import{a as tB,c as FZ,m as xPe,w as Ctt,g as nv,i as O8,T as DA,s as SPe,D as wPe,l as Ks,O as BR,b as Att,C as QN,R as Mtt,u as Pf,d as GO,r as Itt,B as sz,e as Tp,f as Jg,h as hc,j as Rx,k as bPe,E as zo,n as _1,o as zO,p as Ltt,P as EPe,q as Ptt,V as one,t as TPe,v as bv,x as sne,y as hM,z as Ott,A as lne,F as Bg,G as sA,H as UO,I as pp,J as une,K as Rtt,L as BZ,M as Dtt,N as GZ,Q as CPe,S as zZ,U as UZ,W as VZ,X as lz,Y as Ntt,Z as ktt,_ as Ftt,$ as Btt,a0 as APe,a1 as Tde,a2 as R8,a3 as d1,a4 as $Z,a5 as Cde,a6 as D8,a7 as Gtt,a8 as ztt,a9 as hne,aa as uz,ab as N8,ac as Utt,ad as Vtt,ae as k8,af as LF,ag as $tt,ah as e3,ai as MPe,aj as Wtt,ak as Htt,al as jtt,am as Xtt,an as Ytt,ao as t3,ap as qtt,aq as cne,ar as Ztt,as as WZ,at as fne,au as IPe,av as Ktt,aw as Jtt,ax as Qtt,ay as ert,az as trt,aA as rrt,aB as sp,aC as Hx,aD as E1,aE as Qb,aF as rB,aG as Ade,aH as nrt,aI as irt,aJ as art,aK as ort,aL as srt,aM as HZ,aN as lrt,aO as urt,aP as hrt,aQ as crt,aR as jZ,aS as Mde,aT as RW,aU as dne,aV as frt,aW as drt,aX as lA,aY as Ide,aZ as LPe,a_ as vrt,a$ as NC,b0 as Lde,b1 as prt,b2 as grt,b3 as yrt,b4 as mrt,b5 as _rt,b6 as PF,b7 as OF,b8 as PPe,b9 as xrt,ba as Srt,bb as wrt,bc as $b,bd as T1,be as jx,bf as C1,bg as OPe,bh as hz,bi as brt,bj as DW,bk as RF,bl as Pde,bm as Ode,bn as Ert,bo as Trt,bp as Rde,bq as Crt,br as Art}from"./VehicleMovementControlRefactored.a43df089.js";import{z as at,A as Nd,B as Mrt,_ as rf,r as un,v as ul,C as P0,D as Af,F as i_,o as qr,c as hn,l as fe,G as cl,f as Xo,H as Dp,I as Np,J as lu,K as kC,x as mn,j as Bs,p as kd,q as Fd,L as PS,M as qg,i as RPe,N as Dde,n as NA,y as vne,O as Sp,m as a_,P as Irt,Q as Nde,d as nB,e as Mf,R as Lrt,S as XZ,k as uA,T as Prt,w as kde,U as Ort,V as DPe,W as Rrt,X as Drt}from"./index.bba5ce79.js";import{l as Nrt}from"./vehicle_type.9e72c0f2.js";import{g as krt,a as Frt}from"./manager.386efea2.js";import{l as Brt}from"./intersection.ab3021ee.js";function Grt(n,e){for(var t=0;tr[i]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}const pne=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return F0},get Circle(){return JHt},get Ellipse(){return ejt},get Image(){return rjt},get Line(){return ijt},get Marker(){return sjt},get Path(){return Ise},get Polygon(){return gjt},get Polyline(){return mjt},get Rect(){return wjt},get Text(){return Ejt}},Symbol.toStringTag,{value:"Module"})),gne=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return lg},get Circle(){return Ljt},get Dom(){return Ojt},get Ellipse(){return Djt},get Image(){return kjt},get Line(){return Bjt},get Marker(){return zjt},get Path(){return Vjt},get Polygon(){return Wjt},get Polyline(){return jjt},get Rect(){return qjt},get Text(){return eXt}},Symbol.toStringTag,{value:"Module"})),zrt="/airport/assets/light.32436962.svg",Urt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAvCAYAAABzJ5OsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA3qSURBVHgBzVl7jF1FGZ+Zc9+v3W63u2wftqXFPkKhsdgC4VFQNETFfywkEokSIMESY2KoGv7AYvGdAAkIIaK89A9qU/1DUKi2JVoeTQEtu33T1z7a7d3u69573jP+vjnn3Hu2++hWGuK0s+fMOXNmft/3/eb7vpnL2UUoZ5QqVivsFq7YEm6w1VKyJqbYHMbxVzHOOevBtYcJ1oXuu4Vg++bleA/7mIWzj1FODqs10mDrlWRrJumiYnPU7+nG4Gyb8r2t85uT29j/WC4IvFJK9z804K5Op5LrJWOrwzH0C3XOgLo/hz2ia2xS1bjvTTL27TklfiD2+OKDf3tgoDTLaF6vOP/GuJeQhIk4rKmmVOOeKV++5M8QTy7lfJRNs0wXPP93d21OOpd6DhSeTSSGNvXXSkk0haIrdfR9yZTn8Jaddy6eYZ9KQeWsL3epaX/uxY981+eJZFLWv2MiHCWQHgbqdZTzrZWtuWmth2mB/+BkbY6RNZ5jSnQ0yBFeuf6nmMR/qbgQXF1+8NYrhvdXWUJI/b2nuCpeNkN1Lvlzp/7ACCmkrRWbCG3JZZ9pVe65eu7MHnYeM04KnvhKGt5+aGBOqZB/lgveMearCYb1PJcX33pwwZzKeyURro96MYTqLN7Wz1d/55QB7XP9nk+IhtaBaY/ed+281l42hQBishcArl5540gpm8s+4zHV5krpU3XAC9cP7uvPUGu2I0eGBvnSYmfTOOCEwFd8den1dsd1JapypfJdxRrj4N7xlB7b8WV7Ill45tW3DxXZFAqeFDxpvmNJ+z2+Ym2er2RQpfQk88O2vrr1575ceOjBRSM99sTKgAJHT1iquPuHCyzbI5DSw4eeghA0Bt1DiGhsx5Ptxdkd97LIvSo1bfBi64fHl3qcf83B4KjSgTtwtKboqoKKexfvK6alyse7UvN4d97gk9NUgNEril0zqsMD3HY9qccGUi+Yw3fDK+ZSdA+Lr3vtw75VIU4+JfjQj1MVhULLJq2JyKw+aYjAMg9Xeia1qfHMhyBrK48urQ247HxltNdSVx7dsMz2QB9om+jj0Fg+VWpr63r6irlELvfNEJM6V/tjwBPP161bJ7Z82Hc96DLLIVp4UgXASQhNGUX3RBXH86Rtu7K6f0cxVxlMJeJaR54gR04yOdqt76OCyMovMU7nhnsOp0zbUo6mDIBLX4/vh3T0gzkRvPmK3+/+aBX5Y3aO9kVM67q9efNmLpLpWzQn/YCTuMVYTAMmrUMjxHVy6b7lOmpd7tfLvZoXVwNTtX5WuP8QK9zbxVT11Jh5q2WX3Wr+6ApaPzQ2zeH5TM+nLYrq6Lm01WW+qelOwqbjyySa15T52StvzJaCryFTOpI8gB6ItI82tAFlOKQVvK9Ztsrs39xmnqqNNaF0WfqaHzCeyDKeLrH0jZvwrLGQE0KxzMhI0jy4s1Stmiy0rF78BNom7dfnIvrwFet/8mTTww8/zOPUEQ3GaKlEU3vHYlBF0sdeXSuBBvxAI9C9L224POLoV1q3LsHL8a7Rq2JUQSPjfrwHsqseu6P47Aqfc88OLawr5vXrFkCs9oN1d+XaL1yzc+dOwWPqT0SUIU4tXrxYJLL5y2kwLRXCfoAkAKeorXTUFK5ts0X7H19cdWsTRhvlVBpNdzQQJFbAfeb2jYpU38uzK8vu6EmkM5iT+kg9D0bgwA9cCNOEIpVYuGPHDt0hxKtEqHY94OHDhw0lkvOJy05gQqW5J1m4WEn7Slm2TVqRN3a8P59NEJA0ULuRXym3xiaKNRiE3z7n1WWkXduhwBU4BbIoPJFeU9rqmJeJzHJS9tq1a0n7wQKNOLR8+XJyCQbM2BK6LJgLi5MGCtylJLdo00Tg1VUHH1o5eqw6qVNXzkhM8wR+fEghcSrHTbWw67ElAC+D6B24T0/zXeNQnnafMkuDjI6ORu48oA01urq6uAbP2Ezink7AQ8l4bJF4tiPs0UGxauaJtmofm7gQz63hhiBulU1aQMkvzv/Pgr221YU8U1Hew8L59CV0v5wbLYTPNE0e0qYeuXRgouox7pHUbiNUay8QVFgBOvnS8KY1w702m6ooO655c9J+NPHI8Zq6/sQjn4FFldZ8OB+5Z1BHRngIPJRcX7R1/tA4hULBcHTw0b4W4TqqiIIAXa1Uea17f+7Tqf7mBJ960yErvY376mltjcmKgcX52bbuS6zRsrAsR0U+3obmnHripgi8mDt3rlY2aT+ueV6pVLhlWgO6M0VWLxQkSsi48O9OPXWtOeCef7vmO8z6xwZm/3MTk+XO83av9Fjqrsqj15H2vXqagLk9X2MwTatMGLu7u7UWeBhyY9tJxk3PqXlBkuSRtGHE803LYuzoruY2NZxD8nX+TQw0Q1GW2YMsdK9TFkob5qTONnnlIxnTtnViRhgcneMoHx5uIJ/Pa2XD4+hcR7sANPQAeMmGz5w+QhyLKvHOBQFp5W+45KUbnBFvWptko+1ylv3y8yx9869Ycunt0xIAiZ36bu7xm/UeQafIlOMw7XlGBsu91ape+Bz+XvfX4KMGvSz3dPcBKGWLfrBwiDquzB7b3sqGaoaY1tYR8olEo5kusukcDJBFi7VKmh1/d4aLDYvO62m9YRWf3N95rDE4a4APH+j61gtPHKAV7upKaYAjTdtR9xmbr/FMf5obds78U+8z66/3M2v795n7wW/GZJZTFbvis687L6+x4fMsEBebK8rr1dF3t1N2N8Z8ichnhuBl/4G95vBA+USuuWUuxWgk74ZnmapZ1HLqAk5VeKoAAfboUXm2ZdrfYf/OL81WSlathrwu7yewea+UTx3Y+5fNgxFGFqQIXMSAq2KxSLtuv3Pbll2aNpDeReSzbZO7LOFdCPhQhCld5ETFhxfsttJVLFCkIY6ywfyP3n2zU78KgAeBk3Kb6BRswYIFyjAoO+D+nt89cWJkoL/HgdsCbRTclPpp3w27ks1JFT/5utgFaZjKt6f5z4due9OGd3Np7mp1eNdTjxwKwdcF0H4+DFLq2LFj/tDQkI/w6zmO4x1+fetu2nRQ6os2e8+/9PTGzqt2VY20HQhwkSv4YibSzv3vXL+tx2+C5i0drN559pevEx5g9GbNmuXHND/Gc9CKSqPmUQuoxc8/+sKNTfMXrrAGy6naQH/WHipnHLNmIAU04H1FeGoUnD7JRtYbeEV6QOeUYRKiH+EZjojrR1awOl5Tby6MhDRSaT9VKLmZ5plWtqXNqp06sXf7jx/YkclkBi3LojSVfKUTaT/uAuI5Dvm5xOChrpGOa25ahACXcmqWgBnh9D2hZIBO5/eUvxEAgfQbV1hT4oAJbV1Jo5SUU19fCd2fDtZ0f7RxS/gFnQP6IpWSIpV2jGzexehDe55+ZIe0zREhRBXrEfgtN6SOirTNJhEgaY0M8PLBff1tK6+eiy9SBJpO5OgMQ0FTQhi4T3o8mdST60r3gu4TkhsJn6owUqhGvc0FniUSPkvgW3zDkikCjppzjFyB2DLS+eJjb4x2Hz0L4BWANgHeqdX0RlnGwdYL9ohi48aNqebm5gz4n0+lUiXwrdS8eHn7irs33ISA1aRsy/Ac04AT4DpnjTYjgoe7LBFRhhNNMHm49Yk4FZ9Vb8IQ5g29sTUyGXBRjex7/ok3q71HTnmeN4ROw01NTRXwvYbNkquCc0g1DjwL8gZj3759aUiZRZQrQGoKj8XmRctnLbv3oeu4kcz7rk0kEYjisLgRbQ21SjQLfK5TvvC8U42xq6oLh9MebPVJaOoMKyrXqXX99hf/snoOlwF8OJ1Oj9q2zq011xXtM84555+INjjvZynkOnkMUqDTBwiSz7d1FBfe/sDS0pKVC7WvIqDhDwdR6hI5ASSwihuKpJATbhVZtMAFHTGzoa73j53449P7q2f6qslksor5RjD9aDabrZXLZdo8eKyRCYwHH50Ms2At0KLNoOaggTwEyOE+iz7pmavWNi+863srRTqTJQQ416bdsnYbgRXCA/w4VbRY4eEQa5xum2d6hk5ve+VQ97Y/nUHTBXATVKvRIoXbJo0T8LqHOVfT40ooBIFPgm9p8D6HgbJYAwSeagIWMeZ99Z7ZM9bc1J6dd1kr930OEjR2qlIFv5Ro18LqoOkZeSnv9Mnh3tf+cKTv71sGEli8GM/F+DbmrSFYVkFb5ODMAo1dJI4+myCzmyp2i9ACRCHy/xlYQIOHMGloKAXT0ntRWnJlrrRsVSGzaMWM9CWfKhj5QjaRLaXryrAqFmK9V+s9MlTpOVLp/9uWfm+gxwVoHPV5RAcNHOOauVwOaU2N9o32qlWr3D179nhskpR0qh8XopMobYGwZiNBwmsqFFALERsPnjLBAlxjfg2MKlGAtOkBtItpbCrgOLKBKmnchcadyTQ+HfCRp9AeCAMlWlpaUmfPnk1hEaVBowh8ClZIRFZgjTgRja8giIIgGjj6SvQlUKRtF9qmwEOA7bBS2wuFi4S+MPAxISILxGmkvVGsJsKqBQBARGM3Pna02OoaD0G62PQ72Ds7URun1D4Oe6Pka6yrvVDw5xTBGumDFgSTJzH5GPBYGwIsGLfRIeCwGiV/bkwArWVY14N1JTvHHV6Uosb66kgAog65UApkzaVSiXYdrahtqO1UwWO6tiG803N639za2lrEEUa0fpLQtqGUulBFfiwh6kkctKYFIUAhqDxrZKdU8x0dHTnsGTJxwJSOsEZg/ORK7JxcTx4CEQSKKmusg0i4+IL+ZMH+P5b/AnzHa8MtdL8IAAAAAElFTkSuQmCC",Vrt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAvCAYAAABzJ5OsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA5kSURBVHgBzVl7jF3FeZ+Z87rnvvbuy/au19gGmxQHG5p1gLqN5TRN1aZS06ZCaUKqUqnqH7WqVDVR/iARcksjpCZCVO4/FbQlFZFih9KWBkhNwE54BMgSCGDs2F4be71r73v3Ps9jZvL75p6ze3fx7l4SlGTs2fOcM7/v+37fY+Zy9j60Ca0L1Qr7ONfsA9xityjFOphmGxnHX8045+wSjpeYYCfw+itCsLc3Zfkl9nM2zn6OdnFO36ostl8rdusKr+iWORbO6cTi7Gkt48c2l5yn2c/Y3hN4rbV5//RUdIvnOvsVY7ck3zAP9LIPmvc57JEeWybVi+ejDmN/vbHIT7Xcfv/B/2BqqthrlfZrzv/sXQ8hCROtsFabUr/rnpbqP2WnOPRrnJdZm61d8Pz1kdpGL+s+BAr3E4mhTTNaa4VLoenY/CDOmeKLE7ReCzNkYZx5lmJQZKDRUId/cXNPti1/aAv8axdrGy3feohp0bdIjuTIzT/gW0YawZrWaHmfyGMmTSmkkvfShmvF1Vi9UfnL2wa6L7E1zLgieOIrafjZ01Mbi/ncv3LB+5aMSj4bS8mFJbQMAz52/OlC/9EnezaMvON31GuWjiMhMr6cQD+3dXsl+uTtk+sHb61hqFZaC6vFD1rRkB/Ug/Jf7dnUM8pWEWBVzR8+erbjmh19jwD4hmVCaaW0YQCBzh/8wrU3vTPc0Wg0WEMqY4h3z8RZxraZ5zjs1cE9E/FdX74gleSWsJovc0ES0ad183U+Nnn+4h2fuG17eSUBVtX8cxerfyeE+HTLXUPYWMXcsR0V/+/h3r2HH946W60243kbwYLG24LrfDbLn7jr4InCzl+v0kgrEZmn0+MUGvrmR67J349rGKqZMNoBL/7rjfMf6Cz1/tvie4agWhEVbEv33fflbVtee6W7FsdNt3uPTULFnb7PX/6Tz51r/PFnrmjJWvhPDi6gEMUb85W/+f0b+4Z00+RLJhJLtNKM49RFPt91b6yUpB5Rl6B1bAwdbfjHL1038OpLXfUoujpwpFA1NcXU8DDT1aqhzPJmYa7Zep0NHvn61vh/vtkdyFhHUqpIKhUrFmNOFWsWi2z2zgQT4WcrgifJbr/9dvHom2MfkZr1hlKrKFaagJMAIS7UE4/2bHlzqAcT8ZXMpkZHWf7QIdY5Ps68O+9ken7+qu+R4PNBwD525OvbK+eG7XojQLhH3sW8kubEBTxo5yOvDA9SPGbLmMJbtM6SF8Rjp6b/3hJiT1qY0OMoioygn9r/6b3T0Ka1ClV4sciKR49CCmWsMLN1KxPr1q34fgyl5Ysd6olD33heoDhCgNBN92nOD729/kfXdx/ADclanFcsE4Tfd/hovxL81hBmCxWCCZTdIO0jq1z7Dwc+SM65GnDjaiL5bHpcwydsUEhVK1bj0UfWNcJIweKgK1lb45zow3fu/8qhjnvuuYe3UicFzxMNi471fduIHTRYEec1cT1SjUaobh690M2T+mbFRpqamFiUBX7BwpCt1RpSsk8+83/baC7DfUVdxwBv/O6mfb/7G8ePHxe8JeTYTcU0KbNt2zZh+7kbAww2UiHtQwAuQZnqC892NsDPtho5aQoeY7SUaw4h/mei0C5fuWxl1/dJ206gcaEMUVx767Fjx0zeTvDqJsZEmDNnzlhaOJsl0QVOE8NzSAv1MNRbjz+5MVCKtdUIfPouzrkQbQ2rQ1D57JO9AbiK+WEDJinAUQRiIrMDr9j79u0TacgUKYd27Nhh4WAhhnQRYDIVWaARhQoaV9dNXC6yNuM5adrQhVoZCdKy2hpHGPvP/aSjHgYanYWGPuAOhU2lfMJbLpfTcL7I+RMnTnADnrHuEDyPUGoZvkPser2u++LIYe020jpiuDmdnmbc89oaRqoZmJ/JBkGgF/ILhWh0xa0uwgcsC05rJ1KYxEQ9ZjzWSd2iYsnDMBAhaKOj0Gq7+IemKTnxUokpxHrmuu2OZH4cWY2goZntaicjlGXZpihJrG5ByanTatGScnk+n7coNFF4NBKDdUEY6RoKLuV4cdsIUHxRhqWmrlyBiuy2hhGiccsOAZ4FkYk6GlGnaQHdLCAGBgaMskn7adYyvVKp8Ea9MWVeNplVqQAeE0aRHnG9Omu3ATyDwNQou/I2wZMWx4pdFVJYFEealJj2er0xSRhHRkbSNYHJqC3LScbrcVgjrhPnKMYis2qywIud6yeXF0YrNdHdzWp3383UyAgLHnyQsTY574JuJzZtu4IyhBRnNG6cFXgQNKZyuZxRNiJOkzY0CBdmMB6yuYkrZ2PKbMpQxwykL/zoxg9fyDpOe7SnRAVHnbnuOsYLBdZulPLhG5f6N88iylARqOM4BnUYZVs1PzM5Wm3mD45431QS/Ukv6OHkpZExM7iZ2ZBmmaLSYK7QVeWOQ4XSmiCIKs7evazjpZeY6O1FDFw7SeENfdp2q4EWKCY55kSuYVyG0B0inrx48q3z6efTMaLlhukvPvzAKQJsqGM+APycxwFc5l96rznpiLWpIzo7We7++5m9axcrPP44U2Njaw1hOdfl/3zTbw0hQ1AtE9OcslkWyximO/fys5dZsipemKel0KETNX7qjfrc1OQFKMvUFpIJ+LzAwZbfuWH3sJfL6QiaWRXJ8qS0RoZFGNPDfmHuTK5UwViyE6zOQV0oEJyZvTJ26o1vH5lJMbJmicBFWvJSLxQKtFqRbz396AtEHSoTFJkRH8RyOaao86c79z7Tk/WFXGVhTLG9fu+9TL3zDit/9rNM9PSsApyr7nyef37w48/BV1BU2ZGGoiQH2ShZci2HX/7eW6xZDqsEa7O2SXfBtmzZAoxUHXA59O8PXICDjEQ4lwIC2G6k0bnjRZOWG9y9eecPSljCSXZ1ClFyCr/1LTYH3qvTp1dMUqjjVXcuKz51828/hazKuJsNhZuJlWVHSggESy5r5ercsfu/dDoBvyCAifNJ+NPnz5+Xs7OzEuk3RkaNf/Kdx15RpkSA5oUTM9eLhOeTVuLv5krTX9yy6/murM+jZTw0jaiI8Cj6+69KGd1EAeA58Ye7PvrkGGon4fshxkRQVCgtJw5RzMLZ5AsPfvUpYyD03t5e2aJ51krOtESgjGKPvvZisGH33ozXua6X9jlQXWBhGXKQEPaU/Cxy2De6+s/eUZ26xpHSjpsmXDMUgQq6AKuN+fm537v+tmfKoKKVLYROrhDa+Y7QyuZjy/Njbtlq4vTrJ14+dPBtDKME2ajVakEiSLNWWAZ+iQDTJ9+cHdj7B1uZY9vwHUrVGi4MASJGwtSigP9H16azJ11/ak9U7+6xLUdRRcm50YxOPkbnHpw47/ts0s1UP7Pxhuce6h44R7a3crnAzhUiJ9fRgACx5WdD1DUyatTLL3zl88dkvVKFsuqdnZ3YFmpErGUpyJeBJ9BE0Cw6sgvLr9+1p2fwrvt+B5ooqFrVDirzdjg75QWVWVfWKm4cNCwVh4IWLRnkgZ1z06UPzU/19jXmi9sdxzohdXjZ88vPldaPny92zQVhaAkscmwvI62MH9l+PvKKpdApdkReoSu0Mhmk17j6wwe+ePTy0PNUIFXQy6BMfWJiYonml5gZa0Rx8OBBt1QqZcD/nOd5eThSrnvn7q7dB762D/m4IGs1OyzPOkF51o2q866s1xwVBhAgFuicNlVRz2ILEGEERjBHlIXYvIKHCbiMI4Xtos7zY+HnYqdQDN08wGcLsQ3KIL6Uh7524Pj8ydenUZpQSq0AT7Wnp6eOxVLUun+zJCBjjWhKhZmZGY5sC4+Rpkyuj4/KmZNvjPd8+GMbGNWpAv9pUwhLNM0pjArkFAvZl44o+HANpMgNOLcAVliKwQkFKlOKJpaXDa1cR0A8F/lSYOXyEYcwWLGWX/2nL3x/+q0fzsGShufEd+LL9PR0rJtb0kv2+dlVeE8LDxe1Thb1RY60j2s/P7Alu+1zB3YUt994bVSvW6pRs2W97EQ4YoVuySiwGOp+ZHRkNmAX6VaxjYBlYT3hStvzQZcsuO3HTh4cz+RiLFbk7Ns/Hh5++KtvVy6fryUOWsX8Vd/3a5OTk610uTr4dGc4sQjxP5PwP+u6bhbPM+he9+6Pdm6+428/BD/IaVBGhqGQAQQIIUAQYNUeWQgrzQkETQY72RDA9aTwPADPwwoZhagiw5nL0+PP/PfJi/9/mLYcokTbtaQTbYLkvmLLEuNVQ1siBIF3Ojo6vLm5OT8RwncchwRwYBFn0yf+vL80+Jt9bt+WdQoaB3iBUhB7fRH4Lhd+UKCfdCzHJepoC1rmcFY1OTo78tThMxPff3wC2o2RX8IEaAqchGiAxhEKR8muktFXi8sisQBRiAryDBzYB3AfSczD1gTdsyCE1Xn9zTn/+g8WMptu6PR6NhQRRbI8W/SQgM1vUbpSwf5HHDbGLs5UR8/NTz//7StyetyEPSiJjkjmHIEorGezWYrnRJtgcHAwGhoaitnPsMWd7kTZiQDU/VSQ5OjCEjaFawgBZtjpysykVdzDCtA2CweqzXFOxzTF0zEGHQ1wauB4HYGCNB5B4+FKGm8HPE88m1YuFj5kd3V1ufB6F2b2YGYDPhUAYc3C0cKRkxAJ8FQAAm2cDe/Q6oxARQQc2k55HrBFfseJcAbKewbfIkRqgVYamWjU0u2k03MBgIKEaPlM6mwLGk9ARlj0h1g7h+k1dqnlkSNH0uKLr7b0fE8/ZSYCiBagDiZ3MPkS8PANARa8a6FDwGE1Kv6iFgGMlmHdGNZVbFk4fF+aXrrBmgpA1ElLiVKxWKSNISreaT97PXXwmI7rsFag+/S8hGxZwBZG6j8OtG3ptTZw32chFoo4aM0IQoASULmk55Oe6+vry2LNkGkFTOUIW0yMv7jWsnw0kydABIGizhb9IBXOUOqXAvZXsf0UJdYANhEG1sEAAAAASUVORK5CYII=",$rt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAvCAYAAABzJ5OsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA8ZSURBVHgBzVkJjF1XeT7n3HvfPmtmbM94TWzHjpckJjSJmzoxiFCBCpXVRoiklQC1tE2kCkFVqTQiRqURlYJQWtRC2qiiNAnFTYCACeBEHlvEhJhxQryQ8TJxPJvtWd+85b67nHP6/efe++bOeGycpVWPdXzfvWf7/v98/3LOcPYulHGtW2pVdjfXbAO32K1KsTam2XLG8b9mnHM2gucIE+wEuh8Wgv16ZYGPsHdYOHsHZaisb1MWe0ArdttluujUGs3f9MPi7Hktw++ubneeZ2+zvCXwWmvT/9RkcGs24zygGLs1nsM06AUTmv4c+5E8U4vqud+jDmP3L2/lA6nP7z74lyYnW7ut9gc05398SSMkYSIN60pL6ku+aam+JTvE1zZyXmFXWa4WPP/VcH15tpB5HBTuJRJDm2a01gqvQtMzmhC/meJzC6TfhRnSHGfaEgyKNmjU1/4nb+4qXJU9XBX4V4fqy6289TjTomeOHPGTm3/At4A0gkW7kepP5DGLJhRScb+k4F1xNeY2qn9y+4prRthv2MbLgie+kob3n5pc3loqPsYF75k3Sl9hRs0uIXa8TdHcAM9j+7lkbPQYdb3Kp397ZdfoFVa6sua/s+9M26pNPU8A+DJ6z1ePF3pO/u1aKxjPsHe5yEy3P7b+78+4pc11A4zzsYmzQ/d9+Pb1ZAP6LYEnzf9sqPZZIcTHdPx+/Wu7bnSCiYzVdj3jdovpp9xRpupj5rco9DCR723OcaW2cLI/AuC0mDZZPskCp8s/ddP3fgVlwSSwOUr9145Vpa/SVFjfBIx0sdniRXz32JsbOtq7/xCopQxDoVSoCbjddQtrueOxSFtYcPalz4Q0T37jn7Hchk/PaRJtlRej93SbDiqsfuwRxiZJoF4zF4Gf7fs4Y+WTGTfwlbAEHJcFC9D3PHds7OCHtvT0x9rXlwWf8JzAl0qdXwqVkgoaAHjme415YvvnfgAQX2EsqFwCPGkjoAuBk0AkGO0eASfNmx2Id7Jed1k2l5PCigxbFAqfwOcji2k/beum8z333COePja2Q2rW7UutvDDQrheoWt1tSt048ySrvbLbgClu++I84JdrU/XRJvDMqo/MA24ECyP3XndruuH72gtDFYQKwZtvfeLw4C3kj9kCmouU1s37nj17uHCydwfQeSil8vGj4XnKdeumQzjRz1xolRZu3fkUgPxeczL39W8s2rYQeHHb7nnAaRy1UalW66zeaDBaP8DOo6piW9t9hO1KnKcW/uXv7OtVgt+GsYpcdxhK5gWeqLnunMQprialfvQR5g0+dUlbApwMdyG9EuCNgcfmdq7R0E6+JLkTKscW4Inxu1sfePhrbV3e+PTu3bt1IkSi+SbX25b2rMN2KeyYJM5T9aAG3w/UYsCJHrVXHloUeGK0vwk47UKyEx4W90JfByHWxNq+jDDctPOD2w8cOCB4Sv0iTZl169YJO1/c4oEuAVUon560C34YRp3I5aWAEzj/3A+NAbbufPJtAY/4XzLffUCFrrCq1rQ+VpW+YpJl7Gv7+voM75ME0Y7VbgaePn3a0sJZLdE5pA7IPwIaLDUnTbBUaErTgXhc2PK5pvbS3qaw9a9Y9rqPXxE4CZ6UAE6CFOZB27aUGrmeMvmPyG0ivDt37qRkKjTgE/ezadMm68SJE5bkvFOT3NGOcHCeh/ggmbYWA55de68BnhQCTt6GCoFS/qwBe2EmUpByR9BnL6mMOb23sJlf9+F3H3MqVVbACjFdza4j1wHQKEHC7udp4yuVirFN+pYYLAdw+mBJxq6B1qVJwFECrYUfQghMGgEfQ0C59xIfntZoUog6VL/xU8H2vpYPrFwuiFo64x5HTaWFG7P1wpfv40wuxUIUWgx4JVnMCs4tGmS5rssThduxFFSJTyJkULTSJnNlYAq2kKKDhB1ZidapLKTDQuC0I1ZrRIfvP/x37P2fefBn3eu3lCMkscZAX9IrJWm//PbXN75w9LmNwRIpfVBUSKxuKWXhXElnyTipI3YkRqttPnfC4aVSyfIppgI8QgLyC1AmhAAhuE+aiAsFn4X+nYCTtyGqBGN9zCvdwl4bZOzgwYOmjygUPeyi2T0CQtHHeIsodcaS0fwIjjBSbXw8uKKlIHzNdFusWLGCDw8PG+2nNc+r1SpvuI1J4TgdoJo5PvvIjwJMgUnNwpTbpIEv9O+H9z/J+vYJtu8rf82srtUX21avH0e3zUQ70mhT8dGBBubIjS+Pogo4D4OFiySlK9pyBhmoQQbBFI0i4NFwzgl8OuvmbujXs7bdaigiFZFPwNsg0smmwSaF/Du5SQJevW43++S9f86mqvXaki13v3HzX37obMuyVVXIzocOPb85NG4vtiUVORBq4ya3h/tQEQ5FPyWX8DoSFqmikxrXnudNFotFUavVODwOh9uMDBYvDC8Mjaw8fuFM5/I1S8zuKtAFewplwPHqJm3IWKu/+JxJaxONv/ryAKsw58KOL/zrC0YToENIB6yIKNAo6ABrwsnPnJjIEdM5DBODOYIWM+C1ZUsf3s1ICAnAXzNmdnpiFMDN1ITVsID+S16ocWJkeKy0bKWMwGthgkWguU/kZ5fPDKvVfkNlH9o12alOjnqRzGQzHlEhTmxFdJhVkePQRO+INnBsQnNKypRCIk5GjcFs6PXjZxPdJUq0Ux9M/fk3Hx1YuW27WRJ60vDzAvtIzIsMKk6gFgamaBJtQBobBJbmMZbGwSJDChfC6JlF8drQXRNvVAyK1jH0InkwSJCjR2b8xsv7z6emM0XEqUEigLo4cNQtT06cM1kl9hSTyThwNDuSf1+YGcrygHFoxjBRK8NvFExmKCPVU9SkUE/vnslYFfoMFpEOUEw0B4cmeIxHf+2buZSeuTA2cHTvnukEY6Qbze04NTBab2lpAUUCefz5pw/dtOtTf0Cf4ToZTRAQOVl0bFs0T4HHUY0lmcrQYPHs01+/q3FxeJldbKn27Nz1EvWpnh8uEnCyvrA244w899T2pE/X7Xe/EtbrDnMot4GVKOOulUUSWVwPvnzwOMkVAzdCEtfs5PS0Zs0aPTMzg0NTKPv//dFz19750eFcR2evJF8vzRYYDabzkCZw+Pjt+Pztfuea1//lwY+13vDe19bd/6VnR370xNahvf/xAer35n//84fT44prtwxsuv/hZ8f3P3P9+Ree2UnfluzQ7JSxMdhXlpMZKFmrVfq++uCpGHxTAGKMiIOUPnv2rCTwCL+h7/vhyR/vOUwBIyDKUNCIwZPBJoVcZRJVl27/Invme99nO+68i2XX3DDiYVxx3ZZhavv5L16eV02fFWtHaDcLG7eZC6YffV6y+wDenKBgApQa09qH/u2RH5OJUO3u7pYpzc8zWBVLRh2DX37rH4c7tm4/1nHtuq10oiIu+tzxMuWT2fK+5IQU3QwQlbyhZ039yIYxdug/j9zhT5xvqQ8c2bjrjmLzIJ6U9605zw7tqb1XNuoZ9/Tx6z5wY2SHVV6axS4jNSAL03Jy4NXjp/Y+eZHwEK7x8fFE86akA086xyGh7OmBY+Xe3/ngdWBSNnTr4kLnb53czI6tyYRTWR1U50Yq3whCdUmxwrqLXtaZGlx16+pa4RN3es22pK5ojftMos/K2ZY/uhO6sx3vcfYXP3hz2vZ5JhtKP6i89A+f3S/dag2cdTs6OnDIagSxgnUCOA2eQFPWXkAlV9Laufk9S2/+08//rnQbHY2Zizm/Us4Ebs2BI0b2IwUFTC6Esixbi2w+tPLFwMnkQu7YcLXIrvxA6DCwTLJnWQqpB642bG1ZjsI9N1xLiBkQeOFCLYzLtLT73M6Ujz7+8E9mTrxyARQmLVVAGRea92JmRAejFHj90EMPGaNob28nCb1MJtOYOn5k+sg/feFA0KhXFLdCLRC3qFpUrQChFKYhVIgnbXnoB3Tm5b7nMa/hszDw8bvBfN9lfqPG/XqV+zgP+56rfTpo+x6jU1oIV0SXBV4F4e7Rvzk4ffxIGcB9wkF42trajNZTrn0ebRjOiCZVmJ6e5pRDOI4j4H2sxvQ4mx08Md16w3uWaWHbFPXNnQpCObY7ZHgK25H05Da+0YURp+BMAZUuv+KIRCFJoE0g8IgoxFBqRqkXdzISyVf1xDcfebE+dGYS61ZzuVwdzzrxZWpqKtRRojPvnp8twnuH6INcp4jBLXC7bfD/bfnO7s6e9+/a1LJ6wxoZBqBMdJaMIqmljUA26ANKIFnUgMcV/ZK4cSN6CJwyARr00QSe6GMWRf5SPnn03OhPnnrdLU/NQGllrDeN5Sv5fL4+MTGRpsvi4FM3ZlbM/xxqCfQpoa0NlZ7FlvVbO5f//qe2OrlC3gwUtiKgNLsgAcBfkzzimxFMUjJJOjZIAdqKAODZuDhaHn/xh2fGDx+g1LkO4FVgmLUsqwq3TXxvsMjbKLbgum/Ri9ZYCALvtLa25qCFIiYqYeIigaddwY44ve/76LK2bXd151au7zLgkmTMJIlRZmkyF0pekm+0KAzVuzA0e+GnT78xcfiFyWw2K5HyNjC/C8ErqFUorI6I38CNRoDEUbJFboqvdMUt4h0wAszOzhawSB40IE+UgWbyEIBsQrSvu7FYWL+1kFu7paOwbEWJ50o5u9SeNX+Jwl9NVHXGU74XukOD5drI6crUwb3jcnY80Sb4xIkWPkDXQRUX/K739PQ0ent7g/7+/pC9jSvu5CbK7AABLhQK+Xq9nsXvLLRElCK3aqGvRULYts3T8+IbwzeW+o0s1aTWpmIOExABukECQCEueTg4jACOw7+cxq8GPI8tm04uFiayOzs7M9BKBkaUBY2yMfgMQNiglhXvVhLokvl1DNoYG/oqSv4INIAG8Ia0A8RrL64mmrIoGBkobxl8SohkB5o0imsmVe24GgHIxQJgeu7E2OalIFRx6PdxdvaTd9xSS1z2JskXT7vGtwx+QRFsLn0wgmBxB4vPAw/bEDDARPs6VSV2jZK/ICWA0TJ2N8TuKrbIHxHecdHz/wCWCEDUSVKJdhg2XQx1odIZeClVGCA9l8Bz0Hdqb+/q6mrBFUY+Hu9A25Ze7A9s73ZJLdJM4qA1IwgBikEV41qKaxHeo4AzQy4NGOlIYiP/+8AXCMFSQvAYiCBQVNmcHSTCpQ36/xbs/8fyP6oaQOYVoYvQAAAAAElFTkSuQmCC",Wrt="/airport/assets/count4.577debcf.png";var Hrt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),jrt=function(n){Hrt(e,n);function e(t){var r=n.call(this)||this;return r.map_=t,r}return e.prototype.dispatchRenderEvent=function(t,r){tB()},e.prototype.calculateMatrices2D=function(t){var r=t.viewState,i=t.coordinateToPixelTransform,a=t.pixelToCoordinateTransform;FZ(i,t.size[0]/2,t.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),xPe(a,i)},e.prototype.forEachFeatureAtCoordinate=function(t,r,i,a,o,s,l,u){var h,c=r.viewState;function f(k,D,G,W){return o.call(s,D,k?G:null,W)}var d=c.projection,v=Ctt(t.slice(),d),p=[[0,0]];if(d.canWrapX()&&a){var g=d.getExtent(),m=nv(g);p.push([-m,0],[m,0])}for(var y=r.layerStatesArray,_=y.length,x=[],S=[],w=0;w=0;--b){var E=y[b],T=E.layer;if(T.hasRenderer()&&O8(E,c)&&l.call(u,T)){var C=T.getRenderer(),A=T.getSource();if(C&&A){var M=A.getWrapX()?v:t,I=f.bind(null,E.managed);S[0]=M[0]+p[w][0],S[1]=M[1]+p[w][1],h=C.forEachFeatureAtCoordinate(S,r,i,I,x)}if(h)return h}}if(x.length!==0){var R=1/x.length;return x.forEach(function(k,D){return k.distanceSq+=D*R}),x.sort(function(k,D){return k.distanceSq-D.distanceSq}),x.some(function(k){return h=k.callback(k.feature,k.layer,k.geometry)}),h}},e.prototype.forEachLayerAtPixel=function(t,r,i,a,o){return tB()},e.prototype.hasFeatureAtCoordinate=function(t,r,i,a,o,s){var l=this.forEachFeatureAtCoordinate(t,r,i,a,DA,this,o,s);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){tB()},e.prototype.scheduleExpireIconCache=function(t){SPe.canExpireCache()&&t.postRenderFunctions.push(Xrt)},e}(wPe);function Xrt(n,e){SPe.expire()}const Yrt=jrt;var qrt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Zrt=function(n){qrt(e,n);function e(t){var r=n.call(this,t)||this;r.fontChangeListenerKey_=Ks(Att,BR.PROPERTYCHANGE,t.redrawText.bind(t)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=QN+" ol-layers";var a=t.getViewport();return a.insertBefore(r.element_,a.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return e.prototype.dispatchRenderEvent=function(t,r){var i=this.getMap();if(i.hasListener(t)){var a=new Mtt(t,void 0,r);i.dispatchEvent(a)}},e.prototype.disposeInternal=function(){Pf(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),n.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(GO.PRECOMPOSE,t);var r=t.layerStatesArray.sort(function(d,v){return d.zIndex-v.zIndex}),i=t.viewState;this.children_.length=0;for(var a=[],o=null,s=0,l=r.length;s=0;--s)a[s].renderDeclutter(t);Itt(this.element_,this.children_),this.dispatchRenderEvent(GO.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)},e.prototype.forEachLayerAtPixel=function(t,r,i,a,o){for(var s=r.viewState,l=r.layerStatesArray,u=l.length,h=u-1;h>=0;--h){var c=l[h],f=c.layer;if(f.hasRenderer()&&O8(c,s)&&o(f)){var d=f.getRenderer(),v=d.getDataAtPixel(t,r,i);if(v){var p=a(f,v);if(p)return p}}}},e}(Yrt);const NPe=Zrt;var kPe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Dx=function(n){kPe(e,n);function e(t,r){var i=n.call(this,t)||this;return i.layer=r,i}return e}(sz),NW={LAYERS:"layers"},Krt=function(n){kPe(e,n);function e(t){var r=this,i=t||{},a=Tp({},i);delete a.layers;var o=i.layers;return r=n.call(this,a)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(NW.LAYERS,r.handleLayersChanged_),o?Array.isArray(o)?o=new Jg(o.slice(),{unique:!0}):hc(typeof o.getArray=="function",43):o=new Jg(void 0,{unique:!0}),r.setLayers(o),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Pf),this.layersListenerKeys_.length=0;var t=this.getLayers();this.layersListenerKeys_.push(Ks(t,Rx.ADD,this.handleLayersAdd_,this),Ks(t,Rx.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(Pf);bPe(this.listenerKeys_);for(var i=t.getArray(),a=0,o=i.length;athis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Pf(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(zo.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Pf(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Pf),this.dragListenerKeys_.length=0,this.element_=null,n.prototype.disposeInternal.call(this)},e}(TPe);const int=nnt,Zu={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var F8=1/0,ant=function(){function n(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return n.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,bPe(this.queuedElements_)},n.prototype.dequeue=function(){var e=this.elements_,t=this.priorities_,r=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},n.prototype.enqueue=function(e){hc(!(this.keyFunction_(e)in this.queuedElements_),31);var t=this.priorityFunction_(e);return t!=F8?(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},n.prototype.getCount=function(){return this.elements_.length},n.prototype.getLeftChildIndex_=function(e){return e*2+1},n.prototype.getRightChildIndex_=function(e){return e*2+2},n.prototype.getParentIndex_=function(e){return e-1>>1},n.prototype.heapify_=function(){var e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)},n.prototype.isEmpty=function(){return this.elements_.length===0},n.prototype.isKeyQueued=function(e){return e in this.queuedElements_},n.prototype.isQueued=function(e){return this.isKeyQueued(this.keyFunction_(e))},n.prototype.siftUp_=function(e){for(var t=this.elements_,r=this.priorities_,i=t.length,a=t[e],o=r[e],s=e;e>1;){var l=this.getLeftChildIndex_(e),u=this.getRightChildIndex_(e),h=ue;){var s=this.getParentIndex_(t);if(i[s]>o)r[t]=r[s],i[t]=i[s],t=s;else break}r[t]=a,i[t]=o},n.prototype.reprioritize=function(){var e=this.priorityFunction_,t=this.elements_,r=this.priorities_,i=0,a=t.length,o,s,l;for(s=0;s0;)o=this.dequeue()[0],s=o.getKey(),a=o.getState(),a===Hi.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,o.load())},e}(ont);const unt=lnt;function hnt(n,e,t,r,i){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return F8;var a=n.viewState.center,o=r[0]-a[0],s=r[1]-a[1];return 65536*Math.log(i)+Math.sqrt(o*o+s*s)/i}const Jd={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var FPe=256;function Fde(n,e,t){return function(r,i,a,o,s){if(!!r){if(!i&&!e)return r;var l=e?0:a[0]*i,u=e?0:a[1]*i,h=s?s[0]:0,c=s?s[1]:0,f=n[0]+l/2+h,d=n[2]-l/2+h,v=n[1]+u/2+c,p=n[3]-u/2+c;f>d&&(f=(d+f)/2,d=f),v>p&&(v=(p+v)/2,p=v);var g=bv(r[0],f,d),m=bv(r[1],v,p);if(o&&t&&i){var y=30*i;g+=-y*Math.log(1+Math.max(0,f-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-d)/y),m+=-y*Math.log(1+Math.max(0,v-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-p)/y)}return[g,m]}}}function cnt(n){return n}function yne(n,e,t,r){var i=nv(e)/t[0],a=hM(e)/t[1];return r?Math.min(n,Math.max(i,a)):Math.min(n,Math.min(i,a))}function mne(n,e,t){var r=Math.min(n,e),i=50;return r*=Math.log(1+i*Math.max(0,n/e-1))/i+1,t&&(r=Math.max(r,t),r/=Math.log(1+i*Math.max(0,t/n-1))/i+1),bv(r,t/2,e*2)}function fnt(n,e,t,r){return function(i,a,o,s){if(i!==void 0){var l=n[0],u=n[n.length-1],h=t?yne(l,t,o,r):l;if(s){var c=e!==void 0?e:!0;return c?mne(i,h,u):bv(i,u,h)}var f=Math.min(h,i),d=Math.floor(sne(n,f,a));return n[d]>h&&d1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var a=0;a0},e.prototype.getInteracting=function(){return this.hints_[pp.INTERACTING]>0},e.prototype.cancelAnimations=function(){this.setHint(pp.ANIMATING,-this.hints_[pp.ANIMATING]);for(var t,r=0,i=this.animations_.length;r=0;--i){for(var a=this.animations_[i],o=!0,s=0,l=a.length;s0?h/u.duration:1;c>=1?(u.complete=!0,c=1):o=!1;var f=u.easing(c);if(u.sourceCenter){var d=u.sourceCenter[0],v=u.sourceCenter[1],p=u.targetCenter[0],g=u.targetCenter[1];this.nextCenter_=u.targetCenter;var m=d+f*(p-d),y=v+f*(g-v);this.targetCenter_=[m,y]}if(u.sourceResolution&&u.targetResolution){var _=f===1?u.targetResolution:u.sourceResolution+f*(u.targetResolution-u.sourceResolution);if(u.anchor){var x=this.getViewportSize_(this.getRotation()),S=this.constraints_.resolution(_,0,x,!0);this.targetCenter_=this.calculateCenterZoom(S,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=_,this.applyTargetState_(!0)}if(u.sourceRotation!==void 0&&u.targetRotation!==void 0){var w=f===1?UO(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+f*(u.targetRotation-u.sourceRotation);if(u.anchor){var b=this.constraints_.rotation(w,!0);this.targetCenter_=this.calculateCenterRotate(b,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=w}if(this.applyTargetState_(!0),r=!0,!u.complete)break}}if(o){this.animations_[i]=null,this.setHint(pp.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var E=a[0].callback;E&&DF(E,!0)}}this.animations_=this.animations_.filter(Boolean),r&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,r){var i,a=this.getCenterInternal();return a!==void 0&&(i=[a[0]-r[0],a[1]-r[1]],une(i,t-this.getRotation()),Rtt(i,r)),i},e.prototype.calculateCenterZoom=function(t,r){var i,a=this.getCenterInternal(),o=this.getResolution();if(a!==void 0&&o!==void 0){var s=r[0]-t*(r[0]-a[0])/o,l=r[1]-t*(r[1]-a[1])/o;i=[s,l]}return i},e.prototype.getViewportSize_=function(t){var r=this.viewportSize_;if(t){var i=r[0],a=r[1];return[Math.abs(i*Math.cos(t))+Math.abs(a*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(a*Math.cos(t))]}else return r},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t&&BZ(t,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(Jd.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var r=this.calculateExtentInternal(t);return Dtt(r,this.getProjection())},e.prototype.calculateExtentInternal=function(t){var r=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();hc(i,1);var a=this.getResolution();hc(a!==void 0,2);var o=this.getRotation();return hc(o!==void 0,3),GZ(i,a,o,r)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Jd.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,r){return this.getResolutionForExtentInternal(sA(t,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(t,r){var i=r||this.getViewportSizeMinusPadding_(),a=nv(t)/i[0],o=hM(t)/i[1];return Math.max(a,o)},e.prototype.getResolutionForValueFunction=function(t){var r=t||2,i=this.getConstrainedResolution(this.maxResolution_),a=this.minResolution_,o=Math.log(i/a)/Math.log(r);return function(s){var l=i/Math.pow(r,s*o);return l}},e.prototype.getRotation=function(){return this.get(Jd.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var r=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),a=this.minResolution_,o=Math.log(i/a)/r;return function(s){var l=Math.log(i/s)/r/o;return l}},e.prototype.getViewportSizeMinusPadding_=function(t){var r=this.getViewportSize_(t),i=this.padding_;return i&&(r=[r[0]-i[1]-i[3],r[1]-i[0]-i[2]]),r},e.prototype.getState=function(){var t=this.getProjection(),r=this.getResolution(),i=this.getRotation(),a=this.getCenterInternal(),o=this.padding_;if(o){var s=this.getViewportSizeMinusPadding_();a=FW(a,this.getViewportSize_(),[s[0]/2+o[3],s[1]/2+o[0]],r,i)}return{center:a.slice(0),projection:t!==void 0?t:null,resolution:r,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,r=this.getResolution();return r!==void 0&&(t=this.getZoomForResolution(r)),t},e.prototype.getZoomForResolution=function(t){var r=this.minZoom_||0,i,a;if(this.resolutions_){var o=sne(this.resolutions_,t,1);r=o,i=this.resolutions_[o],o==this.resolutions_.length-1?a=2:a=i/this.resolutions_[o+1]}else i=this.maxResolution_,a=this.zoomFactor_;return r+Math.log(i/t)/Math.log(a)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var r=bv(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,bv(t-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,r){var i;if(hc(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function",24),Array.isArray(t)){hc(!CPe(t),25);var a=sA(t,this.getProjection());i=zZ(a)}else if(t.getType()==="Circle"){var a=sA(t.getExtent(),this.getProjection());i=zZ(a),i.rotate(this.getRotation(),UZ(a))}else{var o=Btt();o?i=t.clone().transform(o,this.getProjection()):i=t}this.fitInternal(i,r)},e.prototype.rotatedExtentForGeometry=function(t){for(var r=this.getRotation(),i=Math.cos(r),a=Math.sin(-r),o=t.getFlatCoordinates(),s=t.getStride(),l=1/0,u=1/0,h=-1/0,c=-1/0,f=0,d=o.length;f=0;u--){var h=l[u];if(!(h.getMap()!==this||!h.getActive()||!this.getTargetElement())){var c=h.handleEvent(t);if(!c||t.propagationStopped)break}}}},e.prototype.handlePostRender=function(){var t=this.frameState_,r=this.tileQueue_;if(!r.isEmpty()){var i=this.maxTilesLoading_,a=i;if(t){var o=t.viewHints;if(o[pp.ANIMATING]||o[pp.INTERACTING]){var s=Date.now()-t.time>8;i=s?0:8,a=s?0:2}}r.getTilesLoading()0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Utt(r,this.renderedAttributions_)){Vtt(this.ulElement_);for(var a=0,o=r.length;a0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:wI}):r.setRotation(0))}},e.prototype.render=function(t){var r=t.frameState;if(!!r){var i=r.viewState.rotation;if(i!=this.rotation_){var a="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains(LF);!o&&i===0?this.element.classList.add(LF):o&&i!==0&&this.element.classList.remove(LF)}this.label_.style.transform=a}this.rotation_=i}},e}(fz);const Dnt=Rnt;var Nnt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),knt=function(n){Nnt(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{element:document.createElement("div"),target:i.target})||this;var a=i.className!==void 0?i.className:"ol-zoom",o=i.delta!==void 0?i.delta:1,s=i.zoomInClassName!==void 0?i.zoomInClassName:a+"-in",l=i.zoomOutClassName!==void 0?i.zoomOutClassName:a+"-out",u=i.zoomInLabel!==void 0?i.zoomInLabel:"+",h=i.zoomOutLabel!==void 0?i.zoomOutLabel:"\u2013",c=i.zoomInTipLabel!==void 0?i.zoomInTipLabel:"Zoom in",f=i.zoomOutTipLabel!==void 0?i.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=s,d.setAttribute("type","button"),d.title=c,d.appendChild(typeof u=="string"?document.createTextNode(u):u),d.addEventListener(zo.CLICK,r.handleClick_.bind(r,o),!1);var v=document.createElement("button");v.className=l,v.setAttribute("type","button"),v.title=f,v.appendChild(typeof h=="string"?document.createTextNode(h):h),v.addEventListener(zo.CLICK,r.handleClick_.bind(r,-o),!1);var p=a+" "+QN+" "+uz,g=r.element;return g.className=p,g.appendChild(d),g.appendChild(v),r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleClick_=function(t,r){r.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var r=this.getMap(),i=r.getView();if(!!i){var a=i.getZoom();if(a!==void 0){var o=i.getConstrainedZoom(a+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:o,duration:this.duration_,easing:wI})):i.setZoom(o)}}},e}(fz);const Fnt=knt;var VPe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),BW=.75,NF=.1,Bnt=function(n){VPe(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.createRenderer=function(){return new NPe(this)},e}(UPe),Gnt=function(n){VPe(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.boundHandleRotationChanged_=r.handleRotationChanged_.bind(r),r.collapsed_=i.collapsed!==void 0?i.collapsed:!0,r.collapsible_=i.collapsible!==void 0?i.collapsible:!0,r.collapsible_||(r.collapsed_=!1),r.rotateWithView_=i.rotateWithView!==void 0?i.rotateWithView:!1,r.viewExtent_=void 0;var a=i.className!==void 0?i.className:"ol-overviewmap",o=i.tipLabel!==void 0?i.tipLabel:"Overview map",s=i.collapseLabel!==void 0?i.collapseLabel:"\u2039";typeof s=="string"?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=s):r.collapseLabel_=s;var l=i.label!==void 0?i.label:"\u203A";typeof l=="string"?(r.label_=document.createElement("span"),r.label_.textContent=l):r.label_=l;var u=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_,h=document.createElement("button");h.setAttribute("type","button"),h.title=o,h.appendChild(u),h.addEventListener(zo.CLICK,r.handleClick_.bind(r),!1),r.ovmapDiv_=document.createElement("div"),r.ovmapDiv_.className="ol-overviewmap-map",r.view_=i.view,r.ovmap_=new Bnt({view:i.view});var c=r.ovmap_;i.layers&&i.layers.forEach(function(S){c.addLayer(S)});var f=document.createElement("div");f.className="ol-overviewmap-box",f.style.boxSizing="border-box",r.boxOverlay_=new $tt({position:[0,0],positioning:"center-center",element:f}),r.ovmap_.addOverlay(r.boxOverlay_);var d=a+" "+QN+" "+uz+(r.collapsed_&&r.collapsible_?" "+N8:"")+(r.collapsible_?"":" ol-uncollapsible"),v=r.element;v.className=d,v.appendChild(r.ovmapDiv_),v.appendChild(h);var p=r,g=r.boxOverlay_,m=r.boxOverlay_.getElement(),y=function(S){return{clientX:S.clientX,clientY:S.clientY}},_=function(S){var w=y(S),b=c.getEventCoordinateInternal(w);g.setPosition(b)},x=function(S){var w=c.getEventCoordinateInternal(S);p.getMap().getView().setCenterInternal(w),window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",x)};return m.addEventListener("mousedown",function(){window.addEventListener("mousemove",_),window.addEventListener("mouseup",x)}),r}return e.prototype.setMap=function(t){var r=this.getMap();if(t!==r){if(r){var i=r.getView();i&&this.unbindView_(i),this.ovmap_.setTarget(null)}if(n.prototype.setMap.call(this,t),t){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(Ks(t,BR.PROPERTYCHANGE,this.handleMapPropertyChange_,this));var a=t.getView();a&&(this.bindView_(a),a.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}},e.prototype.handleMapPropertyChange_=function(t){if(t.key===Zu.VIEW){var r=t.oldValue;r&&this.unbindView_(r);var i=this.getMap().getView();this.bindView_(i)}else!this.ovmap_.isRendered()&&(t.key===Zu.TARGET||t.key===Zu.SIZE)&&this.ovmap_.updateSize()},e.prototype.bindView_=function(t){if(!this.view_){var r=new Ay({projection:t.getProjection()});this.ovmap_.setView(r)}t.addChangeListener(Jd.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()},e.prototype.unbindView_=function(t){t.removeChangeListener(Jd.ROTATION,this.boundHandleRotationChanged_)},e.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},e.prototype.validateExtent_=function(){var t=this.getMap(),r=this.ovmap_;if(!(!t.isRendered()||!r.isRendered())){var i=t.getSize(),a=t.getView(),o=a.calculateExtentInternal(i);if(!(this.viewExtent_&&D8(o,this.viewExtent_))){this.viewExtent_=o;var s=r.getSize(),l=r.getView(),u=l.calculateExtentInternal(s),h=r.getPixelFromCoordinateInternal(e3(o)),c=r.getPixelFromCoordinateInternal(MPe(o)),f=Math.abs(h[0]-c[0]),d=Math.abs(h[1]-c[1]),v=s[0],p=s[1];fv*BW||d>p*BW?this.resetExtent_():Wtt(u,o)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),r=this.ovmap_,i=t.getSize(),a=t.getView(),o=a.calculateExtentInternal(i),s=r.getView(),l=Math.log(BW/NF)/Math.LN2,u=1/(Math.pow(2,l/2)*NF);Htt(o,u),s.fitInternal(zZ(o))},e.prototype.recenter_=function(){var t=this.getMap(),r=this.ovmap_,i=t.getView(),a=r.getView();a.setCenterInternal(i.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),r=this.ovmap_;if(!(!t.isRendered()||!r.isRendered())){var i=t.getSize(),a=t.getView(),o=r.getView(),s=this.rotateWithView_?0:-a.getRotation(),l=this.boxOverlay_,u=this.boxOverlay_.getElement(),h=a.getCenterInternal(),c=a.getResolution(),f=o.getResolution(),d=i[0]*c/f,v=i[1]*c/f;if(l.setPosition(h),u){u.style.width=d+"px",u.style.height=v+"px";var p="rotate("+s+"rad)";u.style.transform=p}}},e.prototype.updateBoxAfterOvmapIsRendered_=function(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=jtt(this.ovmap_,d1.POSTRENDER,function(t){delete this.ovmapPostrenderKey_,this.updateBox_()},this))},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(N8),this.collapsed_?k8(this.collapseLabel_,this.label_):k8(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;if(!this.collapsed_){if(t.isRendered()){this.viewExtent_=void 0,t.render();return}t.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){!this.collapsible_||this.collapsed_===t||this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getRotateWithView=function(){return this.rotateWithView_},e.prototype.setRotateWithView=function(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},e.prototype.getOverviewMap=function(){return this.ovmap_},e.prototype.render=function(t){this.validateExtent_(),this.updateBox_()},e}(fz);const znt=Gnt;function Unt(n){var e=n||{},t=new Jg,r=e.zoom!==void 0?e.zoom:!0;r&&t.push(new Fnt(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&t.push(new Dnt(e.rotateOptions));var a=e.attribution!==void 0?e.attribution:!0;return a&&t.push(new Pnt(e.attributionOptions)),t}const qZ={ACTIVE:"active"};var Vnt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),$nt=function(n){Vnt(e,n);function e(t){var r=n.call(this)||this;return r.on,r.once,r.un,t&&t.handleEvent&&(r.handleEvent=t.handleEvent),r.map_=null,r.setActive(!0),r}return e.prototype.getActive=function(){return this.get(qZ.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(qZ.ACTIVE,t)},e.prototype.setMap=function(t){this.map_=t},e}(lz);function Wnt(n,e,t){var r=n.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];n.animateInternal({duration:t!==void 0?t:250,easing:ynt,center:n.getConstrainedCenter(i)})}}function xne(n,e,t,r){var i=n.getZoom();if(i!==void 0){var a=n.getConstrainedZoom(i+e),o=n.getResolutionForZoom(a);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:t,duration:r!==void 0?r:250,easing:wI})}}const r3=$nt;var Hnt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),jnt=function(n){Hnt(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==Yo.DBLCLICK){var i=t.originalEvent,a=t.map,o=t.coordinate,s=i.shiftKey?-this.delta_:this.delta_,l=a.getView();xne(l,s,o,this.duration_),i.preventDefault(),r=!0}return!r},e}(r3);const Xnt=jnt;var Ynt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),qnt=function(n){Ynt(e,n);function e(t){var r=this,i=t||{};return r=n.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.targetPointers=[],r}return e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var r=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Yo.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Yo.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==Yo.POINTERDOWN){var a=this.handleDownEvent(t);this.handlingDownUpSequence=a,r=this.stopDown(a)}else t.type==Yo.POINTERMOVE&&this.handleMoveEvent(t);return!r},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){t.activePointers&&(this.targetPointers=t.activePointers)},e}(r3);function Sne(n){for(var e=n.length,t=0,r=0,i=0;i0&&this.condition_(t)){var r=t.map,i=r.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},e}(bI);const tit=eit;var rit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),nit=function(n){rit(e,n);function e(t){var r=this,i=t||{};return r=n.call(this,{stopDown:t3})||this,r.condition_=i.condition?i.condition:Znt,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(t){if(!!GW(t)){var r=t.map,i=r.getView();if(i.getConstraints().rotation!==_ne){var a=r.getSize(),o=t.pixel,s=Math.atan2(a[1]/2-o[1],o[0]-a[0]/2);if(this.lastAngle_!==void 0){var l=s-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=s}}},e.prototype.handleUpEvent=function(t){if(!GW(t))return!0;var r=t.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(t){if(!GW(t))return!1;if(HPe(t)&&this.condition_(t)){var r=t.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(bI);const iit=nit;var ait=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),oit=function(n){ait(e,n);function e(t){var r=n.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+t,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,r=this.endPixel_,i="px",a=this.element_.style;a.left=Math.min(t[0],r[0])+i,a.top=Math.min(t[1],r[1])+i,a.width=Math.abs(r[0]-t[0])+i,a.height=Math.abs(r[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var r=this.element_.style;r.left="inherit",r.top="inherit",r.width="inherit",r.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,r){this.startPixel_=t,this.endPixel_=r,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,r=this.endPixel_,i=[t,[t[0],r[1]],r,[r[0],t[1]]],a=i.map(this.map_.getCoordinateFromPixelInternal,this.map_);a[4]=a[0].slice(),this.geometry_?this.geometry_.setCoordinates([a]):this.geometry_=new cne([a])},e.prototype.getGeometry=function(){return this.geometry_},e}(wPe);const sit=oit;var YPe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),kF={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},zW=function(n){YPe(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.coordinate=r,a.mapBrowserEvent=i,a}return e}(sz),lit=function(n){YPe(e,n);function e(t){var r=n.call(this)||this;r.on,r.once,r.un;var i=t||{};return r.box_=new sit(i.className||"ol-dragbox"),r.minArea_=i.minArea!==void 0?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:HPe,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return e.prototype.defaultBoxEndCondition=function(t,r,i){var a=i[0]-r[0],o=i[1]-r[1];return a*a+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new zW(kF.BOXDRAG,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var r=this.boxEndCondition_(t,this.startPixel_,t.pixel);return r&&this.onBoxEnd(t),this.dispatchEvent(new zW(r?kF.BOXEND:kF.BOXCANCEL,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new zW(kF.BOXSTART,t.coordinate,t)),!0):!1},e.prototype.onBoxEnd=function(t){},e}(bI);const uit=lit;var hit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),cit=function(n){hit(e,n);function e(t){var r=this,i=t||{},a=i.condition?i.condition:jPe;return r=n.call(this,{condition:a,className:i.className||"ol-dragzoom",minArea:i.minArea})||this,r.duration_=i.duration!==void 0?i.duration:200,r.out_=i.out!==void 0?i.out:!1,r}return e.prototype.onBoxEnd=function(t){var r=this.getMap(),i=r.getView(),a=this.getGeometry();if(this.out_){var o=i.rotatedExtentForGeometry(a),s=i.getResolutionForExtentInternal(o),l=i.getResolution()/s;a=a.clone(),a.scale(l*l)}i.fitInternal(a,{duration:this.duration_,easing:wI})},e}(uit);const fit=cit,$w={LEFT:37,UP:38,RIGHT:39,DOWN:40};var dit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),vit=function(n){dit(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.defaultCondition_=function(a){return wne(a)&&XPe(a)},r.condition_=i.condition!==void 0?i.condition:r.defaultCondition_,r.duration_=i.duration!==void 0?i.duration:100,r.pixelDelta_=i.pixelDelta!==void 0?i.pixelDelta:128,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==zo.KEYDOWN){var i=t.originalEvent,a=i.keyCode;if(this.condition_(t)&&(a==$w.DOWN||a==$w.LEFT||a==$w.RIGHT||a==$w.UP)){var o=t.map,s=o.getView(),l=s.getResolution()*this.pixelDelta_,u=0,h=0;a==$w.DOWN?h=-l:a==$w.LEFT?u=-l:a==$w.RIGHT?u=l:h=l;var c=[u,h];une(c,s.getRotation()),Wnt(s,c,this.duration_),i.preventDefault(),r=!0}}return!r},e}(r3);const pit=vit;var git=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),yit=function(n){git(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.condition_=i.condition?i.condition:XPe,r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:100,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==zo.KEYDOWN||t.type==zo.KEYPRESS){var i=t.originalEvent,a=i.charCode;if(this.condition_(t)&&(a=="+".charCodeAt(0)||a=="-".charCodeAt(0))){var o=t.map,s=a=="+".charCodeAt(0)?this.delta_:-this.delta_,l=o.getView();xne(l,s,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(r3);const mit=yit;var _it=function(){function n(e,t,r){this.decay_=e,this.minVelocity_=t,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return n.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},n.prototype.update=function(e,t){this.points_.push(e,t,Date.now())},n.prototype.end=function(){if(this.points_.length<6)return!1;var e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]0&&this.points_[r+2]>e;)r-=3;var i=this.points_[t+2]-this.points_[r+2];if(i<1e3/60)return!1;var a=this.points_[t]-this.points_[r],o=this.points_[t+1]-this.points_[r+1];return this.angle_=Math.atan2(o,a),this.initialVelocity_=Math.sqrt(a*a+o*o)/i,this.initialVelocity_>this.minVelocity_},n.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},n.prototype.getAngle=function(){return this.angle_},n}();const xit=_it;var Sit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),UW={TRACKPAD:"trackpad",WHEEL:"wheel"},wit=function(n){Sit(e,n);function e(t){var r=this,i=t||{};r=n.call(this,i)||this,r.totalDelta_=0,r.lastDelta_=0,r.maxDelta_=i.maxDelta!==void 0?i.maxDelta:1,r.duration_=i.duration!==void 0?i.duration:250,r.timeout_=i.timeout!==void 0?i.timeout:80,r.useAnchor_=i.useAnchor!==void 0?i.useAnchor:!0,r.constrainResolution_=i.constrainResolution!==void 0?i.constrainResolution:!1;var a=i.condition?i.condition:WPe;return r.condition_=i.onFocusOnly?ZZ($Pe,a):a,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap();if(!!t){var r=t.getView();r.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var r=t.type;if(r!==zo.WHEEL)return!0;var i=t.map,a=t.originalEvent;a.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);var o;if(t.type==zo.WHEEL&&(o=a.deltaY,Ztt&&a.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(o/=APe),a.deltaMode===WheelEvent.DOM_DELTA_LINE&&(o*=40)),o===0)return!1;this.lastDelta_=o;var s=Date.now();this.startTime_===void 0&&(this.startTime_=s),(!this.mode_||s-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(o)<4?UW.TRACKPAD:UW.WHEEL);var l=i.getView();if(this.mode_===UW.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-o/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=s,!1;this.totalDelta_+=o;var u=Math.max(this.timeout_-(s-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),u),!1},e.prototype.handleWheelZoom_=function(t){var r=t.getView();r.getAnimating()&&r.cancelAnimations();var i=-bv(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),xne(r,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(r3);const qPe=wit;var bit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Eit=function(n){bit(e,n);function e(t){var r=this,i=t||{},a=i;return a.stopDown||(a.stopDown=t3),r=n.call(this,a)||this,r.anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=i.threshold!==void 0?i.threshold:.3,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(t){var r=0,i=this.targetPointers[0],a=this.targetPointers[1],o=Math.atan2(a.clientY-i.clientY,a.clientX-i.clientX);if(this.lastAngle_!==void 0){var s=o-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=s}this.lastAngle_=o;var l=t.map,u=l.getView();if(u.getConstraints().rotation!==_ne){var h=l.getViewport().getBoundingClientRect(),c=Sne(this.targetPointers);c[0]-=h.left,c[1]-=h.top,this.anchor_=l.getCoordinateFromPixelInternal(c),this.rotating_&&(l.render(),u.adjustRotationInternal(r,this.anchor_))}},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var r=t.map,i=r.getView();return i.endInteraction(this.duration_),!1}else return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var r=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(bI);const Tit=Eit;var Cit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Ait=function(n){Cit(e,n);function e(t){var r=this,i=t||{},a=i;return a.stopDown||(a.stopDown=t3),r=n.call(this,a)||this,r.anchor_=null,r.duration_=i.duration!==void 0?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return e.prototype.handleDragEvent=function(t){var r=1,i=this.targetPointers[0],a=this.targetPointers[1],o=i.clientX-a.clientX,s=i.clientY-a.clientY,l=Math.sqrt(o*o+s*s);this.lastDistance_!==void 0&&(r=this.lastDistance_/l),this.lastDistance_=l;var u=t.map,h=u.getView();r!=1&&(this.lastScaleDelta_=r);var c=u.getViewport().getBoundingClientRect(),f=Sne(this.targetPointers);f[0]-=c.left,f[1]-=c.top,this.anchor_=u.getCoordinateFromPixelInternal(f),u.render(),h.adjustResolutionInternal(r,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var r=t.map,i=r.getView(),a=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,a),!1}else return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var r=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(bI);const Mit=Ait;var Iit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ZPe=function(n){Iit(e,n);function e(t,r,i){var a=n.call(this)||this;if(i!==void 0&&r===void 0)a.setFlatCoordinates(i,t);else{var o=r||0;a.setCenterAndRadius(t,o,i)}return a}return e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,r,i,a){var o=this.flatCoordinates,s=t-o[0],l=r-o[1],u=s*s+l*l;if(u=i[0]||t[1]<=i[1]&&t[3]>=i[1]?!0:IPe(t,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(t){var r=this.stride,i=this.flatCoordinates[r]-this.flatCoordinates[0],a=t.slice();a[r]=a[0]+i;for(var o=1;o=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)}return this.freehand_&&t.type===Yo.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(t.coordinate),i=!1):this.freehand_&&t.type===Yo.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=t.type===Yo.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(t),this.shouldHandle_&&t.originalEvent.preventDefault()):(t.originalEvent.pointerType==="mouse"||t.type===Yo.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(t)):t.type===Yo.DBLCLICK&&(i=!1),n.prototype.handleEvent.call(this,t)&&i},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new v1(Yo.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var r=!0;if(this.getPointerCount()===0)if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_===xo.POINT)&&(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),r=!1}else this.freehand_&&this.abortDrawing();return!r&&this.stopClick_&&t.preventDefault(),r},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var r=this.downPx_,i=t.pixel,a=r[0]-i[0],o=r[1]-i[1],s=a*a+o*o;if(this.shouldHandle_=this.freehand_?s>this.squaredClickTolerance_:s<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var r=!1;if(this.sketchFeature_){var i=!1,a=[this.finishCoordinate_],o=this.mode_;if(o===xo.POINT)r=!0;else if(o===xo.CIRCLE)r=this.sketchCoords_.length===2;else if(o===xo.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(o===xo.POLYGON){var s=this.sketchCoords_;i=s[0].length>this.minPoints_,a=[s[0][0],s[0][s[0].length-2]]}if(i)for(var l=this.getMap(),u=0,h=a.length;u=this.maxPoints_&&(this.freehand_?o.pop():a=!0),o.push(t.slice()),this.geometryFunction_(o,r,i)):s===xo.POLYGON&&(o=this.sketchCoords_[0],o.length>=this.maxPoints_&&(this.freehand_?o.pop():a=!0),o.push(t.slice()),a&&(this.finishCoordinate_=o[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),a&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(!!this.sketchFeature_){var t=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i,a=this.mode_;if(a===xo.LINE_STRING||a===xo.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();var o=this.finishCoordinate_.slice();i[i.length-1]=o,this.createOrUpdateSketchPoint_(o)}this.geometryFunction_(i,t,r),t.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(a===xo.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);var s=this.sketchLine_.getGeometry();if(i.length>=2){var o=i[i.length-2].slice();i[i.length-1]=o,this.createOrUpdateSketchPoint_(o)}s.setCoordinates(i),this.geometryFunction_(this.sketchCoords_,t,r)}i.length===1&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(!!t){var r=this.sketchCoords_,i=t.getGeometry(),a=this.getMap().getView().getProjection();this.mode_===xo.LINE_STRING?(r.pop(),this.geometryFunction_(r,i,a)):this.mode_===xo.POLYGON&&(r[0].pop(),this.geometryFunction_(r,i,a),r=i.getCoordinates()),this.type_==="MultiPoint"?t.setGeometry(new nrt([r])):this.type_==="MultiLineString"?t.setGeometry(new irt([r])):this.type_==="MultiPolygon"&&t.setGeometry(new art([r])),this.dispatchEvent(new BF(FF.DRAWEND,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new BF(FF.DRAWABORT,t))},e.prototype.appendCoordinates=function(t){var r=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(t[0]);var a;if(r===xo.LINE_STRING||r===xo.CIRCLE)a=this.sketchCoords_;else if(r===xo.POLYGON)a=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&a.shift(),a.pop();for(var o=0;ot)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){tB()},e.prototype.getAlpha=function(t,r){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(!i)i=r,this.transitionStarts_[t]=i;else if(i===-1)return 1;var a=r-i+1e3/60;return a>=this.transition_?1:BPe(a/this.transition_)},e.prototype.inTransition=function(t){return this.transition_?this.transitionStarts_[t]!==-1:!1},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(TPe);const QPe=Uit;var Vit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),$it=function(n){Vit(e,n);function e(t,r,i,a,o,s){var l=n.call(this,t,r,s)||this;return l.crossOrigin_=a,l.src_=i,l.key=i,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.tileLoadFunction_=o,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Hi.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=Hi.ERROR,this.unlistenImage_(),this.image_=Wit(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Hi.LOADED:this.state=Hi.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Hi.ERROR&&(this.state=Hi.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Hi.IDLE&&(this.state=Hi.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=srt(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(QPe);function Wit(){var n=HZ(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}const Hit=$it;var jit=.5,Xit=10,Ude=.25,Yit=function(){function n(e,t,r,i,a,o){this.sourceProj_=e,this.targetProj_=t;var s={},l=lrt(this.targetProj_,this.sourceProj_);this.transformInv_=function(_){var x=_[0]+"/"+_[1];return s[x]||(s[x]=l(_)),s[x]},this.maxSourceExtent_=i,this.errorThresholdSquared_=a*a,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&nv(i)==nv(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?nv(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?nv(this.targetProj_.getExtent()):null;var u=e3(r),h=urt(r),c=MPe(r),f=hrt(r),d=this.transformInv_(u),v=this.transformInv_(h),p=this.transformInv_(c),g=this.transformInv_(f),m=Xit+(o?Math.max(0,Math.ceil(crt(jZ(r)/(o*o*256*256)))):0);if(this.addQuad_(u,h,c,f,d,v,p,g,m),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(_,x,S){y=Math.min(y,_.source[0][0],_.source[1][0],_.source[2][0])}),this.triangles_.forEach(function(_){if(Math.max(_.source[0][0],_.source[1][0],_.source[2][0])-y>this.sourceWorldWidth_/2){var x=[[_.source[0][0],_.source[0][1]],[_.source[1][0],_.source[1][1]],[_.source[2][0],_.source[2][1]]];x[0][0]-y>this.sourceWorldWidth_/2&&(x[0][0]-=this.sourceWorldWidth_),x[1][0]-y>this.sourceWorldWidth_/2&&(x[1][0]-=this.sourceWorldWidth_),x[2][0]-y>this.sourceWorldWidth_/2&&(x[2][0]-=this.sourceWorldWidth_);var S=Math.min(x[0][0],x[1][0],x[2][0]),w=Math.max(x[0][0],x[1][0],x[2][0]);w-S.5&&c<1,v=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var p=Mde([e,t,r,i]),g=nv(p)/this.targetWorldWidth_;v=g>Ude||v}!d&&this.sourceProj_.isGlobal()&&c&&(v=c>Ude||v)}if(!(!v&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!fne(h,this.maxSourceExtent_))){var m=0;if(!v&&(!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(l[0])||!isFinite(l[1]))){if(u>0)v=!0;else if(m=(!isFinite(a[0])||!isFinite(a[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(s[0])||!isFinite(s[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(u>0){if(!v){var y=[(e[0]+r[0])/2,(e[1]+r[1])/2],_=this.transformInv_(y),x=void 0;if(d){var S=(UO(a[0],f)+UO(s[0],f))/2;x=S-UO(_[0],f)}else x=(a[0]+s[0])/2-_[0];var w=(a[1]+s[1])/2-_[1],b=x*x+w*w;v=b>this.errorThresholdSquared_}if(v){if(Math.abs(e[0]-r[0])<=Math.abs(e[1]-r[1])){var E=[(t[0]+r[0])/2,(t[1]+r[1])/2],T=this.transformInv_(E),C=[(i[0]+e[0])/2,(i[1]+e[1])/2],A=this.transformInv_(C);this.addQuad_(e,t,E,C,a,o,T,A,u-1),this.addQuad_(C,E,r,i,A,T,s,l,u-1)}else{var M=[(e[0]+t[0])/2,(e[1]+t[1])/2],I=this.transformInv_(M),R=[(r[0]+i[0])/2,(r[1]+i[1])/2],k=this.transformInv_(R);this.addQuad_(e,M,R,i,a,I,k,l,u-1),this.addQuad_(M,t,r,R,I,o,s,k,u-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(m&11)==0&&this.addTriangle_(e,r,i,a,s,l),(m&14)==0&&this.addTriangle_(e,r,t,a,s,o),m&&((m&13)==0&&this.addTriangle_(t,i,e,o,l,a),(m&7)==0&&this.addTriangle_(t,i,r,o,l,s))}},n.prototype.calculateSourceExtent=function(){var e=dne();return this.triangles_.forEach(function(t,r,i){var a=t.source;RW(e,a[0]),RW(e,a[1]),RW(e,a[2])}),e},n.prototype.getTriangles=function(){return this.triangles_},n}();const qit=Yit;var KZ={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Zit={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},VW,eOe=[];function Vde(n,e,t,r,i){n.beginPath(),n.moveTo(0,0),n.lineTo(e,t),n.lineTo(r,i),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(e,r)+1,Math.max(t,i)),n.restore()}function $W(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-.75*255)>2}function Kit(){if(VW===void 0){var n=document.createElement("canvas").getContext("2d");n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",Vde(n,4,5,4,0),Vde(n,4,5,0,5);var e=n.getImageData(0,0,3,3).data;VW=$W(e,0)||$W(e,4)||$W(e,8)}return VW}function $de(n,e,t,r){var i=lA(t,e,n),a=Ide(e,r,t),o=e.getMetersPerUnit();o!==void 0&&(a*=o);var s=n.getMetersPerUnit();s!==void 0&&(a/=s);var l=n.getExtent();if(!l||LPe(l,i)){var u=Ide(n,a,i)/a;isFinite(u)&&u>0&&(a/=u)}return a}function Jit(n,e,t,r){var i=UZ(t),a=$de(n,e,i,r);return(!isFinite(a)||a<=0)&&IPe(t,function(o){return a=$de(n,e,o,r),isFinite(a)&&a>0}),a}function Qit(n,e,t,r,i,a,o,s,l,u,h,c){var f=HZ(Math.round(t*n),Math.round(t*e),eOe);if(c||Tp(f,KZ),l.length===0)return f.canvas;f.scale(t,t);function d(x){return Math.round(x*t)/t}f.globalCompositeOperation="lighter";var v=dne();l.forEach(function(x,S,w){frt(v,x.extent)});var p=nv(v),g=hM(v),m=HZ(Math.round(t*p/r),Math.round(t*g/r));c||Tp(m,KZ);var y=t/r;l.forEach(function(x,S,w){var b=x.extent[0]-v[0],E=-(x.extent[3]-v[3]),T=nv(x.extent),C=hM(x.extent);x.image.width>0&&x.image.height>0&&m.drawImage(x.image,u,u,x.image.width-2*u,x.image.height-2*u,b*y,E*y,T*y,C*y)});var _=e3(o);return s.getTriangles().forEach(function(x,S,w){var b=x.source,E=x.target,T=b[0][0],C=b[0][1],A=b[1][0],M=b[1][1],I=b[2][0],R=b[2][1],k=d((E[0][0]-_[0])/a),D=d(-(E[0][1]-_[1])/a),G=d((E[1][0]-_[0])/a),W=d(-(E[1][1]-_[1])/a),z=d((E[2][0]-_[0])/a),V=d(-(E[2][1]-_[1])/a),q=T,Y=C;T=0,C=0,A-=q,M-=Y,I-=q,R-=Y;var le=[[A,M,0,0,G-k],[I,R,0,0,z-k],[0,0,A,M,W-D],[0,0,I,R,V-D]],j=drt(le);if(!!j){if(f.save(),f.beginPath(),Kit()||!c){f.moveTo(G,W);for(var Q=4,ie=k-G,oe=D-W,se=0;sethis.maxX&&(this.maxX=e.maxX),e.minYthis.maxY&&(this.maxY=e.maxY)},n.prototype.getHeight=function(){return this.maxY-this.minY+1},n.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},n.prototype.getWidth=function(){return this.maxX-this.minX+1},n.prototype.intersects=function(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY},n}();function GT(n,e,t,r,i){return i!==void 0?(i.minX=n,i.maxX=e,i.minY=t,i.maxY=r,i):new tOe(n,e,t,r)}const rOe=tOe;var nat=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),iat=function(n){nat(e,n);function e(t){var r=n.call(this,t)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=dne(),r.tmpTileRange_=new rOe(0,0,0,0),r}return e.prototype.isDrawableTile=function(t){var r=this.getLayer(),i=t.getState(),a=r.getUseInterimTilesOnError();return i==Hi.LOADED||i==Hi.EMPTY||i==Hi.ERROR&&!a},e.prototype.getTile=function(t,r,i,a){var o=a.pixelRatio,s=a.viewState.projection,l=this.getLayer(),u=l.getSource(),h=u.getTile(t,r,i,o,s);return h.getState()==Hi.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):h.setState(Hi.LOADED)),this.isDrawableTile(h)||(h=h.getInterimTile()),h},e.prototype.getData=function(t){var r=this.frameState;if(!r)return null;var i=this.getLayer(),a=R8(r.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!LPe(o,a))return null;for(var s=r.pixelRatio,l=r.viewState.projection,u=r.viewState,h=i.getRenderSource(),c=h.getTileGridForProjection(u.projection),f=h.getTilePixelRatio(r.pixelRatio),d=c.getZForResolution(u.resolution);d>=c.getMinZoom();--d){var v=c.getTileCoordForCoordAndZ(a,d),p=h.getTile(d,v[1],v[2],s,l);if(!(p instanceof Hit||p instanceof rat))return null;if(p.getState()===Hi.LOADED){var g=c.getOrigin(d),m=NC(c.getTileSize(d)),y=c.getResolution(d),_=Math.floor(f*((a[0]-g[0])/y-v[1]*m[0])),x=Math.floor(f*((g[1]-a[1])/y-v[2]*m[1])),S=Math.round(f*h.getGutterForProjection(u.projection));return this.getImageData(p.getImage(),_+S,x+S)}}return null},e.prototype.loadedTileCallback=function(t,r,i){return this.isDrawableTile(i)?n.prototype.loadedTileCallback.call(this,t,r,i):!1},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,r){var i=t.layerStatesArray[t.layerIndex],a=t.viewState,o=a.projection,s=a.resolution,l=a.center,u=a.rotation,h=t.pixelRatio,c=this.getLayer(),f=c.getSource(),d=f.getRevision(),v=f.getTileGridForProjection(o),p=v.getZForResolution(s,f.zDirection),g=v.getResolution(p),m=t.extent,y=t.viewState.resolution,_=f.getTilePixelRatio(h),x=Math.round(nv(m)/y*h),S=Math.round(hM(m)/y*h),w=i.extent&&sA(i.extent);w&&(m=zO(m,sA(i.extent)));var b=g*x/2/_,E=g*S/2/_,T=[l[0]-b,l[1]-E,l[0]+b,l[1]+E],C=v.getTileRangeForExtentAndZ(m,p),A={};A[p]={};var M=this.createLoadedTileFinder(f,o,A),I=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(var k=u?Lde(a.center,y,u,t.size):void 0,D=C.minX;D<=C.maxX;++D)for(var G=C.minY;G<=C.maxY;++G)if(!(u&&!v.tileCoordIntersectsViewport([p,D,G],k))){var W=this.getTile(p,D,G,t);if(this.isDrawableTile(W)){var z=_1(this);if(W.getState()==Hi.LOADED){A[p][W.tileCoord.toString()]=W;var V=W.inTransition(z);V&&i.opacity!==1&&(W.endTransition(z),V=!1),!this.newTiles_&&(V||this.renderedTiles.indexOf(W)===-1)&&(this.newTiles_=!0)}if(W.getAlpha(z,t.time)===1)continue}var q=v.getTileCoordChildTileRange(W.tileCoord,R,I),Y=!1;q&&(Y=M(p+1,q)),Y||v.forEachTileCoordParentTileRange(W.tileCoord,M,R,I)}var le=g/s*h/_;FZ(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/h,1/h,u,-x/2,-S/2);var j=prt(this.pixelTransform);this.useContainer(r,j,this.getBackground(t));var Q=this.context,ie=Q.canvas;xPe(this.inversePixelTransform,this.pixelTransform),FZ(this.tempTransform,x/2,S/2,le,le,0,-x/2,-S/2),ie.width!=x||ie.height!=S?(ie.width=x,ie.height=S):this.containerReused||Q.clearRect(0,0,x,S),w&&this.clipUnrotated(Q,t,w),f.getInterpolate()||Tp(Q,KZ),this.preRender(Q,t),this.renderedTiles.length=0;var oe=Object.keys(A).map(Number);oe.sort(grt);var se,me,Ce;i.opacity===1&&(!this.containerReused||f.getOpaque(t.viewState.projection))?oe=oe.reverse():(se=[],me=[]);for(var Le=oe.length-1;Le>=0;--Le){var re=oe[Le],yt=f.getTilePixelSize(re,h,o),je=v.getResolution(re),st=je/g,Nt=yt[0]*st*le,Zt=yt[1]*st*le,qe=v.getTileCoordForCoordAndZ(e3(T),re),ur=v.getTileCoordExtent(qe),Dt=R8(this.tempTransform,[_*(ur[0]-T[0])/g,_*(T[3]-ur[3])/g]),ft=_*f.getGutterForProjection(o),Oe=A[re];for(var J in Oe){var W=Oe[J],We=W.tileCoord,Tt=qe[1]-We[1],Qe=Math.round(Dt[0]-(Tt-1)*Nt),zt=qe[2]-We[2],mt=Math.round(Dt[1]-(zt-1)*Zt),D=Math.round(Dt[0]-Tt*Nt),G=Math.round(Dt[1]-zt*Zt),wt=Qe-D,pt=mt-G,ar=p===re,V=ar&&W.getAlpha(_1(this),t.time)!==1,kt=!1;if(!V)if(se){Ce=[D,G,D+wt,G,D+wt,G+pt,D,G+pt];for(var Dr=0,Sr=se.length;Dr=this.minZoom;){if(this.zoomFactor_===2?(o=Math.floor(o/2),s=Math.floor(s/2),a=GT(o,o,s,s,r)):a=this.getTileRangeForExtentAndZ(l,u,r),t(u,a))return!0;--u}return!1},n.prototype.getExtent=function(){return this.extent_},n.prototype.getMaxZoom=function(){return this.maxZoom},n.prototype.getMinZoom=function(){return this.minZoom},n.prototype.getOrigin=function(e){return this.origin_?this.origin_:this.origins_[e]},n.prototype.getResolution=function(e){return this.resolutions_[e]},n.prototype.getResolutions=function(){return this.resolutions_},n.prototype.getTileCoordChildTileRange=function(e,t,r){if(e[0]this.maxZoom||t"u"?"undefined":o};return n.replace(ad.tokenRegEx,r)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(n){return ad.numberRegEx.test(n)},numericIf:function(n){return ad.isNumeric(n)?parseFloat(n):n}},G8={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(n,e){var t=0;return e>0&&(t=parseFloat(n.toPrecision(e))),t},format:function(n,e,t,r){e=typeof e<"u"?e:0,t=typeof t<"u"?t:G8.thousandsSeparator,r=typeof r<"u"?r:G8.decimalSeparator,e!=null&&(n=parseFloat(n.toFixed(e)));var i=n.toString().split(".");i.length===1&&e==null&&(e=0);var a=i[0];if(t)for(var o=/(-?[0-9]+)([0-9]{3})/;o.test(a);)a=a.replace(o,"$1"+t+"$2");var s;if(e==0)s=a;else{var l=i.length>1?i[1]:"0";e!=null&&(l=l+new Array(e-l.length+1).join("0")),s=a+r+l}return s}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(n){return G8.limitSigDigs(this,n)});var UR={bind:function(n,e){var t=Array.prototype.slice.apply(arguments,[2]);return function(){var r=t.concat(Array.prototype.slice.apply(arguments,[0]));return n.apply(e,r)}},bindAsEventListener:function(n,e){return function(t){return n.call(e,t||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},$at={filter:function(n,e,t){var r=[];if(Array.prototype.filter)r=n.filter(e,t);else{var i=n.length;if(typeof e!="function")throw new TypeError;for(var a=0;a-1||i.indexOf("trident")>-1&&i.indexOf("rv")>-1?(n="msie",r=i.match(/msie ([\d.]+)/)||i.match(/rv:([\d.]+)/)):i.indexOf("chrome")>-1?(n="chrome",r=i.match(/chrome\/([\d.]+)/)):i.indexOf("firefox")>-1?(n="firefox",r=i.match(/firefox\/([\d.]+)/)):i.indexOf("opera")>-1?(n="opera",r=i.match(/version\/([\d.]+)/)):i.indexOf("safari")>-1&&(n="safari",r=i.match(/version\/([\d.]+)/)),e=r?r[1]:"",i.indexOf("ipad")>-1||i.indexOf("ipod")>-1||i.indexOf("iphone")>-1?t="apple":i.indexOf("android")>-1&&(r=i.match(/version\/([\d.]+)/),e=r?r[1]:"",t="android"),{name:n,version:e,device:t}}(),Wat=function(){var n=!0,e=Ane;return document.createElement("canvas").getContext?(e.name==="firefox"&&parseFloat(e.version)<5&&(n=!1),e.name==="safari"&&parseFloat(e.version)<4&&(n=!1),e.name==="opera"&&parseFloat(e.version)<10&&(n=!1),e.name==="msie"&&parseFloat(e.version)<9&&(n=!1)):n=!1,n}(),Hat=function(){var n=navigator.userAgent.toLowerCase();return n.indexOf("webkit")===-1&&n.indexOf("gecko")!==-1}(),eE=96,H={assign(n){for(var e=0;e=0;t--)n[t]===e&&n.splice(t,1);return n},indexOf:function(n,e){if(n==null)return-1;if(typeof n.indexOf=="function")return n.indexOf(e);for(var t=0,r=n.length;t=0&&parseFloat(s)<1?(n.style.filter="alpha(opacity="+s*100+")",n.style.opacity=s):parseFloat(s)===1&&(n.style.filter="",n.style.opacity="")},applyDefaults:function(n,e){n=n||{};var t=typeof window.Event=="function"&&e instanceof window.Event;for(var r in e)(n[r]===void 0||!t&&e.hasOwnProperty&&e.hasOwnProperty(r)&&!n.hasOwnProperty(r))&&(n[r]=e[r]);return!t&&e&&e.hasOwnProperty&&e.hasOwnProperty("toString")&&!n.hasOwnProperty("toString")&&(n.toString=e.toString),n},getParameterString:function(n){var e=[];for(var t in n){var r=n[t];if(r!=null&&typeof r!="function"){var i;Array.isArray(r)||r.toString()==="[object Object]"?i=encodeURIComponent(JSON.stringify(r)):i=encodeURIComponent(r),e.push(encodeURIComponent(t)+"="+i)}}return e.join("&")},urlAppend:function(n,e){var t=n;if(e){e.indexOf("?")===0&&(e=e.substring(1));var r=(n+" ").split(/[?&]/);t+=r.pop()===" "?e:r.length?"&"+e:"?"+e}return t},urlPathAppend:function(n,e){let t=n;if(!e)return t;e.indexOf("/")===0&&(e=e.substring(1));const r=n.split("?");return r[0].indexOf("/",r[0].length-1)<0&&(r[0]+="/"),t=`${r[0]}${e}${r.length>1?`?${r[1]}`:""}`,t},DEFAULT_PRECISION:14,toFloat:function(n,e){return e==null&&(e=H.DEFAULT_PRECISION),typeof n!="number"&&(n=parseFloat(n)),e===0?n:parseFloat(n.toPrecision(e))},rad:function(n){return n*Math.PI/180},getParameters:function(n){n=n==null?window.location.href:n;var e="";if(ad.contains(n,"?")){var t=n.indexOf("?")+1,r=ad.contains(n,"#")?n.indexOf("#"):n.length;e=n.substring(t,r)}for(var i={},a=e.split(/[&;]/),o=0,s=a.length;o1?1/n:n;return e},getResolutionFromScale:function(n,e){var t;if(n){e==null&&(e="degrees");var r=H.normalizeScale(n);t=1/(r*Ii[e]*eE)}return t},getScaleFromResolution:function(n,e){e==null&&(e="degrees");var t=n*Ii[e]*eE;return t},getBrowser:function(){return Ane},isSupportCanvas:Wat,supportCanvas:function(){return H.isSupportCanvas},isInTheSameDomain:function(n){if(!n)return!0;var e=n.indexOf("//"),t=document.location.toString(),r=t.indexOf("//");if(e===-1)return!0;var i,a=i=n.substring(0,e),o=t.substring(r+2);r=o.indexOf("/");var s=o.indexOf(":"),l=o.substring(0,r),u=document.location.protocol;if(s!==-1||(l+=":"+(u.toLowerCase()==="http:"?80:443)),u.toLowerCase()!==a.toLowerCase())return!1;a=n.substring(e+2);var h=a.indexOf(":");e=a.indexOf("/");var c=a.substring(0,e),f;h!==-1?f=a.substring(0,h):(f=a.substring(0,e),c+=":"+(i.toLowerCase()==="http:"?80:443));var d=document.domain;return f===d&&c===l},calculateDpi:function(n,e,t,r,i){if(!(!n||!e||!t)){var a=1e4,o=n.getWidth(),s=n.getHeight(),l=e.w,u=e.h;i=i||6378137,r=r||"degrees";var h;if(r.toLowerCase()==="degree"||r.toLowerCase()==="degrees"||r.toLowerCase()==="dd"){let c=o/l,f=s/u,d=c>f?c:f;h=.0254*a/d/t/(Math.PI*2*i/360)/a}else{let c=o/l;h=.0254*a/c/t/a}return h}},toJSON:function(n){var e=n;if(e==null)return null;switch(e.constructor){case String:return e='"'+e.replace(/(["\\])/g,"\\$1")+'"',e=e.replace(/\n/g,"\\n"),e=e.replace(/\r/g,"\\r"),e=e.replace("<","<"),e=e.replace(">",">"),e=e.replace(/%/g,"%25"),e=e.replace(/&/g,"%26"),e;case Array:for(var t="",r=0,i=e.length;r0?"{"+o.join(",")+"}":"{}"}return e.toString()}},getResolutionFromScaleDpi:function(n,e,t,r){var i=null,a=1e4;return r=r||6378137,t=t||"",n>0&&e>0?(n=H.normalizeScale(n),t.toLowerCase()==="degree"||t.toLowerCase()==="degrees"||t.toLowerCase()==="dd"?(i=.0254*a/e/n/(Math.PI*2*r/360)/a,i):(i=.0254*a/e/n/a,i)):-1},getScaleFromResolutionDpi:function(n,e,t,r){var i=null,a=1e4;return r=r||6378137,t=t||"",n>0&&e>0?t.toLowerCase()==="degree"||t.toLowerCase()==="degrees"||t.toLowerCase()==="dd"?(i=.0254*a/e/n/(Math.PI*2*r/360)/a,i):(i=.0254*a/e/n/a,i):-1},transformResult:function(n){return n.responseText&&typeof n.responseText=="string"&&(n=JSON.parse(n.responseText)),n},copyAttributes:function(n,e){if(n=n||{},e)for(var t in e){var r=e[t];r!==void 0&&t!=="CLASS_NAME"&&typeof r!="function"&&(n[t]=r)}return n},copyAttributesWithClip:function(n,e,t){if(n=n||{},e)for(var r in e){var i=!1;if(t&&t.length){for(var a=0,o=t.length;a=0&&o<=1&&a<=1&&o>=0?i=new rg.Point(n.x+a*(e.x-n.x),n.y+a*(e.y-n.y)):i="No Intersection";else if(s==0&&l==0){var h=Math.max(n.y,e.y),c=Math.min(n.y,e.y),f=Math.max(n.x,e.x),d=Math.min(n.x,e.x);(t.y>=c&&t.y<=h||r.y>=c&&r.y<=h)&&t.x>=d&&t.x<=f||r.x>=d&&r.x<=f?i="Coincident":i="Parallel"}else i="Parallel";return i},getTextBounds:function(n,e,t){document.body.appendChild(t),t.style.width="auto",t.style.height="auto",n.fontSize&&(t.style.fontSize=n.fontSize),n.fontFamily&&(t.style.fontFamily=n.fontFamily),n.fontWeight&&(t.style.fontWeight=n.fontWeight),t.style.position="relative",t.style.visibility="hidden",t.style.display="inline-block",t.innerHTML=e;var r=t.clientWidth,i=t.clientHeight;return document.body.removeChild(t),{textWidth:r,textHeight:i}},convertPath:function(n,e){return e?n.replace(/\{([\w-\.]+)\}/g,(t,r)=>{var i;return e.hasOwnProperty(r)?i=jat(e[r]):i=t,encodeURIComponent(i)}):n}},Ii={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};Ii.in=Ii.inches;Ii.degrees=Ii.dd;Ii.nmi=1852*Ii.m;const Fn=.0254000508001016;H.extend(Ii,{Inch:Ii.inches,Meter:1/Fn,Foot:.3048006096012192/Fn,IFoot:.3048/Fn,ClarkeFoot:.3047972651151/Fn,SearsFoot:.30479947153867626/Fn,GoldCoastFoot:.3047997101815088/Fn,IInch:.0254/Fn,MicroInch:254e-7/Fn,Mil:254e-10/Fn,Centimeter:.01/Fn,Kilometer:1e3/Fn,Yard:.9144018288036576/Fn,SearsYard:.914398414616029/Fn,IndianYard:.9143985307444408/Fn,IndianYd37:.91439523/Fn,IndianYd62:.9143988/Fn,IndianYd75:.9143985/Fn,IndianFoot:.30479951/Fn,IndianFt37:.30479841/Fn,IndianFt62:.3047996/Fn,IndianFt75:.3047995/Fn,Mile:1609.3472186944373/Fn,IYard:.9144/Fn,IMile:1609.344/Fn,NautM:1852/Fn,"Lat-66":110943.31648893273/Fn,"Lat-83":110946.25736872235/Fn,Decimeter:.1/Fn,Millimeter:.001/Fn,Dekameter:10/Fn,Decameter:10/Fn,Hectometer:100/Fn,GermanMeter:1.0000135965/Fn,CaGrid:.999738/Fn,ClarkeChain:20.1166194976/Fn,GunterChain:20.11684023368047/Fn,BenoitChain:20.116782494375872/Fn,SearsChain:20.11676512155/Fn,ClarkeLink:.201166194976/Fn,GunterLink:.2011684023368047/Fn,BenoitLink:.20116782494375873/Fn,SearsLink:.2011676512155/Fn,Rod:5.02921005842012/Fn,IntnlChain:20.1168/Fn,IntnlLink:.201168/Fn,Perch:5.02921005842012/Fn,Pole:5.02921005842012/Fn,Furlong:201.1684023368046/Fn,Rood:3.778266898/Fn,CapeFoot:.3047972615/Fn,Brealey:375/Fn,ModAmFt:.304812252984506/Fn,Fathom:1.8288/Fn,"NautM-UK":1853.184/Fn,"50kilometers":5e4/Fn,"150kilometers":15e4/Fn});H.extend(Ii,{mm:Ii.Meter/1e3,cm:Ii.Meter/100,dm:Ii.Meter*100,km:Ii.Meter*1e3,kmi:Ii.nmi,fath:Ii.Fathom,ch:Ii.IntnlChain,link:Ii.IntnlLink,"us-in":Ii.inches,"us-ft":Ii.Foot,"us-yd":Ii.Yard,"us-ch":Ii.GunterChain,"us-mi":Ii.Mile,"ind-yd":Ii.IndianYd37,"ind-ft":Ii.IndianFt37,"ind-ch":20.11669506/Fn});Ii.degree=Ii.dd;Ii.meter=Ii.m;Ii.foot=Ii.ft;Ii.inch=Ii.inches;Ii.mile=Ii.mi;Ii.kilometer=Ii.km;Ii.yard=Ii.yd;function jat(n){return n==null||n==null?"":n instanceof Date?n.toJSON():Xat(n)?JSON.stringify(n):n.toString()}function Xat(n){if(typeof n!="string"&&typeof n!="object")return!1;try{const e=n.toString();return e==="[object Object]"||e==="[object Array]"}catch{return!1}}class vd{constructor(e,t){H.isArray(e)&&(t=e[1],e=e[0]),this.lon=e?H.toFloat(e):0,this.lat=t?H.toFloat(t):0,this.CLASS_NAME="SuperMap.LonLat"}toString(){return"lon="+this.lon+",lat="+this.lat}toShortString(){return this.lon+","+this.lat}clone(){return new vd(this.lon,this.lat)}add(e,t){if(e==null||t==null)throw new TypeError("LonLat.add cannot receive null values");return new vd(this.lon+H.toFloat(e),this.lat+H.toFloat(t))}equals(e){var t=!1;return e!=null&&(t=this.lon===e.lon&&this.lat===e.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(e.lon)&&isNaN(e.lat)),t}wrapDateLine(e){var t=this.clone();if(e){for(;t.lone.right;)t.lon-=e.getWidth()}return t}destroy(){this.lon=null,this.lat=null}static fromString(e){var t=e.split(",");return new vd(t[0],t[1])}static fromArray(e){var t=H.isArray(e),r=t&&e[0],i=t&&e[1];return new vd(r,i)}}class po{constructor(e,t,r,i){H.isArray(e)&&(i=e[3],r=e[2],t=e[1],e=e[0]),this.left=e!=null?H.toFloat(e):this.left,this.bottom=t!=null?H.toFloat(t):this.bottom,this.right=r!=null?H.toFloat(r):this.right,this.top=i!=null?H.toFloat(i):this.top,this.centerLonLat=null,this.CLASS_NAME="SuperMap.Bounds"}clone(){return new po(this.left,this.bottom,this.right,this.top)}equals(e){var t=!1;return e!=null&&(t=this.left===e.left&&this.right===e.right&&this.top===e.top&&this.bottom===e.bottom),t}toString(){return[this.left,this.bottom,this.right,this.top].join(",")}toArray(e){return e===!0?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]}toBBOX(e,t){e==null&&(e=6);var r=Math.pow(10,e),i=Math.round(this.left*r)/r,a=Math.round(this.bottom*r)/r,o=Math.round(this.right*r)/r,s=Math.round(this.top*r)/r;return t===!0?a+","+i+","+s+","+o:i+","+a+","+o+","+s}getWidth(){return this.right-this.left}getHeight(){return this.top-this.bottom}getSize(){return new a3(this.getWidth(),this.getHeight())}getCenterPixel(){return new WE((this.left+this.right)/2,(this.bottom+this.top)/2)}getCenterLonLat(){return this.centerLonLat||(this.centerLonLat=new vd((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat}scale(e,t){e=e||1,t==null&&(t=this.getCenterLonLat());var r,i;t.CLASS_NAME==="SuperMap.LonLat"?(r=t.lon,i=t.lat):(r=t.x,i=t.y);var a=(this.left-r)*e+r,o=(this.bottom-i)*e+i,s=(this.right-r)*e+r,l=(this.top-i)*e+i;return new po(a,o,s,l)}add(e,t){if(e==null||t==null)throw new TypeError("Bounds.add cannot receive null values");return new po(this.left+e,this.bottom+t,this.right+e,this.top+t)}extend(e){var t=null;if(e){switch(e.CLASS_NAME){case"SuperMap.LonLat":t=new po(e.lon,e.lat,e.lon,e.lat);break;case"SuperMap.Geometry.Point":t=new po(e.x,e.y,e.x,e.y);break;case"SuperMap.Bounds":t=e;break}t&&(this.centerLonLat=null,(this.left==null||t.leftthis.right)&&(this.right=t.right),(this.top==null||t.top>this.top)&&(this.top=t.top))}}containsLonLat(e,t){typeof t=="boolean"&&(t={inclusive:t}),t=t||{};var r=this.contains(e.lon,e.lat,t.inclusive),i=t.worldBounds;if(i&&!r){var a=i.getWidth(),o=(i.left+i.right)/2,s=Math.round((e.lon-o)/a);r=this.containsLonLat({lon:e.lon-s*a,lat:e.lat},{inclusive:t.inclusive})}return r}containsPixel(e,t){return this.contains(e.x,e.y,t)}contains(e,t,r){if(r==null&&(r=!0),e==null||t==null)return!1;var i=!1;return r?i=e>=this.left&&e<=this.right&&t>=this.bottom&&t<=this.top:i=e>this.left&&ethis.bottom&&t=r.bottom&&e.bottom<=r.top||r.bottom>=e.bottom&&r.bottom<=e.top,s=e.top>=r.bottom&&e.top<=r.top||r.top>e.bottom&&r.top=r.left&&e.left<=r.right||r.left>=e.left&&r.left<=e.right,u=e.right>=r.left&&e.right<=r.right||r.right>=e.left&&r.right<=e.right;i=(o||s)&&(l||u)}if(t.worldBounds&&!i){var h=t.worldBounds,c=h.getWidth(),f=!h.containsBounds(r),d=!h.containsBounds(e);f&&!d?(e=e.add(-c,0),i=r.intersectsBounds(e,{inclusive:t.inclusive})):d&&!f&&(r=r.add(-c,0),i=e.intersectsBounds(r,{inclusive:t.inclusive}))}return i}containsBounds(e,t,r){t==null&&(t=!1),r==null&&(r=!0);var i=this.contains(e.left,e.bottom,r),a=this.contains(e.right,e.bottom,r),o=this.contains(e.left,e.top,r),s=this.contains(e.right,e.top,r);return t?i||a||o||s:i&&a&&o&&s}determineQuadrant(e){var t="",r=this.getCenterLonLat();return t+=e.lat=e.right&&a.right>e.right;)a=a.add(-o,0);var s=a.left+r;se.left&&a.right-i>e.right&&(a=a.add(-o,0))}return a}toServerJSONObject(){var e={rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom};return e}destroy(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}static fromString(e,t){var r=e.split(",");return po.fromArray(r,t)}static fromArray(e,t){return t===!0?new po(e[1],e[0],e[3],e[2]):new po(e[0],e[1],e[2],e[3])}static fromSize(e){return new po(0,e.h,e.w,0)}static oppositeQuadrant(e){var t="";return t+=e.charAt(0)==="t"?"b":"t",t+=e.charAt(1)==="l"?"r":"l",t}}class O0 extends rg{constructor(e){super(),this.components=[],this.componentTypes=null,e!=null&&this.addComponents(e),this.CLASS_NAME="SuperMap.Geometry.Collection",this.geometryType="Collection"}destroy(){this.components.length=0,this.components=null,super.destroy()}clone(){for(var e=new O0,t=0,r=this.components.length;t-1)){if(t!=null&&t=0;--r)t=this.removeComponent(e[r])||t;return t}removeComponent(e){return H.removeItem(this.components,e),this.clearBounds(),!0}getArea(){for(var e=0,t=0,r=this.components.length;t2;return t&&super.removeComponent.apply(this,arguments),t}getSortedSegments(){for(var e=this.components.length-1,t=new Array(e),r,i,a=0;a=1?1:x,x=x<=-1?-1:x,c=Math.acos(x)*180/Math.PI,a.x==r.x?c=t.x>r.x&&i.x>r.x||t.xv*t.x+p&&i.y>v*i.x+p||t.yr.y?i.xr.x&&(l=!1):a.xv*i.x+p&&(l=!1):a.x>r.x?i.y>r.y&&(l=!1):i.y=0?Math.atan(S)*180/Math.PI:Math.abs(Math.atan(S)*180/Math.PI)+90,b=Math.abs(t.y);r.y==b&&b==a.y&&r.x=0?S>=0?h=h+u:h=180-(h-90)+u:S>0?h=h-180+u:h=90-h+u:E>=0?S>=0?h=h-u:h=180-(h-90)-u:S>=0?h=h-180-u:h=90-h-u,h=h*Math.PI/180;var C=t.x+o*Math.cos(h),A=t.y+o*Math.sin(h);d.push(new Ki(C,A))}d.push(a)}return d}static createLineEPS(e){var t=[],r=e.length;if(r<2)return e;for(var i=0;i1&&(r=parseFloat(r)*d),i.labelAlign&&i.labelAlign!=="cm")switch(i.labelAlign){case"lt":h.x+=t/2,h.y+=r/2;break;case"lm":h.x+=t/2;break;case"lb":h.x+=t/2,h.y-=r/2;break;case"ct":h.y+=r/2;break;case"cb":h.y-=r/2;break;case"rt":h.x-=t/2,h.y+=r/2;break;case"rm":h.x-=t/2;break;case"rb":h.x-=t/2,h.y-=r/2;break}return this.bsInfo.h=r,this.bsInfo.w=t,o=h.x-parseFloat(t)/2,s=h.y+parseFloat(r)/2,u=h.x+parseFloat(t)/2,l=h.y-parseFloat(r)/2,a=new po(o,s,u,l),a}getLabelPxBoundsByText(e,t){var r,i,a,o,s,l=this.getLabelPxSize(t),u=H.cloneObject(e);if(t.labelAlign&&t.labelAlign!=="cm")switch(t.labelAlign){case"lt":u.x+=l.w/2,u.y+=l.h/2;break;case"lm":u.x+=l.w/2;break;case"lb":u.x+=l.w/2,u.y-=l.h/2;break;case"ct":u.y+=l.h/2;break;case"cb":u.y-=l.h/2;break;case"rt":u.x-=l.w/2,u.y+=l.h/2;break;case"rm":u.x-=l.w/2;break;case"rb":u.x-=l.w/2,u.y-=l.h/2;break}return this.bsInfo.h=l.h,this.bsInfo.w=l.w,i=u.x-l.w/2,a=u.y+l.h/2,t.fontStyle&&t.fontStyle==="italic"?s=u.x+l.w/2+parseInt(parseFloat(t.fontSize)/2):s=u.x+l.w/2,o=u.y-l.h/2,r=new po(i,a,s,o),r}getLabelPxSize(e){var t,r,i=1,a=.2,o=parseFloat(e.strokeWidth);t=e.label||this.text,e.fontSize?r=parseFloat(e.fontSize):r=parseFloat("12px");var s,l,u=t.split(` `),h=u.length;h>1?l=r*h+h+o+a*r:l=r+o+a*r+1,s=0,this.labelWTmp&&s255?r++:i++;return t.cnC=r,t.enC=i,t.textC=e.length,t}}class tv extends Vl{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.LinearRing",this.geometryType="LinearRing"}addComponent(e,t){var r=!1,i=this.components.pop();(t!=null||!e.equals(i))&&(r=super.addComponent.apply(this,arguments));var a=this.components[0];return super.addComponent.apply(this,[a]),r}removeComponent(e){var t=this.components&&this.components.length>3;if(t){this.components.pop(),super.removeComponent.apply(this,arguments);var r=this.components[0];super.addComponent.apply(this,[r])}return t}getArea(){var e=0;if(this.components&&this.components.length>2){for(var t=0,r=0,i=this.components.length;r0){e+=Math.abs(this.components[0].getArea());for(var t=1,r=this.components.length;t1},isLeftClick:function(n){return n.which&&n.which===1||n.button&&n.button===1},isRightClick:function(n){return n.which&&n.which===3||n.button&&n.button===2},stop:function(n,e){e||(n.preventDefault?n.preventDefault():n.returnValue=!1),n.stopPropagation?n.stopPropagation():n.cancelBubble=!0},findElement:function(n,e){for(var t=Ul.element(n);t.parentNode&&(!t.tagName||t.tagName.toUpperCase()!=e.toUpperCase());)t=t.parentNode;return t},observe:function(n,e,t,r){var i=H.getElement(n);if(r=r||!1,e==="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.attachEvent)&&(e="keydown"),this.observers||(this.observers={}),!i._eventCacheID){var a="eventCacheID_";i.id&&(a=i.id+"_"+a),i._eventCacheID=H.createUniqueID(a)}var o=i._eventCacheID;this.observers[o]||(this.observers[o]=[]),this.observers[o].push({element:i,name:e,observer:t,useCapture:r}),i.addEventListener?e==="mousewheel"?i.addEventListener(e,t,{useCapture:r,passive:!1}):i.addEventListener(e,t,r):i.attachEvent&&i.attachEvent("on"+e,t)},stopObservingElement:function(n){var e=H.getElement(n),t=e._eventCacheID;this._removeElementObservers(Ul.observers[t])},_removeElementObservers:function(n){if(n)for(var e=n.length-1;e>=0;e--){var t=n[e],r=new Array(t.element,t.name,t.observer,t.useCapture);Ul.stopObserving.apply(this,r)}},stopObserving:function(n,e,t,r){r=r||!1;var i=H.getElement(n),a=i._eventCacheID;e==="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.detachEvent)&&(e="keydown");var o=!1,s=Ul.observers[a];if(s)for(var l=0;!o&&l0){e+='"points":[';for(var r=0,i=this.components.length;r0)for(var o=0,s=0,l=[];o0){if(i===1)return new Ki(r[0].x,r[0].y);var a=[];for(let o=0;o0)if(i===1){let a=[];for(let o=0;o0)if(u===1){for(i=0,o=[];i=0;m--)if(v[g]=-1,c[m].containsBounds(c[g])){f[g]=f[m]*-1,f[g]<0&&(v[g]=m);break}for(let g=0;g0?o.push(h[g]):(o[v[g]].components=o[v[g]].components.concat(h[g].components),o.push(""))}else{o=new Array;for(let g=0;g0&&o.length>0&&(o[o.length-1].components=o[o.length-1].components.concat(l),l=[]),o.push(h[g])),g==a-1){var p=o.length;if(p)o[p-1].components=o[p-1].components.concat(l);else for(let m=0,y=l.length;m=0;_--)if(g[y]=-1,d[_].containsBounds(d[y])){v[y]=v[_]*-1,v[y]<0&&(g[y]=_);break}for(let y=0;y0?o.push(f[y]):(o[g[y]].components=o[g[y]].components.concat(f[y].components),o.push(""))}else{o=new Array;for(let y=0;y0&&o.length>0&&(o[o.length-1].components=o[o.length-1].components.concat(h),h=[]),o.push(f[y])),y==a-1){var m=o.length;if(m)o[m-1].components=o[m-1].components.concat(h);else for(let _=0,x=h.length;_e[o]){var s=e[o];e[o]=e[a],e[a]=s;var l=t[o];if(t[o]=t[a],t[a]=l,r&&r.length>0){var u=r[o];r[o]=r[a],r[a]=u}if(i&&i.length>0){var h=i[o];i[o]=i[a],i[a]=h}}}}class qat extends Vo{constructor(e){super(e),this.CLASS_NAME="SuperMap.Geometry3D",this.position=null,this.rotationX=null,this.rotationY=null,this.rotationZ=null,this.scaleX=null,this.scaleY=null,this.scaleZ=null,H.extend(this,e)}destroy(){this.position=null,this.rotationX=null,this.rotationY=null,this.rotationZ=null,this.scaleX=null,this.scaleY=null,this.scaleZ=null}}const bg={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};class sc extends LOe{constructor(e,t,r){super(null,null,t),this.fid=null,this.geometry=e||null,this.attributes={},t&&(this.attributes=H.extend(this.attributes,t)),this.bounds=null,this.state=null,this.style=r||null,this.url=null,this.lonlat=null,this.CLASS_NAME="SuperMap.Feature.Vector",sc.style={default:{fillColor:"#ee9900",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},select:{fillColor:"blue",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},temporary:{fillColor:"#66cccc",fillOpacity:.2,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"default",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},delete:{display:"none"}}}destroy(){this.layer&&(this.layer.removeFeatures(this),this.layer=null),this.geometry=null,super.destroy()}clone(){return new sc(this.geometry?this.geometry.clone():null,this.attributes,this.style)}toState(e){if(e===bg.UPDATE)switch(this.state){case bg.UNKNOWN:case bg.DELETE:this.state=e;break}else if(e===bg.INSERT)switch(this.state){case bg.UNKNOWN:break;default:this.state=e;break}else if(e===bg.DELETE)switch(this.state){case bg.INSERT:break;case bg.DELETE:break;case bg.UNKNOWN:case bg.UPDATE:this.state=e;break}else e===bg.UNKNOWN&&(this.state=e)}}class Ine{constructor(e){this.data=null,this.keepData=!1,H.extend(this,e),this.options=e,this.CLASS_NAME="SuperMap.Format"}destroy(){}read(e){}write(e){}}class yz extends Ine{constructor(e){super(e),this.indent=" ",this.space=" ",this.newline=` `,this.level=0,this.pretty=!1,this.nativeJSON=function(){return!!(window.JSON&&typeof JSON.parse=="function"&&typeof JSON.stringify=="function")}(),this.CLASS_NAME="SuperMap.Format.JSON",this.serialize={object:function(t){if(t==null)return"null";if(t.constructor===Date)return this.serialize.date.apply(this,[t]);if(t.constructor===Array)return this.serialize.array.apply(this,[t]);var r=["{"];this.level+=1;var i,a,o,s=!1;for(i in t)t.hasOwnProperty(i)&&(a=this.write.apply(this,[i,this.pretty]),o=this.write.apply(this,[t[i],this.pretty]),a!=null&&o!=null&&(s&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),a,":",this.writeSpace(),o),s=!0));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"}"),r.join("")},array:function(t){var r,i=["["];this.level+=1;for(var a=0,o=t.length;a0&&i.push(","),i.push(this.writeNewline(),this.writeIndent(),r));return this.level-=1,i.push(this.writeNewline(),this.writeIndent(),"]"),i.join("")},string:function(t){var r={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(t)?'"'+t.replace(/([\x00-\x1f\\"])/g,function(i,a){var o=r[a];return o||(o=a.charCodeAt(),"\\u00"+Math.floor(o/16).toString(16)+(o%16).toString(16))})+'"':'"'+t+'"'},number:function(t){return isFinite(t)?String(t):"null"},boolean:function(t){return String(t)},date:function(t){function r(i){return i<10?"0"+i:i}return'"'+t.getFullYear()+"-"+r(t.getMonth()+1)+"-"+r(t.getDate())+"T"+r(t.getHours())+":"+r(t.getMinutes())+":"+r(t.getSeconds())+'"'}}}read(e,t){var r;if(this.nativeJSON)try{r=JSON.parse(e,t)}catch{return{data:e}}return this.keepData&&(this.data=r),r}write(e,t){this.pretty=!!t;var r=null,i=typeof e;if(this.serialize[i])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[i].apply(this,[e])}catch{}return r}writeIndent(){var e=[];if(this.pretty)for(var t=0;tthis._toiSevrerFeature(a)):this._toiSevrerFeature(i)}toGeoJSON(e){var t={type:null};if(H.isArray(e)){t.type="FeatureCollection";var r=e.length;t.features=new Array(r);for(var i=0;i-1||(t[i]=e[i]);function a(o,s){if(!!(o.hasOwnProperty("fieldNames")&&o.hasOwnProperty("fieldValues"))){var l=o.fieldNames,u=o.fieldValues;for(var h in l)s[l[h]]=u[h]}}return t}}class Zat extends Ine{constructor(e){super(e),this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},this.CLASS_NAME="SuperMap.Format.WKT",this.extract={point:function(t){return t.x+" "+t.y},multipoint(t){for(var r=[],i=0,a=t.components.length;i0&&a.push(","),r=t[o].geometry,a.push(this.extractGeometry(r));return i&&a.push(")"),a.join("")}extractGeometry(e){var t=e.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[t])return null;var r=t==="collection"?"GEOMETRYCOLLECTION":t.toUpperCase(),i=r+"("+this.extract[t].apply(this,[e])+")";return i}}var Kat="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAAAdCAYAAAAjHtusAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozYWZlOGIwMi01MWE3LTRiZjYtYWVkYS05MGQ2ZTQ4YjZiMmUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODg0NkFBQUE3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODg0NkFBQTk3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4MWI3NzdhNC1lZmEyLTQ1MzUtOGQzNi03MmRjNDkyODMzN2UiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYTYzODVjMi1jNDQ1LTExN2EtYTc0ZC1lM2I5MzJlMGE4Y2QiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5q1HM0AAAF/ElEQVR42tSabYhUVRjHZ7W01C1uaCRW4F3oi9SXCUnwQ9gsGUFvOEtQH1bLu5VS9sbYh5KicjYt29qiGQwVg2xWWKgocob91AvC+CWsoJqB3qHMSdTMpZyeU/+Df07n3pk7997Z6cBv99z7nHvOvf/z/pxJNZvNVI/jCKXmv6EquAmVkxPSlvtp2GItr0/96fFQForChJAWDiVYTkMYMu4XBFcYjLOwWS3sNwmn8NGzZ0h4Flv/zwIdchAnh/slCGmmKUNIBzYPaXOUr0vPuEjD71JAPh7l61embzinhV3V8nnCGmGT8LwlzSL8/yUh4Tfjo9T/CgnCIYNKycA2Qq21AcHU/VHE80Idoo3Qs0W6p0UtUnkZvEMDeVcCyqxEafF7hL8Qf0oYsIj+lfC9cH1CwhchWAGCtZO+AooQOkdC1Km1VtCb63StW73uFSzgKFUkNwBbmZGGmqowhvg8ZNpH9oXChcIcYRdeNomgxLkaH+S1SGubAxyIpFv+Zp+0DYjrAS00j/dem2VGEl6FJ4Qa4quEu8j2hTCJ+GJhe4JjfQMf6JCYPPbysMPxBlp0BUKOogEF9Rg9/heNvNKYfM0KsZUZaYxX4STGrzJa+zbhPeFH2DcK10KItcI+pI0rVElwXl1ULaKnIJhDw0oRQpTQc1zcbwRU8ATy4DR6yMlTzwkqMziEWHvubJ4Nk4ZtHdnqwvwY17xq3Z4FjrG+z2Kdrdf2ZSGD+xlLPh6t1R0jP9fI22ZzKI92yvQl7EbmBxI4S7Y+vIAOL87QZqsc5uNnssxZIcfYjXT9snCR7jjobidp+FkxA2v+Cq1QervMDmp4P7Xs3YZtE9kOC3P/By6JGaETl8ElwueYTNTDq4UDsKnd7YfCNbT239LF1udS72xYJt1UWxNfN4IIP4bWuTpEja01JtMFZFsm/AHbtHBlDE6yasA4moYTrUbvdBTXHqUrAH4uSadbyzF+vbBM2IsNkS3MNa5305JxqfA02T4TnkX8XOH1mPw8ruVejpxbI9hZD2Cz1U7LdrrUvjP/WfZinNZhr6V27hP+FPZh9aLvLxVO4DllX0G2OcKnlO/DCblxaz6uXBtmi+8mBaP3/SP8IuEIiTRoPPQm2TaEmEyXo0JU+F0YiPFD0hhOsiE/vqeEVwyTgF8L51OilcIZ2I4Ll5NttvAJPfukUeB2sk0ZPSbKIUUJpCII7+DasWy08uhNNazT0wGHI7mAtB7KqMKm38HhDdAUibTVKGicbB8YAqrJ9DRsp43JdB4qUof1HQrPE6XTQWu3Ce/inVzjXhXpMiTwUYugNVQ+p80jrUsV5EH0POKeuXO9QjhFq5GryNYvfEMCDhsftYVsB9ETtG0V9ZjfhCURhbcJFpfwVZ9jvhxsLHwTYtp2svlWQw3vXL8UnqHVSIG8l8ex+tHhBXgjddgqHEZ8ufAA2aaEnYgrF/KrPXrEmMUqZ9THLW06xhoBaVueQpkug+ewOUphE3Qv2Q5gGamXYa+QbVq4O+DQ5FHyZqrjxNt7UHh9uuRa0F7HjCF8o9PCTOGnscM7g2u1Hl9C9oeEnxC/1ajZg8JLiM9Hj9GHJseMShwL2DO0G5yEWn3Zh1QUods5CPkIoqlwAZxhXMsb6HrcEPBxchhdJ6wj29vCW4hfLOzo8J3rltYX50nXQAATSf/K4DEaGlTLvplsk/QCpoD60EQ7gLYZc8H9wq+I3yncEOEcNhuz6HWf3XEiwU/4Y8YEqVp2P10rt+8REvBGw026i4aDcbL9jF8r8Blmf4fCOzhViiscskygXRdehf3CO4hfigmTBXyQrl8TFtD1IzQX3CbcQrY3hPcRv4z8OmHPXwchVNln2MmE7BX6VwIFi/he6uxvb6JM3m0fdqvx/ATidxg2JeC7VDErAw5NzGfvwRJVheEIQ8Mg/pdwIM+UOmi9Q8ivCsrIy0tF+wVbEcLrd3Pb2XisEb4Tdlhsi4WP4RBbaLGrHfC3PrvMIezy9rTpGm5lz9LOMG15xvFxD/j5gjzjjDbMOzk+9zzt3v5bgAEAibzFeFHVgYkAAAAASUVORK5CYII=";class POe{constructor(e){var t=this;e=e||{},this.speed=e.speed&&e.speed>=0?e.speed:1,this.frequency=e.speed&&e.frequency>=0?e.frequency:1e3,this.startTime=e.startTime&&e.startTime!=null?e.startTime:0,this.endTime=e.endTime&&e.endTime!=null&&e.endTime>=t.startTime?e.endTime:+new Date,this.repeat=e.repeat!==void 0?e.repeat:!0,this.reverse=e.reverse!==void 0?e.reverse:!1,this.currentTime=null,this.oldTime=null,this.running=!1,this.EVENT_TYPES=["start","pause","stop"],t.events=new y0(this,null,this.EVENT_TYPES),t.speed=Number(t.speed),t.frequency=Number(t.frequency),t.startTime=Number(t.startTime),t.endTime=Number(t.endTime),t.startTime=Date.parse(new Date(t.startTime)),t.endTime=Date.parse(new Date(t.endTime)),t.currentTime=t.startTime,this.CLASS_NAME="SuperMap.TimeControlBase"}updateOptions(e){var t=this;e=e||{},e.speed&&e.speed>=0&&(t.speed=e.speed,t.speed=Number(t.speed)),e.speed&&e.frequency>=0&&(t.frequency=e.frequency,t.frequency=Number(t.frequency)),e.startTime&&e.startTime!=null&&(t.startTime=e.startTime,t.startTime=Date.parse(new Date(t.startTime))),e.endTime&&e.endTime!=null&&e.endTime>=t.startTime&&(t.endTime=e.endTime,t.endTime=Date.parse(new Date(t.endTime))),e.repeat!=null&&(t.repeat=e.repeat),e.reverse!=null&&(t.reverse=e.reverse)}start(){var e=this;e.running||(e.running=!0,e.tick(),e.events.triggerEvent("start",e.currentTime))}pause(){var e=this;e.running=!1,e.events.triggerEvent("pause",e.currentTime)}stop(){var e=this;e.currentTime=e.startTime,e.running&&(e.running=!1),e.events.triggerEvent("stop",e.currentTime)}toggle(){var e=this;e.running?e.pause():e.start()}setSpeed(e){var t=this;return e>=0?(t.speed=e,!0):!1}getSpeed(){return this.speed}setFrequency(e){var t=this;return e>=0?(t.frequency=e,!0):!1}getFrequency(){return this.frequency}setStartTime(e){var t=this;return e=Date.parse(new Date(e)),e>t.endTime?!1:(t.startTime=e,t.currentTime=t.endTime&&(t.currentTime=t.startTime,t.tick()),!0)}getEndTime(){return this.endTime}setCurrentTime(e){var t=this;return t.currentTime=Date.parse(new Date(t.currentTime)),e>=t.startTime&&e<=t.endTime?(t.currentTime=e,t.startTime=t.currentTime,t.tick(),!0):!1}getCurrentTime(){return this.currentTime}setRepeat(e){this.repeat=e}getRepeat(){return this.repeat}setReverse(e){this.reverse=e}getReverse(){return this.reverse}getRunning(){return this.running}destroy(){var e=this;e.speed=null,e.frequency=null,e.startTime=null,e.endTime=null,e.currentTime=null,e.repeat=null,e.running=!1,e.reverse=null}tick(){}}class Jat extends POe{constructor(e,t){super(t);var r=this;r.callback=e,Function.prototype.bind||(Function.prototype.bind=function(i){if(typeof this!="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var a=Array.prototype.slice.call(arguments,1),o=this,s=function(){},l=function(){return o.apply(this instanceof s&&i?this:i,a.concat(Array.prototype.slice.call(arguments)))};return s.prototype=this.prototype,l.prototype=new s,l}),r.update=r.update.bind(r),r.oldTime=r.currentTime,r.CLASS_NAME="SuperMap.TimeFlowControl"}updateOptions(e){e=e||{},super.updateOptions(e)}start(){var e=this;e.running||(e.running=!0,e.reverse?e.currentTime===e.startTime&&(e.oldTime=e.endTime,e.currentTime=e.oldTime):e.oldTime===e.endTime&&(e.currentTime=e.startTime,e.oldTime=e.currentTime),e.tick())}stop(){super.stop();var e=this;e.oldTime=e.currentTime,e.running&&(e.running=!1),e.intervalId&&window.clearTimeout(e.intervalId)}destroy(){super.destroy();var e=this;e.oldTime=null,e.callback=null}tick(){var e=this;e.intervalId&&window.clearInterval(e.intervalId),e.intervalId=null,e.update(),e.intervalId=window.setInterval(e.update,e.frequency)}update(){var e=this;if(!!e.running)if(e.callback&&e.callback(e.currentTime),e.reverse){if(e.currentTime===e.startTime){if(!e.repeat)return e.running=!1,null;e.oldTime=e.endTime,e.currentTime=e.oldTime}else e.currentTime=e.oldTime,e.oldTime-=e.speed;e.oldTime<=e.startTime&&(e.oldTime=e.startTime)}else{if(e.currentTime===e.endTime){if(!e.repeat)return e.running=!1,e.stop(),null;e.stop(),e.currentTime=e.startTime,e.oldTime=e.currentTime,e.start()}else e.oldTime=e.currentTime,e.currentTime+=e.speed;e.currentTime>=e.endTime&&(e.currentTime=e.endTime)}}}(function(n,e){(function(t,r){r()})(at,function(){function t(g){var m=this.constructor;return this.then(function(y){return m.resolve(g()).then(function(){return y})},function(y){return m.resolve(g()).then(function(){return m.reject(y)})})}function r(g){var m=this;return new m(function(y,_){if(!(g&&typeof g.length<"u"))return _(new TypeError(typeof g+" "+g+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var x=Array.prototype.slice.call(g);if(x.length===0)return y([]);var S=x.length;function w(E,T){if(T&&(typeof T=="object"||typeof T=="function")){var C=T.then;if(typeof C=="function"){C.call(T,function(A){w(E,A)},function(A){x[E]={status:"rejected",reason:A},--S===0&&y(x)});return}}x[E]={status:"fulfilled",value:T},--S===0&&y(x)}for(var b=0;b-1?_:y}function d(y,_){_=_||{};var x=_.body;if(d.prototype.isPrototypeOf(y)){if(y.bodyUsed)throw new TypeError("Already read");this.url=y.url,this.credentials=y.credentials,_.headers||(this.headers=new i(y.headers)),this.method=y.method,this.mode=y.mode,x||(x=y._bodyInit,y.bodyUsed=!0)}else this.url=y;if(this.credentials=_.credentials||this.credentials||"omit",(_.headers||!this.headers)&&(this.headers=new i(_.headers)),this.method=f(_.method||this.method||"GET"),this.mode=_.mode||this.mode||null,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x,_)}d.prototype.clone=function(){return new d(this)};function v(y){var _=new FormData;return y.trim().split("&").forEach(function(x){if(x){var S=x.split("="),w=S.shift().replace(/\+/g," "),b=S.join("=").replace(/\+/g," ");_.append(decodeURIComponent(w),decodeURIComponent(b))}}),_}function p(y){var _=new i,x=y.getAllResponseHeaders().trim().split(` `);return x.forEach(function(S){var w=S.trim().split(":"),b=w.shift().trim(),E=w.join(":").trim();_.append(b,E)}),_}h.call(d.prototype);function g(y,_){_||(_={}),this._initBody(y,_),this.type="default",this.status=_.status,this.ok=this.status>=200&&this.status<300,this.statusText=_.statusText,this.headers=_.headers instanceof i?_.headers:new i(_.headers),this.url=_.url||""}h.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},g.error=function(){var y=new g(null,{status:0,statusText:""});return y.type="error",y};var m=[301,302,303,307,308];g.redirect=function(y,_){if(m.indexOf(_)===-1)throw new RangeError("Invalid status code");return new g(null,{status:_,headers:{location:y}})},e.Headers=i,e.Request=d,e.Response=g,e.fetch=function(y,_){return new Promise(function(x,S){var w;d.prototype.isPrototypeOf(y)&&!_?w=y:w=new d(y,_);var b=new XMLHttpRequest;function E(){if("responseURL"in b)return b.responseURL;if(/^X-Request-URL:/m.test(b.getAllResponseHeaders()))return b.getResponseHeader("X-Request-URL")}var T=!1;function C(){if(b.readyState===4){var A=b.status===1223?204:b.status;if(A<100||A>599){if(T)return;T=!0,S(new TypeError("Network request failed"));return}var M={status:A,statusText:b.statusText,headers:p(b),url:E()},I="response"in b?b.response:b.responseText;T||(T=!0,x(new g(I,M)))}}b.onreadystatechange=C,b.onload=C,b.onerror=function(){T||(T=!0,S(new TypeError("Network request failed")))},b.open(w.method,w.url,!0);try{w.credentials==="include"&&("withCredentials"in b?b.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(A){console&&console.warn&&console.warn("set withCredentials error:"+A)}"responseType"in b&&u.blob&&(b.responseType="blob"),w.headers.forEach(function(A,M){b.setRequestHeader(M,A)}),b.send(typeof w._bodyInit>"u"?null:w._bodyInit)})},e.fetch.polyfill=!0,n.exports&&(n.exports=e.fetch)})(typeof self<"u"?self:at)})(Qat);var QZ={exports:{}};(function(n,e){(function(t,r){r(e,n)})(at,function(t,r){var i={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function a(){return"jsonp_"+Date.now()+"_"+Math.ceil(Math.random()*1e5)}function o(u){try{delete window[u]}catch{window[u]=void 0}}function s(u){var h=document.getElementById(u);h&&document.getElementsByTagName("head")[0].removeChild(h)}function l(u){var h=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],c=u,f=h.timeout||i.timeout,d=h.jsonpCallback||i.jsonpCallback,v=void 0;return new Promise(function(p,g){var m=h.jsonpCallbackFunction||a(),y=d+"_"+m;window[m]=function(x){p({ok:!0,json:function(){return Promise.resolve(x)}}),v&&clearTimeout(v),s(y),o(m)},c+=c.indexOf("?")===-1?"?":"&";var _=document.createElement("script");_.setAttribute("src",""+c+d+"="+m),h.charset&&_.setAttribute("charset",h.charset),_.id=y,document.getElementsByTagName("head")[0].appendChild(_),v=setTimeout(function(){g(new Error("JSONP request to "+u+" timed out")),o(m),s(y),window[m]=function(){o(m)}},f),_.onerror=function(){g(new Error("JSONP request to "+u+" failed")),o(m),s(y),v&&clearTimeout(v)}})}r.exports=l})})(QZ,QZ.exports);const OOe=QZ.exports;let jde=window.fetch;var zF={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(n){var e=this;for(var t in n){e.queryKeys.push(t),typeof n[t]!="string"&&(n[t]=H.toJSON(n[t]));var r=encodeURIComponent(n[t]);e.queryValues.push(r)}},issue:function(n){for(var e=this,t=e.getUid(),r=n.url,i=[],a=r,o=0,s=e.queryKeys?e.queryKeys.length:0,l=0;l=e.limitLength){if(o==0)return!1;i.push(a),a=r,o=0,l--}else if(a.length+e.queryKeys[l].length+2+e.queryValues[l].length>e.limitLength)for(var u=e.queryValues[l];u.length>0;){var h=e.limitLength-a.length-e.queryKeys[l].length-2;a.indexOf("?")>-1?a+="&":a+="?";var c=u.substring(0,h);c.substring(h-1,h)==="%"?(h-=1,c=u.substring(0,h)):c.substring(h-2,h-1)==="%"&&(h-=2,c=u.substring(0,h)),a+=e.queryKeys[l]+"="+c,u=u.substring(h),c.length>0&&(i.push(a),a=r,o=0)}else o++,a.indexOf("?")>-1?a+="&":a+="?",a+=e.queryKeys[l]+"="+e.queryValues[l];return i.push(a),e.send(i,"SuperMapJSONPCallbacks_"+t,n&&n.proxy)},getUid:function(){var n=new Date().getTime(),e=Math.floor(Math.random()*1e17);return n*1e3+e},send:function(n,e,t){var r=n.length;if(r>0)return new Promise(i=>{for(var a=new Date().getTime(),o=0;o-1?s+="&":s+="?",s+="sectionCount="+r,s+="§ionIndex="+o,s+="&jsonpUserID="+a,t&&(s=decodeURIComponent(s),s=t+encodeURIComponent(s)),OOe(s,{jsonpCallbackFunction:e,timeout:3e4}).then(l=>{i(l.json())})}})},GET:function(n){var e=this;return e.queryKeys.length=0,e.queryValues.length=0,e.addQueryStrings(n.params),e.issue(n)},POST:function(n){var e=this;return e.queryKeys.length=0,e.queryValues.length=0,e.addQueryStrings({requestEntity:n.data}),e.issue(n)},PUT:function(n){var e=this;return e.queryKeys.length=0,e.queryValues.length=0,e.addQueryStrings({requestEntity:n.data}),e.issue(n)},DELETE:function(n){var e=this;return e.queryKeys.length=0,e.queryValues.length=0,e.addQueryStrings({requestEntity:n.data}),e.issue(n)}},eK,ROe,eot=function(n){eK=n},DOe=function(){return eK!=null?eK:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},tot=function(n){return ROe=n},tK=function(){return ROe||45e3},li={commit:function(n,e,t,r){switch(n=n&&n.toUpperCase(),n){case"GET":return this.get(e,t,r);case"POST":return this.post(e,t,r);case"PUT":return this.put(e,t,r);case"DELETE":return this.delete(e,t,r);default:return this.get(e,t,r)}},supportDirectRequest:function(n,e){return H.isInTheSameDomain(n)?!0:e.crossOrigin!=null?e.crossOrigin:DOe()||e.proxy},get:function(n,e,t){t=t||{};var r="GET";if(n=H.urlAppend(n,this._getParameterString(e||{})),n=this._processUrl(n,t),!this.supportDirectRequest(n,t)){n=n.replace(".json",".jsonp");var i={url:n,data:e};return zF.GET(i)}return this.urlIsLong(n)?this._postSimulatie(r,n.substring(0,n.indexOf("?")),e,t):this._fetch(n,e,t,r)},delete:function(n,e,t){t=t||{};var r="DELETE";if(n=H.urlAppend(n,this._getParameterString(e||{})),n=this._processUrl(n,t),!this.supportDirectRequest(n,t)){n=n.replace(".json",".jsonp");var i={url:n+="&_method=DELETE",data:e};return zF.DELETE(i)}return this.urlIsLong(n)?this._postSimulatie(r,n.substring(0,n.indexOf("?")),e,t):this._fetch(n,e,t,r)},post:function(n,e,t){if(t=t||{},n=this._processUrl(n,t),!this.supportDirectRequest(n,t)){n=n.replace(".json",".jsonp");var r={url:H.urlAppend(n,"_method=POST"),data:e};return zF.POST(r)}return this._fetch(n,e,t,"POST")},put:function(n,e,t){if(t=t||{},n=this._processUrl(n,t),!this.supportDirectRequest(n,t)){n=n.replace(".json",".jsonp");var r={url:n+="&_method=PUT",data:e};return zF.PUT(r)}return this._fetch(n,e,t,"PUT")},urlIsLong:function(n){for(var e=0,t=null,r=0,i=n.length;r-1?"&":"?";return e+=i+"_method="+n,typeof t!="string"&&(t=JSON.stringify(t)),this.post(e,t,r)},_processUrl:function(n,e){if(this._isMVTRequest(n))return n;if(n.indexOf(".json")===-1&&!e.withoutFormatSuffix)if(n.indexOf("?")<0)n+=".json";else{var t=n.split("?");t.length===2&&(n=t[0]+".json?"+t[1])}return e&&e.proxy&&(typeof e.proxy=="function"?n=e.proxy(n):(n=decodeURIComponent(n),n=e.proxy+encodeURIComponent(n))),n},_fetch:function(n,e,t,r){return t=t||{},t.headers=t.headers||{},!t.headers["Content-Type"]&&!FormData.prototype.isPrototypeOf(e)&&(t.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),t.timeout?this._timeout(t.timeout,jde(n,{method:r,headers:t.headers,body:r==="PUT"||r==="POST"?e:void 0,credentials:this._getWithCredentials(t),mode:"cors",timeout:tK()}).then(function(i){return i})):jde(n,{method:r,body:r==="PUT"||r==="POST"?e:void 0,headers:t.headers,credentials:this._getWithCredentials(t),mode:"cors",timeout:tK()}).then(function(i){return i})},_getWithCredentials:function(n){return n.withCredentials===!0?"include":n.withCredentials===!1?"omit":"same-origin"},_fetchJsonp:function(n,e){return e=e||{},OOe(n,{method:"GET",timeout:e.timeout}).then(function(t){return t})},_timeout:function(n,e){return new Promise(function(t,r){setTimeout(function(){r(new Error("timeout"))},n),e.then(t,r)})},_getParameterString:function(n){var e=[];for(var t in n){var r=n[t];if(r!=null&&typeof r!="function"){var i;Array.isArray(r)||r.toString()==="[object Object]"?i=encodeURIComponent(JSON.stringify(r)):i=encodeURIComponent(r),e.push(encodeURIComponent(t)+"="+i)}}return e.join("&")},_isMVTRequest:function(n){return n.indexOf(".mvt")>-1||n.indexOf(".pbf")>-1}};class xs{static generateToken(e,t){var r=this.servers[e];if(!!r)return li.post(r.tokenServiceUrl,JSON.stringify(t.toJSON())).then(function(i){return i.text()})}static registerServers(e){this.servers=this.servers||{},H.isArray(e)||(e=[e]);for(var t=0;ti)}getErrMsgPromise(e){return new Promise(t=>{t(e)})}uploadDataRequest(e,t){var r=this.iportalUrl+"/web/mycontent/datas/"+e+"/upload.json";return this.request("POST",r,t)}addData(e,t){if(!(e instanceof UOe))return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");var r=this.iportalUrl+"/web/mycontent/datas.json",i={fileName:e.fileName,tags:e.tags,type:e.type},a=e.type.toLowerCase(),o;if(a==="excel"||a==="csv"){if(!(e.dataMetaInfo instanceof iK))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");o={xField:e.dataMetaInfo.xField,yField:e.dataMetaInfo.yField},a==="csv"&&(o.fileEncoding=e.dataMetaInfo.fileEncoding),i.coordType="WGS84",i.dataMetaInfo=o}else if(a==="hdfs"||a==="hbase"){if(!(e.dataMetaInfo instanceof iK))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");if(!(e.dataMetaInfo.dataStoreInfo instanceof VOe))return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo is not instanceof iPortalDataStoreInfoParam !");var s={type:e.dataMetaInfo.dataStoreInfo.type};switch(a){case"hdfs":s.url=e.dataMetaInfo.dataStoreInfo.url,o={url:e.dataMetaInfo.url,dataStoreInfo:s};break;case"hbase":if(!(e.dataMetaInfo.dataStoreInfo.connectionInfo instanceof $Oe))return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo.connectionInfo is not instanceof iPortalDataConnectionInfoParam !");s.connectionInfo={dataBase:e.dataMetaInfo.dataStoreInfo.connectionInfo.dataBase,server:e.dataMetaInfo.dataStoreInfo.connectionInfo.server,engineType:"HBASE"},s.datastoreType="SPATIAL",o={dataStoreInfo:s};break}i.dataMetaInfo=o}return this.request("POST",r,JSON.stringify(i)).then(l=>a==="hdfs"||a==="hbase"?l:l.childID?this.uploadDataRequest(l.childID,t):l.customResult)}publishOrUnpublish(e,t){if(!e.dataId||!e.serviceType)return this.getErrMsgPromise("option.dataID and option.serviceType are Required!");var r=e.dataId,i=e.dataServiceId,a=e.serviceType,o=this.iportalUrl+"/web/mycontent/datas/"+r+"/publishstatus.json?serviceType="+a;return i&&(o+="&dataServiceId="+i),this.request("PUT",o,JSON.stringify(t)).then(s=>t?(i||(i=s.customResult),i):s)}getDataPublishedStatus(e,t){var r=this.iportalUrl+"/web/mycontent/datas/"+e+"/publishstatus.json?dataServiceId="+t+"&forPublish=true";return this.request("GET",r)}unPublishDataService(e){return this.publishOrUnpublish(e,!1)}publishDataService(e){return this.publishOrUnpublish(e,!0)}}class ra{constructor(e,t){let r=this;this.EVENT_TYPES=["processCompleted","processFailed"],this.events=null,this.eventListeners=null,this.url=null,this.urls=null,this.proxy=null,this.index=null,this.length=null,this.totalTimes=null,this.POLLING_TIMES=3,this.isInTheSameDomain=null,this.withCredentials=!1,H.isArray(e)?(r.urls=e,r.length=e.length,r.totalTimes=r.length,r.length===1?r.url=e[0]:(r.index=parseInt(Math.random()*r.length),r.url=e[r.index])):(r.totalTimes=1,r.url=e),H.isArray(e)&&!r.isServiceSupportPolling()&&(r.url=e[0],r.totalTimes=1),t=t||{},this.crossOrigin=t.crossOrigin,this.headers=t.headers,H.extend(this,t),r.isInTheSameDomain=H.isInTheSameDomain(r.url),r.events=new y0(r,null,r.EVENT_TYPES,!0),r.eventListeners instanceof Object&&r.events.on(r.eventListeners),this.CLASS_NAME="SuperMap.CommonServiceBase"}destroy(){let e=this;H.isArray(e.urls)&&(e.urls=null,e.index=null,e.length=null,e.totalTimes=null),e.url=null,e.isInTheSameDomain=null,e.EVENT_TYPES=null,e.events&&(e.events.destroy(),e.events=null),e.eventListeners&&(e.eventListeners=null)}request(e){let t=e.scope.format;if(typeof e.success=="string"&&(e.scope.format=e.success,t=e.success,e.success=null,e.failure=null),t&&!this.supportDataFormat(t))throw new Error(`${this.CLASS_NAME} is not surport ${t} format!`);let r=this;return e.url=e.url||r.url,this._returnContent(e)&&!e.url.includes("returnContent=true")&&(e.url=H.urlAppend(e.url,"returnContent=true")),e.proxy=e.proxy||r.proxy,e.withCredentials=e.withCredentials!=null?e.withCredentials:r.withCredentials,e.crossOrigin=e.crossOrigin!=null?e.crossOrigin:r.crossOrigin,e.headers=e.headers||r.headers,e.isInTheSameDomain=r.isInTheSameDomain,e.withoutFormatSuffix=e.scope.withoutFormatSuffix||!1,e.url=xs.appendCredential(e.url),r.calculatePollingTimes(),e.scope=r,r.totalTimes>0?(r.totalTimes--,r.ajaxPolling(e)):r._commit(e)}ajaxPolling(e){let t=this,r=e.url,i=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;return t.index=parseInt(Math.random()*t.length),t.url=t.urls[t.index],r=r.replace(i,i.exec(t.url)[0]),e.url=r,e.isInTheSameDomain=H.isInTheSameDomain(r),t._commit(e)}calculatePollingTimes(){let e=this;e.times?e.totalTimes>e.POLLING_TIMES?e.times>e.POLLING_TIMES?e.totalTimes=e.POLLING_TIMES:e.totalTimes=e.times:e.timese.POLLING_TIMES&&(e.totalTimes=e.POLLING_TIMES),e.totalTimes--}isServiceSupportPolling(){let e=this;return!(e.CLASS_NAME==="SuperMap.REST.ThemeService"||e.CLASS_NAME==="SuperMap.REST.EditFeaturesService")}transformResult(e,t){return e=H.transformResult(e),{result:e,options:t}}transformErrorResult(e,t){return e=H.transformResult(e),{error:e.error||e,options:t}}serviceProcessCompleted(e,t){e=this.transformResult(e).result,this.events.triggerEvent("processCompleted",{result:e,options:t})}serviceProcessFailed(e,t){e=this.transformErrorResult(e).error;let r=e.error||e;this.events.triggerEvent("processFailed",{error:r,options:t})}_returnContent(e){return e.scope.format===Ni.FGB?!1:!!e.scope.returnContent}supportDataFormat(e){return this.dataFormat().includes(e)}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER]}_commit(e){if(e.method==="POST"||e.method==="PUT"||e.method==="PATCH")if(e.params&&(e.url=H.urlAppend(e.url,H.getParameterString(e.params||{}))),typeof e.data=="object")try{e.params=H.toJSON(e.data)}catch{console.log("\u4E0D\u662Fjson\u5BF9\u8C61")}else e.params=e.data;return li.commit(e.method,e.url,e.params,{headers:e.headers,withoutFormatSuffix:e.withoutFormatSuffix,withCredentials:e.withCredentials,crossOrigin:e.crossOrigin,timeout:e.async?0:null,proxy:e.proxy}).then(function(t){return t.text?t.text():t.json?t.json():t}).then(function(t){let r=t;return typeof t=="string"&&(r=new yz().read(t)),(!r||r.error||r.code>=300&&r.code!==304)&&(r&&r.error?r={error:r.error}:r={error:r}),r&&e.scope.format===Ni.FGB&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r}).catch(function(t){return{error:t}}).then(t=>{let r={object:this};if(t.error){const o="processFailed";if(this.events&&this.events.listeners[o]&&this.events.listeners[o].length){var i=e.failure&&(e.scope?UR.bind(e.failure,e.scope):e.failure);i?i(t,e):this.serviceProcessFailed(t,e)}else r={...r,...this.transformErrorResult(t,e)},r.type=o,e.failure&&e.failure(r)}else{const o="processCompleted";if(this.events&&this.events.listeners[o]&&this.events.listeners[o].length){var a=e.success&&(e.scope?UR.bind(e.success,e.scope):e.success);a?a(t,e):this.serviceProcessCompleted(t,e)}else t.succeed=t.succeed==null?!0:t.succeed,r={...r,...this.transformResult(t,e)},r.type=o,e.success&&e.success(r)}return r})}}class WOe{constructor(e){e.filters&&typeof e.filters=="string"&&(e.filters=e.filters.split(",")),this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,H.extend(this,e)}destroy(){this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null}}class HOe{constructor(e){e.filters&&(e.filters=e.filters.split(",")),this.x=null,this.y=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,this.geoDecodingRadius=null,H.extend(this,e)}destroy(){this.x=null,this.y=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,this.geoDecodingRadius=null}}class jOe extends ra{constructor(e,t){super(e,t),this.options=t||{},this.CLASS_NAME="SuperMap.AddressMatchService"}destroy(){super.destroy()}code(e,t,r){if(t instanceof WOe)return this.processAsync(e,t,r)}decode(e,t,r){if(t instanceof HOe)return this.processAsync(e,t,r)}processAsync(e,t,r){return this.request({method:"GET",url:e,params:t,scope:this,success:r,failure:r})}transformResult(e,t){return e.succeed&&delete e.succeed,{result:e,options:t}}}class Lne{constructor(e){this.aggName=null,this.aggFieldName=null,this.CLASS_NAME="SuperMap.AggregationParameter",H.extend(this,e)}destroy(){var e=this;e.aggName=null,e.aggFieldName=null,e.aggType=null}}class XOe extends Lne{constructor(e){super(),this.subAggs=null,this.aggType=null,this.CLASS_NAME="SuperMap.BucketAggParameter",H.extend(this,e)}destroy(){var e=this;e.subAggs&&(e.subAggs=null)}}class oot extends Lne{constructor(e){super(),this.aggType=COe.AVG,H.extend(this,e),this.CLASS_NAME="SuperMap.MetricsAggParameter"}destroy(){super.destroy();var e=this;e.aggType=null}}class iB{constructor(e){this.dataset=null,this.targetDatasourceName=null,this.totalGridName=null,this.diffuseDatasetGridName=null,this.durationDatasetGridName=null,this.directDatasetGridName=null,this.latitude=null,this.timeMode="MULTIDAYS",this.dayStart=null,this.dayEnd=null,this.hourStart=null,this.hourEnd=null,this.transmittance=null,this.hourInterval=null,this.dayInterval=null,this.deleteExistResultDataset=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.AreaSolarRadiationParameters"}destroy(){var e=this;e.dataset=null,e.zFactor=1,e.averageCurvatureName=null,e.profileCurvatureName=null,e.planCurvatureName=null,e.deleteExistResultDataset=!0}static toObject(e,t){var r={};for(var i in e)if(i!=="dataset"){var a=i==="latitude"||i==="timeMode"||i==="dayStart",o=i==="dayEnd"||i==="hourStart"||i==="hourEnd",s=i==="transmittance"||i==="hourInterval"||i==="dayInterval";a||o||s?r[i]=e[i]:t[i]=e[i]}t.parameter=r}}class Hu extends ra{constructor(e,t){super(e,t),this.format=t&&t.format||Ni.GEOJSON,this.CLASS_NAME="SuperMap.SpatialAnalystBase"}destroy(){super.destroy(),this.format=null}transformResult(e,t){var r=this,i;if(e=H.transformResult(e),e&&r.format===Ni.GEOJSON&&typeof r.toGeoJSONResult=="function")if(H.isArray(e)){for(var a=0;a0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.numericPrecision=null,e.rangeMode=null,e.rangeCount=null,e.colorGradientType=null}}class KOe{constructor(e){if(this.datasetName="",this.bounds="",this.distance="",this.distanceField="",this.distanceUnit=zR.METER,this.dissolveField="",this.output=null,this.mappingParameters=null,!e)return this;H.extend(this,e),this.CLASS_NAME="SuperMap.BuffersAnalystJobsParameter"}destroy(){this.datasetName=null,this.bounds=null,this.distance=null,this.distanceField=null,this.distanceUnit=null,this.dissolveField=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},r==="bounds"&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class Mm extends ra{constructor(e,t){t=t||{},super(e,t),this.CLASS_NAME="SuperMap.ProcessingServiceBase"}destroy(){super.destroy()}getJobs(e,t){var r=this;return li.get(xs.appendCredential(e),null,{proxy:r.proxy}).then(function(i){return i.json()}).then(function(i){const a={result:i,object:r,type:"processCompleted"};return t(a),a}).catch(function(i){const a={error:i,object:r,type:"processFailed"};return t(a),a})}addJob(e,t,r,i,a,o){var s=this,l=null;t&&t instanceof r&&(l=new Object,r.toObject(t,l));let u=Object.assign({"Content-Type":"application/x-www-form-urlencoded"},s.headers||{});var h={proxy:s.proxy,headers:u,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,isInTheSameDomain:s.isInTheSameDomain};return li.post(xs.appendCredential(e),JSON.stringify(l),h).then(function(c){return c.json()}).then(function(c){return c.succeed?s.transformResult(c,i,a,o):(c=s.transformErrorResult(c),c.options=s,c.type="processFailed",a(c),c)}).catch(function(c){return c=s.transformErrorResult({error:c}),c.options=s,c.type="processFailed",a(c),c})}transformResult(e,t,r,i){e=H.transformResult(e),t=t||1e3;var a=this;if(e)return new Promise(o=>{var s=setInterval(function(){li.get(xs.appendCredential(e.newResourceLocation),{_t:new Date().getTime()}).then(function(l){return l.json()}).then(function(l){if(o({object:a,id:l.id,state:l.state}),i({id:l.id,state:l.state,object:a}),l.state.runState==="LOST"||l.state.runState==="KILLED"||l.state.runState==="FAILED"){clearInterval(s);const u={error:l.state.errorMsg,state:l.state.runState,object:a,type:"processFailed"};o(u),r(u)}if(l.state.runState==="FINISHED"&&l.setting.serviceInfo){clearInterval(s);const u={result:l,object:a,type:"processCompleted"};o(u),r(u)}}).catch(function(l){clearInterval(s);const u={error:l,object:a,type:"processFailed"};o(u),r(u)})},t)})}}class aB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/buffers"),this.CLASS_NAME="SuperMap.BuffersAnalystJobsService"}destroy(){super.destroy()}getBuffersJobs(e){return super.getJobs(this.url,e)}getBuffersJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addBuffersJob(e,t,r,i){return super.addJob(this.url,e,KOe,t,r,i)}}class JOe{constructor(e){var t=this;this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=!1,H.extend(t,e),this.CLASS_NAME="SuperMap.BurstPipelineAnalystParameters"}destroy(){var e=this;e.sourceNodeIDs=null,e.edgeID=null,e.nodeID=null,e.isUncertainDirectionValid=null}}class Bd extends ra{constructor(e,t){super(e,t),this.format=Ni.GEOJSON,this.CLASS_NAME="SuperMap.NetworkAnalystServiceBase"}destroy(){super.destroy(),this.format=null}transformResult(e,t){var r=this,i;return e=H.transformResult(e),e&&r.format===Ni.GEOJSON&&typeof r.toGeoJSONResult=="function"&&(i=r.toGeoJSONResult(e)),i||(i=e),{result:i,options:t}}toGeoJSONResult(e){return null}}class QOe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.BurstPipelineAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(!(e instanceof JOe))return null;var r=this,i;if(r.url=H.urlPathAppend(r.url,"burstAnalyse"),i={sourceNodeIDs:e.sourceNodeIDs,isUncertainDirectionValid:e.isUncertainDirectionValid},e.edgeID!==null&&e.nodeID!==null)throw new Error("edgeID and nodeID cannot be null at the same time.");if(e.edgeID===null&&e.nodeID===null)throw new Error("edgeID and nodeID cannot be null at the same time.");return e.edgeID!==null?i.edgeID=e.edgeID:i.nodeID=e.nodeID,r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}class eRe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.ChartFeatureInfoSpecsService"}destroy(){super.destroy(),H.reset(this)}processAsync(e){var t=this,r="GET";return t.isTempLayers||H.urlPathAppend(t.url,"chartFeatureInfoSpecs"),t.request({method:r,params:null,scope:t,success:e,failure:e})}}class tRe{constructor(e){this.isQueryPoint=null,this.isQueryLine=null,this.isQueryRegion=null,this.attributeFilter=null,this.chartFeatureInfoSpecCode=null,H.extend(this,e),this.CLASS_NAME="SuperMap.ChartQueryFilterParameter"}destroy(){var e=this;e.isQueryPoint=null,e.isQueryLine=null,e.isQueryRegion=null,e.attributeFilter=null,e.chartFeatureInfoSpecCode=null}toJson(){var e="";return e+='"isQueryPoint":'+this.isQueryPoint+",",e+='"isQueryLine":'+this.isQueryLine+",",e+='"isQueryRegion":'+this.isQueryRegion+",",this.attributeFilter&&(e+='"attributeFilter": "'+this.attributeFilter+'",'),e+='"chartFeatureInfoSpecCode":'+this.chartFeatureInfoSpecCode,e="{"+e+"}",e}}class rRe{constructor(e){this.queryMode=null,this.bounds=null,this.chartLayerNames=null,this.chartQueryFilterParameters=null,this.returnContent=!0,this.startRecord=0,this.expectCount=null,H.extend(this,e),this.CLASS_NAME="SuperMap.ChartQueryParameters"}destroy(){var e=this;e.queryMode=null,e.bounds=null,e.chartLayerNames=null,e.chartQueryFilterParameters=null,e.returnContent=!0,e.startRecord=0,e.expectCount=null}getVariablesJson(){var e="";if(e+='"queryMode":"'+this.queryMode+'",',this.chartLayerNames&&this.chartLayerNames.length){for(var t=[],r=this.chartLayerNames.length,i=0;i0&&(r+=","),r+='{"x":'+t[a].x+',"y":'+t[a].y+"}";else if(e===!0)for(let a=0;a0&&(r+=","),r+=t[a];return r+="]",r}}class lRe extends ra{constructor(e,t){t=t||{},t.EVENT_TYPES=["broadcastSocketConnected","broadcastSocketClosed","broadcastSocketError","broadcastFailed","broadcastSucceeded","subscribeSocketConnected","subscribeSocketClosed","subscribeSocketError","messageSucceeded","setFilterParamSucceeded"],super(e,t),this.geometry=null,this.prjCoordSys=null,this.excludeField=null,H.extend(this,t),this.CLASS_NAME="SuperMap.DataFlowService"}initBroadcast(){var e=this;return this.broadcastWebSocket=this._connect(H.urlPathAppend(e.url,"broadcast")),this.broadcastWebSocket.onopen=function(t){e.broadcastWebSocket.isOpen=!0,t.eventType="broadcastSocketConnected",e.events.triggerEvent("broadcastSocketConnected",t)},this.broadcastWebSocket.onclose=function(t){e.broadcastWebSocket&&(e.broadcastWebSocket.isOpen=!1),t.eventType="broadcastSocketClosed",e.events.triggerEvent("broadcastSocketClosed",t)},this.broadcastWebSocket.onerror=function(t){t.eventType="broadcastSocketError",e.events.triggerEvent("broadcastSocketError",t)},this}broadcast(e){if(!this.broadcastWebSocket||!this.broadcastWebSocket.isOpen){this.events.triggerEvent("broadcastFailed");return}this.broadcastWebSocket.send(JSON.stringify(e)),this.events.triggerEvent("broadcastSucceeded")}initSubscribe(){var e=this;return this.subscribeWebSocket=this._connect(H.urlPathAppend(e.url,"subscribe")),this.subscribeWebSocket.onopen=function(t){e.subscribeWebSocket.send(e._getFilterParams()),t.eventType="subscribeSocketConnected",e.events.triggerEvent("subscribeSocketConnected",t)},this.subscribeWebSocket.onclose=function(t){t.eventType="subscribeWebSocketClosed",e.events.triggerEvent("subscribeWebSocketClosed",t)},this.subscribeWebSocket.onerror=function(t){t.eventType="subscribeSocketError",e.events.triggerEvent("subscribeSocketError",t)},this.subscribeWebSocket.onmessage=function(t){e._onMessage(t)},this}setExcludeField(e){return this.excludeField=e,this.subscribeWebSocket.send(this._getFilterParams()),this}setGeometry(e){return this.geometry=e,this.subscribeWebSocket.send(this._getFilterParams()),this}unSubscribe(){!this.subscribeWebSocket||(this.subscribeWebSocket.close(),this.subscribeWebSocket=null)}unBroadcast(){!this.broadcastWebSocket||(this.broadcastWebSocket.close(),this.broadcastWebSocket=null)}destroy(){ra.prototype.destroy.apply(this,arguments);var e=this;e.geometry=null,e.prjCoordSys=null,e.excludeField=null,this.unBroadcast(),this.unSubscribe()}_getFilterParams(){var e={filterParam:{prjCoordSys:this.prjCoordSys,excludeField:this.excludeField,geometry:this.geometry}};return H.toJSON(e)}_onMessage(e){if(e.data&&e.data.indexOf("filterParam")>=0){var t=JSON.parse(e.data);e.filterParam=t,e.eventType="setFilterParamSucceeded",this.events.triggerEvent("setFilterParamSucceeded",e);return}var r=JSON.parse(e.data);e.featureResult=r,e.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",e)}_connect(e){if(e=xs.appendCredential(e),"WebSocket"in window)return new WebSocket(e);if("MozWebSocket"in window){var t=window.MozWebSocket;return new t(e)}else return console.log("no WebSocket"),null}}class uRe{constructor(e){e=e||{},this.bounds=null,this.dataSourceName=null,this.description=null,this.encodeType=null,this.isReadOnly=null,this.name=null,this.prjCoordSys=null,this.tableName=null,this.type=null,H.extend(this,e);var t=this.bounds;t&&(this.bounds=new po(t.leftBottom.x,t.leftBottom.y,t.rightTop.x,t.rightTop.y)),this.CLASS_NAME="SuperMap.DatasetInfo"}destroy(){H.reset(this)}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e.bounds&&e.bounds.toServerJSONObject&&(e.bounds=e.bounds.toServerJSONObject()),e}}class Rne{constructor(e){this.operation=fOe.UNION,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.OverlayAnalystParameters"}destroy(){var e=this;e.operation=null}}class sK extends Rne{constructor(e){super(e),this.operateDataset=null,this.operateDatasetFields=[],this.operateDatasetFilter=new Of,this.operateRegions=[],this.sourceDataset=null,this.sourceDatasetFields=[],this.sourceDatasetFilter=new Of,this.tolerance=0,this.resultSetting=new _z,H.extend(this,e),this.CLASS_NAME="SuperMap.DatasetOverlayAnalystParameters"}destroy(){super.destroy();var e=this;if(e.operateDataset=null,e.operateDatasetFields=null,e.operateDatasetFilter&&(e.operateDatasetFilter.destroy(),e.operateDatasetFilter=null),e.operateRegions){for(var t=0,r=e.operateRegions,i=r.length;t0&&(r+=","),r+='{"x":'+t[a].x+',"y":'+t[a].y+"}";else if(e===!0)for(let a=0;a0&&(r+=","),r+=t[a];return r+="]",r}toGeoJSONResult(e){if(!e||!e.facilityPathList)return e;var t=new uh;return e.facilityPathList.map(function(r){return r.route&&(r.route=t.toGeoJSON(r.route)),r.pathGuideItems&&(r.pathGuideItems=t.toGeoJSON(r.pathGuideItems)),r.edgeFeatures&&(r.edgeFeatures=t.toGeoJSON(r.edgeFeatures)),r.nodeFeatures&&(r.nodeFeatures=t.toGeoJSON(r.nodeFeatures)),r}),e}}class LRe{constructor(e){this.expectedSupplyCenterCount=null,this.isFromCenter=!1,this.supplyCenters=null,this.turnWeightField=null,this.weightName=null,H.extend(this,e),this.CLASS_NAME="SuperMap.FindLocationParameters"}destroy(){var e=this;if(e.expectedSupplyCenterCount=null,e.isFromCenter=null,e.turnWeightField=null,e.weightName=null,e.supplyCenters){for(var t=0,r=e.supplyCenters,i=r.length;t0&&(t+=","),t+=H.toJSON(e[i]);return t+="]",t}toGeoJSONResult(e){if(!e)return null;var t=new uh;return e.demandResults&&(e.demandResults=t.toGeoJSON(e.demandResults)),e.supplyResults&&(e.supplyResults=t.toGeoJSON(e.supplyResults)),e}}class ORe{constructor(e){this.centers=null,this.hasLeastTotalCost=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new $2,H.extend(this,e),this.CLASS_NAME="SuperMap.FindMTSPPathsParameters"}destroy(){var e=this;e.centers=null,e.hasLeastTotalCost=null,e.isAnalyzeById=null,e.nodes=null,e.maxWeight=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class RRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindMTSPPathsService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof ORe){var r=this,i,a=r.getJson(e.isAnalyzeById,e.centers),o=r.getJson(e.isAnalyzeById,e.nodes);return r.url=H.urlPathAppend(r.url,"mtsppath"),i={centers:a,nodes:o,parameter:H.toJSON(e.parameter),hasLeastTotalCost:e.hasLeastTotalCost},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(e===!1)for(let a=0;a0&&(r+=","),r+='{"x":'+t[a].x+',"y":'+t[a].y+"}";else if(e===!0)for(let a=0;a0&&(r+=","),r+=t[a];return r+="]",r}toGeoJSONResult(e){if(!e||!e.pathList)return null;var t=new uh;return e.pathList.map(function(r){return r.route&&(r.route=t.toGeoJSON(r.route)),r.pathGuideItems&&(r.pathGuideItems=t.toGeoJSON(r.pathGuideItems)),r.edgeFeatures&&(r.edgeFeatures=t.toGeoJSON(r.edgeFeatures)),r.nodeFeatures&&(r.nodeFeatures=t.toGeoJSON(r.nodeFeatures)),r}),e}}class DRe{constructor(e){this.isAnalyzeById=!1,this.hasLeastEdgeCount=null,this.nodes=null,this.parameter=new $2,H.extend(this,e),this.CLASS_NAME="SuperMap.FindPathParameters"}destroy(){var e=this;e.isAnalyzeById=null,e.hasLeastEdgeCount=null,e.nodes=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class NRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindPathService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof DRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"path"),i={hasLeastEdgeCount:e.hasLeastEdgeCount,parameter:H.toJSON(e.parameter),nodes:r.getJson(e.isAnalyzeById,e.nodes)},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(e===!1)for(let a=0;a0&&(r+=","),r+='{"x":'+t[a].x+',"y":'+t[a].y+"}";else if(e===!0)for(let a=0;a0&&(r+=","),r+=t[a];return r+="]",r}toGeoJSONResult(e){if(!e||!e.pathList||e.pathList.length<1)return null;var t=new uh;return e.pathList.forEach(function(r){r.route&&(r.route=t.toGeoJSON(r.route)),r.pathGuideItems&&(r.pathGuideItems=t.toGeoJSON(r.pathGuideItems)),r.edgeFeatures&&(r.edgeFeatures=t.toGeoJSON(r.edgeFeatures)),r.nodeFeatures&&(r.nodeFeatures=t.toGeoJSON(r.nodeFeatures))}),e}}class kRe{constructor(e){this.isAnalyzeById=!1,this.isCenterMutuallyExclusive=!1,this.centers=null,this.isFromCenter=!1,this.weights=null,this.parameter=new $2,H.extend(this,e),this.CLASS_NAME="SuperMap.FindServiceAreasParameters"}destroy(){var e=this;e.isAnalyzeById=null,e.isCenterMutuallyExclusive=null,e.centers=null,e.isFromCenter=null,e.weights=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class FRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindServiceAreasService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof kRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"servicearea"),i={isFromCenter:e.isFromCenter,isCenterMutuallyExclusive:e.isCenterMutuallyExclusive,parameter:H.toJSON(e.parameter),centers:r.getJson(e.isAnalyzeById,e.centers),weights:r.getJson(!0,e.weights)},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(e===!1)for(let a=0;a0&&(r+=","),r+='{"x":'+t[a].x+',"y":'+t[a].y+"}";else if(e===!0)for(let a=0;a0&&(r+=","),r+=t[a];return r+="]",r}toGeoJSONResult(e){if(!e||!e.serviceAreaList)return e;var t=new uh;return e.serviceAreaList.map(function(r){return r.serviceRegion&&(r.serviceRegion=t.toGeoJSON(r.serviceRegion)),r.edgeFeatures&&(r.edgeFeatures=t.toGeoJSON(r.edgeFeatures)),r.nodeFeatures&&(r.nodeFeatures=t.toGeoJSON(r.nodeFeatures)),r.routes&&(r.routes=t.toGeoJSON(r.routes)),r}),e}}class BRe{constructor(e){this.endNodeAssigned=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new $2,H.extend(this,e),this.CLASS_NAME="SuperMap.FindTSPPathsParameters"}destroy(){var e=this;e.endNodeAssigned=null,e.isAnalyzeById=null,e.nodes=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class GRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindTSPPathsService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof BRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"tsppath"),i={parameter:H.toJSON(e.parameter),endNodeAssigned:e.endNodeAssigned,nodes:r.getNodesJson(e)},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}getNodesJson(e){var t="",r,i,a,o;if(e.isAnalyzeById===!1){for(r="[",i=0,o=e.nodes,a=o.length;i0&&(r+=","),r+='{"x":'+o[i].x+',"y":'+o[i].y+"}";r+="]",t+=r}else if(e.isAnalyzeById===!0){let s="[",l=e.nodes,u=l.length;for(let h=0;h0&&(s+=","),s+=l[h];s+="]",t+=s}return t}toGeoJSONResult(e){if(!e||!e.tspPathList)return null;var t=new uh;return e.tspPathList.forEach(function(r){r.route&&(r.route=t.toGeoJSON(r.route)),r.pathGuideItems&&(r.pathGuideItems=t.toGeoJSON(r.pathGuideItems)),r.edgeFeatures&&(r.edgeFeatures=t.toGeoJSON(r.edgeFeatures)),r.nodeFeatures&&(r.nodeFeatures=t.toGeoJSON(r.nodeFeatures))}),e}}class zRe{constructor(e){this.routeTable=null,this.routeIDField=null,this.attributeFilter=null,this.eventTable=null,this.eventRouteIDField=null,this.measureField=null,this.measureStartField=null,this.measureEndField=null,this.measureOffsetField=null,this.errorInfoField=null,this.retainedFields=null,this.dataReturnOption=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.GenerateSpatialDataParameters"}destroy(){var e=this;e.routeTable&&(e.routeTable=null),e.routeIDField=null,e.attributeFilter=null,e.eventTable=null,e.eventRouteIDField=null,e.measureField=null,e.measureStartField=null,e.measureEndField=null,e.measureOffsetField=null,e.errorInfoField=null,e.dataReturnOption&&(e.dataReturnOption.destroy(),e.dataReturnOption=null)}}class URe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GenerateSpatialDataService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof zRe){var r=this,i;return i=r.getJsonParameters(e),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}getJsonParameters(e){var t="",r="datasets/"+e.routeTable+"/linearreferencing/generatespatialdata",i=this;return i.url=H.urlPathAppend(i.url,r),i.url=H.urlAppend(i.url,"returnContent=true"),t=H.toJSON(e),t}}class lot extends XOe{constructor(e){super(),this.precision=5,H.extend(this,e),this.aggType=TOe.GEOHASH_GRID,this.CLASS_NAME="SuperMap.GeoHashGridAggParameter"}destroy(){super.destroy(),this.aggType=null,this.precision=null}static toJsonParameters(e){var t={aggName:e.aggName,aggFieldName:e.aggFieldName,aggType:e.aggType,precision:e.precision};return H.toJson(t)}}class $8 extends Rne{constructor(e){super(e),e&&e.operateGeometry&&(this.operateGeometry=e.operateGeometry),e&&e.sourceGeometry&&(this.sourceGeometry=e.sourceGeometry),e&&e.operateGeometries&&(this.operateGeometries=e.operateGeometries),e&&e.sourceGeometries&&(this.sourceGeometries=e.sourceGeometries),e&&H.extend(this,e),this.CLASS_NAME="SuperMap.GeometryOverlayAnalystParameters"}destroy(){super.destroy();var e=this;e.sourceGeometry&&(e.sourceGeometry.destroy(),e.sourceGeometry=null),e.sourceGeometries&&(e.sourceGeometries.destroy(),e.sourceGeometries=null),e.sourceGeometry&&(e.sourceGeometry.destroy(),e.sourceGeometry=null),e.operateGeometries&&(e.operateGeometries.destroy(),e.operateGeometries=null)}static toObject(e,t){for(var r in e)if(r==="sourceGeometry")t.sourceGeometry=Vo.fromGeometry(e.sourceGeometry);else if(r==="sourceGeometries"){for(var i=[],a=0;a=0;t--)e.points[t].destroy();e.points=null}}static toObject(e,t){for(var r in e)r==="clipRegion"?t.clipRegion=Vo.fromGeometry(e.clipRegion):t[r]=e[r]}}class $Re extends ra{constructor(e,t){t=t||{},super(e,t),this.CLASS_NAME="SuperMap.GeoprocessingService",this.headers={},this.crossOrigin=!0}getTools(e){return this._processAsync({url:`${this.url}/list`,callback:e})}getTool(e,t){return this._processAsync({url:`${this.url}/${e}`,callback:t})}execute(e,t,r,i){t=t||null,r=r||null;const a={parameter:t,environment:r};return this._processAsync({url:`${this.url}/${e}/execute`,executeParamter:a,callback:i})}submitJob(e,t,r,i){t=t||null,r=r||null;const a=JSON.stringify({parameter:t,environments:r});return this._processAsync({url:`${this.url}/${e}/jobs`,method:"POST",callback:i,params:a})}waitForJobCompletion(e,t,r,i){const a=this,o=setInterval(function(){const s=function(l){const u=l.result.state.runState;l.options.statusCallback&&l.options.statusCallback(u),["FINISHED","FAILED","CANCELED"].indexOf(u)!==-1&&(clearInterval(o),i(l))};a._processAsync({url:`${a.url}/${t}/jobs/${e}`,callback:s})},r.interval)}getJobInfo(e,t,r){return this._processAsync({url:`${this.url}/${e}/jobs/${t}`,callback:r})}cancelJob(e,t,r){return this._processAsync({url:`${this.url}/${e}/jobs/${t}/cancel`,callback:r})}getJobs(e,t){let r=`${this.url}/jobs`;e&&typeof e=="string"?r=`${this.url}/${e}/jobs`:t=e,this._processAsync({url:r,callback:t})}getResults(e,t,r,i){let a=`${this.url}/${e}/jobs/${t}/results`;return r&&(typeof r=="string"?a=`${a}/${r}`:i=r),this._processAsync({url:a,callback:i})}_processAsync({url:e,method:t,callback:r,paramter:i}){return this.request({url:e,method:t||"GET",params:i,headers:{"Content-type":"application/json"},scope:this,success:r,failure:r})}}class WRe{constructor(e){this.dataset=null,this.sourceFilter=null,this.referenceFilter=null,this.spatialRelationType=null,this.isBorderInside=null,this.returnFeature=null,this.returnGeoRelatedOnly=null,this.startRecord=0,this.expectCount=500,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.GeoRelationAnalystParameters"}destroy(){var e=this;e.sourceFilter&&e.sourceFilter.destroy(),e.sourceFilter=null,e.referenceFilter&&e.referenceFilter.destroy(),e.referenceFilter=null,e.dataset=null,e.spatialRelationType=null,e.isBorderInside=null,e.returnFeature=null,e.returnGeoRelatedOnly=null,e.startRecord=null,e.expectCount=null}}class HRe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GeoRelationAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof WRe){var r=this;r.url=H.urlPathAppend(r.url,"datasets/"+e.dataset+"/georelation");var i=H.toJSON(e);return r.url=H.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}}class jRe extends ra{constructor(e,t){super(e,t),t&&(this.datasource=null,this.dataset=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.DatasetService")}destroy(){super.destroy();var e=this;e.datasource=null,e.dataset=null}getDatasetsService(e,t){const r=H.urlPathAppend(this.url,`datasources/name/${e}/datasets`);return this.processAsync(r,"GET",t)}getDatasetService(e,t,r){const i=H.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);return this.processAsync(i,"GET",r)}setDatasetService(e,t){if(!e)return;const r=H.urlPathAppend(this.url,`datasources/name/${e.datasourceName}/datasets/name/${e.datasetName}`);return delete e.datasourceName,this.processAsync(r,"PUT",t,e)}deleteDatasetService(e,t,r){const i=H.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);return this.processAsync(i,"DELETE",r)}processAsync(e,t,r,i){var a=this;let o={url:e,method:t,scope:a,success:r,failure:r};return i&&(o.data=H.toJSON(i)),a.request(o)}}class TI{constructor(e){this.datasetNames=null,this.targetEpsgCode=null,this.targetPrj=null,this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.returnCountOnly=!1,this.maxFeatures=null,this.hasGeometry=!0,this.aggregations=null,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesParametersBase"}destroy(){var e=this;e.datasetNames=null,e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.hasGeometry=null,e.maxFeatures=null,e.targetEpsgCode=null,e.targetPrj=null,e.aggregation&&(e.aggregation=null)}}class xE extends TI{constructor(e){super(e),this.getFeatureMode=xE.getFeatureMode.BOUNDS,this.bounds=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=n3.CONTAIN,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsParameters"}destroy(){super.destroy();var e=this;if(e.bounds&&(e.bounds.destroy(),e.bounds=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}static toJsonParameters(e){var t,r,i;return r={leftBottom:{x:e.bounds.left,y:e.bounds.bottom},rightTop:{x:e.bounds.right,y:e.bounds.top}},i={datasetNames:e.datasetNames,getFeatureMode:xE.getFeatureMode.BOUNDS,bounds:r,spatialQueryMode:e.spatialQueryMode},e.fields&&(t=new Of,t.name=e.datasetNames,t.fields=e.fields,i.queryParameter=t),e.attributeFilter&&(i.attributeFilter=e.attributeFilter,i.getFeatureMode=xE.getFeatureMode.BOUNDS_ATTRIBUTEFILTER),e.maxFeatures&&!isNaN(e.maxFeatures)&&(i.maxFeatures=e.maxFeatures),typeof e.hasGeometry=="boolean"&&(i.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(i.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(i.targetPrj=e.targetPrj),e.aggregations&&(i.aggregations=e.aggregations),H.toJSON(i)}}xE.getFeatureMode={BOUNDS:"BOUNDS",BOUNDS_ATTRIBUTEFILTER:"BOUNDS_ATTRIBUTEFILTER"};class CI extends ra{constructor(e,t){super(e,t),t=t||{},this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.hasGeometry=!0,this.maxFeatures=null,this.format=Ni.GEOJSON,H.extend(this,t),this.url=H.urlPathAppend(this.url,"featureResults"),this.CLASS_NAME="SuperMap.GetFeaturesServiceBase"}destroy(){super.destroy();var e=this;e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.maxFeatures=null,e.format=null,e.hasGeometry=null}processAsync(e,t){if(!!e){var r=this,i=null,a=!0;r.returnContent=e.returnContent,r.fromIndex=e.fromIndex,r.toIndex=e.toIndex,r.maxFeatures=e.maxFeatures,r.hasGeometry=e.hasGeometry,r.returnContent&&(a=!1);var o=r.fromIndex!=null&&r.toIndex!=null&&!isNaN(r.fromIndex)&&!isNaN(r.toIndex);return o&&r.fromIndex>=0&&r.toIndex>=0&&!a&&(r.url=H.urlAppend(r.url,`fromIndex=${r.fromIndex}&toIndex=${r.toIndex}`)),e.returnCountOnly&&(r.url=H.urlAppend(r.url,"&returnCountOnly="+e.returnContent)),i=r.getJsonParameters(e),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}transformResult(e,t){var r=this;if(e=H.transformResult(e),r.format===Ni.GEOJSON&&e.features){var i=new uh;e.features=i.toGeoJSON(e.features)}return{result:e,options:t}}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER,Ni.FGB]}}class XRe extends CI{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){return xE.toJsonParameters(e)}}class fK extends TI{constructor(e){super(e),this.bufferDistance=null,this.attributeFilter=null,this.geometry=null,this.fields=null,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBufferParameters"}destroy(){super.destroy();var e=this;if(e.bufferDistance=null,e.attributeFilter=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.geometry&&(e.geometry.destroy(),e.geometry=null)}static toJsonParameters(e){var t,r,i;return i=Vo.fromGeometry(e.geometry),r={datasetNames:e.datasetNames,getFeatureMode:"BUFFER",bufferDistance:e.bufferDistance,geometry:i},e.fields&&(t=new Of,t.name=e.datasetNames,t.fields=e.fields,r.queryParameter=t),e.attributeFilter&&(r.attributeFilter=e.attributeFilter,r.getFeatureMode="BUFFER_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(r.maxFeatures=e.maxFeatures),typeof e.hasGeometry=="boolean"&&(r.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(r.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(r.targetPrj=e.targetPrj),H.toJSON(r)}}class YRe extends CI{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBufferService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof fK)return fK.toJsonParameters(e)}}class qRe extends TI{constructor(e){super(e),this.getFeatureMode="SPATIAL",this.geometry=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=n3.CONTAIN,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryParameters"}destroy(){super.destroy();var e=this;if(e.geometry&&(e.geometry.destroy(),e.geometry=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}static toJsonParameters(e){var t,r,i;return r=Vo.fromGeometry(e.geometry),i={datasetNames:e.datasetNames,getFeatureMode:"SPATIAL",geometry:r,spatialQueryMode:e.spatialQueryMode},e.fields&&(t=new Of,t.name=e.datasetNames,t.fields=e.fields,i.queryParameter=t),e.attributeFilter&&(i.attributeFilter=e.attributeFilter,i.getFeatureMode="SPATIAL_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(i.maxFeatures=e.maxFeatures),typeof e.hasGeometry=="boolean"&&(i.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(i.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(i.targetPrj=e.targetPrj),e.aggregations&&(i.aggregations=e.aggregations),H.toJSON(i)}}class ZRe extends CI{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){return qRe.toJsonParameters(e)}}class KRe extends TI{constructor(e){super(e),this.getFeatureMode="ID",this.IDs=null,this.fields=null,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByIDsParameters"}destroy(){super.destroy();var e=this;if(e.IDs=null,e.getFeatureMode=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}}static toJsonParameters(e){var t,r;return t={datasetNames:e.datasetNames,getFeatureMode:"ID",ids:e.IDs},e.fields&&(r=new Of,r.name=e.datasetNames,r.fields=e.fields,t.queryParameter=r),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),typeof e.hasGeometry=="boolean"&&(t.hasGeometry=e.hasGeometry),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),H.toJSON(t)}}class JRe extends CI{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByIDsService"}destroy(){super.destroy()}getJsonParameters(e){return KRe.toJsonParameters(e)}}class VR extends TI{constructor(e){super(e),this.getFeatureMode="SQL",this.queryParameter=null,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesBySQLParameters"}destroy(){super.destroy();var e=this;e.getFeatureMode=null,e.queryParameter&&(e.queryParameter.destroy(),e.queryParameter=null)}static toJsonParameters(e){var t={datasetNames:e.datasetNames,getFeatureMode:"SQL",queryParameter:e.queryParameter};return e.maxFeatures&&!isNaN(e.maxFeatures)&&(t.maxFeatures=e.maxFeatures),typeof e.hasGeometry=="boolean"&&(t.hasGeometry=e.hasGeometry),e.aggregations&&(t.aggregations=e.aggregations),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),H.toJSON(t)}}class H8 extends CI{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesBySQLService"}destroy(){super.destroy()}getJsonParameters(e){return VR.toJsonParameters(e)}}class QRe extends ra{constructor(e,t){super(e,t),this.datasource=null,this.dataset=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.GetFieldsService"}destroy(){super.destroy();var e=this;e.datasource=null,e.dataset=null}processAsync(e){var t=this;return t.url=H.urlPathAppend(t.url,`datasources/${t.datasource}/datasets/${t.dataset}/fields`),t.request({method:"GET",data:null,scope:t,success:e,failure:e})}}class eDe{constructor(e){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null,H.extend(this,e),this.CLASS_NAME="SuperMap.GetGridCellInfosParameters"}destroy(){var e=this;e.datasetName=null,e.dataSourceName=null,e.X=null,e.Y=null}}class tDe extends ra{constructor(e,t){super(e,t),this.datasetName=null,this.dataSourceName=null,this.datasetType=null,this.X=null,this.Y=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.GetGridCellInfosService"}destroy(){super.destroy();var e=this;e.X=null,e.Y=null,e.datasetName=null,e.dataSourceName=null,e.datasetType=null}processAsync(e,t){if(e instanceof eDe){H.extend(this,e);var r=this;return r.url=H.urlPathAppend(r.url,`datasources/${r.dataSourceName}/datasets/${r.datasetName}`),r.request({method:"GET",data:null,scope:r,success({result:i}){t&&r.getDatasetInfoCompleted(i,t)},failure:t}).then(({result:i})=>r.getDatasetInfoCompleted(i))}}getDatasetInfoCompleted(e,t){var r=this;return e=H.transformResult(e),r.datasetType=e.datasetInfo.type,r.queryGridInfos(t)}queryGridInfos(e){var t=this,r=H.urlPathAppend(t.url,t.datasetType=="GRID"?"gridValue":"imageValue");return t.X!=null&&t.Y!=null&&(r=H.urlAppend(r,`x=${t.X}&y=${t.Y}`)),t.request({url:r,method:"GET",data:null,scope:t,success:e,failure:e})}}class R_{constructor(e,t){if(!e)return this;this.memoryData=null,this.type=e,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.Theme"}destroy(){var e=this;e.memoryData&&(e.memoryData.destroy(),e.memoryData=null),e.type=null}toServerJSONObject(){}}class md{constructor(e){this.align=sOe.BASELINECENTER,this.backColor=new Js(255,255,255),this.foreColor=new Js(0,0,0),this.backOpaque=!1,this.sizeFixed=!0,this.fontHeight=6,this.fontWidth=0,this.fontWeight=400,this.fontName="Times New Roman",this.bold=!1,this.italic=!1,this.italicAngle=0,this.shadow=!1,this.strikeout=!1,this.outline=!1,this.opaqueRate=0,this.underline=!1,this.rotation=0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ServerTextStyle"}destroy(){var e=this;e.align=null,e.backColor&&(e.backColor.destroy(),e.backColor=null),e.foreColor&&(e.foreColor.destroy(),e.foreColor=null),e.backOpaque=null,e.sizeFixed=null,e.fontHeight=null,e.fontWidth=null,e.fontWeight=null,e.fontName=null,e.bold=null,e.italic=null,e.italicAngle=null,e.shadow=null,e.strikeout=null,e.outline=null,e.opaqueRate=null,e.underline=null,e.rotation=null}static fromObj(e){var t=new md(e);return H.copy(t,e),t.backColor=Js.fromJson(e.backColor),t.foreColor=Js.fromJson(e.foreColor),t}}class Sz{constructor(e){this.caption=null,this.end=0,this.start=0,this.visible=!0,this.style=new md,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelItem"}destroy(){var e=this;e.caption=null,e.end=null,e.start=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}static fromObj(e){if(!!e){var t=new Sz;return H.copy(t,e),t}}}class o3{constructor(e){this.caption=null,this.style=new gs,this.unique=null,this.visible=!0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeUniqueItem"}destroy(){var e=this;e.caption=null,e.unique=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e.style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){var t=new o3;return H.copy(t,e),t.style=gs.fromJson(e.style),t}}class o_{constructor(e){this.offsetFixed=!1,this.offsetX="0.0",this.offsetY="0.0",e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeOffset"}destroy(){var e=this;e.offsetFixed=null,e.offsetX=null,e.offsetY=null}static fromObj(e){if(!!e){var t=new o_;return H.copy(t,e),t}}}class wz{constructor(e){this.defaultStyle=null,this.separator=null,this.separatorEnabled=!1,this.splitIndexes=null,this.styles=new md,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.LabelMixedTextStyle"}destroy(){var e=this;if(e.defaultStyle&&(e.defaultStyle.destroy(),e.defaultStyle=null),e.separator=null,e.separatorEnabled=null,e.splitIndexes&&(e.splitIndexes=null),e.styles){for(var t=0,r=e.styles,i=r.length;t0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.defaultStyle&&(e.defaultStyle.destroy(),e.defaultStyle=null)}toServerJSONObject(){var e={};if(e=H.copyAttributes(e,this),e.defaultStyle&&e.defaultStyle.toServerJSONObject&&(e.defaultStyle=e.defaultStyle.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,i=0;i0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.rangeExpression=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}static fromObj(e){if(!!e){var t=new Iz;H.copy(t,e);var r=e.items,i=r?r.length:0;t.items=[];for(var a=0;a0,a=i?e[0].subLayers.layers:null,o=a?a.length:0,r.handleLayers(o,a),{result:e[0],options:t}}handleLayers(e,t){var r=this,i;if(e)for(var a=0;a0)r.handleLayers(t[a].subLayers.layers.length,t[a].subLayers.layers);else{var o=t[a].ugcLayerType;switch(o){case"THEME":i=new iDe,i.fromJson(t[a]),t[a]=i;break;case"GRID":i=new aDe,i.fromJson(t[a]),t[a]=i;break;case"IMAGE":i=new oDe,i.fromJson(t[a]),t[a]=i;break;case"VECTOR":i=new sDe,i.fromJson(t[a]),t[a]=i;break}}}}class Dy{constructor(e){!e||(this.bounds=null,this.searchRadius=0,this.zValueFieldName=null,this.zValueScale=1,this.resolution=null,this.filterQueryParameter=null,this.outputDatasetName=null,this.outputDatasourceName=null,this.pixelFormat=null,this.dataset=null,this.inputPoints=null,this.InterpolationAnalystType="dataset",this.clipParam=null,H.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationAnalystParameters")}destroy(){var e=this;e.bounds=null,e.searchRadius=null,e.zValueFieldName=null,e.zValueScale=null,e.resolution=null,e.filterQueryParameter=null,e.outputDatasetName=null,e.pixelFormat=null}static toObject(e,t){for(var r in e)if(r==="inputPoints"&&e.InterpolationAnalystType==="geometry"){for(var i=[],a=0;a=200&&e.code<300||e.code==0||e.code===304,i=e.code&&r;return!e.code||i?{result:e,options:t}:{error:e,options:t}}}class vK{constructor(e){!e||(this.dataset=null,this.extractRegion=null,this.expression=null,this.isZip=!1,this.ignoreNoValue=!1,this.targetDatasource=null,this.resultGridName=null,this.deleteExistResultDataset=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.MathExpressionAnalysisParameters")}destroy(){var e=this;e.dataset=null,e.bounds=null,e.expression=null,e.isZip=!0,e.ignoreNoValue=!0,e.targetDatasource=null,e.resultGridName=null,e.deleteExistResultDataset=null}static toObject(e,t){for(var r in e)if(r!=="dataset"&&(t[r]=e[r]),r==="extractRegion"&&e[r]){for(var i=e[r].components[0].components,a={},o=[],s="REGION",l=i.length,u=0;u(l.fieldNames=o[a].fieldCaptions,l)),r.format===Ni.GEOJSON&&(o[a].features=i.toGeoJSON(o[a].features)));return{result:e,options:t}}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER,Ni.FGB]}getQueryParameters(e){return new OS({customParams:e.customParams,expectCount:e.expectCount,networkType:e.networkType,queryOption:e.queryOption,queryParams:e.queryParams,startRecord:e.startRecord,prjCoordSys:e.prjCoordSys,holdTime:e.holdTime})}}class SDe extends Pz{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){if(!(e instanceof xDe))return null;var t=this,r="",i=null,a=e.bounds;return i=t.getQueryParameters(e),r+="'queryMode':'BoundsQuery','queryParameters':",r+=H.toJSON(i),r+=",'bounds': {'rightTop':{'y':"+a.top+",'x':"+a.right+"},'leftBottom':{'y':"+a.bottom+",'x':"+a.left+"}}",r="{"+r+"}",r}}class wDe extends OS{constructor(e){e=e||{},super(e),this.geometry=null,this.isNearest=null,this.returnContent=!0,H.extend(this,e),this.CLASS_NAME="SuperMap.QueryByDistanceParameters"}destroy(){super.destroy();var e=this;e.returnContent=null,e.distance=null,e.isNearest=null,e.geometry&&(e.geometry.destroy(),e.geometry=null)}}class bDe extends Pz{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByDistanceService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof wDe){var t=this,r="",i=t.getQueryParameters(e),a=Vo.fromGeometry(e.geometry);return r+=e.isNearest?"'queryMode':'FindNearest','queryParameters':":"'queryMode':'DistanceQuery','queryParameters':",r+=H.toJSON(i),r+=",'geometry':"+H.toJSON(a)+",'distance':"+e.distance,r="{"+r+"}",r}}}class EDe extends OS{constructor(e){e=e||{},super(e),this.returnContent=!0,this.geometry=null,this.spatialQueryMode=n3.INTERSECT,H.extend(this,e),this.CLASS_NAME="SuperMap.QueryByGeometryParameters"}destroy(){super.destroy();var e=this;e.returnContent=null,e.geometry=null,e.spatialQueryMode=null}}class TDe extends Pz{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof EDe){var t=this,r="",i=null,a=e.geometry,o=Vo.fromGeometry(a);return i=t.getQueryParameters(e),r+="'queryMode':'SpatialQuery','queryParameters':",r+=H.toJSON(i)+",'geometry':"+H.toJSON(o)+",'spatialQueryMode':"+H.toJSON(e.spatialQueryMode),r="{"+r+"}",r}}}class ZR extends OS{constructor(e){e=e||{},super(e),this.returnContent=!0,H.extend(this,e),this.CLASS_NAME="SuperMap.QueryBySQLParameters"}destroy(){super.destroy();var e=this;e.returnContent=null}}class j8 extends Pz{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryBySQLService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof ZR){var t=this,r="",i=null;return i=t.getQueryParameters(e),r+="'queryMode':'SqlQuery','queryParameters':",r+=H.toJSON(i),r="{"+r+"}",r}}}class CDe{constructor(e){this.referenceDatasetName=null,this.referenceFilterQueryParameter=null,this.createResultDataset=null,this.resultDatasetName=null,this.resultDatasourceName=null,this.minDistance=null,this.maxDistance=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.MinDistanceAnalystParameters"}destroy(){var e=this;e.referenceDatasetName=null,e.dataset=null,e.referenceFilterQueryParameter=null,e.createResultDataset=null,e.resultDatasetName=null,e.resultDatasourceName=null,e.minDistance=null,e.maxDistance=null}}class ADe extends CDe{constructor(e){super(e),this.dataset=null,this.inputFilterQueryParameter=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.DatasetMinDistanceAnalystParameters"}destroy(){super.destroy();var e=this;this.dataset=null,e.inputFilterQueryParameter=null}}class pK extends CDe{constructor(e){super(e),this.inputGeometries=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.GeometryMinDistanceAnalystParameters"}destroy(){super.destroy();var e=this;e.inputGeometries=null}static toObject(e,t){for(var r in e)if(r==="inputGeometries"&&e.inputGeometries){for(var i=[],a=0;a0&&(a+='"subLayers":'+e.toJSON()),a+=',"visible":'+!0+",",a+='"name":"'+this.getMapName(this.mapUrl)+'"',a+="}]",r.request({method:"PUT",data:a,scope:r,success:t,failure:t})}}createTempLayerComplete(e,t){var r=this;return t.result=H.transformResult(t.result),t.result.succeed&&(r.lastparams.resourceID=t.result.newResourceID),r.processAsync(r.lastparams,e)}getMapName(e){var t=e;t.charAt(t.length-1)==="/"&&(t=t.substr(0,t.length-1));var r=t.lastIndexOf("/"),i=t.substring(r+1,t.length);return i}transformResult(e,t){var r=this;return e=H.transformResult(e),e!=null&&r.lastparams!=null&&r.lastparams.resourceID!=null&&(e.newResourceID=r.lastparams.resourceID),{result:e,options:t}}}class YDe{constructor(e){!e||(this.datasetName="",this.datasetQuery="",this.geometryQuery="",this.mode=n3.CONTAIN,this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsParameter")}destroy(){this.datasetName=null,this.datasetQuery=null,this.geometryQuery=null,this.mode=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class lB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/query"),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsService"}destroy(){super.destroy()}getQueryJobs(e){return super.getJobs(this.url,e)}getQueryJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addQueryJob(e,t,r,i){return super.addJob(this.url,e,YDe,t,r,i)}}class qDe{constructor(e){e=e||{},this.keyWord=null,this.returnPosition=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.StopQueryParameters"}destroy(){H.reset(this)}}class ZDe extends ra{constructor(e,t){super(e,t),t=t||{},H.extend(this,t),this.CLASS_NAME="SuperMap.StopQueryService"}destroy(){super.destroy(),H.reset(this)}processAsync(e,t){if(e instanceof qDe){var r=this;return r.url=H.urlPathAppend(r.url,"stops/keyword/"+e.keyWord),r.request({method:"GET",params:{returnPosition:e.returnPosition},scope:r,success:t,failure:t})}}}class KDe{constructor(e){!e||(this.datasetName="",this.groupField="",this.attributeField="",this.statisticModes="",this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.SummaryAttributesJobsParameter")}destroy(){this.datasetName=null,this.groupField=null,this.attributeField=null,this.statisticModes=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class uB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/summaryattributes"),this.CLASS_NAME="SuperMap.SummaryAttributesJobsService"}destroy(){super.destroy()}getSummaryAttributesJobs(e){return super.getJobs(this.url,e)}getSummaryAttributesJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addSummaryAttributesJob(e,t,r,i){return super.addJob(this.url,e,KDe,t,r,i)}}class JDe{constructor(e){!e||(this.datasetName="",this.regionDataset="",this.query="",this.resolution=100,this.meshType=0,this.statisticModes=bOe.AVERAGE,this.fields="",this.type=Ene.SUMMARYMESH,this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.SummaryMeshJobParameter")}destroy(){this.datasetName=null,this.query=null,this.resolution=null,this.statisticModes=null,this.meshType=null,this.fields=null,this.regionDataset=null,this.type=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="type"){t.type=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}(e.type==="SUMMARYMESH"&&r!=="regionDataset"||e.type==="SUMMARYREGION"&&!i(["meshType","resolution","query"],r))&&(t.analyst=t.analyst||{},r==="query"&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r]))}function i(a,o){for(var s=a.length;s--;)if(a[s]===o)return!0;return!1}}}class hB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/aggregatepoints"),this.CLASS_NAME="SuperMap.SummaryMeshJobsService"}destroy(){super.destroy()}getSummaryMeshJobs(e){return super.getJobs(this.url,e)}getSummaryMeshJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addSummaryMeshJob(e,t,r,i){return super.addJob(this.url,e,JDe,t,r,i)}}class QDe{constructor(e){!e||(this.datasetName="",this.regionDataset="",this.sumShape=!0,this.query="",this.standardSummaryFields=!1,this.standardFields="",this.standardStatisticModes="",this.weightedSummaryFields=!1,this.weightedFields="",this.weightedStatisticModes="",this.meshType=0,this.resolution=100,this.meshSizeUnit=zR.METER,this.type=Ene.SUMMARYMESH,this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.SummaryRegionJobParameter")}destroy(){this.datasetName=null,this.sumShape=null,this.regionDataset=null,this.query=null,this.standardSummaryFields=null,this.standardFields=null,this.standardStatisticModes=null,this.weightedSummaryFields=null,this.weightedFields=null,this.weightedStatisticModes=null,this.meshType=null,this.resolution=null,this.meshSizeUnit=null,this.type=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="type"){t.type=e[r];continue}if(r==="type"){t.type=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}(e.type==="SUMMARYREGION"||e.type==="SUMMARYMESH"&&r!=="regionDataset")&&(t.analyst=t.analyst||{},r==="query"&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r]))}}}class cB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/summaryregion"),this.CLASS_NAME="SuperMap.SummaryRegionJobsService"}destroy(){super.destroy()}getSummaryRegionJobs(e){return super.getJobs(this.url,e)}getSummaryRegionJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addSummaryRegionJob(e,t,r,i){return super.addJob(this.url,e,QDe,t,r,i)}}class kne{constructor(e){this.maxWeight=null,this.nodeID=null,this.resourceValue=null,this.type=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.SupplyCenter"}destroy(){var e=this;e.maxWeight=null,e.nodeID=null,e.resourceValue=null,e.type=null}static fromJson(e){if(!!e)return new kne({maxWeight:e.maxWeight,nodeID:e.nodeID,resourceValue:e.resourceValue,type:e.type})}}class _ot{constructor(e){this.bounds=null,this.boundsType=AOe.MAX,this.cellSize=null,this.cellSizeType=MOe.UNION,H.extend(this,e),this.CLASS_NAME="SuperMap.terrainAnalystSetting"}destroy(){var e=this;e.bounds=null,e.boundsType=null,e.cellSize=null,e.cellSizeType=null}}class eNe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.SurfaceAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof xz){var r=this,i;return i=r.getJsonParameters(e),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}getJsonParameters(e){var t="",r={},i=this;if(e instanceof lK)i.url=H.urlPathAppend(i.url,"datasets/"+e.dataset+"/"+e.surfaceAnalystMethod.toLowerCase()),lK.toObject(e,r),t=H.toJSON(r);else if(e instanceof VRe)i.url=H.urlPathAppend(i.url,"geometry/"+e.surfaceAnalystMethod.toLowerCase()),t=H.toJSON(e);else return;return this.returnContent=!0,t}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER,Ni.FGB]}}class _K{constructor(e){!e||(this.dataset=null,this.zFactor=1,this.averageCurvatureName=null,this.profileCurvatureName="",this.planCurvatureName="",this.deleteExistResultDataset=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.TerrainCurvatureCalculationParameters")}destroy(){var e=this;e.dataset=null,e.zFactor=1,e.averageCurvatureName=null,e.profileCurvatureName=null,e.planCurvatureName=null,e.deleteExistResultDataset=!0}static toObject(e,t){for(var r in e)r!=="dataset"&&(t[r]=e[r])}}class tNe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainCurvatureCalculationService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof _K&&(r.url=H.urlPathAppend(r.url,"datasets/"+e.dataset+"/terraincalculation/curvature")),_K.toObject(e,i);var a=H.toJSON(i);return r.url=H.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:a,scope:r,success:t,failure:t})}}class Fne{constructor(e){this.flowEnabled=!1,this.leaderLineDisplayed=!1,this.leaderLineStyle=new gs,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeFlow"}destroy(){var e=this;e.flowEnabled=null,e.leaderLineDisplayed=null,e.leaderLineStyle&&(e.leaderLineStyle.destroy(),e.leaderLineStyle=null)}static fromObj(e){if(!!e){var t=new Fne;return H.copy(t,e),t.leaderLineStyle=gs.fromJson(e.leaderLineStyle),t}}}class Oz{constructor(e){this.caption=null,this.color=new Js,this.end=0,this.start=0,this.visible=!0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridRangeItem"}destroy(){var e=this;e.caption=null,e.end=null,e.start=null,e.color&&(e.color.destroy(),e.color=null),e.visible=null}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e.color&&e.color.toServerJSONObject&&(e.color=e.color.toServerJSONObject()),e}static fromObj(e){if(!!e){var t=new Oz;return H.copy(t,e),t.color=Js.fromJson(e.color),t}}}class Bne extends R_{constructor(e){super("GRIDRANGE",e),this.items=null,this.rangeMode=vz.EQUALINTERVAL,this.rangeParameter=0,this.colorGradientType=i3.YELLOW_RED,this.reverseColor=!1,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridRange"}destroy(){super.destroy();var e=this;if(e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.reverseColor=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}static fromObj(e){if(!!e){var t=new Bne;H.copy(t,e);var r=e.items,i=r?r.length:0;t.items=[];for(var a=0;a0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.defaultcolor&&(e.defaultcolor.destroy(),e.defaultcolor=null)}toServerJSONObject(){var e={};if(e=H.copyAttributes(e,this),e.defaultcolor&&e.defaultcolor.toServerJSONObject&&(e.defaultcolor=e.defaultcolor.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,i=0;i0&&(e=e.substring(0,e.length-1)),"{"+e+"}"}else return null}}class rNe{constructor(e){this.datasetNames=null,this.dataSourceNames=null,this.joinItems=null,this.themes=null,this.displayFilters=null,this.displayOrderBys=null,this.fieldValuesDisplayFilter=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeParameters"}destroy(){var e=this;if(e.datasetNames=null,e.dataSourceNames=null,e.joinItems){for(let t=0,r=e.joinItems,i=r.length;t0&&(i.length===1?t+=`'displayFilter':"`+i[0]+'",':t+=`'displayFilter':"`+i[s]+'",'),a=e.displayOrderBy,a&&a.length>0&&(a.length===1?t+="'displayOrderBy':'"+a[0]+"',":t+="'displayOrderBy':'"+a[s]+"',"),o=e.fieldValuesDisplayFilter,o&&(t+="'fieldValuesDisplayFilter':"+H.toJSON(o)+","),e.joinItems&&e.joinItems.length>0&&e.joinItems[s]&&(t+="'joinItems':["+H.toJSON(e.joinItems[s])+"],"),e.datasetNames&&e.dataSourceNames){var u=e.datasetNames[s]?s:e.datasetNames.length-1,h=e.dataSourceNames[s]?s:e.dataSourceNames.length-1;t+="'datasetInfo': {'name': '"+e.datasetNames[u]+"','dataSourceName': '"+e.dataSourceNames[h]+"'}},"}else t+="},"}e.themes&&e.themes.length>0&&(t=t.substring(0,t.length-1)),t+="]},";var c=this.url.split("/"),f=c[c.length-2];return t+="'name': '"+f+"'}]",t}}class iNe extends Hu{constructor(e,t){super(e,t),this.mode=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.ThiessenAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e,t){var r={},i=this;e instanceof uK?(i.mode="datasets",i.url=H.urlPathAppend(i.url,"datasets/"+e.dataset+"/thiessenpolygon"),uK.toObject(e,r)):e instanceof W8&&(i.mode="geometry",i.url=H.urlPathAppend(i.url,"geometry/thiessenpolygon"),W8.toObject(e,r));var a=H.toJSON(r);return this.returnContent=!0,i.request({method:"POST",data:a,scope:i,success:t,failure:t})}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER,Ni.FGB]}}class aNe extends Hu{constructor(e,t){super(e,t),t&&H.extend(this,t),this.CLASS_NAME="SuperMap.GeometryBatchAnalystService"}processAsync(e,t){var r=this;r.url=H.urlPathAppend(r.url,"geometry/batchanalyst"),r.url=H.urlAppend(r.url,"returnContent=true&ignoreAnalystParam=true");var i=r._processParams(e),a=H.toJSON(i);return r.request({method:"POST",data:a,scope:r,success:t,failure:t})}_processParams(e){var t=this;if(!!H.isArray(e)){var r=[];return e.map(function(i){return r.push(t._toJSON(i)),i}),r}}_toJSON(e){var t={};if(e.analystName==="buffer")t.analystName="buffer",t.param={},U8.toObject(e.param,t.param);else if(e.analystName==="overlay")t.analystName="overlay",t.param={},$8.toObject(e.param,t.param);else if(e.analystName==="interpolationDensity")t.analystName="interpolationDensity",t.param={},Dy.toObject(e.param,t.param);else if(e.analystName==="interpolationidw")t.analystName="interpolationidw",t.param={},Dy.toObject(e.param,t.param);else if(e.analystName==="interpolationRBF")t.analystName="interpolationRBF",t.param={},Dy.toObject(e.param,t.param);else if(e.analystName==="interpolationKriging")t.analystName="interpolationKriging",t.param={},Dy.toObject(e.param,t.param);else if(e.analystName==="thiessenpolygon")t.analystName="thiessenpolygon",t.param={},W8.toObject(e.param,t.param);else return e;return t}destroy(){super.destroy()}}class oNe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TilesetsService"}destroy(){super.destroy()}processAsync(e){if(!!this.url){var t=this;return t.url=H.urlPathAppend(t.url,"tilesets"),t.request({method:"GET",scope:t,success:e,failure:e})}}}class sNe{constructor(e){!e||(this.datasetName="",this.datasetTopology="",this.tolerance="",this.rule=EOe.REGIONNOOVERLAP,this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TopologyValidatorJobsParameter")}destroy(){this.datasetName=null,this.datasetTopology=null,this.tolerance=null,this.rule=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class fB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/topologyvalidator"),this.CLASS_NAME="SuperMap.TopologyValidatorJobsService"}destroy(){super.destroy()}getTopologyValidatorJobs(e){return super.getJobs(this.url,e)}getTopologyValidatorJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addTopologyValidatorJob(e,t,r,i){return super.addJob(this.url,e,sNe,t,r,i)}}class Une{constructor(e){e=e||{},this.lineID=null,this.lineName=null,this.lineAliasName=null,this.startStopIndex=null,this.startStopName=null,this.startStopAliasName=null,this.endStopIndex=null,this.endStopName=null,this.endStopAliasName=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TransferLine"}destroy(){H.reset(this)}static fromJson(e){if(!!e)return new Une({lineID:e.lineID,lineName:e.lineName,lineAliasName:e.lineAliasName,startStopIndex:e.startStopIndex,startStopName:e.startStopName,startStopAliasName:e.startStopAliasName,endStopIndex:e.endStopIndex,endStopName:e.endStopName,endStopAliasName:e.endStopAliasName})}}class lNe{constructor(e){e=e||{},this.transferLines=null,this.points=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TransferPathParameters"}destroy(){H.reset(this)}static toJson(e){if(e)return H.toJSON(e)}}class uNe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferPathService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof lNe){var r=this,i="GET",a;return r.url=H.urlPathAppend(r.url,"path"),a={points:H.toJSON(e.points),transferLines:H.toJSON(e.transferLines)},r.request({method:i,params:a,scope:r,success:t,failure:t})}}}class hNe{constructor(e){e=e||{},this.solutionCount=6,this.transferPreference=mOe.NONE,this.transferTactic=yOe.LESS_TIME,this.walkingRatio=null,this.points=!1,this.evadeLines=null,this.evadeStops=null,this.priorLines=null,this.priorStops=null,this.travelTime=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TransferSolutionParameters"}destroy(){H.reset(this)}static toJson(e){if(e)return H.toJSON(e)}}class cNe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferSolutionService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof hNe){var r=this,i="GET",a;return r.url=H.urlPathAppend(r.url,"solutions"),a={points:H.toJSON(e.points),walkingRatio:e.walkingRatio,transferTactic:e.transferTactic,solutionCount:e.solutionCount,transferPreference:e.transferPreference},e.evadeLines&&(a.evadeLines=H.toJSON(e.evadeLines)),e.evadeStops&&(a.evadeStops=H.toJSON(e.evadeStops)),e.priorLines&&(a.priorLines=H.toJSON(e.priorLines)),e.priorStops&&(a.priorStops=H.toJSON(e.priorStops)),e.travelTime&&(a.travelTime=e.travelTime),r.request({method:i,params:a,scope:r,success:t,failure:t})}}}class fNe{constructor(e){!e||(this.edgeId="",this.fromNodeId="",this.toNodeId="",this.weightField="",this.edgeWeight="",H.extend(this,e),this.CLASS_NAME="SuperMap.UpdateEdgeWeightParameters")}destroy(){this.edgeId=null,this.fromNodeId=null,this.toNodeId=null,this.weightField=null,this.edgeWeight=null}}class xK{constructor(e){!e||(this.datasourceName=null,this.datasetName=null,this.datasetType=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.CreateDatasetParameters")}destroy(){var e=this;e.datasourceName=null,e.datasetName=null,e.datasetType=null}}class dNe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateEdgeWeightService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof fNe){var r=this,i=r.parse(e);r.url=H.urlPathAppend(r.url,i);var a=e.edgeWeight?e.edgeWeight:null;return r.request({method:"PUT",scope:r,data:a,success:t,failure:t})}}parse(e){if(!!e){var t="";for(var r in e)if(!(e[r]===""||e[r]==="edgeWeight"))switch(r){case"edgeId":t+="/edgeweight/"+e[r];break;case"fromNodeId":t+="/fromnode/"+e[r];break;case"toNodeId":t+="/tonode/"+e[r];break;case"weightField":t+="/weightfield/"+e[r];break}return t}}}class vNe{constructor(e){!e||(this.nodeId="",this.fromEdgeId="",this.toEdgeId="",this.weightField="",this.turnNodeWeight="",H.extend(this,e),this.CLASS_NAME="SuperMap.UpdateTurnNodeWeightParameters")}destroy(){this.nodeId=null,this.fromEdgeId=null,this.toEdgeId=null,this.weightField=null,this.turnNodeWeight=null}}class pNe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateTurnNodeWeightService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof vNe){var r=this,i=r.parse(e);r.url=H.urlPathAppend(r.url,i);var a=e.turnNodeWeight?e.turnNodeWeight:null;return r.request({method:"PUT",scope:r,data:a,success:t,failure:t})}}parse(e){if(!!e){var t="";for(var r in e)if(!(e[r]===""||e[r]==="turnNodeWeight"))switch(r){case"nodeId":t+="/turnnodeweight/"+e[r];break;case"fromEdgeId":t+="/fromedge/"+e[r];break;case"toEdgeId":t+="/toedge/"+e[r];break;case"weightField":t+="/weightfield/"+e[r];break}return t}}}class SK{constructor(e){!e||(this.datasourceName=null,this.datasetName=null,this.isFileCache=null,this.description=null,this.prjCoordSys=null,this.charset=null,this.palette=null,this.noValue=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.UpdateDatasetParameters")}destroy(){var e=this;e.datasourceName=null,e.datasetName=null,e.isFileCache=null,e.prjCoordSys=null,e.charset=null,e.palette=null,e.noValue=null}}class gNe{constructor(e){e=e||{},this.datasetName="",this.datasetVectorClip="",this.geometryClip="",this.mode=SOe.CLIP,this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.VectorClipJobsParameter"}destroy(){this.datasetName=null,this.datasetVectorClip=null,this.geometryClip=null,this.mode=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class dB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/vectorclip"),this.CLASS_NAME="SuperMap.VectorClipJobsService"}destroy(){super.destroy()}getVectorClipJobs(e){return super.getJobs(this.url,e)}getVectorClipJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addVectorClipJob(e,t,r,i){return super.addJob(this.url,e,gNe,t,r,i)}}class Vne{constructor(e){e=e||{},this.type=null,H.extend(this,e),this.CLASS_NAME="SuperMap.RasterFunctionParameter"}destroy(){this.type=null}}class Sot extends Vne{constructor(e){super(e),this.redIndex=0,this.nirIndex=1,this.colorMap="0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff",this.type=Tne.NDVI,H.extend(this,e),this.CLASS_NAME="SuperMap.NDVIParameter"}destroy(){super.destroy(),this.redIndex=null,this.nirIndex=null,this.colorMap=null}toJSON(){return{redIndex:this.redIndex,nirIndex:this.nirIndex,colorMap:this.colorMap,type:this.type}}}class wot extends Vne{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.zFactor=1,this.type=Tne.HILLSHADE,H.extend(this,e),this.CLASS_NAME="SuperMap.HillshadeParameter"}destroy(){super.destroy(),this.altitude=null,this.azimuth=null,this.zFactor=null}toJSON(){return{altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,type:this.type}}}class yNe{constructor(e){this.name=null,this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobCustomItems",H.extend(this,e)}destroy(){var e=this;e.name=null,e.picAsUrl=null,e.picAsBase64=null}toJSON(){var e={name:this.name};return this.title&&(e.title=this.title),this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),H.toJSON(e)}}class mNe{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobImage",H.extend(this,e)}destroy(){this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={};return this.picAsUrl&&(e.picAsUrl=this.picAsUrl),this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),H.toJSON(e)}}class $ne{constructor(e){this.name=null,this.layerType=null,this.url=null,this.CLASS_NAME="SuperMap.WebPrintingJobLayers",H.extend(this,e)}destroy(){this.name=null,this.layerType=null,this.url=null}}class _Ne{constructor(e){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers=null,this.customItems=null,this.CLASS_NAME="SuperMap.WebPrintingJobLegendOptions",H.extend(this,e)}destroy(){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers instanceof $ne&&(this.layers.destroy(),this.layers=null),this.customItems instanceof yNe&&(this.customItems.destroy(),this.customItems=null)}toJSON(){var e={title:this.title||""};return this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64?e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,""):this.customItems&&(e.customItems=this.customItems),H.toJSON(e)}}class xNe{constructor(e){this.center=null,this.scale=null,this.layerNames=null,this.image=null,this.layers=null,this.CLASS_NAME="SuperMap.WebPrintingJobLittleMapOptions",H.extend(this,e)}destroy(){this.center=null,this.scale=null,this.layerNames=null,this.image instanceof mNe&&(this.image.destroy(),this.image=null),this.layers instanceof $ne&&(this.layers.destroy(),this.layers=null)}toJSON(){var e={scale:this.scale,center:this.center};return this.layerNames?e.layerNames=this.layerNames:this.layers&&(e.layers=this.layers),this.image&&(e.image=this.image),H.toJSON(e)}}class SNe{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobNorthArrowOptions",H.extend(this,e)}destroy(){this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={};return this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),H.toJSON(e)}}class wNe{constructor(e){this.scaleText=null,this.orientation=null,this.type=null,this.intervals=null,this.unit=null,this.CLASS_NAME="SuperMap.WebPrintingJobScaleBarOptions",H.extend(this,e)}destroy(){this.scaleText=null,this.orientation=null,this.type=null,this.intervals=null,this.unit=null}toJSON(){var e={scaleText:this.scaleText||"",type:this.type||"BAR",intervals:this.intervals||"",unit:this.unit||"METER"};return this.orientation&&(e.orientation=this.orientation),H.toJSON(e)}}class bNe{constructor(e){this.type=null,this.url=null,this.token=null,this.value=null,this.CLASS_NAME="SuperMap.WebPrintingJobContent",H.extend(this,e)}destroy(){this.type="WEBMAP",this.url=null,this.token=null,this.value=null}toJSON(){var e={type:this.type};return this.token&&(e.token=this.token),this.url?e.url=this.url:this.value&&(e.value=this.value),H.toJSON(e)}}class ENe{constructor(e){this.templateName=null,this.title=null,this.subTitle=null,this.author=null,this.copyright=null,this.scaleBarOptions=null,this.northArrowOptions=null,this.littleMapOptions=null,this.legendOptions=null,this.CLASS_NAME="SuperMap.WebPrintingJobLayoutOptions",H.extend(this,e)}destroy(){this.templateName=null,this.title=null,this.subTitle=null,this.author=null,this.copyright=null,this.scaleBarOptions instanceof wNe&&(this.scaleBarOptions.destroy(),this.scaleBarOptions=null),this.northArrowOptions instanceof SNe&&(this.northArrowOptions.destroy(),this.northArrowOptions=null),this.littleMapOptions instanceof xNe&&(this.littleMapOptions.destroy(),this.littleMapOptions=null),this.legendOptions instanceof _Ne&&(this.legendOptions.destroy(),this.legendOptions=null)}toJSON(){var e={templateName:this.templateName,title:this.title,subTitle:this.subTitle,author:this.author,copyright:this.copyright};return this.scaleBarOptions&&(e.scaleBarOptions=this.scaleBarOptions),this.northArrowOptions&&(e.northArrowOptions=this.northArrowOptions),this.littleMapOptions&&(e.littleMapOptions=this.littleMapOptions),this.legendOptions&&(e.legendOptions=this.legendOptions),H.toJSON(e)}}class TNe{constructor(e){this.format=null,this.dpi=96,this.scale=null,this.rotation=null,this.center=null,this.CLASS_NAME="SuperMap.WebPrintingJobExportOptions",H.extend(this,e)}destroy(){this.format=null,this.dpi=null,this.scale=null,this.rotation=null,this.center=null,this.outputSize=null}toJSON(){var e={format:this.format||"PDF",dpi:this.dpi,scale:this.scale,center:this.center};return this.rotation&&(e.rotation=this.rotation),this.outputSize&&(e.outputSize=this.outputSize),H.toJSON(e)}}class bot{constructor(e){!e||(this.content=null,this.layoutOptions=null,this.exportOptions=null,H.extend(this,e),this.CLASS_NAME="SuperMap.WebPrintingJobParameters")}destroy(){this.content instanceof bNe&&(this.content.destroy(),this.content=null),this.layoutOptions instanceof ENe&&(this.layoutOptions.destroy(),this.layoutOptions=null),this.exportOptions instanceof TNe&&(this.exportOptions.destroy(),this.exportOptions=null)}}class CNe extends ra{constructor(e,t){super(e,t),t&&H.extend(this,t),this.CLASS_NAME="SuperMap.WebPrintingService",this.url}destroy(){super.destroy()}createWebPrintingJob(e,t){if(!!e)return e.layoutOptions&&e.layoutOptions.legendOptions&&(!e.layoutOptions.legendOptions.title&&(e.layoutOptions.legendOptions.title=""),e.layoutOptions.legendOptions.picAsBase64=e.layoutOptions.legendOptions.picAsBase64&&e.layoutOptions.legendOptions.picAsBase64.replace(/^data:.+;base64,/,""),e.layoutOptions.legendOptions.customItems&&e.layoutOptions.legendOptions.customItems.hasOwnProperty("picAsBase64")&&(e.layoutOptions.legendOptions.customItems.picAsBase64=e.layoutOptions.legendOptions.customItems.picAsBase64.replace(/^data:.+;base64,/,""))),this.processAsync("jobs","POST",t,e)}getPrintingJob(e,t){var r=this;r.processAsync(`jobs/${e}`,"GET",function(i){r.rollingProcess(i,r._processUrl(`jobs/${e}`),t)})}getPrintingJobResult(e,t){return this.processAsync(`jobs/${e}/result`,"GET",t)}getLayoutTemplates(e){return this.processAsync("layouts","GET",e)}rollingProcess(e,t,r){var i=this;!e||(this.id&&clearInterval(this.id),this.id=setInterval(function(){i.request({url:t,method:"GET",scope:i,success:r,failure:r})},1e3))}processAsync(e,t,r,i){var a=this;let o={url:a._processUrl(e),method:t,scope:a,success:r,failure:r};return i&&(o.data=H.toJSON(i)),a.request(o)}transformResult(e,t){return e=H.transformResult(e),(e.status==="FINISHED"||e.status==="ERROR")&&clearInterval(this.id),{result:e,options:t}}_processUrl(e){return e?H.urlPathAppend(this.url,e):this.url}}class ANe extends ra{constructor(e,t){super(e,t),this.options=t||{},t&&H.extend(this,t),this.CLASS_NAME="SuperMap.ImageCollectionService"}destroy(){super.destroy()}getLegend(e,t){var r=this,i={collectionId:r.options.collectionId};typeof e=="function"&&(t=e,e=null);var a=H.convertPath("/collections/{collectionId}/legend",i),o=H.urlPathAppend(r.url,a);return this._processAsync({url:o,method:"GET",params:e,callback:t})}getStatistics(e){var t=this,r={collectionId:t.options.collectionId},i=H.convertPath("/collections/{collectionId}/statistics",r),a=H.urlPathAppend(t.url,i);return this._processAsync({url:a,method:"GET",callback:e})}getTileInfo(e){var t=this,r={collectionId:t.options.collectionId},i=H.convertPath("/collections/{collectionId}/tileInfo",r),a=H.urlPathAppend(t.url,i);return this._processAsync({url:a,method:"GET",callback:e})}deleteItemByID(e,t){var r=this,i={collectionId:r.options.collectionId,featureId:e},a=H.convertPath("/collections/{collectionId}/items/{featureId}",i),o=H.urlPathAppend(r.url,a);return this._processAsync({url:o,method:"DELETE",callback:t})}getItemByID(e,t){var r=this,i={collectionId:r.options.collectionId,featureId:e},a=H.convertPath("/collections/{collectionId}/items/{featureId}",i),o=H.urlPathAppend(r.url,a);return this._processAsync({url:o,method:"GET",callback:t})}_processAsync({url:e,method:t,callback:r,params:i}){return this.request({method:t||"GET",url:e,params:i,scope:this,success:r,failure:r})}}class MNe extends ra{constructor(e,t){super(e,t),this.options=t||{},t&&H.extend(this,t),this.CLASS_NAME="SuperMap.ImageService"}destroy(){super.destroy()}getCollections(e){var t=this,r=H.convertPath("/collections"),i=H.urlPathAppend(t.url,r);return this._processAsync({url:i,mehtod:"GET",callback:e})}getCollectionByID(e,t){var r={collectionId:e},i=this,a=H.convertPath("/collections/{collectionId}",r),o=H.urlPathAppend(i.url,a);return this._processAsync({url:o,mehtod:"GET",callback:t})}search(e,t){var r={...e||{}},i=this,a=H.convertPath("/search"),o=H.urlPathAppend(i.url,a);return this._processAsync({url:o,method:"POST",data:r,callback:t})}_processAsync({url:e,method:t,callback:r,data:i}){return this.request({method:t||"GET",url:e,data:i,scope:this,success:r,failure:r})}}class KR{constructor(e){this.include=void 0,this.exclude=void 0,this.CLASS_NAME="SuperMap.FieldsFilter",H.extend(this,e)}destroy(){var e=this;e.include=void 0,e.exclude=void 0}static constructFromObject(e,t){return e&&(t=t||new KR,e.hasOwnProperty("include")&&(t.include=e.include),e.hasOwnProperty("exclude")&&(t.exclude=e.exclude)),t}}class jE{constructor(e){this.field=void 0,this.direction=jE.Direction.ASC,this.CLASS_NAME="SuperMap.Sortby",H.extend(this,e)}destroy(){var e=this;e.field=void 0,e.direction="ASC"}static constructFromObject(e,t){return e&&(t=t||new jE,e.hasOwnProperty("field")&&(t.field=e.field),e.hasOwnProperty("direction")&&(t.direction=e.direction)),t}}jE.Direction={ASC:"ASC",DESC:"DESC"};class Wne{constructor(e){this.bbox=void 0,this.collections=void 0,this.ids=void 0,this.limit=void 0,this.fields=void 0,this.query=void 0,this.sortby=void 0,this.CLASS_NAME="SuperMap.ImageSearchParameter",H.extend(this,e)}destroy(){var e=this;e.bbox=void 0,e.collections=void 0,e.ids=void 0,e.limit=void 0,e.fields=void 0,e.query=void 0,e.sortby=void 0}static constructFromObject(e,t){return e&&(t=t||new Wne,e.hasOwnProperty("bbox")&&(t.bbox=e.bbox),e.hasOwnProperty("collections")&&(t.collections=e.collections),e.hasOwnProperty("ids")&&(t.ids=e.ids),e.hasOwnProperty("limit")&&(t.limit=e.limit),e.hasOwnProperty("fields")&&(t.fields=KR.constructFromObject&&KR.constructFromObject(e.fields,{})||e.fields),e.hasOwnProperty("query")&&(t.query=e.query),e.hasOwnProperty("sortby")&&(t.sortby=e.sortby,e.sortby&&(t.sortby=e.sortby.map(r=>jE.constructFromObject&&jE.constructFromObject(r,{})||r)))),t}}class cM{constructor(e){this.stretchType=void 0,this.stdevCoefficient=void 0,this.gaussianCoefficient=void 0,this.useMedianValue=void 0,this.minPercent=void 0,this.maxPercent=void 0,this.CLASS_NAME="SuperMap.ImageStretchOption",H.extend(this,e)}destroy(){var e=this;e.stretchType=void 0,e.stdevCoefficient=void 0,e.gaussianCoefficient=void 0,e.useMedianValue=void 0,e.minPercent=void 0,e.maxPercent=void 0}static constructFromObject(e,t){return e&&(t=t||new cM,e.hasOwnProperty("stretchType")&&(t.stretchType=e.stretchType),e.hasOwnProperty("stdevCoefficient")&&(t.stdevCoefficient=e.stdevCoefficient),e.hasOwnProperty("gaussianCoefficient")&&(t.gaussianCoefficient=e.gaussianCoefficient),e.hasOwnProperty("useMedianValue")&&(t.useMedianValue=e.useMedianValue),e.hasOwnProperty("minPercent")&&(t.minPercent=e.minPercent),e.hasOwnProperty("maxPercent")&&(t.maxPercent=e.maxPercent)),t}}cM.StretchType={NONE:"NONE",GAUSSIAN:"GAUSSIAN",PERCENTCLIP:"PERCENTCLIP",MINIMUMMAXIMUM:"MINIMUMMAXIMUM",STANDARDDEVIATION:"STANDARDDEVIATION"};class h3{constructor(e){this.displayMode=void 0,this.displayBands=void 0,this.stretchOption=void 0,this.interpolationMode=void 0,this.colorScheme=void 0,this.colorTable=void 0,this.brightness=void 0,this.contrast=void 0,this.noData=void 0,this.noDataColor=void 0,this.noDataTransparent=void 0,this.backgroundValue=void 0,this.backgroundColor=void 0,this.backgroundTransparent=void 0,this.gridFunctions=void 0,this.CLASS_NAME="SuperMap.ImageRenderingRule",H.extend(this,e)}destroy(){var e=this;e.displayMode=void 0,e.displayBands=void 0,e.stretchOption=void 0,e.interpolationMode=void 0,e.colorScheme=void 0,e.colorTable=void 0,e.brightness=void 0,e.contrast=void 0,e.noData=void 0,e.noDataColor=void 0,e.noDataTransparent=void 0,e.backgroundValue=void 0,e.backgroundColor=void 0,e.backgroundTransparent=void 0,e.gridFuncOptions=void 0}static constructFromObject(e,t){return e&&(t=t||new h3,e.hasOwnProperty("displayMode")&&(t.displayMode=e.displayMode),e.hasOwnProperty("displayBands")&&(t.displayBands=e.displayBands),e.hasOwnProperty("stretchOption")&&(t.stretchOption=cM.constructFromObject&&cM.constructFromObject(e.stretchOption,{})||e.stretchOption),e.hasOwnProperty("interpolationMode")&&(t.interpolationMode=e.interpolationMode),e.hasOwnProperty("colorScheme")&&(t.colorScheme=e.colorScheme),e.hasOwnProperty("colorTable")&&(t.colorTable=e.colorTable),e.hasOwnProperty("brightness")&&(t.brightness=e.brightness),e.hasOwnProperty("contrast")&&(t.contrast=e.contrast),e.hasOwnProperty("noData")&&(t.noData=e.noData),e.hasOwnProperty("noDataColor")&&(t.noDataColor=e.noDataColor),e.hasOwnProperty("backgroundValue")&&(t.backgroundValue=e.backgroundValue),e.hasOwnProperty("noDataTransparent")&&(t.noDataTransparent=e.noDataTransparent),e.hasOwnProperty("backgroundColor")&&(t.backgroundColor=e.backgroundColor),e.hasOwnProperty("backgroundTransparent")&&(t.backgroundTransparent=e.backgroundTransparent),e.hasOwnProperty("gridFunctions")&&(t.gridFunctions=e.gridFunctions)),t}}h3.DisplayMode={COMPOSITE:"COMPOSITE",STRETCHED:"Stretched"};h3.InterpolationMode={NEARESTNEIGHBOR:"NEARESTNEIGHBOR",HIGHQUALITYBILINEAR:"HIGHQUALITYBILINEAR",DEFAULT:"DEFAULT"};class Hne{constructor(e){this.girdFuncName="GFHillShade",this.Azimuth=315,this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFHillShade",H.extend(this,e)}destroy(){var e=this;e.girdFuncName="GFHillShade",e.Azimuth=315,e.Altitude=45,e.ZFactor=1}static constructFromObject(e,t){return e&&(t=t||new Hne,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Azimuth")&&(t.Azimuth=e.Azimuth),e.hasOwnProperty("Altitude")&&(t.Altitude=e.Altitude),e.hasOwnProperty("ZFactor")&&(t.ZFactor=e.ZFactor)),t}}class jne{constructor(e){this.girdFuncName="GFAspect",this.Azimuth=void 0,this.CLASS_NAME="SuperMap.ImageGFAspect",H.extend(this,e)}destroy(){var e=this;e.girdFuncName="GFAspect",e.Azimuth=void 0}static constructFromObject(e,t){return e&&(t=t||new jne,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Azimuth")&&(t.Azimuth=e.Azimuth)),t}}class Xne{constructor(e){this.girdFuncName="GFOrtho",this.CLASS_NAME="SuperMap.ImageGFOrtho",H.extend(this,e)}destroy(){var e=this;e.girdFuncName="GFOrtho"}static constructFromObject(e,t){return e&&(t=t||new Xne,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName)),t}}class Yne{constructor(e){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFSlope",H.extend(this,e)}destroy(){var e=this;e.girdFuncName="GFSlope",e.Altitude=45,e.ZFactor=1}static constructFromObject(e,t){return e&&(t=t||new Yne,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Altitude")&&(t.Altitude=e.Altitude),e.hasOwnProperty("ZFactor")&&(t.ZFactor=e.ZFactor)),t}}class Eot extends ra{constructor(e,t){super(e,t),this.options=t||{},this.CLASS_NAME="SuperMap.KnowledgeGraphService"}destroy(){super.destroy()}query(e,t){const r="cypherQuery",i=H.urlAppend(this.url+"/query.json",`${r}=${encodeURI(e)}`);this.processAsync({url:i,method:"GET",callback:t})}getGraphMaps(e){const t=this.url+"/graphmaps.json";this.processAsync({url:t,method:"GET",callback:e})}getGraphMap(e,t){const r=this.url+`/graphmaps/${e}.json`;this.processAsync({url:r,method:"GET",callback:t})}async getGraphMapData(e){let t=[];const r=await this._getGraphMapData(e);if(!r)return;const i=r.dataContent.queries&&r.dataContent.queries.query||[];let a=[];typeof i=="string"?a=[i]:a=i;const o=this._getGraphMapExpandQuery(r);o.length&&a.push(...o);for(let s=0;s{t.push(`match p=(n)-[]-(m) where id(n)=${i} return p;`)}),t}processAsync({url:e,params:t,method:r,callback:i}){const a={method:r,url:e,scope:this,success:i,failure:i};return t&&(a.params=t),this.request(a)}_getGraphMapData(e){return new Promise((t,r)=>{this.getGraphMap(e,i=>{i.type==="processFailed"?r(i.error):i.result.data===""?r("\u65E0\u6570\u636E"):t(i.result.graphMap)})})}_queryDataBySql(e){return new Promise((t,r)=>{this.query(e,i=>{i.type==="processFailed"?r(i.error):t(i.result)})})}}var Tot={DOES_NOT_INVOLVE:"DOES_NOT_INVOLVE",PUBLISH_FAILED:"PUBLISH_FAILED",PUBLISHED:"PUBLISHED",PUBLISHING:"PUBLISHING",UNPUBLISHED:"UNPUBLISHED",UNPUBLISHED_FAILED:"UNPUBLISHED_FAILED"},Cot={FILENAME:"FILENAME",ID:"ID",LASTMODIFIEDTIME:"LASTMODIFIEDTIME",NICKNAME:"NICKNAME",SERVICESTATUS:"SERVICESTATUS",SIZE:"SIZE",STATUS:"STATUS",TYPE:"TYPE",UPDATETIME:"UPDATETIME",USERNAME:"USERNAME"},Aot={LINKPAGE:"LINKPAGE",MAPTITLE:"MAPTITLE",NICKNAME:"NICKNAME",RESTITLE:"RESTITLE",USERNAME:"USERNAME"};class INe{constructor(e){e=e||{},H.extend(this,e),this.CLASS_NAME="SuperMap.OnlineServiceBase"}request(e,t,r,i={}){return t=xs.appendCredential(t),i.crossOrigin=this.options.crossOrigin,i.headers=this.options.headers,li.commit(e,t,r,i).then(function(a){return a.json()})}}class LNe extends INe{constructor(e,t){super(e),t=t||{},this.MD5=null,this.type=null,this.userName=null,this.fileName=null,this.size=null,this.serviceStatus=null,this.serviceId=null,this.id=null,this.lastModfiedTime=null,this.status=null,this.storageId=null,this.publishInfo=null,this.authorizeSetting=null,this.nickname=null,this.tags=[],this.description=null,this.dataItemServices=null,this.coordType=null,this.dataCheckResult=null,this.dataMetaInfo=null,this.thumbnail=null,H.extend(this,t),this.id&&(this.serviceUrl=e+"/"+this.id),this.CLASS_NAME="SuperMap.OnlineData"}load(){if(!!this.serviceUrl){var e=this;return e.request("GET",this.serviceUrl).then(function(t){H.extend(e,t)})}}getPublishedServices(){return this.dataItemServices}getAuthorizeSetting(){return this.authorizeSetting}}class Mot{constructor(){this.rootUrl="https://www.supermapol.com",this.webUrl=this.rootUrl+"/web";var e=this.webUrl+"/mycontent";this.mDatasUrl=e+"/datas",this.CLASS_NAME="SuperMap.Online"}load(){return li.get(this.rootUrl).then(function(e){return e})}login(){xs.loginOnline(this.rootUrl,!0)}queryDatas(e){var t=this,r=t.mDatasUrl;return e&&(e=e.toJSON()),li.get(r,e).then(function(i){if(!(!i||!i.content||i.content.length<1)){for(var a=[],o=i.content,s=o.length,l=0;lc&&(t.outOfGeoFence&&t.outOfGeoFence(e),t.events.triggerEvent("outOfGeoFence",{data:e})),r})}_distance(e,t,r,i){return Math.sqrt((e-r)*(e-r)+(t-i)*(t-i))}_getMeterPerMapUnit(e){let t=6378137,r;return e==="meter"?r=1:e==="degree"&&(r=Math.PI*2*t/360),r}}class Pp{constructor(){this.BUILTIN_OBJECT={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},this._ctx=null,this._canvas=null,this._pixelCtx=null,this._width=null,this._height=null,this._offsetX=0,this._offsetY=0,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Util"}clone(e){var t=this.BUILTIN_OBJECT;if(typeof e=="object"&&e!==null){var r=e;if(e instanceof Array){r=[];for(var i=0,a=e.length;ia&&(a=e+s+u,r.width=a,h=!0),t+l>o&&(o=t+l+u,r.height=o,h=!0),e<-s&&(s=Math.ceil(-e/u)*u,a+=s,r.width=a,h=!0),t<-l&&(l=Math.ceil(-t/u)*u,o+=l,r.height=o,h=!0),h&&i.translate(s,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r1)for(var a=0,o=i-1;a1?Math.ceil(i):i}),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var r=this.map(e.slice(1,3),function(i){return i+"%"});e[1]=r[0],e[2]=r[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=this.adjust(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}toArray(e){e=this.trim(e),e.indexOf("rgba")<0&&(e=this.toRGBA(e));var t=[],r=0;return e.replace(/[\d.]+/g,function(i){r<3?i=i|0:i=+i,t[r++]=i}),t}convert(e,t){if(!this.isCalculableColor(e))return e;var r=this.getData(e),i=r[3];return typeof i>"u"&&(i=1),e.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):e.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):t.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=i,this.toColor(r,t)}toRGBA(e){return this.convert(e,"rgba")}toRGB(e){return this.convert(e,"rgb")}toHex(e){return this.convert(e,"hex")}toHSVA(e){return this.convert(e,"hsva")}toHSV(e){return this.convert(e,"hsv")}toHSBA(e){return this.convert(e,"hsba")}toHSB(e){return this.convert(e,"hsb")}toHSLA(e){return this.convert(e,"hsla")}toHSL(e){return this.convert(e,"hsl")}toName(e){for(var t in this._nameColors)if(this.toHex(this._nameColors[t])===this.toHex(e))return t;return null}trim(e){return String(e).replace(/\s+/g,"")}normalize(e){if(this._nameColors[e]&&(e=this._nameColors[e]),e=this.trim(e),e=e.replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(e&3840)<<8,r=(e&240)<<4,i=e&15;e="#"+((1<<24)+(t<<4)+t+(r<<4)+r+(i<<4)+i).toString(16).slice(1)}return e}lift(e,t){if(!this.isCalculableColor(e))return e;var r=t>0?1:-1;typeof t>"u"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=this.toRGB(e);for(var i=this.getData(e),a=0;a<3;a++)r===1?i[a]=i[a]*(1-t)|0:i[a]=(255-i[a])*t+i[a]|0;return"rgb("+i.join(",")+")"}reverse(e){if(!this.isCalculableColor(e))return e;var t=this.getData(this.toRGBA(e));return t=this.map(t,function(r){return 255-r}),this.toColor(t,"rgb")}mix(e,t,r){if(!this.isCalculableColor(e)||!this.isCalculableColor(t))return e;typeof r>"u"&&(r=.5),r=1-this.adjust(r,[0,1]);for(var i=r*2-1,a=this.getData(this.toRGBA(e)),o=this.getData(this.toRGBA(t)),s=a[3]-o[3],l=((i*s===-1?i:(i+s)/(1+i*s))+1)/2,u=1-l,h=[],c=0;c<3;c++)h[c]=a[c]*l+o[c]*u;var f=a[3]*r+o[3]*(1-r);return f=Math.max(0,Math.min(1,f)),a[3]===1&&o[3]===1?this.toColor(h,"rgb"):(h[3]=f,this.toColor(h,"rgba"))}random(){return"#"+Math.random().toString(16).slice(2,8)}getData(e){e=this.normalize(e);var t=e.match(this.colorRegExp);if(t===null)throw new Error("The color format error");var r,i,a=[],o;if(t[2])r=t[2].replace("#","").split(""),o=[r[0]+r[1],r[2]+r[3],r[4]+r[5]],a=this.map(o,function(f){return SE.prototype.adjust.call(this,parseInt(f,16),[0,255])});else if(t[4]){var s=t[4].split(",");i=s[3],o=s.slice(0,3),a=this.map(o,function(f){return f=Math.floor(f.indexOf("%")>0?parseInt(f,0)*2.55:f),SE.prototype.adjust.call(this,f,[0,255])}),typeof i<"u"&&a.push(this.adjust(parseFloat(i),[0,1]))}else if(t[5]||t[6]){var l=(t[5]||t[6]).split(","),u=parseInt(l[0],0)/360,h=l[1],c=l[2];i=l[3],a=this.map([h,c],function(f){return SE.prototype.adjust.call(this,parseFloat(f)/100,[0,1])}),a.unshift(u),typeof i<"u"&&a.push(this.adjust(parseFloat(i),[0,1]))}return a}alpha(e,t){if(!this.isCalculableColor(e))return e;t===null&&(t=1);var r=this.getData(this.toRGBA(e));return r[3]=this.adjust(Number(t).toFixed(4),[0,1]),this.toColor(r,"rgba")}map(e,t){if(typeof t!="function")throw new TypeError;for(var r=e?e.length:0,i=0;i=t[1]&&(e=t[1]),e}isCalculableColor(e){return e instanceof Array||typeof e=="string"}_HSV_2_RGB(e){var t=e[0],r=e[1],i=e[2],a,o,s;if(r===0)a=i*255,o=i*255,s=i*255;else{var l=t*6;l===6&&(l=0);var u=l|0,h=i*(1-r),c=i*(1-r*(l-u)),f=i*(1-r*(1-(l-u))),d=0,v=0,p=0;u===0?(d=i,v=f,p=h):u===1?(d=c,v=i,p=h):u===2?(d=h,v=i,p=f):u===3?(d=h,v=c,p=i):u===4?(d=f,v=h,p=i):(d=i,v=h,p=c),a=d*255,o=v*255,s=p*255}return[a,o,s]}_HSL_2_RGB(e){var t=e[0],r=e[1],i=e[2],a,o,s;if(r===0)a=i*255,o=i*255,s=i*255;else{var l;i<.5?l=i*(1+r):l=i+r-r*i;var u=2*i-l;a=255*this._HUE_2_RGB(u,l,t+1/3),o=255*this._HUE_2_RGB(u,l,t),s=255*this._HUE_2_RGB(u,l,t-1/3)}return[a,o,s]}_HUE_2_RGB(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+(t-e)*6*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}_RGB_2_HSB(e){var t=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.min(t,r,i),o=Math.max(t,r,i),s=o-a,l=o,u,h;if(s===0)u=0,h=0;else{h=s/o;var c=((o-t)/6+s/2)/s,f=((o-r)/6+s/2)/s,d=((o-i)/6+s/2)/s;t===o?u=d-f:r===o?u=1/3+c-d:i===o&&(u=2/3+f-c),u<0&&(u+=1),u>1&&(u-=1)}return u=u*360,h=h*100,l=l*100,[u,h,l]}_RGB_2_HSL(e){var t=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.min(t,r,i),o=Math.max(t,r,i),s=o-a,l=(o+a)/2,u,h;if(s===0)u=0,h=0;else{l<.5?h=s/(o+a):h=s/(2-o-a);var c=((o-t)/6+s/2)/s,f=((o-r)/6+s/2)/s,d=((o-i)/6+s/2)/s;t===o?u=d-f:r===o?u=1/3+c-d:i===o&&(u=2/3+f-c),u<0&&(u+=1),u>1&&(u-=1)}return u=u*360,h=h*100,l=l*100,[u,h,l]}}var Ym=new SE;class vB{static createCanvas(e,t){var r=document.createElement("canvas");return r.height=e,r.width=t,r.getContext("2d")}static getLinearGradient(e,t,r,i,a){this._ctx||(this._ctx=this.getContext());for(var o=this._ctx.createLinearGradient(e,t,r,i),s=a.length,l=1/(s-1),u=0,h=0;h=t)if(r==="RANGE")for(o=0;o=0?this.getSqrtInterval(e,r):!1;if(t==="logarithm")return this.getMin(e)>0?this.getGeometricProgression(e,r):!1}static getSum(e){return this.getInstance(e).sum()}static getMax(e){return this.getInstance(e).max()}static getMin(e){return this.getInstance(e).min()}static getMean(e){return this.getInstance(e).mean()}static getMedian(e){return this.getInstance(e).median()}static getTimes(e){return e.length}static getEqInterval(e,t){return this.getInstance(e).getClassEqInterval(t)}static getJenks(e,t){return this.getInstance(e).getClassJenks(t)}static getSqrtInterval(e,t){return e=e.map(function(i){return Math.sqrt(i)}),this.getInstance(e).getClassEqInterval(t).map(function(i){return i*i})}static getGeometricProgression(e,t){return this.getInstance(e).getClassGeometricProgression(t)}}var gB=function(n){var e=6378137,t;if(n===Wl.METER)t=1;else if(n===Wl.DEGREE)t=Math.PI*2*e/360;else if(n===Wl.KILOMETER)t=.001;else if(n===Wl.INCH)t=1/.025399999918;else if(n===Wl.FOOT)t=.3048;else return t;return t};function Dot(n,e,t,r,i=22){var a=[];if(n&&n.length>0)for(let o=0;oMath.abs(n-e[i])&&(r=Math.abs(n-e[i]),t=i);return t}function kot(n,e,t){const r=39.37007874015748,i=gB(t);return 1/(n*e*r*i)}function Fot(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function Bot(n,e){const t=[];return Fot(n,e)&&(n[0]>e[0]?t[0]=n[0]:t[0]=e[0],n[1]>e[1]?t[1]=n[1]:t[1]=e[1],n[2]-1&&n%1==0&&n-1&&n%1==0&&n<=PNe}function NNe(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function bst(n){return!!n&&typeof n=="object"}function Est(n){return RNe(n)?cst(n):vst(n)}var Tst=pst(Est),Cst=Tst;class Pt{constructor(e){this.env=null,this.parser=null,this.ruleSet=null,this.cartoStr="",this.shaders=null,typeof e=="string"&&(this.cartoStr=e,this.env={frames:[],errors:[],error:function(t){this.errors.push(t)}},this.parser=this.getParser(this.env),this.parse(e),this.shaders=this.toShaders())}getParser(e){var t,r,i,a,o,s,l,u,h,c=this;function f(){a=l[i],o=r,u=r}function d(){l[i]=a,r=o,u=r}function v(){r>u&&(l[i]=l[i].slice(r-u),u=r)}function p(y){var _,x,S,w;if(y instanceof Function)return y.call(h.parsers);if(typeof y=="string")_=t.charAt(r)===y?y:null,x=1,v();else if(v(),_=y.exec(l[i]),_)x=_[0].length;else return null;if(_){var b=r+=x;for(w=r+l[i].length-x;r=0&&_.charAt(w)!==` `;w--)y.column++;return new Error([y.filename,y.line,y.column,y.message].join(";"))}return this.env=e=e||{},this.env.filename=this.env.filename||null,this.env.inputs=this.env.inputs||{},h={parse:function(y){var _,x=null;if(r=i=u=s=0,l=[],t=y.replace(/\r\n/g,` `),e.filename&&(c.env.inputs[e.filename]=t),l=function(w){for(var b=0,E=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,T=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,C=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,A=0,M,I=w[0],R,k=0,D,G;k0?"missing closing `}`":"missing opening `{`"}),w.map(function(W){return W.join("")})}([[]]),x)throw m(x);var S=function(w,b){var E=w.specificity,T=b.specificity;return E[0]!=T[0]?T[0]-E[0]:E[1]!=T[1]?T[1]-E[1]:E[2]!=T[2]?T[2]-E[2]:T[3]-E[3]};return _=new Pt.Tree.Ruleset([],p(this.parsers.primary)),_.root=!0,_.toList=function(){return function(w){w.error=function(E){w.errors||(w.errors=new Error("")),w.errors.message?w.errors.message+=` `+m(E).message:w.errors.message=m(E).message},w.frames=w.frames||[];var b=this.flatten([],[],w);return b.sort(S),b}}(),_},parsers:{primary:function(){for(var y,_=[];(y=p(this.rule)||p(this.ruleset)||p(this.comment))||p(/^[\s\n]+/)||(y=p(this.invalid));)y&&_.push(y);return _},invalid:function(){var y=p(/^[^;\n]*[;\n]/);if(y)return new Pt.Tree.Invalid(y,o)},comment:function(){var y;if(t.charAt(r)==="/"){if(t.charAt(r+1)==="/")return new Pt.Tree.Comment(p(/^\/\/.*/),!0);if(y=p(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new Pt.Tree.Comment(y)}},entities:{quoted:function(){if(!(t.charAt(r)!=='"'&&t.charAt(r)!=="'")){var y=p(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);if(y)return new Pt.Tree.Quoted(y[1]||y[2])}},field:function(){var y="[",_="]";if(!!p(y)){var x=p(/(^[^\]]+)/);if(!!p(_)&&x)return new Pt.Tree.Field(x[1])}},comparison:function(){var y=p(/^=~|=|!=|<=|>=|<|>/);if(y)return y},keyword:function(){var y=p(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);if(y)return new Pt.Tree.Keyword(y)},call:function(){var y,_;if(!!(y=/^([\w\-]+|%)\(/.exec(l[i]))){if(y=y[1],y==="url")return null;r+=y.length;var x="(",S=")";if(p(x),_=p(this.entities.arguments),!!p(S)&&y)return new Pt.Tree.Call(y,_,r)}},arguments:function(){for(var y=[],_;_=p(this.expression);){y.push(_);var x=",";if(!p(x))break}return y},literal:function(){return p(this.entities.dimension)||p(this.entities.keywordcolor)||p(this.entities.hexcolor)||p(this.entities.quoted)},url:function(){var y;if(!(t.charAt(r)!=="u"||!p(/^url\(/))){y=p(this.entities.quoted)||p(this.entities.variable)||p(/^[\-\w%@_match\/.&=:;#+?~]+/)||"";var _=")";return p(_)?new Pt.Tree.URL(typeof y.value<"u"||y instanceof Pt.Tree.Variable?y:new Pt.Tree.Quoted(y)):new Pt.Tree.Invalid(y,o,"Missing closing ) in URL.")}},variable:function(){var y,_=r;if(t.charAt(r)==="@"&&(y=p(/^@[\w-]+/)))return new Pt.Tree.Variable(y,_,e.filename)},hexcolor:function(){var y;if(t.charAt(r)==="#"&&(y=p(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new Pt.Tree.Color(y[1])},keywordcolor:function(){var y=l[i].match(/^[a-z]+/);if(y&&y[0]in Pt.Tree.Reference.data.colors)return new Pt.Tree.Color(Pt.Tree.Reference.data.colors[p(/^[a-z]+/)])},dimension:function(){var y=t.charCodeAt(r);if(!(y>57||y<45||y===47)){var _=p(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);if(_)return new Pt.Tree.Dimension(_[1],_[2],o)}}},variable:function(){var y;if(t.charAt(r)==="@"&&(y=p(/^(@[\w-]+)\s*:/)))return y[1]},entity:function(){var y=p(this.entities.call)||p(this.entities.literal),_=p(this.entities.field)||p(this.entities.variable),x=p(this.entities.url)||p(this.entities.keyword);return y||_||x},end:function(){var y=";";return p(y)||g("}")},element:function(){var y=p(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(y)return new Pt.Tree.Element(y)},attachment:function(){var y=p(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(y)return y[1]},selector:function(){for(var y,_,x,S=[],w,b=new Pt.Tree.Filterset,E,T=[],C=0,A=0;(x=p(this.element))||(E=p(this.zoom))||(w=p(this.filter))||(y=p(this.attachment));){if(C++,x)S.push(x);else if(E)T.push(E),A++;else if(w){var M=b.add(w);if(M)throw m({message:M,index:r-1});A++}else{if(_)throw m({message:"Encountered second attachment name.",index:r-1});_=y}var I=t.charAt(r);if(I==="{"||I==="}"||I===";"||I===",")break}if(C)return new Pt.Tree.Selector(b,T,S,_,A,o)},filter:function(){f();var y,_,x,S="[",w="]";if(!!p(S)&&(y=p(/^[a-zA-Z0-9\-_]+/)||p(this.entities.quoted)||p(this.entities.variable)||p(this.entities.keyword)||p(this.entities.field))&&(y instanceof Pt.Tree.Quoted&&(y=new Pt.Tree.Field(y.toString())),(_=p(this.entities.comparison))&&(x=p(this.entities.quoted)||p(this.entities.variable)||p(this.entities.dimension)||p(this.entities.keyword)||p(this.entities.field)))){if(!p(w))throw m({message:"Missing closing ] of filter.",index:o-1});return y.is||(y=new Pt.Tree.Field(y)),new Pt.Tree.Filter(y,_,x,o,e.filename)}},zoom:function(){f();var y,_,x="]";if(p(/^\[\s*zoom/g)&&(y=p(this.entities.comparison))&&(_=p(this.entities.variable)||p(this.entities.dimension))&&p(x))return new Pt.Tree.Zoom(y,_,o);d()},block:function(){var y,_="{",x="}";if(p(_)&&(y=p(this.primary))&&p(x))return y},ruleset:function(){var y=[],_,x,S=",";for(f();_=p(this.selector);){for(y.push(_);p(this.comment););if(!p(S))break;for(;p(this.comment););}if(_)for(;p(this.comment););if(y.length>0&&(x=p(this.block))){if(y.length===1&&y[0].elements.length&&y[0].elements[0].value==="Map"){var w=new Pt.Tree.Ruleset(y,x);return w.isMap=!0,w}return new Pt.Tree.Ruleset(y,x)}else d()},rule:function(){var y,_,x=t.charAt(r);if(f(),!(x==="."||x==="#")&&(y=p(this.variable)||p(this.property))){if(_=p(this.value),_&&p(this.end))return new Pt.Tree.Rule(y,_,o,e.filename);s=r,d()}},font:function(){for(var y=[],_=[],x,S=",";x=p(this.entity);)_.push(x);if(y.push(new Pt.Tree.Expression(_)),p(S))for(;(x=p(this.expression))&&(y.push(x),!!p(S)););return new Pt.Tree.Value(y)},value:function(){for(var y,_=[],x=",";(y=p(this.expression))&&(_.push(y),!!p(x)););if(_.length>1)return new Pt.Tree.Value(_.map(function(S){return S.value[0]}));if(_.length===1)return new Pt.Tree.Value(_)},sub:function(){var y,_="(",x=")";if(p(_)&&(y=p(this.expression))&&p(x))return y},multiplication:function(){var y,_,x,S,w="/";if(y=p(this.operand)){for(;(x=p(w)||p("*")||p("%"))&&(_=p(this.operand));)S=new Pt.Tree.Operation(x,[S||y,_],o);return S||y}},addition:function(){var y,_,x,S,w="+";if(y=p(this.multiplication)){for(;(x=p(/^[-+]\s+/)||t.charAt(r-1)!=" "&&(p(w)||p("-")))&&(_=p(this.multiplication));)S=new Pt.Tree.Operation(x,[S||y,_],o);return S||y}},operand:function(){return p(this.sub)||p(this.entity)},expression:function(){for(var y,_=[];y=p(this.addition)||p(this.entity);)_.push(y);if(_.length>0)return new Pt.Tree.Expression(_)},property:function(){var y=p(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(y)return y[1]}}},h}parse(e){var t=this.parser,r=this.ruleSet=t.parse(e);return r}toShaders(){if(this.ruleSet){var e=this.ruleSet;if(e){var t=e.toList(this.env);t.reverse();var r={},i=[];this._toShaders(r,i,t);for(var a=[],o={},s=0,l=t.length;s=0){if(!y.featureFilter){var w=S+x.length,b=_.indexOf(")",w+1),E="featureId&&(featureId"+_.substring(w,b)+")",T=function(C){return!!E};Object.defineProperty(y,"featureFilter",{configurable:!0,enumerable:!1,value:T})}return{property:v,getValue:Function("attributes","zoom","seftFilter","var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){"+_+";} return _value; ")}}else return{property:v,getValue:Function("attributes","zoom","var _value = null;"+_+"; return _value; ")}}(c[v],f);Object.defineProperty(f,"attachment",{configurable:!0,enumerable:!1,value:h}),Object.defineProperty(f,"elements",{configurable:!0,enumerable:!1,value:u.elements}),a.push(f),o[i[s]]=!0}Object.defineProperty(f,"zoom",{configurable:!0,enumerable:!1,value:u.zoom})}return a}}return null}_toShaders(e,t,r){for(let i=0,a=r.length;i= minzoom - 1e-6 and scale < maxzoom + 1e-6"},maxzoom:{"default-value":"1.79769e+308",type:"float","default-meaning":"The layer will be visible at the maximum possible scale",doc:"The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},queryable:{"default-value":!1,type:"boolean","default-meaning":"The layer will not be available for the direct querying of data values",doc:"This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"},"clear-label-cache":{"default-value":!1,type:"boolean","default-meaning":"The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",doc:"This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"},"group-by":{"default-value":"",type:"string","default-meaning":"No special layer grouping will be used during rendering",doc:"https://github.com/mapnik/mapnik/wiki/Grouped-rendering"},"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"maximum-extent":{"default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."}},symbolizers:{"*":{"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},map:{"background-color":{css:"background-color","default-value":"none","default-meaning":"transparent",type:"color",doc:"Map Background color"},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value":"butt",type:["butt","round","square"],doc:"The display of line endings"},"stroke-gamma":{css:"line-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of stroke line"},"stroke-gamma-method":{css:"line-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},"stroke-dasharray":{css:"line-dasharray",type:"numbers",doc:"A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.","default-value":"none","default-meaning":"solid line"},"stroke-dashoffset":{css:"line-dash-offset",type:"numbers",doc:"valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)","default-value":"none","default-meaning":"solid line"},"stroke-miterlimit":{css:"line-miterlimit",type:"float",doc:"The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.","default-value":4,"default-meaning":"Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"},clip:{css:"line-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},offset:{css:"line-offset",type:"float","default-value":0,"default-meaning":"no offset",doc:"Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."},rasterizer:{css:"line-rasterizer",type:["full","fast"],"default-value":"full",doc:"Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."},"geometry-transform":{css:"line-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},markers:{file:{css:"marker-file",doc:"An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.","default-value":"","default-meaning":"An ellipse or circle, if width equals height",type:"uri"},opacity:{css:"marker-opacity",doc:"The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke","default-value":1,"default-meaning":"The stroke-opacity and fill-opacity will be used",type:"float"},"fill-opacity":{css:"marker-fill-opacity",doc:"The fill opacity of the marker","default-value":1,"default-meaning":"opaque",type:"float"},stroke:{css:"marker-line-color",doc:"The color of the stroke around a marker shape.","default-value":"black",type:"color"},"stroke-width":{css:"marker-line-width",doc:"The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",type:"float"},"stroke-opacity":{css:"marker-line-opacity","default-value":1,"default-meaning":"opaque",doc:"The opacity of a line",type:"float"},placement:{css:"marker-placement",type:["point","line","interior"],"default-value":"point","default-meaning":"Place markers at the center point (centroid) of the geometry",doc:"Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"},"multi-policy":{css:"marker-multi-policy",type:["each","whole","largest"],"default-value":"each","default-meaning":"If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",doc:"A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."},"marker-type":{css:"marker-type",type:["arrow","ellipse"],"default-value":"ellipse",doc:"The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"},width:{css:"marker-width","default-value":10,doc:"The width of the marker, if using one of the default types.",type:"expression"},height:{css:"marker-height","default-value":10,doc:"The height of the marker, if using one of the default types.",type:"expression"},fill:{css:"marker-fill","default-value":"blue",doc:"The color of the area of the marker.",type:"color"},"allow-overlap":{css:"marker-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping markers are shown or hidden.","default-meaning":"Do not allow makers to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"marker-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},spacing:{css:"marker-spacing",doc:"Space between repeated labels","default-value":100,type:"float"},"max-error":{css:"marker-max-error",type:"float","default-value":.2,doc:"The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."},transform:{css:"marker-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},clip:{css:"marker-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"marker-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"marker-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"marker-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},shield:{name:{css:"shield-name",type:"expression",serialization:"content",doc:'Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]'},file:{css:"shield-file",required:!0,type:"uri","default-value":"none",doc:"Image file to render behind the shield text"},"face-name":{css:"shield-face-name",type:"string",validate:"font",doc:"Font name and style to use for the shield text","default-value":"",required:!0},"unlock-image":{css:"shield-unlock-image",type:"boolean",doc:"This parameter should be set to true if you are trying to position text beside rather than on top of the shield image","default-value":!1,"default-meaning":"text alignment relative to the shield image uses the center of the image as the anchor for text positioning."},size:{css:"shield-size",type:"float",doc:"The size of the shield text in pixels"},fill:{css:"shield-fill",type:"color",doc:"The color of the shield text"},placement:{css:"shield-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."},"avoid-edges":{css:"shield-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.",type:"boolean","default-value":!1},"allow-overlap":{css:"shield-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"line-pattern":{file:{css:"line-pattern-file",type:"uri","default-value":"none",required:!0,doc:"An image file to be repeated and warped along a line"},clip:{css:"line-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"line-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"polygon-pattern":{file:{css:"polygon-pattern-file",type:"uri","default-value":"none",required:!0,doc:"Image to use as a repeated pattern fill within a polygon"},alignment:{css:"polygon-pattern-alignment",type:["local","global"],"default-value":"local",doc:"Specify whether to align pattern fills to the layer or to the map."},gamma:{css:"polygon-pattern-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon pattern edges"},opacity:{css:"polygon-pattern-opacity",type:"float",doc:"(Default 1.0) - Apply an opacity level to the image used for the pattern","default-value":1,"default-meaning":"The image is rendered without modifications"},clip:{css:"polygon-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},raster:{opacity:{css:"raster-opacity","default-value":1,"default-meaning":"opaque",type:"float",doc:"The opacity of the raster symbolizer on top of other symbolizers."},"filter-factor":{css:"raster-filter-factor","default-value":-1,"default-meaning":"Allow the datasource to choose appropriate downscaling.",type:"float",doc:"This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."},scaling:{css:"raster-scaling",type:["near","fast","bilinear","bilinear8","bicubic","spline16","spline36","hanning","hamming","hermite","kaiser","quadric","catrom","gaussian","bessel","mitchell","sinc","lanczos","blackman"],"default-value":"near",doc:"The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."},"mesh-size":{css:"raster-mesh-size","default-value":16,"default-meaning":"Reprojection mesh will be 1/16 of the resolution of the source image",type:"unsigned",doc:"A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."},"comp-op":{css:"raster-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},point:{file:{css:"point-file",type:"uri",required:!1,"default-value":"none",doc:"Image file to represent a point"},"allow-overlap":{css:"point-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping points are shown or hidden.","default-meaning":"Do not allow points to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"point-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},opacity:{css:"point-opacity",type:"float","default-value":1,"default-meaning":"Fully opaque",doc:"A value from 0 to 1 to control the opacity of the point"},placement:{css:"point-placement",type:["centroid","interior"],doc:"How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.","default-value":"centroid"},transform:{css:"point-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},"comp-op":{css:"point-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},text:{name:{css:"text-name",type:"expression",required:!0,"default-value":"",serialization:"content",doc:"Value to use for a text label. Data columns are specified using brackets like [column_name]"},"face-name":{css:"text-face-name",type:"string",validate:"font",doc:"Font name and style to render a label in",required:!0},size:{css:"text-size",type:"float","default-value":10,doc:"Text size in pixels"},"text-ratio":{css:"text-ratio",doc:"Define the amount of text (of the total) present on successive lines when wrapping occurs","default-value":0,type:"unsigned"},"wrap-width":{css:"text-wrap-width",doc:"Length of a chunk of text in characters before wrapping text","default-value":0,type:"unsigned"},"wrap-before":{css:"text-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"text-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long text."},spacing:{css:"text-spacing",type:"unsigned",doc:"Distance between repeated text labels on a line (aka. label-spacing)"},"character-spacing":{css:"text-character-spacing",type:"float","default-value":0,doc:"Horizontal spacing adjustment between characters in pixels"},"line-spacing":{css:"text-line-spacing","default-value":0,type:"unsigned",doc:"Vertical spacing adjustment between lines in pixels"},"label-position-tolerance":{css:"text-label-position-tolerance","default-value":0,type:"unsigned",doc:"Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"},"max-char-angle-delta":{css:"text-max-char-angle-delta",type:"float","default-value":"22.5",doc:"The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."},fill:{css:"text-fill",doc:"Specifies the color for the text","default-value":"#000000",type:"color"},opacity:{css:"text-opacity",doc:"A number from 0 to 1 specifying the opacity for the text","default-value":1,"default-meaning":"Fully opaque",type:"float"},"halo-fill":{css:"text-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"text-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},dx:{css:"text-dx",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"text-dy",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"vertical-alignment":{css:"text-vertical-alignment",type:["top","middle","bottom","auto"],doc:"Position of label relative to point position.","default-value":"auto","default-meaning":'Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.'},"avoid-edges":{css:"text-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.","default-value":!1,type:"boolean"},"minimum-distance":{css:"text-min-distance",doc:"Minimum permitted distance to the next text symbolizer.",type:"float"},"minimum-padding":{css:"text-min-padding",doc:"Determines the minimum amount of padding that a text symbolizer gets relative to other text",type:"float"},"minimum-path-length":{css:"text-min-path-length",type:"float","default-value":0,"default-meaning":"place labels on all paths",doc:"Place labels only on paths longer than this value."},"allow-overlap":{css:"text-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"expression",doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"expression","default-value":"0"}}},colors:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],transparent:[0,0,0,0]},filter:{value:["true","false","null","point","linestring","polygon","collection"]}};Pt.mapnik_reference={version:{latest:Kde,"2.1.1":Kde}};Pt.Tree={};Pt.Tree.operate=function(n,e,t){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"%":return e%t;case"/":return e/t}};Pt.Tree.functions={rgb:function(n,e,t){return this.rgba(n,e,t,1)},rgba:function(n,e,t,r){var i=this,a=[n,e,t].map(function(o){return i.number(o)});return r=i.number(r),a.some(isNaN)||isNaN(r)?null:new Pt.Tree.Color(a,r)},stop:function(n){var e,t;return arguments.length>1&&(e=arguments[1]),arguments.length>2&&(t=arguments[2]),{is:"tag",val:n,color:e,mode:t,toString(r){return` "}}},hsl:function(n,e,t){return this.hsla(n,e,t,1)},hsla:function(n,e,t,r){if(n=this.number(n)%360/360,e=this.number(e),t=this.number(t),r=this.number(r),[n,e,t,r].some(isNaN))return null;var i=t<=.5?t*(e+1):t+e-t*e,a=t*2-i;return this.rgba(o(n+1/3)*255,o(n)*255,o(n-1/3)*255,r);function o(s){return s=s<0?s+1:s>1?s-1:s,s*6<1?a+(i-a)*s*6:s*2<1?i:s*3<2?a+(i-a)*(2/3-s)*6:a}},hue:function(n){return"toHSL"in n?new Pt.Tree.Dimension(Math.round(n.toHSL().h)):null},saturation:function(n){return"toHSL"in n?new Pt.Tree.Dimension(Math.round(n.toHSL().s*100),"%"):null},lightness:function(n){return"toHSL"in n?new Pt.Tree.Dimension(Math.round(n.toHSL().l*100),"%"):null},alpha:function(n){return"toHSL"in n?new Pt.Tree.Dimension(n.toHSL().a):null},saturate:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.s+=e.value/100,t.s=this.clamp(t.s),this.hsla_simple(t)},desaturate:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.s-=e.value/100,t.s=this.clamp(t.s),this.hsla_simple(t)},lighten:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.l+=e.value/100,t.l=this.clamp(t.l),this.hsla_simple(t)},darken:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.l-=e.value/100,t.l=this.clamp(t.l),this.hsla_simple(t)},fadein:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.a+=e.value/100,t.a=this.clamp(t.a),this.hsla_simple(t)},fadeout:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.a-=e.value/100,t.a=this.clamp(t.a),this.hsla_simple(t)},spin:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL(),r=(t.h+e.value)%360;return t.h=r<0?360+r:r,this.hsla_simple(t)},replace:function(n,e,t){return n.is==="field"?n.toString+".replace("+e.toString()+", "+t.toString()+")":n.replace(e,t)},mix:function(n,e,t){var r=t.value/100,i=r*2-1,a=n.toHSL().a-e.toHSL().a,o=((i*a==-1?i:(i+a)/(1+i*a))+1)/2,s=1-o,l=[n.rgb[0]*o+e.rgb[0]*s,n.rgb[1]*o+e.rgb[1]*s,n.rgb[2]*o+e.rgb[2]*s],u=n.alpha*r+e.alpha*(1-r);return new Pt.Tree.Color(l,u)},greyscale:function(n){return this.desaturate(n,new Pt.Tree.Dimension(100))},"%":function(n){for(var e=Array.prototype.slice.call(arguments,1),t=n.value,r=0;r.5?h/(2-a-o):h/(a+o),a){case e:s=(t-r)/h+(t"}ev(){return this}};Pt.Tree.Definition=class{constructor(e,t){this.elements=e.elements,this.rules=t,this.ruleIndex={};for(var r=0;r=0){if(!e.ppi)return e.error({message:"ppi is not set, so metric units can't be used",index:this.index}),{is:"undefined",value:"undefined"};this.value=this.value/this.densities[this.unit]*e.ppi,this.unit="px"}return this}toColor(){return new Pt.Tree.Color([this.value,this.value,this.value])}round(){return this.value=Math.round(this.value),this}toString(){return this.value.toString()}operate(e,t,r){return this.unit==="%"&&r.unit!=="%"?(e.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):this.unit!=="%"&&r.unit==="%"?t==="*"||t==="/"||t==="%"?(e.error({message:"Percent values can only be added or subtracted from other values",index:this.index}),{is:"undefined",value:"undefined"}):new Pt.Tree.Dimension(Pt.Tree.operate(t,this.value,this.value*r.value*.01),this.unit):new Pt.Tree.Dimension(Pt.Tree.operate(t,this.value,r.value),this.unit||r.unit)}};Pt.Tree.Element=class{constructor(e){this.value=e.trim(),this.value[0]==="#"&&(this.type="id",this.clean=this.value.replace(/^#/,"")),this.value[0]==="."&&(this.type="class",this.clean=this.value.replace(/^\./,"")),this.value.indexOf("*")!==-1&&(this.type="wildcard")}specificity(){return[this.type==="id"?1:0,this.type==="class"?1:0]}toString(){return this.value}};Pt.Tree.Expression=class{constructor(e){this.is="expression",this.value=e}ev(e){return this.value.length>1?new Pt.Tree.Expression(this.value.map(function(t){return t.ev(e)})):this.value[0].ev(e)}toString(e){return this.value.map(function(t){return t.toString(e)}).join(" ")}};Pt.Tree.Field=class{constructor(e){this.is="field",this.value=e||""}toString(){return'["'+this.value.toUpperCase()+'"]'}ev(){return this}};Pt.Tree.Filter=class{constructor(e,t,r,i,a){this.ops={"<":[" < ","numeric"],">":[" > ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" <= ","numeric"],">=":[" >= ","numeric"],"=~":[".match(","string",")"]},this.key=e,this.op=t,this.val=r,this.index=i,this.filename=a,this.id=this.key+this.op+this.val}ev(e){return this.key=this.key.ev(e),this.val=this.val.ev(e),this}toString(){return"["+this.id+"]"}};Pt.Tree.Filterset=class{constructor(){this.filters={}}toJS(e){function t(a){var o=a.op;o==="="&&(o="==");var s=a.val;a._val!==void 0&&(s=a._val.toString(!0)),a.key&&a.key.value==="scale"?s=+s:(typeof s=="string"||typeof s=="object")&&(s="'"+s+"'");var l="attributes";return l+"&&"+l+a.key+"&&"+l+a.key+" "+o+s}var r=[];for(var i in this.filters)r.push(t(this.filters[i]));return r.join(" && ")}toString(){var e=[];for(var t in this.filters)e.push(this.filters[t].id);return e.sort().join(" ")}ev(e){for(var t in this.filters)this.filters[t].ev(e);return this}clone(){var e=new Pt.Tree.Filterset;for(var t in this.filters)e.filters[t]=this.filters[t];return e}cloneWith(e){var t=[];for(var r in e.filters){var i=this.addable(e.filters[r]);if(i===!1)return!1;i===!0&&t.push(e.filters[r])}if(!t.length)return null;var a=new Pt.Tree.Filterset;for(r in this.filters)a.filters[r]=this.filters[r];for(;r=t.shift();)a.add(r);return a}addable(e){var t=e.key.toString(),r=e.val.toString();switch(r.match(/^[0-9]+(\.[0-9]*)?_match/)&&(r=parseFloat(r)),e.op){case"=":return this.filters[t+"="]!==void 0?this.filters[t+"="].val.toString()!=r?!1:null:!(this.filters[t+"!="+r]!==void 0||this.filters[t+">"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+"<"]!==void 0&&this.filters[t+"<"].val<=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>r||this.filters[t+"<="]!==void 0&&this.filters[t+"<="].val"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+"<"]!==void 0&&this.filters[t+"<"].val<=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>r||this.filters[t+"<="]!==void 0&&this.filters[t+"<="].val":return t+"="in this.filters?this.filters[t+"="].val<=r?!1:null:this.filters[t+"<"]!==void 0&&this.filters[t+"<"].val<=r||this.filters[t+"<="]!==void 0&&this.filters[t+"<="].val<=r?!1:this.filters[t+">"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>r?null:!0;case">=":return this.filters[t+"="]!==void 0?this.filters[t+"="].val"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>=r?null:!0;case"<":return this.filters[t+"="]!==void 0?this.filters[t+"="].val>=r?!1:null:this.filters[t+">"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>=r?!1:this.filters[t+"<"]!==void 0&&this.filters[t+"<"].val<=r||this.filters[t+"<="]!==void 0&&this.filters[t+"<="].valr?!1:null:this.filters[t+">"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>r?!1:this.filters[t+"<"]!==void 0&&this.filters[t+"<"].val<=r||this.filters[t+"<="]!==void 0&&this.filters[t+"<="].val<=r?null:!0}}conflict(e){var t=e.key.toString(),r=e.val.toString();return isNaN(parseFloat(r))||(r=parseFloat(r)),e.op==="="&&this.filters[t+"="]!==void 0&&r!=this.filters[t+"="].val.toString()||e.op==="!="&&this.filters[t+"="]!==void 0&&r==this.filters[t+"="].val.toString()||e.op==="="&&this.filters[t+"!="]!==void 0&&r===this.filters[t+"!="].val.toString()?e.toString()+" added to "+this.toString()+" produces an invalid filter":!1}add(e,t){var r=e.key.toString(),i=e.op,a=this.conflict(e),o;if(a)return a;if(i==="="){for(var s in this.filters)this.filters[s].key===r&&delete this.filters[s];this.filters[r+"="]=e}else if(i==="!=")this.filters[r+"!="+e.val]=e;else if(i==="=~")this.filters[r+"=~"+e.val]=e;else if(i===">"){for(var l in this.filters)this.filters[l].key===r&&this.filters[l].val<=e.val&&delete this.filters[l];this.filters[r+">"]=e}else if(i===">="){for(var u in this.filters)o=+this.filters[u].val.toString(),this.filters[u].key===r&&o",this.filters[r+">"]=e):this.filters[r+">="]=e}else if(i==="<"){for(var h in this.filters)o=+this.filters[h].val.toString(),this.filters[h].key===r&&o>=e.val&&delete this.filters[h];this.filters[r+"<"]=e}else if(i==="<="){for(var c in this.filters)o=+this.filters[c].val.toString(),this.filters[c].key===r&&o>e.val&&delete this.filters[c];this.filters[r+"!="+e.val]!==void 0?(delete this.filters[r+"!="+e.val],e.op="<",this.filters[r+"<"]=e):this.filters[r+"<="]=e}}};Pt.Tree.Fontset=class{constructor(e,t){this.fonts=t,this.name="fontset-"+e.effects.length}};Pt.Tree.Invalid=class{constructor(e,t,r){this.is="invalid",this.chunk=e,this.index=t,this.type="syntax",this.message=r||"Invalid code: "+this.chunk}ev(e){return e.error({chunk:this.chunk,index:this.index,type:"syntax",message:this.message||"Invalid code: "+this.chunk}),{is:"undefined"}}};Pt.Tree.Keyword=class{ev(){return this}constructor(e){this.value=e;var t={transparent:"color",true:"boolean",false:"boolean"};this.is=t[e]?t[e]:"keyword"}toString(){return this.value}};Pt.Tree.Literal=class{constructor(e){this.value=e||"",this.is="field"}toString(){return this.value}ev(){return this}};Pt.Tree.Operation=class{constructor(e,t,r){this.is="operation",this.op=e.trim(),this.operands=t,this.index=r}ev(e){var t=this.operands[0].ev(e),r=this.operands[1].ev(e),i;return t.is==="undefined"||r.is==="undefined"?{is:"undefined",value:"undefined"}:(t instanceof Pt.Tree.Dimension&&r instanceof Pt.Tree.Color&&(this.op==="*"||this.op==="+"?(i=r,r=t,t=i):e.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),t instanceof Pt.Tree.Quoted&&r instanceof Pt.Tree.Quoted&&this.op!=="+"?(e.error({message:"Can't subtract, divide, or multiply strings.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):t instanceof Pt.Tree.Field||r instanceof Pt.Tree.Field||t instanceof Pt.Tree.Literal||r instanceof Pt.Tree.Literal?t.is==="color"||r.is==="color"?(e.error({message:"Can't subtract, divide, or multiply colors in expressions.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):new Pt.Tree.Literal(t.ev(e).toString(!0)+this.op+r.ev(e).toString(!0)):t.operate===void 0?(e.error({message:"Cannot do math with type "+t.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):t.operate(e,this.op,r))}};Pt.Tree.Quoted=class{constructor(e){this.is="string",this.value=e||""}toString(e){var t=this.value.replace(/&/g,"&"),r=t.replace(/\'/g,"\\'").replace(/\"/g,""").replace(//g,">");return e===!0?"'"+r+"'":t}ev(){return this}operate(e,t,r){return new Pt.Tree.Quoted(Pt.Tree.operate(t,this.toString(),r.toString(this.contains_field)))}};Pt.Tree.Reference={_validateValue:{font:function(n,e){return n.validation_data&&n.validation_data.fonts?n.validation_data.fonts.indexOf(e)!=-1:!0}},setData:function(n){this.data=n,this.selector_cache=e(n),this.mapnikFunctions=t(n),this.required_cache=r(n);function e(i){var a={};for(var o in i.symbolizers)for(var s in i.symbolizers[o])i.symbolizers[o][s].hasOwnProperty("css")&&(a[i.symbolizers[o][s].css]=[i.symbolizers[o][s],o,s]);return a}function t(i){var a={};for(var o in i.symbolizers)for(var s in i.symbolizers[o])if(i.symbolizers[o][s].type==="functions")for(var l=0;l1?Array.prototype.push.apply(r,o.find(new Pt.Tree.Selector(null,null,e.elements.slice(1)),t)):r.push(o);break}}}),this._lookups[a]=r)}evZooms(e){for(var t=0;tPt.Tree.Zoom.maxZoom||t<0)&&e.error({message:"Only zoom levels between 0 and "+Pt.Tree.Zoom.maxZoom+" supported.",index:this.index}),this.op){case"=":return this.zoom="zoom && zoom === "+t,this;case">":this.zoom="zoom && zoom > "+t;break;case">=":this.zoom="zoom && zoom >= "+t;break;case"<":this.zoom="zoom && zoom < "+t;break;case"<=":this.zoom="zoom && zoom <= "+t;break}return this}toString(){for(var e="",t=0;t<=Pt.Tree.Zoom.maxZoom;t++)e+=this.zoom&1<3&&(t=Array.prototype.slice.call(t,1));for(var i=this._handlers[e],a=i.length,o=0;o4&&(t=Array.prototype.slice.call(t,1,t.length-1));for(var i=t[t.length-1],a=this._handlers[e],o=a.length,s=0;s"u"?Array:Float32Array,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Vector"}create(e,t){var r=this.ArrayCtor,i=new r(2);return i[0]=e||0,i[1]=t||0,i}copy(e,t){return e[0]=t[0],e[1]=t[1],e}set(e,t,r){return e[0]=t,e[1]=r,e}add(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}scaleAndAdd(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e}sub(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}len(e){return Math.sqrt(this.lenSquare(e))}lenSquare(e){return e[0]*e[0]+e[1]*e[1]}mul(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e}div(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e}dot(e,t){return e[0]*t[0]+e[1]*t[1]}scale(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}normalize(e,t){var r=this.len(t);return r===0?(e[0]=0,e[1]=0):(e[0]=t[0]/r,e[1]=t[1]/r),e}distance(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}distanceSquare(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}lerp(e,t,r,i){return e[0]=t[0]+i*(r[0]-t[0]),e[1]=t[1]+i*(r[1]-t[1]),e}applyTransform(e,t,r){var i=t[0],a=t[1];return e[0]=r[0]*i+r[2]*a+r[4],e[1]=r[1]*i+r[3]*a+r[5],e}min(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e}max(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e}length(e){return this.len(e)}lengthSquare(e){return this.lenSquare(e)}dist(e,t){return this.distance(e,t)}distSquare(e,t){return this.distanceSquare(e,t)}}class X8{constructor(){this.vector=new Zne,this.EPSILON=1e-4,this.THREE_SQRT=Math.sqrt(3),this.ONE_THIRD=1/3,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Curve"}isAroundZero(e){return e>-this.EPSILON&&ethis.EPSILON||e<-this.EPSILON}cubicAt(e,t,r,i,a){var o=1-a;return o*o*(o*e+3*a*t)+a*a*(a*i+3*o*r)}cubicDerivativeAt(e,t,r,i,a){var o=1-a;return 3*(((t-e)*o+2*(r-t)*a)*o+(i-r)*a*a)}cubicRootAt(e,t,r,i,a,o){var s=i+3*(t-r)-e,l=3*(r-t*2+e),u=3*(t-e),h=e-a,c=l*l-3*s*u,f=l*u-9*s*h,d=u*u-3*l*h,v=0;if(this.isAroundZero(c)&&this.isAroundZero(f))if(this.isAroundZero(l))o[0]=0;else{let S=-u/l;S>=0&&S<=1&&(o[v++]=S)}else{var p=f*f-4*c*d;if(this.isAroundZero(p)){var g=f/c;let S=-l/s+g,w=-g/2;S>=0&&S<=1&&(o[v++]=S),w>=0&&w<=1&&(o[v++]=w)}else if(p>0){let S=Math.sqrt(p),w=c*l+1.5*s*(-f+S),b=c*l+1.5*s*(-f-S);w<0?w=-Math.pow(-w,this.ONE_THIRD):w=Math.pow(w,this.ONE_THIRD),b<0?b=-Math.pow(-b,this.ONE_THIRD):b=Math.pow(b,this.ONE_THIRD);let E=(-l-(w+b))/(3*s);E>=0&&E<=1&&(o[v++]=E)}else{var m=(2*c*l-3*s*f)/(2*Math.sqrt(c*c*c)),y=Math.acos(m)/3,_=Math.sqrt(c),x=Math.cos(y);let S=(-l-2*_*x)/(3*s),w=(-l+_*(x+this.THREE_SQRT*Math.sin(y)))/(3*s),b=(-l+_*(x-this.THREE_SQRT*Math.sin(y)))/(3*s);S>=0&&S<=1&&(o[v++]=S),w>=0&&w<=1&&(o[v++]=w),b>=0&&b<=1&&(o[v++]=b)}}return v}cubicExtrema(e,t,r,i,a){var o=6*r-12*t+6*e,s=9*t+3*i-3*e-9*r,l=3*t-3*e,u=0;if(this.isAroundZero(s)){if(this.isNotAroundZero(o)){let c=-l/o;c>=0&&c<=1&&(a[u++]=c)}}else{var h=o*o-4*s*l;if(this.isAroundZero(h))a[0]=-o/(2*s);else if(h>0){let c=Math.sqrt(h),f=(-o+c)/(2*s),d=(-o-c)/(2*s);f>=0&&f<=1&&(a[u++]=f),d>=0&&d<=1&&(a[u++]=d)}}return u}cubicSubdivide(e,t,r,i,a,o){var s=(t-e)*a+e,l=(r-t)*a+t,u=(i-r)*a+r,h=(l-s)*a+s,c=(u-l)*a+l,f=(c-h)*a+h;o[0]=e,o[1]=s,o[2]=h,o[3]=f,o[4]=f,o[5]=c,o[6]=u,o[7]=i}cubicProjectPoint(e,t,r,i,a,o,s,l,u,h,c){var f=this.vector.create(),d=this.vector.create(),v=this.vector.create(),p,g=.005,m=1/0;f[0]=u,f[1]=h;for(let y=0;y<1;y+=.05){d[0]=this.cubicAt(e,r,a,s,y),d[1]=this.cubicAt(t,i,o,l,y);let _=this.vector.distSquare(f,d);_=0&&S=0&&h<=1&&(a[u++]=h)}}else{var c=s*s-4*o*l;if(this.isAroundZero(c)){let f=-s/(2*o);f>=0&&f<=1&&(a[u++]=f)}else if(c>0){let f=Math.sqrt(c),d=(-s+f)/(2*o),v=(-s-f)/(2*o);d>=0&&d<=1&&(a[u++]=d),v>=0&&v<=1&&(a[u++]=v)}}return u}quadraticExtremum(e,t,r){var i=e+r-2*t;return i===0?.5:(e-t)/i}quadraticProjectPoint(e,t,r,i,a,o,s,l,u){var h=this.vector.create(),c=this.vector.create(),f=this.vector.create(),d,v=.005,p=1/0;h[0]=s,h[1]=l;for(let g=0;g<1;g+=.05){c[0]=this.quadraticAt(e,r,a,g),c[1]=this.quadraticAt(t,i,o,g);let m=this.vector.distSquare(h,c);m=0&&_"u"?this.isInsideQuadraticStroke(t.xStart,t.yStart,t.cpX1,t.cpY1,t.xEnd,t.yEnd,t.lineWidth,r,i):this.isInsideCubicStroke(t.xStart,t.yStart,t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd,t.lineWidth,r,i);case"line":return this.isInsideLine(t.xStart,t.yStart,t.xEnd,t.yEnd,t.lineWidth,r,i);case"broken-line":return this.isInsideBrokenLine(t.pointList,t.lineWidth,r,i);case"smicbroken-line":{let p=r,g=i;return e.refOriginalPosition&&(p=r-e.refOriginalPosition[0],g=i-e.refOriginalPosition[1]),this.isInsideBrokenLine(t.pointList,t.lineWidth,p,g)}case"ring":return this.isInsideRing(t.x,t.y,t.r0,t.r,r,i);case"smicring":{let p=t.x,g=t.y;return e.refOriginalPosition&&(p=t.x+e.refOriginalPosition[0],g=t.y+e.refOriginalPosition[1]),this.isInsideRing(p,g,t.r0,t.r,r,i)}case"circle":return this.isInsideCircle(t.x,t.y,t.r,r,i);case"smicpoint":{let p=r,g=i;return e.refOriginalPosition&&(p=r-e.refOriginalPosition[0],g=i-e.refOriginalPosition[1]),this.isInsideCircle(t.x,t.y,t.r,p,g)}case"sector":{let p=t.startAngle*Math.PI/180,g=t.endAngle*Math.PI/180;return t.clockWise||(p=-p,g=-g),this.isInsideSector(t.x,t.y,t.r0,t.r,p,g,!t.clockWise,r,i)}case"smicsector":{let p=t.startAngle*Math.PI/180,g=t.endAngle*Math.PI/180;t.clockWise||(p=-p,g=-g);let m=t.x,y=t.y;return e.refOriginalPosition&&(m=t.x+e.refOriginalPosition[0],y=t.y+e.refOriginalPosition[1]),this.isInsideSector(m,y,t.r0,t.r,p,g,!t.clockWise,r,i)}case"path":return this.isInsidePath(t.pathArray,Math.max(t.lineWidth,5),t.brushType,r,i);case"polygon":case"star":case"smicstar":case"isogon":case"smicisogon":return this.isInsidePolygon(t.pointList,r,i);case"smicpolygon":{let p=r,g=i;if(e.refOriginalPosition&&(p=r-e.refOriginalPosition[0],g=i-e.refOriginalPosition[1]),e.holePolygonPointLists&&e.holePolygonPointLists.length>0){for(var o=this.isInsidePolygon(t.pointList,p,g),s=e.holePolygonPointLists,l=!1,u=0,h=s.length;ut+l&&s>i+l||se+l&&o>r+l||ot+f&&c>i+f&&c>o+f&&c>l+f||ce+f&&h>r+f&&h>a+f&&h>s+f||ht+h&&u>i+h&&u>o+h||ue+h&&l>r+h&&l>a+h||lr||f+c=h)return!0;if(o){var d=i;i=this.normalizeRadian(a),a=this.normalizeRadian(d)}else i=this.normalizeRadian(i),a=this.normalizeRadian(a);i>a&&(a+=h);var v=Math.atan2(u,l);return v<0&&(v+=h),v>=i&&v<=a||v+h>=i&&v+h<=a}isInsideBrokenLine(e,t,r,i){for(var a=Math.max(t,10),o=0,s=e.length-1;or*r}isInsideRect(e,t,r,i,a,o){return a>=e&&a<=e+r&&o>=t&&o<=t+i}isInsideCircle(e,t,r,i,a){return(i-e)*(i-e)+(a-t)*(a-t)t&&o>i||oa?s:0}swapExtrema(){var e=this.extrema[0];this.extrema[0]=this.extrema[1],this.extrema[1]=e}windingCubic(e,t,r,i,a,o,s,l,u,h){var c=this.curve,f=this.roots,d=this.extrema;if(h>t&&h>i&&h>o&&h>l||h1&&this.swapExtrema(),m=c.cubicAt(t,i,o,l,d[0]),g>1&&(y=c.cubicAt(t,i,o,l,d[1]))),g==2?xt&&l>i&&l>o||l=0&&f<=1){var d=0,v=u.quadraticAt(t,i,o,f);for(let p=0;ps||(h[p]s?0:or||l<-r)return 0;let c=Math.sqrt(r*r-l*l);if(u[0]=-c,u[1]=c,Math.abs(i-a)>=h){i=0,a=h;var f=o?1:-1;return s>=u[0]+e&&s<=u[1]+e?f:0}if(o){let p=i;i=this.normalizeRadian(a),a=this.normalizeRadian(p)}else i=this.normalizeRadian(i),a=this.normalizeRadian(a);i>a&&(a+=h);var d=0;for(let p=0;p<2;p++){var v=u[p];if(v+e>s){let g=Math.atan2(l,v),m=o?1:-1;g<0&&(g=h+g),(g>=i&&g<=a||g+h>=i&&g+h<=a)&&(g>Math.PI/2&&g0&&(v&&(o+=this.windingLine(s,l,u,h,i,a)),o!==0))return!0;u=m[m.length-2],h=m[m.length-1],c=!1,f&&g.command!=="A"&&(f=!1,s=u,l=h)}switch(g.command){case"M":s=m[0],l=m[1];break;case"L":if(d&&this.isInsideLine(s,l,m[0],m[1],t,i,a))return!0;v&&(o+=this.windingLine(s,l,m[0],m[1],i,a)),s=m[0],l=m[1];break;case"C":if(d&&this.isInsideCubicStroke(s,l,m[0],m[1],m[2],m[3],m[4],m[5],t,i,a))return!0;v&&(o+=this.windingCubic(s,l,m[0],m[1],m[2],m[3],m[4],m[5],i,a)),s=m[4],l=m[5];break;case"Q":if(d&&this.isInsideQuadraticStroke(s,l,m[0],m[1],m[2],m[3],t,i,a))return!0;v&&(o+=this.windingQuadratic(s,l,m[0],m[1],m[2],m[3],i,a)),s=m[2],l=m[3];break;case"A":var y=m[0],_=m[1],x=m[2],S=m[3],w=m[4],b=m[5],E=Math.cos(w)*x+y,T=Math.sin(w)*S+_;f?(f=!1,u=E,h=T):o+=this.windingLine(s,l,E,T);var C=(i-y)*S/x+y;if(d&&this.isInsideArcStroke(y,_,S,w,w+b,1-m[7],t,C,a))return!0;v&&(o+=this.windingArc(y,_,S,w,w+b,1-m[7],C,a)),s=Math.cos(w+b)*x+y,l=Math.sin(w+b)*S+_;break;case"z":if(d&&this.isInsideLine(s,l,u,h,t,i,a))return!0;c=!0;break}}return v&&(o+=this.windingLine(s,l,u,h,i,a)),o!==0}getTextWidth(e,t){var r=e+":"+t;if(this._textWidthCache[r])return this._textWidthCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t),e=(e+"").split(` `);for(var i=0,a=0,o=e.length;athis.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),i}getTextHeight(e,t){var r=e+":"+t;if(this._textHeightCache[r])return this._textHeightCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t),e=(e+"").split(` `);var i=(this._ctx.measureText("ZH").width+2)*e.length;return this._ctx.restore(),this._textHeightCache[r]=i,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),i}}class Ist{constructor(){arguments.length===3&&this.computeBoundingBox(arguments),this.CLASS_NAME="SuperMap.LevelRenderer.Tool.ComputeBoundingBox"}computeBoundingBox(e,t,r){if(e.length!==0){for(var i=e[0][0],a=e[0][0],o=e[0][1],s=e[0][1],l=1;la&&(a=u[0]),u[1]s&&(s=u[1])}t[0]=i,t[1]=o,r[0]=a,r[1]=s}}cubeBezier(e,t,r,i,a,o){var s=new X8,l=[];s.cubicExtrema(e[0],t[0],r[0],i[0],l);for(let v=0;va&&!o?a+=Math.PI*2:ii&&(f[0]=Math.cos(v)*r+e,f[1]=Math.sin(v)*r+t,u.min(s,f,s),u.max(l,f,l))}}class Lst{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Env";var e=this;function t(r){var i=e.os={},a=e.browser={},o=r.match(/Web[kK]it[\/]{0,1}([\d.]+)/),s=r.match(/(Android);?[\s\/]+([\d.]+)?/),l=r.match(/(iPad).*OS\s([\d_]+)/),u=r.match(/(iPod)(.*OS\s([\d_]+))?/),h=!l&&r.match(/(iPhone\sOS)\s([\d_]+)/),c=r.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=c&&r.match(/TouchPad/),d=r.match(/Kindle\/([\d.]+)/),v=r.match(/Silk\/([\d._]+)/),p=r.match(/(BlackBerry).*Version\/([\d.]+)/),g=r.match(/(BB10).*Version\/([\d.]+)/),m=r.match(/(RIM\sTablet\sOS)\s([\d.]+)/),y=r.match(/PlayBook/),_=r.match(/Chrome\/([\d.]+)/)||r.match(/CriOS\/([\d.]+)/),x=r.match(/Firefox\/([\d.]+)/),S=r.match(/MSIE ([\d.]+)/),w=o&&r.match(/Mobile\//)&&!_,b=r.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!_;return(a.webkit=!!o)&&(a.version=o[1]),s&&(i.android=!0,i.version=s[2]),h&&!u&&(i.ios=i.iphone=!0,i.version=h[2].replace(/_/g,".")),l&&(i.ios=i.ipad=!0,i.version=l[2].replace(/_/g,".")),u&&(i.ios=i.ipod=!0,i.version=u[3]?u[3].replace(/_/g,"."):null),c&&(i.webos=!0,i.version=c[2]),f&&(i.touchpad=!0),p&&(i.blackberry=!0,i.version=p[2]),g&&(i.bb10=!0,i.version=g[2]),m&&(i.rimtabletos=!0,i.version=m[2]),y&&(a.playbook=!0),d&&(i.kindle=!0,i.version=d[1]),v&&(a.silk=!0,a.version=v[1]),!v&&i.android&&r.match(/Kindle Fire/)&&(a.silk=!0),_&&(a.chrome=!0,a.version=_[1]),x&&(a.firefox=!0,a.version=x[1]),S&&(a.ie=!0,a.version=S[1]),w&&(r.match(/Safari/)||!!i.ios)&&(a.safari=!0),b&&(a.webview=!0),S&&(a.ie=!0,a.version=S[1]),i.tablet=!!(l||y||s&&!r.match(/Mobile/)||x&&r.match(/Tablet/)||S&&!r.match(/Phone/)&&r.match(/Touch/)),i.phone=!!(!i.tablet&&!i.ipod&&(s||h||c||p||g||_&&r.match(/Android/)||_&&r.match(/CriOS\/([\d.]+)/)||x&&r.match(/Mobile/)||S&&r.match(/Touch/))),{browser:a,os:i,canvasSupported:!!document.createElement("canvas").getContext}}return t(navigator.userAgent)}destory(){return!0}}class Pst{constructor(){this.stop=typeof window.addEventListener=="function"?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0},this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Event"}getX(e){return typeof e.zrenderX<"u"&&e.zrenderX||typeof e.offsetX<"u"&&e.offsetX||typeof e.layerX<"u"&&e.layerX||typeof e.clientX<"u"&&e.clientX}getY(e){return typeof e.zrenderY<"u"&&e.zrenderY||typeof e.offsetY<"u"&&e.offsetY||typeof e.layerY<"u"&&e.layerY||typeof e.clientY<"u"&&e.clientY}getDelta(e){return typeof e.zrenderDelta<"u"&&e.zrenderDelta||typeof e.wheelDelta<"u"&&e.wheelDelta||typeof e.detail<"u"&&-e.detail}}class Ost{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Http"}get(e,t,r){if(typeof e=="object"){var i=e;e=i.url,t=i.onsuccess,r=i.onerror}var a=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");a.open("GET",e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status>=200&&a.status<300||a.status===304?t&&t(a.responseText):r&&r(),a.onreadystatechange=new Function,a=null)},a.send(null)}}class ds{}ds.EVENT={RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300};ds.catchBrushException=!1;ds.debugMode=0;class Rst{constructor(){return this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Log",function(){if(+ds.debugMode!=0){if(+ds.debugMode==1)for(let e in arguments)throw new Error(arguments[e]);else if(+ds.debugMode>1)for(let e in arguments)console.log(arguments[e])}}}destory(){return!0}}class Dst{constructor(){this._radians=window.Math.PI/180,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Math"}sin(e,t){return window.Math.sin(t?e*this._radians:e)}cos(e,t){return window.Math.cos(t?e*this._radians:e)}degreeToRadian(e){return e*this._radians}radianToDegree(e){return e/this._radians}}class Nst{constructor(){this.ArrayCtor=typeof Float32Array>"u"?Array:Float32Array,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Matrix"}create(){var e=this.ArrayCtor,t=new e(6);return this.identity(t),t}identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}mul(e,t,r){return e[0]=t[0]*r[0]+t[2]*r[1],e[1]=t[1]*r[0]+t[3]*r[1],e[2]=t[0]*r[2]+t[2]*r[3],e[3]=t[1]*r[2]+t[3]*r[3],e[4]=t[0]*r[4]+t[2]*r[5]+t[4],e[5]=t[1]*r[4]+t[3]*r[5]+t[5],e}translate(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}rotate(e,t,r){var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],h=Math.sin(r),c=Math.cos(r);return e[0]=i*c+s*h,e[1]=-i*h+s*c,e[2]=a*c+l*h,e[3]=-a*h+c*l,e[4]=c*o+h*u,e[5]=c*u-h*o,e}scale(e,t,r){var i=r[0],a=r[1];return e[0]=t[0]*i,e[1]=t[1]*a,e[2]=t[2]*i,e[3]=t[3]*a,e[4]=t[4]*i,e[5]=t[5]*a,e}invert(e,t){var r=t[0],i=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=r*s-o*i;return u?(u=1/u,e[0]=s*u,e[1]=-o*u,e[2]=-i*u,e[3]=r*u,e[4]=(i*l-s*a)*u,e[5]=(o*a-r*l)*u,e):null}mulVector(e,t,r){var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5];return e[0]=r[0]*i+r[1]*a+o,e[1]=r[0]*s+r[1]*l+u,e}}class cr{static SUtil_smoothBezier(e,t,r,i,a){(!a||a.length!==2)&&(a=[0,0]);var o=a,s=[],l=[],u=[],h=[],c=!!i,f,d;if(c){f=[1/0,1/0],d=[-1/0,-1/0];let p=e.length;for(let g=0;go-2?o-1:d+1][0]+a[0],e[d>o-2?o-1:d+1][1]+a[1]],y=[e[d>o-3?o-1:d+2][0]+a[0],e[d>o-3?o-1:d+2][1]+a[1]]);let _=v*v,x=v*_;s.push([h(p[0],g[0],m[0],y[0],v,_,x),h(p[1],g[1],m[1],y[1],v,_,x)])}return s;function h(c,f,d,v,p,g,m){var y=(d-c)*.5,_=(v-f)*.5;return(2*(f-d)+y+_)*m+(-3*(f-d)-2*y-_)*g+y*p+f}}static SUtil_dashedLineTo(e,t,r,i,a,o,s){var l=[5,5];if(o=typeof o!="number"?5:o,e.setLineDash){l[0]=o,l[1]=o,s&&s instanceof Array?e.setLineDash(s):e.setLineDash(l),e.moveTo(t,r),e.lineTo(i,a);return}var u=i-t,h=a-r,c=Math.floor(Math.sqrt(u*u+h*h)/o);u=u/c,h=h/c;for(var f=!0,d=0;d-o&&ar||t<-r}}updateTransform(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,!this.needTransform)return;var e=[0,0],t=this.transform||cr.Util_matrix.create();if(cr.Util_matrix.identity(t),this.needLocalTransform){if(r(this.scale[0])||r(this.scale[1])){e[0]=-this.scale[2]||0,e[1]=-this.scale[3]||0;let i=r(e[0])||r(e[1]);i&&cr.Util_matrix.translate(t,t,e),cr.Util_matrix.scale(t,t,this.scale),i&&(e[0]=-e[0],e[1]=-e[1],cr.Util_matrix.translate(t,t,e))}if(this.rotation instanceof Array){if(this.rotation[0]!==0){e[0]=-this.rotation[1]||0,e[1]=-this.rotation[2]||0;let i=r(e[0])||r(e[1]);i&&cr.Util_matrix.translate(t,t,e),cr.Util_matrix.rotate(t,t,this.rotation[0]),i&&(e[0]=-e[0],e[1]=-e[1],cr.Util_matrix.translate(t,t,e))}}else+this.rotation!=0&&cr.Util_matrix.rotate(t,t,this.rotation);(r(this.position[0])||r(this.position[1]))&&cr.Util_matrix.translate(t,t,this.position)}this.transform=t,this.parent&&this.parent.needTransform&&(this.needLocalTransform?cr.Util_matrix.mul(this.transform,this.parent.transform,this.transform):cr.Util_matrix.copy(this.transform,this.parent.transform));function r(i){var a=5e-5;return i>a||i<-a}}setTransform(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}decomposeTransform(){if(!this.transform)return;var e=this.transform,t=e[0]*e[0]+e[1]*e[1],r=this.position,i=this.scale,a=this.rotation;s(t-1)&&(t=Math.sqrt(t));var o=e[2]*e[2]+e[3]*e[3];s(o-1)&&(o=Math.sqrt(o)),r[0]=e[4],r[1]=e[5],i[0]=t,i[1]=o,i[2]=i[3]=0,a[0]=Math.atan2(-e[1]/o,e[0]/t),a[1]=a[2]=0;function s(l){var u=5e-5;return l>u||l<-u}}}class m0 extends Cne(JR,Y8){constructor(e){super(e),e=e||{},this.id=null,this.style={},this.highlightStyle=null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],this.invisible=!1,this.ignore=!1,this.zlevel=0,this.draggable=!1,this.clickable=!1,this.hoverable=!0,this.z=0,this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,H.extend(this,e),this.id=this.id||H.createUniqueID("smShape_"),this.CLASS_NAME="SuperMap.LevelRenderer.Shape",this.getTansform=function(){var t=[];return function(r,i){var a=[r,i];return this.needTransform&&this.transform&&(cr.Util_matrix.invert(t,this.transform),cr.Util_matrix.mulVector(a,t,[r,i,1]),r==a[0]&&i==a[1]&&this.updateNeedTransform()),a}}()}destroy(){this.id=null,this.style=null,this.highlightStyle=null,this.parent=null,this.__dirty=null,this.__clipShapes=null,this.invisible=null,this.ignore=null,this.zlevel=null,this.draggable=null,this.clickable=null,this.hoverable=null,this.z=null,this.refOriginalPosition=null,this.refDataID=null,this.refDataHoverGroup=null,this.isHoverByRefDataID=null,this.dataInfo=null,super.destroy()}brush(e,t){var r=this.beforeBrush(e,t);switch(e.beginPath(),this.buildPath(e,r),r.brushType){case"both":this.setCtxGlobalAlpha(e,"fill",r),e.fill(),r.lineWidth>0&&(this.setCtxGlobalAlpha(e,"stroke",r),e.stroke()),this.setCtxGlobalAlpha(e,"reset",r);break;case"stroke":this.setCtxGlobalAlpha(e,"stroke",r),r.lineWidth>0&&e.stroke(),this.setCtxGlobalAlpha(e,"reset",r);break;default:this.setCtxGlobalAlpha(e,"fill",r),e.fill(),this.setCtxGlobalAlpha(e,"reset",r);break}this.drawText(e,r,this.style),this.afterBrush(e)}beforeBrush(e,t){var r=this.style;return this.brushTypeOnly&&(r.brushType=this.brushTypeOnly),t&&(r=this.getHighlightStyle(r,this.highlightStyle||{},this.brushTypeOnly)),this.brushTypeOnly=="stroke"&&(r.strokeColor=r.strokeColor||r.color),e.save(),this.doClip(e),this.setContext(e,r),this.setTransform(e),r}afterBrush(e){e.restore()}setContext(e,t){for(var r=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],i=0,a=r.length;i=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?cr.Util_area.isInside(this,this.style,e,t):!1}drawText(e,t,r){if(!(typeof t.text>"u"||t.text===!1)){var i=t.textColor||t.color||t.strokeColor;e.fillStyle=i;var a=10,o,s,l,u,h=t.textPosition||this.textPosition||"top",c=[];switch(!this.refOriginalPosition||this.refOriginalPosition.length!==2?c=[0,0]:c=this.refOriginalPosition,h){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var f=(r||t).__rect||this.getRect(r||t);switch(h){case"inside":l=f.x+f.width/2,u=f.y+f.height/2,o="center",s="middle",t.brushType!="stroke"&&i==t.color&&(e.fillStyle="#fff");break;case"left":l=f.x-a,u=f.y+f.height/2,o="end",s="middle";break;case"right":l=f.x+f.width+a,u=f.y+f.height/2,o="start",s="middle";break;case"top":l=f.x+f.width/2,u=f.y-a,o="center",s="bottom";break;case"bottom":l=f.x+f.width/2,u=f.y+f.height+a,o="center",s="top";break}}break;case"start":case"end":var d=0,v=0,p=0,g=0;if(typeof t.pointList<"u"){var m=t.pointList;if(m.length<2)return;var y=m.length;switch(h){case"start":d=m[0][0]+c[0],v=m[1][0]+c[0],p=m[0][1]+c[1],g=m[1][1]+c[1];break;case"end":d=m[y-2][0]+c[0],v=m[y-1][0]+c[0],p=m[y-2][1]+c[1],g=m[y-1][1]+c[1];break}}else d=t.xStart+c[0]||0,v=t.xEnd+c[0]||0,p=t.yStart+c[1]||0,g=t.yEnd+c[1]||0;switch(h){case"start":o=d"u"?typeof r.opacity>"u"?1:r.opacity:r.fillOpacity:t==="stroke"?e.globalAlpha=typeof r.strokeOpacity>"u"?typeof r.opacity>"u"?1:r.opacity:r.strokeOpacity:e.globalAlpha=typeof r.opacity>"u"?1:r.opacity}static _fillText(e,t,r,i,a,o,s){a&&(e.font=a),e.textAlign=o,e.textBaseline=s;var l=m0._getTextRect(t,r,i,a,o,s);t=(t+"").split(` `);var u=cr.Util_area.getTextHeight("ZH",a);switch(s){case"top":i=l.y;break;case"bottom":i=l.y+u;break;default:i=l.y+u/2}for(var h=0,c=t.length;h"u"||i.text===!1)){e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var a=(i.text+"").split(` `),o=cr.Util_area.getTextHeight("ZH",i.textFont),s=this.getRectNoRotation(i),l=i.x+r[0],u;i.textBaseline=="top"?u=s.y:i.textBaseline=="bottom"?u=s.y+o:u=s.y+o/2;for(var h=i.x+r[0],c=i.y+r[1],f=0,d=a.length;fi&&(i=u[0]),u[1]a&&(a=u[1]))}return e.__rect={x:t,y:r,width:i-t,height:a-r},e.__rect}getRectNoRotation(e){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition,r=cr.Util_area.getTextHeight("ZH",e.textFont),i=cr.Util_area.getTextWidth(e.text,e.textFont),a=cr.Util_area.getTextHeight(e.text,e.textFont),o=e.x+t[0];e.textAlign=="end"||e.textAlign=="right"?o-=i:e.textAlign=="center"&&(o-=i/2);var s;e.textBaseline=="top"?s=e.y+t[1]:e.textBaseline=="bottom"?s=e.y+t[1]-a:s=e.y+t[1]-a/2;var l=!1,u;if(e.maxWidth){var h=parseInt(e.maxWidth);h-1&&(l===!0?i+=r/3*(i/u):i+=r/3)}var d={x:o,y:s,width:i,height:a};return d}getTextBackground(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;if(!t&&e.__textBackground)return e.__textBackground;var i=this.getRectNoRotation(e),a=e.x+r[0],o=e.y+r[1],s=[];if(e.textRotation&&e.textRotation!==0){let l=e.textRotation,u=this.getRotatedLocation(i.x,i.y,a,o,l),h=this.getRotatedLocation(i.x+i.width,i.y,a,o,l),c=this.getRotatedLocation(i.x+i.width,i.y+i.height,a,o,l),f=this.getRotatedLocation(i.x,i.y+i.height,a,o,l);s.push(u),s.push(h),s.push(c),s.push(f)}else{let l=[i.x,i.y],u=[i.x+i.width,i.y],h=[i.x+i.width,i.y+i.height],c=[i.x,i.y+i.height];s.push(l),s.push(u),s.push(h),s.push(c)}return e.__textBackground=s,e.__textBackground}getRotatedLocation(e,t,r,i,a){var o=new Array,s,l;return t=-t,i=-i,a=-a,s=(e-r)*Math.cos(a/180*Math.PI)-(t-i)*Math.sin(a/180*Math.PI)+r,l=(e-r)*Math.sin(a/180*Math.PI)+(t-i)*Math.cos(a/180*Math.PI)+i,o[0]=s,o[1]=-l,o}}class kst extends m0{constructor(e){super(e),this.type="smiccircle",(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicCircle"}destroy(){this.type=null,super.destroy()}buildPath(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,i=t.x+r[0],a=t.y+r[1];return e.moveTo(i+t.r,a),e.arc(i,a,t.r,0,Math.PI*2,!0),!0}getRect(e){if(e.__rect)return e.__rect;(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition,r=e.x+t[0],i=e.y+t[1],a=e.r,o;return e.brushType=="stroke"||e.brushType=="fill"?o=e.lineWidth||1:o=0,e.__rect={x:Math.round(r-a-o/2),y:Math.round(i-a-o/2),width:a*2+o,height:a*2+o},e.__rect}}class Kne extends m0{constructor(e){super(e),this.type="smicpolygon",this.holePolygonPointLists=null,(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicPolygon"}destroy(){this.type=null,this.holePolygonPointLists=null,super.destroy()}brush(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.style;t&&(r=this.getHighlightStyle(r,this.highlightStyle||{})),e.save(),this.setContext(e,r),this.setTransform(e);var i=!1;(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType>"u")&&(e.beginPath(),r.lineType=="dashed"||r.lineType=="dotted"||r.lineType=="dot"||r.lineType=="dash"||r.lineType=="dashdot"||r.lineType=="longdash"||r.lineType=="longdashdot"?this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}):(this.buildPath(e,r),i=!0),e.closePath(),this.setCtxGlobalAlpha(e,"fill",r),e.fill(),this.setCtxGlobalAlpha(e,"reset",r)),r.lineWidth>0&&(r.brushType=="stroke"||r.brushType=="both")&&(i||(e.beginPath(),this.buildPath(e,r)),this.setCtxGlobalAlpha(e,"stroke",r),e.stroke(),this.setCtxGlobalAlpha(e,"reset",r)),this.drawText(e,r,this.style);var a=H.cloneObject(r);if(a.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var o=this.holePolygonPointLists,s=o.length,l=0;l"u")&&(e.beginPath(),a.lineType=="dashed"||a.lineType=="dotted"||a.lineType=="dot"||a.lineType=="dash"||a.lineType=="dashdot"||a.lineType=="longdash"||a.lineType=="longdashdot"?this.buildPath(e,{lineType:"solid",lineWidth:a.lineWidth,pointList:a.pointList}):(this.buildPath(e,a),i=!0),e.closePath(),this.setCtxGlobalAlpha(e,"fill",a),e.fill(),this.setCtxGlobalAlpha(e,"reset",a)),a.lineWidth>0&&(a.brushType=="stroke"||a.brushType=="both")?(i||(e.beginPath(),this.buildPath(e,a)),e.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(e,"stroke",a),e.stroke(),this.setCtxGlobalAlpha(e,"reset",a)):e.globalCompositeOperation="source-over"}e.restore()}buildPath(e,t){t.showShadow&&(e.shadowBlur=t.shadowBlur,e.shadowColor=t.shadowColor,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY),(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,i=t.pointList;if(!(i.length<2)){if(t.smooth&&t.smooth!=="spline"){var a=cr.SUtil_smoothBezier(i,t.smooth,!0,t.smoothConstraint,r);e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(var o,s,l,u=i.length,h=0;ha&&(a=l[u][0]+r[0]),l[u][1]+r[1]s&&(s=l[u][1]+r[1]);var c;return e.brushType=="stroke"||e.brushType=="fill"?c=e.lineWidth||1:c=0,e.__rect={x:Math.round(i-c/2),y:Math.round(o-c/2),width:a-i+c,height:s-o+c},e.__rect}}class BNe extends m0{constructor(e){super(e),this.brushTypeOnly="stroke",this.textPosition="end",this.type="smicbroken-line",(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicBrokenLine"}destroy(){this.brushTypeOnly=null,this.textPosition=null,this.type=null,super.destroy()}buildPath(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,i=t.pointList;if(!(i.length<2)){var a=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&t.smooth!=="spline"){var o=cr.SUtil_smoothBezier(i,t.smooth,!1,t.smoothConstraint,r);e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);var s,l,u;for(let c=0;co&&(d=u+h,u*=o/d,h*=o/d),c+f>o&&(d=c+f,c*=o/d,f*=o/d),h+c>s&&(d=h+c,h*=s/d,c*=s/d),u+f>s&&(d=u+f,u*=s/d,f*=s/d),e.moveTo(i+u,a),e.lineTo(i+o-h,a),h!==0&&e.quadraticCurveTo(i+o,a,i+o,a+h),e.lineTo(i+o,a+s-c),c!==0&&e.quadraticCurveTo(i+o,a+s,i+o-c,a+s),e.lineTo(i+f,a+s),f!==0&&e.quadraticCurveTo(i,a+s,i,a+s-f),e.lineTo(i,a+u),u!==0&&e.quadraticCurveTo(i,a,i+u,a)}buildPath(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x+r[0],t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1])),e.closePath()}getRect(e){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition;if(e.__rect)return e.__rect;var r;return e.brushType=="stroke"||e.brushType=="fill"?r=e.lineWidth||1:r=0,e.__rect={x:Math.round(e.x+t[0]-r/2),y:Math.round(e.y+t[1]-r/2),width:e.width+r,height:e.height+r},e.__rect}}class Fst extends m0{constructor(e){super(e),this.type="smicsector",(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicSector"}destroy(){this.type=null,super.destroy()}buildPath(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,i=t.x+r[0],a=t.y+r[1],o=t.r0||0,s=t.r,l=t.startAngle,u=t.endAngle,h=t.clockWise||!1;l=cr.Util_math.degreeToRadian(l),u=cr.Util_math.degreeToRadian(u),h||(l=-l,u=-u);var c=cr.Util_math.cos(l),f=cr.Util_math.sin(l);e.moveTo(c*o+i,f*o+a),e.lineTo(c*s+i,f*s+a),e.arc(i,a,s,l,u,!h),e.lineTo(cr.Util_math.cos(u)*o+i,cr.Util_math.sin(u)*o+a),o!==0&&e.arc(i,a,o,u,l,h),e.closePath()}getRect(e){if(e.__rect)return e.__rect;(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition,r=cr.Util_vector.create(),i=cr.Util_vector.create(),a=cr.Util_vector.create(),o=cr.Util_vector.create(),s=e.x+t[0],l=e.y+t[1],u=e.r0||0,h=e.r,c=cr.Util_math.degreeToRadian(e.startAngle),f=cr.Util_math.degreeToRadian(e.endAngle),d=e.clockWise;return d||(c=-c,f=-f),u>1?cr.Util_computeBoundingBox.arc(s,l,u,c,f,!d,r,a):(r[0]=a[0]=s,r[1]=a[1]=l),cr.Util_computeBoundingBox.arc(s,l,h,c,f,!d,i,o),cr.Util_vector.min(r,r,i),cr.Util_vector.max(a,a,o),e.__rect={x:r[0],y:r[1],width:a[0]-r[0],height:a[1]-r[1]},e.__rect}}class Vn{constructor(e){this.shapeParameters=e,this.CLASS_NAME="SuperMap.Feature.ShapeFactory"}destroy(){this.shapeParameters=null}createShape(e){if(e&&(this.shapeParameters=e),!this.shapeParameters)return null;var t=this.shapeParameters;if(t instanceof Fz){let r=new Object;r.x=t.x,r.y=t.y,r.r=t.r,r=H.copyAttributesWithClip(r,t.style,["x","y"]);let i=new LK;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","style","highlightStyle"]),i}else if(t instanceof VO){if(!t.pointList)return null;let r=new Object;r.pointList=t.pointList,r=H.copyAttributesWithClip(r,t.style,["pointList"]);let i=new BNe;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["pointList","style","highlightStyle"]),i}else if(t instanceof I1){if(!t.pointList)return null;let r=new Object;r.pointList=t.pointList,r=H.copyAttributesWithClip(r,t.style,["pointList"]);let i=new Kne;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["pointList","style","highlightStyle"]),i}else if(t instanceof IK){if(!t.x&&!t.y&!t.width&!t.height)return null;let r=new Object;r.x=t.x,r.y=t.y,r.width=t.width,r.height=t.height,r=H.copyAttributesWithClip(r,t.style,["x","y","width","height"]);let i=new GNe;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","width","height","style","highlightStyle"]),i}else if(t instanceof Bz){let r=new Object;r.x=t.x,r.y=t.y,r.r=t.r,r.startAngle=t.startAngle,r.endAngle=t.endAngle,t.r0&&(r.r0=t.r0),t.clockWise&&(r.clockWise=t.clockWise),r=H.copyAttributesWithClip(r,t.style,["x","y","r","startAngle","endAngle","r0","endAngle"]);let i=new Fst;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","r","startAngle","endAngle","r0","endAngle","style","highlightStyle"]),i}else if(t instanceof Ib){let r=new Object;r.x=t.x,r.y=t.y,r.text=t.text,r=H.copyAttributesWithClip(r,t.style,["x","y","text"]);let i=new FNe;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","text","style","highlightStyle"]),i}else if(t instanceof kNe){let r=new Object;r.x=t.x,r.y=t.y,t.image&&(r.image=t.image),t.width&&(r.width=t.width),t.height&&(r.height=t.height),t.sx&&(r.sx=t.sx),t.sy&&(r.sy=t.sy),t.sWidth&&(r.sWidth=t.sWidth),t.sHeight&&(r.sHeight=t.sHeight),r=H.copyAttributesWithClip(r,t.style,["x","y","image","width","height","sx","sy","sWidth","sHeight"]);let i=new My;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","image","width","height","style","highlightStyle"]),i}else if(t instanceof qne){let r=new Object;r.x=t.x,r.r=t.r,r.y=t.y,r=H.copyAttributesWithClip(r,t.style,["x","y","r"]);let i=new kst;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","r","style","highlightStyle","lineWidth","text","textPosition"]),i}return null}static transformStyle(e){var t={},r=["normal","normal","normal","12","arial,sans-serif"],i=[!0,!1];for(var a in e)switch(a){case"fill":i[0]=e[a];break;case"fillColor":t.color=e[a];break;case"stroke":i[1]=e[a];break;case"strokeWidth":t.lineWidth=e[a];break;case"strokeLinecap":t.lineCap=e[a];break;case"strokeLineJoin":t.lineJoin=e[a];break;case"strokeDashstyle":t.lineType=e[a];break;case"pointRadius":t.r=e[a];break;case"label":t.text=e[a];break;case"labelRect":t.labelRect=e[a];break;case"fontColor":t.textColor=e[a];break;case"fontStyle":r[0]=e[a];break;case"fontVariant":r[1]=e[a];break;case"fontWeight":r[2]=e[a];break;case"fontSize":var o="";e[a]&&e[a].toString().indexOf("px")<0&&(o="px"),r[3]=e[a]+o;break;case"fontFamily":r[4]=e[a];break;case"fontOpacity":t.opacity=e[a];break;case"labelPosition":t.textPosition=e[a];break;case"labelAlign":t.textAlign=e[a];break;case"labelBaseline":t.textBaseline=e[a];break;case"labelRotation":t.textRotation=e[a];break;default:t[a]=e[a];break}return t.textFont=r.join(" "),i[0]===!0&&i[1]===!1?t.brushType="fill":i[0]===!1&&i[1]===!0?t.brushType="stroke":i[0]===!0&&i[1]===!0?t.brushType="both":t.brushType="fill",t.lineWidth==null&&(t.lineWidth=1),t}static Background(e,t,r){var i=r||{},a=new IK(t[0],t[3],Math.abs(t[2]-t[0]),Math.abs(t[3]-t[1]));return a.style={fillColor:"#f3f3f3"},i.backgroundStyle&&H.copyAttributesWithClip(a.style,i.backgroundStyle),i.backgroundRadius&&(a.style.radius=i.backgroundRadius),a.clickable=!1,a.hoverable=!1,e.createShape(a)}static GraphAxis(e,t,r,i){var a=t,o=r||{},s=[],l=[],u=o.useXReferenceLine?o.useXReferenceLine:!1,h=o.axisYTick&&!isNaN(o.axisYTick)?o.axisYTick:0,c=[],f=[],d=[];if(h==0){if(d.push([a[0],a[3]-5]),d.push([a[0],a[1]]),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){let D=parseInt(o.axis3DParameter),G=[a[0]-D,a[1]+D];o.axisUseArrow?(f.push([G[0]+1.5,G[1]-7.5]),f.push([G[0]-1,G[1]+1]),f.push([G[0]+7.5,G[1]-1.5]),d.push([G[0],G[1]])):d.push([G[0],G[1]]),d.push([a[0],a[1]])}d.push([a[2]+5,a[1]])}else{var v=Math.abs(a[1]-a[3])/h,p=a[3];d.push([a[0],p-5]);for(var g=0;g=15){let D=parseInt(o.axis3DParameter),G=[a[0]-D,a[1]+D];o.axisUseArrow?(f.push([G[0]+1.5,G[1]-7.5]),f.push([G[0]-1,G[1]+1]),f.push([G[0]+7.5,G[1]-1.5]),d.push([G[0],G[1]])):d.push([G[0],G[1]]),d.push([a[0],a[1]])}d.push([a[2]+5,a[1]])}if(o.axisUseArrow){var y=[[a[2]+5,a[1]+4],[a[2]+13,a[1]],[a[2]+5,a[1]-4]],_=[[a[0]-4,a[3]-5],[a[0],a[3]-13],[a[0]+4,a[3]-5]],x=new I1(y);x.style={fillColor:"#008acd"},H.copyAttributesWithClip(x.style,o.axisStyle),l.push(e.createShape(x));var S=new I1(_);if(S.style={fillColor:"#008acd"},H.copyAttributesWithClip(S.style,o.axisStyle),l.push(e.createShape(S)),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){var w=new I1(f);w.style={fillColor:"#008acd"},H.copyAttributesWithClip(w.style,o.axisStyle),l.push(e.createShape(w))}}c=d;var b=new VO(c);b.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},o.axisStyle&&H.copyAttributesWithClip(b.style,o.axisStyle),b.clickable=!1,b.hoverable=!1;var E=[e.createShape(b)],T=[];if(o.axisYLabels&&o.axisYLabels.length&&o.axisYLabels.length>0){var C=o.axisYLabels;let D=C.length;var A=[0,0];if(o.axisYLabelsOffset&&o.axisYLabelsOffset.length&&(A=o.axisYLabelsOffset),D==1){let G=new Ib(a[0]-5+A[0],a[3]+A[1],C[0]);G.style={labelAlign:"right"},o.axisYLabelsStyle&&H.copyAttributesWithClip(G.style,o.axisYLabelsStyle),G.clickable=!1,G.hoverable=!1,T.push(e.createShape(G))}else for(var M=a[3],I=Math.abs(a[1]-a[3])/(D-1),R=0;R0){let D=o.axisXLabels,G=D.length,W=[0,0];if(o.axisXLabelsOffset&&o.axisXLabelsOffset.length&&(W=o.axisXLabelsOffset),i&&i.xPositions&&i.xPositions.length&&i.xPositions.length==G){let z=i.xPositions;for(let V=0;V=0&&r[a]&&H.copyAttributesWithClip(s,r[a]),i&&i.length&&typeof o<"u"){for(var l=i,u=l.length,h=parseFloat(o),c=0;c=c[2]||c[1]<=c[3]?!1:(this.DVBOrigonPoint=[c[0],c[3]],this.DVBWidth=Math.abs(c[2]-c[0]),this.DVBHeight=Math.abs(c[1]-c[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-l[0],this.DVBOrigonPoint[1]-l[1]],e)}resetLocation(e){e&&(this.lonlat=e);var t=this.getLocalXY(this.lonlat);t[0]+=this.XOffset,t[1]+=this.YOffset,this.location=t;var r=this.width,i=this.height,a=this.location;return this.chartBounds=new po(a[0]-r/2,a[1]+i/2,a[0]+r/2,a[1]-i/2),this.resetLinearGradient(),a}resetLinearGradient(){}shapesConvertToRelativeCoordinate(){for(var e=this.shapes,t=this.location,r=0,i=e.length;r=0?r.push(parseFloat(i[o].toString()).toFixed(t)):r.push(parseFloat(i[o].toString()))}catch{throw new Error("not a number")}return r.length===e.length?r:!1};class Bst extends mw{constructor(e,t,r,i,a){super(e,t,r,i,a),this.CLASS_NAME="SuperMap.Feature.Theme.Bar"}destroy(){super.destroy()}assembleShapes(){var e=[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]],t={showShadow:!0,shadowBlur:8,shadowColor:"rgba(100,100,100,0.8)",shadowOffsetX:2,shadowOffsetY:2},r=this.setting;if(r.barLinearGradient||(r.barLinearGradient=e),r.dataViewBoxParameter||(typeof r.useAxis>"u"||r.useAxis?r.dataViewBoxParameter=[45,15,15,15]:r.dataViewBoxParameter=[5,5,5,5]),!!this.initBaseParameter()){var i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var a=this.dataViewBox,o=this.dataValues;if(!(o.length<1)){for(let p=0,g=o.length;pi[1])return;var s=this.calculateXShapeInfo();if(!!s){var l=s.xPositions,u=s.width;(typeof r.useBackground>"u"||r.useBackground)&&this.shapes.push(Vn.Background(this.shapeFactory,this.chartBox,r)),(typeof r.useAxis>"u"||r.useAxis)&&(this.shapes=this.shapes.concat(Vn.GraphAxis(this.shapeFactory,a,r,s)));for(var h=0;h"u"||r.showShadow){if(r.barShadowStyle){var v=r.barShadowStyle;v.shadowBlur&&(t.shadowBlur=v.shadowBlur),v.shadowColor&&(t.shadowColor=v.shadowColor),v.shadowOffsetX&&(t.shadowOffsetX=v.shadowOffsetX),v.shadowOffsetY&&(t.shadowOffsetY=v.shadowOffsetY)}d.style={},H.copyAttributesWithClip(d.style,t)}d.refDataID=this.data.id,d.dataInfo={field:this.fields[h],value:o[h]},typeof r.barHoverAble<"u"&&(d.hoverable=r.barHoverAble),typeof r.barClickAble<"u"&&(d.clickable=r.barClickAble),this.shapes.push(this.shapeFactory.createShape(d))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e=this.dataViewBox,t=this.setting,r=this.dataValues.length;if(r<1)return null;var i,a=[],o=0,s=this.DVBWidth;if(t.xShapeBlank&&t.xShapeBlank.length&&t.xShapeBlank.length==3){i=t.xShapeBlank;var l=s-(i[0]+i[2]+(r-1)*i[1]);if(l<=r)return null;o=l/r}else o=s/(2*r+1),i=[o,o,o];for(var u=0,h=0;h=t.length&&(r=r%t.length);var u=t[r][0],h=t[r][1],c=new SE,f=c.getLinearGradient(s,0,l,0,[[0,u],[1,h]]);a.style.color=f}}}}class Gst extends mw{constructor(e,t,r,i,a){super(e,t,r,i,a),this.CLASS_NAME="SuperMap.Feature.Theme.Bar3D"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(typeof e.useAxis>"u"||e.useAxis?e.dataViewBoxParameter=[45,25,20,20]:e.dataViewBoxParameter=[5,5,5,5]),e.axisUseArrow=typeof e.axisUseArrow<"u"?e.axisUseArrow:!0,e.axisXLabelsOffset=typeof e.axisXLabelsOffset<"u"?e.axisXLabelsOffset:[-10,10],!!this.initBaseParameter()){var t=this.DVBCodomain;this.DVBUnitValue=(t[1]-t[0])/this.DVBHeight;var r=this.dataViewBox,i=this.dataValues;if(!(i.length<1)){for(let y=0,_=i.length;y<_;y++)if(i[y]t[1])return;var a=this.calculateXShapeInfo();if(!!a){var o=a.xPositions,s=a.width;(typeof e.useBackground>"u"||e.useBackground)&&this.shapes.push(Vn.Background(this.shapeFactory,this.chartBox,e)),(!e.axis3DParameter||isNaN(e.axis3DParameter)||e.axis3DParameter<15)&&(e.axis3DParameter=20),(typeof e.useAxis>"u"||e.useAxis)&&(this.shapes=this.shapes.concat(Vn.GraphAxis(this.shapeFactory,r,e,a)));var l=e.bar3DParameter&&!isNaN(e.bar3DParameter)?e.bar3DParameter:10;for(let y=0;y=u[2]||u[1]<=u[3]?!1:(this.DVBOrigonPoint=[u[0],u[3]],this.DVBWidth=Math.abs(u[2]-u[0]),this.DVBHeight=Math.abs(u[1]-u[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-o[0],this.DVBOrigonPoint[1]-o[1]],e)}}class zst extends zNe{constructor(e,t,r,i,a){super(e,t,r,i,a),this.CLASS_NAME="SuperMap.Feature.Theme.Circle"}destroy(){super.destroy()}assembleShapes(){var e="#ff9277";if(!this.setting)return!1;var t=this.setting;if(!t.codomain)return!1;var r=typeof t.decimalNumber<"u"&&!isNaN(t.decimalNumber)?t.decimalNumber:-1,i=am.getDataValues(this.data,this.fields,r);this.dataValues=i||[];var a=this.dataValues;t.maxR||(t.maxR=100),t.minR||(t.minR=0);var o=this.DVBCodomain;o&&o[1]-o[0]>0?this.DVBUnitValue=t.maxR/(o[1]-o[0]):this.DVBUnitValue=t.maxR;var s=this.DVBUnitValue,l=a[0]*s+t.minR;if(this.width=2*l,this.height=2*l,!!this.initBaseParameter()&&!(o&&(a[0]o[1]))){var u=this.DVBCenterPoint,h=new qne(u[0],u[1],l);h.style=Vn.ShapeStyleTool(null,t.circleStyle,null,null,0),typeof t.fillColor<"u"?h.style.fillColor=t.fillColor:h.style.fillColor=e,h.highlightStyle=Vn.ShapeStyleTool(null,t.circleHoverStyle),typeof t.circleHoverAble<"u"&&(h.hoverable=t.circleHoverAble),typeof t.circleClickAble<"u"&&(h.clickable=t.circleClickAble),h.refDataID=this.data.id,h.dataInfo={field:this.fields[0],r:l,value:a[0]},this.shapes.push(this.shapeFactory.createShape(h)),this.shapesConvertToRelativeCoordinate()}}}class Ust extends mw{constructor(e,t,r,i,a,o){super(e,t,r,i,a,o),this.CLASS_NAME="SuperMap.Feature.Theme.Line"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(typeof e.useAxis>"u"||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),!!this.initBaseParameter()){var t=this.dataViewBox,r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var i=this.DVBUnitValue,a=this.dataValues;if(!(a.length<1)){var o=this.calculateXShapeInfo();if(!!o){var s=o.xPositions;(typeof e.useBackground>"u"||e.useBackground)&&this.shapes.push(Vn.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(Vn.GraphAxis(this.shapeFactory,t,e,o));for(var l,u,h=[],c=[],f=0,d=a.length;fr[1])return null;l=s[f],u=t[1]-(a[f]-r[0])/i;var v=new Fz(l,u);v.style=Vn.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,f,a[f]),v.highlightStyle=Vn.ShapeStyleTool(null,e.pointHoverStyle),typeof e.pointHoverAble<"u"&&(v.hoverable=e.pointHoverAble),typeof e.pointClickAble<"u"&&(v.clickable=e.pointClickAble),v.refDataID=this.data.id,v.dataInfo={field:this.fields[f],value:a[f]},c.push(this.shapeFactory.createShape(v));var p=[l,u];h.push(p)}var g=new VO(h);g.style=Vn.ShapeStyleTool({strokeColor:"#ee9900"},e.lineStyle),g.clickable=!1,g.hoverable=!1;var m=this.shapeFactory.createShape(g);this.shapes.push(m),this.shapes=this.shapes.concat(c),this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e=this.dataViewBox,t=this.setting,r=this.dataValues.length;if(r<1)return null;var i,a=[],o=0,s=this.DVBWidth,l=0;if(t.xShapeBlank&&t.xShapeBlank.length&&t.xShapeBlank.length==2){i=t.xShapeBlank;var u=s-(i[0]+i[1]);if(u<=r)return null;l=u/(r-1)}else l=s/(r+1),i=[l,l,l];for(var h=0,c=0;ci[1])return;var a=0;for(let g=0;g=360&&(u=359.9999999);var v=new Bz(s[0],s[1],c,l,u);if(typeof e.sectorStyleByFields>"u"){var p=f%t.length;v.style=Vn.ShapeStyleTool(null,e.sectorStyle,t,null,p)}else v.style=Vn.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,f,r[f]);v.highlightStyle=Vn.ShapeStyleTool(null,e.sectorHoverStyle),typeof e.sectorHoverAble<"u"&&(v.hoverable=e.sectorHoverAble),typeof e.sectorClickAble<"u"&&(v.clickable=e.sectorClickAble),v.refDataID=this.data.id,v.dataInfo={field:this.fields[f],value:r[f]},this.shapes.push(this.shapeFactory.createShape(v)),l=u}this.shapesConvertToRelativeCoordinate()}}}}class $st extends mw{constructor(e,t,r,i,a,o){super(e,t,r,i,a,o),this.CLASS_NAME="SuperMap.Feature.Theme.Point"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(typeof e.useAxis>"u"||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),!!this.initBaseParameter()){var t=this.dataViewBox,r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var i=this.DVBUnitValue,a=this.dataValues,o=this.calculateXShapeInfo();if(!!o){var s=o.xPositions;(typeof e.useBackground>"u"||e.useBackground)&&this.shapes.push(Vn.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(Vn.GraphAxis(this.shapeFactory,t,e,o));for(var l,u,h=0,c=a.length;hr[1])return null;l=s[h],u=t[1]-(a[h]-r[0])/i;var f=new Fz(l,u);f.style=Vn.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,h,a[h]),f.highlightStyle=Vn.ShapeStyleTool(null,e.pointHoverStyle),typeof e.pointHoverAble<"u"&&(f.hoverable=e.pointHoverAble),typeof e.pointClickAble<"u"&&(f.clickable=e.pointClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[h],value:a[h]},this.shapes.push(this.shapeFactory.createShape(f))}this.shapesConvertToRelativeCoordinate()}}}calculateXShapeInfo(){var e=this.dataViewBox,t=this.setting,r=this.dataValues.length;if(r<1)return null;var i,a=[],o=0,s=this.DVBWidth,l=0;if(t.xShapeBlank&&t.xShapeBlank.length&&t.xShapeBlank.length==2){i=t.xShapeBlank;var u=s-(i[0]+i[1]);if(u<=r)return null;l=u/(r-1)}else l=s/(r+1),i=[l,l,l];for(var h=0,c=0;ci[1])return;var a=0;for(let y=0;y=0&&t.innerRingRadius"u"){var m=v%e.length;g.style=Vn.ShapeStyleTool(null,t.sectorStyle,e,null,m)}else g.style=Vn.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,v,r[v]);g.highlightStyle=Vn.ShapeStyleTool(null,t.sectorHoverStyle),typeof t.sectorHoverAble<"u"&&(g.hoverable=t.sectorHoverAble),typeof t.sectorClickAble<"u"&&(g.clickable=t.sectorClickAble),g.refDataID=this.data.id,g.dataInfo={field:this.fields[v],value:r[v]},this.shapes.push(this.shapeFactory.createShape(g)),l=u}this.shapesConvertToRelativeCoordinate()}}}}class f3 extends am{constructor(e,t,r,i,a){if(super(e,t),!!e.geometry&&e.geometry instanceof rg){this.dataBounds=e.geometry.getBounds(),this.nodesClipPixel=2,this.isHoverAble=!0,this.isMultiHover=!0,this.isClickAble=!0,this.highlightStyle=null,this.shapeOptions={},this.style=r||{},this.CLASS_NAME="SuperMap.Feature.Theme.Vector",this.style=r||{},i&&H.copyAttributesWithClip(this,i,["shapeOptions","dataBounds"]),a&&H.copyAttributesWithClip(this.shapeOptions,a);var o=e.geometry;this.lonlat=this.dataBounds.getCenterLonLat(),this.location=this.getLocalXY(this.lonlat),o instanceof tv?this.lineToTF(o):o instanceof Vl?this.lineToTF(o):o instanceof Mne||(o instanceof HE?this.multiPointToTF(o):o instanceof _E?this.multiLineStringToTF(o):o instanceof A1?this.multiPolygonToTF(o):o instanceof _p?this.polygonToTF(o):o instanceof O0||(o instanceof Ki?this.pointToTF(o):o instanceof IOe?this.rectangleToTF(o):o instanceof O_&&this.geoTextToTF(o)))}}destroy(){this.style=null,this.dataBounds=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.highlightStyle=null,this.shapeOptions=null,super.destroy()}lineToTF(e){for(var t=e.components,r=[],i=[],a=this.location,o=[],s=this.nodesClipPixel,l=0;l0){var h=o[o.length-1];if(Math.abs(h[0]-i[0])<=s&&Math.abs(h[1]-i[1])<=s)continue}o.push(i)}if(o.length<2)return null;var c=new Object;c=H.copyAttributesWithClip(c,this.style,["pointList"]),c.pointList=o;var f=new BNe({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=this.location,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&H.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}multiPointToTF(e){for(var t=e.components,r=[],i=[],a=this.location,o=[],s=this.nodesClipPixel,l=0;l0){var h=o[o.length-1];if(Math.abs(h[0]-i[0])<=s&&Math.abs(h[1]-i[1])<=s)continue}o.push(i);var c=new Object;c.r=6,c=H.copyAttributesWithClip(c,this.style),c.x=i[0],c.y=i[1];var f=new LK({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=a,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&H.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}}multiLineStringToTF(e){for(var t=e.components,r=0;r0){var d=o[o.length-1];if(Math.abs(d[0]-i[0])<=u&&Math.abs(d[1]-i[1])<=u)continue}o.push(i)}}else{s=[];for(var v=0;v0){var p=s[s.length-1];if(Math.abs(p[0]-i[0])<=u&&Math.abs(p[1]-i[1])<=u)continue}s.push(i)}}s.length<2||l.push(s)}if(!(o.length<2)){var g={};g=H.copyAttributesWithClip(g,this.style,["pointList"]),g.pointList=o;var m=new Kne({style:g,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(m.highlightStyle=this.highlightStyle),m.refOriginalPosition=this.location,m.refDataID=this.data.id,m.isHoverByRefDataID=this.isMultiHover,l.length>0&&(m.holePolygonPointLists=l),this.shapeOptions&&H.copyAttributesWithClip(m,this.shapeOptions),this.shapes.push(m)}}rectangleToTF(e){var t=this.location,r=new vd(e.x,e.y),i=this.layer.map.getResolution(),a=this.getLocalXY(r),o=new Object;o.r=6,o=H.copyAttributesWithClip(o,this.style),o.x=a[0]-t[0],o.y=a[1]-t[1]-2*e.width/i,o.width=e.width/i,o.height=e.height/i;var s=new GNe({style:o,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(s.highlightStyle=this.highlightStyle),s.refOriginalPosition=t,s.refDataID=this.data.id,s.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&H.copyAttributesWithClip(s,this.shapeOptions),this.shapes.push(s)}geoTextToTF(e){var t=this.location,r=this.getLocalXY(e),i=new Object;i.r=6,i=H.copyAttributesWithClip(i,this.style,["x","y","text"]),i.x=r[0]-t[0],i.y=r[1]-t[1],i.text=e.text;var a=new FNe({style:i,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(a.highlightStyle=this.highlightStyle),a.refOriginalPosition=t,a.refDataID=this.data.id,a.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&H.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}updateAndAddShapes(){var e=this.getLocalXY(this.lonlat);this.location=e;for(var t=this.layer.renderer,r=0,i=this.shapes.length;r0}addRoot(e){e instanceof Xx&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)}delRoot(e){if(typeof e>"u"){for(var t=0;t=0&&(this.delFromMap(a.id),this._roots.splice(o,1),a instanceof Xx&&a.delChildrenFromStorage(this))}addToMap(e){return e instanceof Xx&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this}get(e){return this._elements[e]}delFromMap(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof Xx&&(t._storage=null)),this}dispose(){this._elements=null,this._roots=null,this._hoverElements=null}static shapeCompareFunc(e,t){return e.zlevel==t.zlevel?e.z==t.z?e.__renderidx-t.__renderidx:e.z-t.z:e.zlevel-t.zlevel}}class va{constructor(e,t){this.root=e,this.storage=t,this._domRoot=null,this._layers={},this._zlevelList=[],this._layerConfig={},this._bgDom=null,this.shapeToImage=null,va.devicePixelRatio=Math.max(window.devicePixelRatio||1,1),this.CLASS_NAME="SuperMap.LevelRenderer.Painter",this.root.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var r=document.createElement("div");this._domRoot=r,r.style.position="relative",r.style.overflow="hidden",r.style.width=this._width+"px",r.style.height=this._height+"px",this.root.appendChild(r),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=va.createDom(H.createUniqueID("SuperMap.Theme_background_"),"div",this),r.appendChild(this._bgDom),this._bgDom.onselectstart=o,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none",this._bgDom.style["-webkit-touch-callout"]="none";var i=new Jde(H.createUniqueID("_highLightLayer_"),this);this._layers.hover=i,r.appendChild(i.dom),i.initContext(),i.dom.onselectstart=o,i.dom.style["-webkit-user-select"]="none",i.dom.style["user-select"]="none",i.dom.style["-webkit-touch-callout"]="none";var a=this;this.updatePainter=function(s,l){a.refreshShapes(s,l)};function o(){return!1}}destroy(){this.dispose(),this._zlevelList=null,this._layerConfig=null,this._bgDom=null,this.shapeToImage=null}render(e){return this.refresh(e,!0),this}refresh(e,t){var r=this.storage.getShapeList(!0);return this._paintList(r,t),typeof e=="function"&&e(),this}_paintList(e,t){typeof t>"u"&&(t=!1),this._updateLayerStatus(e);var r,i,a;for(var o in this._layers)o!=="hover"&&(this._layers[o].unusedCount++,this._layers[o].updateTransform());for(var s=[],l=0,u=e.length;l0&&e>this._zlevelList[0]){for(a=0;ae);a++);i=this._layers[this._zlevelList[a]]}this._zlevelList.splice(a+1,0,e),t=new Jde(H.createUniqueID("_levelLayer_"+e),this);var o=i?i.dom:this._bgDom;o.nextSibling?o.parentNode.insertBefore(t.dom,o.nextSibling):o.parentNode.appendChild(t.dom),t.initContext(),this._layers[e]=t,this._layerConfig[e]&&new Pp().merge(t,this._layerConfig[e],!0),t.updateTransform()}return t}getLayers(){return this._layers}_updateLayerStatus(e){var t=this._layers,r={};for(let s in t)s!=="hover"&&(r[s]=t[s].elCount,t[s].elCount=0);for(let s=0;s0?1.1:1/1.1,f=this.painter.getLayers(),d=!1;for(var v in f)if(v!=="hover"){var p=f[v],g=p.position;if(p.zoomable){p.__zoom=p.__zoom||1;var m=p.__zoom;m*=c,m=Math.max(Math.min(p.maxZoom,m),p.minZoom),c=m/p.__zoom,p.__zoom=m,g[0]-=(this._mouseX-g[0])*(c-1),g[1]-=(this._mouseY-g[1])*(c-1),p.scale[0]*=c,p.scale[1]*=c,p.dirty=!0,d=!0}}d&&this.painter.refresh(),this._dispatchAgency(this._lastHover,ds.EVENT.MOUSEWHEEL,u),this._mousemoveHandler(u)},mousemove:function(u){this._clickThreshold++,u=this._zrenderEventFixed(u),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=cr.Util_event.getX(u),this._mouseY=cr.Util_event.getY(u);var h=this._mouseX-this._lastX,c=this._mouseY-this._lastY;this._processDragStart(u),this._hasfound=0,this._event=u,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(u),this._processDragLeave(u)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var f="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,h,c),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var d=this.painter.getLayers(),v=!1;for(var p in d)if(p!=="hover"){var g=d[p];g.panable&&(f="move",g.position[0]+=h,g.position[1]+=c,v=!0,g.dirty=!0)}v&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?f="move":this._hasfound&&this._lastHover.clickable&&(f="pointer"),this.root.style.cursor=f,this._dispatchAgency(this._lastHover,ds.EVENT.MOUSEMOVE,u),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(u){u=this._zrenderEventFixed(u);var h=u.toElement||u.relatedTarget;if(h!=this.root)for(;h&&h.nodeType!=9;){if(h==this.root){this._mousemoveHandler(u);return}h=h.parentNode}u.zrenderX=this._lastX,u.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(u),this._processDrop(u),this._processDragEnd(u),this.painter.refreshHover(),this.dispatch(ds.EVENT.GLOBALOUT,u)},mousedown:function(u){if(this._clickThreshold=0,this._lastDownButton==2){this._lastDownButton=u.button,this._mouseDownTarget=null;return}this._lastMouseDownMoment=new Date,u=this._zrenderEventFixed(u),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,ds.EVENT.MOUSEDOWN,u),this._lastDownButton=u.button},mouseup:function(u){u=this._zrenderEventFixed(u),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,ds.EVENT.MOUSEUP,u),this._processDrop(u),this._processDragEnd(u)},touchstart:function(u){u=this._zrenderEventFixed(u,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(u),this._mousedownHandler(u)},touchmove:function(u){u=this._zrenderEventFixed(u,!0),this._mousemoveHandler(u),this._isDragging&&cr.Util_event.stop(u)},touchend:function(u){u=this._zrenderEventFixed(u,!0),this._mouseupHandler(u);var h=new Date;h-this._lastTouchMoment=0;o--){var s=t[o];if(r!==s.zlevel&&(i=this.painter.getLayer(s.zlevel,i),a[0]=this._mouseX,a[1]=this._mouseY,i.needTransform&&(cr.Util_matrix.invert(e,i.transform),cr.Util_vector.applyTransform(a,a,e))),this._findHover(s,a[0],a[1]))break}}_mobildFindFixed(e){var t=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var r=0;!this._lastHover&&r"u"?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart,this.CLASS_NAME="SuperMap.LevelRenderer.Animation.Clip"}destroy(){}step(e){var t=new jst,r=(e-this._startTime)/this._life;if(!(r<0)){r=Math.min(r,1);var i=typeof this.easing=="string"?t[this.easing]:this.easing,a=typeof i=="function"?i(r):r;return this.fire("frame",a),r==1?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}}restart(){var e=new Date().getTime(),t=(e-this._startTime)%this._life;this._startTime=new Date().getTime()-t+this.gap}fire(e,t){for(var r=0,i=this._targetPool.length;r=0&&this._clips.splice(t,1)}_update(){var e=new Date().getTime(),t=e-this._time,r=this._clips,i=r.length,a=[],o=[];for(let u=0;u=0&&!(y[E]<=W);E--);E=Math.min(E,f-2)}else{for(E=S;EW);E++);E=Math.min(E-1,f-2)}S=E,w=W;var z=y[E+1]-y[E];if(z!==0){if(T=(W-y[E])/z,o)if(A=_[E],C=_[E===0?E:E-1],M=_[E>f-2?f-1:E+1],I=_[E>f-3?f-1:E+2],v)Mh._catmullRomInterpolateArray(C,A,M,I,T,T*T,T*T*T,i(G,c),g);else{let V;p?V=Mh.rgba2String(R):V=Mh._catmullRomInterpolate(C,A,M,I,T,T*T,T*T*T),r(G,c,V)}else if(v)Mh._interpolateArray(_[E],_[E+1],T,i(G,c),g);else{let V;p?(Mh._interpolateArray(_[E],_[E+1],T,R,1),V=Mh.rgba2String(R)):V=Mh._interpolateNumber(_[E],_[E+1],T),r(G,c,V)}for(E=0;E"u"&&(e.__aniCount=0),e.__aniCount===0&&u.push(e),e.__aniCount++,this.animation.animate(i,{loop:r}).done(function(){if(e.__aniCount--,e.__aniCount===0){var h=new Pp().indexOf(u,e);u.splice(h,1)}})}else cr.Util_log("Element not existed")}clearAnimation(){this.animation.clear()}getWidth(){return this.painter.getWidth()}getHeight(){return this.painter.getHeight()}toDataURL(e,t,r){return this.painter.toDataURL(e,t,r)}shapeToImage(e,t,r){var i=H.createUniqueID("SuperMap.LevelRenderer.ToImage_");return this.painter.shapeToImage(i,e,t,r)}on(e,t){return this.handler.on(e,t),this}un(e,t){return this.handler.un(e,t),this}trigger(e,t){return this.handler.trigger(e,t),this.handler.dispatch(e,t),this}clear(){return this.storage.delRoot(),this.painter.clear(),this}dispose(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=null,this.animatingElements=null,this.storage=null,this.painter=null,this.handler=null}updateHoverShapes(e){return this.painter.updateHoverLayer(e),this}getAllShapes(){return this.storage._shapeList}clearAll(){return this.clear(),this.painter.clearHover(),this}getHoverOne(){return this.handler.getLastHoverOne()}static getFrameCallback(e){return function(){var t=e.animatingElements;if(t instanceof Array){for(var r=0,i=t.length;r"u"&&typeof self<"u"?Lb.worker=!0:typeof navigator>"u"?(Lb.node=!0,Lb.svgSupported=!0):Kst(navigator.userAgent,Lb);function Kst(n,e){var t=e.browser,r=n.match(/Firefox\/([\d.]+)/),i=n.match(/MSIE\s([\d.]+)/)||n.match(/Trident\/.+?rv:(([\d.]+))/),a=n.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(n);r&&(t.firefox=!0,t.version=r[1]),i&&(t.ie=!0,t.version=i[1]),a&&(t.edge=!0,t.version=a[1],t.newEdge=+a[1].split(".")[0]>18),o&&(t.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in s||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}const sa=Lb;var Qne=12,VNe="sans-serif",RS=Qne+"px "+VNe,Jst=20,Qst=100,elt="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function tlt(n){var e={};if(typeof JSON>"u")return e;for(var t=0;t=0)s=o*t.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[l]+":0",i[u]+":0",r[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),n.appendChild(o),t.push(o)}return t}function Elt(n,e,t){for(var r=t?"invTrans":"trans",i=e[r],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var h=n[u].getBoundingClientRect(),c=2*u,f=h.left,d=h.top;o.push(f,d),l=l&&a&&f===a[c]&&d===a[c+1],s.push(n[u].offsetLeft,n[u].offsetTop)}return l&&i?i:(e.srcCoords=o,e[r]=t?rve(s,o):rve(o,s))}function qNe(n){return n.nodeName.toUpperCase()==="CANVAS"}var Tlt=/([&<>"'])/g,Clt={"&":"&","<":"<",">":">",'"':""","'":"'"};function od(n){return n==null?"":(n+"").replace(Tlt,function(e,t){return Clt[t]})}var Alt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,jW=[],Mlt=sa.browser.firefox&&+sa.browser.version.split(".")[0]<39;function BK(n,e,t,r){return t=t||{},r?ive(n,e,t):Mlt&&e.layerX!=null&&e.layerX!==e.offsetX?(t.zrX=e.layerX,t.zrY=e.layerY):e.offsetX!=null?(t.zrX=e.offsetX,t.zrY=e.offsetY):ive(n,e,t),t}function ive(n,e,t){if(sa.domSupported&&n.getBoundingClientRect){var r=e.clientX,i=e.clientY;if(qNe(n)){var a=n.getBoundingClientRect();t.zrX=r-a.left,t.zrY=i-a.top;return}else if(FK(jW,n,r,i)){t.zrX=jW[0],t.zrY=jW[1];return}}t.zrX=t.zrY=0}function oie(n){return n||window.event}function lp(n,e,t){if(e=oie(e),e.zrX!=null)return e;var r=e.type,i=r&&r.indexOf("touch")>=0;if(i){var o=r!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&BK(n,o,e,t)}else{BK(n,e,e,t);var a=Ilt(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&Alt.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function Ilt(n){var e=n.wheelDelta;if(e)return e;var t=n.deltaX,r=n.deltaY;if(t==null||r==null)return e;var i=Math.abs(r!==0?r:t),a=r>0?-1:r<0?1:t>0?-1:1;return 3*i*a}function GK(n,e,t,r){n.addEventListener(e,t,r)}function Llt(n,e,t,r){n.removeEventListener(e,t,r)}var l_=function(n){n.preventDefault(),n.stopPropagation(),n.cancelBubble=!0};function ave(n){return n.which===2||n.which===3}var Plt=function(){function n(){this._track=[]}return n.prototype.recognize=function(e,t,r){return this._doTrack(e,t,r),this._recognize(e)},n.prototype.clear=function(){return this._track.length=0,this},n.prototype._doTrack=function(e,t,r){var i=e.touches;if(!!i){for(var a={points:[],touches:[],target:t,event:e},o=0,s=i.length;o1&&r&&r.length>1){var a=ove(r)/ove(i);!isFinite(a)&&(a=1),e.pinchScale=a;var o=Olt(r);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:n[0].target,event:e}}}}};function Up(){return[1,0,0,1,0,0]}function Vz(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n[4]=0,n[5]=0,n}function sie(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function $1(n,e,t){var r=e[0]*t[0]+e[2]*t[1],i=e[1]*t[0]+e[3]*t[1],a=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],s=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=l,n}function sm(n,e,t){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4]+t[0],n[5]=e[5]+t[1],n}function j2(n,e,t){var r=e[0],i=e[2],a=e[4],o=e[1],s=e[3],l=e[5],u=Math.sin(t),h=Math.cos(t);return n[0]=r*h+o*u,n[1]=-r*u+o*h,n[2]=i*h+s*u,n[3]=-i*u+h*s,n[4]=h*a+u*l,n[5]=h*l-u*a,n}function lie(n,e,t){var r=t[0],i=t[1];return n[0]=e[0]*r,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*i,n}function LI(n,e){var t=e[0],r=e[2],i=e[4],a=e[1],o=e[3],s=e[5],l=t*o-a*r;return l?(l=1/l,n[0]=o*l,n[1]=-a*l,n[2]=-r*l,n[3]=t*l,n[4]=(r*s-o*i)*l,n[5]=(a*i-t*s)*l,n):null}function Rlt(n){var e=Up();return sie(e,n),e}var Dlt=function(){function n(e,t){this.x=e||0,this.y=t||0}return n.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.set=function(e,t){return this.x=e,this.y=t,this},n.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},n.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},n.prototype.scale=function(e){this.x*=e,this.y*=e},n.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},n.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},n.prototype.dot=function(e){return this.x*e.x+this.y*e.y},n.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},n.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},n.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},n.prototype.distance=function(e){var t=this.x-e.x,r=this.y-e.y;return Math.sqrt(t*t+r*r)},n.prototype.distanceSquare=function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r},n.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},n.prototype.transform=function(e){if(!!e){var t=this.x,r=this.y;return this.x=e[0]*t+e[2]*r+e[4],this.y=e[1]*t+e[3]*r+e[5],this}},n.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},n.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},n.set=function(e,t,r){e.x=t,e.y=r},n.copy=function(e,t){e.x=t.x,e.y=t.y},n.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},n.lenSquare=function(e){return e.x*e.x+e.y*e.y},n.dot=function(e,t){return e.x*t.x+e.y*t.y},n.add=function(e,t,r){e.x=t.x+r.x,e.y=t.y+r.y},n.sub=function(e,t,r){e.x=t.x-r.x,e.y=t.y-r.y},n.scale=function(e,t,r){e.x=t.x*r,e.y=t.y*r},n.scaleAndAdd=function(e,t,r,i){e.x=t.x+r.x*i,e.y=t.y+r.y*i},n.lerp=function(e,t,r,i){var a=1-i;e.x=a*t.x+i*r.x,e.y=a*t.y+i*r.y},n}();const qn=Dlt;var $F=Math.min,WF=Math.max,Ww=new qn,Hw=new qn,jw=new qn,Xw=new qn,VL=new qn,$L=new qn,Nlt=function(){function n(e,t,r,i){r<0&&(e=e+r,r=-r),i<0&&(t=t+i,i=-i),this.x=e,this.y=t,this.width=r,this.height=i}return n.prototype.union=function(e){var t=$F(e.x,this.x),r=$F(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=WF(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=WF(e.y+e.height,this.y+this.height)-r:this.height=e.height,this.x=t,this.y=r},n.prototype.applyTransform=function(e){n.applyTransform(this,this,e)},n.prototype.calculateTransform=function(e){var t=this,r=e.width/t.width,i=e.height/t.height,a=Up();return sm(a,a,[-t.x,-t.y]),lie(a,a,[r,i]),sm(a,a,[e.x,e.y]),a},n.prototype.intersect=function(e,t){if(!e)return!1;e instanceof n||(e=n.create(e));var r=this,i=r.x,a=r.x+r.width,o=r.y,s=r.y+r.height,l=e.x,u=e.x+e.width,h=e.y,c=e.y+e.height,f=!(av&&(v=_,pv&&(v=x,m=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height},n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.copy=function(e){n.copy(this,e)},n.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},n.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},n.prototype.isZero=function(){return this.width===0||this.height===0},n.create=function(e){return new n(e.x,e.y,e.width,e.height)},n.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},n.applyTransform=function(e,t,r){if(!r){e!==t&&n.copy(e,t);return}if(r[1]<1e-5&&r[1]>-1e-5&&r[2]<1e-5&&r[2]>-1e-5){var i=r[0],a=r[3],o=r[4],s=r[5];e.x=t.x*i+o,e.y=t.y*a+s,e.width=t.width*i,e.height=t.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}Ww.x=jw.x=t.x,Ww.y=Xw.y=t.y,Hw.x=Xw.x=t.x+t.width,Hw.y=jw.y=t.y+t.height,Ww.transform(r),Xw.transform(r),Hw.transform(r),jw.transform(r),e.x=$F(Ww.x,Hw.x,jw.x,Xw.x),e.y=$F(Ww.y,Hw.y,jw.y,Xw.y);var l=WF(Ww.x,Hw.x,jw.x,Xw.x),u=WF(Ww.y,Hw.y,jw.y,Xw.y);e.width=l-e.x,e.height=u-e.y},n}();const ai=Nlt;var ZNe="silent";function klt(n,e,t){return{type:n,event:t,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:t.zrX,offsetY:t.zrY,gestureEvent:t.gestureEvent,pinchX:t.pinchX,pinchY:t.pinchY,pinchScale:t.pinchScale,wheelDelta:t.zrDelta,zrByTouch:t.zrByTouch,which:t.which,stop:Flt}}function Flt(){l_(this.event)}var Blt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(ng),WL=function(){function n(e,t){this.x=e,this.y=t}return n}(),Glt=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],YW=new ai(0,0,0,0),KNe=function(n){$e(e,n);function e(t,r,i,a,o){var s=n.call(this)||this;return s._hovered=new WL(0,0),s.storage=t,s.painter=r,s.painterRoot=a,s._pointerSize=o,i=i||new Blt,s.proxy=null,s.setHandlerProxy(i),s._draggingMgr=new _lt(s),s}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(te(Glt,function(r){t.on&&t.on(r,this[r],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var r=t.zrX,i=t.zrY,a=JNe(this,r,i),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new WL(r,i):this.findHover(r,i),u=l.target,h=this.proxy;h.setCursor&&h.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(l,"mousemove",t),u&&u!==s&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var r=t.zrEventControl;r!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),r!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new WL(0,0)},e.prototype.dispatch=function(t,r){var i=this[t];i&&i.call(this,r)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var r=this.proxy;r.setCursor&&r.setCursor(t)},e.prototype.dispatchToElement=function(t,r,i){t=t||{};var a=t.target;if(!(a&&a.silent)){for(var o="on"+r,s=klt(r,t,i);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(r,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(r,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(r,s)}))}},e.prototype.findHover=function(t,r,i){var a=this.storage.getDisplayList(),o=new WL(t,r);if(sve(a,o,t,r,i),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,h=new ai(t-u,r-u,l,l),c=a.length-1;c>=0;c--){var f=a[c];f!==i&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(YW.copy(f.getBoundingRect()),f.transform&&YW.applyTransform(f.transform),YW.intersect(h)&&s.push(f))}if(s.length)for(var d=4,v=Math.PI/12,p=Math.PI*2,g=0;g4)return;this._downPoint=null}this.dispatchToElement(a,n,e)}});function zlt(n,e,t){if(n[n.rectHover?"rectContain":"contain"](e,t)){for(var r=n,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var o=r.getClipPath();if(o&&!o.contain(e,t))return!1;r.silent&&(i=!0)}var s=r.__hostTarget;r=s||r.parent}return i?ZNe:!0}return!1}function sve(n,e,t,r,i){for(var a=n.length-1;a>=0;a--){var o=n[a],s=void 0;if(o!==i&&!o.ignore&&(s=zlt(o,t,r))&&(!e.topTarget&&(e.topTarget=o),s!==ZNe)){e.target=o;break}}}function JNe(n,e,t){var r=n.painter;return e<0||e>r.getWidth()||t<0||t>r.getHeight()}const Ult=KNe;var QNe=32,HL=7;function Vlt(n){for(var e=0;n>=QNe;)e|=n&1,n>>=1;return n+e}function lve(n,e,t,r){var i=e+1;if(i===t)return 1;if(r(n[i++],n[e])<0){for(;i=0;)i++;return i-e}function $lt(n,e,t){for(t--;e>>1,i(a,n[l])<0?s=l:o=l+1;var u=r-o;switch(u){case 3:n[o+3]=n[o+2];case 2:n[o+2]=n[o+1];case 1:n[o+1]=n[o];break;default:for(;u>0;)n[o+u]=n[o+u-1],u--}n[o]=a}}function qW(n,e,t,r,i,a){var o=0,s=0,l=1;if(a(n,e[t+i])>0){for(s=r-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(n,e[t+h])>0?o=h+1:l=h}return l}function ZW(n,e,t,r,i,a){var o=0,s=0,l=1;if(a(n,e[t+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=r-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(n,e[t+h])<0?l=h:o=h+1}return l}function Wlt(n,e){var t=HL,r,i,a=0;n.length;var o=[];r=[],i=[];function s(d,v){r[a]=d,i[a]=v,a+=1}function l(){for(;a>1;){var d=a-2;if(d>=1&&i[d-1]<=i[d]+i[d+1]||d>=2&&i[d-2]<=i[d]+i[d-1])i[d-1]i[d+1])break;h(d)}}function u(){for(;a>1;){var d=a-2;d>0&&i[d-1]=HL||b>=HL);if(E)break;S<0&&(S=0),S+=2}if(t=S,t<1&&(t=1),v===1){for(m=0;m=0;m--)n[w+m]=n[S+m];n[x]=o[_];return}for(var b=t;;){var E=0,T=0,C=!1;do if(e(o[_],n[y])<0){if(n[x--]=n[y--],E++,T=0,--v===0){C=!0;break}}else if(n[x--]=o[_--],T++,E=0,--g===1){C=!0;break}while((E|T)=0;m--)n[w+m]=n[S+m];if(v===0){C=!0;break}}if(n[x--]=o[_--],--g===1){C=!0;break}if(T=g-qW(n[y],o,0,g,g-1,e),T!==0){for(x-=T,_-=T,g-=T,w=x+1,S=_+1,m=0;m=HL||T>=HL);if(C)break;b<0&&(b=0),b+=2}if(t=b,t<1&&(t=1),g===1){for(x-=v,y-=v,w=x+1,S=y+1,m=v-1;m>=0;m--)n[w+m]=n[S+m];n[x]=o[_]}else{if(g===0)throw new Error;for(S=x-(g-1),m=0;ms&&(l=s),uve(n,t,t+l,t+a,e),a=l}o.pushRun(t,a),o.mergeRuns(),i-=a,t+=a}while(i!==0);o.forceMergeRuns()}}var ov=1,JP=2,BC=4,hve=!1;function KW(){hve||(hve=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function cve(n,e){return n.zlevel===e.zlevel?n.z===e.z?n.z2-e.z2:n.z-e.z:n.zlevel-e.zlevel}var Hlt=function(){function n(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=cve}return n.prototype.traverse=function(e,t){for(var r=0;r0&&(h.__clipPaths=[]),isNaN(h.z)&&(KW(),h.z=0),isNaN(h.z2)&&(KW(),h.z2=0),isNaN(h.zlevel)&&(KW(),h.zlevel=0),this._displayList[this._displayListLen++]=h}var c=e.getDecalElement&&e.getDecalElement();c&&this._updateAndAddDisplayable(c,t,r);var f=e.getTextGuideLine();f&&this._updateAndAddDisplayable(f,t,r);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,t,r)}},n.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},n.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,r=e.length;t=0&&this._roots.splice(i,1)},n.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},n.prototype.getRoots=function(){return this._roots},n.prototype.dispose=function(){this._displayList=null,this._roots=null},n}();const jlt=Hlt;var e3e;e3e=sa.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(n){return setTimeout(n,16)};const zK=e3e;var SB={linear:function(n){return n},quadraticIn:function(n){return n*n},quadraticOut:function(n){return n*(2-n)},quadraticInOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)},cubicIn:function(n){return n*n*n},cubicOut:function(n){return--n*n*n+1},cubicInOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)},quarticIn:function(n){return n*n*n*n},quarticOut:function(n){return 1- --n*n*n*n},quarticInOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)},quinticIn:function(n){return n*n*n*n*n},quinticOut:function(n){return--n*n*n*n*n+1},quinticInOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)},sinusoidalIn:function(n){return 1-Math.cos(n*Math.PI/2)},sinusoidalOut:function(n){return Math.sin(n*Math.PI/2)},sinusoidalInOut:function(n){return .5*(1-Math.cos(Math.PI*n))},exponentialIn:function(n){return n===0?0:Math.pow(1024,n-1)},exponentialOut:function(n){return n===1?1:1-Math.pow(2,-10*n)},exponentialInOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)},circularIn:function(n){return 1-Math.sqrt(1-n*n)},circularOut:function(n){return Math.sqrt(1- --n*n)},circularInOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)},elasticIn:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)))},elasticOut:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*n)*Math.sin((n-e)*(2*Math.PI)/r)+1)},elasticInOut:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),(n*=2)<1?-.5*(t*Math.pow(2,10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)):t*Math.pow(2,-10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)*.5+1)},backIn:function(n){var e=1.70158;return n*n*((e+1)*n-e)},backOut:function(n){var e=1.70158;return--n*n*((e+1)*n+e)+1},backInOut:function(n){var e=2.5949095;return(n*=2)<1?.5*(n*n*((e+1)*n-e)):.5*((n-=2)*n*((e+1)*n+e)+2)},bounceIn:function(n){return 1-SB.bounceOut(1-n)},bounceOut:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},bounceInOut:function(n){return n<.5?SB.bounceIn(n*2)*.5:SB.bounceOut(n*2-1)*.5+.5}};const t3e=SB;var HF=Math.pow,yS=Math.sqrt,J8=1e-8,r3e=1e-4,fve=yS(3),jF=1/3,Iy=H2(),wp=H2(),kA=H2();function Qx(n){return n>-J8&&nJ8||n<-J8}function Qu(n,e,t,r,i){var a=1-i;return a*a*(a*n+3*i*e)+i*i*(i*r+3*a*t)}function dve(n,e,t,r,i){var a=1-i;return 3*(((e-n)*a+2*(t-e)*i)*a+(r-t)*i*i)}function Q8(n,e,t,r,i,a){var o=r+3*(e-t)-n,s=3*(t-e*2+n),l=3*(e-n),u=n-i,h=s*s-3*o*l,c=s*l-9*o*u,f=l*l-3*s*u,d=0;if(Qx(h)&&Qx(c))if(Qx(s))a[0]=0;else{var v=-l/s;v>=0&&v<=1&&(a[d++]=v)}else{var p=c*c-4*h*f;if(Qx(p)){var g=c/h,v=-s/o+g,m=-g/2;v>=0&&v<=1&&(a[d++]=v),m>=0&&m<=1&&(a[d++]=m)}else if(p>0){var y=yS(p),_=h*s+1.5*o*(-c+y),x=h*s+1.5*o*(-c-y);_<0?_=-HF(-_,jF):_=HF(_,jF),x<0?x=-HF(-x,jF):x=HF(x,jF);var v=(-s-(_+x))/(3*o);v>=0&&v<=1&&(a[d++]=v)}else{var S=(2*h*s-3*o*c)/(2*yS(h*h*h)),w=Math.acos(S)/3,b=yS(h),E=Math.cos(w),v=(-s-2*b*E)/(3*o),m=(-s+b*(E+fve*Math.sin(w)))/(3*o),T=(-s+b*(E-fve*Math.sin(w)))/(3*o);v>=0&&v<=1&&(a[d++]=v),m>=0&&m<=1&&(a[d++]=m),T>=0&&T<=1&&(a[d++]=T)}}return d}function i3e(n,e,t,r,i){var a=6*t-12*e+6*n,o=9*e+3*r-3*n-9*t,s=3*e-3*n,l=0;if(Qx(o)){if(n3e(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var h=a*a-4*o*s;if(Qx(h))i[0]=-a/(2*o);else if(h>0){var c=yS(h),u=(-a+c)/(2*o),f=(-a-c)/(2*o);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function DS(n,e,t,r,i,a){var o=(e-n)*i+n,s=(t-e)*i+e,l=(r-t)*i+t,u=(s-o)*i+o,h=(l-s)*i+s,c=(h-u)*i+u;a[0]=n,a[1]=o,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=r}function a3e(n,e,t,r,i,a,o,s,l,u,h){var c,f=.005,d=1/0,v,p,g,m;Iy[0]=l,Iy[1]=u;for(var y=0;y<1;y+=.05)wp[0]=Qu(n,t,i,o,y),wp[1]=Qu(e,r,a,s,y),g=wE(Iy,wp),g=0&&g=0&&u<=1&&(i[l++]=u)}}else{var h=o*o-4*a*s;if(Qx(h)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(h>0){var c=yS(h),u=(-o+c)/(2*a),f=(-o-c)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function o3e(n,e,t){var r=n+t-2*e;return r===0?.5:(n-e)/r}function tD(n,e,t,r,i){var a=(e-n)*r+n,o=(t-e)*r+e,s=(o-a)*r+a;i[0]=n,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=t}function s3e(n,e,t,r,i,a,o,s,l){var u,h=.005,c=1/0;Iy[0]=o,Iy[1]=s;for(var f=0;f<1;f+=.05){wp[0]=Ph(n,t,i,f),wp[1]=Ph(e,r,a,f);var d=wE(Iy,wp);d=0&&d=1?1:Q8(0,r,a,1,l,s)&&Qu(0,i,o,1,s[0])}}}var Klt=function(){function n(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Hl,this.ondestroy=e.ondestroy||Hl,this.onrestart=e.onrestart||Hl,e.easing&&this.setEasing(e.easing)}return n.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var r=this._life,i=e-this._startTime-this._pausedTime,a=i/r;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=i%r;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},n.prototype.pause=function(){this._paused=!0},n.prototype.resume=function(){this._paused=!1},n.prototype.setEasing=function(e){this.easing=e,this.easingFunc=rn(e)?e:t3e[e]||uie(e)},n}();const Jlt=Klt;var l3e=function(){function n(e){this.value=e}return n}(),Qlt=function(){function n(){this._len=0}return n.prototype.insert=function(e){var t=new l3e(e);return this.insertEntry(t),t},n.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},n.prototype.remove=function(e){var t=e.prev,r=e.next;t?t.next=r:this.head=r,r?r.prev=t:this.tail=t,e.next=e.prev=null,this._len--},n.prototype.len=function(){return this._len},n.prototype.clear=function(){this.head=this.tail=null,this._len=0},n}(),eut=function(){function n(e){this._list=new Qlt,this._maxSize=10,this._map={},this._maxSize=e}return n.prototype.put=function(e,t){var r=this._list,i=this._map,a=null;if(i[e]==null){var o=r.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=r.head;r.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new l3e(t),s.key=e,r.insertEntry(s),i[e]=s}return a},n.prototype.get=function(e){var t=this._map[e],r=this._list;if(t!=null)return t!==r.tail&&(r.remove(t),r.insertEntry(t)),t.value},n.prototype.clear=function(){this._list.clear(),this._map={}},n.prototype.len=function(){return this._list.len()},n}();const d3=eut;var vve={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function l0(n){return n=Math.round(n),n<0?0:n>255?255:n}function tut(n){return n=Math.round(n),n<0?0:n>360?360:n}function rD(n){return n<0?0:n>1?1:n}function JW(n){var e=n;return e.length&&e.charAt(e.length-1)==="%"?l0(parseFloat(e)/100*255):l0(parseInt(e,10))}function bE(n){var e=n;return e.length&&e.charAt(e.length-1)==="%"?rD(parseFloat(e)/100):rD(parseFloat(e))}function QW(n,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?n+(e-n)*t*6:t*2<1?e:t*3<2?n+(e-n)*(2/3-t)*6:n}function eS(n,e,t){return n+(e-n)*t}function tp(n,e,t,r,i){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function VK(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n}var u3e=new d3(20),XF=null;function UT(n,e){XF&&VK(XF,e),XF=u3e.put(n,XF||e.slice())}function gv(n,e){if(!!n){e=e||[];var t=u3e.get(n);if(t)return VK(e,t);n=n+"";var r=n.replace(/ /g,"").toLowerCase();if(r in vve)return VK(e,vve[r]),UT(n,e),e;var i=r.length;if(r.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){tp(e,0,0,0,1);return}return tp(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),UT(n,e),e}else if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){tp(e,0,0,0,1);return}return tp(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),UT(n,e),e}return}var o=r.indexOf("("),s=r.indexOf(")");if(o!==-1&&s+1===i){var l=r.substr(0,o),u=r.substr(o+1,s-(o+1)).split(","),h=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?tp(e,+u[0],+u[1],+u[2],1):tp(e,0,0,0,1);h=bE(u.pop());case"rgb":if(u.length>=3)return tp(e,JW(u[0]),JW(u[1]),JW(u[2]),u.length===3?h:bE(u[3])),UT(n,e),e;tp(e,0,0,0,1);return;case"hsla":if(u.length!==4){tp(e,0,0,0,1);return}return u[3]=bE(u[3]),$K(u,e),UT(n,e),e;case"hsl":if(u.length!==3){tp(e,0,0,0,1);return}return $K(u,e),UT(n,e),e;default:return}}tp(e,0,0,0,1)}}function $K(n,e){var t=(parseFloat(n[0])%360+360)%360/360,r=bE(n[1]),i=bE(n[2]),a=i<=.5?i*(r+1):i+r-i*r,o=i*2-a;return e=e||[],tp(e,l0(QW(o,a,t+1/3)*255),l0(QW(o,a,t)*255),l0(QW(o,a,t-1/3)*255),1),n.length===4&&(e[3]=n[3]),e}function rut(n){if(!!n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i=Math.min(e,t,r),a=Math.max(e,t,r),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var h=((a-e)/6+o/2)/o,c=((a-t)/6+o/2)/o,f=((a-r)/6+o/2)/o;e===a?l=f-c:t===a?l=1/3+h-f:r===a&&(l=2/3+c-h),l<0&&(l+=1),l>1&&(l-=1)}var d=[l*360,u,s];return n[3]!=null&&d.push(n[3]),d}}function WK(n,e){var t=gv(n);if(t){for(var r=0;r<3;r++)e<0?t[r]=t[r]*(1-e)|0:t[r]=(255-t[r])*e+t[r]|0,t[r]>255?t[r]=255:t[r]<0&&(t[r]=0);return W1(t,t.length===4?"rgba":"rgb")}}function eH(n,e,t){if(!(!(e&&e.length)||!(n>=0&&n<=1))){t=t||[];var r=n*(e.length-1),i=Math.floor(r),a=Math.ceil(r),o=e[i],s=e[a],l=r-i;return t[0]=l0(eS(o[0],s[0],l)),t[1]=l0(eS(o[1],s[1],l)),t[2]=l0(eS(o[2],s[2],l)),t[3]=rD(eS(o[3],s[3],l)),t}}function nut(n,e,t){if(!(!(e&&e.length)||!(n>=0&&n<=1))){var r=n*(e.length-1),i=Math.floor(r),a=Math.ceil(r),o=gv(e[i]),s=gv(e[a]),l=r-i,u=W1([l0(eS(o[0],s[0],l)),l0(eS(o[1],s[1],l)),l0(eS(o[2],s[2],l)),rD(eS(o[3],s[3],l))],"rgba");return t?{color:u,leftIndex:i,rightIndex:a,value:r}:u}}function WO(n,e,t,r){var i=gv(n);if(n)return i=rut(i),e!=null&&(i[0]=tut(e)),t!=null&&(i[1]=bE(t)),r!=null&&(i[2]=bE(r)),W1($K(i),"rgba")}function eG(n,e){var t=gv(n);if(t&&e!=null)return t[3]=rD(e),W1(t,"rgba")}function W1(n,e){if(!(!n||!n.length)){var t=n[0]+","+n[1]+","+n[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+n[3]),e+"("+t+")"}}function tG(n,e){var t=gv(n);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var rG=Math.round;function nD(n){var e;if(!n||n==="transparent")n="none";else if(typeof n=="string"&&n.indexOf("rgba")>-1){var t=gv(n);t&&(n="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:n,opacity:e==null?1:e}}var pve=1e-4;function tS(n){return n-pve}function YF(n){return rG(n*1e3)/1e3}function HK(n){return rG(n*1e4)/1e4}function iut(n){return"matrix("+YF(n[0])+","+YF(n[1])+","+YF(n[2])+","+YF(n[3])+","+HK(n[4])+","+HK(n[5])+")"}var aut={left:"start",right:"end",center:"middle",middle:"middle"};function out(n,e,t){return t==="top"?n+=e/2:t==="bottom"&&(n-=e/2),n}function sut(n){return n&&(n.shadowBlur||n.shadowOffsetX||n.shadowOffsetY)}function lut(n){var e=n.style,t=n.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),t[0],t[1]].join(",")}function h3e(n){return n&&!!n.image}function uut(n){return n&&!!n.svgElement}function hie(n){return h3e(n)||uut(n)}function c3e(n){return n.type==="linear"}function f3e(n){return n.type==="radial"}function d3e(n){return n&&(n.type==="linear"||n.type==="radial")}function $z(n){return"url(#"+n+")"}function v3e(n){var e=n.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function p3e(n){var e=n.x||0,t=n.y||0,r=(n.rotation||0)*yB,i=ni(n.scaleX,1),a=ni(n.scaleY,1),o=n.skewX||0,s=n.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),r&&l.push("rotate("+r+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(o||s)&&l.push("skew("+rG(o*yB)+"deg, "+rG(s*yB)+"deg)"),l.join(" ")}var hut=function(){return sa.hasGlobalWindow&&rn(window.btoa)?function(n){return window.btoa(unescape(encodeURIComponent(n)))}:typeof Buffer<"u"?function(n){return Buffer.from(n).toString("base64")}:function(n){return null}}(),jK=Array.prototype.slice;function p1(n,e,t){return(e-n)*t+n}function tH(n,e,t,r){for(var i=e.length,a=0;ar?e:n,a=Math.min(t,r),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)r.length=o;else for(var l=a;l=1},n.prototype.getAdditiveTrack=function(){return this._additiveTrack},n.prototype.addKeyframe=function(e,t,r){this._needsSort=!0;var i=this.keyframes,a=i.length,o=!1,s=yve,l=t;if(Yc(t)){var u=vut(t);s=u,(u===1&&!ha(t[0])||u===2&&!ha(t[0][0]))&&(o=!0)}else if(ha(t)&&!eD(t))s=ZF;else if(Or(t))if(!isNaN(+t))s=ZF;else{var h=gv(t);h&&(l=h,s=QP)}else if(zz(t)){var c=Mt({},l);c.colorStops=Vt(t.colorStops,function(d){return{offset:d.offset,color:gv(d.color)}}),c3e(t)?s=XK:f3e(t)&&(s=YK),l=c}a===0?this.valType=s:(s!==this.valType||s===yve)&&(o=!0),this.discrete=this.discrete||o;var f={time:e,value:l,rawValue:t,percent:0};return r&&(f.easing=r,f.easingFunc=rn(r)?r:t3e[r]||uie(r)),i.push(f),f},n.prototype.prepare=function(e,t){var r=this.keyframes;this._needsSort&&r.sort(function(p,g){return p.time-g.time});for(var i=this.valType,a=r.length,o=r[a-1],s=this.discrete,l=KF(i),u=mve(i),h=0;h=0&&!(o[h].percent<=t);h--);h=f(h,s-2)}else{for(h=c;ht);h++);h=f(h-1,s-2)}v=o[h+1],d=o[h]}if(!!(d&&v)){this._lastFr=h,this._lastFrP=t;var g=v.percent-d.percent,m=g===0?1:f((t-d.percent)/g,1);v.easingFunc&&(m=v.easingFunc(m));var y=r?this._additiveValue:u?jL:e[l];if((KF(a)||u)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=m<1?d.rawValue:v.rawValue;else if(KF(a))a===bB?tH(y,d[i],v[i],m):cut(y,d[i],v[i],m);else if(mve(a)){var _=d[i],x=v[i],S=a===XK;e[l]={type:S?"linear":"radial",x:p1(_.x,x.x,m),y:p1(_.y,x.y,m),colorStops:Vt(_.colorStops,function(b,E){var T=x.colorStops[E];return{offset:p1(b.offset,T.offset,m),color:wB(tH([],b.color,T.color,m))}}),global:x.global},S?(e[l].x2=p1(_.x2,x.x2,m),e[l].y2=p1(_.y2,x.y2,m)):e[l].r=p1(_.r,x.r,m)}else if(u)tH(y,d[i],v[i],m),r||(e[l]=wB(y));else{var w=p1(d[i],v[i],m);r?this._additiveValue=w:e[l]=w}r&&this._addToTarget(e)}}},n.prototype._addToTarget=function(e){var t=this.valType,r=this.propName,i=this._additiveValue;t===ZF?e[r]=e[r]+i:t===QP?(gv(e[r],jL),qF(jL,jL,i,1),e[r]=wB(jL)):t===bB?qF(e[r],e[r],i,1):t===g3e&&gve(e[r],e[r],i,1)},n}(),cie=function(){function n(e,t,r,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&i){rie("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=r}return n.prototype.getMaxTime=function(){return this._maxTime},n.prototype.getDelay=function(){return this._delay},n.prototype.getLoop=function(){return this._loop},n.prototype.getTarget=function(){return this._target},n.prototype.changeTarget=function(e){this._target=e},n.prototype.when=function(e,t,r){return this.whenWithKeys(e,t,Li(t),r)},n.prototype.whenWithKeys=function(e,t,r,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,HO(u),i),this._trackKeys.push(s)}l.addKeyframe(e,HO(t[s]),i)}return this._maxTime=Math.max(this._maxTime,e),this},n.prototype.pause=function(){this._clip.pause(),this._paused=!0},n.prototype.resume=function(){this._clip.resume(),this._paused=!1},n.prototype.isPaused=function(){return!!this._paused},n.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},n.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,r=0;r0)){this._started=1;for(var t=this,r=[],i=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},n}();function hA(){return new Date().getTime()}var gut=function(n){$e(e,n);function e(t){var r=n.call(this)||this;return r._running=!1,r._time=0,r._pausedTime=0,r._pauseStart=0,r._paused=!1,t=t||{},r.stage=t.stage||{},r}return e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var r=t.getClip();r&&this.addClip(r)},e.prototype.removeClip=function(t){if(!!t.animation){var r=t.prev,i=t.next;r?r.next=i:this._head=i,i?i.prev=r:this._tail=r,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var r=t.getClip();r&&this.removeClip(r),t.animation=null},e.prototype.update=function(t){for(var r=hA()-this._pausedTime,i=r-this._time,a=this._head;a;){var o=a.next,s=a.step(r,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=r,t||(this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function r(){t._running&&(zK(r),!t._paused&&t.update())}zK(r)},e.prototype.start=function(){this._running||(this._time=hA(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=hA(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=hA()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var r=t.next;t.prev=t.next=t.animation=null,t=r}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,r){r=r||{},this.start();var i=new cie(t,r.loop);return this.addAnimator(i),i},e}(ng);const yut=gut;var mut=300,rH=sa.domSupported,nH=function(){var n=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},r=Vt(n,function(i){var a=i.replace("mouse","pointer");return t.hasOwnProperty(a)?a:i});return{mouse:n,touch:e,pointer:r}}(),_ve={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},xve=!1;function qK(n){var e=n.pointerType;return e==="pen"||e==="touch"}function _ut(n){n.touching=!0,n.touchTimer!=null&&(clearTimeout(n.touchTimer),n.touchTimer=null),n.touchTimer=setTimeout(function(){n.touching=!1,n.touchTimer=null},700)}function iH(n){n&&(n.zrByTouch=!0)}function xut(n,e){return lp(n.dom,new Sut(n,e),!0)}function y3e(n,e){for(var t=e,r=!1;t&&t.nodeType!==9&&!(r=t.domBelongToZr||t!==e&&t===n.painterRoot);)t=t.parentNode;return r}var Sut=function(){function n(e,t){this.stopPropagation=Hl,this.stopImmediatePropagation=Hl,this.preventDefault=Hl,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return n}(),Dg={mousedown:function(n){n=lp(this.dom,n),this.__mayPointerCapture=[n.zrX,n.zrY],this.trigger("mousedown",n)},mousemove:function(n){n=lp(this.dom,n);var e=this.__mayPointerCapture;e&&(n.zrX!==e[0]||n.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",n)},mouseup:function(n){n=lp(this.dom,n),this.__togglePointerCapture(!1),this.trigger("mouseup",n)},mouseout:function(n){n=lp(this.dom,n);var e=n.toElement||n.relatedTarget;y3e(this,e)||(this.__pointerCapturing&&(n.zrEventControl="no_globalout"),this.trigger("mouseout",n))},wheel:function(n){xve=!0,n=lp(this.dom,n),this.trigger("mousewheel",n)},mousewheel:function(n){xve||(n=lp(this.dom,n),this.trigger("mousewheel",n))},touchstart:function(n){n=lp(this.dom,n),iH(n),this.__lastTouchMoment=new Date,this.handler.processGesture(n,"start"),Dg.mousemove.call(this,n),Dg.mousedown.call(this,n)},touchmove:function(n){n=lp(this.dom,n),iH(n),this.handler.processGesture(n,"change"),Dg.mousemove.call(this,n)},touchend:function(n){n=lp(this.dom,n),iH(n),this.handler.processGesture(n,"end"),Dg.mouseup.call(this,n),+new Date-+this.__lastTouchMomentbve||n<-bve}var qw=[],VT=[],oH=Up(),sH=Math.abs,Aut=function(){function n(){}return n.prototype.getLocalTransform=function(e){return n.getLocalTransform(this,e)},n.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},n.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},n.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},n.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},n.prototype.needLocalTransform=function(){return Yw(this.rotation)||Yw(this.x)||Yw(this.y)||Yw(this.scaleX-1)||Yw(this.scaleY-1)||Yw(this.skewX)||Yw(this.skewY)},n.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),r=this.transform;if(!(t||e)){r&&(wve(r),this.invTransform=null);return}r=r||Up(),t?this.getLocalTransform(r):wve(r),e&&(t?$1(r,e,r):sie(r,e)),this.transform=r,this._resolveGlobalScaleRatio(r)},n.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(qw);var r=qw[0]<0?-1:1,i=qw[1]<0?-1:1,a=((qw[0]-r)*t+r)/qw[0]||0,o=((qw[1]-i)*t+i)/qw[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||Up(),LI(this.invTransform,e)},n.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},n.prototype.setLocalTransform=function(e){if(!!e){var t=e[0]*e[0]+e[1]*e[1],r=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),a=Math.PI/2+i-Math.atan2(e[3],e[2]);r=Math.sqrt(r)*Math.cos(a),t=Math.sqrt(t),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=r,this.originX=0,this.originY=0}},n.prototype.decomposeTransform=function(){if(!!this.transform){var e=this.parent,t=this.transform;e&&e.transform&&($1(VT,e.invTransform,t),t=VT);var r=this.originX,i=this.originY;(r||i)&&(oH[4]=r,oH[5]=i,$1(VT,t,oH),VT[4]-=r,VT[5]-=i,t=VT),this.setLocalTransform(t)}},n.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},n.prototype.transformCoordToLocal=function(e,t){var r=[e,t],i=this.invTransform;return i&&cc(r,r,i),r},n.prototype.transformCoordToGlobal=function(e,t){var r=[e,t],i=this.transform;return i&&cc(r,r,i),r},n.prototype.getLineScale=function(){var e=this.transform;return e&&sH(e[0]-1)>1e-10&&sH(e[3]-1)>1e-10?Math.sqrt(sH(e[0]*e[3]-e[2]*e[1])):1},n.prototype.copyTransform=function(e){_3e(this,e)},n.getLocalTransform=function(e,t){t=t||[];var r=e.originX||0,i=e.originY||0,a=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,h=e.x,c=e.y,f=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(r||i||s||l){var v=r+s,p=i+l;t[4]=-v*a-f*p*o,t[5]=-p*o-d*v*a}else t[4]=t[5]=0;return t[0]=a,t[3]=o,t[1]=d*a,t[2]=f*o,u&&j2(t,t,u),t[4]+=r+h,t[5]+=i+c,t},n.initDefaultProps=function(){var e=n.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),n}(),lm=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function _3e(n,e){for(var t=0;t=0?parseFloat(n)/100*e:parseFloat(n):n}function iG(n,e,t){var r=e.position||"inside",i=e.distance!=null?e.distance:5,a=t.height,o=t.width,s=a/2,l=t.x,u=t.y,h="left",c="top";if(r instanceof Array)l+=_0(r[0],t.width),u+=_0(r[1],t.height),h=null,c=null;else switch(r){case"left":l-=i,u+=s,h="right",c="middle";break;case"right":l+=i+o,u+=s,c="middle";break;case"top":l+=o/2,u-=i,h="center",c="bottom";break;case"bottom":l+=o/2,u+=a+i,h="center";break;case"inside":l+=o/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=i,u+=s,c="middle";break;case"insideRight":l+=o-i,u+=s,h="right",c="middle";break;case"insideTop":l+=o/2,u+=i,h="center";break;case"insideBottom":l+=o/2,u+=a-i,h="center",c="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,h="right";break;case"insideBottomLeft":l+=i,u+=a-i,c="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,h="right",c="bottom";break}return n=n||{},n.x=l,n.y=u,n.align=h,n.verticalAlign=c,n}var lH="__zr_normal__",uH=lm.concat(["ignore"]),Mut=om(lm,function(n,e){return n[e]=!0,n},{ignore:!1}),$T={},Iut=new ai(0,0,0,0),fie=function(){function n(e){this.id=HNe(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return n.prototype._init=function(e){this.attr(e)},n.prototype.drift=function(e,t,r){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.markRedraw()},n.prototype.beforeUpdate=function(){},n.prototype.afterUpdate=function(){},n.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},n.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var r=this.textConfig,i=r.local,a=t.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var u=!1;if(a.copyTransform(t),r.position!=null){var h=Iut;r.layoutRect?h.copy(r.layoutRect):h.copy(this.getBoundingRect()),i||h.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition($T,r,h):iG($T,r,h),a.x=$T.x,a.y=$T.y,o=$T.align,s=$T.verticalAlign;var c=r.origin;if(c&&r.rotation!=null){var f=void 0,d=void 0;c==="center"?(f=h.width*.5,d=h.height*.5):(f=_0(c[0],h.width),d=_0(c[1],h.height)),u=!0,a.originX=-a.x+f+(i?0:h.x),a.originY=-a.y+d+(i?0:h.y)}}r.rotation!=null&&(a.rotation=r.rotation);var v=r.offset;v&&(a.x+=v[0],a.y+=v[1],u||(a.originX=-v[0],a.originY=-v[1]));var p=r.inside==null?typeof r.position=="string"&&r.position.indexOf("inside")>=0:r.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,y=void 0,_=void 0;p&&this.canBeInsideText()?(m=r.insideFill,y=r.insideStroke,(m==null||m==="auto")&&(m=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(m),_=!0)):(m=r.outsideFill,y=r.outsideStroke,(m==null||m==="auto")&&(m=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(m),_=!0)),m=m||"#000",(m!==g.fill||y!==g.stroke||_!==g.autoStroke||o!==g.align||s!==g.verticalAlign)&&(l=!0,g.fill=m,g.stroke=y,g.autoStroke=_,g.align=o,g.verticalAlign=s,t.setDefaultTextStyle(g)),t.__dirty|=ov,l&&t.dirtyStyle(!0)}},n.prototype.canBeInsideText=function(){return!0},n.prototype.getInsideTextFill=function(){return"#fff"},n.prototype.getInsideTextStroke=function(e){return"#000"},n.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?QK:JK},n.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),r=typeof t=="string"&&gv(t);r||(r=[255,255,255,1]);for(var i=r[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)r[o]=r[o]*i+(a?0:255)*(1-i);return r[3]=1,W1(r,"rgba")},n.prototype.traverse=function(e,t){},n.prototype.attrKV=function(e,t){e==="textConfig"?this.setTextConfig(t):e==="textContent"?this.setTextContent(t):e==="clipPath"?this.setClipPath(t):e==="extra"?(this.extra=this.extra||{},Mt(this.extra,t)):this[e]=t},n.prototype.hide=function(){this.ignore=!0,this.markRedraw()},n.prototype.show=function(){this.ignore=!1,this.markRedraw()},n.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(dn(e))for(var r=e,i=Li(r),a=0;a0},n.prototype.getState=function(e){return this.states[e]},n.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},n.prototype.clearStates=function(e){this.useState(lH,!1,e)},n.prototype.useState=function(e,t,r,i){var a=e===lH,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(gi(s,e)>=0&&(t||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){rie("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var h=!!(u&&u.hoverLayer||i);h&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,u,this._normalState,t,!r&&!this.__inHover&&l&&l.duration>0,l);var c=this._textContent,f=this._textGuide;return c&&c.useState(e,t,r,h),f&&f.useState(e,t,r,h),a?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ov),u}}},n.prototype.useStates=function(e,t,r){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l0,v);var p=this._textContent,g=this._textGuide;p&&p.useStates(e,t,f),g&&g.useStates(e,t,f),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ov)}},n.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var r=this.currentStates.slice();r.splice(t,1),this.useStates(r)}},n.prototype.replaceState=function(e,t,r){var i=this.currentStates.slice(),a=gi(i,e),o=gi(i,t)>=0;a>=0?o?i.splice(a,1):i[a]=t:r&&!o&&i.push(t),this.useStates(i)},n.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},n.prototype._mergeStates=function(e){for(var t={},r,i=0;i=0&&a.splice(o,1)}),this.animators.push(e),r&&r.animation.addAnimator(e),r&&r.wakeUp()},n.prototype.updateDuringAnimation=function(e){this.markRedraw()},n.prototype.stopAnimation=function(e,t){for(var r=this.animators,i=r.length,a=[],o=0;o0&&t.during&&a[0].during(function(v,p){t.during(p)});for(var f=0;f0||i.force&&!o.length){var E=void 0,T=void 0,C=void 0;if(s){T={},f&&(E={});for(var x=0;x<_;x++){var m=p[x];T[m]=t[m],f?E[m]=r[m]:t[m]=r[m]}}else if(f){C={};for(var x=0;x<_;x++){var m=p[x];C[m]=HO(t[m]),Put(t,r,m)}}var S=new cie(t,!1,!1,c?To(v,function(M){return M.targetName===e}):null);S.targetName=e,i.scope&&(S.scope=i.scope),f&&E&&S.whenWithKeys(0,E,p),C&&S.whenWithKeys(0,C,p),S.whenWithKeys(u==null?500:u,s?T:r,p).delay(h||0),n.addAnimator(S,e),o.push(S)}}const S3e=fie;var w3e=function(n){$e(e,n);function e(t){var r=n.call(this)||this;return r.isGroup=!0,r._children=[],r.attr(t),r}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var r=this._children,i=0;i=0&&(i.splice(a,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,r){var i=gi(this._children,t);return i>=0&&this.replaceAt(r,i),this},e.prototype.replaceAt=function(t,r){var i=this._children,a=i[r];if(t&&t!==this&&t.parent!==this&&t!==a){i[r]=t,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var r=this.__zr;r&&r!==t.__zr&&t.addSelfToZr(r),r&&r.refresh()},e.prototype.remove=function(t){var r=this.__zr,i=this._children,a=gi(i,t);return a<0?this:(i.splice(a,1),t.parent=null,r&&t.removeSelfFromZr(r),r&&r.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,r=this.__zr,i=0;i0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},n.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},n.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},n.prototype.refreshHover=function(){this._needsRefreshHover=!0},n.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover()},n.prototype.resize=function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},n.prototype.clearAnimation=function(){this.animation.clear()},n.prototype.getWidth=function(){return this.painter.getWidth()},n.prototype.getHeight=function(){return this.painter.getHeight()},n.prototype.setCursorStyle=function(e){this.handler.setCursorStyle(e)},n.prototype.findHover=function(e,t){return this.handler.findHover(e,t)},n.prototype.on=function(e,t,r){return this.handler.on(e,t,r),this},n.prototype.off=function(e,t){this.handler.off(e,t)},n.prototype.trigger=function(e,t){this.handler.trigger(e,t)},n.prototype.clear=function(){for(var e=this.storage.getRoots(),t=0;t0){if(n<=i)return o;if(n>=a)return s}else{if(n>=i)return o;if(n<=a)return s}else{if(n===i)return o;if(n===a)return s}return(n-i)/l*u+o}function xr(n,e){switch(n){case"center":case"middle":n="50%";break;case"left":case"top":n="0%";break;case"right":case"bottom":n="100%";break}return Or(n)?But(n).match(/%$/)?parseFloat(n)/100*e:parseFloat(n):n==null?NaN:+n}function Pl(n,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),E3e),n=(+n).toFixed(e),t?n:+n}function Op(n){return n.sort(function(e,t){return e-t}),n}function Ny(n){if(n=+n,isNaN(n))return 0;if(n>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(n*e)/e===n)return t}return Gut(n)}function Gut(n){var e=n.toString().toLowerCase(),t=e.indexOf("e"),r=t>0?+e.slice(t+1):0,i=t>0?t:e.length,a=e.indexOf("."),o=a<0?0:i-1-a;return Math.max(0,o-r)}function T3e(n,e){var t=Math.log,r=Math.LN10,i=Math.floor(t(n[1]-n[0])/r),a=Math.round(t(Math.abs(e[1]-e[0]))/r),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function zut(n,e){var t=om(n,function(d,v){return d+(isNaN(v)?0:v)},0);if(t===0)return[];for(var r=Math.pow(10,e),i=Vt(n,function(d){return(isNaN(d)?0:d)/t*r*100}),a=r*100,o=Vt(i,function(d){return Math.floor(d)}),s=om(o,function(d,v){return d+v},0),l=Vt(i,function(d,v){return d-o[v]});su&&(u=l[c],h=c);++o[h],l[h]=0,++s}return Vt(o,function(d){return d/r})}function Uut(n,e){var t=Math.max(Ny(n),Ny(e)),r=n+e;return t>E3e?r:Pl(r,t)}var Mve=9007199254740991;function C3e(n){var e=Math.PI*2;return(n%e+e)%e}function aG(n){return n>-Ave&&n=10&&e++,e}function A3e(n,e){var t=die(n),r=Math.pow(10,t),i=n/r,a;return e?i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10:i<1?a=1:i<2?a=2:i<3?a=3:i<5?a=5:a=10,n=a*r,t>=-20?+n.toFixed(t<0?-t:0):n}function fH(n,e){var t=(n.length-1)*e+1,r=Math.floor(t),i=+n[r-1],a=t-r;return a?i+a*(n[r]-i):i}function Ive(n){n.sort(function(l,u){return s(l,u,0)?-1:1});for(var e=-1/0,t=1,r=0;r=0||a&&gi(a,l)<0)){var u=r.getShallow(l,e);u!=null&&(o[n[s][0]]=u)}}return o}}var dht=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],vht=qE(dht),pht=function(){function n(){}return n.prototype.getAreaStyle=function(e,t){return vht(this,e,t)},n}(),tJ=new d3(50);function ght(n){if(typeof n=="string"){var e=tJ.get(n);return e&&e.image}else return n}function yie(n,e,t,r,i){if(n)if(typeof n=="string"){if(e&&e.__zrImageSrc===n||!t)return e;var a=tJ.get(n),o={hostEl:t,cb:r,cbPayload:i};return a?(e=a.image,!jz(e)&&a.pending.push(o)):(e=s_.loadImage(n,Rve,Rve),e.__zrImageSrc=n,tJ.put(n,e.__cachedImgObj={image:e,pending:[o]})),e}else return n;else return e}function Rve(){var n=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=o;l++)s-=o;var u=yv(t,e);return u>s&&(t="",u=0),s=n-u,i.ellipsis=t,i.ellipsisWidth=u,i.contentWidth=s,i.containerWidth=n,i}function z3e(n,e){var t=e.containerWidth,r=e.font,i=e.contentWidth;if(!t)return"";var a=yv(n,r);if(a<=t)return n;for(var o=0;;o++){if(a<=i||o>=e.maxIterations){n+=e.ellipsis;break}var s=o===0?mht(n,i,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(n.length*i/a):0;n=n.substr(0,s),a=yv(n,r)}return n===""&&(n=e.placeholder),n}function mht(n,e,t,r){for(var i=0,a=0,o=n.length;ad&&u){var v=Math.floor(d/s);c=c.slice(0,v)}if(n&&a&&h!=null)for(var p=G3e(h,i,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),g=0;gs&&vH(t,n.substring(s,u),e,o),vH(t,l[2],e,o,l[1]),s=dH.lastIndex}si){S>0?(y.tokens=y.tokens.slice(0,S),g(y,x,_),t.lines=t.lines.slice(0,m+1)):t.lines=t.lines.slice(0,m);break e}var M=b.width,I=M==null||M==="auto";if(typeof M=="string"&&M.charAt(M.length-1)==="%")w.percentWidth=M,h.push(w),w.contentWidth=yv(w.text,C);else{if(I){var R=b.backgroundColor,k=R&&R.image;k&&(k=ght(k),jz(k)&&(w.width=Math.max(w.width,k.width*A/k.height)))}var D=v&&r!=null?r-x:null;D!=null&&D0&&v+r.accumWidth>r.width&&(h=e.split(` `),u=!0),r.accumWidth=v}else{var p=U3e(e,l,r.width,r.breakAll,r.accumWidth);r.accumWidth=p.accumWidth+d,c=p.linesWidths,h=p.lines}}else h=e.split(` `);for(var g=0;g=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var Eht=om(",&?/;] ".split(""),function(n,e){return n[e]=!0,n},{});function Tht(n){return bht(n)?!!Eht[n]:!0}function U3e(n,e,t,r,i){for(var a=[],o=[],s="",l="",u=0,h=0,c=0;ct:i+h+d>t){h?(s||l)&&(v?(s||(s=l,l="",u=0,h=u),a.push(s),o.push(h-u),l+=f,u+=d,s="",h=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(h),s=f,h=d)):v?(a.push(l),o.push(u),l=f,u=d):(a.push(f),o.push(d));continue}h+=d,v?(l+=f,u+=d):(l&&(s+=l,l="",u=0),s+=f)}return!a.length&&!s&&(s=n,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(h)),a.length===1&&(h+=i),{accumWidth:h,lines:a,linesWidths:o}}var rJ="__zr_style_"+Math.round(Math.random()*10),EE={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Xz={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};EE[rJ]=!0;var Nve=["z","z2","invisible"],Cht=["invisible"],Aht=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype._init=function(t){for(var r=Li(t),i=0;i1e-4){s[0]=n-t,s[1]=e-r,l[0]=n+t,l[1]=e+r;return}if(JF[0]=mH(i)*t+n,JF[1]=yH(i)*r+e,QF[0]=mH(a)*t+n,QF[1]=yH(a)*r+e,u(s,JF,QF),h(l,JF,QF),i=i%Kw,i<0&&(i=i+Kw),a=a%Kw,a<0&&(a=a+Kw),i>a&&!o?a+=Kw:ii&&(e4[0]=mH(d)*t+n,e4[1]=yH(d)*r+e,u(s,e4,s),h(l,e4,l))}var Ho={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Jw=[],Qw=[],J0=[],rx=[],Q0=[],ey=[],_H=Math.min,xH=Math.max,eb=Math.cos,tb=Math.sin,qm=Math.abs,nJ=Math.PI,Tx=nJ*2,SH=typeof Float32Array<"u",XL=[];function wH(n){var e=Math.round(n/nJ*1e8)/1e8;return e%2*nJ}function V3e(n,e){var t=wH(n[0]);t<0&&(t+=Tx);var r=t-n[0],i=n[1];i+=r,!e&&i-t>=Tx?i=t+Tx:e&&t-i>=Tx?i=t-Tx:!e&&t>i?i=t+(Tx-wH(t-i)):e&&t0&&(this._ux=qm(r/nG/e)||0,this._uy=qm(r/nG/t)||0)},n.prototype.setDPR=function(e){this.dpr=e},n.prototype.setContext=function(e){this._ctx=e},n.prototype.getContext=function(){return this._ctx},n.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},n.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},n.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Ho.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},n.prototype.lineTo=function(e,t){var r=qm(e-this._xi),i=qm(t-this._yi),a=r>this._ux||i>this._uy;if(this.addData(Ho.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=r*r+i*i;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},n.prototype.bezierCurveTo=function(e,t,r,i,a,o){return this._drawPendingPt(),this.addData(Ho.C,e,t,r,i,a,o),this._ctx&&this._ctx.bezierCurveTo(e,t,r,i,a,o),this._xi=a,this._yi=o,this},n.prototype.quadraticCurveTo=function(e,t,r,i){return this._drawPendingPt(),this.addData(Ho.Q,e,t,r,i),this._ctx&&this._ctx.quadraticCurveTo(e,t,r,i),this._xi=r,this._yi=i,this},n.prototype.arc=function(e,t,r,i,a,o){this._drawPendingPt(),XL[0]=i,XL[1]=a,V3e(XL,o),i=XL[0],a=XL[1];var s=a-i;return this.addData(Ho.A,e,t,r,r,i,s,0,o?0:1),this._ctx&&this._ctx.arc(e,t,r,i,a,o),this._xi=eb(a)*r+e,this._yi=tb(a)*r+t,this},n.prototype.arcTo=function(e,t,r,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,r,i,a),this},n.prototype.rect=function(e,t,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,r,i),this.addData(Ho.R,e,t,r,i),this},n.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ho.Z);var e=this._ctx,t=this._x0,r=this._y0;return e&&e.closePath(),this._xi=t,this._yi=r,this},n.prototype.fill=function(e){e&&e.fill(),this.toStatic()},n.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},n.prototype.len=function(){return this._len},n.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&SH&&(this.data=new Float32Array(t));for(var r=0;rh.length&&(this._expandData(),h=this.data);for(var c=0;c0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},n.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},n.prototype.getBoundingRect=function(){J0[0]=J0[1]=Q0[0]=Q0[1]=Number.MAX_VALUE,rx[0]=rx[1]=ey[0]=ey[1]=-Number.MAX_VALUE;var e=this.data,t=0,r=0,i=0,a=0,o;for(o=0;or||qm(_)>i||f===t-1)&&(p=Math.sqrt(y*y+_*_),a=g,o=m);break}case Ho.C:{var x=e[f++],S=e[f++],g=e[f++],m=e[f++],w=e[f++],b=e[f++];p=Xlt(a,o,x,S,g,m,w,b,10),a=w,o=b;break}case Ho.Q:{var x=e[f++],S=e[f++],g=e[f++],m=e[f++];p=qlt(a,o,x,S,g,m,10),a=g,o=m;break}case Ho.A:var E=e[f++],T=e[f++],C=e[f++],A=e[f++],M=e[f++],I=e[f++],R=I+M;f+=1,e[f++],v&&(s=eb(M)*C+E,l=tb(M)*A+T),p=xH(C,A)*_H(Tx,Math.abs(I)),a=eb(R)*C+E,o=tb(R)*A+T;break;case Ho.R:{s=a=e[f++],l=o=e[f++];var k=e[f++],D=e[f++];p=k*2+D*2;break}case Ho.Z:{var y=s-a,_=l-o;p=Math.sqrt(y*y+_*_),a=s,o=l;break}}p>=0&&(u[c++]=p,h+=p)}return this._pathLen=h,h},n.prototype.rebuildPath=function(e,t){var r=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,h,c,f,d=t<1,v,p,g=0,m=0,y,_=0,x,S;if(d&&(this._pathSegLen||this._calculateLength(),v=this._pathSegLen,p=this._pathLen,y=t*p,!y))return;e:for(var w=0;w0&&(e.lineTo(x,S),_=0),b){case Ho.M:s=u=r[w++],l=h=r[w++],e.moveTo(u,h);break;case Ho.L:{c=r[w++],f=r[w++];var T=qm(c-u),C=qm(f-h);if(T>i||C>a){if(d){var A=v[m++];if(g+A>y){var M=(y-g)/A;e.lineTo(u*(1-M)+c*M,h*(1-M)+f*M);break e}g+=A}e.lineTo(c,f),u=c,h=f,_=0}else{var I=T*T+C*C;I>_&&(x=c,S=f,_=I)}break}case Ho.C:{var R=r[w++],k=r[w++],D=r[w++],G=r[w++],W=r[w++],z=r[w++];if(d){var A=v[m++];if(g+A>y){var M=(y-g)/A;DS(u,R,D,W,M,Jw),DS(h,k,G,z,M,Qw),e.bezierCurveTo(Jw[1],Qw[1],Jw[2],Qw[2],Jw[3],Qw[3]);break e}g+=A}e.bezierCurveTo(R,k,D,G,W,z),u=W,h=z;break}case Ho.Q:{var R=r[w++],k=r[w++],D=r[w++],G=r[w++];if(d){var A=v[m++];if(g+A>y){var M=(y-g)/A;tD(u,R,D,M,Jw),tD(h,k,G,M,Qw),e.quadraticCurveTo(Jw[1],Qw[1],Jw[2],Qw[2]);break e}g+=A}e.quadraticCurveTo(R,k,D,G),u=D,h=G;break}case Ho.A:var V=r[w++],q=r[w++],Y=r[w++],le=r[w++],j=r[w++],Q=r[w++],ie=r[w++],oe=!r[w++],se=Y>le?Y:le,me=qm(Y-le)>.001,Ce=j+Q,Le=!1;if(d){var A=v[m++];g+A>y&&(Ce=j+Q*(y-g)/A,Le=!0),g+=A}if(me&&e.ellipse?e.ellipse(V,q,Y,le,ie,j,Ce,oe):e.arc(V,q,se,j,Ce,oe),Le)break e;E&&(s=eb(j)*Y+V,l=tb(j)*le+q),u=eb(Ce)*Y+V,h=tb(Ce)*le+q;break;case Ho.R:s=u=r[w],l=h=r[w+1],c=r[w++],f=r[w++];var re=r[w++],yt=r[w++];if(d){var A=v[m++];if(g+A>y){var je=y-g;e.moveTo(c,f),e.lineTo(c+_H(je,re),f),je-=re,je>0&&e.lineTo(c+re,f+_H(je,yt)),je-=yt,je>0&&e.lineTo(c+xH(re-je,0),f+yt),je-=re,je>0&&e.lineTo(c,f+xH(yt-je,0));break e}g+=A}e.rect(c,f,re,yt);break;case Ho.Z:if(d){var A=v[m++];if(g+A>y){var M=(y-g)/A;e.lineTo(u*(1-M)+s*M,h*(1-M)+l*M);break e}g+=A}e.closePath(),u=s,h=l}}},n.prototype.clone=function(){var e=new n,t=this.data;return e.data=t.slice?t.slice():Array.prototype.slice.call(t),e._len=this._len,e},n.CMD=Ho,n.initDefaultProps=function(){var e=n.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),n}();const hm=Oht;function Nx(n,e,t,r,i,a,o){if(i===0)return!1;var s=i,l=0,u=n;if(o>e+s&&o>r+s||on+s&&a>t+s||ae+c&&h>r+c&&h>a+c&&h>s+c||hn+c&&u>t+c&&u>i+c&&u>o+c||ue+u&&l>r+u&&l>a+u||ln+u&&s>t+u&&s>i+u||st||h+ui&&(i+=YL);var f=Math.atan2(l,s);return f<0&&(f+=YL),f>=r&&f<=i||f+YL>=r&&f+YL<=i}function g1(n,e,t,r,i,a){if(a>e&&a>r||ai?s:0}var nx=hm.CMD,rb=Math.PI*2,Nht=1e-4;function kht(n,e){return Math.abs(n-e)e&&u>r&&u>a&&u>s||u1&&Fht(),d=Qu(e,r,a,s,gp[0]),f>1&&(v=Qu(e,r,a,s,gp[1]))),f===2?ge&&s>r&&s>a||s=0&&u<=1){for(var h=0,c=Ph(e,r,a,u),f=0;ft||s<-t)return 0;var l=Math.sqrt(t*t-s*s);Sf[0]=-l,Sf[1]=l;var u=Math.abs(r-i);if(u<1e-4)return 0;if(u>=rb-1e-4){r=0,i=rb;var h=a?1:-1;return o>=Sf[0]+n&&o<=Sf[1]+n?h:0}if(r>i){var c=r;r=i,i=c}r<0&&(r+=rb,i+=rb);for(var f=0,d=0;d<2;d++){var v=Sf[d];if(v+n>o){var p=Math.atan2(s,v),h=a?1:-1;p<0&&(p=rb+p),(p>=r&&p<=i||p+rb>=r&&p+rb<=i)&&(p>Math.PI/2&&p1&&(t||(s+=g1(l,u,h,c,r,i))),g&&(l=a[v],u=a[v+1],h=l,c=u),p){case nx.M:h=a[v++],c=a[v++],l=h,u=c;break;case nx.L:if(t){if(Nx(l,u,a[v],a[v+1],e,r,i))return!0}else s+=g1(l,u,a[v],a[v+1],r,i)||0;l=a[v++],u=a[v++];break;case nx.C:if(t){if(Rht(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],e,r,i))return!0}else s+=Bht(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],r,i)||0;l=a[v++],u=a[v++];break;case nx.Q:if(t){if($3e(l,u,a[v++],a[v++],a[v],a[v+1],e,r,i))return!0}else s+=Ght(l,u,a[v++],a[v++],a[v],a[v+1],r,i)||0;l=a[v++],u=a[v++];break;case nx.A:var m=a[v++],y=a[v++],_=a[v++],x=a[v++],S=a[v++],w=a[v++];v+=1;var b=!!(1-a[v++]);f=Math.cos(S)*_+m,d=Math.sin(S)*x+y,g?(h=f,c=d):s+=g1(l,u,f,d,r,i);var E=(r-m)*x/_+m;if(t){if(Dht(m,y,x,S,S+w,b,e,E,i))return!0}else s+=zht(m,y,x,S,S+w,b,E,i);l=Math.cos(S+w)*_+m,u=Math.sin(S+w)*x+y;break;case nx.R:h=l=a[v++],c=u=a[v++];var T=a[v++],C=a[v++];if(f=h+T,d=c+C,t){if(Nx(h,c,f,c,e,r,i)||Nx(f,c,f,d,e,r,i)||Nx(f,d,h,d,e,r,i)||Nx(h,d,h,c,e,r,i))return!0}else s+=g1(f,c,f,d,r,i),s+=g1(h,d,h,c,r,i);break;case nx.Z:if(t){if(Nx(l,u,h,c,e,r,i))return!0}else s+=g1(l,u,h,c,r,i);l=h,u=c;break}}return!t&&!kht(u,c)&&(s+=g1(l,u,h,c,r,i)||0),s!==0}function Uht(n,e,t){return W3e(n,0,!1,e,t)}function Vht(n,e,t,r){return W3e(n,e,!0,t,r)}var oG=sn({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},EE),$ht={style:sn({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Xz.style)},bH=lm.concat(["invisible","culling","z","z2","zlevel","parent"]),Wht=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.update=function(){var t=this;n.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new e;i.buildPath===e.prototype.buildPath&&(i.buildPath=function(l){t.buildPath(l,t.shape)}),i.silent=!0;var a=i.style;for(var o in r)a[o]!==r[o]&&(a[o]=r[o]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var s=0;s.5?JK:r>.2?Cut:QK}else if(t)return QK}return JK},e.prototype.getInsideTextStroke=function(t){var r=this.style.fill;if(Or(r)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=tG(t,0)0))},e.prototype.hasFill=function(){var t=this.style,r=t.fill;return r!=null&&r!=="none"},e.prototype.getBoundingRect=function(){var t=this._rect,r=this.style,i=!t;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&BC)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||i){s.copy(t);var l=r.strokeNoScale?this.getLineScale():1,u=r.lineWidth;if(!this.hasFill()){var h=this.strokeContainThreshold;u=Math.max(u,h==null?4:h)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return t},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect(),o=this.style;if(t=i[0],r=i[1],a.contain(t,r)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),Vht(s,l/u,t,r)))return!0}if(this.hasFill())return Uht(s,t,r)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=BC,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():t==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(t,r){t==="shape"?this.setShape(r):n.prototype.attrKV.call(this,t,r)},e.prototype.setShape=function(t,r){var i=this.shape;return i||(i=this.shape={}),typeof t=="string"?i[t]=r:Mt(i,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&BC)},e.prototype.createStyle=function(t){return Uz(oG,t)},e.prototype._innerSaveToNormal=function(t){n.prototype._innerSaveToNormal.call(this,t);var r=this._normalState;t.shape&&!r.shape&&(r.shape=Mt({},this.shape))},e.prototype._applyStateObj=function(t,r,i,a,o,s){n.prototype._applyStateObj.call(this,t,r,i,a,o,s);var l=!(r&&a),u;if(r&&r.shape?o?a?u=r.shape:(u=Mt({},i.shape),Mt(u,r.shape)):(u=Mt({},a?this.shape:i.shape),Mt(u,r.shape)):l&&(u=i.shape),u)if(o){this.shape=Mt({},this.shape);for(var h={},c=Li(u),f=0;f0},e.prototype.hasFill=function(){var t=this.style,r=t.fill;return r!=null&&r!=="none"},e.prototype.createStyle=function(t){return Uz(Hht,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var r=t.text;r!=null?r+="":r="";var i=v3(r,t.font,t.textAlign,t.textBaseline);if(i.x+=t.x||0,i.y+=t.y||0,this.hasStroke()){var a=t.lineWidth;i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a}this._rect=i}return this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(Vp);H3e.prototype.type="tspan";const aD=H3e;var jht=sn({x:0,y:0},EE),Xht={style:sn({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Xz.style)};function Yht(n){return!!(n&&typeof n!="string"&&n.width&&n.height)}var j3e=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.createStyle=function(t){return Uz(jht,t)},e.prototype._getSize=function(t){var r=this.style,i=r[t];if(i!=null)return i;var a=Yht(r.image)?r.image:this.__image;if(!a)return 0;var o=t==="width"?"height":"width",s=r[o];return s==null?a[t]:a[t]/a[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return Xht},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new ai(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(Vp);j3e.prototype.type="image";const xc=j3e;function qht(n,e){var t=e.x,r=e.y,i=e.width,a=e.height,o=e.r,s,l,u,h;i<0&&(t=t+i,i=-i),a<0&&(r=r+a,a=-a),typeof o=="number"?s=l=u=h=o:o instanceof Array?o.length===1?s=l=u=h=o[0]:o.length===2?(s=u=o[0],l=h=o[1]):o.length===3?(s=o[0],l=h=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],h=o[3]):s=l=u=h=0;var c;s+l>i&&(c=s+l,s*=i/c,l*=i/c),u+h>i&&(c=u+h,u*=i/c,h*=i/c),l+u>a&&(c=l+u,l*=a/c,u*=a/c),s+h>a&&(c=s+h,s*=a/c,h*=a/c),n.moveTo(t+s,r),n.lineTo(t+i-l,r),l!==0&&n.arc(t+i-l,r+l,l,-Math.PI/2,0),n.lineTo(t+i,r+a-u),u!==0&&n.arc(t+i-u,r+a-u,u,0,Math.PI/2),n.lineTo(t+h,r+a),h!==0&&n.arc(t+h,r+a-h,h,Math.PI/2,Math.PI),n.lineTo(t,r+s),s!==0&&n.arc(t+s,r+s,s,Math.PI,Math.PI*1.5)}var cA=Math.round;function X3e(n,e,t){if(!!e){var r=e.x1,i=e.x2,a=e.y1,o=e.y2;n.x1=r,n.x2=i,n.y1=a,n.y2=o;var s=t&&t.lineWidth;return s&&(cA(r*2)===cA(i*2)&&(n.x1=n.x2=rE(r,s,!0)),cA(a*2)===cA(o*2)&&(n.y1=n.y2=rE(a,s,!0))),n}}function Y3e(n,e,t){if(!!e){var r=e.x,i=e.y,a=e.width,o=e.height;n.x=r,n.y=i,n.width=a,n.height=o;var s=t&&t.lineWidth;return s&&(n.x=rE(r,s,!0),n.y=rE(i,s,!0),n.width=Math.max(rE(r+a,s,!1)-n.x,a===0?0:1),n.height=Math.max(rE(i+o,s,!1)-n.y,o===0?0:1)),n}}function rE(n,e,t){if(!e)return n;var r=cA(n*2);return(r+cA(e))%2===0?r/2:(r+(t?1:-1))/2}var Zht=function(){function n(){this.x=0,this.y=0,this.width=0,this.height=0}return n}(),Kht={},q3e=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Zht},e.prototype.buildPath=function(t,r){var i,a,o,s;if(this.subPixelOptimize){var l=Y3e(Kht,r,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=r.r,r=l}else i=r.x,a=r.y,o=r.width,s=r.height;r.r?qht(t,r):t.rect(i,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Si);q3e.prototype.type="rect";const ta=q3e;var zve={fill:"#000"},Uve=2,Jht={style:sn({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Xz.style)},Z3e=function(n){$e(e,n);function e(t){var r=n.call(this)||this;return r.type="text",r._children=[],r._defaultStyle=zve,r.attr(t),r}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){n.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,M=t.width!=null&&(t.overflow==="truncate"||t.overflow==="break"||t.overflow==="breakAll"),I=o.calculatedLineHeight,R=0;R=0&&(R=w[I],R.align==="right");)this._placeToken(R,t,E,m,M,"right",_),T-=R.width,M-=R.width,I--;for(A+=(a-(A-g)-(y-M)-T)/2;C<=I;)R=w[C],this._placeToken(R,t,E,m,A+R.width/2,"center",_),A+=R.width,C++;m+=E}},e.prototype._placeToken=function(t,r,i,a,o,s,l){var u=r.rich[t.styleName]||{};u.text=t.text;var h=t.verticalAlign,c=a+i/2;h==="top"?c=a+t.height/2:h==="bottom"&&(c=a+i-t.height/2);var f=!t.isLineHolder&&EH(u);f&&this._renderBackground(u,r,s==="right"?o-t.width:s==="center"?o-t.width/2:o,c-t.height/2,t.width,t.height);var d=!!u.backgroundColor,v=t.textPadding;v&&(o=Xve(o,s,v),c-=t.height/2-v[0]-t.innerHeight/2);var p=this._getOrCreateChild(aD),g=p.createStyle();p.useStyle(g);var m=this._defaultStyle,y=!1,_=0,x=jve("fill"in u?u.fill:"fill"in r?r.fill:(y=!0,m.fill)),S=Hve("stroke"in u?u.stroke:"stroke"in r?r.stroke:!d&&!l&&(!m.autoStroke||y)?(_=Uve,m.stroke):null),w=u.textShadowBlur>0||r.textShadowBlur>0;g.text=t.text,g.x=o,g.y=c,w&&(g.shadowBlur=u.textShadowBlur||r.textShadowBlur||0,g.shadowColor=u.textShadowColor||r.textShadowColor||"transparent",g.shadowOffsetX=u.textShadowOffsetX||r.textShadowOffsetX||0,g.shadowOffsetY=u.textShadowOffsetY||r.textShadowOffsetY||0),g.textAlign=s,g.textBaseline="middle",g.font=t.font||RS,g.opacity=qy(u.opacity,r.opacity,1),$ve(g,u),S&&(g.lineWidth=qy(u.lineWidth,r.lineWidth,_),g.lineDash=ni(u.lineDash,r.lineDash),g.lineDashOffset=r.lineDashOffset||0,g.stroke=S),x&&(g.fill=x);var b=t.contentWidth,E=t.contentHeight;p.setBoundingRect(new ai(eO(g.x,b,g.textAlign),GC(g.y,E,g.textBaseline),b,E))},e.prototype._renderBackground=function(t,r,i,a,o,s){var l=t.backgroundColor,u=t.borderWidth,h=t.borderColor,c=l&&l.image,f=l&&!c,d=t.borderRadius,v=this,p,g;if(f||t.lineHeight||u&&h){p=this._getOrCreateChild(ta),p.useStyle(p.createStyle()),p.style.fill=null;var m=p.shape;m.x=i,m.y=a,m.width=o,m.height=s,m.r=d,p.dirtyShape()}if(f){var y=p.style;y.fill=l||null,y.fillOpacity=ni(t.fillOpacity,1)}else if(c){g=this._getOrCreateChild(xc),g.onload=function(){v.dirtyStyle()};var _=g.style;_.image=l.image,_.x=i,_.y=a,_.width=o,_.height=s}if(u&&h){var y=p.style;y.lineWidth=u,y.stroke=h,y.strokeOpacity=ni(t.strokeOpacity,1),y.lineDash=t.borderDash,y.lineDashOffset=t.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var x=(p||g).style;x.shadowBlur=t.shadowBlur||0,x.shadowColor=t.shadowColor||"transparent",x.shadowOffsetX=t.shadowOffsetX||0,x.shadowOffsetY=t.shadowOffsetY||0,x.opacity=qy(t.opacity,r.opacity,1)},e.makeFont=function(t){var r="";return J3e(t)&&(r=[t.fontStyle,t.fontWeight,K3e(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),r&&Qg(r)||t.textFont||t.font},e}(Vp),Qht={left:!0,right:1,center:1},ect={top:1,bottom:1,middle:1},Vve=["fontStyle","fontWeight","fontSize","fontFamily"];function K3e(n){return typeof n=="string"&&(n.indexOf("px")!==-1||n.indexOf("rem")!==-1||n.indexOf("em")!==-1)?n:isNaN(+n)?Qne+"px":n+"px"}function $ve(n,e){for(var t=0;t=0,a=!1;if(n instanceof Si){var o=Q3e(n),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(WT(s)||WT(l)){r=r||{};var u=r.style||{};u.fill==="inherit"?(a=!0,r=Mt({},r),u=Mt({},u),u.fill=s):!WT(u.fill)&&WT(s)?(a=!0,r=Mt({},r),u=Mt({},u),u.fill=Jve(s)):!WT(u.stroke)&&WT(l)&&(a||(r=Mt({},r),u=Mt({},u)),u.stroke=Jve(l)),r.style=u}}if(r&&r.z2==null){a||(r=Mt({},r));var h=n.z2EmphasisLift;r.z2=n.z2+(h!=null?h:OI)}return r}function sct(n,e,t){if(t&&t.z2==null){t=Mt({},t);var r=n.z2SelectLift;t.z2=n.z2+(r!=null?r:rct)}return t}function lct(n,e,t){var r=gi(n.currentStates,e)>=0,i=n.style.opacity,a=r?null:act(n,["opacity"],e,{opacity:1});t=t||{};var o=t.style||{};return o.opacity==null&&(t=Mt({},t),o=Mt({opacity:r?i:a.opacity*.1},o),t.style=o),t}function TH(n,e){var t=this.states[n];if(this.style){if(n==="emphasis")return oct(this,n,e,t);if(n==="blur")return lct(this,n,t);if(n==="select")return sct(this,n,t)}return t}function ZE(n){n.stateProxy=TH;var e=n.getTextContent(),t=n.getTextGuideLine();e&&(e.stateProxy=TH),t&&(t.stateProxy=TH)}function epe(n,e){!oke(n,e)&&!n.__highByOuter&&N_(n,eke)}function tpe(n,e){!oke(n,e)&&!n.__highByOuter&&N_(n,tke)}function h_(n,e){n.__highByOuter|=1<<(e||0),N_(n,eke)}function c_(n,e){!(n.__highByOuter&=~(1<<(e||0)))&&N_(n,tke)}function nke(n){N_(n,xie)}function Sie(n){N_(n,rke)}function ike(n){N_(n,nct)}function ake(n){N_(n,ict)}function oke(n,e){return n.__highDownSilentOnTouch&&e.zrByTouch}function ske(n){var e=n.getModel(),t=[],r=[];e.eachComponent(function(i,a){var o=mie(a),s=i==="series",l=s?n.getViewOfSeriesModel(a):n.getViewOfComponentModel(a);!s&&r.push(l),o.isBlured&&(l.group.traverse(function(u){rke(u)}),s&&t.push(a)),o.isBlured=!1}),te(r,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(t,!1,e)})}function aJ(n,e,t,r){var i=r.getModel();t=t||"coordinateSystem";function a(u,h){for(var c=0;c0){var s={dataIndex:o,seriesIndex:t.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function CE(n,e,t){nE(n,!0),N_(n,ZE),sJ(n,e,t)}function vct(n){nE(n,!1)}function vl(n,e,t,r){r?vct(n):CE(n,e,t)}function sJ(n,e,t){var r=Bn(n);e!=null?(r.focus=e,r.blurScope=t):r.focus&&(r.focus=null)}var npe=["emphasis","blur","select"],pct={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function dc(n,e,t,r){t=t||"itemStyle";for(var i=0;i1&&(o*=CH(v),s*=CH(v));var p=(i===a?-1:1)*CH((o*o*(s*s)-o*o*(d*d)-s*s*(f*f))/(o*o*(d*d)+s*s*(f*f)))||0,g=p*o*d/s,m=p*-s*f/o,y=(n+t)/2+r4(c)*g-t4(c)*m,_=(e+r)/2+t4(c)*g+r4(c)*m,x=spe([1,0],[(f-g)/o,(d-m)/s]),S=[(f-g)/o,(d-m)/s],w=[(-1*f-g)/o,(-1*d-m)/s],b=spe(S,w);if(uJ(S,w)<=-1&&(b=qL),uJ(S,w)>=1&&(b=0),b<0){var E=Math.round(b/qL*1e6)/1e6;b=qL*2+E%2*qL}h.addData(u,y,_,o,s,x,b,c,a)}var Sct=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,wct=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function bct(n){var e=new hm;if(!n)return e;var t=0,r=0,i=t,a=r,o,s=hm.CMD,l=n.match(Sct);if(!l)return e;for(var u=0;uR*R+k*k&&(E=C,T=A),{cx:E,cy:T,x0:-h,y0:-c,x1:E*(i/S-1),y1:T*(i/S-1)}}function Lct(n){var e;if(Gt(n)){var t=n.length;if(!t)return n;t===1?e=[n[0],n[0],0,0]:t===2?e=[n[0],n[0],n[1],n[1]]:t===3?e=n.concat(n[2]):e=n}else e=[n,n,n,n];return e}function Pct(n,e){var t,r=tO(e.r,0),i=tO(e.r0||0,0),a=r>0,o=i>0;if(!(!a&&!o)){if(a||(r=i,i=0),i>r){var s=r;r=i,i=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var h=e.cx,c=e.cy,f=!!e.clockwise,d=upe(u-l),v=d>AH&&d%AH;if(v>Pg&&(d=v),!(r>Pg))n.moveTo(h,c);else if(d>AH-Pg)n.moveTo(h+r*jT(l),c+r*nb(l)),n.arc(h,c,r,l,u,!f),i>Pg&&(n.moveTo(h+i*jT(u),c+i*nb(u)),n.arc(h,c,i,u,l,f));else{var p=void 0,g=void 0,m=void 0,y=void 0,_=void 0,x=void 0,S=void 0,w=void 0,b=void 0,E=void 0,T=void 0,C=void 0,A=void 0,M=void 0,I=void 0,R=void 0,k=r*jT(l),D=r*nb(l),G=i*jT(u),W=i*nb(u),z=d>Pg;if(z){var V=e.cornerRadius;V&&(t=Lct(V),p=t[0],g=t[1],m=t[2],y=t[3]);var q=upe(r-i)/2;if(_=ty(q,m),x=ty(q,y),S=ty(q,p),w=ty(q,g),T=b=tO(_,x),C=E=tO(S,w),(b>Pg||E>Pg)&&(A=r*jT(u),M=r*nb(u),I=i*jT(l),R=i*nb(l),dPg){var me=ty(m,T),Ce=ty(y,T),Le=n4(I,R,k,D,r,me,f),re=n4(A,M,G,W,r,Ce,f);n.moveTo(h+Le.cx+Le.x0,c+Le.cy+Le.y0),T0&&n.arc(h+Le.cx,c+Le.cy,me,Tc(Le.y0,Le.x0),Tc(Le.y1,Le.x1),!f),n.arc(h,c,r,Tc(Le.cy+Le.y1,Le.cx+Le.x1),Tc(re.cy+re.y1,re.cx+re.x1),!f),Ce>0&&n.arc(h+re.cx,c+re.cy,Ce,Tc(re.y1,re.x1),Tc(re.y0,re.x0),!f))}else n.moveTo(h+k,c+D),n.arc(h,c,r,l,u,!f);if(!(i>Pg)||!z)n.lineTo(h+G,c+W);else if(C>Pg){var me=ty(p,C),Ce=ty(g,C),Le=n4(G,W,A,M,i,-Ce,f),re=n4(k,D,I,R,i,-me,f);n.lineTo(h+Le.cx+Le.x0,c+Le.cy+Le.y0),C0&&n.arc(h+Le.cx,c+Le.cy,Ce,Tc(Le.y0,Le.x0),Tc(Le.y1,Le.x1),!f),n.arc(h,c,i,Tc(Le.cy+Le.y1,Le.cx+Le.x1),Tc(re.cy+re.y1,re.cx+re.x1),f),me>0&&n.arc(h+re.cx,c+re.cy,me,Tc(re.y1,re.x1),Tc(re.y0,re.x0),!f))}else n.lineTo(h+G,c+W),n.arc(h,c,i,u,l,f)}n.closePath()}}}var Oct=function(){function n(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return n}(),gke=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Oct},e.prototype.buildPath=function(t,r){Pct(t,r)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Si);gke.prototype.type="sector";const wd=gke;var Rct=function(){function n(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return n}(),yke=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Rct},e.prototype.buildPath=function(t,r){var i=r.cx,a=r.cy,o=Math.PI*2;t.moveTo(i+r.r,a),t.arc(i,a,r.r,0,o,!1),t.moveTo(i+r.r0,a),t.arc(i,a,r.r0,0,o,!0)},e}(Si);yke.prototype.type="ring";const Kz=yke;function Dct(n,e,t,r){var i=[],a=[],o=[],s=[],l,u,h,c;if(r){h=[1/0,1/0],c=[-1/0,-1/0];for(var f=0,d=n.length;f=2){if(r){var a=Dct(i,r,t,e.smoothConstraint);n.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(t?o:o-1);s++){var l=a[s*2],u=a[s*2+1],h=i[(s+1)%o];n.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{n.moveTo(i[0][0],i[0][1]);for(var s=1,c=i.length;sab[1]){if(s=!1,a)return s;var h=Math.abs(ab[0]-ib[1]),c=Math.abs(ib[0]-ab[1]);Math.min(h,c)>i.len()&&(h0){var c=h.duration,f=h.delay,d=h.easing,v={duration:c,delay:f||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:n,during:o};s?e.animateFrom(t,v):e.animateTo(t,v)}else e.stopAnimation(),!s&&e.attr(t),o&&o(1),a&&a()}function ma(n,e,t,r,i,a){Aie("update",n,e,t,r,i,a)}function Is(n,e,t,r,i,a){Aie("enter",n,e,t,r,i,a)}function FA(n){if(!n.__zr)return!0;for(var e=0;eMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function fpe(n){return!n.isGroup}function eft(n){return n.shape!=null}function m3(n,e,t){if(!n||!e)return;function r(o){var s={};return o.traverse(function(l){fpe(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return eft(o)&&(s.shape=Mt({},o.shape)),s}var a=r(n);e.traverse(function(o){if(fpe(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),ma(o,l,t,Bn(o).dataIndex)}}})}function Lke(n,e){return Vt(n,function(t){var r=t[0];r=uG(r,e.x),r=hG(r,e.x+e.width);var i=t[1];return i=uG(i,e.y),i=hG(i,e.y+e.height),[r,i]})}function tft(n,e){var t=uG(n.x,e.x),r=hG(n.x+n.width,e.x+e.width),i=uG(n.y,e.y),a=hG(n.y+n.height,e.y+e.height);if(r>=t&&a>=i)return{x:t,y:i,width:r-t,height:a-i}}function _3(n,e,t){var r=Mt({rectHover:!0},e),i=r.style={strokeNoScale:!0};if(t=t||{x:-1,y:-1,width:2,height:2},n)return n.indexOf("image://")===0?(i.image=n.slice(8),sn(i,t),new xc(r)):Qz(n.replace("path://",""),r,t,"center")}function rO(n,e,t,r,i){for(var a=0,o=i[i.length-1];a1)return!1;var g=MH(d,v,h,c)/f;return!(g<0||g>1)}function MH(n,e,t,r){return n*r-t*e}function rft(n){return n<=1e-6&&n>=-1e-6}function DI(n){var e=n.itemTooltipOption,t=n.componentModel,r=n.itemName,i=Or(e)?{formatter:e}:e,a=t.mainType,o=t.componentIndex,s={componentType:a,name:r,$vars:["name"]};s[a+"Index"]=o;var l=n.formatterParamsExtra;l&&te(Li(l),function(h){Fr(s,h)||(s[h]=l[h],s.$vars.push(h))});var u=Bn(n.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:r,option:sn({content:r,formatterParams:s},i)}}function dpe(n,e){var t;n.isGroup&&(t=e(n)),t||n.traverse(e)}function _w(n,e){if(n)if(Gt(n))for(var t=0;t=0&&s.push(l)}),s}}function xw(n,e){return ii(ii({},n,!0),e,!0)}const pft={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},gft={time:{month:["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],monthAbbr:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],dayOfWeek:["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],dayOfWeekAbbr:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"]},legend:{selector:{all:"\u5168\u9009",inverse:"\u53CD\u9009"}},toolbox:{brush:{title:{rect:"\u77E9\u5F62\u9009\u62E9",polygon:"\u5708\u9009",lineX:"\u6A2A\u5411\u9009\u62E9",lineY:"\u7EB5\u5411\u9009\u62E9",keep:"\u4FDD\u6301\u9009\u62E9",clear:"\u6E05\u9664\u9009\u62E9"}},dataView:{title:"\u6570\u636E\u89C6\u56FE",lang:["\u6570\u636E\u89C6\u56FE","\u5173\u95ED","\u5237\u65B0"]},dataZoom:{title:{zoom:"\u533A\u57DF\u7F29\u653E",back:"\u533A\u57DF\u7F29\u653E\u8FD8\u539F"}},magicType:{title:{line:"\u5207\u6362\u4E3A\u6298\u7EBF\u56FE",bar:"\u5207\u6362\u4E3A\u67F1\u72B6\u56FE",stack:"\u5207\u6362\u4E3A\u5806\u53E0",tiled:"\u5207\u6362\u4E3A\u5E73\u94FA"}},restore:{title:"\u8FD8\u539F"},saveAsImage:{title:"\u4FDD\u5B58\u4E3A\u56FE\u7247",lang:["\u53F3\u952E\u53E6\u5B58\u4E3A\u56FE\u7247"]}},series:{typeNames:{pie:"\u997C\u56FE",bar:"\u67F1\u72B6\u56FE",line:"\u6298\u7EBF\u56FE",scatter:"\u6563\u70B9\u56FE",effectScatter:"\u6D9F\u6F2A\u6563\u70B9\u56FE",radar:"\u96F7\u8FBE\u56FE",tree:"\u6811\u56FE",treemap:"\u77E9\u5F62\u6811\u56FE",boxplot:"\u7BB1\u578B\u56FE",candlestick:"K\u7EBF\u56FE",k:"K\u7EBF\u56FE",heatmap:"\u70ED\u529B\u56FE",map:"\u5730\u56FE",parallel:"\u5E73\u884C\u5750\u6807\u56FE",lines:"\u7EBF\u56FE",graph:"\u5173\u7CFB\u56FE",sankey:"\u6851\u57FA\u56FE",funnel:"\u6F0F\u6597\u56FE",gauge:"\u4EEA\u8868\u76D8\u56FE",pictorialBar:"\u8C61\u5F62\u67F1\u56FE",themeRiver:"\u4E3B\u9898\u6CB3\u6D41\u56FE",sunburst:"\u65ED\u65E5\u56FE"}},aria:{general:{withTitle:"\u8FD9\u662F\u4E00\u4E2A\u5173\u4E8E\u201C{title}\u201D\u7684\u56FE\u8868\u3002",withoutTitle:"\u8FD9\u662F\u4E00\u4E2A\u56FE\u8868\uFF0C"},series:{single:{prefix:"",withName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\uFF0C\u8868\u793A{seriesName}\u3002",withoutName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\u3002"},multiple:{prefix:"\u5B83\u7531{seriesCount}\u4E2A\u56FE\u8868\u7CFB\u5217\u7EC4\u6210\u3002",withName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A\u8868\u793A{seriesName}\u7684{seriesType}\uFF0C",withoutName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A{seriesType}\uFF0C",separator:{middle:"\uFF1B",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636E\u662F\u2014\u2014",partialData:"\u5176\u4E2D\uFF0C\u524D{displayCnt}\u9879\u662F\u2014\u2014",withName:"{name}\u7684\u6570\u636E\u662F{value}",withoutName:"{value}",separator:{middle:"\uFF0C",end:""}}}};var fG="ZH",Iie="EN",uD=Iie,IB={},Lie={},Bke=sa.domSupported?function(){var n=(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase();return n.indexOf(fG)>-1?fG:uD}():uD;function Gke(n,e){n=n.toUpperCase(),Lie[n]=new as(e),IB[n]=e}function yft(n){if(Or(n)){var e=IB[n.toUpperCase()]||{};return n===fG||n===Iie?Sn(e):ii(Sn(e),Sn(IB[uD]),!1)}else return ii(Sn(n),Sn(IB[uD]),!1)}function fJ(n){return Lie[n]}function mft(){return Lie[uD]}Gke(Iie,pft);Gke(fG,gft);var Pie=1e3,Oie=Pie*60,KO=Oie*60,Ap=KO*24,mpe=Ap*365,nO={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},o4="{yyyy}-{MM}-{dd}",_pe={year:"{yyyy}",month:"{yyyy}-{MM}",day:o4,hour:o4+" "+nO.hour,minute:o4+" "+nO.minute,second:o4+" "+nO.second,millisecond:nO.none},PH=["year","month","day","hour","minute","second","millisecond"],zke=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function ix(n,e){return n+="","0000".substr(0,e-n.length)+n}function BA(n){switch(n){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return n}}function _ft(n){return n===BA(n)}function xft(n){switch(n){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function rU(n,e,t,r){var i=um(n),a=i[Rie(t)](),o=i[GA(t)]()+1,s=Math.floor((o-1)/3)+1,l=i[nU(t)](),u=i["get"+(t?"UTC":"")+"Day"](),h=i[hD(t)](),c=(h-1)%12+1,f=i[iU(t)](),d=i[aU(t)](),v=i[oU(t)](),p=r instanceof as?r:fJ(r||Bke)||mft(),g=p.getModel("time"),m=g.get("month"),y=g.get("monthAbbr"),_=g.get("dayOfWeek"),x=g.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,ix(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,m[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,ix(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,ix(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,_[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,ix(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,ix(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,ix(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,ix(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,ix(v,3)).replace(/{S}/g,v+"")}function Sft(n,e,t,r,i){var a=null;if(Or(t))a=t;else if(rn(t))a=t(n.value,e,{level:n.level});else{var o=Mt({},nO);if(n.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(Gt(a)){var c=n.level==null?0:n.level>=0?n.level:a.length+n.level;c=Math.min(c,a.length-1),a=a[c]}}return rU(new Date(n.value),a,i,r)}function Uke(n,e){var t=um(n),r=t[GA(e)]()+1,i=t[nU(e)](),a=t[hD(e)](),o=t[iU(e)](),s=t[aU(e)](),l=t[oU(e)](),u=l===0,h=u&&s===0,c=h&&o===0,f=c&&a===0,d=f&&i===1,v=d&&r===1;return v?"year":d?"month":f?"day":c?"hour":h?"minute":u?"second":"millisecond"}function xpe(n,e,t){var r=ha(n)?um(n):n;switch(e=e||Uke(n,t),e){case"year":return r[Rie(t)]();case"half-year":return r[GA(t)]()>=6?1:0;case"quarter":return Math.floor((r[GA(t)]()+1)/4);case"month":return r[GA(t)]();case"day":return r[nU(t)]();case"half-day":return r[hD(t)]()/24;case"hour":return r[hD(t)]();case"minute":return r[iU(t)]();case"second":return r[aU(t)]();case"millisecond":return r[oU(t)]()}}function Rie(n){return n?"getUTCFullYear":"getFullYear"}function GA(n){return n?"getUTCMonth":"getMonth"}function nU(n){return n?"getUTCDate":"getDate"}function hD(n){return n?"getUTCHours":"getHours"}function iU(n){return n?"getUTCMinutes":"getMinutes"}function aU(n){return n?"getUTCSeconds":"getSeconds"}function oU(n){return n?"getUTCMilliseconds":"getMilliseconds"}function wft(n){return n?"setUTCFullYear":"setFullYear"}function Vke(n){return n?"setUTCMonth":"setMonth"}function $ke(n){return n?"setUTCDate":"setDate"}function Wke(n){return n?"setUTCHours":"setHours"}function Hke(n){return n?"setUTCMinutes":"setMinutes"}function jke(n){return n?"setUTCSeconds":"setSeconds"}function Xke(n){return n?"setUTCMilliseconds":"setMilliseconds"}function Yke(n){if(!M3e(n))return Or(n)?n:"-";var e=(n+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function qke(n,e){return n=(n||"").toLowerCase().replace(/-(.)/g,function(t,r){return r.toUpperCase()}),e&&n&&(n=n.charAt(0).toUpperCase()+n.slice(1)),n}var FI=aie;function dJ(n,e,t){var r="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(h){return h&&Qg(h)?h:"-"}function a(h){return!!(h!=null&&!isNaN(h)&&isFinite(h))}var o=e==="time",s=n instanceof Date;if(o||s){var l=o?um(n):n;if(isNaN(+l)){if(s)return"-"}else return rU(l,r,t)}if(e==="ordinal")return OK(n)?i(n):ha(n)&&a(n)?n+"":"-";var u=u_(n);return a(u)?Yke(u):OK(n)?i(n):typeof n=="boolean"?n+"":"-"}var Spe=["a","b","c","d","e","f","g"],OH=function(n,e){return"{"+n+(e==null?"":e)+"}"};function Zke(n,e,t){Gt(e)||(e=[e]);var r=e.length;if(!r)return"";for(var i=e[0].$vars||[],a=0;a':'';var o=t.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}}function KE(n,e){return e=e||"transparent",Or(n)?n:dn(n)&&n.colorStops&&(n.colorStops[0]||{}).color||e}function dG(n,e){if(e==="_blank"||e==="blank"){var t=window.open();t.opener=null,t.location.href=n}else window.open(n,e)}var LB=te,Kke=["left","right","top","bottom","width","height"],iE=[["width","left","right"],["height","top","bottom"]];function Die(n,e,t,r,i){var a=0,o=0;r==null&&(r=1/0),i==null&&(i=1/0);var s=0;e.eachChild(function(l,u){var h=l.getBoundingRect(),c=e.childAt(u+1),f=c&&c.getBoundingRect(),d,v;if(n==="horizontal"){var p=h.width+(f?-f.x+h.x:0);d=a+p,d>r||l.newline?(a=0,d=p,o+=s+t,s=h.height):s=Math.max(s,h.height)}else{var g=h.height+(f?-f.y+h.y:0);v=o+g,v>i||l.newline?(a+=s+t,o=0,v=g,s=h.width):s=Math.max(s,h.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),n==="horizontal"?a=d+t:o=v+t)})}var ME=Die;Un(Die,"vertical");Un(Die,"horizontal");function Tft(n,e,t){var r=e.width,i=e.height,a=xr(n.left,r),o=xr(n.top,i),s=xr(n.right,r),l=xr(n.bottom,i);return(isNaN(a)||isNaN(parseFloat(n.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(n.right)))&&(s=r),(isNaN(o)||isNaN(parseFloat(n.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(n.bottom)))&&(l=i),t=FI(t||0),{width:Math.max(s-a-t[1]-t[3],0),height:Math.max(l-o-t[0]-t[2],0)}}function Uu(n,e,t){t=FI(t||0);var r=e.width,i=e.height,a=xr(n.left,r),o=xr(n.top,i),s=xr(n.right,r),l=xr(n.bottom,i),u=xr(n.width,r),h=xr(n.height,i),c=t[2]+t[0],f=t[1]+t[3],d=n.aspect;switch(isNaN(u)&&(u=r-s-f-a),isNaN(h)&&(h=i-l-c-o),d!=null&&(isNaN(u)&&isNaN(h)&&(d>r/i?u=r*.8:h=i*.8),isNaN(u)&&(u=d*h),isNaN(h)&&(h=u/d)),isNaN(a)&&(a=r-s-u-f),isNaN(o)&&(o=i-l-h-c),n.left||n.right){case"center":a=r/2-u/2-t[3];break;case"right":a=r-u-f;break}switch(n.top||n.bottom){case"middle":case"center":o=i/2-h/2-t[0];break;case"bottom":o=i-h-c;break}a=a||0,o=o||0,isNaN(u)&&(u=r-f-a-(s||0)),isNaN(h)&&(h=i-c-o-(l||0));var v=new ai(a+t[3],o+t[0],u,h);return v.margin=t,v}function sU(n,e,t,r,i,a){var o=!i||!i.hv||i.hv[0],s=!i||!i.hv||i.hv[1],l=i&&i.boundingMode||"all";if(a=a||n,a.x=n.x,a.y=n.y,!o&&!s)return!1;var u;if(l==="raw")u=n.type==="group"?new ai(0,0,+e.width||0,+e.height||0):n.getBoundingRect();else if(u=n.getBoundingRect(),n.needLocalTransform()){var h=n.getLocalTransform();u=u.clone(),u.applyTransform(h)}var c=Uu(sn({width:u.width,height:u.height},e),t,r),f=o?c.x-u.x:0,d=s?c.y-u.y:0;return l==="raw"?(a.x=f,a.y=d):(a.x+=f,a.y+=d),a===n&&n.markRedraw(),!0}function Cft(n,e){return n[iE[e][0]]!=null||n[iE[e][1]]!=null&&n[iE[e][2]]!=null}function cD(n){var e=n.layoutMode||n.constructor.layoutMode;return dn(e)?e:e?{type:e}:null}function kS(n,e,t){var r=t&&t.ignoreSize;!Gt(r)&&(r=[r,r]);var i=o(iE[0],0),a=o(iE[1],1);u(iE[0],n,i),u(iE[1],n,a);function o(h,c){var f={},d=0,v={},p=0,g=2;if(LB(h,function(_){v[_]=n[_]}),LB(h,function(_){s(e,_)&&(f[_]=v[_]=e[_]),l(f,_)&&d++,l(v,_)&&p++}),r[c])return l(e,h[1])?v[h[2]]=null:l(e,h[2])&&(v[h[1]]=null),v;if(p===g||!d)return v;if(d>=g)return f;for(var m=0;m=0;l--)s=ii(s,i[l],!0);r.defaultOption=s}return r.defaultOption},e.prototype.getReferringComponents=function(t,r){var i=t+"Index",a=t+"Id";return p3(this.ecModel,t,{index:this.get(i,!0),id:this.get(a,!0)},r)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(as);B3e(GI,as);Hz(GI);dft(GI);vft(GI,Mft);function Mft(n){var e=[];return te(GI.getClassesByMainType(n),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=Vt(e,function(t){return ky(t).main}),n!=="dataset"&&gi(e,"dataset")<=0&&e.unshift("dataset"),e}const oa=GI;var Qke="";typeof navigator<"u"&&(Qke=navigator.platform||"");var XT="rgba(0, 0, 0, 0.2)";const Ift={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:XT,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:XT,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:XT,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:XT,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:XT,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:XT,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Qke.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var eFe=$r(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),ig="original",qc="arrayRows",ag="objectRows",Im="keyedColumns",mS="typedArray",tFe="unknown",Zy="column",zI="row",nc={Must:1,Might:2,Not:3},rFe=na();function Lft(n){rFe(n).datasetMap=$r()}function nFe(n,e,t){var r={},i=kie(e);if(!i||!n)return r;var a=[],o=[],s=e.ecModel,l=rFe(s).datasetMap,u=i.uid+"_"+t.seriesLayoutBy,h,c;n=n.slice(),te(n,function(p,g){var m=dn(p)?p:n[g]={name:p};m.type==="ordinal"&&h==null&&(h=g,c=v(m)),r[m.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:c,valueWayDim:0});te(n,function(p,g){var m=p.name,y=v(p);if(h==null){var _=f.valueWayDim;d(r[m],_,y),d(o,_,y),f.valueWayDim+=y}else if(h===g)d(r[m],0,y),d(a,0,y);else{var _=f.categoryWayDim;d(r[m],_,y),d(o,_,y),f.categoryWayDim+=y}});function d(p,g,m){for(var y=0;ye)return n[r];return n[t-1]}function oFe(n,e,t,r,i,a,o){a=a||n;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var h=o==null||!r?t:Nft(r,o);if(h=h||t,!(!h||!h.length)){var c=h[l];return i&&(u[i]=c),s.paletteIdx=(l+1)%h.length,c}}function kft(n,e){e(n).paletteIdx=0,e(n).paletteNameMap={}}var s4,ZL,bpe,Epe="\0_ec_inner",Fft=1,sFe=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(t,r,i,a,o,s){a=a||{},this.option=null,this._theme=new as(a),this._locale=new as(o),this._optionManager=s},e.prototype.setOption=function(t,r,i){var a=Ape(r);this._optionManager.setOption(t,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(t,r){return this._resetOption(t,Ape(r))},e.prototype._resetOption=function(t,r){var i=!1,a=this._optionManager;if(!t||t==="recreate"){var o=a.mountOption(t==="recreate");!this.option||t==="recreate"?bpe(this,o):(this.restoreData(),this._mergeOption(o,r)),i=!0}if((t==="timeline"||t==="media")&&this.restoreData(),!t||t==="recreate"||t==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,r))}if(!t||t==="recreate"||t==="media"){var l=a.getMediaOption(this);l.length&&te(l,function(u){i=!0,this._mergeOption(u,r)},this)}return i},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,r){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=$r(),u=r&&r.replaceMergeMainTypeMap;Lft(this),te(t,function(c,f){c!=null&&(oa.hasClass(f)?f&&(s.push(f),l.set(f,!0)):i[f]=i[f]==null?Sn(c):ii(i[f],c,!0))}),u&&u.each(function(c,f){oa.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),oa.topologicalTravel(s,oa.getAllClassMainTypes(),h,this);function h(c){var f=Rft(this,c,Do(t[c])),d=a.get(c),v=d?u&&u.get(c)?"replaceMerge":"normalMerge":"replaceAll",p=R3e(d,f,v);Jut(p,c,oa),i[c]=null,a.set(c,null),o.set(c,0);var g=[],m=[],y=0,_;te(p,function(x,S){var w=x.existing,b=x.newOption;if(!b)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var E=c==="series",T=oa.getClass(c,x.keyInfo.subType,!E);if(!T)return;if(c==="tooltip"){if(_)return;_=!0}if(w&&w.constructor===T)w.name=x.keyInfo.name,w.mergeOption(b,this),w.optionUpdated(b,!1);else{var C=Mt({componentIndex:S},x.keyInfo);w=new T(b,this,this,C),Mt(w,C),x.brandNew&&(w.__requireNewView=!0),w.init(b,this,this),w.optionUpdated(null,!0)}}w?(g.push(w.option),m.push(w),y++):(g.push(void 0),m.push(void 0))},this),i[c]=g,a.set(c,m),o.set(c,y),c==="series"&&s4(this)}this._seriesIndices||s4(this)},e.prototype.getOption=function(){var t=Sn(this.option);return te(t,function(r,i){if(oa.hasClass(i)){for(var a=Do(r),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!iD(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,t[i]=a}}),delete t[Epe],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,r){var i=this._componentsMap.get(t);if(i){var a=i[r||0];if(a)return a;if(r==null){for(var o=0;o=e:t==="max"?n<=e:n===e}function Yft(n,e){return n.join(",")===e.join(",")}const qft=Wft;var Eg=te,fD=dn,Mpe=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function DH(n){var e=n&&n.itemStyle;if(!!e)for(var t=0,r=Mpe.length;t=0;g--){var m=n[g];if(s||(v=m.data.rawIndexOf(m.stackedByDimension,d)),v>=0){var y=m.data.getByRawIndex(m.stackResultDimension,v);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&f>=0&&y>0||l==="samesign"&&f<=0&&y<0){f=Uut(f,y),p=y;break}}}return r[0]=f,r[1]=p,r})})}var lU=function(){function n(e){this.data=e.data||(e.sourceFormat===Im?{}:[]),this.sourceFormat=e.sourceFormat||tFe,this.seriesLayoutBy=e.seriesLayoutBy||Zy,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var r=0;rp&&(p=_)}d[0]=v,d[1]=p}},i=function(){return this._data?this._data.length/this._dimSize:0};Npe=(e={},e[qc+"_"+Zy]={pure:!0,appendData:a},e[qc+"_"+zI]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[ag]={pure:!0,appendData:a},e[Im]={pure:!0,appendData:function(o){var s=this._data;te(o,function(l,u){for(var h=s[u]||(s[u]=[]),c=0;c<(l||[]).length;c++)h.push(l[c])})}},e[ig]={appendData:a},e[mS]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s=0&&(p=o.interpolatedValue[g])}return p!=null?p+"":""})}},n.prototype.getRawValue=function(e,t){return dM(this.getData(t),e)},n.prototype.formatTooltip=function(e,t,r){},n}();function Gpe(n){var e,t;return dn(n)?n.type&&(t=n):e=n,{text:e,frag:t}}function JO(n){return new fdt(n)}var fdt=function(){function n(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return n.prototype.perform=function(e){var t=this._upstream,r=e&&e.skip;if(this._dirty&&t){var i=this.context;i.data=i.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!r&&(a=this._plan(this.context));var o=h(this._modBy),s=this._modDataCount||0,l=h(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function h(y){return!(y>=1)&&(y=1),y}var c;(this._dirty||a==="reset")&&(this._dirty=!1,c=this._doReset(r)),this._modBy=l,this._modDataCount=u;var f=e&&e.step;if(t?this._dueEnd=t._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,v=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!r&&(c||d1&&r>0?s:o}};return a;function o(){return e=n?null:le},gte:function(n,e){return n>=e}},vdt=function(){function n(e,t){if(!ha(t)){var r="";ao(r)}this._opFn=_Fe[e],this._rvalFloat=u_(t)}return n.prototype.evaluate=function(e){return ha(e)?this._opFn(e,this._rvalFloat):this._opFn(u_(e),this._rvalFloat)},n}(),xFe=function(){function n(e,t){var r=e==="desc";this._resultLT=r?1:-1,t==null&&(t=r?"min":"max"),this._incomparable=t==="min"?-1/0:1/0}return n.prototype.evaluate=function(e,t){var r=ha(e)?e:u_(e),i=ha(t)?t:u_(t),a=isNaN(r),o=isNaN(i);if(a&&(r=this._incomparable),o&&(i=this._incomparable),a&&o){var s=Or(e),l=Or(t);s&&(r=l?e:0),l&&(i=s?t:0)}return ri?-this._resultLT:0},n}(),pdt=function(){function n(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=u_(t)}return n.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var r=typeof e;r!==this._rvalTypeof&&(r==="number"||this._rvalTypeof==="number")&&(t=u_(e)===this._rvalFloat)}return this._isEQ?t:!t},n}();function gdt(n,e){return n==="eq"||n==="ne"?new pdt(n==="eq",e):Fr(_Fe,n)?new vdt(n,e):null}var ydt=function(){function n(){}return n.prototype.getRawData=function(){throw new Error("not supported")},n.prototype.getRawDataItem=function(e){throw new Error("not supported")},n.prototype.cloneRawData=function(){},n.prototype.getDimensionInfo=function(e){},n.prototype.cloneAllDimensionInfo=function(){},n.prototype.count=function(){},n.prototype.retrieveValue=function(e,t){},n.prototype.retrieveValueFromItem=function(e,t){},n.prototype.convertValue=function(e,t){return _S(e,t)},n}();function mdt(n,e){var t=new ydt,r=n.data,i=t.sourceFormat=n.sourceFormat,a=n.startIndex,o="";n.seriesLayoutBy!==Zy&&ao(o);var s=[],l={},u=n.dimensionsDefine;if(u)te(u,function(p,g){var m=p.name,y={index:g,name:m,displayName:p.displayName};if(s.push(y),m!=null){var _="";Fr(l,m)&&ao(_),l[m]=y}});else for(var h=0;h65535?Cdt:Adt}function YT(){return[1/0,-1/0]}function Mdt(n){var e=n.constructor;return e===Array?n.slice():new e(n)}function Vpe(n,e,t,r,i){var a=bFe[t||"float"];if(i){var o=n[e],s=o&&o.length;if(s!==r){for(var l=new a(r),u=0;ug[1]&&(g[1]=p)}return this._rawCount=this._count=l,{start:s,end:l}},n.prototype._initDataFromProvider=function(e,t,r){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=Vt(o,function(y){return y.property}),h=0;hm[1]&&(m[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent=[]},n.prototype.count=function(){return this._count},n.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,r=t[e];if(r!=null&&re)a=o-1;else return o}return-1},n.prototype.indicesOfNearest=function(e,t,r){var i=this._chunks,a=i[e],o=[];if(!a)return o;r==null&&(r=1/0);for(var s=1/0,l=-1,u=0,h=0,c=this.count();h=0&&l<0)&&(s=v,l=d,u=0),d===l&&(o[u++]=h))}return o.length=u,o},n.prototype.getIndices=function(){var e,t=this._indices;if(t){var r=t.constructor,i=this._count;if(r===Array){e=new r(i);for(var a=0;a=c&&y<=f||isNaN(y))&&(l[u++]=p),p++}v=!0}else if(a===2){for(var g=d[i[0]],_=d[i[1]],x=e[i[1]][0],S=e[i[1]][1],m=0;m=c&&y<=f||isNaN(y))&&(w>=x&&w<=S||isNaN(w))&&(l[u++]=p),p++}v=!0}}if(!v)if(a===1)for(var m=0;m=c&&y<=f||isNaN(y))&&(l[u++]=b)}else for(var m=0;me[C][1])&&(E=!1)}E&&(l[u++]=t.getRawIndex(m))}return um[1]&&(m[1]=g)}}}},n.prototype.lttbDownSample=function(e,t){var r=this.clone([e],!0),i=r._chunks,a=i[e],o=this.count(),s=0,l=Math.floor(1/t),u=this.getRawIndex(0),h,c,f,d=new(JL(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var v=1;vh&&(h=c,f=x)}A>0&&Ah-v&&(l=h-v,s.length=l);for(var p=0;pc[1]&&(c[1]=m),f[d++]=y}return a._count=d,a._indices=f,a._updateGetRawIdx(),a},n.prototype.each=function(e,t){if(!!this._count)for(var r=e.length,i=this._chunks,a=0,o=this.count();al&&(l=c)}return o=[s,l],this._extent[e]=o,o},n.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var r=[],i=this._chunks,a=0;a=0?this._indices[e]:-1},n.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},n.internalField=function(){function e(t,r,i,a){return _S(t[a],this._dimensions[a])}FH={arrayRows:e,objectRows:function(t,r,i,a){return _S(t[r],this._dimensions[a])},keyedColumns:e,original:function(t,r,i,a){var o=t&&(t.value==null?t:t.value);return _S(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(t,r,i,a){return t[a]}}}(),n}(),EFe=function(){function n(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return n.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},n.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},n.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},n.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},n.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),r=!!t.length,i,a;if(l4(e)){var o=e,s=void 0,l=void 0,u=void 0;if(r){var h=t[0];h.prepareSource(),u=h.getSource(),s=u.data,l=u.sourceFormat,a=[h._getVersionSign()]}else s=o.get("data",!0),l=Ev(s)?mS:ig,a=[];var c=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},d=ni(c.seriesLayoutBy,f.seriesLayoutBy)||null,v=ni(c.sourceHeader,f.sourceHeader),p=ni(c.dimensions,f.dimensions),g=d!==f.seriesLayoutBy||!!v!=!!f.sourceHeader||p;i=g?[gJ(s,{seriesLayoutBy:d,sourceHeader:v,dimensions:p},l)]:[]}else{var m=e;if(r){var y=this._applyTransform(t);i=y.sourceList,a=y.upstreamSignList}else{var _=m.get("source",!0);i=[gJ(_,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},n.prototype._applyTransform=function(e){var t=this._sourceHost,r=t.get("transform",!0),i=t.get("fromTransformResult",!0);if(i!=null){var a="";e.length!==1&&Wpe(a)}var o,s=[],l=[];return te(e,function(u){u.prepareSource();var h=u.getSource(i||0),c="";i!=null&&!h&&Wpe(c),s.push(h),l.push(u._getVersionSign())}),r?o=Edt(r,s,{datasetIndex:t.componentIndex}):i!=null&&(o=[adt(s[0])]),{sourceList:o,upstreamSignList:l}},n.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||t>0&&!n.noHeader;return te(n.blocks,function(i){var a=MFe(i);a>=e&&(e=a+ +(r&&(!a||mJ(i)&&!i.noHeader)))}),e}return 0}function Pdt(n,e,t,r){var i=e.noHeader,a=Rdt(MFe(e)),o=[],s=e.blocks||[];Bf(!s||Gt(s)),s=s||[];var l=n.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Fr(u,l)){var h=new xFe(u[l],null);s.sort(function(v,p){return h.evaluate(v.sortParam,p.sortParam)})}else l==="seriesDesc"&&s.reverse()}te(s,function(v,p){var g=e.valueFormatter,m=AFe(v)(g?Mt(Mt({},n),{valueFormatter:g}):n,v,p>0?a.html:0,r);m!=null&&o.push(m)});var c=n.renderMode==="richText"?o.join(a.richText):_J(o.join(""),i?t:a.html);if(i)return c;var f=dJ(e.header,"ordinal",n.useUTC),d=CFe(r,n.renderMode).nameStyle;return n.renderMode==="richText"?IFe(n,f,d)+a.richText+c:_J('
'+od(f)+"
"+c,t)}function Odt(n,e,t,r){var i=n.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=n.useUTC,h=e.valueFormatter||n.valueFormatter||function(x){return x=Gt(x)?x:[x],Vt(x,function(S,w){return dJ(S,Gt(d)?d[w]:d,u)})};if(!(a&&o)){var c=s?"":n.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),f=a?"":dJ(l,"ordinal",u),d=e.valueType,v=o?[]:h(e.value),p=!s||!a,g=!s&&a,m=CFe(r,i),y=m.nameStyle,_=m.valueStyle;return i==="richText"?(s?"":c)+(a?"":IFe(n,f,y))+(o?"":kdt(n,v,p,g,_)):_J((s?"":c)+(a?"":Ddt(f,!s,y))+(o?"":Ndt(v,p,g,_)),t)}}function Hpe(n,e,t,r,i,a){if(!!n){var o=AFe(n),s={useUTC:i,renderMode:t,orderMode:r,markupStyleCreator:e,valueFormatter:n.valueFormatter};return o(s,n,0,a)}}function Rdt(n){return{html:Idt[n],richText:Ldt[n]}}function _J(n,e){var t='
',r="margin: "+e+"px 0 0";return'
'+n+t+"
"}function Ddt(n,e,t){var r=e?"margin-left:2px":"";return''+od(n)+""}function Ndt(n,e,t,r){var i=t?"10px":"20px",a=e?"float:right;margin-left:"+i:"";return n=Gt(n)?n:[n],''+Vt(n,function(o){return od(o)}).join("  ")+""}function IFe(n,e,t){return n.markupStyleCreator.wrapRichTextStyle(e,t)}function kdt(n,e,t,r,i){var a=[i],o=r?10:20;return t&&a.push({padding:[0,0,0,o],align:"right"}),n.markupStyleCreator.wrapRichTextStyle(Gt(e)?e.join(" "):e,a)}function LFe(n,e){var t=n.getData().getItemVisual(e,"style"),r=t[n.visualDrawType];return KE(r)}function PFe(n,e){var t=n.get("padding");return t!=null?t:e==="richText"?[8,10]:10}var BH=function(){function n(){this.richTextStyles={},this._nextStyleNameId=I3e()}return n.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},n.prototype.makeTooltipMarker=function(e,t,r){var i=r==="richText"?this._generateStyleName():null,a=Eft({color:t,type:e,renderMode:r,markerId:i});return Or(a)?a:(this.richTextStyles[i]=a.style,a.content)},n.prototype.wrapRichTextStyle=function(e,t){var r={};Gt(t)?te(t,function(a){return Mt(r,a)}):Mt(r,t);var i=this._generateStyleName();return this.richTextStyles[i]=r,"{"+i+"|"+e+"}"},n}();function OFe(n){var e=n.series,t=n.dataIndex,r=n.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(t),l=Gt(s),u=LFe(e,t),h,c,f,d;if(o>1||l&&!o){var v=Fdt(s,e,t,a,u);h=v.inlineValues,c=v.inlineValueTypes,f=v.blocks,d=v.inlineValues[0]}else if(o){var p=i.getDimensionInfo(a[0]);d=h=dM(i,t,a[0]),c=p.type}else d=h=l?s[0]:s;var g=vie(e),m=g&&e.name||"",y=i.getName(t),_=r?m:y;return ch("section",{header:m,noHeader:r||!g,sortParam:d,blocks:[ch("nameValue",{markerType:"item",markerColor:u,name:_,noName:!Qg(_),value:h,valueType:c})].concat(f||[])})}function Fdt(n,e,t,r,i){var a=e.getData(),o=om(n,function(c,f,d){var v=a.getDimensionInfo(d);return c=c||v&&v.tooltip!==!1&&v.displayName!=null},!1),s=[],l=[],u=[];r.length?te(r,function(c){h(dM(a,t,c),c)}):te(n,h);function h(c,f){var d=a.getDimensionInfo(f);!d||d.otherDims.tooltip===!1||(o?u.push(ch("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:c,valueType:d.type})):(s.push(c),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var ax=na();function u4(n,e){return n.getName(e)||n.getId(e)}var PB="__universalTransitionEnabled",hU=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return e.prototype.init=function(t,r,i){this.seriesIndex=this.componentIndex,this.dataTask=JO({count:Gdt,reset:zdt}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,i);var a=ax(this).sourceManager=new EFe(this);a.prepareSource();var o=this.getInitialData(t,i);Xpe(o,this),this.dataTask.context.data=o,ax(this).dataBeforeProcessed=o,jpe(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(t,r){var i=cD(this),a=i?BI(t):{},o=this.subType;oa.hasClass(o)&&(o+="Series"),ii(t,r.getTheme().get(this.subType)),ii(t,this.getDefaultOption()),XE(t,"label",["show"]),this.fillDataTextStyle(t.data),i&&kS(t,a,i)},e.prototype.mergeOption=function(t,r){t=ii(this.option,t,!0),this.fillDataTextStyle(t.data);var i=cD(this);i&&kS(this.option,t,i);var a=ax(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(t,r);Xpe(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,ax(this).dataBeforeProcessed=o,jpe(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(t){if(t&&!Ev(t))for(var r=["show"],i=0;ithis.getShallow("animationThreshold")&&(r=!1),!!r},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,r,i){var a=this.ecModel,o=Fie.prototype.getColorFromPalette.call(this,t,r,i);return o||(o=a.getColorFromPalette(t,r,i)),o},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,r){this._innerSelect(this.getData(r),t)},e.prototype.unselect=function(t,r){var i=this.option.selectedMap;if(!!i){var a=this.option.selectedMode,o=this.getData(r);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}return i},e.prototype.isSelected=function(t,r){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(r);return(i==="all"||i[u4(a,t)])&&!a.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[PB])return!0;var t=this.option.universalTransition;return t?t===!0?!0:t&&t.enabled:!1},e.prototype._innerSelect=function(t,r){var i,a,o=this.option,s=o.selectedMode,l=r.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){dn(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,h=0;h0&&this._innerSelect(t,r)}},e.registerClass=function(t){return oa.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(oa);gu(hU,Uie);gu(hU,Fie);B3e(hU,oa);function jpe(n){var e=n.name;vie(n)||(n.name=Bdt(n)||e)}function Bdt(n){var e=n.getRawData(),t=e.mapDimensionsAll("seriesName"),r=[];return te(t,function(i){var a=e.getDimensionInfo(i);a.displayName&&r.push(a.displayName)}),r.join(" ")}function Gdt(n){return n.model.getRawData().count()}function zdt(n){var e=n.model;return e.setData(e.getRawData().cloneShallow()),Udt}function Udt(n,e){e.outputData&&n.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Xpe(n,e){te(K8(n.CHANGABLE_METHODS,n.DOWNSAMPLE_METHODS),function(t){n.wrapMethod(t,Un(Vdt,e))})}function Vdt(n,e){var t=xJ(n);return t&&t.setOutputEnd((e||this).count()),e}function xJ(n){var e=(n.ecModel||{}).scheduler,t=e&&e.getPipeline(n.uid);if(t){var r=t.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(n.uid))}return r}}const Ws=hU;var $ie=function(){function n(){this.group=new Cn,this.uid=kI("viewComponent")}return n.prototype.init=function(e,t){},n.prototype.render=function(e,t,r,i){},n.prototype.dispose=function(e,t){},n.prototype.updateView=function(e,t,r,i){},n.prototype.updateLayout=function(e,t,r,i){},n.prototype.updateVisual=function(e,t,r,i){},n.prototype.toggleBlurSeries=function(e,t,r){},n.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},n}();gie($ie);Hz($ie);const pl=$ie;function UI(){var n=na();return function(e){var t=n(e),r=e.pipelineContext,i=!!t.large,a=!!t.progressiveRender,o=t.large=!!(r&&r.large),s=t.progressiveRender=!!(r&&r.progressiveRender);return(i!==o||a!==s)&&"reset"}}var RFe=na(),$dt=UI(),Wie=function(){function n(){this.group=new Cn,this.uid=kI("viewChart"),this.renderTask=JO({plan:Wdt,reset:Hdt}),this.renderTask.context={view:this}}return n.prototype.init=function(e,t){},n.prototype.render=function(e,t,r,i){},n.prototype.highlight=function(e,t,r,i){var a=e.getData(i&&i.dataType);!a||qpe(a,i,"emphasis")},n.prototype.downplay=function(e,t,r,i){var a=e.getData(i&&i.dataType);!a||qpe(a,i,"normal")},n.prototype.remove=function(e,t){this.group.removeAll()},n.prototype.dispose=function(e,t){},n.prototype.updateView=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.updateLayout=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.updateVisual=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.eachRendered=function(e){_w(this.group,e)},n.markUpdateMethod=function(e,t){RFe(e).updateMethod=t},n.protoInitialize=function(){var e=n.prototype;e.type="chart"}(),n}();function Ype(n,e,t){n&&sD(n)&&(e==="emphasis"?h_:c_)(n,t)}function qpe(n,e,t){var r=YE(n,e),i=e&&e.highlightKey!=null?yct(e.highlightKey):null;r!=null?te(Do(r),function(a){Ype(n.getItemGraphicEl(a),t,i)}):n.eachItemGraphicEl(function(a){Ype(a,t,i)})}gie(Wie);Hz(Wie);function Wdt(n){return $dt(n.model)}function Hdt(n){var e=n.model,t=n.ecModel,r=n.api,i=n.payload,a=e.pipelineContext.progressiveRender,o=n.view,s=i&&RFe(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,t,r,i),jdt[l]}var jdt={incrementalPrepareRender:{progress:function(n,e){e.view.incrementalRender(n,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(n,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};const os=Wie;var vG="\0__throttleOriginMethod",Zpe="\0__throttleRate",Kpe="\0__throttleType";function Hie(n,e,t){var r,i=0,a=0,o=null,s,l,u,h;e=e||0;function c(){a=new Date().getTime(),o=null,n.apply(l,u||[])}var f=function(){for(var d=[],v=0;v=0?c():o=setTimeout(c,-s),i=r};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(d){h=d},f}function VI(n,e,t,r){var i=n[e];if(!!i){var a=i[vG]||i,o=i[Kpe],s=i[Zpe];if(s!==t||o!==r){if(t==null||!r)return n[e]=a;i=n[e]=Hie(a,t,r==="debounce"),i[vG]=a,i[Kpe]=r,i[Zpe]=t}return i}}function dD(n,e){var t=n[e];t&&t[vG]&&(t.clear&&t.clear(),n[e]=t[vG])}var Jpe=na(),Qpe={itemStyle:qE(Fke,!0),lineStyle:qE(kke,!0)},Xdt={lineStyle:"stroke",itemStyle:"fill"};function DFe(n,e){var t=n.visualStyleMapper||Qpe[e];return t||(console.warn("Unknown style type '"+e+"'."),Qpe.itemStyle)}function NFe(n,e){var t=n.visualDrawType||Xdt[e];return t||(console.warn("Unknown style type '"+e+"'."),"fill")}var Ydt={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){var t=n.getData(),r=n.visualStyleAccessPath||"itemStyle",i=n.getModel(r),a=DFe(n,r),o=a(i),s=i.getShallow("decal");s&&(t.setVisual("decal",s),s.dirty=!0);var l=NFe(n,r),u=o[l],h=rn(u)?u:null,c=o.fill==="auto"||o.stroke==="auto";if(!o[l]||h||c){var f=n.getColorFromPalette(n.name,null,e.getSeriesCount());o[l]||(o[l]=f,t.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||rn(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||rn(o.stroke)?f:o.stroke}if(t.setVisual("style",o),t.setVisual("drawType",l),!e.isSeriesFiltered(n)&&h)return t.setVisual("colorFromPalette",!1),{dataEach:function(d,v){var p=n.getDataParams(v),g=Mt({},o);g[l]=h(p),d.setItemVisual(v,"style",g)}}}},QL=new as,qdt={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){if(!(n.ignoreStyleOnData||e.isSeriesFiltered(n))){var t=n.getData(),r=n.visualStyleAccessPath||"itemStyle",i=DFe(n,r),a=t.getVisual("drawType");return{dataEach:t.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[r]){QL.option=l[r];var u=i(QL),h=o.ensureUniqueItemVisual(s,"style");Mt(h,u),QL.option.decal&&(o.setItemVisual(s,"decal",QL.option.decal),QL.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},Zdt={performRawSeries:!0,overallReset:function(n){var e=$r();n.eachSeries(function(t){var r=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+r,a=e.get(i);a||(a={},e.set(i,a)),Jpe(t).scope=a}}),n.eachSeries(function(t){if(!(t.isColorBySeries()||n.isSeriesFiltered(t))){var r=t.getRawData(),i={},a=t.getData(),o=Jpe(t).scope,s=t.visualStyleAccessPath||"itemStyle",l=NFe(t,s);a.each(function(u){var h=a.getRawIndex(u);i[h]=u}),r.each(function(u){var h=i[u],c=a.getItemVisual(h,"colorFromPalette");if(c){var f=a.ensureUniqueItemVisual(h,"style"),d=r.getName(u)||u+"",v=r.count();f[l]=t.getColorFromPalette(d,o,v)}})}})}},h4=Math.PI;function Kdt(n,e){e=e||{},sn(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var t=new Cn,r=new ta({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});t.add(r);var i=new la({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new ta({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});t.add(a);var o;return e.showSpinner&&(o=new Tie({shape:{startAngle:-h4/2,endAngle:-h4/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:h4*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:h4*3/2}).delay(300).start("circularInOut"),t.add(o)),t.resize=function(){var s=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(n.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),h=n.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:h}),a.setShape({x:u-l,y:h-l,width:l*2,height:l*2}),r.setShape({x:0,y:0,width:n.getWidth(),height:n.getHeight()})},t.resize(),t}var Jdt=function(){function n(e,t,r,i){this._stageTaskMap=$r(),this.ecInstance=e,this.api=t,r=this._dataProcessorHandlers=r.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=r.concat(i)}return n.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(r){var i=r.overallTask;i&&i.dirty()})},n.prototype.getPerformArgs=function(e,t){if(!!e.__pipeline){var r=this._pipelineMap.get(e.__pipeline.id),i=r.context,a=!t&&r.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>r.blockIndex,o=a?r.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},n.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},n.prototype.updateStreamModes=function(e,t){var r=this._pipelineMap.get(e.uid),i=e.getData(),a=i.count(),o=r.progressiveEnabled&&t.incrementalPrepareRender&&a>=r.threshold,s=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=r.context={progressiveRender:o,modDataCount:l,large:s}},n.prototype.restorePipelines=function(e){var t=this,r=t._pipelineMap=$r();e.eachSeries(function(i){var a=i.getProgressive(),o=i.uid;r.set(o,{id:o,head:null,tail:null,threshold:i.getProgressiveThreshold(),progressiveEnabled:a&&!(i.preventIncremental&&i.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),t._pipe(i,i.dataTask)})},n.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),r=this.api;te(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),o="";Bf(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,t,r),i.overallReset&&this._createOverallStageTask(i,a,t,r)},this)},n.prototype.prepareView=function(e,t,r,i){var a=e.renderTask,o=a.context;o.model=t,o.ecModel=r,o.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},n.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},n.prototype.performVisualTasks=function(e,t,r){this._performStageTasks(this._visualHandlers,e,t,r)},n.prototype._performStageTasks=function(e,t,r,i){i=i||{};var a=!1,o=this;te(e,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var h=o._stageTaskMap.get(l.uid),c=h.seriesTaskMap,f=h.overallTask;if(f){var d,v=f.agentStubMap;v.each(function(g){s(i,g)&&(g.dirty(),d=!0)}),d&&f.dirty(),o.updatePayload(f,r);var p=o.getPerformArgs(f,i.block);v.each(function(g){g.perform(p)}),f.perform(p)&&(a=!0)}else c&&c.each(function(g,m){s(i,g)&&g.dirty();var y=o.getPerformArgs(g,i.block);y.skip=!l.performRawSeries&&t.isSeriesFiltered(g.context.model),o.updatePayload(g,r),g.perform(y)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},n.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(r){t=r.dataTask.perform()||t}),this.unfinished=t||this.unfinished},n.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},n.prototype.updatePayload=function(e,t){t!=="remain"&&(e.context.payload=t)},n.prototype._createSeriesStageTask=function(e,t,r,i){var a=this,o=t.seriesTaskMap,s=t.seriesTaskMap=$r(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?r.eachRawSeries(h):l?r.eachRawSeriesByType(l,h):u&&u(r,i).each(h);function h(c){var f=c.uid,d=s.set(f,o&&o.get(f)||JO({plan:nvt,reset:ivt,count:ovt}));d.context={model:c,ecModel:r,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(c,d)}},n.prototype._createOverallStageTask=function(e,t,r,i){var a=this,o=t.overallTask=t.overallTask||JO({reset:Qdt});o.context={ecModel:r,api:i,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=$r(),u=e.seriesType,h=e.getTargetSeries,c=!0,f=!1,d="";Bf(!e.createOnAllSeries,d),u?r.eachRawSeriesByType(u,v):h?h(r,i).each(v):(c=!1,te(r.getSeries(),v));function v(p){var g=p.uid,m=l.set(g,s&&s.get(g)||(f=!0,JO({reset:evt,onDirty:rvt})));m.context={model:p,overallProgress:c},m.agent=o,m.__block=c,a._pipe(p,m)}f&&o.dirty()},n.prototype._pipe=function(e,t){var r=e.uid,i=this._pipelineMap.get(r);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},n.wrapStageHandler=function(e,t){return rn(e)&&(e={overallReset:e,seriesType:svt(e)}),e.uid=kI("stageHandler"),t&&(e.visualType=t),e},n}();function Qdt(n){n.overallReset(n.ecModel,n.api,n.payload)}function evt(n){return n.overallProgress&&tvt}function tvt(){this.agent.dirty(),this.getDownstream().dirty()}function rvt(){this.agent&&this.agent.dirty()}function nvt(n){return n.plan?n.plan(n.model,n.ecModel,n.api,n.payload):null}function ivt(n){n.useClearVisual&&n.data.clearAllVisual();var e=n.resetDefines=Do(n.reset(n.model,n.ecModel,n.api,n.payload));return e.length>1?Vt(e,function(t,r){return kFe(r)}):avt}var avt=kFe(0);function kFe(n){return function(e,t){var r=t.data,i=t.resetDefines[n];if(i&&i.dataEach)for(var a=e.start;a0&&d===u.length-f.length){var v=u.slice(0,d);v!=="data"&&(t.mainType=v,t[f.toLowerCase()]=l,h=!0)}}s.hasOwnProperty(u)&&(r[u]=l,h=!0),h||(i[u]=l)})}return{cptQuery:t,dataQuery:r,otherQuery:i}},n.prototype.filter=function(e,t){var r=this.eventInfo;if(!r)return!0;var i=r.targetEl,a=r.packedEvent,o=r.model,s=r.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,i,a));function h(c,f,d,v){return c[d]==null||f[v||d]===c[d]}},n.prototype.afterTrigger=function(){this.eventInfo=null},n}(),SJ=["symbol","symbolSize","symbolRotate","symbolOffset"],nge=SJ.concat(["symbolKeepAspect"]),cvt={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){var t=n.getData();if(n.legendIcon&&t.setVisual("legendIcon",n.legendIcon),!n.hasSymbolVisual)return;for(var r={},i={},a=!1,o=0;o=0&&oE(l)?l:.5;var u=n.createRadialGradient(o,s,0,o,s,l);return u}function wJ(n,e,t){for(var r=e.type==="radial"?Avt(n,e,t):Cvt(n,e,t),i=e.colorStops,a=0;a0)?null:n==="dashed"?[4*e,2*e]:n==="dotted"?[e]:ha(n)?[n]:Gt(n)?n:null}function Xie(n){var e=n.style,t=e.lineDash&&e.lineWidth>0&&Ivt(e.lineDash,e.lineWidth),r=e.lineDashOffset;if(t){var i=e.strokeNoScale&&n.getLineScale?n.getLineScale():1;i&&i!==1&&(t=Vt(t,function(a){return a/i}),r/=i)}return[t,r]}var Lvt=new hm(!0);function yG(n){var e=n.stroke;return!(e==null||e==="none"||!(n.lineWidth>0))}function ige(n){return typeof n=="string"&&n!=="none"}function mG(n){var e=n.fill;return e!=null&&e!=="none"}function age(n,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var t=n.globalAlpha;n.globalAlpha=e.fillOpacity*e.opacity,n.fill(),n.globalAlpha=t}else n.fill()}function oge(n,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var t=n.globalAlpha;n.globalAlpha=e.strokeOpacity*e.opacity,n.stroke(),n.globalAlpha=t}else n.stroke()}function bJ(n,e,t){var r=yie(e.image,e.__image,t);if(jz(r)){var i=n.createPattern(r,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*yB),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function Pvt(n,e,t,r){var i,a=yG(t),o=mG(t),s=t.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var h=e.path||Lvt,c=e.__dirty;if(!r){var f=t.fill,d=t.stroke,v=o&&!!f.colorStops,p=a&&!!d.colorStops,g=o&&!!f.image,m=a&&!!d.image,y=void 0,_=void 0,x=void 0,S=void 0,w=void 0;(v||p)&&(w=e.getBoundingRect()),v&&(y=c?wJ(n,f,w):e.__canvasFillGradient,e.__canvasFillGradient=y),p&&(_=c?wJ(n,d,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=_),g&&(x=c||!e.__canvasFillPattern?bJ(n,f,e):e.__canvasFillPattern,e.__canvasFillPattern=x),m&&(S=c||!e.__canvasStrokePattern?bJ(n,d,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),v?n.fillStyle=y:g&&(x?n.fillStyle=x:o=!1),p?n.strokeStyle=_:m&&(S?n.strokeStyle=S:a=!1)}var b=e.getGlobalScale();h.setScale(b[0],b[1],e.segmentIgnoreThreshold);var E,T;n.setLineDash&&t.lineDash&&(i=Xie(e),E=i[0],T=i[1]);var C=!0;(u||c&BC)&&(h.setDPR(n.dpr),l?h.setContext(null):(h.setContext(n),C=!1),h.reset(),e.buildPath(h,e.shape,r),h.toStatic(),e.pathUpdated()),C&&h.rebuildPath(n,l?s:1),E&&(n.setLineDash(E),n.lineDashOffset=T),r||(t.strokeFirst?(a&&oge(n,t),o&&age(n,t)):(o&&age(n,t),a&&oge(n,t))),E&&n.setLineDash([])}function Ovt(n,e,t){var r=e.__image=yie(t.image,e.__image,e,e.onload);if(!(!r||!jz(r))){var i=t.x||0,a=t.y||0,o=e.getWidth(),s=e.getHeight(),l=r.width/r.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=r.width,s=r.height),t.sWidth&&t.sHeight){var u=t.sx||0,h=t.sy||0;n.drawImage(r,u,h,t.sWidth,t.sHeight,i,a,o,s)}else if(t.sx&&t.sy){var u=t.sx,h=t.sy,c=o-u,f=s-h;n.drawImage(r,u,h,c,f,i,a,o,s)}else n.drawImage(r,i,a,o,s)}}function Rvt(n,e,t){var r,i=t.text;if(i!=null&&(i+=""),i){n.font=t.font||RS,n.textAlign=t.textAlign,n.textBaseline=t.textBaseline;var a=void 0,o=void 0;n.setLineDash&&t.lineDash&&(r=Xie(e),a=r[0],o=r[1]),a&&(n.setLineDash(a),n.lineDashOffset=o),t.strokeFirst?(yG(t)&&n.strokeText(i,t.x,t.y),mG(t)&&n.fillText(i,t.x,t.y)):(mG(t)&&n.fillText(i,t.x,t.y),yG(t)&&n.strokeText(i,t.x,t.y)),a&&n.setLineDash([])}}var sge=["shadowBlur","shadowOffsetX","shadowOffsetY"],lge=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function $Fe(n,e,t,r,i){var a=!1;if(!r&&(t=t||{},e===t))return!1;if(r||e.opacity!==t.opacity){hd(n,i),a=!0;var o=Math.max(Math.min(e.opacity,1),0);n.globalAlpha=isNaN(o)?EE.opacity:o}(r||e.blend!==t.blend)&&(a||(hd(n,i),a=!0),n.globalCompositeOperation=e.blend||EE.blend);for(var s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,r,i){if(!this[Cc]){if(this._disposed){this.id;return}var a,o,s;if(dn(r)&&(i=r.lazyUpdate,a=r.silent,o=r.replaceMerge,s=r.transition,r=r.notMerge),this[Cc]=!0,!this._model||r){var l=new qft(this._api),u=this._theme,h=this._model=new lFe;h.scheduler=this._scheduler,h.ssr=this._ssr,h.init(null,null,null,u,this._locale,l)}this._model.setOption(t,{replaceMerge:o},TJ);var c={seriesTransition:s,optionChanged:!0};if(i)this[td]={silent:a,updateParams:c},this[Cc]=!1,this.getZr().wakeUp();else{try{ZT(this),ox.update.call(this,null,c)}catch(f){throw this[td]=null,this[Cc]=!1,f}this._ssr||this._zr.flush(),this[td]=null,this[Cc]=!1,eP.call(this,a),tP.call(this,a)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||sa.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var r=this._zr.painter;return r.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var r=this._zr.painter;return r.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(!!sa.svgSupported){var t=this._zr,r=t.storage.getDisplayList();return te(r,function(i){i.stopAnimation(null,!0)}),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(this._disposed){this.id;return}t=t||{};var r=t.excludeComponents,i=this._model,a=[],o=this;te(r,function(l){i.eachComponent({mainType:l},function(u){var h=o._componentsMap[u.__viewId];h.group.ignore||(a.push(h),h.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return te(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(t){if(this._disposed){this.id;return}var r=t.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(bge[i]){var l=s,u=s,h=-s,c=-s,f=[],d=t&&t.pixelRatio||this.getDevicePixelRatio();te(eR,function(_,x){if(_.group===i){var S=r?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(Sn(t)),w=_.getDom().getBoundingClientRect();l=a(w.left,l),u=a(w.top,u),h=o(w.right,h),c=o(w.bottom,c),f.push({dom:S,left:w.left,top:w.top})}}),l*=d,u*=d,h*=d,c*=d;var v=h-l,p=c-u,g=s_.createCanvas(),m=Cve(g,{renderer:r?"svg":"canvas"});if(m.resize({width:v,height:p}),r){var y="";return te(f,function(_){var x=_.left-l,S=_.top-u;y+=''+_.dom+""}),m.painter.getSvgRoot().innerHTML=y,t.connectedBackgroundColor&&m.painter.setBackgroundColor(t.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}else return t.connectedBackgroundColor&&m.add(new ta({shape:{x:0,y:0,width:v,height:p},style:{fill:t.connectedBackgroundColor}})),te(f,function(_){var x=new xc({style:{x:_.left*d-l,y:_.top*d-u,image:_.dom}});m.add(x)}),m.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}else return this.getDataURL(t)},e.prototype.convertToPixel=function(t,r){return $H(this,"convertToPixel",t,r)},e.prototype.convertFromPixel=function(t,r){return $H(this,"convertFromPixel",t,r)},e.prototype.containPixel=function(t,r){if(this._disposed){this.id;return}var i=this._model,a,o=XO(i,t);return te(o,function(s,l){l.indexOf("Models")>=0&&te(s,function(u){var h=u.coordinateSystem;if(h&&h.containPoint)a=a||!!h.containPoint(r);else if(l==="seriesModels"){var c=this._chartsMap[u.__viewId];c&&c.containPoint&&(a=a||c.containPoint(r,u))}},this)},this),!!a},e.prototype.getVisual=function(t,r){var i=this._model,a=XO(i,t,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?jie(s,l,r):w3(s,r)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;te(apt,function(r){var i=function(a){var o=t.getModel(),s=a.target,l,u=r==="globalout";if(u?l={}:s&&aE(s,function(v){var p=Bn(v);if(p&&p.dataIndex!=null){var g=p.dataModel||o.getSeriesByIndex(p.seriesIndex);return l=g&&g.getDataParams(p.dataIndex,p.dataType,s)||{},!0}else if(p.eventData)return l=Mt({},p.eventData),!0},!0),l){var h=l.componentType,c=l.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",c=l.seriesIndex);var f=h&&c!=null&&o.getComponent(h,c),d=f&&t[f.mainType==="series"?"_chartsMap":"_componentsMap"][f.__viewId];l.event=a,l.type=r,t._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:f,view:d},t.trigger(r,l)}};i.zrEventfulCallAtLast=!0,t._zr.on(r,i,t)}),te(QO,function(r,i){t._messageCenter.on(i,function(a){this.trigger(i,a)},t)}),te(["selectchanged"],function(r){t._messageCenter.on(r,function(i){this.trigger(r,i)},t)}),dvt(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var t=this.getDom();t&&N3e(this.getDom(),Zie,"");var r=this,i=r._api,a=r._model;te(r._componentsViews,function(o){o.dispose(a,i)}),te(r._chartsViews,function(o){o.dispose(a,i)}),r._zr.dispose(),r._dom=r._model=r._chartsMap=r._componentsMap=r._chartsViews=r._componentsViews=r._scheduler=r._api=r._zr=r._throttledZrFlush=r._theme=r._coordSysMgr=r._messageCenter=null,delete eR[r.id]},e.prototype.resize=function(t){if(!this[Cc]){if(this._disposed){this.id;return}this._zr.resize(t);var r=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!r){var i=r.resetOption("media"),a=t&&t.silent;this[td]&&(a==null&&(a=this[td].silent),i=!0,this[td]=null),this[Cc]=!0;try{i&&ZT(this),ox.update.call(this,{type:"resize",animation:Mt({duration:0},t&&t.animation)})}catch(o){throw this[Cc]=!1,o}this[Cc]=!1,eP.call(this,a),tP.call(this,a)}}},e.prototype.showLoading=function(t,r){if(this._disposed){this.id;return}if(dn(t)&&(r=t,t=""),t=t||"default",this.hideLoading(),!!CJ[t]){var i=CJ[t](this._api,r),a=this._zr;this._loadingFX=i,a.add(i)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(t){var r=Mt({},t);return r.type=QO[t.type],r},e.prototype.dispatchAction=function(t,r){if(this._disposed){this.id;return}if(dn(r)||(r={silent:!!r}),!!_G[t.type]&&!!this._model){if(this[Cc]){this._pendingActions.push(t);return}var i=r.silent;HH.call(this,t,i);var a=r.flush;a?this._zr.flush():a!==!1&&sa.browser.weChat&&this._throttledZrFlush(),eP.call(this,i),tP.call(this,i)}},e.prototype.updateLabelLayout=function(){Ng.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed){this.id;return}var r=t.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(r);a.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){ZT=function(c){var f=c._scheduler;f.restorePipelines(c._model),f.prepareStageTasks(),VH(c,!0),VH(c,!1),f.plan()},VH=function(c,f){for(var d=c._model,v=c._scheduler,p=f?c._componentsViews:c._chartsViews,g=f?c._componentsMap:c._chartsMap,m=c._zr,y=c._api,_=0;_f.get("hoverLayerThreshold")&&!sa.node&&!sa.worker&&f.eachSeries(function(g){if(!g.preventUsingHoverLayer){var m=c._chartsMap[g.__viewId];m.__alive&&m.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function o(c,f){var d=c.get("blendMode")||null;f.eachRendered(function(v){v.isGroup||(v.style.blend=d)})}function s(c,f){if(!c.preventAutoZ){var d=c.get("z")||0,v=c.get("zlevel")||0;f.eachRendered(function(p){return l(p,d,v,-1/0),!0})}}function l(c,f,d,v){var p=c.getTextContent(),g=c.getTextGuideLine(),m=c.isGroup;if(m)for(var y=c.childrenRef(),_=0;_0?{duration:p,delay:d.get("delay"),easing:d.get("easing")}:null;f.eachRendered(function(m){if(m.states&&m.states.emphasis){if(FA(m))return;if(m instanceof Si&&mct(m),m.__dirty){var y=m.prevStates;y&&m.useStates(y)}if(v){m.stateTransition=g;var _=m.getTextContent(),x=m.getTextGuideLine();_&&(_.stateTransition=g),x&&(x.stateTransition=g)}m.__dirty&&i(m)}})}Sge=function(c){return new(function(f){$e(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return c._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(v){for(;v;){var p=v.__ecComponentInfo;if(p!=null)return c._model.getComponent(p.mainType,p.index);v=v.parent}},d.prototype.enterEmphasis=function(v,p){h_(v,p),jv(c)},d.prototype.leaveEmphasis=function(v,p){c_(v,p),jv(c)},d.prototype.enterBlur=function(v){nke(v),jv(c)},d.prototype.leaveBlur=function(v){Sie(v),jv(c)},d.prototype.enterSelect=function(v){ike(v),jv(c)},d.prototype.leaveSelect=function(v){ake(v),jv(c)},d.prototype.getModel=function(){return c.getModel()},d.prototype.getViewOfComponentModel=function(v){return c.getViewOfComponentModel(v)},d.prototype.getViewOfSeriesModel=function(v){return c.getViewOfSeriesModel(v)},d}(uFe))(c)},i4e=function(c){function f(d,v){for(var p=0;p=0)){Ege.push(t);var a=GFe.wrapStageHandler(t,i);a.__prio=e,a.__raw=t,n.push(a)}}function h4e(n,e){CJ[n]=e}function dpt(n,e,t){var r=Wvt("registerMap");r&&r(n,e,t)}var vpt=bdt;q2(Yie,Ydt);q2(cU,qdt);q2(cU,Zdt);q2(Yie,cvt);q2(cU,fvt);q2(JFe,Uvt);l4e(cFe);u4e(Xvt,ndt);h4e("default",Kdt);Lm({type:TE,event:TE,update:TE},Hl);Lm({type:CB,event:CB,update:CB},Hl);Lm({type:YO,event:YO,update:YO},Hl);Lm({type:AB,event:AB,update:AB},Hl);Lm({type:qO,event:qO,update:qO},Hl);s4e("light",lvt);s4e("dark",uvt);var Tge=[],ppt={registerPreprocessor:l4e,registerProcessor:u4e,registerPostInit:upt,registerPostUpdate:hpt,registerUpdateLifecycle:Kie,registerAction:Lm,registerCoordinateSystem:cpt,registerLayout:fpt,registerVisual:q2,registerTransform:vpt,registerLoading:h4e,registerMap:dpt,registerImpl:$vt,PRIORITY:rpt,ComponentModel:oa,ComponentView:pl,SeriesModel:Ws,ChartView:os,registerComponentModel:function(n){oa.registerClass(n)},registerComponentView:function(n){pl.registerClass(n)},registerSeriesModel:function(n){Ws.registerClass(n)},registerChartView:function(n){os.registerClass(n)},registerSubTypeDefaulter:function(n,e){oa.registerSubTypeDefaulter(n,e)},registerPainter:function(n,e){Fut(n,e)}};function _i(n){if(Gt(n)){te(n,function(e){_i(e)});return}gi(Tge,n)>=0||(Tge.push(n),rn(n)&&(n={install:n}),n.install(ppt))}function rP(n){return n==null?0:n.length||1}function Cge(n){return n}var gpt=function(){function n(e,t,r,i,a,o){this._old=e,this._new=t,this._oldKeyGetter=r||Cge,this._newKeyGetter=i||Cge,this.context=a,this._diffModeMultiple=o==="multiple"}return n.prototype.add=function(e){return this._add=e,this},n.prototype.update=function(e){return this._update=e,this},n.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},n.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},n.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},n.prototype.remove=function(e){return this._remove=e,this},n.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},n.prototype._executeOneToOne=function(){var e=this._old,t=this._new,r={},i=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,r,a,"_newKeyGetter");for(var o=0;o1){var h=l.shift();l.length===1&&(r[s]=l[0]),this._update&&this._update(h,o)}else u===1?(r[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,r)},n.prototype._executeMultiple=function(){var e=this._old,t=this._new,r={},i={},a=[],o=[];this._initIndexMap(e,r,a,"_oldKeyGetter"),this._initIndexMap(t,i,o,"_newKeyGetter");for(var s=0;s1&&f===1)this._updateManyToOne&&this._updateManyToOne(h,u),i[l]=null;else if(c===1&&f>1)this._updateOneToMany&&this._updateOneToMany(h,u),i[l]=null;else if(c===1&&f===1)this._update&&this._update(h,u),i[l]=null;else if(c>1&&f>1)this._updateManyToMany&&this._updateManyToMany(h,u),i[l]=null;else if(c>1)for(var d=0;d1)for(var s=0;s30}var nP=dn,sx=Vt,bpt=typeof Int32Array>"u"?Array:Int32Array,Ept="e\0\0",Age=-1,Tpt=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],Cpt=["_approximateExtent"],Mge,p4,iP,aP,YH,g4,qH,Apt=function(){function n(e,t){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var r,i=!1;f4e(e)?(r=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,r=e),r=r||["x","y"];for(var a={},o=[],s={},l=!1,u={},h=0;h=t)){var r=this._store,i=r.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===ig;if(l&&!i.pure)for(var u=[],h=e;h0},n.prototype.ensureUniqueItemVisual=function(e,t){var r=this._itemVisuals,i=r[e];i||(i=r[e]={});var a=i[t];return a==null&&(a=this.getVisual(t),Gt(a)?a=a.slice():nP(a)&&(a=Mt({},a)),i[t]=a),a},n.prototype.setItemVisual=function(e,t,r){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,nP(t)?Mt(i,t):i[t]=r},n.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},n.prototype.setLayout=function(e,t){nP(e)?Mt(this._layout,e):this._layout[e]=t},n.prototype.getLayout=function(e){return this._layout[e]},n.prototype.getItemLayout=function(e){return this._itemLayouts[e]},n.prototype.setItemLayout=function(e,t,r){this._itemLayouts[e]=r?Mt(this._itemLayouts[e]||{},t):t},n.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},n.prototype.setItemGraphicEl=function(e,t){var r=this.hostModel&&this.hostModel.seriesIndex;iJ(r,this.dataType,e,t),this._graphicEls[e]=t},n.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},n.prototype.eachItemGraphicEl=function(e,t){te(this._graphicEls,function(r,i){r&&e&&e.call(t,r,i)})},n.prototype.cloneShallow=function(e){return e||(e=new n(this._schema?this._schema:sx(this.dimensions,this._getDimInfo,this),this.hostModel)),YH(e,this),e._store=this._store,e},n.prototype.wrapMethod=function(e,t){var r=this[e];!rn(r)||(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var i=r.apply(this,arguments);return t.apply(this,[i].concat(iie(arguments)))})},n.internalField=function(){Mge=function(e){var t=e._invertedIndicesMap;te(t,function(r,i){var a=e._dimInfos[i],o=a.ordinalMeta,s=e._store;if(o){r=t[i]=new bpt(o.categories.length);for(var l=0;l1&&(l+="__ec__"+h),i[t]=l}}}(),n}();const Df=Apt;function b3(n,e){Bie(n)||(n=Gie(n)),e=e||{};var t=e.coordDimensions||[],r=e.dimensionsDefine||n.dimensionsDefine||[],i=$r(),a=[],o=Ipt(n,t,r,e.dimensionsCount),s=e.canOmitUnusedDimensions&&p4e(o),l=r===n.dimensionsDefine,u=l?v4e(n):d4e(r),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(n,o));for(var c=$r(h),f=new wFe(o),d=0;d0&&(r.name=i+(a-1)),a++,e.set(i,a)}}function Ipt(n,e,t,r){var i=Math.max(n.dimensionsDetectedCount||1,e.length,t.length,r||0);return te(e,function(a){var o;dn(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function Lpt(n,e,t){if(t||e.hasKey(n)){for(var r=0;e.hasKey(n+r);)r++;n+=r}return e.set(n,!0),n}var Ppt=function(){function n(e){this.coordSysDims=[],this.axisMap=$r(),this.categoryAxisMap=$r(),this.coordSysName=e}return n}();function Opt(n){var e=n.get("coordinateSystem"),t=new Ppt(e),r=Rpt[e];if(r)return r(n,t,t.axisMap,t.categoryAxisMap),t}var Rpt={cartesian2d:function(n,e,t,r){var i=n.getReferringComponents("xAxis",uu).models[0],a=n.getReferringComponents("yAxis",uu).models[0];e.coordSysDims=["x","y"],t.set("x",i),t.set("y",a),KT(i)&&(r.set("x",i),e.firstCategoryDimIndex=0),KT(a)&&(r.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(n,e,t,r){var i=n.getReferringComponents("singleAxis",uu).models[0];e.coordSysDims=["single"],t.set("single",i),KT(i)&&(r.set("single",i),e.firstCategoryDimIndex=0)},polar:function(n,e,t,r){var i=n.getReferringComponents("polar",uu).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],t.set("radius",a),t.set("angle",o),KT(a)&&(r.set("radius",a),e.firstCategoryDimIndex=0),KT(o)&&(r.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(n,e,t,r){e.coordSysDims=["lng","lat"]},parallel:function(n,e,t,r){var i=n.ecModel,a=i.getComponent("parallel",n.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();te(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),h=o[l];t.set(h,u),KT(u)&&(r.set(h,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function KT(n){return n.get("type")==="category"}function Dpt(n,e,t){t=t||{};var r=t.byIndex,i=t.stackedCoordDimension,a,o,s;Npt(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(n&&n.get("stack")),u,h,c,f;if(te(a,function(y,_){Or(y)&&(a[_]=y={name:y}),l&&!y.isExtraCoord&&(!r&&!u&&y.ordinalMeta&&(u=y),!h&&y.type!=="ordinal"&&y.type!=="time"&&(!i||i===y.coordDim)&&(h=y))}),h&&!r&&!u&&(r=!0),h){c="__\0ecstackresult_"+n.id,f="__\0ecstackedover_"+n.id,u&&(u.createInvertedIndices=!0);var d=h.coordDim,v=h.type,p=0;te(a,function(y){y.coordDim===d&&p++});var g={name:c,coordDim:d,coordDimIndex:p,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},m={name:f,coordDim:f,coordDimIndex:p+1,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(f,v),m.storeDimIndex=s.ensureCalculationDimension(c,v)),o.appendCalculationDimension(g),o.appendCalculationDimension(m)):(a.push(g),a.push(m))}return{stackedDimension:h&&h.name,stackedByDimension:u&&u.name,isStackedByIndex:r,stackedOverDimension:f,stackResultDimension:c}}function Npt(n){return!f4e(n.schema)}function FS(n,e){return!!e&&e===n.getCalculationInfo("stackedDimension")}function g4e(n,e){return FS(n,e)?n.getCalculationInfo("stackResultDimension"):e}function kpt(n,e){var t=n.get("coordinateSystem"),r=S3.get(t),i;return e&&e.coordSysDims&&(i=Vt(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=SG(l)}return o})),i||(i=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),i}function Fpt(n,e,t){var r,i;return t&&te(n,function(a,o){var s=a.coordDim,l=t.categoryAxisMap.get(s);l&&(r==null&&(r=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&r!=null&&(n[r].otherDims.itemName=0),r}function k_(n,e,t){t=t||{};var r=e.getSourceManager(),i,a=!1;n?(a=!0,i=Gie(n)):(i=r.getSource(),a=i.sourceFormat===ig);var o=Opt(e),s=kpt(e,o),l=t.useEncodeDefaulter,u=rn(l)?l:l?Un(nFe,s,e):null,h={coordDimensions:s,generateCoord:t.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},c=b3(i,h),f=Fpt(c.dimensions,t.createInvertedIndices,o),d=a?null:r.getSharedDataStore(c),v=Dpt(e,{schema:c,store:d}),p=new Df(c,e);p.setCalculationInfo(v);var g=f!=null&&Bpt(i)?function(m,y,_,x){return x===f?_:this.defaultDimValueGetter(m,y,_,x)}:null;return p.hasItemOption=!1,p.initData(a?i:d,null,g),p}function Bpt(n){if(n.sourceFormat===ig){var e=Gpt(n.data||[]);return!Gt(PI(e))}}function Gpt(n){for(var e=0;et[1]&&(t[1]=e[1])},n.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},n.prototype.getExtent=function(){return this._extent.slice()},n.prototype.setExtent=function(e,t){var r=this._extent;isNaN(e)||(r[0]=e),isNaN(t)||(r[1]=t)},n.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},n.prototype.isBlank=function(){return this._isBlank},n.prototype.setBlank=function(e){this._isBlank=e},n}();Hz(y4e);const F_=y4e;var zpt=0,Upt=function(){function n(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++zpt}return n.createByAxisModel=function(e){var t=e.option,r=t.data,i=r&&Vt(r,Vpt);return new n({categories:i,needCollect:!i,deduplication:t.dedplication!==!1})},n.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},n.prototype.parseAndCollect=function(e){var t,r=this._needCollect;if(!Or(e)&&!r)return e;if(r&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return t=i.get(e),t==null&&(r?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},n.prototype._getOrCreateMap=function(){return this._map||(this._map=$r(this.categories))},n}();function Vpt(n){return dn(n)&&n.value!=null?n.value:n+""}const AJ=Upt;function MJ(n){return n.type==="interval"||n.type==="log"}function $pt(n,e,t,r){var i={},a=n[1]-n[0],o=i.interval=A3e(a/e,!0);t!=null&&or&&(o=i.interval=r);var s=i.intervalPrecision=m4e(o),l=i.niceTickExtent=[Pl(Math.ceil(n[0]/o)*o,s),Pl(Math.floor(n[1]/o)*o,s)];return Wpt(l,n),i}function ZH(n){var e=Math.pow(10,die(n)),t=n/e;return t?t===2?t=3:t===3?t=5:t*=2:t=1,Pl(t*e)}function m4e(n){return Ny(n)+2}function Ige(n,e,t){n[e]=Math.max(Math.min(n[e],t[1]),t[0])}function Wpt(n,e){!isFinite(n[0])&&(n[0]=e[0]),!isFinite(n[1])&&(n[1]=e[1]),Ige(n,0,e),Ige(n,1,e),n[0]>n[1]&&(n[0]=n[1])}function fU(n,e){return n>=e[0]&&n<=e[1]}function dU(n,e){return e[1]===e[0]?.5:(n-e[0])/(e[1]-e[0])}function vU(n,e){return n*(e[1]-e[0])+e[0]}var _4e=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;r.type="ordinal";var i=r.getSetting("ordinalMeta");return i||(i=new AJ({})),Gt(i)&&(i=new AJ({categories:Vt(i,function(a){return dn(a)?a.value:a})})),r._ordinalMeta=i,r._extent=r.getSetting("extent")||[0,i.categories.length-1],r}return e.prototype.parse=function(t){return t==null?NaN:Or(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),fU(t,this._extent)&&this._ordinalMeta.categories[t]!=null},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),dU(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(vU(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],r=this._extent,i=r[0];i<=r[1];)t.push({value:i}),i++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(t==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var r=t.ordinalNumbers,i=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,r.length);o=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(F_);F_.registerClass(_4e);const Qie=_4e;var ub=Pl,x4e=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return fU(t,this._extent)},e.prototype.normalize=function(t){return dU(t,this._extent)},e.prototype.scale=function(t){return vU(t,this._extent)},e.prototype.setExtent=function(t,r){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(r)||(i[1]=parseFloat(r))},e.prototype.unionExtent=function(t){var r=this._extent;t[0]r[1]&&(r[1]=t[1]),this.setExtent(r[0],r[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=m4e(t)},e.prototype.getTicks=function(t){var r=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!r)return s;var l=1e4;i[0]l)return[];var h=s.length?s[s.length-1].value:a[1];return i[1]>h&&(t?s.push({value:ub(h+r,o)}):s.push({value:i[1]})),s},e.prototype.getMinorTicks=function(t){for(var r=this.getTicks(!0),i=[],a=this.getExtent(),o=1;oa[0]&&d0&&(a=a===null?s:Math.min(a,s))}t[r]=a}}return t}function b4e(n){var e=Xpt(n),t=[];return te(n,function(r){var i=r.coordinateSystem,a=i.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],h=Math.abs(o[1]-o[0]),c=a.scale.getExtent(),f=Math.abs(c[1]-c[0]);s=u?h/f*u:h}else{var d=r.getData();s=Math.abs(o[1]-o[0])/d.count()}var v=xr(r.get("barWidth"),s),p=xr(r.get("barMaxWidth"),s),g=xr(r.get("barMinWidth")||(M4e(r)?.5:1),s),m=r.get("barGap"),y=r.get("barCategoryGap");t.push({bandWidth:s,barWidth:v,barMaxWidth:p,barMinWidth:g,barGap:m,barCategoryGap:y,axisKey:tae(a),stackId:eae(r)})}),E4e(t)}function E4e(n){var e={};te(n,function(r,i){var a=r.axisKey,o=r.bandWidth,s=e[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[a]=s;var u=r.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var h=r.barWidth;h&&!l[u].width&&(l[u].width=h,h=Math.min(s.remainedWidth,h),s.remainedWidth-=h);var c=r.barMaxWidth;c&&(l[u].maxWidth=c);var f=r.barMinWidth;f&&(l[u].minWidth=f);var d=r.barGap;d!=null&&(s.gap=d);var v=r.barCategoryGap;v!=null&&(s.categoryGap=v)});var t={};return te(e,function(r,i){t[i]={};var a=r.stacks,o=r.bandWidth,s=r.categoryGap;if(s==null){var l=Li(a).length;s=Math.max(35-l*4,15)+"%"}var u=xr(s,o),h=xr(r.gap,1),c=r.remainedWidth,f=r.autoWidthCount,d=(c-u)/(f+(f-1)*h);d=Math.max(d,0),te(a,function(m){var y=m.maxWidth,_=m.minWidth;if(m.width){var x=m.width;y&&(x=Math.min(x,y)),_&&(x=Math.max(x,_)),m.width=x,c-=x+h*x,f--}else{var x=d;y&&yx&&(x=_),x!==d&&(m.width=x,c-=x+h*x,f--)}}),d=(c-u)/(f+(f-1)*h),d=Math.max(d,0);var v=0,p;te(a,function(m,y){m.width||(m.width=d),p=m,v+=m.width*(1+h)}),p&&(v-=p.width*h);var g=-v/2;te(a,function(m,y){t[i][y]=t[i][y]||{bandWidth:o,offset:g,width:m.width},g+=m.width*(1+h)})}),t}function Ypt(n,e,t){if(n&&e){var r=n[tae(e)];return r!=null&&t!=null?r[eae(t)]:r}}function T4e(n,e){var t=w4e(n,e),r=b4e(t);te(t,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=eae(i),u=r[tae(s)][l],h=u.offset,c=u.width;a.setLayout({bandWidth:u.bandWidth,offset:h,size:c})})}function C4e(n){return{seriesType:n,plan:UI(),reset:function(e){if(!!A4e(e)){var t=e.getData(),r=e.coordinateSystem,i=r.getBaseAxis(),a=r.getOtherAxis(i),o=t.getDimensionIndex(t.mapDimension(a.dim)),s=t.getDimensionIndex(t.mapDimension(i.dim)),l=e.get("showBackground",!0),u=t.mapDimension(a.dim),h=t.getCalculationInfo("stackResultDimension"),c=FS(t,u)&&!!t.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),d=qpt(i,a),v=M4e(e),p=e.get("barMinHeight")||0,g=h&&t.getDimensionIndex(h),m=t.getLayout("size"),y=t.getLayout("offset");return{progress:function(_,x){for(var S=_.count,w=v&&Fy(S*3),b=v&&l&&Fy(S*3),E=v&&Fy(S),T=r.master.getRect(),C=f?T.width:T.height,A,M=x.getStore(),I=0;(A=_.next())!=null;){var R=M.get(c?g:o,A),k=M.get(s,A),D=d,G=void 0;c&&(G=+R-M.get(o,A));var W=void 0,z=void 0,V=void 0,q=void 0;if(f){var Y=r.dataToPoint([R,k]);if(c){var le=r.dataToPoint([G,k]);D=le[0]}W=D,z=Y[1]+y,V=Y[0]-D,q=m,Math.abs(V)>>1;n[i][1]i&&(this._approxInterval=i);var s=y4.length,l=Math.min(Zpt(y4,this._approxInterval,0,s),s-1);this._interval=y4[l][1],this._minLevelUnit=y4[Math.max(l-1,0)][0]},e.prototype.parse=function(t){return ha(t)?t:+um(t)},e.prototype.contain=function(t){return fU(this.parse(t),this._extent)},e.prototype.normalize=function(t){return dU(this.parse(t),this._extent)},e.prototype.scale=function(t){return vU(t,this._extent)},e.type="time",e}(BS),y4=[["second",Pie],["minute",Oie],["hour",KO],["quarter-day",KO*6],["half-day",KO*12],["day",Ap*1.2],["half-week",Ap*3.5],["week",Ap*7],["month",Ap*31],["quarter",Ap*95],["half-year",mpe/2],["year",mpe]];function Kpt(n,e,t,r){var i=um(e),a=um(t),o=function(v){return xpe(i,v,r)===xpe(a,v,r)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},h=function(){return u()&&o("hour")},c=function(){return h()&&o("minute")},f=function(){return c()&&o("second")},d=function(){return f()&&o("millisecond")};switch(n){case"year":return s();case"month":return l();case"day":return u();case"hour":return h();case"minute":return c();case"second":return f();case"millisecond":return d()}}function Jpt(n,e){return n/=Ap,n>16?16:n>7.5?7:n>3.5?4:n>1.5?2:1}function Qpt(n){var e=30*Ap;return n/=e,n>6?6:n>3?3:n>2?2:1}function egt(n){return n/=KO,n>12?12:n>6?6:n>3.5?4:n>2?2:1}function Lge(n,e){return n/=e?Oie:Pie,n>30?30:n>20?20:n>15?15:n>10?10:n>5?5:n>2?2:1}function tgt(n){return A3e(n,!0)}function rgt(n,e,t){var r=new Date(n);switch(BA(e)){case"year":case"month":r[Vke(t)](0);case"day":r[$ke(t)](1);case"hour":r[Wke(t)](0);case"minute":r[Hke(t)](0);case"second":r[jke(t)](0),r[Xke(t)](0)}return r.getTime()}function ngt(n,e,t,r){var i=1e4,a=zke,o=0;function s(C,A,M,I,R,k,D){for(var G=new Date(A),W=A,z=G[I]();W1&&k===0&&M.unshift({value:M[0].value-W})}}for(var k=0;k=r[0]&&y<=r[1]&&c++)}var _=(r[1]-r[0])/e;if(c>_*1.5&&f>_/1.5||(u.push(g),c>_||n===a[d]))break}h=[]}}}for(var x=To(Vt(u,function(C){return To(C,function(A){return A.value>=r[0]&&A.value<=r[1]&&!A.notAdd})}),function(C){return C.length>0}),S=[],w=x.length-1,d=0;d0;)a*=10;var s=[Pl(ogt(r[0]/a)*a),Pl(agt(r[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.calcNiceExtent=function(t){tR.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=Tg(t)/Tg(this.base),fU(t,this._extent)},e.prototype.normalize=function(t){return t=Tg(t)/Tg(this.base),dU(t,this._extent)},e.prototype.scale=function(t){return t=vU(t,this._extent),m4(this.base,t)},e.type="log",e}(F_),P4e=rae.prototype;P4e.getMinorTicks=tR.getMinorTicks;P4e.getLabel=tR.getLabel;function _4(n,e){return igt(n,Ny(e))}F_.registerClass(rae);const sgt=rae;var lgt=function(){function n(e,t,r){this._prepareParams(e,t,r)}return n.prototype._prepareParams=function(e,t,r){r[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!h&&(l=0));var f=this._determinedMin,d=this._determinedMax;return f!=null&&(s=f,u=!0),d!=null&&(l=d,h=!0),{min:s,max:l,minFixed:u,maxFixed:h,isBlank:c}},n.prototype.modifyDataMinMax=function(e,t){this[hgt[e]]=t},n.prototype.setDeterminedMinMax=function(e,t){var r=ugt[e];this[r]=t},n.prototype.freeze=function(){this.frozen=!0},n}(),ugt={min:"_determinedMin",max:"_determinedMax"},hgt={min:"_dataMin",max:"_dataMax"};function O4e(n,e,t){var r=n.rawExtentInfo;return r||(r=new lgt(n,e,t),n.rawExtentInfo=r,r)}function x4(n,e){return e==null?null:eD(e)?NaN:n.parse(e)}function R4e(n,e){var t=n.type,r=O4e(n,e,n.getExtent()).calculate();n.setBlank(r.isBlank);var i=r.min,a=r.max,o=e.ecModel;if(o&&t==="time"){var s=w4e("bar",o),l=!1;if(te(s,function(c){l=l||c.getBaseAxis()===e.axis}),l){var u=b4e(s),h=cgt(i,a,e,u);i=h.min,a=h.max}}return{extent:[i,a],fixMin:r.minFixed,fixMax:r.maxFixed}}function cgt(n,e,t,r){var i=t.axis.getExtent(),a=i[1]-i[0],o=Ypt(r,t.axis);if(o===void 0)return{min:n,max:e};var s=1/0;te(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;te(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-n,c=1-(s+l)/a,f=h/c-h;return e+=f*(l/u),n-=f*(s/u),{min:n,max:e}}function pM(n,e){var t=e,r=R4e(n,t),i=r.extent,a=t.get("splitNumber");n instanceof sgt&&(n.base=t.get("logBase"));var o=n.type,s=t.get("interval"),l=o==="interval"||o==="time";n.setExtent(i[0],i[1]),n.calcNiceExtent({splitNumber:a,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:l?t.get("minInterval"):null,maxInterval:l?t.get("maxInterval"):null}),s!=null&&n.setInterval&&n.setInterval(s)}function pU(n,e){if(e=e||n.get("type"),e)switch(e){case"category":return new Qie({ordinalMeta:n.getOrdinalMeta?n.getOrdinalMeta():n.getCategories(),extent:[1/0,-1/0]});case"time":return new L4e({locale:n.ecModel.getLocaleModel(),useUTC:n.ecModel.get("useUTC")});default:return new(F_.getClass(e)||BS)}}function fgt(n){var e=n.scale.getExtent(),t=e[0],r=e[1];return!(t>0&&r>0||t<0&&r<0)}function E3(n){var e=n.getLabelModel().get("formatter"),t=n.type==="category"?n.scale.getExtent()[0]:null;return n.scale.type==="time"?function(r){return function(i,a){return n.scale.getFormattedLabel(i,a,r)}}(e):Or(e)?function(r){return function(i){var a=n.scale.getLabel(i),o=r.replace("{value}",a!=null?a:"");return o}}(e):rn(e)?function(r){return function(i,a){return t!=null&&(a=i.value-t),r(nae(n,i),a,i.level!=null?{level:i.level}:null)}}(e):function(r){return n.scale.getLabel(r)}}function nae(n,e){return n.type==="category"?n.scale.getLabel(e):e.value}function dgt(n){var e=n.model,t=n.scale;if(!(!e.get(["axisLabel","show"])||t.isBlank())){var r,i,a=t.getExtent();t instanceof Qie?i=t.count():(r=t.getTicks(),i=r.length);var o=n.getLabelModel(),s=E3(n),l,u=1;i>40&&(u=Math.ceil(i/40));for(var h=0;hn[1]&&(n[1]=i[1])})}var T3=function(){function n(){}return n.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},n.prototype.getCoordSysModel=function(){},n}(),ggt=1e-8;function Oge(n,e){return Math.abs(n-e)i&&(r=o,i=l)}if(r)return mgt(r.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(t){var r=this._rect;if(r&&!t)return r;var i=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return te(o,function(s){s.type==="polygon"?Rge(s.exterior,i,a,t):te(s.points,function(l){Rge(l,i,a,t)})}),isFinite(i[0])&&isFinite(i[1])&&isFinite(a[0])&&isFinite(a[1])||(i[0]=i[1]=a[0]=a[1]=0),r=new ai(i[0],i[1],a[0]-i[0],a[1]-i[1]),t||(this._rect=r),r},e.prototype.contain=function(t){var r=this.getBoundingRect(),i=this.geometries;if(!r.contain(t[0],t[1]))return!1;e:for(var a=0,o=i.length;a>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,r.push([s/t,l/t])}return r}function Sgt(n,e){return n=xgt(n),Vt(To(n.features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var r=t.properties,i=t.geometry,a=[];switch(i.type){case"Polygon":var o=i.coordinates;a.push(new Dge(o[0],o.slice(1)));break;case"MultiPolygon":te(i.coordinates,function(l){l[0]&&a.push(new Dge(l[0],l.slice(1)))});break;case"LineString":a.push(new Nge([i.coordinates]));break;case"MultiLineString":a.push(new Nge(i.coordinates))}var s=new k4e(r[e||"name"],a,r.cp);return s.properties=r,s})}var gD=na();function wgt(n){return n.type==="category"?Egt(n):Cgt(n)}function bgt(n,e){return n.type==="category"?Tgt(n,e):{ticks:Vt(n.scale.getTicks(),function(t){return t.value})}}function Egt(n){var e=n.getLabelModel(),t=B4e(n,e);return!e.get("show")||n.scale.isBlank()?{labels:[],labelCategoryInterval:t.labelCategoryInterval}:t}function B4e(n,e){var t=G4e(n,"labels"),r=iae(e),i=z4e(t,r);if(i)return i;var a,o;return rn(r)?a=$4e(n,r):(o=r==="auto"?Agt(n):r,a=V4e(n,o)),U4e(t,r,{labels:a,labelCategoryInterval:o})}function Tgt(n,e){var t=G4e(n,"ticks"),r=iae(e),i=z4e(t,r);if(i)return i;var a,o;if((!e.get("show")||n.scale.isBlank())&&(a=[]),rn(r))a=$4e(n,r,!0);else if(r==="auto"){var s=B4e(n,n.getLabelModel());o=s.labelCategoryInterval,a=Vt(s.labels,function(l){return l.tickValue})}else o=r,a=V4e(n,o,!0);return U4e(t,r,{ticks:a,tickCategoryInterval:o})}function Cgt(n){var e=n.scale.getTicks(),t=E3(n);return{labels:Vt(e,function(r,i){return{level:r.level,formattedLabel:t(r,i),rawLabel:n.scale.getLabel(r),tickValue:r.value}})}}function G4e(n,e){return gD(n)[e]||(gD(n)[e]=[])}function z4e(n,e){for(var t=0;t40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=n.dataToCoord(l+1)-n.dataToCoord(l),h=Math.abs(u*Math.cos(r)),c=Math.abs(u*Math.sin(r)),f=0,d=0;l<=a[1];l+=s){var v=0,p=0,g=v3(t({value:l}),e.font,"center","top");v=g.width*1.3,p=g.height*1.3,f=Math.max(f,v,7),d=Math.max(d,p,7)}var m=f/h,y=d/c;isNaN(m)&&(m=1/0),isNaN(y)&&(y=1/0);var _=Math.max(0,Math.floor(Math.min(m,y))),x=gD(n.model),S=n.getExtent(),w=x.lastAutoInterval,b=x.lastTickCount;return w!=null&&b!=null&&Math.abs(w-_)<=1&&Math.abs(b-o)<=1&&w>_&&x.axisExtent0===S[0]&&x.axisExtent1===S[1]?_=w:(x.lastTickCount=o,x.lastAutoInterval=_,x.axisExtent0=S[0],x.axisExtent1=S[1]),_}function Igt(n){var e=n.getLabelModel();return{axisRotate:n.getRotate?n.getRotate():n.isHorizontal&&!n.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function V4e(n,e,t){var r=E3(n),i=n.scale,a=i.getExtent(),o=n.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=a[0],h=i.count();u!==0&&l>1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=D4e(n),f=o.get("showMinLabel")||c,d=o.get("showMaxLabel")||c;f&&u!==a[0]&&p(a[0]);for(var v=u;v<=a[1];v+=l)p(v);d&&v-l!==a[1]&&p(a[1]);function p(g){var m={value:g};s.push(t?g:{formattedLabel:r(m),rawLabel:i.getLabel(m),tickValue:g})}return s}function $4e(n,e,t){var r=n.scale,i=E3(n),a=[];return te(r.getTicks(),function(o){var s=r.getLabel(o),l=o.value;e(o.value,s)&&a.push(t?l:{formattedLabel:i(o),rawLabel:s,tickValue:l})}),a}var kge=[0,1],Lgt=function(){function n(e,t,r){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=r||[0,0]}return n.prototype.contain=function(e){var t=this._extent,r=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=r&&e<=i},n.prototype.containData=function(e){return this.scale.contain(e)},n.prototype.getExtent=function(){return this._extent.slice()},n.prototype.getPixelPrecision=function(e){return T3e(e||this.scale.getExtent(),this._extent)},n.prototype.setExtent=function(e,t){var r=this._extent;r[0]=e,r[1]=t},n.prototype.dataToCoord=function(e,t){var r=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&i.type==="ordinal"&&(r=r.slice(),Fge(r,i.count())),go(e,kge,r,t)},n.prototype.coordToData=function(e,t){var r=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(r=r.slice(),Fge(r,i.count()));var a=go(e,r,kge,t);return this.scale.scale(a)},n.prototype.pointToData=function(e,t){},n.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),r=bgt(this,t),i=r.ticks,a=Vt(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=t.get("alignWithLabel");return Pgt(this,a,o,e.clamp),a},n.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),t=e.get("splitNumber");t>0&&t<100||(t=5);var r=this.scale.getMinorTicks(t),i=Vt(r,function(a){return Vt(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},n.prototype.getViewLabels=function(){return wgt(this).labels},n.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},n.prototype.getTickModel=function(){return this.model.getModel("axisTick")},n.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),r=t[1]-t[0]+(this.onBand?1:0);r===0&&(r=1);var i=Math.abs(e[1]-e[0]);return Math.abs(i)/r},n.prototype.calculateCategoryInterval=function(){return Mgt(this)},n}();function Fge(n,e){var t=n[1]-n[0],r=e,i=t/r/2;n[0]+=i,n[1]-=i}function Pgt(n,e,t,r){var i=e.length;if(!n.onBand||t||!i)return;var a=n.getExtent(),o,s;if(i===1)e[0].coord=a[0],o=e[1]={coord:a[1]};else{var l=e[i-1].tickValue-e[0].tickValue,u=(e[i-1].coord-e[0].coord)/l;te(e,function(d){d.coord-=u/2});var h=n.scale.getExtent();s=1+h[1]-e[i-1].tickValue,o={coord:e[i-1].coord+u*s},e.push(o)}var c=a[0]>a[1];f(e[0].coord,a[0])&&(r?e[0].coord=a[0]:e.shift()),r&&f(a[0],e[0].coord)&&e.unshift({coord:a[0]}),f(a[1],o.coord)&&(r?o.coord=a[1]:e.pop()),r&&f(o.coord,a[1])&&e.push({coord:a[1]});function f(d,v){return d=Pl(d),v=Pl(v),c?d>v:di&&(i+=oP);var d=Math.atan2(s,o);if(d<0&&(d+=oP),d>=r&&d<=i||d+oP>=r&&d+oP<=i)return l[0]=h,l[1]=c,u-t;var v=t*Math.cos(r)+n,p=t*Math.sin(r)+e,g=t*Math.cos(i)+n,m=t*Math.sin(i)+e,y=(v-o)*(v-o)+(p-s)*(p-s),_=(g-o)*(g-o)+(m-s)*(m-s);return y<_?(l[0]=v,l[1]=p,Math.sqrt(y)):(l[0]=g,l[1]=m,Math.sqrt(_))}function bG(n,e,t,r,i,a,o,s){var l=i-n,u=a-e,h=t-n,c=r-e,f=Math.sqrt(h*h+c*c);h/=f,c/=f;var d=l*h+u*c,v=d/f;s&&(v=Math.min(Math.max(v,0),1)),v*=f;var p=o[0]=n+v*h,g=o[1]=e+v*c;return Math.sqrt((p-i)*(p-i)+(g-a)*(g-a))}function W4e(n,e,t,r,i,a,o){t<0&&(n=n+t,t=-t),r<0&&(e=e+r,r=-r);var s=n+t,l=e+r,u=o[0]=Math.min(Math.max(i,n),s),h=o[1]=Math.min(Math.max(a,e),l);return Math.sqrt((u-i)*(u-i)+(h-a)*(h-a))}var zg=[];function Ngt(n,e,t){var r=W4e(e.x,e.y,e.width,e.height,n.x,n.y,zg);return t.set(zg[0],zg[1]),r}function kgt(n,e,t){for(var r=0,i=0,a=0,o=0,s,l,u=1/0,h=e.data,c=n.x,f=n.y,d=0;d0){e=e/180*Math.PI,t0.fromArray(n[0]),rs.fromArray(n[1]),$l.fromArray(n[2]),qn.sub(By,t0,rs),qn.sub(Ly,$l,rs);var t=By.len(),r=Ly.len();if(!(t<.001||r<.001)){By.scale(1/t),Ly.scale(1/r);var i=By.dot(Ly),a=Math.cos(e);if(a1&&qn.copy(wf,$l),wf.toArray(n[1])}}}}function Fgt(n,e,t){if(t<=180&&t>0){t=t/180*Math.PI,t0.fromArray(n[0]),rs.fromArray(n[1]),$l.fromArray(n[2]),qn.sub(By,rs,t0),qn.sub(Ly,$l,rs);var r=By.len(),i=Ly.len();if(!(r<.001||i<.001)){By.scale(1/r),Ly.scale(1/i);var a=By.dot(e),o=Math.cos(t);if(a=l)qn.copy(wf,$l);else{wf.scaleAndAdd(Ly,s/Math.tan(Math.PI/2-h));var c=$l.x!==rs.x?(wf.x-rs.x)/($l.x-rs.x):(wf.y-rs.y)/($l.y-rs.y);if(isNaN(c))return;c<0?qn.copy(wf,rs):c>1&&qn.copy(wf,$l)}wf.toArray(n[1])}}}}function Gge(n,e,t,r){var i=t==="normal",a=i?n:n.ensureState(t);a.ignore=e;var o=r.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=r.getModel("lineStyle").getLineStyle();i?n.useStyle(s):a.style=s}function Bgt(n,e){var t=e.smooth,r=e.points;if(!!r)if(n.moveTo(r[0][0],r[0][1]),t>0&&r.length>=3){var i=Zx(r[0],r[1]),a=Zx(r[1],r[2]);if(!i||!a){n.lineTo(r[1][0],r[1][1]),n.lineTo(r[2][0],r[2][1]);return}var o=Math.min(i,a)*t,s=_B([],r[1],r[0],o/i),l=_B([],r[1],r[2],o/a),u=_B([],s,l,.5);n.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),n.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var h=1;h0&&a&&S(-h/o,0,o);var p=n[0],g=n[o-1],m,y;_(),m<0&&w(-m,.8),y<0&&w(y,.8),_(),x(m,y,1),x(y,m,-1),_(),m<0&&b(-m),y<0&&b(y);function _(){m=p.rect[e]-r,y=i-g.rect[e]-g.rect[t]}function x(E,T,C){if(E<0){var A=Math.min(T,-E);if(A>0){S(A*C,0,o);var M=A+E;M<0&&w(-M*C,1)}else w(-E*C,1)}}function S(E,T,C){E!==0&&(u=!0);for(var A=T;A0)for(var M=0;M0;M--){var D=C[M-1]*k;S(-D,M,o)}}}function b(E){var T=E<0?-1:1;E=Math.abs(E);for(var C=Math.ceil(E/(o-1)),A=0;A0?S(C,0,A+1):S(-C,o-A-1,o),E-=C,E<=0)return}return u}function Ggt(n,e,t,r){return X4e(n,"x","width",e,t,r)}function Y4e(n,e,t,r){return X4e(n,"y","height",e,t,r)}function q4e(n){var e=[];n.sort(function(p,g){return g.priority-p.priority});var t=new ai(0,0,0,0);function r(p){if(!p.ignore){var g=p.ensureState("emphasis");g.ignore==null&&(g.ignore=!1)}p.ignore=!0}for(var i=0;i=0&&r.attr(a.oldLayoutSelect),gi(f,"emphasis")>=0&&r.attr(a.oldLayoutEmphasis)),ma(r,u,t,l)}else if(r.attr(u),!NI(r).valueAnimation){var c=ni(r.style.opacity,1);r.style.opacity=0,Is(r,{style:{opacity:c}},t,l)}if(a.oldLayout=u,r.states.select){var d=a.oldLayoutSelect={};S4(d,u,w4),S4(d,r.states.select,w4)}if(r.states.emphasis){var v=a.oldLayoutEmphasis={};S4(v,u,w4),S4(v,r.states.emphasis,w4)}Nke(r,l,h,t,t)}if(i&&!i.ignore&&!i.invisible){var a=Vgt(i),o=a.oldLayout,p={points:i.shape.points};o?(i.attr({shape:o}),ma(i,{shape:p},t)):(i.setShape(p),i.style.strokePercent=0,Is(i,{style:{strokePercent:1}},t)),a.oldLayout=p}},n}();const Wgt=$gt;var ej=na();function Hgt(n){n.registerUpdateLifecycle("series:beforeupdate",function(e,t,r){var i=ej(t).labelManager;i||(i=ej(t).labelManager=new Wgt),i.clearLabels()}),n.registerUpdateLifecycle("series:layoutlabels",function(e,t,r){var i=ej(t).labelManager;r.updatedSeries.forEach(function(a){i.addLabelsOfSeries(t.getViewOfSeriesModel(a))}),i.updateLayoutConfig(t),i.layout(t),i.processLabelsOverall()})}var tj=Math.sin,rj=Math.cos,Z4e=Math.PI,cb=Math.PI*2,jgt=180/Z4e,Xgt=function(){function n(){}return n.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},n.prototype.moveTo=function(e,t){this._add("M",e,t)},n.prototype.lineTo=function(e,t){this._add("L",e,t)},n.prototype.bezierCurveTo=function(e,t,r,i,a,o){this._add("C",e,t,r,i,a,o)},n.prototype.quadraticCurveTo=function(e,t,r,i){this._add("Q",e,t,r,i)},n.prototype.arc=function(e,t,r,i,a,o){this.ellipse(e,t,r,r,0,i,a,o)},n.prototype.ellipse=function(e,t,r,i,a,o,s,l){var u=s-o,h=!l,c=Math.abs(u),f=tS(c-cb)||(h?u>=cb:-u>=cb),d=u>0?u%cb:u%cb+cb,v=!1;f?v=!0:tS(c)?v=!1:v=d>=Z4e==!!h;var p=e+r*rj(o),g=t+i*tj(o);this._start&&this._add("M",p,g);var m=Math.round(a*jgt);if(f){var y=1/this._p,_=(h?1:-1)*(cb-y);this._add("A",r,i,m,1,+h,e+r*rj(o+_),t+i*tj(o+_)),y>.01&&this._add("A",r,i,m,0,+h,p,g)}else{var x=e+r*rj(s),S=t+i*tj(s);this._add("A",r,i,m,+v,+h,x,S)}},n.prototype.rect=function(e,t,r,i){this._add("M",e,t),this._add("l",r,0),this._add("l",0,i),this._add("l",-r,0),this._add("Z")},n.prototype.closePath=function(){this._d.length>0&&this._add("Z")},n.prototype._add=function(e,t,r,i,a,o,s,l,u){for(var h=[],c=this._p,f=1;f"}function r0t(n){return""}function sae(n,e){e=e||{};var t=e.newline?` `:"";function r(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return t0t(o,s)+(o!=="style"?od(l):l||"")+(a?""+t+Vt(a,function(u){return r(u)}).join(t)+t:"")+r0t(o)}return r(n)}function n0t(n,e,t){t=t||{};var r=t.newline?` `:"",i=" {"+r,a=r+"}",o=Vt(Li(n),function(l){return l+i+Vt(Li(n[l]),function(u){return u+":"+n[l][u]+";"}).join(r)+a}).join(r),s=Vt(Li(e),function(l){return"@keyframes "+l+i+Vt(Li(e[l]),function(u){return u+i+Vt(Li(e[l][u]),function(h){var c=e[l][u][h];return h==="d"&&(c='path("'+c+'")'),h+":"+c+";"}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?"":[""].join(r)}function PJ(n){return{zrId:n,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssClassIdx:0,cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Uge(n,e,t,r){return ih("svg","root",{width:n,height:e,xmlns:J4e,"xmlns:xlink":Q4e,version:"1.1",baseProfile:"full",viewBox:r?"0 0 "+n+" "+e:!1},t)}var Vge={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Pb="transform-origin";function i0t(n,e,t){var r=Mt({},n.shape);Mt(r,e),n.buildPath(t,r);var i=new K4e;return i.reset(v3e(n)),t.rebuildPath(i,1),i.generateStr(),i.getStr()}function a0t(n,e){var t=e.originX,r=e.originY;(t||r)&&(n[Pb]=t+"px "+r+"px")}var o0t={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function t5e(n,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=n,t}function s0t(n,e,t){var r=n.shape.paths,i={},a,o;if(te(r,function(l){var u=PJ(t.zrId);u.animation=!0,gU(l,{},u,!0);var h=u.cssAnims,c=u.cssNodes,f=Li(h),d=f.length;if(!!d){o=f[d-1];var v=h[o];for(var p in v){var g=v[p];i[p]=i[p]||{d:""},i[p].d+=g.d||""}for(var m in c){var y=c[m].animation;y.indexOf(o)>=0&&(a=y)}}}),!!a){e.d=!1;var s=t5e(i,t);return a.replace(o,s)}}function $ge(n){return Or(n)?Vge[n]?"cubic-bezier("+Vge[n]+")":uie(n)?n:"":""}function gU(n,e,t,r){var i=n.animators,a=i.length,o=[];if(n instanceof Cie){var s=s0t(n,e,t);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var oe=t5e(b,t);return oe+" "+y[0]+" both"}}for(var g in l){var s=p(l[g]);s&&o.push(s)}if(o.length){var m=t.zrId+"-cls-"+t.cssClassIdx++;t.cssNodes["."+m]={animation:o.join(",")},e.class=m}}var yD=Math.round;function r5e(n){return n&&Or(n.src)}function n5e(n){return n&&rn(n.toDataURL)}function lae(n,e,t,r){Jgt(function(i,a){var o=i==="fill"||i==="stroke";o&&d3e(a)?a5e(e,n,i,r):o&&hie(a)?o5e(t,n,i,r):n[i]=a},e,t,!1),v0t(t,n,r)}function Wge(n){return tS(n[0]-1)&&tS(n[1])&&tS(n[2])&&tS(n[3]-1)}function l0t(n){return tS(n[4])&&tS(n[5])}function uae(n,e,t){if(e&&!(l0t(e)&&Wge(e))){var r=t?10:1e4;n.transform=Wge(e)?"translate("+yD(e[4]*r)/r+" "+yD(e[5]*r)/r+")":iut(e)}}function Hge(n,e,t){for(var r=n.points,i=[],a=0;a"u"){var g="Image width/height must been given explictly in svg-ssr renderer.";Bf(f,g),Bf(d,g)}else if(f==null||d==null){var m=function(C,A){if(C){var M=C.elm,I=f||A.width,R=d||A.height;C.tag==="pattern"&&(u?(R=1,I/=a.width):h&&(I=1,R/=a.height)),C.attrs.width=I,C.attrs.height=R,M&&(M.setAttribute("width",I),M.setAttribute("height",R))}},y=yie(v,null,n,function(C){l||m(w,C),m(c,C)});y&&y.width&&y.height&&(f=f||y.width,d=d||y.height)}c=ih("image","img",{href:v,width:f,height:d}),o.width=f,o.height=d}else i.svgElement&&(c=Sn(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(!!c){var _,x;l?_=x=1:u?(x=1,_=o.width/a.width):h?(_=1,x=o.height/a.height):o.patternUnits="userSpaceOnUse",_!=null&&!isNaN(_)&&(o.width=_),x!=null&&!isNaN(x)&&(o.height=x);var S=p3e(i);S&&(o.patternTransform=S);var w=ih("pattern","",o,[c]),b=sae(w),E=r.patternCache,T=E[b];T||(T=r.zrId+"-p"+r.patternIdx++,E[b]=T,o.id=T,w=r.defs[T]=ih("pattern",T,o,[c])),e[t]=$z(T)}}function p0t(n,e,t){var r=t.clipPathCache,i=t.defs,a=r[n.id];if(!a){a=t.zrId+"-c"+t.clipPathIdx++;var o={id:a};r[n.id]=a,i[a]=ih("clipPath",a,o,[i5e(n,t)])}e["clip-path"]=$z(a)}function Yge(n){return document.createTextNode(n)}function Hb(n,e,t){n.insertBefore(e,t)}function qge(n,e){n.removeChild(e)}function Zge(n,e){n.appendChild(e)}function s5e(n){return n.parentNode}function l5e(n){return n.nextSibling}function nj(n,e){n.textContent=e}var Kge=58,g0t=120,y0t=ih("","");function OJ(n){return n===void 0}function Ey(n){return n!==void 0}function m0t(n,e,t){for(var r={},i=e;i<=t;++i){var a=n[i].key;a!==void 0&&(r[a]=i)}return r}function aO(n,e){var t=n.key===e.key,r=n.tag===e.tag;return r&&t}function mD(n){var e,t=n.children,r=n.tag;if(Ey(r)){var i=n.elm=e5e(r);if(hae(y0t,n),Gt(t))for(e=0;ea?(v=t[l+1]==null?null:t[l+1].elm,u5e(n,v,t,i,l)):TG(n,e,r,a))}function zC(n,e){var t=e.elm=n.elm,r=n.children,i=e.children;n!==e&&(hae(n,e),OJ(e.text)?Ey(r)&&Ey(i)?r!==i&&_0t(t,r,i):Ey(i)?(Ey(n.text)&&nj(t,""),u5e(t,null,i,0,i.length-1)):Ey(r)?TG(t,r,0,r.length-1):Ey(n.text)&&nj(t,""):n.text!==e.text&&(Ey(r)&&TG(t,r,0,r.length-1),nj(t,e.text)))}function x0t(n,e){if(aO(n,e))zC(n,e);else{var t=n.elm,r=s5e(t);mD(e),r!==null&&(Hb(r,e.elm,l5e(t)),TG(r,[n],0,0))}return e}var S0t=0,w0t=function(){function n(e,t,r){if(this.type="svg",this.refreshHover=Jge(),this.configLayer=Jge(),this.storage=t,this._opts=r=Mt({},r),this.root=e,this._id="zr"+S0t++,this._oldVNode=Uge(r.width,r.height),e&&!r.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=e5e("svg");hae(null,this._oldVNode),i.appendChild(a),e.appendChild(i)}this.resize(r.width,r.height)}return n.prototype.getType=function(){return this.type},n.prototype.getViewportRoot=function(){return this._viewport},n.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},n.prototype.getSvgDom=function(){return this._svgDom},n.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",x0t(this._oldVNode,e),this._oldVNode=e}},n.prototype.renderOneToVNode=function(e){return Xge(e,PJ(this._id))},n.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),r=this._width,i=this._height,a=PJ(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress;var o=[],s=this._bgVNode=b0t(r,i,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=ih("g","main",{},[]);this._paintList(t,a,l?l.children:o),l&&o.push(l);var u=Vt(Li(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(ih("defs","defs",{},u)),e.animation){var h=n0t(a.cssNodes,a.cssAnims,{newline:!0});if(h){var c=ih("style","stl",{},[],h);o.push(c)}}return Uge(r,i,o,e.useViewBox)},n.prototype.renderToString=function(e){return e=e||{},sae(this.renderToVNode({animation:ni(e.cssAnimation,!0),willUpdate:!1,compress:!0,useViewBox:ni(e.useViewBox,!0)}),{newline:!0})},n.prototype.setBackgroundColor=function(e){this._backgroundColor=e},n.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},n.prototype._paintList=function(e,t,r){for(var i=e.length,a=[],o=0,s,l,u=0,h=0;h=0&&!(f&&l&&f[p]===l[p]);p--);for(var g=v-1;g>p;g--)o--,s=a[o-1];for(var m=p+1;m=s)}}for(var c=this.__startIndex;c15)break}}R.prevElClipPaths&&m.restore()};if(y)if(y.length===0)E=g.__endIndex;else for(var C=d.dpr,A=0;A0&&e>i[0]){for(l=0;le);l++);s=r[i[l]]}if(i.splice(l+1,0,e),r[e]=t,!t.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(t.dom,u.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.__painter=this}},n.prototype.eachLayer=function(e,t){for(var r=this._zlevelList,i=0;i0?b4:0),this._needsManuallyCompositing),h.__builtin__||rie("ZLevel "+u+" has been used by unkown layer "+h.id),h!==a&&(h.__used=!0,h.__startIndex!==l&&(h.__dirty=!0),h.__startIndex=l,h.incremental?h.__drawIndex=-1:h.__drawIndex=l,t(l),a=h),i.__dirty&ov&&!i.__inHover&&(h.__dirty=!0,h.incremental&&h.__drawIndex<0&&(h.__drawIndex=l))}t(l),this.eachBuiltinLayer(function(c,f){!c.__used&&c.getElementCount()>0&&(c.__dirty=!0,c.__startIndex=c.__endIndex=c.__drawIndex=0),c.__dirty&&c.__drawIndex<0&&(c.__drawIndex=c.__startIndex)})},n.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},n.prototype._clearLayer=function(e){e.clear()},n.prototype.setBackgroundColor=function(e){this._backgroundColor=e,te(this._layers,function(t){t.setUnpainted()})},n.prototype.configLayer=function(e,t){if(t){var r=this._layerConfig;r[e]?ii(r[e],t,!0):r[e]=t;for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),r},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(Ws);const D0t=R0t;function gM(n,e){var t=n.mapDimensionsAll("defaultedLabel"),r=t.length;if(r===1){var i=dM(n,e,t[0]);return i!=null?i+"":null}else if(r){for(var a=[],o=0;o=0&&r.push(e[a])}return r.join(" ")}var N0t=function(n){$e(e,n);function e(t,r,i,a){var o=n.call(this)||this;return o.updateData(t,r,i,a),o}return e.prototype._createSymbol=function(t,r,i,a,o){this.removeAll();var s=hu(t,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=k0t,this._symbolType=t,this.add(s)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){h_(this.childAt(0))},e.prototype.downplay=function(){c_(this.childAt(0))},e.prototype.setZ=function(t,r){var i=this.childAt(0);i.zlevel=t,i.z=r},e.prototype.setDraggable=function(t,r){var i=this.childAt(0);i.draggable=t,i.cursor=!r&&t?"move":i.cursor},e.prototype.updateData=function(t,r,i,a){this.silent=!1;var o=t.getItemVisual(r,"symbol")||"circle",s=t.hostModel,l=e.getSymbolSize(t,r),u=o!==this._symbolType,h=a&&a.disableAnimation;if(u){var c=t.getItemVisual(r,"symbolKeepAspect");this._createSymbol(o,t,r,l,c)}else{var f=this.childAt(0);f.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};h?f.attr(d):ma(f,d,s,r),x0(f)}if(this._updateCommon(t,r,l,i,a),u){var f=this.childAt(0);if(!h){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,Is(f,d,s,r)}}h&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,r,i,a,o){var s=this.childAt(0),l=t.hostModel,u,h,c,f,d,v,p,g,m;if(a&&(u=a.emphasisItemStyle,h=a.blurItemStyle,c=a.selectItemStyle,f=a.focus,d=a.blurScope,p=a.labelStatesModels,g=a.hoverScale,m=a.cursorStyle,v=a.emphasisDisabled),!a||t.hasItemOption){var y=a&&a.itemModel?a.itemModel:t.getItemModel(r),_=y.getModel("emphasis");u=_.getModel("itemStyle").getItemStyle(),c=y.getModel(["select","itemStyle"]).getItemStyle(),h=y.getModel(["blur","itemStyle"]).getItemStyle(),f=_.get("focus"),d=_.get("blurScope"),v=_.get("disabled"),p=hh(y),g=_.getShallow("scale"),m=y.getShallow("cursor")}var x=t.getItemVisual(r,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var S=Y2(t.getItemVisual(r,"symbolOffset"),i);S&&(s.x=S[0],s.y=S[1]),m&&s.attr("cursor",m);var w=t.getItemVisual(r,"style"),b=w.fill;if(s instanceof xc){var E=s.style;s.useStyle(Mt({image:E.image,x:E.x,y:E.y,width:E.width,height:E.height},w))}else s.__isEmptyBrush?s.useStyle(Mt({},w)):s.useStyle(w),s.style.decal=null,s.setColor(b,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var T=t.getItemVisual(r,"liftZ"),C=this._z2;T!=null?C==null&&(this._z2=s.z2,s.z2+=T):C!=null&&(s.z2=C,this._z2=null);var A=o&&o.useNameLabel;vc(s,p,{labelFetcher:l,labelDataIndex:r,defaultText:M,inheritColor:b,defaultOpacity:w.opacity});function M(k){return A?t.getName(k):gM(t,k)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var I=s.ensureState("emphasis");I.style=u,s.ensureState("select").style=c,s.ensureState("blur").style=h;var R=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;I.scaleX=this._sizeX*R,I.scaleY=this._sizeY*R,this.setSymbolScale(1),vl(this,f,d,v)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,r,i){var a=this.childAt(0),o=Bn(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&NS(l,{style:{opacity:0}},r,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();NS(a,{style:{opacity:0},scaleX:0,scaleY:0},r,{dataIndex:o,cb:t,removeOpt:s})},e.getSymbolSize=function(t,r){return $I(t.getItemVisual(r,"symbolSize"))},e}(Cn);function k0t(n,e){this.parent.drift(n,e)}const C3=N0t;function aj(n,e,t,r){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(r.isIgnore&&r.isIgnore(t))&&!(r.clipShape&&!r.clipShape.contain(e[0],e[1]))&&n.getItemVisual(t,"symbol")!=="none"}function t0e(n){return n!=null&&!dn(n)&&(n={isIgnore:n}),n||{}}function r0e(n){var e=n.hostModel,t=e.getModel("emphasis");return{emphasisItemStyle:t.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:t.get("focus"),blurScope:t.get("blurScope"),emphasisDisabled:t.get("disabled"),hoverScale:t.get("scale"),labelStatesModels:hh(e),cursorStyle:e.get("cursor")}}var F0t=function(){function n(e){this.group=new Cn,this._SymbolCtor=e||C3}return n.prototype.updateData=function(e,t){this._progressiveEls=null,t=t0e(t);var r=this.group,i=e.hostModel,a=this._data,o=this._SymbolCtor,s=t.disableAnimation,l=r0e(e),u={disableAnimation:s},h=t.getSymbolPoint||function(c){return e.getItemLayout(c)};a||r.removeAll(),e.diff(a).add(function(c){var f=h(c);if(aj(e,f,c,t)){var d=new o(e,c,l,u);d.setPosition(f),e.setItemGraphicEl(c,d),r.add(d)}}).update(function(c,f){var d=a.getItemGraphicEl(f),v=h(c);if(!aj(e,v,c,t)){r.remove(d);return}var p=e.getItemVisual(c,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==p)r.remove(d),d=new o(e,c,l,u),d.setPosition(v);else{d.updateData(e,c,l,u);var m={x:v[0],y:v[1]};s?d.attr(m):ma(d,m,i)}r.add(d),e.setItemGraphicEl(c,d)}).remove(function(c){var f=a.getItemGraphicEl(c);f&&f.fadeOut(function(){r.remove(f)},i)}).execute(),this._getSymbolPoint=h,this._data=e},n.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(r,i){var a=e._getSymbolPoint(i);r.setPosition(a),r.markRedraw()})},n.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=r0e(e),this._data=null,this.group.removeAll()},n.prototype.incrementalUpdate=function(e,t,r){this._progressiveEls=[],r=t0e(r);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a0?t=r[0]:r[1]<0&&(t=r[1]),t}function f5e(n,e,t,r){var i=NaN;n.stacked&&(i=t.get(t.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=n.valueStart);var a=n.baseDataOffset,o=[];return o[a]=t.get(n.baseDim,r),o[1-a]=i,e.dataToPoint(o)}function G0t(n,e){var t=[];return e.diff(n).add(function(r){t.push({cmd:"+",idx:r})}).update(function(r,i){t.push({cmd:"=",idx:i,idx1:r})}).remove(function(r){t.push({cmd:"-",idx:r})}).execute(),t}function z0t(n,e,t,r,i,a,o,s){for(var l=G0t(n,e),u=[],h=[],c=[],f=[],d=[],v=[],p=[],g=c5e(i,e,o),m=n.getLayout("points")||[],y=e.getLayout("points")||[],_=0;_=i||p<0)break;if(IE(m,y)){if(l){p+=a;continue}break}if(p===t)n[a>0?"moveTo":"lineTo"](m,y),c=m,f=y;else{var _=m-u,x=y-h;if(_*_+x*x<.5){p+=a;continue}if(o>0){for(var S=p+a,w=e[S*2],b=e[S*2+1];w===m&&b===y&&g=r||IE(w,b))d=m,v=y;else{C=w-u,A=b-h;var R=m-u,k=w-m,D=y-h,G=b-y,W=void 0,z=void 0;if(s==="x"){W=Math.abs(R),z=Math.abs(k);var V=C>0?1:-1;d=m-V*W*o,v=y,M=m+V*z*o,I=y}else if(s==="y"){W=Math.abs(D),z=Math.abs(G);var q=A>0?1:-1;d=m,v=y-q*W*o,M=m,I=y+q*z*o}else W=Math.sqrt(R*R+D*D),z=Math.sqrt(k*k+G*G),T=z/(z+W),d=m-C*o*(1-T),v=y-A*o*(1-T),M=m+C*o*T,I=y+A*o*T,M=lx(M,ux(w,m)),I=lx(I,ux(b,y)),M=ux(M,lx(w,m)),I=ux(I,lx(b,y)),C=M-m,A=I-y,d=m-C*W/z,v=y-A*W/z,d=lx(d,ux(u,m)),v=lx(v,ux(h,y)),d=ux(d,lx(u,m)),v=ux(v,lx(h,y)),C=m-d,A=y-v,M=m+C*z/W,I=y+A*z/W}n.bezierCurveTo(c,f,d,v,m,y),c=M,f=I}else n.lineTo(m,y)}u=m,h=y,p+=a}return g}var d5e=function(){function n(){this.smooth=0,this.smoothConstraint=!0}return n}(),U0t=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="ec-polyline",r}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new d5e},e.prototype.buildPath=function(t,r){var i=r.points,a=0,o=i.length/2;if(r.connectNulls){for(;o>0&&IE(i[o*2-2],i[o*2-1]);o--);for(;a=0){var x=u?(v-l)*_+l:(d-s)*_+s;return u?[t,x]:[x,t]}s=d,l=v;break;case o.C:d=a[c++],v=a[c++],p=a[c++],g=a[c++],m=a[c++],y=a[c++];var S=u?Q8(s,d,p,m,t,h):Q8(l,v,g,y,t,h);if(S>0)for(var w=0;w=0){var x=u?Qu(l,v,g,y,b):Qu(s,d,p,m,b);return u?[t,x]:[x,t]}}s=m,l=y;break}}},e}(Si),V0t=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(d5e),v5e=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="ec-polygon",r}return e.prototype.getDefaultShape=function(){return new V0t},e.prototype.buildPath=function(t,r){var i=r.points,a=r.stackedOnPoints,o=0,s=i.length/2,l=r.smoothMonotone;if(r.connectNulls){for(;s>0&&IE(i[s*2-2],i[s*2-1]);s--);for(;oe){a?t.push(o(a,l,e)):i&&t.push(o(i,l,0),o(i,l,e));break}else i&&(t.push(o(i,l,0)),i=null),t.push(l),a=l}return t}function H0t(n,e,t){var r=n.getVisual("visualMeta");if(!(!r||!r.length||!n.count())&&e.type==="cartesian2d"){for(var i,a,o=r.length-1;o>=0;o--){var s=n.getDimensionInfo(r[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=r[o];break}}if(!!a){var l=e.getAxis(i),u=Vt(a.stops,function(_){return{coord:l.toGlobalCoord(l.dataToCoord(_.value)),color:_.color}}),h=u.length,c=a.outerColors.slice();h&&u[0].coord>u[h-1].coord&&(u.reverse(),c.reverse());var f=W0t(u,i==="x"?t.getWidth():t.getHeight()),d=f.length;if(!d&&h)return u[0].coord<0?c[1]?c[1]:u[h-1].color:c[0]?c[0]:u[0].color;var v=10,p=f[0].coord-v,g=f[d-1].coord+v,m=g-p;if(m<.001)return"transparent";te(f,function(_){_.offset=(_.coord-p)/m}),f.push({offset:d?f[d-1].offset:.5,color:c[1]||"transparent"}),f.unshift({offset:d?f[0].offset:.5,color:c[0]||"transparent"});var y=new y3(0,0,0,0,f,!0);return y[i]=p,y[i+"2"]=g,y}}}function j0t(n,e,t){var r=n.get("showAllSymbol"),i=r==="auto";if(!(r&&!i)){var a=t.getAxesByScale("ordinal")[0];if(!!a&&!(i&&X0t(a,e))){var o=e.mapDimension(a.dim),s={};return te(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function X0t(n,e){var t=n.getExtent(),r=Math.abs(t[1]-t[0])/n.scale.count();isNaN(r)&&(r=0);for(var i=e.count(),a=Math.max(1,Math.round(i/5)),o=0;or)return!1;return!0}function Y0t(n,e){return isNaN(n)||isNaN(e)}function q0t(n){for(var e=n.length/2;e>0&&Y0t(n[e*2-2],n[e*2-1]);e--);return e-1}function s0e(n,e){return[n[e*2],n[e*2+1]]}function Z0t(n,e,t){for(var r=n.length/2,i=t==="x"?0:1,a,o,s=0,l=-1,u=0;u=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function y5e(n){if(n.get(["endLabel","show"]))return!0;for(var e=0;e0&&t.get(["emphasis","lineStyle","width"])==="bolder"){var V=p.getState("emphasis").style;V.lineWidth=+p.style.lineWidth+1}Bn(p).seriesIndex=t.seriesIndex,vl(p,G,W,z);var q=o0e(t.get("smooth")),Y=t.get("smoothMonotone");if(p.setShape({smooth:q,smoothMonotone:Y,connectNulls:E}),g){var le=l.getCalculationInfo("stackedOnSeries"),j=0;g.useStyle(sn(h.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),le&&(j=o0e(le.get("smooth"))),g.setShape({smooth:q,stackedOnSmooth:j,smoothMonotone:Y,connectNulls:E}),dc(g,t,"areaStyle"),Bn(g).seriesIndex=t.seriesIndex,vl(g,G,W,z)}var Q=function(ie){a._changePolyState(ie)};l.eachItemGraphicEl(function(ie){ie&&(ie.onHoverStateChange=Q)}),this._polyline.onHoverStateChange=Q,this._data=l,this._coordSys=o,this._stackedOnPoints=w,this._points=c,this._step=A,this._valueOrigin=x,t.get("triggerLineEvent")&&(this.packEventData(t,p),g&&this.packEventData(t,g))},e.prototype.packEventData=function(t,r){Bn(r).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,r,i,a){var o=t.getData(),s=YE(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var h=l[s*2],c=l[s*2+1];if(isNaN(h)||isNaN(c)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(h,c))return;var f=t.get("zlevel")||0,d=t.get("z")||0;u=new C3(o,s),u.x=h,u.y=c,u.setZ(f,d);var v=u.getSymbolPath().getTextContent();v&&(v.zlevel=f,v.z=d,v.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else os.prototype.highlight.call(this,t,r,i,a)},e.prototype.downplay=function(t,r,i,a){var o=t.getData(),s=YE(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else os.prototype.downplay.call(this,t,r,i,a)},e.prototype._changePolyState=function(t){var r=this._polygon;sG(this._polyline,t),r&&sG(r,t)},e.prototype._newPolyline=function(t){var r=this._polyline;return r&&this._lineGroup.remove(r),r=new U0t({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(r),this._polyline=r,r},e.prototype._newPolygon=function(t,r){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new v5e({shape:{points:t,stackedOnPoints:r},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(t,r,i){var a,o,s=r.getBaseAxis(),l=s.inverse;r.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):r.type==="polar"&&(a=s.dim==="angle",o=!0);var u=t.hostModel,h=u.get("animationDuration");rn(h)&&(h=h(null));var c=u.get("animationDelay")||0,f=rn(c)?c(null):c;t.eachItemGraphicEl(function(d,v){var p=d;if(p){var g=[d.x,d.y],m=void 0,y=void 0,_=void 0;if(i)if(o){var x=i,S=r.pointToCoord(g);a?(m=x.startAngle,y=x.endAngle,_=-S[1]/180*Math.PI):(m=x.r0,y=x.r,_=S[0])}else{var w=i;a?(m=w.x,y=w.x+w.width,_=d.x):(m=w.y+w.height,y=w.y,_=d.y)}var b=y===m?0:(_-m)/(y-m);l&&(b=1-b);var E=rn(c)?c(v):h*b+f,T=p.getSymbolPath(),C=T.getTextContent();p.attr({scaleX:0,scaleY:0}),p.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:E}),C&&C.animateFrom({style:{opacity:0}},{duration:300,delay:E}),T.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(t,r,i){var a=t.getModel("endLabel");if(y5e(t)){var o=t.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new la({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var h=q0t(l);h>=0&&(vc(s,hh(t,"endLabel"),{inheritColor:i,labelFetcher:t,labelDataIndex:h,defaultText:function(c,f,d){return d!=null?h5e(o,d):gM(o,c)},enableTextSetter:!0},K0t(a,r)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,r,i,a,o,s,l){var u=this._endLabel,h=this._polyline;if(u){t<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var c=i.getLayout("points"),f=i.hostModel,d=f.get("connectNulls"),v=s.get("precision"),p=s.get("distance")||0,g=l.getBaseAxis(),m=g.isHorizontal(),y=g.inverse,_=r.shape,x=y?m?_.x:_.y+_.height:m?_.x+_.width:_.y,S=(m?p:0)*(y?-1:1),w=(m?0:-p)*(y?-1:1),b=m?"x":"y",E=Z0t(c,x,b),T=E.range,C=T[1]-T[0],A=void 0;if(C>=1){if(C>1&&!d){var M=s0e(c,T[0]);u.attr({x:M[0]+S,y:M[1]+w}),o&&(A=f.getRawValue(T[0]))}else{var M=h.getPointOn(x,b);M&&u.attr({x:M[0]+S,y:M[1]+w});var I=f.getRawValue(T[0]),R=f.getRawValue(T[1]);o&&(A=k3e(i,v,I,R,E.t))}a.lastFrameIndex=T[0]}else{var k=t===1||a.lastFrameIndex>0?T[0]:0,M=s0e(c,k);o&&(A=f.getRawValue(k)),u.attr({x:M[0]+S,y:M[1]+w})}if(o){var D=NI(u);typeof D.setLabelText=="function"&&D.setLabelText(A)}}},e.prototype._doUpdateAnimation=function(t,r,i,a,o,s,l){var u=this._polyline,h=this._polygon,c=t.hostModel,f=z0t(this._data,t,this._stackedOnPoints,r,this._coordSys,i,this._valueOrigin),d=f.current,v=f.stackedOnCurrent,p=f.next,g=f.stackedOnNext;if(o&&(d=hx(f.current,i,o,l),v=hx(f.stackedOnCurrent,i,o,l),p=hx(f.next,i,o,l),g=hx(f.stackedOnNext,i,o,l)),a0e(d,p)>3e3||h&&a0e(v,g)>3e3){u.stopAnimation(),u.setShape({points:p}),h&&(h.stopAnimation(),h.setShape({points:p,stackedOnPoints:g}));return}u.shape.__points=f.current,u.shape.points=d;var m={shape:{points:p}};f.current!==d&&(m.shape.__points=f.next),u.stopAnimation(),ma(u,m,c),h&&(h.setShape({points:d,stackedOnPoints:v}),h.stopAnimation(),ma(h,{shape:{stackedOnPoints:g}},c),u.shape.points!==h.shape.points&&(h.shape.points=u.shape.points));for(var y=[],_=f.status,x=0;x<_.length;x++){var S=_[x].cmd;if(S==="="){var w=t.getItemGraphicEl(_[x].idx1);w&&y.push({el:w,ptIdx:x})}}u.animators&&u.animators.length&&u.animators[0].during(function(){h&&h.dirtyShape();for(var b=u.shape.__points,E=0;Ee&&(e=n[t]);return isFinite(e)?e:NaN},min:function(n){for(var e=1/0,t=0;t10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),h=l.getExtent(),c=r.getDevicePixelRatio(),f=Math.abs(h[1]-h[0])*(c||1),d=Math.round(s/f);if(isFinite(d)&&d>1){a==="lttb"&&e.setData(i.lttbDownSample(i.mapDimension(u.dim),1/d));var v=void 0;Or(a)?v=eyt[a]:rn(a)&&(v=a),v&&e.setData(i.downSample(i.mapDimension(u.dim),1/d,v,tyt))}}}}}function ryt(n){n.registerChartView(Q0t),n.registerSeriesModel(D0t),n.registerLayout(M3("line",!0)),n.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),r=e.getModel("lineStyle").getLineStyle();r&&!r.stroke&&(r.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",r)}}),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,m5e("line"))}var _5e=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){return k_(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,r,i){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(t),s=a.dataToPoint(o);if(i)te(a.getAxes(),function(f,d){if(f.type==="category"&&r!=null){var v=f.getTicksCoords(),p=o[d],g=r[d]==="x1"||r[d]==="y1";if(g&&(p+=1),v.length<2)return;if(v.length===2){s[d]=f.toGlobalCoord(f.getExtent()[g?1:0]);return}for(var m=void 0,y=void 0,_=1,x=0;xp){y=(S+m)/2;break}x===1&&(_=w-v[0].tickValue)}y==null&&(m?m&&(y=v[v.length-1].coord):y=v[0].coord),s[d]=f.toGlobalCoord(y)}});else{var l=this.getData(),u=l.getLayout("offset"),h=l.getLayout("size"),c=a.getBaseAxis().isHorizontal()?0:1;s[c]+=u+h/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(Ws);Ws.registerClass(_5e);const CG=_5e;var nyt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(){return k_(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),r=this.get("largeThreshold");return r>t&&(t=r),t},e.prototype.brushSelector=function(t,r,i){return i.rect(r.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=xw(CG.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(CG);const iyt=nyt;var ayt=function(){function n(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return n}(),oyt=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="sausage",r}return e.prototype.getDefaultShape=function(){return new ayt},e.prototype.buildPath=function(t,r){var i=r.cx,a=r.cy,o=Math.max(r.r0||0,0),s=Math.max(r.r,0),l=(s-o)*.5,u=o+l,h=r.startAngle,c=r.endAngle,f=r.clockwise,d=Math.PI*2,v=f?c-hMath.PI/2&&hs)return!0;s=c}return!1},e.prototype._isOrderDifferentInView=function(t,r){for(var i=r.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(t.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(t,r,i,a){if(!!this._isOrderChangedWithinSameData(t,r,i)){var o=this._dataSort(t,i,r);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(t,r,i){var a=r.baseAxis,o=this._dataSort(t,a,function(s){return t.get(t.mapDimension(r.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},e.prototype.remove=function(t,r){this._clear(this._model),this._removeOnRenderedListener(r)},e.prototype.dispose=function(t,r){this._removeOnRenderedListener(r)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var r=this.group,i=this._data;t&&t.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){lD(a,t,Bn(a).dataIndex)})):r.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(os),l0e={cartesian2d:function(n,e){var t=e.width<0?-1:1,r=e.height<0?-1:1;t<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height);var i=n.x+n.width,a=n.y+n.height,o=sj(e.x,n.x),s=lj(e.x+e.width,i),l=sj(e.y,n.y),u=lj(e.y+e.height,a),h=si?s:o,e.y=c&&l>a?u:l,e.width=h?0:s-o,e.height=c?0:u-l,t<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height),h||c},polar:function(n,e){var t=e.r0<=e.r?1:-1;if(t<0){var r=e.r;e.r=e.r0,e.r0=r}var i=lj(e.r,n.r),a=sj(e.r0,n.r0);e.r=i,e.r0=a;var o=i-a<0;if(t<0){var r=e.r;e.r=e.r0,e.r0=r}return o}},u0e={cartesian2d:function(n,e,t,r,i,a,o,s,l){var u=new ta({shape:Mt({},r),z2:1});if(u.__dataIndex=t,u.name="item",a){var h=u.shape,c=i?"height":"width";h[c]=0}return u},polar:function(n,e,t,r,i,a,o,s,l){var u=!i&&l?AG:wd,h=new u({shape:r,z2:1});h.name="item";var c=x5e(i);if(h.calculateTextPosition=syt(c,{isRoundCap:u===AG}),a){var f=h.shape,d=i?"r":"endAngle",v={};f[d]=i?r.r0:r.startAngle,v[d]=r[d],(s?ma:Is)(h,{shape:v},a)}return h}};function cyt(n,e){var t=n.get("realtimeSort",!0),r=e.getBaseAxis();if(t&&r.type==="category"&&e.type==="cartesian2d")return{baseAxis:r,otherAxis:e.getOtherAxis(r)}}function h0e(n,e,t,r,i,a,o,s){var l,u;a?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),s||(o?ma:Is)(t,{shape:l},e,i,null);var h=e?n.baseAxis.model:null;(o?ma:Is)(t,{shape:u},h,i)}function c0e(n,e){for(var t=0;t0?1:-1,o=r.height>0?1:-1;return{x:r.x+a*i/2,y:r.y+o*i/2,width:r.width-a*i,height:r.height-o*i}},polar:function(n,e,t){var r=n.getItemLayout(e);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function vyt(n){return n.startAngle!=null&&n.endAngle!=null&&n.startAngle===n.endAngle}function x5e(n){return function(e){var t=e?"Arc":"Angle";return function(r){switch(r){case"start":case"insideStart":case"end":case"insideEnd":return r+t;default:return r}}}(n)}function d0e(n,e,t,r,i,a,o,s){var l=e.getItemVisual(t,"style");if(s){if(!a.get("roundCap")){var h=n.shape,c=lE(r.getModel("itemStyle"),h,!0);Mt(h,c),n.setShape(h)}}else{var u=r.get(["itemStyle","borderRadius"])||0;n.setShape("r",u)}n.useStyle(l);var f=r.getShallow("cursor");f&&n.attr("cursor",f);var d=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?i.height>=0?"bottom":"top":i.width>=0?"right":"left",v=hh(r);vc(n,v,{labelFetcher:a,labelDataIndex:t,defaultText:gM(a.getData(),t),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var p=n.getTextContent();if(s&&p){var g=r.get(["label","position"]);n.textConfig.inside=g==="middle"?!0:null,lyt(n,g==="outside"?d:g,x5e(o),r.get(["label","rotate"]))}Dke(p,v,a.getRawValue(t),function(y){return h5e(e,y)});var m=r.getModel(["emphasis"]);vl(n,m.get("focus"),m.get("blurScope"),m.get("disabled")),dc(n,r),vyt(i)&&(n.style.fill="none",n.style.stroke="none",te(n.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function pyt(n,e){var t=n.get(["itemStyle","borderColor"]);if(!t||t==="none")return 0;var r=n.get(["itemStyle","borderWidth"])||0,i=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(r,i,a)}var gyt=function(){function n(){}return n}(),v0e=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="largeBar",r}return e.prototype.getDefaultShape=function(){return new gyt},e.prototype.buildPath=function(t,r){for(var i=r.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,h=0;h=0?t:null},30,!1);function yyt(n,e,t){for(var r=n.baseDimIdx,i=1-r,a=n.shape.points,o=n.largeDataIndices,s=[],l=[],u=n.barWidth,h=0,c=a.length/3;h=s[0]&&e<=s[0]+l[0]&&t>=s[1]&&t<=s[1]+l[1])return o[h]}return-1}function S5e(n,e,t){if(Z2(t,"cartesian2d")){var r=e,i=t.getArea();return{x:n?r.x:i.x,y:n?i.y:r.y,width:n?r.width:i.width,height:n?i.height:r.height}}else{var i=t.getArea(),a=e;return{cx:i.cx,cy:i.cy,r0:n?i.r0:a.r0,r:n?i.r:a.r,startAngle:n?a.startAngle:0,endAngle:n?a.endAngle:Math.PI*2}}}function myt(n,e,t){var r=n.type==="polar"?wd:ta;return new r({shape:S5e(e,t,n),silent:!0,z2:0})}const _yt=hyt;function xyt(n){n.registerChartView(_yt),n.registerSeriesModel(iyt),n.registerLayout(n.PRIORITY.VISUAL.LAYOUT,Un(T4e,"bar")),n.registerLayout(n.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,C4e("bar")),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,m5e("bar")),n.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var r=e.componentType||"series";t.eachComponent({mainType:r,query:e},function(i){e.sortInfo&&i.axis.setCategorySortInfo(e.sortInfo)})})}var A4=Math.PI*2,y0e=Math.PI/180;function w5e(n,e){return Uu(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function b5e(n,e){var t=w5e(n,e),r=n.get("center"),i=n.get("radius");Gt(i)||(i=[0,i]);var a=xr(t.width,e.getWidth()),o=xr(t.height,e.getHeight()),s=Math.min(a,o),l=xr(i[0],s/2),u=xr(i[1],s/2),h,c,f=n.coordinateSystem;if(f){var d=f.dataToPoint(r);h=d[0]||0,c=d[1]||0}else Gt(r)||(r=[r,r]),h=xr(r[0],a)+t.x,c=xr(r[1],o)+t.y;return{cx:h,cy:c,r0:l,r:u}}function Syt(n,e,t){e.eachSeriesByType(n,function(r){var i=r.getData(),a=i.mapDimension("value"),o=w5e(r,t),s=b5e(r,t),l=s.cx,u=s.cy,h=s.r,c=s.r0,f=-r.get("startAngle")*y0e,d=r.get("minAngle")*y0e,v=0;i.each(a,function(C){!isNaN(C)&&v++});var p=i.getSum(a),g=Math.PI/(p||v)*2,m=r.get("clockwise"),y=r.get("roseType"),_=r.get("stillShowZeroSum"),x=i.getDataExtent(a);x[0]=0;var S=A4,w=0,b=f,E=m?1:-1;if(i.setLayout({viewRect:o,r:h}),i.each(a,function(C,A){var M;if(isNaN(C)){i.setItemLayout(A,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:m,cx:l,cy:u,r0:c,r:y?NaN:h});return}y!=="area"?M=p===0&&_?g:C*g:M=A4/v,Mt?m:g,S=Math.abs(_.label.y-t);if(S>=x.maxY){var w=_.label.x-e-_.len2*i,b=r+_.len,E=Math.abs(w)n.unconstrainedWidth?null:d:null;r.setStyle("width",v)}var p=r.getBoundingRect();a.width=p.width;var g=(r.style.margin||0)+2.1;a.height=p.height+g,a.y-=(a.height-c)/2}}}function uj(n){return n.position==="center"}function Eyt(n){var e=n.getData(),t=[],r,i,a=!1,o=(n.get("minShowLabelAngle")||0)*wyt,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,h=s.x,c=s.y,f=s.height;function d(w){w.ignore=!0}function v(w){if(!w.ignore)return!0;for(var b in w.states)if(w.states[b].ignore===!1)return!0;return!1}e.each(function(w){var b=e.getItemGraphicEl(w),E=b.shape,T=b.getTextContent(),C=b.getTextGuideLine(),A=e.getItemModel(w),M=A.getModel("label"),I=M.get("position")||A.get(["emphasis","label","position"]),R=M.get("distanceToLabelLine"),k=M.get("alignTo"),D=xr(M.get("edgeDistance"),u),G=M.get("bleedMargin"),W=A.getModel("labelLine"),z=W.get("length");z=xr(z,u);var V=W.get("length2");if(V=xr(V,u),Math.abs(E.endAngle-E.startAngle)0?"right":"left":Y>0?"left":"right"}var st=Math.PI,Nt=0,Zt=M.get("rotate");if(ha(Zt))Nt=Zt*(st/180);else if(I==="center")Nt=0;else if(Zt==="radial"||Zt===!0){var qe=Y<0?-q+st:-q;Nt=qe}else if(Zt==="tangential"&&I!=="outside"&&I!=="outer"){var ur=Math.atan2(Y,le);ur<0&&(ur=st*2+ur);var Dt=le>0;Dt&&(ur=st+ur),Nt=ur-st}if(a=!!Nt,T.x=j,T.y=Q,T.rotation=Nt,T.setStyle({verticalAlign:"middle"}),se){T.setStyle({align:oe});var J=T.states.select;J&&(J.x+=T.x,J.y+=T.y)}else{var ft=T.getBoundingRect().clone();ft.applyTransform(T.getComputedTransform());var Oe=(T.style.margin||0)+2.1;ft.y-=Oe/2,ft.height+=Oe,t.push({label:T,labelLine:C,position:I,len:z,len2:V,minTurnAngle:W.get("minTurnAngle"),maxSurfaceAngle:W.get("maxSurfaceAngle"),surfaceNormal:new qn(Y,le),linePoints:ie,textAlign:oe,labelDistance:R,labelAlignTo:k,edgeDistance:D,bleedMargin:G,rect:ft,unconstrainedWidth:ft.width,labelStyleWidth:T.style.width})}b.setTextConfig({inside:se})}}),!a&&n.get("avoidLabelOverlap")&&byt(t,r,i,l,u,f,h,c);for(var p=0;p0){for(var h=o.getItemLayout(0),c=1;isNaN(h&&h.startAngle)&&c=a.r0}},e.type="pie",e}(os);const Ayt=Cyt;function WI(n,e,t){e=Gt(e)&&{coordDimensions:e}||Mt({encodeDefine:n.getEncode()},e);var r=n.getSource(),i=b3(r,e).dimensions,a=new Df(i,n);return a.initData(r,t),a}var Myt=function(){function n(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return n.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},n.prototype.containName=function(e){var t=this._getRawData();return t.indexOfName(e)>=0},n.prototype.indexOfName=function(e){var t=this._getDataWithEncodedVisual();return t.indexOfName(e)},n.prototype.getItemVisual=function(e,t){var r=this._getDataWithEncodedVisual();return r.getItemVisual(e,t)},n}();const L3=Myt;var Iyt=na(),Lyt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new L3(kr(this.getData,this),kr(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.mergeOption=function(){n.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return WI(this,{coordDimensions:["value"],encodeDefaulter:Un(Nie,this)})},e.prototype.getDataParams=function(t){var r=this.getData(),i=Iyt(r),a=i.seats;if(!a){var o=[];r.each(r.mapDimension("value"),function(l){o.push(l)}),a=i.seats=zut(o,r.hostModel.get("percentPrecision"))}var s=n.prototype.getDataParams.call(this,t);return s.percent=a[t]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(t){XE(t,"labelLine",["show"]);var r=t.labelLine,i=t.emphasis.labelLine;r.show=r.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Ws);const Pyt=Lyt;function Oyt(n){return{seriesType:n,reset:function(e,t){var r=e.getData();r.filterSelf(function(i){var a=r.mapDimension("value"),o=r.get(a,i);return!(ha(o)&&!isNaN(o)&&o<0)})}}}function Ryt(n){n.registerChartView(Ayt),n.registerSeriesModel(Pyt),VFe("pie",n.registerAction),n.registerLayout(Un(Syt,"pie")),n.registerProcessor(I3("pie")),n.registerProcessor(Oyt("pie"))}var Dyt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,r){return k_(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return t==null?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t==null?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,r,i){return i.point(r.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(Ws);const Nyt=Dyt;var T5e=4,kyt=function(){function n(){}return n}(),Fyt=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r._off=0,r.hoverDataIdx=-1,r}return e.prototype.getDefaultShape=function(){return new kyt},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,r){var i=r.points,a=r.size,o=this.symbolProxy,s=o.shape,l=t.getContext?t.getContext():t,u=l&&a[0]=0;u--){var h=u*2,c=a[h]-s/2,f=a[h+1]-l/2;if(t>=c&&r>=f&&t<=c+s&&r<=f+l)return u}return-1},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();if(t=i[0],r=i[1],a.contain(t,r)){var o=this.hoverDataIdx=this.findDataIndex(t,r);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var r=this.shape,i=r.points,a=r.size,o=a[0],s=a[1],l=1/0,u=1/0,h=-1/0,c=-1/0,f=0;f=0&&(u.dataIndex=c+(e.startIndex||0))})},n.prototype.remove=function(){this._clear()},n.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},n}();const Gyt=Byt;var zyt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.updateData(a,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,r,i){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(t,r,i){this._symbolDraw.incrementalUpdate(t,r.getData(),{clipShape:this._getClipShape(r)}),this._finished=t.end===r.getData().count()},e.prototype.updateTransform=function(t,r,i){var a=t.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=M3("").reset(t,r,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){var r=t.coordinateSystem,i=r&&r.getArea&&r.getArea();return t.get("clip",!0)?i:null},e.prototype._updateSymbolDraw=function(t,r){var i=this._symbolDraw,a=r.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new Gyt:new A3,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(t,r){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(os);const Uyt=zyt;var Vyt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(oa);const $yt=Vyt;var DJ=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",uu).models[0]},e.type="cartesian2dAxis",e}(oa);gu(DJ,T3);var C5e={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},Wyt=ii({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},C5e),cae=ii({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},C5e),Hyt=ii({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},cae),jyt=sn({logBase:10},cae);const A5e={category:Wyt,value:cae,time:Hyt,log:jyt};var Xyt={value:1,category:1,time:1,log:1};function yM(n,e,t,r){te(Xyt,function(i,a){var o=ii(ii({},A5e[a],!0),r,!0),s=function(l){$e(u,l);function u(){var h=l!==null&&l.apply(this,arguments)||this;return h.type=e+"Axis."+a,h}return u.prototype.mergeDefaultAndTheme=function(h,c){var f=cD(this),d=f?BI(h):{},v=c.getTheme();ii(h,v.get(a+"Axis")),ii(h,this.getDefaultOption()),h.type=_0e(h),f&&kS(h,d,f)},u.prototype.optionUpdated=function(){var h=this.option;h.type==="category"&&(this.__ordinalMeta=AJ.createByAxisModel(this))},u.prototype.getCategories=function(h){var c=this.option;if(c.type==="category")return h?c.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=e+"Axis."+a,u.defaultOption=o,u}(t);n.registerComponentModel(s)}),n.registerSubTypeDefaulter(e+"Axis",_0e)}function _0e(n){return n.type||(n.data?"category":"value")}var Yyt=function(){function n(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return n.prototype.getAxis=function(e){return this._axes[e]},n.prototype.getAxes=function(){return Vt(this._dimList,function(e){return this._axes[e]},this)},n.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),To(this.getAxes(),function(t){return t.scale.type===e})},n.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},n}();const qyt=Yyt;var NJ=["x","y"];function x0e(n){return n.type==="interval"||n.type==="time"}var Zyt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=NJ,t}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,r=this.getAxis("y").scale;if(!(!x0e(t)||!x0e(r))){var i=t.getExtent(),a=r.getExtent(),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var h=(s[0]-o[0])/l,c=(s[1]-o[1])/u,f=o[0]-i[0]*h,d=o[1]-a[0]*c,v=this._transform=[h,0,0,c,f,d];this._invTransform=LI([],v)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var r=this.getAxis("x"),i=this.getAxis("y");return r.contain(r.toLocalCoord(t[0]))&&i.contain(i.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,r){var i=this.dataToPoint(t),a=this.dataToPoint(r),o=this.getArea(),s=new ai(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},e.prototype.dataToPoint=function(t,r,i){i=i||[];var a=t[0],o=t[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return cc(i,t,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,r)),i[1]=l.toGlobalCoord(l.dataToCoord(o,r)),i},e.prototype.clampData=function(t,r){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(t[0]),u=a.parse(t[1]);return r=r||[],r[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),r[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),r},e.prototype.pointToData=function(t,r){var i=[];if(this._invTransform)return cc(i,t,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(t[0]),r),i[1]=o.coordToData(o.toLocalCoord(t[1]),r),i},e.prototype.getOtherAxis=function(t){return this.getAxis(t.dim==="x"?"y":"x")},e.prototype.getArea=function(){var t=this.getAxis("x").getGlobalExtent(),r=this.getAxis("y").getGlobalExtent(),i=Math.min(t[0],t[1]),a=Math.min(r[0],r[1]),o=Math.max(t[0],t[1])-i,s=Math.max(r[0],r[1])-a;return new ai(i,a,o,s)},e}(qyt),Kyt=function(n){$e(e,n);function e(t,r,i,a,o){var s=n.call(this,t,r,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.getGlobalExtent=function(t){var r=this.getExtent();return r[0]=this.toGlobalCoord(r[0]),r[1]=this.toGlobalCoord(r[1]),t&&r[0]>r[1]&&r.reverse(),r},e.prototype.pointToData=function(t,r){return this.coordToData(this.toLocalCoord(t[this.dim==="x"?0:1]),r)},e.prototype.setCategorySortInfo=function(t){if(this.type!=="category")return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(D0);const Jyt=Kyt;function kJ(n,e,t){t=t||{};var r=n.coordinateSystem,i=e.axis,a={},o=i.getAxesOnZeroOf()[0],s=i.position,l=o?"onZero":s,u=i.dim,h=r.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],f={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,v=u==="x"?[c[2]-d,c[3]+d]:[c[0]-d,c[1]+d];if(o){var p=o.toGlobalCoord(o.dataToCoord(0));v[f.onZero]=Math.max(Math.min(p,v[1]),v[0])}a.position=[u==="y"?v[f[l]]:c[0],u==="x"?v[f[l]]:c[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var g={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=g[s],a.labelOffset=o?v[f[s]]-v[f.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),Gh(t.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var m=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-m:m,a.z2=1,a}function S0e(n){return n.get("coordinateSystem")==="cartesian2d"}function w0e(n){var e={xAxisModel:null,yAxisModel:null};return te(e,function(t,r){var i=r.replace(/Model$/,""),a=n.getReferringComponents(i,uu).models[0];e[r]=a}),e}var hj=Math.log;function M5e(n,e,t){var r=BS.prototype,i=r.getTicks.call(t),a=r.getTicks.call(t,!0),o=i.length-1,s=r.getInterval.call(t),l=R4e(n,e),u=l.extent,h=l.fixMin,c=l.fixMax;if(n.type==="log"){var f=hj(n.base);u=[hj(u[0])/f,hj(u[1])/f]}n.setExtent(u[0],u[1]),n.calcNiceExtent({splitNumber:o,fixMin:h,fixMax:c});var d=r.getExtent.call(n);h&&(u[0]=d[0]),c&&(u[1]=d[1]);var v=r.getInterval.call(n),p=u[0],g=u[1];if(h&&c)v=(g-p)/o;else if(h)for(g=u[0]+v*o;gu[0]&&isFinite(p)&&isFinite(u[0]);)v=ZH(v),p=u[1]-v*o;else{var m=n.getTicks().length-1;m>o&&(v=ZH(v));var y=v*o;g=Math.ceil(u[1]/v)*v,p=Pl(g-y),p<0&&u[0]>=0?(p=0,g=Pl(y)):g>0&&u[1]<=0&&(g=0,p=-Pl(y))}var _=(i[0].value-a[0].value)/s,x=(i[o].value-a[o].value)/s;r.setExtent.call(n,p+v*_,g+v*x),r.setInterval.call(n,v),(_||x)&&r.setNiceExtent.call(n,p+v,g-v)}var Qyt=function(){function n(e,t,r){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=NJ,this._initCartesian(e,t,r),this.model=e}return n.prototype.getRect=function(){return this._rect},n.prototype.update=function(e,t){var r=this._axesMap;this._updateScale(e,this.model);function i(o){var s,l=Li(o),u=l.length;if(!!u){for(var h=[],c=u-1;c>=0;c--){var f=+l[c],d=o[f],v=d.model,p=d.scale;MJ(p)&&v.get("alignTicks")&&v.get("interval")==null?h.push(d):(pM(p,v),MJ(p)&&(s=d))}h.length&&(s||(s=h.pop(),pM(s.scale,s.model)),te(h,function(g){M5e(g.scale,g.model,s.scale)}))}}i(r.x),i(r.y);var a={};te(r.x,function(o){b0e(r,"y",o,a)}),te(r.y,function(o){b0e(r,"x",o,a)}),this.resize(this.model,t)},n.prototype.resize=function(e,t,r){var i=e.getBoxLayoutParams(),a=!r&&e.get("containLabel"),o=Uu(i,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(te(s,function(u){if(!u.model.get(["axisLabel","inside"])){var h=dgt(u);if(h){var c=u.isHorizontal()?"height":"width",f=u.model.get(["axisLabel","margin"]);o[c]-=h[c]+f,u.position==="top"?o.y+=h.height+f:u.position==="left"&&(o.x+=h.width+f)}}}),l()),te(this._coordsList,function(u){u.calcAffineTransform()});function l(){te(s,function(u){var h=u.isHorizontal(),c=h?[0,o.width]:[0,o.height],f=u.inverse?1:0;u.setExtent(c[f],c[1-f]),emt(u,h?o.x:o.y)})}},n.prototype.getAxis=function(e,t){var r=this._axesMap[e];if(r!=null)return r[t||0]},n.prototype.getAxes=function(){return this._axesList.slice()},n.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var r="x"+e+"y"+t;return this._coordsMap[r]}dn(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,a=this._coordsList;i0?"top":"bottom",a="center"):aG(i-rS)?(o=r>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=r>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},n.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},n.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},n}(),T0e={axisLine:function(n,e,t,r){var i=e.get(["axisLine","show"]);if(i==="auto"&&n.handleAutoShown&&(i=n.handleAutoShown("axisLine")),!!i){var a=e.axis.getExtent(),o=r.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(cc(s,s,o),cc(l,l,o));var h=Mt({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new zh({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:h,strokeContainThreshold:n.strokeContainThreshold||5,silent:!0,z2:1});fM(c.shape,c.style.lineWidth),c.anid="line",t.add(c);var f=e.get(["axisLine","symbol"]);if(f!=null){var d=e.get(["axisLine","symbolSize"]);Or(f)&&(f=[f,f]),(Or(d)||ha(d))&&(d=[d,d]);var v=Y2(e.get(["axisLine","symbolOffset"])||0,d),p=d[0],g=d[1];te([{rotate:n.rotation+Math.PI/2,offset:v[0],r:0},{rotate:n.rotation-Math.PI/2,offset:v[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(m,y){if(f[y]!=="none"&&f[y]!=null){var _=hu(f[y],-p/2,-g/2,p,g,h.stroke,!0),x=m.r+m.offset,S=u?l:s;_.attr({rotation:m.rotate,x:S[0]+x*Math.cos(n.rotation),y:S[1]-x*Math.sin(n.rotation),silent:!0,z2:11}),t.add(_)}})}}},axisTickLabel:function(n,e,t,r){var i=imt(t,r,e,n),a=omt(t,r,e,n);if(nmt(e,a,i),amt(t,r,e,n.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=j4e(Vt(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));q4e(o)}},axisName:function(n,e,t,r){var i=Gh(n.axisName,e.get("name"));if(!!i){var a=e.get("nameLocation"),o=n.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=e.axis.getExtent(),h=u[0]>u[1]?-1:1,c=[a==="start"?u[0]-h*l:a==="end"?u[1]+h*l:(u[0]+u[1])/2,A0e(a)?n.labelOffset+o*l:0],f,d=e.get("nameRotate");d!=null&&(d=d*rS/180);var v;A0e(a)?f=LE.innerTextLayout(n.rotation,d!=null?d:n.rotation,o):(f=rmt(n.rotation,a,d||0,u),v=n.axisNameAvailableWidth,v!=null&&(v=Math.abs(v/Math.sin(f.rotation)),!isFinite(v)&&(v=null)));var p=s.getFont(),g=e.get("nameTruncate",!0)||{},m=g.ellipsis,y=Gh(n.nameTruncateMaxWidth,g.maxWidth,v),_=new la({x:c[0],y:c[1],rotation:f.rotation,silent:LE.isLabelSilent(e),style:is(s,{text:i,font:p,overflow:"truncate",width:y,ellipsis:m,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||f.textAlign,verticalAlign:s.get("verticalAlign")||f.textVerticalAlign}),z2:1});if(DI({el:_,componentModel:e,itemName:i}),_.__fullText=i,_.anid="name",e.get("triggerEvent")){var x=LE.makeAxisEventDataBase(e);x.targetType="axisName",x.name=i,Bn(_).eventData=x}r.add(_),_.updateTransform(),t.add(_),_.decomposeTransform()}}};function rmt(n,e,t,r){var i=C3e(t-n),a,o,s=r[0]>r[1],l=e==="start"&&!s||e!=="start"&&s;return aG(i-rS/2)?(o=l?"bottom":"top",a="center"):aG(i-rS*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",irS/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function nmt(n,e,t){if(!D4e(n.axis)){var r=n.get(["axisLabel","showMinLabel"]),i=n.get(["axisLabel","showMaxLabel"]);e=e||[],t=t||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],u=t[0],h=t[1],c=t[t.length-1],f=t[t.length-2];r===!1?(Xv(a),Xv(u)):C0e(a,o)&&(r?(Xv(o),Xv(h)):(Xv(a),Xv(u))),i===!1?(Xv(s),Xv(c)):C0e(l,s)&&(i?(Xv(l),Xv(f)):(Xv(s),Xv(c)))}}function Xv(n){n&&(n.ignore=!0)}function C0e(n,e){var t=n&&n.getBoundingRect().clone(),r=e&&e.getBoundingRect().clone();if(!(!t||!r)){var i=Vz([]);return j2(i,i,-n.rotation),t.applyTransform($1([],i,n.getLocalTransform())),r.applyTransform($1([],i,e.getLocalTransform())),t.intersect(r)}}function A0e(n){return n==="middle"||n==="center"}function I5e(n,e,t,r,i){for(var a=[],o=[],s=[],l=0;l=0||n===e}function fmt(n){var e=fae(n);if(!!e){var t=e.axisPointerModel,r=e.axis.scale,i=t.option,a=t.get("status"),o=t.get("value");o!=null&&(o=r.parse(o));var s=FJ(t);a==null&&(i.status=s?"show":"hide");var l=r.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o0&&!v.min?v.min=0:v.min!=null&&v.min<0&&!v.max&&(v.max=0);var p=l;v.color!=null&&(p=sn({color:v.color},l));var g=ii(Sn(v),{boundaryGap:t,splitNumber:r,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:v.text,showName:u,nameLocation:"end",nameGap:c,nameTextStyle:p,triggerEvent:f},!1);if(Or(h)){var m=g.name;g.name=h.replace("{value}",m!=null?m:"")}else rn(h)&&(g.name=h(g.name,g));var y=new as(g,null,this.ecModel);return gu(y,T3.prototype),y.mainType="radar",y.componentIndex=this.componentIndex,y},this);this._indicatorModels=d},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:ii({lineStyle:{color:"#bbb"}},sP.axisLine),axisLabel:M4(sP.axisLabel,!1),axisTick:M4(sP.axisTick,!1),splitLine:M4(sP.splitLine,!0),splitArea:M4(sP.splitArea,!0),indicator:[]},e}(oa);const Mmt=Amt;var Imt=["axisLine","axisTickLabel","axisName"],Lmt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group;a.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var r=t.coordinateSystem,i=r.getIndicatorAxes(),a=Vt(i,function(o){var s=o.model.get("showName")?o.name:"",l=new d_(o.model,{axisName:s,position:[r.cx,r.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return l});te(a,function(o){te(Imt,o.add,o),this.group.add(o.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(t){var r=t.coordinateSystem,i=r.getIndicatorAxes();if(!i.length)return;var a=t.get("shape"),o=t.getModel("splitLine"),s=t.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),h=o.get("show"),c=s.get("show"),f=l.get("color"),d=u.get("color"),v=Gt(f)?f:[f],p=Gt(d)?d:[d],g=[],m=[];function y(k,D,G){var W=G%D.length;return k[W]=k[W]||[],W}if(a==="circle")for(var _=i[0].getTicksCoords(),x=r.cx,S=r.cy,w=0;w<_.length;w++){if(h){var b=y(g,v,w);g[b].push(new cm({shape:{cx:x,cy:S,r:_[w].coord}}))}if(c&&w<_.length-1){var b=y(m,p,w);m[b].push(new Kz({shape:{cx:x,cy:S,r0:_[w].coord,r:_[w+1].coord}}))}}else for(var E,T=Vt(i,function(k,D){var G=k.getTicksCoords();return E=E==null?G.length-1:Math.min(G.length-1,E),Vt(G,function(W){return r.coordToPoint(W.coord,D)})}),C=[],w=0;w<=E;w++){for(var A=[],M=0;M3?1.4:o>1?1.2:1.1,h=a>0?u:1/u;dj(this,"zoom","zoomOnMouseWheel",t,{scale:h,originX:s,originY:l,isAvailableBehavior:null})}if(i){var c=Math.abs(a),f=(a>0?1:-1)*(c>3?.4:c>1?.15:.05);dj(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:f,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!R0e(this._zr,"globalPan")){var r=t.pinchScale>1?1.1:1/1.1;dj(this,"zoom",null,t,{scale:r,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(ng);function dj(n,e,t,r,i){n.pointerChecker&&n.pointerChecker(r,i.originX,i.originY)&&(l_(r.event),N5e(n,e,t,r,i))}function N5e(n,e,t,r,i){i.isAvailableBehavior=kr(RB,null,t,r),n.trigger(e,i)}function RB(n,e,t){var r=t[n];return!n||r&&(!Or(r)||e.event[r+"Key"])}const P3=zmt;function vae(n,e,t){var r=n.target;r.x+=e,r.y+=t,r.dirty()}function pae(n,e,t,r){var i=n.target,a=n.zoomLimit,o=n.zoom=n.zoom||1;if(o*=e,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/n.zoom;n.zoom=o,i.x-=(t-i.x)*(u-1),i.y-=(r-i.y)*(u-1),i.scaleX*=u,i.scaleY*=u,i.dirty()}var Umt={axisPointer:1,tooltip:1,brush:1};function mU(n,e,t){var r=e.getComponentByElement(n.topTarget),i=r&&r.coordinateSystem;return r&&r!==t&&!Umt.hasOwnProperty(r.mainType)&&i&&i.model!==t}function k5e(n){if(Or(n)){var e=new DOMParser;n=e.parseFromString(n,"text/xml")}var t=n;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!=="svg"||t.nodeType!==1;)t=t.nextSibling;return t}var vj,MG={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},D0e=Li(MG),IG={"alignment-baseline":"textBaseline","stop-color":"stopColor"},N0e=Li(IG),Vmt=function(){function n(){this._defs={},this._root=null}return n.prototype.parse=function(e,t){t=t||{};var r=k5e(e);this._defsUsePending=[];var i=new Cn;this._root=i;var a=[],o=r.getAttribute("viewBox")||"",s=parseFloat(r.getAttribute("width")||t.width),l=parseFloat(r.getAttribute("height")||t.height);isNaN(s)&&(s=null),isNaN(l)&&(l=null),qd(r,i,null,!0,!1);for(var u=r.firstChild;u;)this._parseNode(u,i,a,null,!1,!1),u=u.nextSibling;Hmt(this._defs,this._defsUsePending),this._defsUsePending=[];var h,c;if(o){var f=_U(o);f.length>=4&&(h={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(h&&s!=null&&l!=null&&(c=B5e(h,{x:0,y:0,width:s,height:l}),!t.ignoreViewBox)){var d=i;i=new Cn,i.add(d),d.scaleX=d.scaleY=c.scale,d.x=c.x,d.y=c.y}return!t.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new ta({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:h,viewBoxTransform:c,named:a}},n.prototype._parseNode=function(e,t,r,i,a,o){var s=e.nodeName.toLowerCase(),l,u=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=t;else{if(!a){var h=vj[s];if(h&&Fr(vj,s)){l=h.call(this,e,t);var c=e.getAttribute("name");if(c){var f={name:c,namedFrom:null,svgNodeTagLower:s,el:l};r.push(f),s==="g"&&(u=f)}else i&&r.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});t.add(l)}}var d=k0e[s];if(d&&Fr(k0e,s)){var v=d.call(this,e),p=e.getAttribute("id");p&&(this._defs[p]=v)}}if(l&&l.isGroup)for(var g=e.firstChild;g;)g.nodeType===1?this._parseNode(g,l,r,u,a,o):g.nodeType===3&&o&&this._parseText(g,l),g=g.nextSibling},n.prototype._parseText=function(e,t){var r=new aD({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),$mt(r,t);var i=r.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,r.scaleX*=a/9,r.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=r.getBoundingRect();return this._textX+=s.width,t.add(r),r},n.internalField=function(){vj={g:function(e,t){var r=new Cn;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r},rect:function(e,t){var r=new ta;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),r.silent=!0,r},circle:function(e,t){var r=new cm;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),r.silent=!0,r},line:function(e,t){var r=new zh;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),r.silent=!0,r},ellipse:function(e,t){var r=new Eie;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),r.silent=!0,r},polygon:function(e,t){var r=e.getAttribute("points"),i;r&&(i=G0e(r));var a=new bd({shape:{points:i||[]},silent:!0});return Yv(t,a),qd(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var r=e.getAttribute("points"),i;r&&(i=G0e(r));var a=new Gd({shape:{points:i||[]},silent:!0});return Yv(t,a),qd(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var r=new xc;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),r.silent=!0,r},text:function(e,t){var r=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(r)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new Cn;return Yv(t,s),qd(e,s,this._defsUsePending,!1,!0),s},tspan:function(e,t){var r=e.getAttribute("x"),i=e.getAttribute("y");r!=null&&(this._textX=parseFloat(r)),i!=null&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",s=new Cn;return Yv(t,s),qd(e,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(e,t){var r=e.getAttribute("d")||"",i=fke(r);return Yv(t,i),qd(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),n}(),k0e={lineargradient:function(n){var e=parseInt(n.getAttribute("x1")||"0",10),t=parseInt(n.getAttribute("y1")||"0",10),r=parseInt(n.getAttribute("x2")||"10",10),i=parseInt(n.getAttribute("y2")||"0",10),a=new y3(e,t,r,i);return F0e(n,a),B0e(n,a),a},radialgradient:function(n){var e=parseInt(n.getAttribute("cx")||"0",10),t=parseInt(n.getAttribute("cy")||"0",10),r=parseInt(n.getAttribute("r")||"0",10),i=new Tke(e,t,r);return F0e(n,i),B0e(n,i),i}};function F0e(n,e){var t=n.getAttribute("gradientUnits");t==="userSpaceOnUse"&&(e.global=!0)}function B0e(n,e){for(var t=n.firstChild;t;){if(t.nodeType===1&&t.nodeName.toLocaleLowerCase()==="stop"){var r=t.getAttribute("offset"),i=void 0;r&&r.indexOf("%")>0?i=parseInt(r,10)/100:r?i=parseFloat(r):i=0;var a={};F5e(t,a,a);var o=a.stopColor||t.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:i,color:o})}t=t.nextSibling}}function Yv(n,e){n&&n.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),sn(e.__inheritedStyle,n.__inheritedStyle))}function G0e(n){for(var e=_U(n),t=[],r=0;r0;a-=2){var o=r[a],s=r[a-1],l=_U(o);switch(i=i||Up(),s){case"translate":sm(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":lie(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":j2(i,i,-parseFloat(l[0])*pj);break;case"skewX":var u=Math.tan(parseFloat(l[0])*pj);$1(i,[1,0,u,1,0,0],i);break;case"skewY":var h=Math.tan(parseFloat(l[0])*pj);$1(i,[1,h,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}e.setLocalTransform(i)}}var U0e=/([^\s:;]+)\s*:\s*([^:;]+)/g;function F5e(n,e,t){var r=n.getAttribute("style");if(!!r){U0e.lastIndex=0;for(var i;(i=U0e.exec(r))!=null;){var a=i[1],o=Fr(MG,a)?MG[a]:null;o&&(e[o]=i[2]);var s=Fr(IG,a)?IG[a]:null;s&&(t[s]=i[2])}}}function qmt(n,e,t){for(var r=0;r0,g={api:r,geo:l,mapOrGeoModel:e,data:s,isVisualEncodedByVisualMap:p,isGeo:o,transformInfoRaw:f};l.resourceType==="geoJSON"?this._buildGeoJSON(g):l.resourceType==="geoSVG"&&this._buildSVG(g),this._updateController(e,t,r),this._updateMapSelectHandler(e,u,r,i)},n.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=$r(),r=$r(),i=this._regionsGroup,a=e.transformInfoRaw,o=e.mapOrGeoModel,s=e.data,l=e.geo.projection,u=l&&l.stream;function h(d,v){return v&&(d=v(d)),d&&[d[0]*a.scaleX+a.x,d[1]*a.scaleY+a.y]}function c(d){for(var v=[],p=!u&&l&&l.project,g=0;g=0)&&(f=i);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;vc(e,hh(r),{labelFetcher:f,labelDataIndex:c,defaultText:t},d);var v=e.getTextContent();if(v&&(G5e(v).ignore=v.ignore,e.textConfig&&o)){var p=e.getBoundingRect().clone();e.textConfig.layoutRect=p,e.textConfig.position=[(o[0]-p.x)/p.width*100+"%",(o[1]-p.y)/p.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function j0e(n,e,t,r,i,a){n.data?n.data.setItemGraphicEl(a,e):Bn(e).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:t,region:r&&r.option||{}}}function X0e(n,e,t,r,i){n.data||DI({el:e,componentModel:i,itemName:t,itemTooltipOption:r.get("tooltip")})}function Y0e(n,e,t,r,i){e.highDownSilentOnTouch=!!i.get("selectedMode");var a=r.getModel("emphasis"),o=a.get("focus");return vl(e,o,a.get("blurScope"),a.get("disabled")),n.isGeo&&gct(e,i,t),o}function q0e(n,e,t){var r=[],i;function a(){i=[]}function o(){i.length&&(r.push(i),i=[])}var s=e({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!t&&s.polygonStart(),te(n,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2),i},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(Ws);const y1t=g1t;function m1t(n,e){var t={};return te(n,function(r){r.each(r.mapDimension("value"),function(i,a){var o="ec-"+r.getName(a);t[o]=t[o]||[],isNaN(i)||t[o].push(i)})}),n[0].map(n[0].mapDimension("value"),function(r,i){for(var a="ec-"+n[0].getName(i),o=0,s=1/0,l=-1/0,u=t[a].length,h=0;h1?(x.width=_,x.height=_/g):(x.height=_,x.width=_*g),x.y=y[1]-x.height/2,x.x=y[0]-x.width/2;else{var S=n.getBoxLayoutParams();S.aspect=g,x=Uu(S,{width:v,height:p})}this.setViewRect(x.x,x.y,x.width,x.height),this.setCenter(n.get("center"),e),this.setZoom(n.get("zoom"))}function b1t(n,e){te(e.get("geoCoord"),function(t,r){n.addGeoCoord(r,t)})}var E1t=function(){function n(){this.dimensions=U5e}return n.prototype.create=function(e,t){var r=[];function i(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}e.eachComponent("geo",function(o,s){var l=o.get("map"),u=new Q0e(l+s,l,Mt({nameMap:o.get("nameMap")},i(o)));u.zoomLimit=o.get("scaleLimit"),r.push(u),o.coordinateSystem=u,u.model=o,u.resize=eye,u.resize(o,t)}),e.eachSeries(function(o){var s=o.get("coordinateSystem");if(s==="geo"){var l=o.get("geoIndex")||0;o.coordinateSystem=r[l]}});var a={};return e.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),te(a,function(o,s){var l=Vt(o,function(h){return h.get("nameMap")}),u=new Q0e(s,s,Mt({nameMap:nie(l)},i(o[0])));u.zoomLimit=Gh.apply(null,Vt(o,function(h){return h.get("scaleLimit")})),r.push(u),u.resize=eye,u.resize(o[0],t),te(o,function(h){h.coordinateSystem=u,b1t(u,h)})}),r},n.prototype.getFilledRegions=function(e,t,r,i){for(var a=(e||[]).slice(),o=$r(),s=0;s=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},t.push(s)}}function R1t(n,e){var t=n.isExpand?n.children:[],r=n.parentNode.children,i=n.hierNode.i?r[n.hierNode.i-1]:null;if(t.length){k1t(n);var a=(t[0].hierNode.prelim+t[t.length-1].hierNode.prelim)/2;i?(n.hierNode.prelim=i.hierNode.prelim+e(n,i),n.hierNode.modifier=n.hierNode.prelim-a):n.hierNode.prelim=a}else i&&(n.hierNode.prelim=i.hierNode.prelim+e(n,i));n.parentNode.hierNode.defaultAncestor=F1t(n,i,n.parentNode.hierNode.defaultAncestor||r[0],e)}function D1t(n){var e=n.hierNode.prelim+n.parentNode.hierNode.modifier;n.setLayout({x:e},!0),n.hierNode.modifier+=n.parentNode.hierNode.modifier}function rye(n){return arguments.length?n:z1t}function oO(n,e){return n-=Math.PI/2,{x:e*Math.cos(n),y:e*Math.sin(n)}}function N1t(n,e){return Uu(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function k1t(n){for(var e=n.children,t=e.length,r=0,i=0;--t>=0;){var a=e[t];a.hierNode.prelim+=r,a.hierNode.modifier+=r,i+=a.hierNode.change,r+=a.hierNode.shift+i}}function F1t(n,e,t,r){if(e){for(var i=n,a=n,o=a.parentNode.children[0],s=e,l=i.hierNode.modifier,u=a.hierNode.modifier,h=o.hierNode.modifier,c=s.hierNode.modifier;s=gj(s),a=yj(a),s&&a;){i=gj(i),o=yj(o),i.hierNode.ancestor=n;var f=s.hierNode.prelim+c-a.hierNode.prelim-u+r(s,a);f>0&&(G1t(B1t(s,n,t),n,f),u+=f,l+=f),c+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,h+=o.hierNode.modifier}s&&!gj(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=c-l),a&&!yj(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-h,t=n)}return t}function gj(n){var e=n.children;return e.length&&n.isExpand?e[e.length-1]:n.hierNode.thread}function yj(n){var e=n.children;return e.length&&n.isExpand?e[0]:n.hierNode.thread}function B1t(n,e,t){return n.hierNode.ancestor.parentNode===e.parentNode?n.hierNode.ancestor:t}function G1t(n,e,t){var r=t/(e.hierNode.i-n.hierNode.i);e.hierNode.change-=r,e.hierNode.shift+=t,e.hierNode.modifier+=t,e.hierNode.prelim+=t,n.hierNode.change+=r}function z1t(n,e){return n.parentNode===e.parentNode?1:2}var U1t=function(){function n(){this.parentPoint=[],this.childPoints=[]}return n}(),V1t=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new U1t},e.prototype.buildPath=function(t,r){var i=r.childPoints,a=i.length,o=r.parentPoint,s=i[0],l=i[a-1];if(a===1){t.moveTo(o[0],o[1]),t.lineTo(s[0],s[1]);return}var u=r.orient,h=u==="TB"||u==="BT"?0:1,c=1-h,f=xr(r.forkPosition,1),d=[];d[h]=o[h],d[c]=o[c]+(l[c]-o[c])*f,t.moveTo(o[0],o[1]),t.lineTo(d[0],d[1]),t.moveTo(s[0],s[1]),d[h]=s[h],t.lineTo(d[0],d[1]),d[h]=l[h],t.lineTo(d[0],d[1]),t.lineTo(l[0],l[1]);for(var v=1;vy.x,S||(x=x-Math.PI));var b=S?"left":"right",E=s.getModel("label"),T=E.get("rotate"),C=T*(Math.PI/180),A=g.getTextContent();A&&(g.setTextConfig({position:E.get("position")||b,rotation:T==null?-x:C,origin:"center"}),A.setStyle("verticalAlign","middle"))}var M=s.get(["emphasis","focus"]),I=M==="relative"?K8(o.getAncestorsIndices(),o.getDescendantIndices()):M==="ancestor"?o.getAncestorsIndices():M==="descendant"?o.getDescendantIndices():null;I&&(Bn(t).focus=I),W1t(i,o,h,t,v,d,p,r),t.__edge&&(t.onHoverStateChange=function(R){if(R!=="blur"){var k=o.parentNode&&n.getItemGraphicEl(o.parentNode.dataIndex);k&&k.hoverState===g3||sG(t.__edge,R)}})}function W1t(n,e,t,r,i,a,o,s){var l=e.getModel(),u=n.get("edgeShape"),h=n.get("layout"),c=n.getOrient(),f=n.get(["lineStyle","curveness"]),d=n.get("edgeForkPosition"),v=l.getModel("lineStyle").getLineStyle(),p=r.__edge;if(u==="curve")e.parentNode&&e.parentNode!==t&&(p||(p=r.__edge=new Jz({shape:zJ(h,c,f,i,i)})),ma(p,{shape:zJ(h,c,f,a,o)},n));else if(u==="polyline"&&h==="orthogonal"&&e!==t&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var g=e.children,m=[],y=0;yt&&(t=i.height)}this.height=t+1},n.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,r=this.children,i=r.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},n.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},n.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostTree,r=t.data.getItemModel(this.dataIndex);return r.getModel(e)}},n.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},n.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},n.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},n.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},n.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},n.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t=0){var r=t.getData().tree.root,i=n.targetNode;if(Or(i)&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var a=n.targetNodeId;if(a!=null&&(i=r.getNodeById(a)))return{node:i}}}function Y5e(n){for(var e=[];n;)n=n.parentNode,n&&e.push(n);return e.reverse()}function xae(n,e){var t=Y5e(n);return gi(t,e)>=0}function xU(n,e){for(var t=[];n;){var r=n.dataIndex;t.push({name:n.name,dataIndex:r,value:e.getRawValue(r)}),n=n.parentNode}return t.reverse(),t}var t_t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t){var r={name:t.name,children:t.data},i=t.leaves||{},a=new as(i,this,this.ecModel),o=_ae.createTree(r,this,s);function s(c){c.wrapMethod("getItemModel",function(f,d){var v=o.getNodeByDataIndex(d);return v&&v.children.length&&v.isExpand||(f.parentModel=a),f})}var l=0;o.eachNode("preorder",function(c){c.depth>l&&(l=c.depth)});var u=t.expandAndCollapse,h=u&&t.initialTreeDepth>=0?t.initialTreeDepth:l;return o.root.eachNode("preorder",function(c){var f=c.hostTree.data.getRawDataItem(c.dataIndex);c.isExpand=f&&f.collapsed!=null?!f.collapsed:c.depth<=h}),o.data},e.prototype.getOrient=function(){var t=this.get("orient");return t==="horizontal"?t="LR":t==="vertical"&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,r,i){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(t),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return ch("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treeAncestors=xU(i,this),r.collapsed=!i.isExpand,r},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(Ws);const r_t=t_t;function n_t(n,e,t){for(var r=[n],i=[],a;a=r.pop();)if(i.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)t.push(i[a])}}function i_t(n,e){n.eachSeriesByType("tree",function(t){a_t(t,e)})}function a_t(n,e){var t=N1t(n,e);n.layoutInfo=t;var r=n.get("layout"),i=0,a=0,o=null;r==="radial"?(i=2*Math.PI,a=Math.min(t.height,t.width)/2,o=rye(function(_,x){return(_.parentNode===x.parentNode?1:2)/_.depth})):(i=t.width,a=t.height,o=rye());var s=n.getData().tree.root,l=s.children[0];if(l){O1t(s),n_t(l,R1t,o),s.hierNode.modifier=-l.hierNode.prelim,uP(l,D1t);var u=l,h=l,c=l;uP(l,function(_){var x=_.getLayout().x;xh.getLayout().x&&(h=_),_.depth>c.depth&&(c=_)});var f=u===h?1:o(u,h)/2,d=f-u.getLayout().x,v=0,p=0,g=0,m=0;if(r==="radial")v=i/(h.getLayout().x+f+d),p=a/(c.depth-1||1),uP(l,function(_){g=(_.getLayout().x+d)*v,m=(_.depth-1)*p;var x=oO(g,m);_.setLayout({x:x.x,y:x.y,rawX:g,rawY:m},!0)});else{var y=n.getOrient();y==="RL"||y==="LR"?(p=a/(h.getLayout().x+f+d),v=i/(c.depth-1||1),uP(l,function(_){m=(_.getLayout().x+d)*p,g=y==="LR"?(_.depth-1)*v:i-(_.depth-1)*v,_.setLayout({x:g,y:m},!0)})):(y==="TB"||y==="BT")&&(v=i/(h.getLayout().x+f+d),p=a/(c.depth-1||1),uP(l,function(_){g=(_.getLayout().x+d)*v,m=y==="TB"?(_.depth-1)*p:a-(_.depth-1)*p,_.setLayout({x:g,y:m},!0)}))}}}function o_t(n){n.eachSeriesByType("tree",function(e){var t=e.getData(),r=t.tree;r.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=t.ensureUniqueItemVisual(i.dataIndex,"style");Mt(s,o)})})}function s_t(n){n.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},function(r){var i=e.dataIndex,a=r.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),n.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(e,t,r){t.eachComponent({mainType:"series",subType:"tree",query:e},function(i){var a=i.coordinateSystem,o=yae(a,e,void 0,r);i.setCenter&&i.setCenter(o.center),i.setZoom&&i.setZoom(o.zoom)})})}function l_t(n){n.registerChartView(H1t),n.registerSeriesModel(r_t),n.registerLayout(i_t),n.registerVisual(o_t),s_t(n)}var sye=["treemapZoomToNode","treemapRender","treemapMove"];function u_t(n){for(var e=0;e1;)a=a.parentNode;var o=pJ(n.ecModel,a.name||a.dataIndex+"",r);i.setVisual("decal",o)})}var h_t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.preventUsingHoverLayer=!0,t}return e.prototype.getInitialData=function(t,r){var i={name:t.name,children:t.data};Z5e(i);var a=t.levels||[],o=this.designatedVisualItemStyle={},s=new as({itemStyle:o},this,r);a=t.levels=c_t(a,r);var l=Vt(a||[],function(c){return new as(c,s,r)},this),u=_ae.createTree(i,this,h);function h(c){c.wrapMethod("getItemModel",function(f,d){var v=u.getNodeByDataIndex(d),p=v?l[v.depth]:null;return f.parentModel=p||s,f})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),o=this.getRawValue(t),s=a.getName(t);return ch("nameValue",{name:s,value:o})},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treeAncestors=xU(i,this),r.treePathInfo=r.treeAncestors,r},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},Mt(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var r=this._idIndexMap;r||(r=this._idIndexMap=$r(),this._idIndexMapCount=0);var i=r.get(t);return i==null&&r.set(t,i=this._idIndexMapCount++),i},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var r=this.getRawData().tree.root;(!t||t!==r&&!r.contains(t))&&(this._viewRoot=r)},e.prototype.enableAriaDecal=function(){q5e(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"\u25B6",zoomToNodeRatio:.32*.32,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(Ws);function Z5e(n){var e=0;te(n.children,function(r){Z5e(r);var i=r.value;Gt(i)&&(i=i[0]),e+=i});var t=n.value;Gt(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),Gt(n.value)?n.value[0]=t:n.value=t}function c_t(n,e){var t=Do(e.get("color")),r=Do(e.get(["aria","decal","decals"]));if(!!t){n=n||[];var i,a;te(n,function(s){var l=new as(s),u=l.get("color"),h=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||h&&h!=="none")&&(a=!0)});var o=n[0]||(n[0]={});return i||(o.color=t.slice()),!a&&r&&(o.decal=r.slice()),n}}const f_t=h_t;var d_t=8,lye=8,mj=5,v_t=function(){function n(e){this.group=new Cn,e.add(this.group)}return n.prototype.render=function(e,t,r,i){var a=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!r)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),h=l.getModel(["itemStyle","textStyle"]),c={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(r,c,u),this._renderContent(e,c,s,l,u,h,i),sU(o,c.pos,c.box)}},n.prototype._prepare=function(e,t,r){for(var i=e;i;i=i.parentNode){var a=Ru(i.getModel().get("name"),""),o=r.getTextRect(a),s=Math.max(o.width+d_t*2,t.emptyItemWidth);t.totalWidth+=s+lye,t.renderList.push({node:i,text:a,width:s})}},n.prototype._renderContent=function(e,t,r,i,a,o,s){for(var l=0,u=t.emptyItemWidth,h=e.get(["breadcrumb","height"]),c=Tft(t.pos,t.box),f=t.totalWidth,d=t.renderList,v=i.getModel("itemStyle").getItemStyle(),p=d.length-1;p>=0;p--){var g=d[p],m=g.node,y=g.width,_=g.text;f>c.width&&(f-=y-u,y=u,_=null);var x=new bd({shape:{points:p_t(l,0,y,h,p===d.length-1,p===0)},style:sn(r.getItemStyle(),{lineJoin:"bevel"}),textContent:new la({style:is(a,{text:_})}),textConfig:{position:"inside"},z2:OI*1e4,onclick:Un(s,m)});x.disableLabelAnimation=!0,x.getTextContent().ensureState("emphasis").style=is(o,{text:_}),x.ensureState("emphasis").style=v,vl(x,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(x),g_t(x,e,m),l+=y+lye}},n.prototype.remove=function(){this.group.removeAll()},n}();function p_t(n,e,t,r,i,a){var o=[[i?n:n-mj,e],[n+t,e],[n+t,e+r],[i?n:n-mj,e+r]];return!a&&o.splice(2,0,[n+t+mj,e+r/2]),!i&&o.push([n,e+r/2]),o}function g_t(n,e,t){Bn(n).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:t&&t.dataIndex,name:t&&t.name},treePathInfo:t&&xU(t,e)}}const y_t=v_t;var m_t=function(){function n(){this._storage=[],this._elExistsMap={}}return n.prototype.add=function(e,t,r,i,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:r,delay:i,easing:a}),!0)},n.prototype.finished=function(e){return this._finishedCallback=e,this},n.prototype.start=function(){for(var e=this,t=this._storage.length,r=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;ihye||Math.abs(t.dy)>hye)){var r=this.seriesModel.getData().tree.root;if(!r)return;var i=r.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+t.dx,y:i.y+t.dy,width:i.width,height:i.height}})}},e.prototype._onZoom=function(t){var r=t.originX,i=t.originY;if(this._state!=="animating"){var a=this.seriesModel.getData().tree.root;if(!a)return;var o=a.getLayout();if(!o)return;var s=new ai(o.x,o.y,o.width,o.height),l=this.seriesModel.layoutInfo;r-=l.x,i-=l.y;var u=Up();sm(u,u,[-r,-i]),lie(u,u,[t.scale,t.scale]),sm(u,u,[r,i]),s.applyTransform(u),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},e.prototype._initEvents=function(t){var r=this;t.on("click",function(i){if(r._state==="ready"){var a=r.seriesModel.get("nodeClick",!0);if(!!a){var o=r.findTarget(i.offsetX,i.offsetY);if(!!o){var s=o.node;if(s.getLayout().isLeafRoot)r._rootToNode(o);else if(a==="zoomToNode")r._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),h=l.get("target",!0)||"blank";u&&dG(u,h)}}}}},this)},e.prototype._renderBreadcrumb=function(t,r,i){var a=this;i||(i=t.get("leafDepth",!0)!=null?{node:t.getViewRoot()}:this.findTarget(r.getWidth()/2,r.getHeight()/2),i||(i={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new y_t(this.group))).render(t,r,i.node,function(o){a._state!=="animating"&&(xae(t.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=hP(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,r){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(t,r),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}(os);function hP(){return{nodeGroup:[],background:[],content:[]}}function E_t(n,e,t,r,i,a,o,s,l,u){if(!o)return;var h=o.getLayout(),c=n.getData(),f=o.getModel();if(c.setItemGraphicEl(o.dataIndex,null),!h||!h.isInView)return;var d=h.width,v=h.height,p=h.borderWidth,g=h.invisible,m=o.getRawIndex(),y=s&&s.getRawIndex(),_=o.viewChildren,x=h.upperHeight,S=_&&_.length,w=f.getModel("itemStyle"),b=f.getModel(["emphasis","itemStyle"]),E=f.getModel(["blur","itemStyle"]),T=f.getModel(["select","itemStyle"]),C=w.get("borderRadius")||0,A=j("nodeGroup",UJ);if(!A)return;if(l.add(A),A.x=h.x||0,A.y=h.y||0,A.markRedraw(),LG(A).nodeWidth=d,LG(A).nodeHeight=v,h.isAboveViewRoot)return A;var M=j("background",uye,u,S_t);M&&z(A,M,S&&h.upperLabelHeight);var I=f.getModel("emphasis"),R=I.get("focus"),k=I.get("blurScope"),D=I.get("disabled"),G=R==="ancestor"?o.getAncestorsIndices():R==="descendant"?o.getDescendantIndices():R;if(S)sD(A)&&nE(A,!1),M&&(nE(M,!D),c.setItemGraphicEl(o.dataIndex,M),sJ(M,G,k));else{var W=j("content",uye,u,w_t);W&&V(A,W),M.disableMorphing=!0,M&&sD(M)&&nE(M,!1),nE(A,!D),c.setItemGraphicEl(o.dataIndex,A),sJ(A,G,k)}return A;function z(oe,se,me){var Ce=Bn(se);if(Ce.dataIndex=o.dataIndex,Ce.seriesIndex=n.seriesIndex,se.setShape({x:0,y:0,width:d,height:v,r:C}),g)q(se);else{se.invisible=!1;var Le=o.getVisual("style"),re=Le.stroke,yt=dye(w);yt.fill=re;var je=Rb(b);je.fill=b.get("borderColor");var st=Rb(E);st.fill=E.get("borderColor");var Nt=Rb(T);if(Nt.fill=T.get("borderColor"),me){var Zt=d-2*p;Y(se,re,Le.opacity,{x:p,y:0,width:Zt,height:x})}else se.removeTextContent();se.setStyle(yt),se.ensureState("emphasis").style=je,se.ensureState("blur").style=st,se.ensureState("select").style=Nt,ZE(se)}oe.add(se)}function V(oe,se){var me=Bn(se);me.dataIndex=o.dataIndex,me.seriesIndex=n.seriesIndex;var Ce=Math.max(d-2*p,0),Le=Math.max(v-2*p,0);if(se.culling=!0,se.setShape({x:p,y:p,width:Ce,height:Le,r:C}),g)q(se);else{se.invisible=!1;var re=o.getVisual("style"),yt=re.fill,je=dye(w);je.fill=yt,je.decal=re.decal;var st=Rb(b),Nt=Rb(E),Zt=Rb(T);Y(se,yt,re.opacity,null),se.setStyle(je),se.ensureState("emphasis").style=st,se.ensureState("blur").style=Nt,se.ensureState("select").style=Zt,ZE(se)}oe.add(se)}function q(oe){!oe.invisible&&a.push(oe)}function Y(oe,se,me,Ce){var Le=f.getModel(Ce?fye:cye),re=Ru(f.get("name"),null),yt=Le.getShallow("show");vc(oe,hh(f,Ce?fye:cye),{defaultText:yt?re:null,inheritColor:se,defaultOpacity:me,labelFetcher:n,labelDataIndex:o.dataIndex});var je=oe.getTextContent();if(!!je){var st=je.style,Nt=aie(st.padding||0);Ce&&(oe.setTextConfig({layoutRect:Ce}),je.disableLabelLayout=!0),je.beforeUpdate=function(){var qe=Math.max((Ce?Ce.width:oe.shape.width)-Nt[1]-Nt[3],0),ur=Math.max((Ce?Ce.height:oe.shape.height)-Nt[0]-Nt[2],0);(st.width!==qe||st.height!==ur)&&je.setStyle({width:qe,height:ur})},st.truncateMinChar=2,st.lineOverflow="truncate",le(st,Ce,h);var Zt=je.getState("emphasis");le(Zt?Zt.style:null,Ce,h)}}function le(oe,se,me){var Ce=oe?oe.text:null;if(!se&&me.isLeafRoot&&Ce!=null){var Le=n.get("drillDownIcon",!0);oe.text=Le?Le+" "+Ce:Ce}}function j(oe,se,me,Ce){var Le=y!=null&&t[oe][y],re=i[oe];return Le?(t[oe][y]=null,Q(re,Le)):g||(Le=new se,Le instanceof Vp&&(Le.z2=T_t(me,Ce)),ie(re,Le)),e[oe][m]=Le}function Q(oe,se){var me=oe[m]={};se instanceof UJ?(me.oldX=se.x,me.oldY=se.y):me.oldShape=Mt({},se.shape)}function ie(oe,se){var me=oe[m]={},Ce=o.parentNode,Le=se instanceof Cn;if(Ce&&(!r||r.direction==="drillDown")){var re=0,yt=0,je=i.background[Ce.getRawIndex()];!r&&je&&je.oldShape&&(re=je.oldShape.width,yt=je.oldShape.height),Le?(me.oldX=0,me.oldY=yt):me.oldShape={x:re,y:yt,width:0,height:0}}me.fadein=!Le}}function T_t(n,e){return n*x_t+e}const C_t=b_t;var SD=te,A_t=dn,PG=-1,Sae=function(){function n(e){var t=e.mappingMethod,r=e.type,i=this.option=Sn(e);this.type=r,this.mappingMethod=t,this._normalizeData=L_t[t];var a=n.visualHandlers[r];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[t],t==="piecewise"?(_j(i),M_t(i)):t==="category"?i.categories?I_t(i):_j(i,!0):(Bf(t!=="linear"||i.dataExtent),_j(i))}return n.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},n.prototype.getNormalizer=function(){return kr(this._normalizeData,this)},n.listVisualTypes=function(){return Li(n.visualHandlers)},n.isValidType=function(e){return n.visualHandlers.hasOwnProperty(e)},n.eachVisual=function(e,t,r){dn(e)?te(e,t,r):t.call(r,e)},n.mapVisual=function(e,t,r){var i,a=Gt(e)?[]:dn(e)?{}:(i=!0,null);return n.eachVisual(e,function(o,s){var l=t.call(r,o,s);i?a=l:a[s]=l}),a},n.retrieveVisuals=function(e){var t={},r;return e&&SD(n.visualHandlers,function(i,a){e.hasOwnProperty(a)&&(t[a]=e[a],r=!0)}),r?t:null},n.prepareVisualTypes=function(e){if(Gt(e))e=e.slice();else if(A_t(e)){var t=[];SD(e,function(r,i){t.push(i)}),e=t}else return[];return e.sort(function(r,i){return i==="color"&&r!=="color"&&r.indexOf("color")===0?1:-1}),e},n.dependsOn=function(e,t){return t==="color"?!!(e&&e.indexOf(t)===0):e===t},n.findPieceIndex=function(e,t,r){for(var i,a=1/0,o=0,s=t.length;o=0;a--)r[a]==null&&(delete t[e[a]],e.pop())}function _j(n,e){var t=n.visual,r=[];dn(t)?SD(t,function(a){r.push(a)}):t!=null&&r.push(t);var i={color:1,symbol:1};!e&&r.length===1&&!i.hasOwnProperty(n.type)&&(r[1]=r[0]),K5e(n,r)}function L4(n){return{applyVisual:function(e,t,r){var i=this.mapValueToVisual(e);r("color",n(t("color"),i))},_normalizedToVisual:VJ([0,1])}}function vye(n){var e=this.option.visual;return e[Math.round(go(n,[0,1],[0,e.length-1],!0))]||{}}function cP(n){return function(e,t,r){r(n,this.mapValueToVisual(e))}}function sO(n){var e=this.option.visual;return e[this.option.loop&&n!==PG?n%e.length:n]}function Db(){return this.option.visual[0]}function VJ(n){return{linear:function(e){return go(e,n,this.option.visual,!0)},category:sO,piecewise:function(e,t){var r=$J.call(this,t);return r==null&&(r=go(e,n,this.option.visual,!0)),r},fixed:Db}}function $J(n){var e=this.option,t=e.pieceList;if(e.hasSpecialVisual){var r=Sae.findPieceIndex(n,t),i=t[r];if(i&&i.visual)return i.visual[this.type]}}function K5e(n,e){return n.visual=e,n.type==="color"&&(n.parsedVisual=Vt(e,function(t){var r=gv(t);return r||[0,0,0,1]})),e}var L_t={linear:function(n){return go(n,this.option.dataExtent,[0,1],!0)},piecewise:function(n){var e=this.option.pieceList,t=Sae.findPieceIndex(n,e,!0);if(t!=null)return go(t,[0,e.length-1],[0,1],!0)},category:function(n){var e=this.option.categories?this.option.categoryMap[n]:n;return e==null?PG:e},fixed:Hl};function P4(n,e,t){return n?e<=t:e=t.length||p===t[p.depth]){var m=k_t(i,l,p,g,v,r);Q5e(p,m,t,r)}})}}}function R_t(n,e,t){var r=Mt({},e),i=t.designatedVisualItemStyle;return te(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var o=n.get(a);i[a]=null,o!=null&&(r[a]=o)}),r}function pye(n){var e=xj(n,"color");if(e){var t=xj(n,"colorAlpha"),r=xj(n,"colorSaturation");return r&&(e=WO(e,null,null,r)),t&&(e=eG(e,t)),e}}function D_t(n,e){return e!=null?WO(e,null,null,n):null}function xj(n,e){var t=n[e];if(t!=null&&t!=="none")return t}function N_t(n,e,t,r,i,a){if(!(!a||!a.length)){var o=Sj(e,"color")||i.color!=null&&i.color!=="none"&&(Sj(e,"colorAlpha")||Sj(e,"colorSaturation"));if(!!o){var s=e.get("visualMin"),l=e.get("visualMax"),u=t.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:o.name,dataExtent:u,visual:o.range};c.type==="color"&&(h==="index"||h==="id")?(c.mappingMethod="category",c.loop=!0):c.mappingMethod="linear";var f=new fc(c);return J5e(f).drColorMappingBy=h,f}}}function Sj(n,e){var t=n.get(e);return Gt(t)&&t.length?{name:e,range:t}:null}function k_t(n,e,t,r,i,a){var o=Mt({},e);if(i){var s=i.type,l=s==="color"&&J5e(i).drColorMappingBy,u=l==="index"?r:l==="id"?a.mapIdToIndex(t.getId()):t.getValue(n.get("visualDimension"));o[s]=i.mapValueToVisual(u)}return o}var wD=Math.max,OG=Math.min,gye=Gh,wae=te,e6e=["itemStyle","borderWidth"],F_t=["itemStyle","gapWidth"],B_t=["upperLabel","show"],G_t=["upperLabel","height"];const z_t={seriesType:"treemap",reset:function(n,e,t,r){var i=t.getWidth(),a=t.getHeight(),o=n.option,s=Uu(n.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),l=o.size||[],u=xr(gye(s.width,l[0]),i),h=xr(gye(s.height,l[1]),a),c=r&&r.type,f=["treemapZoomToNode","treemapRootToNode"],d=xD(r,f,n),v=c==="treemapRender"||c==="treemapMove"?r.rootRect:null,p=n.getViewRoot(),g=Y5e(p);if(c!=="treemapMove"){var m=c==="treemapZoomToNode"?j_t(n,d,p,u,h):v?[v.width,v.height]:[u,h],y=o.sort;y&&y!=="asc"&&y!=="desc"&&(y="desc");var _={squareRatio:o.squareRatio,sort:y,leafDepth:o.leafDepth};p.hostTree.clearLayouts();var x={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};p.setLayout(x),t6e(p,_,!1,0),x=p.getLayout(),wae(g,function(w,b){var E=(g[b+1]||p).getValue();w.setLayout(Mt({dataExtent:[E,E],borderWidth:0,upperHeight:0},x))})}var S=n.getData().tree.root;S.setLayout(X_t(s,v,d),!0),n.setLayoutInfo(s),r6e(S,new ai(-s.x,-s.y,i,a),g,p,0)}};function t6e(n,e,t,r){var i,a;if(!n.isRemoved()){var o=n.getLayout();i=o.width,a=o.height;var s=n.getModel(),l=s.get(e6e),u=s.get(F_t)/2,h=n6e(s),c=Math.max(l,h),f=l-u,d=c-u;n.setLayout({borderWidth:l,upperHeight:c,upperLabelHeight:h},!0),i=wD(i-2*f,0),a=wD(a-f-d,0);var v=i*a,p=U_t(n,s,v,e,t,r);if(!!p.length){var g={x:f,y:d,width:i,height:a},m=OG(i,a),y=1/0,_=[];_.area=0;for(var x=0,S=p.length;x=0;l--){var u=i[r==="asc"?o-l-1:l].getValue();u/t*es[1]&&(s[1]=u)})),{sum:r,dataExtent:s}}function H_t(n,e,t){for(var r=0,i=1/0,a=0,o=void 0,s=n.length;ar&&(r=o));var l=n.area*n.area,u=e*e*t;return l?wD(u*r/l,l/(u*i)):1/0}function yye(n,e,t,r,i){var a=e===t.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=t[s[a]],h=e?n.area/e:0;(i||h>t[l[o]])&&(h=t[l[o]]);for(var c=0,f=n.length;cMve&&(u=Mve),a=s}ur&&(r=e);var a=r%2?r+2:r+3;i=[];for(var o=0;o0&&(S[0]=-S[0],S[1]=-S[1]);var b=x[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var E=-Math.atan2(x[1],x[0]);c[0].8?"left":f[0]<-.8?"right":"center",p=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*m+h[0],a.y=-f[1]*y+h[1],v=f[0]>.8?"right":f[0]<-.8?"left":"center",p=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=m*b+h[0],a.y=h[1]+T,v=x[0]<0?"right":"left",a.originX=-m*b,a.originY=-T;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=w[0],a.y=w[1]+T,v="center",a.originY=-T;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-m*b+c[0],a.y=c[1]+T,v=x[0]>=0?"right":"left",a.originX=m*b,a.originY=-T;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||p,align:a.__align||v})}},e}(Cn);const Cae=fxt;var dxt=function(){function n(e){this.group=new Cn,this._LineCtor=e||Cae}return n.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var r=this,i=r.group,a=r._lineData;r._lineData=e,a||i.removeAll();var o=bye(e);e.diff(a).add(function(s){t._doAdd(e,s,o)}).update(function(s,l){t._doUpdate(a,e,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).execute()},n.prototype.updateLayout=function(){var e=this._lineData;!e||e.eachItemGraphicEl(function(t,r){t.updateLayout(e,r)},this)},n.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=bye(e),this._lineData=null,this.group.removeAll()},n.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function r(s){!s.isGroup&&!vxt(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i0}function bye(n){var e=n.hostModel,t=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:t.get("disabled"),blurScope:t.get("blurScope"),focus:t.get("focus"),labelStatesModels:hh(e)}}function Eye(n){return isNaN(n[0])||isNaN(n[1])}function Cj(n){return n&&!Eye(n[0])&&!Eye(n[1])}const Aae=dxt;var Aj=[],Mj=[],Ij=[],eC=Ph,Lj=wE,Tye=Math.abs;function Cye(n,e,t){for(var r=n[0],i=n[1],a=n[2],o=1/0,s,l=t*t,u=.1,h=.1;h<=.9;h+=.1){Aj[0]=eC(r[0],i[0],a[0],h),Aj[1]=eC(r[1],i[1],a[1],h);var c=Tye(Lj(Aj,e)-l);c=0?s=s+u:s=s-u:v>=0?s=s-u:s=s+u}return s}function Pj(n,e){var t=[],r=tD,i=[[],[],[]],a=[[],[]],o=[];e/=2,n.eachEdge(function(s,l){var u=s.getLayout(),h=s.getVisual("fromSymbol"),c=s.getVisual("toSymbol");u.__original||(u.__original=[V1(u[0]),V1(u[1])],u[2]&&u.__original.push(V1(u[2])));var f=u.__original;if(u[2]!=null){if(mf(i[0],f[0]),mf(i[1],f[2]),mf(i[2],f[1]),h&&h!=="none"){var d=uO(s.node1),v=Cye(i,f[0],d*e);r(i[0][0],i[1][0],i[2][0],v,t),i[0][0]=t[3],i[1][0]=t[4],r(i[0][1],i[1][1],i[2][1],v,t),i[0][1]=t[3],i[1][1]=t[4]}if(c&&c!=="none"){var d=uO(s.node2),v=Cye(i,f[1],d*e);r(i[0][0],i[1][0],i[2][0],v,t),i[1][0]=t[1],i[2][0]=t[2],r(i[0][1],i[1][1],i[2][1],v,t),i[1][1]=t[1],i[2][1]=t[2]}mf(u[0],i[0]),mf(u[1],i[2]),mf(u[2],i[1])}else{if(mf(a[0],f[0]),mf(a[1],f[1]),tE(o,a[1],a[0]),II(o,o),h&&h!=="none"){var d=uO(s.node1);RK(a[0],a[0],o,d*e)}if(c&&c!=="none"){var d=uO(s.node2);RK(a[1],a[1],o,-d*e)}mf(u[0],a[0]),mf(u[1],a[1])}})}function Aye(n){return n.type==="view"}var pxt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){var i=new A3,a=new Aae,o=this.group;this._controller=new P3(r.getZr()),this._controllerHost={target:o},o.add(i.group),o.add(a.group),this._symbolDraw=i,this._lineDraw=a,this._firstRender=!0},e.prototype.render=function(t,r,i){var a=this,o=t.coordinateSystem;this._model=t;var s=this._symbolDraw,l=this._lineDraw,u=this.group;if(Aye(o)){var h={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?u.attr(h):ma(u,h,t)}Pj(t.getGraph(),lO(t));var c=t.getData();s.updateData(c);var f=t.getEdgeData();l.updateData(f),this._updateNodeAndLinkScale(),this._updateController(t,r,i),clearTimeout(this._layoutTimeout);var d=t.forceLayout,v=t.get(["force","layoutAnimation"]);d&&this._startForceLayoutIteration(d,v);var p=t.get("layout");c.graph.eachNode(function(_){var x=_.dataIndex,S=_.getGraphicEl(),w=_.getModel();if(!!S){S.off("drag").off("dragend");var b=w.get("draggable");b&&S.on("drag",function(T){switch(p){case"force":d.warmUp(),!a._layouting&&a._startForceLayoutIteration(d,v),d.setFixed(x),c.setItemLayout(x,[S.x,S.y]);break;case"circular":c.setItemLayout(x,[S.x,S.y]),_.setLayout({fixed:!0},!0),Tae(t,"symbolSize",_,[T.offsetX,T.offsetY]),a.updateLayout(t);break;case"none":default:c.setItemLayout(x,[S.x,S.y]),Eae(t.getGraph(),t),a.updateLayout(t);break}}).on("dragend",function(){d&&d.setUnfixed(x)}),S.setDraggable(b,!!w.get("cursor"));var E=w.get(["emphasis","focus"]);E==="adjacency"&&(Bn(S).focus=_.getAdjacentDataIndices())}}),c.graph.eachEdge(function(_){var x=_.getGraphicEl(),S=_.getModel().get(["emphasis","focus"]);!x||S==="adjacency"&&(Bn(x).focus={edge:[_.dataIndex],node:[_.node1.dataIndex,_.node2.dataIndex]})});var g=t.get("layout")==="circular"&&t.get(["circular","rotateLabel"]),m=c.getLayout("cx"),y=c.getLayout("cy");c.graph.eachNode(function(_){s6e(_,g,m,y)}),this._firstRender=!1},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,r){var i=this;(function a(){t.step(function(o){i.updateLayout(i._model),(i._layouting=!o)&&(r?i._layoutTimeout=setTimeout(a,16):a())})})()},e.prototype._updateController=function(t,r,i){var a=this,o=this._controller,s=this._controllerHost,l=this.group;if(o.setPointerChecker(function(u,h,c){var f=l.getBoundingRect();return f.applyTransform(l.transform),f.contain(h,c)&&!mU(u,i,t)}),!Aye(t.coordinateSystem)){o.disable();return}o.enable(t.get("roam")),s.zoomLimit=t.get("scaleLimit"),s.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",function(u){vae(s,u.dx,u.dy),i.dispatchAction({seriesId:t.id,type:"graphRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){pae(s,u.scale,u.originX,u.originY),i.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(),Pj(t.getGraph(),lO(t)),a._lineDraw.updateLayout(),i.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,r=t.getData(),i=lO(t);r.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(t){Pj(t.getGraph(),lO(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(t,r){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(os);const gxt=pxt;function tC(n){return"_EC_"+n}var yxt=function(){function n(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return n.prototype.isDirected=function(){return this._directed},n.prototype.addNode=function(e,t){e=e==null?""+t:""+e;var r=this._nodesMap;if(!r[tC(e)]){var i=new Nb(e,t);return i.hostGraph=this,this.nodes.push(i),r[tC(e)]=i,i}},n.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},n.prototype.getNodeById=function(e){return this._nodesMap[tC(e)]},n.prototype.addEdge=function(e,t,r){var i=this._nodesMap,a=this._edgesMap;if(ha(e)&&(e=this.nodes[e]),ha(t)&&(t=this.nodes[t]),e instanceof Nb||(e=i[tC(e)]),t instanceof Nb||(t=i[tC(t)]),!(!e||!t)){var o=e.id+"-"+t.id,s=new u6e(e,t,r);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),t.inEdges.push(s)),e.edges.push(s),e!==t&&t.edges.push(s),this.edges.push(s),a[o]=s,s}},n.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},n.prototype.getEdge=function(e,t){e instanceof Nb&&(e=e.id),t instanceof Nb&&(t=t.id);var r=this._edgesMap;return this._directed?r[e+"-"+t]:r[e+"-"+t]||r[t+"-"+e]},n.prototype.eachNode=function(e,t){for(var r=this.nodes,i=r.length,a=0;a=0&&e.call(t,r[a],a)},n.prototype.eachEdge=function(e,t){for(var r=this.edges,i=r.length,a=0;a=0&&r[a].node1.dataIndex>=0&&r[a].node2.dataIndex>=0&&e.call(t,r[a],a)},n.prototype.breadthFirstTraverse=function(e,t,r,i){if(t instanceof Nb||(t=this._nodesMap[tC(t)]),!!t){for(var a=r==="out"?"outEdges":r==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a=0&&this[n][e].setItemVisual(this.dataIndex,t,r)},getVisual:function(t){return this[n][e].getItemVisual(this.dataIndex,t)},setLayout:function(t,r){this.dataIndex>=0&&this[n][e].setItemLayout(this.dataIndex,t,r)},getLayout:function(){return this[n][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[n][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[n][e].getRawIndex(this.dataIndex)}}}gu(Nb,h6e("hostGraph","data"));gu(u6e,h6e("hostGraph","edgeData"));const mxt=yxt;function c6e(n,e,t,r,i){for(var a=new mxt(r),o=0;o "+f)),u++)}var d=t.get("coordinateSystem"),v;if(d==="cartesian2d"||d==="polar")v=k_(n,t);else{var p=S3.get(d),g=p?p.dimensions||[]:[];gi(g,"value")<0&&g.concat(["value"]);var m=b3(n,{coordDimensions:g,encodeDefine:t.getEncode()}).dimensions;v=new Df(m,t),v.initData(n)}var y=new Df(["value"],t);return y.initData(l,s),i&&i(v,y),j5e({mainData:v,struct:a,structAttr:"graph",datas:{node:v,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var _xt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments);var r=this;function i(){return r._categoriesData}this.legendVisualProvider=new L3(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(t){n.prototype.mergeDefaultAndTheme.apply(this,arguments),XE(t,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,r){var i=t.edges||t.links||[],a=t.data||t.nodes||[],o=this;if(a&&i){ext(this);var s=c6e(a,i,this,!0,l);return te(s.edges,function(u){txt(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,h){u.wrapMethod("getItemModel",function(v){var p=o._categoriesModels,g=v.getShallow("category"),m=p[g];return m&&(m.parentModel=v.parentModel,v.parentModel=m),v});var c=as.prototype.getModel;function f(v,p){var g=c.call(this,v,p);return g.resolveParentPath=d,g}h.wrapMethod("getItemModel",function(v){return v.resolveParentPath=d,v.getModel=f,v});function d(v){if(v&&(v[0]==="label"||v[1]==="label")){var p=v.slice();return v[0]==="label"?p[0]="edgeLabel":v[1]==="label"&&(p[1]="edgeLabel"),p}return v}}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,r,i){if(i==="edge"){var a=this.getData(),o=this.getDataParams(t,i),s=a.graph.getEdgeByIndex(t),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),h=[];return l!=null&&h.push(l),u!=null&&h.push(u),ch("nameValue",{name:h.join(" > "),value:o.value,noValue:o.value==null})}var c=OFe({series:this,dataIndex:t,multipleSeries:r});return c},e.prototype._updateCategoriesData=function(){var t=Vt(this.option.categories||[],function(i){return i.value!=null?i:Mt({value:0},i)}),r=new Df(["value"],this);r.initData(t),this._categoriesData=r,this._categoriesModels=r.mapArray(function(i){return r.getItemModel(i)})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return n.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Ws);const xxt=_xt;var Sxt={type:"graphRoam",event:"graphRoam",update:"none"};function wxt(n){n.registerChartView(gxt),n.registerSeriesModel(xxt),n.registerProcessor(q_t),n.registerVisual(Z_t),n.registerVisual(K_t),n.registerLayout(rxt),n.registerLayout(n.PRIORITY.VISUAL.POST_CHART_LAYOUT,ixt),n.registerLayout(oxt),n.registerCoordinateSystem("graphView",{dimensions:O3.dimensions,create:lxt}),n.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Hl),n.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Hl),n.registerAction(Sxt,function(e,t,r){t.eachComponent({mainType:"series",query:e},function(i){var a=i.coordinateSystem,o=yae(a,e,void 0,r);i.setCenter&&i.setCenter(o.center),i.setZoom&&i.setZoom(o.zoom)})})}var bxt=function(){function n(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return n}(),Ext=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="pointer",r}return e.prototype.getDefaultShape=function(){return new bxt},e.prototype.buildPath=function(t,r){var i=Math.cos,a=Math.sin,o=r.r,s=r.width,l=r.angle,u=r.x-i(l)*s*(s>=o/3?1:2),h=r.y-a(l)*s*(s>=o/3?1:2);l=r.angle-Math.PI/2,t.moveTo(u,h),t.lineTo(r.x+i(l)*s,r.y+a(l)*s),t.lineTo(r.x+i(r.angle)*o,r.y+a(r.angle)*o),t.lineTo(r.x-i(l)*s,r.y-a(l)*s),t.lineTo(u,h)},e}(Si);const Txt=Ext;function Cxt(n,e){var t=n.get("center"),r=e.getWidth(),i=e.getHeight(),a=Math.min(r,i),o=xr(t[0],e.getWidth()),s=xr(t[1],e.getHeight()),l=xr(n.get("radius"),a/2);return{cx:o,cy:s,r:l}}function R4(n,e){var t=n==null?"":n+"";return e&&(Or(e)?t=e.replace("{value}",t):rn(e)&&(t=e(n))),t}var Axt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){this.group.removeAll();var a=t.get(["axisLine","lineStyle","color"]),o=Cxt(t,i);this._renderMain(t,r,i,a,o),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,r,i,a,o){var s=this.group,l=t.get("clockwise"),u=-t.get("startAngle")/180*Math.PI,h=-t.get("endAngle")/180*Math.PI,c=t.getModel("axisLine"),f=c.get("roundCap"),d=f?AG:wd,v=c.get("show"),p=c.getModel("lineStyle"),g=p.get("width"),m=[u,h];V3e(m,!l),u=m[0],h=m[1];for(var y=h-u,_=u,x=[],S=0;v&&S=T&&(C===0?0:a[C-1][0])Math.PI/2&&(j+=Math.PI)):le==="tangential"?j=-E-Math.PI/2:ha(le)&&(j=le*Math.PI/180),j===0?c.add(new la({style:is(_,{text:z,x:q,y:Y,verticalAlign:k<-.8?"top":k>.8?"bottom":"middle",align:R<-.4?"left":R>.4?"right":"center"},{inheritColor:V}),silent:!0})):c.add(new la({style:is(_,{text:z,x:q,y:Y,verticalAlign:"middle",align:"center"},{inheritColor:V}),silent:!0,originX:q,originY:Y,rotation:j}))}if(y.get("show")&&D!==x){var G=y.get("distance");G=G?G+h:h;for(var Q=0;Q<=S;Q++){R=Math.cos(E),k=Math.sin(E);var ie=new zh({shape:{x1:R*(v-G)+f,y1:k*(v-G)+d,x2:R*(v-b-G)+f,y2:k*(v-b-G)+d},silent:!0,style:M});M.stroke==="auto"&&ie.setStyle({stroke:a((D+Q/S)/x)}),c.add(ie),E+=C}E-=C}else E+=T}},e.prototype._renderPointer=function(t,r,i,a,o,s,l,u,h){var c=this.group,f=this._data,d=this._progressEls,v=[],p=t.get(["pointer","show"]),g=t.getModel("progress"),m=g.get("show"),y=t.getData(),_=y.mapDimension("value"),x=+t.get("min"),S=+t.get("max"),w=[x,S],b=[s,l];function E(C,A){var M=y.getItemModel(C),I=M.getModel("pointer"),R=xr(I.get("width"),o.r),k=xr(I.get("length"),o.r),D=t.get(["pointer","icon"]),G=I.get("offsetCenter"),W=xr(G[0],o.r),z=xr(G[1],o.r),V=I.get("keepAspect"),q;return D?q=hu(D,W-R/2,z-k,R,k,null,V):q=new Txt({shape:{angle:-Math.PI/2,width:R,r:k,x:W,y:z}}),q.rotation=-(A+Math.PI/2),q.x=o.cx,q.y=o.cy,q}function T(C,A){var M=g.get("roundCap"),I=M?AG:wd,R=g.get("overlap"),k=R?g.get("width"):h/y.count(),D=R?o.r-k:o.r-(C+1)*k,G=R?o.r:o.r-C*k,W=new I({shape:{startAngle:s,endAngle:A,cx:o.cx,cy:o.cy,clockwise:u,r0:D,r:G}});return R&&(W.z2=S-y.get(_,C)%S),W}(m||p)&&(y.diff(f).add(function(C){var A=y.get(_,C);if(p){var M=E(C,s);Is(M,{rotation:-((isNaN(+A)?b[0]:go(A,w,b,!0))+Math.PI/2)},t),c.add(M),y.setItemGraphicEl(C,M)}if(m){var I=T(C,s),R=g.get("clip");Is(I,{shape:{endAngle:go(A,w,b,R)}},t),c.add(I),iJ(t.seriesIndex,y.dataType,C,I),v[C]=I}}).update(function(C,A){var M=y.get(_,C);if(p){var I=f.getItemGraphicEl(A),R=I?I.rotation:s,k=E(C,R);k.rotation=R,ma(k,{rotation:-((isNaN(+M)?b[0]:go(M,w,b,!0))+Math.PI/2)},t),c.add(k),y.setItemGraphicEl(C,k)}if(m){var D=d[A],G=D?D.shape.endAngle:s,W=T(C,G),z=g.get("clip");ma(W,{shape:{endAngle:go(M,w,b,z)}},t),c.add(W),iJ(t.seriesIndex,y.dataType,C,W),v[C]=W}}).execute(),y.each(function(C){var A=y.getItemModel(C),M=A.getModel("emphasis"),I=M.get("focus"),R=M.get("blurScope"),k=M.get("disabled");if(p){var D=y.getItemGraphicEl(C),G=y.getItemVisual(C,"style"),W=G.fill;if(D instanceof xc){var z=D.style;D.useStyle(Mt({image:z.image,x:z.x,y:z.y,width:z.width,height:z.height},G))}else D.useStyle(G),D.type!=="pointer"&&D.setColor(W);D.setStyle(A.getModel(["pointer","itemStyle"]).getItemStyle()),D.style.fill==="auto"&&D.setStyle("fill",a(go(y.get(_,C),w,[0,1],!0))),D.z2EmphasisLift=0,dc(D,A),vl(D,I,R,k)}if(m){var V=v[C];V.useStyle(y.getItemVisual(C,"style")),V.setStyle(A.getModel(["progress","itemStyle"]).getItemStyle()),V.z2EmphasisLift=0,dc(V,A),vl(V,I,R,k)}}),this._progressEls=v)},e.prototype._renderAnchor=function(t,r){var i=t.getModel("anchor"),a=i.get("show");if(a){var o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),h=hu(s,r.cx-o/2+xr(l[0],r.r),r.cy-o/2+xr(l[1],r.r),o,o,null,u);h.z2=i.get("showAbove")?1:0,h.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(h)}},e.prototype._renderTitleAndDetail=function(t,r,i,a,o){var s=this,l=t.getData(),u=l.mapDimension("value"),h=+t.get("min"),c=+t.get("max"),f=new Cn,d=[],v=[],p=t.isAnimationEnabled(),g=t.get(["pointer","showAbove"]);l.diff(this._data).add(function(m){d[m]=new la({silent:!0}),v[m]=new la({silent:!0})}).update(function(m,y){d[m]=s._titleEls[y],v[m]=s._detailEls[y]}).execute(),l.each(function(m){var y=l.getItemModel(m),_=l.get(u,m),x=new Cn,S=a(go(_,[h,c],[0,1],!0)),w=y.getModel("title");if(w.get("show")){var b=w.get("offsetCenter"),E=o.cx+xr(b[0],o.r),T=o.cy+xr(b[1],o.r),C=d[m];C.attr({z2:g?0:2,style:is(w,{x:E,y:T,text:l.getName(m),align:"center",verticalAlign:"middle"},{inheritColor:S})}),x.add(C)}var A=y.getModel("detail");if(A.get("show")){var M=A.get("offsetCenter"),I=o.cx+xr(M[0],o.r),R=o.cy+xr(M[1],o.r),k=xr(A.get("width"),o.r),D=xr(A.get("height"),o.r),G=t.get(["progress","show"])?l.getItemVisual(m,"style").fill:S,C=v[m],W=A.get("formatter");C.attr({z2:g?0:2,style:is(A,{x:I,y:R,text:R4(_,W),width:isNaN(k)?null:k,height:isNaN(D)?null:D,align:"center",verticalAlign:"middle"},{inheritColor:G})}),Dke(C,{normal:A},_,function(V){return R4(V,W)}),p&&Nke(C,m,l,t,{getFormattedLabel:function(V,q,Y,le,j,Q){return R4(Q?Q.interpolatedValue:_,W)}}),x.add(C)}f.add(x)}),this.group.add(f),this._titleEls=d,this._detailEls=v},e.type="gauge",e}(os);const Mxt=Axt;var Ixt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="itemStyle",t}return e.prototype.getInitialData=function(t,r){return WI(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(Ws);const Lxt=Ixt;function Pxt(n){n.registerChartView(Mxt),n.registerSeriesModel(Lxt)}var Oxt=["itemStyle","opacity"],Rxt=function(n){$e(e,n);function e(t,r){var i=n.call(this)||this,a=i,o=new Gd,s=new la;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(t,r,!0),i}return e.prototype.updateData=function(t,r,i){var a=this,o=t.hostModel,s=t.getItemModel(r),l=t.getItemLayout(r),u=s.getModel("emphasis"),h=s.get(Oxt);h=h==null?1:h,i||x0(a),a.useStyle(t.getItemVisual(r,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Is(a,{style:{opacity:h}},o,r)):ma(a,{style:{opacity:h},shape:{points:l.points}},o,r),dc(a,s),this._updateLabel(t,r),vl(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,r){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=t.hostModel,l=t.getItemModel(r),u=t.getItemLayout(r),h=u.label,c=t.getItemVisual(r,"style"),f=c.fill;vc(o,hh(l),{labelFetcher:t.hostModel,labelDataIndex:r,defaultOpacity:c.opacity,defaultText:t.getName(r)},{normal:{align:h.textAlign,verticalAlign:h.verticalAlign}}),i.setTextConfig({local:!0,inside:!!h.inside,insideStroke:f,outsideFill:f});var d=h.linePoints;a.setShape({points:d}),i.textGuideLineConfig={anchor:d?new qn(d[0][0],d[0][1]):null},ma(o,{style:{x:h.x,y:h.y}},s,r),o.attr({rotation:h.rotation,originX:h.x,originY:h.y,z2:10}),aae(i,oae(l),{stroke:f})},e}(bd),Dxt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,r,i){var a=t.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new Rxt(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var h=o.getItemGraphicEl(u);h.updateData(a,l),s.add(h),a.setItemGraphicEl(l,h)}).remove(function(l){var u=o.getItemGraphicEl(l);lD(u,t,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(os);const Nxt=Dxt;var kxt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new L3(kr(this.getData,this),kr(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.getInitialData=function(t,r){return WI(this,{coordDimensions:["value"],encodeDefaulter:Un(Nie,this)})},e.prototype._defaultLabelLine=function(t){XE(t,"labelLine",["show"]);var r=t.labelLine,i=t.emphasis.labelLine;r.show=r.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.prototype.getDataParams=function(t){var r=this.getData(),i=n.prototype.getDataParams.call(this,t),a=r.mapDimension("value"),o=r.getSum(a);return i.percent=o?+(r.get(a,t)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Ws);const Fxt=kxt;function Bxt(n,e){return Uu(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Gxt(n,e){for(var t=n.mapDimension("value"),r=n.mapArray(t,function(l){return l}),i=[],a=e==="ascending",o=0,s=n.count();oiSt)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([n.offsetX,n.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(n){if(!(this._mouseDownPoint||!Rj(this,"mousemove"))){var e=this._model,t=e.coordinateSystem.getSlidedAxisExpandWindow([n.offsetX,n.offsetY]),r=t.behavior;r==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(r==="none"?null:{axisExpandWindow:t.axisExpandWindow,animation:r==="jump"?null:{duration:0}})}}};function Rj(n,e){var t=n._model;return t.get("axisExpandable")&&t.get("axisExpandTriggerOn")===e}const sSt=aSt;var lSt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){n.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var r=this.option;t&&ii(r,t,!0),this._initDimensions()},e.prototype.contains=function(t,r){var i=t.get("parallelIndex");return i!=null&&r.getComponent("parallel",i)===this},e.prototype.setAxisExpand=function(t){te(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(r){t.hasOwnProperty(r)&&(this.option[r]=t[r])},this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],r=this.parallelAxisIndex=[],i=To(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);te(i,function(a){t.push("dim"+a.get("dim")),r.push(a.componentIndex)})},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(oa);const uSt=lSt;var hSt=function(n){$e(e,n);function e(t,r,i,a,o){var s=n.call(this,t,r,i)||this;return s.type=a||"value",s.axisIndex=o,s}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(D0);const cSt=hSt;function J2(n,e,t,r,i,a){n=n||0;var o=t[1]-t[0];if(i!=null&&(i=rC(i,[0,o])),a!=null&&(a=Math.max(a,i!=null?i:0)),r==="all"){var s=Math.abs(e[1]-e[0]);s=rC(s,[0,o]),i=a=rC(s,[i,a]),r=0}e[0]=rC(e[0],t),e[1]=rC(e[1],t);var l=Dj(e,r);e[r]+=n;var u=i||0,h=t.slice();l.sign<0?h[0]+=u:h[1]-=u,e[r]=rC(e[r],h);var c;return c=Dj(e,r),i!=null&&(c.sign!==l.sign||c.spana&&(e[1-r]=e[r]+c.sign*a),e}function Dj(n,e){var t=n[e]-n[1-e];return{span:Math.abs(t),sign:t>0?-1:t<0?1:e?-1:1}}function rC(n,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,n))}var Nj=te,d6e=Math.min,v6e=Math.max,Lye=Math.floor,fSt=Math.ceil,Pye=Pl,dSt=Math.PI,vSt=function(){function n(e,t,r){this.type="parallel",this._axesMap=$r(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,r)}return n.prototype._init=function(e,t,r){var i=e.dimensions,a=e.parallelAxisIndex;Nj(i,function(o,s){var l=a[s],u=t.getComponent("parallelAxis",l),h=this._axesMap.set(o,new cSt(o,pU(u),[0,0],u.get("type"),l)),c=h.type==="category";h.onBand=c&&u.get("boundaryGap"),h.inverse=u.get("inverse"),u.axis=h,h.model=u,h.coordinateSystem=u.coordinateSystem=this},this)},n.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},n.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),r=t.axisBase,i=t.layoutBase,a=t.pixelDimIndex,o=e[1-a],s=e[a];return o>=r&&o<=r+t.axisLength&&s>=i&&s<=i+t.layoutLength},n.prototype.getModel=function(){return this._model},n.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(r){if(!!e.contains(r,t)){var i=r.getData();Nj(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),pM(o.scale,o.model)},this)}},this)},n.prototype.resize=function(e,t){this._rect=Uu(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},n.prototype.getRect=function(){return this._rect},n.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,r=["x","y"],i=["width","height"],a=e.get("layout"),o=a==="horizontal"?0:1,s=t[i[o]],l=[0,s],u=this.dimensions.length,h=D4(e.get("axisExpandWidth"),l),c=D4(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,d=e.get("axisExpandWindow"),v;if(d)v=D4(d[1]-d[0],l),d[1]=d[0]+v;else{v=D4(h*(c-1),l);var p=e.get("axisExpandCenter")||Lye(u/2);d=[h*p-v/2],d[1]=d[0]+v}var g=(s-v)/(u-c);g<3&&(g=0);var m=[Lye(Pye(d[0]/h,1))+1,fSt(Pye(d[1]/h,1))-1],y=g/h*d[0];return{layout:a,pixelDimIndex:o,layoutBase:t[r[o]],layoutLength:s,axisBase:t[r[1-o]],axisLength:t[i[1-o]],axisExpandable:f,axisExpandWidth:h,axisCollapseWidth:g,axisExpandWindow:d,axisCount:u,winInnerIndices:m,axisExpandWindow0Pos:y}},n.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,r=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;t.each(function(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),Nj(r,function(o,s){var l=(i.axisExpandable?gSt:pSt)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},h={horizontal:dSt/2,vertical:0},c=[u[a].x+e.x,u[a].y+e.y],f=h[a],d=Up();j2(d,d,f),sm(d,d,c),this._axesLayout[o]={position:c,rotation:f,transform:d,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},n.prototype.getAxis=function(e){return this._axesMap.get(e)},n.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},n.prototype.eachActiveState=function(e,t,r,i){r==null&&(r=0),i==null&&(i=e.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];te(o,function(g){s.push(e.mapDimension(g)),l.push(a.get(g).model)});for(var u=this.hasAxisBrushed(),h=r;ha*(1-c[0])?(u="jump",l=s-a*(1-c[2])):(l=s-a*c[1])>=0&&(l=s-a*(1-c[1]))<=0&&(l=0),l*=t.axisExpandWidth/h,l?J2(l,i,o,"all"):u="none";else{var d=i[1]-i[0],v=o[1]*s/d;i=[v6e(0,v-d/2)],i[1]=d6e(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},n}();function D4(n,e){return d6e(v6e(n,e[0]),e[1])}function pSt(n,e){var t=e.layoutLength/(e.axisCount-1);return{position:t*n,axisNameAvailableWidth:t,axisLabelShow:!0}}function gSt(n,e){var t=e.layoutLength,r=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,h;return n=0;i--)Op(r[i])},e.prototype.getActiveState=function(t){var r=this.activeIntervals;if(!r.length)return"normal";if(t==null||isNaN(+t))return"inactive";if(r.length===1){var i=r[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var a=0,o=r.length;abSt}function S6e(n){var e=n.length-1;return e<0&&(e=0),[n[0],n[e]]}function w6e(n,e,t,r){var i=new Cn;return i.add(new ta({name:"main",style:Pae(t),silent:!0,draggable:!0,cursor:"move",drift:Un(Nye,n,e,i,["n","s","w","e"]),ondragend:Un(QE,e,{isEnd:!0})})),te(r,function(a){i.add(new ta({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Un(Nye,n,e,i,a),ondragend:Un(QE,e,{isEnd:!0})}))}),i}function b6e(n,e,t,r){var i=r.brushStyle.lineWidth||0,a=mM(i,ESt),o=t[0][0],s=t[1][0],l=o-i/2,u=s-i/2,h=t[0][1],c=t[1][1],f=h-a+i/2,d=c-a+i/2,v=h-o,p=c-s,g=v+i,m=p+i;Km(n,e,"main",o,s,v,p),r.transformable&&(Km(n,e,"w",l,u,a,m),Km(n,e,"e",f,u,a,m),Km(n,e,"n",l,u,g,a),Km(n,e,"s",l,d,g,a),Km(n,e,"nw",l,u,a,a),Km(n,e,"ne",f,u,a,a),Km(n,e,"sw",l,d,a,a),Km(n,e,"se",f,d,a,a))}function YJ(n,e){var t=e.__brushOption,r=t.transformable,i=e.childAt(0);i.useStyle(Pae(t)),i.attr({silent:!r,cursor:r?"move":"default"}),te([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=e.childOfName(a.join("")),s=a.length===1?qJ(n,a[0]):PSt(n,a);o&&o.attr({silent:!r,invisible:!r,cursor:r?CSt[s]+"-resize":null})})}function Km(n,e,t,r,i,a,o){var s=e.childOfName(t);s&&s.setShape(RSt(Oae(n,e,[[r,i],[r+a,i+o]])))}function Pae(n){return sn({strokeNoScale:!0},n.brushStyle)}function E6e(n,e,t,r){var i=[ED(n,t),ED(e,r)],a=[mM(n,t),mM(e,r)];return[[i[0],a[0]],[i[1],a[1]]]}function LSt(n){return AE(n.group)}function qJ(n,e){var t={w:"left",e:"right",n:"top",s:"bottom"},r={left:"w",right:"e",top:"n",bottom:"s"},i=eU(t[e],LSt(n));return r[i]}function PSt(n,e){var t=[qJ(n,e[0]),qJ(n,e[1])];return(t[0]==="e"||t[0]==="w")&&t.reverse(),t.join("")}function Nye(n,e,t,r,i,a){var o=t.__brushOption,s=n.toRectRange(o.range),l=T6e(e,i,a);te(r,function(u){var h=TSt[u];s[h[0]][h[1]]+=l[h[0]]}),o.range=n.fromRectRange(E6e(s[0][0],s[1][0],s[0][1],s[1][1])),Mae(e,t),QE(e,{isEnd:!1})}function OSt(n,e,t,r){var i=e.__brushOption.range,a=T6e(n,t,r);te(i,function(o){o[0]+=a[0],o[1]+=a[1]}),Mae(n,e),QE(n,{isEnd:!1})}function T6e(n,e,t){var r=n.group,i=r.transformCoordToLocal(e,t),a=r.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function Oae(n,e,t){var r=x6e(n,e);return r&&r!==JE?r.clipPath(t,n._transform):Sn(t)}function RSt(n){var e=ED(n[0][0],n[1][0]),t=ED(n[0][1],n[1][1]),r=mM(n[0][0],n[1][0]),i=mM(n[0][1],n[1][1]);return{x:e,y:t,width:r-e,height:i-t}}function DSt(n,e,t){if(!(!n._brushType||kSt(n,e.offsetX,e.offsetY))){var r=n._zr,i=n._covers,a=Lae(n,e,t);if(!n._dragging)for(var o=0;or.getWidth()||t<0||t>r.getHeight()}var wU={lineX:Bye(0),lineY:Bye(1),rect:{createCover:function(n,e){function t(r){return r}return w6e({toRectRange:t,fromRectRange:t},n,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(n){var e=S6e(n);return E6e(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(n,e,t,r){b6e(n,e,t,r)},updateCommon:YJ,contain:KJ},polygon:{createCover:function(n,e){var t=new Cn;return t.add(new Gd({name:"main",style:Pae(e),silent:!0})),t},getCreatingRange:function(n){return n},endCreating:function(n,e){e.remove(e.childAt(0)),e.add(new bd({name:"main",draggable:!0,drift:Un(OSt,n,e),ondragend:Un(QE,n,{isEnd:!0})}))},updateCoverShape:function(n,e,t,r){e.childAt(0).setShape({points:Oae(n,e,t)})},updateCommon:YJ,contain:KJ}};function Bye(n){return{createCover:function(e,t){return w6e({toRectRange:function(r){var i=[r,[0,100]];return n&&i.reverse(),i},fromRectRange:function(r){return r[n]}},e,t,[[["w"],["e"]],[["n"],["s"]]][n])},getCreatingRange:function(e){var t=S6e(e),r=ED(t[0][n],t[1][n]),i=mM(t[0][n],t[1][n]);return[r,i]},updateCoverShape:function(e,t,r,i){var a,o=x6e(e,t);if(o!==JE&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(n);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-n]]}var l=[r,a];n&&l.reverse(),b6e(e,t,l,i)},updateCommon:YJ,contain:KJ}}const Rae=MSt;function A6e(n){return n=Dae(n),function(e){return Lke(e,n)}}function M6e(n,e){return n=Dae(n),function(t){var r=e!=null?e:t,i=r?n.width:n.height,a=r?n.x:n.y;return[a,a+(i||0)]}}function I6e(n,e,t){var r=Dae(n);return function(i,a){return r.contain(a[0],a[1])&&!mU(i,e,t)}}function Dae(n){return ai.create(n)}var FSt=["axisLine","axisTickLabel","axisName"],BSt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){n.prototype.init.apply(this,arguments),(this._brushController=new Rae(r.getZr())).on("brush",kr(this._onBrush,this))},e.prototype.render=function(t,r,i,a){if(!GSt(t,r,a)){this.axisModel=t,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Cn,this.group.add(this._axisGroup),!!t.get("show")){var s=USt(t,r),l=s.coordinateSystem,u=t.getAreaSelectStyle(),h=u.width,c=t.axis.dim,f=l.getAxisLayout(c),d=Mt({strokeContainThreshold:h},f),v=new d_(t,d);te(FSt,v.add,v),this._axisGroup.add(v.getGroup()),this._refreshBrushController(d,u,t,s,h,i),m3(o,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,r,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],h=Math.min(30,Math.abs(u)*.1),c=ai.create({x:l[0],y:-o/2,width:u,height:o});c.x-=h,c.width+=2*h,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:A6e(c),isTargetByCursor:I6e(c,s,a),getLinearBrushOtherExtent:M6e(c,0)}]).enableBrush({brushType:"lineX",brushStyle:r,removeOnClick:!0}).updateCovers(zSt(i))},e.prototype._onBrush=function(t){var r=t.areas,i=this.axisModel,a=i.axis,o=Vt(r,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(pl);function GSt(n,e,t){return t&&t.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:t})[0]===n}function zSt(n){var e=n.axis;return Vt(n.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function USt(n,e){return e.getComponent("parallel",n.get("parallelIndex"))}const VSt=BSt;var $St={type:"axisAreaSelect",event:"axisAreaSelected"};function WSt(n){n.registerAction($St,function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(r){r.axis.model.setActiveIntervals(e.intervals)})}),n.registerAction("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(r){r.setAxisExpand(e)})})}var HSt={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function L6e(n){n.registerComponentView(sSt),n.registerComponentModel(uSt),n.registerCoordinateSystem("parallel",xSt),n.registerPreprocessor(tSt),n.registerComponentModel(Oye),n.registerComponentView(VSt),yM(n,"parallel",Oye,HSt),WSt(n)}function jSt(n){_i(L6e),n.registerChartView(Xxt),n.registerSeriesModel(Kxt),n.registerVisual(n.PRIORITY.VISUAL.BRUSH,eSt)}var XSt=function(){function n(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return n}(),YSt=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new XSt},e.prototype.buildPath=function(t,r){var i=r.extent;t.moveTo(r.x1,r.y1),t.bezierCurveTo(r.cpx1,r.cpy1,r.cpx2,r.cpy2,r.x2,r.y2),r.orient==="vertical"?(t.lineTo(r.x2+i,r.y2),t.bezierCurveTo(r.cpx2+i,r.cpy2,r.cpx1+i,r.cpy1,r.x1+i,r.y1)):(t.lineTo(r.x2,r.y2+i),t.bezierCurveTo(r.cpx2,r.cpy2+i,r.cpx1,r.cpy1+i,r.x1,r.y1+i)),t.closePath()},e.prototype.highlight=function(){h_(this)},e.prototype.downplay=function(){c_(this)},e}(Si),qSt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._focusAdjacencyDisabled=!1,t}return e.prototype.render=function(t,r,i){var a=this,o=t.getGraph(),s=this.group,l=t.layoutInfo,u=l.width,h=l.height,c=t.getData(),f=t.getData("edge"),d=t.get("orient");this._model=t,s.removeAll(),s.x=l.x,s.y=l.y,o.eachEdge(function(v){var p=new YSt,g=Bn(p);g.dataIndex=v.dataIndex,g.seriesIndex=t.seriesIndex,g.dataType="edge";var m=v.getModel(),y=m.getModel("lineStyle"),_=y.get("curveness"),x=v.node1.getLayout(),S=v.node1.getModel(),w=S.get("localX"),b=S.get("localY"),E=v.node2.getLayout(),T=v.node2.getModel(),C=T.get("localX"),A=T.get("localY"),M=v.getLayout(),I,R,k,D,G,W,z,V;p.shape.extent=Math.max(1,M.dy),p.shape.orient=d,d==="vertical"?(I=(w!=null?w*u:x.x)+M.sy,R=(b!=null?b*h:x.y)+x.dy,k=(C!=null?C*u:E.x)+M.ty,D=A!=null?A*h:E.y,G=I,W=R*(1-_)+D*_,z=k,V=R*_+D*(1-_)):(I=(w!=null?w*u:x.x)+x.dx,R=(b!=null?b*h:x.y)+M.sy,k=C!=null?C*u:E.x,D=(A!=null?A*h:E.y)+M.ty,G=I*(1-_)+k*_,W=R,z=I*_+k*(1-_),V=D),p.setShape({x1:I,y1:R,x2:k,y2:D,cpx1:G,cpy1:W,cpx2:z,cpy2:V}),p.useStyle(y.getItemStyle()),Gye(p.style,d,v);var q=""+m.get("value"),Y=hh(m,"edgeLabel");vc(p,Y,{labelFetcher:{getFormattedLabel:function(Q,ie,oe,se,me,Ce){return t.getFormattedLabel(Q,ie,"edge",se,qy(me,Y.normal&&Y.normal.get("formatter"),q),Ce)}},labelDataIndex:v.dataIndex,defaultText:q}),p.setTextConfig({position:"inside"});var le=m.getModel("emphasis");dc(p,m,"lineStyle",function(Q){var ie=Q.getItemStyle();return Gye(ie,d,v),ie}),s.add(p),f.setItemGraphicEl(v.dataIndex,p);var j=le.get("focus");vl(p,j==="adjacency"?v.getAdjacentDataIndices():j==="trajectory"?v.getTrajectoryDataIndices():j,le.get("blurScope"),le.get("disabled"))}),o.eachNode(function(v){var p=v.getLayout(),g=v.getModel(),m=g.get("localX"),y=g.get("localY"),_=g.getModel("emphasis"),x=new ta({shape:{x:m!=null?m*u:p.x,y:y!=null?y*h:p.y,width:p.dx,height:p.dy},style:g.getModel("itemStyle").getItemStyle(),z2:10});vc(x,hh(g),{labelFetcher:{getFormattedLabel:function(w,b){return t.getFormattedLabel(w,b,"node")}},labelDataIndex:v.dataIndex,defaultText:v.id}),x.disableLabelAnimation=!0,x.setStyle("fill",v.getVisual("color")),x.setStyle("decal",v.getVisual("style").decal),dc(x,g),s.add(x),c.setItemGraphicEl(v.dataIndex,x),Bn(x).dataType="node";var S=_.get("focus");vl(x,S==="adjacency"?v.getAdjacentDataIndices():S==="trajectory"?v.getTrajectoryDataIndices():S,_.get("blurScope"),_.get("disabled"))}),c.eachItemGraphicEl(function(v,p){var g=c.getItemModel(p);g.get("draggable")&&(v.drift=function(m,y){a._focusAdjacencyDisabled=!0,this.shape.x+=m,this.shape.y+=y,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:c.getRawIndex(p),localX:this.shape.x/u,localY:this.shape.y/h})},v.ondragend=function(){a._focusAdjacencyDisabled=!1},v.draggable=!0,v.cursor="move")}),!this._data&&t.isAnimationEnabled()&&s.setClipPath(ZSt(s.getBoundingRect(),t,function(){s.removeClipPath()})),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(os);function Gye(n,e,t){switch(n.fill){case"source":n.fill=t.node1.getVisual("color"),n.decal=t.node1.getVisual("style").decal;break;case"target":n.fill=t.node2.getVisual("color"),n.decal=t.node2.getVisual("style").decal;break;case"gradient":var r=t.node1.getVisual("color"),i=t.node2.getVisual("color");Or(r)&&Or(i)&&(n.fill=new y3(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:r,offset:0},{color:i,offset:1}]))}}function ZSt(n,e,t){var r=new ta({shape:{x:n.x-10,y:n.y-10,width:0,height:n.height+20}});return Is(r,{shape:{width:n.width+20}},e,t),r}const KSt=qSt;var JSt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){var i=t.edges||t.links,a=t.data||t.nodes,o=t.levels;this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new as(o[l],this,r));if(a&&i){var u=c6e(a,i,this,!0,h);return u.data}function h(c,f){c.wrapMethod("getItemModel",function(d,v){var p=d.parentModel,g=p.getData().getItemLayout(v);if(g){var m=g.depth,y=p.levelModels[m];y&&(d.parentModel=y)}return d}),f.wrapMethod("getItemModel",function(d,v){var p=d.parentModel,g=p.getGraph().getEdgeByIndex(v),m=g.node1.getLayout();if(m){var y=m.depth,_=p.levelModels[y];_&&(d.parentModel=_)}return d})}},e.prototype.setNodePosition=function(t,r){var i=this.option.data||this.option.nodes,a=i[t];a.localX=r[0],a.localY=r[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,r,i){function a(d){return isNaN(d)||d==null}if(i==="edge"){var o=this.getDataParams(t,i),s=o.data,l=o.value,u=s.source+" -- "+s.target;return ch("nameValue",{name:u,value:l,noValue:a(l)})}else{var h=this.getGraph().getNodeByIndex(t),c=h.getLayout().value,f=this.getDataParams(t,i).data.name;return ch("nameValue",{name:f!=null?f+"":null,value:c,noValue:a(c)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(t,r){var i=n.prototype.getDataParams.call(this,t,r);if(i.value==null&&r==="node"){var a=this.getGraph().getNodeByIndex(t),o=a.getLayout().value;i.value=o}return i},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(Ws);const QSt=JSt;function ewt(n,e){n.eachSeriesByType("sankey",function(t){var r=t.get("nodeWidth"),i=t.get("nodeGap"),a=twt(t,e);t.layoutInfo=a;var o=a.width,s=a.height,l=t.getGraph(),u=l.nodes,h=l.edges;nwt(u);var c=To(u,function(p){return p.getLayout().value===0}),f=c.length!==0?0:t.get("layoutIterations"),d=t.get("orient"),v=t.get("nodeAlign");rwt(u,h,r,i,o,s,f,d,v)})}function twt(n,e){return Uu(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function rwt(n,e,t,r,i,a,o,s,l){iwt(n,e,t,i,a,s,l),lwt(n,e,a,i,r,o,s),ywt(n,s)}function nwt(n){te(n,function(e){var t=xS(e.outEdges,RG),r=xS(e.inEdges,RG),i=e.getValue()||0,a=Math.max(t,r,i);e.setLayout({value:a},!0)})}function iwt(n,e,t,r,i,a,o){for(var s=[],l=[],u=[],h=[],c=0,f=0;f=0;m&&g.depth>d&&(d=g.depth),p.setLayout({depth:m?g.depth:c},!0),a==="vertical"?p.setLayout({dy:t},!0):p.setLayout({dx:t},!0);for(var y=0;yc-1?d:c-1;o&&o!=="left"&&awt(n,o,a,b);var E=a==="vertical"?(i-t)/b:(r-t)/b;swt(n,E,a)}function P6e(n){var e=n.hostGraph.data.getRawDataItem(n.dataIndex);return e.depth!=null&&e.depth>=0}function awt(n,e,t,r){if(e==="right"){for(var i=[],a=n,o=0;a.length;){for(var s=0;s0;a--)l*=.99,cwt(s,l,o),kj(s,i,t,r,o),gwt(s,l,o),kj(s,i,t,r,o)}function uwt(n,e){var t=[],r=e==="vertical"?"y":"x",i=eJ(n,function(a){return a.getLayout()[r]});return i.keys.sort(function(a,o){return a-o}),te(i.keys,function(a){t.push(i.buckets.get(a))}),t}function hwt(n,e,t,r,i,a){var o=1/0;te(n,function(s){var l=s.length,u=0;te(s,function(c){u+=c.getLayout().value});var h=a==="vertical"?(r-(l-1)*i)/u:(t-(l-1)*i)/u;h0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),h=l.getLayout()[a]+l.getLayout()[f]+e;var v=i==="vertical"?r:t;if(u=h-e-v,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),h=s;for(var d=c-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[f]+e-h,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),h=l.getLayout()[a]}})}function cwt(n,e,t){te(n.slice().reverse(),function(r){te(r,function(i){if(i.outEdges.length){var a=xS(i.outEdges,fwt,t)/xS(i.outEdges,RG);if(isNaN(a)){var o=i.outEdges.length;a=o?xS(i.outEdges,dwt,t)/o:0}if(t==="vertical"){var s=i.getLayout().x+(a-GS(i,t))*e;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-GS(i,t))*e;i.setLayout({y:l},!0)}}})})}function fwt(n,e){return GS(n.node2,e)*n.getValue()}function dwt(n,e){return GS(n.node2,e)}function vwt(n,e){return GS(n.node1,e)*n.getValue()}function pwt(n,e){return GS(n.node1,e)}function GS(n,e){return e==="vertical"?n.getLayout().x+n.getLayout().dx/2:n.getLayout().y+n.getLayout().dy/2}function RG(n){return n.getValue()}function xS(n,e,t){for(var r=0,i=n.length,a=-1;++ao&&(o=l)}),te(r,function(s){var l=new fc({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),h=s.getModel().get(["itemStyle","color"]);h!=null?(s.setVisual("color",h),s.setVisual("style",{fill:h})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}i.length&&te(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function _wt(n){n.registerChartView(KSt),n.registerSeriesModel(QSt),n.registerLayout(ewt),n.registerVisual(mwt),n.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(r){r.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var O6e=function(){function n(){}return n.prototype.getInitialData=function(e,t){var r,i=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=i.get("type"),s=a.get("type"),l;o==="category"?(e.layout="horizontal",r=i.getOrdinalMeta(),l=!0):s==="category"?(e.layout="vertical",r=a.getOrdinalMeta(),l=!0):e.layout=e.layout||"horizontal";var u=["x","y"],h=e.layout==="horizontal"?0:1,c=this._baseAxisDim=u[h],f=u[1-h],d=[i,a],v=d[h].get("type"),p=d[1-h].get("type"),g=e.data;if(g&&l){var m=[];te(g,function(x,S){var w;Gt(x)?(w=x.slice(),x.unshift(S)):Gt(x.value)?(w=Mt({},x),w.value=w.value.slice(),x.value.unshift(S)):w=x,m.push(w)}),e.data=m}var y=this.defaultValueDimensions,_=[{name:c,type:SG(v),ordinalMeta:r,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:SG(p),dimsDef:y.slice()}];return WI(this,{coordDimensions:_,dimensionsCount:y.length+1,encodeDefaulter:Un(nFe,_,this)})},n.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},n}(),R6e=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],t.visualDrawType="stroke",t}return e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(Ws);gu(R6e,O6e,!0);const xwt=R6e;var Swt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=t.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var h=a.getItemLayout(u),c=zye(h,a,u,l,!0);a.setItemGraphicEl(u,c),o.add(c)}}).update(function(u,h){var c=s.getItemGraphicEl(h);if(!a.hasValue(u)){o.remove(c);return}var f=a.getItemLayout(u);c?(x0(c),D6e(f,c,a,u)):c=zye(f,a,u,l),o.add(c),a.setItemGraphicEl(u,c)}).remove(function(u){var h=s.getItemGraphicEl(u);h&&o.remove(h)}).execute(),this._data=a},e.prototype.remove=function(t){var r=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(a){a&&r.remove(a)})},e.type="boxplot",e}(os),wwt=function(){function n(){}return n}(),bwt=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="boxplotBoxPath",r}return e.prototype.getDefaultShape=function(){return new wwt},e.prototype.buildPath=function(t,r){var i=r.points,a=0;for(t.moveTo(i[a][0],i[a][1]),a++;a<4;a++)t.lineTo(i[a][0],i[a][1]);for(t.closePath();ap){var x=[m,_];r.push(x)}}}return{boxData:t,outliers:r}}var Pwt={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==qc){var r="";ao(r)}var i=Lwt(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Owt(n){n.registerSeriesModel(xwt),n.registerChartView(Twt),n.registerLayout(Cwt),n.registerTransform(Pwt)}var Rwt=["color","borderColor"],Dwt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,r,i){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,r,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,r):this._incrementalRenderNormal(t,r)},e.prototype.eachRendered=function(t){_w(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var r=t.pipelineContext.large;(this._isLargeDraw==null||r!==this._isLargeDraw)&&(this._isLargeDraw=r,this._clear())},e.prototype._renderNormal=function(t){var r=t.getData(),i=this._data,a=this.group,o=r.getLayout("isSimpleBox"),s=t.get("clip",!0),l=t.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),r.diff(i).add(function(h){if(r.hasValue(h)){var c=r.getItemLayout(h);if(s&&Uye(u,c))return;var f=Fj(c,h,!0);Is(f,{shape:{points:c.ends}},t,h),Bj(f,r,h,o),a.add(f),r.setItemGraphicEl(h,f)}}).update(function(h,c){var f=i.getItemGraphicEl(c);if(!r.hasValue(h)){a.remove(f);return}var d=r.getItemLayout(h);if(s&&Uye(u,d)){a.remove(f);return}f?(ma(f,{shape:{points:d.ends}},t,h),x0(f)):f=Fj(d),Bj(f,r,h,o),a.add(f),r.setItemGraphicEl(h,f)}).remove(function(h){var c=i.getItemGraphicEl(h);c&&a.remove(c)}).execute(),this._data=r},e.prototype._renderLarge=function(t){this._clear(),Vye(t,this.group);var r=t.get("clip",!0)?yU(t.coordinateSystem,!1,t):null;r?this.group.setClipPath(r):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,r){for(var i=r.getData(),a=i.getLayout("isSimpleBox"),o;(o=t.next())!=null;){var s=i.getItemLayout(o),l=Fj(s);Bj(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},e.prototype._incrementalRenderLarge=function(t,r){Vye(r,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(os),Nwt=function(){function n(){}return n}(),kwt=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="normalCandlestickBox",r}return e.prototype.getDefaultShape=function(){return new Nwt},e.prototype.buildPath=function(t,r){var i=r.points;this.__simpleBox?(t.moveTo(i[4][0],i[4][1]),t.lineTo(i[6][0],i[6][1])):(t.moveTo(i[0][0],i[0][1]),t.lineTo(i[1][0],i[1][1]),t.lineTo(i[2][0],i[2][1]),t.lineTo(i[3][0],i[3][1]),t.closePath(),t.moveTo(i[4][0],i[4][1]),t.lineTo(i[5][0],i[5][1]),t.moveTo(i[6][0],i[6][1]),t.lineTo(i[7][0],i[7][1]))},e}(Si);function Fj(n,e,t){var r=n.ends;return new kwt({shape:{points:t?Fwt(r,n):r},z2:100})}function Uye(n,e){for(var t=!0,r=0;r0?"borderColor":"borderColor0"])||t.get(["itemStyle",n>0?"color":"color0"]);n===0&&(i=t.get(["itemStyle","borderColorDoji"]));var a=t.getModel("itemStyle").getItemStyle(Rwt);e.useStyle(a),e.style.fill=null,e.style.stroke=i}const Gwt=Dwt;var N6e=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],t}return e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,r,i){var a=r.getItemLayout(t);return a&&i.rect(a.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(Ws);gu(N6e,O6e,!0);const zwt=N6e;function Uwt(n){!n||!Gt(n.series)||te(n.series,function(e){dn(e)&&e.type==="k"&&(e.type="candlestick")})}var Vwt=["itemStyle","borderColor"],$wt=["itemStyle","borderColor0"],Wwt=["itemStyle","borderColorDoji"],Hwt=["itemStyle","color"],jwt=["itemStyle","color0"],Xwt={seriesType:"candlestick",plan:UI(),performRawSeries:!0,reset:function(n,e){function t(a,o){return o.get(a>0?Hwt:jwt)}function r(a,o){return o.get(a===0?Wwt:a>0?Vwt:$wt)}if(!e.isSeriesFiltered(n)){var i=n.pipelineContext.large;return!i&&{progress:function(a,o){for(var s;(s=a.next())!=null;){var l=o.getItemModel(s),u=o.getItemLayout(s).sign,h=l.getItemStyle();h.fill=t(u,l),h.stroke=r(u,l)||h.fill;var c=o.ensureUniqueItemVisual(s,"style");Mt(c,h)}}}}}};const Ywt=Xwt;var qwt={seriesType:"candlestick",plan:UI(),reset:function(n){var e=n.coordinateSystem,t=n.getData(),r=Zwt(n,t),i=0,a=1,o=["x","y"],s=t.getDimensionIndex(t.mapDimension(o[i])),l=Vt(t.mapDimensionsAll(o[a]),t.getDimensionIndex,t),u=l[0],h=l[1],c=l[2],f=l[3];if(t.setLayout({candleWidth:r,isSimpleBox:r<=1.3}),s<0||l.length<4)return;return{progress:n.pipelineContext.large?v:d};function d(p,g){for(var m,y=g.getStore();(m=p.next())!=null;){var _=y.get(s,m),x=y.get(u,m),S=y.get(h,m),w=y.get(c,m),b=y.get(f,m),E=Math.min(x,S),T=Math.max(x,S),C=G(E,_),A=G(T,_),M=G(w,_),I=G(b,_),R=[];W(R,A,0),W(R,C,1),R.push(V(I),V(A),V(M),V(C));var k=g.getItemModel(m),D=!!k.get(["itemStyle","borderColorDoji"]);g.setItemLayout(m,{sign:$ye(y,m,x,S,h,D),initBaseline:x>S?A[a]:C[a],ends:R,brushRect:z(w,b,_)})}function G(q,Y){var le=[];return le[i]=Y,le[a]=q,isNaN(Y)||isNaN(q)?[NaN,NaN]:e.dataToPoint(le)}function W(q,Y,le){var j=Y.slice(),Q=Y.slice();j[i]=MB(j[i]+r/2,1,!1),Q[i]=MB(Q[i]-r/2,1,!0),le?q.push(j,Q):q.push(Q,j)}function z(q,Y,le){var j=G(q,le),Q=G(Y,le);return j[i]-=r/2,Q[i]-=r/2,{x:j[0],y:j[1],width:r,height:Q[1]-j[1]}}function V(q){return q[i]=MB(q[i],1),q}}function v(p,g){for(var m=Fy(p.count*4),y=0,_,x=[],S=[],w,b=g.getStore(),E=!!n.get(["itemStyle","borderColorDoji"]);(w=p.next())!=null;){var T=b.get(s,w),C=b.get(u,w),A=b.get(h,w),M=b.get(c,w),I=b.get(f,w);if(isNaN(T)||isNaN(M)||isNaN(I)){m[y++]=NaN,y+=3;continue}m[y++]=$ye(b,w,C,A,h,E),x[i]=T,x[a]=M,_=e.dataToPoint(x,null,S),m[y++]=_?_[0]:NaN,m[y++]=_?_[1]:NaN,x[a]=I,_=e.dataToPoint(x,null,S),m[y++]=_?_[1]:NaN}g.setLayout("largePoints",m)}}};function $ye(n,e,t,r,i,a){var o;return t>r?o=-1:t0?n.get(i,e-1)<=r?1:-1:1,o}function Zwt(n,e){var t=n.getBaseAxis(),r,i=t.type==="category"?t.getBandWidth():(r=t.getExtent(),Math.abs(r[1]-r[0])/e.count()),a=xr(ni(n.get("barMaxWidth"),i),i),o=xr(ni(n.get("barMinWidth"),1),i),s=n.get("barWidth");return s!=null?xr(s,i):Math.max(Math.min(i/2,a),o)}const Kwt=qwt;function Jwt(n){n.registerChartView(Gwt),n.registerSeriesModel(zwt),n.registerPreprocessor(Uwt),n.registerVisual(Ywt),n.registerLayout(Kwt)}function Wye(n,e){var t=e.rippleEffectColor||e.color;n.eachChild(function(r){r.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?t:null,fill:e.brushType==="fill"?t:null}})})}var Qwt=function(n){$e(e,n);function e(t,r){var i=n.call(this)||this,a=new C3(t,r),o=new Cn;return i.add(a),i.add(o),i.updateData(t,r),i}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var r=t.symbolType,i=t.color,a=t.rippleNumber,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/h*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;rn(c)?f=c(i):f=c,a.__t>0&&(f=-s*a.__t),this._animateSymbol(a,s,f,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(t,r,i,a,o){if(r>0){t.__t=0;var s=this,l=t.animate("",a).when(o?r*2:r,{__t:o?2:1}).delay(i).during(function(){s._updateSymbolPosition(t)});a||l.done(function(){s.remove(t)}),l.start()}},e.prototype._getLineLength=function(t){return Zx(t.__p1,t.__cp1)+Zx(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,r){t.__p1=r[0],t.__p2=r[1],t.__cp1=r[2]||[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2]},e.prototype.updateData=function(t,r,i){this.childAt(0).updateData(t,r,i),this._updateEffectSymbol(t,r)},e.prototype._updateSymbolPosition=function(t){var r=t.__p1,i=t.__p2,a=t.__cp1,o=t.__t<1?t.__t:2-t.__t,s=[t.x,t.y],l=s.slice(),u=Ph,h=UK;s[0]=u(r[0],a[0],i[0],o),s[1]=u(r[1],a[1],i[1],o);var c=t.__t<1?h(r[0],a[0],i[0],o):h(i[0],a[0],r[0],1-o),f=t.__t<1?h(r[1],a[1],i[1],o):h(i[1],a[1],r[1],1-o);t.rotation=-Math.atan2(f,c)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(t.__lastT!==void 0&&t.__lastT=0&&!(a[l]<=r);l--);l=Math.min(l,o-2)}else{for(l=s;lr);l++);l=Math.min(l-1,o-2)}var h=(r-a[l])/(a[l+1]-a[l]),c=i[l],f=i[l+1];t.x=c[0]*(1-h)+h*f[0],t.y=c[1]*(1-h)+h*f[1];var d=t.__t<1?f[0]-c[0]:c[0]-f[0],v=t.__t<1?f[1]-c[1]:c[1]-f[1];t.rotation=-Math.atan2(v,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=r,t.ignore=!1}},e}(k6e);const ubt=lbt;var hbt=function(){function n(){this.polyline=!1,this.curveness=0,this.segs=[]}return n}(),cbt=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r._off=0,r.hoverDataIdx=-1,r}return e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new hbt},e.prototype.buildPath=function(t,r){var i=r.segs,a=r.curveness,o;if(r.polyline)for(o=this._off;o0){t.moveTo(i[o++],i[o++]);for(var l=1;l0){var d=(u+c)/2-(h-f)*a,v=(h+f)/2-(c-u)*a;t.quadraticCurveTo(d,v,c,f)}else t.lineTo(c,f)}this.incremental&&(this._off=o,this.notClear=!0)},e.prototype.findDataIndex=function(t,r){var i=this.shape,a=i.segs,o=i.curveness,s=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u0)for(var c=a[u++],f=a[u++],d=1;d0){var g=(c+v)/2-(f-p)*o,m=(f+p)/2-(v-c)*o;if($3e(c,f,g,m,v,p,s,t,r))return l}else if(Nx(c,f,v,p,s,t,r))return l;l++}return-1},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();if(t=i[0],r=i[1],a.contain(t,r)){var o=this.hoverDataIdx=this.findDataIndex(t,r);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var r=this.shape,i=r.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+e.__startIndex)})},n.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},n}();const dbt=fbt;var vbt={seriesType:"lines",plan:UI(),reset:function(n){var e=n.coordinateSystem;if(!!e){var t=n.get("polyline"),r=n.pipelineContext.large;return{progress:function(i,a){var o=[];if(r){var s=void 0,l=i.end-i.start;if(t){for(var u=0,h=i.start;h0&&(h||u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var c=t.get("clip",!0)&&yU(t.coordinateSystem,!1,t);c?this.group.setClipPath(c):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,r,i){var a=t.getData(),o=this._updateLineDraw(a,t);o.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(t,r,i){this._lineDraw.incrementalUpdate(t,r.getData()),this._finished=t.end===r.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,r,i){var a=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=B6e.reset(t,r,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(t,r){var i=this._lineDraw,a=this._showEffect(r),o=!!r.get("polyline"),s=r.pipelineContext,l=s.large;return(!i||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new dbt:new Aae(o?a?ubt:F6e:a?k6e:Cae),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(i.group),i},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var r=t.getZr(),i=r.painter.getType()==="svg";!i&&this._lastZlevel!=null&&r.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,r){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(r)},e.prototype.dispose=function(t,r){this.remove(t,r)},e.type="lines",e}(os);const gbt=pbt;var ybt=typeof Uint32Array>"u"?Array:Uint32Array,mbt=typeof Float64Array>"u"?Array:Float64Array;function Hye(n){var e=n.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(n.data=Vt(e,function(t){var r=[t[0].coord,t[1].coord],i={coords:r};return t[0].name&&(i.fromName=t[0].name),t[1].name&&(i.toName=t[1].name),nie([i,t[0],t[1]])}))}var _bt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return e.prototype.init=function(t){t.data=t.data||[],Hye(t);var r=this._processFlatCoordsArray(t.data);this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset,r.flatCoords&&(t.data=new Float32Array(r.count)),n.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(t){if(Hye(t),t.data){var r=this._processFlatCoordsArray(t.data);this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset,r.flatCoords&&(t.data=new Float32Array(r.count))}n.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var r=this._processFlatCoordsArray(t.data);r.flatCoords&&(this._flatCoords?(this._flatCoords=K8(this._flatCoords,r.flatCoords),this._flatCoordsOffset=K8(this._flatCoordsOffset,r.flatCoordsOffset)):(this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset),t.data=new Float32Array(r.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var r=this.getData().getItemModel(t),i=r.option instanceof Array?r.option:r.getShallow("coords");return i},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[t*2+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,r){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[t*2],a=this._flatCoordsOffset[t*2+1],o=0;o ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return t==null?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t==null?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),r=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&r>0?r+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(Ws);const xbt=_bt;function N4(n){return n instanceof Array||(n=[n,n]),n}var Sbt={seriesType:"lines",reset:function(n){var e=N4(n.get("symbol")),t=N4(n.get("symbolSize")),r=n.getData();r.setVisual("fromSymbol",e&&e[0]),r.setVisual("toSymbol",e&&e[1]),r.setVisual("fromSymbolSize",t&&t[0]),r.setVisual("toSymbolSize",t&&t[1]);function i(a,o){var s=a.getItemModel(o),l=N4(s.getShallow("symbol",!0)),u=N4(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:r.hasItemOption?i:null}}};const wbt=Sbt;function bbt(n){n.registerChartView(gbt),n.registerSeriesModel(xbt),n.registerLayout(B6e),n.registerVisual(wbt)}var Ebt=256,Tbt=function(){function n(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=s_.createCanvas();this.canvas=e}return n.prototype.update=function(e,t,r,i,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),h=this.pointSize+this.blurSize,c=this.canvas,f=c.getContext("2d"),d=e.length;c.width=t,c.height=r;for(var v=0;v0){var M=o(_)?l:u;_>0&&(_=_*C+E),S[w++]=M[A],S[w++]=M[A+1],S[w++]=M[A+2],S[w++]=M[A+3]*_*256}else w+=4}return f.putImageData(x,0,0),c},n.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=s_.createCanvas()),t=this.pointSize+this.blurSize,r=t*2;e.width=r,e.height=r;var i=e.getContext("2d");return i.clearRect(0,0,r,r),i.shadowOffsetX=r,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),e},n.prototype._getGradient=function(e,t){for(var r=this._gradientPixels,i=r[t]||(r[t]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)e[t](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},n}();const Cbt=Tbt;function Abt(n,e,t){var r=n[1]-n[0];e=Vt(e,function(o){return{interval:[(o.interval[0]-n[0])/r,(o.interval[1]-n[0])/r]}});var i=e.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=e[0]&&r<=e[1]}}function jye(n){var e=n.dimensions;return e[0]==="lng"&&e[1]==="lat"}var Ibt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a;r.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===t&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=t.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):jye(o)&&this._renderOnGeo(o,t,a,i)},e.prototype.incrementalPrepareRender=function(t,r,i){this.group.removeAll()},e.prototype.incrementalRender=function(t,r,i,a){var o=r.coordinateSystem;o&&(jye(o)?this.render(r,i,a):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(r,a,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){_w(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,r,i,a,o){var s=t.coordinateSystem,l=Z2(s,"cartesian2d"),u,h,c,f;if(l){var d=s.getAxis("x"),v=s.getAxis("y");u=d.getBandWidth()+.5,h=v.getBandWidth()+.5,c=d.scale.getExtent(),f=v.scale.getExtent()}for(var p=this.group,g=t.getData(),m=t.getModel(["emphasis","itemStyle"]).getItemStyle(),y=t.getModel(["blur","itemStyle"]).getItemStyle(),_=t.getModel(["select","itemStyle"]).getItemStyle(),x=t.get(["itemStyle","borderRadius"]),S=hh(t),w=t.getModel("emphasis"),b=w.get("focus"),E=w.get("blurScope"),T=w.get("disabled"),C=l?[g.mapDimension("x"),g.mapDimension("y"),g.mapDimension("value")]:[g.mapDimension("time"),g.mapDimension("value")],A=i;Ac[1]||kf[1])continue;var D=s.dataToPoint([R,k]);M=new ta({shape:{x:D[0]-u/2,y:D[1]-h/2,width:u,height:h},style:I})}else{if(isNaN(g.get(C[1],A)))continue;M=new ta({z2:1,shape:s.dataToRect([g.get(C[0],A)]).contentShape,style:I})}if(g.hasItemOption){var G=g.getItemModel(A),W=G.getModel("emphasis");m=W.getModel("itemStyle").getItemStyle(),y=G.getModel(["blur","itemStyle"]).getItemStyle(),_=G.getModel(["select","itemStyle"]).getItemStyle(),x=G.get(["itemStyle","borderRadius"]),b=W.get("focus"),E=W.get("blurScope"),T=W.get("disabled"),S=hh(G)}M.shape.r=x;var z=t.getRawValue(A),V="-";z&&z[2]!=null&&(V=z[2]+""),vc(M,S,{labelFetcher:t,labelDataIndex:A,defaultOpacity:I.opacity,defaultText:V}),M.ensureState("emphasis").style=m,M.ensureState("blur").style=y,M.ensureState("select").style=_,vl(M,b,E,T),M.incremental=o,o&&(M.states.emphasis.hoverLayer=!0),p.add(M),g.setItemGraphicEl(A,M),this._progressiveEls&&this._progressiveEls.push(M)}},e.prototype._renderOnGeo=function(t,r,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=r.getData(),u=this._hmLayer||this._hmLayer||new Cbt;u.blurSize=r.get("blurSize"),u.pointSize=r.get("pointSize"),u.minOpacity=r.get("minOpacity"),u.maxOpacity=r.get("maxOpacity");var h=t.getViewRect().clone(),c=t.getRoamTransform();h.applyTransform(c);var f=Math.max(h.x,0),d=Math.max(h.y,0),v=Math.min(h.width+h.x,a.getWidth()),p=Math.min(h.height+h.y,a.getHeight()),g=v-f,m=p-d,y=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],_=l.mapArray(y,function(b,E,T){var C=t.dataToPoint([b,E]);return C[0]-=f,C[1]-=d,C.push(T),C}),x=i.getExtent(),S=i.type==="visualMap.continuous"?Mbt(x,i.option.range):Abt(x,i.getPieceList(),i.option.selected);u.update(_,g,m,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},S);var w=new xc({style:{width:g,height:m,x:f,y:d,image:u.canvas},silent:!0});this.group.add(w)},e.type="heatmap",e}(os);const Lbt=Ibt;var Pbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){return k_(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=S3.get(this.get("coordinateSystem"));if(t&&t.dimensions)return t.dimensions[0]==="lng"&&t.dimensions[1]==="lat"},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(Ws);const Obt=Pbt;function Rbt(n){n.registerChartView(Lbt),n.registerSeriesModel(Obt)}var Dbt=["itemStyle","borderWidth"],Xye=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],Uj=new cm,Nbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group,o=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis(),h=u.isHorizontal(),c=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:t,coordSys:l,coordSysExtent:[[c.x,c.x+c.width],[c.y,c.y+c.height]],isHorizontal:h,valueDim:Xye[+h],categoryDim:Xye[1-+h]};return o.diff(s).add(function(d){if(!!o.hasValue(d)){var v=qye(o,d),p=Yye(o,d,v,f),g=Zye(o,f,p);o.setItemGraphicEl(d,g),a.add(g),Jye(g,f,p)}}).update(function(d,v){var p=s.getItemGraphicEl(v);if(!o.hasValue(d)){a.remove(p);return}var g=qye(o,d),m=Yye(o,d,g,f),y=W6e(o,m);p&&y!==p.__pictorialShapeStr&&(a.remove(p),o.setItemGraphicEl(d,null),p=null),p?Vbt(p,f,m):p=Zye(o,f,m,!0),o.setItemGraphicEl(d,p),p.__pictorialSymbolMeta=m,a.add(p),Jye(p,f,m)}).remove(function(d){var v=s.getItemGraphicEl(d);v&&Kye(s,d,v.__pictorialSymbolMeta.animationModel,v)}).execute(),this._data=o,this.group},e.prototype.remove=function(t,r){var i=this.group,a=this._data;t.get("animation")?a&&a.eachItemGraphicEl(function(o){Kye(a,Bn(o).dataIndex,t,o)}):i.removeAll()},e.type="pictorialBar",e}(os);function Yye(n,e,t,r){var i=n.getItemLayout(e),a=t.get("symbolRepeat"),o=t.get("symbolClip"),s=t.get("symbolPosition")||"start",l=t.get("symbolRotate"),u=(l||0)*Math.PI/180||0,h=t.get("symbolPatternSize")||2,c=t.isAnimationEnabled(),f={dataIndex:e,layout:i,itemModel:t,symbolType:n.getItemVisual(e,"symbol")||"circle",style:n.getItemVisual(e,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:t.get("symbolRepeatDirection"),symbolPatternSize:h,rotation:u,animationModel:c?t:null,hoverScale:c&&t.get(["emphasis","scale"]),z2:t.getShallow("z",!0)||0};kbt(t,a,i,r,f),Fbt(n,e,i,a,o,f.boundingLength,f.pxSign,h,r,f),Bbt(t,f.symbolScale,u,r,f);var d=f.symbolSize,v=Y2(t.get("symbolOffset"),d);return Gbt(t,d,i,a,o,v,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,r,f),f}function kbt(n,e,t,r,i){var a=r.valueDim,o=n.get("symbolBoundingData"),s=r.coordSys.getOtherAxis(r.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(t[a.wh]<=0),h;if(Gt(o)){var c=[Vj(s,o[0])-l,Vj(s,o[1])-l];c[1]0?1:-1}function Vj(n,e){return n.toGlobalCoord(n.dataToCoord(n.scale.parse(e)))}function Fbt(n,e,t,r,i,a,o,s,l,u){var h=l.valueDim,c=l.categoryDim,f=Math.abs(t[c.wh]),d=n.getItemVisual(e,"symbolSize"),v;Gt(d)?v=d.slice():d==null?v=["100%","100%"]:v=[d,d],v[c.index]=xr(v[c.index],f),v[h.index]=xr(v[h.index],r?f:Math.abs(a)),u.symbolSize=v;var p=u.symbolScale=[v[0]/s,v[1]/s];p[h.index]*=(l.isHorizontal?-1:1)*o}function Bbt(n,e,t,r,i){var a=n.get(Dbt)||0;a&&(Uj.attr({scaleX:e[0],scaleY:e[1],rotation:t}),Uj.updateTransform(),a/=Uj.getLineScale(),a*=e[r.valueDim.index]),i.valueLineWidth=a||0}function Gbt(n,e,t,r,i,a,o,s,l,u,h,c){var f=h.categoryDim,d=h.valueDim,v=c.pxSign,p=Math.max(e[d.index]+s,0),g=p;if(r){var m=Math.abs(l),y=Gh(n.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1));var x=xr(y,e[d.index]),S=Math.max(p+x*2,0),w=_?0:x*2,b=M3e(r),E=b?r:Qye((m+w)/S),T=m-E*p;x=T/2/(_?E:Math.max(E-1,1)),S=p+x*2,w=_?0:x*2,!b&&r!=="fixed"&&(E=u?Qye((Math.abs(u)+w)/S):0),g=E*S-w,c.repeatTimes=E,c.symbolMargin=x}var C=v*(g/2),A=c.pathPosition=[];A[f.index]=t[f.wh]/2,A[d.index]=o==="start"?C:o==="end"?l-C:l/2,a&&(A[0]+=a[0],A[1]+=a[1]);var M=c.bundlePosition=[];M[f.index]=t[f.xy],M[d.index]=t[d.xy];var I=c.barRectShape=Mt({},t);I[d.wh]=v*Math.max(Math.abs(t[d.wh]),Math.abs(A[d.index]+C)),I[f.wh]=t[f.wh];var R=c.clipShape={};R[f.xy]=-t[f.xy],R[f.wh]=h.ecSize[f.wh],R[d.xy]=0,R[d.wh]=t[d.wh]}function G6e(n){var e=n.symbolPatternSize,t=hu(n.symbolType,-e/2,-e/2,e,e);return t.attr({culling:!0}),t.type!=="image"&&t.setStyle({strokeNoScale:!0}),t}function z6e(n,e,t,r){var i=n.__pictorialBundle,a=t.symbolSize,o=t.valueLineWidth,s=t.pathPosition,l=e.valueDim,u=t.repeatTimes||0,h=0,c=a[e.valueDim.index]+o+t.symbolMargin*2;for(Nae(n,function(p){p.__pictorialAnimationIndex=h,p.__pictorialRepeatTimes=u,h0:m<0)&&(y=u-1-p),g[l.index]=c*(y-u/2+.5)+s[l.index],{x:g[0],y:g[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation}}}function U6e(n,e,t,r){var i=n.__pictorialBundle,a=n.__pictorialMainPath;a?zA(a,null,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation},t,r):(a=n.__pictorialMainPath=G6e(t),i.add(a),zA(a,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:0,scaleY:0,rotation:t.rotation},{scaleX:t.symbolScale[0],scaleY:t.symbolScale[1]},t,r))}function V6e(n,e,t){var r=Mt({},e.barRectShape),i=n.__pictorialBarRect;i?zA(i,null,{shape:r},e,t):(i=n.__pictorialBarRect=new ta({z2:2,shape:r,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,n.add(i))}function $6e(n,e,t,r){if(t.symbolClip){var i=n.__pictorialClipPath,a=Mt({},t.clipShape),o=e.valueDim,s=t.animationModel,l=t.dataIndex;if(i)ma(i,{shape:a},s,l);else{a[o.wh]=0,i=new ta({shape:a}),n.__pictorialBundle.setClipPath(i),n.__pictorialClipPath=i;var u={};u[o.wh]=t.clipShape[o.wh],x3[r?"updateProps":"initProps"](i,{shape:u},s,l)}}}function qye(n,e){var t=n.getItemModel(e);return t.getAnimationDelayParams=zbt,t.isAnimationEnabled=Ubt,t}function zbt(n){return{index:n.__pictorialAnimationIndex,count:n.__pictorialRepeatTimes}}function Ubt(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function Zye(n,e,t,r){var i=new Cn,a=new Cn;return i.add(a),i.__pictorialBundle=a,a.x=t.bundlePosition[0],a.y=t.bundlePosition[1],t.symbolRepeat?z6e(i,e,t):U6e(i,e,t),V6e(i,t,r),$6e(i,e,t,r),i.__pictorialShapeStr=W6e(n,t),i.__pictorialSymbolMeta=t,i}function Vbt(n,e,t){var r=t.animationModel,i=t.dataIndex,a=n.__pictorialBundle;ma(a,{x:t.bundlePosition[0],y:t.bundlePosition[1]},r,i),t.symbolRepeat?z6e(n,e,t,!0):U6e(n,e,t,!0),V6e(n,t,!0),$6e(n,e,t,!0)}function Kye(n,e,t,r){var i=r.__pictorialBarRect;i&&i.removeTextContent();var a=[];Nae(r,function(o){a.push(o)}),r.__pictorialMainPath&&a.push(r.__pictorialMainPath),r.__pictorialClipPath&&(t=null),te(a,function(o){NS(o,{scaleX:0,scaleY:0},t,e,function(){r.parent&&r.parent.remove(r)})}),n.setItemGraphicEl(e,null)}function W6e(n,e){return[n.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function Nae(n,e,t){te(n.__pictorialBundle.children(),function(r){r!==n.__pictorialBarRect&&e.call(t,r)})}function zA(n,e,t,r,i,a){e&&n.attr(e),r.symbolClip&&!i?t&&n.attr(t):t&&x3[i?"updateProps":"initProps"](n,t,r.animationModel,r.dataIndex,a)}function Jye(n,e,t){var r=t.dataIndex,i=t.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),h=a.get("focus"),c=a.get("blurScope"),f=a.get("scale");Nae(n,function(p){if(p instanceof xc){var g=p.style;p.useStyle(Mt({image:g.image,x:g.x,y:g.y,width:g.width,height:g.height},t.style))}else p.useStyle(t.style);var m=p.ensureState("emphasis");m.style=o,f&&(m.scaleX=p.scaleX*1.1,m.scaleY=p.scaleY*1.1),p.ensureState("blur").style=s,p.ensureState("select").style=l,u&&(p.cursor=u),p.z2=t.z2});var d=e.valueDim.posDesc[+(t.boundingLength>0)],v=n.__pictorialBarRect;vc(v,hh(i),{labelFetcher:e.seriesModel,labelDataIndex:r,defaultText:gM(e.seriesModel.getData(),r),inheritColor:t.style.fill,defaultOpacity:t.style.opacity,defaultOutsidePosition:d}),vl(n,h,c,a.get("disabled"))}function Qye(n){var e=Math.round(n);return Math.abs(n-e)<1e-4?e:Math.ceil(n)}const $bt=Nbt;var Wbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t.defaultSymbol="roundRect",t}return e.prototype.getInitialData=function(t){return t.stack=null,n.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=xw(CG.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(CG);const Hbt=Wbt;function jbt(n){n.registerChartView($bt),n.registerSeriesModel(Hbt),n.registerLayout(n.PRIORITY.VISUAL.LAYOUT,Un(T4e,"pictorialBar")),n.registerLayout(n.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,C4e("pictorialBar"))}var Xbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._layers=[],t}return e.prototype.render=function(t,r,i){var a=t.getData(),o=this,s=this.group,l=t.getLayerSeries(),u=a.getLayout("layoutInfo"),h=u.rect,c=u.boundaryGap;s.x=0,s.y=h.y+c[0];function f(g){return g.name}var d=new f_(this._layersSeries||[],l,f,f),v=[];d.add(kr(p,this,"add")).update(kr(p,this,"update")).remove(kr(p,this,"remove")).execute();function p(g,m,y){var _=o._layers;if(g==="remove"){s.remove(_[m]);return}for(var x=[],S=[],w,b=l[m].indices,E=0;Ea&&(a=s),r.push(s)}for(var u=0;ua&&(a=c)}return{y0:i,max:a}}function eEt(n){n.registerChartView(qbt),n.registerSeriesModel(Kbt),n.registerLayout(Jbt),n.registerProcessor(I3("themeRiver"))}var tEt=2,rEt=4,nEt=function(n){$e(e,n);function e(t,r,i,a){var o=n.call(this)||this;o.z2=tEt,o.textConfig={inside:!0},Bn(o).seriesIndex=r.seriesIndex;var s=new la({z2:rEt,silent:t.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,t,r,i,a),o}return e.prototype.updateData=function(t,r,i,a,o){this.node=r,r.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;Bn(s).dataIndex=r.dataIndex;var l=r.getModel(),u=l.getModel("emphasis"),h=r.getLayout(),c=Mt({},h);c.label=null;var f=r.getVisual("style");f.lineJoin="bevel";var d=r.getVisual("decal");d&&(f.decal=vM(d,o));var v=lE(l.getModel("itemStyle"),c,!0);Mt(c,v),te(Gf,function(y){var _=s.ensureState(y),x=l.getModel([y,"itemStyle"]);_.style=x.getItemStyle();var S=lE(x,c);S&&(_.shape=S)}),t?(s.setShape(c),s.shape.r=h.r0,Is(s,{shape:{r:h.r}},i,r.dataIndex)):(ma(s,{shape:c},i),x0(s)),s.useStyle(f),this._updateLabel(i);var p=l.getShallow("cursor");p&&s.attr("cursor",p),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var g=u.get("focus"),m=g==="ancestor"?r.getAncestorsIndices():g==="descendant"?r.getDescendantIndices():g;vl(this,m,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t){var r=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),h=Math.sin(l),c=this,f=c.getTextContent(),d=this.node.dataIndex,v=a.get("minAngle")/180*Math.PI,p=a.get("show")&&!(v!=null&&Math.abs(s)Math.PI/2?"right":"left"):!M||M==="center"?(s===2*Math.PI&&o.r0===0?C=0:C=(o.r+o.r0)/2,M="center"):M==="left"?(C=o.r0+A,l>Math.PI/2&&(M="right")):M==="right"&&(C=o.r-A,l>Math.PI/2&&(M="left")),x.style.align=M,x.style.verticalAlign=g(y,"verticalAlign")||"middle",x.x=C*u+o.cx,x.y=C*h+o.cy;var I=g(y,"rotate"),R=0;I==="radial"?(R=e0(-l),R>Math.PI/2&&RMath.PI/2?R-=Math.PI:R<-Math.PI/2&&(R+=Math.PI)):ha(I)&&(R=I*Math.PI/180),x.rotation=e0(R)});function g(m,y){var _=m.get(y);return _==null?a.get(y):_}f.dirtyStyle()},e}(wd);const tme=nEt;var JJ="sunburstRootToNode",rme="sunburstHighlight",iEt="sunburstUnhighlight";function aEt(n){n.registerAction({type:JJ,update:"updateView"},function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},r);function r(i,a){var o=xD(e,[JJ],i);if(o){var s=i.getViewRoot();s&&(e.direction=xae(s,o.node)?"rollUp":"drillDown"),i.resetViewRoot(o.node)}}}),n.registerAction({type:rme,update:"none"},function(e,t,r){e=Mt({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},i);function i(a){var o=xD(e,[rme],a);o&&(e.dataIndex=o.node.dataIndex)}r.dispatchAction(Mt(e,{type:"highlight"}))}),n.registerAction({type:iEt,update:"updateView"},function(e,t,r){e=Mt({},e),r.dispatchAction(Mt(e,{type:"downplay"}))})}var oEt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i,a){var o=this;this.seriesModel=t,this.api=i,this.ecModel=r;var s=t.getData(),l=s.tree.root,u=t.getViewRoot(),h=this.group,c=t.get("renderLabelForZeroData"),f=[];u.eachNode(function(y){f.push(y)});var d=this._oldChildren||[];v(f,d),m(l,u),this._initEvents(),this._oldChildren=f;function v(y,_){if(y.length===0&&_.length===0)return;new f_(_,y,x,x).add(S).update(S).remove(Un(S,null)).execute();function x(w){return w.getId()}function S(w,b){var E=w==null?null:y[w],T=b==null?null:_[b];p(E,T)}}function p(y,_){if(!c&&y&&!y.getValue()&&(y=null),y!==l&&_!==l){if(_&&_.piece)y?(_.piece.updateData(!1,y,t,r,i),s.setItemGraphicEl(y.dataIndex,_.piece)):g(_);else if(y){var x=new tme(y,t,r,i);h.add(x),s.setItemGraphicEl(y.dataIndex,x)}}}function g(y){!y||y.piece&&(h.remove(y.piece),y.piece=null)}function m(y,_){_.depth>0?(o.virtualPiece?o.virtualPiece.updateData(!1,y,t,r,i):(o.virtualPiece=new tme(y,t,r,i),h.add(o.virtualPiece)),_.piece.off("click"),o.virtualPiece.on("click",function(x){o._rootToNode(_.parentNode)})):o.virtualPiece&&(h.remove(o.virtualPiece),o.virtualPiece=null)}},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(r){var i=!1,a=t.seriesModel.getViewRoot();a.eachNode(function(o){if(!i&&o.piece&&o.piece===r.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")t._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var h=l.get("target",!0)||"_blank";dG(u,h)}}i=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:JJ,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,r){var i=r.getData(),a=i.getItemLayout(0);if(a){var o=t[0]-a.cx,s=t[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type="sunburst",e}(os);const sEt=oEt;var lEt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t,r){var i={name:t.name,children:t.data};H6e(i);var a=this._levelModels=Vt(t.levels||[],function(l){return new as(l,this,r)},this),o=_ae.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,h){var c=o.getNodeByDataIndex(h),f=a[c.depth];return f&&(u.parentModel=f),u})}return o.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treePathInfo=xU(i,this),r},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var r=this.getRawData().tree.root;(!t||t!==r&&!r.contains(t))&&(this._viewRoot=r)},e.prototype.enableAriaDecal=function(){q5e(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(Ws);function H6e(n){var e=0;te(n.children,function(r){H6e(r);var i=r.value;Gt(i)&&(i=i[0]),e+=i});var t=n.value;Gt(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),Gt(n.value)?n.value[0]=t:n.value=t}const uEt=lEt;var nme=Math.PI/180;function hEt(n,e,t){e.eachSeriesByType(n,function(r){var i=r.get("center"),a=r.get("radius");Gt(a)||(a=[0,a]),Gt(i)||(i=[i,i]);var o=t.getWidth(),s=t.getHeight(),l=Math.min(o,s),u=xr(i[0],o),h=xr(i[1],s),c=xr(a[0],l/2),f=xr(a[1],l/2),d=-r.get("startAngle")*nme,v=r.get("minAngle")*nme,p=r.getData().tree.root,g=r.getViewRoot(),m=g.depth,y=r.get("sort");y!=null&&j6e(g,y);var _=0;te(g.children,function(D){!isNaN(D.getValue())&&_++});var x=g.getValue(),S=Math.PI/(x||_)*2,w=g.depth>0,b=g.height-(w?-1:1),E=(f-c)/(b||1),T=r.get("clockwise"),C=r.get("stillShowZeroSum"),A=T?1:-1,M=function(D,G){if(!!D){var W=G;if(D!==p){var z=D.getValue(),V=x===0&&C?S:z*S;V1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",e);return r.depth>1&&Or(s)&&(s=WK(s,(r.depth-1)/(a-1)*.5)),s}n.eachSeriesByType("sunburst",function(r){var i=r.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=t(o,r,a.root.height));var u=i.ensureUniqueItemVisual(o.dataIndex,"style");Mt(u,l)})})}function dEt(n){n.registerChartView(sEt),n.registerSeriesModel(uEt),n.registerLayout(Un(hEt,"sunburst")),n.registerProcessor(Un(I3,"sunburst")),n.registerVisual(fEt),aEt(n)}var ime={color:"fill",borderColor:"stroke"},vEt={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},H1=na(),pEt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,r){return k_(null,this)},e.prototype.getDataParams=function(t,r,i){var a=n.prototype.getDataParams.call(this,t,r);return i&&(a.info=H1(i).info),a},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(Ws);const gEt=pEt;function yEt(n,e){return e=e||[0,0],Vt(["x","y"],function(t,r){var i=this.getAxis(t),a=e[r],o=n[r]/2;return i.type==="category"?i.getBandWidth():Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function mEt(n){var e=n.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return n.dataToPoint(t)},size:kr(yEt,n)}}}function _Et(n,e){return e=e||[0,0],Vt([0,1],function(t){var r=e[t],i=n[t]/2,a=[],o=[];return a[t]=r-i,o[t]=r+i,a[1-t]=o[1-t]=e[1-t],Math.abs(this.dataToPoint(a)[t]-this.dataToPoint(o)[t])},this)}function xEt(n){var e=n.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:n.getZoom()},api:{coord:function(t){return n.dataToPoint(t)},size:kr(_Et,n)}}}function SEt(n,e){var t=this.getAxis(),r=e instanceof Array?e[0]:e,i=(n instanceof Array?n[0]:n)/2;return t.type==="category"?t.getBandWidth():Math.abs(t.dataToCoord(r-i)-t.dataToCoord(r+i))}function wEt(n){var e=n.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return n.dataToPoint(t)},size:kr(SEt,n)}}}function bEt(n,e){return e=e||[0,0],Vt(["Radius","Angle"],function(t,r){var i="get"+t+"Axis",a=this[i](),o=e[r],s=n[r]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return t==="Angle"&&(l=l*Math.PI/180),l},this)}function EEt(n){var e=n.getRadiusAxis(),t=n.getAngleAxis(),r=e.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:n.cx,cy:n.cy,r:r[1],r0:r[0]},api:{coord:function(i){var a=e.dataToRadius(i[0]),o=t.dataToAngle(i[1]),s=n.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:kr(bEt,n)}}}function TEt(n){var e=n.getRect(),t=n.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:n.getCellWidth(),cellHeight:n.getCellHeight(),rangeInfo:{start:t.start,end:t.end,weeks:t.weeks,dayCount:t.allDay}},api:{coord:function(r,i){return n.dataToPoint(r,i)}}}}function X6e(n,e,t,r){return n&&(n.legacy||n.legacy!==!1&&!t&&!r&&e!=="tspan"&&(e==="text"||Fr(n,"text")))}function Y6e(n,e,t){var r=n,i,a,o;if(e==="text")o=r;else{o={},Fr(r,"text")&&(o.text=r.text),Fr(r,"rich")&&(o.rich=r.rich),Fr(r,"textFill")&&(o.fill=r.textFill),Fr(r,"textStroke")&&(o.stroke=r.textStroke),Fr(r,"fontFamily")&&(o.fontFamily=r.fontFamily),Fr(r,"fontSize")&&(o.fontSize=r.fontSize),Fr(r,"fontStyle")&&(o.fontStyle=r.fontStyle),Fr(r,"fontWeight")&&(o.fontWeight=r.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=Fr(r,"textPosition");t?i.position=s?r.textPosition:"inside":s&&(i.position=r.textPosition),Fr(r,"textPosition")&&(i.position=r.textPosition),Fr(r,"textOffset")&&(i.offset=r.textOffset),Fr(r,"textRotation")&&(i.rotation=r.textRotation),Fr(r,"textDistance")&&(i.distance=r.textDistance)}return ame(o,n),te(o.rich,function(l){ame(l,l)}),{textConfig:i,textContent:a}}function ame(n,e){!e||(e.font=e.textFont||e.font,Fr(e,"textStrokeWidth")&&(n.lineWidth=e.textStrokeWidth),Fr(e,"textAlign")&&(n.align=e.textAlign),Fr(e,"textVerticalAlign")&&(n.verticalAlign=e.textVerticalAlign),Fr(e,"textLineHeight")&&(n.lineHeight=e.textLineHeight),Fr(e,"textWidth")&&(n.width=e.textWidth),Fr(e,"textHeight")&&(n.height=e.textHeight),Fr(e,"textBackgroundColor")&&(n.backgroundColor=e.textBackgroundColor),Fr(e,"textPadding")&&(n.padding=e.textPadding),Fr(e,"textBorderColor")&&(n.borderColor=e.textBorderColor),Fr(e,"textBorderWidth")&&(n.borderWidth=e.textBorderWidth),Fr(e,"textBorderRadius")&&(n.borderRadius=e.textBorderRadius),Fr(e,"textBoxShadowColor")&&(n.shadowColor=e.textBoxShadowColor),Fr(e,"textBoxShadowBlur")&&(n.shadowBlur=e.textBoxShadowBlur),Fr(e,"textBoxShadowOffsetX")&&(n.shadowOffsetX=e.textBoxShadowOffsetX),Fr(e,"textBoxShadowOffsetY")&&(n.shadowOffsetY=e.textBoxShadowOffsetY))}function ome(n,e,t){var r=n;r.textPosition=r.textPosition||t.position||"inside",t.offset!=null&&(r.textOffset=t.offset),t.rotation!=null&&(r.textRotation=t.rotation),t.distance!=null&&(r.textDistance=t.distance);var i=r.textPosition.indexOf("inside")>=0,a=n.fill||"#000";sme(r,e);var o=r.textFill==null;return i?o&&(r.textFill=t.insideFill||"#fff",!r.textStroke&&t.insideStroke&&(r.textStroke=t.insideStroke),!r.textStroke&&(r.textStroke=a),r.textStrokeWidth==null&&(r.textStrokeWidth=2)):(o&&(r.textFill=n.fill||t.outsideFill||"#000"),!r.textStroke&&t.outsideStroke&&(r.textStroke=t.outsideStroke)),r.text=e.text,r.rich=e.rich,te(e.rich,function(s){sme(s,s)}),r}function sme(n,e){!e||(Fr(e,"fill")&&(n.textFill=e.fill),Fr(e,"stroke")&&(n.textStroke=e.fill),Fr(e,"lineWidth")&&(n.textStrokeWidth=e.lineWidth),Fr(e,"font")&&(n.font=e.font),Fr(e,"fontStyle")&&(n.fontStyle=e.fontStyle),Fr(e,"fontWeight")&&(n.fontWeight=e.fontWeight),Fr(e,"fontSize")&&(n.fontSize=e.fontSize),Fr(e,"fontFamily")&&(n.fontFamily=e.fontFamily),Fr(e,"align")&&(n.textAlign=e.align),Fr(e,"verticalAlign")&&(n.textVerticalAlign=e.verticalAlign),Fr(e,"lineHeight")&&(n.textLineHeight=e.lineHeight),Fr(e,"width")&&(n.textWidth=e.width),Fr(e,"height")&&(n.textHeight=e.height),Fr(e,"backgroundColor")&&(n.textBackgroundColor=e.backgroundColor),Fr(e,"padding")&&(n.textPadding=e.padding),Fr(e,"borderColor")&&(n.textBorderColor=e.borderColor),Fr(e,"borderWidth")&&(n.textBorderWidth=e.borderWidth),Fr(e,"borderRadius")&&(n.textBorderRadius=e.borderRadius),Fr(e,"shadowColor")&&(n.textBoxShadowColor=e.shadowColor),Fr(e,"shadowBlur")&&(n.textBoxShadowBlur=e.shadowBlur),Fr(e,"shadowOffsetX")&&(n.textBoxShadowOffsetX=e.shadowOffsetX),Fr(e,"shadowOffsetY")&&(n.textBoxShadowOffsetY=e.shadowOffsetY),Fr(e,"textShadowColor")&&(n.textShadowColor=e.textShadowColor),Fr(e,"textShadowBlur")&&(n.textShadowBlur=e.textShadowBlur),Fr(e,"textShadowOffsetX")&&(n.textShadowOffsetX=e.textShadowOffsetX),Fr(e,"textShadowOffsetY")&&(n.textShadowOffsetY=e.textShadowOffsetY))}var q6e={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},lme=Li(q6e);om(lm,function(n,e){return n[e]=1,n},{});lm.join(", ");var DG=["","style","shape","extra"],_M=na();function kae(n,e,t,r,i){var a=n+"Animation",o=RI(n,r,i)||{},s=_M(e).userDuring;return o.duration>0&&(o.during=s?kr(LEt,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=n),Mt(o,t[a]),o}function DB(n,e,t,r){r=r||{};var i=r.dataIndex,a=r.isInit,o=r.clearStyle,s=t.isAnimationEnabled(),l=_M(n),u=e.style;l.userDuring=e.during;var h={},c={};if(OEt(n,e,c),hme("shape",e,c),hme("extra",e,c),!a&&s&&(PEt(n,e,h),ume("shape",n,e,h),ume("extra",n,e,h),REt(n,e,u,h)),c.style=u,CEt(n,c,o),MEt(n,e),s)if(a){var f={};te(DG,function(v){var p=v?e[v]:e;p&&p.enterFrom&&(v&&(f[v]=f[v]||{}),Mt(v?f[v]:f,p.enterFrom))});var d=kae("enter",n,e,t,i);d.duration>0&&n.animateFrom(f,d)}else AEt(n,e,i||0,t,h);Z6e(n,e),u?n.dirty():n.markRedraw()}function Z6e(n,e){for(var t=_M(n).leaveToProps,r=0;r0&&n.animateFrom(i,a)}}function MEt(n,e){Fr(e,"silent")&&(n.silent=e.silent),Fr(e,"ignore")&&(n.ignore=e.ignore),n instanceof Vp&&Fr(e,"invisible")&&(n.invisible=e.invisible),n instanceof Si&&Fr(e,"autoBatch")&&(n.autoBatch=e.autoBatch)}var vy={},IEt={setTransform:function(n,e){return vy.el[n]=e,this},getTransform:function(n){return vy.el[n]},setShape:function(n,e){var t=vy.el,r=t.shape||(t.shape={});return r[n]=e,t.dirtyShape&&t.dirtyShape(),this},getShape:function(n){var e=vy.el.shape;if(e)return e[n]},setStyle:function(n,e){var t=vy.el,r=t.style;return r&&(r[n]=e,t.dirtyStyle&&t.dirtyStyle()),this},getStyle:function(n){var e=vy.el.style;if(e)return e[n]},setExtra:function(n,e){var t=vy.el.extra||(vy.el.extra={});return t[n]=e,this},getExtra:function(n){var e=vy.el.extra;if(e)return e[n]}};function LEt(){var n=this,e=n.el;if(!!e){var t=_M(e).userDuring,r=n.userDuring;if(t!==r){n.el=n.userDuring=null;return}vy.el=e,r(IEt)}}function ume(n,e,t,r){var i=t[n];if(!!i){var a=e[n],o;if(a){var s=t.transition,l=i.transition;if(l)if(!o&&(o=r[n]={}),PE(l))Mt(o,a);else for(var u=Do(l),h=0;h=0){!o&&(o=r[n]={});for(var d=Li(a),h=0;h=0)){var f=n.getAnimationStyleProps(),d=f?f.style:null;if(d){!a&&(a=r.style={});for(var v=Li(t),u=0;u=0?e.getStore().get(G,k):void 0}var W=e.get(D.name,k),z=D&&D.ordinalMeta;return z?z.categories[W]:W}function w(R,k){k==null&&(k=u);var D=e.getItemVisual(k,"style"),G=D&&D.fill,W=D&&D.opacity,z=y(k,nS).getItemStyle();G!=null&&(z.fill=G),W!=null&&(z.opacity=W);var V={inheritColor:Or(G)?G:"#000"},q=_(k,nS),Y=is(q,null,V,!1,!0);Y.text=q.getShallow("show")?ni(n.getFormattedLabel(k,nS),gM(e,k)):null;var le=cG(q,V,!1);return T(R,z),z=ome(z,Y,le),R&&E(z,R),z.legacy=!0,z}function b(R,k){k==null&&(k=u);var D=y(k,j1).getItemStyle(),G=_(k,j1),W=is(G,null,null,!0,!0);W.text=G.getShallow("show")?qy(n.getFormattedLabel(k,j1),n.getFormattedLabel(k,nS),gM(e,k)):null;var z=cG(G,null,!0);return T(R,D),D=ome(D,W,z),R&&E(D,R),D.legacy=!0,D}function E(R,k){for(var D in k)Fr(k,D)&&(R[D]=k[D])}function T(R,k){R&&(R.textFill&&(k.textFill=R.textFill),R.textPosition&&(k.textPosition=R.textPosition))}function C(R,k){if(k==null&&(k=u),Fr(ime,R)){var D=e.getItemVisual(k,"style");return D?D[ime[R]]:null}if(Fr(vEt,R))return e.getItemVisual(k,R)}function A(R){if(a.type==="cartesian2d"){var k=a.getBaseAxis();return jpt(sn({axis:k},R))}}function M(){return t.getCurrentSeriesIndices()}function I(R){return Rke(R,t)}}function WEt(n){var e={};return te(n.dimensions,function(t){var r=n.getDimensionInfo(t);if(!r.isExtraCoord){var i=r.coordDim,a=e[i]=e[i]||[];a[r.coordDimIndex]=n.getDimensionIndex(t)}}),e}function jj(n,e,t,r,i,a,o){if(!r){a.remove(e);return}var s=Uae(n,e,t,r,i,a);return s&&o.setItemGraphicEl(t,s),s&&vl(s,r.focus,r.blurScope,r.emphasisDisabled),s}function Uae(n,e,t,r,i,a){var o=-1,s=e;e&&eBe(e,r,i)&&(o=gi(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=Gae(r),s&&GEt(s,u)),r.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),qv.normal.cfg=qv.normal.conOpt=qv.emphasis.cfg=qv.emphasis.conOpt=qv.blur.cfg=qv.blur.conOpt=qv.select.cfg=qv.select.conOpt=null,qv.isLegacy=!1,jEt(u,t,r,i,l,qv),HEt(u,t,r,i,l),zae(n,u,t,r,qv,i,l),Fr(r,"info")&&(H1(u).info=r.info);for(var h=0;h=0?a.replaceAt(u,o):a.add(u),u}function eBe(n,e,t){var r=H1(n),i=e.type,a=e.shape,o=e.style;return t.isUniversalTransitionEnabled()||i!=null&&i!==r.customGraphicType||i==="path"&&KEt(a)&&tBe(a)!==r.customPathData||i==="image"&&Fr(o,"image")&&o.image!==r.customImagePath}function HEt(n,e,t,r,i){var a=t.clipPath;if(a===!1)n&&n.getClipPath()&&n.removeClipPath();else if(a){var o=n.getClipPath();o&&eBe(o,a,r)&&(o=null),o||(o=Gae(a),n.setClipPath(o)),zae(null,o,e,a,null,r,i)}}function jEt(n,e,t,r,i,a){if(!n.isGroup){fme(t,null,a),fme(t,j1,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var h=n.getTextContent();if(o===!1)h&&n.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},h?h.clearStates():(h=Gae(o),n.setTextContent(h)),zae(null,h,e,o,null,r,i);for(var c=o&&o.style,f=0;f=h;d--){var v=e.childAt(d);YEt(e,v,i)}}}function YEt(n,e,t){e&&bU(e,H1(n).option,t)}function qEt(n){new f_(n.oldChildren,n.newChildren,dme,dme,n).add(vme).update(vme).remove(ZEt).execute()}function dme(n,e){var t=n&&n.name;return t!=null?t:FEt+e}function vme(n,e){var t=this.context,r=n!=null?t.newChildren[n]:null,i=e!=null?t.oldChildren[e]:null;Uae(t.api,i,t.dataIndex,r,t.seriesModel,t.group)}function ZEt(n){var e=this.context,t=e.oldChildren[n];t&&bU(t,H1(t).option,e.seriesModel)}function tBe(n){return n&&(n.pathData||n.d)}function KEt(n){return n&&(Fr(n,"pathData")||Fr(n,"d"))}function JEt(n){n.registerChartView(UEt),n.registerSeriesModel(gEt)}var jb=na(),pme=Sn,Xj=kr,QEt=function(){function n(){this._dragging=!1,this.animationThreshold=15}return n.prototype.render=function(e,t,r,i){var a=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=r,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,e,t,r);var h=u.graphicKey;h!==this._lastGraphicKey&&this.clear(r),this._lastGraphicKey=h;var c=this._moveAnimation=this.determineAnimation(e,t);if(!s)s=this._group=new Cn,this.createPointerEl(s,u,e,t),this.createLabelEl(s,u,e,t),r.getZr().add(s);else{var f=Un(gme,t,c);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,t)}mme(s,t,!0),this._renderHandle(a)}},n.prototype.remove=function(e){this.clear(e)},n.prototype.dispose=function(e){this.clear(e)},n.prototype.determineAnimation=function(e,t){var r=t.get("animation"),i=e.axis,a=i.type==="category",o=t.get("snap");if(!o&&!a)return!1;if(r==="auto"||r==null){var s=this.animationThreshold;if(a&&i.getBandWidth()>s)return!0;if(o){var l=fae(e).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return r===!0},n.prototype.makeElOption=function(e,t,r,i,a){},n.prototype.createPointerEl=function(e,t,r,i){var a=t.pointer;if(a){var o=jb(e).pointerEl=new x3[a.type](pme(t.pointer));e.add(o)}},n.prototype.createLabelEl=function(e,t,r,i){if(t.label){var a=jb(e).labelEl=new la(pme(t.label));e.add(a),yme(a,i)}},n.prototype.updatePointerEl=function(e,t,r){var i=jb(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),r(i,{shape:t.pointer.shape}))},n.prototype.updateLabelEl=function(e,t,r,i){var a=jb(e).labelEl;a&&(a.setStyle(t.label.style),r(a,{x:t.label.x,y:t.label.y}),yme(a,i))},n.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,r=this._api.getZr(),i=this._handle,a=t.getModel("handle"),o=t.get("status");if(!a.get("show")||!o||o==="hide"){i&&r.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=_3(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){l_(u.event)},onmousedown:Xj(this._onHandleDragMove,this,0,0),drift:Xj(this._onHandleDragMove,this),ondragend:Xj(this._onHandleDragEnd,this)}),r.add(i)),mme(i,t,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");Gt(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,VI(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},n.prototype._moveHandleToValue=function(e,t){gme(this._axisPointerModel,!t&&this._moveAnimation,this._handle,Yj(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},n.prototype._onHandleDragMove=function(e,t){var r=this._handle;if(!!r){this._dragging=!0;var i=this.updateHandleTransform(Yj(r),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,r.stopAnimation(),r.attr(Yj(i)),jb(r).lastProp=null,this._doDispatchAxisPointer()}},n.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(!!e){var t=this._payloadInfo,r=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:r.axis.dim,axisIndex:r.componentIndex}]})}},n.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(!!e){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},n.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),r=this._group,i=this._handle;t&&r&&(this._lastGraphicKey=null,r&&t.remove(r),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),dD(this,"_doDispatchAxisPointer")},n.prototype.doClear=function(){},n.prototype.buildLabel=function(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}},n}();function gme(n,e,t,r){rBe(jb(t).lastProp,r)||(jb(t).lastProp=r,e?ma(t,r,n):(t.stopAnimation(),t.attr(r)))}function rBe(n,e){if(dn(n)&&dn(e)){var t=!0;return te(e,function(r,i){t=t&&rBe(n[i],r)}),!!t}else return n===e}function yme(n,e){n[e.get(["label","show"])?"show":"hide"]()}function Yj(n){return{x:n.x||0,y:n.y||0,rotation:n.rotation||0}}function mme(n,e,t){var r=e.get("z"),i=e.get("zlevel");n&&n.traverse(function(a){a.type!=="group"&&(r!=null&&(a.z=r),i!=null&&(a.zlevel=i),a.silent=t)})}const $ae=QEt;function Wae(n){var e=n.get("type"),t=n.getModel(e+"Style"),r;return e==="line"?(r=t.getLineStyle(),r.fill=null):e==="shadow"&&(r=t.getAreaStyle(),r.stroke=null),r}function nBe(n,e,t,r,i){var a=t.get("value"),o=iBe(a,e.axis,e.ecModel,t.get("seriesDataIndices"),{precision:t.get(["label","precision"]),formatter:t.get(["label","formatter"])}),s=t.getModel("label"),l=FI(s.get("padding")||0),u=s.getFont(),h=v3(o,u),c=i.position,f=h.width+l[1]+l[3],d=h.height+l[0]+l[2],v=i.align;v==="right"&&(c[0]-=f),v==="center"&&(c[0]-=f/2);var p=i.verticalAlign;p==="bottom"&&(c[1]-=d),p==="middle"&&(c[1]-=d/2),e2t(c,f,d,r);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=e.get(["axisLine","lineStyle","color"])),n.label={x:c[0],y:c[1],style:is(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function e2t(n,e,t,r){var i=r.getWidth(),a=r.getHeight();n[0]=Math.min(n[0]+e,i)-e,n[1]=Math.min(n[1]+t,a)-t,n[0]=Math.max(n[0],0),n[1]=Math.max(n[1],0)}function iBe(n,e,t,r,i){n=e.scale.parse(n);var a=e.scale.getLabel({value:n},{precision:i.precision}),o=i.formatter;if(o){var s={value:nae(e,{value:n}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};te(r,function(l){var u=t.getSeriesByIndex(l.seriesIndex),h=l.dataIndexInside,c=u&&u.getDataParams(h);c&&s.seriesData.push(c)}),Or(o)?a=o.replace("{value}",a):rn(o)&&(a=o(s))}return a}function Hae(n,e,t){var r=Up();return j2(r,r,t.rotation),sm(r,r,t.position),u0([n.dataToCoord(e),(t.labelOffset||0)+(t.labelDirection||1)*(t.labelMargin||0)],r)}function aBe(n,e,t,r,i,a){var o=d_.innerTextLayout(t.rotation,0,t.labelDirection);t.labelMargin=i.get(["label","margin"]),nBe(e,r,i,a,{position:Hae(r.axis,n,t),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function jae(n,e,t){return t=t||0,{x1:n[t],y1:n[1-t],x2:e[t],y2:e[1-t]}}function oBe(n,e,t){return t=t||0,{x:n[t],y:n[1-t],width:e[t],height:e[1-t]}}function _me(n,e,t,r,i,a){return{cx:n,cy:e,r0:t,r,startAngle:i,endAngle:a,clockwise:!0}}var t2t=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),h=xme(l,s).getOtherAxis(s).getGlobalExtent(),c=s.toGlobalCoord(s.dataToCoord(r,!0));if(u&&u!=="none"){var f=Wae(a),d=r2t[u](s,c,h);d.style=f,t.graphicKey=d.type,t.pointer=d}var v=kJ(l.model,i);aBe(r,t,v,i,a,o)},e.prototype.getHandleTransform=function(t,r,i){var a=kJ(r.axis.grid.model,r,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=Hae(r.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,r,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=xme(s,o).getOtherAxis(o).getGlobalExtent(),h=o.dim==="x"?0:1,c=[t.x,t.y];c[h]+=r[h],c[h]=Math.min(l[1],c[h]),c[h]=Math.max(l[0],c[h]);var f=(u[1]+u[0])/2,d=[f,f];d[h]=c[h];var v=[{verticalAlign:"middle"},{align:"center"}];return{x:c[0],y:c[1],rotation:t.rotation,cursorPoint:d,tooltipOption:v[h]}},e}($ae);function xme(n,e){var t={};return t[e.dim+"AxisIndex"]=e.index,n.getCartesian(t)}var r2t={line:function(n,e,t){var r=jae([e,t[0]],[e,t[1]],Sme(n));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(n,e,t){var r=Math.max(1,n.getBandWidth()),i=t[1]-t[0];return{type:"Rect",shape:oBe([e-r/2,t[0]],[r,i],Sme(n))}}};function Sme(n){return n.dim==="x"?0:1}const n2t=t2t;var i2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(oa);const a2t=i2t;var P1=na(),o2t=te;function sBe(n,e,t){if(!sa.node){var r=e.getZr();P1(r).records||(P1(r).records={}),s2t(r,e);var i=P1(r).records[n]||(P1(r).records[n]={});i.handler=t}}function s2t(n,e){if(P1(n).initialized)return;P1(n).initialized=!0,t("click",Un(wme,"click")),t("mousemove",Un(wme,"mousemove")),t("globalout",u2t);function t(r,i){n.on(r,function(a){var o=h2t(e);o2t(P1(n).records,function(s){s&&i(s,a,o.dispatchAction)}),l2t(o.pendings,e)})}}function l2t(n,e){var t=n.showTip.length,r=n.hideTip.length,i;t?i=n.showTip[t-1]:r&&(i=n.hideTip[r-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function u2t(n,e,t){n.handler("leave",null,t)}function wme(n,e,t,r){e.handler(n,t,r)}function h2t(n){var e={showTip:[],hideTip:[]},t=function(r){var i=e[r.type];i?i.push(r):(r.dispatchAction=t,n.dispatchAction(r))};return{dispatchAction:t,pendings:e}}function tQ(n,e){if(!sa.node){var t=e.getZr(),r=(P1(t).records||{})[n];r&&(P1(t).records[n]=null)}}var c2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=r.getComponent("tooltip"),o=t.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";sBe("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(t,r){tQ("axisPointer",r)},e.prototype.dispose=function(t,r){tQ("axisPointer",r)},e.type="axisPointer",e}(pl);const f2t=c2t;function lBe(n,e){var t=[],r=n.seriesIndex,i;if(r==null||!(i=e.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=YE(a,n);if(o==null||o<0||Gt(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)t=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(n.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u),c=h.dim,f=u.dim,d=c==="x"||c==="radius"?1:0,v=a.mapDimension(f),p=[];p[d]=a.get(v,o),p[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),t=l.dataToPoint(p)||[]}else t=l.dataToPoint(a.getValues(Vt(l.dimensions,function(m){return a.mapDimension(m)}),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),t=[g.x+g.width/2,g.y+g.height/2]}return{point:t,el:s}}var bme=na();function d2t(n,e,t){var r=n.currTrigger,i=[n.x,n.y],a=n,o=n.dispatchAction||kr(t.dispatchAction,t),s=e.getComponent("axisPointer").coordSysAxesInfo;if(!!s){NB(i)&&(i=lBe({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=NB(i),u=a.axesInfo,h=s.axesInfo,c=r==="leave"||NB(i),f={},d={},v={list:[],map:{}},p={showPointer:Un(p2t,d),showTooltip:Un(g2t,v)};te(s.coordSysMap,function(m,y){var _=l||m.containPoint(i);te(s.coordSysAxesInfo[y],function(x,S){var w=x.axis,b=x2t(u,x);if(!c&&_&&(!u||b)){var E=b&&b.value;E==null&&!l&&(E=w.pointToData(i)),E!=null&&Eme(x,E,p,!1,f)}})});var g={};return te(h,function(m,y){var _=m.linkGroup;_&&!d[y]&&te(_.axesInfo,function(x,S){var w=d[S];if(x!==m&&w){var b=w.value;_.mapper&&(b=m.axis.scale.parse(_.mapper(b,Tme(x),Tme(m)))),g[m.key]=b}})}),te(g,function(m,y){Eme(h[y],m,p,!0,f)}),y2t(d,h,f),m2t(v,i,n,o),_2t(h,o,t),f}}function Eme(n,e,t,r,i){var a=n.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!n.involveSeries){t.showPointer(n,e);return}var o=v2t(e,n),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&Mt(i,s[0]),!r&&n.snap&&a.containData(l)&&l!=null&&(e=l),t.showPointer(n,e,s),t.showTooltip(n,o,l)}}function v2t(n,e){var t=e.axis,r=t.dim,i=n,a=[],o=Number.MAX_VALUE,s=-1;return te(e.seriesModels,function(l,u){var h=l.getData().mapDimensionsAll(r),c,f;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(h,n,t);f=d.dataIndices,c=d.nestestValue}else{if(f=l.getData().indicesOfNearest(h[0],n,t.type==="category"?.5:null),!f.length)return;c=l.getData().get(h[0],f[0])}if(!(c==null||!isFinite(c))){var v=n-c,p=Math.abs(v);p<=o&&((p=0&&s<0)&&(o=p,s=v,i=c,a.length=0),te(f,function(g){a.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:a,snapToValue:i}}function p2t(n,e,t,r){n[e.key]={value:t,payloadBatch:r}}function g2t(n,e,t,r){var i=t.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,u=_D(l),h=n.map[u];h||(h=n.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},n.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:r,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function y2t(n,e,t){var r=t.axesInfo=[];te(e,function(i,a){var o=i.axisPointerModel.option,s=n[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&r.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function m2t(n,e,t,r){if(NB(e)||!n.list.length){r({type:"hideTip"});return}var i=((n.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:t.tooltipOption,position:t.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:n.list})}function _2t(n,e,t){var r=t.getZr(),i="axisPointerLastHighlights",a=bme(r)[i]||{},o=bme(r)[i]={};te(n,function(u,h){var c=u.axisPointerModel.option;c.status==="show"&&u.triggerEmphasis&&te(c.seriesDataIndices,function(f){var d=f.seriesIndex+" | "+f.dataIndex;o[d]=f})});var s=[],l=[];te(a,function(u,h){!o[h]&&l.push(u)}),te(o,function(u,h){!a[h]&&s.push(u)}),l.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function x2t(n,e){for(var t=0;t<(n||[]).length;t++){var r=n[t];if(e.axis.dim===r.axisDim&&e.axis.model.componentIndex===r.axisIndex)return r}}function Tme(n){var e=n.axis.model,t={},r=t.axisDim=n.axis.dim;return t.axisIndex=t[r+"AxisIndex"]=e.componentIndex,t.axisName=t[r+"AxisName"]=e.name,t.axisId=t[r+"AxisId"]=e.id,t}function NB(n){return!n||n[0]==null||isNaN(n[0])||n[1]==null||isNaN(n[1])}function R3(n){K2.registerAxisPointerClass("CartesianAxisPointer",n2t),n.registerComponentModel(a2t),n.registerComponentView(f2t),n.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!Gt(t)&&(e.axisPointer.link=[t])}}),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=smt(e,t)}),n.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},d2t)}function S2t(n){_i(D5e),_i(R3)}var w2t=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),h=u.getExtent(),c=s.dataToCoord(r),f=a.get("type");if(f&&f!=="none"){var d=Wae(a),v=E2t[f](s,l,c,h);v.style=d,t.graphicKey=v.type,t.pointer=v}var p=a.get(["label","margin"]),g=b2t(r,i,a,l,p);nBe(t,i,a,o,g)},e}($ae);function b2t(n,e,t,r,i){var a=e.axis,o=a.dataToCoord(n),s=r.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=r.getRadiusAxis().getExtent(),u,h,c;if(a.dim==="radius"){var f=Up();j2(f,f,s),sm(f,f,[r.cx,r.cy]),u=u0([o,-i],f);var d=e.getModel("axisLabel").get("rotate")||0,v=d_.innerTextLayout(s,d*Math.PI/180,-1);h=v.textAlign,c=v.textVerticalAlign}else{var p=l[1];u=r.coordToPoint([p+i,o]);var g=r.cx,m=r.cy;h=Math.abs(u[0]-g)/p<.3?"center":u[0]>g?"left":"right",c=Math.abs(u[1]-m)/p<.3?"middle":u[1]>m?"top":"bottom"}return{position:u,align:h,verticalAlign:c}}var E2t={line:function(n,e,t,r){return n.dim==="angle"?{type:"Line",shape:jae(e.coordToPoint([r[0],t]),e.coordToPoint([r[1],t]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:t}}},shadow:function(n,e,t,r){var i=Math.max(1,n.getBandWidth()),a=Math.PI/180;return n.dim==="angle"?{type:"Sector",shape:_me(e.cx,e.cy,r[0],r[1],(-t-i/2)*a,(-t+i/2)*a)}:{type:"Sector",shape:_me(e.cx,e.cy,t-i/2,t+i/2,0,Math.PI*2)}}};const T2t=w2t;var C2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.findAxisModel=function(t){var r,i=this.ecModel;return i.eachComponent(t,function(a){a.getCoordSysModel()===this&&(r=a)},this),r},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(oa);const A2t=C2t;var Xae=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",uu).models[0]},e.type="polarAxis",e}(oa);gu(Xae,T3);var M2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="angleAxis",e}(Xae),I2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="radiusAxis",e}(Xae),Yae=function(n){$e(e,n);function e(t,r){return n.call(this,"radius",t,r)||this}return e.prototype.pointToData=function(t,r){return this.polar.pointToData(t,r)[this.dim==="radius"?0:1]},e}(D0);Yae.prototype.dataToRadius=D0.prototype.dataToCoord;Yae.prototype.radiusToData=D0.prototype.coordToData;const L2t=Yae;var P2t=na(),qae=function(n){$e(e,n);function e(t,r){return n.call(this,"angle",t,r||[0,360])||this}return e.prototype.pointToData=function(t,r){return this.polar.pointToData(t,r)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,r=t.getLabelModel(),i=t.scale,a=i.getExtent(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=t.dataToCoord(s+1)-t.dataToCoord(s),u=Math.abs(l),h=v3(s==null?"":s+"",r.getFont(),"center","top"),c=Math.max(h.height,7),f=c/u;isNaN(f)&&(f=1/0);var d=Math.max(0,Math.floor(f)),v=P2t(t.model),p=v.lastAutoInterval,g=v.lastTickCount;return p!=null&&g!=null&&Math.abs(p-d)<=1&&Math.abs(g-o)<=1&&p>d?d=p:(v.lastTickCount=o,v.lastAutoInterval=d),d},e}(D0);qae.prototype.dataToAngle=D0.prototype.dataToCoord;qae.prototype.angleToData=D0.prototype.coordToData;const O2t=qae;var uBe=["radius","angle"],R2t=function(){function n(e){this.dimensions=uBe,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new L2t,this._angleAxis=new O2t,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return n.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},n.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},n.prototype.getAxis=function(e){var t="_"+e+"Axis";return this[t]},n.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},n.prototype.getAxesByScale=function(e){var t=[],r=this._angleAxis,i=this._radiusAxis;return r.scale.type===e&&t.push(r),i.scale.type===e&&t.push(i),t},n.prototype.getAngleAxis=function(){return this._angleAxis},n.prototype.getRadiusAxis=function(){return this._radiusAxis},n.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},n.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},n.prototype.getTooltipAxes=function(e){var t=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},n.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},n.prototype.pointToData=function(e,t){var r=this.pointToCoord(e);return[this._radiusAxis.radiusToData(r[0],t),this._angleAxis.angleToData(r[1],t)]},n.prototype.pointToCoord=function(e){var t=e[0]-this.cx,r=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(t*t+r*r);t/=l,r/=l;for(var u=Math.atan2(-r,t)/Math.PI*180,h=us;)u+=h*360;return[l,u]},n.prototype.coordToPoint=function(e){var t=e[0],r=e[1]/180*Math.PI,i=Math.cos(r)*t+this.cx,a=-Math.sin(r)*t+this.cy;return[i,a]},n.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis(),r=t.getExtent().slice();r[0]>r[1]&&r.reverse();var i=e.getExtent(),a=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:r[0],r:r[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:e.inverse,contain:function(o,s){var l=o-this.cx,u=s-this.cy,h=l*l+u*u-1e-4,c=this.r,f=this.r0;return h<=c*c&&h>=f*f}}},n.prototype.convertToPixel=function(e,t,r){var i=Cme(t);return i===this?this.dataToPoint(r):null},n.prototype.convertFromPixel=function(e,t,r){var i=Cme(t);return i===this?this.pointToData(r):null},n}();function Cme(n){var e=n.seriesModel,t=n.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}const D2t=R2t;function N2t(n,e,t){var r=e.get("center"),i=t.getWidth(),a=t.getHeight();n.cx=xr(r[0],i),n.cy=xr(r[1],a);var o=n.getRadiusAxis(),s=Math.min(i,a)/2,l=e.get("radius");l==null?l=[0,"100%"]:Gt(l)||(l=[0,l]);var u=[xr(l[0],s),xr(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function k2t(n,e){var t=this,r=t.getAngleAxis(),i=t.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),n.eachSeries(function(s){if(s.coordinateSystem===t){var l=s.getData();te(wG(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),te(wG(l,"angle"),function(u){r.scale.unionExtentFromData(l,u)})}}),pM(r.scale,r.model),pM(i.scale,i.model),r.type==="category"&&!r.onBand){var a=r.getExtent(),o=360/r.scale.count();r.inverse?a[1]+=o:a[1]-=o,r.setExtent(a[0],a[1])}}function F2t(n){return n.mainType==="angleAxis"}function Ame(n,e){if(n.type=e.get("type"),n.scale=pU(e),n.onBand=e.get("boundaryGap")&&n.type==="category",n.inverse=e.get("inverse"),F2t(e)){n.inverse=n.inverse!==e.get("clockwise");var t=e.get("startAngle");n.setExtent(t,t+(n.inverse?-360:360))}e.axis=n,n.model=e}var B2t={dimensions:uBe,create:function(n,e){var t=[];return n.eachComponent("polar",function(r,i){var a=new D2t(i+"");a.update=k2t;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=r.findAxisModel("radiusAxis"),u=r.findAxisModel("angleAxis");Ame(o,l),Ame(s,u),N2t(a,r,e),t.push(a),r.coordinateSystem=a,a.model=r}),n.eachSeries(function(r){if(r.get("coordinateSystem")==="polar"){var i=r.getReferringComponents("polar",uu).models[0];r.coordinateSystem=i.coordinateSystem}}),t}};const G2t=B2t;var z2t=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function k4(n,e,t){e[1]>e[0]&&(e=e.slice().reverse());var r=n.coordToPoint([e[0],t]),i=n.coordToPoint([e[1],t]);return{x1:r[0],y1:r[1],x2:i[0],y2:i[1]}}function F4(n){var e=n.getRadiusAxis();return e.inverse?0:1}function Mme(n){var e=n[0],t=n[n.length-1];e&&t&&Math.abs(Math.abs(e.coord-t.coord)-360)<1e-4&&n.pop()}var U2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,r){if(this.group.removeAll(),!!t.get("show")){var i=t.axis,a=i.polar,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=Vt(i.getViewLabels(),function(h){h=Sn(h);var c=i.scale,f=c.type==="ordinal"?c.getRawOrdinalNumber(h.tickValue):h.tickValue;return h.coord=i.dataToCoord(f),h});Mme(u),Mme(s),te(z2t,function(h){t.get([h,"show"])&&(!i.scale.isBlank()||h==="axisLine")&&V2t[h](this.group,t,a,s,l,o,u)},this)}},e.type="angleAxis",e}(K2),V2t={axisLine:function(n,e,t,r,i,a){var o=e.getModel(["axisLine","lineStyle"]),s=F4(t),l=s?0:1,u;a[l]===0?u=new cm({shape:{cx:t.cx,cy:t.cy,r:a[s]},style:o.getLineStyle(),z2:1,silent:!0}):u=new Kz({shape:{cx:t.cx,cy:t.cy,r:a[s],r0:a[l]},style:o.getLineStyle(),z2:1,silent:!0}),u.style.fill=null,n.add(u)},axisTick:function(n,e,t,r,i,a){var o=e.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[F4(t)],u=Vt(r,function(h){return new zh({shape:k4(t,[l,l+s],h.coord)})});n.add(Cp(u,{style:sn(o.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(n,e,t,r,i,a){if(!!i.length){for(var o=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[F4(t)],h=[],c=0;cm?"left":"right",x=Math.abs(g[1]-y)/p<.3?"middle":g[1]>y?"top":"bottom";if(s&&s[v]){var S=s[v];dn(S)&&S.textStyle&&(d=new as(S.textStyle,l,l.ecModel))}var w=new la({silent:d_.isLabelSilent(e),style:is(d,{x:g[0],y:g[1],fill:d.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:c.formattedLabel,align:_,verticalAlign:x})});if(n.add(w),h){var b=d_.makeAxisEventDataBase(e);b.targetType="axisLabel",b.value=c.rawLabel,Bn(w).eventData=b}},this)},splitLine:function(n,e,t,r,i,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var h=[],c=0;c=0?"p":"n",I=b;S&&(r[h][A]||(r[h][A]={p:b,n:b}),I=r[h][A][M]);var R=void 0,k=void 0,D=void 0,G=void 0;if(v.dim==="radius"){var W=v.dataToCoord(C)-b,z=l.dataToCoord(A);Math.abs(W)=G})}}})}function K2t(n){var e={};te(n,function(r,i){var a=r.getData(),o=r.coordinateSystem,s=o.getBaseAxis(),l=cBe(o,s),u=s.getExtent(),h=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),c=e[l]||{bandWidth:h,remainedWidth:h,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},f=c.stacks;e[l]=c;var d=hBe(r);f[d]||c.autoWidthCount++,f[d]=f[d]||{width:0,maxWidth:0};var v=xr(r.get("barWidth"),h),p=xr(r.get("barMaxWidth"),h),g=r.get("barGap"),m=r.get("barCategoryGap");v&&!f[d].width&&(v=Math.min(c.remainedWidth,v),f[d].width=v,c.remainedWidth-=v),p&&(f[d].maxWidth=p),g!=null&&(c.gap=g),m!=null&&(c.categoryGap=m)});var t={};return te(e,function(r,i){t[i]={};var a=r.stacks,o=r.bandWidth,s=xr(r.categoryGap,o),l=xr(r.gap,1),u=r.remainedWidth,h=r.autoWidthCount,c=(u-s)/(h+(h-1)*l);c=Math.max(c,0),te(a,function(p,g){var m=p.maxWidth;m&&m=t.y&&e[1]<=t.y+t.height:r.contain(r.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},n.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e[t.orient==="horizontal"?0:1]))]},n.prototype.dataToPoint=function(e){var t=this.getAxis(),r=this.getRect(),i=[],a=t.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),i[a]=t.toGlobalCoord(t.dataToCoord(+e)),i[1-a]=a===0?r.y+r.height/2:r.x+r.width/2,i},n.prototype.convertToPixel=function(e,t,r){var i=Ime(t);return i===this?this.dataToPoint(r):null},n.prototype.convertFromPixel=function(e,t,r){var i=Ime(t);return i===this?this.pointToData(r):null},n}();function Ime(n){var e=n.seriesModel,t=n.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function hTt(n,e){var t=[];return n.eachComponent("singleAxis",function(r,i){var a=new uTt(r,n,e);a.name="single_"+i,a.resize(r,e),r.coordinateSystem=a,t.push(a)}),n.eachSeries(function(r){if(r.get("coordinateSystem")==="singleAxis"){var i=r.getReferringComponents("singleAxis",uu).models[0];r.coordinateSystem=i&&i.coordinateSystem}}),t}var cTt={create:hTt,dimensions:dBe};const fTt=cTt;var Lme=["x","y"],dTt=["width","height"],vTt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,o){var s=i.axis,l=s.coordinateSystem,u=Zj(l,1-FG(s)),h=l.dataToPoint(r)[0],c=a.get("type");if(c&&c!=="none"){var f=Wae(a),d=pTt[c](s,h,u);d.style=f,t.graphicKey=d.type,t.pointer=d}var v=rQ(i);aBe(r,t,v,i,a,o)},e.prototype.getHandleTransform=function(t,r,i){var a=rQ(r,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=Hae(r.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,r,i,a){var o=i.axis,s=o.coordinateSystem,l=FG(o),u=Zj(s,l),h=[t.x,t.y];h[l]+=r[l],h[l]=Math.min(u[1],h[l]),h[l]=Math.max(u[0],h[l]);var c=Zj(s,1-l),f=(c[1]+c[0])/2,d=[f,f];return d[l]=h[l],{x:h[0],y:h[1],rotation:t.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},e}($ae),pTt={line:function(n,e,t){var r=jae([e,t[0]],[e,t[1]],FG(n));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(n,e,t){var r=n.getBandWidth(),i=t[1]-t[0];return{type:"Rect",shape:oBe([e-r/2,t[0]],[r,i],FG(n))}}};function FG(n){return n.isHorizontal()?0:1}function Zj(n,e){var t=n.getRect();return[t[Lme[e]],t[Lme[e]]+t[dTt[e]]]}const gTt=vTt;var yTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="single",e}(pl);function mTt(n){_i(R3),K2.registerAxisPointerClass("SingleAxisPointer",gTt),n.registerComponentView(yTt),n.registerComponentView(oTt),n.registerComponentModel(qj),yM(n,"single",qj,qj.defaultOption),n.registerCoordinateSystem("single",fTt)}var _Tt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r,i){var a=BI(t);n.prototype.init.apply(this,arguments),Pme(t,a)},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),Pme(this.option,t)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(oa);function Pme(n,e){var t=n.cellSize,r;Gt(t)?r=t:r=n.cellSize=[t,t],r.length===1&&(r[1]=r[0]);var i=Vt([0,1],function(a){return Cft(e,a)&&(r[a]="auto"),r[a]!=null&&r[a]!=="auto"});kS(n,e,{type:"box",ignoreSize:i})}const xTt=_Tt;var STt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group;a.removeAll();var o=t.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=r.getLocaleModel();this._renderDayRect(t,s,a),this._renderLines(t,s,l,a),this._renderYearText(t,s,l,a),this._renderMonthText(t,u,l,a),this._renderWeekText(t,u,s,l,a)},e.prototype._renderDayRect=function(t,r,i){for(var a=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=r.start.time;u<=r.end.time;u=a.getNextNDay(u,1).time){var h=a.dataToRect([u],!1).tl,c=new ta({shape:{x:h[0],y:h[1],width:s,height:l},cursor:"default",style:o});i.add(c)}},e.prototype._renderLines=function(t,r,i,a){var o=this,s=t.coordinateSystem,l=t.getModel(["splitLine","lineStyle"]).getLineStyle(),u=t.get(["splitLine","show"]),h=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var c=r.start,f=0;c.time<=r.end.time;f++){v(c.formatedDate),f===0&&(c=s.getDateInfo(r.start.y+"-"+r.start.m));var d=c.date;d.setMonth(d.getMonth()+1),c=s.getDateInfo(d)}v(s.getNextNDay(r.end.time,1).formatedDate);function v(p){o._firstDayOfMonth.push(s.getDateInfo(p)),o._firstDayPoints.push(s.dataToRect([p],!1).tl);var g=o._getLinePointsOfOneWeek(t,p,i);o._tlpoints.push(g[0]),o._blpoints.push(g[g.length-1]),u&&o._drawSplitline(g,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,h,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,h,i),l,a)},e.prototype._getEdgesPoints=function(t,r,i){var a=[t[0].slice(),t[t.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-r/2,a[1][o]=a[1][o]+r/2,a},e.prototype._drawSplitline=function(t,r,i){var a=new Gd({z2:20,shape:{points:t},style:r});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(t,r,i){for(var a=t.coordinateSystem,o=a.getDateInfo(r),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),h=a.dataToRect([u.time],!1);s[2*u.day]=h.tl,s[2*u.day+1]=h[i==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(t,r){return Or(t)&&t?bft(t,r):rn(t)?t(r):r.nameMap},e.prototype._yearTextPositionControl=function(t,r,i,a,o){var s=r[0],l=r[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var h=0;return(a==="left"||a==="right")&&(h=Math.PI/2),{rotation:h,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(t,r,i,a){var o=t.getModel("yearLabel");if(!!o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=i!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],h=(u[0][0]+u[1][0])/2,c=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,d={top:[h,u[f][1]],bottom:[h,u[1-f][1]],left:[u[1-f][0],c],right:[u[f][0],c]},v=r.start.y;+r.end.y>+r.start.y&&(v=v+"-"+r.end.y);var p=o.get("formatter"),g={start:r.start.y,end:r.end.y,nameMap:v},m=this._formatterLabel(p,g),y=new la({z2:30,style:is(o,{text:m})});y.attr(this._yearTextPositionControl(y,d[l],i,l,s)),a.add(y)}},e.prototype._monthTextPositionControl=function(t,r,i,a,o){var s="left",l="top",u=t[0],h=t[1];return i==="horizontal"?(h=h+o,r&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,r&&(l="middle"),a==="start"&&(s="right")),{x:u,y:h,align:s,verticalAlign:l}},e.prototype._renderMonthText=function(t,r,i,a){var o=t.getModel("monthLabel");if(!!o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),h=o.get("align"),c=[this._tlpoints,this._blpoints];(!s||Or(s))&&(s&&(r=fJ(s)||r),s=r.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var v=h==="center",p=0;p=i.start.time&&r.times.end.time&&t.reverse(),t},n.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],r;t[0].time>t[1].time&&(r=!0,t.reverse());var i=Math.floor(t[1].time/Kj)-Math.floor(t[0].time/Kj)+1,a=new Date(t[0].time),o=a.getDate(),s=t[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-t[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-t[1].time)*u>0;)i-=u,a.setDate(l-u);var h=Math.floor((i+t[0].day+6)/7),c=r?-h+1:h-1;return r&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:i,weeks:h,nthWeek:c,fweek:t[0].day,lweek:t[1].day}},n.prototype._getDateByWeeksAndDay=function(e,t,r){var i=this._getRangeInfo(r);if(e>i.weeks||e===0&&ti.lweek)return null;var a=(e-1)*7-i.fweek+t,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},n.create=function(e,t){var r=[];return e.eachComponent("calendar",function(i){var a=new n(i);r.push(a),i.coordinateSystem=a}),e.eachSeries(function(i){i.get("coordinateSystem")==="calendar"&&(i.coordinateSystem=r[i.get("calendarIndex")||0])}),r},n.dimensions=["time","value"],n}();function Ome(n){var e=n.calendarModel,t=n.seriesModel,r=e?e.coordinateSystem:t?t.coordinateSystem:null;return r}const ETt=bTt;function TTt(n){n.registerComponentModel(xTt),n.registerComponentView(wTt),n.registerCoordinateSystem("calendar",ETt)}function CTt(n,e){var t=n.existing;if(e.id=n.keyInfo.id,!e.type&&t&&(e.type=t.type),e.parentId==null){var r=e.parentOption;r?e.parentId=r.id:t&&(e.parentId=t.parentId)}e.parentOption=null}function Rme(n,e){var t;return te(e,function(r){n[r]!=null&&n[r]!=="auto"&&(t=!0)}),t}function ATt(n,e,t){var r=Mt({},t),i=n[e],a=t.$action||"merge";a==="merge"?i?(ii(i,r,!0),kS(i,r,{ignoreSize:!0}),Jke(t,i),B4(t,i),B4(t,i,"shape"),B4(t,i,"style"),B4(t,i,"extra"),t.clipPath=i.clipPath):n[e]=r:a==="replace"?n[e]=r:a==="remove"&&i&&(n[e]=null)}var vBe=["transition","enterFrom","leaveTo"],MTt=vBe.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function B4(n,e,t){if(t&&(!n[t]&&e[t]&&(n[t]={}),n=n[t],e=e[t]),!(!n||!e))for(var r=t?vBe:MTt,i=0;i=0;h--){var c=i[h],f=Ru(c.id,null),d=f!=null?o.get(f):null;if(!!d){var v=d.parent,m=yp(v),y=v===a?{width:s,height:l}:{width:m.width,height:m.height},_={},x=sU(d,c,y,null,{hv:c.hv,boundingMode:c.bounding},_);if(!yp(d).isNew&&x){for(var S=c.transition,w={},b=0;b=0)?w[E]=T:d[E]=T}ma(d,w,t,0)}else d.attr(_)}}},e.prototype._clear=function(){var t=this,r=this._elMap;r.each(function(i){kB(i,yp(i).option,r,t._lastGraphicModel)}),this._elMap=$r()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(pl);function nQ(n){var e=Fr(Dme,n)?Dme[n]:Mie(n),t=new e({});return yp(t).type=n,t}function Nme(n,e,t,r){var i=nQ(t);return e.add(i),r.set(n,i),yp(i).id=n,yp(i).isNew=!0,i}function kB(n,e,t,r){var i=n&&n.parent;i&&(n.type==="group"&&n.traverse(function(a){kB(a,e,t,r)}),bU(n,e,r),t.removeKey(yp(n).id))}function kme(n,e,t,r){n.isGroup||te([["cursor",Vp.prototype.cursor],["zlevel",r||0],["z",t||0],["z2",0]],function(i){var a=i[0];Fr(e,a)?n[a]=ni(e[a],i[1]):n[a]==null&&(n[a]=i[1])}),te(Li(e),function(i){if(i.indexOf("on")===0){var a=e[i];n[i]=rn(a)?a:null}}),Fr(e,"draggable")&&(n.draggable=e.draggable),e.name!=null&&(n.name=e.name),e.id!=null&&(n.id=e.id)}function OTt(n){return n=Mt({},n),te(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(Kke),function(e){delete n[e]}),n}function RTt(n,e,t){var r=Bn(n).eventData;!n.silent&&!n.ignore&&!r&&(r=Bn(n).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:n.name}),r&&(r.info=t.info)}function DTt(n){n.registerComponentModel(LTt),n.registerComponentView(PTt),n.registerPreprocessor(function(e){var t=e.graphic;Gt(t)?!t[0]||!t[0].elements?e.graphic=[{elements:t}]:e.graphic=[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var Fme=["x","y","radius","angle","single"],NTt=["cartesian2d","polar","singleAxis"];function kTt(n){var e=n.get("coordinateSystem");return gi(NTt,e)>=0}function iS(n){return n+"Axis"}function FTt(n,e){var t=$r(),r=[],i=$r();n.eachComponent({mainType:"dataZoom",query:e},function(h){i.get(h.uid)||s(h)});var a;do a=!1,n.eachComponent("dataZoom",o);while(a);function o(h){!i.get(h.uid)&&l(h)&&(s(h),a=!0)}function s(h){i.set(h.uid,!0),r.push(h),u(h)}function l(h){var c=!1;return h.eachTargetAxis(function(f,d){var v=t.get(f);v&&v[d]&&(c=!0)}),c}function u(h){h.eachTargetAxis(function(c,f){(t.get(c)||t.set(c,[]))[f]=!0})}return r}function pBe(n){var e=n.ecModel,t={infoList:[],infoMap:$r()};return n.eachTargetAxis(function(r,i){var a=e.getComponent(iS(r),i);if(!!a){var o=a.getCoordSysModel();if(!!o){var s=o.uid,l=t.infoMap.get(s);l||(l={model:o,axisModels:[]},t.infoList.push(l),t.infoMap.set(s,l)),l.axisModels.push(a)}}}),t}var Jj=function(){function n(){this.indexList=[],this.indexMap=[]}return n.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},n}(),BTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._autoThrottle=!0,t._noTarget=!0,t._rangePropMode=["percent","percent"],t}return e.prototype.init=function(t,r,i){var a=Bme(t);this.settledOption=a,this.mergeDefaultAndTheme(t,i),this._doInit(a)},e.prototype.mergeOption=function(t){var r=Bme(t);ii(this.option,t,!0),ii(this.settledOption,r,!0),this._doInit(r)},e.prototype._doInit=function(t){var r=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var i=this.settledOption;te([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(r[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),r=this._targetAxisInfoMap=$r(),i=this._fillSpecifiedTargetAxis(r);i?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(r,this._orient)),this._noTarget=!0,r.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var r=!1;return te(Fme,function(i){var a=this.getReferringComponents(iS(i),rht);if(!!a.specified){r=!0;var o=new Jj;te(a.models,function(s){o.add(s.componentIndex)}),t.set(i,o)}},this),r},e.prototype._fillAutoTargetAxisByOrient=function(t,r){var i=this.ecModel,a=!0;if(a){var o=r==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(h){return h.get("orient",!0)===r}});l(s,"single")}function l(u,h){var c=u[0];if(!!c){var f=new Jj;if(f.add(c.componentIndex),t.set(h,f),a=!1,h==="x"||h==="y"){var d=c.getReferringComponents("grid",uu).models[0];d&&te(u,function(v){c.componentIndex!==v.componentIndex&&d===v.getReferringComponents("grid",uu).models[0]&&f.add(v.componentIndex)})}}}a&&te(Fme,function(u){if(!!a){var h=i.findComponents({mainType:iS(u),filter:function(f){return f.get("type",!0)==="category"}});if(h[0]){var c=new Jj;c.add(h[0].componentIndex),t.set(u,c),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(r){!t&&(t=r)},this),t==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var r=this.ecModel.option;this.option.throttle=r.animation&&r.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var r=this._rangePropMode,i=this.get("rangeMode");te([["start","startValue"],["end","endValue"]],function(a,o){var s=t[a[0]]!=null,l=t[a[1]]!=null;s&&!l?r[o]="percent":!s&&l?r[o]="value":i?r[o]=i[o]:s&&(r[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(r,i){t==null&&(t=this.ecModel.getComponent(iS(r),i))},this),t},e.prototype.eachTargetAxis=function(t,r){this._targetAxisInfoMap.each(function(i,a){te(i.indexList,function(o){t.call(r,a,o)})})},e.prototype.getAxisProxy=function(t,r){var i=this.getAxisModel(t,r);if(i)return i.__dzAxisProxy},e.prototype.getAxisModel=function(t,r){var i=this._targetAxisInfoMap.get(t);if(i&&i.indexMap[r])return this.ecModel.getComponent(iS(t),r)},e.prototype.setRawRange=function(t){var r=this.option,i=this.settledOption;te([["start","startValue"],["end","endValue"]],function(a){(t[a[0]]!=null||t[a[1]]!=null)&&(r[a[0]]=i[a[0]]=t[a[0]],r[a[1]]=i[a[1]]=t[a[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var r=this.option;te(["start","startValue","end","endValue"],function(i){r[i]=t[i]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,r){if(t==null&&r==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getDataValueWindow()}else return this.getAxisProxy(t,r).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var r,i=this._targetAxisInfoMap.keys(),a=0;ao[1];if(_&&!x&&!S)return!0;_&&(g=!0),x&&(v=!0),S&&(p=!0)}return g&&v&&p})}else UC(h,function(d){if(a==="empty")l.setData(u=u.map(d,function(p){return s(p)?p:NaN}));else{var v={};v[d]=o,u.selectRange(v)}});UC(h,function(d){u.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},n.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,r=this._dataExtent;UC(["min","max"],function(i){var a=t.get(i+"Span"),o=t.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=go(r[0]+o,r,[0,100],!0):a!=null&&(o=go(a,[0,100],r,!0)-r[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=o},this)},n.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,r=this._valueWindow;if(!!t){var i=T3e(r,[0,500]);i=Math.min(i,20);var a=e.axis.scale.rawExtentInfo;t[0]!==0&&a.setDeterminedMinMax("min",+r[0].toFixed(i)),t[1]!==100&&a.setDeterminedMinMax("max",+r[1].toFixed(i)),a.freeze()}},n}();function HTt(n,e,t){var r=[1/0,-1/0];UC(t,function(o){pgt(r,o.getData(),e)});var i=n.getAxisModel(),a=O4e(i.axis.scale,i,r).calculate();return[a.min,a.max]}const jTt=WTt;var XTt={getTargetSeries:function(n){function e(i){n.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=n.getComponent(iS(o),s);i(o,s,l,a)})})}e(function(i,a,o,s){o.__dzAxisProxy=null});var t=[];e(function(i,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new jTt(i,a,s,n),t.push(o.__dzAxisProxy))});var r=$r();return te(t,function(i){te(i.getTargetSeriesModels(),function(a){r.set(a.uid,a)})}),r},overallReset:function(n,e){n.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(r,i){t.getAxisProxy(r,i).reset(t)}),t.eachTargetAxis(function(r,i){t.getAxisProxy(r,i).filterData(t,e)})}),n.eachComponent("dataZoom",function(t){var r=t.findRepresentativeAxisProxy();if(r){var i=r.getDataPercentWindow(),a=r.getDataValueWindow();t.setCalculatedRange({start:i[0],end:i[1],startValue:a[0],endValue:a[1]})}})}};const YTt=XTt;function qTt(n){n.registerAction("dataZoom",function(e,t){var r=FTt(t,e);te(r,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var zme=!1;function Kae(n){zme||(zme=!0,n.registerProcessor(n.PRIORITY.PROCESSOR.FILTER,YTt),qTt(n),n.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function ZTt(n){n.registerComponentModel(zTt),n.registerComponentView($Tt),Kae(n)}var bp=function(){function n(){}return n}(),gBe={};function VC(n,e){gBe[n]=e}function yBe(n){return gBe[n]}var KTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){n.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;te(this.option.feature,function(r,i){var a=yBe(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(t)),ii(r,a.defaultOption))})},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(oa);const JTt=KTt;function QTt(n,e,t){var r=e.getBoxLayoutParams(),i=e.get("padding"),a={width:t.getWidth(),height:t.getHeight()},o=Uu(r,a,i);ME(e.get("orient"),n,e.get("itemGap"),o.width,o.height),sU(n,r,a,i)}function mBe(n,e){var t=FI(e.get("padding")),r=e.getItemStyle(["color","opacity"]);return r.fill=e.get("backgroundColor"),n=new ta({shape:{x:n.x-t[3],y:n.y-t[0],width:n.width+t[1]+t[3],height:n.height+t[0]+t[2],r:e.get("borderRadius")},style:r,silent:!0,z2:-1}),n}var eCt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i,a){var o=this.group;if(o.removeAll(),!t.get("show"))return;var s=+t.get("itemSize"),l=t.get("orient")==="vertical",u=t.get("feature")||{},h=this._features||(this._features={}),c=[];te(u,function(v,p){c.push(p)}),new f_(this._featureNames||[],c).add(f).update(f).remove(Un(f,null)).execute(),this._featureNames=c;function f(v,p){var g=c[v],m=c[p],y=u[g],_=new as(y,t,t.ecModel),x;if(a&&a.newTitle!=null&&a.featureName===g&&(y.title=a.newTitle),g&&!m){if(tCt(g))x={onclick:_.option.onclick,featureName:g};else{var S=yBe(g);if(!S)return;x=new S}h[g]=x}else if(x=h[m],!x)return;x.uid=kI("toolbox-feature"),x.model=_,x.ecModel=r,x.api=i;var w=x instanceof bp;if(!g&&m){w&&x.dispose&&x.dispose(r,i);return}if(!_.get("show")||w&&x.unusable){w&&x.remove&&x.remove(r,i);return}d(_,x,g),_.setIconStatus=function(b,E){var T=this.option,C=this.iconPaths;T.iconStatus=T.iconStatus||{},T.iconStatus[b]=E,C[b]&&(E==="emphasis"?h_:c_)(C[b])},x instanceof bp&&x.render&&x.render(_,r,i,a)}function d(v,p,g){var m=v.getModel("iconStyle"),y=v.getModel(["emphasis","iconStyle"]),_=p instanceof bp&&p.getIcons?p.getIcons():v.get("icon"),x=v.get("title")||{},S,w;Or(_)?(S={},S[g]=_):S=_,Or(x)?(w={},w[g]=x):w=x;var b=v.iconPaths={};te(S,function(E,T){var C=_3(E,{},{x:-s/2,y:-s/2,width:s,height:s});C.setStyle(m.getItemStyle());var A=C.ensureState("emphasis");A.style=y.getItemStyle();var M=new la({style:{text:w[T],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null},ignore:!0});C.setTextContent(M),DI({el:C,componentModel:t,itemName:T,formatterParamsExtra:{title:w[T]}}),C.__title=w[T],C.on("mouseover",function(){var I=y.getItemStyle(),R=l?t.get("right")==null&&t.get("left")!=="right"?"right":"left":t.get("bottom")==null&&t.get("top")!=="bottom"?"bottom":"top";M.setStyle({fill:y.get("textFill")||I.fill||I.stroke||"#000",backgroundColor:y.get("textBackgroundColor")}),C.setTextConfig({position:y.get("textPosition")||R}),M.ignore=!t.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){v.get(["iconStatus",T])!=="emphasis"&&i.leaveEmphasis(this),M.hide()}),(v.get(["iconStatus",T])==="emphasis"?h_:c_)(C),o.add(C),C.on("click",kr(p.onclick,p,r,i,T)),b[T]=C})}QTt(o,t,i),o.add(mBe(o.getBoundingRect(),t)),l||o.eachChild(function(v){var p=v.__title,g=v.ensureState("emphasis"),m=g.textConfig||(g.textConfig={}),y=v.getTextContent(),_=y&&y.ensureState("emphasis");if(_&&!rn(_)&&p){var x=_.style||(_.style={}),S=v3(p,la.makeFont(x)),w=v.x+o.x,b=v.y+o.y+s,E=!1;b+S.height>i.getHeight()&&(m.position="top",E=!0);var T=E?-5-S.height:s+10;w+S.width/2>i.getWidth()?(m.position=["100%",T],x.align="right"):w-S.width/2<0&&(m.position=[0,T],x.align="left")}})},e.prototype.updateView=function(t,r,i,a){te(this._features,function(o){o instanceof bp&&o.updateView&&o.updateView(o.model,r,i,a)})},e.prototype.remove=function(t,r){te(this._features,function(i){i instanceof bp&&i.remove&&i.remove(t,r)}),this.group.removeAll()},e.prototype.dispose=function(t,r){te(this._features,function(i){i instanceof bp&&i.dispose&&i.dispose(t,r)})},e.type="toolbox",e}(pl);function tCt(n){return n.indexOf("my")===0}const rCt=eCt;var nCt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,r){var i=this.model,a=i.get("name")||t.get("title.0.text")||"echarts",o=r.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=r.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=sa.browser;if(rn(MouseEvent)&&(u.newEdge||!u.ie&&!u.edge)){var h=document.createElement("a");h.download=a+"."+s,h.target="_blank",h.href=l;var c=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});h.dispatchEvent(c)}else if(window.navigator.msSaveOrOpenBlob||o){var f=l.split(","),d=f[0].indexOf("base64")>-1,v=o?decodeURIComponent(f[1]):f[1];d&&(v=window.atob(v));var p=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var g=v.length,m=new Uint8Array(g);g--;)m[g]=v.charCodeAt(g);var y=new Blob([m]);window.navigator.msSaveOrOpenBlob(y,p)}else{var _=document.createElement("iframe");document.body.appendChild(_);var x=_.contentWindow,S=x.document;S.open("image/svg+xml","replace"),S.write(v),S.close(),x.focus(),S.execCommand("SaveAs",!0,p),document.body.removeChild(_)}}else{var w=i.get("lang"),b='',E=window.open();E.document.write(b),E.document.title=a}},e.getDefaultOption=function(t){var r={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return r},e}(bp);const iCt=nCt;var Ume="__ec_magicType_stack__",aCt=[["line","bar"],["stack"]],oCt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getIcons=function(){var t=this.model,r=t.get("icon"),i={};return te(t.get("type"),function(a){r[a]&&(i[a]=r[a])}),i},e.getDefaultOption=function(t){var r={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return r},e.prototype.onclick=function(t,r,i){var a=this.model,o=a.get(["seriesIndex",i]);if(!!Vme[i]){var s={series:[]},l=function(c){var f=c.subType,d=c.id,v=Vme[i](f,d,c,a);v&&(sn(v,c.option),s.series.push(v));var p=c.coordinateSystem;if(p&&p.type==="cartesian2d"&&(i==="line"||i==="bar")){var g=p.getAxesByScale("ordinal")[0];if(g){var m=g.dim,y=m+"Axis",_=c.getReferringComponents(y,uu).models[0],x=_.componentIndex;s[y]=s[y]||[];for(var S=0;S<=x;S++)s[y][x]=s[y][x]||{};s[y][x].boundaryGap=i==="bar"}}};te(aCt,function(c){gi(c,i)>=0&&te(c,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,h=i;i==="stack"&&(u=ii({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(h="tiled")),r.dispatchAction({type:"changeMagicType",currentType:h,newOption:s,newTitle:u,featureName:"magicType"})}},e}(bp),Vme={line:function(n,e,t,r){if(n==="bar")return ii({id:e,type:"line",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(n,e,t,r){if(n==="line")return ii({id:e,type:"bar",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(n,e,t,r){var i=t.get("stack")===Ume;if(n==="line"||n==="bar")return r.setIconStatus("stack",i?"normal":"emphasis"),ii({id:e,stack:i?"":Ume},r.get(["option","stack"])||{},!0)}};Lm({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(n,e){e.mergeOption(n.newOption)});const sCt=oCt;var EU=new Array(60).join("-"),xM=" ";function lCt(n){var e={},t=[],r=[];return n.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;e[s]||(e[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},r.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(i)}else t.push(i)}else t.push(i)}),{seriesGroupByCategoryAxis:e,other:t,meta:r}}function uCt(n){var e=[];return te(n,function(t,r){var i=t.categoryAxis,a=t.valueAxis,o=a.dim,s=[" "].concat(Vt(t.series,function(d){return d.name})),l=[i.model.getCategories()];te(t.series,function(d){var v=d.getRawData();l.push(d.getRawData().mapArray(v.mapDimension(o),function(p){return p}))});for(var u=[s.join(xM)],h=0;h=0)return!0}var iQ=new RegExp("["+xM+"]+","g");function dCt(n){for(var e=n.split(/\n+/g),t=BG(e.shift()).split(iQ),r=[],i=Vt(t,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=t[a];if(o[i])break}if(a<0){var s=n.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();t[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),t.push(e)}function xCt(n){var e=Jae(n),t=e[e.length-1];e.length>1&&e.pop();var r={};return _Be(t,function(i,a){for(var o=e.length-1;o>=0;o--)if(i=e[o][a],i){r[a]=i;break}}),r}function SCt(n){xBe(n).snapshots=null}function wCt(n){return Jae(n).length}function Jae(n){var e=xBe(n);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var bCt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,r){SCt(t),r.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var r={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])};return r},e}(bp);Lm({type:"restore",event:"restore",update:"prepareAndUpdate"},function(n,e){e.resetOption("recreate")});const ECt=bCt;var TCt=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],CCt=function(){function n(e,t,r){var i=this;this._targetInfoList=[];var a=$me(t,e);te(ACt,function(o,s){(!r||!r.include||gi(r.include,s)>=0)&&o(a,i._targetInfoList)})}return n.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(r,i,a){if((r.coordRanges||(r.coordRanges=[])).push(i),!r.coordRange){r.coordRange=i;var o=Qj[r.brushType](0,a,i);r.__rangeOffset={offset:Xme[r.brushType](o.values,r.range,[1,1]),xyMinMax:o.xyMinMax}}}),e},n.prototype.matchOutputRanges=function(e,t,r){te(e,function(i){var a=this.findTargetInfo(i,t);a&&a!==!0&&te(a.coordSyses,function(o){var s=Qj[i.brushType](1,o,i.range,!0);r(i,s.values,o,t)})},this)},n.prototype.setInputRanges=function(e,t){te(e,function(r){var i=this.findTargetInfo(r,t);if(r.range=r.range||[],i&&i!==!0){r.panelId=i.panelId;var a=Qj[r.brushType](0,i.coordSys,r.coordRange),o=r.__rangeOffset;r.range=o?Xme[r.brushType](a.values,o.offset,MCt(a.xyMinMax,o.xyMinMax)):a.values}},this)},n.prototype.makePanelOpts=function(e,t){return Vt(this._targetInfoList,function(r){var i=r.getPanelRect();return{panelId:r.panelId,defaultBrushType:t?t(r):null,clipPath:A6e(i),isTargetByCursor:I6e(i,e,r.coordSysModel),getLinearBrushOtherExtent:M6e(i)}})},n.prototype.controlSeries=function(e,t,r){var i=this.findTargetInfo(e,r);return i===!0||i&&gi(i.coordSyses,t.coordinateSystem)>=0},n.prototype.findTargetInfo=function(e,t){for(var r=this._targetInfoList,i=$me(t,e),a=0;an[1]&&n.reverse(),n}function $me(n,e){return XO(n,e,{includeMainTypes:TCt})}var ACt={grid:function(n,e){var t=n.xAxisModels,r=n.yAxisModels,i=n.gridModels,a=$r(),o={},s={};!t&&!r&&!i||(te(t,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),te(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),te(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,h=[];te(u.getCartesians(),function(c,f){(gi(t,c.getAxis("x").model)>=0||gi(r,c.getAxis("y").model)>=0)&&h.push(c)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:h[0],coordSyses:h,getPanelRect:Hme.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(n,e){te(n.geoModels,function(t){var r=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:r,coordSyses:[r],getPanelRect:Hme.geo})})}},Wme=[function(n,e){var t=n.xAxisModel,r=n.yAxisModel,i=n.gridModel;return!i&&t&&(i=t.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===e.gridModel},function(n,e){var t=n.geoModel;return t&&t===e.geoModel}],Hme={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var n=this.coordSys,e=n.getBoundingRect().clone();return e.applyTransform(AE(n)),e}},Qj={lineX:Un(jme,0),lineY:Un(jme,1),rect:function(n,e,t,r){var i=n?e.pointToData([t[0][0],t[1][0]],r):e.dataToPoint([t[0][0],t[1][0]],r),a=n?e.pointToData([t[0][1],t[1][1]],r):e.dataToPoint([t[0][1],t[1][1]],r),o=[aQ([i[0],a[0]]),aQ([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(n,e,t,r){var i=[[1/0,-1/0],[1/0,-1/0]],a=Vt(t,function(o){var s=n?e.pointToData(o,r):e.dataToPoint(o,r);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function jme(n,e,t,r){var i=t.getAxis(["x","y"][n]),a=aQ(Vt([0,1],function(s){return e?i.coordToData(i.toLocalCoord(r[s]),!0):i.toGlobalCoord(i.dataToCoord(r[s]))})),o=[];return o[n]=a,o[1-n]=[NaN,NaN],{values:a,xyMinMax:o}}var Xme={lineX:Un(Yme,0),lineY:Un(Yme,1),rect:function(n,e,t){return[[n[0][0]-t[0]*e[0][0],n[0][1]-t[0]*e[0][1]],[n[1][0]-t[1]*e[1][0],n[1][1]-t[1]*e[1][1]]]},polygon:function(n,e,t){return Vt(n,function(r,i){return[r[0]-t[0]*e[i][0],r[1]-t[1]*e[i][1]]})}};function Yme(n,e,t,r){return[e[0]-r[n]*t[0],e[1]-r[n]*t[1]]}function MCt(n,e){var t=qme(n),r=qme(e),i=[t[0]/r[0],t[1]/r[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function qme(n){return n?[n[0][1]-n[0][0],n[1][1]-n[1][0]]:[NaN,NaN]}const Qae=CCt;var oQ=te,ICt=Kut("toolbox-dataZoom_"),LCt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i,a){this._brushController||(this._brushController=new Rae(i.getZr()),this._brushController.on("brush",kr(this._onBrush,this)).mount()),RCt(t,r,this,a,i),OCt(t,r)},e.prototype.onclick=function(t,r,i){PCt[i].call(this)},e.prototype.remove=function(t,r){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,r){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var r=t.areas;if(!t.isEnd||!r.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var o=new Qae(eoe(this.model),a,{include:["grid"]});o.matchOutputRanges(r,a,function(u,h,c){if(c.type==="cartesian2d"){var f=u.brushType;f==="rect"?(s("x",c,h[0]),s("y",c,h[1])):s({lineX:"x",lineY:"y"}[f],c,h)}}),_Ct(a,i),this._dispatchZoomAction(i);function s(u,h,c){var f=h.getAxis(u),d=f.model,v=l(u,d,a),p=v.findRepresentativeAxisProxy(d).getMinMaxSpan();(p.minValueSpan!=null||p.maxValueSpan!=null)&&(c=J2(0,c.slice(),f.scale.getExtent(),0,p.minValueSpan,p.maxValueSpan)),v&&(i[v.id]={dataZoomId:v.id,startValue:c[0],endValue:c[1]})}function l(u,h,c){var f;return c.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var v=d.getAxisModel(u,h.componentIndex);v&&(f=d)}),f}},e.prototype._dispatchZoomAction=function(t){var r=[];oQ(t,function(i,a){r.push(Sn(i))}),r.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:r})},e.getDefaultOption=function(t){var r={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return r},e}(bp),PCt={zoom:function(){var n=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:n})},back:function(){this._dispatchZoomAction(xCt(this.ecModel))}};function eoe(n){var e={xAxisIndex:n.get("xAxisIndex",!0),yAxisIndex:n.get("yAxisIndex",!0),xAxisId:n.get("xAxisId",!0),yAxisId:n.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function OCt(n,e){n.setIconStatus("back",wCt(e)>1?"emphasis":"normal")}function RCt(n,e,t,r,i){var a=t._isZoomActive;r&&r.type==="takeGlobalCursor"&&(a=r.key==="dataZoomSelect"?r.dataZoomSelectActive:!1),t._isZoomActive=a,n.setIconStatus("zoom",a?"emphasis":"normal");var o=new Qae(eoe(n),e,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});t._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:n.getModel("brushStyle").getItemStyle()}:!1)}Oft("dataZoom",function(n){var e=n.getComponent("toolbox",0),t=["feature","dataZoom"];if(!e||e.get(t)==null)return;var r=e.getModel(t),i=[],a=eoe(r),o=XO(n,a);oQ(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),oQ(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,h){var c=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:ICt+u+c};f[h]=c,i.push(f)}return i});const DCt=LCt;function NCt(n){n.registerComponentModel(JTt),n.registerComponentView(rCt),VC("saveAsImage",iCt),VC("magicType",sCt),VC("dataView",mCt),VC("dataZoom",DCt),VC("restore",ECt),_i(ZTt)}var kCt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(oa);const FCt=kCt;function SBe(n){var e=n.get("confine");return e!=null?!!e:n.get("renderMode")==="richText"}function wBe(n){if(!!sa.domSupported){for(var e=document.documentElement.style,t=0,r=n.length;t-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var h=u*Math.PI/180,c=o+i,f=c*Math.abs(Math.cos(h))+c*Math.abs(Math.sin(h)),d=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-c)/2)*100)/100;s+=";"+a+":-"+d+"px";var v=e+" solid "+i+"px;",p=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+v,"border-right:"+v,"background-color:"+r+";"];return'
'}function WCt(n,e){var t="cubic-bezier(0.23,1,0.32,1)",r=" "+n/2+"s "+t,i="opacity"+r+",visibility"+r;return e||(r=" "+n+"s "+t,i+=sa.transformSupported?","+toe+r:",left"+r+",top"+r),zCt+":"+i}function Zme(n,e,t){var r=n.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!sa.transformSupported)return t?"top:"+i+";left:"+r+";":[["top",i],["left",r]];var a=sa.transform3dSupported,o="translate"+(a?"3d":"")+"("+r+","+i+(a?",0":"")+")";return t?"top:0;left:0;"+toe+":"+o+";":[["top",0],["left",0],[bBe,o]]}function HCt(n){var e=[],t=n.get("fontSize"),r=n.getTextColor();r&&e.push("color:"+r),e.push("font:"+n.getFont()),t&&e.push("line-height:"+Math.round(t*3/2)+"px");var i=n.get("textShadowColor"),a=n.get("textShadowBlur")||0,o=n.get("textShadowOffsetX")||0,s=n.get("textShadowOffsetY")||0;return i&&a&&e.push("text-shadow:"+o+"px "+s+"px "+a+"px "+i),te(["decoration","align"],function(l){var u=n.get(l);u&&e.push("text-"+l+":"+u)}),e.join(";")}function jCt(n,e,t){var r=[],i=n.get("transitionDuration"),a=n.get("backgroundColor"),o=n.get("shadowBlur"),s=n.get("shadowColor"),l=n.get("shadowOffsetX"),u=n.get("shadowOffsetY"),h=n.getModel("textStyle"),c=PFe(n,"html"),f=l+"px "+u+"px "+o+"px "+s;return r.push("box-shadow:"+f),e&&i&&r.push(WCt(i,t)),a&&r.push("background-color:"+a),te(["width","color","radius"],function(d){var v="border-"+d,p=qke(v),g=n.get(p);g!=null&&r.push(v+":"+g+(d==="color"?"":"px"))}),r.push(HCt(h)),c!=null&&r.push("padding:"+FI(c).join("px ")+"px"),r.join(";")+";"}function Kme(n,e,t,r,i){var a=e&&e.painter;if(t){var o=a&&a.getViewportRoot();o&&wlt(n,o,document.body,r,i)}else{n[0]=r,n[1]=i;var s=a&&a.getViewportRootOffset();s&&(n[0]+=s.offsetLeft,n[1]+=s.offsetTop)}n[2]=n[0]/e.getWidth(),n[3]=n[1]/e.getHeight()}var XCt=function(){function n(e,t,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,sa.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var a=this._zr=t.getZr(),o=this._appendToBody=r&&r.appendToBody;Kme(this._styleCoord,a,o,t.getWidth()/2,t.getHeight()/2),o?document.body.appendChild(i):e.appendChild(i),this._container=e;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=a.handler,h=a.painter.getViewportRoot();lp(h,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return n.prototype.update=function(e){var t=this._container,r=GCt(t,"position"),i=t.style;i.position!=="absolute"&&r!=="absolute"&&(i.position="relative");var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},n.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var r=this.el,i=r.style,a=this._styleCoord;r.innerHTML?i.cssText=UCt+jCt(e,!this._firstShow,this._longHide)+Zme(a[0],a[1],!0)+("border-color:"+KE(t)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},n.prototype.setContent=function(e,t,r,i,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(Or(a)&&r.get("trigger")==="item"&&!SBe(r)&&(s=$Ct(r,i,a)),Or(e))o.innerHTML=e+s;else if(e){o.innerHTML="",Gt(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,r=this._ecModel,i=this._api,a=t.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(t,r,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,r,i,a){if(!(a.from===this.uid||sa.node||!i.getDom())){var o=e1e(a,i);this._ticket="";var s=a.dataByCoordSys,l=rAt(a,r,i);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var h=KCt;h.x=a.x,h.y=a.y,h.update(),Bn(h).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:h},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(t,r,i,a))return;var c=lBe(a,r),f=c.point[0],d=c.point[1];f!=null&&d!=null&&this._tryShow({offsetX:f,offsetY:d,target:c.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(t,r,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(e1e(a,i))},e.prototype._manuallyAxisShowTip=function(t,r,i,a){var o=a.seriesIndex,s=a.dataIndex,l=r.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=r.getSeriesByIndex(o);if(!!u){var h=u.getData(),c=fP([h.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(c.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(t,r){var i=t.target,a=this._tooltipModel;if(!!a){this._lastX=t.offsetX,this._lastY=t.offsetY;var o=t.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,t);else if(i){this._lastDataByCoordSys=null;var s,l;aE(i,function(u){if(Bn(u).dataIndex!=null)return s=u,!0;if(Bn(u).tooltipConfig!=null)return l=u,!0},!0),s?this._showSeriesItemTooltip(t,s,r):l?this._showComponentItemTooltip(t,l,r):this._hide(r)}else this._lastDataByCoordSys=null,this._hide(r)}},e.prototype._showOrMove=function(t,r){var i=t.get("showDelay");r=kr(r,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(r,i):r()},e.prototype._showAxisTooltip=function(t,r){var i=this._ecModel,a=this._tooltipModel,o=[r.offsetX,r.offsetY],s=fP([r.tooltipOption],a),l=this._renderMode,u=[],h=ch("section",{blocks:[],noHeader:!0}),c=[],f=new BH;te(t,function(y){te(y.dataByAxis,function(_){var x=i.getComponent(_.axisDim+"Axis",_.axisIndex),S=_.value;if(!(!x||S==null)){var w=iBe(S,x.axis,i,_.seriesDataIndices,_.valueLabelOpt),b=ch("section",{header:w,noHeader:!Qg(w),sortBlocks:!0,blocks:[]});h.blocks.push(b),te(_.seriesDataIndices,function(E){var T=i.getSeriesByIndex(E.seriesIndex),C=E.dataIndexInside,A=T.getDataParams(C);if(!(A.dataIndex<0)){A.axisDim=_.axisDim,A.axisIndex=_.axisIndex,A.axisType=_.axisType,A.axisId=_.axisId,A.axisValue=nae(x.axis,{value:S}),A.axisValueLabel=w,A.marker=f.makeTooltipMarker("item",KE(A.color),l);var M=Gpe(T.formatTooltip(C,!0,null)),I=M.frag;if(I){var R=fP([T],a).get("valueFormatter");b.blocks.push(R?Mt({valueFormatter:R},I):I)}M.text&&c.push(M.text),u.push(A)}})}})}),h.blocks.reverse(),c.reverse();var d=r.position,v=s.get("order"),p=Hpe(h,f,l,v,i.get("useUTC"),s.get("textStyle"));p&&c.unshift(p);var g=l==="richText"?` `:"
",m=c.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,m,u,Math.random()+"",o[0],o[1],d,null,f)})},e.prototype._showSeriesItemTooltip=function(t,r,i){var a=this._ecModel,o=Bn(r),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,h=o.dataIndex,c=o.dataType,f=u.getData(c),d=this._renderMode,v=t.positionDefault,p=fP([f.getItemModel(h),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,v?{position:v}:null),g=p.get("trigger");if(!(g!=null&&g!=="item")){var m=u.getDataParams(h,c),y=new BH;m.marker=y.makeTooltipMarker("item",KE(m.color),d);var _=Gpe(u.formatTooltip(h,!1,c)),x=p.get("order"),S=p.get("valueFormatter"),w=_.frag,b=w?Hpe(S?Mt({valueFormatter:S},w):w,y,d,x,a.get("useUTC"),p.get("textStyle")):_.text,E="item_"+u.name+"_"+h;this._showOrMove(p,function(){this._showTooltipContent(p,b,m,E,t.offsetX,t.offsetY,t.position,t.target,y)}),i({type:"showTip",dataIndexInside:h,dataIndex:f.getRawIndex(h),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,r,i){var a=Bn(r),o=a.tooltipConfig,s=o.option||{};if(Or(s)){var l=s;s={content:l,formatter:l}}var u=[s],h=this._ecModel.getComponent(a.componentMainType,a.componentIndex);h&&u.push(h),u.push({formatter:s.content});var c=t.positionDefault,f=fP(u,this._tooltipModel,c?{position:c}:null),d=f.get("content"),v=Math.random()+"",p=new BH;this._showOrMove(f,function(){var g=Sn(f.get("formatterParams")||{});this._showTooltipContent(f,d,g,v,t.offsetX,t.offsetY,t.position,r,p)}),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,r,i,a,o,s,l,u,h){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var c=this._tooltipContent;c.setEnterable(t.get("enterable"));var f=t.get("formatter");l=l||t.get("position");var d=r,v=this._getNearestPoint([o,s],i,t.get("trigger"),t.get("borderColor")),p=v.color;if(f)if(Or(f)){var g=t.ecModel.get("useUTC"),m=Gt(i)?i[0]:i,y=m&&m.axisType&&m.axisType.indexOf("time")>=0;d=f,y&&(d=rU(m.axisValue,d,g)),d=Zke(d,i,!0)}else if(rn(f)){var _=kr(function(x,S){x===this._ticket&&(c.setContent(S,h,t,p,l),this._updatePosition(t,l,o,s,c,i,u))},this);this._ticket=a,d=f(i,a,_)}else d=f;c.setContent(d,h,t,p,l),c.show(t,p),this._updatePosition(t,l,o,s,c,i,u)}},e.prototype._getNearestPoint=function(t,r,i,a){if(i==="axis"||Gt(r))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!Gt(r))return{color:a||r.color||r.borderColor}},e.prototype._updatePosition=function(t,r,i,a,o,s,l){var u=this._api.getWidth(),h=this._api.getHeight();r=r||t.get("position");var c=o.getSize(),f=t.get("align"),d=t.get("verticalAlign"),v=l&&l.getBoundingRect().clone();if(l&&v.applyTransform(l.transform),rn(r)&&(r=r([i,a],s,o.el,v,{viewSize:[u,h],contentSize:c.slice()})),Gt(r))i=xr(r[0],u),a=xr(r[1],h);else if(dn(r)){var p=r;p.width=c[0],p.height=c[1];var g=Uu(p,{width:u,height:h});i=g.x,a=g.y,f=null,d=null}else if(Or(r)&&l){var m=tAt(r,v,c,t.get("borderWidth"));i=m[0],a=m[1]}else{var m=QCt(i,a,o,u,h,f?null:20,d?null:20);i=m[0],a=m[1]}if(f&&(i-=t1e(f)?c[0]/2:f==="right"?c[0]:0),d&&(a-=t1e(d)?c[1]/2:d==="bottom"?c[1]:0),SBe(t)){var m=eAt(i,a,o,u,h);i=m[0],a=m[1]}o.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(t,r){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===t.length;return o&&te(i,function(s,l){var u=s.dataByAxis||[],h=t[l]||{},c=h.dataByAxis||[];o=o&&u.length===c.length,o&&te(u,function(f,d){var v=c[d]||{},p=f.seriesDataIndices||[],g=v.seriesDataIndices||[];o=o&&f.value===v.value&&f.axisType===v.axisType&&f.axisId===v.axisId&&p.length===g.length,o&&te(p,function(m,y){var _=g[y];o=o&&m.seriesIndex===_.seriesIndex&&m.dataIndex===_.dataIndex}),a&&te(f.seriesDataIndices,function(m){var y=m.seriesIndex,_=r[y],x=a[y];_&&x&&x.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=r,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,r){sa.node||!r.getDom()||(dD(this,"_updatePosition"),this._tooltipContent.dispose(),tQ("itemTooltip",r))},e.type="tooltip",e}(pl);function fP(n,e,t){var r=e.ecModel,i;t?(i=new as(t,r,r),i=new as(e.option,i,r)):i=e;for(var a=n.length-1;a>=0;a--){var o=n[a];o&&(o instanceof as&&(o=o.get("tooltip",!0)),Or(o)&&(o={formatter:o}),o&&(i=new as(o,i,r)))}return i}function e1e(n,e){return n.dispatchAction||kr(e.dispatchAction,e)}function QCt(n,e,t,r,i,a,o){var s=t.getSize(),l=s[0],u=s[1];return a!=null&&(n+l+a+2>r?n-=l+a:n+=a),o!=null&&(e+u+o>i?e-=u+o:e+=o),[n,e]}function eAt(n,e,t,r,i){var a=t.getSize(),o=a[0],s=a[1];return n=Math.min(n+o,r)-o,e=Math.min(e+s,i)-s,n=Math.max(n,0),e=Math.max(e,0),[n,e]}function tAt(n,e,t,r){var i=t[0],a=t[1],o=Math.ceil(Math.SQRT2*r)+8,s=0,l=0,u=e.width,h=e.height;switch(n){case"inside":s=e.x+u/2-i/2,l=e.y+h/2-a/2;break;case"top":s=e.x+u/2-i/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-i/2,l=e.y+h+o;break;case"left":s=e.x-i-o,l=e.y+h/2-a/2;break;case"right":s=e.x+u+o,l=e.y+h/2-a/2}return[s,l]}function t1e(n){return n==="center"||n==="middle"}function rAt(n,e,t){var r=pie(n).queryOptionMap,i=r.keys()[0];if(!(!i||i==="series")){var a=p3(e,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(!!o){var s=t.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var h=Bn(u).tooltipConfig;if(h&&h.name===n.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}const nAt=JCt;function iAt(n){_i(R3),n.registerComponentModel(FCt),n.registerComponentView(nAt),n.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Hl),n.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Hl)}var aAt=["rect","polygon","keep","clear"];function oAt(n,e){var t=Do(n?n.brush:[]);if(!!t.length){var r=[];te(t,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(r=r.concat(u))});var i=n&&n.toolbox;Gt(i)&&(i=i[0]),i||(i={feature:{}},n.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,r),sAt(s),e&&!s.length&&s.push.apply(s,aAt)}}function sAt(n){var e={};te(n,function(t){e[t]=1}),n.length=0,te(e,function(t,r){n.push(r)})}var r1e=te;function n1e(n){if(n){for(var e in n)if(n.hasOwnProperty(e))return!0}}function sQ(n,e,t){var r={};return r1e(e,function(a){var o=r[a]=i();r1e(n[a],function(s,l){if(!!fc.isValidType(l)){var u={type:l,visual:s};t&&t(u,a),o[l]=new fc(u),l==="opacity"&&(u=Sn(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new fc(u))}})}),r;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function TBe(n,e,t){var r;te(t,function(i){e.hasOwnProperty(i)&&n1e(e[i])&&(r=!0)}),r&&te(t,function(i){e.hasOwnProperty(i)&&n1e(e[i])?n[i]=Sn(e[i]):delete n[i]})}function lAt(n,e,t,r,i,a){var o={};te(n,function(c){var f=fc.prepareVisualTypes(e[c]);o[c]=f});var s;function l(c){return jie(t,s,c)}function u(c,f){UFe(t,s,c,f)}a==null?t.each(h):t.each([a],h);function h(c,f){s=a==null?c:f;var d=t.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var v=r.call(i,c),p=e[v],g=o[v],m=0,y=g.length;me[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&l1e(e)}};function l1e(n){return new ai(n[0][0],n[1][0],n[0][1]-n[0][0],n[1][1]-n[1][0])}var gAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){this.ecModel=t,this.api=r,this.model,(this._brushController=new Rae(r.getZr())).on("brush",kr(this._onBrush,this)).mount()},e.prototype.render=function(t,r,i,a){this.model=t,this._updateController(t,r,i,a)},e.prototype.updateTransform=function(t,r,i,a){CBe(r),this._updateController(t,r,i,a)},e.prototype.updateVisual=function(t,r,i,a){this.updateTransform(t,r,i,a)},e.prototype.updateView=function(t,r,i,a){this._updateController(t,r,i,a)},e.prototype._updateController=function(t,r,i,a){(!a||a.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var r=this.model.id,i=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:r,areas:Sn(i),$from:r}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:r,areas:Sn(i),$from:r})},e.type="brush",e}(pl);const yAt=gAt;var mAt="#ddd",_At=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.areas=[],t.brushOption={},t}return e.prototype.optionUpdated=function(t,r){var i=this.option;!r&&TBe(i,t,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:mAt},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(t){!t||(this.areas=Vt(t,function(r){return u1e(this.option,r)},this))},e.prototype.setBrushOption=function(t){this.brushOption=u1e(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(oa);function u1e(n,e){return ii({brushType:n.brushType,brushMode:n.brushMode,transformable:n.transformable,brushStyle:new as(n.brushStyle).getItemStyle(),removeOnClick:n.removeOnClick,z:n.z},e,!0)}const xAt=_At;var SAt=["rect","polygon","lineX","lineY","keep","clear"],wAt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i){var a,o,s;r.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,te(t.get("type",!0),function(l){t.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(t,r,i){this.render(t,r,i)},e.prototype.getIcons=function(){var t=this.model,r=t.get("icon",!0),i={};return te(t.get("type",!0),function(a){r[a]&&(i[a]=r[a])}),i},e.prototype.onclick=function(t,r,i){var a=this._brushType,o=this._brushMode;i==="clear"?(r.dispatchAction({type:"axisAreaSelect",intervals:[]}),r.dispatchAction({type:"brush",command:"clear",areas:[]})):r.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?o==="multiple"?"single":"multiple":o}})},e.getDefaultOption=function(t){var r={show:!0,type:SAt.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return r},e}(bp);const bAt=wAt;function EAt(n){n.registerComponentView(yAt),n.registerComponentModel(xAt),n.registerPreprocessor(oAt),n.registerVisual(n.PRIORITY.VISUAL.BRUSH,cAt),n.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(r){r.setAreas(e.areas)})}),n.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Hl),n.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Hl),VC("brush",bAt)}var TAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(oa),CAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){if(this.group.removeAll(),!!t.get("show")){var a=this.group,o=t.getModel("textStyle"),s=t.getModel("subtextStyle"),l=t.get("textAlign"),u=ni(t.get("textBaseline"),t.get("textVerticalAlign")),h=new la({style:is(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),c=h.getBoundingRect(),f=t.get("subtext"),d=new la({style:is(s,{text:f,fill:s.getTextColor(),y:c.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),v=t.get("link"),p=t.get("sublink"),g=t.get("triggerEvent",!0);h.silent=!v&&!g,d.silent=!p&&!g,v&&h.on("click",function(){dG(v,"_"+t.get("target"))}),p&&d.on("click",function(){dG(p,"_"+t.get("subtarget"))}),Bn(h).eventData=Bn(d).eventData=g?{componentType:"title",componentIndex:t.componentIndex}:null,a.add(h),f&&a.add(d);var m=a.getBoundingRect(),y=t.getBoxLayoutParams();y.width=m.width,y.height=m.height;var _=Uu(y,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));l||(l=t.get("left")||t.get("right"),l==="middle"&&(l="center"),l==="right"?_.x+=_.width:l==="center"&&(_.x+=_.width/2)),u||(u=t.get("top")||t.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?_.y+=_.height:u==="middle"&&(_.y+=_.height/2),u=u||"top"),a.x=_.x,a.y=_.y,a.markRedraw();var x={align:l,verticalAlign:u};h.setStyle(x),d.setStyle(x),m=a.getBoundingRect();var S=_.margin,w=t.getItemStyle(["color","opacity"]);w.fill=t.get("backgroundColor");var b=new ta({shape:{x:m.x-S[3],y:m.y-S[0],width:m.width+S[1]+S[3],height:m.height+S[0]+S[2],r:t.get("borderRadius")},style:w,subPixelOptimize:!0,silent:!0});a.add(b)}},e.type="title",e}(pl);function AAt(n){n.registerComponentModel(TAt),n.registerComponentView(CAt)}var MAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode="box",t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i),this._initData()},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){t==null&&(t=this.option.currentIndex);var r=this._data.count();this.option.loop?t=(t%r+r)%r:(t>=r&&(t=r-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t=this.option,r=t.data||[],i=t.axisType,a=this._names=[],o;i==="category"?(o=[],te(r,function(u,h){var c=Ru(PI(u),""),f;dn(u)?(f=Sn(u),f.value=h):f=h,o.push(f),a.push(c)})):o=r;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new Df([{name:"value",type:s}],this);l.initData(o,a)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(oa);const h1e=MAt;var ABe=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline.slider",e.defaultOption=xw(h1e.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(h1e);gu(ABe,Uie.prototype);const IAt=ABe;var LAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline",e}(pl);const PAt=LAt;var OAt=function(n){$e(e,n);function e(t,r,i,a){var o=n.call(this,t,r,i)||this;return o.type=a||"value",o}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(D0);const RAt=OAt;var tX=Math.PI,c1e=na(),DAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){this.api=r},e.prototype.render=function(t,r,i){if(this.model=t,this.api=i,this.ecModel=r,this.group.removeAll(),t.get("show",!0)){var a=this._layout(t,i),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,t);t.formatTooltip=function(u){var h=l.scale.getLabel({value:u});return ch("nameValue",{noName:!0,value:h})},te(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,t)},this),this._renderAxisLabel(a,s,l,t),this._position(a,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,r){var i=t.get(["label","position"]),a=t.get("orient"),o=kAt(t,r),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:tX/2},c=a==="vertical"?o.height:o.width,f=t.getModel("controlStyle"),d=f.get("show",!0),v=d?f.get("itemSize"):0,p=d?f.get("itemGap"):0,g=v+p,m=t.get(["label","rotate"])||0;m=m*tX/180;var y,_,x,S=f.get("position",!0),w=d&&f.get("showPlayBtn",!0),b=d&&f.get("showPrevBtn",!0),E=d&&f.get("showNextBtn",!0),T=0,C=c;S==="left"||S==="bottom"?(w&&(y=[0,0],T+=g),b&&(_=[T,0],T+=g),E&&(x=[C-v,0],C-=g)):(w&&(y=[C-v,0],C-=g),b&&(_=[0,0],T+=g),E&&(x=[C-v,0],C-=g));var A=[T,C];return t.get("inverse")&&A.reverse(),{viewRect:o,mainLength:c,orient:a,rotation:h[a],labelRotation:m,labelPosOpt:s,labelAlign:t.get(["label","align"])||l[a],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[a],playPosition:y,prevBtnPosition:_,nextBtnPosition:x,axisExtent:A,controlSize:v,controlGap:p}},e.prototype._position=function(t,r){var i=this._mainGroup,a=this._labelGroup,o=t.viewRect;if(t.orient==="vertical"){var s=Up(),l=o.x,u=o.y+o.height;sm(s,s,[-l,-u]),j2(s,s,-tX/2),sm(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var h=y(o),c=y(i.getBoundingRect()),f=y(a.getBoundingRect()),d=[i.x,i.y],v=[a.x,a.y];v[0]=d[0]=h[0][0];var p=t.labelPosOpt;if(p==null||Or(p)){var g=p==="+"?0:1;_(d,c,h,1,g),_(v,f,h,1,1-g)}else{var g=p>=0?0:1;_(d,c,h,1,g),v[1]=d[1]+p}i.setPosition(d),a.setPosition(v),i.rotation=a.rotation=t.rotation,m(i),m(a);function m(x){x.originX=h[0][0]-x.x,x.originY=h[1][0]-x.y}function y(x){return[[x.x,x.x+x.width],[x.y,x.y+x.height]]}function _(x,S,w,b,E){x[b]+=w[b][E]-S[b][E]}},e.prototype._createAxis=function(t,r){var i=r.getData(),a=r.get("axisType"),o=NAt(r,a);o.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new RAt("value",o,t.axisExtent,a);return l.model=r,l},e.prototype._createGroup=function(t){var r=this[t]=new Cn;return this.group.add(r),r},e.prototype._renderAxisLine=function(t,r,i,a){var o=i.getExtent();if(!!a.get(["lineStyle","show"])){var s=new zh({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:Mt({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});r.add(s);var l=this._progressLine=new zh({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:sn({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});r.add(l)}},e.prototype._renderAxisTick=function(t,r,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],te(l,function(u){var h=i.dataToCoord(u.value),c=s.getItemModel(u.value),f=c.getModel("itemStyle"),d=c.getModel(["emphasis","itemStyle"]),v=c.getModel(["progress","itemStyle"]),p={x:h,y:0,onclick:kr(o._changeTimeline,o,u.value)},g=f1e(c,f,r,p);g.ensureState("emphasis").style=d.getItemStyle(),g.ensureState("progress").style=v.getItemStyle(),CE(g);var m=Bn(g);c.get("tooltip")?(m.dataIndex=u.value,m.dataModel=a):m.dataIndex=m.dataModel=null,o._tickSymbols.push(g)})},e.prototype._renderAxisLabel=function(t,r,i,a){var o=this,s=i.getLabelModel();if(!!s.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],te(u,function(h){var c=h.tickValue,f=l.getItemModel(c),d=f.getModel("label"),v=f.getModel(["emphasis","label"]),p=f.getModel(["progress","label"]),g=i.dataToCoord(h.tickValue),m=new la({x:g,y:0,rotation:t.labelRotation-t.rotation,onclick:kr(o._changeTimeline,o,c),silent:!1,style:is(d,{text:h.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});m.ensureState("emphasis").style=is(v),m.ensureState("progress").style=is(p),r.add(m),CE(m),c1e(m).dataIndex=c,o._tickLabels.push(m)})}},e.prototype._renderControl=function(t,r,i,a){var o=t.controlSize,s=t.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),h=a.getPlayState(),c=a.get("inverse",!0);f(t.nextBtnPosition,"next",kr(this._changeTimeline,this,c?"-":"+")),f(t.prevBtnPosition,"prev",kr(this._changeTimeline,this,c?"+":"-")),f(t.playPosition,h?"stop":"play",kr(this._handlePlayClick,this,!h),!0);function f(d,v,p,g){if(!!d){var m=_0(ni(a.get(["controlStyle",v+"BtnSize"]),o),o),y=[0,-m/2,m,m],_=FAt(a,v+"Icon",y,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:g?-s:0,rectHover:!0,style:l,onclick:p});_.ensureState("emphasis").style=u,r.add(_),CE(_)}}},e.prototype._renderCurrentPointer=function(t,r,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,h={onCreate:function(c){c.draggable=!0,c.drift=kr(u._handlePointerDrag,u),c.ondragend=kr(u._handlePointerDragend,u),d1e(c,u._progressLine,s,i,a,!0)},onUpdate:function(c){d1e(c,u._progressLine,s,i,a)}};this._currentPointer=f1e(l,l,this._mainGroup,{},this._currentPointer,h)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,r,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,r){var i=this._toAxisCoord(t)[0],a=this._axis,o=Op(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(o[a]=+o[a].toFixed(f)),[o,c]}var rX={min:Un(U4,"min"),max:Un(U4,"max"),average:Un(U4,"average"),median:Un(U4,"median")};function CD(n,e){if(!!e){var t=n.getData(),r=n.coordinateSystem,i=r&&r.dimensions;if(!HAt(e)&&!Gt(e.coord)&&Gt(i)){var a=IBe(e,t,r,n);if(e=Sn(e),e.type&&rX[e.type]&&a.baseAxis&&a.valueAxis){var o=gi(i,a.baseAxis.dim),s=gi(i,a.valueAxis.dim),l=rX[e.type](t,a.baseDataDim,a.valueDataDim,o,s);e.coord=l[0],e.value=l[1]}else e.coord=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis]}if(e.coord==null||!Gt(i))e.coord=[];else for(var u=e.coord,h=0;h<2;h++)rX[u[h]]&&(u[h]=noe(t,t.mapDimension(i[h]),u[h]));return e}}function IBe(n,e,t,r){var i={};return n.valueIndex!=null||n.valueDim!=null?(i.valueDataDim=n.valueIndex!=null?e.getDimension(n.valueIndex):n.valueDim,i.valueAxis=t.getAxis(jAt(r,i.valueDataDim)),i.baseAxis=t.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=t.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function jAt(n,e){var t=n.getData().getDimensionInfo(e);return t&&t.coordDim}function AD(n,e){return n&&n.containData&&e.coord&&!uQ(e)?n.containData(e.coord):!0}function XAt(n,e,t){return n&&n.containZone&&e.coord&&t.coord&&!uQ(e)&&!uQ(t)?n.containZone(e.coord,t.coord):!0}function LBe(n,e){return n?function(t,r,i,a){var o=a<2?t.coord&&t.coord[a]:t.value;return _S(o,e[a])}:function(t,r,i,a){return _S(t.value,e[a])}}function noe(n,e,t){if(t==="average"){var r=0,i=0;return n.each(e,function(a,o){isNaN(a)||(r+=a,i++)}),r/i}else return t==="median"?n.getMedian(e):n.getDataExtent(e)[t==="max"?1:0]}var nX=na(),YAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this.markerGroupMap=$r()},e.prototype.render=function(t,r,i){var a=this,o=this.markerGroupMap;o.each(function(s){nX(s).keep=!1}),r.eachSeries(function(s){var l=US.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,r,i)}),o.each(function(s){!nX(s).keep&&a.group.remove(s.group)})},e.prototype.markKeep=function(t){nX(t).keep=!0},e.prototype.toggleBlurSeries=function(t,r){var i=this;te(t,function(a){var o=US.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(r?nke(l):Sie(l))})}})},e.type="marker",e}(pl);const ioe=YAt;function p1e(n,e,t){var r=e.coordinateSystem;n.each(function(i){var a=n.getItemModel(i),o,s=xr(a.get("x"),t.getWidth()),l=xr(a.get("y"),t.getHeight());if(!isNaN(s)&&!isNaN(l))o=[s,l];else if(e.getMarkerPosition)o=e.getMarkerPosition(n.getValues(n.dimensions,i));else if(r){var u=n.get(r.dimensions[0],i),h=n.get(r.dimensions[1],i);o=r.dataToPoint([u,h])}isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),n.setItemLayout(i,o)})}var qAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var o=US.getMarkerModelFromSeries(a,"markPoint");o&&(p1e(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(t,r,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,new A3),c=ZAt(o,t,r);r.setData(c),p1e(r.getData(),t,a),c.each(function(f){var d=c.getItemModel(f),v=d.getShallow("symbol"),p=d.getShallow("symbolSize"),g=d.getShallow("symbolRotate"),m=d.getShallow("symbolOffset"),y=d.getShallow("symbolKeepAspect");if(rn(v)||rn(p)||rn(g)||rn(m)){var _=r.getRawValue(f),x=r.getDataParams(f);rn(v)&&(v=v(_,x)),rn(p)&&(p=p(_,x)),rn(g)&&(g=g(_,x)),rn(m)&&(m=m(_,x))}var S=d.getModel("itemStyle").getItemStyle(),w=w3(l,"color");S.fill||(S.fill=w),c.setItemVisual(f,{symbol:v,symbolSize:p,symbolRotate:g,symbolOffset:m,symbolKeepAspect:y,style:S})}),h.updateData(c),this.group.add(h.group),c.eachItemGraphicEl(function(f){f.traverse(function(d){Bn(d).dataModel=r})}),this.markKeep(h),h.group.silent=r.get("silent")||t.get("silent")},e.type="markPoint",e}(ioe);function ZAt(n,e,t){var r;n?r=Vt(n&&n.dimensions,function(s){var l=e.getData().getDimensionInfo(e.getData().mapDimension(s))||{};return Mt(Mt({},l),{name:s,ordinalMeta:null})}):r=[{name:"value",type:"float"}];var i=new Df(r,t),a=Vt(t.get("data"),Un(CD,e));n&&(a=To(a,Un(AD,n)));var o=LBe(!!n,r);return i.initData(a,null,o),i}const KAt=qAt;function JAt(n){n.registerComponentModel(WAt),n.registerComponentView(KAt),n.registerPreprocessor(function(e){roe(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var QAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,r,i){return new e(t,r,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(US);const eMt=QAt;var V4=na(),tMt=function(n,e,t,r){var i=n.getData(),a;if(Gt(r))a=r;else{var o=r.type;if(o==="min"||o==="max"||o==="average"||o==="median"||r.xAxis!=null||r.yAxis!=null){var s=void 0,l=void 0;if(r.yAxis!=null||r.xAxis!=null)s=e.getAxis(r.yAxis!=null?"y":"x"),l=Gh(r.yAxis,r.xAxis);else{var u=IBe(r,i,e,n);s=u.valueAxis;var h=g4e(i,u.valueDataDim);l=noe(i,h,o)}var c=s.dim==="x"?0:1,f=1-c,d=Sn(r),v={coord:[]};d.type=null,d.coord=[],d.coord[f]=-1/0,v.coord[f]=1/0;var p=t.get("precision");p>=0&&ha(l)&&(l=+l.toFixed(Math.min(p,20))),d.coord[c]=v.coord[c]=l,a=[d,v,{type:o,valueIndex:r.valueIndex,value:l}]}else a=[]}var g=[CD(n,a[0]),CD(n,a[1]),Mt({},a[2])];return g[2].type=g[2].type||null,ii(g[2],g[0]),ii(g[2],g[1]),g};function GG(n){return!isNaN(n)&&!isFinite(n)}function g1e(n,e,t,r){var i=1-n,a=r.dimensions[n];return GG(e[i])&&GG(t[i])&&e[n]===t[n]&&r.getAxis(a).containData(e[n])}function rMt(n,e){if(n.type==="cartesian2d"){var t=e[0].coord,r=e[1].coord;if(t&&r&&(g1e(1,t,r,n)||g1e(0,t,r,n)))return!0}return AD(n,e[0])&&AD(n,e[1])}function iX(n,e,t,r,i){var a=r.coordinateSystem,o=n.getItemModel(e),s,l=xr(o.get("x"),i.getWidth()),u=xr(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(r.getMarkerPosition)s=r.getMarkerPosition(n.getValues(n.dimensions,e));else{var h=a.dimensions,c=n.get(h[0],e),f=n.get(h[1],e);s=a.dataToPoint([c,f])}if(Z2(a,"cartesian2d")){var d=a.getAxis("x"),v=a.getAxis("y"),h=a.dimensions;GG(n.get(h[0],e))?s[0]=d.toGlobalCoord(d.getExtent()[t?0:1]):GG(n.get(h[1],e))&&(s[1]=v.toGlobalCoord(v.getExtent()[t?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}n.setItemLayout(e,s)}var nMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var o=US.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=V4(o).from,u=V4(o).to;l.each(function(h){iX(l,h,!0,a,i),iX(u,h,!1,a,i)}),s.each(function(h){s.setItemLayout(h,[l.getItemLayout(h),u.getItemLayout(h)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,r,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,new Aae);this.group.add(h.group);var c=iMt(o,t,r),f=c.from,d=c.to,v=c.line;V4(r).from=f,V4(r).to=d,r.setData(v);var p=r.get("symbol"),g=r.get("symbolSize"),m=r.get("symbolRotate"),y=r.get("symbolOffset");Gt(p)||(p=[p,p]),Gt(g)||(g=[g,g]),Gt(m)||(m=[m,m]),Gt(y)||(y=[y,y]),c.from.each(function(x){_(f,x,!0),_(d,x,!1)}),v.each(function(x){var S=v.getItemModel(x).getModel("lineStyle").getLineStyle();v.setItemLayout(x,[f.getItemLayout(x),d.getItemLayout(x)]),S.stroke==null&&(S.stroke=f.getItemVisual(x,"style").fill),v.setItemVisual(x,{fromSymbolKeepAspect:f.getItemVisual(x,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(x,"symbolOffset"),fromSymbolRotate:f.getItemVisual(x,"symbolRotate"),fromSymbolSize:f.getItemVisual(x,"symbolSize"),fromSymbol:f.getItemVisual(x,"symbol"),toSymbolKeepAspect:d.getItemVisual(x,"symbolKeepAspect"),toSymbolOffset:d.getItemVisual(x,"symbolOffset"),toSymbolRotate:d.getItemVisual(x,"symbolRotate"),toSymbolSize:d.getItemVisual(x,"symbolSize"),toSymbol:d.getItemVisual(x,"symbol"),style:S})}),h.updateData(v),c.line.eachItemGraphicEl(function(x){Bn(x).dataModel=r,x.traverse(function(S){Bn(S).dataModel=r})});function _(x,S,w){var b=x.getItemModel(S);iX(x,S,w,t,a);var E=b.getModel("itemStyle").getItemStyle();E.fill==null&&(E.fill=w3(l,"color")),x.setItemVisual(S,{symbolKeepAspect:b.get("symbolKeepAspect"),symbolOffset:ni(b.get("symbolOffset",!0),y[w?0:1]),symbolRotate:ni(b.get("symbolRotate",!0),m[w?0:1]),symbolSize:ni(b.get("symbolSize"),g[w?0:1]),symbol:ni(b.get("symbol",!0),p[w?0:1]),style:E})}this.markKeep(h),h.group.silent=r.get("silent")||t.get("silent")},e.type="markLine",e}(ioe);function iMt(n,e,t){var r;n?r=Vt(n&&n.dimensions,function(u){var h=e.getData().getDimensionInfo(e.getData().mapDimension(u))||{};return Mt(Mt({},h),{name:u,ordinalMeta:null})}):r=[{name:"value",type:"float"}];var i=new Df(r,t),a=new Df(r,t),o=new Df([],t),s=Vt(t.get("data"),Un(tMt,e,n,t));n&&(s=To(s,Un(rMt,n)));var l=LBe(!!n,r);return i.initData(Vt(s,function(u){return u[0]}),null,l),a.initData(Vt(s,function(u){return u[1]}),null,l),o.initData(Vt(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}const aMt=nMt;function oMt(n){n.registerComponentModel(eMt),n.registerComponentView(aMt),n.registerPreprocessor(function(e){roe(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var sMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,r,i){return new e(t,r,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(US);const lMt=sMt;var $4=na(),uMt=function(n,e,t,r){var i=r[0],a=r[1];if(!(!i||!a)){var o=CD(n,i),s=CD(n,a),l=o.coord,u=s.coord;l[0]=Gh(l[0],-1/0),l[1]=Gh(l[1],-1/0),u[0]=Gh(u[0],1/0),u[1]=Gh(u[1],1/0);var h=nie([{},o,s]);return h.coord=[o.coord,s.coord],h.x0=o.x,h.y0=o.y,h.x1=s.x,h.y1=s.y,h}};function zG(n){return!isNaN(n)&&!isFinite(n)}function y1e(n,e,t,r){var i=1-n;return zG(e[i])&&zG(t[i])}function hMt(n,e){var t=e.coord[0],r=e.coord[1],i={coord:t,x:e.x0,y:e.y0},a={coord:r,x:e.x1,y:e.y1};return Z2(n,"cartesian2d")?t&&r&&(y1e(1,t,r)||y1e(0,t,r))?!0:XAt(n,i,a):AD(n,i)||AD(n,a)}function m1e(n,e,t,r,i){var a=r.coordinateSystem,o=n.getItemModel(e),s,l=xr(o.get(t[0]),i.getWidth()),u=xr(o.get(t[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(r.getMarkerPosition){var h=n.getValues(["x0","y0"],e),c=n.getValues(["x1","y1"],e),f=a.clampData(h),d=a.clampData(c),v=[];t[0]==="x0"?v[0]=f[0]>d[0]?c[0]:h[0]:v[0]=f[0]>d[0]?h[0]:c[0],t[1]==="y0"?v[1]=f[1]>d[1]?c[1]:h[1]:v[1]=f[1]>d[1]?h[1]:c[1],s=r.getMarkerPosition(v,t,!0)}else{var p=n.get(t[0],e),g=n.get(t[1],e),m=[p,g];a.clampData&&a.clampData(m,m),s=a.dataToPoint(m,!0)}if(Z2(a,"cartesian2d")){var y=a.getAxis("x"),_=a.getAxis("y"),p=n.get(t[0],e),g=n.get(t[1],e);zG(p)?s[0]=y.toGlobalCoord(y.getExtent()[t[0]==="x0"?0:1]):zG(g)&&(s[1]=_.toGlobalCoord(_.getExtent()[t[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var _1e=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],cMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var o=US.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=Vt(_1e,function(c){return m1e(s,l,c,a,i)});s.setItemLayout(l,u);var h=s.getItemGraphicEl(l);h.setShape("points",u)})}},this)},e.prototype.renderSeries=function(t,r,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,{group:new Cn});this.group.add(h.group),this.markKeep(h);var c=fMt(o,t,r);r.setData(c),c.each(function(f){var d=Vt(_1e,function(E){return m1e(c,f,E,t,a)}),v=o.getAxis("x").scale,p=o.getAxis("y").scale,g=v.getExtent(),m=p.getExtent(),y=[v.parse(c.get("x0",f)),v.parse(c.get("x1",f))],_=[p.parse(c.get("y0",f)),p.parse(c.get("y1",f))];Op(y),Op(_);var x=!(g[0]>y[1]||g[1]_[1]||m[1]<_[0]),S=!x;c.setItemLayout(f,{points:d,allClipped:S});var w=c.getItemModel(f).getModel("itemStyle").getItemStyle(),b=w3(l,"color");w.fill||(w.fill=b,Or(w.fill)&&(w.fill=eG(w.fill,.4))),w.stroke||(w.stroke=b),c.setItemVisual(f,"style",w)}),c.diff($4(h).data).add(function(f){var d=c.getItemLayout(f);if(!d.allClipped){var v=new bd({shape:{points:d.points}});c.setItemGraphicEl(f,v),h.group.add(v)}}).update(function(f,d){var v=$4(h).data.getItemGraphicEl(d),p=c.getItemLayout(f);p.allClipped?v&&h.group.remove(v):(v?ma(v,{shape:{points:p.points}},r,f):v=new bd({shape:{points:p.points}}),c.setItemGraphicEl(f,v),h.group.add(v))}).remove(function(f){var d=$4(h).data.getItemGraphicEl(f);h.group.remove(d)}).execute(),c.eachItemGraphicEl(function(f,d){var v=c.getItemModel(d),p=c.getItemVisual(d,"style");f.useStyle(c.getItemVisual(d,"style")),vc(f,hh(v),{labelFetcher:r,labelDataIndex:d,defaultText:c.getName(d)||"",inheritColor:Or(p.fill)?eG(p.fill,1):"#000"}),dc(f,v),vl(f,null,null,v.get(["emphasis","disabled"])),Bn(f).dataModel=r}),$4(h).data=c,h.group.silent=r.get("silent")||t.get("silent")},e.type="markArea",e}(ioe);function fMt(n,e,t){var r,i,a=["x0","y0","x1","y1"];if(n){var o=Vt(n&&n.dimensions,function(u){var h=e.getData(),c=h.getDimensionInfo(h.mapDimension(u))||{};return Mt(Mt({},c),{name:u,ordinalMeta:null})});i=Vt(a,function(u,h){return{name:u,type:o[h%2].type}}),r=new Df(i,t)}else i=[{name:"value",type:"float"}],r=new Df(i,t);var s=Vt(t.get("data"),Un(uMt,e,n,t));n&&(s=To(s,Un(hMt,n)));var l=n?function(u,h,c,f){var d=u.coord[Math.floor(f/2)][f%2];return _S(d,i[f])}:function(u,h,c,f){return _S(u.value,i[f])};return r.initData(s,null,l),r.hasItemOption=!0,r}const dMt=cMt;function vMt(n){n.registerComponentModel(lMt),n.registerComponentView(dMt),n.registerPreprocessor(function(e){roe(e.series,"markArea")&&(e.markArea=e.markArea||{})})}var pMt=function(n,e){if(e==="all")return{type:"all",title:n.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:n.getLocaleModel().get(["legend","selector","inverse"])}},gMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(t,r){n.prototype.mergeOption.call(this,t,r),this._updateSelector(t)},e.prototype._updateSelector=function(t){var r=t.selector,i=this.ecModel;r===!0&&(r=t.selector=["all","inverse"]),Gt(r)&&te(r,function(a,o){Or(a)&&(a={type:a}),r[o]=ii(a,pMt(i,a.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&this.get("selectedMode")==="single"){for(var r=!1,i=0;i=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(oa);const hQ=gMt;var nC=Un,cQ=te,W4=Cn,yMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!1,t}return e.prototype.init=function(){this.group.add(this._contentGroup=new W4),this.group.add(this._selectorGroup=new W4),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,r,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!t.get("show",!0)){var o=t.get("align"),s=t.get("orient");(!o||o==="auto")&&(o=t.get("left")==="right"&&s==="vertical"?"right":"left");var l=t.get("selector",!0),u=t.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,t,r,i,l,s,u);var h=t.getBoxLayoutParams(),c={width:i.getWidth(),height:i.getHeight()},f=t.get("padding"),d=Uu(h,c,f),v=this.layoutInner(t,o,d,a,l,u),p=Uu(sn({width:v.width,height:v.height},h),c,f);this.group.x=p.x-v.x,this.group.y=p.y-v.y,this.group.markRedraw(),this.group.add(this._backgroundEl=mBe(v,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,r,i,a,o,s,l){var u=this.getContentGroup(),h=$r(),c=r.get("selectedMode"),f=[];i.eachRawSeries(function(d){!d.get("legendHoverLink")&&f.push(d.id)}),cQ(r.getData(),function(d,v){var p=d.get("name");if(!this.newlineDisabled&&(p===""||p===` `)){var g=new W4;g.newline=!0,u.add(g);return}var m=i.getSeriesByName(p)[0];if(!h.get(p))if(m){var y=m.getData(),_=y.getVisual("legendLineStyle")||{},x=y.getVisual("legendIcon"),S=y.getVisual("style"),w=this._createItem(m,p,v,d,r,t,_,S,x,c,a);w.on("click",nC(x1e,p,null,a,f)).on("mouseover",nC(fQ,m.name,null,a,f)).on("mouseout",nC(dQ,m.name,null,a,f)),h.set(p,!0)}else i.eachRawSeries(function(b){if(!h.get(p)&&b.legendVisualProvider){var E=b.legendVisualProvider;if(!E.containName(p))return;var T=E.indexOfName(p),C=E.getItemVisual(T,"style"),A=E.getItemVisual(T,"legendIcon"),M=gv(C.fill);M&&M[3]===0&&(M[3]=.2,C=Mt(Mt({},C),{fill:W1(M,"rgba")}));var I=this._createItem(b,p,v,d,r,t,{},C,A,c,a);I.on("click",nC(x1e,null,p,a,f)).on("mouseover",nC(fQ,null,p,a,f)).on("mouseout",nC(dQ,null,p,a,f)),h.set(p,!0)}},this)},this),o&&this._createSelector(o,r,a,s,l)},e.prototype._createSelector=function(t,r,i,a,o){var s=this.getSelectorGroup();cQ(t,function(u){var h=u.type,c=new la({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:h==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(c);var f=r.getModel("selectorLabel"),d=r.getModel(["emphasis","selectorLabel"]);vc(c,{normal:f,emphasis:d},{defaultText:u.title}),CE(c)})},e.prototype._createItem=function(t,r,i,a,o,s,l,u,h,c,f){var d=t.visualDrawType,v=o.get("itemWidth"),p=o.get("itemHeight"),g=o.isSelected(r),m=a.get("symbolRotate"),y=a.get("symbolKeepAspect"),_=a.get("icon");h=_||h||"roundRect";var x=mMt(h,a,l,u,d,g,f),S=new W4,w=a.getModel("textStyle");if(rn(t.getLegendIcon)&&(!_||_==="inherit"))S.add(t.getLegendIcon({itemWidth:v,itemHeight:p,icon:h,iconRotate:m,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}));else{var b=_==="inherit"&&t.getData().getVisual("symbol")?m==="inherit"?t.getData().getVisual("symbolRotate"):m:0;S.add(_Mt({itemWidth:v,itemHeight:p,icon:h,iconRotate:b,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}))}var E=s==="left"?v+5:-5,T=s,C=o.get("formatter"),A=r;Or(C)&&C?A=C.replace("{name}",r!=null?r:""):rn(C)&&(A=C(r));var M=g?w.getTextColor():a.get("inactiveColor");S.add(new la({style:is(w,{text:A,x:E,y:p/2,fill:M,align:T,verticalAlign:"middle"},{inheritColor:M})}));var I=new ta({shape:S.getBoundingRect(),invisible:!0}),R=a.getModel("tooltip");return R.get("show")&&DI({el:I,componentModel:o,itemName:r,itemTooltipOption:R.option}),S.add(I),S.eachChild(function(k){k.silent=!0}),I.silent=!c,this.getContentGroup().add(S),CE(S),S.__legendDataIndex=i,S},e.prototype.layoutInner=function(t,r,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();ME(t.get("orient"),l,t.get("itemGap"),i.width,i.height);var h=l.getBoundingRect(),c=[-h.x,-h.y];if(u.markRedraw(),l.markRedraw(),o){ME("horizontal",u,t.get("selectorItemGap",!0));var f=u.getBoundingRect(),d=[-f.x,-f.y],v=t.get("selectorButtonGap",!0),p=t.getOrient().index,g=p===0?"width":"height",m=p===0?"height":"width",y=p===0?"y":"x";s==="end"?d[p]+=h[g]+v:c[p]+=f[g]+v,d[1-p]+=h[m]/2-f[m]/2,u.x=d[0],u.y=d[1],l.x=c[0],l.y=c[1];var _={x:0,y:0};return _[g]=h[g]+v+f[g],_[m]=Math.max(h[m],f[m]),_[y]=Math.min(0,f[y]+d[1-p]),_}else return l.x=c[0],l.y=c[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(pl);function mMt(n,e,t,r,i,a,o){function s(g,m){g.lineWidth==="auto"&&(g.lineWidth=m.lineWidth>0?2:0),cQ(g,function(y,_){g[_]==="inherit"&&(g[_]=m[_])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=n.lastIndexOf("empty",0)===0?"fill":"stroke",c=l.getShallow("decal");u.decal=!c||c==="inherit"?r.decal:vM(c,o),u.fill==="inherit"&&(u.fill=r[i]),u.stroke==="inherit"&&(u.stroke=r[h]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?r:t).opacity),s(u,r);var f=e.getModel("lineStyle"),d=f.getLineStyle();if(s(d,t),u.fill==="auto"&&(u.fill=r.fill),u.stroke==="auto"&&(u.stroke=r.fill),d.stroke==="auto"&&(d.stroke=r.fill),!a){var v=e.get("inactiveBorderWidth"),p=u[h];u.lineWidth=v==="auto"?r.lineWidth>0&&p?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),d.stroke=f.get("inactiveColor"),d.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function _Mt(n){var e=n.icon||"roundRect",t=hu(e,0,0,n.itemWidth,n.itemHeight,n.itemStyle.fill,n.symbolKeepAspect);return t.setStyle(n.itemStyle),t.rotation=(n.iconRotate||0)*Math.PI/180,t.setOrigin([n.itemWidth/2,n.itemHeight/2]),e.indexOf("empty")>-1&&(t.style.stroke=t.style.fill,t.style.fill="#fff",t.style.lineWidth=2),t}function x1e(n,e,t,r){dQ(n,e,t,r),t.dispatchAction({type:"legendToggleSelect",name:n!=null?n:e}),fQ(n,e,t,r)}function PBe(n){for(var e=n.getZr().storage.getDisplayList(),t,r=0,i=e.length;ri[o],g=[-d.x,-d.y];r||(g[a]=h[u]);var m=[0,0],y=[-v.x,-v.y],_=ni(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(p){var x=t.get("pageButtonPosition",!0);x==="end"?y[a]+=i[o]-v[o]:m[a]+=v[o]+_}y[1-a]+=d[s]/2-v[s]/2,h.setPosition(g),c.setPosition(m),f.setPosition(y);var S={x:0,y:0};if(S[o]=p?i[o]:d[o],S[s]=Math.max(d[s],v[s]),S[l]=Math.min(0,v[l]+y[1-a]),c.__rectSize=i[o],p){var w={x:0,y:0};w[o]=Math.max(i[o]-v[o]-_,0),w[s]=S[s],c.setClipPath(new ta({shape:w})),c.__rectSize=w[o]}else f.eachChild(function(E){E.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(t);return b.pageIndex!=null&&ma(h,{x:b.contentPosition[0],y:b.contentPosition[1]},p?t:null),this._updatePageInfoView(t,b),S},e.prototype._pageGo=function(t,r,i){var a=this._getPageInfo(r)[t];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:r.id})},e.prototype._updatePageInfoView=function(t,r){var i=this._controllerGroup;te(["pagePrev","pageNext"],function(h){var c=h+"DataIndex",f=r[c]!=null,d=i.childOfName(h);d&&(d.setStyle("fill",f?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),d.cursor=f?"pointer":"default")});var a=i.childOfName("pageText"),o=t.get("pageFormatter"),s=r.pageIndex,l=s!=null?s+1:0,u=r.pageCount;a&&o&&a.setStyle("text",Or(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(t){var r=t.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=t.getOrient().index,s=aX[o],l=oX[o],u=this._findTargetItemIndex(r),h=i.children(),c=h[u],f=h.length,d=f?1:0,v={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return v;var p=x(c);v.contentPosition[o]=-p.s;for(var g=u+1,m=p,y=p,_=null;g<=f;++g)_=x(h[g]),(!_&&y.e>m.s+a||_&&!S(_,m.s))&&(y.i>m.i?m=y:m=_,m&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=m.i),++v.pageCount)),y=_;for(var g=u-1,m=p,y=p,_=null;g>=-1;--g)_=x(h[g]),(!_||!S(y,_.s))&&m.i=b&&w.s<=b+a}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var r,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===t&&(r=s)}),r!=null?r:a},e.type="legend.scroll",e}(OBe);const TMt=EMt;function CMt(n){n.registerAction("legendScroll","legendscroll",function(e,t){var r=e.scrollDataIndex;r!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(i){i.setScrollDataIndex(r)})})}function AMt(n){_i(RBe),n.registerComponentModel(bMt),n.registerComponentView(TMt),CMt(n)}function MMt(n){_i(RBe),_i(AMt)}var IMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.inside",e.defaultOption=xw(TD.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(TD);const LMt=IMt;var aoe=na();function PMt(n,e,t){aoe(n).coordSysRecordMap.each(function(r){var i=r.dataZoomInfoMap.get(e.uid);i&&(i.getRange=t)})}function OMt(n,e){for(var t=aoe(n).coordSysRecordMap,r=t.keys(),i=0;ir[t+e]&&(e=s),i=i&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}function FMt(n){n.registerProcessor(n.PRIORITY.PROCESSOR.FILTER,function(e,t){var r=aoe(t),i=r.coordSysRecordMap||(r.coordSysRecordMap=$r());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=pBe(a);te(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,RMt(t,s.model)),h=u.dataZoomInfoMap||(u.dataZoomInfoMap=$r());h.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){DBe(i,a);return}var h=kMt(l);o.enable(h.controlType,h.opt),o.setPointerChecker(a.containsPoint),VI(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var BMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return e.prototype.render=function(t,r,i){if(n.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),PMt(i,t,{pan:kr(sX.pan,this),zoom:kr(sX.zoom,this),scrollMove:kr(sX.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),n.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){OMt(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(Zae),sX={zoom:function(n,e,t,r){var i=this.range,a=i.slice(),o=n.axisModels[0];if(!!o){var s=lX[e](null,[r.originX,r.originY],o,t,n),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/r.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(J2(0,a,[0,100],0,h.minSpan,h.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:b1e(function(n,e,t,r,i,a){var o=lX[r]([a.oldX,a.oldY],[a.newX,a.newY],e,i,t);return o.signal*(n[1]-n[0])*o.pixel/o.pixelLength}),scrollMove:b1e(function(n,e,t,r,i,a){var o=lX[r]([0,0],[a.scrollDelta,a.scrollDelta],e,i,t);return o.signal*(n[1]-n[0])*a.scrollDelta})};function b1e(n){return function(e,t,r,i){var a=this.range,o=a.slice(),s=e.axisModels[0];if(!!s){var l=n(o,s,e,t,r,i);if(J2(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var lX={grid:function(n,e,t,r,i){var a=t.axis,o={},s=i.model.coordinateSystem.getRect();return n=n||[0,0],a.dim==="x"?(o.pixel=e[0]-n[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-n[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(n,e,t,r,i){var a=t.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return n=n?s.pointToCoord(n):[0,0],e=s.pointToCoord(e),t.mainType==="radiusAxis"?(o.pixel=e[0]-n[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-n[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(n,e,t,r,i){var a=t.axis,o=i.model.coordinateSystem.getRect(),s={};return n=n||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-n[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-n[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};const GMt=BMt;function NBe(n){Kae(n),n.registerComponentModel(LMt),n.registerComponentView(GMt),FMt(n)}var zMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=xw(TD.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(TD);const UMt=zMt;var pP=ta,E1e=7,VMt=1,uX=30,$Mt=7,gP="horizontal",T1e="vertical",WMt=5,HMt=["line","bar","candlestick","scatter"],jMt={easing:"cubicOut",duration:100,delay:0},XMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._displayables={},t}return e.prototype.init=function(t,r){this.api=r,this._onBrush=kr(this._onBrush,this),this._onBrushEnd=kr(this._onBrushEnd,this)},e.prototype.render=function(t,r,i,a){if(n.prototype.render.apply(this,arguments),VI(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),t.get("show")===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),n.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){dD(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var r=this._displayables.sliderGroup=new Cn;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(r),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,r=this.api,i=t.get("brushSelect"),a=i?$Mt:0,o=this._findCoordRect(),s={width:r.getWidth(),height:r.getHeight()},l=this._orient===gP?{right:s.width-o.x-o.width,top:s.height-uX-E1e-a,width:o.width,height:uX}:{right:E1e,top:o.y,width:uX,height:o.height},u=BI(t.option);te(["right","top","width","height"],function(c){u[c]==="ph"&&(u[c]=l[c])});var h=Uu(u,s);this._location={x:h.x,y:h.y},this._size=[h.width,h.height],this._orient===T1e&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,r=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===gP&&!o?{scaleY:l?1:-1,scaleX:1}:i===gP&&o?{scaleY:l?1:-1,scaleX:-1}:i===T1e&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=t.getBoundingRect([s]);t.x=r.x-u.x,t.y=r.y-u.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,r=this._size,i=this._displayables.sliderGroup,a=t.get("brushSelect");i.add(new pP({silent:!0,shape:{x:0,y:0,width:r[0],height:r[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var o=new pP({shape:{x:0,y:0,width:r[0],height:r[1]},style:{fill:"transparent"},z2:0,onclick:kr(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!t)return;var r=this._size,i=this._shadowSize||[],a=t.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():t.otherDim;if(l==null)return;var u=this._shadowPolygonPts,h=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||r[0]!==i[0]||r[1]!==i[1]){var c=o.getDataExtent(l),f=(c[1]-c[0])*.3;c=[c[0]-f,c[1]+f];var d=[0,r[1]],v=[0,r[0]],p=[[r[0],0],[0,0]],g=[],m=v[1]/(o.count()-1),y=0,_=Math.round(o.count()/r[0]),x;o.each([l],function(T,C){if(_>0&&C%_){y+=m;return}var A=T==null||isNaN(T)||T==="",M=A?0:go(T,c,d,!0);A&&!x&&C?(p.push([p[p.length-1][0],0]),g.push([g[g.length-1][0],0])):!A&&x&&(p.push([y,0]),g.push([y,0])),p.push([y,M]),g.push([y,M]),y+=m,x=A}),u=this._shadowPolygonPts=p,h=this._shadowPolylinePts=g}this._shadowData=o,this._shadowDim=l,this._shadowSize=[r[0],r[1]];var S=this.dataZoomModel;function w(T){var C=S.getModel(T?"selectedDataBackground":"dataBackground"),A=new Cn,M=new bd({shape:{points:u},segmentIgnoreThreshold:1,style:C.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),I=new Gd({shape:{points:h},segmentIgnoreThreshold:1,style:C.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return A.add(M),A.add(I),A}for(var b=0;b<3;b++){var E=w(b===1);this._displayables.sliderGroup.add(E),this._displayables.dataShadowSegs.push(E)}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,r=t.get("showDataShadow");if(r!==!1){var i,a=this.ecModel;return t.eachTargetAxis(function(o,s){var l=t.getAxisProxy(o,s).getTargetSeriesModels();te(l,function(u){if(!i&&!(r!==!0&&gi(HMt,u.get("type"))<0)){var h=a.getComponent(iS(o),s).axis,c=YMt(o),f,d=u.coordinateSystem;c!=null&&d.getOtherAxis&&(f=d.getOtherAxis(h).inverse),c=u.getData().mapDimension(c),i={thisAxis:h,series:u,thisDim:o,otherDim:c,otherAxisInverse:f}}},this)},this),i}},e.prototype._renderHandle=function(){var t=this.group,r=this._displayables,i=r.handles=[null,null],a=r.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,h=l.get("borderRadius")||0,c=l.get("brushSelect"),f=r.filler=new pP({silent:c,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new pP({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:h},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:VMt,fill:"rgba(0,0,0,0)"}})),te([0,1],function(_){var x=l.get("handleIcon");!gG[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var S=hu(x,-1,0,2,2,null,!0);S.attr({cursor:C1e(this._orient),draggable:!0,drift:kr(this._onDragMove,this,_),ondragend:kr(this._onDragEnd,this),onmouseover:kr(this._showDataInfo,this,!0),onmouseout:kr(this._showDataInfo,this,!1),z2:5});var w=S.getBoundingRect(),b=l.get("handleSize");this._handleHeight=xr(b,this._size[1]),this._handleWidth=w.width/w.height*this._handleHeight,S.setStyle(l.getModel("handleStyle").getItemStyle()),S.style.strokeNoScale=!0,S.rectHover=!0,S.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),CE(S);var E=l.get("handleColor");E!=null&&(S.style.fill=E),o.add(i[_]=S);var T=l.getModel("textStyle");t.add(a[_]=new la({silent:!0,invisible:!0,style:is(T,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:T.getTextColor(),font:T.getFont()}),z2:10}))},this);var d=f;if(c){var v=xr(l.get("moveHandleSize"),s[1]),p=r.moveHandle=new ta({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:v}}),g=v*.8,m=r.moveHandleIcon=hu(l.get("moveHandleIcon"),-g/2,-g/2,g,g,"#fff",!0);m.silent=!0,m.y=s[1]+v/2-.5,p.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var y=Math.min(s[1]/2,Math.max(v,10));d=r.moveZone=new ta({invisible:!0,shape:{y:s[1]-y,height:v+y}}),d.on("mouseover",function(){u.enterEmphasis(p)}).on("mouseout",function(){u.leaveEmphasis(p)}),o.add(p),o.add(m),o.add(d)}d.attr({draggable:!0,cursor:C1e(this._orient),drift:kr(this._onDragMove,this,"all"),ondragstart:kr(this._showDataInfo,this,!0),ondragend:kr(this._onDragEnd,this),onmouseover:kr(this._showDataInfo,this,!0),onmouseout:kr(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),r=this._getViewExtent();this._handleEnds=[go(t[0],[0,100],r,!0),go(t[1],[0,100],r,!0)]},e.prototype._updateInterval=function(t,r){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];J2(r,a,o,i.get("zoomLock")?"all":t,s.minSpan!=null?go(s.minSpan,l,o,!0):null,s.maxSpan!=null?go(s.maxSpan,l,o,!0):null);var u=this._range,h=this._range=Op([go(a[0],o,l,!0),go(a[1],o,l,!0)]);return!u||u[0]!==h[0]||u[1]!==h[1]},e.prototype._updateView=function(t){var r=this._displayables,i=this._handleEnds,a=Op(i.slice()),o=this._size;te([0,1],function(d){var v=r.handles[d],p=this._handleHeight;v.attr({scaleX:p/2,scaleY:p/2,x:i[d]+(d?-1:1),y:o[1]/2-p/2})},this),r.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};r.moveHandle&&(r.moveHandle.setShape(s),r.moveZone.setShape(s),r.moveZone.getBoundingRect(),r.moveHandleIcon&&r.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=r.dataShadowSegs,u=[0,a[0],a[1],o[0]],h=0;hr[0]||i[1]<0||i[1]>r[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var r=t.offsetX,i=t.offsetY;this._brushStart=new qn(r,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(!!this._brushing){var r=this._displayables.brushRect;if(this._brushing=!1,!!r){r.attr("ignore",!0);var i=r.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=Op([go(i.x,o,s,!0),go(i.x+i.width,o,s,!0)]),this._handleEnds=[i.x,i.x+i.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(l_(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,r){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new pP({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(t,r),h=l.transformCoordToLocal(s.x,s.y),c=this._size;u[0]=Math.max(Math.min(c[0],u[0]),0),o.setShape({x:h[0],y:0,width:u[0]-h[0],height:c[1]})},e.prototype._dispatchZoomAction=function(t){var r=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?jMt:null,start:r[0],end:r[1]})},e.prototype._findCoordRect=function(){var t,r=pBe(this.dataZoomModel).infoList;if(!t&&r.length){var i=r[0].model.coordinateSystem;t=i.getRect&&i.getRect()}if(!t){var a=this.api.getWidth(),o=this.api.getHeight();t={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return t},e.type="dataZoom.slider",e}(Zae);function YMt(n){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[n]}function C1e(n){return n==="vertical"?"ns-resize":"ew-resize"}const qMt=XMt;function kBe(n){n.registerComponentModel(UMt),n.registerComponentView(qMt),Kae(n)}function ZMt(n){_i(NBe),_i(kBe)}var KMt={get:function(n,e,t){var r=Sn((JMt[n]||{})[e]);return t&&Gt(r)?r[r.length-1]:r}},JMt={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};const FBe=KMt;var A1e=fc.mapVisual,QMt=fc.eachVisual,eIt=Gt,M1e=te,tIt=Op,rIt=go,nIt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.stateList=["inRange","outOfRange"],t.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],t.layoutMode={type:"box",ignoreSize:!0},t.dataBound=[-1/0,1/0],t.targetVisuals={},t.controllerVisuals={},t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i)},e.prototype.optionUpdated=function(t,r){var i=this.option;!r&&TBe(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var r=this.stateList;t=kr(t,this),this.controllerVisuals=sQ(this.option.controller,r,t),this.targetVisuals=sQ(this.option.target,r,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,r=[];return t==null||t==="all"?this.ecModel.eachSeries(function(i,a){r.push(a)}):r=Do(t),r},e.prototype.eachTargetSeries=function(t,r){te(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&t.call(r,a)},this)},e.prototype.isTargetSeries=function(t){var r=!1;return this.eachTargetSeries(function(i){i===t&&(r=!0)}),r},e.prototype.formatValueText=function(t,r,i){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;i=i||["<",">"],Gt(t)&&(t=t.slice(),u=!0);var h=r?t:u?[c(t[0]),c(t[1])]:c(t);if(Or(l))return l.replace("{value}",u?h[0]:h).replace("{value2}",u?h[1]:h);if(rn(l))return u?l(t[0],t[1]):l(t);if(u)return t[0]===s[0]?i[0]+" "+h[1]:t[1]===s[1]?i[1]+" "+h[0]:h[0]+" - "+h[1];return h;function c(f){return f===s[0]?"min":f===s[1]?"max":(+f).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,r=tIt([t.min,t.max]);this._dataExtent=r},e.prototype.getDataDimensionIndex=function(t){var r=this.option.dimension;if(r!=null)return t.getDimensionIndex(r);for(var i=t.dimensions,a=i.length-1;a>=0;a--){var o=i[a],s=t.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,r=this.option,i={inRange:r.inRange,outOfRange:r.outOfRange},a=r.target||(r.target={}),o=r.controller||(r.controller={});ii(a,i),ii(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),h.call(this,o);function l(c){eIt(r.color)&&!c.inRange&&(c.inRange={color:r.color.slice().reverse()}),c.inRange=c.inRange||{color:t.get("gradientColor")}}function u(c,f,d){var v=c[f],p=c[d];v&&!p&&(p=c[d]={},M1e(v,function(g,m){if(!!fc.isValidType(m)){var y=FBe.get(m,"inactive",s);y!=null&&(p[m]=y,m==="color"&&!p.hasOwnProperty("opacity")&&!p.hasOwnProperty("colorAlpha")&&(p.opacity=[0,0]))}}))}function h(c){var f=(c.inRange||{}).symbol||(c.outOfRange||{}).symbol,d=(c.inRange||{}).symbolSize||(c.outOfRange||{}).symbolSize,v=this.get("inactiveColor"),p=this.getItemSymbol(),g=p||"roundRect";M1e(this.stateList,function(m){var y=this.itemSize,_=c[m];_||(_=c[m]={color:s?v:[v]}),_.symbol==null&&(_.symbol=f&&Sn(f)||(s?g:[g])),_.symbolSize==null&&(_.symbolSize=d&&Sn(d)||(s?y[0]:[y[0],y[0]])),_.symbol=A1e(_.symbol,function(w){return w==="none"?g:w});var x=_.symbolSize;if(x!=null){var S=-1/0;QMt(x,function(w){w>S&&(S=w)}),_.symbolSize=A1e(x,function(w){return rIt(w,[0,S],[0,y[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(oa);const UG=nIt;var I1e=[20,140],iIt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(t,r){n.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){n.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=I1e[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=I1e[1])},e.prototype._resetRange=function(){var t=this.getExtent(),r=this.option.range;!r||r.auto?(t.auto=1,this.option.range=t):Gt(r)&&(r[0]>r[1]&&r.reverse(),r[0]=Math.max(r[0],t[0]),r[1]=Math.min(r[1],t[1]))},e.prototype.completeVisualOption=function(){n.prototype.completeVisualOption.apply(this,arguments),te(this.stateList,function(t){var r=this.option.controller[t].symbolSize;r&&r[0]!==r[1]&&(r[0]=r[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),r=Op((this.get("range")||[]).slice());return r[0]>t[1]&&(r[0]=t[1]),r[1]>t[1]&&(r[1]=t[1]),r[0]=i[1]||t<=r[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var r=[];return this.eachTargetSeries(function(i){var a=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){t[0]<=s&&s<=t[1]&&a.push(l)},this),r.push({seriesId:i.id,dataIndex:a})},this),r},e.prototype.getVisualMeta=function(t){var r=L1e(this,"outOfRange",this.getExtent()),i=L1e(this,"inRange",this.option.range.slice()),a=[];function o(d,v){a.push({value:d,color:t(d,v)})}for(var s=0,l=0,u=i.length,h=r.length;lt[1])break;a.push({color:this.getControllerVisual(l,"color",r),offset:s/i})}return a.push({color:this.getControllerVisual(t[1],"color",r),offset:1}),a},e.prototype._createBarPoints=function(t,r){var i=this.visualMapModel.itemSize;return[[i[0]-r[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-r[1],t[1]]]},e.prototype._createBarGroup=function(t){var r=this._orient,i=this.visualMapModel.get("inverse");return new Cn(r==="horizontal"&&!i?{scaleX:t==="bottom"?1:-1,rotation:Math.PI/2}:r==="horizontal"&&i?{scaleX:t==="bottom"?-1:1,rotation:-Math.PI/2}:r==="vertical"&&!i?{scaleX:t==="left"?1:-1,scaleY:-1}:{scaleX:t==="left"?1:-1})},e.prototype._updateHandle=function(t,r){if(!!this._useHandle){var i=this._shapes,a=this.visualMapModel,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,u=a.getExtent();sIt([0,1],function(h){var c=o[h];c.setStyle("fill",r.handlesColor[h]),c.y=t[h];var f=py(t[h],[0,l[1]],u,!0),d=this.getControllerVisual(f,"symbolSize");c.scaleX=c.scaleY=d/l[0],c.x=l[0]-d/2;var v=u0(i.handleLabelPoints[h],AE(c,this.group));s[h].setStyle({x:v[0],y:v[1],text:a.formatValueText(this._dataInterval[h]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,r,i,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],h=this._shapes,c=h.indicator;if(!!c){c.attr("invisible",!1);var f={convertOpacityToAlpha:!0},d=this.getControllerVisual(t,"color",f),v=this.getControllerVisual(t,"symbolSize"),p=py(t,s,u,!0),g=l[0]-v/2,m={x:c.x,y:c.y};c.y=p,c.x=g;var y=u0(h.indicatorLabelPoint,AE(c,this.group)),_=h.indicatorLabel;_.attr("invisible",!1);var x=this._applyTransform("left",h.mainGroup),S=this._orient,w=S==="horizontal";_.setStyle({text:(i||"")+o.formatValueText(r),verticalAlign:w?x:"middle",align:w?"center":x});var b={x:g,y:p,style:{fill:d}},E={style:{x:y[0],y:y[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var T={duration:100,easing:"cubicInOut",additive:!0};c.x=m.x,c.y=m.y,c.animateTo(b,T),_.animateTo(E,T)}else c.attr(b),_.attr(E);this._firstShowIndicator=!1;var C=this._shapes.handleLabels;if(C)for(var A=0;Ao[1]&&(c[1]=1/0),r&&(c[0]===-1/0?this._showIndicator(h,c[1],"< ",l):c[1]===1/0?this._showIndicator(h,c[0],"> ",l):this._showIndicator(h,h,"\u2248 ",l));var f=this._hoverLinkDataIndices,d=[];(r||D1e(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(c));var v=eht(f,d);this._dispatchHighDown("downplay",FB(v[0],i)),this._dispatchHighDown("highlight",FB(v[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var r;if(aE(t.target,function(l){var u=Bn(l);if(u.dataIndex!=null)return r=u,!0},!0),!!r){var i=this.ecModel.getSeriesByIndex(r.seriesIndex),a=this.visualMapModel;if(!!a.isTargetSeries(i)){var o=i.getData(r.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),r.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var r=this._shapes.handleLabels;if(r)for(var i=0;i=0&&(a.dimension=o,r.push(a))}}),n.getData().setVisual("visualMeta",r)}}];function gIt(n,e,t,r){for(var i=e.targetVisuals[r],a=fc.prepareVisualTypes(i),o={color:w3(n.getData(),"color")},s=0,l=a.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),n.registerAction(dIt,vIt),te(pIt,function(e){n.registerVisual(n.PRIORITY.VISUAL.COMPONENT,e)}),n.registerPreprocessor(yIt))}function UBe(n){n.registerComponentModel(aIt),n.registerComponentView(fIt),zBe(n)}var mIt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._pieceList=[],t}return e.prototype.optionUpdated=function(t,r){n.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],_It[this._mode].call(this,this._pieceList),this._resetSelected(t,r);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=Sn(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=Vt(this._pieceList,function(l){return l=Sn(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var t=this.option,r={},i=fc.listVisualTypes(),a=this.isCategory();te(t.pieces,function(s){te(i,function(l){s.hasOwnProperty(l)&&(r[l]=1)})}),te(r,function(s,l){var u=!1;te(this.stateList,function(h){u=u||o(t,h,l)||o(t.target,h,l)},this),!u&&te(this.stateList,function(h){(t[h]||(t[h]={}))[l]=FBe.get(l,h==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}n.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,r){var i=this.option,a=this._pieceList,o=(r?i:t).selected||{};if(i.selected=o,te(a,function(l,u){var h=this.getSelectedMapKey(l);o.hasOwnProperty(h)||(o[h]=!0)},this),i.selectedMode==="single"){var s=!1;te(a,function(l,u){var h=this.getSelectedMapKey(l);o[h]&&(s?o[h]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return this._mode==="categories"?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=Sn(t)},e.prototype.getValueState=function(t){var r=fc.findPieceIndex(t,this._pieceList);return r!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[r])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var r=[],i=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var h=fc.findPieceIndex(l,i);h===t&&o.push(u)},this),r.push({seriesId:a.id,dataIndex:o})},this),r},e.prototype.getRepresentValue=function(t){var r;if(this.isCategory())r=t.value;else if(t.value!=null)r=t.value;else{var i=t.interval||[];r=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return r},e.prototype.getVisualMeta=function(t){if(this.isCategory())return;var r=[],i=["",""],a=this;function o(h,c){var f=a.getRepresentValue({interval:h});c||(c=a.getValueState(f));var d=t(f,c);h[0]===-1/0?i[0]=d:h[1]===1/0?i[1]=d:r.push({value:h[0],color:d},{value:h[1],color:d})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return te(s,function(h){var c=h.interval;c&&(c[0]>u&&o([u,c[0]],"outOfRange"),o(c.slice()),u=c[1])},this),{stops:r,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=xw(UG.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(UG),_It={splitNumber:function(n){var e=this.option,t=Math.min(e.precision,20),r=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(t)!==a&&t<5;)t++;e.precision=t,a=+a.toFixed(t),e.minOpen&&n.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o","\u2265"][r[0]]];t.text=t.text||this.formatValueText(t.value!=null?t.value:t.interval,!1,i)},this)}};function B1e(n,e){var t=n.inverse;(n.orient==="vertical"?!t:t)&&e.reverse()}const xIt=mIt;var SIt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.doRender=function(){var t=this.group;t.removeAll();var r=this.visualMapModel,i=r.get("textGap"),a=r.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=r.itemSize,h=this._getViewData(),c=h.endsText,f=Gh(r.get("showLabel",!0),!c);c&&this._renderEndsText(t,c[0],u,f,l),te(h.viewPieceList,function(d){var v=d.piece,p=new Cn;p.onclick=kr(this._onItemClick,this,v),this._enableHoverLink(p,d.indexInModelPieceList);var g=r.getRepresentValue(v);if(this._createItemSymbol(p,g,[0,0,u[0],u[1]]),f){var m=this.visualMapModel.getValueState(g);p.add(new la({style:{x:l==="right"?-i:u[0]+i,y:u[1]/2,text:v.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:m==="outOfRange"?.5:1}}))}t.add(p)},this),c&&this._renderEndsText(t,c[1],u,f,l),ME(r.get("orient"),t,r.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,r){var i=this;t.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:FB(s.findTargetDataIndices(r),s)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,r=t.option;if(r.orient==="vertical")return GBe(t,this.api,t.itemSize);var i=r.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(t,r,i,a,o){if(!!r){var s=new Cn,l=this.visualMapModel.textStyleModel;s.add(new la({style:is(l,{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:r})})),t.add(s)}},e.prototype._getViewData=function(){var t=this.visualMapModel,r=Vt(t.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=t.get("text"),a=t.get("orient"),o=t.get("inverse");return(a==="horizontal"?o:!o)?r.reverse():i&&(i=i.slice().reverse()),{viewPieceList:r,endsText:i}},e.prototype._createItemSymbol=function(t,r,i){t.add(hu(this.getControllerVisual(r,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(r,"color")))},e.prototype._onItemClick=function(t){var r=this.visualMapModel,i=r.option,a=i.selectedMode;if(!!a){var o=Sn(i.selected),s=r.getSelectedMapKey(t);a==="single"||a===!0?(o[s]=!0,te(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(BBe);const wIt=SIt;function VBe(n){n.registerComponentModel(xIt),n.registerComponentView(wIt),zBe(n)}function bIt(n){_i(UBe),_i(VBe)}var EIt={label:{enabled:!0},decal:{show:!1}},G1e=na(),TIt={};function CIt(n,e){var t=n.getModel("aria");if(!t.get("enabled"))return;var r=Sn(EIt);ii(r.label,n.getLocaleModel().get("aria"),!1),ii(t.option,r,!1),i(),a();function i(){var u=t.getModel("decal"),h=u.get("show");if(h){var c=$r();n.eachSeries(function(f){if(!f.isColorBySeries()){var d=c.get(f.type);d||(d={},c.set(f.type,d)),G1e(f).scope=d}}),n.eachRawSeries(function(f){if(n.isSeriesFiltered(f))return;if(rn(f.enableAriaDecal)){f.enableAriaDecal();return}var d=f.getData();if(f.isColorBySeries()){var y=pJ(f.ecModel,f.name,TIt,n.getSeriesCount()),_=d.getVisual("decal");d.setVisual("decal",x(_,y))}else{var v=f.getRawData(),p={},g=G1e(f).scope;d.each(function(S){var w=d.getRawIndex(S);p[w]=S});var m=v.count();v.each(function(S){var w=p[S],b=v.getName(S)||S+"",E=pJ(f.ecModel,b,g,m),T=d.getItemVisual(w,"decal");d.setItemVisual(w,"decal",x(T,E))})}function x(S,w){var b=S?Mt(Mt({},w),S):w;return b.dirty=!0,b}})}}function a(){var u=n.getLocaleModel().get("aria"),h=t.getModel("label");if(h.option=sn(h.option,u),!!h.get("enabled")){var c=e.getZr().dom;if(h.get("description")){c.setAttribute("aria-label",h.get("description"));return}var f=n.getSeriesCount(),d=h.get(["data","maxCount"])||10,v=h.get(["series","maxCount"])||10,p=Math.min(f,v),g;if(!(f<1)){var m=s();if(m){var y=h.get(["general","withTitle"]);g=o(y,{title:m})}else g=h.get(["general","withoutTitle"]);var _=[],x=f>1?h.get(["series","multiple","prefix"]):h.get(["series","single","prefix"]);g+=o(x,{seriesCount:f}),n.eachSeries(function(E,T){if(T1?h.get(["series","multiple",M]):h.get(["series","single",M]),C=o(C,{seriesId:E.seriesIndex,seriesName:E.get("name"),seriesType:l(E.subType)});var I=E.getData();if(I.count()>d){var R=h.get(["data","partialData"]);C+=o(R,{displayCnt:d})}else C+=h.get(["data","allData"]);for(var k=h.get(["data","separator","middle"]),D=h.get(["data","separator","end"]),G=[],W=0;W":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},IIt=function(){function n(e){var t=this._condVal=Or(e)?new RegExp(e):clt(e)?e:null;if(t==null){var r="";ao(r)}}return n.prototype.evaluate=function(e){var t=typeof e;return Or(t)?this._condVal.test(e):ha(t)?this._condVal.test(e+""):!1},n}(),LIt=function(){function n(){}return n.prototype.evaluate=function(){return this.value},n}(),PIt=function(){function n(){}return n.prototype.evaluate=function(){for(var e=this.children,t=0;t2&&r.push(i),i=[I,R]}function h(I,R,k,D){dA(I,k)&&dA(R,D)||i.push(I,R,k,D,k,D)}function c(I,R,k,D,G,W){var z=Math.abs(R-I),V=Math.tan(z/4)*4/3,q=RE:A2&&r.push(i),r}function pQ(n,e,t,r,i,a,o,s,l,u){if(dA(n,t)&&dA(e,r)&&dA(i,o)&&dA(a,s)){l.push(o,s);return}var h=2/u,c=h*h,f=o-n,d=s-e,v=Math.sqrt(f*f+d*d);f/=v,d/=v;var p=t-n,g=r-e,m=i-o,y=a-s,_=p*p+g*g,x=m*m+y*y;if(_=0&&E=0){l.push(o,s);return}var T=[],C=[];DS(n,t,i,o,.5,T),DS(e,r,a,s,.5,C),pQ(T[0],C[0],T[1],C[1],T[2],C[2],T[3],C[3],l,u),pQ(T[4],C[4],T[5],C[5],T[6],C[6],T[7],C[7],l,u)}function HIt(n,e){var t=vQ(n),r=[];e=e||1;for(var i=0;i0)for(var u=0;uMath.abs(u),c=WBe([l,u],h?0:1,e),f=(h?s:u)/c.length,d=0;di,o=WBe([r,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",h=a?"y":"x",c=n[s]/o.length,f=0;f1?null:new qn(p*l+n,p*u+e)}function YIt(n,e,t){var r=new qn;qn.sub(r,t,e),r.normalize();var i=new qn;qn.sub(i,n,e);var a=i.dot(r);return a}function aC(n,e){var t=n[n.length-1];t&&t[0]===e[0]&&t[1]===e[1]||n.push(e)}function qIt(n,e,t){for(var r=n.length,i=[],a=0;ao?(u.x=h.x=s+a/2,u.y=l,h.y=l+o):(u.y=h.y=l+o/2,u.x=s,h.x=s+a),qIt(e,u,h)}function VG(n,e,t,r){if(t===1)r.push(e);else{var i=Math.floor(t/2),a=n(e);VG(n,a[0],i,r),VG(n,a[1],t-i,r)}return r}function ZIt(n,e){for(var t=[],r=0;r0)for(var S=r/t,w=-r/2;w<=r/2;w+=S){for(var b=Math.sin(w),E=Math.cos(w),T=0,_=0;_0;u/=2){var h=0,c=0;(n&u)>0&&(h=1),(e&u)>0&&(c=1),s+=u*u*(3*h^c),c===0&&(h===1&&(n=u-1-n,e=u-1-e),l=n,n=e,e=l)}return s}function HG(n){var e=1/0,t=1/0,r=-1/0,i=-1/0,a=Vt(n,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),h=l.x+l.width/2+(u?u[4]:0),c=l.y+l.height/2+(u?u[5]:0);return e=Math.min(h,e),t=Math.min(c,t),r=Math.max(h,r),i=Math.max(c,i),[h,c]}),o=Vt(a,function(s,l){return{cp:s,z:aLt(s[0],s[1],e,t,r,i),path:n[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function XBe(n){return QIt(n.path,n.count)}function gQ(){return{fromIndividuals:[],toIndividuals:[],count:0}}function oLt(n,e,t){var r=[];function i(S){for(var w=0;w=0;i--)if(!t[i].many.length){var l=t[s].many;if(l.length<=1)if(s)s=0;else return t;var a=l.length,u=Math.ceil(a/2);t[i].many=l.slice(u,a),t[s].many=l.slice(0,u),s++}return t}var lLt={clone:function(n){for(var e=[],t=1-Math.pow(1-n.path.style.opacity,1/n.count),r=0;r0))return;var s=r.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,h;Y1e(n)&&(u=n,h=e),Y1e(e)&&(u=e,h=n);function c(m,y,_,x,S){var w=m.many,b=m.one;if(w.length===1&&!S){var E=y?w[0]:b,T=y?b:w[0];if($G(E))c({many:[E],one:T},!0,_,x,!0);else{var C=s?sn({delay:s(_,x)},l):l;soe(E,T,C),a(E,T,E,T,C)}}else for(var A=sn({dividePath:lLt[t],individualDelay:s&&function(G,W,z,V){return s(G+_,x)}},l),M=y?oLt(w,b,A):sLt(b,w,A),I=M.fromIndividuals,R=M.toIndividuals,k=I.length,D=0;De.length,d=u?q1e(h,u):q1e(f?e:n,[f?n:e]),v=0,p=0;pYBe))for(var i=r.getIndices(),a=hLt(r),o=0;o0&&x.group.traverse(function(w){w instanceof Si&&!w.animators.length&&w.animateFrom({style:{opacity:0}},S)})})}function K1e(n){var e=n.getModel("universalTransition").get("seriesKey");return e||n.id}function J1e(n){return Gt(n)?n.sort().join(","):n}function kx(n){if(n.hostModel)return n.hostModel.getModel("universalTransition").get("divideShape")}function dLt(n,e){var t=$r(),r=$r(),i=$r();return te(n.oldSeries,function(a,o){var s=n.oldDataGroupIds[o],l=n.oldData[o],u=K1e(a),h=J1e(u);r.set(h,{dataGroupId:s,data:l}),Gt(u)&&te(u,function(c){i.set(c,{key:h,dataGroupId:s,data:l})})}),te(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=K1e(a),u=J1e(l),h=r.get(u);if(h)t.set(u,{oldSeries:[{dataGroupId:h.dataGroupId,divide:kx(h.data),data:h.data}],newSeries:[{dataGroupId:o,divide:kx(s),data:s}]});else if(Gt(l)){var c=[];te(l,function(v){var p=r.get(v);p.data&&c.push({dataGroupId:p.dataGroupId,divide:kx(p.data),data:p.data})}),c.length&&t.set(u,{oldSeries:c,newSeries:[{dataGroupId:o,data:s,divide:kx(s)}]})}else{var f=i.get(l);if(f){var d=t.get(f.key);d||(d={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:kx(f.data)}],newSeries:[]},t.set(f.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:kx(s)})}}}}),t}function Q1e(n,e){for(var t=0;t=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:kx(e.oldData[s]),dim:o.dimension})}),te(Do(n.to),function(o){var s=Q1e(t.updatedSeries,o);if(s>=0){var l=t.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:kx(l),dim:o.dimension})}}),i.length>0&&a.length>0&&qBe(i,a,r)}function pLt(n){n.registerUpdateLifecycle("series:beforeupdate",function(e,t,r){te(Do(r.seriesTransition),function(i){te(Do(i.to),function(a){for(var o=r.updatedSeries,s=0;s>1;++t)e[t]=String.fromCharCode(n.charCodeAt(2*t)+(n.charCodeAt(2*t+1)<<8));return e.join("")}function xLt(n){for(var e=[],t=0;t>1;++t)e[t]=String.fromCharCode(n[2*t]+(n[2*t+1]<<8));return e.join("")}function JBe(n){for(var e=[],t=0;t>1;++t)e[t]=String.fromCharCode(n.charCodeAt(2*t+1)+(n.charCodeAt(2*t)<<8));return e.join("")}var hO=function(n){var e=n.charCodeAt(0),t=n.charCodeAt(1);return e==255&&t==254?KBe(n.slice(2)):e==254&&t==255?JBe(n.slice(2)):e==65279?n.slice(1):n},H4=function(e){return String.fromCharCode(e)},t_e=function(e){return String.fromCharCode(e)},SLt=null,aS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r_e(n){for(var e="",t=0,r=0,i=0,a=0,o=0,s=0,l=0,u=0;u>2,r=n.charCodeAt(u++),o=(t&3)<<4|r>>4,i=n.charCodeAt(u++),s=(r&15)<<2|i>>6,l=i&63,isNaN(r)?s=l=64:isNaN(i)&&(l=64),e+=aS.charAt(a)+aS.charAt(o)+aS.charAt(s)+aS.charAt(l);return e}function Tv(n){var e="",t=0,r=0,i=0,a=0,o=0,s=0,l=0;n=n.replace(/^data:([^\/]+\/[^\/]+)?;base64\,/,"").replace(/[^\w\+\/\=]/g,"");for(var u=0;u>4,e+=String.fromCharCode(t),s=aS.indexOf(n.charAt(u++)),r=(o&15)<<4|s>>2,s!==64&&(e+=String.fromCharCode(r)),l=aS.indexOf(n.charAt(u++)),i=(s&3)<<6|l,l!==64&&(e+=String.fromCharCode(i));return e}var oo=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),Sw=function(){if(typeof Buffer<"u"){var n=!Buffer.from;if(!n)try{Buffer.from("foo","utf8")}catch{n=!0}return n?function(e,t){return t?new Buffer(e,t):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}(),MD=function(){if(typeof Buffer>"u")return!1;var n=Sw([65,0]);if(!n)return!1;var e=n.toString("utf16le");return e.length==1}();function VS(n){return oo?Buffer.alloc?Buffer.alloc(n):new Buffer(n):typeof Uint8Array<"u"?new Uint8Array(n):new Array(n)}function n_e(n){return oo?Buffer.allocUnsafe?Buffer.allocUnsafe(n):new Buffer(n):typeof Uint8Array<"u"?new Uint8Array(n):new Array(n)}var iv=function(e){return oo?Sw(e,"binary"):e.split("").map(function(t){return t.charCodeAt(0)&255})};function p_(n){if(Array.isArray(n))return n.map(function(r){return String.fromCharCode(r)}).join("");for(var e=[],t=0;t"u")throw new Error("Unsupported");if(n instanceof ArrayBuffer)return hoe(new Uint8Array(n));for(var e=new Array(n.length),t=0;t>6&31,i[t++]=128|o&63;else if(o>=55296&&o<57344){o=(o&1023)+64;var s=n.charCodeAt(++a)&1023;i[t++]=240|o>>8&7,i[t++]=128|o>>2&63,i[t++]=128|s>>6&15|(o&3)<<4,i[t++]=128|s&63}else i[t++]=224|o>>12&15,i[t++]=128|o>>6&63,i[t++]=128|o&63;t>r&&(e.push(i.slice(0,t)),t=0,i=VS(65535),r=65530)}return e.push(i.slice(0,t)),Yx(e)}var Nf=/\u0000/g,cO=/[\u0001-\u0006]/g;function UA(n){for(var e="",t=n.length-1;t>=0;)e+=n.charAt(t--);return e}function n0(n,e){var t=""+n;return t.length>=e?t:wo("0",e-t.length)+t}function coe(n,e){var t=""+n;return t.length>=e?t:wo(" ",e-t.length)+t}function jG(n,e){var t=""+n;return t.length>=e?t:t+wo(" ",e-t.length)}function bLt(n,e){var t=""+Math.round(n);return t.length>=e?t:wo("0",e-t.length)+t}function ELt(n,e){var t=""+n;return t.length>=e?t:wo("0",e-t.length)+t}var i_e=Math.pow(2,32);function sC(n,e){if(n>i_e||n<-i_e)return bLt(n,e);var t=Math.round(n);return ELt(t,e)}function XG(n,e){return e=e||0,n.length>=7+e&&(n.charCodeAt(e)|32)===103&&(n.charCodeAt(e+1)|32)===101&&(n.charCodeAt(e+2)|32)===110&&(n.charCodeAt(e+3)|32)===101&&(n.charCodeAt(e+4)|32)===114&&(n.charCodeAt(e+5)|32)===97&&(n.charCodeAt(e+6)|32)===108}var a_e=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],vX=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function TLt(n){return n||(n={}),n[0]="General",n[1]="0",n[2]="0.00",n[3]="#,##0",n[4]="#,##0.00",n[9]="0%",n[10]="0.00%",n[11]="0.00E+00",n[12]="# ?/?",n[13]="# ??/??",n[14]="m/d/yy",n[15]="d-mmm-yy",n[16]="d-mmm",n[17]="mmm-yy",n[18]="h:mm AM/PM",n[19]="h:mm:ss AM/PM",n[20]="h:mm",n[21]="h:mm:ss",n[22]="m/d/yy h:mm",n[37]="#,##0 ;(#,##0)",n[38]="#,##0 ;[Red](#,##0)",n[39]="#,##0.00;(#,##0.00)",n[40]="#,##0.00;[Red](#,##0.00)",n[45]="mm:ss",n[46]="[h]:mm:ss",n[47]="mmss.0",n[48]="##0.0E+0",n[49]="@",n[56]='"\u4E0A\u5348/\u4E0B\u5348 "hh"\u6642"mm"\u5206"ss"\u79D2 "',n}var ji={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"\u4E0A\u5348/\u4E0B\u5348 "hh"\u6642"mm"\u5206"ss"\u79D2 "'},o_e={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},CLt={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function YG(n,e,t){for(var r=n<0?-1:1,i=n*r,a=0,o=1,s=0,l=1,u=0,h=0,c=Math.floor(i);ue&&(u>e?(h=l,s=a):(h=u,s=o)),!t)return[0,r*s,h];var f=Math.floor(r*s/h);return[f,r*s-f*h,h]}function uE(n,e,t){if(n>2958465||n<0)return null;var r=n|0,i=Math.floor(86400*(n-r)),a=0,o=[],s={D:r,T:i,u:86400*(n-r)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(s.u)<1e-6&&(s.u=0),e&&e.date1904&&(r+=1462),s.u>.9999&&(s.u=0,++i==86400&&(s.T=i=0,++r,++s.D)),r===60)o=t?[1317,10,29]:[1900,2,29],a=3;else if(r===0)o=t?[1317,8,29]:[1900,1,0],a=6;else{r>60&&--r;var l=new Date(1900,0,1);l.setDate(l.getDate()+r-1),o=[l.getFullYear(),l.getMonth()+1,l.getDate()],a=l.getDay(),r<60&&(a=(a+6)%7),t&&(a=OLt(l,o))}return s.y=o[0],s.m=o[1],s.d=o[2],s.S=i%60,i=Math.floor(i/60),s.M=i%60,i=Math.floor(i/60),s.H=i,s.q=a,s}var QBe=new Date(1899,11,31,0,0,0),ALt=QBe.getTime(),MLt=new Date(1900,2,1,0,0,0);function e8e(n,e){var t=n.getTime();return e?t-=1461*24*60*60*1e3:n>=MLt&&(t+=24*60*60*1e3),(t-(ALt+(n.getTimezoneOffset()-QBe.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function foe(n){return n.indexOf(".")==-1?n:n.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function ILt(n){return n.indexOf("E")==-1?n:n.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function LLt(n){var e=n<0?12:11,t=foe(n.toFixed(12));return t.length<=e||(t=n.toPrecision(10),t.length<=e)?t:n.toExponential(5)}function PLt(n){var e=foe(n.toFixed(11));return e.length>(n<0?12:11)||e==="0"||e==="-0"?n.toPrecision(6):e}function ID(n){var e=Math.floor(Math.log(Math.abs(n))*Math.LOG10E),t;return e>=-4&&e<=-1?t=n.toPrecision(10+e):Math.abs(e)<=9?t=LLt(n):e===10?t=n.toFixed(10).substr(0,12):t=PLt(n),foe(ILt(t.toUpperCase()))}function e2(n,e){switch(typeof n){case"string":return n;case"boolean":return n?"TRUE":"FALSE";case"number":return(n|0)===n?n.toString(10):ID(n);case"undefined":return"";case"object":if(n==null)return"";if(n instanceof Date)return Cv(14,e8e(n,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+n)}function OLt(n,e){e[0]-=581;var t=n.getDay();return n<60&&(t=(t+6)%7),t}function RLt(n,e,t,r){var i="",a=0,o=0,s=t.y,l,u=0;switch(n){case 98:s=t.y+543;case 121:switch(e.length){case 1:case 2:l=s%100,u=2;break;default:l=s%1e4,u=4;break}break;case 109:switch(e.length){case 1:case 2:l=t.m,u=e.length;break;case 3:return vX[t.m-1][1];case 5:return vX[t.m-1][0];default:return vX[t.m-1][2]}break;case 100:switch(e.length){case 1:case 2:l=t.d,u=e.length;break;case 3:return a_e[t.q][0];default:return a_e[t.q][1]}break;case 104:switch(e.length){case 1:case 2:l=1+(t.H+11)%12,u=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:l=t.H,u=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:l=t.M,u=e.length;break;default:throw"bad minute format: "+e}break;case 115:if(e!="s"&&e!="ss"&&e!=".0"&&e!=".00"&&e!=".000")throw"bad second format: "+e;return t.u===0&&(e=="s"||e=="ss")?n0(t.S,e.length):(r>=2?o=r===3?1e3:100:o=r===1?10:1,a=Math.round(o*(t.S+t.u)),a>=60*o&&(a=0),e==="s"?a===0?"0":""+a/o:(i=n0(a,2+r),e==="ss"?i.substr(0,2):"."+i.substr(2,e.length-1)));case 90:switch(e){case"[h]":case"[hh]":l=t.D*24+t.H;break;case"[m]":case"[mm]":l=(t.D*24+t.H)*60+t.M;break;case"[s]":case"[ss]":l=((t.D*24+t.H)*60+t.M)*60+Math.round(t.S+t.u);break;default:throw"bad abstime format: "+e}u=e.length===3?1:2;break;case 101:l=s,u=1;break}var h=u>0?n0(l,u):"";return h}function O1(n){var e=3;if(n.length<=e)return n;for(var t=n.length%e,r=n.substr(0,t);t!=n.length;t+=e)r+=(r.length>0?",":"")+n.substr(t,e);return r}var t8e=/%/g;function DLt(n,e,t){var r=e.replace(t8e,""),i=e.length-r.length;return X1(n,r,t*Math.pow(10,2*i))+wo("%",i)}function NLt(n,e,t){for(var r=e.length-1;e.charCodeAt(r-1)===44;)--r;return X1(n,e.substr(0,r),t/Math.pow(10,3*(e.length-r)))}function r8e(n,e){var t,r=n.indexOf("E")-n.indexOf(".")-1;if(n.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+r8e(n,-e);var i=n.indexOf(".");i===-1&&(i=n.indexOf("E"));var a=Math.floor(Math.log(e)*Math.LOG10E)%i;if(a<0&&(a+=i),t=(e/Math.pow(10,a)).toPrecision(r+1+(i+a)%i),t.indexOf("e")===-1){var o=Math.floor(Math.log(e)*Math.LOG10E);for(t.indexOf(".")===-1?t=t.charAt(0)+"."+t.substr(1)+"E+"+(o-t.length+a):t+="E+"+(o-a);t.substr(0,2)==="0.";)t=t.charAt(0)+t.substr(2,i)+"."+t.substr(2+i),t=t.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(s,l,u,h){return l+u+h.substr(0,(i+a)%i)+"."+h.substr(a)+"E"})}else t=e.toExponential(r);return n.match(/E\+00$/)&&t.match(/e[+-]\d$/)&&(t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1)),n.match(/E\-/)&&t.match(/e\+/)&&(t=t.replace(/e\+/,"e")),t.replace("e","E")}var n8e=/# (\?+)( ?)\/( ?)(\d+)/;function kLt(n,e,t){var r=parseInt(n[4],10),i=Math.round(e*r),a=Math.floor(i/r),o=i-a*r,s=r;return t+(a===0?"":""+a)+" "+(o===0?wo(" ",n[1].length+1+n[4].length):coe(o,n[1].length)+n[2]+"/"+n[3]+n0(s,n[4].length))}function FLt(n,e,t){return t+(e===0?"":""+e)+wo(" ",n[1].length+2+n[4].length)}var i8e=/^#*0*\.([0#]+)/,a8e=/\).*[0#]/,o8e=/\(###\) ###\\?-####/;function bf(n){for(var e="",t,r=0;r!=n.length;++r)switch(t=n.charCodeAt(r)){case 35:break;case 63:e+=" ";break;case 48:e+="0";break;default:e+=String.fromCharCode(t)}return e}function s_e(n,e){var t=Math.pow(10,e);return""+Math.round(n*t)/t}function l_e(n,e){var t=n-Math.floor(n),r=Math.pow(10,e);return e<(""+Math.round(t*r)).length?0:Math.round(t*r)}function BLt(n,e){return e<(""+Math.round((n-Math.floor(n))*Math.pow(10,e))).length?1:0}function GLt(n){return n<2147483647&&n>-2147483648?""+(n>=0?n|0:n-1|0):""+Math.floor(n)}function rp(n,e,t){if(n.charCodeAt(0)===40&&!e.match(a8e)){var r=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return t>=0?rp("n",r,t):"("+rp("n",r,-t)+")"}if(e.charCodeAt(e.length-1)===44)return NLt(n,e,t);if(e.indexOf("%")!==-1)return DLt(n,e,t);if(e.indexOf("E")!==-1)return r8e(e,t);if(e.charCodeAt(0)===36)return"$"+rp(n,e.substr(e.charAt(1)==" "?2:1),t);var i,a,o,s,l=Math.abs(t),u=t<0?"-":"";if(e.match(/^00+$/))return u+sC(l,e.length);if(e.match(/^[#?]+$/))return i=sC(t,0),i==="0"&&(i=""),i.length>e.length?i:bf(e.substr(0,e.length-i.length))+i;if(a=e.match(n8e))return kLt(a,l,u);if(e.match(/^#+0+$/))return u+sC(l,e.length-e.indexOf("0"));if(a=e.match(i8e))return i=s_e(t,a[1].length).replace(/^([^\.]+)$/,"$1."+bf(a[1])).replace(/\.$/,"."+bf(a[1])).replace(/\.(\d*)$/,function(v,p){return"."+p+wo("0",bf(a[1]).length-p.length)}),e.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),a=e.match(/^(0*)\.(#*)$/))return u+s_e(l,a[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,a[1].length?"0.":".");if(a=e.match(/^#{1,3},##0(\.?)$/))return u+O1(sC(l,0));if(a=e.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+rp(n,e,-t):O1(""+(Math.floor(t)+BLt(t,a[1].length)))+"."+n0(l_e(t,a[1].length),a[1].length);if(a=e.match(/^#,#*,#0/))return rp(n,e.replace(/^#,#*,/,""),t);if(a=e.match(/^([0#]+)(\\?-([0#]+))+$/))return i=UA(rp(n,e.replace(/[\\-]/g,""),t)),o=0,UA(UA(e.replace(/\\/g,"")).replace(/[0#]/g,function(v){return o=0?gy("n",r,t):"("+gy("n",r,-t)+")"}if(e.charCodeAt(e.length-1)===44)return zLt(n,e,t);if(e.indexOf("%")!==-1)return ULt(n,e,t);if(e.indexOf("E")!==-1)return s8e(e,t);if(e.charCodeAt(0)===36)return"$"+gy(n,e.substr(e.charAt(1)==" "?2:1),t);var i,a,o,s,l=Math.abs(t),u=t<0?"-":"";if(e.match(/^00+$/))return u+n0(l,e.length);if(e.match(/^[#?]+$/))return i=""+t,t===0&&(i=""),i.length>e.length?i:bf(e.substr(0,e.length-i.length))+i;if(a=e.match(n8e))return FLt(a,l,u);if(e.match(/^#+0+$/))return u+n0(l,e.length-e.indexOf("0"));if(a=e.match(i8e))return i=(""+t).replace(/^([^\.]+)$/,"$1."+bf(a[1])).replace(/\.$/,"."+bf(a[1])),i=i.replace(/\.(\d*)$/,function(v,p){return"."+p+wo("0",bf(a[1]).length-p.length)}),e.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),a=e.match(/^(0*)\.(#*)$/))return u+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,a[1].length?"0.":".");if(a=e.match(/^#{1,3},##0(\.?)$/))return u+O1(""+l);if(a=e.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+gy(n,e,-t):O1(""+t)+"."+wo("0",a[1].length);if(a=e.match(/^#,#*,#0/))return gy(n,e.replace(/^#,#*,/,""),t);if(a=e.match(/^([0#]+)(\\?-([0#]+))+$/))return i=UA(gy(n,e.replace(/[\\-]/g,""),t)),o=0,UA(UA(e.replace(/\\/g,"")).replace(/[0#]/g,function(v){return o-1||t=="\\"&&n.charAt(e+1)=="-"&&"0#".indexOf(n.charAt(e+2))>-1););break;case"?":for(;n.charAt(++e)===t;);break;case"*":++e,(n.charAt(e)==" "||n.charAt(e)=="*")&&++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e-1;);break;case" ":++e;break;default:++e;break}return!1}function $Lt(n,e,t,r){for(var i=[],a="",o=0,s="",l="t",u,h,c,f="H";o=12?n.charAt(o+2):s),p.t="T",f="h",o+=3):n.substr(o,5).toUpperCase()==="AM/PM"?(u!=null&&(p.v=u.H>=12?"PM":"AM"),p.t="T",o+=5,f="h"):n.substr(o,5).toUpperCase()==="\u4E0A\u5348/\u4E0B\u5348"?(u!=null&&(p.v=u.H>=12?"\u4E0B\u5348":"\u4E0A\u5348"),p.t="T",o+=5,f="h"):(p.t="t",++o),u==null&&p.t==="T")return"";i[i.length]=p,l=s;break;case"[":for(a=s;n.charAt(o++)!=="]"&&o-1&&(a=(a.match(/\$([^-\[\]]*)/)||[])[1]||"$",Q2(n)||(i[i.length]={t:"t",v:a}));break;case".":if(u!=null){for(a=s;++o-1;)a+=s;i[i.length]={t:"n",v:a};break;case"?":for(a=s;n.charAt(++o)===s;)a+=s;i[i.length]={t:s,v:a},l=s;break;case"*":++o,(n.charAt(o)==" "||n.charAt(o)=="*")&&++o;break;case"(":case")":i[i.length]={t:r===1?"t":s,v:s},++o;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(a=s;o-1;)a+=n.charAt(o);i[i.length]={t:"D",v:a};break;case" ":i[i.length]={t:s,v:s},++o;break;case"$":i[i.length]={t:"t",v:"$"},++o;break;default:if(",$-+/():!^&'~{}<>=\u20ACacfijklopqrtuvwxzP".indexOf(s)===-1)throw new Error("unrecognized character "+s+" in "+n);i[i.length]={t:"t",v:s},++o;break}var g=0,m=0,y;for(o=i.length-1,l="t";o>=0;--o)switch(i[o].t){case"h":case"H":i[o].t=f,l="h",g<1&&(g=1);break;case"s":(y=i[o].v.match(/\.0+$/))&&(m=Math.max(m,y[0].length-1)),g<3&&(g=3);case"d":case"y":case"M":case"e":l=i[o].t;break;case"m":l==="s"&&(i[o].t="M",g<2&&(g=2));break;case"X":break;case"Z":g<1&&i[o].v.match(/[Hh]/)&&(g=1),g<2&&i[o].v.match(/[Mm]/)&&(g=2),g<3&&i[o].v.match(/[Ss]/)&&(g=3)}switch(g){case 0:break;case 1:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M),u.M>=60&&(u.M=0,++u.H);break;case 2:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M);break}var _="",x;for(o=0;o0){_.charCodeAt(0)==40?(w=e<0&&_.charCodeAt(0)===45?-e:e,b=X1("n",_,w)):(w=e<0&&r>1?-e:e,b=X1("n",_,w),w<0&&i[0]&&i[0].t=="t"&&(b=b.substr(1),i[0].v="-"+i[0].v)),x=b.length-1;var E=i.length;for(o=0;o-1){E=o;break}var T=i.length;if(E===i.length&&b.indexOf("E")===-1){for(o=i.length-1;o>=0;--o)i[o]==null||"n?".indexOf(i[o].t)===-1||(x>=i[o].v.length-1?(x-=i[o].v.length,i[o].v=b.substr(x+1,i[o].v.length)):x<0?i[o].v="":(i[o].v=b.substr(0,x+1),x=-1),i[o].t="t",T=o);x>=0&&T=0;--o)if(!(i[o]==null||"n?".indexOf(i[o].t)===-1)){for(h=i[o].v.indexOf(".")>-1&&o===E?i[o].v.indexOf(".")-1:i[o].v.length-1,S=i[o].v.substr(h+1);h>=0;--h)x>=0&&(i[o].v.charAt(h)==="0"||i[o].v.charAt(h)==="#")&&(S=b.charAt(x--)+S);i[o].v=S,i[o].t="t",T=o}for(x>=0&&T-1&&o===E?i[o].v.indexOf(".")+1:0,S=i[o].v.substr(0,h);h-1&&(w=r>1&&e<0&&o>0&&i[o-1].v==="-"?-e:e,i[o].v=X1(i[o].t,i[o].v,w),i[o].t="t");var C="";for(o=0;o!==i.length;++o)i[o]!=null&&(C+=i[o].v);return C}var u_e=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function h_e(n,e){if(e==null)return!1;var t=parseFloat(e[2]);switch(e[1]){case"=":if(n==t)return!0;break;case">":if(n>t)return!0;break;case"<":if(n":if(n!=t)return!0;break;case">=":if(n>=t)return!0;break;case"<=":if(n<=t)return!0;break}return!1}function WLt(n,e){var t=VLt(n),r=t.length,i=t[r-1].indexOf("@");if(r<4&&i>-1&&--r,t.length>4)throw new Error("cannot find right format for |"+t.join("|")+"|");if(typeof e!="number")return[4,t.length===4||i>-1?t[t.length-1]:"@"];switch(t.length){case 1:t=i>-1?["General","General","General",t[0]]:[t[0],t[0],t[0],"@"];break;case 2:t=i>-1?[t[0],t[0],t[0],t[1]]:[t[0],t[1],t[0],"@"];break;case 3:t=i>-1?[t[0],t[1],t[0],t[2]]:[t[0],t[1],t[2],"@"];break}var a=e>0?t[0]:e<0?t[1]:t[2];if(t[0].indexOf("[")===-1&&t[1].indexOf("[")===-1)return[r,a];if(t[0].match(/\[[=<>]/)!=null||t[1].match(/\[[=<>]/)!=null){var o=t[0].match(u_e),s=t[1].match(u_e);return h_e(e,o)?[r,t[0]]:h_e(e,s)?[r,t[1]]:[r,t[o!=null&&s!=null?2:1]]}return[r,a]}function Cv(n,e,t){t==null&&(t={});var r="";switch(typeof n){case"string":n=="m/d/yy"&&t.dateNF?r=t.dateNF:r=n;break;case"number":n==14&&t.dateNF?r=t.dateNF:r=(t.table!=null?t.table:ji)[n],r==null&&(r=t.table&&t.table[o_e[n]]||ji[o_e[n]]),r==null&&(r=CLt[n]||"General");break}if(XG(r,0))return e2(e,t);e instanceof Date&&(e=e8e(e,t.date1904));var i=WLt(r,e);if(XG(i[1]))return e2(e,t);if(e===!0)e="TRUE";else if(e===!1)e="FALSE";else if(e===""||e==null)return"";return $Lt(i[1],e,t,i[0])}function HLt(n,e){if(typeof e!="number"){e=+e||-1;for(var t=0;t<392;++t){if(ji[t]==null){e<0&&(e=t);continue}if(ji[t]==n){e=t;break}}e<0&&(e=391)}return ji[e]=n,e}function u8e(){ji=TLt()}var jLt={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},h8e=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function XLt(n){var e=typeof n=="number"?ji[n]:n;return e=e.replace(h8e,"(\\d+)"),new RegExp("^"+e+"$")}function YLt(n,e,t){var r=-1,i=-1,a=-1,o=-1,s=-1,l=-1;(e.match(h8e)||[]).forEach(function(c,f){var d=parseInt(t[f+1],10);switch(c.toLowerCase().charAt(0)){case"y":r=d;break;case"d":a=d;break;case"h":o=d;break;case"s":l=d;break;case"m":o>=0?s=d:i=d;break}}),l>=0&&s==-1&&i>=0&&(s=i,i=-1);var u=(""+(r>=0?r:new Date().getFullYear())).slice(-4)+"-"+("00"+(i>=1?i:1)).slice(-2)+"-"+("00"+(a>=1?a:1)).slice(-2);u.length==7&&(u="0"+u),u.length==8&&(u="20"+u);var h=("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(s>=0?s:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return o==-1&&s==-1&&l==-1?u:r==-1&&i==-1&&a==-1?h:u+"T"+h}var qLt={"d.m":"d\\.m"};function OE(n,e){return HLt(qLt[n]||n,e)}var c_e=function(){var n={};n.version="1.2.0";function e(){for(var b=0,E=new Array(256),T=0;T!=256;++T)b=T,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,E[T]=b;return typeof Int32Array<"u"?new Int32Array(E):E}var t=e();function r(b){var E=0,T=0,C=0,A=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(C=0;C!=256;++C)A[C]=b[C];for(C=0;C!=256;++C)for(T=b[C],E=256+C;E<4096;E+=256)T=A[E]=T>>>8^b[T&255];var M=[];for(C=1;C!=16;++C)M[C-1]=typeof Int32Array<"u"&&typeof A.subarray=="function"?A.subarray(C*256,C*256+256):A.slice(C*256,C*256+256);return M}var i=r(t),a=i[0],o=i[1],s=i[2],l=i[3],u=i[4],h=i[5],c=i[6],f=i[7],d=i[8],v=i[9],p=i[10],g=i[11],m=i[12],y=i[13],_=i[14];function x(b,E){for(var T=E^-1,C=0,A=b.length;C>>8^t[(T^b.charCodeAt(C++))&255];return~T}function S(b,E){for(var T=E^-1,C=b.length-15,A=0;A>8&255]^m[b[A++]^T>>16&255]^g[b[A++]^T>>>24]^p[b[A++]]^v[b[A++]]^d[b[A++]]^f[b[A++]]^c[b[A++]]^h[b[A++]]^u[b[A++]]^l[b[A++]]^s[b[A++]]^o[b[A++]]^a[b[A++]]^t[b[A++]];for(C+=15;A>>8^t[(T^b[A++])&255];return~T}function w(b,E){for(var T=E^-1,C=0,A=b.length,M=0,I=0;C>>8^t[(T^M)&255]:M<2048?(T=T>>>8^t[(T^(192|M>>6&31))&255],T=T>>>8^t[(T^(128|M&63))&255]):M>=55296&&M<57344?(M=(M&1023)+64,I=b.charCodeAt(C++)&1023,T=T>>>8^t[(T^(240|M>>8&7))&255],T=T>>>8^t[(T^(128|M>>2&63))&255],T=T>>>8^t[(T^(128|I>>6&15|(M&3)<<4))&255],T=T>>>8^t[(T^(128|I&63))&255]):(T=T>>>8^t[(T^(224|M>>12&15))&255],T=T>>>8^t[(T^(128|M>>6&63))&255],T=T>>>8^t[(T^(128|M&63))&255]);return~T}return n.table=t,n.bstr=x,n.buf=S,n.str=w,n}(),co=function(){var e={};e.version="1.2.2";function t(ue,xe){for(var ce=ue.split("/"),pe=xe.split("/"),we=0,Me=0,nt=Math.min(ce.length,pe.length);we>>1,ue.write_shift(2,ce);var pe=xe.getFullYear()-1980;pe=pe<<4|xe.getMonth()+1,pe=pe<<5|xe.getDate(),ue.write_shift(2,pe)}function o(ue){var xe=ue.read_shift(2)&65535,ce=ue.read_shift(2)&65535,pe=new Date,we=ce&31;ce>>>=5;var Me=ce&15;ce>>>=4,pe.setMilliseconds(0),pe.setFullYear(ce+1980),pe.setMonth(Me-1),pe.setDate(we);var nt=xe&31;xe>>>=5;var It=xe&63;return xe>>>=6,pe.setHours(xe),pe.setMinutes(It),pe.setSeconds(nt<<1),pe}function s(ue){eh(ue,0);for(var xe={},ce=0;ue.l<=ue.length-4;){var pe=ue.read_shift(2),we=ue.read_shift(2),Me=ue.l+we,nt={};switch(pe){case 21589:ce=ue.read_shift(1),ce&1&&(nt.mtime=ue.read_shift(4)),we>5&&(ce&2&&(nt.atime=ue.read_shift(4)),ce&4&&(nt.ctime=ue.read_shift(4))),nt.mtime&&(nt.mt=new Date(nt.mtime*1e3));break;case 1:{var It=ue.read_shift(4),ot=ue.read_shift(4);nt.usz=ot*Math.pow(2,32)+It,It=ue.read_shift(4),ot=ue.read_shift(4),nt.csz=ot*Math.pow(2,32)+It}break}ue.l=Me,xe[pe]=nt}return xe}var l;function u(){return l||(l=ZLt)}function h(ue,xe){if(ue[0]==80&&ue[1]==75)return yn(ue,xe);if((ue[0]|32)==109&&(ue[1]|32)==105)return No(ue,xe);if(ue.length<512)throw new Error("CFB file size "+ue.length+" < 512");var ce=3,pe=512,we=0,Me=0,nt=0,It=0,ot=0,ht=[],ut=ue.slice(0,512);eh(ut,0);var qt=c(ut);switch(ce=qt[0],ce){case 3:pe=512;break;case 4:pe=4096;break;case 0:if(qt[1]==0)return yn(ue,xe);default:throw new Error("Major Version: Expected 3 or 4 saw "+ce)}pe!==512&&(ut=ue.slice(0,pe),eh(ut,28));var fr=ue.slice(0,pe);f(ut,ce);var Wr=ut.read_shift(4,"i");if(ce===3&&Wr!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Wr);ut.l+=4,nt=ut.read_shift(4,"i"),ut.l+=4,ut.chk("00100000","Mini Stream Cutoff Size: "),It=ut.read_shift(4,"i"),we=ut.read_shift(4,"i"),ot=ut.read_shift(4,"i"),Me=ut.read_shift(4,"i");for(var gr=-1,Ar=0;Ar<109&&(gr=ut.read_shift(4,"i"),!(gr<0));++Ar)ht[Ar]=gr;var $n=d(ue,pe);g(ot,Me,$n,pe,ht);var bi=y($n,nt,ht,pe);nt0&&It!==I&&(bi[It].name="!MiniFAT"),bi[ht[0]].name="!FAT",bi.fat_addrs=ht,bi.ssz=pe;var qa={},Qo=[],Ds=[],af=[];_(nt,bi,$n,Qo,we,qa,Ds,It),v(Ds,af,Qo),Qo.shift();var mh={FileIndex:Ds,FullPaths:af};return xe&&xe.raw&&(mh.raw={header:fr,sectors:$n}),mh}function c(ue){if(ue[ue.l]==80&&ue[ue.l+1]==75)return[0,0];ue.chk(R,"Header Signature: "),ue.l+=16;var xe=ue.read_shift(2,"u");return[ue.read_shift(2,"u"),xe]}function f(ue,xe){var ce=9;switch(ue.l+=2,ce=ue.read_shift(2)){case 9:if(xe!=3)throw new Error("Sector Shift: Expected 9 saw "+ce);break;case 12:if(xe!=4)throw new Error("Sector Shift: Expected 12 saw "+ce);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+ce)}ue.chk("0600","Mini Sector Shift: "),ue.chk("000000000000","Reserved: ")}function d(ue,xe){for(var ce=Math.ceil(ue.length/xe)-1,pe=[],we=1;we0&&nt>=0;)Me.push(xe.slice(nt*M,nt*M+M)),we-=M,nt=Yb(ce,nt*4);return Me.length===0?Ku(0):Yx(Me).slice(0,ue.size)}function g(ue,xe,ce,pe,we){var Me=I;if(ue===I){if(xe!==0)throw new Error("DIFAT chain shorter than expected")}else if(ue!==-1){var nt=ce[ue],It=(pe>>>2)-1;if(!nt)return;for(var ot=0;ot=1&&g(Yb(nt,pe-4),xe-1,ce,pe,we)}}function m(ue,xe,ce,pe,we){var Me=[],nt=[];we||(we=[]);var It=pe-1,ot=0,ht=0;for(ot=xe;ot>=0;){we[ot]=!0,Me[Me.length]=ot,nt.push(ue[ot]);var ut=ce[Math.floor(ot*4/pe)];if(ht=ot*4&It,pe<4+ht)throw new Error("FAT boundary crossed: "+ot+" 4 "+pe);if(!ue[ut])break;ot=Yb(ue[ut],ht)}return{nodes:Me,data:S_e([nt])}}function y(ue,xe,ce,pe){var we=ue.length,Me=[],nt=[],It=[],ot=[],ht=pe-1,ut=0,qt=0,fr=0,Wr=0;for(ut=0;ut=we&&(fr-=we),!nt[fr]){ot=[];var gr=[];for(qt=fr;qt>=0;){gr[qt]=!0,nt[qt]=!0,It[It.length]=qt,ot.push(ue[qt]);var Ar=ce[Math.floor(qt*4/pe)];if(Wr=qt*4&ht,pe<4+Wr)throw new Error("FAT boundary crossed: "+qt+" 4 "+pe);if(!ue[Ar]||(qt=Yb(ue[Ar],Wr),gr[qt]))break}Me[fr]={nodes:It,data:S_e([ot])}}return Me}function _(ue,xe,ce,pe,we,Me,nt,It){for(var ot=0,ht=pe.length?2:0,ut=xe[ue].data,qt=0,fr=0,Wr;qt0&&ot!==I&&(xe[ot].name="!StreamData")):Ar.size>=4096?(Ar.storage="fat",xe[Ar.start]===void 0&&(xe[Ar.start]=m(ce,Ar.start,xe.fat_addrs,xe.ssz)),xe[Ar.start].name=Ar.name,Ar.content=xe[Ar.start].data.slice(0,Ar.size)):(Ar.storage="minifat",Ar.size<0?Ar.size=0:ot!==I&&Ar.start!==I&&xe[ot]&&(Ar.content=p(Ar,xe[ot].data,(xe[It]||{}).data))),Ar.content&&eh(Ar.content,0),Me[Wr]=Ar,nt.push(Ar)}}function x(ue,xe){return new Date((av(ue,xe+4)/1e7*Math.pow(2,32)+av(ue,xe)/1e7-11644473600)*1e3)}function S(ue,xe){return u(),h(l.readFileSync(ue),xe)}function w(ue,xe){var ce=xe&&xe.type;switch(ce||oo&&Buffer.isBuffer(ue)&&(ce="buffer"),ce||"base64"){case"file":return S(ue,xe);case"base64":return h(iv(Tv(ue)),xe);case"binary":return h(iv(ue),xe)}return h(ue,xe)}function b(ue,xe){var ce=xe||{},pe=ce.root||"Root Entry";if(ue.FullPaths||(ue.FullPaths=[]),ue.FileIndex||(ue.FileIndex=[]),ue.FullPaths.length!==ue.FileIndex.length)throw new Error("inconsistent CFB structure");ue.FullPaths.length===0&&(ue.FullPaths[0]=pe+"/",ue.FileIndex[0]={name:pe,type:5}),ce.CLSID&&(ue.FileIndex[0].clsid=ce.CLSID),E(ue)}function E(ue){var xe="Sh33tJ5";if(!co.find(ue,"/"+xe)){var ce=Ku(4);ce[0]=55,ce[1]=ce[3]=50,ce[2]=54,ue.FileIndex.push({name:xe,type:2,content:ce,size:4,L:69,R:69,C:69}),ue.FullPaths.push(ue.FullPaths[0]+xe),T(ue)}}function T(ue,xe){b(ue);for(var ce=!1,pe=!1,we=ue.FullPaths.length-1;we>=0;--we){var Me=ue.FileIndex[we];switch(Me.type){case 0:pe?ce=!0:(ue.FileIndex.pop(),ue.FullPaths.pop());break;case 1:case 2:case 5:pe=!0,isNaN(Me.R*Me.L*Me.C)&&(ce=!0),Me.R>-1&&Me.L>-1&&Me.R==Me.L&&(ce=!0);break;default:ce=!0;break}}if(!(!ce&&!xe)){var nt=new Date(1987,1,19),It=0,ot=Object.create?Object.create(null):{},ht=[];for(we=0;we1?1:-1,qt.size=0,qt.type=5;else if(fr.slice(-1)=="/"){for(It=we+1;It=ht.length?-1:It,It=we+1;It=ht.length?-1:It,qt.type=1}else r(ue.FullPaths[we+1]||"")==r(fr)&&(qt.R=we+1),qt.type=2}}}function C(ue,xe){var ce=xe||{};if(ce.fileType=="mad")return Jo(ue,ce);switch(T(ue),ce.fileType){case"zip":return oi(ue,ce)}var pe=function(Wr){for(var gr=0,Ar=0,$n=0;$n0&&(qa<4096?gr+=qa+63>>6:Ar+=qa+511>>9)}}for(var Qo=Wr.FullPaths.length+3>>2,Ds=gr+7>>3,af=gr+127>>7,mh=Ds+Ar+Qo+af,Zl=mh+127>>7,jd=Zl<=109?0:Math.ceil((Zl-109)/127);mh+Zl+jd+127>>7>Zl;)jd=++Zl<=109?0:Math.ceil((Zl-109)/127);var Nl=[1,jd,Zl,af,Qo,Ar,gr,0];return Wr.FileIndex[0].size=gr<<6,Nl[7]=(Wr.FileIndex[0].start=Nl[0]+Nl[1]+Nl[2]+Nl[3]+Nl[4]+Nl[5])+(Nl[6]+7>>3),Nl}(ue),we=Ku(pe[7]<<9),Me=0,nt=0;{for(Me=0;Me<8;++Me)we.write_shift(1,k[Me]);for(Me=0;Me<8;++Me)we.write_shift(2,0);for(we.write_shift(2,62),we.write_shift(2,3),we.write_shift(2,65534),we.write_shift(2,9),we.write_shift(2,6),Me=0;Me<3;++Me)we.write_shift(2,0);for(we.write_shift(4,0),we.write_shift(4,pe[2]),we.write_shift(4,pe[0]+pe[1]+pe[2]+pe[3]-1),we.write_shift(4,0),we.write_shift(4,1<<12),we.write_shift(4,pe[3]?pe[0]+pe[1]+pe[2]-1:I),we.write_shift(4,pe[3]),we.write_shift(-4,pe[1]?pe[0]-1:I),we.write_shift(4,pe[1]),Me=0;Me<109;++Me)we.write_shift(-4,Me>9)));for(It(pe[6]+7>>3);we.l&511;)we.write_shift(-4,G.ENDOFCHAIN);for(nt=Me=0,ot=0;ot=4096)&&(ut.start=nt,It(ht+63>>6)));for(;we.l&511;)we.write_shift(-4,G.ENDOFCHAIN);for(Me=0;Me32&&(console.error("Name "+fr+" will be truncated to "+fr.slice(0,32)),fr=fr.slice(0,32)),ht=2*(fr.length+1),we.write_shift(64,fr,"utf16le"),we.write_shift(2,ht),we.write_shift(1,ut.type),we.write_shift(1,ut.color),we.write_shift(-4,ut.L),we.write_shift(-4,ut.R),we.write_shift(-4,ut.C),ut.clsid)we.write_shift(16,ut.clsid,"hex");else for(ot=0;ot<4;++ot)we.write_shift(4,0);we.write_shift(4,ut.state||0),we.write_shift(4,0),we.write_shift(4,0),we.write_shift(4,0),we.write_shift(4,0),we.write_shift(4,ut.start),we.write_shift(4,ut.size),we.write_shift(4,0)}for(Me=1;Me=4096)if(we.l=ut.start+1<<9,oo&&Buffer.isBuffer(ut.content))ut.content.copy(we,we.l,0,ut.size),we.l+=ut.size+511&-512;else{for(ot=0;ot0&&ut.size<4096)if(oo&&Buffer.isBuffer(ut.content))ut.content.copy(we,we.l,0,ut.size),we.l+=ut.size+63&-64;else{for(ot=0;ot>16|xe>>8|xe)&255}for(var me=typeof Uint8Array<"u",Ce=me?new Uint8Array(1<<8):[],Le=0;Le<1<<8;++Le)Ce[Le]=se(Le);function re(ue,xe){var ce=Ce[ue&255];return xe<=8?ce>>>8-xe:(ce=ce<<8|Ce[ue>>8&255],xe<=16?ce>>>16-xe:(ce=ce<<8|Ce[ue>>16&255],ce>>>24-xe))}function yt(ue,xe){var ce=xe&7,pe=xe>>>3;return(ue[pe]|(ce<=6?0:ue[pe+1]<<8))>>>ce&3}function je(ue,xe){var ce=xe&7,pe=xe>>>3;return(ue[pe]|(ce<=5?0:ue[pe+1]<<8))>>>ce&7}function st(ue,xe){var ce=xe&7,pe=xe>>>3;return(ue[pe]|(ce<=4?0:ue[pe+1]<<8))>>>ce&15}function Nt(ue,xe){var ce=xe&7,pe=xe>>>3;return(ue[pe]|(ce<=3?0:ue[pe+1]<<8))>>>ce&31}function Zt(ue,xe){var ce=xe&7,pe=xe>>>3;return(ue[pe]|(ce<=1?0:ue[pe+1]<<8))>>>ce&127}function qe(ue,xe,ce){var pe=xe&7,we=xe>>>3,Me=(1<>>pe;return ce<8-pe||(nt|=ue[we+1]<<8-pe,ce<16-pe)||(nt|=ue[we+2]<<16-pe,ce<24-pe)||(nt|=ue[we+3]<<24-pe),nt&Me}function ur(ue,xe,ce){var pe=xe&7,we=xe>>>3;return pe<=5?ue[we]|=(ce&7)<>8-pe),xe+3}function Dt(ue,xe,ce){var pe=xe&7,we=xe>>>3;return ce=(ce&1)<>>3;return ce<<=pe,ue[we]|=ce&255,ce>>>=8,ue[we+1]=ce,xe+8}function Oe(ue,xe,ce){var pe=xe&7,we=xe>>>3;return ce<<=pe,ue[we]|=ce&255,ce>>>=8,ue[we+1]=ce&255,ue[we+2]=ce>>>8,xe+16}function J(ue,xe){var ce=ue.length,pe=2*ce>xe?2*ce:xe+5,we=0;if(ce>=xe)return ue;if(oo){var Me=n_e(pe);if(ue.copy)ue.copy(Me);else for(;we>pe-qt,nt=(1<=0;--nt)xe[It|nt<0;)ot[ot.l++]=It[ht++]}return ot.l}function nt(It,ot){for(var ht=0,ut=0,qt=me?new Uint16Array(32768):[];ut0;)ot[ot.l++]=It[ut++];ht=ot.l*8;continue}ht=ur(ot,ht,+(ut+fr==It.length)+2);for(var Wr=0;fr-- >0;){var gr=It[ut];Wr=(Wr<<5^gr)&32767;var Ar=-1,$n=0;if((Ar=qt[Wr])&&(Ar|=ut&-32768,Ar>ut&&(Ar-=32768),Ar2){gr=we[$n],gr<=22?ht=ft(ot,ht,Ce[gr+1]>>1)-1:(ft(ot,ht,3),ht+=5,ft(ot,ht,Ce[gr-23]>>5),ht+=3);var bi=gr<8?0:gr-4>>2;bi>0&&(Oe(ot,ht,$n-ie[gr]),ht+=bi),gr=xe[ut-Ar],ht=ft(ot,ht,Ce[gr]>>3),ht-=3;var qa=gr<4?0:gr-2>>1;qa>0&&(Oe(ot,ht,ut-Ar-oe[gr]),ht+=qa);for(var Qo=0;Qo<$n;++Qo)qt[Wr]=ut&32767,Wr=(Wr<<5^It[ut])&32767,++ut;fr-=$n-1}else gr<=143?gr=gr+48:ht=Dt(ot,ht,1),ht=ft(ot,ht,Ce[gr]),qt[Wr]=ut&32767,++ut}ht=ft(ot,ht,0)-1}return ot.l=(ht+7)/8|0,ot.l}return function(ot,ht){return ot.length<8?Me(ot,ht):nt(ot,ht)}}();function pt(ue){var xe=Ku(50+Math.floor(ue.length*1.1)),ce=wt(ue,xe);return xe.slice(0,ce)}var ar=me?new Uint16Array(32768):We(32768),kt=me?new Uint16Array(32768):We(32768),Dr=me?new Uint16Array(128):We(128),Sr=1,jr=1;function pn(ue,xe){var ce=Nt(ue,xe)+257;xe+=5;var pe=Nt(ue,xe)+1;xe+=5;var we=st(ue,xe)+4;xe+=4;for(var Me=0,nt=me?new Uint8Array(19):We(19),It=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ot=1,ht=me?new Uint8Array(8):We(8),ut=me?new Uint8Array(8):We(8),qt=nt.length,fr=0;fr>8-gr;for(var Ar=(1<<7-gr)-1;Ar>=0;--Ar)Dr[Wr|Ar<>>=3){case 16:for(Me=3+yt(ue,xe),xe+=2,Wr=$n[$n.length-1];Me-- >0;)$n.push(Wr);break;case 17:for(Me=3+je(ue,xe),xe+=3;Me-- >0;)$n.push(0);break;case 18:for(Me=11+Zt(ue,xe),xe+=7;Me-- >0;)$n.push(0);break;default:$n.push(Wr),ot>>0,It=0,ot=0;(pe&1)==0;){if(pe=je(ue,ce),ce+=3,pe>>>1==0){ce&7&&(ce+=8-(ce&7));var ht=ue[ce>>>3]|ue[(ce>>>3)+1]<<8;if(ce+=32,ht>0)for(!xe&&nt0;)we[Me++]=ue[ce>>>3],ce+=8;continue}else pe>>1==1?(It=9,ot=5):(ce=pn(ue,ce),It=Sr,ot=jr);for(;;){!xe&&nt>>1==1?Qe[ut]:ar[ut];if(ce+=qt&15,qt>>>=4,(qt>>>8&255)===0)we[Me++]=qt;else{if(qt==256)break;qt-=257;var fr=qt<8?0:qt-4>>2;fr>5&&(fr=0);var Wr=Me+ie[qt];fr>0&&(Wr+=qe(ue,ce,fr),ce+=fr),ut=qe(ue,ce,ot),qt=pe>>>1==1?zt[ut]:kt[ut],ce+=qt&15,qt>>>=4;var gr=qt<4?0:qt-2>>1,Ar=oe[qt];for(gr>0&&(Ar+=qe(ue,ce,gr),ce+=gr),!xe&&nt>>3]:[we.slice(0,Me),ce+7>>>3]}function Rn(ue,xe){var ce=ue.slice(ue.l||0),pe=Jn(ce,xe);return ue.l+=pe[1],pe[0]}function hi(ue,xe){if(ue)typeof console<"u"&&console.error(xe);else throw new Error(xe)}function yn(ue,xe){var ce=ue;eh(ce,0);var pe=[],we=[],Me={FileIndex:pe,FullPaths:we};b(Me,{root:xe.root});for(var nt=ce.length-4;(ce[nt]!=80||ce[nt+1]!=75||ce[nt+2]!=5||ce[nt+3]!=6)&&nt>=0;)--nt;ce.l=nt+4,ce.l+=4;var It=ce.read_shift(2);ce.l+=6;var ot=ce.read_shift(4);for(ce.l=ot,nt=0;nt0&&(ce=ce.slice(0,ce.length-1),ce=ce.slice(0,ce.lastIndexOf("/")+1),Me.slice(0,ce.length)!=ce););var nt=(pe[1]||"").match(/boundary="(.*?)"/);if(!nt)throw new Error("MAD cannot find boundary");var It="--"+(nt[1]||""),ot=[],ht=[],ut={FileIndex:ot,FullPaths:ht};b(ut);var qt,fr=0;for(we=0;we=32&&Wr<128&&++qt;var Ar=qt>=fr*4/5;we.push(pe),we.push("Content-Location: "+(ce.root||"file:///C:/SheetJS/")+nt),we.push("Content-Transfer-Encoding: "+(Ar?"quoted-printable":"base64")),we.push("Content-Type: "+ws(It,nt)),we.push(""),we.push(Ar?Os(ut):Sl(ut))}return we.push(pe+`--\r `),we.join(`\r `)}function Lo(ue){var xe={};return b(xe,ue),xe}function hs(ue,xe,ce,pe){var we=pe&&pe.unsafe;we||b(ue);var Me=!we&&co.find(ue,xe);if(!Me){var nt=ue.FullPaths[0];xe.slice(0,nt.length)==nt?nt=xe:(nt.slice(-1)!="/"&&(nt+="/"),nt=(nt+xe).replace("//","/")),Me={name:i(xe),type:2},ue.FileIndex.push(Me),ue.FullPaths.push(nt),we||co.utils.cfb_gc(ue)}return Me.content=ce,Me.size=ce?ce.length:0,pe&&(pe.CLSID&&(Me.clsid=pe.CLSID),pe.mt&&(Me.mt=pe.mt),pe.ct&&(Me.ct=pe.ct)),Me}function Rs(ue,xe){b(ue);var ce=co.find(ue,xe);if(ce){for(var pe=0;pe3&&(r=!0),i[a].slice(i[a].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+i[a].slice(i[a].length-1));case"D":t*=24;case"H":t*=60;case"M":if(r)t*=60;else throw new Error("Unsupported ISO Duration Field: M")}e+=t*parseInt(i[a],10)}return e}var d_e=new Date("2017-02-19T19:06:09.000Z"),f8e=isNaN(d_e.getFullYear())?new Date("2/19/17"):d_e,ePt=f8e.getFullYear()==2017;function pc(n,e){var t=new Date(n);if(ePt)return e>0?t.setTime(t.getTime()+t.getTimezoneOffset()*60*1e3):e<0&&t.setTime(t.getTime()-t.getTimezoneOffset()*60*1e3),t;if(n instanceof Date)return n;if(f8e.getFullYear()==1917&&!isNaN(t.getFullYear())){var r=t.getFullYear();return n.indexOf(""+r)>-1||t.setFullYear(t.getFullYear()+100),t}var i=n.match(/\d+/g)||["2017","2","19","0","0","0"],a=new Date(+i[0],+i[1]-1,+i[2],+i[3]||0,+i[4]||0,+i[5]||0);return n.indexOf("Z")>-1&&(a=new Date(a.getTime()-a.getTimezoneOffset()*60*1e3)),a}function t2(n,e){if(oo&&Buffer.isBuffer(n)){if(e&&MD){if(n[0]==255&&n[1]==254)return dO(n.slice(2).toString("utf16le"));if(n[1]==254&&n[2]==255)return dO(JBe(n.slice(2).toString("binary")))}return n.toString("binary")}if(typeof TextDecoder<"u")try{if(e){if(n[0]==255&&n[1]==254)return dO(new TextDecoder("utf-16le").decode(n.slice(2)));if(n[0]==254&&n[1]==255)return dO(new TextDecoder("utf-16be").decode(n.slice(2)))}var t={"\u20AC":"\x80","\u201A":"\x82",\u0192:"\x83","\u201E":"\x84","\u2026":"\x85","\u2020":"\x86","\u2021":"\x87","\u02C6":"\x88","\u2030":"\x89",\u0160:"\x8A","\u2039":"\x8B",\u0152:"\x8C",\u017D:"\x8E","\u2018":"\x91","\u2019":"\x92","\u201C":"\x93","\u201D":"\x94","\u2022":"\x95","\u2013":"\x96","\u2014":"\x97","\u02DC":"\x98","\u2122":"\x99",\u0161:"\x9A","\u203A":"\x9B",\u0153:"\x9C",\u017E:"\x9E",\u0178:"\x9F"};return Array.isArray(n)&&(n=new Uint8Array(n)),new TextDecoder("latin1").decode(n).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(a){return t[a]||a})}catch{}for(var r=[],i=0;i!=n.length;++i)r.push(String.fromCharCode(n[i]));return r.join("")}function sh(n){if(typeof JSON<"u"&&!Array.isArray(n))return JSON.parse(JSON.stringify(n));if(typeof n!="object"||n==null)return n;if(n instanceof Date)return new Date(n.getTime());var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=sh(n[t]));return e}function wo(n,e){for(var t="";t.length3&&nPt.indexOf(e)==-1)return a}else if(e.replace(/[ap]m?/,"").match(/[a-z]/))return a;return o<0||o>8099||n.match(/[^-0-9:,\/\\]/)?a:i}var iPt=function(){var n="abacaba".split(/(:?b)/i).length==5;return function(t,r,i){if(n||typeof r=="string")return t.split(r);for(var a=t.split(r),o=[a[0]],s=1;s\r `,sPt=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,p_e=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/mg,lPt=/<[^>]*>/g,nf=y8e.match(p_e)?p_e:lPt,uPt=/<\w*:/,hPt=/<(\/?)\w+:/;function Tn(n,e,t){for(var r={},i=0,a=0;i!==n.length&&!((a=n.charCodeAt(i))===32||a===10||a===13);++i);if(e||(r[0]=n.slice(0,i)),i===n.length)return r;var o=n.match(sPt),s=0,l="",u=0,h="",c="",f=1;if(o)for(u=0;u!=o.length;++u){for(c=o[u],a=0;a!=c.length&&c.charCodeAt(a)!==61;++a);for(h=c.slice(0,a).trim();c.charCodeAt(a+1)==32;)++a;for(f=(i=c.charCodeAt(a+1))==34||i==39?1:0,l=c.slice(a+1+f,c.length-f),s=0;s!=h.length&&h.charCodeAt(s)!==58;++s);if(s===h.length)h.indexOf("_")>0&&(h=h.slice(0,h.indexOf("_"))),r[h]=l,t||(r[h.toLowerCase()]=l);else{var d=(s===5&&h.slice(0,5)==="xmlns"?"xmlns":"")+h.slice(s+1);if(r[d]&&h.slice(s-3,s)=="ext")continue;r[d]=l,t||(r[d.toLowerCase()]=l)}}return r}function N0(n){return n.replace(hPt,"<$1")}var m8e={""":'"',"'":"'",">":">","<":"<","&":"&"},cPt=doe(m8e),so=function(){var n=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/ig,e=/_x([\da-fA-F]{4})_/ig;function t(r){var i=r+"",a=i.indexOf("-1?16:10))||s}).replace(e,function(s,l){return String.fromCharCode(parseInt(l,16))});var o=i.indexOf("]]>");return t(i.slice(0,a))+i.slice(a+9,o)+t(i.slice(o+3))}return function(i,a){var o=t(i);return a?o.replace(/\r\n/g,` `):o}}(),fPt=/[&<>'"]/g,dPt=/[\u0000-\u001f]/g;function ZG(n){var e=n+"";return e.replace(fPt,function(t){return cPt[t]}).replace(/\n/g,"
").replace(dPt,function(t){return"&#x"+("000"+t.charCodeAt(0).toString(16)).slice(-4)+";"})}var g_e=function(){var n=/&#(\d+);/g;function e(t,r){return String.fromCharCode(parseInt(r,10))}return function(r){return r.replace(n,e)}}();function ps(n){switch(n){case 1:case!0:case"1":case"true":return!0;case 0:case!1:case"0":case"false":return!1}return!1}function pX(n){for(var e="",t=0,r=0,i=0,a=0,o=0,s=0;t191&&r<224){o=(r&31)<<6,o|=i&63,e+=String.fromCharCode(o);continue}if(a=n.charCodeAt(t++),r<240){e+=String.fromCharCode((r&15)<<12|(i&63)<<6|a&63);continue}o=n.charCodeAt(t++),s=((r&7)<<18|(i&63)<<12|(a&63)<<6|o&63)-65536,e+=String.fromCharCode(55296+(s>>>10&1023)),e+=String.fromCharCode(56320+(s&1023))}return e}function y_e(n){var e=VS(2*n.length),t,r,i=1,a=0,o=0,s;for(r=0;r>>10&1023),t=56320+(t&1023)),o!==0&&(e[a++]=o&255,e[a++]=o>>>8,o=0),e[a++]=t%256,e[a++]=t>>>8;return e.slice(0,a).toString("ucs2")}function m_e(n){return Sw(n,"binary").toString("utf8")}var j4="foo bar baz\xE2\x98\x83\xF0\x9F\x8D\xA3",As=oo&&(m_e(j4)==pX(j4)&&m_e||y_e(j4)==pX(j4)&&y_e)||pX,dO=oo?function(n){return Sw(n,"utf8").toString("binary")}:function(n){for(var e=[],t=0,r=0,i=0;t>6))),e.push(String.fromCharCode(128+(r&63)));break;case(r>=55296&&r<57344):r-=55296,i=n.charCodeAt(t++)-56320+(r<<10),e.push(String.fromCharCode(240+(i>>18&7))),e.push(String.fromCharCode(144+(i>>12&63))),e.push(String.fromCharCode(128+(i>>6&63))),e.push(String.fromCharCode(128+(i&63)));break;default:e.push(String.fromCharCode(224+(r>>12))),e.push(String.fromCharCode(128+(r>>6&63))),e.push(String.fromCharCode(128+(r&63)))}return e.join("")},LD=function(){var n={};return function(t,r){var i=t+"|"+(r||"");return n[i]?n[i]:n[i]=new RegExp("<(?:\\w+:)?"+t+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)",r||"")}}(),_8e=function(){var n=[["nbsp"," "],["middot","\xB7"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]});return function(t){for(var r=t.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+/g,` `).replace(/<[^>]*>/g,""),i=0;i([\\s\\S]*?)","g")}}(),pPt=/<\/?(?:vt:)?variant>/g,gPt=/<(?:vt:)([^>]*)>([\s\S]*)"+e+""}function CU(n){if(oo&&Buffer.isBuffer(n))return n.toString("utf8");if(typeof n=="string")return n;if(typeof Uint8Array<"u"&&n instanceof Uint8Array)return As(p_(hoe(n)));throw new Error("Bad input format: expected Buffer or string")}var Mu=/<(\/?)([^\s?>:\/]+)(?:[\s?:\/](?:[^>=]|="[^"]*?")*)?>/mg,xPt={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},SPt=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"];function wPt(n,e){for(var t=1-2*(n[e+7]>>>7),r=((n[e+7]&127)<<4)+(n[e+6]>>>4&15),i=n[e+6]&15,a=5;a>=0;--a)i=i*256+n[e+a];return r==2047?i==0?t*(1/0):NaN:(r==0?r=-1022:(r-=1023,i+=Math.pow(2,52)),t*Math.pow(2,r-52)*i)}function bPt(n,e,t){var r=(e<0||1/e==-1/0?1:0)<<7,i=0,a=0,o=r?-e:e;isFinite(o)?o==0?i=a=0:(i=Math.floor(Math.log(o)/Math.LN2),a=o*Math.pow(2,52-i),i<=-1023&&(!isFinite(a)||a>4|r}var x_e=function(n){for(var e=[],t=10240,r=0;r0&&Buffer.isBuffer(n[0][0])?Buffer.concat(n[0].map(function(e){return Buffer.isBuffer(e)?e:Sw(e)})):x_e(n)}:x_e,w_e=function(n,e,t){for(var r=[],i=e;i0?D3(n,e+4,e+4+t-1):""},w8e=S8e,b8e=function(n,e){var t=av(n,e);return t>0?D3(n,e+4,e+4+t-1):""},E8e=b8e,T8e=function(n,e){var t=2*av(n,e);return t>0?D3(n,e+4,e+4+t-1):""},C8e=T8e,A8e=function(e,t){var r=av(e,t);return r>0?poe(e,t+4,t+4+r):""},M8e=A8e,I8e=function(n,e){var t=av(n,e);return t>0?D3(n,e+4,e+4+t):""},L8e=I8e,P8e=function(n,e){return wPt(n,e)},KG=P8e,O8e=function(e){return Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array};oo&&(w8e=function(e,t){if(!Buffer.isBuffer(e))return S8e(e,t);var r=e.readUInt32LE(t);return r>0?e.toString("utf8",t+4,t+4+r-1):""},E8e=function(e,t){if(!Buffer.isBuffer(e))return b8e(e,t);var r=e.readUInt32LE(t);return r>0?e.toString("utf8",t+4,t+4+r-1):""},C8e=function(e,t){if(!Buffer.isBuffer(e)||!MD)return T8e(e,t);var r=2*e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+r-1)},M8e=function(e,t){if(!Buffer.isBuffer(e)||!MD)return A8e(e,t);var r=e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+r)},L8e=function(e,t){if(!Buffer.isBuffer(e))return I8e(e,t);var r=e.readUInt32LE(t);return e.toString("utf8",t+4,t+4+r)},KG=function(e,t){return Buffer.isBuffer(e)?e.readDoubleLE(t):P8e(e,t)},O8e=function(e){return Buffer.isBuffer(e)||Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array});var WC=function(n,e){return n[e]},R1=function(n,e){return n[e+1]*(1<<8)+n[e]},EPt=function(n,e){var t=n[e+1]*256+n[e];return t<32768?t:(65535-t+1)*-1},av=function(n,e){return n[e+3]*(1<<24)+(n[e+2]<<16)+(n[e+1]<<8)+n[e]},Yb=function(n,e){return n[e+3]<<24|n[e+2]<<16|n[e+1]<<8|n[e]},TPt=function(n,e){return n[e]<<24|n[e+1]<<16|n[e+2]<<8|n[e+3]};function aR(n,e){var t="",r,i,a=[],o,s,l,u;switch(e){case"dbcs":if(u=this.l,oo&&Buffer.isBuffer(this)&&MD)t=this.slice(this.l,this.l+2*n).toString("utf16le");else for(l=0;l0?Yb:TPt)(this,this.l),this.l+=4,r):(i=av(this,this.l),this.l+=4,i);case 8:case-8:if(e==="f")return n==8?i=KG(this,this.l):i=KG([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,i;n=8;case 16:t=x8e(this,this.l,n);break}}return this.l+=n,t}var CPt=function(n,e,t){n[t]=e&255,n[t+1]=e>>>8&255,n[t+2]=e>>>16&255,n[t+3]=e>>>24&255},APt=function(n,e,t){n[t]=e&255,n[t+1]=e>>8&255,n[t+2]=e>>16&255,n[t+3]=e>>24&255},MPt=function(n,e,t){n[t]=e&255,n[t+1]=e>>>8&255};function IPt(n,e,t){var r=0,i=0;if(t==="dbcs"){for(i=0;i!=e.length;++i)MPt(this,e.charCodeAt(i),this.l+2*i);r=2*e.length}else if(t==="sbcs"||t=="cpstr"){for(e=e.replace(/[^\x00-\x7F]/g,"_"),i=0;i!=e.length;++i)this[this.l+i]=e.charCodeAt(i)&255;r=e.length}else if(t==="hex"){for(;i>8}for(;this.l>>=8,this[this.l+1]=e&255;break;case 3:r=3,this[this.l]=e&255,e>>>=8,this[this.l+1]=e&255,e>>>=8,this[this.l+2]=e&255;break;case 4:r=4,CPt(this,e,this.l);break;case 8:if(r=8,t==="f"){bPt(this,e,this.l);break}case 16:break;case-4:r=4,APt(this,e,this.l);break}return this.l+=r,this}function R8e(n,e){var t=x8e(this,this.l,n.length>>1);if(t!==n)throw new Error(e+"Expected "+n+" saw "+t);this.l+=n.length>>1}function eh(n,e){n.l=e,n.read_shift=aR,n.chk=R8e,n.write_shift=IPt}function Kc(n,e){n.l+=e}function Ku(n){var e=VS(n);return eh(e,0),e}function B_(n,e,t){if(!!n){var r,i,a;eh(n,n.l||0);for(var o=n.length,s=0,l=0;n.lr.l&&(r=r.slice(0,r.l),r.l=r.length),r.length>0&&n.push(r)),r=null)},a=function(u){return r&&u=256;)r.c-=256;for(;r.r>=65536;)r.r-=65536}return r}function T_e(n,e,t){var r=sh(n);return r.s=oR(r.s,e.s,t),r.e=oR(r.e,e.s,t),r}function sR(n,e){if(n.cRel&&n.c<0)for(n=sh(n);n.c<0;)n.c+=e>8?16384:256;if(n.rRel&&n.r<0)for(n=sh(n);n.r<0;)n.r+=e>8?1048576:e>5?65536:16384;var t=bo(n);return!n.cRel&&n.cRel!=null&&(t=OPt(t)),!n.rRel&&n.rRel!=null&&(t=LPt(t)),t}function gX(n,e){return n.s.r==0&&!n.s.rRel&&n.e.r==(e.biff>=12?1048575:e.biff>=8?65536:16384)&&!n.e.rRel?(n.s.cRel?"":"$")+$o(n.s.c)+":"+(n.e.cRel?"":"$")+$o(n.e.c):n.s.c==0&&!n.s.cRel&&n.e.c==(e.biff>=12?16383:255)&&!n.e.cRel?(n.s.rRel?"":"$")+ys(n.s.r)+":"+(n.e.rRel?"":"$")+ys(n.e.r):sR(n.s,e.biff)+":"+sR(n.e,e.biff)}function goe(n){return parseInt(PPt(n),10)-1}function ys(n){return""+(n+1)}function LPt(n){return n.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function PPt(n){return n.replace(/\$(\d+)$/,"$1")}function yoe(n){for(var e=RPt(n),t=0,r=0;r!==e.length;++r)t=26*t+e.charCodeAt(r)-64;return t-1}function $o(n){if(n<0)throw new Error("invalid column "+n);var e="";for(++n;n;n=Math.floor((n-1)/26))e=String.fromCharCode((n-1)%26+65)+e;return e}function OPt(n){return n.replace(/^([A-Z])/,"$$$1")}function RPt(n){return n.replace(/^\$([A-Z])/,"$1")}function DPt(n){return n.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function zc(n){for(var e=0,t=0,r=0;r=48&&i<=57?e=10*e+(i-48):i>=65&&i<=90&&(t=26*t+(i-64))}return{c:t-1,r:e-1}}function bo(n){for(var e=n.c+1,t="";e;e=(e-1)/26|0)t=String.fromCharCode((e-1)%26+65)+t;return t+(n.r+1)}function eT(n){var e=n.indexOf(":");return e==-1?{s:zc(n),e:zc(n)}:{s:zc(n.slice(0,e)),e:zc(n.slice(e+1))}}function lo(n,e){return typeof e>"u"||typeof e=="number"?lo(n.s,n.e):(typeof n!="string"&&(n=bo(n)),typeof e!="string"&&(e=bo(e)),n==e?n:n+":"+e)}function NPt(n,e){if(!n&&!(e&&e.biff<=5&&e.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(n)?"'"+n.replace(/'/g,"''")+"'":n}function cu(n){var e={s:{c:0,r:0},e:{c:0,r:0}},t=0,r=0,i=0,a=n.length;for(t=0;r26);++r)t=26*t+i;for(e.s.c=--t,t=0;r9);++r)t=10*t+i;if(e.s.r=--t,r===a||i!=10)return e.e.c=e.s.c,e.e.r=e.s.r,e;for(++r,t=0;r!=a&&!((i=n.charCodeAt(r)-64)<1||i>26);++r)t=26*t+i;for(e.e.c=--t,t=0;r!=a&&!((i=n.charCodeAt(r)-48)<0||i>9);++r)t=10*t+i;return e.e.r=--t,e}function C_e(n,e){var t=n.t=="d"&&e instanceof Date;if(n.z!=null)try{return n.w=Cv(n.z,t?Zc(e):e)}catch{}try{return n.w=Cv((n.XF||{}).numFmtId||(t?14:0),t?Zc(e):e)}catch{return""+e}}function $S(n,e,t){return n==null||n.t==null||n.t=="z"?"":n.w!==void 0?n.w:(n.t=="d"&&!n.z&&t&&t.dateNF&&(n.z=t.dateNF),n.t=="e"?nT[n.v]||n.v:e==null?C_e(n,n.v):C_e(n,e))}function ww(n,e){var t=e&&e.sheet?e.sheet:"Sheet1",r={};return r[t]=n,{SheetNames:[t],Sheets:r}}function D8e(n,e,t){var r=t||{},i=n?n["!data"]!=null:r.dense,a=n||{};i&&!a["!data"]&&(a["!data"]=[]);var o=0,s=0;if(a&&r.origin!=null){if(typeof r.origin=="number")o=r.origin;else{var l=typeof r.origin=="string"?zc(r.origin):r.origin;o=l.r,s=l.c}a["!ref"]||(a["!ref"]="A1:A1")}var u={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(a["!ref"]){var h=cu(a["!ref"]);u.s.c=h.s.c,u.s.r=h.s.r,u.e.c=Math.max(u.e.c,h.e.c),u.e.r=Math.max(u.e.r,h.e.r),o==-1&&(u.e.r=o=h.e.r+1)}for(var c=[],f=0;f!=e.length;++f)if(!!e[f]){if(!Array.isArray(e[f]))throw new Error("aoa_to_sheet expects an array of arrays");var d=o+f,v=""+(d+1);i&&(a["!data"][d]||(a["!data"][d]=[]),c=a["!data"][d]);for(var p=0;p!=e[f].length;++p)if(!(typeof e[f][p]>"u")){var g={v:e[f][p]},m=s+p;if(u.s.r>d&&(u.s.r=d),u.s.c>m&&(u.s.c=m),u.e.r>2;return t?i/100:i}function N8e(n){var e={s:{},e:{}};return e.s.r=n.read_shift(4),e.e.r=n.read_shift(4),e.s.c=n.read_shift(4),e.e.c=n.read_shift(4),e}var rT=N8e;function Bc(n){if(n.length-n.l<8)throw"XLS Xnum Buffer underflow";return n.read_shift(8,"f")}function UPt(n){var e={},t=n.read_shift(1),r=t>>>1,i=n.read_shift(1),a=n.read_shift(2,"i"),o=n.read_shift(1),s=n.read_shift(1),l=n.read_shift(1);switch(n.l++,r){case 0:e.auto=1;break;case 1:e.index=i;var u=RE[i];u&&(e.rgb=OD(u));break;case 2:e.rgb=OD([o,s,l]);break;case 3:e.theme=i;break}return a!=0&&(e.tint=a>0?a/32767:a/32768),e}function VPt(n){var e=n.read_shift(1);n.l++;var t={fBold:e&1,fItalic:e&2,fUnderline:e&4,fStrikeout:e&8,fOutline:e&16,fShadow:e&32,fCondense:e&64,fExtend:e&128};return t}function k8e(n,e){var t={2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"},r=n.read_shift(4);switch(r){case 0:return"";case 4294967295:case 4294967294:return t[n.read_shift(4)]||""}if(r>400)throw new Error("Unsupported Clipboard: "+r.toString(16));return n.l-=4,n.read_shift(0,e==1?"lpstr":"lpwstr")}function $Pt(n){return k8e(n,1)}function WPt(n){return k8e(n,2)}var Soe=2,id=3,X4=11,A_e=12,JG=19,Y4=64,HPt=65,jPt=71,XPt=4108,YPt=4126,Lh=80,F8e=81,qPt=[Lh,F8e],ZPt={1:{n:"CodePage",t:Soe},2:{n:"Category",t:Lh},3:{n:"PresentationFormat",t:Lh},4:{n:"ByteCount",t:id},5:{n:"LineCount",t:id},6:{n:"ParagraphCount",t:id},7:{n:"SlideCount",t:id},8:{n:"NoteCount",t:id},9:{n:"HiddenCount",t:id},10:{n:"MultimediaClipCount",t:id},11:{n:"ScaleCrop",t:X4},12:{n:"HeadingPairs",t:XPt},13:{n:"TitlesOfParts",t:YPt},14:{n:"Manager",t:Lh},15:{n:"Company",t:Lh},16:{n:"LinksUpToDate",t:X4},17:{n:"CharacterCount",t:id},19:{n:"SharedDoc",t:X4},22:{n:"HyperlinksChanged",t:X4},23:{n:"AppVersion",t:id,p:"version"},24:{n:"DigSig",t:HPt},26:{n:"ContentType",t:Lh},27:{n:"ContentStatus",t:Lh},28:{n:"Language",t:Lh},29:{n:"Version",t:Lh},255:{},2147483648:{n:"Locale",t:JG},2147483651:{n:"Behavior",t:JG},1919054434:{}},KPt={1:{n:"CodePage",t:Soe},2:{n:"Title",t:Lh},3:{n:"Subject",t:Lh},4:{n:"Author",t:Lh},5:{n:"Keywords",t:Lh},6:{n:"Comments",t:Lh},7:{n:"Template",t:Lh},8:{n:"LastAuthor",t:Lh},9:{n:"RevNumber",t:Lh},10:{n:"EditTime",t:Y4},11:{n:"LastPrinted",t:Y4},12:{n:"CreatedDate",t:Y4},13:{n:"ModifiedDate",t:Y4},14:{n:"PageCount",t:id},15:{n:"WordCount",t:id},16:{n:"CharCount",t:id},17:{n:"Thumbnail",t:jPt},18:{n:"Application",t:Lh},19:{n:"DocSecurity",t:id},255:{},2147483648:{n:"Locale",t:JG},2147483651:{n:"Behavior",t:JG},1919054434:{}},M_e={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},JPt=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function QPt(n){return n.map(function(e){return[e>>16&255,e>>8&255,e&255]})}var eOt=QPt([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,0,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),RE=sh(eOt),nT={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},B8e={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},G8e=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"],I_e={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"};function tOt(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function rOt(n){var e=tOt();if(!n||!n.match)return e;var t={};if((n.match(nf)||[]).forEach(function(r){var i=Tn(r);switch(i[0].replace(uPt,"<")){case"0?e.calcchains[0]:"",e.sst=e.strs.length>0?e.strs[0]:"",e.style=e.styles.length>0?e.styles[0]:"",e.defaults=t,delete e.calcchains,e}var vA={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",CONN:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function _Q(n){var e=n.lastIndexOf("/");return n.slice(0,e+1)+"_rels/"+n.slice(e+1)+".rels"}function lR(n,e){var t={"!id":{}};if(!n)return t;e.charAt(0)!=="/"&&(e="/"+e);var r={};return(n.match(nf)||[]).forEach(function(i){var a=Tn(i);if(a[0]==="]*>([\\s\\S]*?)")}return n}();function z8e(n){var e={};n=As(n);for(var t=0;t0&&(e[r[1]]=so(i[1])),r[2]==="date"&&e[r[1]]&&(e[r[1]]=pc(e[r[1]]))}return e}var oOt=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]];function U8e(n,e,t,r){var i=[];if(typeof n=="string")i=__e(n,r);else for(var a=0;a0)for(var u=0;u!==i.length;u+=2){switch(l=+i[u+1].v,i[u].v){case"Worksheets":case"\u5DE5\u4F5C\u8868":case"\u041B\u0438\u0441\u0442\u044B":case"\u0623\u0648\u0631\u0627\u0642 \u0627\u0644\u0639\u0645\u0644":case"\u30EF\u30FC\u30AF\u30B7\u30FC\u30C8":case"\u05D2\u05DC\u05D9\u05D5\u05E0\u05D5\u05EA \u05E2\u05D1\u05D5\u05D3\u05D4":case"Arbeitsbl\xE4tter":case"\xC7al\u0131\u015Fma Sayfalar\u0131":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de c\xE1lculo":case"Planilhas":case"Regneark":case"Hojas de c\xE1lculo":case"Werkbladen":t.Worksheets=l,t.SheetNames=o.slice(s,s+l);break;case"Named Ranges":case"Rangos con nombre":case"\u540D\u524D\u4ED8\u304D\u4E00\u89A7":case"Benannte Bereiche":case"Navngivne omr\xE5der":t.NamedRanges=l,t.DefinedNames=o.slice(s,s+l);break;case"Charts":case"Diagramme":t.Chartsheets=l,t.ChartNames=o.slice(s,s+l);break}s+=l}}function sOt(n,e,t){var r={};return e||(e={}),n=As(n),oOt.forEach(function(i){var a=(n.match(LD(i[0]))||[])[1];switch(i[2]){case"string":a&&(e[i[1]]=so(a));break;case"bool":e[i[1]]=a==="true";break;case"raw":var o=n.match(new RegExp("<"+i[0]+"[^>]*>([\\s\\S]*?)"));o&&o.length>0&&(r[i[1]]=o[1]);break}}),r.HeadingPairs&&r.TitlesOfParts&&U8e(r.HeadingPairs,r.TitlesOfParts,e,t),e}var lOt=/<[^>]+>[^<]*/g;function uOt(n,e){var t={},r="",i=n.match(lOt);if(i)for(var a=0;a!=i.length;++a){var o=i[a],s=Tn(o);switch(N0(s[0])){case"":r=null;break;default:if(o.indexOf(""),u=l[0].slice(4),h=l[1];switch(u){case"lpstr":case"bstr":case"lpwstr":t[r]=so(h);break;case"bool":t[r]=ps(h);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":t[r]=parseInt(h,10);break;case"r4":case"r8":case"decimal":t[r]=parseFloat(h);break;case"filetime":case"date":t[r]=pc(h);break;case"cy":case"error":t[r]=so(h);break;default:if(u.slice(-1)=="/")break;e.WTF&&typeof console<"u"&&console.warn("Unexpected",o,u,l)}}else if(o.slice(0,2)!==">2+1<<2),r}function H8e(n){var e=n.read_shift(4),t=n.slice(n.l,n.l+e);return n.l+=e,(e&3)>0&&(n.l+=4-(e&3)&3),t}function yOt(n){var e={};return e.Size=n.read_shift(4),n.l+=e.Size+3-(e.Size-1)%4,e}function QG(n,e,t){var r=n.read_shift(2),i,a=t||{};if(n.l+=2,e!==A_e&&r!==e&&qPt.indexOf(e)===-1&&!((e&65534)==4126&&(r&65534)==4126))throw new Error("Expected type "+e+" saw "+r);switch(e===A_e?r:e){case 2:return i=n.read_shift(2,"i"),a.raw||(n.l+=2),i;case 3:return i=n.read_shift(4,"i"),i;case 11:return n.read_shift(4)!==0;case 19:return i=n.read_shift(4),i;case 30:return V8e(n,r,4).replace(Nf,"");case 31:return $8e(n);case 64:return woe(n);case 65:return H8e(n);case 71:return yOt(n);case 80:return xQ(n,r,!a.raw).replace(Nf,"");case 81:return fOt(n,r).replace(Nf,"");case 4108:return gOt(n);case 4126:case 4127:return r==4127?dOt(n):vOt(n);default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+r)}}function P_e(n,e){var t=n.l,r=n.read_shift(4),i=n.read_shift(4),a=[],o=0,s=0,l=-1,u={};for(o=0;o!=i;++o){var h=n.read_shift(4),c=n.read_shift(4);a[o]=[h,c+t]}a.sort(function(y,_){return y[1]-_[1]});var f={};for(o=0;o!=i;++o){if(n.l!==a[o][1]){var d=!0;if(o>0&&e)switch(e[a[o-1][0]].t){case 2:n.l+2===a[o][1]&&(n.l+=2,d=!1);break;case 80:n.l<=a[o][1]&&(n.l=a[o][1],d=!1);break;case 4108:n.l<=a[o][1]&&(n.l=a[o][1],d=!1);break}if((!e||o==0)&&n.l<=a[o][1]&&(d=!1,n.l=a[o][1]),d)throw new Error("Read Error: Expected address "+a[o][1]+" at "+n.l+" :"+o)}if(e){if(a[o][0]==0&&a.length>o+1&&a[o][1]==a[o+1][1])continue;var v=e[a[o][0]];if(f[v.n]=QG(n,v.t,{raw:!0}),v.p==="version"&&(f[v.n]=String(f[v.n]>>16)+"."+("0000"+String(f[v.n]&65535)).slice(-4)),v.n=="CodePage")switch(f[v.n]){case 0:f[v.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:r0(s=f[v.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+f[v.n])}}else if(a[o][0]===1){if(s=f.CodePage=QG(n,Soe),r0(s),l!==-1){var p=n.l;n.l=a[l][1],u=L_e(n,s),n.l=p}}else if(a[o][0]===0){if(s===0){l=o,n.l=a[o+1][1];continue}u=L_e(n,s)}else{var g=u[a[o][0]],m;switch(n[n.l]){case 65:n.l+=4,m=H8e(n);break;case 30:n.l+=4,m=xQ(n,n[n.l-4]).replace(/\u0000+$/,"");break;case 31:n.l+=4,m=xQ(n,n[n.l-4]).replace(/\u0000+$/,"");break;case 3:n.l+=4,m=n.read_shift(4,"i");break;case 19:n.l+=4,m=n.read_shift(4);break;case 5:n.l+=4,m=n.read_shift(8,"f");break;case 11:n.l+=4,m=tu(n,4);break;case 64:n.l+=4,m=pc(woe(n));break;default:throw new Error("unparsed value: "+n[n.l])}f[g]=m}}return n.l=t+r,f}function O_e(n,e,t){var r=n.content;if(!r)return{};eh(r,0);var i,a,o,s,l=0;r.chk("feff","Byte Order: "),r.read_shift(2);var u=r.read_shift(4),h=r.read_shift(16);if(h!==co.utils.consts.HEADER_CLSID&&h!==t)throw new Error("Bad PropertySet CLSID "+h);if(i=r.read_shift(4),i!==1&&i!==2)throw new Error("Unrecognized #Sets: "+i);if(a=r.read_shift(16),s=r.read_shift(4),i===1&&s!==r.l)throw new Error("Length mismatch: "+s+" !== "+r.l);i===2&&(o=r.read_shift(16),l=r.read_shift(4));var c=P_e(r,e),f={SystemIdentifier:u};for(var d in c)f[d]=c[d];if(f.FMTID=a,i===1)return f;if(l-r.l==2&&(r.l+=2),r.l!==l)throw new Error("Length mismatch 2: "+r.l+" !== "+l);var v;try{v=P_e(r,null)}catch{}for(d in v)f[d]=v[d];return f.FMTID=[a,o],f}function cx(n,e){return n.read_shift(e),null}function mOt(n,e,t){for(var r=[],i=n.l+e;n.l=12?2:1),i="sbcs-cont",a=Mp;if(t&&t.biff>=8&&(Mp=1200),!t||t.biff==8){var o=n.read_shift(1);o&&(i="dbcs-cont")}else t.biff==12&&(i="wstr");t.biff>=2&&t.biff<=5&&(i="cpstr");var s=r?n.read_shift(r,i):"";return Mp=a,s}function xOt(n){var e=Mp;Mp=1200;var t=n.read_shift(2),r=n.read_shift(1),i=r&4,a=r&8,o=1+(r&1),s=0,l,u={};a&&(s=n.read_shift(2)),i&&(l=n.read_shift(4));var h=o==2?"dbcs-cont":"sbcs-cont",c=t===0?"":n.read_shift(t,h);return a&&(n.l+=4*s),i&&(n.l+=l),u.t=c,a||(u.raw=""+u.t+"",u.r=u.t),Mp=e,u}function r2(n,e,t){var r;if(t){if(t.biff>=2&&t.biff<=5)return n.read_shift(e,"cpstr");if(t.biff>=12)return n.read_shift(e,"dbcs-cont")}var i=n.read_shift(1);return i===0?r=n.read_shift(e,"sbcs-cont"):r=n.read_shift(e,"dbcs-cont"),r}function k3(n,e,t){var r=n.read_shift(t&&t.biff==2?1:2);return r===0?(n.l++,""):r2(n,r,t)}function iT(n,e,t){if(t.biff>5)return k3(n,e,t);var r=n.read_shift(1);return r===0?(n.l++,""):n.read_shift(r,t.biff<=4||!n.lens?"cpstr":"sbcs-cont")}function SOt(n){var e=n.read_shift(1);n.l++;var t=n.read_shift(2);return n.l+=2,[e,t]}function wOt(n){var e=n.read_shift(4),t=n.l,r=!1;e>24&&(n.l+=e-24,n.read_shift(16)==="795881f43b1d7f48af2c825dc4852763"&&(r=!0),n.l=t);var i=n.read_shift((r?e-24:e)>>1,"utf16le").replace(Nf,"");return r&&(n.l+=24),i}function bOt(n){for(var e=n.read_shift(2),t="";e-- >0;)t+="../";var r=n.read_shift(0,"lpstr-ansi");if(n.l+=2,n.read_shift(2)!=57005)throw new Error("Bad FileMoniker");var i=n.read_shift(4);if(i===0)return t+r.replace(/\\/g,"/");var a=n.read_shift(4);if(n.read_shift(2)!=3)throw new Error("Bad FileMoniker");var o=n.read_shift(a>>1,"utf16le").replace(Nf,"");return t+o}function EOt(n,e){var t=n.read_shift(16);switch(t){case"e0c9ea79f9bace118c8200aa004ba90b":return wOt(n);case"0303000000000000c000000000000046":return bOt(n);default:throw new Error("Unsupported Moniker "+t)}}function q4(n){var e=n.read_shift(4),t=e>0?n.read_shift(e,"utf16le").replace(Nf,""):"";return t}function TOt(n,e){var t=n.l+e,r=n.read_shift(4);if(r!==2)throw new Error("Unrecognized streamVersion: "+r);var i=n.read_shift(2);n.l+=2;var a,o,s,l,u="",h,c;i&16&&(a=q4(n,t-n.l)),i&128&&(o=q4(n,t-n.l)),(i&257)===257&&(s=q4(n,t-n.l)),(i&257)===1&&(l=EOt(n,t-n.l)),i&8&&(u=q4(n,t-n.l)),i&32&&(h=n.read_shift(16)),i&64&&(c=woe(n)),n.l=t;var f=o||s||l||"";f&&u&&(f+="#"+u),f||(f="#"+u),i&2&&f.charAt(0)=="/"&&f.charAt(1)!="/"&&(f="file://"+f);var d={Target:f};return h&&(d.guid=h),c&&(d.time=c),a&&(d.Tooltip=a),d}function X8e(n){var e=n.read_shift(1),t=n.read_shift(1),r=n.read_shift(1),i=n.read_shift(1);return[e,t,r,i]}function Y8e(n,e){var t=X8e(n);return t[3]=0,t}function Pm(n){var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(2);return{r:e,c:t,ixfe:r}}function COt(n){var e=n.read_shift(2),t=n.read_shift(2);return n.l+=8,{type:e,flags:t}}function AOt(n,e,t){return e===0?"":iT(n,e,t)}function MOt(n,e,t){var r=t.biff>8?4:2,i=n.read_shift(r),a=n.read_shift(r,"i"),o=n.read_shift(r,"i");return[i,a,o]}function q8e(n){var e=n.read_shift(2),t=xoe(n);return[e,t]}function IOt(n,e,t){n.l+=4,e-=4;var r=n.l+e,i=N3(n,e,t),a=n.read_shift(2);if(r-=n.l,a!==r)throw new Error("Malformed AddinUdf: padding = "+r+" != "+a);return n.l+=a,i}function AU(n){var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(2),i=n.read_shift(2);return{s:{c:r,r:e},e:{c:i,r:t}}}function Z8e(n){var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(1),i=n.read_shift(1);return{s:{c:r,r:e},e:{c:i,r:t}}}var LOt=Z8e;function K8e(n){n.l+=4;var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(2);return n.l+=12,[t,e,r]}function POt(n){var e={};return n.l+=4,n.l+=16,e.fSharedNote=n.read_shift(2),n.l+=4,e}function OOt(n){var e={};return n.l+=4,n.cf=n.read_shift(2),e}function Ac(n){n.l+=2,n.l+=n.read_shift(2)}var ROt={0:Ac,4:Ac,5:Ac,6:Ac,7:OOt,8:Ac,9:Ac,10:Ac,11:Ac,12:Ac,13:POt,14:Ac,15:Ac,16:Ac,17:Ac,18:Ac,19:Ac,20:Ac,21:K8e};function DOt(n,e){for(var t=n.l+e,r=[];n.l=2&&(t.dt=n.read_shift(2),n.l-=2),t.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(e>6)throw new Error("Unexpected BIFF Ver "+t.BIFFVer)}return n.read_shift(e),t}function NOt(n,e){return e===0||n.read_shift(2),1200}function kOt(n,e,t){if(t.enc)return n.l+=e,"";var r=n.l,i=iT(n,0,t);return n.read_shift(e+r-n.l),i}function FOt(n,e,t){var r=t&&t.biff==8||e==2?n.read_shift(2):(n.l+=e,0);return{fDialog:r&16,fBelow:r&64,fRight:r&128}}function BOt(n,e,t){var r=n.read_shift(4),i=n.read_shift(1)&3,a=n.read_shift(1);switch(a){case 0:a="Worksheet";break;case 1:a="Macrosheet";break;case 2:a="Chartsheet";break;case 6:a="VBAModule";break}var o=N3(n,0,t);return o.length===0&&(o="Sheet1"),{pos:r,hs:i,dt:a,name:o}}function GOt(n,e){for(var t=n.l+e,r=n.read_shift(4),i=n.read_shift(4),a=[],o=0;o!=i&&n.l>15),i&=32767);var a={Unsynced:r&1,DyZero:(r&2)>>1,ExAsc:(r&4)>>2,ExDsc:(r&8)>>3};return[a,i]}function WOt(n){var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(2),i=n.read_shift(2),a=n.read_shift(2),o=n.read_shift(2),s=n.read_shift(2),l=n.read_shift(2),u=n.read_shift(2);return{Pos:[e,t],Dim:[r,i],Flags:a,CurTab:o,FirstTab:s,Selected:l,TabRatio:u}}function HOt(n,e,t){if(t&&t.biff>=2&&t.biff<5)return{};var r=n.read_shift(2);return{RTL:r&64}}function jOt(){}function XOt(n,e,t){var r={dyHeight:n.read_shift(2),fl:n.read_shift(2)};switch(t&&t.biff||8){case 2:break;case 3:case 4:n.l+=2;break;default:n.l+=10;break}return r.name=N3(n,0,t),r}function YOt(n){var e=Pm(n);return e.isst=n.read_shift(4),e}function qOt(n,e,t){t.biffguess&&t.biff==2&&(t.biff=5);var r=n.l+e,i=Pm(n);t.biff==2&&n.l++;var a=k3(n,r-n.l,t);return i.val=a,i}function ZOt(n,e,t){var r=n.read_shift(2),i=iT(n,0,t);return[r,i]}var KOt=iT;function D_e(n,e,t){var r=n.l+e,i=t.biff==8||!t.biff?4:2,a=n.read_shift(i),o=n.read_shift(i),s=n.read_shift(2),l=n.read_shift(2);return n.l=r,{s:{r:a,c:s},e:{r:o,c:l}}}function JOt(n){var e=n.read_shift(2),t=n.read_shift(2),r=q8e(n);return{r:e,c:t,ixfe:r[0],rknum:r[1]}}function QOt(n,e){for(var t=n.l+e-2,r=n.read_shift(2),i=n.read_shift(2),a=[];n.l>26],r.cellStyles&&(i.alc=a&7,i.fWrap=a>>3&1,i.alcV=a>>4&7,i.fJustLast=a>>7&1,i.trot=a>>8&255,i.cIndent=a>>16&15,i.fShrinkToFit=a>>20&1,i.iReadOrder=a>>22&2,i.fAtrNum=a>>26&1,i.fAtrFnt=a>>27&1,i.fAtrAlc=a>>28&1,i.fAtrBdr=a>>29&1,i.fAtrPat=a>>30&1,i.fAtrProt=a>>31&1,i.dgLeft=o&15,i.dgRight=o>>4&15,i.dgTop=o>>8&15,i.dgBottom=o>>12&15,i.icvLeft=o>>16&127,i.icvRight=o>>23&127,i.grbitDiag=o>>30&3,i.icvTop=s&127,i.icvBottom=s>>7&127,i.icvDiag=s>>14&127,i.dgDiag=s>>21&15,i.icvFore=l&127,i.icvBack=l>>7&127,i.fsxButton=l>>14&1),i}function rRt(n,e,t){var r={};return r.ifnt=n.read_shift(2),r.numFmtId=n.read_shift(2),r.flags=n.read_shift(2),r.fStyle=r.flags>>2&1,e-=6,r.data=tRt(n,e,r.fStyle,t),r}function nRt(n){n.l+=4;var e=[n.read_shift(2),n.read_shift(2)];if(e[0]!==0&&e[0]--,e[1]!==0&&e[1]--,e[0]>7||e[1]>7)throw new Error("Bad Gutters: "+e.join("|"));return e}function N_e(n,e,t){var r=Pm(n);(t.biff==2||e==9)&&++n.l;var i=_Ot(n);return r.val=i,r.t=i===!0||i===!1?"b":"e",r}function iRt(n,e,t){t.biffguess&&t.biff==2&&(t.biff=5);var r=Pm(n),i=Bc(n);return r.val=i,r}var k_e=AOt;function aRt(n,e,t){var r=n.l+e,i=n.read_shift(2),a=n.read_shift(2);if(t.sbcch=a,a==1025||a==14849)return[a,i];if(a<1||a>255)throw new Error("Unexpected SupBook type: "+a);for(var o=r2(n,a),s=[];r>n.l;)s.push(k3(n));return[a,i,o,s]}function F_e(n,e,t){var r=n.read_shift(2),i,a={fBuiltIn:r&1,fWantAdvise:r>>>1&1,fWantPict:r>>>2&1,fOle:r>>>3&1,fOleLink:r>>>4&1,cf:r>>>5&1023,fIcon:r>>>15&1};return t.sbcch===14849&&(i=IOt(n,e-2,t)),a.body=i||n.read_shift(e-2),typeof i=="string"&&(a.Name=i),a}function B_e(n,e,t){var r=n.l+e,i=n.read_shift(2),a=n.read_shift(1),o=n.read_shift(1),s=n.read_shift(t&&t.biff==2?1:2),l=0;(!t||t.biff>=5)&&(t.biff!=5&&(n.l+=2),l=n.read_shift(2),t.biff==5&&(n.l+=2),n.l+=4);var u=r2(n,o,t);i&32&&(u=G8e[u.charCodeAt(0)]);var h=r-n.l;t&&t.biff==2&&--h;var c=r==n.l||s===0||!(h>0)?[]:z3t(n,h,t,s);return{chKey:a,Name:u,itab:l,rgce:c}}function J8e(n,e,t){if(t.biff<8||!(t.biff>8)&&e==n[n.l]+(n[n.l+1]==3?1:0)+1)return G_e(n,e,t);for(var r=[],i=n.l+e,a=n.read_shift(t.biff>8?4:2);a--!==0;)r.push(MOt(n,t.biff>8?12:6,t));if(n.l!=i)throw new Error("Bad ExternSheet: "+n.l+" != "+i);return r}function G_e(n,e,t){n[n.l+1]==3&&n[n.l]++;var r=N3(n,e,t);return r.charCodeAt(0)==3?r.slice(1):r}function oRt(n,e,t){if(t.biff<8){n.l+=e;return}var r=n.read_shift(2),i=n.read_shift(2),a=r2(n,r,t),o=r2(n,i,t);return[a,o]}function sRt(n,e,t){var r=Z8e(n);n.l++;var i=n.read_shift(1);return e-=8,[U3t(n,e,t),i,r]}function z_e(n,e,t){var r=LOt(n);switch(t.biff){case 2:n.l++,e-=7;break;case 3:case 4:n.l+=2,e-=8;break;default:n.l+=6,e-=12}return[r,B3t(n,e,t)]}function lRt(n){var e=n.read_shift(4)!==0,t=n.read_shift(4)!==0,r=n.read_shift(4);return[e,t,r]}function uRt(n,e,t){if(!(t.biff<8)){var r=n.read_shift(2),i=n.read_shift(2),a=n.read_shift(2),o=n.read_shift(2),s=iT(n,0,t);return t.biff<8&&n.read_shift(1),[{r,c:i},s,o,a]}}function hRt(n,e,t){return uRt(n,e,t)}function cRt(n,e){for(var t=[],r=n.read_shift(2);r--;)t.push(AU(n));return t}function fRt(n,e,t){if(t&&t.biff<8)return vRt(n,e,t);var r=K8e(n),i=DOt(n,e-22,r[1]);return{cmo:r,ft:i}}var dRt={8:function(n,e){var t=n.l+e;n.l+=10;var r=n.read_shift(2);n.l+=4,n.l+=2,n.l+=2,n.l+=2,n.l+=4;var i=n.read_shift(1);return n.l+=i,n.l=t,{fmt:r}}};function vRt(n,e,t){n.l+=4;var r=n.read_shift(2),i=n.read_shift(2),a=n.read_shift(2);n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=6,e-=36;var o=[];return o.push((dRt[r]||Kc)(n,e,t)),{cmo:[i,r,a],ft:o}}function pRt(n,e,t){var r=n.l,i="";try{n.l+=4;var a=(t.lastobj||{cmo:[0,0]}).cmo[1],o;[0,5,7,11,12,14].indexOf(a)==-1?n.l+=6:o=SOt(n,6,t);var s=n.read_shift(2);n.read_shift(2),nu(n,2);var l=n.read_shift(2);n.l+=l;for(var u=1;u=(h?s:2*s))break}if(i.length!==s&&i.length!==s*2)throw new Error("cchText: "+s+" != "+i.length);return n.l=r+e,{t:i}}catch{return n.l=r+e,{t:i}}}function gRt(n,e){var t=AU(n);n.l+=16;var r=TOt(n,e-24);return[t,r]}function yRt(n,e){n.read_shift(2);var t=AU(n),r=n.read_shift((e-10)/2,"dbcs-cont");return r=r.replace(Nf,""),[t,r]}function mRt(n){var e=[0,0],t;return t=n.read_shift(2),e[0]=M_e[t]||t,t=n.read_shift(2),e[1]=M_e[t]||t,e}function _Rt(n){for(var e=n.read_shift(2),t=[];e-- >0;)t.push(Y8e(n));return t}function xRt(n){for(var e=n.read_shift(2),t=[];e-- >0;)t.push(Y8e(n));return t}function SRt(n){n.l+=2;var e={cxfs:0,crc:0};return e.cxfs=n.read_shift(2),e.crc=n.read_shift(4),e}function Q8e(n,e,t){if(!t.cellStyles)return Kc(n,e);var r=t&&t.biff>=12?4:2,i=n.read_shift(r),a=n.read_shift(r),o=n.read_shift(r),s=n.read_shift(r),l=n.read_shift(2);r==2&&(n.l+=2);var u={s:i,e:a,w:o,ixfe:s,flags:l};return(t.biff>=5||!t.biff)&&(u.level=l>>8&7),u}function wRt(n,e){var t={};return e<32||(n.l+=16,t.header=Bc(n),t.footer=Bc(n),n.l+=2),t}function bRt(n,e,t){var r={area:!1};if(t.biff!=5)return n.l+=e,r;var i=n.read_shift(1);return n.l+=3,i&16&&(r.area=!0),r}var ERt=Pm,TRt=j8e,CRt=k3;function ARt(n){var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(4),i={fmt:e,env:t,len:r,data:n.slice(n.l,n.l+r)};return n.l+=r,i}function MRt(n,e,t){t.biffguess&&t.biff==5&&(t.biff=2);var r=Pm(n);++n.l;var i=iT(n,e-7,t);return r.t="str",r.val=i,r}function IRt(n){var e=Pm(n);++n.l;var t=Bc(n);return e.t="n",e.val=t,e}function LRt(n){var e=Pm(n);++n.l;var t=n.read_shift(2);return e.t="n",e.val=t,e}function PRt(n){var e=n.read_shift(1);return e===0?(n.l++,""):n.read_shift(e,"sbcs-cont")}function ORt(n,e){n.l+=6,n.l+=2,n.l+=1,n.l+=3,n.l+=1,n.l+=e-13}function RRt(n,e,t){var r=n.l+e,i=Pm(n),a=n.read_shift(2),o=r2(n,a,t);return n.l=r,i.t="str",i.val=o,i}var DRt=[2,3,48,49,131,139,140,245],U_e=function(){var n={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},e=doe({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function t(s,l){var u=[],h=VS(1);switch(l.type){case"base64":h=iv(Tv(s));break;case"binary":h=iv(s);break;case"buffer":case"array":h=s;break}eh(h,0);var c=h.read_shift(1),f=!!(c&136),d=!1,v=!1;switch(c){case 2:break;case 3:break;case 48:d=!0,f=!0;break;case 49:d=!0,f=!0;break;case 131:break;case 139:break;case 140:v=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+c.toString(16))}var p=0,g=521;c==2&&(p=h.read_shift(2)),h.l+=3,c!=2&&(p=h.read_shift(4)),p>1048576&&(p=1e6),c!=2&&(g=h.read_shift(2));var m=h.read_shift(2);l.codepage,c!=2&&(h.l+=16,h.read_shift(1),h[h.l]!==0&&n[h[h.l]],h.l+=1,h.l+=2),v&&(h.l+=36);for(var y=[],_={},x=Math.min(h.length,c==2?521:g-10-(d?264:0)),S=v?32:11;h.l0;){if(h[h.l]===42){h.l+=m;continue}for(++h.l,u[++w]=[],b=0,b=0;b!=y.length;++b){var E=h.slice(h.l,h.l+y[b].len);h.l+=y[b].len,eh(E,0);var T=p_(E);switch(y[b].type){case"C":T.trim().length&&(u[w][b]=T.replace(/\s+$/,""));break;case"D":T.length===8?u[w][b]=new Date(+T.slice(0,4),+T.slice(4,6)-1,+T.slice(6,8)):u[w][b]=T;break;case"F":u[w][b]=parseFloat(T.trim());break;case"+":case"I":u[w][b]=v?E.read_shift(-4,"i")^2147483648:E.read_shift(4,"i");break;case"L":switch(T.trim().toUpperCase()){case"Y":case"T":u[w][b]=!0;break;case"N":case"F":u[w][b]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+T+"|")}break;case"M":if(!f)throw new Error("DBF Unexpected MEMO for type "+c.toString(16));u[w][b]="##MEMO##"+(v?parseInt(T.trim(),10):E.read_shift(4));break;case"N":T=T.replace(/\u0000/g,"").trim(),T&&T!="."&&(u[w][b]=+T||0);break;case"@":u[w][b]=new Date(E.read_shift(-8,"f")-621356832e5);break;case"T":u[w][b]=new Date((E.read_shift(4)-2440588)*864e5+E.read_shift(4));break;case"Y":u[w][b]=E.read_shift(4,"i")/1e4+E.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":u[w][b]=-E.read_shift(-8,"f");break;case"B":if(d&&y[b].len==8){u[w][b]=E.read_shift(8,"f");break}case"G":case"P":E.l+=y[b].len;break;case"0":if(y[b].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+y[b].type)}}}if(c!=2&&h.l=0&&r0(+u.codepage),u.type=="string")throw new Error("Cannot write DBF to JS string");var c=yQ(),f=CQ(s,{header:1,raw:!0,cellDates:!0}),d=f[0],v=f.slice(1),p=s["!cols"]||[],g=0,m=0,y=0,_=1;for(g=0;g250&&(C=250),T=((p[g]||{}).DBF||{}).type,T=="C"&&p[g].DBF.len>C&&(C=p[g].DBF.len),E=="B"&&T=="N"&&(E="N",b[g]=p[g].DBF.dec,C=p[g].DBF.len),w[g]=E=="C"||T=="N"?C:a[E]||0,_+=w[g],S[g]=E}var M=c.next(32);for(M.write_shift(4,318902576),M.write_shift(4,v.length),M.write_shift(2,296+32*y),M.write_shift(2,_),g=0;g<4;++g)M.write_shift(4,0);var I=+e[Mp]||3;for(M.write_shift(4,0|I<<8),n[I]!=+u.codepage&&(u.codepage&&console.error("DBF Unsupported codepage "+Mp+", using 1252"),Mp=1252),g=0,m=0;gw[m]&&(W=W.slice(0,w[m])),y=0;y":190,"?":191,"{":223},e=new RegExp("\x1BN("+h0(n).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),t=function(c,f){var d=n[f];return typeof d=="number"?t_e(d):d},r=function(c,f,d){var v=f.charCodeAt(0)-32<<4|d.charCodeAt(0)-48;return v==59?c:t_e(v)};n["|"]=254;function i(c,f){switch(f.type){case"base64":return a(Tv(c),f);case"binary":return a(c,f);case"buffer":return a(oo&&Buffer.isBuffer(c)?c.toString("binary"):p_(c),f);case"array":return a(t2(c),f)}throw new Error("Unrecognized type "+f.type)}function a(c,f){var d=c.split(/[\n\r]+/),v=-1,p=-1,g=0,m=0,y=[],_=[],x=null,S={},w=[],b=[],E=[],T=0,C,A={Workbook:{WBProps:{},Names:[]}};for(+f.codepage>=0&&r0(+f.codepage);g!==d.length;++g){T=0;var M=d[g].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,r).replace(e,t),I=M.replace(/;;/g,"\0").split(";").map(function(se){return se.replace(/\u0000/g,";")}),R=I[0],k;if(M.length>0)switch(R){case"ID":break;case"E":break;case"B":break;case"O":for(m=1;m=1&&D<=4&&(A.Workbook.WBProps.date1904=!0)}break}break;case"W":break;case"P":switch(I[1].charAt(0)){case"P":_.push(M.slice(3).replace(/;;/g,";"));break}break;case"NN":{var G={Sheet:0};for(m=1;m-1&&y[Y][le];if(!ie||!ie[1])throw new Error("SYLK shared formula cannot find base");j=uGe(ie[1],{r:v-Y,c:p-le})}j&&(y[v][p]?y[v][p].f=j:y[v][p]={t:"n",f:j});break;case"F":var oe=0;for(m=1;m0?(w[v].hpt=T,w[v].hpx=RD(T)):T===0&&(w[v].hidden=!0);break;default:if(f&&f.WTF)throw new Error("SYLK bad record "+M)}oe<1&&(x=null);break;default:if(f&&f.WTF)throw new Error("SYLK bad record "+M)}}return w.length>0&&(S["!rows"]=w),b.length>0&&(S["!cols"]=b),b.forEach(function(se){wM(se)}),f&&f.sheetRows&&(y=y.slice(0,f.sheetRows)),[y,S,A]}function o(c,f){var d=i(c,f),v=d[0],p=d[1],g=d[2],m=sh(f);m.date1904=(((g||{}).Workbook||{}).WBProps||{}).date1904;var y=HI(v,m);h0(p).forEach(function(x){y[x]=p[x]});var _=ww(y,f);return h0(g).forEach(function(x){_[x]=g[x]}),_.bookType="sylk",_}function s(c,f,d,v){var p="C;Y"+(d+1)+";X"+(v+1)+";K";switch(c.t){case"n":p+=c.v||0,c.f&&!c.F&&(p+=";E"+wNt(c.f,{r:d,c:v}));break;case"b":p+=c.v?"TRUE":"FALSE";break;case"e":p+=c.w||c.v;break;case"d":p+='"'+(c.w||c.v)+'"';break;case"s":p+='"'+(c.v==null?"":String(c.v)).replace(/"/g,"").replace(/;/g,";;")+'"';break}return p}function l(c,f){f.forEach(function(d,v){var p="F;W"+(v+1)+" "+(v+1)+" ";d.hidden?p+="0":(typeof d.width=="number"&&!d.wpx&&(d.wpx=t9(d.width)),typeof d.wpx=="number"&&!d.wch&&(d.wch=r9(d.wpx)),typeof d.wch=="number"&&(p+=Math.round(d.wch))),p.charAt(p.length-1)!=" "&&c.push(p)})}function u(c,f){f.forEach(function(d,v){var p="F;";d.hidden?p+="M0;":d.hpt?p+="M"+20*d.hpt+";":d.hpx&&(p+="M"+20*oGe(d.hpx)+";"),p.length>2&&c.push(p+"R"+(v+1))})}function h(c,f,d){var v=["ID;PSheetJS;N;E"],p=[],g=cu(c["!ref"]),m,y=c["!data"]!=null,_=`\r `,x=(((d||{}).Workbook||{}).WBProps||{}).date1904;v.push("P;PGeneral"),v.push("F;P0;DG0G8;M255"),c["!cols"]&&l(v,c["!cols"]),c["!rows"]&&u(v,c["!rows"]),v.push("B;Y"+(g.e.r-g.s.r+1)+";X"+(g.e.c-g.s.c+1)+";D"+[g.s.c,g.s.r,g.e.c,g.e.r].join(" ")),v.push("O;L;D;B"+(x?";V4":"")+";K47;G100 0.001");for(var S=g.s.r;S<=g.e.r;++S)if(!(y&&!c["!data"][S])){for(var w=[],b=g.s.c;b<=g.e.c;++b)m=y?c["!data"][S][b]:c[$o(b)+ys(S)],!(!m||m.v==null&&(!m.f||m.F))&&w.push(s(m,c,S,b));p.push(w.join(_))}return v.join(_)+_+p.join(_)+_+"E"+_}return{to_workbook:o,from_sheet:h}}(),kRt=function(){function n(s,l){switch(l.type){case"base64":return e(Tv(s),l);case"binary":return e(s,l);case"buffer":return e(oo&&Buffer.isBuffer(s)?s.toString("binary"):p_(s),l);case"array":return e(t2(s),l)}throw new Error("Unrecognized type "+l.type)}function e(s,l){for(var u=s.split(` `),h=-1,c=-1,f=0,d=[];f!==u.length;++f){if(u[f].trim()==="BOT"){d[++h]=[],c=0;continue}if(!(h<0)){var v=u[f].trim().split(","),p=v[0],g=v[1];++f;for(var m=u[f]||"";(m.match(/["]/g)||[]).length&1&&f=0&&v[p].length===0;)--p;for(var g=10,m=0,y=0;y<=p;++y)m=v[y].indexOf(" "),m==-1?m=v[y].length:m++,g=Math.max(g,m);for(y=0;y<=p;++y){d[y]=[];var _=0;for(n(v[y].slice(0,g).trim(),d,y,_,f),_=1;_<=(v[y].length-g)/10+1;++_)n(v[y].slice(g+(_-1)*10,g+_*10).trim(),d,y,_,f)}return f.sheetRows&&(d=d.slice(0,f.sheetRows)),d}var t={44:",",9:" ",59:";",124:"|"},r={44:3,9:2,59:1,124:0};function i(h){for(var c={},f=!1,d=0,v=0;d0&&C(),v["!ref"]=lo(p),v}function o(h,c){return!(c&&c.PRN)||c.FS||h.slice(0,4)=="sep="||h.indexOf(" ")>=0||h.indexOf(",")>=0||h.indexOf(";")>=0?a(h,c):HI(e(h,c),c)}function s(h,c){var f="",d=c.type=="string"?[0,0,0,0]:Ioe(h,c);switch(c.type){case"base64":f=Tv(h);break;case"binary":f=h;break;case"buffer":c.codepage==65001?f=h.toString("utf8"):c.codepage&&typeof $C<"u"?f=$C.utils.decode(c.codepage,h):f=oo&&Buffer.isBuffer(h)?h.toString("binary"):p_(h);break;case"array":f=t2(h);break;case"string":f=h;break;default:throw new Error("Unrecognized type "+c.type)}return d[0]==239&&d[1]==187&&d[2]==191?f=As(f.slice(3)):c.type!="string"&&c.type!="buffer"&&c.codepage==65001?f=As(f):c.type=="binary"&&typeof $C<"u"&&c.codepage&&(f=$C.utils.decode(c.codepage,$C.utils.encode(28591,f))),f.slice(0,19)=="socialcalc:version:"?FRt.to_sheet(c.type=="string"?f:As(f),c):o(f,c)}function l(h,c){return ww(s(h,c),c)}function u(h){for(var c=[],f=cu(h["!ref"]),d,v=h["!data"]!=null,p=f.s.r;p<=f.e.r;++p){for(var g=[],m=f.s.c;m<=f.e.c;++m){var y=bo({r:p,c:m});if(d=v?(h["!data"][p]||[])[m]:h[y],!d||d.v==null){g.push(" ");continue}for(var _=(d.w||($S(d),d.w)||"").slice(0,10);_.length<10;)_+=" ";g.push(_+(m===0?" ":""))}c.push(g.join(""))}return c.join(` `)}return{to_workbook:l,to_sheet:s,from_sheet:u}}();function BRt(n,e){var t=e||{},r=!!t.WTF;t.WTF=!0;try{var i=NRt.to_workbook(n,t);return t.WTF=r,i}catch(a){if(t.WTF=r,!a.message.match(/SYLK bad record ID/)&&r)throw a;return PD.to_workbook(n,e)}}var hR=function(){function n(j,Q,ie){if(!!j){eh(j,j.l||0);for(var oe=ie.Enum||q;j.l=16&&j[14]==5&&j[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(j[2]==2)ie.Enum=q,n(j,function(Dt,ft,Oe){switch(Oe){case 0:ie.vers=Dt,Dt>=4096&&(ie.qpro=!0);break;case 255:ie.vers=Dt,ie.works=!0;break;case 6:st=Dt;break;case 204:Dt&&(me=Dt);break;case 222:me=Dt;break;case 15:case 51:(!ie.qpro&&!ie.works||Oe==51)&&Dt[1].v.charCodeAt(0)<48&&(Dt[1].v=Dt[1].v.slice(1)),(ie.works||ie.works2)&&(Dt[1].v=Dt[1].v.replace(/\r\n/g,` `));case 13:case 14:case 16:Oe==14&&(Dt[2]&112)==112&&(Dt[2]&15)>1&&(Dt[2]&15)<15&&(Dt[1].z=ie.dateNF||ji[14],ie.cellDates&&(Dt[1].t="d",Dt[1].v=TU(Dt[1].v))),ie.qpro&&Dt[3]>Ce&&(oe["!ref"]=lo(st),Le[se]=oe,re.push(se),oe={},ie.dense&&(je=oe["!data"]=[]),st={s:{r:0,c:0},e:{r:0,c:0}},Ce=Dt[3],se=me||"Sheet"+(Ce+1),me="");var J=ie.dense?(je[Dt[0].r]||[])[Dt[0].c]:oe[bo(Dt[0])];if(J){J.t=Dt[1].t,J.v=Dt[1].v,Dt[1].z!=null&&(J.z=Dt[1].z),Dt[1].f!=null&&(J.f=Dt[1].f);break}ie.dense?(je[Dt[0].r]||(je[Dt[0].r]=[]),je[Dt[0].r][Dt[0].c]=Dt[1]):oe[bo(Dt[0])]=Dt[1];break;case 21509:ie.works2=!0;break}},ie);else if(j[2]==26||j[2]==14)ie.Enum=Y,j[2]==14&&(ie.qpro=!0,j.l=0),n(j,function(Dt,ft,Oe){switch(Oe){case 204:se=Dt;break;case 22:Dt[1].v.charCodeAt(0)<48&&(Dt[1].v=Dt[1].v.slice(1)),Dt[1].v=Dt[1].v.replace(/\x0F./g,function(J){return String.fromCharCode(J.charCodeAt(1)-32)}).replace(/\r\n/g,` `);case 23:case 24:case 25:case 37:case 39:case 40:if(Dt[3]>Ce&&(oe["!ref"]=lo(st),Le[se]=oe,re.push(se),oe={},ie.dense&&(je=oe["!data"]=[]),st={s:{r:0,c:0},e:{r:0,c:0}},Ce=Dt[3],se="Sheet"+(Ce+1)),Nt>0&&Dt[0].r>=Nt)break;ie.dense?(je[Dt[0].r]||(je[Dt[0].r]=[]),je[Dt[0].r][Dt[0].c]=Dt[1]):oe[bo(Dt[0])]=Dt[1],st.e.c=0&&r0(+ie.codepage),ie.type=="string")throw new Error("Cannot write WK1 to JS string");var oe=yQ(),se=cu(j["!ref"]),me=j["!data"]!=null,Ce=[];Ag(oe,0,a(1030)),Ag(oe,6,l(se));for(var Le=Math.min(se.e.r,8191),re=se.s.c;re<=se.e.c;++re)Ce[re]=$o(re);for(var yt=se.s.r;yt<=Le;++yt){var je=ys(yt);for(re=se.s.c;re<=se.e.c;++re){var st=me?(j["!data"][yt]||[])[re]:j[Ce[re]+je];if(!(!st||st.t=="z"))if(st.t=="n")(st.v|0)==st.v&&st.v>=-32768&&st.v<=32767?Ag(oe,13,v(yt,re,st.v)):Ag(oe,14,g(yt,re,st.v));else{var Nt=$S(st);Ag(oe,15,c(yt,re,Nt.slice(0,239)))}}}return Ag(oe,1),oe.end()}function i(j,Q){var ie=Q||{};if(+ie.codepage>=0&&r0(+ie.codepage),ie.type=="string")throw new Error("Cannot write WK3 to JS string");var oe=yQ();Ag(oe,0,o(j));for(var se=0,me=0;se8191&&(ie=8191),Q.write_shift(2,ie),Q.write_shift(1,se),Q.write_shift(1,oe),Q.write_shift(2,0),Q.write_shift(2,0),Q.write_shift(1,1),Q.write_shift(1,2),Q.write_shift(4,0),Q.write_shift(4,0),Q}function s(j,Q,ie){var oe={s:{c:0,r:0},e:{c:0,r:0}};return Q==8&&ie.qpro?(oe.s.c=j.read_shift(1),j.l++,oe.s.r=j.read_shift(2),oe.e.c=j.read_shift(1),j.l++,oe.e.r=j.read_shift(2),oe):(oe.s.c=j.read_shift(2),oe.s.r=j.read_shift(2),Q==12&&ie.qpro&&(j.l+=2),oe.e.c=j.read_shift(2),oe.e.r=j.read_shift(2),Q==12&&ie.qpro&&(j.l+=2),oe.s.c==65535&&(oe.s.c=oe.e.c=oe.s.r=oe.e.r=0),oe)}function l(j){var Q=Ku(8);return Q.write_shift(2,j.s.c),Q.write_shift(2,j.s.r),Q.write_shift(2,j.e.c),Q.write_shift(2,j.e.r),Q}function u(j,Q,ie){var oe=[{c:0,r:0},{t:"n",v:0},0,0];return ie.qpro&&ie.vers!=20768?(oe[0].c=j.read_shift(1),oe[3]=j.read_shift(1),oe[0].r=j.read_shift(2),j.l+=2):ie.works?(oe[0].c=j.read_shift(2),oe[0].r=j.read_shift(2),oe[2]=j.read_shift(2)):(oe[2]=j.read_shift(1),oe[0].c=j.read_shift(2),oe[0].r=j.read_shift(2)),oe}function h(j,Q,ie){var oe=j.l+Q,se=u(j,Q,ie);if(se[1].t="s",ie.vers==20768){j.l++;var me=j.read_shift(1);return se[1].v=j.read_shift(me,"utf8"),se}return ie.qpro&&j.l++,se[1].v=j.read_shift(oe-j.l,"cstr"),se}function c(j,Q,ie){var oe=Ku(7+ie.length);oe.write_shift(1,255),oe.write_shift(2,Q),oe.write_shift(2,j),oe.write_shift(1,39);for(var se=0;se=128?95:me)}return oe.write_shift(1,0),oe}function f(j,Q,ie){var oe=j.l+Q,se=u(j,Q,ie);if(se[1].t="s",ie.vers==20768){var me=j.read_shift(1);return se[1].v=j.read_shift(me,"utf8"),se}return se[1].v=j.read_shift(oe-j.l,"cstr"),se}function d(j,Q,ie){var oe=u(j,Q,ie);return oe[1].v=j.read_shift(2,"i"),oe}function v(j,Q,ie){var oe=Ku(7);return oe.write_shift(1,255),oe.write_shift(2,Q),oe.write_shift(2,j),oe.write_shift(2,ie,"i"),oe}function p(j,Q,ie){var oe=u(j,Q,ie);return oe[1].v=j.read_shift(8,"f"),oe}function g(j,Q,ie){var oe=Ku(13);return oe.write_shift(1,255),oe.write_shift(2,Q),oe.write_shift(2,j),oe.write_shift(8,ie,"f"),oe}function m(j,Q,ie){var oe=j.l+Q,se=u(j,Q,ie);if(se[1].v=j.read_shift(8,"f"),ie.qpro)j.l=oe;else{var me=j.read_shift(2);S(j.slice(j.l,j.l+me),se),j.l+=me}return se}function y(j,Q,ie){var oe=Q&32768;return Q&=-32769,Q=(oe?j:0)+(Q>=8192?Q-16384:Q),(oe?"":"$")+(ie?$o(Q):ys(Q))}var _={31:["NA",0],33:["ABS",1],34:["TRUNC",1],35:["SQRT",1],36:["LOG",1],37:["LN",1],38:["PI",0],39:["SIN",1],40:["COS",1],41:["TAN",1],42:["ATAN2",2],43:["ATAN",1],44:["ASIN",1],45:["ACOS",1],46:["EXP",1],47:["MOD",2],49:["ISNA",1],50:["ISERR",1],51:["FALSE",0],52:["TRUE",0],53:["RAND",0],63:["ROUND",2],68:["ISNUMBER",1],69:["ISTEXT",1],70:["LEN",1],71:["VALUE",1],73:["MID",3],74:["CHAR",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],102:["UPPER",1],103:["LOWER",1],107:["PROPER",1],109:["TRIM",1],111:["T",1]},x=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function S(j,Q){eh(j,0);for(var ie=[],oe=0,se="",me="",Ce="",Le="";j.lie.length){console.error("WK1 bad formula parse 0x"+re.toString(16)+":|"+ie.join("|")+"|");return}var Nt=ie.slice(-oe);ie.length-=oe,ie.push(_[re][0]+"("+Nt.join(",")+")")}else return re<=7?console.error("WK1 invalid opcode "+re.toString(16)):re<=24?console.error("WK1 unsupported op "+re.toString(16)):re<=30?console.error("WK1 invalid opcode "+re.toString(16)):re<=115?console.error("WK1 unsupported function opcode "+re.toString(16)):console.error("WK1 unrecognized opcode "+re.toString(16))}}ie.length==1?Q[1].f=""+ie[0]:console.error("WK1 bad formula parse |"+ie.join("|")+"|")}function w(j){var Q=[{c:0,r:0},{t:"n",v:0},0];return Q[0].r=j.read_shift(2),Q[3]=j[j.l++],Q[0].c=j[j.l++],Q}function b(j,Q){var ie=w(j);return ie[1].t="s",ie[1].v=j.read_shift(Q-4,"cstr"),ie}function E(j,Q,ie,oe){var se=Ku(6+oe.length);se.write_shift(2,j),se.write_shift(1,ie),se.write_shift(1,Q),se.write_shift(1,39);for(var me=0;me=128?95:Ce)}return se.write_shift(1,0),se}function T(j,Q){var ie=w(j);ie[1].v=j.read_shift(2);var oe=ie[1].v>>1;if(ie[1].v&1)switch(oe&7){case 0:oe=(oe>>3)*5e3;break;case 1:oe=(oe>>3)*500;break;case 2:oe=(oe>>3)/20;break;case 3:oe=(oe>>3)/200;break;case 4:oe=(oe>>3)/2e3;break;case 5:oe=(oe>>3)/2e4;break;case 6:oe=(oe>>3)/16;break;case 7:oe=(oe>>3)/64;break}return ie[1].v=oe,ie}function C(j,Q){var ie=w(j),oe=j.read_shift(4),se=j.read_shift(4),me=j.read_shift(2);if(me==65535)return oe===0&&se===3221225472?(ie[1].t="e",ie[1].v=15):oe===0&&se===3489660928?(ie[1].t="e",ie[1].v=42):ie[1].v=0,ie;var Ce=me&32768;return me=(me&32767)-16446,ie[1].v=(1-Ce*2)*(se*Math.pow(2,me+32)+oe*Math.pow(2,me)),ie}function A(j,Q,ie,oe){var se=Ku(14);if(se.write_shift(2,j),se.write_shift(1,ie),se.write_shift(1,Q),oe==0)return se.write_shift(4,0),se.write_shift(4,0),se.write_shift(2,65535),se;var me=0,Ce=0,Le=0,re=0;return oe<0&&(me=1,oe=-oe),Ce=Math.log2(oe)|0,oe/=Math.pow(2,Ce-31),re=oe>>>0,(re&2147483648)==0&&(oe/=2,++Ce,re=oe>>>0),oe-=re,re|=2147483648,re>>>=0,oe*=Math.pow(2,32),Le=oe>>>0,se.write_shift(4,Le),se.write_shift(4,re),Ce+=16383+(me?32768:0),se.write_shift(2,Ce),se}function M(j,Q){var ie=C(j);return j.l+=Q-14,ie}function I(j,Q){var ie=w(j),oe=j.read_shift(4);return ie[1].v=oe>>6,ie}function R(j,Q){var ie=w(j),oe=j.read_shift(8,"f");return ie[1].v=oe,ie}function k(j,Q){var ie=R(j);return j.l+=Q-12,ie}function D(j,Q){return j[j.l+Q-1]==0?j.read_shift(Q,"cstr"):""}function G(j,Q){var ie=j[j.l++];ie>Q-1&&(ie=Q-1);for(var oe="";oe.length127?95:se}return ie[ie.l++]=0,ie}var q={0:{n:"BOF",f:nu},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:s},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:d},14:{n:"NUMBER",f:p},15:{n:"LABEL",f:h},16:{n:"FORMULA",f:m},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:D},222:{n:"SHEETNAMELP",f:G},255:{n:"BOF",f:nu},65535:{n:""}},Y={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:b},23:{n:"NUMBER17",f:C},24:{n:"NUMBER18",f:T},25:{n:"FORMULA19",f:M},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:z},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:I},38:{n:"??"},39:{n:"NUMBER27",f:R},40:{n:"FORMULA28",f:k},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:D},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:W},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};function le(j,Q){eh(j,0);var ie=Q||{},oe={};ie.dense&&(oe["!data"]=[]);var se=[],me="",Ce={s:{r:-1,c:-1},e:{r:-1,c:-1}},Le=0,re=0,yt=0,je=0,st={SheetNames:[],Sheets:{}};e:for(;j.l255||Ce.s.r>999999)break;Ce.e.cyt&&(Ce.s.c=yt),je=qe.read_shift(4),Ce.s.r>je&&(Ce.s.r=je),je=qe.read_shift(4),Ce.e.rje&&(Ce.s.r=je),Ce.e.r0&&Le>=0;){if(Oe&32)switch(Oe&31){case 2:ft={t:"n",v:ft.v+We&65535};break;case 3:ft={t:"n",v:ft.v+We&65535},ft.v>32767&&(ft.v-=65536);break;case 7:ft={t:"s",v:se[re=re+We>>>0]};break;default:throw"Cannot apply delta for QPW cell type "+(Oe&31)}else switch(Oe&31){case 1:ft={t:"z"};break;case 2:ft={t:"n",v:qe.read_shift(2)};break;case 7:ft={t:"s",v:se[re=qe.read_shift(4)-1]};break;default:throw"Cannot apply repeat for QPW cell type "+(Oe&31)}!ie.sheetStubs&&ft.t=="z"||(oe["!data"]!=null?(oe["!data"][je]||(oe["!data"][je]=[]),oe["!data"][je][yt]=ft):oe[Dt+ys(je)]=ft),++je,--Le}}}break}j.l+=Zt}return st}return{sheet_to_wk1:r,book_to_wk3:i,to_workbook:e}}();function GRt(n){var e={},t=n.match(nf),r=0,i=!1;if(t)for(;r!=t.length;++r){var a=Tn(t[r]);switch(a[0].replace(/\w*:/g,"")){case"":case"":e.shadow=1;break;case"":break;case"":case"":e.outline=1;break;case"":break;case"":case"":e.strike=1;break;case"":break;case"":case"":e.u=1;break;case"":break;case"":case"":e.b=1;break;case"":break;case"":case"":e.i=1;break;case"":break;case"":case"":case"":break;case"":case"":case"":break;case"":case"":case"":break;case"":case"":case"":break;case"":case"":break;case"":i=!1;break;default:if(a[0].charCodeAt(1)!==47&&!i)throw new Error("Unrecognized rich format "+a[0])}}return e}var zRt=function(){var n=LD("t"),e=LD("rPr");function t(a){var o=a.match(n);if(!o)return{t:"s",v:""};var s={t:"s",v:so(o[1])},l=a.match(e);return l&&(s.s=GRt(l[1])),s}var r=/<(?:\w+:)?r>/g,i=/<\/(?:\w+:)?r>/;return function(o){return o.replace(r,"").split(i).map(t).filter(function(s){return s.v})}}(),URt=function(){var e=/(\r\n|\n)/g;function t(i,a,o){var s=[];i.u&&s.push("text-decoration: underline;"),i.uval&&s.push("text-underline-style:"+i.uval+";"),i.sz&&s.push("font-size:"+i.sz+"pt;"),i.outline&&s.push("text-effect: outline;"),i.shadow&&s.push("text-shadow: auto;"),a.push(''),i.b&&(a.push(""),o.push("")),i.i&&(a.push(""),o.push("")),i.strike&&(a.push(""),o.push(""));var l=i.valign||"";return l=="superscript"||l=="super"?l="sup":l=="subscript"&&(l="sub"),l!=""&&(a.push("<"+l+">"),o.push("")),o.push(""),i}function r(i){var a=[[],i.v,[]];return i.v?(i.s&&t(i.s,a[0],a[2]),a[0].join("")+a[1].replace(e,"
")+a[2].join("")):""}return function(a){return a.map(r).join("")}}(),VRt=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,$Rt=/<(?:\w+:)?r\b[^>]*>/,WRt=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function boe(n,e){var t=e?e.cellHTML:!0,r={};return n?(n.match(/^\s*<(?:\w+:)?t[^>]*>/)?(r.t=so(As(n.slice(n.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||""),!0),r.r=As(n),t&&(r.h=ZG(r.t))):n.match($Rt)&&(r.r=As(n),r.t=so(As((n.replace(WRt,"").match(VRt)||[]).join("").replace(nf,"")),!0),t&&(r.h=URt(zRt(r.r)))),r):{t:""}}var HRt=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,jRt=/<(?:\w+:)?(?:si|sstItem)>/g,XRt=/<\/(?:\w+:)?(?:si|sstItem)>/;function YRt(n,e){var t=[],r="";if(!n)return t;var i=n.match(HRt);if(i){r=i[2].replace(jRt,"").split(XRt);for(var a=0;a!=r.length;++a){var o=boe(r[a].trim(),e);o!=null&&(t[t.length]=o)}i=Tn(i[1]),t.Count=i.count,t.Unique=i.uniqueCount}return t}function qRt(n){return[n.read_shift(4),n.read_shift(4)]}function ZRt(n,e){var t=[],r=!1;return B_(n,function(a,o,s){switch(s){case 159:t.Count=a[0],t.Unique=a[1];break;case 19:t.push(a);break;case 160:return!0;case 35:r=!0;break;case 36:r=!1;break;default:if(o.T,!r||e.WTF)throw new Error("Unexpected record 0x"+s.toString(16))}}),t}function eGe(n){for(var e=[],t=n.split(""),r=0;r=4&&(n.l+=e-4),t}function KRt(n){var e={};return e.id=n.read_shift(0,"lpp4"),e.R=Y1(n,4),e.U=Y1(n,4),e.W=Y1(n,4),e}function JRt(n){for(var e=n.read_shift(4),t=n.l+e-4,r={},i=n.read_shift(4),a=[];i-- >0;)a.push({t:n.read_shift(4),v:n.read_shift(0,"lpp4")});if(r.name=n.read_shift(0,"lpp4"),r.comps=a,n.l!=t)throw new Error("Bad DataSpaceMapEntry: "+n.l+" != "+t);return r}function QRt(n){var e=[];n.l+=4;for(var t=n.read_shift(4);t-- >0;)e.push(JRt(n));return e}function eDt(n){var e=[];n.l+=4;for(var t=n.read_shift(4);t-- >0;)e.push(n.read_shift(0,"lpp4"));return e}function tDt(n){var e={};return n.read_shift(4),n.l+=4,e.id=n.read_shift(0,"lpp4"),e.name=n.read_shift(0,"lpp4"),e.R=Y1(n,4),e.U=Y1(n,4),e.W=Y1(n,4),e}function rDt(n){var e=tDt(n);if(e.ename=n.read_shift(0,"8lpp4"),e.blksz=n.read_shift(4),e.cmode=n.read_shift(4),n.read_shift(4)!=4)throw new Error("Bad !Primary record");return e}function tGe(n,e){var t=n.l+e,r={};r.Flags=n.read_shift(4)&63,n.l+=4,r.AlgID=n.read_shift(4);var i=!1;switch(r.AlgID){case 26126:case 26127:case 26128:i=r.Flags==36;break;case 26625:i=r.Flags==4;break;case 0:i=r.Flags==16||r.Flags==4||r.Flags==36;break;default:throw"Unrecognized encryption algorithm: "+r.AlgID}if(!i)throw new Error("Encryption Flags/AlgID mismatch");return r.AlgIDHash=n.read_shift(4),r.KeySize=n.read_shift(4),r.ProviderType=n.read_shift(4),n.l+=8,r.CSPName=n.read_shift(t-n.l>>1,"utf16le"),n.l=t,r}function rGe(n,e){var t={},r=n.l+e;return n.l+=4,t.Salt=n.slice(n.l,n.l+16),n.l+=16,t.Verifier=n.slice(n.l,n.l+16),n.l+=16,n.read_shift(4),t.VerifierHash=n.slice(n.l,r),n.l=r,t}function nDt(n){var e=Y1(n);switch(e.Minor){case 2:return[e.Minor,iDt(n)];case 3:return[e.Minor,aDt()];case 4:return[e.Minor,oDt(n)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+e.Minor)}function iDt(n){var e=n.read_shift(4);if((e&63)!=36)throw new Error("EncryptionInfo mismatch");var t=n.read_shift(4),r=tGe(n,t),i=rGe(n,n.length-n.l);return{t:"Std",h:r,v:i}}function aDt(){throw new Error("File is password-protected: ECMA-376 Extensible")}function oDt(n){var e=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];n.l+=4;var t=n.read_shift(n.length-n.l,"utf8"),r={};return t.replace(nf,function(a){var o=Tn(a);switch(N0(o[0])){case"":break;case"":case"":break;case"":break;case"4||r.Major<2)throw new Error("unrecognized major version code: "+r.Major);t.Flags=n.read_shift(4),e-=4;var i=n.read_shift(4);return e-=4,t.EncryptionHeader=tGe(n,i),e-=i,t.EncryptionVerifier=rGe(n,e),t}function lDt(n){var e={},t=e.EncryptionVersionInfo=Y1(n,4);if(t.Major!=1||t.Minor!=1)throw"unrecognized version code "+t.Major+" : "+t.Minor;return e.Salt=n.read_shift(16),e.EncryptedVerifier=n.read_shift(16),e.EncryptedVerifierHash=n.read_shift(16),e}function uDt(n){var e=0,t,r=eGe(n),i=r.length+1,a,o,s,l,u;for(t=VS(i),t[0]=r.length,a=1;a!=i;++a)t[a]=r[a-1];for(a=i-1;a>=0;--a)o=t[a],s=(e&16384)===0?0:1,l=e<<1&32767,u=s|l,e=u^o;return e^52811}var nGe=function(){var n=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],e=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],t=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],r=function(o){return(o/2|o*128)&255},i=function(o,s){return r(o^s)},a=function(o){for(var s=e[o.length-1],l=104,u=o.length-1;u>=0;--u)for(var h=o[u],c=0;c!=7;++c)h&64&&(s^=t[l]),h*=2,--l;return s};return function(o){for(var s=eGe(o),l=a(s),u=s.length,h=VS(16),c=0;c!=16;++c)h[c]=0;var f,d,v;for((u&1)===1&&(f=l>>8,h[u]=i(n[0],f),--u,f=l&255,d=s[s.length-1],h[u]=i(d,f));u>0;)--u,f=l>>8,h[u]=i(s[u],f),--u,f=l&255,h[u]=i(s[u],f);for(u=15,v=15-s.length;v>0;)f=l>>8,h[u]=i(n[v],f),--u,--v,f=l&255,h[u]=i(s[u],f),--u,--v;return h}}(),hDt=function(n,e,t,r,i){i||(i=e),r||(r=nGe(n));var a,o;for(a=0;a!=e.length;++a)o=e[a],o^=r[t],o=(o>>5|o<<3)&255,i[a]=o,++t;return[i,t,r]},cDt=function(n){var e=0,t=nGe(n);return function(r){var i=hDt("",r,e,t);return e=i[1],i[0]}};function fDt(n,e,t,r){var i={key:nu(n),verificationBytes:nu(n)};return t.password&&(i.verifier=uDt(t.password)),r.valid=i.verificationBytes===i.verifier,r.valid&&(r.insitu=cDt(t.password)),i}function dDt(n,e,t){var r=t||{};return r.Info=n.read_shift(2),n.l-=2,r.Info===1?r.Data=lDt(n):r.Data=sDt(n,e),r}function vDt(n,e,t){var r={Type:t.biff>=8?n.read_shift(2):0};return r.Type?dDt(n,e-2,r):fDt(n,t.biff>=8?e:e-2,t,r),r}function pDt(n,e){switch(e.type){case"base64":return K4(Tv(n),e);case"binary":return K4(n,e);case"buffer":return K4(oo&&Buffer.isBuffer(n)?n.toString("binary"):p_(n),e);case"array":return K4(t2(n),e)}throw new Error("Unrecognized type "+e.type)}function K4(n,e){var t=e||{},r={},i=t.dense;i&&(r["!data"]=[]);var a=n.match(/\\trowd[\s\S]*?\\row\b/g);if(!a)throw new Error("RTF missing table");var o={s:{c:0,r:0},e:{c:0,r:a.length-1}},s=[];return a.forEach(function(l,u){i&&(s=r["!data"][u]=[]);for(var h=/\\[\w\-]+\b/g,c=0,f,d=-1,v=[];(f=h.exec(l))!=null;){var p=l.slice(c,h.lastIndex-f[0].length);switch(p.charCodeAt(0)==32&&(p=p.slice(1)),p.length&&v.push(p),f[0]){case"\\cell":if(++d,v.length){var g={v:v.join(""),t:"s"};g.v=="TRUE"||g.v=="FALSE"?(g.v=g.v=="TRUE",g.t="b"):isNaN(mv(g.v))||(g.t="n",t.cellText!==!1&&(g.w=g.v),g.v=mv(g.v)),i?s[d]=g:r[bo({r:u,c:d})]=g}v=[];break;case"\\par":v.push(` `);break}c=h.lastIndex}d>o.e.c&&(o.e.c=d)}),r["!ref"]=lo(o),r}function gDt(n,e){var t=ww(pDt(n,e),e);return t.bookType="rtf",t}function yDt(n){var e=n.slice(n[0]==="#"?1:0).slice(0,6);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function OD(n){for(var e=0,t=1;e!=3;++e)t=t*256+(n[e]>255?255:n[e]<0?0:n[e]);return t.toString(16).toUpperCase().slice(1)}function mDt(n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i=Math.max(e,t,r),a=Math.min(e,t,r),o=i-a;if(o===0)return[0,0,e];var s=0,l=0,u=i+a;switch(l=o/(u>1?2-u:u),i){case e:s=((t-r)/o+6)%6;break;case t:s=(r-e)/o+2;break;case r:s=(e-t)/o+4;break}return[s/6,l,u/2]}function _Dt(n){var e=n[0],t=n[1],r=n[2],i=t*2*(r<.5?r:1-r),a=r-i/2,o=[a,a,a],s=6*e,l;if(t!==0)switch(s|0){case 0:case 6:l=i*s,o[0]+=i,o[1]+=l;break;case 1:l=i*(2-s),o[0]+=l,o[1]+=i;break;case 2:l=i*(s-2),o[1]+=i,o[2]+=l;break;case 3:l=i*(4-s),o[1]+=l,o[2]+=i;break;case 4:l=i*(s-4),o[2]+=i,o[0]+=l;break;case 5:l=i*(6-s),o[2]+=l,o[0]+=i;break}for(var u=0;u!=3;++u)o[u]=Math.round(o[u]*255);return o}function e9(n,e){if(e===0)return n;var t=mDt(yDt(n));return e<0?t[2]=t[2]*(1+e):t[2]=1-(1-t[2])*(1-e),OD(_Dt(t))}var iGe=6,xDt=15,SDt=1,Ef=iGe;function t9(n){return Math.floor((n+Math.round(128/Ef)/256)*Ef)}function r9(n){return Math.floor((n-5)/Ef*100+.5)/100}function SQ(n){return Math.round((n*Ef+5)/Ef*256)/256}function mX(n){return SQ(r9(t9(n)))}function Eoe(n){var e=Math.abs(n-mX(n)),t=Ef;if(e>.005)for(Ef=SDt;Ef":case"":break;case"":case"":i={},s.diagonalUp&&(i.diagonalUp=ps(s.diagonalUp)),s.diagonalDown&&(i.diagonalDown=ps(s.diagonalDown)),e.Borders.push(i);break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":case"":break;case"":break;case"":case"":break;case"":break;case"":case"":break;case"":break;case"":case"":break;case"":break;case"":case"":break;case"":break;case"":break;case"":case"":break;case"":case"":break;case"":a=!1;break;default:if(r&&r.WTF&&!a)throw new Error("unrecognized "+s[0]+" in borders")}})}function TDt(n,e,t,r){e.Fills=[];var i={},a=!1;(n[0].match(nf)||[]).forEach(function(o){var s=Tn(o);switch(N0(s[0])){case"":case"":break;case"":case"":i={},e.Fills.push(i);break;case"":break;case"":break;case"":e.Fills.push(i),i={};break;case"":s.patternType&&(i.patternType=s.patternType);break;case"":case"":break;case"":case"":break;case"":case"":break;case"":break;case"
":break;case"":break;case"":break;case"":case"":break;case"":a=!1;break;default:if(r&&r.WTF&&!a)throw new Error("unrecognized "+s[0]+" in fills")}})}function CDt(n,e,t,r){e.Fonts=[];var i={},a=!1;(n[0].match(nf)||[]).forEach(function(o){var s=Tn(o);switch(N0(s[0])){case"":case"":break;case"":break;case"":case"":e.Fonts.push(i),i={};break;case"":case"":break;case"":i.bold=1;break;case"":i.italic=1;break;case"":i.underline=1;break;case"":i.strike=1;break;case"":i.outline=1;break;case"":i.shadow=1;break;case"":i.condense=1;break;case"":i.extend=1;break;case"":case"":break;case"":case"":break;case"":case"":break;case"":case"":break;case"":case"":break;case"":a=!1;break;case"":case"":break;case"":a=!1;break;default:if(r&&r.WTF&&!a)throw new Error("unrecognized "+s[0]+" in fonts")}})}function ADt(n,e,t){e.NumberFmt=[];for(var r=h0(ji),i=0;i":case"":case"":break;case"0){if(l>392){for(l=392;l>60&&e.NumberFmt[l]!=null;--l);e.NumberFmt[l]=s}OE(s,l)}}break;case"":break;default:if(t.WTF)throw new Error("unrecognized "+o[0]+" in numFmts")}}}var J4=["numFmtId","fillId","fontId","borderId","xfId"],Q4=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function MDt(n,e,t){e.CellXf=[];var r,i=!1;(n[0].match(nf)||[]).forEach(function(a){var o=Tn(a),s=0;switch(N0(o[0])){case"":case"":case"":break;case"":for(r=o,delete r[0],s=0;s392){for(s=392;s>60;--s)if(e.NumberFmt[r.numFmtId]==e.NumberFmt[s]){r.numFmtId=s;break}}e.CellXf.push(r);break;case"":break;case"":var l={};o.vertical&&(l.vertical=o.vertical),o.horizontal&&(l.horizontal=o.horizontal),o.textRotation!=null&&(l.textRotation=o.textRotation),o.indent&&(l.indent=o.indent),o.wrapText&&(l.wrapText=ps(o.wrapText)),r.alignment=l;break;case"":break;case"":case"":break;case"":i=!1;break;case"":case"":break;case"":i=!1;break;default:if(t&&t.WTF&&!i)throw new Error("unrecognized "+o[0]+" in cellXfs")}})}var IDt=function(){var e=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,t=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,r=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,i=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,a=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(s,l,u){var h={};if(!s)return h;s=s.replace(//mg,"").replace(//gm,"");var c;return(c=s.match(e))&&ADt(c,h,u),(c=s.match(i))&&CDt(c,h,l,u),(c=s.match(r))&&TDt(c,h,l,u),(c=s.match(a))&&EDt(c,h,l,u),(c=s.match(t))&&MDt(c,h,u),h}}();function LDt(n,e){var t=n.read_shift(2),r=Wc(n);return[t,r]}function PDt(n,e,t){var r={};r.sz=n.read_shift(2)/20;var i=VPt(n);i.fItalic&&(r.italic=1),i.fCondense&&(r.condense=1),i.fExtend&&(r.extend=1),i.fShadow&&(r.shadow=1),i.fOutline&&(r.outline=1),i.fStrikeout&&(r.strike=1);var a=n.read_shift(2);switch(a===700&&(r.bold=1),n.read_shift(2)){case 1:r.vertAlign="superscript";break;case 2:r.vertAlign="subscript";break}var o=n.read_shift(1);o!=0&&(r.underline=o);var s=n.read_shift(1);s>0&&(r.family=s);var l=n.read_shift(1);switch(l>0&&(r.charset=l),n.l++,r.color=UPt(n),n.read_shift(1)){case 1:r.scheme="major";break;case 2:r.scheme="minor";break}return r.name=Wc(n),r}var ODt=Kc;function RDt(n,e){var t=n.l+e,r=n.read_shift(2),i=n.read_shift(2);return n.l=t,{ixfe:r,numFmtId:i}}var DDt=Kc;function NDt(n,e,t){var r={};r.NumberFmt=[];for(var i in ji)r.NumberFmt[i]=ji[i];r.CellXf=[],r.Fonts=[];var a=[],o=!1;return B_(n,function(l,u,h){switch(h){case 44:r.NumberFmt[l[0]]=l[1],OE(l[1],l[0]);break;case 43:r.Fonts.push(l),l.color.theme!=null&&e&&e.themeElements&&e.themeElements.clrScheme&&(l.color.rgb=e9(e.themeElements.clrScheme[l.color.theme].rgb,l.color.tint||0));break;case 1025:break;case 45:break;case 46:break;case 47:a[a.length-1]==617&&r.CellXf.push(l);break;case 48:case 507:case 572:case 475:break;case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 35:o=!0;break;case 36:o=!1;break;case 37:a.push(h),o=!0;break;case 38:a.pop(),o=!1;break;default:if(u.T>0)a.push(h);else if(u.T<0)a.pop();else if(!o||t.WTF&&a[a.length-1]!=37)throw new Error("Unexpected record 0x"+h.toString(16))}}),r}var kDt=["","","","","","","","","","","",""];function FDt(n,e,t){e.themeElements.clrScheme=[];var r={};(n[0].match(nf)||[]).forEach(function(i){var a=Tn(i);switch(a[0]){case"":break;case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":case"":a[0].charAt(1)==="/"?(e.themeElements.clrScheme[kDt.indexOf(a[0])]=r,r={}):r.name=a[0].slice(3,a[0].length-1);break;default:if(t&&t.WTF)throw new Error("Unrecognized "+a[0]+" in clrScheme")}})}function BDt(){}function GDt(){}var zDt=/]*)>[\s\S]*<\/a:clrScheme>/,UDt=/]*)>[\s\S]*<\/a:fontScheme>/,VDt=/]*)>[\s\S]*<\/a:fmtScheme>/;function $Dt(n,e,t){e.themeElements={};var r;[["clrScheme",zDt,FDt],["fontScheme",UDt,BDt],["fmtScheme",VDt,GDt]].forEach(function(i){if(!(r=n.match(i[1])))throw new Error(i[0]+" not found in themeElements");i[2](r,e,t)})}var WDt=/]*)>[\s\S]*<\/a:themeElements>/;function sGe(n,e){(!n||n.length===0)&&(n=HDt());var t,r={};if(!(t=n.match(WDt)))throw new Error("themeElements not found in theme");return $Dt(t[0],r,e),r.raw=n,r}function HDt(n,e){if(e&&e.themeXLSX)return e.themeXLSX;if(n&&typeof n.raw=="string")return n.raw;var t=[y8e];return t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]="",t[t.length]="",t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]="",t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]='',t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]='',t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]='',t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]='',t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]="",t[t.length]='',t[t.length]="",t[t.length]="",t[t.length]="",t[t.length]="",t.join("")}function jDt(n,e,t){var r=n.l+e,i=n.read_shift(4);if(i!==124226){if(!t.cellStyles){n.l=r;return}var a=n.slice(n.l);n.l=r;var o;try{o=g8e(a,{type:"array"})}catch{return}var s=cd(o,"theme/theme/theme1.xml",!0);if(!!s)return sGe(s,t)}}function XDt(n){return n.read_shift(4)}function YDt(n){var e={};switch(e.xclrType=n.read_shift(2),e.nTintShade=n.read_shift(2),e.xclrType){case 0:n.l+=4;break;case 1:e.xclrValue=qDt(n,4);break;case 2:e.xclrValue=X8e(n);break;case 3:e.xclrValue=XDt(n);break;case 4:n.l+=4;break}return n.l+=8,e}function qDt(n,e){return Kc(n,e)}function ZDt(n,e){return Kc(n,e)}function KDt(n){var e=n.read_shift(2),t=n.read_shift(2)-4,r=[e];switch(e){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:r[1]=YDt(n);break;case 6:r[1]=ZDt(n,t);break;case 14:case 15:r[1]=n.read_shift(t===1?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+e+" "+t)}return r}function JDt(n,e){var t=n.l+e;n.l+=2;var r=n.read_shift(2);n.l+=2;for(var i=n.read_shift(2),a=[];i-- >0;)a.push(KDt(n,t-n.l));return{ixfe:r,ext:a}}function QDt(n,e){e.forEach(function(t){switch(t[0]){}})}function eNt(n,e){return{flags:n.read_shift(4),version:n.read_shift(4),name:Wc(n)}}function tNt(n){for(var e=[],t=n.read_shift(4);t-- >0;)e.push([n.read_shift(4),n.read_shift(4)]);return e}function rNt(n){return n.l+=4,n.read_shift(4)!=0}function nNt(n,e,t){var r={Types:[],Cell:[],Value:[]},i=t||{},a=[],o=!1,s=2;return B_(n,function(l,u,h){switch(h){case 335:r.Types.push({name:l.name});break;case 51:l.forEach(function(c){s==1?r.Cell.push({type:r.Types[c[0]-1].name,index:c[1]}):s==0&&r.Value.push({type:r.Types[c[0]-1].name,index:c[1]})});break;case 337:s=l?1:0;break;case 338:s=2;break;case 35:a.push(h),o=!0;break;case 36:a.pop(),o=!1;break;default:if(!u.T){if(!o||i.WTF&&a[a.length-1]!=35)throw new Error("Unexpected record 0x"+h.toString(16))}}}),r}function iNt(n,e,t){var r={Types:[],Cell:[],Value:[]};if(!n)return r;var i=!1,a=2,o;return n.replace(nf,function(s){var l=Tn(s);switch(N0(l[0])){case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":break;case"":a=2;break;case"":a=2;break;case"":case"":case"":break;case"":i=!1;break;case"":case"":break;case"]*r:id="([^"]*)"/)||["",""])[1];return e["!id"][t].Target}function V_e(n,e,t,r){var i=n["!data"]!=null,a;e.forEach(function(o){var s=zc(o.ref);if(!(s.r<0||s.c<0)){if(i?(n["!data"][s.r]||(n["!data"][s.r]=[]),a=n["!data"][s.r][s.c]):a=n[o.ref],!a){a={t:"z"},i?n["!data"][s.r][s.c]=a:n[o.ref]=a;var l=cu(n["!ref"]||"BDWGO1000001:A1");l.s.r>s.r&&(l.s.r=s.r),l.e.rs.c&&(l.s.c=s.c),l.e.c=0;--c){if(!t&&a.c[c].T)return;t&&!a.c[c].T&&a.c.splice(c,1)}if(t&&r){for(c=0;c/))return[];var t=[],r=[],i=n.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);i&&i[1]&&i[1].split(/<\/\w*:?author>/).forEach(function(o){if(!(o===""||o.trim()==="")){var s=o.match(/<(?:\w+:)?author[^>]*>(.*)/);s&&t.push(s[1])}});var a=n.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return a&&a[1]&&a[1].split(/<\/\w*:?comment>/).forEach(function(o){if(!(o===""||o.trim()==="")){var s=o.match(/<(?:\w+:)?comment[^>]*>/);if(!!s){var l=Tn(s[0]),u={author:l.authorId&&t[l.authorId]||"sheetjsghost",ref:l.ref,guid:l.guid},h=zc(l.ref);if(!(e.sheetRows&&e.sheetRows<=h.r)){var c=o.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),f=!!c&&!!c[1]&&boe(c[1])||{r:"",t:"",h:""};u.r=f.r,f.r==""&&(f.t=f.h=""),u.t=(f.t||"").replace(/\r\n/g,` `).replace(/\r/g,` `),e.cellHTML&&(u.h=f.h),r.push(u)}}}}),r}function cNt(n,e){var t=[],r=!1,i={},a=0;return n.replace(nf,function(s,l){var u=Tn(s);switch(N0(u[0])){case"":break;case"":i.t!=null&&t.push(i);break;case"":case"":i.t=n.slice(a,l).replace(/\r\n/g,` `).replace(/\r/g,` `);break;case"":r=!0;break;case"":r=!1;break;case"":case"":case"":break;case"":r=!1;break;default:if(!r&&e.WTF)throw new Error("unrecognized "+u[0]+" in threaded comments")}return s}),t}function fNt(n,e){var t=[],r=!1;return n.replace(nf,function(a){var o=Tn(a);switch(N0(o[0])){case"":break;case"":break;case"":case"":case"":break;case"":r=!1;break;default:if(!r&&e.WTF)throw new Error("unrecognized "+o[0]+" in threaded comments")}return a}),t}function dNt(n){var e={};e.iauthor=n.read_shift(4);var t=rT(n);return e.rfx=t.s,e.ref=bo(t.s),n.l+=16,e}var vNt=Wc;function pNt(n,e){var t=[],r=[],i={},a=!1;return B_(n,function(s,l,u){switch(u){case 632:r.push(s);break;case 635:i=s;break;case 637:i.t=s.t,i.h=s.h,i.r=s.r;break;case 636:if(i.author=r[i.iauthor],delete i.iauthor,e.sheetRows&&i.rfx&&e.sheetRows<=i.rfx.r)break;i.t||(i.t=""),delete i.rfx,t.push(i);break;case 3072:break;case 35:a=!0;break;case 36:a=!1;break;case 37:break;case 38:break;default:if(!l.T){if(!a||e.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}}),t}var gNt="application/vnd.ms-office.vbaProject";function yNt(n){var e=co.utils.cfb_new({root:"R"});return n.FullPaths.forEach(function(t,r){if(!(t.slice(-1)==="/"||!t.match(/_VBA_PROJECT_CUR/))){var i=t.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");co.utils.cfb_add(e,i,n.FileIndex[r].content)}}),co.write(e)}function mNt(){return{"!type":"dialog"}}function _Nt(){return{"!type":"dialog"}}function xNt(){return{"!type":"macro"}}function SNt(){return{"!type":"macro"}}var DE=function(){var n=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,e={r:0,c:0};function t(r,i,a,o){var s=!1,l=!1;a.length==0?l=!0:a.charAt(0)=="["&&(l=!0,a=a.slice(1,-1)),o.length==0?s=!0:o.charAt(0)=="["&&(s=!0,o=o.slice(1,-1));var u=a.length>0?parseInt(a,10)|0:0,h=o.length>0?parseInt(o,10)|0:0;return s?h+=e.c:--h,l?u+=e.r:--u,i+(s?"":"$")+$o(h)+(l?"":"$")+ys(u)}return function(i,a){return e=a,i.replace(n,t)}}(),lGe=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,wNt=function(){return function(e,t){return e.replace(lGe,function(r,i,a,o,s,l){var u=yoe(o)-(a?0:t.c),h=goe(l)-(s?0:t.r),c=s=="$"?h+1:h==0?"":"["+h+"]",f=a=="$"?u+1:u==0?"":"["+u+"]";return i+"R"+c+"C"+f})}}();function uGe(n,e){return n.replace(lGe,function(t,r,i,a,o,s){return r+(i=="$"?i+a:$o(yoe(a)+e.c))+(o=="$"?o+s:ys(goe(s)+e.r))})}function bNt(n,e,t){var r=eT(e),i=r.s,a=zc(t),o={r:a.r-i.r,c:a.c-i.c};return uGe(n,o)}function ENt(n){return n.length!=1}function $_e(n){return n.replace(/_xlfn\./g,"")}function bu(n){n.l+=1}function WS(n,e){var t=n.read_shift(e==1?1:2);return[t&16383,t>>14&1,t>>15&1]}function hGe(n,e,t){var r=2;if(t){if(t.biff>=2&&t.biff<=5)return cGe(n);t.biff==12&&(r=4)}var i=n.read_shift(r),a=n.read_shift(r),o=WS(n,2),s=WS(n,2);return{s:{r:i,c:o[0],cRel:o[1],rRel:o[2]},e:{r:a,c:s[0],cRel:s[1],rRel:s[2]}}}function cGe(n){var e=WS(n,2),t=WS(n,2),r=n.read_shift(1),i=n.read_shift(1);return{s:{r:e[0],c:r,cRel:e[1],rRel:e[2]},e:{r:t[0],c:i,cRel:t[1],rRel:t[2]}}}function TNt(n,e,t){if(t.biff<8)return cGe(n);var r=n.read_shift(t.biff==12?4:2),i=n.read_shift(t.biff==12?4:2),a=WS(n,2),o=WS(n,2);return{s:{r,c:a[0],cRel:a[1],rRel:a[2]},e:{r:i,c:o[0],cRel:o[1],rRel:o[2]}}}function fGe(n,e,t){if(t&&t.biff>=2&&t.biff<=5)return CNt(n);var r=n.read_shift(t&&t.biff==12?4:2),i=WS(n,2);return{r,c:i[0],cRel:i[1],rRel:i[2]}}function CNt(n){var e=WS(n,2),t=n.read_shift(1);return{r:e[0],c:t,cRel:e[1],rRel:e[2]}}function ANt(n){var e=n.read_shift(2),t=n.read_shift(2);return{r:e,c:t&255,fQuoted:!!(t&16384),cRel:t>>15,rRel:t>>15}}function MNt(n,e,t){var r=t&&t.biff?t.biff:8;if(r>=2&&r<=5)return INt(n);var i=n.read_shift(r>=12?4:2),a=n.read_shift(2),o=(a&16384)>>14,s=(a&32768)>>15;if(a&=16383,s==1)for(;i>524287;)i-=1048576;if(o==1)for(;a>8191;)a=a-16384;return{r:i,c:a,cRel:o,rRel:s}}function INt(n){var e=n.read_shift(2),t=n.read_shift(1),r=(e&32768)>>15,i=(e&16384)>>14;return e&=16383,r==1&&e>=8192&&(e=e-16384),i==1&&t>=128&&(t=t-256),{r:e,c:t,cRel:i,rRel:r}}function LNt(n,e,t){var r=(n[n.l++]&96)>>5,i=hGe(n,t.biff>=2&&t.biff<=5?6:8,t);return[r,i]}function PNt(n,e,t){var r=(n[n.l++]&96)>>5,i=n.read_shift(2,"i"),a=8;if(t)switch(t.biff){case 5:n.l+=12,a=6;break;case 12:a=12;break}var o=hGe(n,a,t);return[r,i,o]}function ONt(n,e,t){var r=(n[n.l++]&96)>>5;return n.l+=t&&t.biff>8?12:t.biff<8?6:8,[r]}function RNt(n,e,t){var r=(n[n.l++]&96)>>5,i=n.read_shift(2),a=8;if(t)switch(t.biff){case 5:n.l+=12,a=6;break;case 12:a=12;break}return n.l+=a,[r,i]}function DNt(n,e,t){var r=(n[n.l++]&96)>>5,i=TNt(n,e-1,t);return[r,i]}function NNt(n,e,t){var r=(n[n.l++]&96)>>5;return n.l+=t.biff==2?6:t.biff==12?14:7,[r]}function W_e(n){var e=n[n.l+1]&1,t=1;return n.l+=4,[e,t]}function kNt(n,e,t){n.l+=2;for(var r=n.read_shift(t&&t.biff==2?1:2),i=[],a=0;a<=r;++a)i.push(n.read_shift(t&&t.biff==2?1:2));return i}function FNt(n,e,t){var r=n[n.l+1]&255?1:0;return n.l+=2,[r,n.read_shift(t&&t.biff==2?1:2)]}function BNt(n,e,t){var r=n[n.l+1]&255?1:0;return n.l+=2,[r,n.read_shift(t&&t.biff==2?1:2)]}function GNt(n){var e=n[n.l+1]&255?1:0;return n.l+=2,[e,n.read_shift(2)]}function zNt(n,e,t){var r=n[n.l+1]&255?1:0;return n.l+=t&&t.biff==2?3:4,[r]}function dGe(n){var e=n.read_shift(1),t=n.read_shift(1);return[e,t]}function UNt(n){return n.read_shift(2),dGe(n)}function VNt(n){return n.read_shift(2),dGe(n)}function $Nt(n,e,t){var r=(n[n.l]&96)>>5;n.l+=1;var i=fGe(n,0,t);return[r,i]}function WNt(n,e,t){var r=(n[n.l]&96)>>5;n.l+=1;var i=MNt(n,0,t);return[r,i]}function HNt(n,e,t){var r=(n[n.l]&96)>>5;n.l+=1;var i=n.read_shift(2);t&&t.biff==5&&(n.l+=12);var a=fGe(n,0,t);return[r,i,a]}function jNt(n,e,t){var r=(n[n.l]&96)>>5;n.l+=1;var i=n.read_shift(t&&t.biff<=3?1:2);return[X3t[i],gGe[i],r]}function XNt(n,e,t){var r=n[n.l++],i=n.read_shift(1),a=t&&t.biff<=3?[r==88?-1:0,n.read_shift(1)]:YNt(n);return[i,(a[0]===0?gGe:j3t)[a[1]]]}function YNt(n){return[n[n.l+1]>>7,n.read_shift(2)&32767]}function qNt(n,e,t){n.l+=t&&t.biff==2?3:4}function ZNt(n,e,t){if(n.l++,t&&t.biff==12)return[n.read_shift(4,"i"),0];var r=n.read_shift(2),i=n.read_shift(t&&t.biff==2?1:2);return[r,i]}function KNt(n){return n.l++,nT[n.read_shift(1)]}function JNt(n){return n.l++,n.read_shift(2)}function QNt(n){return n.l++,n.read_shift(1)!==0}function e3t(n){return n.l++,Bc(n)}function t3t(n,e,t){return n.l++,N3(n,e-1,t)}function r3t(n,e){var t=[n.read_shift(1)];if(e==12)switch(t[0]){case 2:t[0]=4;break;case 4:t[0]=16;break;case 0:t[0]=1;break;case 1:t[0]=2;break}switch(t[0]){case 4:t[1]=tu(n,1)?"TRUE":"FALSE",e!=12&&(n.l+=7);break;case 37:case 16:t[1]=nT[n[n.l]],n.l+=e==12?4:8;break;case 0:n.l+=8;break;case 1:t[1]=Bc(n);break;case 2:t[1]=iT(n,0,{biff:e>0&&e<8?2:e});break;default:throw new Error("Bad SerAr: "+t[0])}return t}function n3t(n,e,t){for(var r=n.read_shift(t.biff==12?4:2),i=[],a=0;a!=r;++a)i.push((t.biff==12?rT:AU)(n));return i}function i3t(n,e,t){var r=0,i=0;t.biff==12?(r=n.read_shift(4),i=n.read_shift(4)):(i=1+n.read_shift(1),r=1+n.read_shift(2)),t.biff>=2&&t.biff<8&&(--r,--i==0&&(i=256));for(var a=0,o=[];a!=r&&(o[a]=[]);++a)for(var s=0;s!=i;++s)o[a][s]=r3t(n,t.biff);return o}function a3t(n,e,t){var r=n.read_shift(1)>>>5&3,i=!t||t.biff>=8?4:2,a=n.read_shift(i);switch(t.biff){case 2:n.l+=5;break;case 3:case 4:n.l+=8;break;case 5:n.l+=12;break}return[r,0,a]}function o3t(n,e,t){if(t.biff==5)return s3t(n);var r=n.read_shift(1)>>>5&3,i=n.read_shift(2),a=n.read_shift(4);return[r,i,a]}function s3t(n){var e=n.read_shift(1)>>>5&3,t=n.read_shift(2,"i");n.l+=8;var r=n.read_shift(2);return n.l+=12,[e,t,r]}function l3t(n,e,t){var r=n.read_shift(1)>>>5&3;n.l+=t&&t.biff==2?3:4;var i=n.read_shift(t&&t.biff==2?1:2);return[r,i]}function u3t(n,e,t){var r=n.read_shift(1)>>>5&3,i=n.read_shift(t&&t.biff==2?1:2);return[r,i]}function h3t(n,e,t){var r=n.read_shift(1)>>>5&3;return n.l+=4,t.biff<8&&n.l--,t.biff==12&&(n.l+=2),[r]}function c3t(n,e,t){var r=(n[n.l++]&96)>>5,i=n.read_shift(2),a=4;if(t)switch(t.biff){case 5:a=15;break;case 12:a=6;break}return n.l+=a,[r,i]}var f3t=Kc,d3t=Kc,v3t=Kc;function F3(n,e,t){return n.l+=2,[ANt(n)]}function Toe(n){return n.l+=6,[]}var p3t=F3,g3t=Toe,y3t=Toe,m3t=F3;function vGe(n){return n.l+=2,[nu(n),n.read_shift(2)&1]}var _3t=F3,x3t=vGe,S3t=Toe,w3t=F3,b3t=F3,E3t=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function T3t(n){n.l+=2;var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(4),i=n.read_shift(2),a=n.read_shift(2),o=E3t[t>>2&31];return{ixti:e,coltype:t&3,rt:o,idx:r,c:i,C:a}}function C3t(n){return n.l+=2,[n.read_shift(4)]}function A3t(n,e,t){return n.l+=5,n.l+=2,n.l+=t.biff==2?1:4,["PTGSHEET"]}function M3t(n,e,t){return n.l+=t.biff==2?4:5,["PTGENDSHEET"]}function I3t(n){var e=n.read_shift(1)>>>5&3,t=n.read_shift(2);return[e,t]}function L3t(n){var e=n.read_shift(1)>>>5&3,t=n.read_shift(2);return[e,t]}function P3t(n){return n.l+=4,[0,0]}var H_e={1:{n:"PtgExp",f:ZNt},2:{n:"PtgTbl",f:v3t},3:{n:"PtgAdd",f:bu},4:{n:"PtgSub",f:bu},5:{n:"PtgMul",f:bu},6:{n:"PtgDiv",f:bu},7:{n:"PtgPower",f:bu},8:{n:"PtgConcat",f:bu},9:{n:"PtgLt",f:bu},10:{n:"PtgLe",f:bu},11:{n:"PtgEq",f:bu},12:{n:"PtgGe",f:bu},13:{n:"PtgGt",f:bu},14:{n:"PtgNe",f:bu},15:{n:"PtgIsect",f:bu},16:{n:"PtgUnion",f:bu},17:{n:"PtgRange",f:bu},18:{n:"PtgUplus",f:bu},19:{n:"PtgUminus",f:bu},20:{n:"PtgPercent",f:bu},21:{n:"PtgParen",f:bu},22:{n:"PtgMissArg",f:bu},23:{n:"PtgStr",f:t3t},26:{n:"PtgSheet",f:A3t},27:{n:"PtgEndSheet",f:M3t},28:{n:"PtgErr",f:KNt},29:{n:"PtgBool",f:QNt},30:{n:"PtgInt",f:JNt},31:{n:"PtgNum",f:e3t},32:{n:"PtgArray",f:NNt},33:{n:"PtgFunc",f:jNt},34:{n:"PtgFuncVar",f:XNt},35:{n:"PtgName",f:a3t},36:{n:"PtgRef",f:$Nt},37:{n:"PtgArea",f:LNt},38:{n:"PtgMemArea",f:l3t},39:{n:"PtgMemErr",f:f3t},40:{n:"PtgMemNoMem",f:d3t},41:{n:"PtgMemFunc",f:u3t},42:{n:"PtgRefErr",f:h3t},43:{n:"PtgAreaErr",f:ONt},44:{n:"PtgRefN",f:WNt},45:{n:"PtgAreaN",f:DNt},46:{n:"PtgMemAreaN",f:I3t},47:{n:"PtgMemNoMemN",f:L3t},57:{n:"PtgNameX",f:o3t},58:{n:"PtgRef3d",f:HNt},59:{n:"PtgArea3d",f:PNt},60:{n:"PtgRefErr3d",f:c3t},61:{n:"PtgAreaErr3d",f:RNt},255:{}},O3t={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},R3t={1:{n:"PtgElfLel",f:vGe},2:{n:"PtgElfRw",f:w3t},3:{n:"PtgElfCol",f:p3t},6:{n:"PtgElfRwV",f:b3t},7:{n:"PtgElfColV",f:m3t},10:{n:"PtgElfRadical",f:_3t},11:{n:"PtgElfRadicalS",f:S3t},13:{n:"PtgElfColS",f:g3t},15:{n:"PtgElfColSV",f:y3t},16:{n:"PtgElfRadicalLel",f:x3t},25:{n:"PtgList",f:T3t},29:{n:"PtgSxName",f:C3t},255:{}},D3t={0:{n:"PtgAttrNoop",f:P3t},1:{n:"PtgAttrSemi",f:zNt},2:{n:"PtgAttrIf",f:BNt},4:{n:"PtgAttrChoose",f:kNt},8:{n:"PtgAttrGoto",f:FNt},16:{n:"PtgAttrSum",f:qNt},32:{n:"PtgAttrBaxcel",f:W_e},33:{n:"PtgAttrBaxcel",f:W_e},64:{n:"PtgAttrSpace",f:UNt},65:{n:"PtgAttrSpaceSemi",f:VNt},128:{n:"PtgAttrIfError",f:GNt},255:{}};function B3(n,e,t,r){if(r.biff<8)return Kc(n,e);for(var i=n.l+e,a=[],o=0;o!==t.length;++o)switch(t[o][0]){case"PtgArray":t[o][1]=i3t(n,0,r),a.push(t[o][1]);break;case"PtgMemArea":t[o][2]=n3t(n,t[o][1],r),a.push(t[o][2]);break;case"PtgExp":r&&r.biff==12&&(t[o][1][1]=n.read_shift(4),a.push(t[o][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+t[o][0]}return e=i-n.l,e!==0&&a.push(Kc(n,e)),a}function G3(n,e,t){for(var r=n.l+e,i,a,o=[];r!=n.l;)e=r-n.l,a=n[n.l],i=H_e[a]||H_e[O3t[a]],(a===24||a===25)&&(i=(a===24?R3t:D3t)[n[n.l+1]]),!i||!i.f?Kc(n,e):o.push([i.n,i.f(n,e,t)]);return o}function N3t(n){for(var e=[],t=0;t=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function F3t(n,e){var t=n.lastIndexOf("!"),r=e.lastIndexOf("!");return t==-1&&r==-1?n+":"+e:t>0&&r>0&&n.slice(0,t).toLowerCase()==e.slice(0,r).toLowerCase()?n+":"+e.slice(r+1):(console.error("Cannot hydrate range",n,e),n+":"+e)}function pGe(n,e,t){if(!n)return"SH33TJSERR0";if(t.biff>8&&(!n.XTI||!n.XTI[e]))return n.SheetNames[e];if(!n.XTI)return"SH33TJSERR6";var r=n.XTI[e];if(t.biff<8)return e>1e4&&(e-=65536),e<0&&(e=-e),e==0?"":n.XTI[e-1];if(!r)return"SH33TJSERR1";var i="";if(t.biff>8)switch(n[r[0]][0]){case 357:return i=r[1]==-1?"#REF":n.SheetNames[r[1]],r[1]==r[2]?i:i+":"+n.SheetNames[r[2]];case 358:return t.SID!=null?n.SheetNames[t.SID]:"SH33TJSSAME"+n[r[0]][0];case 355:default:return"SH33TJSSRC"+n[r[0]][0]}switch(n[r[0]][0][0]){case 1025:return i=r[1]==-1?"#REF":n.SheetNames[r[1]]||"SH33TJSERR3",r[1]==r[2]?i:i+":"+n.SheetNames[r[2]];case 14849:return n[r[0]].slice(1).map(function(a){return a.Name}).join(";;");default:return n[r[0]][0][3]?(i=r[1]==-1?"#REF":n[r[0]][0][3][r[1]]||"SH33TJSERR4",r[1]==r[2]?i:i+":"+n[r[0]][0][3][r[2]]):"SH33TJSERR2"}}function j_e(n,e,t){var r=pGe(n,e,t);return r=="#REF"?r:NPt(r,t)}function kc(n,e,t,r,i){var a=i&&i.biff||8,o={s:{c:0,r:0},e:{c:0,r:0}},s=[],l,u,h,c=0,f=0,d,v="";if(!n[0]||!n[0][0])return"";for(var p=-1,g="",m=0,y=n[0].length;m=0){switch(n[0][p][1][0]){case 0:g=wo(" ",n[0][p][1][1]);break;case 1:g=wo("\r",n[0][p][1][1]);break;default:if(g="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+n[0][p][1][0])}u=u+g,p=-1}s.push(u+k3t[_[0]]+l);break;case"PtgIsect":l=s.pop(),u=s.pop(),s.push(u+" "+l);break;case"PtgUnion":l=s.pop(),u=s.pop(),s.push(u+","+l);break;case"PtgRange":l=s.pop(),u=s.pop(),s.push(F3t(u,l));break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":h=oR(_[1][1],o,i),s.push(sR(h,a));break;case"PtgRefN":h=t?oR(_[1][1],t,i):_[1][1],s.push(sR(h,a));break;case"PtgRef3d":c=_[1][1],h=oR(_[1][2],o,i),v=j_e(r,c,i),s.push(v+"!"+sR(h,a));break;case"PtgFunc":case"PtgFuncVar":var x=_[1][0],S=_[1][1];x||(x=0),x&=127;var w=x==0?[]:s.slice(-x);s.length-=x,S==="User"&&(S=w.shift()),s.push(S+"("+w.join(",")+")");break;case"PtgBool":s.push(_[1]?"TRUE":"FALSE");break;case"PtgInt":s.push(_[1]);break;case"PtgNum":s.push(String(_[1]));break;case"PtgStr":s.push('"'+_[1].replace(/"/g,'""')+'"');break;case"PtgErr":s.push(_[1]);break;case"PtgAreaN":d=T_e(_[1][1],t?{s:t}:o,i),s.push(gX(d,i));break;case"PtgArea":d=T_e(_[1][1],o,i),s.push(gX(d,i));break;case"PtgArea3d":c=_[1][1],d=_[1][2],v=j_e(r,c,i),s.push(v+"!"+gX(d,i));break;case"PtgAttrSum":s.push("SUM("+s.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":f=_[1][2];var b=(r.names||[])[f-1]||(r[0]||[])[f],E=b?b.Name:"SH33TJSNAME"+String(f);E&&E.slice(0,6)=="_xlfn."&&!i.xlfn&&(E=E.slice(6)),s.push(E);break;case"PtgNameX":var T=_[1][1];f=_[1][2];var C;if(i.biff<=5)T<0&&(T=-T),r[T]&&(C=r[T][f]);else{var A="";if(((r[T]||[])[0]||[])[0]==14849||(((r[T]||[])[0]||[])[0]==1025?r[T][f]&&r[T][f].itab>0&&(A=r.SheetNames[r[T][f].itab-1]+"!"):A=r.SheetNames[f-1]+"!"),r[T]&&r[T][f])A+=r[T][f].Name;else if(r[0]&&r[0][f])A+=r[0][f].Name;else{var M=(pGe(r,T,i)||"").split(";;");M[f-1]?A=M[f-1]:A+="SH33TJSERRX"}s.push(A);break}C||(C={Name:"SH33TJSERRY"}),s.push(C.Name);break;case"PtgParen":var I="(",R=")";if(p>=0){switch(g="",n[0][p][1][0]){case 2:I=wo(" ",n[0][p][1][1])+I;break;case 3:I=wo("\r",n[0][p][1][1])+I;break;case 4:R=wo(" ",n[0][p][1][1])+R;break;case 5:R=wo("\r",n[0][p][1][1])+R;break;default:if(i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+n[0][p][1][0])}p=-1}s.push(I+s.pop()+R);break;case"PtgRefErr":s.push("#REF!");break;case"PtgRefErr3d":s.push("#REF!");break;case"PtgExp":h={c:_[1][1],r:_[1][0]};var k={c:t.c,r:t.r};if(r.sharedf[bo(h)]){var D=r.sharedf[bo(h)];s.push(kc(D,o,k,r,i))}else{var G=!1;for(l=0;l!=r.arrayf.length;++l)if(u=r.arrayf[l],!(h.cu[0].e.c)&&!(h.ru[0].e.r)){s.push(kc(u[1],o,k,r,i)),G=!0;break}G||s.push(_[1])}break;case"PtgArray":s.push("{"+N3t(_[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":p=m;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":s.push("");break;case"PtgAreaErr":s.push("#REF!");break;case"PtgAreaErr3d":s.push("#REF!");break;case"PtgList":s.push("Table"+_[1].idx+"[#"+_[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(_));default:throw new Error("Unrecognized Formula Token: "+String(_))}var W=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(i.biff!=3&&p>=0&&W.indexOf(n[0][m][0])==-1){_=n[0][p];var z=!0;switch(_[1][0]){case 4:z=!1;case 0:g=wo(" ",_[1][1]);break;case 5:z=!1;case 1:g=wo("\r",_[1][1]);break;default:if(g="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+_[1][0])}s.push((z?g:"")+s.pop()+(z?"":g)),p=-1}}if(s.length>1&&i.WTF)throw new Error("bad formula stack");return s[0]=="TRUE"?!0:s[0]=="FALSE"?!1:s[0]}function B3t(n,e,t){var r=n.l+e,i=t.biff==2?1:2,a,o=n.read_shift(i);if(o==65535)return[[],Kc(n,e-2)];var s=G3(n,o,t);return e!==o+i&&(a=B3(n,e-o-i,s,t)),n.l=r,[s,a]}function G3t(n,e,t){var r=n.l+e,i=t.biff==2?1:2,a,o=n.read_shift(i);if(o==65535)return[[],Kc(n,e-2)];var s=G3(n,o,t);return e!==o+i&&(a=B3(n,e-o-i,s,t)),n.l=r,[s,a]}function z3t(n,e,t,r){var i=n.l+e,a=G3(n,r,t),o;return i!==n.l&&(o=B3(n,i-n.l,a,t)),[a,o]}function U3t(n,e,t){var r=n.l+e,i,a=n.read_shift(2),o=G3(n,a,t);return a==65535?[[],Kc(n,e-2)]:(e!==a+2&&(i=B3(n,r-a-2,o,t)),[o,i])}function V3t(n){var e;if(R1(n,n.l+6)!==65535)return[Bc(n),"n"];switch(n[n.l]){case 0:return n.l+=8,["String","s"];case 1:return e=n[n.l+2]===1,n.l+=8,[e,"b"];case 2:return e=n[n.l+2],n.l+=8,[e,"e"];case 3:return n.l+=8,["","s"]}return[]}function _X(n,e,t){var r=n.l+e,i=Pm(n);t.biff==2&&++n.l;var a=V3t(n),o=n.read_shift(1);t.biff!=2&&(n.read_shift(1),t.biff>=5&&n.read_shift(4));var s=G3t(n,r-n.l,t);return{cell:i,val:a[0],formula:s,shared:o>>3&1,tt:a[1]}}function MU(n,e,t){var r=n.read_shift(4),i=G3(n,r,t),a=n.read_shift(4),o=a>0?B3(n,a,i,t):null;return[i,o]}var $3t=MU,IU=MU,W3t=MU,H3t=MU,j3t={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},gGe={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},X3t={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function X_e(n){return n.slice(0,3)=="of:"&&(n=n.slice(3)),n.charCodeAt(0)==61&&(n=n.slice(1),n.charCodeAt(0)==61&&(n=n.slice(1))),n=n.replace(/COM\.MICROSOFT\./g,""),n=n.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(e,t){return t.replace(/\./g,"")}),n=n.replace(/\$'([^']|'')+'/g,function(e){return e.slice(1)}),n=n.replace(/\$([^\]\. #$]+)/g,function(e,t){return t.match(/^([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])?(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})?$/)?e:t}),n=n.replace(/\[.(#[A-Z]*[?!])\]/g,"$1"),n.replace(/[;~]/g,",").replace(/\|/g,";")}function xX(n){n=n.replace(/\$'([^']|'')+'/g,function(r){return r.slice(1)}),n=n.replace(/\$([^\]\. #$]+)/g,function(r,i){return i.match(/^([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])?(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})?$/)?r:i});var e=n.split(":"),t=e[0].split(".")[0];return[t,e[0].split(".")[1]+(e.length>1?":"+(e[1].split(".")[1]||e[1].split(".")[0]):"")]}var cR={},VA={};function fR(n,e){if(!!n){var t=[.7,.7,.75,.75,.3,.3];e=="xlml"&&(t=[1,1,1,1,.5,.5]),n.left==null&&(n.left=t[0]),n.right==null&&(n.right=t[1]),n.top==null&&(n.top=t[2]),n.bottom==null&&(n.bottom=t[3]),n.header==null&&(n.header=t[4]),n.footer==null&&(n.footer=t[5])}}function yGe(n,e,t,r,i,a){try{r.cellNF&&(n.z=ji[e])}catch(s){if(r.WTF)throw s}if(!(n.t==="z"&&!r.cellStyles)){if(n.t==="d"&&typeof n.v=="string"&&(n.v=pc(n.v)),(!r||r.cellText!==!1)&&n.t!=="z")try{if(ji[e]==null&&OE(jLt[e]||"General",e),n.t==="e")n.w=n.w||nT[n.v];else if(e===0)if(n.t==="n")(n.v|0)===n.v?n.w=n.v.toString(10):n.w=ID(n.v);else if(n.t==="d"){var o=Zc(n.v);(o|0)===o?n.w=o.toString(10):n.w=ID(o)}else{if(n.v===void 0)return"";n.w=e2(n.v,VA)}else n.t==="d"?n.w=Cv(e,Zc(n.v),VA):n.w=Cv(e,n.v,VA)}catch(s){if(r.WTF)throw s}if(!!r.cellStyles&&t!=null)try{n.s=a.Fills[t],n.s.fgColor&&n.s.fgColor.theme&&!n.s.fgColor.rgb&&(n.s.fgColor.rgb=e9(i.themeElements.clrScheme[n.s.fgColor.theme].rgb,n.s.fgColor.tint||0),r.WTF&&(n.s.fgColor.raw_rgb=i.themeElements.clrScheme[n.s.fgColor.theme].rgb)),n.s.bgColor&&n.s.bgColor.theme&&(n.s.bgColor.rgb=e9(i.themeElements.clrScheme[n.s.bgColor.theme].rgb,n.s.bgColor.tint||0),r.WTF&&(n.s.bgColor.raw_rgb=i.themeElements.clrScheme[n.s.bgColor.theme].rgb))}catch(s){if(r.WTF&&a.Fills)throw s}}}function Y3t(n,e){var t=cu(e);t.s.r<=t.e.r&&t.s.c<=t.e.c&&t.s.r>=0&&t.s.c>=0&&(n["!ref"]=lo(t))}var q3t=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,Z3t=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,K3t=/<(?:\w:)?hyperlink [^>]*>/mg,J3t=/"(\w*:\w*)"/,Q3t=/<(?:\w:)?col\b[^>]*[\/]?>/g,ekt=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,tkt=/<(?:\w:)?pageMargins[^>]*\/>/g,mGe=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,rkt=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,nkt=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function ikt(n,e,t,r,i,a,o){if(!n)return n;r||(r={"!id":{}});var s={};e.dense&&(s["!data"]=[]);var l={s:{r:2e6,c:2e6},e:{r:0,c:0}},u="",h="",c=n.match(Z3t);c?(u=n.slice(0,c.index),h=n.slice(c.index+c[0].length)):u=h=n;var f=u.match(mGe);f?Coe(f[0],s,i,t):(f=u.match(rkt))&&akt(f[0],f[1]||"",s,i,t);var d=(u.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(d>0){var v=u.slice(d,d+50).match(J3t);v&&!(e&&e.nodim)&&Y3t(s,v[1])}var p=u.match(nkt);p&&p[1]&&ckt(p[1],i);var g=[];if(e.cellStyles){var m=u.match(Q3t);m&&lkt(g,m)}c&&fkt(c[1],s,e,l,a,o);var y=h.match(ekt);y&&(s["!autofilter"]=ukt(y[0]));var _=[],x=h.match(q3t);if(x)for(d=0;d!=x.length;++d)_[d]=cu(x[d].slice(x[d].indexOf('"')+1));var S=h.match(K3t);S&&okt(s,S,r);var w=h.match(tkt);if(w&&(s["!margins"]=skt(Tn(w[0]))),e&&e.nodim&&(l.s.c=l.s.r=0),!s["!ref"]&&l.e.c>=l.s.c&&l.e.r>=l.s.r&&(s["!ref"]=lo(l)),e.sheetRows>0&&s["!ref"]){var b=cu(s["!ref"]);e.sheetRows<=+b.e.r&&(b.e.r=e.sheetRows-1,b.e.r>l.e.r&&(b.e.r=l.e.r),b.e.rl.e.c&&(b.e.c=l.e.c),b.e.c0&&(s["!cols"]=g),_.length>0&&(s["!merges"]=_),s}function Coe(n,e,t,r){var i=Tn(n);t.Sheets[r]||(t.Sheets[r]={}),i.codeName&&(t.Sheets[r].CodeName=so(As(i.codeName)))}function akt(n,e,t,r,i){Coe(n.slice(0,n.indexOf(">")),t,r,i)}function okt(n,e,t){for(var r=n["!data"]!=null,i=0;i!=e.length;++i){var a=Tn(As(e[i]),!0);if(!a.ref)return;var o=((t||{})["!id"]||[])[a.id];o?(a.Target=o.Target,a.location&&(a.Target+="#"+so(a.location))):(a.Target="#"+so(a.location),o={Target:a.Target,TargetMode:"Internal"}),a.Rel=o,a.tooltip&&(a.Tooltip=a.tooltip,delete a.tooltip);for(var s=cu(a.ref),l=s.s.r;l<=s.e.r;++l)for(var u=s.s.c;u<=s.e.c;++u){var h=$o(u)+ys(l);r?(n["!data"][l]||(n["!data"][l]=[]),n["!data"][l][u]||(n["!data"][l][u]={t:"z",v:void 0}),n["!data"][l][u].l=a):(n[h]||(n[h]={t:"z",v:void 0}),n[h].l=a)}}}function skt(n){var e={};return["left","right","top","bottom","header","footer"].forEach(function(t){n[t]&&(e[t]=parseFloat(n[t]))}),e}function lkt(n,e){for(var t=!1,r=0;r!=e.length;++r){var i=Tn(e[r],!0);i.hidden&&(i.hidden=ps(i.hidden));var a=parseInt(i.min,10)-1,o=parseInt(i.max,10)-1;for(i.outlineLevel&&(i.level=+i.outlineLevel||0),delete i.min,delete i.max,i.width=+i.width,!t&&i.width&&(t=!0,Eoe(i.width)),wM(i);a<=o;)n[a++]=sh(i)}}function ukt(n){var e={ref:(n.match(/ref="([^"]*)"/)||[])[1]};return e}var hkt=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/g;function ckt(n,e){e.Views||(e.Views=[{}]),(n.match(hkt)||[]).forEach(function(t,r){var i=Tn(t);e.Views[r]||(e.Views[r]={}),+i.zoomScale&&(e.Views[r].zoom=+i.zoomScale),i.rightToLeft&&ps(i.rightToLeft)&&(e.Views[r].RTL=!0)})}var fkt=function(){var n=/<(?:\w+:)?c[ \/>]/,e=/<\/(?:\w+:)?row>/,t=/r=["']([^"']*)["']/,r=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,i=/ref=["']([^"']*)["']/,a=LD("v"),o=LD("f");return function(l,u,h,c,f,d){for(var v=0,p="",g=[],m=[],y=0,_=0,x=0,S="",w,b,E=0,T=0,C,A,M=0,I=0,R=Array.isArray(d.CellXf),k,D=[],G=[],W=u["!data"]!=null,z=[],V={},q=!1,Y=!!h.sheetStubs,le=l.split(e),j=0,Q=le.length;j!=Q;++j){p=le[j].trim();var ie=p.length;if(ie===0)continue;var oe=0;e:for(v=0;v":if(p[v-1]!="/"){++v;break e}if(h&&h.cellStyles){if(b=Tn(p.slice(oe,v),!0),E=b.r!=null?parseInt(b.r,10):E+1,T=-1,h.sheetRows&&h.sheetRows=v)break;if(b=Tn(p.slice(oe,v),!0),E=b.r!=null?parseInt(b.r,10):E+1,T=-1,!(h.sheetRows&&h.sheetRowsE-1&&(c.s.r=E-1),c.e.r":"")+p,m!=null&&m.length===2){for(y=0,S=m[1],_=0;_!=S.length&&!((x=S.charCodeAt(_)-64)<1||x>26);++_)y=26*y+x;--y,T=y}else++T;for(_=0;_!=p.length&&p.charCodeAt(_)!==62;++_);if(++_,b=Tn(p.slice(0,_),!0),b.r||(b.r=bo({r:E-1,c:T})),S=p.slice(_),w={t:""},(m=S.match(a))!=null&&m[1]!==""&&(w.v=so(m[1])),h.cellFormula){if((m=S.match(o))!=null&&m[1]!==""){if(w.f=so(As(m[1]),!0),h.xlfn||(w.f=$_e(w.f)),m[0].indexOf('t="array"')>-1)w.F=(S.match(i)||[])[1],w.F.indexOf(":")>-1&&D.push([cu(w.F),w.F]);else if(m[0].indexOf('t="shared"')>-1){A=Tn(m[0]);var me=so(As(m[1]));h.xlfn||(me=$_e(me)),G[parseInt(A.si,10)]=[A,me,b.r]}}else(m=S.match(/]*\/>/))&&(A=Tn(m[0]),G[A.si]&&(w.f=bNt(G[A.si][1],G[A.si][2],b.r)));var Ce=zc(b.r);for(_=0;_=D[_][0].s.r&&Ce.r<=D[_][0].e.r&&Ce.c>=D[_][0].s.c&&Ce.c<=D[_][0].e.c&&(w.F=D[_][1])}if(b.t==null&&w.v===void 0)if(w.f||w.F)w.v=0,w.t="n";else if(Y)w.t="z";else continue;else w.t=b.t||"n";switch(c.s.c>T&&(c.s.c=T),c.e.c"u"){if(!Y)continue;w.t="z"}else C=cR[parseInt(w.v,10)],w.v=C.t,w.r=C.r,h.cellHTML&&(w.h=C.h);break;case"str":w.t="s",w.v=w.v!=null?so(As(w.v),!0):"",h.cellHTML&&(w.h=ZG(w.v));break;case"inlineStr":m=S.match(r),w.t="s",m!=null&&(C=boe(m[1]))?(w.v=C.t,h.cellHTML&&(w.h=C.h)):w.v="";break;case"b":w.v=ps(w.v);break;case"d":h.cellDates?w.v=pc(w.v,1):(w.v=Zc(pc(w.v,1)),w.t="n");break;case"e":(!h||h.cellText!==!1)&&(w.w=w.v),w.v=B8e[w.v];break}if(M=I=0,k=null,R&&b.s!==void 0&&(k=d.CellXf[b.s],k!=null&&(k.numFmtId!=null&&(M=k.numFmtId),h.cellStyles&&k.fillId!=null&&(I=k.fillId))),yGe(w,M,I,h,f,d),h.cellDates&&R&&w.t=="n"&&Q2(ji[M])&&(w.t="d",w.v=TU(w.v)),b.cm&&h.xlmeta){var Le=(h.xlmeta.Cell||[])[+b.cm-1];Le&&Le.type=="XLDAPR"&&(w.D=!0)}var re;h.nodim&&(re=zc(b.r),c.s.r>re.r&&(c.s.r=re.r),c.e.r0&&(u["!rows"]=z)}}();function dkt(n,e){var t={},r=n.l+e;t.r=n.read_shift(4),n.l+=4;var i=n.read_shift(2);n.l+=1;var a=n.read_shift(1);return n.l=r,a&7&&(t.level=a&7),a&16&&(t.hidden=!0),a&32&&(t.hpt=i/20),t}var vkt=rT;function pkt(){}function gkt(n,e){var t={},r=n[n.l];return++n.l,t.above=!(r&64),t.left=!(r&128),n.l+=18,t.name=GPt(n),t}function ykt(n){var e=og(n);return[e]}function mkt(n){var e=tT(n);return[e]}function _kt(n){var e=og(n),t=n.read_shift(1);return[e,t,"b"]}function xkt(n){var e=tT(n),t=n.read_shift(1);return[e,t,"b"]}function Skt(n){var e=og(n),t=n.read_shift(1);return[e,t,"e"]}function wkt(n){var e=tT(n),t=n.read_shift(1);return[e,t,"e"]}function bkt(n){var e=og(n),t=n.read_shift(4);return[e,t,"s"]}function Ekt(n){var e=tT(n),t=n.read_shift(4);return[e,t,"s"]}function Tkt(n){var e=og(n),t=Bc(n);return[e,t,"n"]}function _Ge(n){var e=tT(n),t=Bc(n);return[e,t,"n"]}function Ckt(n){var e=og(n),t=xoe(n);return[e,t,"n"]}function Akt(n){var e=tT(n),t=xoe(n);return[e,t,"n"]}function Mkt(n){var e=og(n),t=moe(n);return[e,t,"is"]}function Ikt(n){var e=og(n),t=Wc(n);return[e,t,"str"]}function Lkt(n){var e=tT(n),t=Wc(n);return[e,t,"str"]}function Pkt(n,e,t){var r=n.l+e,i=og(n);i.r=t["!row"];var a=n.read_shift(1),o=[i,a,"b"];if(t.cellFormula){n.l+=2;var s=IU(n,r-n.l,t);o[3]=kc(s,null,i,t.supbooks,t)}else n.l=r;return o}function Okt(n,e,t){var r=n.l+e,i=og(n);i.r=t["!row"];var a=n.read_shift(1),o=[i,a,"e"];if(t.cellFormula){n.l+=2;var s=IU(n,r-n.l,t);o[3]=kc(s,null,i,t.supbooks,t)}else n.l=r;return o}function Rkt(n,e,t){var r=n.l+e,i=og(n);i.r=t["!row"];var a=Bc(n),o=[i,a,"n"];if(t.cellFormula){n.l+=2;var s=IU(n,r-n.l,t);o[3]=kc(s,null,i,t.supbooks,t)}else n.l=r;return o}function Dkt(n,e,t){var r=n.l+e,i=og(n);i.r=t["!row"];var a=Wc(n),o=[i,a,"str"];if(t.cellFormula){n.l+=2;var s=IU(n,r-n.l,t);o[3]=kc(s,null,i,t.supbooks,t)}else n.l=r;return o}var Nkt=rT;function kkt(n,e){var t=n.l+e,r=rT(n),i=_oe(n),a=Wc(n),o=Wc(n),s=Wc(n);n.l=t;var l={rfx:r,relId:i,loc:a,display:s};return o&&(l.Tooltip=o),l}function Fkt(){}function Bkt(n,e,t){var r=n.l+e,i=N8e(n),a=n.read_shift(1),o=[i];if(o[2]=a,t.cellFormula){var s=$3t(n,r-n.l,t);o[1]=s}else n.l=r;return o}function Gkt(n,e,t){var r=n.l+e,i=rT(n),a=[i];if(t.cellFormula){var o=H3t(n,r-n.l,t);a[1]=o,n.l=r}else n.l=r;return a}var zkt=["left","right","top","bottom","header","footer"];function Ukt(n){var e={};return zkt.forEach(function(t){e[t]=Bc(n)}),e}function Vkt(n){var e=n.read_shift(2);return n.l+=28,{RTL:e&32}}function $kt(){}function Wkt(){}function Hkt(n,e,t,r,i,a,o){if(!n)return n;var s=e||{};r||(r={"!id":{}});var l={};s.dense&&(l["!data"]=[]);var u,h={s:{r:2e6,c:2e6},e:{r:0,c:0}},c=!1,f=!1,d,v,p,g,m,y,_,x,S,w=[];s.biff=12,s["!row"]=0;var b=0,E=!1,T=[],C={},A=s.supbooks||i.supbooks||[[]];if(A.sharedf=C,A.arrayf=T,A.SheetNames=i.SheetNames||i.Sheets.map(function(W){return W.name}),!s.supbooks&&(s.supbooks=A,i.Names))for(var M=0;M=Y[0].s.r&&d.r<=Y[0].e.r&&m>=Y[0].s.c&&m<=Y[0].e.c&&(v.F=lo(Y[0]),E=!0)}!E&&z.length>3&&(v.f=z[3])}if(h.s.r>d.r&&(h.s.r=d.r),h.s.c>m&&(h.s.c=m),h.e.rd.r&&(h.s.r=d.r),h.s.c>m&&(h.s.c=m),h.e.r=z.s;)I[z.e--]={width:z.w/256,hidden:!!(z.flags&1),level:z.level},k||(k=!0,Eoe(z.w/256)),wM(I[z.e+1]);break;case 161:l["!autofilter"]={ref:lo(z)};break;case 476:l["!margins"]=z;break;case 147:i.Sheets[t]||(i.Sheets[t]={}),z.name&&(i.Sheets[t].CodeName=z.name),(z.above||z.left)&&(l["!outline"]={above:z.above,left:z.left});break;case 137:i.Views||(i.Views=[{}]),i.Views[0]||(i.Views[0]={}),z.RTL&&(i.Views[0].RTL=!0);break;case 485:break;case 64:case 1053:break;case 151:break;case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:c=!0;break;case 36:c=!1;break;case 37:c=!0;break;case 38:c=!1;break;default:if(!V.T){if(!c||s.WTF)throw new Error("Unexpected record 0x"+q.toString(16))}}},s),delete s.supbooks,delete s["!row"],!l["!ref"]&&(h.s.r<2e6||u&&(u.e.r>0||u.e.c>0||u.s.r>0||u.s.c>0))&&(l["!ref"]=lo(u||h)),s.sheetRows&&l["!ref"]){var G=cu(l["!ref"]);s.sheetRows<=+G.e.r&&(G.e.r=s.sheetRows-1,G.e.r>h.e.r&&(G.e.r=h.e.r),G.e.rh.e.c&&(G.e.c=h.e.c),G.e.c0&&(l["!merges"]=w),I.length>0&&(l["!cols"]=I),R.length>0&&(l["!rows"]=R),l}function jkt(n){var e=[],t=n.match(/^/),r;(n.match(/(.*?)<\/c:pt>/mg)||[]).forEach(function(a){var o=a.match(/(.*)<\/c:v><\/c:pt>/);!o||(e[+o[1]]=t?+o[2]:o[2])});var i=so((n.match(/([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(n.match(/(.*?)<\/c:f>/mg)||[]).forEach(function(a){r=a.replace(/<.*?>/g,"")}),[e,i,r]}function Xkt(n,e,t,r,i,a){var o=a||{"!type":"chart"};if(!n)return a;var s=0,l=0,u="A",h={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(n.match(/[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(c){var f=jkt(c);h.s.r=h.s.c=0,h.e.c=s,u=$o(s),f[0].forEach(function(d,v){o["!data"]?(o["!data"][v]||(o["!data"][v]=[]),o["!data"][v][s]={t:"n",v:d,z:f[1]}):o[u+ys(v)]={t:"n",v:d,z:f[1]},l=v}),h.e.r0&&(o["!ref"]=lo(h)),o}function Ykt(n,e,t,r,i){if(!n)return n;r||(r={"!id":{}});var a={"!type":"chart","!drawel":null,"!rel":""},o,s=n.match(mGe);return s&&Coe(s[0],a,i,t),(o=n.match(/drawing r:id="(.*?)"/))&&(a["!rel"]=o[1]),r["!id"][a["!rel"]]&&(a["!drawel"]=r["!id"][a["!rel"]]),a}function qkt(n,e){n.l+=10;var t=Wc(n);return{name:t}}function Zkt(n,e,t,r,i){if(!n)return n;r||(r={"!id":{}});var a={"!type":"chart","!drawel":null,"!rel":""},o=!1;return B_(n,function(l,u,h){switch(h){case 550:a["!rel"]=l;break;case 651:i.Sheets[t]||(i.Sheets[t]={}),l.name&&(i.Sheets[t].CodeName=l.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:o=!0;break;case 36:o=!1;break;case 37:break;case 38:break;default:if(!(u.T>0)){if(!(u.T<0)){if(!o||e.WTF)throw new Error("Unexpected record 0x"+h.toString(16))}}}},e),r["!id"][a["!rel"]]&&(a["!drawel"]=r["!id"][a["!rel"]]),a}var xGe=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],Kkt=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],Jkt=[],Qkt=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function Y_e(n,e){for(var t=0;t!=n.length;++t)for(var r=n[t],i=0;i!=e.length;++i){var a=e[i];if(r[a[0]]==null)r[a[0]]=a[1];else switch(a[2]){case"bool":typeof r[a[0]]=="string"&&(r[a[0]]=ps(r[a[0]]));break;case"int":typeof r[a[0]]=="string"&&(r[a[0]]=parseInt(r[a[0]],10));break}}}function q_e(n,e){for(var t=0;t!=e.length;++t){var r=e[t];if(n[r[0]]==null)n[r[0]]=r[1];else switch(r[2]){case"bool":typeof n[r[0]]=="string"&&(n[r[0]]=ps(n[r[0]]));break;case"int":typeof n[r[0]]=="string"&&(n[r[0]]=parseInt(n[r[0]],10));break}}}function SGe(n){q_e(n.WBProps,xGe),q_e(n.CalcPr,Qkt),Y_e(n.WBView,Kkt),Y_e(n.Sheets,Jkt),VA.date1904=ps(n.WBProps.date1904)}var eFt=":][*?/\\".split("");function tFt(n,e){try{if(n=="")throw new Error("Sheet name cannot be blank");if(n.length>31)throw new Error("Sheet name cannot exceed 31 chars");if(n.charCodeAt(0)==39||n.charCodeAt(n.length-1)==39)throw new Error("Sheet name cannot start or end with apostrophe (')");if(n.toLowerCase()=="history")throw new Error("Sheet name cannot be 'History'");eFt.forEach(function(t){if(n.indexOf(t)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")})}catch(t){if(e)return!1;throw t}return!0}var rFt=/<\w+:workbook/;function nFt(n,e){if(!n)throw new Error("Could not find file");var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},r=!1,i="xmlns",a={},o=0;if(n.replace(nf,function(l,u){var h=Tn(l);switch(N0(h[0])){case"":break;case"":case"":break;case"":break;case"":xGe.forEach(function(c){if(h[c[0]]!=null)switch(c[2]){case"bool":t.WBProps[c[0]]=ps(h[c[0]]);break;case"int":t.WBProps[c[0]]=parseInt(h[c[0]],10);break;default:t.WBProps[c[0]]=h[c[0]]}}),h.codeName&&(t.WBProps.CodeName=As(h.codeName));break;case"":break;case"":break;case"":case"":break;case"":delete h[0],t.WBView.push(h);break;case"":break;case"":case"":break;case"":break;case"":break;case"":case"":break;case"":break;case"":case"":r=!1;break;case"":a.Ref=so(As(n.slice(o,u))),t.Names.push(a);break;case"":break;case"":delete h[0],t.CalcPr=h;break;case"":break;case"":case"":case"":break;case"":case"":case"":break;case"":case"":break;case"":break;case"":break;case"":case"":break;case"":case"":case"":break;case"":r=!1;break;case"":r=!0;break;case"":r=!1;break;case"8?Wc(n):"";return i.length>0&&(t.CodeName=i),t.autoCompressPictures=!!(r&65536),t.backupFile=!!(r&64),t.checkCompatibility=!!(r&4096),t.date1904=!!(r&1),t.filterPrivacy=!!(r&8),t.hidePivotFieldList=!!(r&1024),t.promptedSolutions=!!(r&16),t.publishItems=!!(r&2048),t.refreshAllConnections=!!(r&262144),t.saveExternalLinkValues=!!(r&128),t.showBorderUnselectedTables=!!(r&4),t.showInkAnnotation=!!(r&32),t.showObjects=["all","placeholders","none"][r>>13&3],t.showPivotChartFilter=!!(r&32768),t.updateLinks=["userSet","never","always"][r>>8&3],t}function oFt(n,e){var t={};return n.read_shift(4),t.ArchID=n.read_shift(4),n.l+=e-8,t}function sFt(n,e,t){var r=n.l+e,i=n.read_shift(4);n.l+=1;var a=n.read_shift(4),o=zPt(n),s=W3t(n,0,t),l=_oe(n);i&32&&(o="_xlnm."+o),n.l=r;var u={Name:o,Ptg:s,Flags:i};return a<268435455&&(u.Sheet=a),l&&(u.Comment=l),u}function lFt(n,e){var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},r=[],i=!1;e||(e={}),e.biff=12;var a=[],o=[[]];return o.SheetNames=[],o.XTI=[],n9[16]={n:"BrtFRTArchID$",f:oFt},B_(n,function(l,u,h){switch(h){case 156:o.SheetNames.push(l.name),t.Sheets.push(l);break;case 153:t.WBProps=l;break;case 39:l.Sheet!=null&&(e.SID=l.Sheet),l.Ref=kc(l.Ptg,null,null,o,e),delete e.SID,delete l.Ptg,a.push(l);break;case 1036:break;case 357:case 358:case 355:case 667:o[0].length?o.push([h,l]):o[0]=[h,l],o[o.length-1].XTI=[];break;case 362:o.length===0&&(o[0]=[],o[0].XTI=[]),o[o.length-1].XTI=o[o.length-1].XTI.concat(l),o.XTI=o.XTI.concat(l);break;case 361:break;case 2071:case 158:case 143:case 664:case 353:break;case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:break;case 35:r.push(h),i=!0;break;case 36:r.pop(),i=!1;break;case 37:r.push(h),i=!0;break;case 38:r.pop(),i=!1;break;case 16:break;default:if(!u.T){if(!i||e.WTF&&r[r.length-1]!=37&&r[r.length-1]!=35)throw new Error("Unexpected record 0x"+h.toString(16))}}},e),SGe(t),t.Names=a,t.supbooks=o,t}function uFt(n,e,t){return e.slice(-4)===".bin"?lFt(n,t):nFt(n,t)}function hFt(n,e,t,r,i,a,o,s){return e.slice(-4)===".bin"?Hkt(n,r,t,i,a,o,s):ikt(n,r,t,i,a,o,s)}function cFt(n,e,t,r,i,a,o,s){return e.slice(-4)===".bin"?Zkt(n,r,t,i,a):Ykt(n,r,t,i,a)}function fFt(n,e,t,r,i,a,o,s){return e.slice(-4)===".bin"?xNt():SNt()}function dFt(n,e,t,r,i,a,o,s){return e.slice(-4)===".bin"?mNt():_Nt()}function vFt(n,e,t,r){return e.slice(-4)===".bin"?NDt(n,t,r):IDt(n,t,r)}function pFt(n,e,t){return e.slice(-4)===".bin"?ZRt(n,t):YRt(n,t)}function gFt(n,e,t){return e.slice(-4)===".bin"?pNt(n,t):hNt(n,t)}function yFt(n,e,t){return e.slice(-4)===".bin"?sNt(n):aNt(n)}function mFt(n,e,t,r){return t.slice(-4)===".bin"?lNt(n,e,t,r):void 0}function _Ft(n,e,t){return e.slice(-4)===".bin"?nNt(n,e,t):iNt(n,e,t)}var wGe=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,bGe=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function Cg(n,e){var t=n.split(/\s+/),r=[];if(e||(r[0]=t[0]),t.length===1)return r;var i=n.match(wGe),a,o,s,l;if(i)for(l=0;l!=i.length;++l)a=i[l].match(bGe),(o=a[1].indexOf(":"))===-1?r[a[1]]=a[2].slice(1,a[2].length-1):(a[1].slice(0,6)==="xmlns:"?s="xmlns"+a[1].slice(6):s=a[1].slice(o+1),r[s]=a[2].slice(1,a[2].length-1));return r}function xFt(n){var e=n.split(/\s+/),t={};if(e.length===1)return t;var r=n.match(wGe),i,a,o,s;if(r)for(s=0;s!=r.length;++s)i=r[s].match(bGe),(a=i[1].indexOf(":"))===-1?t[i[1]]=i[2].slice(1,i[2].length-1):(i[1].slice(0,6)==="xmlns:"?o="xmlns"+i[1].slice(6):o=i[1].slice(a+1),t[o]=i[2].slice(1,i[2].length-1));return t}var dR;function SFt(n,e){var t=dR[n]||so(n);return t==="General"?e2(e):Cv(t,e)}function wFt(n,e,t,r){var i=r;switch((t[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":i=ps(r);break;case"i2":case"int":i=parseInt(r,10);break;case"r4":case"float":i=parseFloat(r);break;case"date":case"dateTime.tz":i=pc(r);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+t[0])}n[so(e)]=i}function bFt(n,e,t){if(n.t!=="z"){if(!t||t.cellText!==!1)try{n.t==="e"?n.w=n.w||nT[n.v]:e==="General"?n.t==="n"?(n.v|0)===n.v?n.w=n.v.toString(10):n.w=ID(n.v):n.w=e2(n.v):n.w=SFt(e||"General",n.v)}catch(a){if(t.WTF)throw a}try{var r=dR[e]||e||"General";if(t.cellNF&&(n.z=r),t.cellDates&&n.t=="n"&&Q2(r)){var i=uE(n.v);i&&(n.t="d",n.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}catch(a){if(t.WTF)throw a}}}function EFt(n,e,t){if(t.cellStyles&&e.Interior){var r=e.Interior;r.Pattern&&(r.patternType=bDt[r.Pattern]||r.Pattern)}n[e.ID]=e}function TFt(n,e,t,r,i,a,o,s,l,u){var h="General",c=r.StyleID,f={};u=u||{};var d=[],v=0;for(c===void 0&&s&&(c=s.StyleID),c===void 0&&o&&(c=o.StyleID);a[c]!==void 0&&(a[c].nf&&(h=a[c].nf),a[c].Interior&&d.push(a[c].Interior),!!a[c].Parent);)c=a[c].Parent;switch(t.Type){case"Boolean":r.t="b",r.v=ps(n);break;case"String":r.t="s",r.r=g_e(so(n)),r.v=n.indexOf("<")>-1?so(e||n).replace(/<.*?>/g,""):r.r;break;case"DateTime":n.slice(-1)!="Z"&&(n+="Z"),r.v=(pc(n)-new Date(Date.UTC(1899,11,30)))/(24*60*60*1e3),r.v!==r.v?r.v=so(n):r.v<60&&(r.v=r.v-1),(!h||h=="General")&&(h="yyyy-mm-dd");case"Number":r.v===void 0&&(r.v=+n),r.t||(r.t="n");break;case"Error":r.t="e",r.v=B8e[n],u.cellText!==!1&&(r.w=n);break;default:n==""&&e==""?r.t="z":(r.t="s",r.v=g_e(e||n));break}if(bFt(r,h,u),u.cellFormula!==!1)if(r.Formula){var p=so(r.Formula);p.charCodeAt(0)==61&&(p=p.slice(1)),r.f=DE(p,i),delete r.Formula,r.ArrayRange=="RC"?r.F=DE("RC:RC",i):r.ArrayRange&&(r.F=DE(r.ArrayRange,i),l.push([cu(r.F),r.F]))}else for(v=0;v=l[v][0].s.r&&i.r<=l[v][0].e.r&&i.c>=l[v][0].s.c&&i.c<=l[v][0].e.c&&(r.F=l[v][1]);u.cellStyles&&(d.forEach(function(g){!f.patternType&&g.patternType&&(f.patternType=g.patternType)}),r.s=f),r.StyleID!==void 0&&(r.ixfe=r.StyleID)}function CFt(n){return G8e.indexOf("_xlnm."+n)>-1?"_xlnm."+n:n}function AFt(n){n.t=n.v||"",n.t=n.t.replace(/\r\n/g,` `).replace(/\r/g,` `),n.v=n.w=n.ixfe=void 0}function SX(n,e){var t=e||{};u8e();var r=hO(CU(n));(t.type=="binary"||t.type=="array"||t.type=="base64")&&(r=As(r));var i=r.slice(0,1024).toLowerCase(),a=!1;if(i=i.replace(/".*?"/g,""),(i.indexOf(">")&1023)>Math.min(i.indexOf(",")&1023,i.indexOf(";")&1023)){var o=sh(t);return o.type="string",PD.to_workbook(r,o)}if(i.indexOf("=0&&(a=!0)}),a)return kFt(r,t);dR={"General Number":"General","General Date":ji[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":ji[15],"Short Date":ji[14],"Long Time":ji[19],"Medium Time":ji[18],"Short Time":ji[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:ji[2],Standard:ji[4],Percent:ji[10],Scientific:ji[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var s,l=[],u,h={},c=[],f={},d="";t.dense&&(f["!data"]=[]);var v={},p={},g=Cg(''),m=0,y=0,_=0,x={s:{r:2e6,c:2e6},e:{r:0,c:0}},S={},w={},b="",E=0,T=[],C={},A={},M=0,I=[],R=[],k={},D=[],G,W=!1,z=[],V=[],q={},Y=0,le=0,j={Sheets:[],WBProps:{date1904:!1}},Q={};Mu.lastIndex=0,r=r.replace(//mg,"");for(var ie="";s=Mu.exec(r);)switch(s[3]=(ie=s[3]).toLowerCase()){case"data":if(ie=="data"){if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else s[0].charAt(s[0].length-2)!=="/"&&l.push([s[3],!0]);break}if(l[l.length-1][1])break;s[1]==="/"?TFt(r.slice(m,s.index),b,g,l[l.length-1][0]=="comment"?k:v,{c:y,r:_},S,D[y],p,z,t):(b="",g=Cg(s[0]),m=s.index+s[0].length);break;case"cell":if(s[1]==="/")if(R.length>0&&(v.c=R),(!t.sheetRows||t.sheetRows>_)&&v.v!==void 0&&(t.dense?(f["!data"][_]||(f["!data"][_]=[]),f["!data"][_][y]=v):f[$o(y)+ys(_)]=v),v.HRef&&(v.l={Target:so(v.HRef)},v.HRefScreenTip&&(v.l.Tooltip=v.HRefScreenTip),delete v.HRef,delete v.HRefScreenTip),(v.MergeAcross||v.MergeDown)&&(Y=y+(parseInt(v.MergeAcross,10)|0),le=_+(parseInt(v.MergeDown,10)|0),(Y>y||le>_)&&T.push({s:{c:y,r:_},e:{c:Y,r:le}})),!t.sheetStubs)v.MergeAcross?y=Y+1:++y;else if(v.MergeAcross||v.MergeDown){for(var oe=y;oe<=Y;++oe)for(var se=_;se<=le;++se)(oe>y||se>_)&&(t.dense?(f["!data"][se]||(f["!data"][se]=[]),f["!data"][se][oe]={t:"z"}):f[$o(oe)+ys(se)]={t:"z"});y=Y+1}else++y;else v=xFt(s[0]),v.Index&&(y=+v.Index-1),yx.e.c&&(x.e.c=y),s[0].slice(-2)==="/>"&&++y,R=[];break;case"row":s[1]==="/"||s[0].slice(-2)==="/>"?(_x.e.r&&(x.e.r=_),s[0].slice(-2)==="/>"&&(p=Cg(s[0]),p.Index&&(_=+p.Index-1)),y=0,++_):(p=Cg(s[0]),p.Index&&(_=+p.Index-1),q={},(p.AutoFitHeight=="0"||p.Height)&&(q.hpx=parseInt(p.Height,10),q.hpt=oGe(q.hpx),V[_]=q),p.Hidden=="1"&&(q.hidden=!0,V[_]=q));break;case"worksheet":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"));c.push(d),x.s.r<=x.e.r&&x.s.c<=x.e.c&&(f["!ref"]=lo(x),t.sheetRows&&t.sheetRows<=x.e.r&&(f["!fullref"]=f["!ref"],x.e.r=t.sheetRows-1,f["!ref"]=lo(x))),T.length&&(f["!merges"]=T),D.length>0&&(f["!cols"]=D),V.length>0&&(f["!rows"]=V),h[d]=f}else x={s:{r:2e6,c:2e6},e:{r:0,c:0}},_=y=0,l.push([s[3],!1]),u=Cg(s[0]),d=so(u.Name),f={},t.dense&&(f["!data"]=[]),T=[],z=[],V=[],Q={name:d,Hidden:0},j.Sheets.push(Q);break;case"table":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else{if(s[0].slice(-2)=="/>")break;l.push([s[3],!1]),D=[],W=!1}break;case"style":s[1]==="/"?EFt(S,w,t):w=Cg(s[0]);break;case"numberformat":w.nf=so(Cg(s[0]).Format||"General"),dR[w.nf]&&(w.nf=dR[w.nf]);for(var me=0;me!=392&&ji[me]!=w.nf;++me);if(me==392){for(me=57;me!=392;++me)if(ji[me]==null){OE(w.nf,me);break}}break;case"column":if(l[l.length-1][0]!=="table"||s[1]==="/")break;if(G=Cg(s[0]),G.Hidden&&(G.hidden=!0,delete G.Hidden),G.Width&&(G.wpx=parseInt(G.Width,10)),!W&&G.wpx>10){W=!0,Ef=iGe;for(var Ce=0;Ce0&&(yt.Sheet=j.Sheets.length-1),j.Names.push(yt);break;case"namedcell":break;case"b":break;case"i":break;case"u":break;case"s":break;case"em":break;case"h2":break;case"h3":break;case"sub":break;case"sup":break;case"span":break;case"alignment":break;case"borders":break;case"border":break;case"font":if(s[0].slice(-2)==="/>")break;s[1]==="/"?b+=r.slice(E,s.index):E=s.index+s[0].length;break;case"interior":if(!t.cellStyles)break;w.Interior=Cg(s[0]);break;case"protection":break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if(s[0].slice(-2)==="/>")break;s[1]==="/"?cOt(C,ie,r.slice(M,s.index)):M=s.index+s[0].length;break;case"paragraphs":break;case"styles":case"workbook":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else l.push([s[3],!1]);break;case"comment":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"));AFt(k),R.push(k)}else l.push([s[3],!1]),u=Cg(s[0]),k={a:u.Author};break;case"autofilter":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else if(s[0].charAt(s[0].length-2)!=="/"){var je=Cg(s[0]);f["!autofilter"]={ref:DE(je.Range).replace(/\$/g,"")},l.push([s[3],!0])}break;case"name":break;case"datavalidation":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else s[0].charAt(s[0].length-2)!=="/"&&l.push([s[3],!0]);break;case"pixelsperinch":break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else s[0].charAt(s[0].length-2)!=="/"&&l.push([s[3],!0]);break;case"null":break;default:if(l.length==0&&s[3]=="document"||l.length==0&&s[3]=="uof")return exe(r,t);var st=!0;switch(l[l.length-1][0]){case"officedocumentsettings":switch(s[3]){case"allowpng":break;case"removepersonalinformation":break;case"downloadcomponents":break;case"locationofcomponents":break;case"colors":break;case"color":break;case"index":break;case"rgb":break;case"targetscreensize":break;case"readonlyrecommended":break;default:st=!1}break;case"componentoptions":switch(s[3]){case"toolbar":break;case"hideofficelogo":break;case"spreadsheetautofit":break;case"label":break;case"caption":break;case"maxheight":break;case"maxwidth":break;case"nextsheetnumber":break;default:st=!1}break;case"excelworkbook":switch(s[3]){case"date1904":j.WBProps.date1904=!0;break;case"windowheight":break;case"windowwidth":break;case"windowtopx":break;case"windowtopy":break;case"tabratio":break;case"protectstructure":break;case"protectwindow":break;case"protectwindows":break;case"activesheet":break;case"displayinknotes":break;case"firstvisiblesheet":break;case"supbook":break;case"sheetname":break;case"sheetindex":break;case"sheetindexfirst":break;case"sheetindexlast":break;case"dll":break;case"acceptlabelsinformulas":break;case"donotsavelinkvalues":break;case"iteration":break;case"maxiterations":break;case"maxchange":break;case"path":break;case"xct":break;case"count":break;case"selectedsheets":break;case"calculation":break;case"uncalced":break;case"startupprompt":break;case"crn":break;case"externname":break;case"formula":break;case"colfirst":break;case"collast":break;case"wantadvise":break;case"boolean":break;case"error":break;case"text":break;case"ole":break;case"noautorecover":break;case"publishobjects":break;case"donotcalculatebeforesave":break;case"number":break;case"refmoder1c1":break;case"embedsavesmarttags":break;default:st=!1}break;case"workbookoptions":switch(s[3]){case"owcversion":break;case"height":break;case"width":break;default:st=!1}break;case"worksheetoptions":switch(s[3]){case"visible":if(s[0].slice(-2)!=="/>")if(s[1]==="/")switch(r.slice(M,s.index)){case"SheetHidden":Q.Hidden=1;break;case"SheetVeryHidden":Q.Hidden=2;break}else M=s.index+s[0].length;break;case"header":f["!margins"]||fR(f["!margins"]={},"xlml"),isNaN(+Tn(s[0]).Margin)||(f["!margins"].header=+Tn(s[0]).Margin);break;case"footer":f["!margins"]||fR(f["!margins"]={},"xlml"),isNaN(+Tn(s[0]).Margin)||(f["!margins"].footer=+Tn(s[0]).Margin);break;case"pagemargins":var Nt=Tn(s[0]);f["!margins"]||fR(f["!margins"]={},"xlml"),isNaN(+Nt.Top)||(f["!margins"].top=+Nt.Top),isNaN(+Nt.Left)||(f["!margins"].left=+Nt.Left),isNaN(+Nt.Right)||(f["!margins"].right=+Nt.Right),isNaN(+Nt.Bottom)||(f["!margins"].bottom=+Nt.Bottom);break;case"displayrighttoleft":j.Views||(j.Views=[]),j.Views[0]||(j.Views[0]={}),j.Views[0].RTL=!0;break;case"freezepanes":break;case"frozennosplit":break;case"splithorizontal":case"splitvertical":break;case"donotdisplaygridlines":break;case"activerow":break;case"activecol":break;case"toprowbottompane":break;case"leftcolumnrightpane":break;case"unsynced":break;case"print":break;case"printerrors":break;case"panes":break;case"scale":break;case"pane":break;case"number":break;case"layout":break;case"pagesetup":break;case"selected":break;case"protectobjects":break;case"enableselection":break;case"protectscenarios":break;case"validprinterinfo":break;case"horizontalresolution":break;case"verticalresolution":break;case"numberofcopies":break;case"activepane":break;case"toprowvisible":break;case"leftcolumnvisible":break;case"fittopage":break;case"rangeselection":break;case"papersizeindex":break;case"pagelayoutzoom":break;case"pagebreakzoom":break;case"filteron":break;case"fitwidth":break;case"fitheight":break;case"commentslayout":break;case"zoom":break;case"lefttoright":break;case"gridlines":break;case"allowsort":break;case"allowfilter":break;case"allowinsertrows":break;case"allowdeleterows":break;case"allowinsertcols":break;case"allowdeletecols":break;case"allowinserthyperlinks":break;case"allowformatcells":break;case"allowsizecols":break;case"allowsizerows":break;case"nosummaryrowsbelowdetail":f["!outline"]||(f["!outline"]={}),f["!outline"].above=!0;break;case"tabcolorindex":break;case"donotdisplayheadings":break;case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":f["!outline"]||(f["!outline"]={}),f["!outline"].left=!0;break;case"blackandwhite":break;case"donotdisplayzeros":break;case"displaypagebreak":break;case"rowcolheadings":break;case"donotdisplayoutline":break;case"noorientation":break;case"allowusepivottables":break;case"zeroheight":break;case"viewablerange":break;case"selection":break;case"protectcontents":break;default:st=!1}break;case"pivottable":case"pivotcache":switch(s[3]){case"immediateitemsondrop":break;case"showpagemultipleitemlabel":break;case"compactrowindent":break;case"location":break;case"pivotfield":break;case"orientation":break;case"layoutform":break;case"layoutsubtotallocation":break;case"layoutcompactrow":break;case"position":break;case"pivotitem":break;case"datatype":break;case"datafield":break;case"sourcename":break;case"parentfield":break;case"ptlineitems":break;case"ptlineitem":break;case"countofsameitems":break;case"item":break;case"itemtype":break;case"ptsource":break;case"cacheindex":break;case"consolidationreference":break;case"filename":break;case"reference":break;case"nocolumngrand":break;case"norowgrand":break;case"blanklineafteritems":break;case"hidden":break;case"subtotal":break;case"basefield":break;case"mapchilditems":break;case"function":break;case"refreshonfileopen":break;case"printsettitles":break;case"mergelabels":break;case"defaultversion":break;case"refreshname":break;case"refreshdate":break;case"refreshdatecopy":break;case"versionlastrefresh":break;case"versionlastupdate":break;case"versionupdateablemin":break;case"versionrefreshablemin":break;case"calculation":break;default:st=!1}break;case"pagebreaks":switch(s[3]){case"colbreaks":break;case"colbreak":break;case"rowbreaks":break;case"rowbreak":break;case"colstart":break;case"colend":break;case"rowend":break;default:st=!1}break;case"autofilter":switch(s[3]){case"autofiltercolumn":break;case"autofiltercondition":break;case"autofilterand":break;case"autofilteror":break;default:st=!1}break;case"querytable":switch(s[3]){case"id":break;case"autoformatfont":break;case"autoformatpattern":break;case"querysource":break;case"querytype":break;case"enableredirections":break;case"refreshedinxl9":break;case"urlstring":break;case"htmltables":break;case"connection":break;case"commandtext":break;case"refreshinfo":break;case"notitles":break;case"nextid":break;case"columninfo":break;case"overwritecells":break;case"donotpromptforfile":break;case"textwizardsettings":break;case"source":break;case"number":break;case"decimal":break;case"thousandseparator":break;case"trailingminusnumbers":break;case"formatsettings":break;case"fieldtype":break;case"delimiters":break;case"tab":break;case"comma":break;case"autoformatname":break;case"versionlastedit":break;case"versionlastrefresh":break;default:st=!1}break;case"datavalidation":switch(s[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;case"cellrangelist":break;default:st=!1}break;case"sorting":case"conditionalformatting":switch(s[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"cellrangelist":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;default:st=!1}break;case"mapinfo":case"schema":case"data":switch(s[3]){case"map":break;case"entry":break;case"range":break;case"xpath":break;case"field":break;case"xsdtype":break;case"filteron":break;case"aggregate":break;case"elementtype":break;case"attributetype":break;case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":break;case"row":break;default:st=!1}break;case"smarttags":break;default:st=!1;break}if(st||s[3].match(/!\[CDATA/))break;if(!l[l.length-1][1])throw"Unrecognized tag: "+s[3]+"|"+l.join("|");if(l[l.length-1][0]==="customdocumentproperties"){if(s[0].slice(-2)==="/>")break;s[1]==="/"?wFt(A,ie,I,r.slice(M,s.index)):(I=s,M=s.index+s[0].length);break}if(t.WTF)throw"Unrecognized tag: "+s[3]+"|"+l.join("|")}var Zt={};return!t.bookSheets&&!t.bookProps&&(Zt.Sheets=h),Zt.SheetNames=c,Zt.Workbook=j,Zt.SSF=sh(ji),Zt.Props=C,Zt.Custprops=A,Zt.bookType="xlml",Zt}function wQ(n,e){switch(Moe(e=e||{}),e.type||"base64"){case"base64":return SX(Tv(n),e);case"binary":case"buffer":case"file":return SX(n,e);case"array":return SX(p_(n),e)}}function MFt(n){var e={},t=n.content;if(t.l=28,e.AnsiUserType=t.read_shift(0,"lpstr-ansi"),e.AnsiClipboardFormat=$Pt(t),t.length-t.l<=4)return e;var r=t.read_shift(4);if(r==0||r>40||(t.l-=4,e.Reserved1=t.read_shift(0,"lpstr-ansi"),t.length-t.l<=4)||(r=t.read_shift(4),r!==1907505652)||(e.UnicodeClipboardFormat=WPt(t),r=t.read_shift(4),r==0||r>40))return e;t.l-=4,e.Reserved2=t.read_shift(0,"lpwstr")}var IFt=[60,1084,2066,2165,2175];function LFt(n,e,t,r,i){var a=r,o=[],s=t.slice(t.l,t.l+a);if(i&&i.enc&&i.enc.insitu&&s.length>0)switch(n){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:break;case 133:break;default:i.enc.insitu(s)}o.push(s),t.l+=a;for(var l=R1(t,t.l),u=bQ[l],h=0;u!=null&&IFt.indexOf(l)>-1;)a=R1(t,t.l+2),h=t.l+4,l==2066?h+=4:(l==2165||l==2175)&&(h+=12),s=t.slice(h,t.l+4+a),o.push(s),t.l+=4+a,u=bQ[l=R1(t,t.l)];var c=Yx(o);eh(c,0);var f=0;c.lens=[];for(var d=0;d1)&&!(kt.sheetRows&&pt.r>=kt.sheetRows)){if(kt.cellStyles&&ar.XF&&ar.XF.data&&C(pt,ar,kt),delete ar.ixfe,delete ar.XF,c=pt,f=bo(pt),(!o||!o.s||!o.e)&&(o={s:{r:0,c:0},e:{r:0,c:0}}),pt.ro.e.r&&(o.e.r=pt.r+1),pt.c+1>o.e.c&&(o.e.c=pt.c+1),kt.cellFormula&&ar.f){for(var Dr=0;Drpt.c||y[Dr][0].s.r>pt.r)&&!(y[Dr][0].e.c>8)!==se)throw new Error("rt mismatch: "+Le+"!="+se);Ce.r==12&&(n.l+=10,me-=10)}var re={};if(se===10?re=Ce.f(n,me,M):re=LFt(se,Ce,n,me,M),q==0&&[9,521,1033,2057].indexOf(V)===-1)continue;switch(se){case 34:t.opts.Date1904=b.WBProps.date1904=re;break;case 134:t.opts.WriteProtect=!0;break;case 47:if(M.enc||(n.l=0),M.enc=re,!e.password)throw new Error("File is password-protected");if(re.valid==null)throw new Error("Encryption scheme unsupported");if(!re.valid)throw new Error("Password is incorrect");break;case 92:M.lastuser=re;break;case 66:var yt=Number(re);switch(yt){case 21010:yt=1200;break;case 32768:yt=1e4;break;case 32769:yt=1252;break}r0(M.codepage=yt),ie=!0;break;case 317:M.rrtabid=re;break;case 25:M.winlocked=re;break;case 439:t.opts.RefreshAll=re;break;case 12:t.opts.CalcCount=re;break;case 16:t.opts.CalcDelta=re;break;case 17:t.opts.CalcIter=re;break;case 13:t.opts.CalcMode=re;break;case 14:t.opts.CalcPrecision=re;break;case 95:t.opts.CalcSaveRecalc=re;break;case 15:M.CalcRefMode=re;break;case 2211:t.opts.FullCalc=re;break;case 129:re.fDialog&&(i["!type"]="dialog"),re.fBelow||((i["!outline"]||(i["!outline"]={})).above=!0),re.fRight||((i["!outline"]||(i["!outline"]={})).left=!0);break;case 224:S.push(re);break;case 430:z.push([re]),z[z.length-1].XTI=[];break;case 35:case 547:z[z.length-1].push(re);break;case 24:case 536:Q={Name:re.Name,Ref:kc(re.rgce,o,null,z,M)},re.itab>0&&(Q.Sheet=re.itab-1),z.names.push(Q),z[0]||(z[0]=[],z[0].XTI=[]),z[z.length-1].push(re),re.Name=="_xlnm._FilterDatabase"&&re.itab>0&&re.rgce&&re.rgce[0]&&re.rgce[0][0]&&re.rgce[0][0][0]=="PtgArea3d"&&(j[re.itab-1]={ref:lo(re.rgce[0][0][1][2])});break;case 22:M.ExternCount=re;break;case 23:z.length==0&&(z[0]=[],z[0].XTI=[]),z[z.length-1].XTI=z[z.length-1].XTI.concat(re),z.XTI=z.XTI.concat(re);break;case 2196:if(M.biff<8)break;Q!=null&&(Q.Comment=re[1]);break;case 18:i["!protect"]=re;break;case 19:re!==0&&M.WTF&&console.error("Password verifier: "+re);break;case 133:a[re.pos]=re,M.snames.push(re.name);break;case 10:{if(--q)break;if(o.e){if(o.e.r>0&&o.e.c>0){if(o.e.r--,o.e.c--,i["!ref"]=lo(o),e.sheetRows&&e.sheetRows<=o.e.r){var je=o.e.r;o.e.r=e.sheetRows-1,i["!fullref"]=i["!ref"],i["!ref"]=lo(o),o.e.r=je}o.e.r++,o.e.c++}R.length>0&&(i["!merges"]=R),k.length>0&&(i["!objects"]=k),D.length>0&&(i["!cols"]=D),G.length>0&&(i["!rows"]=G),b.Sheets.push(E)}u===""?h=i:r[u]=i,i={},e.dense&&(i["!data"]=[])}break;case 9:case 521:case 1033:case 2057:{if(M.biff===8&&(M.biff={9:2,521:3,1033:4}[se]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[re.BIFFVer]||8),M.biffguess=re.BIFFVer==0,re.BIFFVer==0&&re.dt==4096&&(M.biff=5,ie=!0,r0(M.codepage=28591)),M.biff==8&&re.BIFFVer==0&&re.dt==16&&(M.biff=2),q++)break;if(i={},e.dense&&(i["!data"]=[]),M.biff<8&&!ie&&(ie=!0,r0(M.codepage=e.codepage||1252)),M.biff<5||re.BIFFVer==0&&re.dt==4096){u===""&&(u="Sheet1"),o={s:{r:0,c:0},e:{r:0,c:0}};var st={pos:n.l-me,name:u};a[st.pos]=st,M.snames.push(u)}else u=(a[oe]||{name:""}).name;re.dt==32&&(i["!type"]="chart"),re.dt==64&&(i["!type"]="macro"),R=[],k=[],M.arrayf=y=[],D=[],G=[],W=!1,E={Hidden:(a[oe]||{hs:0}).hs,name:u}}break;case 515:case 3:case 2:i["!type"]=="chart"&&(e.dense?(i["!data"][re.r]||[])[re.c]:i[$o(re.c)+ys(re.r)])&&++re.c,_={ixfe:re.ixfe,XF:S[re.ixfe]||{},v:re.val,t:"n"},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e);break;case 5:case 517:_={ixfe:re.ixfe,XF:S[re.ixfe],v:re.val,t:re.t},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e);break;case 638:_={ixfe:re.ixfe,XF:S[re.ixfe],v:re.rknum,t:"n"},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e);break;case 189:for(var Nt=re.c;Nt<=re.C;++Nt){var Zt=re.rkrec[Nt-re.c][0];_={ixfe:Zt,XF:S[Zt],v:re.rkrec[Nt-re.c][1],t:"n"},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:Nt,r:re.r},_,e)}break;case 6:case 518:case 1030:{if(re.val=="String"){s=re;break}if(_=e5(re.val,re.cell.ixfe,re.tt),_.XF=S[_.ixfe],e.cellFormula){var qe=re.formula;if(qe&&qe[0]&&qe[0][0]&&qe[0][0][0]=="PtgExp"){var ur=qe[0][0][1][0],Dt=qe[0][0][1][1],ft=bo({r:ur,c:Dt});m[ft]?_.f=""+kc(re.formula,o,re.cell,z,M):_.F=((e.dense?(i["!data"][ur]||[])[Dt]:i[ft])||{}).F}else _.f=""+kc(re.formula,o,re.cell,z,M)}Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A(re.cell,_,e),s=re}break;case 7:case 519:if(s)s.val=re,_=e5(re,s.cell.ixfe,"s"),_.XF=S[_.ixfe],e.cellFormula&&(_.f=""+kc(s.formula,o,s.cell,z,M)),Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A(s.cell,_,e),s=null;else throw new Error("String record expects Formula");break;case 33:case 545:{y.push(re);var Oe=bo(re[0].s);if(d=e.dense?(i["!data"][re[0].s.r]||[])[re[0].s.c]:i[Oe],e.cellFormula&&d){if(!s||!Oe||!d)break;d.f=""+kc(re[1],o,re[0],z,M),d.F=lo(re[0])}}break;case 1212:{if(!e.cellFormula)break;if(f){if(!s)break;m[bo(s.cell)]=re[0],d=e.dense?(i["!data"][s.cell.r]||[])[s.cell.c]:i[bo(s.cell)],(d||{}).f=""+kc(re[0],o,c,z,M)}}break;case 253:_=e5(l[re.isst].t,re.ixfe,"s"),l[re.isst].h&&(_.h=l[re.isst].h),_.XF=S[_.ixfe],Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e);break;case 513:e.sheetStubs&&(_={ixfe:re.ixfe,XF:S[re.ixfe],t:"z"},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e));break;case 190:if(e.sheetStubs)for(var J=re.c;J<=re.C;++J){var We=re.ixfe[J-re.c];_={ixfe:We,XF:S[We],t:"z"},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:J,r:re.r},_,e)}break;case 214:case 516:case 4:_=e5(re.val,re.ixfe,"s"),_.XF=S[_.ixfe],Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e);break;case 0:case 512:q===1&&(o=re);break;case 252:l=re;break;case 1054:if(M.biff==4){le[Y++]=re[1];for(var Tt=0;Tt=163&&OE(re[1],Y+163)}else OE(re[1],re[0]);break;case 30:{le[Y++]=re;for(var Qe=0;Qe=163&&OE(re,Y+163)}break;case 229:R=R.concat(re);break;case 93:k[re.cmo[0]]=M.lastobj=re;break;case 438:M.lastobj.TxO=re;break;case 127:M.lastobj.ImData=re;break;case 440:for(g=re[0].s.r;g<=re[0].e.r;++g)for(p=re[0].s.c;p<=re[0].e.c;++p)d=e.dense?(i["!data"][g]||[])[p]:i[bo({c:p,r:g})],d&&(d.l=re[1]);break;case 2048:for(g=re[0].s.r;g<=re[0].e.r;++g)for(p=re[0].s.c;p<=re[0].e.c;++p)d=e.dense?(i["!data"][g]||[])[p]:i[bo({c:p,r:g})],d&&d.l&&(d.l.Tooltip=re[1]);break;case 28:{if(M.biff<=5&&M.biff>=2)break;d=e.dense?(i["!data"][re[0].r]||[])[re[0].c]:i[bo(re[0])];var zt=k[re[2]];d||(e.dense?(i["!data"][re[0].r]||(i["!data"][re[0].r]=[]),d=i["!data"][re[0].r][re[0].c]={t:"z"}):d=i[bo(re[0])]={t:"z"},o.e.r=Math.max(o.e.r,re[0].r),o.s.r=Math.min(o.s.r,re[0].r),o.e.c=Math.max(o.e.c,re[0].c),o.s.c=Math.min(o.s.c,re[0].c)),d.c||(d.c=[]),v={a:re[1],t:zt.TxO.t},d.c.push(v)}break;case 2173:QDt(S[re.ixfe],re.ext);break;case 125:{if(!M.cellStyles)break;for(;re.e>=re.s;)D[re.e--]={width:re.w/256,level:re.level||0,hidden:!!(re.flags&1)},W||(W=!0,Eoe(re.w/256)),wM(D[re.e+1])}break;case 520:{var mt={};re.level!=null&&(G[re.r]=mt,mt.level=re.level),re.hidden&&(G[re.r]=mt,mt.hidden=!0),re.hpt&&(G[re.r]=mt,mt.hpt=re.hpt,mt.hpx=RD(re.hpt))}break;case 38:case 39:case 40:case 41:i["!margins"]||fR(i["!margins"]={}),i["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[se]]=re;break;case 161:i["!margins"]||fR(i["!margins"]={}),i["!margins"].header=re.header,i["!margins"].footer=re.footer;break;case 574:re.RTL&&(b.Views[0].RTL=!0);break;case 146:w=re;break;case 2198:I=re;break;case 140:x=re;break;case 442:u?E.CodeName=re||E.name:b.WBProps.CodeName=re||"ThisWorkbook";break}}else Ce||console.error("Missing Info for XLS Record 0x"+se.toString(16)),n.l+=me}return t.SheetNames=h0(a).sort(function(wt,pt){return Number(wt)-Number(pt)}).map(function(wt){return a[wt].name}),e.bookSheets||(t.Sheets=r),!t.SheetNames.length&&h["!ref"]?(t.SheetNames.push("Sheet1"),t.Sheets&&(t.Sheets.Sheet1=h)):t.Preamble=h,t.Sheets&&j.forEach(function(wt,pt){t.Sheets[t.SheetNames[pt]]["!autofilter"]=wt}),t.Strings=l,t.SSF=sh(ji),M.enc&&(t.Encryption=M.enc),I&&(t.Themes=I),t.Metadata={},x!==void 0&&(t.Metadata.Country=x),z.names.length>0&&(b.Names=z.names),t.Workbook=b,t}var Z_e={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function OFt(n,e,t){var r=co.find(n,"/!DocumentSummaryInformation");if(r&&r.size>0)try{var i=O_e(r,ZPt,Z_e.DSI);for(var a in i)e[a]=i[a]}catch(u){if(t.WTF)throw u}var o=co.find(n,"/!SummaryInformation");if(o&&o.size>0)try{var s=O_e(o,KPt,Z_e.SI);for(var l in s)e[l]==null&&(e[l]=s[l])}catch(u){if(t.WTF)throw u}e.HeadingPairs&&e.TitlesOfParts&&(U8e(e.HeadingPairs,e.TitlesOfParts,e,t),delete e.HeadingPairs,delete e.TitlesOfParts)}function EGe(n,e){e||(e={}),Moe(e),ZBe(),e.codepage&&uoe(e.codepage);var t,r;if(n.FullPaths){if(co.find(n,"/encryption"))throw new Error("File is password-protected");t=co.find(n,"!CompObj"),r=co.find(n,"/Workbook")||co.find(n,"/Book")}else{switch(e.type){case"base64":n=iv(Tv(n));break;case"binary":n=iv(n);break;case"buffer":break;case"array":Array.isArray(n)||(n=Array.prototype.slice.call(n));break}eh(n,0),r={content:n}}var i,a;if(t&&MFt(t),e.bookProps&&!e.bookSheets)i={};else{var o=oo?"buffer":"array";if(r&&r.content)i=PFt(r.content,e);else if((a=co.find(n,"PerfectOffice_MAIN"))&&a.content)i=hR.to_workbook(a.content,(e.type=o,e));else if((a=co.find(n,"NativeContent_MAIN"))&&a.content)i=hR.to_workbook(a.content,(e.type=o,e));else throw(a=co.find(n,"MN0"))&&a.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");e.bookVBA&&n.FullPaths&&co.find(n,"/_VBA_PROJECT_CUR/VBA/dir")&&(i.vbaraw=yNt(n))}var s={};return n.FullPaths&&OFt(n,s,e),i.Props=i.Custprops=s,e.bookFiles&&(i.cfb=n),i}var n9={0:{f:dkt},1:{f:ykt},2:{f:Ckt},3:{f:Skt},4:{f:_kt},5:{f:Tkt},6:{f:Ikt},7:{f:bkt},8:{f:Dkt},9:{f:Rkt},10:{f:Pkt},11:{f:Okt},12:{f:mkt},13:{f:Akt},14:{f:wkt},15:{f:xkt},16:{f:_Ge},17:{f:Lkt},18:{f:Ekt},19:{f:moe},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:sFt},40:{},42:{},43:{f:PDt},44:{f:LDt},45:{f:ODt},46:{f:DDt},47:{f:RDt},48:{},49:{f:kPt},50:{},51:{f:tNt},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:Q8e},62:{f:Mkt},63:{f:oNt},64:{f:$kt},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:Kc,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:Vkt},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:gkt},148:{f:vkt,p:16},151:{f:Fkt},152:{},153:{f:aFt},154:{},155:{},156:{f:iFt},157:{},158:{},159:{T:1,f:qRt},160:{T:-1},161:{T:1,f:rT},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:Nkt},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:eNt},336:{T:-1},337:{f:rNt,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:mQ},357:{},358:{},359:{},360:{T:1},361:{},362:{f:J8e},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:Bkt},427:{f:Gkt},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:Ukt},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:pkt},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:kkt},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:mQ},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:vNt},633:{T:1},634:{T:-1},635:{T:1,f:dNt},636:{T:-1},637:{f:BPt},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:qkt},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:Wkt},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}},bQ={6:{f:_X},10:{f:cx},12:{f:nu},13:{f:nu},14:{f:tu},15:{f:tu},16:{f:Bc},17:{f:tu},18:{f:tu},19:{f:nu},20:{f:k_e},21:{f:k_e},23:{f:J8e},24:{f:B_e},25:{f:tu},26:{},27:{},28:{f:hRt},29:{},34:{f:tu},35:{f:F_e},38:{f:Bc},39:{f:Bc},40:{f:Bc},41:{f:Bc},42:{f:tu},43:{f:tu},47:{f:vDt},49:{f:XOt},51:{f:nu},60:{},61:{f:WOt},64:{f:tu},65:{f:jOt},66:{f:nu},77:{},80:{},81:{},82:{},85:{f:nu},89:{},90:{},91:{},92:{f:kOt},93:{f:fRt},94:{},95:{f:tu},96:{},97:{},99:{f:tu},125:{f:Q8e},128:{f:nRt},129:{f:FOt},130:{f:nu},131:{f:tu},132:{f:tu},133:{f:BOt},134:{},140:{f:mRt},141:{f:nu},144:{},146:{f:xRt},151:{},152:{},153:{},154:{},155:{},156:{f:nu},157:{},158:{},160:{f:TRt},161:{f:wRt},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:QOt},190:{f:eRt},193:{f:cx},197:{},198:{},199:{},200:{},201:{},202:{f:tu},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:nu},220:{},221:{f:tu},222:{},224:{f:rRt},225:{f:NOt},226:{f:cx},227:{},229:{f:cRt},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:GOt},253:{f:YOt},255:{f:zOt},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:j8e},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:tu},353:{f:cx},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:aRt},431:{f:tu},432:{},433:{},434:{},437:{},438:{f:pRt},439:{f:tu},440:{f:gRt},441:{},442:{f:k3},443:{},444:{f:nu},445:{},446:{},448:{f:cx},449:{f:$Ot,r:2},450:{f:cx},512:{f:D_e},513:{f:ERt},515:{f:iRt},516:{f:qOt},517:{f:N_e},519:{f:CRt},520:{f:UOt},523:{},545:{f:z_e},549:{f:R_e},566:{},574:{f:HOt},638:{f:JOt},659:{},1048:{},1054:{f:ZOt},1084:{},1212:{f:sRt},2048:{f:yRt},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:Z4},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:cx},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:SRt,r:12},2173:{f:JDt,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:tu,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:oRt,r:12},2197:{},2198:{f:jDt,r:12},2199:{},2200:{},2201:{},2202:{f:lRt,r:12},2203:{f:cx},2204:{},2205:{},2206:{},2207:{},2211:{f:VOt},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:nu},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:bRt},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:_Rt},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:D_e},1:{},2:{f:LRt},3:{f:IRt},4:{f:MRt},5:{f:N_e},7:{f:PRt},8:{},9:{f:Z4},11:{},22:{f:nu},30:{f:KOt},31:{},32:{},33:{f:z_e},36:{},37:{f:R_e},50:{f:ORt},62:{},52:{},67:{},68:{f:nu},69:{},86:{},126:{},127:{f:ARt},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:RRt},223:{},234:{},354:{},421:{},518:{f:_X},521:{f:Z4},536:{f:B_e},547:{f:F_e},561:{},579:{},1030:{f:_X},1033:{f:Z4},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},101:{},102:{},105:{},106:{},107:{},109:{},112:{},114:{},29282:{}};function Ag(n,e,t,r){var i=e;if(!isNaN(i)){var a=r||(t||[]).length||0,o=n.next(4);o.write_shift(2,i),o.write_shift(2,a),a>0&&O8e(t)&&n.push(t)}}function K_e(n,e){var t=e||{},r=t.dense!=null?t.dense:SLt,i={};r&&(i["!data"]=[]),n=n.replace(//g,"");var a=n.match(/");var o=n.match(/<\/table/i),s=a.index,l=o&&o.index||n.length,u=iPt(n.slice(s,l),/(:?]*>)/i,""),h=-1,c=0,f=0,d=0,v={s:{r:1e7,c:1e7},e:{r:0,c:0}},p=[];for(s=0;s/i);for(l=0;l"))>-1;)x=x.slice(S+1);for(var w=0;w")));d=E.colspan?+E.colspan:1,((f=+E.rowspan)>1||d>1)&&p.push({s:{r:h,c},e:{r:h+(f||1)-1,c:c+d-1}});var T=E.t||E["data-t"]||"";if(!x.length){c+=d;continue}if(x=_8e(x),v.s.r>h&&(v.s.r=h),v.e.rc&&(v.s.c=c),v.e.ct||i[c].s.c>l)&&!(i[c].e.r1&&(o.rowspan=u),h>1&&(o.colspan=h),r.editable?v=''+v+"":d&&(o["data-t"]=d&&d.t||"z",d.v!=null&&(o["data-v"]=d.v),d.z!=null&&(o["data-z"]=d.z),d.l&&(d.l.Target||"#").charAt(0)!="#"&&(v=''+v+"")),o.id=(r.id||"sjs")+"-"+f,a.push(_Pt("td",v,o))}}var p="";return p+a.join("")+""}var DFt='SheetJS Table Export',NFt="";function kFt(n,e){var t=n.match(/[\s\S]*?<\/table>/gi);if(!t||t.length==0)throw new Error("Invalid HTML: could not find
");if(t.length==1){var r=ww(K_e(t[0],e),e);return r.bookType="html",r}var i=Loe();return t.forEach(function(a,o){LU(i,K_e(a,e),"Sheet"+(o+1))}),i.bookType="html",i}function FFt(n,e,t){var r=[];return r.join("")+""}function BFt(n,e){var t=e||{},r=t.header!=null?t.header:DFt,i=t.footer!=null?t.footer:NFt,a=[r],o=eT(n["!ref"]);a.push(FFt(n,o,t));for(var s=o.s.r;s<=o.e.r;++s)a.push(RFt(n,o,s,t));return a.push("
"+i),a.join("")}function TGe(n,e,t){var r=e.rows;if(!r)throw"Unsupported origin when "+e.tagName+" is not a TABLE";var i=t||{},a=n["!data"]!=null,o=0,s=0;if(i.origin!=null)if(typeof i.origin=="number")o=i.origin;else{var l=typeof i.origin=="string"?zc(i.origin):i.origin;o=l.r,s=l.c}var u=Math.min(i.sheetRows||1e7,r.length),h={s:{r:0,c:0},e:{r:o,c:s}};if(n["!ref"]){var c=eT(n["!ref"]);h.s.r=Math.min(h.s.r,c.s.r),h.s.c=Math.min(h.s.c,c.s.c),h.e.r=Math.max(h.e.r,c.e.r),h.e.c=Math.max(h.e.c,c.e.c),o==-1&&(h.e.r=o=c.e.r+1)}var f=[],d=0,v=n["!rows"]||(n["!rows"]=[]),p=0,g=0,m=0,y=0,_=0,x=0;for(n["!cols"]||(n["!cols"]=[]);p1||x>1)&&f.push({s:{r:g+o,c:y+s},e:{r:g+o+(_||1)-1,c:y+s+(x||1)-1}});var A={t:"s",v:E},M=b.getAttribute("data-t")||b.getAttribute("t")||"";E!=null&&(E.length==0?A.t=M||"z":i.raw||E.trim().length==0||M=="s"||(E==="TRUE"?A={t:"b",v:!0}:E==="FALSE"?A={t:"b",v:!1}:isNaN(mv(E))?isNaN(SM(E).getDate())||(A={t:"d",v:pc(E)},i.cellDates||(A={t:"n",v:Zc(A.v)}),A.z=i.dateNF||ji[14]):A={t:"n",v:mv(E)})),A.z===void 0&&T!=null&&(A.z=T);var I="",R=b.getElementsByTagName("A");if(R&&R.length)for(var k=0;k=u&&(n["!fullref"]=lo((h.e.r=r.length-p+g-1+o,h))),n}function CGe(n,e){var t=e||{},r={};return t.dense&&(r["!data"]=[]),TGe(r,n,e)}function GFt(n,e){var t=ww(CGe(n,e),e);return t}function J_e(n){var e="",t=zFt(n);return t&&(e=t(n).getPropertyValue("display")),e||(e=n.style&&n.style.display),e==="none"}function zFt(n){return n.ownerDocument.defaultView&&typeof n.ownerDocument.defaultView.getComputedStyle=="function"?n.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}function UFt(n){var e=n.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(//g," ").replace(//g,function(r,i){return Array(parseInt(i,10)+1).join(" ")}).replace(/]*\/>/g," ").replace(//g,` `),t=so(e.replace(/<[^>]*>/g,""));return[t]}function AGe(n,e,t){var r=t||{},i=CU(n);Mu.lastIndex=0,i=i.replace(//mg,"").replace(//gm,"");for(var a,o,s="",l="",u,h=0,c=-1,f="";a=Mu.exec(i);)switch(a[3]=a[3].replace(/_.*$/,"")){case"number-style":case"currency-style":case"percentage-style":case"date-style":case"time-style":case"text-style":a[1]==="/"?(o["truncate-on-overflow"]=="false"&&(s.match(/h/)?s=s.replace(/h+/,"[$&]"):s.match(/m/)?s=s.replace(/m+/,"[$&]"):s.match(/s/)&&(s=s.replace(/s+/,"[$&]"))),r[o.name]=s,s=""):a[0].charAt(a[0].length-2)!=="/"&&(s="",o=Tn(a[0],!1));break;case"boolean-style":a[1]==="/"?(r[o.name]="General",s=""):a[0].charAt(a[0].length-2)!=="/"&&(s="",o=Tn(a[0],!1));break;case"boolean":s+="General";break;case"text":a[1]==="/"?(f=i.slice(c,Mu.lastIndex-a[0].length),f=="%"&&o[0]=="=0"?s=r[u["apply-style-name"]]+";"+s:console.error("ODS number format may be incorrect: "+u.condition);break;case"number":if(a[1]==="/")break;u=Tn(a[0],!1),l="",l+=wo("0",+u["min-integer-digits"]||1),ps(u.grouping)&&(l=O1(wo("#",Math.max(0,4-l.length))+l)),(+u["min-decimal-places"]||+u["decimal-places"])&&(l+="."),+u["min-decimal-places"]&&(l+=wo("0",+u["min-decimal-places"]||1)),+u["decimal-places"]-(+u["min-decimal-places"]||0)&&(l+=wo("0",+u["decimal-places"]-(+u["min-decimal-places"]||0))),s+=l;break;case"embedded-text":a[1]==="/"?h==0?s+='"'+i.slice(c,Mu.lastIndex-a[0].length).replace(/"/g,'""')+'"':s=s.slice(0,h)+'"'+i.slice(c,Mu.lastIndex-a[0].length).replace(/"/g,'""')+'"'+s.slice(h):a[0].charAt(a[0].length-2)!=="/"&&(c=Mu.lastIndex,h=-+Tn(a[0],!1).position||0);break}return r}function MGe(n,e,t){var r=e||{},i=CU(n),a=[],o,s,l,u="",h=0,c,f,d={},v=[],p={};r.dense&&(p["!data"]=[]);var g,m,y={value:""},_="",x=0,S=[],w=-1,b=-1,E={s:{r:1e6,c:1e7},e:{r:0,c:0}},T=0,C=t||{},A={},M=[],I={},R=0,k=0,D=[],G=1,W=1,z=[],V={Names:[],WBProps:{}},q={},Y=["",""],le=[],j={},Q="",ie=0,oe=!1,se=!1,me=0,Ce=0;for(Mu.lastIndex=0,i=i.replace(//mg,"").replace(//gm,"");g=Mu.exec(i);)switch(g[3]=g[3].replace(/_.*$/,"")){case"table":case"\u5DE5\u4F5C\u8868":g[1]==="/"?(E.e.c>=E.s.c&&E.e.r>=E.s.r?p["!ref"]=lo(E):p["!ref"]="A1:A1",r.sheetRows>0&&r.sheetRows<=E.e.r&&(p["!fullref"]=p["!ref"],E.e.r=r.sheetRows-1,p["!ref"]=lo(E)),M.length&&(p["!merges"]=M),D.length&&(p["!rows"]=D),c.name=c.\u540D\u79F0||c.name,typeof JSON<"u"&&JSON.stringify(c),v.push(c.name),d[c.name]=p,se=!1):g[0].charAt(g[0].length-2)!=="/"&&(c=Tn(g[0],!1),w=b=-1,E.s.r=E.s.c=1e7,E.e.r=E.e.c=0,p={},r.dense&&(p["!data"]=[]),M=[],D=[],se=!0);break;case"table-row-group":g[1]==="/"?--T:++T;break;case"table-row":case"\u884C":if(g[1]==="/"){w+=G,G=1;break}if(f=Tn(g[0],!1),f.\u884C\u53F7?w=f.\u884C\u53F7-1:w==-1&&(w=0),G=+f["number-rows-repeated"]||1,G<10)for(me=0;me0&&(D[w+me]={level:T});b=-1;break;case"covered-table-cell":g[1]!=="/"&&++b,r.sheetStubs&&(r.dense?(p["!data"][w]||(p["!data"][w]=[]),p["!data"][w][b]={t:"z"}):p[bo({r:w,c:b})]={t:"z"}),_="",S=[];break;case"table-cell":case"\u6570\u636E":if(g[0].charAt(g[0].length-2)==="/")++b,y=Tn(g[0],!1),W=parseInt(y["number-columns-repeated"]||"1",10),m={t:"z",v:null},y.formula&&r.cellFormula!=!1&&(m.f=X_e(so(y.formula))),y["style-name"]&&A[y["style-name"]]&&(m.z=A[y["style-name"]]),(y.\u6570\u636E\u7C7B\u578B||y["value-type"])=="string"&&(m.t="s",m.v=so(y["string-value"]||""),r.dense?(p["!data"][w]||(p["!data"][w]=[]),p["!data"][w][b]=m):p[$o(b)+ys(w)]=m),b+=W-1;else if(g[1]!=="/"){++b,_="",x=0,S=[],W=1;var Le=G?w+G-1:w;if(b>E.e.c&&(E.e.c=b),bE.e.r&&(E.e.r=Le),y=Tn(g[0],!1),le=[],j={},m={t:y.\u6570\u636E\u7C7B\u578B||y["value-type"],v:null},y["style-name"]&&A[y["style-name"]]&&(m.z=A[y["style-name"]]),r.cellFormula)if(y.formula&&(y.formula=so(y.formula)),y["number-matrix-columns-spanned"]&&y["number-matrix-rows-spanned"]&&(R=parseInt(y["number-matrix-rows-spanned"],10)||0,k=parseInt(y["number-matrix-columns-spanned"],10)||0,I={s:{r:w,c:b},e:{r:w+R-1,c:b+k-1}},m.F=lo(I),z.push([I,m.F])),y.formula)m.f=X_e(y.formula);else for(me=0;me=z[me][0].s.r&&w<=z[me][0].e.r&&b>=z[me][0].s.c&&b<=z[me][0].e.c&&(m.F=z[me][1]);switch((y["number-columns-spanned"]||y["number-rows-spanned"])&&(R=parseInt(y["number-rows-spanned"],10)||0,k=parseInt(y["number-columns-spanned"],10)||0,I={s:{r:w,c:b},e:{r:w+R-1,c:b+k-1}},M.push(I)),y["number-columns-repeated"]&&(W=parseInt(y["number-columns-repeated"],10)),m.t){case"boolean":m.t="b",m.v=ps(y["boolean-value"])||+y["boolean-value"]>=1;break;case"float":m.t="n",m.v=parseFloat(y.value);break;case"percentage":m.t="n",m.v=parseFloat(y.value);break;case"currency":m.t="n",m.v=parseFloat(y.value);break;case"date":m.t="d",m.v=pc(y["date-value"]),r.cellDates||(m.t="n",m.v=Zc(m.v,V.WBProps.date1904)-Ce),m.z||(m.z="m/d/yy");break;case"time":m.t="n",m.v=QLt(y["time-value"])/86400,r.cellDates&&(m.t="d",m.v=TU(m.v)),m.z||(m.z="HH:MM:SS");break;case"number":m.t="n",m.v=parseFloat(y.\u6570\u636E\u6570\u503C);break;default:if(m.t==="string"||m.t==="text"||!m.t)m.t="s",y["string-value"]!=null&&(_=so(y["string-value"]),S=[]);else throw new Error("Unsupported value type "+m.t)}}else{if(oe=!1,m.t==="s"&&(m.v=_||"",S.length&&(m.R=S),oe=x==0),q.Target&&(m.l=q),le.length>0&&(m.c=le,le=[]),_&&r.cellText!==!1&&(m.w=_),oe&&(m.t="z",delete m.v),(!oe||r.sheetStubs)&&!(r.sheetRows&&r.sheetRows<=w))for(var re=0;re0;)p["!data"][w+re][b+W]=sh(m);else for(p[bo({r:w+re,c:b})]=m;--W>0;)p[bo({r:w+re,c:b+W})]=sh(m);E.e.c<=b&&(E.e.c=b)}W=parseInt(y["number-columns-repeated"]||"1",10),b+=W-1,W=0,m={},_="",S=[]}q={};break;case"document":case"document-content":case"\u7535\u5B50\u8868\u683C\u6587\u6863":case"spreadsheet":case"\u4E3B\u4F53":case"scripts":case"styles":case"font-face-decls":case"master-styles":if(g[1]==="/"){if((o=a.pop())[0]!==g[3])throw"Bad state: "+o}else g[0].charAt(g[0].length-2)!=="/"&&a.push([g[3],!0]);break;case"annotation":if(g[1]==="/"){if((o=a.pop())[0]!==g[3])throw"Bad state: "+o;j.t=_,S.length&&(j.R=S),j.a=Q,le.push(j)}else g[0].charAt(g[0].length-2)!=="/"&&a.push([g[3],!1]);Q="",ie=0,_="",x=0,S=[];break;case"creator":g[1]==="/"?Q=i.slice(ie,g.index):ie=g.index+g[0].length;break;case"meta":case"\u5143\u6570\u636E":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if(g[1]==="/"){if((o=a.pop())[0]!==g[3])throw"Bad state: "+o}else g[0].charAt(g[0].length-2)!=="/"&&a.push([g[3],!1]);_="",x=0,S=[];break;case"scientific-number":case"currency-symbol":case"fill-character":break;case"text-style":case"boolean-style":case"number-style":case"currency-style":case"percentage-style":case"date-style":case"time-style":if(g[1]==="/"){var yt=Mu.lastIndex;AGe(i.slice(l,Mu.lastIndex),e,C),Mu.lastIndex=yt}else g[0].charAt(g[0].length-2)!=="/"&&(l=Mu.lastIndex-g[0].length);break;case"script":break;case"libraries":break;case"automatic-styles":break;case"default-style":case"page-layout":break;case"style":{var je=Tn(g[0],!1);je.family=="table-cell"&&C[je["data-style-name"]]&&(A[je.name]=C[je["data-style-name"]])}break;case"map":break;case"font-face":break;case"paragraph-properties":break;case"table-properties":break;case"table-column-properties":break;case"table-row-properties":break;case"table-cell-properties":break;case"number":break;case"fraction":break;case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":break;case"boolean":break;case"text":if(g[0].slice(-2)==="/>")break;if(g[1]==="/")switch(a[a.length-1][0]){case"number-style":case"date-style":case"time-style":u+=i.slice(h,g.index);break}else h=g.index+g[0].length;break;case"named-range":s=Tn(g[0],!1),Y=xX(s["cell-range-address"]);var st={Name:s.name,Ref:Y[0]+"!"+Y[1]};se&&(st.Sheet=v.length),V.Names.push(st);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":case"\u7535\u5B50\u8868\u683C":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":switch(s=Tn(g[0],!1),s["date-value"]){case"1904-01-01":V.WBProps.date1904=!0;case"1900-01-01":Ce=0}break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":case"\u6587\u672C\u4E32":if(["master-styles"].indexOf(a[a.length-1][0])>-1)break;if(g[1]==="/"&&(!y||!y["string-value"])){var Nt=UFt(i.slice(x,g.index));_=(_.length>0?_+` `:"")+Nt[0]}else Tn(g[0],!1),x=g.index+g[0].length;break;case"s":break;case"database-range":if(g[1]==="/")break;try{Y=xX(Tn(g[0])["target-range-address"]),d[Y[0]]["!autofilter"]={ref:Y[1]}}catch{}break;case"date":break;case"object":break;case"title":case"\u6807\u9898":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":break;case"event-listener":break;case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":break;case"properties":break;case"property":break;case"a":if(g[1]!=="/"){if(q=Tn(g[0],!1),!q.href)break;q.Target=so(q.href),delete q.href,q.Target.charAt(0)=="#"&&q.Target.indexOf(".")>-1?(Y=xX(q.Target.slice(1)),q.Target="#"+Y[0]+"!"+Y[1]):q.Target.match(/^\.\.[\\\/]/)&&(q.Target=q.Target.slice(3))}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":break;default:switch(g[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"\u8868:":case"\u5B57:":break;default:if(r.WTF)throw new Error(g)}}var Zt={Sheets:d,SheetNames:v,Workbook:V};return r.bookSheets&&delete Zt.Sheets,Zt}function Q_e(n,e){e=e||{},hp(n,"META-INF/manifest.xml")&&iOt(Cu(n,"META-INF/manifest.xml"),e);var t=cd(n,"styles.xml"),r=t&&AGe(As(t)),i=cd(n,"content.xml");if(!i)throw new Error("Missing content.xml in ODS / UOF file");var a=MGe(As(i),e,r);return hp(n,"meta.xml")&&(a.Props=z8e(Cu(n,"meta.xml"))),a.bookType="ods",a}function exe(n,e){var t=MGe(n,e);return t.bookType="fods",t}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */var Uc=function(){try{return typeof Uint8Array>"u"||typeof Uint8Array.prototype.subarray>"u"?"slice":typeof Buffer<"u"?typeof Buffer.prototype.subarray>"u"?"slice":(typeof Buffer.from=="function"?Buffer.from([72,62]):new Buffer([72,62]))instanceof Uint8Array?"subarray":"slice":"subarray"}catch{return"slice"}}();function DD(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function EQ(n){return typeof TextDecoder<"u"?new TextDecoder().decode(n):As(p_(n))}function IGe(n){for(var e=0,t=0;t>1&1431655765,n=(n&858993459)+(n>>2&858993459),(n+(n>>4)&252645135)*16843009>>>24}function VFt(n,e){for(var t=(n[e+15]&127)<<7|n[e+14]>>1,r=n[e+14]&1,i=e+13;i>=e;--i)r=r*256+n[i];return(n[e+15]&128?-r:r)*Math.pow(10,t-6176)}function i9(n,e){var t=e.l,r=n[t]&127;e:if(n[t++]>=128&&(r|=(n[t]&127)<<7,n[t++]<128||(r|=(n[t]&127)<<14,n[t++]<128)||(r|=(n[t]&127)<<21,n[t++]<128)||(r+=(n[t]&127)*Math.pow(2,28),++t,n[t++]<128)||(r+=(n[t]&127)*Math.pow(2,35),++t,n[t++]<128)||(r+=(n[t]&127)*Math.pow(2,42),++t,n[t++]<128)))break e;return e.l=t,r}function Vs(n){var e=0,t=n[e]&127;e:if(n[e++]>=128){if(t|=(n[e]&127)<<7,n[e++]<128||(t|=(n[e]&127)<<14,n[e++]<128)||(t|=(n[e]&127)<<21,n[e++]<128))break e;t|=(n[e]&127)<<28}return t}function au(n){for(var e=[],t={l:0};t.l=128;);o=n[Uc](t.l,s),t.l=s}break;case 1:o=n[Uc](s,s+8),t.l=s+8;break;case 2:{var l=i9(n,t);o=n[Uc](t.l,t.l+l),t.l+=l}break;case 5:o=n[Uc](s,s+4),t.l=s+4;break;default:throw new Error("PB Type ".concat(a," for Field ").concat(i," at offset ").concat(r))}var u={data:o,type:a};e[i]==null&&(e[i]=[]),e[i].push(u)}return e}function Aoe(n,e){return(n==null?void 0:n.map(function(t){return e(t.data)}))||[]}function $Ft(n){for(var e,t=[],r={l:0};r.l>>0>0),t.push(o)}return t}function WFt(n,e){if(n!=0)throw new Error("Unexpected Snappy chunk type ".concat(n));for(var t={l:0},r=i9(e,t),i=[],a=t.l;a>2;if(s<60)++s;else{var l=s-59;s=e[a],l>1&&(s|=e[a+1]<<8),l>2&&(s|=e[a+2]<<16),l>3&&(s|=e[a+3]<<24),s>>>=0,s++,a+=l}i.push(e[Uc](a,a+s)),a+=s;continue}else{var u=0,h=0;if(o==1?(h=(e[a]>>2&7)+4,u=(e[a++]&224)<<3,u|=e[a++]):(h=(e[a++]>>2)+1,o==2?(u=e[a]|e[a+1]<<8,a+=2):(u=(e[a]|e[a+1]<<8|e[a+2]<<16|e[a+3]<<24)>>>0,a+=4)),u==0)throw new Error("Invalid offset 0");for(var c=i.length-1,f=u;c>=0&&f>=i[c].length;)f-=i[c].length,--c;if(c<0)if(f==0)f=i[c=0].length;else throw new Error("Invalid offset beyond length");if(h0&&(i.push(i[c][Uc](i[c].length-f)),h-=f),++c;h>=i[c].length;)i.push(i[c]),h-=i[c].length,++c;h&&i.push(i[c][Uc](0,h))}i.length>25&&(i=[IGe(i)])}}for(var d=0,v=0;v>8,c=h>=5?i:r;e:if(t&(h>4?8:4)&&n.t=="n"&&u==7){var f=(a=c[7])!=null&&a[0]?Vs(c[7][0].data):-1;if(f==-1)break e;var d=(o=c[15])!=null&&o[0]?Vs(c[15][0].data):-1,v=(s=c[16])!=null&&s[0]?Vs(c[16][0].data):-1,p=(l=c[40])!=null&&l[0]?Vs(c[40][0].data):-1,g=n.v,m=g;t:if(p){if(g==0){d=v=2;break t}g>=604800?d=1:g>=86400?d=2:g>=3600?d=4:g>=60?d=8:g>=1?d=16:d=32,Math.floor(g)!=g?v=32:g%60?v=16:g%3600?v=8:g%86400?v=4:g%604800&&(v=2),v=2&&(m=g/86400,v>2&&(m|=0,g-=86400*m),_.push('d"d"'),y.push(m+(f==2?" day"+(m==1?"":"s"):f==1?"d":""))),d<=4&&v>=4&&(m=g/3600,v>4&&(m|=0,g-=3600*m),_.push((d>=4?"[h]":"h")+'"h"'),y.push(m+(f==2?" hour"+(m==1?"":"s"):f==1?"h":""))),d<=8&&v>=8&&(m=g/60,v>8&&(m|=0,g-=60*m),_.push((d>=8?"[m]":"m")+'"m"'),f==0?y.push((d==8&&v==8||m>=10?"":"0")+m):y.push(m+(f==2?" minute"+(m==1?"":"s"):f==1?"m":""))),d<=16&&v>=16&&(m=g,v>16&&(m|=0,g-=m),_.push((d>=16?"[s]":"s")+'"s"'),f==0?y.push((v==16&&d==16||m>=10?"":"0")+m):y.push(m+(f==2?" second"+(m==1?"":"s"):f==1?"s":""))),v>=32&&(m=Math.round(1e3*g),d<32&&_.push('.000"ms"'),f==0?y.push((m>=100?"":m>=10?"0":"00")+m):y.push(m+(f==2?" millisecond"+(m==1?"":"s"):f==1?"ms":""))),n.w=y.join(f==0?":":" "),n.z=_.join(f==0?'":"':" "),f==0&&(n.w=n.w.replace(/:(\d\d\d)$/,".$1"))}}function XFt(n,e,t){var r=DD(n),i=r.getUint32(4,!0),a=-1,o=-1,s=-1,l=NaN,u=new Date(2001,0,1),h=t>1?12:8;i&2&&(s=r.getUint32(h,!0),h+=4),h+=TQ(i&(t>1?3468:396))*4,i&512&&(a=r.getUint32(h,!0),h+=4),h+=TQ(i&(t>1?12288:4096))*4,i&16&&(o=r.getUint32(h,!0),h+=4),i&32&&(l=r.getFloat64(h,!0),h+=8),i&64&&(u.setTime(u.getTime()+r.getFloat64(h,!0)*1e3),h+=8),t>1&&(i=r.getUint32(8,!0)>>>16,i&255&&(s==-1&&(s=r.getUint32(h,!0)),h+=4));var c,f=n[t>=4?1:2];switch(f){case 0:return;case 2:c={t:"n",v:l};break;case 3:c={t:"s",v:e.sst[o]};break;case 5:c={t:"d",v:u};break;case 6:c={t:"b",v:l>0};break;case 7:c={t:"n",v:l};break;case 8:c={t:"e",v:0};break;case 9:if(a>-1)c={t:"s",v:e.rsst[a]};else throw new Error("Unsupported cell type ".concat(n[Uc](0,4)));break;default:throw new Error("Unsupported cell type ".concat(n[Uc](0,4)))}return s>-1&&LGe(c,f|t<<8,i,e.ofmt[s],e.nfmt[s]),f==7&&(c.v/=86400),c}function YFt(n,e){var t=DD(n);t.getUint32(4,!0);var r=t.getUint32(8,!0),i=12,a=-1,o=-1,s=-1,l=NaN,u=NaN,h=new Date(2001,0,1);r&1&&(l=VFt(n,i),i+=16),r&2&&(u=t.getFloat64(i,!0),i+=8),r&4&&(h.setTime(h.getTime()+t.getFloat64(i,!0)*1e3),i+=8),r&8&&(o=t.getUint32(i,!0),i+=4),r&16&&(a=t.getUint32(i,!0),i+=4);var c,f=n[1];switch(f){case 0:return;case 2:c={t:"n",v:l};break;case 3:c={t:"s",v:e.sst[o]};break;case 5:c={t:"d",v:h};break;case 6:c={t:"b",v:u>0};break;case 7:c={t:"n",v:u};break;case 8:c={t:"e",v:0};break;case 9:c={t:"s",v:e.rsst[a]};break;case 10:c={t:"n",v:l};break;default:throw new Error("Unsupported cell type ".concat(n[1]," : ").concat(r&31," : ").concat(n[Uc](0,4)))}return i+=TQ(r&8160)*4,r&516096&&(s==-1&&(s=t.getUint32(i,!0)),i+=4),s>-1&&LGe(c,f|5<<8,r>>13,e.ofmt[s],e.nfmt[s]),f==7&&(c.v/=86400),c}function qFt(n,e){switch(n[0]){case 0:case 1:case 2:case 3:case 4:return XFt(n,e,n[0]);case 5:return YFt(n,e);default:throw new Error("Unsupported payload version ".concat(n[0]))}}function Hg(n){var e=au(n);return Vs(e[1][0].data)}function t5(n,e){var t=au(e.data),r=Vs(t[1][0].data),i=t[3],a=[];return(i||[]).forEach(function(o){var s=au(o.data);if(!!s[1]){var l=Vs(s[1][0].data)>>>0;switch(r){case 1:a[l]=EQ(s[3][0].data);break;case 8:{var u=n[Hg(s[9][0].data)][0],h=au(u.data),c=n[Hg(h[1][0].data)][0],f=Vs(c.meta[1][0].data);if(f!=2001)throw new Error("2000 unexpected reference to ".concat(f));var d=au(c.data);a[l]=d[3].map(function(v){return EQ(v.data)}).join("")}break;case 2:a[l]=au(s[6][0].data);break;default:throw r}}}),a}function ZFt(n,e){var t,r,i,a,o,s,l,u,h,c,f,d,v,p,g=au(n),m=Vs(g[1][0].data)>>>0,y=Vs(g[2][0].data)>>>0,_=((r=(t=g[8])==null?void 0:t[0])==null?void 0:r.data)&&Vs(g[8][0].data)>0||!1,x,S;if(((a=(i=g[7])==null?void 0:i[0])==null?void 0:a.data)&&e!=0)x=(s=(o=g[7])==null?void 0:o[0])==null?void 0:s.data,S=(u=(l=g[6])==null?void 0:l[0])==null?void 0:u.data;else if(((c=(h=g[4])==null?void 0:h[0])==null?void 0:c.data)&&e!=1)x=(d=(f=g[4])==null?void 0:f[0])==null?void 0:d.data,S=(p=(v=g[3])==null?void 0:v[0])==null?void 0:p.data;else throw"NUMBERS Tile missing ".concat(e," cell storage");for(var w=_?4:1,b=DD(x),E=[],T=0;T=1&&(A[E[E.length-1][0]]=S[Uc](E[E.length-1][1]*w)),{R:m,cells:A}}function KFt(n,e){var t,r=au(e.data),i=-1;(t=r==null?void 0:r[7])!=null&&t[0]&&(Vs(r[7][0].data)>>>0?i=1:i=0);var a=Aoe(r[5],function(o){return ZFt(o,i)});return{nrows:Vs(r[4][0].data)>>>0,data:a.reduce(function(o,s){return o[s.R]||(o[s.R]=[]),s.cells.forEach(function(l,u){if(o[s.R][u])throw new Error("Duplicate cell r=".concat(s.R," c=").concat(u));o[s.R][u]=l}),o},[])}}function JFt(n,e,t){var r,i,a,o,s,l,u=au(e.data),h={s:{r:0,c:0},e:{r:0,c:0}};if(h.e.r=(Vs(u[6][0].data)>>>0)-1,h.e.r<0)throw new Error("Invalid row varint ".concat(u[6][0].data));if(h.e.c=(Vs(u[7][0].data)>>>0)-1,h.e.c<0)throw new Error("Invalid col varint ".concat(u[7][0].data));t["!ref"]=lo(h);var c=t["!data"]!=null,f=t,d=au(u[4][0].data),v=jFt();(r=d[4])!=null&&r[0]&&(v.sst=t5(n,n[Hg(d[4][0].data)][0])),(i=d[11])!=null&&i[0]&&(v.ofmt=t5(n,n[Hg(d[11][0].data)][0])),(a=d[17])!=null&&a[0]&&(v.rsst=t5(n,n[Hg(d[17][0].data)][0])),(o=d[22])!=null&&o[0]&&(v.nfmt=t5(n,n[Hg(d[22][0].data)][0]));var p=au(d[3][0].data),g=0;if(p[1].forEach(function(_){var x=au(_.data),S=n[Hg(x[2][0].data)][0],w=Vs(S.meta[1][0].data);if(w!=6002)throw new Error("6001 unexpected reference to ".concat(w));var b=KFt(n,S);b.data.forEach(function(E,T){E.forEach(function(C,A){var M=qFt(C,v);M&&(c?(f["!data"][g+T]||(f["!data"][g+T]=[]),f["!data"][g+T][A]=M):t[$o(A)+ys(g+T)]=M)})}),g+=b.nrows}),(s=d[13])!=null&&s[0]){var m=n[Hg(d[13][0].data)][0],y=Vs(m.meta[1][0].data);if(y!=6144)throw new Error("Expected merge type 6144, found ".concat(y));t["!merges"]=(l=au(m.data))==null?void 0:l[1].map(function(_){var x=au(_.data),S=DD(au(x[1][0].data)[1][0].data),w=DD(au(x[2][0].data)[1][0].data);return{s:{r:S.getUint16(0,!0),c:S.getUint16(2,!0)},e:{r:S.getUint16(0,!0)+w.getUint16(0,!0)-1,c:S.getUint16(2,!0)+w.getUint16(2,!0)-1}}})}}function QFt(n,e,t){var r=au(e.data),i={"!ref":"A1"};t!=null&&t.dense&&(i["!data"]=[]);var a=n[Hg(r[2][0].data)],o=Vs(a[0].meta[1][0].data);if(o!=6001)throw new Error("6000 unexpected reference to ".concat(o));return JFt(n,a[0],i),i}function e4t(n,e,t){var r,i=au(e.data),a={name:(r=i[1])!=null&&r[0]?EQ(i[1][0].data):"",sheets:[]},o=Aoe(i[2],Hg);return o.forEach(function(s){n[s].forEach(function(l){var u=Vs(l.meta[1][0].data);u==6e3&&a.sheets.push(QFt(n,l,t))})}),a}function t4t(n,e,t){var r,i=Loe(),a=au(e.data);if((r=a[2])!=null&&r[0])throw new Error("Keynote presentations are not supported");var o=Aoe(a[1],Hg);if(o.forEach(function(s){n[s].forEach(function(l){var u=Vs(l.meta[1][0].data);if(u==2){var h=e4t(n,l,t);h.sheets.forEach(function(c,f){LU(i,c,f==0?h.name:h.name+"_"+f,!0)})}})}),i.SheetNames.length==0)throw new Error("Empty NUMBERS file");return i.bookType="numbers",i}function wX(n,e){var t,r,i,a,o,s,l,u={},h=[];if(n.FullPaths.forEach(function(f){if(f.match(/\.iwpv2/))throw new Error("Unsupported password protection")}),n.FileIndex.forEach(function(f){if(!!f.name.match(/\.iwa$/)&&f.content[0]==0){var d;try{d=HFt(f.content)}catch(p){return console.log("?? "+f.content.length+" "+(p.message||p))}var v;try{v=$Ft(d)}catch(p){return console.log("## "+(p.message||p))}v.forEach(function(p){u[p.id]=p.messages,h.push(p.id)})}}),!h.length)throw new Error("File has no messages");if(((i=(r=(t=u==null?void 0:u[1])==null?void 0:t[0].meta)==null?void 0:r[1])==null?void 0:i[0].data)&&Vs(u[1][0].meta[1][0].data)==1e4)throw new Error("Pages documents are not supported");var c=((l=(s=(o=(a=u==null?void 0:u[1])==null?void 0:a[0])==null?void 0:o.meta)==null?void 0:s[1])==null?void 0:l[0].data)&&Vs(u[1][0].meta[1][0].data)==1&&u[1][0];if(c||h.forEach(function(f){u[f].forEach(function(d){var v=Vs(d.meta[1][0].data)>>>0;if(v==1)if(!c)c=d;else throw new Error("Document has multiple roots")})}),!c)throw new Error("Cannot find Document root");return t4t(u,c,e)}function r4t(n){return function(t){for(var r=0;r!=n.length;++r){var i=n[r];t[i[0]]===void 0&&(t[i[0]]=i[1]),i[2]==="n"&&(t[i[0]]=Number(t[i[0]]))}}}function Moe(n){r4t([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(n)}function n4t(n){return vA.WS.indexOf(n)>-1?"sheet":n==vA.CS?"chart":n==vA.DS?"dialog":n==vA.MS?"macro":n&&n.length?n:"sheet"}function i4t(n,e){if(!n)return 0;try{n=e.map(function(r){return r.id||(r.id=r.strRelID),[r.name,n["!id"][r.id].Target,n4t(n["!id"][r.id].Type)]})}catch{return null}return!n||n.length===0?null:n}function a4t(n,e,t,r,i,a,o,s,l,u,h,c){try{a[r]=lR(cd(n,t,!0),e);var f=Cu(n,e),d;switch(s){case"sheet":d=hFt(f,e,i,l,a[r],u,h,c);break;case"chart":if(d=cFt(f,e,i,l,a[r],u,h,c),!d||!d["!drawel"])break;var v=fO(d["!drawel"].Target,e),p=_Q(v),g=uNt(cd(n,v,!0),lR(cd(n,p,!0),v)),m=fO(g,v),y=_Q(m);d=Xkt(cd(n,m,!0),m,l,lR(cd(n,y,!0),m),u,d);break;case"macro":d=fFt(f,e,i,l,a[r],u,h,c);break;case"dialog":d=dFt(f,e,i,l,a[r],u,h,c);break;default:throw new Error("Unrecognized sheet type "+s)}o[r]=d;var _=[],x=[];a&&a[r]&&h0(a[r]).forEach(function(S){var w="";if(a[r][S].Type==vA.CMNT){if(w=fO(a[r][S].Target,e),_=gFt(Cu(n,w,!0),w,l),!_||!_.length)return;V_e(d,_,!1)}a[r][S].Type==vA.TCMNT&&(w=fO(a[r][S].Target,e),x=x.concat(cNt(Cu(n,w,!0),l)))}),x&&x.length&&V_e(d,x,!0,l.people||[])}catch(S){if(l.WTF)throw S}}function Zv(n){return n.charAt(0)=="/"?n.slice(1):n}function o4t(n,e){if(u8e(),e=e||{},Moe(e),hp(n,"META-INF/manifest.xml")||hp(n,"objectdata.xml"))return Q_e(n,e);if(hp(n,"Index/Document.iwa")){if(typeof Uint8Array>"u")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof wX<"u"){if(n.FileIndex)return wX(n,e);var t=co.utils.cfb_new();return v_e(n).forEach(function(k){oPt(t,k,p8e(n,k))}),wX(t,e)}throw new Error("Unsupported NUMBERS file")}if(!hp(n,"[Content_Types].xml")){if(hp(n,"index.xml.gz"))throw new Error("Unsupported NUMBERS 08 file");if(hp(n,"index.xml"))throw new Error("Unsupported NUMBERS 09 file");var r=co.find(n,"Index.zip");if(r)return e=sh(e),delete e.type,typeof r.content=="string"&&(e.type="binary"),typeof Bun<"u"&&Buffer.isBuffer(r.content)?ND(new Uint8Array(r.content),e):ND(r.content,e);throw new Error("Unsupported ZIP file")}var i=v_e(n),a=rOt(cd(n,"[Content_Types].xml")),o=!1,s,l;if(a.workbooks.length===0&&(l="xl/workbook.xml",Cu(n,l,!0)&&a.workbooks.push(l)),a.workbooks.length===0){if(l="xl/workbook.bin",!Cu(n,l,!0))throw new Error("Could not find workbook");a.workbooks.push(l),o=!0}a.workbooks[0].slice(-3)=="bin"&&(o=!0);var u={},h={};if(!e.bookSheets&&!e.bookProps){if(cR=[],a.sst)try{cR=pFt(Cu(n,Zv(a.sst)),a.sst,e)}catch(k){if(e.WTF)throw k}e.cellStyles&&a.themes.length&&(u=sGe(cd(n,a.themes[0].replace(/^\//,""),!0)||"",e)),a.style&&(h=vFt(Cu(n,Zv(a.style)),a.style,u,e))}a.links.map(function(k){try{var D=lR(cd(n,_Q(Zv(k))),k);return mFt(Cu(n,Zv(k)),D,k,e)}catch{}});var c=uFt(Cu(n,Zv(a.workbooks[0])),a.workbooks[0],e),f={},d="";a.coreprops.length&&(d=Cu(n,Zv(a.coreprops[0]),!0),d&&(f=z8e(d)),a.extprops.length!==0&&(d=Cu(n,Zv(a.extprops[0]),!0),d&&sOt(d,f,e)));var v={};(!e.bookSheets||e.bookProps)&&a.custprops.length!==0&&(d=cd(n,Zv(a.custprops[0]),!0),d&&(v=uOt(d,e)));var p={};if((e.bookSheets||e.bookProps)&&(c.Sheets?s=c.Sheets.map(function(D){return D.name}):f.Worksheets&&f.SheetNames.length>0&&(s=f.SheetNames),e.bookProps&&(p.Props=f,p.Custprops=v),e.bookSheets&&typeof s<"u"&&(p.SheetNames=s),e.bookSheets?p.SheetNames:e.bookProps))return p;s={};var g={};e.bookDeps&&a.calcchain&&(g=yFt(Cu(n,Zv(a.calcchain)),a.calcchain));var m=0,y={},_,x;{var S=c.Sheets;f.Worksheets=S.length,f.SheetNames=[];for(var w=0;w!=S.length;++w)f.SheetNames[w]=S[w].name}var b=o?"bin":"xml",E=a.workbooks[0].lastIndexOf("/"),T=(a.workbooks[0].slice(0,E+1)+"_rels/"+a.workbooks[0].slice(E+1)+".rels").replace(/^\//,"");hp(n,T)||(T="xl/_rels/workbook."+b+".rels");var C=lR(cd(n,T,!0),T.replace(/_rels.*/,"s5s"));(a.metadata||[]).length>=1&&(e.xlmeta=_Ft(Cu(n,Zv(a.metadata[0])),a.metadata[0],e)),(a.people||[]).length>=1&&(e.people=fNt(Cu(n,Zv(a.people[0])),e)),C&&(C=i4t(C,c.Sheets));var A=Cu(n,"xl/worksheets/sheet.xml",!0)?1:0;e:for(m=0;m!=f.Worksheets;++m){var M="sheet";if(C&&C[m]?(_="xl/"+C[m][1].replace(/[\/]?xl\//,""),hp(n,_)||(_=C[m][1]),hp(n,_)||(_=T.replace(/_rels\/.*$/,"")+C[m][1]),M=C[m][2]):(_="xl/worksheets/sheet"+(m+1-A)+"."+b,_=_.replace(/sheet0\./,"sheet.")),x=_.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),e&&e.sheets!=null)switch(typeof e.sheets){case"number":if(m!=e.sheets)continue e;break;case"string":if(f.SheetNames[m].toLowerCase()!=e.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(e.sheets)){for(var I=!1,R=0;R!=e.sheets.length;++R)typeof e.sheets[R]=="number"&&e.sheets[R]==m&&(I=1),typeof e.sheets[R]=="string"&&e.sheets[R].toLowerCase()==f.SheetNames[m].toLowerCase()&&(I=1);if(!I)continue e}}a4t(n,_,x,f.SheetNames[m],m,y,s,M,e,c,u,h)}return p={Directory:a,Workbook:c,Props:f,Custprops:v,Deps:g,Sheets:s,SheetNames:f.SheetNames,Strings:cR,Styles:h,Themes:u,SSF:sh(ji)},e&&e.bookFiles&&(n.files?(p.keys=i,p.files=n.files):(p.keys=[],p.files={},n.FullPaths.forEach(function(k,D){k=k.replace(/^Root Entry[\/]/,""),p.keys.push(k),p.files[k]=n.FileIndex[D]}))),e&&e.bookVBA&&(a.vba.length>0?p.vbaraw=Cu(n,Zv(a.vba[0]),!0):a.defaults&&a.defaults.bin===gNt&&(p.vbaraw=Cu(n,"xl/vbaProject.bin",!0))),p.bookType=o?"xlsb":"xlsx",p}function s4t(n,e){var t=e||{},r="Workbook",i=co.find(n,r);try{if(r="/!DataSpaces/Version",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);if(KRt(i.content),r="/!DataSpaces/DataSpaceMap",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);var a=QRt(i.content);if(a.length!==1||a[0].comps.length!==1||a[0].comps[0].t!==0||a[0].name!=="StrongEncryptionDataSpace"||a[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+r);if(r="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);var o=eDt(i.content);if(o.length!=1||o[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+r);if(r="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);rDt(i.content)}catch{}if(r="/EncryptionInfo",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);var s=nDt(i.content);if(r="/EncryptedPackage",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);if(s[0]==4&&typeof decrypt_agile<"u")return decrypt_agile(s[1],i.content,t.password||"",t);if(s[0]==2&&typeof decrypt_std76<"u")return decrypt_std76(s[1],i.content,t.password||"",t);throw new Error("File is password-protected")}function Ioe(n,e){var t="";switch((e||{}).type||"base64"){case"buffer":return[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]];case"base64":t=Tv(n.slice(0,12));break;case"binary":t=n;break;case"array":return[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]];default:throw new Error("Unrecognized type "+(e&&e.type||"undefined"))}return[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3),t.charCodeAt(4),t.charCodeAt(5),t.charCodeAt(6),t.charCodeAt(7)]}function l4t(n,e){return co.find(n,"EncryptedPackage")?s4t(n,e):EGe(n,e)}function u4t(n,e){var t,r=n,i=e||{};return i.type||(i.type=oo&&Buffer.isBuffer(n)?"buffer":"base64"),t=g8e(r,i),o4t(t,i)}function PGe(n,e){var t=0;e:for(;t"u"&&console.error("Codepage tables are not loaded. Non-ASCII characters may not give expected results"),typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer)return ND(new Uint8Array(n),(t=sh(t),t.type="array",t));typeof Uint8Array<"u"&&n instanceof Uint8Array&&!t.type&&(t.type=typeof Deno<"u"?"buffer":"array");var r=n,i=[0,0,0,0],a=!1;if(t.cellStyles&&(t.cellNF=!0,t.sheetStubs=!0),VA={},t.dateNF&&(VA.dateNF=t.dateNF),t.type||(t.type=oo&&Buffer.isBuffer(n)?"buffer":"base64"),t.type=="file"&&(t.type=oo?"buffer":"binary",r=KLt(n),typeof Uint8Array<"u"&&!oo&&(t.type="array")),t.type=="string"&&(a=!0,t.type="binary",t.codepage=65001,r=f4t(n)),t.type=="array"&&typeof Uint8Array<"u"&&n instanceof Uint8Array&&typeof ArrayBuffer<"u"){var o=new ArrayBuffer(3),s=new Uint8Array(o);if(s.foo="bar",!s.foo)return t=sh(t),t.type="array",ND(hoe(r),t)}switch((i=Ioe(r,t))[0]){case 208:if(i[1]===207&&i[2]===17&&i[3]===224&&i[4]===161&&i[5]===177&&i[6]===26&&i[7]===225)return l4t(co.read(r,t),t);break;case 9:if(i[1]<=8)return EGe(r,t);break;case 60:return wQ(r,t);case 73:if(i[1]===73&&i[2]===42&&i[3]===0)throw new Error("TIFF Image File is not a spreadsheet");if(i[1]===68)return BRt(r,t);break;case 84:if(i[1]===65&&i[2]===66&&i[3]===76)return kRt.to_workbook(r,t);break;case 80:return i[1]===75&&i[2]<9&&i[3]<9?u4t(r,t):bX(n,r,t,a);case 239:return i[3]===60?wQ(r,t):bX(n,r,t,a);case 255:if(i[1]===254)return c4t(r,t);if(i[1]===0&&i[2]===2&&i[3]===0)return hR.to_workbook(r,t);break;case 0:if(i[1]===0&&(i[2]>=2&&i[3]===0||i[2]===0&&(i[3]===8||i[3]===9)))return hR.to_workbook(r,t);break;case 3:case 131:case 139:case 140:return U_e.to_workbook(r,t);case 123:if(i[1]===92&&i[2]===114&&i[3]===116)return gDt(r,t);break;case 10:case 13:case 32:return h4t(r,t);case 137:if(i[1]===80&&i[2]===78&&i[3]===71)throw new Error("PNG Image File is not a spreadsheet");break;case 8:if(i[1]===231)throw new Error("Unsupported Multiplan 1.x file!");break;case 12:if(i[1]===236)throw new Error("Unsupported Multiplan 2.x file!");if(i[1]===237)throw new Error("Unsupported Multiplan 3.x file!");break}return DRt.indexOf(i[0])>-1&&i[2]<=12&&i[3]<=31?U_e.to_workbook(r,t):bX(n,r,t,a)}function d4t(n,e,t,r,i,a,o){var s=ys(t),l=o.defval,u=o.raw||!Object.prototype.hasOwnProperty.call(o,"raw"),h=!0,c=n["!data"]!=null,f=i===1?[]:{};if(i!==1)if(Object.defineProperty)try{Object.defineProperty(f,"__rowNum__",{value:t,enumerable:!1})}catch{f.__rowNum__=t}else f.__rowNum__=t;if(!c||n["!data"][t])for(var d=e.s.c;d<=e.e.c;++d){var v=c?(n["!data"][t]||[])[d]:n[r[d]+s];if(v===void 0||v.t===void 0){if(l===void 0)continue;a[d]!=null&&(f[a[d]]=l);continue}var p=v.v;switch(v.t){case"z":if(p==null)break;continue;case"e":p=p==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+v.t)}if(a[d]!=null){if(p==null)if(v.t=="e"&&p===null)f[a[d]]=null;else if(l!==void 0)f[a[d]]=l;else if(u&&p===null)f[a[d]]=null;else continue;else f[a[d]]=u&&(v.t!=="n"||v.t==="n"&&o.rawNumbers!==!1)?p:$S(v,p,o);p!=null&&(h=!1)}}return{row:f,isempty:h}}function CQ(n,e){if(n==null||n["!ref"]==null)return[];var t={t:"n",v:0},r=0,i=1,a=[],o=0,s="",l={s:{r:0,c:0},e:{r:0,c:0}},u=e||{},h=u.range!=null?u.range:n["!ref"];switch(u.header===1?r=1:u.header==="A"?r=2:Array.isArray(u.header)?r=3:u.header==null&&(r=0),typeof h){case"string":l=cu(h);break;case"number":l=cu(n["!ref"]),l.s.r=h;break;default:l=h}r>0&&(i=0);var c=ys(l.s.r),f=[],d=[],v=0,p=0,g=n["!data"]!=null,m=l.s.r,y=0,_={};g&&!n["!data"][m]&&(n["!data"][m]=[]);var x=u.skipHidden&&n["!cols"]||[],S=u.skipHidden&&n["!rows"]||[];for(y=l.s.c;y<=l.e.c;++y)if(!(x[y]||{}).hidden)switch(f[y]=$o(y),t=g?n["!data"][m][y]:n[f[y]+c],r){case 1:a[y]=y-l.s.c;break;case 2:a[y]=f[y];break;case 3:a[y]=u.header[y-l.s.c];break;default:if(t==null&&(t={w:"__EMPTY",t:"s"}),s=o=$S(t,null,u),p=_[o]||0,!p)_[o]=1;else{do s=o+"_"+p++;while(_[s]);_[o]=p,_[s]=1}a[y]=s}for(m=l.s.r+i;m<=l.e.r;++m)if(!(S[m]||{}).hidden){var w=d4t(n,l,m,f,r,a,u);(w.isempty===!1||(r===1?u.blankrows!==!1:!!u.blankrows))&&(d[v++]=w.row)}return d.length=v,d}var txe=/"/g;function v4t(n,e,t,r,i,a,o,s){for(var l=!0,u=[],h="",c=ys(t),f=n["!data"]!=null,d=f&&n["!data"][t]||[],v=e.s.c;v<=e.e.c;++v)if(!!r[v]){var p=f?d[v]:n[r[v]+c];if(p==null)h="";else if(p.v!=null){l=!1,h=""+(s.rawNumbers&&p.t=="n"?p.v:$S(p,null,s));for(var g=0,m=0;g!==h.length;++g)if((m=h.charCodeAt(g))===i||m===a||m===34||s.forceQuotes){h='"'+h.replace(txe,'""')+'"';break}h=="ID"&&(h='"ID"')}else p.f!=null&&!p.F?(l=!1,h="="+p.f,h.indexOf(",")>=0&&(h='"'+h.replace(txe,'""')+'"')):h="";u.push(h)}return s.blankrows===!1&&l?null:u.join(o)}function OGe(n,e){var t=[],r=e==null?{}:e;if(n==null||n["!ref"]==null)return"";for(var i=cu(n["!ref"]),a=r.FS!==void 0?r.FS:",",o=a.charCodeAt(0),s=r.RS!==void 0?r.RS:` `,l=s.charCodeAt(0),u=new RegExp((a=="|"?"\\|":a)+"+$"),h="",c=[],f=r.skipHidden&&n["!cols"]||[],d=r.skipHidden&&n["!rows"]||[],v=i.s.c;v<=i.e.c;++v)(f[v]||{}).hidden||(c[v]=$o(v));for(var p=0,g=i.s.r;g<=i.e.r;++g)(d[g]||{}).hidden||(h=v4t(n,i,g,c,o,l,a,r),h!=null&&(r.strip&&(h=h.replace(u,"")),(h||r.blankrows!==!1)&&t.push((p++?s:"")+h)));return t.join("")}function p4t(n,e){e||(e={}),e.FS=" ",e.RS=` `;var t=OGe(n,e);return t}function g4t(n){var e="",t,r="";if(n==null||n["!ref"]==null)return[];var i=cu(n["!ref"]),a="",o=[],s,l=[],u=n["!data"]!=null;for(s=i.s.c;s<=i.e.c;++s)o[s]=$o(s);for(var h=i.s.r;h<=i.e.r;++h)for(a=ys(h),s=i.s.c;s<=i.e.c;++s)if(e=o[s]+a,t=u?(n["!data"][h]||[])[s]:n[e],r="",t!==void 0){if(t.F!=null){if(e=t.F,!t.f)continue;r=t.f,e.indexOf(":")==-1&&(e=e+":"+e)}if(t.f!=null)r=t.f;else{if(t.t=="z")continue;if(t.t=="n"&&t.v!=null)r=""+t.v;else if(t.t=="b")r=t.v?"TRUE":"FALSE";else if(t.w!==void 0)r="'"+t.w;else{if(t.v===void 0)continue;t.t=="s"?r="'"+t.v:r=""+t.v}}l[l.length]=e+"="+r}return l}function RGe(n,e,t){var r=t||{},i=n?n["!data"]!=null:r.dense,a=+!r.skipHeader,o=n||{};!n&&i&&(o["!data"]=[]);var s=0,l=0;if(o&&r.origin!=null)if(typeof r.origin=="number")s=r.origin;else{var u=typeof r.origin=="string"?zc(r.origin):r.origin;s=u.r,l=u.c}var h={s:{c:0,r:0},e:{c:l,r:s+e.length-1+a}};if(o["!ref"]){var c=cu(o["!ref"]);h.e.c=Math.max(h.e.c,c.e.c),h.e.r=Math.max(h.e.r,c.e.r),s==-1&&(s=c.e.r+1,h.e.r=s+e.length-1+a)}else s==-1&&(s=0,h.e.r=e.length-1+a);var f=r.header||[],d=0,v=[];e.forEach(function(g,m){i&&!o["!data"][s+m+a]&&(o["!data"][s+m+a]=[]),i&&(v=o["!data"][s+m+a]),h0(g).forEach(function(y){(d=f.indexOf(y))==-1&&(f[d=f.length]=y);var _=g[y],x="z",S="",w=i?"":$o(l+d)+ys(s+m+a),b=i?v[l+d]:o[w];_&&typeof _=="object"&&!(_ instanceof Date)?i?v[l+d]=_:o[w]=_:(typeof _=="number"?x="n":typeof _=="boolean"?x="b":typeof _=="string"?x="s":_ instanceof Date?(x="d",r.cellDates||(x="n",_=Zc(_)),S=b!=null&&b.z&&Q2(b.z)?b.z:r.dateNF||ji[14]):_===null&&r.nullError&&(x="e",_=0),b?(b.t=x,b.v=_,delete b.w,delete b.R,S&&(b.z=S)):i?v[l+d]=b={t:x,v:_}:o[w]=b={t:x,v:_},S&&(b.z=S))})}),h.e.c=Math.max(h.e.c,l+f.length-1);var p=ys(s);if(i&&!o["!data"][s]&&(o["!data"][s]=[]),a)for(d=0;d=0&&n.SheetNames.length>e)return e;throw new Error("Cannot find sheet # "+e)}else if(typeof e=="string"){var t=n.SheetNames.indexOf(e);if(t>-1)return t;throw new Error("Cannot find sheet name |"+e+"|")}else throw new Error("Cannot find sheet |"+e+"|")}function Loe(){return{SheetNames:[],Sheets:{}}}function LU(n,e,t,r){var i=1;if(!t)for(;i<=65535&&n.SheetNames.indexOf(t="Sheet"+i)!=-1;++i,t=void 0);if(!t||n.SheetNames.length>=65535)throw new Error("Too many worksheets");if(r&&n.SheetNames.indexOf(t)>=0){var a=t.match(/(^.*?)(\d+)$/);i=a&&+a[2]||0;var o=a&&a[1]||t;for(++i;i<=65535&&n.SheetNames.indexOf(t=o+i)!=-1;++i);}if(tFt(t),n.SheetNames.indexOf(t)>=0)throw new Error("Worksheet with name |"+t+"| already exists!");return n.SheetNames.push(t),n.Sheets[t]=e,t}function _4t(n,e,t){n.Workbook||(n.Workbook={}),n.Workbook.Sheets||(n.Workbook.Sheets=[]);var r=m4t(n,e);switch(n.Workbook.Sheets[r]||(n.Workbook.Sheets[r]={}),t){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+t)}n.Workbook.Sheets[r].Hidden=t}function x4t(n,e){return n.z=e,n}function DGe(n,e,t){return e?(n.l={Target:e},t&&(n.l.Tooltip=t)):delete n.l,n}function S4t(n,e,t){return DGe(n,"#"+e,t)}function w4t(n,e,t){n.c||(n.c=[]),n.c.push({t:e,a:t||"SheetJS"})}function b4t(n,e,t,r){for(var i=typeof e!="string"?e:cu(e),a=typeof e=="string"?e:lo(e),o=i.s.r;o<=i.e.r;++o)for(var s=i.s.c;s<=i.e.c;++s){var l=a9(n,o,s);l.t="n",l.F=a,delete l.v,o==i.s.r&&s==i.s.c&&(l.f=t,r&&(l.D=!0))}var u=eT(n["!ref"]);return u.s.r>i.s.r&&(u.s.r=i.s.r),u.s.c>i.s.c&&(u.s.c=i.s.c),u.e.r0){let l=s.SheetNames[0],u=E4t.sheet_to_csv(s.Sheets[l]);e&&e.call(r,u)}}catch(l){t&&t.call(r,l)}},i.onerror=function(a){t&&t.call(r,a)},this.rABF&&i.readAsArrayBuffer(n.file)},processDataToGeoJson(n,e,t,r,i){let a=null;if(n==="EXCEL"||n==="CSV")a=this.processExcelDataToGeoJson(e),t&&t.call(i,a);else if(n==="JSON"||n==="GEOJSON"){let o=e;typeof o=="string"&&(o=JSON.parse(o)),o.type==="ISERVER"?a=o.data.recordsets[0].features:o.type==="FeatureCollection"?a=o:r&&r.call(i,rv.i18n("msg_dataInWrongGeoJSONFormat")),t&&t.call(i,a)}else r&&r.call(i,rv.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson(n){let e=this.string2Csv(n),t=e.colTitles,r=-1,i=-1;for(let o=0,s=t.length;oi.json()).then(i=>{if(i.succeed===!1){r._fireFailedEvent(i);return}if(i.dataItemServices&&i.dataItemServices.length>0){let a=i.dataItemServices,o;a.forEach(s=>{if(s.serviceType==="RESTDATA"&&s.serviceStatus==="PUBLISHED")o=s;else if(s.serviceType==="RESTMAP"&&s.serviceStatus==="PUBLISHED")o=s;else{r.getDatafromContent(e,t);return}}),o&&r.getDatafromRest(o.serviceType,o.address,t)}else{r.getDatafromContent(e,t);return}}).catch(i=>{console.log(i),r._fireFailedEvent(i)})}getDatafromContent(e,t){let r={result:{}},i=this;e+="/content.json?pageSize=9999999¤tPage=1",li.get(e,null,{withCredentials:this.datasets.withCredentials}).then(a=>a.json()).then(a=>{if(a.succeed===!1){i._fireFailedEvent(a);return}if(a.type){if(a.type==="JSON"||a.type==="GEOJSON"){if(a.content=JSON.parse(a.content.trim()),!a.content.features){console.log(rv.i18n("msg_jsonResolveFiled"));return}let o=this._formatGeoJSON(a.content);r.result.features={type:a.content.type,features:o}}else if(a.type==="EXCEL"||a.type==="CSV"){let o=this._excelData2Feature(a.content);r.result.features={type:"FeatureCollection",features:o}}t(r,"content")}},this).catch(a=>{console.log(a),i._fireFailedEvent(a)})}getDatafromRest(e,t,r){let i=this,a=this.datasets.withCredentials;if(e==="RESTDATA"){let o=`${t}/data/datasources`,s,l;li.get(o,null,{withCredentials:a}).then(u=>u.json()).then(u=>{s=u.datasourceNames[0],o=`${t}/data/datasources/${s}/datasets`,li.get(o,null,{withCredentials:a}).then(h=>h.json()).then(h=>(l=h.datasetNames[0],i.getDatafromRestData(`${t}/data`,[s+":"+l],r),[s+":"+l])).catch(function(h){i._fireFailedEvent(h)})}).catch(function(u){i._fireFailedEvent(u)})}else{let o=`${t}/maps`,s,l,u;li.get(o,null,{withCredentials:a}).then(h=>h.json()).then(h=>{s=h[0].name,u=h[0].path,o=o=`${t}/maps/${s}/layers`,li.get(o,null,{withCredentials:a}).then(c=>c.json()).then(c=>(l=c[0].subLayers.layers[0].caption,i.getDatafromRestMap(l,u,r),l)).catch(function(c){i._fireFailedEvent(c)})}).catch(function(h){i._fireFailedEvent(h)})}}getDatafromRestData(e,t,r){let i=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(e,t,this.datasets.queryInfo,a=>{r(a,"RESTDATA")},a=>{console.log(a),i._fireFailedEvent(a)})}getDatafromRestMap(e,t,r){let i=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(t,e,this.datasets.queryInfo,null,null,a=>{r(a,"RESTMAP")},a=>{console.log(a),i._fireFailedEvent(a)})}_getFeatureBySQL(e,t,r,i,a){let o,s,l,u={name:t.join().replace(":","@")};Object.assign(u,r),o=new Of(u),l=new VR({queryParameter:o,datasetNames:t,fromIndex:0,toIndex:1e5,returnContent:!0}),s=new H8(e),s.processAsync(l,function(h){h.type==="processCompleted"?i&&i(h):a&&a(h)})}_queryFeatureBySQL(e,t,r,i,a,o,s,l,u,h){var c,f,d={name:t};Object.assign(d,r),c=new Of(d),i&&(c.fields=i);var v={queryParams:[c]};h&&(v.queryOption=dz.ATTRIBUTE),l&&(v.startRecord=l),u&&(v.expectCount=u),a&&(v.prjCoordSys={epsgCode:a}),f=new ZR(v),this._queryBySQL(e,f,p=>{p.type==="processCompleted"?o(p):s(p)})}_queryBySQL(e,t,r,i){var a=this,o=new j8(e,{format:a._processFormat(i)});o.processAsync(t,r)}_processFormat(e){return e||Ni.GEOJSON}_formatGeoJSON(e){let t=e.features;return t.forEach((r,i)=>{r.properties.index=i}),t}_excelData2Feature(e){let t=e.colTitles,r=-1,i=-1;for(let o=0,s=t.length;o0&&e.forEach(function(r){r.xAxis&&t.xField.push({field:r.xAxis.field,name:r.xAxis.name}),r.yAxis&&t.yField.push({field:r.yAxis.field,name:r.yAxis.name})})}getDatasetInfo(e){this.createChart=e,this.datasets&&this._checkUrl(this.datasets.url)&&(this.chartModel=new T4t(this.datasets),this.datasets.type==="iServer"?this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this)):this.datasets.type==="iPortal"&&this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this)),this.chartModel.events.on({getdatafailed:t=>{this.events.triggerEvent("getdatafailed",t)}}))}_getDatasetInfoSuccess(e){let t=this.datasets.url,r=t.indexOf("rest");if(r>0){let i=t.indexOf("/",r+5),a=t.substring(r+5,i),o=t.substring(0,r+4)+"/data";if(a==="maps"){let s=t.indexOf("/",i+1),l=t.substring(i+1,s);o=t.substring(0,r+4)+"/maps/"+l,e.result.dataUrl=o,this._getLayerFeatures(e)}else a==="data"&&(e.result.dataUrl=o,this._getDataFeatures(e))}}_getDataInfoSuccess(e,t){let r=this;t==="RESTMAP"?r._getChartDatasFromLayer(e):r._getChartDatas(e)}_getDataFeatures(e){this.chartModel.getDataFeatures(e,this._getChartDatas.bind(this))}_getLayerFeatures(e){this.chartModel.getLayerFeatures(e,this._getChartDatasFromLayer.bind(this))}_getChartDatas(e){if(e){this.features=e.result.features;let t=this.features.features,r={};if(t.length){let i=t[0],a=[],o=[];for(let s in i.properties)a.push(s),o.push(this._getDataType(i.properties[s]));r={features:t,fieldCaptions:a,fieldTypes:o,fieldValues:[]};for(let s in o){let l=[];for(let u in t){let h=t[u],c=r.fieldCaptions[s],f=h.properties[c];l.push(f)}r.fieldValues.push(l)}this.createChart(r)}}}_getChartDatasFromLayer(e){if(e.result.recordsets){let t=e.result.recordsets[0],r=t.features.features;this.features=t.features;let i={};if(r.length){i={features:t.features,fieldCaptions:t.fieldCaptions,fieldTypes:t.fieldTypes,fieldValues:[]};for(let a in i.fieldCaptions){let o=[];for(let s in r){let l=r[s],u=i.fieldCaptions[a],h=l.properties[u];o.push(h)}i.fieldValues.push(o)}this.createChart(i)}}}_createChartOptions(e){return this.calculatedData=this._createChartDatas(e),this.updateChartOptions(this.chartType)}changeType(e){if(e!==this.chartType)return this.chartType=e,this.updateChartOptions(this.chartType)}updateData(e,t,r){this.updateChart=r,this.xField=[],this.yField=[],this._initXYField(t),e.type=e.type||"iServer",e.withCredentials=e.withCredentials||!1,this.datasets=e,this.getDatasetInfo(this._updateDataSuccess.bind(this))}_updateDataSuccess(e){let t=this._createChartOptions(e);this.updateChart(t)}updateChartOptions(e,t){if(this.calculatedData){let r=this.grid,i=this._createChartSeries(this.calculatedData,e),a=[];for(let h in this.calculatedData.XData)a.push({value:this.calculatedData.XData[h].fieldsData});let o={type:"category",name:this.xField[0].name||"X",data:a,nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},s={type:"value",name:this.yFieldName||"Y",data:{},nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},l={formatter:"{b0}: {c0}"},u="#404a59";return t&&(t.grid&&(r=t.grid),t.tooltip&&(l=t.tooltip),t.backgroundColor&&(u=t.backgroundColor)),{backgroundColor:u,grid:r,series:i,xAxis:o,yAxis:s,tooltip:l}}}_createChartDatas(e){let t=0,r=[],i=e.fieldCaptions,a=this;i.forEach(function(l,u){a.xField[0]&&l===a.xField[0].field&&(t=u)}),this.yFieldName="",this.yField.forEach(function(l,u){u!==0&&(a.yFieldName=a.yFieldName+","),a.yFieldName=a.yFieldName+l.name,i.forEach(function(h,c){h===l.field&&r.push(c)})});let o=this._getAttrData(e,t),s=[];if(r.length>0)r.forEach(function(l){let u=[];for(let h in e.fieldValues[l])u.push({value:e.fieldValues[l][h]});s.push(u)});else{let l=[],u=[],h=o.length;for(let c=0;c{e.showView(t.message)}})}getStyle(){return this.viewModel.getStyle()}getFeatures(){return this.viewModel.getFeatures()}setStyle(e){let t=this.viewModel.setStyle(e);this._updateChart(t)}changeType(e){if(this.chartType!==e){this.chartType=e;let t=this.viewModel.changeType(e);this._updateChart(t)}}updateData(e,t){let r=this;this.viewModel.updateData(e,t,function(i){r._updateChart(i),r.addChart&&r.addChart()})}_createChart(e){this.echart=spt(document.getElementById(this.domID),null,{renderer:"canvas"});let t=this.viewModel._createChartOptions(e);this.echart.setOption(t),this.addChart&&this.addChart()}_updateChart(e){this.echart&&(this.echart.clear(),this.echart.setOption(e))}}class bw{constructor(e){e=e||{},this.id=e.id?e.id:null,this.rootContainer=null}getElement(){return this.id&&(this.rootContainer.id=this.id),this.rootContainer}_initView(){}showView(){this.rootContainer.hidden=!1}closeView(){this.rootContainer.hidden=!0}}class A4t extends bw{constructor(e){super(e);let t=e.title?e.title:"";this._initView(t)}_initView(e){const t=document.createElement("div");t.setAttribute("class","component-container");const r=document.createElement("div");r.setAttribute("class","component-title");const i=document.createElement("div");i.innerHTML=e,r.appendChild(i),t.appendChild(r);const a=document.createElement("div");return a.setAttribute("class","component-content"),t.appendChild(a),this.content=a,this.rootContainer=t,t}getContentElement(){return this.content}appendContent(e){this.content.appendChild(e)}}class M4t extends bw{constructor(e){super(e),this._initView(e)}_initView(e){let t=this._createElement("div","component-selecttool");if(e.labelName){let h=this._createElement("label","component-selecttool__lable--describe",t);h.innerHTML=e.labelName}let r=this._createElement("div","component-selecttool--chart",t);r.setAttribute("tabindex","1");let i=this._createElement("div","component-selecttool__name",r);i.title=e.optionsArr[0],i.innerHTML=e.optionsArr[0];let a=this._createElement("div","component-selecttool__trianglebtn--chart",r),o=this._createElement("div","component-triangle-down-img",a),s=this._createElement("div","component-selecttool__content",r),l=this._createElement("div","component-selecttool__content--chart",s),u=this._createElement("div","component-selecttool__scrollarea__content",l);u.setAttribute("tabindex","1"),this.createOptions(u,e.optionsArr),this.optionClickEvent(u,i,e.optionsClickCb),this._selectClickEvent(r,s,o),this.rootContainer=t}createOptions(e,t){for(let r in t){let i=this._createElement("div","component-selecttool__option",e);i.title=t[r],i.innerHTML=t[r]}}_selectClickEvent(e,t,r){e.onclick=function(i){t.style.display==="block"?(t.style.display="none",r.className="component-triangle-down-img"):(t.style.display="block",r.className="triangle-up-img"),i.preventDefault(),i.stopPropagation()},e.onmousedown=function(i){i.target!==this&&(this.focus(),i.preventDefault(),i.stopPropagation())},e.onblur=function(){t.style.display="none",r.className="component-triangle-down-img"}}_createElement(e,t,r){let i=document.createElement(e||"div");return t&&(i.className=t),r&&r.appendChild(i),i}optionClickEvent(e,t,r){for(let i=0;i0;e--)this.header.removeChild(this.header.children[e]),this.content.removeChild(this.content.children[e])}_changeTabsPage(e){const t=e.target.index;for(let r=0;r{for(let r=0;r0;r--)this.content.removeChild(this.content.children[r-1]);const t=this.config[e];for(let r in t)this._createCityItem(r,t[r])}_createCityItem(e,t){const r=document.createElement("div"),i=document.createElement("div");i.setAttribute("class","component-citytabpag__py-key"),i.innerHTML=e,r.appendChild(i);const a=document.createElement("div");a.setAttribute("class","component-citytabpag__content");for(let o=0;o0&&this.appendTabs(e),this.rootContainer=t}setTabs(e){this.removeAllTabs(),this.appendTabs(e)}appendTabs(e){for(let t=0;t0;e--)this.navTabsTitle.removeChild(this.navTabsTitle.children[e]),this.navTabsContent.removeChild(this.navTabsContent.children[e])}_changeTabsPage(e){const t=e.target.index;for(let r=0;r=0;e--)this.content.removeChild(this.content.children[e])}setPageLink(e){this.pageNumberLis=[],this.currentPageNumberLis=[],this.clearPageLink(),this._createPageLi(e),this._appendPageLink()}_createPageLi(e){for(let t=0;t1;e--)this.link.removeChild(this.link.children[e])}_createLink(e){for(let t=0;t<4;t++){const r=document.createElement("li");r.setAttribute("class","disable");const i=document.createElement("span");r.appendChild(i),t===0?(i.id="first",i.setAttribute("class","supermapol-icons-first")):t===1?(i.id="prev",i.setAttribute("class","supermapol-icons-prev")):t===2?(i.id="next",i.setAttribute("class","supermapol-icons-next")):t===3&&(i.id="last",i.setAttribute("class","supermapol-icons-last")),e.appendChild(r)}}_changePageEvent(e){const t=e.target;if(t.parentElement.classList[0]==="disable")return;let r;if(t.id)r=t.id;else if(Number(t.innerHTML))r=Number(t.innerHTML);else return;this._prePageNum(r),this.clearPageLink(),this._appendPageLink()}_changeDisableState(){this.link.children[0].setAttribute("class",""),this.link.children[1].setAttribute("class",""),this.link.children[this.link.children.length-1].setAttribute("class",""),this.link.children[this.link.children.length-2].setAttribute("class",""),this.currentPage===1&&(this.link.children[0].setAttribute("class","disable"),this.link.children[1].setAttribute("class","disable")),this.currentPage===this.pageNumberLis.length&&(this.link.children[this.link.children.length-1].setAttribute("class","disable"),this.link.children[this.link.children.length-2].setAttribute("class","disable"))}_prePageNum(e){const t=[];if(e==="first"?this.currentPage=1:e==="last"?this.currentPage=this.pageNumberLis.length:e==="prev"?this.currentPage=this.currentPage-1:e==="next"?this.currentPage=this.currentPage+1:this.currentPage=e,this.pageNumberLis.length<=5)for(let r=0;r=this.pageNumberLis.length-3)for(let r=this.pageNumberLis.length-5;r0&&(this.currentPageNumberLis=t)}}var MQ={exports:{}};(function(n,e){var t=200,r="Expected a function",i="__lodash_hash_undefined__",a=1,o=2,s=1/0,l=9007199254740991,u="[object Arguments]",h="[object Array]",c="[object Boolean]",f="[object Date]",d="[object Error]",v="[object Function]",p="[object GeneratorFunction]",g="[object Map]",m="[object Number]",y="[object Object]",_="[object Promise]",x="[object RegExp]",S="[object Set]",w="[object String]",b="[object Symbol]",E="[object WeakMap]",T="[object ArrayBuffer]",C="[object DataView]",A="[object Float32Array]",M="[object Float64Array]",I="[object Int8Array]",R="[object Int16Array]",k="[object Int32Array]",D="[object Uint8Array]",G="[object Uint8ClampedArray]",W="[object Uint16Array]",z="[object Uint32Array]",V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,Y=/^\./,le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,Q=/\\(\\)?/g,ie=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,se={};se[A]=se[M]=se[I]=se[R]=se[k]=se[D]=se[G]=se[W]=se[z]=!0,se[u]=se[h]=se[T]=se[c]=se[C]=se[f]=se[d]=se[v]=se[g]=se[m]=se[y]=se[x]=se[S]=se[w]=se[E]=!1;var me=typeof at=="object"&&at&&at.Object===Object&&at,Ce=typeof self=="object"&&self&&self.Object===Object&&self,Le=me||Ce||Function("return this")(),re=e&&!e.nodeType&&e,yt=re&&!0&&n&&!n.nodeType&&n,je=yt&&yt.exports===re,st=je&&me.process,Nt=function(){try{return st&&st.binding("util")}catch{}}(),Zt=Nt&&Nt.isTypedArray;function qe(ee,Se){var Ze=ee?ee.length:0;return!!Ze&&Oe(ee,Se,0)>-1}function ur(ee,Se,Ze){for(var Ct=-1,vr=ee?ee.length:0;++Ct-1}function $n(ee,Se){var Ze=this.__data__,Ct=qf(Ze,ee);return Ct<0?Ze.push([ee,Se]):Ze[Ct][1]=Se,this}qt.prototype.clear=fr,qt.prototype.delete=Wr,qt.prototype.get=gr,qt.prototype.has=Ar,qt.prototype.set=$n;function bi(ee){var Se=-1,Ze=ee?ee.length:0;for(this.clear();++Se=t){var si=Se?null:tc(ee);if(si)return kt(si);Jr=!1,vr=zt,Dn=new Zl}else Dn=Se?[]:nn;e:for(;++Ctnn))return!1;var si=Cr.get(ee);if(si&&Cr.get(Se))return si==Se;var An=-1,qi=!0,_o=vr&a?new Zl:void 0;for(Cr.set(ee,Se),Cr.set(Se,ee);++An-1&&ee%1==0&&ee-1&&ee%1==0&&ee<=l}function Je(ee){var Se=typeof ee;return!!ee&&(Se=="object"||Se=="function")}function Xe(ee){return!!ee&&typeof ee=="object"}function _t(ee){return typeof ee=="symbol"||Xe(ee)&&yn.call(ee)==b}var rt=Zt?Qe(Zt):sf;function Ht(ee){return ee==null?"":ho(ee)}function Yt(ee,Se,Ze){var Ct=ee==null?void 0:Zf(ee,Se);return Ct===void 0?Ze:Ct}function ne(ee,Se){return ee!=null&&mg(ee,Se,Kf)}function ye(ee){return Z(ee)?vg(ee):bs(ee)}function Ue(ee){return ee}function Bt(){}function $t(ee){return _h(ee)?We(gt(ee)):Wm(ee)}n.exports=O})(MQ,MQ.exports);const D4t=MQ.exports;function rxe(n,e){const t=e&&e.styles&&e.styles.style,r=e&&e.captionFields&&e.captionFields.captionField,i={nodes:[],edges:[]};return n.forEach(a=>{const o=a.path;if(o){const{nodes:s,edges:l}=N4t(o,t,r);i.nodes.push(...s),i.edges.push(...l)}else if(BGe(a)){const s=zGe(a,t);i.edges.push(s)}else{const s=GGe(a,t,r);i.nodes.push(s)}}),{nodes:nxe(i.nodes),edges:nxe(i.edges,"edgeId")}}function nxe(n,e="id"){return D4t(n,e)}function BGe(n){return n.hasOwnProperty("start")&&n.hasOwnProperty("end")}function N4t(n,e,t){const r={nodes:[],edges:[]};return n.forEach(i=>{if(BGe(i)){const a=zGe(i,e);r.edges.push(a)}else{const a=GGe(i,e,t);r.nodes.push(a)}}),r}function GGe(n,e,t){const{id:r,properties:i,lables:a}=n,o=e?F4t(n,e):{},s=B4t(n,t),l=o.fillColor||"",u={id:r+"",label:s,properties:i,lables:a};return o.size&&(u.size=o.size,delete o.size),o.fillColor&&(u.style={fill:l,stroke:l},delete o.fillColor),Object.keys(o).length!==0&&(u.labelCfg={style:o}),u}function zGe(n,e){const{start:t,end:r,id:i,type:a,properties:o}=n,s=e?k4t(n,e):{},l={source:t+"",target:r+"",edgeId:i+"",label:a,style:{},labelCfg:{},properties:o};return s.stroke&&(l.style.stroke=s.stroke,l.style.endArrow={path:"M 0,0 L 4,2 L 4,-2 Z",fill:s.stroke},delete s.stroke),s.lineWidth&&(l.style.lineWidth=s.lineWidth,delete s.lineWidth),l.labelCfg={style:s},l}function k4t(n,e){if(!e)return{};const{id:t,type:r}=n,i=e.filter(a=>a.type==="relationShip");for(let a=0;aa.type==="entity");for(let a=0;a=0;s--)(o=n[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function $Ge(n,e){return function(t,r){e(t,r,n)}}function WGe(n,e,t,r,i,a){function o(m){if(m!==void 0&&typeof m!="function")throw new TypeError("Function expected");return m}for(var s=r.kind,l=s==="getter"?"get":s==="setter"?"set":"value",u=!e&&n?r.static?n:n.prototype:null,h=e||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),c,f=!1,d=t.length-1;d>=0;d--){var v={};for(var p in r)v[p]=p==="access"?{}:r[p];for(var p in r.access)v.access[p]=r.access[p];v.addInitializer=function(m){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(m||null))};var g=(0,t[d])(s==="accessor"?{get:h.get,set:h.set}:h[l],v);if(s==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(c=o(g.get))&&(h.get=c),(c=o(g.set))&&(h.set=c),(c=o(g.init))&&i.unshift(c)}else(c=o(g))&&(s==="field"?i.unshift(c):h[l]=c)}u&&Object.defineProperty(u,r.name,h),f=!0}function HGe(n,e,t){for(var r=arguments.length>2,i=0;i0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ooe(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return a}function ZGe(){for(var n=[],e=0;e1||l(d,p)})},v&&(i[d]=v(i[d])))}function l(d,v){try{u(r[d](v))}catch(p){f(a[0][3],p)}}function u(d){d.value instanceof bM?Promise.resolve(d.value.v).then(h,c):f(a[0][2],d)}function h(d){l("next",d)}function c(d){l("throw",d)}function f(d,v){d(v),a.shift(),a.length&&l(a[0][0],a[0][1])}}function JGe(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,a){e[i]=n[i]?function(o){return(t=!t)?{value:bM(n[i](o)),done:!1}:a?a(o):o}:a}}function QGe(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof o9=="function"?o9(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(a){t[a]=n[a]&&function(o){return new Promise(function(s,l){o=n[a](o),i(s,l,o.done,o.value)})}}function i(a,o,s,l){Promise.resolve(l).then(function(u){a({value:u,done:s})},o)}}function e9e(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}var z4t=Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e},LQ=function(n){return LQ=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},LQ(n)};function t9e(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t=LQ(n),r=0;r-1:!1},RU=function(n,e){if(!Ed(n))return n;for(var t=[],r=0;r-1;)Z4t.call(n,a,1);return n},Q4t=Array.prototype.splice,v9e=function(e,t){if(!Ed(e))return[];for(var r=e?t.length:0,i=r-1;r--;){var a=void 0,o=t[r];(r===i||o!==a)&&(a=o,Q4t.call(e,o,1))}return e},p9e=function(n,e,t){if(!vn(n)&&!kh(n))return n;var r=t;return At(n,function(i,a){r=e(r,i,a)}),r},e5t=function(n,e){var t=[];if(!Ed(n))return t;for(var r=-1,i=[],a=n.length;++ra[s])return 1;if(i[s]t?t:n},BB=function(n,e){var t=e.toString(),r=t.indexOf(".");if(r===-1)return Math.round(n);var i=t.substr(r+1).length;return i>20&&(i=20),parseFloat(n.toFixed(i))},on=function(n){return k0(n,"Number")},v5t=function(n){return on(n)&&n%1!==0},p5t=function(n){return on(n)&&n%2===0},g5t=Number.isInteger?Number.isInteger:function(n){return on(n)&&n%1===0},y5t=function(n){return on(n)&&n<0},m5t=1e-5;function y9e(n,e,t){return t===void 0&&(t=m5t),Math.abs(n-e)0};const S5t=function(n,e){if(!!vn(n)){for(var t,r=-1/0,i=0;ir&&(t=a,r=o)}return t}},w5t=function(n,e){if(!!vn(n)){for(var t,r=1/0,i=0;ie?(r&&(clearTimeout(r),r=null),s=h,o=n.apply(i,a),r||(i=a=null)):!r&&t.trailing!==!1&&(r=setTimeout(l,c)),o};return u.cancel=function(){clearTimeout(r),s=0,r=i=a=null},u},T9e=function(n){return Ed(n)?Array.prototype.slice.call(n):[]};var r5={};const vm=function(n){return n=n||"g",r5[n]?r5[n]+=1:r5[n]=1,n+r5[n]},vO=function(){},J5t=function(n){return n};function kU(n){return an(n)?0:Ed(n)?n.length:Object.keys(n).length}var n5;const pO=w9e(function(n,e){e===void 0&&(e={});var t=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return n5||(n5=document.createElement("canvas").getContext("2d")),n5.font=[a,o,i,t+"px",r].join(" "),n5.measureText(rr(n)?n:"").width},function(n,e){return e===void 0&&(e={}),OU([n],Roe(e)).join("")}),Q5t=function(n,e,t,r){r===void 0&&(r="...");var i=16,a=pO(r,t),o=rr(n)?n:jI(n),s=e,l=[],u,h;if(pO(n,t)<=e)return n;for(;u=o.substr(0,i),h=pO(u,t),!(h+a>s&&h>s);)if(l.push(u),s-=h,o=o.substr(i),!o)return l.join("");for(;u=o.substr(0,1),h=pO(u,t),!(h+a>s);)if(l.push(u),s-=h,o=o.substr(1),!o)return l.join("");return""+l.join("")+r};var e6t=function(){function n(){this.map={}}return n.prototype.has=function(e){return this.map[e]!==void 0},n.prototype.get=function(e,t){var r=this.map[e];return r===void 0?t:r},n.prototype.set=function(e,t){this.map[e]=t},n.prototype.clear=function(){this.map={}},n.prototype.delete=function(e){delete this.map[e]},n.prototype.size=function(){return Object.keys(this.map).length},n}();const t6t=Object.freeze(Object.defineProperty({__proto__:null,contains:s9,includes:s9,difference:W4t,find:j4t,findIndex:X4t,firstValue:Y4t,flatten:q4t,flattenDeep:c9e,getRange:f9e,pull:J4t,pullAt:v9e,reduce:p9e,remove:e5t,sortBy:t5t,union:r5t,uniq:kD,valuesOfKey:n5t,head:Ky,last:Fp,startsWith:i5t,endsWith:a5t,filter:RU,every:o5t,some:s5t,group:u5t,groupBy:u9,groupToMap:g9e,getWrapBehavior:h5t,wrapBehavior:hE,number2color:c5t,parseRadius:f5t,clamp:d5t,fixedBase:BB,isDecimal:v5t,isEven:p5t,isInteger:g5t,isNegative:y5t,isNumberEqual:y9e,isOdd:_5t,isPositive:x5t,max:fm,maxBy:S5t,min:dm,minBy:w5t,mod:DU,toDegree:E5t,toInteger:T5t,toRadian:NU,forIn:At,has:axe,hasKey:axe,hasValue:A5t,keys:u9e,isMatch:h9e,values:Roe,lowerCase:M5t,lowerFirst:I5t,substitute:L5t,upperCase:P5t,upperFirst:EM,getType:m9e,isArguments:R5t,isArray:vn,isArrayLike:Ed,isBoolean:z3,isDate:Doe,isError:D5t,isFunction:nl,isFinite:N5t,isNil:an,isNull:k5t,isNumber:on,isObject:Wh,isObjectLike:l9,isPlainObject:kh,isPrototype:_9e,isRegExp:B5t,isString:rr,isType:k0,isUndefined:G5t,isElement:z5t,requestAnimationFrame:x9e,clearAnimationFrame:S9e,augment:U5t,clone:Xi,debounce:U3,memoize:w9e,deepMix:ms,each:At,extend:$5t,indexOf:Noe,isEmpty:E9e,isEqual:HS,isEqualWith:H5t,map:n2,mapValues:X5t,mix:_n,assign:_n,get:y1,set:Y5t,pick:Z5t,omit:K5t,throttle:FD,toArray:T9e,toString:jI,uniqueId:vm,noop:vO,identity:J5t,size:kU,measureTextWidth:pO,getEllipsisText:Q5t,Cache:e6t},Symbol.toStringTag,{value:"Module"})),r6t={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(e){return Object.assign(this,e),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(e){var t=this,r=this.events;this.graph=e,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!0),At(r,function(i,a){e.on(a,i)}),document.addEventListener("visibilitychange",function(){t.keydown=!1})},unbind:function(e){var t=this.events,r=e.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!1),At(t,function(i,a){e.off(a,i)}),e.get("canvas").set("draggable",r)},get:function(e){return this[e]},set:function(e,t){return this[e]=t,this}};var koe=function(){function n(){}return n.registerBehavior=function(e,t){if(!t)throw new Error("please specify handler for this behavior: ".concat(e));var r=Xi(r6t);Object.assign(r,t);var i=function(o){var s=this;Object.assign(this,this.getDefaultCfg(),o);var l=this.getEvents();this.events=null;var u={};l&&(At(l,function(h,c){u[c]=hE(s,h)}),this.events=u)};i.prototype=r,n.types[e]=i},n.hasBehavior=function(e){return!!n.types[e]},n.getBehavior=function(e){return n.types[e]},n.types={},n}(),n6t="*",C9e=function(){function n(){this._events={}}return n.prototype.on=function(e,t,r){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!r}),this},n.prototype.once=function(e,t){return this.on(e,t,!0)},n.prototype.emit=function(e){for(var t=this,r=[],i=1;i0?(t[0]=(s*o+h*r+l*a-u*i)*2/c,t[1]=(l*o+h*i+u*r-s*a)*2/c,t[2]=(u*o+h*a+s*i-l*r)*2/c):(t[0]=(s*o+h*r+l*a-u*i)*2,t[1]=(l*o+h*i+u*r-s*a)*2,t[2]=(u*o+h*a+s*i-l*r)*2),k9e(n,e,t),n}function F9e(n,e){return n[0]=e[12],n[1]=e[13],n[2]=e[14],n}function B9e(n,e){var t=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],u=e[9],h=e[10];return n[0]=Math.hypot(t,r,i),n[1]=Math.hypot(a,o,s),n[2]=Math.hypot(l,u,h),n}function G9e(n,e){var t=new ca(3);B9e(t,e);var r=1/t[0],i=1/t[1],a=1/t[2],o=e[0]*r,s=e[1]*i,l=e[2]*a,u=e[4]*r,h=e[5]*i,c=e[6]*a,f=e[8]*r,d=e[9]*i,v=e[10]*a,p=o+h+v,g=0;return p>0?(g=Math.sqrt(p+1)*2,n[3]=.25*g,n[0]=(c-d)/g,n[1]=(f-l)/g,n[2]=(s-u)/g):o>h&&o>v?(g=Math.sqrt(1+o-h-v)*2,n[3]=(c-d)/g,n[0]=.25*g,n[1]=(s+u)/g,n[2]=(f+l)/g):h>v?(g=Math.sqrt(1+h-o-v)*2,n[3]=(f-l)/g,n[0]=(s+u)/g,n[1]=.25*g,n[2]=(c+d)/g):(g=Math.sqrt(1+v-o-h)*2,n[3]=(s-u)/g,n[0]=(f+l)/g,n[1]=(c+d)/g,n[2]=.25*g),n}function KBt(n,e,t,r){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,u=a+a,h=o+o,c=i*l,f=i*u,d=i*h,v=a*u,p=a*h,g=o*h,m=s*l,y=s*u,_=s*h,x=r[0],S=r[1],w=r[2];return n[0]=(1-(v+g))*x,n[1]=(f+_)*x,n[2]=(d-y)*x,n[3]=0,n[4]=(f-_)*S,n[5]=(1-(c+g))*S,n[6]=(p+m)*S,n[7]=0,n[8]=(d+y)*w,n[9]=(p-m)*w,n[10]=(1-(c+v))*w,n[11]=0,n[12]=t[0],n[13]=t[1],n[14]=t[2],n[15]=1,n}function JBt(n,e,t,r,i){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,h=o+o,c=s+s,f=a*u,d=a*h,v=a*c,p=o*h,g=o*c,m=s*c,y=l*u,_=l*h,x=l*c,S=r[0],w=r[1],b=r[2],E=i[0],T=i[1],C=i[2],A=(1-(p+m))*S,M=(d+x)*S,I=(v-_)*S,R=(d-x)*w,k=(1-(f+m))*w,D=(g+y)*w,G=(v+_)*b,W=(g-y)*b,z=(1-(f+p))*b;return n[0]=A,n[1]=M,n[2]=I,n[3]=0,n[4]=R,n[5]=k,n[6]=D,n[7]=0,n[8]=G,n[9]=W,n[10]=z,n[11]=0,n[12]=t[0]+E-(A*E+R*T+G*C),n[13]=t[1]+T-(M*E+k*T+W*C),n[14]=t[2]+C-(I*E+D*T+z*C),n[15]=1,n}function QBt(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=t+t,s=r+r,l=i+i,u=t*o,h=r*o,c=r*s,f=i*o,d=i*s,v=i*l,p=a*o,g=a*s,m=a*l;return n[0]=1-c-v,n[1]=h+m,n[2]=f-g,n[3]=0,n[4]=h-m,n[5]=1-u-v,n[6]=d+p,n[7]=0,n[8]=f+g,n[9]=d-p,n[10]=1-u-c,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function e8t(n,e,t,r,i,a,o){var s=1/(t-e),l=1/(i-r),u=1/(a-o);return n[0]=a*2*s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a*2*l,n[6]=0,n[7]=0,n[8]=(t+e)*s,n[9]=(i+r)*l,n[10]=(o+a)*u,n[11]=-1,n[12]=0,n[13]=0,n[14]=o*a*2*u,n[15]=0,n}function z9e(n,e,t,r,i){var a=1/Math.tan(e/2),o;return n[0]=a/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,i!=null&&i!==1/0?(o=1/(r-i),n[10]=(i+r)*o,n[14]=2*i*r*o):(n[10]=-1,n[14]=-2*r),n}var t8t=z9e;function r8t(n,e,t,r,i){var a=1/Math.tan(e/2),o;return n[0]=a/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,i!=null&&i!==1/0?(o=1/(r-i),n[10]=i*o,n[14]=i*r*o):(n[10]=-1,n[14]=-r),n}function n8t(n,e,t,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return n[0]=l,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=u,n[6]=0,n[7]=0,n[8]=-((o-s)*l*.5),n[9]=(i-a)*u*.5,n[10]=r/(t-r),n[11]=-1,n[12]=0,n[13]=0,n[14]=r*t/(t-r),n[15]=0,n}function U9e(n,e,t,r,i,a,o){var s=1/(e-t),l=1/(r-i),u=1/(a-o);return n[0]=-2*s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*l,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*u,n[11]=0,n[12]=(e+t)*s,n[13]=(i+r)*l,n[14]=(o+a)*u,n[15]=1,n}var i8t=U9e;function a8t(n,e,t,r,i,a,o){var s=1/(e-t),l=1/(r-i),u=1/(a-o);return n[0]=-2*s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*l,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=u,n[11]=0,n[12]=(e+t)*s,n[13]=(i+r)*l,n[14]=a*u,n[15]=1,n}function o8t(n,e,t,r){var i,a,o,s,l,u,h,c,f,d,v=e[0],p=e[1],g=e[2],m=r[0],y=r[1],_=r[2],x=t[0],S=t[1],w=t[2];return Math.abs(v-x)0&&(d=1/Math.sqrt(d),h*=d,c*=d,f*=d);var v=l*f-u*c,p=u*h-s*f,g=s*c-l*h;return d=v*v+p*p+g*g,d>0&&(d=1/Math.sqrt(d),v*=d,p*=d,g*=d),n[0]=v,n[1]=p,n[2]=g,n[3]=0,n[4]=c*g-f*p,n[5]=f*v-h*g,n[6]=h*p-c*v,n[7]=0,n[8]=h,n[9]=c,n[10]=f,n[11]=0,n[12]=i,n[13]=a,n[14]=o,n[15]=1,n}function l8t(n){return"mat4("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9]+", "+n[10]+", "+n[11]+", "+n[12]+", "+n[13]+", "+n[14]+", "+n[15]+")"}function u8t(n){return Math.hypot(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}function h8t(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n}function V9e(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n}function c8t(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n}function f8t(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n[3]=e[3]+t[3]*r,n[4]=e[4]+t[4]*r,n[5]=e[5]+t[5]*r,n[6]=e[6]+t[6]*r,n[7]=e[7]+t[7]*r,n[8]=e[8]+t[8]*r,n[9]=e[9]+t[9]*r,n[10]=e[10]+t[10]*r,n[11]=e[11]+t[11]*r,n[12]=e[12]+t[12]*r,n[13]=e[13]+t[13]*r,n[14]=e[14]+t[14]*r,n[15]=e[15]+t[15]*r,n}function d8t(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]&&n[4]===e[4]&&n[5]===e[5]&&n[6]===e[6]&&n[7]===e[7]&&n[8]===e[8]&&n[9]===e[9]&&n[10]===e[10]&&n[11]===e[11]&&n[12]===e[12]&&n[13]===e[13]&&n[14]===e[14]&&n[15]===e[15]}function v8t(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],l=n[6],u=n[7],h=n[8],c=n[9],f=n[10],d=n[11],v=n[12],p=n[13],g=n[14],m=n[15],y=e[0],_=e[1],x=e[2],S=e[3],w=e[4],b=e[5],E=e[6],T=e[7],C=e[8],A=e[9],M=e[10],I=e[11],R=e[12],k=e[13],D=e[14],G=e[15];return Math.abs(t-y)<=In*Math.max(1,Math.abs(t),Math.abs(y))&&Math.abs(r-_)<=In*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-x)<=In*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-S)<=In*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(o-w)<=In*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-b)<=In*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(l-E)<=In*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(u-T)<=In*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(h-C)<=In*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(c-A)<=In*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(f-M)<=In*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(d-I)<=In*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(v-R)<=In*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(p-k)<=In*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(g-D)<=In*Math.max(1,Math.abs(g),Math.abs(D))&&Math.abs(m-G)<=In*Math.max(1,Math.abs(m),Math.abs(G))}var p8t=N9e,g8t=V9e;const y8t=Object.freeze(Object.defineProperty({__proto__:null,create:IBt,clone:LBt,copy:PBt,fromValues:OBt,set:RBt,identity:D9e,transpose:DBt,invert:NBt,adjoint:kBt,determinant:FBt,multiply:N9e,translate:BBt,scale:GBt,rotate:zBt,rotateX:UBt,rotateY:VBt,rotateZ:$Bt,fromTranslation:WBt,fromScaling:HBt,fromRotation:jBt,fromXRotation:XBt,fromYRotation:YBt,fromZRotation:qBt,fromRotationTranslation:k9e,fromQuat2:ZBt,getTranslation:F9e,getScaling:B9e,getRotation:G9e,fromRotationTranslationScale:KBt,fromRotationTranslationScaleOrigin:JBt,fromQuat:QBt,frustum:e8t,perspectiveNO:z9e,perspective:t8t,perspectiveZO:r8t,perspectiveFromFieldOfView:n8t,orthoNO:U9e,ortho:i8t,orthoZO:a8t,lookAt:o8t,targetTo:s8t,str:l8t,frob:u8t,add:h8t,subtract:V9e,multiplyScalar:c8t,multiplyScalarAndAdd:f8t,exactEquals:d8t,equals:v8t,mul:p8t,sub:g8t},Symbol.toStringTag,{value:"Module"}));function Uoe(){var n=new ca(3);return ca!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n}function m8t(n){var e=new ca(3);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e}function $9e(n){var e=n[0],t=n[1],r=n[2];return Math.hypot(e,t,r)}function PQ(n,e,t){var r=new ca(3);return r[0]=n,r[1]=e,r[2]=t,r}function _8t(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n}function x8t(n,e,t,r){return n[0]=e,n[1]=t,n[2]=r,n}function S8t(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n}function W9e(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n}function H9e(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}function j9e(n,e,t){return n[0]=e[0]/t[0],n[1]=e[1]/t[1],n[2]=e[2]/t[2],n}function w8t(n,e){return n[0]=Math.ceil(e[0]),n[1]=Math.ceil(e[1]),n[2]=Math.ceil(e[2]),n}function b8t(n,e){return n[0]=Math.floor(e[0]),n[1]=Math.floor(e[1]),n[2]=Math.floor(e[2]),n}function E8t(n,e,t){return n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.min(e[2],t[2]),n}function T8t(n,e,t){return n[0]=Math.max(e[0],t[0]),n[1]=Math.max(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n}function C8t(n,e){return n[0]=Math.round(e[0]),n[1]=Math.round(e[1]),n[2]=Math.round(e[2]),n}function A8t(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n}function M8t(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n}function X9e(n,e){var t=e[0]-n[0],r=e[1]-n[1],i=e[2]-n[2];return Math.hypot(t,r,i)}function Y9e(n,e){var t=e[0]-n[0],r=e[1]-n[1],i=e[2]-n[2];return t*t+r*r+i*i}function q9e(n){var e=n[0],t=n[1],r=n[2];return e*e+t*t+r*r}function I8t(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}function L8t(n,e){return n[0]=1/e[0],n[1]=1/e[1],n[2]=1/e[2],n}function Z9e(n,e){var t=e[0],r=e[1],i=e[2],a=t*t+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),n[0]=e[0]*a,n[1]=e[1]*a,n[2]=e[2]*a,n}function Voe(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function GB(n,e,t){var r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return n[0]=i*l-a*s,n[1]=a*o-r*l,n[2]=r*s-i*o,n}function P8t(n,e,t,r){var i=e[0],a=e[1],o=e[2];return n[0]=i+r*(t[0]-i),n[1]=a+r*(t[1]-a),n[2]=o+r*(t[2]-o),n}function O8t(n,e,t,r,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,u=o*(a-1),h=o*(3-2*a);return n[0]=e[0]*s+t[0]*l+r[0]*u+i[0]*h,n[1]=e[1]*s+t[1]*l+r[1]*u+i[1]*h,n[2]=e[2]*s+t[2]*l+r[2]*u+i[2]*h,n}function R8t(n,e,t,r,i,a){var o=1-a,s=o*o,l=a*a,u=s*o,h=3*a*s,c=3*l*o,f=l*a;return n[0]=e[0]*u+t[0]*h+r[0]*c+i[0]*f,n[1]=e[1]*u+t[1]*h+r[1]*c+i[1]*f,n[2]=e[2]*u+t[2]*h+r[2]*c+i[2]*f,n}function D8t(n,e){e=e||1;var t=i0()*2*Math.PI,r=i0()*2-1,i=Math.sqrt(1-r*r)*e;return n[0]=Math.cos(t)*i,n[1]=Math.sin(t)*i,n[2]=r*e,n}function N8t(n,e,t){var r=e[0],i=e[1],a=e[2],o=t[3]*r+t[7]*i+t[11]*a+t[15];return o=o||1,n[0]=(t[0]*r+t[4]*i+t[8]*a+t[12])/o,n[1]=(t[1]*r+t[5]*i+t[9]*a+t[13])/o,n[2]=(t[2]*r+t[6]*i+t[10]*a+t[14])/o,n}function FU(n,e,t){var r=e[0],i=e[1],a=e[2];return n[0]=r*t[0]+i*t[3]+a*t[6],n[1]=r*t[1]+i*t[4]+a*t[7],n[2]=r*t[2]+i*t[5]+a*t[8],n}function k8t(n,e,t){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],h=i*u-a*l,c=a*s-r*u,f=r*l-i*s,d=i*f-a*c,v=a*h-r*f,p=r*c-i*h,g=o*2;return h*=g,c*=g,f*=g,d*=2,v*=2,p*=2,n[0]=s+h+d,n[1]=l+c+v,n[2]=u+f+p,n}function F8t(n,e,t,r){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),n[0]=a[0]+t[0],n[1]=a[1]+t[1],n[2]=a[2]+t[2],n}function B8t(n,e,t,r){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),n[0]=a[0]+t[0],n[1]=a[1]+t[1],n[2]=a[2]+t[2],n}function G8t(n,e,t,r){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],n[0]=a[0]+t[0],n[1]=a[1]+t[1],n[2]=a[2]+t[2],n}function z8t(n,e){var t=n[0],r=n[1],i=n[2],a=e[0],o=e[1],s=e[2],l=Math.sqrt(t*t+r*r+i*i),u=Math.sqrt(a*a+o*o+s*s),h=l*u,c=h&&Voe(n,e)/h;return Math.acos(Math.min(Math.max(c,-1),1))}function U8t(n){return n[0]=0,n[1]=0,n[2]=0,n}function V8t(n){return"vec3("+n[0]+", "+n[1]+", "+n[2]+")"}function $8t(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]}function W8t(n,e){var t=n[0],r=n[1],i=n[2],a=e[0],o=e[1],s=e[2];return Math.abs(t-a)<=In*Math.max(1,Math.abs(t),Math.abs(a))&&Math.abs(r-o)<=In*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=In*Math.max(1,Math.abs(i),Math.abs(s))}var H8t=W9e,j8t=H9e,X8t=j9e,Y8t=X9e,q8t=Y9e,K9e=$9e,Z8t=q9e,K8t=function(){var n=Uoe();return function(e,t,r,i,a,o){var s,l;for(t||(t=3),r||(r=0),i?l=Math.min(i*t+r,e.length):l=e.length,s=r;s0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=r*o,n[2]=i*o,n[3]=a*o,n}function c7e(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}function sGt(n,e,t,r){var i=t[0]*r[1]-t[1]*r[0],a=t[0]*r[2]-t[2]*r[0],o=t[0]*r[3]-t[3]*r[0],s=t[1]*r[2]-t[2]*r[1],l=t[1]*r[3]-t[3]*r[1],u=t[2]*r[3]-t[3]*r[2],h=e[0],c=e[1],f=e[2],d=e[3];return n[0]=c*u-f*l+d*s,n[1]=-(h*u)+f*o-d*a,n[2]=h*l-c*o+d*i,n[3]=-(h*s)+c*a-f*i,n}function f7e(n,e,t,r){var i=e[0],a=e[1],o=e[2],s=e[3];return n[0]=i+r*(t[0]-i),n[1]=a+r*(t[1]-a),n[2]=o+r*(t[2]-o),n[3]=s+r*(t[3]-s),n}function lGt(n,e){e=e||1;var t,r,i,a,o,s;do t=i0()*2-1,r=i0()*2-1,o=t*t+r*r;while(o>=1);do i=i0()*2-1,a=i0()*2-1,s=i*i+a*a;while(s>=1);var l=Math.sqrt((1-o)/s);return n[0]=e*t,n[1]=e*r,n[2]=e*i*l,n[3]=e*a*l,n}function uGt(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3];return n[0]=t[0]*r+t[4]*i+t[8]*a+t[12]*o,n[1]=t[1]*r+t[5]*i+t[9]*a+t[13]*o,n[2]=t[2]*r+t[6]*i+t[10]*a+t[14]*o,n[3]=t[3]*r+t[7]*i+t[11]*a+t[15]*o,n}function hGt(n,e,t){var r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2],u=t[3],h=u*r+s*a-l*i,c=u*i+l*r-o*a,f=u*a+o*i-s*r,d=-o*r-s*i-l*a;return n[0]=h*u+d*-o+c*-l-f*-s,n[1]=c*u+d*-s+f*-o-h*-l,n[2]=f*u+d*-l+h*-s-c*-o,n[3]=e[3],n}function cGt(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n}function fGt(n){return"vec4("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+")"}function d7e(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]}function v7e(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=e[0],s=e[1],l=e[2],u=e[3];return Math.abs(t-o)<=In*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(r-s)<=In*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=In*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=In*Math.max(1,Math.abs(a),Math.abs(u))}var dGt=i7e,vGt=a7e,pGt=o7e,gGt=l7e,yGt=u7e,mGt=$oe,_Gt=Woe,xGt=function(){var n=J9e();return function(e,t,r,i,a,o){var s,l;for(t||(t=4),r||(r=0),i?l=Math.min(i*t+r,e.length):l=e.length,s=r;sIn?(n[0]=e[0]/r,n[1]=e[1]/r,n[2]=e[2]/r):(n[0]=1,n[1]=0,n[2]=0),t}function EGt(n,e){var t=joe(n,e);return Math.acos(2*t*t-1)}function g7e(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=t[0],l=t[1],u=t[2],h=t[3];return n[0]=r*h+o*s+i*u-a*l,n[1]=i*h+o*l+a*s-r*u,n[2]=a*h+o*u+r*l-i*s,n[3]=o*h-r*s-i*l-a*u,n}function y7e(n,e,t){t*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return n[0]=r*l+o*s,n[1]=i*l+a*s,n[2]=a*l-i*s,n[3]=o*l-r*s,n}function m7e(n,e,t){t*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return n[0]=r*l-a*s,n[1]=i*l+o*s,n[2]=a*l+r*s,n[3]=o*l-i*s,n}function _7e(n,e,t){t*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return n[0]=r*l+i*s,n[1]=i*l-r*s,n[2]=a*l+o*s,n[3]=o*l-a*s,n}function TGt(n,e){var t=e[0],r=e[1],i=e[2];return n[0]=t,n[1]=r,n[2]=i,n[3]=Math.sqrt(Math.abs(1-t*t-r*r-i*i)),n}function x7e(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+r*r+i*i),s=Math.exp(a),l=o>0?s*Math.sin(o)/o:0;return n[0]=t*l,n[1]=r*l,n[2]=i*l,n[3]=s*Math.cos(o),n}function S7e(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+r*r+i*i),s=o>0?Math.atan2(o,a)/o:0;return n[0]=t*s,n[1]=r*s,n[2]=i*s,n[3]=.5*Math.log(t*t+r*r+i*i+a*a),n}function CGt(n,e,t){return S7e(n,e),b7e(n,n,t),x7e(n,n),n}function zB(n,e,t,r){var i=e[0],a=e[1],o=e[2],s=e[3],l=t[0],u=t[1],h=t[2],c=t[3],f,d,v,p,g;return d=i*l+a*u+o*h+s*c,d<0&&(d=-d,l=-l,u=-u,h=-h,c=-c),1-d>In?(f=Math.acos(d),v=Math.sin(f),p=Math.sin((1-r)*f)/v,g=Math.sin(r*f)/v):(p=1-r,g=r),n[0]=p*i+g*l,n[1]=p*a+g*u,n[2]=p*o+g*h,n[3]=p*s+g*c,n}function AGt(n){var e=i0(),t=i0(),r=i0(),i=Math.sqrt(1-e),a=Math.sqrt(e);return n[0]=i*Math.sin(2*Math.PI*t),n[1]=i*Math.cos(2*Math.PI*t),n[2]=a*Math.sin(2*Math.PI*r),n[3]=a*Math.cos(2*Math.PI*r),n}function MGt(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=t*t+r*r+i*i+a*a,s=o?1/o:0;return n[0]=-t*s,n[1]=-r*s,n[2]=-i*s,n[3]=a*s,n}function IGt(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n}function w7e(n,e){var t=e[0]+e[4]+e[8],r;if(t>0)r=Math.sqrt(t+1),n[3]=.5*r,r=.5/r,n[0]=(e[5]-e[7])*r,n[1]=(e[6]-e[2])*r,n[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[i*3+i]-e[a*3+a]-e[o*3+o]+1),n[i]=.5*r,r=.5/r,n[3]=(e[a*3+o]-e[o*3+a])*r,n[a]=(e[a*3+i]+e[i*3+a])*r,n[o]=(e[o*3+i]+e[i*3+o])*r}return n}function LGt(n,e,t,r){var i=.5*Math.PI/180;e*=i,t*=i,r*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(t),l=Math.cos(t),u=Math.sin(r),h=Math.cos(r);return n[0]=a*l*h-o*s*u,n[1]=o*s*h+a*l*u,n[2]=o*l*u-a*s*h,n[3]=o*l*h+a*s*u,n}function PGt(n){return"quat("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+")"}var OGt=Q9e,RGt=e7e,Hoe=t7e,DGt=r7e,NGt=n7e,kGt=g7e,b7e=s7e,joe=c7e,FGt=f7e,Xoe=$oe,BGt=Xoe,Yoe=Woe,GGt=Yoe,qoe=h7e,zGt=d7e,UGt=v7e,VGt=function(){var n=Uoe(),e=PQ(1,0,0),t=PQ(0,1,0);return function(r,i,a){var o=Voe(i,a);return o<-.999999?(GB(n,e,i),K9e(n)<1e-6&&GB(n,t,i),Z9e(n,n),p7e(r,n,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(GB(n,i,a),r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=1+o,qoe(r,r))}}(),$Gt=function(){var n=h9(),e=h9();return function(t,r,i,a,o,s){return zB(n,r,o,s),zB(e,i,a,s),zB(t,n,e,2*s*(1-s)),t}}(),WGt=function(){var n=P9e();return function(e,t,r,i){return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=i[0],n[4]=i[1],n[7]=i[2],n[2]=-t[0],n[5]=-t[1],n[8]=-t[2],qoe(e,w7e(e,n))}}();const HGt=Object.freeze(Object.defineProperty({__proto__:null,create:h9,identity:wGt,setAxisAngle:p7e,getAxisAngle:bGt,getAngle:EGt,multiply:g7e,rotateX:y7e,rotateY:m7e,rotateZ:_7e,calculateW:TGt,exp:x7e,ln:S7e,pow:CGt,slerp:zB,random:AGt,invert:MGt,conjugate:IGt,fromMat3:w7e,fromEuler:LGt,str:PGt,clone:OGt,fromValues:RGt,copy:Hoe,set:DGt,add:NGt,mul:kGt,scale:b7e,dot:joe,lerp:FGt,length:Xoe,len:BGt,squaredLength:Yoe,sqrLen:GGt,normalize:qoe,exactEquals:zGt,equals:UGt,rotationTo:VGt,sqlerp:$Gt,setAxes:WGt},Symbol.toStringTag,{value:"Module"}));function jGt(){var n=new ca(8);return ca!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0),n[3]=1,n}function XGt(n){var e=new ca(8);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e}function YGt(n,e,t,r,i,a,o,s){var l=new ca(8);return l[0]=n,l[1]=e,l[2]=t,l[3]=r,l[4]=i,l[5]=a,l[6]=o,l[7]=s,l}function qGt(n,e,t,r,i,a,o){var s=new ca(8);s[0]=n,s[1]=e,s[2]=t,s[3]=r;var l=i*.5,u=a*.5,h=o*.5;return s[4]=l*r+u*t-h*e,s[5]=u*r+h*n-l*t,s[6]=h*r+l*e-u*n,s[7]=-l*n-u*e-h*t,s}function E7e(n,e,t){var r=t[0]*.5,i=t[1]*.5,a=t[2]*.5,o=e[0],s=e[1],l=e[2],u=e[3];return n[0]=o,n[1]=s,n[2]=l,n[3]=u,n[4]=r*u+i*l-a*s,n[5]=i*u+a*o-r*l,n[6]=a*u+r*s-i*o,n[7]=-r*o-i*s-a*l,n}function ZGt(n,e){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n[4]=e[0]*.5,n[5]=e[1]*.5,n[6]=e[2]*.5,n[7]=0,n}function KGt(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=0,n[5]=0,n[6]=0,n[7]=0,n}function JGt(n,e){var t=h9();G9e(t,e);var r=new ca(3);return F9e(r,e),E7e(n,t,r),n}function T7e(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n}function QGt(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n}function e9t(n,e,t,r,i,a,o,s,l){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n[4]=a,n[5]=o,n[6]=s,n[7]=l,n}var t9t=Hoe;function r9t(n,e){return n[0]=e[4],n[1]=e[5],n[2]=e[6],n[3]=e[7],n}var n9t=Hoe;function i9t(n,e){return n[4]=e[0],n[5]=e[1],n[6]=e[2],n[7]=e[3],n}function a9t(n,e){var t=e[4],r=e[5],i=e[6],a=e[7],o=-e[0],s=-e[1],l=-e[2],u=e[3];return n[0]=(t*u+a*o+r*l-i*s)*2,n[1]=(r*u+a*s+i*o-t*l)*2,n[2]=(i*u+a*l+t*s-r*o)*2,n}function o9t(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=t[0]*.5,l=t[1]*.5,u=t[2]*.5,h=e[4],c=e[5],f=e[6],d=e[7];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=o*s+i*u-a*l+h,n[5]=o*l+a*s-r*u+c,n[6]=o*u+r*l-i*s+f,n[7]=-r*s-i*l-a*u+d,n}function s9t(n,e,t){var r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=s*o+h*r+l*a-u*i,f=l*o+h*i+u*r-s*a,d=u*o+h*a+s*i-l*r,v=h*o-s*r-l*i-u*a;return y7e(n,e,t),r=n[0],i=n[1],a=n[2],o=n[3],n[4]=c*o+v*r+f*a-d*i,n[5]=f*o+v*i+d*r-c*a,n[6]=d*o+v*a+c*i-f*r,n[7]=v*o-c*r-f*i-d*a,n}function l9t(n,e,t){var r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=s*o+h*r+l*a-u*i,f=l*o+h*i+u*r-s*a,d=u*o+h*a+s*i-l*r,v=h*o-s*r-l*i-u*a;return m7e(n,e,t),r=n[0],i=n[1],a=n[2],o=n[3],n[4]=c*o+v*r+f*a-d*i,n[5]=f*o+v*i+d*r-c*a,n[6]=d*o+v*a+c*i-f*r,n[7]=v*o-c*r-f*i-d*a,n}function u9t(n,e,t){var r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=s*o+h*r+l*a-u*i,f=l*o+h*i+u*r-s*a,d=u*o+h*a+s*i-l*r,v=h*o-s*r-l*i-u*a;return _7e(n,e,t),r=n[0],i=n[1],a=n[2],o=n[3],n[4]=c*o+v*r+f*a-d*i,n[5]=f*o+v*i+d*r-c*a,n[6]=d*o+v*a+c*i-f*r,n[7]=v*o-c*r-f*i-d*a,n}function h9t(n,e,t){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],h=e[3];return n[0]=s*o+h*r+l*a-u*i,n[1]=l*o+h*i+u*r-s*a,n[2]=u*o+h*a+s*i-l*r,n[3]=h*o-s*r-l*i-u*a,s=e[4],l=e[5],u=e[6],h=e[7],n[4]=s*o+h*r+l*a-u*i,n[5]=l*o+h*i+u*r-s*a,n[6]=u*o+h*a+s*i-l*r,n[7]=h*o-s*r-l*i-u*a,n}function c9t(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=t[0],l=t[1],u=t[2],h=t[3];return n[0]=r*h+o*s+i*u-a*l,n[1]=i*h+o*l+a*s-r*u,n[2]=a*h+o*u+r*l-i*s,n[3]=o*h-r*s-i*l-a*u,s=t[4],l=t[5],u=t[6],h=t[7],n[4]=r*h+o*s+i*u-a*l,n[5]=i*h+o*l+a*s-r*u,n[6]=a*h+o*u+r*l-i*s,n[7]=o*h-r*s-i*l-a*u,n}function f9t(n,e,t,r){if(Math.abs(r)0){t=Math.sqrt(t);var r=e[0]/t,i=e[1]/t,a=e[2]/t,o=e[3]/t,s=e[4],l=e[5],u=e[6],h=e[7],c=r*s+i*l+a*u+o*h;n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=(s-r*c)/t,n[5]=(l-i*c)/t,n[6]=(u-a*c)/t,n[7]=(h-o*c)/t}return n}function w9t(n){return"quat2("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+")"}function b9t(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]&&n[4]===e[4]&&n[5]===e[5]&&n[6]===e[6]&&n[7]===e[7]}function E9t(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],l=n[6],u=n[7],h=e[0],c=e[1],f=e[2],d=e[3],v=e[4],p=e[5],g=e[6],m=e[7];return Math.abs(t-h)<=In*Math.max(1,Math.abs(t),Math.abs(h))&&Math.abs(r-c)<=In*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-f)<=In*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-d)<=In*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-v)<=In*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=In*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(l-g)<=In*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(u-m)<=In*Math.max(1,Math.abs(u),Math.abs(m))}const T9t=Object.freeze(Object.defineProperty({__proto__:null,create:jGt,clone:XGt,fromValues:YGt,fromRotationTranslationValues:qGt,fromRotationTranslation:E7e,fromTranslation:ZGt,fromRotation:KGt,fromMat4:JGt,copy:T7e,identity:QGt,set:e9t,getReal:t9t,getDual:r9t,setReal:n9t,setDual:i9t,getTranslation:a9t,translate:o9t,rotateX:s9t,rotateY:l9t,rotateZ:u9t,rotateByQuatAppend:h9t,rotateByQuatPrepend:c9t,rotateAroundAxis:f9t,add:d9t,multiply:C7e,mul:v9t,scale:p9t,dot:A7e,lerp:g9t,invert:y9t,conjugate:m9t,length:M7e,len:_9t,squaredLength:BU,sqrLen:x9t,normalize:S9t,str:w9t,exactEquals:b9t,equals:E9t},Symbol.toStringTag,{value:"Module"}));function I7e(){var n=new ca(2);return ca!=Float32Array&&(n[0]=0,n[1]=0),n}function C9t(n){var e=new ca(2);return e[0]=n[0],e[1]=n[1],e}function A9t(n,e){var t=new ca(2);return t[0]=n,t[1]=e,t}function M9t(n,e){return n[0]=e[0],n[1]=e[1],n}function I9t(n,e,t){return n[0]=e,n[1]=t,n}function Oh(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n}function L7e(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n}function P7e(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n}function O7e(n,e,t){return n[0]=e[0]/t[0],n[1]=e[1]/t[1],n}function L9t(n,e){return n[0]=Math.ceil(e[0]),n[1]=Math.ceil(e[1]),n}function P9t(n,e){return n[0]=Math.floor(e[0]),n[1]=Math.floor(e[1]),n}function Ax(n,e,t){return n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n}function Mx(n,e,t){return n[0]=Math.max(e[0],t[0]),n[1]=Math.max(e[1],t[1]),n}function O9t(n,e){return n[0]=Math.round(e[0]),n[1]=Math.round(e[1]),n}function Gc(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n}function R9t(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n}function c9(n,e){var t=e[0]-n[0],r=e[1]-n[1];return Math.hypot(t,r)}function R7e(n,e){var t=e[0]-n[0],r=e[1]-n[1];return t*t+r*r}function D7e(n){var e=n[0],t=n[1];return Math.hypot(e,t)}function N7e(n){var e=n[0],t=n[1];return e*e+t*t}function D9t(n,e){return n[0]=-e[0],n[1]=-e[1],n}function N9t(n,e){return n[0]=1/e[0],n[1]=1/e[1],n}function SS(n,e){var t=e[0],r=e[1],i=t*t+r*r;return i>0&&(i=1/Math.sqrt(i)),n[0]=e[0]*i,n[1]=e[1]*i,n}function Zoe(n,e){return n[0]*e[0]+n[1]*e[1]}function k9t(n,e,t){var r=e[0]*t[1]-e[1]*t[0];return n[0]=n[1]=0,n[2]=r,n}function F9t(n,e,t,r){var i=e[0],a=e[1];return n[0]=i+r*(t[0]-i),n[1]=a+r*(t[1]-a),n}function B9t(n,e){e=e||1;var t=i0()*2*Math.PI;return n[0]=Math.cos(t)*e,n[1]=Math.sin(t)*e,n}function G9t(n,e,t){var r=e[0],i=e[1];return n[0]=t[0]*r+t[2]*i,n[1]=t[1]*r+t[3]*i,n}function z9t(n,e,t){var r=e[0],i=e[1];return n[0]=t[0]*r+t[2]*i+t[4],n[1]=t[1]*r+t[3]*i+t[5],n}function U9t(n,e,t){var r=e[0],i=e[1];return n[0]=t[0]*r+t[3]*i+t[6],n[1]=t[1]*r+t[4]*i+t[7],n}function V9t(n,e,t){var r=e[0],i=e[1];return n[0]=t[0]*r+t[4]*i+t[12],n[1]=t[1]*r+t[5]*i+t[13],n}function $9t(n,e,t,r){var i=e[0]-t[0],a=e[1]-t[1],o=Math.sin(r),s=Math.cos(r);return n[0]=i*s-a*o+t[0],n[1]=i*o+a*s+t[1],n}function k7e(n,e){var t=n[0],r=n[1],i=e[0],a=e[1],o=Math.sqrt(t*t+r*r)*Math.sqrt(i*i+a*a),s=o&&(t*i+r*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function W9t(n){return n[0]=0,n[1]=0,n}function H9t(n){return"vec2("+n[0]+", "+n[1]+")"}function Koe(n,e){return n[0]===e[0]&&n[1]===e[1]}function j9t(n,e){var t=n[0],r=n[1],i=e[0],a=e[1];return Math.abs(t-i)<=In*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(r-a)<=In*Math.max(1,Math.abs(r),Math.abs(a))}var X9t=D7e,UB=L7e,Y9t=P7e,q9t=O7e,Z9t=c9,K9t=R7e,J9t=N7e,Q9t=function(){var n=I7e();return function(e,t,r,i,a,o){var s,l;for(t||(t=2),r||(r=0),i?l=Math.min(i*t+r,e.length):l=e.length,s=r;s0&&d(S[0])}},m=0;m0;)f.push(l.pop());o.push(f)}}return o},z7e=function(e){for(var t=e.nodes,r=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l={},u={},h=[],c=0,f=function g(m){l[m.id]=c,u[m.id]=c,c+=1,o.push(m),s[m.id]=!0;for(var y=cv(m.id,a,"target").filter(function(b){return r.map(function(E){return E.id}).indexOf(b)>-1}),_=function(E){var T=y[E];if(!l[T]&&l[T]!==0){var C=r.filter(function(A){return A.id===T});C.length>0&&g(C[0]),u[m.id]=Math.min(u[m.id],u[T])}else s[T]&&(u[m.id]=Math.min(u[m.id],l[T]))},x=0;x0;){var w=o.pop();if(s[w.id]=!1,S.push(w),w===m)break}S.length>0&&h.push(S)}},d=0,v=r;d0;)for(var g=d.pop(),m=g.id,y=cv(m,e.edges),_=function(w){var b,E=y[w],T=e.nodes.find(function(k){return k.id===E});if(E===m)o.push((b={},b[E]=g,b));else if(!(E in p))v[E]=g,d.push(T),p[E]=new Set([g]);else if(!p[m].has(T)){for(var C=!0,A=[T,g],M=v[m];p[E].size&&!p[E].has(M)&&(A.push(M),M!==v[M.id]);)M=v[M.id];if(A.push(M),t&&r?(C=!1,A.findIndex(function(k){return t.indexOf(k.id)>-1})>-1&&(C=!0)):t&&!r&&A.findIndex(function(k){return t.indexOf(k.id)>-1})>-1&&(C=!1),C){for(var I={},R=1;R0;){var R=I.pop();a.has(R)&&(a.delete(R),o[R.id].forEach(function(k){I.push(k)}),o[R.id].clear())}},c=function A(M,I,R){var k=!1;if(t&&r===!1&&t.indexOf(M.id)>-1)return k;i.push(M),a.add(M);for(var D=R[M.id],G=0;G-1});le-1)?s.push((I={},I[Y.id]=Y,I)):q[Y.id].push(u[Q])}}return{component:V,adjList:q,minIdx:k}},_=0;_=_}),S=z7e({nodes:x,edges:e.edges}).filter(function(A){return A.length>1});if(S.length===0)break;var w=y(S),b=w.minIdx,E=w.adjList,T=w.component;if(T.length>1){T.forEach(function(A){o[A.id]=new Set});var C=l[b];if(t&&r&&t.indexOf(C.id)===-1)return s;c(C,C,E),_=b+1}else break}return s},W7e=function(e,t,r,i){return i===void 0&&(i=!0),t?rse(e,r,i):tse(e,r,i)},f7t=function(e,t,r){for(var i=1/0,a,o=0;oh[x.id]+A?(h[C]=h[x.id]+A,c[C]=[x.id]):h[C]===h[x.id]+A&&c[C].push(x.id)})},v=0;v0&&h.length>0;){var d=h[h.length-1];if(d.length){var v=d.shift();v&&(l.push(v),u[v]=!0,f=i?cv(v,s,"target"):cv(v,s),h.push(f.filter(function(m){return!u[m]})))}else{var p=l.pop();u[p]=!1,h.pop();continue}if(l[l.length-1]===r){var g=l.map(function(y){return y});c.push(g);var p=l.pop();u[p]=!1,h.pop()}}return c},GD=function(e,t){for(var r=i2(e,t),i=[],a=r.length,o=0;oi[o][l]+i[l][s]&&(i[o][s]=i[o][l]+i[l][s]);return i},Y7e=function(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r="weight"),i===void 0&&(i=1e3);var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u={},h={};o.forEach(function(_,x){var S=B7e();_.clusterId=S,u[S]={id:S,nodes:[_]},h[_.id]={node:_,idx:x}});var c=i2(e,t),f={};c.forEach(function(_,x){var S=o[x].id;f[S]={},_.forEach(function(w,b){if(!!w){var E=o[b].id;f[S][E]=w}})});for(var d=0,v=function(){var x=!1;if(o.forEach(function(S){var w={};Object.keys(f[S.id]).forEach(function(R){var k=f[S.id][R],D=h[R].node,G=D.clusterId;w[G]||(w[G]=0),w[G]+=k});var b=-1/0,E=[];if(Object.keys(w).forEach(function(R){b=0&&E.splice(T,1),E&&E.length){x=!0;var C=u[S.clusterId],A=C.nodes.indexOf(S);C.nodes.splice(A,1);var M=Math.floor(Math.random()*E.length),I=u[E[M]];I.nodes.push(S),S.clusterId=I.id}}}),!x)return"break";d++};d0&&E>T&&E-TT&&(A=c.map(function(z){return{node:z,clusterId:z.clusterId}}),M=Xi(y),T=E),I||C>100)break;C++,Object.keys(y).forEach(function(z){var V=0;d.forEach(function(q){var Y=q.source,le=q.target,j=_[Y].node.clusterId,Q=_[le].node.clusterId;(j===z&&Q!==z||Q===z&&j!==z)&&(V=V+(q[r]||1))}),y[z].sumTot=V}),c.forEach(function(z,V){var q=y[z.clusterId],Y=0,le,j=S[V]/(2*b),Q=0,ie=q.nodes;ie.forEach(function(st){var Nt=_[st.id].idx;Q+=x[V][Nt]||0});var oe=Q-q.sumTot*j,se=ie.filter(function(st){return st.id!==z.id});se.forEach(function(st,Nt){v[st.originIndex]});var me=TX(se,v)*u,Ce=w[z.id];if(Object.keys(Ce).forEach(function(st){var Nt=_[st].node,Zt=Nt.clusterId;if(Zt!==z.clusterId){var qe=y[Zt],ur=qe.nodes;if(!(!ur||!ur.length)){var Dt=0;ur.forEach(function(Tt){var Qe=_[Tt.id].idx;Dt+=x[V][Qe]||0});var ft=Dt-qe.sumTot*j,Oe=ur.concat([z]);Oe.forEach(function(Tt,Qe){v[Tt.originIndex]});var J=TX(Oe,v)*u,We=ft-oe;a&&(We=ft+J-(oe+me)),We>Y&&(Y=We,le=qe)}}}),Y>0){le.nodes.push(z);var Le=z.clusterId;z.clusterId=le.id;var re=q.nodes.indexOf(z);q.nodes.splice(re,1);var yt=0,je=0;d.forEach(function(st){var Nt=st.source,Zt=st.target,qe=_[Nt].node.clusterId,ur=_[Zt].node.clusterId;(qe===le.id&&ur!==le.id||ur===le.id&&qe!==le.id)&&(yt=yt+(st[r]||1)),(qe===Le&&ur!==Le||ur===Le&&qe!==Le)&&(je=je+(st[r]||1))}),le.sumTot=yt,q.sumTot=je}})}var R={},k=0;Object.keys(M).forEach(function(z){var V=M[z];if(!V.nodes||!V.nodes.length){delete M[z];return}var q=String(k+1);q!==z&&(V.id=q,V.nodes=V.nodes.map(function(Y){return{id:Y.id,clusterId:q}}),M[q]=V,R[z]=q,delete M[z],k++)}),A.forEach(function(z){var V=z.node,q=z.clusterId;!V||(V.clusterId=q,V.clusterId&&R[V.clusterId]&&(V.clusterId=R[V.clusterId]))});var D=[],G={};d.forEach(function(z){var V=z.source,q=z.target,Y=z[r]||1,le=_[V].node.clusterId,j=_[q].node.clusterId;if(!(!le||!j)){var Q="".concat(le,"---").concat(j);if(G[Q])G[Q].weight+=Y,G[Q].count++;else{var ie={source:le,target:j,weight:Y,count:1};G[Q]=ie,D.push(ie)}}});var W=[];return Object.keys(M).forEach(function(z){W.push(M[z])}),{clusters:W,clusterEdges:D}},q7e=function(e,t,r,i,a,o,s,l){return t===void 0&&(t=!1),r===void 0&&(r="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=void 0),o===void 0&&(o=[]),s===void 0&&(s=["id"]),l===void 0&&(l=1),ase(e,t,r,i,!0,a,o,s,l)},Z7e=function(e,t){var r;t===void 0&&(t=1);for(var i=Xi(e),a=i.nodes,o=a===void 0?[]:a,s=i.edges,l=s===void 0?[]:s,u=function(){var f=g_({nodes:o,edges:l}),d=Object.keys(f);d.sort(function(g,m){var y,_;return((y=f[g])===null||y===void 0?void 0:y.degree)-((_=f[m])===null||_===void 0?void 0:_.degree)});var v=d[0];if(!o.length||((r=f[v])===null||r===void 0?void 0:r.degree)>=t)return"break";var p=o.findIndex(function(g){return g.id===v});o.splice(p,1),l=l.filter(function(g){return!(g.source===v||g.target===v)})};;){var h=u();if(h==="break")break}return{nodes:o,edges:l}},uxe=function(e,t,r){var i=[];switch(e){case jg.EuclideanDistance:i=t[r];break;default:i=[];break}return i},K7e=function(e,t,r,i,a,o){t===void 0&&(t=3),r===void 0&&(r=void 0),i===void 0&&(i=[]),a===void 0&&(a=["id"]),o===void 0&&(o=jg.EuclideanDistance);var s=e.nodes,l=s===void 0?[]:s,u=e.edges,h=u===void 0?[]:u,c={clusters:[{id:"0",nodes:l}],clusterEdges:[]};if(o===jg.EuclideanDistance&&!l.every(function(q){return q.hasOwnProperty(r)}))return c;var f=[],d=[];if(o===jg.EuclideanDistance&&(f=nse(l,r),d=ise(f,i,a)),!d.length)return c;for(var v=kD(d.map(function(q){return q.join("")})),p=Math.min(t,l.length,v.length),g=0;gS&&!m.find(function(se){return HS(se,uxe(o,d,l[le].originIndex))})&&(S=oe,w=le)}},E=0;E=0;R--)_[Number(l[g].clusterId)][R].id===l[g].id&&_[Number(l[g].clusterId)].splice(R,1);l[g].clusterId=String(C),_[C].push(l[g])}}for(var k=!1,g=0;g<_.length;g++){for(var D=_[g],G=new Ip([]),M=0;M=1e3)break}var z=[],V={};return h.forEach(function(q){var Y,le,j=q.source,Q=q.target,ie=(Y=l.find(function(Ce){return Ce.id===j}))===null||Y===void 0?void 0:Y.clusterId,oe=(le=l.find(function(Ce){return Ce.id===Q}))===null||le===void 0?void 0:le.clusterId,se="".concat(ie,"---").concat(oe);if(V[se])V[se].count++;else{var me={source:ie,target:oe,count:1};V[se]=me,z.push(me)}}),{clusters:_,clusterEdges:z}},ose=function(e,t){var r=new Ip(t),i=r.norm2(),a=new Ip(e),o=a.norm2(),s=r.dot(a),l=i*o,u=l?s/l:0;return u},J7e=function(e,t,r,i,a){e===void 0&&(e=[]),r===void 0&&(r=void 0),i===void 0&&(i=[]),a===void 0&&(a=[]);var o=Xi(e.filter(function(f){return f.id!==t.id})),s=e.findIndex(function(f){return f.id===t.id}),l=nse(e,r),u=ise(l,i,a),h=u[s],c=[];return o.forEach(function(f,d){if(f.id!==t.id){var v=u[d],p=ose(v,h);c.push(p),f.cosineSimilarity=p}}),o.sort(function(f,d){return d.cosineSimilarity-f.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},v7t=function(){function n(e){this.count=e.length,this.parent={};for(var t=0,r=e;t0&&(this.list[0]=t,this.moveDown(0)),e},n.prototype.insert=function(e){if(e!==null){this.list.push(e);var t=this.list.length-1;return this.moveUp(t),!0}return!1},n.prototype.moveUp=function(e){for(var t=this.getParent(e);e&&e>0&&this.compareFn(this.list[t],this.list[e])>0;){var r=this.list[t];this.list[t]=this.list[e],this.list[e]=r,e=t,t=this.getParent(e)}},n.prototype.moveDown=function(e){var t,r=e,i=this.getLeft(e),a=this.getRight(e),o=this.list.length;i!==null&&i0?r=i:a!==null&&a0&&(r=a),e!==r&&(t=[this.list[r],this.list[e]],this.list[e]=t[0],this.list[r]=t[1],this.moveDown(r))},n}(),y7t=function(e,t){var r=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return r;var l=a[0],u=new Set;u.add(l);var h=function(g,m){return t?g.weight-m.weight:0},c=new g7t(h);for(VB(l.id,s).forEach(function(p){c.insert(p)});!c.isEmpty();){var f=c.delMin(),d=f.source,v=f.target;u.has(d)&&u.has(v)||(r.push(f),u.has(d)||(u.add(d),VB(d,s).forEach(function(p){c.insert(p)})),u.has(v)||(u.add(v),VB(v,s).forEach(function(p){c.insert(p)})))}return r},hxe=function(e,t){var r=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return r;var l=s.map(function(d){return d});t&&l.sort(function(d,v){return d.weight-v.weight});for(var u=new v7t(a.map(function(d){return d.id}));l.length>0;){var h=l.shift(),c=h.source,f=h.target;u.connected(c,f)||(r.push(h),u.union(c,f))}return r},Q7e=function(e,t,r){var i={prim:y7t,kruskal:hxe};return r?i[r](e,t):hxe(e,t)},eze=function(e,t,r){typeof t!="number"&&(t=1e-6),typeof r!="number"&&(r=.85);for(var i=1,a=0,o=1e3,s=e.nodes,l=s===void 0?[]:s,u=e.edges,h=u===void 0?[]:u,c=l.length,f,d={},v={},p=0;p0&&i>t;){a=0;for(var p=0;p0&&(f+=v[S]/w)}d[m]=r*f,a+=d[m]}}a=(1-a)/c,i=0;for(var p=0;p=0;r--){var i=this.dfsEdgeList[r],a=i.fromNode,o=i.toNode;ad||i.hasNode(o[f.to])||(t.label_;S--){var w=x(S);if(w==="break")break}if(m){var b=e.findMinLabel(g);o.dfsEdgeList.push(new Fb(p,y,Gy,b.edgeLabel,Gy));var E=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[E]!==o.dfsEdgeList[E]?!1:c(g[b.edgeLabel].projected)}var T={};m=!1;var C=0;f.forEach(function(D){var G=new i5(D),W=e.findForwardPureEdges(i,G.edges[d[0]],v,G);W.length>0&&(m=!0,C=p,W.forEach(function(z){var V="".concat(z.label,"-").concat(a[z.to].label);T[V]||(T[V]={projected:[],edgeLabel:z.label,nodeLabel2:a[z.to].label}),T[V].projected.push({graphId:i.id,edge:z,preNode:D})}))});for(var A=d.length,M=function(G){if(m)return"break";var W=d[G];f.forEach(function(z){var V=new i5(z),q=e.findForwardRmpathEdges(i,V.edges[W],v,V);q.length>0&&(m=!0,C=o.dfsEdgeList[W].fromNode,q.forEach(function(Y){var le="".concat(Y.label,"-").concat(a[Y.to].label);T[le]||(T[le]={projected:[],edgeLabel:Y.label,nodeLabel2:a[Y.to].label}),T[le].projected.push({graphId:i.id,edge:Y,preNode:z})}))})},S=0;S=0;v--){var p=t.findBackwardEdge(c,d.edges[a[v]],d.edges[a[0]],d);if(p){var g="".concat(t.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(p.label);u[g]||(u[g]={projected:[],toNodeId:t.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:p.label}),u[g].projected.push({graphId:h.graphId,edge:p,preNode:h})}}if(!(i>=t.maxNodeNum)){var m=t.findForwardPureEdges(c,d.edges[a[0]],s,d);m.forEach(function(_){var x="".concat(o,"-").concat(_.label,"-").concat(f[_.to].label);l[x]||(l[x]={projected:[],fromNodeId:o,edgeLabel:_.label,nodeLabel2:f[_.to].label}),l[x].projected.push({graphId:h.graphId,edge:_,preNode:h})});for(var y=function(x){var S=t.findForwardRmpathEdges(c,d.edges[a[x]],s,d);S.forEach(function(w){var b="".concat(t.dfsCode.dfsEdgeList[a[x]].fromNode,"-").concat(w.label,"-").concat(f[w.to].label);l[b]||(l[b]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[x]].fromNode,edgeLabel:w.label,nodeLabel2:f[w.to].label}),l[b].projected.push({graphId:h.graphId,edge:w,preNode:h})})},v=0;vy){var _=y;y=m,m=_}var x=g.label,S="".concat(m,"-").concat(x,"-").concat(y);if(!o[S]){var w=o[S]||0;w++,o[S]=w}})})}),Object.keys(a).forEach(function(l){var u=a[l];if(!(u2*t)););if(g<2*t&&(s["".concat(h,"-").concat(p)]={start:h,end:p,distance:a[h][p]},c++,l++,l>=r))return s;if(f++,f>2*t)break}if(cf&&(l=f);var d=r[c.id].inDegree;u>d&&(u=d);var v=r[c.id].outDegree;h>v&&(h=v)}),e[t]={degree:l,inDegree:u,outDegree:h}),{minPatternNodeLabelDegree:l,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:h}},aze=function(e,t,r,i,a,o,s){var l;if(r===void 0&&(r=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!e||!e.nodes)){var u=e.nodes.length;if(!!u){var h=GD(e,r),c=GD(t,r),f=yxe(e.nodes,h,r),d=yxe(t.nodes,c,r),v=pxe(e.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,m=pxe(t.nodes,o),y=m.nodeMap,_=m.nodeLabelMap;gxe(e.edges,s,p);var x=gxe(t.edges,s,y).edgeLabelMap,S=[];c==null||c.forEach(function(ft){S=S.concat(ft)}),a||(a=Math.max.apply(Math,_v(_v([],S,!1),[2],!1))),i||(i=a);var w=vxe(e,h,o,i),b=vxe(t,c,o,i),E=Math.min(100,u*(u-1)/2),T=E7t(i,u,E,w,h),C=$B(T,w,e),A=10,M=1,I=1,R=4,k={graphs:C,nodeLabelProp:o,edgeLabelProp:s,minSupport:M,minNodeNum:I,maxNodeNum:R,directed:r},D=b7t(k).slice(0,A),G=D.length,W=[];D.forEach(function(ft,Oe){W[Oe]={},Object.keys(C).forEach(function(J){var We=C[J],Tt=WB(We,ft,o,s);W[Oe][J]=Tt})});var z=T7t(W,G,D),V=z.structure,q=z.structureCountMap,Y=t.nodes[0],le=[],j=(l=t.nodes[0])===null||l===void 0?void 0:l[o],Q=-1/0;t.nodes.forEach(function(ft){var Oe=ft[o],J=g[Oe];(J==null?void 0:J.length)>Q&&(Q=J.length,le=J,j=Oe,Y=ft)});var ie={},oe={},se={},me={},Ce={},Le={};Object.keys(_).forEach(function(ft,Oe){Ce[ft]=[],r&&(Le[ft]=[]);var J=_[ft],We={};J.forEach(function(wt){var pt=d["".concat(Y.id,"-").concat(wt.id)];if(pt&&Ce[ft].push(pt),We["".concat(Y.id,"-").concat(wt.id)]={start:0,end:y[wt.id].idx,distance:pt},r){var ar=d["".concat(wt.id,"-").concat(Y.id)];ar&&Le[ft].push(ar)}}),Ce[ft]=Ce[ft].sort(function(wt,pt){return wt-pt}),r&&(Le[ft]=Le[ft].sort(function(wt,pt){return wt-pt})),oe=$B(We,b,t,oe);var Tt=[];if(Object.keys(We).forEach(function(wt){if(se[wt]){Tt.push(se[wt]);return}var pt=oe[wt];se[wt]=WB(pt,V,o,s),Tt.push(se[wt])}),Tt=Tt.sort(function(wt,pt){return pt-wt}),me["".concat(Y.id,"-").concat(ft)]=Tt,ft!==j)for(var Qe=(le==null?void 0:le.length)||0,zt=function(pt){var ar=le[pt],kt=w[p[ar.id].idx],Dr=kt.nodeLabelCountMap[ft],Sr=_[ft].length;if(!Dr||Dr.countCe[ft][pn]){jr=!0;break}if(jr)return le.splice(pt,1),"continue";var Jn={};kt.neighbors.forEach(function(yn){var Oi=f["".concat(ar.id,"-").concat(yn.id)];Jn["".concat(ar.id,"-").concat(yn.id)]={start:p[ar.id].idx,end:p[yn.id].idx,distance:Oi}}),C=$B(Jn,w,e,C);var Rn=[];Object.keys(Jn).forEach(function(yn){if(q[yn]){Rn.push(q[yn]);return}var Oi=C[yn];q[yn]=WB(Oi,V,o,s),Rn.push(q[yn])}),Rn=Rn.sort(function(yn,Oi){return Oi-yn});for(var hi=!1,pn=0;pn=0;mt--)zt(mt)});var re=[];le==null||le.forEach(function(ft){for(var Oe=p[ft.id].idx,J=ize(e.nodes,h[Oe],Oe,o,a),We=J.neighbors,Tt=We.length,Qe=!1,zt=Tt-1;zt>=0;zt--){if(We.length+1Dr){We.splice(zt,1);continue}if(r){var Sr="".concat(mt.id,"-").concat(ft.id),jr=f[Sr];kt=Le[wt].length-1;var pn=Le[wt][kt];if(jr>pn){We.splice(zt,1);continue}}var Jn=q[pt]?q[pt]:C7t(e,ft,mt,p,ar,w,V,o,s,q,C),Rn="".concat(Y.id,"-").concat(wt),hi=me[Rn][me[Rn].length-1];if(Jn=0;ar--){var pn=jr(ar);if(pn==="break")break}if(Sr)return re.splice(Oe,1),"continue";J.edges=zt;var Jn=BD(J,J.nodes[0].id,!1).length;if(Object.keys(Jn).reverse().forEach(function(ue){if(!(ue===J.nodes[0].id||Sr)){if(Jn[ue]===1/0){var xe=Qe[ue].node[o];if(Tt[xe]--,Tt[xe]<_[xe].length){Sr=!0;return}var ce=J.nodes.indexOf(Qe[ue].node);J.nodes.splice(ce,1),Qe[ue]=void 0;return}var pe=p[ue].node[o];if(!je[pe]||!je[pe].length||Jn[ue]>je[pe][je[pe].length-1]){var xe=Qe[ue].node[o];if(Tt[xe]--,Tt[xe]<_[xe].length){Sr=!0;return}var ce=J.nodes.indexOf(Qe[ue].node);J.nodes.splice(ce,1),Qe[ue]=void 0}}}),Sr)return re.splice(Oe,1),"continue";for(var Rn=!0,hi=0;Rn&&!Sr;){Rn=!1;var yn=r?Qe[We.id].degree=0;oi--){var Gi=J.nodes[oi],ws=Qe[Gi.id].degree,Sl=Qe[Gi.id].inDegree,Os=Qe[Gi.id].outDegree,no=Gi[o],vo=mxe(ie,no,y,_),No=vo.minPatternNodeLabelDegree,Jo=vo.minPatternNodeLabelInDegree,Lo=vo.minPatternNodeLabelOutDegree,hs=r?ws=0;Rs--){var Pn=zt[Rs];if(!Qe[Pn.source]||!Qe[Pn.target]){zt.splice(Rs,1);var mo=Pn[s];if(mt[mo]--,Qe[Pn.source]&&(Qe[Pn.source].degree--,Qe[Pn.source].outDegree--),Qe[Pn.target]&&(Qe[Pn.target].degree--,Qe[Pn.target].inDegree--),x[mo]&&mt[mo]=0;Zt--){var qe=Nt(Zt);if(qe==="break")break}for(var ur=re.length,Dt=function(Oe){var J=re[Oe],We={};J.edges.forEach(function(zt){var mt="".concat(zt.source,"-").concat(zt.target,"-").concat(zt.label);We[mt]?We[mt]++:We[mt]=1});for(var Tt=function(mt){var wt=re[mt],pt={};wt.edges.forEach(function(kt){var Dr="".concat(kt.source,"-").concat(kt.target,"-").concat(kt.label);pt[Dr]?pt[Dr]++:pt[Dr]=1});var ar=!0;Object.keys(pt).length!==Object.keys(We).length?ar=!1:Object.keys(We).forEach(function(kt){pt[kt]!==We[kt]&&(ar=!1)}),ar&&re.splice(mt,1)},Qe=ur-1;Qe>Oe;Qe--)Tt(Qe);ur=re.length},Zt=0;Zt<=ur-1;Zt++)Dt(Zt);return re}}},pA=function(){function n(e){e===void 0&&(e=10),this.linkedList=new F7e,this.maxStep=e}return Object.defineProperty(n.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),n.prototype.isEmpty=function(){return!this.linkedList.head},n.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},n.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},n.prototype.push=function(e){this.linkedList.prepend(e),this.length>this.maxStep&&this.linkedList.deleteTail()},n.prototype.pop=function(){var e=this.linkedList.deleteHead();return e?e.value:null},n.prototype.toArray=function(){return this.linkedList.toArray().map(function(e){return e.value})},n.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},n}(),oze=ese;const A7t={getAdjMatrix:i2,breadthFirstSearch:G7e,connectedComponent:Joe,getDegree:g_,getInDegree:U7e,getOutDegree:V7e,detectCycle:ese,detectDirectedCycle:oze,detectAllCycles:W7e,detectAllDirectedCycle:rse,detectAllUndirectedCycle:tse,depthFirstSearch:Qoe,dijkstra:BD,findAllPath:X7e,findShortestPath:j7e,floydWarshall:GD,labelPropagation:Y7e,louvain:ase,iLouvain:q7e,kCore:Z7e,kMeans:K7e,cosineSimilarity:ose,nodesCosineSimilarity:J7e,minimumSpanningTree:Q7e,pageRank:eze,getNeighbors:cv,Stack:pA,GADDI:aze},M7t=Object.freeze(Object.defineProperty({__proto__:null,getAdjMatrix:i2,breadthFirstSearch:G7e,connectedComponent:Joe,getDegree:g_,getInDegree:U7e,getOutDegree:V7e,detectCycle:ese,detectDirectedCycle:oze,detectAllCycles:W7e,detectAllDirectedCycle:rse,detectAllUndirectedCycle:tse,depthFirstSearch:Qoe,dijkstra:BD,findAllPath:X7e,findShortestPath:j7e,floydWarshall:GD,labelPropagation:Y7e,louvain:ase,iLouvain:q7e,kCore:Z7e,kMeans:K7e,cosineSimilarity:ose,nodesCosineSimilarity:J7e,minimumSpanningTree:Q7e,pageRank:eze,getNeighbors:cv,Stack:pA,GADDI:aze,default:A7t},Symbol.toStringTag,{value:"Module"}));var d9=sg,I7t=function(e){return function(t,r){return t[e]-r[e]}},_xe=function(e,t,r){return e>=t&&e<=r},GU=function(e,t,r,i){var a=1e-4,o={x:r.x-e.x,y:r.y-e.y},s={x:t.x-e.x,y:t.y-e.y},l={x:i.x-r.x,y:i.y-r.y},u=s.x*l.y-s.y*l.x,h=u*u,c=1/u,f=s.x*s.x+s.y*s.y,d=l.x*l.x+l.y*l.y;if(h>a*f*d){var v=(o.x*l.y-o.y*l.x)*c,p=(o.x*s.y-o.y*s.x)*c;return!_xe(v,0,1)||!_xe(p,0,1)?null:{x:e.x+v*s.x,y:e.y+v*s.y}}return null},sze=function(e,t){var r=e.x,i=e.y,a=e.width,o=e.height,s=r+a/2,l=i+o/2,u=[],h={x:s,y:l};u.push({x:r,y:i}),u.push({x:r+a,y:i}),u.push({x:r+a,y:i+o}),u.push({x:r,y:i+o}),u.push({x:r,y:i});for(var c=null,f=1;ft[i][o]+t[o][a]&&(t[i][a]=t[i][o]+t[o][a]);return t},O7t=function(e,t){var r=e.nodes,i=e.edges,a=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(s,l){o[s.id]=l;var u=[];a.push(u)}),i&&i.forEach(function(s){var l=s.source,u=s.target,h=o[l],c=o[u];a[h][c]=1,t||(a[c][h]=1)}),a},cze=function(e,t){e.translate(t.x,t.y)},RQ=function(e,t,r,i){i===void 0&&(i={duration:500});var a=e.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var o=e.getCanvasBBox(),s=t.x-o.minX,l=t.y-o.minY;if(r){var u=s*a[0],h=l*a[4],c=0,f=0,d=0,v=0;e.animate(function(g){return d=u*g,v=h*g,a=d9(a,[["t",d-c,v-f]]),c=d,f=v,{matrix:a}},i)}else{var p=d9(a,[["t",s,l]]);e.setMatrix(p)}},R7t=function(e,t){var r=e.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var i=t;vn(t)||(i=[t,t]),vn(t)&&t.length===1&&(i=[t[0],t[0]]),r=d9(r,[["s",i[0],i[1]]]),e.setMatrix(r)},D7t=function(e,t){var r=e.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]),r=d9(r,[["r",t]]),e.setMatrix(r)},N7t=function(e,t,r){for(var i=[],a=0;a0!=s(h[1]-r)>0&&s(t-(r-u[1])*(u[0]-h[0])/(u[1]-h[1])-u[0])<0&&(i=!i)}return i},fze=function(e,t){return!(t.minX>e.maxX||t.maxXe.maxY||t.maxY1){var y=f[0],_=f[v-1];d.push({from:{x:_[0],y:_[1]},to:{x:y[0],y:y[1]}})}return d};if(e.length<2||t.length<2)return!1;var a=r(e),o=r(t);if(!fze(a,o))return!1;var s=!1;if(At(t,function(c){if(zD(e,c[0],c[1]))return s=!0,!1}),s||(At(e,function(c){if(zD(t,c[0],c[1]))return s=!0,!1}),s))return!0;var l=i(e),u=i(t),h=!1;return At(u,function(c){if(F7t(l,c))return h=!0,!1}),h},a2=function(){function n(e,t,r,i){this.x1=e,this.y1=t,this.x2=r,this.y2=i}return n.prototype.getBBox=function(){var e=Math.min(this.x1,this.x2),t=Math.min(this.y1,this.y2),r=Math.max(this.x1,this.x2),i=Math.max(this.y1,this.y2),a={x:e,y:t,minX:e,minY:t,maxX:r,maxY:i,width:r-e,height:i-t};return a},n}(),sse=function(e,t){var r={top:[e.minX,e.minY,e.maxX,e.minY],left:[e.minX,e.minY,e.minX,e.maxY],bottom:[e.minX,e.maxY,e.maxX,e.maxY],right:[e.maxX,e.minY,e.maxX,e.maxY]};return r[t]},B7t=function(e,t){var r=(t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1),i=(e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1),a=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(a){var o=r/a,s=i/a;if(o>=0&&o<=1&&s>=0&&s<=1)return o}return Number.POSITIVE_INFINITY},vze=function(e,t){for(var r=["top","left","bottom","right"],i=e.getBBox(),a=0,o=[],s=0;s<4;s++){var l=sse(i,r[s]),u=l[0],h=l[1],c=l[2],f=l[3];o[s]=GU({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},{x:u,y:h},{x:c,y:f}),o[s]&&(a+=1)}return[o,a]},lse=function(e,t){for(var r=["top","left","bottom","right"],i=e.getBBox(),a=Number.POSITIVE_INFINITY,o=0,s=0;s<4;s++){var l=sse(i,r[s]),u=l[0],h=l[1],c=l[2],f=l[3],d=B7t(t,new a2(u,h,c,f));d=Math.abs(d-.5),d>=0&&d<=1&&(o+=1,a=d0){for(var i=0,a=e;it.x+t.width,a=e.y>t.y+t.height,o=e.y":.604998779296875,"/":.5,"?":.53699951171875};var _y=Math.PI,kQ=Math.sin,FQ=Math.cos,bh=kQ(_y/8),Eh=FQ(_y/8),g9=function(e,t){var r=e.getBBox(),i={x:r.minX,y:r.minY},a={x:r.maxX,y:r.maxY};if(t){var o=t.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),i=$A(i,o),a=$A(a,o)}var s=i.x,l=i.y,u=a.x,h=a.y;return{x:s,y:l,minX:s,minY:l,maxX:u,maxY:h,width:u-s,height:h-l}},_ze=function(e){var t=e.sourceNode||e.targetNode,r=t.get("group"),i=r.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var a=t.getKeyShape(),o=a.getBBox(),s=e.loopCfg||{},l=s.dist||Math.max(o.width,o.height)*2,u=s.position||tn.defaultLoopPosition,h=[(o.minX+o.maxX)/2+i[6],(o.minY+o.maxY)/2+i[7]],c=[e.startPoint.x,e.startPoint.y],f=[e.endPoint.x,e.endPoint.y],d=o.height/2,v=o.width/2,p=d,g=d,m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,S=a.get("type"),w=Math.min(d/2,v/2),b=Math.min(d,v),E=s!=null&&s.pointPadding?Math.min(b,s==null?void 0:s.pointPadding):w;if(c[0]===f[0]&&c[1]===f[1]){switch(u){case"top":S==="circle"?(c=[h[0]-m,h[1]-y],f=[h[0]+_,h[1]-x]):(c=[h[0]-E,h[1]-d],f=[h[0]+E,h[1]-d]);break;case"top-right":p=d,g=v,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]+m,h[1]-y],f=[h[0]+x,h[1]-_]):(c=[h[0]+v-E,h[1]-d],f=[h[0]+v,h[1]-d+E]);break;case"right":p=v,g=v,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]+y,h[1]-m],f=[h[0]+x,h[1]+_]):(c=[h[0]+v,h[1]-E],f=[h[0]+v,h[1]+E]);break;case"bottom-right":p=v,g=d,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]+y,h[1]+m],f=[h[0]+_,h[1]+x]):(c=[h[0]+v,h[1]+d-E],f=[h[0]+v-E,h[1]+d]);break;case"bottom":p=d,g=d,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]+m,h[1]+y],f=[h[0]-_,h[1]+x]):(c=[h[0]-E,h[1]+d],f=[h[0]+E,h[1]+d]);break;case"bottom-left":p=d,g=v,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]-m,h[1]+y],f=[h[0]-x,h[1]+_]):(c=[h[0]-v,h[1]+d-E],f=[h[0]-v+E,h[1]+d]);break;case"left":p=v,g=v,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]-y,h[1]+m],f=[h[0]-x,h[1]-_]):(c=[h[0]-v,h[1]-E],f=[h[0]-v,h[1]+E]);break;case"top-left":p=v,g=d,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]-y,h[1]-m],f=[h[0]-_,h[1]-x]):(c=[h[0]-v+E,h[1]-d],f=[h[0]-v,h[1]-d+E]);break;default:p=v,g=v,m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]-m,h[1]-y],f=[h[0]+_,h[1]-x]}if(s.clockwise===!1){var T=[c[0],c[1]];c=[f[0],f[1]],f=[T[0],T[1]]}}var C=[c[0]-h[0],c[1]-h[1]],A=(p+l)/p,M=(g+l)/g;s.clockwise===!1&&(A=(g+l)/g,M=(p+l)/p);var I=Gc([0,0],C,A),R=[h[0]+I[0],h[1]+I[1]],k=[f[0]-h[0],f[1]-h[1]],D=Gc([0,0],k,M),G=[h[0]+D[0],h[1]+D[1]];return e.startPoint={x:c[0],y:c[1]},e.endPoint={x:f[0],y:f[1]},e.controlPoints=[{x:R[0],y:R[1]},{x:G[0],y:G[1]}],e},xze=function(e,t,r,i,a){var o=1e-4,s=[],l=e==null?void 0:e.getPoint(t);if(!l)return{x:0,y:0,angle:0};if(t1-o)s=e.getEndTangent();else{var u=e==null?void 0:e.getPoint(t+o);s.push([l.x,l.y]),s.push([u.x,u.y])}var h=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(h<0&&(h+=_y*2),r&&(l.x+=FQ(h)*r,l.y+=kQ(h)*r),i){var c=h-_y/2;h>1/2*_y&&h<3*1/2*_y&&(c-=_y),l.x+=FQ(c)*i,l.y+=kQ(c)*i}var f={x:l.x,y:l.y,angle:h};return a?(h>.5*_y&&h<1.5*_y&&(h-=_y),ve({rotate:h},f)):f},j7t=function n(e,t,r,i){if(i(e,t,r)===!1)return!1;if(e&&e.children){for(var a=e.children.length-1;a>=0;a--)if(!n(e.children[a],e,a,i))return!1}return!0},X7t=function n(e,t,r,i){if(e&&e.children){for(var a=e.children.length-1;a>=0;a--)if(!n(e.children[a],e,a,i))return}return i(e,t,r)!==!1},Fc=function(e,t){typeof t=="function"&&j7t(e,null,-1,t)},xy=function(e,t){typeof t=="function"&&X7t(e,null,-1,t)},Sze=function(e,t){return t*(H7t[e]||1)},wze=function(e,t){var r=0,i=new RegExp("[\u4E00-\u9FA5]+");return e.split("").forEach(function(a){i.test(a)?r+=t:r+=Sze(a,t)}),[r,t]},bze=function(e,t){return typeof t!="number"||t<=0||t>=e.length?e:e.substring(0,t)+"..."},BQ=function(e,t){var r=[],i={},a={};e.forEach(function(l){a[l.id]=l}),e.forEach(function(l,u){var h=Xi(l);h.itemType="combo",h.children=void 0,h.parentId===h.id?(console.warn("The parentId for combo ".concat(h.id," can not be the same as the combo's id")),delete h.parentId):h.parentId&&!a[h.parentId]&&(console.warn("The parent combo for combo ".concat(h.id," does not exist!")),delete h.parentId);var c=i[h.id];if(c){if(h.children=c.children,i[h.id]=h,c=h,!c.parentId){r.push(c);return}var f=i[c.parentId];if(f)f.children?f.children.push(h):f.children=[h];else{var d={id:c.parentId,children:[c]};i[c.parentId]=d,i[h.id]=h}return}if(rr(l.parentId)){var v=i[l.parentId];if(v)v.children?v.children.push(h):v.children=[h],i[h.id]=h;else{var p={id:l.parentId,children:[h]};i[p.id]=p,i[h.id]=h}}else r.push(h),i[h.id]=h});var o={};(t||[]).forEach(function(l){o[l.id]=l;var u=i[l.comboId];if(u){var h={id:l.id,comboId:l.comboId};u.children?u.children.push(h):u.children=[h],h.itemType="node",i[l.id]=h}});var s=0;return r.forEach(function(l){l.depth=s+10,Fc(l,function(u){var h,c=i[u.id].itemType;c==="node"?h=i[u.comboId]:h=i[u.parentId],h&&c==="node"?u.depth=s+1:u.depth=s+10,s-1&&a.splice(h,1),l||(o={id:t,itemType:"node",comboId:r},s[t]={children:void 0}),t){var c=!1;if(r){var f=0;(e||[]).forEach(function(v){c||Fc(v,function(p){return r===p.id?(c=!0,p.children?p.children.push(o):p.children=[o],f=p.depth,o.itemType==="node"?o.depth=f+2:o.depth=f+1,!1):!0})})}else(!r||!c)&&o.itemType!=="node"&&e.push(o);var d=o.depth;Fc(o,function(v){return v.itemType==="node"?d+=2:d+=1,v.depth=d,!0})}return e},HB=function(e,t,r){var i={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};if(!e||e.length===0){var a=r==null?void 0:r.getModel(),o=a||{},s=o.x,l=o.y,u=o.fixSize,h=o.collapsed,c=o.fixCollapseSize,f=h?c:u,d=vn(f)?f:[f,f],v=d[0],p=d[1],g=[v/2,p/2];return{minX:s-g[0],minY:l-g[1],maxX:s+g[0],maxY:l+g[1],x:s,y:l,width:v,height:p}}return e.forEach(function(m){var y=t.findById(m.id);if(!(!y||!y.isVisible())){y.set("bboxCanvasCache",void 0);var _=y.getCanvasBBox();_.x&&i.minX>_.minX&&(i.minX=_.minX),_.y&&i.minY>_.minY&&(i.minY=_.minY),_.x&&i.maxX<_.maxX&&(i.maxX=_.maxX),_.y&&i.maxY<_.maxY&&(i.maxY=_.maxY)}}),i.x=(i.minX+i.maxX)/2,i.y=(i.minY+i.maxY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY,i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2,(r==null?void 0:r.getKeyShape().get("type"))==="circle"&&(i.width=Math.hypot(i.height,i.width),i.height=i.width),Object.keys(i).forEach(function(m){(i[m]===1/0||i[m]===-1/0)&&(i[m]=void 0)}),i},Y7t=function(e){var t=on(e.x)||on(e.y)||e.type||e.anchorPoints||e.size;return e.style&&(t=t||on(e.style.r)||on(e.style.width)||on(e.style.height)||on(e.style.rx)||on(e.style.ry)),t},jB=function(e){var t={};return Object.keys(e).forEach(function(r){var i=e[r];if(!(r==="img"&&!rr(i)))if(Wh(i)&&!vn(i)){var a={};Object.keys(i).forEach(function(o){var s=i[o];o==="img"&&!rr(s)||(a[o]=Xi(s))}),t[r]=a}else t[r]=Xi(i)}),t},UD=function(e){var t=e.animateCfg,r=e.callback,i;if(!t)i={duration:500,callback:r};else if(i=Xi(t),t.callback){var a=t.callback;i.callback=function(){r(),a()}}else i.callback=r;return i};const q7t=Object.freeze(Object.defineProperty({__proto__:null,getBBox:g9,getLoopCfgs:_ze,getLabelPosition:xze,traverseTree:Fc,traverseTreeUp:xy,getLetterWidth:Sze,getTextSize:wze,truncateLabelByLength:bze,plainCombosToTrees:BQ,reconstructTree:GQ,getComboBBox:HB,shouldRefreshEdge:Y7t,cloneBesidesImg:jB,getAnimateCfgWithCallback:UD},Symbol.toStringTag,{value:"Module"}));var Exe=function(e){if(!e)return console.error("G6 Error Tips: the data must be defined"),!1;var t=e.nodes,r=e.edges,i=e.combos,a=i===void 0?[]:i;if(!t&&!r){var o=!0;return Fc(e,function(f){return rr(f.id)?!0:(o=!1,!1)}),o}var s=(t||[]).find(function(f){return!rr(f.id)});if(s)return console.warn("G6 Warning Tips: missing 'id' property, or %c".concat(s.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1;var l=(t||[]).map(function(f){return f.id}),u=a==null?void 0:a.map(function(f){return f.id}),h=_v(_v([],l,!0),u,!0),c=(r||[]).find(function(f){return!h.includes(f.source)||!h.includes(f.target)});return c?(console.warn("G6 Warning Tips: The source %c".concat(c.source,"%c or the target %c").concat(c.target,"%c of the edge do not exist in the nodes or combos."),"font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1):!0},Z7t=function(e,t){if(e==="node"||e==="combo"){if(t.id&&!rr(t.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(t.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(e==="edge"&&(!t.source||!t.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0},K7t=function(){function n(e){this.graph=e,this.destroyed=!1,this.modes=e.get("modes")||{default:[]},this.formatModes(),this.mode=e.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return n.prototype.formatModes=function(){var e=this.modes;At(e,function(t){At(t,function(r,i){rr(r)&&(t[i]={type:r})})})},n.prototype.setBehaviors=function(e){var t=this.graph,r=this.modes[e],i=[],a;At(r||[],function(o){var s=koe.getBehavior(o.type||o);!s||(a=new s(o),a&&(a.bind(t),i.push(a)))}),this.currentBehaves=i},n.mergeBehaviors=function(e,t){return At(t,function(r){e.indexOf(r)<0&&(rr(r)&&(r={type:r}),e.push(r))}),e},n.filterBehaviors=function(e,t){var r=[];return e.forEach(function(i){var a="";rr(i)?a=i:a=i.type,t.indexOf(a)<0&&r.push(i)}),r},n.prototype.setMode=function(e){var t=this,r=t.modes,i=t.graph,a=e,o=r[a];!o||(i.emit("beforemodechange",{mode:e}),At(this.currentBehaves,function(s){s.delegate&&s.delegate.remove(),s.unbind(i)}),this.setBehaviors(a),i.emit("aftermodechange",{mode:e}),this.mode=e)},n.prototype.getMode=function(){return this.mode},n.prototype.manipulateBehaviors=function(e,t,r){var i=this,a;if(vn(e)?a=e:a=[e],vn(t))return At(t,function(s){i.modes[s]?r?i.modes[s]=n.mergeBehaviors(i.modes[s]||[],a):i.modes[s]=n.filterBehaviors(i.modes[s]||[],a):r&&(i.modes[s]=a)}),this;var o=t;return t||(o=this.mode),this.modes[o]||r&&(this.modes[o]=a),r?this.modes[o]=n.mergeBehaviors(this.modes[o]||[],a):this.modes[o]=n.filterBehaviors(this.modes[o]||[],a),this.formatModes(),this.setMode(this.mode),this},n.prototype.updateBehavior=function(e,t,r){rr(e)&&(e={type:e});var i=[];if(!r||r===this.mode||r==="default"){if(i=this.currentBehaves,!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var a=i.length,o=0;o2&&(t.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([i,o[0]]),s==="r")t.push([i].concat(o));else for(;o.length>=e[s]&&(t.push([i].concat(o.splice(0,e[s]))),!!e[s]););return n}),t},zQ=function(n,e){for(var t=[],r=0,i=n.length;i-2*!e>r;r+=2){var a=[{x:+n[r-2],y:+n[r-1]},{x:+n[r],y:+n[r+1]},{x:+n[r+2],y:+n[r+3]},{x:+n[r+4],y:+n[r+5]}];e?r?i-4===r?a[3]={x:+n[0],y:+n[1]}:i-2===r&&(a[2]={x:+n[0],y:+n[1]},a[3]={x:+n[2],y:+n[3]}):a[0]={x:+n[i-2],y:+n[i-1]}:i-4===r?a[3]=a[2]:r||(a[0]={x:+n[r],y:+n[r+1]}),t.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return t},s5=function(n,e,t,r,i){var a=[];if(i===null&&r===null&&(r=t),n=+n,e=+e,t=+t,r=+r,i!==null){var o=Math.PI/180,s=n+t*Math.cos(-r*o),l=n+t*Math.cos(-i*o),u=e+t*Math.sin(-r*o),h=e+t*Math.sin(-i*o);a=[["M",s,u],["A",t,t,0,+(i-r>180),0,l,h]]}else a=[["M",n,e],["m",0,-r],["a",t,r,0,1,1,0,2*r],["a",t,r,0,1,1,0,-2*r],["z"]];return a},UQ=function(n){if(n=gA(n),!n||!n.length)return[["M",0,0]];var e=[],t=0,r=0,i=0,a=0,o=0,s,l;n[0][0]==="M"&&(t=+n[0][1],r=+n[0][2],i=t,a=r,o++,e[0]=["M",t,r]);for(var u=n.length===3&&n[0][0]==="M"&&n[1][0].toUpperCase()==="R"&&n[2][0].toUpperCase()==="Z",h=void 0,c=void 0,f=o,d=n.length;f1&&(S=Math.sqrt(S),t=S*t,r=S*r);var w=t*t,b=r*r,E=(a===o?-1:1)*Math.sqrt(Math.abs((w*b-w*x*x-b*_*_)/(w*x*x+b*_*_)));g=E*t*x/r+(n+s)/2,m=E*-r*_/t+(e+l)/2,v=Math.asin(((e-m)/r).toFixed(9)),p=Math.asin(((l-m)/r).toFixed(9)),v=np&&(v=v-Math.PI*2),!o&&p>v&&(p=p-Math.PI*2)}var T=p-v;if(Math.abs(T)>h){var C=p,A=s,M=l;p=v+h*(o&&p>v?1:-1),s=g+t*Math.cos(p),l=m+r*Math.sin(p),f=Eze(s,l,t,r,i,0,o,A,M,[p,C,g,m])}T=p-v;var I=Math.cos(v),R=Math.sin(v),k=Math.cos(p),D=Math.sin(p),G=Math.tan(T/4),W=4/3*t*G,z=4/3*r*G,V=[n,e],q=[n+W*R,e-z*I],Y=[s+W*D,l-z*k],le=[s,l];if(q[0]=2*V[0]-q[0],q[1]=2*V[1]-q[1],u)return[q,Y,le].concat(f);f=[q,Y,le].concat(f).join().split(",");for(var j=[],Q=0,ie=f.length;Q7){_[x].shift();for(var S=_[x];S.length;)o[x]="A",r&&(s[x]="A"),_.splice(x++,0,["C"].concat(S.splice(0,6)));_.splice(x,1),h=Math.max(t.length,r&&r.length||0)}},d=function(_,x,S,w,b){_&&x&&_[b][0]==="M"&&x[b][0]!=="M"&&(x.splice(b,0,["M",w.x,w.y]),S.bx=0,S.by=0,S.x=_[b][1],S.y=_[b][2],h=Math.max(t.length,r&&r.length||0))};h=Math.max(t.length,r&&r.length||0);for(var v=0;v1?1:l<0?0:l;for(var u=l/2,h=12,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,v=0;v0&&d<1&&l.push(d);continue}var p=c*c-4*f*h,g=Math.sqrt(p);if(!(p<0)){var m=(-c+g)/(2*h);m>0&&m<1&&l.push(m);var y=(-c-g)/(2*h);y>0&&y<1&&l.push(y)}}for(var _=l.length,x=_,S;_--;)d=l[_],S=1-d,u[0][_]=S*S*S*n+3*S*S*d*t+3*S*d*d*i+d*d*d*o,u[1][_]=S*S*S*e+3*S*S*d*r+3*S*d*d*a+d*d*d*s;return u[0][x]=n,u[1][x]=e,u[0][x+1]=o,u[1][x+1]=s,u[0].length=u[1].length=x+2,{min:{x:Math.min.apply(0,u[0]),y:Math.min.apply(0,u[1])},max:{x:Math.max.apply(0,u[0]),y:Math.max.apply(0,u[1])}}},rzt=function(n,e,t,r,i,a,o,s){if(!(Math.max(n,t)Math.max(i,o)||Math.max(e,r)Math.max(a,s))){var l=(n*r-e*t)*(i-o)-(n-t)*(i*s-a*o),u=(n*r-e*t)*(a-s)-(e-r)*(i*s-a*o),h=(n-t)*(a-s)-(e-r)*(i-o);if(!!h){var c=l/h,f=u/h,d=+c.toFixed(2),v=+f.toFixed(2);if(!(d<+Math.min(n,t).toFixed(2)||d>+Math.max(n,t).toFixed(2)||d<+Math.min(i,o).toFixed(2)||d>+Math.max(i,o).toFixed(2)||v<+Math.min(e,r).toFixed(2)||v>+Math.max(e,r).toFixed(2)||v<+Math.min(a,s).toFixed(2)||v>+Math.max(a,s).toFixed(2)))return{x:c,y:f}}}},dx=function(n,e,t){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},Cze=function(n,e,t,r,i){if(i)return[["M",+n+ +i,e],["l",t-i*2,0],["a",i,i,0,0,1,i,i],["l",0,r-i*2],["a",i,i,0,0,1,-i,i],["l",i*2-t,0],["a",i,i,0,0,1,-i,-i],["l",0,i*2-r],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",n,e],["l",t,0],["l",0,r],["l",-t,0],["z"]];return a.parsePathArray=Tze,a},$Q=function(n,e,t,r){return n===null&&(n=e=t=r=0),e===null&&(e=n.y,t=n.width,r=n.height,n=n.x),{x:n,y:e,width:t,w:t,height:r,h:r,x2:n+t,y2:e+r,cx:n+t/2,cy:e+r/2,r1:Math.min(t,r)/2,r2:Math.max(t,r)/2,r0:Math.sqrt(t*t+r*r)/2,path:Cze(n,e,t,r),vb:[n,e,t,r].join(" ")}},nzt=function(n,e){return n=$Q(n),e=$Q(e),dx(e,n.x,n.y)||dx(e,n.x2,n.y)||dx(e,n.x,n.y2)||dx(e,n.x2,n.y2)||dx(n,e.x,e.y)||dx(n,e.x2,e.y)||dx(n,e.x,e.y2)||dx(n,e.x2,e.y2)||(n.xe.x||e.xn.x)&&(n.ye.y||e.yn.y)},Mxe=function(n,e,t,r,i,a,o,s){vn(n)||(n=[n,e,t,r,i,a,o,s]);var l=tzt.apply(null,n);return $Q(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},Ixe=function(n,e,t,r,i,a,o,s,l){var u=1-l,h=Math.pow(u,3),c=Math.pow(u,2),f=l*l,d=f*l,v=h*n+c*3*l*t+u*3*l*l*i+d*o,p=h*e+c*3*l*r+u*3*l*l*a+d*s,g=n+2*l*(t-n)+f*(i-2*t+n),m=e+2*l*(r-e)+f*(a-2*r+e),y=t+2*l*(i-t)+f*(o-2*i+t),_=r+2*l*(a-r)+f*(s-2*a+r),x=u*n+l*t,S=u*e+l*r,w=u*i+l*o,b=u*a+l*s,E=90-Math.atan2(g-y,m-_)*180/Math.PI;return{x:v,y:p,m:{x:g,y:m},n:{x:y,y:_},start:{x,y:S},end:{x:w,y:b},alpha:E}},izt=function(n,e,t){var r=Mxe(n),i=Mxe(e);if(!nzt(r,i))return t?0:[];for(var a=Axe.apply(0,n),o=Axe.apply(0,e),s=~~(a/8),l=~~(o/8),u=[],h=[],c={},f=t?0:[],d=0;d=0&&b<=1&&E>=0&&E<=1&&(t?f+=1:f.push({x:w.x,y:w.y,t1:b,t2:E}))}}return f},azt=function(n,e,t){n=VQ(n),e=VQ(e);for(var r,i,a,o,s,l,u,h,c,f,d=t?0:[],v=0,p=n.length;v=3&&(c.length===3&&f.push("Q"),f=f.concat(c[1])),c.length===2&&f.push("L"),f=f.concat(c[c.length-1]),f});return h}var uzt=function(n,e,t){if(t===1)return[[].concat(n)];var r=[];if(e[0]==="L"||e[0]==="C"||e[0]==="Q")r=r.concat(lzt(n,e,t));else{var i=[].concat(n);i[0]==="M"&&(i[0]="L");for(var a=0;a<=t-1;a++)r.push(i)}return r},hzt=function(n,e){if(n.length===1)return n;var t=n.length-1,r=e.length-1,i=t/r,a=[];if(n.length===1&&n[0][0]==="M"){for(var o=0;o=0;l--)o=a[l].index,a[l].type==="add"?n.splice(o,0,[].concat(n[o])):n.splice(o,1)}r=n.length;var c=i-r;if(r0)t=AX(t,n[r-1],1);else{n[r]=e[r];break}n[r]=["Q"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;case"T":n[r]=["T"].concat(t[0]);break;case"C":if(t.length<3)if(r>0)t=AX(t,n[r-1],2);else{n[r]=e[r];break}n[r]=["C"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;case"S":if(t.length<2)if(r>0)t=AX(t,n[r-1],1);else{n[r]=e[r];break}n[r]=["S"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;default:n[r]=e[r]}return n};const vzt=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:zQ,fillPath:hzt,fillPathByDiff:Aze,formatPath:WQ,intersection:ozt,parsePathArray:Tze,parsePathString:gA,pathToAbsolute:UQ,pathToCurve:VQ,rectPath:Cze},Symbol.toStringTag,{value:"Module"}));var Ize=function(){function n(e,t){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=e,this.name=e,this.originalEvent=t,this.timeStamp=t.timeStamp}return n.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},n.prototype.stopPropagation=function(){this.propagationStopped=!0},n.prototype.toString=function(){var e=this.type;return"[Event (type="+e+")]"},n.prototype.save=function(){},n.prototype.restore=function(){},n}();function Lze(n,e){var t=n.indexOf(e);t!==-1&&n.splice(t,1)}var Lxe=typeof window<"u"&&typeof window.document<"u";function Pze(n,e){if(n.isCanvas())return!0;for(var t=e.getParent(),r=!1;t;){if(t===n){r=!0;break}t=t.getParent()}return r}function HQ(n){return n.cfg.visible&&n.cfg.capture}var pzt=function(n){Kn(e,n);function e(t){var r=n.call(this)||this;r.destroyed=!1;var i=r.getDefaultCfg();return r.cfg=_n(i,t),r}return e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,r){this.cfg[t]=r},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(C9e),Pxe=globalThis&&globalThis.__spreadArray||function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,a;r"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new xzt:typeof navigator<"u"?Dxe(navigator.userAgent):Czt()}function Ezt(n){return n!==""&&bzt.reduce(function(e,t){var r=t[0],i=t[1];if(e)return e;var a=i.exec(n);return!!a&&[r,a]},!1)}function Dxe(n){var e=Ezt(n);if(!e)return null;var t=e[0],r=e[1];if(t==="searchbot")return new _zt;var i=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);i?i.lengtho.delay&&At(e.toAttrs,function(s,l){a.call(o.toAttrs,l)&&(delete o.toAttrs[l],delete o.fromAttrs[l])})}),n}var Dze=function(n){Kn(e,n);function e(t){var r=n.call(this,t)||this;r.attrs={};var i=r.getDefaultAttrs();return _n(i,t.attrs),r.attrs=i,r.initAttrs(i),r.initAnimate(),r}return e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,r=[],i=0;i0?a=Nzt(a,x):i.addAnimator(this),a.push(x),this.set("animations",a),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var r=this;t===void 0&&(t=!0);var i=this.get("animations");At(i,function(a){t&&(a.onFrame?r.attr(a.onFrame(1)):r.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),r=this.get("animations"),i=t.getTime();return At(r,function(a){a._paused=!0,a._pauseTime=i,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:i}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline"),r=t.getTime(),i=this.get("animations"),a=this.get("_pause").pauseTime;return At(i,function(o){o.startTime=o.startTime+(r-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",i),this},e.prototype.emitDelegation=function(t,r){var i=this,a=r.propagationPath;this.getEvents();var o;t==="mouseenter"?o=r.fromShape:t==="mouseleave"&&(o=r.toShape);for(var s=function(c){var f=a[c],d=f.get("name");if(d){if((f.isGroup()||f.isCanvas&&f.isCanvas())&&o&&Pze(f,o))return"break";vn(d)?At(d,function(v){i.emitDelegateEvent(f,v,r)}):l.emitDelegateEvent(f,d,r)}},l=this,u=0;u0)});o.length>0?At(o,function(l){var u=l.getBBox(),h=u.minX,c=u.maxX,f=u.minY,d=u.maxY;hr&&(r=c),fa&&(a=d)}):(t=0,r=0,i=0,a=0);var s={x:t,y:i,minX:t,minY:i,maxX:r,maxY:a,width:r-t,height:a-i};return s},e.prototype.getCanvasBBox=function(){var t=1/0,r=-1/0,i=1/0,a=-1/0,o=this.getChildren().filter(function(l){return l.get("visible")&&(!l.isGroup()||l.isGroup()&&l.getChildren().length>0)});o.length>0?At(o,function(l){var u=l.getCanvasBBox(),h=u.minX,c=u.maxX,f=u.minY,d=u.maxY;hr&&(r=c),fa&&(a=d)}):(t=0,r=0,i=0,a=0);var s={x:t,y:i,minX:t,minY:i,maxX:r,maxY:a,width:r-t,height:a-i};return s},e.prototype.getDefaultCfg=function(){var t=n.prototype.getDefaultCfg.call(this);return t.children=[],t},e.prototype.onAttrChange=function(t,r,i){if(n.prototype.onAttrChange.call(this,t,r,i),t==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},e.prototype.applyMatrix=function(t){var r=this.getTotalMatrix();n.prototype.applyMatrix.call(this,t);var i=this.getTotalMatrix();i!==r&&this._applyChildrenMarix(i)},e.prototype._applyChildrenMarix=function(t){var r=this.getChildren();At(r,function(i){i.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],r=0;r=0;s--){var l=t[s];if(HQ(l)&&(l.isGroup()?o=l.getShape(r,i,a):l.isHit(r,i)&&(o=l)),o)break}return o},e.prototype.add=function(t){var r=this.getCanvas(),i=this.getChildren(),a=this.get("timeline"),o=t.getParent();o&&kzt(o,t,!1),t.set("parent",this),r&&Nze(t,r),a&&kze(t,a),i.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var r=this.getTotalMatrix();r&&t.applyMatrix(r)},e.prototype.getChildren=function(){return this.get("children")||[]},e.prototype.sort=function(){var t=this.getChildren();At(t,function(r,i){return r[jQ]=i,r}),t.sort(Fzt(function(r,i){return r.get("zIndex")-i.get("zIndex")})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),r=t.length-1;r>=0;r--)t[r].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),n.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){var r=this.getChildren();return r[t]},e.prototype.getCount=function(){var t=this.getChildren();return t.length},e.prototype.contain=function(t){var r=this.getChildren();return r.indexOf(t)>-1},e.prototype.removeChild=function(t,r){r===void 0&&(r=!0),this.contain(t)&&t.remove(r)},e.prototype.findAll=function(t){var r=[],i=this.getChildren();return At(i,function(a){t(a)&&r.push(a),a.isGroup()&&(r=r.concat(a.findAll(t)))}),r},e.prototype.find=function(t){var r=null,i=this.getChildren();return At(i,function(a){if(t(a)?r=a:a.isGroup()&&(r=a.find(t)),r)return!1}),r},e.prototype.findById=function(t){return this.find(function(r){return r.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(r){return r.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(r){return r.get("name")===t})},e}(Dze),TM=0,gO=0,mP=0,Bze=1e3,y9,yO,m9=0,o2=0,zU=0,VD=typeof performance=="object"&&performance.now?performance:Date,Gze=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function zze(){return o2||(Gze(Bzt),o2=VD.now()+zU)}function Bzt(){o2=0}function XQ(){this._call=this._time=this._next=null}XQ.prototype=hse.prototype={constructor:XQ,restart:function(n,e,t){if(typeof n!="function")throw new TypeError("callback is not a function");t=(t==null?zze():+t)+(e==null?0:+e),!this._next&&yO!==this&&(yO?yO._next=this:y9=this,yO=this),this._call=n,this._time=t,YQ()},stop:function(){this._call&&(this._call=null,this._time=1/0,YQ())}};function hse(n,e,t){var r=new XQ;return r.restart(n,e,t),r}function Gzt(){zze(),++TM;for(var n=y9,e;n;)(e=o2-n._time)>=0&&n._call.call(null,e),n=n._next;--TM}function Fxe(){o2=(m9=VD.now())+zU,TM=gO=0;try{Gzt()}finally{TM=0,Uzt(),o2=0}}function zzt(){var n=VD.now(),e=n-m9;e>Bze&&(zU-=e,m9=n)}function Uzt(){for(var n,e=y9,t,r=1/0;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:y9=t);yO=n,YQ(r)}function YQ(n){if(!TM){gO&&(gO=clearTimeout(gO));var e=n-o2;e>24?(n<1/0&&(gO=setTimeout(Fxe,n-VD.now()-zU)),mP&&(mP=clearInterval(mP))):(mP||(m9=VD.now(),mP=setInterval(zzt,Bze)),TM=1,Gze(Fxe))}}function cse(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function Uze(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function V3(){}var $D=.7,_9=1/$D,WA="\\s*([+-]?\\d+)\\s*",WD="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Vzt=/^#([0-9a-f]{3,8})$/,$zt=new RegExp(`^rgb\\(${WA},${WA},${WA}\\)$`),Wzt=new RegExp(`^rgb\\(${Jy},${Jy},${Jy}\\)$`),Hzt=new RegExp(`^rgba\\(${WA},${WA},${WA},${WD}\\)$`),jzt=new RegExp(`^rgba\\(${Jy},${Jy},${Jy},${WD}\\)$`),Xzt=new RegExp(`^hsl\\(${WD},${Jy},${Jy}\\)$`),Yzt=new RegExp(`^hsla\\(${WD},${Jy},${Jy},${WD}\\)$`),Bxe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};cse(V3,HD,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:Gxe,formatHex:Gxe,formatHex8:qzt,formatHsl:Zzt,formatRgb:zxe,toString:zxe});function Gxe(){return this.rgb().formatHex()}function qzt(){return this.rgb().formatHex8()}function Zzt(){return Vze(this).formatHsl()}function zxe(){return this.rgb().formatRgb()}function HD(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=Vzt.exec(n))?(t=e[1].length,e=parseInt(e[1],16),t===6?Uxe(e):t===3?new pd(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?u5(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?u5(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=$zt.exec(n))?new pd(e[1],e[2],e[3],1):(e=Wzt.exec(n))?new pd(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Hzt.exec(n))?u5(e[1],e[2],e[3],e[4]):(e=jzt.exec(n))?u5(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Xzt.exec(n))?Wxe(e[1],e[2]/100,e[3]/100,1):(e=Yzt.exec(n))?Wxe(e[1],e[2]/100,e[3]/100,e[4]):Bxe.hasOwnProperty(n)?Uxe(Bxe[n]):n==="transparent"?new pd(NaN,NaN,NaN,0):null}function Uxe(n){return new pd(n>>16&255,n>>8&255,n&255,1)}function u5(n,e,t,r){return r<=0&&(n=e=t=NaN),new pd(n,e,t,r)}function Kzt(n){return n instanceof V3||(n=HD(n)),n?(n=n.rgb(),new pd(n.r,n.g,n.b,n.opacity)):new pd}function qQ(n,e,t,r){return arguments.length===1?Kzt(n):new pd(n,e,t,r==null?1:r)}function pd(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}cse(pd,qQ,Uze(V3,{brighter(n){return n=n==null?_9:Math.pow(_9,n),new pd(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?$D:Math.pow($D,n),new pd(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new pd(NE(this.r),NE(this.g),NE(this.b),x9(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Vxe,formatHex:Vxe,formatHex8:Jzt,formatRgb:$xe,toString:$xe}));function Vxe(){return`#${fE(this.r)}${fE(this.g)}${fE(this.b)}`}function Jzt(){return`#${fE(this.r)}${fE(this.g)}${fE(this.b)}${fE((isNaN(this.opacity)?1:this.opacity)*255)}`}function $xe(){const n=x9(this.opacity);return`${n===1?"rgb(":"rgba("}${NE(this.r)}, ${NE(this.g)}, ${NE(this.b)}${n===1?")":`, ${n})`}`}function x9(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function NE(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function fE(n){return n=NE(n),(n<16?"0":"")+n.toString(16)}function Wxe(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Zg(n,e,t,r)}function Vze(n){if(n instanceof Zg)return new Zg(n.h,n.s,n.l,n.opacity);if(n instanceof V3||(n=HD(n)),!n)return new Zg;if(n instanceof Zg)return n;n=n.rgb();var e=n.r/255,t=n.g/255,r=n.b/255,i=Math.min(e,t,r),a=Math.max(e,t,r),o=NaN,s=a-i,l=(a+i)/2;return s?(e===a?o=(t-r)/s+(t0&&l<1?0:o,new Zg(o,s,l,n.opacity)}function Qzt(n,e,t,r){return arguments.length===1?Vze(n):new Zg(n,e,t,r==null?1:r)}function Zg(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}cse(Zg,Qzt,Uze(V3,{brighter(n){return n=n==null?_9:Math.pow(_9,n),new Zg(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?$D:Math.pow($D,n),new Zg(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,i=2*t-r;return new pd(IX(n>=240?n-240:n+120,i,r),IX(n,i,r),IX(n<120?n+240:n-120,i,r),this.opacity)},clamp(){return new Zg(Hxe(this.h),h5(this.s),h5(this.l),x9(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=x9(this.opacity);return`${n===1?"hsl(":"hsla("}${Hxe(this.h)}, ${h5(this.s)*100}%, ${h5(this.l)*100}%${n===1?")":`, ${n})`}`}}));function Hxe(n){return n=(n||0)%360,n<0?n+360:n}function h5(n){return Math.max(0,Math.min(1,n||0))}function IX(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const fse=n=>()=>n;function eUt(n,e){return function(t){return n+t*e}}function tUt(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}function rUt(n){return(n=+n)==1?$ze:function(e,t){return t-e?tUt(e,t,n):fse(isNaN(e)?t:e)}}function $ze(n,e){var t=e-n;return t?eUt(n,t):fse(isNaN(n)?e:n)}const jxe=function n(e){var t=rUt(e);function r(i,a){var o=t((i=qQ(i)).r,(a=qQ(a)).r),s=t(i.g,a.g),l=t(i.b,a.b),u=$ze(i.opacity,a.opacity);return function(h){return i.r=o(h),i.g=s(h),i.b=l(h),i.opacity=u(h),i+""}}return r.gamma=n,r}(1);function Wze(n,e){e||(e=[]);var t=n?Math.min(e.length,n.length):0,r=e.slice(),i;return function(a){for(i=0;it&&(a=e.slice(t,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:ZQ(r,i)})),t=LX.lastIndex;return tu.length?(l=gA(a[s]),u=gA(i[s]),u=Aze(u,l),u=WQ(u,l),e.fromAttrs.path=u,e.toAttrs.path=l):e.pathFormatted||(l=gA(a[s]),u=gA(i[s]),u=WQ(u,l),e.fromAttrs.path=u,e.toAttrs.path=l,e.pathFormatted=!0),r[s]=[];for(var h=0;h0){for(var s=e.animators.length-1;s>=0;s--){if(r=e.animators[s],r.destroyed){e.removeAnimator(s);continue}if(!r.isAnimatePaused()){i=r.get("animations");for(var l=i.length-1;l>=0;l--)a=i[l],t=VUt(r,a,o),t&&(i.splice(l,1),t=!1,a.callback&&a.callback())}i.length===0&&e.removeAnimator(s)}var u=e.canvas.get("autoDraw");u||e.canvas.draw()}})},n.prototype.addAnimator=function(e){this.animators.push(e)},n.prototype.removeAnimator=function(e){this.animators.splice(e,1)},n.prototype.isAnimating=function(){return!!this.animators.length},n.prototype.stop=function(){this.timer&&this.timer.stop()},n.prototype.stopAllAnimations=function(e){e===void 0&&(e=!0),this.animators.forEach(function(t){t.stopAnimate(e)}),this.animators=[],this.canvas.draw()},n.prototype.getTime=function(){return this.current},n}(),WUt=40,rSe=0,nSe=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function iSe(n,e,t){t.name=e,t.target=n,t.currentTarget=n,t.delegateTarget=n,n.emit(e,t)}function HUt(n,e,t){if(t.bubbles){var r=void 0,i=!1;if(e==="mouseenter"?(r=t.fromShape,i=!0):e==="mouseleave"&&(i=!0,r=t.toShape),n.isCanvas()&&i)return;if(r&&Pze(n,r)){t.bubbles=!1;return}t.name=e,t.currentTarget=n,t.delegateTarget=n,n.emit(e,t)}}var jUt=function(){function n(e){var t=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(r){var i=r.type;t._triggerEvent(i,r)},this._onDocumentMove=function(r){var i=t.canvas,a=i.get("el");if(a!==r.target&&(t.dragging||t.currentShape)){var o=t._getPointInfo(r);t.dragging&&t._emitEvent("drag",r,o,t.draggingShape)}},this._onDocumentMouseUp=function(r){var i=t.canvas,a=i.get("el");if(a!==r.target&&t.dragging){var o=t._getPointInfo(r);t.draggingShape&&t._emitEvent("drop",r,o,null),t._emitEvent("dragend",r,o,t.draggingShape),t._afterDrag(t.draggingShape,o,r)}},this.canvas=e.canvas}return n.prototype.init=function(){this._bindEvents()},n.prototype._bindEvents=function(){var e=this,t=this.canvas.get("el");At(nSe,function(r){t.addEventListener(r,e._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},n.prototype._clearEvents=function(){var e=this,t=this.canvas.get("el");At(nSe,function(r){t.removeEventListener(r,e._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},n.prototype._getEventObj=function(e,t,r,i,a,o){var s=new Ize(e,t);return s.fromShape=a,s.toShape=o,s.x=r.x,s.y=r.y,s.clientX=r.clientX,s.clientY=r.clientY,s.propagationPath.push(i),s},n.prototype._getShape=function(e,t){return this.canvas.getShape(e.x,e.y,t)},n.prototype._getPointInfo=function(e){var t=this.canvas,r=t.getClientByEvent(e),i=t.getPointByEvent(e);return{x:i.x,y:i.y,clientX:r.x,clientY:r.y}},n.prototype._triggerEvent=function(e,t){var r=this._getPointInfo(t),i=this._getShape(r,t),a=this["_on"+e],o=!1;if(a)a.call(this,r,i,t);else{var s=this.currentShape;e==="mouseenter"||e==="dragenter"||e==="mouseover"?(this._emitEvent(e,t,r,null,null,i),i&&this._emitEvent(e,t,r,i,null,i),e==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",t,r,null)):e==="mouseleave"||e==="dragleave"||e==="mouseout"?(o=!0,s&&this._emitEvent(e,t,r,s,s,null),this._emitEvent(e,t,r,null,s,null),e==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",t,r,null)):this._emitEvent(e,t,r,i,null,null)}if(o||(this.currentShape=i),i&&!i.get("destroyed")){var l=this.canvas,u=l.get("el");u.style.cursor=i.attr("cursor")||l.get("cursor")}},n.prototype._onmousedown=function(e,t,r){r.button===rSe&&(this.mousedownShape=t,this.mousedownPoint=e,this.mousedownTimeStamp=r.timeStamp),this._emitEvent("mousedown",r,e,t,null,null)},n.prototype._emitMouseoverEvents=function(e,t,r,i){var a=this.canvas.get("el");r!==i&&(r&&(this._emitEvent("mouseout",e,t,r,r,i),this._emitEvent("mouseleave",e,t,r,r,i),(!i||i.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),i&&(this._emitEvent("mouseover",e,t,i,r,i),this._emitEvent("mouseenter",e,t,i,r,i)))},n.prototype._emitDragoverEvents=function(e,t,r,i,a){i?(i!==r&&(r&&this._emitEvent("dragleave",e,t,r,r,i),this._emitEvent("dragenter",e,t,i,r,i)),a||this._emitEvent("dragover",e,t,i)):r&&this._emitEvent("dragleave",e,t,r,r,i),a&&this._emitEvent("dragover",e,t,i)},n.prototype._afterDrag=function(e,t,r){e&&(e.set("capture",!0),this.draggingShape=null),this.dragging=!1;var i=this._getShape(t,r);i!==e&&this._emitMouseoverEvents(r,t,e,i),this.currentShape=i},n.prototype._onmouseup=function(e,t,r){if(r.button===rSe){var i=this.draggingShape;this.dragging?(i&&this._emitEvent("drop",r,e,t),this._emitEvent("dragend",r,e,i),this._afterDrag(i,e,r)):(this._emitEvent("mouseup",r,e,t),t===this.mousedownShape&&this._emitEvent("click",r,e,t),this.mousedownShape=null,this.mousedownPoint=null)}},n.prototype._ondragover=function(e,t,r){r.preventDefault();var i=this.currentShape;this._emitDragoverEvents(r,e,i,t,!0)},n.prototype._onmousemove=function(e,t,r){var i=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(r,e,a,t,!1),this._emitEvent("drag",r,e,o);else{var s=this.mousedownPoint;if(s){var l=this.mousedownShape,u=r.timeStamp,h=u-this.mousedownTimeStamp,c=s.clientX-e.clientX,f=s.clientY-e.clientY,d=c*c+f*f;h>120||d>WUt?l&&l.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",r,e,o),this.mousedownShape=null,this.mousedownPoint=null):!l&&i.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",r,e,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(r,e,a,t),this._emitEvent("mousemove",r,e,t)):(this._emitMouseoverEvents(r,e,a,t),this._emitEvent("mousemove",r,e,t))}else this._emitMouseoverEvents(r,e,a,t),this._emitEvent("mousemove",r,e,t)}},n.prototype._emitEvent=function(e,t,r,i,a,o){var s=this._getEventObj(e,t,r,i,a,o);if(i){s.shape=i,iSe(i,e,s);for(var l=i.getParent();l;)l.emitDelegation(e,s),s.propagationStopped||HUt(l,e,s),s.propagationPath.push(l),l=l.getParent()}else{var u=this.canvas;iSe(u,e,s)}},n.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},n}(),aSe="px",oSe=Oze(),XUt=oSe&&oSe.name==="firefox",qze=function(n){Kn(e,n);function e(t){var r=n.call(this,t)||this;return r.initContainer(),r.initDom(),r.initEvents(),r.initTimeline(),r}return e.prototype.getDefaultCfg=function(){var t=n.prototype.getDefaultCfg.call(this);return t.cursor="default",t.supportCSSTransform=!1,t},e.prototype.initContainer=function(){var t=this.get("container");rr(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t);var r=this.get("container");r.appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new jUt({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new $Ut(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,r){var i=this.get("el");Lxe&&(i.style.width=t+aSe,i.style.height=r+aSe)},e.prototype.changeSize=function(t,r){this.setDOMSize(t,r),this.set("width",t),this.set("height",r),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var r=this.get("el");Lxe&&r&&(r.style.cursor=t)},e.prototype.getPointByEvent=function(t){var r=this.get("supportCSSTransform");if(r){if(XUt&&!an(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!an(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var i=this.getClientByEvent(t),a=i.x,o=i.y;return this.getPointByClient(a,o)},e.prototype.getClientByEvent=function(t){var r=t;return t.touches&&(t.type==="touchend"?r=t.changedTouches[0]:r=t.touches[0]),{x:r.clientX,y:r.clientY}},e.prototype.getPointByClient=function(t,r){var i=this.get("el"),a=i.getBoundingClientRect();return{x:t-a.left,y:r-a.top}},e.prototype.getClientByPoint=function(t,r){var i=this.get("el"),a=i.getBoundingClientRect();return{x:t+a.left,y:r+a.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){var t=this.get("eventController");t.destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var t=this.get("timeline");this.get("destroyed")||(this.clear(),t&&t.stop(),this.clearEvents(),this.removeDom(),n.prototype.destroy.call(this))},e}(Fze),Zze=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var t=n.prototype.clone.call(this),r=this.getChildren(),i=0;i=t&&i.minY<=r&&i.maxY>=r},e.prototype.afterAttrsChange=function(t){n.prototype.afterAttrsChange.call(this,t),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(t){n.prototype.applyMatrix.call(this,t),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),r=this.getTotalMatrix(),i=t.minX,a=t.minY,o=t.maxX,s=t.maxY;if(r){var l=cE(r,[t.minX,t.minY]),u=cE(r,[t.maxX,t.minY]),h=cE(r,[t.minX,t.maxY]),c=cE(r,[t.maxX,t.maxY]);i=Math.min(l[0],u[0],h[0],c[0]),o=Math.max(l[0],u[0],h[0],c[0]),a=Math.min(l[1],u[1],h[1],c[1]),s=Math.max(l[1],u[1],h[1],c[1])}var f=this.attrs;if(f.shadowColor){var d=f.shadowBlur,v=d===void 0?0:d,p=f.shadowOffsetX,g=p===void 0?0:p,m=f.shadowOffsetY,y=m===void 0?0:m,_=i-v+g,x=o+v+g,S=a-v+y,w=s+v+y;i=Math.min(i,_),o=Math.max(o,x),a=Math.min(a,S),s=Math.max(s,w)}return{x:i,y:a,minX:i,minY:a,maxX:o,maxY:s,width:o-i,height:s-a}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,r){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,r){var i=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[t,r,1];o=this.invertFromMatrix(o);var s=o[0],l=o[1],u=this._isInBBox(s,l);return this.isOnlyHitBox()?u:!!(u&&!this.isClipped(s,l)&&(this.isInShape(s,l)||i&&i.isHit(s,l)||a&&a.isHit(s,l)))},e}(Dze),Jze=new Map;function Rm(n,e){Jze.set(n,e)}function Qze(n){return Jze.get(n)}function eUe(n){var e=n.attr(),t=e.x,r=e.y,i=e.width,a=e.height;return{x:t,y:r,width:i,height:a}}function tUe(n){var e=n.attr(),t=e.x,r=e.y,i=e.r;return{x:t-i,y:r-i,width:i*2,height:i*2}}function Hc(n,e,t,r){var i=n-t,a=e-r;return Math.sqrt(i*i+a*a)}function XB(n,e){return Math.abs(n-e)<.001}function XI(n,e){var t=dm(n),r=dm(e),i=fm(n),a=fm(e);return{x:t,y:r,width:i-t,height:a-r}}function UU(n){return(n+Math.PI*2)%(Math.PI*2)}const Fh={box:function(n,e,t,r){return XI([n,t],[e,r])},length:function(n,e,t,r){return Hc(n,e,t,r)},pointAt:function(n,e,t,r,i){return{x:(1-i)*n+i*t,y:(1-i)*e+i*r}},pointDistance:function(n,e,t,r,i,a){var o=(t-n)*(i-n)+(r-e)*(a-e);if(o<0)return Hc(n,e,i,a);var s=(t-n)*(t-n)+(r-e)*(r-e);return o>s?Hc(t,r,i,a):this.pointToLine(n,e,t,r,i,a)},pointToLine:function(n,e,t,r,i,a){var o=[t-n,r-e];if(Koe(o,[0,0]))return Math.sqrt((i-n)*(i-n)+(a-e)*(a-e));var s=[-o[1],o[0]];SS(s,s);var l=[i-n,a-e];return Math.abs(Zoe(l,s))},tangentAngle:function(n,e,t,r){return Math.atan2(r-e,t-n)}};var YUt=1e-4;function rUe(n,e,t,r,i,a){var o,s=1/0,l=[t,r],u=20;a&&a>200&&(u=a/10);for(var h=1/u,c=h/10,f=0;f<=u;f++){var d=f*h,v=[i.apply(null,n.concat([d])),i.apply(null,e.concat([d]))],p=Hc(l[0],l[1],v[0],v[1]);p=0&&p=0?[i]:[]}function lSe(n,e,t,r){return 2*(1-r)*(e-n)+2*r*(t-e)}function nUe(n,e,t,r,i,a,o){var s=Fx(n,t,i,o),l=Fx(e,r,a,o),u=Fh.pointAt(n,e,t,r,o),h=Fh.pointAt(t,r,i,a,o);return[[n,e,u.x,u.y,s,l],[s,l,h.x,h.y,i,a]]}function QQ(n,e,t,r,i,a,o){if(o===0)return(Hc(n,e,t,r)+Hc(t,r,i,a)+Hc(n,e,i,a))/2;var s=nUe(n,e,t,r,i,a,.5),l=s[0],u=s[1];return l.push(o-1),u.push(o-1),QQ.apply(null,l)+QQ.apply(null,u)}const iUe={box:function(n,e,t,r,i,a){var o=sSe(n,t,i)[0],s=sSe(e,r,a)[0],l=[n,i],u=[e,a];return o!==void 0&&l.push(Fx(n,t,i,o)),s!==void 0&&u.push(Fx(e,r,a,s)),XI(l,u)},length:function(n,e,t,r,i,a){return QQ(n,e,t,r,i,a,3)},nearestPoint:function(n,e,t,r,i,a,o,s){return rUe([n,t,i],[e,r,a],o,s,Fx)},pointDistance:function(n,e,t,r,i,a,o,s){var l=this.nearestPoint(n,e,t,r,i,a,o,s);return Hc(l.x,l.y,o,s)},interpolationAt:Fx,pointAt:function(n,e,t,r,i,a,o){return{x:Fx(n,t,i,o),y:Fx(e,r,a,o)}},divide:function(n,e,t,r,i,a,o){return nUe(n,e,t,r,i,a,o)},tangentAngle:function(n,e,t,r,i,a,o){var s=lSe(n,t,i,o),l=lSe(e,r,a,o),u=Math.atan2(l,s);return UU(u)}};function Bx(n,e,t,r,i){var a=1-i;return a*a*a*n+3*e*i*a*a+3*t*i*i*a+r*i*i*i}function uSe(n,e,t,r,i){var a=1-i;return 3*(a*a*(e-n)+2*a*i*(t-e)+i*i*(r-t))}function PX(n,e,t,r){var i=-3*n+9*e-9*t+3*r,a=6*n-12*e+6*t,o=3*e-3*n,s=[],l,u,h;if(XB(i,0))XB(a,0)||(l=-o/a,l>=0&&l<=1&&s.push(l));else{var c=a*a-4*i*o;XB(c,0)?s.push(-a/(2*i)):c>0&&(h=Math.sqrt(c),l=(-a+h)/(2*i),u=(-a-h)/(2*i),l>=0&&l<=1&&s.push(l),u>=0&&u<=1&&s.push(u))}return s}function aUe(n,e,t,r,i,a,o,s,l){var u=Bx(n,t,i,o,l),h=Bx(e,r,a,s,l),c=Fh.pointAt(n,e,t,r,l),f=Fh.pointAt(t,r,i,a,l),d=Fh.pointAt(i,a,o,s,l),v=Fh.pointAt(c.x,c.y,f.x,f.y,l),p=Fh.pointAt(f.x,f.y,d.x,d.y,l);return[[n,e,c.x,c.y,v.x,v.y,u,h],[u,h,p.x,p.y,d.x,d.y,o,s]]}function eee(n,e,t,r,i,a,o,s,l){if(l===0)return qUt([n,t,i,o],[e,r,a,s]);var u=aUe(n,e,t,r,i,a,o,s,.5),h=u[0],c=u[1];return h.push(l-1),c.push(l-1),eee.apply(null,h)+eee.apply(null,c)}const pR={extrema:PX,box:function(n,e,t,r,i,a,o,s){for(var l=[n,o],u=[e,s],h=PX(n,t,i,o),c=PX(e,r,a,s),f=0;f0?t:t*-1}const ZUt={box:function(n,e,t,r){return{x:n-t,y:e-r,width:t*2,height:r*2}},length:function(n,e,t,r){return Math.PI*(3*(t+r)-Math.sqrt((3*t+r)*(t+3*r)))},nearestPoint:function(n,e,t,r,i,a){var o=t,s=r;if(o===0||s===0)return{x:n,y:e};for(var l=i-n,u=a-e,h=Math.abs(l),c=Math.abs(u),f=o*o,d=s*s,v=Math.PI/4,p,g,m=0;m<4;m++){p=o*Math.cos(v),g=s*Math.sin(v);var y=(f-d)*Math.pow(Math.cos(v),3)/o,_=(d-f)*Math.pow(Math.sin(v),3)/s,x=p-y,S=g-_,w=h-y,b=c-_,E=Math.hypot(S,x),T=Math.hypot(b,w),C=E*Math.asin((x*b-S*w)/(E*T)),A=C/Math.sqrt(f+d-p*p-g*g);v+=A,v=Math.min(Math.PI/2,Math.max(0,v))}return{x:n+hSe(p,l),y:e+hSe(g,u)}},pointDistance:function(n,e,t,r,i,a){var o=this.nearestPoint(n,e,t,r,i,a);return Hc(o.x,o.y,i,a)},pointAt:function(n,e,t,r,i){var a=2*Math.PI*i;return{x:n+t*Math.cos(a),y:e+r*Math.sin(a)}},tangentAngle:function(n,e,t,r,i){var a=2*Math.PI*i,o=Math.atan2(r*Math.cos(a),-t*Math.sin(a));return UU(o)}};function KUt(n,e,t,r,i,a,o,s){return-1*t*Math.cos(i)*Math.sin(s)-r*Math.sin(i)*Math.cos(s)}function JUt(n,e,t,r,i,a,o,s){return-1*t*Math.sin(i)*Math.sin(s)+r*Math.cos(i)*Math.cos(s)}function QUt(n,e,t){return Math.atan(-e/n*Math.tan(t))}function eVt(n,e,t){return Math.atan(e/(n*Math.tan(t)))}function cSe(n,e,t,r,i,a){return t*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+n}function fSe(n,e,t,r,i,a){return t*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function tVt(n,e,t,r){var i=Math.atan2(r*n,t*e);return(i+Math.PI*2)%(Math.PI*2)}function dSe(n,e,t){return{x:n*Math.cos(t),y:e*Math.sin(t)}}function vSe(n,e,t){var r=Math.cos(t),i=Math.sin(t);return[n*r-e*i,n*i+e*r]}const rVt={box:function(n,e,t,r,i,a,o){for(var s=QUt(t,r,i),l=1/0,u=-1/0,h=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var f=s+c;au&&(u=d)}for(var v=eVt(t,r,i),p=1/0,g=-1/0,m=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var y=v+c;ag&&(g=_)}return{x:l,y:p,width:u-l,height:g-p}},length:function(n,e,t,r,i,a,o){},nearestPoint:function(n,e,t,r,i,a,o,s,l){var u=vSe(s-n,l-e,-i),h=u[0],c=u[1],f=ZUt.nearestPoint(0,0,t,r,h,c),d=tVt(t,r,f.x,f.y);do&&(f=dSe(t,r,o));var v=vSe(f.x,f.y,i);return{x:v[0]+n,y:v[1]+e}},pointDistance:function(n,e,t,r,i,a,o,s,l){var u=this.nearestPoint(n,e,t,r,s,l);return Hc(u.x,u.y,s,l)},pointAt:function(n,e,t,r,i,a,o,s){var l=(o-a)*s+a;return{x:cSe(n,e,t,r,i,l),y:fSe(n,e,t,r,i,l)}},tangentAngle:function(n,e,t,r,i,a,o,s){var l=(o-a)*s+a,u=KUt(n,e,t,r,i,a,o,l),h=JUt(n,e,t,r,i,a,o,l);return UU(Math.atan2(h,u))}};function oUe(n){for(var e=0,t=[],r=0;r1||e<0||n.length<2)return null;var t=oUe(n),r=t.segments,i=t.totalLength;if(i===0)return{x:n[0][0],y:n[0][1]};for(var a=0,o=null,s=0;s=a&&e<=a+c){var f=(e-a)/c;o=Fh.pointAt(u[0],u[1],h[0],h[1],f);break}a+=c}return o}function aVt(n,e){if(e>1||e<0||n.length<2)return 0;for(var t=oUe(n),r=t.segments,i=t.totalLength,a=0,o=0,s=0;s=a&&e<=a+c){o=Math.atan2(h[1]-u[1],h[0]-u[0]);break}a+=c}return o}function oVt(n,e,t){for(var r=1/0,i=0;i1){var i=uVt(e,t);return e*r+i*(r-1)}return e}function uVt(n,e){return e?e-n:n*.14}function hVt(n,e){var t=lUe(),r=0;if(an(n)||n==="")return r;if(t.save(),t.font=e,rr(n)&&n.includes(` `)){var i=n.split(` `);At(i,function(a){var o=t.measureText(a).width;r1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}At(t,function(a,o){isNaN(a)||(t[o]=+a)}),e[r]=t}),e}function pVt(n,e,t,r){var i=[],a=!!r,o,s,l,u,h,c,f;if(a){l=r[0],u=r[1];for(var d=0,v=n.length;d2&&(t.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([i,o[0]]),s==="r")t.push([i].concat(o));else for(;o.length>=e[s]&&(t.push([i].concat(o.splice(0,e[s]))),!!e[s]););return""}),t}var mVt=/[a-z]/;function gSe(n,e){return[e[0]+(e[0]-n[0]),e[1]+(e[1]-n[1])]}function fUe(n){var e=tee(n);if(!e||!e.length)return[["M",0,0]];for(var t=!1,r=0;r=0){t=!0;break}}if(!t)return e;var a=[],o=0,s=0,l=0,u=0,h=0,c=e[0];(c[0]==="M"||c[0]==="m")&&(o=+c[1],s=+c[2],l=o,u=s,h++,a[0]=["M",o,s]);for(var r=h,f=e.length;r1&&(t*=Math.sqrt(d),r*=Math.sqrt(d));var v=t*t*(f*f)+r*r*(c*c),p=v?Math.sqrt((t*t*(r*r)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var g=r?p*t*f/r:0,m=t?p*-r*c/t:0,y=(s+u)/2+Math.cos(i)*g-Math.sin(i)*m,_=(l+h)/2+Math.sin(i)*g+Math.cos(i)*m,x=[(c-g)/t,(f-m)/r],S=[(-1*c-g)/t,(-1*f-m)/r],w=ySe([1,0],x),b=ySe(x,S);return ree(x,S)<=-1&&(b=Math.PI),ree(x,S)>=1&&(b=0),o===0&&b>0&&(b=b-2*Math.PI),o===1&&b<0&&(b=b+2*Math.PI),{cx:y,cy:_,rx:nee(n,[u,h])?0:t,ry:nee(n,[u,h])?0:r,startAngle:w,endAngle:w+b,xRotation:i,arcFlag:a,sweepFlag:o}}function mSe(n,e){return[e[0]+(e[0]-n[0]),e[1]+(e[1]-n[1])]}function dUe(n){n=vVt(n);for(var e=[],t=null,r=null,i=null,a=0,o=n.length,s=0;sMath.PI/2?Math.PI-u:u,h=h>Math.PI/2?Math.PI-h:h;var c={xExtra:Math.cos(l/2-u)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(h-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0};return c}function SVt(n){var e=n.attr(),t=e.path,r=e.stroke,i=r?e.lineWidth:0,a=n.get("segments")||dUe(t),o=xVt(a,i),s=o.x,l=o.y,u=o.width,h=o.height,c={minX:s,minY:l,maxX:s+u,maxY:l+h};return c=yse(n,c),{x:c.minX,y:c.minY,width:c.maxX-c.minX,height:c.maxY-c.minY}}function wVt(n){var e=n.attr(),t=e.x1,r=e.y1,i=e.x2,a=e.y2,o=Math.min(t,i),s=Math.max(t,i),l=Math.min(r,a),u=Math.max(r,a),h={minX:o,maxX:s,minY:l,maxY:u};return h=yse(n,h),{x:h.minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}}function bVt(n){var e=n.attr(),t=e.x,r=e.y,i=e.rx,a=e.ry;return{x:t-i,y:r-a,width:i*2,height:a*2}}Rm("rect",eUe);Rm("image",eUe);Rm("circle",tUe);Rm("marker",tUe);Rm("polyline",sVt);Rm("polygon",lVt);Rm("text",cVt);Rm("path",SVt);Rm("line",wVt);Rm("ellipse",bVt);var EVt=function(n){Kn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.item=r.item,i.canvasX=r.canvasX,i.canvasY=r.canvasY,i.wheelDelta=r.wheelDelta,i.detail=r.detail,i}return e}(Ize),iee=function(e){return"".concat(e,"-").concat(Math.random()).concat(Date.now())},mse=function(e){if(vn(e))switch(e.length){case 4:return e;case 3:return e.push(e[1]),e;case 2:return e.concat(e);case 1:return[e[0],e[0],e[0],e[0]];default:return[0,0,0,0]}if(on(e))return[e,e,e,e];if(rr(e)){var t=parseInt(e,10);return[t,t,t,t]}return[0,0,0,0]},TVt=function(e){var t=new EVt(e.type,e);return t.clientX=e.clientX,t.clientY=e.clientY,t.x=e.x,t.y=e.y,t.target=e.target,t.currentTarget=e.currentTarget,t.bubbles=!0,t.item=e.item,t},CVt=function(e){if(!e)return!1;for(var t=9,r=[1,0,0,0,1,0,0,0,1],i=0;ir&&(r=c),f>a&&(a=f)}var d=Math.floor(t),v=Math.floor(i),p=Math.ceil(r)-Math.floor(t),g=Math.ceil(a)-Math.floor(i);return{x:d,y:v,width:p,height:g,minX:t,minY:i,maxX:r,maxY:a}},AVt=function(e,t,r,i,a){t===void 0&&(t=15),r===void 0&&(r="quadratic"),i===void 0&&(i=void 0),a===void 0&&(a=void 0);for(var o=e.length,s=t*2,l=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],u={},h=[],c={},f=0;f=0;return t?i?Math.PI*2-r:r:i?r:Math.PI*2-r}Ew.angleTo=OVt;function RVt(n,e,t){return t?(n[0]=e[1],n[1]=-1*e[0]):(n[0]=-1*e[1],n[1]=e[0]),n}Ew.vertical=RVt;var DVt=function(){function n(e){this.destroyed=!1,this.graph=e,this.destroyed=!1}return n.prototype.getViewCenter=function(){var e=this.getFormatPadding(),t=this.graph,r=this.graph.get("width"),i=t.get("height");return{x:(r-e[1]-e[3])/2+e[3],y:(i-e[0]-e[2])/2+e[0]}},n.prototype.fitCenter=function(e,t){var r=this.graph,i=r.get("group"),a,o=r.getNodes();if(o.length>r.get("optimizeThreshold")){var s=1/0,l=1/0,u=-1/0,h=-1/0;o.forEach(function(x){var S=x.getModel(),w=S.x,b=S.y;s>w&&(s=w),l>b&&(l=b),ug&&(m=g,console.warn("fitview failed, ratio out of range, ratio: %f",s,"graph maxzoom has been used instead"));var y=_Se(d,[["t",-a.x,-a.y],["s",m,m],["t",a.x,a.y]]),_=UD({animateCfg:r,callback:function(){e.setMatrix(y),u.emit("viewportchange",{action:"translate",matrix:d}),u.emit("viewportchange",{action:"zoom",matrix:y})}});e.stopAnimate(),e.setMatrix(t),e.animate(function(x){return{matrix:NQ(t,y,x)}},_)}},n.prototype.fitView=function(e,t){var r=this.graph,i=this.getFormatPadding(),a=r.get("width"),o=r.get("height"),s=r.get("group"),l=s.getMatrix()||[1,0,0,0,1,0,0,0,1];s.resetMatrix();var u,h=r.getNodes();if(h.length>r.get("optimizeThreshold")){var c=1/0,f=1/0,d=-1/0,v=-1/0;h.forEach(function(w){var b=w.getModel(),E=b.x,T=b.y;c>E&&(c=E),f>T&&(f=T),dy&&(_=y),e)this.animatedFitView(s,l,t,u,p,g,_,!0);else{var x=p.x-g.x,S=p.y-g.y;if(Py(x)||Py(S))return;r.translate(x,S),r.zoom(_,p)||console.warn("zoom failed, ratio out of range, ratio: %f",_)}}},n.prototype.fitViewByRules=function(e,t,r){var i=e.onlyOutOfViewPort,a=i===void 0?!1:i,o=e.direction,s=o===void 0?"both":o,l=e.ratioRule,u=l===void 0?"min":l,h=this.graph,c=this.getFormatPadding(),f=h.get("width"),d=h.get("height"),v=h.get("group"),p=v.getMatrix()||[1,0,0,0,1,0,0,0,1];v.resetMatrix();var g,m=h.getNodes();if(m.length>h.get("optimizeThreshold")){var y=1/0,_=1/0,x=-1/0,S=-1/0;m.forEach(function(R){var k=R.getModel(),D=k.x,G=k.y;y>D&&(y=D),_>G&&(_=G),xc.maxX&&(c.maxX=p.maxX),p.maxY>c.maxY&&(c.maxY=p.maxY)}if(c.x=c.minX,c.y=c.minY,c.width=c.maxX-c.minX,c.height=c.maxY-c.minY,!(c.width===0||c.height===0)){var g=this.getViewCenter(),m={x:c.x+c.width/2,y:c.y+c.height/2},y=(s-o[1]-o[3])/c.width,_=(l-o[0]-o[2])/c.height,x=y;y>_&&(x=_),r?this.animatedFitView(u,h,i,c,g,m,x,t):(a.translate(g.x-m.x,g.y-m.y),t&&!a.zoom(x,g)&&console.warn("zoom failed, ratio out of range, ratio: %f",x))}}},n.prototype.changeSize=function(e,t){var r=this.graph;if(!on(e)||!on(t))throw Error("invalid canvas width & height, please make sure width & height type is number");r.set({width:e,height:t});var i=r.get("canvas");i.changeSize(e,t);var a=r.get("plugins");a.forEach(function(o){o.get("gridContainer")&&o.positionInit()})},n.prototype.destroy=function(){this.graph=null,this.destroyed=!1},n}();function aee(n){return aee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aee(n)}function xSe(n){if(typeof n!="string")return n;var e=function(b){if(typeof b!="string")return b;try{return JSON.parse(b.trim())}catch{return b.trim()}},t=e(n);if(typeof t!="string")return t;for(var r=function(b){return b[b.length-1]},i=n.trim(),a=[],o=[],s=function(){for(var b=[],E=0;E=0&&(a.height=o),s>=0&&(a.width=s),i.marginTop&&(a.y+=i.marginTop),i.marginLeft&&(a.x+=i.marginLeft),a}function xUe(n,e){var t;e===void 0&&(e={x:0,y:0});var r=ve({x:0,y:0,width:0,height:0},e);if(!((t=n.children)===null||t===void 0)&&t.length){var i=n.attrs,a=i===void 0?{}:i,o=a.marginTop,s=ve({},e);o&&(s.y+=o);for(var l=0;lr.width&&(r.width=h.width+h.x),h.height+h.y>r.height&&(r.height=h.height+h.y)}}}return n.bbox=FVt(n,e,r),n.attrs=ve(ve({},n.attrs),n.bbox),n}function SUe(n,e){var t,r,i,a,o=(n||{}).type,s=((e==null?void 0:e.attrs)||{}).key;if(s&&n&&(n.attrs.key=s),!n&&e)return{action:"delete",val:e,type:o,key:s};if(n&&!e)return{action:"add",val:n,type:o};if(!n&&!e)return{action:"same",type:o};var l=[];if(((t=n.children)===null||t===void 0?void 0:t.length)>0||((r=e.children)===null||r===void 0?void 0:r.length)>0)for(var u=Math.max((i=n.children)===null||i===void 0?void 0:i.length,(a=e.children)===null||a===void 0?void 0:a.length),h=e.children||[],c=n.children||[],f=0;f"u"?i=iee(a):typeof i!="string"&&(i=String(i)),this.get("model").id=i,this.set("id",i);var o=e.group;o&&(o.set("item",this),o.set("id",i)),this.init(),this.draw();var s=r.shape||r.type||(a==="edge"?"line":"circle"),l=this.get("shapeFactory");if(l&&l[s]){var u=l[s].options;if(u&&u.stateStyles){var h=this.get("styles")||r.stateStyles;h=ms({},u.stateStyles,h),this.set("styles",h)}}}return n.prototype.calculateBBox=function(){var e=this.get("keyShape"),t=this.get("group"),r=g9(e,t);return r.x=r.minX,r.y=r.minY,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.centerX=(r.minX+r.maxX)/2,r.centerY=(r.minY+r.maxY)/2,r},n.prototype.calculateCanvasBBox=function(){var e=this.get("keyShape"),t=this.get("group"),r=g9(e,t);return r.x=r.minX,r.y=r.minY,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.centerX=(r.minX+r.maxX)/2,r.centerY=(r.minY+r.maxY)/2,r},n.prototype.drawInner=function(){var e=this,t=e.get("shapeFactory"),r=e.get("group"),i=e.get("model");r.clear();var a=i.visible;if(a!==void 0&&!a&&e.changeVisibility(a),!!t){e.updatePosition(i);var o=e.getShapeCfg(i),s=o.type,l=t.draw(s,o,r);l&&(e.set("keyShape",l),l.set("isKeyShape",!0),l.set("draggable",!0)),this.setOriginStyle(),this.set("currentShape",s),this.restoreStates(t,s)}},n.prototype.setOriginStyle=function(){var e=this.get("group"),t=e.get("children"),r=this.getKeyShape(),i=this,a=r.get("name");if(this.get("originStyle")){var d=this.get("originStyle");a&&!d[a]&&(d[a]={});for(var v=this.getCurrentStatesStyle(),p=function(m){var y=t[m],_=y.get("name"),x=y.attr();if(_&&_!==a){var S=v[_];d[_]||(d[_]={}),S?Object.keys(x).forEach(function(E){var T=x[E];T!==S[E]&&(d[_][E]=T)}):d[_]=y.get("type")!=="image"?Xi(x):i.getShapeStyleByName(_)}else{var w=y.attr(),b={};Object.keys(v).forEach(function(E){var T=v[E];(E===a||!kh(T))&&(b[E]=T)}),Object.keys(w).forEach(function(E){var T=w[E];b[E]!==T&&(a?d[a][E]=T:d[E]=T)})}},s=0;s-1)return;r.push(a)}else l>-1&&r.splice(l,1)}else if(rr(t)){var u=r.filter(function(f){return f.includes(o)});u.length>0&&this.clearStates(u),s=s.filter(function(f){return!f.includes(o)}),s.push(a),this.set("states",s)}if(i){var h=this.get("model"),c=h.type;i.setState(c,e,t,this)}},n.prototype.clearStates=function(e){var t=this,r=t.getStates(),i=t.get("shapeFactory"),a=t.get("model"),o=a.type;e||(e=r),rr(e)&&(e=[e]);var s=r.filter(function(l){return e.indexOf(l)===-1});t.set("states",s),e.forEach(function(l){i.setState(o,l,!1,t)})},n.prototype.setOptimize=function(e){this.optimize=e},n.prototype.getContainer=function(){return this.get("group")},n.prototype.getKeyShape=function(){return this.get("keyShape")},n.prototype.getModel=function(){return this.get("model")},n.prototype.getType=function(){return this.get("type")},n.prototype.getID=function(){return this.get("id")},n.prototype.isItem=function(){return!0},n.prototype.getStates=function(){return this.get("states")},n.prototype.hasState=function(e){var t=this.getStates();return t.indexOf(e)>=0},n.prototype.refresh=function(e){var t=this.get("model");this.updatePosition(t),this.updateShape(e),this.afterUpdate(),this.clearCache()},n.prototype.getUpdateType=function(e){},n.prototype.update=function(e,t){t===void 0&&(t=void 0);var r=this.get("model");if(t==="move")this.updatePosition(e);else{var i=r.visible,a=e.visible;i!==a&&a!==void 0&&this.changeVisibility(a);var o={x:r.x,y:r.y};e.x=isNaN(+e.x)?r.x:+e.x,e.y=isNaN(+e.y)?r.y:+e.y;var s=this.get("styles");if(e.stateStyles){var l=e.stateStyles;_n(s,l),delete e.stateStyles}Object.assign(r,e),(o.x!==e.x||o.y!==e.y)&&this.updatePosition(e),this.updateShape(t)}this.afterUpdate(),this.clearCache()},n.prototype.updateShape=function(e){var t=this.get("shapeFactory"),r=this.get("model"),i=r.type;if(t.shouldUpdate(i)&&i===this.get("currentShape")){var a=this.getShapeCfg(r,e);t.baseUpdate(i,a,this,e),e!=="move"&&this.setOriginStyle()}else this.draw();this.restoreStates(t,i)},n.prototype.updatePosition=function(e){var t=this.get("model"),r=isNaN(+e.x)?+t.x:+e.x,i=isNaN(+e.y)?+t.y:+e.y,a=this.get("group");if(isNaN(r)||isNaN(i))return!1;t.x=r,t.y=i;var o=a.getMatrix();return o&&o[6]===r&&o[7]===i?!1:(a.resetMatrix(),cze(a,{x:r,y:i}),this.clearCache(),!0)},n.prototype.getBBox=function(){var e=this.get(NX);return e||(e=this.calculateBBox(),this.set(NX,e)),e},n.prototype.getCanvasBBox=function(){var e=this.get(kX);return e||(e=this.calculateCanvasBBox(),this.set(kX,e)),e},n.prototype.toFront=function(){var e=this.get("group");e.toFront()},n.prototype.toBack=function(){var e=this.get("group");e.toBack()},n.prototype.show=function(){this.changeVisibility(!0)},n.prototype.hide=function(){this.changeVisibility(!1)},n.prototype.changeVisibility=function(e){var t=this.get("group");e?t.show():t.hide(),this.set("visible",e)},n.prototype.isVisible=function(){return this.get("visible")},n.prototype.enableCapture=function(e){var t=this.get("group");t&&t.set("capture",e)},n.prototype.destroy=function(){if(!this.destroyed){var e=this.get("animate"),t=this.get("group");e&&t.stopAnimate(),t.shapeMap={},this.clearCache(),t.remove(),this._cfg=null,this.destroyed=!0}},n}(),v5={source:"start",target:"end"},iy="Node",lC="Point",GVt="Anchor",bUe=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,r){var i=v5[t]+lC,a=t+iy,o=this.get(a);o&&!o.destroyed&&o.removeEdge(this),kh(r)?(this.set(i,r),this.set(a,null)):r&&(r.addEdge(this),this.set(a,r),this.set(i,null))},e.prototype.getLinkPoint=function(t,r,i){var a=v5[t]+lC,o=t+iy,s=this.get(a);if(!s){var l=this.get(o),u=t+GVt,h=this.getPrePoint(t,i),c=r[u];an(c)||(s=l.getLinkPointByAnchor(c)),s=s||l.getLinkPoint(h),an(s.index)||this.set("".concat(t,"AnchorIndex"),s.index)}return s},e.prototype.getPrePoint=function(t,r){if(r&&r.length){var i=t==="source"?0:r.length-1;return r[i]}var a=t==="source"?"target":"source";return this.getEndPoint(a)},e.prototype.getEndPoint=function(t){var r=t+iy,i=v5[t]+lC,a=this.get(r);return a&&!a.destroyed?a.get("model"):this.get(i)},e.prototype.getControlPointsByCenter=function(t){var r=this.getEndPoint("source"),i=this.getEndPoint("target"),a=this.get("shapeFactory"),o=t.type;return a.getControlPoints(o,{startPoint:r,endPoint:i})},e.prototype.getEndCenter=function(t){var r=t+iy,i=v5[t]+lC,a=this.get(r);if(a){var o=a.getBBox();return{x:o.centerX,y:o.centerY}}return this.get(i)},e.prototype.init=function(){n.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(t,r){var i=this,a=i.get("linkCenter"),o=r!=null&&r.includes("move")?t:n.prototype.getShapeCfg.call(this,t);if(a)o.startPoint=i.getEndCenter("source"),o.endPoint=i.getEndCenter("target");else{var s=o.controlPoints||i.getControlPointsByCenter(o);o.startPoint=i.getLinkPoint("source",t,s),o.endPoint=i.getLinkPoint("target",t,s)}return o.sourceNode=i.get("sourceNode"),o.targetNode=i.get("targetNode"),o},e.prototype.getModel=function(){var t=this.get("model"),r=this.get("source".concat(iy)),i=this.get("target".concat(iy));return r?delete t["source".concat(iy)]:t.source=this.get("start".concat(lC)),i?delete t["target".concat(iy)]:t.target=this.get("end".concat(lC)),!rr(t.source)&&!kh(t.source)&&(t.source=t.source.getID()),!rr(t.target)&&!kh(t.target)&&(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){return!1},e.prototype.update=function(t,r){r===void 0&&(r=void 0);var i=this.get("model"),a=i.visible,o=t.visible;a!==o&&o!==void 0&&this.changeVisibility(o);var s=this.get("source"),l=this.get("target");if(!(!s||s.destroyed||!l||l.destroyed)){var u=this.get("styles");if(t.stateStyles){var h=t.stateStyles;_n(u,h),delete t.stateStyles}Object.assign(i,t),this.updateShape(r),this.afterUpdate(),this.clearCache()}},e.prototype.destroy=function(){var t=this.get("source".concat(iy)),r=this.get("target".concat(iy));t&&!t.destroyed&&t.removeEdge(this),r&&!r.destroyed&&r.removeEdge(this),n.prototype.destroy.call(this)},e}(wUe),FX="anchorPointsCache",zVt="bboxCache",_se=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getNearestPoint=function(t,r){for(var i=0,a=t[0],o=v9(t[0],r),s=0;s-1&&r.splice(i,1)},e.prototype.clearCache=function(){this.set(zVt,null),this.set(FX,null)},e.prototype.getUpdateType=function(t){var r,i,a,o,s;if(!!t){var l=!an(t.x),u=!an(t.y),h=Object.keys(t);if(h.length===1&&(l||u)||h.length===2&&l&&u)return"move";if(on(t.x)||on(t.y)||t.type||t.anchorPoints||t.size||(t==null?void 0:t.style)&&(((r=t==null?void 0:t.style)===null||r===void 0?void 0:r.r)||((i=t==null?void 0:t.style)===null||i===void 0?void 0:i.width)||((a=t==null?void 0:t.style)===null||a===void 0?void 0:a.height)||((o=t==null?void 0:t.style)===null||o===void 0?void 0:o.rx)||((s=t==null?void 0:t.style)===null||s===void 0?void 0:s.ry)))return"bbox|label";var c=h.includes("label")||h.includes("labelCfg");return c?"style|label":"style"}},e.prototype.setState=function(t,r){var i=this;if(this.optimize){n.prototype.setState.call(this,t,r);return}this.runWithBBoxAffected(function(){return n.prototype.setState.call(i,t,r)})},e.prototype.clearStates=function(t){var r=this;if(this.optimize){n.prototype.clearStates.call(this,t);return}this.runWithBBoxAffected(function(){return n.prototype.clearStates.call(r,t)})},e.prototype.runWithBBoxAffected=function(t){var r=["r","width","height","rx","ry","lineWidth"],i=this.getKeyShape().attr(),a={};Object.keys(this.getKeyShape().attr()).forEach(function(u){r.includes(u)&&(a[u]=i[u])}),t();for(var o=this.getKeyShape().attr(),s=0;s-1?(r.splice(i,1),!0):!1}},e.prototype.removeNode=function(t){if(!!t){var r=this.getNodes(),i=r.indexOf(t);return i>-1?(r.splice(i,1),!0):!1}},e.prototype.getUpdateType=function(t){},e.prototype.getBBox=function(){this.set(ESe,null);var t=this.calculateCanvasBBox();return t},e.prototype.clearCache=function(){this.set(bSe,null),this.set(ESe,null),this.set(TSe,null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),r=this.get("group");t&&r.stopAnimate(),r.shapeMap={},this.clearCache(),this.set(p5,null),this.set("bbox",null),r.remove(),this._cfg=null,this.destroyed=!0}},e}(_se),g5="node",y5="edge",CSe="vedge",_P="combo",UVt="default",ASe="Mapper",Jm="stateStyles",VVt=function(){function n(e){var t=this;this.edgeToBeUpdateMap={},this.throttleRefresh=FD(function(r){var i=t.graph;if(!(!i||i.get("destroyed"))){var a=t.edgeToBeUpdateMap;if(!!a){var o=Object.values(a);!o.length||(o.forEach(function(s){var l=s.edge;if(!(!l||l.destroyed)){var u=l.getSource(),h=l.getTarget();!u||u.destroyed||!h||h.destroyed||l.refresh(s.updateType)}}),t.edgeToBeUpdateMap={})}}},16,{trailing:!0,leading:!0}),this.graph=e,this.destroyed=!1}return n.prototype.addItem=function(e,t){var r=this.graph,i=e===CSe?y5:e,a=r.get("".concat(i,"Group"))||r.get("group"),o=EM(i),s=null,l=r.get(i+EM(Jm))||{},u=r.get(UVt+o);t[Jm]&&(l=t[Jm]),u&&At(u,function(w,b){Wh(w)&&!vn(w)?t[b]=ms({},w,t[b]):vn(w)?t[b]=t[b]||Xi(u[b]):t[b]=t[b]||u[b]});var h=r.get(i+ASe);if(h){var c=h(t);c[Jm]&&(l=c[Jm],delete c[Jm]),At(c,function(w,b){Wh(w)&&!vn(w)?t[b]=ms({},t[b],w):t[b]=c[b]||t[b]})}if(r.emit("beforeadditem",{type:e,model:t}),e===y5||e===CSe){var f=void 0,d=void 0;if(f=t.source,d=t.target,f&&rr(f)&&(f=r.findById(f)),d&&rr(d)&&(d=r.findById(d)),!f||!d){console.warn("The source or target node of edge ".concat(t.id," does not exist!"));return}f.getType&&f.getType()==="combo"&&(t.isComboEdge=!0),d.getType&&d.getType()==="combo"&&(t.isComboEdge=!0),s=new bUe({model:t,source:f,target:d,styles:l,linkCenter:r.get("linkCenter"),group:a.addGroup()})}else if(e===g5)s=new _se({model:t,styles:l,group:a.addGroup()});else if(e===_P){var v=t.children,p=HB(v,r),g=void 0,m=void 0;if(isNaN(p.x)?isNaN(t.x)&&(g=Math.random()*100):g=p.x,isNaN(p.y)?isNaN(t.y)&&(m=Math.random()*100):m=p.y,isNaN(t.x)||isNaN(t.y))t.x=g,t.y=m;else{var y=t.x-g,_=t.y-m;this.updateComboSucceeds(t.id,y,_,v)}var x=a.addGroup();x.setZIndex(t.depth),s=new EUe({model:t,styles:l,animate:r.get("animate"),bbox:t.collapsed?HB([],r):p,group:x}),!t.collapsed&&s.getKeyShape().get("type")==="circle"&&(p.width=Math.hypot(p.height,p.width),p.height=p.width,s.set("bbox",p),s.refresh());var S=s.getModel();(v||[]).forEach(function(w){var b=r.findById(w.id);s.addChild(b),w.depth=S.depth+2})}if(s)return s.setOptimize(r.getNodes().length>r.get("optimizeThreshold")),r.get("".concat(e,"s")).push(s),r.get("itemMap")[s.get("id")]=s,r.emit("afteradditem",{item:s,model:t}),s},n.prototype.updateItem=function(e,t){var r=this,i,a,o=this.graph;if(rr(e)&&(e=o.findById(e)),!(!e||e.destroyed)){var s="";e.getType&&(s=e.getType());var l=o.get(s+ASe),u=e.getModel(),h=u.x,c=u.y,f=e.getUpdateType(t);if(l){var d=ms({},u,t),v=l(d),p=ms({},u,v,t);v[Jm]&&(e.set("styles",p[Jm]),delete p[Jm]),At(p,function(C,A){t[A]=C})}else At(t,function(C,A){u[A]&&Wh(C)&&!vn(C)&&(t[A]=ve(ve({},u[A]),t[A]))});if(o.emit("beforeupdateitem",{item:e,cfg:t}),s===y5){if(t.source){var g=t.source;rr(g)&&(g=o.findById(g)),e.setSource(g)}if(t.target){var m=t.target;rr(m)&&(m=o.findById(m)),e.setTarget(m)}e.update(t)}else if(s===g5){e.update(t,f);var y=e.getEdges();f==="move"?At(y,function(C){r.edgeToBeUpdateMap[C.getID()]={edge:C,updateType:f},r.throttleRefresh()}):f!=null&&f.includes("bbox")&&At(y,function(C){C.refresh(f)})}else if(s===_P){if(e.update(t,f),!isNaN(t.x)||!isNaN(t.y)){var _=t.x-h||0,x=t.y-c||0;this.updateComboSucceeds(u.id,_,x)}var S=e.getEdges(),w=(f==null?void 0:f.includes("bbox"))||f==="move";if(w&&s===_P){var b=e.get("shapeFactory"),E=u.type||"circle",T=u.animate===void 0||t.animate===void 0?(a=(i=b[E])===null||i===void 0?void 0:i.options)===null||a===void 0?void 0:a.animate:u.animate||t.animate;T?setTimeout(function(){if(!(!e||e.destroyed)){var C=e.getKeyShape();!C||C.destroyed||At(S,function(A){A&&!A.destroyed&&A.refresh()})}},201):At(S,function(C){C.refresh()})}}e.setOptimize(o.getNodes().length>o.get("optimizeThreshold")),o.emit("afterupdateitem",{item:e,cfg:t})}},n.prototype.updateCombo=function(e,t,r){var i=this,a,o,s=this.graph;if(rr(e)&&(e=s.findById(e)),!(!e||e.destroyed)){var l=e.getModel(),u=HB(t,s,e),h=u.x,c=u.y;e.set("bbox",u);var f=h,d=c;r?(f=isNaN(l.x)?h:l.x,d=isNaN(l.y)?c:l.y):(f=isNaN(h)?l.x:h,d=isNaN(c)?l.y:c),e.update({x:f,y:d});var v=e.get("shapeFactory"),p=l.type||"circle",g=l.animate===void 0?(o=(a=v[p])===null||a===void 0?void 0:a.options)===null||o===void 0?void 0:o.animate:l.animate;g?setTimeout(function(){if(!(!e||e.destroyed)){var m=e.getKeyShape();!m||m.destroyed||(e.getShapeCfg(l),i.updateComboEdges(e))}},201):this.updateComboEdges(e)}},n.prototype.updateComboEdges=function(e){for(var t,r,i=e.getEdges()||[],a=0;a-1&&o.splice(s,1),a===y5){var l=r.get("v".concat(a,"s")),u=l.indexOf(e);u>-1&&l.splice(u,1)}var h=e.get("id"),c=r.get("itemMap");delete c[h];var f=r.get("comboTrees"),d=e.get("id");if(a===g5){var v=e.getModel().comboId;if(f&&v){var p=f,g=!1;f.forEach(function(w){g||Fc(w,function(b){if(b.id===d&&p){var E=p.indexOf(b);return p.splice(E,1),g=!0,!1}return p=b.children,!0})})}for(var m=e.getEdges(),y=m.length-1;y>=0;y--)r.removeItem(m[y],!1);v&&r.updateCombo(v)}else if(a===_P){var _=e.getModel().parentId,x,S=!1;(f||[]).forEach(function(b){S||Fc(b,function(E){return E.id===d?(x=E,S=!0,!1):!0})}),x.removed=!0,x&&x.children&&x.children.forEach(function(b){t.removeItem(b.id)});for(var m=e.getEdges(),y=m.length;y>=0;y--)r.removeItem(m[y],!1);_&&r.updateCombo(_)}e.destroy(),r.emit("afterremoveitem",{item:i,type:a})}},n.prototype.setItemState=function(e,t,r){var i=this.graph,a=t;rr(r)&&(a="".concat(t,":").concat(r)),!(e.hasState(a)===r&&r||rr(r)&&e.hasState(a))&&(i.emit("beforeitemstatechange",{item:e,state:a,enabled:r}),e.setState(t,r),i.autoPaint(),i.emit("afteritemstatechange",{item:e,state:a,enabled:r}))},n.prototype.priorityState=function(e,t){var r=this.graph,i=e;rr(e)&&(i=r.findById(e)),this.setItemState(i,t,!1),this.setItemState(i,t,!0)},n.prototype.clearItemStates=function(e,t){var r=this.graph;rr(e)&&(e=r.findById(e)),r.emit("beforeitemstatesclear",{item:e,states:t}),e.clearStates(t),r.emit("afteritemstatesclear",{item:e,states:t})},n.prototype.refreshItem=function(e){var t=this.graph;rr(e)&&(e=t.findById(e)),t.emit("beforeitemrefresh",{item:e}),e.refresh(),t.emit("afteritemrefresh",{item:e})},n.prototype.addCombos=function(e,t){var r=this,i=this.graph;(e||[]).forEach(function(o){xy(o,function(s){var l;return t.forEach(function(u){u.id===s.id&&(u.children=s.children,u.depth=s.depth,l=u)}),l&&r.addItem("combo",l),!0})});var a=i.get("comboGroup");a&&a.sort()},n.prototype.changeItemVisibility=function(e,t){var r=this,i=this.graph;if(rr(e)&&(e=i.findById(e)),!e){console.warn("The item to be shown or hidden does not exist!");return}if(i.emit("beforeitemvisibilitychange",{item:e,visible:t}),e.changeVisibility(t),e.getType&&e.getType()===g5){var a=e.getEdges();At(a,function(h){t&&!(h.get("source").isVisible()&&h.get("target").isVisible())||r.changeItemVisibility(h,t)})}else if(e.getType&&e.getType()===_P){var o=i.get("comboTrees"),s=e.get("id"),l=[],u=!1;(o||[]).forEach(function(c){u||!c.children||c.children.length===0||Fc(c,function(f){return f.id===s?(l=f.children,u=!0,!1):!0})}),l&&(!t||t&&!e.getModel().collapsed)&&l.forEach(function(c){var f=i.findById(c.id);r.changeItemVisibility(f,t)});var a=e.getEdges();At(a,function(c){t&&!(c.get("source").isVisible()&&c.get("target").isVisible())||r.changeItemVisibility(c,t)})}return i.emit("afteritemvisibilitychange",{item:e,visible:t}),e},n.prototype.destroy=function(){this.graph=null,this.destroyed=!0},n}(),$Vt=function(){function n(e){this.graph=e,this.destroyed=!1}return n.prototype.updateState=function(e,t,r){var i=this.graph.get("states"),a=t;rr(r)&&(a="".concat(t,":").concat(r)),i[a]||(i[a]=[]),r?i[a].push(e):i[a]=i[a].filter(function(o){return o!==e}),this.graph.set("states",i),this.graph.emit("graphstatechange",{states:i})},n.prototype.updateStates=function(e,t,r){var i=this.graph.get("states"),a=rr(t)?[t]:t;a.forEach(function(o){var s=o;i[s]||(i[s]=[]),rr(r)&&(s="".concat(o,":").concat(r)),r?i[s].push(e):i[s]=i[s].filter(function(l){return l!==e})}),this.graph.set("states",i),this.graph.emit("graphstatechange",{states:t})},n.prototype.destroy=function(){this.graph=null,this.destroyed=!0},n}(),WVt=function(e,t){return!e||!t?e:e.replace(/\\?\{([^{}]+)\}/g,function(r,i){if(r.charAt(0)==="\\")return r.slice(1);var a=t[i];return a===0&&(a="0"),a||""})},TUe=function(e){var t=[];if(e.length<2)throw new Error("point length must largn than 2, now it's ".concat(e.length));for(var r=0,i=e;r0?o-1:t-1,l=SS([0,0],Oh([0,0],a[s].v,Gc([0,0],a[o].v,-1)));a[o].p=Oh([0,0],a[o].p,Gc([0,0],l,e))}return a.map(function(u){var h=u.p;return{x:h[0],y:h[1]}})}var jVt=function(e,t){for(var r=[],i=0;i<5;i++){var a=Math.cos((18+72*i)/180*Math.PI)*e,o=Math.sin((18+72*i)/180*Math.PI)*e,s=Math.cos((54+72*i)/180*Math.PI)*t,l=Math.sin((54+72*i)/180*Math.PI)*t;i===0?r.push(["M",a,-o]):r.push(["L",a,-o]),r.push(["L",s,-l])}return r.push(["Z"]),r};const XVt=Object.freeze(Object.defineProperty({__proto__:null,getSpline:TUe,getControlPoint:w9,pointsToPolygon:HVt,pathToPoints:oee,getClosedSpline:see,roundedHull:lee,paddedHull:CUe,getStarPath:jVt},Symbol.toStringTag,{value:"Module"}));var PSe=function(e,t,r){return(e.y-r.y)*(t.x-r.x)-(e.x-r.x)*(t.y-r.y)},OSe=function(e){var t=e.map(function(c){return{x:c.getModel().x,y:c.getModel().y}});t.sort(function(c,f){return c.x===f.x?c.y-f.y:c.x-f.x});for(var r={},i=t.length-1;i>=0;i--){var a=t[i],o=a.x,s=a.y;r["".concat(o,"-").concat(s)]&&t.splice(i,1),r["".concat(o,"-").concat(s)]=!0}if(t.length===1)return t;for(var l=[],i=0;i=2&&PSe(l[l.length-2],l[l.length-1],t[i])<=0;)l.pop();l.push(t[i])}for(var u=[],i=t.length-1;i>=0;i--){for(;u.length>=2&&PSe(u[u.length-2],u[u.length-1],t[i])<=0;)u.pop();u.push(t[i])}u.pop(),l.pop();var h=l.concat(u);return h},YVt={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function qVt(n,e,t){var r=!1,i=function(l,u){return e.cells[l+u*e.width]},a=function(l,u){var h=0;return i(l-1,u-1)>=t&&(h+=1),i(l,u-1)>t&&(h+=2),i(l-1,u)>t&&(h+=4),i(l,u)>t&&(h+=8),h},o=function(l,u){for(var h=l,c=u,f,d,v=0;v-1){if(!(n[0].x!==h||n[0].y!==c))return!0}else n.push({x:h,y:c});var p=a(h,c);switch(p){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:h++;break;case 12:case 14:case 4:h--;break;case 6:f===0&&(d===-1?h-=1:h+=1);break;case 1:case 13:case 5:c--;break;case 9:f===1&&(d===0?c-=1:c+=1);break;case 10:case 8:case 11:c++;break;default:return console.warn("Marching squares invalid state: ".concat(p)),!0}}};this.march=function(){for(var s=0;st&&a(s,l)!==15&&(r=o(s,l));return r}}var ZVt=function(e,t,r){var i=Math.ceil(e/r),a=Math.ceil(t/r),o=new Float32Array(Math.max(0,i*a)).fill(0);return{cells:o,width:i,height:a}},KVt=function(e,t,r){var i=null,a=Number.POSITIVE_INFINITY;return t.forEach(function(o){var s={x:e.getModel().x,y:e.getModel().y},l={x:o.getModel().x,y:o.getModel().y},u=p9(s,l),h=new a2(s.x,s.y,l.x,l.y),c=r.reduce(function(f,d){return lse(d,h)>0?f+1:f},0);u*Math.pow(c+1,2)=0&&o=1;)S/=1.5,w=RSe(v,S,g,x),b=u(w,o)||u(w,a),E=h(w,t);w&&!b&&(!x||!E)&&(o.push(new a2(d.x1,d.y1,w.x,w.y)),o.push(new a2(w.x,w.y,d.x2,d.y2)),s=!0)};y(!0),s||y(!1)}}s||a.push(d),l+=1};!s&&o.length;)c()}for(;o.length;)a.push(o.pop());return a};function QVt(n,e,t,r,i){var a=KVt(n,t,e);if(a===null)return[];var o=function(c){for(var f=[];c.length>0;){var d=c.pop();if(c.length===0){f.push(d);break}var v=c.pop(),p=new a2(d.x1,d.y1,v.x2,v.y2),g=AUe(e,p);g?(f.push(d),c.push(v)):c.push(p)}return f},s=new a2(n.getModel().x,n.getModel().y,a.getModel().x,a.getModel().y),l=JVt(s,e,r,i),u=o(l);return u}var e$t=function(e,t,r){var i=Object.assign(YVt,r),a=pze(e.map(function(y){return{x:y.getModel().x,y:y.getModel().y}}));e=e.sort(function(y,_){return p9({x:y.getModel().x,y:y.getModel().y},a)-p9({x:_.getModel().x,y:_.getModel().y},a)});var o=[],s=[];e.forEach(function(y){var _=QVt(y,t,o,i.maxRoutingIterations,i.morphBuffer);_.forEach(function(x){s.push(x)}),o.push(y)});for(var l=t$t(e,s,i.nodeR0),u=ZVt(l.width,l.height,i.pixelGroupSize),h=[],c=[],f=0;f1)for(v=Math.floor(d.length/i.skip);v<3&&i.skip>1;)i.skip-=1,v=Math.floor(d.length/i.skip);for(var p=0,g=0;g0)i.nonMemberInfluenceFactor*=.8;else break}return c};function t$t(n,e,t){var r={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},i=[];n.forEach(function(l){i.push(l.getBBox())}),e.forEach(function(l){i.push(l.getBBox())});for(var a=0,o=i;ar.maxX?s.maxX:r.maxX)+t,r.maxY=(s.maxY>r.maxY?s.maxY:r.maxY)+t}return r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.x=r.minX,r.y=r.minY,r}function r$t(n,e,t,r,i,a){function o(d,v){var p=Math.floor((d-v)/a.pixelGroupSize);return p<0?0:p}function s(d,v){return d*a.pixelGroupSize+v}var l=(a.nodeR0-a.nodeR1)*(a.nodeR0-a.nodeR1),u=(a.edgeR0-a.edgeR1)*(a.edgeR0-a.edgeR1),h=function(v,p){var g=Math.min(o(v.minX,p+r.minX),i.width),m=Math.min(o(v.minY,p+r.minY),i.height),y=Math.min(o(v.maxX,-p+r.minX),i.width),_=Math.min(o(v.maxY,-p+r.minY),i.height);return[g,m,y,_]},c=function(v,p){for(var g=v.getBBox(),m=h(g,a.nodeR1),y=m[0],_=m[1],x=m[2],S=m[3],w=_;wl.y?r?u.topLeft:u.bottomRight:r?u.topRight:u.bottomLeft:o.ys.x?r?u.topLeft:u.bottomRight:r?u.bottomLeft:u.topRight:a.x0?this.cfg.padding+e:10+e,this.cfg.bubbleCfg={nodeR0:this.padding-e,nodeR1:this.padding-e,morphBuffer:this.padding-e}},n.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),this.type!=="round-convex"&&this.type!=="smooth-convex"&&this.type!=="bubble"&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},n.prototype.calcPath=function(e,t){var r,i,a;switch(this.type){case"round-convex":r=OSe(e),a=lee(r.map(function(o){return[o.x,o.y]}),this.padding),i=tee(a);break;case"smooth-convex":r=OSe(e),r.length===2?(a=lee(r.map(function(o){return[o.x,o.y]}),this.padding),i=tee(a)):r.length>2&&(a=CUe(r.map(function(o){return[o.x,o.y]}),this.padding),i=see(a));break;case"bubble":r=e$t(e,t,this.cfg.bubbleCfg),i=r.length>=2&&see(r);break}return i},n.prototype.render=function(){this.group.addShape("path",{attrs:ve({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id,capture:!1}),this.group.toBack()},n.prototype.addMember=function(e){if(!!e){rr(e)&&(e=this.graph.findById(e)),this.members.push(e);var t=this.nonMembers.indexOf(e);return t>-1&&this.nonMembers.splice(t,1),this.updateData(this.members,this.nonMembers),!0}},n.prototype.addNonMember=function(e){if(!!e){rr(e)&&(e=this.graph.findById(e)),this.nonMembers.push(e);var t=this.members.indexOf(e);return t>-1&&this.members.splice(t,1),this.updateData(this.members,this.nonMembers),!0}},n.prototype.removeMember=function(e){if(!!e){rr(e)&&(e=this.graph.findById(e));var t=this.members.indexOf(e);return t>-1?(this.members.splice(t,1),this.updateData(this.members,this.nonMembers),!0):!1}},n.prototype.removeNonMember=function(e){if(!!e){rr(e)&&(e=this.graph.findById(e));var t=this.nonMembers.indexOf(e);return t>-1?(this.nonMembers.splice(t,1),this.updateData(this.members,this.nonMembers),!0):!1}},n.prototype.updateData=function(e,t){var r=this;this.group.findById(this.id).remove(),e&&(this.members=e.map(function(i){return rr(i)?r.graph.findById(i):i})),t&&(this.nonMembers=t.map(function(i){return rr(i)?r.graph.findById(i):i})),this.path=this.calcPath(this.members,this.nonMembers),this.render()},n.prototype.updateStyle=function(e){var t=this.group.findById(this.id);t.attr(ve({},e))},n.prototype.updateCfg=function(e){var t=this;this.cfg=ms(this.cfg,e),this.id=this.cfg.id,this.group=this.cfg.group,e.members&&(this.members=this.cfg.members.map(function(r){return rr(r)?t.graph.findById(r):r})),e.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map(function(r){return rr(r)?t.graph.findById(r):r})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},n.prototype.contain=function(e){var t=this,r;rr(e)?r=this.graph.findById(e):r=e;var i,a=r.getKeyShape();if(r.get("type")==="path")i=oee(a.attr("path"));else{var o=a.getCanvasBBox();i=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return i=i.map(function(s){var l=t.graph.getPointByCanvas(s[0],s[1]);return[l.x,l.y]}),dze(i,oee(this.path))},n.prototype.destroy=function(){this.group.remove(),this.cfg=null},n}(),xP=sg,n$t="node",IUe=function(n){Kn(e,n);function e(t){var r=n.call(this)||this;return r.sortCombos=U3(function(){var i=r.get("comboSorted");if(!(!r||r.destroyed||i)){r.set("comboSorted",!0);var a=[],o={},s=r.get("comboTrees");(s||[]).forEach(function(u){Fc(u,function(h){return a[h.depth]?a[h.depth].push(h.id):a[h.depth]=[h.id],o[h.id]=h.depth,!0})});var l=r.getEdges().concat(r.get("vedges"));(l||[]).forEach(function(u){var h=u.getModel(),c=o[h.source]||0,f=o[h.target]||0,d=Math.max(c,f);a[d]?a[d].push(h.id):a[d]=[h.id]}),a.forEach(function(u){if(!(!u||!u.length))for(var h=u.length-1;h>=0;h--){var c=r.findById(u[h]);c&&c.toFront()}})}},500,!1),r.cfg=ms(r.getDefaultCfg(),t),r.init(),r.animating=!1,r.destroyed=!1,r.cfg.enabledStack&&(r.undoStack=new pA(r.cfg.maxStep),r.redoStack=new pA(r.cfg.maxStep)),r}return e.prototype.init=function(){this.initCanvas();var t=new DVt(this),r=new K7t(this),i=new VVt(this),a=new $Vt(this);this.set({viewController:t,modeController:r,itemController:i,stateController:a}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},e.prototype.initGroups=function(){var t=this.get("canvas");if(!!t){var r=t.get("el"),i=(r||{}).id,a=i===void 0?"g6":i,o=t.addGroup({id:"".concat(a,"-root"),className:tn.rootContainerClassName});if(this.get("groupByTypes")){var s=o.addGroup({id:"".concat(a,"-edge"),className:tn.edgeContainerClassName}),l=o.addGroup({id:"".concat(a,"-node"),className:tn.nodeContainerClassName}),u=o.addGroup({id:"".concat(a,"-combo"),className:tn.comboContainerClassName});u.toBack(),this.set({nodeGroup:l,edgeGroup:s,comboGroup:u})}var h=o.addGroup({id:"".concat(a,"-delegate"),className:tn.delegateContainerClassName});this.set({delegateGroup:h}),this.set("group",o)}},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.02,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[],optimizeThreshold:1e3}},e.prototype.set=function(t,r){return kh(t)?this.cfg=ve(ve({},this.cfg),t):this.cfg[t]=r,t==="enabledStack"&&r&&!this.undoStack&&!this.redoStack&&(this.undoStack=new pA(this.cfg.maxStep),this.redoStack=new pA(this.cfg.maxStep)),this},e.prototype.get=function(t){var r;return(r=this.cfg)===null||r===void 0?void 0:r[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,r){rr(t)&&(t=this.findById(t));var i=this.get("itemController");r||(r=t.get("states")),i.clearItemStates(t,r);var a=this.get("stateController");a.updateStates(t,r,!1)},e.prototype.node=function(t){typeof t=="function"&&this.set("nodeMapper",t)},e.prototype.edge=function(t){typeof t=="function"&&this.set("edgeMapper",t)},e.prototype.combo=function(t){typeof t=="function"&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,r){var i,a=this.get("".concat(t,"s"));return At(a,function(o,s){if(r(o,s))return i=o,i}),i},e.prototype.findAll=function(t,r){var i=[];return At(this.get("".concat(t,"s")),function(a,o){r(a,o)&&i.push(a)}),i},e.prototype.findAllByState=function(t,r,i){return i?this.findAll(t,function(a){return a.hasState(r)&&i(a)}):this.findAll(t,function(a){return a.hasState(r)})},e.prototype.translate=function(t,r,i,a){var o=this,s=this.get("group"),l=Xi(s.getMatrix());if(l||(l=[1,0,0,0,1,0,0,0,1]),i){var u=UD({animateCfg:a,callback:function(){return o.emit("viewportchange",{action:"translate",matrix:s.getMatrix()})}});RQ(s,{x:s.getCanvasBBox().x+t,y:s.getCanvasBBox().y+r},i,u||{duration:500,easing:"easeCubic"})}else l=xP(l,[["t",t,r]]),s.setMatrix(l),this.emit("viewportchange",{action:"translate",matrix:l}),this.autoPaint()},e.prototype.moveTo=function(t,r,i,a){var o=this.get("group");RQ(o,{x:t,y:r},i,a||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:o.getMatrix()})},e.prototype.fitView=function(t,r,i,a){t&&this.set("fitViewPadding",t);var o=this.get("viewController");r?o.fitViewByRules(r,i,a):o.fitView(i,a),this.autoPaint()},e.prototype.fitCenter=function(t,r){var i=this.get("viewController");i.fitCenter(t,r),this.autoPaint()},e.prototype.addBehaviors=function(t,r){var i=this.get("modeController");return i.manipulateBehaviors(t,r,!0),this},e.prototype.removeBehaviors=function(t,r){var i=this.get("modeController");return i.manipulateBehaviors(t,r,!1),this},e.prototype.updateBehavior=function(t,r,i){var a=this.get("modeController");return a.updateBehavior(t,r,i),this},e.prototype.zoom=function(t,r,i,a){var o=this,s=this.get("group"),l=Xi(s.getMatrix())||[1,0,0,0,1,0,0,0,1],u=this.get("minZoom"),h=this.get("maxZoom"),c=this.getZoom()||1,f=c*t,d=t,v=!1;if(u&&fh&&(d=h/c,v=!0),r?l=xP(l,[["t",-r.x,-r.y],["s",d,d],["t",r.x,r.y]]):l=xP(l,[["s",d,d]]),i){var p=Xi(s.getMatrix());p||(p=[1,0,0,0,1,0,0,0,1]);var g=p[0],m=g*d,y=UD({animateCfg:a,callback:function(){return o.emit("viewportchange",{action:"zoom",matrix:s.getMatrix()})}});s.animate(function(_){if(_===1)p=l;else{var x=use(g,m,_)/p[0];r?p=xP(p,[["t",-r.x,-r.y],["s",x,x],["t",r.x,r.y]]):p=xP(p,[["s",x,x]])}return{matrix:p}},y)}else s.setMatrix(l),this.emit("viewportchange",{action:"zoom",matrix:l}),this.autoPaint();return!v},e.prototype.zoomTo=function(t,r,i,a){var o=t/this.getZoom();return this.zoom(o,r,i,a)},e.prototype.focusItem=function(t,r,i){var a=this.get("viewController"),o=!1;r?o=!0:r===void 0&&(o=this.get("animate"));var s={};i?s=i:i===void 0&&(s=this.get("animateCfg")),a.focus(t,o,s),this.autoPaint()},e.prototype.focusItems=function(t,r,i,a){var o=this.get("viewController");o.focusItems(t,r,i,a)},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,r){var i=this.get("viewController");return i.getPointByClient(t,r)},e.prototype.getClientByPoint=function(t,r){var i=this.get("viewController");return i.getClientByPoint(t,r)},e.prototype.getPointByCanvas=function(t,r){var i=this.get("viewController");return i.getPointByCanvas(t,r)},e.prototype.getCanvasByPoint=function(t,r){var i=this.get("viewController");return i.getCanvasByPoint(t,r)},e.prototype.getGraphCenterPoint=function(){var t=this.get("group").getCanvasBBox();return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}},e.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},e.prototype.showItem=function(t,r){r===void 0&&(r=!0);var i=this.get("itemController"),a=i.changeItemVisibility(t,!0);if(r&&this.get("enabledStack")){var o=a.getID(),s=a.getType(),l={},u={};switch(s){case"node":l.nodes=[{id:o,visible:!1}],u.nodes=[{id:o,visible:!0}];break;case"edge":l.nodes=[{id:o,visible:!1}],u.edges=[{id:o,visible:!0}];break;case"combo":l.nodes=[{id:o,visible:!1}],u.combos=[{id:o,visible:!0}];break}this.pushStack("visible",{before:l,after:u})}},e.prototype.hideItem=function(t,r){r===void 0&&(r=!0);var i=this.get("itemController"),a=i.changeItemVisibility(t,!1);if(r&&this.get("enabledStack")){var o=a.getID(),s=a.getType(),l={},u={};switch(s){case"node":l.nodes=[{id:o,visible:!0}],u.nodes=[{id:o,visible:!1}];break;case"edge":l.nodes=[{id:o,visible:!0}],u.edges=[{id:o,visible:!1}];break;case"combo":l.nodes=[{id:o,visible:!0}],u.combos=[{id:o,visible:!1}];break}this.pushStack("visible",{before:l,after:u})}},e.prototype.refreshItem=function(t){var r=this.get("itemController");r.refreshItem(t)},e.prototype.setAutoPaint=function(t){var r=this;r.set("autoPaint",t);var i=r.get("canvas");i.set("autoDraw",t)},e.prototype.remove=function(t,r){r===void 0&&(r=!0),this.removeItem(t,r)},e.prototype.removeItem=function(t,r){r===void 0&&(r=!0);var i=t;if(rr(t)&&(i=this.findById(t)),!i&&rr(t))console.warn("The item ".concat(t," to be removed does not exist!"));else if(i){var a="";if(i.getType&&(a=i.getType()),r&&this.get("enabledStack")){var o=ve(ve({},i.getModel()),{itemType:a}),s={};switch(a){case"node":{s.nodes=[o],s.edges=[];for(var l=i.getEdges(),u=l.length-1;u>=0;u--)s.edges.push(ve(ve({},l[u].getModel()),{itemType:"edge"}));break}case"edge":s.edges=[o];break;case"combo":s.combos=[o];break}this.pushStack("delete",{before:s,after:{}})}if(a==="node"){var h=i.getModel();h.comboId&&this.updateComboTree(i,void 0,!1)}var c=this.get("itemController");if(c.removeItem(i),a==="combo"){var f=GQ(this.get("comboTrees"));this.set("comboTrees",f)}}},e.prototype.innerAddItem=function(t,r,i){if(!Z7t(t,r))return!1;if(r.id&&this.findById(r.id)){console.warn("This item exists already. Be sure the id %c".concat(r.id,"%c is unique."),"font-size: 20px; color: red;","");return}var a,o=this.get("comboTrees")||[];if(t==="combo"){var s=this.get("itemMap"),l=!1;if(o.forEach(function(v){l||xy(v,function(p){if(r.parentId===p.id){l=!0;var g=ve({id:r.id,depth:p.depth+2},r);p.children?p.children.push(g):p.children=[g],r.depth=g.depth,a=i.addItem(t,r)}var m=s[p.id];return l&&m&&m.getType&&m.getType()==="combo"&&i.updateCombo(m,p.children),!0})}),!l){var u=ve({id:r.id,depth:0},r);r.depth=u.depth,o.push(u),a=i.addItem(t,r)}this.set("comboTrees",o),r.collapsed&&(this.collapseCombo(a,!1),this.updateCombo(a))}else if(t==="node"&&rr(r.comboId)&&o){var h=this.findById(r.comboId);h&&h.getType&&h.getType()!=="combo"&&console.warn("'".concat(r.comboId,"' is not a id of a combo in the graph, the node will be added without combo.")),a=i.addItem(t,r);var c=this.get("itemMap"),f=!1,d=!1;o.forEach(function(v){d||f||xy(v,function(p){if(p.id===r.id)return d=!0,!1;if(r.comboId===p.id&&!d){f=!0;var g=Xi(r);g.itemType="node",p.children?p.children.push(g):p.children=[g],g.depth=p.depth+1}return f&&c[p.id].getType&&c[p.id].getType()==="combo"&&i.updateCombo(c[p.id],p.children),!0})})}else a=i.addItem(t,r);if(t==="node"&&r.comboId||t==="combo"&&r.parentId){var h=this.findById(r.comboId||r.parentId);h&&h.getType&&h.getType()==="combo"&&h.addChild(a)}return a},e.prototype.addItem=function(t,r,i,a){i===void 0&&(i=!0),a===void 0&&(a=!0);var o=this.get("comboSorted");this.set("comboSorted",o&&!a);var s=this.get("itemController"),l=this.innerAddItem(t,r,s);if(l===!1||l===!0)return l;var u=this.get("combos");if(u&&u.length>0&&this.sortCombos(),this.autoPaint(),i&&this.get("enabledStack")){var h=ve(ve({},l.getModel()),{itemType:t}),c={};switch(t){case"node":c.nodes=[h];break;case"edge":c.edges=[h];break;case"combo":c.combos=[h];break}this.pushStack("add",{before:{},after:c})}return l},e.prototype.addItems=function(t,r,i){t===void 0&&(t=[]),r===void 0&&(r=!0),i===void 0&&(i=!0);var a=this.get("comboSorted");this.set("comboSorted",a&&!i);for(var o=this.get("itemController"),s=[],l=0;l0&&this.sortCombos()}if(this.autoPaint(),r&&this.get("enabledStack")){for(var c={nodes:[],edges:[],combos:[]},l=0;l=0;g--)v[g].destroyed&&v.splice(g,1);f&&(o.addCombos(f),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",c,s.edges),At(h,function(x,S){x.getType&&(x.getType()==="node"||x.getType()==="combo")||c.edges.indexOf(x)<0&&(delete h[S],o.remove(x,!1))}),(this.get("comboTrees")||[]).forEach(function(x){xy(x,function(S){var w=i.findById(S.id);return w.getType()==="combo"&&S.collapsed&&i.collapseCombo(S.id,!1),!0})}),this.set({nodes:c.nodes,edges:c.edges});var m=(this.get("layout")||{}).relayoutAtChangeData,y=m===void 0?!0:m,_=this.get("layoutController");return y&&_&&(_.changeData(function(){setTimeout(function(){var x;(x=o.getCombos())===null||x===void 0||x.forEach(function(S){S.set("animate",!0)})},0)}),o.get("animate")&&!_.getLayoutType()?(o.positionsAnimate(),(a=o.getCombos())===null||a===void 0||a.forEach(function(x){return x.set("animate",!0)})):o.autoPaint()),setTimeout(function(){l.set("localRefresh",u)},16),this.set("data",s),this.emit("afterchangedata"),this},e.prototype.addCombos=function(t){var r=this,i=r.get("comboTrees"),a=this.get("itemController");a.addCombos(i,t)},e.prototype.createCombo=function(t,r,i){var a=this;i===void 0&&(i=!0);var o=this.get("itemController");this.set("comboSorted",!1);var s="",l;if(!!t){if(rr(t))s=t,l={id:t};else{if(s=t.id,!s){console.warn("Create combo failed. Please assign a unique string id for the adding combo.");return}l=t}var u=i&&this.get("enabledStack"),h={nodes:[],combos:[]};u&&r.forEach(function(m){var y=a.findById(m),_=y.getType();if(!(_!=="node"&&_!=="combo")){var x=y.getModel();h["".concat(_,"s")].push({id:m,parentId:_==="node"?x.comboId:x.parentId})}});var c=this.get("comboTrees"),f=new Set(r),d=new Map;c&&(c.forEach(function(m){xy(m,function(y,_,x){if(f.has(y.id)){if(_){var S=a.findById(_.id),w=a.findById(y.id);_.children.splice(x,1),S.removeChild(w),o.updateCombo(S,_.children)}y.itemType==="combo"&&d.set(y.id,y)}return!0})}),c=c.filter(function(m){return!f.has(m.id)}),this.set("comboTrees",c));var v={nodes:[],combos:[]},p=r.map(function(m){var y=a.findById(m),_=y.getModel(),x="";y.getType&&(x=y.getType());var S=d.get(m)||{id:y.getID(),itemType:x};return x==="combo"?(S.parentId=s,_.parentId=s):x==="node"&&(S.comboId=s,_.comboId=s),u&&v["".concat(x,"s")].push({id:_.id,parentId:s}),S});l.children=p,this.addItem("combo",l,!1),this.set("comboSorted",!1),c&&(c.forEach(function(m){Fc(m,function(y){return y.id===s?(y.itemType="combo",y.children=p,!1):!0})}),this.sortCombos()),u&&(v.combos.push(l),this.pushStack("createCombo",{before:h,after:v}));var g=this.findById(s);!g.getModel().parentId&&g.getChildren().combos.length&&this.updateComboTree(g,void 0,!1),setTimeout(function(){g.set("animate",!0)},0)}},e.prototype.uncombo=function(t,r){var i=this,a,o;r===void 0&&(r=!0);var s=this,l=t;if(rr(t)&&(l=this.findById(t)),!l||l.getType&&l.getType()!=="combo"){console.warn("The item is not a combo!");return}var u=l.getModel(),h=l.getModel().parentId,c=s.get("comboTrees");c||(c=[]);var f=this.get("itemMap"),d=l.get("id"),v,p=[],g=this.get("combos"),m=this.findById(h),y=r&&this.get("enabledStack"),_={};if(y&&(_=Xi(u),_.children=[]),c.forEach(function(b){v||xy(b,function(E){var T;if(E.id===d){v=E;var C=l.getEdges().map(function(I){return I.getID()});C.forEach(function(I){i.removeItem(I,!1)});var A=g.indexOf(l);g.splice(A,1),delete f[d];var M=Xi(l.getModel());l.destroy(),i.emit("afterremoveitem",{item:M,type:"combo"})}if(h&&v&&E.id===h){m.removeCombo(l),p=E.children;var A=p.indexOf(v);return A!==-1&&p.splice(A,1),(T=v.children)===null||T===void 0||T.forEach(function(R){var k=i.findById(R.id),D=k.getModel();k.getType&&k.getType()==="combo"?(R.parentId=h,delete R.comboId,D.parentId=h,delete D.comboId):k.getType&&k.getType()==="node"&&(R.comboId=h,D.comboId=h),m.addChild(k),p.push(R)}),i.updateCombo(m),!1}return!0})}),!h&&v){var x=c.indexOf(v);c.splice(x,1),(a=v.children)===null||a===void 0||a.forEach(function(b){b.parentId=void 0;var E=i.findById(b.id).getModel();delete E.parentId,delete E.comboId,b.itemType!=="node"&&c.push(b)})}if(y){var S={nodes:[],combos:[]},w={nodes:[],combos:[]};(o=v.children)===null||o===void 0||o.forEach(function(b){var E=i.findById(b.id),T=E.getType();T!=="node"&&T!=="combo"||(S["".concat(T,"s")].push({id:b.id,parentId:d}),w["".concat(T,"s")].push({id:b.id,parentId:h}))}),S.combos.push(_),this.pushStack("uncombo",{before:S,after:w})}},e.prototype.updateCombos=function(t){var r=this;t===void 0&&(t=!1);var i=this,a=this.get("comboTrees"),o=i.get("itemController"),s=i.get("itemMap");(a||[]).forEach(function(l){xy(l,function(u){var h;if(!u)return!0;var c=s[u.id];if(((h=c==null?void 0:c.getType)===null||h===void 0?void 0:h.call(c))==="combo"){var f=_v([],c.getStates(),!0);At(f,function(d){return r.setItemState(c,d,!1)}),o.updateCombo(c,u.children,t),At(f,function(d){return r.setItemState(c,d,!0)})}return!0})}),i.sortCombos()},e.prototype.updateCombo=function(t){var r=this,i=this,a=t,o;if(rr(t)&&(a=this.findById(t)),!a||a.getType&&a.getType()!=="combo"){console.warn("The item to be updated is not a combo!");return}o=a.get("id");var s=this.get("comboTrees"),l=i.get("itemController"),u=i.get("itemMap");(s||[]).forEach(function(h){xy(h,function(c){if(!c)return!0;var f=u[c.id];if(o===c.id&&f&&f.getType&&f.getType()==="combo"){var d=_v([],f.getStates(),!0);At(d,function(v){f.getStateStyle(v)&&r.setItemState(f,v,!1)}),l.updateCombo(f,c.children),At(d,function(v){f.getStateStyle(v)&&r.setItemState(f,v,!0)}),o&&(o=c.parentId)}return!0})})},e.prototype.updateComboTree=function(t,r,i){i===void 0&&(i=!0);var a=this;this.set("comboSorted",!1);var o;rr(t)?o=a.findById(t):o=t;var s=o.getModel(),l=s.comboId||s.parentId,u="";if(o.getType&&(u=o.getType()),r&&u==="combo"){var h=this.get("comboTrees"),c=!0,f;if((h||[]).forEach(function(y){f||Fc(y,function(_){if(!f)return _.id===o.getID()&&(f=_),!0})}),Fc(f,function(y){return y.id===r?(c=!1,!1):!0}),!c){console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!");return}}if(i&&this.get("enabledStack")){var d={},v={};u==="combo"?(d.combos=[{id:s.id,parentId:s.parentId}],v.combos=[{id:s.id,parentId:r}]):u==="node"&&(d.nodes=[{id:s.id,parentId:s.comboId}],v.nodes=[{id:s.id,parentId:r}]),this.pushStack("updateComboTree",{before:d,after:v})}if(s.parentId||s.comboId){var p=this.findById(s.parentId||s.comboId);p&&p.removeChild(o)}if(u==="combo"?s.parentId=r:u==="node"&&(s.comboId=r),r){var g=this.findById(r);g&&g.addChild(o)}if(l){var g=this.findById(l);g&&g.removeChild(o)}var m=GQ(this.get("comboTrees"),s.id,r);this.set("comboTrees",m),this.updateCombos()},e.prototype.save=function(){var t=[],r=[],i=[];return At(this.get("nodes"),function(a){t.push(a.getModel())}),At(this.get("edges"),function(a){r.push(a.getModel())}),At(this.get("combos"),function(a){i.push(a.getModel())}),{nodes:t,edges:r,combos:i}},e.prototype.changeSize=function(t,r){var i=this.get("viewController");return i.changeSize(t,r),this},e.prototype.refresh=function(){var t=this;if(t.emit("beforegraphrefresh"),t.get("animate"))t.positionsAnimate();else{var r=t.get("nodes"),i=t.get("edges"),a=t.get("edges");At(r,function(o){o.refresh()}),At(i,function(o){o.refresh()}),At(a,function(o){o.refresh()})}t.emit("aftergraphrefresh"),t.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if(rr(t)&&(t=this.findById(t)),!t||t.getType&&t.getType()!=="combo"){console.warn("The combo does not exist!");return}return t.getChildren()},e.prototype.positionsAnimate=function(t){var r=this;r.emit("beforeanimate");var i=r.get("animateCfg"),a=i.onFrame,o=t?r.getNodes().concat(r.getCombos()):r.getNodes(),s=o.map(function(u){var h=u.getModel();return{id:h.id,x:h.x,y:h.y}});r.stopAnimate();var l=r.get("canvas");r.animating=!0,setTimeout(function(){l.animate(function(u){At(s,function(h){var c=r.findById(h.id);if(!(!c||c.destroyed)){var f=c.get("originAttrs"),d=c.get("model"),v=c.getContainer().getMatrix();if(f==null&&(v&&(f={x:v[6],y:v[7]}),c.set("originAttrs",f||0)),a){var p=a(c,u,h,f||{x:0,y:0});c.set("model",Object.assign(d,p))}else f?(d.x=f.x+(h.x-f.x)*u,d.y=f.y+(h.y-f.y)*u):(d.x=h.x,d.y=h.y)}}),r.refreshPositions(t)},{duration:i.duration,easing:i.easing,callback:function(){At(o,function(h){h.set("originAttrs",null)}),i.callback&&i.callback(),r.emit("afteranimate"),r.animating=!1}})},0)},e.prototype.refreshPositions=function(t){var r=this;r.emit("beforegraphrefreshposition");var i=r.get("nodes"),a=r.get("edges"),o=r.get("vedges"),s=r.get("combos"),l,u={},h=function(f){At(f,function(d){l=d.getModel();var v=d.get("originAttrs");if(!(v&&l.x===v.x&&l.y===v.y)){var p=d.updatePosition({x:l.x,y:l.y});u[l.id]=p,l.comboId&&(u[l.comboId]=u[l.comboId]||p),l.parentId&&(u[l.parentId]=u[l.parentId]||p)}})};h(s),h(i),s&&s.length!==0&&(t&&h(s),r.updateCombos()),At(a,function(c){var f=c.getSource().getModel(),d=c.getTarget();if(!kh(d)){var v=d.getModel();(u[f.id]||u[v.id]||c.getModel().isComboEdge)&&c.refresh()}}),At(o,function(c){c.refresh()}),r.emit("aftergraphrefreshposition"),r.autoPaint()},e.prototype.stopAnimate=function(){var t=this.get("canvas"),r=t.cfg.timeline;r&&r.stopAllAnimations()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){var t=this.get("modeController");return t.getMode()},e.prototype.setMode=function(t){var r=this.get("modeController");return r.setMode(t),this},e.prototype.clear=function(t){var r;return t===void 0&&(t=!1),(r=this.get("canvas"))===null||r===void 0||r.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],vedges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t,r,i,a){var o=this;t===void 0&&(t={}),a===void 0&&(a=!0);var s=this.get("layoutController");if(rr(t)&&(t={type:t}),r){var l=i;l||(r==="begin"?l={x:0,y:0}:l={x:this.getWidth()/2,y:this.getHeight()/2}),l=this.getPointByCanvas(l.x,l.y);var u=["force","gForce","fruchterman","force2"];u.includes(t.type)||!t.type&&u.includes(s==null?void 0:s.layoutType)?t.center=[l.x,l.y]:this.once("afterlayout",function(f){var d=o.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];l.x=l.x*d[0]+d[6],l.y=l.y*d[0]+d[7];var v=o.getGroup().getCanvasBBox(),p=v.minX,g=v.maxX,m=v.minY,y=v.maxY,_={x:(p+g)/2,y:(m+y)/2};r==="begin"&&(_.x=p,_.y=m),o.translate(l.x-_.x,l.y-_.y)})}var h=ve({},this.get("layout")),c={};Object.assign(c,h,t),t.pipes&&!t.type?delete c.type:!t.pipes&&c.type&&delete c.pipes,this.set("layout",c),s&&(s.isLayoutTypeSame(c)&&c.gpuEnabled===h.gpuEnabled?s.updateLayoutCfg(c):s.changeLayout(c),a&&this.get("enabledStack")&&this.pushStack("layout",{before:h,after:c}))},e.prototype.destroyLayout=function(){var t=this.get("layoutController");t==null||t.destroyLayout()},e.prototype.layout=function(){var t,r=this.get("layoutController"),i=this.get("layout");if(!(!i||!r)){if(i.workerEnabled){r.layout();return}!((t=r.layoutMethods)===null||t===void 0)&&t.length?r.relayout(!0):r.layout()}},e.prototype.collapseCombo=function(t,r){var i=this;if(r===void 0&&(r=!0),!this.destroyed){if(rr(t)&&(t=this.findById(t)),!t){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"collapse",item:t});var a=t.getModel(),o=this.get("itemController");o.collapseCombo(t,r),a.collapsed=!0;var s=this.getEdges().concat(this.get("vedges")),l=[],u=this.get("comboTrees"),h=!1;(u||[]).forEach(function(f){h||Fc(f,function(d){if(h&&d.depth<=a.depth)return!1;if(a.id===d.id&&(h=!0),h){var v=i.findById(d.id);v&&v.getType&&v.getType()==="combo"&&(l=l.concat(v.getNodes()),l=l.concat(v.getCombos()))}return!0})});var c={};s.forEach(function(f){var d=f.getModel(),v=d.isVEdge,p=d.size,g=p===void 0?1:p;if(!(f.isVisible()&&!v)){var m=f.getSource(),y=f.getTarget(),_=null,x;if(m.getModel().id===a.id||l.includes(m)&&!l.includes(y)?(_=y,x=!1):(y.getModel().id===a.id||!l.includes(m)&&l.includes(y))&&(_=m,x=!0),_){if(v){i.removeItem(f,!1);return}for(var S=_.getModel();!_.isVisible();){var w=S.parentId,b=S.comboId,E=w||b;if(_=i.findById(E),!_||!E)return;S=_.getModel()}var T=S.id,C=x?{source:T,target:a.id,size:g,isVEdge:!0}:{source:a.id,target:T,size:g,isVEdge:!0},A="".concat(C.source,"-").concat(C.target);if(c[A]){c[A].size+=g;return}c[A]=C}}}),this.addItems(Object.values(c).map(function(f){return{type:"vedge",model:f}}),!1),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})}},e.prototype.expandCombo=function(t,r){var i=this;if(r===void 0&&(r=!0),rr(t)&&(t=this.findById(t)),!t||t.getType&&t.getType()!=="combo"){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var a=t.getModel(),o=this.get("itemController");o.expandCombo(t,r),a.collapsed=!1;var s=this.getEdges().concat(this.get("vedges")),l=[],u=this.get("comboTrees"),h=!1;(u||[]).forEach(function(f){h||Fc(f,function(d){if(h&&d.depth<=a.depth)return!1;if(a.id===d.id&&(h=!0),h){var v=i.findById(d.id);v&&v.getType&&v.getType()==="combo"&&(l=l.concat(v.getNodes()),l=l.concat(v.getCombos()))}return!0})});var c={};s.forEach(function(f){if(!(f.isVisible()&&!f.getModel().isVEdge)){var d=f.getSource(),v=f.getTarget(),p=d.get("id"),g=v.get("id"),m=null,y;if(p===a.id||l.includes(d)&&!l.includes(v)?(m=v,y=!1):g===a.id||!l.includes(d)&&l.includes(v)?(m=d,y=!0):l.includes(d)&&l.includes(v)&&d.isVisible()&&v.isVisible()&&f.show(),m){var _=f.getModel(),x=_.isVEdge,S=_.size,w=S===void 0?1:S;if(x){i.removeItem(f,!1);return}for(var b=m.getModel();!m.isVisible();){var E=b.parentId,T=b.comboId,C=E||T;if(m=i.findById(C),!m||!C)return;b=m.getModel()}for(var A=b.id,M=y?v:d,I=M.getModel();!M.isVisible();){var R=I.parentId,k=I.comboId,D=R||k;if(M=i.findById(D),!M||!D)return;if(I.comboId===a.id||I.parentId===a.id)break;I=M.getModel()}var G=I.id;if(A){var W=y?{source:A,target:G,isVEdge:!0,size:w}:{source:G,target:A,isVEdge:!0,size:w},z="".concat(W.source,"-").concat(W.target);if(c[z]){c[z].size+=w;return}c[z]=W}}}}),this.addItems(Object.values(c).map(function(f){return{type:"vedge",model:f}}),!1),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})},e.prototype.collapseExpandCombo=function(t,r){if(r===void 0&&(r=!0),rr(t)&&(t=this.findById(t)),!(!t||t.getType&&t.getType()!=="combo")){for(var i=t.getModel(),a=this.findById(i.parentId);a;){var o=a.getModel();if(o.collapsed){console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),a=void 0;return}a=this.findById(o.parentId)}var s=i.collapsed;s?this.expandCombo(t,r):this.collapseCombo(t,r),this.updateCombo(t)}},e.prototype.getNeighbors=function(t,r){var i=t;return rr(t)&&(i=this.findById(t)),i.getNeighbors(r)},e.prototype.getNodeDegree=function(t,r,i){r===void 0&&(r=void 0),i===void 0&&(i=!1);var a=t;rr(t)&&(a=this.findById(t));var o=this.get("degrees");(!o||i)&&(o=g_(this.save()),this.set("degrees",o));var s=o[a.getID()],l=0;if(!s)return 0;switch(r){case"in":l=s.inDegree;break;case"out":l=s.outDegree;break;case"all":l=s;break;default:l=s.degree;break}return l},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear(),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack}))},e.prototype.pushStack=function(t,r,i){if(t===void 0&&(t="update"),i===void 0&&(i="undo"),!this.get("enabledStack")){console.warn("\u8BF7\u5148\u542F\u7528 undo & redo \u529F\u80FD\uFF0C\u5728\u5B9E\u4F8B\u5316 Graph \u65F6\u5019\u914D\u7F6E enabledStack: true !");return}var a=r?Xi(r):{before:{},after:Xi(this.save())};i==="redo"?this.redoStack.push({action:t,data:a}):this.undoStack.push({action:t,data:a}),this.emit("stackchange",{action:t,stackType:i,undoStack:this.undoStack,redoStack:this.redoStack})},e.prototype.getAdjMatrix=function(t,r){t===void 0&&(t=!0),r===void 0&&(r=this.get("directed"));var i=this.get("adjMatrix");return(!i||!t)&&(i=i2(this.save(),r),this.set("adjMatrix",i)),i},e.prototype.getShortestPathMatrix=function(t,r){t===void 0&&(t=!0),r===void 0&&(r=this.get("directed"));var i=this.get("adjMatrix"),a=this.get("shortestPathMatrix");return(!i||!t)&&(i=i2(this.save(),r),this.set("adjMatrix",i)),(!a||!t)&&(a=GD(this.save(),r),this.set("shortestPathMatrix",a)),a},e.prototype.on=function(t,r,i){return n.prototype.on.call(this,t,r,i)},e.prototype.destroy=function(){var t,r,i,a,o;this.emit("beforedestroy"),this.clear(),this.clearStack(),(t=this.get("itemController"))===null||t===void 0||t.destroy(),(r=this.get("modeController"))===null||r===void 0||r.destroy(),(i=this.get("viewController"))===null||i===void 0||i.destroy(),(a=this.get("stateController"))===null||a===void 0||a.destroy(),(o=this.get("canvas"))===null||o===void 0||o.destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null,this.emit("afterdestroy")},e.prototype.createHull=function(t){if(!t.members||t.members.length<1){console.warn("Create hull failed! The members is empty.");return}var r=this.get("hullGroup"),i=this.get("hullMap");if(i||(i={},this.set("hullMap",i)),(!r||r.get("destroyed"))&&(r=this.get("group").addGroup({id:"hullGroup"}),r.toBack(),this.set("hullGroup",r)),i[t.id])return console.warn("Existed hull id."),i[t.id];var a=r.addGroup({id:"".concat(t.id,"-container")}),o=new MUe(this,ve(ve({},t),{group:a})),s=o.id;return i[s]=o,o},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var r,i;rr(t)?i=this.getHullById(t):i=t,(r=this.get("hullMap"))===null||r===void 0||delete r[i.id],i.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();!t||!Object.keys(t).length||(Object.keys(t).forEach(function(r){var i=t[r];i.destroy()}),this.set("hullMap",{}))},e}(C9e);function uee(n){return uee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uee(n)}var uC=sg,DSe="-shape",BX="-label",m5=["startArrow","endArrow"],NSe={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},i$t={lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},_5={edge:i$t,node:NSe,combo:NSe},hee="-label-bg",xse={options:{labelCfg:{style:{fontFamily:tn.windowFontFamily}},descriptionCfg:{style:{fontFamily:tn.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(e){return{}},getOptions:function(e,t){return t==="move"||(t==null?void 0:t.includes("bbox"))?e:ms({},this.options,this.getCustomConfig(e)||{},e)},draw:function(e,t){t.shapeMap={},this.mergeStyle=this.getOptions(e);var r=this.drawShape(e,t);if(r.set("className",this.itemType+DSe),t.shapeMap[this.itemType+DSe]=r,e.label){var i=this.drawLabel(e,t);i.set("className",this.itemType+BX),t.shapeMap[this.itemType+BX]=i}return r},afterDraw:function(e,t,r){},drawShape:function(e,t){return null},drawLabel:function(e,t){var r=(this.mergeStyle||this.getOptions(e)||{}).labelCfg,i=r||{},a=this.getLabelStyle(e,i,t),o=a.rotate;delete a.rotate;var s=t.addShape("text",{attrs:a,draggable:!0,className:"text-shape",name:"text-shape",labelRelated:!0});if(t.shapeMap["text-shape"]=s,!isNaN(o)&&o!==""){var l=s.getBBox(),u=[1,0,0,0,1,0,0,0,1];if(a.rotateCenter)switch(a.rotateCenter){case"center":u=uC(u,[["t",-l.width/2,-l.height/2],["r",o],["t",l.width/2,l.height/2]]);break;case"lefttop":u=uC(u,[["t",-a.x,-a.y],["r",o],["t",a.x,a.y]]);break;case"leftcenter":u=uC(u,[["t",-a.x,-a.y-l.height/2],["r",o],["t",a.x,a.y+l.height/2]]);break;default:u=uC(u,[["t",-l.width/2,-l.height/2],["r",o],["t",l.width/2,l.height/2]]);break}else u=uC(u,[["t",-a.x,-a.y-l.height/2],["r",o],["t",a.x,a.y+l.height/2]]);s.setMatrix(u)}if(a.background){var h=this.drawLabelBg(e,t,s),c=this.itemType+hee;h.set("classname",c),t.shapeMap[c]=h,s.toFront()}return s},drawLabelBg:function(e,t,r){var i=this.options.labelCfg,a=_n({},i,e.labelCfg),o=this.getLabelBgStyleByPosition(r,a),s=t.addShape("rect",{name:"text-bg-shape",attrs:o,labelRelated:!0});return t.shapeMap["text-bg-shape"]=s,s},getLabelStyleByPosition:function(e,t,r){return{text:e.label}},getLabelBgStyleByPosition:function(e,t){return{}},getLabelStyle:function(e,t,r){var i=this.getLabelStyleByPosition(e,t,r),a="".concat(this.itemType,"Label"),o=tn[a]?tn[a].style:null;return ve(ve(ve({},o),i),t.style)},getShapeStyle:function(e){return e.style},update:function(e,t,r){this.updateShapeStyle(e,t,r),this.updateLabel(e,t,r)},updateShapeStyle:function(e,t,r){var i,a=t.getContainer(),o=t.getKeyShape(),s=_n({},o.attr(),e.style),l=function(c){var f,d=s[c];if(kh(d)){var v=((i=a.shapeMap)===null||i===void 0?void 0:i[c])||a.find(function(p){return p.get("name")===c});v==null||v.attr(d)}else o.attr((f={},f[c]=d,f))};for(var u in s)l(u)},updateLabel:function(e,t,r){var i,a,o=t.getContainer(),s=(this.mergeStyle||this.getOptions({},r)||{}).labelCfg,l=s===void 0?{}:s,u=this.itemType+BX,h=o.shapeMap[u]||o.find(function(x){return x.get("className")===u}),c=this.itemType+hee,f=o.shapeMap[c]||o.find(function(x){return x.get("className")===c});if(h&&e.label===void 0&&(o.removeChild(h),delete o.shapeMap[u],f&&(o.removeChild(f),delete o.shapeMap[c])),e.label||e.label==="")if(h){(!r||r==="bbox|label"||this.itemType==="edge"&&r!=="style")&&(l=ms(l,e.labelCfg));var v=this.getLabelStyleByPosition(e,l,o),p=(i=e.labelCfg)===null||i===void 0?void 0:i.style,g=ve(ve({},v),p),m=g.rotate;if(delete g.rotate,!isNaN(m)&&m!==""){var y=[1,0,0,0,1,0,0,0,1];y=uC(y,[["t",-g.x,-g.y],["r",m],["t",g.x,g.y]]),g.matrix=y,h.attr(g)}else((a=h.getMatrix())===null||a===void 0?void 0:a[4])!==1&&h.resetMatrix(),h.attr(g);if(!f)g.background&&(f=this.drawLabelBg(e,o,h),f.set("classname",c),o.shapeMap[c]=f,h.toFront());else if(g.background){var _=this.getLabelBgStyleByPosition(h,l);f.attr(_)}else o.removeChild(f)}else{var d=this.drawLabel(e,o);d.set("className",u),o.shapeMap[u]=d}},afterUpdate:function(e,t){},setState:function(e,t,r){var i,a,o,s=r.get("keyShape");if(!(!s||s.destroyed)){var l=r.getType(),u=z3(t)?e:"".concat(e,":").concat(t),h=this.getStateStyle(u,r),c=r.getStateStyle(u);if(!(!c&&!h)){var f=_n({},c||h),d=r.getContainer(),v={x:1,y:1,cx:1,cy:1,matrix:1};if(l==="combo"&&(v.r=1,v.width=1,v.height=1),t){var p=function(D){var G,W=f[D];if(kh(W)&&!m5.includes(D)){var z=((o=d.shapeMap)===null||o===void 0?void 0:o[D])||d.find(function(V){return V.get("name")===D});z==null||z.attr(W)}else s.attr((G={},G[D]=W,G))};for(var g in f)p(g)}else{var m=jB(r.getCurrentStatesStyle()),y=r.getModel(),_=_n({},y.style,jB(r.getOriginStyle())),x=s.get("name"),S=s.attr(),w={};Object.keys(S).forEach(function(k){if(k!=="img"){var D=S[k];D&&uee(D)==="object"?w[k]=Xi(D):w[k]=D}});var b={},E=function(D){var G=f[D];if(kh(G)&&!m5.includes(D)){var W=d.shapeMap[D]||d.find(function(q){return q.get("name")===D});if(W){var z=jB(W.attr());At(G,function(q,Y){if(D===x&&w[Y]&&!v[Y]){delete w[Y];var le=_[D][Y]||_5[l][Y];s.attr(Y,le)}else if(z[Y]||z[Y]===0){delete z[Y];var j=_[D][Y]||_5[l][Y];W.attr(Y,j)}}),b[D]=z}}else if(w[D]&&!v[D]){delete w[D];var V=_[D]||(_[x]?_[x][D]:void 0)||_5[l][D];s.attr(D,V)}};for(var T in f)E(T);x?b[x]=w:_n(b,w);for(var g in m)if(!v[g]){var C=m[g];(!kh(C)||m5.includes(g))&&(x?(_n(_[x],(a={},a[g]=C,a)),delete _[g]):_n(_,(i={},i[g]=C,i)),delete m[g])}var A={};ms(A,_,b,m);var M=!1,I=function(D){var G,W,z=A[D];if(kh(z)&&!m5.includes(D)){var V=d.shapeMap[D]||d.find(function(Y){return Y.get("name")===D});V&&((V.get("type")==="text"||V.get("labelRelated"))&&(delete z.x,delete z.y,delete z.matrix),D===x&&(l==="combo"&&(delete z.r,delete z.width,delete z.height),M=!0),V.attr(z))}else if(!M){var q=z||_5[l][D];l==="combo"?x||s.attr((G={},G[D]=q,G)):s.attr((W={},W[D]=q,W))}};for(var R in A)I(R)}}}},getStateStyle:function(e,t){var r=t.getModel(),i=t.getType(),a=this.getOptions(r),o=a.stateStyles,s=a.style,l=s===void 0?{}:s,u=r.stateStyles?r.stateStyles[e]:o&&o[e];return i==="combo"?Xi(u):_n({},l,u)},getControlPoints:function(e){return e.controlPoints},getAnchorPoints:function(e){var t,r,i=(e==null?void 0:e.anchorPoints)||((t=this.getCustomConfig(e))===null||t===void 0?void 0:t.anchorPoints)||((r=this.options)===null||r===void 0?void 0:r.anchorPoints);return i}},a$t={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:tn.nodeLabel.offset,getSize:function(e){var t,r=((t=this.mergeStyle)===null||t===void 0?void 0:t.size)||e.size||this.getOptions({}).size||tn.defaultNode.size;return vn(r)&&r.length===1&&(r=[r[0],r[0]]),vn(r)||(r=[r,r]),r},getLabelStyleByPosition:function(e,t){var r=t.maxLength,i=e.label;r&&(i=bze(i,r));var a=t.position||this.labelPosition;if(a==="center")return{x:0,y:0,text:i,textBaseline:"middle",textAlign:"center"};var o=t.offset;an(o)&&(o=this.offset);var s=this.getSize(e),l;switch(a){case"top":l={x:0,y:-s[1]/2-o,textBaseline:"bottom",textAlign:"center"};break;case"bottom":l={x:0,y:s[1]/2+o,textBaseline:"top",textAlign:"center"};break;case"left":l={x:-s[0]/2-o,y:0,textBaseline:"middle",textAlign:"right"};break;default:l={x:s[0]/2+o,y:0,textBaseline:"middle",textAlign:"left"};break}return l.text=i,l},getLabelBgStyleByPosition:function(e,t){var r;if(!e)return{};var i=(r=t.style)===null||r===void 0?void 0:r.background;if(!i)return{};var a=e.getBBox(),o=mse(i.padding),s=a.width+o[1]+o[3],l=a.height+o[0]+o[2];return ve(ve({x:a.minX-o[3],y:a.minY-o[0]},i),{width:s,height:l})},drawShape:function(e,t){var r=this.shapeType,i=this.getShapeStyle(e),a=t.addShape(r,{attrs:i,draggable:!0,name:"node-shape"});return t.shapeMap["node-shape"]=a,a},updateLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=t.shapeMap["link-point-left"]||t.find(function(A){return A.get("className")==="link-point-left"}),a=t.shapeMap["link-point-right"]||t.find(function(A){return A.get("className")==="link-point-right"}),o=t.shapeMap["link-point-top"]||t.find(function(A){return A.get("className")==="link-point-top"}),s=t.shapeMap["link-point-bottom"]||t.find(function(A){return A.get("className")==="link-point-bottom"}),l;i&&(l=i.attr()),a&&!l&&(l=a.attr()),o&&!l&&(l=o.attr()),s&&!l&&(l=s.attr()),l||(l=r);var u=_n({},l,e.linkPoints),h=u.fill,c=u.stroke,f=u.lineWidth,d=u.size/2;d||(d=u.r);var v=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},p=v.left,g=v.right,m=v.top,y=v.bottom,_=this.getSize(e),x=_[0],S=_[1],w={r:d,fill:h,stroke:c,lineWidth:f};if(i)!p&&p!==void 0?(i.remove(),delete t.shapeMap["link-point-left"]):i.attr(ve(ve({},w),{x:-x/2,y:0}));else if(p){var b="link-point-left";t.shapeMap[b]=t.addShape("circle",{attrs:ve(ve({},w),{x:-x/2,y:0}),className:b,name:b,isAnchorPoint:!0})}if(a)!g&&g!==void 0&&(a.remove(),delete t.shapeMap["link-point-right"]),a.attr(ve(ve({},w),{x:x/2,y:0}));else if(g){var E="link-point-right";t.shapeMap[E]=t.addShape("circle",{attrs:ve(ve({},w),{x:x/2,y:0}),className:E,name:E,isAnchorPoint:!0})}if(o)!m&&m!==void 0&&(o.remove(),delete t.shapeMap["link-point-top"]),o.attr(ve(ve({},w),{x:0,y:-S/2}));else if(m){var T="link-point-top";t.shapeMap[T]=t.addShape("circle",{attrs:ve(ve({},w),{x:0,y:-S/2}),className:T,name:T,isAnchorPoint:!0})}if(s)!y&&y!==void 0?(s.remove(),delete t.shapeMap["link-point-bottom"]):s.attr(ve(ve({},w),{x:0,y:S/2}));else if(y){var C="link-point-bottom";t.shapeMap[C]=t.addShape("circle",{attrs:ve(ve({},w),{x:0,y:S/2}),className:C,name:C,isAnchorPoint:!0})}},updateShape:function(e,t,r,i,a){var o=t.get("keyShape");o.attr(ve({},r)),this.updateLabel(e,t,a),i&&this.updateIcon(e,t)},updateIcon:function(e,t){var r=this,i=t.getContainer(),a=(this.mergeStyle||this.getOptions(e)).icon,o=e.icon?e.icon:{show:void 0,text:void 0},s=o.show,l=o.text,u=i.shapeMap["".concat(this.type,"-icon")]||i.find(function(m){return m.get("name")==="".concat(r.type,"-icon")});if(u)if(s||s===void 0){var h=_n({},u.attr(),a),c=h.width,f=c===void 0?20:c,d=h.height,v=d===void 0?20:d;(h.fontFamily==="iconfont"||h.hasOwnProperty("text"))&&(f=0,v=0),u.attr(ve(ve({},h),{x:-f/2,y:-v/2}))}else u.remove(),delete i.shapeMap["".concat(this.type,"-icon")];else if(s){var p="".concat(this.type,"-icon");if(l)i.shapeMap[p]=i.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:p,name:p});else{var f=a.width,v=a.height;i.shapeMap[p]=i.addShape("image",{attrs:ve(ve({},a),{x:-f/2,y:-v/2}),className:p,name:p})}var g=i.shapeMap["node-label"]||i.find(function(m){return m.get("name")==="node-label"});g&&g.toFront()}}},o$t=ve(ve({},xse),a$t);_s.registerNode("single-node",o$t);var x5="edge-shape";function s$t(n){var e=n;return n==="start"?e="end":n==="end"&&(e="start"),e}var l$t={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:tn.defaultEdge.size,style:{x:0,y:0,stroke:tn.defaultEdge.style.stroke,lineAppendWidth:tn.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:tn.edgeLabel.style.fill,fontSize:tn.edgeLabel.style.fontSize,fontFamily:tn.windowFontFamily}},stateStyles:ve({},tn.edgeStateStyles)},getPath:function(e){var t=[];return At(e,function(r,i){i===0?t.push(["M",r.x,r.y]):t.push(["L",r.x,r.y])}),t},getShapeStyle:function(e){var t=this.options.style,r={stroke:e.color},i=_n({},t,r,e.style),a=e.size||tn.defaultEdge.size;e=this.getPathPoints(e);var o=e.startPoint,s=e.endPoint,l=this.getControlPoints(e),u=[o];l&&(u=u.concat(l)),u.push(s);var h=this.getPath(u),c=_n({},tn.defaultEdge.style,{stroke:tn.defaultEdge.color,lineWidth:a,path:h},i);return c},updateShapeStyle:function(e,t,r){var i,a=t.getContainer(),o=((i=t.getKeyShape)===null||i===void 0?void 0:i.call(t))||a.shapeMap["edge-shape"],s=e.size;e=this.getPathPoints(e);var l=e.startPoint,u=e.endPoint,h=this.getControlPoints(e),c=[l];h&&(c=c.concat(h)),c.push(u);var f=o.attr(),d=e.style||{};d.stroke===void 0&&(d.stroke=e.color);var v=e.sourceNode,p=e.targetNode,g={radius:d.radius};h||(g={source:v,target:p,offset:d.offset,radius:d.radius});var m=this.getPath(c,g),y={};r==="move"?y={path:m}:(f.endArrow&&d.endArrow===!1&&(e.style.endArrow={path:""}),f.startArrow&&d.startArrow===!1&&(e.style.startArrow={path:""}),y=ve({},e.style),y.lineWidth===void 0&&(y.lineWidth=(on(s)?s:s==null?void 0:s[0])||f.lineWidth),y.path===void 0&&(y.path=m),y.stroke===void 0&&(y.stroke=f.stroke||e.color)),o&&o.attr(y)},getLabelStyleByPosition:function(e,t,r){var i=t.position||this.labelPosition,a={},o=r==null?void 0:r.shapeMap[x5],s;i==="start"?s=0:i==="end"?s=1:s=.5;var l=t.refX||this.refX,u=t.refY||this.refY;if(e.startPoint.x===e.endPoint.x&&e.startPoint.y===e.endPoint.y)return a.x=e.startPoint.x+l,a.y=e.startPoint.y+u,a.text=e.label,a;var h;an(t.autoRotate)?h=this.labelAutoRotate:h=t.autoRotate;var c=xze(o,s,l,u,h);return a.x=c.x,a.y=c.y,a.rotate=c.rotate,a.textAlign=this._getTextAlign(i,c.angle),a.text=e.label,a},getLabelBgStyleByPosition:function(e,t){if(!e)return{};var r=e.getBBox(),i=t.style&&t.style.background;if(!i)return{};var a=i.padding,o=r.width+a[1]+a[3],s=r.height+a[0]+a[2],l=ve(ve({},i),{width:o,height:s,x:r.minX-a[3],y:r.minY-a[0],matrix:[1,0,0,0,1,0,0,0,1]}),u;return an(t.autoRotate)?u=this.labelAutoRotate:u=t.autoRotate,u&&(l.matrix=e.attr("matrix")||[1,0,0,0,1,0,0,0,1]),l},_getTextAlign:function(e,t){var r="center";return t?(t=t%(Math.PI*2),e!=="center"&&(t>=0&&t<=Math.PI/2||t>=3/2*Math.PI&&t<2*Math.PI?r=e:r=s$t(e)),r):e},getControlPoints:function(e){return e.controlPoints},getPathPoints:function(e){return e},drawShape:function(e,t){var r=this.getShapeStyle(e),i=t.addShape("path",{className:x5,name:x5,attrs:r});return t.shapeMap[x5]=i,i},drawLabel:function(e,t){var r=this.options.labelCfg,i=ms({},r,e.labelCfg),a=this.getLabelStyle(e,i,t),o=a.rotate;delete a.rotate;var s=t.addShape("text",{attrs:a,name:"text-shape",labelRelated:!0,draggable:!0});if(t.shapeMap["text-shape"]=s,!isNaN(o)&&o!==""&&s.rotateAtStart(o),a.background){var l=this.drawLabelBg(e,t,s,a,o),u=this.itemType+hee;l.set("classname",u),t.shapeMap[u]=l,s.toFront()}return s},drawLabelBg:function(e,t,r,i,a){var o=this.options.labelCfg,s=ms({},o,e.labelCfg),l=this.getLabelBgStyleByPosition(r,s),u=t.addShape("rect",{name:"text-bg-shape",attrs:l,labelRelated:!0});return t.shapeMap["text-bg-shape"]=u,u}},u$t=ve(ve({},xse),l$t);_s.registerEdge("single-edge",u$t);_s.registerEdge("line",{getControlPoints:function(){}},"single-edge");_s.registerEdge("spline",{getPath:function(e){var t=TUe(e);return t}},"single-edge");_s.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(e){var t=e.startPoint,r=e.endPoint,i={x:(t.x+r.x)/2,y:(t.y+r.y)/2},a,o;if(e.controlPoints!==void 0){if(o=e.controlPoints[0],a=OQ(t,o,r),t.x<=r.x&&t.y>r.y?this.clockwise=a.x>o.x?0:1:t.x<=r.x&&t.yo.x?1:0:t.x>r.x&&t.y<=r.y?this.clockwise=a.y0&&d(S[0])}},m=0;m0;)f.push(l.pop());o.push(f)}}return o};qS.detectConnectedComponents=GUe;var zUe=function(e){for(var t=e.nodes,r=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l={},u={},h=[],c=0,f=function g(m){l[m.id]=c,u[m.id]=c,c+=1,o.push(m),s[m.id]=!0;for(var y=(0,BUe.getNeighbors)(m.id,a,"target").filter(function(b){return r.map(function(E){return E.id}).indexOf(b)>-1}),_=function(E){var T=y[E];if(!l[T]&&l[T]!==0){var C=r.filter(function(A){return A.id===T});C.length>0&&g(C[0]),u[m.id]=Math.min(u[m.id],u[T])}else s[T]&&(u[m.id]=Math.min(u[m.id],l[T]))},x=0;x0;){var w=o.pop();if(s[w.id]=!1,S.push(w),w===m)break}S.length>0&&h.push(S)}},d=0,v=r;d0;)for(var g=d.pop(),m=g.id,y=(0,$Ue.getNeighbors)(m,e.edges),_=function(w){var b,E=y[w],T=e.nodes.find(function(k){return k.id===E});if(E===m)o.push((b={},b[E]=g,b));else if(!(E in p))v[E]=g,d.push(T),p[E]=new Set([g]);else if(!p[m].has(T)){for(var C=!0,A=[T,g],M=v[m];p[E].size&&!p[E].has(M)&&(A.push(M),M!==v[M.id]);)M=v[M.id];if(A.push(M),t&&r?(C=!1,A.findIndex(function(k){return t.indexOf(k.id)>-1})>-1&&(C=!0)):t&&!r&&A.findIndex(function(k){return t.indexOf(k.id)>-1})>-1&&(C=!1),C){for(var I={},R=1;R0;){var R=I.pop();a.has(R)&&(a.delete(R),o[R.id].forEach(function(k){I.push(k)}),o[R.id].clear())}},c=function A(M,I,R){var k=!1;if(t&&r===!1&&t.indexOf(M.id)>-1)return k;i.push(M),a.add(M);for(var D=R[M.id],G=0;G-1});le-1)?s.push((I={},I[Y.id]=Y,I)):q[Y.id].push(u[Q])}}return{component:V,adjList:q,minIdx:k}},_=0;_=_}),S=(0,VUe.detectStrongConnectComponents)({nodes:x,edges:e.edges}).filter(function(A){return A.length>1});if(S.length===0)break;var w=y(S),b=w.minIdx,E=w.adjList,T=w.component;if(T.length>1){T.forEach(function(A){o[A.id]=new Set});var C=l[b];if(t&&r&&t.indexOf(C.id)===-1)return s;c(C,C,E),_=b+1}else break}return s};zy.detectAllDirectedCycle=jUe;var q$t=function(e,t,r,i){return i===void 0&&(i=!0),t?jUe(e,r,i):HUe(e,r,i)};zy.detectAllCycles=q$t;var Z$t=Y$t;zy.default=Z$t;var YI={};const XUe=Nd($4t),$3=Nd(t6t);Object.defineProperty(YI,"__esModule",{value:!0});YI.default=void 0;var kSe=XUe,K$t=$3,FSe=Du,J$t=function(e,t,r){for(var i=1/0,a,o=0;oh[x.id]+A?(h[C]=h[x.id]+A,c[C]=[x.id]):h[C]===h[x.id]+A&&c[C].push(x.id)})},v=0;v0&&h.length>0;){var d=h[h.length-1];if(d.length){var v=d.shift();v&&(l.push(v),u[v]=!0,f=i?(0,S5.getNeighbors)(v,s,"target"):(0,S5.getNeighbors)(v,s),h.push(f.filter(function(m){return!u[m]})))}else{var p=l.pop();u[p]=!1,h.pop();continue}if(l[l.length-1]===r){var g=l.map(function(y){return y});c.push(g);var p=l.pop();u[p]=!1,h.pop()}}return c};MM.findAllPath=iWt;var W3={};Object.defineProperty(W3,"__esModule",{value:!0});W3.default=void 0;var aWt=oWt(aT);function oWt(n){return n&&n.__esModule?n:{default:n}}var sWt=function(e,t){for(var r=(0,aWt.default)(e,t),i=[],a=r.length,o=0;oi[o][l]+i[l][s]&&(i[o][s]=i[o][l]+i[l][s]);return i},lWt=sWt;W3.default=lWt;var XU={};Object.defineProperty(XU,"__esModule",{value:!0});XU.default=void 0;var uWt=cWt(aT),hWt=Du;function cWt(n){return n&&n.__esModule?n:{default:n}}var fWt=function(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r="weight"),i===void 0&&(i=1e3);var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u={},h={};o.forEach(function(_,x){var S=(0,hWt.uniqueId)();_.clusterId=S,u[S]={id:S,nodes:[_]},h[_.id]={node:_,idx:x}});var c=(0,uWt.default)(e,t),f={};c.forEach(function(_,x){var S=o[x].id;f[S]={},_.forEach(function(w,b){if(!!w){var E=o[b].id;f[S][E]=w}})});for(var d=0,v=function(){var x=!1;if(o.forEach(function(S){var w={};Object.keys(f[S.id]).forEach(function(R){var k=f[S.id][R],D=h[R].node,G=D.clusterId;w[G]||(w[G]=0),w[G]+=k});var b=-1/0,E=[];if(Object.keys(w).forEach(function(R){b=0&&E.splice(T,1),E&&E.length){x=!0;var C=u[S.clusterId],A=C.nodes.indexOf(S);C.nodes.splice(A,1);var M=Math.floor(Math.random()*E.length),I=u[E[M]];I.nodes.push(S),S.clusterId=I.id}}}),!x)return"break";d++};d0&&E>T&&E-TT&&(A=c.map(function(z){return{node:z,clusterId:z.clusterId}}),M=(0,bWt.clone)(y),T=E),I||C>100)break;C++,Object.keys(y).forEach(function(z){var V=0;d.forEach(function(q){var Y=q.source,le=q.target,j=_[Y].node.clusterId,Q=_[le].node.clusterId;(j===z&&Q!==z||Q===z&&j!==z)&&(V=V+(q[r]||1))}),y[z].sumTot=V}),c.forEach(function(z,V){var q=y[z.clusterId],Y=0,le,j=S[V]/(2*b),Q=0,ie=q.nodes;ie.forEach(function(st){var Nt=_[st.id].idx;Q+=x[V][Nt]||0});var oe=Q-q.sumTot*j,se=ie.filter(function(st){return st.id!==z.id});se.forEach(function(st,Nt){v[st.originIndex]});var me=GX(se,v)*u,Ce=w[z.id];if(Object.keys(Ce).forEach(function(st){var Nt=_[st].node,Zt=Nt.clusterId;if(Zt!==z.clusterId){var qe=y[Zt],ur=qe.nodes;if(!(!ur||!ur.length)){var Dt=0;ur.forEach(function(Tt){var Qe=_[Tt.id].idx;Dt+=x[V][Qe]||0});var ft=Dt-qe.sumTot*j,Oe=ur.concat([z]);Oe.forEach(function(Tt,Qe){v[Tt.originIndex]});var J=GX(Oe,v)*u,We=ft-oe;a&&(We=ft+J-(oe+me)),We>Y&&(Y=We,le=qe)}}}),Y>0){le.nodes.push(z);var Le=z.clusterId;z.clusterId=le.id;var re=q.nodes.indexOf(z);q.nodes.splice(re,1);var yt=0,je=0;d.forEach(function(st){var Nt=st.source,Zt=st.target,qe=_[Nt].node.clusterId,ur=_[Zt].node.clusterId;(qe===le.id&&ur!==le.id||ur===le.id&&qe!==le.id)&&(yt=yt+(st[r]||1)),(qe===Le&&ur!==Le||ur===Le&&qe!==Le)&&(je=je+(st[r]||1))}),le.sumTot=yt,q.sumTot=je}})}var R={},k=0;Object.keys(M).forEach(function(z){var V=M[z];if(!V.nodes||!V.nodes.length){delete M[z];return}var q=String(k+1);q!==z&&(V.id=q,V.nodes=V.nodes.map(function(Y){return{id:Y.id,clusterId:q}}),M[q]=V,R[z]=q,delete M[z],k++)}),A.forEach(function(z){var V=z.node,q=z.clusterId;!V||(V.clusterId=q,V.clusterId&&R[V.clusterId]&&(V.clusterId=R[V.clusterId]))});var D=[],G={};d.forEach(function(z){var V=z.source,q=z.target,Y=z[r]||1,le=_[V].node.clusterId,j=_[q].node.clusterId;if(!(!le||!j)){var Q="".concat(le,"---").concat(j);if(G[Q])G[Q].weight+=Y,G[Q].count++;else{var ie={source:le,target:j,weight:Y,count:1};G[Q]=ie,D.push(ie)}}});var W=[];return Object.keys(M).forEach(function(z){W.push(M[z])}),{clusters:W,clusterEdges:D}},MWt=AWt;YU.default=MWt;var qU={},ZU={};Object.defineProperty(ZU,"__esModule",{value:!0});ZU.default=void 0;var IWt=function(){function n(e){this.count=e.length,this.parent={};for(var t=0,r=e;t0&&(this.list[0]=t,this.moveDown(0)),e},n.prototype.insert=function(e){if(e!==null){this.list.push(e);var t=this.list.length-1;return this.moveUp(t),!0}return!1},n.prototype.moveUp=function(e){for(var t=this.getParent(e);e&&e>0&&this.compareFn(this.list[t],this.list[e])>0;){var r=this.list[t];this.list[t]=this.list[e],this.list[e]=r,e=t,t=this.getParent(e)}},n.prototype.moveDown=function(e){var t,r=e,i=this.getLeft(e),a=this.getRight(e),o=this.list.length;i!==null&&i0?r=i:a!==null&&a0&&(r=a),e!==r&&(t=[this.list[r],this.list[e]],this.list[e]=t[0],this.list[r]=t[1],this.moveDown(r))},n}(),RWt=OWt;KU.default=RWt;Object.defineProperty(qU,"__esModule",{value:!0});qU.default=void 0;var DWt=eVe(ZU),NWt=eVe(KU),zX=Du;function eVe(n){return n&&n.__esModule?n:{default:n}}var kWt=function(e,t){var r=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return r;var l=a[0],u=new Set;u.add(l);var h=function(g,m){return t?g.weight-m.weight:0},c=new NWt.default(h);for((0,zX.getEdgesByNodeId)(l.id,s).forEach(function(p){c.insert(p)});!c.isEmpty();){var f=c.delMin(),d=f.source,v=f.target;u.has(d)&&u.has(v)||(r.push(f),u.has(d)||(u.add(d),(0,zX.getEdgesByNodeId)(d,s).forEach(function(p){c.insert(p)})),u.has(v)||(u.add(v),(0,zX.getEdgesByNodeId)(v,s).forEach(function(p){c.insert(p)})))}return r},$Se=function(e,t){var r=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return r;var l=s.map(function(d){return d});t&&l.sort(function(d,v){return d.weight-v.weight});for(var u=new DWt.default(a.map(function(d){return d.id}));l.length>0;){var h=l.shift(),c=h.source,f=h.target;u.connected(c,f)||(r.push(h),u.union(c,f))}return r},FWt=function(e,t,r){var i={prim:kWt,kruskal:$Se};return r?i[r](e,t):$Se(e,t)},BWt=FWt;qU.default=BWt;var JU={};Object.defineProperty(JU,"__esModule",{value:!0});JU.default=void 0;var GWt=UWt(q1),zWt=Du;function UWt(n){return n&&n.__esModule?n:{default:n}}var VWt=function(e,t,r){typeof t!="number"&&(t=1e-6),typeof r!="number"&&(r=.85);for(var i=1,a=0,o=1e3,s=e.nodes,l=s===void 0?[]:s,u=e.edges,h=u===void 0?[]:u,c=l.length,f,d={},v={},p=0;p0&&i>t;){a=0;for(var p=0;p0&&(f+=v[S]/w)}d[m]=r*f,a+=d[m]}}a=(1-a)/c,i=0;for(var p=0;p=0;r--){var i=this.dfsEdgeList[r],a=i.fromNode,o=i.toNode;ad||i.hasNode(o[f.to])||(t.label_;S--){var w=x(S);if(w==="break")break}if(m){var b=e.findMinLabel(g);o.dfsEdgeList.push(new Bb(p,y,fd.VACANT_NODE_LABEL,b.edgeLabel,fd.VACANT_NODE_LABEL));var E=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[E]!==o.dfsEdgeList[E]?!1:c(g[b.edgeLabel].projected)}var T={};m=!1;var C=0;f.forEach(function(D){var G=new w5(D),W=e.findForwardPureEdges(i,G.edges[d[0]],v,G);W.length>0&&(m=!0,C=p,W.forEach(function(z){var V="".concat(z.label,"-").concat(a[z.to].label);T[V]||(T[V]={projected:[],edgeLabel:z.label,nodeLabel2:a[z.to].label}),T[V].projected.push({graphId:i.id,edge:z,preNode:D})}))});for(var A=d.length,M=function(G){if(m)return"break";var W=d[G];f.forEach(function(z){var V=new w5(z),q=e.findForwardRmpathEdges(i,V.edges[W],v,V);q.length>0&&(m=!0,C=o.dfsEdgeList[W].fromNode,q.forEach(function(Y){var le="".concat(Y.label,"-").concat(a[Y.to].label);T[le]||(T[le]={projected:[],edgeLabel:Y.label,nodeLabel2:a[Y.to].label}),T[le].projected.push({graphId:i.id,edge:Y,preNode:z})}))})},S=0;S=0;v--){var p=t.findBackwardEdge(c,d.edges[a[v]],d.edges[a[0]],d);if(p){var g="".concat(t.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(p.label);u[g]||(u[g]={projected:[],toNodeId:t.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:p.label}),u[g].projected.push({graphId:h.graphId,edge:p,preNode:h})}}if(!(i>=t.maxNodeNum)){var m=t.findForwardPureEdges(c,d.edges[a[0]],s,d);m.forEach(function(_){var x="".concat(o,"-").concat(_.label,"-").concat(f[_.to].label);l[x]||(l[x]={projected:[],fromNodeId:o,edgeLabel:_.label,nodeLabel2:f[_.to].label}),l[x].projected.push({graphId:h.graphId,edge:_,preNode:h})});for(var y=function(x){var S=t.findForwardRmpathEdges(c,d.edges[a[x]],s,d);S.forEach(function(w){var b="".concat(t.dfsCode.dfsEdgeList[a[x]].fromNode,"-").concat(w.label,"-").concat(f[w.to].label);l[b]||(l[b]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[x]].fromNode,edgeLabel:w.label,nodeLabel2:f[w.to].label}),l[b].projected.push({graphId:h.graphId,edge:w,preNode:h})})},v=0;vy){var _=y;y=m,m=_}var x=g.label,S="".concat(m,"-").concat(x,"-").concat(y);if(!o[S]){var w=o[S]||0;w++,o[S]=w}})})}),Object.keys(a).forEach(function(l){var u=a[l];if(!(u2*t)););if(g<2*t&&(s["".concat(h,"-").concat(p)]={start:h,end:p,distance:a[h][p]},c++,l++,l>=r))return s;if(f++,f>2*t)break}if(cf&&(l=f);var d=r[c.id].inDegree;u>d&&(u=d);var v=r[c.id].outDegree;h>v&&(h=v)}),e[t]={degree:l,inDegree:u,outDegree:h}),{minPatternNodeLabelDegree:l,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:h}},iHt=function(e,t,r,i,a,o,s){var l;if(r===void 0&&(r=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!e||!e.nodes)){var u=e.nodes.length;if(!!u){var h=(0,XSe.default)(e,r),c=(0,XSe.default)(t,r),f=JSe(e.nodes,h,r),d=JSe(t.nodes,c,r),v=ZSe(e.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,m=ZSe(t.nodes,o),y=m.nodeMap,_=m.nodeLabelMap;KSe(e.edges,s,p);var x=KSe(t.edges,s,y).edgeLabelMap,S=[];c==null||c.forEach(function(ft){S=S.concat(ft)}),a||(a=Math.max.apply(Math,(0,jSe.__spreadArray)((0,jSe.__spreadArray)([],S,!1),[2],!1))),i||(i=a);var w=qSe(e,h,o,i),b=qSe(t,c,o,i),E=Math.min(100,u*(u-1)/2),T=tHt(i,u,E,w,h),C=YB(T,w,e),A=10,M=1,I=1,R=4,k={graphs:C,nodeLabelProp:o,edgeLabelProp:s,minSupport:M,minNodeNum:I,maxNodeNum:R,directed:r},D=(0,QWt.default)(k).slice(0,A),G=D.length,W=[];D.forEach(function(ft,Oe){W[Oe]={},Object.keys(C).forEach(function(J){var We=C[J],Tt=qB(We,ft,o,s);W[Oe][J]=Tt})});var z=rHt(W,G,D),V=z.structure,q=z.structureCountMap,Y=t.nodes[0],le=[],j=(l=t.nodes[0])===null||l===void 0?void 0:l[o],Q=-1/0;t.nodes.forEach(function(ft){var Oe=ft[o],J=g[Oe];(J==null?void 0:J.length)>Q&&(Q=J.length,le=J,j=Oe,Y=ft)});var ie={},oe={},se={},me={},Ce={},Le={};Object.keys(_).forEach(function(ft,Oe){Ce[ft]=[],r&&(Le[ft]=[]);var J=_[ft],We={};J.forEach(function(wt){var pt=d["".concat(Y.id,"-").concat(wt.id)];if(pt&&Ce[ft].push(pt),We["".concat(Y.id,"-").concat(wt.id)]={start:0,end:y[wt.id].idx,distance:pt},r){var ar=d["".concat(wt.id,"-").concat(Y.id)];ar&&Le[ft].push(ar)}}),Ce[ft]=Ce[ft].sort(function(wt,pt){return wt-pt}),r&&(Le[ft]=Le[ft].sort(function(wt,pt){return wt-pt})),oe=YB(We,b,t,oe);var Tt=[];if(Object.keys(We).forEach(function(wt){if(se[wt]){Tt.push(se[wt]);return}var pt=oe[wt];se[wt]=qB(pt,V,o,s),Tt.push(se[wt])}),Tt=Tt.sort(function(wt,pt){return pt-wt}),me["".concat(Y.id,"-").concat(ft)]=Tt,ft!==j)for(var Qe=(le==null?void 0:le.length)||0,zt=function(pt){var ar=le[pt],kt=w[p[ar.id].idx],Dr=kt.nodeLabelCountMap[ft],Sr=_[ft].length;if(!Dr||Dr.countCe[ft][pn]){jr=!0;break}if(jr)return le.splice(pt,1),"continue";var Jn={};kt.neighbors.forEach(function(yn){var Oi=f["".concat(ar.id,"-").concat(yn.id)];Jn["".concat(ar.id,"-").concat(yn.id)]={start:p[ar.id].idx,end:p[yn.id].idx,distance:Oi}}),C=YB(Jn,w,e,C);var Rn=[];Object.keys(Jn).forEach(function(yn){if(q[yn]){Rn.push(q[yn]);return}var Oi=C[yn];q[yn]=qB(Oi,V,o,s),Rn.push(q[yn])}),Rn=Rn.sort(function(yn,Oi){return Oi-yn});for(var hi=!1,pn=0;pn=0;mt--)zt(mt)});var re=[];le==null||le.forEach(function(ft){for(var Oe=p[ft.id].idx,J=aVe(e.nodes,h[Oe],Oe,o,a),We=J.neighbors,Tt=We.length,Qe=!1,zt=Tt-1;zt>=0;zt--){if(We.length+1Dr){We.splice(zt,1);continue}if(r){var Sr="".concat(mt.id,"-").concat(ft.id),jr=f[Sr];kt=Le[wt].length-1;var pn=Le[wt][kt];if(jr>pn){We.splice(zt,1);continue}}var Jn=q[pt]?q[pt]:nHt(e,ft,mt,p,ar,w,V,o,s,q,C),Rn="".concat(Y.id,"-").concat(wt),hi=me[Rn][me[Rn].length-1];if(Jn=0;ar--){var pn=jr(ar);if(pn==="break")break}if(Sr)return re.splice(Oe,1),"continue";J.edges=zt;var Jn=(0,YSe.default)(J,J.nodes[0].id,!1).length;if(Object.keys(Jn).reverse().forEach(function(ue){if(!(ue===J.nodes[0].id||Sr)){if(Jn[ue]===1/0){var xe=Qe[ue].node[o];if(Tt[xe]--,Tt[xe]<_[xe].length){Sr=!0;return}var ce=J.nodes.indexOf(Qe[ue].node);J.nodes.splice(ce,1),Qe[ue]=void 0;return}var pe=p[ue].node[o];if(!je[pe]||!je[pe].length||Jn[ue]>je[pe][je[pe].length-1]){var xe=Qe[ue].node[o];if(Tt[xe]--,Tt[xe]<_[xe].length){Sr=!0;return}var ce=J.nodes.indexOf(Qe[ue].node);J.nodes.splice(ce,1),Qe[ue]=void 0}}}),Sr)return re.splice(Oe,1),"continue";for(var Rn=!0,hi=0;Rn&&!Sr;){Rn=!1;var yn=r?Qe[We.id].degree=0;oi--){var Gi=J.nodes[oi],ws=Qe[Gi.id].degree,Sl=Qe[Gi.id].inDegree,Os=Qe[Gi.id].outDegree,no=Gi[o],vo=QSe(ie,no,y,_),No=vo.minPatternNodeLabelDegree,Jo=vo.minPatternNodeLabelInDegree,Lo=vo.minPatternNodeLabelOutDegree,hs=r?ws=0;Rs--){var Pn=zt[Rs];if(!Qe[Pn.source]||!Qe[Pn.target]){zt.splice(Rs,1);var mo=Pn[s];if(mt[mo]--,Qe[Pn.source]&&(Qe[Pn.source].degree--,Qe[Pn.source].outDegree--),Qe[Pn.target]&&(Qe[Pn.target].degree--,Qe[Pn.target].inDegree--),x[mo]&&mt[mo]=0;Zt--){var qe=Nt(Zt);if(qe==="break")break}for(var ur=re.length,Dt=function(Oe){var J=re[Oe],We={};J.edges.forEach(function(zt){var mt="".concat(zt.source,"-").concat(zt.target,"-").concat(zt.label);We[mt]?We[mt]++:We[mt]=1});for(var Tt=function(mt){var wt=re[mt],pt={};wt.edges.forEach(function(kt){var Dr="".concat(kt.source,"-").concat(kt.target,"-").concat(kt.label);pt[Dr]?pt[Dr]++:pt[Dr]=1});var ar=!0;Object.keys(pt).length!==Object.keys(We).length?ar=!1:Object.keys(We).forEach(function(kt){pt[kt]!==We[kt]&&(ar=!1)}),ar&&re.splice(mt,1)},Qe=ur-1;Qe>Oe;Qe--)Tt(Qe);ur=re.length},Zt=0;Zt<=ur-1;Zt++)Dt(Zt);return re}}},aHt=iHt;QU.default=aHt;(function(n){function e(x){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},e(x)}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"GADDI",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(n,"breadthFirstSearch",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"connectedComponent",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"depthFirstSearch",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"detectCycle",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"dijkstra",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"findAllPath",{enumerable:!0,get:function(){return u.findAllPath}}),Object.defineProperty(n,"findShortestPath",{enumerable:!0,get:function(){return u.findShortestPath}}),Object.defineProperty(n,"floydWarshall",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(n,"getAdjMatrix",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(n,"getDegree",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"getInDegree",{enumerable:!0,get:function(){return a.getInDegree}}),Object.defineProperty(n,"getNeighbors",{enumerable:!0,get:function(){return g.getNeighbors}}),Object.defineProperty(n,"getOutDegree",{enumerable:!0,get:function(){return a.getOutDegree}}),Object.defineProperty(n,"labelPropagation",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(n,"louvain",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(n,"minimumSpanningTree",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(n,"pageRank",{enumerable:!0,get:function(){return v.default}});var t=_(aT),r=_(WU),i=_(qS),a=y(q1),o=_(zy),s=_(jU),l=_(YI),u=MM,h=_(W3),c=_(XU),f=_(YU),d=_(qU),v=_(JU),p=_(QU),g=Du;function m(x){if(typeof WeakMap!="function")return null;var S=new WeakMap,w=new WeakMap;return(m=function(E){return E?w:S})(x)}function y(x,S){if(!S&&x&&x.__esModule)return x;if(x===null||e(x)!=="object"&&typeof x!="function")return{default:x};var w=m(S);if(w&&w.has(x))return w.get(x);var b={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in x)if(T!=="default"&&Object.prototype.hasOwnProperty.call(x,T)){var C=E?Object.getOwnPropertyDescriptor(x,T):null;C&&(C.get||C.set)?Object.defineProperty(b,T,C):b[T]=x[T]}return b.default=x,w&&w.set(x,b),b}function _(x){return x&&x.__esModule?x:{default:x}}})(FUe);function pee(n){return pee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pee(n)}Object.defineProperty($U,"__esModule",{value:!0});$U.default=void 0;var UX=oHt(FUe),ewe=YS;function oVe(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(oVe=function(i){return i?t:e})(n)}function oHt(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||pee(n)!=="object"&&typeof n!="function")return{default:n};var t=oVe(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in n)if(a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)){var o=i?Object.getOwnPropertyDescriptor(n,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=n[a]}return r.default=n,t&&t.set(n,r),r}var VX=typeof self<"u"?self:{};VX.onmessage=function(n){var e=n.data,t=e._algorithmType,r=e.data;if(!!t){if(typeof UX[t]=="function"){var i=UX[t].apply(UX,r);VX.postMessage({_algorithmType:ewe.MESSAGE.SUCCESS,data:i});return}VX.postMessage({_algorithmType:ewe.MESSAGE.FAILURE})}};var sHt=null;$U.default=sHt;Object.defineProperty(VU,"__esModule",{value:!0});VU.default=void 0;var lHt=YS,uHt=hHt($U);function hHt(n){return n&&n.__esModule?n:{default:n}}var cHt=function(e){return function(){for(var t=[],r=0;r=n&&i<=n+t&&a>=e&&a<=e+r}function qD(n,e){return!(e.minX>n.maxX||e.maxXn.maxY||e.maxY=0&&i<1/2*Math.PI?(s={x:o.minX,y:o.minY},l={x:o.maxX,y:o.maxY}):1/2*Math.PI<=i&&i1&&(t*=Math.sqrt(d),r*=Math.sqrt(d));var v=t*t*(f*f)+r*r*(c*c),p=v?Math.sqrt((t*t*(r*r)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var g=r?p*t*f/r:0,m=t?p*-r*c/t:0,y=(s+u)/2+Math.cos(i)*g-Math.sin(i)*m,_=(l+h)/2+Math.sin(i)*g+Math.cos(i)*m,x=[(c-g)/t,(f-m)/r],S=[(-1*c-g)/t,(-1*f-m)/r],w=rwe([1,0],x),b=rwe(x,S);return gee(x,S)<=-1&&(b=Math.PI),gee(x,S)>=1&&(b=0),o===0&&b>0&&(b=b-2*Math.PI),o===1&&b<0&&(b=b+2*Math.PI),{cx:y,cy:_,rx:twe(n,[u,h])?0:t,ry:twe(n,[u,h])?0:r,startAngle:w,endAngle:w+b,xRotation:i,arcFlag:a,sweepFlag:o}}var b9=Math.sin,E9=Math.cos,Tse=Math.atan2,E5=Math.PI;function hVe(n,e,t,r,i,a,o){var s=e.stroke,l=e.lineWidth,u=t-i,h=r-a,c=Tse(h,u),f=new Ise({type:"path",canvas:n.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*E9(E5/6)+","+10*b9(E5/6)+" L0,0 L"+10*E9(E5/6)+",-"+10*b9(E5/6),stroke:s,lineWidth:l}});f.translate(i,a),f.rotateAtPoint(i,a,c),n.set(o?"startArrowShape":"endArrowShape",f)}function cVe(n,e,t,r,i,a,o){var s=e.startArrow,l=e.endArrow,u=e.stroke,h=e.lineWidth,c=o?s:l,f=c.d,d=c.fill,v=c.stroke,p=c.lineWidth,g=rh(c,["d","fill","stroke","lineWidth"]),m=t-i,y=r-a,_=Tse(y,m);f&&(i=i-E9(_)*f,a=a-b9(_)*f);var x=new Ise({type:"path",canvas:n.get("canvas"),isArrowShape:!0,attrs:ve(ve({},g),{stroke:v||u,lineWidth:p||h,fill:d})});x.translate(i,a),x.rotateAtPoint(i,a,_),n.set(o?"startArrowShape":"endArrowShape",x)}function kE(n,e,t,r,i){var a=Tse(r-e,t-n);return{dx:E9(a)*i,dy:b9(a)*i}}function Cse(n,e,t,r,i,a){typeof e.startArrow=="object"?cVe(n,e,t,r,i,a,!0):e.startArrow?hVe(n,e,t,r,i,a,!0):n.set("startArrowShape",null)}function Ase(n,e,t,r,i,a){typeof e.endArrow=="object"?cVe(n,e,t,r,i,a,!1):e.endArrow?hVe(n,e,t,r,i,a,!1):n.set("startArrowShape",null)}var iwe={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function LM(n,e){var t=e.attr();for(var r in t){var i=t[r],a=iwe[r]?iwe[r]:r;a==="matrix"&&i?n.transform(i[0],i[1],i[3],i[4],i[6],i[7]):a==="lineDash"&&n.setLineDash?vn(i)&&n.setLineDash(i):(a==="strokeStyle"||a==="fillStyle"?i=$Ht(n,e,i):a==="globalAlpha"&&(i=i*n.globalAlpha),n[a]=i)}}function yee(n,e,t){for(var r=0;rS?x:S,A=x>S?1:x/S,M=x>S?S/x:1;e.translate(y,_),e.rotate(E),e.scale(A,M),e.arc(0,0,C,w,b,1-T),e.scale(1/A,1/M),e.rotate(-E),e.translate(-y,-_)}break}case"Z":e.closePath();break}if(f==="Z")s=l;else{var I=c.length;s=[c[I-2],c[I-1]]}}}}function vVe(n,e){var t=n.get("canvas");t&&(e==="remove"&&(n._cacheCanvasBBox=n.get("cacheCanvasBBox")),n.get("hasChanged")||(n.set("hasChanged",!0),n.cfg.parent&&n.cfg.parent.get("hasChanged")||(t.refreshElement(n,e,t),t.get("autoDraw")&&t.draw())))}function XHt(n){var e;if(n.destroyed)e=n._cacheCanvasBBox;else{var t=n.get("cacheCanvasBBox"),r=t&&!!(t.width&&t.height),i=n.getCanvasBBox(),a=i&&!!(i.width&&i.height);r&&a?e=kHt(t,i):r?e=t:a&&(e=i)}return e}function YHt(n){if(!n.length)return null;var e=[],t=[],r=[],i=[];return At(n,function(a){var o=XHt(a);o&&(e.push(o.minX),t.push(o.minY),r.push(o.maxX),i.push(o.maxY))}),{minX:dm(e),minY:dm(t),maxX:fm(r),maxY:fm(i)}}function qHt(n,e){return!n||!e||!qD(n,e)?null:{minX:Math.max(n.minX,e.minX),minY:Math.max(n.minY,e.minY),maxX:Math.min(n.maxX,e.maxX),maxY:Math.min(n.maxY,e.maxY)}}var pVe=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onCanvasChange=function(t){vVe(this,t)},e.prototype.getShapeBase=function(){return pne},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,r){r&&(t.save(),LM(t,r),r.createPath(t),t.restore(),t.clip(),r._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,r=[],i=[];At(t,function(f){var d=f.cfg.cacheCanvasBBox;d&&f.cfg.isInView&&(r.push(d.minX,d.maxX),i.push(d.minY,d.maxY))});var a=null;if(r.length){var o=dm(r),s=fm(r),l=dm(i),u=fm(i);a={minX:o,minY:l,x:o,y:l,maxX:s,maxY:u,width:s-o,height:u-l};var h=this.cfg.canvas;if(h){var c=h.getViewRange();this.set("isInView",qD(a,c))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",a)},e.prototype.draw=function(t,r){var i=this.cfg.children,a=r?this.cfg.refresh:!0;i.length&&a&&(t.save(),LM(t,this),this._applyClip(t,this.getClip()),yee(t,i,r),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(Zze),ZHt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return pne},e.prototype.getGroupBase=function(){return pVe},e.prototype.onCanvasChange=function(t){vVe(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),r=this.getHitLineWidth(),i=Qze(t),a=i(this),o=r/2,s=a.x-o,l=a.y-o,u=a.x+a.width+o,h=a.y+a.height+o;return{x:s,minX:s,y:l,minY:l,width:a.width+r,height:a.height+r,maxX:u,maxY:h}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,r){r&&(t.save(),LM(t,r),r.createPath(t),t.restore(),t.clip(),r._afterDraw())},e.prototype.draw=function(t,r){var i=this.cfg.clipShape;if(r){if(this.cfg.refresh===!1){this.set("hasChanged",!1);return}var a=this.getCanvasBBox();if(!qD(r,a)){this.set("hasChanged",!1),this.cfg.isInView&&this._afterDraw();return}}t.save(),LM(t,this),this._applyClip(t,i),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var r=this.getCanvasBBox(),i=qD(r,t);this.set("isInView",i),i?this.set("cacheCanvasBBox",r):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var r=this.attrs,i=r.lineWidth,a=r.opacity,o=r.strokeOpacity,s=r.fillOpacity;this.isFill()&&(!an(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.isStroke()&&i>0&&(!an(o)&&o!==1&&(t.globalAlpha=o),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,r){var i=this.isStroke(),a=this.isFill(),o=this.getHitLineWidth();return this.isInStrokeOrPath(t,r,i,a,o)},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(Kze);const F0=ZHt;var KHt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){var s=this.attr(),l=s.x,u=s.y,h=s.r,c=o/2,f=sVe(l,u,t,r);return a&&i?f<=h+c:a?f<=h:i?f>=h-c&&f<=h+c:!1},e.prototype.createPath=function(t){var r=this.attr(),i=r.x,a=r.y,o=r.r;t.beginPath(),t.arc(i,a,o,0,Math.PI*2,!1),t.closePath()},e}(F0);const JHt=KHt;function T5(n,e,t,r){return n/(t*t)+e/(r*r)}var QHt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){var s=this.attr(),l=o/2,u=s.x,h=s.y,c=s.rx,f=s.ry,d=(t-u)*(t-u),v=(r-h)*(r-h);return a&&i?T5(d,v,c+l,f+l)<=1:a?T5(d,v,c,f)<=1:i?T5(d,v,c-l,f-l)>=1&&T5(d,v,c+l,f+l)<=1:!1},e.prototype.createPath=function(t){var r=this.attr(),i=r.x,a=r.y,o=r.rx,s=r.ry;if(t.beginPath(),t.ellipse)t.ellipse(i,a,o,s,0,0,Math.PI*2,!1);else{var l=o>s?o:s,u=o>s?1:o/s,h=o>s?s/o:1;t.save(),t.translate(i,a),t.scale(u,h),t.arc(0,0,l,0,Math.PI*2),t.restore(),t.closePath()}},e}(F0);const ejt=QHt;function awe(n){return n instanceof HTMLElement&&rr(n.nodeName)&&n.nodeName.toUpperCase()==="CANVAS"}var tjt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(this.get("toDraw")===!0){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var r=this,i=this.attrs;if(rr(t)){var a=new Image;a.onload=function(){if(r.destroyed)return!1;r.attr("img",a),r.set("loading",!1),r._afterLoading();var o=r.get("callback");o&&o.call(r)},a.crossOrigin="Anonymous",a.src=t,this.set("loading",!0)}else t instanceof Image?(i.width||(i.width=t.width),i.height||(i.height=t.height)):awe(t)&&(i.width||(i.width=Number(t.getAttribute("width"))),i.height||(i.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),t==="img"&&this._setImage(r)},e.prototype.createPath=function(t){if(this.get("loading")){this.set("toDraw",!0),this.set("context",t);return}var r=this.attr(),i=r.x,a=r.y,o=r.width,s=r.height,l=r.sx,u=r.sy,h=r.swidth,c=r.sheight,f=r.img;(f instanceof Image||awe(f))&&(!an(l)&&!an(u)&&!an(h)&&!an(c)?t.drawImage(f,l,u,h,c,i,a,o,s):t.drawImage(f,i,a,o,s))},e}(F0);const rjt=tjt;function oS(n,e,t,r,i,a,o){var s=Math.min(n,t),l=Math.max(n,t),u=Math.min(e,r),h=Math.max(e,r),c=i/2;return a>=s-c&&a<=l+c&&o>=u-c&&o<=h+c?Fh.pointToLine(n,e,t,r,a,o)<=i/2:!1}var njt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.startArrow,l=t.endArrow;s&&Cse(this,t,a,o,r,i),l&&Ase(this,t,r,i,a,o)},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){if(!i||!o)return!1;var s=this.attr(),l=s.x1,u=s.y1,h=s.x2,c=s.y2;return oS(l,u,h,c,o,t,r)},e.prototype.createPath=function(t){var r=this.attr(),i=r.x1,a=r.y1,o=r.x2,s=r.y2,l=r.startArrow,u=r.endArrow,h={dx:0,dy:0},c={dx:0,dy:0};l&&l.d&&(h=kE(i,a,o,s,r.startArrow.d)),u&&u.d&&(c=kE(i,a,o,s,r.endArrow.d)),t.beginPath(),t.moveTo(i+h.dx,a+h.dy),t.lineTo(o-c.dx,s-c.dy)},e.prototype.afterDrawPath=function(t){var r=this.get("startArrowShape"),i=this.get("endArrowShape");r&&r.draw(t),i&&i.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),r=t.x1,i=t.y1,a=t.x2,o=t.y2;return Fh.length(r,i,a,o)},e.prototype.getPoint=function(t){var r=this.attr(),i=r.x1,a=r.y1,o=r.x2,s=r.y2;return Fh.pointAt(i,a,o,s,t)},e}(F0);const ijt=njt;var ajt={circle:function(n,e,t){return[["M",n-t,e],["A",t,t,0,1,0,n+t,e],["A",t,t,0,1,0,n-t,e]]},square:function(n,e,t){return[["M",n-t,e-t],["L",n+t,e-t],["L",n+t,e+t],["L",n-t,e+t],["Z"]]},diamond:function(n,e,t){return[["M",n-t,e],["L",n,e-t],["L",n+t,e],["L",n,e+t],["Z"]]},triangle:function(n,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",n-t,e+r],["L",n,e-r],["L",n+t,e+r],["Z"]]},"triangle-down":function(n,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",n-t,e-r],["L",n+t,e-r],["L",n,e+r],["Z"]]}},ojt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),["symbol","x","y","r","radius"].indexOf(t)!==-1&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return an(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t=this.attr(),r=t.x,i=t.y,a=t.symbol||"circle",o=this._getR(t),s,l;if(nl(a))s=a,l=s(r,i,o),l=fUe(l);else{if(s=e.Symbols[a],!s)return console.warn(a+" marker is not supported."),null;l=s(r,i,o)}return l},e.prototype.createPath=function(t){var r=this._getPath(),i=this.get("paramsCache");dVe(this,t,{path:r},i)},e.Symbols=ajt,e}(F0);const sjt=ojt;function gVe(n,e,t){var r=lUe();return n.createPath(r),r.isPointInPath(e,t)}var ljt=1e-6;function $X(n){return Math.abs(n)0!=$X(s[1]-t)>0&&$X(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function mO(n,e,t,r,i,a,o,s){var l=(Math.atan2(s-e,o-n)+Math.PI*2)%(Math.PI*2);if(li)return!1;var u={x:n+t*Math.cos(l),y:e+t*Math.sin(l)};return sVe(u.x,u.y,o,s)<=a/2}var hjt=sg;function cjt(n){for(var e=!1,t=n.length,r=0;r_?y:_,T=y>_?1:y/_,C=y>_?_/y:1,A=hjt(null,[["t",-g,-m],["r",-w],["s",1/T,1/C]]);FU(b,b,A),a=mO(0,0,E,x,S,e,b[0],b[1]);break}if(a)break}}return a}function djt(n){for(var e=n.length,t=[],r=[],i=[],a=0;a0&&r.push(i),{polygons:t,polylines:r}}const C5=ve({hasArc:cjt,extractPolygons:djt,isPointInStroke:fjt},vzt);function owe(n,e,t){for(var r=!1,i=0;i=h[0]&&t<=h[1]&&(i=(t-h[0])/(h[1]-h[0]),a=c)});var s=o[a];if(an(s)||an(a))return null;var l=s.length,u=o[a+1];return pR.pointAt(s[l-2],s[l-1],u[1],u[2],u[3],u[4],u[5],u[6],i)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",C5.pathToCurve(t))},e.prototype._setTcache=function(){var t=0,r=0,i=[],a,o,s,l,u=this.get("curve");if(!!u){if(At(u,function(h,c){s=u[c+1],l=h.length,s&&(t+=pR.length(h[l-2],h[l-1],s[1],s[2],s[3],s[4],s[5],s[6])||0)}),this.set("totalLength",t),t===0){this.set("tCache",[]);return}At(u,function(h,c){s=u[c+1],l=h.length,s&&(a=[],a[0]=r/t,o=pR.length(h[l-2],h[l-1],s[1],s[2],s[3],s[4],s[5],s[6]),r+=o||0,a[1]=r/t,i.push(a))}),this.set("tCache",i)}},e.prototype.getStartTangent=function(){var t=this.getSegments(),r;if(t.length>1){var i=t[0].currentPoint,a=t[1].currentPoint,o=t[1].startTangent;r=[],o?(r.push([i[0]-o[0],i[1]-o[1]]),r.push([i[0],i[1]])):(r.push([a[0],a[1]]),r.push([i[0],i[1]]))}return r},e.prototype.getEndTangent=function(){var t=this.getSegments(),r=t.length,i;if(r>1){var a=t[r-2].currentPoint,o=t[r-1].currentPoint,s=t[r-1].endTangent;i=[],s?(i.push([o[0]-s[0],o[1]-s[1]]),i.push([o[0],o[1]])):(i.push([a[0],a[1]]),i.push([o[0],o[1]]))}return i},e}(F0);const Ise=vjt;function mVe(n,e,t,r,i){var a=n.length;if(a<2)return!1;for(var o=0;o=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Fh.pointAt(r[o][0],r[o][1],r[o+1][0],r[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var r=this.getTotalLength();if(!(r<=0)){var i=0,a=[],o,s;At(t,function(l,u){t[u+1]&&(o=[],o[0]=i/r,s=Fh.length(l[0],l[1],t[u+1][0],t[u+1][1]),i+=s,o[1]=i/r,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,r=[];return r.push([t[1][0],t[1][1]]),r.push([t[0][0],t[0][1]]),r},e.prototype.getEndTangent=function(){var t=this.attr().points,r=t.length-1,i=[];return i.push([t[r-1][0],t[r-1][1]]),i.push([t[r][0],t[r][1]]),i},e}(F0);const mjt=yjt;function _jt(n,e,t,r,i,a,o){var s=i/2;return dE(n-s,e-s,t,i,a,o)||dE(n+t-s,e-s,i,r,a,o)||dE(n+s,e+r-s,t,i,a,o)||dE(n-s,e+s,i,r,a,o)}function xjt(n,e,t,r,i,a,o,s){return oS(n+i,e,n+t-i,e,a,o,s)||oS(n+t,e+i,n+t,e+r-i,a,o,s)||oS(n+t-i,e+r,n+i,e+r,a,o,s)||oS(n,e+r-i,n,e+i,a,o,s)||mO(n+t-i,e+i,i,1.5*Math.PI,2*Math.PI,a,o,s)||mO(n+t-i,e+r-i,i,0,.5*Math.PI,a,o,s)||mO(n+i,e+r-i,i,.5*Math.PI,Math.PI,a,o,s)||mO(n+i,e+i,i,Math.PI,1.5*Math.PI,a,o,s)}var Sjt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){var s=this.attr(),l=s.x,u=s.y,h=s.width,c=s.height,f=s.radius;if(f){var v=!1;return i&&(v=xjt(l,u,h,c,f,o,t,r)),!v&&a&&(v=gVe(this,t,r)),v}else{var d=o/2;if(a&&i)return dE(l-d,u-d,h+d,c+d,t,r);if(a)return dE(l,u,h,c,t,r);if(i)return _jt(l,u,h,c,o,t,r)}},e.prototype.createPath=function(t){var r=this.attr(),i=r.x,a=r.y,o=r.width,s=r.height,l=r.radius;if(t.beginPath(),l===0)t.rect(i,a,o,s);else{var u=WHt(l),h=u[0],c=u[1],f=u[2],d=u[3];t.moveTo(i+h,a),t.lineTo(i+o-c,a),c!==0&&t.arc(i+o-c,a+c,c,-Math.PI/2,0),t.lineTo(i+o,a+s-f),f!==0&&t.arc(i+o-f,a+s-f,f,0,Math.PI/2),t.lineTo(i+d,a+s),d!==0&&t.arc(i+d,a+s-d,d,Math.PI/2,Math.PI),t.lineTo(i,a+h),h!==0&&t.arc(i+h,a+h,h,Math.PI,Math.PI*1.5),t.closePath()}},e}(F0);const wjt=Sjt;var bjt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=hUe(t)},e.prototype._setText=function(t){var r=null;rr(t)&&t.indexOf(` `)!==-1&&(r=t.split(` `)),this.set("textArr",r)},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),t.startsWith("font")&&this._assembleFont(),t==="text"&&this._setText(r)},e.prototype._getSpaceingY=function(){var t=this.attrs,r=t.lineHeight,i=t.fontSize*1;return r?r-i:i*.14},e.prototype._drawTextArr=function(t,r,i){var a=this.attrs,o=a.textBaseline,s=a.x,l=a.y,u=a.fontSize*1,h=this._getSpaceingY(),c=uUe(a.text,a.fontSize,a.lineHeight),f;At(r,function(d,v){f=l+v*(h+u)-c+u,o==="middle"&&(f+=c-u-(c-u)/2),o==="top"&&(f+=c-u),an(d)||(i?t.fillText(d,s,f):t.strokeText(d,s,f))})},e.prototype._drawText=function(t,r){var i=this.attr(),a=i.x,o=i.y,s=this.get("textArr");if(s)this._drawTextArr(t,s,r);else{var l=i.text;an(l)||(r?t.fillText(l,a,o):t.strokeText(l,a,o))}},e.prototype.strokeAndFill=function(t){var r=this.attrs,i=r.lineWidth,a=r.opacity,o=r.strokeOpacity,s=r.fillOpacity;this.isStroke()&&i>0&&(!an(o)&&o!==1&&(t.globalAlpha=a),this.stroke(t)),this.isFill()&&(!an(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(F0);const Ejt=bjt;function Tjt(n,e){if(e){var t=Rze(e);return cE(t,n)}return n}function _Ve(n,e,t){var r=n.getTotalMatrix();if(r){var i=Tjt([e,t,1],r),a=i[0],o=i[1];return[a,o]}return[e,t]}function swe(n,e,t){if(n.isCanvas&&n.isCanvas())return!0;if(!HQ(n)||n.cfg.isInView===!1)return!1;if(n.cfg.clipShape){var r=_Ve(n,e,t),i=r[0],a=r[1];if(n.isClipped(i,a))return!1}var o=n.cfg.cacheCanvasBBox||n.getCanvasBBox();return e>=o.minX&&e<=o.maxX&&t>=o.minY&&t<=o.maxY}function xVe(n,e,t){if(!swe(n,e,t))return null;for(var r=null,i=n.getChildren(),a=i.length,o=a-1;o>=0;o--){var s=i[o];if(s.isGroup())r=xVe(s,e,t);else if(swe(s,e,t)){var l=s,u=_Ve(s,e,t),h=u[0],c=u[1];l.isInShape(h,c)&&(r=s)}if(r)break}return r}var M1=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=n.prototype.getDefaultCfg.call(this);return t.renderer="canvas",t.autoDraw=!0,t.localRefresh=!0,t.refreshElements=[],t.clipView=!0,t.quickHit=!1,t},e.prototype.onCanvasChange=function(t){(t==="attr"||t==="sort"||t==="changeSize")&&(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return pne},e.prototype.getGroupBase=function(){return pVe},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||NHt();return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),r=t.getContext("2d");return this.set("context",r),t},e.prototype.setDOMSize=function(t,r){n.prototype.setDOMSize.call(this,t,r);var i=this.get("context"),a=this.get("el"),o=this.getPixelRatio();a.width=o*t,a.height=o*r,o>1&&i.scale(o,o)},e.prototype.clear=function(){n.prototype.clear.call(this),this._clearFrame();var t=this.get("context"),r=this.get("el");t.clearRect(0,0,r.width,r.height)},e.prototype.getShape=function(t,r){var i;return this.get("quickHit")?i=xVe(this,t,r):i=n.prototype.getShape.call(this,t,r,null),i},e.prototype._getRefreshRegion=function(){var t=this.get("refreshElements"),r=this.getViewRange(),i;if(t.length&&t[0]===this)i=r;else if(i=YHt(t),i){i.minX=Math.floor(i.minX),i.minY=Math.floor(i.minY),i.maxX=Math.ceil(i.maxX),i.maxY=Math.ceil(i.maxY),i.maxY+=1;var a=this.get("clipView");a&&(i=qHt(i,r))}return i},e.prototype.refreshElement=function(t){var r=this.get("refreshElements");r.push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(S9e(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),r=this.get("el"),i=this.getChildren();t.clearRect(0,0,r.width,r.height),LM(t,this),yee(t,i),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),r=this.get("refreshElements"),i=this.getChildren(),a=this._getRefreshRegion();a?(t.clearRect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.save(),t.beginPath(),t.rect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.clip(),LM(t,this),HHt(this,i,a),yee(t,i,a),t.restore()):r.length&&fVe(r),At(r,function(o){o.get("hasChanged")&&o.set("hasChanged",!1)}),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,r=this.get("drawFrame"),i=this.get("drawFrameCallback");r||(r=x9e(function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null),i&&i()}),this.set("drawFrame",r))},e.prototype.skipDraw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},e}(qze),_ee={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},Qa={opacity:"opacity",fillStyle:"fill",fill:"fill",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",x:"x",y:"y",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"};function $p(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function SVe(n){var e=_ee[n.type],t=n.getParent();if(!e)throw new Error("the type "+n.type+" is not supported by svg");var r=$p(e);if(n.get("id")&&(r.id=n.get("id")),n.set("el",r),n.set("attrs",{}),t){var i=t.get("el");i||(i=t.createDom(),t.set("el",i)),i.appendChild(r)}return r}function wVe(n,e){var t=n.get("el"),r=T9e(t.children).sort(e),i=document.createDocumentFragment();r.forEach(function(a){i.appendChild(a)}),t.appendChild(i)}function Cjt(n,e){var t=n.parentNode,r=Array.from(t.childNodes).filter(function(s){return s.nodeType===1&&s.nodeName.toLowerCase()!=="defs"}),i=r[e],a=r.indexOf(n);if(i){if(a>e)t.insertBefore(n,i);else if(a0&&(r?"stroke"in i?this._setColor(t,"stroke",s):"strokeStyle"in i&&this._setColor(t,"stroke",l):this._setColor(t,"stroke",s||l),h&&f.setAttribute(Qa.strokeOpacity,h),c&&f.setAttribute(Qa.lineWidth,c))},e.prototype._setColor=function(t,r,i){var a=this.get("el");if(!i){a.setAttribute(Qa[r],"none");return}if(i=i.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(i)){var o=t.find("gradient",i);o||(o=t.addGradient(i)),a.setAttribute(Qa[r],"url(#"+o+")")}else if(/^[p,P]{1}[\s]*\(/.test(i)){var o=t.find("pattern",i);o||(o=t.addPattern(i)),a.setAttribute(Qa[r],"url(#"+o+")")}else a.setAttribute(Qa[r],i)},e.prototype.shadow=function(t,r){var i=this.attr(),a=r||i,o=a.shadowOffsetX,s=a.shadowOffsetY,l=a.shadowBlur,u=a.shadowColor;(o||s||l||u)&&Ajt(this,t)},e.prototype.transform=function(t){var r=this.attr(),i=(t||r).matrix;i&&X3(this)},e.prototype.isInShape=function(t,r){return this.isPointInPath(t,r)},e.prototype.isPointInPath=function(t,r){var i=this.get("el"),a=this.get("canvas"),o=a.get("el").getBoundingClientRect(),s=t+o.left,l=r+o.top,u=document.elementFromPoint(s,l);return!!(u&&u.isEqualNode(i))},e.prototype.getHitLineWidth=function(){var t=this.attrs,r=t.lineWidth,i=t.lineAppendWidth;return this.isStroke()?r+i:0},e}(Kze);const lg=Mjt;var Ijt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="circle",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,r:0})},e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");At(r||i,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):Qa[s]&&a.setAttribute(Qa[s],o)})},e}(lg);const Ljt=Ijt;var Pjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="dom",t.canFill=!1,t.canStroke=!1,t}return e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");if(At(r||i,function(u,h){Qa[h]&&a.setAttribute(Qa[h],u)}),typeof i.html=="function"){var o=i.html.call(this,i);if(o instanceof Element||o instanceof HTMLDocument){for(var s=a.childNodes,l=s.length-1;l>=0;l--)a.removeChild(s[l]);a.appendChild(o)}else a.innerHTML=o}else a.innerHTML=i.html},e}(lg);const Ojt=Pjt;var Rjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="ellipse",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");At(r||i,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):Qa[s]&&a.setAttribute(Qa[s],o)})},e}(lg);const Djt=Rjt;var Njt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="image",t.canFill=!1,t.canStroke=!1,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,r){var i=this,a=this.attr(),o=this.get("el");At(r||a,function(s,l){l==="img"?i._setImage(a.img):Qa[l]&&o.setAttribute(Qa[l],s)})},e.prototype.setAttr=function(t,r){this.attrs[t]=r,t==="img"&&this._setImage(r)},e.prototype._setImage=function(t){var r=this.attr(),i=this.get("el");if(rr(t))i.setAttribute("href",t);else if(t instanceof window.Image)r.width||(i.setAttribute("width",t.width),this.attr("width",t.width)),r.height||(i.setAttribute("height",t.height),this.attr("height",t.height)),i.setAttribute("href",t.src);else if(t instanceof HTMLElement&&rr(t.nodeName)&&t.nodeName.toUpperCase()==="CANVAS")i.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var a=document.createElement("canvas");a.setAttribute("width",""+t.width),a.setAttribute("height",""+t.height),a.getContext("2d").putImageData(t,0,0),r.width||(i.setAttribute("width",""+t.width),this.attr("width",t.width)),r.height||(i.setAttribute("height",""+t.height),this.attr("height",t.height)),i.setAttribute("href",a.toDataURL())}},e}(lg);const kjt=Njt;var Fjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="line",t.canFill=!1,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");At(r||i,function(o,s){if(s==="startArrow"||s==="endArrow")if(o){var l=Wh(o)?t.addArrow(i,Qa[s]):t.getDefaultArrow(i,Qa[s]);a.setAttribute(Qa[s],"url(#"+l+")")}else a.removeAttribute(Qa[s]);else Qa[s]&&a.setAttribute(Qa[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr(),r=t.x1,i=t.y1,a=t.x2,o=t.y2;return Fh.length(r,i,a,o)},e.prototype.getPoint=function(t){var r=this.attr(),i=r.x1,a=r.y1,o=r.x2,s=r.y2;return Fh.pointAt(i,a,o,s,t)},e}(lg);const Bjt=Fjt;var A5={circle:function(n,e,t){return[["M",n,e],["m",-t,0],["a",t,t,0,1,0,t*2,0],["a",t,t,0,1,0,-t*2,0]]},square:function(n,e,t){return[["M",n-t,e-t],["L",n+t,e-t],["L",n+t,e+t],["L",n-t,e+t],["Z"]]},diamond:function(n,e,t){return[["M",n-t,e],["L",n,e-t],["L",n+t,e],["L",n,e+t],["Z"]]},triangle:function(n,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",n-t,e+r],["L",n,e-r],["L",n+t,e+r],["z"]]},triangleDown:function(n,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",n-t,e-r],["L",n+t,e-r],["L",n,e+r],["Z"]]}};const lwe={get:function(n){return A5[n]},register:function(n,e){A5[n]=e},remove:function(n){delete A5[n]},getAll:function(){return A5}};var Gjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="marker",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t){var r=this.get("el");r.setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return vn(t)?t.map(function(r){return r.join(" ")}).join(""):t},e.prototype._getPath=function(){var t=this.attr(),r=t.x,i=t.y,a=t.r||t.radius,o=t.symbol||"circle",s;return nl(o)?s=o:s=lwe.get(o),s?s(r,i,a):(console.warn(s+" symbol is not exist."),null)},e.symbolsFactory=lwe,e}(lg);const zjt=Gjt;var Ujt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="path",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,r){var i=this,a=this.attr(),o=this.get("el");At(r||a,function(s,l){if(l==="path"&&vn(s))o.setAttribute("d",i._formatPath(s));else if(l==="startArrow"||l==="endArrow")if(s){var u=Wh(s)?t.addArrow(a,Qa[l]):t.getDefaultArrow(a,Qa[l]);o.setAttribute(Qa[l],"url(#"+u+")")}else o.removeAttribute(Qa[l]);else Qa[l]&&o.setAttribute(Qa[l],s)})},e.prototype._formatPath=function(t){var r=t.map(function(i){return i.join(" ")}).join("");return~r.indexOf("NaN")?"":r},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var r=this.get("el"),i=this.getTotalLength();if(i===0)return null;var a=r?r.getPointAtLength(t*i):null;return a?{x:a.x,y:a.y}:null},e}(lg);const Vjt=Ujt;var $jt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="polygon",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");At(r||i,function(o,s){s==="points"&&vn(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):Qa[s]&&a.setAttribute(Qa[s],o)})},e}(lg);const Wjt=$jt;var Hjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="polyline",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),["points"].indexOf(t)!==-1&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");At(r||i,function(o,s){s==="points"&&vn(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):Qa[s]&&a.setAttribute(Qa[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr().points,r=this.get("totalLength");return an(r)?(this.set("totalLength",sUe.length(t)),this.get("totalLength")):r},e.prototype.getPoint=function(t){var r=this.attr().points,i=this.get("tCache");i||(this._setTcache(),i=this.get("tCache"));var a,o;return At(i,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Fh.pointAt(r[o][0],r[o][1],r[o+1][0],r[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var r=this.getTotalLength();if(!(r<=0)){var i=0,a=[],o,s;At(t,function(l,u){t[u+1]&&(o=[],o[0]=i/r,s=Fh.length(l[0],l[1],t[u+1][0],t[u+1][1]),i+=s,o[1]=i/r,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,r=[];return r.push([t[1][0],t[1][1]]),r.push([t[0][0],t[0][1]]),r},e.prototype.getEndTangent=function(){var t=this.attr().points,r=t.length-1,i=[];return i.push([t[r-1][0],t[r-1][1]]),i.push([t[r][0],t[r][1]]),i},e}(lg);const jjt=Hjt;function Xjt(n){var e=0,t=0,r=0,i=0;return vn(n)?n.length===1?e=t=r=i=n[0]:n.length===2?(e=r=n[0],t=i=n[1]):n.length===3?(e=n[0],t=i=n[1],r=n[2]):(e=n[0],t=n[1],r=n[2],i=n[3]):e=t=r=i=n,{r1:e,r2:t,r3:r,r4:i}}var Yjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="rect",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,r){var i=this,a=this.attr(),o=this.get("el"),s=!1,l=["x","y","width","height","radius"];At(r||a,function(u,h){l.indexOf(h)!==-1&&!s?(o.setAttribute("d",i._assembleRect(a)),s=!0):l.indexOf(h)===-1&&Qa[h]&&o.setAttribute(Qa[h],u)})},e.prototype._assembleRect=function(t){var r=t.x,i=t.y,a=t.width,o=t.height,s=t.radius;if(!s)return"M "+r+","+i+" l "+a+",0 l 0,"+o+" l"+-a+" 0 z";var l=Xjt(s);vn(s)?s.length===1?l.r1=l.r2=l.r3=l.r4=s[0]:s.length===2?(l.r1=l.r3=s[0],l.r2=l.r4=s[1]):s.length===3?(l.r1=s[0],l.r2=l.r4=s[1],l.r3=s[2]):(l.r1=s[0],l.r2=s[1],l.r3=s[2],l.r4=s[3]):l.r1=l.r2=l.r3=l.r4=s;var u=[["M "+(r+l.r1)+","+i],["l "+(a-l.r1-l.r2)+",0"],["a "+l.r2+","+l.r2+",0,0,1,"+l.r2+","+l.r2],["l 0,"+(o-l.r2-l.r3)],["a "+l.r3+","+l.r3+",0,0,1,"+-l.r3+","+l.r3],["l "+(l.r3+l.r4-a)+",0"],["a "+l.r4+","+l.r4+",0,0,1,"+-l.r4+","+-l.r4],["l 0,"+(l.r4+l.r1-o)],["a "+l.r1+","+l.r1+",0,0,1,"+l.r1+","+-l.r1],["z"]];return u.join(" ")},e}(lg);const qjt=Yjt;var uwe=.3,Zjt={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},Kjt={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},Jjt={left:"left",start:"left",center:"middle",right:"end",end:"end"},Qjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="text",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,r){var i=this,a=this.attr(),o=this.get("el");this._setFont(),At(r||a,function(s,l){l==="text"?i._setText(""+s):l==="matrix"&&s?X3(i):Qa[l]&&o.setAttribute(Qa[l],s)}),o.setAttribute("paint-order","stroke"),o.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),r=this.attr(),i=r.textBaseline,a=r.textAlign,o=Oze();o&&o.name==="firefox"?t.setAttribute("dominant-baseline",Kjt[i]||"alphabetic"):t.setAttribute("alignment-baseline",Zjt[i]||"baseline"),t.setAttribute("text-anchor",Jjt[a]||"left")},e.prototype._setText=function(t){var r=this.get("el"),i=this.attr(),a=i.x,o=i.textBaseline,s=o===void 0?"bottom":o;if(!t)r.innerHTML="";else if(~t.indexOf(` `)){var l=t.split(` `),u=l.length-1,h="";At(l,function(c,f){f===0?s==="alphabetic"?h+=''+c+"":s==="top"?h+=''+c+"":s==="middle"?h+=''+c+"":s==="bottom"?h+=''+c+"":s==="hanging"&&(h+=''+c+""):h+=''+c+""}),r.innerHTML=h}else r.innerHTML=t},e}(lg);const eXt=Qjt;var tXt=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,rXt=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,nXt=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function CVe(n){var e=n.match(nXt);if(!e)return"";var t="";return e.sort(function(r,i){return r=r.split(":"),i=i.split(":"),Number(r[0])-Number(i[0])}),At(e,function(r){r=r.split(":"),t+=''}),t}function iXt(n,e){var t=tXt.exec(n),r=DU(NU(parseFloat(t[1])),Math.PI*2),i=t[2],a,o;r>=0&&r<.5*Math.PI?(a={x:0,y:0},o={x:1,y:1}):.5*Math.PI<=r&&r`;t.innerHTML=r},n}(),hwe=function(){function n(e,t){this.cfg={};var r=$p("marker"),i=vm("marker_");r.setAttribute("id",i);var a=$p("path");a.setAttribute("stroke",e.stroke||"none"),a.setAttribute("fill",e.fill||"none"),r.appendChild(a),r.setAttribute("overflow","visible"),r.setAttribute("orient","auto-start-reverse"),this.el=r,this.child=a,this.id=i;var o=e[t==="marker-start"?"startArrow":"endArrow"];return this.stroke=e.stroke||"#000",o===!0?this._setDefaultPath(t,a):(this.cfg=o,this._setMarker(e.lineWidth,a)),this}return n.prototype.match=function(){return!1},n.prototype._setDefaultPath=function(e,t){var r=this.el;t.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),r.setAttribute("refX",""+10*Math.cos(Math.PI/6)),r.setAttribute("refY",""+5)},n.prototype._setMarker=function(e,t){var r=this.el,i=this.cfg.path,a=this.cfg.d;vn(i)&&(i=i.map(function(o){return o.join(" ")}).join("")),t.setAttribute("d",i),r.appendChild(t),a&&r.setAttribute("refX",""+a/e)},n.prototype.update=function(e){var t=this.child;t.attr?t.attr("fill",e):t.setAttribute("fill",e)},n}(),hXt=function(){function n(e){this.type="clip",this.cfg={};var t=$p("clipPath");this.el=t,this.id=vm("clip_"),t.id=this.id;var r=e.cfg.el;return t.appendChild(r),this.cfg=e,this}return n.prototype.match=function(){return!1},n.prototype.remove=function(){var e=this.el;e.parentNode.removeChild(e)},n}(),cXt=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,fXt=function(){function n(e){this.cfg={};var t=$p("pattern");t.setAttribute("patternUnits","userSpaceOnUse");var r=$p("image");t.appendChild(r);var i=vm("pattern_");t.id=i,this.el=t,this.id=i,this.cfg=e;var a=cXt.exec(e),o=a[2];r.setAttribute("href",o);var s=new Image;o.match(/^data:/i)||(s.crossOrigin="Anonymous"),s.src=o;function l(){t.setAttribute("width",""+s.width),t.setAttribute("height",""+s.height)}return s.complete?l():(s.onload=l,s.src=s.src),this}return n.prototype.match=function(e,t){return this.cfg===t},n}(),dXt=function(){function n(e){var t=$p("defs"),r=vm("defs_");t.id=r,e.appendChild(t),this.children=[],this.defaultArrow={},this.el=t,this.canvas=e}return n.prototype.find=function(e,t){for(var r=this.children,i=null,a=0;a]*>/,xee={tr:document.createElement("tbody"),tbody:_O,thead:_O,tfoot:_O,td:WX,th:WX,"*":document.createElement("div")}}function zs(n){_O||vXt();var e=AVe.test(n)&&RegExp.$1;(!e||!(e in xee))&&(e="*");var t=xee[e];n=typeof n=="string"?n.replace(/(^\s*)|(\s*$)/g,""):n,t.innerHTML=""+n;var r=t.childNodes[0];return r&&t.contains(r)&&t.removeChild(r),r}function Di(n,e){if(n)for(var t in e)e.hasOwnProperty(t)&&(n.style[t]=e[t]);return n}var MVe={exports:{}},IVe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},LVe={exports:{}},pXt=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")},gXt=pXt,yXt=Array.prototype.concat,mXt=Array.prototype.slice,cwe=LVe.exports=function(e){for(var t=[],r=0,i=e.length;r=4&&n[3]!==1&&(e=", "+n[3]),"hwb("+n[0]+", "+n[1]+"%, "+n[2]+"%"+e+")"};fv.to.keyword=function(n){return OVe[n.slice(0,3)]};function wS(n,e,t){return Math.min(Math.max(e,n),t)}function I5(n){var e=Math.round(n).toString(16).toUpperCase();return e.length<2?"0"+e:e}var Lse={exports:{}},FE=IVe,RVe={};for(var jX in FE)FE.hasOwnProperty(jX)&&(RVe[FE[jX]]=jX);var Ln=Lse.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var rd in Ln)if(Ln.hasOwnProperty(rd)){if(!("channels"in Ln[rd]))throw new Error("missing channels property: "+rd);if(!("labels"in Ln[rd]))throw new Error("missing channel labels property: "+rd);if(Ln[rd].labels.length!==Ln[rd].channels)throw new Error("channel and label counts mismatch: "+rd);var _Xt=Ln[rd].channels,xXt=Ln[rd].labels;delete Ln[rd].channels,delete Ln[rd].labels,Object.defineProperty(Ln[rd],"channels",{value:_Xt}),Object.defineProperty(Ln[rd],"labels",{value:xXt})}Ln.rgb.hsl=function(n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i=Math.min(e,t,r),a=Math.max(e,t,r),o=a-i,s,l,u;return a===i?s=0:e===a?s=(t-r)/o:t===a?s=2+(r-e)/o:r===a&&(s=4+(e-t)/o),s=Math.min(s*60,360),s<0&&(s+=360),u=(i+a)/2,a===i?l=0:u<=.5?l=o/(a+i):l=o/(2-a-i),[s,l*100,u*100]};Ln.rgb.hsv=function(n){var e,t,r,i,a,o=n[0]/255,s=n[1]/255,l=n[2]/255,u=Math.max(o,s,l),h=u-Math.min(o,s,l),c=function(f){return(u-f)/6/h+1/2};return h===0?i=a=0:(a=h/u,e=c(o),t=c(s),r=c(l),o===u?i=r-t:s===u?i=1/3+e-r:l===u&&(i=2/3+t-e),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,u*100]};Ln.rgb.hwb=function(n){var e=n[0],t=n[1],r=n[2],i=Ln.rgb.hsl(n)[0],a=1/255*Math.min(e,Math.min(t,r));return r=1-1/255*Math.max(e,Math.max(t,r)),[i,a*100,r*100]};Ln.rgb.cmyk=function(n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i,a,o,s;return s=Math.min(1-e,1-t,1-r),i=(1-e-s)/(1-s)||0,a=(1-t-s)/(1-s)||0,o=(1-r-s)/(1-s)||0,[i*100,a*100,o*100,s*100]};function SXt(n,e){return Math.pow(n[0]-e[0],2)+Math.pow(n[1]-e[1],2)+Math.pow(n[2]-e[2],2)}Ln.rgb.keyword=function(n){var e=RVe[n];if(e)return e;var t=1/0,r;for(var i in FE)if(FE.hasOwnProperty(i)){var a=FE[i],o=SXt(n,a);o.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var i=e*.4124+t*.3576+r*.1805,a=e*.2126+t*.7152+r*.0722,o=e*.0193+t*.1192+r*.9505;return[i*100,a*100,o*100]};Ln.rgb.lab=function(n){var e=Ln.rgb.xyz(n),t=e[0],r=e[1],i=e[2],a,o,s;return t/=95.047,r/=100,i/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*r-16,o=500*(t-r),s=200*(r-i),[a,o,s]};Ln.hsl.rgb=function(n){var e=n[0]/360,t=n[1]/100,r=n[2]/100,i,a,o,s,l;if(t===0)return l=r*255,[l,l,l];r<.5?a=r*(1+t):a=r+t-r*t,i=2*r-a,s=[0,0,0];for(var u=0;u<3;u++)o=e+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(a-i)*6*o:2*o<1?l=a:3*o<2?l=i+(a-i)*(2/3-o)*6:l=i,s[u]=l*255;return s};Ln.hsl.hsv=function(n){var e=n[0],t=n[1]/100,r=n[2]/100,i=t,a=Math.max(r,.01),o,s;return r*=2,t*=r<=1?r:2-r,i*=a<=1?a:2-a,s=(r+t)/2,o=r===0?2*i/(a+i):2*t/(r+t),[e,o*100,s*100]};Ln.hsv.rgb=function(n){var e=n[0]/60,t=n[1]/100,r=n[2]/100,i=Math.floor(e)%6,a=e-Math.floor(e),o=255*r*(1-t),s=255*r*(1-t*a),l=255*r*(1-t*(1-a));switch(r*=255,i){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}};Ln.hsv.hsl=function(n){var e=n[0],t=n[1]/100,r=n[2]/100,i=Math.max(r,.01),a,o,s;return s=(2-t)*r,a=(2-t)*i,o=t*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};Ln.hwb.rgb=function(n){var e=n[0]/360,t=n[1]/100,r=n[2]/100,i=t+r,a,o,s,l;i>1&&(t/=i,r/=i),a=Math.floor(6*e),o=1-r,s=6*e-a,(a&1)!==0&&(s=1-s),l=t+s*(o-t);var u,h,c;switch(a){default:case 6:case 0:u=o,h=l,c=t;break;case 1:u=l,h=o,c=t;break;case 2:u=t,h=o,c=l;break;case 3:u=t,h=l,c=o;break;case 4:u=l,h=t,c=o;break;case 5:u=o,h=t,c=l;break}return[u*255,h*255,c*255]};Ln.cmyk.rgb=function(n){var e=n[0]/100,t=n[1]/100,r=n[2]/100,i=n[3]/100,a,o,s;return a=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,t*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),[a*255,o*255,s*255]};Ln.xyz.rgb=function(n){var e=n[0]/100,t=n[1]/100,r=n[2]/100,i,a,o;return i=e*3.2406+t*-1.5372+r*-.4986,a=e*-.9689+t*1.8758+r*.0415,o=e*.0557+t*-.204+r*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};Ln.xyz.lab=function(n){var e=n[0],t=n[1],r=n[2],i,a,o;return e/=95.047,t/=100,r/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=116*t-16,a=500*(e-t),o=200*(t-r),[i,a,o]};Ln.lab.xyz=function(n){var e=n[0],t=n[1],r=n[2],i,a,o;a=(e+16)/116,i=t/500+a,o=a-r/200;var s=Math.pow(a,3),l=Math.pow(i,3),u=Math.pow(o,3);return a=s>.008856?s:(a-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=u>.008856?u:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};Ln.lab.lch=function(n){var e=n[0],t=n[1],r=n[2],i,a,o;return i=Math.atan2(r,t),a=i*360/2/Math.PI,a<0&&(a+=360),o=Math.sqrt(t*t+r*r),[e,o,a]};Ln.lch.lab=function(n){var e=n[0],t=n[1],r=n[2],i,a,o;return o=r/360*2*Math.PI,i=t*Math.cos(o),a=t*Math.sin(o),[e,i,a]};Ln.rgb.ansi16=function(n){var e=n[0],t=n[1],r=n[2],i=1 in arguments?arguments[1]:Ln.rgb.hsv(n)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(r/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return i===2&&(a+=60),a};Ln.hsv.ansi16=function(n){return Ln.rgb.ansi16(Ln.hsv.rgb(n),n[2])};Ln.rgb.ansi256=function(n){var e=n[0],t=n[1],r=n[2];if(e===t&&t===r)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5);return i};Ln.ansi16.rgb=function(n){var e=n%10;if(e===0||e===7)return n>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(n>50)+1)*.5,r=(e&1)*t*255,i=(e>>1&1)*t*255,a=(e>>2&1)*t*255;return[r,i,a]};Ln.ansi256.rgb=function(n){if(n>=232){var e=(n-232)*10+8;return[e,e,e]}n-=16;var t,r=Math.floor(n/36)/5*255,i=Math.floor((t=n%36)/6)/5*255,a=t%6/5*255;return[r,i,a]};Ln.rgb.hex=function(n){var e=((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};Ln.hex.rgb=function(n){var e=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(s){return s+s}).join(""));var r=parseInt(t,16),i=r>>16&255,a=r>>8&255,o=r&255;return[i,a,o]};Ln.rgb.hcg=function(n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i=Math.max(Math.max(e,t),r),a=Math.min(Math.min(e,t),r),o=i-a,s,l;return o<1?s=a/(1-o):s=0,o<=0?l=0:i===e?l=(t-r)/o%6:i===t?l=2+(r-e)/o:l=4+(e-t)/o+4,l/=6,l%=1,[l*360,o*100,s*100]};Ln.hsl.hcg=function(n){var e=n[1]/100,t=n[2]/100,r=1,i=0;return t<.5?r=2*e*t:r=2*e*(1-t),r<1&&(i=(t-.5*r)/(1-r)),[n[0],r*100,i*100]};Ln.hsv.hcg=function(n){var e=n[1]/100,t=n[2]/100,r=e*t,i=0;return r<1&&(i=(t-r)/(1-r)),[n[0],r*100,i*100]};Ln.hcg.rgb=function(n){var e=n[0]/360,t=n[1]/100,r=n[2]/100;if(t===0)return[r*255,r*255,r*255];var i=[0,0,0],a=e%1*6,o=a%1,s=1-o,l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-t)*r,[(t*i[0]+l)*255,(t*i[1]+l)*255,(t*i[2]+l)*255]};Ln.hcg.hsv=function(n){var e=n[1]/100,t=n[2]/100,r=e+t*(1-e),i=0;return r>0&&(i=e/r),[n[0],i*100,r*100]};Ln.hcg.hsl=function(n){var e=n[1]/100,t=n[2]/100,r=t*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[n[0],i*100,r*100]};Ln.hcg.hwb=function(n){var e=n[1]/100,t=n[2]/100,r=e+t*(1-e);return[n[0],(r-e)*100,(1-r)*100]};Ln.hwb.hcg=function(n){var e=n[1]/100,t=n[2]/100,r=1-t,i=r-e,a=0;return i<1&&(a=(r-i)/(1-i)),[n[0],i*100,a*100]};Ln.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};Ln.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};Ln.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};Ln.gray.hsl=Ln.gray.hsv=function(n){return[0,0,n[0]]};Ln.gray.hwb=function(n){return[0,100,n[0]]};Ln.gray.cmyk=function(n){return[0,0,0,n[0]]};Ln.gray.lab=function(n){return[n[0],0,0]};Ln.gray.hex=function(n){var e=Math.round(n[0]/100*255)&255,t=(e<<16)+(e<<8)+e,r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};Ln.rgb.gray=function(n){var e=(n[0]+n[1]+n[2])/3;return[e/255*100]};var T9=Lse.exports;function wXt(){for(var n={},e=Object.keys(T9),t=e.length,r=0;r1&&(t=Array.prototype.slice.call(arguments)),n(t))};return"conversion"in n&&(e.conversion=n.conversion),e}function LXt(n){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=n(t);if(typeof r=="object")for(var i=r.length,a=0;a>16&255,n>>8&255,n&255],this.valpha=1;else{this.valpha=1;var o=Object.keys(n);"alpha"in n&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof n.alpha=="number"?n.alpha:0);var s=o.sort().join("");if(!(s in wee))throw new Error("Unable to parse color from object: "+JSON.stringify(n));this.model=wee[s];var l=sv[this.model].labels,u=[];for(t=0;tt?(e+.05)/(t+.05):(t+.05)/(e+.05)},level:function(n){var e=this.contrast(n);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var n=this.rgb().color,e=(n[0]*299+n[1]*587+n[2]*114)/1e3;return e<128},isLight:function(){return!this.isDark()},negate:function(){for(var n=this.rgb(),e=0;e<3;e++)n.color[e]=255-n.color[e];return n},lighten:function(n){var e=this.hsl();return e.color[2]+=e.color[2]*n,e},darken:function(n){var e=this.hsl();return e.color[2]-=e.color[2]*n,e},saturate:function(n){var e=this.hsl();return e.color[1]+=e.color[1]*n,e},desaturate:function(n){var e=this.hsl();return e.color[1]-=e.color[1]*n,e},whiten:function(n){var e=this.hwb();return e.color[1]+=e.color[1]*n,e},blacken:function(n){var e=this.hwb();return e.color[2]+=e.color[2]*n,e},grayscale:function(){var n=this.rgb().color,e=n[0]*.3+n[1]*.59+n[2]*.11;return oc.rgb(e,e,e)},fade:function(n){return this.alpha(this.valpha-this.valpha*n)},opaquer:function(n){return this.alpha(this.valpha+this.valpha*n)},rotate:function(n){var e=this.hsl(),t=e.color[0];return t=(t+n)%360,t=t<0?360+t:t,e.color[0]=t,e},mix:function(n,e){if(!n||!n.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof n);var t=n.rgb(),r=this.rgb(),i=e===void 0?.5:e,a=2*i-1,o=t.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return oc.rgb(s*t.red()+l*r.red(),s*t.green()+l*r.green(),s*t.blue()+l*r.blue(),t.alpha()*i+r.alpha()*(1-i))}};Object.keys(sv).forEach(function(n){if(DVe.indexOf(n)===-1){var e=sv[n].channels;oc.prototype[n]=function(){if(this.model===n)return new oc(this);if(arguments.length)return new oc(arguments,n);var t=typeof arguments[e]=="number"?e:this.valpha;return new oc(DXt(sv[this.model][n].raw(this.color)).concat(t),n)},oc[n]=function(t){return typeof t=="number"&&(t=bee(Pse.call(arguments),e)),new oc(t,n)}}});function OXt(n,e){return Number(n.toFixed(e))}function RXt(n){return function(e){return OXt(e,n)}}function Gl(n,e,t){return n=Array.isArray(n)?n:[n],n.forEach(function(r){(C9[r]||(C9[r]=[]))[e]=t}),n=n[0],function(r){var i;return arguments.length?(t&&(r=t(r)),i=this[n](),i.color[e]=r,i):(i=this[n]().color[e],t&&(i=t(i)),i)}}function Yu(n){return function(e){return Math.max(0,Math.min(n,e))}}function DXt(n){return Array.isArray(n)?n:[n]}function bee(n,e){for(var t=0;t=0,a=!t&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return a?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return On(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(HXt,arguments)},brighten:function(){return this._applyModification(jXt,arguments)},darken:function(){return this._applyModification(XXt,arguments)},desaturate:function(){return this._applyModification(VXt,arguments)},saturate:function(){return this._applyModification($Xt,arguments)},greyscale:function(){return this._applyModification(WXt,arguments)},spin:function(){return this._applyModification(YXt,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(KXt,arguments)},complement:function(){return this._applyCombination(qXt,arguments)},monochromatic:function(){return this._applyCombination(JXt,arguments)},splitcomplement:function(){return this._applyCombination(ZXt,arguments)},triad:function(){return this._applyCombination(gwe,[3])},tetrad:function(){return this._applyCombination(gwe,[4])}};On.fromRatio=function(n,e){if(A9(n)=="object"){var t={};for(var r in n)n.hasOwnProperty(r)&&(r==="a"?t[r]=n[r]:t[r]=SO(n[r]));n=t}return On(n,e)};function FXt(n){var e={r:0,g:0,b:0},t=1,r=null,i=null,a=null,o=!1,s=!1;return typeof n=="string"&&(n=nYt(n)),A9(n)=="object"&&(Qm(n.r)&&Qm(n.g)&&Qm(n.b)?(e=BXt(n.r,n.g,n.b),o=!0,s=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Qm(n.h)&&Qm(n.s)&&Qm(n.v)?(r=SO(n.s),i=SO(n.v),e=zXt(n.h,r,i),o=!0,s="hsv"):Qm(n.h)&&Qm(n.s)&&Qm(n.l)&&(r=SO(n.s),a=SO(n.l),e=GXt(n.h,r,a),o=!0,s="hsl"),n.hasOwnProperty("a")&&(t=n.a)),t=NVe(t),{ok:o,format:n.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}function BXt(n,e,t){return{r:hl(n,255)*255,g:hl(e,255)*255,b:hl(t,255)*255}}function fwe(n,e,t){n=hl(n,255),e=hl(e,255),t=hl(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),a,o,s=(r+i)/2;if(r==i)a=o=0;else{var l=r-i;switch(o=s>.5?l/(2-r-i):l/(r+i),r){case n:a=(e-t)/l+(e1&&(c-=1),c<1/6?u+(h-u)*6*c:c<1/2?h:c<2/3?u+(h-u)*(2/3-c)*6:u}if(e===0)r=i=a=t;else{var s=t<.5?t*(1+e):t+e-t*e,l=2*t-s;r=o(l,s,n+1/3),i=o(l,s,n),a=o(l,s,n-1/3)}return{r:r*255,g:i*255,b:a*255}}function dwe(n,e,t){n=hl(n,255),e=hl(e,255),t=hl(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),a,o,s=r,l=r-i;if(o=r===0?0:l/r,r==i)a=0;else{switch(r){case n:a=(e-t)/l+(e>1)+720)%360;--e;)r.h=(r.h+i)%360,a.push(On(r));return a}function JXt(n,e){e=e||6;for(var t=On(n).toHsv(),r=t.h,i=t.s,a=t.v,o=[],s=1/e;e--;)o.push(On({h:r,s:i,v:a})),a=(a+s)%1;return o}On.mix=function(n,e,t){t=t===0?0:t||50;var r=On(n).toRgb(),i=On(e).toRgb(),a=t/100,o={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return On(o)};On.readability=function(n,e){var t=On(n),r=On(e);return(Math.max(t.getLuminance(),r.getLuminance())+.05)/(Math.min(t.getLuminance(),r.getLuminance())+.05)};On.isReadable=function(n,e,t){var r=On.readability(n,e),i,a;switch(a=!1,i=iYt(t),i.level+i.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7;break}return a};On.mostReadable=function(n,e,t){var r=null,i=0,a,o,s,l;t=t||{},o=t.includeFallbackColors,s=t.level,l=t.size;for(var u=0;ui&&(i=a,r=On(e[u]));return On.isReadable(n,r,{level:s,size:l})||!o?r:(t.includeFallbackColors=!1,On.mostReadable(n,["#fff","#000"],t))};var Eee=On.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},QXt=On.hexNames=eYt(Eee);function eYt(n){var e={};for(var t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function NVe(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function hl(n,e){tYt(n)&&(n="100%");var t=rYt(n);return n=Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(n*e,10)/100),Math.abs(n-e)<1e-6?1:n%e/parseFloat(e)}function tV(n){return Math.min(1,Math.max(0,n))}function Kd(n){return parseInt(n,16)}function tYt(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function rYt(n){return typeof n=="string"&&n.indexOf("%")!=-1}function a0(n){return n.length==1?"0"+n:""+n}function SO(n){return n<=1&&(n=n*100+"%"),n}function kVe(n){return Math.round(parseFloat(n)*255).toString(16)}function ywe(n){return Kd(n)/255}var Og=function(){var n="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+n+")",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Qm(n){return!!Og.CSS_UNIT.exec(n)}function nYt(n){n=n.replace(NXt,"").replace(kXt,"").toLowerCase();var e=!1;if(Eee[n])n=Eee[n],e=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=Og.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=Og.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Og.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=Og.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Og.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=Og.hsva.exec(n))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Og.hex8.exec(n))?{r:Kd(t[1]),g:Kd(t[2]),b:Kd(t[3]),a:ywe(t[4]),format:e?"name":"hex8"}:(t=Og.hex6.exec(n))?{r:Kd(t[1]),g:Kd(t[2]),b:Kd(t[3]),format:e?"name":"hex"}:(t=Og.hex4.exec(n))?{r:Kd(t[1]+""+t[1]),g:Kd(t[2]+""+t[2]),b:Kd(t[3]+""+t[3]),a:ywe(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=Og.hex3.exec(n))?{r:Kd(t[1]+""+t[1]),g:Kd(t[2]+""+t[2]),b:Kd(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function iYt(n){var e,t;return n=n||{level:"AA",size:"small"},e=(n.level||"AA").toUpperCase(),t=(n.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}var L5=2,mwe=.16,aYt=.05,oYt=.05,sYt=.15,FVe=5,BVe=4,lYt=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function _we(n,e,t){var r;return Math.round(n.h)>=60&&Math.round(n.h)<=240?r=t?Math.round(n.h)-L5*e:Math.round(n.h)+L5*e:r=t?Math.round(n.h)+L5*e:Math.round(n.h)-L5*e,r<0?r+=360:r>=360&&(r-=360),r}function xwe(n,e,t){if(n.h===0&&n.s===0)return n.s;var r;return t?r=n.s-mwe*e:e===BVe?r=n.s+mwe:r=n.s+aYt*e,r>1&&(r=1),t&&e===FVe&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function Swe(n,e,t){var r;return t?r=n.v+oYt*e:r=n.v-sYt*e,r>1&&(r=1),Number(r.toFixed(2))}function M9(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],r=On(n),i=FVe;i>0;i-=1){var a=r.toHsv(),o=On({h:_we(a,i,!0),s:xwe(a,i,!0),v:Swe(a,i,!0)}).toHexString();t.push(o)}t.push(r.toHexString());for(var s=1;s<=BVe;s+=1){var l=r.toHsv(),u=On({h:_we(l,s),s:xwe(l,s),v:Swe(l,s)}).toHexString();t.push(u)}return e.theme==="dark"?lYt.map(function(h){var c=h.index,f=h.opacity,d=On.mix(e.backgroundColor||"#141414",t[c],f*100).toHexString();return d}):t}var XX={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},YX={},qX={};Object.keys(XX).forEach(function(n){YX[n]=M9(XX[n]),YX[n].primary=YX[n][5],qX[n]=M9(XX[n],{theme:"dark",backgroundColor:"#141414"}),qX[n].primary=qX[n][5]});var Ju=function(e,t,r){var i=_R(e),a=_R(t);return _R([(1-r)*i.red()+r*a.red(),(1-r)*i.green()+r*a.green(),(1-r)*i.blue()+r*a.blue()]).rgb()},uYt=function(e,t,r){t===void 0&&(t="#fff"),r===void 0&&(r="rgb(150, 150, 150)");var i=Ju(t,e,.05).rgb().toString(),a=Ju(t,e,.1).rgb().toString(),o=Ju(t,e,.2).rgb().toString(),s=Ju(t,e,.4).rgb().toString(),l=Ju(t,r,.02).rgb().toString(),u=Ju(t,r,.05).rgb().toString(),h=Ju(t,r,.1).rgb().toString(),c=Ju(t,r,.2).rgb().toString(),f=Ju(t,r,.3).rgb().toString(),d=M9(e,{theme:"default",backgroundColor:t}),v=_R(e).hex().toLowerCase(),p=d.indexOf(v),g=e;return p!==-1&&(g=d[p+1]),{mainStroke:e,mainFill:a,activeStroke:e,activeFill:i,inactiveStroke:s,inactiveFill:i,selectedStroke:e,selectedFill:t,highlightStroke:g,highlightFill:o,disableStroke:f,disableFill:u,edgeMainStroke:f,edgeActiveStroke:e,edgeInactiveStroke:c,edgeSelectedStroke:e,edgeHighlightStroke:e,edgeDisableStroke:h,comboMainStroke:f,comboMainFill:l,comboActiveStroke:e,comboActiveFill:i,comboInactiveStroke:f,comboInactiveFill:l,comboSelectedStroke:e,comboSelectedFill:l,comboHighlightStroke:g,comboHighlightFill:l,comboDisableStroke:c,comboDisableFill:u}},hYt=function(e,t,r){t===void 0&&(t="#fff"),r===void 0&&(r="#777");var i=Ju(t,e,.2).rgb().toString(),a=Ju(t,e,.3).rgb().toString(),o=Ju(t,e,.6).rgb().toString(),s=Ju(t,e,.8).rgb().toString(),l=Ju(t,r,.2).rgb().toString(),u=Ju(t,r,.25).rgb().toString(),h=Ju(t,r,.3).rgb().toString(),c=Ju(t,r,.4).rgb().toString(),f=Ju(t,r,.5).rgb().toString(),d=M9(e,{theme:"dark",backgroundColor:t}),v=_R(e).hex().toLowerCase(),p=d.indexOf(v),g=e;return p!==-1&&(g=d[p+1]),{mainStroke:s,mainFill:i,activeStroke:e,activeFill:a,inactiveStroke:s,inactiveFill:i,selectedStroke:e,selectedFill:i,highlightStroke:e,highlightFill:o,disableStroke:f,disableFill:u,edgeMainStroke:r,edgeActiveStroke:e,edgeInactiveStroke:r,edgeSelectedStroke:e,edgeHighlightStroke:e,edgeDisableStroke:h,comboMainStroke:c,comboMainFill:u,comboActiveStroke:e,comboActiveFill:l,comboInactiveStroke:c,comboInactiveFill:u,comboSelectedStroke:e,comboSelectedFill:l,comboHighlightStroke:g,comboHighlightFill:u,comboDisableStroke:c,comboDisableFill:l}},Ose=function(e,t,r,i){return t===void 0&&(t="#fff"),r===void 0&&(r="default"),r==="default"?uYt(e,t,"rgb(150, 150, 150)"):hYt(e,t,"#777")},cYt=function(e,t,r,i){t===void 0&&(t="#fff"),r===void 0&&(r="default");var a=[];return e.forEach(function(o){a.push(Ose(o,t,r))}),a};const fYt=Object.freeze(Object.defineProperty({__proto__:null,mixColor:Ju,getColorsWithSubjectColor:Ose,getColorSetsBySubjectColors:cYt},Symbol.toStringTag,{value:"Module"}));var dYt="rgb(95, 149, 255)",vYt="rgb(255, 255, 255)",wwe="rgb(0, 0, 0)",da=Ose(dYt,vYt);const BE={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:da.mainStroke,fill:da.mainFill},size:20,color:da.mainStroke,linkPoints:{size:8,lineWidth:1,fill:da.activeFill,stroke:da.activeStroke}},nodeStateStyles:{active:{fill:da.activeFill,stroke:da.activeStroke,lineWidth:2,shadowColor:da.mainStroke,shadowBlur:10},selected:{fill:da.selectedFill,stroke:da.selectedStroke,lineWidth:4,shadowColor:da.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:da.highlightFill,stroke:da.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:da.inactiveFill,stroke:da.inactiveStroke,lineWidth:1},disable:{fill:da.disableFill,stroke:da.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:wwe,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:da.edgeMainStroke,lineAppendWidth:2},color:da.edgeMainStroke},edgeStateStyles:{active:{stroke:da.edgeActiveStroke,lineWidth:1},selected:{stroke:da.edgeSelectedStroke,lineWidth:2,shadowColor:da.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:da.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:da.edgeInactiveStroke,lineWidth:1},disable:{stroke:da.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:wwe,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:da.comboMainFill,lineWidth:1,stroke:da.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:da.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:da.comboActiveStroke,lineWidth:1,fill:da.comboActiveFill},selected:{stroke:da.comboSelectedStroke,lineWidth:2,fill:da.comboSelectedFill,shadowColor:da.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:da.comboHighlightStroke,lineWidth:2,fill:da.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:da.comboInactiveStroke,fill:da.comboInactiveFill,lineWidth:1},disable:{stroke:da.comboDisableStroke,fill:da.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"};var pYt=function(e){var t=e.clone();return GVe(e,t),t},GVe=function(e,t){var r;e.isGroup()&&t.isGroup()&&((r=e.get("children"))===null||r===void 0||r.forEach(function(s,l){var u=t.get("children")[l];GVe(s,u)}));var i=e.get("type"),a=t.get("type");if(!(i!=="image"||a!=="image")){var o=e.get("clipShape");o&&t.setClip({type:o.get("type"),attrs:o.attr()})}},gYt=gc.cloneEvent,yYt=gc.isViewportChanged,mYt=function(n){Kn(e,n);function e(t){var r=n.call(this,t)||this;return r.extendEvents=[],r.dragging=!1,r.mousedown=!1,r.preItem=null,r.destroy(),r.graph=t,r.destroyed=!1,r.initEvents(),r}return e.prototype.initEvents=function(){var t=this,r=t.graph,i=t.extendEvents,a=i===void 0?[]:i,o=r.get("canvas"),s=o.get("el"),l=hE(this,"onCanvasEvents"),u=hE(this,"onExtendEvents"),h=hE(this,"onWheelEvent");o.off("*").on("*",l),this.canvasHandler=l,a.push(M5(s,"wheel",h)),typeof window<"u"&&(a.push(M5(window,"keydown",u)),a.push(M5(window,"keyup",u)),a.push(M5(window,"focus",u))),this.resetHandler&&r.off("afterchangedata",this.resetHandler),this.resetHandler=hE(this,"resetStatus"),r.on("afterchangedata",this.resetHandler)},e.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},e.prototype.onCanvasEvents=function(t){var r=this,i=this.graph,a=i.get("canvas"),o=t.target,s=t.type;switch(s){case"drag":this.onCanvasEvents(Object.assign({},t,{type:"mousemove"}));break;case"dragend":this.onCanvasEvents(Object.assign({},t,{type:"mouseup"}));break;case"mousedown":this.mousedown=!0;break;case"mouseup":setTimeout(function(){return r.mousedown=!1});break;case"click":if(!this.mousedown)return;break}t.canvasX=t.x,t.canvasY=t.y;var l={x:t.canvasX,y:t.canvasY},u=i.get("group"),h=u.getMatrix();if(h||(h=[1,0,0,0,1,0,0,0,1]),yYt(h)&&(l=i.getPointByClient(t.clientX,t.clientY)),t.x=l.x,t.y=l.y,t.currentTarget=i,o===a){(s==="mousemove"||s==="mouseleave")&&this.handleMouseMove(t,"canvas"),t.target=a,t.item=null,i.emit(s,t),i.emit("canvas:".concat(s),t);return}var c=e.getItemRoot(o);if(!c){i.emit(s,t);return}var f=c.get("item");if(!f.destroyed){var d=f.getType();if(t.target=o,t.item=f,t.canvasX===t.x&&t.canvasY===t.y){var v=i.getCanvasByPoint(t.x,t.y);t.canvasX=v.x,t.canvasY=v.y}t.name&&!t.name.includes(":")?(i.emit("".concat(d,":").concat(s),t),i.emit(s,t)):t.name&&i.emit(t.name,t),s==="dragstart"&&(this.dragging=!0),s==="dragend"&&(this.dragging=!1),s==="mousemove"&&this.handleMouseMove(t,d)}},e.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},e.prototype.onWheelEvent=function(t){an(t.wheelDelta)&&(t.wheelDelta=-t.detail),this.graph.emit("wheel",t)},e.prototype.handleMouseMove=function(t,r){var i=this,a=i.graph,o=i.preItem,s=a.get("canvas"),l=t.target===s?null:t.item;t=gYt(t),o&&o!==l&&!o.destroyed&&(t.item=o,this.emitCustomEvent(o.getType(),"mouseleave",t),this.dragging&&this.emitCustomEvent(o.getType(),"dragleave",t)),l&&o!==l&&(t.item=l,this.emitCustomEvent(r,"mouseenter",t),this.dragging&&this.emitCustomEvent(r,"dragenter",t)),this.preItem=l},e.prototype.emitCustomEvent=function(t,r,i){i.type=r,this.graph.emit("".concat(t,":").concat(r),i)},e.prototype.resetStatus=function(){this.mousedown=!1,this.dragging=!1,this.preItem=null},e.prototype.destroy=function(){var t=this,r=t.graph,i=t.canvasHandler,a=t.extendEvents,o=r.get("canvas");o.off("*",i),At(a,function(s){s.remove()}),this.resetStatus(),this.extendEvents.length=0,this.canvasHandler=null,this.resetHandler=null,this.destroyed=!0},e}(DUe),Yi={},Z1={},Xl={};Object.defineProperty(Xl,"__esModule",{value:!0});Xl.Base=void 0;var _Yt=function(){function n(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return n.prototype.layout=function(e){return this.init(e),this.execute(!0)},n.prototype.init=function(e){this.nodes=e.nodes||[],this.edges=e.edges||[],this.combos=e.combos||[],this.comboEdges=e.comboEdges||[],this.hiddenNodes=e.hiddenNodes||[],this.hiddenEdges=e.hiddenEdges||[],this.hiddenCombos=e.hiddenCombos||[],this.vedges=e.vedges||[]},n.prototype.execute=function(e){},n.prototype.executeWithWorker=function(){},n.prototype.getDefaultCfg=function(){return{}},n.prototype.updateCfg=function(e){e&&Object.assign(this,e)},n.prototype.getType=function(){return"base"},n.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},n}();Xl.Base=_Yt;var ZX={},PM={};Object.defineProperty(PM,"__esModule",{value:!0});PM.camelize=PM.isString=void 0;var xYt=function(n){return typeof n=="string"};PM.isString=xYt;var SYt=function(n){var e=Object.create(null);return function(t){var r=e[t];return r||(e[t]=n(t))}},wYt=/-(\w)/g;PM.camelize=SYt(function(n){return n.replace(wYt,function(e,t){return t?t.toUpperCase():""})});var q3={};Object.defineProperty(q3,"__esModule",{value:!0});q3.isArray=void 0;q3.isArray=Array.isArray;var rV={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.toNumber=n.isNaN=n.isNumber=void 0;var e=function(i){return typeof i=="number"};n.isNumber=e;var t=function(i){return Number.isNaN(Number(i))};n.isNaN=t;var r=function(i){var a=parseFloat(i);return(0,n.isNaN)(a)?i:a};n.toNumber=r})(rV);var nV={},Rse={};(function(n){var e=at&&at.__assign||function(){return e=Object.assign||function(i){for(var a,o=1,s=arguments.length;o_[S][b]+_[b][w]&&(_[S][w]=_[S][b]+_[b][w]);return _};n.floydWarshall=s;var l=function(y,_){var x=y.nodes,S=y.edges,w=[],b={};if(!x)throw new Error("invalid nodes data!");return x&&x.forEach(function(E,T){b[E.id]=T;var C=[];w.push(C)}),S==null||S.forEach(function(E){var T=(0,n.getEdgeTerminal)(E,"source"),C=(0,n.getEdgeTerminal)(E,"target"),A=b[T],M=b[C];A===void 0||M===void 0||(w[A][M]=1,_||(w[M][A]=1))}),w};n.getAdjMatrix=l;var u=function(y,_){var x=[];return y.forEach(function(S){var w=[];S.forEach(function(b){w.push(b*_)}),x.push(w)}),x};n.scaleMatrix=u;var h=function(y,_){if(y&&y.children){for(var x=y.children.length-1;x>=0;x--)if(!h(y.children[x],_))return}return!!_(y)},c=function(y,_){typeof _=="function"&&h(y,_)};n.traverseTreeUp=c;var f=function(y){var _=1/0,x=1/0,S=-1/0,w=-1/0;return y.forEach(function(b){var E=b.size;(0,e.isArray)(E)?E.length===1&&(E=[E[0],E[0]]):(0,t.isNumber)(E)?E=[E,E]:(E===void 0||isNaN(E))&&(E=[30,30]);var T=[E[0]/2,E[1]/2],C=b.x-T[0],A=b.x+T[0],M=b.y-T[1],I=b.y+T[1];_>C&&(_=C),x>M&&(x=M),Su.size[1]?u.size[0]:u.size[1]:(0,e.isObject)(u.size)?u.size.width>u.size.height?u.size.width:u.size.height:u.size:o}:(0,n.isFunction)(s)?s:(0,t.isNumber)(s)?function(){return s}:(0,e.isArray)(s)?function(){if(l){var u=Math.max.apply(Math,s);return isNaN(u)?o:u}return s}:(0,e.isObject)(s)?function(){if(l){var u=Math.max(s.width,s.height);return isNaN(u)?o:u}return[s.width,s.height]}:function(){return o}};n.getFuncByUnknownType=a}(KX)),KX}var Ewe;function Dl(){return Ewe||(Ewe=1,function(n){var e=at&&at.__createBinding||(Object.create?function(r,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(r,o,s)}:function(r,i,a,o){o===void 0&&(o=a),r[o]=i[a]}),t=at&&at.__exportStar||function(r,i){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,r,a)};Object.defineProperty(n,"__esModule",{value:!0}),t(PM,n),t(q3,n),t(rV,n),t(nV,n),t(Rse,n),t(bYt(),n)}(ZX)),ZX}var EYt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(Z1,"__esModule",{value:!0});Z1.getLayoutByName=Z1.unRegisterLayout=Z1.registerLayout=void 0;var TYt=Xl,CYt=Dl(),sS=new Map,AYt=function(n,e){if(sS.get(n)&&console.warn("The layout with the name ".concat(n," exists already, it will be overridden")),(0,CYt.isObject)(e)){var t=function(r){EYt(i,r);function i(a){var o=this,s;o=r.call(this)||this;var l=o,u={},h=Object.assign({},l.getDefaultCfg(),((s=e.getDefaultCfg)===null||s===void 0?void 0:s.call(e))||{});return Object.assign(u,h,e,a),Object.keys(u).forEach(function(c){var f=u[c];l[c]=f}),o}return i}(TYt.Base);sS.set(n,t)}else sS.set(n,e);return sS.get(n)};Z1.registerLayout=AYt;var MYt=function(n){sS.has(n)&&sS.delete(n)};Z1.unRegisterLayout=MYt;var IYt=function(n){return sS.has(n)?sS.get(n):null};Z1.getLayoutByName=IYt;var JX={},Z3={},LYt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(Z3,"__esModule",{value:!0});Z3.GridLayout=void 0;var hC=Dl(),PYt=Xl,OYt=function(n){LYt(e,n);function e(t){var r=n.call(this)||this;return r.begin=[0,0],r.preventOverlap=!0,r.preventOverlapPadding=10,r.condense=!1,r.sortBy="degree",r.nodes=[],r.edges=[],r.width=300,r.height=300,r.row=0,r.col=0,r.cellWidth=0,r.cellHeight=0,r.cellUsed={},r.id2manPos={},r.onLayoutEnd=function(){},r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},e.prototype.execute=function(){var t=this,r=t.nodes,i=t.edges,a=t.begin,o=r.length;if(o===0)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:r,edges:i};if(o===1)return r[0].x=a[0],r[0].y=a[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:r,edges:i};var s=t.sortBy,l=t.width,u=t.height,h=t.condense,c=t.preventOverlapPadding,f=t.preventOverlap,d=t.nodeSpacing,v=t.nodeSize,p=[];r.forEach(function(M){p.push(M)});var g={};if(p.forEach(function(M,I){g[M.id]=I}),(s==="degree"||!(0,hC.isString)(s)||p[0][s]===void 0)&&(s="degree",(0,hC.isNaN)(r[0].degree))){var m=(0,hC.getDegree)(p.length,g,i);p.forEach(function(M,I){M.degree=m[I].all})}p.sort(function(M,I){return I[s]-M[s]}),!l&&typeof window<"u"&&(l=window.innerWidth),!u&&typeof window<"u"&&(u=window.innerHeight);var y=t.rows,_=t.cols!=null?t.cols:t.columns;if(t.cells=o,y!=null&&_!=null?(t.rows=y,t.cols=_):y!=null&&_==null?(t.rows=y,t.cols=Math.ceil(t.cells/t.rows)):y==null&&_!=null?(t.cols=_,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.rows=Math.max(t.rows,1),t.cols=Math.max(t.cols,1),t.cols*t.rows>t.cells){var x=t.small(),S=t.large();(x-1)*S>=t.cells?t.small(x-1):(S-1)*x>=t.cells&&t.large(S-1)}else for(;t.cols*t.rows=t.cells?t.large(S+1):t.small(x+1)}if(t.cellWidth=l/t.cols,t.cellHeight=u/t.rows,h&&(t.cellWidth=0,t.cellHeight=0),f||d){var w=(0,hC.getFuncByUnknownType)(10,d),b=(0,hC.getFuncByUnknownType)(30,v,!1);p.forEach(function(M){(!M.x||!M.y)&&(M.x=0,M.y=0);var I=b(M)||30,R,k;(0,hC.isArray)(I)?(R=I[0],k=I[1]):(R=I,k=I);var D=w!==void 0?w(M):c,G=R+D,W=k+D;t.cellWidth=Math.max(t.cellWidth,G),t.cellHeight=Math.max(t.cellHeight,W)})}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var E=0;E=r&&(t.col=0,t.row++)},e.prototype.getPos=function(t){var r=this,i=r.begin,a=r.cellWidth,o=r.cellHeight,s,l,u=r.id2manPos[t.id];if(u)s=u.col*a+a/2+i[0],l=u.row*o+o/2+i[1];else{for(;r.used(r.row,r.col);)r.moveToNextCell();s=r.col*a+a/2+i[0],l=r.row*o+o/2+i[1],r.use(r.row,r.col),r.moveToNextCell()}t.x=s,t.y=l},e.prototype.getType=function(){return"grid"},e}(PYt.Base);Z3.GridLayout=OYt;var K3={},RYt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(K3,"__esModule",{value:!0});K3.RandomLayout=void 0;var DYt=Xl,NYt=function(n){RYt(e,n);function e(t){var r=n.call(this)||this;return r.center=[0,0],r.width=300,r.height=300,r.nodes=[],r.edges=[],r.onLayoutEnd=function(){},r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,r=t.nodes,i=.9,a=t.center;return!t.width&&typeof window<"u"&&(t.width=window.innerWidth),!t.height&&typeof window<"u"&&(t.height=window.innerHeight),r&&r.forEach(function(o){o.x=(Math.random()-.5)*i*t.width+a[0],o.y=(Math.random()-.5)*i*t.height+a[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:r,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(DYt.Base);K3.RandomLayout=NYt;var J3={},kYt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(J3,"__esModule",{value:!0});J3.GForceLayout=void 0;var FYt=Xl,Ic=Dl(),QX=function(n,e){var t;return n?(0,Ic.isNumber)(n)?t=function(r){return n}:t=n:t=function(r){return e||1},t},BYt=function(n){kYt(e,n);function e(t){var r=n.call(this)||this;return r.maxIteration=500,r.workerEnabled=!1,r.edgeStrength=200,r.nodeStrength=1e3,r.coulombDisScale=.005,r.damping=.9,r.maxSpeed=1e3,r.minMovement=.5,r.interval=.02,r.factor=1,r.linkDistance=1,r.gravity=10,r.preventOverlap=!0,r.collideStrength=1,r.tick=function(){},r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.animate=!0,r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,r,i=this,a=i.nodes;if(i.timeInterval!==void 0&&typeof window<"u"&&window.clearInterval(i.timeInterval),!a||a.length===0){(t=i.onLayoutEnd)===null||t===void 0||t.call(i);return}!i.width&&typeof window<"u"&&(i.width=window.innerWidth),!i.height&&typeof window<"u"&&(i.height=window.innerHeight),i.center||(i.center=[i.width/2,i.height/2]);var o=i.center;if(a.length===1){a[0].x=o[0],a[0].y=o[1],(r=i.onLayoutEnd)===null||r===void 0||r.call(i);return}var s={},l={};a.forEach(function(v,p){(0,Ic.isNumber)(v.x)||(v.x=Math.random()*i.width),(0,Ic.isNumber)(v.y)||(v.y=Math.random()*i.height),s[v.id]=v,l[v.id]=p}),i.nodeMap=s,i.nodeIdxMap=l,i.linkDistance=QX(i.linkDistance,1),i.nodeStrength=QX(i.nodeStrength,1),i.edgeStrength=QX(i.edgeStrength,1);var u=i.nodeSize,h;if(i.preventOverlap){var c=i.nodeSpacing,f;(0,Ic.isNumber)(c)?f=function(){return c}:(0,Ic.isFunction)(c)?f=c:f=function(){return 0},u?(0,Ic.isArray)(u)?h=function(v){return Math.max(u[0],u[1])+f(v)}:h=function(v){return u+f(v)}:h=function(v){return v.size?(0,Ic.isArray)(v.size)?Math.max(v.size[0],v.size[1])+f(v):(0,Ic.isObject)(v.size)?Math.max(v.size.width,v.size.height)+f(v):v.size+f(v):10+f(v)}}i.nodeSize=h;var d=i.edges;i.degrees=(0,Ic.getDegree)(a.length,i.nodeIdxMap,d),i.getMass||(i.getMass=function(v){var p=v.mass||i.degrees[i.nodeIdxMap[v.id]].all||1;return p}),i.run()},e.prototype.run=function(){var t,r=this,i=r.maxIteration,a=r.nodes,o=r.workerEnabled,s=r.minMovement,l=r.animate;if(!!a)if(o||!l){for(var u=0;u"u")return;var c=0;this.timeInterval=window.setInterval(function(){var f,d;if(!!a){var v=r.runOneStep(c)||[];r.reachMoveThreshold(a,v,s)&&((f=r.onLayoutEnd)===null||f===void 0||f.call(r),window.clearInterval(r.timeInterval)),c++,c>=i&&((d=r.onLayoutEnd)===null||d===void 0||d.call(r),window.clearInterval(r.timeInterval))}},0)}},e.prototype.reachMoveThreshold=function(t,r,i){var a=0;return t.forEach(function(o,s){var l=o.x-r[s].x,u=o.y-r[s].y;a+=Math.sqrt(l*l+u*u)}),a/=t.length,a=m)){var y=d.x-g.x,_=d.y-g.y;y===0&&_===0&&(y=Math.random()*.01,_=Math.random()*.01);var x=y*y+_*_,S=Math.sqrt(x),w=(S+.1)*s,b=y/S,E=_/S,T=(c(d)+c(g))*.5*o/(w*w),C=a?a(g):1;if(t[2*v]+=b*T,t[2*v+1]+=E*T,t[2*m]-=b*T,t[2*m+1]-=E*T,l&&(f(d)+f(g))/2>S){var A=h*(c(d)+c(g))*.5/x;t[2*v]+=b*A/p,t[2*v+1]+=E*A/p,t[2*m]-=b*A/C,t[2*m+1]-=E*A/C}}})})},e.prototype.calAttractive=function(t,r){var i=this,a=i.nodeMap,o=i.nodeIdxMap,s=i.linkDistance,l=i.edgeStrength,u=i.nodeSize,h=i.getMass;r.forEach(function(c,f){var d=(0,Ic.getEdgeTerminal)(c,"source"),v=(0,Ic.getEdgeTerminal)(c,"target"),p=a[d],g=a[v],m=g.x-p.x,y=g.y-p.y;m===0&&y===0&&(m=Math.random()*.01,y=Math.random()*.01);var _=Math.sqrt(m*m+y*y),x=m/_,S=y/_,w=s(c,p,g)||1+(u(p)+u(g)||0)/2,b=w-_,E=b*l(c),T=o[d],C=o[v],A=h?h(p):1,M=h?h(g):1;t[2*T]-=x*E/A,t[2*T+1]-=S*E/A,t[2*C]+=x*E/M,t[2*C+1]+=S*E/M})},e.prototype.calGravity=function(t,r){for(var i=this,a=i.center,o=i.gravity,s=i.degrees,l=r.length,u=0;uo.maxSpeed){var d=o.maxSpeed/f;h=d*h,c=d*c}r[2*u]=h,r[2*u+1]=c})},e.prototype.updatePosition=function(t,r,i){i.forEach(function(a,o){if((0,Ic.isNumber)(a.fx)&&(0,Ic.isNumber)(a.fy)){a.x=a.fx,a.y=a.fy;return}var s=t[2*o]*r,l=t[2*o+1]*r;a.x+=s,a.y+=l})},e.prototype.stop=function(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(FYt.Base);J3.GForceLayout=BYt;var Q3={},iV={};function GYt(n){const e=+this._x.call(null,n),t=+this._y.call(null,n);return zVe(this.cover(e,t),e,t,n)}function zVe(n,e,t,r){if(isNaN(e)||isNaN(t))return n;var i,a=n._root,o={data:r},s=n._x0,l=n._y0,u=n._x1,h=n._y1,c,f,d,v,p,g,m,y;if(!a)return n._root=o,n;for(;a.length;)if((p=e>=(c=(s+u)/2))?s=c:u=c,(g=t>=(f=(l+h)/2))?l=f:h=f,i=a,!(a=a[m=g<<1|p]))return i[m]=o,n;if(d=+n._x.call(null,a.data),v=+n._y.call(null,a.data),e===d&&t===v)return o.next=a,i?i[m]=o:n._root=o,n;do i=i?i[m]=new Array(4):n._root=new Array(4),(p=e>=(c=(s+u)/2))?s=c:u=c,(g=t>=(f=(l+h)/2))?l=f:h=f;while((m=g<<1|p)===(y=(v>=f)<<1|d>=c));return i[y]=a,i[m]=o,n}function zYt(n){var e,t,r=n.length,i,a,o=new Array(r),s=new Array(r),l=1/0,u=1/0,h=-1/0,c=-1/0;for(t=0;th&&(h=i),ac&&(c=a));if(l>h||u>c)return this;for(this.cover(l,u).cover(h,c),t=0;tn||n>=i||r>e||e>=a;)switch(u=(eh||(s=v.y0)>c||(l=v.x1)=m)<<1|n>=g)&&(v=f[f.length-1],f[f.length-1]=f[f.length-1-p],f[f.length-1-p]=v)}else{var y=n-+this._x.call(null,d.data),_=e-+this._y.call(null,d.data),x=y*y+_*_;if(x=(f=(o+l)/2))?o=f:l=f,(p=c>=(d=(s+u)/2))?s=d:u=d,e=t,!(t=t[g=p<<1|v]))return this;if(!t.length)break;(e[g+1&3]||e[g+2&3]||e[g+3&3])&&(r=e,m=g)}for(;t.data!==n;)if(i=t,!(t=t.next))return this;return(a=t.next)&&delete t.next,i?(a?i.next=a:delete i.next,this):e?(a?e[g]=a:delete e[g],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(r?r[m]=t:this._root=t),this):(this._root=a,this)}function jYt(n){for(var e=0,t=n.length;e1&&(E=(0,qu.getAvgNodePosition)(C))}else E=void 0;return{x:E==null?void 0:E.x,y:E==null?void 0:E.y}}}}if(i){c||(c=this.getSameTypeLeafMap());var d=Array.from(new Set(o.map(function(_,x){return _[a]}))).filter(function(_){return _!==void 0}),v={};d.forEach(function(_){var x=o.filter(function(S){return S[a]===_}).map(function(S){return s[S.id]});v[_]=(0,qu.getAvgNodePosition)(x)}),h={single:function(_){return u(_)},leaf:function(_){return u(_)},others:function(_){return u(_)},center:function(_,x,S){var w=v[_[a]];return{x:w==null?void 0:w.x,y:w==null?void 0:w.y}}}}this.centripetalOptions=kg(kg({},this.centripetalOptions),h);var p=this.centripetalOptions,g=p.leaf,m=p.single,y=p.others;g&&typeof g!="function"&&(this.centripetalOptions.leaf=function(){return g}),m&&typeof m!="function"&&(this.centripetalOptions.single=function(){return m}),y&&typeof y!="function"&&(this.centripetalOptions.others=function(){return y})},e.prototype.updateCfg=function(t){t&&Object.assign(this,t)},e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t=this;t.stop();var r=t.nodes,i=t.edges,a=t.defSpringLen;if(t.judgingDistance=0,!r||r.length===0){t.onLayoutEnd([]);return}!t.width&&typeof window<"u"&&(t.width=window.innerWidth),!t.height&&typeof window<"u"&&(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var o=t.center;if(r.length===1){r[0].x=o[0],r[0].y=o[1],t.onLayoutEnd([kg({},r[0])]);return}t.degreesMap=(0,qu.getDegreeMap)(r,i),t.propsGetMass?t.getMass=t.propsGetMass:t.getMass=function(d){var v=1;(0,qu.isNumber)(d.mass)&&(v=d.mass);var p=t.degreesMap[d.id].all;return!p||p<5?v:p*5*v};var s=t.nodeSize,l;if(t.preventOverlap){var u=t.nodeSpacing,h;(0,qu.isNumber)(u)?h=function(){return u}:(0,qu.isFunction)(u)?h=u:h=function(){return 0},s?(0,qu.isArray)(s)?l=function(d){return Math.max(s[0],s[1])+h(d)}:l=function(d){return s+h(d)}:l=function(d){return d.size?(0,qu.isArray)(d.size)?Math.max(d.size[0],d.size[1])+h(d):(0,qu.isObject)(d.size)?Math.max(d.size.width,d.size.height)+h(d):d.size+h(d):10+h(d)}}t.nodeSize=l,t.linkDistance=eY(t.linkDistance,1),t.nodeStrength=eY(t.nodeStrength,1),t.edgeStrength=eY(t.edgeStrength,1);var c={},f={};r.forEach(function(d,v){(0,qu.isNumber)(d.x)||(d.x=Math.random()*t.width),(0,qu.isNumber)(d.y)||(d.y=Math.random()*t.height);var p=t.degreesMap[d.id];c[d.id]=kg(kg({},d),{data:kg(kg({},d.data),{size:t.nodeSize(d)||30,layout:{inDegree:p.in,outDegree:p.out,degree:p.all,tDegree:p.in,sDegree:p.out,force:{mass:t.getMass(d),nodeStrength:t.nodeStrength(d,i)}}})}),f[d.id]=v}),t.nodeMap=c,t.nodeIdxMap=f,t.edgeInfos=[],i==null||i.forEach(function(d){var v=c[d.source],p=c[d.target];!v||!p?elf.edgeInfos.push({}):t.edgeInfos.push({edgeStrength:t.edgeStrength(d),linkDistance:a?a(kg(kg({},d),{source:v,target:p}),v,p):t.linkDistance(d,v,p)||1+(s(v)+s(v)||0)/2})}),this.getCentripetalOptions(),t.onLayoutEnd=t.onLayoutEnd||function(){},t.run()},e.prototype.run=function(){var t=this,r=t.maxIteration,i=t.nodes,a=t.edges,o=t.workerEnabled,s=t.minMovement,l=t.animate,u=t.nodeMap,h=t.height;if(t.currentMinY=0,t.currentMaxY=h,!!i){var c=[];if(i.forEach(function(m,y){c[2*y]=0,c[2*y+1]=0}),this.defSideCoe&&typeof this.defSideCoe=="function"){var f={};a.forEach(function(m){var y=m.source,_=m.target;f[y]=f[y]||[],f[y].push(m),f[_]=f[_]||[],f[_].push(m)}),this.relatedEdges=f}var d=r,v=!l;if(o||v){for(var p=0;(t.judgingDistance>s||p<1)&&p"u")return;var g=0;this.timeInterval=window.setInterval(function(){!i||(t.runOneStep(g,c),g++,(g>=d||t.judgingDistancel){var v=l/d;c=v*c,f=v*f}r[2*h]=c,r[2*h+1]=f})},e.prototype.updatePosition=function(t,r){var i=this,a=i.nodes,o=i.distanceThresholdMode,s=i.nodeMap;if(!(a!=null&&a.length)){this.judgingDistance=0;return}var l=0;o==="max"?i.judgingDistance=-1/0:o==="min"&&(i.judgingDistance=1/0);var u=1/0,h=-1/0;a.forEach(function(c,f){var d=s[c.id];if((0,qu.isNumber)(c.fx)&&(0,qu.isNumber)(c.fy)){c.x=c.fx,c.y=c.fy,d.x=c.x,d.y=c.y;return}var v=t[2*f]*r,p=t[2*f+1]*r;c.x+=v,c.y+=p,d.x=c.x,d.y=c.y,c.yh&&(h=c.y);var g=Math.sqrt(v*v+p*p);switch(o){case"max":i.judgingDistanceg&&(i.judgingDistance=g);break;default:l=l+g;break}}),this.currentMinY=u,this.currentMaxY=h,(!o||o==="mean")&&(i.judgingDistance=l/a.length)},e.prototype.stop=function(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"force2"},e.prototype.getSameTypeLeafMap=function(){var t=this,r=t.nodeClusterBy,i=t.nodes,a=t.edges,o=t.nodeMap,s=t.degreesMap;if(!!(i!=null&&i.length)){var l={};return i.forEach(function(u,h){var c=s[u.id].all;c===1&&(l[u.id]=(0,qu.getCoreNodeAndRelativeLeafNodes)("leaf",u,a,r,s,o))}),l}},e}(hqt.Base);Q3.Force2Layout=fqt;var Nse={},oV={};function dqt(n,e){var t,r=1;n==null&&(n=0),e==null&&(e=0);function i(){var a,o=t.length,s,l=0,u=0;for(a=0;af.index){var A=d-E.x-E.vx,M=v-E.y-E.vy,I=A*A+M*M;Id+C||wv+C||bu.r&&(u.r=u[h].r)}function l(){if(!!e){var u,h=e.length,c;for(t=new Array(h),u=0;u[e(S,w,o),S])),x;for(g=0,s=new Array(m);g{}};function UVe(){for(var n=0,e=arguments.length,t={},r;n=0&&(r=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}ZB.prototype=UVe.prototype={constructor:ZB,on:function(n,e){var t=this._,r=xqt(n+"",t),i,a=-1,o=r.length;if(arguments.length<2){for(;++a0)for(var t=new Array(i),r=0,i,a;r(n=(wqt*n+bqt)%Iwe)/Iwe}function Tqt(n){return n.x}function Cqt(n){return n.y}var Aqt=10,Mqt=Math.PI*(3-Math.sqrt(5));function Iqt(n){var e,t=1,r=.001,i=1-Math.pow(r,1/300),a=0,o=.6,s=new Map,l=hse(c),u=UVe("tick","end"),h=Eqt();n==null&&(n=[]);function c(){f(),u.call("tick",e),t1?(g==null?s.delete(p):s.set(p,v(g)),e):s.get(p)},find:function(p,g,m){var y=0,_=n.length,x,S,w,b,E;for(m==null?m=1/0:m*=m,y=0;y<_;++y)b=n[y],x=p-b.x,S=g-b.y,w=x*x+S*S,w1?(u.on(p,g),e):u.on(p)}}}function Lqt(){var n,e,t,r,i=ah(-30),a,o=1,s=1/0,l=.81;function u(d){var v,p=n.length,g=aV(n,Tqt,Cqt).visitAfter(c);for(r=d,v=0;v=s)return;(d.data!==e||d.next)&&(m===0&&(m=lS(t),x+=m*m),y===0&&(y=lS(t),x+=y*y),x-1||(o[l]=a[l])}),o}),r.ticking=!1},e.prototype.execute=function(t){var r=this,i=r.nodes,a=r.edges;if(!r.ticking){var o=r.forceSimulation,s=r.alphaMin,l=r.alphaDecay,u=r.alpha;if(o){if(t){if(r.clustering&&r.clusterForce&&(r.clusterForce.nodes(i),r.clusterForce.links(a)),o.nodes(i),a&&r.edgeForce)r.edgeForce.links(a);else if(a&&!r.edgeForce){var f=fC.forceLink().id(function(g){return g.id}).links(a);r.edgeStrength&&f.strength(r.edgeStrength),r.linkDistance&&f.distance(r.linkDistance),r.edgeForce=f,o.force("link",f)}}r.preventOverlap&&r.overlapProcess(o),o.alpha(u).restart(),this.ticking=!0}else try{var h=fC.forceManyBody();if(r.nodeStrength&&h.strength(r.nodeStrength),o=fC.forceSimulation().nodes(i),r.clustering){var c=(0,Wqt.default)();c.centerX(r.center[0]).centerY(r.center[1]).template("force").strength(r.clusterFociStrength),a&&c.links(a),i&&c.nodes(i),c.forceLinkDistance(r.clusterEdgeDistance).forceLinkStrength(r.clusterEdgeStrength).forceCharge(r.clusterNodeStrength).forceNodeSize(r.clusterNodeSize),r.clusterForce=c,o.force("group",c)}if(o.force("center",fC.forceCenter(r.center[0],r.center[1])).force("charge",h).alpha(u).alphaDecay(l).alphaMin(s),r.preventOverlap&&r.overlapProcess(o),a){var f=fC.forceLink().id(function(p){return p.id}).links(a);r.edgeStrength&&f.strength(r.edgeStrength),r.linkDistance&&f.distance(r.linkDistance),r.edgeForce=f,o.force("link",f)}if(r.workerEnabled&&!qqt()&&(r.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),!r.workerEnabled)o.on("tick",function(){r.tick()}).on("end",function(){r.ticking=!1,r.onLayoutEnd&&r.onLayoutEnd()}),r.ticking=!0;else{o.stop();for(var d=Yqt(o),v=1;v<=d;v++)o.tick(),postMessage({nodes:i,currentTick:v,totalTicks:d,type:jqt.LAYOUT_MESSAGE.TICK},void 0);r.ticking=!1}r.forceSimulation=o,r.ticking=!0}catch(p){r.ticking=!1,console.warn(p)}}},e.prototype.overlapProcess=function(t){var r=this,i=r.nodeSize,a=r.nodeSpacing,o,s,l=r.collideStrength;if((0,vb.isNumber)(a)?s=function(){return a}:(0,vb.isFunction)(a)?s=a:s=function(){return 0},!i)o=function(f){if(f.size){if((0,vb.isArray)(f.size)){var d=f.size[0]>f.size[1]?f.size[0]:f.size[1];return d/2+s(f)}if((0,vb.isObject)(f.size)){var d=f.size.width>f.size.height?f.size.width:f.size.height;return d/2+s(f)}return f.size/2+s(f)}return 10+s(f)};else if((0,vb.isFunction)(i))o=function(f){var d=i(f);return d+s(f)};else if((0,vb.isArray)(i)){var u=i[0]>i[1]?i[0]:i[1],h=u/2;o=function(f){return h+s(f)}}else if((0,vb.isNumber)(i)){var c=i/2;o=function(f){return c+s(f)}}else o=function(){return 10};t.force("collisionForce",fC.forceCollide(o).strength(l))},e.prototype.updateCfg=function(t){var r=this;r.ticking&&(r.forceSimulation.stop(),r.ticking=!1),r.forceSimulation=null,Object.assign(r,t)},e.prototype.destroy=function(){var t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0},e}(Hqt.Base);oV.ForceLayout=Xqt;function Yqt(n){var e=n.alphaMin(),t=n.alphaTarget(),r=n.alpha(),i=Math.log((e-t)/(r-t))/Math.log(1-n.alphaDecay()),a=Math.ceil(i);return a}function qqt(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}(function(n){var e=at&&at.__createBinding||(Object.create?function(r,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(r,o,s)}:function(r,i,a,o){o===void 0&&(o=a),r[o]=i[a]}),t=at&&at.__exportStar||function(r,i){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,r,a)};Object.defineProperty(n,"__esModule",{value:!0}),t(oV,n)})(Nse);var ek={},Zqt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(ek,"__esModule",{value:!0});ek.CircularLayout=void 0;var Kqt=Xl,$y=Dl();function Jqt(n,e,t,r){n.forEach(function(i,a){n[a].children=[],n[a].parent=[]}),r?e.forEach(function(i){var a=(0,$y.getEdgeTerminal)(i,"source"),o=(0,$y.getEdgeTerminal)(i,"target"),s=0;a&&(s=t[a]);var l=0;o&&(l=t[o]);var u=n[s].children,h=n[l].parent;u.push(n[l].id),h.push(n[s].id)}):e.forEach(function(i){var a=(0,$y.getEdgeTerminal)(i,"source"),o=(0,$y.getEdgeTerminal)(i,"target"),s=0;a&&(s=t[a]);var l=0;o&&(l=t[o]);var u=n[s].children,h=n[l].children;u.push(n[l].id),h.push(n[s].id)})}function Qqt(n,e,t){for(var r=t.length,i=0;ir?1:0}var tZt=function(n){Zqt(e,n);function e(t){var r=n.call(this)||this;return r.radius=null,r.nodeSize=void 0,r.startRadius=null,r.endRadius=null,r.startAngle=0,r.endAngle=2*Math.PI,r.clockwise=!0,r.divisions=1,r.ordering=null,r.angleRatio=1,r.nodes=[],r.edges=[],r.nodeMap={},r.degrees=[],r.width=300,r.height=300,r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,r=this,i=r.nodes,a=r.edges,o=i.length;if(o===0){r.onLayoutEnd&&r.onLayoutEnd();return}!r.width&&typeof window<"u"&&(r.width=window.innerWidth),!r.height&&typeof window<"u"&&(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var s=r.center;if(o===1){i[0].x=s[0],i[0].y=s[1],r.onLayoutEnd&&r.onLayoutEnd();return}var l=r.radius,u=r.startRadius,h=r.endRadius,c=r.divisions,f=r.startAngle,d=r.endAngle,v=r.angleRatio,p=r.ordering,g=r.clockwise,m=r.nodeSpacing,y=r.nodeSize,_=(d-f)/o,x={};i.forEach(function(D,G){x[D.id]=G}),r.nodeMap=x;var S=(0,$y.getDegree)(i.length,x,a);if(r.degrees=S,m){var w=(0,$y.getFuncByUnknownType)(10,m),b=(0,$y.getFuncByUnknownType)(10,y),E=-1/0;i.forEach(function(D){var G=b(D);Er.width?r.width/2:r.height/2:!u&&h?u=h:u&&!h&&(h=u);var C=_*v,A=[];p==="topology"?A=r.topologyOrdering():p==="topology-directed"?A=r.topologyOrdering(!0):p==="degree"?A=r.degreeOrdering():A=i;for(var M=Math.ceil(o/c),I=0;I0?n.set(e,t):n.delete(e))}function VVe(n,e,t,r){var i=String(e),a=String(t);if(!n&&i>a){var o=i;i=a,a=o}return i+HA.EDGE_KEY_DELIM+a+HA.EDGE_KEY_DELIM+(r===void 0?HA.DEFAULT_EDGE_NAME:r)}function Rwe(n,e,t,r){var i=String(e),a=String(t),o={v:e,w:t};if(!n&&i>a){var s=o.v;o.v=o.w,o.w=s}return r!==void 0&&(o.name=r),o}function tY(n,e){return VVe(n,e.v,e.w,e.name)}function Dwe(n){return typeof n=="function"}var iZt=function(e){return e.nodes().map(function(t){var r=e.node(t),i=e.parent(t),a={id:t,value:r,parent:i};return a.value===void 0&&delete a.value,a.parent===void 0&&delete a.parent,a})},aZt=function(e){return e.edges().map(function(t){var r=e.edge(t),i={v:t.v,w:t.w,value:r,name:t.name};return i.name===void 0&&delete i.name,i.value===void 0&&delete i.value,i})},oZt=function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:iZt(e),edges:aZt(e),value:e.graph()};return t.value===void 0&&delete t.value,t},sZt=function(e){var t=new oT(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(function(r){t.setNode(r.id,r.value),r.parent&&t.setParent(r.id,r.parent)}),e.edges.forEach(function(r){t.setEdge(r.v,r.w,r.value,r.name)}),t};function Nwe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function kwe(n){for(var e=1;e0&&arguments[0]!==void 0?arguments[0]:{};uZt(this,n),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=HA.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(i){return e.label=i,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(i){return Dwe(i)?e.defaultNodeLabelFn=i:e.defaultNodeLabelFn=function(){return i},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(i){return e.nodesLabelMap.get(i)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter(function(i){var a;return!(!((a=e.inEdgesMap.get(i))===null||a===void 0)&&a.size)})},this.sinks=function(){return e.nodes().filter(function(i){var a;return!(!((a=e.outEdgesMap.get(i))===null||a===void 0)&&a.size)})},this.setNodes=function(i,a){return i.map(function(o){return e.setNode(o,a)}),e},this.hasNode=function(i){return e.nodesLabelMap.has(i)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(i){if(e.isCompound()){var a,o=(a=e.parentMap)===null||a===void 0?void 0:a.get(i);if(o!==e.GRAPH_NODE)return o}},this.removeFromParentsChildList=function(i){var a=e.parentMap.get(i);e.childrenMap.get(a).delete(i)},this.setParent=function(i,a){var o,s;e.checkCompound();for(var l=a===void 0?e.GRAPH_NODE:a,u=e.parent(l);u;){if(i===u)throw new Error("Setting "+a+" as parent of "+i+" would create a cycle");u=e.parent(u)}a&&e.setNode(a),e.setNode(i),e.removeFromParentsChildList(i),(o=e.parentMap)===null||o===void 0||o.set(i,l);var h=e.childrenMap.get(l);return h.set(i,!0),(s=e.childrenMap)===null||s===void 0||s.set(l,h),e},this.children=function(i){var a=i===void 0?e.GRAPH_NODE:i;if(e.isCompound()){var o,s=(o=e.childrenMap)===null||o===void 0?void 0:o.get(a);return s?Array.from(s.keys()):void 0}if(a===e.GRAPH_NODE)return e.nodes();if(i&&e.hasNode(i))return[]},this.predecessors=function(i){var a=e.predecessorsMap.get(i);return a?Array.from(a.keys()):void 0},this.successors=function(i){var a=e.successorsMap.get(i);return a?Array.from(a.keys()):void 0},this.neighbors=function(i){var a;if(!!e.hasNode(i))return Array.from(new Set((a=e.predecessors(i))===null||a===void 0?void 0:a.concat(e.successors(i))))},this.isLeaf=function(i){var a;if(e.isDirected()){var o;return!(!((o=e.successors(i))===null||o===void 0)&&o.length)}return!(!((a=e.neighbors(i))===null||a===void 0)&&a.length)},this.filterNodes=function(i){var a=e.directed,o=e.multigraph,s=e.compound,l=new n({directed:a,multigraph:o,compound:s});if(l.setGraph(e.graph()),e.nodes().forEach(function(h){i(h)&&l.setNode(h,e.node(h))}),e.edges().forEach(function(h){l.hasNode(h.v)&&l.hasNode(h.w)&&l.setEdgeObj(h,e.edge(h))}),s){var u=function(c){for(var f=e.parent(c);f!==void 0&&!l.hasNode(f);)f=e.parent(f);return f};l.nodes().forEach(function(h){l.setParent(h,u(h))})}return l},this.setDefaultEdgeLabel=function(i){return Dwe(i)?e.defaultEdgeLabelFn=i:e.defaultEdgeLabelFn=function(){return i},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(i,a){return e.setEdge(i.v,i.w,a,i.name)},this.setPath=function(i,a){return i.reduce(function(o,s){return e.setEdge(o,s,a),s}),e},this.edgeFromArgs=function(i,a,o){return e.edge({v:i,w:a,name:o})},this.edge=function(i){return e.edgesLabelsMap.get(tY(e.isDirected(),i))},this.hasEdge=function(i,a,o){return e.edgesLabelsMap.has(tY(e.isDirected(),{v:i,w:a,name:o}))},this.removeEdgeObj=function(i){var a=i.v,o=i.w,s=i.name;return e.removeEdge(a,o,s)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(i,a){var o=e.inEdgesMap.get(i);if(o)return Array.from(o.values()).filter(function(s){return!a||s.v===a})},this.outEdges=function(i,a){var o=e.outEdgesMap.get(i);if(o)return Array.from(o.values()).filter(function(s){return!a||s.w===a})},this.nodeEdges=function(i,a){var o;if(!!e.hasNode(i))return(o=e.inEdges(i,a))===null||o===void 0?void 0:o.concat(e.outEdges(i,a))},this.toJSON=function(){return oZt(e)},this.nodeInDegree=function(i){var a=e.inEdgesMap.get(i);return a?a.size:0},this.nodeOutDegree=function(i){var a=e.outEdgesMap.get(i);return a?a.size:0},this.nodeDegree=function(i){return e.nodeInDegree(i)+e.nodeOutDegree(i)},this.source=function(i){return i.v},this.target=function(i){return i.w};var r=kwe(kwe({},cZt),t);this.compound=r.compound,this.directed=r.directed,this.multigraph=r.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return hZt(n,[{key:"setNode",value:function(t,r){var i=this.nodesLabelMap,a=this.defaultNodeLabelFn,o=this.isCompound,s=this.parentMap,l=this.childrenMap,u=this.inEdgesMap,h=this.outEdgesMap,c=this.predecessorsMap,f=this.successorsMap;if(i.has(t))return r!==void 0&&i.set(t,r),this;if(i.set(t,r||a(t)),o()){var d;s==null||s.set(t,this.GRAPH_NODE),l==null||l.set(t,new Map),l!=null&&l.has(this.GRAPH_NODE)||l==null||l.set(this.GRAPH_NODE,new Map),l==null||(d=l.get(this.GRAPH_NODE))===null||d===void 0||d.set(t,!0)}return[u,h,c,f].forEach(function(v){return v.set(t,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(t){var r=this;if(this.hasNode(t)){var i=function(g){r.removeEdge(g.v,g.w,g.name)},a=this.inEdgesMap,o=this.outEdgesMap,s=this.predecessorsMap,l=this.successorsMap,u=this.nodesLabelMap;if(this.isCompound()){var h,c,f;this.removeFromParentsChildList(t),(h=this.parentMap)===null||h===void 0||h.delete(t),(c=this.children(t))===null||c===void 0||c.forEach(function(p){return r.setParent(p)}),(f=this.childrenMap)===null||f===void 0||f.delete(t)}var d=a.get(t),v=o.get(t);Array.from(d.values()).forEach(function(p){return i(p)}),Array.from(v.values()).forEach(function(p){return i(p)}),u.delete(t),a.delete(t),o.delete(t),s.delete(t),l.delete(t),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(t,r,i,a){var o,s,l=Rwe(this.isDirected(),t,r,a),u=tY(this.isDirected(),l),h=l.v,c=l.w;if(this.edgesLabelsMap.has(u))return this.edgesLabelsMap.set(u,i),this;if(a!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(h),this.setNode(c),this.edgesLabelsMap.set(u,i||this.defaultEdgeLabelFn(h,c,a)),Object.freeze(l),this.edgesMap.set(u,l);var f=this.predecessorsMap.get(c),d=this.successorsMap.get(h);return Pwe(f,h),Pwe(d,c),(o=this.inEdgesMap.get(c))===null||o===void 0||o.set(u,l),(s=this.outEdgesMap.get(h))===null||s===void 0||s.set(u,l),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(t,r,i){var a=VVe(this.isDirected(),t,r,i),o=this.edgesMap.get(a);if(o){var s=Rwe(this.isDirected(),t,r,i),l=s.v,u=s.w;this.edgesLabelsMap.delete(a),this.edgesMap.delete(a);var h=this.predecessorsMap.get(u),c=this.successorsMap.get(l);Owe(h,l),Owe(c,u),this.inEdgesMap.get(u).delete(a),this.outEdgesMap.get(l).delete(a),this.edgeCountNum-=1}return this}}]),n}();oT.fromJSON=sZt;function Tee(n){return Tee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tee(n)}function fZt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Bwe(n,e){for(var t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function D1(n){return D1=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},D1(n)}var xZt=function(n){pZt(t,n);var e=gZt(t);function t(){var r;fZt(this,t);for(var i=arguments.length,a=new Array(i),o=0;o-1&&this.eventPool[i].splice(o,1)}}},{key:"emitEvent",value:function(i){for(var a=arguments.length,o=new Array(a>1?a-1:0),s=1;s>1,((s=r[a])===null||s===void 0?void 0:s.priority)e.arr[i].priority)throw new Error("New priority is greater than current priority.Key: ".concat(t," Old: + ").concat(e.arr[i].priority," New: ").concat(r));e.arr[i].priority=r,e.innerDecrease(i)}}),bZt=function(e,t){var r=new oT,i=new Map,a=new $Ve,o;function s(h){var c=h.v===o?h.w:h.v,f=a.priority(c);if(f!==void 0){var d=t(h);d0;){var u;if(o=a.removeMin(),i.has(o))r.setEdge(o,i.get(o));else{if(l)throw new Error("Input graph is not connected: "+e.graph());l=!0}(u=e.nodeEdges(o))===null||u===void 0||u.forEach(s)}return r},EZt=function(e){var t=new Set,r=[],i=e.nodes();return i.forEach(function(a){for(var o=[],s=[a];s.length>0;){var l=s.pop();if(!t.has(l)){var u,h;t.add(l),o.push(l),(u=e.successors(l))===null||u===void 0||u.forEach(function(c){return s.push(c)}),(h=e.predecessors(l))===null||h===void 0||h.forEach(function(c){return s.push(c)})}}o.length&&r.push(o)}),r},TZt=function n(e,t,r,i,a,o){i.includes(t)||(i.push(t),r||o.push(t),a(t).forEach(function(s){return n(e,s,r,i,a,o)}),r&&o.push(t))},$se=function(e,t,r){var i=Array.isArray(t)?t:[t],a=function(u){return e.isDirected()?e.successors(u):e.neighbors(u)},o=[],s=[];return i.forEach(function(l){if(e.hasNode(l))TZt(e,l,r==="post",s,a,o);else throw new Error("Graph does not have node: "+l)}),o};function CZt(n,e){return LZt(n)||IZt(n,e)||MZt(n,e)||AZt()}function AZt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MZt(n,e){if(!!n){if(typeof n=="string")return zwe(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return zwe(n,e)}}function zwe(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t0&&(s=o.removeMin(),l=a.get(s),!(l&&l.distance===Number.POSITIVE_INFINITY));)i(s).forEach(u);var h={};return Array.from(a.entries()).forEach(function(c){var f=CZt(c,2),d=f[0],v=f[1];return h[String(d)]=v,h}),h},RZt=function(e,t,r){var i={};return e.nodes().forEach(function(a){return i[String(a)]=WVe(e,a,t,r),i}),i},HVe=function(e){var t=0,r=[],i=new Map,a=[];function o(s){var l,u={onStack:!0,lowlink:t,index:t};if(i.set(s,u),t+=1,r.push(s),(l=e.successors(s))===null||l===void 0||l.forEach(function(d){var v;if(i.has(d)){if(!((v=i.get(d))===null||v===void 0)&&v.onStack){var g=i.get(d);u.lowlink=Math.min(u.lowlink,g.index)}}else{o(d);var p=i.get(d);u.lowlink=Math.min(u.lowlink,p.lowlink)}}),u.lowlink===u.index){var h=[],c;do{c=r.pop();var f=i.get(c);f.onStack=!1,h.push(c)}while(s!==c);a.push(h)}}return e.nodes().forEach(function(s){i.has(s)||o(s)}),a},DZt=function(e){return HVe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})};function Aee(n){return Aee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Aee(n)}function Uwe(n,e){for(var t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function UZt(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function KD(n,e){return KD=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},KD(n,e)}function JD(n){return JD=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},JD(n)}var Iee=function(n){FZt(t,n);var e=BZt(t);function t(){return kZt(this,t),e.apply(this,arguments)}return NZt(t)}(Mee(Error));function XVe(n){var e=new Set,t=new Set,r=[];function i(a){if(t.has(a))throw new Iee;if(!e.has(a)){var o;t.add(a),e.add(a),(o=n.predecessors(a))===null||o===void 0||o.forEach(i),t.delete(a),r.push(a)}}if(n.sinks().forEach(i),e.size!==n.nodeCount())throw new Iee;return r}var VZt=function(e){try{XVe(e)}catch(t){if(t instanceof Iee)return!1;throw t}return!0},$Zt=function(e,t){return $se(e,t,"post")},WZt=function(e,t){return $se(e,t,"pre")},HZt=function(){return 1};function jZt(n,e,t){return XZt(n,e||HZt,t||function(r){return n.outEdges(r)})}function XZt(n,e,t){var r={},i=n.nodes();return i.forEach(function(a){var o=String(a);r[o]={},r[o][o]={distance:0},i.forEach(function(s){a!==s&&(r[o][String(s)]={distance:Number.POSITIVE_INFINITY})}),t(a).forEach(function(s){var l=s.v===a?s.w:s.v,u=e(s);r[o][String(l)]={distance:u,predecessor:a}})}),i.forEach(function(a){var o=String(a),s=r[o];i.forEach(function(l){var u=String(l),h=r[u];i.forEach(function(c){var f=String(c),d=h[o],v=s[f],p=h[f],g=d.distance+v.distance;gn.length)&&(e=n.length);for(var t=0,r=new Array(e);t0;--s)if(o=e[s].dequeue(),o){r=r.concat(rY(n,e,t,o,!0));break}}}return r},rY=function(n,e,t,r,i){var a,o,s=[];return(a=n.inEdges(r.v))===null||a===void 0||a.forEach(function(l){var u=n.edge(l),h=n.node(l.v);i&&s.push({v:l.v,w:l.w,in:0,out:0}),h.out===void 0&&(h.out=0),h.out-=u,Lee(e,t,h)}),(o=n.outEdges(r.v))===null||o===void 0||o.forEach(function(l){var u=n.edge(l),h=l.w,c=n.node(h);c.in===void 0&&(c.in=0),c.in-=u,Lee(e,t,c)}),n.removeNode(r.v),i?s:void 0},xKt=function(n,e){var t=new gKt,r=0,i=0;n.nodes().forEach(function(u){t.setNode(u,{v:u,in:0,out:0})}),n.edges().forEach(function(u){var h=t.edge(u)||0,c=(e==null?void 0:e(u))||1,f=h+c;t.setEdge(u.v,u.w,f),i=Math.max(i,t.node(u.v).out+=c),r=Math.max(r,t.node(u.w).in+=c)});for(var a=[],o=i+r+3,s=0;sMath.abs(E)*A?(T<0&&(A=-A),M=A*E/T,I=A):(E<0&&(C=-C),M=C,I=C*T/E),{x:w+M,y:b+I}};n.intersectRect=h;var c=function(x){for(var S=[],w=(0,n.maxRank)(x)+1,b=0;bS)&&(S=E)}),S||(S=0),S};n.maxRank=p;var g=function(x,S){var w={lhs:[],rhs:[]};return x==null||x.forEach(function(b){S(b)?w.lhs.push(b):w.rhs.push(b)}),w};n.partition=g;var m=function(x,S){var w=Date.now();try{return S()}finally{console.log("".concat(x," time: ").concat(Date.now()-w,"ms"))}};n.time=m;var y=function(x,S){return S()};n.notime=y;var _=function(x,S){return x.reduce(function(w,b){var E=S(w),T=S(b);return E>T?b:w})};n.minBy=_})(Nv);Object.defineProperty(Hse,"__esModule",{value:!0});var IKt=Nv,LKt=function(n){n.graph().dummyChains=[],n.edges().forEach(function(e){return PKt(n,e)})},PKt=function(n,e){var t=e.v,r=n.node(t).rank,i=e.w,a=n.node(i).rank,o=e.name,s=n.edge(e),l=s.labelRank;if(a!==r+1){n.removeEdgeObj(e);var u=n.graph(),h,c,f;for(f=0,++r;rT.lim&&(C=T,A=!0);var M=x.edges().filter(function(I){return A===y(_,_.node(I.v),C)&&A!==y(_,_.node(I.w),C)});return(0,r.minBy)(M,function(I){return(0,t.slack)(x,I)})};n.enterEdge=v;var p=function(_,x,S,w){var b=S.v,E=S.w;_.removeEdge(b,E),_.setEdge(w.v,w.w,{}),(0,n.initLowLimValues)(_),(0,n.initCutValues)(_,x),g(_,x)};n.exchangeEdges=p;var g=function(_,x){var S=_.nodes().find(function(b){var E;return!(!((E=x.node(b))===null||E===void 0)&&E.parent)}),w=a(_,S);w=w==null?void 0:w.slice(1),w==null||w.forEach(function(b){var E=_.node(b).parent,T=x.edgeFromArgs(b,E),C=!1;T||(T=x.edgeFromArgs(E,b),C=!0),x.node(b).rank=x.node(E).rank+(C?T.minlen:-T.minlen)})},m=function(_,x,S){return _.hasEdge(x,S)},y=function(_,x,S){return S.low<=x.lim&&x.lim<=S.lim};n.default=s})(s$e);var kKt=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(jse,"__esModule",{value:!0});var l$e=c0,FKt=ZS,BKt=kKt(s$e),GKt=function(n){switch(n.graph().ranker){case"network-simplex":UKt(n);break;case"tight-tree":$we(n);break;case"longest-path":zKt(n);break;default:$we(n)}},zKt=l$e.longestPath,$we=function(n){(0,l$e.longestPathWithLayer)(n),(0,FKt.feasibleTreeWithLayer)(n)},UKt=function(n){(0,BKt.default)(n)};jse.default=GKt;var Xse={};Object.defineProperty(Xse,"__esModule",{value:!0});var VKt=function(n){var e,t={},r=0,i=function(a){var o,s=r;(o=n.children(a))===null||o===void 0||o.forEach(i),t[a]={low:s,lim:r++}};return(e=n.children())===null||e===void 0||e.forEach(i),t},$Kt=function(n,e,t,r){var i=[],a=[],o=Math.min(e[t].low,e[r].low),s=Math.max(e[t].lim,e[r].lim),l,u;l=t;do l=n.parent(l),i.push(l);while(l&&(e[l].low>o||s>e[l].lim));for(u=l,l=r;l&&l!==u;)a.push(l),l=n.parent(l);return{lca:u,path:i.concat(a.reverse())}},WKt=function(n){var e,t=VKt(n);(e=n.graph().dummyChains)===null||e===void 0||e.forEach(function(r){var i,a,o=r,s=n.node(o),l=s.edgeObj;if(!!l)for(var u=$Kt(n,t,l.v,l.w),h=u.path,c=u.lca,f=0,d=h[f],v=!0;o!==l.w;){if(s=n.node(o),v){for(;d!==c&&((i=n.node(d))===null||i===void 0?void 0:i.maxRank)-1:!1};const L9=rJt;var nJt=function(n,e){if(!Td(n))return n;for(var t=[],r=0;r-1;)xJt.call(n,a,1);return n};const bJt=wJt;var EJt=Array.prototype.splice,TJt=function(e,t){if(!Td(e))return[];for(var r=e?t.length:0,i=r-1;r--;){var a=void 0,o=t[r];(r===i||o!==a)&&(a=o,EJt.call(e,o,1))}return e};const x$e=TJt;var CJt=function(n,e,t){if(!ju(n)&&!RM(n))return n;var r=t;return OM(n,function(i,a){r=e(r,i,a)}),r};const S$e=CJt;var AJt=function(n,e){var t=[];if(!Td(n))return t;for(var r=-1,i=[],a=n.length;++ra[s])return 1;if(i[s]t?t:n};const YJt=XJt;var qJt=function(n,e){var t=e.toString(),r=t.indexOf(".");if(r===-1)return Math.round(n);var i=t.substr(r+1).length;return i>20&&(i=20),parseFloat(n.toFixed(i))};const ZJt=qJt;function U_(n){return typeof n=="number"}function KJt(n){return U_(n)&&n%1!==0}function JJt(n){return U_(n)&&n%2===0}function QJt(n){return U_(n)&&n%1===0}function eQt(n){return U_(n)&&n<0}var tQt=1e-5;function rQt(n,e,t){return t===void 0&&(t=tQt),n===e||Math.abs(n-e)0};const aQt=iQt,oQt=function(n,e){if(!!ju(n)){for(var t,r=-1/0,i=0;ir&&(t=a,r=o)}return t}},sQt=function(n,e){if(!!ju(n)){for(var t,r=1/0,i=0;ii&&(r=t,o(1),++e),t[s]=l}function o(s){e=0,t=Object.create(null),s||(r=Object.create(null))}return o(),{clear:o,has:function(s){return t[s]!==void 0||r[s]!==void 0},get:function(s){var l=t[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return a(s,l),l},set:function(s,l){t[s]!==void 0?t[s]=l:a(s,l)}}}var sY=new Map;function M$e(n,e,t){t===void 0&&(t=128);var r=function(){for(var i=[],a=0;ae?(r&&(clearTimeout(r),r=null),s=h,o=n.apply(i,a),r||(i=a=null)):!r&&t.trailing!==!1&&(r=setTimeout(l,c)),o};return u.cancel=function(){clearTimeout(r),s=0,r=i=a=null},u},xer=function(n){return Td(n)?Array.prototype.slice.call(n):[]};var O5={};const Ser=function(n){return n=n||"g",O5[n]?O5[n]+=1:O5[n]=1,n+O5[n]},wer=function(){},ber=function(n){return n};function Eer(n){return Tw(n)?0:Td(n)?n.length:Object.keys(n).length}var Ter=function(){function n(){this.map={}}return n.prototype.has=function(e){return this.map[e]!==void 0},n.prototype.get=function(e,t){var r=this.map[e];return r===void 0?t:r},n.prototype.set=function(e,t){this.map[e]=t},n.prototype.clear=function(){this.map={}},n.prototype.delete=function(e){delete this.map[e]},n.prototype.size=function(){return Object.keys(this.map).length},n}();const Cer=Ter;var Aer=/rgba?\(([\s.,0-9]+)\)/;function Mer(){var n=document.getElementById("antv-web-colour-picker");return n||(n=document.createElement("i"),n.id="antv-web-colour-picker",n.title="Web Colour Picker",n.style.display="none",document.body.appendChild(n),n)}function Ier(n){if(n[0]==="#"&&n.length===7)return n;var e=Mer();e.style.color=n;var t=document.defaultView.getComputedStyle(e,"").getPropertyValue("color"),r=Aer.exec(t),i=r[1].split(/\s*,\s*/).map(function(a){return Number(a)});return t=f$e(i),t}var P$e=M$e(Ier,function(n){return n},256);function lY(n,e,t,r){return n[r]+(e[r]-n[r])*t}function Ler(n,e){var t=isNaN(Number(e))||e<0?0:e>1?1:Number(e),r=n.length-1,i=Math.floor(r*t),a=r*t-i,o=n[i],s=i===r?o:n[i+1];return f$e([lY(o,s,a,0),lY(o,s,a,1),lY(o,s,a,2)])}function Per(n){var e=typeof n=="string"?n.split("-"):n,t=e.map(function(r){return c$e(r.indexOf("#")===-1?P$e(r):r)});return function(r){return Ler(t,r)}}var Oer=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Rer=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Der=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function Ner(n){return/^[r,R,L,l]{1}[\s]*\(/.test(n)}function ker(n){if(Ner(n)){var e,t=void 0;if(n[0]==="l"){var r=Oer.exec(n),i=+r[1]+90;t=r[2],e="linear-gradient(".concat(i,"deg, ")}else if(n[0]==="r"){e="radial-gradient(";var r=Rer.exec(n);t=r[4]}var a=t.match(Der);return a.forEach(function(o,s){var l=o.split(":");e+="".concat(l[1]," ").concat(Number(l[0])*100,"%"),s!==a.length-1&&(e+=", ")}),e+=")",e}return n}function Fer(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return Boe(r,t),Om(n,r,e)}function Ber(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return Goe(r,t),Om(n,r,e)}function Ger(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return zoe(r,t),Om(n,r,e)}function zer(n,e,t){return Om(n,t,e)}function Uer(n,e){for(var t=n?[].concat(n):[1,0,0,0,1,0,0,0,1],r=0,i=e.length;r=0;return t?i?Math.PI*2-r:r:i?r:Math.PI*2-r}function $er(n,e,t){return t?(n[0]=e[1],n[1]=-1*e[0]):(n[0]=-1*e[1],n[1]=e[0]),n}function Wer(n,e){if(e==="off")return[].concat(n);var t=typeof e=="number"&&e>=1?Math.pow(10,e):1;return n.map(function(r){var i=r.slice(1).map(Number).map(function(a){return e?Math.round(a*t)/t:Math.round(a)});return[r[0]].concat(i)})}function Her(n,e){return e===void 0&&(e="off"),Wer(n,e).map(function(t){return t[0]+t.slice(1).join(" ")}).join("")}var R$e={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function jer(n,e,t){if(n[t].length>7){n[t].shift();for(var r=n[t],i=t;r.length;)e[t]="A",n.splice(i+=1,0,["C"].concat(r.splice(0,6)));n.splice(t,1)}}var xR={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function D$e(n){return Array.isArray(n)&&n.every(function(e){var t=e[0].toLowerCase();return xR[t]===e.length-1&&"achlmqstvz".includes(t)})}function N$e(n){return D$e(n)&&n.every(function(e){var t=e[0];return t===t.toUpperCase()})}function k$e(n){return N$e(n)&&n.every(function(e){var t=e[0];return"ACLMQZ".includes(t)})}function Ywe(n){for(var e=n.pathValue[n.segmentStart],t=e.toLowerCase(),r=n.data;r.length>=xR[t]&&(t==="m"&&r.length>2?(n.segments.push([e].concat(r.splice(0,2))),t="l",e=e==="m"?"l":"L"):n.segments.push([e].concat(r.splice(0,xR[t]))),!!xR[t]););}function Xer(n){var e=n.index,t=n.pathValue,r=t.charCodeAt(e);if(r===48){n.param=0,n.index+=1;return}if(r===49){n.param=1,n.index+=1;return}n.err='[path-util]: invalid Arc flag "'.concat(t[e],'", expecting 0 or 1 at index ').concat(e)}function Yer(n){return n>=48&&n<=57||n===43||n===45||n===46}function dC(n){return n>=48&&n<=57}function qer(n){var e=n.max,t=n.pathValue,r=n.index,i=r,a=!1,o=!1,s=!1,l=!1,u;if(i>=e){n.err="[path-util]: Invalid path value at index ".concat(i,', "pathValue" is missing param');return}if(u=t.charCodeAt(i),(u===43||u===45)&&(i+=1,u=t.charCodeAt(i)),!dC(u)&&u!==46){n.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(t[i],'" is not a number');return}if(u!==46){if(a=u===48,i+=1,u=t.charCodeAt(i),a&&i=5760&&e.includes(n)}function JB(n){for(var e=n.pathValue,t=n.max;n.index0;o-=1){if(Jer(i)&&(o===3||o===4)?Xer(n):qer(n),n.err.length)return;n.data.push(n.param),JB(n),n.index=n.max||!Yer(t.charCodeAt(n.index)))break}Ywe(n)}var etr=function(){function n(e){this.pathValue=e,this.segments=[],this.max=e.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return n}();function hV(n){if(D$e(n))return[].concat(n);var e=new etr(n);for(JB(e);e.index1&&(C=Math.sqrt(C),f*=C,d*=C);var A=f*f,M=d*d,I=(a===o?-1:1)*Math.sqrt(Math.abs((A*M-A*T*T-M*E*E)/(A*T*T+M*E*E)));w=I*f*T/d+(h+v)/2,b=I*-d*E/f+(c+p)/2,x=Math.asin(((c-b)/d*Math.pow(10,9)>>0)/Math.pow(10,9)),S=Math.asin(((p-b)/d*Math.pow(10,9)>>0)/Math.pow(10,9)),x=hS&&(x-=Math.PI*2),!o&&S>x&&(S-=Math.PI*2)}var R=S-x;if(Math.abs(R)>g){var k=S,D=v,G=p;S=x+g*(o&&S>x?1:-1),v=w+f*Math.cos(S),p=b+d*Math.sin(S),y=Qse(v,p,f,d,i,0,o,D,G,[S,k,w,b])}R=S-x;var W=Math.cos(x),z=Math.sin(x),V=Math.cos(S),q=Math.sin(S),Y=Math.tan(R/4),le=4/3*f*Y,j=4/3*d*Y,Q=[h,c],ie=[h+le*z,c-j*W],oe=[v+le*q,p-j*V],se=[v,p];if(ie[0]=2*Q[0]-ie[0],ie[1]=2*Q[1]-ie[1],u)return ie.concat(oe,se,y);y=ie.concat(oe,se,y);for(var me=[],Ce=0,Le=y.length;Ce=a)o={x:t,y:r};else{var s=Gx([n,e],[t,r],i/a),l=s[0],u=s[1];o={x:l,y:u}}return{length:a,point:o,min:{x:Math.min(n,t),y:Math.min(e,r)},max:{x:Math.max(n,t),y:Math.max(e,r)}}}function Zwe(n,e){var t=n.x,r=n.y,i=e.x,a=e.y,o=t*i+r*a,s=Math.sqrt((Math.pow(t,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))),l=t*a-r*i<0?-1:1,u=l*Math.acos(o/s);return u}function ltr(n,e,t,r,i,a,o,s,l,u){var h=Math.abs,c=Math.sin,f=Math.cos,d=Math.sqrt,v=Math.PI,p=h(t),g=h(r),m=(i%360+360)%360,y=m*(v/180);if(n===s&&e===l)return{x:n,y:e};if(p===0||g===0)return Dee(n,e,s,l,u).point;var _=(n-s)/2,x=(e-l)/2,S={x:f(y)*_+c(y)*x,y:-c(y)*_+f(y)*x},w=Math.pow(S.x,2)/Math.pow(p,2)+Math.pow(S.y,2)/Math.pow(g,2);w>1&&(p*=d(w),g*=d(w));var b=Math.pow(p,2)*Math.pow(g,2)-Math.pow(p,2)*Math.pow(S.y,2)-Math.pow(g,2)*Math.pow(S.x,2),E=Math.pow(p,2)*Math.pow(S.y,2)+Math.pow(g,2)*Math.pow(S.x,2),T=b/E;T=T<0?0:T;var C=(a!==o?1:-1)*d(T),A={x:C*(p*S.y/g),y:C*(-(g*S.x)/p)},M={x:f(y)*A.x-c(y)*A.y+(n+s)/2,y:c(y)*A.x+f(y)*A.y+(e+l)/2},I={x:(S.x-A.x)/p,y:(S.y-A.y)/g},R=Zwe({x:1,y:0},I),k={x:(-S.x-A.x)/p,y:(-S.y-A.y)/g},D=Zwe(I,k);!o&&D>0?D-=2*v:o&&D<0&&(D+=2*v),D%=2*v;var G=R+D*u,W=p*f(G),z=g*c(G),V={x:f(y)*W-c(y)*z+M.x,y:c(y)*W+f(y)*z+M.y};return V}function utr(n,e,t,r,i,a,o,s,l,u,h){var c,f=h.bbox,d=f===void 0?!0:f,v=h.length,p=v===void 0?!0:v,g=h.sampleSize,m=g===void 0?30:g,y=typeof u=="number",_=n,x=e,S=0,w=[_,x,S],b=[_,x],E=0,T={x:0,y:0},C=[{x:_,y:x}];y&&u<=0&&(T={x:_,y:x});for(var A=0;A<=m;A+=1){if(E=A/m,c=ltr(n,e,t,r,i,a,o,s,l,E),_=c.x,x=c.y,d&&C.push({x:_,y:x}),p&&(S+=KI(b,[_,x])),b=[_,x],y&&S>=u&&u>w[2]){var M=(S-u)/(S-w[2]);T={x:b[0]*(1-M)+w[0]*M,y:b[1]*(1-M)+w[1]*M}}w=[_,x,S]}return y&&u>=S&&(T={x:s,y:l}),{length:S,point:T,min:{x:Math.min.apply(null,C.map(function(I){return I.x})),y:Math.min.apply(null,C.map(function(I){return I.y}))},max:{x:Math.max.apply(null,C.map(function(I){return I.x})),y:Math.max.apply(null,C.map(function(I){return I.y}))}}}function htr(n,e,t,r,i,a,o,s,l){var u=1-l;return{x:Math.pow(u,3)*n+3*Math.pow(u,2)*l*t+3*u*Math.pow(l,2)*i+Math.pow(l,3)*o,y:Math.pow(u,3)*e+3*Math.pow(u,2)*l*r+3*u*Math.pow(l,2)*a+Math.pow(l,3)*s}}function G$e(n,e,t,r,i,a,o,s,l,u){var h,c=u.bbox,f=c===void 0?!0:c,d=u.length,v=d===void 0?!0:d,p=u.sampleSize,g=p===void 0?10:p,m=typeof l=="number",y=n,_=e,x=0,S=[y,_,x],w=[y,_],b=0,E={x:0,y:0},T=[{x:y,y:_}];m&&l<=0&&(E={x:y,y:_});for(var C=0;C<=g;C+=1){if(b=C/g,h=htr(n,e,t,r,i,a,o,s,b),y=h.x,_=h.y,f&&T.push({x:y,y:_}),v&&(x+=KI(w,[y,_])),w=[y,_],m&&x>=l&&l>S[2]){var A=(x-l)/(x-S[2]);E={x:w[0]*(1-A)+S[0]*A,y:w[1]*(1-A)+S[1]*A}}S=[y,_,x]}return m&&l>=x&&(E={x:o,y:s}),{length:x,point:E,min:{x:Math.min.apply(null,T.map(function(M){return M.x})),y:Math.min.apply(null,T.map(function(M){return M.y}))},max:{x:Math.max.apply(null,T.map(function(M){return M.x})),y:Math.max.apply(null,T.map(function(M){return M.y}))}}}function ctr(n,e,t,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*n+2*s*o*t+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function ftr(n,e,t,r,i,a,o,s){var l,u=s.bbox,h=u===void 0?!0:u,c=s.length,f=c===void 0?!0:c,d=s.sampleSize,v=d===void 0?10:d,p=typeof o=="number",g=n,m=e,y=0,_=[g,m,y],x=[g,m],S=0,w={x:0,y:0},b=[{x:g,y:m}];p&&o<=0&&(w={x:g,y:m});for(var E=0;E<=v;E+=1){if(S=E/v,l=ctr(n,e,t,r,i,a,S),g=l.x,m=l.y,h&&b.push({x:g,y:m}),f&&(y+=KI(x,[g,m])),x=[g,m],p&&y>=o&&o>_[2]){var T=(y-o)/(y-_[2]);w={x:x[0]*(1-T)+_[0]*T,y:x[1]*(1-T)+_[1]*T}}_=[g,m,y]}return p&&o>=y&&(w={x:i,y:a}),{length:y,point:w,min:{x:Math.min.apply(null,b.map(function(C){return C.x})),y:Math.min.apply(null,b.map(function(C){return C.y}))},max:{x:Math.max.apply(null,b.map(function(C){return C.x})),y:Math.max.apply(null,b.map(function(C){return C.y}))}}}function fV(n,e,t){for(var r,i,a,o,s,l,u=cV(n),h=typeof e=="number",c,f=[],d,v=0,p=0,g=0,m=0,y,_=[],x=[],S=0,w={x:0,y:0},b=w,E=w,T=w,C=0,A=0,M=u.length;A=e&&(T=E),x.push(b),_.push(w),C+=S,l=d!=="Z"?y.slice(-2):[g,m],v=l[0],p=l[1];return h&&e>=C&&(T={x:v,y:p}),{length:C,point:T,min:{x:Math.min.apply(null,_.map(function(I){return I.x})),y:Math.min.apply(null,_.map(function(I){return I.y}))},max:{x:Math.max.apply(null,x.map(function(I){return I.x})),y:Math.max.apply(null,x.map(function(I){return I.y}))}}}function dtr(n,e){if(!n)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var t=fV(n,void 0,ve(ve({},e),{length:!1})),r=t.min,i=r.x,a=r.y,o=t.max,s=o.x,l=o.y,u=s-i,h=l-a;return{width:u,height:h,x:i,y:a,x2:s,y2:l,cx:i+u/2,cy:a+h/2,cz:Math.max(u,h)+Math.min(u,h)/2}}function SR(n,e){return fV(n,void 0,ve(ve({},e),{bbox:!1,length:!0})).length}function vtr(n,e){if(!n)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var t=fV(n,void 0,ve(ve({},e),{bbox:!0,length:!0})),r=t.length,i=t.min,a=i.x,o=i.y,s=t.max,l=s.x,u=s.y,h=l-a,c=u-o;return{length:r,width:h,height:c,x:a,y:o,x2:l,y2:u,cx:a+h/2,cy:o+c/2,cz:Math.max(h,c)+Math.min(h,c)/2}}function ptr(n){var e=n.length,t=e-1;return n.map(function(r,i){return n.map(function(a,o){var s=i+o,l;return o===0||n[s]&&n[s][0]==="M"?(l=n[s],["M"].concat(l.slice(-2))):(s>=e&&(s-=t),n[s])})})}function gtr(n,e){var t=n.length-1,r=[],i=0,a=0,o=ptr(n);return o.forEach(function(s,l){n.slice(1).forEach(function(u,h){a+=KI(n[(l+h)%t].slice(-2),e[h%t].slice(-2))}),r[l]=a,a=0}),i=r.indexOf(Math.min.apply(null,r)),o[i]}function ytr(n,e,t,r,i,a,o,s){return 3*((s-e)*(t+i)-(o-n)*(r+a)+r*(n-i)-t*(e-a)+s*(i+n/3)-o*(a+e/3))/20}function z$e(n){var e=0,t=0,r=0;return B$e(n).map(function(i){var a;switch(i[0]){case"M":return e=i[1],t=i[2],0;default:var o=i.slice(1),s=o[0],l=o[1],u=o[2],h=o[3],c=o[4],f=o[5];return r=ytr(e,t,s,l,u,h,c,f),a=i.slice(-2),e=a[0],t=a[1],r}}).reduce(function(i,a){return i+a},0)}function mtr(n){return z$e(n)>=0}function QB(n,e,t){return fV(n,e,ve(ve({},t),{bbox:!1,length:!0})).point}function _tr(n,e){var t=hV(n);if(typeof t=="string")throw TypeError(t);var r=t.slice(),i=SR(r),a=r.length-1,o=0,s=0,l=t[0],u=l.slice(-2),h=u[0],c=u[1],f={x:h,y:c};if(a<=0||!e||!Number.isFinite(e))return{segment:l,index:0,length:s,point:f,lengthAtSegment:o};if(e>=i)return r=t.slice(0,-1),o=SR(r),s=i-o,{segment:t[a],index:a,length:s,lengthAtSegment:o};for(var d=[];a>0;)l=r[a],r=r.slice(0,-1),o=SR(r),s=i-o,i=o,d.push({segment:l,index:a,length:s,lengthAtSegment:o}),a-=1;return d.find(function(v){var p=v.lengthAtSegment;return p<=e})}function xtr(n,e){for(var t=hV(n),r=cV(t),i=SR(t),a=function(S){var w=S.x-e.x,b=S.y-e.y;return w*w+b*b},o=8,s,l=0,u,h=0,c=1/0,f=0;f<=i;f+=o)s=QB(r,f),l=a(s),l.5;)p=h-o,d=QB(r,p),m=a(d),g=h+o,v=QB(r,g),y=a(v),p>=0&&m=f[m],d[m]-=v?1:0,v?y.ss:[y.s]}).flat()});return p[0].length===p[1].length?p:U$e(p[0],p[1],c)}var btr=1e-6;function uY(n){return Math.abs(n)0!=uY(s[1]-t)>0&&uY(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}var Jwe=function(n,e,t){return n>=e&&n<=t};function Ttr(n,e,t,r){var i=.001,a={x:t.x-n.x,y:t.y-n.y},o={x:e.x-n.x,y:e.y-n.y},s={x:r.x-t.x,y:r.y-t.y},l=o.x*s.y-o.y*s.x,u=l*l,h=o.x*o.x+o.y*o.y,c=s.x*s.x+s.y*s.y,f=null;if(u>i*h*c){var d=(a.x*s.y-a.y*s.x)/l,v=(a.x*o.y-a.y*o.x)/l;Jwe(d,0,1)&&Jwe(v,0,1)&&(f={x:n.x+d*o.x,y:n.y+d*o.y})}return f}function Qwe(n){for(var e=[],t=n.length,r=0;r1){var o=n[0],s=n[t-1];e.push({from:{x:s[0],y:s[1]},to:{x:o[0],y:o[1]}})}return e}function Ctr(n,e){var t=!1;return n.forEach(function(r){if(Ttr(r.from,r.to,e.from,e.to))return t=!0,!1}),t}function ebe(n){var e=n.map(function(r){return r[0]}),t=n.map(function(r){return r[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,t),maxY:Math.max.apply(null,t)}}function Atr(n,e){return!(e.minX>n.maxX||e.maxXn.maxY||e.maxY0;)c%2&&(f+=l[c+1]),c=c-1>>1,l[c]+=h.weight;u+=h.weight*f}}),u},ktr=function(n,e){for(var t=0,r=1;r<(e==null?void 0:e.length);r+=1)t+=Ntr(n,e[r-1],e[r]);return t};ele.default=ktr;var tle={};Object.defineProperty(tle,"__esModule",{value:!0});var Ftr=z_,Btr=function(n,e,t){var r=Gtr(n),i=new Ftr.Graph({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(a){return n.node(a)});return n.nodes().forEach(function(a){var o,s=n.node(a),l=n.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,l||r),(o=n[t](a))===null||o===void 0||o.forEach(function(u){var h=u.v===a?u.w:u.v,c=i.edgeFromArgs(h,a),f=c!==void 0?c.weight:0;i.setEdge(h,a,{weight:n.edge(u).weight+f})}),s.hasOwnProperty("minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i},Gtr=function(n){for(var e;n.hasNode(e="_root".concat(Math.random())););return e};tle.default=Btr;var rle={};Object.defineProperty(rle,"__esModule",{value:!0});var ztr=function(n,e,t){var r={},i;t==null||t.forEach(function(a){for(var o=n.parent(a),s,l;o;){if(s=n.parent(o),s?(l=r[s],r[s]=o):(l=i,i=o),l&&l!==o){e.setEdge(l,o);return}o=s}})};rle.default=ztr;var nle={},ile={};Object.defineProperty(ile,"__esModule",{value:!0});var Utr=function(n,e){return e.map(function(t){var r=n.inEdges(t);if(!(r!=null&&r.length))return{v:t};{var i={sum:0,weight:0};return r==null||r.forEach(function(a){var o=n.edge(a),s=n.node(a.v);i.sum+=o.weight*s.order,i.weight+=o.weight}),{v:t,barycenter:i.sum/i.weight,weight:i.weight}}})};ile.default=Utr;var ale={};Object.defineProperty(ale,"__esModule",{value:!0});var Vtr=function(n,e){var t,r,i,a={};n==null||n.forEach(function(s,l){a[s.v]={i:l,indegree:0,in:[],out:[],vs:[s.v]};var u=a[s.v];s.barycenter!==void 0&&(u.barycenter=s.barycenter,u.weight=s.weight)}),(t=e.edges())===null||t===void 0||t.forEach(function(s){var l=a[s.v],u=a[s.w];l!==void 0&&u!==void 0&&(u.indegree++,l.out.push(a[s.w]))});var o=(i=(r=Object.values(a)).filter)===null||i===void 0?void 0:i.call(r,function(s){return!s.indegree});return $tr(o)},$tr=function(n){for(var e,t,r=[],i=function(u){return function(h){h.merged||(h.barycenter===void 0||u.barycenter===void 0||h.barycenter>=u.barycenter)&&Wtr(u,h)}},a=function(u){return function(h){h.in.push(u),--h.indegree===0&&n.push(h)}},o=function(){var u=n.pop();r.push(u),(e=u.in.reverse())===null||e===void 0||e.forEach(function(h){return i(u)(h)}),(t=u.out)===null||t===void 0||t.forEach(function(h){return a(u)(h)})};n!=null&&n.length;)o();var s=r.filter(function(u){return!u.merged}),l=["vs","i","barycenter","weight"];return s.map(function(u){var h={};return l==null||l.forEach(function(c){u[c]!==void 0&&(h[c]=u[c])}),h})},Wtr=function(n,e){var t,r=0,i=0;n.weight&&(r+=n.barycenter*n.weight,i+=n.weight),e.weight&&(r+=e.barycenter*e.weight,i+=e.weight),n.vs=(t=e.vs)===null||t===void 0?void 0:t.concat(n.vs),n.barycenter=r/i,n.weight=i,n.i=Math.min(e.i,n.i),e.merged=!0};ale.default=Vtr;var ole={};Object.defineProperty(ole,"__esModule",{value:!0});var Htr=Nv,jtr=function(n,e,t,r){var i=(0,Htr.partition)(n,function(f){var d=f.hasOwnProperty("fixorder")&&!isNaN(f.fixorder);return r?!d&&f.hasOwnProperty("barycenter"):d||f.hasOwnProperty("barycenter")}),a=i.lhs,o=i.rhs.sort(function(f,d){return-f.i- -d.i}),s=[],l=0,u=0,h=0;a==null||a.sort(Xtr(!!e,!!t)),h=tbe(s,o,h),a==null||a.forEach(function(f){var d;h+=(d=f.vs)===null||d===void 0?void 0:d.length,s.push(f.vs),l+=f.barycenter*f.weight,u+=f.weight,h=tbe(s,o,h)});var c={vs:s.flat()};return u&&(c.barycenter=l/u,c.weight=u),c},tbe=function(n,e,t){for(var r=t,i;e.length&&(i=e[e.length-1]).i<=r;)e.pop(),n==null||n.push(i.vs),r++;return r},Xtr=function(n,e){return function(t,r){if(t.fixorder!==void 0&&r.fixorder!==void 0)return t.fixorder-r.fixorder;if(t.barycenterr.barycenter)return 1;if(e&&t.order!==void 0&&r.order!==void 0){if(t.orderr.order)return 1}return n?r.i-t.i:t.i-r.i}};ole.default=jtr;var sle=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(nle,"__esModule",{value:!0});var Ytr=sle(ile),qtr=sle(ale),Ztr=sle(ole),$$e=function(n,e,t,r,i,a){var o,s,l,u,h=n.children(e),c=n.node(e),f=c?c.borderLeft:void 0,d=c?c.borderRight:void 0,v={};f&&(h=h==null?void 0:h.filter(function(x){return x!==f&&x!==d}));var p=(0,Ytr.default)(n,h||[]);p==null||p.forEach(function(x){var S;if(!((S=n.children(x.v))===null||S===void 0)&&S.length){var w=$$e(n,x.v,t,r,a);v[x.v]=w,w.hasOwnProperty("barycenter")&&Jtr(x,w)}});var g=(0,qtr.default)(p,t);Ktr(g,v),(o=g.filter(function(x){return x.vs.length>0}))===null||o===void 0||o.forEach(function(x){var S=n.node(x.vs[0]);S&&(x.fixorder=S.fixorder,x.order=S.order)});var m=(0,Ztr.default)(g,r,i,a);if(f&&(m.vs=[f,m.vs,d].flat(),!((s=n.predecessors(f))===null||s===void 0)&&s.length)){var y=n.node(((l=n.predecessors(f))===null||l===void 0?void 0:l[0])||""),_=n.node(((u=n.predecessors(d))===null||u===void 0?void 0:u[0])||"");m.hasOwnProperty("barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+y.order+_.order)/(m.weight+2),m.weight+=2}return m},Ktr=function(n,e){n==null||n.forEach(function(t){var r,i=(r=t.vs)===null||r===void 0?void 0:r.map(function(a){return e[a]?e[a].vs:a});t.vs=i.flat()})},Jtr=function(n,e){n.barycenter!==void 0?(n.barycenter=(n.barycenter*n.weight+e.barycenter*e.weight)/(n.weight+e.weight),n.weight+=e.weight):(n.barycenter=e.barycenter,n.weight=e.weight)};nle.default=$$e;var rk=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Kse,"__esModule",{value:!0});var rbe=rk(Jse),nbe=rk(ele),Qtr=rk(tle),err=rk(rle),trr=rk(nle),ibe=Dl(),rrr=z_,hY=Nv,nrr=function(n,e){for(var t=(0,hY.maxRank)(n),r=[],i=[],a=1;a-1;a--)i.push(a);var o=abe(n,r,"inEdges"),s=abe(n,i,"outEdges"),l=(0,rbe.default)(n);cY(n,l);for(var u=Number.POSITIVE_INFINITY,h,a=0,c=0;c<4;++a,++c){obe(a%2?o:s,a%4>=2,!1,e),l=(0,hY.buildLayerMatrix)(n);var f=(0,nbe.default)(n,l);f=2,!0,e),l=(0,hY.buildLayerMatrix)(n);var f=(0,nbe.default)(n,l);fk)&&(0,n.addConflict)(w,V,W)}))}function E(A){return JSON.stringify(A.slice(1))}function T(A,M){var I=E(A);M.get(I)||(b.apply(void 0,A),M.set(I,!0))}var C=function(A,M){var I=-1,R,k=0,D=new Map;return M==null||M.forEach(function(G,W){var z;if(((z=x.node(G))===null||z===void 0?void 0:z.dummy)==="border"){var V=x.predecessors(G)||[];V.length&&(R=x.node(V[0]).order,T([M,k,W,I,R],D),k=W,I=R)}T([M,k,M.length,R,A.length],D)}),M};return S!=null&&S.length&&S.reduce(C),w};n.findType2Conflicts=s;var l=function(x,S){var w,b;if(!((w=x.node(S))===null||w===void 0)&&w.dummy)return(b=x.predecessors(S))===null||b===void 0?void 0:b.find(function(E){return x.node(E).dummy})};n.findOtherInnerSegmentNode=l;var u=function(x,S,w){var b=S,E=w;if(b>E){var T=b;b=E,E=T}var C=x[b];C||(x[b]=C={}),C[E]=!0};n.addConflict=u;var h=function(x,S,w){var b=S,E=w;if(b>E){var T=S;b=E,E=T}return!!x[b]};n.hasConflict=h;var c=function(x,S,w,b){var E={},T={},C={};return S==null||S.forEach(function(A){A==null||A.forEach(function(M,I){E[M]=M,T[M]=M,C[M]=I})}),S==null||S.forEach(function(A){var M=-1;A==null||A.forEach(function(I){var R=b(I);if(R.length){R=R.sort(function(z,V){return C[z]-C[V]});for(var k=(R.length-1)/2,D=Math.floor(k),G=Math.ceil(k);D<=G;++D){var W=R[D];T[I]===I&&MJ.x&&(k=J.x),D>J.y&&(D=J.y)}),_.edges().forEach(function(Oe){var J,We=_.edge(Oe);(J=We.points)===null||J===void 0||J.forEach(function(Tt){k>Tt.x&&(k=Tt.x),D>Tt.y&&(D=Tt.y)})}),R[0]=f[0]-k,R[1]=f[1]-D}var G=h==="LR"||h==="RL";if(d){var W=this,z=W.focusNode,V=W.ranksep,q=W.getRadialPos,Y=(0,Zd.isString)(z)?z:z==null?void 0:z.id,le=Y?(o=_.node(Y))===null||o===void 0?void 0:o._rank:0,j=[],Q=G?"y":"x",ie=G?"height":"width",oe=1/0,se=-1/0;_.nodes().forEach(function(Oe){var J=_.node(Oe);if(!!s.nodeMap[Oe]){var We=T(s.nodeMap[Oe]);if(le===0)j[J._rank]||(j[J._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),j[J._rank].nodes.push(Oe),j[J._rank].totalWidth+=We*2+J[ie],j[J._rank].maxSizese&&(se=mt)}});var me=V||50,Ce={},Le=(se-oe)/.9,re=[(oe+se-Le)*.5,(oe+se+Le)*.5],yt=function(Oe,J,We,Tt){We===void 0&&(We=-1/0),Tt===void 0&&(Tt=[0,1]);var Qe=We;return Oe.forEach(function(zt){var mt=_.node(zt);Ce[zt]=J;var wt=q(mt[Q],re,Le,J,Tt),pt=wt.x,ar=wt.y;if(!!s.nodeMap[zt]){s.nodeMap[zt].x=pt+R[0],s.nodeMap[zt].y=ar+R[1],s.nodeMap[zt]._order=mt._order;var kt=E(s.nodeMap[zt]);Qe=Qe})}:function(Oe,J,We){var Tt=Math.max(J.x,We.x),Qe=Math.min(J.x,We.x);return Oe.filter(function(zt){return zt.x<=Tt&&zt.x>=Qe})};_.edges().forEach(function(Oe){var J,We=_.edge(Oe),Tt=y.findIndex(function(mt){var wt=(0,Zd.getEdgeTerminal)(mt,"source"),pt=(0,Zd.getEdgeTerminal)(mt,"target");return wt===Oe.v&&pt===Oe.w});if(!(Tt<=-1)&&s.edgeLabelSpace&&s.controlPoints&&y[Tt].type!=="loop"){(J=We==null?void 0:We.points)===null||J===void 0||J.forEach(function(mt){mt.x+=R[0],mt.y+=R[1]});var Qe=s.nodeMap[Oe.v],zt=s.nodeMap[Oe.w];y[Tt].controlPoints=Hrr(We==null?void 0:We.points,Qe,zt,ur,G,Dt,ft)}})}return s.onLayoutEnd&&s.onLayoutEnd(),{nodes:l,edges:y}}},e.prototype.getRadialPos=function(t,r,i,a,o){o===void 0&&(o=[0,1]);var s=(t-r[0])/i;s=s*(o[1]-o[0])+o[0];var l=s*2*Math.PI;return{x:Math.cos(l)*a,y:Math.sin(l)*a}},e.prototype.getType=function(){return"dagre"},e}($rr.Base);qI.DagreLayout=Wrr;var Hrr=function(n,e,t,r,i,a,o){var s=(n==null?void 0:n.slice(1,n.length-1))||[];if(e&&t){var l=e.x,u=e.y,h=t.x,c=t.y;if(i&&(l=e.y,u=e.x,h=t.y,c=t.x),c!==u&&l!==h){var f=r.indexOf(u),d=r[f+1];if(d){var v=s[0],p=i?{x:(u+d)/2,y:(v==null?void 0:v.y)||h}:{x:(v==null?void 0:v.x)||h,y:(u+d)/2};(!v||a(v,p))&&s.unshift(p)}var g=r.indexOf(c),m=Math.abs(g-f);if(m===1)s=o(s,e,t),s.length||s.push(i?{x:(u+c)/2,y:l}:{x:l,y:(u+c)/2});else if(m>1){var y=r[g-1];if(y){var _=s[s.length-1],x=i?{x:(c+y)/2,y:(_==null?void 0:_.y)||h}:{x:(_==null?void 0:_.x)||l,y:(c+y)/2};(!_||a(_,x))&&s.push(x)}}}}return s},nk={};const R9={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function kee(n={},e=R9){var t,r,i,a;const o=JSON.parse(JSON.stringify(e)),s=((t=n==null?void 0:n.graph)===null||t===void 0?void 0:t.meta)||{},l=((r=n==null?void 0:n.subScene)===null||r===void 0?void 0:r.meta)||{},u=((i=n==null?void 0:n.nodeSize)===null||i===void 0?void 0:i.meta)||{},h=((a=n==null?void 0:n.nodeSize)===null||a===void 0?void 0:a.node)||{},c=o.nodeSize.bridge;return{graph:{meta:Object.assign(o.graph.meta,s)},subScene:{meta:Object.assign(o.subScene.meta,l)},nodeSize:{meta:Object.assign(o.nodeSize.meta,u),node:Object.assign(o.nodeSize.node,h),bridge:c}}}function H$e(n){return`\u25EC${n}\u25EC`}const DM=H$e("ROOT"),j$e=H$e("BRIDGE_GRAPH");var dd,l2,NM,Fee;(function(n){n[n.META=0]="META",n[n.NODE=1]="NODE",n[n.BRIDGE=2]="BRIDGE"})(dd||(dd={})),function(n){n[n.INCLUDE=0]="INCLUDE",n[n.EXCLUDE=1]="EXCLUDE",n[n.UNSPECIFIED=2]="UNSPECIFIED"}(l2||(l2={})),function(n){n[n.META=0]="META",n[n.CORE=1]="CORE",n[n.BRIDGE=2]="BRIDGE"}(NM||(NM={})),function(n){n[n.META=0]="META",n[n.OP=1]="OP",n[n.SERIES=2]="SERIES"}(Fee||(Fee={}));var D5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cle(n,e){return n(e={exports:{}},e.exports),e.exports}var jrr=function(){this.__data__=[],this.size=0},JI=function(n,e){return n===e||n!=n&&e!=e},dV=function(n,e){for(var t=n.length;t--;)if(JI(n[t][0],e))return t;return-1},Xrr=Array.prototype.splice,Yrr=function(n){var e=this.__data__,t=dV(e,n);return!(t<0)&&(t==e.length-1?e.pop():Xrr.call(e,t,1),--this.size,!0)},qrr=function(n){var e=this.__data__,t=dV(e,n);return t<0?void 0:e[t][1]},Zrr=function(n){return dV(this.__data__,n)>-1},Krr=function(n,e){var t=this.__data__,r=dV(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this};function jC(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e-1&&n%1==0&&n-1&&n%1==0&&n<=9007199254740991},Ys={};Ys["[object Float32Array]"]=Ys["[object Float64Array]"]=Ys["[object Int8Array]"]=Ys["[object Int16Array]"]=Ys["[object Int32Array]"]=Ys["[object Uint8Array]"]=Ys["[object Uint8ClampedArray]"]=Ys["[object Uint16Array]"]=Ys["[object Uint32Array]"]=!0,Ys["[object Arguments]"]=Ys["[object Array]"]=Ys["[object ArrayBuffer]"]=Ys["[object Boolean]"]=Ys["[object DataView]"]=Ys["[object Date]"]=Ys["[object Error]"]=Ys["[object Function]"]=Ys["[object Map]"]=Ys["[object Number]"]=Ys["[object Object]"]=Ys["[object RegExp]"]=Ys["[object Set]"]=Ys["[object String]"]=Ys["[object WeakMap]"]=!1;var Bnr=function(n){return S0(n)&&dle(n.length)&&!!Ys[Cw(n)]},xV=function(n){return function(e){return n(e)}},FM=cle(function(n,e){var t=e&&!e.nodeType&&e,r=t&&n&&!n.nodeType&&n,i=r&&r.exports===t&&X$e.process,a=function(){try{var o=r&&r.require&&r.require("util").types;return o||i&&i.binding&&i.binding("util")}catch{}}();n.exports=a}),_be=FM&&FM.isTypedArray,ok=_be?xV(_be):Bnr,Gnr=Object.prototype.hasOwnProperty,Z$e=function(n,e){var t=jl(n),r=!t&&kM(n),i=!t&&!r&&u2(n),a=!t&&!r&&!i&&ok(n),o=t||r||i||a,s=o?Rnr(n.length,String):[],l=s.length;for(var u in n)!e&&!Gnr.call(n,u)||o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||_V(u,l))||s.push(u);return s},znr=Object.prototype,SV=function(n){var e=n&&n.constructor;return n===(typeof e=="function"&&e.prototype||znr)},K$e=function(n,e){return function(t){return n(e(t))}},Unr=K$e(Object.keys,Object),Vnr=Object.prototype.hasOwnProperty,vle=function(n){if(!SV(n))return Unr(n);var e=[];for(var t in Object(n))Vnr.call(n,t)&&t!="constructor"&&e.push(t);return e},V_=function(n){return n!=null&&dle(n.length)&&!ik(n)},Aw=function(n){return V_(n)?Z$e(n):vle(n)},$nr=function(n,e){return n&&ak(e,Aw(e),n)},Wnr=function(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e},Hnr=Object.prototype.hasOwnProperty,jnr=function(n){if(!Cd(n))return Wnr(n);var e=SV(n),t=[];for(var r in n)(r!="constructor"||!e&&Hnr.call(n,r))&&t.push(r);return t},uT=function(n){return V_(n)?Z$e(n,!0):jnr(n)},Xnr=function(n,e){return n&&ak(e,uT(e),n)},J$e=cle(function(n,e){var t=e&&!e.nodeType&&e,r=t&&n&&!n.nodeType&&n,i=r&&r.exports===t?B0.Buffer:void 0,a=i?i.allocUnsafe:void 0;n.exports=function(o,s){if(s)return o.slice();var l=o.length,u=a?a(l):new o.constructor(l);return o.copy(u),u}}),Q$e=function(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++ts))return!1;var u=a.get(n),h=a.get(e);if(u&&h)return u==e&&h==n;var c=-1,f=!0,d=2&t?new cWe:void 0;for(a.set(n,e),a.set(e,n);++c0&&r(l)?t>1?n(l,t-1,r,i,a):gle(a,l):i||(a[a.length]=l)}return a},nar=function(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)},Rbe=Math.max,LWe=function(n,e,t){return e=Rbe(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,a=Rbe(r.length-e,0),o=Array(a);++i0){if(++e>=800)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}(iar),CV=function(n,e){return PWe(LWe(n,e,hT),n+"")},OWe=function(n,e,t,r){for(var i=n.length,a=t+(r?1:-1);r?a--:++a-1},har=function(n,e,t){for(var r=-1,i=n==null?0:n.length;++r=200){var u=e?null:far(n);if(u)return Sle(u);o=!1,i=fWe,l=new cWe}else l=e?[]:s;e:for(;++ra){var o=i;i=a,a=o}return i+""+a+""+(Hr.isUndefined(r)?"\0":r)}function yar(n,e,t,r){var i=""+e,a=""+t;if(!n&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function mY(n,e){return wO(n,e.v,e.w,e.name)}Xa.prototype._nodeCount=0,Xa.prototype._edgeCount=0,Xa.prototype.isDirected=function(){return this._isDirected},Xa.prototype.isMultigraph=function(){return this._isMultigraph},Xa.prototype.isCompound=function(){return this._isCompound},Xa.prototype.setGraph=function(n){return this._label=n,this},Xa.prototype.graph=function(){return this._label},Xa.prototype.setDefaultNodeLabel=function(n){return Hr.isFunction(n)||(n=Hr.constant(n)),this._defaultNodeLabelFn=n,this},Xa.prototype.nodeCount=function(){return this._nodeCount},Xa.prototype.nodes=function(){return Hr.keys(this._nodes)},Xa.prototype.sources=function(){var n=this;return Hr.filter(this.nodes(),function(e){return Hr.isEmpty(n._in[e])})},Xa.prototype.sinks=function(){var n=this;return Hr.filter(this.nodes(),function(e){return Hr.isEmpty(n._out[e])})},Xa.prototype.setNodes=function(n,e){var t=arguments,r=this;return Hr.each(n,function(i){t.length>1?r.setNode(i,e):r.setNode(i)}),this},Xa.prototype.setNode=function(n,e){return Hr.has(this._nodes,n)?(arguments.length>1&&(this._nodes[n]=e),this):(this._nodes[n]=arguments.length>1?e:this._defaultNodeLabelFn(n),this._isCompound&&(this._parent[n]="\0",this._children[n]={},this._children["\0"][n]=!0),this._in[n]={},this._preds[n]={},this._out[n]={},this._sucs[n]={},++this._nodeCount,this)},Xa.prototype.node=function(n){return this._nodes[n]},Xa.prototype.hasNode=function(n){return Hr.has(this._nodes,n)},Xa.prototype.removeNode=function(n){var e=this;if(Hr.has(this._nodes,n)){var t=function(r){e.removeEdge(e._edgeObjs[r])};delete this._nodes[n],this._isCompound&&(this._removeFromParentsChildList(n),delete this._parent[n],Hr.each(this.children(n),function(r){e.setParent(r)}),delete this._children[n]),Hr.each(Hr.keys(this._in[n]),t),delete this._in[n],delete this._preds[n],Hr.each(Hr.keys(this._out[n]),t),delete this._out[n],delete this._sucs[n],--this._nodeCount}return this},Xa.prototype.setParent=function(n,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Hr.isUndefined(e))e="\0";else{for(var t=e+="";!Hr.isUndefined(t);t=this.parent(t))if(t===n)throw new Error("Setting "+e+" as parent of "+n+" would create a cycle");this.setNode(e)}return this.setNode(n),this._removeFromParentsChildList(n),this._parent[n]=e,this._children[e][n]=!0,this},Xa.prototype._removeFromParentsChildList=function(n){delete this._children[this._parent[n]][n]},Xa.prototype.parent=function(n){if(this._isCompound){var e=this._parent[n];if(e!=="\0")return e}},Xa.prototype.children=function(n){if(Hr.isUndefined(n)&&(n="\0"),this._isCompound){var e=this._children[n];if(e)return Hr.keys(e)}else{if(n==="\0")return this.nodes();if(this.hasNode(n))return[]}},Xa.prototype.predecessors=function(n){var e=this._preds[n];if(e)return Hr.keys(e)},Xa.prototype.successors=function(n){var e=this._sucs[n];if(e)return Hr.keys(e)},Xa.prototype.neighbors=function(n){var e=this.predecessors(n);if(e)return Hr.union(e,this.successors(n))},Xa.prototype.isLeaf=function(n){return(this.isDirected()?this.successors(n):this.neighbors(n)).length===0},Xa.prototype.filterNodes=function(n){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var t=this;Hr.each(this._nodes,function(a,o){n(o)&&e.setNode(o,a)}),Hr.each(this._edgeObjs,function(a){e.hasNode(a.v)&&e.hasNode(a.w)&&e.setEdge(a,t.edge(a))});var r={};function i(a){var o=t.parent(a);return o===void 0||e.hasNode(o)?(r[a]=o,o):o in r?r[o]:i(o)}return this._isCompound&&Hr.each(e.nodes(),function(a){e.setParent(a,i(a))}),e},Xa.prototype.setDefaultEdgeLabel=function(n){return Hr.isFunction(n)||(n=Hr.constant(n)),this._defaultEdgeLabelFn=n,this},Xa.prototype.edgeCount=function(){return this._edgeCount},Xa.prototype.edges=function(){return Hr.values(this._edgeObjs)},Xa.prototype.setPath=function(n,e){var t=this,r=arguments;return Hr.reduce(n,function(i,a){return r.length>1?t.setEdge(i,a,e):t.setEdge(i,a),a}),this},Xa.prototype.setEdge=function(){var n,e,t,r,i=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(n=a.v,e=a.w,t=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(n=a,e=arguments[1],t=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),n=""+n,e=""+e,Hr.isUndefined(t)||(t=""+t);var o=wO(this._isDirected,n,e,t);if(Hr.has(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(!Hr.isUndefined(t)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(n),this.setNode(e),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(n,e,t);var s=yar(this._isDirected,n,e,t);return n=s.v,e=s.w,Object.freeze(s),this._edgeObjs[o]=s,Dbe(this._preds[e],n),Dbe(this._sucs[n],e),this._in[e][o]=s,this._out[n][o]=s,this._edgeCount++,this},Xa.prototype.edge=function(n,e,t){var r=arguments.length===1?mY(this._isDirected,arguments[0]):wO(this._isDirected,n,e,t);return this._edgeLabels[r]},Xa.prototype.hasEdge=function(n,e,t){var r=arguments.length===1?mY(this._isDirected,arguments[0]):wO(this._isDirected,n,e,t);return Hr.has(this._edgeLabels,r)},Xa.prototype.removeEdge=function(n,e,t){var r=arguments.length===1?mY(this._isDirected,arguments[0]):wO(this._isDirected,n,e,t),i=this._edgeObjs[r];return i&&(n=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],Nbe(this._preds[e],n),Nbe(this._sucs[n],e),delete this._in[e][r],delete this._out[n][r],this._edgeCount--),this},Xa.prototype.inEdges=function(n,e){var t=this._in[n];if(t){var r=Hr.values(t);return e?Hr.filter(r,function(i){return i.v===e}):r}},Xa.prototype.outEdges=function(n,e){var t=this._out[n];if(t){var r=Hr.values(t);return e?Hr.filter(r,function(i){return i.w===e}):r}},Xa.prototype.nodeEdges=function(n,e){var t=this.inEdges(n,e);if(t)return t.concat(this.outEdges(n,e))};var kbe={Graph:Tle,version:"2.1.8"},mar={write:function(n){var e={options:{directed:n.isDirected(),multigraph:n.isMultigraph(),compound:n.isCompound()},nodes:_ar(n),edges:xar(n)};return Hr.isUndefined(n.graph())||(e.value=Hr.clone(n.graph())),e},read:function(n){var e=new Tle(n.options).setGraph(n.value);return Hr.each(n.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),Hr.each(n.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}};function _ar(n){return Hr.map(n.nodes(),function(e){var t=n.node(e),r=n.parent(e),i={v:e};return Hr.isUndefined(t)||(i.value=t),Hr.isUndefined(r)||(i.parent=r),i})}function xar(n){return Hr.map(n.edges(),function(e){var t=n.edge(e),r={v:e.v,w:e.w};return Hr.isUndefined(e.name)||(r.name=e.name),Hr.isUndefined(t)||(r.value=t),r})}var Sar=function(n){var e,t={},r=[];function i(a){Hr.has(t,a)||(t[a]=!0,e.push(a),Hr.each(n.successors(a),i),Hr.each(n.predecessors(a),i))}return Hr.each(n.nodes(),function(a){e=[],i(a),e.length&&r.push(e)}),r},NWe=np;function np(){this._arr=[],this._keyIndices={}}np.prototype.size=function(){return this._arr.length},np.prototype.keys=function(){return this._arr.map(function(n){return n.key})},np.prototype.has=function(n){return Hr.has(this._keyIndices,n)},np.prototype.priority=function(n){var e=this._keyIndices[n];if(e!==void 0)return this._arr[e].priority},np.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},np.prototype.add=function(n,e){var t=this._keyIndices;if(n=String(n),!Hr.has(t,n)){var r=this._arr,i=r.length;return t[n]=i,r.push({key:n,priority:e}),this._decrease(i),!0}return!1},np.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},np.prototype.decrease=function(n,e){var t=this._keyIndices[n];if(e>this._arr[t].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[t].priority+" New: "+e);this._arr[t].priority=e,this._decrease(t)},np.prototype._heapify=function(n){var e=this._arr,t=2*n,r=t+1,i=n;t>1].priority0&&(l=c.removeMin(),(u=h[l]).distance!==Number.POSITIVE_INFINITY);)s(l).forEach(f);return h}(n,String(e),t||war,r||function(i){return n.outEdges(i)})},war=Hr.constant(1),bar=function(n,e,t){return Hr.transform(n.nodes(),function(r,i){r[i]=kWe(n,i,e,t)},{})},FWe=function(n){var e=0,t=[],r={},i=[];function a(o){var s=r[o]={onStack:!0,lowlink:e,index:e++};if(t.push(o),n.successors(o).forEach(function(h){Hr.has(r,h)?r[h].onStack&&(s.lowlink=Math.min(s.lowlink,r[h].index)):(a(h),s.lowlink=Math.min(s.lowlink,r[h].lowlink))}),s.lowlink===s.index){var l,u=[];do l=t.pop(),r[l].onStack=!1,u.push(l);while(o!==l);i.push(u)}}return n.nodes().forEach(function(o){Hr.has(r,o)||a(o)}),i},Ear=function(n){return Hr.filter(FWe(n),function(e){return e.length>1||e.length===1&&n.hasEdge(e[0],e[0])})},Tar=function(n,e,t){return function(r,i,a){var o={},s=r.nodes();return s.forEach(function(l){o[l]={},o[l][l]={distance:0},s.forEach(function(u){l!==u&&(o[l][u]={distance:Number.POSITIVE_INFINITY})}),a(l).forEach(function(u){var h=u.v===l?u.w:u.v,c=i(u);o[l][h]={distance:c,predecessor:l}})}),s.forEach(function(l){var u=o[l];s.forEach(function(h){var c=o[h];s.forEach(function(f){var d=c[l],v=u[f],p=c[f],g=d.distance+v.distance;g0;){if(t=a.removeMin(),Hr.has(i,t))r.setEdge(t,i[t]);else{if(s)throw new Error("Input graph is not connected: "+n);s=!0}n.nodeEdges(t).forEach(o)}return r},tarjan:FWe,topsort:_Y},version:kbe.version};try{B9=Aar}catch{}B9||(B9=window.graphlib);var G0=B9,Mar=function(n){return sWe(n,5)},tN=function(n,e,t){if(!Cd(t))return!1;var r=typeof e;return!!(r=="number"?V_(t)&&_V(e,t.length):r=="string"&&e in t)&&JI(t[e],n)},zWe=Object.prototype,Iar=zWe.hasOwnProperty,Lar=CV(function(n,e){n=Object(n);var t=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&tN(e[0],e[1],i)&&(r=1);++t-1?i[a?e[o]:o]:void 0}},Oar=/^\s+|\s+$/g,Rar=/^[-+]0x[0-9a-f]+$/i,Dar=/^0b[01]+$/i,Nar=/^0o[0-7]+$/i,kar=parseInt,Far=function(n){if(typeof n=="number")return n;if(c2(n))return NaN;if(Cd(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Cd(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(Oar,"");var t=Dar.test(n);return t||Nar.test(n)?kar(n.slice(2),t?2:8):Rar.test(n)?NaN:+n},t8=function(n){return n?(n=Far(n))===1/0||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:n===0?n:0},Bar=function(n){var e=t8(n),t=e%1;return e==e?t?e-t:e:0},Gar=Math.max,zar=Par(function(n,e,t){var r=n==null?0:n.length;if(!r)return-1;var i=t==null?0:Bar(t);return i<0&&(i=Gar(r+i,0)),OWe(n,$_(e),i)}),UWe=function(n){return n!=null&&n.length?Ele(n,1):[]},Uar=function(n,e){return n==null?n:_le(n,lWe(e),uT)},Var=function(n){var e=n==null?0:n.length;return e?n[e-1]:void 0},$ar=function(n,e){var t={};return e=$_(e),xle(n,function(r,i,a){yV(t,i,e(r,i,a))}),t},Cle=function(n,e,t){for(var r=-1,i=n.length;++re},Har=function(n){return n&&n.length?Cle(n,hT,War):void 0},Wee=function(n,e,t){(t!==void 0&&!JI(n[e],t)||t===void 0&&!(e in n))&&yV(n,e,t)},jar=Function.prototype,Xar=Object.prototype,VWe=jar.toString,Yar=Xar.hasOwnProperty,qar=VWe.call(Object),Zar=function(n){if(!S0(n)||Cw(n)!="[object Object]")return!1;var e=wV(n);if(e===null)return!0;var t=Yar.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&VWe.call(t)==qar},Hee=function(n,e){if((e!=="constructor"||typeof n[e]!="function")&&e!="__proto__")return n[e]},Kar=function(n){return ak(n,uT(n))},Jar=function(n,e,t,r,i,a,o){var s=Hee(n,t),l=Hee(e,t),u=o.get(l);if(u)Wee(n,t,u);else{var h=a?a(s,l,t+"",n,e,o):void 0,c=h===void 0;if(c){var f=jl(l),d=!f&&u2(l),v=!f&&!d&&ok(l);h=l,f||d||v?jl(s)?h=s:RWe(s)?h=Q$e(s):d?(c=!1,h=J$e(l,!0)):v?(c=!1,h=iWe(l,!0)):h=[]:Zar(l)||kM(l)?(h=s,kM(s)?h=Kar(s):Cd(s)&&!ik(s)||(h=oWe(l))):c=!1}c&&(o.set(l,h),i(h,l,r,a,o),o.delete(l)),Wee(n,t,h)}},Qar=function n(e,t,r,i,a){e!==t&&_le(t,function(o,s){if(a||(a=new XA),Cd(o))Jar(e,t,s,r,n,i,a);else{var l=i?i(Hee(e,s),o,s+"",e,t,a):void 0;l===void 0&&(l=o),Wee(e,s,l)}},uT)},eor=function(n){return CV(function(e,t){var r=-1,i=t.length,a=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(a=n.length>3&&typeof a=="function"?(i--,a):void 0,o&&tN(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++re||a&&o&&l&&!s&&!u||r&&o&&l||!t&&l||!i)return 1;if(!r&&!a&&!u&&n=s?l:l*(t[r]=="desc"?-1:1)}return n.index-e.index},gor=function(n,e,t){e=e.length?qA(e,function(a){return jl(a)?function(o){return TV(o,a.length===1?a[0]:a)}:a}):[hT];var r=-1;e=qA(e,xV($_));var i=EWe(n,function(a,o,s){return{criteria:qA(e,function(l){return l(a)}),index:++r,value:a}});return dor(i,function(a,o){return por(a,o,t)})},yor=CV(function(n,e){if(n==null)return[];var t=e.length;return t>1&&tN(n,e[0],e[1])?e=[]:t>2&&tN(e[0],e[1],e[2])&&(e=[e[0]]),gor(n,Ele(e,1),[])}),mor=0,_or=function(n){var e=++mor;return yWe(n)+e},xor=function(n,e,t){for(var r=-1,i=n.length,a=e.length,o={};++r0;--c)if(s=a[c].dequeue()){l=l.concat(xY(i,a,o,s,!0));break}}}return l}(t.graph,t.buckets,t.zeroIdx);return ke.flatten(ke.map(r,function(i){return n.outEdges(i.v,i.w)}),!0)},Cor=ke.constant(1);function xY(n,e,t,r,i){var a=i?[]:void 0;return ke.forEach(n.inEdges(r.v),function(o){var s=n.edge(o),l=n.node(o.v);i&&a.push({v:o.v,w:o.w}),l.out-=s,jee(e,t,l)}),ke.forEach(n.outEdges(r.v),function(o){var s=n.edge(o),l=o.w,u=n.node(l);u.in-=s,jee(e,t,u)}),n.removeNode(r.v),a}function jee(n,e,t){t.out?t.in?n[t.out-t.in+e].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}var Gbe={run:function(n){var e=n.graph().acyclicer==="greedy"?Tor(n,function(t){return function(r){return t.edge(r).weight}}(n)):function(t){var r=[],i={},a={};function o(s){ke.has(a,s)||(a[s]=!0,i[s]=!0,ke.forEach(t.outEdges(s),function(l){ke.has(i,l.w)?r.push(l):o(l.w)}),delete i[s])}return ke.forEach(t.nodes(),o),r}(n);ke.forEach(e,function(t){var r=n.edge(t);n.removeEdge(t),r.forwardName=t.name,r.reversed=!0,n.setEdge(t.w,t.v,r,ke.uniqueId("rev"))})},undo:function(n){ke.forEach(n.edges(),function(e){var t=n.edge(e);if(t.reversed){n.removeEdge(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}})}},zbe=G0.Graph,Hh={addDummyNode:Ube,simplify:function(n){var e=new zbe().setGraph(n.graph());return ke.forEach(n.nodes(),function(t){e.setNode(t,n.node(t))}),ke.forEach(n.edges(),function(t){var r=e.edge(t.v,t.w)||{weight:0,minlen:1},i=n.edge(t);e.setEdge(t.v,t.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e},asNonCompoundGraph:function(n){var e=new zbe({multigraph:n.isMultigraph()}).setGraph(n.graph());return ke.forEach(n.nodes(),function(t){n.children(t).length||e.setNode(t,n.node(t))}),ke.forEach(n.edges(),function(t){e.setEdge(t,n.edge(t))}),e},successorWeights:function(n){var e=ke.map(n.nodes(),function(t){var r={};return ke.forEach(n.outEdges(t),function(i){r[i.w]=(r[i.w]||0)+n.edge(i).weight}),r});return ke.zipObject(n.nodes(),e)},predecessorWeights:function(n){var e=ke.map(n.nodes(),function(t){var r={};return ke.forEach(n.inEdges(t),function(i){r[i.v]=(r[i.v]||0)+n.edge(i).weight}),r});return ke.zipObject(n.nodes(),e)},intersectRect:function(n,e){var t,r,i=n.x,a=n.y,o=e.x-i,s=e.y-a,l=n.width/2,u=n.height/2;if(!o&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(o)*u?(s<0&&(u=-u),t=u*o/s,r=u):(o<0&&(l=-l),t=l,r=l*s/o),{x:i+t,y:a+r}},buildLayerMatrix:function(n){var e=ke.map(ke.range(Vbe(n)+1),function(){return[]});return ke.forEach(n.nodes(),function(t){var r=n.node(t),i=r.rank;ke.isUndefined(i)||(e[i][r.order]=t)}),e},normalizeRanks:function(n){var e=ke.min(ke.map(n.nodes(),function(t){return n.node(t).rank}));ke.forEach(n.nodes(),function(t){var r=n.node(t);ke.has(r,"rank")&&(r.rank-=e)})},removeEmptyRanks:function(n){var e=ke.min(ke.map(n.nodes(),function(a){return n.node(a).rank})),t=[];ke.forEach(n.nodes(),function(a){var o=n.node(a).rank-e;t[o]||(t[o]=[]),t[o].push(a)});var r=0,i=n.graph().nodeRankFactor;ke.forEach(t,function(a,o){ke.isUndefined(a)&&o%i!=0?--r:r&&ke.forEach(a,function(s){n.node(s).rank+=r})})},addBorderNode:function(n,e,t,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=t,i.order=r),Ube(n,"border",i,e)},maxRank:Vbe,partition:function(n,e){var t={lhs:[],rhs:[]};return ke.forEach(n,function(r){e(r)?t.lhs.push(r):t.rhs.push(r)}),t},time:function(n,e){var t=ke.now();try{return e()}finally{console.log(n+" time: "+(ke.now()-t)+"ms")}},notime:function(n,e){return e()}};function Ube(n,e,t,r){var i;do i=ke.uniqueId(r);while(n.hasNode(i));return t.dummy=e,n.setNode(i,t),i}function Vbe(n){return ke.max(ke.map(n.nodes(),function(e){var t=n.node(e).rank;if(!ke.isUndefined(t))return t}))}var $be={run:function(n){n.graph().dummyChains=[],ke.forEach(n.edges(),function(e){(function(t,r){var i,a,o,s=r.v,l=t.node(s).rank,u=r.w,h=t.node(u).rank,c=r.name,f=t.edge(r),d=f.labelRank;if(h!==l+1){for(t.removeEdge(r),o=0,++l;lo.lim&&(s=o,l=!0);var u=ke.filter(e.edges(),function(h){return l===Wbe(n,n.node(h.v),s)&&l!==Wbe(n,n.node(h.w),s)});return ke.minBy(u,function(h){return Por(e,h)})}function KWe(n,e,t,r){var i=t.v,a=t.w;n.removeEdge(i,a),n.setEdge(r.v,r.w,{}),Mle(n),Ale(n,e),function(o,s){var l=ke.find(o.nodes(),function(h){return!s.node(h).parent}),u=Ror(o,l);u=u.slice(1),ke.forEach(u,function(h){var c=o.node(h).parent,f=s.edge(h,c),d=!1;f||(f=s.edge(c,h),d=!0),s.node(h).rank=s.node(c).rank+(d?f.minlen:-f.minlen)})}(n,e)}function Wbe(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}zb.initLowLimValues=Mle,zb.initCutValues=Ale,zb.calcCutValue=XWe,zb.leaveEdge=qWe,zb.enterEdge=ZWe,zb.exchangeEdges=KWe;var JWe=WWe,For=function(n){switch(n.graph().ranker){case"network-simplex":Hbe(n);break;case"tight-tree":(function(e){JWe(e),jWe(e)})(n);break;case"longest-path":Bor(n);break;default:Hbe(n)}},Bor=JWe;function Hbe(n){kor(n)}var Gor=function(n){var e=function(t){var r={},i=0;function a(o){var s=i;ke.forEach(t.children(o),a),r[o]={low:s,lim:i++}}return ke.forEach(t.children(),a),r}(n);ke.forEach(n.graph().dummyChains,function(t){for(var r=n.node(t),i=r.edgeObj,a=function(c,f,d,v){var p,g,m=[],y=[],_=Math.min(f[d].low,f[v].low),x=Math.max(f[d].lim,f[v].lim);p=d;do p=c.parent(p),m.push(p);while(p&&(f[p].low>_||x>f[p].lim));for(g=p,p=v;(p=c.parent(p))!==g;)y.push(p);return{path:m.concat(y.reverse()),lca:g}}(n,e,i.v,i.w),o=a.path,s=a.lca,l=0,u=o[l],h=!0;t!==i.w;){if(r=n.node(t),h){for(;(u=o[l])!==s&&n.node(u).maxRank0;)h%2&&(c+=s[h+1]),s[h=h-1>>1]+=u.weight;l+=u.weight*c})),l}var Wor=function(n,e){return ke.map(e,function(t){var r=n.inEdges(t);if(r.length){var i=ke.reduce(r,function(a,o){var s=n.edge(o),l=n.node(o.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}})},Hor=function(n,e){var t={};return ke.forEach(n,function(r,i){var a=t[r.v]={indegree:0,in:[],out:[],vs:[r.v],i};ke.isUndefined(r.barycenter)||(a.barycenter=r.barycenter,a.weight=r.weight)}),ke.forEach(e.edges(),function(r){var i=t[r.v],a=t[r.w];ke.isUndefined(i)||ke.isUndefined(a)||(a.indegree++,i.out.push(t[r.w]))}),function(r){var i=[];function a(l){return function(u){u.merged||(ke.isUndefined(u.barycenter)||ke.isUndefined(l.barycenter)||u.barycenter>=l.barycenter)&&function(h,c){var f=0,d=0;h.weight&&(f+=h.barycenter*h.weight,d+=h.weight),c.weight&&(f+=c.barycenter*c.weight,d+=c.weight),h.vs=c.vs.concat(h.vs),h.barycenter=f/d,h.weight=d,h.i=Math.min(c.i,h.i),c.merged=!0}(l,u)}}function o(l){return function(u){u.in.push(l),--u.indegree==0&&r.push(u)}}for(;r.length;){var s=r.pop();i.push(s),ke.forEach(s.in.reverse(),a(s)),ke.forEach(s.out,o(s))}return ke.map(ke.filter(i,function(l){return!l.merged}),function(l){return ke.pick(l,["vs","i","barycenter","weight"])})}(ke.filter(t,function(r){return!r.indegree}))},jor=function(n,e){var t=Hh.partition(n,function(c){return ke.has(c,"barycenter")}),r=t.lhs,i=ke.sortBy(t.rhs,function(c){return-c.i}),a=[],o=0,s=0,l=0;r.sort((u=!!e,function(c,f){return c.barycenterf.barycenter?1:u?f.i-c.i:c.i-f.i})),l=Kbe(a,i,l),ke.forEach(r,function(c){l+=c.vs.length,a.push(c.vs),o+=c.barycenter*c.weight,s+=c.weight,l=Kbe(a,i,l)});var u,h={vs:ke.flatten(a,!0)};return s&&(h.barycenter=o/s,h.weight=s),h};function Kbe(n,e,t){for(var r;e.length&&(r=ke.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}var Xor=function n(e,t,r,i){var a=e.children(t),o=e.node(t),s=o?o.borderLeft:void 0,l=o?o.borderRight:void 0,u={};s&&(a=ke.filter(a,function(p){return p!==s&&p!==l}));var h=Wor(e,a);ke.forEach(h,function(p){if(e.children(p.v).length){var g=n(e,p.v,r,i);u[p.v]=g,ke.has(g,"barycenter")&&(m=p,y=g,ke.isUndefined(m.barycenter)?(m.barycenter=y.barycenter,m.weight=y.weight):(m.barycenter=(m.barycenter*m.weight+y.barycenter*y.weight)/(m.weight+y.weight),m.weight+=y.weight))}var m,y});var c=Hor(h,r);(function(p,g){ke.forEach(p,function(m){m.vs=ke.flatten(m.vs.map(function(y){return g[y]?g[y].vs:y}),!0)})})(c,u);var f=jor(c,i);if(s&&(f.vs=ke.flatten([s,f.vs,l],!0),e.predecessors(s).length)){var d=e.node(e.predecessors(s)[0]),v=e.node(e.predecessors(l)[0]);ke.has(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+d.order+v.order)/(f.weight+2),f.weight+=2}return f},Yor=G0.Graph,qor=function(n,e,t){var r=function(a){for(var o;a.hasNode(o=ke.uniqueId("_root")););return o}(n),i=new Yor({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(a){return n.node(a)});return ke.forEach(n.nodes(),function(a){var o=n.node(a),s=n.parent(a);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),ke.forEach(n[t](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),c=ke.isUndefined(h)?0:h.weight;i.setEdge(u,a,{weight:n.edge(l).weight+c})}),ke.has(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i},Zor=function(n,e,t){var r,i={};ke.forEach(t,function(a){for(var o,s,l=n.parent(a);l;){if((o=n.parent(l))?(s=i[o],i[o]=l):(s=r,r=l),s&&s!==l)return void e.setEdge(s,l);l=o}})},Kor=G0.Graph,Jor=function(n){var e=Hh.maxRank(n),t=Jbe(n,ke.range(1,e+1),"inEdges"),r=Jbe(n,ke.range(e-1,-1,-1),"outEdges"),i=Uor(n);Qbe(n,i);for(var a,o=Number.POSITIVE_INFINITY,s=0,l=0;l<4;++s,++l){Qor(s%2?t:r,s%4>=2),i=Hh.buildLayerMatrix(n);var u=Vor(n,i);ul)&&eHe(t,c,u)})})}return ke.reduce(e,function(i,a){var o,s=-1,l=0;return ke.forEach(a,function(u,h){if(n.node(u).dummy==="border"){var c=n.predecessors(u);c.length&&(o=n.node(c[0]).order,r(a,l,h,s,o),l=h,s=o)}r(a,l,a.length,o,i.length)}),a}),t}function eHe(n,e,t){if(e>t){var r=e;e=t,t=r}var i=n[e];i||(n[e]=i={}),i[t]=!0}function isr(n,e,t){if(e>t){var r=e;e=t,t=r}return ke.has(n[e],t)}function asr(n,e,t,r){var i={},a={},o={};return ke.forEach(e,function(s){ke.forEach(s,function(l,u){i[l]=l,a[l]=l,o[l]=u})}),ke.forEach(e,function(s){var l=-1;ke.forEach(s,function(u){var h=r(u);if(h.length)for(var c=((h=ke.sortBy(h,function(p){return o[p]})).length-1)/2,f=Math.floor(c),d=Math.ceil(c);f<=d;++f){var v=h[f];a[u]===u&&lnew Asr(t)).forEach(t=>{e.nodes[t.name]=t,t.inputs.forEach(r=>{(function(i,a,o){o.name!==a.name&&i.edges.push(Object.assign(Object.assign({},o.attr),{v:o.name,w:a.name}))})(e,t,r)})}),e}class Lsr{constructor(e,t={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=l2.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=dd.META,this.path=[],this.name=e,this.metaGraph=Ile(e,NM.META,t)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map(e=>this.metaGraph.node(e))}leaves(){let e,t=[],r=[this];for(;r.length;){let i=r.shift();i.isGroupNode?(e=i.metaGraph,e.nodes().forEach(a=>r.push(e.node(a)))):t.push(i.name)}return t}}class Psr{constructor(e,t){this.v=e,this.w=t,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(e,t){this.baseEdgeList.push(e)}}function rHe(n,e={}){return new Lsr(n,e)}function nHe(n,e){return new Psr(n,e)}function Ile(n,e,t){const r=t||{},i=new Tsr.Graph(r);return i.setGraph({name:n,rankdir:r.rankdir,type:e,align:r.align}),i}class Osr{constructor(e={}){this.graphOptions=e,this.index={},this.graphOptions.compound=!0,this.root=rHe(DM,this.graphOptions),this.index[DM]=this.root}getNodeMap(){return this.index}node(e){return this.index[e]}setNode(e,t){this.index[e]=t}getBridgeGraph(e){const t=this.index[e];if(!t)throw Error("Could not find node in hierarchy: "+e);if(!("metaGraph"in t))return null;const r=t;if(r.bridgeGraph)return r.bridgeGraph;const i=Ile(j$e,NM.BRIDGE,this.graphOptions);if(r.bridgeGraph=i,!t.parentNode||!("metaGraph"in t.parentNode))return i;const a=t.parentNode;return[a.metaGraph,this.getBridgeGraph(a.name)].forEach(o=>{o.edges().filter(s=>s.v===e||s.w===e).forEach(s=>{const l=s.w===e;o.edge(s).baseEdgeList.forEach(u=>{const[h,c]=l?[u.w,s.v]:[u.v,s.w],f=this.getChildName(e,h),d={v:l?c:f,w:l?f:c};let v=i.edge(d);v||(v=nHe(d.v,d.w),v.inbound=l,i.setEdge(d.v,d.w,v)),v.addBaseEdge(u,this)})})}),i}getChildName(e,t){let r=this.index[t];for(;r;){if(r.parentNode&&r.parentNode.name===e)return r.name;r=r.parentNode}throw Error("Could not find immediate child for descendant: "+t)}getPredecessors(e){const t=this.index[e];if(!t)throw Error("Could not find node with name: "+e);return this.getOneWayEdges(t,!0)}getSuccessors(e){const t=this.index[e];if(!t)throw Error("Could not find node with name: "+e);return this.getOneWayEdges(t,!1)}getOneWayEdges(e,t){const r=[];if(!e.parentNode||!e.parentNode.isGroupNode)return r;const i=e.parentNode,a=i.metaGraph,o=this.getBridgeGraph(i.name);return eEe(a,e,t,r),eEe(o,e,t,r),r}}function Rsr(n,e){const{rankDirection:t,align:r}=e,i=new Osr({rankdir:t,align:r});return function(a,o){Object.keys(o.nodes).forEach(s=>{const l=o.nodes[s],u=l.path;let h=a.root;h.depth=Math.max(u.length,h.depth);for(let c=0;c{let d=0;for(;c;)f[d++]=c.name,c=c.parentNode;return d-1};o.edges.forEach(c=>{l=[],u=[];let f=h(o.nodes[c.v],l),d=h(o.nodes[c.w],u);for(;l[f]===u[d];)if(f--,d--,f<0||d<0)throw Error("No difference found between ancestor paths.");const v=s[l[f+1]],p=l[f],g=u[d];let m=v.metaGraph.edge(p,g);m||(m=nHe(p,g),v.metaGraph.setEdge(p,g,m)),m.addBaseEdge(c,a)})}(i,n),i}function eEe(n,e,t,r){(t?n.inEdges(e.name):n.outEdges(e.name)).forEach(i=>{const a=n.edge(i);r.push(a)})}class Dsr{constructor(e){this.hierarchy=e,this.index={},this.hasSubHierarchy={},this.root=new rEe(this.hierarchy.root,this.hierarchy.graphOptions),this.index[e.root.name]=this.root,this.buildSubHierarchy(e.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(e){if(e in this.hasSubHierarchy)return;this.hasSubHierarchy[e]=!0;const t=this.index[e];if(t.node.type!==dd.META)return;const r=t,i=r.node.metaGraph,a=r.coreGraph;i.nodes().forEach(h=>{const c=this.getOrCreateRenderNodeByName(h);a.setNode(h,c)}),i.edges().forEach(h=>{const c=i.edge(h),f=new tEe(c);a.setEdge(h.v,h.w,f)});const o=r.node.parentNode;if(!o)return;const s=this.getRenderNodeByName(o.name),l=(h,...c)=>c.concat([h?"IN":"OUT"]).join("~~"),u=this.hierarchy.getBridgeGraph(e);u.edges().forEach(h=>{const c=u.edge(h),f=!!i.node(h.w),[d,v]=f?[h.w,h.v]:[h.v,h.w],p=S=>{const w=f?{v:S,w:e}:{v:e,w:S};return s.coreGraph.edge(w)};let g=p(v);g||(g=p(l(f,v,o.name)));const m=l(f,e),y=l(f,v,e);let _=a.node(y);if(!_){let S=a.node(m);if(!S){const b={name:m,type:dd.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:l2.UNSPECIFIED,inbound:f,attr:{}};S=new n8(b),this.index[m]=S,a.setNode(m,S)}const w={name:y,type:dd.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:l2.UNSPECIFIED,inbound:f,attr:{}};_=new n8(w),this.index[y]=_,a.setNode(y,_),a.setParent(y,m),S.node.cardinality++}const x=new tEe(c);x.adjoiningMetaEdge=g,f?a.setEdge(y,d,x):a.setEdge(d,y,x)})}getOrCreateRenderNodeByName(e){if(!e)return null;if(e in this.index)return this.index[e];const t=this.getNodeByName(e);return t?(this.index[e]=t.isGroupNode?new rEe(t,this.hierarchy.graphOptions):new n8(t),this.index[e]):null}getRenderNodeByName(e){return this.index[e]}getNodeByName(e){return this.hierarchy.node(e)}}class n8{constructor(e){this.node=e,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=e.width||0,this.height=e.height||0,this.displayName=e.name,this.attr=e.attr}}class tEe{constructor(e){this.metaEdge=e,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class rEe extends n8{constructor(e,t){super(e);const r=e.metaGraph.graph();t.compound=!0,this.coreGraph=Ile(r.name,NM.CORE,t)}}function iHe(n,e){n.node.isGroupNode&&function(t,r){const i=kee(r);t.coreGraph.nodes().map(a=>t.coreGraph.node(a)).forEach(a=>{var o,s,l,u,h,c;const{height:f,width:d}=a;switch(a.node.type){case dd.NODE:Object.assign(a,i.nodeSize.node),a.height=f||i.nodeSize.node.height,a.width=d||i.nodeSize.node.width;break;case dd.BRIDGE:Object.assign(a,i.nodeSize.bridge);break;case dd.META:a.expanded?iHe(a,r):(Object.assign(a,i.nodeSize.meta),a.height=i.nodeSize.meta.height,a.width=i.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+a.node.type)}if(!a.expanded){const v=a.attr;(function(p,g=!1){if(p.coreBox.width=p.width,p.coreBox.height=p.height,!g){const m=`${p.displayName}`.length,y=3;p.width=Math.max(p.coreBox.width,m*y)}})(a,r&&(a.node.type===0&&!!(!((s=(o=r==null?void 0:r.nodeSize)===null||o===void 0?void 0:o.meta)===null||s===void 0)&&s.width)||a.node.type===1&&(!!(!((u=(l=r==null?void 0:r.nodeSize)===null||l===void 0?void 0:l.node)===null||u===void 0)&&u.width)||!!v.width)||a.node.type===2&&!!(!((c=(h=r==null?void 0:r.nodeSize)===null||h===void 0?void 0:h.bridge)===null||c===void 0)&&c.width)))}})}(n,e),n.node.type===dd.META&&function(t,r){const i=kee(r),a=i.subScene.meta;Object.assign(t,a);const{nodeSep:o,rankSep:s,edgeSep:l,align:u}=i.graph.meta,h={nodesep:o,ranksep:s,edgesep:l,align:u};Object.assign(t.coreBox,function(d,v){const{ranksep:p,nodesep:g,edgesep:m,align:y}=v;Object.assign(d.graph(),{ranksep:p,nodesep:g,edgesep:m,align:y});const _=[];if(d.nodes().forEach(E=>{d.node(E).node.type!==dd.BRIDGE&&_.push(E)}),!_.length)return{width:0,height:0};Csr(d);let x=1/0,S=1/0,w=-1/0,b=-1/0;return _.forEach(E=>{const T=d.node(E),C=.5*T.width,A=T.x-C,M=T.x+C;x=Aw?M:w;const I=.5*T.height,R=T.y-I,k=T.y+I;S=Rb?k:b}),d.edges().forEach(E=>{const T=d.edge(E),C=d.node(T.metaEdge.v),A=d.node(T.metaEdge.w);if(T.points.length===3&&function(R){let k=nEe(R[0],R[1]);for(let D=1;D1)return!1;k=G}return!0}(T.points)){if(C!=null){const R=C.expanded?C.x:Xee(C);T.points[0].x=R}if(A!=null){const R=A.expanded?A.x:Xee(A);T.points[2].x=R}T.points=[T.points[0],T.points[1]]}const M=T.points[T.points.length-2];A!=null&&(T.points[T.points.length-1]=iEe(M,A));const I=T.points[1];C!=null&&(T.points[0]=iEe(I,C)),T.points.forEach(R=>{x=R.xw?R.x:w,S=R.yb?R.y:b})}),d.nodes().forEach(E=>{const T=d.node(E);T.x-=x,T.y-=S}),d.edges().forEach(E=>{d.edge(E).points.forEach(T=>{T.x-=x,T.y-=S})}),{width:w-x,height:b-S}}(t.coreGraph,h));let c=0;t.coreGraph.nodeCount()>0&&c++;const f=c<=1?0:c;t.coreBox.width+=f+f,t.coreBox.height=a.labelHeight+t.coreBox.height,t.width=t.coreBox.width+a.paddingLeft+a.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(n,e)}function nEe(n,e){const t=e.x-n.x,r=e.y-n.y;return 180*Math.atan(r/t)/Math.PI}function Xee(n){return n.expanded?n.x:n.x-n.width/2+0+n.coreBox.width/2}function iEe(n,e){const t=e.expanded?e.x:Xee(e),r=e.y,i=n.x-t,a=n.y-r;let o,s,l=e.expanded?e.width:e.coreBox.width,u=e.expanded?e.height:e.coreBox.height;return Math.abs(a)*l/2>Math.abs(i)*u/2?(a<0&&(u=-u),o=a===0?0:u/2*i/a,s=u/2):(i<0&&(l=-l),o=l/2,s=i===0?0:l/2*a/i),{x:t+o,y:r+s}}function Nsr(n,e,t){var r,i,a,o;const s=n.nodes.filter((c,f,d)=>d.findIndex(v=>v.id===c.id)!==f).map(c=>c.id);if(s.length)throw new Error(`Duplicated ids found: ${s.join(", ")}`);const l=function(c){const f={nodes:[]},d=c.compound,v=Object.keys(d||{}),p=new Map,g=(y,_=[])=>{if(p.has(y))return p.get(y);for(let x=0;xc.edges.filter(_=>_.w===y).map(_=>({name:_.v}));return c.nodes.forEach(y=>{const _=y.id,x=[...g(_),_];let S=m(_);f.nodes.push({name:_,path:x,inputs:S,width:y.width,height:y.height,attr:Object.assign({},y)})}),f}(n),u=function(c,f){const d=(p,g)=>{for(let m of g.values())if(m.includes(p))return!0;return!1},v=(p,g=[])=>{if(Object.keys(p).length===0)return[...new Set(g)];const m=new Map(Object.keys(p).map(_=>[_,p[_]])),y={};for(let[_,x]of m)d(_,m)?y[_]=x:g=g.concat(_,x);return v(y,g)};return v(c).filter(p=>f.includes(p))}(n.compound||{},(e==null?void 0:e.expanded)||[]),h=function(c,f){return function(d){return new Dsr(d)}(Rsr(Isr(c),f))}(l,{rankDirection:((i=(r=t==null?void 0:t.graph)===null||r===void 0?void 0:r.meta)===null||i===void 0?void 0:i.rankDir)||(e==null?void 0:e.rankDirection)||R9.graph.meta.rankDir,align:((o=(a=t==null?void 0:t.graph)===null||a===void 0?void 0:a.meta)===null||o===void 0?void 0:o.align)||R9.graph.meta.align});return function(c,f){f.forEach(d=>{const v=c.getRenderInfoNodes().find(m=>m.displayName===d);let p=v&&v.node&&v.node.name||"";const g=c.getRenderNodeByName(p);if(!g)throw new Error(`No nodes found: ${p}`);g.expanded=!0,c.buildSubHierarchy(p)})}(h,u),iHe(h.root,t),aHe(h.root)}function ksr(n,e=!1){const t=JSON.parse(JSON.stringify(n)),r={nodes:[t],edges:[...t.edges]};return t.nodes.forEach(function i(a){(a.type===0||a.type===1)&&r.nodes.push(a),a.type===0&&(r.edges=r.edges.concat(a.edges)),Array.isArray(a.nodes)&&a.nodes.forEach(i)}),e&&r.nodes.forEach(i=>{const a=r.nodes.find(o=>o.id===i.parentNodeName);if(a){const o=a.x-a.width/2+a.paddingLeft,s=a.y-a.height/2+a.labelHeight+a.paddingTop;a.id!==DM&&(i.x+=o,i.y+=s),i.type===0&&i.edges.forEach(l=>{l.points.forEach(u=>{u.x+=i.x-i.width/2+i.paddingLeft,u.y+=i.y-i.height/2+i.labelHeight+i.paddingTop})})}}),r}function Fsr(n,e,t,r){var i,a;let o=[];const s=((i=t.find(c=>c.id===n))===null||i===void 0?void 0:i.path)||[],l=((a=t.find(c=>c.id===e))===null||a===void 0?void 0:a.path)||[],u=[DM,...s].slice(0,s.length).reverse(),h=[DM,...l].slice(0,l.length);return u.forEach(c=>{const f=t.find(d=>d.id===c);o=o.concat(f.edges.filter(d=>d.baseEdgeList.some(v=>v.v===((r==null?void 0:r.v)||n)&&v.w===((r==null?void 0:r.w)||e))))}),h.filter(c=>!u.includes(c)).forEach(c=>{const f=t.find(d=>d.id===c);o=o.concat(f.edges.filter(d=>d.baseEdgeList.some(v=>v.v===((r==null?void 0:r.v)||n)&&v.w===((r==null?void 0:r.w)||e))))}),o}function aHe(n){const e=n.coreGraph.nodes().map(r=>n.coreGraph.node(r));return Object.assign(Object.assign({},aEe(n)),{expanded:n.expanded,nodes:n.expanded?(t=e,t.map(r=>r.node.type===dd.META?aHe(r):aEe(r))):[],edges:n.expanded?Bsr(n):[]});var t}function aEe(n){return{id:n.node.name,name:n.node.name,type:n.node.type,cardinality:n.node.cardinality,attr:n.attr,parentNodeName:n.node.parentNode?n.node.parentNode.name:null,coreBox:Object.assign({},n.coreBox),x:n.x,y:n.y,width:n.width,height:n.height,radius:n.radius,labelHeight:n.labelHeight,labelOffset:n.labelOffset,outboxWidth:n.outboxWidth,paddingLeft:n.paddingLeft,paddingTop:n.paddingTop,paddingRight:n.paddingRight,paddingBottom:n.paddingBottom,path:n.node.path}}function Bsr(n){return n.coreGraph.edges().map(e=>({renderInfoEdge:n.coreGraph.edge(e),edge:e})).filter(({renderInfoEdge:e})=>e.metaEdge).map(({edge:e,renderInfoEdge:t})=>{const r=function(i,a){const o=a.points.map(s=>Object.assign({},s));if(a.adjoiningMetaEdge){const s=a.adjoiningMetaEdge.points,l=a.metaEdge.inbound,u=l?s[s.length-1]:s[0],h=o[l?0:o.length-1],c=i.x-i.width/2,f=i.y-i.height/2,d=u.x-c,v=u.y-f,p=-i.paddingLeft,g=-(i.paddingTop+i.labelHeight);h.x=d+p,h.y=v+g}return o}(n,t);return{adjoiningEdge:t.adjoiningMetaEdge?{w:t.adjoiningMetaEdge.metaEdge.w,v:t.adjoiningMetaEdge.metaEdge.v}:null,inbound:t.metaEdge.inbound,w:e.w,v:e.v,points:r,weight:t.weight,baseEdgeList:t.metaEdge.baseEdgeList,parentNodeName:n.node.name}})}const Gsr=Object.freeze(Object.defineProperty({__proto__:null,BRIDGE_GRAPH_NAME:j$e,get GraphType(){return NM},get HierarchyNodeType(){return Fee},get InclusionType(){return l2},LAYOUT_CONFIG:R9,get NodeType(){return dd},ROOT_NAME:DM,buildGraph:Nsr,flatGraph:ksr,getEdges:Fsr,mergeConfig:kee},Symbol.toStringTag,{value:"Module"})),zsr=Nd(Gsr);var Usr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Fg=at&&at.__assign||function(){return Fg=Object.assign||function(n){for(var e,t=1,r=arguments.length;tu.x&&(s=u.x),l>u.y&&(l=u.y)}),r.forEach(function(u){u.points.forEach(function(h){s>h.x&&(s=h.x),l>h.y&&(l=h.y)})}),o[0]=a[0]-s,o[1]=a[1]-l}return o},e.prototype.updateNodePosition=function(t,r){var i=this,a=i.combos,o=i.nodes,s=i.edges,l=i.anchorPoint,u=i.graphSettings,h=this.getBegin(t,r);t.forEach(function(c){var f,d=c.x,v=c.y,p=c.id,g=c.type,m=c.coreBox;if(g===Kv.HierarchyNodeType.META&&p!==Kv.ROOT_NAME){var y=a.findIndex(function(b){return b.id===p}),_=(f=u==null?void 0:u.subScene)===null||f===void 0?void 0:f.meta;a[y].offsetX=d+h[0],a[y].offsetY=v+h[1],a[y].fixSize=[m.width,m.height],a[y].fixCollapseSize=[m.width,m.height],c.expanded?a[y].padding=[_==null?void 0:_.paddingTop,_==null?void 0:_.paddingRight,_==null?void 0:_.paddingBottom,_==null?void 0:_.paddingLeft]:a[y].padding=[0,0,0,0]}else if(g===Kv.HierarchyNodeType.OP){var y=o.findIndex(function(E){return E.id===p});if(o[y].x=d+h[0],o[y].y=v+h[1],l){var x=[],S=r.filter(function(E){return E.v===p}),w=r.filter(function(E){return E.w===p});S.length>0&&S.forEach(function(E){var T=E.points[0],C=(T.x-d)/c.width+.5,A=(T.y-v)/c.height+.5;x.push([C,A]),E.baseEdgeList.forEach(function(M){var I=s.find(function(R){return R.source===M.v&&R.target===M.w});I&&(I.sourceAnchor=x.length-1)})}),w.length>0&&w.forEach(function(E){var T=E.points[E.points.length-1],C=(T.x-d)/c.width+.5,A=(T.y-v)/c.height+.5;x.push([C,A]),E.baseEdgeList.forEach(function(M){var I=s.find(function(R){return R.source===M.v&&R.target===M.w});I&&(I.targetAnchor=x.length-1)})}),o[y].anchorPoints=x.length>0?x:o[y].anchorPoints||[]}}})},e.prototype.updateEdgePosition=function(t,r){var i=this,a=i.combos,o=i.edges,s=i.controlPoints,l=this.getBegin(t,r);s&&(a.forEach(function(u){u.inEdges=[],u.outEdges=[]}),o.forEach(function(u){var h,c,f,d,v=t.find(function(b){return b.id===u.source}),p=t.find(function(b){return b.id===u.target}),g=[],m=[];if(v&&p)m=(0,Kv.getEdges)(v==null?void 0:v.id,p==null?void 0:p.id,t);else if(!v||!p){var y=i.getNodePath(u.source),_=i.getNodePath(u.target),x=y.reverse().slice(v?0:1).find(function(b){return t.find(function(E){return E.id===b})}),S=_.reverse().slice(p?0:1).find(function(b){return t.find(function(E){return E.id===b})});v=t.find(function(b){return b.id===x}),p=t.find(function(b){return b.id===S}),m=(0,Kv.getEdges)(v==null?void 0:v.id,p==null?void 0:p.id,t,{v:u.source,w:u.target})}if(g=m.reduce(function(b,E){return vC(vC([],b,!0),E.points.map(function(T){return Fg(Fg({},T),{x:T.x+l[0],y:T.y+l[1]})}),!0)},[]),g=g.slice(1,-1),u.controlPoints=g,(p==null?void 0:p.type)===Kv.NodeType.META){var w=a.findIndex(function(b){return b.id===(p==null?void 0:p.id)});if(!a[w]||((h=a[w].inEdges)===null||h===void 0?void 0:h.some(function(b){return b.source===v.id&&b.target===p.id})))return;(c=a[w].inEdges)===null||c===void 0||c.push({source:v.id,target:p.id,controlPoints:g})}if((v==null?void 0:v.type)===Kv.NodeType.META){var w=a.findIndex(function(E){return E.id===(v==null?void 0:v.id)});if(!a[w]||((f=a[w].outEdges)===null||f===void 0?void 0:f.some(function(E){return E.source===v.id&&E.target===p.id})))return;(d=a[w].outEdges)===null||d===void 0||d.push({source:v.id,target:p.id,controlPoints:g})}}))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every(function(r){return r.layoutOrder!==void 0})||t.forEach(function(r,i){r.layoutOrder=i}),t.sort(function(r,i){return r.layoutOrder-i.layoutOrder})},e}(Vsr.Base);nk.DagreCompoundLayout=$sr;var Lle={},AV={},Ple={};const Wsr=Object.prototype.toString;function U9(n){const e=Wsr.call(n);return e.endsWith("Array]")&&!e.includes("Big")}function Hsr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!U9(n))throw new TypeError("input must be an array");if(n.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,r=t===void 0?0:t,i=e.toIndex,a=i===void 0?n.length:i;if(r<0||r>=n.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=r||a>n.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=n[r],s=r+1;so&&(o=n[s]);return o}function jsr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!U9(n))throw new TypeError("input must be an array");if(n.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,r=t===void 0?0:t,i=e.toIndex,a=i===void 0?n.length:i;if(r<0||r>=n.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=r||a>n.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=n[r],s=r+1;s1&&arguments[1]!==void 0?arguments[1]:{};if(U9(n)){if(n.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var t;if(e.output!==void 0){if(!U9(e.output))throw new TypeError("output option must be an array if specified");t=e.output}else t=new Array(n.length);var r=jsr(n),i=Hsr(n);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=e.min,o=a===void 0?e.autoMinMax?r:0:a,s=e.max,l=s===void 0?e.autoMinMax?i:1:s;if(o>=l)throw new RangeError("min option must be smaller than max option");for(var u=(l-o)/(i-r),h=0;h>r);return this},n.prototype.signPropagatingRightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i>r.get(i,a));return this},n.signPropagatingRightShift=function(r,i){return new e(r).signPropagatingRightShift(i)},n.prototype.rightShift=function(r){return typeof r=="number"?this.rightShiftS(r):this.rightShiftM(r)},n.prototype.rightShiftS=function(r){for(let i=0;i>>r);return this},n.prototype.rightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i>>r.get(i,a));return this},n.rightShift=function(r,i){return new e(r).rightShift(i)},n.prototype.zeroFillRightShift=n.prototype.rightShift,n.prototype.zeroFillRightShiftS=n.prototype.rightShiftS,n.prototype.zeroFillRightShiftM=n.prototype.rightShiftM,n.zeroFillRightShift=n.rightShift,n.prototype.not=function(){for(let r=0;rr)throw new RangeError("Row index out of range")}function fp(n,e,t){let r=t?n.columns:n.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function ZC(n,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==n.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function KC(n,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==n.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function lHe(n,e,t){return{row:uHe(n,e),column:hHe(n,t)}}function uHe(n,e){if(typeof e!="object")throw new TypeError("unexpected type for row indices");if(e.some(r=>r<0||r>=n.rows))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function hHe(n,e){if(typeof e!="object")throw new TypeError("unexpected type for column indices");if(e.some(r=>r<0||r>=n.columns))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Yee(n,e,t,r,i){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(F5("startRow",e),F5("endRow",t),F5("startColumn",r),F5("endColumn",i),e>t||r>i||e<0||e>=n.rows||t<0||t>=n.rows||r<0||r>=n.columns||i<0||i>=n.columns)throw new RangeError("Submatrix indices are out of range")}function MV(n,e=0){let t=[];for(let r=0;r=a)throw new RangeError("min must be smaller than max");let s=a-i,l=new ln(e,t);for(let u=0;ur?(a=!0,r=t):(i=!1,a=!0);e++}return i}isReducedEchelonForm(){let e=0,t=0,r=-1,i=!0,a=!1;for(;er?(a=!0,r=t):(i=!1,a=!0);for(let o=t+1;oe.get(i,r)&&(i=a);if(e.get(i,r)===0)r++;else{e.swapRows(t,i);let a=e.get(t,r);for(let o=r;o=0;)if(e.maxRow(i)===0)i--;else{let a=0,o=!1;for(;ae&&(e=this.get(t,r));return e}maxIndex(){let e=this.get(0,0),t=[0,0];for(let r=0;re&&(e=this.get(r,i),t[0]=r,t[1]=i);return t}min(){let e=this.get(0,0);for(let t=0;tt&&(t=this.get(e,r));return t}maxRowIndex(e){cp(this,e);let t=this.get(e,0),r=[e,0];for(let i=1;it&&(t=this.get(e,i),r[1]=i);return r}minRow(e){cp(this,e);let t=this.get(e,0);for(let r=1;rt&&(t=this.get(r,e));return t}maxColumnIndex(e){fp(this,e);let t=this.get(0,e),r=[0,e];for(let i=1;it&&(t=this.get(i,e),r[0]=i);return r}minColumn(e){fp(this,e);let t=this.get(0,e);for(let r=1;r=r)throw new RangeError("min must be smaller than max");let i=new ln(this.rows,this.columns);for(let a=0;a=r)throw new RangeError("min must be smaller than max");let i=new ln(this.rows,this.columns);for(let a=0;ar||t<0||t>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");let i=new ln(e.length,r-t+1);for(let a=0;a=this.rows)throw new RangeError(`Row index out of range: ${e[a]}`);i.set(a,o-t,this.get(e[a],o))}return i}subMatrixColumn(e,t,r){if(t===void 0&&(t=0),r===void 0&&(r=this.rows-1),t>r||t<0||t>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");let i=new ln(r-t+1,e.length);for(let a=0;a=this.columns)throw new RangeError(`Column index out of range: ${e[a]}`);i.set(o-t,a,this.get(o,e[a]))}return i}setSubMatrix(e,t,r){e=ln.checkMatrix(e);let i=t+e.rows-1,a=r+e.columns-1;Yee(this,t,i,r,a);for(let o=0;o0)if(this.data=[],Number.isInteger(t)&&t>0)for(let r=0;r"u"&&(t=e,e=this.columns),fp(this,e,!0),t=KC(this,t);for(let r=0;rMath.abs(v[h])&&(h=s);if(h!==l){for(u=0;u=0;u--){for(l=0;lo?i.set(a,o,e.get(a,o)):a===o?i.set(a,o,1):i.set(a,o,0);return i}get upperTriangularMatrix(){let e=this.LU,t=e.rows,r=e.columns,i=new ln(t,r);for(let a=0;aMath.abs(e)?(t=e/n,Math.abs(n)*Math.sqrt(1+t*t)):e!==0?(t=n/e,Math.abs(e)*Math.sqrt(1+t*t)):0}class qee{constructor(e){e=Av.checkMatrix(e);let t=e.clone(),r=e.rows,i=e.columns,a=new Float64Array(i),o,s,l,u;for(l=0;l=0;u--){for(l=0;l=0;s--){for(a=0;a=0;C--)if(v[C]!==0){for(let A=C+1;A=0;C--){if(C0;){let C,A;for(C=b-2;C>=-1&&C!==-1;C--){const M=Number.MIN_VALUE+T*Math.abs(v[C]+Math.abs(v[C+1]));if(Math.abs(m[C])<=M||Number.isNaN(m[C])){m[C]=0;break}}if(C===b-2)A=4;else{let M;for(M=b-1;M>=C&&M!==C;M--){let I=(M!==b?Math.abs(m[M]):0)+(M!==C+1?Math.abs(m[M-1]):0);if(Math.abs(v[M])<=T*I){v[M]=0;break}}M===C?A=3:M===b-1?A=1:(A=2,C=M)}switch(C++,A){case 1:{let M=m[b-2];m[b-2]=0;for(let I=b-2;I>=C;I--){let R=x1(v[I],M),k=v[I]/R,D=M/R;if(v[I]=R,I!==C&&(M=-D*m[I-1],m[I-1]=k*m[I-1]),u)for(let G=0;G=v[C+1]);){let M=v[C];if(v[C]=v[C+1],v[C+1]=M,u&&Ct&&a.set(h,c,e.get(h,c)/this.s[c]);let o=this.U,s=o.rows,l=o.columns,u=new ln(r,s);for(let h=0;he&&t++;return t}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return ln.diag(this.s)}}function Elr(n,e=!1){return n=Av.checkMatrix(n),e?new BM(n).inverse():fHe(n,ln.eye(n.rows))}function fHe(n,e,t=!1){return n=Av.checkMatrix(n),e=Av.checkMatrix(e),t?new BM(n).solve(e):n.isSquare()?new V9(n).solve(e):new qee(n).solve(e)}function a8(n){if(n=ln.checkMatrix(n),n.isSquare()){let e,t,r,i;if(n.columns===2)return e=n.get(0,0),t=n.get(0,1),r=n.get(1,0),i=n.get(1,1),e*i-t*r;if(n.columns===3){let a,o,s;return a=new i8(n,[1,2],[1,2]),o=new i8(n,[1,2],[0,2]),s=new i8(n,[1,2],[0,1]),e=n.get(0,0),t=n.get(0,1),r=n.get(0,2),e*a8(a)-t*a8(o)+r*a8(s)}else return new V9(n).determinant}else throw Error("determinant can only be calculated for a square matrix")}function Tlr(n,e){let t=[];for(let r=0;ri)return new Array(e.rows+1).fill(0);{let a=e.addRow(t,[0]);for(let o=0;oe?a[o]=1/a[o]:a[o]=0;return i.mmul(ln.diag(a).mmul(r.transpose()))}function Ilr(n,e=n,t={}){n=new ln(n);let r=!1;if(typeof e=="object"&&!ln.isMatrix(e)&&!Array.isArray(e)?(t=e,e=n,r=!0):e=new ln(e),n.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:i=!0}=t;i&&(n=n.center("column"),r||(e=e.center("column")));const a=n.transpose().mmul(e);for(let o=0;o0?i.set(a,a+1,t[a]):t[a]<0&&i.set(a,a-1,t[a])}return i}}function Plr(n,e,t,r){let i,a,o,s,l,u,h,c;for(l=0;l0;s--){for(c=0,o=0,u=0;u0&&(a=-a),e[s]=c*a,o=o-i*a,t[s-1]=i-a,l=0;lu)do{for(i=t[u],c=(t[u+1]-i)/(2*e[u]),f=x1(c,1),c<0&&(f=-f),t[u]=e[u]/(c+f),t[u+1]=e[u]*(c+f),d=t[u+1],a=i-t[u],o=u+2;o=u;o--)for(g=p,p=v,_=y,i=v*e[o],a=v*c,f=x1(c,e[o]),e[o+1]=y*f,y=e[o]/f,v=c/f,c=v*t[o]-y*i,t[o+1]=a+y*(v*i+y*t[o]),l=0;lw*S);t[u]=t[u]+x,e[u]=0}for(o=0;o=c;u--)t[u]=e.get(u,c-1)/f,l+=t[u]*t[u];for(s=Math.sqrt(l),t[c]>0&&(s=-s),l=l-t[c]*s,t[c]=t[c]-s,h=c;h=c;u--)o+=t[u]*e.get(u,h);for(o=o/l,u=c;u<=a;u++)e.set(u,h,e.get(u,h)-o*t[u])}for(u=0;u<=a;u++){for(o=0,h=a;h>=c;h--)o+=t[h]*e.get(u,h);for(o=o/l,h=c;h<=a;h++)e.set(u,h,e.get(u,h)-o*t[h])}t[c]=f*t[c],e.set(c,c-1,f*s)}}for(u=0;u=i+1;c--)if(e.get(c,c-1)!==0){for(u=c+1;u<=a;u++)t[u]=e.get(u,c-1);for(h=c;h<=a;h++){for(s=0,u=c;u<=a;u++)s+=t[u]*r.get(u,h);for(s=s/t[c]/e.get(c,c-1),u=c;u<=a;u++)r.set(u,h,r.get(u,h)+s*t[u])}}}function Dlr(n,e,t,r,i){let a=n-1,o=0,s=n-1,l=Number.EPSILON,u=0,h=0,c=0,f=0,d=0,v=0,p=0,g=0,m,y,_,x,S,w,b,E,T,C,A,M,I,R,k;for(m=0;ms)&&(t[m]=i.get(m,m),e[m]=0),y=Math.max(m-1,0);y=o;){for(x=a;x>o&&(v=Math.abs(i.get(x-1,x-1))+Math.abs(i.get(x,x)),v===0&&(v=h),!(Math.abs(i.get(x,x-1))=0){for(p=c>=0?c+p:c-p,t[a-1]=E+p,t[a]=t[a-1],p!==0&&(t[a]=E-b/p),e[a-1]=0,e[a]=0,E=i.get(a,a-1),v=Math.abs(E)+Math.abs(p),c=E/v,f=p/v,d=Math.sqrt(c*c+f*f),c=c/d,f=f/d,y=a-1;y0)){for(v=Math.sqrt(v),T=x&&(p=i.get(S,S),d=E-p,v=T-p,c=(d*v-b)/i.get(S+1,S)+i.get(S,S+1),f=i.get(S+1,S+1)-p-d-v,d=i.get(S+2,S+1),v=Math.abs(c)+Math.abs(f)+Math.abs(d),c=c/v,f=f/v,d=d/v,!(S===x||Math.abs(i.get(S,S-1))*(Math.abs(f)+Math.abs(d))S+2&&i.set(m,m-3,0);for(_=S;_<=a-1&&(R=_!==a-1,_!==S&&(c=i.get(_,_-1),f=i.get(_+1,_-1),d=R?i.get(_+2,_-1):0,E=Math.abs(c)+Math.abs(f)+Math.abs(d),E!==0&&(c=c/E,f=f/E,d=d/E)),E!==0);_++)if(v=Math.sqrt(c*c+f*f+d*d),c<0&&(v=-v),v!==0){for(_!==S?i.set(_,_-1,-v*E):x!==S&&i.set(_,_-1,-i.get(_,_-1)),c=c+v,E=c/v,T=f/v,p=d/v,f=f/c,d=d/c,y=_;y=0;a--)if(c=t[a],f=e[a],f===0)for(x=a,i.set(a,a,1),m=a-1;m>=0;m--){for(b=i.get(m,m)-c,d=0,y=x;y<=a;y++)d=d+i.get(m,y)*i.get(y,a);if(e[m]<0)p=b,v=d;else if(x=m,e[m]===0?i.set(m,a,b!==0?-d/b:-d/(l*h)):(E=i.get(m,m+1),T=i.get(m+1,m),f=(t[m]-c)*(t[m]-c)+e[m]*e[m],w=(E*v-p*d)/f,i.set(m,a,w),i.set(m+1,a,Math.abs(E)>Math.abs(p)?(-d-b*w)/E:(-v-T*w)/p)),w=Math.abs(i.get(m,a)),l*w*w>1)for(y=m;y<=a;y++)i.set(y,a,i.get(y,a)/w)}else if(f<0)for(x=a-1,Math.abs(i.get(a,a-1))>Math.abs(i.get(a-1,a))?(i.set(a-1,a-1,f/i.get(a,a-1)),i.set(a-1,a,-(i.get(a,a)-c)/i.get(a,a-1))):(k=B5(0,-i.get(a-1,a),i.get(a-1,a-1)-c,f),i.set(a-1,a-1,k[0]),i.set(a-1,a,k[1])),i.set(a,a-1,0),i.set(a,a,1),m=a-2;m>=0;m--){for(C=0,A=0,y=x;y<=a;y++)C=C+i.get(m,y)*i.get(y,a-1),A=A+i.get(m,y)*i.get(y,a);if(b=i.get(m,m)-c,e[m]<0)p=b,d=C,v=A;else if(x=m,e[m]===0?(k=B5(-C,-A,b,f),i.set(m,a-1,k[0]),i.set(m,a,k[1])):(E=i.get(m,m+1),T=i.get(m+1,m),M=(t[m]-c)*(t[m]-c)+e[m]*e[m]-f*f,I=(t[m]-c)*2*f,M===0&&I===0&&(M=l*h*(Math.abs(b)+Math.abs(f)+Math.abs(E)+Math.abs(T)+Math.abs(p))),k=B5(E*d-p*C+f*A,E*v-p*A-f*C,M,I),i.set(m,a-1,k[0]),i.set(m,a,k[1]),Math.abs(E)>Math.abs(p)+Math.abs(f)?(i.set(m+1,a-1,(-C-b*i.get(m,a-1)+f*i.get(m,a))/E),i.set(m+1,a,(-A-b*i.get(m,a)-f*i.get(m,a-1))/E)):(k=B5(-d-T*i.get(m,a-1),-v-T*i.get(m,a),p,f),i.set(m+1,a-1,k[0]),i.set(m+1,a,k[1]))),w=Math.max(Math.abs(i.get(m,a-1)),Math.abs(i.get(m,a))),l*w*w>1)for(y=m;y<=a;y++)i.set(y,a-1,i.get(y,a-1)/w),i.set(y,a,i.get(y,a)/w)}for(m=0;ms)for(y=m;y=o;y--)for(m=o;m<=s;m++){for(p=0,_=o;_<=Math.min(y,s);_++)p=p+r.get(m,_)*i.get(_,y);r.set(m,y,p)}}}function B5(n,e,t,r){let i,a;return Math.abs(t)>Math.abs(r)?(i=r/t,a=t+i*r,[(n+i*e)/a,(e-i*n)/a]):(i=t/r,a=r+i*t,[(i*n+e)/a,(i*e-n)/a])}class uEe{constructor(e){if(e=Av.checkMatrix(e),!e.isSymmetric())throw new Error("Matrix is not symmetric");let t=e,r=t.rows,i=new ln(r,r),a=!0,o,s,l;for(s=0;s0,i.set(s,s,Math.sqrt(Math.max(u,0))),l=s+1;l=0;l--)for(s=0;so;d++)c=e.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0)),c=c.div(c.norm()),u=e.mmul(c).div(c.transpose().mmul(c).get(0,0)),d>0&&(l=u.clone().sub(f).pow(2).sum()),f=u.clone(),r?(h=r.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0)),h=h.div(h.norm()),s=r.mmul(h).div(h.transpose().mmul(h).get(0,0))):s=u;if(r){let d=e.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0));d=d.div(d.norm());let v=e.clone().sub(u.clone().mmul(d.transpose())),p=s.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0)),g=r.clone().sub(u.clone().mulS(p.get(0,0)).mmul(h.transpose()));this.t=u,this.p=d.transpose(),this.w=c.transpose(),this.q=h,this.u=s,this.s=u.transpose().mmul(u),this.xResidual=v,this.yResidual=g,this.betas=p}else this.w=c.transpose(),this.s=u.transpose().mmul(u).sqrt(),i?this.t=u.clone().div(this.s.get(0,0)):this.t=u,this.xResidual=e.sub(u.mmul(c.transpose()))}}const Nlr=Object.freeze(Object.defineProperty({__proto__:null,AbstractMatrix:Ji,default:ln,Matrix:ln,wrap:blr,WrapperMatrix1D:cHe,WrapperMatrix2D:Av,solve:fHe,inverse:Elr,determinant:a8,linearDependencies:Alr,pseudoInverse:Mlr,covariance:Ilr,correlation:Llr,SingularValueDecomposition:BM,SVD:BM,EigenvalueDecomposition:lEe,EVD:lEe,CholeskyDecomposition:uEe,CHO:uEe,LuDecomposition:V9,LU:V9,QrDecomposition:qee,QR:qee,Nipals:hEe,NIPALS:hEe,MatrixColumnView:plr,MatrixColumnSelectionView:glr,MatrixFlipColumnView:ylr,MatrixFlipRowView:mlr,MatrixRowView:_lr,MatrixRowSelectionView:xlr,MatrixSelectionView:i8,MatrixSubView:Slr,MatrixTransposeView:wlr},Symbol.toStringTag,{value:"Module"})),dHe=Nd(Nlr);Object.defineProperty(Ple,"__esModule",{value:!0});var bP=dHe,klr=function(){function n(e){this.distances=e.distances,this.dimension=e.dimension||2,this.linkDistance=e.linkDistance}return n.prototype.layout=function(){var e=this,t=e.dimension,r=e.distances,i=e.linkDistance;try{var a=bP.Matrix.mul(bP.Matrix.pow(r,2),-.5),o=a.mean("row"),s=a.mean("column"),l=a.mean();a.add(l).subRowVector(o).subColumnVector(s);var u=new bP.SingularValueDecomposition(a),h=bP.Matrix.sqrt(u.diagonalMatrix).diagonal();return u.leftSingularVectors.toJSON().map(function(p){return bP.Matrix.mul([p],[h]).toJSON()[0].splice(0,t)})}catch{for(var c=[],f=0;fh?1:-1;c=.01*v,f=.01*v}if(dMath.PI/2&&(m-=Math.PI/2,v*=-1,p*=-1);var y=Math.cos(m)*g;u.x=v*y,u.y=p*y});var l=e.radii;t.forEach(function(u,h){if(h!==o){var c=Math.sqrt(r[h].x*r[h].x+r[h].y*r[h].y);if(c>0&&h!==o){var f=Math.min(s*(i/Flr),c);if(u[0]+=r[h].x/c*f,u[1]+=r[h].y/c*f,a){var d=u[0]-t[o][0],v=u[1]-t[o][1],p=Math.sqrt(d*d+v*v);d=d/p*l[h],v=v/p*l[h],u[0]=t[o][0]+d,u[1]=t[o][1]+v}}}})},n}();Ole.default=Blr;var Glr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),vHe=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(AV,"__esModule",{value:!0});AV.RadialLayout=void 0;var Jv=Dl(),zlr=Xl,Ulr=vHe(Ple),Vlr=vHe(Ole);function $lr(n){for(var e=n.length,t=n[0].length,r=[],i=0;ia[0]?a[0]:p-a[0],y=g-a[1]>a[1]?a[1]:g-a[1];m===0&&(m=p/2),y===0&&(y=g/2);var _=y>m?m:y,x=Math.max.apply(Math,v),S=[];v.forEach(function(W,z){t.unitRadius||(t.unitRadius=_/x),S[z]=W*t.unitRadius}),t.radii=S;var w=t.eIdealDisMatrix();t.eIdealDistances=w;var b=$lr(w);t.weights=b;var E=new Ulr.default({linkDistance:o,distances:w}),T=E.layout();T.forEach(function(W){(0,Jv.isNaN)(W[0])&&(W[0]=Math.random()*o),(0,Jv.isNaN)(W[1])&&(W[1]=Math.random()*o)}),t.positions=T,T.forEach(function(W,z){r[z].x=W[0]+a[0],r[z].y=W[1]+a[1]}),T.forEach(function(W){W[0]-=T[h][0],W[1]-=T[h][1]}),t.run();var C=t.preventOverlap,A=t.nodeSize,M,I=t.strictRadial;if(C){var R=t.nodeSpacing,k;(0,Jv.isNumber)(R)?k=function(){return R}:(0,Jv.isFunction)(R)?k=R:k=function(){return 0},A?(0,Jv.isArray)(A)?M=function(W){var z=A[0]>A[1]?A[0]:A[1];return z+k(W)}:M=function(W){return A+k(W)}:M=function(W){if(W.size){if((0,Jv.isArray)(W.size)){var z=W.size[0]>W.size[1]?W.size[0]:W.size[1];return z+k(W)}if((0,Jv.isObject)(W.size)){var z=W.size.width>W.size.height?W.size.width:W.size.height;return z+k(W)}return W.size+k(W)}return 10+k(W)};var D={nodes:r,nodeSizeFunc:M,adjMatrix:c,positions:T,radii:S,height:g,width:p,strictRadial:I,focusID:h,iterations:t.maxPreventOverlapIteration||200,k:T.length/4.5},G=new Vlr.default(D);T=G.layout()}return T.forEach(function(W,z){r[z].x=W[0]+a[0],r[z].y=W[1]+a[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:r,edges:i}},e.prototype.run=function(){for(var t=this,r=t.maxIteration,i=t.positions||[],a=t.weights||[],o=t.eIdealDistances||[],s=t.radii||[],l=0;l<=r;l++){var u=l/r;t.oneIteration(u,i,s,o,a)}},e.prototype.oneIteration=function(t,r,i,a,o){var s=this,l=1-t,u=s.focusIndex;r.forEach(function(h,c){var f=cEe(h,[0,0]),d=f===0?0:1/f;if(c!==u){var v=0,p=0,g=0;r.forEach(function(y,_){if(c!==_){var x=cEe(h,y),S=x===0?0:1/x,w=a[_][c];g+=o[c][_],v+=o[c][_]*(y[0]+w*(h[0]-y[0])*S),p+=o[c][_]*(y[1]+w*(h[1]-y[1])*S)}});var m=i[c]===0?0:1/i[c];g*=l,g+=t*m*m,v*=l,v+=t*m*h[0]*d,h[0]=v/g,p*=l,p+=t*m*h[1]*d,h[1]=p/g}})},e.prototype.eIdealDisMatrix=function(){var t=this,r=t.nodes;if(!r)return[];var i=t.distances,a=t.linkDistance,o=t.radii||[],s=t.unitRadius||50,l=[];return i&&i.forEach(function(u,h){var c=[];u.forEach(function(f,d){if(h===d)c.push(0);else if(o[h]===o[d])if(t.sortBy==="data")c.push(f*(Math.abs(h-d)*t.sortStrength)/(o[h]/s));else if(t.sortBy){var v=r[h][t.sortBy]||0,p=r[d][t.sortBy]||0;(0,Jv.isString)(v)&&(v=v.charCodeAt(0)),(0,Jv.isString)(p)&&(p=p.charCodeAt(0)),c.push(f*(Math.abs(v-p)*t.sortStrength)/(o[h]/s))}else c.push(f*a/(o[h]/s));else{var g=(a+s)/2;c.push(f*g)}}),l.push(c)}),l},e.prototype.handleInfinity=function(t,r,i){for(var a=t.length,o=0;oi?t[r][a]:i);return i},e.prototype.getType=function(){return"radial"},e}(zlr.Base);AV.RadialLayout=Hlr;(function(n){var e=at&&at.__createBinding||(Object.create?function(r,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(r,o,s)}:function(r,i,a,o){o===void 0&&(o=a),r[o]=i[a]}),t=at&&at.__exportStar||function(r,i){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,r,a)};Object.defineProperty(n,"__esModule",{value:!0}),t(AV,n)})(Lle);var lk={},jlr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(lk,"__esModule",{value:!0});lk.ConcentricLayout=void 0;var ay=Dl(),Xlr=Xl,Ylr=function(n){jlr(e,n);function e(t){var r=n.call(this)||this;return r.nodeSize=30,r.minNodeSpacing=10,r.nodeSpacing=10,r.preventOverlap=!1,r.equidistant=!1,r.startAngle=3/2*Math.PI,r.clockwise=!0,r.sortBy="degree",r.nodes=[],r.edges=[],r.width=300,r.height=300,r.onLayoutEnd=function(){},r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{nodeSize:30,minNodeSpacing:10,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},e.prototype.execute=function(){var t,r,i=this,a=i.nodes,o=i.edges,s=a.length;if(s===0){(t=i.onLayoutEnd)===null||t===void 0||t.call(i);return}!i.width&&typeof window<"u"&&(i.width=window.innerWidth),!i.height&&typeof window<"u"&&(i.height=window.innerHeight),i.center||(i.center=[i.width/2,i.height/2]);var l=i.center;if(s===1){a[0].x=l[0],a[0].y=l[1],(r=i.onLayoutEnd)===null||r===void 0||r.call(i);return}var u=i.nodeSize,h=i.nodeSpacing,c=[],f,d=0;(0,ay.isArray)(u)?f=Math.max(u[0],u[1]):f=u,(0,ay.isArray)(h)?d=Math.max(h[0],h[1]):(0,ay.isNumber)(h)&&(d=h),a.forEach(function(I){c.push(I);var R=f;(0,ay.isArray)(I.size)?R=Math.max(I.size[0],I.size[1]):(0,ay.isNumber)(I.size)?R=I.size:(0,ay.isObject)(I.size)&&(R=Math.max(I.size.width,I.size.height)),f=Math.max(f,R),(0,ay.isFunction)(h)&&(d=Math.max(h(I),d))}),i.clockwise=i.counterclockwise!==void 0?!i.counterclockwise:i.clockwise;var v={},p={};if(c.forEach(function(I,R){v[I.id]=I,p[I.id]=R}),(i.sortBy==="degree"||!(0,ay.isString)(i.sortBy)||c[0][i.sortBy]===void 0)&&(i.sortBy="degree",!(0,ay.isNumber)(a[0].degree))){var g=(0,ay.getDegree)(a.length,p,o);c.forEach(function(I,R){I.degree=g[R].all})}c.sort(function(I,R){return R[i.sortBy]-I[i.sortBy]}),i.maxValueNode=c[0],i.maxLevelDiff=i.maxLevelDiff||i.maxValueNode[i.sortBy]/4;var m=[[]],y=m[0];c.forEach(function(I){if(y.length>0){var R=Math.abs(y[0][i.sortBy]-I[i.sortBy]);i.maxLevelDiff&&R>=i.maxLevelDiff&&(y=[],m.push(y))}y.push(I)});var _=f+(d||i.minNodeSpacing);if(!i.preventOverlap){var x=m.length>0&&m[0].length>1,S=Math.min(i.width,i.height)/2-_,w=S/(m.length+(x?1:0));_=Math.min(_,w)}var b=0;if(m.forEach(function(I){var R=i.sweep;R===void 0&&(R=2*Math.PI-2*Math.PI/I.length);var k=I.dTheta=R/Math.max(1,I.length-1);if(I.length>1&&i.preventOverlap){var D=Math.cos(k)-Math.cos(0),G=Math.sin(k)-Math.sin(0),W=Math.sqrt(_*_/(D*D+G*G));b=Math.max(W,b)}I.r=b,b+=_}),i.equidistant){for(var E=0,T=0,C=0;C"u")return;var f=0;this.timeInterval=window.setInterval(function(){var d;r.runOneStep(h),f++,f>=o&&((d=r.onLayoutEnd)===null||d===void 0||d.call(r),window.clearInterval(r.timeInterval))},0)}return{nodes:i,edges:a}}},e.prototype.runOneStep=function(t){var r,i=this,a=i.nodes;if(!!a){var o=i.edges,s=i.center,l=i.gravity,u=i.speed,h=i.clustering,c=i.height*i.width,f=Math.sqrt(c)/10,d=c/(a.length+1),v=Math.sqrt(d),p=[];if(a.forEach(function(y,_){p[_]={x:0,y:0}}),i.applyCalculate(a,o,p,v,d),h){for(var g in t)t[g].cx=0,t[g].cy=0,t[g].count=0;a.forEach(function(y){var _=t[y.cluster];(0,zl.isNumber)(y.x)&&(_.cx+=y.x),(0,zl.isNumber)(y.y)&&(_.cy+=y.y),_.count++});for(var g in t)t[g].cx/=t[g].count,t[g].cy/=t[g].count;var m=i.clusterGravity||l;a.forEach(function(y,_){if(!(!(0,zl.isNumber)(y.x)||!(0,zl.isNumber)(y.y))){var x=t[y.cluster],S=Math.sqrt((y.x-x.cx)*(y.x-x.cx)+(y.y-x.cy)*(y.y-x.cy)),w=v*m;p[_].x-=w*(y.x-x.cx)/S,p[_].y-=w*(y.y-x.cy)/S}})}a.forEach(function(y,_){if(!(!(0,zl.isNumber)(y.x)||!(0,zl.isNumber)(y.y))){var x=.01*v*l;p[_].x-=x*(y.x-s[0]),p[_].y-=x*(y.y-s[1])}}),a.forEach(function(y,_){if((0,zl.isNumber)(y.fx)&&(0,zl.isNumber)(y.fy)){y.x=y.fx,y.y=y.fy;return}if(!(!(0,zl.isNumber)(y.x)||!(0,zl.isNumber)(y.y))){var x=Math.sqrt(p[_].x*p[_].x+p[_].y*p[_].y);if(x>0){var S=Math.min(f*(u/eur),x);y.x+=p[_].x/x*S,y.y+=p[_].y/x*S}}}),(r=i.tick)===null||r===void 0||r.call(i)}},e.prototype.applyCalculate=function(t,r,i,a,o){var s=this;s.calRepulsive(t,i,o),r&&s.calAttractive(r,i,a)},e.prototype.calRepulsive=function(t,r,i){t.forEach(function(a,o){r[o]={x:0,y:0},t.forEach(function(s,l){if(o!==l&&!(!(0,zl.isNumber)(a.x)||!(0,zl.isNumber)(s.x)||!(0,zl.isNumber)(a.y)||!(0,zl.isNumber)(s.y))){var u=a.x-s.x,h=a.y-s.y,c=u*u+h*h;if(c===0){c=1;var f=o>l?1:-1;u=.01*f,h=.01*f}var d=i/c;r[o].x+=u*d,r[o].y+=h*d}})})},e.prototype.calAttractive=function(t,r,i){var a=this;t.forEach(function(o){var s=(0,zl.getEdgeTerminal)(o,"source"),l=(0,zl.getEdgeTerminal)(o,"target");if(!(!s||!l)){var u=a.nodeIdxMap[s],h=a.nodeIdxMap[l];if(u!==h){var c=a.nodeMap[s],f=a.nodeMap[l];if(!(!(0,zl.isNumber)(f.x)||!(0,zl.isNumber)(c.x)||!(0,zl.isNumber)(f.y)||!(0,zl.isNumber)(c.y))){var d=f.x-c.x,v=f.y-c.y,p=Math.sqrt(d*d+v*v),g=p*p/i;r[h].x-=d/p*g,r[h].y-=v/p*g,r[u].x+=d/p*g,r[u].y+=v/p*g}}}})},e.prototype.stop=function(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(Qlr.Base);hk.FruchtermanLayout=tur;var ck={};function fEe(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Vc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){fEe(a,r,i,o,s,"next",l)}function s(l){fEe(a,r,i,o,s,"throw",l)}o(void 0)})}}function GM(n){return GM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GM(n)}function rur(n,e){if(GM(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(GM(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function pHe(n){var e=rur(n,"string");return GM(e)=="symbol"?e:e+""}function Lr(n,e,t){return(e=pHe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function z0(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function dEe(n,e){for(var t=0;t-1&&n%1==0&&n<=bur}var Tur=Eur;function Cur(n){return n!=null&&typeof n=="object"}var Dle=Cur,Aur=Rle,Mur=Tur,Iur=Dle,Lur="[object Arguments]",Pur="[object Array]",Our="[object Boolean]",Rur="[object Date]",Dur="[object Error]",Nur="[object Function]",kur="[object Map]",Fur="[object Number]",Bur="[object Object]",Gur="[object RegExp]",zur="[object Set]",Uur="[object String]",Vur="[object WeakMap]",$ur="[object ArrayBuffer]",Wur="[object DataView]",Hur="[object Float32Array]",jur="[object Float64Array]",Xur="[object Int8Array]",Yur="[object Int16Array]",qur="[object Int32Array]",Zur="[object Uint8Array]",Kur="[object Uint8ClampedArray]",Jur="[object Uint16Array]",Qur="[object Uint32Array]",qs={};qs[Hur]=qs[jur]=qs[Xur]=qs[Yur]=qs[qur]=qs[Zur]=qs[Kur]=qs[Jur]=qs[Qur]=!0;qs[Lur]=qs[Pur]=qs[$ur]=qs[Our]=qs[Wur]=qs[Rur]=qs[Dur]=qs[Nur]=qs[kur]=qs[Fur]=qs[Bur]=qs[Gur]=qs[zur]=qs[Uur]=qs[Vur]=!1;function ehr(n){return Iur(n)&&Mur(n.length)&&!!qs[Aur(n)]}var thr=ehr;function rhr(n){return function(e){return n(e)}}var nhr=rhr,Zee={exports:{}};(function(n,e){var t=gHe,r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,a=i&&i.exports===r,o=a&&t.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();n.exports=s})(Zee,Zee.exports);var ihr=thr,ahr=nhr,yEe=Zee.exports,mEe=yEe&&yEe.isTypedArray,ohr=mEe?ahr(mEe):ihr,$9=ohr,shr=Rle,lhr=Dle,uhr="[object Number]";function hhr(n){return typeof n=="number"||lhr(n)&&shr(n)==uhr}var chr=hhr,fhr=Array.isArray,dhr=fhr,_He={exports:{}},Nle={exports:{}};(function(n){function e(t,r){this.v=t,this.k=r}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(Nle);var kle={exports:{}},Fle={exports:{}};(function(n){function e(t,r,i,a){var o=Object.defineProperty;try{o({},"",{})}catch{o=0}n.exports=e=function(l,u,h,c){if(u)o?o(l,u,{value:h,enumerable:!c,configurable:!c,writable:!c}):l[u]=h;else{var f=function(v,p){e(l,v,function(g){return this._invoke(v,p,g)})};f("next",0),f("throw",1),f("return",2)}},n.exports.__esModule=!0,n.exports.default=n.exports,e(t,r,i,a)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(Fle);(function(n){var e=Fle.exports;function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,i,a=typeof Symbol=="function"?Symbol:{},o=a.iterator||"@@iterator",s=a.toStringTag||"@@toStringTag";function l(g,m,y,_){var x=m&&m.prototype instanceof h?m:h,S=Object.create(x.prototype);return e(S,"_invoke",function(w,b,E){var T,C,A,M=0,I=E||[],R=!1,k={p:0,n:0,v:r,a:D,f:D.bind(r,4),d:function(W,z){return T=W,C=0,A=r,k.n=z,u}};function D(G,W){for(C=G,A=W,i=0;!R&&M&&!z&&i3?(z=Y===W)&&(A=V[(C=V[4])?5:(C=3,3)],V[4]=V[5]=r):V[0]<=q&&((z=G<2&&qW||W>Y)&&(V[4]=G,V[5]=W,k.n=Y,C=0))}if(z||G>1)return u;throw R=!0,W}return function(G,W,z){if(M>1)throw TypeError("Generator is already running");for(R&&W===1&&D(W,z),C=W,A=z;(i=C<2?r:A)||!R;){T||(C?C<3?(C>1&&(k.n=-1),D(C,A)):k.n=A:k.v=A);try{if(M=2,T){if(C||(G="next"),i=T[G]){if(!(i=i.call(T,A)))throw TypeError("iterator result is not an object");if(!i.done)return i;A=i.value,C<2&&(C=0)}else C===1&&(i=T.return)&&i.call(T),C<2&&(A=TypeError("The iterator does not provide a '"+G+"' method"),C=1);T=r}else if((i=(R=k.n<0)?A:w.call(b,k))!==u)break}catch(V){T=r,C=1,A=V}finally{M=1}}return{value:i,done:R}}}(g,y,_),!0),S}var u={};function h(){}function c(){}function f(){}i=Object.getPrototypeOf;var d=[][o]?i(i([][o]())):(e(i={},o,function(){return this}),i),v=f.prototype=h.prototype=Object.create(d);function p(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,f):(g.__proto__=f,e(g,s,"GeneratorFunction")),g.prototype=Object.create(v),g}return c.prototype=f,e(v,"constructor",f),e(f,"constructor",c),c.displayName="GeneratorFunction",e(f,s,"GeneratorFunction"),e(v),e(v,s,"Generator"),e(v,o,function(){return this}),e(v,"toString",function(){return"[object Generator]"}),(n.exports=t=function(){return{w:l,m:p}},n.exports.__esModule=!0,n.exports.default=n.exports)()}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(kle);var xHe={exports:{}},Ble={exports:{}},Gle={exports:{}};(function(n){var e=Nle.exports,t=Fle.exports;function r(i,a){function o(l,u,h,c){try{var f=i[l](u),d=f.value;return d instanceof e?a.resolve(d.v).then(function(v){o("next",v,h,c)},function(v){o("throw",v,h,c)}):a.resolve(d).then(function(v){f.value=v,h(f)},function(v){return o("throw",v,h,c)})}catch(v){c(v)}}var s;this.next||(t(r.prototype),t(r.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),t(this,"_invoke",function(l,u,h){function c(){return new a(function(f,d){o(l,h,f,d)})}return s=s?s.then(c,c):c()},!0)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports})(Gle);(function(n){var e=kle.exports,t=Gle.exports;function r(i,a,o,s,l){return new t(e().w(i,a,o,s),l||Promise)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports})(Ble);(function(n){var e=Ble.exports;function t(r,i,a,o,s){var l=e(r,i,a,o,s);return l.next().then(function(u){return u.done?u.value:l.next()})}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(xHe);var SHe={exports:{}};(function(n){function e(t){var r=Object(t),i=[];for(var a in r)i.unshift(a);return function o(){for(;i.length;)if((a=i.pop())in r)return o.value=a,o.done=!1,o;return o.done=!0,o}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(SHe);var wHe={exports:{}},bHe={exports:{}};(function(n){function e(t){return n.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n.exports.__esModule=!0,n.exports.default=n.exports,e(t)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(bHe);(function(n){var e=bHe.exports.default;function t(r){if(r!=null){var i=r[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],a=0;if(i)return i.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length))return{next:function(){return r&&a>=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}}}throw new TypeError(e(r)+" is not iterable")}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(wHe);(function(n){var e=Nle.exports,t=kle.exports,r=xHe.exports,i=Ble.exports,a=Gle.exports,o=SHe.exports,s=wHe.exports;function l(){var u=t(),h=u.m(l),c=(Object.getPrototypeOf?Object.getPrototypeOf(h):h.__proto__).constructor;function f(p){var g=typeof p=="function"&&p.constructor;return!!g&&(g===c||(g.displayName||g.name)==="GeneratorFunction")}var d={throw:1,return:2,break:3,continue:3};function v(p){var g,m;return function(y){g||(g={stop:function(){return m(y.a,2)},catch:function(){return y.v},abrupt:function(x,S){return m(y.a,d[x],S)},delegateYield:function(x,S,w){return g.resultName=S,m(y.d,s(x),w)},finish:function(x){return m(y.f,x)}},m=function(x,S,w){y.p=g.prev,y.n=g.next;try{return x(S,w)}finally{g.next=y.n}}),g.resultName&&(g[g.resultName]=y.v,g.resultName=void 0),g.sent=y.v,g.next=y.n;try{return p.call(this,g)}finally{y.p=g.prev,y.n=g.next}}}return(n.exports=l=function(){return{wrap:function(m,y,_,x){return u.w(v(m),y,_,x&&x.reverse())},isGeneratorFunction:f,mark:u.m,awrap:function(m,y){return new e(m,y)},AsyncIterator:a,async:function(m,y,_,x,S){return(f(y)?i:r)(v(m),y,_,x,S)},keys:o,values:s}},n.exports.__esModule=!0,n.exports.default=n.exports)()}n.exports=l,n.exports.__esModule=!0,n.exports.default=n.exports})(_He);var o8=_He.exports(),Rc=o8;try{regeneratorRuntime=o8}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=o8:Function("r","regeneratorRuntime = r")(o8)}var vhr=1;function EHe(){return vhr++}var Qt;(function(n){n[n.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",n[n.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",n[n.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",n[n.POINTS=0]="POINTS",n[n.LINES=1]="LINES",n[n.LINE_LOOP=2]="LINE_LOOP",n[n.LINE_STRIP=3]="LINE_STRIP",n[n.TRIANGLES=4]="TRIANGLES",n[n.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",n[n.TRIANGLE_FAN=6]="TRIANGLE_FAN",n[n.ZERO=0]="ZERO",n[n.ONE=1]="ONE",n[n.SRC_COLOR=768]="SRC_COLOR",n[n.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",n[n.SRC_ALPHA=770]="SRC_ALPHA",n[n.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",n[n.DST_ALPHA=772]="DST_ALPHA",n[n.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",n[n.DST_COLOR=774]="DST_COLOR",n[n.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",n[n.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",n[n.FUNC_ADD=32774]="FUNC_ADD",n[n.BLEND_EQUATION=32777]="BLEND_EQUATION",n[n.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",n[n.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",n[n.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",n[n.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",n[n.MAX_EXT=32776]="MAX_EXT",n[n.MIN_EXT=32775]="MIN_EXT",n[n.BLEND_DST_RGB=32968]="BLEND_DST_RGB",n[n.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",n[n.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",n[n.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",n[n.CONSTANT_COLOR=32769]="CONSTANT_COLOR",n[n.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",n[n.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",n[n.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",n[n.BLEND_COLOR=32773]="BLEND_COLOR",n[n.ARRAY_BUFFER=34962]="ARRAY_BUFFER",n[n.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",n[n.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",n[n.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",n[n.STREAM_DRAW=35040]="STREAM_DRAW",n[n.STATIC_DRAW=35044]="STATIC_DRAW",n[n.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",n[n.BUFFER_SIZE=34660]="BUFFER_SIZE",n[n.BUFFER_USAGE=34661]="BUFFER_USAGE",n[n.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",n[n.FRONT=1028]="FRONT",n[n.BACK=1029]="BACK",n[n.FRONT_AND_BACK=1032]="FRONT_AND_BACK",n[n.CULL_FACE=2884]="CULL_FACE",n[n.BLEND=3042]="BLEND",n[n.DITHER=3024]="DITHER",n[n.STENCIL_TEST=2960]="STENCIL_TEST",n[n.DEPTH_TEST=2929]="DEPTH_TEST",n[n.SCISSOR_TEST=3089]="SCISSOR_TEST",n[n.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",n[n.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",n[n.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",n[n.NO_ERROR=0]="NO_ERROR",n[n.INVALID_ENUM=1280]="INVALID_ENUM",n[n.INVALID_VALUE=1281]="INVALID_VALUE",n[n.INVALID_OPERATION=1282]="INVALID_OPERATION",n[n.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",n[n.CW=2304]="CW",n[n.CCW=2305]="CCW",n[n.LINE_WIDTH=2849]="LINE_WIDTH",n[n.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",n[n.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",n[n.CULL_FACE_MODE=2885]="CULL_FACE_MODE",n[n.FRONT_FACE=2886]="FRONT_FACE",n[n.DEPTH_RANGE=2928]="DEPTH_RANGE",n[n.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",n[n.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",n[n.DEPTH_FUNC=2932]="DEPTH_FUNC",n[n.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",n[n.STENCIL_FUNC=2962]="STENCIL_FUNC",n[n.STENCIL_FAIL=2964]="STENCIL_FAIL",n[n.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",n[n.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",n[n.STENCIL_REF=2967]="STENCIL_REF",n[n.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",n[n.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",n[n.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",n[n.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",n[n.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",n[n.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",n[n.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",n[n.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",n[n.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",n[n.VIEWPORT=2978]="VIEWPORT",n[n.SCISSOR_BOX=3088]="SCISSOR_BOX",n[n.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",n[n.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",n[n.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",n[n.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",n[n.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",n[n.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",n[n.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",n[n.RED_BITS=3410]="RED_BITS",n[n.GREEN_BITS=3411]="GREEN_BITS",n[n.BLUE_BITS=3412]="BLUE_BITS",n[n.ALPHA_BITS=3413]="ALPHA_BITS",n[n.DEPTH_BITS=3414]="DEPTH_BITS",n[n.STENCIL_BITS=3415]="STENCIL_BITS",n[n.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",n[n.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",n[n.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",n[n.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",n[n.SAMPLES=32937]="SAMPLES",n[n.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",n[n.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",n[n.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",n[n.DONT_CARE=4352]="DONT_CARE",n[n.FASTEST=4353]="FASTEST",n[n.NICEST=4354]="NICEST",n[n.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",n[n.BYTE=5120]="BYTE",n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.SHORT=5122]="SHORT",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.INT=5124]="INT",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.FLOAT=5126]="FLOAT",n[n.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",n[n.ALPHA=6406]="ALPHA",n[n.RGB=6407]="RGB",n[n.RGBA=6408]="RGBA",n[n.LUMINANCE=6409]="LUMINANCE",n[n.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",n[n.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",n[n.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",n[n.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",n[n.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",n[n.VERTEX_SHADER=35633]="VERTEX_SHADER",n[n.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",n[n.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",n[n.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",n[n.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",n[n.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",n[n.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",n[n.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",n[n.SHADER_TYPE=35663]="SHADER_TYPE",n[n.DELETE_STATUS=35712]="DELETE_STATUS",n[n.LINK_STATUS=35714]="LINK_STATUS",n[n.VALIDATE_STATUS=35715]="VALIDATE_STATUS",n[n.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",n[n.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",n[n.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",n[n.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",n[n.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",n[n.NEVER=512]="NEVER",n[n.LESS=513]="LESS",n[n.EQUAL=514]="EQUAL",n[n.LEQUAL=515]="LEQUAL",n[n.GREATER=516]="GREATER",n[n.NOTEQUAL=517]="NOTEQUAL",n[n.GEQUAL=518]="GEQUAL",n[n.ALWAYS=519]="ALWAYS",n[n.KEEP=7680]="KEEP",n[n.REPLACE=7681]="REPLACE",n[n.INCR=7682]="INCR",n[n.DECR=7683]="DECR",n[n.INVERT=5386]="INVERT",n[n.INCR_WRAP=34055]="INCR_WRAP",n[n.DECR_WRAP=34056]="DECR_WRAP",n[n.VENDOR=7936]="VENDOR",n[n.RENDERER=7937]="RENDERER",n[n.VERSION=7938]="VERSION",n[n.NEAREST=9728]="NEAREST",n[n.LINEAR=9729]="LINEAR",n[n.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",n[n.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",n[n.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",n[n.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",n[n.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",n[n.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",n[n.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",n[n.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",n[n.TEXTURE_2D=3553]="TEXTURE_2D",n[n.TEXTURE=5890]="TEXTURE",n[n.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",n[n.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",n[n.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",n[n.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",n[n.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",n[n.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",n[n.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",n[n.TEXTURE0=33984]="TEXTURE0",n[n.TEXTURE1=33985]="TEXTURE1",n[n.TEXTURE2=33986]="TEXTURE2",n[n.TEXTURE3=33987]="TEXTURE3",n[n.TEXTURE4=33988]="TEXTURE4",n[n.TEXTURE5=33989]="TEXTURE5",n[n.TEXTURE6=33990]="TEXTURE6",n[n.TEXTURE7=33991]="TEXTURE7",n[n.TEXTURE8=33992]="TEXTURE8",n[n.TEXTURE9=33993]="TEXTURE9",n[n.TEXTURE10=33994]="TEXTURE10",n[n.TEXTURE11=33995]="TEXTURE11",n[n.TEXTURE12=33996]="TEXTURE12",n[n.TEXTURE13=33997]="TEXTURE13",n[n.TEXTURE14=33998]="TEXTURE14",n[n.TEXTURE15=33999]="TEXTURE15",n[n.TEXTURE16=34e3]="TEXTURE16",n[n.TEXTURE17=34001]="TEXTURE17",n[n.TEXTURE18=34002]="TEXTURE18",n[n.TEXTURE19=34003]="TEXTURE19",n[n.TEXTURE20=34004]="TEXTURE20",n[n.TEXTURE21=34005]="TEXTURE21",n[n.TEXTURE22=34006]="TEXTURE22",n[n.TEXTURE23=34007]="TEXTURE23",n[n.TEXTURE24=34008]="TEXTURE24",n[n.TEXTURE25=34009]="TEXTURE25",n[n.TEXTURE26=34010]="TEXTURE26",n[n.TEXTURE27=34011]="TEXTURE27",n[n.TEXTURE28=34012]="TEXTURE28",n[n.TEXTURE29=34013]="TEXTURE29",n[n.TEXTURE30=34014]="TEXTURE30",n[n.TEXTURE31=34015]="TEXTURE31",n[n.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",n[n.REPEAT=10497]="REPEAT",n[n.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",n[n.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",n[n.FLOAT_VEC2=35664]="FLOAT_VEC2",n[n.FLOAT_VEC3=35665]="FLOAT_VEC3",n[n.FLOAT_VEC4=35666]="FLOAT_VEC4",n[n.INT_VEC2=35667]="INT_VEC2",n[n.INT_VEC3=35668]="INT_VEC3",n[n.INT_VEC4=35669]="INT_VEC4",n[n.BOOL=35670]="BOOL",n[n.BOOL_VEC2=35671]="BOOL_VEC2",n[n.BOOL_VEC3=35672]="BOOL_VEC3",n[n.BOOL_VEC4=35673]="BOOL_VEC4",n[n.FLOAT_MAT2=35674]="FLOAT_MAT2",n[n.FLOAT_MAT3=35675]="FLOAT_MAT3",n[n.FLOAT_MAT4=35676]="FLOAT_MAT4",n[n.SAMPLER_2D=35678]="SAMPLER_2D",n[n.SAMPLER_CUBE=35680]="SAMPLER_CUBE",n[n.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",n[n.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",n[n.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",n[n.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",n[n.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",n[n.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",n[n.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",n[n.COMPILE_STATUS=35713]="COMPILE_STATUS",n[n.LOW_FLOAT=36336]="LOW_FLOAT",n[n.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",n[n.HIGH_FLOAT=36338]="HIGH_FLOAT",n[n.LOW_INT=36339]="LOW_INT",n[n.MEDIUM_INT=36340]="MEDIUM_INT",n[n.HIGH_INT=36341]="HIGH_INT",n[n.FRAMEBUFFER=36160]="FRAMEBUFFER",n[n.RENDERBUFFER=36161]="RENDERBUFFER",n[n.RGBA4=32854]="RGBA4",n[n.RGB5_A1=32855]="RGB5_A1",n[n.RGB565=36194]="RGB565",n[n.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",n[n.STENCIL_INDEX=6401]="STENCIL_INDEX",n[n.STENCIL_INDEX8=36168]="STENCIL_INDEX8",n[n.DEPTH_STENCIL=34041]="DEPTH_STENCIL",n[n.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",n[n.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",n[n.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",n[n.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",n[n.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",n[n.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",n[n.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",n[n.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",n[n.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",n[n.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",n[n.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",n[n.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",n[n.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",n[n.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",n[n.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",n[n.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",n[n.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",n[n.NONE=0]="NONE",n[n.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",n[n.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",n[n.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",n[n.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",n[n.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",n[n.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",n[n.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",n[n.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",n[n.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",n[n.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",n[n.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",n[n.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",n[n.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",n[n.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",n[n.COPY_SRC=1]="COPY_SRC",n[n.COPY_DST=2]="COPY_DST",n[n.SAMPLED=4]="SAMPLED",n[n.STORAGE=8]="STORAGE",n[n.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(Qt||(Qt={}));var phr=function(){function n(){z0(this,n),this.config=void 0}return U0(n,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),n}();typeof navigator<"u"&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);var rN;(function(n){n.Void="Void",n.Boolean="Boolean",n.Float="Float",n.Uint32="Uint32",n.Int32="Int32",n.Vector="Vector",n.Vector2Float="vec2",n.Vector3Float="vec3",n.Vector4Float="vec4",n.Vector2Boolean="vec2",n.Vector3Boolean="vec3",n.Vector4Boolean="vec4",n.Vector2Uint="vec2",n.Vector3Uint="vec3",n.Vector4Uint="vec4",n.Vector2Int="vec2",n.Vector3Int="vec3",n.Vector4Int="vec4",n.Matrix="Matrix",n.Matrix3x3Float="mat3x3",n.Matrix4x4Float="mat4x4",n.Struct="Struct",n.FloatArray="Float[]",n.Vector4FloatArray="vec4[]"})(rN||(rN={}));var _Ee;(function(n){n.Program="Program",n.Identifier="Identifier",n.VariableDeclaration="VariableDeclaration",n.BlockStatement="BlockStatement",n.ReturnStatement="ReturnStatement",n.FunctionDeclaration="FunctionDeclaration",n.VariableDeclarator="VariableDeclarator",n.AssignmentExpression="AssignmentExpression",n.LogicalExpression="LogicalExpression",n.BinaryExpression="BinaryExpression",n.ArrayExpression="ArrayExpression",n.UnaryExpression="UnaryExpression",n.UpdateExpression="UpdateExpression",n.FunctionExpression="FunctionExpression",n.MemberExpression="MemberExpression",n.ConditionalExpression="ConditionalExpression",n.ExpressionStatement="ExpressionStatement",n.CallExpression="CallExpression",n.NumThreadStatement="NumThreadStatement",n.StorageStatement="StorageStatement",n.DoWhileStatement="DoWhileStatement",n.WhileStatement="WhileStatement",n.ForStatement="ForStatement",n.BreakStatement="BreakStatement",n.ContinueStatement="ContinueStatement",n.IfStatement="IfStatement",n.ImportedFunctionStatement="ImportedFunctionStatement"})(_Ee||(_Ee={}));var zM;(function(n){n.Input="Input",n.Output="Output",n.Uniform="Uniform",n.Workgroup="Workgroup",n.UniformConstant="UniformConstant",n.Image="Image",n.StorageBuffer="StorageBuffer",n.Private="Private",n.Function="Function"})(zM||(zM={}));var wR;(function(n){n.GLSL100="GLSL100",n.GLSL450="GLSL450",n.WGSL="WGSL"})(wR||(wR={}));var ghr="__DefineValuePlaceholder__";function yhr(){if(typeof document<"u")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function xEe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function SEe(n){for(var e=1;e0&&s[0]!==void 0?s[0]:1,!this.dirty){u.next=6;break}return this.compiledBundle.context&&(a>1?this.compiledBundle.context.maxIteration=a:this.compiledBundle.context.maxIteration++),u.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter(function(h){var c=h.isReferer;return c}).forEach(function(h){var c=h.data,f=h.name;i.model.confirmInput(c.model,f)}),o=0;o"u";case"symbol":return typeof K=="symbol"}}function f(K,ge,Pe){c(K,ge)||o("invalid parameter type"+l(Pe)+". expected "+ge+", got "+typeof K)}function d(K,ge){K>=0&&(K|0)===K||o("invalid parameter type, ("+K+")"+l(ge)+". must be a nonnegative integer")}function v(K,ge,Pe){ge.indexOf(K)<0&&o("invalid value"+l(Pe)+". must be one of: "+ge)}var p=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function g(K){Object.keys(K).forEach(function(ge){p.indexOf(ge)<0&&o('invalid regl constructor argument "'+ge+'". must be one of '+p)})}function m(K,ge){for(K=K+"";K.length0&&ge.push(new x("unknown",0,Pe))}}),ge}function T(K,ge){ge.forEach(function(Pe){var ct=K[Pe.file];if(ct){var Ot=ct.index[Pe.line];if(Ot){Ot.errors.push(Pe),ct.hasErrors=!0;return}}K.unknown.hasErrors=!0,K.unknown.lines[0].errors.push(Pe)})}function C(K,ge,Pe,ct,Ot){if(!K.getShaderParameter(ge,K.COMPILE_STATUS)){var lt=K.getShaderInfoLog(ge),xt=ct===K.FRAGMENT_SHADER?"fragment":"vertex";G(Pe,"string",xt+" shader source must be a string",Ot);var Kt=b(Pe,Ot),er=E(lt);T(Kt,er),Object.keys(Kt).forEach(function(lr){var tr=Kt[lr];if(!tr.hasErrors)return;var dr=[""],Er=[""];function Jt(pr,Ye){dr.push(pr),Er.push(Ye||"")}Jt("file number "+lr+": "+tr.name+` `,"color:red;text-decoration:underline;font-weight:bold"),tr.lines.forEach(function(pr){if(pr.errors.length>0){Jt(m(pr.number,4)+"| ","background-color:yellow; font-weight:bold"),Jt(pr.line+i,"color:red; background-color:yellow; font-weight:bold");var Ye=0;pr.errors.forEach(function(St){var or=St.message,Mr=/^\s*'(.*)'\s*:\s*(.*)$/.exec(or);if(Mr){var Wt=Mr[1];switch(or=Mr[2],Wt){case"assign":Wt="=";break}Ye=Math.max(pr.line.indexOf(Wt,Ye),0)}else Ye=0;Jt(m("| ",6)),Jt(m("^^^",Ye+3)+i,"font-weight:bold"),Jt(m("| ",6)),Jt(or+i,"font-weight:bold")}),Jt(m("| ",6)+i)}else Jt(m(pr.number,4)+"| "),Jt(pr.line+i,"color:red")}),typeof document<"u"&&!window.chrome?(Er[0]=dr.join("%c"),console.log.apply(console,Er)):console.log(dr.join(""))}),s.raise("Error compiling "+xt+" shader, "+Kt[0].name)}}function A(K,ge,Pe,ct,Ot){if(!K.getProgramParameter(ge,K.LINK_STATUS)){var lt=K.getProgramInfoLog(ge),xt=b(Pe,Ot),Kt=b(ct,Ot),er='Error linking program with vertex shader, "'+Kt[0].name+'", and fragment shader "'+xt[0].name+'"';typeof document<"u"?console.log("%c"+er+i+"%c"+lt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(er+i+lt),s.raise(er)}}function M(K){K._commandRef=S()}function I(K,ge,Pe,ct){M(K);function Ot(er){return er?ct.id(er):0}K._fragId=Ot(K.static.frag),K._vertId=Ot(K.static.vert);function lt(er,lr){Object.keys(lr).forEach(function(tr){er[ct.id(tr)]=!0})}var xt=K._uniformSet={};lt(xt,ge.static),lt(xt,ge.dynamic);var Kt=K._attributeSet={};lt(Kt,Pe.static),lt(Kt,Pe.dynamic),K._hasCount="count"in K.static||"count"in K.dynamic||"elements"in K.static||"elements"in K.dynamic}function R(K,ge){var Pe=w();o(K+" in command "+(ge||S())+(Pe==="unknown"?"":" called from "+Pe))}function k(K,ge,Pe){K||R(ge,Pe||S())}function D(K,ge,Pe,ct){K in ge||R("unknown parameter ("+K+")"+l(Pe)+". possible values: "+Object.keys(ge).join(),ct||S())}function G(K,ge,Pe,ct){c(K,ge)||R("invalid parameter type"+l(Pe)+". expected "+ge+", got "+typeof K,ct||S())}function W(K){K()}function z(K,ge,Pe){K.texture?v(K.texture._texture.internalformat,ge,"unsupported texture format for attachment"):v(K.renderbuffer._renderbuffer.format,Pe,"unsupported renderbuffer format for attachment")}var V=33071,q=9728,Y=9984,le=9985,j=9986,Q=9987,ie=5120,oe=5121,se=5122,me=5123,Ce=5124,Le=5125,re=5126,yt=32819,je=32820,st=33635,Nt=34042,Zt=36193,qe={};qe[ie]=qe[oe]=1,qe[se]=qe[me]=qe[Zt]=qe[st]=qe[yt]=qe[je]=2,qe[Ce]=qe[Le]=qe[re]=qe[Nt]=4;function ur(K,ge){return K===je||K===yt||K===st?2:K===Nt?4:qe[K]*ge}function Dt(K){return!(K&K-1)&&!!K}function ft(K,ge,Pe){var ct,Ot=ge.width,lt=ge.height,xt=ge.channels;s(Ot>0&&Ot<=Pe.maxTextureSize&<>0&<<=Pe.maxTextureSize,"invalid texture shape"),(K.wrapS!==V||K.wrapT!==V)&&s(Dt(Ot)&&Dt(lt),"incompatible wrap mode for texture, both width and height must be power of 2"),ge.mipmask===1?Ot!==1&<!==1&&s(K.minFilter!==Y&&K.minFilter!==j&&K.minFilter!==le&&K.minFilter!==Q,"min filter requires mipmap"):(s(Dt(Ot)&&Dt(lt),"texture must be a square power of 2 to support mipmapping"),s(ge.mipmask===(Ot<<1)-1,"missing or incomplete mipmap data")),ge.type===re&&(Pe.extensions.indexOf("oes_texture_float_linear")<0&&s(K.minFilter===q&&K.magFilter===q,"filter not supported, must enable oes_texture_float_linear"),s(!K.genMipmaps,"mipmap generation not supported with float textures"));var Kt=ge.images;for(ct=0;ct<16;++ct)if(Kt[ct]){var er=Ot>>ct,lr=lt>>ct;s(ge.mipmask&1<0&&Ot<=ct.maxTextureSize&<>0&<<=ct.maxTextureSize,"invalid texture shape"),s(Ot===lt,"cube map must be square"),s(ge.wrapS===V&&ge.wrapT===V,"wrap mode not supported by cube map");for(var Kt=0;Kt>tr,Jt=lt>>tr;s(er.mipmask&1<1&&ge===Pe&&(ge==='"'||ge==="'"))return['"'+wt(K.substr(1,K.length-2))+'"'];var ct=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(K);if(ct)return pt(K.substr(0,ct.index)).concat(pt(ct[1])).concat(pt(K.substr(ct.index+ct[0].length)));var Ot=K.split(".");if(Ot.length===1)return['"'+wt(K)+'"'];for(var lt=[],xt=0;xtSr(Pe,ge+"["+ct+"]")));if(K instanceof mt)return K;J(!1,"invalid option type in uniform "+ge)}var jr={DynamicVariable:mt,define:kt,isDynamic:Dr,unbox:Sr,accessor:ar},pn={next:typeof requestAnimationFrame=="function"?function(K){return requestAnimationFrame(K)}:function(K){return setTimeout(K,16)},cancel:typeof cancelAnimationFrame=="function"?function(K){return cancelAnimationFrame(K)}:clearTimeout},Jn=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function Rn(){var K={"":0},ge=[""];return{id:function(Pe){var ct=K[Pe];return ct||(ct=K[Pe]=ge.length,ge.push(Pe),ct)},str:function(Pe){return ge[Pe]}}}function hi(K,ge,Pe){var ct=document.createElement("canvas");r(ct.style,{border:0,margin:0,padding:0,top:0,left:0}),K.appendChild(ct),K===document.body&&(ct.style.position="absolute",r(K.style,{margin:0,padding:0}));function Ot(){var Kt=window.innerWidth,er=window.innerHeight;if(K!==document.body){var lr=K.getBoundingClientRect();Kt=lr.right-lr.left,er=lr.bottom-lr.top}ct.width=Pe*Kt,ct.height=Pe*er,r(ct.style,{width:Kt+"px",height:er+"px"})}var lt;K!==document.body&&typeof ResizeObserver=="function"?(lt=new ResizeObserver(function(){setTimeout(Ot)}),lt.observe(K)):window.addEventListener("resize",Ot,!1);function xt(){lt?lt.disconnect():window.removeEventListener("resize",Ot),K.removeChild(ct)}return Ot(),{canvas:ct,onDestroy:xt}}function yn(K,ge){function Pe(ct){try{return K.getContext(ct,ge)}catch{return null}}return Pe("webgl")||Pe("experimental-webgl")||Pe("webgl-experimental")}function Oi(K){return typeof K.nodeName=="string"&&typeof K.appendChild=="function"&&typeof K.getBoundingClientRect=="function"}function oi(K){return typeof K.drawArrays=="function"||typeof K.drawElements=="function"}function Gi(K){return typeof K=="string"?K.split():(J(Array.isArray(K),"invalid extension array"),K)}function ws(K){return typeof K=="string"?(J(typeof document<"u","not supported outside of DOM"),document.querySelector(K)):K}function Sl(K){var ge=K||{},Pe,ct,Ot,lt,xt={},Kt=[],er=[],lr=typeof window>"u"?1:window.devicePixelRatio,tr=!1,dr=function(pr){pr&&J.raise(pr)},Er=function(){};if(typeof ge=="string"?(J(typeof document<"u","selector queries only supported in DOM enviroments"),Pe=document.querySelector(ge),J(Pe,"invalid query string for element")):typeof ge=="object"?Oi(ge)?Pe=ge:oi(ge)?(lt=ge,Ot=lt.canvas):(J.constructor(ge),"gl"in ge?lt=ge.gl:"canvas"in ge?Ot=ws(ge.canvas):"container"in ge&&(ct=ws(ge.container)),"attributes"in ge&&(xt=ge.attributes,J.type(xt,"object","invalid context attributes")),"extensions"in ge&&(Kt=Gi(ge.extensions)),"optionalExtensions"in ge&&(er=Gi(ge.optionalExtensions)),"onDone"in ge&&(J.type(ge.onDone,"function","invalid or missing onDone callback"),dr=ge.onDone),"profile"in ge&&(tr=!!ge.profile),"pixelRatio"in ge&&(lr=+ge.pixelRatio,J(lr>0,"invalid pixel ratio"))):J.raise("invalid arguments to regl"),Pe&&(Pe.nodeName.toLowerCase()==="canvas"?Ot=Pe:ct=Pe),!lt){if(!Ot){J(typeof document<"u","must manually specify webgl context outside of DOM environments");var Jt=hi(ct||document.body,dr,lr);if(!Jt)return null;Ot=Jt.canvas,Er=Jt.onDestroy}xt.premultipliedAlpha===void 0&&(xt.premultipliedAlpha=!0),lt=yn(Ot,xt)}return lt?{gl:lt,canvas:Ot,container:ct,extensions:Kt,optionalExtensions:er,pixelRatio:lr,profile:tr,onDone:dr,onDestroy:Er}:(Er(),dr("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Os(K,ge){var Pe={};function ct(xt){J.type(xt,"string","extension name must be string");var Kt=xt.toLowerCase(),er;try{er=Pe[Kt]=K.getExtension(Kt)}catch{}return!!er}for(var Ot=0;Ot65535)<<4,K>>>=ge,Pe=(K>255)<<3,K>>>=Pe,ge|=Pe,Pe=(K>15)<<2,K>>>=Pe,ge|=Pe,Pe=(K>3)<<1,K>>>=Pe,ge|=Pe,ge|K>>1}function xe(){var K=no(8,function(){return[]});function ge(lt){var xt=mo(lt),Kt=K[ue(xt)>>2];return Kt.length>0?Kt.pop():new ArrayBuffer(xt)}function Pe(lt){K[ue(lt.byteLength)>>2].push(lt)}function ct(lt,xt){var Kt=null;switch(lt){case vo:Kt=new Int8Array(ge(xt),0,xt);break;case No:Kt=new Uint8Array(ge(xt),0,xt);break;case Jo:Kt=new Int16Array(ge(2*xt),0,xt);break;case Lo:Kt=new Uint16Array(ge(2*xt),0,xt);break;case hs:Kt=new Int32Array(ge(4*xt),0,xt);break;case Rs:Kt=new Uint32Array(ge(4*xt),0,xt);break;case Pn:Kt=new Float32Array(ge(4*xt),0,xt);break;default:return null}return Kt.length!==xt?Kt.subarray(0,xt):Kt}function Ot(lt){Pe(lt.buffer)}return{alloc:ge,free:Pe,allocType:ct,freeType:Ot}}var ce=xe();ce.zero=xe();var pe=3408,we=3410,Me=3411,nt=3412,It=3413,ot=3414,ht=3415,ut=33901,qt=33902,fr=3379,Wr=3386,gr=34921,Ar=36347,$n=36348,bi=35661,qa=35660,Qo=34930,Ds=36349,af=34076,mh=34024,Zl=7936,jd=7937,Nl=7938,ec=35724,js=34047,fg=36063,dg=34852,Xd=3553,Yd=34067,vg=34069,qf=33984,Zf=6408,pg=5126,Kf=5121,of=36160,X0=36053,Y0=36064,Kl=16384,sf=function(K,ge){var Pe=1;ge.ext_texture_filter_anisotropic&&(Pe=K.getParameter(js));var ct=1,Ot=1;ge.webgl_draw_buffers&&(ct=K.getParameter(dg),Ot=K.getParameter(fg));var lt=!!ge.oes_texture_float;if(lt){var xt=K.createTexture();K.bindTexture(Xd,xt),K.texImage2D(Xd,0,Zf,1,1,0,Zf,pg,null);var Kt=K.createFramebuffer();if(K.bindFramebuffer(of,Kt),K.framebufferTexture2D(of,Y0,Xd,xt,0),K.bindTexture(Xd,null),K.checkFramebufferStatus(of)!==X0)lt=!1;else{K.viewport(0,0,1,1),K.clearColor(1,0,0,1),K.clear(Kl);var er=ce.allocType(pg,4);K.readPixels(0,0,1,1,Zf,pg,er),K.getError()?lt=!1:(K.deleteFramebuffer(Kt),K.deleteTexture(xt),lt=er[0]===1),ce.freeType(er)}}var lr=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),tr=!0;if(!lr){var dr=K.createTexture(),Er=ce.allocType(Kf,36);K.activeTexture(qf),K.bindTexture(Yd,dr),K.texImage2D(vg,0,Zf,3,3,0,Zf,Kf,Er),ce.freeType(Er),K.bindTexture(Yd,null),K.deleteTexture(dr),tr=!K.getError()}return{colorBits:[K.getParameter(we),K.getParameter(Me),K.getParameter(nt),K.getParameter(It)],depthBits:K.getParameter(ot),stencilBits:K.getParameter(ht),subpixelBits:K.getParameter(pe),extensions:Object.keys(ge).filter(function(Jt){return!!ge[Jt]}),maxAnisotropic:Pe,maxDrawbuffers:ct,maxColorAttachments:Ot,pointSizeDims:K.getParameter(ut),lineWidthDims:K.getParameter(qt),maxViewportDims:K.getParameter(Wr),maxCombinedTextureUnits:K.getParameter(bi),maxCubeMapSize:K.getParameter(af),maxRenderbufferSize:K.getParameter(mh),maxTextureUnits:K.getParameter(Qo),maxTextureSize:K.getParameter(fr),maxAttributes:K.getParameter(gr),maxVertexUniforms:K.getParameter(Ar),maxVertexTextureUnits:K.getParameter(qa),maxVaryingVectors:K.getParameter($n),maxFragmentUniforms:K.getParameter(Ds),glsl:K.getParameter(ec),renderer:K.getParameter(jd),vendor:K.getParameter(Zl),version:K.getParameter(Nl),readFloat:lt,npotTextureCube:tr}};function mu(K){return!!K&&typeof K=="object"&&Array.isArray(K.shape)&&Array.isArray(K.stride)&&typeof K.offset=="number"&&K.shape.length===K.stride.length&&(Array.isArray(K.data)||t(K.data))}var bs=function(K){return Object.keys(K).map(function(ge){return K[ge]})},lf={shape:tc,flatten:q0};function gg(K,ge,Pe){for(var ct=0;ct0){var yr;if(Array.isArray(St[0])){Xt=_g(St);for(var jt=1,mr=1;mr0)if(typeof jt[0]=="number"){var Tr=ce.allocType(Wt.dtype,jt.length);U(Tr,jt),Xt(Tr,cn),ce.freeType(Tr)}else if(Array.isArray(jt[0])||t(jt[0])){Hn=_g(jt);var hr=$v(jt,Hn,Wt.dtype);Xt(hr,cn),ce.freeType(hr)}else J.raise("invalid buffer data")}else if(mu(jt)){Hn=jt.shape;var Ut=jt.stride,Nn=0,ci=0,Ur=0,Ei=0;Hn.length===1?(Nn=Hn[0],ci=1,Ur=Ut[0],Ei=0):Hn.length===2?(Nn=Hn[0],ci=Hn[1],Ur=Ut[0],Ei=Ut[1]):J.raise("invalid shape");var Xn=Array.isArray(jt.data)?Wt.dtype:N(jt.data),xi=ce.allocType(Xn,Nn*ci);X(xi,jt.data,Nn,ci,Ur,Ei,jt.offset),Xt(xi,cn),ce.freeType(xi)}else J.raise("invalid data for buffer subdata");return Nr}return or||Nr(Ye),Nr._reglType="buffer",Nr._buffer=Wt,Nr.subdata=yr,Pe.profile&&(Nr.stats=Wt.stats),Nr.destroy=function(){Er(Wt)},Nr}function pr(){bs(lt).forEach(function(Ye){Ye.buffer=K.createBuffer(),K.bindBuffer(Ye.type,Ye.buffer),K.bufferData(Ye.type,Ye.persistentData||Ye.byteLength,Ye.usage)})}return Pe.profile&&(ge.getTotalBufferSize=function(){var Ye=0;return Object.keys(lt).forEach(function(St){Ye+=lt[St].stats.size}),Ye}),{create:Jt,createStream:er,destroyStream:lr,clear:function(){bs(lt).forEach(Er),Kt.forEach(Er)},getBuffer:function(Ye){return Ye&&Ye._buffer instanceof xt?Ye._buffer:null},restore:pr,_initBuffer:dr}}var Ae=0,Re=0,Be=1,Je=1,Xe=4,_t=4,rt={points:Ae,point:Re,lines:Be,line:Je,triangles:Xe,triangle:_t,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ht=0,Yt=1,ne=4,ye=5120,Ue=5121,Bt=5122,$t=5123,ee=5124,Se=5125,Ze=34963,Ct=35040,vr=35044;function Cr(K,ge,Pe,ct){var Ot={},lt=0,xt={uint8:Ue,uint16:$t};ge.oes_element_index_uint&&(xt.uint32=Se);function Kt(pr){this.id=lt++,Ot[this.id]=this,this.buffer=pr,this.primType=ne,this.vertCount=0,this.type=0}Kt.prototype.bind=function(){this.buffer.bind()};var er=[];function lr(pr){var Ye=er.pop();return Ye||(Ye=new Kt(Pe.create(null,Ze,!0,!1)._buffer)),dr(Ye,pr,Ct,-1,-1,0,0),Ye}function tr(pr){er.push(pr)}function dr(pr,Ye,St,or,Mr,Wt,Nr){pr.buffer.bind();var Xt;if(Ye){var yr=Nr;!Nr&&(!t(Ye)||mu(Ye)&&!t(Ye.data))&&(yr=ge.oes_element_index_uint?Se:$t),Pe._initBuffer(pr.buffer,Ye,St,yr,3)}else K.bufferData(Ze,Wt,St),pr.buffer.dtype=Xt||Ue,pr.buffer.usage=St,pr.buffer.dimension=3,pr.buffer.byteLength=Wt;if(Xt=Nr,!Nr){switch(pr.buffer.dtype){case Ue:case ye:Xt=Ue;break;case $t:case Bt:Xt=$t;break;case Se:case ee:Xt=Se;break;default:J.raise("unsupported type for element array")}pr.buffer.dtype=Xt}pr.type=Xt,J(Xt!==Se||!!ge.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var jt=Mr;jt<0&&(jt=pr.buffer.byteLength,Xt===$t?jt>>=1:Xt===Se&&(jt>>=2)),pr.vertCount=jt;var mr=or;if(or<0){mr=ne;var cn=pr.buffer.dimension;cn===1&&(mr=Ht),cn===2&&(mr=Yt),cn===3&&(mr=ne)}pr.primType=mr}function Er(pr){ct.elementsCount--,J(pr.buffer!==null,"must not double destroy elements"),delete Ot[pr.id],pr.buffer.destroy(),pr.buffer=null}function Jt(pr,Ye){var St=Pe.create(null,Ze,!0),or=new Kt(St._buffer);ct.elementsCount++;function Mr(Wt){if(!Wt)St(),or.primType=ne,or.vertCount=0,or.type=Ue;else if(typeof Wt=="number")St(Wt),or.primType=ne,or.vertCount=Wt|0,or.type=Ue;else{var Nr=null,Xt=vr,yr=-1,jt=-1,mr=0,cn=0;Array.isArray(Wt)||t(Wt)||mu(Wt)?Nr=Wt:(J.type(Wt,"object","invalid arguments for elements"),"data"in Wt&&(Nr=Wt.data,J(Array.isArray(Nr)||t(Nr)||mu(Nr),"invalid data for element buffer")),"usage"in Wt&&(J.parameter(Wt.usage,_u,"invalid element buffer usage"),Xt=_u[Wt.usage]),"primitive"in Wt&&(J.parameter(Wt.primitive,rt,"invalid element buffer primitive"),yr=rt[Wt.primitive]),"count"in Wt&&(J(typeof Wt.count=="number"&&Wt.count>=0,"invalid vertex count for elements"),jt=Wt.count|0),"type"in Wt&&(J.parameter(Wt.type,xt,"invalid buffer type"),cn=xt[Wt.type]),"length"in Wt?mr=Wt.length|0:(mr=jt,cn===$t||cn===Bt?mr*=2:(cn===Se||cn===ee)&&(mr*=4))),dr(or,Nr,Xt,yr,jt,mr,cn)}return Mr}return Mr(pr),Mr._reglType="elements",Mr._elements=or,Mr.subdata=function(Wt,Nr){return St.subdata(Wt,Nr),Mr},Mr.destroy=function(){Er(or)},Mr}return{create:Jt,createStream:lr,destroyStream:tr,getElements:function(pr){return typeof pr=="function"&&pr._elements instanceof Kt?pr._elements:null},clear:function(){bs(Ot).forEach(Er)}}}var Jr=new Float32Array(1),nn=new Uint32Array(Jr.buffer),Dn=5123;function si(K){for(var ge=ce.allocType(Dn,K.length),Pe=0;Pe>>31<<15,lt=(ct<<1>>>24)-127,xt=ct>>13&(1<<10)-1;if(lt<-24)ge[Pe]=Ot;else if(lt<-14){var Kt=-14-lt;ge[Pe]=Ot+(xt+(1<<10)>>Kt)}else lt>15?ge[Pe]=Ot+31744:ge[Pe]=Ot+(lt+15<<10)+xt}return ge}function An(K){return Array.isArray(K)||t(K)}var qi=function(K){return!(K&K-1)&&!!K},_o=34467,cs=3553,wl=34067,xu=34069,fa=6408,Ft=6406,nr=6407,Wn=6409,Zi=6410,Ts=32854,ko=32855,Fo=36194,Su=32819,Jf=32820,xg=33635,sF=34042,Y$=6402,lF=34041,q$=35904,Z$=35906,CT=36193,K$=33776,J$=33777,Q$=33778,eW=33779,Zce=35986,Kce=35987,Jce=34798,Qce=35840,efe=35841,tfe=35842,rfe=35843,nfe=36196,AT=5121,tW=5123,rW=5125,ML=5126,WQe=10242,HQe=10243,jQe=10497,nW=33071,XQe=33648,YQe=10240,qQe=10241,iW=9728,ZQe=9729,aW=9984,ife=9985,afe=9986,oW=9987,KQe=33170,uF=4352,JQe=4353,QQe=4354,eet=34046,tet=3317,ret=37440,net=37441,iet=37443,ofe=37444,IL=33984,aet=[aW,afe,ife,oW],hF=[0,Wn,Zi,nr,fa],Wv={};Wv[Wn]=Wv[Ft]=Wv[Y$]=1,Wv[lF]=Wv[Zi]=2,Wv[nr]=Wv[q$]=3,Wv[fa]=Wv[Z$]=4;function MT(K){return"[object "+K+"]"}var sfe=MT("HTMLCanvasElement"),lfe=MT("OffscreenCanvas"),ufe=MT("CanvasRenderingContext2D"),hfe=MT("ImageBitmap"),cfe=MT("HTMLImageElement"),ffe=MT("HTMLVideoElement"),oet=Object.keys(Xs).concat([sfe,lfe,ufe,hfe,cfe,ffe]),IT=[];IT[AT]=1,IT[ML]=4,IT[CT]=2,IT[tW]=2,IT[rW]=4;var xh=[];xh[Ts]=2,xh[ko]=2,xh[Fo]=2,xh[lF]=4,xh[K$]=.5,xh[J$]=.5,xh[Q$]=1,xh[eW]=1,xh[Zce]=.5,xh[Kce]=1,xh[Jce]=1,xh[Qce]=.5,xh[efe]=.25,xh[tfe]=.5,xh[rfe]=.25,xh[nfe]=.5;function dfe(K){return Array.isArray(K)&&(K.length===0||typeof K[0]=="number")}function vfe(K){if(!Array.isArray(K))return!1;var ge=K.length;return!(ge===0||!An(K[0]))}function Nw(K){return Object.prototype.toString.call(K)}function pfe(K){return Nw(K)===sfe}function gfe(K){return Nw(K)===lfe}function set(K){return Nw(K)===ufe}function uet(K){return Nw(K)===hfe}function het(K){return Nw(K)===cfe}function cet(K){return Nw(K)===ffe}function sW(K){if(!K)return!1;var ge=Nw(K);return oet.indexOf(ge)>=0?!0:dfe(K)||vfe(K)||mu(K)}function yfe(K){return Xs[Object.prototype.toString.call(K)]|0}function fet(K,ge){var Pe=ge.length;switch(K.type){case AT:case tW:case rW:case ML:var ct=ce.allocType(K.type,Pe);ct.set(ge),K.data=ct;break;case CT:K.data=si(ge);break;default:J.raise("unsupported texture type, must specify a typed array")}}function mfe(K,ge){return ce.allocType(K.type===CT?ML:K.type,ge)}function _fe(K,ge){K.type===CT?(K.data=si(ge),ce.freeType(ge)):K.data=ge}function det(K,ge,Pe,ct,Ot,lt){for(var xt=K.width,Kt=K.height,er=K.channels,lr=xt*Kt*er,tr=mfe(K,lr),dr=0,Er=0;Er=1;)Kt+=xt*er*er,er/=2;return Kt}else return xt*Pe*ct}function vet(K,ge,Pe,ct,Ot,lt,xt){var Kt={"don't care":uF,"dont care":uF,nice:QQe,fast:JQe},er={repeat:jQe,clamp:nW,mirror:XQe},lr={nearest:iW,linear:ZQe},tr=r({mipmap:oW,"nearest mipmap nearest":aW,"linear mipmap nearest":ife,"nearest mipmap linear":afe,"linear mipmap linear":oW},lr),dr={none:0,browser:ofe},Er={uint8:AT,rgba4:Su,rgb565:xg,"rgb5 a1":Jf},Jt={alpha:Ft,luminance:Wn,"luminance alpha":Zi,rgb:nr,rgba:fa,rgba4:Ts,"rgb5 a1":ko,rgb565:Fo},pr={};ge.ext_srgb&&(Jt.srgb=q$,Jt.srgba=Z$),ge.oes_texture_float&&(Er.float32=Er.float=ML),ge.oes_texture_half_float&&(Er.float16=Er["half float"]=CT),ge.webgl_depth_texture&&(r(Jt,{depth:Y$,"depth stencil":lF}),r(Er,{uint16:tW,uint32:rW,"depth stencil":sF})),ge.webgl_compressed_texture_s3tc&&r(pr,{"rgb s3tc dxt1":K$,"rgba s3tc dxt1":J$,"rgba s3tc dxt3":Q$,"rgba s3tc dxt5":eW}),ge.webgl_compressed_texture_atc&&r(pr,{"rgb atc":Zce,"rgba atc explicit alpha":Kce,"rgba atc interpolated alpha":Jce}),ge.webgl_compressed_texture_pvrtc&&r(pr,{"rgb pvrtc 4bppv1":Qce,"rgb pvrtc 2bppv1":efe,"rgba pvrtc 4bppv1":tfe,"rgba pvrtc 2bppv1":rfe}),ge.webgl_compressed_texture_etc1&&(pr["rgb etc1"]=nfe);var Ye=Array.prototype.slice.call(K.getParameter(_o));Object.keys(pr).forEach(function(Ie){var vt=pr[Ie];Ye.indexOf(vt)>=0&&(Jt[Ie]=vt)});var St=Object.keys(Jt);Pe.textureFormats=St;var or=[];Object.keys(Jt).forEach(function(Ie){var vt=Jt[Ie];or[vt]=Ie});var Mr=[];Object.keys(Er).forEach(function(Ie){var vt=Er[Ie];Mr[vt]=Ie});var Wt=[];Object.keys(lr).forEach(function(Ie){var vt=lr[Ie];Wt[vt]=Ie});var Nr=[];Object.keys(tr).forEach(function(Ie){var vt=tr[Ie];Nr[vt]=Ie});var Xt=[];Object.keys(er).forEach(function(Ie){var vt=er[Ie];Xt[vt]=Ie});var yr=St.reduce(function(Ie,vt){var it=Jt[vt];return it===Wn||it===Ft||it===Wn||it===Zi||it===Y$||it===lF||ge.ext_srgb&&(it===q$||it===Z$)?Ie[it]=it:it===ko||vt.indexOf("rgba")>=0?Ie[it]=fa:Ie[it]=nr,Ie},{});function jt(){this.internalformat=fa,this.format=fa,this.type=AT,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=ofe,this.width=0,this.height=0,this.channels=0}function mr(Ie,vt){Ie.internalformat=vt.internalformat,Ie.format=vt.format,Ie.type=vt.type,Ie.compressed=vt.compressed,Ie.premultiplyAlpha=vt.premultiplyAlpha,Ie.flipY=vt.flipY,Ie.unpackAlignment=vt.unpackAlignment,Ie.colorSpace=vt.colorSpace,Ie.width=vt.width,Ie.height=vt.height,Ie.channels=vt.channels}function cn(Ie,vt){if(!(typeof vt!="object"||!vt)){if("premultiplyAlpha"in vt&&(J.type(vt.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),Ie.premultiplyAlpha=vt.premultiplyAlpha),"flipY"in vt&&(J.type(vt.flipY,"boolean","invalid texture flip"),Ie.flipY=vt.flipY),"alignment"in vt&&(J.oneOf(vt.alignment,[1,2,4,8],"invalid texture unpack alignment"),Ie.unpackAlignment=vt.alignment),"colorSpace"in vt&&(J.parameter(vt.colorSpace,dr,"invalid colorSpace"),Ie.colorSpace=dr[vt.colorSpace]),"type"in vt){var it=vt.type;J(ge.oes_texture_float||!(it==="float"||it==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),J(ge.oes_texture_half_float||!(it==="half float"||it==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),J(ge.webgl_depth_texture||!(it==="uint16"||it==="uint32"||it==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),J.parameter(it,Er,"invalid texture type"),Ie.type=Er[it]}var Br=Ie.width,Ti=Ie.height,be=Ie.channels,de=!1;"shape"in vt?(J(Array.isArray(vt.shape)&&vt.shape.length>=2,"shape must be an array"),Br=vt.shape[0],Ti=vt.shape[1],vt.shape.length===3&&(be=vt.shape[2],J(be>0&&be<=4,"invalid number of channels"),de=!0),J(Br>=0&&Br<=Pe.maxTextureSize,"invalid width"),J(Ti>=0&&Ti<=Pe.maxTextureSize,"invalid height")):("radius"in vt&&(Br=Ti=vt.radius,J(Br>=0&&Br<=Pe.maxTextureSize,"invalid radius")),"width"in vt&&(Br=vt.width,J(Br>=0&&Br<=Pe.maxTextureSize,"invalid width")),"height"in vt&&(Ti=vt.height,J(Ti>=0&&Ti<=Pe.maxTextureSize,"invalid height")),"channels"in vt&&(be=vt.channels,J(be>0&&be<=4,"invalid number of channels"),de=!0)),Ie.width=Br|0,Ie.height=Ti|0,Ie.channels=be|0;var Ne=!1;if("format"in vt){var He=vt.format;J(ge.webgl_depth_texture||!(He==="depth"||He==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),J.parameter(He,Jt,"invalid texture format");var Ke=Ie.internalformat=Jt[He];Ie.format=yr[Ke],He in Er&&("type"in vt||(Ie.type=Er[He])),He in pr&&(Ie.compressed=!0),Ne=!0}!de&&Ne?Ie.channels=Wv[Ie.format]:de&&!Ne?Ie.channels!==hF[Ie.format]&&(Ie.format=Ie.internalformat=hF[Ie.channels]):Ne&&de&&J(Ie.channels===Wv[Ie.format],"number of channels inconsistent with specified format")}}function Hn(Ie){K.pixelStorei(ret,Ie.flipY),K.pixelStorei(net,Ie.premultiplyAlpha),K.pixelStorei(iet,Ie.colorSpace),K.pixelStorei(tet,Ie.unpackAlignment)}function Tr(){jt.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function hr(Ie,vt){var it=null;if(sW(vt)?it=vt:vt&&(J.type(vt,"object","invalid pixel data type"),cn(Ie,vt),"x"in vt&&(Ie.xOffset=vt.x|0),"y"in vt&&(Ie.yOffset=vt.y|0),sW(vt.data)&&(it=vt.data)),J(!Ie.compressed||it instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),vt.copy){J(!it,"can not specify copy and data field for the same texture");var Br=Ot.viewportWidth,Ti=Ot.viewportHeight;Ie.width=Ie.width||Br-Ie.xOffset,Ie.height=Ie.height||Ti-Ie.yOffset,Ie.needsCopy=!0,J(Ie.xOffset>=0&&Ie.xOffset=0&&Ie.yOffset0&&Ie.width<=Br&&Ie.height>0&&Ie.height<=Ti,"copy texture read out of bounds")}else if(!it)Ie.width=Ie.width||1,Ie.height=Ie.height||1,Ie.channels=Ie.channels||4;else if(t(it))Ie.channels=Ie.channels||4,Ie.data=it,!("type"in vt)&&Ie.type===AT&&(Ie.type=yfe(it));else if(dfe(it))Ie.channels=Ie.channels||4,fet(Ie,it),Ie.alignment=1,Ie.needsFree=!0;else if(mu(it)){var be=it.data;!Array.isArray(be)&&Ie.type===AT&&(Ie.type=yfe(be));var de=it.shape,Ne=it.stride,He,Ke,Ge,Fe,ze,Ee;de.length===3?(Ge=de[2],Ee=Ne[2]):(J(de.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Ge=1,Ee=1),He=de[0],Ke=de[1],Fe=Ne[0],ze=Ne[1],Ie.alignment=1,Ie.width=He,Ie.height=Ke,Ie.channels=Ge,Ie.format=Ie.internalformat=hF[Ge],Ie.needsFree=!0,det(Ie,be,Fe,ze,Ee,it.offset)}else if(pfe(it)||gfe(it)||set(it))pfe(it)||gfe(it)?Ie.element=it:Ie.element=it.canvas,Ie.width=Ie.element.width,Ie.height=Ie.element.height,Ie.channels=4;else if(uet(it))Ie.element=it,Ie.width=it.width,Ie.height=it.height,Ie.channels=4;else if(het(it))Ie.element=it,Ie.width=it.naturalWidth,Ie.height=it.naturalHeight,Ie.channels=4;else if(cet(it))Ie.element=it,Ie.width=it.videoWidth,Ie.height=it.videoHeight,Ie.channels=4;else if(vfe(it)){var De=Ie.width||it[0].length,_e=Ie.height||it.length,Ve=Ie.channels;An(it[0][0])?Ve=Ve||it[0][0].length:Ve=Ve||1;for(var et=lf.shape(it),Lt=1,Rt=0;Rt=0,"oes_texture_float extension not enabled"):Ie.type===CT&&J(Pe.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Ut(Ie,vt,it){var Br=Ie.element,Ti=Ie.data,be=Ie.internalformat,de=Ie.format,Ne=Ie.type,He=Ie.width,Ke=Ie.height;Hn(Ie),Br?K.texImage2D(vt,it,de,de,Ne,Br):Ie.compressed?K.compressedTexImage2D(vt,it,be,He,Ke,0,Ti):Ie.needsCopy?(ct(),K.copyTexImage2D(vt,it,de,Ie.xOffset,Ie.yOffset,He,Ke,0)):K.texImage2D(vt,it,de,He,Ke,0,de,Ne,Ti||null)}function Nn(Ie,vt,it,Br,Ti){var be=Ie.element,de=Ie.data,Ne=Ie.internalformat,He=Ie.format,Ke=Ie.type,Ge=Ie.width,Fe=Ie.height;Hn(Ie),be?K.texSubImage2D(vt,Ti,it,Br,He,Ke,be):Ie.compressed?K.compressedTexSubImage2D(vt,Ti,it,Br,Ne,Ge,Fe,de):Ie.needsCopy?(ct(),K.copyTexSubImage2D(vt,Ti,it,Br,Ie.xOffset,Ie.yOffset,Ge,Fe)):K.texSubImage2D(vt,Ti,it,Br,Ge,Fe,He,Ke,de)}var ci=[];function Ur(){return ci.pop()||new Tr}function Ei(Ie){Ie.needsFree&&ce.freeType(Ie.data),Tr.call(Ie),ci.push(Ie)}function Xn(){jt.call(this),this.genMipmaps=!1,this.mipmapHint=uF,this.mipmask=0,this.images=Array(16)}function xi(Ie,vt,it){var Br=Ie.images[0]=Ur();Ie.mipmask=1,Br.width=Ie.width=vt,Br.height=Ie.height=it,Br.channels=Ie.channels=4}function Wa(Ie,vt){var it=null;if(sW(vt))it=Ie.images[0]=Ur(),mr(it,Ie),hr(it,vt),Ie.mipmask=1;else if(cn(Ie,vt),Array.isArray(vt.mipmap))for(var Br=vt.mipmap,Ti=0;Ti>=Ti,it.height>>=Ti,hr(it,Br[Ti]),Ie.mipmask|=1<=0&&!("faces"in vt)&&(Ie.genMipmaps=!0)}if("mag"in vt){var Br=vt.mag;J.parameter(Br,lr),Ie.magFilter=lr[Br]}var Ti=Ie.wrapS,be=Ie.wrapT;if("wrap"in vt){var de=vt.wrap;typeof de=="string"?(J.parameter(de,er),Ti=be=er[de]):Array.isArray(de)&&(J.parameter(de[0],er),J.parameter(de[1],er),Ti=er[de[0]],be=er[de[1]])}else{if("wrapS"in vt){var Ne=vt.wrapS;J.parameter(Ne,er),Ti=er[Ne]}if("wrapT"in vt){var He=vt.wrapT;J.parameter(He,er),be=er[He]}}if(Ie.wrapS=Ti,Ie.wrapT=be,"anisotropic"in vt){var Ke=vt.anisotropic;J(typeof Ke=="number"&&Ke>=1&&Ke<=Pe.maxAnisotropic,"aniso samples must be between 1 and "),Ie.anisotropic=vt.anisotropic}if("mipmap"in vt){var Ge=!1;switch(typeof vt.mipmap){case"string":J.parameter(vt.mipmap,Kt,"invalid mipmap hint"),Ie.mipmapHint=Kt[vt.mipmap],Ie.genMipmaps=!0,Ge=!0;break;case"boolean":Ge=Ie.genMipmaps=vt.mipmap;break;case"object":J(Array.isArray(vt.mipmap),"invalid mipmap type"),Ie.genMipmaps=!1,Ge=!0;break;default:J.raise("invalid mipmap type")}Ge&&!("min"in vt)&&(Ie.minFilter=aW)}}function Ql(Ie,vt){K.texParameteri(vt,qQe,Ie.minFilter),K.texParameteri(vt,YQe,Ie.magFilter),K.texParameteri(vt,WQe,Ie.wrapS),K.texParameteri(vt,HQe,Ie.wrapT),ge.ext_texture_filter_anisotropic&&K.texParameteri(vt,eet,Ie.anisotropic),Ie.genMipmaps&&(K.hint(KQe,Ie.mipmapHint),K.generateMipmap(vt))}var eu=0,Xu={},Sh=Pe.maxTextureUnits,bl=Array(Sh).map(function(){return null});function fi(Ie){jt.call(this),this.mipmask=0,this.internalformat=fa,this.id=eu++,this.refCount=1,this.target=Ie,this.texture=K.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new fs,xt.profile&&(this.stats={size:0})}function wh(Ie){K.activeTexture(IL),K.bindTexture(Ie.target,Ie.texture)}function io(){var Ie=bl[0];Ie?K.bindTexture(Ie.target,Ie.texture):K.bindTexture(cs,null)}function bn(Ie){var vt=Ie.texture;J(vt,"must not double destroy texture");var it=Ie.unit,Br=Ie.target;it>=0&&(K.activeTexture(IL+it),K.bindTexture(Br,null),bl[it]=null),K.deleteTexture(vt),Ie.texture=null,Ie.params=null,Ie.pixels=null,Ie.refCount=0,delete Xu[Ie.id],lt.textureCount--}r(fi.prototype,{bind:function(){var Ie=this;Ie.bindCount+=1;var vt=Ie.unit;if(vt<0){for(var it=0;it0)continue;Br.unit=-1}bl[it]=Ie,vt=it;break}vt>=Sh&&J.raise("insufficient number of texture units"),xt.profile&<.maxTextureUnits>ze)-Ge,Ee.height=Ee.height||(it.height>>ze)-Fe,J(it.type===Ee.type&&it.format===Ee.format&&it.internalformat===Ee.internalformat,"incompatible format for texture.subimage"),J(Ge>=0&&Fe>=0&&Ge+Ee.width<=it.width&&Fe+Ee.height<=it.height,"texture.subimage write out of bounds"),J(it.mipmask&1<>Ge;++Ge){var Fe=He>>Ge,ze=Ke>>Ge;if(!Fe||!ze)break;K.texImage2D(cs,Ge,it.format,Fe,ze,0,it.format,it.type,null)}return io(),xt.profile&&(it.stats.size=cF(it.internalformat,it.type,He,Ke,!1,!1)),Br}return Br(Ie,vt),Br.subimage=Ti,Br.resize=be,Br._reglType="texture2d",Br._texture=it,xt.profile&&(Br.stats=it.stats),Br.destroy=function(){it.decRef()},Br}function ia(Ie,vt,it,Br,Ti,be){var de=new fi(wl);Xu[de.id]=de,lt.cubeCount++;var Ne=new Array(6);function He(Fe,ze,Ee,De,_e,Ve){var et,Lt=de.texInfo;for(fs.call(Lt),et=0;et<6;++et)Ne[et]=Ri();if(typeof Fe=="number"||!Fe){var Rt=Fe|0||1;for(et=0;et<6;++et)xi(Ne[et],Rt,Rt)}else if(typeof Fe=="object")if(ze)Wa(Ne[0],Fe),Wa(Ne[1],ze),Wa(Ne[2],Ee),Wa(Ne[3],De),Wa(Ne[4],_e),Wa(Ne[5],Ve);else if(Bl(Lt,Fe),cn(de,Fe),"faces"in Fe){var bt=Fe.faces;for(J(Array.isArray(bt)&&bt.length===6,"cube faces must be a length 6 array"),et=0;et<6;++et)J(typeof bt[et]=="object"&&!!bt[et],"invalid input for cube map face"),mr(Ne[et],de),Wa(Ne[et],bt[et])}else for(et=0;et<6;++et)Wa(Ne[et],Fe);else J.raise("invalid arguments to cube map");for(mr(de,Ne[0]),Pe.npotTextureCube||J(qi(de.width)&&qi(de.height),"your browser does not support non power or two texture dimensions"),Lt.genMipmaps?de.mipmask=(Ne[0].width<<1)-1:de.mipmask=Ne[0].mipmask,J.textureCube(de,Lt,Ne,Pe),de.internalformat=Ne[0].internalformat,He.width=Ne[0].width,He.height=Ne[0].height,wh(de),et=0;et<6;++et)Fl(Ne[et],xu+et);for(Ql(Lt,wl),io(),xt.profile&&(de.stats.size=cF(de.internalformat,de.type,He.width,He.height,Lt.genMipmaps,!0)),He.format=or[de.internalformat],He.type=Mr[de.type],He.mag=Wt[Lt.magFilter],He.min=Nr[Lt.minFilter],He.wrapS=Xt[Lt.wrapS],He.wrapT=Xt[Lt.wrapT],et=0;et<6;++et)Jl(Ne[et]);return He}function Ke(Fe,ze,Ee,De,_e){J(!!ze,"must specify image data"),J(typeof Fe=="number"&&Fe===(Fe|0)&&Fe>=0&&Fe<6,"invalid face");var Ve=Ee|0,et=De|0,Lt=_e|0,Rt=Ur();return mr(Rt,de),Rt.width=0,Rt.height=0,hr(Rt,ze),Rt.width=Rt.width||(de.width>>Lt)-Ve,Rt.height=Rt.height||(de.height>>Lt)-et,J(de.type===Rt.type&&de.format===Rt.format&&de.internalformat===Rt.internalformat,"incompatible format for texture.subimage"),J(Ve>=0&&et>=0&&Ve+Rt.width<=de.width&&et+Rt.height<=de.height,"texture.subimage write out of bounds"),J(de.mipmask&1<>De;++De)K.texImage2D(xu+Ee,De,de.format,ze>>De,ze>>De,0,de.format,de.type,null);return io(),xt.profile&&(de.stats.size=cF(de.internalformat,de.type,He.width,He.height,!1,!0)),He}}return He(Ie,vt,it,Br,Ti,be),He.subimage=Ke,He.resize=Ge,He._reglType="textureCube",He._texture=de,xt.profile&&(He.stats=de.stats),He.destroy=function(){de.decRef()},He}function El(){for(var Ie=0;Ie>Br,it.height>>Br,0,it.internalformat,it.type,null);else for(var Ti=0;Ti<6;++Ti)K.texImage2D(xu+Ti,Br,it.internalformat,it.width>>Br,it.height>>Br,0,it.internalformat,it.type,null);Ql(it.texInfo,it.target)})}function Vw(){for(var Ie=0;Ie=2,"invalid renderbuffer shape"),Nr=mr[0]|0,Xt=mr[1]|0}else"radius"in jt&&(Nr=Xt=jt.radius|0),"width"in jt&&(Nr=jt.width|0),"height"in jt&&(Xt=jt.height|0);"format"in jt&&(J.parameter(jt.format,lt,"invalid renderbuffer format"),yr=lt[jt.format])}else typeof Mr=="number"?(Nr=Mr|0,typeof Wt=="number"?Xt=Wt|0:Xt=Nr):Mr?J.raise("invalid arguments to renderbuffer constructor"):Nr=Xt=1;if(J(Nr>0&&Xt>0&&Nr<=Pe.maxRenderbufferSize&&Xt<=Pe.maxRenderbufferSize,"invalid renderbuffer size"),!(Nr===Ye.width&&Xt===Ye.height&&yr===Ye.format))return St.width=Ye.width=Nr,St.height=Ye.height=Xt,Ye.format=yr,K.bindRenderbuffer(K_,Ye.renderbuffer),K.renderbufferStorage(K_,yr,Nr,Xt),J(K.getError()===0,"invalid render buffer format"),Ot.profile&&(Ye.stats.size=Ife(Ye.format,Ye.width,Ye.height)),St.format=xt[Ye.format],St}function or(Mr,Wt){var Nr=Mr|0,Xt=Wt|0||Nr;return Nr===Ye.width&&Xt===Ye.height||(J(Nr>0&&Xt>0&&Nr<=Pe.maxRenderbufferSize&&Xt<=Pe.maxRenderbufferSize,"invalid renderbuffer size"),St.width=Ye.width=Nr,St.height=Ye.height=Xt,K.bindRenderbuffer(K_,Ye.renderbuffer),K.renderbufferStorage(K_,Ye.format,Nr,Xt),J(K.getError()===0,"invalid render buffer format"),Ot.profile&&(Ye.stats.size=Ife(Ye.format,Ye.width,Ye.height))),St}return St(Jt,pr),St.resize=or,St._reglType="renderbuffer",St._renderbuffer=Ye,Ot.profile&&(St.stats=Ye.stats),St.destroy=function(){Ye.decRef()},St}Ot.profile&&(ct.getTotalRenderbufferSize=function(){var Jt=0;return Object.keys(er).forEach(function(pr){Jt+=er[pr].stats.size}),Jt});function Er(){bs(er).forEach(function(Jt){Jt.renderbuffer=K.createRenderbuffer(),K.bindRenderbuffer(K_,Jt.renderbuffer),K.renderbufferStorage(K_,Jt.format,Jt.width,Jt.height)}),K.bindRenderbuffer(K_,null)}return{create:dr,clear:function(){bs(er).forEach(tr)},restore:Er}},jm=36160,lW=36161,kw=3553,dF=34069,Lfe=36064,Pfe=36096,Ofe=36128,Rfe=33306,Dfe=36053,get=36054,yet=36055,met=36057,_et=36061,xet=36193,wet=5121,bet=5126,Nfe=6407,kfe=6408,Eet=6402,Tet=[Nfe,kfe],uW=[];uW[kfe]=4,uW[Nfe]=3;var vF=[];vF[wet]=1,vF[bet]=4,vF[xet]=2;var Cet=32854,Aet=32855,Met=36194,Iet=33189,Let=36168,Ffe=34041,Pet=35907,Oet=34836,Ret=34842,Det=34843,Net=[Cet,Aet,Met,Pet,Ret,Det,Oet],LT={};LT[Dfe]="complete",LT[get]="incomplete attachment",LT[met]="incomplete dimensions",LT[yet]="incomplete, missing attachment",LT[_et]="unsupported";function ket(K,ge,Pe,ct,Ot,lt){var xt={cur:null,next:null,dirty:!1,setFBO:null},Kt=["rgba"],er=["rgba4","rgb565","rgb5 a1"];ge.ext_srgb&&er.push("srgba"),ge.ext_color_buffer_half_float&&er.push("rgba16f","rgb16f"),ge.webgl_color_buffer_float&&er.push("rgba32f");var lr=["uint8"];ge.oes_texture_half_float&&lr.push("half float","float16"),ge.oes_texture_float&&lr.push("float","float32");function tr(Tr,hr,Ut){this.target=Tr,this.texture=hr,this.renderbuffer=Ut;var Nn=0,ci=0;hr?(Nn=hr.width,ci=hr.height):Ut&&(Nn=Ut.width,ci=Ut.height),this.width=Nn,this.height=ci}function dr(Tr){Tr&&(Tr.texture&&Tr.texture._texture.decRef(),Tr.renderbuffer&&Tr.renderbuffer._renderbuffer.decRef())}function Er(Tr,hr,Ut){if(!!Tr)if(Tr.texture){var Nn=Tr.texture._texture,ci=Math.max(1,Nn.width),Ur=Math.max(1,Nn.height);J(ci===hr&&Ur===Ut,"inconsistent width/height for supplied texture"),Nn.refCount+=1}else{var Ei=Tr.renderbuffer._renderbuffer;J(Ei.width===hr&&Ei.height===Ut,"inconsistent width/height for renderbuffer"),Ei.refCount+=1}}function Jt(Tr,hr){hr&&(hr.texture?K.framebufferTexture2D(jm,Tr,hr.target,hr.texture._texture.texture,0):K.framebufferRenderbuffer(jm,Tr,lW,hr.renderbuffer._renderbuffer.renderbuffer))}function pr(Tr){var hr=kw,Ut=null,Nn=null,ci=Tr;typeof Tr=="object"&&(ci=Tr.data,"target"in Tr&&(hr=Tr.target|0)),J.type(ci,"function","invalid attachment data");var Ur=ci._reglType;return Ur==="texture2d"?(Ut=ci,J(hr===kw)):Ur==="textureCube"?(Ut=ci,J(hr>=dF&&hr=2,"invalid shape for framebuffer"),xi=wh[0],Wa=wh[1]}else"radius"in fi&&(xi=Wa=fi.radius),"width"in fi&&(xi=fi.width),"height"in fi&&(Wa=fi.height);("color"in fi||"colors"in fi)&&(Ri=fi.color||fi.colors,Array.isArray(Ri)&&J(Ri.length===1||ge.webgl_draw_buffers,"multiple render targets not supported")),Ri||("colorCount"in fi&&(Ql=fi.colorCount|0,J(Ql>0,"invalid color buffer count")),"colorTexture"in fi&&(Jl=!!fi.colorTexture,fs="rgba4"),"colorType"in fi&&(Bl=fi.colorType,Jl?(J(ge.oes_texture_float||!(Bl==="float"||Bl==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),J(ge.oes_texture_half_float||!(Bl==="half float"||Bl==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):Bl==="half float"||Bl==="float16"?(J(ge.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),fs="rgba16f"):(Bl==="float"||Bl==="float32")&&(J(ge.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),fs="rgba32f"),J.oneOf(Bl,lr,"invalid color type")),"colorFormat"in fi&&(fs=fi.colorFormat,Kt.indexOf(fs)>=0?Jl=!0:er.indexOf(fs)>=0?Jl=!1:Jl?J.oneOf(fi.colorFormat,Kt,"invalid color format for texture"):J.oneOf(fi.colorFormat,er,"invalid color format for renderbuffer"))),("depthTexture"in fi||"depthStencilTexture"in fi)&&(bl=!!(fi.depthTexture||fi.depthStencilTexture),J(!bl||ge.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in fi&&(typeof fi.depth=="boolean"?Fl=fi.depth:(eu=fi.depth,wu=!1)),"stencil"in fi&&(typeof fi.stencil=="boolean"?wu=fi.stencil:(Xu=fi.stencil,Fl=!1)),"depthStencil"in fi&&(typeof fi.depthStencil=="boolean"?Fl=wu=fi.depthStencil:(Sh=fi.depthStencil,Fl=!1,wu=!1))}var io=null,bn=null,Mi=null,ia=null;if(Array.isArray(Ri))io=Ri.map(pr);else if(Ri)io=[pr(Ri)];else for(io=new Array(Ql),Xn=0;Xn=0||io[Xn].renderbuffer&&Net.indexOf(io[Xn].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+Xn+" is invalid"),io[Xn]&&io[Xn].texture){var K0=uW[io[Xn].texture._texture.format]*vF[io[Xn].texture._texture.type];El===null?El=K0:J(El===K0,"all color attachments much have the same number of bits per pixel.")}return Er(bn,xi,Wa),J(!bn||bn.texture&&bn.texture._texture.format===Eet||bn.renderbuffer&&bn.renderbuffer._renderbuffer.format===Iet,"invalid depth attachment for framebuffer object"),Er(Mi,xi,Wa),J(!Mi||Mi.renderbuffer&&Mi.renderbuffer._renderbuffer.format===Let,"invalid stencil attachment for framebuffer object"),Er(ia,xi,Wa),J(!ia||ia.texture&&ia.texture._texture.format===Ffe||ia.renderbuffer&&ia.renderbuffer._renderbuffer.format===Ffe,"invalid depth-stencil attachment for framebuffer object"),Xt(Ut),Ut.width=xi,Ut.height=Wa,Ut.colorAttachments=io,Ut.depthAttachment=bn,Ut.stencilAttachment=Mi,Ut.depthStencilAttachment=ia,Nn.color=io.map(St),Nn.depth=St(bn),Nn.stencil=St(Mi),Nn.depthStencil=St(ia),Nn.width=Ut.width,Nn.height=Ut.height,jt(Ut),Nn}function ci(Ur,Ei){J(xt.next!==Ut,"can not resize a framebuffer which is currently in use");var Xn=Math.max(Ur|0,1),xi=Math.max(Ei|0||Xn,1);if(Xn===Ut.width&&xi===Ut.height)return Nn;for(var Wa=Ut.colorAttachments,Fl=0;Fl=2,"invalid shape for framebuffer"),J(Jl[0]===Jl[1],"cube framebuffer must be square"),Xn=Jl[0]}else"radius"in Ri&&(Xn=Ri.radius|0),"width"in Ri?(Xn=Ri.width|0,"height"in Ri&&J(Ri.height===Xn,"must be square")):"height"in Ri&&(Xn=Ri.height|0);("color"in Ri||"colors"in Ri)&&(xi=Ri.color||Ri.colors,Array.isArray(xi)&&J(xi.length===1||ge.webgl_draw_buffers,"multiple render targets not supported")),xi||("colorCount"in Ri&&(wu=Ri.colorCount|0,J(wu>0,"invalid color buffer count")),"colorType"in Ri&&(J.oneOf(Ri.colorType,lr,"invalid color type"),Fl=Ri.colorType),"colorFormat"in Ri&&(Wa=Ri.colorFormat,J.oneOf(Ri.colorFormat,Kt,"invalid color format for texture"))),"depth"in Ri&&(Ei.depth=Ri.depth),"stencil"in Ri&&(Ei.stencil=Ri.stencil),"depthStencil"in Ri&&(Ei.depthStencil=Ri.depthStencil)}var fs;if(xi)if(Array.isArray(xi))for(fs=[],Ur=0;Ur0&&(Ei.depth=hr[0].depth,Ei.stencil=hr[0].stencil,Ei.depthStencil=hr[0].depthStencil),hr[Ur]?hr[Ur](Ei):hr[Ur]=mr(Ei)}return r(Ut,{width:Xn,height:Xn,color:fs})}function Nn(ci){var Ur,Ei=ci|0;if(J(Ei>0&&Ei<=Pe.maxCubeMapSize,"invalid radius for cube fbo"),Ei===Ut.width)return Ut;var Xn=Ut.color;for(Ur=0;Ur0,"must specify at least one attribute");var cn={},Hn=yr.attributes;Hn.length=mr.length;for(var Tr=0;Tr=Nn.byteLength?ci.subdata(Nn):(ci.destroy(),yr.buffers[Tr]=null)),yr.buffers[Tr]||(ci=yr.buffers[Tr]=Ot.create(hr,Bfe,!1,!0)),Ut.buffer=Ot.getBuffer(ci),Ut.size=Ut.buffer.dimension|0,Ut.normalized=!1,Ut.type=Ut.buffer.dtype,Ut.offset=0,Ut.stride=0,Ut.divisor=0,Ut.state=1,cn[Tr]=1}else Ot.getBuffer(hr)?(Ut.buffer=Ot.getBuffer(hr),Ut.size=Ut.buffer.dimension|0,Ut.normalized=!1,Ut.type=Ut.buffer.dtype,Ut.offset=0,Ut.stride=0,Ut.divisor=0,Ut.state=1):Ot.getBuffer(hr.buffer)?(Ut.buffer=Ot.getBuffer(hr.buffer),Ut.size=(+hr.size||Ut.buffer.dimension)|0,Ut.normalized=!!hr.normalized||!1,"type"in hr?(J.parameter(hr.type,_h,"invalid buffer type"),Ut.type=_h[hr.type]):Ut.type=Ut.buffer.dtype,Ut.offset=(hr.offset||0)|0,Ut.stride=(hr.stride||0)|0,Ut.divisor=(hr.divisor||0)|0,Ut.state=1,J(Ut.size>=1&&Ut.size<=4,"size must be between 1 and 4"),J(Ut.offset>=0,"invalid offset"),J(Ut.stride>=0&&Ut.stride<=255,"stride must be between 0 and 255"),J(Ut.divisor>=0,"divisor must be positive"),J(!Ut.divisor||!!ge.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in hr?(J(Tr>0,"first attribute must not be a constant"),Ut.x=+hr.x||0,Ut.y=+hr.y||0,Ut.z=+hr.z||0,Ut.w=+hr.w||0,Ut.state=2):J(!1,"invalid attribute spec for location "+Tr)}for(var Ur=0;Ur1)for(var Hn=0;HnYe&&(Ye=St.stats.uniformsCount)}),Ye},Pe.getMaxAttributesCount=function(){var Ye=0;return tr.forEach(function(St){St.stats.attributesCount>Ye&&(Ye=St.stats.attributesCount)}),Ye});function pr(){Ot={},lt={};for(var Ye=0;Ye=0,"missing vertex shader",or),J.command(St>=0,"missing fragment shader",or);var Wt=lr[St];Wt||(Wt=lr[St]={});var Nr=Wt[Ye];if(Nr&&(Nr.refCount++,!Mr))return Nr;var Xt=new Er(St,Ye);return Pe.shaderCount++,Jt(Xt,or,Mr),Nr||(Wt[Ye]=Xt),tr.push(Xt),r(Xt,{destroy:function(){if(Xt.refCount--,Xt.refCount<=0){K.deleteProgram(Xt.program);var yr=tr.indexOf(Xt);tr.splice(yr,1),Pe.shaderCount--}Wt[Xt.vertId].refCount<=0&&(K.deleteShader(lt[Xt.vertId]),delete lt[Xt.vertId],delete lr[Xt.fragId][Xt.vertId]),Object.keys(lr[Xt.fragId]).length||(K.deleteShader(Ot[Xt.fragId]),delete Ot[Xt.fragId],delete lr[Xt.fragId])}})},restore:pr,shader:er,frag:-1,vert:-1}}var $et=6408,LL=5121,Wet=3333,pF=5126;function Het(K,ge,Pe,ct,Ot,lt,xt){function Kt(tr){var dr;ge.next===null?(J(Ot.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),dr=LL):(J(ge.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),dr=ge.next.colorAttachments[0].texture._texture.type,lt.oes_texture_float?(J(dr===LL||dr===pF,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),dr===pF&&J(xt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):J(dr===LL,"Reading from a framebuffer is only allowed for the type 'uint8'"));var Er=0,Jt=0,pr=ct.framebufferWidth,Ye=ct.framebufferHeight,St=null;t(tr)?St=tr:tr&&(J.type(tr,"object","invalid arguments to regl.read()"),Er=tr.x|0,Jt=tr.y|0,J(Er>=0&&Er=0&&Jt0&&pr+Er<=ct.framebufferWidth,"invalid width for read pixels"),J(Ye>0&&Ye+Jt<=ct.framebufferHeight,"invalid height for read pixels"),Pe();var or=pr*Ye*4;return St||(dr===LL?St=new Uint8Array(or):dr===pF&&(St=St||new Float32Array(or))),J.isTypedArray(St,"data buffer for regl.read() must be a typedarray"),J(St.byteLength>=or,"data buffer for regl.read() too small"),K.pixelStorei(Wet,4),K.readPixels(Er,Jt,pr,Ye,$et,dr,St),St}function er(tr){var dr;return ge.setFBO({framebuffer:tr.framebuffer},function(){dr=Kt(tr)}),dr}function lr(tr){return!tr||!("framebuffer"in tr)?Kt(tr):er(tr)}return lr}function PT(K){return Array.prototype.slice.call(K)}function OT(K){return PT(K).join("")}function jet(){var K=0,ge=[],Pe=[];function ct(dr){for(var Er=0;Er0&&(dr.push(Ye,"="),dr.push.apply(dr,PT(arguments)),dr.push(";")),Ye}return r(Er,{def:pr,toString:function(){return OT([Jt.length>0?"var "+Jt.join(",")+";":"",OT(dr)])}})}function lt(){var dr=Ot(),Er=Ot(),Jt=dr.toString,pr=Er.toString;function Ye(St,or){Er(St,or,"=",dr.def(St,or),";")}return r(function(){dr.apply(dr,PT(arguments))},{def:dr.def,entry:dr,exit:Er,save:Ye,set:function(St,or,Mr){Ye(St,or),dr(St,or,"=",Mr,";")},toString:function(){return Jt()+pr()}})}function xt(){var dr=OT(arguments),Er=lt(),Jt=lt(),pr=Er.toString,Ye=Jt.toString;return r(Er,{then:function(){return Er.apply(Er,PT(arguments)),this},else:function(){return Jt.apply(Jt,PT(arguments)),this},toString:function(){var St=Ye();return St&&(St="else{"+St+"}"),OT(["if(",dr,"){",pr(),"}",St])}})}var Kt=Ot(),er={};function lr(dr,Er){var Jt=[];function pr(){var Wt="a"+Jt.length;return Jt.push(Wt),Wt}Er=Er||0;for(var Ye=0;Ye":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Q_={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},pde={frag:Ket,vert:Jet},PW={cw:ude,ccw:LW};function IF(K){return Array.isArray(K)||t(K)||mu(K)}function gde(K){return K.sort(function(ge,Pe){return ge===Xm?-1:Pe===Xm?1:ge=1,ct>=2,ge)}else if(Pe===gF){var Ot=K.data;return new cf(Ot.thisDep,Ot.contextDep,Ot.propDep,ge)}else{if(Pe===Ufe)return new cf(!1,!1,!1,ge);if(Pe===Vfe){for(var lt=!1,xt=!1,Kt=!1,er=0;er=1&&(xt=!0),tr>=2&&(Kt=!0)}else lr.type===gF&&(lt=lt||lr.data.thisDep,xt=xt||lr.data.contextDep,Kt=Kt||lr.data.propDep)}return new cf(lt,xt,Kt,ge)}else return new cf(Pe===pW,Pe===vW,Pe===dW,ge)}}var yde=new cf(!1,!1,!1,function(){});function vtt(K,ge,Pe,ct,Ot,lt,xt,Kt,er,lr,tr,dr,Er,Jt,pr){var Ye=lr.Record,St={add:32774,subtract:32778,"reverse subtract":32779};Pe.ext_blend_minmax&&(St.min=utt,St.max=htt);var or=Pe.angle_instanced_arrays,Mr=Pe.webgl_draw_buffers,Wt={dirty:!0,profile:pr.profile},Nr={},Xt=[],yr={},jt={};function mr(be){return be.replace(".","_")}function cn(be,de,Ne){var He=mr(be);Xt.push(be),Nr[He]=Wt[He]=!!Ne,yr[He]=de}function Hn(be,de,Ne){var He=mr(be);Xt.push(be),Array.isArray(Ne)?(Wt[He]=Ne.slice(),Nr[He]=Ne.slice()):Wt[He]=Nr[He]=Ne,jt[He]=de}cn($fe,rtt),cn(Wfe,ttt),Hn(Hfe,"blendColor",[0,0,0,0]),Hn(gW,"blendEquationSeparate",[fde,fde]),Hn(yW,"blendFuncSeparate",[cde,hde,cde,hde]),cn(jfe,itt,!0),Hn(Xfe,"depthFunc",ftt),Hn(Yfe,"depthRange",[0,1]),Hn(qfe,"depthMask",!0),Hn(mW,mW,[!0,!0,!0,!0]),cn(Zfe,ett),Hn(Kfe,"cullFace",Uw),Hn(_W,_W,LW),Hn(xW,xW,1),cn(Jfe,ott),Hn(SW,"polygonOffset",[0,0]),cn(Qfe,stt),cn(ede,ltt),Hn(wW,"sampleCoverage",[1,!1]),cn(tde,ntt),Hn(rde,"stencilMask",-1),Hn(bW,"stencilFunc",[ctt,0,-1]),Hn(EW,"stencilOpSeparate",[UL,J_,J_,J_]),Hn(PL,"stencilOpSeparate",[Uw,J_,J_,J_]),cn(nde,att),Hn(yF,"scissor",[0,0,K.drawingBufferWidth,K.drawingBufferHeight]),Hn(Xm,Xm,[0,0,K.drawingBufferWidth,K.drawingBufferHeight]);var Tr={gl:K,context:Er,strings:ge,next:Nr,current:Wt,draw:dr,elements:lt,buffer:Ot,shader:tr,attributes:lr.state,vao:lr,uniforms:er,framebuffer:Kt,extensions:Pe,timer:Jt,isBufferArgs:IF},hr={primTypes:rt,compareFuncs:BT,blendFuncs:Z0,blendEquations:St,stencilOps:Q_,glTypes:_h,orientationType:PW};J.optional(function(){Tr.isArrayLike=An}),Mr&&(hr.backBuffer=[Uw],hr.drawBuffer=no(ct.maxDrawbuffers,function(be){return be===0?[0]:no(be,function(de){return dtt+de})}));var Ut=0;function Nn(){var be=jet(),de=be.link,Ne=be.global;be.id=Ut++,be.batchId="0";var He=de(Tr),Ke=be.shared={props:"a0"};Object.keys(Tr).forEach(function(De){Ke[De]=Ne.def(He,".",De)}),J.optional(function(){be.CHECK=de(J),be.commandStr=J.guessCommand(),be.command=de(be.commandStr),be.assert=function(De,_e,Ve){De("if(!(",_e,"))",this.CHECK,".commandRaise(",de(Ve),",",this.command,");")},hr.invalidBlendCombinations=vde});var Ge=be.next={},Fe=be.current={};Object.keys(jt).forEach(function(De){Array.isArray(Wt[De])&&(Ge[De]=Ne.def(Ke.next,".",De),Fe[De]=Ne.def(Ke.current,".",De))});var ze=be.constants={};Object.keys(hr).forEach(function(De){ze[De]=Ne.def(JSON.stringify(hr[De]))}),be.invoke=function(De,_e){switch(_e.type){case fW:var Ve=["this",Ke.context,Ke.props,be.batchId];return De.def(de(_e.data),".call(",Ve.slice(0,Math.max(_e.data.length+1,4)),")");case dW:return De.def(Ke.props,_e.data);case vW:return De.def(Ke.context,_e.data);case pW:return De.def("this",_e.data);case gF:return _e.data.append(be,De),_e.data.ref;case Ufe:return _e.data.toString();case Vfe:return _e.data.map(function(et){return be.invoke(De,et)})}},be.attribCache={};var Ee={};return be.scopeAttrib=function(De){var _e=ge.id(De);if(_e in Ee)return Ee[_e];var Ve=lr.scope[_e];Ve||(Ve=lr.scope[_e]=new Ye);var et=Ee[_e]=de(Ve);return et},be}function ci(be){var de=be.static,Ne=be.dynamic,He;if(OL in de){var Ke=!!de[OL];He=kl(function(Fe,ze){return Ke}),He.enable=Ke}else if(OL in Ne){var Ge=Ne[OL];He=Qf(Ge,function(Fe,ze){return Fe.invoke(ze,Ge)})}return He}function Ur(be,de){var Ne=be.static,He=be.dynamic;if(Fw in Ne){var Ke=Ne[Fw];return Ke?(Ke=Kt.getFramebuffer(Ke),J.command(Ke,"invalid framebuffer object"),kl(function(Fe,ze){var Ee=Fe.link(Ke),De=Fe.shared;ze.set(De.framebuffer,".next",Ee);var _e=De.context;return ze.set(_e,"."+NT,Ee+".width"),ze.set(_e,"."+kT,Ee+".height"),Ee})):kl(function(Fe,ze){var Ee=Fe.shared;ze.set(Ee.framebuffer,".next","null");var De=Ee.context;return ze.set(De,"."+NT,De+"."+ade),ze.set(De,"."+kT,De+"."+ode),"null"})}else if(Fw in He){var Ge=He[Fw];return Qf(Ge,function(Fe,ze){var Ee=Fe.invoke(ze,Ge),De=Fe.shared,_e=De.framebuffer,Ve=ze.def(_e,".getFramebuffer(",Ee,")");J.optional(function(){Fe.assert(ze,"!"+Ee+"||"+Ve,"invalid framebuffer object")}),ze.set(_e,".next",Ve);var et=De.context;return ze.set(et,"."+NT,Ve+"?"+Ve+".width:"+et+"."+ade),ze.set(et,"."+kT,Ve+"?"+Ve+".height:"+et+"."+ode),Ve})}else return null}function Ei(be,de,Ne){var He=be.static,Ke=be.dynamic;function Ge(Ee){if(Ee in He){var De=He[Ee];J.commandType(De,"object","invalid "+Ee,Ne.commandStr);var _e=!0,Ve=De.x|0,et=De.y|0,Lt,Rt;return"width"in De?(Lt=De.width|0,J.command(Lt>=0,"invalid "+Ee,Ne.commandStr)):_e=!1,"height"in De?(Rt=De.height|0,J.command(Rt>=0,"invalid "+Ee,Ne.commandStr)):_e=!1,new cf(!_e&&de&&de.thisDep,!_e&&de&&de.contextDep,!_e&&de&&de.propDep,function(en,di){var Vr=en.shared.context,Mn=Lt;"width"in De||(Mn=di.def(Vr,".",NT,"-",Ve));var Qn=Rt;return"height"in De||(Qn=di.def(Vr,".",kT,"-",et)),[Ve,et,Mn,Qn]})}else if(Ee in Ke){var bt=Ke[Ee],ir=Qf(bt,function(en,di){var Vr=en.invoke(di,bt);J.optional(function(){en.assert(di,Vr+"&&typeof "+Vr+'==="object"',"invalid "+Ee)});var Mn=en.shared.context,Qn=di.def(Vr,".x|0"),Ha=di.def(Vr,".y|0"),sl=di.def('"width" in ',Vr,"?",Vr,".width|0:","(",Mn,".",NT,"-",Qn,")"),ff=di.def('"height" in ',Vr,"?",Vr,".height|0:","(",Mn,".",kT,"-",Ha,")");return J.optional(function(){en.assert(di,sl+">=0&&"+ff+">=0","invalid "+Ee)}),[Qn,Ha,sl,ff]});return de&&(ir.thisDep=ir.thisDep||de.thisDep,ir.contextDep=ir.contextDep||de.contextDep,ir.propDep=ir.propDep||de.propDep),ir}else return de?new cf(de.thisDep,de.contextDep,de.propDep,function(en,di){var Vr=en.shared.context;return[0,0,di.def(Vr,".",NT),di.def(Vr,".",kT)]}):null}var Fe=Ge(Xm);if(Fe){var ze=Fe;Fe=new cf(Fe.thisDep,Fe.contextDep,Fe.propDep,function(Ee,De){var _e=ze.append(Ee,De),Ve=Ee.shared.context;return De.set(Ve,"."+Xet,_e[2]),De.set(Ve,"."+Yet,_e[3]),_e})}return{viewport:Fe,scissor_box:Ge(yF)}}function Xn(be,de){var Ne=be.static,He=typeof Ne[DL]=="string"&&typeof Ne[RL]=="string";if(He){if(Object.keys(de.dynamic).length>0)return null;var Ke=de.static,Ge=Object.keys(Ke);if(Ge.length>0&&typeof Ke[Ge[0]]=="number"){for(var Fe=[],ze=0;ze=0,"invalid "+_e,de.commandStr),kl(function(Rt,bt){return Ve&&(Rt.OFFSET=et),et})}else if(_e in He){var Lt=He[_e];return Qf(Lt,function(Rt,bt){var ir=Rt.invoke(bt,Lt);return Ve&&(Rt.OFFSET=ir,J.optional(function(){Rt.assert(bt,ir+">=0","invalid "+_e)})),ir})}else if(Ve&&Ge)return kl(function(Rt,bt){return Rt.OFFSET="0",0});return null}var Ee=ze(mF,!0);function De(){if(zw in Ne){var _e=Ne[zw]|0;return J.command(typeof _e=="number"&&_e>=0,"invalid vertex count",de.commandStr),kl(function(){return _e})}else if(zw in He){var Ve=He[zw];return Qf(Ve,function(Rt,bt){var ir=Rt.invoke(bt,Ve);return J.optional(function(){Rt.assert(bt,"typeof "+ir+'==="number"&&'+ir+">=0&&"+ir+"===("+ir+"|0)","invalid vertex count")}),ir})}else if(Ge)if(ex(Ge)){if(Ge)return Ee?new cf(Ee.thisDep,Ee.contextDep,Ee.propDep,function(Rt,bt){var ir=bt.def(Rt.ELEMENTS,".vertCount-",Rt.OFFSET);return J.optional(function(){Rt.assert(bt,ir+">=0","invalid vertex offset/element buffer too small")}),ir}):kl(function(Rt,bt){return bt.def(Rt.ELEMENTS,".vertCount")});var et=kl(function(){return-1});return J.optional(function(){et.MISSING=!0}),et}else{var Lt=new cf(Ge.thisDep||Ee.thisDep,Ge.contextDep||Ee.contextDep,Ge.propDep||Ee.propDep,function(Rt,bt){var ir=Rt.ELEMENTS;return Rt.OFFSET?bt.def(ir,"?",ir,".vertCount-",Rt.OFFSET,":-1"):bt.def(ir,"?",ir,".vertCount:-1")});return J.optional(function(){Lt.DYNAMIC=!0}),Lt}return null}return{elements:Ge,primitive:Fe(),count:De(),instances:ze(_F,!1),offset:Ee}}function Fl(be,de){var Ne=be.static,He=be.dynamic,Ke={};return Xt.forEach(function(Ge){var Fe=mr(Ge);function ze(Ee,De){if(Ge in Ne){var _e=Ee(Ne[Ge]);Ke[Fe]=kl(function(){return _e})}else if(Ge in He){var Ve=He[Ge];Ke[Fe]=Qf(Ve,function(et,Lt){return De(et,Lt,et.invoke(Lt,Ve))})}}switch(Ge){case Zfe:case Wfe:case $fe:case tde:case jfe:case nde:case Jfe:case Qfe:case ede:case qfe:return ze(function(Ee){return J.commandType(Ee,"boolean",Ge,de.commandStr),Ee},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,"typeof "+_e+'==="boolean"',"invalid flag "+Ge,Ee.commandStr)}),_e});case Xfe:return ze(function(Ee){return J.commandParameter(Ee,BT,"invalid "+Ge,de.commandStr),BT[Ee]},function(Ee,De,_e){var Ve=Ee.constants.compareFuncs;return J.optional(function(){Ee.assert(De,_e+" in "+Ve,"invalid "+Ge+", must be one of "+Object.keys(BT))}),De.def(Ve,"[",_e,"]")});case Yfe:return ze(function(Ee){return J.command(An(Ee)&&Ee.length===2&&typeof Ee[0]=="number"&&typeof Ee[1]=="number"&&Ee[0]<=Ee[1],"depth range is 2d array",de.commandStr),Ee},function(Ee,De,_e){J.optional(function(){Ee.assert(De,Ee.shared.isArrayLike+"("+_e+")&&"+_e+".length===2&&typeof "+_e+'[0]==="number"&&typeof '+_e+'[1]==="number"&&'+_e+"[0]<="+_e+"[1]","depth range must be a 2d array")});var Ve=De.def("+",_e,"[0]"),et=De.def("+",_e,"[1]");return[Ve,et]});case yW:return ze(function(Ee){J.commandType(Ee,"object","blend.func",de.commandStr);var De="srcRGB"in Ee?Ee.srcRGB:Ee.src,_e="srcAlpha"in Ee?Ee.srcAlpha:Ee.src,Ve="dstRGB"in Ee?Ee.dstRGB:Ee.dst,et="dstAlpha"in Ee?Ee.dstAlpha:Ee.dst;return J.commandParameter(De,Z0,Fe+".srcRGB",de.commandStr),J.commandParameter(_e,Z0,Fe+".srcAlpha",de.commandStr),J.commandParameter(Ve,Z0,Fe+".dstRGB",de.commandStr),J.commandParameter(et,Z0,Fe+".dstAlpha",de.commandStr),J.command(vde.indexOf(De+", "+Ve)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+De+", "+Ve+")",de.commandStr),[Z0[De],Z0[Ve],Z0[_e],Z0[et]]},function(Ee,De,_e){var Ve=Ee.constants.blendFuncs;J.optional(function(){Ee.assert(De,_e+"&&typeof "+_e+'==="object"',"invalid blend func, must be an object")});function et(Vr,Mn){var Qn=De.def('"',Vr,Mn,'" in ',_e,"?",_e,".",Vr,Mn,":",_e,".",Vr);return J.optional(function(){Ee.assert(De,Qn+" in "+Ve,"invalid "+Ge+"."+Vr+Mn+", must be one of "+Object.keys(Z0))}),Qn}var Lt=et("src","RGB"),Rt=et("dst","RGB");J.optional(function(){var Vr=Ee.constants.invalidBlendCombinations;Ee.assert(De,Vr+".indexOf("+Lt+'+", "+'+Rt+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var bt=De.def(Ve,"[",Lt,"]"),ir=De.def(Ve,"[",et("src","Alpha"),"]"),en=De.def(Ve,"[",Rt,"]"),di=De.def(Ve,"[",et("dst","Alpha"),"]");return[bt,en,ir,di]});case gW:return ze(function(Ee){if(typeof Ee=="string")return J.commandParameter(Ee,St,"invalid "+Ge,de.commandStr),[St[Ee],St[Ee]];if(typeof Ee=="object")return J.commandParameter(Ee.rgb,St,Ge+".rgb",de.commandStr),J.commandParameter(Ee.alpha,St,Ge+".alpha",de.commandStr),[St[Ee.rgb],St[Ee.alpha]];J.commandRaise("invalid blend.equation",de.commandStr)},function(Ee,De,_e){var Ve=Ee.constants.blendEquations,et=De.def(),Lt=De.def(),Rt=Ee.cond("typeof ",_e,'==="string"');return J.optional(function(){function bt(ir,en,di){Ee.assert(ir,di+" in "+Ve,"invalid "+en+", must be one of "+Object.keys(St))}bt(Rt.then,Ge,_e),Ee.assert(Rt.else,_e+"&&typeof "+_e+'==="object"',"invalid "+Ge),bt(Rt.else,Ge+".rgb",_e+".rgb"),bt(Rt.else,Ge+".alpha",_e+".alpha")}),Rt.then(et,"=",Lt,"=",Ve,"[",_e,"];"),Rt.else(et,"=",Ve,"[",_e,".rgb];",Lt,"=",Ve,"[",_e,".alpha];"),De(Rt),[et,Lt]});case Hfe:return ze(function(Ee){return J.command(An(Ee)&&Ee.length===4,"blend.color must be a 4d array",de.commandStr),no(4,function(De){return+Ee[De]})},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,Ee.shared.isArrayLike+"("+_e+")&&"+_e+".length===4","blend.color must be a 4d array")}),no(4,function(Ve){return De.def("+",_e,"[",Ve,"]")})});case rde:return ze(function(Ee){return J.commandType(Ee,"number",Fe,de.commandStr),Ee|0},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,"typeof "+_e+'==="number"',"invalid stencil.mask")}),De.def(_e,"|0")});case bW:return ze(function(Ee){J.commandType(Ee,"object",Fe,de.commandStr);var De=Ee.cmp||"keep",_e=Ee.ref||0,Ve="mask"in Ee?Ee.mask:-1;return J.commandParameter(De,BT,Ge+".cmp",de.commandStr),J.commandType(_e,"number",Ge+".ref",de.commandStr),J.commandType(Ve,"number",Ge+".mask",de.commandStr),[BT[De],_e,Ve]},function(Ee,De,_e){var Ve=Ee.constants.compareFuncs;J.optional(function(){function bt(){Ee.assert(De,Array.prototype.join.call(arguments,""),"invalid stencil.func")}bt(_e+"&&typeof ",_e,'==="object"'),bt('!("cmp" in ',_e,")||(",_e,".cmp in ",Ve,")")});var et=De.def('"cmp" in ',_e,"?",Ve,"[",_e,".cmp]",":",J_),Lt=De.def(_e,".ref|0"),Rt=De.def('"mask" in ',_e,"?",_e,".mask|0:-1");return[et,Lt,Rt]});case EW:case PL:return ze(function(Ee){J.commandType(Ee,"object",Fe,de.commandStr);var De=Ee.fail||"keep",_e=Ee.zfail||"keep",Ve=Ee.zpass||"keep";return J.commandParameter(De,Q_,Ge+".fail",de.commandStr),J.commandParameter(_e,Q_,Ge+".zfail",de.commandStr),J.commandParameter(Ve,Q_,Ge+".zpass",de.commandStr),[Ge===PL?Uw:UL,Q_[De],Q_[_e],Q_[Ve]]},function(Ee,De,_e){var Ve=Ee.constants.stencilOps;J.optional(function(){Ee.assert(De,_e+"&&typeof "+_e+'==="object"',"invalid "+Ge)});function et(Lt){return J.optional(function(){Ee.assert(De,'!("'+Lt+'" in '+_e+")||("+_e+"."+Lt+" in "+Ve+")","invalid "+Ge+"."+Lt+", must be one of "+Object.keys(Q_))}),De.def('"',Lt,'" in ',_e,"?",Ve,"[",_e,".",Lt,"]:",J_)}return[Ge===PL?Uw:UL,et("fail"),et("zfail"),et("zpass")]});case SW:return ze(function(Ee){J.commandType(Ee,"object",Fe,de.commandStr);var De=Ee.factor|0,_e=Ee.units|0;return J.commandType(De,"number",Fe+".factor",de.commandStr),J.commandType(_e,"number",Fe+".units",de.commandStr),[De,_e]},function(Ee,De,_e){J.optional(function(){Ee.assert(De,_e+"&&typeof "+_e+'==="object"',"invalid "+Ge)});var Ve=De.def(_e,".factor|0"),et=De.def(_e,".units|0");return[Ve,et]});case Kfe:return ze(function(Ee){var De=0;return Ee==="front"?De=UL:Ee==="back"&&(De=Uw),J.command(!!De,Fe,de.commandStr),De},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,_e+'==="front"||'+_e+'==="back"',"invalid cull.face")}),De.def(_e,'==="front"?',UL,":",Uw)});case xW:return ze(function(Ee){return J.command(typeof Ee=="number"&&Ee>=ct.lineWidthDims[0]&&Ee<=ct.lineWidthDims[1],"invalid line width, must be a positive number between "+ct.lineWidthDims[0]+" and "+ct.lineWidthDims[1],de.commandStr),Ee},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,"typeof "+_e+'==="number"&&'+_e+">="+ct.lineWidthDims[0]+"&&"+_e+"<="+ct.lineWidthDims[1],"invalid line width")}),_e});case _W:return ze(function(Ee){return J.commandParameter(Ee,PW,Fe,de.commandStr),PW[Ee]},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,_e+'==="cw"||'+_e+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),De.def(_e+'==="cw"?'+ude+":"+LW)});case mW:return ze(function(Ee){return J.command(An(Ee)&&Ee.length===4,"color.mask must be length 4 array",de.commandStr),Ee.map(function(De){return!!De})},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,Ee.shared.isArrayLike+"("+_e+")&&"+_e+".length===4","invalid color.mask")}),no(4,function(Ve){return"!!"+_e+"["+Ve+"]"})});case wW:return ze(function(Ee){J.command(typeof Ee=="object"&&Ee,Fe,de.commandStr);var De="value"in Ee?Ee.value:1,_e=!!Ee.invert;return J.command(typeof De=="number"&&De>=0&&De<=1,"sample.coverage.value must be a number between 0 and 1",de.commandStr),[De,_e]},function(Ee,De,_e){J.optional(function(){Ee.assert(De,_e+"&&typeof "+_e+'==="object"',"invalid sample.coverage")});var Ve=De.def('"value" in ',_e,"?+",_e,".value:1"),et=De.def("!!",_e,".invert");return[Ve,et]})}}),Ke}function wu(be,de){var Ne=be.static,He=be.dynamic,Ke={};return Object.keys(Ne).forEach(function(Ge){var Fe=Ne[Ge],ze;if(typeof Fe=="number"||typeof Fe=="boolean")ze=kl(function(){return Fe});else if(typeof Fe=="function"){var Ee=Fe._reglType;Ee==="texture2d"||Ee==="textureCube"?ze=kl(function(De){return De.link(Fe)}):Ee==="framebuffer"||Ee==="framebufferCube"?(J.command(Fe.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Ge+'"',de.commandStr),ze=kl(function(De){return De.link(Fe.color[0])})):J.commandRaise('invalid data for uniform "'+Ge+'"',de.commandStr)}else An(Fe)?ze=kl(function(De){var _e=De.global.def("[",no(Fe.length,function(Ve){return J.command(typeof Fe[Ve]=="number"||typeof Fe[Ve]=="boolean","invalid uniform "+Ge,De.commandStr),Fe[Ve]}),"]");return _e}):J.commandRaise('invalid or missing data for uniform "'+Ge+'"',de.commandStr);ze.value=Fe,Ke[Ge]=ze}),Object.keys(He).forEach(function(Ge){var Fe=He[Ge];Ke[Ge]=Qf(Fe,function(ze,Ee){return ze.invoke(Ee,Fe)})}),Ke}function Ri(be,de){var Ne=be.static,He=be.dynamic,Ke={};return Object.keys(Ne).forEach(function(Ge){var Fe=Ne[Ge],ze=ge.id(Ge),Ee=new Ye;if(IF(Fe))Ee.state=DT,Ee.buffer=Ot.getBuffer(Ot.create(Fe,FT,!1,!0)),Ee.type=0;else{var De=Ot.getBuffer(Fe);if(De)Ee.state=DT,Ee.buffer=De,Ee.type=0;else if(J.command(typeof Fe=="object"&&Fe,"invalid data for attribute "+Ge,de.commandStr),"constant"in Fe){var _e=Fe.constant;Ee.buffer="null",Ee.state=cW,typeof _e=="number"?Ee.x=_e:(J.command(An(_e)&&_e.length>0&&_e.length<=4,"invalid constant for attribute "+Ge,de.commandStr),RT.forEach(function(en,di){di<_e.length&&(Ee[en]=_e[di])}))}else{IF(Fe.buffer)?De=Ot.getBuffer(Ot.create(Fe.buffer,FT,!1,!0)):De=Ot.getBuffer(Fe.buffer),J.command(!!De,'missing buffer for attribute "'+Ge+'"',de.commandStr);var Ve=Fe.offset|0;J.command(Ve>=0,'invalid offset for attribute "'+Ge+'"',de.commandStr);var et=Fe.stride|0;J.command(et>=0&&et<256,'invalid stride for attribute "'+Ge+'", must be integer betweeen [0, 255]',de.commandStr);var Lt=Fe.size|0;J.command(!("size"in Fe)||Lt>0&&Lt<=4,'invalid size for attribute "'+Ge+'", must be 1,2,3,4',de.commandStr);var Rt=!!Fe.normalized,bt=0;"type"in Fe&&(J.commandParameter(Fe.type,_h,"invalid type for attribute "+Ge,de.commandStr),bt=_h[Fe.type]);var ir=Fe.divisor|0;"divisor"in Fe&&(J.command(ir===0||or,'cannot specify divisor for attribute "'+Ge+'", instancing not supported',de.commandStr),J.command(ir>=0,'invalid divisor for attribute "'+Ge+'"',de.commandStr)),J.optional(function(){var en=de.commandStr,di=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(Fe).forEach(function(Vr){J.command(di.indexOf(Vr)>=0,'unknown parameter "'+Vr+'" for attribute pointer "'+Ge+'" (valid parameters are '+di+")",en)})}),Ee.buffer=De,Ee.state=DT,Ee.size=Lt,Ee.normalized=Rt,Ee.type=bt||De.dtype,Ee.offset=Ve,Ee.stride=et,Ee.divisor=ir}}Ke[Ge]=kl(function(en,di){var Vr=en.attribCache;if(ze in Vr)return Vr[ze];var Mn={isStream:!1};return Object.keys(Ee).forEach(function(Qn){Mn[Qn]=Ee[Qn]}),Ee.buffer&&(Mn.buffer=en.link(Ee.buffer),Mn.type=Mn.type||Mn.buffer+".dtype"),Vr[ze]=Mn,Mn})}),Object.keys(He).forEach(function(Ge){var Fe=He[Ge];function ze(Ee,De){var _e=Ee.invoke(De,Fe),Ve=Ee.shared,et=Ee.constants,Lt=Ve.isBufferArgs,Rt=Ve.buffer;J.optional(function(){Ee.assert(De,_e+"&&(typeof "+_e+'==="object"||typeof '+_e+'==="function")&&('+Lt+"("+_e+")||"+Rt+".getBuffer("+_e+")||"+Rt+".getBuffer("+_e+".buffer)||"+Lt+"("+_e+'.buffer)||("constant" in '+_e+"&&(typeof "+_e+'.constant==="number"||'+Ve.isArrayLike+"("+_e+".constant))))",'invalid dynamic attribute "'+Ge+'"')});var bt={isStream:De.def(!1)},ir=new Ye;ir.state=DT,Object.keys(ir).forEach(function(Mn){bt[Mn]=De.def(""+ir[Mn])});var en=bt.buffer,di=bt.type;De("if(",Lt,"(",_e,")){",bt.isStream,"=true;",en,"=",Rt,".createStream(",FT,",",_e,");",di,"=",en,".dtype;","}else{",en,"=",Rt,".getBuffer(",_e,");","if(",en,"){",di,"=",en,".dtype;",'}else if("constant" in ',_e,"){",bt.state,"=",cW,";","if(typeof "+_e+'.constant === "number"){',bt[RT[0]],"=",_e,".constant;",RT.slice(1).map(function(Mn){return bt[Mn]}).join("="),"=0;","}else{",RT.map(function(Mn,Qn){return bt[Mn]+"="+_e+".constant.length>"+Qn+"?"+_e+".constant["+Qn+"]:0;"}).join(""),"}}else{","if(",Lt,"(",_e,".buffer)){",en,"=",Rt,".createStream(",FT,",",_e,".buffer);","}else{",en,"=",Rt,".getBuffer(",_e,".buffer);","}",di,'="type" in ',_e,"?",et.glTypes,"[",_e,".type]:",en,".dtype;",bt.normalized,"=!!",_e,".normalized;");function Vr(Mn){De(bt[Mn],"=",_e,".",Mn,"|0;")}return Vr("size"),Vr("offset"),Vr("stride"),Vr("divisor"),De("}}"),De.exit("if(",bt.isStream,"){",Rt,".destroyStream(",en,");","}"),bt}Ke[Ge]=Qf(Fe,ze)}),Ke}function Jl(be,de){var Ne=be.static,He=be.dynamic;if(NL in Ne){var Ke=Ne[NL];return Ke!==null&&lr.getVAO(Ke)===null&&(Ke=lr.createVAO(Ke)),kl(function(Fe){return Fe.link(lr.getVAO(Ke))})}else if(NL in He){var Ge=He[NL];return Qf(Ge,function(Fe,ze){var Ee=Fe.invoke(ze,Ge);return ze.def(Fe.shared.vao+".getVAO("+Ee+")")})}return null}function fs(be){var de=be.static,Ne=be.dynamic,He={};return Object.keys(de).forEach(function(Ke){var Ge=de[Ke];He[Ke]=kl(function(Fe,ze){return typeof Ge=="number"||typeof Ge=="boolean"?""+Ge:Fe.link(Ge)})}),Object.keys(Ne).forEach(function(Ke){var Ge=Ne[Ke];He[Ke]=Qf(Ge,function(Fe,ze){return Fe.invoke(ze,Ge)})}),He}function Bl(be,de,Ne,He,Ke){var Ge=be.static,Fe=be.dynamic;J.optional(function(){var Vr=[Fw,RL,DL,Bw,Gw,mF,zw,_F,OL,NL].concat(Xt);function Mn(Qn){Object.keys(Qn).forEach(function(Ha){J.command(Vr.indexOf(Ha)>=0,'unknown parameter "'+Ha+'"',Ke.commandStr)})}Mn(Ge),Mn(Fe)});var ze=Xn(be,de),Ee=Ur(be),De=Ei(be,Ee,Ke),_e=Wa(be,Ke),Ve=Fl(be,Ke),et=xi(be,Ke,ze);function Lt(Vr){var Mn=De[Vr];Mn&&(Ve[Vr]=Mn)}Lt(Xm),Lt(mr(yF));var Rt=Object.keys(Ve).length>0,bt={framebuffer:Ee,draw:_e,shader:et,state:Ve,dirty:Rt,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(bt.profile=ci(be),bt.uniforms=wu(Ne,Ke),bt.drawVAO=bt.scopeVAO=Jl(be),!bt.drawVAO&&et.program&&!ze&&Pe.angle_instanced_arrays){var ir=!0,en=et.program.attributes.map(function(Vr){var Mn=de.static[Vr];return ir=ir&&!!Mn,Mn});if(ir&&en.length>0){var di=lr.getVAO(lr.createVAO(en));bt.drawVAO=new cf(null,null,null,function(Vr,Mn){return Vr.link(di)}),bt.useVAO=!0}}return ze?bt.useVAO=!0:bt.attributes=Ri(de,Ke),bt.context=fs(He),bt}function Ql(be,de,Ne){var He=be.shared,Ke=He.context,Ge=be.scope();Object.keys(Ne).forEach(function(Fe){de.save(Ke,"."+Fe);var ze=Ne[Fe],Ee=ze.append(be,de);Array.isArray(Ee)?Ge(Ke,".",Fe,"=[",Ee.join(),"];"):Ge(Ke,".",Fe,"=",Ee,";")}),de(Ge)}function eu(be,de,Ne,He){var Ke=be.shared,Ge=Ke.gl,Fe=Ke.framebuffer,ze;Mr&&(ze=de.def(Ke.extensions,".webgl_draw_buffers"));var Ee=be.constants,De=Ee.drawBuffer,_e=Ee.backBuffer,Ve;Ne?Ve=Ne.append(be,de):Ve=de.def(Fe,".next"),He||de("if(",Ve,"!==",Fe,".cur){"),de("if(",Ve,"){",Ge,".bindFramebuffer(",dde,",",Ve,".framebuffer);"),Mr&&de(ze,".drawBuffersWEBGL(",De,"[",Ve,".colorAttachments.length]);"),de("}else{",Ge,".bindFramebuffer(",dde,",null);"),Mr&&de(ze,".drawBuffersWEBGL(",_e,");"),de("}",Fe,".cur=",Ve,";"),He||de("}")}function Xu(be,de,Ne){var He=be.shared,Ke=He.gl,Ge=be.current,Fe=be.next,ze=He.current,Ee=He.next,De=be.cond(ze,".dirty");Xt.forEach(function(_e){var Ve=mr(_e);if(!(Ve in Ne.state)){var et,Lt;if(Ve in Fe){et=Fe[Ve],Lt=Ge[Ve];var Rt=no(Wt[Ve].length,function(ir){return De.def(et,"[",ir,"]")});De(be.cond(Rt.map(function(ir,en){return ir+"!=="+Lt+"["+en+"]"}).join("||")).then(Ke,".",jt[Ve],"(",Rt,");",Rt.map(function(ir,en){return Lt+"["+en+"]="+ir}).join(";"),";"))}else{et=De.def(Ee,".",Ve);var bt=be.cond(et,"!==",ze,".",Ve);De(bt),Ve in yr?bt(be.cond(et).then(Ke,".enable(",yr[Ve],");").else(Ke,".disable(",yr[Ve],");"),ze,".",Ve,"=",et,";"):bt(Ke,".",jt[Ve],"(",et,");",ze,".",Ve,"=",et,";")}}}),Object.keys(Ne.state).length===0&&De(ze,".dirty=false;"),de(De)}function Sh(be,de,Ne,He){var Ke=be.shared,Ge=be.current,Fe=Ke.current,ze=Ke.gl;gde(Object.keys(Ne)).forEach(function(Ee){var De=Ne[Ee];if(!(He&&!He(De))){var _e=De.append(be,de);if(yr[Ee]){var Ve=yr[Ee];ex(De)?_e?de(ze,".enable(",Ve,");"):de(ze,".disable(",Ve,");"):de(be.cond(_e).then(ze,".enable(",Ve,");").else(ze,".disable(",Ve,");")),de(Fe,".",Ee,"=",_e,";")}else if(An(_e)){var et=Ge[Ee];de(ze,".",jt[Ee],"(",_e,");",_e.map(function(Lt,Rt){return et+"["+Rt+"]="+Lt}).join(";"),";")}else de(ze,".",jt[Ee],"(",_e,");",Fe,".",Ee,"=",_e,";")}})}function bl(be,de){or&&(be.instancing=de.def(be.shared.extensions,".angle_instanced_arrays"))}function fi(be,de,Ne,He,Ke){var Ge=be.shared,Fe=be.stats,ze=Ge.current,Ee=Ge.timer,De=Ne.profile;function _e(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Ve,et;function Lt(Vr){Ve=de.def(),Vr(Ve,"=",_e(),";"),typeof Ke=="string"?Vr(Fe,".count+=",Ke,";"):Vr(Fe,".count++;"),Jt&&(He?(et=de.def(),Vr(et,"=",Ee,".getNumPendingQueries();")):Vr(Ee,".beginQuery(",Fe,");"))}function Rt(Vr){Vr(Fe,".cpuTime+=",_e(),"-",Ve,";"),Jt&&(He?Vr(Ee,".pushScopeStats(",et,",",Ee,".getNumPendingQueries(),",Fe,");"):Vr(Ee,".endQuery();"))}function bt(Vr){var Mn=de.def(ze,".profile");de(ze,".profile=",Vr,";"),de.exit(ze,".profile=",Mn,";")}var ir;if(De){if(ex(De)){De.enable?(Lt(de),Rt(de.exit),bt("true")):bt("false");return}ir=De.append(be,de),bt(ir)}else ir=de.def(ze,".profile");var en=be.block();Lt(en),de("if(",ir,"){",en,"}");var di=be.block();Rt(di),de.exit("if(",ir,"){",di,"}")}function wh(be,de,Ne,He,Ke){var Ge=be.shared;function Fe(Ee){switch(Ee){case xF:case bF:case CF:return 2;case SF:case EF:case AF:return 3;case wF:case TF:case MF:return 4;default:return 1}}function ze(Ee,De,_e){var Ve=Ge.gl,et=de.def(Ee,".location"),Lt=de.def(Ge.attributes,"[",et,"]"),Rt=_e.state,bt=_e.buffer,ir=[_e.x,_e.y,_e.z,_e.w],en=["buffer","normalized","offset","stride"];function di(){de("if(!",Lt,".buffer){",Ve,".enableVertexAttribArray(",et,");}");var Mn=_e.type,Qn;if(_e.size?Qn=de.def(_e.size,"||",De):Qn=De,de("if(",Lt,".type!==",Mn,"||",Lt,".size!==",Qn,"||",en.map(function(sl){return Lt+"."+sl+"!=="+_e[sl]}).join("||"),"){",Ve,".bindBuffer(",FT,",",bt,".buffer);",Ve,".vertexAttribPointer(",[et,Qn,Mn,_e.normalized,_e.stride,_e.offset],");",Lt,".type=",Mn,";",Lt,".size=",Qn,";",en.map(function(sl){return Lt+"."+sl+"="+_e[sl]+";"}).join(""),"}"),or){var Ha=_e.divisor;de("if(",Lt,".divisor!==",Ha,"){",be.instancing,".vertexAttribDivisorANGLE(",[et,Ha],");",Lt,".divisor=",Ha,";}")}}function Vr(){de("if(",Lt,".buffer){",Ve,".disableVertexAttribArray(",et,");",Lt,".buffer=null;","}if(",RT.map(function(Mn,Qn){return Lt+"."+Mn+"!=="+ir[Qn]}).join("||"),"){",Ve,".vertexAttrib4f(",et,",",ir,");",RT.map(function(Mn,Qn){return Lt+"."+Mn+"="+ir[Qn]+";"}).join(""),"}")}Rt===DT?di():Rt===cW?Vr():(de("if(",Rt,"===",DT,"){"),di(),de("}else{"),Vr(),de("}"))}He.forEach(function(Ee){var De=Ee.name,_e=Ne.attributes[De],Ve;if(_e){if(!Ke(_e))return;Ve=_e.append(be,de)}else{if(!Ke(yde))return;var et=be.scopeAttrib(De);J.optional(function(){be.assert(de,et+".state","missing attribute "+De)}),Ve={},Object.keys(new Ye).forEach(function(Lt){Ve[Lt]=de.def(et,".",Lt)})}ze(be.link(Ee),Fe(Ee.info.type),Ve)})}function io(be,de,Ne,He,Ke){for(var Ge=be.shared,Fe=Ge.gl,ze,Ee=0;Ee1?de(no(Mn,function(ff){return Array.isArray(bt)?bt[ff]:bt+"["+ff+"]"})):(J(!Array.isArray(bt),"uniform value must not be an array"),de(bt));de(");")}}function bn(be,de,Ne,He){var Ke=be.shared,Ge=Ke.gl,Fe=Ke.draw,ze=He.draw;function Ee(){var Qn=ze.elements,Ha,sl=de;return Qn?((Qn.contextDep&&He.contextDynamic||Qn.propDep)&&(sl=Ne),Ha=Qn.append(be,sl)):Ha=sl.def(Fe,".",Bw),Ha&&sl("if("+Ha+")"+Ge+".bindBuffer("+Zet+","+Ha+".buffer.buffer);"),Ha}function De(){var Qn=ze.count,Ha,sl=de;return Qn?((Qn.contextDep&&He.contextDynamic||Qn.propDep)&&(sl=Ne),Ha=Qn.append(be,sl),J.optional(function(){Qn.MISSING&&be.assert(de,"false","missing vertex count"),Qn.DYNAMIC&&be.assert(sl,Ha+">=0","missing vertex count")})):(Ha=sl.def(Fe,".",zw),J.optional(function(){be.assert(sl,Ha+">=0","missing vertex count")})),Ha}var _e=Ee();function Ve(Qn){var Ha=ze[Qn];return Ha?Ha.contextDep&&He.contextDynamic||Ha.propDep?Ha.append(be,Ne):Ha.append(be,de):de.def(Fe,".",Qn)}var et=Ve(Gw),Lt=Ve(mF),Rt=De();if(typeof Rt=="number"){if(Rt===0)return}else Ne("if(",Rt,"){"),Ne.exit("}");var bt,ir;or&&(bt=Ve(_F),ir=be.instancing);var en=_e+".type",di=ze.elements&&ex(ze.elements);function Vr(){function Qn(){Ne(ir,".drawElementsInstancedANGLE(",[et,Rt,en,Lt+"<<(("+en+"-"+zfe+")>>1)",bt],");")}function Ha(){Ne(ir,".drawArraysInstancedANGLE(",[et,Lt,Rt,bt],");")}_e?di?Qn():(Ne("if(",_e,"){"),Qn(),Ne("}else{"),Ha(),Ne("}")):Ha()}function Mn(){function Qn(){Ne(Ge+".drawElements("+[et,Rt,en,Lt+"<<(("+en+"-"+zfe+")>>1)"]+");")}function Ha(){Ne(Ge+".drawArrays("+[et,Lt,Rt]+");")}_e?di?Qn():(Ne("if(",_e,"){"),Qn(),Ne("}else{"),Ha(),Ne("}")):Ha()}or&&(typeof bt!="number"||bt>=0)?typeof bt=="string"?(Ne("if(",bt,">0){"),Vr(),Ne("}else if(",bt,"<0){"),Mn(),Ne("}")):Vr():Mn()}function Mi(be,de,Ne,He,Ke){var Ge=Nn(),Fe=Ge.proc("body",Ke);return J.optional(function(){Ge.commandStr=de.commandStr,Ge.command=Ge.link(de.commandStr)}),or&&(Ge.instancing=Fe.def(Ge.shared.extensions,".angle_instanced_arrays")),be(Ge,Fe,Ne,He),Ge.compile().body}function ia(be,de,Ne,He){bl(be,de),Ne.useVAO?Ne.drawVAO?de(be.shared.vao,".setVAO(",Ne.drawVAO.append(be,de),");"):de(be.shared.vao,".setVAO(",be.shared.vao,".targetVAO);"):(de(be.shared.vao,".setVAO(null);"),wh(be,de,Ne,He.attributes,function(){return!0})),io(be,de,Ne,He.uniforms,function(){return!0}),bn(be,de,de,Ne)}function El(be,de){var Ne=be.proc("draw",1);bl(be,Ne),Ql(be,Ne,de.context),eu(be,Ne,de.framebuffer),Xu(be,Ne,de),Sh(be,Ne,de.state),fi(be,Ne,de,!1,!0);var He=de.shader.progVar.append(be,Ne);if(Ne(be.shared.gl,".useProgram(",He,".program);"),de.shader.program)ia(be,Ne,de,de.shader.program);else{Ne(be.shared.vao,".setVAO(null);");var Ke=be.global.def("{}"),Ge=Ne.def(He,".id"),Fe=Ne.def(Ke,"[",Ge,"]");Ne(be.cond(Fe).then(Fe,".call(this,a0);").else(Fe,"=",Ke,"[",Ge,"]=",be.link(function(ze){return Mi(ia,be,de,ze,1)}),"(",He,");",Fe,".call(this,a0);"))}Object.keys(de.state).length>0&&Ne(be.shared.current,".dirty=true;")}function K0(be,de,Ne,He){be.batchId="a1",bl(be,de);function Ke(){return!0}wh(be,de,Ne,He.attributes,Ke),io(be,de,Ne,He.uniforms,Ke),bn(be,de,de,Ne)}function Vw(be,de,Ne,He){bl(be,de);var Ke=Ne.contextDep,Ge=de.def(),Fe="a0",ze="a1",Ee=de.def();be.shared.props=Ee,be.batchId=Ge;var De=be.scope(),_e=be.scope();de(De.entry,"for(",Ge,"=0;",Ge,"<",ze,";++",Ge,"){",Ee,"=",Fe,"[",Ge,"];",_e,"}",De.exit);function Ve(en){return en.contextDep&&Ke||en.propDep}function et(en){return!Ve(en)}if(Ne.needsContext&&Ql(be,_e,Ne.context),Ne.needsFramebuffer&&eu(be,_e,Ne.framebuffer),Sh(be,_e,Ne.state,Ve),Ne.profile&&Ve(Ne.profile)&&fi(be,_e,Ne,!1,!0),He)Ne.useVAO?Ne.drawVAO?Ve(Ne.drawVAO)?_e(be.shared.vao,".setVAO(",Ne.drawVAO.append(be,_e),");"):De(be.shared.vao,".setVAO(",Ne.drawVAO.append(be,De),");"):De(be.shared.vao,".setVAO(",be.shared.vao,".targetVAO);"):(De(be.shared.vao,".setVAO(null);"),wh(be,De,Ne,He.attributes,et),wh(be,_e,Ne,He.attributes,Ve)),io(be,De,Ne,He.uniforms,et),io(be,_e,Ne,He.uniforms,Ve),bn(be,De,_e,Ne);else{var Lt=be.global.def("{}"),Rt=Ne.shader.progVar.append(be,_e),bt=_e.def(Rt,".id"),ir=_e.def(Lt,"[",bt,"]");_e(be.shared.gl,".useProgram(",Rt,".program);","if(!",ir,"){",ir,"=",Lt,"[",bt,"]=",be.link(function(en){return Mi(K0,be,Ne,en,2)}),"(",Rt,");}",ir,".call(this,a0[",Ge,"],",Ge,");")}}function Ie(be,de){var Ne=be.proc("batch",2);be.batchId="0",bl(be,Ne);var He=!1,Ke=!0;Object.keys(de.context).forEach(function(Lt){He=He||de.context[Lt].propDep}),He||(Ql(be,Ne,de.context),Ke=!1);var Ge=de.framebuffer,Fe=!1;Ge?(Ge.propDep?He=Fe=!0:Ge.contextDep&&He&&(Fe=!0),Fe||eu(be,Ne,Ge)):eu(be,Ne,null),de.state.viewport&&de.state.viewport.propDep&&(He=!0);function ze(Lt){return Lt.contextDep&&He||Lt.propDep}Xu(be,Ne,de),Sh(be,Ne,de.state,function(Lt){return!ze(Lt)}),(!de.profile||!ze(de.profile))&&fi(be,Ne,de,!1,"a1"),de.contextDep=He,de.needsContext=Ke,de.needsFramebuffer=Fe;var Ee=de.shader.progVar;if(Ee.contextDep&&He||Ee.propDep)Vw(be,Ne,de,null);else{var De=Ee.append(be,Ne);if(Ne(be.shared.gl,".useProgram(",De,".program);"),de.shader.program)Vw(be,Ne,de,de.shader.program);else{Ne(be.shared.vao,".setVAO(null);");var _e=be.global.def("{}"),Ve=Ne.def(De,".id"),et=Ne.def(_e,"[",Ve,"]");Ne(be.cond(et).then(et,".call(this,a0,a1);").else(et,"=",_e,"[",Ve,"]=",be.link(function(Lt){return Mi(Vw,be,de,Lt,2)}),"(",De,");",et,".call(this,a0,a1);"))}}Object.keys(de.state).length>0&&Ne(be.shared.current,".dirty=true;")}function vt(be,de){var Ne=be.proc("scope",3);be.batchId="a2";var He=be.shared,Ke=He.current;Ql(be,Ne,de.context),de.framebuffer&&de.framebuffer.append(be,Ne),gde(Object.keys(de.state)).forEach(function(Fe){var ze=de.state[Fe],Ee=ze.append(be,Ne);An(Ee)?Ee.forEach(function(De,_e){Ne.set(be.next[Fe],"["+_e+"]",De)}):Ne.set(He.next,"."+Fe,Ee)}),fi(be,Ne,de,!0,!0),[Bw,mF,zw,_F,Gw].forEach(function(Fe){var ze=de.draw[Fe];!ze||Ne.set(He.draw,"."+Fe,""+ze.append(be,Ne))}),Object.keys(de.uniforms).forEach(function(Fe){var ze=de.uniforms[Fe].append(be,Ne);Array.isArray(ze)&&(ze="["+ze.join()+"]"),Ne.set(He.uniforms,"["+ge.id(Fe)+"]",ze)}),Object.keys(de.attributes).forEach(function(Fe){var ze=de.attributes[Fe].append(be,Ne),Ee=be.scopeAttrib(Fe);Object.keys(new Ye).forEach(function(De){Ne.set(Ee,"."+De,ze[De])})}),de.scopeVAO&&Ne.set(He.vao,".targetVAO",de.scopeVAO.append(be,Ne));function Ge(Fe){var ze=de.shader[Fe];ze&&Ne.set(He.shader,"."+Fe,ze.append(be,Ne))}Ge(RL),Ge(DL),Object.keys(de.state).length>0&&(Ne(Ke,".dirty=true;"),Ne.exit(Ke,".dirty=true;")),Ne("a1(",be.shared.context,",a0,",be.batchId,");")}function it(be){if(!(typeof be!="object"||An(be))){for(var de=Object.keys(be),Ne=0;Ne=0;--bn){var Mi=Ut[bn];Mi&&Mi(Jt,null,0)}Pe.flush(),lr&&lr.update()}function xi(){!Ei&&Ut.length>0&&(Ei=pn.next(Xn))}function Wa(){Ei&&(pn.cancel(Xn),Ei=null)}function Fl(bn){bn.preventDefault(),Ot=!0,Wa(),Nn.forEach(function(Mi){Mi()})}function wu(bn){Pe.getError(),Ot=!1,lt.restore(),Xt.restore(),or.restore(),yr.restore(),jt.restore(),mr.restore(),Mr.restore(),lr&&lr.restore(),cn.procs.refresh(),xi(),ci.forEach(function(Mi){Mi()})}hr&&(hr.addEventListener(_de,Fl,!1),hr.addEventListener(xde,wu,!1));function Ri(){Ut.length=0,Wa(),hr&&(hr.removeEventListener(_de,Fl),hr.removeEventListener(xde,wu)),Xt.clear(),mr.clear(),jt.clear(),yr.clear(),Nr.clear(),or.clear(),Mr.clear(),lr&&lr.clear(),Ur.forEach(function(bn){bn()})}function Jl(bn){J(!!bn,"invalid args to regl({...})"),J.type(bn,"object","invalid args to regl({...})");function Mi(Ke){var Ge=r({},Ke);delete Ge.uniforms,delete Ge.attributes,delete Ge.context,delete Ge.vao,"stencil"in Ge&&Ge.stencil.op&&(Ge.stencil.opBack=Ge.stencil.opFront=Ge.stencil.op,delete Ge.stencil.op);function Fe(ze){if(ze in Ge){var Ee=Ge[ze];delete Ge[ze],Object.keys(Ee).forEach(function(De){Ge[ze+"."+De]=Ee[De]})}}return Fe("blend"),Fe("depth"),Fe("cull"),Fe("stencil"),Fe("polygonOffset"),Fe("scissor"),Fe("sample"),"vao"in Ke&&(Ge.vao=Ke.vao),Ge}function ia(Ke,Ge){var Fe={},ze={};return Object.keys(Ke).forEach(function(Ee){var De=Ke[Ee];if(jr.isDynamic(De)){ze[Ee]=jr.unbox(De,Ee);return}else if(Ge&&Array.isArray(De)){for(var _e=0;_e0)return Ti.call(this,Ne(Ke|0),Ke|0)}else if(Array.isArray(Ke)){if(Ke.length)return Ti.call(this,Ke,Ke.length)}else return Br.call(this,Ke)}return r(He,{stats:vt,destroy:function(){it.destroy()}})}var fs=mr.setFBO=Jl({framebuffer:jr.define.call(null,Sde,"framebuffer")});function Bl(bn,Mi){var ia=0;cn.procs.poll();var El=Mi.color;El&&(Pe.clearColor(+El[0]||0,+El[1]||0,+El[2]||0,+El[3]||0),ia|=_tt),"depth"in Mi&&(Pe.clearDepth(+Mi.depth),ia|=xtt),"stencil"in Mi&&(Pe.clearStencil(Mi.stencil|0),ia|=Stt),J(!!ia,"called regl.clear with no buffer specified"),Pe.clear(ia)}function Ql(bn){if(J(typeof bn=="object"&&bn,"regl.clear() takes an object as input"),"framebuffer"in bn)if(bn.framebuffer&&bn.framebuffer_reglType==="framebufferCube")for(var Mi=0;Mi<6;++Mi)fs(r({framebuffer:bn.framebuffer.faces[Mi]},bn),Bl);else fs(bn,Bl);else Bl(null,bn)}function eu(bn){J.type(bn,"function","regl.frame() callback must be a function"),Ut.push(bn);function Mi(){var ia=wde(Ut,bn);J(ia>=0,"cannot cancel a frame twice");function El(){var K0=wde(Ut,El);Ut[K0]=Ut[Ut.length-1],Ut.length-=1,Ut.length<=0&&Wa()}Ut[ia]=El}return xi(),{cancel:Mi}}function Xu(){var bn=Tr.viewport,Mi=Tr.scissor_box;bn[0]=bn[1]=Mi[0]=Mi[1]=0,Jt.viewportWidth=Jt.framebufferWidth=Jt.drawingBufferWidth=bn[2]=Mi[2]=Pe.drawingBufferWidth,Jt.viewportHeight=Jt.framebufferHeight=Jt.drawingBufferHeight=bn[3]=Mi[3]=Pe.drawingBufferHeight}function Sh(){Jt.tick+=1,Jt.time=fi(),Xu(),cn.procs.poll()}function bl(){yr.refresh(),Xu(),cn.procs.refresh(),lr&&lr.update()}function fi(){return(Jn()-tr)/1e3}bl();function wh(bn,Mi){J.type(Mi,"function","listener callback must be a function");var ia;switch(bn){case"frame":return eu(Mi);case"lost":ia=Nn;break;case"restore":ia=ci;break;case"destroy":ia=Ur;break;default:J.raise("invalid event, must be one of frame,lost,restore,destroy")}return ia.push(Mi),{cancel:function(){for(var El=0;El=0},read:Hn,destroy:Ri,_gl:Pe,_refresh:bl,poll:function(){Sh(),lr&&lr.update()},now:fi,stats:Kt});return ge.onDone(null,io),io}return Ttt})})(CHe);const mhr=CHe.exports;var _hr=function(){function n(e,t){z0(this,n),this.attribute=void 0,this.buffer=void 0;var r=t.buffer,i=t.offset,a=t.stride,o=t.normalized,s=t.size,l=t.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:a||0,normalized:o||!1,divisor:l||0},s&&(this.attribute.size=s)}return U0(n,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),n}(),e1,CP,t1,Qv,AP,px,MP,G5,oy,gb,rc,sy,ly,z5,xhr=(e1={},Lr(e1,Qt.POINTS,"points"),Lr(e1,Qt.LINES,"lines"),Lr(e1,Qt.LINE_LOOP,"line loop"),Lr(e1,Qt.LINE_STRIP,"line strip"),Lr(e1,Qt.TRIANGLES,"triangles"),Lr(e1,Qt.TRIANGLE_FAN,"triangle fan"),Lr(e1,Qt.TRIANGLE_STRIP,"triangle strip"),e1),AHe=(CP={},Lr(CP,Qt.STATIC_DRAW,"static"),Lr(CP,Qt.DYNAMIC_DRAW,"dynamic"),Lr(CP,Qt.STREAM_DRAW,"stream"),CP),zle=(t1={},Lr(t1,Qt.BYTE,"int8"),Lr(t1,Qt.UNSIGNED_INT,"int16"),Lr(t1,Qt.INT,"int32"),Lr(t1,Qt.UNSIGNED_BYTE,"uint8"),Lr(t1,Qt.UNSIGNED_SHORT,"uint16"),Lr(t1,Qt.UNSIGNED_INT,"uint32"),Lr(t1,Qt.FLOAT,"float"),t1),Shr=(Qv={},Lr(Qv,Qt.ALPHA,"alpha"),Lr(Qv,Qt.LUMINANCE,"luminance"),Lr(Qv,Qt.LUMINANCE_ALPHA,"luminance alpha"),Lr(Qv,Qt.RGB,"rgb"),Lr(Qv,Qt.RGBA,"rgba"),Lr(Qv,Qt.RGBA4,"rgba4"),Lr(Qv,Qt.RGB5_A1,"rgb5 a1"),Lr(Qv,Qt.RGB565,"rgb565"),Lr(Qv,Qt.DEPTH_COMPONENT,"depth"),Lr(Qv,Qt.DEPTH_STENCIL,"depth stencil"),Qv),whr=(AP={},Lr(AP,Qt.DONT_CARE,"dont care"),Lr(AP,Qt.NICEST,"nice"),Lr(AP,Qt.FASTEST,"fast"),AP),wEe=(px={},Lr(px,Qt.NEAREST,"nearest"),Lr(px,Qt.LINEAR,"linear"),Lr(px,Qt.LINEAR_MIPMAP_LINEAR,"mipmap"),Lr(px,Qt.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Lr(px,Qt.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Lr(px,Qt.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),px),bEe=(MP={},Lr(MP,Qt.REPEAT,"repeat"),Lr(MP,Qt.CLAMP_TO_EDGE,"clamp"),Lr(MP,Qt.MIRRORED_REPEAT,"mirror"),MP),bhr=(G5={},Lr(G5,Qt.NONE,"none"),Lr(G5,Qt.BROWSER_DEFAULT_WEBGL,"browser"),G5),Ehr=(oy={},Lr(oy,Qt.NEVER,"never"),Lr(oy,Qt.ALWAYS,"always"),Lr(oy,Qt.LESS,"less"),Lr(oy,Qt.LEQUAL,"lequal"),Lr(oy,Qt.GREATER,"greater"),Lr(oy,Qt.GEQUAL,"gequal"),Lr(oy,Qt.EQUAL,"equal"),Lr(oy,Qt.NOTEQUAL,"notequal"),oy),EEe=(gb={},Lr(gb,Qt.FUNC_ADD,"add"),Lr(gb,Qt.MIN_EXT,"min"),Lr(gb,Qt.MAX_EXT,"max"),Lr(gb,Qt.FUNC_SUBTRACT,"subtract"),Lr(gb,Qt.FUNC_REVERSE_SUBTRACT,"reverse subtract"),gb),U5=(rc={},Lr(rc,Qt.ZERO,"zero"),Lr(rc,Qt.ONE,"one"),Lr(rc,Qt.SRC_COLOR,"src color"),Lr(rc,Qt.ONE_MINUS_SRC_COLOR,"one minus src color"),Lr(rc,Qt.SRC_ALPHA,"src alpha"),Lr(rc,Qt.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Lr(rc,Qt.DST_COLOR,"dst color"),Lr(rc,Qt.ONE_MINUS_DST_COLOR,"one minus dst color"),Lr(rc,Qt.DST_ALPHA,"dst alpha"),Lr(rc,Qt.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Lr(rc,Qt.CONSTANT_COLOR,"constant color"),Lr(rc,Qt.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Lr(rc,Qt.CONSTANT_ALPHA,"constant alpha"),Lr(rc,Qt.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Lr(rc,Qt.SRC_ALPHA_SATURATE,"src alpha saturate"),rc),Thr=(sy={},Lr(sy,Qt.NEVER,"never"),Lr(sy,Qt.ALWAYS,"always"),Lr(sy,Qt.LESS,"less"),Lr(sy,Qt.LEQUAL,"lequal"),Lr(sy,Qt.GREATER,"greater"),Lr(sy,Qt.GEQUAL,"gequal"),Lr(sy,Qt.EQUAL,"equal"),Lr(sy,Qt.NOTEQUAL,"notequal"),sy),pC=(ly={},Lr(ly,Qt.ZERO,"zero"),Lr(ly,Qt.KEEP,"keep"),Lr(ly,Qt.REPLACE,"replace"),Lr(ly,Qt.INVERT,"invert"),Lr(ly,Qt.INCR,"increment"),Lr(ly,Qt.DECR,"decrement"),Lr(ly,Qt.INCR_WRAP,"increment wrap"),Lr(ly,Qt.DECR_WRAP,"decrement wrap"),ly),Chr=(z5={},Lr(z5,Qt.FRONT,"front"),Lr(z5,Qt.BACK,"back"),z5),Ahr=function(){function n(e,t){z0(this,n),this.buffer=void 0;var r=t.data,i=t.usage,a=t.type;this.buffer=e.buffer({data:r,usage:AHe[i||Qt.STATIC_DRAW],type:zle[a||Qt.UNSIGNED_BYTE]})}return U0(n,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){}},{key:"subData",value:function(t){var r=t.data,i=t.offset;this.buffer.subdata(r,i)}}]),n}();function Kee(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t16)throw new Error("invalid data type ".concat(c));i[h]=function(){return u.data}}});var a=this.getOuputDataTexture(),o=a.textureWidth,s=a.texelCount;i.u_OutputTextureSize=[o,o],i.u_OutputTexelCount=s,this.context.output.textureSize=[o,o];var l={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:`#ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; #else precision mediump float; #endif `.concat(this.context.shader),uniforms:i,vert:Rhr,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(l)}return U0(n,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use(function(){t.computeCommand()})}},{key:"readData",value:function(){var e=Vc(Rc.mark(function r(){var i=this,a,o,s,l,u,h,c,f;return Rc.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(this.reGl({framebuffer:this.texFBO})(function(){a=i.reGl.read()}),!a){v.next=6;break}if(o=this.getOuputDataTexture(),s=o.originalDataLength,l=o.elementsPerTexel,u=o.typedArrayConstructor,h=u===void 0?Float32Array:u,c=[],l!==4)for(f=0;f0&&arguments[0]!==void 0?arguments[0]:{},r=new n;return r.setConfig(t),r.setEngine(new ecr),r}}]),n}();const rcr=Object.freeze(Object.defineProperty({__proto__:null,World:tcr,Kernel:THe},Symbol.toStringTag,{value:"Module"})),IHe=Nd(rcr);var lv={};Object.defineProperty(lv,"__esModule",{value:!0});lv.arrayToTextureData=lv.attributesToTextureData=lv.buildTextureDataWithTwoEdgeAttr=lv.buildTextureData=lv.proccessToFunc=void 0;var ncr=Dl(),W9=nV,icr=function(n,e){var t;return n?(0,ncr.isNumber)(n)?t=function(){return n}:t=n:t=function(){return e||1},t};lv.proccessToFunc=icr;var acr=function(n,e){var t=[],r=[],i={},a=0;for(a=0;a 0.0) { dx += param * xDist; dy += param * yDist; if (xDist == 0 && yDist == 0) { const sign = i < j ? 1 : -1; dx += param * sign; dy += param * sign; } } } } return [dx, dy]; } calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { // let dx = 0, dy = 0; const vx = currentNode[0] - this.u_Center[0]; const vy = currentNode[1] - this.u_Center[1]; const gf = 0.01 * this.u_K * this.u_Gravity; dx = gf * vx; dy = gf * vy; if (this.u_Clustering == 1) { const clusterIdx = int(nodeAttributes[0]); const center = this.u_ClusterCenters[clusterIdx]; const cvx = currentNode[0] - center[0]; const cvy = currentNode[1] - center[1]; const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01; const parma = this.u_K * this.u_ClusterGravity / dist; dx += parma * cvx; dy += parma * cvy; } return [dx, dy]; } calcAttractive(i: int, currentNode: vec4): vec2 { let dx = 0, dy = 0; const arr_offset = int(floor(currentNode[2] + 0.5)); const length = int(floor(currentNode[3] + 0.5)); const node_buffer: vec4; for (let p = 0; p < MAX_EDGE_PER_VERTEX; p++) { if (p >= length) break; const arr_idx = arr_offset + p; // when arr_idx % 4 == 0 update currentNodedx_buffer const buf_offset = arr_idx - arr_idx / 4 * 4; if (p == 0 || buf_offset == 0) { node_buffer = this.u_Data[int(arr_idx / 4)]; } const float_j = buf_offset == 0 ? node_buffer[0] : buf_offset == 1 ? node_buffer[1] : buf_offset == 2 ? node_buffer[2] : node_buffer[3]; const nextNode = this.u_Data[int(float_j)]; const xDist = currentNode[0] - nextNode[0]; const yDist = currentNode[1] - nextNode[1]; const dist = sqrt(xDist * xDist + yDist * yDist) + 0.01; let attractiveF = dist / this.u_K; if (dist > 0.0) { dx -= xDist * attractiveF; dy -= yDist * attractiveF; if (xDist == 0 && yDist == 0) { const sign = i < int(float_j) ? 1 : -1; dx -= sign * attractiveF; dy -= sign * attractiveF; } } } return [dx, dy]; } @main compute() { const i = globalInvocationID.x; const currentNode = this.u_Data[i]; let dx = 0, dy = 0; if (i >= VERTEX_COUNT) { this.u_Data[i] = currentNode; return; } // [gravity, fx, fy, 0] const nodeAttributes = this.u_AttributeArray[i]; if (nodeAttributes[1] != 0 && nodeAttributes[2] != 0) { // the node is fixed this.u_Data[i] = [ nodeAttributes[1], nodeAttributes[2], currentNode[2], currentNode[3] ]; return; } // repulsive const repulsive = this.calcRepulsive(i, currentNode); dx += repulsive[0]; dy += repulsive[1]; // attractive const attractive = this.calcAttractive(i, currentNode); dx += attractive[0]; dy += attractive[1]; // gravity const gravity = this.calcGravity(currentNode, nodeAttributes); dx -= gravity[0]; dy -= gravity[1]; // speed dx *= this.u_Speed; dy *= this.u_Speed; // move const distLength = sqrt(dx * dx + dy * dy); if (distLength > 0.0) { const limitedDist = min(this.u_MaxDisplace * this.u_Speed, distLength); this.u_Data[i] = [ currentNode[0] + dx / distLength * limitedDist, currentNode[1] + dy / distLength * limitedDist, currentNode[2], currentNode[3] ]; } } } `;Wy.fruchtermanBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}';Wy.clusterCode=` import { globalInvocationID } from 'g-webgpu'; const VERTEX_COUNT; const CLUSTER_COUNT; @numthreads(1, 1, 1) class CalcCenter { @in u_Data: vec4[]; @in u_NodeAttributes: vec4[]; // [[clusterIdx, 0, 0, 0], ...] @in @out u_ClusterCenters: vec4[]; // [[cx, cy, nodeCount, clusterIdx], ...] @main compute() { const i = globalInvocationID.x; const center = this.u_ClusterCenters[i]; let sumx = 0; let sumy = 0; let count = 0; for (let j = 0; j < VERTEX_COUNT; j++) { const attributes = this.u_NodeAttributes[j]; const clusterIdx = int(attributes[0]); const vertex = this.u_Data[j]; if (clusterIdx == i) { sumx += vertex.x; sumy += vertex.y; count += 1; } } this.u_ClusterCenters[i] = [ sumx / count, sumy / count, count, i ]; } } `;Wy.clusterBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}';var ucr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),V5=at&&at.__awaiter||function(n,e,t,r){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(h){try{u(r.next(h))}catch(c){o(c)}}function l(h){try{u(r.throw(h))}catch(c){o(c)}}function u(h){h.done?a(h.value):i(h.value).then(s,l)}u((r=r.apply(n,e||[])).next())})},$5=at&&at.__generator||function(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(h){return l([u,h])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]= length) break; const arr_idx = arr_offset + 4 * p; // i \u8282\u70B9\u7684\u7B2C p \u6761\u8FB9\u5F00\u59CB\u7684\u5C0F\u683C\u5B50\u4F4D\u7F6E const buf_offset = arr_idx - arr_idx / 4 * 4; if (p == 0 || buf_offset == 0) { node_buffer = this.u_Data[int(arr_idx / 4)]; // \u5927\u683C\u5B50\uFF0C\u5927\u683C\u5B50\u4F4D\u7F6E=\u5C0F\u4E2A\u5B50\u4F4D\u7F6E / 4\uFF0C } let float_j: float = node_buffer[0]; const nextNode = this.u_Data[int(float_j)]; const vx = nextNode[0] - currentNode[0]; const vy = nextNode[1] - currentNode[1]; const dist = sqrt(vx * vx + vy * vy) + 0.01; const direx = vx / dist; const direy = vy / dist; const edgeLength = node_buffer[1]; const edgeStrength = node_buffer[2]; const diff: float = edgeLength - dist;//edgeLength // const param = diff * this.u_stiffness / mass; // const param = diff * edgeStrength / mass; // ax -= direx * param; ay -= direy * param; } return [ax, ay]; } @main compute() { const i = globalInvocationID.x; const currentNode = this.u_Data[i]; const movement = u_AveMovement[0]; let ax = 0, ay = 0; if (i >= VERTEX_COUNT || movement.x < u_minMovement) { this.u_Data[i] = currentNode; return; } // \u6BCF\u4E2A\u8282\u70B9\u5C5E\u6027\u5360\u4E24\u4E2A\u6570\u7EC4\u4E2D\u5404\u4E00\u683C // [mass, degree, nodeStrength, fx] const nodeAttributes1 = this.u_NodeAttributeArray1[i]; // [centerX, centerY, centerGravity, fy] const nodeAttributes2 = this.u_NodeAttributeArray2[i]; // repulsive const repulsive = this.calcRepulsive(i, currentNode); ax += repulsive[0]; ay += repulsive[1]; // attractive const attractive = this.calcAttractive(i, currentNode, nodeAttributes1); ax += attractive[0]; ay += attractive[1]; // gravity const gravity = this.calcGravity(i, currentNode, nodeAttributes2); ax -= gravity[0]; ay -= gravity[1]; // speed const param = this.u_interval * this.u_damping; let vx = ax * param; let vy = ay * param; const vlength = sqrt(vx * vx + vy * vy) + 0.0001; if (vlength > this.u_maxSpeed) { const param2 = this.u_maxSpeed / vlength; vx = param2 * vx; vy = param2 * vy; } // move if (nodeAttributes1[3] != 0 && nodeAttributes2[3] != 0) { this.u_Data[i] = [ nodeAttributes1[3], nodeAttributes2[3], currentNode[2], 0 ]; } else { const distx = vx * this.u_interval; const disty = vy * this.u_interval; const distLength = sqrt(distx * distx + disty * disty); this.u_Data[i] = [ currentNode[0] + distx, currentNode[1] + disty, currentNode[2], distLength ]; } // the avarage move distance // need to share memory } } `;Hy.gForceBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {float distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}';Hy.aveMovementCode=` const VERTEX_COUNT; @numthreads(1, 1, 1) class CalcAveMovement { @in u_Data: vec4[]; @in u_iter: float; @in @out u_AveMovement: vec4[]; @main compute() { let movement = 0; for (let j: int = 0; j < VERTEX_COUNT; j++) { const vertex = this.u_Data[j]; movement += vertex[3]; } movement = movement / float(VERTEX_COUNT); this.u_AveMovement[0] = [movement, 0, 0, 0]; } } `;Hy.aveMovementBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}';var dcr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),AY=at&&at.__awaiter||function(n,e,t,r){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(h){try{u(r.next(h))}catch(c){o(c)}}function l(h){try{u(r.throw(h))}catch(c){o(c)}}function u(h){h.done?a(h.value):i(h.value).then(s,l)}u((r=r.apply(n,e||[])).next())})},MY=at&&at.__generator||function(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(h){return l([u,h])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]G.size[1]?G.size[0]:G.size[1];return W/2}if((0,zi.isObject)(G.size)){var W=G.size.width>G.size.height?G.size.width:G.size.height;return W/2}return G.size/2}return 10};else if((0,zi.isFunction)(g))y=function(G){return g(G)};else if((0,zi.isArray)(g)){var x=g[0]>g[1]?g[0]:g[1],S=x/2;y=function(G){return S}}else{var w=g/2;y=function(G){return w}}this.nodeSize=y;var b=t.comboSpacing,E;(0,zi.isNumber)(b)?E=function(){return b}:(0,zi.isFunction)(b)?E=b:E=function(){return 0},this.comboSpacing=E;var T=t.comboPadding,C;(0,zi.isNumber)(T)?C=function(){return T}:(0,zi.isArray)(T)?C=function(){return Math.max.apply(null,T)}:(0,zi.isFunction)(T)?C=T:C=function(){return 0},this.comboPadding=C;var A=this.linkDistance,M;A||(A=10),(0,zi.isNumber)(A)?M=function(G){return A}:M=A,this.linkDistance=M;var I=this.edgeStrength,R;I||(I=1),(0,zi.isNumber)(I)?R=function(G){return I}:R=I,this.edgeStrength=R;var k=this.nodeStrength,D;k||(k=30),(0,zi.isNumber)(k)?D=function(G){return k}:D=k,this.nodeStrength=D},e.prototype.initPos=function(t){var r=this,i=r.nodes;i.forEach(function(a,o){var s=a.comboId,l=t[s];s&&l?(a.x=l.cx+100/(o+1),a.y=l.cy+100/(o+1)):(a.x=100/(o+1),a.y=100/(o+1))})},e.prototype.getComboMap=function(){var t=this,r=t.nodeMap,i=t.comboTrees,a=t.oriComboMap,o={};return(i||[]).forEach(function(s){var l=[];(0,zi.traverseTreeUp)(s,function(u){if(u.itemType==="node"||!a[u.id])return!0;if(o[u.id]===void 0){var h={id:u.id,name:u.id,cx:0,cy:0,count:0,depth:t.oriComboMap[u.id].depth||0,children:[]};o[u.id]=h}var c=u.children;c&&c.forEach(function(v){if(!o[v.id]&&!r[v.id])return!0;l.push(v)});var f=o[u.id];if(f.cx=0,f.cy=0,l.length===0){f.empty=!0;var d=a[u.id];f.cx=d.x,f.cy=d.y}return l.forEach(function(v){if(f.count++,v.itemType!=="node"){var p=o[v.id];(0,zi.isNumber)(p.cx)&&(f.cx+=p.cx),(0,zi.isNumber)(p.cy)&&(f.cy+=p.cy);return}var g=r[v.id];!g||((0,zi.isNumber)(g.x)&&(f.cx+=g.x),(0,zi.isNumber)(g.y)&&(f.cy+=g.y))}),f.cx/=f.count||1,f.cy/=f.count||1,f.children=l,!0})}),o},e.prototype.applyComboCenterForce=function(t){var r=this,i=r.gravity,a=r.comboGravity||i,o=this.alpha,s=r.comboTrees,l=r.indexMap,u=r.nodeMap,h=r.comboMap;(s||[]).forEach(function(c){(0,zi.traverseTreeUp)(c,function(f){if(f.itemType==="node")return!0;var d=h[f.id];if(!d)return!0;var v=h[f.id],p=(v.depth+1)/10*.5,g=v.cx,m=v.cy;return v.cx=0,v.cy=0,v.children.forEach(function(y){if(y.itemType!=="node"){var _=h[y.id];_&&(0,zi.isNumber)(_.cx)&&(v.cx+=_.cx),_&&(0,zi.isNumber)(_.cy)&&(v.cy+=_.cy);return}var x=u[y.id],S=x.x-g||.005,w=x.y-m||.005,b=Math.sqrt(S*S+w*w),E=l[x.id],T=a*o/b*p;t[E].x-=S*T,t[E].y-=w*T,(0,zi.isNumber)(x.x)&&(v.cx+=x.x),(0,zi.isNumber)(x.y)&&(v.cy+=x.y)}),v.cx/=v.count||1,v.cy/=v.count||1,!0})})},e.prototype.applyCalculate=function(t){var r=this,i=r.comboMap,a=r.nodes,o={};a.forEach(function(l,u){a.forEach(function(h,c){if(!(u_&&(f.minX=_),f.minY>x&&(f.minY=x),f.maxX1&&h.forEach(function(c,f){if(c.itemType==="node")return!1;var d=r[c.id];!d||h.forEach(function(v,p){if(f<=p||v.itemType==="node")return!1;var g=r[v.id];if(!g)return!1;var m=d.cx-g.cx||.005,y=d.cy-g.cy||.005,_=m*m+y*y,x=d.r||1,S=g.r||1,w=x+S,b=S*S,E=x*x;if(_o)){var C=r["".concat(p.id,"-").concat(S.id)],A=C.vx,M=C.vy,I=Math.log(Math.abs(S.depth-p.depth)/10)+1||1;I=I<1?1:I,S.comboId!==p.comboId&&(I+=1);var R=I?Math.pow(d,I):1,k=s(S)*l/E*R;if(t[g].x+=A*k,t[g].y+=M*k,g=0;R--)I(R);return{nodes:c,edges:f,combos:d,comboEdges:v}},l.prototype.getInnerGraphs=function(u){var h=this,c=h.comboTrees,f=h.nodeSize,d=h.edges,v=h.comboPadding,p=h.spacing,g={},m=this.innerLayout||new a.ConcentricLayout({type:"concentric",sortBy:"id"});return m.center=[0,0],m.preventOverlap=!0,m.nodeSpacing=p,(c||[]).forEach(function(y){(0,i.traverseTreeUp)(y,function(_){var x,S=(v==null?void 0:v(_))||10;if((0,i.isArray)(S)&&(S=Math.max.apply(Math,S)),!((x=_.children)===null||x===void 0)&&x.length){var b=_.children.map(function(z){if(z.itemType==="combo")return g[z.id];var V=u[z.id]||{};return e(e({},V),z)}),E=b.map(function(z){return z.id}),T={nodes:b,edges:d.filter(function(z){return E.includes(z.source)&&E.includes(z.target)})},C=1/0;b.forEach(function(z){var V;z.size||(z.size=((V=g[z.id])===null||V===void 0?void 0:V.size)||(f==null?void 0:f(z))||[30,30]),(0,i.isNumber)(z.size)&&(z.size=[z.size,z.size]),C>z.size[0]&&(C=z.size[0]),C>z.size[1]&&(C=z.size[1])}),m.layout(T);var A=(0,i.getLayoutBBox)(b),M=A.minX,I=A.minY,R=A.maxX,k=A.maxY,D={x:(R+M)/2,y:(k+I)/2};T.nodes.forEach(function(z){z.x-=D.x,z.y-=D.y});var G=Math.max(R-M,C)+S*2,W=Math.max(k-I,C)+S*2;g[_.id]={id:_.id,nodes:b,size:[G,W]}}else if(_.itemType==="combo"){var w=S?[S*2,S*2]:[30,30];g[_.id]={id:_.id,nodes:[],size:w}}return!0})}),g},l.prototype.initVals=function(){var u=this,h=u.nodeSize,c=u.spacing,f,d;if((0,i.isNumber)(c)?d=function(){return c}:(0,i.isFunction)(c)?d=c:d=function(){return 0},this.spacing=d,!h)f=function(_){var x=d(_);if(_.size){if((0,i.isArray)(_.size)){var S=_.size[0]>_.size[1]?_.size[0]:_.size[1];return(S+x)/2}if((0,i.isObject)(_.size)){var S=_.size.width>_.size.height?_.size.width:_.size.height;return(S+x)/2}return(_.size+x)/2}return 10+x/2};else if((0,i.isFunction)(h))f=function(_){var x=h(_),S=d(_);if((0,i.isArray)(_.size)){var w=_.size[0]>_.size[1]?_.size[0]:_.size[1];return(w+S)/2}return((x||10)+S)/2};else if((0,i.isArray)(h)){var v=h[0]>h[1]?h[0]:h[1],p=v/2;f=function(_){return p+d(_)/2}}else{var g=h/2;f=function(_){return g+d(_)/2}}this.nodeSize=f;var m=u.comboPadding,y;(0,i.isNumber)(m)?y=function(){return m}:(0,i.isArray)(m)?y=function(){return Math.max.apply(null,m)}:(0,i.isFunction)(m)?y=m:y=function(){return 0},this.comboPadding=y},l.prototype.getType=function(){return"comboCombined"},l}(r.Base);return IP.ComboCombinedLayout=o,IP}var vk={},Ule={};Object.defineProperty(Ule,"__esModule",{value:!0});var Scr=function(){function n(e){this.id=e.id||0,this.rx=e.rx,this.ry=e.ry,this.fx=0,this.fy=0,this.mass=e.mass,this.degree=e.degree,this.g=e.g||0}return n.prototype.distanceTo=function(e){var t=this.rx-e.rx,r=this.ry-e.ry;return Math.hypot(t,r)},n.prototype.setPos=function(e,t){this.rx=e,this.ry=t},n.prototype.resetForce=function(){this.fx=0,this.fy=0},n.prototype.addForce=function(e){var t=e.rx-this.rx,r=e.ry-this.ry,i=Math.hypot(t,r);i=i<1e-4?1e-4:i;var a=this.g*(this.degree+1)*(e.degree+1)/i;this.fx+=a*t/i,this.fy+=a*r/i},n.prototype.in=function(e){return e.contains(this.rx,this.ry)},n.prototype.add=function(e){var t=this.mass+e.mass,r=(this.rx*this.mass+e.rx*e.mass)/t,i=(this.ry*this.mass+e.ry*e.mass)/t,a=this.degree+e.degree,o={rx:r,ry:i,mass:t,degree:a};return new n(o)},n}();Ule.default=Scr;var Vle={};Object.defineProperty(Vle,"__esModule",{value:!0});var wcr=function(){function n(e){this.xmid=e.xmid,this.ymid=e.ymid,this.length=e.length,this.massCenter=e.massCenter||[0,0],this.mass=e.mass||1}return n.prototype.getLength=function(){return this.length},n.prototype.contains=function(e,t){var r=this.length/2;return e<=this.xmid+r&&e>=this.xmid-r&&t<=this.ymid+r&&t>=this.ymid-r},n.prototype.NW=function(){var e=this.xmid-this.length/4,t=this.ymid+this.length/4,r=this.length/2,i={xmid:e,ymid:t,length:r},a=new n(i);return a},n.prototype.NE=function(){var e=this.xmid+this.length/4,t=this.ymid+this.length/4,r=this.length/2,i={xmid:e,ymid:t,length:r},a=new n(i);return a},n.prototype.SW=function(){var e=this.xmid-this.length/4,t=this.ymid-this.length/4,r=this.length/2,i={xmid:e,ymid:t,length:r},a=new n(i);return a},n.prototype.SE=function(){var e=this.xmid+this.length/4,t=this.ymid-this.length/4,r=this.length/2,i={xmid:e,ymid:t,length:r},a=new n(i);return a},n}();Vle.default=wcr;var $le={};Object.defineProperty($le,"__esModule",{value:!0});var bcr=function(){function n(e){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,e!=null&&(this.quad=e)}return n.prototype.insert=function(e){if(this.body==null){this.body=e;return}this._isExternal()?(this.quad&&(this.NW=new n(this.quad.NW()),this.NE=new n(this.quad.NE()),this.SW=new n(this.quad.SW()),this.SE=new n(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e))},n.prototype._putBody=function(e){!this.quad||(e.in(this.quad.NW())&&this.NW?this.NW.insert(e):e.in(this.quad.NE())&&this.NE?this.NE.insert(e):e.in(this.quad.SW())&&this.SW?this.SW.insert(e):e.in(this.quad.SE())&&this.SE&&this.SE.insert(e))},n.prototype._isExternal=function(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null},n.prototype.updateForce=function(e){if(!(this.body==null||e===this.body))if(this._isExternal())e.addForce(this.body);else{var t=this.quad?this.quad.getLength():0,r=this.body.distanceTo(e);t/r250&&(t.barnesHut=!0),t.prune===void 0&&l>100&&(t.prune=!0),this.maxIteration===0&&!t.prune?(o=250,l<=200&&l>100?o=1e3:l>200&&(o=1200),this.maxIteration=o):this.maxIteration===0&&a&&(o=100,l<=200&&l>100?o=500:l>200&&(o=950),this.maxIteration=o),t.kr||(t.kr=50,l>100&&l<=500?t.kr=20:l>500&&(t.kr=1)),t.kg||(t.kg=20,l>100&&l<=500?t.kg=10:l>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(s),i()},e.prototype.updateNodesByForces=function(t){for(var r=this,i=r.edges,a=r.maxIteration,o=r.nodes,s=i.filter(function(b){var E=(0,i1.getEdgeTerminal)(b,"source"),T=(0,i1.getEdgeTerminal)(b,"target");return E!==T}),l=o.length,u=s.length,h=[],c={},f={},d=[],v=0;v0;){for(var S=0;Sm||!c)?y=this.getOptRepGraForces(y,x,o):y=this.getRepGraForces(g,m,y,p,s,o);var b=this.updatePos(y,_,v,o);u=b.nodes,v=b.sg,g--,l.tick&&l.tick()}return u},e.prototype.getAttrForces=function(t,r,i,a,o,s,l,u){for(var h=this,c=h.nodes,f=h.preventOverlap,d=h.dissuadeHubs,v=h.mode,p=h.prune,g=0;g0&&(b=w,E=w),u[2*a[m.id]]+=b*S[0],u[2*a[_.id]]-=E*S[0],u[2*a[m.id]+1]+=b*S[1],u[2*a[_.id]+1]-=E*S[1]}}return u},e.prototype.getRepGraForces=function(t,r,i,a,o,s){for(var l=this,u=l.nodes,h=l.preventOverlap,c=l.kr,f=l.kg,d=l.center,v=l.prune,p=u.length,g=0;g0&&(x=c*(s[g]+1)*(s[m]+1)/_),i[2*g]-=x*y[0],i[2*m]+=x*y[0],i[2*g+1]-=x*y[1],i[2*m+1]+=x*y[1]}var S=[u[g].x-d[0],u[g].y-d[1]],w=Math.hypot(S[0],S[1]);S[0]=S[0]/w,S[1]=S[1]/w;var b=f*(s[g]+1);i[2*g]-=b*S[0],i[2*g+1]-=b*S[1]}return i},e.prototype.getOptRepGraForces=function(t,r,i){for(var a=this,o=a.nodes,s=a.kg,l=a.center,u=a.prune,h=o.length,c=9e10,f=-9e10,d=9e10,v=-9e10,p=0;p=f&&(f=o[p].x),o[p].x<=c&&(c=o[p].x),o[p].y>=v&&(v=o[p].y),o[p].y<=d&&(d=o[p].y));for(var g=Math.max(f-c,v-d),m={xmid:(f+c)/2,ymid:(v+d)/2,length:g,massCenter:l,mass:h},y=new Acr.default(m),_=new Mcr.default(y),p=0;p1.5*w?1.5*w:i);for(var m=0;mT?T:b;var C=b*t[2*m],A=b*t[2*m+1];s[m].x+=C,s[m].y+=A}return{nodes:s,sg:i}},e}(Tcr.Base);vk.ForceAtlas2Layout=Icr;var pk={},Hle={},jle={},Xle={},yA=at&&at.__assign||function(){return yA=Object.assign||function(n){for(var e,t=1,r=arguments.length;te;r--)for(var i=0;i=e&&(this.additionColumn[i]+=t);for(var r=0;re;r--)this.cells[i][r+t]=yA(yA({},this.cells[i][r]),{dx:i,dy:r+t,x:i*this.CELL_W,y:(r+t)*this.CELL_H}),this.cells[i][r]={dx:i,dy:r,x:i*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null};for(var r=0;r=e&&(this.additionRow[r]+=t);for(var i=0;ia){for(var d=Math.ceil((u.size[0]+i)/a)-1,v=d,p=0;p-1;if(g&&!s.cells[c+p+1][f].node)v--;else break}s.insertColumn(c,v)}if(u.size[1]+i>o){for(var d=Math.ceil((u.size[1]+i)/o)-1,v=d,p=0;p-1;if(g&&!s.cells[c][f+p+1].node)v--;else break}s.insertRow(f,v)}}for(var l=0;lIY?(y=i-h,m=s-a,_=parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)),x=parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2))):0m?_=x=parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):_=x=parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2))):g<-IY?(y=i-h,m=-(u-r),y>m?_=x=parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):_=x=parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2))):(y=l-o,Math.abs(p)>(a-r)/2?m=r-u:m=p,y>m?_=x=parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):_=x=parseFloat(m&&g!==0?(m/Math.sin(g)).toFixed(2):y.toFixed(2)));var S=parseFloat(g.toFixed(2)),w=t;return t&&(w=Dcra?e:n,s=i>a?n:e,l=o.x-o.size[0]/2,u=o.y-o.size[1]/2,h=o.x+o.size[0]/2,c=o.y+o.size[1]/2,f=s.x-s.size[0]/2,d=s.y-s.size[1]/2,v=s.x+s.size[0]/2,p=s.y+s.size[1]/2,g=o.x,m=o.y,y=s.x,_=s.y,x=h>=f&&v>=l&&c>=d&&p>=u,S=0,w=0;if(x){w=Math.sqrt(Math.pow(y-g,2)+Math.pow(_-m,2));var b=l>f?l:f,E=u>d?u:d,T=hPHe||r.y>OHe)&&(e+=1e12);for(var i=t+1;i150,d=c<30||c>150,v=h>70&&h<110,p=c>70&&c<110;if(f&&!d||h*c<0){s=!1;break}else if(v&&!p||h*c<0){s=!1;break}else if((u.x-n.x)*(u.x-e.x)<0){s=!1;break}else if((u.y-n.y)*(u.y-e.y)<0){s=!1;break}}return s}function Ucr(n,e){for(var t=!1,r=1,i=kcr*r,a=Fcr*r,o=[i,-i,0,0],s=[0,0,a,-a],l=0;lNEe?(h=d,t=!0):(u.x-=o[c],u.y-=s[c])}}return LY>NEe&&(LY*=Bcr),t?NHe(n):0}function kEe(n,e){var t=0;(n.x<0||n.y<0||n.x+n.size[0]+20>PHe||n.y+n.size[1]+20>OHe)&&(t+=1e12);for(var r=0;r0&&(s++,!(s>=o));){var l=Ucr(n,e);l!==0&&(a=l),i=a-t,t=a,i===0?--r:r=20}return n.forEach(function(u){u.x=u.x-u.size[0]/2,u.y=u.y-u.size[1]/2}),{nodes:n,edges:e}}Yle.default=Vcr;var Qee=at&&at.__assign||function(){return Qee=Object.assign||function(n){for(var e,t=1,r=arguments.length;t1){var g=Qee({},v);delete g.size,o.push(g)}});var s=[];r.forEach(function(v){var p=o.find(function(m){return m.id===v.source}),g=o.find(function(m){return m.id===v.target});p&&g&&s.push(v)});var l=new Ycr.DagreLayout({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}),u=l.layout({nodes:o,edges:s}).nodes;t.forEach(function(v){var p=(u||[]).find(function(g){return g.id===v.id});v.x=(p==null?void 0:p.x)||i/2,v.y=(p==null?void 0:p.y)||a/2});var h=JSON.parse(JSON.stringify(t)),c=JSON.parse(JSON.stringify(r)),f=mC.forceSimulation().nodes(h).force("link",mC.forceLink(c).id(function(v){return v.id}).distance(function(v){var p=s.find(function(g){return g.source===v.source&&g.target===v.target});return p?30:20})).force("charge",mC.forceManyBody()).force("center",mC.forceCenter(i/2,a/2)).force("x",mC.forceX(i/2)).force("y",mC.forceY(a/2)).alpha(.3).alphaDecay(.08).alphaMin(.001),d=new Promise(function(v){f.on("end",function(){t.forEach(function(S){var w=h.find(function(b){return b.id===S.id});w&&(S.x=w.x,S.y=w.y)});var p=Math.min.apply(Math,t.map(function(S){return S.x})),g=Math.max.apply(Math,t.map(function(S){return S.x})),m=Math.min.apply(Math,t.map(function(S){return S.y})),y=Math.max.apply(Math,t.map(function(S){return S.y})),_=i/(g-p),x=a/(y-m);t.forEach(function(S){S.x!==void 0&&_<1&&(S.x=(S.x-p)*_),S.y!==void 0&&x<1&&(S.y=(S.y-m)*x)}),t.forEach(function(S){S.sizeTemp=S.size,S.size=[10,10]}),(0,Xcr.default)(t,r),t.forEach(function(S){S.size=S.sizeTemp||[],delete S.sizeTemp}),(0,jcr.default)({nodes:t,edges:r},e),v()})});return d}Hle.default=qcr;var Zcr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Kcr=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(pk,"__esModule",{value:!0});pk.ERLayout=void 0;var Jcr=Xl,Qcr=Kcr(Hle),efr=function(n){Zcr(e,n);function e(t){var r=n.call(this)||this;return r.width=300,r.height=300,r.nodeMinGap=50,r.onLayoutEnd=function(){},t&&r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{width:300,height:300,nodeMinGap:50}},e.prototype.execute=function(){var t=this,r=t.nodes,i=t.edges;return r==null||r.forEach(function(a){a.size||(a.size=[50,50])}),(0,Qcr.default)({nodes:r,edges:i},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then(function(){t.onLayoutEnd&&t.onLayoutEnd()})},e.prototype.getType=function(){return"er"},e}(Jcr.Base);pk.ERLayout=efr;var yb={},FEe;function tfr(){if(FEe)return yb;FEe=1,Object.defineProperty(yb,"__esModule",{value:!0}),yb.Layouts=yb.Layout=void 0;var n=Z1,e=Z3,t=K3,r=Q3,i=J3,a=Nse,o=ek,s=qI,l=Lle,u=lk,h=uk,c=hk,f=ck,d=fk,v=dk,p=LHe(),g=vk,m=pk,y=nk,_=Dl(),x=function(){function S(w){var b=(0,n.getLayoutByName)(w.type);this.layoutInstance=new b(w)}return S.prototype.layout=function(w){return this.layoutInstance.layout(w)},S.prototype.updateCfg=function(w){this.layoutInstance.updateCfg(w)},S.prototype.init=function(w){this.correctLayers(w.nodes),this.layoutInstance.init(w)},S.prototype.correctLayers=function(w){if(!!(w!=null&&w.length)){var b=1/0,E=[];if(w.forEach(function(C){(0,_.isString)(C.layer)&&(C.layer=parseInt(C.layer,10)),!(C.layer===void 0||isNaN(C.layer))&&(E.push(C),C.layerx.low&&(x=x.nxt);var T=w+S.prelim+S.w-(E+b.prelim);T>0&&(E+=T,o(y,_,x.index,T));var C=u(S),A=u(b);C<=A&&(S=l(S),S!==null&&(w+=S.mod)),C>=A&&(b=s(b),b!==null&&(E+=b.mod))}!S&&!!b?h(y,_,b,E):!!S&&!b&&c(y,_,S,w)}function o(y,_,x,S){y.c[_].mod+=S,y.c[_].msel+=S,y.c[_].mser+=S,v(y,_,x,S)}function s(y){return y.cs===0?y.tl:y.c[0]}function l(y){return y.cs===0?y.tr:y.c[y.cs-1]}function u(y){return y.y+y.h}function h(y,_,x,S){var w=y.c[0].el;w.tl=x;var b=S-x.mod-y.c[0].msel;w.mod+=b,w.prelim-=b,y.c[0].el=y.c[_].el,y.c[0].msel=y.c[_].msel}function c(y,_,x,S){var w=y.c[_].er;w.tr=x;var b=S-x.mod-y.c[_].mser;w.mod+=b,w.prelim-=b,y.c[_].er=y.c[_-1].er,y.c[_].mser=y.c[_-1].mser}function f(y){y.prelim=(y.c[0].prelim+y.c[0].mod+y.c[y.cs-1].mod+y.c[y.cs-1].prelim+y.c[y.cs-1].w)/2-y.w/2}function d(y,_){_+=y.mod,y.x=y.prelim+_,p(y);for(var x=0;x=x.low;)x=x.nxt;return{low:y,index:_,nxt:x}}WHe(n,t);var m=bO.fromNode(n,t);return r(m),d(m,0),$He(m,n,t),lfr(n,t),n},zEe=zHe,HHe=function(n,e){for(var t=zEe(n.data,e,!0),r=zEe(n.data,e,!0),i=n.children.length,a=Math.round(i/2),o=e.getSide||function(h,c){return c-1},dfr=Ix[0],Zle=function(n,e,t){var r=e.direction||dfr;if(e.isHorizontal=ffr(r),r&&Ix.indexOf(r)===-1)throw new TypeError("Invalid direction: "+r);if(r===Ix[0])t(n,e);else if(r===Ix[1])t(n,e),n.right2left();else if(r===Ix[2])t(n,e);else if(r===Ix[3])t(n,e),n.bottom2top();else if(r===Ix[4]||r===Ix[5]){var i=hfr(n,e),a=i.left,o=i.right;t(a,e),t(o,e),e.isHorizontal?a.right2left():a.bottom2top(),o.translate(a.x-o.x,a.y-o.y),n.x=a.x,n.y=o.y;var s=n.getBoundingBox();e.isHorizontal?s.top<0&&n.translate(0,-s.top):s.left<0&&n.translate(-s.left,0)}var l=e.fixedRoot;return l===void 0&&(l=!0),l&&n.translate(-(n.x+n.width/2+n.hgap),-(n.y+n.height/2+n.vgap)),vfr(n,e),n};function vfr(n,e){if(e.radial){var t=e.isHorizontal?["x","y"]:["y","x"],r=t[0],i=t[1],a={x:1/0,y:1/0},o={x:-1/0,y:-1/0},s=0;n.DFTraverse(function(h){s++;var c=h.x,f=h.y;a.x=Math.min(a.x,c),a.y=Math.min(a.y,f),o.x=Math.max(o.x,c),o.y=Math.max(o.y,f)});var l=o[i]-a[i];if(l===0)return;var u=Math.PI*2/s;n.DFTraverse(function(h){var c=(h[i]-a[i])/l*(Math.PI*2-u)+u,f=h[r]-n[r];h.x=Math.cos(c)*f,h.y=Math.sin(c)*f})}}function pfr(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,ete(n,e)}function ete(n,e){return ete=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ete(n,e)}var gfr=IV,yfr=ufr,mfr=Zle,_fr=Mw,xfr=function(n){function e(){return n.apply(this,arguments)||this}pfr(e,n);var t=e.prototype;return t.execute=function(){var i=this;return mfr(i.rootNode,i.options,yfr)},e}(gfr),Sfr={};function wfr(n,e){return e=_fr.assign({},Sfr,e),new xfr(n,e).execute()}var bfr=wfr,Efr=Mw;function Tfr(n,e){e===void 0&&(e=[]);var t=this;t.x=t.y=0,t.leftChild=t.rightChild=null,t.height=0,t.children=e}var Cfr={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function jHe(n,e,t){t?(e.x=n.x,e.y=n.y):(e.x=n.y,e.y=n.x),n.children.forEach(function(r,i){jHe(r,e.children[i],t)})}var Afr=function(n,e){e===void 0&&(e={}),e=Efr.assign({},Cfr,e);var t=0;function r(l){if(!l)return null;l.width=0,l.depth&&l.depth>t&&(t=l.depth);var u=l.children,h=u.length,c=new Tfr(l.height,[]);return u.forEach(function(f,d){var v=r(f);c.children.push(v),d===0&&(c.leftChild=v),d===h-1&&(c.rightChild=v)}),c.originNode=l,c.isLeaf=l.isLeaf(),c}function i(l){if(l.isLeaf||l.children.length===0)l.drawingDepth=t;else{var u=l.children.map(function(c){return i(c)}),h=Math.min.apply(null,u);l.drawingDepth=h-1}return l.drawingDepth}var a;function o(l){l.x=l.drawingDepth*e.rankSep,l.isLeaf?(l.y=0,a&&(l.y=a.y+a.height+e.nodeSep,l.originNode.parent!==a.originNode.parent&&(l.y+=e.subTreeSep)),a=l):(l.children.forEach(function(u){o(u)}),l.y=(l.leftChild.y+l.rightChild.y)/2)}var s=r(n);return i(s),o(s),jHe(s,n,e.isHorizontal),n};function Mfr(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,tte(n,e)}function tte(n,e){return tte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},tte(n,e)}var Ifr=IV,Lfr=Afr,Pfr=Zle,Ofr=Mw,Rfr=function(n){function e(){return n.apply(this,arguments)||this}Mfr(e,n);var t=e.prototype;return t.execute=function(){var i=this;return i.rootNode.width=0,Pfr(i.rootNode,i.options,Lfr)},e}(Ifr),Dfr={};function Nfr(n,e){return e=Ofr.assign({},Dfr,e),new Rfr(n,e).execute()}var kfr=Nfr,UEe=Mw;function Ffr(n,e,t,r,i){var a=(typeof t=="function"?t(n):t)*n.depth;if(!r)try{if(n.id===n.parent.children[0].id){n.x+=a,n.y=e?e.y:0;return}}catch{}if(n.x+=a,e){if(n.y=e.y+UEe.getHeight(e,n,i),e.parent&&n.parent.id!==e.parent.id){var o=e.parent,s=o.y+UEe.getHeight(o,n,i);n.y=s>n.y?s:n.y}}else n.y=0}var Bfr=function(n,e,t,r){var i=null;n.eachNode(function(a){Ffr(a,i,e,t,r),i=a})};function Gfr(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,rte(n,e)}function rte(n,e){return rte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},rte(n,e)}var zfr=IV,H5=Bfr,Ufr=HHe,Vfr=Mw,EO=["LR","RL","H"],$fr=EO[0],Wfr=function(n){function e(){return n.apply(this,arguments)||this}Gfr(e,n);var t=e.prototype;return t.execute=function(){var i=this,a=i.options,o=i.rootNode;a.isHorizontal=!0;var s=a.indent,l=s===void 0?20:s,u=a.dropCap,h=u===void 0?!0:u,c=a.direction,f=c===void 0?$fr:c,d=a.align;if(f&&EO.indexOf(f)===-1)throw new TypeError("Invalid direction: "+f);if(f===EO[0])H5(o,l,h,d);else if(f===EO[1])H5(o,l,h,d),o.right2left();else if(f===EO[2]){var v=Ufr(o,a),p=v.left,g=v.right;H5(p,l,h,d),p.right2left(),H5(g,l,h,d);var m=p.getBoundingBox();g.translate(m.width,0),o.x=g.x-o.width/2}return o},e}(zfr),Hfr={};function jfr(n,e){return e=Vfr.assign({},Hfr,e),new Wfr(n,e).execute()}var Xfr=jfr,Yfr=Mw;function XHe(n,e){var t=0;return n.children.length?n.children.forEach(function(r){t+=XHe(r,e)}):t=n.height,n._subTreeSep=e.getSubTreeSep(n.data),n.totalHeight=Math.max(n.height,t)+2*n._subTreeSep,n.totalHeight}function YHe(n){var e=n.children,t=e.length;if(t){e.forEach(function(l){YHe(l)});var r=e[0],i=e[t-1],a=i.y-r.y+i.height,o=0;if(e.forEach(function(l){o+=l.totalHeight}),a>n.height)n.y=r.y+a/2-n.height/2;else if(e.length!==1||n.height>o){var s=n.y+(n.height-a)/2-r.y;e.forEach(function(l){l.translate(0,s)})}else n.y=(r.y+r.height/2+i.y+i.height/2)/2-n.height/2}}var qfr={getSubTreeSep:function(){return 0}},Zfr=function(n,e){e===void 0&&(e={}),e=Yfr.assign({},qfr,e),n.parent={x:0,width:0,height:0,y:0},n.BFTraverse(function(t){t.x=t.parent.x+t.parent.width}),n.parent=null,XHe(n,e),n.startY=0,n.y=n.totalHeight/2-n.height/2,n.eachNode(function(t){var r=t.children,i=r.length;if(i){var a=r[0];if(a.startY=t.startY+t._subTreeSep,i===1)a.y=t.y+t.height/2-a.height/2;else{a.y=a.startY+a.totalHeight/2-a.height/2;for(var o=1;o=0&&(s="x",o="y");var l=0;VEe(e,function(c){return l++,c.x>a.x&&(a.x=c.x),c.xa.y&&(a.y=c.y),c.y"u"||typeof document>"u"?{}:{canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var e=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl")))}catch{return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var t=document.createElement("div");return t.id="webgl-error-message",t.style.fontFamily="monospace",t.style.fontSize="13px",t.style.fontWeight="normal",t.style.textAlign="center",t.style.background="#fff",t.style.color="#000",t.style.padding="1.5em",t.style.width="400px",t.style.margin="5em auto 0",this.webgl||(t.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support WebGL.
','Find out how to get it here.'].join(` `):['Your browser does not seem to support WebGL.
','Find out how to get it here.'].join(` `)),t},addGetWebGLMessage:function(t){t=t||{};var r=t.parent!==void 0?t.parent:document.body,i=t.id!==void 0?t.id:"oldie",a=Kle().getWebGLErrorMessage();a.id=i,r.appendChild(a)}}};const pdr=Object.freeze(Object.defineProperty({__proto__:null,gpuDetector:Kle},Symbol.toStringTag,{value:"Module"}));var qHe=function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("firefox")>-1?"firefox":e.indexOf("safari")>-1?"safari":e.indexOf("opr")>-1?"opera":e.indexOf("chrome")>-1?"chrome":e.indexOf("trident")>-1?"ie 11":e.indexOf("ie")>-1?"ie":"unknown"};const gdr=Object.freeze(Object.defineProperty({__proto__:null,getBrowserName:qHe},Symbol.toStringTag,{value:"Module"}));var H_=ve(ve(ve(ve(ve({},gc),fYt),vdr),pdr),gdr),ydr=H_.radialLayout,mdr=function(){function n(e){this.type=e.type,this.radial=e.radial,this.config=e}return n.prototype.init=function(e){var t=this;if(this.data=e,this.radial){this.layoutMethod=function(r){var i=j9[t.type](r,t.config);return ydr(i),i};return}this.layoutMethod=function(r){return j9[t.type](r,t.config)}},n.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},n.prototype.layout=function(e){return this.init(e),this.execute()},n}();Yi.registerLayout("grid",Yi.GridLayout);Yi.registerLayout("random",Yi.RandomLayout);Yi.registerLayout("force",Yi.ForceLayout);Yi.registerLayout("circular",Yi.CircularLayout);Yi.registerLayout("dagre",Yi.DagreLayout);Yi.registerLayout("dagreCompound",Yi.DagreCompoundLayout);Yi.registerLayout("radial",Yi.RadialLayout);Yi.registerLayout("concentric",Yi.ConcentricLayout);Yi.registerLayout("mds",Yi.MDSLayout);Yi.registerLayout("fruchterman",Yi.FruchtermanLayout);Yi.registerLayout("fruchterman-gpu",Yi.FruchtermanGPULayout);Yi.registerLayout("gForce",Yi.GForceLayout);Yi.registerLayout("force2",Yi.Force2Layout);Yi.registerLayout("gForce-gpu",Yi.GForceGPULayout);Yi.registerLayout("comboForce",Yi.ComboForceLayout);Yi.registerLayout("comboCombined",Yi.ComboCombinedLayout);Yi.registerLayout("forceAtlas2",Yi.ForceAtlas2Layout);var _dr=function(e,t){t.isCustomLayout=!0,Yi.Layouts[e]=Yi.registerLayout(e,t)},xdr=function(){function n(e,t){var r=e.toString(),i=new Blob(["importScripts('".concat(t,"');(").concat(r,")()")],{type:"text/javascript"});return new Worker(URL.createObjectURL(i))}return n}(),Sdr=function(e){e===void 0&&(e="https://unpkg.com/@antv/layout@0.3.23/dist/layout.min.js");function t(){var i={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};layout.registerLayout("grid",layout.GridLayout),layout.registerLayout("random",layout.RandomLayout),layout.registerLayout("force",layout.ForceLayout),layout.registerLayout("force2",layout.Force2Layout),layout.registerLayout("circular",layout.CircularLayout),layout.registerLayout("dagre",layout.DagreLayout),layout.registerLayout("dagreCompound",layout.DagreCompoundLayout),layout.registerLayout("radial",layout.RadialLayout),layout.registerLayout("concentric",layout.ConcentricLayout),layout.registerLayout("mds",layout.MDSLayout),layout.registerLayout("fruchterman",layout.FruchtermanLayout),layout.registerLayout("fruchterman-gpu",layout.FruchtermanGPULayout),layout.registerLayout("gForce",layout.GForceLayout),layout.registerLayout("gForce-gpu",layout.GForceGPULayout),layout.registerLayout("comboForce",layout.ComboForceLayout),layout.registerLayout("comboCombined",layout.ComboCombinedLayout),layout.registerLayout("forceAtlas2",layout.ForceAtlas2Layout);function a(s){var l=s.data.type;return l===i.RUN||l===i.GPURUN}function o(s){var l=this,u=s.data.type;switch(u){case i.RUN:{var h=s.data,c=h.nodes,f=h.edges,d=h.layoutCfg,v=d===void 0?{}:d,p=v.type,g=layout.getLayoutByName(p);if(!g){this.postMessage({type:i.ERROR,message:"layout ".concat(p," not found")});break}var m;v.onLayoutEnd=function(){l.postMessage({type:i.END,nodes:c}),m==null||m.destroy()},m=new g(v),m.init({nodes:c,edges:f}),m.execute();break}case i.GPURUN:{var y=s.data,_=y.nodes,f=y.edges,x=y.layoutCfg,v=x===void 0?{}:x,S=y.canvas,p=v.type,g=layout.getLayoutByName(p);if(!g){this.postMessage({type:i.ERROR,message:"layout ".concat(p," not found")});break}if(p.split("-")[1]!=="gpu"){this.postMessage({type:i.ERROR,message:"layout ".concat(p," does not support GPU")});break}var w=new g(v);w.init({nodes:_,edges:f}),w.executeWithWorker(S,this);break}}}onmessage=function(l){a(l)&&o(l)}}var r=new xdr(t,e);return r},_C={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};function ite(n){return ite=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ite(n)}var $Ee=function(e){return setTimeout(e,16)},WEe=function(e){return clearTimeout(e)},j5={requestAnimationFrame:function(e){var t=typeof window<"u"&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||$Ee;return t(e)},cancelAnimationFrame:function(e){var t=typeof window<"u"&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||WEe;return t(e)}},wdr=["fruchterman","gForce"],bdr=["force","grid","circular"],Edr=function(n){Kn(e,n);function e(t){var r=n.call(this,t)||this;return r.graph=t,r.layoutCfg=t.get("layout")||{},r.layoutType=r.getLayoutType(),r.worker=null,r.workerData={},r.initLayout(),r}return e.prototype.initLayout=function(){},e.prototype.getWorker=function(){return this.worker?this.worker:(typeof Worker>"u"?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=Sdr(this.layoutCfg.workerScriptURL),this.worker)},e.prototype.stopWorker=function(){var t=this.workerData;!this.worker||(this.worker.terminate(),this.worker=null,t.requestId&&(j5.cancelAnimationFrame(t.requestId),t.requestId=null),t.requestId2&&(j5.cancelAnimationFrame(t.requestId2),t.requestId2=null))},e.prototype.execLayoutMethod=function(t,r){var i=this;return new Promise(function(a,o){return Qd(i,void 0,void 0,function(){var s,l,u,h,c,p,f,d,v,p,g;return ev(this,function(m){switch(m.label){case 0:if(s=this.graph,!s||s.get("destroyed"))return[2];l=t.type,t.onLayoutEnd=function(){s.emit("aftersublayout",{type:l}),a()},l&&this.isGPU&&(ZHe(l)?l="".concat(l,"-gpu"):console.warn("The '".concat(l,"' layout does not support GPU calculation for now, it will run in CPU."))),gc.isForce(l)?(u=t.onTick,h=t.animate,c=h===void 0&&(l==="force"||l==="force2"),p=function(){u&&u(),(h||c)&&s.refreshPositions()},t.tick=p):(l==="comboForce"||l==="comboCombined")&&(t.comboTrees=s.get("comboTrees")),f=!1;try{d=new Yi.Layouts[l](t),this.layoutMethods[r]&&this.layoutMethods[r].destroy(),this.layoutMethods[r]=d}catch{console.warn("The layout method: '".concat(l,"' does not exist! Please specify it first.")),o()}return f=d.enableTick,f&&(v=t.onTick,p=function(){v&&v(),s.refreshPositions()},d.tick=p),g=this.filterLayoutData(this.data,t),Adr(g,r),d.init(g),s.emit("beforesublayout",{type:l}),[4,d.execute()];case 1:return m.sent(),d.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),[2]}})})})},e.prototype.updateLayoutMethod=function(t,r){var i=this;return new Promise(function(a,o){return Qd(i,void 0,void 0,function(){var s,l,u,h,c,f,d;return ev(this,function(v){switch(v.label){case 0:return s=this.graph,l=r==null?void 0:r.type,r.onLayoutEnd=function(){s.emit("aftersublayout",{type:l}),a()},gc.isForce(l)&&(u=r.onTick,h=r.animate,c=h===void 0&&(l==="force"||l==="force2"),f=function(){u==null||u(),(h||c)&&s.refreshPositions()},r.tick=f),d=this.filterLayoutData(this.data,r),t.init(d),t.updateCfg(r),s.emit("beforesublayout",{type:l}),[4,t.execute()];case 1:return v.sent(),t.isCustomLayout&&r.onLayoutEnd&&r.onLayoutEnd(),[2]}})})})},e.prototype.layout=function(t){var r=this,i,a=this.graph;if(!(!a||a.get("destroyed"))){this.data=this.setDataFromGraph();var o=this.data,s=o.nodes,l=o.hiddenNodes;if(!s)return!1;var u=a.get("width"),h=a.get("height"),c={};Object.assign(c,{width:u,height:h,center:[u/2,h/2]},this.layoutCfg),this.layoutCfg=c;var f=c.type,d=!1;(i=this.layoutMethods)===null||i===void 0||i.forEach(function(S){var w;return d=!!(!((w=S.nodes)===null||w===void 0)&&w.length)||d});var v=this.destoryLayoutMethods();a.emit("beforelayout");var p=Promise.resolve();d&&f&&(v==null?void 0:v.length)===1&&v[0]===f?this.tweakInit():p=this.initPositions(c.center,s);var g=this.initPositions(c.center,l);g.then(),this.isGPU=HEe(c,f);var m=c.onLayoutEnd,y=c.layoutEndFormatted,_=c.adjust;if(y||(c.layoutEndFormatted=!0,c.onAllLayoutEnd=function(){return Qd(r,void 0,void 0,function(){return ev(this,function(S){switch(S.label){case 0:return m&&m(s),this.refreshLayout(),_&&c.pipes?[4,this.adjustPipesBox(this.data,_)]:[3,2];case 1:S.sent(),this.refreshLayout(),S.label=2;case 2:return a.emit("afterlayout"),[2]}})})}),this.stopWorker(),c.workerEnabled&&this.layoutWithWorker(this.data,t))return!0;var x=!1;return c.type?(x=!0,p=p.then(function(){return Qd(r,void 0,void 0,function(){return ev(this,function(S){switch(S.label){case 0:return[4,this.execLayoutMethod(c,0)];case 1:return[2,S.sent()]}})})})):c.pipes&&(x=!0,c.pipes.forEach(function(S,w){p=p.then(function(){return Qd(r,void 0,void 0,function(){return ev(this,function(b){switch(b.label){case 0:return[4,this.execLayoutMethod(S,w)];case 1:return[2,b.sent()]}})})})})),x?p.then(function(){c.onAllLayoutEnd&&c.onAllLayoutEnd(),t&&t()}).catch(function(S){console.warn("graph layout failed,",S)}):(a.refreshPositions(),t==null||t()),!1}},e.prototype.tweakInit=function(){var t=this,r=t.data,i=t.graph,a=r.nodes,o=r.edges;if(!!(a!=null&&a.length)){var s={};a.forEach(function(h){var c=h.x,f=h.y;!isNaN(c)&&!isNaN(f)&&(s[h.id]={x:c,y:f},h.mass=h.mass||2)}),o.forEach(function(h){var c=h.source,f=h.target,d=s[c],v=s[f];!d&&v?s[c]={x:v.x+(Math.random()-.5)*80,y:v.y+(Math.random()-.5)*80}:!v&&d&&(s[f]={x:d.x+(Math.random()-.5)*80,y:d.y+(Math.random()-.5)*80})});var l=i.get("width"),u=i.get("height");a.forEach(function(h){var c=s[h.id]||{x:l/2+(Math.random()-.5)*20,y:u/2+(Math.random()-.5)*20};h.x=c.x,h.y=c.y})}},e.prototype.initWithPreset=function(t,r){var i=this;return new Promise(function(a,o){return Qd(i,void 0,void 0,function(){var s,l,u,h,c,f,d;return ev(this,function(v){switch(v.label){case 0:return s=this,l=s.layoutCfg,u=s.data,h=l.preset,!(h!=null&&h.type)||!Yi.Layouts[h==null?void 0:h.type]?(r==null||r(),a(),[2,!1]):(c=HEe(h,h.type),f=c?"".concat(h.type,"-gpu"):h.type,d=new Yi.Layouts[f](h),delete l.preset,d.init(u),[4,d.execute()]);case 1:return v.sent(),t==null||t(),a(),[2,!0]}})})})},e.prototype.layoutWithWorker=function(t,r){var i=this,a=this,o=a.layoutCfg,s=a.graph,l=this.getWorker(),u=this.workerData;if(!l)return!1;u.requestId=null,u.requestId2=null,u.currentTick=null,u.currentTickData=null,s.emit("beforelayout");var h=Promise.resolve(),c=!1;if(o.type)c=!0,h=h.then(function(){return i.runWebworker(l,t,o)});else if(o.pipes){c=!0;for(var f=function(m){h=h.then(function(){return i.runWebworker(l,t,m)})},d=0,v=o.pipes;d'),h=i?i.backgroundColor:void 0,c=i?i.padding:void 0;c?on(c)&&(c=[c,c,c,c]):c=[0,0,0,0];var f=o+c[0]+c[2],d=s+c[1]+c[3],v={container:u,height:f,width:d,quickHit:!0},p=l==="svg"?new yR(v):new M1(v),g=this.get("group"),m=g.clone(),y=Xi(m.getMatrix());y||(y=[1,0,0,0,1,0,0,0,1]);var _=(a.maxX+a.minX)/2,x=(a.maxY+a.minY)/2;y=jEe(y,[["t",-_,-x],["t",s/2+c[3],o/2+c[0]]]),m.resetMatrix(),m.setMatrix(y),p.add(m);var S=p.get("el"),w="";r||(r="image/png"),setTimeout(function(){if(l==="svg"){var b=S.cloneNode(!0),E=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),T=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",E);T.replaceChild(b,T.documentElement);var C=new XMLSerializer().serializeToString(T);w="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(C))}else{var A=void 0,M=S.getContext("2d"),I=void 0;if(h){var R=typeof window<"u"?window.devicePixelRatio:1;try{A=M.getImageData(0,0,d*R,f*R),I=M.globalCompositeOperation,M.globalCompositeOperation="destination-over",M.fillStyle=h,M.fillRect(0,0,d,f)}catch{console.error("Download image failed. Out of memory at ImageData creation")}}w=S.toDataURL(r),h&&(M.clearRect(0,0,d,f),M.putImageData(A,0,0),M.globalCompositeOperation=I)}t&&t(w)},16)},e.prototype.downloadFullImage=function(t,r,i){var a=this,o=this.get("group").getCanvasBBox(),s=o.height,l=o.width,u=this.get("renderer"),h=zs('
'),c=document.querySelector(".g6-graph-watermarker"),f=i?i.backgroundColor:void 0,d=i?i.padding:void 0;d?on(d)&&(d=[d,d,d,d]):d=[0,0,0,0];var v=s+d[0]+d[2],p=l+d[1]+d[3];if(c){var g=this.get("graphWaterMarker").cfg||{},m=g.width,y=g.height;v=Math.ceil(v/y)*y,p=Math.ceil(p/m)*m}var _={container:h,height:v,width:p},x=u==="svg"?new yR(_):new M1(_),S=this.get("group"),w=pYt(S),b=Xi(w.getMatrix());b||(b=[1,0,0,0,1,0,0,0,1]);var E=(o.maxX+o.minX)/2,T=(o.maxY+o.minY)/2;b=jEe(b,[["t",-E,-T],["t",l/2+d[3],s/2+d[0]]]),w.resetMatrix(),w.setMatrix(b),x.add(w);var C=x.get("el");r||(r="image/png"),this.asyncToDataUrl(r,f,function(A){var M=document.createElement("a"),I=(t||"graph")+(u==="svg"?".svg":".".concat(r.split("/")[1]));a.dataURLToImage(A,u,M,I);var R=document.createEvent("MouseEvents");R.initEvent("click",!1,!1),M.dispatchEvent(R)},p,v,C)},e.prototype.downloadImage=function(t,r,i){var a=this,o=this;o.stopAnimate();var s=o.get("canvas"),l=s.getRenderer();r||(r="image/png");var u=(t||"graph")+(l==="svg"?".svg":".".concat(r.split("/")[1])),h=document.createElement("a");o.asyncToDataUrl(r,i,function(c){a.dataURLToImage(c,l,h,u);var f=document.createEvent("MouseEvents");f.initEvent("click",!1,!1),h.dispatchEvent(f)})},e.prototype.dataURLToImage=function(t,r,i,a){if(!t||t==="data:"){console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items");return}if(typeof window<"u")if(window.Blob&&window.URL&&r!=="svg"){var o=t.split(","),s="";if(o&&o.length>0){var l=o[0].match(/:(.*?);/);l&&l.length>=2&&(s=l[1])}for(var u=atob(o[1]),h=u.length,c=new Uint8Array(h);h--;)c[h]=u.charCodeAt(h);var f=new Blob([c],{type:s});window.navigator.msSaveBlob?window.navigator.msSaveBlob(f,a):i.addEventListener("click",function(){i.download=a,i.href=window.URL.createObjectURL(f)})}else i.addEventListener("click",function(){i.download=a,i.href=t})},e.prototype.addPlugin=function(t){var r=this;t.destroyed||(r.get("plugins").push(t),t.initPlugin(r))},e.prototype.removePlugin=function(t){var r=this.get("plugins"),i=r.indexOf(t);i>=0&&(t.destroyPlugin(),r.splice(i,1))},e.prototype.setImageWaterMarker=function(t,r){t===void 0&&(t=BE.waterMarkerImage);var i=this.get("container");rr(i)&&(i=document.getElementById(i)),i.style.position||(i.style.position="relative");var a=this.get("graphWaterMarker"),o=ms({},BE.imageWaterMarkerConfig,r),s=o.width,l=o.height,u=o.compatible,h=o.image;if(!t){var c=u?i:document.querySelector(".g6-graph-watermarker");c&&(c.style.cssText=void 0),a&&a.clear();return}if(a)a.clear();else{var f={container:i,width:s,height:l,capture:!1},d=this.get("pixelRatio");d&&(f.pixelRatio=d,window.devicePixelRatio=d),a=new M1(f),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var v=a.get("context"),p=h.rotate,g=h.x,m=h.y;v.rotate(-p*Math.PI/180);var y=new Image;y.crossOrigin="anonymous",y.src=t,y.onload=function(){if(v.drawImage(y,g,m,h.width,h.height),v.rotate(p*Math.PI/180),u)i.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var _=document.querySelector(".g6-graph-watermarker");_||(_=document.createElement("div"),_.className="g6-graph-watermarker"),_.className="g6-graph-watermarker",a.destroyed||(_.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;"),i.appendChild(_))}}},e.prototype.setTextWaterMarker=function(t,r){var i=this.get("container");rr(i)&&(i=document.getElementById(i)),i.style.position||(i.style.position="relative");var a=this.get("graphWaterMarker"),o=ms({},BE.textWaterMarkerConfig,r),s=o.width,l=o.height,u=o.compatible,h=o.text;if(!(t!=null&&t.length)){var c=u?i:document.querySelector(".g6-graph-watermarker");c&&(c.style.cssText=void 0),a&&a.clear();return}if(a)a.clear();else{var f={container:i,width:s,height:l,capture:!1},d=this.get("pixelRatio");d&&(f.pixelRatio=d,window.devicePixelRatio=d),a=new M1(f),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var v=a.get("context"),p=h.rotate,g=h.fill,m=h.fontFamily,y=h.fontSize,_=h.baseline,x=h.x,S=h.y,w=h.lineHeight;v.rotate(-p*Math.PI/180),v.font="".concat(y,"px ").concat(m),v.fillStyle=g,v.textBaseline=_;for(var b=rr(t)?[t]:t,E=b.length-1;E>=0;E--)v.fillText(b[E],x,S+E*w);if(v.rotate(p*Math.PI/180),u)i.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var T=document.querySelector(".g6-graph-watermarker");T||(T=document.createElement("div"),T.className="g6-graph-watermarker"),T.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"),i.appendChild(T)}},e.prototype.destroy=function(){var t,r,i,a;At(this.get("plugins"),function(h){h.destroyPlugin()});var o=this.get("tooltips");if(o)for(var s=0;s0)for(var u=s.length-1;u>=0;u--){var h=s[u].getModel();e.indexOfChild(t.children||[],h.id)===-1&&(a.innerRemoveChild(h.id,{x:t.x,y:t.y},i),s.splice(u,1))}}var c,f;o.get("originAttrs")&&(c=o.get("originAttrs").x,f=o.get("originAttrs").y);var d=o.getModel();i&&o.set("originAttrs",{x:d.x,y:d.y}),o.set("model",Object.assign(d,t.data)),(c!==t.x||f!==t.y)&&o.updatePosition({x:t.x,y:t.y})},e.prototype.innerRemoveChild=function(t,r,i){var a=this,o=a.findById(t);if(!!o)if(At(o.get("children"),function(l){a.innerRemoveChild(l.getModel().id,r,i)}),i){var s=o.getModel();o.set("to",r),o.set("originAttrs",{x:s.x,y:s.y}),a.get("removeList").push(o)}else a.removeItem(o,!1)},e.prototype.changeData=function(t,r){r===void 0&&(r=!0);var i=this;this.getNodes().map(function(a){return i.clearItemStates(a)}),this.getEdges().map(function(a){return i.clearItemStates(a)}),r&&this.get("enabledStack")&&this.pushStack("changedata",{before:i.get("originData"),after:t||i.get("data")}),t?(i.data(t),i.render(!1)):i.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");var r=this;r.updateLayout(t)},e.prototype.updateLayout=function(t,r,i,a){a===void 0&&(a=!0);var o=this;if(!t){console.warn("layout cannot be null");return}if(a&&this.get("enabledStack")&&this.pushStack("layout",{before:o.get("layout"),after:t}),o.set("layout",t),o.set("layoutMethod",o.getLayout()),o.layout(),r){var s=i;s||(r==="begin"?s={x:0,y:0}:s={x:this.getWidth()/2,y:this.getHeight()/2}),s=this.getPointByCanvas(s.x,s.y);var l=this.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];s.x=s.x*l[0]+l[6],s.y=s.y*l[0]+l[7];var u=this.getGroup().getCanvasBBox(),h=u.minX,c=u.maxX,f=u.minY,d=u.maxY,v={x:(h+c)/2,y:(f+d)/2};r==="begin"&&(v.x=h,v.y=f),this.translate(s.x-v.x,s.y-v.y)}},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");var r=this;r.layout(t)},e.prototype.layout=function(t){var r=this,i=this,a=i.get("data"),o=i.get("layoutMethod"),s=i.get("layout"),l=a;if(s!=null&&s.excludeInvisibles){a=Xi(i.get("data"));var u={};OY(a,function(f){var d=f.children;if(!(d!=null&&d.length))return!0;for(var v=d.length-1;v>=0;v--){var p=r.findById(d[v].id),g=p?!p.isVisible():d[v].visible===!1;g&&(u[f.id]=u[f.id]||[],u[f.id].push({idx:v,child:d.splice(v,1)[0]}))}}),l=o?o(a,i.get("layout")):a,OY(l,function(f){var d=u[f.id];if(d!=null&&d.length)for(var v=d.length-1;v>=0;v--){var p=d[v],g=p.idx,m=p.child;f.children.splice(g,0,m)}})}else l=o?o(a,i.get("layout")):a;var h=i.get("animate");if(i.emit("beforerefreshlayout",{data:a,layoutData:l}),i.emit("beforelayout"),i.innerUpdateChild(l,void 0,h),t){var c=i.get("viewController");c.fitView()}h?i.layoutAnimate(l):(i.refresh(),i.paint()),i.emit("afterrefreshlayout",{data:a,layoutData:l}),i.emit("afterlayout")},e.prototype.addChild=function(t,r,i){i===void 0&&(i=!0);var a=this;a.emit("beforeaddchild",{model:t,parent:r}),rr(r)||(r=r.get("id"));var o=a.findDataById(r);if(o){o.children||(o.children=[]),o.children.push(t);var s=a.findById(r);s.refresh(),a.changeData(void 0,i)}},e.prototype.updateChildren=function(t,r,i){i===void 0&&(i=!0);var a=this,o=a.findById(r);if(!r||!o){console.warn("Update children failed! There is no node with id '".concat(r,"'"));return}var s=a.findDataById(r);s.children=t,o.refresh(),a.changeData(void 0,i)},e.prototype.updateChild=function(t,r,i){i===void 0&&(i=!0);var a=this;if(!r||!a.findById(r)){a.changeData(t,i);return}var o=a.findDataById(r),s=a.findById(t.id);if(o.children||(o.children=[]),!s)o.children.push(t);else{var l=e.indexOfChild(o.children,t.id);l>-1&&(o.children[l]=t)}var u=a.findById(r);u==null||u.refresh(),a.changeData(void 0,i)},e.prototype.removeChild=function(t,r){r===void 0&&(r=!0);var i=this,a=i.findById(t),o;if(a?o=a==null?void 0:a.get("parent"):o=i.getNodes().find(function(c){var f=c.getModel().children||[];return!!f.find(function(d){return d.id===t})}),o&&!o.destroyed){var s=o.get("id"),l=i.findDataById(s),u=l&&l.children||[],h=e.indexOfChild(u,t);u.splice(h,1),o.refresh()}i.changeData(void 0,r)},e.prototype.findDataById=function(t,r){var i=this;if(r||(r=i.get("data")),t===r.id)return r;var a=null;return At(r.children||[],function(o){if(o.id===t)return a=o,!1;if(a=i.findDataById(t,o),a)return!1}),a},e.prototype.layoutAnimate=function(t,r){var i=this,a=this.get("animateCfg");i.emit("beforeanimate",{data:t}),i.getEdges().forEach(function(o){var s=o.get("model");s.sourceAnchor||(s.sourceAnchor=o.get("sourceAnchorIndex"))}),this.get("canvas").animate(function(o){OY(t,function(s){var l=i.findById(s.id);if(l){var u=l.get("originAttrs"),h=l.get("model");if(u||(u={x:h.x,y:h.y},l.set("originAttrs",u)),r){var c=r(l,o,u,t);l.set("model",Object.assign(h,c))}else h.x=u.x+(s.x-u.x)*o,h.y=u.y+(s.y-u.y)*o}return!0}),At(i.get("removeList"),function(s){var l=s.getModel(),u=s.get("originAttrs"),h=s.get("to");l.x=u.x+(h.x-u.x)*o,l.y=u.y+(h.y-u.y)*o}),i.refreshPositions()},{duration:a.duration,easing:a.ease,callback:function(){At(i.getNodes(),function(s){s.set("originAttrs",null)}),At(i.get("removeList"),function(s){i.removeItem(s,!1)}),i.set("removeList",[]),a.callback&&a.callback(),i.emit("afteranimate",{data:t})},delay:a.delay})},e.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},e.prototype.isLayoutAnimating=function(){return this.layoutAnimating},e.prototype.render=function(t){t===void 0&&(t=!0);var r=this,i=r.get("data");if(!i||!Wh(i)||!Object.keys(i).length)throw new Error("data must be defined first");r.clear(),t&&this.get("enabledStack")&&this.clearStack(),r.emit("beforerender"),r.layout(this.get("fitView")),r.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e.prototype.data=function(t){n.prototype.data.call(this,t),this.set("originData",Idr(t))},e}(KHe),Odr=function(){function n(e){this._cfgs=ms(this.getDefaultCfgs(),e),this._events={},this.destroyed=!1}return n.prototype.getDefaultCfgs=function(){return{}},n.prototype.initPlugin=function(e){var t=this;t.set("graph",e);var r=t.getEvents(),i={};At(r,function(a,o){var s=hE(t,a);i[o]=s,e.on(o,s)}),this._events=i,this.init()},n.prototype.getEvents=function(){return{}},n.prototype.get=function(e){var t;return(t=this._cfgs)===null||t===void 0?void 0:t[e]},n.prototype.set=function(e,t){this._cfgs[e]=t},n.prototype.destroy=function(){},n.prototype.destroyPlugin=function(){this.destroy();var e=this.get("graph"),t=this._events;At(t,function(r,i){e.off(i,r)}),this._events=null,this._cfgs=null,this.destroyed=!0},n}();const zd=Odr;var Rdr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),XEe="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",Ddr=function(n){Rdr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{img:XEe,follow:!0}},e.prototype.init=function(){var t=this.get("graph"),r=t.get("container"),i=t.get("canvas").get("el"),a=this.get("img")||XEe;a.includes("url(")||(a='url("'.concat(a,'")'));var o=zs(`
`),s=zs(`
`));this.set("container",o),this.set("gridContainer",s),this.positionInit(),o.appendChild(s),r.insertBefore(o,i)},e.prototype.positionInit=function(){var t=this.get("graph"),r=t.get("minZoom"),i=t.get("width"),a=t.get("height");Di(this.get("container"),{width:"".concat(i,"px"),height:"".concat(a,"px")});var o=i*80/r,s=a*80/r;Di(this.get("gridContainer"),{width:"".concat(o,"px"),height:"".concat(s,"px"),left:"-".concat(o/2,"px"),top:"-".concat(s/2,"px")})},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var r=this.get("gridContainer"),i=t.matrix;i||(i=[1,0,0,0,1,0,0,0,1]);var a=this.get("follow"),o="matrix(".concat(i[0],", ").concat(i[1],", ").concat(i[3],", ").concat(i[4],", ").concat(a?i[6]:"0",", ").concat(a?i[7]:"0",")");Di(r,{transform:o})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph"),r=t.get("container"),i=this.get("container");r.removeChild(i)},e}(zd);const Ndr=Ddr;var cT={exports:{}},YEe=[],PP=[],kdr="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function QHe(n,e){if(e=e||{},n===void 0)throw new Error(kdr);var t=e.prepend===!0?"prepend":"append",r=e.container!==void 0?e.container:document.querySelector("head"),i=YEe.indexOf(r);i===-1&&(i=YEe.push(r)-1,PP[i]={});var a;return PP[i]!==void 0&&PP[i][t]!==void 0?a=PP[i][t]:(a=PP[i][t]=Fdr(),t==="prepend"?r.insertBefore(a,r.childNodes[0]):r.appendChild(a)),n.charCodeAt(0)===65279&&(n=n.substr(1,n.length)),a.styleSheet?a.styleSheet.cssText+=n:a.textContent+=n,a}function Fdr(){var n=document.createElement("style");return n.setAttribute("type","text/css"),n}cT.exports=QHe;cT.exports.insertCss=QHe;var Bdr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();typeof document<"u"&&cT.exports(` .g6-component-contextmenu { border: 1px solid #e2e2e2; border-radius: 4px; font-size: 12px; color: #545454; background-color: rgba(255, 255, 255, 0.9); padding: 10px 8px; box-shadow: rgb(174, 174, 174) 0px 0px 10px; } .g6-contextmenu-ul { padding: 0; margin: 0; list-style: none; } `);var Gdr=function(n){Bdr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(r){return`
  • \u83DC\u5355\u98791
  • \u83DC\u5355\u98792
`},shouldBegin:function(r){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},e.prototype.getEvents=function(){return this.get("trigger")==="click"?{click:"onMenuShow",touchend:"onMenuShow"}:{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=this.get("className"),r=zs("
"));Di(r,{top:"0px",position:"absolute",visibility:"hidden"});var i=this.get("container");i||(i=this.get("graph").get("container")),rr(i)&&(i=document.getElementById(i)),i.appendChild(r),this.set("menu",r)},e.prototype.onMenuShow=function(t){var r=this;t.preventDefault();var i=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&i.indexOf(t.item.getType())===-1){r.onMenuHide();return}}else if(i.indexOf("canvas")===-1){r.onMenuHide();return}var a=this.get("shouldBegin");if(!!a(t)){var o=this.get("menu"),s=this.get("getContent"),l=this.get("graph"),u=s(t,l);rr(u)?o.innerHTML=u:o.innerHTML=u.outerHTML,this.removeMenuEventListener();var h=this.get("handleMenuClick");if(h){var c=function(E){h(E.target,t.item,l)};this.set("handleMenuClickWrapper",c),o.addEventListener("click",c)}var f=l.get("width"),d=l.get("height"),v=o.getBoundingClientRect(),p=this.get("offsetX")||0,g=this.get("offsetY")||0,m=l.getContainer().offsetTop,y=l.getContainer().offsetLeft,_=t.canvasX+y+p,x=t.canvasY+m+g;_+v.width>f&&(_=t.canvasX-v.width-p+y),x+v.height>d&&(x=t.canvasY-v.height-g+m),x<0&&(x=0),Di(o,{top:"".concat(x,"px"),left:"".concat(_,"px"),visibility:"visible"});var S=this.get("trigger")==="click",w=function(E){if(S){S=!1;return}r.onMenuHide()};document.body.addEventListener("click",w),this.set("handler",w)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),r=this.get("handler");if(t){var i=this.get("menu");i.removeEventListener("click",t),this.set("handleMenuClickWrapper",null)}r&&document.body.removeEventListener("click",r)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&Di(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var r=this.get("container");r||(r=this.get("graph").get("container")),rr(r)&&(r=document.getElementById(r)),r.removeChild(t)}},e}(zd);const zdr=Gdr;var Udr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ote=globalThis&&globalThis.__assign||function(){return ote=Object.assign||function(n){for(var e,t=1,r=arguments.length;t-1,u=navigator.userAgent.toLowerCase().indexOf("safari")>-1,h=zs(`
`)),c=0,f=0,d=!1,v=0,p=0,g=0,m=0,y=0,_=0,x=u||l?"mousedown":"dragstart";h.addEventListener(x,function(E){var T,C;if(E.dataTransfer){var A=new Image;A.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",(C=(T=E.dataTransfer).setDragImage)===null||C===void 0||C.call(T,A,0,0);try{E.dataTransfer.setData("text/html","view-port-minimap")}catch{E.dataTransfer.setData("text","view-port-minimap")}}if(r.refresh=!1,E.target===h){var M=h.style;v=parseInt(M.left,10),p=parseInt(M.top,10),g=parseInt(M.width,10),m=parseInt(M.height,10),!(g>i[0]||m>i[1])&&(_=a.getZoom(),y=t.get("ratio"),d=!0,c=E.clientX,f=E.clientY)}},!1);var S=function(T){if(!(!d||an(T.clientX)||an(T.clientY))){var C=c-T.clientX,A=f-T.clientY;(v-C<0||v-C+g>=i[0])&&(C=0),(p-A<0||p-A+m>=i[1])&&(A=0),v-=C,p-=A,Di(h,{left:"".concat(v,"px"),top:"".concat(p,"px")}),a.translate(C*_/y,A*_/y),c=T.clientX,f=T.clientY}};!u&&!l&&h.addEventListener("drag",S,!1);var w=function(){d=!1,r.refresh=!0},b=u||l?"mouseup":"dragend";h.addEventListener(b,w,!1),s.addEventListener("mouseleave",w),s.addEventListener("mouseup",w),(u||l)&&s.addEventListener("mousemove",S,!1),this.set("viewport",h),s.appendChild(h)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),r=this.get("totaldx"),i=this.get("totaldy"),a=this.get("graph"),o=this.get("size"),s=a.get("canvas").get("el"),l=a.get("width")||s.scrollWidth||500,u=a.get("height")||s.scrollHeight||500,h=a.getPointByCanvas(0,0),c=a.getPointByCanvas(l,u),f=this.get("viewport");f||this.initViewport();var d=(c.x-h.x)*t,v=(c.y-h.y)*t,p=h.x*t+r,g=h.y*t+i,m=p+d,y=g+v;p<0&&(d+=p,p=0),m>o[0]&&(d=d-(m-o[0])),g<0&&(v+=g,g=0),y>o[1]&&(v=v-(y-o[1])),this.set("ratio",t);var _="".concat(p,"px"),x="".concat(g,"px");Di(f,{left:_,top:x,width:"".concat(d,"px"),height:"".concat(v,"px")})}},e.prototype.updateGraphShapes=function(){var t=this._cfgs.graph,r=this.get("canvas"),i=t.get("group");if(!i.destroyed){r.clear();var a;this.get("hideEdge")?(a=r.addGroup(),i.get("children").forEach(function(s){s.get("id").includes("-edge")||a.add(s.clone())})):(a=i.clone(),a.resetMatrix(),r.add(a));var o=t.get("renderer");o===ZEe&&this.updateVisible(a)}},e.prototype.updateVisible=function(t){var r=this;if(!t.isGroup()&&!t.get("visible"))t.hide();else{var i=t.get("children");if(!i||!i.length)return;i.forEach(function(a){a.get("visible")||a.hide(),r.updateVisible(a)})}},e.prototype.updateKeyShapes=function(){var t=this,r=this._cfgs.graph,i=this.get("canvas"),a=i.get("children")[0]||i.addGroup();this.get("hideEdge")||At(r.getEdges(),function(l){t.updateOneEdgeKeyShape(l,a)}),At(r.getNodes(),function(l){t.updateOneNodeKeyShape(l,a)});var o=r.getCombos();if(o&&o.length){var s=a.find(function(l){return l.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||(At(o,function(l){t.updateOneComboKeyShape(l,s)}),s==null||s.sort(),s==null||s.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.updateOneComboKeyShape=function(t,r){if(!this.destroyed){var i=this.get("itemMap")||{},a=i[t.get("id")],o=t.getBBox(),s=t.get("keyShape").clone(),l=s.attr(),u={x:o.centerX,y:o.centerY};a?u=Object.assign(l,u):(a=s,r.add(a));var h=a.get("type");(h==="rect"||h==="image")&&(u.x=o.minX,u.y=o.minY),a.attr(u),t.isVisible()?a.show():a.hide(),a.exist=!0;var c=t.getModel().depth;isNaN(c)||a.set("zIndex",c),i[t.get("id")]=a,this.set("itemMap",i)}},e.prototype.updateOneNodeKeyShape=function(t,r){var i=this.get("itemMap")||{},a=i[t.get("id")],o=t.getBBox(),s=t.get("keyShape").clone(),l=s.attr(),u={x:o.centerX,y:o.centerY};a?(u=Object.assign(l,u),a.toFront()):(a=s,r.add(a));var h=a.get("type");(h==="rect"||h==="image")&&(u.x=o.minX,u.y=o.minY),a.attr(u),t.isVisible()?a.show():a.hide(),a.exist=!0;var c=t.getModel().depth;isNaN(c)||a.set("zIndex",c),i[t.get("id")]=a,this.set("itemMap",i)},e.prototype.updateDelegateShapes=function(){var t=this,r=this._cfgs.graph,i=this.get("canvas"),a=i.get("children")[0]||i.addGroup();this.get("hideEdge")||At(r.getEdges(),function(l){t.updateOneEdgeKeyShape(l,a)}),At(r.getNodes(),function(l){t.updateOneNodeDelegateShape(l,a)});var o=r.getCombos();if(o&&o.length){var s=a.find(function(l){return l.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||(At(o,function(l){t.updateOneComboKeyShape(l,s)}),s==null||s.sort(),s==null||s.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},r=Object.keys(t);if(!(!r||r.length===0))for(var i=r.length-1;i>=0;i--){var a=t[r[i]],o=a.exist;a.exist=!1,o||(a.remove(),delete t[r[i]])}},e.prototype.updateOneEdgeKeyShape=function(t,r){var i=this.get("itemMap")||{},a=i[t.get("id")];if(a){var o=t.get("keyShape").attr("path");a.attr("path",o)}else a=t.get("keyShape").clone(),r.add(a);t.isVisible()?a.show():a.hide(),a.exist=!0,i[t.get("id")]=a,this.set("itemMap",i)},e.prototype.updateOneNodeDelegateShape=function(t,r){var i=this.get("delegateStyle"),a=this.get("itemMap")||{},o=a[t.get("id")],s=t.getBBox();if(o){var l={x:s.minX,y:s.minY,width:s.width,height:s.height};o.attr(l),o.toFront()}else o=r.addShape("rect",{attrs:ote({x:s.minX,y:s.minY,width:s.width,height:s.height},i),name:"minimap-node-shape"});t.isVisible()?o.show():o.hide(),o.exist=!0,a[t.get("id")]=o,this.set("itemMap",a)},e.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},e.prototype.initContainer=function(){var t=this,r=t.get("graph"),i=t.get("size"),a=t.get("className"),o=t.get("container"),s=zs("
"));rr(o)&&(o=document.getElementById(o)),o?o.appendChild(s):r.get("container").appendChild(s),t.set("container",s);var l=zs('
');s.appendChild(l),l.addEventListener("dragenter",function(c){c.preventDefault()}),l.addEventListener("dragover",function(c){c.preventDefault()});var u,h=r.get("renderer");h===ZEe?u=new yR({container:l,width:i[0],height:i[1]}):u=new M1({container:l,width:i[0],height:i[1]}),t.set("canvas",u),t.updateCanvas()},e.prototype.updateCanvas=function(){if(!this.destroyed){var t=this.get("refresh");if(!!t){var r=this.get("graph");if(!r.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var i=this.get("size"),a=this.get("canvas"),o=this.get("type"),s=this.get("padding");if(!a.destroyed){switch(o){case $dr:this.updateGraphShapes();break;case Wdr:this.updateKeyShapes();break;case Hdr:this.updateDelegateShapes();break}var l=a.get("children")[0];if(!!l){l.resetMatrix();var u=l.getCanvasBBox(),h=r.get("canvas").getCanvasBBox(),c=r.getZoom()||1,f=h.width/c,d=h.height/c;Number.isFinite(u.width)&&(f=qEe(u.width,f),d=qEe(u.height,d)),f+=2*s,d+=2*s;var v=Math.min(i[0]/f,i[1]/d),p=[1,0,0,0,1,0,0,0,1],g=0,m=0;Number.isFinite(u.minX)&&(g=-u.minX),Number.isFinite(u.minY)&&(m=-u.minY);var y=(i[0]-(f-2*s)*v)/2,_=(i[1]-(d-2*s)*v)/2;p=Vdr(p,[["t",g,m],["s",v,v],["t",y,_]]),l.setMatrix(p),this.set("ratio",v),this.set("totaldx",y+g*v),this.set("totaldy",_+m*v),this.set("dx",y),this.set("dy",_),this.updateViewport()}}}}}},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t;(t=this.get("canvas"))===null||t===void 0||t.destroy();var r=this.get("container");r!=null&&r.parentNode&&r.parentNode.removeChild(r)},e}(zd);const Xdr=jdr;var Ydr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();function uy(n,e,t){var r=n.x-e.x,i=n.y-e.y;return!t||Math.abs(r)>t||Math.abs(i)>t?Math.sqrt(r*r+i*i):t}function qdr(n,e){return n.x*e.x+n.y*e.y}function KEe(n,e){var t=(e.source.y-e.target.y)/(e.source.x-e.target.x),r=(t*t*e.source.x+t*(n.y-e.source.y)+n.x)/(t*t+1),i=t*(r-e.source.x)+e.source.y;return{x:r,y:i}}var Zdr=function(n){Ydr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},e.prototype.init=function(){var t=this.get("graph"),r=this.get("onTick"),i=function(){r&&r(),t.refreshPositions()};this.set("tick",i)},e.prototype.bundling=function(t){var r=this;if(r.set("data",t),!r.isTicking()){var i=t.edges||[],a=t.nodes||[],o={},s=!1;if(a.forEach(function(x){(x.x===null||!x.y===null||x.x===void 0||!x.y===void 0)&&(s=!0),o[x.id]=x}),s)throw new Error("please layout the graph or assign x and y for nodes first");r.set("nodeIdMap",o);var l=r.get("divisions"),u=r.get("divRate"),h=r.divideEdges(l);r.set("edgePoints",h);var c=r.getEdgeBundles();r.set("edgeBundles",c);for(var f=r.get("cycles"),d=r.get("iterations"),v=r.get("iterRate"),p=r.get("lambda"),g=0;gv;){var _=v/y,x={x:o[l][m-1].x,y:o[l][m-1].y};x.x+=_*(g.x-o[l][m-1].x),x.y+=_*(g.y-o[l][m-1].y),p.push(x),y-=v,v=d}v-=y}}),p.push({x:c.x,y:c.y}),o[l]=p}}),o},e.prototype.getEdgeLength=function(t){var r=0;return t.forEach(function(i,a){a!==0&&(r+=uy(i,t[a-1]))}),r},e.prototype.getEdgeBundles=function(){var t=this,r=t.get("data"),i=r.edges||[],a=t.get("bundleThreshold"),o=t.get("nodeIdMap"),s=t.get("edgeBundles");return s||(s=[]),i.forEach(function(l,u){(!s[u]||s[u]===void 0)&&(s[u]=[])}),i.forEach(function(l,u){var h=o[l.source],c=o[l.target];i.forEach(function(f,d){if(!(d<=u)){var v=o[f.source],p=o[f.target],g=t.getBundleScore({source:h,target:c},{source:v,target:p});g>=a&&(s[u].push(d),s[d].push(u))}})}),s},e.prototype.getBundleScore=function(t,r){var i=this;t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,r.vx=r.target.x-r.source.x,r.vy=r.target.y-r.source.y,t.length=uy({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),r.length=uy({x:r.source.x,y:r.source.y},{x:r.target.x,y:r.target.y});var a=i.getAngleScore(t,r),o=i.getScaleScore(t,r),s=i.getPositionScore(t,r),l=i.getVisibilityScore(t,r);return a*o*s*l},e.prototype.getAngleScore=function(t,r){var i=qdr({x:t.vx,y:t.vy},{x:r.vx,y:r.vy});return i/(t.length*r.length)},e.prototype.getScaleScore=function(t,r){var i=(t.length+r.length)/2,a=2/(i/Math.min(t.length,r.length)+Math.max(t.length,r.length)/i);return a},e.prototype.getPositionScore=function(t,r){var i=(t.length+r.length)/2,a={x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},o={x:(r.source.x+r.target.x)/2,y:(r.source.y+r.target.y)/2},s=uy(a,o);return i/(i+s)},e.prototype.getVisibilityScore=function(t,r){var i=this.getEdgeVisibility(t,r),a=this.getEdgeVisibility(r,t);return ia||Math.abs(c.y)>a){var f=uy(s[h][t],s[r][t]),d=1/f;u.x+=c.x*d,u.y+=c.y*d}}),u},e.prototype.isTicking=function(){return this.get("ticking")},e.prototype.getSimulation=function(){return this.get("forceSimulation")},e.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),n.prototype.destroy.call(this)},e}(zd);const Kdr=Zdr;var Jdr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ste=globalThis&&globalThis.__assign||function(){return ste=Object.assign||function(n){for(var e,t=1,r=arguments.length;t(u||i.get("height"))&&a>1||c<(h||i.get("height")*.05)&&a<1)&&(a=1),c*=a,r.set("r",c),r.set("r2",c*c);var f=r.get("d");r.set("molecularParam",(f+1)*c),r.set("delegateCenterDiff",void 0),r.magnify(t,l)}},e.prototype.scaleRByDrag=function(t){var r=this;if(!!t){var i=r.get("dragPrePos"),a=r.get("graph"),o,s=a.getPointByClient(t.clientX,t.clientY);t.x-i.x<0?o=1-X5:o=1/(1-X5);var l=r.get("maxR"),u=r.get("minR"),h=r.get("r");(h>(l||a.get("height"))&&o>1||h<(u||a.get("height")*.05)&&o<1)&&(o=1),h*=o,r.set("r",h),r.set("r2",h*h);var c=r.get("d");r.set("molecularParam",(c+1)*h),r.magnify(t,s),r.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){var r=this;if(!(!t&&!t.originalEvent)){t.preventDefault&&t.preventDefault();var i=0;t.originalEvent.wheelDelta<0?i=-.1:i=.1;var a=r.get("d"),o=a+i,s=r.get("maxD"),l=r.get("minD");if(ol){r.set("d",o);var u=r.get("r");r.set("molecularParam",(o+1)*u);var h=r.get("delegate"),c=h?{x:h.attr("x"),y:h.attr("y")}:void 0;r.set("delegateCenterDiff",void 0),r.magnify(t,c)}}},e.prototype.scaleDByDrag=function(t){var r=this,i=r.get("dragPrePos"),a=t.x-i.x>0?.1:-.1,o=r.get("d"),s=o+a,l=r.get("maxD"),u=r.get("minD");if(su){r.set("d",s);var h=r.get("r");r.set("molecularParam",(s+1)*h),r.magnify(t)}r.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,r){var i=this;i.restoreCache();var a=i.get("graph"),o=i.get("cachedMagnifiedModels"),s=i.get("cachedOriginPositions"),l=i.get("showLabel"),u=i.get("r"),h=i.get("r2"),c=i.get("d"),f=i.get("molecularParam"),d=a.getNodes(),v=d.length,p=r?{x:r.x,y:r.y}:{x:t.x,y:t.y};i.get("dragging")&&(i.get("trigger")==="mousemove"||i.get("trigger")==="click")&&(p=i.get("cacheCenter"));var g=i.get("delegateCenterDiff");g&&(p.x+=g.x,p.y+=g.y),i.updateDelegate(p,u);for(var m=0;m
  • `},zoomSensitivity:2}},e.prototype.init=function(){var t=this,r=this.get("graph"),i=this.get("getContent"),a=i(r),o=a;rr(a)&&(o=zs(a));var s=this.get("className");o.setAttribute("class",s||"g6-component-toolbar");var l=this.get("container");l||(l=this.get("graph").get("container")),rr(l)&&(l=document.getElementById(l)),l.appendChild(o),this.set("toolBar",o);var u=this.get("handleClick");o.addEventListener("click",function(c){var f=rvr(c).filter(function(v){return v.nodeName==="LI"});if(f.length!==0){var d=f[0].getAttribute("code");!d||(u?u(d,r):t.handleDefaultOperator(d))}});var h=this.get("position");h&&Di(o,{top:"".concat(h.y,"px"),left:"".concat(h.x,"px")}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=this.get("graph"),r=document.querySelector('.g6-component-toolbar li[code="undo"]'),i=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),a=document.querySelector('.g6-component-toolbar li[code="redo"]'),o=document.querySelector('.g6-component-toolbar li[code="redo"] svg');!r||!i||!a||!o||(r.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4"),a.setAttribute("style","cursor: not-allowed"),o.setAttribute("style","opacity: 0.4"),t.on("stackchange",function(s){var l=s.undoStack,u=s.redoStack,h=l.length,c=u.length;h===0?(r.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(r.removeAttribute("style"),i.removeAttribute("style")),c===0?(a.setAttribute("style","cursor: not-allowed"),o.setAttribute("style","opacity: 0.4")):(a.removeAttribute("style"),o.removeAttribute("style"))}))},e.prototype.undo=function(){var t=this.get("graph"),r=t.getUndoStack();if(!(!r||r.length===0)){var i=r.pop();if(i){var a=i.action;t.pushStack(a,Xi(i.data),"redo");var o=i.data.before;if(a==="add"&&(o=i.data.after),!o)return;switch(a){case"visible":{Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){var v=t.findById(d.id);d.visible?t.showItem(v,!1):t.hideItem(v,!1)})});break}case"render":case"update":Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){var v=t.findById(d.id);delete d.id,t.updateItem(v,d,!1),v.getType()==="combo"&&t.updateCombo(v)})});break;case"changedata":t.changeData(o,!1);break;case"delete":{Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){var v=d.itemType;delete d.itemType,t.addItem(v,d,!1)})});break}case"add":Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){t.removeItem(d.id,!1)})});break;case"updateComboTree":Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){t.updateComboTree(d.id,d.parentId,!1)})});break;case"createCombo":var s=i.data.after.combos,l=s[s.length-1];Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){t.updateComboTree(d.id,d.parentId,!1)})}),t.removeItem(l.id,!1);break;case"uncombo":var u=o.combos[o.combos.length-1],h=o.nodes.concat(o.combos).map(function(c){return c.id}).filter(function(c){return c!==u.id});t.createCombo(u,h,!1);break;case"layout":t.updateLayout(o,void 0,void 0,!1);break}}}},e.prototype.redo=function(){var t=this.get("graph"),r=t.getRedoStack();if(!(!r||r.length===0)){var i=r.pop();if(i){var a=i.action,o=i.data.after;if(t.pushStack(a,Xi(i.data)),a==="delete"&&(o=i.data.before),!o)return;switch(a){case"visible":{Object.keys(o).forEach(function(h){var c=o[h];!c||c.forEach(function(f){var d=t.findById(f.id);f.visible?t.showItem(d,!1):t.hideItem(d,!1)})});break}case"render":case"update":Object.keys(o).forEach(function(h){var c=o[h];!c||c.forEach(function(f){var d=t.findById(f.id);delete f.id,t.updateItem(d,f,!1),d.getType()==="combo"&&t.updateCombo(d)})});break;case"changedata":t.changeData(o,!1);break;case"delete":o.edges&&o.edges.forEach(function(h){t.removeItem(h.id,!1)}),o.nodes&&o.nodes.forEach(function(h){t.removeItem(h.id,!1)}),o.combos&&o.combos.forEach(function(h){t.removeItem(h.id,!1)});break;case"add":{Object.keys(o).forEach(function(h){var c=o[h];!c||c.forEach(function(f){var d=f.itemType;delete f.itemType,t.addItem(d,f,!1)})});break}case"updateComboTree":Object.keys(o).forEach(function(h){var c=o[h];!c||c.forEach(function(f){t.updateComboTree(f.id,f.parentId,!1)})});break;case"createCombo":var s=o.combos[o.combos.length-1];t.createCombo(s,s.children.map(function(h){return h.id}),!1);break;case"uncombo":var l=i.data.before.combos,u=l[l.length-1];t.uncombo(u.id,!1);break;case"layout":t.updateLayout(o,void 0,void 0,!1);break}}}},e.prototype.zoomOut=function(){var t=this.get("graph"),r=t.getZoom(),i=1/(1-QEe*this.get("zoomSensitivity")),a=this.get("maxZoom")||t.get("maxZoom");i*r>a||t.zoomTo(r*i)},e.prototype.zoomIn=function(){var t=this.get("graph"),r=t.getZoom(),i=1-QEe*this.get("zoomSensitivity"),a=this.get("minZoom")||t.get("minZoom");i*r\u7C7B\u578B\uFF1A`.concat(r.item.getType(),` ID\uFF1A`).concat(r.item.getID(),` `)},shouldBegin:function(r){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},e.prototype.getEvents=function(){return this.get("trigger")==="click"?{"node:click":"onClick","edge:click":"onClick","combo:click":"onClick","canvas:click":"onMouseLeave",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave",drag:"onMouseLeave"}:{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},e.prototype.init=function(){var t=this,r=t.get("className")||"g6-component-tooltip",i=zs("
    ")),a=t.get("container");a||(a=t.get("graph").get("container")),rr(a)&&(a=document.getElementById(a)),Di(i,{position:"absolute",visibility:"hidden",display:"none"}),a.appendChild(i),t.get("trigger")!=="click"&&(i.addEventListener("mouseenter",function(o){Di(i,{visibility:"visible",display:"unset"})}),i.addEventListener("mouseleave",function(o){t.hideTooltip()})),t.set("tooltip",i)},e.prototype.onClick=function(t){var r=this.get("itemTypes");if(!(t.item&&t.item.getType&&r.indexOf(t.item.getType())===-1)){var i=t.item,a=this.get("graph");this.currentTarget===i?(this.currentTarget=null,this.hideTooltip(),a.emit("tooltipchange",{item:t.item,action:"hide"})):(this.currentTarget=i,this.showTooltip(t),a.emit("tooltipchange",{item:t.item,action:"show"}))}},e.prototype.onMouseEnter=function(t){var r=this.get("itemTypes");if(!(t.item&&t.item.getType&&r.indexOf(t.item.getType())===-1)){var i=t.item,a=this.get("graph");this.currentTarget=i,this.showTooltip(t),a.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var r=this.get("itemTypes");t.item&&t.item.getType&&r.indexOf(t.item.getType())===-1||!this.currentTarget||t.item!==this.currentTarget||this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip();var t=this.get("graph");t.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.clearContainer=function(){var t=this.get("tooltip");t&&(t.innerHTML="")},e.prototype.showTooltip=function(t){if(!!t.item){var r=this.get("itemTypes");if(!(t.item.getType&&r.indexOf(t.item.getType())===-1)){var i=this.get("tooltip"),a=this.get("getContent"),o=a(t);rr(o)?i.innerHTML=o:(this.clearContainer(),i.appendChild(o)),this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&Di(t,{visibility:"hidden",display:"none"})},e.prototype.updatePosition=function(t){var r=this.get("shouldBegin"),i=this.get("tooltip");if(!r(t)){Di(i,{visibility:"hidden",display:"none"});return}var a=this.get("graph"),o=a.get("width"),s=a.get("height"),l=this.get("offsetX")||0,u=this.get("offsetY")||0,h=a.getPointByClient(t.clientX,t.clientY),c=this.get("fixToNode"),f=t.item;if(f.getType&&f.getType()==="node"&&c&&vn(c)&&c.length>=2){var d=f.getBBox();h={x:d.minX+d.width*c[0],y:d.minY+d.height*c[1]}}var v=a.getCanvasByPoint(h.x,h.y),p=v.x,g=v.y,m=a.getContainer(),y={x:p+m.offsetLeft+l,y:g+m.offsetTop+u};Di(i,{visibility:"visible",display:"unset"});var _=i.getBoundingClientRect();p+_.width+l>o&&(y.x-=_.width+l),g+_.height+u>s&&(y.y-=_.height+u,y.y<0&&(y.y=0)),Di(i,{left:"".concat(y.x,"px"),top:"".concat(y.y,"px")})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var r=this.get("container");r||(r=this.get("graph").get("container")),rr(r)&&(r=document.getElementById(r)),r.removeChild(t)}},e}(zd);const svr=ovr;var eje="timebarstartplay",tje="timebarendplay",Oy="valuechange",GE="timebarConfigChanged",uS="playPauseBtn",nN="nextStepBtn",iN="preStepBtn",lvr=function(){function n(e){var t=e.x,r=t===void 0?0:t,i=e.y,a=i===void 0?0:i,o=e.container,s=e.text,l=e.padding,u=l===void 0?[4,4,4,4]:l,h=e.className,c=h===void 0?"g6-component-timebar-tooltip":h,f=e.backgroundColor,d=f===void 0?"#000":f,v=e.textColor,p=v===void 0?"#fff":v,g=e.opacity,m=g===void 0?.8:g,y=e.fontSize,_=y===void 0?12:y;this.container=o,this.className=c,this.backgroundColor=d,this.textColor=p,this.x=r,this.y=a,this.text=s,this.padding=u,this.opacity=m,this.fontSize=_,this.render()}return n.prototype.render=function(){var e=this,t=e.className;e.x,e.y;var r=e.backgroundColor,i=e.textColor,a=e.text,o=e.padding,s=e.opacity,l=e.fontSize,u=e.container,h=zs("
    '));rr(u)&&(u=document.getElementById(u)),u.appendChild(h),e.parentHeight=u.offsetHeight,e.parentWidth=u.offsetWidth,Di(h,{visibility:"hidden",top:0,left:0});var c=zs(`
    "));c.innerHTML=a,h.appendChild(c),e.backgroundDOM=c;var f=zs("
    "));h.appendChild(f),e.arrowDOM=f,e.container=h},n.prototype.show=function(e){var t=this,r=e.text,i=e.x;e.y,e.clientX,e.clientY,t.backgroundDOM.innerHTML=r;var a=t.backgroundDOM.offsetWidth,o=t.backgroundDOM.offsetHeight,s=t.arrowDOM.offsetWidth,l=t.arrowDOM.offsetHeight;Di(t.container,{top:"".concat(-o-l,"px"),left:"".concat(i,"px"),visibility:"visible"}),Di(t.backgroundDOM,{marginLeft:"".concat(-a/2,"px")}),Di(t.arrowDOM,{marginLeft:"".concat(-s/2,"px"),top:"".concat(o,"px")});var u=i-a/2,h=i+a/2;u<0?Di(t.backgroundDOM,{marginLeft:"".concat(-a/2-u,"px")}):h>t.parentWidth&&Di(t.backgroundDOM,{marginLeft:"".concat(-a/2-h+t.parentWidth+12,"px")})},n.prototype.hide=function(){Di(this.container,{top:0,left:0,visibility:"hidden"})},n}();const uvr=lvr;var lte=globalThis&&globalThis.__assign||function(){return lte=Object.assign||function(n){for(var e,t=1,r=arguments.length;th&&(o=h,a=u)})}t.originalEvent.deltaY>0?a=Math.max(0,a-1):a=Math.min(e.speedAxisY.length-1,a+1);var s=e.speedAxisY[a]-i;r=OP(r,[["t",0,s]]),e.speedPoint.setMatrix(r),e.currentSpeed=e.speedAxisY.length-a,e.speedText.attr("text","".concat(e.currentSpeed,".0X")),e.group.emit(GE,{speed:e.currentSpeed,type:e.currentType})}),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",function(t){var r,i,a=t.target.get("isChecked");a?(e.checkedIcon.hide(),e.checkedText.attr("text",((i=e.controllerCfg)===null||i===void 0?void 0:i.timePointControllerText)||"\u5355\u4E00\u65F6\u95F4"),e.currentType=Cy.RANGE):(e.checkedIcon.show(),e.checkedText.attr("text",((r=e.controllerCfg)===null||r===void 0?void 0:r.timeRangeControllerText)||"\u65F6\u95F4\u8303\u56F4"),e.currentType=Cy.SINGLE),t.target.set("isChecked",!a),e.group.emit(GE,{type:e.currentType,speed:e.currentSpeed})})},n.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},n}();const ije=mvr;var bR=globalThis&&globalThis.__assign||function(){return bR=Object.assign||function(n){for(var e,t=1,r=arguments.length;t=E&&I<=T,k=R?h:c,D=S.addShape("rect",{attrs:bR({x:a+I*(x+y),y:a,width:x,height:m},k),draggable:!0,name:"tick-rect-".concat(I)}),G=S.addShape("rect",{attrs:{x:a+I*x+y*(2*I-1)/2,y:a,width:I===0||I===_-1?x+y/2:x+y,height:m,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(I)});G.toFront();var W=D.getBBox(),z=(W.minX+W.maxX)/2;w.push({rect:D,pickRect:G,value:M.date,x:z,y:W.minY});var V;if(u?(V=u(M),!rr(V)&&V&&(V=M.date)):I%Math.round(_/10)===0&&(V=M.date),V){b.push(V);var q=W.maxY+a*2;S.addShape("line",{attrs:{stroke:"#BFBFBF",x1:z,y1:q,x2:z,y2:q+p},name:"tick-line"});var Y=q+p+a,le=S.addShape("text",{attrs:bR({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:z,y:Y,textAlign:"center",text:V,textBaseline:"top",fontSize:10,fontFamily:e.fontFamily||"Arial, sans-serif"},f),capture:!1,name:"tick-label"}),j=le.getBBox();if(j.maxX>r?le.attr("textAlign","right"):j.minX<0&&le.attr("textAlign","left"),on(C)&&b.length!==10){var Q=_vr([1,0,0,0,1,0,0,0,1],[["t",-z,-Y],["r",C],["t",z-5,Y+2]]);le.attr({textAlign:"left",matrix:Q})}b.length===1?le.attr({textAlign:"left"}):b.length===10&&le.attr({textAlign:"right"})}}),this.tickRects=w;var A=this.group;this.currentSpeed=1,this.controllerBtnGroup=new ije(bR({group:A,x:this.x,y:this.y+i+5,width:r,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"},this.controllerCfg))},n.prototype.initEvent=function(){var e=this,t=this.sliceGroup;t.on("click",function(h){var c=h.target;if(!(c.get("type")!=="rect"||!c.get("name"))){var f=parseInt(c.get("name").split("-")[2],10);if(!isNaN(f)){var d=e.tickRects,v=e.unselectedTickStyle;d.forEach(function(y){y.rect.attr(v)});var p=e.selectedTickStyle;d[f].rect.attr(p),e.startTickRectId=f,e.endTickRectId=f;var g=d.length,m=f/g;e.graph.emit(Oy,{value:[m,m]})}}}),t.on("dragstart",function(h){var c=e.tickRects,f=e.unselectedTickStyle;c.forEach(function(y){y.rect.attr(f)});var d=h.target,v=parseInt(d.get("name").split("-")[2],10),p=e.selectedTickStyle;c[v].rect.attr(p),e.startTickRectId=v;var g=c.length,m=v/g;e.graph.emit(Oy,{value:[m,m]}),e.dragging=!0}),t.on("dragover",function(h){if(!!e.dragging&&h.target.get("type")==="rect"){for(var c=parseInt(h.target.get("name").split("-")[2],10),f=e.startTickRectId,d=e.tickRects,v=e.selectedTickStyle,p=e.unselectedTickStyle,g=0;g=f&&g<=c?v:p;d[g].rect.attr(m)}var y=d.length;e.endTickRectId=c;var _=f/y,x=c/y;e.graph.emit(Oy,{value:[_,x]})}}),t.on("drop",function(h){if(!!e.dragging&&(e.dragging=!1,h.target.get("type")==="rect")){var c=e.startTickRectId,f=parseInt(h.target.get("name").split("-")[2],10);if(!(f0?t.endTickRectId++:(r[t.endTickRectId].rect.attr(a),t.endTickRectId--),s!==t.startTickRectId)t.endTickRectIdthis.max?NaN:this.values[a]},e.prototype.getText=function(t){for(var r=[],i=1;i1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(Jle),oje=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Lx="\\d\\d?",yx="\\d\\d",Tvr="\\d{3}",Cvr="\\d{4}",ER="[^\\s]+",sje=/\[([^]*?)\]/gm;function lje(n,e){for(var t=[],r=0,i=n.length;r-1?i:null}};function JS(n){for(var e=[],t=1;t3?0:(n-n%10!==10?1:0)*n%10]}},X9=JS({},Qle),cje=function(n){return X9=JS(X9,n)},t2e=function(n){return n.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},nd=function(n,e){for(e===void 0&&(e=2),n=String(n);n.length0?"-":"+")+nd(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(n){var e=n.getTimezoneOffset();return(e>0?"-":"+")+nd(Math.floor(Math.abs(e)/60),2)+":"+nd(Math.abs(e)%60,2)}},r2e=function(n){return+n-1},n2e=[null,Lx],i2e=[null,ER],a2e=["isPm",ER,function(n,e){var t=n.toLowerCase();return t===e.amPm[0]?0:t===e.amPm[1]?1:null}],o2e=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(n){var e=(n+"").match(/([+-]|\d\d)/gi);if(e){var t=+e[1]*60+parseInt(e[2],10);return e[0]==="+"?t:-t}return 0}],Lvr={D:["day",Lx],DD:["day",yx],Do:["day",Lx+ER,function(n){return parseInt(n,10)}],M:["month",Lx,r2e],MM:["month",yx,r2e],YY:["year",yx,function(n){var e=new Date,t=+(""+e.getFullYear()).substr(0,2);return+(""+(+n>68?t-1:t)+n)}],h:["hour",Lx,void 0,"isPm"],hh:["hour",yx,void 0,"isPm"],H:["hour",Lx],HH:["hour",yx],m:["minute",Lx],mm:["minute",yx],s:["second",Lx],ss:["second",yx],YYYY:["year",Cvr],S:["millisecond","\\d",function(n){return+n*100}],SS:["millisecond",yx,function(n){return+n*10}],SSS:["millisecond",Tvr],d:n2e,dd:n2e,ddd:i2e,dddd:i2e,MMM:["month",ER,e2e("monthNamesShort")],MMMM:["month",ER,e2e("monthNames")],a:a2e,A:a2e,ZZ:o2e,Z:o2e},Y9={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},fje=function(n){return JS(Y9,n)},dje=function(n,e,t){if(e===void 0&&(e=Y9.default),t===void 0&&(t={}),typeof n=="number"&&(n=new Date(n)),Object.prototype.toString.call(n)!=="[object Date]"||isNaN(n.getTime()))throw new Error("Invalid Date pass to format");e=Y9[e]||e;var r=[];e=e.replace(sje,function(a,o){return r.push(o),"@@@"});var i=JS(JS({},X9),t);return e=e.replace(oje,function(a){return Ivr[a](n,i)}),e.replace(/@@@/g,function(){return r.shift()})};function vje(n,e,t){if(t===void 0&&(t={}),typeof e!="string")throw new Error("Invalid format in fecha parse");if(e=Y9[e]||e,n.length>1e3)return null;var r=new Date,i={year:r.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],s=e.replace(sje,function(x,S){return o.push(t2e(S)),"@@@"}),l={},u={};s=t2e(s).replace(oje,function(x){var S=Lvr[x],w=S[0],b=S[1],E=S[3];if(l[w])throw new Error("Invalid format. "+w+" specified twice in format");return l[w]=!0,E&&(u[E]=!0),a.push(S),"("+b+")"}),Object.keys(u).forEach(function(x){if(!l[x])throw new Error("Invalid format. "+x+" is required in specified format")}),s=s.replace(/@@@/g,function(){return o.shift()});var h=n.match(new RegExp(s,"i"));if(!h)return null;for(var c=JS(JS({},X9),t),f=1;f11||i.month<0||i.day>31||i.day<1||i.hour>23||i.hour<0||i.minute>59||i.minute<0||i.second>59||i.second<0)return null;return m}var pje={format:dje,parse:vje,defaultI18n:Qle,setGlobalDateI18n:cje,setGlobalDateMasks:fje};const Pvr=Object.freeze(Object.defineProperty({__proto__:null,default:pje,assign:JS,format:dje,parse:vje,defaultI18n:Qle,setGlobalDateI18n:cje,setGlobalDateMasks:fje},Symbol.toStringTag,{value:"Module"}));function Ovr(n){return function(e,t,r,i){for(var a=an(r)?0:r,o=an(i)?e.length:i;a>>1;n(e[s])>t?o=s:a=s+1}return a}}var s2e="format";function gje(n,e){var t=Pvr[s2e]||pje[s2e];return t(n,e)}function q9(n){return rr(n)&&(n.indexOf("T")>0?n=new Date(n).getTime():n=new Date(n.replace(/-/gi,"/")).getTime()),Doe(n)&&(n=n.getTime()),n}var Vg=1e3,zE=60*Vg,UE=60*zE,N1=24*UE,TR=N1*31,l2e=N1*365,RP=[["HH:mm:ss",Vg],["HH:mm:ss",Vg*10],["HH:mm:ss",Vg*30],["HH:mm",zE],["HH:mm",zE*10],["HH:mm",zE*30],["HH",UE],["HH",UE*6],["HH",UE*12],["YYYY-MM-DD",N1],["YYYY-MM-DD",N1*4],["YYYY-WW",N1*7],["YYYY-MM",TR],["YYYY-MM",TR*4],["YYYY-MM",TR*6],["YYYY",N1*380]];function Rvr(n,e,t){var r=(e-n)/t,i=Ovr(function(o){return o[1]})(RP,r)-1,a=RP[i];return i<0?a=RP[0]:i>=RP.length&&(a=Fp(RP)),a}var Dvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="timeCat",t}return e.prototype.translate=function(t){t=q9(t);var r=this.values.indexOf(t);return r===-1&&(on(t)&&t-1){var a=this.values[i],o=this.formatter;return a=o?o(a,r):gje(a,this.mask),a}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var t=this.values;At(t,function(r,i){t[i]=q9(r)}),t.sort(function(r,i){return r-i}),n.prototype.setDomain.call(this)},e}(gk),LV=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.isContinuous=!0,t}return e.prototype.scale=function(t){if(an(t))return NaN;var r=this.rangeMin(),i=this.rangeMax(),a=this.max,o=this.min;if(a===o)return r;var s=this.getScalePercent(t);return r+s*(i-r)},e.prototype.init=function(){n.prototype.init.call(this);var t=this.ticks,r=Ky(t),i=Fp(t);rthis.max&&(this.max=i),an(this.minLimit)||(this.min=r),an(this.maxLimit)||(this.max=i)},e.prototype.setDomain=function(){var t=f9e(this.values),r=t.min,i=t.max;an(this.min)&&(this.min=r),an(this.max)&&(this.max=i),this.min>this.max&&(this.min=r,this.max=i)},e.prototype.calculateTicks=function(){var t=this,r=n.prototype.calculateTicks.call(this);return this.nice||(r=RU(r,function(i){return i>=t.min&&i<=t.max})),r},e.prototype.getScalePercent=function(t){var r=this.max,i=this.min;return(t-i)/(r-i)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(Jle),Nvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="linear",t.isLinear=!0,t}return e.prototype.invert=function(t){var r=this.getInvertPercent(t);return this.min+r*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(LV);const yk=Nvr;function zx(n,e){var t=Math.E,r;return e>=0?r=Math.pow(t,Math.log(e)/n):r=Math.pow(t,Math.log(-e)/n)*-1,r}function dp(n,e){return n===1?1:Math.log(e)/Math.log(n)}function yje(n,e,t){an(t)&&(t=Math.max.apply(null,n));var r=t;return At(n,function(i){i>0&&i1&&(r=1),r}var kvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="log",t}return e.prototype.invert=function(t){var r=this.base,i=dp(r,this.max),a=this.rangeMin(),o=this.rangeMax()-a,s,l=this.positiveMin;if(l){if(t===0)return 0;s=dp(r,l/r);var u=1/(i-s)*o;if(t=0?1:-1;return Math.pow(s,i)*l},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var r=this.max,i=this.min;if(r===i)return 0;var a=this.exponent,o=(zx(a,t)-zx(a,i))/(zx(a,r)-zx(a,i));return o},e}(LV),Bvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="time",t}return e.prototype.getText=function(t,r){var i=this.translate(t),a=this.formatter;return a?a(i,r):gje(i,this.mask)},e.prototype.scale=function(t){var r=t;return(rr(r)||Doe(r))&&(r=this.translate(r)),n.prototype.scale.call(this,r)},e.prototype.translate=function(t){return q9(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,r=this.getConfig("min"),i=this.getConfig("max");if((!an(r)||!on(r))&&(this.min=this.translate(this.min)),(!an(i)||!on(i))&&(this.max=this.translate(this.max)),t&&t.length){var a=[],o=1/0,s=o,l=0;At(t,function(u){var h=q9(u);if(isNaN(h))throw new TypeError("Invalid Time: "+u+" in time scale!");o>h?(s=o,o=h):s>h&&(s=h),l1&&(this.minTickInterval=s-o),an(r)&&(this.min=o),an(i)&&(this.max=l)}},e}(yk),mje=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="quantize",t}return e.prototype.invert=function(t){var r=this.ticks,i=r.length,a=this.getInvertPercent(t),o=Math.floor(a*(i-1));if(o>=i-1)return Fp(r);if(o<0)return Ky(r);var s=r[o],l=r[o+1],u=o/(i-1),h=(o+1)/(i-1);return s+(a-u)/(h-u)*(l-s)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var t=n.prototype.calculateTicks.call(this);return this.nice||(Fp(t)!==this.max&&t.push(this.max),Ky(t)!==this.min&&t.unshift(this.min)),t},e.prototype.getScalePercent=function(t){var r=this.ticks;if(tFp(r))return 1;var i=0;return At(r,function(a,o){if(t>=a)i=o;else return!1}),i/(r.length-1)},e}(LV),Gvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="quantile",t}return e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(mje),_je={};function zvr(n){return _je[n]}function km(n,e){if(zvr(n))throw new Error("type '"+n+"' existed.");_je[n]=e}var Uvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="identity",t.isIdentity=!0,t}return e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&on(t)?t:this.range[0]},e.prototype.invert=function(t){var r=this.range;return tr[1]?NaN:this.values[0]},e}(Jle);function xje(n){var e=n.values,t=n.tickInterval,r=n.tickCount,i=n.showLast;if(on(t)){var a=RU(e,function(v,p){return p%t===0}),o=Fp(e);return i&&Fp(a)!==o&&a.push(o),a}var s=e.length,l=n.min,u=n.max;if(an(l)&&(l=0),an(u)&&(u=e.length-1),!on(r)||r>=s)return e.slice(l,u+1);if(r<=0||u<=0)return[];for(var h=r===1?s:Math.floor(s/(r-1)),c=[],f=l,d=0;d=u);d++)f=Math.min(l+d*h,u),d===r-1&&i?c.push(e[u]):c.push(e[f]);return c}function Vvr(n){var e=n.min,t=n.max,r=n.nice,i=n.tickCount,a=new $vr;return a.domain([e,t]),r&&a.nice(i),a.ticks(i)}var DY=5,u2e=Math.sqrt(50),h2e=Math.sqrt(10),c2e=Math.sqrt(2),$vr=function(){function n(){this._domain=[0,1]}return n.prototype.domain=function(e){return e?(this._domain=Array.from(e,Number),this):this._domain.slice()},n.prototype.nice=function(e){var t,r;e===void 0&&(e=DY);var i=this._domain.slice(),a=0,o=this._domain.length-1,s=this._domain[a],l=this._domain[o],u;return l0?(s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u,u=l8(s,l,e)):u<0&&(s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u,u=l8(s,l,e)),u>0?(i[a]=Math.floor(s/u)*u,i[o]=Math.ceil(l/u)*u,this.domain(i)):u<0&&(i[a]=Math.ceil(s*u)/u,i[o]=Math.floor(l*u)/u,this.domain(i)),this},n.prototype.ticks=function(e){return e===void 0&&(e=DY),Wvr(this._domain[0],this._domain[this._domain.length-1],e||DY)},n}();function Wvr(n,e,t){var r,i=-1,a,o,s;if(e=+e,n=+n,t=+t,n===e&&t>0)return[n];if((r=e0)for(n=Math.ceil(n/s),e=Math.floor(e/s),o=new Array(a=Math.ceil(e-n+1));++i=0?(a>=u2e?10:a>=h2e?5:a>=c2e?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=u2e?10:a>=h2e?5:a>=c2e?2:1)}function f2e(n,e,t){var r;return t==="ceil"?r=Math.ceil(n/e):t==="floor"?r=Math.floor(n/e):r=Math.round(n/e),r*e}function eue(n,e,t){var r=f2e(n,t,"floor"),i=f2e(e,t,"ceil");r=BB(r,t),i=BB(i,t);for(var a=[],o=Math.max((i-r)/(Math.pow(2,12)-1),t),s=r;s<=i;s=s+o){var l=BB(s,o);a.push(l)}return{min:r,max:i,ticks:a}}function tue(n,e,t){var r,i=n.minLimit,a=n.maxLimit,o=n.min,s=n.max,l=n.tickCount,u=l===void 0?5:l,h=an(i)?an(e)?o:e:i,c=an(a)?an(t)?s:t:a;if(h>c&&(r=[h,c],c=r[0],h=r[1]),u<=2)return[h,c];for(var f=(c-h)/(u-1),d=[],v=0;v=0&&(l=1),1-s/(o-1)-t+l}function Zvr(n,e,t){var r=kU(e),i=Noe(e,n),a=1;return 1-i/(r-1)-t+a}function Kvr(n,e,t,r,i,a){var o=(n-1)/(a-i),s=(e-1)/(Math.max(a,r)-Math.min(t,i));return 2-Math.max(o/s,s/o)}function Jvr(n,e){return n>=e?2-(n-1)/(e-1):1}function Qvr(n,e,t,r){var i=e-n;return 1-.5*(Math.pow(e-r,2)+Math.pow(n-t,2))/Math.pow(.1*i,2)}function epr(n,e,t){var r=e-n;if(t>r){var i=(t-r)/2;return 1-Math.pow(i,2)/Math.pow(.1*r,2)}return 1}function tpr(){return 1}function rpr(n,e,t,r,i,a){t===void 0&&(t=5),r===void 0&&(r=!0),i===void 0&&(i=jvr),a===void 0&&(a=[.25,.2,.5,.05]);var o=t<0?0:Math.round(t);if(Number.isNaN(n)||Number.isNaN(e)||typeof n!="number"||typeof e!="number"||!o)return{min:0,max:0,ticks:[]};if(e-n<1e-15||o===1)return{min:n,max:e,ticks:[n]};if(e-n>1e148){var s=t||5,l=(e-n)/s;return{min:n,max:e,ticks:Array(s).fill(null).map(function(q,Y){return Ub(n+l*Y)})}}for(var u={score:-2,lmin:0,lmax:0,lstep:0},h=1;h<1/0;){for(var c=0;cu.score&&(!r||E<=n&&T>=e)&&(u.lmin=E,u.lmax=T,u.lstep=C,u.score=k)}m+=1}v+=1}}h+=1}var D=Ub(u.lmax),G=Ub(u.lmin),W=Ub(u.lstep),z=Math.floor(Yvr((D-G)/W))+1,V=new Array(z);V[0]=Ub(G);for(var c=1;c0)o=Math.floor(dp(e,r));else{var l=yje(a,e,i);o=Math.floor(dp(e,l))}for(var u=s-o,h=Math.ceil(u/t),c=[],f=o;f=0?1:-1;return Math.pow(o,e)*s})}function opr(n,e){var t=n.length*e;return e===1?n[n.length-1]:e===0?n[0]:t%1!==0?n[Math.ceil(t)-1]:n.length%2===0?(n[t-1]+n[t])/2:n[t]}function spr(n){var e=n.tickCount,t=n.values;if(!t||!t.length)return[];for(var r=t.slice().sort(function(s,l){return s-l}),i=[],a=0;a1&&(i=i*Math.ceil(s)),r&&il2e)for(var l=Z9(t),u=Math.ceil(a/l2e),h=s;h<=l+u;h=h+u)o.push(cpr(h));else if(a>TR)for(var c=Math.ceil(a/TR),f=ute(e),d=fpr(e,t),h=0;h<=d+c;h=h+c)o.push(dpr(s,h+f));else if(a>N1)for(var v=new Date(e),p=v.getFullYear(),g=v.getMonth(),m=v.getDate(),y=Math.ceil(a/N1),_=vpr(e,t),h=0;h<_+y;h=h+y)o.push(new Date(p,g,m+h).getTime());else if(a>UE)for(var v=new Date(e),p=v.getFullYear(),g=v.getMonth(),y=v.getDate(),x=v.getHours(),S=Math.ceil(a/UE),w=ppr(e,t),h=0;h<=w+S;h=h+S)o.push(new Date(p,g,y,x+h).getTime());else if(a>zE)for(var b=gpr(e,t),E=Math.ceil(a/zE),h=0;h<=b+E;h=h+E)o.push(e+h*zE);else{var T=a;T=512&&console.warn("Notice: current ticks length("+o.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+a+") is too small, increase the value to solve the problem!"),o}Nm("cat",xje);Nm("time-cat",hpr);Nm("wilkinson-extended",npr);Nm("r-pretty",lpr);Nm("time",upr);Nm("time-pretty",ypr);Nm("log",ipr);Nm("pow",apr);Nm("quantile",spr);Nm("d3-linear",Hvr);km("cat",gk);km("category",gk);km("identity",Uvr);km("linear",yk);km("log",kvr);km("pow",Fvr);km("time",Bvr);km("timeCat",Dvr);km("quantize",mje);km("quantile",Gvr);var mpr=globalThis&&globalThis.__spreadArray||function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,a;rp?(w.show(),E.show(),p=T.minX+T.width+10):(w.hide(),E.hide()),w}),this.controllerBtnGroup=new ije(Cs({group:this.group,x:this.x,y:this.y+i+25,width:r,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),s.move(this.x,this.y),this.bindEvents(),this.currentMode===Cy.SINGLE&&(this.minHandlerShape.hide(),this.foregroundShape.hide(),this.minTextShape.hide())},n.prototype.bindEvents=function(){var e=this,t=this.group.find(function(i){return i.get("name")==="minHandlerShape"});t&&(t.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),t.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var r=this.group.find(function(i){return i.get("name")==="maxHandlerShape"});r&&(r.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),r.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("".concat(uS,":click"),function(){e.isPlay=!e.isPlay,e.currentHandler=e.maxHandlerShape,e.changePlayStatus()}),this.group.on("".concat(nN,":click"),function(){e.currentHandler=e.maxHandlerShape,e.updateStartEnd(.01),e.updateUI()}),this.group.on("".concat(iN,":click"),function(){e.currentHandler=e.maxHandlerShape,e.updateStartEnd(-.01),e.updateUI()}),this.group.on(GE,function(i){var a=i.type,o=i.speed;e.currentSpeed=o,e.currentMode=a,a===Cy.SINGLE?(e.minHandlerShape.hide(),e.foregroundShape.hide(),e.minTextShape.hide()):a===Cy.RANGE&&(e.minHandlerShape.show(),e.foregroundShape.show(),e.minTextShape.show())})},n.prototype.adjustTickIndex=function(e){for(var t=0;t1&&(this.start=1),this.end>1&&(this.end=1),this.end<0&&(this.end=0);var t=this.x+this.start*this.width,r=this.x+this.end*this.width;this.foregroundShape.attr("x",t),this.foregroundShape.attr("width",r-t);var i=y1(this.handlerStyle,"width",hte);this.setText(this.minText,this.maxText);var a=this.dodgeText([t,r]),o=a[0],s=a[1];this.minHandlerShape.setX(t-i/2),At(o,function(l,u){return e.minTextShape.attr(u,l)}),this.maxHandlerShape.setX(r-i/2),At(s,function(l,u){return e.maxTextShape.attr(u,l)}),this.currentMode===Cy.RANGE?this.graph.emit(Oy,{value:[this.start,this.end].sort()}):this.currentMode===Cy.SINGLE&&this.graph.emit(Oy,{value:[this.end,this.end]})},n.prototype.dodgeText=function(e){var t,r,i=2,a=y1(this.handlerStyle,"width",hte),o=this.minTextShape,s=this.maxTextShape,l=e[0],u=e[1],h=!1;l>u&&(t=[u,l],l=t[0],u=t[1],r=[s,o],o=r[0],s=r[1],h=!0);var c=o.getBBox(),f=s.getBBox(),d=null,v=null;return this.timeBarType==="trend"?(d=l-c.widththis.x+this.width?{x:u-a/2-i,textAlign:"right"}:{x:u+a/2+i,textAlign:"left"}):this.timeBarType==="simple"&&(d=o.attr("x")>c.width?{x:l,textAlign:"center"}:{x:l,textAlign:"left"},v=s.attr("x")>this.width-f.width?{x:u,textAlign:"right"}:{x:u,textAlign:"center"}),h?[v,d]:[d,v]},n.prototype.startPlay=function(){var e=this;return typeof window<"u"?window.requestAnimationFrame(function(){var t=e,r=t.ticks,i=t.width,a=e.currentSpeed,o=i/r.length,s=o/((10-a)*1e3/60),l=e.adjustOffsetRange(s/e.width);e.updateStartEnd(l),e.updateUI(),e.isPlay&&(e.playHandler=e.startPlay())}):void 0},n.prototype.changePlayStatus=function(e){e===void 0&&(e=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(eje,null)):this.playHandler&&(typeof window<"u"&&window.cancelAnimationFrame(this.playHandler),e&&this.graph.emit(tje,null))},n.prototype.destory=function(){this.graph.off(Oy,function(){});var e=this.group,t=e.find(function(i){return i.get("name")==="minHandlerShape"});t&&(t.off("minHandlerShape-handler:mousedown"),t.off("minHandlerShape-handler:touchstart"),t.destroy());var r=e.find(function(i){return i.get("name")==="maxHandlerShape"});r&&(r.off("maxHandlerShape-handler:mousedown"),r.off("maxHandlerShape-handler:touchstart"),r.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),e.off("".concat(uS,":click")),e.off("".concat(nN,":click")),e.off("".concat(iN,":click")),e.off(GE),e.destroy(),this.trendComponent&&this.trendComponent.destory()},n}();const $pr=Vpr;var Wpr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),m1=globalThis&&globalThis.__assign||function(){return m1=Object.assign||function(n){for(var e,t=1,r=arguments.length;t
    ")),Di(u,{position:"relative"})),o){var h=this.get("graph").get("container");h.appendChild(u)}this.set("timeBarContainer",u);var c,f=t.get("renderer");f==="SVG"?c=new yR({container:u,width:i,height:a}):c=new M1({container:u,width:i,height:a}),this.get("containerCSS")&&Di(u,this.get("containerCSS")),this.set("canvas",c)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas"),r=t.addGroup({name:"timebar-group"});this.set("timeBarGroup",r),this.renderTrend(),this.initEvent();var i=typeof window<"u"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",i)},e.prototype.play=function(){this.togglePlay(!0)},e.prototype.pause=function(){this.togglePlay(!1)},e.prototype.togglePlay=function(t){var r=this.get("timebar");!r||(r.isPlay=!!t,r.changePlayStatus())},e.prototype.renderTrend=function(){var t=this,r=this._cfgs,i=r.width,a=r.x,o=r.y,s=r.padding,l=r.type,u=r.trend,h=r.slider,c=r.controllerCfg,f=r.textStyle,d=r.tick,v=r.backgroundStyle,p=r.foregroundStyle,g=u.data,m=Hpr(u,["data"]),y=i-2*s,_=l==="trend"?Xpr:jpr,x=this.get("graph"),S=this.get("timeBarGroup"),w=this.get("canvas"),b=null;if(l==="trend"||l==="simple"){var E=this.get("getValue");b=new $pr(m1(m1({graph:x,canvas:w,group:S,type:l,x:a+s,y:l==="trend"?o+s:o+s+15,width:y,height:_,padding:s,backgroundStyle:v,foregroundStyle:p,trendCfg:m1(m1({},m),{data:g.map(function(C){return(E==null?void 0:E(C))||C.value})})},h),{tick:{ticks:g,tickLabelFormatter:d.tickLabelFormatter,tickLabelStyle:d.tickLabelStyle,tickLineStyle:d.tickLineStyle},handlerStyle:m1(m1({},h.handlerStyle),{height:h.height||_}),controllerCfg:c,textStyle:f}))}else l==="tick"&&(b=new bvr(m1({graph:x,canvas:w,group:S,x:a+s,y:o+s,width:i,height:42,padding:2,controllerCfg:c},d)));var T=function(){var A=t.get("timebar");A.draggingHandler=!1,A.isPlay&&(A.isPlay=!1,A.currentHandler=A.maxHandlerShape,A.changePlayStatus()),document.removeEventListener("mouseup",T)};w.on("mousedown",function(C){(C.target.get("name")==="maxHandlerShape-handler"||C.target.get("name")==="minHandlerShape-handler"||C.target===b.foregroundShape)&&document.addEventListener("mouseup",T)}),this.set("timebar",b)},e.prototype.filterData=function(t){var r,i=t.value;if(!i){i=[];var a=this._cfgs.type;!a||a==="trend"||a==="simple"?(i[0]=this._cfgs.slider.start,i[1]=this._cfgs.slider.end):a==="tick"&&(i[0]=this._cfgs.tick.start,i[1]=this._cfgs.tick.end)}var o=null,s=this._cfgs.type;if(s==="trend"||s==="simple"?o=this._cfgs.trend.data:s==="tick"&&(o=this._cfgs.tick.data),!o||o.length===0){console.warn("\u8BF7\u914D\u7F6E TimeBar \u7EC4\u4EF6\u7684\u6570\u636E");return}var l=this.get("rangeChange"),u=this.get("graph"),h=Math.round(o.length*i[0]),c=Math.round(o.length*i[1]);c=c>=o.length?o.length-1:c,h=h>=o.length?o.length-1:h;var f=(r=this._cfgs.tick)===null||r===void 0?void 0:r.tickLabelFormatter,d=f?f(o[h]):o[h].date,v=f?f(o[c]):o[c].date;if(s!=="tick"){var p=this.get("timebar");p.setText(d,v)}if(l)l(u,d,v);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&this.cacheGraphData.nodes.length===0)&&(this.cacheGraphData=u.get("data"));var g=this.get("filterItemTypes"),m=this.get("changeData"),y=this.get("getDate"),_=this.get("shouldIgnore"),x=o[h].date,S=o[c].date;if(m||m===void 0){var w=this.cacheGraphData.nodes,b=this.cacheGraphData.edges,E={},T={};u.getNodes().forEach(function(C){return E[C.getID()]=!0}),u.getEdges().forEach(function(C){return T[C.getID()]=!0}),g.includes("node")&&(w==null||w.forEach(function(C){var A=+((y==null?void 0:y(C))||C.date),M=A>=x&&A<=S||(_==null?void 0:_("node",C,{min:x,max:S})),I=E[C.id];I&&!M?(u.removeItem(C.id),E[C.id]=!1):!I&&M&&(u.addItem("node",C),E[C.id]=!0)}),b==null||b.forEach(function(C){var A=E[C.source]&&E[C.target]||(_==null?void 0:_("edge",C,{min:x,max:S})),M=!!u.findById(C.id);M&&!A?(u.removeItem(C.id),T[C.id]=!1):!M&&A?(u.addItem("edge",C),T[C.id]=!0):M||(T[C.id]=!1)})),(this.get("filterEdge")||g.includes("edge"))&&(b==null||b.filter(function(C){var A=+((y==null?void 0:y(C))||C.date),M=A>=x&&A<=S||(_==null?void 0:_("edge",C,{min:x,max:S})),I=E[C.source]&&E[C.target],R=M&&I,k=T[C.id];k&&!R?(T[C.id]=!1,u.removeItem(C.id)):!k&&R&&(T[C.id]=!0,u.addItem("edge",C))}))}else g.includes("node")&&u.getNodes().forEach(function(C){var A=C.getModel();if(!(_!=null&&_("node",A,{min:x,max:S}))){var M=+((y==null?void 0:y(A))||A.date);MS?u.hideItem(C):u.showItem(C)}}),(this.get("filterEdge")||g.includes("edge"))&&u.getEdges().forEach(function(C){var A=C.getModel();if(!(_!=null&&_("edge",A,{min:o[h].date,max:o[c].date}))){var M=+((y==null?void 0:y(A))||A.date);if(Mo[c].date)u.hideItem(C);else{var I=C.getSource().isVisible(),R=C.getTarget().isVisible();I&&R&&u.showItem(C)}}})}},e.prototype.initEvent=function(){var t=this.get("graph");t.on("afterchangedata",this.changeData),t.on("afterrender",this.afterrenderListener),t.on(Oy,this.valueChangeListener)},e.prototype.destroy=function(){var t=this.get("graph");t.off("afterchangedata",this.changeData),t.off("afterrender",this.afterrenderListener),t.off(Oy,this.valueChangeListener);var r=this.get("timebar");r&&r.destory&&r.destory(),n.prototype.destroy.call(this);var i=this.get("timeBarContainer");if(i){var a=this.get("container");a||(a=this.get("graph").get("container")),rr(a)&&(a=document.getElementById(a)),a===i&&(a=a.parentElement),a.removeChild(i)}},e}(zd);const qpr=Ypr;var Zpr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Kpr=gc.applyMatrix;function Jpr(n,e){var t,r;if(n.naturalWidth)t=n.naturalWidth,r=n.naturalHeight;else{var i=new Image;i.src=n.src,i.onload=function(){e&&e(i.width,i.height)}}return[t,r]}var Qpr=function(n){Zpr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,r=this._cfgs,i=r.graph;if(!this.destroyed){var a=this.get("container");rr(a)&&(a=document.getElementById(a));var o=zs("
    y||d>_||(p=i.getZoom(),v=t.get("ratio"),u=!0,s=g.clientX,l=g.clientY)}},!1),a.addEventListener("mousemove",function(g){if(!(!u||an(g.clientX)||an(g.clientY))){var m=t.get("width"),y=t.get("height"),_=o.style;h=parseInt(_.left,10),c=parseInt(_.top,10),f=parseInt(_.width,10),d=parseInt(_.height,10);var x=s-g.clientX,S=l-g.clientY;h-x<0?x=h:h-x+f>=m&&(x=0),c-S<0?S=c:c-S+d>=y&&(S=0),h-=x,c-=S,Di(o,{left:"".concat(h,"px"),top:"".concat(c,"px")}),i.translate(x*p/v,S*p/v),s=g.clientX,l=g.clientY}},!1),a.addEventListener("mouseleave",function(){u=!1,r.refresh=!0},!1),a.addEventListener("mouseup",function(){u=!1,r.refresh=!0},!1),this.set("viewport",o),a.appendChild(o)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),r=this.get("width"),i=this.get("height"),a=this.get("graph"),o=a.get("width"),s=a.get("height"),l=o/s,u=a.getGroup(),h=u.getCanvasBBox(),c=[(h.minX+h.maxX)/2,(h.minY+h.maxY)/2],f=[h.maxX-h.minX,h.maxY-h.minY],d={centerX:c[0],centerY:c[1],width:0,height:0,minX:0,minY:0};h[0]/h[1]>l?(d.width=f[0],d.height=d.width/l):(d.height=f[1],d.width=d.height*l),d.minX=c[0]-d.width/2,d.minY=c[1]-d.height/2;var v=u.getMatrix();v||(v=[1,0,0,0,1,0,0,0,1]);var p=Foe([1,0,0,0,1,0,0,0,1],v),g=Kpr({x:d.minX,y:d.minY},p),m=a.getCanvasByPoint(g.x,g.y),y=this.get("viewport");y||this.initViewport();var _=o/d.width,x=_*r,S=_*i,w=r*-m.x/d.width,b=i*-m.y/d.height,E=w+x,T=b+S;w<0&&(x+=w,w=0),E>r&&(x=x-(E-r)),b<0&&(S+=b,b=0),T>i&&(S=S-(T-i)),this.set("ratio",t);var C="".concat(w,"px"),A="".concat(b,"px");Di(y,{left:C,top:A,width:"".concat(x,"px"),height:"".concat(S,"px")})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this,r=t.get("graph"),i=r.get("width"),a=r.get("height"),o=a/i,s=t.get("className"),l=t.get("container"),u=t.get("width"),h=t.get("height");!u&&!h&&(u=200),u?(h=o*u,t.set("height",h)):(u=1/o*h,t.set("width",u));var c=zs("
    "));rr(l)&&(l=document.getElementById(l)),l?l.appendChild(c):r.get("container").appendChild(c),t.set("container",c);var f=zs('
    ');c.appendChild(f);var d=zs('');f.appendChild(d),t.set("containerDOM",f),t.set("containerSpan",d);var v=zs(''));t.set("imgDOM",v),t.updateImgSize(),d.appendChild(v),t.updateCanvas()},e.prototype.updateImgSize=function(){var t=this,r=t.get("imgDOM"),i=t.get("width"),a=t.get("height");r.onload=function(){var o=Jpr(r);o[0]>o[1]?r.width=i:r.height=a}},e.prototype.updateCanvas=function(){var t=this.get("refresh");if(!!t){var r=this.get("graph");if(!r.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var i=this.get("width"),a=r.get("canvas").getCanvasBBox(),o=a.width,s=i/o;this.set("ratio",s),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){var r=this,i=r.get("imgDOM");i.remove(),r.set("graphImg",t);var a=zs(''));r.set("imgDOM",a),a.src=t,r.updateImgSize();var o=r.get("containerSpan");o.appendChild(a),r.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(zd);const egr=Qpr;var tgr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),cte=globalThis&&globalThis.__assign||function(){return cte=Object.assign||function(n){for(var e,t=1,r=arguments.length;t(l||i.get("height"))&&a>1||h<(u||i.get("height")*.05)&&a<1)&&(a=1),h*=a,r.set("r",h),r.filter(t)}},e.prototype.filter=function(t){var r=this,i=r.get("graph"),a=i.getNodes(),o={},s=r.get("r"),l=r.get("type"),u={x:t.x,y:t.y};r.updateDelegate(u,s);var h=r.get("shouldShow"),c=r.get("vShapes");c&&c.forEach(function(m){m.remove(),m.destroy()}),c=[],a.forEach(function(m){var y=m.getModel(),_=y.x,x=y.y;rgr({x:_,y:x},u)
    `);s.appendChild(l),this.set("container",l);var u=this.render();Di(l,this.getContainerPos(u)),this.bindEvents()},e.prototype.getContainerPos=function(t){t===void 0&&(t=[0,0]);var r=this,i=r.get("graph"),a=this.get("offsetX"),o=this.get("offsetY"),s=this.get("margin"),l=this.get("position").split("-"),u={top:0,right:1,bottom:2,left:3},h=0,c=0,f={left:(i.getWidth()-t[0])/2+h,top:(i.getHeight()-t[1])/2+c};return l.forEach(function(d){var v=s[u[d]],p=d;switch(d){case"top":v+=c;break;case"left":v+=h;break;case"bottom":v=i.getHeight()-t[1]-v+c,p="top";break;default:v=i.getWidth()-t[0]-v+h,p="left";break}f[p]=v}),f.top+=o+i.getContainer().offsetTop,f.left+=a+i.getContainer().offsetLeft,Object.keys(f).forEach(function(d){f[d]="".concat(f[d],"px")}),f},e.prototype.bindEvents=function(){var t=this,r=t.get("filter");if(!(!r||!r.enable)){var i=r.trigger||"click";cgr.includes(i)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),i="click");var a=t.get("legendCanvas");i==="mouseenter"?(a.on("node-container:mouseenter",function(o){return t.filterData(o)}),a.on("node-container:mouseleave",function(o){t.clearFilter(),t.clearActiveLegend()})):(a.on("node-container:click",function(o){return t.filterData(o)}),a.on("click",function(o){o.target&&o.target.isCanvas&&o.target.isCanvas()&&(t.clearFilter(),t.clearActiveLegend())}))}},e.prototype.changeData=function(t){this.set("data",t);var r=this.render();Di(this.get("container"),this.getContainerPos(r))},e.prototype.activateLegend=function(t){var r=this.get("filter"),i=r==null?void 0:r.multiple;i||this.clearActiveLegend();var a=t.get("parent");a.get("active")?(a.set("active",!1),this.findLegendItemsByState("active").length&&a.set("inactive",!0)):(a.set("inactive",!1),a.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach(function(c){c.set("inactive",!0)}):this.clearActiveLegend();var o=(r==null?void 0:r.legendStateStyles)||{},s=(o==null?void 0:o.inactive)||{opacity:.5,"text-shape":{opacity:.5}},l=s["text-shape"]||{};this.findLegendItemsByState("inactive").forEach(function(c){var f=c.get("children"),d=f[0],v=f[1];d.attr(ll(ll({},d.get("oriAttrs")),s)),v.attr(ll(ll({},v.get("oriAttrs")),l))});var u=(o==null?void 0:o.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},h=u["text-shape"]||{};this.findLegendItemsByState("active").forEach(function(c){var f=c.get("children"),d=f[0],v=f[1];d.attr(ll(ll({},d.get("oriAttrs")),u)),v.attr(ll(ll({},v.get("oriAttrs")),h))})},e.prototype.findLegendItemsByState=function(t,r,i){r===void 0&&(r="all"),i===void 0&&(i=!0);var a=this.get("legendCanvas").find(function(l){return l.get("name")==="root"}),o=a.find(function(l){return l.get("name")==="node-group"}),s=a.find(function(l){return l.get("name")==="edge-group"});return r==="node"?o.get("children").filter(function(l){return!!l.get(t)===i}):r==="edge"?s.get("children").filter(function(l){return!!l.get(t)===i}):o.get("children").filter(function(l){return!!l.get(t)===i}).concat(s.get("children").filter(function(l){return!!l.get(t)===i}))},e.prototype.clearActiveLegend=function(){var t=this.get("legendCanvas"),r=t.find(function(a){return a.get("name")==="root"}),i=[r.find(function(a){return a.get("name")==="node-group"}),r.find(function(a){return a.get("name")==="edge-group"})];i.forEach(function(a){a.get("children").forEach(function(o){o.set("active",!1),o.set("inactive",!1);var s=o.get("children"),l=s[0],u=s[1];l.attr(l.get("oriAttrs")),u.attr(u.get("oriAttrs"))})})},e.prototype.filterData=function(t){var r=this.get("filter"),i=r==null?void 0:r.filterFunctions;if(!(!r||!i)){var a=this.get("legendCanvas"),o=this.get("graph"),s=r.graphActiveState||"active",l=r.graphInactiveState||"inactive",u=r.multiple;this.clearFilter(),u||this.clearActiveLegend(),this.activateLegend(t.target);var h=a.find(function(m){return m.get("name")==="root"}),c=h.find(function(m){return m.get("name")==="node-group"}),f=h.find(function(m){return m.get("name")==="edge-group"}),d=c.get("children").filter(function(m){return m.get("active")}),v=f.get("children").filter(function(m){return m.get("active")}),p=0,g=["getNodes","getEdges"];g.forEach(function(m){o[m]().forEach(function(y){var _=!1,x=m==="getNodes"?d:v;x.forEach(function(S){var w=i[S.get("id")];_=_||w(y.getModel())}),_?(o.setItemState(y,l,!1),o.setItemState(y,s,!0),p++):(o.setItemState(y,s,!1),o.setItemState(y,l,!0))})}),p||g.forEach(function(m){o[m]().forEach(function(y){o.clearItemStates(y,[l])})})}},e.prototype.clearFilter=function(){var t=this.get("graph"),r=this.get("filter");if(!!r){var i=r.graphActiveState||"active",a=r.graphInactiveState||"inactive";t.getNodes().forEach(function(o){t.clearItemStates(o,[i,a])}),t.getEdges().forEach(function(o){t.clearItemStates(o,[i,a])})}},e.prototype.render=function(){var t=this;this.processData();var r=this.get("legendCanvas");r?r.clear():r=new M1({container:this.get("container"),width:200,height:200});var i=r.addGroup({name:"root"}),a=i.addGroup({name:"node-group"}),o=i.addGroup({name:"edge-group"});this.set("legendCanvas",r);var s=this.get("itemsData"),l=["nodes","edges"],u=[a,o];l.forEach(function(D,G){s[D].forEach(function(W){var z,V=u[G].addGroup({id:W.id,name:"node-container"}),q,Y=W.type,le=t.getShapeSize(W),j=le.width,Q=le.height,ie=le.r,oe=t.getStyle(D.substr(0,4),W);switch(W.type){case"circle":q={r:ie,x:0,y:0};break;case"rect":q={width:j,height:Q,x:-j/2,y:-Q/2};break;case"ellipse":q={rx:j,ry:Q,x:0,y:0},Y="ellipse";break;case"line":q={x1:-j/2,y1:0,x2:j/2,y2:0},Y="line";break;case"quadratic":q={path:[["M",-j/2,0],["Q",0,j/2,j/2,0]]},Y="path";break;case"cubic":q={path:[["M",-j/2,0],["C",-j/6,j/2,j/6,-j/2,j/2,0]]},Y="path";break;case"diamond":q={path:[["M",0,-Q],["L",j,0],["L",0,Q],["L",-j,0],["Z"]]},Y="path";break;case"triangle":q={path:[["M",-j,Q],["L",0,-Q],["L",j,Q],["Z"]]},Y="path";break;case"star":q={path:gc.getStarPath(ie*3,ie*1.2)},Y="path";break;default:q={r:ie,x:0,y:0};break}var se=V.addShape(Y,{attrs:ll(ll({},q),oe),name:"".concat(W.type,"-node-keyShape"),oriAttrs:ll({opacity:1},oe)});if(W.label){var me=se.getBBox(),Ce=((z=W.labelCfg)===null||z===void 0?void 0:z.style)||{},Le=ll({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},Ce);V.addShape("text",{attrs:ll({x:me.maxX+4,y:0,text:W.label},Le),className:"legend-label",name:"".concat(W.type,"-node-text"),oriAttrs:Le})}})});var h=this.get("padding"),c,f=i.find(function(D){return D.get("name")==="title-container"}),d={height:0,maxY:0,width:0};if(this.get("title")){f||(f=i.addGroup({name:"title-container"}));var v={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:h[0]},p=this.get("titleConfig")||{},g=Object.assign(v,p.style||{});c=f.addShape("text",{attrs:ll({text:this.get("title")},g)}),d=f.getCanvasBBox(),f.setMatrix([1,0,0,0,1,0,p.offsetX,p.offsetY,1])}this.layoutItems();var m=i.getCanvasBBox(),y=a.getCanvasBBox(),_=y.minX<0?Math.abs(y.minX)+h[3]:h[3],x=d.maxYc.max&&(c.max=s[0]),_.setMatrix([1,0,0,0,1,0,C,A,1])});var f=c.max-c.min,d={min:0,max:-1/0},v=u.getCanvasBBox();s[0]=0,s[1]=a==="vertical"?v.maxX+r:v.maxY+i,h.get("children").forEach(function(_,x){x===0&&(d.min=s[0]);var S=_.get("children")[0],w=_.getCanvasBBox(),b=S.getBBox(),E=b.width,T=b.height,C=0,A=0;a==="vertical"?(C=s[1],A=s[0],s[0]=A+w.height+i,_.setMatrix([1,0,0,0,1,0,0,A+T/2,1])):(C=s[0],A=s[1],s[0]=C+w.width+r,_.setMatrix([1,0,0,0,1,0,C+E/2,0,1])),s[0]>d.max&&(d.max=s[0])});var p=d.max-d.min;if(o&&o!==""&&o!=="left"){var g=f-p,m=o==="center"?Math.abs(g)/2:Math.abs(g),y=g<0?u:h;y.get("children").forEach(function(_){var x=_.getMatrix()||[1,0,0,0,1,0,0,0,1];a==="vertical"?x[7]+=m:x[6]+=m,_.setMatrix(x)})}},e.prototype.processData=function(){var t=this.get("data"),r={nodes:[],edges:[]};t.nodes&&(t.nodes.sort(function(i,a){return i.order-a.order}),t.nodes.forEach(function(i){var a,o,s,l,u,h=i.size||[((a=i.style)===null||a===void 0?void 0:a.width)||((o=i.style)===null||o===void 0?void 0:o.r)||8,((s=i.style)===null||s===void 0?void 0:s.height)||((l=i.style)===null||l===void 0?void 0:l.r)||8],c=((u=i.labelCfg)===null||u===void 0?void 0:u.style)||{};r.nodes.push({id:i.id||vm(),type:i.type||"circle",style:ll({},i.style),order:i.order,label:i.label,itemType:"node",size:h,labelCfg:{position:"right",style:ll({fontFamily:"Arial"},c)}})})),t.edges&&(t.edges.sort(function(i,a){return i.order-a.order}),t.edges.forEach(function(i){var a,o,s=i.type||"line";i.type==="cubic-horizontal"&&(s="cubic");var l=((a=i.labelCfg)===null||a===void 0?void 0:a.style)||{},u=i.size||[((o=i.style)===null||o===void 0?void 0:o.width)||8,1];r.edges.push({id:i.id||vm(),type:s,size:u,style:ll({lineWidth:vn(u)?u[1]:1},i.style),order:i.order,label:i.label,itemType:"edge",labelCfg:{position:"right",style:ll({fontFamily:"Arial"},l)}})})),this.set("itemsData",r)},e.prototype.getContainer=function(){return this.get("container")},e.prototype.formatArray=function(t){var r=this.get(t);if(on(r))this.set(t,[r,r,r,r]);else if(vn(r))switch(r.length){case 0:this.set(t,[0,0,0,0]);break;case 1:this.set(t,[r[0],r[0],r[0],r[0]]);break;case 2:this.set(t,[r[0],r[1],r[0],r[1]]);break;case 3:this.set(t,[r[0],r[1],r[2],r[1]]);break}return this.get(t)},e.prototype.getShapeSize=function(t){var r,i,a;return t.size&&(vn(t.size)?(r=t.size[0],i=t.size[1]||t.size[0],a=t.size[0]/2):on(t.size)&&(r=t.size,i=t.size,a=t.size/2)),t.style&&(t.style.width&&(r=t.style.width),t.style.height&&(i=t.style.height),t.style.r&&(a=t.style.r)),a||(a=5),r||(r=a),i||(i=a),{width:r,height:i,r:a}},e.prototype.getStyle=function(t,r){var i=t==="node"?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1};return ll(ll({},i),r.style||{})},e.prototype.destroy=function(){var t=this.get("legendCanvas");t==null||t.destroy();var r=this.get("graph"),i=r.get("container"),a=this.get("container");i.removeChild(a)},e}(zd);const dgr=fgr;var vgr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ip=globalThis&&globalThis.__assign||function(){return ip=Object.assign||function(n){for(var e,t=1,r=arguments.length;t+

    ":"

    -

    ",f=r?"":"

    ".concat(l,"

    "),d="

    x

    ",v=r?"".concat(h,"px"):"".concat(h,"px ").concat(h,"px 0 0");return'

    `).concat(o,`

    `).concat(c,` `).concat(d,`
    `).concat(f,`
    `)}},e.prototype.init=function(){var t=this;if(!t.destroyed){var r=t.get("graph"),i=r.getContainer(),a=t.get("container"),o=this.get("containerCfg");o?(a=this.createContainer(),i.appendChild(a)):a=i,this.set("container",a);var s=i.getBoundingClientRect(),l=new M1({container:i,width:s.right-s.left,height:s.bottom-s.top});Di(l.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",U3(function(){return t.resizeCanvas(t)},100));var u=l.addGroup({id:"annotation-link-group"});t.set("linkGroup",u),t.set("canvas",l),t.get("getTitle")||t.set("getTitle",function(c){var f,d=((f=c==null?void 0:c.getModel)===null||f===void 0?void 0:f.call(c))||{},v=d.label,p=d.id;return v||p||"-"}),t.get("getContent")||t.set("getContent",function(c){var f,d;if(!c)return"-";var v=((f=c.getModel)===null||f===void 0?void 0:f.call(c))||{},p=v.label,g=v.id,m=(d=c.getType)===null||d===void 0?void 0:d.call(c),y=m?"".concat(m,": "):"";return"".concat(y).concat(p||g||"")});var h=t.get("defaultData");h&&this.readData(h)}},e.prototype.createContainer=function(){var t=this;if(!this.destroyed){var r=this.get("containerCfg"),i=this.get("graph"),a=i.getContainer(),o=a.getBoundingClientRect(),s=o.left,l=o.right,u=o.top,h=o.bottom,c=h-u,f=l-s,d=r.position,v=d===void 0?"top":d,p=r.offsetX,g=p===void 0?0:p,m=r.offsetY,y=m===void 0?0:m,_=y2e(r,["position","offsetX","offsetY"]),x=r.height,S=x===void 0?"fit-content":x,w=r.width,b=w===void 0?i.getWidth():w;S==="100%"&&(S=c),b==="100%"&&(b=f);var E="unset",T="unset",C={};switch(v){case"right":E="".concat(c,"px"),C={top:0,right:0},C.right+=s+g,C.top+=u+y;break;case"bottom":T="".concat(f,"px"),C={bottom:0,left:0},C.left+=s+g,C.bottom+=u+y;break;case"top":T="".concat(f,"px");case"left":E="".concat(c,"px");default:C={top:0,left:0},C.left+=s+g,C.top+=u+y;break}Object.keys(C).forEach(function(M){C[M]="".concat(C[M],"px")});var A=zs("
    "));return Di(A,ip(ip({position:"absolute",display:v==="top"||v==="bottom"?"inline-flex":"unset",width:on(b)?"".concat(b,"px"):b,height:on(S)?"".concat(S,"px"):S,maxHeight:E,maxWidth:T,overflow:"scroll"},C),_)),a.appendChild(A),A.addEventListener("scroll",function(M){t.updateLinks()}),A}},e.prototype.resizeCanvas=function(t){clearTimeout(t.resizeTimer),t.resizeTimer=setTimeout(function(){if(!(!t||t.destroyed)){var r=t.get("container").getBoundingClientRect(),i=r.right-r.left,a=r.bottom-r.top;t.get("canvas").changeSize(i,a),t.updateOutsideCards(t)}},250)},e.prototype.updateOutsideCards=function(t){var r=t||this,i=r.get("cardInfoMap")||{},a=r.get("graph"),o=a.getPointByCanvas(0,0),s=a.getPointByCanvas(a.getWidth(),a.getHeight()),l=a.getClientByPoint(o.x,o.y),u=l.x,h=l.y,c=a.getClientByPoint(s.x,s.y),f=c.x,d=c.y;Object.values(i).forEach(function(v){var p=v.card;if(!!p){var g=p.style,m=mb(g.left),y=mb(g.top),_=p.getBoundingClientRect(),x=_.width,S=_.height,w=m,b=y;m+x>f-u&&(w=f-u-x),m<0&&(w=0),y+S>d-h&&(b=d-h-S),y<0&&(b=0),Di(p,{left:"".concat(w,"px"),top:"".concat(b,"px")})}}),r.updateLinks()},e.prototype.showAnnotation=function(t){if(!this.destroyed){var r=t.item;this.toggleAnnotation(r)}},e.prototype.hideCards=function(){var t=this;if(!t.destroyed){var r=t.get("cardInfoMap")||{};Object.keys(r).forEach(function(i){t.hideCard(i)})}},e.prototype.toggleAnnotation=function(t,r){var i,a;r===void 0&&(r={});var o=this;if(!o.destroyed){var s=o.get("cardInfoMap")||{},l=o.get("graph"),u=o.get("container"),h=o.get("containerCfg"),c=Object.assign({},o.get("cardCfg")||{},r),f=c.minHeight,d=c.minWidth,v=c.width,p=c.height,g=c.collapsed,m=g===void 0?!1:g,y=c.x,_=c.y,x=c.title,S=c.content,w=c.maxTitleLength,b=c.defaultBegin,E=y2e(c,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),T=o.get("linkGroup"),C=this.get("rows")||[[]],A=(i=t.isCanvas)===null||i===void 0?void 0:i.call(t),M=A?m2e:t.getID(),I=s[M]||{},R=I.card,k=I.link,D=I.x,G=I.y,W=I.title,z=I.content,V=this.get("getTitle"),q=this.get("getContent"),Y=this.get("getContentPlaceholder")||function(){return""},le=this.get("getTitlePlaceHolder")||function(){return""},j=Y(t),Q=le(t),ie=zs(this.getDOMContent(ip({itemId:M,collapsed:m,title:((a=W||x||(V==null?void 0:V(t)))===null||a===void 0?void 0:a.substr(0,w))||Q,content:z||S||(q==null?void 0:q(t))||j},E))),oe=on(f)?"".concat(f,"px"):f;Di(ie,{minHeight:m?"unset":oe,minWidth:on(d)?"".concat(d,"px"):d,height:p,width:v});var se=!!R;se?(k==null||k.remove(!0),u.replaceChild(ie,R)):u.appendChild(ie);var me;if(!h){if(me=u.getBoundingClientRect()||{},y!==void 0&&_!==void 0)D=y,G=_;else if(!se&&!A){var Ce=me.top,Le=b||{},re=Le.left,yt=Le.right,je=yt===void 0?16:yt,st=Le.top,Nt=st===void 0?8:st,Zt=Le.bottom,qe=je,ur=Nt;isNaN(re)||(qe=u.scrollWidth-re),isNaN(Zt)||(ur=u.scrollHeight-Zt);var Dt=on(d)?d:100;D=u.scrollWidth-ie.scrollWidth-(C.length-1)*Dt-qe;var ft=C[C.length-1],Oe=(ft[ft.length-1]||{}).bbox;G=(Oe==null?void 0:Oe.bottom)-Ce||ur}Di(ie,{position:"absolute",left:"".concat(D,"px"),top:"".concat(G,"px"),cusor:h?"unset":"move"})}this.bindListener(ie,M);var J=ie.getBoundingClientRect();if(!A){var We=NY(t,J,l,this.get("canvas")),Tt=this.get("linkStyle");k=T.addShape("path",{attrs:ip({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:We},Tt)})}if(s[M]=ip(ip({},s[M]||{}),{id:M,collapsed:m,card:ie,link:k,x:D,y:G,cardBBox:J,content:z||S,title:W||x,contentPlaceholder:j,titlePlaceholder:Q,isCanvas:A}),o.set("cardInfoMap",s),h)this.updateCardPositionsInConatainer(),this.updateLinks();else{var Qe=!isNaN(y)&&!isNaN(_);if(!se&&!A&&!Qe){var zt=me.bottom,mt=zt===void 0?0:zt,Ce=me.top;C[C.length-1].push({id:M,bbox:J}),J.top>mt-Ce-J.height-16&&C.push([]),this.set("rows",C)}}this.updateCardSize(M);var wt=this.get("onAnnotationChange");wt==null||wt(s[M],se?"update":"create")}},e.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var t=this.get("cardInfoMap");if(!!t){var r=this.get("container"),i=this.get("containerCfg").position,a=r.getBoundingClientRect().width,o=getComputedStyle(r),s=mb(o.paddingLeft)+mb(o.paddingRight);a-=s,Object.values(t).forEach(function(l){var u=l.card,h=u.getBoundingClientRect().width;switch(i){case"right":Di(u,{marginLeft:a?"".concat(a-h,"px"):"0px"});break;case"top":case"bottom":Di(u,{marginLeft:"8px"})}})}}},e.prototype.handleExpandCollapseCard=function(t){if(!this.destroyed){var r=this.get("graph"),i=this.get("cardInfoMap");if(!!i){var a=i[t].collapsed,o=r.findById(t);if(!!o){var s=this.get("cardCfg").collapseType;s==="hide"&&!a?this.hideCard(t):this.toggleAnnotation(o,{collapsed:!a}),i[t]=ip(ip({},i[t]),{collapsed:!a})}}}},e.prototype.hideCard=function(t){if(!this.destroyed){var r=this.get("cardInfoMap");if(!(!r||!r[t])){var i=r[t],a=i.card,o=i.link;Di(a,{display:"none"}),o==null||o.hide();var s=this.get("onAnnotationChange");s(r[t],"hide")}}},e.prototype.removeCard=function(t){if(!this.destroyed){var r=this.get("cardInfoMap");if(!!r){var i=r[t],a=i.card,o=i.link,s=this.get("container");s.removeChild(a),o==null||o.remove(!0),delete r[t];var l=this.get("onAnnotationChange");l(i,"remove")}}},e.prototype.bindListener=function(t,r){var i=this;if(!this.destroyed){t.addEventListener("mousemove",function(l){var u;if(l.target.className==="g6-annotation-collapse"?u="collapse":l.target.className==="g6-annotation-expand"?u="expand":l.target.className==="g6-annotation-close"&&(u="close"),u){var h=i.get("cardCfg").onMouseEnterIcon,c=h===void 0?function(){}:h;c(l,r,u)}}),t.addEventListener("mouseout",function(l){var u;if(l.target.className==="g6-annotation-collapse"?u="collapse":l.target.className==="g6-annotation-expand"?u="expand":l.target.className==="g6-annotation-close"&&(u="close"),u){var h=i.get("cardCfg").onMouseLeaveIcon,c=h===void 0?function(){}:h;c(l,r,u)}}),t.addEventListener("mouseenter",function(l){var u=i.get("cardInfoMap");if(!!u){var h=i.get("graph"),c=h.findById(r);if(c){var f=i.get("itemHighlightState");h.setItemState(c,f,!0)}var d=u[r].link;if(d){var v=i.get("linkHighlightStyle")||{};d.attr(v)}}}),t.addEventListener("mouseleave",function(l){var u=i.get("cardInfoMap");if(!!u){var h=i.get("graph"),c=h.findById(r);if(c){var f=i.get("itemHighlightState");h.setItemState(c,f,!1)}var d=u[r].link;if(d){var v=i.get("linkHighlightStyle")||{};Object.keys(v).forEach(function(g){d.attr(g,void 0),d.attr(g,void 0)});var p=i.get("linkStyle");d.attr(p)}}}),t.addEventListener("click",function(l){var u=(i.get("cardCfg")||{}).onClickIcon;if(l.target.className==="g6-annotation-collapse"||l.target.className==="g6-annotation-expand"){var h=i.get("cardCfg").collapseType;h==="hide"?i.hideCard(r):i.handleExpandCollapseCard(r),u==null||u(l,r,l.target.className==="g6-annotation-collapse"?"collapse":"expand")}else if(l.target.className==="g6-annotation-close"){var c=i.get("cardCfg").closeType;c==="remove"?i.removeCard(r):i.hideCard(r),u==null||u(l,r,"close")}});var a=this.get("editable");a&&t.addEventListener("dblclick",function(l){var u=i.get("cardInfoMap"),h=(i.get("cardCfg")||{}).maxTitleLength,c=h===void 0?20:h;if(!!u){var f=l.target,d=f.className;if(!(d!=="g6-annotation-title"&&d!=="g6-annotation-content")){var v=d==="g6-annotation-title"?f.getBoundingClientRect():f.parentNode.getBoundingClientRect(),p=v.width,g=v.height,m=getComputedStyle(f),y=d==="g6-annotation-title"?"input":"textarea",_=zs("<".concat(y,' class="').concat(d,'-input" type="textarea" style="width:').concat(p,"px; height: ").concat(g,'px; min-width: 16px;"/>')),x=zs('
    '));x.appendChild(_),f.parentNode.replaceChild(x,f);var S=u[r],w=S.contentPlaceholder,b=S.titlePlaceholder,E=S.content,T=S.title,C=E;d==="g6-annotation-title"?(_.name="title",_.maxLength=c,C=T):_.name="content",C?(_.innerHTML=f.innerHTML,_.value=f.innerHTML):_.placeholder=d==="g6-annotation-title"?b:w,_.focus(),_.addEventListener("blur",function(A){_.value&&(f.innerHTML=_.value,S[_.name||"title"]=_.value),x.parentNode.replaceChild(f,x),i.updateCardSize(r);var M=i.get("onAnnotationChange");M==null||M(S,"update")})}}});var o=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];t.draggable=!0,t.addEventListener("dragstart",function(l){var u=l.target.className;if(!o.includes(u)){var h=t.style;i.set("dragging",{card:t,x:l.clientX,y:l.clientY,left:mb(h.left),top:mb(h.top)})}}),t.addEventListener("drag",function(l){l.preventDefault();var u=i.get("cardInfoMap");if(!!u){var h=l.clientX,c=l.clientY,f=i.get("dragging");if(!(isNaN(h)||isNaN(c)||!f)){var d=f.x,v=f.y,p=f.left,g=f.top,m=f.card,y=h-d,_=c-v;p+=y,g+=_;var x=i.get("graph"),S=x.getPointByCanvas(0,0),w=x.getPointByCanvas(x.getWidth(),x.getHeight()),b=x.getClientByPoint(S.x,S.y),E=b.x,T=b.y,C=x.getClientByPoint(w.x,w.y),A=C.x,M=C.y,I=m.getBoundingClientRect(),R=I.right-I.left,k=I.bottom-I.top;(p>A-E-R&&y>0||p<0&&y<0)&&(p-=y),(g>M-T-k&&_>0||g<0&&_<0)&&(g-=_),Di(m,{left:"".concat(p,"px"),top:"".concat(g,"px"),visibility:"hidden"}),d=h,v=c;var D=(u[r]||{}).link;if(D){var G=x.findById(r);D.attr("path",NY(G,I,x,i.get("canvas")))}i.set("dragging",{x:d,y:v,left:p,top:g,card:m})}}});var s=function(u){var h=i.get("cardInfoMap");if(!!h){var c=i.get("dragging");if(c){var f=c.left,d=c.top,v=c.card;h[r].x=f,h[r].y=d,Di(v,{visibility:"visible"}),i.set("dragging",!1);var p=i.get("rows");p==null||p.forEach(function(m){for(var y=m.length-1;y>=0;y--)m[y].id===r&&m.splice(y,1)});var g=i.get("onAnnotationChange");g==null||g(h[r],"update")}}};t.addEventListener("dragend",s)}},e.prototype.updateCardSize=function(t){var r=this.get("cardInfoMap");if(!!r){var i=r[t].card,a=i.getBoundingClientRect().width,o=i.getElementsByClassName("g6-annotation-title")[0];if(o){var s=getComputedStyle(o),l=mb(s.marginLeft),u=o.getBoundingClientRect().width;Di(o,{marginRight:"".concat(a-l-24-16-u,"px")})}}},e.prototype.updateLink=function(t){var r=t.item;if(!!r){var i=this.get("cardInfoMap");if(!!i){var a=this.get("canvas"),o=this.get("graph"),s=r.getID(),l=i[s]||{},u=l.link,h=l.card;if(u){var c=NY(r,h.getBoundingClientRect(),o,a);u.attr("path",c)}}}},e.prototype.updateLinks=function(){var t=this;if(!this.destroyed){var r=this.get("cardInfoMap");if(!!r){var i=this.get("graph");Object.values(r).forEach(function(a){var o=a.id,s=i.findById(o);t.updateLink({item:s})})}}},e.prototype.onGraphDataChange=function(){var t=this,r=this.get("cardInfoMap");if(!!r){var i=this.get("graph");Object.values(r).forEach(function(a){var o=a.id,s=a.card,l=a.isCanvas;if(!(!s||l||s.style.display==="none")){var u=i.findById(o);u&&u.isVisible()?t.toggleAnnotation(u):t.hideCard(o)}})}},e.prototype.onGraphItemVisibilityChange=function(t){var r=t.item,i=t.visible;if(!(!r||r.destroyed)){var a=this.get("cardInfoMap");if(!!a){var o=r.getID();!a[o]||i||this.hideCard(o)}}},e.prototype.saveData=function(t){t===void 0&&(t=!1);var r=this.get("cardInfoMap");if(!!r){var i=this.get("graph"),a=this.get("getTitle"),o=this.get("getContent"),s=[];return Object.values(r).forEach(function(l){var u=l.title,h=l.content,c=l.x,f=l.y,d=l.id,v=l.collapsed,p=l.card;if(!(p&&p.style.display==="none"&&!t)){var g=i.findById(d)||i.get("canvas");s.push({id:d,x:c,y:f,collapsed:v,title:u||(a==null?void 0:a(g)),content:h||(o==null?void 0:o(g)),visible:p&&p.style.display!=="none"})}}),s}},e.prototype.readData=function(t){var r=this,i=this.get("graph");t.forEach(function(a){var o=a.id,s=a.x,l=a.y,u=a.title,h=a.content,c=a.collapsed,f=a.visible,d=i.findById(o);if(!d&&o===m2e&&(d=i.get("canvas")),!d){var v=r.get("cardInfoMap")||{};v[o]=a,r.set("cardInfoMap",v);return}r.toggleAnnotation(d,{x:s,y:l,title:u,content:h,collapsed:c}),f||r.hideCard(o)})},e.prototype.clear=function(){var t=this.get("cardInfoMap");if(!!t){var r=this.get("container");Object.values(t).forEach(function(i){var a=i.card,o=i.link;r.removeChild(a),o==null||o.remove(!0)}),this.set("cardInfoMap",{})}},e.prototype.destroy=function(){var t;this.clear(),(t=this.get("canvas"))===null||t===void 0||t.destroy();var r=this.get("graph");!r||r.destroyed||(this.get("containerCfg")&&r.getContainer().removeChild(this.get("container")),this.destroyed=!0)},e}(zd);const ggr=pgr;var ygr=function(e,t){var r,i,a=1/0;Object.keys(e).forEach(function(l){var u=e[l];Object.keys(t).forEach(function(h){var c=t[h],f=u.x-c.x,d=u.y-c.y,v=f*f+d*d;a>v&&(a=v,r=u,i=c)})});var o=20,s=gc.getControlPoint(r,i,.5,o);return[["M",r.x,r.y],["Q",s.x,s.y,i.x,i.y]]},NY=function(e,t,r,i){var a,o,s=e.getType();if(s==="edge")o=[e.getKeyShape().getPoint(.5)];else{var l=(a=e.getKeyShape)===null||a===void 0?void 0:a.call(e).getBBox(),u=l.minX,h=l.minY,c=l.maxX,f=l.maxY,d=e.getModel(),v=d.x,p=d.y;u+=v,h+=p,c+=v,f+=p,o={left:{x:u,y:(h+f)/2},right:{x:c,y:(h+f)/2},top:{x:(u+c)/2,y:h},bottom:{x:(u+c)/2,y:f}}}Object.keys(o).forEach(function(T){var C=o[T],A=C.x,M=C.y,I=r.getClientByPoint(A,M);o[T]=i.getPointByClient(I.x,I.y)});var g=t.top,m=g===void 0?0:g,y=t.left,_=y===void 0?0:y,x=t.right,S=x===void 0?0:x,w=t.bottom,b=w===void 0?0:w,E={left:i.getPointByClient(_,(m+b)/2),right:i.getPointByClient(S,(m+b)/2),top:i.getPointByClient((_+S)/2,m),bottom:i.getPointByClient((_+S)/2,b)};return ygr(o,E)},mb=function(e){return Number(e.replace(/\s+|px/gi,""))||0},mgr={PluginBase:zd,Menu:zdr,Grid:Ndr,Minimap:Xdr,Bundling:Kdr,ToolBar:ivr,Tooltip:svr,Fisheye:evr,TimeBar:qpr,ImageMinimap:egr,EdgeFilterLens:igr,SnapLine:ugr,Legend:dgr,Annotation:ggr};const Lu=mgr;G_("circle",{options:{size:Rr.defaultNode.size,style:{x:0,y:0,stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,i=r===void 0?{}:r,a=this.getShapeStyle(e),o=ms({},i,e.icon),s="".concat(this.type,"-keyShape"),l=t.addShape("circle",{attrs:a,className:s,name:s,draggable:!0});t.shapeMap[s]=l;var u=o.width,h=o.height,c=o.show,f=o.text;if(c){var d="".concat(this.type,"-icon");f?t.shapeMap[d]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:d,name:d,draggable:!0}):t.shapeMap[d]=t.addShape("image",{attrs:ve({x:-u/2,y:-h/2},o),className:d,name:d,draggable:!0})}return this.drawLinkPoints(e,t),l},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints;if(!!r){var i=r||{},a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,h=i.r,c=rh(i,["top","left","right","bottom","size","r"]),f=this.getSize(e),d=f[0]/2;if(o){var v="link-point-left";t.shapeMap[v]=t.addShape("circle",{attrs:ve(ve({},c),{x:-d,y:0,r:u/2||h||5}),className:v,name:v,isAnchorPoint:!0})}if(s){var p="link-point-right";t.shapeMap[p]=t.addShape("circle",{attrs:ve(ve({},c),{x:d,y:0,r:u/2||h||5}),className:p,name:p,isAnchorPoint:!0})}if(a){var g="link-point-top";t.shapeMap[g]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:-d,r:u/2||h||5}),className:g,name:g,isAnchorPoint:!0})}if(l){var m="link-point-bottom";t.shapeMap[m]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:d,r:u/2||h||5}),className:m,name:m,isAnchorPoint:!0})}}},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=ms({},t,r),a=this.getSize(e),o=a[0]/2,s=ve({x:0,y:0,r:o},i);return s},update:function(e,t,r){var i=t.getContainer(),a=this.getSize(e),o=ve({},e.style);e.style.stroke===void 0&&e.color&&(o.stroke=e.color),e.style.r===void 0&&!isNaN(a[0])&&(o.r=a[0]/2),this.updateShape(e,t,o,!0,r),this.updateLinkPoints(e,i)}},"single-node");G_("rect",{options:{size:[100,30],style:{radius:0,stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(e,t){var r=this.getShapeStyle(e),i=t.addShape("rect",{attrs:r,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return t.shapeMap["".concat(this.type,"-keyShape")]=i,this.drawLinkPoints(e,t),i},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=r===void 0?{}:r,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,h=i.r,c=rh(i,["top","left","right","bottom","size","r"]),f=this.getSize(e),d=f[0],v=f[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},c),{x:-d/2,y:0,r:u/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},c),{x:d/2,y:0,r:u/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:-v/2,r:u/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:v/2,r:u/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],l=ve({x:-o/2,y:-s/2,width:o,height:s},i);return l},update:function(e,t,r){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s=t.get("keyShape");e.size||(o[0]=s.attr("width")||a.width,o[1]=s.attr("height")||a.height);var l={stroke:e.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},u=_n({},a,s.attr(),l);u=_n(u,e.style),this.updateShape(e,t,u,!1,r),this.updateLinkPoints(e,i)}},"single-node");G_("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,i=r===void 0?{}:r,a=this.getShapeStyle(e),o=t.addShape("ellipse",{attrs:a,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});t.shapeMap["ellipse-keyShape"]=o;var s=i.width,l=i.height,u=i.show,h=i.text;return u&&(h?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:ve({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=r===void 0?{}:r,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,h=i.r,c=rh(i,["top","left","right","bottom","size","r"]),f=this.getSize(e),d=f[0]/2,v=f[1]/2;o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},c),{x:-d,y:0,r:u/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},c),{x:d,y:0,r:u/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:-v,r:u/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:v,r:u/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getSize(e),o=a[0]/2,s=a[1]/2,l=ve({x:0,y:0,rx:o,ry:s},i);return l},update:function(e,t,r){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s={stroke:e.color,rx:o[0]/2,ry:o[1]/2},l=t.get("keyShape"),u=_n({},a,l.attr(),s);u=_n(u,e.style),this.updateShape(e,t,u,!0,r),this.updateLinkPoints(e,i)}},"single-node");G_("diamond",{options:{size:[80,80],style:{stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,i=r===void 0?{}:r,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,l=i.height,u=i.show,h=i.text;return u&&(h?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:ve({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=r===void 0?{}:r,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,h=i.r,c=rh(i,["top","left","right","bottom","size","r"]),f=this.getSize(e),d=f[0],v=f[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},c),{x:-d/2,y:0,r:u/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},c),{x:d/2,y:0,r:u/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:-v/2,r:u/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:v/2,r:u/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(e){var t=this.getSize(e),r=t[0],i=t[1],a=[["M",0,-i/2],["L",r/2,0],["L",0,i/2],["L",-r/2,0],["Z"]];return a},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getPath(e),o=ve({path:a},i);return o},update:function(e,t,r){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=_n({},a,l.attr(),s);u=_n(u,e.style),this.updateShape(e,t,u,!0,r),this.updateLinkPoints(e,i)}},"single-node");G_("triangle",{options:{size:40,direction:"up",style:{stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(e,t){var r=this.mergeStyle||this.getOptions(e),i=r.icon,a=i===void 0?{}:i,o=r.direction,s=this.getShapeStyle(e),l=e.direction||o,u=t.addShape("path",{attrs:s,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=u;var h=a.width,c=a.height,f=a.show,d=a.offset,v=a.text;if(f)if(v)t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var p=-h/2,g=-c/2;(l==="up"||l==="down")&&(g+=d),(l==="left"||l==="right")&&(p+=d),t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:ve({x:p,y:g},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(e,t),u},drawLinkPoints:function(e,t){var r=this.mergeStyle||this.getOptions(e),i=r.linkPoints,a=i===void 0?{}:i,o=r.direction,s=e.direction||o,l=a.top,u=a.left,h=a.right,c=a.bottom,f=a.size,d=a.r,v=rh(a,["top","left","right","bottom","size","r"]),p=this.getSize(e),g=p[0];if(u){var m=null,y=g*Math.sin(1/3*Math.PI),_=g*Math.sin(1/3*Math.PI);s==="up"?m=[-_,y]:s==="down"?m=[-_,-y]:s==="left"&&(m=[-_,_-y]),m&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},v),{x:m[0],y:m[1],r:f/2||d||5}),className:"link-point-left",name:"link-point-left"}))}if(h){var x=null,y=g*Math.sin(1/3*Math.PI),_=g*Math.sin(1/3*Math.PI);s==="up"?x=[_,y]:s==="down"?x=[_,-y]:s==="right"&&(x=[_,_-y]),x&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},v),{x:x[0],y:x[1],r:f/2||d||5}),className:"link-point-right",name:"link-point-right"}))}if(l){var S=null,y=g*Math.sin(1/3*Math.PI),_=g*Math.sin(1/3*Math.PI);s==="up"?S=[_-y,-y]:s==="left"?S=[_,-y]:s==="right"&&(S=[-_,-y]),S&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},v),{x:S[0],y:S[1],r:f/2||d||5}),className:"link-point-top",name:"link-point-top"}))}if(c){var w=null,y=g*Math.sin(1/3*Math.PI),_=g*Math.sin(1/3*Math.PI);s==="down"?w=[-_+y,y]:s==="left"?w=[_,y]:s==="right"&&(w=[-_,y]),w&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},v),{x:w[0],y:w[1],r:f/2||d||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(e){var t=(this.mergeStyle||this.getOptions(e)).direction,r=e.direction||t,i=this.getSize(e),a=i[0],o=a*Math.sin(1/3*Math.PI),s=a*Math.sin(1/3*Math.PI),l=[["M",-s,o],["L",0,-o],["L",s,o],["Z"]];return r==="down"?l=[["M",-s,-o],["L",s,-o],["L",0,o],["Z"]]:r==="left"?l=[["M",-s,s-o],["L",s,-s],["L",s,s],["Z"]]:r==="right"&&(l=[["M",s,s-o],["L",-s,s],["L",-s,-s],["Z"]]),l},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getPath(e),o=ve({path:a},i);return o},update:function(e,t,r){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=_n({},a,l.attr(),s);u=_n(u,e.style),this.updateShape(e,t,u,!0,r),this.updateLinkPoints(e,i)},updateLinkPoints:function(e,t){var r=this.getOptions({}),i=r.linkPoints,a=r.direction,o=e.direction||a,s=t.shapeMap["link-point-left"]||t.find(function(D){return D.get("className")==="link-point-left"}),l=t.shapeMap["link-point-right"]||t.find(function(D){return D.get("className")==="link-point-right"}),u=t.shapeMap["link-point-top"]||t.find(function(D){return D.get("className")==="link-point-top"}),h=t.shapeMap["link-point-bottom"]||t.find(function(D){return D.get("className")==="link-point-bottom"}),c=i,f=s||l||u||h;f&&(c=f.attr());var d=_n({},c,e.linkPoints),v=d.fill,p=d.stroke,g=d.lineWidth,m=d.size/2;m||(m=d.r);var y=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},_=y.left,x=y.right,S=y.top,w=y.bottom,b=this.getSize(e),E=b[0],T={r:m,fill:v,stroke:p,lineWidth:g},C=null,A=E*Math.sin(1/3*Math.PI),M=E*Math.sin(1/3*Math.PI);o==="up"?C=[-M,A]:o==="down"?C=[-M,-A]:o==="left"&&(C=[-M,M-A]),C&&(s?!_&&_!==void 0?(s.remove(),delete t.shapeMap["link-point-left"]):s.attr(ve(ve({},T),{x:C[0],y:C[1]})):_&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},T),{x:C[0],y:C[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var I=null;o==="up"?I=[M,A]:o==="down"?I=[M,-A]:o==="right"&&(I=[M,M-A]),I&&(l?!x&&x!==void 0?(l.remove(),delete t.shapeMap["link-point-right"]):l.attr(ve(ve({},T),{x:I[0],y:I[1]})):x&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},T),{x:I[0],y:I[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var R=null;o==="up"?R=[M-A,-A]:o==="left"?R=[M,-A]:o==="right"&&(R=[-M,-A]),R&&(u?!S&&S!==void 0?(u.remove(),delete t.shapeMap["link-point-top"]):u.attr(ve(ve({},T),{x:R[0],y:R[1]})):S&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},T),{x:R[0],y:R[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var k=null;o==="down"?k=[-M+A,A]:o==="left"?k=[M,A]:o==="right"&&(k=[-M,A]),k&&(h?!w&&w!==void 0?(h.remove(),delete t.shapeMap["link-point-bottom"]):h.attr(ve(ve({},T),{x:k[0],y:k[1]})):w&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},T),{x:k[0],y:k[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node");G_("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:Rr.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:Rr.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:Rr.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).preRect,i=r===void 0?{}:r,a=this.getShapeStyle(e),o=this.getSize(e),s=o[0],l=o[1],u=t.addShape("rect",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=u;var h=i.show,c=rh(i,["show"]);return h&&(t.shapeMap["pre-rect"]=t.addShape("rect",{attrs:ve({x:-s/2,y:-l/2,height:l},c),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(e,t),this.drawStateIcon(e,t),this.drawLinkPoints(e,t),u},drawLogoIcon:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).logoIcon,i=r===void 0?{}:r,a=this.getSize(e),o=a[0];if(i.show){var s=i.width,l=i.height,u=i.x,h=i.y,c=i.offset,f=i.text,d=rh(i,["width","height","x","y","offset","text"]);f?t.shapeMap["rect-logo-icon"]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):t.shapeMap["rect-logo-icon"]=t.addShape("image",{attrs:ve(ve({},d),{x:u||-o/2+s+c,y:h||-l/2,width:s,height:l}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).stateIcon,i=r===void 0?{}:r,a=this.getSize(e),o=a[0];if(i.show){var s=i.width,l=i.height,u=i.x,h=i.y,c=i.offset,f=i.text,d=rh(i,["width","height","x","y","offset","text"]);f?t.shapeMap["rect-state-icon"]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):t.shapeMap["rect-state-icon"]=t.addShape("image",{attrs:ve(ve({},d),{x:u||o/2-s+c,y:h||-l/2,width:s,height:l}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=r===void 0?{}:r,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,h=i.r,c=rh(i,["top","left","right","bottom","size","r"]),f=this.getSize(e),d=f[0],v=f[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},c),{x:-d/2,y:0,r:u/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},c),{x:d/2,y:0,r:u/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:-v/2,r:u/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:v/2,r:u/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(e,t){var r=this.getOptions(e),i=r.labelCfg,a=i===void 0?{}:i,o=r.logoIcon,s=o===void 0?{}:o,l=r.descriptionCfg,u=l===void 0?{}:l,h=this.getSize(e),c=h[0],f=null,d=s.show,v=s.width,p=-c/2+a.offset;d&&(p=-c/2+v+a.offset);var g=a.style,m=u.style,y=u.paddingTop;return rr(e.description)?(f=t.addShape("text",{attrs:ve(ve({},g),{x:p,y:-5,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=f,t.shapeMap["rect-description"]=t.addShape("text",{attrs:ve(ve({},m),{x:p,y:17+(y||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(f=t.addShape("text",{attrs:ve(ve({},g),{x:p,y:7,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=f),f},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],l=ve({x:-o/2,y:-s/2,width:o,height:s},i);return l},update:function(e,t){var r=this.mergeStyle||this.getOptions(e),i=r.style,a=i===void 0?{}:i,o=r.labelCfg,s=o===void 0?{}:o,l=r.descriptionCfg,u=l===void 0?{}:l,h=this.getSize(e),c=h[0],f=h[1],d=t.get("keyShape");d.attr(ve(ve({},a),{x:-c/2,y:-f/2,width:c,height:f}));var v=t.getContainer(),p=v.shapeMap["rect-logo-icon"]||v.find(function(ie){return ie.get("className")==="rect-logo-icon"}),g=p?p.attr():{},m=_n({},g,e.logoIcon),y=m.width;y===void 0&&(y=this.options.logoIcon.width);var _=e.logoIcon?e.logoIcon.show:void 0,x=s.offset,S=-c/2+y+x;!_&&_!==void 0&&(S=-c/2+x);var w=v.shapeMap["node-label"]||v.find(function(ie){return ie.get("className")==="node-label"}),b=v.shapeMap["rect-description"]||v.find(function(ie){return ie.get("className")==="rect-description"});if(e.label)if(!w)v.shapeMap["node-label"]=v.addShape("text",{attrs:ve(ve({},s.style),{x:S,y:e.description?-5:7,text:e.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});else{var E=e.labelCfg?e.labelCfg.style:{},T=_n({},w.attr(),E);e.label&&(T.text=e.label),T.x=S,rr(e.description)&&(T.y=-5),b&&(b.resetMatrix(),b.attr({x:S})),w.resetMatrix(),w.attr(T)}if(rr(e.description)){var C=u.paddingTop;if(!b)v.shapeMap["rect-description"]=v.addShape("text",{attrs:ve(ve({},u.style),{x:S,y:17+(C||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0});else{var E=e.descriptionCfg?e.descriptionCfg.style:{},A=_n({},b.attr(),E);rr(e.description)&&(A.text=e.description),A.x=S,b.resetMatrix(),b.attr(ve(ve({},A),{y:17+(C||0)}))}}var M=v.shapeMap["pre-rect"]||v.find(function(ie){return ie.get("className")==="pre-rect"});if(M&&!M.destroyed){var I=_n({},M.attr(),e.preRect);M.attr(ve(ve({},I),{x:-c/2,y:-f/2,height:f}))}if(p&&!p.destroyed)if(!_&&_!==void 0)p.remove(),delete v.shapeMap["pre-rect"];else{var R=m.width,k=m.height,D=m.x,G=m.y,W=m.offset,z=rh(m,["width","height","x","y","offset"]);p.attr(ve(ve({},z),{x:D||-c/2+R+W,y:G||-k/2,width:R,height:k}))}else _&&this.drawLogoIcon(e,v);var V=v.shapeMap["rect-state-icon"]||v.find(function(ie){return ie.get("className")==="rect-state-icon"}),q=V?V.attr():{},Y=_n({},q,e.stateIcon);if(V){!Y.show&&Y.show!==void 0&&(V.remove(),delete v.shapeMap["rect-state-icon"]);var le=Y.width,k=Y.height,D=Y.x,G=Y.y,j=Y.offset,Q=rh(Y,["width","height","x","y","offset"]);V.attr(ve(ve({},Q),{x:D||c/2-le+j,y:G||-k/2,width:le,height:k}))}else Y.show&&this.drawStateIcon(e,v);this.updateLinkPoints(e,v)},getOptions:function(e,t){return t==="move"?e:ms({},this.options,this.getCustomConfig(e)||{},e)}},"single-node");G_("star",{options:{size:60,style:{stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,i=r===void 0?{}:r,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,l=i.height,u=i.show,h=i.text;return u&&(h?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:ve({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=r===void 0?{}:r,a=i.top,o=i.left,s=i.right,l=i.leftBottom,u=i.rightBottom,h=i.size,c=i.r,f=rh(i,["top","left","right","leftBottom","rightBottom","size","r"]),d=this.getSize(e),v=d[0];if(s){var p=Math.cos(.1*Math.PI)*v,g=Math.sin((18+72*0)/180*Math.PI)*v;t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},f),{x:p,y:-g,r:h/2||c||5}),className:"link-point-right",name:"link-point-right"})}if(a){var p=Math.cos(.5*Math.PI)*v,g=Math.sin((18+72*1)/180*Math.PI)*v;t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},f),{x:p,y:-g,r:h/2||c||5}),className:"link-point-top",name:"link-point-top"})}if(o){var p=Math.cos(.9*Math.PI)*v,g=Math.sin((18+72*2)/180*Math.PI)*v;t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},f),{x:p,y:-g,r:h/2||c||5}),className:"link-point-left",name:"link-point-left"})}if(l){var p=Math.cos(1.3*Math.PI)*v,g=Math.sin((18+72*3)/180*Math.PI)*v;t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},f),{x:p,y:-g,r:h/2||c||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(u){var p=Math.cos(1.7*Math.PI)*v,g=Math.sin((18+72*4)/180*Math.PI)*v;t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:ve(ve({},f),{x:p,y:-g,r:h/2||c||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(e){var t=this.getSize(e),r=t[0],i=r*3/8,a=e.innerR||i;return gc.getStarPath(r,a)},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getPath(e),o=ve({path:a},i);return o},update:function(e,t,r){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=_n({},a,l.attr(),s);u=_n(u,e.style),this.updateShape(e,t,u,!0,r),this.updateLinkPoints(e,i)},updateLinkPoints:function(e,t){var r=this.getOptions({}).linkPoints,i=t.shapeMap["link-point-left"]||t.find(function(A){return A.get("className")==="link-point-left"}),a=t.shapeMap["link-point-right"]||t.find(function(A){return A.get("className")==="link-point-right"}),o=t.shapeMap["link-point-top"]||t.find(function(A){return A.get("className")==="link-point-top"}),s=t.shapeMap["link-point-left-bottom"]||t.find(function(A){return A.get("className")==="link-point-left-bottom"}),l=t.shapeMap["link-point-left-bottom"]||t.find(function(A){return A.get("className")==="link-point-right-bottom"}),u=r,h=i||a||o||s||l;h&&(u=h.attr());var c=_n({},u,e.linkPoints),f=c.fill,d=c.stroke,v=c.lineWidth,p=c.size/2;p||(p=c.r);var g=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},m=g.left,y=g.right,_=g.top,x=g.leftBottom,S=g.rightBottom,w=this.getSize(e),b=w[0],E={r:p,fill:f,stroke:d,lineWidth:v},T=Math.cos((18+72*0)/180*Math.PI)*b,C=Math.sin((18+72*0)/180*Math.PI)*b;a?!y&&y!==void 0?(a.remove(),delete t.shapeMap["link-point-right"]):a.attr(ve(ve({},E),{x:T,y:-C})):y&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},E),{x:T,y:-C}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),T=Math.cos((18+72*1)/180*Math.PI)*b,C=Math.sin((18+72*1)/180*Math.PI)*b,o?!_&&_!==void 0?(o.remove(),delete t.shapeMap["link-point-top"]):o.attr(ve(ve({},E),{x:T,y:-C})):_&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},E),{x:T,y:-C}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),T=Math.cos((18+72*2)/180*Math.PI)*b,C=Math.sin((18+72*2)/180*Math.PI)*b,i?!m&&m!==void 0?(i.remove(),delete t.shapeMap["link-point-left"]):i.attr(ve(ve({},E),{x:T,y:-C})):m&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},E),{x:T,y:-C}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),T=Math.cos((18+72*3)/180*Math.PI)*b,C=Math.sin((18+72*3)/180*Math.PI)*b,s?!x&&x!==void 0?(s.remove(),delete t.shapeMap["link-point-left-bottom"]):s.attr(ve(ve({},E),{x:T,y:-C})):x&&(t.shapeMap["link-point-left-bottom"]=t.addShape("circle",{attrs:ve(ve({},E),{x:T,y:-C}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),T=Math.cos((18+72*4)/180*Math.PI)*b,C=Math.sin((18+72*4)/180*Math.PI)*b,l?!S&&S!==void 0?(l.remove(),delete t.shapeMap["link-point-right-bottom"]):l.attr(ve(ve({},E),{x:T,y:-C})):S&&(t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:ve(ve({},E),{x:T,y:-C}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var _2e=gc.defaultSubjectColors,AR="fan-shape-",bje=function(e,t){var r=0,i=[];return Object.keys(e).forEach(function(a){var o=+e[a];isNaN(o)||(i.push({key:a,value:o,color:t[a]}),r+=o)}),{totalValue:r,configs:i}},Eje=function(e){var t=e.attr("r"),r=.6*t,i=(t+r)/2,a=t-r;return{lineWidth:a,arcR:i}},fte=function(e,t){var r=t.arcR,i=t.arcBegin,a=t.beginAngle,o=t.config,s=t.fanIndex,l=t.lineWidth,u=t.totalValue,h=t.drawWhole,c=h===void 0?!1:h,f=t.updateShape,d=f===void 0?void 0:f,v=o.value/u;if(v<.001)return{beginAngle:a,arcBegin:i,shape:void 0,shouldEnd:!1};var p,g,m;if(c||v>.999)p=[r,1e-4],m=1;else{var y=v*Math.PI*2;g=a+y,p=[r*Math.cos(g),-r*Math.sin(g)],m=y>Math.PI?1:0}var _={path:[["M",i[0],i[1]],["A",r,r,0,m,0,p[0],p[1]]],stroke:o.color||(d==null?void 0:d.attr("stroke"))||_2e[s%_2e.length],lineWidth:l};return d?d.attr(_):e.shapeMap["".concat(AR).concat(s)]=e.addShape("path",{attrs:_,name:"".concat(AR).concat(s),draggable:!0}),{beginAngle:g,arcBegin:p,shape:e.shapeMap["".concat(AR).concat(s)],shouldEnd:c||v>.999}},_gr=function(e,t,r){var i=e.donutAttrs,a=i===void 0?{}:i,o=e.donutColorMap,s=o===void 0?{}:o,l=Object.keys(a).length;if(a&&l>1){var u=bje(a,s),h=u.configs,c=u.totalValue;if(c){var f=Eje(r),d=f.lineWidth,v=f.arcR,p=[v,0],g=0;if(l===1){fte(t,{arcR:v,arcBegin:p,beginAngle:g,config:h[0],fanIndex:0,lineWidth:d,totalValue:c,drawWhole:!0});return}for(var m=0;m=0;a--){var o=e[a];o.id="".concat(o.x,"|||").concat(o.y),r[o.id]||(r[o.id]=o,t.push(o))}return t},Tje=function(e){return rue(e)},K9=function(e,t){return e.width||e.height?{centerX:e.centerX,centerY:e.centerY,minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t,height:e.height+2*t,width:e.width+2*t}:e},wgr=function(e,t){var r=Math.abs(e.x-t.centerX),i=Math.abs(e.y-t.centerY);return r===0&&i===0?0:r/t.width>i/t.height},dte=function(e,t,r){var i=wgr(t,e);if(i===0){var a=e.centerX,o=e.centerY;return r.yt.x?a=e.maxX:r.xe.centerX?e.maxX:e.minX,y:t.y}:{x:t.x,y:t.y>e.centerY?e.maxY:e.minY}},x2e=function(e,t){var r=Math.min(e.minX,t.minX),i=Math.min(e.minY,t.minY),a=Math.max(e.maxX,t.maxX),o=Math.max(e.maxY,t.maxY);return{centerX:(r+a)/2,centerY:(i+o)/2,minX:r,minY:i,maxX:a,maxY:o,height:o-i,width:a-r}},vte=function(e){return[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}]},q5=function(e,t){var r=e.x,i=e.y;return rt.maxX||it.maxY},bgr=function(e,t){return te.maxX?[]:[{x:t,y:e.minY},{x:t,y:e.maxY}]},Egr=function(e,t){return te.maxY?[]:[{x:e.minX,y:t},{x:e.maxX,y:t}]},Tgr=function(e,t){return bgr(e,t.x).concat(Egr(e,t.y))},aN=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},Cgr=function(e,t){var r=-2,i=0;return t.forEach(function(a){a&&(e.x===a.x&&(i+=r),e.y===a.y&&(i+=r))}),i},S2e=function(e,t,r,i,a){return aN(e,t)+aN(e,r)+Cgr(e,[t,r,i,a])},Cje=function(e,t,r,i,a){a===void 0&&(a=0),e.unshift(t[i]),r[i]&&r[i]!==i&&a<=100&&Cje(e,t,r,r[i],a+1)},Z5=function(e,t,r,i){var a=r.x-e.x,o=r.y-e.y,s=i.x-e.x,l=i.y-e.y,u=r.x-t.x,h=r.y-t.y,c=i.x-t.x,f=i.y-t.y,d=a*l-o*s,v=u*f-h*c,p=a*h-o*u,g=s*f-l*c;return d*v<=0&&p*g<=0},pte=function(e,t,r){if(r.width||r.height){var i=vte(r),a=i[0],o=i[1],s=i[2],l=i[3];return Z5(e,t,a,o)||Z5(e,t,a,l)||Z5(e,t,o,s)||Z5(e,t,s,l)}return!1},Agr=function(e,t,r,i){var a=[];return e.forEach(function(o){if(o!==t&&(o.x===t.x||o.y===t.y)){if(pte(o,t,r)||pte(o,t,i))return;a.push(o)}}),rue(a)},Aje=function(){function n(){this.arr=[],this.map={},this.arr=[],this.map={}}return n.prototype._innerAdd=function(e,t){for(var r=[0,t-1];r[1]-r[0]>1;){var i=Math.floor((r[0]+r[1])/2);if(this.arr[i].value>e.value)r[1]=i;else if(this.arr[i].value=0;t--)this.map[this.arr[t].id]?e=this.arr[t].id:this.arr.splice(t,1);return e},n.prototype._findFirstId=function(){for(;this.arr.length;){var e=this.arr.shift();if(this.map[e.id])return e.id}},n.prototype.minId=function(e){return e?this._clearAndGetMinId():this._findFirstId()},n}(),Mgr=function(e,t,r,i,a,o,s){var l,u=[],h=(l={},l[t.id]=t,l),c={},f={},d={};f[t.id]=0,d[t.id]=S2e(t,r,t);var v=new Aje;v.add({id:t.id,value:d[t.id]});var p={};e.forEach(function(S){p[S.id]=S});for(var g;Object.keys(h).length;){var m=v.minId(!1);if(m)g=h[m];else break;if(g===r){var y=[];return Cje(y,p,c,r.id),y}delete h[g.id],v.remove(g.id),u.push(g);var _=Agr(e,g,i,a),x=function(w){w.forEach(function(b){if(u.indexOf(b)===-1){var E=b.id;h[E]||(h[E]=b);var T=d[g.id]+aN(g,b);if(f[E]&&T>=f[E]){v.add({id:E,value:d[E]});return}c[E]=g.id,f[E]=T,d[E]=f[E]+S2e(b,r,t,o,s),v.add({id:E,value:d[E]})}})};x(_)}return[t,r]},Igr=function(e,t,r){return!(e.x===t.x&&t.x===r.x||e.y===t.y&&t.y===r.y)},Lgr=function(e,t,r,i){var a=aN(e,t),o=aN(r,t);a=0;o--){var s=e[o];if(s.x===r.x?i.push(s):(i=[s],r.x=s.x),s.y===r.y?a.push(s):(a=[s],r.y=s.y),i.length>2){var l=e.indexOf(i[1]);l>-1&&e.splice(l,1);continue}if(a.length>2){var l=e.indexOf(a[1]);l>-1&&e.splice(l,1)}}return e},Ogr=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},Rgr=function(e,t,r,i,a){return Tje(Mje(e,t,r,i,a.offset))},Dgr={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:Ogr,fallbackRoute:Rgr},k1=function(e,t){var r=Math.round(Math.abs(e/t)),i=e<0?-1:1;return r<0?0:i*r},Ngr=function(e,t,r){var i={};return e.forEach(function(a){if(!!a)for(var o=K9(a.getBBox(),r),s=k1(o.minX,t);s<=k1(o.maxX,t);s+=1)for(var l=k1(o.minY,t);l<=k1(o.maxY,t);l+=1)i["".concat(s,"|||").concat(l)]=!0}),i},kY=function(e,t){var r=t.x-e.x,i=t.y-e.y;return r||i?Math.atan2(i,r):0},b2e=function(e,t){var r=Math.abs(e-t);return r>Math.PI?2*Math.PI-r:r},E2e=function(e,t,r){for(var i=1/0,a=0,o=t.length;au.minX&&t.xu.minY&&t.y0&&w>0;){var k=_.minId((w+1)%30===0);if(k)b=v[k];else break;if(R["".concat(b.x,"|||").concat(b.y)])return kgr(b,g,h,t,e,c,l);delete v[b.id],_.remove(b.id),p[b.id]=!0;for(var x=0;xo.maxAllowedDirectionChange)&&!u[D])){v[D]||(v[D]=T);var G=s[M];C=o.distFunc(b,T)+(isNaN(G)?l:G),A=m[b.id]+C;var W=m[D];W&&A>=W||(g[D]=b,m[D]=A,y[D]=A+E2e(T,d,o.distFunc),_.add({id:D,value:y[D]}))}}w-=1}return o.fallbackRoute(e,t,r,i,o)};NUe("polyline",{options:{color:Rr.defaultEdge.color,size:Rr.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:Rr.defaultEdge.style.stroke,lineAppendWidth:Rr.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:Rr.edgeLabel.style.fill,fontSize:Rr.edgeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:ve({},Rr.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(e,t){var r=this.getShapeStyle(e);r.radius===0&&delete r.radius;var i=t.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:r});return t.shapeMap["edge-shape"]=i,i},getShapeStyle:function(e){var t=this.options.style,r={stroke:e.color},i=_n({},t,r,e.style);e=this.getPathPoints(e),this.radius=i.radius,this.offset=i.offset;var a=e.startPoint,o=e.endPoint,s=this.getControlPoints(e),l=[a];s&&(l=l.concat(s)),l.push(o);var u=e.sourceNode,h=e.targetNode,c=i.radius,f=this.options.routeCfg,d=_n({},f,e.routeCfg);d.offset=i.offset;var v=this.getPath(l,u,h,c,d,!Boolean(s));(vn(v)&&v.length<=1||rr(v)&&v.indexOf("L")===-1)&&(v="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(o.x)||isNaN(o.y))&&(v="M0 0, L0 0");var p=_n({},Rr.defaultEdge.style,i,{lineWidth:e.size,path:v});return p},updateShapeStyle:function(e,t){var r=t.getContainer();if(!!t.isVisible()){var i={stroke:e.color},a=r.shapeMap["edge-shape"]||r.find(function(x){return x.get("className")==="edge-shape"})||t.getKeyShape(),o=e.size;e=this.getPathPoints(e);var s=e.startPoint,l=e.endPoint,u=this.getControlPoints(e),h=[s];u&&(h=h.concat(u)),h.push(l);var c=a.attr(),f=_n({},i,c,e.style),d=e.sourceNode,v=e.targetNode,p=f.radius,g=this.options.routeCfg,m=_n({},g,e.routeCfg);m.offset=f.offset;var y=this.getPath(h,d,v,p,m,!Boolean(u));(vn(y)&&y.length<=1||rr(y)&&y.indexOf("L")===-1)&&(y="M0 0, L0 0"),(isNaN(s.x)||isNaN(s.y)||isNaN(l.x)||isNaN(l.y))&&(y="M0 0, L0 0"),c.endArrow&&f.endArrow===!1&&(e.style.endArrow={path:""}),c.startArrow&&f.startArrow===!1&&(e.style.startArrow={path:""});var _=_n(i,a.attr(),{lineWidth:o,path:y},e.style);a&&a.attr(_)}},getPath:function(e,t,r,i,a,o){var s=a.offset,l=a.obstacles,u=a.simple;if(!s||e.length>2||o===!1){if(i)return w2e(e,i);var h=[];return At(e,function(v,p){p===0?h.push(["M",v.x,v.y]):h.push(["L",v.x,v.y])}),h}u!==!1&&!(l!=null&&l.length)&&(u=!0);var c=u?Mje(e[e.length-1],e[0],r,t,s):Fgr(e[0],e[e.length-1],t,r,a);if(!c||!c.length)return"M0 0, L0 0";if(i){var f=w2e(c,i);return f}c=Pgr(c);var d=gc.pointsToPolygon(c);return d}},"single-edge");var C2e=H_.cloneEvent,A2e=H_.isNaN,M2e=Math.abs,Bgr=10,Ggr=["shift","ctrl","alt","control"];const zgr={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(e){var t=this.origin,r=+e.clientX,i=+e.clientY;if(!(A2e(r)||A2e(i))){var a=r-t.x,o=i-t.y;this.get("direction")==="x"?o=0:this.get("direction")==="y"&&(a=0),this.origin={x:r,y:i};var s=this.graph.get("width"),l=this.graph.get("height"),u=this.graph.get("canvas").getCanvasBBox(),h=this.scalableRange,c=this.scalableRange;h<1&&h>-1&&(h=s*h,c=l*c),(u.minX<=s+h&&u.minX+a>s+h||u.maxX+h>=0&&u.maxX+h+a<0)&&(a=0),(u.minY<=l+c&&u.minY+o>l+c||u.maxY+c>=0&&u.maxY+c+o<0)&&(o=0),this.graph.translate(a,o)}},onTouchStart:function(e){var t=this,r=e.originalEvent.touches,i=r[0],a=r[1];i&&a||(e.preventDefault(),this.mousedown=!0,t.onDragStart(e))},onMouseDown:function(e){this.mousedown=!0},onDragMove:function(e){!this.mousedown||(this.dragstart?this.onDrag(e):(this.dragstart=!0,this.onDragStart(e)))},onDragStart:function(e){var t=this,r=e.originalEvent;if(!(r&&e.name!=="touchstart"&&r.button!==0)&&!(e.name!=="touchstart"&&typeof window<"u"&&window.event&&!window.event.buttons&&!window.event.button)&&!!this.shouldBegin(e,this)&&!t.keydown&&!!this.allowDrag(e)){if(t.origin={x:e.clientX,y:e.clientY},t.dragging=!1,this.enableOptimize){for(var i=this.graph,a=i.getEdges(),o=0,s=a.length;ol)for(var d=i.getNodes(),v=0,p=d.length;v-1?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(e){var t,r,i=e.target,a=i&&i.isCanvas&&i.isCanvas();if(z3(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if(Wh(this.allowDragOnItem)){var o=this.allowDragOnItem,s=o.node,l=o.edge,u=o.combo,h=(r=(t=e.item)===null||t===void 0?void 0:t.getType)===null||r===void 0?void 0:r.call(t);if(!s&&h==="node"||!l&&h==="edge"||!u&&h==="combo")return!1}return!0}},Ugr={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(e){if(!this.origin||!e||e.destroyed)return!1;var t=e.getType();return t==="combo"},onTouchStart:function(e){if(!!e.item){var t=this;try{var r=e.originalEvent.touches,i=r[0],a=r[1];if(i&&a)return;e.preventDefault()}catch{console.warn("Touch original event not exist!")}this.mousedown={item:e.item,target:e.target,origin:{x:e.x,y:e.y}},this.dragstart=!0,t.onDragStart(e)}},onTouchMove:function(e){var t=this;try{var r=e.originalEvent.touches,i=r[0],a=r[1];if(i&&a){t.onDragEnd(e);return}e.preventDefault()}catch{console.warn("Touch original event not exist!")}t.onDrag(e)},onMouseDown:function(e){this.mousedown={item:e.item,target:e.target,origin:{x:e.x,y:e.y}},typeof window<"u"&&!this.windowEventBinded&&(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(e){var t,r;if(((r=(t=e.item)===null||t===void 0?void 0:t.getType)===null||r===void 0?void 0:r.call(t))!=="node"){this.onDragEnd();return}!this.mousedown||(this.dragstart?this.onDrag(ve(ve({},e),this.mousedown)):(this.dragstart=!0,this.onDragStart(e)))},onDragStart:function(e){var t=this;if(this.currentShouldEnd=!0,!!this.shouldBegin(ve(ve({},e),this.mousedown),this)){var r=this.mousedown,i=r.item,a=r.target;if(!(!i||i.destroyed||i.hasLocked())){var o=i.getContainer();if(o.set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(i),a){var s=a.get("isAnchorPoint");if(s)return}var l=this.graph;this.targets=[],this.targetCombo=null;var u=l.findAllByState("node",this.selectedState),h=i.get("id"),c=u.filter(function(d){var v=d.get("id");return h===v});if(c.length===0?this.targets.push(i):u.length>1?u.forEach(function(d){var v=d.hasLocked();v||t.targets.push(d)}):this.targets.push(i),this.graph.get("enabledStack")&&this.enableStack){var f=[];this.targets.forEach(function(d){var v=d.getModel(),p=v.x,g=v.y,m=v.id;f.push({x:p,y:g,id:m})}),this.set("beforeDragNodes",f)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(d){var v=d.getEdges();v.forEach(function(p){!p.isVisible()||(t.hidenEdge[p.getID()]=!0,p.hide())})}),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(e){var t=this;if(!(!this.mousedown||!this.origin)&&!!this.shouldUpdate(e,this))if(this.get("enableDelegate"))this.updateDelegate(e);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:e,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var r={};this.targets.map(function(i){t.update(i,e);var a=i.getModel().comboId;a&&(r[a]=t.graph.findById(a))}),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(e){var t=this,r;if(this.mousedown=!1,this.dragstart=!1,typeof window<"u"&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),!!this.origin){(r=this.cachedCaptureItems)===null||r===void 0||r.forEach(function(o){var s=o.getContainer();s.set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(o){var s=o.getEdges();s.forEach(function(l){t.hidenEdge[l.getID()]&&l.show(),l.refresh()})}),this.hidenEdge={};var i=this.graph;if(i.get("enabledStack")&&this.enableStack){var a={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(o){a.before.nodes.push(o)}),this.targets.forEach(function(o){var s=o.getModel(),l=s.x,u=s.y,h=s.id;a.after.nodes.push({x:l,y:u,id:h})}),i.pushStack("update",Xi(a))}i.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(e){var t=e.item;if(this.currentShouldEnd=this.shouldEnd(e,t,this),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!this.validationCombo(t))){var r=this.graph;if(this.comboActiveState&&r.setItemState(t,this.comboActiveState,!1),this.targetCombo=t,this.onlyChangeComboSize)r.updateCombos();else{var i=t.getModel();this.targets.map(function(a){var o=a.getModel();o.comboId!==i.id&&r.updateComboTree(a,i.id)}),r.updateCombo(t)}r.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(e){var t=this.graph;this.currentShouldEnd=this.shouldEnd(e,void 0,this),this.updatePositions(e,!this.currentShouldEnd),!(!this.targets||this.targets.length===0||!this.currentShouldEnd)&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map(function(r){var i=r.getModel();i.comboId&&t.updateComboTree(r)}))},onDropNode:function(e){if(!(!this.targets||this.targets.length===0)){var t=this,r=e.item,i=t.graph,a=r.getModel().comboId,o=a?i.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(e,o,this),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(a){var s=i.findById(a);t.comboActiveState&&i.setItemState(s,t.comboActiveState,!1),this.targets.map(function(l){var u=l.getModel();a!==u.comboId&&i.updateComboTree(l,a)}),i.updateCombo(s)}else this.targets.map(function(l){var u=l.getModel();u.comboId&&i.updateComboTree(l)});i.emit("dragnodeend",{items:this.targets,targetItem:r})}}},onDragEnter:function(e){var t=e.item;if(!!this.validationCombo(t)){var r=this.graph;this.comboActiveState&&r.setItemState(t,this.comboActiveState,!0)}},onDragLeave:function(e){var t=e.item;if(!!this.validationCombo(t)){var r=this.graph;this.comboActiveState&&r.setItemState(t,this.comboActiveState,!1)}},updatePositions:function(e,t){var r=this;!this.targets||this.targets.length===0||(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:e,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):t||this.targets.map(function(i){return r.update(i,e)}):this.targets.map(function(i){return r.update(i,e,t)}))},update:function(e,t,r){var i=this.origin,a=e.get("model"),o=e.get("id");this.point[o]||(this.point[o]={x:a.x||0,y:a.y||0});var s=t.x-i.x+this.point[o].x,l=t.y-i.y+this.point[o].y;r&&(s+=i.x-t.x,l+=i.y-t.y);var u={x:s,y:l};this.get("updateEdge")?this.graph.updateItem(e,u,!1):e.updatePosition(u)},debounceUpdate:U3(function(n){var e=n.targets,t=n.graph,r=n.point,i=n.origin,a=n.evt,o=n.updateEdge,s=n.onlyChangeComboSize,l=n.updateParentCombos;e.map(function(u){var h=u.get("model"),c=u.get("id");r[c]||(r[c]={x:h.x||0,y:h.y||0});var f=a.x-i.x+r[c].x,d=a.y-i.y+r[c].y,v={x:f,y:d};o?t.updateItem(u,v,!1):u.updatePosition(v)}),s&&l(t,e)},50,!0),updateDelegate:function(e){var t=this.graph;if(this.delegateRect){var f=e.x-this.origin.x+this.originPoint.minX,d=e.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:f,y:d})}else{var r=t.get("group"),i=ms({},BE.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(e),o=a.x,s=a.y,l=a.width,u=a.height,h=a.minX,c=a.minY;this.originPoint={x:o,y:s,width:l,height:u,minX:h,minY:c},this.delegateRect=r.addShape("rect",{attrs:ve({width:l,height:u,x:o,y:s},i),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(e){var t=this.targets;t.length===0&&t.push(e.item);for(var r=1/0,i=-1/0,a=1/0,o=-1/0,s=0;si&&(i=f),d>o&&(o=d)}var v=Math.floor(r),p=Math.floor(a),g=Math.ceil(i)-Math.floor(r),m=Math.ceil(o)-Math.floor(a);return{x:v,y:p,width:g,height:m,minX:r,minY:a}},updateParentCombos:function(e,t){var r=e||this.graph,i=t||this.targets,a={};i==null||i.forEach(function(o){var s=o.getModel().comboId;s&&(a[s]=r.findById(s))}),Object.values(a).forEach(function(o){o&&r.updateCombo(o)})}};var K5=null;const Vgr={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldClearStatusOnSecond:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return this.get("trigger")==="mouseenter"?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(e){var t=this;try{var r=e.originalEvent.touches,i=r[0],a=r[1];if(i&&a)return;e.preventDefault()}catch{console.warn("Touch original event not exist!")}t.setAllItemStates(e)},clearOnTouchStart:function(e){var t=this;try{var r=e.originalEvent.touches,i=r[0],a=r[1];if(i&&a)return;e.preventDefault()}catch{console.warn("Touch original event not exist!")}t.clearActiveState(e)},setAllItemStates:function(e){clearTimeout(this.timer),this.throttleSetAllItemStates(e,this)},clearActiveState:function(e){var t=this,r=this.shouldClearStatusOnSecond;r&&(K5=null),this.timer=setTimeout(function(){t.throttleClearActiveState(e,t)},50)},throttleSetAllItemStates:FD(function(n,e){var t=n.item,r=e.graph;if(!(!r||r.destroyed)&&(e.item=t,!!e.shouldUpdate(n.item,{event:n,action:"activate"},e))){var i=e.shouldClearStatusOnSecond,a=t.getModel().id;if(K5===a&&i){e.throttleClearActiveState(n,e),K5=null;return}for(var o=e.activeState,s=e.inactiveState,l=r.getNodes(),u=r.getCombos(),h=r.getEdges(),c=r.get("vedges"),f=l.length,d=u.length,v=h.length,p=c.length,g=e.inactiveItems||{},m=e.activeItems||{},y=0;y-1||(this.trigger=P2e,console.warn("Behavior brush-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(e){var t=e.item,r=this.brush,i=this.selectOnCombo,a=(t==null?void 0:t.getType())==="combo";a&&!i||!a&&t||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates(),r||(r=this.createBrush()),this.originPoint={x:e.canvasX,y:e.canvasY},r.attr({width:0,height:0}),r.show(),this.dragging=!0)},onMouseMove:function(e){!this.dragging||this.trigger!=="drag"&&!this.keydown||this.updateBrush(e)},onMouseUp:function(e){this.graph,!(!this.brush&&!this.dragging)&&(this.trigger!=="drag"&&!this.keydown||(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(e),this.dragging=!1))},clearStates:function(){var e=this,t=e.graph,r=e.selectedState,i=t.findAllByState("node",r),a=t.findAllByState("edge",r),o=t.findAllByState("combo",r);i.forEach(function(s){return t.setItemState(s,r,!1)}),a.forEach(function(s){return t.setItemState(s,r,!1)}),o.forEach(function(s){return t.setItemState(s,r,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(e,t,r,i,a){var o=e.getBBox();return o.centerX>=t&&o.centerX<=r&&o.centerY>=i&&o.centerY<=a},getSelectedNodes:function(e){var t=this,r=this,i=r.graph,a=r.originPoint,o=r.shouldUpdate,s=r.isBBoxCenterInRect,l=this.selectedState,u={x:e.x,y:e.y},h=i.getPointByCanvas(a.x,a.y),c=J5(u.x,h.x),f=I2e(u.x,h.x),d=J5(u.y,h.y),v=I2e(u.y,h.y),p=[],g=[];i.getNodes().forEach(function(_){if(_.isVisible()&&s(_,c,f,d,v)&&o(_,"select",t)){p.push(_);var x=_.getModel();g.push(x.id),i.setItemState(_,l,!0)}});var m=[];this.includeEdges&&p.forEach(function(_){var x=_.getOutEdges();x.forEach(function(S){if(!!S.isVisible()){var w=S.getModel(),b=w.source,E=w.target;g.includes(b)&&g.includes(E)&&o(S,"select",t)&&(m.push(S),i.setItemState(S,t.selectedState,!0))}})});var y=[];this.includeCombos&&i.getCombos().forEach(function(_){if(_.isVisible()&&s(_,c,f,d,v)&&o(_,"select",t)){y.push(_);var x=_.getModel();g.push(x.id),i.setItemState(_,l,!0)}}),this.selectedEdges=m,this.selectedNodes=p,this.selectedCombos=y,this.onSelect&&this.onSelect(p,m,y),i.emit("nodeselectchange",{selectedItems:{nodes:p,edges:m,combos:y},select:!0})},createBrush:function(){var e=this,t=e.graph.get("canvas").addShape("rect",{attrs:e.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(e){var t=this.originPoint;this.brush.attr({width:L2e(e.canvasX-t.x),height:L2e(e.canvasY-t.y),x:J5(e.canvasX,t.x),y:J5(e.canvasY,t.y)})},onKeyDown:function(e){var t=e.key;if(!!t){var r=this.trigger.toLowerCase(),i=t.toLowerCase();i===r||i==="control"&&r==="ctrl"||i==="ctrl"&&r==="control"?this.keydown=!0:this.keydown=!1}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}};var O2e="shift",Hgr=["shift","ctrl","alt","control"];const jgr={getDefaultCfg:function(){return{multiple:!0,trigger:O2e,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var e=this;return Hgr.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=O2e,console.warn("Behavior click-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),e.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(e){var t=this,r=e.item;if(!(!r||r.destroyed)){var i=r.getType(),a=t.graph,o=t.keydown,s=t.multiple,l=t.shouldUpdate,u=t.shouldBegin;if(!!u(e,t)){if(!o||!s){var h=a.findAllByState("node",t.selectedState).concat(a.findAllByState("edge",t.selectedState)).concat(a.findAllByState("combo",t.selectedState));At(h,function(p){p!==r&&a.setItemState(p,t.selectedState,!1)})}var c=function(){switch(i){case"node":return t.selectNode;case"edge":return t.selectEdge;case"combo":return t.selectCombo;default:return!1}}();if(!c){var f=a.findAllByState("node",t.selectedState),d=a.findAllByState("edge",t.selectedState),v=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{selectedItems:{nodes:f,edges:d,combos:v},select:!1});return}if(r.hasState(t.selectedState)){l(e,t)&&a.setItemState(r,t.selectedState,!1);var f=a.findAllByState("node",t.selectedState),d=a.findAllByState("edge",t.selectedState),v=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:r,selectedItems:{nodes:f,edges:d,combos:v},select:!1})}else{l(e,t)&&a.setItemState(r,t.selectedState,!0);var f=a.findAllByState("node",t.selectedState),d=a.findAllByState("edge",t.selectedState),v=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:r,selectedItems:{nodes:f,edges:d,combos:v},select:!0})}}}},onCanvasClick:function(e){var t=this,r=this,i=r.graph,a=r.shouldBegin;if(!!a(e,this)){var o=i.findAllByState("node",this.selectedState);At(o,function(u){i.setItemState(u,t.selectedState,!1)});var s=i.findAllByState("edge",this.selectedState);At(s,function(u){i.setItemState(u,t.selectedState,!1)});var l=i.findAllByState("combo",this.selectedState);At(l,function(u){i.setItemState(u,t.selectedState,!1)}),i.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(e){var t=this,r=e.key;!r||(r.toLowerCase()===this.trigger.toLowerCase()||r.toLowerCase()==="control"?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.keydown=!1}};var Xgr=sg,Q5=.05;const Ygr={getDefaultCfg:function(){return this.isFireFox=qHe()==="firefox",{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var e=this.fixSelectedItems;return e.fixState||(e.fixState="selected"),e.fixAll&&(e.fixLineWidth=!0,e.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(e){var t=e.originalEvent.touches,r=t[0],i=t[1];e.preventDefault(),i&&(this.shouldBegin&&!this.shouldBegin(e,this)||(this.startPoint={pageX:r.pageX,pageY:r.pageY},this.moveable=!0,i&&(this.endPoint={pageX:i.pageX,pageY:i.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(e){if(!!this.moveable){e.preventDefault();var t=e.originalEvent.touches,r=t[0],i=t[1];if(!!i){this.endPoint||(this.endPoint={pageX:i.pageX,pageY:i.pageY});var a=function(p,g){return Math.hypot(g.x-p.x,g.y-p.y)},o=a({x:r.pageX,y:r.pageY},{x:i.pageX,y:i.pageY})/a({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),s=this.originScale*o;this.currentScale=s;var l=this.get("minZoom")||this.graph.get("minZoom"),u=this.get("maxZoom")||this.graph.get("maxZoom");if(!(s>u||s0||e.wheelDelta<0?h=1-Q5*l:h=1/(1-Q5*l):e.wheelDelta<0?h=1-Q5*l:h=1/(1-Q5*l),c=u*h;var f=this.get("minZoom")||i.get("minZoom"),d=this.get("maxZoom")||i.get("maxZoom");c>d?c=d:ci/2?h-=f.width:h+=this.offset,c>a/2?c-=f.height:c+=this.offset;var d="".concat(h,"px"),v="".concat(c,"px");Di(this.container,{left:d,top:v,visibility:"visible"})},createTooltip:function(e){var t=e.get("el");t.style.position="relative";var r=zs('
    '));return t.parentNode.appendChild(r),Di(r,{position:"absolute",visibility:"visible"}),this.width=e.get("width"),this.height=e.get("height"),this.container=r,this.graph.get("tooltips").push(r),r}},qgr=ve({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(t){return t.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Ije),Zgr=ve({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: ".concat(t.source," target: ").concat(t.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Ije);var R2e="click",Kgr=["click","dblclick"];const Jgr={getDefaultCfg:function(){return{trigger:R2e,onChange:function(){}}},getEvents:function(){var e,t;return Kgr.includes(this.trigger)?t=this.trigger:(t=R2e,console.warn("Behavior collapse-expand \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),e={},e["node:".concat(t)]="onNodeClick",e.touchstart="onNodeClick",e},onNodeClick:function(e){var t=this;if(this.trigger==="click"){if(this.timer){clearTimeout(this.timer),this.timer=0;return}this.timer=setTimeout(function(){t.toggle(e),clearTimeout(t.timer),t.timer=0},200)}else this.toggle(e)},toggle:function(e){var t=e.item;if(!!t){var r=this.graph.findDataById(t.get("id"));if(!!r){var i=r.children;if(!(!i||i.length===0)){var a=!r.collapsed;!this.shouldBegin(e,a,this)||(r.collapsed=a,t.getModel().collapsed=a,this.graph.emit("itemcollapsed",{item:e.item,collapsed:a}),this.shouldUpdate(e,a,this)&&(this.onChange(t,a,this),this.graph.layout()))}}}}};var Qgr=H_.calculationItemsBBox,Lje=function(e,t){if(t(e)!==!1&&e){var r=e.get("combos");if(r.length===0)return!1;At(r,function(i){Lje(i,t)})}};const e0r={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(e){var t=e.item;if(!t||t.destroyed||!this.shouldUpdate(e,this))return!1;var r=t.getType();return r==="combo"},onMouseDown:function(e){this.origin={x:e.x,y:e.y}},onDragStart:function(e){var t=this,r=this.graph,i=e.item;if(this.currentShouldEnd=!0,!!this.validationCombo(e)&&!i.hasLocked()){this.targets=[];var a=r.findAllByState("combo",this.selectedState),o=i.get("id"),s=a.filter(function(u){var h=u.get("id");return o===h});s.length===0?this.targets.push(i):this.targets=a.filter(function(u){return!u.hasLocked()});var l=[];this.targets.forEach(function(u){var h=u.getModel(),c=h.x,f=h.y,d=h.id;l.push({x:c,y:f,id:d})}),this.set("beforeDragItems",l),this.activeState&&this.targets.map(function(u){var h=u.getModel();if(h.parentId){var c=r.findById(h.parentId);c&&r.setItemState(c,t.activeState,!0)}}),this.point={},this.originPoint={},this.currentItemChildCombos=[],Lje(i,function(u){if(u.destroyed)return!1;var h=u.getModel();return t.currentItemChildCombos.push(h.id),!0})}},onDrag:function(e){var t=this;if(!!this.origin&&!!this.validationCombo(e))if(this.enableDelegate)this.updateDelegate(e);else{if(this.activeState){var r=this.graph,i=e.item,a=i.getModel(),o=r.getCombos(),s=i.getBBox(),l=s.centerX,u=s.centerY,h=s.width,c=o.filter(function(f){var d=f.getModel();return a.parentId,d.id!==a.id&&!t.currentItemChildCombos.includes(d.id)});c.map(function(f){var d=f.getBBox(),v=d.centerX,p=d.centerY,g=d.width,m=l-v,y=u-p,_=2*Math.sqrt(m*m+y*y);h+g-_>.8*h?r.setItemState(f,t.activeState,!0):r.setItemState(f,t.activeState,!1)})}At(this.targets,function(f){t.updateCombo(f,e)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(e,t){var r=this;(this.enableDelegate||t)&&At(this.targets,function(i){r.updateCombo(i,e,t)})},onDrop:function(e){var t=this,r=e.item;if(this.currentShouldEnd=this.shouldEnd(e,r,this),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!r||!this.targets||r.destroyed)){var i=this.graph,a=r.getModel();this.targets.map(function(o){var s=o.getModel();s.parentId!==a.id?(t.activeState&&i.setItemState(r,t.activeState,!1),t.onlyChangeComboSize?i.updateCombo(o):i.updateComboTree(o,a.id,!1)):i.updateCombo(r)}),this.end(r,e),this.endComparison=!0}},onNodeDrop:function(e){var t=this;if(!(!this.targets||this.targets.length===0)){var r=this.graph,i=e.item,a=i.getModel().comboId,o=a?r.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(e,o,this),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){var s;if(a){if(this.activeState){var l=r.findById(a);r.setItemState(l,this.activeState,!1)}this.targets.map(function(u){t.onlyChangeComboSize?r.updateCombo(u):a!==u.getID()&&(s=r.findById(a),a!==u.getModel().parentId&&r.updateComboTree(u,a,!1))})}else this.targets.map(function(u){if(t.onlyChangeComboSize)r.updateCombo(u);else{var h=u.getModel();h.comboId&&r.updateComboTree(u,void 0,!1)}});this.endComparison=!0,this.end(s,e)}}},onDragEnter:function(e){if(!!this.origin&&!!this.validationCombo(e)){var t=e.item,r=this.graph;this.activeState&&r.setItemState(t,this.activeState,!0)}},onDragLeave:function(e){if(!!this.origin&&!!this.validationCombo(e)){var t=e.item,r=this.graph;this.activeState&&r.setItemState(t,this.activeState,!1)}},onDragEnd:function(e){if(!(!this.targets||this.targets.length===0)){var t=e.item;this.currentShouldEnd&&this.updatePositions(e);var r=this.getParentCombo(t.getModel().parentId),i=this.graph;r&&this.activeState&&i.setItemState(r,this.activeState,!1),this.end(void 0,e)}},end:function(e,t){var r=this;if(!!this.origin){var i=this.graph;if(this.delegateShape){var a=i.get("delegateGroup");a.clear(),this.delegateShape=null}if(e&&this.activeState&&i.setItemState(e,this.activeState,!1),!e){var o=i.get("enabledStack")&&this.enableStack,s={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map(function(l){if(!r.onlyChangeComboSize)i.updateComboTree(l,void 0,o);else{i.updateCombo(l);var u=l.getModel(),h=u.x,c=u.y,f=u.id;s.after.combos.push({x:h,y:c,id:f}),i.pushStack("update",s)}})}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(e,t,r){var i=this;if(r===void 0&&(r={}),t(e,r)!==!1&&e){var a=e.get("combos");At(a,function(s){i.traverse(s,t,r)});var o=e.get("nodes");At(o,function(s){i.traverse(s,t,r)})}},updateCombo:function(e,t,r){this.updateSingleItem(e,t,r);var i={};this.traverse(e,function(a,o){return a.destroyed?!1:(a.getEdges().forEach(function(s){return o[s.getID()]=s}),!0)},i),Object.values(i).forEach(function(a){return a.refresh()})},updateSingleItem:function(e,t,r){var i=this.origin,a=this.graph,o=e.getModel(),s=e.get("id");this.point[s]||(this.point[s]={x:o.x,y:o.y});var l=t.x-i.x+this.point[s].x,u=t.y-i.y+this.point[s].y;r&&(l+=i.x-t.x,u+=i.y-t.y),a.updateItem(e,{x:l,y:u},!1)},getParentCombo:function(e){var t=this.graph;if(!!e){var r=t.findById(e);if(!!r)return r}},updateDelegate:function(e){var t=this.graph;if(this.delegateShape){var f=e.x-this.origin.x+this.originPoint.minX,d=e.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:f,y:d})}else{var r=t.get("delegateGroup"),i=null;this.targets.length>1?i=Qgr(this.targets):i=this.targets[0].getBBox();var a=i.x,o=i.y,s=i.width,l=i.height,u=i.minX,h=i.minY;this.originPoint={x:a,y:o,width:s,height:l,minX:u,minY:h};var c=ve(ve({},BE.delegateStyle),this.delegateStyle);this.delegateShape=r.addShape("rect",{attrs:ve({width:i.width,height:i.height,x:i.x,y:i.y},c),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var e=this,t=e.graph,r=e.targets,i={};r==null||r.forEach(function(a){var o=a.getModel().parentId;o&&(i[o]=t.findById(o))}),Object.values(i).forEach(function(a){a&&t.updateCombo(a)})}};var D2e="dblclick",t0r=["click","dblclick"];const r0r={getDefaultCfg:function(){return{trigger:D2e,relayout:!0}},getEvents:function(){var e,t;return t0r.includes(this.trigger)?t=this.trigger:(t=D2e,console.warn("Behavior collapse-expand-group \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),e={},e["combo:".concat(t)]="onComboClick",e},onComboClick:function(e){var t=e.item,r=this,i=r.graph,a=r.relayout;if(!(!t||t.destroyed||t.getType()!=="combo")){var o=t.getModel(),s=o.id;!s||(i.collapseExpandCombo(s),a&&i.get("layout")?i.layout():i.refreshPositions())}}};var n0r=H_.isPolygonsIntersect,i0r=H_.pathToPoints,N2e="shift",a0r=["drag","shift","ctrl","alt","control"],o0r=function(e,t){var r,i=e.getKeyShape();if(e.get("type")==="path")r=i0r(i.attr("path"));else{var a=i.getCanvasBBox();r=[[a.minX,a.minY],[a.maxX,a.minY],[a.maxX,a.maxY],[a.minX,a.maxY]]}return n0r(t,r)};const s0r={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:N2e,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return a0r.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=N2e,console.warn("Behavior lasso-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(e){var t=this.lasso,r=e.item;r||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates("dragstart"),t||(t=this.createLasso()),this.dragging=!0,this.originPoint={x:e.x,y:e.y},this.points.push(this.originPoint),t.show())},onDragMove:function(e){!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push({x:e.x,y:e.y}),this.updateLasso(e))},onDragEnd:function(e){!this.lasso&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var e=this.points,t=[];return e.length&&(e.forEach(function(r,i){i===0?t.push(["M",r.x,r.y]):t.push(["L",r.x,r.y])}),t.push(["L",e[0].x,e[0].y])),t},clearStates:function(e){e===void 0&&(e="canvas:click");var t=this,r=t.graph,i=t.selectedState,a=t.shouldDeselect,o=r.findAllByState("node",i),s=r.findAllByState("edge",i);(!a||a({action:e,nodes:o,edges:s}))&&(o.forEach(function(l){return r.setItemState(l,i,!1)}),s.forEach(function(l){return r.setItemState(l,i,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],r.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var e=this,t=this,r=t.graph,i=t.shouldUpdate,a=this.points.map(function(h){return[r.getCanvasByPoint(h.x,h.y).x,r.getCanvasByPoint(h.x,h.y).y]}),o=this.selectedState,s=[],l=[];r.getNodes().forEach(function(h){if(!!h.isVisible()&&o0r(h,a)&&i(h,"select",e)){s.push(h);var c=h.getModel();l.push(c.id),r.setItemState(h,o,!0)}});var u=[];this.includeEdges&&s.forEach(function(h){var c=h.getOutEdges();c.forEach(function(f){if(!!f.isVisible()){var d=f.getModel(),v=d.source,p=d.target;l.includes(v)&&l.includes(p)&&i(f,"select",e)&&(u.push(f),r.setItemState(f,e.selectedState,!0))}})}),this.selectedEdges=u,this.selectedNodes=s,this.onSelect&&this.onSelect(s,u),r.emit("nodeselectchange",{selectedItems:{nodes:s,edges:u},select:!0})},createLasso:function(){var e=this,t=e.graph.get("delegateGroup").addShape("path",{attrs:ve({path:[]},e.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(e){var t=this;this.lasso.attr({path:t.getLassoPath()})},onKeyDown:function(e){var t=e.key;!t||(t.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}};var k2e="click",l0r=["click","drag"],F2e=void 0,u0r=["shift","ctrl","control","alt","meta",void 0];const h0r={getDefaultCfg:function(){return{trigger:k2e,key:F2e,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var e=this;l0r.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=k2e,console.warn("Behavior create-edge \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click'\uFF0C'drag'")),e.key&&u0r.indexOf(e.key.toLowerCase())===-1&&(e.trigger=F2e,console.warn("Behavior create-edge \u7684 key \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'shift'\uFF0C'ctrl'\uFF0C'alt'\uFF0C'control'\uFF0C\u6216 undefined"));var t;return e.trigger==="drag"?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:e.trigger==="click"&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),e.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(e){var t=this;if(!(t.key&&!t.keydown)){var r=e.item;(!r||r.getID()===t.source||r.getType()!=="node")&&t.cancelCreating({item:t.edge,x:e.x,y:e.y})}},onClick:function(e){var t=this;if(!(t.key&&!t.keydown)){var r=e.item,i=t.graph,a=r.getModel(),o=t.getEdgeConfig;if(t.addingEdge&&t.edge){if(!t.shouldEnd(e,t))return;var s=void 0;o&&nl(o)?s=o({source:t.source,target:a.id},t):s=t.edgeConfig;var l=ve({target:a.id},s);if(t.source===a.id&&(l.type="loop"),i.emit("beforecreateedge",{}),i.updateItem(t.edge,l,!1),i.get("enabledStack")){var u=ve(ve({},t.edge.getModel()),{itemType:"edge"}),h={};h.edges=[u],i.pushStack("add",{before:{},after:h})}i.emit("aftercreateedge",{edge:t.edge}),t.edge.getKeyShape().set("capture",!0),t.edge=null,t.addingEdge=!1}else{if(!t.shouldBegin(e,t))return;var s=void 0;o&&nl(o)?s=o({source:a.id,target:a.id},t):s=t.edgeConfig,t.edge=i.addItem("edge",ve({source:a.id,target:a.id},s),!1),t.source=a.id,t.addingEdge=!0,t.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(e){var t=this;if(!(t.key&&!t.keydown)){t.edge&&t.edge.destroyed&&t.cancelCreating({item:t.edge});var r={x:e.x,y:e.y};if(!t.graph.findById(t.source)){t.addingEdge=!1;return}t.addingEdge&&t.edge&&t.graph.updateItem(t.edge,{target:r},!1)}},cancelCreating:function(e){var t,r,i=this;if(!(i.key&&!i.keydown)){var a=i.graph,o=e.item;if(i.addingEdge&&(i.edge===o||((r=(t=e.target)===null||t===void 0?void 0:t.isCanvas)===null||r===void 0?void 0:r.call(t)))){i.edge&&!i.edge.destroyed&&a.removeItem(i.edge,!1),i.edge=null,i.addingEdge=!1;return}}},onKeyDown:function(e){var t=this,r=e.key;!r||(r.toLowerCase()===t.key.toLowerCase()?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.addingEdge&&e.edge&&(e.graph.removeItem(e.edge,!1),e.addingEdge=!1,e.edge=null),this.keydown=!1}};var B2e="ctrl",c0r=["shift","ctrl","alt","control"],f0r="1";const d0r={getDefaultCfg:function(){return{trigger:B2e,combinedKey:f0r,functionName:"fitView",functionParams:[]}},getEvents:function(){return c0r.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=B2e,console.warn("Behavior shortcuts-fit-view \u7684 trigger \u53C2\u6570 '".concat(this.trigger,"' \u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(e){var t=e.key;if(!!t){var r=this.trigger.toLowerCase(),i=t.toLowerCase();this.triggerKeydown||(i===r||i==="control"&&r==="ctrl"||i==="ctrl"&&r==="control"?this.triggerKeydown=!0:this.triggerKeydown=!1);var a=this.graph;if(!a[this.functionName])return console.warn("Behavior shortcuts-fit-view \u7684 functionName \u53C2\u6570 '".concat(this.functionName,"' \u4E0D\u5408\u6CD5\uFF0C\u5B83\u4E0D\u662F Graph \u7684\u4E00\u4E2A\u51FD\u6570\u540D")),{};if(this.triggerKeydown&&!this.combinedKey){this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]();return}var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(i===o||i==="control"&&o==="ctrl"||i==="ctrl"&&o==="control")&&(this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]())}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}};var v0r=["shift","ctrl","alt","control","meta"];const p0r={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return(!this.zoomKey||v0r.indexOf(this.zoomKey)===-1)&&(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(e){var t=this;if(!!this.allowDrag(e)){var r=this.graph,i=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];i.includes("control")&&i.push("ctrl");var a=i.some(function(V){return e["".concat(V,"Key")]});if(a){var o=r.get("canvas"),s=o.getPointByClient(e.clientX,e.clientY),l=r.getZoom();e.wheelDelta>0?l=l+l*.05:l=l-l*.05,r.zoomTo(l,{x:s.x,y:s.y})}else{var u=e.deltaX||e.movementX,h=e.deltaY||e.movementY;!h&&navigator.userAgent.indexOf("Firefox")>-1&&(h=-e.wheelDelta*125/3);var c=this.graph.get("width"),f=this.graph.get("height"),d=this.graph.get("canvas").getCanvasBBox(),v=this.scalableRange,p=this.scalableRange;v<1&&v>-1&&(v=c*v,p=f*p);var g=d.minX,m=d.maxX,y=d.minY,_=d.maxY;u>0?m<-v?u=0:m-u<-v&&(u=m+v):u<0&&(g>c+v?u=0:g-u>c+v&&(u=g-(c+v))),h>0?_<-p?h=0:_-h<-p&&(h=_+p):h<0&&(y>f+p?h=0:y-h>f+p&&(h=y-(f+p))),this.get("direction")==="x"?h=0:this.get("direction")==="y"&&(u=0),r.translate(-u,-h)}e.preventDefault();var x=this.get("enableOptimize");if(x){var S=this.get("optimizeZoom"),w=this.get("optimized"),b=r.getNodes(),E=r.getEdges(),T=b.length,C=E.length;if(!w){for(var A=0;A{const{item:r}=t;if(t.target&&t.target.isCanvas&&t.target.isCanvas()||!r)return;const i=r.getType(),a=r.getModel();if(i&&a&&i==="node")return this.isCollpased(a.id)?`
    • \u5C55\u5F00
    `:`
    • \u6298\u53E0
    `},handleMenuClick:(t,r)=>{switch(t.id.split("-")[0]){case"hide":this.hideItem(r);break;case"expand":this.expandNode(r);break;case"collapse":this.collapseNode(r);break;case"show":this.showItem(r);break}},offsetX:26,offsetY:0,itemTypes:["node","edge","canvas"]})}_getGraphConfig(e){const t={speed:120,maxIteration:83,tick:()=>{this.refreshPositions()}},r={type:"fruchterman",gravity:5},i={},a={type:"line",style:{endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:"#e0e0e0"},lineWidth:.5},labelCfg:{autoRotate:!0,style:{fontSize:4,fill:"#333"}}},o={default:["drag-canvas","zoom-canvas","drag-node"]},s=this._getContextMenu(),l=[new JC.ToolBar,s],u="#b4d6ff",h={lineWidth:3,stroke:u},c={stroke:u,shadowColor:u,shadowBlur:5,endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:u}},f=(v="knowledgeGraph")=>{const p=document.querySelector(`#${v}`);return{container:v,width:p.scrollWidth,height:p.scrollHeight,plugins:l,modes:o,layout:{...r,...t},defaultNode:i,defaultEdge:a,nodeStateStyles:{hover:h},edgeStateStyles:{hover:c}}};if(!e)return this._setToolBarStyle(),f();e.container=e.container||"knowledgeGraph";const d=typeof e.container=="string"?document.querySelector(`#${e.container}`):e.container;return e.width=e.width||d.scrollWidth,e.height=e.height||d.scrollHeight,e.layout={...r,...e.layout||{},...e.animate!==!1?t:{}},e.defaultNode={...i,...e.defaultNode||{}},e.defaultEdge={...a,...e.defaultEdge||{}},e.modes={default:[e.dragCanvas!==!1&&"drag-canvas",e.zoomCanvas!==!1&&"zoom-canvas",e.dragNode!==!1&&"drag-node"]},e.nodeStateStyles={hover:{...h,...e.nodeHighlightStyle||{}}},e.edgeStateStyles={hover:{...c,...e.edgeHighlightStyle||{}}},e.showToolBar!==!1&&(e.plugins=[new JC.ToolBar],this._setToolBarStyle()),e.showContextMenu!==!1&&(e.plugins=[...e.plugins||[],s],this._setToolBarStyle()),e}changeSize(e,t){return this.graph.changeSize(e,t)}autoResize(){const e=this.getContainer();window.addEventListener("resize",()=>{const t=e.scrollWidth,r=e.scrollHeight;this.graph.changeSize(t,r),this.graph.refresh()})}zoom(e,t,r,i){this.graph.zoom(e,t,r,i)}zoomTo(e,t,r,i){this.graph.zoomTo(e,t,r,i)}fitView(e,t,r,i){this.graph.fitView(e,t,r,i)}fitCenter(e,t){this.graph.fitCenter(e,t)}getGraphCenterPoint(){return this.graph.getGraphCenterPoint()}getViewPortCenterPoint(){return this.graph.getViewPortCenterPoint()}getZoom(){return this.graph.getZoom()}getMinZoom(){return this.graph.getMinZoom()}setMinZoom(e){this.graph.setMinZoom(e)}getMaxZoom(){return this.graph.getMaxZoom()}setMaxZoom(e){this.graph.setMaxZoom(e)}getWidth(){return this.graph.getWidth()}getHeight(){return this.graph.getHeight()}setCenter(e){var t=this.graph.getWidth()/2,r=this.graph.getHeight()/2,i=this.graph.getCanvasByPoint(e.x,e.y);this.graph.translate(t-i.x,r-i.y)}_setToolBarStyle(){cT.exports(` .g6-component-toolbar li[code='redo'], .g6-component-toolbar li[code='undo'], .g6-component-toolbar li[code='realZoom'] { display: none; } .g6-component-contextmenu { position: absolute; z-index: 2; list-style-type: none; border-radius: 6px; font-size: 14px; width: fit-content; transition: opacity .2s; text-align: center; box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.6); border: 0px; } .g6-component-contextmenu ul { padding-left: 0px; margin: 0; } .g6-component-contextmenu li { cursor: pointer; list-style-type: none; list-style: none; margin-left: 0; line-height: 38px; padding: 0px 35px; } .g6-component-contextmenu li:hover { color: #333; background: #aaaaaa45; } `)}highlightNode(e=this.graph){function t(){e.setAutoPaint(!1),e.getNodes().forEach(function(r){e.clearItemStates(r)}),e.paint(),e.setAutoPaint(!0)}e.on("node:mouseenter",function(r){const i=r.item;e.setAutoPaint(!1),e.getNodes().forEach(function(a){e.clearItemStates(a)}),e.setItemState(i,"hover",!0),e.paint(),e.setAutoPaint(!0)}),e.on("node:mouseleave",t)}highlightEdge(e=this.graph){function t(){e.setAutoPaint(!1),e.getEdges().forEach(function(r){e.clearItemStates(r)}),e.paint(),e.setAutoPaint(!0)}e.on("edge:mouseenter",function(r){const i=r.item;e.setAutoPaint(!1),e.getNodes().forEach(function(a){e.clearItemStates(a)}),e.setItemState(i,"hover",!0),e.paint(),e.setAutoPaint(!0)}),e.on("edge:mouseleave",t)}setData(e,t=this.graph){this.data?t.changeData(e):t.data(e),this.data=e}render(e=this.graph){return e.render()}updateGraph(e,t=this.graph){this.data=e,t.changeData(e)}refresh(e=this.graph){e.refresh()}getContainer(e=this.graph){return e.getContainer()}getCanvas(e=this.graph){return e.get("canvas")}getNodes(e=this.graph){return e.getNodes()}getEdges(e=this.graph){return e.getEdges()}getNeighbors(e,t,r=this.graph){return r.getNeighbors(e,t)}findById(e,t=this.graph){return t.findById(e)}find(e,t,r=this.graph){return r.find(e,t)}findAll(e,t,r=this.graph){return r.findAll(e,t)}getEdgesByNode(e){return e.getEdges()}getInEdges(e){return e.getInEdges()}getOutEdges(e){return e.getOutEdges()}getSourceByEdge(e){return e.getSource()}getTargetByEdge(e){return e.getTarget()}expandNode(e){const t=e.getModel().id;this._expandCollapseNode(this.collpasedData[t],"show"),delete this.collpasedData[t]}collapseNode(e){const t=e.getModel().id,r=[];this._collapseFunc(e,r),this.collpasedData[t]=r,this._expandCollapseNode(r)}isCollpased(e){return!!this.collpasedData[e]}_collapseFunc(e,t=[]){const r=this.getNeighbors(e,"target"),i=this.getNeighbors(e,"source");for(let a=0;a{t==="hide"?this.hideItem(r.id):(this.showItem(r.id),this.isCollpased(r.id)&&delete this.collpasedData[r.id]),r.children&&this._expandCollapseNode(r.children,t)})}showItem(e,t,r=this.graph){r.showItem(e,t)}hideItem(e,t,r=this.graph){r.hideItem(e,t)}show(e){e.show()}hide(e){e.hide()}changeVisibility(e,t){e.changeVisibility(t)}isVisible(e){return e.isVisible()}getModel(e){return e.getModel()}addItem(e,t,r=this.graph){r.addItem(e,t)}removeItem(e,t=this.graph){t.removeItem(e)}updateItem(e,t,r=this.graph){r.updateItem(e,t)}refreshItem(e,t=this.graph){t.refreshItem(e)}refreshPositions(e=this.graph){e.refreshPositions()}on(e,t,r=this.graph){r.on(e,t)}off(e,t,r=this.graph){r.off(e,t)}toDataURL(e,t,r=this.graph){r.toDataURL(e,t)}bindNodeDefaultDragEvent(e=this.graph){e.on("node:dragstart",function(t){G2e(t)}),e.on("node:drag",function(t){G2e(t)}),e.on("node:dragend",function(t){t.item.get("model").fx=null,t.item.get("model").fy=null})}stopDefaultEventPropagation(e=this.graph){e.on("click",function(t){t.stopPropagation()}),e.on("mousedown",function(t){t.stopPropagation()}),e.on("mouseover",function(t){t.stopPropagation()}),e.on("mouseout",function(t){t.stopPropagation()})}clear(e=this.graph){e.clear()}destroy(e=this.graph){e.destroy()}}function G2e(n){const e=n.item.get("model");return e.fx=n.x,e.fy=n.y,e.x=n.x,e.y=n.y,e}var yte={exports:{}};(function(n,e){var t=200,r="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",o="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",h="[object Function]",c="[object GeneratorFunction]",f="[object Map]",d="[object Number]",v="[object Object]",p="[object Promise]",g="[object RegExp]",m="[object Set]",y="[object String]",_="[object Symbol]",x="[object WeakMap]",S="[object ArrayBuffer]",w="[object DataView]",b="[object Float32Array]",E="[object Float64Array]",T="[object Int8Array]",C="[object Int16Array]",A="[object Int32Array]",M="[object Uint8Array]",I="[object Uint8ClampedArray]",R="[object Uint16Array]",k="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,G=/\w*$/,W=/^\[object .+?Constructor\]$/,z=/^(?:0|[1-9]\d*)$/,V={};V[a]=V[o]=V[S]=V[w]=V[s]=V[l]=V[b]=V[E]=V[T]=V[C]=V[A]=V[f]=V[d]=V[v]=V[g]=V[m]=V[y]=V[_]=V[M]=V[I]=V[R]=V[k]=!0,V[u]=V[h]=V[x]=!1;var q=typeof at=="object"&&at&&at.Object===Object&&at,Y=typeof self=="object"&&self&&self.Object===Object&&self,le=q||Y||Function("return this")(),j=e&&!e.nodeType&&e,Q=j&&!0&&n&&!n.nodeType&&n,ie=Q&&Q.exports===j;function oe(Te,gt){return Te.set(gt[0],gt[1]),Te}function se(Te,gt){return Te.add(gt),Te}function me(Te,gt){for(var B=-1,O=Te?Te.length:0;++B-1}function Me(Te,gt){var B=this.__data__,O=Ds(B,Te);return O<0?B.push([Te,gt]):B[O][1]=gt,this}ue.prototype.clear=xe,ue.prototype.delete=ce,ue.prototype.get=pe,ue.prototype.has=we,ue.prototype.set=Me;function nt(Te){var gt=-1,B=Te?Te.length:0;for(this.clear();++gt-1&&Te%1==0&&Te-1&&Te%1==0&&Te<=i}function Vv(Te){var gt=typeof Te;return!!Te&&(gt=="object"||gt=="function")}function hf(Te){return!!Te&&typeof Te=="object"}function _u(Te){return uf(Te)?qa(Te):js(Te)}function $v(){return[]}function _g(){return!1}n.exports=Hm})(yte,yte.exports);const T0r=yte.exports;class mte{constructor(e,t="G6"){this.graph=null,this.config=T0r(e),this.graphRender=null,this.type=t,this.createGraphRender(this.type),this.config=this.graphRender._getGraphConfig(this.config),this.createGraph(this.config),this.CLASS_NAME="SuperMap.KnowledgeGraph"}static dataFromGraphMap(e,t){return rxe(e,t)}static dataFromKnowledgeGraphQuery(e){return rxe(e)}handleNodeStatus(e){const{expand:t,collapse:r,hidden:i}=e;this.expandNodes(t),this.collapseNodes(r),this.hideNodes(i)}expandNodes(e){!e||e.forEach(t=>{this.expandNode(t+"")})}collapseNodes(e){!e||e.forEach(t=>{this.collapseNode(t+"")})}hideNodes(e){!e||e.forEach(t=>{this.hideItem(t+"")})}createGraphRender(e){e==="G6"&&(this.graphRender=new E0r)}createGraph(e){const t=this.initGraph(e);return this.graph=t,this.autoResize(),t}getGraph(){return this.graph}autoResize(){this.config&&this.config.autoResize!==!1&&this.graphRender.autoResize()}zoom(e,t,r,i){this.graphRender.zoom(e,t,r,i)}zoomTo(e,t,r,i){this.graphRender.zoomTo(e,t,r,i)}fitView(e,t,r,i){this.graphRender.fitView(e,t,r,i)}fitCenter(e,t){this.graphRender.fitCenter(e,t)}getGraphCenterPoint(){return this.graphRender.getGraphCenterPoint()}getViewPortCenterPoint(){return this.graphRender.getViewPortCenterPoint()}getZoom(){return this.graphRender.getZoom()}getMinZoom(){return this.graphRender.getMinZoom()}setMinZoom(e){this.graphRender.setMinZoom(e)}getMaxZoom(){return this.graphRender.getMaxZoom()}setMaxZoom(e){this.graphRender.setMaxZoom(e)}getWidth(){return this.graphRender.getWidth()}getHeight(){return this.graphRender.getHeight()}initGraph(e){const t=this.graphRender.initGraph(e);this.graph=t;const r=()=>{this.config.zoom!==void 0&&this.zoom(this.config.zoom),this.config.center!==void 0&&this.graphRender.setCenter({x:this.config.center[0],y:this.config.center[1]})};return this.graph.on("beforelayout",r),t}setData(e,t=this.graph){e=e||{nodes:[],edges:[]},this.config&&this.config.nodeLabelMaxWidth&&(e.nodes=this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth,e.nodes)),this.graphRender.setData(e,t),this.render(t),this.data=e}render(e=this.graph){e&&this.graphRender.render(e)}updateGraph(e,t=this.graph){t&&this.graphRender.updateGraph(e,t)}refresh(){return this.graphRender.refresh()}changeSize(e,t){return this.graphRender.changeSize(e,t)}resize(e,t){this.graphRender.changeSize(e,t),this.graphRender.refresh()}getContainer(){return this.graphRender.getContainer()}getCanvas(){return this.graphRender.getCanvas()}getNodes(){return this.graphRender.getNodes()}getEdges(){return this.graphRender.getEdges()}getNeighbors(e,t){return this.graphRender.getNeighbors(e,t)}findById(e){return this.graphRender.findById(e)}find(e,t){return this.graphRender.find(e,t)}findAll(e,t){return this.graphRender.findAll(e,t)}getEdgesByNode(e){return this.graphRender.getEdgesByNode(e)}getInEdges(e){return this.graphRender.getInEdges(e)}getOutEdges(e){return this.graphRender.getOutEdges(e)}getSourceByEdge(e){return this.graphRender.getSourceByEdge(e)}getTargetByEdge(e){return this.graphRender.getTargetByEdge(e)}expandNode(e){const t=this.findById(e);t&&this.graphRender.expandNode(t)}collapseNode(e){const t=this.findById(e);t&&this.graphRender.collapseNode(t)}showItem(e,t){this.graphRender.showItem(e,t)}hideItem(e,t){this.graphRender.hideItem(e,t)}show(e){this.graphRender.show(e)}hide(e){this.graphRender.hide(e)}changeVisibility(e,t){this.graphRender.changeVisibility(e,t)}isVisible(e){return this.graphRender.isVisible(e)}getModel(e){return this.graphRender.getModel(e)}addItem(e,t){return this.graphRender.addItem(e,t)}removeItem(e){return this.graphRender.removeItem(e)}updateItem(e,t){return this.graphRender.updateItem(e,t)}refreshItem(e){return this.graphRender.refreshItem(e)}refreshPositions(){return this.graphRender.refreshPositions()}on(e,t){this.graphRender.on(e,t)}off(e,t){this.graphRender.off(e,t)}toDataURL(e,t){this.graphRender.toDataURL(e,t)}nodeLabelOpenEllipsis(e,t){return t?e?t.map(r=>{const i=r.labelCfg&&r.labelCfg.fontSize||this.defaultNode&&this.defaultNode.labelCfg&&this.defaultNode.labelCfg.fontSize||14;return r.label=C0r(r.label,e,i),r}):t:[]}clear(e=this.graph){e&&e.clear()}destroy(e=this.graph){e&&e.destroy()}}function C0r(n,e,t){const r=s=>{let l=0;for(let u=0;u0&&s.charCodeAt(u)<128?l++:l+=2;return l},i=t*1;e=e*1.6;const a=r(n)*i,o="\u2026";if(a>e){const s=Math.floor((e-20)/i),l=n.substring(0,s);return(n.substring(s).length+o.length)*i>e?l+` `+n.substring(s,s+s-2)+o:n.substring(s).length==0?l:l+` `+n.substring(s)}else return n}ae.Lang=rv;ae.i18n=ae.Lang.i18n;ae.Util={...ae.Util,...H};ae.Browser=Ane;ae.INCHES_PER_UNIT=Ii;ae.METERS_PER_INCH=Fn;ae.DOTS_PER_INCH=eE;ae.IS_GECKO=Hat;ae.setCORS=eot;ae.isCORS=DOe;ae.setRequestTimeout=tot;ae.getRequestTimeout=tK;ae.FetchRequest=li;ae.inherit=Vat;ae.mixin=Cne;ae.String=ad;ae.Number=G8;ae.Function=UR;ae.Array=$at;ae.Date=Yat;ae.Event=Ul;ae.Bounds=po;ae.Credential=z8;ae.Events=y0;ae.Feature=LOe;ae.Geometry=rg;ae.Geometry3D=qat;ae.Pixel=WE;ae.Size=a3;ae.Feature.Vector=sc;ae.Geometry.Collection=O0;ae.Geometry.Curve=Mne;ae.Geometry.GeoText=O_;ae.Geometry.LinearRing=tv;ae.Geometry.LineString=Vl;ae.Geometry.MultiLineString=_E;ae.Geometry.MultiPoint=HE;ae.Geometry.MultiPolygon=A1;ae.Geometry.Point=Ki;ae.Geometry.Polygon=_p;ae.Geometry.Rectangle=IOe;ae.Components.Chart=C4t;ae.Components.ChartViewModel=NGe;ae.Components.MessageBox=UNe;ae.Components.AttributesPopContainer=L4t;ae.Components.CityTabsPage=P4t;ae.Components.CommonContainer=A4t;ae.Components.DropDownBox=I4t;ae.Components.IndexTabsPageContainer=FGe;ae.Components.NavTabsPage=O4t;ae.Components.PaginationContainer=R4t;ae.Components.PopContainer=kGe;ae.Components.Select=M4t;ae.Components.TemplateBase=bw;ae.Components.FileReaderUtil=AQ;ae.TimeControlBase=POe;ae.TimeFlowControl=Jat;ae.Format=ae.Format||Ine;ae.Format.GeoJSON=uh;ae.Format.JSON=yz;ae.Format.WKT=Zat;ae.iManager=rot;ae.iManagerCreateNodeParam=rK;ae.iManagerServiceBase=NOe;ae.iPortal=not;ae.iPortalAddDataParam=UOe;ae.iPortalAddResourceParam=nK;ae.iPortalDataConnectionInfoParam=$Oe;ae.iPortalDataMetaInfoParam=iK;ae.iPortalDataStoreInfoParam=VOe;ae.iPortalQueryParam=kOe;ae.iPortalQueryResult=FOe;ae.iPortalRegisterServiceParam=zOe;ae.iPortalResource=BOe;ae.iPortalServiceBase=mz;ae.iPortalShareEntity=iot;ae.iPortalShareParam=GOe;ae.iPortalUser=aot;ae.AddressMatchService=jOe;ae.AggregationParameter=Lne;ae.AreaSolarRadiationParameters=iB;ae.AreaSolarRadiationService=YOe;ae.BucketAggParameter=XOe;ae.BufferAnalystParameters=Pne;ae.BufferAnalystService=ZOe;ae.BufferDistance=aK;ae.BuffersAnalystJobsParameter=KOe;ae.BuffersAnalystJobsService=aB;ae.BufferSetting=qOe;ae.BurstPipelineAnalystParameters=JOe;ae.BurstPipelineAnalystService=QOe;ae.ChartFeatureInfoSpecsService=eRe;ae.ChartQueryFilterParameter=tRe;ae.ChartQueryParameters=rRe;ae.ChartQueryService=nRe;ae.ClipParameter=sot;ae.ColorDictionary=iRe;ae.CommonServiceBase=ra;ae.ComputeWeightMatrixParameters=oRe;ae.ComputeWeightMatrixService=sRe;ae.CreateDatasetParameters=xK;ae.DataFlowService=lRe;ae.DataReturnOption=_z;ae.DatasetBufferAnalystParameters=oK;ae.DatasetInfo=uRe;ae.DatasetOverlayAnalystParameters=sK;ae.DatasetService=jRe;ae.DatasetSurfaceAnalystParameters=lK;ae.DatasetThiessenAnalystParameters=uK;ae.DatasourceConnectionInfo=One;ae.DatasourceService=cRe;ae.DensityAnalystService=fRe;ae.DensityKernelAnalystParameters=hK;ae.EditFeaturesParameters=cK;ae.EditFeaturesService=V8;ae.FacilityAnalyst3DParameters=EI;ae.FacilityAnalystSinks3DParameters=dRe;ae.FacilityAnalystSinks3DService=vRe;ae.FacilityAnalystSources3DParameters=pRe;ae.FacilityAnalystSources3DService=gRe;ae.FacilityAnalystStreamParameters=yRe;ae.FacilityAnalystStreamService=mRe;ae.FacilityAnalystTracedown3DParameters=_Re;ae.FacilityAnalystTracedown3DService=xRe;ae.FacilityAnalystTraceup3DParameters=SRe;ae.FacilityAnalystTraceup3DService=wRe;ae.FacilityAnalystUpstream3DParameters=bRe;ae.FacilityAnalystUpstream3DService=ERe;ae.FieldParameters=TRe;ae.FieldsFilter=KR;ae.FieldStatisticService=ARe;ae.FieldStatisticsParameters=CRe;ae.FilterParameter=Of;ae.FindClosestFacilitiesParameters=MRe;ae.FindClosestFacilitiesService=IRe;ae.FindLocationParameters=LRe;ae.FindLocationService=PRe;ae.FindMTSPPathsParameters=ORe;ae.FindMTSPPathsService=RRe;ae.FindPathParameters=DRe;ae.FindPathService=NRe;ae.FindServiceAreasParameters=kRe;ae.FindServiceAreasService=FRe;ae.FindTSPPathsParameters=BRe;ae.FindTSPPathsService=GRe;ae.GenerateSpatialDataParameters=zRe;ae.GenerateSpatialDataService=URe;ae.GeoCodingParameter=WOe;ae.GeoDecodingParameter=HOe;ae.GeoHashGridAggParameter=lot;ae.GeometryBatchAnalystService=aNe;ae.GeometryBufferAnalystParameters=U8;ae.GeometryOverlayAnalystParameters=$8;ae.GeometrySurfaceAnalystParameters=VRe;ae.GeometryThiessenAnalystParameters=W8;ae.GeoprocessingService=$Re;ae.GeoRelationAnalystParameters=WRe;ae.GeoRelationAnalystService=HRe;ae.GetFeaturesByBoundsParameters=xE;ae.GetFeaturesByBoundsService=XRe;ae.GetFeaturesByBufferParameters=fK;ae.GetFeaturesByBufferService=YRe;ae.GetFeaturesByGeometryParameters=qRe;ae.GetFeaturesByGeometryService=ZRe;ae.GetFeaturesByIDsParameters=KRe;ae.GetFeaturesByIDsService=JRe;ae.GetFeaturesBySQLParameters=VR;ae.GetFeaturesBySQLService=H8;ae.GetFeaturesParametersBase=TI;ae.GetFeaturesServiceBase=CI;ae.GetFieldsService=QRe;ae.GetGridCellInfosParameters=eDe;ae.GetGridCellInfosService=tDe;ae.GetLayersInfoService=lDe;ae.Grid=aDe;ae.HillshadeParameter=wot;ae.Image=oDe;ae.ImageCollectionService=ANe;ae.ImageGFAspect=jne;ae.ImageGFHillShade=Hne;ae.ImageGFOrtho=Xne;ae.ImageGFSlope=Yne;ae.ImageRenderingRule=h3;ae.ImageSearchParameter=Wne;ae.ImageService=MNe;ae.ImageStretchOption=cM;ae.InterpolationAnalystParameters=Dy;ae.InterpolationAnalystService=dDe;ae.InterpolationDensityAnalystParameters=hDe;ae.InterpolationIDWAnalystParameters=cDe;ae.InterpolationKrigingAnalystParameters=fDe;ae.InterpolationRBFAnalystParameters=uDe;ae.JoinItem=nDe;ae.KernelDensityJobParameter=vDe;ae.KernelDensityJobsService=oB;ae.LabelImageCell=uot;ae.LabelMatrixCell=Lz;ae.LabelMixedTextStyle=wz;ae.LabelSymbolCell=hot;ae.LabelThemeCell=cot;ae.LayerStatus=fot;ae.LinkItem=dot;ae.MappingParameters=Am;ae.MapService=dK;ae.MathExpressionAnalysisParameters=vK;ae.MathExpressionAnalysisService=pDe;ae.MeasureParameters=gDe;ae.MeasureService=yDe;ae.MetricsAggParameter=oot;ae.NDVIParameter=Sot;ae.NetworkAnalystServiceBase=Bd;ae.OutputSetting=Cm;ae.OverlapDisplayedOptions=vot;ae.OverlayAnalystParameters=Rne;ae.OverlayAnalystService=mDe;ae.OverlayGeoJobParameter=_De;ae.OverlayGeoJobsService=sB;ae.PointWithMeasure=pz;ae.ProcessingServiceBase=Mm;ae.QueryByBoundsParameters=xDe;ae.QueryByBoundsService=SDe;ae.QueryByDistanceParameters=wDe;ae.QueryByDistanceService=bDe;ae.QueryByGeometryParameters=EDe;ae.QueryByGeometryService=TDe;ae.QueryBySQLParameters=ZR;ae.QueryBySQLService=j8;ae.DatasetMinDistanceAnalystParameters=ADe;ae.MinDistanceAnalystService=MDe;ae.TerrainCutFillCalculationParameters=gK;ae.TerrainCutFillCalculationService=IDe;ae.terrainAnalystSetting=_ot;ae.TerrainAspectCalculationParameters=yK;ae.TerrainAspectCalculationService=LDe;ae.TerrainSlopeCalculationParameters=mK;ae.TerrainSlopeCalculationService=PDe;ae.GeometryMinDistanceAnalystParameters=pK;ae.ConvexHullAnalystParameters=pot;ae.ConvexHullAnalystService=ODe;ae.TraceAnalystParameters=RDe;ae.TraceAnalystService=DDe;ae.ConnectedEdgesAnalystParameters=NDe;ae.ConnectedEdgesAnalystService=kDe;ae.GetLayersLegendInfoParameters=got;ae.GetLayersLegendInfoService=FDe;ae.QueryParameters=OS;ae.QueryService=BDe;ae.RasterFunctionParameter=Vne;ae.Route=gz;ae.RouteCalculateMeasureParameters=GDe;ae.RouteCalculateMeasureService=zDe;ae.RouteLocatorParameters=UDe;ae.RouteLocatorService=VDe;ae.ServerColor=Js;ae.ServerFeature=u3;ae.ServerGeometry=Vo;ae.ServerStyle=gs;ae.ServerTextStyle=md;ae.ServerTheme=iDe;ae.SetDatasourceParameters=$De;ae.SetLayerInfoParameters=yot;ae.SetLayerInfoService=WDe;ae.SetLayersInfoParameters=mot;ae.SetLayersInfoService=HDe;ae.SetLayerStatusParameters=jDe;ae.SetLayerStatusService=XDe;ae.SingleObjectQueryJobsParameter=YDe;ae.SingleObjectQueryJobsService=lB;ae.Sortby=jE;ae.SpatialAnalystBase=Hu;ae.StopQueryParameters=qDe;ae.StopQueryService=ZDe;ae.SummaryAttributesJobsParameter=KDe;ae.SummaryAttributesJobsService=uB;ae.SummaryMeshJobParameter=JDe;ae.SummaryMeshJobsService=hB;ae.SummaryRegionJobParameter=QDe;ae.SummaryRegionJobsService=cB;ae.SupplyCenter=kne;ae.SurfaceAnalystParameters=xz;ae.SurfaceAnalystParametersSetting=hRe;ae.SurfaceAnalystService=eNe;ae.TerrainCurvatureCalculationParameters=_K;ae.TerrainCurvatureCalculationService=tNe;ae.Theme=R_;ae.ThemeDotDensity=Cz;ae.ThemeFlow=Fne;ae.ThemeGraduatedSymbol=Az;ae.ThemeGraduatedSymbolStyle=qR;ae.ThemeGraph=Tz;ae.ThemeGraphAxes=jR;ae.ThemeGraphItem=Ez;ae.ThemeGraphSize=XR;ae.ThemeGraphText=YR;ae.ThemeGridRange=Bne;ae.ThemeGridRangeItem=Oz;ae.ThemeGridUnique=Gne;ae.ThemeGridUniqueItem=Rz;ae.ThemeLabel=s3;ae.ThemeLabelAlongLine=WR;ae.ThemeLabelBackground=HR;ae.ThemeLabelItem=Sz;ae.ThemeLabelText=$R;ae.ThemeLabelUniqueItem=zne;ae.ThemeMemoryData=xot;ae.ThemeOffset=o_;ae.ThemeParameters=rNe;ae.ThemeRange=Iz;ae.ThemeRangeItem=Mz;ae.ThemeService=nNe;ae.ThemeUnique=bz;ae.ThemeUniqueItem=o3;ae.ThiessenAnalystParameters=Dne;ae.ThiessenAnalystService=iNe;ae.TilesetsService=oNe;ae.TopologyValidatorJobsParameter=sNe;ae.TopologyValidatorJobsService=fB;ae.TransferLine=Une;ae.TransferPathParameters=lNe;ae.TransferPathService=uNe;ae.TransferSolutionParameters=hNe;ae.TransferSolutionService=cNe;ae.TransportationAnalystParameter=$2;ae.TransportationAnalystResultSetting=aRe;ae.UGCLayer=Nne;ae.UGCMapLayer=rDe;ae.UGCSubLayer=l3;ae.UpdateDatasetParameters=SK;ae.UpdateEdgeWeightParameters=fNe;ae.UpdateEdgeWeightService=dNe;ae.UpdateTurnNodeWeightParameters=vNe;ae.UpdateTurnNodeWeightService=pNe;ae.Vector=sDe;ae.VectorClipJobsParameter=gNe;ae.VectorClipJobsService=dB;ae.WebPrintingJobContent=bNe;ae.WebPrintingJobCustomItems=yNe;ae.WebPrintingJobExportOptions=TNe;ae.WebPrintingJobImage=mNe;ae.WebPrintingJobLayers=$ne;ae.WebPrintingJobLayoutOptions=ENe;ae.WebPrintingJobLegendOptions=_Ne;ae.WebPrintingJobLittleMapOptions=xNe;ae.WebPrintingJobNorthArrowOptions=SNe;ae.WebPrintingJobParameters=bot;ae.WebPrintingJobScaleBarOptions=wNe;ae.WebPrintingService=CNe;ae.Online=Mot;ae.OnlineData=LNe;ae.OnlineQueryDatasParameter=Iot;ae.ServiceStatus=Tot;ae.DataItemType=Fat;ae.DataItemOrderBy=Cot;ae.FilterField=Aot;ae.OnlineServiceBase=INe;ae.Feature=ae.Feature||{};ae.Feature.Theme=am;ae.Feature.Theme.Bar=Bst;ae.Feature.Theme.Bar3D=Gst;ae.Feature.Theme.Circle=zst;ae.Feature.Theme.Graph=mw;ae.Feature.Theme.Line=Ust;ae.Feature.Theme.Pie=Vst;ae.Feature.Theme.Point=$st;ae.Feature.Theme.RankSymbol=zNe;ae.Feature.Theme.Ring=Wst;ae.Feature.Theme.ThemeVector=f3;ae.Feature.ShapeParameters=D_;ae.Feature.ShapeParameters.Circle=qne;ae.Feature.ShapeParameters.Image=kNe;ae.Feature.ShapeParameters.Label=Ib;ae.Feature.ShapeParameters.Line=VO;ae.Feature.ShapeParameters.Point=Fz;ae.Feature.ShapeParameters.Polygon=I1;ae.Feature.ShapeParameters.Rectangle=IK;ae.Feature.ShapeParameters.Sector=Bz;ae.Feature.ShapeFactory=Vn;ae.LevelRenderer=Gg;ae.KeyServiceParameter=Lot;ae.SecurityManager=xs;ae.ServerInfo=Pot;ae.TokenServiceParameter=Oot;ae.ThemeStyle=Ast;ae.CartoCSS=Pt;ae.ElasticSearch=Rot;ae.ArrayStatistic=pB;ae.ColorsPickerUtil=vB;ae.DataFormat=Ni;ae.ServerType=KP;ae.GeometryType=Lc;ae.QueryOption=dz;ae.JoinType=cat;ae.SpatialQueryMode=n3;ae.SpatialRelationType=fat;ae.MeasureMode=JZ;ae.Unit=Wl;ae.BufferRadiusUnit=nOe;ae.EngineType=dat;ae.ThemeGraphTextFormat=iOe;ae.ThemeGraphType=aOe;ae.GraphAxesTextDisplayMode=oOe;ae.GraduatedMode=B8;ae.RangeMode=vz;ae.ThemeType=vat;ae.ColorGradientType=i3;ae.TextAlignment=sOe;ae.FillGradientMode=pat;ae.AlongLineDirection=lOe;ae.LabelBackShape=uOe;ae.LabelOverLengthMode=hOe;ae.DirectionType=gat;ae.OverlayOperationType=fOe;ae.OutputType=dOe;ae.SideType=yat;ae.SupplyCenterType=mat;ae.TurnType=_at;ae.BufferEndType=cOe;ae.SmoothMethod=vOe;ae.SurfaceAnalystMethod=pOe;ae.DataReturnMode=gOe;ae.EditType=GR;ae.TransferTactic=yOe;ae.TransferPreference=mOe;ae.GridType=xat;ae.ColorSpaceType=Sat;ae.LayerType=wat;ae.UGCLayerType=bat;ae.StatisticMode=Eat;ae.PixelFormat=Tat;ae.SearchMode=Cat;ae.InterpolationAlgorithmType=Aat;ae.VariogramMode=_Oe;ae.Exponent=xOe;ae.ClientType=bne;ae.ChartType=Mat;ae.ClipAnalystMode=SOe;ae.AnalystAreaUnit=wOe;ae.AnalystSizeUnit=zR;ae.StatisticAnalystMode=bOe;ae.SummaryType=Ene;ae.TopologyValidatorRule=EOe;ae.BucketAggType=TOe;ae.MetricsAggType=COe;ae.GetFeatureMode=Iat;ae.RasterFunctionType=Tne;ae.ResourceType=Lat;ae.OrderBy=Pat;ae.OrderType=Oat;ae.SearchType=Rat;ae.AggregationTypes=Dat;ae.PermissionType=Nat;ae.EntityType=kat;ae.WebExportFormatType=Bat;ae.WebScaleOrientationType=Gat;ae.WebScaleType=zat;ae.WebScaleUnit=Uat;ae.KnowledgeGraph=mte;ae.BoundsType=AOe;ae.CellSizeType=MOe;var A0r=function(){function n(){this.disposed=!1}return n.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},n.prototype.disposeInternal=function(){},n}();const PV=A0r;var M0r=function(){function n(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}return n.prototype.preventDefault=function(){this.defaultPrevented=!0},n.prototype.stopPropagation=function(){this.propagationStopped=!0},n}();const Fm=M0r;function I0r(n,e,t){for(var r,i,a=t||f2,o=0,s=n.length,l=!1;o>1),i=+a(n[r],e),i<0?o=r+1:(s=r,l=!i);return l?o:~o}function f2(n,e){return n>e?1:n0){for(i=1;i0?i-1:i:n[i-1]-e0||t&&o===0)})}function ZA(){return!0}function RV(){return!1}function d2(){}function O0r(n){var e=!1,t,r,i;return function(){var a=Array.prototype.slice.call(arguments);return(!e||this!==i||!Iw(a,r))&&(e=!0,i=this,r=a,t=n.apply(this,arguments)),t}}var Ao=typeof Object.assign=="function"?Object.assign:function(n,e){if(n==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),r=1,i=arguments.length;r0:!1},e.prototype.removeEventListener=function(t,r){var i=this.listeners_&&this.listeners_[t];if(i){var a=i.indexOf(r);a!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[a]=d2,++this.pendingRemovals_[t]):(i.splice(a,1),i.length===0&&delete this.listeners_[t]))}},e}(PV);const eL=D0r,Ci={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function pa(n,e,t,r,i){if(r&&r!==n&&(t=t.bind(r)),i){var a=t;t=function(){n.removeEventListener(e,t),a.apply(this,arguments)}}var o={target:n,type:e,listener:t};return n.addEventListener(e,t),o}function J9(n,e,t,r){return pa(n,e,t,r,!0)}function Ms(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),QI(n))}var N0r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),DV=function(n){N0r(e,n);function e(){var t=n.call(this)||this;return t.on=t.onInternal,t.once=t.onceInternal,t.un=t.unInternal,t.revision_=0,t}return e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Ci.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,r){if(Array.isArray(t)){for(var i=t.length,a=new Array(i),o=0;o=0||QS.match(/cpu (os|iphone os) 15_4 like mac os x/)),$0r=QS.indexOf("webkit")!==-1&&QS.indexOf("edge")==-1,W0r=QS.indexOf("macintosh")!==-1,iue=typeof devicePixelRatio<"u"?devicePixelRatio:1,NV=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,H0r=typeof Image<"u"&&Image.prototype.decode,Rje=function(){var n=!1;try{var e=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return n}();function Ad(n,e,t,r){var i;return t&&t.length?i=t.shift():NV?i=new OffscreenCanvas(n||300,e||300):i=document.createElement("canvas"),n&&(i.width=n),e&&(i.height=e),i.getContext("2d",r)}function U2e(n,e){var t=e.parentNode;t&&t.replaceChild(n,e)}function _te(n){return n&&n.parentNode?n.parentNode.removeChild(n):null}function j0r(n){for(;n.lastChild;)n.removeChild(n.lastChild)}function X0r(n,e){for(var t=n.childNodes,r=0;;++r){var i=t[r],a=e[r];if(!i&&!a)break;if(i!==a){if(!i){n.appendChild(a);continue}if(!a){n.removeChild(i),--r;continue}n.insertBefore(a,i)}}}var Y0r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),q0r=function(n){Y0r(e,n);function e(t){var r=n.call(this)||this,i=t.element;return i&&!t.target&&!i.style.pointerEvents&&(i.style.pointerEvents="auto"),r.element=i||null,r.target_=null,r.map_=null,r.listenerKeys=[],t.render&&(r.render=t.render),t.target&&r.setTarget(t.target),r}return e.prototype.disposeInternal=function(){_te(this.element),n.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&_te(this.element);for(var r=0,i=this.listenerKeys.length;r0&&(this.length=e,this.max=this.length-1,this.slider.setAttribute("max",this.max))}setLayer(e){e&&(this.options.layer=e);var t=this,r=t.options.layer;r.on("tilesetsinfoloaded",function(i){var a=i.value&&i.value.tileVersions;t.update(a)}),r.on("tileversionschanged",function(i){var a=i.value&&i.value.tileVersion;t.setContent(a)}),t.getTileSetsInfo()}update(e){this.tileVersions=e||[],this.updateLength(this.tileVersions.length)}getTileSetsInfo(){var e=this;e.options.layer&&new nue(e.options.layer._url).getTilesets(function(r){e.options.layer.setTileSetsInfo(r.result)})}removeLayer(){this.options.layer=null}nextTilesVersion(){return this.firstLoad?(this.options.layer.nextTilesVersion(),this.firstLoad=!1,this):parseInt(this.slider.value)>this.max-1?this:(this.slider.value=parseInt(this.slider.value)+1,this.options.layer.nextTilesVersion(),this)}lastTilesVersion(){return parseInt(this.slider.value)1?(t=i,r=a):l>0&&(t+=o*l,r+=s*l)}return VE(n,e,t,r)}function VE(n,e,t,r){var i=t-n,a=r-e;return i*i+a*a}function tyr(n){for(var e=n.length,t=0;ti&&(i=o,r=a)}if(i===0)return null;var s=n[r];n[r]=n[t],n[t]=s;for(var l=t+1;l=0;f--){c[f]=n[f][e]/n[f][f];for(var d=f-1;d>=0;d--)n[d][e]-=n[d][f]*c[f]}return c}function u8(n){return n*Math.PI/180}function bS(n,e){var t=n%e;return t*e<0?t+e:t}function S1(n,e,t){return n+t*(e-n)}function Fje(n,e){var t=Math.pow(10,e);return Math.round(n*t)/t}function t6(n,e){return Math.floor(Fje(n,e))}function r6(n,e){return Math.ceil(Fje(n,e))}var ryr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),_k=6378137,_A=Math.PI*_k,nyr=[-_A,-_A,_A,_A],iyr=[-180,-85,180,85],n6=_k*Math.log(Math.tan(Math.PI/2)),xC=function(n){ryr(e,n);function e(t){return n.call(this,{code:t,units:$c.METERS,extent:nyr,global:!0,worldExtent:iyr,getPointResolution:function(r,i){return r/Q0r(i[1]/_k)}})||this}return e}(ew),W2e=[new xC("EPSG:3857"),new xC("EPSG:102100"),new xC("EPSG:102113"),new xC("EPSG:900913"),new xC("http://www.opengis.net/def/crs/EPSG/0/3857"),new xC("http://www.opengis.net/gml/srs/epsg.xml#3857")];function ayr(n,e,t){var r=n.length,i=t>1?t:2,a=e;a===void 0&&(i>2?a=n.slice():a=new Array(r));for(var o=0;on6?s=n6:s<-n6&&(s=-n6),a[o+1]=s}return a}function oyr(n,e,t){var r=n.length,i=t>1?t:2,a=e;a===void 0&&(i>2?a=n.slice():a=new Array(r));for(var o=0;oi&&(l=l|Ih.RIGHT),sa&&(l=l|Ih.ABOVE),l===Ih.UNKNOWN&&(l=Ih.INTERSECTING),l}function Md(){return[1/0,1/0,-1/0,-1/0]}function pm(n,e,t,r,i){return i?(i[0]=n,i[1]=e,i[2]=t,i[3]=r,i):[n,e,t,r]}function xk(n){return pm(1/0,1/0,-1/0,-1/0,n)}function zje(n,e){var t=n[0],r=n[1];return pm(t,r,t,r,e)}function lue(n,e,t,r,i){var a=xk(i);return Vje(a,n,e,t,r)}function m_(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function pyr(n,e,t){return Math.abs(n[0]-e[0])n[2]&&(n[2]=e[2]),e[1]n[3]&&(n[3]=e[3]),n}function MR(n,e){e[0]n[2]&&(n[2]=e[0]),e[1]n[3]&&(n[3]=e[1])}function Vje(n,e,t,r,i){for(;te[0]?r[0]=n[0]:r[0]=e[0],n[1]>e[1]?r[1]=n[1]:r[1]=e[1],n[2]=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function Sk(n){return n[2]=o&&p<=l),!r&&!!(a&Ih.RIGHT)&&!(i&Ih.RIGHT)&&(g=d-(f-l)*v,r=g>=s&&g<=u),!r&&!!(a&Ih.BELOW)&&!(i&Ih.BELOW)&&(p=f-(d-s)/v,r=p>=o&&p<=l),!r&&!!(a&Ih.LEFT)&&!(i&Ih.LEFT)&&(g=d-(f-o)*v,r=g>=s&&g<=u)}return r}function bte(n,e,t,r){var i=[];if(r>1)for(var a=n[2]-n[0],o=n[3]-n[1],s=0;s=t[2])){var i=Co(t),a=Math.floor((r[0]-t[0])/i),o=a*i;n[0]-=o,n[2]-=o}return n}function X2e(n,e,t){var r=t!==void 0?n.toFixed(t):""+n,i=r.indexOf(".");return i=i===-1?r.length:i,i>e?r:new Array(1+e-i).join("0")+r}function Syr(n,e){for(var t=(""+n).split("."),r=(""+e).split("."),i=0;io)return 1;if(o>a)return-1}return 0}function wyr(n,e){return n[0]+=+e[0],n[1]+=+e[1],n}function Y2e(n,e,t){var r=bS(e+180,360)-180,i=Math.abs(3600*r),a=t||0,o=Math.pow(10,a),s=Math.floor(i/3600),l=Math.floor((i-s*3600)/60),u=i-s*3600-l*60;return u=Math.ceil(u*o)/o,u>=60&&(u=0,l+=1),l>=60&&(l=0,s+=1),s+"\xB0 "+X2e(l,2)+"\u2032 "+X2e(u,2,a)+"\u2033"+(r==0?"":" "+n.charAt(r<0?1:0))}function t7(n,e){for(var t=!0,r=n.length-1;r>=0;--r)if(n[r]!=e[r]){t=!1;break}return t}function uue(n,e){var t=Math.cos(e),r=Math.sin(e),i=n[0]*t-n[1]*r,a=n[1]*t+n[0]*r;return n[0]=i,n[1]=a,n}function byr(n,e){return n[0]*=e,n[1]*=e,n}function hue(n,e){if(e.canWrapX()){var t=Co(e.getExtent()),r=Hje(n,e,t);r&&(n[0]-=r*t)}return n}function Hje(n,e,t){var r=e.getExtent(),i=0;if(e.canWrapX()&&(n[0]r[2])){var a=t||Co(r);i=Math.floor((n[0]-r[0])/a)}return i}const Kr={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};var Eyr=63710088e-1;function q2e(n,e,t){var r=t||Eyr,i=u8(n[1]),a=u8(e[1]),o=(a-i)/2,s=u8(e[0]-n[0])/2,l=Math.sin(o)*Math.sin(o)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(a);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var Ete=!0;function Tyr(n){var e=n===void 0?!0:n;Ete=!e}function cue(n,e,t){var r;if(e!==void 0){for(var i=0,a=n.length;i=2;--u)o[s+u]=e[s+u]}return o}}function Myr(n,e,t,r){var i=ya(n),a=ya(e);VM(i,a,Z2e(t)),VM(a,i,Z2e(r))}function Ry(n,e){if(n===e)return!0;var t=n.getUnits()===e.getUnits();if(n.getCode()===e.getCode())return t;var r=vue(n,e);return r===cue&&t}function vue(n,e){var t=n.getCode(),r=e.getCode(),i=Bje(t,r);return i||(i=jje),i}function __(n,e){var t=ya(n),r=ya(e);return vue(t,r)}function r7(n,e,t){var r=__(e,t);return r(n,void 0,n.length)}function Cte(n,e,t,r){var i=__(e,t);return bte(n,i,void 0,r)}var Iyr=null;function Lyr(){return Iyr}function Ate(n,e){return n}function c1(n,e){return Ete&&!t7(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Ete=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function Xje(n,e){return n}function F1(n,e){return n}function K2e(n,e,t){return function(r){var i=r[0],a=r[1],o,s;if(n.canWrapX()){var l=n.getExtent(),u=Co(l);s=Hje(r,n,u),s&&(i=i-s*u),i=Ui(i,l[0],l[2]),a=Ui(a,l[1],l[3]),o=t([i,a])}else o=t(r);return s&&e.canWrapX()&&(o[0]+=s*Co(e.getExtent())),o}}function Pyr(){Tte(W2e),Tte(j2e),Ayr(j2e,W2e,ayr,oyr)}Pyr();var Oyr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),FY="units",xb={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},Ryr=[1,2,5],BY=25.4/.28,Dyr=function(n){Oyr(e,n);function e(t){var r=this,i=t||{},a=i.className!==void 0?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return r=n.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=a+"-inner",r.element.className=a+" "+mk,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=i.minWidth!==void 0?i.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(FY,r.handleUnitsChanged_),r.setUnits(i.units||xb.METRIC),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r.dpi_=i.dpi||void 0,r}return e.prototype.getUnits=function(){return this.get(FY)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(FY,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=t.center,i=t.projection,a=this.getUnits(),o=a==xb.DEGREES?$c.DEGREES:$c.METERS,s=sN(i,t.resolution,r,o),l=this.minWidth_*(this.dpi_||BY)/BY,u=l*s,h="";if(a==xb.DEGREES){var c=Hp[$c.DEGREES];u*=c,u=l)break;++f}var m;this.scaleBar_?m=this.createScaleBar(v,d,h):m=d.toFixed(p<0?-p:0)+" "+h,this.renderedHTML_!=m&&(this.innerElement_.innerHTML=m,this.renderedHTML_=m),this.renderedWidth_!=v&&(this.innerElement_.style.width=v+"px",this.renderedWidth_=v),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)},e.prototype.createScaleBar=function(t,r,i){for(var a="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),o=[],s=t/this.scaleBarSteps_,l="#ffffff",u=0;u
    '+this.createMarker("relative",u)+(u%2===0||this.scaleBarSteps_===2?this.createStepText(u,t,!1,r,i):"")+"
    "),u===this.scaleBarSteps_-1&&o.push(this.createStepText(u+1,t,!0,r,i)),l==="#ffffff"?l="#000000":l="#ffffff";var h;this.scaleBarText_?h='
    '+a+"
    ":h="";var c='
    '+h+o.join("")+"
    ";return c},e.prototype.createMarker=function(t,r){var i=t==="absolute"?3:-10;return'
    '},e.prototype.createStepText=function(t,r,i,a,o){var s=t===0?0:Math.round(a/this.scaleBarSteps_*t*100)/100,l=s+(t===0?"":" "+o),u=t===0?-3:r/this.scaleBarSteps_*-1,h=t===0?0:r/this.scaleBarSteps_*2;return'
    '+l+"
    "},e.prototype.getScaleForResolution=function(){var t=sN(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,$c.METERS),r=this.dpi_||BY,i=1e3/25.4;return parseFloat(t.toString())*i*r},e.prototype.render=function(t){var r=t.frameState;r?this.viewState_=r.viewState:this.viewState_=null,this.updateElement_()},e}(tL);const Nyr=Dyr;class kyr extends Nyr{constructor(e){e=e||{},e.render=function(t){var r=t.frameState;r?this.viewState_=r.viewState:this.viewState_=null,this.updateElementRepair()},super(e)}updateElementRepair(){const e=this.viewState_||this.o||this.Om;if(!e){this.renderedVisible_=this.renderedVisible_||this.j||this.yn,this.renderedVisible_&&(this.element_=this.element_||this.c,this.element.style.display="none",this.renderedVisible_=!1);return}const t=e.center,r=e.projection,i=this.getUnits(),a=i=="degrees"?"degrees":"m";let o=sN(r,e.resolution,t,a);this.minWidth_=this.minWidth_||this.v||this.Em;let s=this.minWidth_*o,l="";if(i=="degrees"){const p=Hp.degrees;s*=p,s

    =this.minWidth_)break;++h}this.renderedHTML_=this.renderedHTML_||this.D||this.am,this.innerElement_=this.innerElement_||this.l||this.Tm,this.renderedWidth_=this.renderedWidth_||this.B||this.Am,this.renderedVisible_=this.renderedVisible_||this.j||this.yn,this.element_=this.element_||this.c;let v=c.toFixed(d<0?-d:0)+" "+l;this.renderedHTML_!=v&&(this.innerElement_.innerHTML=v,this.renderedHTML_=v),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+"px",this.renderedWidth_=f),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}}class Fyr extends tL{constructor(e){e=e||{},e.imageUrl=e.imageUrl||null,e.width=e.width||null,e.height=e.height||null,e.alt=e.alt||"SuperMap iClient",super(e),this.options=e,this.element=e.element=t.call(this);function t(){var i="ol-control-logo ol-unselectable ol-control",a=document.createElement("div");a.className=i,r.call(this,a);var o=Kat;this.options.imageUrl&&(o=this.options.imageUrl);var s=this.options.alt,l=this.options.link,u="94px",h="29px",c="width:"+u+";height:"+h+";";return this.options.imageUrl&&(u=this.options.width,h=this.options.height,c="width:"+u+";height:"+h+";",(!u||!h)&&(c="")),a.innerHTML=""+s+"",a}function r(i){var a=document.getElementsByClassName("ol-attribution");a=a&&a[0];var o=a&&a.clientHeight||29;i.style.bottom=parseInt(o)+6+"px",i.style.right="4px",i.style.marginTop=0,i.style.marginLeft=0,i.style.marginBottom=0,i.style.marginRight=0;var s=document.createElement("style");s.type="text/css",s.innerHTML=".ol-control-logo,.ol-control-logo:hover {background-color: rgba(255,255,255,0);}",document.getElementsByTagName("head")[0].appendChild(s)}}}var J2e={"point-file":"pointFile","point-fill":"fillStyle","point-radius":"pointRadius","point-halo-radius":"pointHaloRadius","point-halo-color":"pointHaloColor","point-dx":"offsetX","point-dy":"offsetY","point-opacity":"globalAlpha","point-comp-op":"globalCompositeOperation"},GY={"line-color":"strokeStyle","line-width":"lineWidth","line-cap":"lineCap","line-join":"lineJoin","line-miterlimit":"miterLimit","line-dash-offset":"lineDashOffset","line-opacity":"strokeOpacity","line-dasharray":"lineDasharray","line-offset":"offset","line-comp-op":"globalCompositeOperation"},zY={"line-color":"strokeStyle","line-width":"lineWidth","line-cap":"lineCap","line-join":"lineJoin","line-miterlimit":"miterLimit","line-dash-offset":"lineDashOffset","line-opacity":"strokeOpacity","line-dasharray":"lineDasharray","polygon-fill":"fillStyle","polygon-dx":"offsetX","polygon-dy":"offsetY","polygon-opacity":"fillOpacity","polygon-comp-op":"globalCompositeOperation"},UY={CartoStyleMap:{TEXT:{"text-size":"fontSize","text-face-name":"fontFamily","text-align":"textAlign","text-vertical-alignment":"textBaseline","text-horizontal-alignment":"textAlign","text-bold":"bold","text-weight":"fontWeight","text-name":"textName","text-halo-radius":"haloRadius","text-halo-color":"backColor","text-fill":"foreColor","text-opacity":"globalAlpha","text-dx":"offsetX","text-dy":"offsetY","text-comp-op":"globalCompositeOperation"},POINT:J2e,MULTIPOINT:J2e,LINE:GY,LINESTRING:GY,MULTILINESTRING:GY,REGION:zY,POLYGON:zY,MULTIPOLYGON:zY},ServerStyleMap:{fillBackOpaque:{canvasStyle:"",type:"bool",defaultValue:!0},lineWidth:{canvasStyle:"lineWidth",type:"number",unit:"mm",defaultValue:.1},fillBackColor:{canvasStyle:"",type:"color",defaultValue:"rgba(0,0,0,0)"},markerWidth:{canvasStyle:"",type:"number",unit:"mm",defaultValue:""},markerAngle:{canvasStyle:"",type:"number",unit:"degree",defaultValue:""},fillForeColor:{canvasStyle:"fillStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},foreColor:{canvasStyle:"fillStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},markerSize:{canvasStyle:"markerSize",type:"number",unit:"mm",defaultValue:2.4},fillGradientOffsetRatioX:{canvasStyle:"",type:"number",defaultValue:0},fillGradientOffsetRatioY:{canvasStyle:"",type:"number",defaultValue:0},lineColor:{canvasStyle:"strokeStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},fillOpaqueRate:{canvasStyle:"",type:"number",defaultValue:100},markerHeight:{canvasStyle:"",type:"number",unit:"mm",defaultValue:0},fillGradientMode:{canvasStyle:"",type:"string",defaultValue:"NONE"},fillSymbolID:{canvasStyle:"",type:"number",defaultValue:0},fillGradientAngle:{canvasStyle:"",type:"number",unit:"degree",defaultValue:0},markerSymbolID:{canvasStyle:"",type:"number",defaultValue:0},lineSymbolID:{canvasStyle:"",type:"number",defaultValue:0}},CartoCompOpMap:{clear:"",src:"",dst:"","src-over":"source-over","dst-over":"destination-over","src-in":"source-in","dst-in":"destination-in","src-out":"source-out","dst-out":"destination-out","src-atop":"source-atop","dst-atop":"destination-atop",xor:"xor",plus:"lighter",minus:"",multiply:"",screen:"",overlay:"",darken:"",lighten:"lighter","color-dodge":"","color-burn":"","hard-light":"","soft-light":"",difference:"",exclusion:"",contrast:"",invert:"","invert-rgb":"","grain-merge":"","grain-extract":"",hue:"",saturation:"",color:"",value:""}},Q2e={pointFile:"",pointRadius:3,pointHaloRadius:1,pointHaloColor:"#c33",offsetX:0,offsetY:0,fillStyle:"#fc0",globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},VY={strokeStyle:"rgba(0,0,0,0)",lineWidth:1,lineCap:"butt",lineJoin:"round",miterLimit:10,lineDashOffset:0,lineDasharray:[],strokeOpacity:1,offset:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},$Y={strokeStyle:"rgba(0,0,0,0)",lineWidth:1,lineCap:"butt",lineJoin:"round",miterLimit:10,lineDashOffset:0,lineOpacity:1,fillOpacity:1,lineDasharray:[],fillStyle:"rgba(0,0,0,0)",polygonOpacity:1,offsetX:0,offsetY:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},Byr={TEXT:{font:"10px sans-serif",textAlign:"middle",textBaseline:"center",direction:"ltr",bold:!1,haloRadius:0,backColor:"rgba(255,255,255,1)",foreColor:"rgba(0,0,0,1)",offsetX:0,offsetY:0,textHeight:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},POINT:Q2e,MULTIPOINT:Q2e,LINE:VY,LINESTRING:VY,MULTILINESTRING:VY,REGION:$Y,POLYGON:$Y,MULTIPOLYGON:$Y,SHADOW:{shadowBlur:0,shadowColor:"rgba(0,0,0,0)",shadowOffsetX:0,shadowOffsetY:0},GLOBAL:{globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0}},pue=new Array(6);function Nu(){return[1,0,0,1,0,0]}function IR(n){return wk(n,1,0,0,1,0,0)}function nL(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],l=e[0],u=e[1],h=e[2],c=e[3],f=e[4],d=e[5];return n[0]=t*l+i*u,n[1]=r*l+a*u,n[2]=t*h+i*c,n[3]=r*h+a*c,n[4]=t*f+i*d+o,n[5]=r*f+a*d+s,n}function wk(n,e,t,r,i,a,o){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n[4]=a,n[5]=o,n}function Gyr(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function ks(n,e){var t=e[0],r=e[1];return e[0]=n[0]*t+n[2]*r+n[4],e[1]=n[1]*t+n[3]*r+n[5],e}function zyr(n,e){var t=Math.cos(e),r=Math.sin(e);return nL(n,wk(pue,t,r,-r,t,0,0))}function LR(n,e,t){return nL(n,wk(pue,e,0,0,t,0,0))}function Uyr(n,e,t){return wk(n,e,0,0,t,0,0)}function Vyr(n,e,t){return nL(n,wk(pue,1,0,0,1,e,t))}function Id(n,e,t,r,i,a,o,s){var l=Math.sin(a),u=Math.cos(a);return n[0]=r*u,n[1]=i*l,n[2]=-r*l,n[3]=i*u,n[4]=o*r*u-s*r*l+e,n[5]=o*i*l+s*i*u+t,n}function bk(n,e){var t=$yr(e);ki(t!==0,32);var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5];return n[0]=o/t,n[1]=-i/t,n[2]=-a/t,n[3]=r/t,n[4]=(a*l-o*s)/t,n[5]=-(r*l-i*s)/t,n}function $yr(n){return n[0]*n[3]-n[1]*n[2]}var eTe;function gue(n){var e="matrix("+n.join(", ")+")";if(NV)return e;var t=eTe||(eTe=document.createElement("div"));return t.style.transform=e,t.style.transform}function ES(n,e,t,r,i,a){for(var o=a||[],s=0,l=e;l=n){var a=0;for(var o in e)(a++&3)===0&&(delete e[o],--t)}i=Qyr(r),e[r]=i,++t}return i}}();function n7(n){return Array.isArray(n)?n:Jyr(n)}function Qyr(n){var e,t,r,i,a;if(Zyr.exec(n)&&(n=Kyr(n)),qyr.exec(n)){var o=n.length-1,s=void 0;o<=4?s=1:s=2;var l=o===4||o===8;e=parseInt(n.substr(1+0*s,s),16),t=parseInt(n.substr(1+1*s,s),16),r=parseInt(n.substr(1+2*s,s),16),l?i=parseInt(n.substr(1+3*s,s),16):i=255,s==1&&(e=(e<<4)+e,t=(t<<4)+t,r=(r<<4)+r,l&&(i=(i<<4)+i)),a=[e,t,r,i/255]}else n.indexOf("rgba(")==0?(a=n.slice(5,-1).split(",").map(Number),rTe(a)):n.indexOf("rgb(")==0?(a=n.slice(4,-1).split(",").map(Number),a.push(1),rTe(a)):ki(!1,14);return a}function rTe(n){return n[0]=Ui(n[0]+.5|0,0,255),n[1]=Ui(n[1]+.5|0,0,255),n[2]=Ui(n[2]+.5|0,0,255),n[3]=Ui(n[3],0,1),n}function Kje(n){var e=n[0];e!=(e|0)&&(e=e+.5|0);var t=n[1];t!=(t|0)&&(t=t+.5|0);var r=n[2];r!=(r|0)&&(r=r+.5|0);var i=n[3]===void 0?1:Math.round(n[3]*100)/100;return"rgba("+e+","+t+","+r+","+i+")"}function jy(n){return Array.isArray(n)?Kje(n):n}var Jje="10px sans-serif",K1="#000",i7="round",lN=[],uN=0,$M="round",hN=10,cN="#000",fN="center",a7="middle",pE=[0,0,0,0],dN=1,f1=new kv,emr=new eL;emr.setSize=function(){console.warn("labelCache is deprecated.")};var QC=null,Mte,Ite={},tmr=function(){var n=100,e="32px ",t=["monospace","serif"],r=t.length,i="wmytzilWMYTZIL@#/&?$%10\uF013",a,o;function s(u,h,c){for(var f=!0,d=0;d0;)this.pop()},e.prototype.extend=function(t){for(var r=0,i=t.length;rt;){if(r-t>600){var a=r-t+1,o=e-t+1,s=Math.log(a),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1),h=Math.max(t,Math.floor(e-o*l/a+u)),c=Math.min(r,Math.floor(e+(a-o)*l/a+u));iXe(n,e,h,c,i)}var f=n[e],d=t,v=r;for(DP(n,t,e),i(n[r],f)>0&&DP(n,t,r);d0;)v--}i(n[t],f)===0?DP(n,t,v):(v++,DP(n,v,r)),v<=e&&(t=v+1),e<=v&&(r=v-1)}}function DP(n,e,t){var r=n[e];n[e]=n[t],n[t]=r}function Cmr(n,e){return ne?1:0}class aXe{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const r=[];if(!o6(e,t))return r;const i=this.toBBox,a=[];for(;t;){for(let o=0;o=0&&a[t].children.length>this._maxEntries;)this._split(a,t),t--;this._adjustParentBBoxes(i,a,t)}_split(e,t){const r=e[t],i=r.children.length,a=this._minEntries;this._chooseSplitAxis(r,a,i);const o=this._chooseSplitIndex(r,a,i),s=eA(r.children.splice(o,r.children.length-o));s.height=r.height,s.leaf=r.leaf,SC(r,this.toBBox),SC(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,t){this.data=eA([e,t]),this.data.height=e.height+1,this.data.leaf=!1,SC(this.data,this.toBBox)}_chooseSplitIndex(e,t,r){let i,a=1/0,o=1/0;for(let s=t;s<=r-t;s++){const l=CO(e,0,s,this.toBBox),u=CO(e,s,r,this.toBBox),h=Pmr(l,u),c=WY(l)+WY(u);h=t;u--){const h=e.children[u];AO(s,e.leaf?a(h):h),l+=a6(s)}return l}_adjustParentBBoxes(e,t,r){for(let i=r;i>=0;i--)AO(t[i],e)}_condense(e){for(let t=e.length-1,r;t>=0;t--)e[t].children.length===0?t>0?(r=e[t-1].children,r.splice(r.indexOf(e[t]),1)):this.clear():SC(e[t],this.toBBox)}}function Amr(n,e,t){if(!t)return e.indexOf(n);for(let r=0;r=n.minX&&e.maxY>=n.minY}function eA(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function oTe(n,e,t,r,i){const a=[e,t];for(;a.length;){if(t=a.pop(),e=a.pop(),t-e<=r)continue;const o=e+Math.ceil((t-e)/r/2)*r;Tmr(n,o,e,t,i),a.push(e,o,o,t)}}var Omr=function(){function n(e){this.rbush_=new aXe(e),this.items_={}}return n.prototype.insert=function(e,t){var r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(r),this.items_[vi(t)]=r},n.prototype.load=function(e,t){for(var r=new Array(t.length),i=0,a=t.length;i=200&&s.status<300){var u=e.getType(),h=void 0;u==qb.JSON||u==qb.TEXT?h=s.responseText:u==qb.XML?(h=s.responseXML,h||(h=new DOMParser().parseFromString(s.responseText,"application/xml"))):u==qb.ARRAY_BUFFER&&(h=s.response),h?a(e.readFeatures(h,{extent:t,featureProjection:i}),e.readProjection(h)):o()}else o()},s.onerror=o,s.send()}function hTe(n,e){return function(t,r,i,a,o){var s=this;sXe(n,e,t,r,i,function(l,u){s.addFeatures(l),a!==void 0&&a(l)},o||d2)}}var lXe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),mx=function(n){lXe(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.feature=r,a.features=i,a}return e}(Fm),kmr=function(n){lXe(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:p2.READY,wrapX:i.wrapX!==void 0?i.wrapX:!0})||this,r.on,r.once,r.un,r.loader_=d2,r.format_=i.format,r.overlaps_=i.overlaps===void 0?!0:i.overlaps,r.url_=i.url,i.loader!==void 0?r.loader_=i.loader:r.url_!==void 0&&(ki(r.format_,7),r.loader_=hTe(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:oXe;var a=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=a?new sTe:null,r.loadedExtentsRtree_=new sTe,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var o,s;return Array.isArray(i.features)?s=i.features:i.features&&(o=i.features,s=o.getArray()),!a&&o===void 0&&(o=new gd(s)),s!==void 0&&r.addFeaturesInternal(s),o!==void 0&&r.bindFeaturesCollection_(o),r}return e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var r=vi(t);if(!this.addToIndex_(r,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(r,t);var i=t.getGeometry();if(i){var a=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(a,t)}else this.nullGeometryFeatures_[r]=t;this.dispatchEvent(new mx(yf.ADDFEATURE,t))},e.prototype.setupChangeEvents_=function(t,r){this.featureChangeKeys_[t]=[pa(r,Ci.CHANGE,this.handleFeatureChange_,this),pa(r,UM.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,r){var i=!0,a=r.getId();return a!==void 0&&(a.toString()in this.idIndex_?i=!1:this.idIndex_[a.toString()]=r),i&&(ki(!(t in this.uidIndex_),30),this.uidIndex_[t]=r),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var r=[],i=[],a=[],o=0,s=t.length;o0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),n.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var r=this.loadedExtentsRtree_,i;r.forEachInExtent(t,function(a){if(m_(a.extent,t))return i=a,!0}),i&&r.remove(i)},e.prototype.removeFeature=function(t){if(!!t){var r=vi(t);r in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[r]:this.featuresRtree_&&this.featuresRtree_.remove(t);var i=this.removeFeatureInternal(t);i&&this.changed()}},e.prototype.removeFeatureInternal=function(t){var r=vi(t),i=this.featureChangeKeys_[r];if(!!i){i.forEach(Ms),delete this.featureChangeKeys_[r];var a=t.getId();return a!==void 0&&delete this.idIndex_[a.toString()],delete this.uidIndex_[r],this.dispatchEvent(new mx(yf.REMOVEFEATURE,t)),t}},e.prototype.removeFromIdIndex_=function(t){var r=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],r=!0;break}return r},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){ki(this.format_,7),this.url_=t,this.setLoader(hTe(t,this.format_))},e}(_ue);const _f=kmr,jo={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};var Fmr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Bmr=function(n){Fmr(e,n);function e(t){var r=n.call(this)||this;r.on,r.once,r.un,r.background_=t.background;var i=Ao({},t);return typeof t.properties=="object"&&(delete i.properties,Ao(i,t.properties)),i[jo.OPACITY]=t.opacity!==void 0?t.opacity:1,ki(typeof i[jo.OPACITY]=="number",64),i[jo.VISIBLE]=t.visible!==void 0?t.visible:!0,i[jo.Z_INDEX]=t.zIndex,i[jo.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,i[jo.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,i[jo.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,i[jo.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,r.className_=i.className!==void 0?i.className:"ol-layer",delete i.className,r.setProperties(i),r.state_=null,r}return e.prototype.getBackground=function(){return this.background_},e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var r=this.state_||{layer:this,managed:t===void 0?!0:t},i=this.getZIndex();return r.opacity=Ui(Math.round(this.getOpacity()*100)/100,0,1),r.visible=this.getVisible(),r.extent=this.getExtent(),r.zIndex=i===void 0&&!r.managed?1/0:i,r.maxResolution=this.getMaxResolution(),r.minResolution=Math.max(this.getMinResolution(),0),r.minZoom=this.getMinZoom(),r.maxZoom=this.getMaxZoom(),this.state_=r,r},e.prototype.getLayersArray=function(t){return ti()},e.prototype.getLayerStatesArray=function(t){return ti()},e.prototype.getExtent=function(){return this.get(jo.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(jo.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(jo.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(jo.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(jo.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(jo.OPACITY)},e.prototype.getSourceState=function(){return ti()},e.prototype.getVisible=function(){return this.get(jo.VISIBLE)},e.prototype.getZIndex=function(){return this.get(jo.Z_INDEX)},e.prototype.setBackground=function(t){this.background_=t,this.changed()},e.prototype.setExtent=function(t){this.set(jo.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(jo.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(jo.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(jo.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(jo.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){ki(typeof t=="number",64),this.set(jo.OPACITY,t)},e.prototype.setVisible=function(t){this.set(jo.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(jo.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),n.prototype.disposeInternal.call(this)},e}(kv);const uXe=Bmr,Tf={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};var Gmr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Ek=function(n){Gmr(e,n);function e(t){var r=this,i=Ao({},t);delete i.source,r=n.call(this,i)||this,r.on,r.once,r.un,r.mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,r.rendered=!1,t.render&&(r.render=t.render),t.map&&r.setMap(t.map),r.addChangeListener(jo.SOURCE,r.handleSourcePropertyChange_);var a=t.source?t.source:null;return r.setSource(a),r}return e.prototype.getLayersArray=function(t){var r=t||[];return r.push(this),r},e.prototype.getLayerStatesArray=function(t){var r=t||[];return r.push(this.getLayerState()),r},e.prototype.getSource=function(){return this.get(jo.SOURCE)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():p2.UNDEFINED},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Ms(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=pa(t,Ci.CHANGE,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise(function(r){return r([])})},e.prototype.getData=function(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)},e.prototype.render=function(t,r){var i=this.getRenderer();if(i.prepareFrame(t))return this.rendered=!0,i.renderFrame(t,r)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(jo.MAP,t)},e.prototype.getMapInternal=function(){return this.get(jo.MAP)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Ms(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ms(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=pa(t,Tf.PRECOMPOSE,function(r){var i=r,a=i.frameState.layerStatesArray,o=this.getLayerState(!1);ki(!a.some(function(s){return s.layer===o.layer}),67),a.push(o)},this),this.mapRenderKey_=pa(this,Ci.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(jo.SOURCE,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),n.prototype.disposeInternal.call(this)},e}(uXe);function l7(n,e){if(!n.visible)return!1;var t=e.resolution;if(t=n.maxResolution)return!1;var r=e.zoom;return r>n.minZoom&&r<=n.maxZoom}function cTe(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]+2*e,t[1]=n[1]+2*e,t}function fTe(n){return n[0]>0&&n[1]>0}function hXe(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]*e+.5|0,t[1]=n[1]*e+.5|0,t}function nh(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}var zmr=function(){function n(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=nh(e.scale),this.displacement_=e.displacement}return n.prototype.clone=function(){var e=this.getScale();return new n({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},n.prototype.getOpacity=function(){return this.opacity_},n.prototype.getRotateWithView=function(){return this.rotateWithView_},n.prototype.getRotation=function(){return this.rotation_},n.prototype.getScale=function(){return this.scale_},n.prototype.getScaleArray=function(){return this.scaleArray_},n.prototype.getDisplacement=function(){return this.displacement_},n.prototype.getAnchor=function(){return ti()},n.prototype.getImage=function(e){return ti()},n.prototype.getHitDetectionImage=function(){return ti()},n.prototype.getPixelRatio=function(e){return 1},n.prototype.getImageState=function(){return ti()},n.prototype.getImageSize=function(){return ti()},n.prototype.getOrigin=function(){return ti()},n.prototype.getSize=function(){return ti()},n.prototype.setDisplacement=function(e){this.displacement_=e},n.prototype.setOpacity=function(e){this.opacity_=e},n.prototype.setRotateWithView=function(e){this.rotateWithView_=e},n.prototype.setRotation=function(e){this.rotation_=e},n.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=nh(e)},n.prototype.listenImageChange=function(e){ti()},n.prototype.load=function(){ti()},n.prototype.unlistenImageChange=function(e){ti()},n}();const cXe=zmr;var Umr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Vmr=function(n){Umr(e,n);function e(t){var r=this,i=t.rotateWithView!==void 0?t.rotateWithView:!1;return r=n.call(this,{opacity:1,rotateWithView:i,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0]})||this,r.canvas_=void 0,r.hitDetectionCanvas_=null,r.fill_=t.fill!==void 0?t.fill:null,r.origin_=[0,0],r.points_=t.points,r.radius_=t.radius!==void 0?t.radius:t.radius1,r.radius2_=t.radius2,r.angle_=t.angle!==void 0?t.angle:0,r.stroke_=t.stroke!==void 0?t.stroke:null,r.size_=null,r.renderOptions_=null,r.render(),r}return e.prototype.clone=function(){var t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return r.setOpacity(this.getOpacity()),r},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var r=this.getDisplacement();return[t[0]/2-r[0],t[1]/2+r[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var r=this.canvas_[t];if(!r){var i=this.renderOptions_,a=Ad(i.size*t,i.size*t);this.draw_(i,a,t),r=a.canvas,this.canvas_[t]=r}return r},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return Ai.LOADED},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,r,i){if(r===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return r;var a=this.radius_,o=this.radius2_===void 0?a:this.radius2_;if(al&&(this.instructions.push([yi.CUSTOM,l,h,t,i,cS]),this.hitDetectionInstructions.push([yi.CUSTOM,l,h,t,a||i,cS]));break;case Kr.POINT:u=t.getFlatCoordinates(),this.coordinates.push(u[0],u[1]),h=this.coordinates.length,this.instructions.push([yi.CUSTOM,l,h,t,i]),this.hitDetectionInstructions.push([yi.CUSTOM,l,h,t,a||i]);break}this.endGeometry(r)},e.prototype.beginGeometry=function(t,r){this.beginGeometryInstruction1_=[yi.BEGIN_GEOMETRY,r,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[yi.BEGIN_GEOMETRY,r,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var r,i=t.length,a,o,s=-1;for(r=0;rthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var r=t.fillStyle,i=[yi.SET_FILL_STYLE,r];return typeof r!="string"&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[yi.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,r){var i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(r.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,r){var i=t.strokeStyle,a=t.lineCap,o=t.lineDash,s=t.lineDashOffset,l=t.lineJoin,u=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=a||o!=t.currentLineDash&&!Iw(t.currentLineDash,o)||t.currentLineDashOffset!=s||t.currentLineJoin!=l||t.currentLineWidth!=u||t.currentMiterLimit!=h)&&(i!==void 0&&r.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=a,t.currentLineDash=o,t.currentLineDashOffset=s,t.currentLineJoin=l,t.currentLineWidth=u,t.currentMiterLimit=h)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var r=[yi.END_GEOMETRY,t];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Gje(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;f0(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(qje);const Ck=Jmr;var Qmr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),e1r=function(n){Qmr(e,n);function e(t,r,i,a){var o=n.call(this,t,r,i,a)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return e.prototype.drawPoint=function(t,r){if(!!this.image_){this.beginGeometry(t,r);var i=t.getFlatCoordinates(),a=t.getStride(),o=this.coordinates.length,s=this.appendFlatPointCoordinates(i,a);this.instructions.push([yi.DRAW_IMAGE,o,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([yi.DRAW_IMAGE,o,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.drawMultiPoint=function(t,r){if(!!this.image_){this.beginGeometry(t,r);var i=t.getFlatCoordinates(),a=t.getStride(),o=this.coordinates.length,s=this.appendFlatPointCoordinates(i,a);this.instructions.push([yi.DRAW_IMAGE,o,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([yi.DRAW_IMAGE,o,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,n.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,r){var i=t.getAnchor(),a=t.getSize(),o=t.getHitDetectionImage(),s=t.getImage(this.pixelRatio),l=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=o,this.image_=s,this.height_=a[1],this.opacity_=t.getOpacity(),this.originX_=l[0]*this.imagePixelRatio_,this.originY_=l[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=a[0],this.declutterImageWithText_=r},e}(Ck);const t1r=e1r;var r1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),n1r=function(n){r1r(e,n);function e(t,r,i,a){return n.call(this,t,r,i,a)||this}return e.prototype.drawFlatCoordinates_=function(t,r,i,a){var o=this.coordinates.length,s=this.appendFlatLineCoordinates(t,r,i,a,!1,!1),l=[yi.MOVE_TO_LINE_TO,o,s];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},e.prototype.drawLineString=function(t,r){var i=this.state,a=i.strokeStyle,o=i.lineWidth;if(!(a===void 0||o===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,r),this.hitDetectionInstructions.push([yi.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,lN,uN],gE);var s=t.getFlatCoordinates(),l=t.getStride();this.drawFlatCoordinates_(s,0,s.length,l),this.hitDetectionInstructions.push(hS),this.endGeometry(r)}},e.prototype.drawMultiLineString=function(t,r){var i=this.state,a=i.strokeStyle,o=i.lineWidth;if(!(a===void 0||o===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,r),this.hitDetectionInstructions.push([yi.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],gE);for(var s=t.getEnds(),l=t.getFlatCoordinates(),u=t.getStride(),h=0,c=0,f=s.length;c0;){for(var c=u.pop(),f=u.pop(),d=0,v=n[f],p=n[f+1],g=n[c],m=n[c+1],y=f+r;yd&&(h=y,d=S)}d>i&&(l[(h-e)/r]=1,f+r0&&p>d)&&(v<0&&g0&&g>v)){u=c,h=f;continue}a[o++]=u,a[o++]=h,s=u,l=h,u=c,h=f}}return a[o++]=u,a[o++]=h,o}function dXe(n,e,t,r,i,a,o,s){for(var l=0,u=t.length;ln&&(l>s&&(s=l,a=u,o=c),l=0,u=c-i)),f=d,g=y,m=_),v=x,p=S}return l+=d,l>s?[u,c]:[a,o]}var c1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),h7={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},f1r=function(n){c1r(e,n);function e(t,r,i,a){var o=n.call(this,t,r,i,a)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return e.prototype.finish=function(){var t=n.prototype.finish.call(this);return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t},e.prototype.drawText=function(t,r){var i=this.textFillState_,a=this.textStrokeState_,o=this.textState_;if(!(this.text_===""||!o||!i&&!a)){var s=this.coordinates,l=s.length,u=t.getType(),h=null,c=t.getStride();if(o.placement===vXe.LINE&&(u==Kr.LINE_STRING||u==Kr.MULTI_LINE_STRING||u==Kr.POLYGON||u==Kr.MULTI_POLYGON)){if(!Cl(this.getBufferedMaxExtent(),t.getExtent()))return;var f=void 0;if(h=t.getFlatCoordinates(),u==Kr.LINE_STRING)f=[h.length];else if(u==Kr.MULTI_LINE_STRING)f=t.getEnds();else if(u==Kr.POLYGON)f=t.getEnds().slice(0,1);else if(u==Kr.MULTI_POLYGON){var d=t.getEndss();f=[];for(var v=0,p=d.length;vM[2]}else A=x>T;var I=Math.PI,R=[],k=w+r===e;e=w,g=0,m=b,f=n[e],d=n[e+1];var D;if(k){y(),D=Math.atan2(d-p,f-v),A&&(D+=D>0?-I:I);var G=(T+x)/2,W=(C+S)/2;return R[0]=[G,W,(E-a)/2,D,i],R}for(var z=0,V=i.length;z0?-I:I),D!==void 0){var Y=q-D;if(Y+=Y>I?-2*I:Y<-I?2*I:0,Math.abs(Y)>o)return null}D=q;for(var le=z,j=0;z0&&n.push(` `,""),n.push(e,""),n}var C1r=function(){function n(e,t,r,i){this.overlaps=r,this.pixelRatio=t,this.resolution=e,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=Nu(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return n.prototype.createLabel=function(e,t,r,i){var a=e+t+r+i;if(this.labels_[a])return this.labels_[a];var o=i?this.strokeStates[i]:null,s=r?this.fillStates[r]:null,l=this.textStates[t],u=this.pixelRatio,h=[l.scale[0]*u,l.scale[1]*u],c=Array.isArray(e),f=mTe(c?e[0]:e,l.textAlign||fN),d=i&&o.lineWidth?o.lineWidth:0,v=c?e:e.split(` `).reduce(T1r,[]),p=nmr(l,v),g=p.width,m=p.height,y=p.widths,_=p.heights,x=p.lineWidths,S=g+d,w=[],b=(S+2)*h[0],E=(m+d)*h[1],T={width:b<0?Math.floor(b):Math.ceil(b),height:E<0?Math.floor(E):Math.ceil(E),contextInstructions:w};if((h[0]!=1||h[1]!=1)&&w.push("scale",h),i){w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",d),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit);var C=NV?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;C.prototype.setLineDash&&(w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset))}r&&w.push("fillStyle",s.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var A=.5-f,M=f*S+A*d,I=[],R=[],k=0,D=0,G=0,W=0,z,V=0,q=v.length;Ve?e-u:a,x=o+h>t?t-h:o,S=v[3]+_*f[0]+v[1],w=v[0]+x*f[1]+v[2],b=m-v[3],E=y-v[0];(p||c!==0)&&(_x[0]=b,xx[0]=b,_x[1]=E,a1[1]=E,a1[0]=b+S,o1[0]=a1[0],o1[1]=E+w,xx[1]=o1[1]);var T;return c!==0?(T=Id(Nu(),r,i,1,1,c,-r,-i),ks(T,_x),ks(T,a1),ks(T,o1),ks(T,xx),pm(Math.min(_x[0],a1[0],o1[0],xx[0]),Math.min(_x[1],a1[1],o1[1],xx[1]),Math.max(_x[0],a1[0],o1[0],xx[0]),Math.max(_x[1],a1[1],o1[1],xx[1]),wC)):pm(Math.min(b,b+S),Math.min(E,E+w),Math.max(b,b+S),Math.max(E,E+w),wC),d&&(m=Math.round(m),y=Math.round(y)),{drawImageX:m,drawImageY:y,drawImageW:_,drawImageH:x,originX:u,originY:h,declutterBox:{minX:wC[0],minY:wC[1],maxX:wC[2],maxY:wC[3],value:g},canvasTransform:T,scale:f}},n.prototype.replayImageOrLabel_=function(e,t,r,i,a,o,s){var l=!!(o||s),u=i.declutterBox,h=e.canvas,c=s?s[2]*i.scale[0]/2:0,f=u.minX-c<=h.width/t&&u.maxX+c>=0&&u.minY-c<=h.height/t&&u.maxY+c>=0;return f&&(l&&this.replayTextBackground_(e,_x,a1,o1,xx,o,s),imr(e,i.canvasTransform,a,r,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},n.prototype.fill_=function(e){if(this.alignFill_){var t=ks(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(t[0]%r,t[1]%r),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()},n.prototype.setStrokeStyle_=function(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.setLineDash&&(e.lineDashOffset=t[7],e.setLineDash(t[6]))},n.prototype.drawLabelWithPointPlacement_=function(e,t,r,i){var a=this.textStates[t],o=this.createLabel(e,t,i,r),s=this.strokeStates[r],l=this.pixelRatio,u=mTe(Array.isArray(e)?e[0]:e,a.textAlign||fN),h=h7[a.textBaseline||a7],c=s&&s.lineWidth?s.lineWidth:0,f=o.width/l-2*a.scale[0],d=u*f+2*(.5-u)*c,v=h*o.height/l+2*(.5-h)*c;return{label:o,anchorX:d,anchorY:v}},n.prototype.execute_=function(e,t,r,i,a,o,s,l){var u;this.pixelCoordinates_&&Iw(r,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=ES(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),Gyr(this.renderedTransform_,r));for(var h=0,c=i.length,f=0,d,v,p,g,m,y,_,x,S,w,b,E,T=0,C=0,A=null,M=null,I=this.coordinateCache_,R=this.viewRotation_,k=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,D={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:R},G=this.instructions!=i||this.overlaps?0:200,W,z,V,q;hG&&(this.fill_(e),T=0),C>G&&(e.stroke(),C=0),!T&&!C&&(e.beginPath(),g=NaN,m=NaN),++h;break;case yi.CIRCLE:f=Y[1];var j=u[f],Q=u[f+1],ie=u[f+2],oe=u[f+3],se=ie-j,me=oe-Q,Ce=Math.sqrt(se*se+me*me);e.moveTo(j+Ce,Q),e.arc(j,Q,Ce,0,2*Math.PI,!0),++h;break;case yi.CLOSE_PATH:e.closePath(),++h;break;case yi.CUSTOM:f=Y[1],d=Y[2];var Le=Y[3],re=Y[4],yt=Y.length==6?Y[5]:void 0;D.geometry=Le,D.feature=W,h in I||(I[h]=[]);var je=I[h];yt?yt(u,f,d,2,je):(je[0]=u[f],je[1]=u[f+1],je.length=2),re(je,D),++h;break;case yi.DRAW_IMAGE:f=Y[1],d=Y[2],x=Y[3],v=Y[4],p=Y[5];var st=Y[6],Nt=Y[7],Zt=Y[8],qe=Y[9],ur=Y[10],Dt=Y[11],ft=Y[12],Oe=Y[13],J=Y[14];if(!x&&Y.length>=19){S=Y[18],w=Y[19],b=Y[20],E=Y[21];var We=this.drawLabelWithPointPlacement_(S,w,b,E);x=We.label,Y[3]=x;var Tt=Y[22];v=(We.anchorX-Tt)*this.pixelRatio,Y[4]=v;var Qe=Y[23];p=(We.anchorY-Qe)*this.pixelRatio,Y[5]=p,st=x.height,Y[6]=st,Oe=x.width,Y[13]=Oe}var zt=void 0;Y.length>24&&(zt=Y[24]);var mt=void 0,wt=void 0,pt=void 0;Y.length>16?(mt=Y[15],wt=Y[16],pt=Y[17]):(mt=pE,wt=!1,pt=!1),ur&&k?Dt+=R:!ur&&!k&&(Dt-=R);for(var ar=0;f0){if(!o||d!==ga.IMAGE&&d!==ga.TEXT||o.indexOf(w)!==-1){var A=(f[T]-3)/4,M=i-A%s,I=i-(A/s|0),R=a(w,b,M*M+I*I);if(R)return R}h.clearRect(0,0,s,s);break}}var p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(f2);var g,m,y,_,x;for(g=p.length-1;g>=0;--g){var S=p[g].toString();for(y=this.executorsByZIndex_[S],m=XY.length-1;m>=0;--m)if(d=XY[m],_=y[d],_!==void 0&&(x=_.executeHitDetection(h,l,r,v,c),x))return x}},n.prototype.getClipCoords=function(e){var t=this.maxExtent_;if(!t)return null;var r=t[0],i=t[1],a=t[2],o=t[3],s=[r,i,r,o,a,o,a,i];return ES(s,0,8,2,e,s),s},n.prototype.isEmpty=function(){return v2(this.executorsByZIndex_)},n.prototype.execute=function(e,t,r,i,a,o,s){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(f2),this.maxExtent_&&(e.save(),this.clip(e,r));var u=o||XY,h,c,f,d,v,p;for(s&&l.reverse(),h=0,c=l.length;ht)break;var s=r[o];s||(s=[],r[o]=s),s.push(((n+i)*e+(n+a))*4+3),i>0&&s.push(((n-i)*e+(n+a))*4+3),a>0&&(s.push(((n+i)*e+(n-a))*4+3),i>0&&s.push(((n-i)*e+(n-a))*4+3))}for(var l=[],i=0,u=r.length;ithis.maxCacheSize_},n.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var t in this.cache_){var r=this.cache_[t];(e++&3)===0&&!r.hasListener()&&(delete this.cache_[t],--this.cacheSize_)}}},n.prototype.get=function(e,t,r){var i=_Te(e,t,r);return i in this.cache_?this.cache_[i]:null},n.prototype.set=function(e,t,r,i){var a=_Te(e,t,r);this.cache_[a]=i,++this.cacheSize_},n.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},n}();function _Te(n,e,t){var r=t?Zje(t):"null";return e+":"+n+":"+r}var d7=new L1r,P1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),O1r=function(n){P1r(e,n);function e(t,r,i,a){var o=n.call(this)||this;return o.extent=t,o.pixelRatio_=i,o.resolution=r,o.state=a,o}return e.prototype.changed=function(){this.dispatchEvent(Ci.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return ti()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){ti()},e}(eL);const wue=O1r;var R1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),D1r=function(n){R1r(e,n);function e(t,r,i,a,o,s){var l=n.call(this,t,r,i,Ai.IDLE)||this;return l.src_=a,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.state=Ai.IDLE,l.imageLoadFunction_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Ai.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=lh(this.extent)/this.image_.height),this.state=Ai.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==Ai.IDLE||this.state==Ai.ERROR)&&(this.state=Ai.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=bue(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=lh(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(wue);function bue(n,e,t){var r=n,i=!0,a=!1,o=!1,s=[J9(r,Ci.LOAD,function(){o=!0,a||e()})];return r.src&&H0r?(a=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(o?e():t())})):s.push(J9(r,Ci.ERROR,t)),function(){i=!1,s.forEach(Ms)}}const N1r=D1r;var k1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),NP=null,F1r=function(n){k1r(e,n);function e(t,r,i,a,o,s){var l=n.call(this)||this;return l.hitDetectionImage_=null,l.image_=t||new Image,a!==null&&(l.image_.crossOrigin=a),l.canvas_={},l.color_=s,l.unlisten_=null,l.imageState_=o,l.size_=i,l.src_=r,l.tainted_,l}return e.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===Ai.LOADED){NP||(NP=Ad(1,1)),NP.drawImage(this.image_,0,0);try{NP.getImageData(0,0,1,1),this.tainted_=!1}catch{NP=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Ci.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=Ai.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Ai.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],r=this.size_[1],i=Ad(t,r);i.fillRect(0,0,t,r),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Ai.IDLE){this.imageState_=Ai.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=bue(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(!(!this.color_||this.canvas_[t]||this.imageState_!==Ai.LOADED)){var r=document.createElement("canvas");this.canvas_[t]=r,r.width=Math.ceil(this.image_.width*t),r.height=Math.ceil(this.image_.height*t);var i=r.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=Zje(this.color_),i.fillRect(0,0,r.width/t,r.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var a=i.getImageData(0,0,r.width,r.height),o=a.data,s=this.color_[0]/255,l=this.color_[1]/255,u=this.color_[2]/255,h=this.color_[3],c=0,f=o.length;c0,6);var c=i.src!==void 0?Ai.IDLE:Ai.LOADED;return r.color_=i.color!==void 0?n7(i.color):null,r.iconImage_=B1r(u,h,r.imgSize_!==void 0?r.imgSize_:null,r.crossOrigin_,c,r.color_),r.offset_=i.offset!==void 0?i.offset:[0,0],r.offsetOrigin_=i.offsetOrigin!==void 0?i.offsetOrigin:ep.TOP_LEFT,r.origin_=null,r.size_=i.size!==void 0?i.size:null,r}return e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var r=this.getSize();if(this.anchorXUnits_==Ux.FRACTION||this.anchorYUnits_==Ux.FRACTION){if(!r)return null;t=this.anchor_.slice(),this.anchorXUnits_==Ux.FRACTION&&(t[0]*=r[0]),this.anchorYUnits_==Ux.FRACTION&&(t[1]*=r[1])}if(this.anchorOrigin_!=ep.TOP_LEFT){if(!r)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_==ep.TOP_RIGHT||this.anchorOrigin_==ep.BOTTOM_RIGHT)&&(t[0]=-t[0]+r[0]),(this.anchorOrigin_==ep.BOTTOM_LEFT||this.anchorOrigin_==ep.BOTTOM_RIGHT)&&(t[1]=-t[1]+r[1])}this.normalizedAnchor_=t}var i=this.getDisplacement();return[t[0]-i[0],t[1]+i[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=ep.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;t=t.slice(),(this.offsetOrigin_==ep.TOP_RIGHT||this.offsetOrigin_==ep.BOTTOM_RIGHT)&&(t[0]=i[0]-r[0]-t[0]),(this.offsetOrigin_==ep.BOTTOM_LEFT||this.offsetOrigin_==ep.BOTTOM_RIGHT)&&(t[1]=i[1]-r[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(Ci.CHANGE,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Ci.CHANGE,t)},e}(cXe);const yy=z1r;var U1r="#333",V1r=function(){function n(e){var t=e||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=nh(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new Ko({color:U1r}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:vXe.POINT,this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}return n.prototype.clone=function(){var e=this.getScale();return new n({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},n.prototype.getOverflow=function(){return this.overflow_},n.prototype.getFont=function(){return this.font_},n.prototype.getMaxAngle=function(){return this.maxAngle_},n.prototype.getPlacement=function(){return this.placement_},n.prototype.getOffsetX=function(){return this.offsetX_},n.prototype.getOffsetY=function(){return this.offsetY_},n.prototype.getFill=function(){return this.fill_},n.prototype.getRotateWithView=function(){return this.rotateWithView_},n.prototype.getRotation=function(){return this.rotation_},n.prototype.getScale=function(){return this.scale_},n.prototype.getScaleArray=function(){return this.scaleArray_},n.prototype.getStroke=function(){return this.stroke_},n.prototype.getText=function(){return this.text_},n.prototype.getTextAlign=function(){return this.textAlign_},n.prototype.getTextBaseline=function(){return this.textBaseline_},n.prototype.getBackgroundFill=function(){return this.backgroundFill_},n.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},n.prototype.getPadding=function(){return this.padding_},n.prototype.setOverflow=function(e){this.overflow_=e},n.prototype.setFont=function(e){this.font_=e},n.prototype.setMaxAngle=function(e){this.maxAngle_=e},n.prototype.setOffsetX=function(e){this.offsetX_=e},n.prototype.setOffsetY=function(e){this.offsetY_=e},n.prototype.setPlacement=function(e){this.placement_=e},n.prototype.setRotateWithView=function(e){this.rotateWithView_=e},n.prototype.setFill=function(e){this.fill_=e},n.prototype.setRotation=function(e){this.rotation_=e},n.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=nh(e!==void 0?e:1)},n.prototype.setStroke=function(e){this.stroke_=e},n.prototype.setText=function(e){this.text_=e},n.prototype.setTextAlign=function(e){this.textAlign_=e},n.prototype.setTextBaseline=function(e){this.textBaseline_=e},n.prototype.setBackgroundFill=function(e){this.backgroundFill_=e},n.prototype.setBackgroundStroke=function(e){this.backgroundStroke_=e},n.prototype.setPadding=function(e){this.padding_=e},n}();const J1=V1r;var uv=.5;function yXe(n,e,t,r,i,a,o){var s=n[0]*uv,l=n[1]*uv,u=Ad(s,l);u.imageSmoothingEnabled=!1;for(var h=u.canvas,c=new yue(u,uv,i,null,o),f=t.length,d=Math.floor((256*256*256-1)/f),v={},p=1;p<=f;++p){var g=t[p-1],m=g.getStyleFunction()||r;if(!!r){var y=m(g,a);if(!!y){Array.isArray(y)||(y=[y]);for(var _=p*d,x="#"+("000000"+_.toString(16)).slice(-6),S=0,w=y.length;Sp[2];)++y,_=m*y,c.push(this.getRenderTransform(a,o,s,uv,f,d,_).slice()),g-=m}this.hitDetectionImageData_=yXe(i,c,this.renderedFeatures_,h.getStyleFunction(),u,o,s)}r(mXe(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,r,i,a,o){var s=this;if(!!this.replayGroup_){var l=r.viewState.resolution,u=r.viewState.rotation,h=this.getLayer(),c={},f=function(p,g,m){var y=vi(p),_=c[y];if(_){if(_!==!0&&m<_.distanceSq){if(m===0)return c[y]=!0,o.splice(o.lastIndexOf(_),1),a(p,h,g);_.geometry=g,_.distanceSq=m}}else{if(m===0)return c[y]=!0,a(p,h,g);o.push(c[y]={feature:p,layer:h,geometry:g,distanceSq:m,callback:a})}},d,v=[this.replayGroup_];return this.declutterExecutorGroup&&v.push(this.declutterExecutorGroup),v.some(function(p){return d=p.forEachFeatureAtCoordinate(t,l,u,i,f,p===s.declutterExecutorGroup&&r.declutterTree?r.declutterTree.all().map(function(g){return g.value}):null)}),d}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var r=this.getLayer(),i=r.getSource();if(!i)return!1;var a=t.viewHints[Gs.ANIMATING],o=t.viewHints[Gs.INTERACTING],s=r.getUpdateWhileAnimating(),l=r.getUpdateWhileInteracting();if(!this.dirty_&&!s&&a||!l&&o)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var u=t.extent,h=t.viewState,c=h.projection,f=h.resolution,d=t.pixelRatio,v=r.getRevision(),p=r.getRenderBuffer(),g=r.getRenderOrder();g===void 0&&(g=dmr);var m=h.center.slice(),y=f0(u,p*f),_=y.slice(),x=[y.slice()],S=c.getExtent();if(i.getWrapX()&&c.canWrapX()&&!vv(S,t.extent)){var w=Co(S),b=Math.max(Co(y)/2,w);y[0]=S[0]-b,y[2]=S[2]+b,hue(m,c);var E=Wje(x[0],c);E[0]S[0]&&E[2]>S[2]&&x.push([E[0]-w,E[1],E[2]-w,E[3]])}if(!this.dirty_&&this.renderedResolution_==f&&this.renderedRevision_==v&&this.renderedRenderOrder_==g&&vv(this.wrappedRenderedExtent_,y))return Iw(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var T=new c7(Lte(f,d),y,f,d),C;this.getLayer().getDeclutter()&&(C=new c7(Lte(f,d),y,f,d));for(var A,M,I,M=0,I=x.length;M-180&&f<90&&f>-90;if(!(h.length===l.length&&d))continue;const v={};v.type="Feature",v.geometry={},v.properties={},v.geometry.type="Point",v.geometry.coordinates=[c,f];for(let p=0;pSTe(a.properties.Name,e)),r=0,i=null;return t.forEach(a=>{let o=0;Array.from(new Set(a.properties.Name.split(""))).forEach(s=>{e.includes(s)&&o++}),o>r&&(r=o,i=a)}),i},setMask(n,e){if(!e||!((e instanceof d0?e.getGeometry():e)instanceof vT)&&["MultiPolygon","Polygon"].indexOf(e.getType())<0)return;const r=e instanceof d0?e:new d0(e),i=new So({fill:new Ko({color:"black"})}),a=new Sy({source:new _f({features:[r],wrapX:!1})}),o=function(l){const u=rXe(l);l.context.globalCompositeOperation="destination-in",a.getSource().forEachFeature(function(h){u.drawFeature(h,i),l.context.globalCompositeOperation="source-over"})},s=Array.isArray(n)?n:[n];xTe(s),s.forEach(l=>{l.classNameBak_=l.className_,l.className_=`ol_mask_layer_${l.ol_uid}`,l.clipRender=o,l.extentBak_=l.getExtent(),l.setExtent(a.getSource().getExtent()),l.on("postrender",o),l.changed()})},unsetMask:xTe,getZoomByResolution(n,e){return Not(n,e)},scalesToResolutions(n,e,t,r,i,a){return Dot(n,e,t,r,i)},getProjection(n,e){let t=ya(`EPSG:${n.epsgCode}`);return n.type=="PCS_NON_EARTH"&&(t=new ew({extent:e,units:"m",code:"0"})),t||console.error(`The projection of EPSG:${n.epsgCode} is missing, please register the projection of EPSG:${n.epsgCode} first, refer to the documentation: https://iclient.supermap.io/web/introduction/leafletDevelop.html#multiProjection`),t}};function _Xe(n){return typeof n=="string"&&n.constructor===String}function K1r(n){return Object.prototype.toString.call(n)==="[object Array]"}function xTe(n){const e=Array.isArray(n)?n:[n];for(let t=0;t"u"&&ZY!==void 0?function(n){return typeof n=="function"||n===ZY}:function(n){return typeof n=="function"},d_r=yu,Ud=function(n){return typeof n=="object"?n!==null:d_r(n)},KY=xl,v_r=yu,p_r=function(n){return v_r(n)?n:void 0},yT=function(n,e){return arguments.length<2?p_r(KY[n]):KY[n]&&KY[n][e]},g_r=ql,VV=g_r({}.isPrototypeOf),y_r=xl,wTe=y_r.navigator,bTe=wTe&&wTe.userAgent,Ik=bTe?String(bTe):"",AXe=xl,JY=Ik,ETe=AXe.process,TTe=AXe.Deno,CTe=ETe&&ETe.versions||TTe&&TTe.version,ATe=CTe&&CTe.v8,Xg,v7;ATe&&(Xg=ATe.split("."),v7=Xg[0]>0&&Xg[0]<4?1:+(Xg[0]+Xg[1]));!v7&&JY&&(Xg=JY.match(/Edge\/(\d+)/),(!Xg||Xg[1]>=74)&&(Xg=JY.match(/Chrome\/(\d+)/),Xg&&(v7=+Xg[1])));var Tue=v7,MTe=Tue,m_r=Yl,__r=xl,x_r=__r.String,MXe=!!Object.getOwnPropertySymbols&&!m_r(function(){var n=Symbol("symbol detection");return!x_r(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&MTe&&MTe<41}),S_r=MXe,IXe=S_r&&!Symbol.sham&&typeof Symbol.iterator=="symbol",w_r=yT,b_r=yu,E_r=VV,T_r=IXe,C_r=Object,LXe=T_r?function(n){return typeof n=="symbol"}:function(n){var e=w_r("Symbol");return b_r(e)&&E_r(e.prototype,C_r(n))},A_r=String,$V=function(n){try{return A_r(n)}catch{return"Object"}},M_r=yu,I_r=$V,L_r=TypeError,j_=function(n){if(M_r(n))return n;throw new L_r(I_r(n)+" is not a function")},P_r=j_,O_r=UV,iL=function(n,e){var t=n[e];return O_r(t)?void 0:P_r(t)},QY=Sc,eq=yu,tq=Ud,R_r=TypeError,D_r=function(n,e){var t,r;if(e==="string"&&eq(t=n.toString)&&!tq(r=QY(t,n))||eq(t=n.valueOf)&&!tq(r=QY(t,n))||e!=="string"&&eq(t=n.toString)&&!tq(r=QY(t,n)))return r;throw new R_r("Can't convert object to primitive value")},WV={exports:{}},ITe=xl,N_r=Object.defineProperty,Cue=function(n,e){try{N_r(ITe,n,{value:e,configurable:!0,writable:!0})}catch{ITe[n]=e}return e},k_r=xl,F_r=Cue,LTe="__core-js_shared__",PTe=WV.exports=k_r[LTe]||F_r(LTe,{});(PTe.versions||(PTe.versions=[])).push({version:"3.43.0",mode:"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",source:"https://github.com/zloirock/core-js"});var OTe=WV.exports,Aue=function(n,e){return OTe[n]||(OTe[n]=e||{})},B_r=$0,G_r=Object,HV=function(n){return G_r(B_r(n))},z_r=ql,U_r=HV,V_r=z_r({}.hasOwnProperty),W0=Object.hasOwn||function(e,t){return V_r(U_r(e),t)},$_r=ql,W_r=0,H_r=Math.random(),j_r=$_r(1.1 .toString),PXe=function(n){return"Symbol("+(n===void 0?"":n)+")_"+j_r(++W_r+H_r,36)},X_r=xl,Y_r=Aue,RTe=W0,q_r=PXe,Z_r=MXe,K_r=IXe,xA=X_r.Symbol,rq=Y_r("wks"),J_r=K_r?xA.for||xA:xA&&xA.withoutSetter||q_r,Jh=function(n){return RTe(rq,n)||(rq[n]=Z_r&&RTe(xA,n)?xA[n]:J_r("Symbol."+n)),rq[n]},Q_r=Sc,DTe=Ud,NTe=LXe,exr=iL,txr=D_r,rxr=Jh,nxr=TypeError,ixr=rxr("toPrimitive"),axr=function(n,e){if(!DTe(n)||NTe(n))return n;var t=exr(n,ixr),r;if(t){if(e===void 0&&(e="default"),r=Q_r(t,n,e),!DTe(r)||NTe(r))return r;throw new nxr("Can't convert object to primitive value")}return e===void 0&&(e="number"),txr(n,e)},oxr=axr,sxr=LXe,OXe=function(n){var e=oxr(n,"string");return sxr(e)?e:e+""},lxr=xl,kTe=Ud,Rte=lxr.document,uxr=kTe(Rte)&&kTe(Rte.createElement),jV=function(n){return uxr?Rte.createElement(n):{}},hxr=V0,cxr=Yl,fxr=jV,RXe=!hxr&&!cxr(function(){return Object.defineProperty(fxr("div"),"a",{get:function(){return 7}}).a!==7}),dxr=V0,vxr=Sc,pxr=xXe,gxr=Eue,yxr=Mk,mxr=OXe,_xr=W0,xxr=RXe,FTe=Object.getOwnPropertyDescriptor;Ak.f=dxr?FTe:function(e,t){if(e=yxr(e),t=mxr(t),xxr)try{return FTe(e,t)}catch{}if(_xr(e,t))return gxr(!vxr(pxr.f,e,t),e[t])};var X_={},Sxr=V0,wxr=Yl,DXe=Sxr&&wxr(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),bxr=Ud,Exr=String,Txr=TypeError,Xf=function(n){if(bxr(n))return n;throw new Txr(Exr(n)+" is not an object")},Cxr=V0,Axr=RXe,Mxr=DXe,u6=Xf,BTe=OXe,Ixr=TypeError,nq=Object.defineProperty,Lxr=Object.getOwnPropertyDescriptor,iq="enumerable",aq="configurable",oq="writable";X_.f=Cxr?Mxr?function(e,t,r){if(u6(e),t=BTe(t),u6(r),typeof e=="function"&&t==="prototype"&&"value"in r&&oq in r&&!r[oq]){var i=Lxr(e,t);i&&i[oq]&&(e[t]=r.value,r={configurable:aq in r?r[aq]:i[aq],enumerable:iq in r?r[iq]:i[iq],writable:!1})}return nq(e,t,r)}:nq:function(e,t,r){if(u6(e),t=BTe(t),u6(r),Axr)try{return nq(e,t,r)}catch{}if("get"in r||"set"in r)throw new Ixr("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Pxr=V0,Oxr=X_,Rxr=Eue,Lk=Pxr?function(n,e,t){return Oxr.f(n,e,Rxr(1,t))}:function(n,e,t){return n[e]=t,n},Mue={exports:{}},Dte=V0,Dxr=W0,NXe=Function.prototype,Nxr=Dte&&Object.getOwnPropertyDescriptor,Iue=Dxr(NXe,"name"),kxr=Iue&&function(){}.name==="something",Fxr=Iue&&(!Dte||Dte&&Nxr(NXe,"name").configurable),XV={EXISTS:Iue,PROPER:kxr,CONFIGURABLE:Fxr},Bxr=ql,Gxr=yu,Nte=WV.exports,zxr=Bxr(Function.toString);Gxr(Nte.inspectSource)||(Nte.inspectSource=function(n){return zxr(n)});var Lue=Nte.inspectSource,Uxr=xl,Vxr=yu,GTe=Uxr.WeakMap,$xr=Vxr(GTe)&&/native code/.test(String(GTe)),Wxr=Aue,Hxr=PXe,zTe=Wxr("keys"),Pue=function(n){return zTe[n]||(zTe[n]=Hxr(n))},Oue={},jxr=$xr,kXe=xl,Xxr=Ud,Yxr=Lk,sq=W0,lq=WV.exports,qxr=Pue,Zxr=Oue,UTe="Object already initialized",kte=kXe.TypeError,Kxr=kXe.WeakMap,p7,pN,g7,Jxr=function(n){return g7(n)?pN(n):p7(n,{})},Qxr=function(n){return function(e){var t;if(!Xxr(e)||(t=pN(e)).type!==n)throw new kte("Incompatible receiver, "+n+" required");return t}};if(jxr||lq.state){var hy=lq.state||(lq.state=new Kxr);hy.get=hy.get,hy.has=hy.has,hy.set=hy.set,p7=function(n,e){if(hy.has(n))throw new kte(UTe);return e.facade=n,hy.set(n,e),e},pN=function(n){return hy.get(n)||{}},g7=function(n){return hy.has(n)}}else{var bC=qxr("state");Zxr[bC]=!0,p7=function(n,e){if(sq(n,bC))throw new kte(UTe);return e.facade=n,Yxr(n,bC,e),e},pN=function(n){return sq(n,bC)?n[bC]:{}},g7=function(n){return sq(n,bC)}}var YV={set:p7,get:pN,has:g7,enforce:Jxr,getterFor:Qxr},Rue=ql,eSr=Yl,tSr=yu,h6=W0,Fte=V0,rSr=XV.CONFIGURABLE,nSr=Lue,FXe=YV,iSr=FXe.enforce,aSr=FXe.get,VTe=String,h8=Object.defineProperty,oSr=Rue("".slice),sSr=Rue("".replace),lSr=Rue([].join),uSr=Fte&&!eSr(function(){return h8(function(){},"length",{value:8}).length!==8}),hSr=String(String).split("String"),cSr=Mue.exports=function(n,e,t){oSr(VTe(e),0,7)==="Symbol("&&(e="["+sSr(VTe(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!h6(n,"name")||rSr&&n.name!==e)&&(Fte?h8(n,"name",{value:e,configurable:!0}):n.name=e),uSr&&t&&h6(t,"arity")&&n.length!==t.arity&&h8(n,"length",{value:t.arity});try{t&&h6(t,"constructor")&&t.constructor?Fte&&h8(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch{}var r=iSr(n);return h6(r,"source")||(r.source=lSr(hSr,typeof e=="string"?e:"")),n};Function.prototype.toString=cSr(function(){return tSr(this)&&aSr(this).source||nSr(this)},"toString");var fSr=yu,dSr=X_,vSr=Mue.exports,pSr=Cue,mT=function(n,e,t,r){r||(r={});var i=r.enumerable,a=r.name!==void 0?r.name:e;if(fSr(t)&&vSr(t,a,r),r.global)i?n[e]=t:pSr(e,t);else{try{r.unsafe?n[e]&&(i=!0):delete n[e]}catch{}i?n[e]=t:dSr.f(n,e,{value:t,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return n},BXe={},gSr=Math.ceil,ySr=Math.floor,mSr=Math.trunc||function(e){var t=+e;return(t>0?ySr:gSr)(t)},_Sr=mSr,qV=function(n){var e=+n;return e!==e||e===0?0:_Sr(e)},xSr=qV,SSr=Math.max,wSr=Math.min,bSr=function(n,e){var t=xSr(n);return t<0?SSr(t+e,0):wSr(t,e)},ESr=qV,TSr=Math.min,aL=function(n){var e=ESr(n);return e>0?TSr(e,9007199254740991):0},CSr=aL,Due=function(n){return CSr(n.length)},ASr=Mk,MSr=bSr,ISr=Due,$Te=function(n){return function(e,t,r){var i=ASr(e),a=ISr(i);if(a===0)return!n&&-1;var o=MSr(r,a),s;if(n&&t!==t){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((n||o in i)&&i[o]===t)return n||o||0;return!n&&-1}},GXe={includes:$Te(!0),indexOf:$Te(!1)},LSr=ql,uq=W0,PSr=Mk,OSr=GXe.indexOf,RSr=Oue,WTe=LSr([].push),zXe=function(n,e){var t=PSr(n),r=0,i=[],a;for(a in t)!uq(RSr,a)&&uq(t,a)&&WTe(i,a);for(;e.length>r;)uq(t,a=e[r++])&&(~OSr(i,a)||WTe(i,a));return i},Nue=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],DSr=zXe,NSr=Nue,kSr=NSr.concat("length","prototype");BXe.f=Object.getOwnPropertyNames||function(e){return DSr(e,kSr)};var UXe={};UXe.f=Object.getOwnPropertySymbols;var FSr=yT,BSr=ql,GSr=BXe,zSr=UXe,USr=Xf,VSr=BSr([].concat),$Sr=FSr("Reflect","ownKeys")||function(e){var t=GSr.f(USr(e)),r=zSr.f;return r?VSr(t,r(e)):t},HTe=W0,WSr=$Sr,HSr=Ak,jSr=X_,XSr=function(n,e,t){for(var r=WSr(e),i=jSr.f,a=HSr.f,o=0;oc;c++)if(d=m(n[c]),d&&wCe(ECe,d))return d;return new d8(!1)}u=YEr(n,h)}for(v=a?n.next:u.next;!(p=$Er(v,u)).done;){try{d=m(p.value)}catch(y){bCe(u,"throw",y)}if(typeof d=="object"&&d&&wCe(ECe,d))return d}return new d8(!1)},KEr=Jh,SYe=KEr("iterator"),wYe=!1;try{var JEr=0,TCe={next:function(){return{done:!!JEr++}},return:function(){wYe=!0}};TCe[SYe]=function(){return this},Array.from(TCe,function(){throw 2})}catch{}var QEr=function(n,e){try{if(!e&&!wYe)return!1}catch{return!1}var t=!1;try{var r={};r[SYe]=function(){return{next:function(){return{done:t=!0}}}},n(r)}catch{}return t},e2r=QV,t2r=QEr,r2r=Ok.CONSTRUCTOR,bYe=r2r||!t2r(function(n){e2r.all(n).then(void 0,function(){})}),n2r=Yf,i2r=Sc,a2r=j_,o2r=oL,s2r=zue,l2r=xYe,u2r=bYe;n2r({target:"Promise",stat:!0,forced:u2r},{all:function(e){var t=this,r=o2r.f(t),i=r.resolve,a=r.reject,o=s2r(function(){var s=a2r(t.resolve),l=[],u=0,h=1;l2r(e,function(c){var f=u++,d=!1;h++,i2r(s,t,c).then(function(v){d||(d=!0,l[f]=v,--h||i(l))},a)}),--h||i(l)});return o.error&&a(o.value),r.promise}});var h2r=Yf,c2r=Ok.CONSTRUCTOR,Hte=QV,f2r=yT,d2r=yu,v2r=mT,CCe=Hte&&Hte.prototype;h2r({target:"Promise",proto:!0,forced:c2r,real:!0},{catch:function(n){return this.then(void 0,n)}});if(d2r(Hte)){var ACe=f2r("Promise").prototype.catch;CCe.catch!==ACe&&v2r(CCe,"catch",ACe,{unsafe:!0})}var p2r=Yf,g2r=Sc,y2r=j_,m2r=oL,_2r=zue,x2r=xYe,S2r=bYe;p2r({target:"Promise",stat:!0,forced:S2r},{race:function(e){var t=this,r=m2r.f(t),i=r.reject,a=_2r(function(){var o=y2r(t.resolve);x2r(e,function(s){g2r(o,t,s).then(r.resolve,i)})});return a.error&&i(a.value),r.promise}});var w2r=Yf,b2r=oL,E2r=Ok.CONSTRUCTOR;w2r({target:"Promise",stat:!0,forced:E2r},{reject:function(e){var t=b2r.f(this),r=t.reject;return r(e),t.promise}});var T2r=Xf,C2r=Ud,A2r=oL,M2r=function(n,e){if(T2r(n),C2r(e)&&e.constructor===n)return e;var t=A2r.f(n),r=t.resolve;return r(e),t.promise},I2r=Yf,L2r=yT,P2r=Ok.CONSTRUCTOR,O2r=M2r;L2r("Promise");I2r({target:"Promise",stat:!0,forced:P2r},{resolve:function(e){return O2r(this,e)}});var R2r=kue,D2r=String,Bm=function(n){if(R2r(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return D2r(n)},N2r=Xf,EYe=function(){var n=N2r(this),e="";return n.hasIndices&&(e+="d"),n.global&&(e+="g"),n.ignoreCase&&(e+="i"),n.multiline&&(e+="m"),n.dotAll&&(e+="s"),n.unicode&&(e+="u"),n.unicodeSets&&(e+="v"),n.sticky&&(e+="y"),e},Hue=Yl,k2r=xl,jue=k2r.RegExp,Xue=Hue(function(){var n=jue("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),F2r=Xue||Hue(function(){return!jue("a","y").sticky}),B2r=Xue||Hue(function(){var n=jue("^r","gy");return n.lastIndex=2,n.exec("str")!==null}),TYe={BROKEN_CARET:B2r,MISSED_STICKY:F2r,UNSUPPORTED_Y:Xue},CYe={},G2r=zXe,z2r=Nue,U2r=Object.keys||function(e){return G2r(e,z2r)},V2r=V0,$2r=DXe,W2r=X_,H2r=Xf,j2r=Mk,X2r=U2r;CYe.f=V2r&&!$2r?Object.defineProperties:function(e,t){H2r(e);for(var r=j2r(t),i=X2r(t),a=i.length,o=0,s;a>o;)W2r.f(e,s=i[o++],r[s]);return e};var Y2r=Xf,q2r=CYe,MCe=Nue,Z2r=Oue,K2r=QXe,J2r=jV,Q2r=Pue,ICe=">",LCe="<",jte="prototype",Xte="script",AYe=Q2r("IE_PROTO"),Sq=function(){},MYe=function(n){return LCe+Xte+ICe+n+LCe+"/"+Xte+ICe},PCe=function(n){n.write(MYe("")),n.close();var e=n.parentWindow.Object;return n=null,e},eTr=function(){var n=J2r("iframe"),e="java"+Xte+":",t;return n.style.display="none",K2r.appendChild(n),n.src=String(e),t=n.contentWindow.document,t.open(),t.write(MYe("document.F=Object")),t.close(),t.F},_6,v8=function(){try{_6=new ActiveXObject("htmlfile")}catch{}v8=typeof document<"u"?document.domain&&_6?PCe(_6):eTr():PCe(_6);for(var n=MCe.length;n--;)delete v8[jte][MCe[n]];return v8()};Z2r[AYe]=!0;var Yue=Object.create||function(e,t){var r;return e!==null?(Sq[jte]=Y2r(e),r=new Sq,Sq[jte]=null,r[AYe]=e):r=v8(),t===void 0?r:q2r.f(r,t)},tTr=Yl,rTr=xl,nTr=rTr.RegExp,iTr=tTr(function(){var n=nTr(".","s");return!(n.dotAll&&n.test(` `)&&n.flags==="s")}),aTr=Yl,oTr=xl,sTr=oTr.RegExp,lTr=aTr(function(){var n=sTr("(?b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$c")!=="bc"}),wA=Sc,t$=ql,uTr=Bm,hTr=EYe,cTr=TYe,fTr=Aue,dTr=Yue,vTr=YV.get,pTr=iTr,gTr=lTr,yTr=fTr("native-string-replace",String.prototype.replace),_7=RegExp.prototype.exec,Yte=_7,mTr=t$("".charAt),_Tr=t$("".indexOf),xTr=t$("".replace),wq=t$("".slice),qte=function(){var n=/a/,e=/b*/g;return wA(_7,n,"a"),wA(_7,e,"a"),n.lastIndex!==0||e.lastIndex!==0}(),IYe=cTr.BROKEN_CARET,Zte=/()??/.exec("")[1]!==void 0,STr=qte||Zte||IYe||pTr||gTr;STr&&(Yte=function(e){var t=this,r=vTr(t),i=uTr(e),a=r.raw,o,s,l,u,h,c,f;if(a)return a.lastIndex=t.lastIndex,o=wA(Yte,a,i),t.lastIndex=a.lastIndex,o;var d=r.groups,v=IYe&&t.sticky,p=wA(hTr,t),g=t.source,m=0,y=i;if(v&&(p=xTr(p,"y",""),_Tr(p,"g")===-1&&(p+="g"),y=wq(i,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&mTr(i,t.lastIndex-1)!==` `)&&(g="(?: "+g+")",y=" "+y,m++),s=new RegExp("^(?:"+g+")",p)),Zte&&(s=new RegExp("^"+g+"$(?!\\s)",p)),qte&&(l=t.lastIndex),u=wA(_7,v?s:t,y),v?u?(u.input=wq(u.input,m),u[0]=wq(u[0],m),u.index=t.lastIndex,t.lastIndex+=u[0].length):t.lastIndex=0:qte&&u&&(t.lastIndex=t.global?u.index+u[0].length:l),Zte&&u&&u.length>1&&wA(yTr,u[0],s,function(){for(h=1;h=a?n?"":void 0:(o=kCe(r,i),o<55296||o>56319||i+1===a||(s=kCe(r,i+1))<56320||s>57343?n?ITr(r,i):o:n?LTr(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},PTr={codeAt:FCe(!1),charAt:FCe(!0)},OTr=PTr.charAt,Jue=function(n,e,t){return e+(t?OTr(n,e).length:1)},RTr=xl,DTr=Yl,BCe=RTr.RegExp,NTr=!DTr(function(){var n=!0;try{BCe(".","d")}catch{n=!1}var e={},t="",r=n?"dgimsy":"gimsy",i=function(l,u){Object.defineProperty(e,l,{get:function(){return t+=u,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};n&&(a.hasIndices="d");for(var o in a)i(o,a[o]);var s=Object.getOwnPropertyDescriptor(BCe.prototype,"flags").get.call(e);return s!==r||t!==r}),kTr={correct:NTr},FTr=Sc,BTr=W0,GTr=VV,GCe=kTr,zTr=EYe,UTr=RegExp.prototype,Que=GCe.correct?function(n){return n.flags}:function(n){return!GCe.correct&>r(UTr,n)&&!BTr(n,"flags")?FTr(zTr,n):n.flags},zCe=Sc,VTr=Xf,$Tr=yu,WTr=gT,HTr=que,jTr=TypeError,ehe=function(n,e){var t=n.exec;if($Tr(t)){var r=zCe(t,n,e);return r!==null&&VTr(r),r}if(WTr(n)==="RegExp")return zCe(HTr,n,e);throw new jTr("RegExp#exec called on incompatible receiver")},XTr=Sc,YTr=ql,qTr=Zue,ZTr=Xf,KTr=Ud,JTr=aL,x6=Bm,QTr=$0,eCr=iL,tCr=Jue,rCr=Que,UCe=ehe,VCe=YTr("".indexOf);qTr("match",function(n,e,t){return[function(i){var a=QTr(this),o=KTr(i)?eCr(i,n):void 0;return o?XTr(o,i,a):new RegExp(i)[n](x6(a))},function(r){var i=ZTr(this),a=x6(r),o=t(e,i,a);if(o.done)return o.value;var s=x6(rCr(i));if(VCe(s,"g")===-1)return UCe(i,a);var l=VCe(s,"u")!==-1;i.lastIndex=0;for(var u=[],h=0,c;(c=UCe(i,a))!==null;){var f=x6(c[0]);u[h]=f,f===""&&(i.lastIndex=tCr(a,JTr(i.lastIndex),l)),h++}return h===0?null:u}]});var the=ql,nCr=HV,iCr=Math.floor,Eq=the("".charAt),aCr=the("".replace),Tq=the("".slice),oCr=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,sCr=/\$([$&'`]|\d{1,2})/g,lCr=function(n,e,t,r,i,a){var o=t+n.length,s=r.length,l=sCr;return i!==void 0&&(i=nCr(i),l=oCr),aCr(a,l,function(u,h){var c;switch(Eq(h,0)){case"$":return"$";case"&":return n;case"`":return Tq(e,0,t);case"'":return Tq(e,o);case"<":c=i[Tq(h,1,-1)];break;default:var f=+h;if(f===0)return u;if(f>s){var d=iCr(f/10);return d===0?u:d<=s?r[d-1]===void 0?Eq(h,1):r[d-1]+Eq(h,1):u}c=r[f-1]}return c===void 0?"":c})},uCr=JXe,$Ce=Sc,r$=ql,hCr=Zue,cCr=Yl,fCr=Xf,dCr=yu,vCr=Ud,pCr=qV,gCr=aL,wb=Bm,yCr=$0,mCr=Jue,_Cr=iL,xCr=lCr,SCr=Que,wCr=ehe,bCr=Jh,Kte=bCr("replace"),ECr=Math.max,TCr=Math.min,CCr=r$([].concat),Cq=r$([].push),S6=r$("".indexOf),WCe=r$("".slice),ACr=function(n){return n===void 0?n:String(n)},MCr=function(){return"a".replace(/./,"$0")==="$0"}(),HCe=function(){return/./[Kte]?/./[Kte]("a","$0")==="":!1}(),ICr=!cCr(function(){var n=/./;return n.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(n,"$")!=="7"});hCr("replace",function(n,e,t){var r=HCe?"$":"$0";return[function(a,o){var s=yCr(this),l=vCr(a)?_Cr(a,Kte):void 0;return l?$Ce(l,a,s,o):$Ce(e,wb(s),a,o)},function(i,a){var o=fCr(this),s=wb(i);if(typeof a=="string"&&S6(a,r)===-1&&S6(a,"$<")===-1){var l=t(e,o,s,a);if(l.done)return l.value}var u=dCr(a);u||(a=wb(a));var h=wb(SCr(o)),c=S6(h,"g")!==-1,f;c&&(f=S6(h,"u")!==-1,o.lastIndex=0);for(var d=[],v;v=wCr(o,s),!(v===null||(Cq(d,v),!c));){var p=wb(v[0]);p===""&&(o.lastIndex=mCr(s,gCr(o.lastIndex),f))}for(var g="",m=0,y=0;y=m&&(g+=WCe(s,m,x)+w,m=x+_.length)}return g+WCe(s,m)}]},!ICr||!MCr||HCe);var LCr=Ud,PCr=gT,OCr=Jh,RCr=OCr("match"),DCr=function(n){var e;return LCr(n)&&((e=n[RCr])!==void 0?!!e:PCr(n)==="RegExp")},NCr=DCr,kCr=TypeError,rhe=function(n){if(NCr(n))throw new kCr("The method doesn't accept regular expressions");return n},FCr=Jh,BCr=FCr("match"),nhe=function(n){var e=/./;try{"/./"[n](e)}catch{try{return e[BCr]=!1,"/./"[n](e)}catch{}}return!1},GCr=Yf,zCr=JV,UCr=Ak.f,VCr=aL,jCe=Bm,$Cr=rhe,WCr=$0,HCr=nhe,jCr=zCr("".slice),XCr=Math.min,PYe=HCr("startsWith"),YCr=!PYe&&!!function(){var n=UCr(String.prototype,"startsWith");return n&&!n.writable}();GCr({target:"String",proto:!0,forced:!YCr&&!PYe},{startsWith:function(e){var t=jCe(WCr(this));$Cr(e);var r=VCr(XCr(arguments.length>1?arguments[1]:void 0,t.length)),i=jCe(e);return jCr(t,r,r+i.length)===i}});var qCr=Jh,ZCr=Yue,KCr=X_.f,Jte=qCr("unscopables"),Qte=Array.prototype;Qte[Jte]===void 0&&KCr(Qte,Jte,{configurable:!0,value:ZCr(null)});var JCr=function(n){Qte[Jte][n]=!0},QCr=Yl,eAr=!QCr(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype}),tAr=W0,rAr=yu,nAr=HV,iAr=Pue,aAr=eAr,XCe=iAr("IE_PROTO"),ere=Object,oAr=ere.prototype,OYe=aAr?ere.getPrototypeOf:function(n){var e=nAr(n);if(tAr(e,XCe))return e[XCe];var t=e.constructor;return rAr(t)&&e instanceof t?t.prototype:e instanceof ere?oAr:null},sAr=Yl,lAr=yu,uAr=Ud,YCe=OYe,hAr=mT,cAr=Jh,tre=cAr("iterator"),RYe=!1,g2,Aq,Mq;[].keys&&(Mq=[].keys(),"next"in Mq?(Aq=YCe(YCe(Mq)),Aq!==Object.prototype&&(g2=Aq)):RYe=!0);var fAr=!uAr(g2)||sAr(function(){var n={};return g2[tre].call(n)!==n});fAr&&(g2={});lAr(g2[tre])||hAr(g2,tre,function(){return this});var DYe={IteratorPrototype:g2,BUGGY_SAFARI_ITERATORS:RYe},dAr=DYe.IteratorPrototype,vAr=Yue,pAr=Eue,gAr=KV,yAr=Rk,mAr=function(){return this},_Ar=function(n,e,t,r){var i=e+" Iterator";return n.prototype=vAr(dAr,{next:pAr(+!r,t)}),gAr(n,i,!1),yAr[i]=mAr,n},xAr=Yf,SAr=Sc,NYe=XV,wAr=yu,bAr=_Ar,qCe=OYe,ZCe=WXe,EAr=KV,TAr=Lk,Iq=mT,CAr=Jh,AAr=Rk,kYe=DYe,MAr=NYe.PROPER,IAr=NYe.CONFIGURABLE,KCe=kYe.IteratorPrototype,w6=kYe.BUGGY_SAFARI_ITERATORS,GP=CAr("iterator"),JCe="keys",zP="values",QCe="entries",LAr=function(){return this},PAr=function(n,e,t,r,i,a,o){bAr(t,e,r);var s=function(m){if(m===i&&f)return f;if(!w6&&m&&m in h)return h[m];switch(m){case JCe:return function(){return new t(this,m)};case zP:return function(){return new t(this,m)};case QCe:return function(){return new t(this,m)}}return function(){return new t(this)}},l=e+" Iterator",u=!1,h=n.prototype,c=h[GP]||h["@@iterator"]||i&&h[i],f=!w6&&c||s(i),d=e==="Array"&&h.entries||c,v,p,g;if(d&&(v=qCe(d.call(new n)),v!==Object.prototype&&v.next&&(qCe(v)!==KCe&&(ZCe?ZCe(v,KCe):wAr(v[GP])||Iq(v,GP,LAr)),EAr(v,l,!0))),MAr&&i===zP&&c&&c.name!==zP&&(IAr?TAr(h,"name",zP):(u=!0,f=function(){return SAr(c,this)})),i)if(p={values:s(zP),keys:a?f:s(JCe),entries:s(QCe)},o)for(g in p)(w6||u||!(g in h))&&Iq(h,g,p[g]);else xAr({target:e,proto:!0,forced:w6||u},p);return h[GP]!==f&&Iq(h,GP,f,{name:i}),AAr[e]=f,p},OAr=function(n,e){return{value:n,done:e}},RAr=Mk,ihe=JCr,eAe=Rk,FYe=YV,DAr=X_.f,NAr=PAr,b6=OAr,kAr=V0,BYe="Array Iterator",FAr=FYe.set,BAr=FYe.getterFor(BYe),GAr=NAr(Array,"Array",function(n,e){FAr(this,{type:BYe,target:RAr(n),index:0,kind:e})},function(){var n=BAr(this),e=n.target,t=n.index++;if(!e||t>=e.length)return n.target=null,b6(void 0,!0);switch(n.kind){case"keys":return b6(t,!1);case"values":return b6(e[t],!1)}return b6([t,e[t]],!1)},"values"),tAe=eAe.Arguments=eAe.Array;ihe("keys");ihe("values");ihe("entries");if(kAr&&tAe.name!=="values")try{DAr(tAe,"name",{value:"values"})}catch{}var zAr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},UAr=jV,Lq=UAr("span").classList,rAe=Lq&&Lq.constructor&&Lq.constructor.prototype,VAr=rAe===Object.prototype?void 0:rAe,nAe=xl,GYe=zAr,$Ar=VAr,IO=GAr,iAe=Lk,WAr=KV,HAr=Jh,Pq=HAr("iterator"),Oq=IO.values,zYe=function(n,e){if(n){if(n[Pq]!==Oq)try{iAe(n,Pq,Oq)}catch{n[Pq]=Oq}if(WAr(n,e,!0),GYe[e]){for(var t in IO)if(n[t]!==IO[t])try{iAe(n,t,IO[t])}catch{n[t]=IO[t]}}}};for(var Rq in GYe)zYe(nAe[Rq]&&nAe[Rq].prototype,Rq);zYe($Ar,"DOMTokenList");var jAr=j_,XAr=HV,YAr=CXe,qAr=Due,aAe=TypeError,oAe="Reduce of empty array with no initial value",sAe=function(n){return function(e,t,r,i){var a=XAr(e),o=YAr(a),s=qAr(a);if(jAr(t),s===0&&r<2)throw new aAe(oAe);var l=n?s-1:0,u=n?-1:1;if(r<2)for(;;){if(l in o){i=o[l],l+=u;break}if(l+=u,n?l<0:s<=l)throw new aAe(oAe)}for(;n?l>=0:s>l;l+=u)l in o&&(i=t(i,o[l],l,a));return i}},ZAr={left:sAe(!1),right:sAe(!0)},KAr=Yl,UYe=function(n,e){var t=[][n];return!!t&&KAr(function(){t.call(null,e||function(){return 1},1)})},JAr=Yf,QAr=ZAr.left,eMr=UYe,lAe=Tue,tMr=ZV,rMr=!tMr&&lAe>79&&lAe<83,nMr=rMr||!eMr("reduce");JAr({target:"Array",proto:!0,forced:nMr},{reduce:function(e){var t=arguments.length;return QAr(this,e,t,t>1?arguments[1]:void 0)}});var iMr=Yf,aMr=JV,oMr=Ak.f,sMr=aL,uAe=Bm,lMr=rhe,uMr=$0,hMr=nhe,cMr=aMr("".slice),fMr=Math.min,VYe=hMr("endsWith"),dMr=!VYe&&!!function(){var n=oMr(String.prototype,"endsWith");return n&&!n.writable}();iMr({target:"String",proto:!0,forced:!dMr&&!VYe},{endsWith:function(e){var t=uAe(uMr(this));lMr(e);var r=arguments.length>1?arguments[1]:void 0,i=t.length,a=r===void 0?i:fMr(sMr(r),i),o=uAe(e);return cMr(t,a-o.length,a)===o}});var Dq=Sc,$Ye=ql,vMr=Zue,pMr=Xf,gMr=Ud,yMr=$0,mMr=ZXe,_Mr=Jue,xMr=aL,hAe=Bm,SMr=iL,cAe=ehe,wMr=TYe,bMr=Yl,TC=wMr.UNSUPPORTED_Y,EMr=4294967295,TMr=Math.min,Nq=$Ye([].push),kq=$Ye("".slice),CMr=!bMr(function(){var n=/(?:)/,e=n.exec;n.exec=function(){return e.apply(this,arguments)};var t="ab".split(n);return t.length!==2||t[0]!=="a"||t[1]!=="b"}),fAe="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;vMr("split",function(n,e,t){var r="0".split(void 0,0).length?function(i,a){return i===void 0&&a===0?[]:Dq(e,this,i,a)}:e;return[function(a,o){var s=yMr(this),l=gMr(a)?SMr(a,n):void 0;return l?Dq(l,a,s,o):Dq(r,hAe(s),a,o)},function(i,a){var o=pMr(this),s=hAe(i);if(!fAe){var l=t(r,o,s,a,r!==e);if(l.done)return l.value}var u=mMr(o,RegExp),h=o.unicode,c=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(TC?"g":"y"),f=new u(TC?"^(?:"+o.source+")":o,c),d=a===void 0?EMr:a>>>0;if(d===0)return[];if(s.length===0)return cAe(f,s)===null?[s]:[];for(var v=0,p=0,g=[];p"u"?at:window,E6=["moz","webkit"],eM="AnimationFrame",jM=Q1["request"+eM],yN=Q1["cancel"+eM]||Q1["cancelRequest"+eM];for(var UP=0;!jM&&UP3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var l=this.r.toString(16),u=this.g.toString(16),h=this.b.toString(16);return l.length==1&&(l="0"+l),u.length==1&&(u="0"+u),h.length==1&&(h="0"+h),"#"+l+u+h},this.getHelpXML=function(){for(var l=new Array,u=0;u "+p.toRGB()+" -> "+p.toHex());v.appendChild(g),v.appendChild(m),d.appendChild(v)}catch{}return d}},UMr=Yf,VMr=JV,$Mr=GXe.indexOf,WMr=UYe,ire=VMr([].indexOf),HYe=!!ire&&1/ire([1],1,-0)<0,HMr=HYe||!WMr("indexOf");UMr({target:"Array",proto:!0,forced:HMr},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return HYe?ire(this,e,t)||0:$Mr(this,e,t)}});var jMr=Yf,XMr=ql,YMr=rhe,qMr=$0,yAe=Bm,ZMr=nhe,KMr=XMr("".indexOf);jMr({target:"String",proto:!0,forced:!ZMr("includes")},{includes:function(e){return!!~KMr(yAe(qMr(this)),yAe(YMr(e)),arguments.length>1?arguments[1]:void 0)}});var JMr=gT,QMr=Array.isArray||function(e){return JMr(e)==="Array"},eIr=Yf,tIr=ql,rIr=QMr,nIr=tIr([].reverse),mAe=[1,2];eIr({target:"Array",proto:!0,forced:String(mAe)===String(mAe.reverse())},{reverse:function(){return rIr(this)&&(this.length=this.length),nIr(this)}});/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var jYe=function(n,e){return(jYe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(n,e)};function XYe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}jYe(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function iIr(n){var e="";Array.isArray(n)||(n=[n]);for(var t=0;tn.phi1&&(n.phi2-=2*Vx),n.sweepFlag===1&&n.phi2r)return[];if(r===0)return[[n*t/(n*n+e*e),e*t/(n*n+e*e)]];var i=Math.sqrt(r);return[[(n*t+e*i)/(n*n+e*e),(e*t-n*i)/(n*n+e*e)],[(n*t-e*i)/(n*n+e*e),(e*t+n*i)/(n*n+e*e)]]}var Tu,s1=Math.PI/180;function xAe(n,e,t){return(1-t)*n+t*e}function SAe(n,e,t,r){return n+Math.cos(r/180*Vx)*e+Math.sin(r/180*Vx)*t}function wAe(n,e,t,r){var i=1e-6,a=e-n,o=t-e,s=3*a+3*(r-t)-6*o,l=6*(o-a),u=3*a;return Math.abs(s)b&&(d.sweepFlag=+!d.sweepFlag),d})}function o(){return function(s){var l={};for(var u in s)l[u]=s[u];return l}}n.ROUND=function(s){function l(u){return Math.round(u*s)/s}return s===void 0&&(s=1e13),Rg(s),function(u){return u.x1!==void 0&&(u.x1=l(u.x1)),u.y1!==void 0&&(u.y1=l(u.y1)),u.x2!==void 0&&(u.x2=l(u.x2)),u.y2!==void 0&&(u.y2=l(u.y2)),u.x!==void 0&&(u.x=l(u.x)),u.y!==void 0&&(u.y=l(u.y)),u.rX!==void 0&&(u.rX=l(u.rX)),u.rY!==void 0&&(u.rY=l(u.rY)),u}},n.TO_ABS=e,n.TO_REL=function(){return i(function(s,l,u){return s.relative||(s.x1!==void 0&&(s.x1-=l),s.y1!==void 0&&(s.y1-=u),s.x2!==void 0&&(s.x2-=l),s.y2!==void 0&&(s.y2-=u),s.x!==void 0&&(s.x-=l),s.y!==void 0&&(s.y-=u),s.relative=!0),s})},n.NORMALIZE_HVZ=function(s,l,u){return s===void 0&&(s=!0),l===void 0&&(l=!0),u===void 0&&(u=!0),i(function(h,c,f,d,v){if(isNaN(d)&&!(h.type&_r.MOVE_TO))throw new Error("path must start with moveto");return l&&h.type&_r.HORIZ_LINE_TO&&(h.type=_r.LINE_TO,h.y=h.relative?0:f),u&&h.type&_r.VERT_LINE_TO&&(h.type=_r.LINE_TO,h.x=h.relative?0:c),s&&h.type&_r.CLOSE_PATH&&(h.type=_r.LINE_TO,h.x=h.relative?d-c:d,h.y=h.relative?v-f:v),h.type&_r.ARC&&(h.rX===0||h.rY===0)&&(h.type=_r.LINE_TO,delete h.rX,delete h.rY,delete h.xRot,delete h.lArcFlag,delete h.sweepFlag),h})},n.NORMALIZE_ST=t,n.QT_TO_C=r,n.INFO=i,n.SANITIZE=function(s){s===void 0&&(s=0),Rg(s);var l=NaN,u=NaN,h=NaN,c=NaN;return i(function(f,d,v,p,g){var m=Math.abs,y=!1,_=0,x=0;if(f.type&_r.SMOOTH_CURVE_TO&&(_=isNaN(l)?0:d-l,x=isNaN(u)?0:v-u),f.type&(_r.CURVE_TO|_r.SMOOTH_CURVE_TO)?(l=f.relative?d+f.x2:f.x2,u=f.relative?v+f.y2:f.y2):(l=NaN,u=NaN),f.type&_r.SMOOTH_QUAD_TO?(h=isNaN(h)?d:2*d-h,c=isNaN(c)?v:2*v-c):f.type&_r.QUAD_TO?(h=f.relative?d+f.x1:f.x1,c=f.relative?v+f.y1:f.y2):(h=NaN,c=NaN),f.type&_r.LINE_COMMANDS||f.type&_r.ARC&&(f.rX===0||f.rY===0||!f.lArcFlag)||f.type&_r.CURVE_TO||f.type&_r.SMOOTH_CURVE_TO||f.type&_r.QUAD_TO||f.type&_r.SMOOTH_QUAD_TO){var S=f.x===void 0?0:f.relative?f.x:f.x-d,w=f.y===void 0?0:f.relative?f.y:f.y-v;_=isNaN(h)?f.x1===void 0?_:f.relative?f.x:f.x1-d:h-d,x=isNaN(c)?f.y1===void 0?x:f.relative?f.y:f.y1-v:c-v;var b=f.x2===void 0?0:f.relative?f.x:f.x2-d,E=f.y2===void 0?0:f.relative?f.y:f.y2-v;m(S)<=s&&m(w)<=s&&m(_)<=s&&m(x)<=s&&m(b)<=s&&m(E)<=s&&(y=!0)}return f.type&_r.CLOSE_PATH&&m(d-p)<=s&&m(v-g)<=s&&(y=!0),y?[]:f})},n.MATRIX=a,n.ROTATE=function(s,l,u){l===void 0&&(l=0),u===void 0&&(u=0),Rg(s,l,u);var h=Math.sin(s),c=Math.cos(s);return a(c,h,-h,c,l-l*c+u*h,u-l*h-u*c)},n.TRANSLATE=function(s,l){return l===void 0&&(l=0),Rg(s,l),a(1,0,0,1,s,l)},n.SCALE=function(s,l){return l===void 0&&(l=s),Rg(s,l),a(s,0,0,l,0,0)},n.SKEW_X=function(s){return Rg(s),a(1,0,Math.atan(s),1,0,0)},n.SKEW_Y=function(s){return Rg(s),a(1,Math.atan(s),0,1,0,0)},n.X_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),Rg(s),a(-1,0,0,1,s,0)},n.Y_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),Rg(s),a(1,0,0,-1,0,s)},n.A_TO_C=function(){return i(function(s,l,u){return _r.ARC===s.type?function(h,c,f){var d,v,p,g;h.cX||Gq(h,c,f);for(var m=Math.min(h.phi1,h.phi2),y=Math.max(h.phi1,h.phi2)-m,_=Math.ceil(y/90),x=new Array(_),S=c,w=f,b=0;b<_;b++){var E=xAe(h.phi1,h.phi2,b/_),T=xAe(h.phi1,h.phi2,(b+1)/_),C=T-E,A=4/3*Math.tan(C*s1/4),M=[Math.cos(E*s1)-A*Math.sin(E*s1),Math.sin(E*s1)+A*Math.cos(E*s1)],I=M[0],R=M[1],k=[Math.cos(T*s1),Math.sin(T*s1)],D=k[0],G=k[1],W=[D+A*Math.sin(T*s1),G-A*Math.cos(T*s1)],z=W[0],V=W[1];x[b]={relative:h.relative,type:_r.CURVE_TO};var q=function(Y,le){var j=are([Y*h.rX,le*h.rY],h.xRot),Q=j[0],ie=j[1];return[h.cX+Q,h.cY+ie]};d=q(I,R),x[b].x1=d[0],x[b].y1=d[1],v=q(z,V),x[b].x2=v[0],x[b].y2=v[1],p=q(D,G),x[b].x=p[0],x[b].y=p[1],h.relative&&(x[b].x1-=S,x[b].y1-=w,x[b].x2-=S,x[b].y2-=w,x[b].x-=S,x[b].y-=w),S=(g=[x[b].x,x[b].y])[0],w=g[1]}return x}(s,s.relative?0:l,s.relative?0:u):s})},n.ANNOTATE_ARCS=function(){return i(function(s,l,u){return s.relative&&(l=0,u=0),_r.ARC===s.type&&Gq(s,l,u),s})},n.CLONE=o,n.CALCULATE_BOUNDS=function(){var s=function(f){var d={};for(var v in f)d[v]=f[v];return d},l=e(),u=r(),h=t(),c=i(function(f,d,v){var p=h(u(l(s(f))));function g(V){V>c.maxX&&(c.maxX=V),Vc.maxY&&(c.maxY=V),Vz&&g(bAe(d,p.x1,p.x2,p.x,z));for(var x=0,S=wAe(v,p.y1,p.y2,p.y);xz&&m(bAe(v,p.y1,p.y2,p.y,z))}if(p.type&_r.ARC){g(p.x),m(p.y),Gq(p,d,v);for(var w=p.xRot/180*Math.PI,b=Math.cos(w)*p.rX,E=Math.sin(w)*p.rX,T=-Math.sin(w)*p.rY,C=Math.cos(w)*p.rY,A=p.phi1p.phi2?[p.phi2+360,p.phi1+360]:[p.phi2,p.phi1],M=A[0],I=A[1],R=function(V){var q=V[0],Y=V[1],le=180*Math.atan2(Y,q)/Math.PI;return leM&&zM&&zh)throw new SyntaxError('Expected positive number, got "'+h+'" at index "'+o+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+o+'"')}this.curArgs.push(h),this.curArgs.length===sIr[this.curCommandType]&&(_r.HORIZ_LINE_TO===this.curCommandType?a({type:_r.HORIZ_LINE_TO,relative:this.curCommandRelative,x:h}):_r.VERT_LINE_TO===this.curCommandType?a({type:_r.VERT_LINE_TO,relative:this.curCommandRelative,y:h}):this.curCommandType===_r.MOVE_TO||this.curCommandType===_r.LINE_TO||this.curCommandType===_r.SMOOTH_QUAD_TO?(a({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),_r.MOVE_TO===this.curCommandType&&(this.curCommandType=_r.LINE_TO)):this.curCommandType===_r.CURVE_TO?a({type:_r.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===_r.SMOOTH_CURVE_TO?a({type:_r.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_r.QUAD_TO?a({type:_r.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_r.ARC&&a({type:_r.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!aIr(s))if(s===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(s!=="+"&&s!=="-"&&s!==".")if(u)this.curNumber=s,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+o+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+s+'" at index '+o+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,s!=="z"&&s!=="Z")if(s==="h"||s==="H")this.curCommandType=_r.HORIZ_LINE_TO,this.curCommandRelative=s==="h";else if(s==="v"||s==="V")this.curCommandType=_r.VERT_LINE_TO,this.curCommandRelative=s==="v";else if(s==="m"||s==="M")this.curCommandType=_r.MOVE_TO,this.curCommandRelative=s==="m";else if(s==="l"||s==="L")this.curCommandType=_r.LINE_TO,this.curCommandRelative=s==="l";else if(s==="c"||s==="C")this.curCommandType=_r.CURVE_TO,this.curCommandRelative=s==="c";else if(s==="s"||s==="S")this.curCommandType=_r.SMOOTH_CURVE_TO,this.curCommandRelative=s==="s";else if(s==="q"||s==="Q")this.curCommandType=_r.QUAD_TO,this.curCommandRelative=s==="q";else if(s==="t"||s==="T")this.curCommandType=_r.SMOOTH_QUAD_TO,this.curCommandRelative=s==="t";else{if(s!=="a"&&s!=="A")throw new SyntaxError('Unexpected character "'+s+'" at index '+o+".");this.curCommandType=_r.ARC,this.curCommandRelative=s==="a"}else r.push({type:_r.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=s,this.curNumberHasDecimal=s==="."}else this.curNumber+=s,this.curNumberHasDecimal=!0;else this.curNumber+=s;else this.curNumber+=s,this.curNumberHasExp=!0;else this.curNumber+=s,this.curNumberHasExpDigits=this.curNumberHasExp}return r},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(r,i){i===void 0&&(i=[]);for(var a=0,o=Object.getPrototypeOf(this).parse.call(this,r);a>>S;if(o[_+3]=re,re!==0){var yt=255/re;o[_]=(V*x>>>S)*yt,o[_+1]=(q*x>>>S)*yt,o[_+2]=(Y*x>>>S)*yt}else o[_]=o[_+1]=o[_+2]=0;V-=D,q-=G,Y-=W,le-=z,D-=g.r,G-=g.g,W-=g.b,z-=g.a;var je=Le+a+1;je=y+(je>>S,We>0?(We=255/We,o[oi]=(wt*x>>>S)*We,o[oi+1]=(pt*x>>>S)*We,o[oi+2]=(ar*x>>>S)*We):o[oi]=o[oi+1]=o[oi+2]=0,wt-=Tt,pt-=Qe,ar-=zt,kt-=mt,Tt-=g.r,Qe-=g.g,zt-=g.b,mt-=g.a,oi=Dt+((oi=Oi+h)e--&&i?String(Math.round(parseFloat(r))):r);return t}var CIr=/(\[[^\]]+\])/g,AIr=/(#[^\s+>~.[:]+)/g,MIr=/(\.[^\s+>~.[:]+)/g,IIr=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,LIr=/(:[\w-]+\([^)]*\))/gi,PIr=/(:[^\s+>~.[:]+)/g,OIr=/([^\s+>~.[:]+)/g;function Eb(n,e){var t=e.exec(n);return t?[n.replace(e," "),t.length]:[n,0]}function RIr(n){var e=[0,0,0],t=n.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[t,r]=Eb(t,CIr),e[1]+=r,[t,r]=Eb(t,AIr),e[0]+=r,[t,r]=Eb(t,MIr),e[1]+=r,[t,r]=Eb(t,IIr),e[2]+=r,[t,r]=Eb(t,LIr),e[1]+=r,[t,r]=Eb(t,PIr),e[1]+=r,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,r]=Eb(t,OIr),e[2]+=r,e.join("")}var tM=1e-8;function AAe(n){return Math.sqrt(Math.pow(n[0],2)+Math.pow(n[1],2))}function ore(n,e){return(n[0]*e[0]+n[1]*e[1])/(AAe(n)*AAe(e))}function MAe(n,e){return(n[0]*e[1]0&&arguments[0]!==void 0?arguments[0]:" ",{document:t,name:r}=this;return sL(this.getString()).trim().split(e).map(i=>new jn(t,r,i))}hasValue(e){var{value:t}=this;return t!==null&&t!==""&&(e||t!==0)&&typeof t<"u"}isString(e){var{value:t}=this,r=typeof t=="string";return!r||!e?r:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);var{value:t}=this,r=parseFloat(t);return this.isString(/%$/)&&(r/=100),r}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=TIr(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[r,i]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:a}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(a.computeSize("x"),a.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(a.computeSize("x"),a.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*a.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*a.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&i):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*a.computeSize(r);default:{var o=this.getNumber();return t&&o<1?o*a.computeSize(r):o}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}getFillStyleDefinition(e,t){var r=this.getDefinition();if(!r)return null;if(typeof r.createGradient=="function")return r.createGradient(this.document.ctx,e,t);if(typeof r.createPattern=="function"){if(r.getHrefAttribute().hasValue()){var i=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),i.hasValue()&&r.getAttribute("patternTransform",!0).setValue(i.value)}return r.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){return this.hasValue()?jn.textBaselineMapping[this.getString()]:null}addOpacity(e){for(var t=this.getColor(),r=t.length,i=0,a=0;a1&&arguments[1]!==void 0?arguments[1]:0,[r=t,i=t]=xv(e);return new su(r,i)}static parseScale(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[r=t,i=r]=xv(e);return new su(r,i)}static parsePath(e){for(var t=xv(e),r=t.length,i=[],a=0;a0}runEvents(){if(!!this.working){var{screen:e,events:t,eventElements:r}=this,{style:i}=e.ctx.canvas;i&&(i.cursor=""),t.forEach((a,o)=>{for(var{run:s}=a,l=r[o];l;)s(l),l=l.parent}),this.events=[],this.eventElements=[]}}checkPath(e,t){if(!(!this.working||!t)){var{events:r,eventElements:i}=this;r.forEach((a,o)=>{var{x:s,y:l}=a;!i[o]&&t.isPointInPath&&t.isPointInPath(s,l)&&(i[o]=e)})}}checkBoundingBox(e,t){if(!(!this.working||!t)){var{events:r,eventElements:i}=this;r.forEach((a,o)=>{var{x:s,y:l}=a;!i[o]&&t.isPointInBox(s,l)&&(i[o]=e)})}}mapXY(e,t){for(var{window:r,ctx:i}=this.screen,a=new su(e,t),o=i.canvas;o;)a.x-=o.offsetLeft,a.y-=o.offsetTop,o=o.offsetParent;return r.scrollX&&(a.x+=r.scrollX),r.scrollY&&(a.y+=r.scrollY),a}onClick(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:r,run(i){i.onClick&&i.onClick()}})}onMouseMove(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:r,run(i){i.onMouseMove&&i.onMouseMove()}})}}var JYe=typeof window<"u"?window:null,QYe=typeof fetch<"u"?fetch.bind(void 0):null;class n${constructor(e){var{fetch:t=QYe,window:r=JYe}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new DIr,this.mouse=new NIr(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=r,this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(t=>t());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:t,ctx:r,aspectRatio:i,width:a,desiredWidth:o,height:s,desiredHeight:l,minX:u=0,minY:h=0,refX:c,refY:f,clip:d=!1,clipX:v=0,clipY:p=0}=e,g=sL(i).replace(/^defer\s/,""),[m,y]=g.split(" "),_=m||"xMidYMid",x=y||"meet",S=a/o,w=s/l,b=Math.min(S,w),E=Math.max(S,w),T=o,C=l;x==="meet"&&(T*=b,C*=b),x==="slice"&&(T*=E,C*=E);var A=new jn(t,"refX",c),M=new jn(t,"refY",f),I=A.hasValue()&&M.hasValue();if(I&&r.translate(-b*A.getPixels("x"),-b*M.getPixels("y")),d){var R=b*v,k=b*p;r.beginPath(),r.moveTo(R,k),r.lineTo(a,k),r.lineTo(a,s),r.lineTo(R,s),r.closePath(),r.clip()}if(!I){var D=x==="meet"&&b===w,G=x==="slice"&&E===w,W=x==="meet"&&b===S,z=x==="slice"&&E===S;_.startsWith("xMid")&&(D||G)&&r.translate(a/2-T/2,0),_.endsWith("YMid")&&(W||z)&&r.translate(0,s/2-C/2),_.startsWith("xMax")&&(D||G)&&r.translate(a-T,0),_.endsWith("YMax")&&(W||z)&&r.translate(0,s-C)}switch(!0){case _==="none":r.scale(S,w);break;case x==="meet":r.scale(b,b);break;case x==="slice":r.scale(E,E);break}r.translate(-u,-h)}start(e){var{enableRedraw:t=!1,ignoreMouse:r=!1,ignoreAnimation:i=!1,ignoreDimensions:a=!1,ignoreClear:o=!1,forceRedraw:s,scaleWidth:l,scaleHeight:u,offsetX:h,offsetY:c}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:f,mouse:d}=this,v=1e3/f;if(this.frameDuration=v,this.readyPromise=new Promise(_=>{this.resolveReady=_}),this.isReady()&&this.render(e,a,o,l,u,h,c),!!t){var p=Date.now(),g=p,m=0,y=()=>{p=Date.now(),m=p-g,m>=v&&(g=p-m%v,this.shouldUpdate(i,s)&&(this.render(e,a,o,l,u,h,c),d.runEvents())),this.intervalId=QA.exports(y)};r||d.start(),this.intervalId=QA.exports(y)}}stop(){this.intervalId&&(QA.exports.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){var{frameDuration:r}=this,i=this.animations.reduce((a,o)=>o.update(r)||a,!1);if(i)return!0}return!!(typeof t=="function"&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,r,i,a,o,s){var{CLIENT_WIDTH:l,CLIENT_HEIGHT:u,viewPort:h,ctx:c,isFirstRender:f}=this,d=c.canvas;h.clear(),d.width&&d.height?h.setCurrent(d.width,d.height):h.setCurrent(l,u);var v=e.getStyle("width"),p=e.getStyle("height");!t&&(f||typeof i!="number"&&typeof a!="number")&&(v.hasValue()&&(d.width=v.getPixels("x"),d.style&&(d.style.width="".concat(d.width,"px"))),p.hasValue()&&(d.height=p.getPixels("y"),d.style&&(d.style.height="".concat(d.height,"px"))));var g=d.clientWidth||d.width,m=d.clientHeight||d.height;if(t&&v.hasValue()&&p.hasValue()&&(g=v.getPixels("x"),m=p.getPixels("y")),h.setCurrent(g,m),typeof o=="number"&&e.getAttribute("x",!0).setValue(o),typeof s=="number"&&e.getAttribute("y",!0).setValue(s),typeof i=="number"||typeof a=="number"){var y=xv(e.getAttribute("viewBox").getString()),_=0,x=0;if(typeof i=="number"){var S=e.getStyle("width");S.hasValue()?_=S.getPixels("x")/i:isNaN(y[2])||(_=y[2]/i)}if(typeof a=="number"){var w=e.getStyle("height");w.hasValue()?x=w.getPixels("y")/a:isNaN(y[3])||(x=y[3]/a)}_||(_=x),x||(x=_),e.getAttribute("width",!0).setValue(i),e.getAttribute("height",!0).setValue(a);var b=e.getStyle("transform",!0,!0);b.setValue("".concat(b.getString()," scale(").concat(1/_,", ").concat(1/x,")"))}r||c.clearRect(0,0,g,m),e.render(c),f&&(this.isFirstRender=!1)}}n$.defaultWindow=JYe;n$.defaultFetch=QYe;var{defaultFetch:kIr}=n$,FIr=typeof DOMParser<"u"?DOMParser:null;class zq{constructor(){var{fetch:e=kIr,DOMParser:t=FIr}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=e,this.DOMParser=t}parse(e){var t=this;return Vc(function*(){return e.startsWith("<")?t.parseFromString(e):t.load(e)})()}parseFromString(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}load(e){var t=this;return Vc(function*(){var r=yield t.fetch(e),i=yield r.text();return t.parseFromString(i)})()}}class BIr{constructor(e,t){this.type="translate",this.point=null,this.point=su.parse(t)}apply(e){var{x:t,y:r}=this.point;e.translate(t||0,r||0)}unapply(e){var{x:t,y:r}=this.point;e.translate(-1*t||0,-1*r||0)}applyToPoint(e){var{x:t,y:r}=this.point;e.applyTransform([1,0,0,1,t||0,r||0])}}class GIr{constructor(e,t,r){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var i=xv(t);this.angle=new jn(e,"angle",i[0]),this.originX=r[0],this.originY=r[1],this.cx=i[1]||0,this.cy=i[2]||0}apply(e){var{cx:t,cy:r,originX:i,originY:a,angle:o}=this,s=t+i.getPixels("x"),l=r+a.getPixels("y");e.translate(s,l),e.rotate(o.getRadians()),e.translate(-s,-l)}unapply(e){var{cx:t,cy:r,originX:i,originY:a,angle:o}=this,s=t+i.getPixels("x"),l=r+a.getPixels("y");e.translate(s,l),e.rotate(-1*o.getRadians()),e.translate(-s,-l)}applyToPoint(e){var{cx:t,cy:r,angle:i}=this,a=i.getRadians();e.applyTransform([1,0,0,1,t||0,r||0]),e.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]),e.applyTransform([1,0,0,1,-t||0,-r||0])}}class zIr{constructor(e,t,r){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var i=su.parseScale(t);(i.x===0||i.y===0)&&(i.x=tM,i.y=tM),this.scale=i,this.originX=r[0],this.originY=r[1]}apply(e){var{scale:{x:t,y:r},originX:i,originY:a}=this,o=i.getPixels("x"),s=a.getPixels("y");e.translate(o,s),e.scale(t,r||t),e.translate(-o,-s)}unapply(e){var{scale:{x:t,y:r},originX:i,originY:a}=this,o=i.getPixels("x"),s=a.getPixels("y");e.translate(o,s),e.scale(1/t,1/r||t),e.translate(-o,-s)}applyToPoint(e){var{x:t,y:r}=this.scale;e.applyTransform([t||0,0,0,r||0,0,0])}}class eqe{constructor(e,t,r){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=xv(t),this.originX=r[0],this.originY=r[1]}apply(e){var{originX:t,originY:r,matrix:i}=this,a=t.getPixels("x"),o=r.getPixels("y");e.translate(a,o),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.translate(-a,-o)}unapply(e){var{originX:t,originY:r,matrix:i}=this,a=i[0],o=i[2],s=i[4],l=i[1],u=i[3],h=i[5],c=0,f=0,d=1,v=1/(a*(u*d-h*f)-o*(l*d-h*c)+s*(l*f-u*c)),p=t.getPixels("x"),g=r.getPixels("y");e.translate(p,g),e.transform(v*(u*d-h*f),v*(h*c-l*d),v*(s*f-o*d),v*(a*d-s*c),v*(o*h-s*u),v*(s*l-a*h)),e.translate(-p,-g)}applyToPoint(e){e.applyTransform(this.matrix)}}class tqe extends eqe{constructor(e,t,r){super(e,t,r),this.type="skew",this.angle=null,this.angle=new jn(e,"angle",t)}}class UIr extends tqe{constructor(e,t,r){super(e,t,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class VIr extends tqe{constructor(e,t,r){super(e,t,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function $Ir(n){return sL(n).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function WIr(n){var[e,t]=n.split("(");return[e.trim(),t.trim().replace(")","")]}class y2{constructor(e,t,r){this.document=e,this.transforms=[];var i=$Ir(t);i.forEach(a=>{if(a!=="none"){var[o,s]=WIr(a),l=y2.transformTypes[o];typeof l<"u"&&this.transforms.push(new l(this.document,s,r))}})}static fromElement(e,t){var r=t.getStyle("transform",!1,!0),[i,a=i]=t.getStyle("transform-origin",!1,!0).split(),o=[i,a];return r.hasValue()?new y2(e,r.getString(),o):null}apply(e){for(var{transforms:t}=this,r=t.length,i=0;i=0;i--)t[i].unapply(e)}applyToPoint(e){for(var{transforms:t}=this,r=t.length,i=0;i2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=e,this.node=t,this.captureTextNodes=r,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!t||t.nodeType!==1)){if(Array.from(t.attributes).forEach(s=>{var l=EIr(s.nodeName);this.attributes[l]=new jn(e,l,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var i=this.getAttribute("style").getString().split(";").map(s=>s.trim());i.forEach(s=>{if(!!s){var[l,u]=s.split(":").map(h=>h.trim());this.styles[l]=new jn(e,l,u)}})}var{definitions:a}=e,o=this.getAttribute("id");o.hasValue()&&(a[o.getString()]||(a[o.getString()]=this)),Array.from(t.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(r&&(s.nodeType===3||s.nodeType===4)){var l=e.createTextNode(s);l.getText().length>0&&this.addChild(l)}})}}getAttribute(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.attributes[e];if(!r&&t){var i=new jn(this.document,e,"");return this.attributes[e]=i,i}return r||jn.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if(e==="href"||e.endsWith(":href"))return this.attributes[e];return jn.empty(this.document)}getStyle(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.styles[e];if(i)return i;var a=this.getAttribute(e);if(a!=null&&a.hasValue())return this.styles[e]=a,a;if(!r){var{parent:o}=this;if(o){var s=o.getStyle(e);if(s!=null&&s.hasValue())return s}}if(t){var l=new jn(this.document,e,"");return this.styles[e]=l,l}return i||jn.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(e),r.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var t=y2.fromElement(this.document,this);t&&t.apply(e);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var i=r.getDefinition();i&&i.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){var t=e instanceof il?e:this.document.createElement(e);t.parent=this,il.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){var t,{node:r}=this;if(typeof r.matches=="function")return r.matches(e);var i=(t=r.getAttribute)===null||t===void 0?void 0:t.call(r,"class");return!i||i===""?!1:i.split(" ").some(a=>".".concat(a)===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:t}=this.document;for(var r in e)if(!r.startsWith("@")&&this.matchesSelector(r)){var i=e[r],a=t[r];if(i)for(var o in i){var s=this.stylesSpecificity[o];typeof s>"u"&&(s="000"),a>=s&&(this.styles[o]=i[o],this.stylesSpecificity[o]=a)}}}removeStyles(e,t){var r=t.reduce((i,a)=>{var o=e.getStyle(a);if(!o.hasValue())return i;var s=o.getString();return o.setValue(""),[...i,[a,s]]},[]);return r}restoreStyles(e,t){t.forEach(r=>{var[i,a]=r;e.getStyle(i,!0).setValue(a)})}isFirstChild(){var e;return((e=this.parent)===null||e===void 0?void 0:e.children.indexOf(this))===0}}il.ignoreChildTypes=["title"];class HIr extends il{constructor(e,t,r){super(e,t,r)}}function jIr(n){var e=n.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function XIr(n){return typeof process>"u"?n:n.trim().split(",").map(jIr).join(",")}function YIr(n){if(!n)return"";var e=n.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function qIr(n){if(!n)return"";var e=n.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class Lf{constructor(e,t,r,i,a,o){var s=o?typeof o=="string"?Lf.parse(o):o:{};this.fontFamily=a||s.fontFamily,this.fontSize=i||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=t||s.fontVariant}static parse(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r="",i="",a="",o="",s="",l=sL(e).trim().split(" "),u={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return l.forEach(h=>{switch(!0){case(!u.fontStyle&&Lf.styles.includes(h)):h!=="inherit"&&(r=h),u.fontStyle=!0;break;case(!u.fontVariant&&Lf.variants.includes(h)):h!=="inherit"&&(i=h),u.fontStyle=!0,u.fontVariant=!0;break;case(!u.fontWeight&&Lf.weights.includes(h)):h!=="inherit"&&(a=h),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0;break;case!u.fontSize:h!=="inherit"&&([o]=h.split("/")),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0,u.fontSize=!0;break;default:h!=="inherit"&&(s+=h)}}),new Lf(r,i,a,o,s,t)}toString(){return[YIr(this.fontStyle),this.fontVariant,qIr(this.fontWeight),this.fontSize,XIr(this.fontFamily)].join(" ").trim()}}Lf.styles="normal|italic|oblique|inherit";Lf.variants="normal|small-caps|inherit";Lf.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class H0{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=e,this.y1=t,this.x2=r,this.y2=i,this.addPoint(e,t),this.addPoint(r,i)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),ethis.x2&&(this.x2=e)),typeof t<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(!!e){var{x1:t,y1:r,x2:i,y2:a}=e;this.addPoint(t,r),this.addPoint(i,a)}}sumCubic(e,t,r,i,a){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*r+3*(1-e)*Math.pow(e,2)*i+Math.pow(e,3)*a}bezierCurveAdd(e,t,r,i,a){var o=6*t-12*r+6*i,s=-3*t+9*r-9*i+3*a,l=3*r-3*t;if(s===0){if(o===0)return;var u=-l/o;0=t.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",r=new su(this.command[e],this.command[t]);return this.makeAbsolute(r)}getAsControlPoint(e,t){var r=this.getPoint(e,t);return this.control=r,r}getAsCurrentPoint(e,t){var r=this.getPoint(e,t);return this.current=r,r}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==_r.CURVE_TO&&e!==_r.SMOOTH_CURVE_TO&&e!==_r.QUAD_TO&&e!==_r.SMOOTH_QUAD_TO)return this.current;var{current:{x:t,y:r},control:{x:i,y:a}}=this,o=new su(2*t-i,2*r-a);return o}makeAbsolute(e){if(this.command.relative){var{x:t,y:r}=this.current;e.x+=t,e.y+=r}return e}addMarker(e,t,r){var{points:i,angles:a}=this;r&&a.length>0&&!a[a.length-1]&&(a[a.length-1]=i[i.length-1].angleTo(r)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,t=e.length,r=0;r1&&arguments[1]!==void 0?arguments[1]:!1;if(!t){var r=this.getStyle("fill"),i=this.getStyle("fill-opacity"),a=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,i);s&&(e.fillStyle=s)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());var l=r.getColor();l!=="inherit"&&(e.fillStyle=l==="none"?"rgba(0,0,0,0)":l)}if(i.hasValue()){var u=new jn(this.document,"fill",e.fillStyle).addOpacity(i).getColor();e.fillStyle=u}if(a.isUrlDefinition()){var h=a.getFillStyleDefinition(this,o);h&&(e.strokeStyle=h)}else if(a.hasValue()){a.getString()==="currentColor"&&a.setValue(this.getStyle("color").getColor());var c=a.getString();c!=="inherit"&&(e.strokeStyle=c==="none"?"rgba(0,0,0,0)":c)}if(o.hasValue()){var f=new jn(this.document,"stroke",e.strokeStyle).addOpacity(o).getString();e.strokeStyle=f}var d=this.getStyle("stroke-width");if(d.hasValue()){var v=d.getPixels();e.lineWidth=v||tM}var p=this.getStyle("stroke-linecap"),g=this.getStyle("stroke-linejoin"),m=this.getStyle("stroke-miterlimit"),y=this.getStyle("stroke-dasharray"),_=this.getStyle("stroke-dashoffset");if(p.hasValue()&&(e.lineCap=p.getString()),g.hasValue()&&(e.lineJoin=g.getString()),m.hasValue()&&(e.miterLimit=m.getNumber()),y.hasValue()&&y.getString()!=="none"){var x=xv(y.getString());typeof e.setLineDash<"u"?e.setLineDash(x):typeof e.webkitLineDash<"u"?e.webkitLineDash=x:typeof e.mozDash<"u"&&!(x.length===1&&x[0]===0)&&(e.mozDash=x);var S=_.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=S:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=S:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=S)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){var w=this.getStyle("font"),b=this.getStyle("font-style"),E=this.getStyle("font-variant"),T=this.getStyle("font-weight"),C=this.getStyle("font-size"),A=this.getStyle("font-family"),M=new Lf(b.getString(),E.getString(),T.getString(),C.hasValue()?"".concat(C.getPixels(!0),"px"):"",A.getString(),Lf.parse(w.getString(),e.font));b.setValue(M.fontStyle),E.setValue(M.fontVariant),T.setValue(M.fontWeight),C.setValue(M.fontSize),A.setValue(M.fontFamily),e.font=M.toString(),C.isPixels()&&(this.document.emSize=C.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class ns extends _T{constructor(e,t,r){super(e,t,r),this.type="path",this.pathParser=null,this.pathParser=new Wi(this.getAttribute("d").getString())}path(e){var{pathParser:t}=this,r=new H0;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case Wi.MOVE_TO:this.pathM(e,r);break;case Wi.LINE_TO:this.pathL(e,r);break;case Wi.HORIZ_LINE_TO:this.pathH(e,r);break;case Wi.VERT_LINE_TO:this.pathV(e,r);break;case Wi.CURVE_TO:this.pathC(e,r);break;case Wi.SMOOTH_CURVE_TO:this.pathS(e,r);break;case Wi.QUAD_TO:this.pathQ(e,r);break;case Wi.SMOOTH_QUAD_TO:this.pathT(e,r);break;case Wi.ARC:this.pathA(e,r);break;case Wi.CLOSE_PATH:this.pathZ(e,r);break}return r}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,t=e.getMarkerPoints(),r=e.getMarkerAngles(),i=t.map((a,o)=>[a,r[o]]);return i}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");e.fillStyle!==""&&(t.getString("inherit")!=="inherit"?e.fill(t.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var r=this.getMarkers();if(r){var i=r.length-1,a=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(a.isUrlDefinition()){var l=a.getDefinition(),[u,h]=r[0];l.render(e,u,h)}if(o.isUrlDefinition())for(var c=o.getDefinition(),f=1;f1&&(i*=Math.sqrt(f),a*=Math.sqrt(f));var d=(s===l?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(a,2)-Math.pow(i,2)*Math.pow(c.y,2)-Math.pow(a,2)*Math.pow(c.x,2))/(Math.pow(i,2)*Math.pow(c.y,2)+Math.pow(a,2)*Math.pow(c.x,2)));isNaN(d)&&(d=0);var v=new su(d*i*c.y/a,d*-a*c.x/i),p=new su((t.x+h.x)/2+Math.cos(u)*v.x-Math.sin(u)*v.y,(t.y+h.y)/2+Math.sin(u)*v.x+Math.cos(u)*v.y),g=MAe([1,0],[(c.x-v.x)/i,(c.y-v.y)/a]),m=[(c.x-v.x)/i,(c.y-v.y)/a],y=[(-c.x-v.x)/i,(-c.y-v.y)/a],_=MAe(m,y);return ore(m,y)<=-1&&(_=Math.PI),ore(m,y)>=1&&(_=0),{currentPoint:h,rX:i,rY:a,sweepFlag:l,xAxisRotation:u,centp:p,a1:g,ad:_}}pathA(e,t){var{pathParser:r}=this,{currentPoint:i,rX:a,rY:o,sweepFlag:s,xAxisRotation:l,centp:u,a1:h,ad:c}=ns.pathA(r),f=1-s?1:-1,d=h+f*(c/2),v=new su(u.x+a*Math.cos(d),u.y+o*Math.sin(d));if(r.addMarkerAngle(v,d-f*Math.PI/2),r.addMarkerAngle(i,d-f*Math.PI),t.addPoint(i.x,i.y),e&&!isNaN(h)&&!isNaN(c)){var p=a>o?a:o,g=a>o?1:a/o,m=a>o?o/a:1;e.translate(u.x,u.y),e.rotate(l),e.scale(g,m),e.arc(0,0,p,h,h+c,Boolean(1-s)),e.scale(1/g,1/m),e.rotate(-l),e.translate(-u.x,-u.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){ns.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}class rqe extends ns{constructor(e,t,r){super(e,t,r),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class rw extends _T{constructor(e,t,r){super(e,t,new.target===rw?!0:r),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(e,t);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(e.textBaseline=r)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var t=null;return this.children.forEach((r,i)=>{var a=this.getChildBoundingBox(e,this,this,i);t?t.addBoundingBox(a):t=a}),t}getFontSize(){var{document:e,parent:t}=this,r=Lf.parse(e.ctx.font).fontSize,i=t.getStyle("font-size").getNumber(r);return i}getTElementBoundingBox(e){var t=this.getFontSize();return new H0(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,r){var i=t[r],a=null;if(e.isArabic){var o=t.length,s=t[r-1],l=t[r+1],u="isolated";if((r===0||s===" ")&&r0&&s!==" "&&r0&&s!==" "&&(r===o-1||l===" ")&&(u="initial"),typeof e.glyphs[i]<"u"){var h=e.glyphs[i];a=h instanceof rqe?h:h[u]}}else a=e.glyphs[i];return a||(a=e.missingGlyph),a}getText(){return""}getTextFromNode(e){var t=e||this.node,r=Array.from(t.parentNode.childNodes),i=r.indexOf(t),a=r.length-1,o=sL(t.textContent||"");return i===0&&(o=SIr(o)),i===a&&(o=wIr(o)),o}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((r,i)=>{this.renderChild(e,this,this,i)});var{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){var{document:t,parent:r}=this,i=this.getText(),a=r.getStyle("font-family").getDefinition();if(a){for(var{unitsPerEm:o}=a.fontFace,s=Lf.parse(t.ctx.font),l=r.getStyle("font-size").getNumber(s.fontSize),u=r.getStyle("font-style").getString(s.fontStyle),h=l/o,c=a.isRTL?i.split("").reverse().join(""):i,f=xv(r.getAttribute("dx").getString()),d=c.length,v=0;v=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),r=!1,i=0;t==="start"&&!r||t==="end"&&r?i=e.x-this.minX:t==="end"&&!r||t==="start"&&r?i=e.x-this.maxX:i=e.x-(this.minX+this.maxX)/2;for(var a=this.textChunkStart;a{this.adjustChildCoordinatesRecursiveCore(e,this,this,r)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,r,i){var a=r.children[i];a.children.length>0?a.children.forEach((o,s)=>{t.adjustChildCoordinatesRecursiveCore(e,t,a,s)}):this.adjustChildCoordinates(e,t,r,i)}adjustChildCoordinates(e,t,r,i){var a=r.children[i];if(typeof a.measureText!="function")return a;e.save(),a.setContext(e,!0);var o=a.getAttribute("x"),s=a.getAttribute("y"),l=a.getAttribute("dx"),u=a.getAttribute("dy"),h=a.getStyle("font-family").getDefinition(),c=Boolean(h)&&h.isRTL;i===0&&(o.hasValue()||o.setValue(a.getInheritedAttribute("x")),s.hasValue()||s.setValue(a.getInheritedAttribute("y")),l.hasValue()||l.setValue(a.getInheritedAttribute("dx")),u.hasValue()||u.setValue(a.getInheritedAttribute("dy")));var f=a.measureText(e);return c&&(t.x-=f),o.hasValue()?(t.applyAnchoring(),a.x=o.getPixels("x"),l.hasValue()&&(a.x+=l.getPixels("x"))):(l.hasValue()&&(t.x+=l.getPixels("x")),a.x=t.x),t.x=a.x,c||(t.x+=f),s.hasValue()?(a.y=s.getPixels("y"),u.hasValue()&&(a.y+=u.getPixels("y"))):(u.hasValue()&&(t.y+=u.getPixels("y")),a.y=t.y),t.y=a.y,t.leafTexts.push(a),t.minX=Math.min(t.minX,a.x,a.x+f),t.maxX=Math.max(t.maxX,a.x,a.x+f),a.clearContext(e),e.restore(),a}getChildBoundingBox(e,t,r,i){var a=r.children[i];if(typeof a.getBoundingBox!="function")return null;var o=a.getBoundingBox(e);return o?(a.children.forEach((s,l)=>{var u=t.getChildBoundingBox(e,t,a,l);o.addBoundingBox(u)}),o):null}renderChild(e,t,r,i){var a=r.children[i];a.render(e),a.children.forEach((o,s)=>{t.renderChild(e,t,a,s)})}measureText(e){var{measureCache:t}=this;if(~t)return t;var r=this.getText(),i=this.measureTargetText(e,r);return this.measureCache=i,i}measureTargetText(e,t){if(!t.length)return 0;var{parent:r}=this,i=r.getStyle("font-family").getDefinition();if(i){for(var a=this.getFontSize(),o=i.isRTL?t.split("").reverse().join(""):t,s=xv(r.getAttribute("dx").getString()),l=o.length,u=0,h=0;h0?"":this.getTextFromNode()}getText(){return this.text}}class ZIr extends i${constructor(){super(...arguments),this.type="textNode"}}class Dk extends _T{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var t,{document:r}=this,{screen:i,window:a}=r,o=e.canvas;if(i.setDefaults(e),o.style&&typeof e.font<"u"&&a&&typeof a.getComputedStyle<"u"){e.font=a.getComputedStyle(o).getPropertyValue("font");var s=new jn(r,"fontSize",Lf.parse(e.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:l,height:u}=i.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var h=this.getAttribute("refX"),c=this.getAttribute("refY"),f=this.getAttribute("viewBox"),d=f.hasValue()?xv(f.getString()):null,v=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",p=0,g=0,m=0,y=0;d&&(p=d[0],g=d[1]),this.root||(l=this.getStyle("width").getPixels("x"),u=this.getStyle("height").getPixels("y"),this.type==="marker"&&(m=p,y=g,p=0,g=0)),i.viewPort.setCurrent(l,u),this.node&&(!this.parent||((t=this.node.parentNode)===null||t===void 0?void 0:t.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),d&&(l=d[2],u=d[3]),r.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:l,height:i.viewPort.height,desiredHeight:u,minX:p,minY:g,refX:h.getValue(),refY:c.getValue(),clip:v,clipX:m,clipY:y}),d&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(l,u))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.getAttribute("width",!0),a=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),s=this.getAttribute("style"),l=i.getNumber(0),u=a.getNumber(0);if(r)if(typeof r=="string")this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var h=this.getAttribute("preserveAspectRatio");h.hasValue()&&h.setValue(h.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(e),a.setValue(t),o.hasValue()||o.setValue("0 0 ".concat(l||e," ").concat(u||t)),s.hasValue()){var c=this.getStyle("width"),f=this.getStyle("height");c.hasValue()&&c.setValue("".concat(e,"px")),f.hasValue()&&f.setValue("".concat(t,"px"))}}}class nqe extends ns{constructor(){super(...arguments),this.type="rect"}path(e){var t=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),a=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),s=this.getAttribute("ry"),l=o.getPixels("x"),u=s.getPixels("y");if(o.hasValue()&&!s.hasValue()&&(u=l),s.hasValue()&&!o.hasValue()&&(l=u),l=Math.min(l,i/2),u=Math.min(u,a/2),e){var h=4*((Math.sqrt(2)-1)/3);e.beginPath(),a>0&&i>0&&(e.moveTo(t+l,r),e.lineTo(t+i-l,r),e.bezierCurveTo(t+i-l+h*l,r,t+i,r+u-h*u,t+i,r+u),e.lineTo(t+i,r+a-u),e.bezierCurveTo(t+i,r+a-u+h*u,t+i-l+h*l,r+a,t+i-l,r+a),e.lineTo(t+l,r+a),e.bezierCurveTo(t+l-h*l,r+a,t,r+a-u+h*u,t,r+a-u),e.lineTo(t,r+u),e.bezierCurveTo(t,r+u-h*u,t+l-h*l,r,t+l,r),e.closePath())}return new H0(t,r,t+i,r+a)}getMarkers(){return null}}class KIr extends ns{constructor(){super(...arguments),this.type="circle"}path(e){var t=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return e&&i>0&&(e.beginPath(),e.arc(t,r,i,0,Math.PI*2,!1),e.closePath()),new H0(t-i,r-i,t+i,r+i)}getMarkers(){return null}}class JIr extends ns{constructor(){super(...arguments),this.type="ellipse"}path(e){var t=4*((Math.sqrt(2)-1)/3),r=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),a=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return e&&r>0&&i>0&&(e.beginPath(),e.moveTo(a+r,o),e.bezierCurveTo(a+r,o+t*i,a+t*r,o+i,a,o+i),e.bezierCurveTo(a-t*r,o+i,a-r,o+t*i,a-r,o),e.bezierCurveTo(a-r,o-t*i,a-t*r,o-i,a,o-i),e.bezierCurveTo(a+t*r,o-i,a+r,o-t*i,a+r,o),e.closePath()),new H0(a-r,o-i,a+r,o+i)}getMarkers(){return null}}class QIr extends ns{constructor(){super(...arguments),this.type="line"}getPoints(){return[new su(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new su(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:t,y:r},{x:i,y:a}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,r),e.lineTo(i,a)),new H0(t,r,i,a)}getMarkers(){var[e,t]=this.getPoints(),r=e.angleTo(t);return[[e,r],[t,r]]}}class iqe extends ns{constructor(e,t,r){super(e,t,r),this.type="polyline",this.points=[],this.points=su.parsePath(this.getAttribute("points").getString())}path(e){var{points:t}=this,[{x:r,y:i}]=t,a=new H0(r,i);return e&&(e.beginPath(),e.moveTo(r,i)),t.forEach(o=>{var{x:s,y:l}=o;a.addPoint(s,l),e&&e.lineTo(s,l)}),a}getMarkers(){var{points:e}=this,t=e.length-1,r=[];return e.forEach((i,a)=>{a!==t&&r.push([i,i.angleTo(e[a+1])])}),r.length>0&&r.push([e[e.length-1],r[r.length-1][1]]),r}}class eLr extends iqe{constructor(){super(...arguments),this.type="polygon"}path(e){var t=super.path(e),[{x:r,y:i}]=this.points;return e&&(e.lineTo(r,i),e.closePath()),t}}class tLr extends il{constructor(){super(...arguments),this.type="pattern"}createPattern(e,t,r){var i=this.getStyle("width").getPixels("x",!0),a=this.getStyle("height").getPixels("y",!0),o=new Dk(this.document,null);o.attributes.viewBox=new jn(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new jn(this.document,"width","".concat(i,"px")),o.attributes.height=new jn(this.document,"height","".concat(a,"px")),o.attributes.transform=new jn(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;var s=this.document.createCanvas(i,a),l=s.getContext("2d"),u=this.getAttribute("x"),h=this.getAttribute("y");u.hasValue()&&h.hasValue()&&l.translate(u.getPixels("x",!0),h.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var c=-1;c<=1;c++)for(var f=-1;f<=1;f++)l.save(),o.attributes.x=new jn(this.document,"x",c*s.width),o.attributes.y=new jn(this.document,"y",f*s.height),o.render(l),l.restore();var d=e.createPattern(s,"repeat");return d}}class rLr extends il{constructor(){super(...arguments),this.type="marker"}render(e,t,r){if(!!t){var{x:i,y:a}=t,o=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(i,a),o==="auto"&&e.rotate(r),s==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();var l=new Dk(this.document,null);l.type=this.type,l.attributes.viewBox=new jn(this.document,"viewBox",this.getAttribute("viewBox").getValue()),l.attributes.refX=new jn(this.document,"refX",this.getAttribute("refX").getValue()),l.attributes.refY=new jn(this.document,"refY",this.getAttribute("refY").getValue()),l.attributes.width=new jn(this.document,"width",this.getAttribute("markerWidth").getValue()),l.attributes.height=new jn(this.document,"height",this.getAttribute("markerHeight").getValue()),l.attributes.overflow=new jn(this.document,"overflow",this.getAttribute("overflow").getValue()),l.attributes.fill=new jn(this.document,"fill",this.getAttribute("fill").getColor("black")),l.attributes.stroke=new jn(this.document,"stroke",this.getAttribute("stroke").getValue("none")),l.children=this.children,l.render(e),e.restore(),s==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),o==="auto"&&e.rotate(-r),e.translate(-i,-a)}}}class nLr extends il{constructor(){super(...arguments),this.type="defs"}render(){}}class ohe extends _T{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var t=new H0;return this.children.forEach(r=>{t.addBoundingBox(r.getBoundingBox(e))}),t}}class aqe extends il{constructor(e,t,r){super(e,t,r),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:i,children:a}=this;a.forEach(o=>{o.type==="stop"&&i.push(o)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,r){var i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var{stops:a}=i,o=this.getGradient(e,t);if(!o)return this.addParentOpacity(r,a[a.length-1].color);if(a.forEach(g=>{o.addColorStop(g.offset,this.addParentOpacity(r,g.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:l,viewPort:u}=s.screen,[h]=u.viewPorts,c=new nqe(s,null);c.attributes.x=new jn(s,"x",-l/3),c.attributes.y=new jn(s,"y",-l/3),c.attributes.width=new jn(s,"width",l),c.attributes.height=new jn(s,"height",l);var f=new ohe(s,null);f.attributes.transform=new jn(s,"transform",this.getAttribute("gradientTransform").getValue()),f.children=[c];var d=new Dk(s,null);d.attributes.x=new jn(s,"x",0),d.attributes.y=new jn(s,"y",0),d.attributes.width=new jn(s,"width",h.width),d.attributes.height=new jn(s,"height",h.height),d.children=[f];var v=s.createCanvas(h.width,h.height),p=v.getContext("2d");return p.fillStyle=o,d.render(p),p.createPattern(v,"no-repeat")}return o}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){if(e.hasValue()){var r=new jn(this.document,"color",t);return r.addOpacity(e).getColor()}return t}}class iLr extends aqe{constructor(e,t,r){super(e,t,r),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){var r=this.getGradientUnits()==="objectBoundingBox",i=r?t.getBoundingBox(e):null;if(r&&!i)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var a=r?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=r?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),l=r?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return a===s&&o===l?null:e.createLinearGradient(a,o,s,l)}}class aLr extends aqe{constructor(e,t,r){super(e,t,r),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){var r=this.getGradientUnits()==="objectBoundingBox",i=t.getBoundingBox(e);if(r&&!i)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var a=r?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=r?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=a,l=o;this.getAttribute("fx").hasValue()&&(s=r?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(l=r?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var u=r?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),h=this.getAttribute("fr").getPixels();return e.createRadialGradient(s,l,h,a,o,u)}}class oLr extends il{constructor(e,t,r){super(e,t,r),this.type="stop";var i=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),a=this.getStyle("stop-opacity"),o=this.getStyle("stop-color",!0);o.getString()===""&&o.setValue("#000"),a.hasValue()&&(o=o.addOpacity(a)),this.offset=i,this.color=o.getColor()}}class she extends il{constructor(e,t,r){super(e,t,r),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new jn(e,"values",null);var i=this.getAttribute("values");i.hasValue()&&this.values.setValue(i.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){var{initialUnits:e}=this,{progress:t,from:r,to:i}=this.getProgress(),a=r.getNumber()+(i.getNumber()-r.getNumber())*t;return e==="%"&&(a*=100),"".concat(a).concat(e)}update(e){var{parent:t}=this,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var i=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(i==="freeze"&&!this.frozen)this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=r.getString();else if(i==="remove"&&!this.removed)return this.removed=!0,r.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;var a=!1;if(this.begin{var u=a[l];return s+(u-s)*e}).join(" ");return o}}class uLr extends il{constructor(e,t,r){super(e,t,r),this.type="font",this.glyphs={},this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:i}=e,{children:a}=this;for(var o of a)switch(o.type){case"font-face":{this.fontFace=o;var s=o.getStyle("font-family");s.hasValue()&&(i[s.getString()]=this);break}case"missing-glyph":this.missingGlyph=o;break;case"glyph":{var l=o;l.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[l.unicode]>"u"&&(this.glyphs[l.unicode]={}),this.glyphs[l.unicode][l.arabicForm]=l):this.glyphs[l.unicode]=l;break}}}render(){}}class hLr extends il{constructor(e,t,r){super(e,t,r),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class cLr extends ns{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class fLr extends rw{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}class dLr extends rw{constructor(e,t,r){super(e,t,r),this.type="a";var{childNodes:i}=t,a=i[0],o=i.length>0&&Array.from(i).every(s=>s.nodeType===3);this.hasText=o,this.text=o?this.getTextFromNode(a):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:t,x:r,y:i}=this,{mouse:a}=t.screen,o=new jn(t,"fontSize",Lf.parse(t.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new H0(r,i-o.getPixels("y"),r+this.measureText(e),i))}else if(this.children.length>0){var s=new ohe(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){var e=this.document.ctx;e.canvas.style.cursor="pointer"}}function kAe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function T6(n){for(var e=1;e{var{type:i,points:a}=r;switch(i){case Wi.LINE_TO:e&&e.lineTo(a[0],a[1]);break;case Wi.MOVE_TO:e&&e.moveTo(a[0],a[1]);break;case Wi.CURVE_TO:e&&e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case Wi.QUAD_TO:e&&e.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case Wi.ARC:{var[o,s,l,u,h,c,f,d]=a,v=l>u?l:u,p=l>u?1:l/u,g=l>u?u/l:1;e&&(e.translate(o,s),e.rotate(f),e.scale(p,g),e.arc(0,0,v,h,h+c,Boolean(1-d)),e.scale(1/p,1/g),e.rotate(-f),e.translate(-o,-s));break}case Wi.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),{glyphInfo:i}=this,a=e.fillStyle;t==="underline"&&e.beginPath(),i.forEach((o,s)=>{var{p0:l,p1:u,rotation:h,text:c}=o;e.save(),e.translate(l.x,l.y),e.rotate(h),e.fillStyle&&e.fillText(c,0,0),e.strokeStyle&&e.strokeText(c,0,0),e.restore(),t==="underline"&&(s===0&&e.moveTo(l.x,l.y+r/8),e.lineTo(u.x,u.y+r/5))}),t==="underline"&&(e.lineWidth=r/20,e.strokeStyle=a,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,r,i,a,o,s,l,u){var h=o,c=this.measureText(e,l);l===" "&&t==="justify"&&r-1&&(h+=this.getLetterSpacingAt(u));var f=this.textHeight/20,d=this.getEquidistantPointOnPath(h,f,0),v=this.getEquidistantPointOnPath(h+c,f,0),p={p0:d,p1:v},g=d&&v?Math.atan2(v.y-d.y,v.x-d.x):0;if(s){var m=Math.cos(Math.PI/2+g)*s,y=Math.cos(-g)*s;p.p0=T6(T6({},d),{},{x:d.x+m,y:d.y+y}),p.p1=T6(T6({},v),{},{x:v.x+m,y:v.y+y})}return h+=c,{offset:h,segment:p,rotation:g}}measureText(e,t){var{measuresCache:r}=this,i=t||this.getText();if(r.has(i))return r.get(i);var a=this.measureTargetText(e,i);return r.set(i,a),a}setTextData(e){if(!this.glyphInfo){var t=this.getText(),r=t.split(""),i=t.split(" ").length-1,a=this.parent.getAttribute("dx").split().map(x=>x.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),l=this.getStyle("letter-spacing"),u=this.parent.getStyle("letter-spacing"),h=0;!l.hasValue()||l.getValue()==="inherit"?h=u.getPixels():l.hasValue()&&l.getValue()!=="initial"&&l.getValue()!=="unset"&&(h=l.getPixels());var c=[],f=t.length;this.letterSpacingCache=c;for(var d=0;dw===0?0:x+S||0,0),p=this.measureText(e),g=Math.max(p+v,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];var m=this.getPathLength(),y=this.getStyle("startOffset").getNumber(0)*m,_=0;(s==="middle"||s==="center")&&(_=-g/2),(s==="end"||s==="right")&&(_=-g),_+=y,r.forEach((x,S)=>{var{offset:w,segment:b,rotation:E}=this.findSegmentToFitChar(e,s,g,m,i,_,o,x,S);_=w,!(!b.p0||!b.p1)&&this.glyphInfo.push({text:r[S],p0:b.p0,p1:b.p1,rotation:E})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var t=[],{pathParser:r}=e;for(r.reset();!r.isEnd();){var{current:i}=r,a=i?i.x:0,o=i?i.y:0,s=r.next(),l=s.type,u=[];switch(s.type){case Wi.MOVE_TO:this.pathM(r,u);break;case Wi.LINE_TO:l=this.pathL(r,u);break;case Wi.HORIZ_LINE_TO:l=this.pathH(r,u);break;case Wi.VERT_LINE_TO:l=this.pathV(r,u);break;case Wi.CURVE_TO:this.pathC(r,u);break;case Wi.SMOOTH_CURVE_TO:l=this.pathS(r,u);break;case Wi.QUAD_TO:this.pathQ(r,u);break;case Wi.SMOOTH_QUAD_TO:l=this.pathT(r,u);break;case Wi.ARC:u=this.pathA(r);break;case Wi.CLOSE_PATH:ns.pathZ(r);break}s.type!==Wi.CLOSE_PATH?t.push({type:l,points:u,start:{x:a,y:o},pathLength:this.calcLength(a,o,l,u)}):t.push({type:Wi.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){var{x:r,y:i}=ns.pathM(e).point;t.push(r,i)}pathL(e,t){var{x:r,y:i}=ns.pathL(e).point;return t.push(r,i),Wi.LINE_TO}pathH(e,t){var{x:r,y:i}=ns.pathH(e).point;return t.push(r,i),Wi.LINE_TO}pathV(e,t){var{x:r,y:i}=ns.pathV(e).point;return t.push(r,i),Wi.LINE_TO}pathC(e,t){var{point:r,controlPoint:i,currentPoint:a}=ns.pathC(e);t.push(r.x,r.y,i.x,i.y,a.x,a.y)}pathS(e,t){var{point:r,controlPoint:i,currentPoint:a}=ns.pathS(e);return t.push(r.x,r.y,i.x,i.y,a.x,a.y),Wi.CURVE_TO}pathQ(e,t){var{controlPoint:r,currentPoint:i}=ns.pathQ(e);t.push(r.x,r.y,i.x,i.y)}pathT(e,t){var{controlPoint:r,currentPoint:i}=ns.pathT(e);return t.push(r.x,r.y,i.x,i.y),Wi.QUAD_TO}pathA(e){var{rX:t,rY:r,sweepFlag:i,xAxisRotation:a,centp:o,a1:s,ad:l}=ns.pathA(e);return i===0&&l>0&&(l-=2*Math.PI),i===1&&l<0&&(l+=2*Math.PI),[o.x,o.y,t,r,s,l,a,i]}calcLength(e,t,r,i){var a=0,o=null,s=null,l=0;switch(r){case Wi.LINE_TO:return this.getLineLength(e,t,i[0],i[1]);case Wi.CURVE_TO:for(a=0,o=this.getPointOnCubicBezier(0,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=this.getPointOnCubicBezier(l,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case Wi.QUAD_TO:for(a=0,o=this.getPointOnQuadraticBezier(0,e,t,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=this.getPointOnQuadraticBezier(l,e,t,i[0],i[1],i[2],i[3]),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case Wi.ARC:{a=0;var u=i[4],h=i[5],c=i[4]+h,f=Math.PI/180;if(Math.abs(u-c)c;l-=f)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(l=u+f;l5&&arguments[5]!==void 0?arguments[5]:t,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:r,l=(a-r)/(i-t+tM),u=Math.sqrt(e*e/(1+l*l));it)return null;var{dataArray:a}=this;for(var o of a){if(o&&(o.pathLength<5e-5||r+o.pathLength+5e-5=0&&l>c)break;i=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],l,o.points[6]);break}case Wi.CURVE_TO:l=s/o.pathLength,l>1&&(l=1),i=this.getPointOnCubicBezier(l,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3],o.points[4],o.points[5]);break;case Wi.QUAD_TO:l=s/o.pathLength,l>1&&(l=1),i=this.getPointOnQuadraticBezier(l,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3]);break}if(i)return i;break}return null}getLineLength(e,t,r,i){return Math.sqrt((r-e)*(r-e)+(i-t)*(i-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,r,i,a,o,s,l,u){var h=l*IAe(e)+o*LAe(e)+i*PAe(e)+t*OAe(e),c=u*IAe(e)+s*LAe(e)+a*PAe(e)+r*OAe(e);return{x:h,y:c}}getPointOnQuadraticBezier(e,t,r,i,a,o,s){var l=o*RAe(e)+i*DAe(e)+t*NAe(e),u=s*RAe(e)+a*DAe(e)+r*NAe(e);return{x:l,y:u}}getPointOnEllipticalArc(e,t,r,i,a,o){var s=Math.cos(o),l=Math.sin(o),u={x:r*Math.cos(a),y:i*Math.sin(a)};return{x:e+(u.x*s-u.y*l),y:t+(u.x*l+u.y*s)}}buildEquidistantCache(e,t){var r=this.getPathLength(),i=t||.25,a=e||r/100;if(!this.equidistantCache||this.equidistantCache.step!==a||this.equidistantCache.precision!==i){this.equidistantCache={step:a,precision:i,points:[]};for(var o=0,s=0;s<=r;s+=i){var l=this.getPointOnPath(s),u=this.getPointOnPath(s+i);!l||!u||(o+=this.getLineLength(l.x,l.y,u.x,u.y),o>=a&&(this.equidistantCache.points.push({x:l.x,y:l.y,distance:s}),o-=a))}}}getEquidistantPointOnPath(e,t,r){if(this.buildEquidistantCache(t,r),e<0||e-this.getPathLength()>5e-5)return null;var i=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}}var pLr=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class gLr extends _T{constructor(e,t,r){super(e,t,r),this.type="image",this.loaded=!1;var i=this.getHrefAttribute().getString();if(!!i){var a=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);e.images.push(this),a?this.loadSvg(i):this.loadImage(i),this.isSvg=a}}loadImage(e){var t=this;return Vc(function*(){try{var r=yield t.document.createImage(e);t.image=r}catch(i){console.error('Error while loading image "'.concat(e,'":'),i)}t.loaded=!0})()}loadSvg(e){var t=this;return Vc(function*(){var r=pLr.exec(e);if(r){var i=r[5];r[4]==="base64"?t.image=atob(i):t.image=decodeURIComponent(i)}else try{var a=yield t.document.fetch(e),o=yield a.text();t.image=o}catch(s){console.error('Error while loading image "'.concat(e,'":'),s)}t.loaded=!0})()}renderChildren(e){var{document:t,image:r,loaded:i}=this,a=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y");if(!(!i||!r||!s||!l)){if(e.save(),e.translate(a,o),this.isSvg){var u=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:l});u.document.documentElement.parent=this,u.render()}else{var h=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:h.width,height:l,desiredHeight:h.height}),this.loaded&&(typeof h.complete>"u"||h.complete)&&e.drawImage(h,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new H0(e,t,e+r,t+i)}}class yLr extends _T{constructor(){super(...arguments),this.type="symbol"}render(e){}}class mLr{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,t){var r=this;return Vc(function*(){try{var{document:i}=r,a=yield i.canvg.parser.load(t),o=a.getElementsByTagName("font");Array.from(o).forEach(s=>{var l=i.createElement(s);i.definitions[e]=l})}catch(s){console.error('Error while loading font "'.concat(t,'":'),s)}r.loaded=!0})()}}class oqe extends il{constructor(e,t,r){super(e,t,r),this.type="style";var i=sL(Array.from(t.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),a=i.split("}");a.forEach(o=>{var s=o.trim();if(!!s){var l=s.split("{"),u=l[0].split(","),h=l[1].split(";");u.forEach(c=>{var f=c.trim();if(!!f){var d=e.styles[f]||{};if(h.forEach(g=>{var m=g.indexOf(":"),y=g.substr(0,m).trim(),_=g.substr(m+1,g.length-m).trim();y&&_&&(d[y]=new jn(e,y,_))}),e.styles[f]=d,e.stylesSpecificity[f]=RIr(f),f==="@font-face"){var v=d["font-family"].getString().replace(/"|'/g,""),p=d.src.getString().split(",");p.forEach(g=>{if(g.indexOf('format("svg")')>0){var m=KYe(g);m&&new mLr(e).load(v,m)}})}}})}})}}oqe.parseExternalUrl=KYe;class _Lr extends _T{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var t=this.getAttribute("x"),r=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),r.hasValue()&&e.translate(0,r.getPixels("y"))}path(e){var{element:t}=this;t&&t.path(e)}renderChildren(e){var{document:t,element:r}=this;if(r){var i=r;if(r.type==="symbol"&&(i=new Dk(t,null),i.attributes.viewBox=new jn(t,"viewBox",r.getAttribute("viewBox").getString()),i.attributes.preserveAspectRatio=new jn(t,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),i.attributes.overflow=new jn(t,"overflow",r.getAttribute("overflow").getString()),i.children=r.children,r.styles.opacity=new jn(t,"opacity",this.calculateOpacity())),i.type==="svg"){var a=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);a.hasValue()&&(i.attributes.width=new jn(t,"width",a.getString())),o.hasValue()&&(i.attributes.height=new jn(t,"height",o.getString()))}var s=i.parent;i.parent=this,i.render(e),i.parent=s}}getBoundingBox(e){var{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){var{document:e,element:t}=this;return y2.fromElement(e,t)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function C6(n,e,t,r,i,a){return n[t*r*4+e*4+a]}function A6(n,e,t,r,i,a,o){n[t*r*4+e*4+a]=o}function Eu(n,e,t){var r=n[e];return r*t}function l1(n,e,t,r){return e+Math.cos(n)*t+Math.sin(n)*r}class sqe extends il{constructor(e,t,r){super(e,t,r),this.type="feColorMatrix";var i=xv(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var a=i[0];i=[.213+.787*a,.715-.715*a,.072-.072*a,0,0,.213-.213*a,.715+.285*a,.072-.072*a,0,0,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var o=i[0]*Math.PI/180;i=[l1(o,.213,.787,-.213),l1(o,.715,-.715,-.715),l1(o,.072,-.072,.928),0,0,l1(o,.213,-.213,.143),l1(o,.715,.285,.14),l1(o,.072,-.072,-.283),0,0,l1(o,.213,-.213,-.787),l1(o,.715,-.715,.715),l1(o,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=i,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,r,i,a){for(var{includeOpacity:o,matrix:s}=this,l=e.getImageData(0,0,i,a),u=0;u{l.addBoundingBox(v.getBoundingBox(e))}),i=Math.floor(l.x1),a=Math.floor(l.y1),o=Math.floor(l.width),s=Math.floor(l.height)}var u=this.removeStyles(t,a$.ignoreStyles),h=r.createCanvas(i+o,a+s),c=h.getContext("2d");r.screen.setDefaults(c),this.renderChildren(c),new sqe(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,i+o,a+s);var f=r.createCanvas(i+o,a+s),d=f.getContext("2d");r.screen.setDefaults(d),t.render(d),d.globalCompositeOperation="destination-in",d.fillStyle=c.createPattern(h,"no-repeat"),d.fillRect(0,0,i+o,a+s),e.fillStyle=d.createPattern(f,"no-repeat"),e.fillRect(0,0,i+o,a+s),this.restoreStyles(t,u)}render(e){}}a$.ignoreStyles=["mask","transform","clip-path"];var FAe=()=>{};class xLr extends il{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:t}=this,r=Reflect.getPrototypeOf(e),{beginPath:i,closePath:a}=e;r&&(r.beginPath=FAe,r.closePath=FAe),Reflect.apply(i,e,[]),this.children.forEach(o=>{if(!(typeof o.path>"u")){var s=typeof o.elementTransform<"u"?o.elementTransform():null;s||(s=y2.fromElement(t,o)),s&&s.apply(e),o.path(e),r&&(r.closePath=a),s&&s.unapply(e)}}),Reflect.apply(a,e,[]),e.clip(),r&&(r.beginPath=i,r.closePath=a)}render(e){}}class o$ extends il{constructor(){super(...arguments),this.type="filter"}apply(e,t){var{document:r,children:i}=this,a=t.getBoundingBox(e);if(!!a){var o=0,s=0;i.forEach(m=>{var y=m.extraFilterDistance||0;o=Math.max(o,y),s=Math.max(s,y)});var l=Math.floor(a.width),u=Math.floor(a.height),h=l+2*o,c=u+2*s;if(!(h<1||c<1)){var f=Math.floor(a.x),d=Math.floor(a.y),v=this.removeStyles(t,o$.ignoreStyles),p=r.createCanvas(h,c),g=p.getContext("2d");r.screen.setDefaults(g),g.translate(-f+o,-d+s),t.render(g),i.forEach(m=>{typeof m.apply=="function"&&m.apply(g,0,0,h,c)}),e.drawImage(p,0,0,h,c,f-o,d-s,h,c),this.restoreStyles(t,v)}}}render(e){}}o$.ignoreStyles=["filter","transform","clip-path"];class SLr extends il{constructor(e,t,r){super(e,t,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,t,r,i,a){}}class wLr extends il{constructor(){super(...arguments),this.type="feMorphology"}apply(e,t,r,i,a){}}class bLr extends il{constructor(){super(...arguments),this.type="feComposite"}apply(e,t,r,i,a){}}class ELr extends il{constructor(e,t,r){super(e,t,r),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,r,i,a){var{document:o,blurRadius:s}=this,l=o.window?o.window.document.body:null,u=e.canvas;u.id=o.getUniqueId(),l&&(u.style.display="none",l.appendChild(u)),_Ir(u,t,r,i,a,s),l&&l.removeChild(u)}}class TLr extends il{constructor(){super(...arguments),this.type="title"}}class CLr extends il{constructor(){super(...arguments),this.type="desc"}}var ALr={svg:Dk,rect:nqe,circle:KIr,ellipse:JIr,line:QIr,polyline:iqe,polygon:eLr,path:ns,pattern:tLr,marker:rLr,defs:nLr,linearGradient:iLr,radialGradient:aLr,stop:oLr,animate:she,animateColor:sLr,animateTransform:lLr,font:uLr,"font-face":hLr,"missing-glyph":cLr,glyph:rqe,text:rw,tspan:i$,tref:fLr,a:dLr,textPath:vLr,image:gLr,g:ohe,symbol:yLr,style:oqe,use:_Lr,mask:a$,clipPath:xLr,filter:o$,feDropShadow:SLr,feMorphology:wLr,feComposite:bLr,feColorMatrix:sqe,feGaussianBlur:ELr,title:TLr,desc:CLr};function BAe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function MLr(n){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:!1,t=document.createElement("img");return e&&(t.crossOrigin="Anonymous"),new Promise((r,i)=>{t.onload=()=>{r(t)},t.onerror=(a,o,s,l,u)=>{i(u)},t.src=n})}),sre.apply(this,arguments)}class TS{constructor(e){var{rootEmSize:t=12,emSize:r=12,createCanvas:i=TS.createCanvas,createImage:a=TS.createImage,anonymousCrossOrigin:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=e,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=t,this.emSize=r,this.createCanvas=i,this.createImage=this.bindCreateImage(a,o),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,t){return typeof t=="boolean"?(r,i)=>e(r,typeof i=="boolean"?i:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:t}=this;t.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e){var t=e.nodeName.replace(/^[^:]+:/,""),r=TS.elementTypes[t];return typeof r<"u"?new r(this,e):new HIr(this,e)}createTextNode(e){return new ZIr(this,e)}setViewBox(e){this.screen.setViewBox(MLr({document:this},e))}}TS.createCanvas=ILr;TS.createImage=LLr;TS.elementTypes=ALr;function GAe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tb(n){for(var e=1;e2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new zq(r),this.screen=new n$(e,r),this.options=r;var i=new TS(this,r),a=i.createDocumentElement(t);this.document=i,this.documentElement=a}static from(e,t){var r=arguments;return Vc(function*(){var i=r.length>2&&r[2]!==void 0?r[2]:{},a=new zq(i),o=yield a.parse(t);return new bA(e,o,i)})()}static fromString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=new zq(r),a=i.parseFromString(t);return new bA(e,a,r)}fork(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return bA.from(e,t,Tb(Tb({},this.options),r))}forkString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return bA.fromString(e,t,Tb(Tb({},this.options),r))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,t=this;return Vc(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:{};t.start(Tb({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),yield t.ready(),t.stop()})()}start(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:t,screen:r,options:i}=this;r.start(t,Tb(Tb({enableRedraw:!0},i),e))}stop(){this.screen.stop()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(e,t,r)}}var lqe=8,CC=lqe*2;const u1=1e-7;class ts{static getValidStyleFromLayerInfo(e,t,r){var i=t.getGeometry().getType().toUpperCase(),a=e.layerStyle,o=this.getDefaultStyle(i);if((i==="POINT"||i==="MULTIPOINT")&&!t.getProperties().textStyle&&e.type!=="LABEL"&&!t.getProperties().TEXT_FEATURE_CONTENT){if(a){var s={transparent:!0,resourceType:"SYMBOLMARKER",picWidth:Math.ceil(a.markerSize*eE*Ii.mm)||13,picHeight:Math.ceil(a.markerSize*eE*Ii.mm)||13,style:JSON.stringify(a)},l=H.urlAppend(r+"/symbol.png",H.getParameterString(s));return o.pointFile=l,new So({image:new yy({src:o.pointFile})})}return this.toOLPointStyle(o)}else if((i==="POINT"||i==="MULTIPOINT")&&(t.getProperties().textStyle||e.type==="LABEL"||t.getProperties().TEXT_STYLE_INFO)){if(o=this.getDefaultStyle("TEXT"),t.getProperties().textStyle&&(a=t.getProperties().textStyle),t.getProperties().TEXT_STYLE_INFO&&(a=JSON.parse(t.getProperties().TEXT_STYLE_INFO).textStyle),a&&a!=="{}"){var u="";o.fontStyle=a.italic?"italic":"normal",o.fontWeight=a.bold?a.fontWeight:"normal";var h=a.fontHeight*eE*Ii.mm*.85;o.fontSize=h+"px",a.fontName.indexOf("@")?u=a.fontName.replace(/@/g,""):u=a.fontName,o.fontFamily=u,o.textHeight=h;var c=a.align.replace(/TOP|MIDDLE|BASELINE|BOTTOM/,"");o.textAlign=c.toLowerCase();var f=a.align.replace(/LEFT|RIGHT|CENTER/,"");f==="BASELINE"&&(f="alphabetic"),o.textBaseline=f.toLowerCase(),o.haloRadius=a.outline?a.outlineWidth:0,o.backColor="rgba("+a.backColor.red+","+a.backColor.green+","+a.backColor.blue+",1)",o.foreColor="rgba("+a.foreColor.red+","+a.foreColor.green+","+a.foreColor.blue+",1)",o.rotation=a.rotation}var d;if(t.getProperties().textStyle&&t.getProperties().texts&&(d=t.getProperties().texts[0]),e.type==="LABEL"){var v=e.textField;if(v&&v.indexOf(".")){var p=v.split(".");v=p&&p.length>0&&p[p.length-1]}d=t.getProperties().attributes?t.getProperties().attributes[v]:t.getProperties()[v]}return t.getProperties().TEXT_FEATURE_CONTENT&&(d=t.getProperties().TEXT_FEATURE_CONTENT),d?this.toOLTextStyle(o,d):this.toOLPointStyle(this.getDefaultStyle("POINT"))}else if(a){var g=a.fillSymbolID>7?0:a.fillSymbolID,m=a.lineSymbolID>5?0:a.lineSymbolID;for(var y in a){var _=UY.ServerStyleMap[y],x=_.canvasStyle;if(x&&x!=""){var S;switch(_.type){case"number":S=a[y],_.unit&&(S=S*eE*Ii[_.unit]*2.5),o[x]=S;break;case"color":var w=a[y],b=a.fillBackColor,E=1;if(x==="fillStyle")if(g===0||g===1)E=1-g,S="rgba("+w.red+","+w.green+","+w.blue+","+E+")";else try{var T=document.createElement("canvas");T.height=8,T.width=8;var C=T.getContext("2d"),A=new Image;this.layer&&this.layer.fillImages&&C.drawImage(this.layer.fillImages["System "+g],0,0);for(var M=C.getImageData(0,0,T.width,T.height),I=M.data,R=0,k=I.length;R{i=new yy({img:S,scale:f/S.width,imgSize:[S.width,S.height],anchor:[.5,.5]})})):i=new yy({src:v,scale:p,anchor:y}):i=new rm({radius:f,fill:new Ko({color:_}),stroke:new es({width:h||u1,color:x}),displacement:this.getCircleDisplacement(f,g,m)}),r.setImage(i);else if(t==="LINE"||t==="LINESTRING"||t==="MULTILINESTRING"||t==="LINEARRING")o=new es({width:h||u1,color:x,lineCap:d||"round",lineDash:this.dashStyle(e,1)}),r.setStroke(o);else if(t==="POLYGON"||t==="MULTIPOLYGON"||t==="REGION")a=new Ko({color:_}),o=new es({width:h||u1,color:x,lineCap:d||"round",lineDash:this.dashStyle(e,1)}),r.setFill(a),r.setStroke(o);else{let S=this.getCanvas(e);i=new yy({img:S.canvas,imgSize:[S.width,S.height],scale:1,anchor:[.5,.5]}),r.setImage(i)}return r}static getIconAnchor(e=.5,t=.5){return[e,t]}static getCircleDisplacement(e,t=0,r=0){const i=e*t,a=e*r;return[i,-a]}static getTextOffset(e,t=0,r=0){const i=e.substr(0,e.length-2)/2;return{x:i*t,y:i*r}}static getCanvas(e){let t;e.canvas?document.querySelector("#"+e.canvas)?t=document.getElemntById(e.canvas):t=this.createCanvas(e):(t=this.createCanvas(e),e.canvas=t.id),t.style.display="none";var r=t.getContext("2d");let i=Number(e.font.replace(/[^0-9]/ig,"")),a=e.text.split(`\r `),o=a.length;r.font=e.font;let s=this.drawRect(r,e,a,i,t);return this.positionY=lqe,o>1?a.forEach(function(l,u){u!==0&&(this.positionY=this.positionY+i),this.canvasTextAutoLine(l,e,r,i,s.width)},this):this.canvasTextAutoLine(a[0],e,r,i,s.width),{canvas:t,width:s.width,height:s.height}}static createCanvas(e){let t=document.createElement("div");document.body.appendChild(t);let r=document.createElement("canvas");return r.id=e.canvas?e.canvas:"textCanvas"+br.newGuid(8),t.appendChild(r),r}static drawRect(e,t,r,i,a){let o=t.backgroundFill,s=t.maxWidth-CC,l,u=0,h=0,c=[];return r.forEach(function(f){let d="",v;h++;for(var p=0;ps&&p>0||f[p]===` `?(d=f[p],h++,v=!0):(d=g,l=y)}v?c.push(s):c.push(l)},this),l=this.getCanvasWidth(c,s),u=h*i,u+=CC,a.width=l,a.height=u,e.fillStyle=o,e.fillRect(0,0,l,u),{width:l,height:u}}static getCanvasWidth(e,t){let r=0;for(let i=0;i=t)return t+CC;a>r&&(r=a)}return r+CC}static canvasTextAutoLine(e,t,r,i,a){r.font=t.font;let o=t.textAlign,s=this.getPositionX(o,a),l=e.split(""),u="",h=t.fillColor,c=t.maxWidth-CC;for(var f=0;fc&&f>0||l[f]===` `?(r.fillStyle=h,r.textAlign=o,r.textBaseline="top",r.fillText(u,s,this.positionY),u=l[f],this.positionY+=i):u=d}r.fillStyle=h,r.textAlign=o,r.textBaseline="top",r.fillText(u,s,this.positionY)}static getPositionX(e,t){let r,i=t-CC;switch(e){case"center":r=i/2;break;case"right":r=i;break;default:r=8;break}return r}static hexToRgb(e){if(!!e){var t=e.replace("#","").split(""),r=[t[0]+t[1],t[2]+t[3],t[4]+t[5]];return r=r.map(function(i){return parseInt(i,16)}),r}}static formatRGB(e){let t;return e.length===3?(t="rgb(",e.forEach(function(r,i){i===2?t+=r:t+=r+","})):(t="rgba(",e.forEach(function(r,i){i===3?t+=r:t+=r+","})),t+=")",t}static async getCanvasFromSVG(e,t,r){const i=window.canvg&&window.canvg.default?window.canvg.default:bA;let a=document.createElement("canvas");a.id="dataviz-canvas-"+br.newGuid(8),a.style.display="none",t.appendChild(a);try{const o=a.getContext("2d");if((await i.from(o,e,{ignoreMouse:!0,ignoreAnimation:!0,forceRedraw:()=>!1})).start(),a.width>300||a.height>300)return;r(a)}catch{return}}static stopCanvg(){this.canvgsV.forEach(e=>e.stop()),this.canvgsV=[]}static getMarkerDefaultStyle(e,t){let r;switch(e){case"POINT":r={src:`${t}apps/dataviz/static/imgs/markers/mark_red.png`,scale:1,anchor:[.5,1]};break;case"LINE":case"LINESTRING":case"MULTILINESTRING":r={strokeColor:"#3498db",strokeOpacity:1,strokeWidth:5,lineCap:"round",lineDash:"solid"};break;case"REGION":case"POLYGON":case"MULTIPOLYGON":r={fillColor:"#1abd9c",fillOpacity:1,strokeColor:"#3498db",strokeOpacity:1,strokeWidth:3,lineCap:"round",lineDash:"solid"};break}return r}static async getOpenlayersStyle(e,t,r){let i;return e.type==="BASIC_POINT"?i=await this.toOpenLayersStyle(e,t):e.type==="SYMBOL_POINT"?i=this.getSymbolStyle(e,r):e.type==="SVG_POINT"?i=await this.getSVGStyle(e):e.type==="IMAGE_POINT"&&(i=this.getImageStyle(e)),i}static getSymbolStyle(e,t){let r="";e.unicode&&(r=String.fromCharCode(parseInt(e.unicode.replace(/^&#x/,""),16)));let i=ts.hexToRgb(e.fillColor);i.push(e.fillOpacity);let a=ts.hexToRgb(e.strokeColor);a.push(e.strokeOpacity);let o=t?2*e.radius+"px":e.fontSize;const{offsetX:s,offsetY:l,rotation:u=0}=e,h=ts.getTextOffset(o,s,l);return new So({text:new J1({text:r,font:o+" supermapol-icons",placement:"point",textAlign:"center",fill:new Ko({color:i}),backgroundFill:new Ko({color:[0,0,0,0]}),stroke:new es({width:e.strokeWidth||1e-6,color:a}),offsetX:h.x,offsetY:h.y,rotation:u})})}static async getSVGStyle(e){let t,r=this;r.svgDiv||(r.svgDiv=document.createElement("div"),document.body.appendChild(r.svgDiv));const{url:i,radius:a,offsetX:o,offsetY:s,fillOpacity:l,rotation:u}=e;let h=this.getIconAnchor(o,s);return await ts.getCanvasFromSVG(i,r.svgDiv,function(c){t=new So({image:new yy({img:r.setColorToCanvas(c,e),scale:2*a/c.width,imgSize:[c.width,c.height],anchor:h||[.5,.5],opacity:l,anchorOrigin:"bottom-right",rotation:u})})}),t}static setColorToCanvas(e,t){let r=e.getContext("2d"),i=ts.hexToRgb(t.fillColor);i&&i.push(t.fillOpacity);let a=ts.hexToRgb(t.strokeColor);return a&&a.push(t.strokeOpacity),r.fillStyle=ts.formatRGB(i),r.fill(),r.strokeStyle=ts.formatRGB(a),r.lineWidth=t.strokeWidth,r.stroke(),e}static getImageStyle(e){let t=e.imageInfo.size,r=2*e.radius/t.w,i=e.imageInfo,a=i.img;(!a||!a.src)&&(a=new Image,a.src=i.url);const{offsetX:o,offsetY:s,rotation:l}=e;let u=this.getIconAnchor(o,s);return new So({image:new yy({img:a,scale:r,imgSize:[t.w,t.h],anchor:u||[.5,.5],anchorOrigin:"bottom-right",rotation:l})})}static getRoadPath(e,t){const{strokeWidth:r=u1,lineCap:i,strokeColor:a,strokeOpacity:o}=e;let s=this.hexToRgb(a);s&&s.push(o);var l=new So({stroke:new es({width:r||u1,color:s,lineCap:i||"round",lineDash:[0]})});const{strokeColor:u}=t;let h=this.hexToRgb(u);h&&h.push(o);let c=t.strokeWidth||(r===0?u1:r+2);var f=new So({stroke:new es({width:c,color:h,lineCap:i||"round",lineDash:[0]})});return[f,l]}static getPathway(e,t){let{strokeWidth:r=u1,strokeColor:i,strokeOpacity:a}=e;const o=(d=>[d,d+r*2])(4*r),s="square";let l=this.hexToRgb(i);l&&l.push(a);var u=new So({stroke:new es({width:r*.5||u1,color:l,lineCap:s,lineDash:o})});const{strokeColor:h}=t;let c=this.hexToRgb(h);c&&c.push(a);var f=new So({stroke:new es({width:r||u1,color:c,lineCap:s})});return[f,u]}}var PLr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),OLr=function(n){PLr(e,n);function e(t){var r=n.call(this)||this;return r.map_=t,r}return e.prototype.dispatchRenderEvent=function(t,r){ti()},e.prototype.calculateMatrices2D=function(t){var r=t.viewState,i=t.coordinateToPixelTransform,a=t.pixelToCoordinateTransform;Id(i,t.size[0]/2,t.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),bk(a,i)},e.prototype.forEachFeatureAtCoordinate=function(t,r,i,a,o,s,l,u){var h,c=r.viewState;function f(k,D,G,W){return o.call(s,D,k?G:null,W)}var d=c.projection,v=hue(t.slice(),d),p=[[0,0]];if(d.canWrapX()&&a){var g=d.getExtent(),m=Co(g);p.push([-m,0],[m,0])}for(var y=r.layerStatesArray,_=y.length,x=[],S=[],w=0;w=0;--b){var E=y[b],T=E.layer;if(T.hasRenderer()&&l7(E,c)&&l.call(u,T)){var C=T.getRenderer(),A=T.getSource();if(C&&A){var M=A.getWrapX()?v:t,I=f.bind(null,E.managed);S[0]=M[0]+p[w][0],S[1]=M[1]+p[w][1],h=C.forEachFeatureAtCoordinate(S,r,i,I,x)}if(h)return h}}if(x.length!==0){var R=1/x.length;return x.forEach(function(k,D){return k.distanceSq+=D*R}),x.sort(function(k,D){return k.distanceSq-D.distanceSq}),x.some(function(k){return h=k.callback(k.feature,k.layer,k.geometry)}),h}},e.prototype.forEachLayerAtPixel=function(t,r,i,a,o){return ti()},e.prototype.hasFeatureAtCoordinate=function(t,r,i,a,o,s){var l=this.forEachFeatureAtCoordinate(t,r,i,a,ZA,this,o,s);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){ti()},e.prototype.scheduleExpireIconCache=function(t){d7.canExpireCache()&&t.postRenderFunctions.push(RLr)},e}(PV);function RLr(n,e){d7.expire()}const DLr=OLr;var NLr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),kLr=function(n){NLr(e,n);function e(t){var r=n.call(this,t)||this;r.fontChangeListenerKey_=pa(f1,UM.PROPERTYCHANGE,t.redrawText.bind(t)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=mk+" ol-layers";var a=t.getViewport();return a.insertBefore(r.element_,a.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return e.prototype.dispatchRenderEvent=function(t,r){var i=this.getMap();if(i.hasListener(t)){var a=new PR(t,void 0,r);i.dispatchEvent(a)}},e.prototype.disposeInternal=function(){Ms(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),n.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(Tf.PRECOMPOSE,t);var r=t.layerStatesArray.sort(function(d,v){return d.zIndex-v.zIndex}),i=t.viewState;this.children_.length=0;for(var a=[],o=null,s=0,l=r.length;s=0;--s)a[s].renderDeclutter(t);X0r(this.element_,this.children_),this.dispatchRenderEvent(Tf.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)},e.prototype.forEachLayerAtPixel=function(t,r,i,a,o){for(var s=r.viewState,l=r.layerStatesArray,u=l.length,h=u-1;h>=0;--h){var c=l[h],f=c.layer;if(f.hasRenderer()&&l7(c,s)&&o(f)){var d=f.getRenderer(),v=d.getDataAtPixel(t,r,i);if(v){var p=a(f,v);if(p)return p}}}},e}(DLr);const FLr=kLr;var uqe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),$x=function(n){uqe(e,n);function e(t,r){var i=n.call(this,t)||this;return i.layer=r,i}return e}(Fm),Uq={LAYERS:"layers"},BLr=function(n){uqe(e,n);function e(t){var r=this,i=t||{},a=Ao({},i);delete a.layers;var o=i.layers;return r=n.call(this,a)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(Uq.LAYERS,r.handleLayersChanged_),o?Array.isArray(o)?o=new gd(o.slice(),{unique:!0}):ki(typeof o.getArray=="function",43):o=new gd(void 0,{unique:!0}),r.setLayers(o),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Ms),this.layersListenerKeys_.length=0;var t=this.getLayers();this.layersListenerKeys_.push(pa(t,ud.ADD,this.handleLayersAdd_,this),pa(t,ud.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(Ms);QI(this.listenerKeys_);for(var i=t.getArray(),a=0,o=i.length;athis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Ms(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Ci.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Ms(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ms),this.dragListenerKeys_.length=0,this.element_=null,n.prototype.disposeInternal.call(this)},e}(eL);const HLr=WLr,Pc={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var x7=1/0,jLr=function(){function n(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return n.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,QI(this.queuedElements_)},n.prototype.dequeue=function(){var e=this.elements_,t=this.priorities_,r=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},n.prototype.enqueue=function(e){ki(!(this.keyFunction_(e)in this.queuedElements_),31);var t=this.priorityFunction_(e);return t!=x7?(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},n.prototype.getCount=function(){return this.elements_.length},n.prototype.getLeftChildIndex_=function(e){return e*2+1},n.prototype.getRightChildIndex_=function(e){return e*2+2},n.prototype.getParentIndex_=function(e){return e-1>>1},n.prototype.heapify_=function(){var e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)},n.prototype.isEmpty=function(){return this.elements_.length===0},n.prototype.isKeyQueued=function(e){return e in this.queuedElements_},n.prototype.isQueued=function(e){return this.isKeyQueued(this.keyFunction_(e))},n.prototype.siftUp_=function(e){for(var t=this.elements_,r=this.priorities_,i=t.length,a=t[e],o=r[e],s=e;e>1;){var l=this.getLeftChildIndex_(e),u=this.getRightChildIndex_(e),h=ue;){var s=this.getParentIndex_(t);if(i[s]>o)r[t]=r[s],i[t]=i[s],t=s;else break}r[t]=a,i[t]=o},n.prototype.reprioritize=function(){var e=this.priorityFunction_,t=this.elements_,r=this.priorities_,i=0,a=t.length,o,s,l;for(s=0;s0;)o=this.dequeue()[0],s=o.getKey(),a=o.getState(),a===Xr.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,o.load())},e}(XLr);const ZLr=qLr;function KLr(n,e,t,r,i){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return x7;var a=n.viewState.center,o=r[0]-a[0],s=r[1]-a[1];return 65536*Math.log(i)+Math.sqrt(o*o+s*s)/i}const Ig={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var JLr=42,lhe=256;function zAe(n,e,t){return function(r,i,a,o,s){if(!!r){if(!i&&!e)return r;var l=e?0:a[0]*i,u=e?0:a[1]*i,h=s?s[0]:0,c=s?s[1]:0,f=n[0]+l/2+h,d=n[2]-l/2+h,v=n[1]+u/2+c,p=n[3]-u/2+c;f>d&&(f=(d+f)/2,d=f),v>p&&(v=(p+v)/2,p=v);var g=Ui(r[0],f,d),m=Ui(r[1],v,p);if(o&&t&&i){var y=30*i;g+=-y*Math.log(1+Math.max(0,f-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-d)/y),m+=-y*Math.log(1+Math.max(0,v-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-p)/y)}return[g,m]}}}function QLr(n){return n}function uhe(n,e,t,r){var i=Co(e)/t[0],a=lh(e)/t[1];return r?Math.min(n,Math.max(i,a)):Math.min(n,Math.min(i,a))}function hhe(n,e,t){var r=Math.min(n,e),i=50;return r*=Math.log(1+i*Math.max(0,n/e-1))/i+1,t&&(r=Math.max(r,t),r/=Math.log(1+i*Math.max(0,t/n-1))/i+1),Ui(r,t/2,e*2)}function ePr(n,e,t,r){return function(i,a,o,s){if(i!==void 0){var l=n[0],u=n[n.length-1],h=t?uhe(l,t,o,r):l;if(s){var c=e!==void 0?e:!0;return c?hhe(i,h,u):Ui(i,u,h)}var f=Math.min(h,i),d=Math.floor(OV(n,f,a));return n[d]>h&&d1)c=t;else if(f>0){for(var d=0;di&&(i=u),a=s,o=l}return i}function dhe(n,e,t,r,i){for(var a=0,o=t.length;aa&&(u-s)*(a-l)-(i-s)*(h-l)>0&&o++:h<=a&&(u-s)*(a-l)-(i-s)*(h-l)<0&&o--,s=u,l=h}return o!==0}function yhe(n,e,t,r,i,a){if(t.length===0||!yE(n,e,t[0],r,i,a))return!1;for(var o=1,s=t.length;ox&&(u=(h+c)/2,yhe(n,e,t,r,u,v)&&(_=u,x=S)),h=c}return isNaN(_)&&(_=i[a]),o?(o.push(_,v,x),o):[_,v,x]}function dqe(n,e,t,r,i){for(var a=[],o=0,s=t.length;o=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]?!0:vqe(n,e,t,r,function(o,s){return xyr(i,o,s)}):!1}function yPr(n,e,t,r,i){for(var a=0,o=t.length;a0}function gqe(n,e,t,r,i){for(var a=i!==void 0?i:!1,o=0,s=t.length;o1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var a=0;a0},e.prototype.getInteracting=function(){return this.hints_[Gs.INTERACTING]>0},e.prototype.cancelAnimations=function(){this.setHint(Gs.ANIMATING,-this.hints_[Gs.ANIMATING]);for(var t,r=0,i=this.animations_.length;r=0;--i){for(var a=this.animations_[i],o=!0,s=0,l=a.length;s0?h/u.duration:1;c>=1?(u.complete=!0,c=1):o=!1;var f=u.easing(c);if(u.sourceCenter){var d=u.sourceCenter[0],v=u.sourceCenter[1],p=u.targetCenter[0],g=u.targetCenter[1];this.nextCenter_=u.targetCenter;var m=d+f*(p-d),y=v+f*(g-v);this.targetCenter_=[m,y]}if(u.sourceResolution&&u.targetResolution){var _=f===1?u.targetResolution:u.sourceResolution+f*(u.targetResolution-u.sourceResolution);if(u.anchor){var x=this.getViewportSize_(this.getRotation()),S=this.constraints_.resolution(_,0,x,!0);this.targetCenter_=this.calculateCenterZoom(S,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=_,this.applyTargetState_(!0)}if(u.sourceRotation!==void 0&&u.targetRotation!==void 0){var w=f===1?bS(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+f*(u.targetRotation-u.sourceRotation);if(u.anchor){var b=this.constraints_.rotation(w,!0);this.targetCenter_=this.calculateCenterRotate(b,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=w}if(this.applyTargetState_(!0),r=!0,!u.complete)break}}if(o){this.animations_[i]=null,this.setHint(Gs.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var E=a[0].callback;E&&M6(E,!0)}}this.animations_=this.animations_.filter(Boolean),r&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,r){var i,a=this.getCenterInternal();return a!==void 0&&(i=[a[0]-r[0],a[1]-r[1]],uue(i,t-this.getRotation()),wyr(i,r)),i},e.prototype.calculateCenterZoom=function(t,r){var i,a=this.getCenterInternal(),o=this.getResolution();if(a!==void 0&&o!==void 0){var s=r[0]-t*(r[0]-a[0])/o,l=r[1]-t*(r[1]-a[1])/o;i=[s,l]}return i},e.prototype.getViewportSize_=function(t){var r=this.viewportSize_;if(t){var i=r[0],a=r[1];return[Math.abs(i*Math.cos(t))+Math.abs(a*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(a*Math.cos(t))]}else return r},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t&&Ate(t,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(Ig.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var r=this.calculateExtentInternal(t);return Xje(r,this.getProjection())},e.prototype.calculateExtentInternal=function(t){var r=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();ki(i,1);var a=this.getResolution();ki(a!==void 0,2);var o=this.getRotation();return ki(o!==void 0,3),oN(i,a,o,r)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Ig.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,r){return this.getResolutionForExtentInternal(F1(t,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(t,r){var i=r||this.getViewportSizeMinusPadding_(),a=Co(t)/i[0],o=lh(t)/i[1];return Math.max(a,o)},e.prototype.getResolutionForValueFunction=function(t){var r=t||2,i=this.getConstrainedResolution(this.maxResolution_),a=this.minResolution_,o=Math.log(i/a)/Math.log(r);return function(s){var l=i/Math.pow(r,s*o);return l}},e.prototype.getRotation=function(){return this.get(Ig.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var r=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),a=this.minResolution_,o=Math.log(i/a)/r;return function(s){var l=Math.log(i/s)/r/o;return l}},e.prototype.getViewportSizeMinusPadding_=function(t){var r=this.getViewportSize_(t),i=this.padding_;return i&&(r=[r[0]-i[1]-i[3],r[1]-i[0]-i[2]]),r},e.prototype.getState=function(){var t=this.getProjection(),r=this.getResolution(),i=this.getRotation(),a=this.getCenterInternal(),o=this.padding_;if(o){var s=this.getViewportSizeMinusPadding_();a=$q(a,this.getViewportSize_(),[s[0]/2+o[3],s[1]/2+o[0]],r,i)}return{center:a.slice(0),projection:t!==void 0?t:null,resolution:r,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,r=this.getResolution();return r!==void 0&&(t=this.getZoomForResolution(r)),t},e.prototype.getZoomForResolution=function(t){var r=this.minZoom_||0,i,a;if(this.resolutions_){var o=OV(this.resolutions_,t,1);r=o,i=this.resolutions_[o],o==this.resolutions_.length-1?a=2:a=i/this.resolutions_[o+1]}else i=this.maxResolution_,a=this.zoomFactor_;return r+Math.log(i/t)/Math.log(a)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var r=Ui(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,Ui(t-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,r){var i;if(ki(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function",24),Array.isArray(t)){ki(!Sk(t),25);var a=F1(t,this.getProjection());i=jAe(a)}else if(t.getType()===Kr.CIRCLE){var a=F1(t.getExtent(),this.getProjection());i=jAe(a),i.rotate(this.getRotation(),kf(a))}else{var o=Lyr();o?i=t.clone().transform(o,this.getProjection()):i=t}this.fitInternal(i,r)},e.prototype.rotatedExtentForGeometry=function(t){for(var r=this.getRotation(),i=Math.cos(r),a=Math.sin(-r),o=t.getFlatCoordinates(),s=t.getStride(),l=1/0,u=1/0,h=-1/0,c=-1/0,f=0,d=o.length;f=0;u--){var h=l[u];if(!(h.getMap()!==this||!h.getActive()||!this.getTargetElement())){var c=h.handleEvent(t);if(!c||t.propagationStopped)break}}}},e.prototype.handlePostRender=function(){var t=this.frameState_,r=this.tileQueue_;if(!r.isEmpty()){var i=this.maxTilesLoading_,a=i;if(t){var o=t.viewHints;if(o[Gs.ANIMATING]||o[Gs.INTERACTING]){var s=Date.now()-t.time>8;i=s?0:8,a=s?0:2}}r.getTilesLoading()0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Iw(r,this.renderedAttributions_)){j0r(this.ulElement_);for(var a=0,o=r.length;a0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:lL}):r.setRotation(0))}},e.prototype.render=function(t){var r=t.frameState;if(!!r){var i=r.viewState.rotation;if(i!=this.rotation_){var a="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains(e6);!o&&i===0?this.element.classList.add(e6):o&&i!==0&&this.element.classList.remove(e6)}this.label_.style.transform=a}this.rotation_=i}},e}(tL);const GPr=BPr;var zPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),UPr=function(n){zPr(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{element:document.createElement("div"),target:i.target})||this;var a=i.className!==void 0?i.className:"ol-zoom",o=i.delta!==void 0?i.delta:1,s=i.zoomInClassName!==void 0?i.zoomInClassName:a+"-in",l=i.zoomOutClassName!==void 0?i.zoomOutClassName:a+"-out",u=i.zoomInLabel!==void 0?i.zoomInLabel:"+",h=i.zoomOutLabel!==void 0?i.zoomOutLabel:"\u2013",c=i.zoomInTipLabel!==void 0?i.zoomInTipLabel:"Zoom in",f=i.zoomOutTipLabel!==void 0?i.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=s,d.setAttribute("type","button"),d.title=c,d.appendChild(typeof u=="string"?document.createTextNode(u):u),d.addEventListener(Ci.CLICK,r.handleClick_.bind(r,o),!1);var v=document.createElement("button");v.className=l,v.setAttribute("type","button"),v.title=f,v.appendChild(typeof h=="string"?document.createTextNode(h):h),v.addEventListener(Ci.CLICK,r.handleClick_.bind(r,-o),!1);var p=a+" "+mk+" "+aue,g=r.element;return g.className=p,g.appendChild(d),g.appendChild(v),r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleClick_=function(t,r){r.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var r=this.getMap(),i=r.getView();if(!!i){var a=i.getZoom();if(a!==void 0){var o=i.getConstrainedZoom(a+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:o,duration:this.duration_,easing:lL})):i.setZoom(o)}}},e}(tL);const VPr=UPr;function $Pr(n){var e=n||{},t=new gd,r=e.zoom!==void 0?e.zoom:!0;r&&t.push(new VPr(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&t.push(new GPr(e.rotateOptions));var a=e.attribution!==void 0?e.attribution:!0;return a&&t.push(new kPr(e.attributionOptions)),t}const XAe={ACTIVE:"active"};var WPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),HPr=function(n){WPr(e,n);function e(t){var r=n.call(this)||this;return r.on,r.once,r.un,t&&t.handleEvent&&(r.handleEvent=t.handleEvent),r.map_=null,r.setActive(!0),r}return e.prototype.getActive=function(){return this.get(XAe.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(XAe.ACTIVE,t)},e.prototype.setMap=function(t){this.map_=t},e}(kv);function jPr(n,e,t){var r=n.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];n.animateInternal({duration:t!==void 0?t:250,easing:aPr,center:n.getConstrainedCenter(i)})}}function xhe(n,e,t,r){var i=n.getZoom();if(i!==void 0){var a=n.getConstrainedZoom(i+e),o=n.getResolutionForZoom(a);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:t,duration:r!==void 0?r:250,easing:lL})}}const kk=HPr;var XPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),YPr=function(n){XPr(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==Zs.DBLCLICK){var i=t.originalEvent,a=t.map,o=t.coordinate,s=i.shiftKey?-this.delta_:this.delta_,l=a.getView();xhe(l,s,o,this.duration_),i.preventDefault(),r=!0}return!r},e}(kk);const qPr=YPr;var ZPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),KPr=function(n){ZPr(e,n);function e(t){var r=this,i=t||{};return r=n.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.trackedPointers_={},r.targetPointers=[],r}return e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var r=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Zs.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Zs.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==Zs.POINTERDOWN){var a=this.handleDownEvent(t);this.handlingDownUpSequence=a,r=this.stopDown(a)}else t.type==Zs.POINTERMOVE&&this.handleMoveEvent(t);return!r},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(JPr(t)){var r=t.originalEvent,i=r.pointerId.toString();t.type==Zs.POINTERUP?delete this.trackedPointers_[i]:t.type==Zs.POINTERDOWN?this.trackedPointers_[i]=r:i in this.trackedPointers_&&(this.trackedPointers_[i]=r),this.targetPointers=Pje(this.trackedPointers_)}},e}(kk);function She(n){for(var e=n.length,t=0,r=0,i=0;i0&&this.condition_(t)){var r=t.map,i=r.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},e}(uL);const oOr=aOr;var sOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),lOr=function(n){sOr(e,n);function e(t){var r=this,i=t||{};return r=n.call(this,{stopDown:RV})||this,r.condition_=i.condition?i.condition:QPr,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(t){if(!!Wq(t)){var r=t.map,i=r.getView();if(i.getConstraints().rotation!==che){var a=r.getSize(),o=t.pixel,s=Math.atan2(a[1]/2-o[1],o[0]-a[0]/2);if(this.lastAngle_!==void 0){var l=s-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=s}}},e.prototype.handleUpEvent=function(t){if(!Wq(t))return!0;var r=t.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(t){if(!Wq(t))return!1;if(Sqe(t)&&this.condition_(t)){var r=t.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(uL);const uOr=lOr;var hOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),cOr=function(n){hOr(e,n);function e(t){var r=n.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+t,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,r=this.endPixel_,i="px",a=this.element_.style;a.left=Math.min(t[0],r[0])+i,a.top=Math.min(t[1],r[1])+i,a.width=Math.abs(r[0]-t[0])+i,a.height=Math.abs(r[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var r=this.element_.style;r.left="inherit",r.top="inherit",r.width="inherit",r.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,r){this.startPixel_=t,this.endPixel_=r,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,r=this.endPixel_,i=[t,[t[0],r[1]],r,[r[0],t[1]]],a=i.map(this.map_.getCoordinateFromPixelInternal,this.map_);a[4]=a[0].slice(),this.geometry_?this.geometry_.setCoordinates([a]):this.geometry_=new m2([a])},e.prototype.getGeometry=function(){return this.geometry_},e}(PV);const fOr=cOr;var Eqe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),I6={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},Hq=function(n){Eqe(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.coordinate=r,a.mapBrowserEvent=i,a}return e}(Fm),dOr=function(n){Eqe(e,n);function e(t){var r=n.call(this)||this;r.on,r.once,r.un;var i=t||{};return r.box_=new fOr(i.className||"ol-dragbox"),r.minArea_=i.minArea!==void 0?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:Sqe,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return e.prototype.defaultBoxEndCondition=function(t,r,i){var a=i[0]-r[0],o=i[1]-r[1];return a*a+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Hq(I6.BOXDRAG,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var r=this.boxEndCondition_(t,this.startPixel_,t.pixel);return r&&this.onBoxEnd(t),this.dispatchEvent(new Hq(r?I6.BOXEND:I6.BOXCANCEL,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Hq(I6.BOXSTART,t.coordinate,t)),!0):!1},e.prototype.onBoxEnd=function(t){},e}(uL);const vOr=dOr;var pOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),gOr=function(n){pOr(e,n);function e(t){var r=this,i=t||{},a=i.condition?i.condition:rOr;return r=n.call(this,{condition:a,className:i.className||"ol-dragzoom",minArea:i.minArea})||this,r.duration_=i.duration!==void 0?i.duration:200,r.out_=i.out!==void 0?i.out:!1,r}return e.prototype.onBoxEnd=function(t){var r=this.getMap(),i=r.getView(),a=this.getGeometry();if(this.out_){var o=i.rotatedExtentForGeometry(a),s=i.getResolutionForExtentInternal(o),l=i.getResolution()/s;a=a.clone(),a.scale(l*l)}i.fitInternal(a,{duration:this.duration_,easing:lL})},e}(vOr);const yOr=gOr,Cb={LEFT:37,UP:38,RIGHT:39,DOWN:40};var mOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),_Or=function(n){mOr(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.defaultCondition_=function(a){return wqe(a)&&bqe(a)},r.condition_=i.condition!==void 0?i.condition:r.defaultCondition_,r.duration_=i.duration!==void 0?i.duration:100,r.pixelDelta_=i.pixelDelta!==void 0?i.pixelDelta:128,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==Ci.KEYDOWN){var i=t.originalEvent,a=i.keyCode;if(this.condition_(t)&&(a==Cb.DOWN||a==Cb.LEFT||a==Cb.RIGHT||a==Cb.UP)){var o=t.map,s=o.getView(),l=s.getResolution()*this.pixelDelta_,u=0,h=0;a==Cb.DOWN?h=-l:a==Cb.LEFT?u=-l:a==Cb.RIGHT?u=l:h=l;var c=[u,h];uue(c,s.getRotation()),jPr(s,c,this.duration_),i.preventDefault(),r=!0}}return!r},e}(kk);const xOr=_Or;var SOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),wOr=function(n){SOr(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.condition_=i.condition?i.condition:bqe,r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:100,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==Ci.KEYDOWN||t.type==Ci.KEYPRESS){var i=t.originalEvent,a=i.charCode;if(this.condition_(t)&&(a=="+".charCodeAt(0)||a=="-".charCodeAt(0))){var o=t.map,s=a=="+".charCodeAt(0)?this.delta_:-this.delta_,l=o.getView();xhe(l,s,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(kk);const bOr=wOr;var EOr=function(){function n(e,t,r){this.decay_=e,this.minVelocity_=t,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return n.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},n.prototype.update=function(e,t){this.points_.push(e,t,Date.now())},n.prototype.end=function(){if(this.points_.length<6)return!1;var e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]0&&this.points_[r+2]>e;)r-=3;var i=this.points_[t+2]-this.points_[r+2];if(i<1e3/60)return!1;var a=this.points_[t]-this.points_[r],o=this.points_[t+1]-this.points_[r+1];return this.angle_=Math.atan2(o,a),this.initialVelocity_=Math.sqrt(a*a+o*o)/i,this.initialVelocity_>this.minVelocity_},n.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},n.prototype.getAngle=function(){return this.angle_},n}();const TOr=EOr;var COr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),jq={TRACKPAD:"trackpad",WHEEL:"wheel"},AOr=function(n){COr(e,n);function e(t){var r=this,i=t||{};r=n.call(this,i)||this,r.totalDelta_=0,r.lastDelta_=0,r.maxDelta_=i.maxDelta!==void 0?i.maxDelta:1,r.duration_=i.duration!==void 0?i.duration:250,r.timeout_=i.timeout!==void 0?i.timeout:80,r.useAnchor_=i.useAnchor!==void 0?i.useAnchor:!0,r.constrainResolution_=i.constrainResolution!==void 0?i.constrainResolution:!1;var a=i.condition?i.condition:tOr;return r.condition_=i.onFocusOnly?hre(xqe,a):a,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap().getView();t.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var r=t.type;if(r!==Ci.WHEEL)return!0;var i=t.map,a=t.originalEvent;a.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);var o;if(t.type==Ci.WHEEL&&(o=a.deltaY,z0r&&a.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(o/=iue),a.deltaMode===WheelEvent.DOM_DELTA_LINE&&(o*=40)),o===0)return!1;this.lastDelta_=o;var s=Date.now();this.startTime_===void 0&&(this.startTime_=s),(!this.mode_||s-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(o)<4?jq.TRACKPAD:jq.WHEEL);var l=i.getView();if(this.mode_===jq.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-o/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=s,!1;this.totalDelta_+=o;var u=Math.max(this.timeout_-(s-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),u),!1},e.prototype.handleWheelZoom_=function(t){var r=t.getView();r.getAnimating()&&r.cancelAnimations();var i=-Ui(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),xhe(r,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(kk);const Tqe=AOr;var MOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),IOr=function(n){MOr(e,n);function e(t){var r=this,i=t||{},a=i;return a.stopDown||(a.stopDown=RV),r=n.call(this,a)||this,r.anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=i.threshold!==void 0?i.threshold:.3,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(t){var r=0,i=this.targetPointers[0],a=this.targetPointers[1],o=Math.atan2(a.clientY-i.clientY,a.clientX-i.clientX);if(this.lastAngle_!==void 0){var s=o-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=s}this.lastAngle_=o;var l=t.map,u=l.getView();if(u.getConstraints().rotation!==che){var h=l.getViewport().getBoundingClientRect(),c=She(this.targetPointers);c[0]-=h.left,c[1]-=h.top,this.anchor_=l.getCoordinateFromPixelInternal(c),this.rotating_&&(l.render(),u.adjustRotationInternal(r,this.anchor_))}},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var r=t.map,i=r.getView();return i.endInteraction(this.duration_),!1}else return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var r=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(uL);const LOr=IOr;var POr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),OOr=function(n){POr(e,n);function e(t){var r=this,i=t||{},a=i;return a.stopDown||(a.stopDown=RV),r=n.call(this,a)||this,r.anchor_=null,r.duration_=i.duration!==void 0?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return e.prototype.handleDragEvent=function(t){var r=1,i=this.targetPointers[0],a=this.targetPointers[1],o=i.clientX-a.clientX,s=i.clientY-a.clientY,l=Math.sqrt(o*o+s*s);this.lastDistance_!==void 0&&(r=this.lastDistance_/l),this.lastDistance_=l;var u=t.map,h=u.getView();r!=1&&(this.lastScaleDelta_=r);var c=u.getViewport().getBoundingClientRect(),f=She(this.targetPointers);f[0]-=c.left,f[1]-=c.top,this.anchor_=u.getCoordinateFromPixelInternal(f),u.render(),h.adjustResolutionInternal(r,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var r=t.map,i=r.getView(),a=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,a),!1}else return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var r=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(uL);const ROr=OOr;function S7(n,e,t,r,i,a,o){var s,l,u=(t-e)/r;if(u===1)s=e;else if(u===2)s=e,l=i;else if(u!==0){for(var h=n[e],c=n[e+1],f=0,d=[0],v=e+r;v1?o:2,x=a||new Array(_),v=0;v<_;++v)x[v]=s===void 0?NaN:l===void 0?n[s+v]:S1(n[s+v],n[s+r+v],l);return x}function cre(n,e,t,r,i,a){if(t==e)return null;var o;if(i>1;i{i(s,e)},a,o)};EA.prototype.forEachFeatureAtPixelDefault=EA.prototype.forEachFeatureAtPixel,EA.prototype.forEachFeatureAtPixel=EA.prototype.Tc=function(e,t,r,i){const a=r&&r.layerFilter?r.layerFilter:()=>!0,o=this.getLayers().getArray(),s=this.getView().getResolution(),l=this.getCoordinateFromPixel(e);for(let u=0;ut)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){ti()},e.prototype.getAlpha=function(t,r){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(!i)i=r,this.transitionStarts_[t]=i;else if(i===-1)return 1;var a=r-i+1e3/60;return a>=this.transition_?1:hqe(a/this.transition_)},e.prototype.inTransition=function(t){return this.transition_?this.transitionStarts_[t]!==-1:!1},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(eL);const u$=XOr;var YOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),qOr=function(n){YOr(e,n);function e(t,r,i,a,o,s){var l=n.call(this,t,r,s)||this;return l.crossOrigin_=a,l.src_=i,l.key=i,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.tileLoadFunction_=o,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Xr.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=Xr.ERROR,this.unlistenImage_(),this.image_=ZOr(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Xr.LOADED:this.state=Xr.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Xr.ERROR&&(this.state=Xr.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Xr.IDLE&&(this.state=Xr.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=bue(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(u$);function ZOr(){var n=Ad(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}const Iqe=qOr;var Lqe=.5,my=!0,KOr=10,YAe=.25,JOr=function(){function n(e,t,r,i,a,o){this.sourceProj_=e,this.targetProj_=t;var s={},l=__(this.targetProj_,this.sourceProj_);this.transformInv_=function(_){var x=_[0]+"/"+_[1];return s[x]||(s[x]=l(_)),s[x]},this.maxSourceExtent_=i,this.errorThresholdSquared_=a*a,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&Co(i)==Co(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Co(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Co(this.targetProj_.getExtent()):null;var u=Lw(r),h=BV(r),c=FV(r),f=kV(r),d=this.transformInv_(u),v=this.transformInv_(h),p=this.transformInv_(c),g=this.transformInv_(f),m=KOr+(o?Math.max(0,Math.ceil(eyr(wte(r)/(o*o*256*256)))):0);if(this.addQuad_(u,h,c,f,d,v,p,g,m),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(_,x,S){y=Math.min(y,_.source[0][0],_.source[1][0],_.source[2][0])}),this.triangles_.forEach(function(_){if(Math.max(_.source[0][0],_.source[1][0],_.source[2][0])-y>this.sourceWorldWidth_/2){var x=[[_.source[0][0],_.source[0][1]],[_.source[1][0],_.source[1][1]],[_.source[2][0],_.source[2][1]]];x[0][0]-y>this.sourceWorldWidth_/2&&(x[0][0]-=this.sourceWorldWidth_),x[1][0]-y>this.sourceWorldWidth_/2&&(x[1][0]-=this.sourceWorldWidth_),x[2][0]-y>this.sourceWorldWidth_/2&&(x[2][0]-=this.sourceWorldWidth_);var S=Math.min(x[0][0],x[1][0],x[2][0]),w=Math.max(x[0][0],x[1][0],x[2][0]);w-S.5&&c<1,v=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var p=e7([e,t,r,i]),g=Co(p)/this.targetWorldWidth_;v=g>YAe||v}!d&&this.sourceProj_.isGlobal()&&c&&(v=c>YAe||v)}if(!(!v&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!Cl(h,this.maxSourceExtent_))){var m=0;if(!v&&(!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(l[0])||!isFinite(l[1]))){if(u>0)v=!0;else if(m=(!isFinite(a[0])||!isFinite(a[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(s[0])||!isFinite(s[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(u>0){if(!v){var y=[(e[0]+r[0])/2,(e[1]+r[1])/2],_=this.transformInv_(y),x=void 0;if(d){var S=(bS(a[0],f)+bS(s[0],f))/2;x=S-bS(_[0],f)}else x=(a[0]+s[0])/2-_[0];var w=(a[1]+s[1])/2-_[1],b=x*x+w*w;v=b>this.errorThresholdSquared_}if(v){if(Math.abs(e[0]-r[0])<=Math.abs(e[1]-r[1])){var E=[(t[0]+r[0])/2,(t[1]+r[1])/2],T=this.transformInv_(E),C=[(i[0]+e[0])/2,(i[1]+e[1])/2],A=this.transformInv_(C);this.addQuad_(e,t,E,C,a,o,T,A,u-1),this.addQuad_(C,E,r,i,A,T,s,l,u-1)}else{var M=[(e[0]+t[0])/2,(e[1]+t[1])/2],I=this.transformInv_(M),R=[(r[0]+i[0])/2,(r[1]+i[1])/2],k=this.transformInv_(R);this.addQuad_(e,M,R,i,a,I,k,l,u-1),this.addQuad_(M,t,r,R,I,o,s,k,u-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(m&11)==0&&this.addTriangle_(e,r,i,a,s,l),(m&14)==0&&this.addTriangle_(e,r,t,a,s,o),m&&((m&13)==0&&this.addTriangle_(t,i,e,o,l,a),(m&7)==0&&this.addTriangle_(t,i,r,o,l,s))}},n.prototype.calculateSourceExtent=function(){var e=Md();return this.triangles_.forEach(function(t,r,i){var a=t.source;MR(e,a[0]),MR(e,a[1]),MR(e,a[2])}),e},n.prototype.getTriangles=function(){return this.triangles_},n}();const Pqe=JOr;var w7={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Oqe={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},Xq;function qAe(n,e,t,r,i){n.beginPath(),n.moveTo(0,0),n.lineTo(e,t),n.lineTo(r,i),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(e,r)+1,Math.max(t,i)),n.restore()}function Yq(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-.75*255)>2}function QOr(){if(Xq===void 0){var n=document.createElement("canvas").getContext("2d");n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",qAe(n,4,5,4,0),qAe(n,4,5,0,5);var e=n.getImageData(0,0,3,3).data;Xq=Yq(e,0)||Yq(e,4)||Yq(e,8)}return Xq}function b7(n,e,t,r){var i=r7(t,e,n),a=sN(e,r,t),o=e.getMetersPerUnit();o!==void 0&&(a*=o);var s=n.getMetersPerUnit();s!==void 0&&(a/=s);var l=n.getExtent();if(!l||dv(l,i)){var u=sN(n,a,i)/a;isFinite(u)&&u>0&&(a/=u)}return a}function eRr(n,e,t,r){var i=kf(t),a=b7(n,e,i,r);return(!isFinite(a)||a<=0)&&$je(t,function(o){return a=b7(n,e,o,r),isFinite(a)&&a>0}),a}function Rqe(n,e,t,r,i,a,o,s,l,u,h,c){var f=Ad(Math.round(t*n),Math.round(t*e));if(c||Ao(f,w7),l.length===0)return f.canvas;f.scale(t,t);function d(x){return Math.round(x*t)/t}f.globalCompositeOperation="lighter";var v=Md();l.forEach(function(x,S,w){Uje(v,x.extent)});var p=Co(v),g=lh(v),m=Ad(Math.round(t*p/r),Math.round(t*g/r));c||Ao(m,w7);var y=t/r;l.forEach(function(x,S,w){var b=x.extent[0]-v[0],E=-(x.extent[3]-v[3]),T=Co(x.extent),C=lh(x.extent);x.image.width>0&&x.image.height>0&&m.drawImage(x.image,u,u,x.image.width-2*u,x.image.height-2*u,b*y,E*y,T*y,C*y)});var _=Lw(o);return s.getTriangles().forEach(function(x,S,w){var b=x.source,E=x.target,T=b[0][0],C=b[0][1],A=b[1][0],M=b[1][1],I=b[2][0],R=b[2][1],k=d((E[0][0]-_[0])/a),D=d(-(E[0][1]-_[1])/a),G=d((E[1][0]-_[0])/a),W=d(-(E[1][1]-_[1])/a),z=d((E[2][0]-_[0])/a),V=d(-(E[2][1]-_[1])/a),q=T,Y=C;T=0,C=0,A-=q,M-=Y,I-=q,R-=Y;var le=[[A,M,0,0,G-k],[I,R,0,0,z-k],[0,0,A,M,W-D],[0,0,I,R,V-D]],j=tyr(le);if(!!j){if(f.save(),f.beginPath(),QOr()||!c){f.moveTo(G,W);for(var Q=4,ie=k-G,oe=D-W,se=0;se0&&this.getCount()>this.highWaterMark},n.prototype.expireCache=function(e){for(;this.canExpireCache();)this.pop()},n.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},n.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},n.prototype.forEach=function(e){for(var t=this.oldest_;t;)e(t.value_,t.key_,this),t=t.newer},n.prototype.get=function(e,t){var r=this.entries_[e];return ki(r!==void 0,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},n.prototype.remove=function(e){var t=this.entries_[e];return ki(t!==void 0,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_},n.prototype.getCount=function(){return this.count_},n.prototype.getKeys=function(){var e=new Array(this.count_),t=0,r;for(r=this.newest_;r;r=r.older)e[t++]=r.key_;return e},n.prototype.getValues=function(){var e=new Array(this.count_),t=0,r;for(r=this.newest_;r;r=r.older)e[t++]=r.value_;return e},n.prototype.peekLast=function(){return this.oldest_.value_},n.prototype.peekLastKey=function(){return this.oldest_.key_},n.prototype.peekFirstKey=function(){return this.newest_.key_},n.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},n.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},n.prototype.set=function(e,t){ki(!(e in this.entries_),16);var r={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[e]=r,++this.count_},n.prototype.setSize=function(e){this.highWaterMark=e},n}();const iRr=nRr;function ZAe(n,e,t,r){return r!==void 0?(r[0]=n,r[1]=e,r[2]=t,r):[n,e,t]}function hL(n,e,t){return n+"/"+e+"/"+t}function Nqe(n){return hL(n[0],n[1],n[2])}function aRr(n){var e=n.substring(n.lastIndexOf("/")+1,n.length).split(",").map(Number),t=e[0],r=e[1],i=e[2];return hL(t,r,i)}function kqe(n){return n.split("/").map(Number)}function Fqe(n){return(n[1]<t||t>e.getMaxZoom())return!1;var a=e.getFullTileRange(t);return a?a.containsXY(r,i):!0}var sRr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),lRr=function(n){sRr(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.expireCache=function(t){for(;this.canExpireCache();){var r=this.peekLast();if(r.getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var t=this.peekFirstKey(),r=kqe(t),i=r[0];this.forEach(function(a){a.tileCoord[0]!==i&&(this.remove(Nqe(a.tileCoord)),a.release())}.bind(this))}},e}(iRr);const bhe=lRr,qq={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var Bqe=function(){function n(e,t,r,i){this.minX=e,this.maxX=t,this.minY=r,this.maxY=i}return n.prototype.contains=function(e){return this.containsXY(e[1],e[2])},n.prototype.containsTileRange=function(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY},n.prototype.containsXY=function(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY},n.prototype.equals=function(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY},n.prototype.extend=function(e){e.minXthis.maxX&&(this.maxX=e.maxX),e.minYthis.maxY&&(this.maxY=e.maxY)},n.prototype.getHeight=function(){return this.maxY-this.minY+1},n.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},n.prototype.getWidth=function(){return this.maxX-this.minX+1},n.prototype.intersects=function(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY},n}();function AC(n,e,t,r,i){return i!==void 0?(i.minX=n,i.maxX=e,i.minY=t,i.maxY=r,i):new Bqe(n,e,t,r)}const Gqe=Bqe;var uRr=[0,0,0],Sx=5,hRr=function(){function n(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,ki(P0r(this.resolutions_,function(o,s){return s-o},!0),17);var t;if(!e.origins){for(var r=0,i=this.resolutions_.length-1;r=this.minZoom;){if(this.zoomFactor_===2?(o=Math.floor(o/2),s=Math.floor(s/2),a=AC(o,o,s,s,r)):a=this.getTileRangeForExtentAndZ(l,u,r),t(u,a))return!0;--u}return!1},n.prototype.getExtent=function(){return this.extent_},n.prototype.getMaxZoom=function(){return this.maxZoom},n.prototype.getMinZoom=function(){return this.minZoom},n.prototype.getOrigin=function(e){return this.origin_?this.origin_:this.origins_[e]},n.prototype.getResolution=function(e){return this.resolutions_[e]},n.prototype.getResolutions=function(){return this.resolutions_},n.prototype.getTileCoordChildTileRange=function(e,t,r){if(e[0]this.maxZoom||t0?r:Math.max(o/s[0],a/s[1]),u=i+1,h=new Array(u),c=0;ci.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,r,i,a){},e}(_ue),vRr=function(n){$qe(e,n);function e(t,r){var i=n.call(this,t)||this;return i.tile=r,i}return e}(Fm);const pRr=dRr;function gRr(n,e){var t=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,a=/\{-y\}/g;return function(o,s,l){if(o)return n.replace(t,o[0].toString()).replace(r,o[1].toString()).replace(i,o[2].toString()).replace(a,function(){var u=o[0],h=e.getFullTileRange(u);ki(h,55);var c=h.getHeight()-o[2]-1;return c.toString()})}}function yRr(n,e){for(var t=n.length,r=new Array(t),i=0;i\xA9 SuperMap iClient",i=c$.defaultTileGrid(),a=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",o=t.url!==void 0?t.url:"https://maponline{num}.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20170408",s=t.hidpi||(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1;o=o.replace("{styles}",s?"ph":"pl"),super({attributions:r,cacheSize:t.cacheSize,crossOrigin:a,opaque:t.opaque!==void 0?t.opaque:!0,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,projection:"EPSG:3857",wrapX:t.wrapX,tilePixelRatio:s?2:1,tileGrid:i,tileUrlFunction:u}),t.tileProxy&&(this.tileProxy=t.tileProxy);var l=this;function u(h,c,f){var d=o.replace("{num}",Math.abs((h[1]+h[2])%4)).replace("{z}",h[0].toString()).replace("{x}",h[1].toString()).replace("{y}",function(){console.log(br.getOlVersion());var v=["4","5"].indexOf(br.getOlVersion())>-1?h[2]:-h[2]-1;return v.toString()}).replace("{-y}",function(){var v=h[0],p=i.getFullTileRange(v);ki(p,55);var g=p.getHeight()+h[2];return g.toString()});return l.tileProxy&&(d=l.tileProxy+encodeURIComponent(d)),d}}static defaultTileGrid(){var e=new ym({extent:[-33554432,-33554432,33554432,33554432],resolutions:[262144,131072,65536,32768,16284,8192,4096,2048,1024,512,256,128,64,32,16,8,4,2,1,.5],origin:[0,0],minZoom:3});return e}}var bRr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ERr=function(n){bRr(e,n);function e(t,r,i,a,o,s,l){var u=this,h=t.getExtent(),c=r.getExtent(),f=c?tm(i,c):i,d=kf(f),v=b7(t,r,d,a),p=Lqe,g=new Pqe(t,r,f,h,v*p,a),m=g.calculateSourceExtent(),y=s(m,v,o),_=y?Ai.IDLE:Ai.EMPTY,x=y?y.getPixelRatio():1;return u=n.call(this,i,a,x,_)||this,u.targetProj_=r,u.maxSourceExtent_=h,u.triangulation_=g,u.targetResolution_=a,u.targetExtent_=i,u.sourceImage_=y,u.sourcePixelRatio_=x,u.interpolate_=l,u.canvas_=null,u.sourceListenerKey_=null,u}return e.prototype.disposeInternal=function(){this.state==Ai.LOADING&&this.unlistenSource_(),n.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==Ai.LOADED){var r=Co(this.targetExtent_)/this.targetResolution_,i=lh(this.targetExtent_)/this.targetResolution_;this.canvas_=Rqe(r,i,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==Ai.IDLE){this.state=Ai.LOADING,this.changed();var t=this.sourceImage_.getState();t==Ai.LOADED||t==Ai.ERROR?this.reproject_():(this.sourceListenerKey_=pa(this.sourceImage_,Ci.CHANGE,function(r){var i=this.sourceImage_.getState();(i==Ai.LOADED||i==Ai.ERROR)&&(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){Ms(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(wue);const TRr=ERr;var jqe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Zq={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"},CRr=function(n){jqe(e,n);function e(t,r){var i=n.call(this,t)||this;return i.image=r,i}return e}(Fm),ARr=function(n){jqe(e,n);function e(t){var r=this,i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;return t.interpolate!==void 0&&(i=t.interpolate),r=n.call(this,{attributions:t.attributions,projection:t.projection,state:t.state,interpolate:i})||this,r.on,r.once,r.un,r.resolutions_=t.resolutions!==void 0?t.resolutions:null,r.reprojectedImage_=null,r.reprojectedRevision_=0,r}return e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var r=OV(this.resolutions_,t,0);t=this.resolutions_[r]}return t},e.prototype.getImage=function(t,r,i,a){var o=this.getProjection();if(!my||!o||!a||Ry(o,a))return o&&(a=o),this.getImageInternal(t,r,i,a);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Ry(this.reprojectedImage_.getProjection(),a)&&this.reprojectedImage_.getResolution()==r&&m_(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new TRr(o,a,t,r,i,function(s,l,u){return this.getImageInternal(s,l,u,o)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_},e.prototype.getImageInternal=function(t,r,i,a){return ti()},e.prototype.handleImageChange=function(t){var r=t.target,i;switch(r.getState()){case Ai.LOADING:this.loading=!0,i=Zq.IMAGELOADSTART;break;case Ai.LOADED:this.loading=!1,i=Zq.IMAGELOADEND;break;case Ai.ERROR:this.loading=!1,i=Zq.IMAGELOADERROR;break;default:return}this.hasListener(i)&&this.dispatchEvent(new CRr(i,r))},e}(_ue);function MRr(n,e){n.getImage().src=e}const Xqe=ARr;var IRr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),LRr=function(n){IRr(e,n);function e(t){var r=n.call(this)||this;return r.geometries_=t||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Ms),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(!!this.geometries_)for(var t=0,r=this.geometries_.length;t\xA9 SuperMap iServer with \xA9 SuperMap iClient",e.format=e.format?e.format:"png",this._layerUrl=H.urlPathAppend(e.url,"image."+e.format),this._layerUrl=xs.appendCredential(this._layerUrl);const t={},r=e.transparent!==void 0?e.transparent:!0;t.transparent=r;const i=e.cacheEnabled!==void 0?e.cacheEnabled:!0;t.cacheEnabled=i,e.layersID!==void 0&&(t.layersID=e.layersID);let a=!1;e.redirect!==void 0&&(a=e.redirect),t.redirect=a,e.prjCoordSys&&(t.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.clipRegionEnabled&&e.clipRegion instanceof vT&&(e.clipRegion=br.toSuperMapGeometry(new jc().writeGeometryObject(e.clipRegion)),e.clipRegion=H.toJSON(Vo.fromGeometry(e.clipRegion)),t.clipRegionEnabled=e.clipRegionEnabled,t.clipRegion=JSON.stringify(e.clipRegion)),!!e.overlapDisplayed&&e.overlapDisplayedOptions&&(t.overlapDisplayed=e.overlapDisplayed,t.overlapDisplayedOptions=e.overlapDisplayedOptions.toString()),i===!0&&e.tileversion&&(t.tileversion=e.tileversion),e.rasterfunction&&(t.rasterfunction=JSON.stringify(e.rasterfunction)),e.antialias!==void 0&&(t.antialias=e.antialias),e.markerAngleFixed!==void 0&&(t.markerAngleFixed=e.markerAngleFixed),e.textAngleFixed!==void 0&&(t.textAngleFixed=e.textAngleFixed),e.textOrientationFixed!==void 0&&(t.textOrientationFixed=e.textOrientationFixed),e.paintBackground!==void 0&&(t.paintBackground=e.paintBackground),isNaN(e.maxVisibleTextSize)||(t.maxVisibleTextSize=+e.maxVisibleTextSize),isNaN(e.minVisibleTextSize)||(t.maxVisibleTextSize=+e.minVisibleTextSize),isNaN(e.maxVisibleVertex)||(t.maxVisibleVertex=Math.round(+e.maxVisibleVertex)),this._layerUrl=H.urlAppend(this._layerUrl,H.getParameterString(t)),this.cacheEnabled=i,e.tileProxy&&(this.tileProxy=e.tileProxy)}getImageInternal(e,t,r){t=this.findNearestResolution(t);const i=t/r,a=kf(e),o=Math.ceil(Co(e)/i),s=Math.ceil(lh(e)/i),l=oN(a,i,0,[o,s]),u=Math.ceil(this.ratio_*Co(e)/i),h=Math.ceil(this.ratio_*lh(e)/i),c=oN(a,i,0,[u,h]),f=this._image;if(f&&this.renderedRevision_===this.getRevision()&&f.getResolution()===t&&f.getPixelRatio()===r&&vv(f.getExtent(),l))return f;const d=[Math.round(Co(c)/i),Math.round(lh(c)/i)],v=this._getRequestUrl(c,d);return this._image=new N1r(c,t,r,v,this._crossOrigin,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this._image.addEventListener("change",this.handleImageChange.bind(this)),this._image}_getRequestUrl(e,t){const r={width:t[0],height:t[1],viewBounds:{leftBottom:{x:e[0],y:e[1]},rightTop:{x:e[2],y:e[3]}}};this.cacheEnabled||(r._t=new Date().getTime());let i=H.urlAppend(this._layerUrl,H.getParameterString(r));return this.tileProxy&&(i=this.tileProxy+encodeURIComponent(i)),i}static optionsFromMapJSON(e,t){var r=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top],i=a();function a(){var o=28,s=96,l=r[2]-r[0],u=r[3]-r[1],h=l>=u?l:u,c;h===l?c=h/t.viewer.width:c=h/t.viewer.height;var f=[],d=Wl.METER;if(t.coordUnit===Wl.DEGREE&&(d=Wl.DEGREE),t.visibleScales.length>0)for(let p=0;p\xA9 SuperMap iClient",i=t.mapName||"quanguo",a=t.mapType||"web",o=t.url||"http://t2.dituhui.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}";o=o.replace("{mapName}",i).replace("{type}",a);var s={attributions:r,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,opaque:t.opaque===void 0?!0:t.opaque,maxZoom:t.maxZoom||18,reprojectionErrorThreshold:t.reprojectionErrorThreshold,url:o,wrapX:t.wrapX};t.tileProxy&&(s.tileLoadFunction=u),super(s),t.tileProxy&&(this.tileProxy=t.tileProxy);var l=this;function u(h,c){h.getImage().src=l.tileProxy+encodeURIComponent(c)}}}const P6={KVP:"KVP",REST:"REST"};function T7(n,e){var t=[];Object.keys(e).forEach(function(i){e[i]!==null&&e[i]!==void 0&&t.push(i+"="+encodeURIComponent(e[i]))});var r=t.join("&");return n=n.replace(/[?&]$/,""),n=n.indexOf("?")===-1?n+"?":n+"&",n+r}var tDr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),rDr=function(n){tDr(e,n);function e(t){var r=n.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})||this;return r.matrixIds_=t.matrixIds,r}return e.prototype.getMatrixId=function(t){return this.matrixIds_[t]},e.prototype.getMatrixIds=function(){return this.matrixIds_},e}(ym);const pre=rDr;var nDr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),iDr=function(n){nDr(e,n);function e(t){var r=this,i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);var a=t.requestEncoding!==void 0?t.requestEncoding:P6.KVP,o=t.tileGrid,s=t.urls;return s===void 0&&t.url!==void 0&&(s=Wqe(t.url)),r=n.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:o,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:s,wrapX:t.wrapX!==void 0?t.wrapX:!1,transition:t.transition,zDirection:t.zDirection})||this,r.version_=t.version!==void 0?t.version:"1.0.0",r.format_=t.format!==void 0?t.format:"image/jpeg",r.dimensions_=t.dimensions!==void 0?t.dimensions:{},r.layer_=t.layer,r.matrixSet_=t.matrixSet,r.style_=t.style,r.requestEncoding_=a,r.setKey(r.getKeyForDimensions_()),s&&s.length>0&&(r.tileUrlFunction=fre(s.map(r.createFromWMTSTemplate.bind(r)))),r}return e.prototype.setUrls=function(t){this.urls=t;var r=t.join(` `);this.setTileUrlFunction(fre(t.map(this.createFromWMTSTemplate.bind(this))),r)},e.prototype.getDimensions=function(){return this.dimensions_},e.prototype.getFormat=function(){return this.format_},e.prototype.getLayer=function(){return this.layer_},e.prototype.getMatrixSet=function(){return this.matrixSet_},e.prototype.getRequestEncoding=function(){return this.requestEncoding_},e.prototype.getStyle=function(){return this.style_},e.prototype.getVersion=function(){return this.version_},e.prototype.getKeyForDimensions_=function(){var t=0,r=[];for(var i in this.dimensions_)r[t++]=i+"-"+this.dimensions_[i];return r.join("/")},e.prototype.updateDimensions=function(t){Ao(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},e.prototype.createFromWMTSTemplate=function(t){var r=this.requestEncoding_,i={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};r==P6.KVP&&Ao(i,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=r==P6.KVP?T7(t,i):t.replace(/\{(\w+?)\}/g,function(s,l){return l.toLowerCase()in i?i[l.toLowerCase()]:s});var a=this.tileGrid,o=this.dimensions_;return function(s,l,u){if(s){var h={TileMatrix:a.getMatrixId(s[0]),TileCol:s[1],TileRow:s[2]};Ao(h,o);var c=t;return r==P6.KVP?c=T7(c,h):c=c.replace(/\{(\w+?)\}/g,function(f,d){return h[d]}),c}else return}},e}(Fk);const qqe=iDr;class rM extends qqe{constructor(e){var t={vec:"cva",ter:"cta",img:"cia"},r={vec:18,ter:14,img:18},i=e||{},a=i.attributions||"Map Data with \xA9 SuperMap iClient";i.layerType=i.layerType||"vec",i.layerType=i.isLabel?t[i.layerType]:i.layerType,i.matrixSet=i.projection==="EPSG:4326"||i.projection==="EPSG:4490"?"c":"w",!i.url&&!i.urls&&(i.url="http://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?"),i.key&&(i.url=`${i.url}tk=${i.key}`),i.url=i.url.replace("{layer}",i.layerType).replace("{proj}",i.matrixSet);var o=i.tileGrid||rM.getTileGrid(i.projection||"EPSG:3857"),s=i.crossOrigin!==void 0?i.crossOrigin:"anonymous",l={version:i.version||"1.0.0",format:i.format||"tiles",dimensions:i.dimensions||{},layer:i.layerType,matrixSet:i.matrixSet,tileGrid:o,style:i.style||"default",attributions:a,cacheSize:i.cacheSize,crossOrigin:s,opaque:i.opaque===void 0?!0:i.opaque,maxZoom:r[i.layerType],reprojectionErrorThreshold:i.reprojectionErrorThreshold,url:i.url,urls:i.urls,projection:i.projection||"EPSG:3857",wrapX:i.wrapX};i.tileProxy&&(l.tileLoadFunction=h),super(l),i.tileProxy&&(this.tileProxy=i.tileProxy);var u=this;function h(c,f){c.getImage().src=u.tileProxy+encodeURIComponent(f)}}static getTileGrid(e){return e==="EPSG:4326"||e==="EPSG:4490"?rM.default4326TileGrid():rM.default3857TileGrid()}static default4326TileGrid(){for(var e=[],t=[],r=1;r<19;r++)e.push(.703125*2/Math.pow(2,r)),t.push(r);var i=new pre({extent:[-180,-90,180,90],resolutions:e,origin:[-180,90],matrixIds:t,minZoom:1});return i}static default3857TileGrid(){for(var e=[],t=[],r=1;r<19;r++)e.push(78271.51696402031*2/Math.pow(2,r)),t.push(r);var i=new pre({extent:[-200375083427892e-7,-200375083427892e-7,200375083427892e-7,200375083427892e-7],resolutions:e,matrixIds:t,origin:[-200375083427892e-7,200375083427892e-7],minZoom:1});return i}}class Bp extends Fk{constructor(e){e=e||{},e.attributions=e.attributions||"Map Data \xA9 SuperMap iServer with \xA9 SuperMap iClient",e.format=e.format?e.format:"png",super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,logo:br.getOlVersion()==="4"?e.logo:null,opaque:e.opaque,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:e.state,tileClass:e.tileClass,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:s,wrapX:e.wrapX!==void 0?e.wrapX:!1,cacheEnabled:e.cacheEnabled,layersID:e.layersID}),e.tileProxy&&(this.tileProxy=e.tileProxy),this.options=e,this._url=e.url,this.tileSetsIndex=-1,this.tempIndex=-1,this.dpi=this.options.dpi||96;var t=this,r=H.urlPathAppend(e.url,"tileImage."+e.format);function i(){var l=this,u={};return u.redirect=e.redirect!==void 0?e.redirect:!1,u.transparent=e.transparent!==void 0?e.transparent:!0,u.cacheEnabled=e.cacheEnabled!==!1,l.cacheEnabled=u.cacheEnabled,u._cache=u.cacheEnabled,this.origin&&(u.origin=JSON.stringify({x:this.origin[0],y:this.origin[1]})),e.prjCoordSys&&(u.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.layersID&&(u.layersID=e.layersID.toString()),e.clipRegion instanceof vT&&(e.clipRegionEnabled=!0,e.clipRegion=br.toSuperMapGeometry(new jc().writeGeometryObject(e.clipRegion)),e.clipRegion=H.toJSON(Vo.fromGeometry(e.clipRegion)),u.clipRegionEnabled=e.clipRegionEnabled,u.clipRegion=JSON.stringify(e.clipRegion)),e.overlapDisplayed?u.overlapDisplayed=!0:(u.overlapDisplayed=!1,e.overlapDisplayedOptions&&(u.overlapDisplayedOptions=l.overlapDisplayedOptions.toString())),u.cacheEnabled&&e.tileversion&&(u.tileversion=e.tileversion.toString()),e.rasterfunction&&(u.rasterfunction=JSON.stringify(e.rasterfunction)),u}function a(){return this._paramsChanged&&(this._layerUrl=o.call(this),this._paramsChanged=!1),this._layerUrl||o.call(this)}function o(){return this.requestParams=this.requestParams||i.call(this),this._layerUrl=H.urlAppend(r,H.getParameterString(this.requestParams)),this._layerUrl=xs.appendCredential(this._layerUrl),this._layerUrl}function s(l,u,h){t.tileGrid||(e.extent?(t.tileGrid=Bp.createTileGrid(e.extent),t.resolutions&&(t.tileGrid.resolutions=t.resolutions)):(h.getCode()==="EPSG:3857"&&(t.tileGrid=Bp.createTileGrid([-200375083427892e-7,-200375083427892e-7,200375083427892e-7,200375083427892e-7]),t.extent=[-200375083427892e-7,-200375083427892e-7,200375083427892e-7,200375083427892e-7]),h.getCode()==="EPSG:4326"&&(t.tileGrid=Bp.createTileGrid([-180,-90,180,90]),t.extent=[-180,-90,180,90]))),t.origin=t.tileGrid.getOrigin(0);var c=l[0],f=l[1],d=["4","5"].indexOf(br.getOlVersion())>-1?-l[2]-1:l[2],v=t.tileGrid.getResolution(c),p=t.dpi||96,g=h.getUnits()||Wl.DEGREE;(g==="degrees"||g==="degree")&&(g=Wl.DEGREE),(g==="m"||g==="meter")&&(g=Wl.METER);var m=br.resolutionToScale(v,p,g),y=nh(t.tileGrid.getTileSize(c,t.tmpSize)),_=a.call(t),x=_+encodeURI("&x="+f+"&y="+d+"&width="+y[0]+"&height="+y[1]+"&scale="+m);return t.tileProxy&&(x=t.tileProxy+encodeURIComponent(x)),t.cacheEnabled||(x+="&_t="+new Date().getTime()),x}}setTileSetsInfo(e){this.tileSets=e,br.isArray(this.tileSets)&&(this.tileSets=e[0]),this.tileSets&&(this.dispatchEvent({type:"tilesetsinfoloaded",value:{tileVersions:this.tileSets.tileVersions}}),this.changeTilesVersion())}lastTilesVersion(){this.tempIndex=this.tileSetsIndex-1,this.changeTilesVersion()}nextTilesVersion(){this.tempIndex=this.tileSetsIndex+1,this.changeTilesVersion()}changeTilesVersion(){var e=this;if(e.tileSets!=null&&!(e.tempIndex===e.tileSetsIndex||this.tempIndex<0)){var t=e.tileSets.tileVersions;if(t&&e.tempIndex=0){var r=t[e.tempIndex].name,i=e.mergeTileVersionParam(r);i&&(e.tileSetsIndex=e.tempIndex,e.dispatchEvent({type:"tileversionschanged",value:{tileVersion:t[e.tempIndex]}}))}}}updateCurrentTileSetsIndex(e){this.tempIndex=e}mergeTileVersionParam(e){return e?(this.requestParams.tileversion=e,this._paramsChanged=!0,this.refresh(),!0):!1}static optionsFromMapJSON(e,t){var r={};r.url=e,r.crossOrigin="anonymous";var i=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top];const{visibleScales:a,bounds:o,dpi:s,coordUnit:l}=t;var u=br.scalesToResolutions(a,o,s,l);return r.tileGrid=new ym({extent:i,resolutions:u}),r}static createTileGrid(e,t,r,i,a){var o=Ehe({extent:e,maxZoom:t,minZoom:r,tileSize:i});return new ym({extent:e,minZoom:r,origin:a,resolutions:o.getResolutions(),tileSize:o.getTileSize()})}}function aDr(n){n("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),n("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),n("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),n.WGS84=n["EPSG:4326"],n["EPSG:3785"]=n["EPSG:3857"],n.GOOGLE=n["EPSG:3857"],n["EPSG:900913"]=n["EPSG:3857"],n["EPSG:102113"]=n["EPSG:3857"]}var _2=1,x2=2,nM=3,oDr=4,gre=5,JAe=6378137,sDr=6356752314e-3,QAe=.0066943799901413165,DR=484813681109536e-20,Ir=Math.PI/2,lDr=.16666666666666666,uDr=.04722222222222222,hDr=.022156084656084655,Zr=1e-10,ic=.017453292519943295,Xy=57.29577951308232,qo=Math.PI/4,mN=Math.PI*2,ou=3.14159265359,Vd={};Vd.greenwich=0;Vd.lisbon=-9.131906111111;Vd.paris=2.337229166667;Vd.bogota=-74.080916666667;Vd.madrid=-3.687938888889;Vd.rome=12.452333333333;Vd.bern=7.439583333333;Vd.jakarta=106.807719444444;Vd.ferro=-17.666666666667;Vd.brussels=4.367975;Vd.stockholm=18.058277777778;Vd.athens=23.7163375;Vd.oslo=10.722916666667;const cDr={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var eMe=/[\s_\-\/\(\)]/g;function nw(n,e){if(n[e])return n[e];for(var t=Object.keys(n),r=e.toLowerCase().replace(eMe,""),i=-1,a,o;++i-1})}var gDr=["3857","900913","3785","102113"];function yDr(n){var e=nw(n,"authority");if(!!e){var t=nw(e,"epsg");return t&&gDr.indexOf(t)>-1}}function mDr(n){var e=nw(n,"extension");if(!!e)return nw(e,"proj4")}function _Dr(n){return n[0]==="+"}function xDr(n){if(fDr(n)){if(dDr(n))return xf[n];if(pDr(n)){var e=PPe(n);if(yDr(e))return xf["EPSG:3857"];var t=mDr(e);return t?yre(t):e}if(_Dr(n))return yre(n)}else return n}function tMe(n,e){n=n||{};var t,r;if(!e)return n;for(r in e)t=e[r],t!==void 0&&(n[r]=t);return n}function mm(n,e,t){var r=n*e;return t/Math.sqrt(1-r*r)}function Bk(n){return n<0?-1:1}function fn(n){return Math.abs(n)<=ou?n:n-Bk(n)*mN}function v0(n,e,t){var r=n*t,i=.5*n;return r=Math.pow((1-r)/(1+r),i),Math.tan(.5*(Ir-e))/r}function _N(n,e){for(var t=.5*n,r,i,a=Ir-2*Math.atan(e),o=0;o<=15;o++)if(r=n*Math.sin(a),i=Ir-2*Math.atan(e*Math.pow((1-r)/(1+r),t))-a,a+=i,Math.abs(i)<=1e-10)return a;return-9999}function SDr(){var n=this.b/this.a;this.es=1-n*n,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=mm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function wDr(n){var e=n.x,t=n.y;if(t*Xy>90&&t*Xy<-90&&e*Xy>180&&e*Xy<-180)return null;var r,i;if(Math.abs(Math.abs(t)-Ir)<=Zr)return null;if(this.sphere)r=this.x0+this.a*this.k0*fn(e-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(qo+.5*t));else{var a=Math.sin(t),o=v0(this.e,t,a);r=this.x0+this.a*this.k0*fn(e-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return n.x=r,n.y=i,n}function bDr(n){var e=n.x-this.x0,t=n.y-this.y0,r,i;if(this.sphere)i=Ir-2*Math.atan(Math.exp(-t/(this.a*this.k0)));else{var a=Math.exp(-t/(this.a*this.k0));if(i=_N(this.e,a),i===-9999)return null}return r=fn(this.long0+e/(this.a*this.k0)),n.x=r,n.y=i,n}var EDr=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const TDr={init:SDr,forward:wDr,inverse:bDr,names:EDr};function CDr(){}function rMe(n){return n}var ADr=["longlat","identity"];const MDr={init:CDr,forward:rMe,inverse:rMe,names:ADr};var IDr=[TDr,MDr],g8={},C7=[];function Zqe(n,e){var t=C7.length;return n.names?(C7[t]=n,n.names.forEach(function(r){g8[r.toLowerCase()]=t}),this):(console.log(e),!0)}function LDr(n){if(!n)return!1;var e=n.toLowerCase();if(typeof g8[e]<"u"&&C7[g8[e]])return C7[g8[e]]}function PDr(){IDr.forEach(Zqe)}const ODr={start:PDr,add:Zqe,get:LDr};var Pi={};Pi.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};Pi.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};Pi.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};Pi.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};Pi.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};Pi.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};Pi.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};Pi.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};Pi.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};Pi.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};Pi.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};Pi.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};Pi.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};Pi.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};Pi.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};Pi.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};Pi.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};Pi.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};Pi.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};Pi.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};Pi.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};Pi.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};Pi.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};Pi.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};Pi.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};Pi.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};Pi.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};Pi.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};Pi.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};Pi.hough={a:6378270,rf:297,ellipseName:"Hough"};Pi.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};Pi.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};Pi.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};Pi.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};Pi.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};Pi.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};Pi.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};Pi.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};Pi.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};Pi.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};Pi.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};Pi.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var RDr=Pi.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Pi.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function DDr(n,e,t,r){var i=n*n,a=e*e,o=(i-a)/i,s=0;r?(n*=1-o*(lDr+o*(uDr+o*hDr)),i=n*n,o=0):s=Math.sqrt(o);var l=(i-a)/a;return{es:o,e:s,ep2:l}}function NDr(n,e,t,r,i){if(!n){var a=nw(Pi,r);a||(a=RDr),n=a.a,e=a.b,t=a.rf}return t&&!e&&(e=(1-1/t)*n),(t===0||Math.abs(n-e)3&&(s.datum_params[3]!==0||s.datum_params[4]!==0||s.datum_params[5]!==0||s.datum_params[6]!==0)&&(s.datum_type=x2,s.datum_params[3]*=DR,s.datum_params[4]*=DR,s.datum_params[5]*=DR,s.datum_params[6]=s.datum_params[6]/1e6+1)),o&&(s.datum_type=nM,s.grids=o),s.a=t,s.b=r,s.es=i,s.ep2=a,s}var Kqe={};function FDr(n,e){var t=new DataView(e),r=zDr(t),i=UDr(t,r);i.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var a=VDr(t,i,r),o={header:i,subgrids:a};return Kqe[n]=o,o}function BDr(n){if(n===void 0)return null;var e=n.split(",");return e.map(GDr)}function GDr(n){if(n.length===0)return null;var e=n[0]==="@";return e&&(n=n.slice(1)),n==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:n,mandatory:!e,grid:Kqe[n]||null,isNull:!1}}function TA(n){return n/3600*Math.PI/180}function zDr(n){var e=n.getInt32(8,!1);return e===11?!1:(e=n.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function UDr(n,e){return{nFields:n.getInt32(8,e),nSubgridFields:n.getInt32(24,e),nSubgrids:n.getInt32(40,e),shiftType:mre(n,56,56+8).trim(),fromSemiMajorAxis:n.getFloat64(120,e),fromSemiMinorAxis:n.getFloat64(136,e),toSemiMajorAxis:n.getFloat64(152,e),toSemiMinorAxis:n.getFloat64(168,e)}}function mre(n,e,t){return String.fromCharCode.apply(null,new Uint8Array(n.buffer.slice(e,t)))}function VDr(n,e,t){for(var r=176,i=[],a=0;a5e-11?!1:n.datum_type===_2?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]:n.datum_type===x2?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]&&n.datum_params[3]===e.datum_params[3]&&n.datum_params[4]===e.datum_params[4]&&n.datum_params[5]===e.datum_params[5]&&n.datum_params[6]===e.datum_params[6]:!0}function Jqe(n,e,t){var r=n.x,i=n.y,a=n.z?n.z:0,o,s,l,u;if(i<-Ir&&i>-1.001*Ir)i=-Ir;else if(i>Ir&&i<1.001*Ir)i=Ir;else{if(i<-Ir)return{x:-1/0,y:-1/0,z:n.z};if(i>Ir)return{x:1/0,y:1/0,z:n.z}}return r>Math.PI&&(r-=2*Math.PI),s=Math.sin(i),u=Math.cos(i),l=s*s,o=t/Math.sqrt(1-e*l),{x:(o+a)*u*Math.cos(r),y:(o+a)*u*Math.sin(r),z:(o*(1-e)+a)*s}}function Qqe(n,e,t,r){var i=1e-12,a=i*i,o=30,s,l,u,h,c,f,d,v,p,g,m,y,_,x=n.x,S=n.y,w=n.z?n.z:0,b,E,T;if(s=Math.sqrt(x*x+S*S),l=Math.sqrt(x*x+S*S+w*w),s/ta&&_r.y||h>r.x||ds&&Math.abs(l.y)>s);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=fn(a.x+t.ll[0]),r.y=a.y+t.ll[1]}else isNaN(a.x)||(r.x=n.x+a.x,r.y=n.y+a.y);return r}function iMe(n,e){var t={x:n.x/e.del[0],y:n.y/e.del[1]},r={x:Math.floor(t.x),y:Math.floor(t.y)},i={x:t.x-1*r.x,y:t.y-1*r.y},a={x:Number.NaN,y:Number.NaN},o;if(r.x<0||r.x>=e.lim[0]||r.y<0||r.y>=e.lim[1])return a;o=r.y*e.lim[0]+r.x;var s={x:e.cvs[o][0],y:e.cvs[o][1]};o++;var l={x:e.cvs[o][0],y:e.cvs[o][1]};o+=e.lim[0];var u={x:e.cvs[o][0],y:e.cvs[o][1]};o--;var h={x:e.cvs[o][0],y:e.cvs[o][1]},c=i.x*i.y,f=i.x*(1-i.y),d=(1-i.x)*(1-i.y),v=(1-i.x)*i.y;return a.x=d*s.x+f*l.x+v*h.x+c*u.x,a.y=d*s.y+f*l.y+v*h.y+c*u.y,a}function aMe(n,e,t){var r=t.x,i=t.y,a=t.z||0,o,s,l,u={};for(l=0;l<3;l++)if(!(e&&l===2&&t.z===void 0))switch(l===0?(o=r,"ew".indexOf(n.axis[l])!==-1?s="x":s="y"):l===1?(o=i,"ns".indexOf(n.axis[l])!==-1?s="y":s="x"):(o=a,s="z"),n.axis[l]){case"e":u[s]=o;break;case"w":u[s]=-o;break;case"n":u[s]=o;break;case"s":u[s]=-o;break;case"u":t[s]!==void 0&&(u.z=o);break;case"d":t[s]!==void 0&&(u.z=-o);break;default:return null}return u}function eZe(n){var e={x:n[0],y:n[1]};return n.length>2&&(e.z=n[2]),n.length>3&&(e.m=n[3]),e}function KDr(n){oMe(n.x),oMe(n.y)}function oMe(n){if(typeof Number.isFinite=="function"){if(Number.isFinite(n))return;throw new TypeError("coordinates must be finite numbers")}if(typeof n!="number"||n!==n||!isFinite(n))throw new TypeError("coordinates must be finite numbers")}function JDr(n,e){return(n.datum.datum_type===_2||n.datum.datum_type===x2||n.datum.datum_type===nM)&&e.datumCode!=="WGS84"||(e.datum.datum_type===_2||e.datum.datum_type===x2||e.datum.datum_type===nM)&&n.datumCode!=="WGS84"}function A7(n,e,t,r){var i;Array.isArray(t)?t=eZe(t):t={x:t.x,y:t.y,z:t.z,m:t.m};var a=t.z!==void 0;if(KDr(t),n.datum&&e.datum&&JDr(n,e)&&(i=new nm("WGS84"),t=A7(n,i,t,r),n=i),r&&n.axis!=="enu"&&(t=aMe(n,!1,t)),n.projName==="longlat")t={x:t.x*ic,y:t.y*ic,z:t.z||0};else if(n.to_meter&&(t={x:t.x*n.to_meter,y:t.y*n.to_meter,z:t.z||0}),t=n.inverse(t),!t)return;if(n.from_greenwich&&(t.x+=n.from_greenwich),t=qDr(n.datum,e.datum,t),!!t)return e.from_greenwich&&(t={x:t.x-e.from_greenwich,y:t.y,z:t.z||0}),e.projName==="longlat"?t={x:t.x*Xy,y:t.y*Xy,z:t.z||0}:(t=e.forward(t),e.to_meter&&(t={x:t.x/e.to_meter,y:t.y/e.to_meter,z:t.z||0})),r&&e.axis!=="enu"?aMe(e,!0,t):(a||delete t.z,t)}var sMe=nm("WGS84");function Kq(n,e,t,r){var i,a,o;return Array.isArray(t)?(i=A7(n,e,t,r)||{x:NaN,y:NaN},t.length>2?typeof n.name<"u"&&n.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof i.z=="number"?[i.x,i.y,i.z].concat(t.splice(3)):[i.x,i.y,t[2]].concat(t.splice(3)):[i.x,i.y].concat(t.splice(2)):[i.x,i.y]):(a=A7(n,e,t,r),o=Object.keys(t),o.length===2||o.forEach(function(s){if(typeof n.name<"u"&&n.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(s==="x"||s==="y"||s==="z")return}else if(s==="x"||s==="y")return;a[s]=t[s]}),a)}function lMe(n){return n instanceof nm?n:n.oProj?n.oProj:nm(n)}function Bu(n,e,t){n=lMe(n);var r=!1,i;return typeof e>"u"?(e=n,n=sMe,r=!0):(typeof e.x<"u"||Array.isArray(e))&&(t=e,e=n,n=sMe,r=!0),e=lMe(e),t?Kq(n,e,t):(i={forward:function(a,o){return Kq(n,e,a,o)},inverse:function(a,o){return Kq(e,n,a,o)}},r&&(i.oProj=e),i)}function XM(n,e,t){if(!(this instanceof XM))return new XM(n,e,t);if(Array.isArray(n))this.x=n[0],this.y=n[1],this.z=n[2]||0;else if(typeof n=="object")this.x=n.x,this.y=n.y,this.z=n.z||0;else if(typeof n=="string"&&typeof e>"u"){var r=n.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=n,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}XM.fromMGRS=function(n){return new XM(xrt(n))};XM.prototype.toMGRS=function(n){return Srt([this.x,this.y],n)};var QDr=1,eNr=.25,uMe=.046875,hMe=.01953125,cMe=.01068115234375,tNr=.75,rNr=.46875,nNr=.013020833333333334,iNr=.007120768229166667,aNr=.3645833333333333,oNr=.005696614583333333,sNr=.3076171875;function tZe(n){var e=[];e[0]=QDr-n*(eNr+n*(uMe+n*(hMe+n*cMe))),e[1]=n*(tNr-n*(uMe+n*(hMe+n*cMe)));var t=n*n;return e[2]=t*(rNr-n*(nNr+n*iNr)),t*=n,e[3]=t*(aNr-n*oNr),e[4]=t*n*sNr,e}function f$(n,e,t,r){return t*=e,e*=e,r[0]*n-t*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))}var lNr=20;function rZe(n,e,t){for(var r=1/(1-e),i=n,a=lNr;a;--a){var o=Math.sin(i),s=1-e*o*o;if(s=(f$(i,o,Math.cos(i),t)-n)*(s*Math.sqrt(s))*r,i-=s,Math.abs(s)Zr?Math.tan(t):0,p=Math.pow(v,2),g=Math.pow(p,2);i=1-this.es*Math.pow(s,2),h=h/Math.sqrt(i);var m=f$(t,s,l,this.en);a=this.a*(this.k0*h*(1+c/6*(1-p+f+c/20*(5-18*p+g+14*f-58*p*f+c/42*(61+179*g-g*p-479*p)))))+this.x0,o=this.a*(this.k0*(m-this.ml0+s*r*h/2*(1+c/12*(5-p+9*f+4*d+c/30*(61+g-58*p+270*f-330*p*f+c/56*(1385+543*g-g*p-3111*p))))))+this.y0}else{var u=l*Math.sin(r);if(Math.abs(Math.abs(u)-1)=1){if(u-1>Zr)return 93;o=0}else o=Math.acos(o);t<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return n.x=a,n.y=o,n}function cNr(n){var e,t,r,i,a=(n.x-this.x0)*(1/this.a),o=(n.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,t=rZe(e,this.es,this.en),Math.abs(t)Zr?Math.tan(t):0,v=this.ep2*Math.pow(f,2),p=Math.pow(v,2),g=Math.pow(d,2),m=Math.pow(g,2);e=1-this.es*Math.pow(c,2);var y=a*Math.sqrt(e)/this.k0,_=Math.pow(y,2);e=e*d,r=t-e*_/(1-this.es)*.5*(1-_/12*(5+3*g-9*v*g+v-4*p-_/30*(61+90*g-252*v*g+45*m+46*v-_/56*(1385+3633*g+4095*m+1574*m*g)))),i=fn(this.long0+y*(1-_/6*(1+2*g+v-_/20*(5+28*g+24*m+8*v*g+6*v-_/42*(61+662*g+1320*m+720*m*g))))/f)}else r=Ir*Bk(o),i=0;else{var s=Math.exp(a/this.k0),l=.5*(s-1/s),u=this.lat0+o/this.k0,h=Math.cos(u);e=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),r=Math.asin(e),o<0&&(r=-r),l===0&&h===0?i=0:i=fn(Math.atan2(l,h)+this.long0)}return n.x=i,n.y=r,n}var fNr=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const y8={init:uNr,forward:hNr,inverse:cNr,names:fNr};function nZe(n){var e=Math.exp(n);return e=(e-1/e)/2,e}function Kg(n,e){n=Math.abs(n),e=Math.abs(e);var t=Math.max(n,e),r=Math.min(n,e)/(t||1);return t*Math.sqrt(1+Math.pow(r,2))}function dNr(n){var e=1+n,t=e-1;return t===0?n:n*Math.log(e)/t}function vNr(n){var e=Math.abs(n);return e=dNr(e*(1+e/(Kg(1,e)+1))),n<0?-e:e}function Che(n,e){for(var t=2*Math.cos(2*e),r=n.length-1,i=n[r],a=0,o;--r>=0;)o=-a+t*i+n[r],a=i,i=o;return e+o*Math.sin(2*e)}function pNr(n,e){for(var t=2*Math.cos(e),r=n.length-1,i=n[r],a=0,o;--r>=0;)o=-a+t*i+n[r],a=i,i=o;return Math.sin(e)*o}function gNr(n){var e=Math.exp(n);return e=(e+1/e)/2,e}function iZe(n,e,t){for(var r=Math.sin(e),i=Math.cos(e),a=nZe(t),o=gNr(t),s=2*i*o,l=-2*r*a,u=n.length-1,h=n[u],c=0,f=0,d=0,v,p;--u>=0;)v=f,p=c,f=h,c=d,h=-v+s*f-l*c+n[u],d=-p+l*f+s*c;return s=r*o,l=i*a,[s*h-l*d,s*d+l*h]}function yNr(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(y8.init.apply(this),this.forward=y8.forward,this.inverse=y8.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var n=this.es/(1+Math.sqrt(1-this.es)),e=n/(2-n),t=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),t=t*e,this.cgb[1]=t*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=t*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),t=t*e,this.cgb[2]=t*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=t*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),t=t*e,this.cgb[3]=t*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=t*(1237/630+e*(-12/5+e*(-24832/14175))),t=t*e,this.cgb[4]=t*(4174/315+e*(-144838/6237)),this.cbg[4]=t*(-734/315+e*(109598/31185)),t=t*e,this.cgb[5]=t*(601676/22275),this.cbg[5]=t*(444337/155925),t=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+t*(1/4+t*(1/64+t/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=t*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=t*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),t=t*e,this.utg[2]=t*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=t*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),t=t*e,this.utg[3]=t*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=t*(49561/161280+e*(-179/168+e*(6601661/7257600))),t=t*e,this.utg[4]=t*(-4583/161280+e*(108847/3991680)),this.gtu[4]=t*(34729/80640+e*(-3418889/1995840)),t=t*e,this.utg[5]=t*(-20648693/638668800),this.gtu[5]=t*(212378941/319334400);var r=Che(this.cbg,this.lat0);this.Zb=-this.Qn*(r+pNr(this.gtu,2*r))}function mNr(n){var e=fn(n.x-this.long0),t=n.y;t=Che(this.cbg,t);var r=Math.sin(t),i=Math.cos(t),a=Math.sin(e),o=Math.cos(e);t=Math.atan2(r,o*i),e=Math.atan2(a*i,Kg(r,i*o)),e=vNr(Math.tan(e));var s=iZe(this.gtu,2*t,2*e);t=t+s[0],e=e+s[1];var l,u;return Math.abs(e)<=2.623395162778?(l=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*t+this.Zb)+this.y0):(l=1/0,u=1/0),n.x=l,n.y=u,n}function _Nr(n){var e=(n.x-this.x0)*(1/this.a),t=(n.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var r,i;if(Math.abs(e)<=2.623395162778){var a=iZe(this.utg,2*t,2*e);t=t+a[0],e=e+a[1],e=Math.atan(nZe(e));var o=Math.sin(t),s=Math.cos(t),l=Math.sin(e),u=Math.cos(e);t=Math.atan2(o*u,Kg(l,u*s)),e=Math.atan2(l,u*s),r=fn(e+this.long0),i=Che(this.cgb,t)}else r=1/0,i=1/0;return n.x=r,n.y=i,n}var xNr=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"];const m8={init:yNr,forward:mNr,inverse:_Nr,names:xNr};function SNr(n,e){if(n===void 0){if(n=Math.floor((fn(e)+Math.PI)*30/Math.PI)+1,n<0)return 0;if(n>60)return 60}return n}var wNr="etmerc";function bNr(){var n=SNr(this.zone,this.long0);if(n===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(n)-183)*ic,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,m8.init.apply(this),this.forward=m8.forward,this.inverse=m8.inverse}var ENr=["Universal Transverse Mercator System","utm"];const TNr={init:bNr,names:ENr,dependsOn:wNr};function Ahe(n,e){return Math.pow((1-n)/(1+n),e)}var CNr=20;function ANr(){var n=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*n*n),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(n/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+qo)/(Math.pow(Math.tan(.5*this.lat0+qo),this.C)*Ahe(this.e*n,this.ratexp))}function MNr(n){var e=n.x,t=n.y;return n.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+qo),this.C)*Ahe(this.e*Math.sin(t),this.ratexp))-Ir,n.x=this.C*e,n}function INr(n){for(var e=1e-14,t=n.x/this.C,r=n.y,i=Math.pow(Math.tan(.5*r+qo)/this.K,1/this.C),a=CNr;a>0&&(r=2*Math.atan(i*Ahe(this.e*Math.sin(n.y),-.5*this.e))-Ir,!(Math.abs(r-n.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Zr&&(this.k0=.5*this.cons*mm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/v0(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=mm(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Ir,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function BNr(n){var e=n.x,t=n.y,r=Math.sin(t),i=Math.cos(t),a,o,s,l,u,h,c=fn(e-this.long0);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=Zr&&Math.abs(t+this.lat0)<=Zr?(n.x=NaN,n.y=NaN,n):this.sphere?(a=2*this.k0/(1+this.sinlat0*r+this.coslat0*i*Math.cos(c)),n.x=this.a*a*i*Math.sin(c)+this.x0,n.y=this.a*a*(this.coslat0*r-this.sinlat0*i*Math.cos(c))+this.y0,n):(o=2*Math.atan(this.ssfn_(t,r,this.e))-Ir,l=Math.cos(o),s=Math.sin(o),Math.abs(this.coslat0)<=Zr?(u=v0(this.e,t*this.con,this.con*r),h=2*this.a*this.k0*u/this.cons,n.x=this.x0+h*Math.sin(e-this.long0),n.y=this.y0-this.con*h*Math.cos(e-this.long0),n):(Math.abs(this.sinlat0)0?e=fn(this.long0+Math.atan2(n.x,-1*n.y)):e=fn(this.long0+Math.atan2(n.x,n.y)):e=fn(this.long0+Math.atan2(n.x*Math.sin(s),o*this.coslat0*Math.cos(s)-n.y*this.sinlat0*Math.sin(s))),n.x=e,n.y=t,n)}else if(Math.abs(this.coslat0)<=Zr){if(o<=Zr)return t=this.lat0,e=this.long0,n.x=e,n.y=t,n;n.x*=this.con,n.y*=this.con,r=o*this.cons/(2*this.a*this.k0),t=this.con*_N(this.e,r),e=this.con*fn(this.con*this.long0+Math.atan2(n.x,-1*n.y))}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=Zr?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+n.y*Math.sin(i)*this.cosX0/o),e=fn(this.long0+Math.atan2(n.x*Math.sin(i),o*this.cosX0*Math.cos(i)-n.y*this.sinX0*Math.sin(i)))),t=-1*_N(this.e,Math.tan(.5*(Ir+a)));return n.x=e,n.y=t,n}var zNr=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"];const UNr={init:FNr,forward:BNr,inverse:GNr,names:zNr,ssfn_:kNr};function VNr(){var n=this.lat0;this.lambda0=this.long0;var e=Math.sin(n),t=this.a,r=this.rf,i=1/r,a=2*i-Math.pow(i,2),o=this.e=Math.sqrt(a);this.R=this.k0*t*Math.sqrt(1-a)/(1-a*Math.pow(e,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(n),4)),this.b0=Math.asin(e/this.alpha);var s=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+n/2)),u=Math.log((1+o*e)/(1-o*e));this.K=s-this.alpha*l+this.alpha*o/2*u}function $Nr(n){var e=Math.log(Math.tan(Math.PI/4-n.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(n.y))/(1-this.e*Math.sin(n.y))),r=-this.alpha*(e+t)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(n.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return n.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,n.x=this.R*o+this.x0,n}function WNr(n){for(var e=n.x-this.x0,t=n.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(t/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+o/this.alpha,l=0,u=a,h=-1e3,c=0;Math.abs(u-h)>1e-7;){if(++c>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),h=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return n.x=s,n.y=u,n}var HNr=["somerc"];const jNr={init:VNr,forward:$Nr,inverse:WNr,names:HNr};var nA=1e-7;function XNr(n){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof n.PROJECTION=="object"?Object.keys(n.PROJECTION)[0]:n.PROJECTION;return"no_uoff"in n||"no_off"in n||e.indexOf(t)!==-1}function YNr(){var n,e,t,r,i,a,o,s,l,u,h=0,c,f=0,d=0,v=0,p=0,g=0,m=0;this.no_off=XNr(this),this.no_rot="no_rot"in this;var y=!1;"alpha"in this&&(y=!0);var _=!1;if("rectified_grid_angle"in this&&(_=!0),y&&(m=this.alpha),_&&(h=this.rectified_grid_angle*ic),y||_)f=this.longc;else if(d=this.long1,p=this.lat1,v=this.long2,g=this.lat2,Math.abs(p-g)<=nA||(n=Math.abs(p))<=nA||Math.abs(n-Ir)<=nA||Math.abs(Math.abs(this.lat0)-Ir)<=nA||Math.abs(Math.abs(g)-Ir)<=nA)throw new Error;var x=1-this.es;e=Math.sqrt(x),Math.abs(this.lat0)>Zr?(s=Math.sin(this.lat0),t=Math.cos(this.lat0),n=1-this.es*s*s,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/x),this.A=this.B*this.k0*e/n,r=this.B*e/(t*Math.sqrt(n)),i=r*r-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Math.pow(v0(this.e,this.lat0,s),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=i=1),y||_?(y?(c=Math.asin(Math.sin(m)/r),_||(h=m)):(c=h,m=Math.asin(r*Math.sin(c))),this.lam0=f-Math.asin(.5*(i-1/i)*Math.tan(c))/this.B):(a=Math.pow(v0(this.e,p,Math.sin(p)),this.B),o=Math.pow(v0(this.e,g,Math.sin(g)),this.B),i=this.E/a,l=(o-a)/(o+a),u=this.E*this.E,u=(u-o*a)/(u+o*a),n=d-v,n<-Math.pi?v-=mN:n>Math.pi&&(v+=mN),this.lam0=fn(.5*(d+v)-Math.atan(u*Math.tan(.5*this.B*(d-v))/l)/this.B),c=Math.atan(2*Math.sin(this.B*fn(d-this.lam0))/(i-1/i)),h=m=Math.asin(r*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(m))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(qo-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(qo+i))}function qNr(n){var e={},t,r,i,a,o,s,l,u;if(n.x=n.x-this.lam0,Math.abs(Math.abs(n.y)-Ir)>Zr){if(o=this.E/Math.pow(v0(this.e,n.y,Math.sin(n.y)),this.B),s=1/o,t=.5*(o-s),r=.5*(o+s),a=Math.sin(this.B*n.x),i=(t*this.singam-a*this.cosgam)/r,Math.abs(Math.abs(i)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*n.y;return this.no_rot?(e.x=l,e.y=u):(l-=this.u_0,e.x=u*this.cosrot+l*this.sinrot,e.y=l*this.cosrot-u*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function ZNr(n){var e,t,r,i,a,o,s,l={};if(n.x=(n.x-this.x0)*(1/this.a),n.y=(n.y-this.y0)*(1/this.a),this.no_rot?(t=n.y,e=n.x):(t=n.x*this.cosrot-n.y*this.sinrot,e=n.y*this.cosrot+n.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*t),i=.5*(r-1/r),a=.5*(r+1/r),o=Math.sin(this.BrA*e),s=(o*this.cosgam+i*this.singam)/a,Math.abs(Math.abs(s)-1)Zr?this.ns=Math.log(r/s)/Math.log(i/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function e3r(n){var e=n.x,t=n.y;Math.abs(2*Math.abs(t)-Math.PI)<=Zr&&(t=Bk(t)*(Ir-2*Zr));var r=Math.abs(Math.abs(t)-Ir),i,a;if(r>Zr)i=v0(this.e,t,Math.sin(t)),a=this.a*this.f0*Math.pow(i,this.ns);else{if(r=t*this.ns,r<=0)return null;a=0}var o=this.ns*fn(e-this.long0);return n.x=this.k0*(a*Math.sin(o))+this.x0,n.y=this.k0*(this.rh-a*Math.cos(o))+this.y0,n}function t3r(n){var e,t,r,i,a,o=(n.x-this.x0)/this.k0,s=this.rh-(n.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+s*s),t=1):(e=-Math.sqrt(o*o+s*s),t=-1);var l=0;if(e!==0&&(l=Math.atan2(t*o,t*s)),e!==0||this.ns>0){if(t=1/this.ns,r=Math.pow(e/(this.a*this.f0),t),i=_N(this.e,r),i===-9999)return null}else i=-Ir;return a=fn(l/this.ns+this.long0),n.x=a,n.y=i,n}var r3r=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const n3r={init:QNr,forward:e3r,inverse:t3r,names:r3r};function i3r(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function a3r(n){var e,t,r,i,a,o,s,l=n.x,u=n.y,h=fn(l-this.long0);return e=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/e)-this.s45),r=-h*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(r)),a=Math.asin(Math.cos(t)*Math.sin(r)/Math.cos(i)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),n.y=s*Math.cos(o)/1,n.x=s*Math.sin(o)/1,this.czech||(n.y*=-1,n.x*=-1),n}function o3r(n){var e,t,r,i,a,o,s,l,u=n.x;n.x=n.y,n.y=u,this.czech||(n.y*=-1,n.x*=-1),o=Math.sqrt(n.x*n.x+n.y*n.y),a=Math.atan2(n.y,n.x),i=a/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),t=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),n.x=this.long0-t/this.alfa,s=e,l=0;var h=0;do n.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)),this.e/2))-this.s45),Math.abs(s-n.y)<1e-10&&(l=1),s=n.y,h+=1;while(l===0&&h<15);return h>=15?null:n}var s3r=["Krovak","krovak"];const l3r={init:i3r,forward:a3r,inverse:o3r,names:s3r};function Rf(n,e,t,r,i){return n*i-e*Math.sin(2*i)+t*Math.sin(4*i)-r*Math.sin(6*i)}function Gk(n){return 1-.25*n*(1+n/16*(3+1.25*n))}function zk(n){return .375*n*(1+.25*n*(1+.46875*n))}function Uk(n){return .05859375*n*n*(1+.75*n)}function Vk(n){return n*n*n*(35/3072)}function YM(n,e,t){var r=e*t;return n/Math.sqrt(1-r*r)}function cL(n){return Math.abs(n)1e-7?(t=n*e,(1-n*n)*(e/(1-t*t)-.5/n*Math.log((1-t)/(1+t)))):2*e}var v3r=1,p3r=2,g3r=3,y3r=4;function m3r(){var n=Math.abs(this.lat0);if(Math.abs(n-Ir)0){var e;switch(this.qp=CS(this.e,1),this.mmf=.5/(1-this.es),this.apa=A3r(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=CS(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function _3r(n){var e,t,r,i,a,o,s,l,u,h,c=n.x,f=n.y;if(c=fn(c-this.long0),this.sphere){if(a=Math.sin(f),h=Math.cos(f),r=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+h*r:1+this.sinph0*a+this.cosph0*h*r,t<=Zr)return null;t=Math.sqrt(2/t),e=t*h*Math.sin(c),t*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*h*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.lat0)=0?(e=(u=Math.sqrt(o))*i,t=r*(this.mode===this.S_POLE?u:-u)):e=t=0;break}}return n.x=this.a*e+this.x0,n.y=this.a*t+this.y0,n}function x3r(n){n.x-=this.x0,n.y-=this.y0;var e=n.x/this.a,t=n.y/this.a,r,i,a,o,s,l,u;if(this.sphere){var h=0,c,f=0;if(c=Math.sqrt(e*e+t*t),i=c*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(i),h=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=Zr?0:Math.asin(t*f/c),e*=f,t=h*c;break;case this.OBLIQ:i=Math.abs(c)<=Zr?this.lat0:Math.asin(h*this.sinph0+t*f*this.cosph0/c),e*=f*this.cosph0,t=(h-Math.sin(i)*this.sinph0)*c;break;case this.N_POLE:t=-t,i=Ir-i;break;case this.S_POLE:i-=Ir;break}r=t===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,t)}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,t*=this.dd,l=Math.sqrt(e*e+t*t),l1&&(n=n>1?1:-1),Math.asin(n)}function P3r(){Math.abs(this.lat1+this.lat2)Zr?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function O3r(n){var e=n.x,t=n.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var r=CS(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*fn(e-this.long0),o=i*Math.sin(a)+this.x0,s=this.rh-i*Math.cos(a)+this.y0;return n.x=o,n.y=s,n}function R3r(n){var e,t,r,i,a,o;return n.x-=this.x0,n.y=this.rh-n.y+this.y0,this.ns0>=0?(e=Math.sqrt(n.x*n.x+n.y*n.y),r=1):(e=-Math.sqrt(n.x*n.x+n.y*n.y),r=-1),i=0,e!==0&&(i=Math.atan2(r*n.x,r*n.y)),r=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(t=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,t)),a=fn(i/this.ns0+this.long0),n.x=a,n.y=o,n}function D3r(n,e){var t,r,i,a,o,s=iw(.5*e);if(n0||Math.abs(o)<=Zr?(s=this.x0+this.a*a*t*Math.sin(r)/o,l=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*t*i)/o):(s=this.x0+this.infinity_dist*t*Math.sin(r),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*i)),n.x=s,n.y=l,n}function G3r(n){var e,t,r,i,a,o;return n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,(e=Math.sqrt(n.x*n.x+n.y*n.y))?(i=Math.atan2(e,this.rc),t=Math.sin(i),r=Math.cos(i),o=iw(r*this.sin_p14+n.y*t*this.cos_p14/e),a=Math.atan2(n.x*t,e*this.cos_p14*r-n.y*this.sin_p14*t),a=fn(this.long0+a)):(o=this.phic0,a=0),n.x=a,n.y=o,n}var z3r=["gnom"];const U3r={init:F3r,forward:B3r,inverse:G3r,names:z3r};function V3r(n,e){var t=1-(1-n*n)/(2*n)*Math.log((1-n)/(1+n));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*Ir:Ir;for(var r=Math.asin(.5*e),i,a,o,s,l=0;l<30;l++)if(a=Math.sin(r),o=Math.cos(r),s=n*a,i=Math.pow(1-s*s,2)/(2*o)*(e/(1-n*n)-a/(1-s*s)+.5/n*Math.log((1-s)/(1+s))),r+=i,Math.abs(i)<=1e-10)return r;return NaN}function $3r(){this.sphere||(this.k0=mm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function W3r(n){var e=n.x,t=n.y,r,i,a=fn(e-this.long0);if(this.sphere)r=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(t)/Math.cos(this.lat_ts);else{var o=CS(this.e,Math.sin(t));r=this.x0+this.a*this.k0*a,i=this.y0+this.a*o*.5/this.k0}return n.x=r,n.y=i,n}function H3r(n){n.x-=this.x0,n.y-=this.y0;var e,t;return this.sphere?(e=fn(this.long0+n.x/this.a/Math.cos(this.lat_ts)),t=Math.asin(n.y/this.a*Math.cos(this.lat_ts))):(t=V3r(this.e,2*n.y*this.k0/this.a),e=fn(this.long0+n.x/(this.a*this.k0))),n.x=e,n.y=t,n}var j3r=["cea"];const X3r={init:$3r,forward:W3r,inverse:H3r,names:j3r};function Y3r(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function q3r(n){var e=n.x,t=n.y,r=fn(e-this.long0),i=cL(t-this.lat0);return n.x=this.x0+this.a*r*this.rc,n.y=this.y0+this.a*i,n}function Z3r(n){var e=n.x,t=n.y;return n.x=fn(this.long0+(e-this.x0)/(this.a*this.rc)),n.y=cL(this.lat0+(t-this.y0)/this.a),n}var K3r=["Equirectangular","Equidistant_Cylindrical","eqc"];const J3r={init:Y3r,forward:q3r,inverse:Z3r,names:K3r};var fMe=20;function Q3r(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Gk(this.es),this.e1=zk(this.es),this.e2=Uk(this.es),this.e3=Vk(this.es),this.ml0=this.a*Rf(this.e0,this.e1,this.e2,this.e3,this.lat0)}function ekr(n){var e=n.x,t=n.y,r,i,a,o=fn(e-this.long0);if(a=o*Math.sin(t),this.sphere)Math.abs(t)<=Zr?(r=this.a*o,i=-1*this.a*this.lat0):(r=this.a*Math.sin(a)/Math.tan(t),i=this.a*(cL(t-this.lat0)+(1-Math.cos(a))/Math.tan(t)));else if(Math.abs(t)<=Zr)r=this.a*o,i=-1*this.ml0;else{var s=YM(this.a,this.e,Math.sin(t))/Math.tan(t);r=s*Math.sin(a),i=this.a*Rf(this.e0,this.e1,this.e2,this.e3,t)-this.ml0+s*(1-Math.cos(a))}return n.x=r+this.x0,n.y=i+this.y0,n}function tkr(n){var e,t,r,i,a,o,s,l,u;if(r=n.x-this.x0,i=n.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=Zr)e=fn(r/this.a+this.long0),t=0;else{o=this.lat0+i/this.a,s=r*r/this.a/this.a+o*o,l=o;var h;for(a=fMe;a;--a)if(h=Math.tan(l),u=-1*(o*(l*h+1)-l-.5*(l*l+s)*h)/((l-o)/h-1),l+=u,Math.abs(u)<=Zr){t=l;break}e=fn(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(t))}else if(Math.abs(i+this.ml0)<=Zr)t=0,e=fn(this.long0+r/this.a);else{o=(this.ml0+i)/this.a,s=r*r/this.a/this.a+o*o,l=o;var c,f,d,v,p;for(a=fMe;a;--a)if(p=this.e*Math.sin(l),c=Math.sqrt(1-p*p)*Math.tan(l),f=this.a*Rf(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),v=f/this.a,u=(o*(c*v+1)-v-.5*c*(v*v+s))/(this.es*Math.sin(2*l)*(v*v+s-2*o*v)/(4*c)+(o-v)*(c*d-2/Math.sin(2*l))-d),l-=u,Math.abs(u)<=Zr){t=l;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=fn(this.long0+Math.asin(r*c/this.a)/Math.sin(t))}return n.x=e,n.y=t,n}var rkr=["Polyconic","poly"];const nkr={init:Q3r,forward:ekr,inverse:tkr,names:rkr};function ikr(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function akr(n){var e,t=n.x,r=n.y,i=r-this.lat0,a=t-this.long0,o=i/DR*1e-5,s=a,l=1,u=0;for(e=1;e<=10;e++)l=l*o,u=u+this.A[e]*l;var h=u,c=s,f=1,d=0,v,p,g=0,m=0;for(e=1;e<=6;e++)v=f*h-d*c,p=d*h+f*c,f=v,d=p,g=g+this.B_re[e]*f-this.B_im[e]*d,m=m+this.B_im[e]*f+this.B_re[e]*d;return n.x=m*this.a+this.x0,n.y=g*this.a+this.y0,n}function okr(n){var e,t=n.x,r=n.y,i=t-this.x0,a=r-this.y0,o=a/this.a,s=i/this.a,l=1,u=0,h,c,f=0,d=0;for(e=1;e<=6;e++)h=l*o-u*s,c=u*o+l*s,l=h,u=c,f=f+this.C_re[e]*l-this.C_im[e]*u,d=d+this.C_im[e]*l+this.C_re[e]*u;for(var v=0;v.999999999999&&(t=.999999999999),e=Math.asin(t);var r=fn(this.long0+n.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var i=Math.asin(t);return n.x=r,n.y=i,n}var bkr=["Mollweide","moll"];const Ekr={init:xkr,forward:Skr,inverse:wkr,names:bkr};function Tkr(){Math.abs(this.lat1+this.lat2)=0?(t=Math.sqrt(n.x*n.x+n.y*n.y),e=1):(t=-Math.sqrt(n.x*n.x+n.y*n.y),e=-1);var a=0;if(t!==0&&(a=Math.atan2(e*n.x,e*n.y)),this.sphere)return i=fn(this.long0+a/this.ns),r=cL(this.g-t/this.a),n.x=i,n.y=r,n;var o=this.g-t/this.a;return r=M7(o,this.e0,this.e1,this.e2,this.e3),i=fn(this.long0+a/this.ns),n.x=i,n.y=r,n}var Mkr=["Equidistant_Conic","eqdc"];const Ikr={init:Tkr,forward:Ckr,inverse:Akr,names:Mkr};function Lkr(){this.R=this.a}function Pkr(n){var e=n.x,t=n.y,r=fn(e-this.long0),i,a;Math.abs(t)<=Zr&&(i=this.x0+this.R*r,a=this.y0);var o=iw(2*Math.abs(t/Math.PI));(Math.abs(r)<=Zr||Math.abs(Math.abs(t)-Ir)<=Zr)&&(i=this.x0,t>=0?a=this.y0+Math.PI*this.R*Math.tan(.5*o):a=this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/r-r/Math.PI),l=s*s,u=Math.sin(o),h=Math.cos(o),c=h/(u+h-1),f=c*c,d=c*(2/u-1),v=d*d,p=Math.PI*this.R*(s*(c-v)+Math.sqrt(l*(c-v)*(c-v)-(v+l)*(f-v)))/(v+l);r<0&&(p=-p),i=this.x0+p;var g=l+c;return p=Math.PI*this.R*(d*g-s*Math.sqrt((v+l)*(l+1)-g*g))/(v+l),t>=0?a=this.y0+p:a=this.y0-p,n.x=i,n.y=a,n}function Okr(n){var e,t,r,i,a,o,s,l,u,h,c,f,d;return n.x-=this.x0,n.y-=this.y0,c=Math.PI*this.R,r=n.x/c,i=n.y/c,a=r*r+i*i,o=-Math.abs(i)*(1+a),s=o-2*i*i+r*r,l=-2*o+1+2*i*i+a*a,d=i*i/l+(2*s*s*s/l/l/l-9*o*s/l/l)/27,u=(o-s*s/3/l)/l,h=2*Math.sqrt(-u/3),c=3*d/u/h,Math.abs(c)>1&&(c>=0?c=1:c=-1),f=Math.acos(c)/3,n.y>=0?t=(-h*Math.cos(f+Math.PI/3)-s/3/l)*Math.PI:t=-(-h*Math.cos(f+Math.PI/3)-s/3/l)*Math.PI,Math.abs(r)2*Ir*this.a?void 0:(t=e/this.a,r=Math.sin(t),i=Math.cos(t),a=this.long0,Math.abs(e)<=Zr?o=this.lat0:(o=iw(i*this.sin_p12+n.y*r*this.cos_p12/e),s=Math.abs(this.lat0)-Ir,Math.abs(s)<=Zr?this.lat0>=0?a=fn(this.long0+Math.atan2(n.x,-n.y)):a=fn(this.long0-Math.atan2(-n.x,n.y)):a=fn(this.long0+Math.atan2(n.x*r,e*this.cos_p12*i-n.y*this.sin_p12*r))),n.x=a,n.y=o,n)):(l=Gk(this.es),u=zk(this.es),h=Uk(this.es),c=Vk(this.es),Math.abs(this.sin_p12-1)<=Zr?(f=this.a*Rf(l,u,h,c,Ir),e=Math.sqrt(n.x*n.x+n.y*n.y),d=f-e,o=M7(d/this.a,l,u,h,c),a=fn(this.long0+Math.atan2(n.x,-1*n.y)),n.x=a,n.y=o,n):Math.abs(this.sin_p12+1)<=Zr?(f=this.a*Rf(l,u,h,c,Ir),e=Math.sqrt(n.x*n.x+n.y*n.y),d=e-f,o=M7(d/this.a,l,u,h,c),a=fn(this.long0+Math.atan2(n.x,n.y)),n.x=a,n.y=o,n):(e=Math.sqrt(n.x*n.x+n.y*n.y),g=Math.atan2(n.x,n.y),v=YM(this.a,this.e,this.sin_p12),m=Math.cos(g),y=this.e*this.cos_p12*m,_=-y*y/(1-this.es),x=3*this.es*(1-_)*this.sin_p12*this.cos_p12*m/(1-this.es),S=e/v,w=S-_*(1+_)*Math.pow(S,3)/6-x*(1+3*_)*Math.pow(S,4)/24,b=1-_*w*w/2-S*w*w*w/6,p=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*m),a=fn(this.long0+Math.asin(Math.sin(g)*Math.sin(w)/Math.cos(p))),E=Math.sin(p),o=Math.atan2((E-this.es*b*this.sin_p12)*Math.tan(p),E*(1-this.es)),n.x=a,n.y=o,n))}var Bkr=["Azimuthal_Equidistant","aeqd"];const Gkr={init:Nkr,forward:kkr,inverse:Fkr,names:Bkr};function zkr(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Ukr(n){var e,t,r,i,a,o,s,l,u=n.x,h=n.y;return r=fn(u-this.long0),e=Math.sin(h),t=Math.cos(h),i=Math.cos(r),o=this.sin_p14*e+this.cos_p14*t*i,a=1,(o>0||Math.abs(o)<=Zr)&&(s=this.a*a*t*Math.sin(r),l=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*t*i)),n.x=s,n.y=l,n}function Vkr(n){var e,t,r,i,a,o,s;return n.x-=this.x0,n.y-=this.y0,e=Math.sqrt(n.x*n.x+n.y*n.y),t=iw(e/this.a),r=Math.sin(t),i=Math.cos(t),o=this.long0,Math.abs(e)<=Zr?(s=this.lat0,n.x=o,n.y=s,n):(s=iw(i*this.sin_p14+n.y*r*this.cos_p14/e),a=Math.abs(this.lat0)-Ir,Math.abs(a)<=Zr?(this.lat0>=0?o=fn(this.long0+Math.atan2(n.x,-n.y)):o=fn(this.long0-Math.atan2(-n.x,n.y)),n.x=o,n.y=s,n):(o=fn(this.long0+Math.atan2(n.x*r,e*this.cos_p14*i-n.y*this.sin_p14*r)),n.x=o,n.y=s,n))}var $kr=["ortho"];const Wkr={init:zkr,forward:Ukr,inverse:Vkr,names:$kr};var Tl={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Zo={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Hkr(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Ir-qo/2?this.face=Tl.TOP:this.lat0<=-(Ir-qo/2)?this.face=Tl.BOTTOM:Math.abs(this.long0)<=qo?this.face=Tl.FRONT:Math.abs(this.long0)<=Ir+qo?this.face=this.long0>0?Tl.RIGHT:Tl.LEFT:this.face=Tl.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function jkr(n){var e={x:0,y:0},t,r,i,a,o,s,l={value:0};if(n.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(n.y)):t=n.y,r=n.x,this.face===Tl.TOP)a=Ir-t,r>=qo&&r<=Ir+qo?(l.value=Zo.AREA_0,i=r-Ir):r>Ir+qo||r<=-(Ir+qo)?(l.value=Zo.AREA_1,i=r>0?r-ou:r+ou):r>-(Ir+qo)&&r<=-qo?(l.value=Zo.AREA_2,i=r+Ir):(l.value=Zo.AREA_3,i=r);else if(this.face===Tl.BOTTOM)a=Ir+t,r>=qo&&r<=Ir+qo?(l.value=Zo.AREA_0,i=-r+Ir):r=-qo?(l.value=Zo.AREA_1,i=-r):r<-qo&&r>=-(Ir+qo)?(l.value=Zo.AREA_2,i=-r-Ir):(l.value=Zo.AREA_3,i=r>0?-r+ou:-r-ou);else{var u,h,c,f,d,v,p;this.face===Tl.RIGHT?r=iM(r,+Ir):this.face===Tl.BACK?r=iM(r,+ou):this.face===Tl.LEFT&&(r=iM(r,-Ir)),f=Math.sin(t),d=Math.cos(t),v=Math.sin(r),p=Math.cos(r),u=d*p,h=d*v,c=f,this.face===Tl.FRONT?(a=Math.acos(u),i=R6(a,c,h,l)):this.face===Tl.RIGHT?(a=Math.acos(h),i=R6(a,c,-u,l)):this.face===Tl.BACK?(a=Math.acos(-u),i=R6(a,c,-h,l)):this.face===Tl.LEFT?(a=Math.acos(-h),i=R6(a,c,u,l)):(a=i=0,l.value=Zo.AREA_0)}return s=Math.atan(12/ou*(i+Math.acos(Math.sin(i)*Math.cos(qo))-Ir)),o=Math.sqrt((1-Math.cos(a))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===Zo.AREA_1?s+=Ir:l.value===Zo.AREA_2?s+=ou:l.value===Zo.AREA_3&&(s+=1.5*ou),e.x=o*Math.cos(s),e.y=o*Math.sin(s),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,n.x=e.x,n.y=e.y,n}function Xkr(n){var e={lam:0,phi:0},t,r,i,a,o,s,l,u,h,c={value:0};if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,r=Math.atan(Math.sqrt(n.x*n.x+n.y*n.y)),t=Math.atan2(n.y,n.x),n.x>=0&&n.x>=Math.abs(n.y)?c.value=Zo.AREA_0:n.y>=0&&n.y>=Math.abs(n.x)?(c.value=Zo.AREA_1,t-=Ir):n.x<0&&-n.x>=Math.abs(n.y)?(c.value=Zo.AREA_2,t=t<0?t+ou:t-ou):(c.value=Zo.AREA_3,t+=Ir),h=ou/12*Math.tan(t),o=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),s=Math.atan(o),i=Math.cos(t),a=Math.tan(r),l=1-i*i*a*a*(1-Math.cos(Math.atan(1/Math.cos(s)))),l<-1?l=-1:l>1&&(l=1),this.face===Tl.TOP)u=Math.acos(l),e.phi=Ir-u,c.value===Zo.AREA_0?e.lam=s+Ir:c.value===Zo.AREA_1?e.lam=s<0?s+ou:s-ou:c.value===Zo.AREA_2?e.lam=s-Ir:e.lam=s;else if(this.face===Tl.BOTTOM)u=Math.acos(l),e.phi=u-Ir,c.value===Zo.AREA_0?e.lam=-s+Ir:c.value===Zo.AREA_1?e.lam=-s:c.value===Zo.AREA_2?e.lam=-s-Ir:e.lam=s<0?-s-ou:-s+ou;else{var f,d,v;f=l,h=f*f,h>=1?v=0:v=Math.sqrt(1-h)*Math.sin(s),h+=v*v,h>=1?d=0:d=Math.sqrt(1-h),c.value===Zo.AREA_1?(h=d,d=-v,v=h):c.value===Zo.AREA_2?(d=-d,v=-v):c.value===Zo.AREA_3&&(h=d,d=v,v=-h),this.face===Tl.RIGHT?(h=f,f=-d,d=h):this.face===Tl.BACK?(f=-f,d=-d):this.face===Tl.LEFT&&(h=f,f=d,d=-h),e.phi=Math.acos(-v)-Ir,e.lam=Math.atan2(d,f),this.face===Tl.RIGHT?e.lam=iM(e.lam,-Ir):this.face===Tl.BACK?e.lam=iM(e.lam,-ou):this.face===Tl.LEFT&&(e.lam=iM(e.lam,+Ir))}if(this.es!==0){var p,g,m;p=e.phi<0?1:0,g=Math.tan(e.phi),m=this.b/Math.sqrt(g*g+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-m*m)/(this.one_minus_f*m)),p&&(e.phi=-e.phi)}return e.lam+=this.long0,n.x=e.lam,n.y=e.phi,n}function R6(n,e,t,r){var i;return nqo&&i<=Ir+qo?(r.value=Zo.AREA_1,i-=Ir):i>Ir+qo||i<=-(Ir+qo)?(r.value=Zo.AREA_2,i=i>=0?i-ou:i+ou):(r.value=Zo.AREA_3,i+=Ir)),i}function iM(n,e){var t=n+e;return t<-ou?t+=mN:t>+ou&&(t-=mN),t}var Ykr=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const qkr={init:Hkr,forward:jkr,inverse:Xkr,names:Ykr};var _re=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],PO=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],aZe=.8487,oZe=1.3523,sZe=Xy/5,Zkr=1/sZe,CA=18,I7=function(n,e){return n[0]+e*(n[1]+e*(n[2]+e*n[3]))},Kkr=function(n,e){return n[1]+e*(2*n[2]+e*3*n[3])};function Jkr(n,e,t,r){for(var i=e;r;--r){var a=n(i);if(i-=a,Math.abs(a)=CA&&(r=CA-1),t=Xy*(t-Zkr*r);var i={x:I7(_re[r],t)*e,y:I7(PO[r],t)};return n.y<0&&(i.y=-i.y),i.x=i.x*this.a*aZe+this.x0,i.y=i.y*this.a*oZe+this.y0,i}function tFr(n){var e={x:(n.x-this.x0)/(this.a*aZe),y:Math.abs(n.y-this.y0)/(this.a*oZe)};if(e.y>=1)e.x/=_re[CA][0],e.y=n.y<0?-Ir:Ir;else{var t=Math.floor(e.y*CA);for(t<0?t=0:t>=CA&&(t=CA-1);;)if(PO[t][0]>e.y)--t;else if(PO[t+1][0]<=e.y)++t;else break;var r=PO[t],i=5*(e.y-r[0])/(PO[t+1][0]-r[0]);i=Jkr(function(a){return(I7(r,a)-e.y)/Kkr(r,a)},i,Zr,100),e.x/=I7(_re[t],i),e.y=(5*t+i)*ic,n.y<0&&(e.y=-e.y)}return e.x=fn(e.x+this.long0),e}var rFr=["Robinson","robin"];const nFr={init:Qkr,forward:eFr,inverse:tFr,names:rFr};function iFr(){this.name="geocent"}function aFr(n){var e=Jqe(n,this.es,this.a);return e}function oFr(n){var e=Qqe(n,this.es,this.a,this.b);return e}var sFr=["Geocentric","geocentric","geocent","Geocent"];const lFr={init:iFr,forward:aFr,inverse:oFr,names:sFr};var Dc={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},VP={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function uFr(){if(Object.keys(VP).forEach(function(t){if(typeof this[t]>"u")this[t]=VP[t].def;else{if(VP[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);VP[t].num&&(this[t]=parseFloat(this[t]))}VP[t].degrees&&(this[t]=this[t]*ic)}.bind(this)),Math.abs(Math.abs(this.lat0)-Ir)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var n=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(n),this.sw=Math.sin(n)}function hFr(n){n.x-=this.long0;var e=Math.sin(n.y),t=Math.cos(n.y),r=Math.cos(n.x),i,a;switch(this.mode){case Dc.OBLIQ:a=this.sinph0*e+this.cosph0*t*r;break;case Dc.EQUIT:a=t*r;break;case Dc.S_POLE:a=-e;break;case Dc.N_POLE:a=e;break}switch(a=this.pn1/(this.p-a),i=a*t*Math.sin(n.x),this.mode){case Dc.OBLIQ:a*=this.cosph0*e-this.sinph0*t*r;break;case Dc.EQUIT:a*=e;break;case Dc.N_POLE:a*=-(t*r);break;case Dc.S_POLE:a*=t*r;break}var o,s;return o=a*this.cg+i*this.sg,s=1/(o*this.sw*this.h1+this.cw),i=(i*this.cg-a*this.sg)*this.cw*s,a=o*s,n.x=i*this.a,n.y=a*this.a,n}function cFr(n){n.x/=this.a,n.y/=this.a;var e={x:n.x,y:n.y},t,r,i;i=1/(this.pn1-n.y*this.sw),t=this.pn1*n.x*i,r=this.pn1*n.y*this.cw*i,n.x=t*this.cg+r*this.sg,n.y=r*this.cg-t*this.sg;var a=Kg(n.x,n.y);if(Math.abs(a)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var n=1-this.es,e=1/n;this.radius_p=Math.sqrt(n),this.radius_p2=n,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function pFr(n){var e=n.x,t=n.y,r,i,a,o;if(e=e-this.long0,this.shape==="ellipse"){t=Math.atan(this.radius_p2*Math.tan(t));var s=this.radius_p/Kg(this.radius_p*Math.cos(t),Math.sin(t));if(i=s*Math.cos(e)*Math.cos(t),a=s*Math.sin(e)*Math.cos(t),o=s*Math.sin(t),(this.radius_g-i)*i-a*a-o*o*this.radius_p_inv2<0)return n.x=Number.NaN,n.y=Number.NaN,n;r=this.radius_g-i,this.flip_axis?(n.x=this.radius_g_1*Math.atan(a/Kg(o,r)),n.y=this.radius_g_1*Math.atan(o/r)):(n.x=this.radius_g_1*Math.atan(a/r),n.y=this.radius_g_1*Math.atan(o/Kg(a,r)))}else this.shape==="sphere"&&(r=Math.cos(t),i=Math.cos(e)*r,a=Math.sin(e)*r,o=Math.sin(t),r=this.radius_g-i,this.flip_axis?(n.x=this.radius_g_1*Math.atan(a/Kg(o,r)),n.y=this.radius_g_1*Math.atan(o/r)):(n.x=this.radius_g_1*Math.atan(a/r),n.y=this.radius_g_1*Math.atan(o/Kg(a,r))));return n.x=n.x*this.a,n.y=n.y*this.a,n}function gFr(n){var e=-1,t=0,r=0,i,a,o,s;if(n.x=n.x/this.a,n.y=n.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*Kg(1,r)):(t=Math.tan(n.x/this.radius_g_1),r=Math.tan(n.y/this.radius_g_1)*Kg(1,t));var l=r/this.radius_p;if(i=t*t+l*l+e*e,a=2*this.radius_g*e,o=a*a-4*i*this.C,o<0)return n.x=Number.NaN,n.y=Number.NaN,n;s=(-a-Math.sqrt(o))/(2*i),e=this.radius_g+s*e,t*=s,r*=s,n.x=Math.atan2(t,e),n.y=Math.atan(r*Math.cos(n.x)/e),n.y=Math.atan(this.radius_p_inv2*Math.tan(n.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*Math.sqrt(1+r*r)):(t=Math.tan(n.x/this.radius_g_1),r=Math.tan(n.y/this.radius_g_1)*Math.sqrt(1+t*t)),i=t*t+r*r+e*e,a=2*this.radius_g*e,o=a*a-4*i*this.C,o<0)return n.x=Number.NaN,n.y=Number.NaN,n;s=(-a-Math.sqrt(o))/(2*i),e=this.radius_g+s*e,t*=s,r*=s,n.x=Math.atan2(t,e),n.y=Math.atan(r*Math.cos(n.x)/e)}return n.x=n.x+this.long0,n}var yFr=["Geostationary Satellite View","Geostationary_Satellite","geos"];const mFr={init:vFr,forward:pFr,inverse:gFr,names:yFr};function _Fr(n){n.Proj.projections.add(y8),n.Proj.projections.add(m8),n.Proj.projections.add(TNr),n.Proj.projections.add(NNr),n.Proj.projections.add(UNr),n.Proj.projections.add(jNr),n.Proj.projections.add(JNr),n.Proj.projections.add(n3r),n.Proj.projections.add(l3r),n.Proj.projections.add(d3r),n.Proj.projections.add(L3r),n.Proj.projections.add(k3r),n.Proj.projections.add(U3r),n.Proj.projections.add(X3r),n.Proj.projections.add(J3r),n.Proj.projections.add(nkr),n.Proj.projections.add(lkr),n.Proj.projections.add(dkr),n.Proj.projections.add(_kr),n.Proj.projections.add(Ekr),n.Proj.projections.add(Ikr),n.Proj.projections.add(Dkr),n.Proj.projections.add(Gkr),n.Proj.projections.add(Wkr),n.Proj.projections.add(qkr),n.Proj.projections.add(nFr),n.Proj.projections.add(lFr),n.Proj.projections.add(dFr),n.Proj.projections.add(mFr)}Bu.defaultDatum="WGS84";Bu.Proj=nm;Bu.WGS84=new Bu.Proj("WGS84");Bu.Point=XM;Bu.toPoint=eZe;Bu.defs=xf;Bu.nadgrid=FDr;Bu.transform=A7;Bu.mgrs=wrt;Bu.version="__VERSION__";_Fr(Bu);function xFr(){const n=["(",")","\uFF08","\uFF09",",","\uFF0C"],e={};return n.forEach((t,r)=>{e[t]=`$${r}`}),e}function lZe(n){const e=xFr();for(let t in e){const r=e[t],i=new RegExp(`\\${t}`,"g");for(;i.test(n);)n=n.replace(i,r)}return n}function Jq(n,e){const r=n.replace(/&|\||>|<|=|!/g," ").split(" ").filter(a=>a);let i=n;return r.forEach(a=>{const o=e.find(s=>s===a);if(uZe(a)&&o&&(i=i.replace(o,"$"+o)),o){const s=lZe(o);i=i.replace(o,s)}}),i}function Qq(n){let e={};for(let t in n){let r=t;uZe(t)&&(r="$"+t),r=lZe(r),e[r]=n[t]}return e}function uZe(n){return/^\d/.test(n)}class hZe extends _l{constructor(e,t){super(e,t),this._queryService=new BDe(e,t)}queryByBounds(e,t,r){return e=this._processParams(e),this._queryService.queryByBounds(e,t,r)}queryByDistance(e,t,r){return e=this._processParams(e),this._queryService.queryByDistance(e,t,r)}queryBySQL(e,t,r){return e=this._processParams(e),this._queryService.queryBySQL(e,t,r)}queryByGeometry(e,t,r){return e=this._processParams(e),this._queryService.queryByGeometry(e,t,r)}_processParams(e){return e?(e.returnContent=e.returnContent==null?!0:e.returnContent,e.queryParams&&!br.isArray(e.queryParams)&&(e.queryParams=[e.queryParams]),e.bounds&&(e.bounds=new po(e.bounds[0],e.bounds[1],e.bounds[2],e.bounds[3])),e.geometry&&(e.geometry instanceof Qs?e.geometry=new Ki(e.geometry.getCoordinates()[0],e.geometry.getCoordinates()[1]):e.geometry=br.toSuperMapGeometry(JSON.parse(new jc().writeGeometry(e.geometry)))),e):{}}}class SFr{constructor(e,t){this.url=e,this.options=t||{}}getFeaturesByIDs(e,t,r){var i=this,a=new JRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:r});return a.processAsync(e,t)}getFeaturesByBounds(e,t,r){var i=this,a=new XRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}getFeaturesByBuffer(e,t,r){var i=this,a=new YRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}getFeaturesBySQL(e,t,r){var i=this,a=new H8(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}getFeaturesByGeometry(e,t,r){var i=this,a=new ZRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}editFeatures(e,t){if(!(!e||!e.dataSourceName||!e.dataSetName)){var r=this,i=r.url,a=e.dataSourceName,o=e.dataSetName;i=H.urlPathAppend(i,"datasources/"+a+"/datasets/"+o);var s=new V8(i,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return s.processAsync(e,t)}}getMetadata(e,t){var r=this,i=r.url,a=e.dataSourceName,o=e.dataSetName;i=H.urlPathAppend(i,"datasources/"+a+"/datasets/"+o);var s=new V8(i,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return s.getMetaData(e,t)}_processFormat(e){return e||Ni.GEOJSON}}class cZe extends _l{constructor(e,t){super(e,t),this._featureService=new SFr(e,t)}getFeaturesByIDs(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByIDs(e,t,r)}getFeaturesByBounds(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByBounds(e,t,r)}getFeaturesByBuffer(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByBuffer(e,t,r)}getFeaturesBySQL(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesBySQL(e,t,r)}getFeaturesByGeometry(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByGeometry(e,t,r)}editFeatures(e,t){if(!(!e||!e.dataSourceName||!e.dataSetName)){var r=this,i=r.url,a=e.dataSourceName,o=e.dataSetName;i=H.urlPathAppend(i,"datasources/"+a+"/datasets/"+o);var s=new V8(i,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return s.processAsync(r._processParams(e),t)}}getMetadata(e,t){return this._featureService.getMetadata(e,t)}_processParams(e){if(!e)return{};var t=this;if(e.returnContent=e.returnContent==null?!0:e.returnContent,e.fromIndex=e.fromIndex?e.fromIndex:0,e.toIndex=e.toIndex?e.toIndex:-1,e.bounds&&(e.bounds=br.toSuperMapBounds(e.bounds)),e.geometry&&(e.geometry=br.toSuperMapGeometry(JSON.parse(new jc().writeGeometry(e.geometry)))),e.editType&&(e.editType=e.editType.toLowerCase()),e.features){var r=[];br.isArray(e.features)?e.features.map(function(i){return r.push(t._createServerFeature(i)),i}):r.push(t._createServerFeature(e.features)),e.features=r}return e}_createServerFeature(e){var t={},r=[],i=[],a=e.getProperties();for(var o in a)o!==e.getGeometryName()&&(r.push(o),i.push(a[o]));return t.fieldNames=r,t.fieldValues=i,e.getId()&&(t.id=e.getId()),t.geometry=br.toSuperMapGeometry(new jc().writeFeatureObject(e)),t}_processFormat(e){return e||Ni.GEOJSON}}function wFr(n){let e=[];return TFr(n)&&n.length&&n.forEach(t=>{let r=t.get("attributes");r&&e.push(r)}),e}function dMe(n,e,t,r,i,a,o){bFr(n,e,r,i,t,a,o)}function vMe(n,e,t,r,i,a,o,s,l,u){const h=new Of({name:e,attributeFilter:t});r&&(h.fields=r);const c={queryParams:[h]};u&&(c.queryOption=dz.ATTRIBUTE),s&&(c.startRecord=s),l&&(c.expectCount=l),i&&(c.prjCoordSys={epsgCode:i});const f=new ZR(c);new hZe(n).queryBySQL(f,function(v){v.type==="processCompleted"?a(v):o(v)})}function bFr(n,e,t,r,i,a,o){let s=new Of({name:e.join().replace(":","@")}),l=o||1e3,u,h=[];pMe(n,s,e,0,1,1,i,a).then(c=>{u=c;let f=c.result.totalCount;if(f>1){for(let d=1;d{d.forEach(v=>{v.type==="processCompleted"&&v.result.features&&v.result.features.features?v.result.features.features.forEach(p=>{u.result.features.features.push(p)}):u.someRequestFailed=!0}),t(u)}).catch(d=>{r(d)})}else t(c)}).catch(c=>{r(c)})}function EFr(n,e,t,r,i,a){return new VR({queryParameter:n,datasetNames:e,fromIndex:t,toIndex:r,maxFeatures:i,returnContent:!0,targetEpsgCode:a})}function pMe(n,e,t,r,i,a,o,s){return new Promise((l,u)=>{new cZe(n,o).getFeaturesBySQL(EFr(e,t,r,i,a,s),h=>{let c=h.result;h.type==="processCompleted"&&c&&c.features?l(h):u(h)})})}function TFr(n){return Object.prototype.toString.call(n)==="[object Array]"}class Ihe extends _l{constructor(e,t){t=t||{},t.projection&&(t.prjCoordSys=t.projection),super(e,t),this.dataFlow=new lRe(e,t),this.dataFlow.events.on({broadcastSocketConnected:this._defaultEvent,broadcastSocketError:this._defaultEvent,broadcastFailed:this._defaultEvent,broadcastSucceeded:this._defaultEvent,subscribeSocketConnected:this._defaultEvent,subscribeSocketError:this._defaultEvent,messageSucceeded:this._defaultEvent,setFilterParamSucceeded:this._defaultEvent,scope:this})}initBroadcast(){return this.dataFlow.initBroadcast(),this}broadcast(e){this.dataFlow.broadcast(e)}initSubscribe(){return this.dataFlow.initSubscribe(),this}setExcludeField(e){return this.dataFlow.setExcludeField(e),this.options.excludeField=e,this}setGeometry(e){return this.dataFlow.setGeometry(e),this.options.geometry=e,this}unSubscribe(){this.dataFlow.unSubscribe()}unBroadcast(){this.dataFlow.unBroadcast()}_defaultEvent(e){this.dispatchEvent({type:e.eventType||e.type,value:e})}}class CFr extends _f{constructor(e){var t=e||{};super(t),this.idField=t.idField||"id",this.dataService=new Ihe(t.ws,{geometry:t.geometry,prjCoordSys:t.prjCoordSys,excludeField:t.excludeField}).initSubscribe();var r=this;r.dataService.on("subscribeSocketConnected",function(i){r.dispatchEvent({type:"subscribeSucceeded",value:i})}),r.dataService.on("messageSucceeded",function(i){r._onMessageSuccessed(i)}),r.dataService.on("setFilterParamSucceeded",function(i){r.dispatchEvent({type:"setFilterParamSucceeded",value:i})}),this.featureCache={}}setExcludeField(e){return this.dataService.setExcludeField(e),this.excludeField=e,this}setGeometry(e){return this.dataService.setGeometry(e),this.geometry=e,this}_onMessageSuccessed(e){var t=new jc().readFeature(e.value.featureResult),r=t.get(this.idField);r!==void 0&&this.featureCache[r]?(this.featureCache[r].setGeometry(t.getGeometry()),this.featureCache[r].setProperties(t.getProperties()),this.changed()):(this.addFeature(t),this.featureCache[r]=t),this.dispatchEvent({type:"dataupdated",value:{source:this,data:t}})}}class fZe{constructor(e,t){this.geometry=e,this.attributes=t}toFeature(){var e=this.geometry;if(e instanceof vT){let t=this.attributes;t.geometry=e;let r=new d0(t);return new uh().read(new jc().writeFeature(r),"Feature")}else if(e.length===3)return e=new O_(e[0],e[1],e[2]),new sc(e,this.attributes)}}var AFr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),MFr=function(n){AFr(e,n);function e(t,r,i,a,o){var s=this,l=o!==void 0?Ai.IDLE:Ai.LOADED;return s=n.call(this,t,r,i,l)||this,s.loader_=o!==void 0?o:null,s.canvas_=a,s.error_=null,s}return e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=Ai.ERROR):this.state=Ai.LOADED,this.changed()},e.prototype.load=function(){this.state==Ai.IDLE&&(this.state=Ai.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(wue);const IFr=MFr;var LFr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),PFr=function(n){LFr(e,n);function e(t){var r=this,i=t||{},a=i.imageSmoothing!==void 0?i.imageSmoothing:!0;return i.interpolate!==void 0&&(a=i.interpolate),r=n.call(this,{attributions:i.attributions,interpolate:a,projection:i.projection,resolutions:i.resolutions,state:i.state})||this,r.canvasFunction_=i.canvasFunction,r.canvas_=null,r.renderedRevision_=0,r.ratio_=i.ratio!==void 0?i.ratio:1.5,r}return e.prototype.getImageInternal=function(t,r,i,a){r=this.findNearestResolution(r);var o=this.canvas_;if(o&&this.renderedRevision_==this.getRevision()&&o.getResolution()==r&&o.getPixelRatio()==i&&vv(o.getExtent(),t))return o;t=t.slice(),_yr(t,this.ratio_);var s=Co(t)/r,l=lh(t)/r,u=[s*i,l*i],h=this.canvasFunction_.call(this,t,r,i,u,a);return h&&(o=new IFr(t,r,i,h)),this.canvas_=o,this.renderedRevision_=this.getRevision(),o},e}(Xqe);const d$=PFr;class fS extends d${constructor(e,t){var r=t||{};super({attributions:r.attributions||"Map Data \xA9 SuperMap iServer with \xA9 SuperMap iClient",canvasFunction:i,logo:br.getOlVersion()==="4"?r.logo:null,projection:r.projection,ratio:r.ratio,resolutions:r.resolutions,state:r.state}),this.on=this.onInternal,this.id=r.id?r.id:H.createUniqueID("themeLayer_");function i(o,s,l,u,h){var c=u[0]*l,f=u[1]*l;if(this.context||(this.context=br.createCanvasContext2D(c,f)),!this.features)return this.context.canvas;this.pixelRatio=l;var d=this.map.getSize()[0]*l,v=this.map.getSize()[1]*l;this.offset=[(c-d)/2/l,(f-v)/2/l],this.notFirst||(this.redrawThematicFeatures(o),this.notFirst=!0),this.div.id=this.id,this.div.className="themeLayer",this.div.style.width=c+"px",this.div.style.height=f+"px",this.map.getViewport().appendChild(this.div),this.renderer.resize(),this.map.getViewport().removeChild(this.div),this.themeCanvas=this.renderer.painter.root.getElementsByTagName("canvas")[0],this.themeCanvas.width=c,this.themeCanvas.height=f,this.themeCanvas.style.width=c+"px",this.themeCanvas.style.height=f+"px",this.themeCanvas.getContext("2d").clearRect(0,0,c,f);var p=this.renderer.painter._layers.hover.ctx,g=p.canvas,m=br.createCanvasContext2D(c,f);m.drawImage(g,0,0,g.width,g.height,0,0,c,f),this.redrawThematicFeatures(o);var y=this.context.canvas;return this.context.clearRect(0,0,y.width,y.height),y.width=c,y.height=f,y.style.width=c+"px",y.style.height=f+"px",this.context.drawImage(this.themeCanvas,0,0),this.context.drawImage(m.canvas,0,0),this.context.canvas}this.canvasFunctionInternal_=i,this.EVENT_TYPES=["loadstart","loadend","loadcancel","visibilitychanged","move","moveend","added","removed","tileloaded","beforefeaturesadded","featuresadded","featuresremoved"],this.features=[],this.TFEvents=r.TFEvents||[],this.map=r.map;var a=this.map.getSize();this.div=document.createElement("div"),this.map.getViewport().appendChild(this.div),this.div.style.width=a[0]+"px",this.div.style.height=a[1]+"px",this.setOpacity(r.opacity),this.levelRenderer=new Gg,this.movingOffset=[0,0],this.renderer=this.levelRenderer.init(this.div),this.map.getViewport().removeChild(this.div),this.renderer.clear(),this.addTFEvents()}destroy(){this.EVENT_TYPES=null,this.isBaseLayer=null,this.TFEvents=null,this.destroyFeatures(),this.features=null,this.renderer&&this.renderer.dispose(),this.renderer=null,this.levelRenderer=null,this.movingOffset=null,this.currentMousePosition=null}destroyFeatures(e){var t=e==null;if(t&&(e=this.features),e){this.removeFeatures(e),Array.isArray(e)||(e=[e]);for(var r=e.length-1;r>=0;r--)e[r].destroy()}}setOpacity(e){if(e!==this.opacity){this.opacity=e;var t=this.div;H.modifyDOMElement(t,null,null,null,null,null,null,e),this.map!==null&&this.dispatchEvent({type:"changelayer",value:{layer:this,property:"opacity"}})}}addFeatures(e){}removeFeatures(e){var t=this;if(!!e){if(e===t.features)return t.removeAllFeatures();!H.isArray(e)&&typeof e!="function"&&(e=[e]);for(var r=[],i=0;i"u"&&typeof E.__overlayWeight>"u"?0:typeof b.__overlayWeight<"u"&&typeof E.__overlayWeight>"u"?-1:typeof b.__overlayWeight>"u"&&typeof E.__overlayWeight<"u"?1:typeof b.__overlayWeight<"u"&&typeof E.__overlayWeight<"u"?parseFloat(b.__overlayWeight)=r.left&&s.x<=r.right&&s.y>=r.top&&s.y<=r.bottom){i=!0;break}}return i}clearCache(){this.cache={},this.charts=[]}removeFeatures(e){this.clearCache(),super.removeFeatures(e)}removeAllFeatures(){this.clearCache(),super.removeAllFeatures()}redraw(){return this.clearCache(),this.renderer?(this.redrawThematicFeatures(this.map.getView().calculateExtent()),!0):!1}clear(){this.renderer&&(this.renderer.clearAll(),this.renderer.refresh()),this.removeAllFeatures(),this.clearCache()}canvasFunctionInternal_(e,t,r,i,a){return fS.prototype.canvasFunctionInternal_.apply(this,arguments)}}class L7 extends u7{constructor(e){e.stroke?(e.stroke.color=e.stroke.getColor()||"#3388ff",e.stroke.width=e.stroke.getWidth()||1):e.stroke=new es({color:"#3388ff",width:1}),e.fill?e.fill.color=e.fill.getColor()||"#66ccff":e.fill=new Ko({color:"#66ccff"}),super({angle:e.angle||60,stroke:e.stroke,fill:e.fill,radius:e.radius||10,rotation:e.rotation||0}),this.count_=e.count||3,this.strokeOpacity=e.strokeOpacity||1,this.fillOpacity=e.fillOpacity||1,this._pixelRatio=window?window.devicePixelRatio:1,this._canvas=this.getImage(this._pixelRatio),this._ctx=this._canvas.getContext("2d"),this._render()}_render(){var e=0,t=this.getAngle();if(this.spaceAngle=360/this.count_-this.getAngle(),!(this.spaceAngle<0)){this._ctx.setTransform(this._pixelRatio,0,0,this._pixelRatio,0,0),this._ctx.translate(0,0),this._ctx.beginPath();for(var r=0;r!1,gMe=function(){let n=document.createElement("div"),e=["transform","WebkitTransform","MozTransform","OTransform","msTransform"];for(let t=0;t-1&&(this._data=e),!this._renderLayer)return;this._renderLayer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0}),this._refreshData();let t=this._getLayerState();t.data=this._data||[],this._renderLayer.setNeedsRedraw(!0),this._renderLayer.setState(t)}drawGraphics(e){this._data=e||(this._data?this._data:[]),this._renderLayer||this._createInnerRender(),this._clearBuffer(),this._draw()}_initContainer(){this._canvas=this._createCanvas(this.width,this.height),this._layerContainer=this.container,this._wrapper=document.createElement("div"),this._wrapper.className="deck-wrapper",this._wrapper.style.position="absolute",this._wrapper.style.top="0",this._wrapper.style.left="0",this._wrapper.appendChild(this._canvas),this._layerContainer&&this._layerContainer.appendChild(this._wrapper)}_createCanvas(e,t){let r=document.createElement("canvas");return r.oncontextmenu=OFr,r.width=e,r.height=t,r.style.width=e+"px",r.style.height=t+"px",r}_createInnerRender(){let e=this,t=this._getLayerState(),{color:r,radius:i,opacity:a,highlightColor:o,radiusScale:s,radiusMinPixels:l,radiusMaxPixels:u,strokeWidth:h,outline:c}=t;i=this._pixelToMeter(i);let f={id:"scatter-plot",data:[],pickable:Boolean(this.onClick)||Boolean(this.onHover),autoHighlight:!0,color:r,opacity:a,radius:i,radiusScale:s,highlightColor:o,radiusMinPixels:l,radiusMaxPixels:u,strokeWidth:h,outline:c,getPosition(d){if(!d)return[0,0,0];let v=d.getGeometry(),p=v&&v.getCoordinates();return p=e._project(p),p&&[p[0],p[1],0]},getColor(d){let v=e._getLayerDefaultStyle(),p=d&&d.getStyle();return p&&p.getColor&&p.getColor()||v.color},getRadius(d){let v=e._getLayerDefaultStyle(),p=d&&d.getStyle();return p&&p.getRadius&&p.getRadius()||v.radius},updateTriggers:{getColor:[r],getRadius:[i]}};e._renderLayer=new window.DeckGL.ScatterplotLayer(f)}_getLayerDefaultStyle(){let{color:e,opacity:t,radius:r,radiusScale:i,radiusMinPixels:a,radiusMaxPixels:o,strokeWidth:s,outline:l}=this._getLayerState();return r=this._pixelToMeter(r),{color:e,opacity:t,radius:r,radiusScale:i,radiusMinPixels:a,radiusMaxPixels:o,strokeWidth:s,outline:l}}_getLayerState(){let e=this.layer.getLayerState(),r=this.map.getView().getProjection().getCode(),i=r7([e.longitude,e.latitude],r,"EPSG:4326");return e.longitude=i[0],e.latitude=i[1],e.zoom=e.zoom-1,e}_draw(){this._refreshData();let e=this._getLayerState();e.data=this._data||[];let t={};for(let r in e)t[r]=e[r];this._renderLayer.setNeedsRedraw(!0),t.layers=[this._renderLayer],t.canvas=this._canvas,this.onBeforeRender&&(t.onBeforeRender=this.onBeforeRender.bind(this)),this.onAfterRender&&(t.onAfterRender=this.onAfterRender.bind(this)),this.deckGL?this.deckGL.setProps(t):this.deckGL=new window.DeckGL.experimental.DeckGLJS(t)}_refreshData(){let e=this._data||[],t=br.isArray(e)?[].concat(e):[e];this._renderLayer.props.data||(this._renderLayer.props.data=[]),this._renderLayer.props.data.length=0;for(let r=0;r=l.width)return null;var c=lh(s),f=Math.floor(l.height*((s[3]-a[1])/c));return f<0||f>=l.height?null:this.getImageData(l,h,f)},e.prototype.renderFrame=function(t,r){var i=this.image_,a=i.getExtent(),o=i.getResolution(),s=i.getPixelRatio(),l=t.layerStatesArray[t.layerIndex],u=t.pixelRatio,h=t.viewState,c=h.center,f=h.resolution,d=t.size,v=u*o/(f*s),p=Math.round(d[0]*u),g=Math.round(d[1]*u),m=h.rotation;if(m){var y=Math.round(Math.sqrt(p*p+g*g));p=y,g=y}Id(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/u,1/u,m,-p/2,-g/2),bk(this.inversePixelTransform,this.pixelTransform);var _=gue(this.pixelTransform);this.useContainer(r,_,l.opacity,this.getBackground(t));var x=this.context,S=x.canvas;S.width!=p||S.height!=g?(S.width=p,S.height=g):this.containerReused||x.clearRect(0,0,p,g);var w=!1,b=!0;if(l.extent){var E=F1(l.extent,h.projection);b=Cl(E,t.extent),w=b&&!vv(E,t.extent),w&&this.clipUnrotated(x,t,E)}var T=i.getImage(),C=Id(this.tempTransform,p/2,g/2,v,v,0,s*(a[0]-c[0])/o,s*(c[1]-a[3])/o);this.renderedResolution=o*u/s;var A=T.width*C[0],M=T.height*C[3];if(this.getLayer().getSource().getInterpolate()||Ao(x,w7),this.preRender(x,t),b&&A>=.5&&M>=.5){var I=C[4],R=C[5],k=l.opacity,D=void 0;k!==1&&(D=x.globalAlpha,x.globalAlpha=k),x.drawImage(T,0,0,+T.width,+T.height,Math.round(I),Math.round(R),Math.round(A),Math.round(M)),k!==1&&(x.globalAlpha=D)}return this.postRender(x,t),w&&x.restore(),Ao(x,Oqe),_!==S.style.transform&&(S.style.transform=_),this.container},e}(Sue);const zFr=GFr;var UFr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),VFr=function(n){UFr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.createRenderer=function(){return new zFr(this)},e.prototype.getData=function(t){return n.prototype.getData.call(this,t)},e}(FFr);const dZe=VFr,$Fr={color:[0,0,0,255],opacity:.8,radius:10,radiusScale:1,radiusMinPixels:0,radiusMaxPixels:Number.MAX_SAFE_INTEGER,strokeWidth:1,outline:!1},eZ=["canvas","webgl"];class v$ extends d${constructor(e){super({attributions:e.attributions,canvasFunction:r,logo:br.getOlVersion()==="4"?e.logo:null,projection:e.projection,ratio:e.ratio,resolutions:e.resolutions,state:e.state}),this.graphics=[].concat(e.graphics),this.map=e.map,H.extend(this,e),this.render=e.render||eZ[0],br.supportWebGL2()||(this.render=eZ[0]),this.highLightStyle=e.highLightStyle,this.isHighLight=typeof e.isHighLight>"u"?!0:e.isHighLight,this.hitGraphicLayer=null,this._forEachFeatureAtCoordinate=a,this._options=e;const t=this;e.onClick&&t.map.on("click",function(o){if(t.isDeckGLRender){const l=t.renderer.deckGL.pickObject({x:o.pixel[0],y:o.pixel[1]});e.onClick(l);return}const s=t.findGraphicByPixel(o,t);s&&(e.onClick(s,o),t.isHighLight&&t._highLight(s.getGeometry().getCoordinates(),new So({image:s.getStyle()}).getImage(),s,o.pixel))}),t.map.on("pointermove",function(o){if(t.isDeckGLRender){const s=t.renderer.deckGL.pickObject({x:o.pixel[0],y:o.pixel[1]});e.onHover&&e.onHover(s)}});function r(o,s,l,u,h){var c=u[0]/l,f=u[1]/l,d=t.map.getSize()[0],v=t.map.getSize()[1];t.renderer||(t.renderer=i(u,l)),t.renderer.mapWidth=c,t.renderer.mapHeight=f,t.renderer.pixelRatio=l,t.renderer.offset=[(c-d)/2,(f-v)/2];let p=this.getGraphicsInExtent(o);return t.renderer._clearBuffer(),t.renderer.selected=this.selected,t.renderer.drawGraphics(p),t.isDeckGLRender=t.renderer instanceof yMe,t.isDeckGLRender?(t.context||(t.context=br.createCanvasContext2D(c,f)),t.context.canvas):t.renderer.getCanvas()}function i(o,s){let l;if(t.render===eZ[0])l=new DFr(t,{size:o,pixelRatio:s});else{let u=H.extend({},$Fr),h=H.extend(u,{color:t.color,opacity:t.opacity,radius:t.radius,radiusScale:t.radiusScale,radiusMinPixels:t.radiusMinPixels,radiusMaxPixels:t.radiusMaxPixels,strokeWidth:t.strokeWidth,outline:t.outline,onClick:t.onClick,onHover:t.onHover});h=H.extend(t,h),h.pixelRatio=s,h.container=t.map.getViewport().getElementsByClassName("ol-overlaycontainer")[0],h.onBeforeRender=function(){return!1},h.onAfterRender=function(){return!1},l=new yMe(t,h)}return l}function a(o,s,l,u,h){let c=t.getGraphicsInExtent();t._highLightClose();for(let f=c.length-1;f>=0;f--){let d=c[f].getStyle();if(!d)return;if(d instanceof x8)continue;let v=c[f].getGeometry().getCoordinates(),p=new So({image:d}).getImage(),g=!1;if(p instanceof L7&&p.getCount()===1){const m=p.getRotation()*180/Math.PI,y=Number.parseFloat(p.getAngle()),_=p.getRadius()*s;let x=null;if(y>355)x=new rm(v,_);else{const S=[];S.push(v);const w=y/8;for(let b=0;b<8;b++){const E=(m+b*w)/180*Math.PI;S.push([v[0]+_*Math.cos(E),v[1]-_*Math.sin(E)])}S.push(v),x=new m2([S])}x.intersectsCoordinate(this.map.getCoordinateFromPixel(u))&&(g=!0)}else{let m=[];m[0]=v[0]-p.getAnchor()[0]*s,m[2]=v[0]+p.getAnchor()[0]*s,m[1]=v[1]-p.getAnchor()[1]*s,m[3]=v[1]+p.getAnchor()[1]*s,dv(m,o)&&(g=!0)}if(g===!0){l&&l(c[f],h);continue}}}}findGraphicByPixel(e,t){const r=t.map.getFeaturesAtPixel(e.pixel)||[];for(let i=0;i-1)return a}}setGraphics(e){this.graphics=this.graphics||[],this.graphics.length=0;let t=br.isArray(e)?[].concat(e):[e];this.graphics=[].concat(t),this.update()}addGraphics(e){this.graphics=this.graphics||[];let t=br.isArray(e)?[].concat(e):[e];this.graphics=this.graphics.concat(t),this.update()}getGraphicBy(e,t){let r=null;for(let i in this.graphics)if(this.graphics[i][e]===t){r=this.graphics[i];break}return r}getGraphicById(e){return this.getGraphicBy("id",e)}getGraphicsByAttribute(e,t){var r,i=[];for(let a in this.graphics)r=this.graphics[a],r&&r.attributes&&r.attributes[e]===t&&i.push(r);return i}removeGraphics(e=null){if(!e||e.length===0||e===this.graphics){this.graphics.length=0,this.update();return}H.isArray(e)||(e=[e]);for(let t=e.length-1;t>=0;t--){let r=e[t],i=H.indexOf(this.graphics,r);i!==-1&&this.graphics.splice(i,1)}this.update()}clear(){this.removeGraphics()}update(){this.renderer.update(this.graphics,this._getDefaultStyle())}_getDefaultStyle(){const e={};return this.color&&(e.fill=new Ko({color:this.toRGBA(this.color)})),this.radius&&(e.radius=this.radius),this.outline&&(e.stroke=new Ko({color:this.toRGBA(this.color),width:this.strokeWidth})),new rm(e)}toRGBA(e){return`rgba(${e[0]},${e[1]},${e[2]},${(e[3]||255)/255})`}setStyle(e){let t=this,r={color:t.color,radius:t.radius,opacity:t.opacity,highlightColor:t.highlightColor,radiusScale:t.radiusScale,radiusMinPixels:t.radiusMinPixels,radiusMaxPixels:t.radiusMaxPixels,strokeWidth:t.strokeWidth,outline:t.outline};H.extend(t,H.extend(r,e)),t.update()}getLayerState(){let e=this.map,t=e.getSize()[0],r=e.getSize()[1],i=e.getView(),a=i.getCenter(),o=a[0],s=a[1],l=i.getZoom(),u=i.getMaxZoom(),c=-i.getRotation()*180/Math.PI,f={longitude:o,latitude:s,zoom:l,maxZoom:u,pitch:0,bearing:c},d={};for(let v in f)d[v]=f[v];return d.width=t,d.height=r,d.color=this.color,d.radius=this.radius,d.opacity=this.opacity,d.highlightColor=this.highlightColor,d.radiusScale=this.radiusScale,d.radiusMinPixels=this.radiusMinPixels,d.radiusMaxPixels=this.radiusMaxPixels,d.strokeWidth=this.strokeWidth,d.outline=this.outline,d}_highLightClose(){this.selected=null,this.hitGraphicLayer&&(this.map.removeLayer(this.hitGraphicLayer),this.hitGraphicLayer=null),this.changed()}_highLight(e,t,r,i){if(r.getStyle()instanceof L7){this.hitGraphicLayer&&(this.map.removeLayer(this.hitGraphicLayer),this.hitGraphicLayer=null);var a=this.map.getPixelFromCoordinate([e[0],e[1]]);i=i||[0,0];var o=Math.atan2(i[1]-a[1],i[0]-a[0])/Math.PI*180;o=o>0?o:360+o;var s=Math.ceil(o/(t.getAngle()+t.getSpaceAngle())),l=(s-1)*(t.getAngle()+t.getSpaceAngle()),u={stroke:new es({color:"#ff0000",width:1}),fill:new Ko({color:"#0099ff"}),radius:t.getRadius(),angle:t.getAngle(),eAngle:l+t.getAngle(),sAngle:l,rotation:t.getRotation()};this.highLightStyle&&this.highLightStyle instanceof x8&&(u.stroke=this.highLightStyle.getStroke(),u.fill=this.highLightStyle.getFill(),u.radius=this.highLightStyle.getRadius(),u.angle=this.highLightStyle.getAngle());var h=new qM(new Qs(e));h.setStyle(new x8(u)),this.hitGraphicLayer=new dZe({source:new v$({map:this.map,graphics:[h]})}),this.map.addLayer(this.hitGraphicLayer)}else this.selected=r,this.changed()}getGraphicsInExtent(e){var t=[];return e?(this.graphics.forEach(r=>{vv(e,r.getGeometry().getExtent())&&t.push(r)}),t):(this.graphics.forEach(r=>{t.push(r)}),t)}}class AS extends fS{constructor(e,t){super(e,t),this.cache=t.cache||{},this.cacheFields=t.cacheFields||[],this.style=t.style||{},this.maxCacheCount=t.maxCacheCount||0,this.isCustomSetMaxCacheCount=t.isCustomSetMaxCacheCount===void 0?!1:t.isCustomSetMaxCacheCount,this.nodesClipPixel=t.nodesClipPixel||2,this.isHoverAble=t.isHoverAble===void 0?!1:t.isHoverAble,this.isMultiHover=t.isMultiHover===void 0?!1:t.isMultiHover,this.isClickAble=t.isClickAble===void 0?!0:t.isClickAble,this.highlightStyle=t.highlightStyle||null,this.isAllowFeatureStyle=t.isAllowFeatureStyle===void 0?!1:t.isAllowFeatureStyle}destroy(){this.maxCacheCount=null,this.isCustomSetMaxCacheCount=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.cache=null,this.cacheFields=null,this.style=null,this.highlightStyle=null,this.isAllowFeatureStyle=null}addFeatures(e){this.dispatchEvent({type:"beforefeaturesadded",value:{features:e}}),this.features=this.toiClientFeature(e),this.isCustomSetMaxCacheCount||(this.maxCacheCount=this.features.length*5),this.renderer&&this.changed()}removeFeatures(e){this.clearCache(),fS.prototype.removeFeatures.call(this,e)}removeAllFeatures(){this.clearCache(),fS.prototype.removeAllFeatures.apply(this,arguments)}redrawThematicFeatures(e){var t=this.renderer.getHoverOne(),r=null;t&&t.refDataID&&(r=t.refDataID),this.renderer.clearAll();for(var i=this.features,a=this.cache,o=this.cacheFields,s=this.map.getView().getZoom(),l=this.maxCacheCount,u=0,h=i.length;ul){var g=o[0];o.splice(0,1),delete a[g]}}}}if(this.renderer.render(),r&&this.isHoverAble&&this.isMultiHover){var m=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(m)}}createThematicFeature(e){var t=H.copyAttributesWithClip(this.style);e.style&&this.isAllowFeatureStyle===!0&&(t=H.copyAttributesWithClip(e.style));var r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Vn.transformStyle(this.highlightStyle);for(var i=new f3(e,this,Vn.transformStyle(t),r),a=0;a0&&this.labelFeatures.length===0)for(var t=this.setLabelsStyle(this.features),r=0,i=t.length;r=0&&v.x<=h.x&&v.y>=0&&v.y<=h.y){if(i.style.minZoomLevel>-1&&c<=i.style.minZoomLevel||i.style.maxZoomLevel>-1&&c>i.style.maxZoomLevel)continue;var p=null;i.isStyleChange?(i.isStyleChange=null,p=this.calculateLabelBounds(i,v)):i.geometry.bsInfo.w&&i.geometry.bsInfo.h?p=this.calculateLabelBounds2(i,v):p=this.calculateLabelBounds(i,v);var g=new po(0,h.y,h.x,0),m=p.length;if(this.isAvoid){var y=this.getAvoidInfo(g,p);if(y){if(y.aspectW==="left"){i.style.labelXOffset+=y.offsetX;for(let E=0;E=a[u].start&&s=a[u].start&&sl&&(l=g,u="top")}if(p.y>e.bottom){let g=Math.abs(p.y-e.bottom);g>l&&(l=g,u="bottom")}if(p.xs&&(s=g,h="left")}if(p.x>e.right){let g=Math.abs(p.x-e.right);g>s&&(s=g,h="right")}}}}isQuadrilateralOverLap(e,t){var r=e.length,i=t.length;if(r!==5||i!==5)return null;var a=!1;for(let l=0;l"u"?{}:window,r=this.devicePixelRatio=t.devicePixelRatio||1;e.width=parseInt(this.width)*r,e.height=parseInt(this.height)*r,this.context==="2d"&&e.getContext(this.context).scale(r,r),e.style.width=this.width+"px",e.style.height=this.height+"px",this.context==="webgl"&&this.canvas.getContext(this.context).viewport(0,0,e.width,e.height)}draw(){this.options.update&&this.options.update.call(this)}resize(e,t){var r=typeof window>"u"?{}:window,i=this.devicePixelRatio=r.devicePixelRatio||1;this.canvas.width=e*i,this.canvas.height=t*i,this.context==="2d"&&this.canvas.getContext("2d").scale(i,i),this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this.context==="webgl"&&this.canvas.getContext(this.context).viewport(0,0,this.canvas.width,this.canvas.height)}getContainer(){return this.canvas}setZIndex(e){this.canvas.style.zIndex=e}getZIndex(){return this.zIndex}}var P7={exports:{}};(function(n,e){(function(t,r){r(e)})(at,function(t){var r="2.0.62",i=function(B){B&&B.clearRect&&B.clearRect(0,0,B.canvas.width,B.canvas.height)},a=function(B){var O=window.devicePixelRatio||1;B.canvas.width=B.canvas.width*O,B.canvas.height=B.canvas.height*O,B.canvas.style.width=B.canvas.width/O+"px",B.canvas.style.height=B.canvas.height/O+"px",B.scale(O,O)};function o(){this._subscribers={}}o.prototype.on=function(B,O){var F=this._subscribers[B];F||(F=[],this._subscribers[B]=F),F.push({callback:O})},o.prototype.off=function(B,O){var F=this._subscribers[B];if(F)for(var N=0;NF&&(F=U)}return F}},g.prototype.getSum=function(B){var O=this._data;if(!(!O||O.length<=0)){for(var F=0,N=0;N"u")){var F=document.createElement("canvas");B&&(F.width=B),O&&(F.height=O)}return F}function w(B){B=B||{},this.gradient=B.gradient||{.25:"rgba(0, 0, 255, 1)",.55:"rgba(0, 255, 0, 1)",.85:"rgba(255, 255, 0, 1)",1:"rgba(255, 0, 0, 1)"},this.maxSize=B.maxSize||35,this.minSize=B.minSize||0,this.max=B.max||100,this.min=B.min||0,this.initPalette()}w.prototype.setMax=function(B){this.max=B||100},w.prototype.setMin=function(B){this.min=B||0},w.prototype.setMaxSize=function(B){this.maxSize=B||35},w.prototype.setMinSize=function(B){this.minSize=B||0},w.prototype.initPalette=function(){var B=this.gradient,O=new S(256,1),F=this.paletteCtx=O.getContext("2d"),N=F.createLinearGradient(0,0,256,1);for(var U in B)N.addColorStop(parseFloat(U),B[U]);F.fillStyle=N,F.fillRect(0,0,256,1)},w.prototype.getColor=function(B){var O=this.getImageData(B);return"rgba("+O[0]+", "+O[1]+", "+O[2]+", "+O[3]/256+")"},w.prototype.getImageData=function(B){var O=this.paletteCtx.getImageData(0,0,256,1).data;if(B===void 0)return O;var F=this.max,N=this.min;B>F&&(B=F),BF&&(B=F),BN)O=X+(B-N)/(F-N)*(U-X);else return U;return O},w.prototype.getLegend=function(B){var O=this.gradient,F=B.width||20,N=B.height||180,U=new S(F,N),X=U.getContext("2d"),Z=X.createLinearGradient(0,N,0,0);for(var Ae in O)Z.addColorStop(parseFloat(Ae),O[Ae]);return X.fillStyle=Z,X.fillRect(0,0,F,N),U};var b=typeof window>"u"?{}:window,E=b.devicePixelRatio||1;function T(B){var O=B/2,F=B+O,N=1e4,U=new S(F*2,F*2),X=U.getContext("2d");return X.shadowBlur=O,X.shadowColor="black",X.shadowOffsetX=X.shadowOffsetY=N,X.beginPath(),X.arc(F-N,F-N,B,0,Math.PI*2,!0),X.closePath(),X.fill(),U}function C(B,O,F){var N=A(F),U=M(F),X=N-U,Je=F.range||null,Z=0,Ae=1024;Je&&Je.length===2&&(Z=(Je[0]-U)/X*1024),Je&&Je.length===2&&(Ae=(Je[1]-U)/X*1024);for(var Re=F.maxOpacity||.8,Be=F.minOpacity||0,Je=F.range,Xe=3,_t=B.length,rt;Xe<_t;Xe+=4)rt=B[Xe]*4,B[Xe]/256>Re&&(B[Xe]=256*Re),B[Xe]/256=Z&&rt<=Ae?(B[Xe-3]=O[rt],B[Xe-2]=O[rt+1],B[Xe-1]=O[rt+2]):B[Xe]=0}function A(B){var O=B.max||100;return O}function M(B){var O=B.min||0;return O}function I(B,O,F){var N=A(F),U=M(F),X=F._size;X==null&&(X=F.size,X==null&&(X=13));var Z=new w({gradient:F.gradient,max:N,min:U}),Ae=T(X),Re=Ae.width/2,Be=Ae.height/2,Je=O,Xe={};Je.forEach(function(Ht,Yt){var ne=Ht.count===void 0?1:Ht.count,ye=Math.min(1,ne/N).toFixed(2);Xe[ye]=Xe[ye]||[],Xe[ye].push(Ht)});for(var _t in Xe)if(!isNaN(_t)){var rt=Xe[_t];B.beginPath(),F.withoutAlpha||(B.globalAlpha=_t),B.strokeStyle=Z.getColor(_t*N),rt.forEach(function(Ht,Yt){if(!!Ht.geometry){var ne=Ht.geometry._coordinates||Ht.geometry.coordinates,ye=Ht.geometry.type;if(ye==="Point"){var Ue=Ht.count===void 0?1:Ht.count;B.globalAlpha=Ue/N,B.drawImage(Ae,ne[0]-Re,ne[1]-Be)}else if(ye==="LineString"){var Ue=Ht.count===void 0?1:Ht.count;B.globalAlpha=Ue/N,B.beginPath(),_.draw(B,Ht,F),B.stroke()}}})}}function R(B,O,F){if(!(B.canvas.width<=0||B.canvas.height<=0)){var N=F.strength||.3;B.strokeStyle="rgba(0,0,0,"+N+")";var U=new S(B.canvas.width,B.canvas.height),X=U.getContext("2d");X.scale(E,E),F=F||{};var Z=O instanceof g?O.get():O;B.save();var Ae=new w({gradient:F.gradient});if(I(X,Z,F),!F.absolute){var Re=X.getImageData(0,0,B.canvas.width,B.canvas.height);C(Re.data,Ae.getImageData(),F),B.putImageData(Re,0,0),B.restore()}Ae=null,U=null}}var k={draw:R},D={draw:function(O,F,N){O.save();var U=F instanceof g?F.get():F,X={},Z=N._size||N.size||50,Ae="enableCluster"in N?N.enableCluster:!0,Re=N.offset||{x:0,y:0},Be=new w({min:N.min||0,max:N.max||100,gradient:N.gradient});if(Ae){for(var Ht=0;Ht1){var Ue=Yt-ne,Bt=ne+(Ytee*ee+Se*Se&&(ne=Bt+(Ht&1?1:-1)/2,Ht=$t)}var Ze=ne+"-"+Ht,Ct=Je[Ze];Ct?Ct.push(U[Xe]):(Ct=Je[Ze]=[U[Xe]],Ct.i=ne,Ct.j=Ht,Ct.x=(ne+(Ht&1?1/2:0))*Re,Ct.y=Ht*Be)}var vr=new w({max:N.max||100,maxSize:Ae,gradient:N.gradient});for(var X in Je){var Cr=Je[X];O.beginPath();for(var Jr=0;Jr<6;Jr++){var nn=G({x:Cr.x+Z.x,y:Cr.y+Z.y},Ae,Jr);O.lineTo(nn[0],nn[1])}O.closePath();for(var Dn=0,Xe=0;Xe1||Ht<-1||Ht>1||(Be.push(rt,Ht),Je++)}var Yt=new Float32Array(Be),ne=Je,ye=B.createBuffer();B.bindBuffer(B.ARRAY_BUFFER,ye),B.bufferData(B.ARRAY_BUFFER,Yt,B.STATIC_DRAW),B.vertexAttribPointer(U,2,B.FLOAT,!1,0,0),B.enableVertexAttribArray(U),B.vertexAttrib1f(X,F._size);var Ue=q(F.fillStyle||"red");B.uniform4f(Z,Ue[0]/255,Ue[1]/255,Ue[2]/255,Ue[3]/255),B.drawArrays(B.POINTS,0,ne)}}var me={draw:se};function Ce(B,O,F){F=F||2;var N=O&&O.length,U=N?O[0]*F:B.length,X=Le(B,0,U,F,!0),Z=[];if(!X)return Z;var Ae,Re,Be,Je,Xe,_t,rt;if(N&&(X=qe(B,O,X,F)),B.length>80*F){Ae=Be=B[0],Re=Je=B[1];for(var Ht=F;HtBe&&(Be=Xe),_t>Je&&(Je=_t);rt=Math.max(Be-Ae,Je-Re)}return yt(X,Z,F,Ae,Re,rt),Z}function Le(B,O,F,N,U){var X,Z;if(U===Rn(B,O,F,N)>0)for(X=O;X=O;X-=N)Z=jr(X,B[X],B[X+1],Z);return Z&&wt(Z,Z.next)&&(pn(Z),Z=Z.next),Z}function re(B,O){if(!B)return B;O||(O=B);var F=B,N;do if(N=!1,!F.steiner&&(wt(F,F.next)||mt(F.prev,F,F.next)===0)){if(pn(F),F=O=F.prev,F===F.next)return null;N=!0}else F=F.next;while(N||F!==O);return O}function yt(B,O,F,N,U,X,Z){if(!!B){!Z&&X&&Oe(B,N,U,X);for(var Ae=B,Re,Be;B.prev!==B.next;){if(Re=B.prev,Be=B.next,X?st(B,N,U,X):je(B)){O.push(Re.i/F),O.push(B.i/F),O.push(Be.i/F),pn(B),B=Be.next,Ae=Be.next;continue}if(B=Be,B===Ae){Z?Z===1?(B=Nt(B,O,F),yt(B,O,F,N,U,X,2)):Z===2&&Zt(B,O,F,N,U,X):yt(re(B),O,F,N,U,X,1);break}}}}function je(B){var O=B.prev,F=B,N=B.next;if(mt(O,F,N)>=0)return!1;for(var U=B.next.next;U!==B.prev;){if(Qe(O.x,O.y,F.x,F.y,N.x,N.y,U.x,U.y)&&mt(U.prev,U,U.next)>=0)return!1;U=U.next}return!0}function st(B,O,F,N){var U=B.prev,X=B,Z=B.next;if(mt(U,X,Z)>=0)return!1;for(var Ae=U.xX.x?U.x>Z.x?U.x:Z.x:X.x>Z.x?X.x:Z.x,Je=U.y>X.y?U.y>Z.y?U.y:Z.y:X.y>Z.y?X.y:Z.y,Xe=We(Ae,Re,O,F,N),_t=We(Be,Je,O,F,N),rt=B.nextZ;rt&&rt.z<=_t;){if(rt!==B.prev&&rt!==B.next&&Qe(U.x,U.y,X.x,X.y,Z.x,Z.y,rt.x,rt.y)&&mt(rt.prev,rt,rt.next)>=0)return!1;rt=rt.nextZ}for(rt=B.prevZ;rt&&rt.z>=Xe;){if(rt!==B.prev&&rt!==B.next&&Qe(U.x,U.y,X.x,X.y,Z.x,Z.y,rt.x,rt.y)&&mt(rt.prev,rt,rt.next)>=0)return!1;rt=rt.prevZ}return!0}function Nt(B,O,F){var N=B;do{var U=N.prev,X=N.next.next;!wt(U,X)&&pt(U,N,N.next,X)&&kt(U,X)&&kt(X,U)&&(O.push(U.i/F),O.push(N.i/F),O.push(X.i/F),pn(N),pn(N.next),N=B=X),N=N.next}while(N!==B);return N}function Zt(B,O,F,N,U,X){var Z=B;do{for(var Ae=Z.next.next;Ae!==Z.prev;){if(Z.i!==Ae.i&&zt(Z,Ae)){var Re=Sr(Z,Ae);Z=re(Z,Z.next),Re=re(Re,Re.next),yt(Z,O,F,N,U,X),yt(Re,O,F,N,U,X);return}Ae=Ae.next}Z=Z.next}while(Z!==B)}function qe(B,O,F,N){var U=[],X,Z,Ae,Re,Be;for(X=0,Z=O.length;X=F.next.y){var Ae=F.x+(U-F.y)*(F.next.x-F.x)/(F.next.y-F.y);if(Ae<=N&&Ae>X){if(X=Ae,Ae===N){if(U===F.y)return F;if(U===F.next.y)return F.next}Z=F.x=F.x&&F.x>=Be&&Qe(UZ.x)&&kt(F,B)&&(Z=F,Xe=_t)),F=F.next;return Z}function Oe(B,O,F,N){var U=B;do U.z===null&&(U.z=We(U.x,U.y,O,F,N)),U.prevZ=U.prev,U.nextZ=U.next,U=U.next;while(U!==B);U.prevZ.nextZ=null,U.prevZ=null,J(U)}function J(B){var O,F,N,U,X,Z,Ae,Re,Be=1;do{for(F=B,B=null,X=null,Z=0;F;){for(Z++,N=F,Ae=0,O=0;O0||Re>0&&N;)Ae===0?(U=N,N=N.nextZ,Re--):Re===0||!N||F.z<=N.z?(U=F,F=F.nextZ,Ae--):(U=N,N=N.nextZ,Re--),X?X.nextZ=U:B=U,U.prevZ=X,X=U;F=N}X.nextZ=null,Be*=2}while(Z>1);return B}function We(B,O,F,N,U){return B=32767*(B-F)/U,O=32767*(O-N)/U,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,B|O<<1}function Tt(B){var O=B,F=B;do O.x=0&&(B-Z)*(N-Ae)-(F-Z)*(O-Ae)>=0&&(F-Z)*(X-Ae)-(U-Z)*(N-Ae)>=0}function zt(B,O){return B.next.i!==O.i&&B.prev.i!==O.i&&!ar(B,O)&&kt(B,O)&&kt(O,B)&&Dr(B,O)}function mt(B,O,F){return(O.y-B.y)*(F.x-O.x)-(O.x-B.x)*(F.y-O.y)}function wt(B,O){return B.x===O.x&&B.y===O.y}function pt(B,O,F,N){return wt(B,O)&&wt(F,N)||wt(B,N)&&wt(F,O)?!0:mt(B,O,F)>0!=mt(B,O,N)>0&&mt(F,N,B)>0!=mt(F,N,O)>0}function ar(B,O){var F=B;do{if(F.i!==B.i&&F.next.i!==B.i&&F.i!==O.i&&F.next.i!==O.i&&pt(F,F.next,B,O))return!0;F=F.next}while(F!==B);return!1}function kt(B,O){return mt(B.prev,B,B.next)<0?mt(B,O,B.next)>=0&&mt(B,B.prev,O)>=0:mt(B,O,B.prev)<0||mt(B,B.next,O)<0}function Dr(B,O){var F=B,N=!1,U=(B.x+O.x)/2,X=(B.y+O.y)/2;do F.y>X!=F.next.y>X&&U<(F.next.x-F.x)*(X-F.y)/(F.next.y-F.y)+F.x&&(N=!N),F=F.next;while(F!==B);return N}function Sr(B,O){var F=new Jn(B.i,B.x,B.y),N=new Jn(O.i,O.x,O.y),U=B.next,X=O.prev;return B.next=O,O.prev=B,F.next=U,U.prev=F,N.next=F,F.prev=N,X.next=N,N.prev=X,N}function jr(B,O,F,N){var U=new Jn(B,O,F);return N?(U.next=N.next,U.prev=N,N.next.prev=U,N.next=U):(U.prev=U,U.next=U),U}function pn(B){B.next.prev=B.prev,B.prev.next=B.next,B.prevZ&&(B.prevZ.nextZ=B.nextZ),B.nextZ&&(B.nextZ.prevZ=B.prevZ)}function Jn(B,O,F){this.i=B,this.x=O,this.y=F,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ce.deviation=function(B,O,F,N){var U=O&&O.length,X=U?O[0]*F:B.length,Z=Math.abs(Rn(B,0,X,F));if(U)for(var Ae=0,Re=O.length;Ae0&&(N+=B[U-1].length,F.holes.push(N))}return F};var hi=["attribute vec4 a_Position;","void main() {","gl_Position = a_Position;","gl_PointSize = 30.0;","}"].join(""),yn=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join("");function Oi(B,O,F){if(!!O){B.clear(B.COLOR_BUFFER_BIT),B.viewport(0,0,B.canvas.width,B.canvas.height);var N=V(B,hi,yn);B.enable(B.BLEND),B.blendFunc(B.SRC_ALPHA,B.ONE);var U=B.canvas.width/2,X=B.canvas.height/2;B.bindBuffer(B.ARRAY_BUFFER,B.createBuffer()),B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,B.createBuffer());var Z=B.getAttribLocation(N,"a_Position");B.vertexAttribPointer(Z,2,B.FLOAT,!1,0,0),B.enableVertexAttribArray(Z);var Ae=B.getUniformLocation(N,"u_FragColor"),Re=q(F.fillStyle||"red");B.uniform4f(Ae,Re[0]/255,Re[1]/255,Re[2]/255,Re[3]/255),B.lineWidth(F.lineWidth||1);for(var Be=[],Je=[],Xe=65536,_t=0,rt=0,Ht=O.length;rtXe&&(B.bufferData(B.ARRAY_BUFFER,new Float32Array(Be),B.STATIC_DRAW),B.bufferData(B.ELEMENT_ARRAY_BUFFER,new Uint16Array(Je),B.STATIC_DRAW),B.drawElements(B.TRIANGLES,Je.length,B.UNSIGNED_SHORT,0),Be.length=0,Je.length=0,_t=0);for(var ye=0;ye0&&(U[0].geometry.type=="LineString"?Q.draw(O,U,N):U[0].geometry.type=="Polygon"||U[0].geometry.type=="MultiPolygon"?oi.draw(O,U,N):me.draw(O,U,N))}};function ws(B,O){O=O||{};for(var F=[],N=0;N0&&(F=F.concat(U))}return F}function Sl(B,O,Ae){if(!B||!O)return null;var N=function(vr){return 1-2*vr+vr*vr},U=function(vr){return 2*vr-2*vr*vr},X=function(vr){return vr*vr},Z=[],Ae=Ae||40,Re,Be,Je,Xe,_t,rt,Ht=0,Yt=0;if(typeof O>"u"){typeof Z<"u"&&(Z=[]);return}var ne=parseFloat(B.lat),ye=parseFloat(O.lat),Ue=parseFloat(B.lng),Bt=parseFloat(O.lng);for(Bt>Ue&&parseFloat(Bt-Ue)>180&&Ue<0&&(Ue=parseFloat(180+180+Ue),Bt=parseFloat(180+180+Bt)),rt=0,ye==ne?(Re=0,Be=Ue-Bt):Bt==Ue?(Re=Math.PI/2,Be=ne-ye):(Re=Math.atan((ye-ne)/(Bt-Ue)),Be=(ye-ne)/Math.sin(Re)),rt==0&&(rt=Re+Math.PI/5),Je=Be/2,_t=Je*Math.cos(rt)+Ue,Xe=Je*Math.sin(rt)+ne,Ht=0;Ht0?$t-360:$t,ee]),Yt=Yt+1/Ae}return Z}var Os={getPoints:ws},no=function(){var O={},F=[],N=[],U=[],X=.1,Z=.1,Ae=1,Re=2,Be=6,Je=70,Xe=.6666667,_t=.6,rt=1e-8;function Ht(Ft,nr){return Ft.x*nr.x+Ft.y*nr.y}function Yt(Ft){return{x:O[Ft.target].x-O[Ft.source].x,y:O[Ft.target].y-O[Ft.source].y}}function ne(Ft){return Math.sqrt(Math.pow(O[Ft.source].x-O[Ft.target].x,2)+Math.pow(O[Ft.source].y-O[Ft.target].y,2))}function ye(Ft){return Math.sqrt(Math.pow(Ft.source.x-Ft.target.x,2)+Math.pow(Ft.source.y-Ft.target.y,2))}function Ue(Ft){var nr=(O[Ft.source].x+O[Ft.target].x)/2,Wn=(O[Ft.source].y+O[Ft.target].y)/2;return{x:nr,y:Wn}}function Bt(Ft){for(var nr=0,Wn=1;Wnrt||Math.abs(Fo.y)>rt){var Su=1/Math.pow(ye({source:U[Ts[ko]][nr],target:U[Ft][nr]}),1);Zi.x+=Fo.x*Su,Zi.y+=Fo.y*Su}}return Zi}function Jr(Ft,nr,Wn){for(var Zi=X/(ne(F[Ft])*(nr+1)),Ts=[{x:0,y:0}],ko=1;koTs;){var Jf=Ts/Su,xg=U[nr][Fo-1].x,sF=U[nr][Fo-1].y;xg+=Jf*(U[nr][Fo].x-U[nr][Fo-1].x),sF+=Jf*(U[nr][Fo].y-U[nr][Fo-1].y),ko.push({x:xg,y:sF}),Su-=Ts,Ts=Zi}Ts-=Su}ko.push(O[F[nr].target]),U[nr]=ko}}function Dn(Ft,nr){var Wn=Math.abs(Ht(Yt(Ft),Yt(nr))/(ne(Ft)*ne(nr)));return Wn}function si(Ft,nr){var Wn=(ne(Ft)+ne(nr))/2,Zi=2/(Wn/Math.min(ne(Ft),ne(nr))+Math.max(ne(Ft),ne(nr))/Wn);return Zi}function An(Ft,nr){var Wn=(ne(Ft)+ne(nr))/2,Zi={x:(O[Ft.source].x+O[Ft.target].x)/2,y:(O[Ft.source].y+O[Ft.target].y)/2},Ts={x:(O[nr.source].x+O[nr.target].x)/2,y:(O[nr.source].y+O[nr.target].y)/2},ko=Wn/(Wn+$t(Zi,Ts));return ko}function qi(Ft,nr){var Wn=ee(O[nr.source],{source:O[Ft.source],target:O[Ft.target]}),Zi=ee(O[nr.target],{source:O[Ft.source],target:O[Ft.target]}),Ts={x:(Wn.x+Zi.x)/2,y:(Wn.y+Zi.y)/2},ko={x:(O[Ft.source].x+O[Ft.target].x)/2,y:(O[Ft.source].y+O[Ft.target].y)/2},Fo=Math.max(0,1-2*$t(ko,Ts)/$t(Wn,Zi));return Fo}function _o(Ft,nr){return Math.min(qi(Ft,nr),qi(nr,Ft))}function cs(Ft,nr){var Wn=Dn(Ft,nr)*si(Ft,nr)*An(Ft,nr)*_o(Ft,nr);return Wn}function wl(Ft,nr){return cs(Ft,nr)>=_t}function xu(){for(var Ft=0;Ft=F.length-1));X++);this.splitList.other=F[F.length-1]},vo.prototype.getLegend=function(B){var O=this.splitList,F=document.createElement("div");F.style.cssText="background:#fff; padding: 5px; border: 1px solid #ccc;";var N="";for(var U in O)N+='

    '+U+"
    ";return F.innerHTML=N,F};function No(B){this.splitList=B||[{start:0,value:"red"}]}No.prototype.get=function(B){for(var O=this.splitList,F=!1,N=0;N=O[N].start)&&(O[N].end===void 0||O[N].end!==void 0&&B"u"?{}:window,Rs=hs.BMap||hs.BMapGL;Rs&&(Lo.prototype=new Rs.Overlay,Lo.prototype.initialize=function(B){this._map=B;var O=this.canvas=document.createElement("canvas");O.style.cssText="position:absolute;left:0;top:0;z-index:"+this.zIndex+";user-select:none;",O.style.mixBlendMode=this.mixBlendMode,this.adjustSize();var F=B.getPanes()[this.paneName];F||(F=B.getPanes().floatShadow),F.appendChild(O);var N=this;return B.addEventListener("resize",function(){N.adjustSize(),N._draw()}),B.addEventListener("update",function(){N._draw()}),this.options.updateImmediate&&setTimeout(function(){N._draw()},100),this.canvas},Lo.prototype.adjustSize=function(){var B=this._map.getSize(),O=this.canvas,F=this.devicePixelRatio=hs.devicePixelRatio||1;O.width=B.width*F,O.height=B.height*F,this.context=="2d"&&O.getContext(this.context).scale(F,F),O.style.width=B.width+"px",O.style.height=B.height+"px"},Lo.prototype.draw=function(){var B=this;this.options.updateImmediate?B._draw():(clearTimeout(B.timeoutID),B.timeoutID=setTimeout(function(){B._draw()},15))},Lo.prototype._draw=function(){var B=this._map,O=B.getSize(),F=B.getCenter();if(F){var N=B.pointToOverlayPixel(F);this.canvas.style.left=N.x-O.width/2+"px",this.canvas.style.top=N.y-O.height/2+"px",this.dispatchEvent("draw"),this.options.update&&this.options.update.call(this)}},Lo.prototype.getContainer=function(){return this.canvas},Lo.prototype.show=function(){this.canvas||this._map.addOverlay(this),this.canvas.style.display="block"},Lo.prototype.hide=function(){this.canvas.style.display="none"},Lo.prototype.setZIndex=function(B){this.zIndex=B,this.canvas.style.zIndex=this.zIndex},Lo.prototype.getZIndex=function(){return this.zIndex});var Pn=Pn||function(){var B=[];return{getAll:function(){return B},removeAll:function(){B=[]},add:function(F){B.push(F)},remove:function(F){var N=B.indexOf(F);N!==-1&&B.splice(N,1)},update:function(F,N){if(B.length===0)return!1;var U=0;for(F=F!==void 0?F:Pn.now();U"u"&&typeof process<"u"?Pn.now=function(){var B=process.hrtime();return B[0]*1e3+B[1]/1e6}:typeof window<"u"&&window.performance!==void 0&&window.performance.now!==void 0?Pn.now=window.performance.now.bind(window.performance):Date.now!==void 0?Pn.now=Date.now:Pn.now=function(){return new Date().getTime()},Pn.Tween=function(B){var O=B,F={},N={},U={},X=1e3,Z=0,Ae,Re=!1,Be=!1,Je=0,Xe=null,_t=Pn.Easing.Linear.None,rt=Pn.Interpolation.Linear,Ht=[],Yt=null,ne=!1,ye=null,Ue=null,Bt=null;this.to=function($t,ee){return N=$t,ee!==void 0&&(X=ee),this},this.start=function($t){Pn.add(this),Be=!0,ne=!1,Xe=$t!==void 0?$t:Pn.now(),Xe+=Je;for(var ee in N){if(N[ee]instanceof Array){if(N[ee].length===0)continue;N[ee]=[O[ee]].concat(N[ee])}O[ee]!==void 0&&(F[ee]=O[ee],F[ee]instanceof Array||(F[ee]*=1),U[ee]=F[ee]||0)}return this},this.stop=function(){return Be?(Pn.remove(this),Be=!1,Bt!==null&&Bt.call(O,O),this.stopChainedTweens(),this):this},this.end=function(){return this.update(Xe+X),this},this.stopChainedTweens=function(){for(var $t=0,ee=Ht.length;$t1?1:Se,Ze=_t(Se);for(ee in N)if(F[ee]!==void 0){var Ct=F[ee]||0,vr=N[ee];vr instanceof Array?O[ee]=rt(vr,Ze):(typeof vr=="string"&&(vr.charAt(0)==="+"||vr.charAt(0)==="-"?vr=Ct+parseFloat(vr):vr=parseFloat(vr)),typeof vr=="number"&&(O[ee]=Ct+(vr-Ct)*Ze))}if(ye!==null&&ye.call(O,Ze),Se===1)if(Z>0){isFinite(Z)&&Z--;for(ee in U){if(typeof N[ee]=="string"&&(U[ee]=U[ee]+parseFloat(N[ee])),Re){var Cr=U[ee];U[ee]=N[ee],N[ee]=Cr}F[ee]=U[ee]}return Ae!==void 0?Xe=$t+Ae:Xe=$t+Je,!0}else{Ue!==null&&Ue.call(O,O);for(var Jr=0,nn=Ht.length;Jr1?Z(O[N],O[N-1],N-U):Z(O[X],O[X+1>N?N:X+1],U-X)},Bezier:function(O,F){for(var N=0,U=O.length-1,X=Math.pow,Z=Pn.Interpolation.Utils.Bernstein,Ae=0;Ae<=U;Ae++)N+=X(1-F,U-Ae)*X(F,Ae)*O[Ae]*Z(U,Ae);return N},CatmullRom:function(O,F){var N=O.length-1,U=N*F,X=Math.floor(U),Z=Pn.Interpolation.Utils.CatmullRom;return O[0]===O[N]?(F<0&&(X=Math.floor(U=N*(1+F))),Z(O[(X-1+N)%N],O[X],O[(X+1)%N],O[(X+2)%N],U-X)):F<0?O[0]-(Z(O[0],O[0],O[1],O[1],-U)-O[0]):F>1?O[N]-(Z(O[N],O[N],O[N-1],O[N-1],U-N)-O[N]):Z(O[X?X-1:0],O[X],O[N1;N--)F*=N;return B[O]=F,F}}(),CatmullRom:function(O,F,N,U,X){var Z=(N-O)*.5,Ae=(U-F)*.5,Re=X*X,Be=X*Re;return(2*F-2*N+Z+Ae)*Be+(-3*F+3*N-2*Z-Ae)*Re+Z*X+F}}};function mo(B,O){var F=O[0]-B[0],N=O[1]-B[1],U=360*Math.atan(N/F)/(2*Math.PI);return O[0]U&&N>X}var qt={},fr={},Wr={draw:function(O,F,N){for(var U=F instanceof g?F.get():F,X=function(){var Je=U[Z];if(Je.geometry)if(Re=Je.icon||N.icon,typeof Re=="string"){var Xe=window.encodeURIComponent(Re),_t=qt[Xe];_t?gr(_t,N,O,Je):(fr[Xe]||(fr[Xe]=[],Ar(Xe,function(rt,Ht){fr[Ht]&&fr[Ht].forEach(function(Yt){return Yt(rt)}),fr[Ht]=null,qt[Ht]=rt},function(rt){fr[rt]&&fr[rt].forEach(function(Ht){return Ht("error")}),fr[rt]=null,qt[rt]="error"})),fr[Xe].push(function(rt){gr(rt,N,O,Je)}))}else gr(Re,N,O,Je)},Z=0,Ae=U.length;Z>1;bi(B,O,Z,N,U,X%2),$n(B,O,F,N,Z-1,X+1),$n(B,O,F,Z+1,U,X+1)}}function bi(B,O,F,N,U,X){for(;U>N;){if(U-N>600){var Z=U-N+1,Ae=F-N+1,Re=Math.log(Z),Be=.5*Math.exp(2*Re/3),Je=.5*Math.sqrt(Re*Be*(Z-Be)/Z)*(Ae-Z/2<0?-1:1),Xe=Math.max(N,Math.floor(F-Ae*Be/Z+Je)),_t=Math.min(U,Math.floor(F+(Z-Ae)*Be/Z+Je));bi(B,O,F,Xe,_t,X)}var rt=O[2*F+X],Ht=N,Yt=U;for(qa(B,O,N,F),O[2*U+X]>rt&&qa(B,O,N,U);Htrt;)Yt--}O[2*N+X]===rt?qa(B,O,N,Yt):(Yt++,qa(B,O,Yt,U)),Yt<=F&&(N=Yt+1),F<=Yt&&(U=Yt-1)}}function qa(B,O,F,N){Qo(B,F,N),Qo(O,2*F,2*N),Qo(O,2*F+1,2*N+1)}function Qo(B,O,F){var N=B[O];B[O]=B[F],B[F]=N}function Ds(B,O,F,N,U,X,Z){for(var Ae=[0,B.length-1,0],Re=[],Be,Je;Ae.length;){var Xe=Ae.pop(),_t=Ae.pop(),rt=Ae.pop();if(_t-rt<=Z){for(var Ht=rt;Ht<=_t;Ht++)Be=O[2*Ht],Je=O[2*Ht+1],Be>=F&&Be<=U&&Je>=N&&Je<=X&&Re.push(B[Ht]);continue}var Yt=Math.floor((rt+_t)/2);Be=O[2*Yt],Je=O[2*Yt+1],Be>=F&&Be<=U&&Je>=N&&Je<=X&&Re.push(B[Yt]);var ne=(Xe+1)%2;(Xe===0?F<=Be:N<=Je)&&(Ae.push(rt),Ae.push(Yt-1),Ae.push(ne)),(Xe===0?U>=Be:X>=Je)&&(Ae.push(Yt+1),Ae.push(_t),Ae.push(ne))}return Re}function af(B,O,F,N,U,X){for(var Z=[0,B.length-1,0],Ae=[],Re=U*U;Z.length;){var Be=Z.pop(),Je=Z.pop(),Xe=Z.pop();if(Je-Xe<=X){for(var _t=Xe;_t<=Je;_t++)mh(O[2*_t],O[2*_t+1],F,N)<=Re&&Ae.push(B[_t]);continue}var rt=Math.floor((Xe+Je)/2),Ht=O[2*rt],Yt=O[2*rt+1];mh(Ht,Yt,F,N)<=Re&&Ae.push(B[rt]);var ne=(Be+1)%2;(Be===0?F-U<=Ht:N-U<=Yt)&&(Z.push(Xe),Z.push(rt-1),Z.push(ne)),(Be===0?F+U>=Ht:N+U>=Yt)&&(Z.push(rt+1),Z.push(Je),Z.push(ne))}return Ae}function mh(B,O,F,N){var U=B-F,X=O-N;return U*U+X*X}var Zl=function(O){return O[0]},jd=function(O){return O[1]},Nl=function(O,F,N,U,X){F===void 0&&(F=Zl),N===void 0&&(N=jd),U===void 0&&(U=64),X===void 0&&(X=Float64Array),this.nodeSize=U,this.points=O;for(var Z=O.length<65536?Uint16Array:Uint32Array,Ae=this.ids=new Z(O.length),Re=this.coords=new X(O.length*2),Be=0;Be=N;Re--)Z=this._cluster(Z,Re),this.trees[Re]=new Nl(Z,of,X0,X,Float32Array);return this},js.prototype.getClusters=function(O,F){var N=((O[0]+180)%360+360)%360-180,U=Math.max(-90,Math.min(90,O[1])),X=O[2]===180?180:((O[2]+180)%360+360)%360-180,Z=Math.max(-90,Math.min(90,O[3]));if(O[2]-O[0]>=360)N=-180,X=180;else if(N>X){var Ae=this.getClusters([N,U,180,Z],F),Re=this.getClusters([-180,U,X,Z],F);return Ae.concat(Re)}for(var Be=this.trees[this._limitZoom(F)],Je=Be.range(vg(N),qf(Z),vg(X),qf(U)),Xe=[],_t=0,rt=Je;_tF&&(Yt+=Bt.numPoints||1)}if(Yt>=Re){for(var $t=Xe.x*Ht,ee=Xe.y*Ht,Se=Ae&&Ht>1?this._map(Xe,!0):null,Ze=(Je<<5)+(F+1)+this.points.length,Ct=0,vr=rt;Ct1)for(var Dn=0,si=rt;Dn>5},js.prototype._getOriginZoom=function(O){return(O-this.points.length)%32},js.prototype._map=function(O,F){if(O.numPoints)return F?Kf({},O.properties):O.properties;var N=this.points[O.index].properties,U=this.options.map(N);return F&&U===N?Kf({},U):U};function fg(B,O,F,N,U){return{x:B,y:O,zoom:1/0,id:F,parentId:-1,numPoints:N,properties:U}}function dg(B,O){var F=B.geometry.coordinates,N=F[0],U=F[1];return{x:vg(N),y:qf(U),zoom:1/0,index:O,parentId:-1}}function Xd(B){return{type:"Feature",id:B.id,properties:Yd(B),geometry:{type:"Point",coordinates:[Zf(B.x),pg(B.y)]}}}function Yd(B){var O=B.numPoints,F=O>=1e4?Math.round(O/1e3)+"k":O>=1e3?Math.round(O/100)/10+"k":O;return Kf(Kf({},B.properties),{cluster:!0,cluster_id:B.id,point_count:O,point_count_abbreviated:F})}function vg(B){return B/360+.5}function qf(B){var O=Math.sin(B*Math.PI/180),F=.5-.25*Math.log((1+O)/(1-O))/Math.PI;return F<0?0:F>1?1:F}function Zf(B){return(B-.5)*360}function pg(B){var O=(180-B*360)*Math.PI/180;return 360*Math.atan(Math.exp(O))/Math.PI-90}function Kf(B,O){for(var F in O)B[F]=O[F];return B}function of(B){return B.x}function X0(B){return B.y}typeof window<"u"&&requestAnimationFrame(Y0);function Y0(B){requestAnimationFrame(Y0),Pn.update(B)}var Kl=function(){function B(O,F,N){h(this,B),F instanceof g||(F=new g(F)),this.dataSet=F,this.map=O,N.draw==="cluster"&&this.refreshCluster(N)}return c(B,[{key:"refreshCluster",value:function(F){F=F||this.options,this.supercluster=new js({maxZoom:F.maxZoom||19,radius:F.clusterRadius||100,minPoints:F.minPoints||2,extent:F.extent||512}),this.supercluster.load(this.dataSet.get()),this.supercluster.trees.forEach(function(N){var U=0,X=1/0;N.points.forEach(function(Z){U=Math.max(Z.numPoints||0,U),X=Math.min(Z.numPoints||1/0,X)}),N.max=U,N.min=X}),this.clusterDataSet=new g}},{key:"getDefaultContextConfig",value:function(){return{globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0,strokeStyle:"#000000",fillStyle:"#000000",shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0)",lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,lineDashOffset:0,font:"10px sans-serif",textAlign:"start",textBaseline:"alphabetic"}}},{key:"initDataRange",value:function(F){var N=this;if(N.intensity=new w({maxSize:N.options.maxSize,minSize:N.options.minSize,gradient:N.options.gradient,max:N.options.max||this.dataSet.getMax("count")}),N.category=new vo(N.options.splitList),N.choropleth=new No(N.options.splitList),N.options.splitList===void 0&&N.category.generateByDataSet(this.dataSet,N.options.color),N.options.splitList===void 0){var U=N.options.min||this.dataSet.getMin("count"),X=N.options.max||this.dataSet.getMax("count");N.choropleth.generateByMinMax(U,X)}}},{key:"getLegend",value:function(F){this.options.draw;var N=this;if(N.options.draw=="intensity"||N.options.draw=="heatmap")return this.intensity.getLegend(F);if(N.options.draw=="category")return this.category.getLegend(F)}},{key:"processData",value:function(F){var N=this,U=N.options.draw;if(U=="bubble"||U=="intensity"||U=="category"||U=="choropleth"||U=="simple")for(var X=0;X=this.getZoom())?X=this.clusterDataSet.get():X=this.dataSet.get();for(var Z=0;Z-1){if(U.isPointInStroke&&U.isPointInStroke(Re,Be))return X[Z]}else if(U.isPointInPath(Re,Be))return X[Z]}}},{key:"getClusterPoints",value:function(F){var N=this;if(F.type!=="Feature")return[];var U=this.supercluster.getChildren(F.id);return U.map(function(X){return X.type==="Feature"?N.getClusterPoints(X):X}).flat()}},{key:"clickEvent",value:function(F,N){if(!!this.options.methods){var U=this.isPointInPath(this.getContext(),F);if(U){if(this.options.draw==="cluster"){var X=this.getClusterPoints(U);U.children=X}this.options.methods.click(U,N)}else this.options.methods.click(null,N)}}},{key:"mousemoveEvent",value:function(F,N){if(!!this.options.methods){var U=this.isPointInPath(this.getContext(),F);if(U){if(this.options.draw==="cluster"){var X=this.getClusterPoints(U);U.children=X}this.options.methods.mousemove(U,N)}else this.options.methods.mousemove(null,N)}}},{key:"tapEvent",value:function(F,N){if(!!this.options.methods){var U=this.isPointInPath(this.getContext(),F);if(U){if(this.options.draw==="cluster"){var X=this.getClusterPoints(U);U.children=X}this.options.methods.tap(U,N)}else this.options.methods.tap(null,N)}}},{key:"update",value:function(F,N){var U=this,X=F.options,Z=U.options;for(var Ae in X)Z[Ae]=X[Ae];U.init(Z),N!==!1&&U.draw()}},{key:"setOptions",value:function(F){var N=this;N.dataSet.reset(),N.init(F),N.draw()}},{key:"set",value:function(F){var N=this,U=this.getContext(),X=this.getDefaultContextConfig();for(var Z in X)U[Z]=X[Z];N.init(F.options),N.draw()}},{key:"destroy",value:function(){this.unbindEvent(),this.hide()}},{key:"initAnimator",value:function(){var F=this,N=F.options.animation;if(F.options.draw=="time"||F.isEnabledTime()){N.stepsRange||(N.stepsRange={start:this.dataSet.getMin("time")||0,end:this.dataSet.getMax("time")||0}),this.steps={step:N.stepsRange.start},F.animator=new Pn.Tween(this.steps).onUpdate(function(){F._canvasUpdate(this.step)}).repeat(1/0),this.addAnimatorEvent();var U=N.duration*1e3||5e3;F.animator.to({step:N.stepsRange.end},U),F.animator.start()}else F.animator&&F.animator.stop()}},{key:"addAnimatorEvent",value:function(){}},{key:"animatorMovestartEvent",value:function(){var F=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=F.stepsRange.start,this.animator.stop())}},{key:"animatorMoveendEvent",value:function(){this.isEnabledTime()&&this.animator&&this.animator.start()}}]),B}(),sf=typeof window>"u"?{}:window,mu=sf.BMap||sf.BMapGL,bs=function(B){d(O,B);function O(F,N,U){h(this,O);var X=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,N,U));X.map=F,X.options=U||{},X.dataSet=N;var Z=new Lo({map:F,zIndex:X.options.zIndex,update:X._canvasUpdate.bind(X)});X.init(X.options),X.canvasLayer=Z,X.transferToMercator();var Ae=X;return N.on("change",function(){Ae.transferToMercator(),Z.draw()}),X.ctx=Z.canvas.getContext("2d"),X.start(),X}return c(O,[{key:"draw",value:function(){this.canvasLayer.draw()}},{key:"init",value:function(N){var U=this;U.options=N,this.initDataRange(N),this.context=U.options.context||"2d",U.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(U.options.zIndex),U.options.max&&this.intensity.setMax(U.options.max),U.options.min&&this.intensity.setMin(U.options.min),this.initAnimator()}},{key:"transferToMercator",value:function(){var N=this.map,U=N.getMapType(),X;if(U.getProjection?X=U.getProjection():X={lngLatToPoint:function(Re){var Be=N.lnglatToMercator(Re.lng,Re.lat);return{x:Be[0],y:Be[1]}}},this.options.coordType!=="bd09mc"){var Z=this.dataSet.get();Z=this.dataSet.transferCoordinate(Z,function(Ae){var Re=X.lngLatToPoint({lng:Ae[0],lat:Ae[1]});return[Re.x,Re.y]},"coordinates","coordinates_mercator"),this.dataSet._set(Z)}}},{key:"_canvasUpdate",value:function(){var N=this.ctx;if(!!N){var U=this.map,X,Z;U.getMapType().getProjection?(X=U.getMapType().getProjection(),Z=X.lngLatToPoint(U.getCenter())):(Z={x:U.getCenter().lng,y:U.getCenter().lat},Z.x>-180&&Z.x<180&&(Z=U.lnglatToMercator(Z.x,Z.y),Z={x:Z[0],y:Z[1]}),X={lngLatToPoint:function(Xe){var _t=U.lnglatToMercator(Xe.lng,Xe.lat);return{x:_t[0],y:_t[1]}}});var Ae;X.getZoomUnits?Ae=X.getZoomUnits(U.getZoom()):Ae=Math.pow(2,18-U.getZoom());var Re=new mu.Pixel(Z.x-U.getSize().width/2*Ae,Z.y+U.getSize().height/2*Ae);i(N);var Be={fromColumn:this.options.coordType=="bd09mc"?"coordinates":"coordinates_mercator",transferCoordinate:function(Xe){if(!!Xe){var _t=(Xe[0]-Re.x)/Ae,rt=(Re.y-Xe[1])/Ae;return[_t,rt]}}};this.data=this.dataSet.get(Be),this.processData(this.data),this.drawAnimation()}}},{key:"drawAnimation",value:function(){var N=this.ctx,U=this.data;if(!!U){N.save(),N.globalCompositeOperation="destination-out",N.fillStyle="rgba(0, 0, 0, .1)",N.fillRect(0,0,N.canvas.width,N.canvas.height),N.restore(),N.save(),this.options.shadowColor&&(N.shadowColor=this.options.shadowColor),this.options.shadowBlur&&(N.shadowBlur=this.options.shadowBlur),this.options.globalAlpha&&(N.globalAlpha=this.options.globalAlpha),this.options.globalCompositeOperation&&(N.globalCompositeOperation=this.options.globalCompositeOperation);for(var X=this.options,Z=0;ZAe&&(U[Z]._size=Re),N.lineWidth=1,N.strokeStyle=U[Z].strokeStyle||U[Z]._strokeStyle||X.strokeStyle||"yellow",N.stroke();var Be=U[Z].fillStyle||U[Z]._fillStyle||X.fillStyle;Be&&(N.fillStyle=Be,N.fill())}else if(U[Z].geometry.type==="LineString"){N.beginPath();var Je=U[Z].size||this.options.size||5,Re=U[Z].minSize||this.options.minSize||0;U[Z]._index===void 0&&(U[Z]._index=0);var Xe=U[Z]._index;N.arc(U[Z].geometry._coordinates[Xe][0],U[Z].geometry._coordinates[Xe][1],Je,0,Math.PI*2,!0),N.closePath(),U[Z]._index++,U[Z]._index>=U[Z].geometry._coordinates.length&&(U[Z]._index=0);var _t=U[Z].strokeStyle||X.strokeStyle,Be=U[Z].fillStyle||X.fillStyle||"yellow";N.fillStyle=Be,N.fill(),_t&&X.lineWidth&&(N.lineWidth=X.lineWidth||1,N.strokeStyle=_t,N.stroke())}N.restore()}}},{key:"animate",value:function(){this.drawAnimation();var N=this.options.animateTime||100;this.timeout=setTimeout(this.animate.bind(this),N)}},{key:"start",value:function(){this.stop(),this.animate()}},{key:"stop",value:function(){clearTimeout(this.timeout)}},{key:"unbindEvent",value:function(){}},{key:"hide",value:function(){this.canvasLayer.hide(),this.stop()}},{key:"show",value:function(){this.start()}},{key:"clearData",value:function(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}},{key:"destroy",value:function(){this.stop(),this.unbindEvent(),this.clearData(),this.map.removeOverlay(this.canvasLayer),this.canvasLayer=null}}]),O}(Kl),lf=typeof window>"u"?{}:window,gg=lf.BMap||lf.BMapGL,Wm=function(B){d(O,B);function O(F,N,U){h(this,O);var X=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,N,U)),Z=X;U=U||{},X.clickEvent=X.clickEvent.bind(X),X.mousemoveEvent=X.mousemoveEvent.bind(X),X.tapEvent=X.tapEvent.bind(X),Z.init(U),Z.argCheck(U),Z.transferToMercator();var Ae=X.canvasLayer=new Lo({map:F,context:X.context,updateImmediate:U.updateImmediate,paneName:U.paneName,mixBlendMode:U.mixBlendMode,enableMassClear:U.enableMassClear,zIndex:U.zIndex,update:function(){Z._canvasUpdate()}});return N.on("change",function(){Z.transferToMercator(),U.draw==="cluster"&&Z.refreshCluster(),Ae.draw()}),X}return c(O,[{key:"clickEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"clickEvent",this).call(this,U,N)}},{key:"mousemoveEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"mousemoveEvent",this).call(this,U,N)}},{key:"tapEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"tapEvent",this).call(this,U,N)}},{key:"bindEvent",value:function(N){this.unbindEvent();var U=this.map,X=0,Z=this;this.options.methods&&(this.options.methods.click&&(U.setDefaultCursor("default"),U.addEventListener("click",this.clickEvent)),this.options.methods.mousemove&&U.addEventListener("mousemove",this.mousemoveEvent),"ontouchend"in window.document&&this.options.methods.tap&&(U.addEventListener("touchstart",function(Ae){X=new Date}),U.addEventListener("touchend",function(Ae){new Date-X<300&&Z.tapEvent(Ae)})))}},{key:"unbindEvent",value:function(N){var U=this.map;this.options.methods&&(this.options.methods.click&&U.removeEventListener("click",this.clickEvent),this.options.methods.mousemove&&U.removeEventListener("mousemove",this.mousemoveEvent))}},{key:"transferToMercator",value:function(N){N||(N=this.dataSet);var U=this.map,X=U.getMapType(),Z;if(X.getProjection?Z=X.getProjection():Z={lngLatToPoint:function(Be){var Je=U.lnglatToMercator(Be.lng,Be.lat);return{x:Je[0],y:Je[1]}}},this.options.coordType!=="bd09mc"){var Ae=N.get();Ae=N.transferCoordinate(Ae,function(Re){if(Re[0]<-180||Re[0]>180||Re[1]<-90||Re[1]>90)return Re;var Be=Z.lngLatToPoint({lng:Re[0],lat:Re[1]});return[Be.x,Be.y]},"coordinates","coordinates_mercator"),N._set(Ae)}}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"_canvasUpdate",value:function(N){if(!!this.canvasLayer){var U=this,X=this.options.animation,Z=this.canvasLayer._map,Ae,Re;Z.getMapType().getProjection?(Ae=Z.getMapType().getProjection(),Re=Ae.lngLatToPoint(Z.getCenter())):(Re={x:Z.getCenter().lng,y:Z.getCenter().lat},Re.x>-180&&Re.x<180&&(Re=Z.lnglatToMercator(Re.x,Re.y),Re={x:Re[0],y:Re[1]}),Ae={lngLatToPoint:function(nn){var Dn=Z.lnglatToMercator(nn.lng,nn.lat);return{x:Dn[0],y:Dn[1]}}});var Be;Ae.getZoomUnits?Be=Ae.getZoomUnits(Z.getZoom()):Be=Math.pow(2,18-Z.getZoom());var Je=new gg.Pixel(Re.x-Z.getSize().width/2*Be,Re.y+Z.getSize().height/2*Be),Xe=this.getContext();if(this.isEnabledTime()){if(N===void 0){i(Xe);return}this.context=="2d"&&(Xe.save(),Xe.globalCompositeOperation="destination-out",Xe.fillStyle="rgba(0, 0, 0, .1)",Xe.fillRect(0,0,Xe.canvas.width,Xe.canvas.height),Xe.restore())}else i(Xe);if(this.context=="2d")for(var _t in this.options)Xe[_t]=this.options[_t];else Xe.clear(Xe.COLOR_BUFFER_BIT);if(!(this.options.minZoom&&Z.getZoom()this.options.maxZoom)){var rt=1;this.context!="2d"&&(rt=this.canvasLayer.devicePixelRatio);var Ht={fromColumn:this.options.coordType=="bd09mc"?"coordinates":"coordinates_mercator",transferCoordinate:function(nn){var Dn=(nn[0]-Je.x)/Be*rt,si=(Je.y-nn[1])/Be*rt;return[Dn,si]}};N!==void 0&&(Ht.filter=function(Jr){var nn=X.trails||10;return!!(N&&Jr.time>N-nn&&Jr.time=ne)){var ye=this.map.getBounds(),Ue=ye.getNorthEast(),Bt=ye.getSouthWest(),$t=this.supercluster.getClusters([Bt.lng,Bt.lat,Ue.lng,Ue.lat],ne);this.pointCountMax=this.supercluster.trees[ne].max,this.pointCountMin=this.supercluster.trees[ne].min;var ee={},Se=null,Ze=null;this.pointCountMax===this.pointCountMin?(Se=this.options.fillStyle,Ze=this.options.minSize||8):ee=new w({min:this.pointCountMin,max:this.pointCountMax,minSize:this.options.minSize||8,maxSize:this.options.maxSize||30,gradient:this.options.gradient});for(var Ct=0;Ct<$t.length;Ct++){var vr=$t[Ct];vr.properties&&vr.properties.cluster_id?($t[Ct].size=Ze||ee.getSize(vr.properties.point_count),$t[Ct].fillStyle=Se||ee.getColor(vr.properties.point_count)):$t[Ct].size=U.options.size}this.clusterDataSet.set($t),this.transferToMercator(this.clusterDataSet),Yt=U.clusterDataSet.get(Ht)}else Yt=U.dataSet.get(Ht);this.processData(Yt);var Cr=Z.pointToPixel(new gg.Point(0,0));U.options.unit=="m"?(U.options.size&&(U.options._size=U.options.size/Be),U.options.width&&(U.options._width=U.options.width/Be),U.options.height&&(U.options._height=U.options.height/Be)):(U.options._size=U.options.size,U.options._height=U.options.height,U.options._width=U.options.width),this.drawContext(Xe,Yt,U.options,Cr),U.options.updateCallback&&U.options.updateCallback(N)}}}},{key:"init",value:function(N){var U=this;U.options=N,this.initDataRange(N),this.context=U.options.context||"2d",U.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(U.options.zIndex),U.options.max&&this.intensity.setMax(U.options.max),U.options.min&&this.intensity.setMin(U.options.min),this.initAnimator(),this.bindEvent()}},{key:"getZoom",value:function(){return this.map.getZoom()}},{key:"addAnimatorEvent",value:function(){this.map.addEventListener("movestart",this.animatorMovestartEvent.bind(this)),this.map.addEventListener("moveend",this.animatorMoveendEvent.bind(this))}},{key:"show",value:function(){this.map.addOverlay(this.canvasLayer),this.bindEvent()}},{key:"hide",value:function(){this.unbindEvent(),this.map.removeOverlay(this.canvasLayer)}},{key:"draw",value:function(){this.canvasLayer&&this.canvasLayer.draw()}},{key:"clearData",value:function(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}},{key:"destroy",value:function(){this.unbindEvent(),this.clearData(),this.map.removeOverlay(this.canvasLayer),this.canvasLayer=null}}]),O}(Kl);function ho(B){this.isAdded_=!1,this.isAnimated_=!1,this.paneName_=ho.DEFAULT_PANE_NAME_,this.updateHandler_=null,this.resizeHandler_=null,this.topLeft_=null,this.centerListener_=null,this.resizeListener_=null,this.needsResize_=!0,this.requestAnimationFrameId_=null;var O=document.createElement("canvas");O.style.position="absolute",O.style.top=0,O.style.left=0,O.style.pointerEvents="none",this.canvas=O,this.canvasCssWidth_=300,this.canvasCssHeight_=150,this.resolutionScale_=1;function F(N,U){return function(){U.apply(N)}}this.repositionFunction_=F(this,this.repositionCanvas_),this.resizeFunction_=F(this,this.resize_),this.requestUpdateFunction_=F(this,this.update_),B&&this.setOptions(B)}var Es=typeof window>"u"?{}:window;Es.google&&Es.google.maps&&(ho.prototype=new google.maps.OverlayView,ho.DEFAULT_PANE_NAME_="overlayLayer",ho.CSS_TRANSFORM_=function(){for(var B=document.createElement("div"),O=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],F=0;FU.options.maxZoom)){var Je=1;this.context!="2d"&&(Je=this.canvasLayer.devicePixelRatio);var Re=this.map,Be=Re.getProjection(),Je=Math.pow(2,Re.zoom)*resolutionScale,Xe=Be.fromLatLngToPoint(this.canvasLayer.getTopLeft()),_t={transferCoordinate:function(Ue){var Bt=new google.maps.LatLng(Ue[1],Ue[0]),$t=Be.fromLatLngToPoint(Bt),ee={x:($t.x-Xe.x)*Je,y:($t.y-Xe.y)*Je};return[ee.x,ee.y]}};N!==void 0&&(_t.filter=function(ye){var Ue=X.trails||10;return!!(N&&ye.time>N-Ue&&ye.timeU-ne&&Yt.time0&&arguments[0]!==void 0?arguments[0]:null,N=arguments[1],U=arguments[2];h(this,O);var X=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,N,U));return X.options=U,X.canvasLayer={canvas:null,devicePixelRatio:window.devicePixelRatio},X.layer_=null,X.initDataRange(U),X.initAnimator(),X.onEvents(),F.on("complete",function(){this.init(F,U),this.argCheck(U)},X),X}return c(O,[{key:"init",value:function(N,U){if(N)this.map=N,this.context=this.options.context||"2d",this.getCanvasLayer();else throw new Error("not map object")}},{key:"_canvasUpdate",value:function(N){this.render(this.canvasLayer.canvas,N)}},{key:"render",value:function(N,U){if(!!N){var X=this.map,Z=N.getContext(this.context),Ae=this.options.animation;if(this.isEnabledTime()){if(U===void 0)return i(Z),this;this.context==="2d"&&(Z.save(),Z.globalCompositeOperation="destination-out",Z.fillStyle="rgba(0, 0, 0, .1)",Z.fillRect(0,0,Z.canvas.width,Z.canvas.height),Z.restore())}else i(Z);if(this.context==="2d")for(var Re in this.options)Z[Re]=this.options[Re];else Z.clear(Z.COLOR_BUFFER_BIT);var Be={transferCoordinate:function(_t){var rt=X.lngLatToContainer(new AMap.LngLat(_t[0],_t[1]));return[rt.x,rt.y]}};U!==void 0&&(Be.filter=function(Xe){var _t=Ae.trails||10;return!!(U&&Xe.time>U-_t&&Xe.time0&&arguments[0]!==void 0?arguments[0]:null,N=arguments[1],U=arguments[2];h(this,O);var X=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,N,U));return X.options=U,X.canvasLayer={canvas:null,devicePixelRatio:window.devicePixelRatio},X.layer_=null,X.previousCursor_=void 0,X.init(F,U),X.argCheck(U),X}return c(O,[{key:"init",value:function(N,U){if(N&&N instanceof ol.Map)this.$Map=N,this.context=this.options.context||"2d",this.getCanvasLayer(),this.initDataRange(U),this.initAnimator(),this.onEvents();else throw new Error("not map object")}},{key:"_canvasUpdate",value:function(N){this.render(this.canvasLayer.canvas,N)}},{key:"render",value:function(N,U){var X=this.$Map,Z=N.getContext(this.context),Ae=this.options.animation,Re=this.options.hasOwnProperty("projection")?this.options.projection:"EPSG:4326",Be=this.$Map.getView().getProjection().getCode();if(this.isEnabledTime()){if(U===void 0)return i(Z),this;this.context==="2d"&&(Z.save(),Z.globalCompositeOperation="destination-out",Z.fillStyle="rgba(0, 0, 0, .1)",Z.fillRect(0,0,Z.canvas.width,Z.canvas.height),Z.restore())}else i(Z);if(this.context==="2d")for(var Je in this.options)Z[Je]=this.options[Je];else Z.clear(Z.COLOR_BUFFER_BIT);var Xe={};Xe.transferCoordinate=Re===Be?function(rt){return X.getPixelFromCoordinate(rt)}:function(rt){return X.getPixelFromCoordinate(ol.proj.transform(rt,Re,Be))},U!==void 0&&(Xe.filter=function(rt){var Ht=Ae.trails||10;return!!(U&&rt.time>U-Ht&&rt.timeU.options.maxZoom)){var Be=Ae.getBounds(),Je=Be.getEast()-Be.getWest(),Xe=Be.getNorth()-Be.getSouth(),_t=Ae.getSize(),rt=Je/_t.x,Ht=Xe/_t.y,Yt=this.canvasLayer.getTopLeft(),ne=Ae.latLngToContainerPoint(Yt),ye={transferCoordinate:function(Se){var Ze;U.context==="2d"?Ze=Ae.latLngToContainerPoint(L.latLng(Se[1],Se[0])):Ze={x:(Se[0]-Yt.lng)/rt,y:(Yt.lat-Se[1])/Ht};var Ct={x:Ze.x-ne.x,y:Ze.y-ne.y};return[Ct.x,Ct.y]}};N!==void 0&&(ye.filter=function(ee){var Se=X.trails||10;return N&&ee.time>N-Se&&ee.time"u"?{}:window,N=this.devicePixelRatio=F.devicePixelRatio;return(!this.mapVOptions.context||this.mapVOptions.context==="2d")&&O.getContext("2d").scale(N,N),O},_resize:function(){var O=this.canvas;if(!!O){var F=this._map,N=F.getSize();O.width=N.x,O.height=N.y,O.style.width=N.x+"px",O.style.height=N.y+"px";var U=F.getBounds(),X=F.latLngToLayerPoint(U.getNorthWest());L.DomUtil.setPosition(O,X)}},_reset:function(){this._resize(),this._render()},redraw:function(){this._resize(),this._render()},_render:function(){this.render()}});mg=function(O,F,N){return new Uv(O,F,N)}}var _h=mg,Vv=function(B){d(O,B);function O(F,N,U,X){h(this,O);var Z=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,N,U));return Kl?(Z.map=F,Z.scene=F.scene,Z.dataSet=N,U=U||{},Z.init(U),Z.argCheck(U),Z.initDevicePixelRatio(),Z.canvasLayer=X,Z.stopAniamation=!1,Z.animation=U.animation,Z.clickEvent=Z.clickEvent.bind(Z),Z.mousemoveEvent=Z.mousemoveEvent.bind(Z),Z.bindEvent(),Z):v(Z)}return c(O,[{key:"initDevicePixelRatio",value:function(){this.devicePixelRatio=window.devicePixelRatio||1}},{key:"clickEvent",value:function(N){var U=N.point;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"clickEvent",this).call(this,U,N)}},{key:"mousemoveEvent",value:function(N){var U=N.point;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"mousemoveEvent",this).call(this,U,N)}},{key:"addAnimatorEvent",value:function(){}},{key:"animatorMovestartEvent",value:function(){var N=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=N.stepsRange.start)}},{key:"animatorMoveendEvent",value:function(){this.isEnabledTime()&&this.animator}},{key:"bindEvent",value:function(){this.map,this.options.methods&&(this.options.methods.click,this.options.methods.mousemove)}},{key:"unbindEvent",value:function(){var N=this.map;this.options.methods&&(this.options.methods.click&&N.off("click",this.clickEvent),this.options.methods.mousemove&&N.off("mousemove",this.mousemoveEvent))}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"init",value:function(N){this.options=N,this.initDataRange(N),this.context=this.options.context||"2d",this.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(this.options.zIndex),this.initAnimator()}},{key:"_canvasUpdate",value:function(N){this.map;var U=this.scene;if(this.canvasLayer&&!this.stopAniamation){var X=this.options.animation,Z=this.getContext();if(this.isEnabledTime()){if(N===void 0)return void this.clear(Z);this.context==="2d"&&(Z.save(),Z.globalCompositeOperation="destination-out",Z.fillStyle="rgba(0, 0, 0, .1)",Z.fillRect(0,0,Z.canvas.width,Z.canvas.height),Z.restore())}else this.clear(Z);if(this.context==="2d")for(var Ae in this.options)Z[Ae]=this.options[Ae];else Z.clear(Z.COLOR_BUFFER_BIT);var Re={transferCoordinate:function(_t){var rt=Cesium.Cartesian3.fromDegrees(_t[0],_t[1]),Ht=Cesium.SceneTransforms.wgs84ToWindowCoordinates(U,rt);return Ht==null?[-1,-1]:[Ht.x,Ht.y]}};N!==void 0&&(Re.filter=function(Xe){var _t=X.trails||10;return!!(N&&Xe.time>N-_t&&Xe.time"u"?{}:window,f=c.devicePixelRatio||1;h=f}var d={transferCoordinate:function(m){var y=(m[0]-t._mapCenter[0])/t._reselutions,_=(t._mapCenter[1]-m[1])/t._reselutions,x=[y+t._mapCenterPx[0],_+t._mapCenterPx[1]];return x=v(x,t._mapCenterPx,1),[(x[0]+t.offset[0])*h,(x[1]+t.offset[1])*h]}};function v(m,y,_){var x=(m[0]-y[0])*_+y[0],S=(m[1]-y[1])*_+y[1];return[x,S]}e!==void 0&&(d.filter=function(m){var y=r.trails||10;return e&&m.time>e-y&&m.time\xA9 SuperMap iClient",canvasFunction:r,logo:br.getOlVersion()==="4"?t.logo:null,projection:t.projection,ratio:t.ratio,resolutions:t.resolutions,state:t.state}),this.map=e.map,this.dataSet=e.dataSet,this.mapvOptions=e.mapvOptions;function r(i,a,o,s,l){var u=s[0]/o,h=s[1]/o,c=this.map.getSize()[0],f=this.map.getSize()[1];this.layer||(this.layer=new XFr(this.map,this.dataSet,this.mapvOptions,u,h,this)),this.layer.pixelRatio=o,this.layer.offset=[(u-c)/2,(h-f)/2],this.rotate?this.rotate!==this.map.getView().getRotation()&&(this.layer.canvasLayer.resize(u,h),this.rotate=this.map.getView().getRotation()):this.rotate=this.map.getView().getRotation();var d=this.layer.canvasLayer.canvas;this.layer.isEnabledTime()||(this.layer.canvasLayer.resize(u,h),this.layer.canvasLayer.draw()),this.context||(this.context=br.createCanvasContext2D(u,h));var v=this.context.canvas;return this.context.clearRect(0,0,v.width,v.height),v.width=s[0],v.height=s[1],v.style.width=s[0]+"px",v.style.height=s[1]+"px",this.context.drawImage(d,0,0),(this.resolution!==a||JSON.stringify(this.extent)!==JSON.stringify(i))&&(this.resolution=a,this.extent=i),this.context.canvas}}addData(e,t){this.layer.addData(e,t)}getData(){return this.layer&&(this.dataSet=this.layer.getData()),this.dataSet}removeData(e){this.layer&&this.layer.removeData(e)}clearData(){this.layer.clearData()}update(e){this.layer.update(e),this.changed()}}class qFr extends AS{constructor(e,t){super(e,t),this.style=t.style,this.isHoverAble=t.isHoverAble,this.highlightStyle=t.highlightStyle,this.themeField=t.themeField,this.styleGroups=t.styleGroups}destroy(){this.style=null,this.themeField=null,this.styleGroups=null,AS.prototype.destroy.apply(this,arguments)}createThematicFeature(e){var t=this.getStyleByData(e),r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Vn.transformStyle(this.highlightStyle);for(var i=new f3(e,this,Vn.transformStyle(t),r),a=0;a0&&r.attributes){var i=this.themeField,a=r.attributes,o=this.styleGroups,s=!1,l=null;for(var u in a)if(i===u){s=!0,l=a[u];break}if(s){for(var h=0,c=o.length;h=o[h].start&&l=0))throw new Error("precision must be a positive number");var t=Math.pow(10,e||0);return Math.round(n*t)/t}function ZM(n,e){e===void 0&&(e="kilometers");var t=p$[e];if(!t)throw new Error(e+" units is invalid");return n*t}function S2(n,e){e===void 0&&(e="kilometers");var t=p$[e];if(!t)throw new Error(e+" units is invalid");return n/t}function R7(n,e){return aw(S2(n,e))}function w2(n){var e=n%360;return e<0&&(e+=360),e}function aw(n){var e=n%(2*Math.PI);return e*180/Math.PI}function ku(n){var e=n%360;return e*Math.PI/180}function b2(n,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(n>=0))throw new Error("length must be a positive number");return ZM(S2(n,e),t)}function xZe(n,e,t){if(e===void 0&&(e="meters"),t===void 0&&(t="kilometers"),!(n>=0))throw new Error("area must be a positive number");var r=O7[e];if(!r)throw new Error("invalid original units");var i=O7[t];if(!i)throw new Error("invalid final units");return n/r*i}function Gu(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function Io(n){return!!n&&n.constructor===Object}function SZe(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(e){if(!Gu(e))throw new Error("bbox must only contain numbers")})}function wZe(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}const bZe=Object.freeze(Object.defineProperty({__proto__:null,earthRadius:Au,factors:p$,unitsFactors:vZe,areaFactors:O7,feature:fu,geometry:pZe,point:Vi,points:gZe,polygon:Qi,polygons:yZe,lineString:yo,lineStrings:mZe,featureCollection:Zn,multiLineString:Pw,multiPoint:$k,multiPolygon:Ld,geometryCollection:Lhe,round:_Ze,radiansToLength:ZM,lengthToRadians:S2,lengthToDegrees:R7,bearingToAzimuth:w2,radiansToDegrees:aw,degreesToRadians:ku,convertLength:b2,convertArea:xZe,isNumber:Gu,isObject:Io,validateBBox:SZe,validateId:wZe},Symbol.toStringTag,{value:"Module"}));function gl(n,e,t){if(n!==null)for(var r,i,a,o,s,l,u,h=0,c=0,f,d=n.type,v=d==="FeatureCollection",p=d==="Feature",g=v?n.features.length:1,m=0;ml||v>u||p>h){s=c,l=r,u=v,h=p,a=0;return}var g=yo([s,c],t.properties);if(e(g,r,i,p,a)===!1)return!1;a++,s=c})===!1)return!1}}})}function Nhe(n,e,t){var r=t,i=!1;return B1(n,function(a,o,s,l,u){i===!1&&t===void 0?r=a:r=e(r,a,o,s,l,u),i=!0}),r}function khe(n,e){if(!n)throw new Error("geojson is required");fh(n,function(t,r,i){if(t.geometry!==null){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(e(t,r,i,0,0)===!1)return!1;break;case"Polygon":for(var s=0;st[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function ri(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Bhe(n){if(n.length>1&&Gu(n[0])&&Gu(n[1]))return!0;if(Array.isArray(n[0])&&n[0].length)return Bhe(n[0]);throw new Error("coordinates must only contain numbers")}function IZe(n,e,t){if(!e||!t)throw new Error("type and name required");if(!n||n.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.type)}function xN(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}function Y_(n,e,t){if(!n)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!n||n.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(var r=0,i=n.features;r * v. 1.2.0 * https://github.com/RaumZeit/MarchingSquares.js * * MarchingSquaresJS is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MarchingSquaresJS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * As additional permission under GNU Affero General Public License version 3 * section 7, third-party projects (personal or commercial) may distribute, * include, or link against UNMODIFIED VERSIONS of MarchingSquaresJS without the * requirement that said third-party project for that reason alone becomes * subject to any requirement of the GNU Affero General Public License version 3. * Any modifications to MarchingSquaresJS, however, must be shared with the public * and made available. * * In summary this: * - allows you to use MarchingSquaresJS at no cost * - allows you to use MarchingSquaresJS for both personal and commercial purposes * - allows you to distribute UNMODIFIED VERSIONS of MarchingSquaresJS under any * license as long as this license notice is included * - enables you to keep the source code of your program that uses MarchingSquaresJS * undisclosed * - forces you to share any modifications you have made to MarchingSquaresJS, * e.g. bug-fixes * * You should have received a copy of the GNU Affero General Public License * along with MarchingSquaresJS. If not, see . */var _Me={successCallback:null,verbose:!1},D6={};function n4r(n,e,t){t=t||{};for(var r=Object.keys(_Me),i=0;i=e?8:0,s|=u>=e?4:0,s|=h>=e?2:0,s|=c>=e?1:0;var f=!1;if(s===5||s===10){var d=(l+u+h+c)/4;s===5&&d=0;f--)if(Math.abs(e[f][0][0]-h)<=r&&Math.abs(e[f][0][1]-c)<=r){for(var d=l.path.length-2;d>=0;--d)e[f].unshift(l.path[d]);u=!0;break}}u||(e[t++]=l.path)}})}),e}function s4r(n,e,t){var r=n.length,i=[],a=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],o=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],s,l,u=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"],h=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],d,c=n[e][t],f=c.cval,d=u[f],v=tZ(c,d);i.push([t+v[0],e+v[1]]),d=h[f],v=tZ(c,d),i.push([t+v[0],e+v[1]]),xMe(c);for(var p=t+a[f],g=e+o[f],m=f;p>=0&&g>=0&&g"u"));){if(f=c.cval,f===0||f===15)return{path:i,info:"mergeable"};d=h[f],s=a[f],l=o[f],(f===5||f===10)&&(f===5?c.flipped?o[m]===-1?(d="left",s=-1,l=0):(d="right",s=1,l=0):a[m]===-1&&(d="bottom",s=0,l=-1):f===10&&(c.flipped?a[m]===-1?(d="top",s=0,l=1):(d="bottom",s=0,l=-1):o[m]===1&&(d="left",s=-1,l=0))),v=tZ(c,d),i.push([p+v[0],g+v[1]]),xMe(c),p+=s,g+=l,m=f}return{path:i,info:"closed"}}function l4r(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.zProperty||"elevation",r=e.flip,i=e.flags;Y_(n,"Point","input must contain Points");for(var a=u4r(n,r),o=[],s=0;sC;){if(A-C>600){var I=A-C+1,R=T-C+1,k=Math.log(I),D=.5*Math.exp(2*k/3),G=.5*Math.sqrt(k*D*(I-D)/I)*(R-I/2<0?-1:1),W=Math.max(C,Math.floor(T-R*D/I+G)),z=Math.min(A,Math.floor(T+(I-R)*D/I+G));b(E,T,W,z,M)}var V=E[T],q=C,Y=A;for(r(E,C,T),M(E[A],V)>0&&r(E,C,A);q0;)Y--}M(E[C],V)===0?r(E,C,Y):r(E,++Y,A),Y<=T&&(C=Y+1),T<=Y&&(A=Y-1)}})(y,_,x||0,S||y.length-1,w||i)}function r(y,_,x){var S=y[_];y[_]=y[x],y[x]=S}function i(y,_){return y<_?-1:y>_?1:0}var a=function(y){y===void 0&&(y=9),this._maxEntries=Math.max(4,y),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(y,_,x){if(!x)return _.indexOf(y);for(var S=0;S<_.length;S++)if(x(y,_[S]))return S;return-1}function s(y,_){l(y,0,y.children.length,_,y)}function l(y,_,x,S,w){w||(w=g(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var b=_;b=y.minX&&_.maxY>=y.minY}function g(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(y,_,x,S,w){for(var b=[_,x];b.length;)if(!((x=b.pop())-(_=b.pop())<=S)){var E=_+Math.ceil((x-_)/S/2)*S;t(y,E,_,x,w),b.push(_,E,E,x)}}return a.prototype.all=function(){return this._all(this.data,[])},a.prototype.search=function(y){var _=this.data,x=[];if(!p(y,_))return x;for(var S=this.toBBox,w=[];_;){for(var b=0;b<_.children.length;b++){var E=_.children[b],T=_.leaf?S(E):E;p(y,T)&&(_.leaf?x.push(E):v(y,T)?this._all(E,x):w.push(E))}_=w.pop()}return x},a.prototype.collides=function(y){var _=this.data;if(!p(y,_))return!1;for(var x=[];_;){for(var S=0;S<_.children.length;S++){var w=_.children[S],b=_.leaf?this.toBBox(w):w;if(p(y,b)){if(_.leaf||v(y,b))return!0;x.push(w)}}_=x.pop()}return!1},a.prototype.load=function(y){if(!y||!y.length)return this;if(y.length=0&&w[_].children.length>this._maxEntries;)this._split(w,_),_--;this._adjustParentBBoxes(S,w,_)},a.prototype._split=function(y,_){var x=y[_],S=x.children.length,w=this._minEntries;this._chooseSplitAxis(x,w,S);var b=this._chooseSplitIndex(x,w,S),E=g(x.children.splice(b,x.children.length-b));E.height=x.height,E.leaf=x.leaf,s(x,this.toBBox),s(E,this.toBBox),_?y[_-1].children.push(E):this._splitRoot(x,E)},a.prototype._splitRoot=function(y,_){this.data=g([y,_]),this.data.height=y.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},a.prototype._chooseSplitIndex=function(y,_,x){for(var S,w,b,E,T,C,A,M=1/0,I=1/0,R=_;R<=x-_;R++){var k=l(y,0,R,this.toBBox),D=l(y,R,x,this.toBBox),G=(w=k,b=D,E=void 0,T=void 0,C=void 0,A=void 0,E=Math.max(w.minX,b.minX),T=Math.max(w.minY,b.minY),C=Math.min(w.maxX,b.maxX),A=Math.min(w.maxY,b.maxY),Math.max(0,C-E)*Math.max(0,A-T)),W=f(k)+f(D);G=_;M--){var I=y.children[M];u(E,y.leaf?w(I):I),T+=d(E)}return T},a.prototype._adjustParentBBoxes=function(y,_,x){for(var S=x;S>=0;S--)u(_[S],y)},a.prototype._condense=function(y){for(var _=y.length-1,x=void 0;_>=0;_--)y[_].children.length===0?_>0?(x=y[_-1].children).splice(x.indexOf(y[_]),1):this.clear():s(y[_],this.toBBox)},a})})(PZe);class d4r{constructor(e=[],t=v4r){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,i=t[e];for(;e>0;){const a=e-1>>1,o=t[a];if(r(i,o)>=0)break;t[e]=o,e=a}t[e]=i}_down(e){const{data:t,compare:r}=this,i=this.length>>1,a=t[e];for(;e=0)break;t[e]=s,e=o}t[e]=a}}function v4r(n,e){return ne?1:0}const p4r=Object.freeze(Object.defineProperty({__proto__:null,default:d4r},Symbol.toStringTag,{value:"Module"})),g4r=Nd(p4r);var g$={exports:{}},y4r=function(e,t,r,i){var a=e[0],o=e[1],s=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=(i-r)/2,u=0,h=l-1;uo!=v>o&&a<(d-c)*(o-f)/(v-f)+c;p&&(s=!s)}return s},m4r=function(e,t,r,i){var a=e[0],o=e[1],s=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=i-r,u=0,h=l-1;uo!=v>o&&a<(d-c)*(o-f)/(v-f)+c;p&&(s=!s)}return s},OZe=y4r,RZe=m4r;g$.exports=function(e,t,r,i){return t.length>0&&Array.isArray(t[0])?RZe(e,t,r,i):OZe(e,t,r,i)};g$.exports.nested=RZe;g$.exports.flat=OZe;var xre={exports:{}};(function(n,e){(function(t,r){r(e)})(at,function(t){const i=33306690738754706e-32;function a(p,g,m,y,_){let x,S,w,b,E=g[0],T=y[0],C=0,A=0;T>E==T>-E?(x=E,E=g[++C]):(x=T,T=y[++A]);let M=0;if(CE==T>-E?(w=x-((S=E+x)-E),E=g[++C]):(w=x-((S=T+x)-T),T=y[++A]),x=S,w!==0&&(_[M++]=w);CE==T>-E?(w=x-((S=x+E)-(b=S-x))+(E-b),E=g[++C]):(w=x-((S=x+T)-(b=S-x))+(T-b),T=y[++A]),x=S,w!==0&&(_[M++]=w);for(;C0!=w>0)return b;const E=Math.abs(S+w);return Math.abs(b)>=s*E?b:-function(T,C,A,M,I,R,k){let D,G,W,z,V,q,Y,le,j,Q,ie,oe,se,me,Ce,Le,re,yt;const je=T-I,st=A-I,Nt=C-R,Zt=M-R;V=(Ce=(le=je-(Y=(q=134217729*je)-(q-je)))*(Q=Zt-(j=(q=134217729*Zt)-(q-Zt)))-((me=je*Zt)-Y*j-le*j-Y*Q))-(ie=Ce-(re=(le=Nt-(Y=(q=134217729*Nt)-(q-Nt)))*(Q=st-(j=(q=134217729*st)-(q-st)))-((Le=Nt*st)-Y*j-le*j-Y*Q))),h[0]=Ce-(ie+V)+(V-re),V=(se=me-((oe=me+ie)-(V=oe-me))+(ie-V))-(ie=se-Le),h[1]=se-(ie+V)+(V-Le),V=(yt=oe+ie)-oe,h[2]=oe-(yt-V)+(ie-V),h[3]=yt;let qe=function(J,We){let Tt=We[0];for(let Qe=1;Qe=ur||-qe>=ur||(D=T-(je+(V=T-je))+(V-I),W=A-(st+(V=A-st))+(V-I),G=C-(Nt+(V=C-Nt))+(V-R),z=M-(Zt+(V=M-Zt))+(V-R),D===0&&G===0&&W===0&&z===0)||(ur=u*k+i*Math.abs(qe),(qe+=je*z+Zt*D-(Nt*W+st*G))>=ur||-qe>=ur))return qe;V=(Ce=(le=D-(Y=(q=134217729*D)-(q-D)))*(Q=Zt-(j=(q=134217729*Zt)-(q-Zt)))-((me=D*Zt)-Y*j-le*j-Y*Q))-(ie=Ce-(re=(le=G-(Y=(q=134217729*G)-(q-G)))*(Q=st-(j=(q=134217729*st)-(q-st)))-((Le=G*st)-Y*j-le*j-Y*Q))),v[0]=Ce-(ie+V)+(V-re),V=(se=me-((oe=me+ie)-(V=oe-me))+(ie-V))-(ie=se-Le),v[1]=se-(ie+V)+(V-Le),V=(yt=oe+ie)-oe,v[2]=oe-(yt-V)+(ie-V),v[3]=yt;const Dt=a(4,h,4,v,c);V=(Ce=(le=je-(Y=(q=134217729*je)-(q-je)))*(Q=z-(j=(q=134217729*z)-(q-z)))-((me=je*z)-Y*j-le*j-Y*Q))-(ie=Ce-(re=(le=Nt-(Y=(q=134217729*Nt)-(q-Nt)))*(Q=W-(j=(q=134217729*W)-(q-W)))-((Le=Nt*W)-Y*j-le*j-Y*Q))),v[0]=Ce-(ie+V)+(V-re),V=(se=me-((oe=me+ie)-(V=oe-me))+(ie-V))-(ie=se-Le),v[1]=se-(ie+V)+(V-Le),V=(yt=oe+ie)-oe,v[2]=oe-(yt-V)+(ie-V),v[3]=yt;const ft=a(Dt,c,4,v,f);V=(Ce=(le=D-(Y=(q=134217729*D)-(q-D)))*(Q=z-(j=(q=134217729*z)-(q-z)))-((me=D*z)-Y*j-le*j-Y*Q))-(ie=Ce-(re=(le=G-(Y=(q=134217729*G)-(q-G)))*(Q=W-(j=(q=134217729*W)-(q-W)))-((Le=G*W)-Y*j-le*j-Y*Q))),v[0]=Ce-(ie+V)+(V-re),V=(se=me-((oe=me+ie)-(V=oe-me))+(ie-V))-(ie=se-Le),v[1]=se-(ie+V)+(V-Le),V=(yt=oe+ie)-oe,v[2]=oe-(yt-V)+(ie-V),v[3]=yt;const Oe=a(ft,f,4,v,d);return d[Oe-1]}(p,g,m,y,_,x,E)},t.orient2dfast=function(p,g,m,y,_,x){return(g-x)*(m-_)-(p-_)*(y-x)},Object.defineProperty(t,"__esModule",{value:!0})})})(xre,xre.exports);var SMe=PZe.exports,S8=g4r,_4r=g$.exports,x4r=xre.exports.orient2d;S8.default&&(S8=S8.default);zhe.exports=DZe;zhe.exports.default=DZe;function DZe(n,e,t){e=Math.max(0,e===void 0?2:e),t=t||0;var r=T4r(n),i=new SMe(16);i.toBBox=function(y){return{minX:y[0],minY:y[1],maxX:y[0],maxY:y[1]}},i.compareMinX=function(y,_){return y[0]-_[0]},i.compareMinY=function(y,_){return y[1]-_[1]},i.load(n);for(var a=[],o=0,s;oa||s.push({node:h,dist:c})}for(;s.length&&!s.peek().node.children;){var f=s.pop(),d=f.node,v=iZ(d,e,t),p=iZ(d,r,i);if(f.dist=e.minX&&n[0]<=e.maxX&&n[1]>=e.minY&&n[1]<=e.maxY}function bMe(n,e,t){for(var r=Math.min(n[0],e[0]),i=Math.min(n[1],e[1]),a=Math.max(n[0],e[0]),o=Math.max(n[1],e[1]),s=t.search({minX:r,minY:i,maxX:a,maxY:o}),l=0;l0!=AA(n,e,r)>0&&AA(t,r,n)>0!=AA(t,r,e)>0}function rZ(n){var e=n.p,t=n.next.p;return n.minX=Math.min(e[0],t[0]),n.minY=Math.min(e[1],t[1]),n.maxX=Math.max(e[0],t[0]),n.maxY=Math.max(e[1],t[1]),n}function T4r(n){for(var e=n[0],t=n[0],r=n[0],i=n[0],a=0;ar[0]&&(r=o),o[1]i[1]&&(i=o)}var s=[e,t,r,i],l=s.slice();for(a=0;a1?(r=t[0],i=t[1]):s>0&&(r+=a*s,i+=o*s)}return a=n[0]-r,o=n[1]-i,a*a+o*o}function N6(n,e,t,r,i,a,o,s){var l=t-n,u=r-e,h=o-i,c=s-a,f=n-i,d=e-a,v=l*l+u*u,p=l*h+u*c,g=h*h+c*c,m=l*f+u*d,y=h*f+c*d,_=v*g-p*p,x,S,w,b,E=_,T=_;_===0?(S=0,E=1,b=y,T=g):(S=p*y-g*m,b=v*y-p*m,S<0?(S=0,b=y,T=g):S>E&&(S=E,b=y+p,T=g)),b<0?(b=0,-m<0?S=0:-m>v?S=E:(S=-m,E=v)):b>T&&(b=T,-m+p<0?S=0:-m+p>v?S=E:(S=-m+p,E=v)),x=S===0?0:S/E,w=b===0?0:b/T;var C=(1-x)*n+x*t,A=(1-x)*e+x*r,M=(1-w)*i+w*o,I=(1-w)*a+w*s,R=M-C,k=I-A;return R*R+k*k}function C4r(n,e){return n[0]===e[0]?n[1]-e[1]:n[0]-e[0]}function A4r(n){n.sort(C4r);for(var e=[],t=0;t=2&&AA(e[e.length-2],e[e.length-1],n[t])<=0;)e.pop();e.push(n[t])}for(var r=[],i=n.length-1;i>=0;i--){for(;r.length>=2&&AA(r[r.length-2],r[r.length-1],n[i])<=0;)r.pop();r.push(n[i])}return r.pop(),e.pop(),e.concat(r)}function NZe(n,e){e===void 0&&(e={}),e.concavity=e.concavity||1/0;var t=[];if(gl(n,function(i){t.push([i[0],i[1]])}),!t.length)return null;var r=zhe.exports(t,e.concavity);return r.length>3?Qi([r]):null}function ss(n,e,t){if(t===void 0&&(t={}),!n)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=Wo(n),i=ls(e),a=i.type,o=e.bbox,s=i.coordinates;if(o&&M4r(r,o)===!1)return!1;a==="Polygon"&&(s=[s]);for(var l=!1,u=0;un[1]!=u>n[1]&&n[0]<(l-o)*(n[1]-s)/(u-s)+o;c&&(r=!r)}return r}function M4r(n,e){return e[0]<=n[0]&&e[1]<=n[1]&&e[2]>=n[0]&&e[3]>=n[1]}function Sre(n,e){var t=[];return uo(n,function(r){var i=!1;if(r.geometry.type==="Point")Pd(e,function(o){ss(r,o)&&(i=!0)}),i&&t.push(r);else if(r.geometry.type==="MultiPoint"){var a=[];Pd(e,function(o){gl(r,function(s){ss(s,o)&&(i=!0,a.push(s))})}),i&&t.push($k(a))}else throw new Error("Input geometry must be a Point or MultiPoint")}),Zn(t)}function Mo(n,e,t){t===void 0&&(t={});var r=Wo(n),i=Wo(e),a=ku(i[1]-r[1]),o=ku(i[0]-r[0]),s=ku(r[1]),l=ku(i[1]),u=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(s)*Math.cos(l);return ZM(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),t.units)}function kZe(n,e){var t=!1;return Zn(P4r(n.features.map(function(r){var i={x:r.geometry.coordinates[0],y:r.geometry.coordinates[1]};return e?i.z=r.properties[e]:r.geometry.coordinates.length===3&&(t=!0,i.z=r.geometry.coordinates[2]),i})).map(function(r){var i=[r.a.x,r.a.y],a=[r.b.x,r.b.y],o=[r.c.x,r.c.y],s={};return t?(i.push(r.a.z),a.push(r.b.z),o.push(r.c.z)):s={a:r.a.z,b:r.b.z,c:r.c.z},Qi([[i,a,o,i]],s)}))}var CMe=function(){function n(e,t,r){this.a=e,this.b=t,this.c=r;var i=t.x-e.x,a=t.y-e.y,o=r.x-e.x,s=r.y-e.y,l=i*(e.x+t.x)+a*(e.y+t.y),u=o*(e.x+r.x)+s*(e.y+r.y),h=2*(i*(r.y-t.y)-a*(r.x-t.x)),c,f;this.x=(s*l-a*u)/h,this.y=(i*u-o*l)/h,c=this.x-e.x,f=this.y-e.y,this.r=c*c+f*f}return n}();function I4r(n,e){return e.x-n.x}function L4r(n){var e=n.length,t,r,i,a,o;e:for(;e;)for(r=n[--e],t=n[--e],i=e;i;)if(o=n[--i],a=n[--i],t===a&&r===o||t===o&&r===a){n.splice(e,2),n.splice(i,2),e-=2;continue e}}function P4r(n){if(n.length<3)return[];n.sort(I4r);for(var e=n.length-1,t=n[e].x,r=n[0].x,i=n[e].y,a=i,o=1e-12,s,l,u,h,c,f;e--;)n[e].ya&&(a=n[e].y);var d=r-t,v=a-i,p=d>v?d:v,g=(r+t)*.5,m=(a+i)*.5,y=[new CMe({__sentinel:!0,x:g-20*p,y:m-p},{__sentinel:!0,x:g,y:m+20*p},{__sentinel:!0,x:g+20*p,y:m-p})],_=[],x=[],S;for(e=n.length;e--;){for(x.length=0,S=y.length;S--;){if(d=n[e].x-y[S].x,d>0&&d*d>y[S].r){_.push(y[S]),y.splice(S,1);continue}v=n[e].y-y[S].y,!(d*d+v*v>y[S].r)&&(x.push(y[S].a,y[S].b,y[S].b,y[S].c,y[S].c,y[S].a),y.splice(S,1))}for(L4r(x),S=x.length;S;)l=x[--S],s=x[--S],u=n[e],h=l.x-s.x,c=l.y-s.y,f=2*(h*(u.y-l.y)-c*(u.x-l.x)),Math.abs(f)>o&&y.push(new CMe(s,l,u))}for(Array.prototype.push.apply(_,y),e=_.length;e--;)(_[e].a.__sentinel||_[e].b.__sentinel||_[e].c.__sentinel)&&_.splice(e,1);return _}function Xh(n){if(!n)throw new Error("geojson is required");switch(n.type){case"Feature":return FZe(n);case"FeatureCollection":return O4r(n);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Uhe(n);default:throw new Error("unknown GeoJSON type")}}function FZe(n){var e={type:"Feature"};return Object.keys(n).forEach(function(t){switch(t){case"type":case"properties":case"geometry":return;default:e[t]=n[t]}}),e.properties=BZe(n.properties),e.geometry=Uhe(n.geometry),e}function BZe(n){var e={};return n&&Object.keys(n).forEach(function(t){var r=n[t];typeof r=="object"?r===null?e[t]=null:Array.isArray(r)?e[t]=r.map(function(i){return i}):e[t]=BZe(r):e[t]=r}),e}function O4r(n){var e={type:"FeatureCollection"};return Object.keys(n).forEach(function(t){switch(t){case"type":case"features":return;default:e[t]=n[t]}}),e.features=n.features.map(function(t){return FZe(t)}),e}function Uhe(n){var e={type:n.type};return n.bbox&&(e.bbox=n.bbox),n.type==="GeometryCollection"?(e.geometries=n.geometries.map(function(t){return Uhe(t)}),e):(e.coordinates=GZe(n.coordinates),e)}function GZe(n){var e=n;return typeof e[0]!="object"?e.slice():e.map(function(t){return GZe(t)})}function R4r(n,e){if(e===void 0&&(e={}),e=e||{},!Io(e))throw new Error("options is invalid");var t=e.mutate;if(zf(n)!=="FeatureCollection")throw new Error("geojson must be a FeatureCollection");if(!n.features.length)throw new Error("geojson is empty");(t===!1||t===void 0)&&(n=Xh(n));var r=[],i=Fhe(n,function(a,o){var s=D4r(a,o);return s||(r.push(a),o)});return i&&r.push(i),r.length?r.length===1?r[0]:Pw(r.map(function(a){return a.coordinates})):null}function k6(n){return n[0].toString()+","+n[1].toString()}function D4r(n,e){var t=n.geometry.coordinates,r=e.geometry.coordinates,i=k6(t[0]),a=k6(t[t.length-1]),o=k6(r[0]),s=k6(r[r.length-1]),l;if(i===s)l=r.concat(t.slice(1));else if(o===a)l=t.concat(r.slice(1));else if(i===o)l=t.slice(1).reverse().concat(r);else if(a===s)l=t.concat(r.reverse().slice(1));else return null;return yo(l)}function N4r(n){return n}function k4r(n){if(n==null)return N4r;var e,t,r=n.scale[0],i=n.scale[1],a=n.translate[0],o=n.translate[1];return function(s,l){l||(e=t=0);var u=2,h=s.length,c=new Array(h);for(c[0]=(e+=s[0])*r+a,c[1]=(t+=s[1])*i+o;u1)for(var c=1,f=s(u[0]),d,v;cf&&(v=u[0],u[0]=u[c],u[c]=v,f=d);return u}).filter(function(l){return l.length>0})}}var y$=Object.prototype.hasOwnProperty;function V4r(n){var e=1/0,t=1/0,r=-1/0,i=-1/0;function a(c){c!=null&&y$.call(o,c.type)&&o[c.type](c)}var o={GeometryCollection:function(c){c.geometries.forEach(a)},Point:function(c){s(c.coordinates)},MultiPoint:function(c){c.coordinates.forEach(s)},LineString:function(c){l(c.arcs)},MultiLineString:function(c){c.arcs.forEach(l)},Polygon:function(c){c.arcs.forEach(l)},MultiPolygon:function(c){c.arcs.forEach(u)}};function s(c){var f=c[0],d=c[1];fr&&(r=f),di&&(i=d)}function l(c){c.forEach(s)}function u(c){c.forEach(l)}for(var h in n)a(n[h]);return r>=e&&i>=t?[e,t,r,i]:void 0}function $4r(n,e,t,r,i){arguments.length===3&&(r=Array,i=null);for(var a=new r(n=1<=n)throw new Error("full hashset");d=a[f=f+1&o]}return a[f]=c,!0}function u(c){for(var f=e(c)&o,d=a[f],v=0;d!=i;){if(t(d,c))return!0;if(++v>=n)break;d=a[f=f+1&o]}return!1}function h(){for(var c=[],f=0,d=a.length;f=n)throw new Error("full hashmap");m=o[g=g+1&l]}return o[g]=v,s[g]=p,p}function c(v,p){for(var g=e(v)&l,m=o[g],y=0;m!=i;){if(t(m,v))return s[g];if(++y>=n)throw new Error("full hashmap");m=o[g=g+1&l]}return o[g]=v,s[g]=p,p}function f(v,p){for(var g=e(v)&l,m=o[g],y=0;m!=i;){if(t(m,v))return s[g];if(++y>=n)break;m=o[g=g+1&l]}return p}function d(){for(var v=[],p=0,g=o.length;p>7^F6[2]^F6[3],e&2147483647}function W4r(n){var e=n.coordinates,t=n.lines,r=n.rings,i=w(),a=new Int32Array(e.length),o=new Int32Array(e.length),s=new Int32Array(e.length),l=new Int8Array(e.length),u=0,h,c,f,d,v;for(h=0,c=e.length;h=0){var D=s[I];(k!==M||D!==R)&&(k!==R||D!==M)&&(++u,l[I]=1)}else o[I]=M,s[I]=R}}function w(){for(var A=Vhe(e.length*1.4,b,E,Int32Array,-1,Int32Array),M=new Int32Array(e.length),I=0,R=e.length;I>1),i;e0&&t&&Q4r(n,t,e),i=X4r(H4r(q4r(n))),a=i.coordinates,o=Vhe(i.arcs.length*1.4,t5r,r5r);n=i.objects,i.bbox=t,i.arcs=i.arcs.map(function(f,d){return o.set(f,d),a.slice(f[0],f[1]+1)}),delete i.coordinates,a=null;function s(f){f&&y$.call(l,f.type)&&l[f.type](f)}var l={GeometryCollection:function(f){f.geometries.forEach(s)},LineString:function(f){f.arcs=u(f.arcs)},MultiLineString:function(f){f.arcs=f.arcs.map(u)},Polygon:function(f){f.arcs=f.arcs.map(u)},MultiPolygon:function(f){f.arcs=f.arcs.map(h)}};function u(f){var d=[];do{var v=o.get(f);d.push(f[0]l;){if(u-l>600){var c=u-l+1,f=s-l+1,d=Math.log(c),v=.5*Math.exp(2*d/3),p=.5*Math.sqrt(d*v*(c-v)/c)*(f-c/2<0?-1:1),g=Math.max(l,Math.floor(s-f*v/c+p)),m=Math.min(u,Math.floor(s+(c-f)*v/c+p));r(o,s,g,m,h)}var y=o[s],_=l,x=u;for(i(o,l,s),h(o[u],y)>0&&i(o,l,u);_0;)x--}h(o[l],y)===0?i(o,l,x):(x++,i(o,x,u)),x<=s&&(l=x+1),s<=x&&(u=x-1)}}function i(o,s,l){var u=o[s];o[s]=o[l],o[l]=u}function a(o,s){return os?1:0}return t})})($Ze);Wk.exports=SN;Wk.exports.default=SN;var l5r=$Ze.exports;function SN(n,e){if(!(this instanceof SN))return new SN(n,e);this._maxEntries=Math.max(4,n||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),e&&this._initFormat(e),this.clear()}SN.prototype={all:function(){return this._all(this.data,[])},search:function(n){var e=this.data,t=[],r=this.toBBox;if(!G6(n,e))return t;for(var i=[],a,o,s,l;e;){for(a=0,o=e.children.length;a=0&&a[e].children.length>this._maxEntries;)this._split(a,e),e--;this._adjustParentBBoxes(i,a,e)},_split:function(n,e){var t=n[e],r=t.children.length,i=this._minEntries;this._chooseSplitAxis(t,i,r);var a=this._chooseSplitIndex(t,i,r),o=iA(t.children.splice(a,t.children.length-a));o.height=t.height,o.leaf=t.leaf,MC(t,this.toBBox),MC(o,this.toBBox),e?n[e-1].children.push(o):this._splitRoot(t,o)},_splitRoot:function(n,e){this.data=iA([n,e]),this.data.height=n.height+1,this.data.leaf=!1,MC(this.data,this.toBBox)},_chooseSplitIndex:function(n,e,t){var r,i,a,o,s,l,u,h;for(l=u=1/0,r=e;r<=t-e;r++)i=OO(n,0,r,this.toBBox),a=OO(n,r,t,this.toBBox),o=c5r(i,a),s=oZ(i)+oZ(a),o=e;l--)u=n.children[l],RO(o,n.leaf?i(u):u),s+=B6(o);return s},_adjustParentBBoxes:function(n,e,t){for(var r=t;r>=0;r--)RO(e[r],n)},_condense:function(n){for(var e=n.length-1,t;e>=0;e--)n[e].children.length===0?e>0?(t=n[e-1].children,t.splice(t.indexOf(n[e]),1)):this.clear():MC(n[e],this.toBBox)},_initFormat:function(n){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(n[0])),this.compareMinY=new Function("a","b",e.join(n[1])),this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};function u5r(n,e,t){if(!t)return e.indexOf(n);for(var r=0;r=n.minX&&e.maxY>=n.minY}function iA(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function LMe(n,e,t,r,i){for(var a=[e,t],o;a.length;)t=a.pop(),e=a.pop(),!(t-e<=r)&&(o=e+Math.ceil((t-e)/r/2)*r,l5r(n,o,e,t,i),a.push(e,o,o,t))}function f5r(n,e,t,r){var i=Wk.exports(6),a=e.features.map(function(o){var s;return{minX:o.geometry.coordinates[0],minY:o.geometry.coordinates[1],maxX:o.geometry.coordinates[0],maxY:o.geometry.coordinates[1],property:(s=o.properties)===null||s===void 0?void 0:s[t]}});return i.load(a),n.features.forEach(function(o){o.properties||(o.properties={});var s=yl(o),l=i.search({minX:s[0],minY:s[1],maxX:s[2],maxY:s[3]}),u=[];l.forEach(function(h){ss([h.minX,h.minY],o)&&u.push(h.property)}),o.properties[r]=u}),n}function d5r(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.mutate;if(!n)throw new Error("geojson is required");return(t===!1||t===void 0)&&(n=Xh(n)),gl(n,function(r){var i=r[0],a=r[1];r[0]=a,r[1]=i}),n}function E2(n,e){e===void 0&&(e={});var t=typeof e=="object"?e.mutate:e;if(!n)throw new Error("geojson is required");var r=zf(n),i=[];switch(r){case"LineString":i=lZ(n);break;case"MultiLineString":case"Polygon":ri(n).forEach(function(o){i.push(lZ(o))});break;case"MultiPolygon":ri(n).forEach(function(o){var s=[];o.forEach(function(l){s.push(lZ(l))}),i.push(s)});break;case"Point":return n;case"MultiPoint":var a={};ri(n).forEach(function(o){var s=o.join("-");Object.prototype.hasOwnProperty.call(a,s)||(i.push(o),a[s]=!0)});break;default:throw new Error(r+" geometry not supported")}return n.coordinates?t===!0?(n.coordinates=i,n):{type:r,coordinates:i}:t===!0?(n.geometry.coordinates=i,n):fu({type:r,coordinates:i},n.properties,{bbox:n.bbox,id:n.id})}function lZ(n){var e=ri(n);if(e.length===2&&!PMe(e[0],e[1]))return e;var t=[],r=e.length-1,i=t.length;t.push(e[0]);for(var a=1;a2&&OMe(t[i-3],t[i-1],t[i-2])&&t.splice(t.length-2,1))}if(t.push(e[e.length-1]),i=t.length,PMe(e[0],e[e.length-1])&&i<4)throw new Error("invalid polygon");return OMe(t[i-3],t[i-1],t[i-2])&&t.splice(t.length-2,1),t}function PMe(n,e){return n[0]===e[0]&&n[1]===e[1]}function OMe(n,e,t){var r=t[0],i=t[1],a=n[0],o=n[1],s=e[0],l=e[1],u=r-a,h=i-o,c=s-a,f=l-o,d=u*f-h*c;return d!==0?!1:Math.abs(c)>=Math.abs(f)?c>0?a<=r&&r<=s:s<=r&&r<=a:f>0?o<=i&&i<=l:l<=i&&i<=o}function v5r(n,e){var t=n.x-e.x,r=n.y-e.y;return t*t+r*r}function p5r(n,e,t){var r=e.x,i=e.y,a=t.x-r,o=t.y-i;if(a!==0||o!==0){var s=((n.x-r)*a+(n.y-i)*o)/(a*a+o*o);s>1?(r=t.x,i=t.y):s>0&&(r+=a*s,i+=o*s)}return a=n.x-r,o=n.y-i,a*a+o*o}function g5r(n,e){for(var t=n[0],r=[t],i,a=1,o=n.length;ae&&(r.push(i),t=i);return t!==i&&r.push(i),r}function bre(n,e,t,r,i){for(var a=r,o,s=e+1;sa&&(o=s,a=l)}a>r&&(o-e>1&&bre(n,e,o,r,i),i.push(n[o]),t-o>1&&bre(n,o,t,r,i))}function y5r(n,e){var t=n.length-1,r=[n[0]];return bre(n,0,t,e,r),r.push(n[t]),r}function Ere(n,e,t){if(n.length<=2)return n;var r=e!==void 0?e*e:1;return n=t?n:g5r(n,r),n=y5r(n,r),n}function m5r(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.tolerance!==void 0?e.tolerance:1,r=e.highQuality||!1,i=e.mutate||!1;if(!n)throw new Error("geojson is required");if(t&&t<0)throw new Error("invalid tolerance");return i!==!0&&(n=Xh(n)),Pd(n,function(a){_5r(a,t,r)}),n}function _5r(n,e,t){var r=n.type;if(r==="Point"||r==="MultiPoint")return n;E2(n,!0);var i=n.coordinates;switch(r){case"LineString":n.coordinates=RMe(i,e,t);break;case"MultiLineString":n.coordinates=i.map(function(a){return RMe(a,e,t)});break;case"Polygon":n.coordinates=DMe(i,e,t);break;case"MultiPolygon":n.coordinates=i.map(function(a){return DMe(a,e,t)})}return n}function RMe(n,e,t){return Ere(n.map(function(r){return{x:r[0],y:r[1],z:r[2]}}),e,t).map(function(r){return r.z?[r.x,r.y,r.z]:[r.x,r.y]})}function DMe(n,e,t){return n.map(function(r){var i=r.map(function(o){return{x:o[0],y:o[1]}});if(i.length<4)throw new Error("invalid polygon");for(var a=Ere(i,e,t).map(function(o){return[o.x,o.y]});!x5r(a);)e-=e*.01,a=Ere(i,e,t).map(function(o){return[o.x,o.y]});return(a[a.length-1][0]!==a[0][0]||a[a.length-1][1]!==a[0][1])&&a.push(a[0]),a})}function x5r(n){return n.length<3?!1:!(n.length===3&&n[2][0]===n[0][0]&&n[2][1]===n[0][1])}var S5r=function(){function n(e){this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(var t=0;te&&(t.push(i),r=a)}return t},n.prototype.vector=function(e){var t=this.pos(e+10),r=this.pos(e-10);return{angle:180*Math.atan2(t.y-r.y,t.x-r.x)/3.14,speed:Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y)+(r.z-t.z)*(r.z-t.z))}},n.prototype.pos=function(e){var t=e-this.delay;t<0&&(t=0),t>this.duration&&(t=this.duration-1);var r=t/this.duration;if(r>=1)return this.points[this.length-1];var i=Math.floor((this.points.length-1)*r),a=(this.length-1)*r-i;return b5r(a,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},n}();const w5r=S5r;function b5r(n,e,t,r,i){var a=E5r(n),o={x:i.x*a[0]+r.x*a[1]+t.x*a[2]+e.x*a[3],y:i.y*a[0]+r.y*a[1]+t.y*a[2]+e.y*a[3],z:i.z*a[0]+r.z*a[1]+t.z*a[2]+e.z*a[3]};return o}function E5r(n){var e=n*n,t=e*n;return[t,3*e*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}function NMe(n,e){e===void 0&&(e={});for(var t=e.resolution||1e4,r=e.sharpness||.85,i=[],a=ls(n).coordinates.map(function(u){return{x:u[0],y:u[1]}}),o=new w5r({duration:t,points:a,sharpness:r}),s=function(u){var h=o.pos(u);Math.floor(u/100)%2===0&&i.push([h.x,h.y])},l=0;li;)o=Math.floor((r+1)*Math.random()),a=t[o],t[o]=t[r],t[r]=a;return t.slice(i)}function Whe(n,e){e===void 0&&(e={});var t=Number(n[0]),r=Number(n[1]),i=Number(n[2]),a=Number(n[3]);if(n.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var o=[t,r],s=[t,a],l=[i,a],u=[i,r];return Qi([[o,u,l,s,o]],e.properties,{bbox:n,id:e.id})}function WZe(n){return Whe(yl(n))}function HZe(n){var e=n[0],t=n[1],r=n[2],i=n[3],a=Mo(n.slice(0,2),[r,t]),o=Mo(n.slice(0,2),[e,i]);if(a>=o){var s=(t+i)/2;return[e,s-(r-e)/2,r,s+(r-e)/2]}else{var l=(e+r)/2;return[l-(i-t)/2,t,l+(i-t)/2,i]}}function _m(n,e,t,r){r===void 0&&(r={});var i=Wo(n),a=ku(i[0]),o=ku(i[1]),s=ku(t),l=S2(e,r.units),u=Math.asin(Math.sin(o)*Math.cos(l)+Math.cos(o)*Math.sin(l)*Math.cos(s)),h=a+Math.atan2(Math.sin(s)*Math.sin(l)*Math.cos(o),Math.cos(l)-Math.sin(o)*Math.sin(u)),c=aw(h),f=aw(u);return Vi([c,f],r.properties)}function Hhe(n,e,t){t===void 0&&(t={});for(var r=t.steps||64,i=t.properties?t.properties:!Array.isArray(n)&&n.type==="Feature"&&n.properties?n.properties:{},a=[],o=0;o80*t){s=u=n[0],l=h=n[1];for(var v=t;vu&&(u=c),f>h&&(h=f);d=Math.max(u-s,h-l),d=d!==0?32767/d:0}return wN(a,o,t,s,l,d,0),o}function XZe(n,e,t,r,i){var a,o;if(i===Are(n,e,t,r)>0)for(a=e;a=e;a-=r)o=kMe(a,n[a],n[a+1],o);return o&&S$(o,o.next)&&(EN(o),o=o.next),o}function T2(n,e){if(!n)return n;e||(e=n);var t=n,r;do if(r=!1,!t.steiner&&(S$(t,t.next)||Ll(t.prev,t,t.next)===0)){if(EN(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function wN(n,e,t,r,i,a,o){if(!!n){!o&&a&&z5r(n,r,i,a);for(var s=n,l,u;n.prev!==n.next;){if(l=n.prev,u=n.next,a?O5r(n,r,i,a):P5r(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),EN(n),n=u.next,s=u.next;continue}if(n=u,n===s){o?o===1?(n=R5r(T2(n),e,t),wN(n,e,t,r,i,a,2)):o===2&&D5r(n,e,t,r,i,a):wN(T2(n),e,t,r,i,a,1);break}}}}function P5r(n){var e=n.prev,t=n,r=n.next;if(Ll(e,t,r)>=0)return!1;for(var i=e.x,a=t.x,o=r.x,s=e.y,l=t.y,u=r.y,h=ia?i>o?i:o:a>o?a:o,d=s>l?s>u?s:u:l>u?l:u,v=r.next;v!==e;){if(v.x>=h&&v.x<=f&&v.y>=c&&v.y<=d&&MA(i,s,a,l,o,u,v.x,v.y)&&Ll(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function O5r(n,e,t,r){var i=n.prev,a=n,o=n.next;if(Ll(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,u=o.x,h=i.y,c=a.y,f=o.y,d=sl?s>u?s:u:l>u?l:u,g=h>c?h>f?h:f:c>f?c:f,m=Tre(d,v,e,t,r),y=Tre(p,g,e,t,r),_=n.prevZ,x=n.nextZ;_&&_.z>=m&&x&&x.z<=y;){if(_.x>=d&&_.x<=p&&_.y>=v&&_.y<=g&&_!==i&&_!==o&&MA(s,h,l,c,u,f,_.x,_.y)&&Ll(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=d&&x.x<=p&&x.y>=v&&x.y<=g&&x!==i&&x!==o&&MA(s,h,l,c,u,f,x.x,x.y)&&Ll(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=m;){if(_.x>=d&&_.x<=p&&_.y>=v&&_.y<=g&&_!==i&&_!==o&&MA(s,h,l,c,u,f,_.x,_.y)&&Ll(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=y;){if(x.x>=d&&x.x<=p&&x.y>=v&&x.y<=g&&x!==i&&x!==o&&MA(s,h,l,c,u,f,x.x,x.y)&&Ll(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function R5r(n,e,t){var r=n;do{var i=r.prev,a=r.next.next;!S$(i,a)&&YZe(i,r,r.next,a)&&bN(i,a)&&bN(a,i)&&(e.push(i.i/t|0),e.push(r.i/t|0),e.push(a.i/t|0),EN(r),EN(r.next),r=n=a),r=r.next}while(r!==n);return T2(r)}function D5r(n,e,t,r,i,a){var o=n;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&$5r(o,s)){var l=qZe(o,s);o=T2(o,o.next),l=T2(l,l.next),wN(o,e,t,r,i,a,0),wN(l,e,t,r,i,a,0);return}s=s.next}o=o.next}while(o!==n)}function N5r(n,e,t,r){var i=[],a,o,s,l,u;for(a=0,o=e.length;a=t.next.y&&t.next.y!==t.y){var s=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(s<=r&&s>a&&(a=s,o=t.x=t.x&&t.x>=u&&r!==t.x&&MA(io.x||t.x===o.x&&G5r(o,t)))&&(o=t,c=f)),t=t.next;while(t!==l);return o}function G5r(n,e){return Ll(n.prev,n,e.prev)<0&&Ll(e.next,n,n.next)<0}function z5r(n,e,t,r){var i=n;do i.z===0&&(i.z=Tre(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,U5r(i)}function U5r(n){var e,t,r,i,a,o,s,l,u=1;do{for(t=n,n=null,a=null,o=0;t;){for(o++,r=t,s=0,e=0;e0||l>0&&r;)s!==0&&(l===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:n=i,i.prevZ=a,a=i;t=r}a.nextZ=null,u*=2}while(o>1);return n}function Tre(n,e,t,r,i){return n=(n-t)*i|0,e=(e-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function V5r(n){var e=n,t=n;do(e.x=(n-o)*(a-s)&&(n-o)*(r-s)>=(t-o)*(e-s)&&(t-o)*(a-s)>=(i-o)*(r-s)}function $5r(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!W5r(n,e)&&(bN(n,e)&&bN(e,n)&&H5r(n,e)&&(Ll(n.prev,n,e.prev)||Ll(n,e.prev,e))||S$(n,e)&&Ll(n.prev,n,n.next)>0&&Ll(e.prev,e,e.next)>0)}function Ll(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function S$(n,e){return n.x===e.x&&n.y===e.y}function YZe(n,e,t,r){var i=U6(Ll(n,e,t)),a=U6(Ll(n,e,r)),o=U6(Ll(t,r,n)),s=U6(Ll(t,r,e));return!!(i!==a&&o!==s||i===0&&z6(n,t,e)||a===0&&z6(n,r,e)||o===0&&z6(t,n,r)||s===0&&z6(t,e,r))}function z6(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function U6(n){return n>0?1:n<0?-1:0}function W5r(n,e){var t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&YZe(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function bN(n,e){return Ll(n.prev,n,n.next)<0?Ll(n,e,n.next)>=0&&Ll(n,n.prev,e)>=0:Ll(n,e,n.prev)<0||Ll(n,n.next,e)<0}function H5r(n,e){var t=n,r=!1,i=(n.x+e.x)/2,a=(n.y+e.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&i<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function qZe(n,e){var t=new Cre(n.i,n.x,n.y),r=new Cre(e.i,e.x,e.y),i=n.next,a=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,a.next=r,r.prev=a,r}function kMe(n,e,t,r){var i=new Cre(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function EN(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Cre(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}x$.deviation=function(n,e,t,r){var i=e&&e.length,a=i?e[0]*t:n.length,o=Math.abs(Are(n,0,a,t));if(i)for(var s=0,l=e.length;s0&&(r+=n[i-1].length,t.holes.push(r))}return t};function j5r(n){if(!n.geometry||n.geometry.type!=="Polygon"&&n.geometry.type!=="MultiPolygon")throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return n.geometry.type==="Polygon"?e.features=FMe(n.geometry.coordinates):n.geometry.coordinates.forEach(function(t){e.features=e.features.concat(FMe(t))}),e}function FMe(n){var e=X5r(n),t=2,r=jhe.exports(e.vertices,e.holes,t),i=[],a=[];r.forEach(function(l,u){var h=r[u];a.push([e.vertices[h*t],e.vertices[h*t+1]])});for(var o=0;o0&&(r+=n[i-1].length,t.holes.push(r))}return t}function D7(n,e){if(!n)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var t,r=1/0,i=0;return uo(e,function(a,o){var s=Mo(n,a);si?t:i,u=r>a?r:a;return[o,s,l,u]}var fL={exports:{}},ZZe={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(at,function(){function t(y,_,x,S,w){(function b(E,T,C,A,M){for(;A>C;){if(A-C>600){var I=A-C+1,R=T-C+1,k=Math.log(I),D=.5*Math.exp(2*k/3),G=.5*Math.sqrt(k*D*(I-D)/I)*(R-I/2<0?-1:1),W=Math.max(C,Math.floor(T-R*D/I+G)),z=Math.min(A,Math.floor(T+(I-R)*D/I+G));b(E,T,W,z,M)}var V=E[T],q=C,Y=A;for(r(E,C,T),M(E[A],V)>0&&r(E,C,A);q0;)Y--}M(E[C],V)===0?r(E,C,Y):r(E,++Y,A),Y<=T&&(C=Y+1),T<=Y&&(A=Y-1)}})(y,_,x||0,S||y.length-1,w||i)}function r(y,_,x){var S=y[_];y[_]=y[x],y[x]=S}function i(y,_){return y<_?-1:y>_?1:0}var a=function(y){y===void 0&&(y=9),this._maxEntries=Math.max(4,y),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(y,_,x){if(!x)return _.indexOf(y);for(var S=0;S<_.length;S++)if(x(y,_[S]))return S;return-1}function s(y,_){l(y,0,y.children.length,_,y)}function l(y,_,x,S,w){w||(w=g(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var b=_;b=y.minX&&_.maxY>=y.minY}function g(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(y,_,x,S,w){for(var b=[_,x];b.length;)if(!((x=b.pop())-(_=b.pop())<=S)){var E=_+Math.ceil((x-_)/S/2)*S;t(y,E,_,x,w),b.push(_,E,E,x)}}return a.prototype.all=function(){return this._all(this.data,[])},a.prototype.search=function(y){var _=this.data,x=[];if(!p(y,_))return x;for(var S=this.toBBox,w=[];_;){for(var b=0;b<_.children.length;b++){var E=_.children[b],T=_.leaf?S(E):E;p(y,T)&&(_.leaf?x.push(E):v(y,T)?this._all(E,x):w.push(E))}_=w.pop()}return x},a.prototype.collides=function(y){var _=this.data;if(!p(y,_))return!1;for(var x=[];_;){for(var S=0;S<_.children.length;S++){var w=_.children[S],b=_.leaf?this.toBBox(w):w;if(p(y,b)){if(_.leaf||v(y,b))return!0;x.push(w)}}_=x.pop()}return!1},a.prototype.load=function(y){if(!y||!y.length)return this;if(y.length=0&&w[_].children.length>this._maxEntries;)this._split(w,_),_--;this._adjustParentBBoxes(S,w,_)},a.prototype._split=function(y,_){var x=y[_],S=x.children.length,w=this._minEntries;this._chooseSplitAxis(x,w,S);var b=this._chooseSplitIndex(x,w,S),E=g(x.children.splice(b,x.children.length-b));E.height=x.height,E.leaf=x.leaf,s(x,this.toBBox),s(E,this.toBBox),_?y[_-1].children.push(E):this._splitRoot(x,E)},a.prototype._splitRoot=function(y,_){this.data=g([y,_]),this.data.height=y.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},a.prototype._chooseSplitIndex=function(y,_,x){for(var S,w,b,E,T,C,A,M=1/0,I=1/0,R=_;R<=x-_;R++){var k=l(y,0,R,this.toBBox),D=l(y,R,x,this.toBBox),G=(w=k,b=D,E=void 0,T=void 0,C=void 0,A=void 0,E=Math.max(w.minX,b.minX),T=Math.max(w.minY,b.minY),C=Math.min(w.maxX,b.maxX),A=Math.min(w.maxY,b.maxY),Math.max(0,C-E)*Math.max(0,A-T)),W=f(k)+f(D);G=_;M--){var I=y.children[M];u(E,y.leaf?w(I):I),T+=d(E)}return T},a.prototype._adjustParentBBoxes=function(y,_,x){for(var S=x;S>=0;S--)u(_[S],y)},a.prototype._condense=function(y){for(var _=y.length-1,x=void 0;_>=0;_--)y[_].children.length===0?_>0?(x=y[_-1].children).splice(x.indexOf(y[_]),1):this.clear():s(y[_],this.toBBox)},a})})(ZZe);const K5r=Nd(bZe),J5r=Nd(MZe),Q5r=Nd(KFr);var cy=ZZe.exports,KZe=K5r,JZe=J5r,IC=Q5r.default,e6r=JZe.featureEach;JZe.coordEach;KZe.polygon;var BMe=KZe.featureCollection;function QZe(n){var e=new cy(n);return e.insert=function(t){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:IC(t),cy.prototype.insert.call(this,t)},e.load=function(t){var r=[];return Array.isArray(t)?t.forEach(function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:IC(i),r.push(i)}):e6r(t,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:IC(i),r.push(i)}),cy.prototype.load.call(this,r)},e.remove=function(t,r){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:IC(t),cy.prototype.remove.call(this,t,r)},e.clear=function(){return cy.prototype.clear.call(this)},e.search=function(t){var r=cy.prototype.search.call(this,this.toBBox(t));return BMe(r)},e.collides=function(t){return cy.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=cy.prototype.all.call(this);return BMe(t)},e.toJSON=function(){return cy.prototype.toJSON.call(this)},e.fromJSON=function(t){return cy.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var r;if(t.bbox)r=t.bbox;else if(Array.isArray(t)&&t.length===4)r=t;else if(Array.isArray(t)&&t.length===6)r=[t[0],t[1],t[3],t[4]];else if(t.type==="Feature")r=IC(t);else if(t.type==="FeatureCollection")r=IC(t);else throw new Error("invalid geojson");return{minX:r[0],minY:r[1],maxX:r[2],maxY:r[3]}},e}fL.exports=QZe;fL.exports.default=QZe;function q_(n,e){var t={},r=[];if(n.type==="LineString"&&(n=fu(n)),e.type==="LineString"&&(e=fu(e)),n.type==="Feature"&&e.type==="Feature"&&n.geometry!==null&&e.geometry!==null&&n.geometry.type==="LineString"&&e.geometry.type==="LineString"&&n.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var i=GMe(n,e);return i&&r.push(i),Zn(r)}var a=fL.exports();return a.load(C2(e)),uo(C2(n),function(o){uo(a.search(o),function(s){var l=GMe(o,s);if(l){var u=ri(l).join(",");t[u]||(t[u]=!0,r.push(l))}})}),Zn(r)}function GMe(n,e){var t=ri(n),r=ri(e);if(t.length!==2)throw new Error(" line1 must only contain 2 coordinates");if(r.length!==2)throw new Error(" line2 must only contain 2 coordinates");var i=t[0][0],a=t[0][1],o=t[1][0],s=t[1][1],l=r[0][0],u=r[0][1],h=r[1][0],c=r[1][1],f=(c-u)*(o-i)-(h-l)*(s-a),d=(h-l)*(a-u)-(c-u)*(i-l),v=(o-i)*(a-u)-(s-a)*(i-l);if(f===0)return d===0&&v===0,null;var p=d/f,g=v/f;if(p>=0&&p<=1&&g>=0&&g<=1){var m=i+p*(o-i),y=a+p*(s-a);return Vi([m,y])}return null}function G1(n,e,t){t===void 0&&(t={});var r=Vi([1/0,1/0],{dist:1/0}),i=0;return fh(n,function(a){for(var o=ri(a),s=0;s0&&(g=p.features[0],g.properties.dist=Mo(e,g,t),g.properties.location=i+Mo(l,g,t)),l.properties.dist180?-360:r[0]-i[0]>180?360:0;var a=t6r(r,i),o=b2(a,"meters",t.units);return o}function t6r(n,e,t){t=t===void 0?Au:Number(t);var r=t,i=n[1]*Math.PI/180,a=e[1]*Math.PI/180,o=a-i,s=Math.abs(e[0]-n[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var l=Math.log(Math.tan(a/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),u=Math.abs(l)>1e-11?o/l:Math.cos(i),h=Math.sqrt(o*o+u*u*s*s),c=h*r;return c}function eKe(n,e,t){if(t===void 0&&(t={}),t.method||(t.method="geodesic"),t.units||(t.units="kilometers"),!n)throw new Error("pt is required");if(Array.isArray(n)?n=Vi(n):n.type==="Point"?n=fu(n):xN(n,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=yo(e):e.type==="LineString"?e=fu(e):xN(e,"LineString","line");var r=1/0,i=n.geometry.coordinates;return B1(e,function(a){var o=a.geometry.coordinates[0],s=a.geometry.coordinates[1],l=r6r(i,o,s,t);l=0&&u<=1&&(d.onLine1=!0),h>=0&&h<=1&&(d.onLine2=!0),d.onLine1&&d.onLine2?[d.x,d.y]:!1)}function UMe(n){for(var e=l6r(n),t=m$(e),r=!1,i=0;!r&&i0){e+=Math.abs(HMe(n[0]));for(var t=1;t2){for(s=0;s=a&&o===i.length-1);o++)if(a>=e){var s=e-a;if(s){var l=x_(i[o],i[o-1])-180,u=_m(i[o],s,l,t);return u}else return Vi(i[o])}else a+=Mo(i[o],i[o+1],t);return Vi(i[i.length-1])}function Mre(n,e){return e===void 0&&(e={}),Nhe(n,function(t,r){var i=r.geometry.coordinates;return t+Mo(i[0],i[1],e)},0)}function c6r(n,e,t){var r=ri(t);if(zf(t)!=="LineString")throw new Error("line must be a LineString");var i=G1(t,n),a=G1(t,e),o;i.properties.index<=a.properties.index?o=[i,a]:o=[a,i];for(var s=[o[0].geometry.coordinates],l=o[0].properties.index+1;l=s&&c===i.length-1);c++){if(s>e&&a.length===0){if(l=e-s,!l)return a.push(i[c]),yo(a);u=x_(i[c],i[c-1])-180,h=_m(i[c],l,u,r),a.push(h.geometry.coordinates)}if(s>=t)return l=t-s,l?(u=x_(i[c],i[c-1])-180,h=_m(i[c],l,u,r),a.push(h.geometry.coordinates),yo(a)):(a.push(i[c]),yo(a));if(s>=e&&a.push(i[c]),c===i.length-1)return yo(a);s+=Mo(i[c],i[c+1],r)}if(s"u"?null:t.epsilon))return!0}return!1}function f6r(n,e,t,r,i){var a=t[0],o=t[1],s=n[0],l=n[1],u=e[0],h=e[1],c=t[0]-s,f=t[1]-l,d=u-s,v=h-l,p=c*v-f*d;if(i!==null){if(Math.abs(p)>i)return!1}else if(p!==0)return!1;if(r){if(r==="start")return Math.abs(d)>=Math.abs(v)?d>0?s0?l=Math.abs(v)?d>0?s<=a&&a0?l<=o&&o=Math.abs(v)?d>0?s0?l=Math.abs(v)?d>0?s<=a&&a<=u:u<=a&&a<=s:v>0?l<=o&&o<=h:h<=o&&o<=l;return!1}function rKe(n,e){var t=ls(n),r=ls(e),i=t.type,a=r.type;switch(i){case"Point":switch(a){case"MultiPoint":return d6r(t,r);case"LineString":return yd(t,r,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return ss(t,r,{ignoreBoundary:!0});default:throw new Error("feature2 "+a+" geometry not supported")}case"MultiPoint":switch(a){case"MultiPoint":return v6r(t,r);case"LineString":return p6r(t,r);case"Polygon":case"MultiPolygon":return g6r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"LineString":switch(a){case"LineString":return y6r(t,r);case"Polygon":case"MultiPolygon":return m6r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"Polygon":switch(a){case"Polygon":case"MultiPolygon":return _6r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function d6r(n,e){var t,r=!1;for(t=0;te[0]||n[2]e[1]||n[3] is required");if(typeof t!="number")throw new Error(" must be a number");if(typeof r!="number")throw new Error(" must be a number");(i===!1||i===void 0)&&(n=JSON.parse(JSON.stringify(n)));var a=Math.pow(10,t);return gl(n,function(o){S6r(o,a,r)}),n}function S6r(n,e,t){n.length>t&&n.splice(t,n.length);for(var r=0;r=1||C<=0||A>=1||A<=0)){var M=T,I=!a[M];I&&(a[M]=!0),e?i.push(e(T,m,y,S,w,C,_,x,b,E,A,I)):i.push(T)}}}function g(m,y){var _=r[m][y],x=r[m][y+1],S,w,b,E;return _[0]l[j.isect].coord?-1:1});for(var b=[];m.length>0;){var E=m.pop(),T=E.isect,C=E.parent,A=E.winding,M=b.length,I=[l[T].coord],R=T;if(l[T].ringAndEdge1Walkable)var k=l[T].ringAndEdge1,D=l[T].nxtIsectAlongRingAndEdge1;else var k=l[T].ringAndEdge2,D=l[T].nxtIsectAlongRingAndEdge2;for(;!NO(l[T].coord,l[D].coord);){I.push(l[D].coord);for(var G=void 0,y=0;y1)for(var j=0;j"u"&&(e=!0),n.length!=3)throw new Error("This function requires an array of three points [x,y]");var t=(n[1][0]-n[0][0])*(n[2][1]-n[0][1])-(n[1][1]-n[0][1])*(n[2][0]-n[0][0]);return t>=0==e}function A6r(n){for(var e=0,t=0;tf&&(p>h&&vh&&pl&&(l=g)}var m=[];if(s&&l0&&Math.abs(x-t[_-1][0])>f){var S=parseFloat(t[_-1][0]),w=parseFloat(t[_-1][1]),b=parseFloat(t[_][0]),E=parseFloat(t[_][1]);if(S>-180&&S-180&&t[_-1][0]h&&S<180&&b===-180&&_+1h&&t[_-1][0]<180){y.push([180,t[_][1]]),_++,y.push([t[_][0],t[_][1]]);continue}if(Sh){var T=S;S=b,b=T;var C=w;w=E,E=C}if(S>h&&b=180&&Sh?180:-180,M]),y=[],y.push([t[_-1][0]>h?-180:180,M]),m.push(y)}else y=[],m.push(y);y.push([x,t[_][1]])}else y.push([t[_][0],t[_][1]])}}else{var I=[];m.push(I);for(var R=0;R1&&t.push(yo(h)),Zn(t)}function lKe(n,e){if(!e.features.length)throw new Error("lines must contain features");if(e.features.length===1)return e.features[0];var t,r=1/0;return uo(e,function(i){var a=G1(i,n),o=a.properties.dist;oh&&f.push(_m(n,e,h,i).geometry.coordinates),yo(f,l)}function KMe(n){var e=n%360;return e<0&&(e+=360),e}function CN(n,e){e===void 0&&(e={});var t=ls(n);switch(!e.properties&&n.type==="Feature"&&(e.properties=n.properties),t.type){case"Polygon":return hKe(t,e);case"MultiPolygon":return O6r(t,e);default:throw new Error("invalid poly")}}function hKe(n,e){e===void 0&&(e={});var t=ls(n),r=t.coordinates,i=e.properties?e.properties:n.type==="Feature"?n.properties:{};return cKe(r,i)}function O6r(n,e){e===void 0&&(e={});var t=ls(n),r=t.coordinates,i=e.properties?e.properties:n.type==="Feature"?n.properties:{},a=[];return r.forEach(function(o){a.push(cKe(o,i))}),Zn(a)}function cKe(n,e){return n.length>1?Pw(n,e):yo(n[0],e)}function JMe(n,e){e===void 0&&(e={});var t,r,i,a=e.properties,o=(t=e.autoComplete)!==null&&t!==void 0?t:!0,s=(r=e.orderCoords)!==null&&r!==void 0?r:!0,l=(i=e.mutate)!==null&&i!==void 0?i:!1;switch(l||(n=Xh(n)),n.type){case"FeatureCollection":var u=[];return n.features.forEach(function(h){u.push(ri(QMe(h,{},o,s)))}),Ld(u,a);default:return QMe(n,a,o,s)}}function QMe(n,e,t,r){e=e||(n.type==="Feature"?n.properties:{});var i=ls(n),a=i.coordinates,o=i.type;if(!a.length)throw new Error("line must contain coordinates");switch(o){case"LineString":return t&&(a=eIe(a)),Qi([a],e);case"MultiLineString":var s=[],l=0;return a.forEach(function(u){if(t&&(u=eIe(u)),r){var h=R6r(yl(yo(u)));h>l?(s.unshift(u),l=h):s.push(u)}else s.push(u)}),Qi(s,e);default:throw new Error("geometry type "+o+" is not supported")}}function eIe(n){var e=n[0],t=e[0],r=e[1],i=n[n.length-1],a=i[0],o=i[1];return(t!==a||r!==o)&&n.push(e),n}function R6r(n){var e=n[0],t=n[1],r=n[2],i=n[3];return Math.abs(e-r)*Math.abs(t-i)}function D6r(n,e,t){var r=n.length,i=LA(n[0],e),a=[],o,s,l,u,h;for(t||(t=[]),o=1;oe[2]&&(t|=2),n[1]e[3]&&(t|=8),t}function k6r(n,e){var t=ls(n),r=t.type,i=n.type==="Feature"?n.properties:{},a=t.coordinates;switch(r){case"LineString":case"MultiLineString":{var o=[];return r==="LineString"&&(a=[a]),a.forEach(function(s){D6r(s,e,o)}),o.length===1?yo(o[0],i):Pw(o,i)}case"Polygon":return Qi(tIe(a,e),i);case"MultiPolygon":return Ld(a.map(function(s){return tIe(s,e)}),i);default:throw new Error("geometry "+r+" not supported")}}function tIe(n,e){for(var t=[],r=0,i=n;r0&&((o[0][0]!==o[o.length-1][0]||o[0][1]!==o[o.length-1][1])&&o.push(o[0]),o.length>=4&&t.push(o))}return t}var rIe=Object.prototype.toString,fKe=function(e){var t=rIe.call(e),r=t==="[object Arguments]";return r||(r=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&rIe.call(e.callee)==="[object Function]"),r},fZ,nIe;function F6r(){if(nIe)return fZ;nIe=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=fKe,i=Object.prototype.propertyIsEnumerable,a=!i.call({toString:null},"toString"),o=i.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var d=f.constructor;return d&&d.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&e.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),c=function(f){if(typeof window>"u"||!h)return l(f);try{return l(f)}catch{return!1}};n=function(d){var v=d!==null&&typeof d=="object",p=t.call(d)==="[object Function]",g=r(d),m=v&&t.call(d)==="[object String]",y=[];if(!v&&!p&&!g)throw new TypeError("Object.keys called on a non-object");var _=o&&p;if(m&&d.length>0&&!e.call(d,0))for(var x=0;x0)for(var S=0;S"u"||!Ah?Za:Ah(Uint8Array),$E={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Za:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Za:ArrayBuffer,"%ArrayIteratorPrototype%":LC&&Ah?Ah([][Symbol.iterator]()):Za,"%AsyncFromSyncIteratorPrototype%":Za,"%AsyncFunction%":aA,"%AsyncGenerator%":aA,"%AsyncGeneratorFunction%":aA,"%AsyncIteratorPrototype%":aA,"%Atomics%":typeof Atomics>"u"?Za:Atomics,"%BigInt%":typeof BigInt>"u"?Za:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Za:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Za:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Za:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":CBr,"%eval%":eval,"%EvalError%":ABr,"%Float16Array%":typeof Float16Array>"u"?Za:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Za:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Za:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Za:FinalizationRegistry,"%Function%":TKe,"%GeneratorFunction%":aA,"%Int8Array%":typeof Int8Array>"u"?Za:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Za:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Za:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":LC&&Ah?Ah(Ah([][Symbol.iterator]())):Za,"%JSON%":typeof JSON=="object"?JSON:Za,"%Map%":typeof Map>"u"?Za:Map,"%MapIteratorPrototype%":typeof Map>"u"||!LC||!Ah?Za:Ah(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":TBr,"%Object.getOwnPropertyDescriptor%":AN,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Za:Promise,"%Proxy%":typeof Proxy>"u"?Za:Proxy,"%RangeError%":MBr,"%ReferenceError%":IBr,"%Reflect%":typeof Reflect>"u"?Za:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Za:Set,"%SetIteratorPrototype%":typeof Set>"u"||!LC||!Ah?Za:Ah(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Za:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":LC&&Ah?Ah(""[Symbol.iterator]()):Za,"%Symbol%":LC?Symbol:Za,"%SyntaxError%":JM,"%ThrowTypeError%":GBr,"%TypedArray%":VBr,"%TypeError%":aM,"%Uint8Array%":typeof Uint8Array>"u"?Za:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Za:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Za:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Za:Uint32Array,"%URIError%":LBr,"%WeakMap%":typeof WeakMap>"u"?Za:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Za:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Za:WeakSet,"%Function.prototype.call%":jk,"%Function.prototype.apply%":CKe,"%Object.defineProperty%":BBr,"%Object.getPrototypeOf%":zBr,"%Math.abs%":PBr,"%Math.floor%":OBr,"%Math.max%":RBr,"%Math.min%":DBr,"%Math.pow%":NBr,"%Math.round%":kBr,"%Math.sign%":FBr,"%Reflect.getPrototypeOf%":UBr};if(Ah)try{null.error}catch(n){var $Br=Ah(Ah(n));$E["%Error.prototype%"]=$Br}var WBr=function n(e){var t;if(e==="%AsyncFunction%")t=pZ("async function () {}");else if(e==="%GeneratorFunction%")t=pZ("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=pZ("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&Ah&&(t=Ah(i.prototype))}return $E[e]=t,t},dIe={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Xk=Hk,N7=EKe,HBr=Xk.call(jk,Array.prototype.concat),jBr=Xk.call(CKe,Array.prototype.splice),vIe=Xk.call(jk,String.prototype.replace),k7=Xk.call(jk,String.prototype.slice),XBr=Xk.call(jk,RegExp.prototype.exec),YBr=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,qBr=/\\(\\)?/g,ZBr=function(e){var t=k7(e,0,1),r=k7(e,-1);if(t==="%"&&r!=="%")throw new JM("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new JM("invalid intrinsic syntax, expected opening `%`");var i=[];return vIe(e,YBr,function(a,o,s,l){i[i.length]=s?vIe(l,qBr,"$1"):o||a}),i},KBr=function(e,t){var r=e,i;if(N7(dIe,r)&&(i=dIe[r],r="%"+i[0]+"%"),N7($E,r)){var a=$E[r];if(a===aA&&(a=WBr(r)),typeof a>"u"&&!t)throw new aM("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:a}}throw new JM("intrinsic "+e+" does not exist!")},AKe=function(e,t){if(typeof e!="string"||e.length===0)throw new aM("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new aM('"allowMissing" argument must be a boolean');if(XBr(/^%?[^%]*%?$/,e)===null)throw new JM("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=ZBr(e),i=r.length>0?r[0]:"",a=KBr("%"+i+"%",t),o=a.name,s=a.value,l=!1,u=a.alias;u&&(i=u[0],jBr(r,HBr([0,1],u)));for(var h=1,c=!0;h=r.length){var p=AN(s,f);c=!!p,c&&"get"in p&&!("originalValue"in p.get)?s=p.get:s=s[f]}else c=N7(s,f),s=s[f];c&&!l&&($E[o]=s)}}return s},MKe=AKe,IKe=Qhe,JBr=IKe([MKe("%String.prototype.indexOf%")]),ece=function(e,t){var r=MKe(e,!!t);return typeof r=="function"&&JBr(e,".prototype.")>-1?IKe([r]):r},QBr=Zhe(),e8r=ece,Ore=e8r("Object.prototype.toString"),E$=function(e){return QBr&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Ore(e)==="[object Arguments]"},LKe=function(e){return E$(e)?!0:e!==null&&typeof e=="object"&&"length"in e&&typeof e.length=="number"&&e.length>=0&&Ore(e)!=="[object Array]"&&"callee"in e&&Ore(e.callee)==="[object Function]"},t8r=function(){return E$(arguments)}();E$.isLegacyArguments=LKe;var r8r=t8r?E$:LKe,pIe=b$,n8r=yKe,PC=dL,gIe=vL,tce=function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new PC("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new PC("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new PC("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new PC("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new PC("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new PC("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!gIe&&gIe(e,t);if(pIe)pIe(e,t,{configurable:o===null&&l?l.configurable:!o,enumerable:i===null&&l?l.enumerable:!i,value:r,writable:a===null&&l?l.writable:!a});else if(s||!i&&!a&&!o)e[t]=r;else throw new n8r("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Rre=b$,PKe=function(){return!!Rre};PKe.hasArrayLengthDefineBug=function(){if(!Rre)return null;try{return Rre([],"length",{value:1}).length!==1}catch{return!0}};var rce=PKe,i8r=dKe,a8r=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",o8r=Object.prototype.toString,s8r=Array.prototype.concat,yIe=tce,l8r=function(n){return typeof n=="function"&&o8r.call(n)==="[object Function]"},OKe=rce(),u8r=function(n,e,t,r){if(e in n){if(r===!0){if(n[e]===t)return}else if(!l8r(r)||!r())return}OKe?yIe(n,e,t,!0):yIe(n,e,t)},RKe=function(n,e){var t=arguments.length>2?arguments[2]:{},r=i8r(e);a8r&&(r=s8r.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i4294967295||f8r(t)!==t)throw new xIe("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,a=!0;if("length"in e&&_Ie){var o=_Ie(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(a=!1)}return(i||a||!r)&&(c8r?mIe(e,"length",t,!0,!0):mIe(e,"length",t)),e},v8r=Hk,p8r=Jhe,g8r=xKe,y8r=function(){return g8r(v8r,p8r,arguments)};(function(n){var e=d8r,t=b$,r=Qhe,i=y8r;n.exports=function(o){var s=r(arguments),l=o.length-(arguments.length-1);return e(s,1+(l>0?l:0),!0)},t?t(n.exports,"apply",{value:i}):n.exports.apply=i})(nce);var SIe=function(n){return n!==n},DKe=function(e,t){return e===0&&t===0?1/e===1/t:!!(e===t||SIe(e)&&SIe(t))},m8r=DKe,NKe=function(){return typeof Object.is=="function"?Object.is:m8r},_8r=NKe,x8r=Yk,S8r=function(){var e=_8r();return x8r(Object,{is:e},{is:function(){return Object.is!==e}}),e},w8r=Yk,b8r=nce.exports,E8r=DKe,kKe=NKe,T8r=S8r,FKe=b8r(kKe(),Object);w8r(FKe,{getPolyfill:kKe,implementation:E8r,shim:T8r});var C8r=FKe,wIe=ece,A8r=Zhe(),M8r=EKe,I8r=vL,Dre;if(A8r){var L8r=wIe("RegExp.prototype.exec"),bIe={},yZ=function(){throw bIe},EIe={toString:yZ,valueOf:yZ};typeof Symbol.toPrimitive=="symbol"&&(EIe[Symbol.toPrimitive]=yZ),Dre=function(e){if(!e||typeof e!="object")return!1;var t=I8r(e,"lastIndex"),r=t&&M8r(t,"value");if(!r)return!1;try{L8r(e,EIe)}catch(i){return i===bIe}}}else{var P8r=wIe("Object.prototype.toString"),O8r="[object RegExp]";Dre=function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:P8r(e)===O8r}}var R8r=Dre,MN=function(){return typeof function(){}.name=="string"},NR=Object.getOwnPropertyDescriptor;if(NR)try{NR([],"length")}catch{NR=null}MN.functionsHaveConfigurableNames=function(){if(!MN()||!NR)return!1;var e=NR(function(){},"name");return!!e&&!!e.configurable};var D8r=Function.prototype.bind;MN.boundFunctionsHaveNames=function(){return MN()&&typeof D8r=="function"&&function(){}.bind().name!==""};var N8r=MN,TIe=tce,k8r=rce(),F8r=N8r.functionsHaveConfigurableNames(),B8r=dL,G8r=function(e,t){if(typeof e!="function")throw new B8r("`fn` is not a function");var r=arguments.length>2&&!!arguments[2];return(!r||F8r)&&(k8r?TIe(e,"name",t,!0,!0):TIe(e,"name",t)),e},z8r=G8r,U8r=dL,V8r=Object,BKe=z8r(function(){if(this==null||this!==V8r(this))throw new U8r("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0),$8r=BKe,W8r=Yk.supportsDescriptors,H8r=Object.getOwnPropertyDescriptor,GKe=function(){if(W8r&&/a/mig.flags==="gim"){var e=H8r(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var t="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(r,"sticky",{get:function(){t+="y"}}),e.get.call(r),t==="dy")return e.get}}return $8r},j8r=Yk.supportsDescriptors,X8r=GKe,Y8r=vL,q8r=Object.defineProperty,Z8r=gKe,CIe=bKe,K8r=/a/,J8r=function(){if(!j8r||!CIe)throw new Z8r("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=X8r(),t=CIe(K8r),r=Y8r(t,"flags");return(!r||r.get!==e)&&q8r(t,"flags",{configurable:!0,enumerable:!1,get:e}),e},Q8r=Yk,eGr=nce.exports,tGr=BKe,zKe=GKe,rGr=J8r,UKe=eGr(zKe());Q8r(UKe,{getPolyfill:zKe,implementation:tGr,shim:rGr});var nGr=UKe,VKe=ece,iGr=VKe("Date.prototype.getDay"),aGr=function(e){try{return iGr(e),!0}catch{return!1}},oGr=VKe("Object.prototype.toString"),sGr="[object Date]",lGr=Zhe(),uGr=function(e){return typeof e!="object"||e===null?!1:lGr?aGr(e):oGr(e)===sGr},AIe=dKe,MIe=r8r,IIe=C8r,LIe=R8r,PIe=nGr,OIe=uGr,RIe=Date.prototype.getTime;function $Ke(n,e,t){var r=t||{};return(r.strict?IIe(n,e):n===e)?!0:!n||!e||typeof n!="object"&&typeof e!="object"?r.strict?IIe(n,e):n==e:hGr(n,e,r)}function DIe(n){return n==null}function NIe(n){return!(!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number")}function hGr(n,e,t){var r,i;if(typeof n!=typeof e||DIe(n)||DIe(e)||n.prototype!==e.prototype||MIe(n)!==MIe(e))return!1;var a=LIe(n),o=LIe(e);if(a!==o)return!1;if(a||o)return n.source===e.source&&PIe(n)===PIe(e);if(OIe(n)&&OIe(e))return RIe.call(n)===RIe.call(e);var s=NIe(n),l=NIe(e);if(s!==l)return!1;if(s||l){if(n.length!==e.length)return!1;for(r=0;r=0;r--)if(u[r]!=h[r])return!1;for(r=u.length-1;r>=0;r--)if(i=u[r],!$Ke(n[i],e[i],t))return!1;return!0}var PA=$Ke;function WKe(n,e,t){if(t===void 0&&(t={}),t=t||{},!Io(t))throw new Error("options is invalid");var r=t.tolerance||0,i=[],a=fL.exports(),o=C2(n);a.load(o);var s;return B1(e,function(l){var u=!1;!l||(uo(a.search(l),function(h){if(u===!1){var c=ri(l).sort(),f=ri(h).sort();PA(c,f)||(r===0?yd(c[0],h)&&yd(c[1],h):G1(h,c[0]).properties.dist<=r&&G1(h,c[1]).properties.dist<=r)?(u=!0,s?s=mZ(s,l):s=l):(r===0?yd(f[0],l)&&yd(f[1],l):G1(l,f[0]).properties.dist<=r&&G1(l,f[1]).properties.dist<=r)&&(s?s=mZ(s,h):s=h)}}),u===!1&&s&&(i.push(s),s=void 0))}),s&&i.push(s),Zn(i)}function mZ(n,e){var t=ri(e),r=ri(n),i=r[0],a=r[r.length-1],o=n.geometry.coordinates;return PA(t[0],i)?o.unshift(t[1]):PA(t[0],a)?o.push(t[1]):PA(t[1],i)?o.unshift(t[0]):PA(t[1],a)&&o.push(t[0]),n}function cGr(n,e,t,r,i){if(i=i||{},!Io(i))throw new Error("options is invalid");var a=i.properties;if(!n)throw new Error("center is required");if(t==null)throw new Error("bearing1 is required");if(r==null)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if(typeof i!="object")throw new Error("options must be an object");if(kIe(t)===kIe(r))return Hhe(n,e,i);var o=ri(n),s=uKe(n,e,t,r,i),l=[[o]];return gl(s,function(u){l[0].push(u)}),l[0].push(o),Qi(l,a)}function kIe(n){var e=n%360;return e<0&&(e+=360),e}function A2(n,e,t){t===void 0&&(t={});var r;t.final?r=FIe(Wo(e),Wo(n)):r=FIe(Wo(n),Wo(e));var i=r>180?-(360-r):r;return i}function FIe(n,e){var t=ku(n[1]),r=ku(e[1]),i=ku(e[0]-n[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var a=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),o=Math.atan2(i,a);return(aw(o)+360)%360}function QM(n,e,t,r){r===void 0&&(r={});var i=e<0,a=b2(Math.abs(e),r.units,"meters");i&&(a=-Math.abs(a));var o=Wo(n),s=fGr(o,a,t);return s[0]+=s[0]-o[0]>180?-360:o[0]-s[0]>180?360:0,Vi(s,r.properties)}function fGr(n,e,t,r){r=r===void 0?Au:Number(r);var i=e/r,a=n[0]*Math.PI/180,o=ku(n[1]),s=ku(t),l=i*Math.cos(s),u=o+l;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var h=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),c=Math.abs(h)>1e-11?l/h:Math.cos(o),f=i*Math.sin(s)/c,d=a+f;return[(d*180/Math.PI+540)%360-180,u*180/Math.PI]}function dGr(n,e){var t=ri(n),r=ri(e),i,a,o,s,l=yl(e),u=0,h=null;t[0]>l[0]&&t[0]l[1]&&t[1]0?pGr(e,s,i)||(i=s):t>0&&r<=0&&(vGr(e,s,a)||(a=s)),t=r}return[i,a]}function vGr(n,e,t){return IN(n,e,t)>0}function pGr(n,e,t){return IN(n,e,t)<0}function IN(n,e,t){return(e[0]-n[0])*(t[1]-n[1])-(t[0]-n[0])*(e[1]-n[1])}function F7(n){for(var e=ri(n),t=0,r=1,i,a;r0}function gGr(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.reverse||!1,r=e.mutate||!1;if(!n)throw new Error(" is required");if(typeof t!="boolean")throw new Error(" must be a boolean");if(typeof r!="boolean")throw new Error(" must be a boolean");r===!1&&(n=Xh(n));var i=[];switch(n.type){case"GeometryCollection":return Pd(n,function(a){C8(a,t)}),n;case"FeatureCollection":return uo(n,function(a){uo(C8(a,t),function(o){i.push(o)})}),Zn(i)}return C8(n,t)}function C8(n,e){var t=n.type==="Feature"?n.geometry.type:n.type;switch(t){case"GeometryCollection":return Pd(n,function(r){C8(r,e)}),n;case"LineString":return GIe(ri(n),e),n;case"Polygon":return zIe(ri(n),e),n;case"MultiLineString":return ri(n).forEach(function(r){GIe(r,e)}),n;case"MultiPolygon":return ri(n).forEach(function(r){zIe(r,e)}),n;case"Point":case"MultiPoint":return n}}function GIe(n,e){F7(n)===e&&n.reverse()}function zIe(n,e){F7(n[0])!==e&&n[0].reverse();for(var t=1;t * v. 1.2.0 * https://github.com/RaumZeit/MarchingSquares.js * * MarchingSquaresJS is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MarchingSquaresJS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * As additional permission under GNU Affero General Public License version 3 * section 7, third-party projects (personal or commercial) may distribute, * include, or link against UNMODIFIED VERSIONS of MarchingSquaresJS without the * requirement that said third-party project for that reason alone becomes * subject to any requirement of the GNU Affero General Public License version 3. * Any modifications to MarchingSquaresJS, however, must be shared with the public * and made available. * * In summary this: * - allows you to use MarchingSquaresJS at no cost * - allows you to use MarchingSquaresJS for both personal and commercial purposes * - allows you to distribute UNMODIFIED VERSIONS of MarchingSquaresJS under any * license as long as this license notice is included * - enables you to keep the source code of your program that uses MarchingSquaresJS * undisclosed * - forces you to share any modifications you have made to MarchingSquaresJS, * e.g. bug-fixes * * You should have received a copy of the GNU Affero General Public License * along with MarchingSquaresJS. If not, see . */var UIe={successCallback:null,verbose:!1,polygons:!1},Ab={};function _Gr(n,e,t,r){r=r||{};for(var i=Object.keys(UIe),a=0;a-1}function JGr(n,e,t){for(var r=n.length-1,i=n[0].length-1,a={rows:r,cols:i,cells:[]},o=e+Math.abs(t),s=0;so?128:64,u|=co?32:16,u|=fo?8:4,u|=do?2:1;var v=+u,p=0;if(u===17||u===18||u===33||u===34||u===38||u===68||u===72||u===98||u===102||u===132||u===136||u===137||u===152||u===153){var g=(h+c+f+d)/4;p=g>o?2:g0?(u=156,p=4):u=152:u===33?p>0?(u=139,p=4):u=137:u===72?p>0?(u=99,p=4):u=98:u===132&&(p>0?(u=39,p=4):u=38)}if(u!=0&&u!=170){var m,y,_,x,S,w,b,E;m=y=_=x=S=w=b=E=.5;var T=[];u===1?(_=1-he(e,f,d),E=1-he(e,h,d),T.push(En[u])):u===169?(_=he(o,d,f),E=he(o,d,h),T.push(En[u])):u===4?(w=1-he(e,c,f),x=he(e,d,f),T.push(Yr[u])):u===166?(w=he(o,f,c),x=1-he(o,f,d),T.push(Yr[u])):u===16?(S=he(e,f,c),y=he(e,h,c),T.push(Qr[u])):u===154?(S=1-he(o,c,f),y=1-he(o,c,h),T.push(Qr[u])):u===64?(b=he(e,d,h),m=1-he(e,c,h),T.push(Yn[u])):u===106?(b=1-he(o,h,d),m=he(o,h,c),T.push(Yn[u])):u===168?(x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),T.push(kn[u]),T.push(En[u])):u===2?(x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),T.push(kn[u]),T.push(En[u])):u===162?(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),T.push(kn[u]),T.push(En[u])):u===8?(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),T.push(Qr[u]),T.push(Yr[u])):u===138?(S=1-he(e,c,f),w=1-he(o,c,f),m=1-he(o,c,h),y=1-he(e,c,h),T.push(Qr[u]),T.push(Yr[u])):u===32?(S=he(o,f,c),w=he(e,f,c),m=he(e,h,c),y=he(o,h,c),T.push(Qr[u]),T.push(Yr[u])):u===42?(E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c),T.push(ei[u]),T.push(Yn[u])):u===128&&(E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h),T.push(ei[u]),T.push(Yn[u])),u===5?(w=1-he(e,c,f),E=1-he(e,h,d),T.push(Yr[u])):u===165?(w=he(o,f,c),E=he(o,d,h),T.push(Yr[u])):u===20?(x=he(e,d,f),y=he(e,h,c),T.push(kn[u])):u===150?(x=1-he(o,f,d),y=1-he(o,c,h),T.push(kn[u])):u===80?(S=he(e,f,c),b=he(e,d,h),T.push(Qr[u])):u===90?(S=1-he(o,c,f),b=1-he(o,h,d),T.push(Qr[u])):u===65?(_=1-he(e,f,d),m=1-he(e,c,h),T.push(En[u])):u===105?(_=he(o,d,f),m=he(o,h,c),T.push(En[u])):u===160?(S=he(o,f,c),w=he(e,f,c),E=he(e,d,h),b=he(o,d,h),T.push(Qr[u]),T.push(Yr[u])):u===10?(S=1-he(e,c,f),w=1-he(o,c,f),E=1-he(o,h,d),b=1-he(e,h,d),T.push(Qr[u]),T.push(Yr[u])):u===130?(x=1-he(e,f,d),_=1-he(o,f,d),m=1-he(o,c,h),y=1-he(e,c,h),T.push(kn[u]),T.push(En[u])):u===40?(x=he(o,d,f),_=he(e,d,f),m=he(e,h,c),y=he(o,h,c),T.push(kn[u]),T.push(En[u])):u===101?(w=he(o,f,c),m=he(o,h,c),T.push(Yr[u])):u===69?(w=1-he(e,c,f),m=1-he(e,c,h),T.push(Yr[u])):u===149?(E=he(o,d,h),y=1-he(o,c,h),T.push(ei[u])):u===21?(E=1-he(e,h,d),y=he(e,h,c),T.push(ei[u])):u===86?(x=1-he(o,f,d),b=1-he(o,h,d),T.push(kn[u])):u===84?(x=he(e,d,f),b=he(e,d,h),T.push(kn[u])):u===89?(S=1-he(o,c,f),_=he(o,d,f),T.push(En[u])):u===81?(S=he(e,f,c),_=1-he(e,f,d),T.push(En[u])):u===96?(S=he(o,f,c),w=he(e,f,c),b=he(e,d,h),m=he(o,h,c),T.push(Qr[u]),T.push(Yr[u])):u===74?(S=1-he(e,c,f),w=1-he(o,c,f),b=1-he(o,h,d),m=1-he(e,c,h),T.push(Qr[u]),T.push(Yr[u])):u===24?(S=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),y=he(e,h,c),T.push(Qr[u]),T.push(En[u])):u===146?(S=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),y=1-he(o,c,h),T.push(Qr[u]),T.push(En[u])):u===6?(w=1-he(e,c,f),x=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),T.push(Yr[u]),T.push(kn[u])):u===164?(w=he(o,f,c),x=he(e,d,f),E=he(e,d,h),b=he(o,d,h),T.push(Yr[u]),T.push(kn[u])):u===129?(_=1-he(e,f,d),E=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h),T.push(En[u]),T.push(ei[u])):u===41?(_=he(o,d,f),E=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c),T.push(En[u]),T.push(ei[u])):u===66?(x=1-he(e,f,d),_=1-he(o,f,d),b=1-he(o,h,d),m=1-he(e,c,h),T.push(kn[u]),T.push(En[u])):u===104?(x=he(o,d,f),_=he(e,d,f),b=he(e,d,h),m=he(o,h,c),T.push(En[u]),T.push($a[u])):u===144?(S=he(e,f,c),E=he(e,d,h),b=he(o,d,h),y=1-he(o,c,h),T.push(Qr[u]),T.push(Yn[u])):u===26?(S=1-he(o,c,f),E=1-he(o,h,d),b=1-he(e,h,d),y=he(e,h,c),T.push(Qr[u]),T.push(Yn[u])):u===36?(w=he(o,f,c),x=he(e,d,f),m=he(e,h,c),y=he(o,h,c),T.push(Yr[u]),T.push(kn[u])):u===134?(w=1-he(e,c,f),x=1-he(o,f,d),m=1-he(o,c,h),y=1-he(e,c,h),T.push(Yr[u]),T.push(kn[u])):u===9?(S=1-he(e,c,f),w=1-he(o,c,f),_=he(o,d,f),E=1-he(e,h,d),T.push(Qr[u]),T.push(Yr[u])):u===161?(S=he(o,f,c),w=he(e,f,c),_=1-he(e,f,d),E=he(o,d,h),T.push(Qr[u]),T.push(Yr[u])):u===37?(w=he(o,f,c),E=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c),T.push(Yr[u]),T.push(ei[u])):u===133?(w=1-he(e,c,f),E=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h),T.push(Yr[u]),T.push(ei[u])):u===148?(x=he(e,d,f),E=he(e,d,h),b=he(o,d,h),y=1-he(o,c,h),T.push(kn[u]),T.push(Yn[u])):u===22?(x=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),y=he(e,h,c),T.push(kn[u]),T.push(Yn[u])):u===82?(S=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),b=1-he(o,h,d),T.push(Qr[u]),T.push(En[u])):u===88?(S=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),b=he(e,d,h),T.push(Qr[u]),T.push(En[u])):u===73?(S=1-he(e,c,f),w=1-he(o,c,f),_=he(o,d,f),m=1-he(e,c,h),T.push(Qr[u]),T.push(Yr[u])):u===97?(S=he(o,f,c),w=he(e,f,c),_=1-he(e,f,d),m=he(o,h,c),T.push(Qr[u]),T.push(Yr[u])):u===145?(S=he(e,f,c),_=1-he(e,f,d),E=he(o,d,h),y=1-he(o,c,h),T.push(Qr[u]),T.push(ei[u])):u===25?(S=1-he(o,c,f),_=he(o,d,f),E=1-he(e,h,d),y=he(e,h,c),T.push(Qr[u]),T.push(ei[u])):u===70?(w=1-he(e,c,f),x=1-he(o,f,d),b=1-he(o,h,d),m=1-he(e,c,h),T.push(Yr[u]),T.push(kn[u])):u===100?(w=he(o,f,c),x=he(e,d,f),b=he(e,d,h),m=he(o,h,c),T.push(Yr[u]),T.push(kn[u])):u===34?(p===0?(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)):(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)),T.push(Qr[u]),T.push(Yr[u]),T.push(ei[u]),T.push(Yn[u])):u===35?(p===4?(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)):(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)),T.push(Qr[u]),T.push(Yr[u]),T.push(En[u]),T.push(Yn[u])):u===136?(p===0?(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)):(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)),T.push(Qr[u]),T.push(Yr[u]),T.push(ei[u]),T.push(Yn[u])):u===153?(p===0?(S=he(e,f,c),_=1-he(e,f,d),E=1-he(e,h,d),y=he(e,h,c)):(S=1-he(o,c,f),_=he(o,d,f),E=he(o,d,h),y=1-he(o,c,h)),T.push(Qr[u]),T.push(En[u])):u===102?(p===0?(w=1-he(e,c,f),x=he(e,d,f),b=he(e,d,h),m=1-he(e,c,h)):(w=he(o,f,c),x=1-he(o,f,d),b=1-he(o,h,d),m=he(o,h,c)),T.push(Yr[u]),T.push(Yn[u])):u===155?(p===4?(S=he(e,f,c),_=1-he(e,f,d),E=1-he(e,h,d),y=he(e,h,c)):(S=1-he(o,c,f),_=he(o,d,f),E=he(o,d,h),y=1-he(o,c,h)),T.push(Qr[u]),T.push(ei[u])):u===103?(p===4?(w=1-he(e,c,f),x=he(e,d,f),b=he(e,d,h),m=1-he(e,c,h)):(w=he(o,f,c),x=1-he(o,f,d),b=1-he(o,h,d),m=he(o,h,c)),T.push(Yr[u]),T.push(kn[u])):u===152?(p===0?(S=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),y=he(e,h,c)):(S=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),y=1-he(o,c,h)),T.push(Qr[u]),T.push(kn[u]),T.push(En[u])):u===156?(p===4?(S=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),y=he(e,h,c)):(S=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),y=1-he(o,c,h)),T.push(Qr[u]),T.push(En[u]),T.push(Yn[u])):u===137?(p===0?(S=he(o,f,c),w=he(e,f,c),_=1-he(e,f,d),E=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)):(S=1-he(e,c,f),w=1-he(o,c,f),_=he(o,d,f),E=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)),T.push(Qr[u]),T.push(Yr[u]),T.push(En[u])):u===139?(p===4?(S=he(o,f,c),w=he(e,f,c),_=1-he(e,f,d),E=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)):(S=1-he(e,c,f),w=1-he(o,c,f),_=he(o,d,f),E=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)),T.push(Qr[u]),T.push(Yr[u]),T.push(ei[u])):u===98?(p===0?(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),b=he(e,d,h),m=1-he(e,c,h)):(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),b=1-he(o,h,d),m=he(o,h,c)),T.push(Qr[u]),T.push(Yr[u]),T.push(Yn[u])):u===99?(p===4?(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),b=he(e,d,h),m=1-he(e,c,h)):(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),b=1-he(o,h,d),m=he(o,h,c)),T.push(Qr[u]),T.push(Yr[u]),T.push(En[u])):u===38?(p===0?(w=1-he(e,c,f),x=he(e,d,f),E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)):(w=he(o,f,c),x=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)),T.push(Yr[u]),T.push(ei[u]),T.push(Yn[u])):u===39?(p===4?(w=1-he(e,c,f),x=he(e,d,f),E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)):(w=he(o,f,c),x=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)),T.push(Yr[u]),T.push(kn[u]),T.push(Yn[u])):u===85&&(S=1,w=0,x=1,_=0,E=0,b=1,m=0,y=1),(m<0||m>1||y<0||y>1||S<0||S>1||x<0||x>1||E<0||E>1||b<0||b>1)&&console.log("MarchingSquaresJS-isoBands: "+u+" "+v+" "+h+","+c+","+f+","+d+" "+p+" "+m+" "+y+" "+S+" "+w+" "+x+" "+_+" "+E+" "+b),a.cells[s][l]={cval:u,cval_real:v,flipped:p,topleft:m,topright:y,righttop:S,rightbottom:w,bottomright:x,bottomleft:_,leftbottom:E,lefttop:b,edges:T}}}}}return a}function QGr(n){for(var e=[],t=n.rows,r=n.cols,i=[],a=0;a0){var s=n.cells[a][o],l=r9r(s),u=null,h=o,c=a;l!==null&&i.push([l.p[0]+h,l.p[1]+c]);do{if(u=n9r(n.cells[c][h],l.x,l.y,l.o),u!==null)i.push([u.p[0]+h,u.p[1]+c]),h+=u.x,c+=u.y,l=u;else break;if(c<0||c>=t||h<0||h>=r||typeof n.cells[c][h]>"u"){h-=u.x,c-=u.y;var f=e9r(n,h,c,u.x,u.y,u.o);if(f!==null)f.path.forEach(function(d){i.push(d)}),h=f.i,c=f.j,l=f;else break}}while(typeof n.cells[c][h]<"u"&&n.cells[c][h].edges.length>0);e.push(i),i=[],n.cells[a][o].edges.length>0&&o--}return e}function e9r(n,e,t,r,i,a){for(var o=n.cells[t][e],s=o.cval_real,l=e+r,u=t+i,h=[],c=!1;!c;){if(typeof n.cells[u]>"u"||typeof n.cells[u][l]>"u")if(u-=i,l-=r,o=n.cells[u][l],s=o.cval_real,i===-1)if(a===0)if(s&Rh)h.push([l,u]),r=-1,i=0,a=0;else if(s&th)h.push([l+1,u]),r=1,i=0,a=0;else{h.push([l+o.bottomright,u]),r=0,i=1,a=1,c=!0;break}else if(s&Rh)h.push([l,u]),r=-1,i=0,a=0;else if(s&th){h.push([l+o.bottomright,u]),r=0,i=1,a=1,c=!0;break}else{h.push([l+o.bottomleft,u]),r=0,i=1,a=0,c=!0;break}else if(i===1)if(a===0)if(s&Rp)h.push([l+1,u+1]),r=1,i=0,a=1;else if(s&lc){h.push([l+o.topleft,u+1]),r=0,i=-1,a=0,c=!0;break}else{h.push([l+o.topright,u+1]),r=0,i=-1,a=1,c=!0;break}else s&Rp?(h.push([l+1,u+1]),r=1,i=0,a=1):(h.push([l+1,u+1]),r=1,i=0,a=1);else if(r===-1)if(a===0)if(s&lc)h.push([l,u+1]),r=0,i=1,a=0;else if(s&Rh){h.push([l,u+o.leftbottom]),r=1,i=0,a=0,c=!0;break}else{h.push([l,u+o.lefttop]),r=1,i=0,a=1,c=!0;break}else if(s&lc)h.push([l,u+1]),r=0,i=1,a=0;else{console.log("MarchingSquaresJS-isoBands: wtf");break}else if(r===1)if(a===0)if(s&th)h.push([l+1,u]),r=0,i=-1,a=1;else{h.push([l+1,u+o.rightbottom]),r=-1,i=0,a=0,c=!0;break}else if(s&th)h.push([l+1,u]),r=0,i=-1,a=1;else if(s&Rp){h.push([l+1,u+o.righttop]),r=-1,i=0,a=1;break}else{h.push([l+1,u+o.rightbottom]),r=-1,i=0,a=0,c=!0;break}else{console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}else if(o=n.cells[u][l],s=o.cval_real,r===-1)if(a===0)if(typeof n.cells[u-1]<"u"&&typeof n.cells[u-1][l]<"u")r=0,i=-1,a=1;else if(s&Rh)h.push([l,u]);else{h.push([l+o.bottomright,u]),r=0,i=1,a=1,c=!0;break}else if(s&lc)console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!");else{console.log("MarchingSquaresJS-isoBands: found entry from top at "+l+","+u);break}else if(r===1)if(a===0){console.log("MarchingSquaresJS-isoBands: wtf");break}else if(typeof n.cells[u+1]<"u"&&typeof n.cells[u+1][l]<"u")r=0,i=1,a=0;else if(s&Rp)h.push([l+1,u+1]),r=1,i=0,a=1;else{h.push([l+o.topleft,u+1]),r=0,i=-1,a=0,c=!0;break}else if(i===-1)if(a===1)if(typeof n.cells[u][l+1]<"u")r=1,i=0,a=1;else if(s&th)h.push([l+1,u]),r=0,i=-1,a=1;else{h.push([l+1,u+o.righttop]),r=-1,i=0,a=1,c=!0;break}else{console.log("MarchingSquaresJS-isoBands: wtf");break}else if(i===1)if(a===0)if(typeof n.cells[u][l-1]<"u")r=-1,i=0,a=0;else if(s&lc)h.push([l,u+1]),r=0,i=1,a=0;else{h.push([l,u+o.leftbottom]),r=1,i=0,a=0,c=!0;break}else{console.log("MarchingSquaresJS-isoBands: wtf");break}else{console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(l+=r,u+=i,l===e&&u===t)break}return{path:h,i:l,j:u,x:r,y:i,o:a}}function t9r(n,e){delete n.edges[e];for(var t=e+1;t0){var e=n.edges[n.edges.length-1],t=n.cval_real;switch(e){case 0:return t&Rp?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.topleft,1],x:0,y:-1,o:0};case 1:return t&th?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 2:return t&th?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[n.topleft,1],x:0,y:-1,o:0};case 3:return t&Rh?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 4:return t&Rp?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.topright,1],x:0,y:-1,o:1};case 5:return t&th?{p:[n.topright,1],x:0,y:-1,o:1}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 6:return t&th?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[n.topright,1],x:0,y:-1,o:1};case 7:return t&Rh?{p:[n.topright,1],x:0,y:-1,o:1}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 8:return t&th?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[1,n.righttop],x:-1,y:0,o:1};case 9:return t&Rh?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 10:return t&Rh?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[1,n.righttop],x:-1,y:0,o:1};case 11:return t&lc?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[0,n.lefttop],x:1,y:0,o:1};case 12:return t&th?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 13:return t&Rh?{p:[1,n.rightbottom],x:-1,y:0,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 14:return t&Rh?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 15:return t&lc?{p:[1,n.rightbottom],x:-1,y:0,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 16:return t&th?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[0,n.leftbottom],x:1,y:0,o:0};case 17:return t&lc?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[0,n.lefttop],x:1,y:0,o:1};case 18:return t&Rh?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 19:return t&lc?{p:[n.bottomleft,0],x:0,y:1,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 20:return t&lc?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[0,n.leftbottom],x:1,y:0,o:0};case 21:return t&Rp?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[n.topright,1],x:0,y:-1,o:1};case 22:return t&lc?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 23:return t&Rp?{p:[0,n.lefttop],x:1,y:0,o:1}:{p:[n.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(n);break}}return null}function n9r(n,e,t,r){var i,a,o,s,l=n.cval,u;switch(e){case-1:switch(r){case 0:i=Yr[l],o=Ma[l],s=Ia[l],u=La[l];break;default:i=Qr[l],o=Ta[l],s=Ca[l],u=Aa[l];break}break;case 1:switch(r){case 0:i=ei[l],o=za[l],s=Ua[l],u=Va[l];break;default:i=Yn[l],o=Fa[l],s=Ba[l],u=Ga[l];break}break;default:switch(t){case-1:switch(r){case 0:i=$a[l],o=_a[l],s=xa[l],u=Sa[l];break;default:i=Ya[l],o=wa[l],s=ba[l],u=Ea[l];break}break;case 1:switch(r){case 0:i=En[l],o=Pa[l],s=Oa[l],u=Ra[l];break;default:i=kn[l],o=Da[l],s=Na[l],u=ka[l];break}break}break}if(a=n.edges.indexOf(i),typeof n.edges[a]<"u")t9r(n,a);else return null;switch(l=n.cval_real,i){case 0:l&Rp?(e=n.topleft,t=1):(e=1,t=n.righttop);break;case 1:l&th?(e=1,t=n.rightbottom):(e=n.topleft,t=1);break;case 2:l&th?(e=n.topleft,t=1):(e=n.bottomright,t=0);break;case 3:l&Rh?(e=n.bottomleft,t=0):(e=n.topleft,t=1);break;case 4:l&Rp?(e=n.topright,t=1):(e=1,t=n.righttop);break;case 5:l&th?(e=1,t=n.rightbottom):(e=n.topright,t=1);break;case 6:l&th?(e=n.topright,t=1):(e=n.bottomright,t=0);break;case 7:l&Rh?(e=n.bottomleft,t=0):(e=n.topright,t=1);break;case 8:l&th?(e=1,t=n.righttop):(e=n.bottomright,t=0);break;case 9:l&Rh?(e=n.bottomleft,t=0):(e=1,t=n.righttop);break;case 10:l&Rh?(e=1,t=n.righttop):(e=0,t=n.leftbottom);break;case 11:l&lc?(e=0,t=n.lefttop):(e=1,t=n.righttop);break;case 12:l&th?(e=1,t=n.rightbottom):(e=n.bottomright,t=0);break;case 13:l&Rh?(e=n.bottomleft,t=0):(e=1,t=n.rightbottom);break;case 14:l&Rh?(e=1,t=n.rightbottom):(e=0,t=n.leftbottom);break;case 15:l&lc?(e=0,t=n.lefttop):(e=1,t=n.rightbottom);break;case 16:l&th?(e=0,t=n.leftbottom):(e=n.bottomright,t=0);break;case 17:l&lc?(e=0,t=n.lefttop):(e=n.bottomright,t=0);break;case 18:l&Rh?(e=n.bottomleft,t=0):(e=0,t=n.leftbottom);break;case 19:l&lc?(e=0,t=n.lefttop):(e=n.bottomleft,t=0);break;case 20:l&lc?(e=0,t=n.leftbottom):(e=n.topleft,t=1);break;case 21:l&Rp?(e=n.topright,t=1):(e=0,t=n.leftbottom);break;case 22:l&lc?(e=0,t=n.lefttop):(e=n.topleft,t=1);break;case 23:l&Rp?(e=n.topright,t=1):(e=0,t=n.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(n),null}return(typeof e>"u"||typeof t>"u"||typeof o>"u"||typeof s>"u"||typeof u>"u")&&(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(n),console.log(e+" "+t+" "+o+" "+s+" "+u)),{p:[e,t],x:o,y:s,o:u}}function i9r(n){var e=[],t=0;return n.cells.forEach(function(r,i){r.forEach(function(a,o){if(typeof a<"u"){var s=zr[a.cval](a);typeof s=="object"&&_Z(s)?typeof s[0]=="object"&&_Z(s[0])?typeof s[0][0]=="object"&&_Z(s[0][0])?s.forEach(function(l){l.forEach(function(u){u[0]+=o,u[1]+=i}),e[t++]=l}):(s.forEach(function(l){l[0]+=o,l[1]+=i}),e[t++]=s):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),e}function a9r(n,e,t){if(t=t||{},!Io(t))throw new Error("options is invalid");var r=t.zProperty||"elevation",i=t.commonProperties||{},a=t.breaksProperties||[];if(Y_(n,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!Io(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(a))throw new Error("breaksProperties is not an Array");var o=yGr(n,{zProperty:r,flip:!0}),s=o9r(o,e,r);s=s9r(s,o,n);var l=s.map(function(u,h){if(a[h]&&!Io(a[h]))throw new Error("Each mappedProperty is required to be an Object");var c=Ghe({},i,a[h]);c[r]=u[r];var f=Ld(u.groupedRings,c);return f});return Zn(l)}function o9r(n,e,t){for(var r=[],i=1;i0){var h=r[l-1],c=_9r(u,h);c!==!1&&(h[1]=c,u[0]=c),o.push(h[0]),l===a.length-2&&(o.push(u[0]),o.push(u[1]))}a.length===2&&(o.push(u[0]),o.push(u[1]))}}),yo(o,n.properties)}function S9r(n,e,t){var r=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),i=n[0]+t*(e[1]-n[1])/r,a=e[0]+t*(e[1]-n[1])/r,o=n[1]+t*(n[0]-e[0])/r,s=e[1]+t*(n[0]-e[0])/r;return[[i,o],[a,s]]}function w9r(n){return(n>0)-(n<0)||+n}function fce(n,e,t){var r=e[0]-n[0],i=e[1]-n[1],a=t[0]-e[0],o=t[1]-e[1];return w9r(r*o-a*i)}function b9r(n,e){var t=n.geometry.coordinates[0].map(function(o){return o[0]}),r=n.geometry.coordinates[0].map(function(o){return o[1]}),i=e.geometry.coordinates[0].map(function(o){return o[0]}),a=e.geometry.coordinates[0].map(function(o){return o[1]});return Math.max.apply(null,t)===Math.max.apply(null,i)&&Math.max.apply(null,r)===Math.max.apply(null,a)&&Math.min.apply(null,t)===Math.min.apply(null,i)&&Math.min.apply(null,r)===Math.min.apply(null,a)}function WIe(n,e){return e.geometry.coordinates[0].every(function(t){return ss(Vi(t),n)})}function E9r(n,e){return n[0]===e[0]&&n[1]===e[1]}var T9r=function(){function n(e){this.id=n.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return n.buildId=function(e){return e.join(",")},n.prototype.removeInnerEdge=function(e){this.innerEdges=this.innerEdges.filter(function(t){return t.from.id!==e.from.id})},n.prototype.removeOuterEdge=function(e){this.outerEdges=this.outerEdges.filter(function(t){return t.to.id!==e.to.id})},n.prototype.addOuterEdge=function(e){this.outerEdges.push(e),this.outerEdgesSorted=!1},n.prototype.sortOuterEdges=function(){var e=this;this.outerEdgesSorted||(this.outerEdges.sort(function(t,r){var i=t.to,a=r.to;if(i.coordinates[0]-e.coordinates[0]>=0&&a.coordinates[0]-e.coordinates[0]<0)return 1;if(i.coordinates[0]-e.coordinates[0]<0&&a.coordinates[0]-e.coordinates[0]>=0)return-1;if(i.coordinates[0]-e.coordinates[0]===0&&a.coordinates[0]-e.coordinates[0]===0)return i.coordinates[1]-e.coordinates[1]>=0||a.coordinates[1]-e.coordinates[1]>=0?i.coordinates[1]-a.coordinates[1]:a.coordinates[1]-i.coordinates[1];var o=fce(e.coordinates,i.coordinates,a.coordinates);if(o<0)return 1;if(o>0)return-1;var s=Math.pow(i.coordinates[0]-e.coordinates[0],2)+Math.pow(i.coordinates[1]-e.coordinates[1],2),l=Math.pow(a.coordinates[0]-e.coordinates[0],2)+Math.pow(a.coordinates[1]-e.coordinates[1],2);return s-l}),this.outerEdgesSorted=!0)},n.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},n.prototype.getOuterEdge=function(e){return this.sortOuterEdges(),this.outerEdges[e]},n.prototype.addInnerEdge=function(e){this.innerEdges.push(e)},n}();const HIe=T9r;var C9r=function(){function n(e,t){this.from=e,this.to=t,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return n.prototype.getSymetric=function(){return this.symetric||(this.symetric=new n(this.to,this.from),this.symetric.symetric=this),this.symetric},n.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},n.prototype.isEqual=function(e){return this.from.id===e.from.id&&this.to.id===e.to.id},n.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},n.prototype.toLineString=function(){return yo([this.from.coordinates,this.to.coordinates])},n.prototype.compareTo=function(e){return fce(e.from.coordinates,e.to.coordinates,this.to.coordinates)},n}();const A9r=C9r;var M9r=function(){function n(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return n.prototype.push=function(e){this.edges.push(e),this.polygon=this.envelope=void 0},n.prototype.get=function(e){return this.edges[e]},Object.defineProperty(n.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),n.prototype.forEach=function(e){this.edges.forEach(e)},n.prototype.map=function(e){return this.edges.map(e)},n.prototype.some=function(e){return this.edges.some(e)},n.prototype.isValid=function(){return!0},n.prototype.isHole=function(){var e=this,t=this.edges.reduce(function(o,s,l){return s.from.coordinates[1]>e.edges[o].from.coordinates[1]&&(o=l),o},0),r=(t===0?this.length:t)-1,i=(t+1)%this.length,a=fce(this.edges[r].from.coordinates,this.edges[t].from.coordinates,this.edges[i].from.coordinates);return a===0?this.edges[r].from.coordinates[0]>this.edges[i].from.coordinates[0]:a>0},n.prototype.toMultiPoint=function(){return $k(this.edges.map(function(e){return e.from.coordinates}))},n.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var e=this.edges.map(function(t){return t.from.coordinates});return e.push(this.edges[0].from.coordinates),this.polygon=Qi([e])},n.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=WZe(this.toPolygon())},n.findEdgeRingContaining=function(e,t){var r=e.getEnvelope(),i,a;return t.forEach(function(o){var s=o.getEnvelope();if(a&&(i=a.getEnvelope()),!b9r(s,r)&&WIe(s,r)){for(var l=e.map(function(v){return v.from.coordinates}),u=void 0,h=function(v){o.some(function(p){return E9r(v,p.from.coordinates)})||(u=v)},c=0,f=l;c"u"?Object.keys(this.nodes).forEach(function(r){return t._computeNextCWEdges(t.nodes[r])}):e.getOuterEdges().forEach(function(r,i){e.getOuterEdge((i===0?e.getOuterEdges().length:i)-1).symetric.next=r})},n.prototype._computeNextCCWEdges=function(e,t){for(var r=e.getOuterEdges(),i,a,o=r.length-1;o>=0;--o){var s=r[o],l=s.symetric,u=void 0,h=void 0;s.label===t&&(u=s),l.label===t&&(h=l),!(!u||!h)&&(h&&(a=h),u&&(a&&(a.next=u,a=void 0),i||(i=u)))}a&&(a.next=i)},n.prototype._findLabeledEdgeRings=function(){var e=[],t=0;return this.edges.forEach(function(r){if(!(r.label>=0)){e.push(r);var i=r;do i.label=t,i=i.next;while(!r.isEqual(i));t++}}),e},n.prototype.getEdgeRings=function(){var e=this;this._computeNextCWEdges(),this.edges.forEach(function(r){r.label=void 0}),this._findLabeledEdgeRings().forEach(function(r){e._findIntersectionNodes(r).forEach(function(i){e._computeNextCCWEdges(i,r.label)})});var t=[];return this.edges.forEach(function(r){r.ring||t.push(e._findEdgeRing(r))}),t},n.prototype._findIntersectionNodes=function(e){var t=[],r=e,i=function(){var a=0;r.from.getOuterEdges().forEach(function(o){o.label===e.label&&++a}),a>1&&t.push(r.from),r=r.next};do i();while(!e.isEqual(r));return t},n.prototype._findEdgeRing=function(e){var t=e,r=new XKe;do r.push(t),t.ring=r,t=t.next;while(!e.isEqual(t));return r},n.prototype.removeNode=function(e){var t=this;e.getOuterEdges().forEach(function(r){return t.removeEdge(r)}),e.innerEdges.forEach(function(r){return t.removeEdge(r)}),delete this.nodes[e.id]},n.prototype.removeEdge=function(e){this.edges=this.edges.filter(function(t){return!t.isEqual(e)}),e.deleteEdge()},n}();const P9r=L9r;function O9r(n){var e=P9r.fromGeoJson(n);e.deleteDangles(),e.deleteCutEdges();var t=[],r=[];return e.getEdgeRings().filter(function(i){return i.isValid()}).forEach(function(i){i.isHole()?t.push(i):r.push(i)}),t.forEach(function(i){XKe.findEdgeRingContaining(i,r)&&r.push(i)}),Zn(r.map(function(i){return i.toPolygon()}))}function YKe(n,e){var t=!0;return fh(n,function(r){fh(e,function(i){if(t===!1)return!1;t=R9r(r.geometry,i.geometry)})}),t}function R9r(n,e){switch(n.type){case"Point":switch(e.type){case"Point":return!F9r(n.coordinates,e.coordinates);case"LineString":return!jIe(e,n);case"Polygon":return!ss(n,e)}break;case"LineString":switch(e.type){case"Point":return!jIe(n,e);case"LineString":return!D9r(n,e);case"Polygon":return!XIe(e,n)}break;case"Polygon":switch(e.type){case"Point":return!ss(e,n);case"LineString":return!XIe(n,e);case"Polygon":return!N9r(e,n)}}return!1}function jIe(n,e){for(var t=0;t0}function XIe(n,e){for(var t=0,r=e.coordinates;t0}function N9r(n,e){for(var t=0,r=n.coordinates[0];t0}function k9r(n,e,t){var r=t[0]-n[0],i=t[1]-n[1],a=e[0]-n[0],o=e[1]-n[1],s=r*o-i*a;return s!==0?!1:Math.abs(a)>=Math.abs(o)?a>0?n[0]<=t[0]&&t[0]<=e[0]:e[0]<=t[0]&&t[0]<=n[0]:o>0?n[1]<=t[1]&&t[1]<=e[1]:e[1]<=t[1]&&t[1]<=n[1]}function F9r(n,e){return n[0]===e[0]&&n[1]===e[1]}function B9r(n,e){var t=ls(n),r=ls(e),i=t.type,a=r.type,o=t.coordinates,s=r.coordinates;switch(i){case"Point":switch(a){case"Point":return dce(o,s);default:throw new Error("feature2 "+a+" geometry not supported")}case"MultiPoint":switch(a){case"Point":return G9r(t,r);case"MultiPoint":return z9r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"LineString":switch(a){case"Point":return yd(r,t,{ignoreEndVertices:!0});case"LineString":return $9r(t,r);case"MultiPoint":return U9r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"Polygon":switch(a){case"Point":return ss(r,t,{ignoreBoundary:!0});case"LineString":return W9r(t,r);case"Polygon":return H9r(t,r);case"MultiPoint":return V9r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function G9r(n,e){var t,r=!1;for(t=0;te[0]||n[2]e[1]||n[3]0)for(var r=0;r0}function ZIe(n,e){for(var t=!1,r=!1,i=n.coordinates.length,a=0;a=Math.abs(s)?o>0?n[0]<=t[0]&&t[0]<=e[0]:e[0]<=t[0]&&t[0]<=n[0]:s>0?n[1]<=t[1]&&t[1]<=e[1]:e[1]<=t[1]&&t[1]<=n[1]:Math.abs(o)>=Math.abs(s)?o>0?n[0]0?n[1]=0&&(t=[].concat(n.slice(r,n.length),n.slice(1,r+1))),t};Gm.prototype.comparePath=function(n,e){var t=this;return n.every(function(r,i){return t.compareCoord(r,this[i])},e)};Gm.prototype.comparePolygon=function(n,e){if(this.compareLine(n.coordinates[0],e.coordinates[0],1,!0)){var t=n.coordinates.slice(1,n.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return t.every(function(a){return this.some(function(o){return i.compareLine(a,o,1,!0)})},r)}else return!1};Gm.prototype.compareFeature=function(n,e){return n.id!==e.id||!this.objectComparator(n.properties,e.properties)||!this.compareBBox(n,e)?!1:this.compare(n.geometry,e.geometry)};Gm.prototype.compareBBox=function(n,e){return!!(!n.bbox&&!e.bbox||n.bbox&&e.bbox&&this.compareCoord(n.bbox,e.bbox))};Gm.prototype.removePseudo=function(n){return n};function Z9r(n,e){return q9r(n,e,{strict:!0})}var K9r=Gm;const JKe=K9r;function J9r(n,e){var t=ls(n),r=ls(e),i=t.type,a=r.type;if(i==="MultiPoint"&&a!=="MultiPoint"||(i==="LineString"||i==="MultiLineString")&&a!=="LineString"&&a!=="MultiLineString"||(i==="Polygon"||i==="MultiPolygon")&&a!=="Polygon"&&a!=="MultiPolygon")throw new Error("features must be of the same type");if(i==="Point")throw new Error("Point geometry not supported");var o=new JKe({precision:6});if(o.compare(n,e))return!1;var s=0;switch(i){case"MultiPoint":for(var l=0;l0}function Q9r(n,e){var t=ls(n).type,r=ls(e).type;if(t!==r)return!1;var i=new JKe({precision:6});return i.compare(E2(n),E2(e))}function QKe(n,e){var t=!1;return fh(n,function(r){fh(e,function(i){if(t===!0)return!0;t=!YKe(r.geometry,i.geometry)})}),t}var eJe={exports:{}},xZ={exports:{}},JIe;function e7r(){return JIe||(JIe=1,function(n){function e(t,r,i,a){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,r,i,a)}e.prototype.run=function(t,r,i,a){this._init(t,r,i,a);for(var o=0;o=this.minPts&&(r=this._mergeArrays(r,o))}this._assigned[a]!==1&&this._addToCluster(a,t)}},e.prototype._addToCluster=function(t,r){this.clusters[r].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var r=[],i=0;i0){for(var h=0;h=0);return r},e.prototype.assign=function(){for(var t=!1,r=this.dataset.length,i,a=0;a"u"&&(t[r]=[]),t[r].push(i);return t},e.prototype.argmin=function(t,r,i){for(var a=Number.MAX_VALUE,o=0,s=r.length,l,u=0;uo&&(i=a):r=this.minPts)return a}},t.prototype._regionQuery=function(r,i){i=i||this.epsilon;for(var a=[],o=0,s=this.dataset.length;o0;i.length0;){var l=e[Math.floor(Math.random()*o)],u=s?l.join("_"):""+l;r[u]||(r[u]=!0,i.push(l))}if(i.length0,s=e[Math.floor(Math.random()*a)];for(o?s.join("_"):""+s,i.push(s);i.length0,d=[];if(t)t=="kmrand"?i=h7r(n,e):t=="kmpp"?i=c7r(n,e):i=t;else for(var v={};i.lengtht&&(e.numberOfClusters=t),e.mutate!==!0&&(n=Xh(n));var r=KM(n),i=r.slice(0,e.numberOfClusters),a=d7r(r,e.numberOfClusters,i),o={};return a.centroids.forEach(function(s,l){o[l]=s}),uo(n,function(s,l){var u=a.idxs[l];s.properties.cluster=u,s.properties.centroid=o[u]}),n}function p7r(n,e){if(!n)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");var t=iLe(n,"line1");if(t!=="LineString")throw new Error("line1 must be a LineString");var r=iLe(e,"line2");if(r!=="LineString")throw new Error("line2 must be a LineString");for(var i=C2(E2(n)).features,a=C2(E2(e)).features,o=0;o0;){var l=o.pop();if(l===t)return aLe(l);l.closed=!0;for(var u=n.neighbors(l),h=0,c=u.length;h0&&(this.content[0]=e,this.bubbleUp(0)),n},remove:function(n){var e=this.content.indexOf(n),t=this.content.pop();e!==this.content.length-1&&(this.content[e]=t,this.scoreFunction(t)0;){var t=(n+1>>1)-1,r=this.content[t];if(this.scoreFunction(e)=f;){for(var G=[],W=[],z=c+b,V=0;z<=d;){var q=Vi([z,k]),Y=_7r(q,a);G.push(Y?0:1),W.push(z+"|"+k);var le=Mo(q,n);!Y&&le0)){if(p/=d,d<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=r-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p0)){if(p/=v,v<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=i-l,!(!v&&p<0)){if(p/=v,v<0){if(p>f)return;p>c&&(c=p)}else if(v>0){if(p0)&&!(f<1)||(c>0&&(n[0]=[s+c*d,l+c*v]),f<1&&(n[1]=[s+f*d,l+f*v])),!0}}}}}function b7r(n,e,t,r,i){var a=n[1];if(a)return!0;var o=n[0],s=n.left,l=n.right,u=s[0],h=s[1],c=l[0],f=l[1],d=(u+c)/2,v=(h+f)/2,p,g;if(f===h){if(d=r)return;if(u>c){if(!o)o=[d,t];else if(o[1]>=i)return;a=[d,i]}else{if(!o)o=[d,i];else if(o[1]1)if(u>c){if(!o)o=[(t-g)/p,t];else if(o[1]>=i)return;a=[(i-g)/p,i]}else{if(!o)o=[(i-g)/p,i];else if(o[1]=r)return;a=[r,p*r+g]}else{if(!o)o=[r,p*r+g];else if(o[0]vs||Math.abs(a[0][1]-a[1][1])>vs))&&delete Nc[i]}function T7r(n){return hv[n.index]={site:n,halfedges:[]}}function C7r(n,e){var t=n.site,r=e.left,i=e.right;return t===i&&(i=r,r=t),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(t===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function oJe(n,e){return e[+(e.left!==n.site)]}function A7r(n,e){return e[+(e.left===n.site)]}function M7r(){for(var n=0,e=hv.length,t,r,i,a;nvs||Math.abs(g-d)>vs)&&(u.splice(l,0,Nc.push(HP(s,v,Math.abs(p-n)vs?[n,Math.abs(f-n)vs?[Math.abs(d-r)vs?[t,Math.abs(f-t)vs?[Math.abs(d-e)=-N7r)){var d=l*l+u*u,v=h*h+c*c,p=(c*d-u*v)/f,g=(l*v-h*d)/f,m=sJe.pop()||new L7r;m.arc=n,m.site=i,m.x=p+o,m.y=(m.cy=g+s)+Math.sqrt(p*p+g*g),n.circle=m;for(var y=null,_=LN._;_;)if(m.y<_.y||m.y===_.y&&m.x<=_.x)if(_.L)_=_.L;else{y=_.P;break}else if(_.R)_=_.R;else{y=_;break}LN.insert(y,m),y||(vce=m)}}}}function oM(n){var e=n.circle;e&&(e.P||(vce=e.N),LN.remove(e),sJe.push(e),A$(e),n.circle=null)}var lJe=[];function P7r(){A$(this),this.edge=this.site=this.circle=null}function lLe(n){var e=lJe.pop()||new P7r;return e.site=n,e}function EZ(n){oM(n),sM.remove(n),lJe.push(n),A$(n)}function O7r(n){var e=n.circle,t=e.x,r=e.cy,i=[t,r],a=n.P,o=n.N,s=[n];EZ(n);for(var l=a;l.circle&&Math.abs(t-l.circle.x)vs)s=s.L;else if(o=e-D7r(s,t),o>vs){if(!s.R){r=s;break}s=s.R}else{a>-vs?(r=s.P,i=s):o>-vs?(r=s,i=s.N):r=i=s;break}T7r(n);var l=lLe(n);if(sM.insert(r,l),!(!r&&!i)){if(r===i){oM(r),i=lLe(r.site),sM.insert(l,i),l.edge=i.edge=kO(r.site,l.site),OA(r),OA(i);return}if(!i){l.edge=kO(r.site,l.site);return}oM(r),oM(i);var u=r.site,h=u[0],c=u[1],f=n[0]-h,d=n[1]-c,v=i.site,p=v[0]-h,g=v[1]-c,m=2*(f*g-d*p),y=f*f+d*d,_=p*p+g*g,x=[(g*y-d*_)/m+h,(f*_-p*y)/m+c];z7(i.edge,u,v,x),l.edge=kO(u,n,null,x),i.edge=kO(n,v,null,x),OA(r),OA(i)}}function uJe(n,e){var t=n.site,r=t[0],i=t[1],a=i-e;if(!a)return r;var o=n.P;if(!o)return-1/0;t=o.site;var s=t[0],l=t[1],u=l-e;if(!u)return s;var h=s-r,c=1/a-1/u,f=h/u;return c?(-f+Math.sqrt(f*f-2*c*(h*h/(-2*u)-l+u/2+i-a/2)))/c+r:(r+s)/2}function D7r(n,e){var t=n.N;if(t)return uJe(t,e);var r=n.site;return r[1]===e?r[0]:1/0}var vs=1e-6,N7r=1e-12,sM,hv,LN,Nc;function k7r(n,e,t){return(n[0]-t[0])*(e[1]-n[1])-(n[0]-e[0])*(t[1]-n[1])}function F7r(n,e){return e[1]-n[1]||e[0]-n[0]}function kre(n,e){var t=n.sort(F7r).pop(),r,i,a;for(Nc=[],hv=new Array(n.length),sM=new G7,LN=new G7;;)if(a=vce,t&&(!a||t[1]=o)return null;var l=n-s.site[0],u=e-s.site[1],h=l*l+u*u;do s=r.cells[i=a],a=null,s.halfedges.forEach(function(c){var f=r.edges[c],d=f.left;if(!((d===s.site||!d)&&!(d=f.right))){var v=n-d[0],p=e-d[1],g=v*v+p*p;g=-270&&(v=-v),d<-180&&d>=-360&&(p=-p),a==="degrees"){var g=v*Math.cos(h)+p*Math.sin(h),m=p*Math.cos(h)-v*Math.sin(h);v=g,p=m}c.push([v+u[0],p+u[1]])}return c.push(c[0]),a==="degrees"?Qi([c],l):HKe(Qi([c],l),o,{pivot:s})}function uLe(n){var e=n*Math.PI/180;return Math.tan(e)}function pce(n,e){e===void 0&&(e={});var t=0,r=0,i=0;return Pd(n,function(a,o,s){var l=e.weight?s==null?void 0:s[e.weight]:void 0;if(l=l==null?1:l,!Gu(l))throw new Error("weight value must be a number for feature index "+o);l=Number(l),l>0&&gl(a,function(u){t+=u[0]*l,r+=u[1]*l,i+=l})}),Vi([t/i,r/i],e.properties,e)}function U7r(n,e){if(e===void 0&&(e={}),e=e||{},!Io(e))throw new Error("options is invalid");var t=e.counter||10;if(!Gu(t))throw new Error("counter must be a number");var r=e.weight,i=pce(n,{weight:e.weight}),a=Zn([]);uo(n,function(s){var l;a.features.push(ow(s,{properties:{weight:(l=s.properties)===null||l===void 0?void 0:l[r]}}))});var o={tolerance:e.tolerance,medianCandidates:[]};return cJe(i.geometry.coordinates,[0,0],a,o,t)}function cJe(n,e,t,r,i){var a=r.tolerance||.001,o=0,s=0,l=0,u=0;if(uo(t,function(f){var d,v=(d=f.properties)===null||d===void 0?void 0:d.weight,p=v==null?1:v;if(p=Number(p),!Gu(p))throw new Error("weight value must be a number");if(p>0){u+=1;var g=p*Mo(f,n);g===0&&(g=1);var m=p/g;o+=f.geometry.coordinates[0]*m,s+=f.geometry.coordinates[1]*m,l+=m}}),u<1)throw new Error("no features to measure");var h=o/l,c=s/l;return u===1||i===0||Math.abs(h-e[0])0&&(l=Qi(s).geometry),H7r(l,u),s=u.slice(0);t.push(Qi(s,o));break;case"MultiPolygon":s=[[[]]];for(var c=0;c0&&(l=Ld(s).geometry),j7r(l,u),s=u.slice(0);t.push(Ld(s,o));break;default:throw new Error("geometry is invalid, must be Polygon or MultiPolygon")}}),Zn(t)}function H7r(n,e){var t=0,r=0;gl(n,function(i,a,o,s,l){l>t&&(t=l,r=a,e.push([]));var u=a-r,h=n.coordinates[l][u+1],c=i[0],f=i[1],d=h[0],v=h[1];e[l].push([.75*c+.25*d,.75*f+.25*v]),e[l].push([.25*c+.75*d,.25*f+.75*v])},!0),e.forEach(function(i){i.push(i[0])})}function j7r(n,e){var t=0,r=0,i=0;gl(n,function(a,o,s,l,u){l>i&&(i=l,r=o,e.push([[]])),u>t&&(t=u,r=o,e[l].push([]));var h=o-r,c=n.coordinates[l][u][h+1],f=a[0],d=a[1],v=c[0],p=c[1];e[l][u].push([.75*f+.25*v,.75*d+.25*p]),e[l][u].push([.25*f+.75*v,.25*d+.75*p])},!0),e.forEach(function(a){a.forEach(function(o){o.push(o[0])})})}function X7r(n,e,t){t===void 0&&(t=2);var r=Wo(n),i=Wo(e),a=r[0]-i[0],o=r[1]-i[1];return t===1?Math.abs(a)+Math.abs(o):Math.pow(Math.pow(a,t)+Math.pow(o,t),1/t)}function fJe(n,e){e=e||{};var t=e.threshold||1e4,r=e.p||2,i=e.binary||!1,a=e.alpha||-1,o=e.standardization||!1,s=[];uo(n,function(d){s.push(ow(d))});for(var l=[],u=0;ur&&(a[0]=r),a[0]<-r&&(a[0]=-r),a[1]>r&&(a[1]=r),a[1]<-r&&(a[1]=-r),a}function fLe(n){var e=180/Math.PI,t=6378137;return[n[0]*e/t,(Math.PI*.5-2*Math.atan(Math.exp(-n[1]/t)))*e]}function Z7r(n){return n<0?-1:n>0?1:0}const K7r=Object.freeze(Object.defineProperty({__proto__:null,toMercator:vJe,toWgs84:pJe},Symbol.toStringTag,{value:"Module"}));var J7r=globalThis&&globalThis.__spreadArrays||function(){for(var n=0,e=0,t=arguments.length;e0?l+h[u-1]:l}),s.forEach(function(l){l=l*2*Math.PI/s[s.length-1];var u=Math.random();o.push([u*(e.max_radial_length||10)*Math.sin(l),u*(e.max_radial_length||10)*Math.cos(l)])}),o[o.length-1]=o[0],o=o.map(Q7r(qk(e.bbox))),t.push(Qi([o]))},i=0;i * @license MIT * @preserve *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */function izr(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(h){return l([u,h])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]e?1:n0){if(e.right===null)break;if(t(n,e.right.key)>0){var s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}i.right=e,i=e,e=e.right}else break}return i.right=e.left,a.left=e.right,e.left=r.right,e.right=r.left,e}function TZ(n,e,t,r){var i=new sw(n,e);if(t===null)return i.left=i.right=null,i;t=qx(n,t,r);var a=r(n,t.key);return a<0?(i.left=t.left,i.right=t,t.left=null):a>=0&&(i.right=t.right,i.left=t,t.right=null),i}function vLe(n,e,t){var r=null,i=null;if(e){e=qx(n,e,t);var a=t(e.key,n);a===0?(r=e.left,i=e.right):a<0?(i=e.right,e.right=null,r=e):(r=e.left,e.left=null,i=e)}return{left:r,right:i}}function ozr(n,e,t){return e===null?n:(n===null||(e=qx(n.key,e,t),e.left=n),e)}function Fre(n,e,t,r,i){if(n){r(""+e+(t?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+i(n)+` `);var a=e+(t?" ":"\u2502 ");n.left&&Fre(n.left,a,!1,r,i),n.right&&Fre(n.right,a,!0,r,i)}}var _ce=function(){function n(e){e===void 0&&(e=azr),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,t){return this._size++,this._root=TZ(e,t,this._root,this._comparator)},n.prototype.add=function(e,t){var r=new sw(e,t);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,a=qx(e,this._root,i),o=i(e,a.key);return o===0?this._root=a:(o<0?(r.left=a.left,r.right=a,a.left=null):o>0&&(r.right=a.right,r.left=a,a.right=null),this._size++,this._root=r),this._root},n.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},n.prototype._remove=function(e,t,r){var i;if(t===null)return null;t=qx(e,t,r);var a=r(e,t.key);return a===0?(t.left===null?i=t.right:(i=qx(e,t.left,r),i.right=t.right),this._size--,i):t},n.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=qx(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},n.prototype.findStatic=function(e){for(var t=this._root,r=this._comparator;t;){var i=r(e,t.key);if(i===0)return t;i<0?t=t.left:t=t.right}return null},n.prototype.find=function(e){return this._root&&(this._root=qx(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},n.prototype.contains=function(e){for(var t=this._root,r=this._comparator;t;){var i=r(e,t.key);if(i===0)return!0;i<0?t=t.left:t=t.right}return!1},n.prototype.forEach=function(e,t){for(var r=this._root,i=[],a=!1;!a;)r!==null?(i.push(r),r=r.left):i.length!==0?(r=i.pop(),e.call(t,r),r=r.right):a=!0;return this},n.prototype.range=function(e,t,r,i){for(var a=[],o=this._comparator,s=this._root,l;a.length!==0||s;)if(s)a.push(s),s=s.left;else{if(s=a.pop(),l=o(s.key,t),l>0)break;if(o(s.key,e)>=0&&r.call(i,s))return this;s=s.right}return this},n.prototype.keys=function(){var e=[];return this.forEach(function(t){var r=t.key;return e.push(r)}),e},n.prototype.values=function(){var e=[];return this.forEach(function(t){var r=t.data;return e.push(r)}),e},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},n.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},n.prototype.at=function(e){for(var t=this._root,r=!1,i=0,a=[];!r;)if(t)a.push(t),t=t.left;else if(a.length>0){if(t=a.pop(),i===e)return t;i++,t=t.right}else r=!0;return null},n.prototype.next=function(e){var t=this._root,r=null;if(e.right){for(r=e.right;r.left;)r=r.left;return r}for(var i=this._comparator;t;){var a=i(e.key,t.key);if(a===0)break;a<0?(r=t,t=t.left):t=t.right}return r},n.prototype.prev=function(e){var t=this._root,r=null;if(e.left!==null){for(r=e.left;r.right;)r=r.right;return r}for(var i=this._comparator;t;){var a=i(e.key,t.key);if(a===0)break;a<0?t=t.left:(r=t,t=t.right)}return r},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return lzr(this._root)},n.prototype.load=function(e,t,r){t===void 0&&(t=[]),r===void 0&&(r=!1);var i=e.length,a=this._comparator;if(r&&zre(e,t,0,i-1,a),this._root===null)this._root=Bre(e,t,0,i),this._size=i;else{var o=uzr(this.toList(),szr(e,t),a);i=this._size+i,this._root=Gre({head:o},0,i)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){e===void 0&&(e=function(r){return String(r.key)});var t=[];return Fre(this._root,"",!0,function(r){return t.push(r)},e),t.join("")},n.prototype.update=function(e,t,r){var i=this._comparator,a=vLe(e,this._root,i),o=a.left,s=a.right;i(e,t)<0?s=TZ(t,r,s,i):o=TZ(t,r,o,i),this._root=ozr(o,s,i)},n.prototype.split=function(e){return vLe(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,r;return izr(this,function(i){switch(i.label){case 0:e=this._root,t=[],r=!1,i.label=1;case 1:return r?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return i.sent(),e=e.right,[3,5];case 4:r=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function Bre(n,e,t,r){var i=r-t;if(i>0){var a=t+Math.floor(i/2),o=n[a],s=e[a],l=new sw(o,s);return l.left=Bre(n,e,t,a),l.right=Bre(n,e,a+1,r),l}return null}function szr(n,e){for(var t=new sw(null,null),r=t,i=0;i0?(e=a=a.next=t.pop(),e=e.right):r=!0;return a.next=null,i.next}function Gre(n,e,t){var r=t-e;if(r>0){var i=e+Math.floor(r/2),a=Gre(n,e,i),o=n.head;return o.left=a,n.head=n.head.next,o.right=Gre(n,i+1,t),o}return null}function uzr(n,e,t){for(var r=new sw(null,null),i=r,a=n,o=e;a!==null&&o!==null;)t(a.key,o.key)<0?(i.next=a,a=a.next):(i.next=o,o=o.next),i=i.next;return a!==null?i.next=a:o!==null&&(i.next=o),r.next}function zre(n,e,t,r,i){if(!(t>=r)){for(var a=n[t+r>>1],o=t-1,s=r+1;;){do o++;while(i(n[o],a)<0);do s--;while(i(n[s],a)>0);if(o>=s)break;var l=n[o];n[o]=n[s],n[s]=l,l=e[o],e[o]=e[s],e[s]=l}zre(n,e,t,s,i),zre(n,e,s+1,r,i)}}const e_=11102230246251565e-32,Mc=134217729,hzr=(3+8*e_)*e_;function CZ(n,e,t,r,i){let a,o,s,l,u=e[0],h=r[0],c=0,f=0;h>u==h>-u?(a=u,u=e[++c]):(a=h,h=r[++f]);let d=0;if(cu==h>-u?(o=u+a,s=a-(o-u),u=e[++c]):(o=h+a,s=a-(o-h),h=r[++f]),a=o,s!==0&&(i[d++]=s);cu==h>-u?(o=a+u,l=o-a,s=a-(o-l)+(u-l),u=e[++c]):(o=a+h,l=o-a,s=a-(o-l)+(h-l),h=r[++f]),a=o,s!==0&&(i[d++]=s);for(;c=R||-I>=R||(c=n-T,s=n-(T+c)+(c-i),c=t-C,u=t-(C+c)+(c-i),c=e-A,l=e-(A+c)+(c-a),c=r-M,h=r-(M+c)+(c-a),s===0&&l===0&&u===0&&h===0)||(R=vzr*o+hzr*Math.abs(I),I+=T*h+M*s-(A*u+C*l),I>=R||-I>=R))return I;x=s*M,f=Mc*s,d=f-(f-s),v=s-d,f=Mc*M,p=f-(f-M),g=M-p,S=v*g-(x-d*p-v*p-d*g),w=l*C,f=Mc*l,d=f-(f-l),v=l-d,f=Mc*C,p=f-(f-C),g=C-p,b=v*g-(w-d*p-v*p-d*g),m=S-b,c=S-m,vf[0]=S-(m+c)+(c-b),y=x+m,c=y-x,_=x-(y-c)+(m-c),m=_-w,c=_-m,vf[1]=_-(m+c)+(c-w),E=y+m,c=E-y,vf[2]=y-(E-c)+(m-c),vf[3]=E;const k=CZ(4,OC,4,vf,pLe);x=T*h,f=Mc*T,d=f-(f-T),v=T-d,f=Mc*h,p=f-(f-h),g=h-p,S=v*g-(x-d*p-v*p-d*g),w=A*u,f=Mc*A,d=f-(f-A),v=A-d,f=Mc*u,p=f-(f-u),g=u-p,b=v*g-(w-d*p-v*p-d*g),m=S-b,c=S-m,vf[0]=S-(m+c)+(c-b),y=x+m,c=y-x,_=x-(y-c)+(m-c),m=_-w,c=_-m,vf[1]=_-(m+c)+(c-w),E=y+m,c=E-y,vf[2]=y-(E-c)+(m-c),vf[3]=E;const D=CZ(k,pLe,4,vf,gLe);x=s*h,f=Mc*s,d=f-(f-s),v=s-d,f=Mc*h,p=f-(f-h),g=h-p,S=v*g-(x-d*p-v*p-d*g),w=l*u,f=Mc*l,d=f-(f-l),v=l-d,f=Mc*u,p=f-(f-u),g=u-p,b=v*g-(w-d*p-v*p-d*g),m=S-b,c=S-m,vf[0]=S-(m+c)+(c-b),y=x+m,c=y-x,_=x-(y-c)+(m-c),m=_-w,c=_-m,vf[1]=_-(m+c)+(c-w),E=y+m,c=E-y,vf[2]=y-(E-c)+(m-c),vf[3]=E;const G=CZ(D,gLe,4,vf,yLe);return yLe[G-1]}function gzr(n,e,t,r,i,a){const o=(e-a)*(t-i),s=(n-i)*(r-a),l=o-s,u=Math.abs(o+s);return Math.abs(l)>=fzr*u?l:-pzr(n,e,t,r,i,a,u)}const jP=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,Ure=(n,e)=>{if(e.ur.x{if(-dSn.x*e.y-n.y*e.x,EJe=(n,e)=>n.x*e.x+n.y*e.y,xLe=(n,e,t)=>{const r=gzr(n.x,n.y,e.x,e.y,t.x,t.y);return r>0?-1:r<0?1:0},U7=n=>Math.sqrt(EJe(n,n)),_zr=(n,e,t)=>{const r={x:e.x-n.x,y:e.y-n.y},i={x:t.x-n.x,y:t.y-n.y};return A8(i,r)/U7(i)/U7(r)},xzr=(n,e,t)=>{const r={x:e.x-n.x,y:e.y-n.y},i={x:t.x-n.x,y:t.y-n.y};return EJe(i,r)/U7(i)/U7(r)},SLe=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},wLe=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},Szr=(n,e,t,r)=>{if(e.x===0)return wLe(t,r,n.x);if(r.x===0)return wLe(n,e,t.x);if(e.y===0)return SLe(t,r,n.y);if(r.y===0)return SLe(n,e,t.y);const i=A8(e,r);if(i==0)return null;const a={x:t.x-n.x,y:t.y-n.y},o=A8(a,e)/i,s=A8(a,r)/i,l=n.x+s*e.x,u=t.x+o*r.x,h=n.y+s*e.y,c=t.y+o*r.y,f=(l+u)/2,d=(h+c)/2;return{x:f,y:d}};class xp{static compare(e,t){const r=xp.comparePoints(e.point,t.point);return r!==0?r:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:MS.compare(e.segment,t.segment))}static comparePoints(e,t){return e.xt.x?1:e.yt.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let r=0,i=t.length;r{const a=i.otherSE;t.set(i,{sine:_zr(this.point,e.point,a.point),cosine:xzr(this.point,e.point,a.point)})};return(i,a)=>{t.has(i)||r(i),t.has(a)||r(a);const{sine:o,cosine:s}=t.get(i),{sine:l,cosine:u}=t.get(a);return o>=0&&l>=0?su?-1:0:o<0&&l<0?su?1:0:lo?1:0}}}let wzr=0;class MS{static compare(e,t){const r=e.leftSE.point.x,i=t.leftSE.point.x,a=e.rightSE.point.x,o=t.rightSE.point.x;if(os&&l>u)return-1;const c=e.comparePoint(t.leftSE.point);if(c<0)return 1;if(c>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(r>i){if(sl&&s>h)return 1;const c=t.comparePoint(e.leftSE.point);if(c!==0)return c;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(sl)return 1;if(ao){const c=e.comparePoint(t.rightSE.point);if(c<0)return 1;if(c>0)return-1}if(a!==o){const c=u-s,f=a-r,d=h-l,v=o-i;if(c>f&&dv)return-1}return a>o?1:ah?1:e.idt.id?1:0}constructor(e,t,r,i){this.id=++wzr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=r,this.windings=i}static fromRing(e,t,r){let i,a,o;const s=xp.comparePoints(e,t);if(s<0)i=e,a=t,o=1;else if(s>0)i=t,a=e,o=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const l=new xp(i,!0),u=new xp(a,!1);return new MS(l,u,[r],[o])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:et?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,r=this.rightSE.point,i=this.vector();if(t.x===r.x)return e.x===t.x?0:e.x0&&s.swapEvents(),xp.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),a.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,r=this.windings.length;t0){const a=t;t=r,r=a}if(t.prev===r){const a=t;t=r,r=a}for(let a=0,o=r.rings.length;ai.length===1&&i[0].isSubject;this._isInResult=r(e)!==r(t);break}default:throw new Error(`Unrecognized operation type found ${o0.type}`)}return this._isInResult}}class bLe{constructor(e,t,r){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=r,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=PN.round(e[0][0],e[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let a=i;for(let o=1,s=e.length;othis.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),a=l)}(i.x!==a.x||i.y!==a.y)&&this.segments.push(MS.fromRing(a,i,this))}getSweepEvents(){const e=[];for(let t=0,r=this.segments.length;tthis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,r=this.interiorRings.length;tthis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,r=this.polys.length;t0&&(e=o)}let t=e.segment.prevInResult(),r=t?t.prevInResult():null;for(;;){if(!t)return null;if(!r)return t.ringOut;if(r.ringOut!==t.ringOut)return r.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=r.prevInResult(),r=t?t.prevInResult():null}}}class TLe{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,r=this.interiorRings.length;t1&&arguments[1]!==void 0?arguments[1]:MS.compare;this.queue=e,this.tree=new _ce(t),this.segments=[]}process(e){const t=e.segment,r=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),r;const i=e.isLeft?this.tree.add(t):this.tree.find(t);if(!i)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let a=i,o=i,s,l;for(;s===void 0;)a=this.tree.prev(a),a===null?s=null:a.key.consumedBy===void 0&&(s=a.key);for(;l===void 0;)o=this.tree.next(o),o===null?l=null:o.key.consumedBy===void 0&&(l=o.key);if(e.isLeft){let u=null;if(s){const c=s.getIntersection(t);if(c!==null&&(t.isAnEndpoint(c)||(u=c),!s.isAnEndpoint(c))){const f=this._splitSafely(s,c);for(let d=0,v=f.length;d0?(this.tree.remove(t),r.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const h=this._splitSafely(s,u);for(let c=0,f=h.length;cCLe)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new Tzr(a);let s=a.size,l=a.pop();for(;l;){const c=l.key;if(a.size===s){const d=c.segment;throw new Error(`Unable to pop() ${c.isLeft?"left":"right"} SweepEvent [${c.point.x}, ${c.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(a.size>CLe)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>Czr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=o.process(c);for(let d=0,v=f.length;d1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;rt.x?1:this.yt.y?1:0};tt.prototype.clone=function(){};tt.prototype.copy=function(){return new tt(this)};tt.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};tt.prototype.distance3D=function(e){var t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return Math.sqrt(t*t+r*r+i*i)};tt.prototype.distance=function(e){var t=this.x-e.x,r=this.y-e.y;return Math.sqrt(t*t+r*r)};tt.prototype.hashCode=function(){var e=17;return e=37*e+tt.hashCode(this.x),e=37*e+tt.hashCode(this.y),e};tt.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z};tt.prototype.interfaces_=function(){return[$d,I$,Wd]};tt.prototype.getClass=function(){return tt};tt.hashCode=function(){if(arguments.length===1){var e=arguments[0],t=ui.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}};xT.DimensionalComparator.get=function(){return z1};xT.serialVersionUID.get=function(){return 6683108902428367e3};xT.NULL_ORDINATE.get=function(){return ui.NaN};xT.X.get=function(){return 0};xT.Y.get=function(){return 1};xT.Z.get=function(){return 2};Object.defineProperties(tt,xT);var z1=function(e){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t!==2&&t!==3)throw new Ss("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}};z1.prototype.compare=function(e,t){var r=e,i=t,a=z1.compare(r.x,i.x);if(a!==0)return a;var o=z1.compare(r.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var s=z1.compare(r.z,i.z);return s};z1.prototype.interfaces_=function(){return[eI]};z1.prototype.getClass=function(){return z1};z1.compare=function(e,t){return et?1:ui.isNaN(e)?ui.isNaN(t)?0:-1:ui.isNaN(t)?1:0};var tI=function(){};tI.prototype.create=function(){};tI.prototype.interfaces_=function(){return[]};tI.prototype.getClass=function(){return tI};var dt=function(){},Kk={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};dt.prototype.interfaces_=function(){return[]};dt.prototype.getClass=function(){return dt};dt.toLocationSymbol=function(e){switch(e){case dt.EXTERIOR:return"e";case dt.BOUNDARY:return"b";case dt.INTERIOR:return"i";case dt.NONE:return"-"}throw new Ss("Unknown location value: "+e)};Kk.INTERIOR.get=function(){return 0};Kk.BOUNDARY.get=function(){return 1};Kk.EXTERIOR.get=function(){return 2};Kk.NONE.get=function(){return-1};Object.defineProperties(dt,Kk);var zn=function(n,e){return n.interfaces_&&n.interfaces_().indexOf(e)>-1},Uf=function(){},CJe={LOG_10:{configurable:!0}};Uf.prototype.interfaces_=function(){return[]};Uf.prototype.getClass=function(){return Uf};Uf.log10=function(e){var t=Math.log(e);return ui.isInfinite(t)||ui.isNaN(t)?t:t/Uf.LOG_10};Uf.min=function(e,t,r,i){var a=e;return tr?r:e}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],a=arguments[1],o=arguments[2];return io?o:i}};Uf.wrap=function(e,t){return e<0?t- -e%t:e%t};Uf.max=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],r=arguments[2],i=e;return t>i&&(i=t),r>i&&(i=r),i}else if(arguments.length===4){var a=arguments[0],o=arguments[1],s=arguments[2],l=arguments[3],u=a;return o>u&&(u=o),s>u&&(u=s),l>u&&(u=l),u}};Uf.average=function(e,t){return(e+t)/2};CJe.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(Uf,CJe);var hg=function(e){this.str=e};hg.prototype.append=function(e){this.str+=e};hg.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)};hg.prototype.toString=function(e){return this.str};var jp=function(e){this.value=e};jp.prototype.intValue=function(){return this.value};jp.prototype.compareTo=function(e){return this.valuee?1:0};jp.isNaN=function(e){return Number.isNaN(e)};var ON=function(){};ON.isWhitespace=function(e){return e<=32&&e>=0||e===127};ON.toUpperCase=function(e){return e.toUpperCase()};var Et=function n(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof n){var t=arguments[0];this.init(t)}else if(typeof arguments[0]=="string"){var r=arguments[0];n.call(this,n.parse(r))}}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this.init(i,a)}},Fv={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Et.prototype.le=function(e){return(this._hi9?(c=!0,f="9"):f="0"+h,s.append(f),r=r.subtract(Et.valueOf(h)).multiply(Et.TEN),c&&r.selfAdd(Et.TEN);var d=!0,v=Et.magnitude(r._hi);if(v<0&&Math.abs(v)>=l-u&&(d=!1),!d)break}return t[0]=i,s.toString()};Et.prototype.sqr=function(){return this.multiply(this)};Et.prototype.doubleValue=function(){return this._hi+this._lo};Et.prototype.subtract=function(){if(arguments[0]instanceof Et){var e=arguments[0];return this.add(e.negate())}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}};Et.prototype.equals=function(){if(arguments.length===1){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}};Et.prototype.isZero=function(){return this._hi===0&&this._lo===0};Et.prototype.selfSubtract=function(){if(arguments[0]instanceof Et){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}};Et.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};Et.prototype.min=function(e){return this.le(e)?this:e};Et.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Et){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfDivide(t,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],a=null,o=null,s=null,l=null,u=null,h=null,c=null,f=null;return u=this._hi/r,h=Et.SPLIT*u,a=h-u,f=Et.SPLIT*r,a=h-a,o=u-a,s=f-r,c=u*r,s=f-s,l=r-s,f=a*s-c+a*l+o*s+o*l,h=(this._hi-c-f+this._lo-u*i)/r,f=u+h,this._hi=f,this._lo=u-f+h,this}};Et.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};Et.prototype.divide=function(){if(arguments[0]instanceof Et){var e=arguments[0],t=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null;o=this._hi/e._hi,s=Et.SPLIT*o,t=s-o,u=Et.SPLIT*e._hi,t=s-t,r=o-t,i=u-e._hi,l=o*e._hi,i=u-i,a=e._hi-i,u=t*i-l+t*a+r*i+r*a,s=(this._hi-l-u+this._lo-o*e._lo)/e._hi,u=o+s;var h=u,c=o-u+s;return new Et(h,c)}else if(typeof arguments[0]=="number"){var f=arguments[0];return ui.isNaN(f)?Et.createNaN():Et.copy(this).selfDivide(f,0)}};Et.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo};Et.prototype.pow=function(e){if(e===0)return Et.valueOf(1);var t=new Et(this),r=Et.valueOf(1),i=Math.abs(e);if(i>1)for(;i>0;)i%2===1&&r.selfMultiply(t),i/=2,i>0&&(t=t.sqr());else r=t;return e<0?r.reciprocal():r};Et.prototype.ceil=function(){if(this.isNaN())return Et.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new Et(e,t)};Et.prototype.compareTo=function(e){var t=e;return this._hit._hi?1:this._lot._lo?1:0};Et.prototype.rint=function(){if(this.isNaN())return this;var e=this.add(.5);return e.floor()};Et.prototype.setValue=function(){if(arguments[0]instanceof Et){var e=arguments[0];return this.init(e),this}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}};Et.prototype.max=function(e){return this.ge(e)?this:e};Et.prototype.sqrt=function(){if(this.isZero())return Et.valueOf(0);if(this.isNegative())return Et.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,r=Et.valueOf(t),i=this.subtract(r.sqr()),a=i._hi*(e*.5);return r.add(a)};Et.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Et){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0],r=null,i=null,a=null,o=null,s=null,l=null;return a=this._hi+t,s=a-this._hi,o=a-s,o=t-s+(this._hi-o),l=o+this._lo,r=a+l,i=l+(a-r),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(arguments.length===2){var u=arguments[0],h=arguments[1],c=null,f=null,d=null,v=null,p=null,g=null,m=null,y=null;p=this._hi+u,d=this._lo+h,m=p-this._hi,y=d-this._lo,g=p-m,v=d-y,g=u-m+(this._hi-g),v=h-y+(this._lo-v),m=g+d,c=p+m,f=m+(p-c),m=v+f;var _=c+m,x=m+(c-_);return this._hi=_,this._lo=x,this}};Et.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Et){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfMultiply(t,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],a=null,o=null,s=null,l=null,u=null,h=null;u=Et.SPLIT*this._hi,a=u-this._hi,h=Et.SPLIT*r,a=u-a,o=this._hi-a,s=h-r,u=this._hi*r,s=h-s,l=r-s,h=a*s-u+a*l+o*s+o*l+(this._hi*i+this._lo*r);var c=u+h;a=u-c;var f=h+a;return this._hi=c,this._lo=f,this}};Et.prototype.selfSqr=function(){return this.selfMultiply(this)};Et.prototype.floor=function(){if(this.isNaN())return Et.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new Et(e,t)};Et.prototype.negate=function(){return this.isNaN()?this:new Et(-this._hi,-this._lo)};Et.prototype.clone=function(){};Et.prototype.multiply=function(){if(arguments[0]instanceof Et){var e=arguments[0];return e.isNaN()?Et.createNaN():Et.copy(this).selfMultiply(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return ui.isNaN(t)?Et.createNaN():Et.copy(this).selfMultiply(t,0)}};Et.prototype.isNaN=function(){return ui.isNaN(this._hi)};Et.prototype.intValue=function(){return Math.trunc(this._hi)};Et.prototype.toString=function(){var e=Et.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()};Et.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),r=this.extractSignificantDigits(!0,t),i=t[0]+1,a=r;if(r.charAt(0)===".")a="0"+r;else if(i<0)a="0."+Et.stringOfChar("0",-i)+r;else if(r.indexOf(".")===-1){var o=i-r.length,s=Et.stringOfChar("0",o);a=r+s+".0"}return this.isNegative()?"-"+a:a};Et.prototype.reciprocal=function(){var e=null,t=null,r=null,i=null,a=null,o=null,s=null,l=null;a=1/this._hi,o=Et.SPLIT*a,e=o-a,l=Et.SPLIT*this._hi,e=o-e,t=a-e,r=l-this._hi,s=a*this._hi,r=l-r,i=this._hi-r,l=e*r-s+e*i+t*r+t*i,o=(1-s-l-a*this._lo)/this._hi;var u=a+o,h=a-u+o;return new Et(u,h)};Et.prototype.toSciNotation=function(){if(this.isZero())return Et.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),r=this.extractSignificantDigits(!1,t),i=Et.SCI_NOT_EXPONENT_CHAR+t[0];if(r.charAt(0)==="0")throw new Error("Found leading zero: "+r);var a="";r.length>1&&(a=r.substring(1));var o=r.charAt(0)+"."+a;return this.isNegative()?"-"+o+i:o+i};Et.prototype.abs=function(){return this.isNaN()?Et.NaN:this.isNegative()?this.negate():new Et(this)};Et.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0};Et.prototype.lt=function(e){return(this._hie._hi||this._hi===e._hi)&&this._lo>e._lo};Et.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0};Et.prototype.trunc=function(){return this.isNaN()?Et.NaN:this.isPositive()?this.floor():this.ceil()};Et.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};Et.prototype.interfaces_=function(){return[Wd,$d,I$]};Et.prototype.getClass=function(){return Et};Et.sqr=function(e){return Et.valueOf(e).selfMultiply(e)};Et.valueOf=function(){if(typeof arguments[0]=="string"){var e=arguments[0];return Et.parse(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return new Et(t)}};Et.sqrt=function(e){return Et.valueOf(e).sqrt()};Et.parse=function(e){for(var t=0,r=e.length;ON.isWhitespace(e.charAt(t));)t++;var i=!1;if(t=r);){var h=e.charAt(t);if(t++,ON.isDigit(h)){var c=h-"0";o.selfMultiply(Et.TEN),o.selfAdd(c),s++;continue}if(h==="."){l=s;continue}if(h==="e"||h==="E"){var f=e.substring(t);try{u=jp.parseInt(f)}catch(m){throw m instanceof Error?new Error("Invalid exponent "+f+" in string "+e):m}finally{}break}throw new Error("Unexpected character '"+h+"' at position "+t+" in string "+e)}var d=o,v=s-l-u;if(v===0)d=o;else if(v>0){var p=Et.TEN.pow(v);d=o.divide(p)}else if(v<0){var g=Et.TEN.pow(-v);d=o.multiply(g)}return i?d.negate():d};Et.createNaN=function(){return new Et(ui.NaN,ui.NaN)};Et.copy=function(e){return new Et(e)};Et.magnitude=function(e){var t=Math.abs(e),r=Math.log(t)/Math.log(10),i=Math.trunc(Math.floor(r)),a=Math.pow(10,i);return a*10<=t&&(i+=1),i};Et.stringOfChar=function(e,t){for(var r=new hg,i=0;i0){if(o<=0)return uc.signum(s);i=a+o}else if(a<0){if(o>=0)return uc.signum(s);i=-a-o}else return uc.signum(s);var l=uc.DP_SAFE_EPSILON*i;return s>=l||-s>=l?uc.signum(s):2};uc.signum=function(e){return e>0?1:e<0?-1:0};AJe.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties(uc,AJe);var ua=function(){},Jk={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Jk.X.get=function(){return 0};Jk.Y.get=function(){return 1};Jk.Z.get=function(){return 2};Jk.M.get=function(){return 3};ua.prototype.setOrdinate=function(e,t,r){};ua.prototype.size=function(){};ua.prototype.getOrdinate=function(e,t){};ua.prototype.getCoordinate=function(){};ua.prototype.getCoordinateCopy=function(e){};ua.prototype.getDimension=function(){};ua.prototype.getX=function(e){};ua.prototype.clone=function(){};ua.prototype.expandEnvelope=function(e){};ua.prototype.copy=function(){};ua.prototype.getY=function(e){};ua.prototype.toCoordinateArray=function(){};ua.prototype.interfaces_=function(){return[I$]};ua.prototype.getClass=function(){return ua};Object.defineProperties(ua,Jk);var MJe=function(){},gL=function(n){function e(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(MJe),zu=function(){};zu.arraycopy=function(e,t,r,i,a){for(var o=0,s=t;se._minx?this._minx:e._minx,r=this._miny>e._miny?this._miny:e._miny,i=this._maxx=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}};gn.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof gn){var e=arguments[0];return this.isNull()||e.isNull()?!1:!(e._minx>this._maxx||e._maxxthis._maxy||e._maxythis._maxx||rthis._maxy||ithis._maxx&&(this._maxx=t._maxx),t._minythis._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(rthis._maxx&&(this._maxx=r),ithis._maxy&&(this._maxy=i))}};gn.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return et._minx?1:this._minyt._miny?1:this._maxxt._maxx?1:this._maxyt._maxy?1:0};gn.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)};gn.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};gn.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};gn.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};gn.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t};gn.prototype.expandBy=function(){if(arguments.length===1){var e=arguments[0];this.expandBy(e,e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}};gn.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof gn){var e=arguments[0];return this.covers(e)}else if(arguments[0]instanceof tt){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.covers(r,i)}};gn.prototype.centre=function(){return this.isNull()?null:new tt((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};gn.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof tt){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof gn){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var a=arguments[0],o=arguments[1],s=arguments[2],l=arguments[3];ae._maxx&&(t=this._minx-e._maxx);var r=0;return this._maxye._maxy&&(r=this._miny-e._maxy),t===0?r:r===0?t:Math.sqrt(t*t+r*r)};gn.prototype.hashCode=function(){var e=17;return e=37*e+tt.hashCode(this._minx),e=37*e+tt.hashCode(this._maxx),e=37*e+tt.hashCode(this._miny),e=37*e+tt.hashCode(this._maxy),e};gn.prototype.interfaces_=function(){return[$d,Wd]};gn.prototype.getClass=function(){return gn};gn.intersects=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],r=arguments[2];return r.x>=(e.xt.x?e.x:t.x)&&r.y>=(e.yt.y?e.y:t.y)}else if(arguments.length===4){var i=arguments[0],a=arguments[1],o=arguments[2],s=arguments[3],l=Math.min(o.x,s.x),u=Math.max(o.x,s.x),h=Math.min(i.x,a.x),c=Math.max(i.x,a.x);return!(h>u||cu)||cr?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}};Ls.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};Ls.prototype.setPrecisionModel=function(e){this._precisionModel=e};Ls.prototype.isInteriorIntersection=function(){var e=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var t=arguments[0],r=0;ra?o=i:o=a;else{var s=Math.abs(e.x-t.x),l=Math.abs(e.y-t.y);i>a?o=s:o=l,o===0&&!e.equals(t)&&(o=Math.max(s,l))}return mi.isTrue(!(o===0&&!e.equals(t)),"Bad distance calculation"),o};Ls.nonRobustComputeEdgeDistance=function(e,t,r){var i=e.x-t.x,a=e.y-t.y,o=Math.sqrt(i*i+a*a);return mi.isTrue(!(o===0&&!e.equals(t)),"Invalid distance calculation"),o};ST.DONT_INTERSECT.get=function(){return 0};ST.DO_INTERSECT.get=function(){return 1};ST.COLLINEAR.get=function(){return 2};ST.NO_INTERSECTION.get=function(){return 0};ST.POINT_INTERSECTION.get=function(){return 1};ST.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(Ls,ST);var Ow=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(r){var i=new gn(this._inputLines[0][0],this._inputLines[0][1]),a=new gn(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(r)&&a.contains(r)},e.prototype.computeIntersection=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];if(this._isProper=!1,gn.intersects(i,a,r)&&Gr.orientationIndex(i,a,r)===0&&Gr.orientationIndex(a,i,r)===0)return this._isProper=!0,(r.equals(i)||r.equals(a))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION}else return n.prototype.computeIntersection.apply(this,arguments)},e.prototype.normalizeToMinimum=function(r,i,a,o,s){s.x=this.smallestInAbsValue(r.x,i.x,a.x,o.x),s.y=this.smallestInAbsValue(r.y,i.y,a.y,o.y),r.x-=s.x,r.y-=s.y,i.x-=s.x,i.y-=s.y,a.x-=s.x,a.y-=s.y,o.x-=s.x,o.y-=s.y},e.prototype.safeHCoordinateIntersection=function(r,i,a,o){var s=null;try{s=Sv.intersection(r,i,a,o)}catch(l){if(l instanceof gL)s=e.nearestEndpoint(r,i,a,o);else throw l}finally{}return s},e.prototype.intersection=function(r,i,a,o){var s=this.intersectionWithNormalization(r,i,a,o);return this.isInSegmentEnvelopes(s)||(s=new tt(e.nearestEndpoint(r,i,a,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(s),s},e.prototype.smallestInAbsValue=function(r,i,a,o){var s=r,l=Math.abs(s);return Math.abs(i)1e-4&&zu.out.println("Distance = "+s.distance(l))},e.prototype.intersectionWithNormalization=function(r,i,a,o){var s=new tt(r),l=new tt(i),u=new tt(a),h=new tt(o),c=new tt;this.normalizeToEnvCentre(s,l,u,h,c);var f=this.safeHCoordinateIntersection(s,l,u,h);return f.x+=c.x,f.y+=c.y,f},e.prototype.computeCollinearIntersection=function(r,i,a,o){var s=gn.intersects(r,i,a),l=gn.intersects(r,i,o),u=gn.intersects(a,o,r),h=gn.intersects(a,o,i);return s&&l?(this._intPt[0]=a,this._intPt[1]=o,n.COLLINEAR_INTERSECTION):u&&h?(this._intPt[0]=r,this._intPt[1]=i,n.COLLINEAR_INTERSECTION):s&&u?(this._intPt[0]=a,this._intPt[1]=r,a.equals(r)&&!l&&!h?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):s&&h?(this._intPt[0]=a,this._intPt[1]=i,a.equals(i)&&!l&&!u?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):l&&u?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!s&&!h?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):l&&h?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!s&&!u?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):n.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(r,i,a,o,s){var l=r.xi.x?r.x:i.x,c=r.y>i.y?r.y:i.y,f=a.xo.x?a.x:o.x,p=a.y>o.y?a.y:o.y,g=l>f?l:f,m=hd?u:d,_=c0&&l>0||s<0&&l<0)return n.NO_INTERSECTION;var u=Gr.orientationIndex(a,o,r),h=Gr.orientationIndex(a,o,i);if(u>0&&h>0||u<0&&h<0)return n.NO_INTERSECTION;var c=s===0&&l===0&&u===0&&h===0;return c?this.computeCollinearIntersection(r,i,a,o):(s===0||l===0||u===0||h===0?(this._isProper=!1,r.equals2D(a)||r.equals2D(o)?this._intPt[0]=r:i.equals2D(a)||i.equals2D(o)?this._intPt[0]=i:s===0?this._intPt[0]=new tt(a):l===0?this._intPt[0]=new tt(o):u===0?this._intPt[0]=new tt(r):h===0&&(this._intPt[0]=new tt(i))):(this._isProper=!0,this._intPt[0]=this.intersection(r,i,a,o)),n.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(r,i,a,o){var s=r,l=Gr.distancePointLine(r,a,o),u=Gr.distancePointLine(i,a,o);return u0?r>0?-a:a:r>0?a:-a;if(t===0||r===0)return i>0?e>0?a:-a:e>0?-a:a;if(t>0?i>0?t<=i||(a=-a,o=e,e=r,r=o,o=t,t=i,i=o):t<=-i?(a=-a,r=-r,i=-i):(o=e,e=-r,r=o,o=t,t=-i,i=o):i>0?-t<=i?(a=-a,e=-e,t=-t):(o=-e,e=r,r=o,o=-t,t=i,i=o):t>=i?(e=-e,t=-t,r=-r,i=-i):(a=-a,o=-e,e=-r,r=o,o=-t,t=-i,i=o),e>0)if(r>0){if(!(e<=r))return a}else return a;else{if(r>0)return-a;if(e>=r)a=-a,e=-e,r=-r;else return-a}for(;;){if(s=Math.floor(r/e),r=r-s*e,i=i-s*t,i<0)return-a;if(i>t)return a;if(e>r+r){if(ti+i)return-a;r=e-r,i=t-i,a=-a}if(i===0)return r===0?0:-a;if(r===0||(s=Math.floor(e/r),e=e-s*r,t=t-s*i,t<0))return a;if(t>i)return-a;if(r>e+e){if(it+t)return a;e=r-e,t=i-t,a=-a}if(t===0)return e===0?0:a;if(e===0)return-a}};var Gp=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};Gp.prototype.countSegment=function(e,t){if(e.xi&&(r=t.x,i=e.x),this._p.x>=r&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var a=e.x-this._p.x,o=e.y-this._p.y,s=t.x-this._p.x,l=t.y-this._p.y,u=I2.signOfDet2x2(a,o,s,l);if(u===0)return this._isPointOnSegment=!0,null;l0&&this._crossingCount++}};Gp.prototype.isPointInPolygon=function(){return this.getLocation()!==dt.EXTERIOR};Gp.prototype.getLocation=function(){return this._isPointOnSegment?dt.BOUNDARY:this._crossingCount%2===1?dt.INTERIOR:dt.EXTERIOR};Gp.prototype.isOnSegment=function(){return this._isPointOnSegment};Gp.prototype.interfaces_=function(){return[]};Gp.prototype.getClass=function(){return Gp};Gp.locatePointInRing=function(){if(arguments[0]instanceof tt&&zn(arguments[1],ua)){for(var e=arguments[0],t=arguments[1],r=new Gp(e),i=new tt,a=new tt,o=1;o1||u<0||u>1)&&(a=!0)}}return a?Uf.min(Gr.distancePointLine(e,r,i),Gr.distancePointLine(t,r,i),Gr.distancePointLine(r,e,t),Gr.distancePointLine(i,e,t)):0};Gr.isPointInRing=function(e,t){return Gr.locatePointInRing(e,t)!==dt.EXTERIOR};Gr.computeLength=function(e){var t=e.size();if(t<=1)return 0;var r=0,i=new tt;e.getCoordinate(0,i);for(var a=i.x,o=i.y,s=1;sr.y&&(r=o,i=a)}var s=i;do s=s-1,s<0&&(s=t);while(e[s].equals2D(r)&&s!==i);var l=i;do l=(l+1)%t;while(e[l].equals2D(r)&&l!==i);var u=e[s],h=e[l];if(u.equals2D(r)||h.equals2D(r)||u.equals2D(h))return!1;var c=Gr.computeOrientation(u,r,h),f=!1;return c===0?f=u.x>h.x:f=c>0,f};Gr.locatePointInRing=function(e,t){return Gp.locatePointInRing(e,t)};Gr.distancePointLinePerpendicular=function(e,t,r){var i=(r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y),a=((t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y))/i;return Math.abs(a)*Math.sqrt(i)};Gr.computeOrientation=function(e,t,r){return Gr.orientationIndex(e,t,r)};Gr.distancePointLine=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(t.length===0)throw new Ss("Line array must contain at least one vertex");for(var r=e.distance(t[0]),i=0;i=1)return o.distance(l);var c=((s.y-o.y)*(l.x-s.x)-(s.x-o.x)*(l.y-s.y))/u;return Math.abs(c)*Math.sqrt(u)}};Gr.isOnLine=function(e,t){for(var r=new Ow,i=1;i0};nI.prototype.interfaces_=function(){return[Od]};nI.prototype.getClass=function(){return nI};var iI=function(){};iI.prototype.isInBoundary=function(e){return e>1};iI.prototype.interfaces_=function(){return[Od]};iI.prototype.getClass=function(){return iI};var aI=function(){};aI.prototype.isInBoundary=function(e){return e===1};aI.prototype.interfaces_=function(){return[Od]};aI.prototype.getClass=function(){return aI};var Al=function(){};Al.prototype.add=function(){};Al.prototype.addAll=function(){};Al.prototype.isEmpty=function(){};Al.prototype.iterator=function(){};Al.prototype.size=function(){};Al.prototype.toArray=function(){};Al.prototype.remove=function(){};function Sce(n){this.message=n||""}Sce.prototype=new Error;Sce.prototype.name="IndexOutOfBoundsException";var yL=function(){};yL.prototype.hasNext=function(){};yL.prototype.next=function(){};yL.prototype.remove=function(){};var wv=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(Al);function mL(n){this.message=n||""}mL.prototype=new Error;mL.prototype.name="NoSuchElementException";var Pr=function(n){function e(){n.call(this),this.array_=[],arguments[0]instanceof Al&&this.addAll(arguments[0])}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[n,Al]},e.prototype.add=function(r){return arguments.length===1?this.array_.push(r):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(r){for(var i=this,a=r.iterator();a.hasNext();)i.add(a.next());return!0},e.prototype.set=function(r,i){var a=this.array_[r];return this.array_[r]=i,a},e.prototype.iterator=function(){return new Rzr(this)},e.prototype.get=function(r){if(r<0||r>=this.size())throw new Sce;return this.array_[r]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var r=this,i=[],a=0,o=this.array_.length;a=1){var h=this.get(this.size()-1);if(h.equals2D(l))return null}n.prototype.add.call(this,l)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var c=arguments[0],f=arguments[1];return this.add(c,f),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var d=arguments[0],v=arguments[1],p=arguments[2];if(p)for(var g=0;g=0;m--)i.add(d[m],v);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof tt){var y=arguments[0],_=arguments[1],x=arguments[2];if(!x){var S=this.size();if(S>0){if(y>0){var w=this.get(y-1);if(w.equals2D(_))return null}if(yA&&(M=-1);for(var I=C;I!==A;I+=M)i.add(E[I],T);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new tt(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,t),e}(Pr),Bi=function(){},P$={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};P$.ForwardComparator.get=function(){return RN};P$.BidirectionalComparator.get=function(){return oI};P$.coordArrayType.get=function(){return new Array(0).fill(null)};Bi.prototype.interfaces_=function(){return[]};Bi.prototype.getClass=function(){return Bi};Bi.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))};Bi.ptNotInList=function(e,t){for(var r=0;r=e?t:[]};Bi.indexOf=function(e,t){for(var r=0;r0)&&(t=e[r]);return t};Bi.extract=function(e,t,r){t=Uf.clamp(t,0,e.length),r=Uf.clamp(r,-1,e.length);var i=r-t+1;r<0&&(i=0),t>=e.length&&(i=0),ri.length)return 1;if(r.length===0)return 0;var a=Bi.compare(r,i),o=Bi.isEqualReversed(r,i);return o?0:a};oI.prototype.OLDcompare=function(e,t){var r=e,i=t;if(r.lengthi.length)return 1;if(r.length===0)return 0;for(var a=Bi.increasingDirection(r),o=Bi.increasingDirection(i),s=a>0?0:r.length-1,l=o>0?0:r.length-1,u=0;u0)e=e.right;else return e.value}return null};dh.prototype.put=function(n,e){if(this.root_===null)return this.root_={key:n,value:e,left:null,right:null,parent:null,color:Ty,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var t=this.root_,r,i;do if(r=t,i=n.compareTo(t.key),i<0)t=t.left;else if(i>0)t=t.right;else{var a=t.value;return t.value=e,a}while(t!==null);var o={key:n,left:null,right:null,value:e,parent:r,color:Ty,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?r.left=o:r.right=o,this.fixAfterInsertion(o),this.size_++,null};dh.prototype.fixAfterInsertion=function(n){var e=this;for(n.color=bx;n!=null&&n!==this.root_&&n.parent.color===bx;)if(Bo(n)===AZ(Bo(Bo(n)))){var t=MLe(Bo(Bo(n)));ALe(t)===bx?(fy(Bo(n),Ty),fy(t,Ty),fy(Bo(Bo(n)),bx),n=Bo(Bo(n))):(n===MLe(Bo(n))&&(n=Bo(n),e.rotateLeft(n)),fy(Bo(n),Ty),fy(Bo(Bo(n)),bx),e.rotateRight(Bo(Bo(n))))}else{var r=AZ(Bo(Bo(n)));ALe(r)===bx?(fy(Bo(n),Ty),fy(r,Ty),fy(Bo(Bo(n)),bx),n=Bo(Bo(n))):(n===AZ(Bo(n))&&(n=Bo(n),e.rotateRight(n)),fy(Bo(n),Ty),fy(Bo(Bo(n)),bx),e.rotateLeft(Bo(Bo(n))))}this.root_.color=Ty};dh.prototype.values=function(){var n=new Pr,e=this.getFirstEntry();if(e!==null)for(n.add(e.value);(e=dh.successor(e))!==null;)n.add(e.value);return n};dh.prototype.entrySet=function(){var n=new wce,e=this.getFirstEntry();if(e!==null)for(n.add(e);(e=dh.successor(e))!==null;)n.add(e);return n};dh.prototype.rotateLeft=function(n){if(n!=null){var e=n.right;n.right=e.left,e.left!=null&&(e.left.parent=n),e.parent=n.parent,n.parent===null?this.root_=e:n.parent.left===n?n.parent.left=e:n.parent.right=e,e.left=n,n.parent=e}};dh.prototype.rotateRight=function(n){if(n!=null){var e=n.left;n.left=e.right,e.right!=null&&(e.right.parent=n),e.parent=n.parent,n.parent===null?this.root_=e:n.parent.right===n?n.parent.right=e:n.parent.left=e,e.right=n,n.parent=e}};dh.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n};dh.successor=function(n){if(n===null)return null;if(n.right!==null){for(var e=n.right;e.left!==null;)e=e.left;return e}else{for(var t=n.parent,r=n;t!==null&&r===t.right;)r=t,t=t.parent;return t}};dh.prototype.size=function(){return this.size_};var DN=function(){};DN.prototype.interfaces_=function(){return[]};DN.prototype.getClass=function(){return DN};function LJe(){}LJe.prototype=new O$;function Xp(){this.array_=[],arguments[0]instanceof Al&&this.addAll(arguments[0])}Xp.prototype=new LJe;Xp.prototype.contains=function(n){for(var e=this,t=0,r=this.array_.length;t=0;){var s=a.substring(0,o);i.add(s),a=a.substring(o+r),o=a.indexOf(t)}a.length>0&&i.add(a);for(var l=new Array(i.size()).fill(null),u=0;u0)for(var o=a;o0&&i.append(" ");for(var o=0;o0&&i.append(","),i.append(xd.toString(e.getOrdinate(a,o)))}return i.append(")"),i.toString()}};rl.ensureValidRing=function(e,t){var r=t.size();if(r===0)return t;if(r<=3)return rl.createClosedRing(e,t,4);var i=t.getOrdinate(0,ua.X)===t.getOrdinate(r-1,ua.X)&&t.getOrdinate(0,ua.Y)===t.getOrdinate(r-1,ua.Y);return i?t:rl.createClosedRing(e,t,r+1)};rl.createClosedRing=function(e,t,r){var i=e.create(r,t.getDimension()),a=t.size();rl.copy(t,0,i,0,a);for(var o=a;o0&&rl.reverse(i._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ja.FALSE:0},e.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return Gr.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var i=this._points.copy();rl.reverse(i);var a=this.getFactory().createLineString(i);return a},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var a=arguments[0],o=a,s=0,l=0;s= 2)");this._points=i},e.prototype.isCoordinate=function(i){for(var a=this,o=0;o=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.MINIMUM_VALID_SIZE.get=function(){return 4},t.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,t),e}($s),p0=function(n){function e(){n.apply(this,arguments)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Gn.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],a=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,a):!1}else return n.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var i=this,a=this._geometries.length,o=new Array(a).fill(null),s=0;s0?t.createPoint(r[0]):t.createPoint():e};FN.prototype.interfaces_=function(){return[Rd.GeometryEditorOperation]};FN.prototype.getClass=function(){return FN};var BN=function(){};BN.prototype.edit=function(e,t){return e instanceof b0?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof $s?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof Jc?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e};BN.prototype.interfaces_=function(){return[Rd.GeometryEditorOperation]};BN.prototype.getClass=function(){return BN};var el=function(){var e=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var r=0;r0){var t=new hg(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var r=1;r3&&(i=3),i<2?new el(r):new el(r,i)}};E0.prototype.interfaces_=function(){return[tI,Wd]};E0.prototype.getClass=function(){return E0};E0.instance=function(){return E0.instanceObject};Ece.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};Ece.instanceObject.get=function(){return new E0};Object.defineProperties(E0,Ece);var OJe=function(n){function e(){n.call(this),this.map_=new Map}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.get=function(r){return this.map_.get(r)||null},e.prototype.put=function(r,i){return this.map_.set(r,i),i},e.prototype.values=function(){for(var r=new Pr,i=this.map_.values(),a=i.next();!a.done;)r.add(a.value),a=i.next();return r},e.prototype.entrySet=function(){var r=new wce;return this.map_.entries().forEach(function(i){return r.add(i)}),r},e.prototype.size=function(){return this.map_.size()},e}(bT),to=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof qp){var e=arguments[0];this._modelType=e,e===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var t=arguments[0];this._modelType=n.FIXED,this.setScale(t)}else if(arguments[0]instanceof n){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},Tce={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};to.prototype.equals=function(e){if(!(e instanceof to))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale};to.prototype.compareTo=function(e){var t=e,r=this.getMaximumSignificantDigits(),i=t.getMaximumSignificantDigits();return new jp(r).compareTo(new jp(i))};to.prototype.getScale=function(){return this._scale};to.prototype.isFloating=function(){return this._modelType===to.FLOATING||this._modelType===to.FLOATING_SINGLE};to.prototype.getType=function(){return this._modelType};to.prototype.toString=function(){var e="UNKNOWN";return this._modelType===to.FLOATING?e="Floating":this._modelType===to.FLOATING_SINGLE?e="Floating-Single":this._modelType===to.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e};to.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var e=arguments[0];if(ui.isNaN(e))return e;if(this._modelType===to.FLOATING_SINGLE){var t=e;return t}return this._modelType===to.FIXED?Math.round(e*this._scale)/this._scale:e}else if(arguments[0]instanceof tt){var r=arguments[0];if(this._modelType===to.FLOATING)return null;r.x=this.makePrecise(r.x),r.y=this.makePrecise(r.y)}};to.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===to.FLOATING?e=16:this._modelType===to.FLOATING_SINGLE?e=6:this._modelType===to.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e};to.prototype.setScale=function(e){this._scale=Math.abs(e)};to.prototype.interfaces_=function(){return[Wd,$d]};to.prototype.getClass=function(){return to};to.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t};Tce.serialVersionUID.get=function(){return 7777263578777804e3};Tce.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(to,Tce);var qp=function n(e){this._name=e||null,n.nameToTypeMap.put(e,this)},Cce={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};qp.prototype.readResolve=function(){return qp.nameToTypeMap.get(this._name)};qp.prototype.toString=function(){return this._name};qp.prototype.interfaces_=function(){return[Wd]};qp.prototype.getClass=function(){return qp};Cce.serialVersionUID.get=function(){return-552860263173159e4};Cce.nameToTypeMap.get=function(){return new OJe};Object.defineProperties(qp,Cce);to.Type=qp;to.FIXED=new qp("FIXED");to.FLOATING=new qp("FLOATING");to.FLOATING_SINGLE=new qp("FLOATING SINGLE");var Fi=function n(){this._precisionModel=new to,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?zn(arguments[0],tI)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof to&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},RJe={serialVersionUID:{configurable:!0}};Fi.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new tt(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new tt(e.getMinX(),e.getMinY()),new tt(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new tt(e.getMinX(),e.getMinY()),new tt(e.getMinX(),e.getMaxY()),new tt(e.getMaxX(),e.getMaxY()),new tt(e.getMaxX(),e.getMinY()),new tt(e.getMinX(),e.getMinY())]),null)};Fi.prototype.createLineString=function(e){if(e){if(e instanceof Array)return new $s(this.getCoordinateSequenceFactory().create(e),this);if(zn(e,ua))return new $s(e,this)}else return new $s(this.getCoordinateSequenceFactory().create([]),this)};Fi.prototype.createMultiLineString=function(){if(arguments.length===0)return new lw(null,this);if(arguments.length===1){var e=arguments[0];return new lw(e,this)}};Fi.prototype.buildGeometry=function(e){for(var t=null,r=!1,i=!1,a=e.iterator();a.hasNext();){var o=a.next(),s=o.getClass();t===null&&(t=s),s!==t&&(r=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(t===null)return this.createGeometryCollection();if(r||i)return this.createGeometryCollection(Fi.toGeometryArray(e));var l=e.iterator().next(),u=e.size()>1;if(u){if(l instanceof Rl)return this.createMultiPolygon(Fi.toPolygonArray(e));if(l instanceof $s)return this.createMultiLineString(Fi.toLineStringArray(e));if(l instanceof Jc)return this.createMultiPoint(Fi.toPointArray(e));mi.shouldNeverReachHere("Unhandled class: "+l.getClass().getName())}return l};Fi.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)};Fi.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof tt){var e=arguments[0];return this.createPoint(e!==null?this.getCoordinateSequenceFactory().create([e]):null)}else if(zn(arguments[0],ua)){var t=arguments[0];return new Jc(t,this)}}};Fi.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};Fi.prototype.createPolygon=function(){if(arguments.length===0)return new Rl(null,null,this);if(arguments.length===1){if(zn(arguments[0],ua)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof b0){var r=arguments[0];return this.createPolygon(r,null)}}else if(arguments.length===2){var i=arguments[0],a=arguments[1];return new Rl(i,a,this)}};Fi.prototype.getSRID=function(){return this._SRID};Fi.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Yh(null,this);if(arguments.length===1){var e=arguments[0];return new Yh(e,this)}};Fi.prototype.createGeometry=function(e){var t=new Rd(this);return t.edit(e,{edit:function(){if(arguments.length===2){var r=arguments[0];return this._coordinateSequenceFactory.create(r)}}})};Fi.prototype.getPrecisionModel=function(){return this._precisionModel};Fi.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(e!==null?this.getCoordinateSequenceFactory().create(e):null)}else if(zn(arguments[0],ua)){var t=arguments[0];return new b0(t,this)}}};Fi.prototype.createMultiPolygon=function(){if(arguments.length===0)return new p0(null,this);if(arguments.length===1){var e=arguments[0];return new p0(e,this)}};Fi.prototype.createMultiPoint=function(){var e=this;if(arguments.length===0)return new sI(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new sI(t,this)}else if(arguments[0]instanceof Array){var r=arguments[0];return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}else if(zn(arguments[0],ua)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var a=new Array(i.size()).fill(null),o=0;o=this.size())throw new Error;return this.array_[n]};cg.prototype.push=function(n){return this.array_.push(n),n};cg.prototype.pop=function(n){if(this.array_.length===0)throw new F$;return this.array_.pop()};cg.prototype.peek=function(){if(this.array_.length===0)throw new F$;return this.array_[this.array_.length-1]};cg.prototype.empty=function(){return this.array_.length===0};cg.prototype.isEmpty=function(){return this.empty()};cg.prototype.search=function(n){return this.array_.indexOf(n)};cg.prototype.size=function(){return this.array_.length};cg.prototype.toArray=function(){for(var n=this,e=[],t=0,r=this.array_.length;t0&&this._minIndexthis._minCoord.y&&r.y>this._minCoord.y&&i===Gr.CLOCKWISE)&&(a=!0),a&&(this._minIndex=this._minIndex-1)};Zp.prototype.getRightmostSideOfSegment=function(e,t){var r=e.getEdge(),i=r.getCoordinates();if(t<0||t+1>=i.length||i[t].y===i[t+1].y)return-1;var a=wr.LEFT;return i[t].yt._minCoord.x)&&(t._minDe=e,t._minIndex=i,t._minCoord=r[i])};Zp.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode(),t=e.getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};Zp.prototype.findEdge=function(e){for(var t=this,r=e.iterator();r.hasNext();){var i=r.next();!i.isForward()||t.checkForRightmostCoordinate(i)}mi.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var a=this.getRightmostSide(this._minDe,this._minIndex);a===wr.LEFT&&(this._orientedDe=this._minDe.getSym())};Zp.prototype.interfaces_=function(){return[]};Zp.prototype.getClass=function(){return Zp};var wm=function(n){function e(t,r){n.call(this,e.msgWithCoord(t,r)),this.pt=r?new tt(r):null,this.name="TopologyException"}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(r,i){return i?r:r+" [ "+i+" ]"},e}(xm),B$=function(){this.array_=[]};B$.prototype.addLast=function(e){this.array_.push(e)};B$.prototype.removeFirst=function(){return this.array_.shift()};B$.prototype.isEmpty=function(){return this.array_.length===0};var qh=function(){this._finder=null,this._dirEdgeList=new Pr,this._nodes=new Pr,this._rightMostCoord=null,this._env=null,this._finder=new Zp};qh.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.setVisited(!1)}};qh.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};qh.prototype.computeNodeDepth=function(e){for(var t=this,r=null,i=e.getEdges().iterator();i.hasNext();){var a=i.next();if(a.isVisited()||a.getSym().isVisited()){r=a;break}}if(r===null)throw new wm("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(r);for(var o=e.getEdges().iterator();o.hasNext();){var s=o.next();s.setVisited(!0),t.copySymDepths(s)}};qh.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(wr.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)};qh.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};qh.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(wr.RIGHT)>=1&&t.getDepth(wr.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}};qh.prototype.computeDepths=function(e){var t=this,r=new wce,i=new B$,a=e.getNode();for(i.addLast(a),r.add(a),e.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();r.add(o),t.computeNodeDepth(o);for(var s=o.getEdges().iterator();s.hasNext();){var l=s.next(),u=l.getSym();if(!u.isVisited()){var h=u.getNode();r.contains(h)||(i.addLast(h),r.add(h))}}}};qh.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.xt._rightMostCoord.x?1:0};qh.prototype.getEnvelope=function(){if(this._env===null){for(var e=new gn,t=this._dirEdgeList.iterator();t.hasNext();)for(var r=t.next(),i=r.getEdge().getCoordinates(),a=0;athis.location.length){var r=new Array(3).fill(null);r[wr.ON]=this.location[wr.ON],r[wr.LEFT]=dt.NONE,r[wr.RIGHT]=dt.NONE,this.location=r}for(var i=0;i1&&e.append(dt.toLocationSymbol(this.location[wr.LEFT])),e.append(dt.toLocationSymbol(this.location[wr.ON])),this.location.length>1&&e.append(dt.toLocationSymbol(this.location[wr.RIGHT])),e.toString()};Uo.prototype.setLocations=function(e,t,r){this.location[wr.ON]=e,this.location[wr.LEFT]=t,this.location[wr.RIGHT]=r};Uo.prototype.get=function(e){return e1};Uo.prototype.isAnyNull=function(){for(var e=this,t=0;te._maxNodeDegree&&(e._maxNodeDegree=i),t=e.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2};ml.prototype.addPoints=function(e,t,r){var i=this,a=e.getCoordinates();if(t){var o=1;r&&(o=0);for(var s=o;s=0;u--)i._pts.add(a[u])}};ml.prototype.isHole=function(){return this._isHole};ml.prototype.setInResult=function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)};ml.prototype.containsPoint=function(e){var t=this.getLinearRing(),r=t.getEnvelopeInternal();if(!r.contains(e)||!Gr.isPointInRing(e,t.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var a=i.next();if(a.containsPoint(e))return!1}return!0};ml.prototype.addHole=function(e){this._holes.add(e)};ml.prototype.isShell=function(){return this._shell===null};ml.prototype.getLabel=function(){return this._label};ml.prototype.getEdges=function(){return this._edges};ml.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};ml.prototype.getShell=function(){return this._shell};ml.prototype.mergeLabel=function(){if(arguments.length===1){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(arguments.length===2){var t=arguments[0],r=arguments[1],i=t.getLocation(r,wr.RIGHT);if(i===dt.NONE)return null;if(this._label.getLocation(r)===dt.NONE)return this._label.setLocation(r,i),null}};ml.prototype.setShell=function(e){this._shell=e,e!==null&&e.addHole(this)};ml.prototype.toPolygon=function(e){for(var t=this,r=new Array(this._holes.size()).fill(null),i=0;i=2,"found partial label"),this.computeIM(e)};Vf.prototype.isInResult=function(){return this._isInResult};Vf.prototype.isVisited=function(){return this._isVisited};Vf.prototype.interfaces_=function(){return[]};Vf.prototype.getClass=function(){return Vf};var G$=function(n){function e(){n.call(this),this._coord=null,this._edges=null;var t=arguments[0],r=arguments[1];this._coord=t,this._edges=r,this._label=new fo(0,dt.NONE)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var r=this.getEdges().getEdges().iterator();r.hasNext();){var i=r.next();if(i.getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(r){r.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(r){},e.prototype.computeMergedLocation=function(r,i){var a=dt.NONE;if(a=this._label.getLocation(i),!r.isNull(i)){var o=r.getLocation(i);a!==dt.BOUNDARY&&(a=o)}return a},e.prototype.setLabel=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this._label===null?this._label=new fo(r,i):this._label.setLocation(r,i)}else return n.prototype.setLabel.apply(this,arguments)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var r=this;if(arguments[0]instanceof e){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof fo)for(var a=arguments[0],o=0;o<2;o++){var s=r.computeMergedLocation(a,o),l=r._label.getLocation(o);l===dt.NONE&&r._label.setLocation(o,s)}},e.prototype.add=function(r){this._edges.insert(r),r.setNode(this)},e.prototype.setLabelBoundary=function(r){if(this._label===null)return null;var i=dt.NONE;this._label!==null&&(i=this._label.getLocation(r));var a=null;switch(i){case dt.BOUNDARY:a=dt.INTERIOR;break;case dt.INTERIOR:a=dt.BOUNDARY;break;default:a=dt.BOUNDARY;break}this._label.setLocation(r,a)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vf),Kp=function(){this.nodeMap=new dh,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};Kp.prototype.find=function(e){return this.nodeMap.get(e)};Kp.prototype.addNode=function(){if(arguments[0]instanceof tt){var e=arguments[0],t=this.nodeMap.get(e);return t===null&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}else if(arguments[0]instanceof G$){var r=arguments[0],i=this.nodeMap.get(r.getCoordinate());return i===null?(this.nodeMap.put(r.getCoordinate(),r),r):(i.mergeLabel(r),i)}};Kp.prototype.print=function(e){for(var t=this.iterator();t.hasNext();){var r=t.next();r.print(e)}};Kp.prototype.iterator=function(){return this.nodeMap.values().iterator()};Kp.prototype.values=function(){return this.nodeMap.values()};Kp.prototype.getBoundaryNodes=function(e){for(var t=new Pr,r=this.iterator();r.hasNext();){var i=r.next();i.getLabel().getLocation(e)===dt.BOUNDARY&&t.add(i)}return t};Kp.prototype.add=function(e){var t=e.getCoordinate(),r=this.addNode(t);r.add(e)};Kp.prototype.interfaces_=function(){return[]};Kp.prototype.getClass=function(){return Kp};var Eo=function(){},tF={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Eo.prototype.interfaces_=function(){return[]};Eo.prototype.getClass=function(){return Eo};Eo.isNorthern=function(e){return e===Eo.NE||e===Eo.NW};Eo.isOpposite=function(e,t){if(e===t)return!1;var r=(e-t+4)%4;return r===2};Eo.commonHalfPlane=function(e,t){if(e===t)return e;var r=(e-t+4)%4;if(r===2)return-1;var i=et?e:t;return i===0&&a===3?3:i};Eo.isInHalfPlane=function(e,t){return t===Eo.SE?e===Eo.SE||e===Eo.SW:e===t||e===t+1};Eo.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Ss("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?Eo.NE:Eo.SE:t>=0?Eo.NW:Eo.SW}else if(arguments[0]instanceof tt&&arguments[1]instanceof tt){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new Ss("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?Eo.NE:Eo.SE:i.y>=r.y?Eo.NW:Eo.SW}};tF.NE.get=function(){return 0};tF.NW.get=function(){return 1};tF.SW.get=function(){return 2};tF.SE.get=function(){return 3};Object.defineProperties(Eo,tF);var vh=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var e=arguments[0];this._edge=e}else if(arguments.length===3){var t=arguments[0],r=arguments[1],i=arguments[2],a=null;this._edge=t,this.init(r,i),this._label=a}else if(arguments.length===4){var o=arguments[0],s=arguments[1],l=arguments[2],u=arguments[3];this._edge=o,this.init(s,l),this._label=u}};vh.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant2){s.linkDirectedEdgesForMinimalEdgeRings();var l=s.buildMinimalRings(),u=i.findShell(l);u!==null?(i.placePolygonHoles(u,l),t.add(u)):r.addAll(l)}else a.add(s)}return a};Qc.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();){var r=t.next();if(r.containsPoint(e))return!0}return!1};Qc.prototype.buildMaximalEdgeRings=function(e){for(var t=this,r=new Pr,i=e.iterator();i.hasNext();){var a=i.next();if(a.isInResult()&&a.getLabel().isArea()&&a.getEdgeRing()===null){var o=new Wzr(a,t._geometryFactory);r.add(o),o.setInResult()}}return r};Qc.prototype.placePolygonHoles=function(e,t){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()&&i.setShell(e)}};Qc.prototype.getPolygons=function(){var e=this.computePolygons(this._shellList);return e};Qc.prototype.findEdgeRingContaining=function(e,t){for(var r=e.getLinearRing(),i=r.getEnvelopeInternal(),a=r.getCoordinateN(0),o=null,s=null,l=t.iterator();l.hasNext();){var u=l.next(),h=u.getLinearRing(),c=h.getEnvelopeInternal();o!==null&&(s=o.getLinearRing().getEnvelopeInternal());var f=!1;c.contains(i)&&Gr.isPointInRing(a,h.getCoordinates())&&(f=!0),f&&(o===null||s.contains(c))&&(o=u)}return o};Qc.prototype.findShell=function(e){for(var t=0,r=null,i=e.iterator();i.hasNext();){var a=i.next();a.isHole()||(r=a,t++)}return mi.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),r};Qc.prototype.add=function(){if(arguments.length===1){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(arguments.length===2){var t=arguments[0],r=arguments[1];Ps.linkResultDirectedEdges(r);var i=this.buildMaximalEdgeRings(t),a=new Pr,o=this.buildMinimalEdgeRings(i,this._shellList,a);this.sortShellsAndHoles(o,this._shellList,a),this.placeFreeHoles(this._shellList,a)}};Qc.prototype.interfaces_=function(){return[]};Qc.prototype.getClass=function(){return Qc};var uI=function(){};uI.prototype.getBounds=function(){};uI.prototype.interfaces_=function(){return[]};uI.prototype.getClass=function(){return uI};var Lv=function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t};Lv.prototype.getItem=function(){return this._item};Lv.prototype.getBounds=function(){return this._bounds};Lv.prototype.interfaces_=function(){return[uI,Wd]};Lv.prototype.getClass=function(){return Lv};var bm=function(){this._size=null,this._items=null,this._size=0,this._items=new Pr,this._items.add(null)};bm.prototype.poll=function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e};bm.prototype.size=function(){return this._size};bm.prototype.reorder=function(e){for(var t=this,r=null,i=this._items.get(e);e*2<=this._size&&(r=e*2,r!==t._size&&t._items.get(r+1).compareTo(t._items.get(r))<0&&r++,t._items.get(r).compareTo(i)<0);e=r)t._items.set(e,t._items.get(r));this._items.set(e,i)};bm.prototype.clear=function(){this._size=0,this._items.clear()};bm.prototype.isEmpty=function(){return this._size===0};bm.prototype.add=function(e){var t=this;this._items.add(null),this._size+=1;var r=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(r/2)))<0;r/=2)t._items.set(r,t._items.get(Math.trunc(r/2)));this._items.set(r,e)};bm.prototype.interfaces_=function(){return[]};bm.prototype.getClass=function(){return bm};var w_=function(){};w_.prototype.visitItem=function(e){};w_.prototype.interfaces_=function(){return[]};w_.prototype.getClass=function(){return w_};var L2=function(){};L2.prototype.insert=function(e,t){};L2.prototype.remove=function(e,t){};L2.prototype.query=function(){};L2.prototype.interfaces_=function(){return[]};L2.prototype.getClass=function(){return L2};var Ol=function(){if(this._childBoundables=new Pr,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._level=e}}},NJe={serialVersionUID:{configurable:!0}};Ol.prototype.getLevel=function(){return this._level};Ol.prototype.size=function(){return this._childBoundables.size()};Ol.prototype.getChildBoundables=function(){return this._childBoundables};Ol.prototype.addChildBoundable=function(e){mi.isTrue(this._bounds===null),this._childBoundables.add(e)};Ol.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};Ol.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};Ol.prototype.interfaces_=function(){return[uI,Wd]};Ol.prototype.getClass=function(){return Ol};NJe.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(Ol,NJe);var Pv=function(){};Pv.reverseOrder=function(){return{compare:function(t,r){return r.compareTo(t)}}};Pv.min=function(e){return Pv.sort(e),e.get(0)};Pv.sort=function(e,t){var r=e.toArray();t?IS.sort(r,t):IS.sort(r);for(var i=e.iterator(),a=0,o=r.length;afl.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(r)return this.expand(this._boundable1,this._boundable2,e,t),null;if(i)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new Ss("neither boundable is composite")};fl.prototype.isLeaves=function(){return!(fl.isComposite(this._boundable1)||fl.isComposite(this._boundable2))};fl.prototype.compareTo=function(e){var t=e;return this._distancet._distance?1:0};fl.prototype.expand=function(e,t,r,i){for(var a=this,o=e.getChildBoundables(),s=o.iterator();s.hasNext();){var l=s.next(),u=new fl(l,t,a._itemDistance);u.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=t}},z$={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};du.prototype.getNodeCapacity=function(){return this._nodeCapacity};du.prototype.lastNode=function(e){return e.get(e.size()-1)};du.prototype.size=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=arguments[0],r=0,i=t.getChildBoundables().iterator();i.hasNext();){var a=i.next();a instanceof Ol?r+=e.size(a):a instanceof Lv&&(r+=1)}return r}};du.prototype.removeItem=function(e,t){for(var r=null,i=e.getChildBoundables().iterator();i.hasNext();){var a=i.next();a instanceof Lv&&a.getItem()===t&&(r=a)}return r!==null?(e.getChildBoundables().remove(r),!0):!1};du.prototype.itemsTree=function(){var e=this;if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new Pr:t}else if(arguments.length===1){for(var r=arguments[0],i=new Pr,a=r.getChildBoundables().iterator();a.hasNext();){var o=a.next();if(o instanceof Ol){var s=e.itemsTree(o);s!==null&&i.add(s)}else o instanceof Lv?i.add(o.getItem()):mi.shouldNeverReachHere()}return i.size()<=0?null:i}};du.prototype.insert=function(e,t){mi.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Lv(e,t))};du.prototype.boundablesAtLevel=function(){var e=this;if(arguments.length===1){var t=arguments[0],r=new Pr;return this.boundablesAtLevel(t,this._root,r),r}else if(arguments.length===3){var i=arguments[0],a=arguments[1],o=arguments[2];if(mi.isTrue(i>-2),a.getLevel()===i)return o.add(a),null;for(var s=a.getChildBoundables().iterator();s.hasNext();){var l=s.next();l instanceof Ol?e.boundablesAtLevel(i,l,o):(mi.isTrue(l instanceof Lv),i===-1&&o.add(l))}return null}};du.prototype.query=function(){var e=this;if(arguments.length===1){var t=arguments[0];this.build();var r=new Pr;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,r),r}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,a)}else if(arguments.length===3){if(zn(arguments[2],w_)&&arguments[0]instanceof Object&&arguments[1]instanceof Ol)for(var o=arguments[0],s=arguments[1],l=arguments[2],u=s.getChildBoundables(),h=0;hr&&(r=o)}}return r+1}};du.prototype.createParentBoundables=function(e,t){var r=this;mi.isTrue(!e.isEmpty());var i=new Pr;i.add(this.createNode(t));var a=new Pr(e);Pv.sort(a,this.getComparator());for(var o=a.iterator();o.hasNext();){var s=o.next();r.lastNode(i).getChildBoundables().size()===r.getNodeCapacity()&&i.add(r.createNode(t)),r.lastNode(i).addChildBoundable(s)}return i};du.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};du.prototype.interfaces_=function(){return[Wd]};du.prototype.getClass=function(){return du};du.compareDoubles=function(e,t){return e>t?1:e0);for(var s=new Pr,l=0;l0;){var p=v.poll(),g=p.getDistance();if(g>=f)break;p.isLeaves()?(f=g,d=p):p.expandToQueue(v,f)}return[d.getBoundable(0).getItem(),d.getBoundable(1).getItem()]}}else if(arguments.length===3){var m=arguments[0],y=arguments[1],_=arguments[2],x=new Lv(m,y),S=new fl(this.getRoot(),x,_);return this.nearestNeighbour(S)[0]}},e.prototype.interfaces_=function(){return[L2,Wd]},e.prototype.getClass=function(){return e},e.centreX=function(i){return e.avg(i.getMinX(),i.getMaxX())},e.avg=function(i,a){return(i+a)/2},e.centreY=function(i){return e.avg(i.getMinY(),i.getMaxY())},t.STRtreeNode.get=function(){return ILe},t.serialVersionUID.get=function(){return 0x39920f7d5f261e0},t.xComparator.get=function(){return{interfaces_:function(){return[eI]},compare:function(r,i){return n.compareDoubles(e.centreX(r.getBounds()),e.centreX(i.getBounds()))}}},t.yComparator.get=function(){return{interfaces_:function(){return[eI]},compare:function(r,i){return n.compareDoubles(e.centreY(r.getBounds()),e.centreY(i.getBounds()))}}},t.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(r,i){return r.intersects(i)}}},t.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,t),e}(du),ILe=function(n){function e(){var t=arguments[0];n.call(this,t)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var r=null,i=this.getChildBoundables().iterator();i.hasNext();){var a=i.next();r===null?r=new gn(a.getBounds()):r.expandToInclude(a.getBounds())}return r},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ol),ac=function(){};ac.prototype.interfaces_=function(){return[]};ac.prototype.getClass=function(){return ac};ac.relativeSign=function(e,t){return et?1:0};ac.compare=function(e,t,r){if(t.equals2D(r))return 0;var i=ac.relativeSign(t.x,r.x),a=ac.relativeSign(t.y,r.y);switch(e){case 0:return ac.compareValue(i,a);case 1:return ac.compareValue(a,i);case 2:return ac.compareValue(a,-i);case 3:return ac.compareValue(-i,a);case 4:return ac.compareValue(-i,-a);case 5:return ac.compareValue(-a,-i);case 6:return ac.compareValue(-a,i);case 7:return ac.compareValue(i,-a)}return mi.shouldNeverReachHere("invalid octant value"),0};ac.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0};var b_=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],r=arguments[2],i=arguments[3];this._segString=e,this.coord=new tt(t),this.segmentIndex=r,this._segmentOctant=i,this._isInterior=!t.equals2D(e.getCoordinate(r))};b_.prototype.getCoordinate=function(){return this.coord};b_.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)};b_.prototype.compareTo=function(e){var t=e;return this.segmentIndext.segmentIndex?1:this.coord.equals2D(t.coord)?0:ac.compare(this._segmentOctant,this.coord,t.coord)};b_.prototype.isEndPoint=function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e};b_.prototype.isInterior=function(){return this._isInterior};b_.prototype.interfaces_=function(){return[$d]};b_.prototype.getClass=function(){return b_};var Zh=function(){this._nodeMap=new dh,this._edge=null;var e=arguments[0];this._edge=e};Zh.prototype.getSplitCoordinates=function(){var e=this,t=new Qk;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var a=r.next();e.addEdgeCoordinates(i,a,t),i=a}return t.toCoordinateArray()};Zh.prototype.addCollapsedNodes=function(){var e=this,t=new Pr;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var r=t.iterator();r.hasNext();){var i=r.next().intValue();e.add(e._edge.getCoordinate(i),i)}};Zh.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var r=t.next();r.print(e)}};Zh.prototype.findCollapsesFromExistingVertices=function(e){for(var t=this,r=0;r=0?t>=0?r>=i?0:1:r>=i?7:6:t>=0?r>=i?3:2:r>=i?4:5}else if(arguments[0]instanceof tt&&arguments[1]instanceof tt){var a=arguments[0],o=arguments[1],s=o.x-a.x,l=o.y-a.y;if(s===0&&l===0)throw new Ss("Cannot compute the octant for two identical points "+a);return P2.octant(s,l)}};var T0=function(){};T0.prototype.getCoordinates=function(){};T0.prototype.size=function(){};T0.prototype.getCoordinate=function(e){};T0.prototype.isClosed=function(){};T0.prototype.setData=function(e){};T0.prototype.getData=function(){};T0.prototype.interfaces_=function(){return[]};T0.prototype.getClass=function(){return T0};var GN=function(){};GN.prototype.addIntersection=function(e,t){};GN.prototype.interfaces_=function(){return[T0]};GN.prototype.getClass=function(){return GN};var al=function(){this._nodeList=new Zh(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};al.prototype.getCoordinates=function(){return this._pts};al.prototype.size=function(){return this._pts.length};al.prototype.getCoordinate=function(e){return this._pts[e]};al.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};al.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))};al.prototype.setData=function(e){this._data=e};al.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:P2.octant(e,t)};al.prototype.getData=function(){return this._data};al.prototype.addIntersection=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(arguments.length===4){var r=arguments[0],i=arguments[1],a=arguments[3],o=new tt(r.getIntersection(a));this.addIntersection(o,i)}};al.prototype.toString=function(){return Mv.toLineString(new el(this._pts))};al.prototype.getNodeList=function(){return this._nodeList};al.prototype.addIntersectionNode=function(e,t){var r=t,i=r+1;if(i=0&&r>=0||t<=0&&r<=0?Math.max(t,r):0}else if(arguments[0]instanceof tt){var i=arguments[0];return Gr.orientationIndex(this.p0,this.p1,i)}};wn.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])};wn.prototype.isVertical=function(){return this.p0.x===this.p1.x};wn.prototype.equals=function(e){if(!(e instanceof wn))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)};wn.prototype.intersection=function(e){var t=new Ow;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null};wn.prototype.project=function(){if(arguments[0]instanceof tt){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new tt(e);var t=this.projectionFactor(e),r=new tt;return r.x=this.p0.x+t*(this.p1.x-this.p0.x),r.y=this.p0.y+t*(this.p1.y-this.p0.y),r}else if(arguments[0]instanceof wn){var i=arguments[0],a=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(a>=1&&o>=1||a<=0&&o<=0)return null;var s=this.project(i.p0);a<0&&(s=this.p0),a>1&&(s=this.p1);var l=this.project(i.p1);return o<0&&(l=this.p0),o>1&&(l=this.p1),new wn(s,l)}};wn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};wn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};wn.prototype.getCoordinate=function(e){return e===0?this.p0:this.p1};wn.prototype.distancePerpendicular=function(e){return Gr.distancePointLinePerpendicular(e,this.p0,this.p1)};wn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};wn.prototype.midPoint=function(){return wn.midPoint(this.p0,this.p1)};wn.prototype.projectionFactor=function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,r=this.p1.y-this.p0.y,i=t*t+r*r;if(i<=0)return ui.NaN;var a=((e.x-this.p0.x)*t+(e.y-this.p0.y)*r)/i;return a};wn.prototype.closestPoints=function(e){var t=this.intersection(e);if(t!==null)return[t,t];var r=new Array(2).fill(null),i=ui.MAX_VALUE,a=null,o=this.closestPoint(e.p0);i=o.distance(e.p0),r[0]=o,r[1]=e.p0;var s=this.closestPoint(e.p1);a=s.distance(e.p1),a0&&t<1)return this.project(e);var r=this.p0.distance(e),i=this.p1.distance(e);return r1||ui.isNaN(t))&&(t=1),t};wn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};wn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};wn.prototype.distance=function(){if(arguments[0]instanceof wn){var e=arguments[0];return Gr.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}else if(arguments[0]instanceof tt){var t=arguments[0];return Gr.distancePointLine(t,this.p0,this.p1)}};wn.prototype.pointAlong=function(e){var t=new tt;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t};wn.prototype.hashCode=function(){var e=ui.doubleToLongBits(this.p0.x);e^=ui.doubleToLongBits(this.p0.y)*31;var t=Math.trunc(e)^Math.trunc(e>>32),r=ui.doubleToLongBits(this.p1.x);r^=ui.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(r)^Math.trunc(r>>32);return t^i};wn.prototype.interfaces_=function(){return[$d,Wd]};wn.prototype.getClass=function(){return wn};wn.midPoint=function(e,t){return new tt((e.x+t.x)/2,(e.y+t.y)/2)};FJe.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(wn,FJe);var zN=function(){this.tempEnv1=new gn,this.tempEnv2=new gn,this._overlapSeg1=new wn,this._overlapSeg2=new wn};zN.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var e=arguments[0],t=arguments[1],r=arguments[2],i=arguments[3];e.getLineSegment(t,this._overlapSeg1),r.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}};zN.prototype.interfaces_=function(){return[]};zN.prototype.getClass=function(){return zN};var ef=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],r=arguments[2],i=arguments[3];this._pts=e,this._start=t,this._end=r,this._context=i};ef.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]};ef.prototype.computeSelect=function(e,t,r,i){var a=this._pts[t],o=this._pts[r];if(i.tempEnv1.init(a,o),r-t===1)return i.select(this,t),null;if(!e.intersects(i.tempEnv1))return null;var s=Math.trunc((t+r)/2);t=e.length-1)return e.length-1;for(var i=Eo.quadrant(e[r],e[r+1]),a=t+1;as.getId()&&(s.computeOverlaps(h,a),i._nOverlaps++),i._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.SegmentOverlapAction.get=function(){return LLe},Object.defineProperties(e,t),e}(UN),LLe=function(n){function e(){n.call(this),this._si=null;var t=arguments[0];this._si=t}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length===4){var r=arguments[0],i=arguments[1],a=arguments[2],o=arguments[3],s=r.getContext(),l=a.getContext();this._si.processIntersections(s,i,l,o)}else return n.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(zN),eo=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(r)}else if(arguments.length===4){var i=arguments[0],a=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(a),this.setJoinStyle(o),this.setMitreLimit(s)}}},Um={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};eo.prototype.getEndCapStyle=function(){return this._endCapStyle};eo.prototype.isSingleSided=function(){return this._isSingleSided};eo.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=eo.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=eo.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==eo.JOIN_ROUND&&(this._quadrantSegments=eo.DEFAULT_QUADRANT_SEGMENTS)};eo.prototype.getJoinStyle=function(){return this._joinStyle};eo.prototype.setJoinStyle=function(e){this._joinStyle=e};eo.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e};eo.prototype.getSimplifyFactor=function(){return this._simplifyFactor};eo.prototype.getQuadrantSegments=function(){return this._quadrantSegments};eo.prototype.setEndCapStyle=function(e){this._endCapStyle=e};eo.prototype.getMitreLimit=function(){return this._mitreLimit};eo.prototype.setMitreLimit=function(e){this._mitreLimit=e};eo.prototype.setSingleSided=function(e){this._isSingleSided=e};eo.prototype.interfaces_=function(){return[]};eo.prototype.getClass=function(){return eo};eo.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)};Um.CAP_ROUND.get=function(){return 1};Um.CAP_FLAT.get=function(){return 2};Um.CAP_SQUARE.get=function(){return 3};Um.JOIN_ROUND.get=function(){return 1};Um.JOIN_MITRE.get=function(){return 2};Um.JOIN_BEVEL.get=function(){return 3};Um.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};Um.DEFAULT_MITRE_LIMIT.get=function(){return 5};Um.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(eo,Um);var Hs=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Gr.COUNTERCLOCKWISE,this._inputLine=e||null},rF={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Hs.prototype.isDeletable=function(e,t,r,i){var a=this._inputLine[e],o=this._inputLine[t],s=this._inputLine[r];return!this.isConcave(a,o,s)||!this.isShallow(a,o,s,i)?!1:this.isShallowSampled(a,o,e,r,i)};Hs.prototype.deleteShallowConcavities=function(){for(var e=this,t=1,r=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(r),a=!1;i=0;a--)r.addPt(e[a])};$f.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1),r=e.distance(t);return rMath.PI;)e-=ea.PI_TIMES_2;for(;e<=-Math.PI;)e+=ea.PI_TIMES_2;return e};ea.angle=function(){if(arguments.length===1){var e=arguments[0];return Math.atan2(e.y,e.x)}else if(arguments.length===2){var t=arguments[0],r=arguments[1],i=r.x-t.x,a=r.y-t.y;return Math.atan2(a,i)}};ea.isAcute=function(e,t,r){var i=e.x-t.x,a=e.y-t.y,o=r.x-t.x,s=r.y-t.y,l=i*o+a*s;return l>0};ea.isObtuse=function(e,t,r){var i=e.x-t.x,a=e.y-t.y,o=r.x-t.x,s=r.y-t.y,l=i*o+a*s;return l<0};ea.interiorAngle=function(e,t,r){var i=ea.angle(t,e),a=ea.angle(t,r);return Math.abs(a-i)};ea.normalizePositive=function(e){if(e<0){for(;e<0;)e+=ea.PI_TIMES_2;e>=ea.PI_TIMES_2&&(e=0)}else{for(;e>=ea.PI_TIMES_2;)e-=ea.PI_TIMES_2;e<0&&(e=0)}return e};ea.angleBetween=function(e,t,r){var i=ea.angle(t,e),a=ea.angle(t,r);return ea.diff(i,a)};ea.diff=function(e,t){var r=null;return eMath.PI&&(r=2*Math.PI-r),r};ea.toRadians=function(e){return e*Math.PI/180};ea.getTurn=function(e,t){var r=Math.sin(t-e);return r>0?ea.COUNTERCLOCKWISE:r<0?ea.CLOCKWISE:ea.NONE};ea.angleBetweenOriented=function(e,t,r){var i=ea.angle(t,e),a=ea.angle(t,r),o=a-i;return o<=-Math.PI?o+ea.PI_TIMES_2:o>Math.PI?o-ea.PI_TIMES_2:o};ET.PI_TIMES_2.get=function(){return 2*Math.PI};ET.PI_OVER_2.get=function(){return Math.PI/2};ET.PI_OVER_4.get=function(){return Math.PI/4};ET.COUNTERCLOCKWISE.get=function(){return Gr.COUNTERCLOCKWISE};ET.CLOCKWISE.get=function(){return Gr.CLOCKWISE};ET.NONE.get=function(){return Gr.COLLINEAR};Object.defineProperties(ea,ET);var us=function n(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new wn,this._seg1=new wn,this._offset0=new wn,this._offset1=new wn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],t=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=t,this._li=new Ow,this._filletAngleQuantum=Math.PI/2/t.getQuadrantSegments(),t.getQuadrantSegments()>=8&&t.getJoinStyle()===eo.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},nF={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};us.prototype.addNextSegment=function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var r=Gr.computeOrientation(this._s0,this._s1,this._s2),i=r===Gr.CLOCKWISE&&this._side===wr.LEFT||r===Gr.COUNTERCLOCKWISE&&this._side===wr.RIGHT;r===0?this.addCollinear(t):i?this.addOutsideTurn(r,t):this.addInsideTurn(r,t)};us.prototype.addLineEndCap=function(e,t){var r=new wn(e,t),i=new wn;this.computeOffsetSegment(r,wr.LEFT,this._distance,i);var a=new wn;this.computeOffsetSegment(r,wr.RIGHT,this._distance,a);var o=t.x-e.x,s=t.y-e.y,l=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case eo.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(t,l+Math.PI/2,l-Math.PI/2,Gr.CLOCKWISE,this._distance),this._segList.addPt(a.p1);break;case eo.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(a.p1);break;case eo.CAP_SQUARE:var u=new tt;u.x=Math.abs(this._distance)*Math.cos(l),u.y=Math.abs(this._distance)*Math.sin(l);var h=new tt(i.p1.x+u.x,i.p1.y+u.y),c=new tt(a.p1.x+u.x,a.p1.y+u.y);this._segList.addPt(h),this._segList.addPt(c);break}};us.prototype.getCoordinates=function(){var e=this._segList.getCoordinates();return e};us.prototype.addMitreJoin=function(e,t,r,i){var a=!0,o=null;try{o=Sv.intersection(t.p0,t.p1,r.p0,r.p1);var s=i<=0?1:o.distance(e)/Math.abs(i);s>this._bufParams.getMitreLimit()&&(a=!1)}catch(l){if(l instanceof gL)o=new tt(0,0),a=!1;else throw l}finally{}a?this._segList.addPt(o):this.addLimitedMitreJoin(t,r,i,this._bufParams.getMitreLimit())};us.prototype.addFilletCorner=function(e,t,r,i,a){var o=t.x-e.x,s=t.y-e.y,l=Math.atan2(s,o),u=r.x-e.x,h=r.y-e.y,c=Math.atan2(h,u);i===Gr.CLOCKWISE?l<=c&&(l+=2*Math.PI):l>=c&&(l-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,l,c,i,a),this._segList.addPt(r)};us.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)0){var r=new tt((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r);var i=new tt((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}};us.prototype.createCircle=function(e){var t=new tt(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};us.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)};us.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new $f,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*us.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};us.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var t=this._li.getIntersectionNum();t>=2&&(this._bufParams.getJoinStyle()===eo.JOIN_BEVEL||this._bufParams.getJoinStyle()===eo.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,Gr.CLOCKWISE,this._distance))};us.prototype.closeRing=function(){this._segList.closeRing()};us.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};us.prototype.interfaces_=function(){return[]};us.prototype.getClass=function(){return us};nF.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};nF.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};nF.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};nF.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(us,nF);var yc=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t};yc.prototype.getOffsetCurve=function(e,t){if(this._distance=t,t===0)return null;var r=t<0,i=Math.abs(t),a=this.getSegGen(i);e.length<=1?this.computePointCurve(e[0],a):this.computeOffsetCurve(e,r,a);var o=a.getCoordinates();return r&&Bi.reverse(o),o};yc.prototype.computeSingleSidedBufferCurve=function(e,t,r){var i=this.simplifyTolerance(this._distance);if(t){r.addSegments(e,!0);var a=Hs.simplify(e,-i),o=a.length-1;r.initSideSegments(a[o],a[o-1],wr.LEFT),r.addFirstSegment();for(var s=o-2;s>=0;s--)r.addNextSegment(a[s],!0)}else{r.addSegments(e,!1);var l=Hs.simplify(e,i),u=l.length-1;r.initSideSegments(l[0],l[1],wr.LEFT),r.addFirstSegment();for(var h=2;h<=u;h++)r.addNextSegment(l[h],!0)}r.addLastSegment(),r.closeRing()};yc.prototype.computeRingBufferCurve=function(e,t,r){var i=this.simplifyTolerance(this._distance);t===wr.RIGHT&&(i=-i);var a=Hs.simplify(e,i),o=a.length-1;r.initSideSegments(a[o-1],a[0],t);for(var s=1;s<=o;s++){var l=s!==1;r.addNextSegment(a[s],l)}r.closeRing()};yc.prototype.computeLineBufferCurve=function(e,t){var r=this.simplifyTolerance(this._distance),i=Hs.simplify(e,r),a=i.length-1;t.initSideSegments(i[0],i[1],wr.LEFT);for(var o=2;o<=a;o++)t.addNextSegment(i[o],!0);t.addLastSegment(),t.addLineEndCap(i[a-1],i[a]);var s=Hs.simplify(e,-r),l=s.length-1;t.initSideSegments(s[l],s[l-1],wr.LEFT);for(var u=l-2;u>=0;u--)t.addNextSegment(s[u],!0);t.addLastSegment(),t.addLineEndCap(s[1],s[0]),t.closeRing()};yc.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case eo.CAP_ROUND:t.createCircle(e);break;case eo.CAP_SQUARE:t.createSquare(e);break}};yc.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided()||t===0)return null;var r=Math.abs(t),i=this.getSegGen(r);if(e.length<=1)this.computePointCurve(e[0],i);else if(this._bufParams.isSingleSided()){var a=t<0;this.computeSingleSidedBufferCurve(e,a,i)}else this.computeLineBufferCurve(e,i);var o=i.getCoordinates();return o};yc.prototype.getBufferParameters=function(){return this._bufParams};yc.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()};yc.prototype.getRingCurve=function(e,t,r){if(this._distance=r,e.length<=2)return this.getLineCurve(e,r);if(r===0)return yc.copyCoordinates(e);var i=this.getSegGen(r);return this.computeRingBufferCurve(e,t,i),i.getCoordinates()};yc.prototype.computeOffsetCurve=function(e,t,r){var i=this.simplifyTolerance(this._distance);if(t){var a=Hs.simplify(e,-i),o=a.length-1;r.initSideSegments(a[o],a[o-1],wr.LEFT),r.addFirstSegment();for(var s=o-2;s>=0;s--)r.addNextSegment(a[s],!0)}else{var l=Hs.simplify(e,i),u=l.length-1;r.initSideSegments(l[0],l[1],wr.LEFT),r.addFirstSegment();for(var h=2;h<=u;h++)r.addNextSegment(l[h],!0)}r.addLastSegment()};yc.prototype.getSegGen=function(e){return new us(this._precisionModel,this._bufParams,e)};yc.prototype.interfaces_=function(){return[]};yc.prototype.getClass=function(){return yc};yc.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),r=0;ro.getMaxY()||e.findStabbedSegments(t,a.getDirectedEdges(),r)}return r}else if(arguments.length===3){if(zn(arguments[2],wv)&&arguments[0]instanceof tt&&arguments[1]instanceof Vre)for(var s=arguments[0],l=arguments[1],u=arguments[2],h=l.getEdge().getCoordinates(),c=0;ce._seg.p1.y&&e._seg.reverse();var f=Math.max(e._seg.p0.x,e._seg.p1.x);if(!(fe._seg.p1.y)&&Gr.computeOrientation(e._seg.p0,e._seg.p1,s)!==Gr.RIGHT){var d=l.getDepth(wr.LEFT);e._seg.p0.equals(h[c])||(d=l.getDepth(wr.RIGHT));var v=new hw(e._seg,d);u.add(v)}}else if(zn(arguments[2],wv)&&arguments[0]instanceof tt&&zn(arguments[1],wv))for(var p=arguments[0],g=arguments[1],m=arguments[2],y=g.iterator();y.hasNext();){var _=y.next();!_.isForward()||e.findStabbedSegments(p,_,m)}}};O2.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(t.size()===0)return 0;var r=Pv.min(t);return r._leftDepth};O2.prototype.interfaces_=function(){return[]};O2.prototype.getClass=function(){return O2};GJe.DepthSegment.get=function(){return hw};Object.defineProperties(O2,GJe);var hw=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new wn(e),this._leftDepth=t};hw.prototype.compareTo=function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var r=this._upwardSeg.orientationIndex(t._upwardSeg);return r!==0||(r=-1*t._upwardSeg.orientationIndex(this._upwardSeg),r!==0)?r:this._upwardSeg.compareTo(t._upwardSeg)};hw.prototype.compareX=function(e,t){var r=e.p0.compareTo(t.p0);return r!==0?r:e.p1.compareTo(t.p1)};hw.prototype.toString=function(){return this._upwardSeg.toString()};hw.prototype.interfaces_=function(){return[$d]};hw.prototype.getClass=function(){return hw};var ro=function(e,t,r){this.p0=e||null,this.p1=t||null,this.p2=r||null};ro.prototype.area=function(){return ro.area(this.p0,this.p1,this.p2)};ro.prototype.signedArea=function(){return ro.signedArea(this.p0,this.p1,this.p2)};ro.prototype.interpolateZ=function(e){if(e===null)throw new Ss("Supplied point is null.");return ro.interpolateZ(e,this.p0,this.p1,this.p2)};ro.prototype.longestSideLength=function(){return ro.longestSideLength(this.p0,this.p1,this.p2)};ro.prototype.isAcute=function(){return ro.isAcute(this.p0,this.p1,this.p2)};ro.prototype.circumcentre=function(){return ro.circumcentre(this.p0,this.p1,this.p2)};ro.prototype.area3D=function(){return ro.area3D(this.p0,this.p1,this.p2)};ro.prototype.centroid=function(){return ro.centroid(this.p0,this.p1,this.p2)};ro.prototype.inCentre=function(){return ro.inCentre(this.p0,this.p1,this.p2)};ro.prototype.interfaces_=function(){return[]};ro.prototype.getClass=function(){return ro};ro.area=function(e,t,r){return Math.abs(((r.x-e.x)*(t.y-e.y)-(t.x-e.x)*(r.y-e.y))/2)};ro.signedArea=function(e,t,r){return((r.x-e.x)*(t.y-e.y)-(t.x-e.x)*(r.y-e.y))/2};ro.det=function(e,t,r,i){return e*i-t*r};ro.interpolateZ=function(e,t,r,i){var a=t.x,o=t.y,s=r.x-a,l=i.x-a,u=r.y-o,h=i.y-o,c=s*h-l*u,f=e.x-a,d=e.y-o,v=(h*f-l*d)/c,p=(-u*f+s*d)/c,g=t.z+v*(r.z-t.z)+p*(i.z-t.z);return g};ro.longestSideLength=function(e,t,r){var i=e.distance(t),a=t.distance(r),o=r.distance(e),s=i;return a>s&&(s=a),o>s&&(s=o),s};ro.isAcute=function(e,t,r){return!(!ea.isAcute(e,t,r)||!ea.isAcute(t,r,e)||!ea.isAcute(r,e,t))};ro.circumcentre=function(e,t,r){var i=r.x,a=r.y,o=e.x-i,s=e.y-a,l=t.x-i,u=t.y-a,h=2*ro.det(o,s,l,u),c=ro.det(s,o*o+s*s,u,l*l+u*u),f=ro.det(o,o*o+s*s,l,l*l+u*u),d=i-c/h,v=a+f/h;return new tt(d,v)};ro.perpendicularBisector=function(e,t){var r=t.x-e.x,i=t.y-e.y,a=new Sv(e.x+r/2,e.y+i/2,1),o=new Sv(e.x-i+r/2,e.y+r+i/2,1);return new Sv(a,o)};ro.angleBisector=function(e,t,r){var i=t.distance(e),a=t.distance(r),o=i/(i+a),s=r.x-e.x,l=r.y-e.y,u=new tt(e.x+o*s,e.y+o*l);return u};ro.area3D=function(e,t,r){var i=t.x-e.x,a=t.y-e.y,o=t.z-e.z,s=r.x-e.x,l=r.y-e.y,u=r.z-e.z,h=a*u-o*l,c=o*s-i*u,f=i*l-a*s,d=h*h+c*c+f*f,v=Math.sqrt(d)/2;return v};ro.centroid=function(e,t,r){var i=(e.x+t.x+r.x)/3,a=(e.y+t.y+r.y)/3;return new tt(i,a)};ro.inCentre=function(e,t,r){var i=t.distance(r),a=e.distance(r),o=e.distance(t),s=i+a+o,l=(i*e.x+a*t.x+o*r.x)/s,u=(i*e.y+a*t.y+o*r.y)/s;return new tt(l,u)};var Dd=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Pr;var e=arguments[0],t=arguments[1],r=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=r};Dd.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),r=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(r,dt.EXTERIOR,dt.INTERIOR)};Dd.prototype.addPolygon=function(e){var t=this,r=this._distance,i=wr.LEFT;this._distance<0&&(r=-this._distance,i=wr.RIGHT);var a=e.getExteriorRing(),o=Bi.removeRepeatedPoints(a.getCoordinates());if(this._distance<0&&this.isErodedCompletely(a,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,r,i,dt.EXTERIOR,dt.INTERIOR);for(var s=0;s0&&t.isErodedCompletely(l,-t._distance)||t.addPolygonRing(u,r,wr.opposite(i),dt.INTERIOR,dt.EXTERIOR)}};Dd.prototype.isTriangleErodedCompletely=function(e,t){var r=new ro(e[0],e[1],e[2]),i=r.inCentre(),a=Gr.distancePointLine(i,r.p0,r.p1);return a=b0.MINIMUM_VALID_SIZE&&Gr.isCCW(e)&&(o=a,s=i,r=wr.opposite(r));var l=this._curveBuilder.getRingCurve(e,r,t);this.addCurve(l,o,s)};Dd.prototype.add=function(e){if(e.isEmpty())return null;e instanceof Rl?this.addPolygon(e):e instanceof $s?this.addLineString(e):e instanceof Jc?this.addPoint(e):e instanceof sI?this.addCollection(e):e instanceof lw?this.addCollection(e):e instanceof p0?this.addCollection(e):e instanceof Yh&&this.addCollection(e)};Dd.prototype.isErodedCompletely=function(e,t){var r=e.getCoordinates();if(r.length<4)return t<0;if(r.length===4)return this.isTriangleErodedCompletely(r,t);var i=e.getEnvelopeInternal(),a=Math.min(i.getHeight(),i.getWidth());return t<0&&2*Math.abs(t)>a};Dd.prototype.addCollection=function(e){for(var t=this,r=0;r=this._max)throw new mL;var e=this._parent.getGeometryN(this._index++);return e instanceof Yh?(this._subcollectionIterator=new g0(e),this._subcollectionIterator.next()):e};g0.prototype.remove=function(){throw new Error(this.getClass().getName())};g0.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)};g0.prototype.interfaces_=function(){return[yL]};g0.prototype.getClass=function(){return g0};g0.isAtomic=function(e){return!(e instanceof Yh)};var Ff=function(){this._geom=null;var e=arguments[0];this._geom=e};Ff.prototype.locate=function(e){return Ff.locate(e,this._geom)};Ff.prototype.interfaces_=function(){return[cI]};Ff.prototype.getClass=function(){return Ff};Ff.isPointInRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?Gr.isPointInRing(e,t.getCoordinates()):!1};Ff.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var r=t.getExteriorRing();if(!Ff.isPointInRing(e,r))return!1;for(var i=0;i=0;o--){var s=r._edgeList.get(o),l=s.getSym();a===null&&(a=l),i!==null&&l.setNext(i),i=s}a.setNext(i)},e.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],a=this.findIndex(i),o=i.getDepth(wr.LEFT),s=i.getDepth(wr.RIGHT),l=this.computeDepths(a+1,this._edgeList.size(),o),u=this.computeDepths(0,a,l);if(u!==s)throw new wm("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var h=arguments[0],c=arguments[1],f=arguments[2],d=f,v=h;v=0;l--){var u=i._resultAreaEdgeList.get(l),h=u.getSym();switch(a===null&&u.getEdgeRing()===r&&(a=u),s){case i._SCANNING_FOR_INCOMING:if(h.getEdgeRing()!==r)continue;o=h,s=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(u.getEdgeRing()!==r)continue;o.setNextMin(u),s=i._SCANNING_FOR_INCOMING;break}}s===this._LINKING_TO_OUTGOING&&(mi.isTrue(a!==null,"found null for first outgoing dirEdge"),mi.isTrue(a.getEdgeRing()===r,"unable to link last incoming dirEdge"),o.setNextMin(a))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var a=i.next();a.isInResult()&&r++}return r}else if(arguments.length===1){for(var o=arguments[0],s=0,l=this.iterator();l.hasNext();){var u=l.next();u.getEdgeRing()===o&&s++}return s}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var r=dt.NONE,i=this.iterator();i.hasNext();){var a=i.next(),o=a.getSym();if(!a.isLineEdge()){if(a.isInResult()){r=dt.INTERIOR;break}if(o.isInResult()){r=dt.EXTERIOR;break}}}if(r===dt.NONE)return null;for(var s=r,l=this.iterator();l.hasNext();){var u=l.next(),h=u.getSym();u.isLineEdge()?u.getEdge().setCovered(s===dt.INTERIOR):(u.isInResult()&&(s=dt.EXTERIOR),h.isInResult()&&(s=dt.INTERIOR))}},e.prototype.computeLabelling=function(r){var i=this;n.prototype.computeLabelling.call(this,r),this._label=new fo(dt.NONE);for(var a=this.iterator();a.hasNext();)for(var o=a.next(),s=o.getEdge(),l=s.getLabel(),u=0;u<2;u++){var h=l.getLocation(u);(h===dt.INTERIOR||h===dt.BOUNDARY)&&i._label.setLocation(u,dt.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ph),zJe=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.createNode=function(r){return new G$(r,new jzr)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(lI),E_=function n(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=n.orientation(e)};E_.prototype.compareTo=function(e){var t=e,r=E_.compareOriented(this._pts,this._orientation,t._pts,t._orientation);return r};E_.prototype.interfaces_=function(){return[$d]};E_.prototype.getClass=function(){return E_};E_.orientation=function(e){return Bi.increasingDirection(e)===1};E_.compareOriented=function(e,t,r,i){for(var a=t?1:-1,o=i?1:-1,s=t?e.length:-1,l=i?r.length:-1,u=t?0:e.length-1,h=i?0:r.length-1;;){var c=e[u].compareTo(r[h]);if(c!==0)return c;u+=a,h+=o;var f=u===s,d=h===l;if(f&&!d)return-1;if(!f&&d)return 1;if(f&&d)return 0}};var Ov=function(){this._edges=new Pr,this._ocaMap=new dh};Ov.prototype.print=function(e){var t=this;e.print("MULTILINESTRING ( ");for(var r=0;r0&&e.print(","),e.print("(");for(var a=i.getCoordinates(),o=0;o0&&e.print(","),e.print(a[o].x+" "+a[o].y);e.println(")")}e.print(") ")};Ov.prototype.addAll=function(e){for(var t=this,r=e.iterator();r.hasNext();)t.add(r.next())};Ov.prototype.findEdgeIndex=function(e){for(var t=this,r=0;r0||!t.coord.equals2D(a);o||i--;var s=new Array(i).fill(null),l=0;s[l++]=new tt(e.coord);for(var u=e.segmentIndex+1;u<=t.segmentIndex;u++)s[l++]=r.edge.pts[u];return o&&(s[l]=t.coord),new H7(s,new fo(this.edge._label))};C0.prototype.add=function(e,t,r){var i=new Jp(e,t,r),a=this._nodeMap.get(i);return a!==null?a:(this._nodeMap.put(i,i),i)};C0.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();){var r=t.next();if(r.coord.equals(e))return!0}return!1};C0.prototype.interfaces_=function(){return[]};C0.prototype.getClass=function(){return C0};var fw=function(){};fw.prototype.getChainStartIndices=function(e){var t=this,r=0,i=new Pr;i.add(new jp(r));do{var a=t.findChainEnd(e,r);i.add(new jp(a)),r=a}while(rr?t:r};Em.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,r=this.pts[this.startIndex[e+1]].x;return tr&&(a=1),e._depth[t][i]=a}}};Fu.prototype.getDelta=function(e){return this._depth[e][wr.RIGHT]-this._depth[e][wr.LEFT]};Fu.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?dt.EXTERIOR:dt.INTERIOR};Fu.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};Fu.prototype.add=function(){var e=this;if(arguments.length===1)for(var t=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var a=t.getLocation(r,i);(a===dt.EXTERIOR||a===dt.INTERIOR)&&(e.isNull(r,i)?e._depth[r][i]=Fu.depthAtLocation(a):e._depth[r][i]+=Fu.depthAtLocation(a))}else if(arguments.length===3){var o=arguments[0],s=arguments[1],l=arguments[2];l===dt.INTERIOR&&this._depth[o][s]++}};Fu.prototype.interfaces_=function(){return[]};Fu.prototype.getClass=function(){return Fu};Fu.depthAtLocation=function(e){return e===dt.EXTERIOR?0:e===dt.INTERIOR?1:Fu.NULL_VALUE};UJe.NULL_VALUE.get=function(){return-1};Object.defineProperties(Fu,UJe);var H7=function(n){function e(){if(n.call(this),this.pts=null,this._env=null,this.eiList=new C0(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Fu,this._depthDelta=0,arguments.length===1){var t=arguments[0];e.call(this,t,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new e(r,fo.toLineLabel(this._label));return i},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(r){this._isIsolated=r},e.prototype.setName=function(r){this._name=r},e.prototype.equals=function(r){var i=this;if(!(r instanceof e))return!1;var a=r;if(this.pts.length!==a.pts.length)return!1;for(var o=!0,s=!0,l=this.pts.length,u=0;u0?this.pts[0]:null;if(arguments.length===1){var r=arguments[0];return this.pts[r]}},e.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var a=0;a0&&r.print(","),r.print(i.pts[a].x+" "+i.pts[a].y);r.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(r){e.updateIM(this._label,r)},e.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(r){var i=this;r.print("edge "+this._name+": ");for(var a=this.pts.length-1;a>=0;a--)r.print(i.pts[a]+" ");r.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Em(this)),this._mce},e.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new gn;for(var i=0;i0&&i.append(","),i.append(r.pts[a].x+" "+r.pts[a].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},e.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var a=0;ai||this._maxyo;if(s)return!1;var l=this.intersectsToleranceSquare(e,t);return mi.isTrue(!(s&&l),"Found bad envelope test"),l};mc.prototype.initCorners=function(e){var t=.5;this._minx=e.x-t,this._maxx=e.x+t,this._miny=e.y-t,this._maxy=e.y+t,this._corner[0]=new tt(this._maxx,this._maxy),this._corner[1]=new tt(this._minx,this._maxy),this._corner[2]=new tt(this._minx,this._miny),this._corner[3]=new tt(this._maxx,this._miny)};mc.prototype.intersects=function(e,t){return this._scaleFactor===1?this.intersectsScaled(e,t):(this.copyScaled(e,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))};mc.prototype.scale=function(e){return Math.round(e*this._scaleFactor)};mc.prototype.getCoordinate=function(){return this._originalPt};mc.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)};mc.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var e=mc.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new gn(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv};mc.prototype.intersectsPixelClosure=function(e,t){return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.hasIntersection()))};mc.prototype.intersectsToleranceSquare=function(e,t){var r=!1,i=!1;return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.isProper())||r&&i||e.equals(this._pt)||t.equals(this._pt))};mc.prototype.addSnappedNode=function(e,t){var r=e.getCoordinate(t),i=e.getCoordinate(t+1);return this.intersects(r,i)?(e.addIntersection(this.getCoordinate(),t),!0):!1};mc.prototype.interfaces_=function(){return[]};mc.prototype.getClass=function(){return mc};$Je.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(mc,$Je);var VN=function(){this.tempEnv1=new gn,this.selectedSegment=new wn};VN.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}};VN.prototype.interfaces_=function(){return[]};VN.prototype.getClass=function(){return VN};var fI=function(){this._index=null;var e=arguments[0];this._index=e},WJe={HotPixelSnapAction:{configurable:!0}};fI.prototype.snap=function(){if(arguments.length===1){var e=arguments[0];return this.snap(e,null,-1)}else if(arguments.length===3){var t=arguments[0],r=arguments[1],i=arguments[2],a=t.getSafeEnvelope(),o=new HJe(t,r,i);return this._index.query(a,{interfaces_:function(){return[w_]},visitItem:function(s){var l=s;l.select(a,o)}}),o.isNodeAdded()}};fI.prototype.interfaces_=function(){return[]};fI.prototype.getClass=function(){return fI};WJe.HotPixelSnapAction.get=function(){return HJe};Object.defineProperties(fI,WJe);var HJe=function(n){function e(){n.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=t,this._parentEdge=r,this._hotPixelVertexIndex=i}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],a=r.getContext();if(this._parentEdge!==null&&a===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(a,i)}else return n.prototype.select.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(VN),R2=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new Pr};R2.prototype.processIntersections=function(e,t,r,i){var a=this;if(e===r&&t===i)return null;var o=e.getCoordinates()[t],s=e.getCoordinates()[t+1],l=r.getCoordinates()[i],u=r.getCoordinates()[i+1];if(this._li.computeIntersection(o,s,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var h=0;h=0;t--){try{e.bufferReducedPrecision(t)}catch(o){if(o instanceof wm)e._saveException=o;else throw o}finally{}if(e._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=Ou.precisionScaleFactor(this._argGeom,this._distance,r),a=new to(i);this.bufferFixedPrecision(a)}};Ou.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===to.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()};Ou.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)};Ou.prototype.bufferOriginalPrecision=function(){try{var e=new jh(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(t instanceof xm)this._saveException=t;else throw t}finally{}};Ou.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry};Ou.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)};Ou.prototype.interfaces_=function(){return[]};Ou.prototype.getClass=function(){return Ou};Ou.bufferOp=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new Ou(e),i=r.getResultGeometry(t);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Gn&&typeof arguments[1]=="number"){var a=arguments[0],o=arguments[1],s=arguments[2],l=new Ou(a);l.setQuadrantSegments(s);var u=l.getResultGeometry(o);return u}else if(arguments[2]instanceof eo&&arguments[0]instanceof Gn&&typeof arguments[1]=="number"){var h=arguments[0],c=arguments[1],f=arguments[2],d=new Ou(h,f),v=d.getResultGeometry(c);return v}}else if(arguments.length===4){var p=arguments[0],g=arguments[1],m=arguments[2],y=arguments[3],_=new Ou(p);_.setQuadrantSegments(m),_.setEndCapStyle(y);var x=_.getResultGeometry(g);return x}};Ou.precisionScaleFactor=function(e,t,r){var i=e.getEnvelopeInternal(),a=Uf.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=t>0?t:0,s=a+2*o,l=Math.trunc(Math.log(s)/Math.log(10)+1),u=r-l,h=Math.pow(10,u);return h};_L.CAP_ROUND.get=function(){return eo.CAP_ROUND};_L.CAP_BUTT.get=function(){return eo.CAP_FLAT};_L.CAP_FLAT.get=function(){return eo.CAP_FLAT};_L.CAP_SQUARE.get=function(){return eo.CAP_SQUARE};_L.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(Ou,_L);var Uh=function(){this._pt=[new tt,new tt],this._distance=ui.NaN,this._isNull=!0};Uh.prototype.getCoordinates=function(){return this._pt};Uh.prototype.getCoordinate=function(e){return this._pt[e]};Uh.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);ithis._distance&&this.initialize(t,r,i)}};Uh.prototype.interfaces_=function(){return[]};Uh.prototype.getClass=function(){return Uh};var Yg=function(){};Yg.prototype.interfaces_=function(){return[]};Yg.prototype.getClass=function(){return Yg};Yg.computeDistance=function(){if(arguments[2]instanceof Uh&&arguments[0]instanceof $s&&arguments[1]instanceof tt)for(var e=arguments[0],t=arguments[1],r=arguments[2],i=e.getCoordinates(),a=new wn,o=0;o0||this._isIn?dt.INTERIOR:dt.EXTERIOR)};Rv.prototype.interfaces_=function(){return[]};Rv.prototype.getClass=function(){return Rv};var Vh=function n(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],t=arguments[1];n.call(this,e,n.INSIDE_AREA,t)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];this._component=r,this._segIndex=i,this._pt=a}},jJe={INSIDE_AREA:{configurable:!0}};Vh.prototype.isInsideArea=function(){return this._segIndex===Vh.INSIDE_AREA};Vh.prototype.getCoordinate=function(){return this._pt};Vh.prototype.getGeometryComponent=function(){return this._component};Vh.prototype.getSegmentIndex=function(){return this._segIndex};Vh.prototype.interfaces_=function(){return[]};Vh.prototype.getClass=function(){return Vh};jJe.INSIDE_AREA.get=function(){return-1};Object.defineProperties(Vh,jJe);var r_=function(e){this._pts=e||null};r_.prototype.filter=function(e){e instanceof Jc&&this._pts.add(e)};r_.prototype.interfaces_=function(){return[Yp]};r_.prototype.getClass=function(){return r_};r_.getPoints=function(){if(arguments.length===1){var e=arguments[0];return e instanceof Jc?Pv.singletonList(e):r_.getPoints(e,new Pr)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return t instanceof Jc?r.add(t):t instanceof Yh&&t.apply(new r_(r)),r}};var N2=function(){this._locations=null;var e=arguments[0];this._locations=e};N2.prototype.filter=function(e){(e instanceof Jc||e instanceof $s||e instanceof Rl)&&this._locations.add(new Vh(e,0,e.getCoordinate()))};N2.prototype.interfaces_=function(){return[Yp]};N2.prototype.getClass=function(){return N2};N2.getLocations=function(e){var t=new Pr;return e.apply(new N2(t)),t};var Vu=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Rv,this._minDistanceLocation=null,this._minDistance=ui.MAX_VALUE,arguments.length===2){var e=arguments[0],t=arguments[1];this._geom=[e,t],this._terminateDistance=0}else if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=a}};Vu.prototype.computeContainmentDistance=function(){var e=this;if(arguments.length===0){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(arguments.length===2){var r=arguments[0],i=arguments[1],a=1-r,o=im.getPolygons(this._geom[r]);if(o.size()>0){var s=N2.getLocations(this._geom[a]);if(this.computeContainmentDistance(s,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[a]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&zn(arguments[0],wv)&&zn(arguments[1],wv)){for(var l=arguments[0],u=arguments[1],h=arguments[2],c=0;cthis._minDistance)return null;for(var a=t.getCoordinates(),o=r.getCoordinate(),s=0;sthis._minDistance)return null;for(var v=c.getCoordinates(),p=f.getCoordinates(),g=0;gthis._distance&&this.initialize(t,r,i)}};oh.prototype.interfaces_=function(){return[]};oh.prototype.getClass=function(){return oh};var Ep=function(){};Ep.prototype.interfaces_=function(){return[]};Ep.prototype.getClass=function(){return Ep};Ep.computeDistance=function(){if(arguments[2]instanceof oh&&arguments[0]instanceof $s&&arguments[1]instanceof tt)for(var e=arguments[0],t=arguments[1],r=arguments[2],i=new wn,a=e.getCoordinates(),o=0;o1||e<=0)throw new Ss("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e};Sd.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)};Sd.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};Sd.prototype.computeOrientedDistance=function(e,t,r){var i=new k2(t);if(e.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var a=new A_(t,this._densifyFrac);e.apply(a),r.setMaximum(a.getMaxPointDistance())}};Sd.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};Sd.prototype.interfaces_=function(){return[]};Sd.prototype.getClass=function(){return Sd};Sd.distance=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new Sd(e,t);return r.distance()}else if(arguments.length===3){var i=arguments[0],a=arguments[1],o=arguments[2],s=new Sd(i,a);return s.setDensifyFraction(o),s.distance()}};Lce.MaxPointDistanceFilter.get=function(){return k2};Lce.MaxDensifiedByFractionDistanceFilter.get=function(){return A_};Object.defineProperties(Sd,Lce);var k2=function(){this._maxPtDist=new oh,this._minPtDist=new oh,this._euclideanDist=new Ep,this._geom=null;var e=arguments[0];this._geom=e};k2.prototype.filter=function(e){this._minPtDist.initialize(),Ep.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};k2.prototype.getMaxPointDistance=function(){return this._maxPtDist};k2.prototype.interfaces_=function(){return[w0]};k2.prototype.getClass=function(){return k2};var A_=function(){this._maxPtDist=new oh,this._minPtDist=new oh,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))};A_.prototype.filter=function(e,t){var r=this;if(t===0)return null;for(var i=e.getCoordinate(t-1),a=e.getCoordinate(t),o=(a.x-i.x)/this._numSubSegs,s=(a.y-i.y)/this._numSubSegs,l=0;lr){this._isValid=!1;var a=i.getCoordinates();this._errorLocation=a[1],this._errorIndicator=e.getFactory().createLineString(a),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Mv.toLineString(a[0],a[1])+")"}};Xc.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=Xc.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-t,this._maxValidDistance=e+t,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Xc.VERBOSE&&zu.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};Xc.prototype.checkNegativeValid=function(){if(!(this._input instanceof Rl||this._input instanceof p0||this._input instanceof Yh))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)};Xc.prototype.getErrorIndicator=function(){return this._errorIndicator};Xc.prototype.checkMinimumDistance=function(e,t,r){var i=new Vu(e,t,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound0&&e>t&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")};$u.prototype.report=function(e){if(!$u.VERBOSE)return null;zu.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))};$u.prototype.getErrorMessage=function(){return this._errorMsg};$u.prototype.interfaces_=function(){return[]};$u.prototype.getClass=function(){return $u};$u.isValidMsg=function(e,t,r){var i=new $u(e,t,r);return i.isValid()?null:i.getErrorMessage()};$u.isValid=function(e,t,r){var i=new $u(e,t,r);return!!i.isValid()};Oce.VERBOSE.get=function(){return!1};Oce.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties($u,Oce);var eg=function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};eg.prototype.getCoordinates=function(){return this._pts};eg.prototype.size=function(){return this._pts.length};eg.prototype.getCoordinate=function(e){return this._pts[e]};eg.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};eg.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:P2.octant(this.getCoordinate(e),this.getCoordinate(e+1))};eg.prototype.setData=function(e){this._data=e};eg.prototype.getData=function(){return this._data};eg.prototype.toString=function(){return Mv.toLineString(new el(this._pts))};eg.prototype.interfaces_=function(){return[T0]};eg.prototype.getClass=function(){return eg};var vu=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Pr,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null};vu.prototype.getInteriorIntersection=function(){return this._interiorIntersection};vu.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e};vu.prototype.getIntersectionSegments=function(){return this._intSegments};vu.prototype.count=function(){return this._intersectionCount};vu.prototype.getIntersections=function(){return this._intersections};vu.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e};vu.prototype.setKeepIntersections=function(e){this._keepIntersections=e};vu.prototype.processIntersections=function(e,t,r,i){if(!this._findAllIntersections&&this.hasIntersection()||e===r&&t===i)return null;if(this._isCheckEndSegmentsOnly){var a=this.isEndSegment(e,t)||this.isEndSegment(r,i);if(!a)return null}var o=e.getCoordinates()[t],s=e.getCoordinates()[t+1],l=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(o,s,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=s,this._intSegments[2]=l,this._intSegments[3]=u,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};vu.prototype.isEndSegment=function(e,t){return t===0||t>=e.size()-2};vu.prototype.hasIntersection=function(){return this._interiorIntersection!==null};vu.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};vu.prototype.interfaces_=function(){return[cw]};vu.prototype.getClass=function(){return vu};vu.createAllIntersectionsFinder=function(e){var t=new vu(e);return t.setFindAllIntersections(!0),t};vu.createAnyIntersectionFinder=function(e){return new vu(e)};vu.createIntersectionCounter=function(e){var t=new vu(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var Dv=function(){this._li=new Ow,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};Dv.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};Dv.prototype.getIntersections=function(){return this._segInt.getIntersections()};Dv.prototype.isValid=function(){return this.execute(),this._isValid};Dv.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e};Dv.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new vu(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new Mce;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};Dv.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new wm(this.getErrorMessage(),this._segInt.getInteriorIntersection())};Dv.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Mv.toLineString(e[0],e[1])+" and "+Mv.toLineString(e[2],e[3])};Dv.prototype.interfaces_=function(){return[]};Dv.prototype.getClass=function(){return Dv};Dv.computeIntersections=function(e){var t=new Dv(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var vw=function n(){this._nv=null;var e=arguments[0];this._nv=new Dv(n.toSegmentStrings(e))};vw.prototype.checkValid=function(){this._nv.checkValid()};vw.prototype.interfaces_=function(){return[]};vw.prototype.getClass=function(){return vw};vw.toSegmentStrings=function(e){for(var t=new Pr,r=e.iterator();r.hasNext();){var i=r.next();t.add(new eg(i.getCoordinates(),i))}return t};vw.checkValid=function(e){var t=new vw(e);t.checkValid()};var F2=function(e){this._mapOp=e};F2.prototype.map=function(e){for(var t=this,r=new Pr,i=0;i0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)};_c.prototype.interfaces_=function(){return[]};_c.prototype.getClass=function(){return _c};var M0=function n(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new wn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof $s&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];n.call(this,e.getCoordinates(),t)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=n.isClosed(r),this._snapTolerance=i}};M0.prototype.snapVertices=function(e,t){for(var r=this,i=this._isClosed?e.size()-1:e.size(),a=0;a=0&&e.add(s+1,new tt(o),!1)}};M0.prototype.findSegmentIndexToSnap=function(e,t){for(var r=this,i=ui.MAX_VALUE,a=-1,o=0;ot&&(t=i)}return t}else if(arguments.length===2){var a=arguments[0],o=arguments[1];return Math.min(tl.computeOverlaySnapTolerance(a),tl.computeOverlaySnapTolerance(o))}};tl.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal(),r=Math.min(t.getHeight(),t.getWidth()),i=r*tl.SNAP_PRECISION_FACTOR;return i};tl.snapToSelf=function(e,t,r){var i=new tl(e);return i.snapToSelf(t,r)};XJe.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(tl,XJe);var YJe=function(n){function e(t,r,i){n.call(this),this._snapTolerance=t||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(r,i){var a=new M0(r,this._snapTolerance);return a.setAllowSnappingToSourceVertices(this._isSelfSnap),a.snapTo(i)},e.prototype.transformCoordinates=function(r,i){var a=r.toCoordinateArray(),o=this.snapLine(a,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(_c),Bh=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Bh.prototype.getCommon=function(){return ui.longBitsToDouble(this._commonBits)};Bh.prototype.add=function(e){var t=ui.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=Bh.signExpBits(this._commonBits),this._isFirst=!1,null;var r=Bh.signExpBits(t);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Bh.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=Bh.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};Bh.prototype.toString=function(){if(arguments.length===1){var e=arguments[0],t=ui.longBitsToDouble(e),r=ui.toBinaryString(e),i="0000000000000000000000000000000000000000000000000000000000000000"+r,a=i.substring(i.length-64),o=a.substring(0,1)+" "+a.substring(1,12)+"(exp) "+a.substring(12)+" [ "+t+" ]";return o}};Bh.prototype.interfaces_=function(){return[]};Bh.prototype.getClass=function(){return Bh};Bh.getBit=function(e,t){var r=1<>52};Bh.zeroLowerBits=function(e,t){var r=(1<=0;i--){if(Bh.getBit(e,i)!==Bh.getBit(t,i))return r;r++}return 52};var M_=function(){this._commonCoord=null,this._ccFilter=new G2},Rce={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};M_.prototype.addCommonBits=function(e){var t=new I_(this._commonCoord);e.apply(t),e.geometryChanged()};M_.prototype.removeCommonBits=function(e){if(this._commonCoord.x===0&&this._commonCoord.y===0)return e;var t=new tt(this._commonCoord);t.x=-t.x,t.y=-t.y;var r=new I_(t);return e.apply(r),e.geometryChanged(),e};M_.prototype.getCommonCoordinate=function(){return this._commonCoord};M_.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()};M_.prototype.interfaces_=function(){return[]};M_.prototype.getClass=function(){return M_};Rce.CommonCoordinateFilter.get=function(){return G2};Rce.Translater.get=function(){return I_};Object.defineProperties(M_,Rce);var G2=function(){this._commonBitsX=new Bh,this._commonBitsY=new Bh};G2.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)};G2.prototype.getCommonCoordinate=function(){return new tt(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};G2.prototype.interfaces_=function(){return[w0]};G2.prototype.getClass=function(){return G2};var I_=function(){this.trans=null;var e=arguments[0];this.trans=e};I_.prototype.filter=function(e,t){var r=e.getOrdinate(t,0)+this.trans.x,i=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,r),e.setOrdinate(t,1,i)};I_.prototype.isDone=function(){return!1};I_.prototype.isGeometryChanged=function(){return!0};I_.prototype.interfaces_=function(){return[Iv]};I_.prototype.getClass=function(){return I_};var pu=function(e,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=t,this.computeSnapTolerance()};pu.prototype.selfSnap=function(e){var t=new tl(e),r=t.snapTo(e,this._snapTolerance);return r};pu.prototype.removeCommonBits=function(e){this._cbr=new M_,this._cbr.add(e[0]),this._cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(e[0].copy()),t[1]=this._cbr.removeCommonBits(e[1].copy()),t};pu.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e};pu.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),r=pi.overlayOp(t[0],t[1],e);return this.prepareResult(r)};pu.prototype.checkValid=function(e){e.isValid()||zu.out.println("Snapped geometry is invalid")};pu.prototype.computeSnapTolerance=function(){this._snapTolerance=tl.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};pu.prototype.snap=function(e){var t=this.removeCommonBits(e),r=tl.snap(t[0],t[1],this._snapTolerance);return r};pu.prototype.interfaces_=function(){return[]};pu.prototype.getClass=function(){return pu};pu.overlayOp=function(e,t,r){var i=new pu(e,t);return i.getResultGeometry(r)};pu.union=function(e,t){return pu.overlayOp(e,t,pi.UNION)};pu.intersection=function(e,t){return pu.overlayOp(e,t,pi.INTERSECTION)};pu.symDifference=function(e,t){return pu.overlayOp(e,t,pi.SYMDIFFERENCE)};pu.difference=function(e,t){return pu.overlayOp(e,t,pi.DIFFERENCE)};var Kh=function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t};Kh.prototype.getResultGeometry=function(e){var t=null,r=!1,i=null;try{t=pi.overlayOp(this._geom[0],this._geom[1],e);var a=!0;a&&(r=!0)}catch(o){if(o instanceof xm)i=o;else throw o}finally{}if(!r)try{t=pu.overlayOp(this._geom[0],this._geom[1],e)}catch(o){throw o instanceof xm?i:o}finally{}return t};Kh.prototype.interfaces_=function(){return[]};Kh.prototype.getClass=function(){return Kh};Kh.overlayOp=function(e,t,r){var i=new Kh(e,t);return i.getResultGeometry(r)};Kh.union=function(e,t){return Kh.overlayOp(e,t,pi.UNION)};Kh.intersection=function(e,t){return Kh.overlayOp(e,t,pi.INTERSECTION)};Kh.symDifference=function(e,t){return Kh.overlayOp(e,t,pi.SYMDIFFERENCE)};Kh.difference=function(e,t){return Kh.overlayOp(e,t,pi.DIFFERENCE)};var $N=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t};$N.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)};$N.prototype.interfaces_=function(){return[]};$N.prototype.getClass=function(){return $N};var tf=function n(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],t=arguments[1];this._eventType=n.DELETE,this._xValue=e,this._insertEvent=t}else if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];this._eventType=n.INSERT,this._label=r,this._xValue=i,this._obj=a}},Dce={INSERT:{configurable:!0},DELETE:{configurable:!0}};tf.prototype.isDelete=function(){return this._eventType===tf.DELETE};tf.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e};tf.prototype.getObject=function(){return this._obj};tf.prototype.compareTo=function(e){var t=e;return this._xValuet._xValue?1:this._eventTypet._eventType?1:0};tf.prototype.getInsertEvent=function(){return this._insertEvent};tf.prototype.isInsert=function(){return this._eventType===tf.INSERT};tf.prototype.isSameLabel=function(e){return this._label===null?!1:this._label===e._label};tf.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};tf.prototype.interfaces_=function(){return[$d]};tf.prototype.getClass=function(){return tf};Dce.INSERT.get=function(){return 1};Dce.DELETE.get=function(){return 2};Object.defineProperties(tf,Dce);var j7=function(){};j7.prototype.interfaces_=function(){return[]};j7.prototype.getClass=function(){return j7};var Wu=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var e=arguments[0],t=arguments[1],r=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=r};Wu.prototype.isTrivialIntersection=function(e,t,r,i){if(e===r&&this._li.getIntersectionNum()===1){if(Wu.isAdjacentSegments(t,i))return!0;if(e.isClosed()){var a=e.getNumPoints()-1;if(t===0&&i===a||i===0&&t===a)return!0}}return!1};Wu.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};Wu.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e};Wu.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};Wu.prototype.isBoundaryPointInternal=function(e,t){for(var r=t.iterator();r.hasNext();){var i=r.next(),a=i.getCoordinate();if(e.isIntersection(a))return!0}return!1};Wu.prototype.hasProperIntersection=function(){return this._hasProper};Wu.prototype.hasIntersection=function(){return this._hasIntersection};Wu.prototype.isDone=function(){return this._isDone};Wu.prototype.isBoundaryPoint=function(e,t){return t===null?!1:!!(this.isBoundaryPointInternal(e,t[0])||this.isBoundaryPointInternal(e,t[1]))};Wu.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t};Wu.prototype.addIntersections=function(e,t,r,i){if(e===r&&t===i)return null;this.numTests++;var a=e.getCoordinates()[t],o=e.getCoordinates()[t+1],s=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(a,o,s,l),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(e.addIntersections(this._li,t,0),r.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))};Wu.prototype.interfaces_=function(){return[]};Wu.prototype.getClass=function(){return Wu};Wu.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var Xzr=function(n){function e(){n.call(this),this.events=new Pr,this.nOverlaps=null}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){var r=this;Pv.sort(this.events);for(var i=0;it||this._maxo?1:0};WN.prototype.interfaces_=function(){return[eI]};WN.prototype.getClass=function(){return WN};var Yzr=function(n){function e(){n.call(this),this._item=null;var t=arguments[0],r=arguments[1],i=arguments[2];this._min=t,this._max=r,this._item=i}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.query=function(r,i,a){if(!this.intersects(r,i))return null;a.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(I0),qzr=function(n){function e(){n.call(this),this._node1=null,this._node2=null;var t=arguments[0],r=arguments[1];this._node1=t,this._node2=r,this.buildExtent(this._node1,this._node2)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},e.prototype.query=function(r,i,a){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,a),this._node2!==null&&this._node2.query(r,i,a)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(I0),L0=function(){this._leaves=new Pr,this._root=null,this._level=0};L0.prototype.buildTree=function(){var e=this;Pv.sort(this._leaves,new I0.NodeComparator);for(var t=this._leaves,r=null,i=new Pr;;){if(e.buildLevel(t,i),i.size()===1)return i.get(0);r=t,t=i,i=r}};L0.prototype.insert=function(e,t,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Yzr(e,t,r))};L0.prototype.query=function(e,t,r){this.init(),this._root.query(e,t,r)};L0.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};L0.prototype.printNode=function(e){zu.out.println(Mv.toLineString(new tt(e._min,this._level),new tt(e._max,this._level)))};L0.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};L0.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var r=0;r=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),a=0,o=r.iterator();o.hasNext();){var s=o.next();i[a++]=s.getCoordinate().copy()}return i},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(r,i,a){if(this.isBoundaryNode(r,i))return null;a===dt.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,a)},e.prototype.addPolygonRing=function(r,i,a){if(r.isEmpty())return null;var o=Bi.removeRepeatedPoints(r.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var s=i,l=a;Gr.isCCW(o)&&(s=a,l=i);var u=new H7(o,new fo(this._argIndex,dt.BOUNDARY,s,l));this._lineEdgeMap.put(r,u),this.insertEdge(u),this.insertPoint(this._argIndex,o[0],dt.BOUNDARY)},e.prototype.insertPoint=function(r,i,a){var o=this._nodes.addNode(i),s=o.getLabel();s===null?o._label=new fo(r,a):s.setLocation(r,a)},e.prototype.createEdgeSetIntersector=function(){return new Xzr},e.prototype.addSelfIntersectionNodes=function(r){for(var i=this,a=this._edges.iterator();a.hasNext();)for(var o=a.next(),s=o.getLabel().getLocation(r),l=o.eiList.iterator();l.hasNext();){var u=l.next();i.addSelfIntersectionNode(r,u.coord,s)}},e.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof p0&&(this._useBoundaryDeterminationRule=!1),r instanceof Rl)this.addPolygon(r);else if(r instanceof $s)this.addLineString(r);else if(r instanceof Jc)this.addPoint(r);else if(r instanceof sI)this.addCollection(r);else if(r instanceof lw)this.addCollection(r);else if(r instanceof p0)this.addCollection(r);else if(r instanceof Yh)this.addCollection(r);else throw new Error(r.getClass().getName())}else return n.prototype.add.apply(this,arguments)},e.prototype.addCollection=function(r){for(var i=this,a=0;a50?(this._areaPtLocator===null&&(this._areaPtLocator=new vI(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return n.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(r,i){return r.isInBoundary(i)?dt.BOUNDARY:dt.INTERIOR},e}(Ps),gI=function(){if(this._li=new Ow,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new XP(0,e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1],i=Od.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new XP(0,t,i),this._arg[1]=new XP(1,r,i)}else if(arguments.length===3){var a=arguments[0],o=arguments[1],s=arguments[2];a.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(a.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new XP(0,a,s),this._arg[1]=new XP(1,o,s)}};gI.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()};gI.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)};gI.prototype.interfaces_=function(){return[]};gI.prototype.getClass=function(){return gI};var LS=function(){};LS.prototype.interfaces_=function(){return[]};LS.prototype.getClass=function(){return LS};LS.map=function(){if(arguments[0]instanceof Gn&&zn(arguments[1],LS.MapOp)){for(var e=arguments[0],t=arguments[1],r=new Pr,i=0;i=e.size()?null:e.get(t)};dl.union=function(e){var t=new dl(e);return t.union()};KJe.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(dl,KJe);var X7=function(){};X7.prototype.interfaces_=function(){return[]};X7.prototype.getClass=function(){return X7};X7.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return pi.createEmptyResult(pi.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),Kh.overlayOp(e,t,pi.UNION)};function Rw(){return new Y7}function Y7(){this.reset()}Y7.prototype={constructor:Y7,reset:function(){this.s=this.t=0},add:function(n){PLe(V6,n,this.t),PLe(this,V6.s,this.s),this.s?this.t+=V6.t:this.s=V6.t},valueOf:function(){return this.s}};var V6=new Y7;function PLe(n,e,t){var r=n.s=e+t,i=r-e,a=r-i;n.t=e-a+(t-i)}var Us=1e-6,Oo=Math.PI,Yy=Oo/2,OLe=Oo/4,Tm=Oo*2,Ex=180/Oo,vp=Oo/180,$h=Math.abs,Zzr=Math.atan,mI=Math.atan2,Ml=Math.cos,Il=Math.sin,xL=Math.sqrt;function JJe(n){return n>1?0:n<-1?Oo:Math.acos(n)}function z2(n){return n>1?Yy:n<-1?-Yy:Math.asin(n)}function FO(){}function q7(n,e){n&&DLe.hasOwnProperty(n.type)&&DLe[n.type](n,e)}var RLe={Feature:function(n,e){q7(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,r=-1,i=t.length;++rOo?n-Tm:n<-Oo?n+Tm:n,e]}jre.invert=jre;function Jzr(n,e,t){return(n%=Tm)?e||t?QJe(FLe(n),BLe(e,t)):FLe(n):e||t?BLe(e,t):jre}function kLe(n){return function(e,t){return e+=n,[e>Oo?e-Tm:e<-Oo?e+Tm:e,t]}}function FLe(n){var e=kLe(n);return e.invert=kLe(-n),e}function BLe(n,e){var t=Ml(n),r=Il(n),i=Ml(e),a=Il(e);function o(s,l){var u=Ml(l),h=Ml(s)*u,c=Il(s)*u,f=Il(l),d=f*t+h*r;return[mI(c*i-d*a,h*t-f*r),z2(d*i+c*a)]}return o.invert=function(s,l){var u=Ml(l),h=Ml(s)*u,c=Il(s)*u,f=Il(l),d=f*i-c*a;return[mI(c*i+f*a,h*t+d*r),z2(d*t-h*r)]},o}function Qzr(n,e,t,r,i,a){if(!!t){var o=Ml(e),s=Il(e),l=r*t;i==null?(i=e+r*Tm,a=e-l/2):(i=GLe(o,i),a=GLe(o,a),(r>0?ia)&&(i+=r*Tm));for(var u,h=i;r>0?h>a:h1&&n.push(n.pop().concat(n.shift()))},result:function(){var t=n;return n=[],e=null,t}}}function eUr(n,e,t,r,i,a){var o=n[0],s=n[1],l=e[0],u=e[1],h=0,c=1,f=l-o,d=u-s,v;if(v=t-o,!(!f&&v>0)){if(v/=f,f<0){if(v0){if(v>c)return;v>h&&(h=v)}if(v=i-o,!(!f&&v<0)){if(v/=f,f<0){if(v>c)return;v>h&&(h=v)}else if(f>0){if(v0)){if(v/=d,d<0){if(v0){if(v>c)return;v>h&&(h=v)}if(v=a-s,!(!d&&v<0)){if(v/=d,d<0){if(v>c)return;v>h&&(h=v)}else if(d>0){if(v0&&(n[0]=o+h*f,n[1]=s+h*d),c<1&&(e[0]=o+c*f,e[1]=s+c*d),!0}}}}}function M8(n,e){return $h(n[0]-e[0])=0;--s)i.point((c=h[s])[0],c[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,h=f.z,d=!d}while(!f.v);i.lineEnd()}}}function zLe(n){if(!!(e=n.length)){for(var e,t=0,r=n[0],i;++te?1:n>=e?0:NaN}function tUr(n){return n.length===1&&(n=rUr(n)),{left:function(e,t,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r>>1;n(e[a],t)<0?r=a+1:i=a}return r},right:function(e,t,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r>>1;n(e[a],t)>0?i=a:r=a+1}return r}}}function rUr(n){return function(e,t){return rQe(n(e),t)}}tUr(rQe);function nQe(n){for(var e=n.length,t,r=-1,i=0,a,o;++r=0;)for(o=n[e],t=o.length;--t>=0;)a[--i]=o[t];return a}var BO=1e9,j6=-BO;function nUr(n,e,t,r){function i(u,h){return n<=u&&u<=t&&e<=h&&h<=r}function a(u,h,c,f){var d=0,v=0;if(u==null||(d=o(u,c))!==(v=o(h,c))||l(u,h)<0^c>0)do f.point(d===0||d===3?n:t,d>1?r:e);while((d=(d+c+4)%4)!==v);else f.point(h[0],h[1])}function o(u,h){return $h(u[0]-n)0?0:3:$h(u[0]-t)0?2:1:$h(u[1]-e)0?1:0:h>0?3:2}function s(u,h){return l(u.x,h.x)}function l(u,h){var c=o(u,1),f=o(h,1);return c!==f?c-f:c===0?h[1]-u[1]:c===1?u[0]-h[0]:c===2?u[1]-h[1]:h[0]-u[0]}return function(u){var h=u,c=eQe(),f,d,v,p,g,m,y,_,x,S,w,b={point:E,lineStart:M,lineEnd:I,polygonStart:C,polygonEnd:A};function E(k,D){i(k,D)&&h.point(k,D)}function T(){for(var k=0,D=0,G=d.length;Dr&&(j-Y)*(r-le)>(Q-le)*(n-Y)&&++k:Q<=r&&(j-Y)*(r-le)<(Q-le)*(n-Y)&&--k;return k}function C(){h=c,f=[],d=[],w=!0}function A(){var k=T(),D=w&&k,G=(f=nQe(f)).length;(D||G)&&(u.polygonStart(),D&&(u.lineStart(),a(null,null,1,u),u.lineEnd()),G&&tQe(f,s,k,a,u),u.polygonEnd()),h=u,f=d=v=null}function M(){b.point=R,d&&d.push(v=[]),S=!0,x=!1,y=_=NaN}function I(){f&&(R(p,g),m&&x&&c.rejoin(),f.push(c.result())),b.point=E,x&&h.lineEnd()}function R(k,D){var G=i(k,D);if(d&&v.push([k,D]),S)p=k,g=D,m=G,S=!1,G&&(h.lineStart(),h.point(k,D));else if(G&&x)h.point(k,D);else{var W=[y=Math.max(j6,Math.min(BO,y)),_=Math.max(j6,Math.min(BO,_))],z=[k=Math.max(j6,Math.min(BO,k)),D=Math.max(j6,Math.min(BO,D))];eUr(W,z,n,e,t,r)?(x||(h.lineStart(),h.point(W[0],W[1])),h.point(z[0],z[1]),G||h.lineEnd(),w=!1):G&&(h.lineStart(),h.point(k,D),w=!1)}y=k,_=D,x=G}return b}}var IZ=Rw();function iUr(n,e){var t=e[0],r=e[1],i=[Il(t),-Ml(t),0],a=0,o=0;IZ.reset();for(var s=0,l=n.length;s=0?1:-1,E=b*w,T=E>Oo,C=v*x;if(IZ.add(mI(C*b*Il(E),p*S+C*Ml(E))),a+=T?w+b*Tm:w,T^f>=t^y>=t){var A=Z7(_I(c),_I(m));Hre(A);var M=Z7(i,A);Hre(M);var I=(T^w>=0?-1:1)*z2(M[2]);(r>I||r===I&&(A[0]||A[1]))&&(o+=T^w>=0?1:-1)}}return(a<-Us||aHN&&(HN=n),eJ7&&(J7=e)}Rw();function iQe(n,e,t,r){return function(i,a){var o=e(a),s=i.invert(r[0],r[1]),l=eQe(),u=e(l),h=!1,c,f,d,v={point:p,lineStart:m,lineEnd:y,polygonStart:function(){v.point=_,v.lineStart=x,v.lineEnd=S,f=[],c=[]},polygonEnd:function(){v.point=p,v.lineStart=m,v.lineEnd=y,f=nQe(f);var w=iUr(c,s);f.length?(h||(a.polygonStart(),h=!0),tQe(f,sUr,w,t,a)):w&&(h||(a.polygonStart(),h=!0),a.lineStart(),t(null,null,1,a),a.lineEnd()),h&&(a.polygonEnd(),h=!1),f=c=null},sphere:function(){a.polygonStart(),a.lineStart(),t(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function p(w,b){var E=i(w,b);n(w=E[0],b=E[1])&&a.point(w,b)}function g(w,b){var E=i(w,b);o.point(E[0],E[1])}function m(){v.point=g,o.lineStart()}function y(){v.point=p,o.lineEnd()}function _(w,b){d.push([w,b]);var E=i(w,b);u.point(E[0],E[1])}function x(){u.lineStart(),d=[]}function S(){_(d[0][0],d[0][1]),u.lineEnd();var w=u.clean(),b=l.result(),E,T=b.length,C,A,M;if(d.pop(),c.push(d),d=null,!!T){if(w&1){if(A=b[0],(C=A.length-1)>0){for(h||(a.polygonStart(),h=!0),a.lineStart(),E=0;E1&&w&2&&b.push(b.pop().concat(b.shift())),f.push(b.filter(oUr))}}return v}}function oUr(n){return n.length>1}function sUr(n,e){return((n=n.x)[0]<0?n[1]-Yy-Us:Yy-n[1])-((e=e.x)[0]<0?e[1]-Yy-Us:Yy-e[1])}const $Le=iQe(function(){return!0},lUr,hUr,[-Oo,-Yy]);function lUr(n){var e=NaN,t=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(a,o){var s=a>0?Oo:-Oo,l=$h(a-e);$h(l-Oo)0?Yy:-Yy),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(s,t),n.point(a,t),i=0):r!==s&&l>=Oo&&($h(e-r)Us?Zzr((Il(e)*(a=Ml(r))*Il(t)-Il(r)*(i=Ml(e))*Il(n))/(i*a*o)):(e+r)/2}function hUr(n,e,t,r){var i;if(n==null)i=t*Yy,r.point(-Oo,i),r.point(0,i),r.point(Oo,i),r.point(Oo,0),r.point(Oo,-i),r.point(0,-i),r.point(-Oo,-i),r.point(-Oo,0),r.point(-Oo,i);else if($h(n[0]-e[0])>Us){var a=n[0]0,i=$h(t)>Us;function a(h,c,f,d){Qzr(d,n,e,f,h,c)}function o(h,c){return Ml(h)*Ml(c)>t}function s(h){var c,f,d,v,p;return{lineStart:function(){v=d=!1,p=1},point:function(g,m){var y=[g,m],_,x=o(g,m),S=r?x?0:u(g,m):x?u(g+(g<0?Oo:-Oo),m):0;if(!c&&(v=d=x)&&h.lineStart(),x!==d&&(_=l(c,y),(!_||M8(c,_)||M8(y,_))&&(y[0]+=Us,y[1]+=Us,x=o(y[0],y[1]))),x!==d)p=0,x?(h.lineStart(),_=l(y,c),h.point(_[0],_[1])):(_=l(c,y),h.point(_[0],_[1]),h.lineEnd()),c=_;else if(i&&c&&r^x){var w;!(S&f)&&(w=l(y,c,!0))&&(p=0,r?(h.lineStart(),h.point(w[0][0],w[0][1]),h.point(w[1][0],w[1][1]),h.lineEnd()):(h.point(w[1][0],w[1][1]),h.lineEnd(),h.lineStart(),h.point(w[0][0],w[0][1])))}x&&(!c||!M8(c,y))&&h.point(y[0],y[1]),c=y,d=x,f=S},lineEnd:function(){d&&h.lineEnd(),c=null},clean:function(){return p|(v&&d)<<1}}}function l(h,c,f){var d=_I(h),v=_I(c),p=[1,0,0],g=Z7(d,v),m=$6(g,g),y=g[0],_=m-y*y;if(!_)return!f&&h;var x=t*m/_,S=-t*y/_,w=Z7(p,g),b=W6(p,x),E=W6(g,S);MZ(b,E);var T=w,C=$6(b,T),A=$6(T,T),M=C*C-A*($6(b,b)-1);if(!(M<0)){var I=xL(M),R=W6(T,(-C-I)/A);if(MZ(R,b),R=Wre(R),!f)return R;var k=h[0],D=c[0],G=h[1],W=c[1],z;D0^R[1]<($h(R[0]-k)Oo^(k<=R[0]&&R[0]<=D)){var le=W6(T,(-C+I)/A);return MZ(le,b),[R,Wre(le)]}}}function u(h,c){var f=r?n:Oo-n,d=0;return h<-f?d|=1:h>f&&(d|=2),c<-f?d|=4:c>f&&(d|=8),d}return iQe(o,s,a,r?[0,-n]:[-Oo,n-Oo])}function aQe(n){return function(e){var t=new Xre;for(var r in n)t[r]=n[r];return t.stream=e,t}}function Xre(){}Xre.prototype={constructor:Xre,point:function(n,e){this.stream.point(n,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function oQe(n,e,t){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),a!=null&&n.clipExtent(null),Kzr(t,n.stream(VLe));var o=VLe.result(),s=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+e[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+e[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a!=null&&n.clipExtent(a),n.scale(s*150).translate([l,u])}function fUr(n,e,t){return oQe(n,[[0,0],e],t)}var WLe=16,dUr=Ml(30*vp);function HLe(n,e){return+e?pUr(n,e):vUr(n)}function vUr(n){return aQe({point:function(e,t){e=n(e,t),this.stream.point(e[0],e[1])}})}function pUr(n,e){function t(r,i,a,o,s,l,u,h,c,f,d,v,p,g){var m=u-r,y=h-i,_=m*m+y*y;if(_>4*e&&p--){var x=o+f,S=s+d,w=l+v,b=xL(x*x+S*S+w*w),E=z2(w/=b),T=$h($h(w)-1)e||$h((m*I+y*R)/_-.5)>.3||o*f+s*d+l*v2?R[2]%360*vp:0,M()):[u*Ex,h*Ex,c*Ex]},T.precision=function(R){return arguments.length?(w=HLe(A,S=R*R),I()):xL(S)},T.fitExtent=function(R,k){return oQe(T,R,k)},T.fitSize=function(R,k){return fUr(T,R,k)};function M(){d=QJe(f=Jzr(u,h,c),e);var R=e(s,l);return a=r-R[0]*t,o=i+R[1]*t,I()}function I(){return b=E=null,T}return function(){return e=n.apply(this,arguments),T.invert=e.invert&&C,M()}}function sQe(n){return function(e,t){var r=Ml(e),i=Ml(t),a=n(r*i);return[a*i*Il(e),a*Il(t)]}}function lQe(n){return function(e,t){var r=xL(e*e+t*t),i=n(r),a=Il(i),o=Ml(i);return[mI(e*a,r*o),z2(r&&t*a/r)]}}var _Ur=sQe(function(n){return xL(2/(1+n))});_Ur.invert=lQe(function(n){return 2*z2(n/2)});var uQe=sQe(function(n){return(n=JJe(n))&&n/Il(n)});uQe.invert=lQe(function(n){return n});function xUr(){return yUr(uQe).scale(79.4188).clipAngle(180-.001)}function jLe(n,e){return[n,e]}jLe.invert=jLe;function SUr(n,e,t){t=t||{};var r=t.units||"kilometers",i=t.steps||8;if(!n)throw new Error("geojson is required");if(typeof t!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(e===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var a=[];switch(n.type){case"GeometryCollection":return Pd(n,function(o){var s=I8(o,e,r,i);s&&a.push(s)}),Zn(a);case"FeatureCollection":return uo(n,function(o){var s=I8(o,e,r,i);s&&uo(s,function(l){l&&a.push(l)})}),Zn(a)}return I8(n,e,r,i)}function I8(n,e,t,r){var i=n.properties||{},a=n.type==="Feature"?n.geometry:n;if(a.type==="GeometryCollection"){var o=[];return Pd(n,function(p){var g=I8(p,e,t,r);g&&o.push(g)}),Zn(o)}var s=wUr(a),l={type:a.type,coordinates:cQe(a.coordinates,s)},u=new Ace,h=u.read(l),c=ZM(S2(e,t),"meters"),f=Ou.bufferOp(h,c,r),d=new DJe;if(f=d.write(f),!hQe(f.coordinates)){var v={type:f.type,coordinates:fQe(f.coordinates,s)};return fu(v,i)}}function hQe(n){return Array.isArray(n[0])?hQe(n[0]):isNaN(n[0])}function cQe(n,e){return typeof n[0]!="object"?e(n):n.map(function(t){return cQe(t,e)})}function fQe(n,e){return typeof n[0]!="object"?e.invert(n):n.map(function(t){return fQe(t,e)})}function wUr(n){var e=m$(n).geometry.coordinates,t=[-e[0],-e[1]];return xUr().rotate(t).scale(Au)}function bUr(n,e,t){t===void 0&&(t={});var r=ls(n),i=ls(e),a=t_.union(r.coordinates,i.coordinates);return a.length===0?null:a.length===1?Qi(a[0],t.properties):Ld(a,t.properties)}function jN(n,e,t){t===void 0&&(t={});var r=ls(n),i=ls(e),a=t_.intersection(r.coordinates,i.coordinates);return a.length===0?null:a.length===1?Qi(a[0],t.properties):Ld(a,t.properties)}function EUr(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.propertyName;Y_(n,"Polygon","dissolve");var r=[];if(e.propertyName){var i={};uo(n,function(l){Object.prototype.hasOwnProperty.call(i,l.properties[t])||(i[l.properties[t]]=[]),i[l.properties[t]].push(l)});for(var a=Object.keys(i),o=0;og/2;C&&(T-=g/4);for(var A=[],M=[],I=0;I<6;I++){var R=2*Math.PI/6*I;A.push(Math.cos(R)),M.push(Math.sin(R))}for(var k=[],D=0;D<=w;D++)for(var G=0;G<=E;G++){var W=D%2===1;if(!(G===0&&W)&&!(G===0&&C)){var z=D*_+i-b,V=G*x+a+T;if(W&&(V-=g/2),t.triangles===!0)CUr([z,V],c/2,d/2,JSON.parse(r),A,M).forEach(function(Y){t.mask?jN(t.mask,Y)&&k.push(Y):k.push(Y)});else{var q=TUr([z,V],c/2,d/2,JSON.parse(r),A,M);t.mask?jN(t.mask,q)&&k.push(q):k.push(q)}}}return Zn(k)}function TUr(n,e,t,r,i,a){for(var o=[],s=0;s<6;s++){var l=n[0]+e*i[s],u=n[1]+t*a[s];o.push([l,u])}return o.push(o[0].slice()),Qi([o],r)}function CUr(n,e,t,r,i,a){for(var o=[],s=0;s<6;s++){var l=[];l.push(n),l.push([n[0]+e*i[s],n[1]+t*a[s]]),l.push([n[0]+e*i[(s+1)%6],n[1]+t*a[(s+1)%6]]),l.push(n),o.push(Qi([l],r))}return o}function AUr(n,e){var t=IUr(e),r=null;return n.type==="FeatureCollection"?r=MUr(n):r=vQe(t_.union(n.geometry.coordinates)),r.geometry.coordinates.forEach(function(i){t.geometry.coordinates.push(i[0])}),t}function MUr(n){var e=n.features.length===2?t_.union(n.features[0].geometry.coordinates,n.features[1].geometry.coordinates):t_.union.apply(t_,n.features.map(function(t){return t.geometry.coordinates}));return vQe(e)}function vQe(n){return Ld(n)}function IUr(n){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],t=n&&n.geometry.coordinates||e;return Qi(t)}function LUr(n,e,t,r){r===void 0&&(r={});for(var i=[],a=n[0],o=n[1],s=n[2],l=n[3],u=e/Mo([a,o],[s,o],r),h=u*(s-a),c=t/Mo([a,o],[a,l],r),f=c*(l-o),d=s-a,v=l-o,p=Math.floor(d/h),g=Math.floor(v/f),m=(d-p*h)/2,y=(v-g*f)/2,_=a+m,x=0;x\xA9 turfjs with \xA9 SuperMap iClient",features:t.features,format:t.format,extent:t.extent,logo:br.getOlVersion()==="4"?t.logo:null,projection:t.projection,wrapX:t.wrapX}),this.turfMap={"Measurement.along":["line","distance","units"],"Measurement.area":["geojson"],"Measurement.bbox":["geojson"],"Measurement.bboxPolygon":["bbox"],"Measurement.bearing":["start","end","final"],"Measurement.center":["geojson","properties"],"Measurement.centerOfMass":["geojson","properties"],"Measurement.centroid":["geojson","properties"],"Measurement.destination":["origin","distance","bearing","units"],"Measurement.distance":["from","to","units"],"Measurement.envelope":["geojson"],"Measurement.length":["geojson","units"],"Measurement.midpoint":["point1","point2"],"Measurement.pointOnFeature":["geojson"],"Measurement.polygonTangents":["point","polygon"],"Measurement.rhumbBearing":["start","end","final"],"Measurement.rhumbDestination":["origin","distance","bearing","units"],"Measurement.rhumbDistance":["from","to","units"],"Measurement.square":["bbox"],"Measurement.greatCircle":["start","end","properties","npoints","offset"],"CoordinateMutation.cleanCoords":["geojson","mutate"],"CoordinateMutation.flip":["geojson","mutate"],"CoordinateMutation.rewind":["geojson","reverse","mutate"],"CoordinateMutation.round":["num","precision"],"CoordinateMutation.truncate":["geojson","precision","coordinates","mutate"],"Transformation.bboxClip":["feature","bbox"],"Transformation.bezierSpline":["line","resolution","sharpness"],"Transformation.buffer":["geojson","radius","units","steps"],"Transformation.circle":["center","radius","steps","units","properties"],"Transformation.clone":["geojson"],"Transformation.concave":["points","maxEdge","units"],"Transformation.convex":["geojson","concavity"],"Transformation.difference":["polygon1","polygon2"],"Transformation.dissolve":["featureCollection","propertyName"],"Transformation.intersect":["poly1","poly2"],"Transformation.lineOffset":["geojson","distance","units"],"Transformation.simplify":["feature","tolerance","highQuality"],"Transformation.tesselate":["poly"],"Transformation.transformRotate":["geojson","angle","pivot","mutate"],"Transformation.transformTranslate":["geojson","distance","direction","units","zTranslation","mutate"],"Transformation.transformScale":["geojson","factor","origin","mutate"],"Transformation.union":["A"],"Transformation.voronoi":["points","bbox"],"featureConversion.combine":["fc"],"featureConversion.explode":["geojson"],"featureConversion.flatten":["geojson"],"featureConversion.lineStringToPolygon":["lines","properties","autoComplete","orderCoords"],"featureConversion.polygonize":["geojson"],"featureConversion.polygonToLineString":["polygon","properties"],"Misc.kinks":["featureIn"],"Misc.lineArc":["center","radius","bearing1","bearing2","steps","units"],"Misc.lineChunk":["geojson","segmentLength","units","reverse"],"Misc.lineIntersect":["line1","line2"],"Misc.lineOverlap":["line1","line2"],"Misc.lineSegment":["geojson"],"Misc.lineSlice":["startPt","stopPt","line"],"Misc.lineSliceAlong":["line","startDist","stopDist","units"],"Misc.lineSplit":["line","splitter"],"Misc.mask":["polygon","mask"],"Misc.pointOnLine":["lines","pt","units"],"Misc.sector":["center","radius","bearing1","bearing2","steps","units"],"Misc.shortestPath":["start","end","obstacles","units","resolution"],"Misc.unkinkPolygon":["geojson"],"Helper.featureCollection":["features","bbox","id"],"Helper.feature":["geometry","properties","bbox","id"],"Helper.geometryCollection":["geometries","properties","bbox","id"],"Helper.lineString":["coordinates","properties","bbox","id"],"Helper.multiLineString":["coordinates","properties","bbox","id"],"Helper.multiPoint":["coordinates","properties","bbox","id"],"Helper.multiPolygon":["coordinates","properties","bbox","id"],"Helper.point":["coordinates","properties","bbox","id"],"Helper.polygon":["coordinates","properties","bbox","id"],"Data.sample":["featurecollection","num"],"Interpolation.interpolate":["points","cellSize","gridType","property","units","weight"],"Interpolation.isobands":["pointGrid","breaks","zProperty","commonProperties","breaksProperties"],"Interpolation.isolines":["pointGrid","breaks","zProperty","commonProperties","breaksProperties"],"Interpolation.planepoint":["point","triangle"],"Interpolation.tin":["points","z"],"Joins.pointsWithinPolygon":["points","polygons"],"Joins.tag":["points","polygons","field","outField","mask","properties"],"Grids.hexGrid":["bbox","cellSide","units","triangles"],"Grids.pointGrid":["bbox","cellSide","units","mask","properties"],"Grids.squareGrid":["bbox","cellSide","units","mask","properties"],"Grids.triangleGrid":["bbox","cellSide","units","mask","properties"],"Classification.nearestPoint":["targetPoint","points"],"Aggregation.collect":["polygons","points","inProperty","outProperty"],"Aggregation.clustersDbscan":["points","maxDistance","units","minPoints","mutate"],"Aggregation.clustersKmeans":["points","numberOfClusters","mutate"],"Meta.coordAll":["geojson"],"Meta.coordEach":["geojson","callback","excludeWrapCoord"],"Meta.coordReduce":["geojson","callback","initialValue","excludeWrapCoord"],"Meta.featureEach":["geojson","callback"],"Meta.featureReduce":["geojson","callback","initialValue"],"Meta.flattenEach":["geojson","callback"],"Meta.flattenReduce":["geojson","callback","initialValue"],"Meta.getCoord":["coord"],"Meta.getCoords":["coords"],"Meta.getGeom":["geojson"],"Meta.getGeomType":["geojson","name"],"Meta.geomEach":["geojson","callback"],"Meta.geomReduce":["geojson","callback","initialValue"],"Meta.propEach":["geojson","callback"],"Meta.propReduce":["geojson","callback","initialValue"],"Meta.segmentEach":["geojson","callback"],"Meta.segmentReduce":["geojson","callback","initialValue"],"Meta.getCluster":["geojson","filter"],"Meta.clusterEach":["geojson","property","callback"],"Meta.clusterReduce":["geojson","property","callback","initialValue"],"Assertions.collectionOf":["featureCollection","type","name"],"Assertions.containsNumber":["coordinates"],"Assertions.geojsonType":["value","type","name"],"Assertions.featureOf":["feature","type","name"],"Booleans.booleanClockwise":["line"],"Booleans.booleanContains":["feature1","feature2"],"Booleans.booleanCrosses":["feature1","feature2"],"Booleans.booleanDisjoint":["feature1","feature2"],"Booleans.booleanEqual":["feature1","feature2"],"Booleans.booleanOverlap":["feature1","feature2"],"Booleans.booleanParallel":["feature1","feature2"],"Booleans.booleanPointInPolygon":["point","polygon","ignoreBoundary"],"Booleans.booleanPointOnLine":["point","linestring","ignoreEndVertices"],"UnitConversion.bearingToAngle":["bearing"],"UnitConversion.convertArea":["area","originalUnit","finalUnit"],"UnitConversion.convertLength":["length","originalUnit","finalUnit"],"UnitConversion.degreesToradians":["degrees"],"UnitConversion.lengthToRadians":["distance","units"],"UnitConversion.lengthToDegrees":["distance","units"],"UnitConversion.radiansToLength":["radians","units"],"UnitConversion.radiansToDegrees":["radians"],"UnitConversion.toMercator":["geojson","mutate"],"UnitConversion.toWgs84":["geojson","mutate"]},this.turfOptionMap={"Measurement.along":["line","distance",{units:""}],"Measurement.bboxPolygon":["bbox",{properties:"",id:""}],"Measurement.bearing":["start","end",{final:""}],"Measurement.center":["geojson",{properties:""}],"Measurement.destination":["origin","distance","bearing",{units:"",properties:""}],"Measurement.distance":["from","to",{units:""}],"Measurement.length":["geojson",{units:""}],"Measurement.rhumbBearing":["start","end",{final:""}],"Measurement.rhumbDestination":["origin","distance","bearing",{units:"",properties:""}],"Measurement.rhumbDistance":["from","to",{units:""}],"Measurement.greatCircle":["start","end",{properties:"",npoints:"",offset:""}],"CoordinateMutation.cleanCoords":["geojson",{mutate:""}],"CoordinateMutation.flip":["geojson",{mutate:""}],"CoordinateMutation.rewind":["geojson",{mutate:"",reverse:""}],"CoordinateMutation.truncate":["geojson",{precision:"",coordinates:"",mutate:""}],"Transformation.bezierSpline":["line",{resolution:"",sharpness:""}],"Transformation.buffer":["geojson","radius",{units:"",steps:""}],"Transformation.circle":["center","radius",{units:"",steps:"",properties:""}],"Transformation.concave":["points",{maxEdge:"",units:""}],"Transformation.convex":["geojson",{concavity:""}],"Transformation.dissolve":["featureCollection",{propertyName:""}],"Transformation.lineOffset":["geojson","distance",{units:""}],"Transformation.simplify":["geojson",{tolerance:"",highQuality:""}],"Transformation.transformRotate":["geojson","angle",{pivot:"",mutate:""}],"Transformation.transformTranslate":["geojson","distance","direction",{units:"",zTranslation:"",mutate:""}],"Transformation.transformScale":["geojson","factor",{origin:"",mutate:""}],"Transformation.voronoi":["points",{bbox:""}],"featureConversion.lineStringToPolygon":["lines",{properties:"",autoComplete:"",orderCoords:""}],"featureConversion.polygonToLineString":["polygon",{properties:""}],"Misc.lineArc":["center","radius","bearing1","bearing2",{steps:"",units:""}],"Misc.lineChunk":["geojson","segmentLength",{units:"",reverse:""}],"Misc.lineOverlap":["line1","line2",{tolerance:""}],"Misc.lineSliceAlong":["line","startDist","stopDist",{units:""}],"Misc.pointOnLine":["lines","pt",{units:""}],"Misc.sector":["center","radius","bearing1","bearing2",{units:"",steps:"",properties:""}],"Misc.shortestPath":["start","end",{obstacles:"",units:"",resolution:""}],"Helper.feature":["geometry","properties",{bbox:"",id:""}],"Helper.geometryCollection":["geometries","properties",{bbox:"",id:""}],"Helper.lineString":["coordinates","properties",{bbox:"",id:""}],"Helper.multiLineString":["coordinates","properties",{bbox:"",id:""}],"Helper.multiPoint":["coordinates","properties",{bbox:"",id:""}],"Helper.multiPolygon":["coordinates","properties",{bbox:"",id:""}],"Helper.point":["coordinates","properties",{bbox:"",id:""}],"Helper.polygon":["coordinates","properties",{bbox:"",id:""}],"Interpolation.interpolate":["points","cellSize",{gridType:"",property:"",units:"",weight:""}],"Interpolation.isobands":["pointGrid","breaks",{zProperty:"",commonProperties:"",breaksProperties:""}],"Interpolation.isolines":["pointGrid","breaks",{zProperty:"",commonProperties:"",breaksProperties:""}],"Grids.hexGrid":["bbox","cellSide",{units:"",triangles:"",properties:"",mask:""}],"Grids.pointGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Grids.squareGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Grids.triangleGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Aggregation.clustersDbscan":["points","maxDistance",{units:"",minPoints:"",mutate:""}],"Aggregation.clustersKmeans":["points",{numberOfClusters:"",mutate:""}],"Booleans.booleanPointInPolygon":["point","polygon",{ignoreBoundary:""}],"Booleans.booleanPointOnLine":["point","linestring",{ignoreEndVertices:""}],"UnitConversion.toMercator":["geojson",{mutate:""}],"UnitConversion.toWgs84":["geojson",{mutate:""}]}}process(e,t,r,i){var a;try{a=XLe[e.split(".")[1]].apply(this,this.parse(e,t))}catch{a=XLe[e.split(".")[1]].apply(this,this.parseOption(e,t))}var o=null;try{o=new jc().readFeatures(a)}catch{r&&r(a);return}i=i==null?!0:i,i&&this.addFeatures(o),r&&r(a)}parse(e,t){if(e==="Transformation.union")return t.A;var r=[],i=this.turfMap[e];return i&&i.map(function(a){return r.push(t[a]),t[a]}),r}parseOption(e,t){var r=[],i=this.turfOptionMap[e];return i.map(function(a){if(a instanceof Object){var o=a;Object.keys(o).forEach(function(s){o[s]=t[s]}),r.push(o)}else r.push(t[a]);return t}),r}}class RUr extends AS{constructor(e,t){super(e,t),this.themeField=t.themeField,this.style=t.style,this.styleGroups=t.styleGroups,this.isHoverAble=t.isHoverAble,this.highlightStyle=t.highlightStyle}destroy(){this.style=null,this.themeField=null,this.styleGroups=null,AS.prototype.destroy.apply(this,arguments)}createThematicFeature(e){var t=this.getStyleByData(e),r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Vn.transformStyle(this.highlightStyle);for(var i=new f3(e,this,Vn.transformStyle(t),r),a=0;a0&&r.attributes){var i=this.themeField,a=r.attributes,o=this.styleGroups,s=!1,l=null;for(var u in a)if(i===u){s=!0,l=a[u];break}if(s){for(var h=0,c=o.length;h-1;k--)if(A.indexOf(R[k])>-1){I=A.replace(R[k],E[R[k]]);break}I=I.replace(/[#]/gi,"#"),E[A]=M,b=b.replace(new RegExp(I,"g"),M)}),b=b.replace(/[#]/gi,` #`),b=b.replace(/\[zoom/gi,"[scale")}var T=new Pt(b).getShaders(),C={};T.forEach(function(A){return C[A.elements[0].clean]=C[A.elements[0].clean]||{},C[A.elements[0].clean][A.attachment]=C[A.elements[0].clean][A.attachment]||[],C[A.elements[0].clean][A.attachment].push(A),A}),Ka.setCartoShaders(C)}},_.send(null)}if(Ka.getCartoCss()){var x=new Pt(Ka.getCartoCss()).getShaders(),S={};x.forEach(function(w){return S[w.elements[0].clean]=S[w.elements[0].clean]||{},S[w.elements[0].clean][w.attachment]=S[w.elements[0].clean][w.attachment]||[],S[w.elements[0].clean][w.attachment].push(w),w}),Ka.setClientCartoShaders(S)}}},s.open("GET",H.urlPathAppend(Ka.getUrl(),"layers.json"),!1),s.send(null),this.on("featureSelected",function(f){Ka.setSelectedId(f.selectedId),Ka.setLayerName(f.layerName)});function l(){return new So({image:new rm({radius:5,fill:new Ko({color:"blue"})})})}function u(){return new So({stroke:new es({color:"blue",width:3})})}function h(){return new So({fill:new Ko({color:[0,0,255,.5]}),stroke:new es({color:"blue",width:3})})}function c(){return new So({text:new J1({font:"15px Microsoft YaHei",fill:new Ko({color:"blue"}),stroke:new es({color:"white",width:1})})})}}static setCartoShaders(e){this.cartoShaders=e}static getCartoShaders(){return this.cartoShaders}static setClientCartoShaders(e){this.clientCartoShaders=e}static getClientCartoShaders(){return this.clientCartoShaders}static setCartoCss(e){this.cartoCss=e}static getCartoCss(){return this.cartoCss}static setDonotNeedServerCartoCss(e){this.donotNeedServerCartoCss=e}static getDonotNeedServerCartoCss(){return this.donotNeedServerCartoCss}static setLayersInfo(e){this.layersInfo=e}static getLayersInfo(){return this.layersInfo}static setUrl(e){this.url=e}static getUrl(){return this.url}static setView(e){this.view=e}static getView(){return this.view}static setSelectedId(e){this.selectedId=e}static getSelectedId(){return this.selectedId}static setLayerName(e){this.layerName=e}static getLayerName(){return this.layerName}static setSelectedPointStyle(e){this.selectedPointStyle=e}static setSelectedLineStyle(e){this.selectedLineStyle=e}static setSelectedRegionStyle(e){this.selectedRegionStyle=e}static setSelectedTextStyle(e){this.selectedTextStyle=e}static getSelectedStyle(e){if(e==="POINT"||e==="MULTIPOINT")return this.selectedPointStyle;if(e==="LINESTRING"||e==="MULTILINESTRING")return this.selectedLineStyle;if(e==="POLYGON"||e==="MULTIPOLYGON")return this.selectedRegionStyle;if(e==="TEXT")return this.selectedTextStyle}static getLayerInfo(e){var t=Ka.getLayersInfo();if(t===void 0)return null;var r=t[e];if(!r)return null;var i={layerIndex:r.layerIndex,ugcLayerType:r.ugcLayerType};switch(r.ugcLayerType){case"VECTOR":i.layerStyle=r.style?r.style:null;break;case"THEME":var a=r.theme;i.layerStyle=a?a.defaultStyle:null,a&&a.type==="LABEL"&&(i.type=a.type,i.textField=a.labelExpression);break;default:r.style&&(i.layerStyle=r.style);break}return i}static getStyle(e,t){var r=Ka.getUrl(),i=Ka.getView(),a=i.getZoom(),o=96,s=br.resolutionToScale(i.getResolution(),o,Wl.METER),l=e.replace(/(@)/gi,"___").replace(/(#)/gi,"___");if(Ka.getCartoCss()&&Ka.getClientCartoShaders()[l])return c(Ka.getClientCartoShaders()[l]);var u=Ka.getLayerInfo(e);if(!Ka.getDonotNeedServerCartoCss()&&Ka.getCartoShaders()[l]){if(t.getProperties().textStyle||t.getProperties().TEXT_FEATURE_CONTENT||u.type=="LABEL"&&u.textField){var h=ts.getValidStyleFromLayerInfo(u,t,r);return t.getGeometry().getType().toUpperCase()==="POINT"&&(h=f(u,t,r)),h}return c(Ka.getCartoShaders()[l])}if(u)return ts.getValidStyleFromLayerInfo(u,t,r);function c(d){var v=[];for(var p in d)d[p].map(function(g){return v.push(ts.getStyleFromCarto(a,s,g,t,!0,r)),g});return v}function f(d,v,p){var g=ts.getValidStyleFromLayerInfo(d,v,p);if(d.type=="LABEL"){v.setProperties({type:"TEXT"});for(var m=c(Ka.getCartoShaders()[l]),y=g.getText(),_=0;_ */kce.read=function(n,e,t,r,i){var a,o,s=i*8-r-1,l=(1<>1,h=-7,c=t?i-1:0,f=t?-1:1,d=n[e+c];for(c+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=a*256+n[e+c],c+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=r;h>0;o=o*256+n[e+c],c+=f,h-=8);if(a===0)a=1-u;else{if(a===l)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,r),a=a-u}return(d?-1:1)*o*Math.pow(2,a-r)};kce.write=function(n,e,t,r,i,a){var o,s,l,u=a*8-i-1,h=(1<>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,v=r?1:-1,p=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+c>=1?e+=f/l:e+=f*Math.pow(2,1-c),e*l>=2&&(o++,l/=2),o+c>=h?(s=0,o=h):o+c>=1?(s=(e*l-1)*Math.pow(2,i),o=o+c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;n[t+d]=s&255,d+=v,s/=256,i-=8);for(o=o<0;n[t+d]=o&255,d+=v,o/=256,u-=8);n[t+d-v]|=p*128};var WUr=Go,X6=kce;function Go(n){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(n)?n:new Uint8Array(n||0),this.pos=0,this.type=0,this.length=this.buf.length}Go.Varint=0;Go.Fixed64=1;Go.Bytes=2;Go.Fixed32=5;var Yre=(1<<16)*(1<<16),qLe=1/Yre,HUr=12,yQe=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Go.prototype={destroy:function(){this.buf=null},readFields:function(n,e,t){for(t=t||this.length;this.pos>3,a=this.pos;this.type=r&7,n(i,e,this),this.pos===a&&this.skip(r)}return e},readMessage:function(n,e){return this.readFields(n,e,this.readVarint()+this.pos)},readFixed32:function(){var n=Y6(this.buf,this.pos);return this.pos+=4,n},readSFixed32:function(){var n=KLe(this.buf,this.pos);return this.pos+=4,n},readFixed64:function(){var n=Y6(this.buf,this.pos)+Y6(this.buf,this.pos+4)*Yre;return this.pos+=8,n},readSFixed64:function(){var n=Y6(this.buf,this.pos)+KLe(this.buf,this.pos+4)*Yre;return this.pos+=8,n},readFloat:function(){var n=X6.read(this.buf,this.pos,!0,23,4);return this.pos+=4,n},readDouble:function(){var n=X6.read(this.buf,this.pos,!0,52,8);return this.pos+=8,n},readVarint:function(n){var e=this.buf,t,r;return r=e[this.pos++],t=r&127,r<128||(r=e[this.pos++],t|=(r&127)<<7,r<128)||(r=e[this.pos++],t|=(r&127)<<14,r<128)||(r=e[this.pos++],t|=(r&127)<<21,r<128)?t:(r=e[this.pos],t|=(r&15)<<28,jUr(t,n,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var n=this.readVarint();return n%2===1?(n+1)/-2:n/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=HUr&&yQe?oVr(this.buf,e,n):aVr(this.buf,e,n)},readBytes:function(){var n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e},readPackedVarint:function(n,e){if(this.type!==Go.Bytes)return n.push(this.readVarint(e));var t=h1(this);for(n=n||[];this.pos127;);else if(e===Go.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Go.Fixed32)this.pos+=4;else if(e===Go.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(n,e){this.writeVarint(n<<3|e)},realloc:function(n){for(var e=this.length||16;e268435455||n<0){XUr(n,this);return}this.realloc(4),this.buf[this.pos++]=n&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=n>>>7&127)))},writeSVarint:function(n){this.writeVarint(n<0?-n*2-1:n*2)},writeBoolean:function(n){this.writeVarint(Boolean(n))},writeString:function(n){n=String(n),this.realloc(n.length*4),this.pos++;var e=this.pos;this.pos=sVr(this.buf,n,this.pos);var t=this.pos-e;t>=128&&ZLe(e,t,this),this.pos=e-1,this.writeVarint(t),this.pos+=t},writeFloat:function(n){this.realloc(4),X6.write(this.buf,n,this.pos,!0,23,4),this.pos+=4},writeDouble:function(n){this.realloc(8),X6.write(this.buf,n,this.pos,!0,52,8),this.pos+=8},writeBytes:function(n){var e=n.length;this.writeVarint(e),this.realloc(e);for(var t=0;t=128&&ZLe(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeMessage:function(n,e,t){this.writeTag(n,Go.Bytes),this.writeRawMessage(e,t)},writePackedVarint:function(n,e){e.length&&this.writeMessage(n,ZUr,e)},writePackedSVarint:function(n,e){e.length&&this.writeMessage(n,KUr,e)},writePackedBoolean:function(n,e){e.length&&this.writeMessage(n,eVr,e)},writePackedFloat:function(n,e){e.length&&this.writeMessage(n,JUr,e)},writePackedDouble:function(n,e){e.length&&this.writeMessage(n,QUr,e)},writePackedFixed32:function(n,e){e.length&&this.writeMessage(n,tVr,e)},writePackedSFixed32:function(n,e){e.length&&this.writeMessage(n,rVr,e)},writePackedFixed64:function(n,e){e.length&&this.writeMessage(n,nVr,e)},writePackedSFixed64:function(n,e){e.length&&this.writeMessage(n,iVr,e)},writeBytesField:function(n,e){this.writeTag(n,Go.Bytes),this.writeBytes(e)},writeFixed32Field:function(n,e){this.writeTag(n,Go.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(n,e){this.writeTag(n,Go.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(n,e){this.writeTag(n,Go.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(n,e){this.writeTag(n,Go.Fixed64),this.writeSFixed64(e)},writeVarintField:function(n,e){this.writeTag(n,Go.Varint),this.writeVarint(e)},writeSVarintField:function(n,e){this.writeTag(n,Go.Varint),this.writeSVarint(e)},writeStringField:function(n,e){this.writeTag(n,Go.Bytes),this.writeString(e)},writeFloatField:function(n,e){this.writeTag(n,Go.Fixed32),this.writeFloat(e)},writeDoubleField:function(n,e){this.writeTag(n,Go.Fixed64),this.writeDouble(e)},writeBooleanField:function(n,e){this.writeVarintField(n,Boolean(e))}};function jUr(n,e,t){var r=t.buf,i,a;if(a=r[t.pos++],i=(a&112)>>4,a<128||(a=r[t.pos++],i|=(a&127)<<3,a<128)||(a=r[t.pos++],i|=(a&127)<<10,a<128)||(a=r[t.pos++],i|=(a&127)<<17,a<128)||(a=r[t.pos++],i|=(a&127)<<24,a<128)||(a=r[t.pos++],i|=(a&1)<<31,a<128))return RC(n,i,e);throw new Error("Expected varint not more than 10 bytes")}function h1(n){return n.type===Go.Bytes?n.readVarint()+n.pos:n.pos+1}function RC(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function XUr(n,e){var t,r;if(n>=0?(t=n%4294967296|0,r=n/4294967296|0):(t=~(-n%4294967296),r=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,r=r+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),YUr(t,r,e),qUr(r,e)}function YUr(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127}function qUr(n,e){var t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127)))))}function ZLe(n,e,t){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(r);for(var i=t.pos-1;i>=n;i--)t.buf[i+r]=t.buf[i]}function ZUr(n,e){for(var t=0;t>>8,n[t+2]=e>>>16,n[t+3]=e>>>24}function KLe(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16)+(n[e+3]<<24)}function aVr(n,e,t){for(var r="",i=e;i239?4:a>223?3:a>191?2:1;if(i+s>t)break;var l,u,h;s===1?a<128&&(o=a):s===2?(l=n[i+1],(l&192)===128&&(o=(a&31)<<6|l&63,o<=127&&(o=null))):s===3?(l=n[i+1],u=n[i+2],(l&192)===128&&(u&192)===128&&(o=(a&15)<<12|(l&63)<<6|u&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(l=n[i+1],u=n[i+2],h=n[i+3],(l&192)===128&&(u&192)===128&&(h&192)===128&&(o=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,r+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),r+=String.fromCharCode(o),i+=s}return r}function oVr(n,e,t){return yQe.decode(n.subarray(e,t))}function sVr(n,e,t){for(var r=0,i,a;r55295&&i<57344)if(a)if(i<56320){n[t++]=239,n[t++]=191,n[t++]=189,a=i;continue}else i=a-55296<<10|i-56320|65536,a=null;else{i>56319||r+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):a=i;continue}else a&&(n[t++]=239,n[t++]=191,n[t++]=189,a=null);i<128?n[t++]=i:(i<2048?n[t++]=i>>6|192:(i<65536?n[t++]=i>>12|224:(n[t++]=i>>18|240,n[t++]=i>>12&63|128),n[t++]=i>>6&63|128),n[t++]=i&63|128)}return t}var JLe=Nu(),XN=function(){function n(e,t,r,i,a){this.styleFunction,this.extent_,this.id_=a,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=i}return n.prototype.get=function(e){return this.properties_[e]},n.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Kr.POINT?zje(this.flatCoordinates_):lue(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},n.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var e=kf(this.getExtent());this.flatInteriorPoints_=mhe(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_},n.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var e=Aqe(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=dqe(this.flatCoordinates_,0,this.ends_,2,e)}return this.flatInteriorPoints_},n.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=S7(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},n.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var e=this.flatCoordinates_,t=0,r=this.ends_,i=0,a=r.length;i>3}l--,s===1||s===2?(u+=t.readSVarint(),h+=t.readSVarint(),s===1&&c>f&&(a.push(c),f=c),i.push(u,h),c+=2):s===7?c>f&&(i.push(i[f],i[f+1]),c+=2):ki(!1,59)}c>f&&(a.push(c),f=c)},e.prototype.createFeature_=function(t,r,i){var a=r.type;if(a===0)return null;var o,s=r.properties,l;this.idProperty_?(l=s[this.idProperty_],delete s[this.idProperty_]):l=r.id,s[this.layerName_]=r.layer.name;var u=[],h=[];this.readRawGeometry_(t,r,u,h);var c=vVr(a,h.length);if(this.featureClass_===qre)o=new this.featureClass_(c,u,h,s,l),o.transform(i.dataProjection);else{var f=void 0;if(c==Kr.POLYGON){var d=wPr(u,h);f=d.length>1?new Mqe(u,Ro.XY,d):new m2(u,Ro.XY,h)}else f=c===Kr.POINT?new Qs(u,Ro.XY):c===Kr.LINE_STRING?new gm(u,Ro.XY):c===Kr.POLYGON?new m2(u,Ro.XY,h):c===Kr.MULTI_POINT?new whe(u,Ro.XY):c===Kr.MULTI_LINE_STRING?new Cqe(u,Ro.XY,h):null;var v=this.featureClass_;o=new v,this.geometryName_&&o.setGeometryName(this.geometryName_);var p=The(f,!1,i);o.setGeometry(p),l!==void 0&&o.setId(l),o.setProperties(s,!0)}return o},e.prototype.getType=function(){return qb.ARRAY_BUFFER},e.prototype.readFeatures=function(t,r){var i=this.layers_,a=this.adaptOptions(r),o=ya(a.dataProjection);o.setWorldExtent(a.extent),a.dataProjection=o;var s=new WUr(t),l=s.readFields(hVr,{}),u=[];for(var h in l)if(!(i&&i.indexOf(h)==-1)){var c=l[h],f=c?[0,0,c.extent,c.extent]:null;o.setExtent(f);for(var d=0,v=c.length;d>3,r=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null;e.values.push(r)}}function fVr(n,e,t){if(n==1)e.id=t.readVarint();else if(n==2)for(var r=t.readVarint()+t.pos;t.pos\xA9 SuperMap iServer with \xA9 SuperMap iClient",["4","5"].indexOf(br.getOlVersion())<0&&(e.tileSize=e.format instanceof w1&&e.style?512:256),super({attributions:e.attributions,cacheSize:e.cacheSize,format:e.format||new jc,logo:br.getOlVersion()==="4"?e.logo:null,overlaps:e.overlaps,projection:e.projection,state:e.format instanceof w1&&e.style&&Object.prototype.toString.call(e.style)=="[object String]"?"loading":e.state,tileClass:e.tileClass,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction||(e.format instanceof w1&&e.style?u:l),tileLoadFunction:e.tileLoadFunction||(e.format instanceof w1?c:h),wrapX:e.wrapX!==void 0?e.wrapX:!1,tileSize:e.tileSize||null,zDirection:["4","5"].indexOf(br.getOlVersion())>-1?null:0});var o=this;if(o.withCredentials=e.withCredentials,o._tileType=e.tileType||"ScaleXY",this.vectorTileStyles=new Ka,e.format instanceof w1&&e.style)if(Object.prototype.toString.call(e.style)=="[object String]"){var s=xs.appendCredential(e.style);li.get(s,null,{withCredentials:e.withCredentials}).then(f=>f.json()).then(f=>{this._fillByStyleJSON(f,e.source),this.setState("ready")})}else this._fillByStyleJSON(e.style,e.source);else this._fillByRestMapOptions(e.url,e);function l(f,d,v){o.tileGrid||(o.tileGrid=o.getTileGridForProjection(v));var p=f[0],g=f[1],m=["4","5"].indexOf(br.getOlVersion())>-1?-f[2]-1:f[2],y=nh(o.tileGrid.getTileSize(p,o.tmpSize)),_="";if(o.tileType==="ZXY")_="&width="+y[0]+"&height="+y[1]+"&x="+g+"&y="+m+"&z="+p;else if(o.tileType==="ViewBounds"){var x=o.tileGrid.getTileCoordExtent(f);_="&width="+y[0]+"&height="+y[1]+"&viewBounds="+x[0]+","+x[1]+","+x[2]+","+x[3]}else{var S=o.tileGrid.getOrigin(p),w=o.tileGrid.getResolution(p),b=96,E=v.getUnits()||"degrees";E==="degrees"&&(E=Wl.DEGREE),E==="m"&&(E=Wl.METER);var T=br.resolutionToScale(w,b,E);_="&x="+g+"&y="+m+"&width="+y[0]+"&height="+y[1]+"&scale="+T+"&origin={'x':"+S[0]+",'y':"+S[1]+"}"}return o._tileUrl+encodeURI(_)}function u(f){if(f)return o._tileUrl.replace(t,f[0].toString()).replace(r,f[1].toString()).replace(i,function(){var d=["4","5"].indexOf(br.getOlVersion())>-1?-f[2]-1:f[2];return d.toString()}).replace(a,function(){var d=f[0],v=o.tileGrid.getFullTileRange(d),p=v.getHeight()+f[2];return p.toString()})}function h(f,d){var v=new RegExp("(^|\\?|&)width=([^&]*)(\\s|&|$)"),p=new RegExp("(^|\\?|&)height=([^&]*)(\\s|&|$)"),g=Number(d.match(v)[2]),m=Number(d.match(p)[2]);f.setLoader(function(y,_,x){li.get(d).then(function(S){if(f.getFormat()instanceof jc)return S.json()}).then(function(S){var w=[];if(f.getFormat()instanceof jc){S.recordsets.map(function(E){return E.features.map(function(T){for(var C=[],A=0,M=0;M-1?(f.setExtent([0,0,g,m]),f.setProjection(b),w=f.getFormat().readFeatures(br.toGeoJSON(w))):w=f.getFormat().readFeatures(br.toGeoJSON(w),{extent:y,dataProjection:b,featureProjection:x}),f.setFeatures(w)}})})}function c(f,d){const v=f.getFormat(),p=f.onLoad.bind(f),g=f.onError.bind(f);f.setLoader(function(m,y,_){const x=new XMLHttpRequest;x.open("GET",typeof d=="function"?d(m,y,_):d,!0),v.getType()=="arraybuffer"&&(x.responseType="arraybuffer"),x.withCredentials=o.withCredentials,x.onload=function(){if(!x.status||x.status>=200&&x.status<300){const S=v.getType();let w;S==="json"||S==="text"?w=x.responseText:S==="xml"?(w=x.responseXML,w||(w=new DOMParser().parseFromString(x.responseText,"application/xml"))):S==="arraybuffer"&&(w=x.response),w?["4","5"].indexOf(br.getOlVersion())>-1?p.call(this,v.readFeatures(w,{featureProjection:_}),v.readProjection(w),v.getLastExtent()):p.call(this,v.readFeatures(w,{extent:m,featureProjection:_}),v.readProjection(w)):g.call(this)}else g.call(this)}.bind(this),x.onerror=function(){g.call(this)}.bind(this),x.send()})}}_fillByStyleJSON(e,t){if(t||(t=Object.keys(e.sources)[0]),e.sources&&e.sources[t]&&(this._tileUrl=xs.appendCredential(e.sources[t].tiles[0])),e.metadata&&e.metadata.indexbounds){const i=e.metadata.indexbounds;var r=Math.max(i[2]-i[0],i[3]-i[1]);const a=[];for(let o=0;o<30;o++)a.push(r/512/Math.pow(2,o));this.tileGrid=new ym({extent:e.metadata.indexbounds,resolutions:a,tileSize:[512,512]})}}_fillByRestMapOptions(e,t){this._tileUrl=H.urlPathAppend(t.url,"tileFeature.json"),t.format instanceof w1&&(this._tileUrl=H.urlPathAppend(t.url,"tileFeature.mvt")),this._tileUrl=xs.appendCredential(this._tileUrl);var r=!0;t.returnAttributes!==void 0&&(r=t.returnAttributes);var i={};i.returnAttributes=r,t._cache!==void 0&&(i._cache=t._cache),t.layersID!==void 0&&(i.layersID=t.layersID),t.layerNames!==void 0&&(i.layerNames=t.layerNames),t.expands!==void 0&&(i.expands=t.expands),t.compressTolerance!==void 0&&(i.compressTolerance=t.compressTolerance),t.coordinateType!==void 0&&(i.coordinateType=t.coordinateType),t.returnCutEdges!==void 0&&(i.returnCutEdges=t.returnCutEdges),this._tileUrl=H.urlAppend(this._tileUrl,H.getParameterString(i))}static optionsFromMapJSON(e,t){var r={};r.url=e,r.crossOrigin="anonymous";var i=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top],a=o();function o(){var l=17,u=96,h=i[2]-i[0],c=i[3]-i[1],f=h>=c?h:c,d;f===h?d=f/t.viewer.width:d=f/t.viewer.height;var v=[],p=Wl.METER;if(t.coordUnit===Wl.DEGREE&&(p=Wl.DEGREE),t.visibleScales.length>0){var g=s(t);for(let m=0;m\xA9 SuperMap iServer with \xA9 SuperMap iClient",canvasFunction:i,logo:br.getOlVersion()==="4"?r.logo:null,projection:r.projection,ratio:r.ratio,resolutions:r.resolutions,state:r.state});function i(o,s,l,u,h){var c=u[0]*l,f=u[1]*l;if(this.rootCanvas.width=this.maxWidth=c,this.rootCanvas.height=this.maxHeight=f,!this.features)return this.rootCanvas;this.pixelRatio=l;var d=this.map.getSize()[0]*l,v=this.map.getSize()[1]*l;return this.offset=[(c-d)/2/l,(f-v)/2/l],this.updateHeatPoints(s),this.rootCanvas}if(this.canvasFunctionInternal_=i,this.features=[],this.name=e,!r.map)throw new Error("options.map is not found.");this.map=r.map,this.id=r.id?r.id:H.createUniqueID("HeatMapSource_"),this.opacity=r.opacity?r.opacity:1,this.colors=r.colors?r.colors:["blue","cyan","lime","yellow","red"],this.useGeoUnit=r.useGeoUnit?r.useGeoUnit:!1,this.radius=r.radius?r.radius:50,this.featureWeight=r.featureWeight?r.featureWeight:null,this.maxWeight=null,this.minWeight=null,this.maxWidth=null,this.maxHeight=null,this.rootCanvas=document.createElement("canvas");var a=this.map.getSize();this.rootCanvas.width=this.maxWidth=parseInt(a[0]),this.rootCanvas.height=this.maxHeight=parseInt(a[1]),H.modifyDOMElement(this.rootCanvas,null,null,null,null,null,null,this.opacity),this.canvasContext=this.rootCanvas.getContext("2d")}addFeatures(e){this.features=this.toiClientFeature(e),this.changed()}setOpacity(e){if(e!==this.opacity){this.opacity=e;var t=this.rootCanvas;H.modifyDOMElement(t,null,null,null,null,null,null,e),this.map!==null&&this.changed()}}updateHeatPoints(e){this.features&&this.features.length>0?this.convertFastToPixelPoints(e):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)}convertFastToPixelPoints(e){var t=[],r,i,a,o,s,l;this.useRadius=this.useGeoUnit?parseInt(this.radius/e):this.radius;for(var u=0;u0&&this.maxWidth>0){var r=this.canvasContext;this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var i=0;i>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){QLe[0]=t,this.writeInt32(e,Wx[0])}writeFloat64(e,t){ePe[0]=t,this.writeInt32(e,Wx[q6?0:1]),this.writeInt32(e+4,Wx[q6?1:0])}getBufferIdentifier(){if(this.bytes_.length>10)+55296,(o&(1<<10)-1)+56320))}return i}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+YP}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=qP)throw new Error("FlatBuffers: file identifier must be length "+qP);for(let t=0;t=0;r--)e.addInt32(t[r]);return e.endVector()}static startEndsVector(e,t){e.startVector(4,t,4)}static addXy(e,t){e.addFieldOffset(1,t,0)}static createXyVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}static startXyVector(e,t){e.startVector(8,t,8)}static addZ(e,t){e.addFieldOffset(2,t,0)}static createZVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}static startZVector(e,t){e.startVector(8,t,8)}static addM(e,t){e.addFieldOffset(3,t,0)}static createMVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}static startMVector(e,t){e.startVector(8,t,8)}static addT(e,t){e.addFieldOffset(4,t,0)}static createTVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}static startTVector(e,t){e.startVector(8,t,8)}static addTm(e,t){e.addFieldOffset(5,t,0)}static createTmVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addInt64(t[r]);return e.endVector()}static startTmVector(e,t){e.startVector(8,t,8)}static addType(e,t){e.addFieldInt8(6,t,Dh.Unknown)}static addParts(e,t){e.addFieldOffset(7,t,0)}static createPartsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startPartsVector(e,t){e.startVector(4,t,4)}static endGeometry(e){return e.endObject()}static createGeometry(e,t,r,i,a,o,s,l,u){return gf.startGeometry(e),gf.addEnds(e,t),gf.addXy(e,r),gf.addZ(e,i),gf.addM(e,a),gf.addT(e,o),gf.addTm(e,s),gf.addType(e,l),gf.addParts(e,u),gf.endGeometry(e)}}function Jre(n,e){const t=[];for(let r=0;r>1]),t.push(i)}return t}function tPe(n,e,t){if(!t||t.length===0)return[Jre(n,e)];let r=0;const i=Array.from(t).map(o=>n.slice(r,r=o<<1));let a;return e&&(r=0,a=Array.from(t).map(o=>e.slice(r,r=o))),i.map((o,s)=>Jre(o,a?a[s]:void 0))}function gVr(n,e){const t=n.xyArray(),r=n.zArray();switch(e){case Dh.Point:{const i=Array.from(t);return r&&i.push(r[0]),i}case Dh.MultiPoint:case Dh.LineString:return Jre(t,r);case Dh.MultiLineString:return tPe(t,r,n.endsArray());case Dh.Polygon:return tPe(t,r,n.endsArray())}}function Qre(n,e){let t=e;if(t===Dh.Unknown&&(t=n.type()),t===Dh.GeometryCollection){const i=[];for(let a=0;aa.coordinates)}}const r=gVr(n,t);return{type:Dh[t],coordinates:r}}var Ch;(function(n){n[n.Byte=0]="Byte",n[n.UByte=1]="UByte",n[n.Bool=2]="Bool",n[n.Short=3]="Short",n[n.UShort=4]="UShort",n[n.Int=5]="Int",n[n.UInt=6]="UInt",n[n.Long=7]="Long",n[n.ULong=8]="ULong",n[n.Float=9]="Float",n[n.Double=10]="Double",n[n.String=11]="String",n[n.Json=12]="Json",n[n.DateTime=13]="DateTime",n[n.Binary=14]="Binary"})(Ch||(Ch={}));class Th{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsColumn(e,t){return(t||new Th).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsColumn(e,t){return e.setPosition(e.position()+iF),(t||new Th).__init(e.readInt32(e.position())+e.position(),e)}name(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}type(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):Ch.Byte}title(e){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}description(e){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}width(){const e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readInt32(this.bb_pos+e):-1}precision(){const e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readInt32(this.bb_pos+e):-1}scale(){const e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readInt32(this.bb_pos+e):-1}nullable(){const e=this.bb.__offset(this.bb_pos,18);return e?!!this.bb.readInt8(this.bb_pos+e):!0}unique(){const e=this.bb.__offset(this.bb_pos,20);return e?!!this.bb.readInt8(this.bb_pos+e):!1}primaryKey(){const e=this.bb.__offset(this.bb_pos,22);return e?!!this.bb.readInt8(this.bb_pos+e):!1}metadata(e){const t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__string(this.bb_pos+t,e):null}static startColumn(e){e.startObject(11)}static addName(e,t){e.addFieldOffset(0,t,0)}static addType(e,t){e.addFieldInt8(1,t,Ch.Byte)}static addTitle(e,t){e.addFieldOffset(2,t,0)}static addDescription(e,t){e.addFieldOffset(3,t,0)}static addWidth(e,t){e.addFieldInt32(4,t,-1)}static addPrecision(e,t){e.addFieldInt32(5,t,-1)}static addScale(e,t){e.addFieldInt32(6,t,-1)}static addNullable(e,t){e.addFieldInt8(7,+t,1)}static addUnique(e,t){e.addFieldInt8(8,+t,0)}static addPrimaryKey(e,t){e.addFieldInt8(9,+t,0)}static addMetadata(e,t){e.addFieldOffset(10,t,0)}static endColumn(e){const t=e.endObject();return e.requiredField(t,4),t}static createColumn(e,t,r,i,a,o,s,l,u,h,c,f){return Th.startColumn(e),Th.addName(e,t),Th.addType(e,r),Th.addTitle(e,i),Th.addDescription(e,a),Th.addWidth(e,o),Th.addPrecision(e,s),Th.addScale(e,l),Th.addNullable(e,u),Th.addUnique(e,h),Th.addPrimaryKey(e,c),Th.addMetadata(e,f),Th.endColumn(e)}}class $g{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFeature(e,t){return(t||new $g).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFeature(e,t){return e.setPosition(e.position()+iF),(t||new $g).__init(e.readInt32(e.position())+e.position(),e)}geometry(e){const t=this.bb.__offset(this.bb_pos,4);return t?(e||new gf).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}properties(e){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb.__vector(this.bb_pos+t)+e):0}propertiesLength(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}propertiesArray(){const e=this.bb.__offset(this.bb_pos,6);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}columns(e,t){const r=this.bb.__offset(this.bb_pos,8);return r?(t||new Th).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}columnsLength(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFeature(e){e.startObject(3)}static addGeometry(e,t){e.addFieldOffset(0,t,0)}static addProperties(e,t){e.addFieldOffset(1,t,0)}static createPropertiesVector(e,t){e.startVector(1,t.length,1);for(let r=t.length-1;r>=0;r--)e.addInt8(t[r]);return e.endVector()}static startPropertiesVector(e,t){e.startVector(1,t,1)}static addColumns(e,t){e.addFieldOffset(2,t,0)}static createColumnsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startColumnsVector(e,t){e.startVector(4,t,4)}static endFeature(e){return e.endObject()}static finishFeatureBuffer(e,t){e.finish(t)}static finishSizePrefixedFeatureBuffer(e,t){e.finish(t,void 0,!0)}static createFeature(e,t,r,i){return $g.startFeature(e),$g.addGeometry(e,t),$g.addProperties(e,r),$g.addColumns(e,i),$g.endFeature(e)}}new TextEncoder;const rPe=new TextDecoder;function yVr(n,e){const t={};if(!e||e.length===0)return t;const r=n.propertiesArray();if(!r)return t;const i=new DataView(r.buffer,r.byteOffset),a=n.propertiesLength();let o=0;for(;o0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:_Vr(e,t.value)}})}function SVr(n){if((n|=0)<0)throw new Error("invalid length");var e=this,t=this._array.length-this._index;if(this._index+n<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=n));var r=new Uint8Array(n);return r.set(this._array.subarray(this._index)),function i(){return e._source.read().then(function(a){return a.done?(e._array=Bce,e._index=0,t>0?r.subarray(0,t):null):t+a.value.length>=n?(e._array=a.value,e._index=n-t,r.set(a.value.subarray(0,n-t),t),r):(r.set(a.value,t),t+=a.value.length,i())})}()}function wVr(n){return typeof n.slice=="function"?n:new U$(typeof n.read=="function"?n:n.getReader())}function U$(n){this._source=n,this._array=Bce,this._index=0}U$.prototype.read=xVr;U$.prototype.slice=SVr;U$.prototype.cancel=mVr;class op{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsCrs(e,t){return(t||new op).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsCrs(e,t){return e.setPosition(e.position()+iF),(t||new op).__init(e.readInt32(e.position())+e.position(),e)}org(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}code(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}name(e){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}description(e){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}wkt(e){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__string(this.bb_pos+t,e):null}codeString(e){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}static startCrs(e){e.startObject(6)}static addOrg(e,t){e.addFieldOffset(0,t,0)}static addCode(e,t){e.addFieldInt32(1,t,0)}static addName(e,t){e.addFieldOffset(2,t,0)}static addDescription(e,t){e.addFieldOffset(3,t,0)}static addWkt(e,t){e.addFieldOffset(4,t,0)}static addCodeString(e,t){e.addFieldOffset(5,t,0)}static endCrs(e){return e.endObject()}static createCrs(e,t,r,i,a,o,s){return op.startCrs(e),op.addOrg(e,t),op.addCode(e,r),op.addName(e,i),op.addDescription(e,a),op.addWkt(e,o),op.addCodeString(e,s),op.endCrs(e)}}class Q7{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsHeader(e,t){return(t||new Q7).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsHeader(e,t){return e.setPosition(e.position()+iF),(t||new Q7).__init(e.readInt32(e.position())+e.position(),e)}name(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}envelope(e){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+e*8):0}envelopeLength(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}envelopeArray(){const e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}geometryType(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):Dh.Unknown}hasZ(){const e=this.bb.__offset(this.bb_pos,10);return e?!!this.bb.readInt8(this.bb_pos+e):!1}hasM(){const e=this.bb.__offset(this.bb_pos,12);return e?!!this.bb.readInt8(this.bb_pos+e):!1}hasT(){const e=this.bb.__offset(this.bb_pos,14);return e?!!this.bb.readInt8(this.bb_pos+e):!1}hasTm(){const e=this.bb.__offset(this.bb_pos,16);return e?!!this.bb.readInt8(this.bb_pos+e):!1}columns(e,t){const r=this.bb.__offset(this.bb_pos,18);return r?(t||new Th).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}columnsLength(){const e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}featuresCount(){const e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readUint64(this.bb_pos+e):BigInt("0")}indexNodeSize(){const e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readUint16(this.bb_pos+e):16}crs(e){const t=this.bb.__offset(this.bb_pos,24);return t?(e||new op).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}title(e){const t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__string(this.bb_pos+t,e):null}description(e){const t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__string(this.bb_pos+t,e):null}metadata(e){const t=this.bb.__offset(this.bb_pos,30);return t?this.bb.__string(this.bb_pos+t,e):null}static startHeader(e){e.startObject(14)}static addName(e,t){e.addFieldOffset(0,t,0)}static addEnvelope(e,t){e.addFieldOffset(1,t,0)}static createEnvelopeVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}static startEnvelopeVector(e,t){e.startVector(8,t,8)}static addGeometryType(e,t){e.addFieldInt8(2,t,Dh.Unknown)}static addHasZ(e,t){e.addFieldInt8(3,+t,0)}static addHasM(e,t){e.addFieldInt8(4,+t,0)}static addHasT(e,t){e.addFieldInt8(5,+t,0)}static addHasTm(e,t){e.addFieldInt8(6,+t,0)}static addColumns(e,t){e.addFieldOffset(7,t,0)}static createColumnsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startColumnsVector(e,t){e.startVector(4,t,4)}static addFeaturesCount(e,t){e.addFieldInt64(8,t,BigInt("0"))}static addIndexNodeSize(e,t){e.addFieldInt16(9,t,16)}static addCrs(e,t){e.addFieldOffset(10,t,0)}static addTitle(e,t){e.addFieldOffset(11,t,0)}static addDescription(e,t){e.addFieldOffset(12,t,0)}static addMetadata(e,t){e.addFieldOffset(13,t,0)}static endHeader(e){return e.endObject()}static finishHeaderBuffer(e,t){e.finish(t)}static finishSizePrefixedHeaderBuffer(e,t){e.finish(t,void 0,!0)}}function Gce(n){const e=Q7.getRootAsHeader(n),t=e.featuresCount(),r=e.indexNodeSize(),i=[];for(let l=0;l0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function YN(n){return this instanceof YN?(this.v=n,this):new YN(n)}function EVr(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){r[f]&&(i[f]=function(d){return new Promise(function(v,p){a.push([f,d,v,p])>1||s(f,d)})})}function s(f,d){try{l(r[f](d))}catch(v){c(a[0][3],v)}}function l(f){f.value instanceof YN?Promise.resolve(f.value.v).then(u,h):c(a[0][2],f)}function u(f){s("next",f)}function h(f){s("throw",f)}function c(f,d){f(d),a.shift(),a.length&&s(a[0][0],a[0][1])}}var mQe=function(n){bVr(e,n);function e(t){var r=n.call(this,t)||this;return Object.defineProperty(r,"name",{value:"RepeaterOverflowError",enumerable:!1}),typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf(r,r.constructor.prototype):r.__proto__=r.constructor.prototype,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(r,r.constructor),r}return e}(Error);(function(){function n(e){if(e<0)throw new RangeError("Capacity may not be less than 0");this._c=e,this._q=[]}return Object.defineProperty(n.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),n.prototype.add=function(e){if(this.full)throw new Error("Buffer full");this._q.push(e)},n.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},n})();(function(){function n(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(n.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),n.prototype.add=function(e){for(;this._q.length>=this._c;)this._q.shift();this._q.push(e)},n.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},n})();(function(){function n(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(n.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),n.prototype.add=function(e){this._q.length=ez;return Promise.resolve(e).then(function(r){return!t&&n.state>=rne?lM(n).then(function(i){return{value:i,done:!0}}):{value:r,done:t}})}function zce(n,e){var t,r;if(!(n.state>=U2))if(n.state=U2,n.onnext(),n.onstop(),n.err==null&&(n.err=e),n.pushes.length===0&&(typeof n.buffer>"u"||n.buffer.empty))kR(n);else try{for(var i=SL(n.pushes),a=i.next();!a.done;a=i.next()){var o=a.value;o.resolve()}}catch(s){t={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}function kR(n){var e,t;if(!(n.state>=ez)){n.state=rne||(n.state=tz)throw new mQe("No more than "+tz+" pending calls to push are allowed on a single repeater.");if(n.state>=U2)return Promise.resolve(void 0);var t=n.pending===void 0?Promise.resolve(e):n.pending.then(function(){return e});t=t.catch(function(l){n.state=nPe)){n.state=nPe;var e=TVr.bind(null,n),t=CVr(n);n.execution=new Promise(function(r){return r(n.executor(e,t))}),n.execution.catch(function(){return zce(n)})}}var Z6=new WeakMap,aF=function(){function n(e,t){Z6.set(this,{executor:e,buffer:t,err:void 0,state:LZ,pushes:[],nexts:[],pending:void 0,execution:void 0,onnext:rz,onstop:rz})}return n.prototype.next=function(e){tne(e);var t=Z6.get(this);if(t===void 0)throw new Error("WeakMap error");if(t.nexts.length>=tz)throw new mQe("No more than "+tz+" pending calls to next are allowed on a single repeater.");if(t.state<=LZ&&AVr(t),t.onnext(e),typeof t.buffer<"u"&&!t.buffer.empty){var r=Jb(t,t.buffer.remove());if(t.pushes.length){var i=t.pushes.shift();t.buffer.add(i.value),t.onnext=i.resolve}return r}else if(t.pushes.length){var a=t.pushes.shift();return t.onnext=a.resolve,Jb(t,a.value)}else if(t.state>=U2)return kR(t),Jb(t,lM(t));return new Promise(function(o){return t.nexts.push({resolve:o,value:e})})},n.prototype.return=function(e){tne(e);var t=Z6.get(this);if(t===void 0)throw new Error("WeakMap error");return kR(t),t.execution=Promise.resolve(t.execution).then(function(){return e}),Jb(t,lM(t))},n.prototype.throw=function(e){var t=Z6.get(this);if(t===void 0)throw new Error("WeakMap error");return t.state<=LZ||t.state>=U2||typeof t.buffer<"u"&&!t.buffer.empty?(kR(t),t.err==null&&(t.err=e),Jb(t,lM(t))):this.next(Promise.reject(e))},n.prototype[Symbol.asyncIterator]=function(){return this},n.race=MVr,n.merge=IVr,n.zip=LVr,n.latest=PVr,n}();function V$(n,e){var t,r,i=[],a=function(u){u!=null&&typeof u[Symbol.asyncIterator]=="function"?i.push(u[Symbol.asyncIterator]()):u!=null&&typeof u[Symbol.iterator]=="function"?i.push(u[Symbol.iterator]()):i.push(function(){return EVr(this,arguments,function(){return yw(this,function(f){switch(f.label){case 0:return e.yieldValues?[4,YN(u)]:[3,3];case 1:return[4,f.sent()];case 2:f.sent(),f.label=3;case 3:return e.returnValues?[4,YN(u)]:[3,5];case 4:return[2,f.sent()];case 5:return[2]}})})}())};try{for(var o=SL(n),s=o.next();!s.done;s=o.next()){var l=s.value;a(l)}}catch(u){t={error:u}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}function MVr(n){var e=this,t=V$(n,{returnValues:!0});return new aF(function(r,i){return SI(e,void 0,void 0,function(){var a,o,s,l,u,h;return yw(this,function(c){switch(c.label){case 0:if(!t.length)return i(),[2];o=!1,i.then(function(){a(),o=!0}),c.label=1;case 1:c.trys.push([1,,5,7]),l=void 0,u=0,h=function(){var f,d,v,p,g,m;return yw(this,function(y){switch(y.label){case 0:f=u;try{for(d=(g=void 0,SL(t)),v=d.next();!v.done;v=d.next())p=v.value,Promise.resolve(p.next()).then(function(_){_.done?(i(),s===void 0&&(s=_)):u===f&&(u++,a(_))},function(_){return i(_)})}catch(_){g={error:_}}finally{try{v&&!v.done&&(m=d.return)&&m.call(d)}finally{if(g)throw g.error}}return[4,new Promise(function(_){return a=_})];case 1:return l=y.sent(),l===void 0?[3,3]:[4,r(l.value)];case 2:y.sent(),y.label=3;case 3:return[2]}})},c.label=2;case 2:return o?[3,4]:[5,h()];case 3:return c.sent(),[3,2];case 4:return[2,s&&s.value];case 5:return i(),[4,Promise.race(t.map(function(f){return f.return&&f.return()}))];case 6:return c.sent(),[7];case 7:return[2]}})})})}function IVr(n){var e=this,t=V$(n,{yieldValues:!0});return new aF(function(r,i){return SI(e,void 0,void 0,function(){var a,o,s,l=this;return yw(this,function(u){switch(u.label){case 0:if(!t.length)return i(),[2];a=[],o=!1,i.then(function(){var h,c;o=!0;try{for(var f=SL(a),d=f.next();!d.done;d=f.next()){var v=d.value;v()}}catch(p){h={error:p}}finally{try{d&&!d.done&&(c=f.return)&&c.call(f)}finally{if(h)throw h.error}}}),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,Promise.all(t.map(function(h,c){return SI(l,void 0,void 0,function(){var f,d;return yw(this,function(v){switch(v.label){case 0:v.trys.push([0,,6,9]),v.label=1;case 1:return o?[3,5]:(Promise.resolve(h.next()).then(function(p){return a[c](p)},function(p){return i(p)}),[4,new Promise(function(p){a[c]=p})]);case 2:return f=v.sent(),f===void 0?[3,4]:f.done?(s=f,[2]):[4,r(f.value)];case 3:v.sent(),v.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return d=h.return,d?[4,h.return()]:[3,8];case 7:d=v.sent(),v.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return u.sent(),[2,s&&s.value];case 3:return i(),[7];case 4:return[2]}})})})}function LVr(n){var e=this,t=V$(n,{returnValues:!0});return new aF(function(r,i){return SI(e,void 0,void 0,function(){var a,o,s,l;return yw(this,function(u){switch(u.label){case 0:if(!t.length)return i(),[2,[]];o=!1,i.then(function(){a(),o=!0}),u.label=1;case 1:u.trys.push([1,,6,8]),u.label=2;case 2:return o?[3,5]:(Promise.all(t.map(function(h){return h.next()})).then(function(h){return a(h)},function(h){return i(h)}),[4,new Promise(function(h){return a=h})]);case 3:return s=u.sent(),s===void 0?[2]:(l=s.map(function(h){return h.value}),s.some(function(h){return h.done})?[2,l]:[4,r(l)]);case 4:return u.sent(),[3,2];case 5:return[3,8];case 6:return i(),[4,Promise.all(t.map(function(h){return h.return&&h.return()}))];case 7:return u.sent(),[7];case 8:return[2]}})})})}function PVr(n){var e=this,t=V$(n,{yieldValues:!0,returnValues:!0});return new aF(function(r,i){return SI(e,void 0,void 0,function(){var a,o,s,l,u,h=this;return yw(this,function(c){switch(c.label){case 0:if(!t.length)return i(),[2,[]];o=[],s=!1,i.then(function(){var f,d;a();try{for(var v=SL(o),p=v.next();!p.done;p=v.next()){var g=p.value;g()}}catch(m){f={error:m}}finally{try{p&&!p.done&&(d=v.return)&&d.call(v)}finally{if(f)throw f.error}}s=!0}),c.label=1;case 1:return c.trys.push([1,,5,7]),Promise.all(t.map(function(f){return f.next()})).then(function(f){return a(f)},function(f){return i(f)}),[4,new Promise(function(f){return a=f})];case 2:return l=c.sent(),l===void 0?[2]:(u=l.map(function(f){return f.value}),l.every(function(f){return f.done})?[2,u]:[4,r(u.slice())]);case 3:return c.sent(),[4,Promise.all(t.map(function(f,d){return SI(h,void 0,void 0,function(){var v;return yw(this,function(p){switch(p.label){case 0:if(l[d].done)return[2,l[d].value];p.label=1;case 1:return s?[3,4]:(Promise.resolve(f.next()).then(function(g){return o[d](g)},function(g){return i(g)}),[4,new Promise(function(g){return o[d]=g})]);case 2:return v=p.sent(),v===void 0?[2,l[d].value]:v.done?[2,v.value]:(u[d]=v.value,[4,r(u.slice())]);case 3:return p.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,c.sent()];case 5:return i(),[4,Promise.all(t.map(function(f){return f.return&&f.return()}))];case 6:return c.sent(),[7];case 7:return[2]}})})})}class qN{constructor(){this._extraRequestThreshold=256*1024}extraRequestThreshold(){return this._extraRequestThreshold}setExtraRequestThreshold(e){if(e<0)throw new Error("extraRequestThreshold cannot be negative");this._extraRequestThreshold=e}}qN.global=new qN;var Ug;(function(n){n[n.Debug=0]="Debug",n[n.Info=1]="Info",n[n.Warn=2]="Warn",n[n.Error=3]="Error"})(Ug||(Ug={}));class Nh{static debug(...e){this.log(Ug.Debug,...e)}static info(...e){this.log(Ug.Info,...e)}static warn(...e){this.log(Ug.Warn,...e)}static error(...e){this.log(Ug.Error,...e)}static log(e,...t){if(!(this.logLevel>e))switch(e){case Ug.Debug:{console.debug(...t);break}case Ug.Info:{console.info(...t);break}case Ug.Warn:{console.warn(...t);break}case Ug.Error:{console.error(...t);break}}}}Nh.logLevel=Ug.Info;const FR=8*4+8,OVr=16;function Uce(n,e){e=Math.min(Math.max(+e,2),65535);let t=n,r=t;do t=Math.ceil(t/e),r+=t;while(t!==1);return r*FR}function RVr(n,e){if(e<2)throw new Error("Node size must be at least 2");if(n===0)throw new Error("Number of items must be greater than 0");let t=n,r=t;const i=[t];do t=Math.ceil(t/e),r+=t,i.push(t);while(t!==1);const a=[];t=r;for(const s of i)a.push(t-s),t-=s;a.reverse(),i.reverse();const o=[];for(let s=0;sthis.nodes[1]),this.nodes[1]=v}toString(){return`[NodeRange level: ${this._level}, nodes: ${this.nodes[0]}-${this.nodes[1]}]`}}const{minX:a,minY:o,maxX:s,maxY:l}=t;Nh.info(`tree items: ${n}, nodeSize: ${e}`);const u=RVr(n,e),h=u[0][0],f=[(()=>{const d=[0,1],v=u.length-1;return new i(d,v)})()];for(Nh.debug(`starting stream search with queue: ${f}, numItems: ${n}, nodeSize: ${e}, levelBounds: ${u}`);f.length!=0;){const d=f.shift();Nh.debug(`popped node: ${d}, queueLength: ${f.length}`);const v=d.startNode(),p=v>=h,[,g]=u[d.level()],m=Math.min(d.endNode()+e,g),y=m-v,_=await r(v*FR,y*FR),x=new Float64Array(_),S=new Uint32Array(_);for(let w=v;wx[b+2]||o>x[b+3])continue;const E=S[(b<<1)+8],T=S[(b<<1)+9],C=aPe(T,E);if(p){const R=(()=>{if(w ${C}`),M.extendEndNodeToNewOffset(C);continue}const I=(()=>{const R=d.level()-1,k=[C,C+1];return new i(k,R)})();M!==void 0&&M.level()==I.level()?Nh.info(`Same level, but too far away. Pushing new request at offset: ${C} rather than merging with distant ${M}`):Nh.info(`Pushing new level for ${I} onto queue with nearestNodeRange: ${M} since there's not already a range for this level.`),f.push(I)}}}function aPe(n,e){if((n&4293918720)!=0)throw Error("integer is too large to be safely represented");return e+n*2**32}const vS=new Uint8Array([102,103,98,3,102,103,98,0]),U1=4;class Vce{constructor(e,t,r,i){this.headerClient=e,this.header=t,this.headerLength=r,this.indexLength=i}static async open(e){const r=new oPe(e),i=(()=>{const c=OVr,f=3;let d=0,v;for(v=0;vvS[d]===f))throw Nh.error(`bytes: ${c} != ${vS}`),new Error("Not a FlatGeobuf file");Nh.debug("magic bytes look good")}let o;{const c=await r.getRange(8,4,a,"header");o=new DataView(c).getUint32(0,!0);const f=1048576*10;if(o>f||o<8)throw new Error("Invalid header size");Nh.debug(`headerLength: ${o}`)}const s=await r.getRange(12,o,a,"header"),l=new L_(new Uint8Array(s)),u=Gce(l),h=Uce(u.featuresCount,u.indexNodeSize);return Nh.debug("completed: opening http reader"),new Vce(r,u,o,h)}async*selectBbox(e){const t=this.lengthBeforeTree(),r=this.headerClient,i=async function(l,u){return r.getRange(t+l,u,0,"index")},a=[];let o=[];for await(const l of DVr(this.header.featuresCount,this.header.indexNodeSize,e,i)){const[u,,]=l;let[,,h]=l;if(h||(Nh.info("final feature"),h=qN.global.extraRequestThreshold()),o.length==0){o.push([u,h]);continue}const c=o[o.length-1],f=u-(c[0]+c[1]);f>qN.global.extraRequestThreshold()&&(Nh.info(`Pushing new feature batch, since gap ${f} was too large`),a.push(o),o=[]),o.push([u,h])}this.headerClient.logUsage("header+index"),o.length>0&&a.push(o);const s=a.flatMap(l=>this.readFeatureBatch(l));yield*aF.merge(s)}lengthBeforeTree(){return vS.length+U1+this.headerLength}lengthBeforeFeatures(){return this.lengthBeforeTree()+this.indexLength}buildFeatureClient(){return new oPe(this.headerClient.httpClient)}async*readFeatureBatch(e){const[t]=e[0],[r,i]=e[e.length-1],a=t,s=r+i-a,l=this.buildFeatureClient();for(const[u]of e)yield await this.readFeature(l,u,s);l.logUsage("feature")}async readFeature(e,t,r){const i=t+this.lengthBeforeFeatures();let a;{const h=await e.getRange(i,4,r,"feature length");a=new DataView(h).getUint32(0,!0)}const o=await e.getRange(i+4,a,r,"feature data"),s=new Uint8Array(o),l=new Uint8Array(a+U1);l.set(s,U1);const u=new L_(l);return u.setPosition(U1),$g.getRootAsFeature(u)}}class oPe{constructor(e){this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,typeof e=="string"?this.httpClient=new NVr(e):this.httpClient=e}async getRange(e,t,r,i){this.bytesEverUsed+=t;const a=e-this.head,o=a+t;if(a>=0&&o<=this.buffer.byteLength)return this.buffer.slice(a,o);const s=Math.max(t,r);return this.bytesEverFetched+=s,Nh.debug(`requesting for new Range: ${e}-${e+t-1}`),this.buffer=await this.httpClient.getRange(e,s,i),this.head=e,this.buffer.slice(0,t)}logUsage(e){const t=e.split(" ")[0],r=this.bytesEverUsed,i=this.bytesEverFetched,a=(100*r/i).toFixed(2);Nh.info(`${t} bytes used/requested: ${r} / ${i} = ${a}%`)}}class NVr{constructor(e){this.requestsEverMade=0,this.bytesEverRequested=0,this.url=e}async getRange(e,t,r){this.requestsEverMade+=1,this.bytesEverRequested+=t;const i=`bytes=${e}-${e+t-1}`;return Nh.info(`request: #${this.requestsEverMade}, purpose: ${r}), bytes: (this_request: ${t}, ever: ${this.bytesEverRequested}), Range: ${i}`),(await fetch(this.url,{headers:{Range:i}})).arrayBuffer()}}function kVr(n,e,t){if(!n.subarray(0,3).every((h,c)=>vS[c]===h))throw new Error("Not a FlatGeobuf file");const r=new L_(n),i=r.readUint32(vS.length);r.setPosition(vS.length+U1);const a=Gce(r);t&&t(a);let o=vS.length+U1+i;const{indexNodeSize:s,featuresCount:l}=a;s>0&&(o+=Uce(l,s));const u=[];for(;oawait r.slice(f);let a=new Uint8Array(await i(8));if(!a.subarray(0,3).every((f,d)=>vS[d]===f))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await i(4));let o=new L_(a);const s=o.readUint32(0);a=new Uint8Array(await i(s)),o=new L_(a);const l=Gce(o);t&&t(l);const{indexNodeSize:u,featuresCount:h}=l;if(u>0){const f=Uce(h,u);await i(f)}let c;for(;c=await GVr(i,l,e);)yield c}async function*BVr(n,e,t,r){const i=await Vce.open(n);Nh.debug("opened reader"),r&&r(i.header);for await(const a of i.selectBbox(e))yield t(a,i.header)}async function GVr(n,e,t){let r=new Uint8Array(await n(4,"feature length"));if(r.byteLength===0)return;let i=new L_(r);const a=i.readUint32(0);r=new Uint8Array(await n(a,"feature data"));const o=new Uint8Array(a+4);o.set(r,4),i=new L_(o),i.setPosition(U1);const s=$g.getRootAsFeature(i);return t(s,e)}function zVr(n,e){return{type:"FeatureCollection",features:kVr(n,Fce,e)}}function UVr(n,e){return FVr(n,Fce,e)}function VVr(n,e,t){return BVr(n,e,Fce,t)}function $Vr(n,e,t){return n instanceof Uint8Array?zVr(n,t):n instanceof ReadableStream?UVr(n,t):VVr(n,e,t)}class WVr extends _f{constructor(e){const t=Object.assign({strategy:uTe},e);delete t.url,delete t.extent,delete t.idField,super(t),this.options=e||{},this.strategy=t.strategy,this.url=this.options.url,this.extent=this.options.extent,this._idField=this.options.idField||"SmID",this._validatedId=!1,this._checked=!1,this.setLoader(async function(r){if(this.strategy===uTe&&(this._validatedId||this.clear(),this.extent)){const a=Bot(this.extent,r);r=a&&a.length?a:this.extent}!this.extent&&(this.strategy===oXe||!isFinite(r[0]))&&(r=[]);let i;Object.keys(r).length||(i=await this._getStream(this.url)),this._handleFeatures(i&&i.body||this.url,r)})}async _handleFeatures(e,t){let r={};t&&t.length&&(r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]});const i=$Vr(e,r);for await(let a of i){let o=a.properties[this._idField];o&&!this._validatedId&&(this._validatedId=!0,this._checked=!0),a=new jc().readFeature(a),o&&this._checked&&a.setId(o),this.options.featureLoader&&typeof this.options.featureLoader=="function"&&(a=this.options.featureLoader(a)),this.addFeature(a)}}async _getStream(e){return await li.get(e,{},{withoutFormatSuffix:!0}).then(function(t){return t})}}class _Qe extends _l{constructor(e,t){super(e,t),this._knowledgeGraphService=new Eot(e,t)}query(e,t){return this._knowledgeGraphService.query(e,t)}getGraphMaps(e){return this._knowledgeGraphService.getGraphMaps(e)}getGraphMap(e,t){return this._knowledgeGraphService.getGraphMap(e,t)}async getGraphMapData(e){return await this._knowledgeGraphService.getGraphMapData(e)}}class HVr extends fT{constructor(e,t){super(),this.graph=null,this.EVENT_TYPES=["loaded"],this.url=e,this.options=t;const r=e.split("/").pop();this.url=e.replace(`/graphmaps/${r}`,""),this.createGraphMap(r,t)}async createGraphMap(e,t){this.knowledgeGraphService=this.createKnowledgeGraphService(this.url,t);const r=await this.knowledgeGraphService.getGraphMapData(e),i=mte.dataFromGraphMap(r.data,r.graphMap);this.graph=new mte(t&&t.config),this.graph.on("beforelayout",()=>{this.dispatchEvent(this.EVENT_TYPES[0])}),this.graph.setData(i),this.graph.handleNodeStatus(G4t(r.graphMap))}createKnowledgeGraphService(e,t){return new _Qe(e,t)}}var xQe=function(n){if(gm.prototype.getFlatMidpoint||(gm.prototype.getFlatMidpoint=function(){return this.getCoordinateAt(.5)}),br.getOlVersion()==="4"&&window&&window.ol&&window.ol.geom.flat){window.targetMapCache=n;let e=window.ol;e.format.MVT.prototype.readProjection=function(t){return new e.proj.Projection({code:"",units:e.proj.Units.TILE_PIXELS})},e.format.MVT.prototype.readProjection=function(t){return new e.proj.Projection({code:"",units:e.proj.Units.TILE_PIXELS})},e.render.canvas.Replay.prototype.applyFill=function(t,r){var i=t.fillStyle,a=[e.render.canvas.Instruction.SET_FILL_STYLE,i];if(typeof i!="string"){var o=window.targetMapCache.getView().getProjection().getExtent();a.push([o[0],o[3]])}this.instructions.push(a)},e.render.canvas.Replay.prototype.applyFill=function(t,r){var i=t.fillStyle,a=[e.render.canvas.Instruction.SET_FILL_STYLE,i];if(typeof i!="string"){var o=window.targetMapCache.getView().getProjection().getExtent();a.push([o[0],o[3]])}this.instructions.push(a)},e.format.MVT.prototype.createFeature_=function(t,r,i){var a=r.type;if(a===0)return null;var o,s=r.id,l=r.properties;l[this.layerName_]=r.layer.name;var u=[],h=[];e.format.MVT.readRawGeometry_(t,r,u,h);var c=e.format.MVT.getGeometryType_(a,h.length);if(this.featureClass_===e.render.Feature)o=new this.featureClass_(c,u,h,l,s);else{var f;if(c==e.geom.GeometryType.POLYGON){for(var d=[],v=0,p=0,g=0,m=h.length;g1?(h=d,f=new e.geom.MultiPolygon(null)):f=new e.geom.Polygon(null)}else f=c===e.geom.GeometryType.POINT?new e.geom.Point(null):c===e.geom.GeometryType.LINE_STRING?new e.geom.LineString(null):c===e.geom.GeometryType.POLYGON?new e.geom.Polygon(null):c===e.geom.GeometryType.MULTI_POINT?new e.geom.MultiPoint(null):c===e.geom.GeometryType.MULTI_LINE_STRING?new e.geom.MultiLineString(null):null;if(f){f.setFlatCoordinates(e.geom.GeometryLayout.XY,u,h),o=new this.featureClass_,this.geometryName_&&o.setGeometryName(this.geometryName_);var _=e.format.Feature.transformWithOptions(f,!1,this.adaptOptions(i));o.setGeometry(_),o.setId(s),o.setProperties(l)}}return o},e.geom.flat.textpath.lineString=function(t,r,i,a,o,s,l,u){var h=[],c=Math.atan2(t[i-a+1]-t[r+1],t[i-a]-t[r]),f=c<-.785||c>2.356,d=c<-.785&&c>-2.356||c>.785&&c<2.356,v=o.length,p=t[r],g=t[r+1];r+=a;for(var m=t[r],y=t[r+1],_=0,x=Math.sqrt(Math.pow(m-p,2)+Math.pow(y-g,2));r=19968&&D<=40907;E=f?k+E:E+k;var W=s(E)-T;for(T+=W;r1?le:le<0||le>1?Y:Y1?le:le<0||le>1?Y:Y0?-Math.PI:Math.PI),G&&d&&(se+=se>0?-Math.PI/2:Math.PI/2),M!==void 0){var me=se-M;if(me+=me>Math.PI?-2*Math.PI:me<-Math.PI?2*Math.PI:0,G===I?Math.abs(me)>u:Math.abs(me)>u+Math.PI/2)return null}M==se&&!d?(f&&(C[0]=j,C[1]=Q,C[2]=W/2),C[4]=E):(E=k,T=W,C=[j,Q,W/2,se,E],f?h.unshift(C):h.push(C),M=se,I=G),w=ie,b=oe,l+=W}return h},e.layer.VectorTile.prototype.setFastRender=function(t){return this.fastRender=t},e.renderer.canvas.VectorTileLayer.prototype.postCompose=function(t,r,i){var a=this.getLayer(),o=a.getDeclutter()?{}:null,s=a.getSource(),l=a.getRenderMode(),u=e.renderer.canvas.VectorTileLayer.VECTOR_REPLAYS[l],h=r.pixelRatio,c=r.viewState.rotation,f=r.size,d,v;c&&(d=Math.round(h*f[0]/2),v=Math.round(h*f[1]/2),e.render.canvas.rotateAtOffset(t,-c,d,v)),o&&this.declutterTree_.clear();for(var p=this.renderedTiles,g=s.getTileGridForProjection(r.viewState.projection),m=[],y=[],_=p.length-1;_>=0;--_){var x=p[_];if(x.getState()!=e.TileState.ABORT)for(var S=x.tileCoord,w=g.getTileCoordExtent(S)[0]-g.getTileCoordExtent(x.wrappedTileCoord)[0],b=void 0,E=0,T=x.tileKeys.length;E-1}function ut(ne,ye){var Ue=this.__data__,Bt=js(Ue,ne);return Bt<0?Ue.push([ne,ye]):Ue[Bt][1]=ye,this}Me.prototype.clear=nt,Me.prototype.delete=It,Me.prototype.get=ot,Me.prototype.has=ht,Me.prototype.set=ut;function qt(ne){var ye=-1,Ue=ne?ne.length:0;for(this.clear();++ye$t?0:$t+ye),Ue=Ue>$t?$t:Ue,Ue<0&&(Ue+=$t),$t=ye>Ue?0:Ue-ye>>>0,ye>>>=0;for(var ee=Array($t);++Bt<$t;)ee[Bt]=ne[Bt+ye];return ee}function bs(ne){if(typeof ne=="string")return ne;if(Re(ne))return Pn?Pn.call(ne):"";var ye=ne+"";return ye=="0"&&1/ne==-s?"-0":ye}function lf(ne){return O(ne)?ne:Vv(ne)}function gg(ne,ye,Ue,Bt,$t,ee){var Se=$t&o,Ze=ne.length,Ct=ye.length;if(Ze!=Ct&&!(Se&&Ct>Ze))return!1;var vr=ee.get(ne);if(vr&&ee.get(ye))return vr==ye;var Cr=-1,Jr=!0,nn=$t&a?new bi:void 0;for(ee.set(ne,ye),ee.set(ye,ne);++Cr-1&&ne%1==0&&ne-1&&ne%1==0&&ne<=l}function Z(ne){var ye=typeof ne;return!!ne&&(ye=="object"||ye=="function")}function Ae(ne){return!!ne&&typeof ne=="object"}function Re(ne){return typeof ne=="symbol"||Ae(ne)&&Sr.call(ne)==b}var Be=Zt?ft(Zt):pg;function Je(ne){return ne==null?"":bs(ne)}function Xe(ne,ye,Ue){var Bt=ne==null?void 0:fg(ne,ye);return Bt===void 0?Ue:Bt}function _t(ne,ye){return ne!=null&&Hm(ne,ye,Xd)}function rt(ne){return F(ne)?ec(ne):of(ne)}function Ht(ne){return ne}function Yt(ne){return bc(ne)?ur(hf(ne)):Kl(ne)}n.exports=_g})(nne,nne.exports);const jVr=nne.exports;class SQe extends fT{constructor(e){super(),e=e||{},this.spriteRegEx=/^(.*)(\?.*)$/,this.defaultFont=["DIN Offc Pro Medium","Arial Unicode MS Regular"],this.map=e.map,this.source=e.source,this.styleTarget=e.style||H.urlAppend(H.urlPathAppend(e.url,"tileFeature/vectorstyles"),"type=MapBox_GL&styleonly=true"),this.resolutions=e.resolutions,this.withCredentials=e.withCredentials,this.selectedObjects=[],this.selectedStyle=e.selectedStyle||function(){return new So({fill:new Ko({color:"rgba(255, 0, 0, 1)"}),stroke:new es({color:"rgba(255, 0, 0, 1)",width:10}),text:new J1({font:'normal 400 11.19px "Microsoft YaHei"',placement:"point",fill:new Ko({color:"blue"})}),image:new rm({radius:5,fill:new Ko({color:"blue"})})})},this.layersBySourceLayer={},xQe(this.map),this._loadStyle(this.styleTarget)}getStyleFunction(){return this.featureStyleFuntion}getStylesBySourceLayer(e){if(this.layersBySourceLayer[e])return this.layersBySourceLayer[e];const t=[];for(let r=0;r{jVr(this.selectedObjects,r=>t.id===r.id&&t.sourceLayer===r.sourceLayer)})}clearSelectedObjects(){this.selectedObjects=[]}updateStyles(e){Object.prototype.toString.call(e)!=="[object Array]"&&(e=[e]);const t={};e.forEach(i=>{t[i.id]=i});let r=0;for(const i in this._mbStyle.layers){const a=this._mbStyle.layers[i];if(r>=e.length)break;if(!t[a.id])continue;const o=JSON.parse(JSON.stringify(t[a.id]));o.paint&&(o.paint=Object.assign({},a.paint,o.paint)),o.layout&&(o.layout=Object.assign({},a.layout,o.layout)),Object.assign(a,o),r++}this._createStyleFunction()}setStyle(e){this.layersBySourceLayer={},this._loadStyle(e)}_loadStyle(e){if(Object.prototype.toString.call(e)=="[object Object]")this._mbStyle=e,this._resolve();else{var t=xs.appendCredential(e);li.get(t,null,{withCredentials:this.withCredentials}).then(r=>r.json()).then(r=>{this._mbStyle=r,this._resolve()})}}_resolve(){if(this.source||(this.source=Object.keys(this._mbStyle.sources)[0]),this._mbStyle.sprite){const t=(window.devicePixelRatio>=1.5?.5:1)==.5?"@2x":"";this._mbStyle.sprite=this._mbStyle.sprite.replace("@2x","");const r=this._toSpriteUrl(this._mbStyle.sprite,this.path,t+".json");li.get(xs.appendCredential(r),null,{withCredentials:this.withCredentials}).then(i=>i.json()).then(i=>{this._spriteData=i,this._spriteImageUrl=xs.appendCredential(this._toSpriteUrl(this._mbStyle.sprite,this.path,t+".png")),this._spriteImage=null;const a=new Image;a.crossOrigin=this.withCredentials?"use-credentials":"anonymous",a.onload=()=>{this._spriteImage=a,this._initStyleFunction()},a.onerror=()=>{this._spriteImage=null,this._initStyleFunction()},a.src=this._spriteImageUrl}).catch(i=>{console.log(i),this._spriteImage=null,this._initStyleFunction()})}else this._initStyleFunction()}_initStyleFunction(){if(!this.resolutions&&this._mbStyle.metadata&&this._mbStyle.metadata.indexbounds){const t=this._mbStyle.metadata.indexbounds;var e=Math.max(t[2]-t[0],t[3]-t[1]);const r=[];for(let i=0;i<30;i++)r.push(e/512/Math.pow(2,i));this.resolutions=r}this._createStyleFunction(),this.dispatchEvent("styleloaded")}_createStyleFunction(){this.map&&window.olms.applyBackground(this.map,this._mbStyle),this.featureStyleFuntion=this._getStyleFunction()}_getStyleFunction(){return this.fun=window.olms.stylefunction({setStyle:function(){},set:function(){},changed:function(){}},this._mbStyle,this.source,this.resolutions,this._spriteData,"",this._spriteImage),(e,t)=>{const r=this.fun(e,t);if(this.selectedObjects.length>0&&this.selectedObjects.find(i=>i.id===e.getId()&&i.sourceLayer===e.get("layer"))){const i=r&&r[0]?r[0].getZIndex():99999;let a=this.selectedStyle(e,t);Array.isArray(a)||(a=[a]);for(let o=0;o2?i[2]:""):e+r}}class XVr extends _l{constructor(e,t){super(e,t),this._addressMatchService=new jOe(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}code(e,t){return this._addressMatchService.code(H.urlPathAppend(this.url,"geocoding"),e,t)}decode(e,t){return this._addressMatchService.decode(H.urlPathAppend(this.url,"geodecoding"),e,t)}}class YVr{constructor(e,t){this.url=e,this.options=t||{}}queryChart(e,t,r){var i=this,a=e,o=i._processFormat(r),s=new nRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:o});return s.processAsync(a,t)}getChartFeatureInfo(e){var t=this,r=H.urlPathAppend(t.url,"chartFeatureInfoSpecs"),i=new eRe(r,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers});return i.processAsync(e)}_processFormat(e){return e||Ni.GEOJSON}}class qVr extends _l{constructor(e,t){super(e,t),this._chartService=new YVr(e,t)}queryChart(e,t,r){return e=this._processParams(e),this._chartService.queryChart(e,t,r)}getChartFeatureInfo(e){return this._chartService.getChartFeatureInfo(e)}_processParams(e){if(!e)return{};e.returnContent=e.returnContent==null?!0:e.returnContent,e.filter&&(e.chartQueryFilterParameters=br.isArray(e.filter)?e.filter:[e.filter]),e.bounds&&(e.bounds=new po(e.bounds[0],e.bounds[1],e.bounds[2],e.bounds[3]))}}class ZVr{constructor(e,t){this.url=e,this.options=t||{}}getFields(e,t){var r=this,i=new QRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,datasource:e.datasource,dataset:e.dataset});return i.processAsync(t)}getFieldStatisticsInfo(e,t){if(e instanceof CRe){var r=this,i=e.fieldName,a=e.statisticMode;a&&!Array.isArray(a)&&(a=[a]),r.currentStatisticResult={fieldName:i},r._statisticsCallback=t,a.forEach(o=>{r.currentStatisticResult[o]=null,r._fieldStatisticRequest(e.datasource,e.dataset,i,o)})}}_fieldStatisticRequest(e,t,r,i){var a=this,o=new ARe(a.url,{datasource:e,dataset:t,field:r,statisticMode:i,crossOrigin:a.options.crossOrigin,headers:a.options.headers});o.processAsync(a._processCompleted.bind(a))}_processCompleted(e){var t=this;if(e.error){t._statisticsCallback(e);return}var r=!0,i=e.result;this.currentStatisticResult&&t.currentStatisticResult[i.mode]==null&&(this.currentStatisticResult[i.mode]=i.result);for(var a in t.currentStatisticResult)if(t.currentStatisticResult[a]==null){r=!1;break}r&&t._statisticsCallback({result:t.currentStatisticResult})}}class KVr extends _l{constructor(e,t){super(e,t),this._fieldService=new ZVr(e,t)}getFields(e,t){return this._fieldService.getFields(e,t)}getFieldStatisticsInfo(e,t){return this._fieldService.getFieldStatisticsInfo(e,t)}}class JVr extends _l{constructor(e,t){super(e,t),this._datasetService=new jRe(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getDatasets(e,t){if(!!e)return this._datasetService.getDatasetsService(e,t)}getDataset(e,t,r){if(!(!e||!t))return this._datasetService.getDatasetService(e,t,r)}setDataset(e,t){if(!(!(e instanceof xK)&&!(e instanceof SK))){if(e instanceof xK)var r={datasetType:e.datasetType,datasetName:e.datasetName,datasourceName:e.datasourceName};else e instanceof SK&&(r={datasetName:e.datasetName,datasourceName:e.datasourceName,isFileCache:e.isFileCache,description:e.description,prjCoordSys:e.prjCoordSys,charset:e.charset});return this._datasetService.setDatasetService(r,t)}}deleteDataset(e,t,r){return this._datasetService.deleteDatasetService(e,t,r)}}class QVr extends _l{constructor(e,t){super(e,t),this._datasourceService=new cRe(this.url,{proxy:this.proxy,withCredentials:this.withCredentials,crossOrigin:this.crossOrigin,headers:this.headers})}getDatasources(e){return this._datasourceService.getDatasourcesService(e)}getDatasource(e,t){if(!!e)return this._datasourceService.getDatasourceService(e,t)}setDatasource(e,t){if(!(e instanceof $De))return;const r={description:e.description,coordUnit:e.coordUnit,distanceUnit:e.distanceUnit,datasourceName:e.datasourceName};return this._datasourceService.setDatasourceService(r,t)}}class e$r extends _l{constructor(e,t){super(e,t),this._gridCellQueryService=new tDe(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getGridCellInfos(e,t){return e?this._gridCellQueryService.processAsync(e,t):null}}class t$r extends _l{constructor(e,t){super(e,t),this.headers=!0,this.crossOrigin=!0,this.withCredentials=!0,this.proxy=!0,this._geoprocessingJobsService=new $Re(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getTools(e){return this._geoprocessingJobsService.getTools(e)}getTool(e,t){return this._geoprocessingJobsService.getTool(e,t)}execute(e,t,r,i){return this._geoprocessingJobsService.execute(e,t,r,i)}submitJob(e,t,r,i){return this._geoprocessingJobsService.submitJob(e,t,r,i)}waitForJobCompletion(e,t,r,i){return this._geoprocessingJobsService.waitForJobCompletion(e,t,r,i)}getJobInfo(e,t,r){return this._geoprocessingJobsService.getJobInfo(e,t,r)}cancelJob(e,t,r){return this._geoprocessingJobsService.cancelJob(e,t,r)}getJobs(e,t){return this._geoprocessingJobsService.getJobs(e,t)}getResults(e,t,r,i){return this._geoprocessingJobsService.getResults(e,t,r,i)}}class r$r{constructor(e,t){this.url=e,this.options=t||{}}getLayersInfo(e){var t=this,r=new lDe(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers});return r.processAsync(e)}getLayersLegendInfo(e,t){var r=this,i=new FDe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}setLayerInfo(e,t){if(!!e){var r=this,i=e.resourceID,a=e.tempLayerName,o=e.layerInfo;if(!(!i||!a)){var s=H.urlPathAppend(r.url,"tempLayersSet/"+i+"/"+a),l=new WDe(s,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return l.processAsync(o,t)}}}setLayersInfo(e,t){if(!!e){var r=this,i=e.resourceID,a=e.isTempLayers?e.isTempLayers:!1,o=e.layersInfo;if(!(a&&!i||!o)){var s=new HDe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,resourceID:i,isTempLayers:a});return s.processAsync(o,t)}}}setLayerStatus(e,t){if(!!e){var r=this,i=new XDe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}}}class n$r extends _l{constructor(e,t){super(e,t),this._layerInfoService=new r$r(e,t)}getLayersInfo(e){return this._layerInfoService.getLayersInfo(e)}getLayersLegendInfo(e,t){return this._layerInfoService.getLayersLegendInfo(e,t)}setLayerInfo(e,t){return this._layerInfoService.setLayerInfo(e,t)}setLayersInfo(e,t){return this._layerInfoService.setLayersInfo(e,t)}setLayerStatus(e,t){return this._layerInfoService.setLayerStatus(e,t)}}class i$r extends _l{constructor(e,t){super(e,t)}measureDistance(e,t){return this.measure(e,"DISTANCE",t)}measureArea(e,t){return this.measure(e,"AREA",t)}measure(e,t,r){var i=this,a=new yDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,measureMode:t});return a.processAsync(i._processParam(e),r)}_processParam(e){return e&&e.geometry&&(e.geometry=br.toSuperMapGeometry(JSON.parse(new jc().writeGeometry(e.geometry)))),e}}class a$r{constructor(e,t){this.url=e,this.options=t||{}}sinksFacilityAnalyst(e,t){var r=this,i=new vRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}sourcesFacilityAnalyst(e,t){var r=this,i=new gRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}traceUpFacilityAnalyst(e,t){var r=this,i=new wRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}traceDownFacilityAnalyst(e,t){var r=this,i=new xRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}upstreamFacilityAnalyst(e,t){var r=this,i=new ERe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}}class o$r extends _l{constructor(e,t){super(e,t),this._networkAnalyst3DService=new a$r(e,t)}sinksFacilityAnalyst(e,t){return this._networkAnalyst3DService.sinksFacilityAnalyst(e,t)}sourcesFacilityAnalyst(e,t){return this._networkAnalyst3DService.sourcesFacilityAnalyst(e,t)}traceUpFacilityAnalyst(e,t){return this._networkAnalyst3DService.traceUpFacilityAnalyst(e,t)}traceDownFacilityAnalyst(e,t){return this._networkAnalyst3DService.traceDownFacilityAnalyst(e,t)}upstreamFacilityAnalyst(e,t){return this._networkAnalyst3DService.upstreamFacilityAnalyst(e,t)}}class s$r{constructor(e,t){this.url=e,this.options=t||{}}burstPipelineAnalyst(e,t){var r=this,i=new QOe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}computeWeightMatrix(e,t){var r=this,i=new sRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}findClosestFacilities(e,t,r){var i=this,a=new IRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}traceAnalyst(e,t,r){var i=this,a=new DDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}connectedEdgesAnalyst(e,t,r){var i=this,a=new kDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}streamFacilityAnalyst(e,t,r){var i=this,a=new mRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}findLocation(e,t,r){var i=this,a=new PRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}findPath(e,t,r){var i=this,a=new NRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}findTSPPaths(e,t,r){var i=this,a=new GRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}findMTSPPaths(e,t,r){var i=this,a=new RRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}findServiceAreas(e,t,r){var i=this,a=new FRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}updateEdgeWeight(e,t){var r=this,i=new dNe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}updateTurnNodeWeight(e,t){var r=this,i=new pNe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}_processFormat(e){return e||Ni.GEOJSON}}class l$r extends _l{constructor(e,t){super(e,t),this._networkAnalystService=new s$r(e,t)}burstPipelineAnalyst(e,t){return e=this._processParams(e),this._networkAnalystService.burstPipelineAnalyst(e,t)}computeWeightMatrix(e,t){return e=this._processParams(e),this._networkAnalystService.computeWeightMatrix(e,t)}findClosestFacilities(e,t,r){return e=this._processParams(e),this._networkAnalystService.findClosestFacilities(e,t,r)}traceAnalyst(e,t,r){return e=this._processParams(e),this._networkAnalystService.traceAnalyst(e,t,r)}connectedEdgesAnalyst(e,t,r){return e=this._processParams(e),this._networkAnalystService.connectedEdgesAnalyst(e,t,r)}streamFacilityAnalyst(e,t,r){return e=this._processParams(e),this._networkAnalystService.streamFacilityAnalyst(e,t,r)}findLocation(e,t,r){return e=this._processParams(e),this._networkAnalystService.findLocation(e,t,r)}findPath(e,t,r){return e=this._processParams(e),this._networkAnalystService.findPath(e,t,r)}findTSPPaths(e,t,r){return e=this._processParams(e),this._networkAnalystService.findTSPPaths(e,t,r)}findMTSPPaths(e,t,r){return e=this._processParams(e),this._networkAnalystService.findMTSPPaths(e,t,r)}findServiceAreas(e,t,r){return e=this._processParams(e),this._networkAnalystService.findServiceAreas(e,t,r)}updateEdgeWeight(e,t){return this._networkAnalystService.updateEdgeWeight(e,t)}updateTurnNodeWeight(e,t){return this._networkAnalystService.updateTurnNodeWeight(e,t)}_processParams(e){if(!e)return{};if(e.centers&&br.isArray(e.centers)&&e.centers.map(function(r,i){return e.centers[i]=r instanceof Qs?{x:r.getCoordinates()[0],y:r.getCoordinates()[1]}:r,e.centers[i]}),e.nodes&&br.isArray(e.nodes)&&e.nodes.map(function(r,i){return e.nodes[i]=r instanceof Qs?{x:r.getCoordinates()[0],y:r.getCoordinates()[1]}:r,e.nodes[i]}),e.event&&e.event instanceof Qs&&(e.event={x:e.event.getCoordinates()[0],y:e.event.getCoordinates()[1]}),e.facilities&&br.isArray(e.facilities)&&e.facilities.map(function(r,i){return e.facilities[i]=r instanceof Qs?{x:r.getCoordinates()[0],y:r.getCoordinates()[1]}:r,e.facilities[i]}),e.parameter&&e.parameter.barrierPoints){var t=e.parameter.barrierPoints;br.isArray(t)?t.map(function(r,i){return e.parameter.barrierPoints[i]=r instanceof Qs?{x:r.getCoordinates()[0],y:r.getCoordinates()[1]}:r,e.parameter.barrierPoints[i]}):e.parameter.barrierPoints=[t instanceof Qs?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t]}return e}_processFormat(e){return e||Ni.GEOJSON}}class u$r{constructor(e,t){this.url=e,this.options=t||{},this.kernelDensityJobs={},this.summaryMeshJobs={},this.queryJobs={},this.summaryRegionJobs={},this.vectorClipJobs={},this.overlayGeoJobs={},this.buffersJobs={},this.topologyValidatorJobs={},this.summaryAttributesJobs={}}getKernelDensityJobs(e,t){var r=this,i=r._processFormat(t),a=new oB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getKernelDensityJobs(e)}getKernelDensityJob(e,t,r){var i=this,a=i._processFormat(r),o=new oB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getKernelDensityJob(e,t)}addKernelDensityJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new oB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addKernelDensityJob(e,r,t,function(l){a.kernelDensityJobs[l.id]=l.state})}getKernelDensityJobState(e){return this.kernelDensityJobs[e]}getSummaryMeshJobs(e,t){var r=this,i=r._processFormat(t),a=new hB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getSummaryMeshJobs(e)}getSummaryMeshJob(e,t,r){var i=this,a=i._processFormat(r),o=new hB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getSummaryMeshJob(e,t)}addSummaryMeshJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new hB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addSummaryMeshJob(e,r,t,function(l){a.summaryMeshJobs[l.id]=l.state})}getSummaryMeshJobState(e){return this.summaryMeshJobs[e]}getQueryJobs(e,t){var r=this,i=r._processFormat(t),a=new lB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getQueryJobs(e)}getQueryJob(e,t,r){var i=this,a=i._processFormat(r),o=new lB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getQueryJob(e,t)}addQueryJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new lB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addQueryJob(e,r,t,function(l){a.queryJobs[l.id]=l.state})}getQueryJobState(e){return this.queryJobs[e]}getSummaryRegionJobs(e,t){var r=this,i=r._processFormat(t),a=new cB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getSummaryRegionJobs(e)}getSummaryRegionJob(e,t,r){var i=this,a=i._processFormat(r),o=new cB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getSummaryRegionJob(e,t)}addSummaryRegionJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new cB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addSummaryRegionJob(e,r,t,function(l){a.summaryRegionJobs[l.id]=l.state})}getSummaryRegionJobState(e){return this.summaryRegionJobs[e]}getVectorClipJobs(e,t){var r=this,i=r._processFormat(t),a=new dB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getVectorClipJobs(e)}getVectorClipJob(e,t,r){var i=this,a=i._processFormat(r),o=new dB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getVectorClipJob(e,t)}addVectorClipJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new dB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addVectorClipJob(e,r,t,function(l){a.vectorClipJobs[l.id]=l.state})}getVectorClipJobState(e){return this.vectorClipJobs[e]}getOverlayGeoJobs(e,t){var r=this,i=r._processFormat(t),a=new sB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getOverlayGeoJobs(e)}getOverlayGeoJob(e,t,r){var i=this,a=i._processFormat(r),o=new sB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getOverlayGeoJob(e,t)}addOverlayGeoJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new sB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addOverlayGeoJob(e,r,t,function(l){a.overlayGeoJobs[l.id]=l.state})}getoverlayGeoJobState(e){return this.overlayGeoJobs[e]}getBuffersJobs(e,t){var r=this,i=r._processFormat(t),a=new aB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getBuffersJobs(e)}getBuffersJob(e,t,r){var i=this,a=i._processFormat(r),o=new aB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getBuffersJob(e,t)}addBuffersJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new aB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addBuffersJob(e,r,t,function(l){a.buffersJobs[l.id]=l.state})}getBuffersJobState(e){return this.buffersJobs[e]}getTopologyValidatorJobs(e,t){var r=this,i=r._processFormat(t),a=new fB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getTopologyValidatorJobs(e)}getTopologyValidatorJob(e,t,r){var i=this,a=i._processFormat(r),o=new fB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getTopologyValidatorJob(e,t)}addTopologyValidatorJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new fB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addTopologyValidatorJob(e,r,t,function(l){a.topologyValidatorJobs[l.id]=l.state})}getTopologyValidatorJobState(e){return this.topologyValidatorJobs[e]}getSummaryAttributesJobs(e,t){var r=this,i=r._processFormat(t),a=new uB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getSummaryAttributesJobs(e)}getSummaryAttributesJob(e,t,r){var i=this,a=i._processFormat(r),o=new uB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getSummaryAttributesJob(e,t)}addSummaryAttributesJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new uB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addSummaryAttributesJob(e,r,t,function(l){a.summaryAttributesJobs[l.id]=l.state})}getSummaryAttributesJobState(e){return this.summaryAttributesJobs[e]}_processFormat(e){return e||Ni.GEOJSON}}class h$r extends _l{constructor(e,t){super(e,t),this._processingService=new u$r(e,t)}getKernelDensityJobs(e,t){return this._processingService.getKernelDensityJobs(e,t)}getKernelDensityJob(e,t,r){return this._processingService.getKernelDensityJob(e,t,r)}addKernelDensityJob(e,t,r,i){return e=this._processParams(e),this._processingService.addKernelDensityJob(e,t,r,i)}getKernelDensityJobState(e){return this._processingService.getKernelDensityJobState(e)}getSummaryMeshJobs(e,t){return this._processingService.getSummaryMeshJobs(e,t)}getSummaryMeshJob(e,t,r){return this._processingService.getSummaryMeshJob(e,t,r)}addSummaryMeshJob(e,t,r,i){return e=this._processParams(e),this._processingService.addSummaryMeshJob(e,t,r,i)}getSummaryMeshJobState(e){return this._processingService.getSummaryMeshJobState(e)}getQueryJobs(e,t){return this._processingService.getQueryJobs(e,t)}getQueryJob(e,t,r){return this._processingService.getQueryJob(e,t,r)}addQueryJob(e,t,r,i){return e=this._processParams(e),this._processingService.addQueryJob(e,t,r,i)}getQueryJobState(e){return this._processingService.getQueryJobState(e)}getSummaryRegionJobs(e,t){return this._processingService.getSummaryRegionJobs(e,t)}getSummaryRegionJob(e,t,r){return this._processingService.getSummaryRegionJob(e,t,r)}addSummaryRegionJob(e,t,r,i){return e=this._processParams(e),this._processingService.addSummaryRegionJob(e,t,r,i)}getSummaryRegionJobState(e){return this._processingService.getSummaryRegionJobState(e)}getVectorClipJobs(e,t){return this._processingService.getVectorClipJobs(e,t)}getVectorClipJob(e,t,r){return this._processingService.getVectorClipJob(e,t,r)}addVectorClipJob(e,t,r,i){return e=this._processParams(e),this._processingService.addVectorClipJob(e,t,r,i)}getVectorClipJobState(e){return this._processingService.getVectorClipJobState(e)}getOverlayGeoJobs(e,t){return this._processingService.getOverlayGeoJobs(e,t)}getOverlayGeoJob(e,t,r){return this._processingService.getOverlayGeoJob(e,t,r)}addOverlayGeoJob(e,t,r,i){return e=this._processParams(e),this._processingService.addOverlayGeoJob(e,t,r,i)}getoverlayGeoJobState(e){return this._processingService.getoverlayGeoJobState(e)}getBuffersJobs(e,t){return this._processingService.getBuffersJobs(e,t)}getBuffersJob(e,t,r){return this._processingService.getBuffersJob(e,t,r)}addBuffersJob(e,t,r,i){return e=this._processParams(e),this._processingService.addBuffersJob(e,t,r,i)}getBuffersJobState(e){return this._processingService.getBuffersJobState(e)}getTopologyValidatorJobs(e,t){return this._processingService.getTopologyValidatorJobs(e,t)}getTopologyValidatorJob(e,t,r){return this._processingService.getTopologyValidatorJob(e,t,r)}addTopologyValidatorJob(e,t,r,i){return e=this._processParams(e),this._processingService.addTopologyValidatorJob(e,t,r,i)}getTopologyValidatorJobState(e){return this._processingService.getTopologyValidatorJobState(e)}getSummaryAttributesJobs(e,t){return this._processingService.getSummaryAttributesJobs(e,t)}getSummaryAttributesJob(e,t,r){return this._processingService.getSummaryAttributesJob(e,t,r)}addSummaryAttributesJob(e,t,r,i){return e=this._processParams(e),this._processingService.addSummaryAttributesJob(e,t,r,i)}getSummaryAttributesJobState(e){return this._processingService.getSummaryAttributesJobState(e)}_processFormat(e){return e||Ni.GEOJSON}_processParams(e){return e?(e.bounds&&(e.bounds=br.toSuperMapBounds(e.bounds)),e.query&&(e.query=br.toSuperMapBounds(e.query)),e.geometryQuery&&(e.geometryQuery=br.toProcessingParam(e.geometryQuery)),e.geometryClip&&(e.geometryClip=br.toProcessingParam(e.geometryClip)),e):{}}}class c$r{constructor(e,t){this.url=e,this.options=t||{}}getAreaSolarRadiationResult(e,t,r){var i=this,a=new YOe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}bufferAnalysis(e,t,r){var i=this,a=new ZOe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}densityAnalysis(e,t,r){var i=this,a=new fRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}generateSpatialData(e,t,r){var i=this,a=new URe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}geoRelationAnalysis(e,t,r){var i=this,a=new HRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}interpolationAnalysis(e,t,r){var i=this,a=new dDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}mathExpressionAnalysis(e,t,r){var i=this,a=new pDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}overlayAnalysis(e,t,r){var i=this,a=new mDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}routeCalculateMeasure(e,t,r){var i=this,a=new zDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}routeLocate(e,t,r){var i=this,a=new VDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}surfaceAnalysis(e,t,r){var i=this,a=new eNe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}terrainCurvatureCalculate(e,t,r){var i=this,a=new tNe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}terrainCutFillCalculate(e,t,r){var i=this,a=new IDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}terrainAspectCalculate(e,t,r){var i=this,a=new LDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}terrainSlopeCalculate(e,t,r){var i=this,a=new PDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}thiessenAnalysis(e,t,r){var i=this,a=new iNe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}minDistanceAnalysis(e,t,r){var i=this,a=new MDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}convexHullAnalysis(e,t,r){var i=this,a=new ODe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}geometrybatchAnalysis(e,t,r){for(var i=this,a=new aNe(i.url,{format:i._processFormat(r)}),o=[],s=0;s0&&h.length>0;)p=h.pop(),i=l.pop(),o=u.pop(),y=p.toString(),y in c||(r.push(o[0],o[1]),c[y]=!0),g=h.pop(),a=l.pop(),s=u.pop(),m=(p+g)/2,d=n(m),v=e(d),kje(v[0],v[1],o[0],o[1],s[0],s[1])this.featurePool_.length;)f=new d0,this.featurePool_.push(f);var d=a.getFeaturesCollection();d.clear();var v=0,p,g;for(p=0,g=this.meridians_.length;pMath.PI/2;d=d!==g}for(var m=rXe(t),y=c;y<=f;++y){var _=this.meridians_.length+this.parallels_.length,x=void 0,S=void 0,w=void 0,b=void 0;if(this.meridiansLabels_)for(S=0,w=this.meridiansLabels_.length;S=u?(t[0]=l[0],t[2]=l[2]):s=!0);var h=[Ui(r[0],this.minX_,this.maxX_),Ui(r[1],this.minY_,this.maxY_)],c=this.toLonLatTransform_(h);isNaN(c[1])&&(c[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);var f=Ui(c[0],this.minLon_,this.maxLon_),d=Ui(c[1],this.minLat_,this.maxLat_),v=this.maxLines_,p,g,m,y,_=t;s||(_=[Ui(t[0],this.minX_,this.maxX_),Ui(t[1],this.minY_,this.maxY_),Ui(t[2],this.minX_,this.maxX_),Ui(t[3],this.minY_,this.maxY_)]);var x=bte(_,this.toLonLatTransform_,void 0,8),S=x[3],w=x[2],b=x[1],E=x[0];if(s||(dv(_,this.bottomLeft_)&&(E=this.minLon_,b=this.minLat_),dv(_,this.bottomRight_)&&(w=this.maxLon_,b=this.minLat_),dv(_,this.topLeft_)&&(E=this.minLon_,S=this.maxLat_),dv(_,this.topRight_)&&(w=this.maxLon_,S=this.maxLat_),S=Ui(S,d,this.maxLat_),w=Ui(w,f,this.maxLon_),b=Ui(b,this.minLat_,d),E=Ui(E,this.minLon_,f)),f=Math.floor(f/o)*o,y=Ui(f,this.minLon_,this.maxLon_),g=this.addMeridian_(y,b,S,a,t,0),p=0,s)for(;(y-=o)>=E&&p++a[s]&&(o=s,s=1);var l=Math.max(r[1],a[o]),u=Math.min(r[3],a[s]),h=Ui(r[1]+Math.abs(r[1]-r[3])*this.lonLabelPosition_,l,u),c=a[o-1]+(a[s-1]-a[o-1])*(h-a[o])/(a[s]-a[o]),f=[c,h],d=this.meridiansLabels_[i].geom;return d.setCoordinates(f),d},e.prototype.getMeridians=function(){return this.meridians_},e.prototype.getParallel_=function(t,r,i,a,o){var s=b$r(t,r,i,this.projection_,a),l=this.parallels_[o];return l?(l.setFlatCoordinates(Ro.XY,s),l.changed()):l=new gm(s,Ro.XY),l},e.prototype.getParallelPoint_=function(t,r,i){var a=t.getFlatCoordinates(),o=0,s=a.length-2;a[o]>a[s]&&(o=s,s=0);var l=Math.max(r[0],a[o]),u=Math.min(r[2],a[s]),h=Ui(r[0]+Math.abs(r[0]-r[2])*this.latLabelPosition_,l,u),c=a[o+1]+(a[s+1]-a[o+1])*(h-a[o])/(a[s]-a[o]),f=[h,c],d=this.parallelsLabels_[i].geom;return d.setCoordinates(f),d},e.prototype.getParallels=function(){return this.parallels_},e.prototype.updateProjectionInfo_=function(t){var r=ya("EPSG:4326"),i=t.getWorldExtent();this.maxLat_=i[3],this.maxLon_=i[2],this.minLat_=i[1],this.minLon_=i[0];var a=__(t,r);if(this.minLon_=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t},e}(Sy);const M$r=A$r;var nz=34962,$ce=34963,I$r=35040,L$r=35044,L8=35048,P$r=5121,O$r=5123,R$r=5125,EQe=5126,sPe=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function TQe(n,e){for(var t=Ao({preserveDrawingBuffer:!0,antialias:!V0r},e),r=sPe.length,i=0;i0))){var t=e.canvas,r=TQe(t),i=r.getExtension("WEBGL_lose_context");i&&i.loseContext(),delete iz[n]}}var W$r=function(n){z$r(e,n);function e(t){var r=n.call(this)||this,i=t||{};r.boundHandleWebGLContextLost_=r.handleWebGLContextLost.bind(r),r.boundHandleWebGLContextRestored_=r.handleWebGLContextRestored.bind(r),r.canvasCacheKey_=i.canvasCacheKey?uPe(i.canvasCacheKey):U$r(),r.canvas_=V$r(r.canvasCacheKey_),r.gl_=TQe(r.canvas_),r.bufferCache_={},r.extensionCache_={},r.currentProgram_=null,r.canvas_.addEventListener(K6.LOST,r.boundHandleWebGLContextLost_),r.canvas_.addEventListener(K6.RESTORED,r.boundHandleWebGLContextRestored_),r.offsetRotateMatrix_=Nu(),r.offsetScaleMatrix_=Nu(),r.tmpMat4_=G$r(),r.uniformLocations_={},r.attribLocations_={},r.uniforms_=[],i.uniforms&&r.setUniforms(i.uniforms);var a=r.getGL();return r.postProcessPasses_=i.postProcesses?i.postProcesses.map(function(o){return new lPe({webGlContext:a,scaleRatio:o.scaleRatio,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,uniforms:o.uniforms})}):[new lPe({webGlContext:a})],r.shaderCompileErrors_=null,r.startTime_=Date.now(),r}return e.prototype.setUniforms=function(t){this.uniforms_=[];for(var r in t)this.uniforms_.push({name:r,value:t[r]});this.uniformLocations_={}},e.prototype.canvasCacheKeyMatches=function(t){return this.canvasCacheKey_===uPe(t)},e.prototype.getExtension=function(t){if(t in this.extensionCache_)return this.extensionCache_[t];var r=this.gl_.getExtension(t);return this.extensionCache_[t]=r,r},e.prototype.bindBuffer=function(t){var r=this.getGL(),i=vi(t),a=this.bufferCache_[i];if(!a){var o=r.createBuffer();a={buffer:t,webGlBuffer:o},this.bufferCache_[i]=a}r.bindBuffer(t.getType(),a.webGlBuffer)},e.prototype.flushBufferData=function(t){var r=this.getGL();this.bindBuffer(t),r.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var r=this.getGL(),i=vi(t),a=this.bufferCache_[i];a&&!r.isContextLost()&&r.deleteBuffer(a.webGlBuffer),delete this.bufferCache_[i]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(K6.LOST,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(K6.RESTORED,this.boundHandleWebGLContextRestored_),$$r(this.canvasCacheKey_),delete this.gl_,delete this.canvas_},e.prototype.prepareDraw=function(t,r){var i=this.getGL(),a=this.getCanvas(),o=t.size,s=t.pixelRatio;a.width=o[0]*s,a.height=o[1]*s,a.style.width=o[0]+"px",a.style.height=o[1]+"px",i.useProgram(this.currentProgram_);for(var l=this.postProcessPasses_.length-1;l>=0;l--)this.postProcessPasses_[l].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,r?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,r,i){var a=this.getGL(),o=r.getSize();a.bindFramebuffer(a.FRAMEBUFFER,r.getFramebuffer()),a.viewport(0,0,o[0],o[1]),a.bindTexture(a.TEXTURE_2D,r.getTexture()),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),a.enable(a.BLEND),a.blendFunc(a.ONE,i?a.ZERO:a.ONE_MINUS_SRC_ALPHA),a.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,r){var i=this.getGL();this.getExtension("OES_element_index_uint");var a=i.UNSIGNED_INT,o=4,s=r-t,l=t*o;i.drawElements(i.TRIANGLES,s,a,l)},e.prototype.finalizeDraw=function(t,r,i){for(var a=0,o=this.postProcessPasses_.length;athis.size_[0]||t>=this.size_[1])return dy[0]=0,dy[1]=0,dy[2]=0,dy[3]=0,dy;this.readAll();var r=Math.floor(e)+(this.size_[1]-Math.floor(t)-1)*this.size_[0];return dy[0]=this.data_[r*4],dy[1]=this.data_[r*4+1],dy[2]=this.data_[r*4+2],dy[3]=this.data_[r*4+3],dy},n.prototype.getTexture=function(){return this.texture_},n.prototype.getFramebuffer=function(){return this.framebuffer_},n.prototype.updateSize_=function(){var e=this.size_,t=this.helper_.getGL();this.texture_=this.helper_.createTexture(e,null,this.texture_),t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer_),t.viewport(0,0,e[0],e[1]),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(e[0]*e[1]*4)},n}();const J$r=K$r;function Q$r(){var n='var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r"u"?"data:application/javascript;base64,"+Buffer.from(n,"binary").toString("base64"):URL.createObjectURL(new Blob([n],{type:"application/javascript"})))}var eWr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),tWr=function(n){eWr(e,n);function e(t,r){var i=this,a=r.uniforms||{},o=Nu();a[oA.PROJECTION_MATRIX]=o,i=n.call(this,t,{uniforms:a,postProcesses:r.postProcesses})||this,i.ready=!1,i.sourceRevision_=-1,i.verticesBuffer_=new OZ(nz,L8),i.hitVerticesBuffer_=new OZ(nz,L8),i.indicesBuffer_=new OZ($ce,L8),i.vertexShader_=r.vertexShader,i.fragmentShader_=r.fragmentShader,i.program_,i.hitDetectionEnabled_=!!(r.hitFragmentShader&&r.hitVertexShader),i.hitVertexShader_=r.hitVertexShader,i.hitFragmentShader_=r.hitFragmentShader,i.hitProgram_;var s=r.attributes?r.attributes.map(function(u){return{name:"a_"+u.name,size:1,type:Wg.FLOAT}}):[];i.attributes=[{name:"a_position",size:2,type:Wg.FLOAT},{name:"a_index",size:1,type:Wg.FLOAT}].concat(s),i.hitDetectionAttributes=[{name:"a_position",size:2,type:Wg.FLOAT},{name:"a_index",size:1,type:Wg.FLOAT},{name:"a_hitColor",size:4,type:Wg.FLOAT},{name:"a_featureUid",size:1,type:Wg.FLOAT}].concat(s),i.customAttributes=r.attributes?r.attributes:[],i.previousExtent_=Md(),i.currentTransform_=o,i.renderTransform_=Nu(),i.invertRenderTransform_=Nu(),i.renderInstructions_=new Float32Array(0),i.hitRenderInstructions_=new Float32Array(0),i.hitRenderTarget_,i.generateBuffersRun_=0,i.worker_=Q$r(),i.worker_.addEventListener("message",function(u){var h=u.data;if(h.type===DZ.GENERATE_BUFFERS){var c=h.projectionTransform;h.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(h.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(h.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(h.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=c,bk(this.invertRenderTransform_,this.renderTransform_),h.hitDetection?this.hitRenderInstructions_=new Float32Array(u.data.renderInstructions):(this.renderInstructions_=new Float32Array(u.data.renderInstructions),h.generateBuffersRun===this.generateBuffersRun_&&(this.ready=!0)),this.getLayer().changed()}}.bind(i)),i.featureCache_={},i.featureCount_=0;var l=i.getLayer().getSource();return i.sourceListenKeys_=[pa(l,yf.ADDFEATURE,i.handleSourceFeatureAdded_,i),pa(l,yf.CHANGEFEATURE,i.handleSourceFeatureChanged_,i),pa(l,yf.REMOVEFEATURE,i.handleSourceFeatureDelete_,i),pa(l,yf.CLEAR,i.handleSourceFeatureClear_,i)],l.forEachFeature(function(u){this.featureCache_[vi(u)]={feature:u,properties:u.getProperties(),geometry:u.getGeometry()},this.featureCount_++}.bind(i)),i}return e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitProgram_=this.helper.getProgram(this.hitFragmentShader_,this.hitVertexShader_),this.hitRenderTarget_=new J$r(this.helper))},e.prototype.handleSourceFeatureAdded_=function(t){var r=t.feature;this.featureCache_[vi(r)]={feature:r,properties:r.getProperties(),geometry:r.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var r=t.feature;this.featureCache_[vi(r)]={feature:r,properties:r.getProperties(),geometry:r.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var r=t.feature;delete this.featureCache_[vi(r)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){var r=this.helper.getGL();this.preRender(r,t);var i=this.indicesBuffer_.getSize();this.helper.drawElements(0,i),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);var a=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),this.postRender(r,t),a},e.prototype.prepareFrameInternal=function(t){var r=this.getLayer(),i=r.getSource(),a=t.viewState,o=!t.viewHints[Gs.ANIMATING]&&!t.viewHints[Gs.INTERACTING],s=!m_(this.previousExtent_,t.extent),l=this.sourceRevision_0&&(this.newTiles_=!0):h.setState(Xr.LOADED)),this.isDrawableTile(h)||(h=h.getInterimTile()),h},e.prototype.getData=function(t){var r=this.frameState;if(!r)return null;var i=this.getLayer(),a=ks(r.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!dv(o,a))return null;for(var s=r.pixelRatio,l=r.viewState.projection,u=r.viewState,h=i.getRenderSource(),c=h.getTileGridForProjection(u.projection),f=h.getTilePixelRatio(r.pixelRatio),d=c.getZForResolution(u.resolution);d>=c.getMinZoom();--d){var v=c.getTileCoordForCoordAndZ(a,d),p=h.getTile(d,v[1],v[2],s,l);if(!(p instanceof Iqe||p instanceof Dqe))return null;if(p.getState()===Xr.LOADED){var g=c.getOrigin(d),m=nh(c.getTileSize(d)),y=c.getResolution(d),_=Math.floor(f*((a[0]-g[0])/y-v[1]*m[0])),x=Math.floor(f*((g[1]-a[1])/y-v[2]*m[1]));return this.getImageData(p.getImage(),_,x)}}return null},e.prototype.loadedTileCallback=function(t,r,i){return this.isDrawableTile(i)?n.prototype.loadedTileCallback.call(this,t,r,i):!1},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,r){var i=t.layerStatesArray[t.layerIndex],a=t.viewState,o=a.projection,s=a.resolution,l=a.center,u=a.rotation,h=t.pixelRatio,c=this.getLayer(),f=c.getSource(),d=f.getRevision(),v=f.getTileGridForProjection(o),p=v.getZForResolution(s,f.zDirection),g=v.getResolution(p),m=t.extent,y=i.extent&&F1(i.extent);y&&(m=tm(m,F1(i.extent)));var _=f.getTilePixelRatio(h),x=Math.round(t.size[0]*_),S=Math.round(t.size[1]*_);if(u){var w=Math.round(Math.sqrt(x*x+S*S));x=w,S=w}var b=g*x/2/_,E=g*S/2/_,T=[l[0]-b,l[1]-E,l[0]+b,l[1]+E],C=v.getTileRangeForExtentAndZ(m,p),A={};A[p]={};var M=this.createLoadedTileFinder(f,o,A),I=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(var k=C.minX;k<=C.maxX;++k)for(var D=C.minY;D<=C.maxY;++D){var G=this.getTile(p,k,D,t);if(this.isDrawableTile(G)){var W=vi(this);if(G.getState()==Xr.LOADED){A[p][G.tileCoord.toString()]=G;var z=G.inTransition(W);!this.newTiles_&&(z||this.renderedTiles.indexOf(G)===-1)&&(this.newTiles_=!0)}if(G.getAlpha(W,t.time)===1)continue}var V=v.getTileCoordChildTileRange(G.tileCoord,R,I),q=!1;V&&(q=M(p+1,V)),q||v.forEachTileCoordParentTileRange(G.tileCoord,M,R,I)}var Y=g/s;Id(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/_,1/_,u,-x/2,-S/2);var le=gue(this.pixelTransform);this.useContainer(r,le,i.opacity,this.getBackground(t));var j=this.context,Q=j.canvas;bk(this.inversePixelTransform,this.pixelTransform),Id(this.tempTransform,x/2,S/2,Y,Y,0,-x/2,-S/2),Q.width!=x||Q.height!=S?(Q.width=x,Q.height=S):this.containerReused||j.clearRect(0,0,x,S),y&&this.clipUnrotated(j,t,y),f.getInterpolate()||Ao(j,w7),this.preRender(j,t),this.renderedTiles.length=0;var ie=Object.keys(A).map(Number);ie.sort(f2);var oe,se,me;i.opacity===1&&(!this.containerReused||f.getOpaque(t.viewState.projection))?ie=ie.reverse():(oe=[],se=[]);for(var Ce=ie.length-1;Ce>=0;--Ce){var Le=ie[Ce],re=f.getTilePixelSize(Le,h,o),yt=v.getResolution(Le),je=yt/g,st=re[0]*je*Y,Nt=re[1]*je*Y,Zt=v.getTileCoordForCoordAndZ(Lw(T),Le),qe=v.getTileCoordExtent(Zt),ur=ks(this.tempTransform,[_*(qe[0]-T[0])/g,_*(T[3]-qe[3])/g]),Dt=_*f.getGutterForProjection(o),ft=A[Le];for(var Oe in ft){var G=ft[Oe],J=G.tileCoord,We=Zt[1]-J[1],Tt=Math.round(ur[0]-(We-1)*st),Qe=Zt[2]-J[2],zt=Math.round(ur[1]-(Qe-1)*Nt),k=Math.round(ur[0]-We*st),D=Math.round(ur[1]-Qe*Nt),mt=Tt-k,wt=zt-D,pt=p===Le,z=pt&&G.getAlpha(vi(this),t.time)!==1,ar=!1;if(!z)if(oe){me=[k,D,k+mt,D,k+mt,D+wt,k,D+wt];for(var kt=0,Dr=oe.length;kt0){r([]);return}var y=c.getTileCoordExtent(v.wrappedTileCoord),_=Lw(y),x=[(f[0]-_[0])/h,(_[1]-f[1])/h],S=v.getSourceTiles().reduce(function(C,A){return C.concat(A.getFeatures())},[]),w=v.hitDetectionImageData[o];if(!w&&!this.animatingOrInteracting_){var b=nh(c.getTileSize(c.getZForResolution(h))),E=this.renderedRotation_,T=[this.getRenderTransform(c.getTileCoordCenter(v.wrappedTileCoord),h,0,uv,b[0]*uv,b[1]*uv,0)];w=yXe(b,T,S,a.getStyleFunction(),c.getTileCoordExtent(v.wrappedTileCoord),v.getReplayState(a).renderedResolution,E),v.hitDetectionImageData[o]=w}r(mXe(x,S,w))}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.renderedLayerRevision_!==void 0&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var r=this.context,i=r.globalAlpha;r.globalAlpha=this.getLayer().getOpacity();for(var a=t.viewHints,o=!(a[Gs.ANIMATING]||a[Gs.INTERACTING]),s=this.renderedTiles,l=0,u=s.length;l=0;--f)c[f].execute(this.context,1,this.getTileRenderTransform(h,t),t.viewState.rotation,o,void 0,t.declutterTree)}r.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,r){var i=r.pixelRatio,a=r.viewState,o=a.center,s=a.resolution,l=a.rotation,u=r.size,h=Math.round(u[0]*i),c=Math.round(u[1]*i),f=this.getLayer().getSource(),d=f.getTileGridForProjection(r.viewState.projection),v=t.tileCoord,p=d.getTileCoordExtent(t.wrappedTileCoord),g=d.getTileCoordExtent(v,this.tmpExtent)[0]-p[0],m=nL(LR(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(o,s,l,i,h,c,g));return m},e.prototype.renderFrame=function(t,r){var i=t.viewHints,a=!(i[Gs.ANIMATING]||i[Gs.INTERACTING]);n.prototype.renderFrame.call(this,t,r),this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation;var o=this.getLayer(),s=o.getRenderMode(),l=this.context,u=l.globalAlpha;l.globalAlpha=o.getOpacity();for(var h=cWr[s],c=t.viewState,f=c.rotation,d=o.getSource(),v=d.getTileGridForProjection(c.projection),p=v.getZForResolution(c.resolution,d.zDirection),g=this.renderedTiles,m=[],y=[],_=g.length-1;_>=0;--_){var x=g[_],S=x.executorGroups[vi(o)].filter(function(D){return D.hasExecutors(h)});if(S.length!==0){for(var w=this.getTileRenderTransform(x,t),b=x.tileCoord[0],E=!1,T=S[0].getClipCoords(w),C=0,A=m.length;C=0},e.prototype.tileUrlFunction=function(t,r,i){var a=this.getTileGrid();if(a||(a=this.getTileGridForProjection(i)),!(a.getResolutions().length<=t[0])){r!=1&&(!this.hidpi_||this.serverType_===void 0)&&(r=1);var o=a.getResolution(t[0]),s=a.getTileCoordExtent(t,this.tmpExtent_),l=nh(a.getTileSize(t[0]),this.tmpSize),u=this.gutter_;u!==0&&(l=cTe(l,u,this.tmpSize),s=f0(s,o*u,s)),r!=1&&(l=hXe(l,r,this.tmpSize));var h={SERVICE:"WMS",VERSION:J6,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return Ao(h,this.params_),this.getRequestUrl_(t,l,s,r,i,h)}},e}(Fk);const cjr=hjr;var fjr=200,jce="__lodash_hash_undefined__",djr=9007199254740991,vjr="[object Arguments]",pjr="[object Function]",gjr="[object GeneratorFunction]",yjr=/[\\^$.*+?()[\]{}|]/g,mjr=/^\[object .+?Constructor\]$/,_jr=typeof at=="object"&&at&&at.Object===Object&&at,xjr=typeof self=="object"&&self&&self.Object===Object&&self,Xce=_jr||xjr||Function("return this")();function Sjr(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function wjr(n,e){var t=n?n.length:0;return!!t&&Ajr(n,e,0)>-1}function bjr(n,e,t){for(var r=-1,i=n?n.length:0;++r-1}function Yjr(n,e){var t=this.__data__,r=W$(t,n);return r<0?t.push([n,e]):t[r][1]=e,this}EL.prototype.clear=Wjr;EL.prototype.delete=Hjr;EL.prototype.get=jjr;EL.prototype.has=Xjr;EL.prototype.set=Yjr;function TL(n){var e=-1,t=n?n.length:0;for(this.clear();++e=fjr&&(a=Ljr,o=!1,e=new oz(e));e:for(;++i0&&t(s)?e>1?kQe(s,e-1,t,r,i):Tjr(i,s):r||(i[i.length]=s)}return i}function nXr(n){if(!GQe(n)||sXr(n))return!1;var e=BQe(n)||Ojr(n)?Njr:mjr;return e.test(lXr(n))}function iXr(n,e){return e=yPe(e===void 0?n.length-1:e,0),function(){for(var t=arguments,r=-1,i=yPe(t.length-e,0),a=Array(i);++r-1&&n%1==0&&n<=djr}function GQe(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function pXr(n){return!!n&&typeof n=="object"}var gXr=uXr;window.proj4=Bu;window.Proj4js=Bu;const eB=new jc,yXr=1e3,mPe={DEGREES:2*Math.PI*6370997/360,DEGREE:2*Math.PI*6370997/360,FEET:.3048,METERS:1,METER:1,M:1,USFEET:1200/3937},ZP={default:96,iServerWMTS:90.7142857142857};class mXr extends fT{constructor(e,t){super(),br.isObject(e)?(t=e,this.mapId=t.id):this.mapId=e,t=t||{},this.server=t.server,this.successCallback=t.successCallback,this.errorCallback=t.errorCallback,this.credentialKey=t.credentialKey,this.credentialValue=t.credentialValue,this.withCredentials=t.withCredentials||!1,this.target=t.target||"map",this.excludePortalProxyUrl=t.excludePortalProxyUrl||!1,this.serviceProxy=t.serviceProxy||null,this.tiandituKey=t.tiandituKey,this.googleMapsAPIKey=t.googleMapsAPIKey||"",this.proxy=t.proxy,this.layerAdded=0,this.layers=[],this.events=new y0(this,null,["updateDataflowFeature"],!0),this.webMap=t.webMap,this.tileFormat=t.tileFormat&&t.tileFormat.toLowerCase(),this.restDataSingleRequestCount=t.restDataSingleRequestCount||1e3,this.createMap(t.mapSetting),this.webMap?br.isString(this.webMap)?this.createWebmap(this.webMap):this.getMapInfoSuccess(t.webMap):this.createWebmap()}_removeBaseLayer(){const e=this.map,{layer:t,labelLayer:r}=this.baseLayer;r&&e.removeLayer(r),t&&e.removeLayer(t),this.baseLayer=null}_removeLayers(){const e=this.map;this.layers.forEach(({layerType:t,layer:r,labelLayer:i,pathLayer:a,dataflowService:o})=>{if(!!r){if(t==="MIGRATION"){r.remove();return}(t==="DATAFLOW_POINT_TRACK"||t==="DATAFLOW_HEAT")&&(a&&e.removeLayer(a),o&&o.unSubscribe()),i&&e.removeLayer(i),e.removeLayer(r)}}),this.layers=[]}_clear(){this.scales=[],this.resolutionArray=[],this.resolutions={},this.layerAdded=0,this._removeBaseLayer(),this._removeLayers()}refresh(){this._clear(),this.createWebmap()}createMap(e){let t,r,i;e&&(i=e.interactions,t=e.overlays,r=e.controls),this.map=new EA({interactions:i,overlays:t,controls:r,target:this.target}),e&&this.registerMapEvent({mapClickCallback:e.mapClickCallback})}registerMapEvent(e){this.map.on("click",function(r){e.mapClickCallback&&e.mapClickCallback(r)})}createWebmap(e){let t;if(e)t=e;else{let r=this.server.split("");r[r.length-1]!=="/"&&(this.server+="/"),t=this.server+"web/maps/"+this.mapId+"/map";let i="getUrlResource.json?url=";if(this.excludePortalProxyUrl&&this.server.indexOf(i)>-1){let a=this.server.split(i);a.length>1&&(t=a[0]+i+this.server+"web/maps/"+this.mapId+"/map.json")}}this.getMapInfo(t)}getMapInfo(e){let t=this,r=e;e.indexOf(".json")===-1&&(e=this.handleJSONSuffix(e),r=e),li.get(t.getRequestUrl(r),null,{withCredentials:this.withCredentials}).then(function(i){return i.json()}).then(function(i){t.getMapInfoSuccess(i)}).catch(function(i){t.errorCallback&&t.errorCallback(i,"getMapFaild",t.map)})}async getMapInfoSuccess(e){let t=this;if(e.succeed===!1){t.errorCallback&&t.errorCallback(e.error,"getMapFaild",t.map);return}let r=await t.handleCRS(e.projection,e.baseLayer.url);if(t.mapParams={title:e.title,description:e.description},r.action==="BrowseMap")t.createSpecLayer(e);else if(r.action==="OpenMap")t.baseProjection=r.newCrs||e.projection,t.webMapVersion=e.version,t.baseLayer=e.baseLayer,t.isHaveGraticule=e.grid&&e.grid.graticule,e.baseLayer&&e.baseLayer.layerType==="MAPBOXSTYLE"?t.addMVTMapLayer(e,e.baseLayer,0).then(async()=>{t.createView(e),!e.layers||e.layers.length===0?t.sendMapToUser(0):await t.addLayers(e),t.addGraticule(e)}).catch(function(i){t.errorCallback&&t.errorCallback(i,"getMapFaild",t.map)}):(await t.addBaseMap(e),!e.layers||e.layers.length===0?t.sendMapToUser(0):await t.addLayers(e),t.addGraticule(e));else{t.errorCallback&&t.errorCallback({type:"Not support CS",errorMsg:`Not support CS: ${e.projection}`},"getMapFaild",t.map);return}}async handleCRS(e,t){let r=this,i={},a=e,o="OpenMap";return this.isCustomProjection(e)?await li.get(r.getRequestUrl(`${t}/prjCoordSys.wkt`),null,{withCredentials:r.withCredentials,withoutFormatSuffix:!0}).then(function(s){return s.text()}).then(async function(s){if(s.indexOf("")===-1)r.addProjctionFromWKT(s,e),i={action:o,newCrs:a};else throw"ERROR"}).catch(function(){o="BrowseMap",i={action:o,newCrs:a}}):(e.indexOf("EPSG")===0&&e.split(":")[1]<=0?o="BrowseMap":e==="EPSG:910111"||e==="EPSG:910112"?a="EPSG:3857":e==="EPSG:910101"||e==="EPSG:910102"?a="EPSG:4326":e.indexOf("EPSG")!==0&&(r.addProjctionFromWKT(a),a=r.getEpsgInfoFromWKT(e)),i={action:o,newCrs:a}),i}getScales(e){let t=[],r={},i,a,o=[],s=e.coordUnit||ya(e.projection).getUnits();if(s||(s=this.baseProjection=="EPSG:3857"?"m":"degree"),e.visibleScales&&e.visibleScales.length>0)e.visibleScales.forEach(l=>{let u=1/l;i=this.getResFromScale(u,s),l=`1:${u}`,r[this.formatScale(l)]=i,o.push(i),t.push(l)},this);else if(e.layerType==="WMTS")e.scales.forEach(l=>{i=this.getResFromScale(l,s,90.7),l=`1:${l}`,r[this.formatScale(l)]=i,o.push(i),t.push(l)},this);else{let{minZoom:l=0,maxZoom:u=22}=e,h=this.map.getView();for(let c=l;c<=u;c++)if(i=h.getResolutionForZoom(c),a=this.getScaleFromRes(i,s),t.indexOf(a)===-1){t.push(a);let f=a.replace(/,/g,"");r[f]=i,o.push(i)}}this.scales=t,this.resolutions=r,this.resolutionArray=o}getResFromScale(e,t="DEGREE",r=96){let i=mPe[t.toUpperCase()];return e*.0254/r/i}getScaleFromRes(e,t="DEGREE",r=96){let i,a=mPe[t.toUpperCase()];return i=e*r*a/.0254,"1:"+i}formatScale(e){return e.replace(/,/g,"")}createSpecLayer(e){let t=this,r=e.baseLayer,i=r.url,a=r.layerType,o=[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y],s=new ew({extent:o,units:"m",code:"EPSG:0"});fue(s);let l={center:e.center,level:0};t.baseProjection=s;let u={center:l.center?[l.center.x,l.center.y]:[0,0],zoom:0,projection:s};["4","5"].indexOf(br.getOlVersion())<0&&(u.multiWorld=!0);let h=new Lp(u);t.map.setView(h),t.mapParams&&(t.mapParams.extent=o,t.mapParams.projection=e.projection),i&&i.indexOf("?token=")>-1&&(t.credentialKey="token",t.credentialValue=e.baseLayer.credential=i.split("?token=")[1],i=i.split("?token=")[0]);let c;a==="TILE"?(i=this.handleJSONSuffix(i),li.get(t.getRequestUrl(i),null,{withCredentials:this.withCredentials}).then(function(f){return f.json()}).then(function(f){r.originResult=f;let d="IPORTAL",v=r.credential,p="Token",g=r.url;(r.url.indexOf("www.supermapol.com")>-1||r.url.indexOf("itest.supermapol.com")>-1)&&(p="Key",g=[g],d="ONLINE"),v&&xs[`register${p}`](g,v);let m={serverType:d,url:i,tileGrid:Bp.optionsFromMapJSON(i,f).tileGrid};i&&!H.isInTheSameDomain(i)&&!this.isIportalProxyServiceUrl(i)&&(m.tileProxy=t.server+"apps/viewer/getUrlResource.png?url="),c=new Bp(m),t.addSpecToMap(c)}).catch(function(f){t.errorCallback&&t.errorCallback(f,"getMapFaild",t.map)})):a==="WMS"?(c=t.createWMSSource(r),t.addSpecToMap(c)):a==="WMTS"?li.get(t.getRequestUrl(i,!0),null,{withCredentials:this.withCredentials}).then(function(f){return f.text()}).then(function(f){r.extent=[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y],r.scales=t.getWMTSScales(r.tileMatrixSet,f),r.dpi=ZP.iServerWMTS,c=t.createWMTSSource(r),t.addSpecToMap(c)}).catch(function(f){t.errorCallback&&t.errorCallback(f,"getMapFaild",t.map)}):t.errorCallback&&t.errorCallback({type:"Not support CS",errorMsg:`Not support CS: ${a}`},"getMapFaild",t.map),h&&h.fit(o)}addSpecToMap(e){let t=new P8({source:e,zIndex:0});this.map.addLayer(t),this.sendMapToUser(0)}getWMTSScales(e,t){let o=new dPe().read(t).Contents.TileMatrixSet,s=[];for(let l=0;l=1)}limitScale(e,t){if(this.validScale(e.minScale)&&this.validScale(e.maxScale)){let r,i,a;if(t.layerType==="WMTS")r=t.scales,i=+e.minScale.split(":")[1],a=+e.maxScale.split(":")[1];else{const h=this.scales.map(c=>1/c.split(":")[1]);Array.isArray(t.visibleScales)&&t.visibleScales.length&&t.visibleScales?r=t.visibleScales:r=h,i=1/+e.minScale.split(":")[1],a=1/+e.maxScale.split(":")[1]}const o=this.findNearest(r,i),s=this.findNearest(r,a);let l=r.indexOf(o),u=r.indexOf(s);l>u&&([l,u]=[u,l]),(l!==0||u!==r.length-1)&&(this.map.setView(new Lp(Object.assign({},this.map.getView().options_,{maxResolution:void 0,minResolution:void 0,minZoom:l,maxZoom:u,constrainResolution:!1}))),this.map.addInteraction(new Tqe({constrainResolution:!0})))}}parseNumber(e){return Number(e.split(":")[1])}findNearest(e,t){let r=0,i=t;for(let a=1,o=e.length;athis.createMVTLayer(i).then(a=>{let o=br.newGuid(8);t.name&&a.setProperties({name:t.name,layerID:o,layerType:"VECTOR_TILE"}),t.visibleScale&&this.setVisibleScales(a,t.visibleScale),t.layer=a,t.layerID=o,this.map.addLayer(a)})).catch(function(i){throw i})}createView(e){let t=e.center,r=e.level!==void 0?e.level:1,i=e.maxZoom||22,a,o=this.baseProjection,s=[];for(let c in t)s.push(t[c]);s.length===0&&(s=[0,0]),this.baseLayerExtent=a=e.baseLayer&&e.baseLayer.extent,this.mapParams&&(this.mapParams.extent=a,this.mapParams.projection=o),!dv(a,s)&&(s=kf(a));let l=e.baseLayer,u;if(l.visibleScales&&l.visibleScales.length>0||l.scales&&l.scales.length>0)this.getScales(l);else if(e.baseLayer&&a&&a.length===4){let c=a[2]-a[0],f=a[3]-a[1],d=c/512,v=f/512;u=Math.max(d,v)}this.map.setView(new Lp({zoom:r,center:s,projection:o,maxZoom:i,maxResolution:u}));let h={};if(l.scales&&l.scales.length>0&&l.layerType==="WMTS"||this.resolutionArray&&this.resolutionArray.length>0?h={zoom:r,center:s,projection:o,resolutions:this.resolutionArray,maxZoom:i}:l.layerType==="WMTS"?(h={zoom:r,center:s,projection:o,maxZoom:i},this.getScales(l)):(h={zoom:r,center:s,projection:o,maxResolution:u,maxZoom:i},this.getScales(l)),["4","5"].indexOf(br.getOlVersion())<0&&(h.multiWorld=!0,h.showFullExtent=!0,h.enableRotation=!1,h.constrainResolution=!0),this.map.setView(new Lp(h)),e.visibleExtent){const c=this.map.getView(),f=c.getResolutionForExtent(e.visibleExtent,this.map.getSize());c.setResolution(f),c.setCenter(kf(e.visibleExtent))}}createBaseLayer(e,t,r,i,a){let o,s=this;i&&(s=i);let l=e.layerType;switch((l.indexOf("TIANDITU_VEC")>-1||l.indexOf("TIANDITU_IMG")>-1||l.indexOf("TIANDITU_TER")>-1)&&(l=l.substr(0,12)),l){case"TIANDITU_VEC":case"TIANDITU_IMG":case"TIANDITU_TER":o=this.createTiandituSource(l,e.projection);break;case"BAIDU":o=this.createBaiduSource();break;case"BING":o=this.createBingSource(e,e.projection);break;case"WMS":o=this.createWMSSource(e);break;case"WMTS":o=s.createWMTSSource(e);break;case"TILE":case"SUPERMAP_REST":o=s.createDynamicTiledSource(e,a);break;case"CLOUD":case"CLOUD_BLACK":case"OSM":case"JAPAN_ORT":case"JAPAN_RELIEF":case"JAPAN_PALE":case"JAPAN_STD":case"GOOGLE_CN":case"GOOGLE":o=this.createXYZSource(e);break}var u=new P8({source:o,zIndex:e.zIndex||1,visible:e.visible}),h=br.newGuid(8);e.name&&u.setProperties({name:e.name,layerID:h}),(e.visible===void 0||e.visible===null)&&(e.visible=!0),u.setVisible(e.visible),e.opacity&&u.setOpacity(e.opacity),t&&u.setZIndex(t),e.layer=u,e.layerID=h;let{visibleScale:c,autoUpdateTime:f}=e,d,v;return c&&(v=this.resolutions[c.minScale],d=this.resolutions[c.maxScale],v>1?u.setMaxResolution(Math.ceil(v)):u.setMaxResolution(v*1.1),u.setMinResolution(d)),f&&!e.autoUpdateInterval&&(e.autoUpdateInterval=setInterval(()=>{s.updateTileToMap(e,t)},f)),r&&(u.setZIndex(0),s.map.addLayer(u)),u}updateTileToMap(e,t){this.map.removeLayer(e.layer),this.map.addLayer(this.createBaseLayer(e,t))}getInternetMapInfo(e){const t=[-200375083427892e-7,-200375083427892e-7,200375083427892e-7,200375083427892e-7],r=[-180,-90,180,90],i=[-2003750834e-2,-2003750834e-2,2003750834e-2,2003750834e-2],a=[1255566753929e-5,128185298656e-5,1752590886651e-5,748487070596e-5],o=[-1974111714519e-5,-1000392136848e-5,1998167771404e-5,1966098356089e-5];switch(e.units="m",e.layerType){case"BAIDU":e.iServerUrl="https://map.baidu.com/",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=1,e.extent=t;break;case"CLOUD":e.url="http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"CLOUD_BLACK":e.url="http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"tencent":e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"TIANDITU_VEC_3857":case"TIANDITU_IMG_3857":case"TIANDITU_TER_3857":e.iserverUrl="https://map.tianditu.gov.cn/",e.epsgCode="EPSG:3857",e.minZoom=0,e.maxZoom=19,e.level=1,e.extent=t,e.layerType==="TIANDITU_TER_3857"&&(e.maxZoom=14);break;case"TIANDITU_VEC_4326":case"TIANDITU_IMG_4326":case"TIANDITU_TER_4326":e.iserverUrl="https://map.tianditu.gov.cn/",e.epsgCode="EPSG:4326",e.minZoom=0,e.maxZoom=19,e.level=1,e.extent=r,e.layerType==="TIANDITU_TER_4326"&&(e.maxZoom=14);break;case"OSM":e.url="http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=1,e.extent=i,e.iserverUrl="https://www.openstreetmap.org";break;case"GOOGLE":e.url=`https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i540264686!3m12!2s${this.getLang()}!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0&key=${this.googleMapsAPIKey}`,e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=22,e.level=1,e.extent=i,e.iserverUrl="https://www.google.cn/maps";break;case"JAPAN_STD":e.url="https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=0,e.extent=i;break;case"JAPAN_PALE":e.url="https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=2,e.maxZoom=19,e.level=2,e.extent=i;break;case"JAPAN_RELIEF":e.url="https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=5,e.maxZoom=14,e.level=5,e.extent=a;break;case"JAPAN_ORT":e.url="https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg",e.epsgCode="EPSG:3857",e.minZoom=2,e.maxZoom=12,e.level=2,e.extent=o;break}}createDynamicTiledSource(e,t){let r="IPORTAL",i=e.credential?e.credential.token:void 0,a="Token",o=e.url;(e.url.indexOf("www.supermapol.com")>-1||e.url.indexOf("itest.supermapol.com")>-1)&&(a="Key",o=[o],r="ONLINE"),i&&xs[`register${a}`](o,i);let s={transparent:!0,url:e.url,wrapX:!1,serverType:r,format:e.format};if(!t&&!this.isCustomProjection(this.baseProjection)&&(s.prjCoordSys={epsgCode:this.baseProjection.split(":")[1]}),e.visibleScales&&e.visibleScales.length>0){let u=[];for(let c in e.visibleScales){let f=br.scaleToResolution(e.visibleScales[c],ZP.default,e.coordUnit);u.push(f)}e.visibleResolutions=u;let h=new ym({extent:e.extent,resolutions:u});s.tileGrid=h}else{s.extent=this.baseLayerExtent;let u=new ym({extent:e.extent,resolutions:this.getResolutionsFromBounds(e.extent)});s.tileGrid=u}e.url&&!H.isInTheSameDomain(e.url)&&!this.isIportalProxyServiceUrl(e.url)&&e.format!=="webp"&&(s.tileProxy=this.server+"apps/viewer/getUrlResource.png?url=");let l=new Bp(s);return xs[`register${a}`](e.url),l}getResolutionsFromBounds(e){let t=[],r=Math.abs(e[0]-e[2])/512;for(let i=0;i<22;i++){if(i===0){t[i]=r;continue}r=r/2,t[i]=r}return t}createTiandituSource(e,t,r){let i={layerType:e.split("_")[1].toLowerCase(),isLabel:r||!1,projection:t,url:`https://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?tk=${this.tiandituKey}`};return new rM(i)}createBaiduSource(){return new c$}createBingSource(e,t){let r="https://dynamic.t0.tiles.ditu.live.com/comp/ch/{quadKey}?it=G,TW,L,LA&mkt=zh-cn&og=109&cstl=w4c&ur=CN&n=z";return new E7({wrapX:!1,projection:t,crossOrigin:"anonymous",tileUrlFunction:function(i){let[a,o,s]=[...i];s=s>0?s-1:-s-1;let l="";for(let u=a;u>0;u--){let h=0,c=1<{if(l.succeed===!1)return l;let u="png";return r.tileFormat==="webp"&&(u=await r.isSupportWebp(e.url,i)?"webp":"png"),{units:l.coordUnit&&l.coordUnit.toLowerCase(),coordUnit:l.coordUnit,visibleScales:l.visibleScales,extent:[l.bounds.left,l.bounds.bottom,l.bounds.right,l.bounds.top],projection:`EPSG:${l.prjCoordSys.epsgCode}`,format:u}}).catch(l=>({succeed:!1,error:l}))}getTileInfo(e,t,r){let i=this,a={withCredentials:this.withCredentials,withoutFormatSuffix:!0};e.url.indexOf("?token=")>-1&&(i.credentialKey="token",i.credentialValue=e.credential=e.url.split("?token=")[1],e.url=e.url.split("?token=")[0]);let o=this.handleJSONSuffix(e.url);return li.get(i.getRequestUrl(o),null,a).then(function(s){return s.json()}).then(async function(s){if(s&&s.code&&s.code!==200)throw s;s.visibleScales&&(e.visibleScales=s.visibleScales,e.coordUnit=s.coordUnit),e.maxZoom=s.maxZoom,e.maxZoom=s.minZoom;let l=e.credential?e.credential.token:void 0;if(e.format="png",i.tileFormat==="webp"&&e.url!=="https://maptiles.supermapol.com/iserver/services/map_China/rest/maps/China_Dark"){const u=await i.isSupportWebp(e.url,l);e.format=u?"webp":"png"}r?t&&t(r,null,!0,i):t&&t(e)}).catch(function(s){i.errorCallback&&i.errorCallback(s,"getTileInfo",i.map)})}getWMTSUrl(e,t){let r="?";return e.indexOf("?")>-1&&(r="&"),t?e+=r+"SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities":e+=r+"/1.0.0/WMTSCapabilities.xml",this.getRequestUrl(e,!0)}getWmtsInfo(e,t){let r=this,i={withCredentials:r.withCredentials,withoutFormatSuffix:!0};const a=!e.requestEncoding||e.requestEncoding==="KVP";return li.get(r.getWMTSUrl(e.url,a),null,i).then(function(o){return o.text()}).then(function(o){let l=new dPe().read(o);if(r.isValidResponse(l)){let h=l.Contents,c=h.TileMatrixSet,f=h.Layer,d,v,p,g="default";for(let S=0;S{S.isDefault&&(g=S.Identifier)});let m=[],y=[];for(let S=0;S-1?[b[1],b[0]]:b;break}let _=e.name,x;u?(u[0]<-180&&(u[0]=-180),u[1]<-90&&(u[1]=-90),u[2]>180&&(u[2]=180),u[3]>90&&(u[3]=90),x=Cte(u,"EPSG:4326",r.baseProjection)):x=ya(r.baseProjection).getExtent(),e.tileUrl=r.getTileUrl(l.OperationsMetadata.GetTile.DCP.HTTP.Get,d,p,a),e.extent=x,e.name=_,e.orginEpsgCode=e.projection,e.overLayer=!0,e.scales=m,e.style=g,e.title=_,e.unit="m",e.layerFormat=p,e.matrixIds=y,t&&t(e)}}).catch(function(o){r.errorCallback&&r.errorCallback(o,"getWmtsFaild",r.map)})}getWmsInfo(e){let t=this,r=e.url.trim();r+=r.indexOf("?")>-1?"&SERVICE=WMS&REQUEST=GetCapabilities":"?SERVICE=WMS&REQUEST=GetCapabilities";let i={withCredentials:t.withCredentials,withoutFormatSuffix:!0};return new Promise(function(o){return li.get(t.getRequestUrl(r,!0),null,i).then(function(s){return s.text()}).then(async function(s){let u=new ljr().read(s);if(u){let h=u.Capability.Layer.Layer,c=e.projection;e.subLayers=e.layers[0],e.version=u.version;for(let f=0;f{o.Constraint[0].AllowedValues.Value[0].toUpperCase()==="KVP"&&(a=o.href)}):a=t.ResourceURL.filter(s=>s.format===r)[0].template,a}createWMTSSource(e){let t=e.extent||ya(e.projection).getExtent(),r=ya(this.baseProjection).getUnits();return new qqe({url:e.tileUrl||e.url,layer:e.layer,format:e.layerFormat,style:e.style,matrixSet:e.tileMatrixSet,requestEncoding:e.requestEncoding||"KVP",tileGrid:this.getWMTSTileGrid(t,e.scales,r,e.dpi,e.origin,e.matrixIds),tileLoadFunction:function(i,a){if(a.indexOf("tianditu.gov.cn")>=0){i.getImage().src=`${a}&tk=${H.getParameters(e.url).tk}`;return}i.getImage().src=a}})}getWMTSTileGrid(e,t,r,i,a,o){let s=this.getReslutionsFromScales(t,i||ZP.iServerWMTS,r);return new pre({origin:a,extent:e,resolutions:s.res,matrixIds:o||s.matrixIds})}getReslutionsFromScales(e,t,r,i){r=r&&r.toLowerCase()||"degrees",t=t||ZP.iServerWMTS,i=i||6378137;let a=[],o=[];if(br.isArray(e))e&&e.forEach(function(s,l){s>1&&(o.push(l),a.push(this.getResolutionFromScale(s,t,r,i)))},this);else{let s=e.TileMatrix;s&&s.forEach(function(l){o.push(l.Identifier),a.push(this.getResolutionFromScale(l.ScaleDenominator,t,r,i))},this)}return{res:a,matrixIds:o}}getResolutionFromScale(e,t=ZP.default,r,i){let a;return e=+e,e=e>1?1/e:e,r==="degrees"||r==="dd"||r==="degree"?a=.0254*1e4/t/e/(Math.PI*2*i/360)/1e4:a=.0254*1e4/t/e/1e4,a}isValidResponse(e){let t=["Contents","OperationsMetadata"],r=!0;for(let i=0;i0){this.layers=t;for(let o=0;o{r.layerAdded++,r.sendMapToUser(a)}).catch(function(c){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(c,"getLayerFaild",r.map)});else if(u&&u.serverId||s.layerType==="MARKER"||s.layerType==="HOSTED_TILE"||h){let c=s.dataSource,f=c?c.serverId:s.serverId;if(!f&&!h){await r.addLayer(s,null,l),r.layerAdded++,r.sendMapToUser(a);return}if(s.layerType==="MARKER"||c&&(!c.accessType||c.accessType==="DIRECT")||h){let d=h?`${r.server}apps/dataviz/libs/sample-datas/${c.name}.json`:`${r.server}web/datas/${f}/content.json?pageSize=9999999¤tPage=1`;d=r.getRequestUrl(d),li.get(d,null,{withCredentials:this.withCredentials}).then(function(v){return v.json()}).then(async function(v){if(v.succeed===!1){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(v.error,"getLayerFaild",r.map);return}if(v&&v.type){if(v.type==="JSON"||v.type==="GEOJSON")v.content=v.content.type?v.content:JSON.parse(v.content),i=r.geojsonToFeature(v.content,s);else if(v.type==="EXCEL"||v.type==="CSV")if(s.dataSource&&s.dataSource.administrativeInfo){v.content.rows.unshift(v.content.colTitles);let{divisionType:p,divisionField:g}=s.dataSource.administrativeInfo,m=r.excelData2FeatureByDivision(v.content,p,g);i=r._parseGeoJsonData2Feature({allDatas:{features:m.features},fileCode:s.projection})}else i=await r.excelData2Feature(v.content,s);else if(v.type==="SHP"){let p=JSON.parse(v.content);v.content=p.layers[0],i=r.geojsonToFeature(v.content,s)}await r.addLayer(s,i,l),r.layerAdded++,r.sendMapToUser(a)}}).catch(function(v){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(v,"getLayerFaild",r.map)})}else{let d=s.layerType==="HOSTED_TILE",v=c?c.serverId:s.serverId;r.checkUploadToRelationship(v).then(function(p){if(p&&p.length>0){let g=p[0].name,m=p[0].type.toUpperCase();r.getDataService(v,g).then(async function(y){let _=y.dataItemServices;if(_.length===0){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(null,"getLayerFaild",r.map);return}if(d){let x=r.getService(_,"RESTDATA");r.isMvt(x.address,g).then(async S=>{await r.getServiceInfoFromLayer(l,a,s,_,g,m,S)}).catch(async()=>{await r.getServiceInfoFromLayer(l,a,s,_,g,m)})}else await r.getServiceInfoFromLayer(l,a,s,_,g,m)})}else r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(null,"getLayerFaild",r.map)}).catch(function(p){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(p,"getLayerFaild",r.map)})}}else u&&u.type==="USER_DATA"?r.addGeojsonFromUrl(s,a,l,!1):s.layerType==="TILE"?r.getTileLayerExtent(s,function(c){r.map.addLayer(r.createBaseLayer(c,l)),r.layerAdded++,r.sendMapToUser(a)},function(c){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(c,"getLayerFaild",r.map)}):s.layerType==="SUPERMAP_REST"||s.layerType==="WMS"||s.layerType==="WMTS"?s.layerType==="WMTS"?r.getWmtsInfo(s,function(c){r.map.addLayer(r.createBaseLayer(c,l)),r.layerAdded++,r.sendMapToUser(a)}):s.layerType==="WMS"?r.getWmsInfo(s).then(()=>{r.map.addLayer(r.createBaseLayer(s,l)),r.layerAdded++,r.sendMapToUser(a)}):(s.projection=r.baseProjection,r.map.addLayer(r.createBaseLayer(s,l)),r.layerAdded++,r.sendMapToUser(a)):u&&u.type==="REST_DATA"?r.getFeaturesFromRestData(s,l,a):u&&u.type==="REST_MAP"&&u.url?vMe(u.url,u.layerName,"smid=1",null,null,function(c){var f=c&&c.result.recordsets,d=f&&f[0],v=d.fields;if(d&&v){let m=[];for(var p in v){var g=v[p];(g.indexOf("Sm")!==0||g==="SmID")&&m.push(g)}r.getFeatures(m,s,async function(y){await r.addLayer(s,y,l),r.layerAdded++,r.sendMapToUser(a)},function(y){r.layerAdded++,r.errorCallback&&r.errorCallback(y,"getFeatureFaild",r.map)})}},function(c){r.errorCallback&&r.errorCallback(c,"getFeatureFaild",r.map)}):(s.layerType==="DATAFLOW_POINT_TRACK"||s.layerType==="DATAFLOW_HEAT")&&r.getDataflowInfo(s,async function(){await r.addLayer(s,i,l),r.layerAdded++,r.sendMapToUser(a)},function(c){r.layerAdded++,r.errorCallback&&r.errorCallback(c,"getFeatureFaild",r.map)})}}}addGeojsonFromUrl(e,t,r,i=this.withCredentials){let{dataSource:a}=e,{url:o}=a,s=this;li.get(o,null,{withCredentials:i,withoutFormatSuffix:!0}).then(function(l){return l.json()}).then(async function(l){if(!l||l.succeed===!1){t?s.errorCallback&&s.errorCallback(l.error,"autoUpdateFaild",s.map):(s.layerAdded++,s.sendMapToUser(t),s.errorCallback&&s.errorCallback(l.error,"getLayerFaild",s.map));return}var u;if(l.type==="CSV"||l.type==="EXCEL")if(e.dataSource&&e.dataSource.administrativeInfo){l.content.rows.unshift(l.content.colTitles);let{divisionType:c,divisionField:f}=e.dataSource.administrativeInfo,d=s.excelData2FeatureByDivision(l.content,c,f);u=s._parseGeoJsonData2Feature({allDatas:{features:d.features},fileCode:e.projection})}else u=await s.excelData2Feature(l.content,e);else{var h=l.content?JSON.parse(l.content):l;u=s.geojsonToFeature(h,e)}t?(await s.addLayer(e,u,r),s.layerAdded++,s.sendMapToUser(t)):(s.map.removeLayer(e.layer),e.labelLayer&&s.map.removeLayer(e.labelLayer),await s.addLayer(e,u,r))}).catch(function(l){s.layerAdded++,s.sendMapToUser(t),s.errorCallback&&s.errorCallback(l,"getLayerFaild",s.map)})}async getServiceInfoFromLayer(e,t,r,i,a,o,s){let l=this,u=s?!s.isMvt:r.layerType==="HOSTED_TILE",h=!1;for(let c=0;cv.json());t.xyField={xField:d.xField,yField:d.yField},d.xIndex?(c=d.xIndex,f=d.yIndex):(c=i.indexOf(d.xField),f=i.indexOf(d.yField))}else if(o.type==="SAMPLE_DATA"){const d=S$r.find(v=>v.id===o.name)||{};u=d.xField,h=d.yField,t.xyField={xField:u,yField:h},c=i.findIndex(v=>v===u),f=i.findIndex(v=>v===h)}}catch(d){console.error(d)}for(let d=0,v=r.length;d-1){const E=b+"_1";g[E]=p[S]}else g[b]=p[S]}let x=new d0({geometry:_,attributes:g});l.push(x)}}return Promise.resolve(l)}excelData2FeatureByDivision(e,t,r){let i=this,a;if(t==="Province"?a=window.ProvinceData:t==="City"?a=window.MunicipalData:t==="GB-T_2260"&&(a=window.AdministrativeArea),a)return i.changeExcel2Geojson(a.features,e.rows,t,r)}_parseGeoJsonData2Feature(e){let t=e.allDatas.features,r=[];for(let i=0,a=t.length;iu===i);return s.forEach(u=>{let h;if(r==="GB-T_2260"?h=e.find(c=>c.properties.GB===u[l]):h=br.getHighestMatchAdministration(e,u[l]),h){let c=window.cloneDeep(h);c.properties={},u.forEach((f,d)=>{let v=o[d].trim();c.properties[v]=f}),a.features.push(c)}}),a}geojsonToFeature(e,t){let r=e.features,i=[];for(let a=0,o=r.length;a-1||p._smiportal_imgLinkUrl.indexOf("https://")>-1?g=p._smiportal_imgLinkUrl:p._smiportal_imgLinkUrl!==void 0&&p._smiportal_imgLinkUrl!==null&&p._smiportal_imgLinkUrl!==""&&(g=`${br.getIPortalUrl()}resources/markerIcon/${p._smiportal_imgLinkUrl}`),c={dataViz_description:p._smiportal_description,dataViz_imgUrl:g,dataViz_title:p._smiportal_title,dataViz_url:p._smiportal_otherLinkUrl},v.anchor=[.5,1],v.src=v.externalGraphic,f=v,d=Object.assign({},{attributes:c},{useStyle:f}),delete p._smiportal_description,delete p._smiportal_imgLinkUrl,delete p._smiportal_title,delete p._smiportal_otherLinkUrl}else d={attributes:s};l.setProperties(d),i.push(l)}return i}parseGeoJsonData2Feature(e){let t=e.allDatas.features,r=[];for(let i=0,a=t.length;i{a.updateFeaturesToMap(e,r,!0)},l)}}e.layer=i,e.layerID=o,e.labelStyle&&e.labelStyle.labelField&&e.layerType!=="DATAFLOW_POINT_TRACK"&&(t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,this.addLabelLayer(e,t))}updateFeaturesToMap(e,t){let r=this,i=e.dataSource,a=e.dataSource.url,o=i.dataSourceName||e.name;if(i.type==="USER_DATA"||i.accessType==="DIRECT")r.addGeojsonFromUrl(e,null,t);else{let s=r.formatUrlWithCredential(a),l={};l.withCredentials=this.withCredentials,!this.excludePortalProxyUrl&&!H.isInTheSameDomain(s)&&!this.isIportalProxyServiceUrl(s)&&(l.proxy=this.getProxy()),dMe(s,[o],l,async function(u){let h=r.parseGeoJsonData2Feature({allDatas:{features:u.result.features.features},fileCode:e.projection,featureProjection:r.baseProjection});r.map.removeLayer(e.layer),e.labelLayer&&r.map.removeLayer(e.labelLayer),await r.addLayer(e,h,t)},function(u){r.errorCallback&&r.errorCallback(u,"autoUpdateFaild",r.map)},void 0,this.restDataSingleRequestCount)}}async addVectorTileLayer(e,t,r){let i;r==="RESTDATA"&&(i=await this.createDataVectorTileLayer(e));let a=br.newGuid(8);return i&&(e.name&&i.setProperties({name:e.name,layerID:a}),e.opacity!=null&&i.setOpacity(e.opacity),i.setVisible(e.visible),i.setZIndex(t)),e.layer=i,e.layerID=a,i}async createDataVectorTileLayer(e){var t=new w1({featureClass:d0});w1.prototype.readProjection=function(){return new ew({code:"",units:$c.TILE_PIXELS})};let r=e.featureType,i=await ts.toOpenLayersStyle(this.getDataVectorTileStyle(r),r);return new fPe({source:new Zre({url:e.url,projection:e.projection,tileType:"ScaleXY",format:t}),style:i})}getDataVectorTileStyle(e){let t={radius:8,fillColor:"#EE4D5A",fillOpacity:.9,strokeColor:"#ffffff",strokeWidth:1,strokeOpacity:1,lineDash:"solid",type:"BASIC_POINT"};return["LINE","LINESTRING","MULTILINESTRING"].indexOf(e)>-1?(t.strokeColor="#4CC8A3",t.strokeWidth=2):["REGION","POLYGON","MULTIPOLYGON"].indexOf(e)>-1&&(t.fillColor="#826DBA"),t}getFiterFeatures(e,t){let r=this.parseFilterCondition(e),i=[];for(let a=0;a0&&i.push(o)}return i}parseFilterCondition(e){return e.replace(/=/g,"==").replace(/AND|and/g,"&&").replace(/or|OR/g,"||").replace(/<==/g,"<=").replace(/>==/g,">=").replace(/\(?[^\(]+?\s*in\s*\([^\)]+?\)\)?/gi,t=>{const r=t.match(/([^(]+?)\s*in\s*\(([^)]+?)\)/i);return r.length===3?`(${r[2].split(",").map(i=>`${r[1]} == ${i.trim()}`).join(" || ")})`:t})}async createGraphicLayer(e,t){t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t;let r=await this.getGraphicsFromFeatures(t,e.style,e.featureType),i=new v$({graphics:r,render:"canvas",map:this.map,isHighLight:!1});return new dZe({source:i})}async getGraphicsFromFeatures(e,t,r){let i=await ts.getOpenlayersStyle(t,r),a=i.getImage(),o=[];for(let s in e){let l=new qM(e[s].getGeometry());l.setStyle(a),l.setProperties({attributes:e[s].get("attributes")}),o.push(l)}return o}createSymbolLayer(e,t){let r=ts.getSymbolStyle(e.style);return new Sy({style:r,source:new _f({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1}),renderMode:"image"})}addLabelLayer(e,t){let r=e.labelStyle,i=this.getLabelStyle(r,e),a=e.labelLayer=new Sy({declutter:!0,styleOL:i,labelField:r.labelField,source:new _f({features:t,wrapX:!1})});a.setStyle(s=>{let l=r.labelField,u=s.get("attributes")[l.trim()]+"";if(u==="undefined")return null;let h=a.get("styleOL"),c=h.getText();return c&&c.setText&&c.setText(u),h}),this.map.addLayer(a),a.setVisible(e.visible),a.setZIndex(1e3);const{visibleScale:o}=e;return o&&this.setVisibleScales(a,o),a}setVisibleScales(e,t){let r=this.resolutions[t.minScale],i=this.resolutions[t.maxScale];r>1?e.setMaxResolution(Math.ceil(r)):e.setMaxResolution(r*1.1),e.setMinResolution(i)}getLabelStyle(e,t){let r=t.style||t.pointStyle;const{radius:i=0,strokeWidth:a=0}=r,o=-(i+a),{fontSize:s="14px",fontFamily:l,fill:u,backgroundFill:h,offsetX:c=0,offsetY:f=o,placement:d="point",textBaseline:v="bottom",textAlign:p="center",outlineColor:g="#000000",outlineWidth:m=0}=e,y={font:`${s} ${l}`,placement:d,textBaseline:v,fill:new Ko({color:u}),backgroundFill:new Ko({color:h}),padding:[3,3,3,3],offsetX:t.featureType==="POINT"?c:0,offsetY:t.featureType==="POINT"?f:0,overflow:!0,maxAngle:0};return t.featureType==="POINT"&&(y.textAlign=p),m>0&&(y.stroke=new es({color:g,width:m})),new So({text:new J1(y)})}async createVectorLayer(e,t){const{featureType:r,style:i}=e;let a;if(r==="LINE"&&br.isArray(i)&&i.length===2){const[o,s]=i;a=!s.lineDash||s.lineDash==="solid"?ts.getRoadPath(s,o):ts.getPathway(s,o)}else br.isArray(i)&&(e.style=i[0]),a=await ts.toOpenLayersStyle(e.style,e.featureType);return new Sy({style:a,source:new _f({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})})}createHeatLayer(e,t){t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t;let i={source:new _f({features:t,wrapX:!1})},a=e.themeSetting;i.gradient=a.colors.slice(),i.radius=parseInt(a.radius);let o=a.customSettings;for(let s in o)i.gradient[s]=o[s];return a.weight&&this.changeWeight(t,a.weight),new cPe(i)}changeWeight(e,t){let r=this;this.fieldMaxValue={},this.getMaxValue(e,t);let i=this.fieldMaxValue[t];e.forEach(function(a){let o=a.get("attributes");try{let s=o[t];a.set("weight",s/i)}catch(s){r.errorCallback&&r.errorCallback(s)}})}getMaxValue(e,t){let r=[],i=this,a,o=t;this.fieldMaxValue[o]||(e.forEach(function(s){a=s.get("attributes");try{r.push(parseFloat(a[o]))}catch(l){i.errorCallback&&i.errorCallback(l)}}),this.fieldMaxValue[o]=pB.getArrayStatistic(r,"Maximum"))}async createUniqueLayer(e,t){let r=await this.createUniqueSource(e,t),i=new Sy({styleSource:r,source:new _f({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})});return i.setStyle(a=>{let o=i.get("styleSource"),s=o.themeField,l=a.get("attributes")[s];return o.styleGroups.find(h=>h.value===l).olStyle}),i}async createUniqueSource(e,t){let r=await this.getUniqueStyleGroup(e,t);return{map:this.map,style:e.style,isHoverAble:e.isHoverAble,highlightStyle:e.highlightStyle,themeField:e.themeSetting.themeField,styleGroups:r}}async getUniqueStyleGroup(e,t){let r=e.featureType,i=e.style,a=e.themeSetting,o=a.themeField,s=[],l=a.customSettings;for(let d in t){let p=t[d].get("attributes")[o],g=!1;for(let m in s)if(s[m]===p){g=!0;break}g||s.push(p)}let u=[];const h=this.getCustomSettingColors(l,r).map(d=>d.toLowerCase()),c=this.getUniqueColors(a.colors||this.defaultParameters.themeSetting.colors,s.length+Object.keys(l).length).map(d=>d.toLowerCase()),f=gXr(c,h);for(let d=0;d{if(br.isString(e[a])){i.push(e[a]);return}t==="LINE"?i.push(e[a].strokeColor):i.push(e[a].fillColor)}),i}getUniqueColors(e,t){return vB.getGradientColors(e,t)}async createRangeLayer(e,t){let r=await this.createRangeSource(e,t),i=new Sy({styleSource:r,source:new _f({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})});return i.setStyle(a=>{let o=i.get("styleSource");if(o){let s=o.themeField,l=Number(a.get("attributes")[s.trim()]),u=o.styleGroups;for(let h=0;h=u[h].start&&l<=u[h].end)return u[h].olStyle}else if(l>u[h].start&&l<=u[h].end)return u[h].olStyle}}),i}async createRangeSource(e,t){let r=await this.getRangeStyleGroup(e,t);return r?{style:e.style,themeField:e.themeSetting.themeField,styleGroups:r}:!1}async getRangeStyleGroup(e,t){let r=e.featureType,i=e.themeSetting,a=e.style,o=i.segmentCount,s=i.segmentMethod,l=i.colors,u=i.customSettings,h=i.themeField,c=[],f,d=o,v=s,p=this;t.forEach(function(m){f=m.get("attributes");try{if(f){let y=f[h.trim()];y!=null&&br.isNumber(y)&&c.push(parseFloat(y))}else m.get(h)&&br.isNumber(m.get(h))&&m.get(h)&&c.push(parseFloat(m.get(h)))}catch(y){p.errorCallback&&p.errorCallback(y)}});let g;try{g=pB.getArraySegments(c,v,d)}catch(m){p.errorCallback&&p.errorCallback(m)}if(g){let m=d;f&&g[0]===g[f.length-1]&&(m=1,g.length=2);for(let x in g){let S=g[x];Number(x)===0?S=Math.floor(S*100)/100:S=Math.ceil(S*100)/100+.1,g[x]=Number(S.toFixed(2))}let y=l;y=vB.getGradientColors(y,m,"RANGE");for(let x=0;x0&&p.addDataflowFeature(_,e.identifyField,{dataflowSource:a,featureCache:g,labelSource:s,labelFeatureCache:m,pathSource:u,pathFeatureCache:y,maxPointCount:e.maxPointCount})}else p.addDataflowFeature(_,e.identifyField,{dataflowSource:a,featureCache:g,labelSource:s,labelFeatureCache:m,pathSource:u,pathFeatureCache:y,maxPointCount:e.maxPointCount})}}(f,d,v)),this.setFeatureStyle(h,e.directionField,r.type),h}addDataflowFeature(e,t,r){r.dataflowSource&&this.addFeatureFromDataflowService(r.dataflowSource,e,t,r.featureCache),r.labelSource&&this.addFeatureFromDataflowService(r.labelSource,e,t,r.labelFeatureCache),r.pathSource&&this.addPathFeature(r.pathSource,e,t,r.pathFeatureCache,r.maxPointCount)}addPathFeature(e,t,r,i,a){let o=[];var s=t.get(r);i[s]?(o=i[s].getGeometry().getCoordinates(),o.push(t.getGeometry().getCoordinates()),a&&o.length>a&&o.splice(0,o.length-a),i[s].getGeometry().setCoordinates(o)):(o.push(t.getGeometry().getCoordinates()),i[s]=new d0({geometry:new gm(o)}),e.addFeature(i[s]))}setFeatureStyle(e,t,r){let i=e.get("styleOL");e.setStyle(a=>{let o,s;if(t!==void 0&&t!=="\u672A\u8BBE\u7F6E"&&t!=="None"?o=a.get("attributes")[t]:o=0,o>360||o<0)return null;r==="SYMBOL_POINT"?s=i.getText():s=i.getImage();let l=Math.PI*o/180;return s&&s.setRotation(l),i})}createDataflowHeatLayer(e){let r={source:this.createDataflowHeatSource(e)};if(r.gradient=e.themeSetting.colors.slice(),r.radius=parseInt(e.themeSetting.radius),e.themeSetting.customSettings){let i=e.themeSetting.customSettings;for(let a in i)r.gradient[a]=i[a]}return new cPe(r)}createDataflowHeatSource(e){let t=this,r=new _f({wrapX:!1}),i={};return this.createDataflowService(e,function(a){return function(o){if(e.filterCondition){let s=t.parseFilterCondition(e.filterCondition);const l=o.get("attributes"),u=Jq(s,Object.keys(l)),h=Qq(l),c="select * from json where ("+u+")";let f=window.jsonsql.query(c,{attributes:h});f&&f.length>0&&t.addDataflowFeature(o,e.identifyField,{dataflowSource:r,featureCache:a})}else t.addDataflowFeature(o,e.identifyField,{dataflowSource:r,featureCache:a});e.themeSetting.weight&&t.changeWeight(r.getFeatures(),e.themeSetting.weight)}}(i)),r}addFeatureFromDataflowService(e,t,r,i){var a=t.get(r);a!==void 0&&i[a]?(i[a].setGeometry(t.getGeometry()),i[a].setProperties(t.getProperties()),e.changed()):(e.addFeature(t),i[a]=t)}createDataflowService(e,t){let r=this,i=new Ihe(e.wsUrl).initSubscribe();i.on("messageSucceeded",function(a){let o=JSON.parse(a.value.data),s=eB.readFeature(o,{dataProjection:e.projection||"EPSG:4326",featureProjection:r.baseProjection||"EPSG:4326"});s.setProperties({attributes:o.properties}),t(s)}),e.dataflowService=i}async setEachFeatureDefaultStyle(e){let t=this;e=br.isArray(e)||e instanceof gd?e:[e];for(let r=0;r{let o=i.get("styleSource"),s=o.parameters.themeSetting.themeField,l=Number(a.get("attributes")[s]),u=o.styleGroups;for(let h=0,c=u.length;h=u[h].start&&l{let y=m.get("attributes"),_=y[e];_==null||!br.isNumber(_)||a.push(Number(_))});try{o=pB.getArraySegments(a,u,h)}catch(m){console.error(m)}for(let m=0;m0&&r>0?`EPSG:${e.substring(t,r).split(",")[1].substr(1)}`:!1}}createMigrationLayer(e,t){window.ol3Echarts.prototype.getContainer||(window.ol3Echarts.prototype.getContainer=function(){return this.$container}),window.ol3Echarts.prototype.setVisible||(window.ol3Echarts.prototype.setVisible=function(l){if(l){let u=this.get("options");u&&(this.setChartOptions(u),this.unset("options"))}else{let u=this.getChartOptions();this.set("options",u),this.clear(),this.setChartOptions({})}}),window.ol3Echarts.prototype.setZIndex||(window.ol3Echarts.prototype.setZIndex=function(l){let u=this.getContainer();u&&(u.style.zIndex=l)}),window.ol3Echarts.prototype.setCursor||(window.ol3Echarts.prototype.setCursor=function(l="default"){let u=this.getContainer();u&&l==="default"&&u.classList.add("cursor-default")});let r=wFr(t),i=this.createLinesData(e,r),a=this.createPointsData(i,e,r),o=this.createOptions(e,i,a),s=new window.ol3Echarts(o,{hideOnMoving:!1,hideOnZooming:!1,forcedPrecomposeRerender:!0});return s.type="ECHARTS",s}createOptions(e,t,r){let i,a=this.createLineSeries(e,t);if(r&&r.length){let s=this.createPointSeries(e,r);i=a.concat(s)}else i=a.slice();return{series:i}}createLineSeries(e,t){let r=e.lineSetting,i=e.animationSetting,a=[{name:"line-series",type:"lines",zlevel:1,silent:!0,effect:{show:i.show,constantSpeed:i.constantSpeed,trailLength:0,symbol:i.symbol,symbolSize:i.symbolSize},lineStyle:{normal:{color:r.color,type:r.type,width:r.width,opacity:r.opacity,curveness:r.curveness}},data:t}];return t.length>yXr&&(a[0].blendMode="lighter"),a}createPointSeries(e,t){let r=e.lineSetting,i=e.animationSetting,a=e.labelSetting,o=[{name:"point-series",coordinateSystem:"geo",zlevel:2,silent:!0,label:{normal:{show:a.show,position:"right",formatter:"{b}",color:a.color,fontFamily:a.fontFamily}},itemStyle:{normal:{color:r.color||a.color}},data:t}];return i.show?(o[0].type="effectScatter",o[0].rippleEffect={brushType:"stroke"}):o[0].type="scatter",o}createPointsData(e,t,r){let i=[],a=t.labelSetting;if(!a.show||!e.length)return i;let o=[],s=[];return e.forEach((l,u)=>{let h=l.coords,c=h[0],f=h[1],d=r[u][a.from],v=r[u][a.to];!o.find(m=>m.value[0]===c[0]&&m.value[1]===c[1])&&o.push({name:d,value:c}),!s.find(m=>m.value[0]===f[0]&&m.value[1]===f[1])&&s.push({name:v,value:f})}),i=o.concat(s),i}createLinesData(e,t){let r=[];if(t&&t.length){let i=e.from,a=e.to,o,s;if(i.type==="XY_FIELD"&&i.xField&&i.yField&&a.xField&&a.yField)t.forEach(l=>{let u=l[i.xField],h=l[i.yField],c=l[a.xField],f=l[a.yField];!u||!h||!c||!f||(o=[l[i.xField],l[i.yField]],s=[l[a.xField],l[a.yField]],r.push({coords:[o,s]}))});else if(i.type==="PLACE_FIELD"&&i.field&&a.field){const l=_$r.concat(x$r);t.forEach(u=>{let h=u[i.field],c=u[a.field];o=l.find(f=>br.isMatchAdministrativeName(f.name,h)),s=l.find(f=>br.isMatchAdministrativeName(f.name,c)),!(!o||!s)&&r.push({coords:[o.coord,s.coord]})})}}return r}getService(e,t){return e.filter(i=>i&&i.serviceType===t)[0]}isMvt(e,t){let r=this;return this.getDatasetsInfo(e,t).then(i=>i.epsgCode==r.baseProjection.split("EPSG:")[1]?li.get(r.getRequestUrl(`${i.url}/tilefeature.mvt`),null,{withCredentials:r.withCredentials}).then(function(a){return a.json()}).then(function(a){return i.isMvt=a.error&&a.error.code===400,i}).catch(()=>i):i)}getDatasetsInfo(e,t){let r=this;return r.getDatasources(e).then(function(i){let a=`${e}/data/datasources/${i}/datasets/${t}.json`;return li.get(r.getRequestUrl(a),null,{withCredentials:r.withCredentials}).then(function(o){return o.json()}).then(function(o){return{epsgCode:o.datasetInfo.prjCoordSys.epsgCode,bounds:o.datasetInfo.bounds,url:a}})})}isRestMapMapboxStyle(e){const t="/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY";let r=e.dataSource,i=e.layerType;return!!(r&&r.type==="EXTERNAL"&&r.url.indexOf(t)>-1&&(i==="MAPBOXSTYLE"||i==="VECTOR_TILE"))}getMapboxStyleLayerInfo(e,t){let r=this;return new Promise((i,a)=>r.getMapLayerExtent(t).then(o=>r.getMapboxStyle(e,o).then(s=>{Object.assign(o,s),i(o)}).catch(s=>{a(s)})).catch(o=>{a(o)}))}getMapLayerExtent(e){const t="/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY";let i=e.dataSource.url;this.isRestMapMapboxStyle(e)&&(i=i.replace(t,"")),i=this.getRequestUrl(i+".json");let a=e.credential,o,s;return a&&(s=Object.keys(a)[0],o=a[s],i=`${i}?${s}=${o}`),li.get(i,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0,headers:{"Content-Type":"application/json;chartset=uft-8"}}).then(function(l){return l.json()}).then(l=>(e.visibleScales=l.visibleScales,e.coordUnit=l.coordUnit,e.scale=l.scale,e.epsgCode=l.prjCoordSys.epsgCode,e.bounds=l.bounds,e)).catch(l=>{throw l})}getMapboxStyle(e,t){let r=this,i=t.url||t.dataSource.url,a=i;a.indexOf("/restjsr/")>-1&&(a=`${a}/style.json`),a=this.getRequestUrl(a);let o=t.credential,s,l;return o&&(l=Object.keys(o)[0],s=o[l],a=`${a}?${l}=${s}`),li.get(a,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0,headers:{"Content-Type":"application/json;chartset=uft-8"}}).then(function(u){return u.json()}).then(u=>{r._matchStyleObject(u);let h=t.bounds;if(s){u.sprite=`${u.sprite}?${l}=${s}`;let f=u.sources;Object.keys(f).forEach(function(v){u.sources[v].tiles.forEach(function(p,g){u.sources[v].tiles[g]=`${p}?${l}=${s}`})})}let c={url:i,sourceType:"VECTOR_TILE",layerType:"VECTOR_TILE",styles:u,extent:h&&[h.left,h.bottom,h.right,h.top],bounds:t.bounds,projection:"EPSG:"+t.epsgCode,epsgCode:t.epsgCode,name:t.name};return Object.assign(t,c),t.zIndex>0&&r.modifyMapboxstyleLayer(e,t),t}).catch(u=>u)}modifyMapboxstyleLayer(e,t){let r=this;if(e.layers&&e.layers.length===0)return;let i=t.styles.layers;if(!i)return;i=i.filter(o=>o.type!=="background"),t.styles.layers=i;let a=e.layers.filter(o=>o.layerType==="VECTOR_TILE"&&o.zIndex!==t.zIndex).map(o=>o.styles&&o.styles.layers);!a||a&&a.length===0||a.forEach(o=>{i.forEach(s=>{r.renameLayerId(o,s)})})}renameLayerId(e,t){if(e.find(r=>r.id===t.id)){const r=t.id.match(/(.+)\((\w)\)$/);r?t.id=`${r[1]}(${+r[2]+1})`:t.id+="(1)",e.find(i=>i.id===t.id)&&this.renameLayerId(e,t)}}_matchStyleObject(e){let{sprite:t,glyphs:r}=e;t&&typeof t=="object"&&(e.sprite=Object.values(t)[0]),r&&typeof r=="object"&&(e.glyphs=Object.values(r)[0])}isIportalProxyServiceUrl(e){if(this.serviceProxy&&this.serviceProxy.enable&&e){let t="";return this.serviceProxy.proxyServerRootUrl?t=`${this.serviceProxy.proxyServerRootUrl}/`:this.serviceProxy.rootUrlPostfix?t=`${this.serviceProxy.port}/${this.serviceProxy.rootUrlPostfix}/`:this.serviceProxy.rootUrlPostfix||(t=`${this.serviceProxy.port}/`),this.serviceProxy.port!==80?e.indexOf(t)>=0:e.indexOf(t)>=0||e.indexOf(t.replace(":80",""))>=0}else return!1}getStyleResolutions(e,t=0,r=22){let i=[],o=Math.abs(e.left-e.right)/512;for(let s=t;s<=r;s++){if(s===0){i[s]=o;continue}o=o/2,i[s]=o}return i}createVisibleResolution(e,t,r,i){let a=[];if(e&&e.length>0)a=e.map(o=>{let s=1/o;return this.getResFromScale(s,i)});else{let o=this.getEnvelope(t,r);a=this.getStyleResolutions(o)}return a}getEnvelope(e,t){let r={};return e&&e.length===4?(r.left=e[0],r.bottom=e[1],r.right=e[2],r.top=e[3]):r=t,r}createMVTLayer(e){let t=e.styles;const r=t&&t.metadata&&t.metadata.indexbounds,i=this.createVisibleResolution(e.visibleScales,r,e.bounds,e.coordUnit),a=this.getEnvelope(r,e.bounds),o=this.getStyleResolutions(a);let s=this.isIportalProxyServiceUrl(t.sprite),l=new SQe({style:t,source:t.name,resolutions:o,map:this.map,withCredentials:s});return new Promise(u=>{l.on("styleloaded",function(){let h=i[i.length-1],c=i[0],f=new fPe({declutter:!0,source:new Zre({style:t,withCredentials:s,projection:e.projection,format:new w1({featureClass:qre}),wrapX:!1}),style:l.featureStyleFuntion,visible:e.visible,zIndex:e.zIndex,opacity:e.opacity,minResolution:h,maxResolution:c>1?Math.ceil(c):c*1.1});u(f)})})}isSupportWebp(e,t){if(this.isIE()||this.isFirefox()&&this.getFirefoxVersion()<65||this.isChrome()&&this.getChromeVersion()<32)return!1;e=t?`${e}/tileImage.webp?token=${t}`:`${e}/tileImage.webp`;let i=H.isInTheSameDomain(e),a;return i&&!t?a=!1:a=!0,e=this.getRequestUrl(e,a),li.get(e,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0}).then(function(o){if(o.status!==200)throw o.status;return o}).then(()=>!0).catch(()=>!1)}isIE(){return!!window.ActiveXObject||"ActiveXObject"in window}isFirefox(){return navigator.userAgent.indexOf("Firefox")>-1}isChrome(){return navigator.userAgent.indexOf("Chrome")>-1}getFirefoxVersion(){return+navigator.userAgent.toLowerCase().match(/firefox\/([\d.]+)/)[1]}getChromeVersion(){return+navigator.userAgent.toLowerCase().match(/chrome\/([\d.]+)/)[1]}addGraticule(e){if(this.isHaveGraticule){this.createGraticuleLayer(e.grid.graticule),this.layerAdded++;const t=e.layers?e.layers.length:0;this.sendMapToUser(t)}}createGraticuleLayer(e){const{strokeColor:t,strokeWidth:r,lineDash:i,extent:a,visible:o,interval:s,lonLabelStyle:l,latLabelStyle:u}=e,h=this.baseProjection;let c=new ya(h);c.setExtent(a),c.setWorldExtent(Cte(a,h,"EPSG:4326"));let f={layerID:"graticule_layer",strokeStyle:new es({color:t,width:r,lineDash:i}),extent:a,visible:o,intervals:s,showLabels:!0,zIndex:9999,wrapX:!1,targetSize:0};l&&(f.lonLabelStyle=new J1({font:`${l.fontSize} ${l.fontFamily}`,textBaseline:l.textBaseline,fill:new Ko({color:l.fill}),stroke:new es({color:l.outlineColor,width:l.outlineWidth})})),u&&(f.latLabelStyle=new J1({font:`${u.fontSize} ${u.fontFamily}`,textBaseline:u.textBaseline,fill:new Ko({color:u.fill}),stroke:new es({color:u.outlineColor,width:u.outlineWidth})}));const d=new M$r(f);this.map.addLayer(d)}getLang(){if(this.getCookie("language")){const e=this.getCookie("language");return this.formatCookieLang(e)}else return navigator.language||navigator.browserLanguage}getCookie(e){e=e.toLowerCase();let t=null;return document.cookie.split(";").forEach(function(i){const a=i.split("=");if(a[0].toLowerCase().trim()===e){t=a[1].trim();return}}),t}formatCookieLang(e){let t;switch(e){case"zh":t="zh-CN";break;case"ar":t="ar-EG";break;case"bg":t="bg-BG";break;case"ca":t="ca-ES";break;case"cs":t="cs-CZ";break;case"da":t="da-DK";break;case"de":t="de-DE";break;case"el":t="el-GR";break;case"es":t="es-ES";break;case"et":t="et-EE";break;case"fa":t="fa-IR";break;case"fl":t="fi-FI";break;case"fr":t="fr-FR";break;case"he":t="he-IL";break;case"hu":t="hu-HU";break;case"id":t="id-ID";break;case"is":t="is-IS";break;case"it":t="it-IT";break;case"ja":t="ja-JP";break;case"ko":t="ko-KR";break;case"ku":t="ku-IQ";break;case"mn":t="mn-MN";break;case"nb":t="nb-NO";break;case"ne":t="ne-NP";break;case"nl":t="nl-NL";break;case"pl":t="pl-PL";break;case"pt":t="pt-PT";break;case"ru":t="ru-RU";break;case"sk":t="sk-SK";break;case"sl":t="sl-SI";break;case"sr":t="sr-RS";break;case"sv":t="sv-SE";break;case"th":t="th-TH";break;case"tr":t="tr-TR";break;case"uk":t="uk-UA";break;case"vi":t="vi-VN";break;default:t="en-US";break}return t}isCustomProjection(e){return br.isNumber(e)?[-1e3,-1].includes(+e):["EPSG:-1000","EPSG:-1"].includes(e)}handleJSONSuffix(e){if(!e.includes(".json"))if(e.includes("?")){let t=e.split("?");t[0]=t[0]+".json",e=t.join("?")}else e=e+".json";return e}}class _Xr extends E7{constructor(e){e=e||{},e.format=e.format||"png",e.transparent=e.transparent===void 0?!0:e.transparent===!0,e.cacheEnabled=e.cacheEnabled===void 0?!0:e.cacheEnabled===!0;var t=e.attributions||"Map Data \xA9 SuperMap iServer",r=s(e.url,e),i={...e,attributions:t,url:r};!e.tileLoadFunction&&e.tileProxy&&(i.tileLoadFunction=o),super(i);var a=this;this.options=e,e.tileProxy&&(this.tileProxy=e.tileProxy);function o(h,c){h.getImage().src=a.tileProxy+encodeURIComponent(c)}function s(h,c){var f=H.urlPathAppend(h,`/collections/${c.collectionId}/tile.${c.format}?x={x}&y={y}&z={z}`),d=l(c);return f=H.urlAppend(f,u(d)),f=xs.appendCredential(f),c.cacheEnabled||(f+="&_t="+new Date().getTime()),f}function l(h){var c={};return c.transparent=h.transparent,c.cacheEnabled=h.cacheEnabled!==!1,h.sqlFilter&&(c.sqlFilter=h.sqlFilter),h.renderingRule&&(c.renderingRule=JSON.stringify(h.renderingRule)),h.ids&&(c.ids=h.ids.join(",")),h.names&&(c.names=h.names.join(",")),c}function u(h){var c=[];for(var f in h)c.push(encodeURIComponent(f)+"="+encodeURIComponent(h[f]));return c.join("&")}}}class xXr{constructor(e,t,r){this.MapService=e,this.url=t,this.options=r,this.CLASS_NAME="SuperMap.InitMapServiceBase"}createMapService(){const e=this.MapService,t=this.url,r=this.options;return new e(t,{proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,headers:r.headers,projection:r.projection})}getMapInfo(e){return new Promise((t,r)=>{this.createMapService().getMapInfo(a=>{e(a,t,r)})})}getWKT(){return new Promise((e,t)=>{this.createMapService().getWKT(i=>{try{const a=i.result.data;e(a)}catch(a){t(a)}})})}}function SXr(n){return n==="PCS_NON_EARTH"}window.proj4=Bu;function wXr(n,e={}){const{mapOptions:t,viewOptions:r,layerOptions:i,sourceOptions:a}=e,o=new xXr(nue,n,e);return o.getMapInfo(async function(s,l,u){if(!s||!s.result){u("service is not work!");return}let{prjCoordSys:h,bounds:c}=s.result;if(!ya(`EPSG:${h.epsgCode}`)&&!SXr(h.type)){const p=await o.getWKT();EXr(h.epsgCode,p,c)}let f=bXr(s.result,t,r),{layer:d,source:v}=TXr(n,s.result,a,i);f.addLayer(d),l({map:f,source:v,layer:d})})}function zQe(n,e=22){let{bounds:t,dpi:r,center:i,visibleScales:a,scale:o,coordUnit:s,prjCoordSys:l}=n;const u=i.x&&i.y?[i.x,i.y]:[(t.left+t.right)/2,(t.bottom+t.top)/2],h=[t.left,t.bottom,t.right,t.top];let c=br.getProjection(l,h);var f=br.scalesToResolutions(a,t,r,s,e);const d=br.getZoomByResolution(br.scaleToResolution(o,r,s),f);return{center:u,projection:c,zoom:d,resolutions:f}}function bXr(n,e,t){let r=zQe(n);var i=new EA({target:"map",view:new Lp({...r,...t}),...e});return i}function EXr(n,e,t){const r=[t.left,t.bottom,t.right,t.top];let i=`EPSG:${n}`;if(!ya(i)&&Bu.defs(i,e),wQe&&ZN){ZN(Bu);var a=ya(i);a.setExtent(r)}}function TXr(n,e,t,r){let i=Bp.optionsFromMapJSON(n,e,!0);i={...i,...t};var a=new Bp(i),o=new P8({source:a,...r});return{layer:o,source:a}}if(window&&window.ol){let n=window.ol;n.supermap={...ae,...n.supermap},n.supermap.control=n.supermap.control||{},n.supermap.control.ChangeTileVersion=Z0r,n.supermap.control.Logo=Fyr,n.supermap.control.ScaleLine=kyr,n.supermap.StyleUtils=ts,n.supermap.Util=br,n.source.BaiduMap=c$,n.source.ImageSuperMapRest=KRr,n.source.SuperMapCloud=eDr,n.source.ImageTileSuperMapRest=_Xr,n.source.Tianditu=rM,n.source.TileSuperMapRest=Bp,n.supermap.WebMap=mXr,n.style.CloverShape=L7,n.Graphic=qM,n.style.HitCloverShape=x8,n.source.GeoFeature=AS,n.source.Theme=fS,n.supermap.ThemeFeature=fZe,n.supermap.MapboxStyles=SQe,n.supermap.VectorTileStyles=Ka,n.source.DataFlow=CFr,n.source.Graph=_8,n.source.Graphic=v$,n.source.HeatMap=pVr,n.source.Label=WFr,n.source.Mapv=YFr,n.source.Range=qFr,n.source.RankSymbol=ZFr,n.source.Turf=OUr,n.source.FGB=WVr,n.source.Unique=RUr,n.source.VectorTileSuperMapRest=Zre,n.supermap.GraphMap=HVr,n.supermap.AddressMatchService=XVr,n.supermap.ChartService=qVr,n.supermap.DataFlowService=Ihe,n.supermap.DatasetService=JVr,n.supermap.DatasourceService=QVr,n.supermap.FeatureService=cZe,n.supermap.FieldService=KVr,n.supermap.GridCellInfosService=e$r,n.supermap.GeoprocessingService=t$r,n.supermap.LayerInfoService=n$r,n.supermap.MapService=nue,n.supermap.MeasureService=i$r,n.supermap.NetworkAnalyst3DService=o$r,n.supermap.NetworkAnalystService=l$r,n.supermap.ProcessingService=h$r,n.supermap.QueryService=hZe,n.supermap.ServiceBase=_l,n.supermap.SpatialAnalystService=f$r,n.supermap.ThemeService=d$r,n.supermap.TrafficTransferAnalystService=p$r,n.supermap.WebPrintingJobService=g$r,n.supermap.ImageService=y$r,n.supermap.ImageCollectionService=m$r,n.supermap.KnowledgeGraphService=_Qe,n.supermap.initMap=wXr,n.supermap.viewOptionsFromMapJSON=zQe,n.supermap.CommonUtil=H}const Gv=n=>(kd("data-v-ff64246d"),n=n(),Fd(),n),CXr={class:"layer-switcher"},AXr={key:0,class:"layer-panel"},MXr={class:"panel-tabs"},IXr={class:"tabs-left"},LXr={class:"tabs-right"},PXr={class:"checkbox-container master-select"},OXr=["checked"],RXr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),DXr=Gv(()=>fe("span",{class:"layer-name"},"\u5168\u9009",-1)),NXr=Gv(()=>fe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[fe("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),fe("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)),kXr=[NXr],FXr={key:0,class:"panel-content"},BXr={class:"layer-group"},GXr={class:"layer-grid"},zXr={class:"checkbox-container"},UXr=["onUpdate:modelValue","onChange"],VXr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),$Xr={class:"layer-name"},WXr={key:1,class:"panel-content"},HXr={class:"layer-group"},jXr={class:"layer-grid"},XXr={class:"checkbox-container"},YXr=["onUpdate:modelValue","onChange"],qXr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),ZXr={class:"layer-name"},KXr={key:2,class:"panel-content"},JXr={class:"layer-group"},QXr={class:"layer-grid-full"},eYr={class:"layer-item"},tYr={class:"checkbox-container"},rYr=["checked"],nYr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),iYr=Gv(()=>fe("span",{class:"layer-name"},"\u7535\u5B50\u56F4\u680F",-1)),aYr={class:"layer-item"},oYr={class:"checkbox-container"},sYr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),lYr=Gv(()=>fe("span",{class:"layer-name"},"\u8DEF\u7EBF\u56FE",-1)),uYr={class:"layer-item"},hYr={class:"checkbox-container"},cYr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),fYr=Gv(()=>fe("span",{class:"layer-name"},"\u6D4B\u8BD5\u533A\u57DF1",-1)),dYr={class:"layer-item"},vYr={class:"checkbox-container"},pYr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),gYr=Gv(()=>fe("span",{class:"layer-name"},"\u6D4B\u8BD5\u533A\u57DF2",-1)),yYr={__name:"LayerSwitcher",props:{map:Object,categories:Object},emits:["layerChange","setCategoryVisibility"],setup(n,{expose:e,emit:t}){const r=n,i=un(!1),a=un("icon");un("white");const o=un(!1),s=ul(()=>!o.value);let l=null;const u=un(!0);let h=null;const c=un(!0);let f=null;const d=un(!0);let v=null;const p=ul(()=>r.categories?Object.values(r.categories).every(V=>V.visible):!1),g=ul(()=>r.categories?Object.values(r.categories).every(V=>V.showLabel):!1),m=ul(()=>!o.value&&u.value&&c.value&&d.value),y=ul(()=>a.value==="icon"?p.value:a.value==="text"?g.value:a.value==="road"?m.value:!1);function _(){i.value=!i.value}function x(){if(!r.categories)return;const V=!p.value;Object.keys(r.categories).forEach(q=>{r.categories[q].visible=V,z(q)})}function S(){if(!r.categories)return;const V=!g.value;Object.keys(r.categories).forEach(q=>{r.categories[q].showLabel=V,z(q)})}function w(){const V=!m.value;o.value===V&&E(),u.value=V,c.value=V,d.value=V}function b(){a.value==="icon"?x():a.value==="text"?S():a.value==="road"&&w()}function E(){o.value=!o.value,console.log("toggleHideRoadLayer: hideRoadLayer =",o.value,"showRoadLayer =",s.value),s.value?A():R()}P0(()=>{r.map&&(T(),s.value&&A(),k(),G())}),Af(()=>r.map,V=>{V&&(T(),s.value&&A(),k(),G())}),e({setLayerVisibility(V,q){var Y;t("setCategoryVisibility",V,{visible:q,showLabel:((Y=r.categories[V])==null?void 0:Y.showLabel)||!0})}});async function T(){if(C(),!!r.map)try{const q=await(await fetch("./roadTest.json")).json(),Y=new Hx({features:new $b().readFeatures(q,{dataProjection:"EPSG:4326",featureProjection:r.map.getView().getProjection()})});h=new sp({source:Y,style:new T1({stroke:new jx({color:"#C9C9C9",width:1})}),zIndex:2,visible:u.value}),r.map.addLayer(h),console.log("loadCustomRoadLayer: \u5DF2\u6DFB\u52A0\u81EA\u5B9A\u4E49\u8DEF\u7EBF\u56FE\u5C42",h)}catch(V){console.error("loadCustomRoadLayer: \u52A0\u8F7D\u6216\u6DFB\u52A0\u81EA\u5B9A\u4E49\u8DEF\u7EBF\u56FE\u5C42\u5931\u8D25",V)}}function C(){if(!r.map)return;let V=!1;const q=r.map.getLayers().getArray();for(let Y=q.length-1;Y>=0;Y--){const le=q[Y];le instanceof sp&&le.getZIndex&&le.getZIndex()===2&&(r.map.removeLayer(le),V=!0,console.log("removeCustomRoadLayer: \u5DF2\u79FB\u9664\u81EA\u5B9A\u4E49\u8DEF\u7EBF\u56FE\u5C42",le))}h=null,V||console.log("removeCustomRoadLayer: \u6CA1\u6709\u627E\u5230\u53EF\u79FB\u9664\u7684\u81EA\u5B9A\u4E49\u8DEF\u7EBF\u56FE\u5C42")}Af(u,V=>{console.log("showCustomRoadLayer\u53D8\u5316:",V),V?h?h.setVisible(!0):T():h&&h.setVisible(!1)});async function A(){if(R(),!!r.map)try{const q=await(await fetch("./dianziweilan3.json")).json(),Y=new Hx({features:new $b().readFeatures(q,{dataProjection:"EPSG:4326",featureProjection:r.map.getView().getProjection()})}),le=new T1({stroke:new jx({color:"rgba(255, 0, 0, 0.8)",width:1}),fill:new C1({color:"rgba(255, 0, 0, 0.3)"})});l=new sp({source:Y,style:le,zIndex:2,className:"fence-layer"}),r.map.addLayer(l),console.log("addRoadLayer: \u5DF2\u6DFB\u52A0\u7535\u5B50\u56F4\u680F\u56FE\u5C42",l),await M()}catch(V){console.error("addRoadLayer: \u52A0\u8F7D\u6216\u6DFB\u52A0\u7535\u5B50\u56F4\u680F\u56FE\u5C42\u5931\u8D25",V)}}async function M(){try{const q=await(await fetch("./dianziweilan2.json")).json(),Y=new Hx({features:new $b().readFeatures(q,{dataProjection:"EPSG:4326",featureProjection:r.map.getView().getProjection()})}),le=new T1({stroke:new jx({color:"rgba(255, 255, 0, 0.8)",width:1}),fill:new C1({color:"rgba(255, 255, 0, 0.3)"})});I=new sp({source:Y,style:le,zIndex:1,className:"second-fence-layer"}),r.map.addLayer(I),console.log("addSecondRoadLayer: \u5DF2\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u7535\u5B50\u56F4\u680F\u56FE\u5C42",I)}catch(V){console.error("addSecondRoadLayer: \u52A0\u8F7D\u6216\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u7535\u5B50\u56F4\u680F\u56FE\u5C42\u5931\u8D25",V)}}let I=null;function R(){if(!r.map)return;let V=!1;const q=r.map.getLayers().getArray();for(let Y=q.length-1;Y>=0;Y--){const le=q[Y];le instanceof sp&&le.getZIndex&&(le.getZIndex()===1||le.getZIndex()===2)&&(r.map.removeLayer(le),V=!0,console.log("removeRoadLayer: \u5DF2\u79FB\u9664\u9053\u8DEF\u56FE\u5C42",le))}l=null,I=null,V||console.log("removeRoadLayer: \u6CA1\u6709\u627E\u5230\u53EF\u79FB\u9664\u7684\u9053\u8DEF\u56FE\u5C42")}Af(s,V=>{console.log("showRoadLayer\u53D8\u5316:",V),V?A():R()});async function k(){if(D(),!!r.map)try{const q=await(await fetch("./quyu1.json")).json(),Y=new Hx({features:new $b().readFeatures(q,{dataProjection:"EPSG:4326",featureProjection:r.map.getView().getProjection()})});f=new sp({source:Y,style:new T1({stroke:new jx({color:"#FF5733",width:2}),fill:new C1({color:"rgba(255, 87, 51, 0.3)"})}),zIndex:3,visible:c.value}),r.map.addLayer(f),console.log("loadArea1Layer: \u5DF2\u6DFB\u52A0\u533A\u57DF1\u56FE\u5C42",f)}catch(V){console.error("loadArea1Layer: \u52A0\u8F7D\u6216\u6DFB\u52A0\u533A\u57DF1\u56FE\u5C42\u5931\u8D25",V)}}function D(){if(!r.map)return;let V=!1;const q=r.map.getLayers().getArray();for(let Y=q.length-1;Y>=0;Y--){const le=q[Y];le instanceof sp&&le.getZIndex&&le.getZIndex()===3&&(r.map.removeLayer(le),V=!0,console.log("removeArea1Layer: \u5DF2\u79FB\u9664\u533A\u57DF1\u56FE\u5C42",le))}f=null,V||console.log("removeArea1Layer: \u6CA1\u6709\u627E\u5230\u53EF\u79FB\u9664\u7684\u533A\u57DF1\u56FE\u5C42")}async function G(){if(W(),!!r.map)try{const q=await(await fetch("./quyu2.json")).json(),Y=new Hx({features:new $b().readFeatures(q,{dataProjection:"EPSG:4326",featureProjection:r.map.getView().getProjection()})});v=new sp({source:Y,style:new T1({stroke:new jx({color:"#3374FF",width:2}),fill:new C1({color:"rgba(51, 116, 255, 0.3)"})}),zIndex:4,visible:d.value}),r.map.addLayer(v),console.log("loadArea2Layer: \u5DF2\u6DFB\u52A0\u533A\u57DF2\u56FE\u5C42",v)}catch(V){console.error("loadArea2Layer: \u52A0\u8F7D\u6216\u6DFB\u52A0\u533A\u57DF2\u56FE\u5C42\u5931\u8D25",V)}}function W(){if(!r.map)return;let V=!1;const q=r.map.getLayers().getArray();for(let Y=q.length-1;Y>=0;Y--){const le=q[Y];le instanceof sp&&le.getZIndex&&le.getZIndex()===4&&(r.map.removeLayer(le),V=!0,console.log("removeArea2Layer: \u5DF2\u79FB\u9664\u533A\u57DF2\u56FE\u5C42",le))}v=null,V||console.log("removeArea2Layer: \u6CA1\u6709\u627E\u5230\u53EF\u79FB\u9664\u7684\u533A\u57DF2\u56FE\u5C42")}Af(c,V=>{console.log("showArea1Layer\u53D8\u5316:",V),V?f?f.setVisible(!0):k():f&&f.setVisible(!1)}),Af(d,V=>{console.log("showArea2Layer\u53D8\u5316:",V),V?v?v.setVisible(!0):G():v&&v.setVisible(!1)}),i_(()=>{R(),C(),D(),W()});function z(V){console.log(`LayerSwitcher: \u8BBE\u7F6E\u5206\u7C7B ${V} \u53EF\u89C1\u6027`,{visible:r.categories[V].visible,showLabel:r.categories[V].showLabel}),t("setCategoryVisibility",V,{visible:r.categories[V].visible,showLabel:r.categories[V].showLabel})}return(V,q)=>(qr(),hn("div",CXr,[fe("div",{class:"layer-icon",onClick:_}),i.value?(qr(),hn("div",AXr,[fe("div",MXr,[fe("div",IXr,[fe("div",{class:cl(["tab",{active:a.value==="icon"}]),onClick:q[0]||(q[0]=Y=>a.value="icon")}," \u56FE\u6807 ",2),fe("div",{class:cl(["tab",{active:a.value==="text"}]),onClick:q[1]||(q[1]=Y=>a.value="text")}," \u6587\u672C ",2),fe("div",{class:cl(["tab",{active:a.value==="road"}]),onClick:q[2]||(q[2]=Y=>a.value="road")}," \u9053\u8DEF ",2)]),fe("div",LXr,[fe("label",PXr,[fe("input",{type:"checkbox",checked:Xo(y),onChange:b},null,40,OXr),RXr,DXr]),fe("div",{class:"close-btn",onClick:_,title:"\u5173\u95ED\u56FE\u5C42\u9762\u677F"},kXr)])]),a.value==="icon"?(qr(),hn("div",FXr,[fe("div",BXr,[fe("div",GXr,[(qr(!0),hn(Dp,null,Np(n.categories,(Y,le)=>(qr(),hn("div",{class:"layer-item",key:le},[fe("label",zXr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":j=>Y.visible=j,onChange:j=>z(le)},null,40,UXr),[[kC,Y.visible]]),VXr,fe("span",$Xr,mn(Y.name),1)])]))),128))])])])):a.value==="text"?(qr(),hn("div",WXr,[fe("div",HXr,[fe("div",jXr,[(qr(!0),hn(Dp,null,Np(n.categories,(Y,le)=>(qr(),hn("div",{class:"layer-item",key:le},[fe("label",XXr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":j=>Y.showLabel=j,onChange:j=>z(le)},null,40,YXr),[[kC,Y.showLabel]]),qXr,fe("span",ZXr,mn(Y.name),1)])]))),128))])])])):(qr(),hn("div",KXr,[fe("div",JXr,[fe("div",QXr,[fe("div",eYr,[fe("label",tYr,[fe("input",{type:"checkbox",checked:!o.value,onChange:E},null,40,rYr),nYr,iYr])]),fe("div",aYr,[fe("label",oYr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":q[3]||(q[3]=Y=>u.value=Y)},null,512),[[kC,u.value]]),sYr,lYr])]),fe("div",uYr,[fe("label",hYr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":q[4]||(q[4]=Y=>c.value=Y)},null,512),[[kC,c.value]]),cYr,fYr])]),fe("div",dYr,[fe("label",vYr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":q[5]||(q[5]=Y=>d.value=Y)},null,512),[[kC,d.value]]),pYr,gYr])])])])]))])):Bs("",!0)]))}},mYr=rf(yYr,[["__scopeId","data-v-ff64246d"]]);function j$(n,e){return n&&typeof n=="object"&&n.status==="error"&&n.message||e}async function _Yr(n){const e=await PS({url:"/api/VehicleRegistry",method:"post",data:n});if(e&&typeof e=="object"&&e.status==="error")throw new Error(j$(e,"\u5BF9\u8C61\u6CE8\u518C\u540C\u6B65\u5931\u8D25"));return e}async function xYr(n){const e=await PS({url:"/config/runway/alert_zone_radius/aircraft",method:"post",data:{value:n}});if(e&&typeof e=="object"&&e.status==="error")throw new Error(j$(e,"\u4FEE\u6539\u544A\u8B66\u533A\u534A\u5F84\u5931\u8D25"));return e}async function SYr(n){const e=(()=>{if(typeof n=="number")return{value:n};if(!n||typeof n!="object")return{};if(Object.prototype.hasOwnProperty.call(n,"value"))return{value:n.value};const r={};return Object.prototype.hasOwnProperty.call(n,"vehicleDistance")&&(r.vehicleDistance=n.vehicleDistance),Object.prototype.hasOwnProperty.call(n,"aircraftDistance")&&(r.aircraftDistance=n.aircraftDistance),r})(),t=await PS({url:"/config/collision/diverging_release_distance",method:"post",data:e});if(t&&typeof t=="object"&&t.status==="error")throw new Error(j$(t,"\u4FEE\u6539\u51B2\u7A81\u89E3\u9664\u8DDD\u79BB\u9608\u503C\u5931\u8D25"));return t}async function wYr(n){const e=await PS({url:"/api/vehicle-route/assignment",method:"post",data:n});if(e&&typeof e=="object"&&e.status==="error")throw new Error(j$(e,"\u8F66\u8F86\u8DEF\u7EBF\u5206\u914D\u5931\u8D25"));return e}const X$=n=>(kd("data-v-f567b4ae"),n=n(),Fd(),n),bYr=["onClick"],EYr={class:"vehicle-edit-dialog"},TYr={class:"dialog-header"},CYr=X$(()=>fe("span",{class:"dialog-title"},"\u8FD0\u884C\u5BF9\u8C61\u7F16\u8F91",-1)),AYr=["src"],MYr={class:"dialog-body"},IYr={class:"search-row"},LYr=X$(()=>fe("span",{class:"search-label"},"\u5BF9\u8C61\u68C0\u7D22\uFF1A",-1)),PYr=["onKeyup"],OYr=vne('
    \u542F\u52A8
    \u822A\u73ED\u53F7/\u8F66\u724C\u53F7
    \u7C7B\u578B
    \u8DEF\u7EBF
    ',1),RYr={class:"table-body"},DYr={key:0,class:"table-empty"},NYr={key:1,class:"table-empty"},kYr={key:2,class:"table-rows"},FYr={class:"col col-enable"},BYr={class:"checkbox-container"},GYr=["onUpdate:modelValue"],zYr=X$(()=>fe("span",{class:"checkmark"},null,-1)),UYr={class:"col col-id"},VYr={class:"cell-box"},$Yr={class:"col col-type"},WYr=["onUpdate:modelValue"],HYr=["value"],jYr={class:"col col-route"},XYr=["onUpdate:modelValue"],YYr=X$(()=>fe("option",{value:""},"\u672A\u9009\u62E9",-1)),qYr=["value"],ZYr={class:"dialog-footer"},KYr=["disabled"],JYr=["disabled"],QYr={__name:"VehicleRunningEditDialog",props:{visible:{type:Boolean,default:!1}},emits:["close"],setup(n,{emit:e}){const t=n,r=OPe(),i=un(!1),a=un(!1),o=un(""),s=un([]);let l=null,u=null,h=null;const c=[{label:"\u822A\u7A7A\u5668",value:"AIRCRAFT"},{label:"\u65E0\u4EBA\u8F66",value:"UNMANNED_VEHICLE"},{label:"\u7279\u52E4\u8F66",value:"SPECIAL_VEHICLE"}],f=[{label:"807-805",routeName:"807-805",description:"\u6D4B\u8BD5\u8DEF\u7EBF-807-805",points:[{lon:40508513641064e-6,lat:4024186813497e-6},{lon:40508714127776e-6,lat:4024250934516e-6},{lon:40508853166318e-6,lat:4024293929307e-6},{lon:40508966275693e-6,lat:4024330441807e-6}]},{label:"M4 829-826-K1",routeName:"M4 829-826-K1",description:"\u6D4B\u8BD5\u8DEF\u7EBF-M4 829-826-K1",points:[{lon:40507849913313e-6,lat:4023625932486e-6},{lon:40507732597485e-6,lat:4023991671027e-6},{lon:40507723998527e-6,lat:4023986908527e-6},{lon:40507674841898e-6,lat:402413830738e-5}]},{label:"M1 K2-1-1-1#\u6D88\u9632",routeName:"M1 K2-1-1-1#\u6D88\u9632",description:"\u6D4B\u8BD5\u8DEF\u7EBF-M1 K2-1-1-1#\u6D88\u9632",points:[{lon:40509113197805e-6,lat:4024029951692e-6},{lon:40508997734226e-6,lat:4024393687528e-6},{lon:40509007523809e-6,lat:4024395275028e-6},{lon:40508957783071e-6,lat:4024548361738e-6}]}],d=ul(()=>{const T=(o.value||"").trim().toLowerCase();return T?s.value.filter(C=>String((C==null?void 0:C.id)||"").toLowerCase().includes(T)):s.value});function v(){o.value=(o.value||"").trim()}function p(T){if(!T)return null;if(typeof T=="object")return T;if(typeof T!="string")return null;try{return JSON.parse(T)}catch{return null}}function g(T){const C=String(T||"").toUpperCase();return C==="UNMANNED_VEHICLE"?"\u65E0\u4EBA\u8F66":C==="SPECIAL_VEHICLE"?"\u7279\u52E4\u8F66":C==="AIRCRAFT"?"\u822A\u7A7A\u5668":C==="WUREN"?"\u65E0\u4EBA\u8F66":C==="TEQIN"?"\u7279\u52E4\u8F66":C==="AIRCRAFT"||C==="AIRCRAFT_IN"||C==="AIRCRAFT_OUT"||C==="HANGKONG"?"\u822A\u7A7A\u5668":C||"\u672A\u77E5"}function m(T){const C=String(T||"").toUpperCase();return C==="UNMANNED_VEHICLE"||C==="WUREN"?"UNMANNED_VEHICLE":C==="SPECIAL_VEHICLE"||C==="TEQIN"?"SPECIAL_VEHICLE":(C==="AIRCRAFT"||C==="HANGKONG"||C==="AIRCRAFT_IN"||C==="AIRCRAFT_OUT","AIRCRAFT")}function y(T){const C=String(T||"").toUpperCase();return C==="UNMANNED_VEHICLE"?"WUREN":C==="SPECIAL_VEHICLE"?"TEQIN":C==="AIRCRAFT"?"HANGKONG":C==="WUREN"?"WUREN":C==="TEQIN"?"TEQIN":C==="AIRCRAFT"||C==="AIRCRAFT_IN"||C==="AIRCRAFT_OUT"||C==="HANGKONG"?"HANGKONG":C==="JIUYUAN"?"JIUYUAN":"PUTONG"}function _(T){const C=String(T||"").toUpperCase();return C==="UNMANNED_VEHICLE"||C==="WUREN"?"UNMANNED_VEHICLE":C==="SPECIAL_VEHICLE"||C==="TEQIN"?"SPECIAL_VEHICLE":""}function x(T,C){const A=String(T||"").trim();if(!A)return;g(C);const M=String(C||"").trim(),I=r.getVehicleRouteAssignment(A),R=s.value.find(G=>(G==null?void 0:G.id)===A);if(R){if(R.lastSeen=Date.now(),M&&(R.objectType=M),!R.typeSelected){const G=r.getVehicleTypeOverride(A);R.typeSelected=G||m(M)}!R.routeName&&I&&(R.routeName=I);return}const k=r.isVehicleEnabled(A),D=r.getVehicleTypeOverride(A);s.value=[...s.value,{id:A,enabled:k,objectType:M,typeSelected:D||m(M),routeName:I||"",lastSeen:Date.now()}]}function S(){var C;const T=(C=window.APP_CONFIG)==null?void 0:C.WS_BASE_URL;if(!T){i.value=!1;return}l=brt(T,{reconnectInterval:3e3,maxReconnectAttempts:5}),u=A=>{const M=p(A);if(!M||M.type!=="position_update")return;const I=M.payload||{};x(I.object_id,I.object_type),i.value&&(i.value=!1)},l.on("message",u),l.send(JSON.stringify({type:"subscribe",topics:["position_update","collision_warning","rule_violation"],timestamp:Date.now()})),h&&clearTimeout(h),h=setTimeout(()=>{i.value=!1},1200)}function w(){h&&(clearTimeout(h),h=null),l&&u&&l.off("message",u),u=null,l=null}function b(){a.value||e("close")}async function E(){if(!a.value){a.value=!0;try{const T=(s.value||[]).filter(I=>!!(I!=null&&I.id)&&I.enabled===!0).map(I=>({vehicleID:String(I.id),vehicleType:y(I.typeSelected||I.objectType)})),C=(s.value||[]).filter(I=>!!(I!=null&&I.id)&&I.enabled!==!0&&r.isVehicleEnabled(I.id)).map(I=>({vehicleID:String(I.id),vehicleType:"PUTONG"})),A=[...T,...C];A.length&&await _Yr(A);const M=(s.value||[]).filter(I=>!!(I!=null&&I.id)&&I.enabled===!0&&!!I.routeName).map(I=>{const R=f.find(D=>D.routeName===I.routeName),k=_(I.typeSelected||I.objectType);return!R||!k?null:{vehicleID:String(I.id),vehicleType:k,routeName:R.routeName,description:R.description,status:"ACTIVE",isBidirectional:!1,maxSpeedKph:25,typicalSpeedKph:15,points:R.points,route:{points:R.points}}}).filter(Boolean);M.length&&await Promise.all(M.map(I=>wYr(I))),(s.value||[]).forEach(I=>{!(I!=null&&I.id)||(r.setVehicleTypeOverride(I.id,I.typeSelected||m(I.objectType)),r.setVehicleRouteAssignment(I.id,I.routeName),r.setVehicleEnabled(I.id,I.enabled===!0))}),Sp.success("\u5DF2\u540C\u6B65\u5230\u540E\u7AEF"),e("close")}catch(T){Sp.error((T==null?void 0:T.message)||"\u540C\u6B65\u5931\u8D25")}finally{a.value=!1}}}return Af(()=>t.visible,async T=>{if(!T){w();return}o.value="",s.value=[],i.value=!0,S()},{immediate:!1}),(T,C)=>n.visible?(qr(),hn("div",{key:0,class:"vehicle-edit-mask",onClick:NA(b,["self"])},[fe("div",EYr,[fe("div",TYr,[CYr,fe("img",{class:"dialog-close",src:Xo(hz),alt:"close",onClick:b},null,8,AYr)]),fe("div",MYr,[fe("div",IYr,[LYr,lu(fe("input",{"onUpdate:modelValue":C[0]||(C[0]=A=>o.value=A),class:"search-input",placeholder:"\u8BF7\u8F93\u5165\u822A\u73ED\u53F7/\u8F66\u724C\u53F7",onKeyup:RPe(v,["enter"])},null,40,PYr),[[qg,o.value]])]),OYr,fe("div",RYr,[i.value?(qr(),hn("div",DYr,"\u52A0\u8F7D\u4E2D...")):Xo(d).length===0?(qr(),hn("div",NYr,"\u6682\u65E0\u6570\u636E")):(qr(),hn("div",kYr,[(qr(!0),hn(Dp,null,Np(Xo(d),A=>(qr(),hn("div",{key:A.id,class:"table-row"},[fe("div",FYr,[fe("label",BYr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":M=>A.enabled=M},null,8,GYr),[[kC,A.enabled]]),zYr])]),fe("div",UYr,[fe("div",VYr,mn(A.id),1)]),fe("div",$Yr,[lu(fe("select",{"onUpdate:modelValue":M=>A.typeSelected=M,class:"type-select"},[(qr(),hn(Dp,null,Np(c,M=>fe("option",{key:M.value,value:M.value},mn(M.label),9,HYr)),64))],8,WYr),[[Dde,A.typeSelected]])]),fe("div",jYr,[lu(fe("select",{"onUpdate:modelValue":M=>A.routeName=M,class:"type-select"},[YYr,(qr(),hn(Dp,null,Np(f,M=>fe("option",{key:M.routeName,value:M.routeName},mn(M.label),9,qYr)),64))],8,XYr),[[Dde,A.routeName]])])]))),128))]))])]),fe("div",ZYr,[fe("button",{class:"footer-btn cancel",disabled:a.value,onClick:b},"\u53D6\u6D88",8,KYr),fe("button",{class:"footer-btn confirm",disabled:a.value,onClick:E},mn(a.value?"\u63D0\u4EA4\u4E2D...":"\u786E\u5B9A"),9,JYr)])])],8,bYr)):Bs("",!0)}},eqr=rf(QYr,[["__scopeId","data-v-f567b4ae"]]);const qce=n=>(kd("data-v-0989065e"),n=n(),Fd(),n),tqr=["onClick"],rqr={class:"dialog"},nqr={class:"dialog-header"},iqr=qce(()=>fe("span",{class:"dialog-title"},"\u4FEE\u6539\u9884\u8B66\u8DDD\u79BB",-1)),aqr=["src"],oqr={class:"dialog-body"},sqr={class:"form-row"},lqr=qce(()=>fe("span",{class:"form-label"},"\u544A\u8B66\u8DDD\u79BB\u8C03\u6574\uFF1A",-1)),uqr={class:"form-row"},hqr=qce(()=>fe("span",{class:"form-label"},"\u5206\u79BB\u8DDD\u79BB\u8C03\u6574\uFF1A",-1)),cqr={__name:"WarningDistanceDialog",props:{visible:{type:Boolean,default:!1}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=un({vehicleDistance:"",aircraftDistance:"",separationDistance:""});function i(){e("close")}function a(){e("confirm",{...r.value})}return Af(()=>t.visible,o=>{!o||(r.value={vehicleDistance:"",aircraftDistance:"",separationDistance:""})}),(o,s)=>n.visible?(qr(),hn("div",{key:0,class:"dialog-mask",onClick:NA(i,["self"])},[fe("div",rqr,[fe("div",nqr,[iqr,fe("img",{class:"dialog-close",src:Xo(hz),alt:"close",onClick:i},null,8,aqr)]),fe("div",oqr,[fe("div",sqr,[lqr,lu(fe("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>r.value.vehicleDistance=l),class:"form-input",placeholder:"\u65E0\u4EBA\u8F66\u62A5\u8B66\u8DDD\u79BB"},null,512),[[qg,r.value.vehicleDistance]]),lu(fe("input",{"onUpdate:modelValue":s[1]||(s[1]=l=>r.value.aircraftDistance=l),class:"form-input",placeholder:"\u98DE\u673A\u544A\u8B66\u8DDD\u79BB"},null,512),[[qg,r.value.aircraftDistance]])]),fe("div",uqr,[hqr,lu(fe("input",{"onUpdate:modelValue":s[2]||(s[2]=l=>r.value.separationDistance=l),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,r.value.separationDistance]])])]),fe("div",{class:"dialog-footer"},[fe("button",{class:"footer-btn cancel",onClick:i},"\u53D6\u6D88"),fe("button",{class:"footer-btn confirm",onClick:a},"\u786E\u5B9A")])])],8,tqr)):Bs("",!0)}},fqr=rf(cqr,[["__scopeId","data-v-0989065e"]]);const oF=n=>(kd("data-v-4ad96261"),n=n(),Fd(),n),dqr=["onClick"],vqr={class:"dialog"},pqr={class:"dialog-header"},gqr=oF(()=>fe("span",{class:"dialog-title"},"\u822A\u7A7A\u5668\u6ED1\u884C\u8DEF\u7531\u67E5\u8BE2",-1)),yqr=["src"],mqr={class:"dialog-tabs"},_qr={class:"dialog-body"},xqr={class:"form-grid"},Sqr={class:"form-item"},wqr=oF(()=>fe("span",{class:"form-label"},[a_("flightNo\uFF08\u822A\u73ED\u53F7\uFF09\uFF1A"),fe("span",{class:"required"},"*")],-1)),bqr={class:"form-item"},Eqr=oF(()=>fe("span",{class:"form-label"},"inRunway\uFF08\u8FDB\u6E2F\u8DD1\u9053\uFF09\uFF1A",-1)),Tqr={class:"form-item"},Cqr=oF(()=>fe("span",{class:"form-label"},"outRunway\uFF08\u51FA\u6E2F\u8DD1\u9053\uFF09\uFF1A",-1)),Aqr={key:0,class:"form-item"},Mqr=oF(()=>fe("span",{class:"form-label"},[a_("contactCross\uFF08\u8054\u7EDC\u9053\u53E3\uFF09\uFF1A"),fe("span",{class:"required"},"*")],-1)),Iqr={class:"form-item"},Lqr={class:"form-label"},Pqr={key:0,class:"required"},Oqr={class:"form-hint"},Rqr={key:0},Dqr={key:1},Nqr={__name:"RouteModifyDialog",props:{visible:{type:Boolean,default:!1}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=un("IN"),i=un({flightNo:"",inRunway:"",outRunway:"",contactCross:"",seat:""});function a(){e("close")}function o(){const s=String(i.value.flightNo||"").trim();if(!s){Sp.warning("\u8BF7\u8F93\u5165\u822A\u73ED\u53F7 flightNo");return}const l={routeType:r.value,flightNo:s,objectId:s,vehicleID:s,objectName:s};if(r.value==="IN"){if(!i.value.inRunway||!i.value.contactCross||!i.value.seat){Sp.warning("\u8FDB\u6E2F\u67E5\u8BE2\u5FC5\u987B\u586B\u5199\uFF1A\u8FDB\u6E2F\u8DD1\u9053\u3001\u8054\u7EDC\u9053\u53E3\u3001\u673A\u4F4D\u53F7");return}l.inRunway=i.value.inRunway,l.contactCross=i.value.contactCross,l.seat=i.value.seat,i.value.outRunway&&(l.outRunway=i.value.outRunway)}else{if(!i.value.outRunway){Sp.warning("\u51FA\u6E2F\u67E5\u8BE2\u5FC5\u987B\u586B\u5199\uFF1A\u51FA\u6E2F\u8DD1\u9053");return}const u=String(i.value.seat||"").trim();if(!u){Sp.warning("\u51FA\u6E2F\u67E5\u8BE2\u5FC5\u987B\u586B\u5199\uFF1A\u673A\u4F4D\u53F7 seat");return}l.outRunway=i.value.outRunway,l.seat=u,i.value.inRunway&&(l.inRunway=i.value.inRunway)}e("confirm",l),e("close")}return Af(()=>t.visible,s=>{!s||(r.value="IN",i.value={flightNo:"",inRunway:"",outRunway:"",contactCross:"",seat:""})}),(s,l)=>n.visible?(qr(),hn("div",{key:0,class:"dialog-mask",onClick:NA(a,["self"])},[fe("div",vqr,[fe("div",pqr,[gqr,fe("img",{class:"dialog-close",src:Xo(hz),alt:"close",onClick:a},null,8,yqr)]),fe("div",mqr,[fe("div",{class:cl(["tab",{active:r.value==="IN"}]),onClick:l[0]||(l[0]=u=>r.value="IN")},"\u8FDB\u6E2F\u8DEF\u7531",2),fe("div",{class:cl(["tab",{active:r.value==="OUT"}]),onClick:l[1]||(l[1]=u=>r.value="OUT")},"\u51FA\u6E2F\u8DEF\u7531",2)]),fe("div",_qr,[fe("div",xqr,[fe("div",Sqr,[wqr,lu(fe("input",{"onUpdate:modelValue":l[2]||(l[2]=u=>i.value.flightNo=u),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,i.value.flightNo]])]),fe("div",bqr,[Eqr,lu(fe("input",{"onUpdate:modelValue":l[3]||(l[3]=u=>i.value.inRunway=u),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,i.value.inRunway]])]),fe("div",Tqr,[Cqr,lu(fe("input",{"onUpdate:modelValue":l[4]||(l[4]=u=>i.value.outRunway=u),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,i.value.outRunway]])]),r.value==="IN"?(qr(),hn("div",Aqr,[Mqr,lu(fe("input",{"onUpdate:modelValue":l[5]||(l[5]=u=>i.value.contactCross=u),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,i.value.contactCross]])])):Bs("",!0),fe("div",Iqr,[fe("span",Lqr,[a_("seat\uFF08\u673A\u4F4D\u53F7\uFF09\uFF1A"),r.value==="IN"?(qr(),hn("span",Pqr,"*")):Bs("",!0)]),lu(fe("input",{"onUpdate:modelValue":l[6]||(l[6]=u=>i.value.seat=u),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,i.value.seat]])])]),fe("div",Oqr,[r.value==="IN"?(qr(),hn("div",Rqr,"\u8FDB\u6E2F\u5FC5\u586B\uFF1AflightNo\u3001inRunway\u3001contactCross\u3001seat\uFF1B\u5EFA\u8BAE\u586B\u5199\uFF1AoutRunway")):(qr(),hn("div",Dqr,"\u51FA\u6E2F\u5FC5\u586B\uFF1AflightNo\u3001outRunway\u3001seat\uFF1B\u5EFA\u8BAE\u586B\u5199\uFF1AinRunway"))])]),fe("div",{class:"dialog-footer"},[fe("button",{class:"footer-btn cancel",onClick:a},"\u53D6\u6D88"),fe("button",{class:"footer-btn confirm",onClick:o},"\u67E5\u8BE2")])])],8,dqr)):Bs("",!0)}},kqr=rf(Nqr,[["__scopeId","data-v-4ad96261"]]);function Fqr(n){return PS({url:"/api/aircraft-routes/query",method:"post",data:n})}const Bqr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAACklpQ0NQc1JHQiBJRUM2MTk2Ni0yLjEAAEiJnVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/stRzjPAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAJcEhZcwAACxMAAAsTAQCanBgAAAEdSURBVEiJtdWxK0VhGAfg5yLLRYhYGLAYDHKZjHexSGQ2Wa3qDkrKH8JgY7BIGZSR0SChpBhkuWIgx3C/6d5c57ud8y2/es953+e833IKSZJodkq7DaUeVJHAZaVpu7bmjxtOERc4RHeahlhgB1OYxHiaho6I4XPYwDPKeErTFLNBBe3YTDs8BujHAh5xEPFRqYFVdGIf33kA5ZDHMcNjgHl84SoPYBDDuBd5PWmBsZC3scPTAn0h7/ICekN+5gVUQ3blBbyEHM0LuAk5nRfwjmuMYCIPAM5CLocs//Viq8BRyHVs4xRDWQLneFC7oi0UMJMlUMRrXa2UFdCGE8zW1TPb4AeLWFP72X+Eej3YMgBv2MMKBrCktlXxv8ZfcIwuNRzwDTEAAAAASUVORK5CYII=",Gqr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAACklpQ0NQc1JHQiBJRUM2MTk2Ni0yLjEAAEiJnVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/stRzjPAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAJcEhZcwAACxMAAAsTAQCanBgAAAEdSURBVEiJtdW/K4VRGAfwD12DH3eRgZJCMlgUu0HpLgY2A3+IkjIoK6PJLMKidEcTV0bLZWAhQiGluIZ7lKTrXL3nWb6973me99P7LKehUqmoVaPLWrGGXRzg9ft5ab7muMbax+AFBezgDluYQ3vEbBQAxyFbMI0N7MXMxwInv4AFfGQFlH48d6iu7s+q5w8qWEIZvRjLErjBBBaxHt5NZQlAMeR2yPGsga8q4wpDaEsBwGnIwVTAZcjOVMBzyHwqoDnkYyqgP+RDKmAg5EUKIIc+XOM2BTCCJhzGNP8HmAxZrNn1TyCHWbxhMwUwgx7s4z5roBsreMdy7FAsMKy68y6s4igWyEX2neNMdfcLsR+vB3hSvezzIq/Kr/oE3Zs1N+v+bUIAAAAASUVORK5CYII=",zqr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAASLSURBVHgBzVnPbxtFFH5vZp0fTiyBgg9OKUUcHEsQqa05UdSkd/gDAvf0wg3+jPbGpblxyo1Dwx1EHVWocmhEBbG5QCo5UZQoSG6axJuZx3uzXttx12vHcm1/B+/Oj5355pt5b2aeEfpE7va9PJDNgsW8RVpAhFkASgWlWCWCPUVYAbBl0Lq4s/VzEfoAXqXywsKdFM7oFSJcaZLpuasKEhVR09pfxSd7PX/VSyVHLKlXCWAFBgAk2OiVaFeCuU+XVsjA6tUV69p1BS2u7Wz/8lNcLR1XmLt191teS0wOJmHwSLGUy+nMjdTh/r9PO1WKVNBN6bT3gJDyMAQQURlP7f1SabPaXqYiP5j2Hg2LnAARszStH0SVvTHFMq2s6zIMGeym5qOm+xLB3O2lL9lSv4HRYTGd+bDKJF+EGY0pXrh1Z95aZxAjhRil2ECYbhBE0quIlIFRA8n53EZSfkQ9nu3HME54be6JVTsFRT0YM9gp7XYtR9ACDs2l9AqF6AiinEqIzKNuH8haoLZ0CIK3A0R73wNj8tHuOqykGoQQ2H3zgmDHiuL+idPYSljqkgV3HAg+dr/k8qROkC8/YV4sSGc9fmTjyAkppTVq7gy1Yuk1Wj49cJnkcGd1/Uj4Od7yjpclFzJKSKF/YUh8CaepG0lrKe9ZhfPYYZJEKI/JJSan1VRyVmsvgUo419tlQk5F5RqDy26f2juzZI2l2tmJOX99an1z0ZUkt5/1eKCZaHJKZgi9RELNzmUmkukPJtVEUolKqkUXgMDS2t+5GlhqOlrmB+bi3J4f7/tw8M+ZPXllWE2IBUHK63TOk5Ep9MBLTEAi+Y6eeO+jqfQnS+/qhKeC8nAgYVvBT2NR1ueYmp25pDU+7T/98WD32caRiBA7zey0PYiBJRm1gdrJsXn/xsezyblr0zAAXFv6OrP72+OjXup6csHpqCIz9P1zc/rfgX/456/HE6m5hJqcaVlpIkuv15rQmAgqzzYOLmTRdrNkwipmby5txO3BSmnwPLZdpflVi3k2LTTKOVLzHQN7dSOw4pbY+sVYfN+IxXT1n/x52WM7KhFCR4KWG/J9blpZQ7Vawy82jME9CVRdSVtvumHsIUUK/R/15gNdY1jx2BL4vkrLcfWkQdMwuKDxMNn+hA7pfsCDL/NATRnGFdYW1c5WoRgYytihsvNHoRgctyytw5iBl6oLlQROd9aMHUHNkQd5OoKlzc0qW9jYkGT1NsKwSPNOkjRrY7IWK6F6gsaucPTyZS2duV5jkp/BCIHWPtz5vbAVpi/diw/3d1/M8eWZ/eoijABk7Xppu/BDa17kRpq7eZdDHzDUe4rEZ8rPn3zVnh8dm5kx38k+CEOCuBQJHkWVxR5FshynwQEFLTtBprW8XXjYqTw2PnjEgZz0/PU9HiHHoHHAAUyq8iHj+7+fF9biavUWAubIA7nQCHwBA4Cohme0FhUPbMfVguh1otxFnhW9YhyHFeMtVZ3Rei/E+iLYitzi53yfVnKnzvJUzQeXr3AZkPwN8YovpiU+khThAsqy8UMf+B9ymBOEqiwGgAAAAABJRU5ErkJggg==",Uqr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYdSURBVHgBvVnNbxtFFH9vZtdrO3bS1EnaWI34Eo6lkqptQFBa+iHEDSQQXMIf0F64wR/AGbUXxIVw4lSJQw9tT1xANFUlkEsLlRq7SBQinH6lbepQx+vdeX2zazub1HZ2t1F/ipV4Z3bmN+/N+82bF4SYKO4/Ng2kCqBwWiFNIkIGgLJ+K9aIYFEQVgFUBaQszV/+qQQxgFE6T04ezOKAnCHCmTUyoaeqIlEJJc1eL11YDP1WmE4esbQ8TgAzsAVAgnNhiW5KsPj6kRly4Xh0i206dRUVzs5f/fl8v16yX2Nx3+HPeS8xObBg65FlUx4dHX8he+/WP5d6depqQc+lKeMkIU3DcwARVbCuTpTLF2sb20TXF1LGt1HJIUSMuOC7iAVKyZPd2p5ysXYrz3QUQg8uQAhAgZL/5A/6VBEIooBfy3dz9zqCxf1HPuBhP4OQ0OQQCU0zgQnLktI0heCZ2GUtetFIMqZGx1+sMclrTxGc3HcwTyS+5PFDR6tg05nSEKnsNiO78+VkOjduouug22yQUopZRibIa8KpkaFdZ5aWFmxvjvZzJHmcrTEedhzPkexJI5HA9PAOMzuxOz0y9d72/IGPclbSQsmmjEFPE/E0t/3VI+hZD+F9iAh2MLAB0bDS0hoaM8f2vDsy/ubHO0d3H93m78N40AeCVhJ/DvCtB1GBvvH1nmNPg0ykO9tFJjPoNaOAuFBJOdMhqACj6x0pn6d2NOjtpjZ4NK79fPDCfYI6K4my9zpTs3UIdQzDOsLtDohd3ok0CWWL+w9NG+C609DHE76UYEvfyJuK1Y6tzgHComII/2UKEGRlRI5wIaVk/pJtu2ZcT4I8KNgUJAsG/yr0aucpPGMYUqI0paajFVnbjbRrDUNiMpkSppQiKCmmIUUmkxH2qq0XorMXpuMRA8exleMoUAo2JclKNW0ogfl+qs8kRHIgI1KZYUOYWj4ktszEIirQtBLCSA+JYECY6YyRGdllua6/L7Vsuy6BcprKfrzs1msP3YbdZHaiL0k2RsHg2bruv7ZrZSKJ6e27ElZuwpJWSrReXNfTkaYwAwQplTPk2KtJqfwt0SJJym2SfHCn6To3Vh1nWTWdJvQFQdbolef5K9MSIlGwG4deeWNwx55jOQiBkdeO5fSnV3v1t7O3K+e//k8boa+bOVDEJisAl93SWL7rpAaHDdgibHtp7yCxyyFEoBj6gtPLihx9ZDdWlXhwx/77x++q+bc+tKU10BFkbwtw0AgzKYzBsURyOJ/Uz+u3//q/8eiurQMhmDDoaNYBc/PCD3ccpTY/qQlrBvda6ZUgaPPrSer1urIXyvWH1a8WvAOutQVZRkQmPSDTubw1UHhnMH/gk536+f3rv9xfuHTmvt2wWxmD70qt5ZqWUg6FySMI1aLBcVRmzegp1N7AWiaUC+i0HuoA4l+GKZXtJITpOBQ0iMMha9u2sptNxQ3+kddyZ6QEQmFVa2ro+yq1P56q6QHWBJqUE1yVtpZnpWD/qNkNL6vCpnArEAO+ZX2ZQ59NYP5nO4c7UKok5i/PlfxAiQb/PPazZ9c/vgIDE1D0bHojqvN/zpV84VV0GmKAs2b/hHAdfUzQGr9Wwh/mvO0BHsLbeh5ByrixCOot5jhNsusrrl1bstvPXRY5TfxZwHnGbIdg+eLFGg8XiaS/+dm9jqtWVx45yzf/qDdWlmy38di9N/9rTQUsGhU87Ll2WaSzmycPcor92Dgbp8QhpYE6odF3FMUJAv94shQTVSHoRJtg51RYWliwR8cn2E34NkRFS4Rdj5wLoVS4B1CpU/O/z11uf193L753699rOb48s1mnICIoltJtGEOp0+Wrc98Hn3UVrOLew1z6gOdSl2lD12cqVy58uvF599rMgPsFWySWgMeBlhRdPOrW1lfyC1ynwS0qWvaCdmvl6typXu1964NLXMgZzU8s8gq5Bo1bXMCkGofWNzeuzM326xWuBOzVbXRpJHr1oRu01XCVZrvVAzciWhG9RZSn4Ls0RrpLexbjI1Ws0ukwxGIRDKI4dYjv00LfqQvsqrx/+WpvA9L/hljhZLvMJ3MJHKjogx9i4AlyrehUszxtEAAAAABJRU5ErkJggg==",Vqr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgqSURBVHgBvVlbb1TXFd6Xc585nvFcPJ4hvoDxBRK3gAOoOAKiRmoilSRvFX2IKlUiD+1b+AmVWrVJX5oXeIv6wEOSRqKhraK0EDCxVDIBF6g9JliA8Y3B4xnPeC5nztm7ax8z5lLPzLFjsawj27PX3vs731p7rbXXYLRJGdj36hDirA8xPMQw78cY+RHi5uooznOO5gjHswixSURpcuLb80m0CcEbUe7vHzaxjx7nHB9/DMbzVrOY8ySm/PR48tKc51lelFxgBj3BETqOtkAwR3/1CrQpwIGXjxznDjqxccaabj2LGT49MXbh80ZatNHgwN7D74EvATikoq0XE6g8Go13mQ/n747WU1qXQdekuvQ+x3wIPQfhnE/iEns3lbqcf3aMrDtBl049L3BCMMZ9XKfvrzf2fyYWZgVej6LnLBCmEuuZ+ymAA/uOHIOT+uvmixFEMMKSJGFFkalh+KjhD0g6/FYUCcMpBVIwmE74EHf1wS7IgwxG4915AHljba/aH/17hxOcS6dg9Xg9UJwzAEYQJgRTeDRVJZrflNRgu6wE2iQBrLI8X7VyD6yVfN6xKhVmOw4XItYQ85sKx3lUst+s+eMag9H27cK06/qd+xawOyEUEUAGrBGf3y/5Q+2yL9Gj6e39uhrZoQf7DwVDvQdNblcYsUsMIwdAiYdjvLZSEyYxUrFM1JqpcY09wHq27hzBGogsS8CaRnW/SfXwNkUJdanEjMhmYsDX0vmiSajkrmeXCk5u8utM5uaX2dLiXKVYyDqVUpnZjHEGjycmi86rgkX6BHt99cARMKeqKsQAc5rhdsVo79WV6A5NCXdpkd2HW/2xbkOYvTaHyKDb3uPTo90qsyuc2GWXTcbEU2OwMZOMEiuzcDfpAgy1d78HNlg3UwhfUwCcLxCWzfYdqhbbqdNgQgn27A+EevYFZc0n1dtE9oeVwM4DAdmMSHb+gYWZxZ2qJVhEiDcGCGewb3H+7kfUrUoQq5tjJTAbHARqxoG1tp26L95vRHYdCRnhhI4J9ZTLtfALWrD3YKCYvl+ycvNV26o+IpI3QqhGEx1JGmnrPFbvcLgAJYo13ZT0aKcSeenHreHe/a1UUSnaoBBJJaGB4VbkcCd751rBESyiZiySSRGg+hopCX8GP2Isv2AbrdHvnZNDLw63uib2IEDzEGEEJ5opcgaxzCqy9MifF1hp2UablGohU71z7k/TXvUxwX3i6MUbKomHqgTpIalqO2z+yw/vr3x3OYs2INy2WO52Mnv77B/urDy4U/FcJ3NkSk3rPPIIJZFR5OW3I1pru5ZNfpYu3btWaHnp9ZDS1mM0ml7OzpXTY//MSL6AtP3YyS5r+aGVPPWrW8hL7sPclJrpuDHVsTgvph0JDgfVTCk8/E68NDtRyN38IqPNd634el9pJXrLU2sxYG1pKpldnv5vMdz3o0BLx26XCAEQoHlKzEJoJN4tQkxd56cQShTIuarup/bygiUDQDnQpkBsU7T4gFHK3K8UJ84vUcWgUkubIubk744tL3zzeZrIOt124O2YYF18nh0fyXx39o/3Lcg0zI2DTXBCXpZAr1AvSAtxCxEiYUcNUm5E5Fzq4tLK1GgudOBnMQqstQ6+HinOjBeWxv+1hKeuLDOlhVjlghPb/1a0Bswu5e2Fq/9IO+W8o/iDEof0hzwIx2yORmNdQ+Bj3fWUoG7BVJaIovpo52u/TAR3HQ1B2cAzVz5JY8S4Eu7U5ZaoYnTsMRlRELgAjf3gtYjsC8isarHsVDKXvnFhsaVr0IztfSNqxHq02SvnFj0xyPB1Gkl0h+HPQ/V0sPsjfleRagSof9uAXwnGNaNj0F+au1XM/+dcRmndpkBpo2jBmKqHEprIMOXMTGlm9OMFSG0scfCtmBHp1MV66RtfLaYn/13wUjAQjr4AgB3gf/hYXS14U/dtHZsVZ24W7ZWMZcR2GpIRkPX2Xh/STJIdO7fo+mcgLtZCi+Bri6nRXNsPfxKK7DoUIpJCKvlFa+LT305Nf/0XwR73dIgddvpRuXXkfLNwIw6LLFOsahrRND/ddvSdWGTPG1ExxqoVlk2NLGUmLueY4seB7ftaogOHWkVVI8ZnRj+dv3PpzINyLlMVL+up3EJoNnX14pur5VasS22Uj1eJ5EgcPceGZMpsXrg3Vlye+iYX6DlgSppf0tt2GC3bh/xQF/oDnbtNTCnOz6QKEx//Zur+lb9lrPKKwzzk38f7oQtQzXzlAgzvfGESVckvPExDq9aGug5K+WphyX547e8ZbpdsPdKtyUaLIqmG5FhFZ/rSmbnxT343XcjMW6Iw8MjamlDKTz6cu1dwAS5OT1thuFGBvQebT+U1vxRsIpfNmVQxezu5LPuCND89Xhj/7Pd3569fzIn7COPeWVvbAVojqauX3I7D40vT8LCJitLZjbQ4Vm9ryK24qbh1wL+ACbLPalm/MVhrMksIf7fWt1mr6wSL0XiHBdse8r7WaiwTYIQZHWfVlHyz0EAwYx9MXB35tvb/U4Xnw/l7N7ybeusFmD+TGhv56MnP1q17BvYchtYHem6tDyGiPzN57dLPn/18/d6MzzkJZppEz0ngUCRF82i9sYaVYx/0afAWNS3riTDr5NjIB/XGG15+IFCOws1qDt4QetB4ixuYPA/H6cNb10ZON9Ly1gJ2+zb0BESSn6ItEMEaLvPT6/UDn5WNNdEfAYUthoDRONqQAGOMnyFlfsYLsE0BfFIGBl8ZgggND+oDUyVWL181N+Dia4gCwTgFpUQS2Why4vrIpr6G+B/jP7NCPGnPlgAAAABJRU5ErkJggg==";const UQe=n=>(kd("data-v-eabcb3ef"),n=n(),Fd(),n),$qr=["onClick"],Wqr=UQe(()=>fe("svg",{class:"settings-icon",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none"},[fe("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z",stroke:"currentColor","stroke-width":"2"}),fe("path",{d:"M19.4 15a8.2 8.2 0 0 0 .1-1 8.2 8.2 0 0 0-.1-1l2-1.6-1.9-3.3-2.4 1a7.9 7.9 0 0 0-1.7-1l-.4-2.6H9l-.4 2.6a7.9 7.9 0 0 0-1.7 1l-2.4-1-1.9 3.3 2 1.6a8.2 8.2 0 0 0-.1 1 8.2 8.2 0 0 0 .1 1l-2 1.6 1.9 3.3 2.4-1c.5.4 1.1.7 1.7 1l.4 2.6h6.2l.4-2.6c.6-.3 1.2-.6 1.7-1l2.4 1 1.9-3.3-2-1.6Z",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round"})],-1)),Hqr=[Wqr],jqr=UQe(()=>fe("span",null,"\u8DEF\u5F84\u51B2\u7A81\u663E\u793A",-1)),Xqr={__name:"OpenLayersZoomControl",props:{map:Object,resetView:{type:Function,default:null},vehicleCategories:{type:Object,default:()=>({})},vehicleMovementControl:{type:Object,default:null}},emits:["compass","zoomIn","zoomOut","layerChange","rotate","setCategoryVisibility","drawTestRoute","routeQueried"],setup(n,{expose:e,emit:t}){const r=n;[Bqr,Gqr,zqr,Uqr,Vqr].forEach(R=>{const k=new window.Image;k.src=R});const i=un(null),a=un(null),o=un(!1),s=un(!1),l=un(!1),u=un(!1),h=Irt(),c=ul({get:()=>h.pathConflictDisplayEnabled!==!1,set:R=>{h.changeSetting({key:"pathConflictDisplayEnabled",value:R});const k=JSON.parse(localStorage.getItem("layout-setting"))||{};localStorage.setItem("layout-setting",JSON.stringify({...k,pathConflictDisplayEnabled:R}))}}),f=un(0);function d(){r.map&&r.map.getView()&&(f.value=r.map.getView().getRotation()*180/Math.PI)}function v(){r.map&&(r.map.getView().animate({rotation:0,duration:300}),t("rotate",0))}function p(){if(r.map){const k=r.map.getView().getRotation()-Math.PI/2;r.map.getView().animate({rotation:k,duration:300}),t("rotate",k*180/Math.PI)}}function g(){if(r.map){const k=r.map.getView().getRotation()+Math.PI/2;r.map.getView().animate({rotation:k,duration:300}),t("rotate",k*180/Math.PI)}}function m(){if(t("zoomIn"),r.map){const R=r.map.getView(),k=R.getConstrainedZoom(R.getZoom()+1);R.animate({zoom:k,duration:250})}}function y(){if(t("zoomOut"),r.map){const R=r.map.getView(),k=R.getConstrainedZoom(R.getZoom()-1);R.animate({zoom:k,duration:250})}}function _(R){console.log("ZoomControl\u6536\u5230\u56FE\u5C42\u53D8\u5316:",R),t("layerChange",R)}function x(R,k){t("setCategoryVisibility",R,k),r.vehicleMovementControl&&r.vehicleMovementControl.setCategoryVisibility&&r.vehicleMovementControl.setCategoryVisibility(R,k)}function S(){o.value=!o.value}function w(){o.value=!1,s.value=!0}function b(){o.value=!1,l.value=!0}function E(){o.value=!1,u.value=!0}function T(){o.value=!1,t("drawTestRoute")}async function C(R){var k,D,G,W,z;try{const V=await Fqr(R);if(V.code===200&&V.data){Sp.success("\u8DEF\u7531\u67E5\u8BE2\u6210\u529F\uFF0C\u5DF2\u5728\u5730\u56FE\u4E0A\u7ED8\u5236");const Y={flightNo:(R==null?void 0:R.objectId)||(R==null?void 0:R.vehicleID)||(R==null?void 0:R.flightNo)||(R==null?void 0:R.objectName)||((k=V==null?void 0:V.data)==null?void 0:k.flightNo)||((D=V==null?void 0:V.data)==null?void 0:D.objectId)||((G=V==null?void 0:V.data)==null?void 0:G.vehicleID)||((W=V==null?void 0:V.data)==null?void 0:W.objectName)||((z=V==null?void 0:V.data)==null?void 0:z.routeCodes)||"QUERY-ROUTE",routeType:R.routeType,routeStatus:V.data.routeStatus||"ACTIVE",routeGeometry:V.data.geoPath||V.data.featureCollection||V.data.geojson||V.data.routeGeometry||V.data.featureLayer,routeCodes:V.data.routeCodes||V.data.codes};r.vehicleMovementControl&&typeof r.vehicleMovementControl.handleAircraftRouteUpdate=="function"?r.vehicleMovementControl.handleAircraftRouteUpdate(Y):window.__injectAircraftRouteUpdate?window.__injectAircraftRouteUpdate(Y):t("routeQueried",Y)}else Sp.warning(V.msg||"\u67E5\u8BE2\u8DEF\u7531\u5931\u8D25")}catch(V){console.error("\u67E5\u8BE2\u8DEF\u7531\u51FA\u9519:",V),Sp.error(V.message||"\u67E5\u8BE2\u8DEF\u7531\u51FA\u9519")}}async function A(R){const k=Number(R==null?void 0:R.vehicleDistance),D=Number(R==null?void 0:R.aircraftDistance),G=Number(R==null?void 0:R.separationDistance),W=Number.isFinite(k)&&k>0,z=Number.isFinite(D)&&D>0,V=Number.isFinite(G)&&G>0;if(!W&&!z&&!V){Sp.error("\u8BF7\u81F3\u5C11\u586B\u5199\u4E00\u9879\u6709\u6548\u914D\u7F6E\uFF08\u5927\u4E8E 0 \u7684\u6570\u5B57\uFF09");return}try{const q=[];if(W||z){const Y={};W&&(Y.vehicleDistance=k),z&&(Y.aircraftDistance=D),q.push(SYr(Y))}V&&q.push(xYr(G)),await Promise.all(q),Sp.success("\u914D\u7F6E\u5DF2\u66F4\u65B0"),l.value=!1}catch(q){Sp.error((q==null?void 0:q.message)||"\u914D\u7F6E\u66F4\u65B0\u5931\u8D25")}}function M(R){const k=a.value;!k||k.contains(R.target)||(o.value=!1)}let I=null;return P0(()=>{document.addEventListener("click",M),r.map&&(d(),I=r.map.getView().on("change:rotation",d))}),i_(()=>{if(document.removeEventListener("click",M),I&&r.map)try{Nde(()=>import("./VehicleMovementControlRefactored.a43df089.js").then(R=>R.bs),["assets/VehicleMovementControlRefactored.a43df089.js","assets/index.bba5ce79.js","assets/index.eab70bbf.css","assets/VehicleMovementControlRefactored.34604a8b.css"]).then(({unByKey:R})=>{R(I)}).catch(R=>{console.error("\u6E05\u7406\u4E8B\u4EF6\u76D1\u542C\u5668\u5931\u8D25:",R)})}catch(R){console.error("\u6E05\u7406\u4E8B\u4EF6\u76D1\u542C\u5668\u5931\u8D25:",R)}}),Af(()=>r.map,R=>{if(R){if(d(),I)try{Nde(()=>import("./VehicleMovementControlRefactored.a43df089.js").then(k=>k.bs),["assets/VehicleMovementControlRefactored.a43df089.js","assets/index.bba5ce79.js","assets/index.eab70bbf.css","assets/VehicleMovementControlRefactored.34604a8b.css"]).then(({unByKey:k})=>{k(I)}).catch(k=>{console.error("\u6E05\u7406\u4E8B\u4EF6\u76D1\u542C\u5668\u5931\u8D25:",k)})}catch(k){console.error("\u6E05\u7406\u4E8B\u4EF6\u76D1\u542C\u5668\u5931\u8D25:",k)}I=R.getView().on("change:rotation",d)}}),e({setLayerVisibility(R,k){return i.value?i.value.setLayerVisibility(R,k):!1},resetRotation:v,getRotation(){return f.value}}),(R,k)=>{const D=nB("el-switch");return qr(),hn("div",{class:"zoom-control",ref_key:"zoomControlRef",ref:a},[fe("div",{class:cl(["settings-control",{active:o.value}]),onClick:NA(S,["stop"])},Hqr,10,$qr),o.value?(qr(),hn("div",{key:0,class:"settings-panel",onClick:k[2]||(k[2]=NA(()=>{},["stop"]))},[fe("div",{class:"settings-item",onClick:w},"\u7F16\u8F91"),fe("div",{class:"settings-item",onClick:b},"\u4FEE\u6539\u9884\u8B66\u8DDD\u79BB"),fe("div",{class:"settings-item",onClick:E},"\u67E5\u8BE2\u8DEF\u7531"),fe("div",{class:"settings-item",onClick:T},"\u7ED8\u5236\u6D4B\u8BD5\u8DEF\u7531"),fe("div",{class:"settings-item settings-switch-item",onClick:k[1]||(k[1]=NA(()=>{},["stop"]))},[jqr,Mf(D,{modelValue:Xo(c),"onUpdate:modelValue":k[0]||(k[0]=G=>Lrt(c)?c.value=G:null),size:"small"},null,8,["modelValue"])])])):Bs("",!0),Mf(eqr,{visible:s.value,onClose:k[3]||(k[3]=G=>s.value=!1)},null,8,["visible"]),Mf(fqr,{visible:l.value,onClose:k[4]||(k[4]=G=>l.value=!1),onConfirm:A},null,8,["visible"]),Mf(kqr,{visible:u.value,onClose:k[5]||(k[5]=G=>u.value=!1),onConfirm:C},null,8,["visible"]),Mf(mYr,{class:"layer-switcher",map:n.map,categories:n.vehicleCategories,onLayerChange:_,onSetCategoryVisibility:x,ref_key:"layerSwitcherRef",ref:i},null,8,["map","categories"]),fe("div",{class:"compass-container",style:XZ({transform:`rotate(${-f.value}deg)`})},[fe("div",{class:"rotate-left",onClick:p,title:"\u5411\u53F3\u65CB\u8F6C90\xB0"}),fe("div",{class:"rotate-right",onClick:g,title:"\u5411\u5DE6\u65CB\u8F6C90\xB0"})],4),fe("div",{class:"zoom-in",onClick:m}),fe("div",{class:"zoom-out",onClick:y})],512)}}},Yqr=rf(Xqr,[["__scopeId","data-v-eabcb3ef"]]);const qqr={class:"map-info"},Zqr=["value"],Kqr=["value"],Jqr={__name:"OpenLayersMapInfo",props:{map:Object},setup(n){const e=n,t=un("XY\u5750\u6807: --"),r=un("WGS84: --");function i(s){if(!e.map){console.warn("\u5730\u56FE\u5B9E\u4F8B\u672A\u4F20\u9012\u5230OpenLayersMapInfo\u7EC4\u4EF6");return}try{const l=[s.offsetX,s.offsetY],u=e.map.getCoordinateFromPixel(l);if(u){t.value=`XY\u5750\u6807: X=${u[0].toFixed(6)}, Y=${u[1].toFixed(6)}`;try{const[h,c]=lA(u,"EPSG:4528","EPSG:4326");r.value=`WGS84: \u7ECF\u5EA6=${h.toFixed(6)}\xB0, \u7EAC\u5EA6=${c.toFixed(6)}\xB0`}catch{r.value="WGS84: \u8F6C\u6362\u9519\u8BEF"}}else t.value="XY\u5750\u6807: --",r.value="WGS84: --"}catch(l){console.error("\u5904\u7406\u9F20\u6807\u79FB\u52A8\u4E8B\u4EF6\u65F6\u51FA\u9519:",l),t.value="XY\u5750\u6807: \u9519\u8BEF",r.value="WGS84: \u9519\u8BEF"}}function a(){if(!e.map)return;const s=e.map.getTargetElement();s&&s.addEventListener("mousemove",i)}function o(){if(!e.map)return;const s=e.map.getTargetElement();s&&s.removeEventListener("mousemove",i)}return P0(a),i_(o),Af(()=>e.map,(s,l)=>{o(),a()}),(s,l)=>(qr(),hn("div",qqr,[fe("input",{type:"text",readonly:"",value:t.value},null,8,Zqr),fe("input",{type:"text",readonly:"",value:r.value},null,8,Kqr)]))}},Qqr=rf(Jqr,[["__scopeId","data-v-c7543916"]]);const VQe=n=>(kd("data-v-40bee71a"),n=n(),Fd(),n),eZr={class:"scale-control"},tZr={class:"scale-bar"},rZr=VQe(()=>fe("div",{class:"tick left"},null,-1)),nZr=VQe(()=>fe("div",{class:"tick right"},null,-1)),iZr=[rZr,nZr],aZr={class:"scale-text"},oZr={__name:"OpenLayersScaleControl",props:{map:Object,position:{type:String,default:"bottomleft"}},setup(n){const e=n,t=un("100 \u7C73"),r=un(80);function i(){if(!e.map)return;const s=e.map.getView();if(!s)return;const l=s.getResolution();if(!l)return;const u=60,h=150,c=Math.round((u+h)/2),f=l*c;function d(g){if(g<=0)return 0;const m=Math.floor(Math.log10(g)),y=g/Math.pow(10,m);let _;return y<1.5?_=1:y<3?_=2:y<7?_=5:_=10,_*Math.pow(10,m)}let v=d(f),p=v/l;if((ph)&&(p=Math.max(u,Math.min(h,p)),v=d(p*l)),r.value=Math.round(p),v>=1e3){const g=v/1e3;t.value=Math.round(g*10)/10+" \u516C\u91CC"}else t.value=Math.round(v)+" \u7C73"}function a(){!e.map||(e.map.on("moveend",i),i())}function o(){e.map&&e.map.un("moveend",i)}return Af(()=>e.map,s=>{o(),s&&a()}),P0(()=>{a()}),i_(()=>{o()}),(s,l)=>(qr(),hn("div",eZr,[fe("div",tZr,[fe("div",{class:"scale-line",style:XZ({width:r.value+"px"})},null,4),fe("div",{class:"scale-ticks",style:XZ({width:r.value+"px"})},iZr,4),fe("div",aZr,mn(t.value),1)])]))}},sZr=rf(oZr,[["__scopeId","data-v-40bee71a"]]);const Z_=n=>(kd("data-v-6d6fb11e"),n=n(),Fd(),n),lZr={class:"route-draw-control"},uZr={class:"draw-tools"},hZr=Z_(()=>fe("span",null,"\u7ED8\u5236\u8DEF\u7EBF",-1)),cZr=[hZr],fZr=Z_(()=>fe("span",null,"\u7ED8\u5236\u70B9\u7EBF\u9762",-1)),dZr=[fZr],vZr=Z_(()=>fe("span",null,"\u6E05\u9664",-1)),pZr=[vZr],gZr=Z_(()=>fe("span",null,"\u5BFC\u51FA\u6570\u636E",-1)),yZr=[gZr],mZr=Z_(()=>fe("span",null,"\u5BFC\u5165\u6570\u636E",-1)),_Zr=[mZr],xZr={key:0,class:"polygon-panel"},SZr=Z_(()=>fe("span",null,"\u70B9\u7EBF\u9762\u4FE1\u606F",-1)),wZr={class:"panel-content"},bZr={class:"info-header"},EZr={class:"info-content"},TZr=["onClick"],CZr={key:0,class:"no-data"},AZr={key:1,class:"route-lines-panel"},MZr=Z_(()=>fe("span",null,"\u8DEF\u7EBF\u4FE1\u606F",-1)),IZr={class:"panel-content"},LZr={class:"info-header"},PZr={class:"info-content"},OZr=["onClick"],RZr={key:0,class:"no-data"},DZr={key:2,class:"import-dialog"},NZr={class:"dialog-content"},kZr={class:"dialog-header"},FZr=Z_(()=>fe("h3",null,"\u5BFC\u5165\u6570\u636E",-1)),BZr={class:"dialog-body"},GZr={class:"file-upload"},zZr=Z_(()=>fe("label",{for:"jsonFileInput"},"\u6216\u8005\u4E0A\u4F20JSON\u6587\u4EF6",-1)),UZr={class:"dialog-footer"},VZr={__name:"RouteDrawControl",props:{map:Object},setup(n,{expose:e}){const t=n,r=un(!1),i=un(""),a=un(!1),o=un(!1),s=un([]),l=un([]),u=un(!1),h=un("");let c=null,f=null,d=null;function v(){!t.map||(f=new Hx,d=new sp({source:f,style:new T1({fill:new C1({color:"rgba(0, 150, 255, 0.3)"}),stroke:new jx({color:"#0096ff",width:3}),image:new DW({radius:7,fill:new C1({color:"#0096ff"})})})}),t.map.addLayer(d))}function p(){m(),r.value=!0,i.value="LineString",o.value=!0,c=new zde({source:f,type:"LineString",style:new T1({stroke:new jx({color:"#ff0000",width:3}),image:new DW({radius:5,fill:new C1({color:"#ff0000"})})})}),c.on("drawend",function(T){const C=T.feature,A=C.getGeometry(),M=RF(A),I=A.getCoordinates().length;C.setProperties({type:"route",length:M,vertices:I}),l.value.push({id:Date.now(),feature:C,length:M,vertices:I,extent:A.getExtent()}),r.value=!1}),t.map.addInteraction(c)}function g(){m(),r.value=!0,i.value="Polygon",a.value=!0,c=new zde({source:f,type:"Polygon",style:new T1({fill:new C1({color:"rgba(255, 165, 0, 0.3)"}),stroke:new jx({color:"#ffa500",width:3}),image:new DW({radius:5,fill:new C1({color:"#ffa500"})})})}),c.on("drawend",function(T){const C=T.feature,A=C.getGeometry(),M=Pde(A),I=RF(A.getLinearRing(0)),R=A.getLinearRing(0).getCoordinates().length-1;C.setProperties({type:"polygon",area:M,perimeter:I,vertices:R}),s.value.push({id:Date.now(),feature:C,area:M,perimeter:I,vertices:R,extent:A.getExtent()}),r.value=!1}),t.map.addInteraction(c)}function m(){c&&(t.map.removeInteraction(c),c=null),f&&f.clear(),r.value=!1,s.value=[],l.value=[]}function y(){a.value=!1}function _(){o.value=!1}function x(T){t.map&&T.extent&&t.map.getView().fit(T.extent,{padding:[50,50,50,50],duration:1e3})}function S(T){t.map&&T.extent&&t.map.getView().fit(T.extent,{padding:[50,50,50,50],duration:1e3})}function w(){if(!f||f.getFeatures().length===0){alert("\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684\u6570\u636E\uFF0C\u8BF7\u5148\u7ED8\u5236\u8DEF\u7EBF\u6216\u70B9\u7EBF\u9762");return}const T=new $b,C=f.getFeatures(),A=T.writeFeaturesObject(C,{dataProjection:"EPSG:4326",featureProjection:t.map.getView().getProjection()}),M=JSON.stringify(A,null,2),I=new Blob([M],{type:"application/json"}),R=URL.createObjectURL(I),k=document.createElement("a");k.href=R,k.download="roadTest.json",document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(R),console.log("\u6570\u636E\u5DF2\u5BFC\u51FA\u4E3AGeoJSON\uFF0C\u6587\u4EF6\u540D\uFF1AroadTest.json"),alert("\u6587\u4EF6\u5DF2\u4E0B\u8F7D\u4E3AroadTest.json\uFF0C\u8BF7\u5C06\u5176\u590D\u5236\u5230\u9879\u76EE\u7684public\u76EE\u5F55\u4E0B")}function b(T){const C=T.target.files[0];if(!C)return;const A=new FileReader;A.onload=M=>{h.value=M.target.result},A.readAsText(C)}function E(){if(!h.value){alert("\u8BF7\u8F93\u5165\u6216\u4E0A\u4F20JSON\u6570\u636E");return}try{const T=JSON.parse(h.value),C=new $b;m();const A=C.readFeatures(T,{dataProjection:"EPSG:4326",featureProjection:t.map.getView().getProjection()});if(f.addFeatures(A),A.forEach(M=>{const I=M.getGeometry(),R=M.getProperties();if(I instanceof rB||R.type==="route"){const k=RF(I),D=I.getCoordinates().length;l.value.push({id:Date.now()+Math.random(),feature:M,length:R.length||k,vertices:R.vertices||D,extent:I.getExtent()})}else if(I instanceof cne||R.type==="polygon"){const k=Pde(I),D=RF(I.getLinearRing(0)),G=I.getLinearRing(0).getCoordinates().length-1;s.value.push({id:Date.now()+Math.random(),feature:M,area:R.area||k,perimeter:R.perimeter||D,vertices:R.vertices||G,extent:I.getExtent()})}}),l.value.length>0&&(o.value=!0),s.value.length>0&&(a.value=!0),u.value=!1,h.value="",A.length>0){const M=f.getExtent();t.map.getView().fit(M,{padding:[50,50,50,50],duration:1e3})}console.log("\u6210\u529F\u5BFC\u5165\u6570\u636E\uFF0C\u5171",A.length,"\u4E2A\u7279\u5F81")}catch(T){console.error("\u5BFC\u5165\u6570\u636E\u5931\u8D25:",T),alert("\u5BFC\u5165\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5JSON\u683C\u5F0F\u662F\u5426\u6B63\u786E")}}return P0(()=>{t.map&&v()}),Af(()=>t.map,T=>{T&&v()}),i_(()=>{t.map&&(c&&t.map.removeInteraction(c),d&&t.map.removeLayer(d))}),e({startDrawLine:p,startDrawPolygon:g,clearDraw:m,exportRouteData:w,importRouteData:E,showImportDialog:u}),(T,C)=>(qr(),hn("div",lZr,[fe("div",uZr,[fe("div",{class:cl(["tool-button",{active:r.value&&i.value==="LineString"}]),onClick:p},cZr,2),fe("div",{class:cl(["tool-button",{active:r.value&&i.value==="Polygon"}]),onClick:g},dZr,2),fe("div",{class:"tool-button",onClick:m},pZr),fe("div",{class:"tool-button",onClick:w},yZr),fe("div",{class:"tool-button",onClick:C[0]||(C[0]=A=>u.value=!0)},_Zr)]),a.value?(qr(),hn("div",xZr,[fe("div",{class:"panel-header"},[SZr,fe("span",{class:"close-btn",onClick:y},"\xD7")]),fe("div",wZr,[(qr(!0),hn(Dp,null,Np(s.value,(A,M)=>(qr(),hn("div",{class:"info-item",key:M},[fe("div",bZr,"\u70B9\u7EBF\u9762 "+mn(M+1),1),fe("div",EZr,[fe("p",null,"\u9762\u79EF: "+mn(A.area.toFixed(2))+" \u5E73\u65B9\u7C73",1),fe("p",null,"\u5468\u957F: "+mn(A.perimeter.toFixed(2))+" \u7C73",1),fe("p",null,"\u9876\u70B9\u6570: "+mn(A.vertices),1),fe("button",{class:"focus-btn",onClick:I=>x(A)},"\u5B9A\u4F4D",8,TZr)])]))),128)),s.value.length===0?(qr(),hn("div",CZr," \u6682\u65E0\u70B9\u7EBF\u9762\u6570\u636E\uFF0C\u8BF7\u5148\u7ED8\u5236\u70B9\u7EBF\u9762 ")):Bs("",!0)])])):Bs("",!0),o.value?(qr(),hn("div",AZr,[fe("div",{class:"panel-header"},[MZr,fe("span",{class:"close-btn",onClick:_},"\xD7")]),fe("div",IZr,[(qr(!0),hn(Dp,null,Np(l.value,(A,M)=>(qr(),hn("div",{class:"info-item",key:M},[fe("div",LZr,"\u8DEF\u7EBF "+mn(M+1),1),fe("div",PZr,[fe("p",null,"\u957F\u5EA6: "+mn(A.length.toFixed(2))+" \u7C73",1),fe("p",null,"\u9876\u70B9\u6570: "+mn(A.vertices),1),fe("button",{class:"focus-btn",onClick:I=>S(A)},"\u5B9A\u4F4D",8,OZr)])]))),128)),l.value.length===0?(qr(),hn("div",RZr," \u6682\u65E0\u8DEF\u7EBF\u6570\u636E\uFF0C\u8BF7\u5148\u7ED8\u5236\u8DEF\u7EBF ")):Bs("",!0)])])):Bs("",!0),u.value?(qr(),hn("div",DZr,[fe("div",NZr,[fe("div",kZr,[FZr,fe("span",{class:"close-btn",onClick:C[1]||(C[1]=A=>u.value=!1)},"\xD7")]),fe("div",BZr,[lu(fe("textarea",{"onUpdate:modelValue":C[2]||(C[2]=A=>h.value=A),placeholder:"\u8BF7\u7C98\u8D34JSON\u6570\u636E"},null,512),[[qg,h.value]]),fe("div",GZr,[zZr,fe("input",{type:"file",id:"jsonFileInput",accept:".json",onChange:b},null,32)])]),fe("div",UZr,[fe("button",{onClick:C[3]||(C[3]=A=>u.value=!1)},"\u53D6\u6D88"),fe("button",{onClick:E,class:"primary-btn"},"\u5BFC\u5165")])])])):Bs("",!0)]))}},$Zr=rf(VZr,[["__scopeId","data-v-6d6fb11e"]]);const WZr={class:"map-container"},HZr={class:"map-content-wrapper"},jZr={__name:"OpenLayersMap",props:{vehicleCategories:{type:Object,default:()=>({})},vehicleMovementControl:{type:Object,default:null}},emits:["setCategoryVisibility","drawTestRoute"],setup(n,{expose:e,emit:t}){function r(b,E){t("setCategoryVisibility",b,E)}Ode.defs("EPSG:4528","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),Ert(Ode);const i=Trt("EPSG:4528"),a=[405027047458807e-7,40192710092735e-7,40514081829214096e-9,40309391342735e-7],o=[40512494329214066e-9,4026228757190162e-9],s=[1322.9166666666665,529.1666666666666,264.5833333333333,132.29166666666666,66.14583333333333,26.45833333333333,13.229166666666664,6.614583333333332,2.645833333333333,1.3229166666666665,.5291666666666666,.2645833333333333,.13229166666666664];function l(b){const E=[];for(let T=0;T{let b=null;try{const M=localStorage.getItem("defaultMapView");M&&(b=JSON.parse(M),console.log("\u52A0\u8F7D\u4FDD\u5B58\u7684\u9ED8\u8BA4\u89C6\u56FE:",b))}catch(M){console.error("\u52A0\u8F7D\u4FDD\u5B58\u7684\u89C6\u56FE\u51FA\u9519:",M)}const E=new hat({extent:a,resolutions:s,tileSize:256,origin:[a[0],a[3]]}),T=new Ay({projection:i,center:b?b.center:o,zoom:b?b.zoom:p,minZoom:d,maxZoom:v,resolutions:u,rotation:b?b.rotation:h});f.value=new kit({target:c.value,controls:[],loadTilesWhileAnimating:!0,interactions:JPe({altShiftDragRotate:!1,pinchRotate:!1,mouseWheelZoom:!1,doubleClickZoom:!1,shiftDragZoom:!1}),layers:[new Wde({source:new Bp({url:"http://10.96.3.10:8090/iserver/services/map-QDJC_DT-GX3/rest/maps/QDJC2DZT",projection:"EPSG:4528",tileGrid:E,wrapX:!1,attributions:""}),transition:0})],view:T}),console.log("\u5730\u56FE\u5B9E\u4F8B\u5DF2\u521B\u5EFA:",f.value),f.value.addInteraction(new qPe({constrainResolution:!0}));const C=new Wde({source:new Bp({url:"http://10.96.3.10:8090/iserver/services/map-QDJC_DT-GX3/rest/maps/QDJC2DZT",projection:"EPSG:4528",tileGrid:E,wrapX:!1})}),A=new znt({className:"ol-overviewmap custom-overview",layers:[C],collapsed:!1,collapsible:!1,rotateWithView:!0,tipLabel:"",view:new Ay({projection:i,center:o,zoom:10,minZoom:3,maxZoom:15,resolutions:s})});f.value.addControl(A),setTimeout(()=>{const M=document.querySelector(".custom-overview");M?(M.style.display="block",console.log("\u9E70\u773C\u56FE\u5DF2\u6DFB\u52A0\u5230\u5730\u56FE")):console.warn("\u672A\u627E\u5230\u9E70\u773C\u56FE\u5143\u7D20")},500),setTimeout(()=>{const M=f.value.getView();b||M.fit(a,{size:f.value.getSize(),padding:[50,50,50,350],maxZoom:p,constrainResolution:!1}),M.animate({rotation:b?b.rotation:h,duration:500}),f.value.updateSize()},200),T.on("change:rotation",function(){})}),i_(()=>{f.value&&f.value.setTarget(null)});function g(){}function m(){}function y(){f.value&&(f.value.getView().setRotation(h),f.value.getView().setCenter(o),f.value.getView().setZoom(p))}function _(){if(f.value){try{const b=localStorage.getItem("defaultMapView");if(b){const E=JSON.parse(b);f.value.getView().setCenter(E.center),f.value.getView().setZoom(E.zoom),f.value.getView().setRotation(E.rotation);return}}catch(b){console.error("\u52A0\u8F7D\u4FDD\u5B58\u7684\u89C6\u56FE\u51FA\u9519:",b)}f.value.getView().setRotation(h),f.value.getView().setCenter(o),f.value.getView().setZoom(p)}}const x={center:o,rotation:h,initialZoom:p,bounds:{left:a[0],bottom:a[1],right:a[2],top:a[3]}};function S(b){console.log("\u5207\u6362\u56FE\u5C42\u7C7B\u578B:",b)}function w(){if(f.value){const b=f.value.getView(),E=b.getCenter(),T=b.getZoom(),C=b.getRotation();return console.log("\u5F53\u524D\u5730\u56FE\u72B6\u6001:"),console.log("\u4E2D\u5FC3\u70B9:",E),console.log("\u7F29\u653E\u7EA7\u522B:",T),console.log("\u65CB\u8F6C\u89D2\u5EA6:",C),{center:E,zoom:T,rotation:C}}return null}return e({zoomIn:g,zoomOut:m,compass:y,resetView:_,getCurrentMapState:w,map:f}),(b,E)=>(qr(),hn("div",WZr,[fe("div",HZr,[fe("div",{ref_key:"mapContainer",ref:c,id:"map"},null,512)]),Mf(Yqr,{map:f.value,resetView:_,vehicleCategories:n.vehicleCategories,vehicleMovementControl:n.vehicleMovementControl,onCompass:y,onZoomIn:g,onZoomOut:m,onLayerChange:S,onSetCategoryVisibility:r,onDrawTestRoute:E[0]||(E[0]=T=>b.$emit("drawTestRoute"))},null,8,["map","vehicleCategories","vehicleMovementControl"]),Mf(Qqr,{map:f.value,mapConfig:x},null,8,["map"]),Mf(sZr,{map:f.value},null,8,["map"]),f.value?(qr(),uA($Zr,{key:0,map:f.value,ref:"routeDrawControlRef"},null,8,["map"])):Bs("",!0),Prt(b.$slots,"default",{},void 0,!0)]))}},XZr=rf(jZr,[["__scopeId","data-v-853f4944"]]),YZr="/airport/assets/online_car.75a67313.png",qZr="/airport/assets/offline_car.b6d879a9.png",ZZr="/airport/assets/fault_car.d14b763b.png";const CL=n=>(kd("data-v-f04383d5"),n=n(),Fd(),n),KZr={class:"car-alarm-container"},JZr={class:"car-item"},QZr=CL(()=>fe("img",{src:YZr,class:"car-icon"},null,-1)),eKr={class:"car-text"},tKr={class:"car-count"},rKr=CL(()=>fe("span",{class:"unit"},"\u8F86",-1)),nKr=CL(()=>fe("div",{class:"car-label"},"\u5728\u7EBF\u8F66\u8F86",-1)),iKr={class:"car-item"},aKr=CL(()=>fe("img",{src:qZr,class:"car-icon"},null,-1)),oKr={class:"car-text"},sKr={class:"car-count"},lKr=CL(()=>fe("span",{class:"unit"},"\u8F86",-1)),uKr=CL(()=>fe("div",{class:"car-label"},"\u79BB\u7EBF\u8F66\u8F86",-1)),hKr=vne('
    0\u8F86
    \u6545\u969C\u8F66\u8F86
    ',1),cKr={__name:"carClarm",props:{onlineCountProp:{type:Number,default:206},offlineCountProp:{type:Number,default:25},faultCountProp:{type:Number,default:27}},setup(n,{expose:e}){const t=n,r=un(t.onlineCountProp),i=un(t.offlineCountProp),a=un(t.faultCountProp);e({updateCounts:o});function o(l,u,h){r.value=l!==void 0?l:r.value,i.value=u!==void 0?u:i.value,a.value=h!==void 0?h:a.value}P0(()=>{console.log("\u8F66\u8F86\u62A5\u8B66\u4FE1\u606F\u7EC4\u4EF6\u5DF2\u52A0\u8F7D"),s()});async function s(){var l,u,h;try{const c=await PS({url:"/api/vehicle-manager/vehicles/summary",method:"get"}),f=c&&c.data!==void 0?c.data:c||{};o(Number(f.onlineCount)||0,Number(f.offlineCount)||0,Number(f.faultCount)||0)}catch{o((l=r.value)!=null?l:0,(u=i.value)!=null?u:0,(h=a.value)!=null?h:0)}}return(l,u)=>(qr(),hn("div",KZr,[fe("div",JZr,[QZr,fe("div",eKr,[fe("div",tKr,[a_(mn(r.value),1),rKr]),nKr])]),fe("div",iKr,[aKr,fe("div",oKr,[fe("div",sKr,[a_(mn(i.value),1),lKr]),uKr])]),hKr]))}},fKr=rf(cKr,[["__scopeId","data-v-f04383d5"]]),$Qe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAYAAAC8XK78AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMGSURBVHgBxVXLSiNBFL2VRI3PtG8UxPaBS+1tFjI9G7eapQuxAyq6i4I7JRkEwZXJF8T5ggm4mpUJfkD0C6YHBEEEexTfj55zmkQiQ2KQzMyFS3WqbtU5955bFZH/bKrcwtra2o9gMDjo9/t/4Wdqa2srIX/B/OUWwuGw3tnZGe7r6wuChDk5OTkD/57L5RypofnKLby8vHy5uLiwn5+fpaOjw+3t7TXa2toOdnZ2ZuRfEEgmk47rutGzszNRsJaWFkE19MbGxm+pVCohNTL1XsDm5uZuT09PrLu7WyCF1NXVuZeXl3J1dXXs8/kiKysrtlRp+Xxex36tvr5exsbGjqoiEI/HNRQgPzIyMtjU1KRIgERub28VSNgIicKy5fYfHh6a2DMNUKuhoUFDBQXEKbGNcz+/S6BAwmxubj4YHR2VAgEVCAQEEgklYr/Mz88nivH7+/smAKdxi6zW1tYQiaN/BHPeXibA3kICyaoI0La3t3dxK2L9/f1CcHqRDJpVbm5ubMzZyNIIhUIaXABMUMa6xT0F8i7iFaoYU7Ozs0mU4hM2JtPp9NdKJHAD8sPDwwTwZChWgo6yunCFc14JEqg0hv709ESyrEAGskZ8KN+ErutGe3v73uLiYnp5eVkvRwCxkdPTUwcjL4ailhg8cByuWOKSOe/2UKa7uzthlU5OTpzz8/Ps4+OjSXCeGUBMFIfmh4aGtOvra6uAFS3RX8NgsJFwqIFv7f7+XqCvW0qCDuMUibqO46iHhwd+O6jCHshlsHY8Pj7+5iHzds3NzVk4aIJBLFmha02WGc1nQHtBM7nUFV2siqVlDzBznsHSMlM6gLKYz2A6NzU1dSQV7LUJLcvSsSmNV88cGBggIJtMoKkHUtDcm+OIzDwt0UjU00YCGZDOAjwXiUSqfq7f3IKlpaU4OjeBRpOurq7X7iUgtFTQzgOFsw+OQI5ZZhYWFn7KB+2PaxiLxXRkFEfpLd5daC0E5sNBMIJSy9XV1Zr8KVV8B9bX1w0QCAHU3tjY+HCWlew32VsyAm4h+D0AAAAASUVORK5CYII=",dKr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADhSURBVHgBlVELEcIwDO04BNTBigMcMAebg80Bk4CD4WAWcAAOwAFzgISSN97uclyzz7vLLenyXtM85wzEGC8Sb4kncrcFilxKnJi3WwQ+IKq6gEiqd29oeIlBSJ18j6xDqjEzJogkHCRyClwzwdoJJrwwiTNuNxF/yCXuUWEt2U8C6ixsEejhfUIUVvZL5IKNQRG9mgL2Fpqz+9MoJR6y7IEimGQk4UzyG3tMgdF/lQfm0z4Gt/CEMzav6gZnqoYr9ZyA5zvrxL9W72dOpKGNPZdaMYdw5daAGx/t5K2ddfMXZoj7fWN1zB8AAAAASUVORK5CYII=";const TT=n=>(kd("data-v-daf5595e"),n=n(),Fd(),n),vKr={class:"car-detail-container"},pKr=TT(()=>fe("div",{class:"header"},[fe("img",{src:$Qe,alt:"list_bg",class:"header-title-icon"}),fe("span",{class:"header-title"},"\u8F66\u8F86\u8BE6\u60C5")],-1)),gKr={class:"back-button"},yKr={class:"track-list"},mKr={class:"section base-info"},_Kr={class:"car-id"},xKr=TT(()=>fe("div",{class:"video-tabs"},[fe("span",{class:"tab active"},"\u4EFB\u52A1\u4E2D"),fe("span",{class:"tab active"},"\u5728\u7EBF")],-1)),SKr={class:"info-row"},wKr={class:"info-row"},bKr={class:"section task-info"},EKr=TT(()=>fe("div",{class:"section-title"},"\u4EFB\u52A1\u4FE1\u606F",-1)),TKr={class:"info-row"},CKr={class:"info-row"},AKr={class:"info-row"},MKr={class:"section battery-info"},IKr=TT(()=>fe("div",{class:"section-title"},[a_(" \u7535\u6C60\u76D1\u63A7 "),fe("span",{class:"status-normal"},"\u6B63\u5E38")],-1)),LKr={class:"info-row1"},PKr=TT(()=>fe("div",{class:"battery-left"},[fe("img",{src:dKr,alt:"battery",class:"battery-icon"}),fe("p",{class:"battery-content"},"\u7535\u6C60\u6E29\u5EA6")],-1)),OKr={class:"section video-info"},RKr=vne('
    360\xB0\u76D1\u63A7\u72B6\u6001 \u524D\u89C6\u5DE6\u524D\u53F3\u524D\u540E\u89C6
    ',1),DKr={class:"video-preview"},NKr=["src"],kKr={class:"section track-info"},FKr={class:"section-title"},BKr=TT(()=>fe("div",{class:"track-search"},[fe("input",{type:"text",placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22"}),fe("span",{class:"search-icon"})],-1)),GKr={class:"track-timeline"},zKr=TT(()=>fe("div",{class:"timeline-line"},null,-1)),UKr={class:"track-content"},VKr={class:"track-time"},$Kr={class:"track-desc"},WKr={class:"track-detail"},HKr={__name:"CarDetail",props:{car:{type:Object,required:!0}},setup(n){const e=n,t=[{time:"2024\u5E746\u670816\u65E5 18:12:09\u20142024\u5E746\u670816\u65E5 20:12:09",desc:"\u8D77\u70B9\uFF1A\u673A\u573A\u53D1\u5C55\u516C\u53F8 \u7EC8\u70B9\uFF1A\u673A\u573A\u53D1\u5C55\u516C\u53F8",distance:"20km",taskId:"001"},{time:"2024\u5E746\u670815\u65E5 18:12:09\u20142024\u5E746\u670815\u65E5 20:12:09",desc:"\u8D77\u70B9\uFF1A\u673A\u573A\u53D1\u5C55\u516C\u53F8 \u7EC8\u70B9\uFF1A\u673A\u573A\u53D1\u5C55\u516C\u53F8",distance:"20km",taskId:"002"}];function r(a){const o=parseFloat(a);return isNaN(o)?"temp-normal":o>=45?"temp-danger":o>=38?"temp-warning":"temp-normal"}const i=ul(()=>{var o;const a=(o=e.car)==null?void 0:o.trackList;return Array.isArray(a)?a.length:t.length});return(a,o)=>{var h,c;const s=nB("ArrowLeft"),l=nB("el-icon"),u=nB("el-button");return qr(),hn("div",vKr,[pKr,fe("div",gKr,[Mf(u,{type:"primary",plain:"",class:"btn custom-back-btn",size:"small",onClick:o[0]||(o[0]=f=>a.$emit("back"))},{default:kde(()=>[Mf(l,{class:"back-icon"},{default:kde(()=>[Mf(s)]),_:1}),a_(" \u8FD4\u56DE\u8F66\u8F86\u5217\u8868 ")]),_:1})]),fe("div",yKr,[fe("div",mKr,[fe("div",_Kr,[a_(mn(n.car.id)+"\uFF08"+mn(n.car.type)+"\uFF09 ",1),xKr]),fe("div",SKr,[fe("div",null,"\u54C1\u724C\uFF1A"+mn(n.car.brand||"\u9A71\u9E1F\u8F66"),1),fe("div",null,"\u8D1F\u8D23\u4EBA\uFF1A"+mn(n.car.manager),1)]),fe("div",wKr,[fe("div",null,"\u6240\u5C5E\u5355\u4F4D\uFF1A"+mn(n.car.company||"\u673A\u573A\u53D1\u5C55\u516C\u53F8"),1),fe("div",null,"\u8054\u7CFB\u65B9\u5F0F\uFF1A"+mn(n.car.phone||"18661190988"),1)])]),fe("div",bKr,[EKr,fe("div",TKr,[fe("div",null,"\u5F00\u59CB\u65F6\u95F4\uFF1A"+mn(n.car.taskStart||"5\u67081\u65E512:00"),1),fe("div",null,"\u7ED3\u675F\u65F6\u95F4\uFF1A"+mn(n.car.taskEnd||"5\u67081\u65E512:30"),1)]),fe("div",CKr,[fe("div",null,"\u8D77\u70B9\uFF1A"+mn(n.car.taskStartPoint||"A\u533A\u5FEB\u51B2\u6869"),1),fe("div",null,"\u7EC8\u70B9\uFF1A"+mn(n.car.taskEndPoint||"B\u533A\u5FEB\u51B2\u6869"),1)]),fe("div",AKr,[fe("div",null,"\u884C\u9A76\u901F\u5EA6\uFF1A"+mn(n.car.speed),1),fe("div",null,"\u884C\u9A76\u91CC\u7A0B\uFF1A"+mn(n.car.distance),1)])]),fe("div",MKr,[IKr,fe("div",LKr,[PKr,fe("p",{class:cl(["battery-temp",r((h=n.car.batteryTemp)!=null?h:"--")])},mn((c=n.car.batteryTemp)!=null?c:"--"),3)])]),fe("div",OKr,[RKr,fe("div",DKr,[fe("img",{src:n.car.videoImg,alt:"360\u76D1\u63A7"},null,8,NKr)])]),fe("div",kKr,[fe("div",FKr,"\u5386\u53F2\u8F68\u8FF9\uFF08"+mn(Xo(i))+"\uFF09",1),BKr,(qr(!0),hn(Dp,null,Np(n.car.trackList||t,(f,d)=>(qr(),hn("div",{class:"track-item",key:d},[fe("div",GKr,[fe("div",{class:cl(["timeline-dot",{active:d===0}])},null,2),zKr]),fe("div",UKr,[fe("div",VKr,mn(f.time),1),fe("div",$Kr,mn(f.desc),1),fe("div",WKr,[fe("span",null,"\u884C\u9A76\u91CC\u7A0B\uFF1A"+mn(f.distance),1),fe("span",null,"\u4EFB\u52A1\u7F16\u53F7\uFF1A"+mn(f.taskId),1)])])]))),128))])])])}}},jKr=rf(HKr,[["__scopeId","data-v-daf5595e"]]);const XKr=n=>(kd("data-v-6aa232ba"),n=n(),Fd(),n),YKr={class:"filter-dropdown"},qKr=XKr(()=>fe("span",{class:"arrow-down"},null,-1)),ZKr={class:"dropdown-menu"},KKr=["onClick"],JKr={__name:"FilterDropdown",props:{options:{type:Array,required:!0,default:()=>[]},modelValue:{type:[String,Number,Object],default:""},placeholder:{type:String,default:"\u5168\u90E8"}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,r=un(!1),i=un(t.placeholder);P0(()=>{if(t.modelValue){const l=t.options.find(u=>u.value===t.modelValue);l&&(i.value=l.label)}document.addEventListener("click",s)}),Ort(()=>{document.removeEventListener("click",s)}),Af(()=>t.modelValue,l=>{if(l){const u=t.options.find(h=>h.value===l);u&&(i.value=u.label)}else i.value=t.placeholder});function a(l){l.stopPropagation(),r.value=!r.value}function o(l){i.value=l.label,r.value=!1,e("update:modelValue",l.value),e("change",l)}function s(l){l.target.closest(".filter-dropdown")||(r.value=!1)}return(l,u)=>(qr(),hn("div",YKr,[fe("div",{class:"selected-filter",onClick:a},[a_(mn(i.value)+" ",1),qKr]),lu(fe("div",ZKr,[(qr(!0),hn(Dp,null,Np(n.options,(h,c)=>(qr(),hn("div",{key:c,class:"menu-item",onClick:f=>o(h)},mn(h.label),9,KKr))),128))],512),[[DPe,r.value]])]))}},_Pe=rf(JKr,[["__scopeId","data-v-6aa232ba"]]);const AL=n=>(kd("data-v-aebeef26"),n=n(),Fd(),n),QKr={class:"event-list-container"},eJr={key:1,class:"event-list-header"},tJr={class:"header-title"},rJr=AL(()=>fe("img",{src:$Qe,alt:"list_bg",class:"header-title-icon"},null,-1)),nJr={class:"header-title-text"},iJr={class:"header-actions"},aJr={class:"search-box"},oJr=["onKeyup"],sJr={class:"event-list-content"},lJr=["onClick"],uJr={class:"car-main-info"},hJr={class:"car-id"},cJr={class:"car-actions"},fJr={class:"car-details"},dJr={class:"detail-row"},vJr={class:"detail-item"},pJr=AL(()=>fe("span",{class:"detail-label"},"\u884C\u9A76\u901F\u5EA6:",-1)),gJr={class:"detail-value"},yJr={class:"detail-item"},mJr=AL(()=>fe("span",{class:"detail-label"},"\u884C\u9A76\u8DDD\u79BB:",-1)),_Jr={class:"detail-value"},xJr={class:"detail-row"},SJr={class:"detail-item"},wJr=AL(()=>fe("span",{class:"detail-label"},"\u4EFB\u52A1\u8FDB\u5EA6:",-1)),bJr={class:"detail-value"},EJr={class:"detail-item"},TJr=AL(()=>fe("span",{class:"detail-label"},"\u8D1F\u8D23\u4EBA:",-1)),CJr={class:"detail-value"},AJr={class:"car-owner"},MJr=AL(()=>fe("span",{class:"owner-icon"},null,-1)),IJr={class:"owner-name"},LJr={class:"event-list-pagination"},PJr=["onClick"],OJr={__name:"eventlist",setup(n,{expose:e}){const t=[{label:"\u5168\u90E8",value:"all"},{label:"\u5728\u7EBF",value:"online"},{label:"\u79BB\u7EBF",value:"offline"},{label:"\u6545\u969C",value:"fault"}],r=un([{label:"\u5168\u90E8",value:"all"}]),i=un("all"),a=un("all"),o=un(""),s=un(1),l=un(8),u=un([]),h=OPe();function c(D,G){return D==="fault"||G?"fault":D==="offline"?"offline":(D==="online","online")}function f(D){return D!=null&&D.isFault?"repair":D!=null&&D.currentTask?"task":"idle"}function d(D){var G,W,z,V,q;return{id:D==null?void 0:D.vehicleId,type:(D==null?void 0:D.vehicleType)||"",status:c(D==null?void 0:D.status,D==null?void 0:D.isFault),taskStatus:f(D),speed:(G=D==null?void 0:D.speed)!=null?G:"",distance:(W=D==null?void 0:D.distance)!=null?W:"",progress:(z=D==null?void 0:D.progress)!=null?z:0,manager:(V=D==null?void 0:D.manager)!=null?V:"",owner:(q=D==null?void 0:D.organization)!=null?q:""}}function v(D){const G=h.getVehicleTypeOverride(D==null?void 0:D.id),W=String(G||"").toUpperCase();return W==="UNMANNED_VEHICLE"?"\u65E0\u4EBA\u8F66":W==="SPECIAL_VEHICLE"?"\u7279\u52E4\u8F66":W==="AIRCRAFT"?"\u822A\u7A7A\u5668":G||(D==null?void 0:D.type)||""}function p(D,G){return{id:D,type:G||"",status:"online",taskStatus:"idle",speed:"",distance:"",progress:0,manager:"",owner:""}}const g=ul(()=>{const D=Array.isArray(u.value)?u.value:[],G=new Set(D.map(q=>q==null?void 0:q.id).filter(Boolean)),W=h.vehicleTypeOverrides||{},z=h.enabledVehicleIds||{},V=[];return Object.keys(W).forEach(q=>{if(!q||G.has(q))return;const Y=String(W[q]||"").toUpperCase();Y!=="UNMANNED_VEHICLE"&&Y!=="SPECIAL_VEHICLE"||z[q]===!0&&V.push(p(q,W[q]))}),[...D,...V]});async function m(D={pageNum:1,pageSize:100}){var G;try{const W=await PS({url:"/api/vehicle-manager/vehicles",method:"get",params:D}),z=W&&W.data!==void 0?W.data:W||{},V=(z==null?void 0:z.rows)||((G=z==null?void 0:z.data)==null?void 0:G.rows)||[];u.value=V.map(d)}catch{u.value=[]}}const y=ul(()=>_.value.length),_=ul(()=>g.value.filter(D=>{if(!h.isVehicleEnabled(D==null?void 0:D.id)||i.value!=="all"&&D.status!==i.value||a.value!=="all"&&v(D)!==a.value)return!1;if(o.value.trim()){const G=o.value.toLowerCase().trim();if(![D.id,v(D),D.manager,D.owner,A(D.status),M(D.taskStatus)].join(" ").toLowerCase().includes(G))return!1}return!0})),x=ul(()=>{const D=_.value.length,G=l.value||1;return Math.max(1,Math.ceil(D/G))}),S=ul(()=>{const D=(s.value-1)*l.value,G=D+l.value;return _.value.slice(D,G)});function w(D){if(typeof D!="number")return;const G=x.value;D<1?s.value=1:D>G?s.value=G:s.value=D}function b(){s.value=1,console.log("\u7B5B\u9009\u6761\u4EF6\u53D8\u66F4:",{status:i.value,type:a.value,search:o.value})}function E(){s.value=1,console.log("\u641C\u7D22\u5173\u952E\u5B57:",o.value)}function T(){o.value="",s.value=1,console.log("\u6E05\u7A7A\u641C\u7D22\u5173\u952E\u5B57")}function C(){Nrt({level:2}).then(D=>{if(D.rows&&Array.isArray(D.rows)){const W=D.rows.filter(z=>z.level===2).map(z=>({label:z.displayNameCn,value:z.displayNameCn}));r.value=[{label:"\u5168\u90E8",value:"all"},...W],console.log("\u8F66\u8F86\u7C7B\u578B\u5217\u8868\u5DF2\u66F4\u65B0:",r.value)}}).catch(D=>{console.error("\u83B7\u53D6\u8F66\u8F86\u7C7B\u578B\u5217\u8868\u5931\u8D25:",D)})}function A(D){switch(D){case"online":return"\u5728\u7EBF";case"offline":return"\u79BB\u7EBF";case"fault":return"\u6545\u969C";default:return"\u672A\u77E5"}}function M(D){switch(D){case"task":return"\u4EFB\u52A1\u4E2D";case"idle":return"\u95F2\u7F6E\u4E2D";case"repair":return"\u7EF4\u4FEE\u4E2D";default:return"\u672A\u77E5"}}e({updateCarList:I});function I(D){D&&Array.isArray(D)&&(u.value=D)}const R=un(null);async function k(D){var G,W,z,V,q,Y,le,j,Q,ie,oe;if(!k.inFlight){k.inFlight=!0;try{const se=await PS({url:`/api/vehicle-manager/vehicles/${encodeURIComponent(D.id)}`,method:"get"}),me=se&&se.data!==void 0?se.data:se||{},Ce={...D,id:(G=me==null?void 0:me.vehicleId)!=null?G:D.id,type:(W=me==null?void 0:me.vehicleType)!=null?W:D.type,brand:(z=me==null?void 0:me.brand)!=null?z:D.brand,manager:(V=me==null?void 0:me.manager)!=null?V:D.manager,company:(q=me==null?void 0:me.organization)!=null?q:D.company,phone:(Y=me==null?void 0:me.contactPhone)!=null?Y:D.phone,speed:(le=me==null?void 0:me.speed)!=null?le:D.speed,distance:(j=me==null?void 0:me.distance)!=null?j:D.distance,batteryTemp:(Q=me==null?void 0:me.batteryTemp)!=null?Q:D.batteryTemp};R.value=Ce;try{const Le=await krt(Ce.id),re=Le&&Le.data!==void 0?Le.data:Le||{};let yt=[];const je=[re==null?void 0:re.data,re==null?void 0:re.rows,re==null?void 0:re.list,re==null?void 0:re.tasks,re];for(const qe of je)if(Array.isArray(qe)){yt=qe;break}(!yt||yt.length===0)&&Array.isArray(re==null?void 0:re.waypoints)&&(yt=[{id:Ce.id,vehicleId:Ce.id,waypoints:re.waypoints,timestamp:re.timestamp}]);const st=qe=>String(qe).padStart(2,"0"),Nt=qe=>{const ur=new Date(qe);return`${ur.getFullYear()}\u5E74${ur.getMonth()+1}\u6708${ur.getDate()}\u65E5 ${st(ur.getHours())}:${st(ur.getMinutes())}:${st(ur.getSeconds())}`},Zt=(yt||[]).map((qe,ur)=>{var zt,mt,wt,pt,ar;const ft=(Array.isArray(qe==null?void 0:qe.points)?qe.points:Array.isArray(qe==null?void 0:qe.waypoints)?qe.waypoints:Array.isArray((zt=qe==null?void 0:qe.path)==null?void 0:zt.points)?qe.path.points:[]).map((kt,Dr)=>{var Jn,Rn,hi,yn,Oi,oi,Gi,ws,Sl,Os;const Sr=(hi=(Rn=(Jn=kt==null?void 0:kt.timestamp)!=null?Jn:kt==null?void 0:kt.time)!=null?Rn:kt==null?void 0:kt.ts)!=null?hi:Date.now()+Dr*1e3,jr=(Gi=(oi=(Oi=(yn=kt==null?void 0:kt.longitude)!=null?yn:kt==null?void 0:kt.lng)!=null?Oi:kt==null?void 0:kt.lon)!=null?oi:kt==null?void 0:kt.y)!=null?Gi:0,pn=(Os=(Sl=(ws=kt==null?void 0:kt.latitude)!=null?ws:kt==null?void 0:kt.lat)!=null?Sl:kt==null?void 0:kt.x)!=null?Os:0;return{timestamp:typeof Sr=="string"?Sr:new Date(Sr).toISOString(),longitude:Number(jr)||0,latitude:Number(pn)||0}});if(ft.length===0)return{time:"",desc:"",distance:"",taskId:String((wt=(mt=qe==null?void 0:qe.missionId)!=null?mt:qe==null?void 0:qe.id)!=null?wt:ur+1)};const Oe=ft[0],J=ft[ft.length-1]||Oe;let We=0;for(let kt=1;kt{console.log("\u8F66\u8F86\u5217\u8868\u7EC4\u4EF6\u5DF2\u52A0\u8F7D"),C(),m()}),(D,G)=>(qr(),hn("div",null,[fe("div",QKr,[R.value?(qr(),uA(jKr,{key:0,car:R.value,onBack:G[0]||(G[0]=W=>R.value=null)},null,8,["car"])):(qr(),hn("div",eJr,[fe("div",tJr,[rJr,fe("div",nJr,"\u8F66\u8F86\u5217\u8868 ("+mn(Xo(y))+")",1)]),fe("div",iJr,[Mf(_Pe,{modelValue:i.value,"onUpdate:modelValue":G[1]||(G[1]=W=>i.value=W),options:t,onChange:b},null,8,["modelValue"]),Mf(_Pe,{modelValue:a.value,"onUpdate:modelValue":G[2]||(G[2]=W=>a.value=W),options:r.value,onChange:b},null,8,["modelValue","options"]),fe("div",aJr,[lu(fe("input",{type:"text",placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22","onUpdate:modelValue":G[3]||(G[3]=W=>o.value=W),onInput:E,onKeyup:RPe(E,["enter"])},null,40,oJr),[[qg,o.value]]),o.value?Bs("",!0):(qr(),hn("div",{key:0,class:"search-icon",onClick:T})),o.value?(qr(),hn("div",{key:1,class:"clear-icon",onClick:T},"\xD7")):Bs("",!0)])])])),fe("div",sJr,[(qr(!0),hn(Dp,null,Np(Xo(S),(W,z)=>(qr(),hn("div",{key:W.id,class:cl(["car-item",{fault:W.status==="fault",online:W.status==="online",offline:W.status==="offline"}]),onClick:V=>k(W)},[fe("div",uJr,[fe("div",hJr,mn(W.id)+" ("+mn(v(W))+")",1),fe("div",cJr,[fe("div",{class:cl(["status-btn",W.taskStatus])},mn(M(W.taskStatus)),3),fe("div",{class:cl(["online-status",W.status])},mn(A(W.status)),3)])]),fe("div",fJr,[fe("div",dJr,[fe("div",vJr,[pJr,fe("span",gJr,mn(W.speed),1)]),fe("div",yJr,[mJr,fe("span",_Jr,mn(W.distance),1)])]),fe("div",xJr,[fe("div",SJr,[wJr,fe("span",bJr,mn(W.progress)+"%",1)]),fe("div",EJr,[TJr,fe("span",CJr,mn(W.manager),1)])]),fe("div",AJr,[MJr,fe("span",IJr,mn(W.owner),1)])])],10,lJr))),128))]),fe("div",LJr,[(qr(!0),hn(Dp,null,Np(Xo(x),W=>(qr(),hn("div",{key:W,class:cl(["page-btn",{active:W===s.value}]),onClick:z=>w(W)},mn(W),11,PJr))),128))])])]))}},RJr=rf(OJr,[["__scopeId","data-v-aebeef26"]]),DJr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJKSURBVHgB7VPNThpRFL53ZtBCSjMubNLYpLhxW7auxDegO10oNNE1w0o3lk40ujIZ4gNAdW95A4aNiRtLH6CBrkhpGqZYZgZm7r39LpWGEjDttvFLhnv4zj3fnL8h5L+DODlJyGeWXyN/gfDwMK2GoR3MzSVYENyolL4G3bxX0N/bey8o1Uf/qcwGD2MsP+h01thg4CjxuA6xpnZ8/G7Wy2Uc6RpGGkYmblmvxp0dw0hoQpTcVqvIOF97vLREFEWpB0LUVMZyT87O8pOCSmdnJ8VcNxO6bmXSuWBZzdD3CZ2f1/vtdp15Xs3zvM/EdavM96dmSb9tbxc45wXY31GijkwFAA9AiIOz/ENVzeVy2ZEB7a2tLDjx9Px8umBrYyMhgqDEFSWvMHYjOTH8EWgpNZ9dXprkH6D5jkMUSlOwP7ARKzOEJnhbGoOjI0OjNINKLO3g4I/M5ArxIMgJRUmiorpG0KMQAhFK0zQScX7fDEPJf5Qm9zyCQbyEWfL291N4ofmo33f8aNQY3N6+GQoPO4QsGqmUHnheZuX6unhfKT3DKHAhCrK1gvMGxr0ABV12HD11FPQ5dnpapNOCv2azKXkulsv2ON/Z3S0hPkPu1k0OEMJFEouZ2AiHjByT+LK52cCRQHBT+P66j2lHo9G34HIyYDgwVbUhZi5eXNTGY6d+eujZOsqrorQXKKeBS07Y6/1aKZQHLv+8Upm+NmQGGum0TrrdKswkoXfXKLUwLHPZtp1ZcTMFR/i0uppDVklOSHHl6qpOHjCJnxWaE28UYzl7AAAAAElFTkSuQmCC",NJr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANMSURBVHgBlZTNbhtVFMfPueMJNBuGJ8jwBDW8QJIVIJDsIiGVUCkxK0RBjiuUquFjbBYEqJoYCQQLJDuq2rAA7EgIkFjEeYK2T9DJsl20TuvE47lzzumZiTpqPuq2V16M7z33dz7+51yEZyz585tFMBiASB8I1/H9r+rj7HEsbCPwwcXb+vX4Bzjp+vjOlzsvBJSNL2YAkhCMWwTEDgCLCOpKmTgLZBQYAX7wfXj0rjkG+325Cchb6qoEE04PSMFMykxAmHYiinfAsSUBc1s2LtbHRkjXP2+j4LyG0sS5H2qZg9ZFH16SavodjeIfT1WaYbZ/bSkQkLqG3HY+vFw5BqSrtToCBoy4UDh3ZR1OKkUn8NkmgYljiOzDxssTkzPA2AKUGp5bbeYpS2vRR+avhbn+NFi2hsOiGQ3DZDhcd61twd17XSBqCtGqtD72cyADBULJTszR02FZGslp4FGINAwgGq4zDKoqU0NruwvgVnMgstXQqXeq8ms4FijSo/1oVoE9TEavSBwVsdLsG6a2kJ1PTQrSWvDYkm9Quofu/hGUAZ1pddnPNxPadh7c6RAlHtjRLifcyAKn5JZB8OS381MFa13fEWoC8a1DwHi/auYuzz65x9eWOubT62eOBu64tsvWTCfx3qu5yvHPC0V3EkKstPvSOr+mAs1rW2yarMaQjYm20wwap42Vnxq5Y80wGUDR/azdy8onv5z1hZ0tEZjSSYBE+IKLhT4Ji16uq4mvY6LjDDcEYdNoHfGTq9sHQcwtGG0bPVMLDI0tvGHYYlUVnlJRUOVHhyGgaE+th02IBtrNgxBHeyFEe57sD+qQRHmqBZIgnSLWe9oBr3EhqhaA04TUN1DqJZ1Wz7HRfWJedJb/O9RG8bdvLzqWcpE4Fedx6mm6LB7K2lmfOU7T8TDdR2g4tb8a8ByLrrwXqH06gilu14749UwUWSnrvMK0boZ4obP9PDBZK3tY6/Zl9UxJ/3mwC5vY6PbxqBEnlD6mJS3NR+6lv3snwezKu6q2tLQTuu6lf2tPnh17D2XlLV8fq61UXQYJUaRrjAkPDtnXmpTTM73ZY4O1iaV/bo4F5uDv3iwRcVmrU1To6QPr9GGVnoPQxuX/TyzNI9WdzeQzAvSaAAAAAElFTkSuQmCC",kJr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAL+SURBVHgBrVQ9TBRBFH5vZg8Q/87GRC1YexPu1EiiMUKiibGQO2Ote4mFheawMKLNHYWFheGuMrEBCisLDoyFxGQhFhghARITOzl7o6sIy+3OvOfsHiBC4AL6Njuz8/O++d735i1CA+OZgg0gXfOZBNB9mO4rNfIRjTYAkwukBgGUw1r3+5MPbPgXUx96HZrunV8d66mH/TR1323kty1TwUEBdVhcG1t+HxC1h5M9nbsCDSfvFIlCwI6nQ6tzmC55DLUygi7ATkF58rYtWN2UrJxNDktWGShIhe9udcJOQEmHBa2CcTz7bGLjGnaVPGLdx0ADW4HixgnfdWxL6s+W3H8SWo8kN7uoqrlW1WDixjyRLrd0vSg1ZJrA5QLrcIiaD+SJgm6jblv9pahvZxXEDDUFOYHczjOPU/W7vAVT383YkuS8Fvp4U8sxV7Qk0lFy/uL5/q4rfZmNZODpR3lGWUIENktV086F2hTIeofgbbeLMuGh3Jcymh1k4JF6OALIPLGx6DQgSZbYZSUODwNyWzzNhqAQg/L0k5y1xnLsskM6sJsXfqTVAcrXQWTKkMhQxIQjMjgrEqIHQuoWiaMZ1r5tQLkesAE8U85FWGugSGFBIBQxO+7V3lw0GOyYow8SxjTiFgFtVeOibG6toAocFmYXMQohZuW557lVrBjUf33eMfUNTVcm4otOwc84aBaiHGVyJXDzG4CIcsqSR2xmv42V4Qng+Urn1su4wlQXmP6UI6mFOQRZas1+LMMGC8YupbT2ZzA6ieOpZBPCTOher1igcthV8azF0VMZ0GF1z9WptXLcm/1UgS1M672eJYMiKSNPlCQjDGuY07Vf5ZAXo/K9ZwmtPUKVWnh5orPOe1VmVf9WpreslbFpl6ugl4MR2XLsiwEdABSVcOlbWWKYN4JV4/zEmg6fKBitMkb25Mqdq8fGiHHO4+ybvRjlL+4HRdMhB1lWVO3rnElwxHC+hkvXDmWrHuzGFkdOF5dfdeThf9n34VTSH01f2G7PbyaydzoUZ98tAAAAAElFTkSuQmCC",FJr=n=>(kd("data-v-499c1eca"),n=n(),Fd(),n),BJr={class:"alarm-notification-container"},GJr={class:"detail-tabs"},zJr={class:"tab-header"},UJr={class:"tab-list"},VJr=FJr(()=>fe("i",{class:"close-icon"},"\xD7",-1)),$Jr=[VJr],WJr={class:"alarm-list"},HJr={key:0,src:DJr,class:"alarm-img",alt:"\u8F66\u8F86\u51B2\u7A81"},jJr={key:1,src:NJr,class:"alarm-img",alt:"\u8D8A\u754C\u544A\u8B66"},XJr={key:2,src:kJr,class:"alarm-img",alt:"\u8D85\u901F\u544A\u8B66"},YJr={key:3,class:"alarm-dot"},qJr={class:"alarm-content"},ZJr={class:"alarm-title"},KJr={class:"alarm-time"},JJr={key:0,class:"empty-data"},QJr={__name:"AlarmNotification",emits:["close"],setup(n,{expose:e,emit:t}){const r=un("all"),i=un(!0),a=un([]),o=ul(()=>r.value==="all"?a.value:a.value.filter(l=>l.type===r.value));function s(){i.value=!1,t("close")}return e({updateAlarmList(l){l&&Array.isArray(l)&&(a.value=l)},show(){i.value=!0},hide(){i.value=!1},toggle(){i.value=!i.value},isVisible(){return i.value}}),(l,u)=>lu((qr(),hn("div",BJr,[fe("div",GJr,[fe("div",zJr,[fe("div",UJr,[fe("div",{class:cl(["tab-item",{active:r.value==="all"}]),onClick:u[0]||(u[0]=h=>r.value="all")}," \u5168\u90E8 ",2),fe("div",{class:cl(["tab-item",{active:r.value==="car"}]),onClick:u[1]||(u[1]=h=>r.value="car")}," \u8F66\u8F86\u51B2\u7A81 ",2),fe("div",{class:cl(["tab-item",{active:r.value==="report"}]),onClick:u[2]||(u[2]=h=>r.value="report")}," \u8D8A\u754C\u544A\u8B66 ",2),fe("div",{class:cl(["tab-item",{active:r.value==="speed"}]),onClick:u[3]||(u[3]=h=>r.value="speed")}," \u8D85\u901F\u544A\u8B66 ",2)]),fe("div",{class:"tab-actions"},[fe("div",{class:"close-btn",onClick:s},$Jr)])])]),fe("div",WJr,[(qr(!0),hn(Dp,null,Np(Xo(o),(h,c)=>(qr(),hn("div",{class:"alarm-item",key:c},[fe("div",{class:cl(["alarm-icon1",h.level])},[h.type==="car"?(qr(),hn("img",HJr)):h.type==="report"?(qr(),hn("img",jJr)):h.type==="speed"?(qr(),hn("img",XJr)):(qr(),hn("i",YJr))],2),fe("div",qJr,[fe("div",ZJr,mn(h.carId)+" ("+mn(h.carType)+") "+mn(h.time)+" "+mn(h.description),1),fe("div",KJr,mn(h.date),1)])]))),128)),Xo(o).length===0?(qr(),hn("div",JJr," \u6682\u65E0\u544A\u8B66\u6570\u636E ")):Bs("",!0)])],512)),[[DPe,i.value]])}},eQr=rf(QJr,[["__scopeId","data-v-499c1eca"]]),tQr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAG7SURBVHgBvZRLTgJBEIb/aokxLszcQFj42Ck3gAsYETVxN5wAOAFwAzwBvTbKeAPgBrhDYDE3cFhCZNqq4eEwvBNjJZ1UT3V/XV31TwN/bLRtwZljXx/4uPYNPMWj86CbewPjjm0d+SgYQp6nViTs8vemAiqdjHa3Ai8dO2UMnBUgLIF9FLv3+n0t8PzVviUVwHY2GiMdLgOFMotzZg1249jDDOCNBki4Oe3JXM0CPlDaFcYH63GMUux6nJF1eBLUGgtAMkjtCutmda5/U2tJcyabUVgAijQi2XnTsRIm/uWbXeYkbic8WGcvAWMC5MKGYaAhkjLYddfBOLvSwp4YXc2BiiISiSHeedIuQ9MCZVFXN8GmWf42ZazQDgf9AzhyBYEOB0j2srq4CRYwpsC5bC7q9hdCYhY5mG+ke4+6vQ0mt/i804nJ5WYAQpWLXA5dweJo47yeKxBMkg/Ir4FJfZszfy6bY+AZkc4KlGEaG2CSnRqhsgRsZ7RHhAz2NPmfpdZLQDF+PZoMDTqL7eaNQano46CiqwIoy0V0twbscazM3U/072qtaHCnB1YZOuWmWIbMRy+j2/hP+wHqGsG1HQspqAAAAABJRU5ErkJggg==",Dw=n=>(kd("data-v-aaea1471"),n=n(),Fd(),n),rQr={key:0,class:"weather-station-container"},nQr={class:"weather-station-box"},iQr=Dw(()=>fe("div",{class:"weather-station-title"},[fe("span",null,"\u4FE1\u53F7\u706FXH001 | \u6C14\u8C61\u76D1\u6D4B"),fe("img",{class:"weather-station-status",src:tQr,alt:"\u6C14\u8C61\u76D1\u6D4B\u7AD9"})],-1)),aQr={class:"weather-station-content"},oQr={class:"weather-station-info-container"},sQr={class:"weather-station-info-row"},lQr={class:"weather-station-info-item"},uQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u6E29\u5EA6:",-1)),hQr={class:"weather-info-value"},cQr={class:"weather-station-info-item"},fQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u6E7F\u5EA6:",-1)),dQr={class:"weather-info-value"},vQr={class:"weather-station-info-row"},pQr={class:"weather-station-info-item"},gQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u98CE\u901F:",-1)),yQr={class:"weather-info-value"},mQr={class:"weather-station-info-item"},_Qr=Dw(()=>fe("span",{class:"weather-info-label"},"\u80FD\u89C1\u5EA6:",-1)),xQr={class:"weather-info-value"},SQr={class:"weather-station-info-row"},wQr={class:"weather-station-info-item"},bQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u98CE\u5411:",-1)),EQr={class:"weather-info-value"},TQr={class:"weather-station-info-item"},CQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u6E7F\u6ED1\u7A0B\u5EA6:",-1)),AQr={class:"weather-info-value"},MQr={class:"weather-station-info-row"},IQr={class:"weather-station-info-item"},LQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u6C14\u538B:",-1)),PQr={class:"weather-info-value"},OQr={__name:"WeatherStationPopup",props:{visible:{type:Boolean,default:!1},stationData:{type:Object,default:()=>({})},position:{type:Object,default:()=>({x:0,y:0})}},emits:["close"],setup(n,{emit:e}){const t=n;Rrt(o=>({"0f57bb8d":t.position.x+"px","7738e86c":t.position.y+"px"}));const r=un({temperature:"22.5",humidity:"68",windSpeed:"3.2",visibility:"8.5",pressure:"1013.2",windDirection:"\u5317\u98CE",wetness:"\u5E72\u71E5",updateTime:Date.now()});function i(){r.value={temperature:"22.5",humidity:"68",windSpeed:"3.2",visibility:"8.5",pressure:"1013.2",windDirection:"\u5317\u98CE",wetness:"\u5E72\u71E5",updateTime:Date.now()}}function a(){e("close")}return P0(()=>{const o=setInterval(()=>{i()},6e4);i_(()=>{clearInterval(o)})}),(o,s)=>n.visible?(qr(),hn("div",rQr,[fe("div",nQr,[fe("div",{class:"weather-station-header"},[iQr,fe("img",{class:"weather-station-close",src:hz,alt:"",onClick:a})]),fe("div",aQr,[fe("div",oQr,[fe("div",sQr,[fe("div",lQr,[uQr,fe("span",hQr,mn(r.value.temperature)+"\xB0C",1)]),fe("div",cQr,[fQr,fe("span",dQr,mn(r.value.humidity)+"%",1)])]),fe("div",vQr,[fe("div",pQr,[gQr,fe("span",yQr,mn(r.value.windSpeed)+"m/s",1)]),fe("div",mQr,[_Qr,fe("span",xQr,mn(r.value.visibility)+"km",1)])]),fe("div",SQr,[fe("div",wQr,[bQr,fe("span",EQr,mn(r.value.windDirection),1)]),fe("div",TQr,[CQr,fe("span",AQr,mn(r.value.wetness),1)])]),fe("div",MQr,[fe("div",IQr,[LQr,fe("span",PQr,mn(r.value.pressure)+"hPa",1)])])])])])])):Bs("",!0)}},RQr=rf(OQr,[["__scopeId","data-v-aaea1471"]]),DQr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAABOCAYAAABSU1QqAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA8bSURBVHgBzVpLjxxXFT73VlU/ZjweTxJszeSBE9mJbCBK0hGsgkYIELCPlDV/IAhQRISQxYIFC34Ie1iTLUIjFhGbSKA4UTy2Y3s8Hk8/quqey3fuo+pWT0/3KO876unu6nurTn3nnO88bhF9Q8aNGzc0jUYFvflmlh5X9DWN3d3d/O5dGuQXyrXZROWqGMwOzcPJDlG1t7dXxXk5fYVjezRa2zQbF3VBF249zArqc8nHelIbPSmKxWu+VAGvXPl5P9t49KRl/YzOiktsTc7KTqlSE9ZmqphUbdj0Oa/G5X1Dd6DdnS9ZwMuv7F7okb2qtH5e2ckWqcyqTJdsqykpPWMMKmhMhh7XqjjmflZqolpTZnd2tmmP9r9YAUVtW3Zjp6zttVyrl5j4HEx7pqwtieRFMxybMJuDIsse6Vwds9UVaV0NSVuLCeYI/zaIbkG4ET7ufV4BXxztPpUxvULKfo8tbddk80xTzWQrTRqyMitlD1jRQ7L6ET7PKOtVpEzp/FLEhqanmGCGmvpy0gNod2sbHz4jgtdffeO6UfQaLjAiYzYNaWPJ1rhcrayq8PlYkT2EjT0odHZUM5eWVZVlDNMzFnOszQtFlSHqCa5EgyHReJLZYz22/S2P4P7cdU8V8NLLL68/oZ/cZc3XFanrOO2QLEMoBdmUsQzTJzq0Vh2S4gPoaorfSs2we0DWOVmWK6oNPKK2thcQdAMSUk3rvKZqEeXWAY12lqj42uu732XD38eFvgOhvg0ZLAEAq7TohPFvAhwe4/2IRH24LFmqIFwt63Xg1UxbBX1TBv8goyGsoAch5Txl3SA4pQnZocYa4eYDJ8PeaQi++OruW2zoLTkZlkAqFgOGLenH7nRWPcZPM6tUBVlhaxm0htm4trYZCWS4G5EKVs94y4CKoRgWFAyBIteVM2pixBivtVagFU7Csq7EJaEyxlI9hTo1GQvNKajUAiWNWYxLk/skC2B/isJnGSaH1EZMNJ638vNsoUp8zp1blF7FazPRh/PiRQhqmh+shB7uKsrG6SwB1d8COyHj/SRv4QvmmXjvQA1qrh26ucKwvV7hVNzrwRgnE79mo4vgEgHnvqr26sBOtTIwZd27IopHYLHyalRjlM2hW5irdUgGBynL0jofkXF05N/nosgCieaGba+vU1nwxQTJYagq/sqyQjw4F+TSE1Xtx154A4J97isFmvFHtiDf9ioVR2VZj1bATOvuCn3ivkB1EFk3RkjCKn6IJ0fvEDkDghoIIhxaOwS7io69E69ScTvgmsoLwl0bo3gbulmtdat+UW8mL22TVM4j6KiGgpD9gaOZZmyJhPsn5DghoMcbDCJEE1wiqjUVEU5tUydR3JKzgGeE0+PIvGCqIfAZTWdTGky61751i1YLqMIVlVYqfLcByGQR/qwOFwXY7BFvTyI2GN0kd44in6oq2qKLvjQVJxGuEC8WAHe2VwvojyJwBkSsY5g5KsmEjRBnAiLcsk6DWm5iJGmRzKFi4cGGZmQIScOJt7bESVaqOH6VC3N7pDG34K1GTA0MbgNqEkDwp5MSosafAXJ1cva6rhthS6wWL3ZBRHzkQCCEF+8tFZBbCMJPNqDSugo3pCJHrERY3T1T6iB5ZufqHu/Rg5mY0cy6aCA0uOV/HY2WCqhPVFEqoNIwXQhwDdlAv8zBYQIfGZhHprOFBVlPeBCxGNkgUWTqEEkW+MgSHtQLpopdhilZmJ2l87hLSJnDF5EkoOiwE4rpBScRmhnHQLK1KJCcYoNBEK3nf7ZOnXLUJQvaJS6C5ZwHi+Mq67i6FtIO9FIUTSQZ9MP8NQ/gVmTq5QK2gnhBA6YJMExJ5BU6Uj5zDcHPRqImgxQ0D4JFO6zaWDydhftJQt0ZBGydRFIobhyinakXLW8SCnIqNQlpO+EiD8q/Xrt6IGssQp2zwQMQ9RloJgRhMR7r8IhETR1Zmm/g6TWQ9TDNZsSLxUnqlGPEAmMkKb2KxU3WAg86Ba/OZuairuARuY3TBT5hdfKQHlprfwtqH8YERhBU83UJ8CskFjsnke+C35DGtHwszwep5cHuLaTzRBb1LMD+nQgbj9amnjtT4YQsQ+IgsRglDkWiliHp1goBY/QPRi1G1aHGNp606Z5HCmA/B9B+Dz8fyo+ZnefBygnZo7YJI5FknEB468yhLtKLpKI2iQTcOo1ppncixWXIewOhcN2Xnp4HWxl9HHZFE2xwhkgSY7Er3M+MoPhGdFAYV+rJ3MxiWmQSkPZ5rfiXPtwpRztp0loGoh6kNLPhkwXJB/f2NuwSAeOwahH3dVMGfSJytEKqH0Gwt9O6xKnYyei5UCzQ0Yxk1M6LD86WD8aENfluuxO5LZpOzcfdoh/jNn9Dc97sbdDDZ2GD6W/S3RqNjtQSAVOP8OioJof1OLpktdDeBnnBKdKh1E8x5x3K26LJBZIQi50NJuPWWVL+eOb5GZ2cwKRzF6s5GT9TnL/r9Vt4Cgw1iYy1FYtPERAhL6T8TcmpdRubabWK58YvVMa/Sg/0kI87mpmbeGrZqZv2hYw2rUpkbjNrG+xqlYrbsY81f+1cWElq1FWxJISnlp2cOIbPUiwnXxsvZi+/MkmGvWLchse8bbl2BuaTGV/ViSensS7LenZvYxnN2OSoDf4SKjq9cMHKcRtLfw0qbKzfZdTCg+RpZi0xQmNKNTpa5sXNT7bTh/EE7XFs+XBF18TSHejgHa3snXisLTvJRZJ5mjlDNtOED+vyZO1IZW6qbuuT02jeojum6V24WiOc5JdF3Axx/cEBzWYommJdLGM1UXNymH2gOEEzyRxeLBxu7w/M+q47YHwLztFMJ6NGZ2E47Kh40Vjco3Y2GIyPfWcwVh3haPgi1YjyZuDHp7CTP6qMPoVTyHdF0vWoXPgLbWAh0b47k2wGpBCdoWhqcGgoB3xjdTPT2578972ZDoT3YBl/UiJkKDtdTSLJQuFjsSvcYwMdCDaRBLFYH+Z2admpg2O0sViHfFC7So5D9RQpx4beDDt7pXvA58+Ydo9CeibNI5fyi4pD7los2JCLLMOb2NHYWULU3CSeyS/KC9ZNrEKMlmrOT5kApr9gxr1mStq8TIxIvNgBCCcZINQNmhYrnaU/mAZYZ1gOQb3QCNj3Zsh55xh2eL8pOyV7MaaVLUl4BcFY1Hmi9v23Y42cMFSdS3ozWfLVBk1Tt1EuxRCzTZfZhtBD88glqpLz516zIRe0lLecJ9lMSBZk+MJ9y4e6pb0ZG+tiq6INdiYCKqs9cv6gdxpmbl3b+H/5XAu4yKOKPVkPXNHksxlGgSAJ6wovNm3yR6GBGb9wmg+2A/7hk1kt+WFqIplrv2VJZyu23mLRNJ2X5GBl8yi1bOU3mmzIqHUnfvgZ0lm1LR01q8UGnZpz1x9s0n1BMenNuCG9o9g8Wtz5OCXUUWgS+ZpzLnjHOSz7ZFYEFRENUdObcc2nKHFTMIU4XLbnkkjimkcu1G0tbAHn7YUlyetUmG7vTSToqDXZHxEmdE7i3cL3ZuJwhbtq+tNuVH5LLI6pK9xD+bCqu8VJ29cJEDpcp+UtDiDX4fCuZJIfXHcr3nsWy07y7bcF4/gYNBPq4vl8MJ+XVwxPhd6K9DS88fsqVCeMjSgq7S+PmmXXo+6m4R5B6Q1mIQhYEbzXvaLY4Dq8eGM9GOF7781J1AxvRaHn0SSrOtQiem523IZwn53BmsgwHX/L87k+delfscsfsxlRsHtmYTQ6LWFNzqqTmiOgxnMLnDBSFzj8fEvTnQH7xZ0etfW7nX56bX3Z6bv81Bm+yz8/Ts1mpKZJN8Fa320ll7340Gl12vW1skQaQ00Ts6GatjUjQ4haYnHaPDp7j1pEjBdQNincT5vt0c9jCzjduyOxxrRw958ZKnZeHJtHRK7Duny30yZlJ3nbSqPF/NJWZBNTtZBqyfq2P5gHV/TJQmwiYb94EtKtkPJLVbd8t1O1RB1T/iaCpDVw0m0VZ3Hd/pjNBJrJs4Rm6sInC4mOJVXo91E0iYQBwUuXyrme4qLmEViL2G2RO17sAhdquuQgu8xaY78kZDNAT3qDvsNaN0Ttd9zbIbH4ZG/m5DhRNOEWhipTV+ElzyBfOB+pTzc8s2j/uN2aJR2a6K7DmjsEhWaadCsJddL6cOnMRgzFJ7244ZYLF3fu4vrrgHAd/LwG04My1Dqyhk15XAOhxcgTIVpoXBIZcSN3R1IFBbYh5/iMGIj+EhvUJM7d2chTShVnRU/cmyE727zgWs3kQSHOjzSP++sosz7lD+Sc+/t8QsCDOx8fP7j90T/v3775tycuPvchuLCEM1526YBSPWCwjuxlHSfsQbgpFFo5rwoCyhNJUWCWzog8E1Vjj0e7gC5zjMah0ijWeBU4Wa76poDEttS82dd8RFN+CefYXyRgOu7f+eiT+/s3/1XsPPn33OafIEtdh7qfcjt4ym14bAKoDThVjY0YVDuqCiWWZ0QRWhvBkkVY99wZftNZj42Zse7lXJel0Uj1xwA7LwXBQylU+YO9vZAY+aHojOPKq298C4Jcg1f/BOp/huShMviC4xOlHkFpd4HUI5zxsZY6LtdlhSw1y+TBM7xqU+ZFr7JlXXFPVzwrK5hghTup+kdZtbFxJATpXukjotlZBYT6xw9u37x5//aH/7j09NV/w5QKADoAZQ4kfYTw5xB7LoB0enAwCE0Tee7NqRg2iEux5ppLoKmznPuwQQmK9SQ3GbAe90tGsINauio+M4KnjWuv/PBqzep1bMtehsGdg2+4BxvhSmNU/A9hr6iZs0Nr6yoHkjN57/VbBMdA0IyremOr2qIBkNvvIPi5BUzHlZffeE3n2VXN9gWcujLWzMCPpWVzrAv1AJ5+bzpTk3yBius6ryZbB9XOZ1XxWcaDOx/t39//8D/nn37qffjvXdB3gaRjDdwPbXMO2l8rCtXLlK2k31DoYV1BzTk8mKeHfHG4DdU+/mJVvGpcv757rhrwswhPV1iKZUtT+PcU/jVBGfVYFdWjkvWE9bhEaD6B4JcuYDpeGI02e7T+XF2ZdQhHE1NPBjlNapuPh7Y+vtebzL7WB73/t7d3iLf35fOVKz84nw36m1VW9YeZVpXqa/r4v7Kb01nzlSJ42tjeHq2dPz/IHp2bmv094cK9ir6hQ9EcaP8H8vStdyyempgAAAAASUVORK5CYII=",NQr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAABOCAYAAABSU1QqAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA8ZSURBVHgBzVpLjxxXFT733urHzLhtDwmxZhJCCHaiGIiSdARiERiEWLBjEym/AKQsAIGExAJFbFiyQWLB74A1WbBBaMQiYhMJlIfisR3b4/F4+lFV91y+cx9Vt3p6ukd5n1FPd1ffqvrqPL7zqCL6gsgbb7yhaTzu0auvmny7os9J9vb2itu3aVhcLjfnU1Wo3nB+ZO9Pd4mq/f39Kq0r6DOUnfF485IdPaZ7dPnGfdOjAZd8oqe11dNeb/k+nyrAq1d/PDCjB4841k9o07vCzhas3IwqNWVtZ4pJ1ZbtgItqUt61dAvW3f2UAT71wt7lPrlrSuuvKTfdJmWcMrpkV81I6TlDqEcTsvSwVr0THphSE9WajNvd3aF9OvhkAYrZtt1ot6zdc4VWzzLxBbj2XDlXEsmL5tg2ZbaHPWMe6EKdsNMVaV1tkHYOC+wx/o2IbgDcGB/3Py7AZ8Z7jxqmF0i5b7GjnZpcYTTVTK7SpIGVWSl3yIruk9MP8HlOpl+RsqWPS4ENS8+wwG5oGshBD2Hd7R18+IgavP7iK9etopdwgjFZe8mSto5cjdPVyqkKn08UuSP42L2eNsc1c+lYVcYwXM86rHGu6CmqLFFf9Eo03CCaTI070RM32A4aPFg475kArzz//NaX9CN7rPm6InUdh90gxwClgE1Zx3B9oiPn1BEpPoStZvit1Ay/h8o6BzOFotoiImrn+lGDXoCQatriTVULlBuHNN5dYeLnXt77Jlv+Nk70DYD6KjA4ggKc0mITxr8p9PAQ78ck5sNpyVEFcLXsryOvGu0U7E0G8UFWA6xoDyDlOGXdaHBGU3IbGvsINx96DPtnafCZF/deY0uvycGwC1CxODB8ST/0h3PqIX6aO6UqYIWvGVgNq3Fu7QyJynA1ggpez3gz0IqllBYUHIES15VzanLEBK/NFtCaIGHZr8QpYTLGrnoGc2qyDpZTMKmDljRWMU5N/pPsAP9TFD+L2AKorbhoOm4V1rmeKvG58GFRBhNvzsUePoqXaVDTorASerityEzyVaLUcAnsQabryd7iF6yz6dqhNZi59totFMT1+z1v4n4fzjidhn1GXQ2uALjwVbVnh+5Ui4HJdK+KKG2Bx8qrMY1VroBt4a7OazIGSFmWzseIyPFxeF/IIksQLYhrz69zLPhiI3I4qkq/suwhEVyI5vIDVe3HfnyDBgc8UAo0E7ZsA9/OOhMnY7mgragzrbt76FPXBaoDZN04IQmrBJFITtEhOKMGNTSIdOjcBthVbByCeJ2JW0FoqgCEuz5G6TJ0s7fWrfnFvEZe2mWlXNCgpxqKIAdDTzONbAvCg1M4TgEM+gaDCNHEkEhmzSEiqF0eJIpbchblWeH0JCYAUw2Bz2k2n9Fw2j33jRu0HqCKZ1RaqfjdRUVmO+HP6XhSKJuDxtuDiA+mMCl8oMinqkq+6LMvzSRIhCskikWBuzvrAYatSJxRI84zzAKVGGEj5JmoEW5Zp9FaYVMmaTVZwMTCgw3NiAhJI4i3tyVI1po4fZUTc7ulcbcYrVZcDQzuotYkgeBPZy1EjT8LzdXZ0eu6bsCW2Fui2CcRiZFDUSGieH8lQG5VEH9yUSttqHBDKrLFSYbV3SPlAVIYt9D3hIgezsWN5s5nA6HB7fDreLwSoD7VRamolYbpYoJryAb2ZY4BE/nIwj2MNksbsr7wIHIxqkGixNQxkyyJkRU8qJcsFb+MS0xcbfJ13CUk4/WLTBK16HUnFNOPQSI0M0mJZHtZIjnDByMQrRd/dt6cstUXC9oXLqLLhQiWwFXOc3UtpB3ppddrMslwENdvBgVuJ6ZeDbAFEoBGnWaKYcoyr9CRCpVrTH4uETVZlKBFBJb8sGpz8WwerydLdecA2AaJlFDcBES7Ui/bvSkoyJvUZqTtwSUelH/9du+h7OOQ6rwPHoKoz0EzMQmL8zivj0TU1MHSXpCLUZxVMxLFEiR1zjHigQ5QLF5lMLGEyWbkQW/g9dXMQtYVfSRu43yHULD6JSoqXTcQfRSrxb7EVSNj9F+cc6OgRdHfBk1otayuB6nlwe4ltOt8ucV06tpq26oPUC9oY/6Mlc9YCsAlF6PFoUTUIlJurQGYsn90anGqDjW2+aTpNRS5QNm2XWbE9SIPOnMBUfMnHOVa+Kklbskkk0yFN86d6hK9SCnqskzAbdDYuNxrUOeQw49CM8hm0A3/Edd5tQVfhKYJPjhHJkm52Dfu59agnDYFKOqGPJJba2Y1GAcNqlRRU0h3yM6/xsev52ewUjyAqIc5zYxCsSD14P7+yK0AmMSpZdzXLRl0mzmgQdGoC61bqNgc/RLfv7v08GWIYE8zUlH7KD48Xz2YCtbsu+su5LZpShv992hi41H+HK8f0hLBOuW7djk2fDD/TaZb4/GxWgEwj4igHdXUsEGPvljtBY2FJdqnRBuDBGXY69jjB3SGWMl9MRd7H8zkxnlK/iBKLa7o1AQ2X8uhmhFwSv0Mmvs+rZPYk4hsrll6BkBkiFjyNy2n1m1upgUTa98h/AQ7vEJrxMRhRh/1uKeZhd/PbDt1M74QacuqDHNbWbvoo8nEUiM6/Q98+ZDWSFK+1ONqwcRSEJ7ZdnIWGKFKcZx9baKYA35lswpbBBq9A6//gzsHyNTVSSTnuc6YvtsfraIZl211MV5iR6eX7hAhNpeiPoR2f48a4zadITL88jxIgWY2Mye0tlTj41VR3PzkOnOYQNBBjy0fZrvqhrqlHfwQe/9uFUgvg9M0c45qpkkfLtGHPqU73fYnnb3j6ENSHGtMx+i3OMgtWiZ+Pjik+RxNU+qLRdYTNWebOZjuFM1ka7h7mLwvZmcAzv0GkG9S9zq8+MnCxkbHxMtEn701Oh93e6G4NX7BnFXHlKezvti3DLWMCm+hHfgVtrYMHH1QeFBuBuSnPUfTlKSlHCcE0gEdTBxmM20uFmn4O7ad0pNogATAX1CcDNm0CBpsMglysT4q3Mq2U8fAaHOxjvWgVrqpC7ihHBdnM2nQHqYLRKlYkOGRL/nRj+BmxQGQvo4fD8wCgMQyfAl3NHZXEHXiQZX/ogIwptM+6Lu5CLTTdorkKOIMyVXuQDH/1DI/kCAZwsTDZsRK55kP5gkWaY6Dy+ulTsARWDR13nZKPRjt6LFlBa8q+jcK8rcxIlGH+duJRk0Yu84VsxmTfXXR0tQdlEsz5AuDhZ7EHykGiQ8Q4ytn35X4lrPyQ/RmpxgkSULjvh1S3crZjEt9sVPJBzsLURE4HTQXNoagYeY2tG34VyyMgHtFmA+Wcdo69E1TqGZ4yyopWNdEsW2LP4oDzPSF83qwFfB5KGazejCi8uM3k0220uitH6dbs0Ukh2uHR7lnq3CjycWKWnfyR1ghk1XX0lGzt/igN3Ph54PJxF6L2WzGi8yO0vBo+eTjjFRHcUgUes6F5N3U+XKfzIW2M1g2zWb88Ckhbqb8cfxbtseSTOKHRz7VbS8dARftiaXI63SY/t6bIOiYNbs/IuTigySERWiakvjGXTXzaS9VuCWWZOYb99g+rJtucTb29QDihGuhbmnEK8hPOEIo2ewHP91K1y4aTL54xpMTJyegmdgXL9aDxSJecTwVZytycy04f+hCdd4KKz/+iq1m6Oq6ZXjQoMwGTUwCToD3u2cUH9xCFI+2ohO++eYCokaCF8V5RVOs6tiL6IXV6TaE/+wd1iaG6cRbUSzMqcvwSlP+VM2Igf0zC+PxWQVrdlSd9RxRa7ywgwcjfUEzm4mdMUrmzozahbudYXntn7IQLcqUnzoSpvyLcmY1Iz1NfhOsjd0WudyLj5NWb93QK0umsdQMMRuqCTGSLCxELbk4Hx6df0YtENMJlMsa97NWB+0XaQSsu8VDnd3tTJmEYWIfxWl4ROQnrKvvdrqs7aTgW3m2WNy1hWxTqRZLLdm/nQ8WMRSFqFMm8feLp7HciiW/dHWr73aqlqhTyd9kEM6WZ9NWCRY/7U/VTKSZwmQ0U/dCsZDZWEqFwQBNkyCMGrxypVS0EmCAZoj9LXLPi13FxZ4u28i+spbSP1Yz0J7MBsOEtW6IOtxxb0Vy8enZzGk51TThEjaUUdcQJU+gXriYqE9nfcrpoUN7a5Z0HKL7CWvhNSg005RbWaqT0YcvZ0YpFZ+O4oZbLj+2exvn34IKt8DPm3A9GENtoWq4JI9rILXIhLLUQuN+/Of8OwmXU2Qb8oHPyIGYL7FFT+LDna08pVSx6fUlvNHwQe1Fj2s1lweFuDjWPBlscU0f8ttyzIMDPgXw8Nb7J/duvvfPuzff/euXHnvyHXBhiWB8ypcDSvWhgy1UL1s4YB/gZjBo5aMqApQnkhJglsmIPBNV4x6P9gld1liNTaVF14xXDwcr1MD2gNiVmi8NNB/TjJ/FMQ6WAczl7q33Prh78O6/eruP/K1wxQeoUrdg7kf9HTwlYaguQVEjBFWNGzHodlQVW6zAiAJaW9ElC1j/3Bl+06bP1s5Z9wuuy9JqlPoTKLsoRYNH0CDx2/v7sTAKouiccvXFV74MIM8hqn8E8z9B8lAZYsHziVIPYLTb0NQDHPGhlkelCl1WqFKNkQfP8KptWfT6lSvrivu64nlZwQUrXEk1ODbVaHQsBOlf+SOi5rwAYf7JvZvvvnv35jt/v/L4tX/DlXpQ6BCUOZTyEeAvIPdcBun0EWAATVN57s2bGD6IU7HmmktoU5uCB/BBSYr1tLAGup4MSkay49GCic+twbPkuRe+d61m9TJuyz4Fh7uA2PAPNiKUJuj478Nf7yAzH6E5rgpoci7v/UGrwQk0aCdVPdqutmkIzR10NPixAeZy9flXXtKFuYZpwtM4dGWdnYMfS8f2RPfUPUT6ndlcTYslJq7roppuH1a7H9XE55F7t947uHvwzn8uPv7oW4jf26DvHoqOTXA/rM0FaH+z11N9o1wFYqx7eqOuYOYCEcyzI35sYwemffjJmnidXL++d6Ea8leQnq6yNMuOZojvGeJrijbqoepVD0rWU9aTEqn5lAY/dYC5PD0eX+rT1pN1ZbcAjqa2ng4LmtaumGy4+uROfzr/XB/0/t/+/hHe3pLPV69+56IZDi5VphpsGK0qNdD0/n/lbk5nn89Ug2fJzs548+LFoXlwYWYP9oUL9yv6goqiBaX9H5WkspUGs1/AAAAAAElFTkSuQmCC",kQr="/airport/assets/red.892fd06c.svg",FQr="/airport/assets/yellow.ada6d5da.svg",BQr="/airport/assets/green.08121006.svg";const $m=n=>(kd("data-v-2b86b8c7"),n=n(),Fd(),n),GQr={class:"platform-overview platform-no-padding"},zQr={class:"alarm-stats-card"},UQr={class:"stats-header"},VQr=$m(()=>fe("span",{class:"stats-title"},"\u544A\u8B66\u7EDF\u8BA1",-1)),$Qr={class:"stats-time"},WQr={class:"stats-content"},HQr=$m(()=>fe("img",{src:Urt,class:"stats-icon"},null,-1)),jQr={class:"stats-text"},XQr={class:"stats-count"},YQr=$m(()=>fe("span",{class:"stats-label"},"\u51B2\u7A81\u9884\u8B66",-1)),qQr={key:0,class:"new-badge"},ZQr=$m(()=>fe("img",{src:Vrt,class:"stats-icon"},null,-1)),KQr={class:"stats-text"},JQr={class:"stats-count"},QQr=$m(()=>fe("span",{class:"stats-label"},"\u51B2\u7A81\u544A\u8B66",-1)),een={key:0,class:"new-badge"},ten=$m(()=>fe("img",{src:$rt,class:"stats-icon"},null,-1)),ren={class:"stats-text"},nen={class:"stats-count"},ien=$m(()=>fe("span",{class:"stats-label"},"\u8D8A\u754C\u544A\u8B66",-1)),aen={key:0,class:"new-badge"},oen=$m(()=>fe("img",{src:Wrt,class:"stats-icon"},null,-1)),sen={class:"stats-text"},len={class:"stats-count"},uen=$m(()=>fe("span",{class:"stats-label"},"\u8D85\u901F\u544A\u8B66",-1)),hen={key:0,class:"new-badge"},cen=$m(()=>fe("i",{class:"alarm-icon"},null,-1)),fen={key:0,class:"alarm-badge"},den=["src","alt"],ven={__name:"index",setup(n){const e=un(!1),t=un(!1),r=un(null),i=un(null),a=un(null),o=un([]),s=un(null),l=un(null),u=un([]),h=un(null),c=un(!1),f=un(null),d=un({x:0,y:0}),v=ul(()=>{var Q;return(((Q=i.value)==null?void 0:Q.alarmList)||[]).filter(ie=>ie.type==="car"&&ie.level==="medium").length}),p=ul(()=>{var Q;return(((Q=i.value)==null?void 0:Q.alarmList)||[]).filter(ie=>ie.type==="car"&&ie.level==="high").length}),g=ul(()=>{var Q;return(((Q=i.value)==null?void 0:Q.alarmList)||[]).filter(ie=>ie.type==="report").length}),m=ul(()=>{var Q;return(((Q=i.value)==null?void 0:Q.alarmList)||[]).filter(ie=>ie.type==="speed").length}),y=ul(()=>{var ie;return(((ie=i.value)==null?void 0:ie.alarmList)||[]).filter(oe=>oe.type==="car"&&oe.level==="medium"&&Date.now()-new Date(oe.date).getTime()<1e4).length>0}),_=ul(()=>{var ie;return(((ie=i.value)==null?void 0:ie.alarmList)||[]).filter(oe=>oe.type==="car"&&oe.level==="high"&&Date.now()-new Date(oe.date).getTime()<1e4).length>0}),x=ul(()=>{var ie;return(((ie=i.value)==null?void 0:ie.alarmList)||[]).filter(oe=>oe.type==="report"&&Date.now()-new Date(oe.date).getTime()<1e4).length>0}),S=ul(()=>{var ie;return(((ie=i.value)==null?void 0:ie.alarmList)||[]).filter(oe=>oe.type==="speed"&&Date.now()-new Date(oe.date).getTime()<1e4).length>0}),w=un(""),b=un(null);Af(()=>{var j;return(j=i.value)==null?void 0:j.alarmList},j=>{j&&b.value&&b.value.updateAlarmList(j)},{deep:!0});function E(){const j=new Date;w.value=j.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"})}const T=ul(()=>v.value+p.value+g.value+m.value),C=ul(()=>{var j;return((j=i.value)==null?void 0:j.vehicleCategories)||{}});function A(j,Q){i.value&&i.value.setCategoryVisibility&&i.value.setCategoryVisibility(j,Q)}function M(){i.value&&i.value.drawTestRoute&&i.value.drawTestRoute()}function I(){t.value=!1,console.log("\u544A\u8B66\u9762\u677F\u5DF2\u5173\u95ED")}function R(){c.value=!1,f.value=null,console.log("\u6C14\u8C61\u76D1\u6D4B\u7AD9\u5F39\u7A97\u5DF2\u5173\u95ED")}function k(j){const Q=a.value.forEachFeatureAtPixel(j.pixel,function(ie){return ie});if(Q){const ie=Q.getProperties();if(ie.type==="trafficLight"){f.value=ie;const oe=j.pixel[0],se=j.pixel[1],Ce=a.value.getTargetElement().getBoundingClientRect();d.value={x:Ce.left+oe+20,y:Ce.top+se-50},c.value=!0,console.log("\u70B9\u51FB\u4E86\u7EA2\u7EFF\u706F:",ie,"\u5F39\u7A97\u4F4D\u7F6E:",d.value)}}}function D(){e.value=!e.value}function G(){t.value=!t.value,t.value&&b.value&&i.value&&b.value.updateAlarmList(i.value.alarmList)}async function W(){console.log("\u{1F50D} \u5F00\u59CB\u83B7\u53D6\u8DEF\u53E3\u6570\u636E...");try{const j=await Brt();console.log("\u{1F4E1} API\u54CD\u5E94\u539F\u59CB\u6570\u636E:",j),console.log("\u{1F4CA} \u54CD\u5E94\u6570\u636E\u7C7B\u578B:",typeof j,"\u662F\u5426\u4E3A\u6570\u7EC4:",Array.isArray(j)),j&&Array.isArray(j)?(console.log("\u2705 \u54CD\u5E94\u6570\u636E\u6709\u6548\uFF0C\u8DEF\u53E3\u6570\u91CF:",j.length),o.value=j.map(Q=>{const ie={intersectionId:Q.intersectionId,intersectionName:Q.intersectionName,longitude:Q.longitude,latitude:Q.latitude,areaCode:Q.areaCode||"",description:Q.description||"",status:Q.isActive?"1":"0",createTime:Q.createdTime};return console.log("\u{1F5FA}\uFE0F \u6620\u5C04\u8DEF\u53E3\u6570\u636E:",ie),ie}),console.log("\u2705 \u83B7\u53D6\u8DEF\u53E3\u6570\u636E\u6210\u529F\uFF0C\u603B\u6570:",o.value.length),console.log("\u{1F4CD} \u5904\u7406\u540E\u7684\u8DEF\u53E3\u6570\u636E:",o.value)):(console.warn("\u26A0\uFE0F API\u54CD\u5E94\u6570\u636E\u65E0\u6548\u6216\u4E0D\u662F\u6570\u7EC4"),o.value=[])}catch(j){console.error("\u274C \u83B7\u53D6\u8DEF\u53E3\u5217\u8868\u5931\u8D25:",j),console.error("\u274C \u9519\u8BEF\u8BE6\u60C5:",j.message,j.stack),o.value=[]}}function z(j="unknown",Q="ns"){let ie=zrt;j==="red"?ie=kQr:j==="yellow"?ie=FQr:j==="green"&&(ie=BQr);const oe=Q==="ew"?Math.PI/2:0;return new T1({image:new Art({src:ie,scale:.2,anchor:[.5,.5],opacity:1,rotation:oe})})}const V=un({});function q(j){var ie;if(!j)return;let Q="unknown";if(j.status)Q=j.status;else if(j.ns_status||j.ew_status)Q=j.ns_status||j.ew_status||"unknown";else{const oe=j.serviceData?j.serviceData:j,se=Array.isArray(oe&&oe.phases)?oe.phases:[];if(se.length>0){const me=se.map(Ce=>Number(Ce.phaseColor));me.includes(3)?Q="red":me.includes(4)||me.includes(2)?Q="yellow":me.includes(1)&&(Q="green")}else{const me=Number((ie=oe&&oe.trafficLightsStatus)!=null?ie:j.trafficLightsStatus);me===3?Q="red":me===4||me===2?Q="yellow":me===1&&(Q="green")}}V.value.globalStatus=Q,V.value.timestamp=Date.now(),Y()}function Y(){if(!h.value||!h.value.getSource())return;const j=h.value.getSource(),Q=j.getFeatures(),ie=V.value.globalStatus||"unknown";Q.forEach(oe=>{oe.getProperties().type==="trafficLight"&&oe.setStyle(z(ie,"ns"))}),j.changed()}window.updateTrafficLightStatus=q;function le(){if(console.log("\u{1F6A6} \u5F00\u59CB\u6E32\u67D3\u7EA2\u7EFF\u706F\u5230\u5730\u56FE..."),console.log("\u{1F5FA}\uFE0F \u5730\u56FE\u5B9E\u4F8B\u72B6\u6001:",a.value?"\u5DF2\u521D\u59CB\u5316":"\u672A\u521D\u59CB\u5316"),console.log("\u{1F4CD} \u7EA2\u7EFF\u706F\u6570\u636E\u6570\u91CF:",u.value.length),!a.value){console.warn("\u26A0\uFE0F \u5730\u56FE\u5B9E\u4F8B\u672A\u521D\u59CB\u5316\uFF0C\u65E0\u6CD5\u6E32\u67D3\u7EA2\u7EFF\u706F");return}h.value&&(console.log("\u{1F5D1}\uFE0F \u79FB\u9664\u73B0\u6709\u7EA2\u7EFF\u706F\u56FE\u5C42"),a.value.removeLayer(h.value));const j=new Hx;let Q=0,ie=0;if([{id:"fixed-1",longitude:120.09986800557976,latitude:36.35086289387643,intersectionName:"\u56FA\u5B9A\u5750\u6807\u70B91",status:"green"},{id:"fixed-2",longitude:120.09437418546923,latitude:36.34969069796734,intersectionName:"\u56FA\u5B9A\u5750\u6807\u70B92",status:"red"},{id:"fixed-3",longitude:120.0857115242345,latitude:36.346946273836345,intersectionName:"\u56FA\u5B9A\u5750\u6807\u70B93",status:"yellow"}].forEach((se,me)=>{console.log(`\u{1F50D} \u5904\u7406\u56FA\u5B9A\u5750\u6807\u70B9${me+1}:`,se);const Ce=parseFloat(se.longitude),Le=parseFloat(se.latitude);console.log(`\u{1F4CD} \u56FA\u5B9A\u5750\u6807\u70B9 "${se.intersectionName}" \u4F4D\u7F6E: [${Ce}, ${Le}]`);const re=lA([Ce,Le],"EPSG:4326",a.value.getView().getProjection());console.log("\u{1F504} \u8F6C\u6362\u540E\u7684\u5730\u56FE\u5750\u6807:",re);const yt=new Qb(re),je=new E1({geometry:yt,...se,type:"trafficLight",deviceName:se.intersectionName+" (\u5357\u5317\u65B9\u5411)",intersectionId:se.id,deviceId:se.id+"-ns"});je.setStyle(z(se.status,"ns")),j.addFeature(je),Q++,console.log(`\u2705 \u56FA\u5B9A\u5750\u6807\u70B9 "${se.intersectionName}" \u5DF2\u6DFB\u52A0\u5230\u5730\u56FE`);const st=Ce+8e-4,Nt=Le-5e-4,Zt=lA([st,Nt],"EPSG:4326",a.value.getView().getProjection()),qe=new Qb(Zt);new E1({geometry:qe,...se,id:se.id+"-ew",longitude:st,latitude:Nt,type:"trafficLight",deviceName:se.intersectionName+" (\u4E1C\u897F\u65B9\u5411)",intersectionId:se.id,deviceId:se.id+"-ew"})}),u.value.forEach((se,me)=>{if(console.log(`\u{1F50D} \u5904\u7406\u7B2C${me+1}\u4E2A\u7EA2\u7EFF\u706F:`,se),se.longitude&&se.latitude){const Ce=parseFloat(se.longitude),Le=parseFloat(se.latitude);if(console.log(`\u{1F4CD} \u7EA2\u7EFF\u706F "${se.deviceName}" \u4F4D\u7F6E: [${Ce}, ${Le}] (\u8DEF\u53E3: ${se.intersectionName})`),isNaN(Ce)||isNaN(Le)){console.warn(`\u26A0\uFE0F \u7EA2\u7EFF\u706F "${se.deviceName}" \u5750\u6807\u65E0\u6548: [${se.longitude}, ${se.latitude}]`),ie++;return}const re=lA([Ce,Le],"EPSG:4326",a.value.getView().getProjection());console.log("\u{1F504} \u8F6C\u6362\u540E\u7684\u5730\u56FE\u5750\u6807:",re);const yt=new Qb(re),je=new E1({geometry:yt,...se,type:"trafficLight",deviceName:se.deviceName+" (\u5357\u5317\u65B9\u5411)",deviceId:se.deviceId+"-ns"});je.setStyle(z(se.status||"unknown","ns")),j.addFeature(je),Q++,console.log(`\u2705 \u7EA2\u7EFF\u706F "${se.deviceName}" \u5DF2\u6DFB\u52A0\u5230\u5730\u56FE`);const st=Ce+1e-4,Nt=lA([st,Le],"EPSG:4326",a.value.getView().getProjection()),Zt=new Qb(Nt),qe=new E1({geometry:Zt,...se,id:se.id+"-ew",longitude:st,latitude:Le,type:"trafficLight",deviceName:(se.deviceName||se.intersectionName)+" (\u4E1C\u897F\u65B9\u5411)",deviceId:se.deviceId+"-ew"});qe.setStyle(z(se.status||"unknown","ew")),j.addFeature(qe),Q++,console.log(`\u2705 \u7EA2\u7EFF\u706F "${se.deviceName}" \u7684\u914D\u5BF9\u7EA2\u7EFF\u706F\u5DF2\u6DFB\u52A0\u5230\u5730\u56FE`)}else console.warn(`\u26A0\uFE0F \u7EA2\u7EFF\u706F "${se.deviceName}" \u7F3A\u5C11\u7ECF\u7EAC\u5EA6\u4FE1\u606F (\u672A\u5339\u914D\u5230\u8DEF\u53E3):`,{intersectionId:se.intersectionId,longitude:se.longitude,latitude:se.latitude}),ie++}),console.log(`\u{1F4CA} \u7EA2\u7EFF\u706F\u5904\u7406\u7EDF\u8BA1: \u6709\u6548=${Q}, \u65E0\u6548=${ie}`),Q===0){console.warn("\u26A0\uFE0F \u6CA1\u6709\u6709\u6548\u7684\u7EA2\u7EFF\u706F\u5750\u6807\u53EF\u4EE5\u6E32\u67D3");return}h.value=new sp({source:j,zIndex:2001}),console.log("\u{1F6A6} \u521B\u5EFA\u7EA2\u7EFF\u706F\u56FE\u5C42:",h.value),console.log("\u{1F4CD} \u56FE\u5C42\u7279\u5F81\u6570\u91CF:",j.getFeatures().length),a.value.addLayer(h.value),console.log("\u2705 \u7EA2\u7EFF\u706F\u56FE\u5C42\u5DF2\u6DFB\u52A0\u5230\u5730\u56FE"),Y(),setTimeout(()=>{h.value.setZIndex(2001),console.log("\u{1F5FA}\uFE0F \u8BBE\u7F6E\u7EA2\u7EFF\u706F\u56FE\u5C42zIndex\u4E3A2001")},100)}return Drt(()=>{console.log("\u5E73\u53F0\u6982\u89C8\u7EC4\u4EF6\u88AB\u6FC0\u6D3B"),setTimeout(()=>{if(i.value){const j=i.value.wsConnected;console.log("WebSocket\u8FDE\u63A5\u72B6\u6001:",j),j||(console.log("WebSocket\u672A\u8FDE\u63A5\uFF0C\u5C1D\u8BD5\u91CD\u65B0\u8FDE\u63A5"),i.value.reconnectWebSocket())}},1e3)}),P0(()=>{var Q;(Q=document.querySelector(".app-main"))==null||Q.classList.add("platform-no-padding"),E();const j=setInterval(E,1e3);r.value&&setTimeout(async()=>{a.value=r.value.map,console.log("\u5730\u56FE\u5B9E\u4F8B\u5DF2\u83B7\u53D6:",a.value),await W(),le(),a.value.on("click",k)},1e3),i_(()=>{clearInterval(j),l.value&&Rde(l.value)}),window.updateTrafficLightStatus=q}),i_(()=>{var j;(j=document.querySelector(".app-main"))==null||j.classList.remove("platform-no-padding"),a.value&&s.value&&a.value.removeLayer(s.value),l.value&&Rde(l.value)}),Af(()=>{var j;return(j=r.value)==null?void 0:j.map},j=>{j&&(a.value=j,console.log("\u5730\u56FE\u5B9E\u4F8B\u5DF2\u66F4\u65B0:",a.value),W())}),(j,Q)=>(qr(),hn("div",GQr,[Mf(XZr,{ref_key:"mapRef",ref:r,vehicleMovementControl:i.value,vehicleCategories:Xo(C),onSetCategoryVisibility:A,onDrawTestRoute:M},null,8,["vehicleMovementControl","vehicleCategories"]),Mf(fKr),fe("div",zQr,[fe("div",UQr,[VQr,fe("span",$Qr,mn(w.value),1)]),fe("div",WQr,[fe("div",{class:cl(["stats-item",{"has-new":Xo(y)}])},[HQr,fe("div",jQr,[fe("span",XQr,mn(Xo(v)),1),YQr]),Xo(y)?(qr(),hn("span",qQr)):Bs("",!0)],2),fe("div",{class:cl(["stats-item",{"has-new":Xo(_)}])},[ZQr,fe("div",KQr,[fe("span",JQr,mn(Xo(p)),1),QQr]),Xo(_)?(qr(),hn("span",een)):Bs("",!0)],2),fe("div",{class:cl(["stats-item",{"has-new":Xo(x)}])},[ten,fe("div",ren,[fe("span",nen,mn(Xo(g)),1),ien]),Xo(x)?(qr(),hn("span",aen)):Bs("",!0)],2),fe("div",{class:cl(["stats-item",{"has-new":Xo(S)}])},[oen,fe("div",sen,[fe("span",len,mn(Xo(m)),1),uen]),Xo(S)?(qr(),hn("span",hen)):Bs("",!0)],2)])]),t.value?(qr(),uA(eQr,{key:0,ref_key:"alarmNotificationRef",ref:b,onClose:I},null,512)):Bs("",!0),fe("div",{class:"alarm-btn",onClick:G},[cen,Xo(T)>0?(qr(),hn("span",fen,mn(Xo(T)),1)):Bs("",!0)]),fe("img",{class:cl(["eventlist-toggle-btn",{"btn-opened":e.value}]),src:e.value?Xo(DQr):Xo(NQr),alt:e.value?"\u6536\u8D77\u8F66\u8F86\u5217\u8868":"\u5C55\u5F00\u8F66\u8F86\u5217\u8868",onClick:D},null,10,den),e.value?(qr(),uA(RJr,{key:1})):Bs("",!0),a.value?(qr(),uA(Crt,{key:2,map:a.value,ref_key:"vehicleMovementRef",ref:i},null,8,["map"])):Bs("",!0),c.value?(qr(),uA(RQr,{key:3,visible:c.value,"station-data":f.value,position:d.value,onClose:R},null,8,["visible","station-data","position"])):Bs("",!0)]))}},$en=rf(ven,[["__scopeId","data-v-2b86b8c7"]]);export{$en as default};