You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7561 lines
2.1 MiB
7561 lines
2.1 MiB
!(function(){var Z_=(rr,ee,L)=>new Promise((q,he)=>{var _=fe=>{try{U(L.next(fe))}catch(se){he(se)}},le=fe=>{try{U(L.throw(fe))}catch(se){he(se)}},U=fe=>fe.done?q(fe.value):Promise.resolve(fe.value).then(_,le);U((L=L.apply(rr,ee)).next())});(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3633],{99758:function(rr,ee,L){"use strict";var q=L(79685),he=L(81383),_=function(){return _=Object.assign||function(U){for(var fe,se=1,Qe=arguments.length;se<Qe;se++){fe=arguments[se];for(var ae in fe)Object.prototype.hasOwnProperty.call(fe,ae)&&(U[ae]=fe[ae])}return U},_.apply(this,arguments)},le=function(U){return q.createElement(he.P,_({},U,{chartType:"Area"}))};ee.Z=le},30524:function(rr,ee,L){"use strict";var q=L(79685),he=L(81383),_=function(){return _=Object.assign||function(U){for(var fe,se=1,Qe=arguments.length;se<Qe;se++){fe=arguments[se];for(var ae in fe)Object.prototype.hasOwnProperty.call(fe,ae)&&(U[ae]=fe[ae])}return U},_.apply(this,arguments)},le=function(U){return q.createElement(he.P,_({},U,{chartType:"Gauge"}))};ee.Z=le},46302:function(rr,ee,L){"use strict";var q=L(79685),he=L(81383),_=function(){return _=Object.assign||function(U){for(var fe,se=1,Qe=arguments.length;se<Qe;se++){fe=arguments[se];for(var ae in fe)Object.prototype.hasOwnProperty.call(fe,ae)&&(U[ae]=fe[ae])}return U},_.apply(this,arguments)},le=function(U){return q.createElement(he.P,_({},U,{chartType:"Liquid"}))};ee.Z=le},20413:function(rr,ee,L){"use strict";var q=L(79685),he=L(81383),_=function(){return _=Object.assign||function(U){for(var fe,se=1,Qe=arguments.length;se<Qe;se++){fe=arguments[se];for(var ae in fe)Object.prototype.hasOwnProperty.call(fe,ae)&&(U[ae]=fe[ae])}return U},_.apply(this,arguments)},le=function(U){return q.createElement(he.P,_({},U,{chartType:"WordCloud"}))};ee.Z=le},79586:function(rr,ee,L){"use strict";L.d(ee,{f:function(){return Ye}});var q=L(6346),he=L(89543),_=L(68591),le=L.n(_),U=L(79685),fe=L(34435),se=L(93264),Qe=L(33298),ae=function(Xt){return(0,q.Z)({},Xt.componentCls,{width:"100%","&-wide":{maxWidth:1152,margin:"0 auto"}})};function et(wt){return(0,Qe.Xj)("ProLayoutGridContent",function(Xt){var Zt=(0,se.Z)((0,se.Z)({},Xt),{},{componentCls:".".concat(wt)});return[ae(Zt)]})}var dt=L(63342),Ye=function(Xt){var Zt=(0,U.useContext)(fe.X),nr=Xt.children,Vt=Xt.contentWidth,xt=Xt.className,bt=Xt.style,Tr=(0,U.useContext)(he.ZP.ConfigContext),hr=Tr.getPrefixCls,lr=Xt.prefixCls||hr("pro"),At=Vt||Zt.contentWidth,ut="".concat(lr,"-grid-content"),It=et(ut),qe=It.wrapSSR,Ct=It.hashId,fr=At==="Fixed"&&Zt.layout==="top";return qe((0,dt.jsx)("div",{className:le()(ut,Ct,xt,(0,q.Z)({},"".concat(ut,"-wide"),fr)),style:bt,children:(0,dt.jsx)("div",{className:"".concat(lr,"-grid-content-children ").concat(Ct).trim(),children:nr})}))}},43700:function(rr,ee,L){"use strict";L.d(ee,{S:function(){return se}});var q=L(93264),he=L(98787),_=L(2219),le=L(79685),U=L(63342),fe=["isLoading","pastDelay","timedOut","error","retry"],se=function(ae){var et=ae.isLoading,dt=ae.pastDelay,Ye=ae.timedOut,wt=ae.error,Xt=ae.retry,Zt=(0,he.Z)(ae,fe);return(0,U.jsx)("div",{style:{paddingBlockStart:100,textAlign:"center"},children:(0,U.jsx)(_.Z,(0,q.Z)({size:"large"},Zt))})}},34435:function(rr,ee,L){"use strict";L.d(ee,{X:function(){return he}});var q=L(79685),he=(0,q.createContext)({})},16604:function(){window._iconfont_svg_string_3580659='<svg><symbol id="l7-icon-area1" viewBox="0 0 1024 1024"><path d="M796.444444 56.888889a113.777778 113.777778 0 0 1 43.064889 219.136l38.798223 466.261333a113.777778 113.777778 0 1 1-133.518223 145.237334H279.210667a113.777778 113.777778 0 1 1-60.302223-137.272889L697.856 227.555556A113.777778 113.777778 0 0 1 796.444444 56.888889z m56.888889 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-682.666666 0a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m577.592889-534.072889L269.198222 796.444444c4.152889 7.168 7.509333 14.791111 10.012445 22.812445h465.578666a114.119111 114.119111 0 0 1 65.479111-71.224889l-38.798222-466.261333a112.924444 112.924444 0 0 1-23.210666-7.964445zM796.444444 125.155556a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-area" viewBox="0 0 1024 1024"><path d="M796.444444 56.888889a113.777778 113.777778 0 0 1 43.008 219.136l38.855112 466.261333a113.777778 113.777778 0 0 1-16.497778 224.540445L853.333333 967.111111a113.777778 113.777778 0 0 1-108.544-79.644444H279.210667a113.834667 113.834667 0 0 1-100.067556 79.36L170.666667 967.111111a113.777778 113.777778 0 0 1-17.066667-226.304l30.492444-351.175111a113.777778 113.777778 0 0 1 34.986667-218.680889L227.555556 170.666667a113.777778 113.777778 0 0 1 99.896888 59.221333l355.84-71.395556a113.777778 113.777778 0 0 1 104.675556-101.262222L796.444444 56.888889z m56.888889 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-682.666666 0a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m526.051555-582.314666L340.650667 296.903111a113.891556 113.891556 0 0 1-88.462223 98.645333l-30.947555 355.84c27.477333 13.653333 48.64 38.115556 58.026667 67.754667h465.521777a114.119111 114.119111 0 0 1 65.536-71.168l-38.855111-466.261333a113.948444 113.948444 0 0 1-74.752-56.206222zM227.555556 238.933333a45.511111 45.511111 0 1 0 0 91.022223 45.511111 45.511111 0 0 0 0-91.022223z m568.888888-113.777777a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-delete" viewBox="0 0 1024 1024"><path d="M705.422222 85.333333a34.133333 34.133333 0 0 1 34.133334 34.133334V227.555556h136.533333a34.133333 34.133333 0 0 1 0 68.266666h-25.543111l-24.348445 610.076445a34.133333 34.133333 0 0 1-34.133333 32.768H231.936a34.133333 34.133333 0 0 1-34.076444-32.768L173.340444 295.822222H147.911111a34.133333 34.133333 0 1 1 0-68.266666H284.444444V119.466667a34.133333 34.133333 0 0 1 34.133334-34.133334h386.844444zM241.720889 295.822222l22.983111 574.577778h494.535111l23.04-574.577778H241.720889zM671.288889 153.6H352.711111V227.555556h318.577778V153.6z" ></path></symbol><symbol id="l7-icon-color" viewBox="0 0 1024 1024"><path d="M512 56.888889c9.841778 0 19.626667 0.341333 29.354667 0.910222 69.176889 4.437333 119.068444 62.577778 124.302222 131.072l0.455111 9.386667c0.739556 44.600889 15.303111 84.935111 44.999111 114.631111 27.022222 27.022222 62.805333 41.528889 102.570667 44.430222l12.060444 0.568889c72.476444 1.194667 135.793778 52.451556 140.458667 124.757333 1.137778 18.261333 1.251556 36.807111 0.170667 55.637334-13.198222 233.585778-211.399111 424.220444-445.326223 428.714666L512 967.111111a455.111111 455.111111 0 0 1-455.054222-464.156444c4.551111-233.927111 195.185778-432.128 428.771555-445.326223C494.535111 57.116444 503.296 56.888889 512 56.888889z m0 68.266667a385.706667 385.706667 0 0 0-22.414222 0.625777C291.726222 136.988444 129.080889 305.948444 125.155556 504.263111c-4.152889 212.366222 163.100444 387.185778 372.508444 394.353778l13.425778 0.227555 8.533333-0.113777c198.371556-3.811556 367.331556-166.456889 378.538667-364.373334a396.174222 396.174222 0 0 0-0.170667-47.331555c-1.991111-31.232-29.127111-56.604444-67.128889-60.472889l-8.248889-0.455111-14.051555-0.682667c-56.547556-4.209778-107.406222-25.884444-145.806222-64.284444-38.855111-38.798222-60.416-90.225778-64.284445-145.749334l-0.910222-21.333333c-2.901333-38.001778-28.785778-66.048-60.302222-68.096A433.891556 433.891556 0 0 0 512 125.155556zM438.044444 682.666667a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z m-170.666666-227.555556a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z m142.222222-227.555555a68.266667 68.266667 0 1 1 0 136.533333 68.266667 68.266667 0 0 1 0-136.533333z" ></path></symbol><symbol id="l7-icon-base-map" viewBox="0 0 1024 1024"><path d="M923.761778 115.029333A34.133333 34.133333 0 0 1 967.111111 147.911111v624.128a34.133333 34.133333 0 0 1-22.186667 32.028445l-278.755555 103.992888a34.133333 34.133333 0 0 1-23.665778 0.056889L381.724444 812.714667a34.133333 34.133333 0 0 0-23.665777 0.113777L102.968889 908.060444a34.133333 34.133333 0 0 1-45.738667-26.965333L56.888889 876.088889V251.960889a34.133333 34.133333 0 0 1 22.186667-32.028445l278.755555-103.992888a34.133333 34.133333 0 0 1 20.992-0.967112l266.183111 72.988445a34.133333 34.133333 0 0 0 18.204445 0zM403.911111 192.625778v555.576889l216.177778 79.075555V251.960889l-216.177778-59.335111z m-68.266667 4.380444L125.155556 275.569778v551.310222l210.432-78.506667V197.006222zM898.844444 192.853333l-210.545777 58.936889v575.089778l210.545777-78.563556V192.853333z" ></path></symbol><symbol id="l7-icon-dot" viewBox="0 0 1024 1024"><path d="M341.333333 739.555556a113.777778 113.777778 0 0 1 8.533334 227.271111L341.333333 967.111111a113.777778 113.777778 0 0 1-8.533333-227.271111L341.333333 739.555556z m0 68.266666a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM910.222222 341.333333a113.777778 113.777778 0 0 1 8.533334 227.271111L910.222222 568.888889a113.777778 113.777778 0 0 1-8.533333-227.271111L910.222222 341.333333z m0 68.266667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM227.555556 56.888889a113.777778 113.777778 0 0 1 8.533333 227.271111L227.555556 284.444444a113.777778 113.777778 0 0 1-8.533334-227.271111L227.555556 56.888889z m0 68.266667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-display" viewBox="0 0 1024 1024"><path d="M512 170.666667c284.444444 0 455.111111 227.555556 455.111111 341.333333s-170.666667 341.333333-455.111111 341.333333-455.111111-227.555556-455.111111-341.333333 170.666667-341.333333 455.111111-341.333333z m0 68.266666C303.729778 238.933333 125.155556 401.237333 125.155556 512c0 110.762667 178.574222 273.066667 386.844444 273.066667s386.844444-162.304 386.844444-273.066667c0-110.762667-178.574222-273.066667-386.844444-273.066667zM512 341.333333a170.666667 170.666667 0 1 1 0 341.333334 170.666667 170.666667 0 0 1 0-341.333334z m0 68.266667a102.4 102.4 0 1 0 0 204.8 102.4 102.4 0 0 0 0-204.8z" ></path></symbol><symbol id="l7-icon-enlarge" viewBox="0 0 1024 1024"><path d="M546.133333 147.911111l-0.056889 329.955556H876.088889a34.133333 34.133333 0 0 1 0 68.266666H546.076444v329.955556a34.133333 34.133333 0 0 1-68.266666 0V546.133333H147.911111a34.133333 34.133333 0 1 1 0-68.266666h329.898667V147.911111a34.133333 34.133333 0 0 1 68.266666 0z" ></path></symbol><symbol id="l7-icon-export-picture" viewBox="0 0 1024 1024"><path d="M883.873684 161.684211a32.336842 32.336842 0 0 1 32.336842 32.336842v582.063158a32.336842 32.336842 0 0 1-32.336842 32.336842H86.231579a32.336842 32.336842 0 0 1-32.336842-32.336842V194.021053a32.336842 32.336842 0 0 1 32.336842-32.336842h797.642105z m-32.336842 64.673684H118.568421v517.389473h170.792421a32.175158 32.175158 0 0 1 0.431158-0.646736l3.772632-4.473264 330.320842-330.374736a32.336842 32.336842 0 0 1 38.588631-5.389474l4.473263 3.018105 184.589474 147.725474V226.357895z m-202.428631 248.131368L379.850105 743.747368H851.536842v-107.304421l-202.428631-161.953684zM323.368421 323.368421a107.789474 107.789474 0 1 1 0 215.578947 107.789474 107.789474 0 0 1 0-215.578947z m0 64.673684a43.115789 43.115789 0 1 0 0 86.231579 43.115789 43.115789 0 0 0 0-86.231579z" ></path></symbol><symbol id="l7-icon-exit-fullscreen" viewBox="0 0 1024 1024"><path d="M841.955556 591.644444a34.133333 34.133333 0 0 1 5.518222 67.811556l-5.518222 0.455111h-133.745778l192 192.056889a34.133333 34.133333 0 0 1-38.343111 55.182222l-5.176889-2.958222-4.721778-3.982222L659.911111 708.266667V841.955556a34.133333 34.133333 0 0 1-28.615111 33.678222L625.777778 876.088889a34.133333 34.133333 0 0 1-33.678222-28.615111L591.644444 841.955556V625.777778a34.133333 34.133333 0 0 1 28.615112-33.678222L625.777778 591.644444h216.177778z m-443.733334 0a34.133333 34.133333 0 0 1 33.678222 28.615112L432.355556 625.777778v216.177778a34.133333 34.133333 0 0 1-67.811556 5.518222L364.088889 841.955556v-133.745778l-192.056889 192a34.133333 34.133333 0 0 1-52.224-43.52l3.982222-4.721778L315.847111 659.911111H182.044444a34.133333 34.133333 0 0 1-33.678222-28.615111L147.911111 625.777778a34.133333 34.133333 0 0 1 28.615111-33.678222L182.044444 591.644444H398.222222zM167.310222 119.808l4.721778 3.982222L364.088889 315.847111V182.044444a34.133333 34.133333 0 0 1 28.615111-33.678222L398.222222 147.911111a34.133333 34.133333 0 0 1 33.678222 28.615111L432.355556 182.044444V398.222222a34.133333 34.133333 0 0 1-28.615112 33.678222L398.222222 432.355556H182.044444a34.133333 34.133333 0 0 1-5.518222-67.811556L182.044444 364.088889h133.802667L123.790222 172.032a34.133333 34.133333 0 0 1 43.52-52.224z m732.899556 3.982222a34.133333 34.133333 0 0 1 3.982222 43.52l-3.982222 4.721778L708.266667 364.088889H841.955556a34.133333 34.133333 0 0 1 33.678222 28.615111L876.088889 398.222222a34.133333 34.133333 0 0 1-28.615111 33.678222L841.955556 432.355556H625.777778a34.133333 34.133333 0 0 1-33.678222-28.615112L591.644444 398.222222V182.044444a34.133333 34.133333 0 0 1 67.811556-5.518222l0.455111 5.518222v133.802667l192.056889-192.056889a34.133333 34.133333 0 0 1 48.241778 0z" ></path></symbol><symbol id="l7-icon-line" viewBox="0 0 1024 1024"><path d="M853.333333 56.888889a113.777778 113.777778 0 0 1 8.533334 227.271111L853.333333 284.444444c-19.000889 0-36.864-4.664889-52.622222-12.856888l-529.123555 529.066666a113.777778 113.777778 0 0 1-92.387556 166.115556L170.666667 967.111111a113.777778 113.777778 0 0 1-8.533334-227.271111L170.666667 739.555556c19.000889 0 36.864 4.664889 52.622222 12.856888l529.123555-529.066666a113.777778 113.777778 0 0 1 92.387556-166.115556L853.333333 56.888889zM170.666667 807.822222a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m682.666666-682.666666a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-layer" viewBox="0 0 1024 1024"><path d="M767.089778 625.777778l180.167111 82.773333a34.133333 34.133333 0 0 1 4.892444 59.278222l-4.892444 2.730667-420.977778 193.422222a34.133333 34.133333 0 0 1-22.983111 1.991111l-5.575111-1.991111-420.977778-193.422222a34.133333 34.133333 0 0 1-4.892444-59.278222l4.892444-2.730667L256.853333 625.777778l81.749334 37.546666L172.771556 739.555556 512 895.374222 851.171556 739.555556l-165.831112-76.231112 81.749334-37.546666z m0-227.555556l180.167111 82.773334a34.133333 34.133333 0 0 1 4.892444 59.278222l-4.892444 2.730666-420.977778 193.422223a34.133333 34.133333 0 0 1-22.983111 1.991111l-5.575111-1.991111-420.977778-193.422223a34.133333 34.133333 0 0 1-4.892444-59.278222l4.892444-2.730666L256.853333 398.222222l81.749334 37.546667-165.831111 76.174222L512 667.818667l339.171556-155.875556-165.831112-76.174222L767.089778 398.222222zM497.720889 60.017778a34.133333 34.133333 0 0 1 28.558222 0l420.977778 193.422222a34.133333 34.133333 0 0 1 0 62.008889l-420.977778 193.422222a34.133333 34.133333 0 0 1-28.558222 0l-420.977778-193.422222a34.133333 34.133333 0 0 1 0-62.008889zM512 128.568889L172.771556 284.387556 512 440.263111l339.171556-155.875555L512 128.568889z" ></path></symbol><symbol id="l7-icon-narrow" viewBox="0 0 1024 1024"><path d="M910.222222 512a34.133333 34.133333 0 0 1-34.133333 34.133333H147.911111a34.133333 34.133333 0 1 1 0-68.266666h728.177778a34.133333 34.133333 0 0 1 34.133333 34.133333z" ></path></symbol><symbol id="l7-icon-fullscreen" viewBox="0 0 1024 1024"><path d="M645.176889 597.674667l4.721778 3.982222L841.955556 793.6l0.056888-133.688889a34.133333 34.133333 0 0 1 28.615112-33.678222L876.088889 625.777778a34.133333 34.133333 0 0 1 33.678222 28.615111L910.222222 659.911111v216.177778a34.133333 34.133333 0 0 1-28.615111 33.678222L876.088889 910.222222h-216.177778a34.133333 34.133333 0 0 1-5.518222-67.811555l5.518222-0.455111h133.745778l-192-192.056889a34.133333 34.133333 0 0 1 43.52-52.224z m-222.833778 3.982222a34.133333 34.133333 0 0 1 3.982222 43.52l-3.982222 4.721778L230.286222 841.955556H364.088889a34.133333 34.133333 0 0 1 33.678222 28.615111L398.222222 876.088889a34.133333 34.133333 0 0 1-28.615111 33.678222L364.088889 910.222222H147.911111a34.133333 34.133333 0 0 1-33.678222-28.615111L113.777778 876.088889v-216.177778a34.133333 34.133333 0 0 1 67.811555-5.518222l0.455111 5.518222-0.056888 133.745778 192.113777-192a34.133333 34.133333 0 0 1 48.241778 0zM364.088889 113.777778a34.133333 34.133333 0 0 1 5.518222 67.811555L364.088889 182.044444H230.343111l192 192.056889a34.133333 34.133333 0 0 1-43.52 52.224l-4.721778-3.982222-192.113777-192.056889L182.044444 364.088889a34.133333 34.133333 0 0 1-28.615111 33.678222L147.911111 398.222222a34.133333 34.133333 0 0 1-33.678222-28.615111L113.777778 364.088889V147.911111a34.133333 34.133333 0 0 1 28.615111-33.678222L147.911111 113.777778h216.177778z m512 0a34.133333 34.133333 0 0 1 33.678222 28.615111L910.222222 147.911111v216.177778a34.133333 34.133333 0 0 1-67.811555 5.518222L841.955556 364.088889l-0.056889-133.745778-192 192a34.133333 34.133333 0 0 1-52.224-43.52l3.982222-4.721778L793.6 182.044444H659.911111a34.133333 34.133333 0 0 1-33.678222-28.615111L625.777778 147.911111a34.133333 34.133333 0 0 1 28.615111-33.678222L659.911111 113.777778h216.177778z" ></path></symbol><symbol id="l7-icon-hide" viewBox="0 0 1024 1024"><path d="M875.52 87.836444a34.133333 34.133333 0 0 1 7.281778 43.121778l-3.527111 5.006222-682.666667 796.444445a34.133333 34.133333 0 0 1-55.409778-39.367111l3.527111-5.006222 97.166223-113.379556C123.164444 697.969778 56.888889 582.940444 56.888889 512c0-113.777778 170.666667-341.333333 455.111111-341.333333a496.64 496.64 0 0 1 208.952889 45.112889l106.439111-124.188445a34.133333 34.133333 0 0 1 48.128-3.754667z m-38.684444 202.524445C921.031111 362.951111 967.111111 452.835556 967.111111 512c0 113.777778-170.666667 341.333333-455.111111 341.333333-50.631111 0-97.678222-7.224889-140.8-19.740444l50.232889-58.595556A417.393778 417.393778 0 0 0 512 785.066667c208.270222 0 386.844444-162.304 386.844444-273.066667 0-52.849778-40.675556-117.418667-105.813333-170.496l43.804445-51.2zM512 238.933333C303.729778 238.933333 125.155556 401.237333 125.155556 512c0 66.787556 64.853333 152.291556 162.133333 209.692444L377.173333 616.675556a170.666667 170.666667 0 0 1 217.713778-253.895112l78.620445-91.704888A432.924444 432.924444 0 0 0 512 238.933333z m166.684444 236.088889a170.666667 170.666667 0 0 1-177.664 207.303111l177.607112-207.303111zM512 409.6a102.4 102.4 0 0 0-88.746667 153.486222L548.864 416.426667A102.172444 102.172444 0 0 0 512 409.6z" ></path></symbol><symbol id="l7-icon-rectangle" viewBox="0 0 1024 1024"><path d="M170.666667 56.888889a113.777778 113.777778 0 0 1 108.544 79.644444H853.333333a34.133333 34.133333 0 0 1 33.678223 28.615111L887.466667 170.666667v574.122666a113.777778 113.777778 0 1 1-142.677334 142.734223L170.666667 887.466667a34.133333 34.133333 0 0 1-33.678223-28.615111L136.533333 853.333333V279.210667A113.777778 113.777778 0 0 1 170.666667 56.888889z m682.666666 750.933333a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z m-34.133333-603.022222H279.210667a114.062222 114.062222 0 0 1-74.353778 74.410667L204.8 819.2h539.989333a114.062222 114.062222 0 0 1 74.410667-74.410667V204.8zM170.666667 125.155556a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-ranging" viewBox="0 0 1024 1024"><path d="M723.171556 50.403556l250.424888 250.424888a31.061333 31.061333 0 0 1 0 43.918223L344.746667 973.596444a31.061333 31.061333 0 0 1-43.918223 0L50.403556 723.171556a31.061333 31.061333 0 0 1 0-43.918223L679.253333 50.403556a31.061333 31.061333 0 0 1 43.918223 0z m-21.959112 74.524444l-39.765333 39.822222 98.986667 98.872889a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-63.886222 63.886222 62.179556 62.122667a34.133333 34.133333 0 0 1-44.088889 51.882667L563.2 387.242667 501.077333 325.063111 437.191111 388.949333l98.986667 98.929778a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-63.886222 63.886222L387.242667 563.2a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.584-62.122667-62.179556-63.886222 63.886222 98.986667 98.929778a34.133333 34.133333 0 0 1-44.088889 51.882667l-4.209778-3.640889-98.929778-98.929778-39.765333 39.822222 197.802667 197.745778 576.284444-576.284444-197.802667-197.745778z" ></path></symbol><symbol id="l7-icon-reposition" viewBox="0 0 1024 1024"><path d="M512 56.888889a34.133333 34.133333 0 0 1 34.133333 34.133333v24.177778A398.336 398.336 0 0 1 908.856889 477.866667h24.177778a34.133333 34.133333 0 0 1 0 68.266666h-24.177778A398.336 398.336 0 0 1 546.133333 908.856889L546.133333 932.977778a34.133333 34.133333 0 0 1-68.266666 0v-24.177778A398.336 398.336 0 0 1 115.2 546.133333L91.022222 546.133333a34.133333 34.133333 0 1 1 0-68.266666h24.177778A398.336 398.336 0 0 1 477.866667 115.2V91.022222A34.133333 34.133333 0 0 1 512 56.888889z m34.190222 126.862222L546.133333 193.422222a34.133333 34.133333 0 1 1-68.266666 0v-9.671111A330.069333 330.069333 0 0 0 183.751111 477.866667h9.671111a34.133333 34.133333 0 1 1 0 68.266666l-9.671111 0.056889A330.069333 330.069333 0 0 0 477.866667 840.248889V830.577778a34.133333 34.133333 0 0 1 68.266666 0l0.056889 9.671111A330.069333 330.069333 0 0 0 840.248889 546.133333L830.577778 546.133333a34.133333 34.133333 0 0 1 0-68.266666h9.671111A330.069333 330.069333 0 0 0 546.133333 183.751111zM512 341.333333a170.666667 170.666667 0 1 1 0 341.333334 170.666667 170.666667 0 0 1 0-341.333334z m0 68.266667a102.4 102.4 0 1 0 0 204.8 102.4 102.4 0 0 0 0-204.8z" ></path></symbol><symbol id="l7-icon-round" viewBox="0 0 1024 1024"><path d="M512 56.888889a455.111111 455.111111 0 0 1 391.395556 687.502222 113.777778 113.777778 0 0 1-159.061334 158.890667A455.111111 455.111111 0 0 1 120.604444 279.608889 113.777778 113.777778 0 0 1 279.608889 120.604444 452.835556 452.835556 0 0 1 512 56.888889z m0 68.266667a384.910222 384.910222 0 0 0-191.715556 50.744888A113.777778 113.777778 0 0 1 175.957333 320.284444a386.844444 386.844444 0 0 0 527.815111 527.758223 113.777778 113.777778 0 0 1 144.270223-144.440889A386.844444 386.844444 0 0 0 512 125.155556z m299.406222 640.739555a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222zM212.593778 167.082667a45.511111 45.511111 0 1 0 0 91.022222 45.511111 45.511111 0 0 0 0-91.022222z" ></path></symbol><symbol id="l7-icon-guanbi" viewBox="0 0 1024 1024"><path d="M576 512l277.333333 277.333333-64 64-277.333333-277.333333L234.666667 853.333333 170.666667 789.333333l277.333333-277.333333L170.666667 234.666667 234.666667 170.666667l277.333333 277.333333L789.333333 170.666667 853.333333 234.666667 576 512z" ></path></symbol></svg>',function(rr){try{let ae=function(){U||(U=!0,_())},et=function(){try{le.documentElement.doScroll("left")}catch(dt){return void setTimeout(et,50)}ae()};var se=ae,Qe=et,L=(L=document.getElementsByTagName("script"))[L.length-1],ee=L.getAttribute("data-injectcss"),L=L.getAttribute("data-disable-injectsvg");if(!L){var q,he,_,le,U,fe=function(Ye,wt){wt.parentNode.insertBefore(Ye,wt)};if(ee&&!rr.__iconfont__svg__cssinject__){rr.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(dt){console&&console.log(dt)}}q=function(){var Ye,wt=document.createElement("div");wt.innerHTML=rr._iconfont_svg_string_3580659,(wt=wt.getElementsByTagName("svg")[0])&&(wt.setAttribute("aria-hidden","true"),wt.style.position="absolute",wt.style.width=0,wt.style.height=0,wt.style.overflow="hidden",wt=wt,(Ye=document.body).firstChild?fe(wt,Ye.firstChild):Ye.appendChild(wt))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(q,0):(he=function(){document.removeEventListener("DOMContentLoaded",he,!1),q()},document.addEventListener("DOMContentLoaded",he,!1)):document.attachEvent&&(_=q,le=rr.document,U=!1,et(),le.onreadystatechange=function(){le.readyState=="complete"&&(le.onreadystatechange=null,ae())})}}catch(ae){}}(window)},60740:function(rr,ee,L){"use strict";L.d(ee,{zP:function(){return _B},JE:function(){return mk},ns:function(){return gB}});var q=L(79685),he=(0,q.createContext)({});function _(){return(0,q.useContext)(he)}var le={},U={},fe=function(r){return U[r]},se=function(r,t){U[r]=t},Qe=function(r){return le[r]},ae=function(r,t){le[r]=t},et={},dt={},Ye=34,wt=10,Xt=13;function Zt(e){return new Function("d","return {"+e.map(function(r,t){return JSON.stringify(r)+": d["+t+'] || ""'}).join(",")+"}")}function nr(e,r){var t=Zt(e);return function(n,i){return r(t(n),i,e)}}function Vt(e){var r=Object.create(null),t=[];return e.forEach(function(n){for(var i in n)i in r||t.push(r[i]=i)}),t}function xt(e,r){var t=e+"",n=t.length;return n<r?new Array(r-n+1).join(0)+t:t}function bt(e){return e<0?"-"+xt(-e,6):e>9999?"+"+xt(e,6):xt(e,4)}function Tr(e){var r=e.getUTCHours(),t=e.getUTCMinutes(),n=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":bt(e.getUTCFullYear(),4)+"-"+xt(e.getUTCMonth()+1,2)+"-"+xt(e.getUTCDate(),2)+(i?"T"+xt(r,2)+":"+xt(t,2)+":"+xt(n,2)+"."+xt(i,3)+"Z":n?"T"+xt(r,2)+":"+xt(t,2)+":"+xt(n,2)+"Z":t||r?"T"+xt(r,2)+":"+xt(t,2)+"Z":"")}function hr(e){var r=new RegExp('["'+e+`
|
|
\r]`),t=e.charCodeAt(0);function n(b,T){var M,O,F=i(b,function($,G){if(M)return M($,G-1);O=$,M=T?nr($,T):Zt($)});return F.columns=O||[],F}function i(b,T){var M=[],O=b.length,F=0,$=0,G,ue=O<=0,xe=!1;b.charCodeAt(O-1)===wt&&--O,b.charCodeAt(O-1)===Xt&&--O;function ze(){if(ue)return dt;if(xe)return xe=!1,et;var ht,gt=F,Ot;if(b.charCodeAt(gt)===Ye){for(;F++<O&&b.charCodeAt(F)!==Ye||b.charCodeAt(++F)===Ye;);return(ht=F)>=O?ue=!0:(Ot=b.charCodeAt(F++))===wt?xe=!0:Ot===Xt&&(xe=!0,b.charCodeAt(F)===wt&&++F),b.slice(gt+1,ht-1).replace(/""/g,'"')}for(;F<O;){if((Ot=b.charCodeAt(ht=F++))===wt)xe=!0;else if(Ot===Xt)xe=!0,b.charCodeAt(F)===wt&&++F;else if(Ot!==t)continue;return b.slice(gt,ht)}return ue=!0,b.slice(gt,O)}for(;(G=ze())!==dt;){for(var Je=[];G!==et&&G!==dt;)Je.push(G),G=ze();T&&(Je=T(Je,$++))==null||M.push(Je)}return M}function o(b,T){return b.map(function(M){return T.map(function(O){return y(M[O])}).join(e)})}function s(b,T){return T==null&&(T=Vt(b)),[T.map(y).join(e)].concat(o(b,T)).join(`
|
|
`)}function l(b,T){return T==null&&(T=Vt(b)),o(b,T).join(`
|
|
`)}function f(b){return b.map(v).join(`
|
|
`)}function v(b){return b.map(y).join(e)}function y(b){return b==null?"":b instanceof Date?Tr(b):r.test(b+="")?'"'+b.replace(/"/g,'""')+'"':b}return{parse:n,parseRows:i,format:s,formatBody:l,formatRows:f,formatRow:v,formatValue:y}}var lr=hr(","),At=lr.parse,ut=lr.parseRows,It=lr.format,qe=lr.formatBody,Ct=lr.formatRows,fr=lr.formatRow,re=lr.formatValue,V=L(93264),K=63710088e-1,Me={centimeters:K*100,centimetres:K*100,degrees:K/111325,feet:K*3.28084,inches:K*39.37,kilometers:K/1e3,kilometres:K/1e3,meters:K,metres:K,miles:K/1609.344,millimeters:K*1e3,millimetres:K*1e3,nauticalmiles:K/1852,radians:1,yards:K*1.0936},Se={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/K,yards:1.0936133},nt={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function te(e,r,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=r||{},n.geometry=e,n}function Ce(e,r,t){switch(t===void 0&&(t={}),e){case"Point":return we(r).geometry;case"LineString":return on(r).geometry;case"Polygon":return Lt(r).geometry;case"MultiPoint":return bn(r).geometry;case"MultiLineString":return Un(r).geometry;case"MultiPolygon":return Kr(r).geometry;default:throw new Error(e+" is invalid")}}function we(e,r,t){if(t===void 0&&(t={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ie(e[0])||!ie(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return te(n,r,t)}function Xe(e,r,t){return t===void 0&&(t={}),Hr(e.map(function(n){return we(n,r)}),t)}function Lt(e,r,t){t===void 0&&(t={});for(var n=0,i=e;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:e};return te(l,r,t)}function Ht(e,r,t){return t===void 0&&(t={}),Hr(e.map(function(n){return Lt(n,r)}),t)}function on(e,r,t){if(t===void 0&&(t={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:e};return te(n,r,t)}function Jr(e,r,t){return t===void 0&&(t={}),Hr(e.map(function(n){return on(n,r)}),t)}function Hr(e,r){r===void 0&&(r={});var t={type:"FeatureCollection"};return r.id&&(t.id=r.id),r.bbox&&(t.bbox=r.bbox),t.features=e,t}function Un(e,r,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:e};return te(n,r,t)}function bn(e,r,t){t===void 0&&(t={});var n={type:"MultiPoint",coordinates:e};return te(n,r,t)}function Kr(e,r,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:e};return te(n,r,t)}function Mi(e,r,t){t===void 0&&(t={});var n={type:"GeometryCollection",geometries:e};return te(n,r,t)}function Si(e,r){if(r===void 0&&(r=0),r&&!(r>=0))throw new Error("precision must be a positive number");var t=Math.pow(10,r||0);return Math.round(e*t)/t}function Ri(e,r){r===void 0&&(r="kilometers");var t=Me[r];if(!t)throw new Error(r+" units is invalid");return e*t}function Gn(e,r){r===void 0&&(r="kilometers");var t=Me[r];if(!t)throw new Error(r+" units is invalid");return e/t}function Dn(e,r){return Yi(Gn(e,r))}function Ya(e){var r=e%360;return r<0&&(r+=360),r}function Yi(e){var r=e%(2*Math.PI);return r*180/Math.PI}function Na(e){var r=e%360;return r*Math.PI/180}function Dt(e,r,t){if(r===void 0&&(r="kilometers"),t===void 0&&(t="kilometers"),!(e>=0))throw new Error("length must be a positive number");return Ri(Gn(e,r),t)}function k(e,r,t){if(r===void 0&&(r="meters"),t===void 0&&(t="kilometers"),!(e>=0))throw new Error("area must be a positive number");var n=nt[r];if(!n)throw new Error("invalid original units");var i=nt[t];if(!i)throw new Error("invalid final units");return e/n*i}function ie(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function ve(e){return!!e&&e.constructor===Object}function Ze(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(r){if(!ie(r))throw new Error("bbox must only contain numbers")})}function _t(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}function Wt(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return e.geometry.coordinates;if(e.type==="Point")return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Sr(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function He(e){if(e.length>1&&isNumber(e[0])&&isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return He(e[0]);throw new Error("coordinates must only contain numbers")}function Et(e,r,t){if(!r||!t)throw new Error("type and name required");if(!e||e.type!==r)throw new Error("Invalid input to "+t+": must be a "+r+", given "+e.type)}function cr(e,r,t){if(!e)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!e||e.type!=="Feature"||!e.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!e.geometry||e.geometry.type!==r)throw new Error("Invalid input to "+t+": must be a "+r+", given "+e.geometry.type)}function mr(e,r,t){if(!e)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!e||e.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(var n=0,i=e.features;n<i.length;n++){var o=i[n];if(!o||o.type!=="Feature"||!o.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!o.geometry||o.geometry.type!==r)throw new Error("Invalid input to "+t+": must be a "+r+", given "+o.geometry.type)}}function Zr(e){return e.type==="Feature"?e.geometry:e}function Fn(e,r){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}function En(e,r,t){if(e!==null)for(var n,i,o,s,l,f,v,y=0,b=0,T,M=e.type,O=M==="FeatureCollection",F=M==="Feature",$=O?e.features.length:1,G=0;G<$;G++){v=O?e.features[G].geometry:F?e.geometry:e,T=v?v.type==="GeometryCollection":!1,l=T?v.geometries.length:1;for(var ue=0;ue<l;ue++){var xe=0,ze=0;if(s=T?v.geometries[ue]:v,s!==null){f=s.coordinates;var Je=s.type;switch(y=t&&(Je==="Polygon"||Je==="MultiPolygon")?1:0,Je){case null:break;case"Point":if(r(f,b,G,xe,ze)===!1)return!1;b++,xe++;break;case"LineString":case"MultiPoint":for(n=0;n<f.length;n++){if(r(f[n],b,G,xe,ze)===!1)return!1;b++,Je==="MultiPoint"&&xe++}Je==="LineString"&&xe++;break;case"Polygon":case"MultiLineString":for(n=0;n<f.length;n++){for(i=0;i<f[n].length-y;i++){if(r(f[n][i],b,G,xe,ze)===!1)return!1;b++}Je==="MultiLineString"&&xe++,Je==="Polygon"&&ze++}Je==="Polygon"&&xe++;break;case"MultiPolygon":for(n=0;n<f.length;n++){for(ze=0,i=0;i<f[n].length;i++){for(o=0;o<f[n][i].length-y;o++){if(r(f[n][i][o],b,G,xe,ze)===!1)return!1;b++}ze++}xe++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(En(s.geometries[n],r,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Cn(e,r,t,n){var i=t;return En(e,function(o,s,l,f,v){s===0&&t===void 0?i=o:i=r(i,o,s,l,f,v)},n),i}function fn(e,r){var t;switch(e.type){case"FeatureCollection":for(t=0;t<e.features.length&&r(e.features[t].properties,t)!==!1;t++);break;case"Feature":r(e.properties,0);break}}function ni(e,r,t){var n=t;return fn(e,function(i,o){o===0&&t===void 0?n=i:n=r(n,i,o)}),n}function Yn(e,r){if(e.type==="Feature")r(e,0);else if(e.type==="FeatureCollection")for(var t=0;t<e.features.length&&r(e.features[t],t)!==!1;t++);}function oa(e,r,t){var n=t;return Yn(e,function(i,o){o===0&&t===void 0?n=i:n=r(n,i,o)}),n}function Qi(e){var r=[];return En(e,function(t){r.push(t)}),r}function lo(e,r){var t,n,i,o,s,l,f,v,y,b,T=0,M=e.type==="FeatureCollection",O=e.type==="Feature",F=M?e.features.length:1;for(t=0;t<F;t++){for(l=M?e.features[t].geometry:O?e.geometry:e,v=M?e.features[t].properties:O?e.properties:{},y=M?e.features[t].bbox:O?e.bbox:void 0,b=M?e.features[t].id:O?e.id:void 0,f=l?l.type==="GeometryCollection":!1,s=f?l.geometries.length:1,i=0;i<s;i++){if(o=f?l.geometries[i]:l,o===null){if(r(null,T,v,y,b)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(r(o,T,v,y,b)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(r(o.geometries[n],T,v,y,b)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}T++}}function Is(e,r,t){var n=t;return lo(e,function(i,o,s,l,f){o===0&&t===void 0?n=i:n=r(n,i,o,s,l,f)}),n}function hi(e,r){lo(e,function(t,n,i,o,s){var l=t===null?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return r(te(t,i,{bbox:o,id:s}),n,0)===!1?!1:void 0}var f;switch(l){case"MultiPoint":f="Point";break;case"MultiLineString":f="LineString";break;case"MultiPolygon":f="Polygon";break}for(var v=0;v<t.coordinates.length;v++){var y=t.coordinates[v],b={type:f,coordinates:y};if(r(te(b,i),n,v)===!1)return!1}})}function W(e,r,t){var n=t;return hi(e,function(i,o,s){o===0&&s===0&&t===void 0?n=i:n=r(n,i,o,s)}),n}function J(e,r){hi(e,function(t,n,i){var o=0;if(t.geometry){var s=t.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var l,f=0,v=0,y=0;if(En(t,function(b,T,M,O,F){if(l===void 0||n>f||O>v||F>y){l=b,f=n,v=O,y=F,o=0;return}var $=lineString([l,b],t.properties);if(r($,n,i,F,o)===!1)return!1;o++,l=b})===!1)return!1}}})}function oe(e,r,t){var n=t,i=!1;return J(e,function(o,s,l,f,v){i===!1&&t===void 0?n=o:n=r(n,o,s,l,f,v),i=!0}),n}function be(e,r){if(!e)throw new Error("geojson is required");hi(e,function(t,n,i){if(t.geometry!==null){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(r(t,n,i,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<s.length;l++)if(r(lineString(s[l],t.properties),n,i,l)===!1)return!1;break}}})}function Oe(e,r,t){var n=t;return be(e,function(i,o,s,l){o===0&&t===void 0?n=i:n=r(n,i,o,s,l)}),n}function it(e,r){if(r=r||{},!isObject(r))throw new Error("options is invalid");var t=r.featureIndex||0,n=r.multiFeatureIndex||0,i=r.geometryIndex||0,o=r.segmentIndex||0,s=r.properties,l;switch(e.type){case"FeatureCollection":t<0&&(t=e.features.length+t),s=s||e.features[t].properties,l=e.features[t].geometry;break;case"Feature":s=s||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var f=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=f.length+o-1),lineString([f[o],f[o+1]],s,r);case"Polygon":return i<0&&(i=f.length+i),o<0&&(o=f[i].length+o-1),lineString([f[i][o],f[i][o+1]],s,r);case"MultiLineString":return n<0&&(n=f.length+n),o<0&&(o=f[n].length+o-1),lineString([f[n][o],f[n][o+1]],s,r);case"MultiPolygon":return n<0&&(n=f.length+n),i<0&&(i=f[n].length+i),o<0&&(o=f[n][i].length-o-1),lineString([f[n][i][o],f[n][i][o+1]],s,r)}throw new Error("geojson is invalid")}function pt(e,r){if(r=r||{},!isObject(r))throw new Error("options is invalid");var t=r.featureIndex||0,n=r.multiFeatureIndex||0,i=r.geometryIndex||0,o=r.coordIndex||0,s=r.properties,l;switch(e.type){case"FeatureCollection":t<0&&(t=e.features.length+t),s=s||e.features[t].properties,l=e.features[t].geometry;break;case"Feature":s=s||e.properties,l=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=e;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var f=l.coordinates;switch(l.type){case"Point":return point(f,s,r);case"MultiPoint":return n<0&&(n=f.length+n),point(f[n],s,r);case"LineString":return o<0&&(o=f.length+o),point(f[o],s,r);case"Polygon":return i<0&&(i=f.length+i),o<0&&(o=f[i].length+o),point(f[i][o],s,r);case"MultiLineString":return n<0&&(n=f.length+n),o<0&&(o=f[n].length+o),point(f[n][o],s,r);case"MultiPolygon":return n<0&&(n=f.length+n),i<0&&(i=f[n].length+i),o<0&&(o=f[n][i].length-o),point(f[n][i][o],s,r)}throw new Error("geojson is invalid")}var j=L(51392),Q=L(30114),Le=L(61926),at=L(79640),Ee=L(87136),ir=L(98403);function wr(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch(r){return typeof e=="function"}}var An=L(49435);function sn(e,r,t){return(0,An.Z)()?sn=Reflect.construct.bind():sn=function(i,o,s){var l=[null];l.push.apply(l,o);var f=Function.bind.apply(i,l),v=new f;return s&&(0,ir.Z)(v,s.prototype),v},sn.apply(null,arguments)}function sr(e){var r=typeof Map=="function"?new Map:void 0;return sr=function(n){if(n===null||!wr(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return sn(n,arguments,(0,Ee.Z)(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),(0,ir.Z)(i,n)},sr(e)}var en={REGISTERED_PROTOCOLS:{}};function Wr(e){var r=Yr();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function Yr(){if(typeof Reflect=="undefined"||!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(e){return!1}}var pi=function(r){return en.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]},tn=function(e){(0,Le.Z)(t,e);var r=Wr(t);function t(n,i,o,s){var l;return(0,Q.Z)(this,t),l=r.call(this,"AJAXError: ".concat(i," (").concat(n,"): ").concat(o)),l.status=n,l.statusText=i,l.url=o,l.body=s,l}return(0,j.Z)(t)}(sr(Error));function vi(e,r){var t=new XMLHttpRequest,n=Array.isArray(e.url)?e.url[0]:e.url;t.open(e.method||"GET",n,!0),e.type==="arrayBuffer"&&(t.responseType="arraybuffer");for(var i in e.headers)e.headers.hasOwnProperty(i)&&t.setRequestHeader(i,e.headers[i]);return e.type==="json"&&(t.responseType="text",t.setRequestHeader("Accept","application/json")),t.withCredentials=e.credentials==="include",t.onerror=function(){r(new Error(t.statusText))},t.onload=function(){if((t.status>=200&&t.status<300||t.status===0)&&t.response!==null){var o=t.response;if(e.type==="json")try{o=JSON.parse(t.response)}catch(l){return r(l)}r(null,o,t.getResponseHeader("Cache-Control"),t.getResponseHeader("Expires"),t)}else{var s=new Blob([t.response],{type:t.getResponseHeader("Content-Type")});r(new tn(t.status,t.statusText,n.toString(),s))}},t.cancel=t.abort,t.send(e.body),t}function qi(e){return new Promise(function(r,t){vi(e,function(n,i,o,s,l){n?t({err:n,data:null,xhr:l}):r({err:null,data:i,cacheControl:o,expires:s,xhr:l})})})}function ci(e,r){return vi(e,r)}var zi=function(r,t){var n=pi(r.url)||ci;return n((0,V.Z)((0,V.Z)({},r),{},{type:"json"}),t)},Ai=function(r,t){var n=pi(r.url)||ci;return n((0,V.Z)((0,V.Z)({},r),{},{type:"arrayBuffer"}),t)},Xo=function(r,t){return ci(_objectSpread(_objectSpread({},r),{},{method:"POST"}),t)},Ji=function(r,t){return ci((0,V.Z)((0,V.Z)({},r),{},{method:"GET"}),t)};function Ia(e){var r=window.document.createElement("a");return r.href=e,r.protocol===window.document.location.protocol&&r.host===window.document.location.host}var Ti="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function mi(e,r){var t=new window.Image,n=window.URL||window.webkitURL;t.crossOrigin="anonymous",t.onload=function(){r(null,t),n.revokeObjectURL(t.src),t.onload=null,window.requestAnimationFrame(function(){t.src=Ti})},t.onerror=function(){return r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var i=new Blob([new Uint8Array(e)],{type:"image/png"});t.src=e.byteLength?n.createObjectURL(i):Ti}function wi(e,r){var t=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(t).then(function(n){r(null,n)}).catch(function(n){r(new Error("Could not load image because of ".concat(n.message,". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")))})}var Pa=function(r,t,n){var i=function(s,l){if(s)t(s);else if(l){var f=typeof createImageBitmap=="function",v=n?n(l):l;f?wi(v,t):mi(v,t)}};return r.type==="json"?zi(r,i):Ai(r,i)},cu=function(r,t){var n=typeof createImageBitmap=="function";n?wi(r,t):mi(r,t)},ma=function(e){return e.CENTER="center",e.TOP="top",e["TOP-LEFT"]="top-left",e["TOP-RIGHT"]="top-right",e.BOTTOM="bottom",e["BOTTOM-LEFT"]="bottom-left",e["BOTTOM-RIGHT"]="bottom-right",e.LEFT="left",e.RIGHT="right",e}({}),Aa={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function $l(e,r,t){var n=e.classList;for(var i in Aa)Aa.hasOwnProperty(i)&&n.remove("l7-".concat(t,"-anchor-").concat(i));n.add("l7-".concat(t,"-anchor-").concat(r))}var os=L(19007);function Ta(e){return typeof e=="string"?!!d3.color(e):!1}function fi(e){var r=os.ZP(e),t=[0,0,0,0];return r!=null&&(t[0]=r.r/255,t[1]=r.g/255,t[2]=r.b/255,t[3]=r.opacity),t}function Oa(e){var r=e&&e[0],t=e&&e[1],n=e&&e[2],i=r+t*256+n*65536-1;return i}function sa(e){return[e+1&255,e+1>>8&255,e+1>>8>>8&255]}function Ao(e){var r=window.document.createElement("canvas"),t=r.getContext("2d");r.width=256,r.height=1;for(var n=null,i=t.createLinearGradient(0,0,256,1),o=e.positions[0],s=e.positions[e.positions.length-1],l=0;l<e.colors.length;++l){var f=(e.positions[l]-o)/(s-o);i.addColorStop(f,e.colors[l])}return t.fillStyle=i,t.fillRect(0,0,256,1),n=new Uint8ClampedArray(t.getImageData(0,0,256,1).data),r=null,t=null,{data:n,width:256,height:1}}function ha(e,r){var t=window.document.createElement("canvas"),n=t.getContext("2d");t.width=256,t.height=1;for(var i=n.createLinearGradient(0,0,256,1),o=r[1]-r[0],s=0;s<e.colors.length;++s){var l=Math.max((e.positions[s]-r[0])/o,0);i.addColorStop(l,e.colors[s])}n.fillStyle=i,n.fillRect(0,0,256,1);var f=n.getImageData(0,0,256,1).data,v=ss(n,f);return t=null,n=null,v}function $o(e){var r=window.document.createElement("canvas"),t=r.getContext("2d");r.width=256,r.height=1;var n=t.createImageData(256,1);return n.data.fill(0),e.positions.forEach(function(i,o){var s=fi(e.colors[o]);n.data[i*4+0]=s[0]*255,n.data[i*4+1]=s[1]*255,n.data[i*4+2]=s[2]*255,n.data[i*4+3]=s[3]*255}),r=null,t=null,n}function Vo(e){var r=window.document.createElement("canvas"),t=r.getContext("2d");t.globalAlpha=1,r.width=256,r.height=1;for(var n=256/e.colors.length,i=0;i<e.colors.length;i++)t.beginPath(),t.lineWidth=2,t.strokeStyle=e.colors[i],t.moveTo(i*n,0),t.lineTo((i+1)*n,0),t.stroke();var o=t.getImageData(0,0,256,1).data,s=ss(t,o);return r=null,t=null,s}function Ru(e,r){var t=window.document.createElement("canvas"),n=t.getContext("2d");n.globalAlpha=1,t.width=256,t.height=1;var i=r[1]-r[0];e.positions.length-e.colors.length!==1&&console.warn("positions \u7684\u6570\u5B57\u4E2A\u6570\u5E94\u5F53\u6BD4 colors \u7684\u6837\u5F0F\u591A\u4E00\u4E2A,poisitions \u7684\u9996\u5C3E\u503C\u4E00\u822C\u4E3A\u6570\u636E\u7684\u6700\u5927\u6700\u65B0\u503C");for(var o=0;o<e.colors.length;o++)n.beginPath(),n.lineWidth=2,n.strokeStyle=e.colors[o],n.moveTo((e.positions[o]-r[0])/i*255,0),n.lineTo((e.positions[o+1]-r[0])/i*255,0),n.stroke();var s=n.getImageData(0,0,256,1).data,l=ss(n,s);return t=null,n=null,l}function ss(e,r){for(var t=e.createImageData(256,1),n=0;n<t.data.length;n+=4)t.data[n+0]=r[n+0],t.data[n+1]=r[n+1],t.data[n+2]=r[n+2],t.data[n+3]=r[n+3];return t}function Cc(e){switch(e.type){case"cat":return[0,255];default:return[0,1]}}var Ea={BACK:1029,FRONT:1028};function ea(e){switch(e){case"GAODE1.x":return Ea.BACK;case"GAODE2.x":return Ea.BACK;case"MAPBOX":return Ea.FRONT;case"SIMPLE":return Ea.FRONT;case"GLOBEL":return Ea.BACK;case"DEBAULT":return Ea.FRONT;default:return Ea.FRONT}}var Kt=L(57963),Sn=L(89342),de=L(3659),Re=L.n(de),ct=L(70934),or=L.n(ct),jr=L(63390),In=L.n(jr),Hi=L(55796),vo=L.n(Hi),To=L(46400),co=L.n(To),Ps=L(10347),ys=L.n(Ps),Kh=L(94394),Cf=L.n(Kh),jo=L(65604),xl=L.n(jo),bl=L(44162),Mu=L.n(bl),Iu=L(71828),Qu=L.n(Iu),Qc=L(87993),Os=L.n(Qc),qa=L(73875),El=L.n(qa),Ju=L(62016),Rf=L.n(Ju),Qh=L(3689),Mf=L.n(Qh),ph=L(72806),dh=L.n(ph),vh=L(66058),Jh=L.n(vh),ep=L(87575),Zp=L.n(ep),Jc=L(14354),Pu=L.n(Jc),tp=L(85261),Ho=L.n(tp),Yl=L(42493),Sl=L.n(Yl),$s=L(1433),Al=L.n($s),oi={isNil:Cf(),merge:El(),throttle:dh(),isString:Qu(),debounce:In(),pull:Mf(),isTypedArray:Os(),isPlainObject:Mu(),isNumber:xl(),isBoolean:co(),isEqual:ys(),cloneDeep:or(),uniq:Jh(),clamp:Re(),upperFirst:Zp(),get:vo(),mergeWith:Rf(),isFunction:Pu(),isObject:Ho(),isUndefined:Sl(),camelCase:Al()},el=oi.pull;function Ds(e){var r=e;return typeof e=="string"&&(r=window.document.getElementById(e)),r}function Ou(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function tl(e){return Ou(e).split(/\s+/)}function rp(e){var r,t=(r=document)===null||r===void 0||(r=r.documentElement)===null||r===void 0?void 0:r.style;if(!t)return e[0];for(var n in e)if(e[n]&&e[n]in t)return e[n];return e[0]}function ta(e,r,t){var n=window.document.createElement(e);return r&&(n.className=r||""),t&&t.appendChild(n),n}function Ii(e){var r=e.parentNode;r&&r.removeChild(e)}function fu(e,r){if(e.classList!==void 0)for(var t=tl(r),n=0,i=t.length;n<i;n++)e.classList.add(t[n]);else if(!mh(e,r)){var o=ef(e);Ha(e,(o?o+" ":"")+r)}}function Du(e,r){if(e.classList!==void 0){var t=tl(r);t.forEach(function(n){e.classList.remove(n)})}else Ha(e,Ou((" "+ef(e)+" ").replace(" "+r+" "," ")))}function mh(e,r){if(e.classList!==void 0)return e.classList.contains(r);var t=ef(e);return t.length>0&&new RegExp("(^|\\s)"+r+"(\\s|$)").test(t)}function Ha(e,r){e instanceof HTMLElement?e.className=r:e.className.baseVal=r}function ef(e){return e instanceof SVGElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}function Vp(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}var xs=rp(["transform","WebkitTransform"]);function Fu(e,r){e.style[xs]=r}function ku(){if(typeof Event=="function")window.dispatchEvent(new Event("resize"));else{var e=window.document.createEvent("UIEvents");e.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(e)}}function ql(e){var r=["padding: "+(e.height/2-8)+"px "+e.width/2+"px;","line-height: "+e.height+"px;","background-image: url("+e.toDataURL()+");"];console.log(`%c
|
|
`,r.join(""))}function If(){var e,r=window.document.querySelector('meta[name="viewport"]');if(!r)return 1;var t=(e=r.content)===null||e===void 0?void 0:e.split(","),n=t.find(function(i){var o=i.split("="),s=(0,Sn.Z)(o,1),l=s[0];return l==="initial-scale"});return n?n.split("=")[1]*1:1}var wa=If()<1?1:window.devicePixelRatio;function Qs(e,r){e.setAttribute("style","".concat(e.style.cssText).concat(r))}function Rc(e){return e.split(";").map(function(r){return r.trim()}).filter(function(r){return r})}function Kl(e,r){var t,n=Rc((t=e.getAttribute("style"))!==null&&t!==void 0?t:""),i=Rc(r),o=el.apply(void 0,[n].concat((0,Kt.Z)(i)));e.setAttribute("style",o.join(";"))}function rl(e){return Object.entries(e).map(function(r){var t=(0,Sn.Z)(r,2),n=t[0],i=t[1];return"".concat(n,": ").concat(i)}).join(";")}function gh(e,r){return{left:e.left-r.left,top:e.top-r.top,right:r.left+r.width-e.left-e.width,bottom:r.top+r.height-e.top-e.height}}function Ql(e,r){e.checked=r,r?e.setAttribute("checked","true"):e.removeAttribute("checked")}function ca(e){e.innerHTML=""}function tf(e){e.setAttribute("draggable","false")}function np(e,r){if(typeof r=="string"){var t=document.createElement("div");for(t.innerHTML=r;t.firstChild;)e.append(t.firstChild)}else Array.isArray(r)?e.append.apply(e,(0,Kt.Z)(r)):e.append(r)}function Tl(e,r){for(var t=Array.isArray(r)?r:[r],n=e;n instanceof Element&&n!==window.document.body;){var i,o;if(t.find(function(s){var l;return(l=n)===null||l===void 0?void 0:l.matches(s)}))return n;n=(i=(o=n)===null||o===void 0?void 0:o.parentElement)!==null&&i!==void 0?i:null}}var Jl;function _h(e){return typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap}function Pf(){return typeof importScripts=="function"}var wl=Pf()?function(){return self.worker&&self.worker.referrer}:function(){return(window.location.protocol==="blob:"?window.parent:window).location.href},hu=(Jl=navigator)===null||Jl===void 0?void 0:Jl.userAgent,Mc=!!hu.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),rf=hu.indexOf("Android")>-1||hu.indexOf("Adr")>-1;function ec(){for(var e=hu,r=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],t=!0,n=0,i=r;n<i.length;n++){var o=i[n];if(e.indexOf(o)>0){t=!1;break}}return t}function tc(e,r){e.forEach(function(t){r[t]&&(r[t]=r[t].bind(r))})}var ip=null;function nl(e){var r=[1/0,1/0,-1/0,-1/0];return En(e,function(t){r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])}),r}nl.default=nl;var Js=nl;function nf(e){return typeof e=="number"}var Ic=2*Math.PI*6378137/2;function yh(e,r){var t=(0,Sn.Z)(r,4),n=t[0],i=t[1],o=t[2],s=t[3];return e.lng>n&&e.lng<=o&&e.lat>i&&e.lat<=s}function Cl(e){var r=[1/0,1/0,-1/0,-1/0];return e.forEach(function(t){var n=t.coordinates;pu(r,n)}),r}function pu(e,r){return Array.isArray(r[0])?r.forEach(function(t){pu(e,t)}):(e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]<r[0]&&(e[2]=r[0]),e[3]<r[1]&&(e[3]=r[1])),e}function af(e,r){return Pc(e,r)}function Pc(e,r){return Array.isArray(e[0])?e.map(function(t){return Pc(t,r)}):r(e)}function Bu(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{enable:!0,decimal:1};e=Df(e,r);var n=e[0],i=e[1],o=n*Ic/180,s=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);return s=s*Ic/180,t.enable&&(o=Number(o.toFixed(t.decimal)),s=Number(s.toFixed(t.decimal))),e.length===3?[o,s,e[2]]:[o,s]}function Md(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,t=e[0],n=e[1],i=t/Ic*180,o=n/Ic*180;return o=180/Math.PI*(2*Math.atan(Math.exp(o*Math.PI/180))-Math.PI/2),r!=null&&(i=Number(i.toFixed(r)),o=Number(o.toFixed(r))),e.length===3?[i,o,e[2]]:[i,o]}function Of(e){if(e==null)throw new Error("lng is required");return(e>180||e<-180)&&(e=e%360,e>180&&(e=-360+e),e<-180&&(e=360+e),e===0&&(e=0)),e}function xh(e){if(e==null)throw new Error("lat is required");return(e>90||e<-90)&&(e=e%180,e>90&&(e=-180+e),e<-90&&(e=180+e),e===0&&(e=0)),e}function Df(e,r){if(r===!1)return e;var t=Of(e[0]),n=xh(e[1]);return n>85&&(n=85),n<-85&&(n=-85),e.length===3?[t,n,e[2]]:[t,n]}function Fo(e){var r=85.0511287798,t=Math.max(Math.min(r,e[1]),-r),n=256<<20,i=Math.PI/180,o=e[0]*i,s=t*i;s=Math.log(Math.tan(Math.PI/4+s/2));var l=.5/Math.PI,f=.5,v=-.5/Math.PI;return i=.5,o=n*(l*o+f),s=n*(v*s+i),[Math.floor(o),Math.floor(s)]}function bh(e){var r=.5/Math.PI,t=.5,n=-.5/Math.PI,i=.5,o=256<<20,s=_slicedToArray(e,2),l=s[0],f=s[1];l=(l/o-t)/r,f=(f/o-i)/n,f=(Math.atan(Math.pow(Math.E,f))-Math.PI/4)*2,i=Math.PI/180;var v=f/i,y=l/i;return[y,v]}function ap(e,r){var t=85.0511287798,n=Math.PI/180,i=6378137;return r=Math.max(Math.min(t,r),-t),e*=n,r*=n,r=Math.log(Math.tan(Math.PI/4+r/2)),[e*i,r*i]}function Ff(e,r){var t=Math.PI/180,n=6378137,i=e/n/t,o=2*(Math.atan(Math.exp(r/n))-Math.PI/4)/t;return[i,o]}function Eh(e,r,t){var n=Na(r[1]-e[1]),i=Na(r[0]-e[0]),o=Na(e[1]),s=Na(r[1]),l=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(i/2),2)*Math.cos(o)*Math.cos(s);return Ri(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),t="meters")}function Oc(e){var r=Math.PI/180,t=85.0511287798,n=6378137,i=Math.max(Math.min(t,e[1]),-t),o=Math.sin(i*r),s=n*e[0]*r,l=n*Math.log((1+o)/(1-o))/2;return[s,l]}function of(e,r){var t=Math.abs(e[1][1]-e[0][1])*r,n=Math.abs(e[1][0]-e[0][0])*r;return[[e[0][0]-n,e[0][1]-t],[e[1][0]+n,e[1][1]+t]]}function il(e,r){return e[0][0]<=r[0][0]&&e[0][1]<=r[0][1]&&e[1][0]>=r[1][0]&&e[1][1]>=r[1][1]}function pa(e){return[[e[0],e[1]],[e[2],e[3]]]}function kf(e){var r=du(e,[0,0]);return[e[0]/r,e[1]/r]}function du(e,r){return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function Rl(e,r){return e[0]*r[0]+e[1]*r[1]}function Li(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Ca(e,r){return Math.acos(Rl(e,r)/(Li(e)*Li(r)))*180/Math.PI}function Ys(e,r){return r[0]>0?r[1]>0?90-Math.atan(r[1]/r[0])*180/Math.PI:90+Math.atan(-r[1]/r[0])*180/Math.PI:r[1]<0?180+(90-Math.atan(r[1]/r[0])*180/Math.PI):270+Math.atan(r[1]/-r[0])*180/Math.PI}function Bf(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:100;if(!(!e||e.length<2)){for(var t=[0,1],n=0,i=[],o=0;o<e.length-1;o++){var s=e[o],l=e[o+1],f=du(s,l);n+=f;var v=[s[0]-l[0],s[1]-l[1]],y=Ys(t,v);if(o>0){var b=i[o-1].rotation;b-y>360-b+y&&(y=y+360)}i.push({start:s,end:l,dis:f,rotation:y,duration:0})}return i.map(function(T){T.duration=r*(T.dis/n)}),i}}function Fs(e){if(nf(e[0]))return e;if(nf(e[0][0]))throw new Error("\u5F53\u524D\u6570\u636E\u4E0D\u652F\u6301\u6807\u6CE8");if(nf(e[0][0][0])){var r=e,t=0,n=0,i=0;return r.forEach(function(o){o.forEach(function(s){t+=s[0],n+=s[1],i++})}),[t/i,n/i,0]}else throw new Error("\u5F53\u524D\u6570\u636E\u4E0D\u652F\u6301\u6807\u6CE8")}function sf(e){for(var r=e[0],t=e[1],n=e[0],i=e[1],o=0,s=0,l=0,f=0;f<e.length;f+=2){var v=e[f],y=e[f+1];v&&y&&(r=Math.max(v,r),t=Math.max(y,t),n=Math.min(v,n),i=Math.min(y,i),o+=v,s+=y,l++)}return{center:[o/l,s/l],radius:Math.sqrt(Math.pow(r-n,2)+Math.pow(t-i,2))/2}}function op(e){return Js(Hr([on(e)]))}function Sh(e){var r=131,t=137,n=0;e+="x";for(var i=Math.floor(9007199254740991/t),o=0;o<e.length;o++)n>i&&(n=Math.floor(n/t)),n=n*r+e.charCodeAt(o);return n}function Lf(e){e=e.toString();for(var r=5381,t=e.length;t;)r=r*33^e.charCodeAt(--t);return r>>>0}function Ml(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var r=Math.random()*16|0,t=e==="x"?r:r&3|8;return t.toString(16)})}var ko=function(e){return e["GAODE1.x"]="GAODE1.x",e["GAODE2.x"]="GAODE2.x",e.MAPBOX="MAPBOX",e.DEFAULT="DEFAUlTMAP",e.SIMPLE="SIMPLE",e.GLOBEL="GLOBEL",e}({});function Wa(e,r,t,n,i){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:30,s=arguments.length>6?arguments[6]:void 0,l=t;return s&&(l=Math.round(t*(o-1))/(o-1)),n?_n(e,r,l,n,i):_n(e,r,l,.314,i)}function al(e,r){var t=1-r;return(e[0]*t+e[1]*r)*t+(e[1]*t+e[2]*r)*r}function Ah(e,r){return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function Ka(e,r,t){var n=[r[0]-e[0],r[1]-e[1]],i=Ah(n,[0,0]),o=Math.atan2(n[1],n[0]),s=i/2/Math.cos(t),l=o+t,f=[s*Math.cos(l)+e[0],s*Math.sin(l)+e[1]];return f}function _n(e,r,t,n,i){if(i===MapType["GAODE2.x"]){var o=amap2Project(e[0],e[1]),s=amap2Project(r[0],r[1]),l=Ka(o,s,n),f=[o[0],l[0],s[0]],v=[o[1],l[1],s[1]];return[].concat(_toConsumableArray(amap2UnProject(al(f,t),al(v,t))),[0])}else{var y=Ka(e,r,n),b=[e[0],y[0],r[0]],T=[e[1],y[1],r[1]];return[al(b,t),al(T,t),0]}}function ks(e,r,t,n,i){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:30,s=arguments.length>6?arguments[6]:void 0,l=t;return s&&(l=Math.round(t*29)/29),ga(e,r,l,i)}function uf(e,r){var t=[r[0]-e[0],r[1]-e[1]],n=calDistance(t,[0,0]),i=Math.atan2(t[1],t[0]),o=.314,s=n/2/Math.cos(o),l=i+o,f=[s*Math.cos(l)+e[0],s*Math.sin(l)+e[1]];return f}function rc(e,r){var t=1-r;return(e[0]*t+e[1]*r)*t+(e[1]*t+e[2]*r)*r}function us(e,r){var t=[e[0]-r[0],e[1]-r[1]],n=[Math.sin(t[0]/2),Math.sin(t[1]/2)],i=n[1]*n[1]+Math.cos(e[1])*Math.cos(r[1])*n[0]*n[0];return 2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i))}function ga(e,r,t,n){var i=[degreesToRadians(e[0]),degreesToRadians(e[1])],o=[degreesToRadians(r[0]),degreesToRadians(r[1])];if(n==="GAODE2.x"){var s=uf(i,o),l=[i[0],s[0],o[0]],f=[i[1],s[1],o[1]];return[rc(l,t),rc(f,t),0]}else{var v=us(i,o);if(Math.abs(v-Math.PI)<.001)return[(1-t)*i[0]+t*o[0],(1-t)*i[1]+t*o[1]];var y=Math.sin((1-t)*v)/Math.sin(v),b=Math.sin(t*v)/Math.sin(v),T=[Math.sin(i[0]),Math.sin(i[1])],M=[Math.cos(i[0]),Math.cos(i[1])],O=[Math.sin(o[0]),Math.sin(o[1])],F=[Math.cos(o[0]),Math.cos(o[1])],$=y*M[1]*M[0]+b*F[1]*F[0],G=y*M[1]*T[0]+b*F[1]*O[0],ue=y*T[1]+b*O[1];return[radiansToDegrees(Math.atan2(G,$)),radiansToDegrees(Math.atan2(ue,Math.sqrt($*$+G*G)))]}}function Th(e,r){for(var t=0,n=[],i=0;i<e.length-1;i++){var o=e[i],s=e[i+1],l=ol(o,s),f=t;t+=l,n.push({p1:o,p2:s,totalDistance:t,distance:l,lastTotalDistance:f})}for(var v=t*r,y,b,T=0,M=n;T<M.length;T++){var O=M[T],F=O.totalDistance;if(F>v){var $=O.p1,G=O.p2,ue=(v-O.lastTotalDistance)/O.distance,xe=qr(G,$,ue);y=xe[0],b=xe[1];break}}return{lng:y,lat:b,height:0}}function qr(e,r,t){return[e[0]*t+r[0]*(1-t),e[1]*t+r[1]*(1-t)]}function ol(e,r){return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function Dc(e,r){var t=r.featureId,n=e.data.dataArray;return typeof t=="number"&&(n=n.filter(function(i){var o=i.id;return o===t})),n.map(function(i){var o=eu(i,r);return _objectSpread(_objectSpread({},i),o)})}function wh(e,r){return new Promise(function(t){e.inited?t(Dc(e,r)):e.once("update",function(){t(Dc(e,r))})})}function eu(e,r){var t=r.offset,n=r.shape,i=r.thetaOffset,o=r.mapVersion,s=r.segmentNumber,l=s===void 0?30:s,f=r.autoFit,v=f===void 0?!0:f,y=e.coordinates;if(n==="line")return pathLineAtOffset(y,t);var b=y[0],T=y[1],M=typeof i=="string"?e[i]||0:i,O;switch(n){case"arc":O=arcLineAtOffset;break;case"greatcircle":O=greatCircleLineAtOffset;break;default:O=arcLineAtOffset}var F=O(b,T,t,M,o,l,v),$=_slicedToArray(F,3),G=$[0],ue=$[1],xe=$[2];return{lng:G,lat:ue,height:xe}}var Bs=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:50,t=arguments.length>1?arguments[1]:void 0;(0,Q.Z)(this,e),this.limit=r,this.destroy=t||this.defaultDestroy,this.order=[],this.clear()}return(0,j.Z)(e,[{key:"clear",value:function(){var t=this;this.order.forEach(function(n){t.delete(n)}),this.cache={},this.order=[]}},{key:"get",value:function(t){var n=this.cache[t];return n&&(this.deleteOrder(t),this.appendOrder(t)),n}},{key:"set",value:function(t,n){this.cache[t]?(this.delete(t),this.cache[t]=n,this.appendOrder(t)):(Object.keys(this.cache).length===this.limit&&this.delete(this.order[0]),this.cache[t]=n,this.appendOrder(t))}},{key:"delete",value:function(t){var n=this.cache[t];n&&(this.deleteCache(t),this.deleteOrder(t),this.destroy(n,t))}},{key:"deleteCache",value:function(t){delete this.cache[t]}},{key:"deleteOrder",value:function(t){var n=this.order.findIndex(function(i){return i===t});n>=0&&this.order.splice(n,1)}},{key:"appendOrder",value:function(t){this.order.push(t)}},{key:"defaultDestroy",value:function(t,n){return null}}]),e}();function Nf(e){if(e.length===0)throw new Error("max requires at least one data point");for(var r=e[0],t=1;t<e.length;t++)e[t]>r&&(r=e[t]);return r*1}function Uf(e){if(e.length===0)throw new Error("min requires at least one data point");for(var r=e[0],t=1;t<e.length;t++)e[t]<r&&(r=e[t]);return r*1}function Yo(e){if(e.length===0)return 0;for(var r=e[0]*1,t=1;t<e.length;t++)r+=e[t]*1;return r}function Lu(e){if(e.length===0)throw new Error("mean requires at least one data point");return Yo(e)/e.length}function sp(e){if(e.length===0)throw new Error("mean requires at least one data point");if(e.length<3)return e[0];e.sort();for(var r=e[0],t=NaN,n=0,i=1,o=1;o<e.length+1;o++)e[o]!==r?(i>n&&(n=i,t=r),i=1,r=e[o]):i++;return t*1}var Il={min:Uf,max:Nf,mean:Lu,sum:Yo,mode:sp};function lf(e,r){return e.map(function(t){return t[r]})}function up(e,r){return Il[e](r)}var Pt=L(64632),Fe=L(13547),B=L(6346),qs=L(29972),ge=L.n(qs);function Bo(e,r){r===void 0&&(r={});var t=Number(e[0]),n=Number(e[1]),i=Number(e[2]),o=Number(e[3]);if(e.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[t,n],l=[t,o],f=[i,o],v=[i,n];return Lt([[s,v,f,l,s]],r.properties,{bbox:e,id:r.id})}var io=L(11488),vu=L.n(io),bs=function(e){return e.Realtime="realtime",e.Overlap="overlap",e.Replace="replace",e}({}),Da=function(e){return e.Loading="Loading",e.Loaded="Loaded",e.Failure="Failure",e.Cancelled="Cancelled",e}({}),nc=0,kn=1,yn=2;function Ls(e){e.forEach(function(r){r.isCurrent&&(r.isVisible=r.isLoaded)})}function qo(e){e.forEach(function(r){r.properties.state=nc}),e.forEach(function(r){r.isCurrent&&!Fa(r)&&Ns(r)}),e.forEach(function(r){r.isVisible=!!(r.properties.state&yn)})}function mu(e){e.forEach(function(t){t.properties.state=nc}),e.forEach(function(t){t.isCurrent&&Fa(t)});var r=e.slice().sort(function(t,n){return t.z-n.z});r.forEach(function(t){t.isVisible=!!(t.properties.state&yn),t.children.length&&(t.isVisible||t.properties.state&kn)?t.children.forEach(function(n){n.properties.state=kn}):t.isCurrent&&Ns(t)})}function Fa(e){for(;e;){if(e.isLoaded)return e.properties.state|=yn,!0;e=e.parent}return!1}function Ns(e){e.children.forEach(function(r){r.isLoaded?r.properties.state|=yn:Ns(r)})}var Ks,Fc=256,ra=[-1/0,-1/0,1/0,1/0],wo=.2,Ch=5,Pl=(Ks={},(0,B.Z)(Ks,bs.Realtime,Ls),(0,B.Z)(Ks,bs.Overlap,qo),(0,B.Z)(Ks,bs.Replace,mu),Ks),zf=function(){};function gu(e,r,t){var n=Math.floor((e+180)/360*Math.pow(2,t)),i=Math.floor((1-Math.log(Math.tan(r*Math.PI/180)+1/Math.cos(r*Math.PI/180))/Math.PI)/2*Math.pow(2,t));return[n,i]}function Es(e,r,t){var n=e/Math.pow(2,t)*360-180,i=Math.PI-2*Math.PI*r/Math.pow(2,t),o=180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)));return[n,o]}var ic=function(r,t,n){var i=Es(r,t,n),o=(0,Sn.Z)(i,2),s=o[0],l=o[1],f=Es(r+1,t+1,n),v=(0,Sn.Z)(f,2),y=v[0],b=v[1];return[s,b,y,l]};function Nu(e){var r=e.zoom,t=e.latLonBounds,n=e.maxZoom,i=n===void 0?1/0:n,o=e.minZoom,s=o===void 0?0:o,l=e.zoomOffset,f=l===void 0?0:l,v=e.extent,y=v===void 0?ra:v,b=Math.ceil(r)+f;if(Number.isFinite(s)&&b<s)return[];Number.isFinite(i)&&b>i&&(b=i);for(var T=(0,Sn.Z)(t,4),M=T[0],O=T[1],F=T[2],$=T[3],G=[Math.max(M,y[0]),Math.max(O,y[1]),Math.min(F,y[2]),Math.min($,y[3])],ue=[],xe=gu(G[0],G[1],b),ze=(0,Sn.Z)(xe,2),Je=ze[0],ht=ze[1],gt=gu(G[2],G[3],b),Ot=(0,Sn.Z)(gt,2),tr=Ot[0],Ir=Ot[1],Er=Je;Er<=tr;Er++)for(var mn=Ir;mn<=ht;mn++)ue.push({x:Er,y:mn,z:b});var Ln=(tr+Je)/2,Fi=(ht+Ir)/2,xa=function(_s,as){return Math.abs(_s-Ln)+Math.abs(as-Fi)};return ue.sort(function(is,_s){return xa(is.x,is.y)-xa(_s.x,_s.y)}),ue}var Zf=function(r,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=Math.pow(2,n),s=o-1,l=o,f=r,v=t;return i&&(f<0?f=f+l:f>s&&(f=f%l)),{warpX:f,warpY:v}};function kc(e){var r=cf();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function cf(){if(typeof Reflect=="undefined"||!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(e){return!1}}var Vf=function(e){(0,Le.Z)(t,e);var r=kc(t);function t(n){var i;(0,Q.Z)(this,t),i=r.call(this),(0,B.Z)((0,Fe.Z)(i),"tileSize",256),(0,B.Z)((0,Fe.Z)(i),"isVisible",!1),(0,B.Z)((0,Fe.Z)(i),"isCurrent",!1),(0,B.Z)((0,Fe.Z)(i),"isVisibleChange",!1),(0,B.Z)((0,Fe.Z)(i),"loadedLayers",0),(0,B.Z)((0,Fe.Z)(i),"isLayerLoaded",!1),(0,B.Z)((0,Fe.Z)(i),"isLoad",!1),(0,B.Z)((0,Fe.Z)(i),"isChildLoad",!1),(0,B.Z)((0,Fe.Z)(i),"parent",null),(0,B.Z)((0,Fe.Z)(i),"children",[]),(0,B.Z)((0,Fe.Z)(i),"data",null),(0,B.Z)((0,Fe.Z)(i),"properties",{}),(0,B.Z)((0,Fe.Z)(i),"loadDataId",0);var o=n.x,s=n.y,l=n.z,f=n.tileSize,v=n.warp,y=v===void 0?!0:v;return i.x=o,i.y=s,i.z=l,i.warp=y||!0,i.tileSize=f,i}return(0,j.Z)(t,[{key:"isLoading",get:function(){return this.loadStatus===Da.Loading}},{key:"isLoaded",get:function(){return this.loadStatus===Da.Loaded}},{key:"isFailure",get:function(){return this.loadStatus===Da.Failure}},{key:"setTileLayerLoaded",value:function(){this.isLayerLoaded=!0}},{key:"isCancelled",get:function(){return this.loadStatus===Da.Cancelled}},{key:"isDone",get:function(){return[Da.Loaded,Da.Cancelled,Da.Failure].includes(this.loadStatus)}},{key:"bounds",get:function(){return ic(this.x,this.y,this.z)}},{key:"bboxPolygon",get:function(){var i=(0,Sn.Z)(this.bounds,4),o=i[0],s=i[1],l=i[2],f=i[3],v=[(l-o)/2,(f-s)/2],y=Bo(this.bounds,{properties:{key:this.key,id:this.key,bbox:this.bounds,center:v,meta:`
|
|
`.concat(this.key,`
|
|
`)}});return y}},{key:"key",get:function(){var i="".concat(this.x,"_").concat(this.y,"_").concat(this.z);return i}},{key:"layerLoad",value:function(){this.loadedLayers++,this.emit("layerLoaded")}},{key:"loadData",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l,f,v,y,b,T,M,O,F,$,G,ue,xe,ze,Je,ht,gt;return ge().wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return l=s.getData,f=s.onLoad,v=s.onError,this.loadDataId++,y=this.loadDataId,this.isLoading&&this.abortLoad(),this.abortController=new AbortController,this.loadStatus=Da.Loading,b=null,tr.prev=7,M=this.x,O=this.y,F=this.z,$=this.bounds,G=this.tileSize,ue=this.warp,xe=Zf(M,O,F,ue),ze=xe.warpX,Je=xe.warpY,ht=this.abortController.signal,gt={x:ze,y:Je,z:F,bounds:$,tileSize:G,signal:ht,warp:ue},tr.next=14,l(gt,this);case 14:b=tr.sent,tr.next=20;break;case 17:tr.prev=17,tr.t0=tr.catch(7),T=tr.t0;case 20:if(y===this.loadDataId){tr.next=22;break}return tr.abrupt("return");case 22:if(!(this.isCancelled&&!b)){tr.next=24;break}return tr.abrupt("return");case 24:if(!(T||!b)){tr.next=28;break}return this.loadStatus=Da.Failure,v(T,this),tr.abrupt("return");case 28:this.loadStatus=Da.Loaded,this.data=b,f(this);case 31:case"end":return tr.stop()}},o,this,[[7,17]])}));function i(o){return n.apply(this,arguments)}return i}()},{key:"reloadData",value:function(i){this.isLoading&&this.abortLoad(),this.loadData(i)}},{key:"abortLoad",value:function(){this.isLoaded||this.isCancelled||(this.loadStatus=Da.Cancelled,this.abortController.abort(),this.xhrCancel&&this.xhrCancel())}}]),t}(io.EventEmitter),ac=function(r,t){var n=pa(r),i=of(n,t),o=360*3-180,s=85.0511287798065,l=[Math.max(i[0][0],-o),Math.max(i[0][1],-s),Math.min(i[1][0],o),Math.min(i[1][1],s)];return l},oc=function(r,t){var n=pa(r),i=pa(t),o=il(n,i);return o};function Uu(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=zu(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function zu(e,r){if(e){if(typeof e=="string")return tu(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tu(e,r)}}function tu(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function jf(e){var r=Ol();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function Ol(){if(typeof Reflect=="undefined"||!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(e){return!1}}var ru=oi.throttle,Dl=function(e){return e.TilesLoadStart="tiles-load-start",e.TileLoaded="tile-loaded",e.TileError="tile-error",e.TileUnload="tile-unload",e.TileUpdate="tile-update",e.TilesLoadFinished="tiles-load-finished",e}({}),ff=function(e){(0,Le.Z)(t,e);var r=jf(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this),(0,B.Z)((0,Fe.Z)(i),"currentTiles",[]),(0,B.Z)((0,Fe.Z)(i),"cacheTiles",new Map),(0,B.Z)((0,Fe.Z)(i),"throttleUpdate",ru(function(o,s){i.update(o,s)},16)),(0,B.Z)((0,Fe.Z)(i),"onTileLoad",function(o){i.emit(Dl.TileLoaded,o),i.updateTileVisible(),i.loadFinished()}),(0,B.Z)((0,Fe.Z)(i),"onTileError",function(o,s){i.emit(Dl.TileError,{error:o,tile:s}),i.updateTileVisible(),i.loadFinished()}),(0,B.Z)((0,Fe.Z)(i),"onTileUnload",function(o){i.emit(Dl.TileUnload,o),i.loadFinished()}),i.options={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,extent:ra,getTileData:zf,warp:!0,updateStrategy:bs.Replace},i.updateOptions(n),i}return(0,j.Z)(t,[{key:"isLoaded",get:function(){return this.currentTiles.every(function(i){return i.isDone})}},{key:"tiles",get:function(){var i=Array.from(this.cacheTiles.values()).sort(function(o,s){return o.z-s.z});return i}},{key:"updateOptions",value:function(i){var o=i.minZoom===void 0?this.options.minZoom:Math.ceil(i.minZoom),s=i.maxZoom===void 0?this.options.maxZoom:Math.floor(i.maxZoom);this.options=(0,V.Z)((0,V.Z)((0,V.Z)({},this.options),i),{},{minZoom:o,maxZoom:s})}},{key:"update",value:function(i,o){var s=this,l=Math.max(0,Math.ceil(i));if(!(this.lastViewStates&&this.lastViewStates.zoom===l&&oc(this.lastViewStates.latLonBoundsBuffer,o))){var f=ac(o,wo);this.lastViewStates={zoom:l,latLonBounds:o,latLonBoundsBuffer:f},this.currentZoom=l;var v=!1,y=this.getTileIndices(l,f).filter(function(b){return s.options.warp||b.x>=0&&b.x<Math.pow(2,l)});this.emit(Dl.TilesLoadStart),this.currentTiles=y.map(function(b){var T=b.x,M=b.y,O=b.z,F=s.getTile(T,M,O);if(F){var $,G,ue=(($=F)===null||$===void 0?void 0:$.isFailure)||((G=F)===null||G===void 0?void 0:G.isCancelled);return ue&&F.loadData({getData:s.options.getTileData,onLoad:s.onTileLoad,onError:s.onTileError}),F}return F=s.createTile(T,M,O),v=!0,F}),v&&this.resizeCacheTiles(),this.updateTileVisible(),this.pruneRequests()}}},{key:"reloadAll",value:function(){var i=Uu(this.cacheTiles),o;try{for(i.s();!(o=i.n()).done;){var s=(0,Sn.Z)(o.value,2),l=s[0],f=s[1];if(!this.currentTiles.includes(f)){this.cacheTiles.delete(l),this.onTileUnload(f);return}this.onTileUnload(f),f.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError})}}catch(v){i.e(v)}finally{i.f()}}},{key:"reloadTileById",value:function(i,o,s){var l=this.cacheTiles.get("".concat(o,",").concat(s,",").concat(i));l&&(this.onTileUnload(l),l.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}))}},{key:"reloadTileByLnglat",value:function(i,o,s){var l=this.getTileByLngLat(i,o,s);l&&this.reloadTileById(l.z,l.x,l.y)}},{key:"reloadTileByExtent",value:function(i,o){var s=this,l=this.getTileIndices(o,i);l.forEach(function(f){s.reloadTileById(f.z,f.x,f.y)})}},{key:"pruneRequests",value:function(){var i=[],o=Uu(this.cacheTiles.values()),s;try{for(o.s();!(s=o.n()).done;){var l=s.value;l.isLoading&&!l.isCurrent&&!l.isVisible&&i.push(l)}}catch(v){o.e(v)}finally{o.f()}for(;i.length>0;){var f=i.shift();f.abortLoad()}}},{key:"getTileByLngLat",value:function(i,o,s){var l=this.options.zoomOffset,f=Math.ceil(s)+l,v=gu(i,o,f),y=this.tiles.filter(function(b){return b.key==="".concat(v[0],"_").concat(v[1],"_").concat(f)});return y[0]}},{key:"getTileExtent",value:function(i,o){return this.getTileIndices(o,i)}},{key:"getTileByZXY",value:function(i,o,s){var l=this.tiles.filter(function(f){return f.key==="".concat(o,"_").concat(s,"_").concat(i)});return l[0]}},{key:"clear",value:function(){var i=Uu(this.cacheTiles.values()),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.isLoading?s.abortLoad():this.onTileUnload(s)}}catch(l){i.e(l)}finally{i.f()}this.lastViewStates=void 0,this.cacheTiles.clear(),this.currentTiles=[]}},{key:"destroy",value:function(){this.clear(),this.removeAllListeners()}},{key:"updateTileVisible",value:function(){var i=this.options.updateStrategy,o=new Map,s=Uu(this.cacheTiles.values()),l;try{for(s.s();!(l=s.n()).done;){var f=l.value;o.set(f.key,f.isVisible),f.isCurrent=!1,f.isVisible=!1}}catch(O){s.e(O)}finally{s.f()}var v=Uu(this.currentTiles),y;try{for(v.s();!(y=v.n()).done;){var b=y.value;b.isCurrent=!0,b.isVisible=!0}}catch(O){v.e(O)}finally{v.f()}var T=Array.from(this.cacheTiles.values());typeof i=="function"?i(T):Pl[i](T);var M=!1;Array.from(this.cacheTiles.values()).forEach(function(O){O.isVisible!==o.get(O.key)?(O.isVisibleChange=!0,M=!0):O.isVisibleChange=!1}),M&&this.emit(Dl.TileUpdate)}},{key:"getTileIndices",value:function(i,o){var s=this.options,l=s.tileSize,f=s.extent,v=s.zoomOffset,y=Math.floor(this.options.maxZoom),b=Math.ceil(this.options.minZoom),T=Nu({maxZoom:y,minZoom:b,zoomOffset:v,tileSize:l,zoom:i,latLonBounds:o,extent:f});return T}},{key:"getTileId",value:function(i,o,s){var l="".concat(i,",").concat(o,",").concat(s);return l}},{key:"loadFinished",value:function(){var i=!this.currentTiles.some(function(o){return!o.isDone});return i&&this.emit(Dl.TilesLoadFinished),i}},{key:"getTile",value:function(i,o,s){var l=this.getTileId(i,o,s),f=this.cacheTiles.get(l);return f}},{key:"createTile",value:function(i,o,s){var l=this.getTileId(i,o,s),f=new Vf({x:i,y:o,z:s,tileSize:this.options.tileSize,warp:this.options.warp});return this.cacheTiles.set(l,f),f.loadData({getData:this.options.getTileData,onLoad:this.onTileLoad,onError:this.onTileError}),f}},{key:"resizeCacheTiles",value:function(){var i=Ch*this.currentTiles.length,o=this.cacheTiles.size>i;if(o){var s=Uu(this.cacheTiles),l;try{for(s.s();!(l=s.n()).done;){var f=(0,Sn.Z)(l.value,2),v=f[0],y=f[1];if(!y.isVisible&&!this.currentTiles.includes(y)&&(this.cacheTiles.delete(v),this.onTileUnload(y)),this.cacheTiles.size<=i)break}}catch(b){s.e(b)}finally{s.f()}}this.rebuildTileTree()}},{key:"rebuildTileTree",value:function(){var i=Uu(this.cacheTiles.values()),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.parent=null,s.children.length=0}}catch(b){i.e(b)}finally{i.f()}var l=Uu(this.cacheTiles.values()),f;try{for(l.s();!(f=l.n()).done;){var v=f.value,y=this.getNearestAncestor(v.x,v.y,v.z);v.parent=y,y!=null&&y.children&&y.children.push(v)}}catch(b){l.e(b)}finally{l.f()}}},{key:"getNearestAncestor",value:function(i,o,s){for(;s>this.options.minZoom;){i=Math.floor(i/2),o=Math.floor(o/2),s=s-1;var l=this.getTile(i,o,s);if(l)return l}return null}}]),t}(vu());function Rh(e){return/(?=.*{box})(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function Hf(e){var r=[],t=/\{([a-z])-([a-z])\}/.exec(e);if(t){var n=t[1].charCodeAt(0),i=t[2].charCodeAt(0),o;for(o=n;o<=i;++o)r.push(e.replace(t[0],String.fromCharCode(o)));return r}if(t=/\{(\d+)-(\d+)\}/.exec(e),t){for(var s=parseInt(t[2],10),l=parseInt(t[1],10);l<=s;l++)r.push(e.replace(t[0],l.toString()));return r}return r.push(e),r}function h(e,r){if(!e||!e.length)throw new Error("url is not allowed to be empty");var t=r.x,n=r.y,i=r.z,o=Hf(e),s=Math.abs(t+n)%o.length,l=pi(o[s])?"".concat(o[s],"/{z}/{x}/{y}"):o[s];return l.replace(/\{x\}/g,t.toString()).replace(/\{y\}/g,n.toString()).replace(/\{z\}/g,i.toString()).replace(/\{bbox\}/g,ic(t,n,i).join(",")).replace(/\{-y\}/g,(Math.pow(2,i)-n-1).toString())}function d(e,r){var t=r.x,n=r.y,i=r.z,o=r.layer,s=r.version,l=s===void 0?"1.0.0":s,f=r.style,v=f===void 0?"default":f,y=r.format,b=r.service,T=b===void 0?"WMTS":b,M=r.tileMatrixset,O="".concat(e,"&SERVICE=").concat(T,"&REQUEST=GetTile&VERSION=").concat(l,"&LAYER=").concat(o,"&STYLE=").concat(v,"&TILEMATRIXSET=").concat(M,"&FORMAT=").concat(y,"&TILECOL=").concat(t,"&TILEROW=").concat(n,"&TILEMATRIX=").concat(i);return O}function p(e,r){if(!e)throw new Error(r||"web worker helper assertion failed.")}var g={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,document:typeof document!="undefined"&&document},S=g.self||g.window||{},w=g.window||g.self||{},C=g.self||g.window||{},P=g.document||{},Z=typeof importScripts=="function",Y=typeof window!="undefined"&&typeof window.orientation!="undefined",pe=function(){function e(r,t){var n=this;this.name=r,this.workerThread=t,this.isRunning=!0,this.resolve=function(){},this.reject=function(){},this.result=new Promise(function(i,o){n.resolve=i,n.reject=o})}return e.prototype.postMessage=function(r,t){this.workerThread.postMessage({source:"Main thread",type:r,payload:t})},e.prototype.done=function(r){p(this.isRunning,"WorkerJob isRunning false."),this.isRunning=!1,this.resolve(r)},e.prototype.error=function(r){p(this.isRunning,"WorkerJob isRunning false."),this.isRunning=!1,this.reject(r)},e}(),_e=pe,ye=new Map;function Ue(e){p(e.source&&!e.url||!e.source&&e.url);var r=ye.get(e.source||e.url);return r||(e.url&&(r=ke(e.url),ye.set(e.url,r)),e.source&&(r=Ke(e.source),ye.set(e.source,r))),p(r),r}function ke(e){if(!e.startsWith("http"))return e;var r=Ie(e);return Ke(r)}function Ke(e){var r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function Ie(e){return`try {
|
|
importScripts('`+e+`');
|
|
} catch (error) {
|
|
console.error(error);
|
|
throw error;
|
|
}`}function $e(e,r,t){r===void 0&&(r=!0);var n=t||new Set;if(e){if(vt(e))n.add(e);else if(vt(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(var i in e)$e(e[i],r,n)}}return t===void 0?Array.from(n):[]}function vt(e){return e?e instanceof ArrayBuffer||typeof MessagePort!="undefined"&&e instanceof MessagePort||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas:!1}var Rt=function(){},Jt=function(){function e(r){this.terminated=!1,this.loadableURL="";var t=r.name,n=r.source,i=r.url;p(n||i),this.name=t,this.source=n,this.url=i,this.onMessage=Rt,this.onError=function(o){return console.log(o)},this.worker=this.createBrowserWorker()}return e.isSupported=function(){return typeof Worker!="undefined"},e.prototype.destroy=function(){this.onMessage=Rt,this.onError=Rt,this.worker.terminate(),this.terminated=!0},Object.defineProperty(e.prototype,"isRunning",{get:function(){return!!this.onMessage},enumerable:!1,configurable:!0}),e.prototype.postMessage=function(r,t){t=t||$e(r),this.worker.postMessage(r,t)},e.prototype.getErrorFromErrorEvent=function(r){var t="Failed to load ";return t+="worker "+this.name+" from "+this.url+". ",r.message&&(t+=r.message+" in "),r.lineno&&(t+=":"+r.lineno+":"+r.colno),new Error(t)},e.prototype.createBrowserWorker=function(){var r=this;this.loadableURL=Ue({source:this.source,url:this.url});var t=new Worker(this.loadableURL,{name:this.name});return t.onmessage=function(n){n.data?r.onMessage(n.data):r.onError(new Error("No data received"))},t.onerror=function(n){r.onError(r.getErrorFromErrorEvent(n)),r.terminated=!0},t.onmessageerror=function(n){return console.error("worker "+r.name+", message error: "+n)},t},e}(),zt=Jt,ar=function(){return ar=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},ar.apply(this,arguments)},_r=function(e,r,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function l(y){try{v(n.next(y))}catch(b){s(b)}}function f(y){try{v(n.throw(y))}catch(b){s(b)}}function v(y){y.done?o(y.value):i(y.value).then(l,f)}v((n=n.apply(e,r||[])).next())})},Nr=function(e,r){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(v){return function(y){return f([v,y])}}function f(v){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=v[0]&2?i.return:v[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,v[1])).done)return o;switch(i=0,o&&(v=[v[0]&2,o.value]),v[0]){case 0:case 1:o=v;break;case 4:return t.label++,{value:v[1],done:!1};case 5:t.label++,i=v[1],v=[0];continue;case 7:v=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!o||v[1]>o[0]&&v[1]<o[3])){t.label=v[1];break}if(v[0]===6&&t.label<o[1]){t.label=o[1],o=v;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(v);break}o[2]&&t.ops.pop(),t.trys.pop();continue}v=r.call(e,t)}catch(y){v=[6,y],i=0}finally{n=o=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}},kr=function(){function e(r){this.name="unnamed",this.maxConcurrency=1,this.maxMobileConcurrency=1,this.onDebug=function(){},this.reuseWorkers=!0,this.props={},this.jobQueue=[],this.idleQueue=[],this.count=0,this.isDestroyed=!1,this.source=r.source,this.url=r.url,this.setProps(r)}return e.prototype.destroy=function(){this.idleQueue.forEach(function(r){return r.destroy()}),this.isDestroyed=!0},e.prototype.setProps=function(r){this.props=ar(ar({},this.props),r),r.name!==void 0&&(this.name=r.name),r.maxConcurrency!==void 0&&(this.maxConcurrency=r.maxConcurrency),r.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=r.maxMobileConcurrency),r.reuseWorkers!==void 0&&(this.reuseWorkers=r.reuseWorkers),r.onDebug!==void 0&&(this.onDebug=r.onDebug)},e.prototype.startJob=function(r,t,n){return t===void 0&&(t=function(i,o,s){return i.done(s)}),n===void 0&&(n=function(i,o){return i.error(o)}),_r(this,void 0,void 0,function(){var i,o=this;return Nr(this,function(s){switch(s.label){case 0:return i=new Promise(function(l){return o.jobQueue.push({name:r,onMessage:t,onError:n,onStart:l}),o}),this.startQueuedJob(),[4,i];case 1:return[2,s.sent()]}})})},e.prototype.startQueuedJob=function(){return _r(this,void 0,void 0,function(){var r,t,n;return Nr(this,function(i){switch(i.label){case 0:if(!this.jobQueue.length)return[2];if(r=this.getAvailableWorker(),!r)return[2];if(t=this.jobQueue.shift(),!t)return[3,4];this.onDebug({message:"Starting job",name:t.name,backlog:this.jobQueue.length,workerThread:r}),n=new _e(t.name,r),r.onMessage=function(o){return t.onMessage(n,o.type,o.payload)},r.onError=function(o){return t.onError(n,o)},t.onStart(n),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,n.result];case 2:return i.sent(),[3,4];case 3:return this.returnWorkerToQueue(r),[7];case 4:return[2]}})})},e.prototype.returnWorkerToQueue=function(r){var t=this.isDestroyed||!this.reuseWorkers||this.count>this.getMaxConcurrency();t?(r.destroy(),this.count--):this.idleQueue.push(r),this.isDestroyed||this.startQueuedJob()},e.prototype.getAvailableWorker=function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this.getMaxConcurrency()){this.count++;var r=this.name.toLowerCase()+" (#"+this.count+" of "+this.maxConcurrency+")";return new zt({name:r,source:this.source,url:this.url})}return null},e.prototype.getMaxConcurrency=function(){return Y?this.maxMobileConcurrency:this.maxConcurrency},e}(),un=kr,Pn=function(){return Pn=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Pn.apply(this,arguments)},zn=function(e){var r=typeof Symbol=="function"&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},Zn={maxConcurrency:3,maxMobileConcurrency:1,onDebug:function(){},reuseWorkers:!0},Wi=function(){function e(r){this.workerPools=new Map,this.props=Pn({},Zn),this.setProps(r),this.workerPools=new Map}return e.isSupported=function(){return zt.isSupported()},e.getWorkerFarm=function(r){return r===void 0&&(r={}),e.workerFarm=e.workerFarm||new e({}),e.workerFarm.setProps(r),e.workerFarm},e.prototype.destroy=function(){var r,t;try{for(var n=zn(this.workerPools.values()),i=n.next();!i.done;i=n.next()){var o=i.value;o.destroy()}}catch(s){r={error:s}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}},e.prototype.setProps=function(r){var t,n;this.props=Pn(Pn({},this.props),r);try{for(var i=zn(this.workerPools.values()),o=i.next();!o.done;o=i.next()){var s=o.value;s.setProps(this.getWorkerPoolProps())}}catch(l){t={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.getWorkerPool=function(r){var t=r.name,n=r.source,i=r.url,o=this.workerPools.get(t);return o||(o=new un({name:t,source:n,url:i}),o.setProps(this.getWorkerPoolProps()),this.workerPools.set(t,o)),o},e.prototype.getWorkerPoolProps=function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}},e}(),vn=null,ei=new Map,_i=function(){function e(){}return Object.defineProperty(e,"onmessage",{set:function(r){self.onmessage=function(t){if(qn(t)){var n=t.data,i=n.type,o=n.payload;r(i,o)}}},enumerable:!1,configurable:!0}),e.addEventListener=function(r){var t=ei.get(r);t||(t=function(n){if(qn(n)){var i=n.data,o=i.type,s=i.payload;r(o,s)}}),self.addEventListener("message",t)},e.removeEventListener=function(r){var t=ei.get(r);ei.delete(r),self.removeEventListener("message",t)},e.postMessage=function(r,t){if(self){var n={source:"Worker thread",type:r,payload:t},i=$e(t);self.postMessage(n,i)}},e}(),ri=null;function qn(e){var r=e.type,t=e.data;return r==="message"&&t&&typeof t.source=="string"&&t.source==="Main thread"}function di(e){return JSON.parse(Jn(e))}function Jn(e){var r=new Set;return JSON.stringify(e,function(t,n){if(typeof n=="object"&&n!==null){if(r.has(n))try{return JSON.parse(JSON.stringify(n))}catch(i){return}r.add(n)}return n})}function Kn(e){return""+e.name}function Co(e,r){r===void 0&&(r={});var t=r[e.id]||{},n=e.name+".worker.js",i=t.workerUrl;return r._workerType==="test"&&(i=e.module+"/dist/"+n),i||(i="https://unpkg.com/"+e.module+"/dist/"+n),assert(i),i}var Ua=function(e,r,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function l(y){try{v(n.next(y))}catch(b){s(b)}}function f(y){try{v(n.throw(y))}catch(b){s(b)}}function v(y){y.done?o(y.value):i(y.value).then(l,f)}v((n=n.apply(e,r||[])).next())})},Ro=function(e,r){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(v){return function(y){return f([v,y])}}function f(v){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=v[0]&2?i.return:v[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,v[1])).done)return o;switch(i=0,o&&(v=[v[0]&2,o.value]),v[0]){case 0:case 1:o=v;break;case 4:return t.label++,{value:v[1],done:!1};case 5:t.label++,i=v[1],v=[0];continue;case 7:v=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!o||v[1]>o[0]&&v[1]<o[3])){t.label=v[1];break}if(v[0]===6&&t.label<o[1]){t.label=o[1],o=v;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(v);break}o[2]&&t.ops.pop(),t.trys.pop();continue}v=r.call(e,t)}catch(y){v=[6,y],i=0}finally{n=o=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}};function Lo(e,r){return WorkerFarm.isSupported()?e.worker&&(r==null?void 0:r.worker):!1}function Ga(e,r,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),Ua(this,void 0,void 0,function(){var i,o,s,l,f,v,y,b;return Ro(this,function(T){switch(T.label){case 0:return i=getWorkerName(e),o=getWorkerURL(e,t),s=WorkerFarm.getWorkerFarm(t),l=s.getWorkerPool({name:i,url:o}),f=t.jobName||e.name,[4,l.startJob(f,Xa.bind(null,n))];case 1:return v=T.sent(),y=removeNontransferableOptions(t),v.postMessage("process",{input:r,options:y}),[4,v.result];case 2:return b=T.sent(),[2,b.result]}})})}function Xa(e,r,t,n){return Ua(this,void 0,void 0,function(){var i,o,s,l,f,v,y;return Ro(this,function(b){switch(b.label){case 0:switch(i=t,i){case"done":return[3,1];case"error":return[3,2];case"process":return[3,3]}return[3,8];case 1:return r.done(n),[3,9];case 2:return r.error(new Error(n.error)),[3,9];case 3:o=n.id,s=n.input,l=n.options,b.label=4;case 4:return b.trys.push([4,6,,7]),e.process?[4,e.process(s,l)]:(r.postMessage("error",{id:o,error:"Worker not set up to process on main thread"}),[2]);case 5:return f=b.sent(),r.postMessage("done",{id:o,result:f}),[3,7];case 6:return v=b.sent(),y=v instanceof Error?v.message:"unknown error",r.postMessage("error",{id:o,error:y}),[3,7];case 7:return[3,9];case 8:console.warn("process-on-worker: unknown message "+t),b.label=9;case 9:return[2]}})})}var Ss=function(){function e(){this._values=[],this._settlers=[],this._closed=!1}return e.prototype[Symbol.asyncIterator]=function(){return this},e.prototype.push=function(r){return this.enqueue(r)},e.prototype.enqueue=function(r){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");var t=this._settlers.shift();r instanceof Error?t.reject(r):t.resolve({value:r})}else this._values.push(r)},e.prototype.close=function(){for(;this._settlers.length>0;){var r=this._settlers.shift();r.resolve({done:!0})}this._closed=!0},e.prototype.next=function(){var r=this;if(this._values.length>0){var t=this._values.shift();return t instanceof Error?Promise.reject(t):Promise.resolve({done:!1,value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise(function(n,i){r._settlers.push({resolve:n,reject:i})})},e}(),ls=null,Zu=function(e,r,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function l(y){try{v(n.next(y))}catch(b){s(b)}}function f(y){try{v(n.throw(y))}catch(b){s(b)}}function v(y){y.done?o(y.value):i(y.value).then(l,f)}v((n=n.apply(e,r||[])).next())})},cs=function(e,r){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(v){return function(y){return f([v,y])}}function f(v){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=v[0]&2?i.return:v[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,v[1])).done)return o;switch(i=0,o&&(v=[v[0]&2,o.value]),v[0]){case 0:case 1:o=v;break;case 4:return t.label++,{value:v[1],done:!1};case 5:t.label++,i=v[1],v=[0];continue;case 7:v=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!o||v[1]>o[0]&&v[1]<o[3])){t.label=v[1];break}if(v[0]===6&&t.label<o[1]){t.label=o[1],o=v;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(v);break}o[2]&&t.ops.pop(),t.trys.pop();continue}v=r.call(e,t)}catch(y){v=[6,y],i=0}finally{n=o=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}},nu=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e[Symbol.asyncIterator],t;return r?r.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(o){t[o]=e[o]&&function(s){return new Promise(function(l,f){s=e[o](s),i(l,f,s.done,s.value)})}}function i(o,s,l,f){Promise.resolve(f).then(function(v){o({value:v,done:l})},s)}},Us=0,sl,Fl;function ul(e,r){var t=this;if(typeof self!="undefined"){var n={process:kl};WorkerBody.onmessage=function(i,o){return Zu(t,void 0,void 0,function(){var s,l,f,v,y,b,T,M,O,F,$;return cs(this,function(G){switch(G.label){case 0:switch(G.trys.push([0,19,,20]),s=i,s){case"process":return[3,1];case"process-in-batches":return[3,3];case"input-batch":return[3,16];case"input-done":return[3,17]}return[3,18];case 1:if(!e)throw new Error("Worker does not support atomic processing");return[4,e(o.input,o.options||{},n)];case 2:return l=G.sent(),WorkerBody.postMessage("done",{result:l}),[3,18];case 3:if(!r)throw new Error("Worker does not support batched processing");sl=new AsyncQueue,Fl=o.options||{},f=r(sl,Fl,n),G.label=4;case 4:G.trys.push([4,9,10,15]),v=nu(f),G.label=5;case 5:return[4,v.next()];case 6:if(y=G.sent(),!!y.done)return[3,8];b=y.value,WorkerBody.postMessage("output-batch",{result:b}),G.label=7;case 7:return[3,5];case 8:return[3,15];case 9:return T=G.sent(),F={error:T},[3,15];case 10:return G.trys.push([10,,13,14]),y&&!y.done&&($=v.return)?[4,$.call(v)]:[3,12];case 11:G.sent(),G.label=12;case 12:return[3,14];case 13:if(F)throw F.error;return[7];case 14:return[7];case 15:return WorkerBody.postMessage("done",{}),[3,18];case 16:return sl.push(o.input),[3,18];case 17:return sl.close(),[3,18];case 18:return[3,20];case 19:return M=G.sent(),O=M instanceof Error?M.message:"",WorkerBody.postMessage("error",{error:O}),[3,20];case 20:return[2]}})})}}}function kl(e,r){return r===void 0&&(r={}),new Promise(function(t,n){var i=Us++,o=function(l,f){if(f.id===i)switch(l){case"done":WorkerBody.removeEventListener(o),t(f.result);break;case"error":WorkerBody.removeEventListener(o),n(f.error);break;default:}};WorkerBody.addEventListener(o);var s={id:i,input:e,options:r};WorkerBody.postMessage("process",s)})}var Vu=function(e,r,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function l(y){try{v(n.next(y))}catch(b){s(b)}}function f(y){try{v(n.throw(y))}catch(b){s(b)}}function v(y){y.done?o(y.value):i(y.value).then(l,f)}v((n=n.apply(e,r||[])).next())})},iu=function(e,r){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(v){return function(y){return f([v,y])}}function f(v){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=v[0]&2?i.return:v[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,v[1])).done)return o;switch(i=0,o&&(v=[v[0]&2,o.value]),v[0]){case 0:case 1:o=v;break;case 4:return t.label++,{value:v[1],done:!1};case 5:t.label++,i=v[1],v=[0];continue;case 7:v=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!o||v[1]>o[0]&&v[1]<o[3])){t.label=v[1];break}if(v[0]===6&&t.label<o[1]){t.label=o[1],o=v;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(v);break}o[2]&&t.ops.pop(),t.trys.pop();continue}v=r.call(e,t)}catch(y){v=[6,y],i=0}finally{n=o=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}},ju={};function Ko(e,r,t){return r===void 0&&(r=null),t===void 0&&(t={}),Vu(this,void 0,void 0,function(){return iu(this,function(n){switch(n.label){case 0:return r&&(e=Qa(e,r,t)),ju[e]=ju[e]||As(e),[4,ju[e]];case 1:return[2,n.sent()]}})})}function Qa(e,r,t){if(e.startsWith("http"))return e;var n=t.modules||{};return n[e]?n[e]:t.CDN?(assert(t.CDN.startsWith("http")),t.CDN+"/"+r+"/dist/libs/"+e):isWorker?"../src/libs/"+e:"modules/"+r+"/src/libs/"+e}function As(e){return Vu(this,void 0,void 0,function(){var r,t,n;return iu(this,function(i){switch(i.label){case 0:return e.endsWith("wasm")?[4,fetch(e)]:[3,3];case 1:return r=i.sent(),[4,r.arrayBuffer()];case 2:return[2,i.sent()];case 3:return isWorker?[2,importScripts(e)]:[4,fetch(e)];case 4:return t=i.sent(),[4,t.text()];case 5:return n=i.sent(),[2,au(n,e)]}})})}function au(e,r){if(isWorker)return eval.call(global,e),null;var t=document.createElement("script");t.id=r;try{t.appendChild(document.createTextNode(e))}catch(n){t.text=e}return document.body.appendChild(t),null}var Hu="0.0.3",Zi={id:"null",name:"null",module:"web-worker-helper",options:{}};function mo(e){var r=e.color;return!r||!r.length?[1,1,1,1]:r}function ao(e,r,t){return t.length===2?[t[0],t[1],0]:[t[0],t[1],t[2]]}function ou(e){var r=e.filter;return r?[1]:[0]}function Bc(e,r){return[r]}var Bl=L(89675),fs=L.n(Bl),Or=L(1153),Wu=Or.Ue(),Gu=Or.Ue(),oo=Or.Ue(),Ll=Or.Ue(),_u=Or.Ue();function Qo(e,r,t,n,i){Or.IH(e,t,n),Or.Fv(e,e),r=Or.al(-e[1],e[0]);var o=Or.al(-t[1],t[0]);return[i/Or.AK(r,o),r]}function sc(e,r){return Or.t8(e,-r[1],r[0])}function hf(e,r,t){return Or.lu(e,r,t),Or.Fv(e,e),e}function Lc(e,r){return e[0]===r[0]&&e[1]===r[1]}function Km(e){for(var r=new Map,t=0;t<e.length;t++){var n=e[0].toString()+"-"+e[1].toString();r.get(n)?(e.splice(t,1),t++):r.set(n,n)}return e}var Bv=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,Q.Z)(this,e),(0,B.Z)(this,"lastFlip",-1),(0,B.Z)(this,"miter",Or.al(0,0)),(0,B.Z)(this,"started",!1),(0,B.Z)(this,"dash",!1),(0,B.Z)(this,"totalDistance",0),(0,B.Z)(this,"currentIndex",0),this.join=r.join||"miter",this.cap=r.cap||"butt",this.miterLimit=r.miterLimit||10,this.thickness=r.thickness||1,this.dash=r.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0,indexes:[]}}return(0,j.Z)(e,[{key:"extrude_gaode2",value:function(t,n){var i=this.complex;if(t.length<=1)return i;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var o=t.length,s=i.startIndex,l=1;l<o;l++){var f,v,y,b=t[l-1];b.push((f=n[l-1][2])!==null&&f!==void 0?f:0);var T=n[l-1],M=t[l];M.push((v=n[l][2])!==null&&v!==void 0?v:0);var O=n[l],F=l<t.length-1?[].concat((0,Kt.Z)(t[l+1]),[(y=n[l+1][2])!==null&&y!==void 0?y:0]):null,$=l<n.length-1?n[l+1]:null,G=this.segment_gaode2(i,s,b,M,F,T,O,$);s+=G}if(this.dash)for(var ue=0;ue<i.positions.length/6;ue++)i.positions[ue*6+5]=this.totalDistance;return i.startIndex=i.positions.length/6,i}},{key:"simpleExtrude_gaode2",value:function(t,n){var i=this.complex;if(t.length<=1)return i;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var o=t.length,s=i.startIndex,l=1;l<o;l++){var f,v,y,b=t[l-1];b.push((f=n[l-1][2])!==null&&f!==void 0?f:0);var T=n[l-1],M=t[l];M.push((v=n[l][2])!==null&&v!==void 0?v:0);var O=n[l],F=l<t.length-1?[].concat((0,Kt.Z)(t[l+1]),[(y=n[l+1][2])!==null&&y!==void 0?y:0]):null,$=l<n.length-1?n[l+1]:null,G=this.simpleSegment(i,s,b,M,F,T,O,$);s+=G}if(this.dash)for(var ue=0;ue<i.positions.length/6;ue++)i.positions[ue*6+5]=this.totalDistance;return i.startIndex=i.positions.length/6,i}},{key:"extrude",value:function(t){var n=this.complex;if(t.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var i=t.length,o=n.startIndex,s=1;s<i;s++){var l=t[s-1],f=t[s],v=s<t.length-1?t[s+1]:null,y=this.segment(n,o,l,f,v);o+=y}if(this.dash)for(var b=0;b<n.positions.length/6;b++)n.positions[b*6+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"simpleExtrude",value:function(t){var n=this.complex;if(t.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var i=t.length,o=n.startIndex,s=1;s<i;s++){var l=t[s-1],f=t[s],v=s<t.length-1?t[s+1]:null,y=this.simpleSegment(n,o,l,f,v);o+=y}if(this.dash)for(var b=0;b<n.positions.length/6;b++)n.positions[b*6+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"segment_gaode2",value:function(t,n,i,o,s,l,f,v){var y=0,b=t.indices,T=t.positions,M=t.normals,O=this.cap==="square",F=this.join==="bevel",$=Fo([f[0],f[1]]),G=Fo([l[0],l[1]]);hf(oo,o,i);var ue=0;if(this.dash&&(ue=this.lineSegmentDistance($,G),this.totalDistance+=ue),this.normal||(this.normal=Or.Ue(),sc(this.normal,oo)),!this.started)if(this.started=!0,O){var xe=Or.Ue(),ze=Or.Ue();Or.IH(xe,this.normal,oo),Or.IH(ze,this.normal,oo),M.push(ze[0],ze[1],0),M.push(xe[0],xe[1],0),T.push(i[0],i[1],i[2]|0,this.totalDistance-ue,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),T.push(i[0],i[1],i[2]|0,this.totalDistance-ue,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(T,M,i,this.normal,this.thickness,this.totalDistance-ue);if(b.push(n+0,n+1,n+2),s){Lc(o,s)&&Or.IH(s,o,Or.Fv(s,Or.$X(s,o,i))),hf(Ll,s,o);var gt=Qo(_u,Or.Ue(),oo,Ll,this.thickness),Ot=(0,Sn.Z)(gt,2),tr=Ot[0],Ir=Ot[1],Er=Or.AK(_u,this.normal)<0?-1:1,mn=F;if(!mn&&this.join==="miter"){var Ln=tr;Ln>this.miterLimit&&(mn=!0)}mn?(M.push(this.normal[0],this.normal[1],0),M.push(Ir[0],Ir[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,b.push.apply(b,(0,Kt.Z)(this.lastFlip!==-Er?[n,n+2,n+3]:[n+2,n+1,n+3])),b.push(n+2,n+3,n+4),sc(Wu,Ll),Or.JG(this.normal,Wu),M.push(this.normal[0],this.normal[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,y+=3):(this.extrusions(T,M,o,Ir,tr,this.totalDistance),b.push.apply(b,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),Er=-1,Or.JG(this.normal,Ir),y+=2),this.lastFlip=Er}else{if(sc(this.normal,oo),O){var Je=Or.Ue(),ht=Or.Ue();Or.lu(ht,oo,this.normal),Or.IH(Je,oo,this.normal),M.push(ht[0],ht[1],0),M.push(Je[0],Je[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(T,M,o,this.normal,this.thickness,this.totalDistance);b.push.apply(b,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),y+=2}return y}},{key:"simpleSegment",value:function(t,n,i,o,s){var l=0,f=t.indices,v=t.positions,y=t.normals,b=Fo([o[0],o[1]]),T=Fo([i[0],i[1]]);hf(oo,b,T);var M=0;if(this.dash&&(M=this.lineSegmentDistance(b,T),this.totalDistance+=M),this.normal||(this.normal=Or.Ue(),sc(this.normal,oo)),this.started||(this.started=!0,this.extrusions(v,y,i,this.normal,this.thickness,this.totalDistance-M)),f.push(n+0,n+1,n+2),!s)sc(this.normal,oo),this.extrusions(v,y,o,this.normal,this.thickness,this.totalDistance),f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),l+=2;else{var O=Fo([s[0],s[1]]);Lc(b,O)&&Or.IH(O,b,Or.Fv(O,Or.$X(O,b,T))),hf(Ll,O,b);var F=Qo(_u,Or.Ue(),oo,Ll,this.thickness),$=(0,Sn.Z)(F,2),G=$[0],ue=$[1],xe=Or.AK(_u,this.normal)<0?-1:1;this.extrusions(v,y,o,ue,G,this.totalDistance),f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),xe=-1,Or.JG(this.normal,ue),l+=2,this.lastFlip=xe}return l}},{key:"segment",value:function(t,n,i,o,s){var l=0,f=t.indices,v=t.positions,y=t.normals,b=this.cap==="square",T=this.join==="bevel",M=Fo([o[0],o[1]]),O=Fo([i[0],i[1]]);hf(oo,M,O);var F=0;if(this.dash&&(F=this.lineSegmentDistance(M,O),this.totalDistance+=F),this.normal||(this.normal=Or.Ue(),sc(this.normal,oo)),!this.started)if(this.started=!0,b){var $=Or.Ue(),G=Or.Ue();Or.IH($,this.normal,oo),Or.IH(G,this.normal,oo),y.push(G[0],G[1],0),y.push($[0],$[1],0),v.push(i[0],i[1],i[2]|0,this.totalDistance-F,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),v.push(i[0],i[1],i[2]|0,this.totalDistance-F,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(v,y,i,this.normal,this.thickness,this.totalDistance-F);if(f.push(n+0,n+1,n+2),s){var ze=Fo([s[0],s[1]]);Lc(M,ze)&&Or.IH(ze,M,Or.Fv(ze,Or.$X(ze,M,O))),hf(Ll,ze,M);var Je=Qo(_u,Or.Ue(),oo,Ll,this.thickness),ht=(0,Sn.Z)(Je,2),gt=ht[0],Ot=ht[1],tr=Or.AK(_u,this.normal)<0?-1:1,Ir=T;if(!Ir&&this.join==="miter"){var Er=gt;Er>this.miterLimit&&(Ir=!0)}Ir?(y.push(this.normal[0],this.normal[1],0),y.push(Ot[0],Ot[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,f.push.apply(f,(0,Kt.Z)(this.lastFlip!==-tr?[n,n+2,n+3]:[n+2,n+1,n+3])),f.push(n+2,n+3,n+4),sc(Wu,Ll),Or.JG(this.normal,Wu),y.push(this.normal[0],this.normal[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,l+=3):(this.extrusions(v,y,o,Ot,gt,this.totalDistance),f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),tr=-1,Or.JG(this.normal,Ot),l+=2),this.lastFlip=tr}else{if(sc(this.normal,oo),b){var ue=Or.Ue(),xe=Or.Ue();Or.lu(xe,oo,this.normal),Or.IH(ue,oo,this.normal),y.push(xe[0],xe[1],0),y.push(ue[0],ue[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(v,y,o,this.normal,this.thickness,this.totalDistance);f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),l+=2}return l}},{key:"extrusions",value:function(t,n,i,o,s,l){n.push(o[0],o[1],0),n.push(o[0],o[1],0),t.push(i[0],i[1],i[2]|0,l,-s,i[2]|0),this.complex.indexes.push(this.currentIndex),t.push(i[0],i[1],i[2]|0,l,s,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}},{key:"lineSegmentDistance",value:function(t,n){var i=n[0]-t[0],o=n[1]-t[1];return Math.sqrt(i*i+o*o)}}]),e}();function jp(e){var r=e.coordinates,t=e.originCoordinates,n=e.version,i=new Bv({dash:!0,join:"bevel"});if(n==="GAODE2.x"){var o=r;Array.isArray(o[0][0])||(o=[r]);var s=t;Array.isArray(s[0][0])||(s=[t]);for(var l=0;l<o.length;l++){var f=o[l],v=s[l];i.extrude_gaode2(f,v)}}else{var y=r;y[0]&&!Array.isArray(y[0][0])&&(y=[r]),y.forEach(function(T){i.extrude(T)})}var b=i.complex;return{vertices:b.positions,indices:b.indices,normals:b.normals,indexes:b.indexes,size:6}}function pf(e){var r=Fs(e.coordinates);return{vertices:[].concat((0,Kt.Z)(r),(0,Kt.Z)(r),(0,Kt.Z)(r),(0,Kt.Z)(r)),indices:[0,1,2,2,3,0],size:r.length}}function Id(e){var r=e.coordinates,t=fs().flatten(r),n=t.vertices,i=t.dimensions,o=t.holes,s=fs()(n,o,i);return{indices:s,vertices:n,size:i}}var lp=function(){var e=(0,Pt.Z)(ge().mark(function r(t){var n,i,o,s,l,f,v,y,b;return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return n=t.descriptors,i=t.features,o=t.enablePicking,s=t.iconMap,l={a_Color:mo,a_Position:ao,filter:ou,a_vertexId:Bc,a_PickingColor:function(F){var $=F.id;return o?sa($):[0,0,0]},a_DistanceAndIndex:function(F,$,G,ue,xe,ze){return ze===void 0?[G[3],10]:[G[3],ze]},a_Total_Distance:function(F,$,G){return[G[5]]},a_Size:function(F){var $=F.size,G=$===void 0?1:$;return Array.isArray(G)?[G[0],G[1]]:[G,0]},a_Normal:function(F,$,G,ue,xe){return xe},a_Miter:function(F,$,G){return[G[4]]},a_iconMapUV:function(F){var $=F.texture,G=s[$]||{x:0,y:0},ue=G.x,xe=G.y;return[ue,xe]}},f={sizePerElement:0,elements:[]},v=0,y=[],b=3,i.forEach(function(O,F){var $=jp(O),G=$.indices,ue=$.vertices,xe=$.normals,ze=$.size,Je=$.indexes;G.forEach(function(tr){y.push(tr+v)}),b=ze;var ht=ue.length/ze;f.sizePerElement=b,f.elements.push({featureIdx:F,vertices:ue,normals:xe,offset:v}),v+=ht;for(var gt=function(Ir){var Er=(xe==null?void 0:xe.slice(Ir*3,Ir*3+3))||[],mn=ue.slice(Ir*ze,Ir*ze+ze),Ln=0;Je&&Je[Ir]!==void 0&&(Ln=Je[Ir]),n.forEach(function(Fi){if(Fi&&l[Fi.name]){var xa;(xa=Fi.buffer.data).push.apply(xa,(0,Kt.Z)(l[Fi.name](O,F,mn,Ir,Er,Ln)))}})},Ot=0;Ot<ht;Ot++)gt(Ot)}),M.abrupt("return",{descriptors:n,featureLayout:f,indices:y});case 8:case"end":return M.stop()}},r)}));return function(t){return e.apply(this,arguments)}}(),Pd=function(){var e=(0,Pt.Z)(ge().mark(function r(t){var n,i,o,s,l,f,v,y,b;return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return n=t.descriptors,i=t.features,o=t.enablePicking,s=t.shape2d,l={a_Color:mo,a_Position:ao,filter:ou,a_vertexId:Bc,a_PickingColor:function(F){var $=F.id;return o?sa($):[0,0,0]},a_Shape:function(F){var $=F.shape,G=$===void 0?2:$,ue=s.indexOf(G);return[ue]},a_Extrude:function(F,$,G,ue){var xe=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],ze=ue%4*3;return[xe[ze],xe[ze+1],xe[ze+2]]},a_Size:function(F){var $=F.size,G=$===void 0?5:$;return Array.isArray(G)?[G[0]]:[G]}},f={sizePerElement:0,elements:[]},v=0,y=[],b=3,i.forEach(function(O,F){var $=pf(O),G=$.indices,ue=$.vertices,xe=$.normals,ze=$.size,Je=$.indexes;G.forEach(function(tr){y.push(tr+v)}),b=ze;var ht=ue.length/ze;f.sizePerElement=b,f.elements.push({featureIdx:F,vertices:ue,normals:xe,offset:v}),v+=ht;for(var gt=function(Ir){var Er=(xe==null?void 0:xe.slice(Ir*3,Ir*3+3))||[],mn=ue.slice(Ir*ze,Ir*ze+ze),Ln=0;Je&&Je[Ir]!==void 0&&(Ln=Je[Ir]),n.forEach(function(Fi){if(Fi&&l[Fi.name]){var xa;(xa=Fi.buffer.data).push.apply(xa,(0,Kt.Z)(l[Fi.name](O,F,mn,Ir,Er,Ln)))}})},Ot=0;Ot<ht;Ot++)gt(Ot)}),M.abrupt("return",{descriptors:n,featureLayout:f,indices:y});case 8:case"end":return M.stop()}},r)}));return function(t){return e.apply(this,arguments)}}(),Nc=function(){var e=(0,Pt.Z)(ge().mark(function r(t){var n,i,o,s,l,f,v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return n=t.descriptors,i=t.features,o=t.enablePicking,s={a_Color:mo,a_Position:ao,filter:ou,a_vertexId:Bc,a_PickingColor:function(O){var F=O.id;return o?sa(F):[0,0,0]}},l={sizePerElement:0,elements:[]},f=0,v=[],y=3,i.forEach(function(M,O){var F=Id(M),$=F.indices,G=F.vertices,ue=F.normals,xe=F.size,ze=F.indexes;$.forEach(function(Ot){v.push(Ot+f)}),y=xe;var Je=G.length/xe;l.sizePerElement=y,l.elements.push({featureIdx:O,vertices:G,normals:ue,offset:f}),f+=Je;for(var ht=function(tr){var Ir=(ue==null?void 0:ue.slice(tr*3,tr*3+3))||[],Er=G.slice(tr*xe,tr*xe+xe),mn=0;ze&&ze[tr]!==void 0&&(mn=ze[tr]),n.forEach(function(Ln){if(Ln&&s[Ln.name]){var Fi;(Fi=Ln.buffer.data).push.apply(Fi,(0,Kt.Z)(s[Ln.name](M,O,Er,tr,Ir,mn)))}})},gt=0;gt<Je;gt++)ht(gt)}),T.abrupt("return",{descriptors:n,featureLayout:l,indices:v});case 8:case"end":return T.stop()}},r)}));return function(t){return e.apply(this,arguments)}}(),Mh={pointFill:Pd,line:lp,polygonFill:Nc},Od=(0,V.Z)({},Mh);function Qm(e){return Hp.apply(this,arguments)}function Hp(){return Hp=_asyncToGenerator(_regeneratorRuntime.mark(function e(r){var t,n;return _regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(t=r.workerType,n=r.data,!Od[t]){o.next=3;break}return o.abrupt("return",Od[t](n));case 3:return o.abrupt("return",Promise.reject(new Error('Worker with type "'.concat(t,'" non-existent.'))));case 4:case"end":return o.stop()}},e)})),Hp.apply(this,arguments)}var Dd=new Map;function Jm(e,r){Dd.set(e,r)}function Fd(e){var r=Dd.get(e);return r}var Uc="l7-worker",Wf=3,cp=!0;function df(e){registerWorkerSource(Uc,e)}function fp(){var e=getWorkerSource(Uc);if(!e)throw new Error("get worker failed by workerName: ".concat(Uc,"."));return e}function so(e,r){return uc.apply(this,arguments)}function uc(){return uc=_asyncToGenerator(_regeneratorRuntime.mark(function e(r,t){var n,i,o,s,l;return _regeneratorRuntime.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return n=fp(),i=WorkerFarm.getWorkerFarm({maxConcurrency:Wf,reuseWorkers:cp}),o=i.getWorkerPool({name:Uc,source:n}),v.next=5,o.startJob(Uc,function(y,b,T){return y.done(T)});case 5:return s=v.sent,s.postMessage("process",{input:{workerType:r,data:t}}),v.next=9,s.result;case 9:return l=v.sent,v.abrupt("return",l.result);case 11:case"end":return v.stop()}},e)})),uc.apply(this,arguments)}var hp=L(70309),vf=L.n(hp);function mf(e,r){return e.map(function(t){return t[r]*1})}function zc(e){return e===void 0?!1:!Array.isArray(e)&&e.data!==void 0}function Ih(e){return Array.isArray(e)?e.length===0?!1:!!zc(e[0]):!1}function gf(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number":!1}function ll(e){var r=Object.isFrozen(e)?oi.cloneDeep(e):e;return vf()(r,!0),r}function Zc(e,r){var t=r.x,n=r.y,i=r.x1,o=r.y1,s=r.coordinates,l=r.geometry,f=[];if(!Array.isArray(e))return{dataArray:[]};if(l)return e.filter(function(G){return G[l]&&G[l].type&&G[l].coordinates&&G[l].coordinates.length>0}).forEach(function(G,ue){var xe=ll(G[l]);hi(xe,function(ze){var Je=Sr(ze),ht=(0,V.Z)((0,V.Z)({},G),{},{_id:ue,coordinates:Je});f.push(ht)})}),{dataArray:f};for(var v=0;v<e.length;v++){var y=e[v],b=[];if(s){var T="Polygon";Array.isArray(s[0])||(T="Point"),Array.isArray(s[0])&&!Array.isArray(s[0][0])&&(T="LineString");var M=ll({type:T,coordinates:y[s]});b=M.coordinates}else if(t&&n&&i&&o){var O=[parseFloat(y[t]),parseFloat(y[n])],F=[parseFloat(y[i]),parseFloat(y[o])];b=[O,F]}else t&&n&&(b=[parseFloat(y[t]),parseFloat(y[n])]);var $=(0,V.Z)((0,V.Z)({},y),{},{_id:v,coordinates:b});f.push($)}return{dataArray:f}}function _f(e,r){var t=At(e);return Zc(t,r)}var cl=L(63195);function lc(e){for(var r=e.toString(),t=5381,n=r.length;n;)t=t*33^r.charCodeAt(--n);return t>>>0}function yf(e,r){return r===void 0?null:(0,cl.Z)(e.properties[r])*1==="number"?e.properties[r]*1:e.properties&&e.properties[r]?lc(e.properties[r]+"")%1000019:null}function pp(e,r){var t=[],n={};return e.features?(e.features=e.features.filter(function(i){var o=i.geometry;return i!=null&&o&&o.type&&o.coordinates&&o.coordinates.length>0}),e=ll(e),e.features.length===0?{dataArray:[],featureKeys:n}:(hi(e,function(i,o){var s=yf(i,r==null?void 0:r.featureId);s===null&&(s=o);var l=s,f=Sr(i),v=(0,V.Z)((0,V.Z)({},i.properties),{},{coordinates:f,_id:l});t.push(v)}),{dataArray:t,featureKeys:n})):(e.features=[],{dataArray:[]})}function Ph(e,r,t,n){for(var i=n,o=t-r>>1,s=t-r,l,f=e[r],v=e[r+1],y=e[t],b=e[t+1],T=r+3;T<t;T+=3){var M=Wp(e[T],e[T+1],f,v,y,b);if(M>i)l=T,i=M;else if(M===i){var O=Math.abs(T-o);O<s&&(l=T,s=O)}}i>n&&(l-r>3&&Ph(e,r,l,n),e[l+2]=i,t-l>3&&Ph(e,l,t,n))}function Wp(e,r,t,n,i,o){var s=i-t,l=o-n;if(s!==0||l!==0){var f=((e-t)*s+(r-n)*l)/(s*s+l*l);f>1?(t=i,n=o):f>0&&(t+=s*f,n+=l*f)}return s=e-t,l=r-n,s*s+l*l}function xf(e,r,t,n){var i={id:typeof e=="undefined"?null:e,type:r,geometry:t,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return fl(i),i}function fl(e){var r=e.geometry,t=e.type;if(t==="Point"||t==="MultiPoint"||t==="LineString")Nl(e,r);else if(t==="Polygon"||t==="MultiLineString")for(var n=0;n<r.length;n++)Nl(e,r[n]);else if(t==="MultiPolygon")for(n=0;n<r.length;n++)for(var i=0;i<r[n].length;i++)Nl(e,r[n][i])}function Nl(e,r){for(var t=0;t<r.length;t+=3)e.minX=Math.min(e.minX,r[t]),e.minY=Math.min(e.minY,r[t+1]),e.maxX=Math.max(e.maxX,r[t]),e.maxY=Math.max(e.maxY,r[t+1])}function kd(e,r){var t=[];if(e.type==="FeatureCollection")for(var n=0;n<e.features.length;n++)Oh(t,e.features[n],r,n);else e.type==="Feature"?Oh(t,e,r):Oh(t,{geometry:e},r);return t}function Oh(e,r,t,n){if(r.geometry){var i=r.geometry.coordinates,o=r.geometry.type,s=Math.pow(t.tolerance/((1<<t.maxZoom)*t.extent),2),l=[],f=r.id;if(t.promoteId?f=r.properties[t.promoteId]:t.generateId&&(f=n||0),o==="Point")Gp(i,l);else if(o==="MultiPoint")for(var v=0;v<i.length;v++)Gp(i[v],l);else if(o==="LineString")dp(i,l,s,!1);else if(o==="MultiLineString")if(t.lineMetrics){for(v=0;v<i.length;v++)l=[],dp(i[v],l,s,!1),e.push(xf(f,"LineString",l,r.properties));return}else cc(i,l,s,!1);else if(o==="Polygon")cc(i,l,s,!0);else if(o==="MultiPolygon")for(v=0;v<i.length;v++){var y=[];cc(i[v],y,s,!0),l.push(y)}else if(o==="GeometryCollection"){for(v=0;v<r.geometry.geometries.length;v++)Oh(e,{id:f,geometry:r.geometry.geometries[v],properties:r.properties},t,n);return}else throw new Error("Input data is not a valid GeoJSON object.");e.push(xf(f,o,l,r.properties))}}function Gp(e,r){r.push(Bd(e[0])),r.push(hl(e[1])),r.push(0)}function dp(e,r,t,n){for(var i,o,s=0,l=0;l<e.length;l++){var f=Bd(e[l][0]),v=hl(e[l][1]);r.push(f),r.push(v),r.push(0),l>0&&(n?s+=(i*v-f*o)/2:s+=Math.sqrt(Math.pow(f-i,2)+Math.pow(v-o,2))),i=f,o=v}var y=r.length-3;r[2]=1,Ph(r,0,y,t),r[y+2]=1,r.size=Math.abs(s),r.start=0,r.end=r.size}function cc(e,r,t,n){for(var i=0;i<e.length;i++){var o=[];dp(e[i],o,t,n),r.push(o)}}function Bd(e){return e/360+.5}function hl(e){var r=Math.sin(e*Math.PI/180),t=.5-.25*Math.log((1+r)/(1-r))/Math.PI;return t<0?0:t>1?1:t}function pl(e,r,t,n,i,o,s,l){if(t/=r,n/=r,o>=t&&s<n)return e;if(s<t||o>=n)return null;for(var f=[],v=0;v<e.length;v++){var y=e[v],b=y.geometry,T=y.type,M=i===0?y.minX:y.minY,O=i===0?y.maxX:y.maxY;if(M>=t&&O<n){f.push(y);continue}else if(O<t||M>=n)continue;var F=[];if(T==="Point"||T==="MultiPoint")bf(b,F,t,n,i);else if(T==="LineString")fc(b,F,t,n,i,!1,l.lineMetrics);else if(T==="MultiLineString")Ul(b,F,t,n,i,!1);else if(T==="Polygon")Ul(b,F,t,n,i,!0);else if(T==="MultiPolygon")for(var $=0;$<b.length;$++){var G=[];Ul(b[$],G,t,n,i,!0),G.length&&F.push(G)}if(F.length){if(l.lineMetrics&&T==="LineString"){for($=0;$<F.length;$++)f.push(xf(y.id,T,F[$],y.tags));continue}(T==="LineString"||T==="MultiLineString")&&(F.length===1?(T="LineString",F=F[0]):T="MultiLineString"),(T==="Point"||T==="MultiPoint")&&(T=F.length===3?"Point":"MultiPoint"),f.push(xf(y.id,T,F,y.tags))}}return f.length?f:null}function bf(e,r,t,n,i){for(var o=0;o<e.length;o+=3){var s=e[o+i];s>=t&&s<=n&&(r.push(e[o]),r.push(e[o+1]),r.push(e[o+2]))}}function fc(e,r,t,n,i,o,s){for(var l=Xp(e),f=i===0?vp:Ts,v=e.start,y,b,T=0;T<e.length-3;T+=3){var M=e[T],O=e[T+1],F=e[T+2],$=e[T+3],G=e[T+4],ue=i===0?M:O,xe=i===0?$:G,ze=!1;s&&(y=Math.sqrt(Math.pow(M-$,2)+Math.pow(O-G,2))),ue<t?xe>t&&(b=f(l,M,O,$,G,t),s&&(l.start=v+y*b)):ue>n?xe<n&&(b=f(l,M,O,$,G,n),s&&(l.start=v+y*b)):Gf(l,M,O,F),xe<t&&ue>=t&&(b=f(l,M,O,$,G,t),ze=!0),xe>n&&ue<=n&&(b=f(l,M,O,$,G,n),ze=!0),!o&&ze&&(s&&(l.end=v+y*b),r.push(l),l=Xp(e)),s&&(v+=y)}var Je=e.length-3;M=e[Je],O=e[Je+1],F=e[Je+2],ue=i===0?M:O,ue>=t&&ue<=n&&Gf(l,M,O,F),Je=l.length-3,o&&Je>=3&&(l[Je]!==l[0]||l[Je+1]!==l[1])&&Gf(l,l[0],l[1],l[2]),l.length&&r.push(l)}function Xp(e){var r=[];return r.size=e.size,r.start=e.start,r.end=e.end,r}function Ul(e,r,t,n,i,o){for(var s=0;s<e.length;s++)fc(e[s],r,t,n,i,o,!1)}function Gf(e,r,t,n){e.push(r),e.push(t),e.push(n)}function vp(e,r,t,n,i,o){var s=(o-r)/(n-r);return e.push(o),e.push(t+(i-t)*s),e.push(1),s}function Ts(e,r,t,n,i,o){var s=(o-t)/(i-t);return e.push(r+(n-r)*s),e.push(o),e.push(1),s}function hs(e,r){var t=r.buffer/r.extent,n=e,i=pl(e,1,-1-t,t,0,-1,2,r),o=pl(e,1,1-t,2+t,0,-1,2,r);return(i||o)&&(n=pl(e,1,-t,1+t,0,-1,2,r)||[],i&&(n=go(i,1).concat(n)),o&&(n=n.concat(go(o,-1)))),n}function go(e,r){for(var t=[],n=0;n<e.length;n++){var i=e[n],o=i.type,s;if(o==="Point"||o==="MultiPoint"||o==="LineString")s=zs(i.geometry,r);else if(o==="MultiLineString"||o==="Polygon"){s=[];for(var l=0;l<i.geometry.length;l++)s.push(zs(i.geometry[l],r))}else if(o==="MultiPolygon")for(s=[],l=0;l<i.geometry.length;l++){for(var f=[],v=0;v<i.geometry[l].length;v++)f.push(zs(i.geometry[l][v],r));s.push(f)}t.push(xf(i.id,o,s,i.tags))}return t}function zs(e,r){var t=[];t.size=e.size,e.start!==void 0&&(t.start=e.start,t.end=e.end);for(var n=0;n<e.length;n+=3)t.push(e[n]+r,e[n+1],e[n+2]);return t}function $p(e,r){if(e.transformed)return e;var t=1<<e.z,n=e.x,i=e.y,o,s,l;for(o=0;o<e.features.length;o++){var f=e.features[o],v=f.geometry,y=f.type;if(f.geometry=[],y===1)for(s=0;s<v.length;s+=2)f.geometry.push(Xf(v[s],v[s+1],r,t,n,i));else for(s=0;s<v.length;s++){var b=[];for(l=0;l<v[s].length;l+=2)b.push(Xf(v[s][l],v[s][l+1],r,t,n,i));f.geometry.push(b)}}return e.transformed=!0,e}function Xf(e,r,t,n,i,o){return[Math.round(t*(e*n-i)),Math.round(t*(r*n-o))]}function Ld(e,r,t,n,i){for(var o=r===i.maxZoom?0:i.tolerance/((1<<r)*i.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:t,y:n,z:r,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},l=0;l<e.length;l++){s.numFeatures++,Lv(s,e[l],o,i);var f=e[l].minX,v=e[l].minY,y=e[l].maxX,b=e[l].maxY;f<s.minX&&(s.minX=f),v<s.minY&&(s.minY=v),y>s.maxX&&(s.maxX=y),b>s.maxY&&(s.maxY=b)}return s}function Lv(e,r,t,n){var i=r.geometry,o=r.type,s=[];if(o==="Point"||o==="MultiPoint")for(var l=0;l<i.length;l+=3)s.push(i[l]),s.push(i[l+1]),e.numPoints++,e.numSimplified++;else if(o==="LineString")Yp(s,i,e,t,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(l=0;l<i.length;l++)Yp(s,i[l],e,t,o==="Polygon",l===0);else if(o==="MultiPolygon")for(var f=0;f<i.length;f++){var v=i[f];for(l=0;l<v.length;l++)Yp(s,v[l],e,t,!0,l===0)}if(s.length){var y=r.tags||null;if(o==="LineString"&&n.lineMetrics){y={};for(var b in r.tags)y[b]=r.tags[b];y.mapbox_clip_start=i.start/i.size,y.mapbox_clip_end=i.end/i.size}var T={geometry:s,type:o==="Polygon"||o==="MultiPolygon"?3:o==="LineString"||o==="MultiLineString"?2:1,tags:y};r.id!==null&&(T.id=r.id),e.features.push(T)}}function Yp(e,r,t,n,i,o){var s=n*n;if(n>0&&r.size<(i?s:n)){t.numPoints+=r.length/3;return}for(var l=[],f=0;f<r.length;f+=3)(n===0||r[f+2]>s)&&(t.numSimplified++,l.push(r[f]),l.push(r[f+1])),t.numPoints++;i&&Nd(l,o),e.push(l)}function Nd(e,r){for(var t=0,n=0,i=e.length,o=i-2;n<i;o=n,n+=2)t+=(e[n]-e[o])*(e[n+1]+e[o+1]);if(t>0===r)for(n=0,i=e.length;n<i/2;n+=2){var s=e[n],l=e[n+1];e[n]=e[i-2-n],e[n+1]=e[i-1-n],e[i-2-n]=s,e[i-1-n]=l}}function Nv(e,r){return new Dh(e,r)}function Dh(e,r){r=this.options=Uv(Object.create(this.options),r);var t=r.debug;if(t&&console.time("preprocess data"),r.maxZoom<0||r.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(r.promoteId&&r.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=kd(e,r);this.tiles={},this.tileCoords=[],t&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",r.indexMaxZoom,r.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=hs(n,r),n.length&&this.splitTile(n,0,0,0),t&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}Dh.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Dh.prototype.splitTile=function(e,r,t,n,i,o,s){for(var l=[e,r,t,n],f=this.options,v=f.debug;l.length;){n=l.pop(),t=l.pop(),r=l.pop(),e=l.pop();var y=1<<r,b=Jo(r,t,n),T=this.tiles[b];if(!T&&(v>1&&console.time("creation"),T=this.tiles[b]=Ld(e,r,t,n,f),this.tileCoords.push({z:r,x:t,y:n}),v)){v>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",r,t,n,T.numFeatures,T.numPoints,T.numSimplified),console.timeEnd("creation"));var M="z"+r;this.stats[M]=(this.stats[M]||0)+1,this.total++}if(T.source=e,i){if(r===f.maxZoom||r===i)continue;var O=1<<i-r;if(t!==Math.floor(o/O)||n!==Math.floor(s/O))continue}else if(r===f.indexMaxZoom||T.numPoints<=f.indexMaxPoints)continue;if(T.source=null,e.length!==0){v>1&&console.time("clipping");var F=.5*f.buffer/f.extent,$=.5-F,G=.5+F,ue=1+F,xe,ze,Je,ht,gt,Ot;xe=ze=Je=ht=null,gt=pl(e,y,t-F,t+G,0,T.minX,T.maxX,f),Ot=pl(e,y,t+$,t+ue,0,T.minX,T.maxX,f),e=null,gt&&(xe=pl(gt,y,n-F,n+G,1,T.minY,T.maxY,f),ze=pl(gt,y,n+$,n+ue,1,T.minY,T.maxY,f),gt=null),Ot&&(Je=pl(Ot,y,n-F,n+G,1,T.minY,T.maxY,f),ht=pl(Ot,y,n+$,n+ue,1,T.minY,T.maxY,f),Ot=null),v>1&&console.timeEnd("clipping"),l.push(xe||[],r+1,t*2,n*2),l.push(ze||[],r+1,t*2,n*2+1),l.push(Je||[],r+1,t*2+1,n*2),l.push(ht||[],r+1,t*2+1,n*2+1)}}},Dh.prototype.getTile=function(e,r,t){var n=this.options,i=n.extent,o=n.debug;if(e<0||e>24)return null;var s=1<<e;r=(r%s+s)%s;var l=Jo(e,r,t);if(this.tiles[l])return $p(this.tiles[l],i);o>1&&console.log("drilling down to z%d-%d-%d",e,r,t);for(var f=e,v=r,y=t,b;!b&&f>0;)f--,v=Math.floor(v/2),y=Math.floor(y/2),b=this.tiles[Jo(f,v,y)];return!b||!b.source?null:(o>1&&console.log("found parent tile z%d-%d-%d",f,v,y),o>1&&console.time("drilling down"),this.splitTile(b.source,f,v,y,e,r,t),o>1&&console.timeEnd("drilling down"),this.tiles[l]?$p(this.tiles[l],i):null)};function Jo(e,r,t){return((1<<e)*t+r)*32+e}function Uv(e,r){for(var t in r)e[t]=r[t];return e}var $f=function(){function e(r,t,n,i){(0,Q.Z)(this,e),(0,B.Z)(this,"vectorLayerCache",{}),this.x=t,this.y=n,this.z=i,this.vectorTile=r}return(0,j.Z)(e,[{key:"getTileData",value:function(t){if(!t||!this.vectorTile.layers[t])return[];if(this.vectorLayerCache[t])return this.vectorLayerCache[t];var n=this.vectorTile.layers[t];return n.features}},{key:"getFeatureById",value:function(){throw new Error("Method not implemented.")}}]),e}(),qp={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0};function Ud(e){for(var r=0,t=0,n=e.length,i=n-1,o,s;t<n;i=t++)o=e[t],s=e[i],r+=(s.x-o.x)*(o.y+s.y);return r}function Kp(e){var r=e.length;if(r<=1)return[e];for(var t=[],n,i,o=0;o<r;o++){var s=Ud(e[o]);s!==0&&(i===void 0&&(i=s<0),i===s<0?(n&&t.push(n),n=[e[o]]):n.push(e[o]))}return n&&t.push(n),t}var zv=["Unknown","Point","LineString","Polygon"];function Zv(e,r,t,n,i){var o=i.geometry,s=i.type,l=i.tags,f=i.id,v=e*Math.pow(2,n),y=e*r,b=e*t,T=zv[s],M,O;function F(ue){for(var xe=0;xe<ue.length;xe++){var ze=ue[xe];if(ze[3])break;var Je=180-(ze[1]+b)*360/v,ht=(ze[0]+y)*360/v-180,gt=360/Math.PI*Math.atan(Math.exp(Je*Math.PI/180))-90;ue[xe]=[ht,gt,0,1]}}switch(s){case 1:var $=[];for(M=0;M<o.length;M++)$[M]=o[M][0];o=$,F(o);break;case 2:for(M=0;M<o.length;M++)F(o[M]);break;case 3:for(o=Kp(o),M=0;M<o.length;M++)for(O=0;O<o[M].length;O++)F(o[M][O]);break}o.length===1?o=o[0]:T="Multi"+T;var G={type:"Feature",geometry:{type:T,coordinates:o},properties:l,id:f,tileOrigin:[0,0],coord:""};return G}var zd=function(){var e=(0,Pt.Z)(ge().mark(function r(t,n,i,o){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",new Promise(function(f){var v=n.getTile(t.z,t.x,t.y),y=v?v.features.map(function(M){return Zv(o,i.x,i.y,i.z,M)}):[],b={layers:{defaultLayer:{features:y}}},T=new $f(b,t.x,t.y,t.z);f(T)}));case 1:case"end":return l.stop()}},r)}));return function(t,n,i,o){return e.apply(this,arguments)}}();function Zd(e){var r={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!0,debug:0};return e===void 0||typeof e.geojsonvtOptions=="undefined"?r:(0,V.Z)((0,V.Z)({},r),e.geojsonvtOptions)}function z(e,r){var t=Zd(r),n=t.extent||4096,i=Nv(e,t),o=function(f,v){return zd(v,i,f,n)},s=(0,V.Z)((0,V.Z)((0,V.Z)({},qp),r),{},{getTileData:o});return{data:e,dataArray:[],tilesetOptions:s,isTile:!0}}function Ae(e,r){var t=r.extent,n=t===void 0?[121.168,30.2828,121.384,30.4219]:t,i=r.requestParameters,o=i===void 0?{}:i,s=new Promise(function(f){e instanceof HTMLImageElement||_h(e)?f([e]):je(e,o,function(v){f(v)})}),l={originData:e,images:s,_id:1,dataArray:[{_id:0,coordinates:[[n[0],n[1]],[n[2],n[3]]]}]};return l}function je(e,r,t){var n=[];if(typeof e=="string")Pa((0,V.Z)((0,V.Z)({},r),{},{url:e}),function(s,l){l&&(n.push(l),t(n))});else{var i=e.length,o=0;e.forEach(function(s){Pa((0,V.Z)((0,V.Z)({},r),{},{url:s}),function(l,f){o++,f&&n.push(f),o===i&&t(n)})})}return Ae}var jt=function(){var e=(0,Pt.Z)(ge().mark(function r(t,n,i,o){var s,l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return s={x:n.x,y:n.y,z:n.z},l=h(t,s),v.abrupt("return",new Promise(function(y){o?o(s,function(b,T){if(b||!T){var M={layers:{defaultLayer:{features:[]}}},O=new $f(M,n.x,n.y,n.z);y(O)}else{var F={layers:{defaultLayer:{features:T.features}}},$=new $f(F,n.x,n.y,n.z);y($)}}):Ji((0,V.Z)((0,V.Z)({},i),{},{url:l}),function(b,T){if(b||!T){var M={layers:{defaultLayer:{features:[]}}},O=new $f(M,n.x,n.y,n.z);y(O)}else{var F=JSON.parse(T),$={layers:{defaultLayer:{features:F}}},G=new $f($,n.x,n.y,n.z);y(G)}})}));case 3:case"end":return v.stop()}},r)}));return function(t,n,i,o){return e.apply(this,arguments)}}();function pr(e,r){var t=function(o,s){return jt(e,s,r==null?void 0:r.requestParameters,r.getCustomData)},n=(0,V.Z)((0,V.Z)({},r),{},{getTileData:t});return{dataArray:[],tilesetOptions:n,isTile:!0}}var Gt=L(85143),kt=L(43548),Dr=L.n(kt),Cr=function(){function e(r,t,n,i){(0,Q.Z)(this,e),(0,B.Z)(this,"vectorLayerCache",{}),this.x=t,this.y=n,this.z=i,this.vectorTile=new Gt.VectorTile(new(Dr())(r))}return(0,j.Z)(e,[{key:"getTileData",value:function(t){if(!t||!this.vectorTile.layers[t])return[];if(this.vectorLayerCache[t])return this.vectorLayerCache[t];var n=this.vectorTile.layers[t];if(Array.isArray(n.features))return this.vectorLayerCache[t]=n.features,n.features;for(var i=[],o=0;o<n.length;o++){var s=n.feature(o),l=s.toGeoJSON(this.x,this.y,this.z);i.push((0,V.Z)((0,V.Z)({},l),{},{properties:(0,V.Z)({id:l.id},l.properties)}))}return this.vectorLayerCache[t]=i,i}},{key:"getFeatureById",value:function(){throw new Error("Method not implemented.")}}]),e}(),Vr={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0},Br=function(){var e=(0,Pt.Z)(ge().mark(function r(t,n,i,o,s){var l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return l=h(t,n),v.abrupt("return",new Promise(function(y){if(s)s({x:i.x,y:i.y,z:i.z},function(T,M){if(T||!M)y(void 0);else{var O=new Cr(M,i.x,i.y,i.z);y(O)}});else{var b=Ai((0,V.Z)((0,V.Z)({},o),{},{url:l}),function(T,M){if(T||!M)y(void 0);else{var O=new Cr(M,i.x,i.y,i.z);y(O)}});i.xhrCancel=function(){return b.cancel()}}}));case 2:case"end":return v.stop()}},r)}));return function(t,n,i,o,s){return e.apply(this,arguments)}}();function Ur(e,r){var t=Array.isArray(e)?e[0]:e,n=function(s,l){return Br(t,s,l,r==null?void 0:r.requestParameters,r==null?void 0:r.getCustomData)},i=(0,V.Z)((0,V.Z)((0,V.Z)({},Vr),r),{},{getTileData:n});return{data:t,dataArray:[],tilesetOptions:i,isTile:!0}}function Gr(e,r,t){switch(e){case"+":return r+t;case"-":return r-t;case"*":return r*t;case"/":return r/t;case"%":return r%t;case"^":return Math.pow(r,t);case"abs":return Math.abs(r);case"floor":return Math.floor(r);case"round":return Math.round(r);case"ceil":return Math.ceil(r);case"sin":return Math.sin(r);case"cos":return Math.cos(r);case"atan":return t===-1?Math.atan(r):Math.atan2(r,t);case"min":return Math.min(r,t);case"max":return Math.max(r,t);case"log10":return Math.log(r);case"log2":return Math.log2(r);default:return console.warn("Calculate symbol err! Return default 0"),0}}function Ar(e,r){for(var t=r[0],n=t.width,i=t.height,o=r.map(function(M){return M.rasterData}),s=n*i,l=[],f=JSON.stringify(e),v=0;v<s;v++){var y=JSON.parse(f),b=zr(y,o,v);if(typeof b=="number")l.push(b);else{var T=er(y);l.push(T)}}return l}function zr(e,r,t){if(e.length===2&&e[0]==="band"&&typeof e[1]=="number")try{return r[e[1]][t]}catch(n){return console.warn("Raster Data err!"),0}e.map(function(n,i){if(Array.isArray(n)&&n.length>0)switch(n[0]){case"band":try{e[i]=r[n[1]][t]}catch(o){console.warn("Raster Data err!"),e[i]=0}break;default:zr(n,r,t)}})}function Tt(e){var r=(0,Sn.Z)(e,3),t=r[0],n=r[1],i=n===void 0?-1:n,o=r[2],s=o===void 0?-1:o;if(t===void 0)return console.warn("Express err!"),["+",0,0];var l=t.replace(/\s+/g,"");return[l,i,s]}function er(e){var r=Tt(e),t=r[0],n=r[1],i=r[2];return Array.isArray(n)&&(n=er(e[1])),Array.isArray(i)&&(i=er(e[2])),Gr(t,n,i)}var Fr={nd:{type:"operation",expression:["/",["-",["band",1],["band",0]],["+",["band",1],["band",0]]]},rgb:{type:"function",method:rn}};function rn(e,r){for(var t=e[0].rasterData,n=e[1].rasterData,i=e[2].rasterData,o=[],s=(r==null?void 0:r.countCut)||[2,98],l=(0,Sn.Z)(s,2),f=l[0],v=l[1],y=(r==null?void 0:r.RMinMax)||yr(t,f,v),b=(r==null?void 0:r.GMinMax)||yr(n,f,v),T=(r==null?void 0:r.BMinMax)||yr(i,f,v),M=0;M<t.length;M++)o.push(Math.max(0,t[M]-y[0])),o.push(Math.max(0,n[M]-b[0])),o.push(Math.max(0,i[M]-T[0]));return{rasterData:o,rMinMax:y,gMinMax:b,bMinMax:T}}function yr(e,r,t){var n=e.slice().sort(function(l,f){return l-f}),i=n.length,o=n[Math.ceil(i*r/100)],s=n[Math.ceil(i*t/100)];return[o,s]}function an(e,r,t){return Pr.apply(this,arguments)}function Pr(){return Pr=(0,Pt.Z)(ge().mark(function e(r,t,n){var i,o,s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(r.length!==0){b.next=2;break}return b.abrupt("return",{rasterData:[0],width:1,heigh:1});case 2:return b.next=4,Promise.all(r.map(function(T){var M=T.data,O=T.bands,F=O===void 0?[0]:O;return t(M,F)}));case 4:i=b.sent,o=[],i.forEach(function(T){Array.isArray(T)?o.push.apply(o,(0,Kt.Z)(T)):o.push(T)}),s=o[0],l=s.width,f=s.height,b.t0=(0,cl.Z)(n),b.next=b.t0==="function"?11:b.t0==="object"?13:15;break;case 11:return v=n(o),b.abrupt("break",16);case 13:return Array.isArray(n)?v={rasterData:Ar(n,o)}:v=nn(n,o),b.abrupt("break",16);case 15:v={rasterData:o[0].rasterData};case 16:return b.abrupt("return",(0,V.Z)((0,V.Z)({},v),{},{width:l,height:f}));case 17:case"end":return b.stop()}},e)})),Pr.apply(this,arguments)}function nn(e,r){var t=Fr[e.type];if(t.type==="function")return t.method(r,e==null?void 0:e.options);if(t.type==="operation")return e.type==="rgb"?br(t.expression,r):{rasterData:Ar(t.expression,r)}}function br(e,r){e.r===void 0&&console.warn("Channel R lost in Operation! Use band[0] to fill!"),e.g===void 0&&console.warn("Channel G lost in Operation! Use band[0] to fill!"),e.b===void 0&&console.warn("Channel B lost in Operation! Use band[0] to fill!");var t=Ar(e.r||["band",0],r),n=Ar(e.g||["band",0],r),i=Ar(e.b||["band",0],r);return[t,n,i]}function $r(e,r,t,n){return Nn.apply(this,arguments)}function Nn(){return Nn=(0,Pt.Z)(ge().mark(function e(r,t,n,i){var o;return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,an(r,t,n);case 2:o=l.sent,i(null,{data:o});case 4:case"end":return l.stop()}},e)})),Nn.apply(this,arguments)}function ui(e,r){var t=r.extent,n=r.width,i=r.height,o=r.min,s=r.max,l=r.format,f=r.operation,v,y,b;if(l===void 0||gf(e))v=Array.from(e),y=n,b=i;else{var T=Array.isArray(e)?e:[e];v=an(T,l,f)}var M={_id:1,dataArray:[{_id:1,data:v,width:y,height:b,min:o,max:s,coordinates:[[t[0],t[1]],[t[2],t[3]]]}]};return M}var Qr=L(56034),yt=L(31331),vr=L(82615),ot={IEventEmitter:Symbol.for("IEventEmitter"),ISceneService:Symbol.for("ISceneService"),IGlobalConfigService:Symbol.for("IGlobalConfigService"),ICameraService:Symbol.for("ICameraService"),ICoordinateSystemService:Symbol.for("ICoordinateSystemService"),ILayerService:Symbol.for("ILayerService"),IDebugService:Symbol.for("IDebugService"),ILayerMappingService:Symbol.for("ILayerMappingService"),ILayerStyleService:Symbol.for("ILayerStyleService"),IMapService:Symbol.for("IMapService"),IMarkerService:Symbol.for("IMarkerService"),IPopupService:Symbol.for("PopupService"),IFactoryMapService:Symbol.for("Factory<IMapService>"),IRendererService:Symbol.for("IRendererService"),IShaderModuleService:Symbol.for("IShaderModuleService"),IIconService:Symbol.for("IIconService"),IFontService:Symbol.for("IFontService"),IInteractionService:Symbol.for("IInteractionService"),IPickingService:Symbol.for("IPickingService"),IControlService:Symbol.for("IControlService"),IStyleAttributeService:Symbol.for("IStyleAttributeService"),ILayer:Symbol.for("ILayer"),ILayerPlugin:Symbol.for("ILayerPlugin"),INormalPass:Symbol.for("INormalPass"),IPostProcessor:Symbol.for("IPostProcessor"),IPostProcessingPass:Symbol.for("IPostProcessingPass"),IFactoryPostProcessingPass:Symbol.for("Factory<IPostProcessingPass>"),IFactoryNormalPass:Symbol.for("Factory<IFactoryNormalPass>"),IMultiPassRenderer:Symbol.for("IMultiPassRenderer"),SceneID:Symbol.for("SceneID"),MapConfig:Symbol.for("MapConfig")},Ci=L(45188),ln=L.n(Ci);function yi(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=si(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function si(e,r){if(e){if(typeof e=="string")return Qn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Qn(e,r)}}function Qn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Vi=30;function _o(e){var r=e.characterSet,t=e.getFontWidth,n=e.fontHeight,i=e.buffer,o=e.maxCanvasWidth,s=e.mapping,l=s===void 0?{}:s,f=e.xOffset,v=f===void 0?0:f,y=e.yOffset,b=y===void 0?0:y,T=0,M=v;Array.from(r).forEach(function(F,$){if(!l[F]){var G=t(F,$);M+Vi>o&&(M=0,T++),l[F]={x:M,y:b+T*Vi,width:Vi,height:Vi,advance:G},M+=Vi}});var O=n+i*2;return{mapping:l,xOffset:M,yOffset:b+T*O,canvasHeight:fo(b+(T+1)*O)}}function Wo(e,r,t){var n=0,i=0,o=0,s=[],l={},f=yi(e),v;try{for(f.s();!(v=f.n()).done;){var y=v.value;if(!l[y.id]){var b=y.size;n+b+r>t&&(Pi(l,s,i),n=0,i=o+i+r,o=0,s=[]),s.push({icon:y,xOffset:n}),n=n+b+r,o=Math.max(o,b)}}}catch(M){f.e(M)}finally{f.f()}s.length>0&&Pi(l,s,i);var T=fo(o+i+r);return{mapping:l,canvasHeight:T}}function Pi(e,r,t){var n=yi(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value,s=o.icon,l=o.xOffset;e[s.id]=(0,V.Z)((0,V.Z)({},s),{},{x:l,y:t,image:s.image,width:s.width,height:s.height})}}catch(f){n.e(f)}finally{n.f()}}function fo(e){return Math.pow(2,Math.ceil(Math.log2(e)))}var Sa,yo;function xo(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ja(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function Ja(e,r){if(e){if(typeof e=="string")return Mo(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Mo(e,r)}}function Mo(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ps(e){var r=Io();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function Io(){if(typeof Reflect=="undefined"||!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(e){return!1}}var xi=bi(),es="sans-serif",ua="normal",Xn=24,Oi=3,Xi=.25,bo=8,Xu=1024,Ne=1,$t=1,Nt=3,hn=null;function bi(){for(var e=[],r=32;r<128;r++)e.push(String.fromCharCode(r));return e}function da(e,r,t,n){e.font="".concat(n," ").concat(t,"px ").concat(r),e.fillStyle="black",e.textBaseline="middle"}function ce(e,r){for(var t=0;t<e.length;t++)r.data[4*t+3]=e[t]}var Te=(Sa=(0,yt.b2)(),Sa(yo=function(e){(0,Le.Z)(t,e);var r=ps(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"fontAtlas",void 0),(0,B.Z)((0,Fe.Z)(n),"iconFontMap",void 0),(0,B.Z)((0,Fe.Z)(n),"iconFontGlyphs",{}),(0,B.Z)((0,Fe.Z)(n),"fontOptions",void 0),(0,B.Z)((0,Fe.Z)(n),"key",void 0),(0,B.Z)((0,Fe.Z)(n),"cache",new Bs(Nt)),n}return(0,j.Z)(t,[{key:"scale",get:function(){return $t}},{key:"canvas",get:function(){var i=this.cache.get(this.key);return i&&i.data}},{key:"mapping",get:function(){var i=this.cache.get(this.key);return i&&i.mapping||{}}},{key:"getCanvasByKey",value:function(i){var o=this.cache.get(i);return o&&o.data}},{key:"getMappingByKey",value:function(i){var o=this.cache.get(i);return o&&o.mapping||{}}},{key:"init",value:function(){this.cache.clear(),this.fontOptions={fontFamily:es,fontWeight:ua,characterSet:xi,fontSize:Xn,buffer:Oi,sdf:!0,cutoff:Xi,radius:bo,iconfont:!1},this.key="",this.iconFontMap=new Map}},{key:"addIconGlyphs",value:function(i){var o=this;i.forEach(function(s){o.iconFontGlyphs[s.name]=s.unicode})}},{key:"addIconFont",value:function(i,o){this.iconFontMap.set(i,o)}},{key:"getIconFontKey",value:function(i){return this.iconFontMap.get(i)||i}},{key:"getGlyph",value:function(i){return this.iconFontGlyphs[i]?String.fromCharCode(parseInt(this.iconFontGlyphs[i],16)):""}},{key:"setFontOptions",value:function(i){this.fontOptions=(0,V.Z)((0,V.Z)({},this.fontOptions),i),this.key=this.getKey();var o=this.getNewChars(this.key,this.fontOptions.characterSet),s=this.cache.get(this.key);if(!(s&&o.length===0)){var l=this.generateFontAtlas(this.key,o,s);this.fontAtlas=l,this.cache.set(this.key,l)}}},{key:"addFontFace",value:function(i,o){var s=this,l=document.createElement("style");l.type="text/css",l.innerText=`
|
|
@font-face{
|
|
font-family: '`.concat(i,`';
|
|
src: url('`).concat(o,`') format('woff2'),
|
|
url('`).concat(o,`') format('woff'),
|
|
url('`).concat(o,`') format('truetype');
|
|
}`),l.onload=function(){if(document.fonts)try{document.fonts.load("24px ".concat(i),"L7text"),document.fonts.ready.then(function(){s.emit("fontloaded",{fontFamily:i})})}catch(f){console.warn("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301 document.fonts !"),console.warn("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301 iconfont !"),console.warn(f)}},document.getElementsByTagName("head")[0].appendChild(l)}},{key:"destroy",value:function(){this.cache.clear(),this.iconFontMap.clear()}},{key:"generateFontAtlas",value:function(i,o,s){var l=this.fontOptions,f=l.fontFamily,v=l.fontWeight,y=l.fontSize,b=l.buffer,T=l.sdf,M=l.radius,O=l.cutoff,F=l.iconfont,$=s&&s.data;$||($=window.document.createElement("canvas"),$.width=Xu);var G=$.getContext("2d",{willReadFrequently:!0});da(G,f,y,v);var ue=_o((0,V.Z)({getFontWidth:function(lu){return G.measureText(lu).width},fontHeight:y*$t,buffer:b,characterSet:o,maxCanvasWidth:Xu},s&&{mapping:s.mapping,xOffset:s.xOffset,yOffset:s.yOffset})),xe=ue.mapping,ze=ue.canvasHeight,Je=ue.xOffset,ht=ue.yOffset,gt=G.getImageData(0,0,$.width,$.height);if($.height=ze,G.putImageData(gt,0,0),da(G,f,y,v),T){var Ot=new(ln())(y,b,M,O,f,v),tr=G.getImageData(0,0,Ot.size,Ot.size),Ir=xo(o),Er;try{for(Ir.s();!(Er=Ir.n()).done;){var mn=Er.value;if(F){var Ln=String.fromCharCode(parseInt(mn.replace("&#x","").replace(";",""),16)),Fi=Ot.draw(Ln);ce(Fi,tr)}else ce(Ot.draw(mn),tr);G.putImageData(tr,xe[mn].x,xe[mn].y)}}catch(as){Ir.e(as)}finally{Ir.f()}}else{var xa=xo(o),is;try{for(xa.s();!(is=xa.n()).done;){var _s=is.value;G.fillText(_s,xe[_s].x,xe[_s].y+y*Ne)}}catch(as){xa.e(as)}finally{xa.f()}}return{xOffset:Je,yOffset:ht,mapping:xe,data:$,width:$.width,height:$.height}}},{key:"getKey",value:function(){var i=this.fontOptions,o=i.fontFamily,s=i.fontWeight;return"".concat(o,"_").concat(s)}},{key:"getNewChars",value:function(i,o){var s=this.cache.get(i);if(!s)return o;var l=[],f=s.mapping,v=new Set(Object.keys(f)),y=new Set(o);return y.forEach(function(b){v.has(b)||l.push(b)}),l}}]),t}(io.EventEmitter))||yo),Ve,Ut;function Bt(e){var r=tt();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function tt(){if(typeof Reflect=="undefined"||!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(e){return!1}}var ft=3,mt=1024,De=64,st=(Ve=(0,yt.b2)(),Ve(Ut=function(e){(0,Le.Z)(t,e);var r=Bt(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"canvasHeight",128),(0,B.Z)((0,Fe.Z)(n),"texture",void 0),(0,B.Z)((0,Fe.Z)(n),"canvas",void 0),(0,B.Z)((0,Fe.Z)(n),"iconData",void 0),(0,B.Z)((0,Fe.Z)(n),"iconMap",void 0),(0,B.Z)((0,Fe.Z)(n),"ctx",void 0),(0,B.Z)((0,Fe.Z)(n),"loadingImageCount",0),n}return(0,j.Z)(t,[{key:"isLoading",value:function(){return this.loadingImageCount===0}},{key:"init",value:function(){this.iconData=[],this.iconMap={},this.canvas=window.document.createElement("canvas"),this.canvas.width=128,this.canvas.height=128,this.ctx=this.canvas.getContext("2d")}},{key:"addImage",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s,l){var f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return f=new Image,this.loadingImageCount++,this.hasImage(s)?console.warn("Image Id already exists"):this.iconData.push({id:s,size:De}),this.updateIconMap(),b.next=6,this.loadImage(l);case 6:f=b.sent,v=this.iconData.find(function(T){return T.id===s}),v&&(v.image=f,v.width=f.width,v.height=f.height),this.update();case 10:case"end":return b.stop()}},o,this)}));function i(o,s){return n.apply(this,arguments)}return i}()},{key:"addImageMini",value:function(i,o,s){var l=this,f=s.getSceneConfig().canvas,v=f.createImage();if(this.loadingImageCount++,this.hasImage(i))throw new Error("Image Id already exists");this.iconData.push({id:i,size:De}),this.updateIconMap(),this.loadImageMini(o,f).then(function(y){v=y;var b=l.iconData.find(function(T){return T.id===i});b&&(b.image=v,b.width=v.width,b.height=v.height),l.update()})}},{key:"getTexture",value:function(){return this.texture}},{key:"getIconMap",value:function(){return this.iconMap}},{key:"getCanvas",value:function(){return this.canvas}},{key:"hasImage",value:function(i){return this.iconMap.hasOwnProperty(i)}},{key:"removeImage",value:function(i){this.hasImage(i)&&(this.iconData=this.iconData.filter(function(o){return o.id!==i}),delete this.iconMap[i],this.update())}},{key:"destroy",value:function(){this.removeAllListeners("imageUpdate"),this.iconData=[],this.iconMap={}}},{key:"loadImage",value:function(i){return new Promise(function(o,s){if(i instanceof HTMLImageElement){o(i);return}var l=new Image;l.crossOrigin="anonymous",l.onload=function(){o(l)},l.onerror=function(){s(new Error("Could not load image at "+i))},l.src=i instanceof File?URL.createObjectURL(i):i})}},{key:"update",value:function(){this.updateIconMap(),this.updateIconAtlas(),this.loadingImageCount--,this.loadingImageCount===0&&this.emit("imageUpdate")}},{key:"updateIconAtlas",value:function(){var i=this;this.canvas.width=mt,this.canvas.height=this.canvasHeight,Object.keys(this.iconMap).forEach(function(o){var s=i.iconMap[o],l=s.x,f=s.y,v=s.image,y=s.width,b=y===void 0?64:y,T=s.height,M=T===void 0?64:T,O=Math.max(b,M),F=O/De,$=M/F,G=b/F;v&&i.ctx.drawImage(v,l+(De-G)/2,f+(De-$)/2,G,$)})}},{key:"updateIconMap",value:function(){var i=Wo(this.iconData,ft,mt),o=i.mapping,s=i.canvasHeight;this.iconMap=o,this.canvasHeight=s}},{key:"loadImageMini",value:function(i,o){return new Promise(function(s,l){var f=o.createImage();f.crossOrigin="anonymous",f.onload=function(){s(f)},f.onerror=function(){l(new Error("Could not load image at "+i))},f.src=i})}}]),t}(io.EventEmitter))||Ut),me=L(49701),lt,Qt,ur=(lt=(0,yt.b2)(),lt(Qt=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"viewport",void 0),(0,B.Z)(this,"overridedViewProjectionMatrix",void 0),(0,B.Z)(this,"jitteredViewProjectionMatrix",void 0),(0,B.Z)(this,"jitteredProjectionMatrix",void 0),(0,B.Z)(this,"viewMatrixInverse",void 0),(0,B.Z)(this,"cameraPosition",void 0)}return(0,j.Z)(e,[{key:"init",value:function(){}},{key:"update",value:function(t){this.viewport=t,this.viewMatrixInverse=me.create(),me.invert(this.viewMatrixInverse,t.getViewMatrix()),this.cameraPosition=[this.viewMatrixInverse[12],this.viewMatrixInverse[13],this.viewMatrixInverse[14]]}},{key:"getProjectionMatrix",value:function(){return this.jitteredProjectionMatrix||this.viewport.getProjectionMatrix()}},{key:"getModelMatrix",value:function(){return this.viewport.getModelMatrix()}},{key:"getViewMatrix",value:function(){return this.viewport.getViewMatrix()}},{key:"getViewMatrixUncentered",value:function(){return this.viewport.getViewMatrixUncentered()}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewport.getViewProjectionMatrixUncentered()}},{key:"getViewProjectionMatrix",value:function(){return this.overridedViewProjectionMatrix||this.jitteredViewProjectionMatrix||this.viewport.getViewProjectionMatrix()}},{key:"getZoom",value:function(){return this.viewport.getZoom()}},{key:"getZoomScale",value:function(){return this.viewport.getZoomScale()}},{key:"getCenter",value:function(){var t=this.viewport.getCenter(),n=(0,Sn.Z)(t,2),i=n[0],o=n[1];return[i,o]}},{key:"getFocalDistance",value:function(){return this.viewport.getFocalDistance()}},{key:"getCameraPosition",value:function(){return this.cameraPosition}},{key:"projectFlat",value:function(t,n){return this.viewport.projectFlat(t,n)}},{key:"setViewProjectionMatrix",value:function(t){this.overridedViewProjectionMatrix=t}},{key:"jitterProjectionMatrix",value:function(t,n){var i=me.fromTranslation(me.create(),[t,n,0]);this.jitteredProjectionMatrix=me.multiply(me.create(),i,this.viewport.getProjectionMatrix()),this.jitteredViewProjectionMatrix=me.multiply(me.create(),this.jitteredProjectionMatrix,this.viewport.getViewMatrix())}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0,this.jitteredViewProjectionMatrix=void 0}}]),e}())||Qt),xr=function(e){return e.TOPRIGHT="topright",e.TOPLEFT="topleft",e.BOTTOMRIGHT="bottomright",e.BOTTOMLEFT="bottomleft",e.TOPCENTER="topcenter",e.BOTTOMCENTER="bottomcenter",e.LEFTCENTER="leftcenter",e.RIGHTCENTER="rightcenter",e.LEFTTOP="lefttop",e.RIGHTTOP="righttop",e.LEFTBOTTOM="leftbottom",e.RIGHTBOTTOM="rightbottom",e}({}),gr,Mr;function On(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=xn(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function xn(e,r){if(e){if(typeof e=="string")return Tn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Tn(e,r)}}function Tn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var $n={topleft:"column",topright:"column",bottomright:"column",bottomleft:"column",leftcenter:"column",rightcenter:"column",topcenter:"row",bottomcenter:"row",lefttop:"row",righttop:"row",leftbottom:"row",rightbottom:"row"},ii=(gr=(0,yt.b2)(),gr(Mr=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"container",void 0),(0,B.Z)(this,"controlCorners",void 0),(0,B.Z)(this,"controlContainer",void 0),(0,B.Z)(this,"scene",void 0),(0,B.Z)(this,"mapsService",void 0),(0,B.Z)(this,"controls",[]),(0,B.Z)(this,"unAddControls",[])}return(0,j.Z)(e,[{key:"init",value:function(t,n){this.container=t.container,this.scene=n,this.mapsService=n.get(ot.IMapService),this.initControlPos()}},{key:"addControl",value:function(t,n){var i=n.get(ot.IMapService);i.map?(t.addTo(this.scene),this.controls.push(t)):this.unAddControls.push(t)}},{key:"getControlByName",value:function(t){return this.controls.find(function(n){return n.controlOption.name===t})}},{key:"removeControl",value:function(t){var n=this.controls.indexOf(t);return n>-1&&this.controls.splice(n,1),t.remove(),this}},{key:"addControls",value:function(){var t=this;this.unAddControls.forEach(function(n){n.addTo(t.scene),t.controls.push(n)}),this.unAddControls=[]}},{key:"destroy",value:function(){var t=On(this.controls),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;i.remove()}}catch(o){t.e(o)}finally{t.f()}this.controls=[],this.clearControlPos()}},{key:"initControlPos",value:function(){var t=this.controlCorners={},n="l7-",i=this.controlContainer=ta("div",n+"control-container",this.container);function o(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=l.map(function(v){return n+v}).join(" ");t[l.filter(function(v){return!["row","column"].includes(v)}).join("")]=ta("div",f,i)}function s(l){var f=l.replace(/^(top|bottom|left|right|center)/,"$1-").split("-");return[].concat((0,Kt.Z)(f),[$n[l]])}Object.values(xr).forEach(function(l){o(s(l))}),this.checkCornerOverlap()}},{key:"clearControlPos",value:function(){for(var t in this.controlCorners)this.controlCorners[t]&&Ii(this.controlCorners[t]);this.controlContainer&&Ii(this.controlContainer)}},{key:"checkCornerOverlap",value:function(){var t=this,n=window.MutationObserver;if(n)for(var i=function(){var f=s[o],v=f.match(/^(top|bottom)(left|right)$/);if(v){var y=(0,Sn.Z)(v,3),b=y[1],T=y[2],M=t.controlCorners["".concat(b).concat(T)],O=new n(function(F){var $=(0,Sn.Z)(F,1),G=$[0].target;M&&(M.style[b]=G.clientHeight+"px")});O.observe(t.controlCorners["".concat(T).concat(b)],{childList:!0,attributes:!0})}},o=0,s=Object.keys(this.controlCorners);o<s.length;o++)i()}}]),e}())||Mr),na,Eo,dl=(na=(0,yt.b2)(),na(Eo=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"container",void 0),(0,B.Z)(this,"scene",void 0),(0,B.Z)(this,"mapsService",void 0),(0,B.Z)(this,"markers",[]),(0,B.Z)(this,"markerLayers",[]),(0,B.Z)(this,"unAddMarkers",[]),(0,B.Z)(this,"unAddMarkerLayers",[])}return(0,j.Z)(e,[{key:"addMarkerLayer",value:function(t){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markerLayers.push(t),t.addTo(this.scene)):this.unAddMarkerLayers.push(t)}},{key:"removeMarkerLayer",value:function(t){t.destroy(),this.markerLayers.indexOf(t);var n=this.markerLayers.indexOf(t);n>-1&&this.markerLayers.splice(n,1)}},{key:"addMarker",value:function(t){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markers.push(t),t.addTo(this.scene)):this.unAddMarkers.push(t)}},{key:"addMarkers",value:function(){var t=this;this.unAddMarkers.forEach(function(n){n.addTo(t.scene),t.markers.push(n)}),this.unAddMarkers=[]}},{key:"addMarkerLayers",value:function(){var t=this;this.unAddMarkerLayers.forEach(function(n){t.markerLayers.push(n),n.addTo(t.scene)}),this.unAddMarkers=[]}},{key:"removeMarker",value:function(t){t.remove(),this.markers.indexOf(t);var n=this.markers.indexOf(t);n>-1&&this.markers.splice(n,1)}},{key:"removeAllMarkers",value:function(){this.destroy()}},{key:"init",value:function(t){this.scene=t,this.mapsService=t.get(ot.IMapService)}},{key:"destroy",value:function(){this.markers.forEach(function(t){t.remove()}),this.markers=[],this.markerLayers.forEach(function(t){t.destroy()}),this.markerLayers=[]}},{key:"removeMakerLayerMarker",value:function(t){t.destroy()}}]),e}())||Eo),mp,yu,Vd=(mp=(0,yt.b2)(),mp(yu=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"scene",void 0),(0,B.Z)(this,"mapsService",void 0),(0,B.Z)(this,"popups",[]),(0,B.Z)(this,"unAddPopups",[])}return(0,j.Z)(e,[{key:"isMarkerReady",get:function(){return this.mapsService.map&&this.mapsService.getMarkerContainer()}},{key:"removePopup",value:function(t){t!=null&&t.isOpen()&&t.remove();var n=this.popups.indexOf(t);n>-1&&this.popups.splice(n,1);var i=this.unAddPopups.indexOf(t);i>-1&&this.unAddPopups.splice(i,1)}},{key:"destroy",value:function(){this.popups.forEach(function(t){return t.remove()})}},{key:"addPopup",value:function(t){var n=this;t&&t.getOptions().autoClose&&[].concat((0,Kt.Z)(this.popups),(0,Kt.Z)(this.unAddPopups)).forEach(function(i){i.getOptions().autoClose&&n.removePopup(i)}),this.isMarkerReady?(t.addTo(this.scene),this.popups.push(t)):this.unAddPopups.push(t),t.on("close",function(){n.removePopup(t)})}},{key:"initPopup",value:function(){var t=this;this.unAddPopups.length&&this.unAddPopups.forEach(function(n){t.addPopup(n),t.unAddPopups=[]})}},{key:"init",value:function(t){this.scene=t,this.mapsService=t.get(ot.IMapService)}}]),e}())||yu),Zs=function(e){return e.normal="normal",e.additive="additive",e.subtractive="subtractive",e.min="min",e.max="max",e.none="none",e}({}),hc=function(e){return e.MULTIPLE="MULTIPLE",e.SINGLE="SINGLE",e}({}),Qp=function(e){return e.AND="and",e.OR="or",e}({}),ds=function(e){return e.INIT="init",e.UPDATE="update",e}({}),eg={MapToken:"\u60A8\u6B63\u5728\u4F7F\u7528 Demo \u6D4B\u8BD5 Token, \u751F\u4EA7\u73AF\u5883\u52A1\u5FC5\u81EA\u884C\u6CE8\u518C Token \u786E\u4FDD\u670D\u52A1\u7A33\u5B9A \u9AD8\u5FB7\u5730\u56FE\u7533\u8BF7\u5730\u5740 https://lbs.amap.com/api/javascript-api/guide/abc/prepare Mapbox\u5730\u56FE\u7533\u8BF7\u5730\u5740 https://docs.mapbox.com/help/glossary/access-token/",SDK:"\u8BF7\u786E\u8BA4\u5F15\u5165\u4E86mapbox-gl api\u4E14\u5728L7\u4E4B\u524D\u5F15\u5165"},jd=eg,Yf,Hd,gp=oi.merge,tg={id:"map",logoPosition:"bottomleft",logoVisible:!0,antialias:!0,stencil:!0,preserveDrawingBuffer:!1,pickBufferScale:1,fitBoundsOptions:{animate:!1}},No={colors:["rgb(103,0,31)","rgb(178,24,43)","rgb(214,96,77)","rgb(244,165,130)","rgb(253,219,199)","rgb(247,247,247)","rgb(209,229,240)","rgb(146,197,222)","rgb(67,147,195)","rgb(33,102,172)","rgb(5,48,97)"],size:10,shape:"circle",scales:{},shape2d:["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],shape3d:["cylinder","triangleColumn","hexagonColumn","squareColumn"],minZoom:-1,maxZoom:24,visible:!0,autoFit:!1,pickingBuffer:0,enablePropagation:!1,zIndex:0,blend:"normal",maskLayers:[],enableMask:!0,maskOperation:Qp.AND,pickedFeatureID:-1,enableMultiPassRenderer:!1,enablePicking:!0,active:!1,activeColor:"#2f54eb",enableHighlight:!1,enableSelect:!1,highlightColor:"#2f54eb",activeMix:0,selectColor:"blue",selectMix:0,enableTAA:!1,jitterScale:1,enableLighting:!1,animateOption:{enable:!1,interval:.2,duration:4,trailLength:.15},forward:!0},$a=(Yf=(0,yt.b2)(),Yf(Hd=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"sceneConfigCache",{}),(0,B.Z)(this,"layerConfigCache",{}),(0,B.Z)(this,"layerAttributeConfigCache",{})}return(0,j.Z)(e,[{key:"getSceneConfig",value:function(t){return this.sceneConfigCache[t]}},{key:"getSceneWarninfo",value:function(t){return jd[t]}},{key:"setSceneConfig",value:function(t,n){this.sceneConfigCache[t]=(0,V.Z)((0,V.Z)({},tg),n)}},{key:"getLayerConfig",value:function(t){return this.layerConfigCache[t]}},{key:"setLayerConfig",value:function(t,n,i){this.layerConfigCache[n]=(0,V.Z)({},gp({},this.sceneConfigCache[t],No,i))}},{key:"getAttributeConfig",value:function(t){return this.layerAttributeConfigCache[t]}},{key:"setAttributeConfig",value:function(t,n){this.layerAttributeConfigCache[t]=(0,V.Z)((0,V.Z)({},this.layerAttributeConfigCache[t]),n)}},{key:"clean",value:function(){this.sceneConfigCache={},this.layerConfigCache={}}}]),e}())||Hd);function Ni(e,r,t,n){t&&Object.defineProperty(e,r,{enumerable:t.enumerable,configurable:t.configurable,writable:t.writable,value:t.initializer?t.initializer.call(n):void 0})}function ki(e,r,t,n,i){var o={};return Object.keys(n).forEach(function(s){o[s]=n[s]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=t.slice().reverse().reduce(function(s,l){return l(e,r,s)||s},o),i&&o.initializer!==void 0&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),o.initializer===void 0&&(Object.defineProperty(e,r,o),o=null),o}var Fh=L(76126),Wd=Math.PI/180,rg=512,Gd=4003e4;function qf(e){var r=e.latitude,t=r===void 0?0:r,n=e.zoom,i=n===void 0?0:n,o=e.scale,s=e.highPrecision,l=s===void 0?!1:s,f=e.flipY,v=f===void 0?!1:f;o=o!==void 0?o:Math.pow(2,i);var y={},b=rg*o,T=Math.cos(t*Wd),M=b/360,O=M/T,F=b/Gd/T;if(y.pixelsPerMeter=[F,-F,F],y.metersPerPixel=[1/F,-1/F,1/F],y.pixelsPerDegree=[M,-O,F],y.degreesPerPixel=[1/M,-1/O,1/F],l){var $=Wd*Math.tan(t*Wd)/T,G=M*$/2,ue=b/Gd*$,xe=ue/O*F;y.pixelsPerDegree2=[0,-G,ue],y.pixelsPerMeter2=[xe,0,xe],v&&(y.pixelsPerDegree2[1]=-y.pixelsPerDegree2[1],y.pixelsPerMeter2[1]=-y.pixelsPerMeter2[1])}return v&&(y.pixelsPerMeter[1]=-y.pixelsPerMeter[1],y.metersPerPixel[1]=-y.metersPerPixel[1],y.pixelsPerDegree[1]=-y.pixelsPerDegree[1],y.degreesPerPixel[1]=-y.degreesPerPixel[1]),y}var zl=function(e){return e[e.LNGLAT=1]="LNGLAT",e[e.LNGLAT_OFFSET=2]="LNGLAT_OFFSET",e[e.VECTOR_TILE=3]="VECTOR_TILE",e[e.IDENTITY=4]="IDENTITY",e[e.P20=5]="P20",e[e.P20_OFFSET=6]="P20_OFFSET",e[e.METER_OFFSET=7]="METER_OFFSET",e[e.P20_2=8]="P20_2",e}({}),Kf={CoordinateSystem:"u_CoordinateSystem",ViewportCenter:"u_ViewportCenter",ViewportCenterProjection:"u_ViewportCenterProjection",PixelsPerDegree:"u_PixelsPerDegree",PixelsPerDegree2:"u_PixelsPerDegree2",PixelsPerMeter:"u_PixelsPerMeter",Mvp:"u_Mvp"},Po,_p,Vc,yp,Jp,Vv=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],xp=(Po=(0,yt.b2)(),_p=(0,yt.f3)(ot.ICameraService),Po(Vc=(yp=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"needRefresh",!0),Ni(this,"cameraService",Jp,this),(0,B.Z)(this,"coordinateSystem",void 0),(0,B.Z)(this,"viewportCenter",void 0),(0,B.Z)(this,"viewportCenterProjection",void 0),(0,B.Z)(this,"pixelsPerDegree",void 0),(0,B.Z)(this,"pixelsPerDegree2",void 0),(0,B.Z)(this,"pixelsPerMeter",void 0)}return(0,j.Z)(e,[{key:"refresh",value:function(t){var n=this.cameraService.getZoom(),i=this.cameraService.getZoomScale(),o=t||this.cameraService.getCenter(),s=qf({latitude:o[1],zoom:n}),l=s.pixelsPerMeter,f=s.pixelsPerDegree;this.viewportCenter=o,this.viewportCenterProjection=[0,0,0,0],this.pixelsPerMeter=l,this.pixelsPerDegree=f,this.pixelsPerDegree2=[0,0,0],this.coordinateSystem===zl.LNGLAT||this.coordinateSystem===zl.P20?this.cameraService.setViewProjectionMatrix(void 0):this.coordinateSystem===zl.LNGLAT_OFFSET?this.calculateLnglatOffset(o,n):this.coordinateSystem===zl.P20_OFFSET&&this.calculateLnglatOffset(o,n,i,!0),this.needRefresh=!1}},{key:"getCoordinateSystem",value:function(){return this.coordinateSystem}},{key:"setCoordinateSystem",value:function(t){this.coordinateSystem=t}},{key:"getViewportCenter",value:function(){return this.viewportCenter}},{key:"getViewportCenterProjection",value:function(){return this.viewportCenterProjection}},{key:"getPixelsPerDegree",value:function(){return this.pixelsPerDegree}},{key:"getPixelsPerDegree2",value:function(){return this.pixelsPerDegree2}},{key:"getPixelsPerMeter",value:function(){return this.pixelsPerMeter}},{key:"calculateLnglatOffset",value:function(t,n,i,o){var s=qf({latitude:t[1],zoom:n,scale:i,flipY:o,highPrecision:!0}),l=s.pixelsPerMeter,f=s.pixelsPerDegree,v=s.pixelsPerDegree2,y=this.cameraService.getViewMatrix(),b=this.cameraService.getProjectionMatrix(),T=me.multiply([],b,y),M=this.cameraService.projectFlat([Math.fround(t[0]),Math.fround(t[1])],Math.pow(2,n));this.viewportCenterProjection=Fh.fF([],[M[0],M[1],0,1],T),y=this.cameraService.getViewMatrixUncentered()||y,T=me.multiply([],b,y),T=me.multiply([],T,Vv),this.cameraService.setViewProjectionMatrix(T),this.pixelsPerMeter=l,this.pixelsPerDegree=f,this.pixelsPerDegree2=v}}]),e}(),Jp=ki(yp.prototype,"cameraService",[_p],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yp))||Vc),jc,jv;function ng(e){var r=E0();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function E0(){if(typeof Reflect=="undefined"||!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(e){return!1}}var ts=(jc=(0,yt.b2)(),jc(jv=function(e){(0,Le.Z)(t,e);var r=ng(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"renderMap",new Map),(0,B.Z)((0,Fe.Z)(n),"enable",!1),(0,B.Z)((0,Fe.Z)(n),"renderEnable",!1),(0,B.Z)((0,Fe.Z)(n),"cacheLogs",{}),n}return(0,j.Z)(t,[{key:"setEnable",value:function(i){this.enable=!!i}},{key:"log",value:function(i,o){var s=this;if(this.enable){var l=i.split("."),f=null;l.forEach(function(v,y){f!==null?(f[v]||(f[v]={}),y!==l.length-1&&(f=f[v])):(s.cacheLogs[v]||(s.cacheLogs[v]={}),y!==l.length-1&&(f=s.cacheLogs[v])),y===l.length-1&&(f[v]=(0,V.Z)((0,V.Z)({time:Date.now()},f[v]),o))})}}},{key:"getLog",value:function(i){var o=this;switch((0,cl.Z)(i)){case"string":return this.cacheLogs[i];case"object":return i.map(function(s){return o.cacheLogs[s]}).filter(function(s){return s!==void 0});case"undefined":return this.cacheLogs}}},{key:"removeLog",value:function(i){delete this.cacheLogs[i]}},{key:"generateRenderUid",value:function(){return this.renderEnable?Ml():""}},{key:"renderDebug",value:function(i){this.renderEnable=i}},{key:"renderStart",value:function(i){if(!(!this.renderEnable||!this.enable)){var o=this.renderMap.get(i)||{};this.renderMap.set(i,(0,V.Z)((0,V.Z)({},o),{},{renderUid:i,renderStart:Date.now()}))}}},{key:"renderEnd",value:function(i){if(!(!this.renderEnable||!this.enable)){var o=this.renderMap.get(i);if(o){var s=o.renderStart,l=Date.now();this.emit("renderEnd",(0,V.Z)((0,V.Z)({},o),{},{renderEnd:l,renderDuration:l-s})),this.renderMap.delete(i)}}}},{key:"destroy",value:function(){this.cacheLogs=null,this.renderMap.clear()}}]),t}(io.EventEmitter))||jv),Qf=L(75772),bp=L.n(Qf),a=function(e){return e.Hover="hover",e.Click="click",e.Select="select",e.Active="active",e.Drag="drag",e}({}),u,c,m,x,E;function A(e){var r=I();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function I(){if(typeof Reflect=="undefined"||!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(e){return!1}}var D={panstart:"dragstart",panmove:"dragging",panend:"dragend",pancancel:"dragcancel"},N=(u=(0,yt.b2)(),c=(0,yt.f3)(ot.IMapService),u(m=(x=function(e){(0,Le.Z)(t,e);var r=A(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"indragging",!1),Ni((0,Fe.Z)(n),"mapService",E,(0,Fe.Z)(n)),(0,B.Z)((0,Fe.Z)(n),"hammertime",void 0),(0,B.Z)((0,Fe.Z)(n),"lastClickTime",0),(0,B.Z)((0,Fe.Z)(n),"lastClickXY",[-1,-1]),(0,B.Z)((0,Fe.Z)(n),"clickTimer",void 0),(0,B.Z)((0,Fe.Z)(n),"$containter",void 0),(0,B.Z)((0,Fe.Z)(n),"onDrag",function(l){var f=n.interactionEvent(l);f.type=D[f.type],f.type==="dragging"?n.indragging=!0:n.indragging=!1,n.emit(a.Drag,f)}),(0,B.Z)((0,Fe.Z)(n),"onHammer",function(l){l.srcEvent.stopPropagation();var f=n.interactionEvent(l);n.emit(a.Hover,f)}),(0,B.Z)((0,Fe.Z)(n),"onTouch",function(l){var f=l.touches[0];n.onHover({x:f.pageX,y:f.pageY,type:"touch"})}),(0,B.Z)((0,Fe.Z)(n),"onHover",function(l){var f=l.clientX,v=l.clientY,y=f,b=v,T=l.type,M=n.mapService.getMapContainer();if(M){var O=M.getBoundingClientRect(),F=O.top,$=O.left;y=y-$-M.clientLeft,b=b-F-M.clientTop}var G=n.mapService.containerToLngLat([y,b]);if(T==="click"){n.isDoubleTap(y,b,G);return}if(T==="touch"){n.isDoubleTap(y,b,G);return}T!=="click"&&T!=="dblclick"&&n.emit(a.Hover,{x:y,y:b,lngLat:G,type:T,target:l})}),n}return(0,j.Z)(t,[{key:"init",value:function(){this.addEventListenerOnMap(),this.$containter=this.mapService.getMapContainer()}},{key:"destroy",value:function(){this.hammertime&&this.hammertime.destroy(),this.removeEventListenerOnMap(),this.off(a.Hover)}},{key:"triggerHover",value:function(i){var o=i.x,s=i.y;this.emit(a.Hover,{x:o,y:s})}},{key:"triggerSelect",value:function(i){this.emit(a.Select,{featureId:i})}},{key:"triggerActive",value:function(i){this.emit(a.Active,{featureId:i})}},{key:"handleMiniEvent",value:function(i){this.onHover({clientX:i.touches[0].pageX,clientY:i.touches[0].pageY,type:"touch"})}},{key:"addEventListenerOnMap",value:function(){var i=this.mapService.getMapContainer();if(i){var o=new(bp()).Manager(i);o.add(new(bp()).Tap({event:"dblclick",taps:2})),o.add(new(bp()).Tap({event:"click"})),o.add(new(bp()).Pan({threshold:0,pointers:0})),o.add(new(bp()).Press({})),o.on("dblclick click",this.onHammer),o.on("panstart panmove panend pancancel",this.onDrag),i.addEventListener("mousemove",this.onHover),i.addEventListener("mousedown",this.onHover,!0),i.addEventListener("mouseup",this.onHover),i.addEventListener("contextmenu",this.onHover),this.hammertime=o}}},{key:"removeEventListenerOnMap",value:function(){var i=this.mapService.getMapContainer();i&&(i.removeEventListener("mousemove",this.onHover),this.hammertime.off("dblclick click",this.onHammer),this.hammertime.off("panstart panmove panend pancancel",this.onDrag),i.removeEventListener("mousedown",this.onHover),i.removeEventListener("mouseup",this.onHover),i.removeEventListener("contextmenu",this.onHover))}},{key:"interactionEvent",value:function(i){var o=i.type,s=i.pointerType,l,f;s==="touch"?(f=Math.floor(i.pointers[0].clientY),l=Math.floor(i.pointers[0].clientX)):(f=Math.floor(i.srcEvent.y),l=Math.floor(i.srcEvent.x));var v=this.mapService.getMapContainer();if(v){var y=v.getBoundingClientRect(),b=y.top,T=y.left;l-=T,f-=b}var M=this.mapService.containerToLngLat([l,f]);return{x:l,y:f,lngLat:M,type:o,target:i.srcEvent}}},{key:"isDoubleTap",value:function(i,o,s){var l=this,f=new Date().getTime(),v="click";f-this.lastClickTime<400&&Math.abs(this.lastClickXY[0]-i)<10&&Math.abs(this.lastClickXY[1]-o)<10?(this.lastClickTime=0,this.lastClickXY=[-1,-1],this.clickTimer&&clearTimeout(this.clickTimer),v="dblclick",this.emit(a.Hover,{x:i,y:o,lngLat:s,type:v})):(this.lastClickTime=f,this.lastClickXY=[i,o],this.clickTimer=setTimeout(function(){v="click",l.emit(a.Hover,{x:i,y:o,lngLat:s,type:v})},400))}}]),t}(vu()),E=ki(x.prototype,"mapService",[c],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),x))||m),H=0;function X(e){var r=e;if(typeof e=="string"&&(r=document.getElementById(e)),r){var t=document.createElement("div");return t.style.cssText+=`
|
|
position: absolute;
|
|
z-index:2;
|
|
height: 100%;
|
|
width: 100%;
|
|
pointer-events: none;
|
|
`,t.id="l7-scene-".concat(H++),t.classList.add("l7-scene"),r.appendChild(t),t}return null}function ne(e){var r,t=!0;if((e==null||(r=e.target)===null||r===void 0?void 0:r.target)instanceof HTMLElement)for(var n,i=e==null||(n=e.target)===null||n===void 0?void 0:n.target;i;){var o,s=Array.from(i.classList);if(s.includes("l7-marker")||s.includes("l7-popup")){t=!1;break}i=(o=i)===null||o===void 0?void 0:o.parentElement}return t}var R=function(e){return e[e.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",e[e.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",e[e.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.FUNC_ADD=32774]="FUNC_ADD",e[e.BLEND_EQUATION=32777]="BLEND_EQUATION",e[e.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",e[e.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",e[e.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",e[e.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",e[e.MAX_EXT=32776]="MAX_EXT",e[e.MIN_EXT=32775]="MIN_EXT",e[e.BLEND_DST_RGB=32968]="BLEND_DST_RGB",e[e.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",e[e.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",e[e.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.BLEND_COLOR=32773]="BLEND_COLOR",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",e[e.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.BUFFER_SIZE=34660]="BUFFER_SIZE",e[e.BUFFER_USAGE=34661]="BUFFER_USAGE",e[e.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK",e[e.CULL_FACE=2884]="CULL_FACE",e[e.BLEND=3042]="BLEND",e[e.DITHER=3024]="DITHER",e[e.STENCIL_TEST=2960]="STENCIL_TEST",e[e.DEPTH_TEST=2929]="DEPTH_TEST",e[e.SCISSOR_TEST=3089]="SCISSOR_TEST",e[e.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",e[e.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",e[e.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",e[e.NO_ERROR=0]="NO_ERROR",e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.CW=2304]="CW",e[e.CCW=2305]="CCW",e[e.LINE_WIDTH=2849]="LINE_WIDTH",e[e.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",e[e.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",e[e.CULL_FACE_MODE=2885]="CULL_FACE_MODE",e[e.FRONT_FACE=2886]="FRONT_FACE",e[e.DEPTH_RANGE=2928]="DEPTH_RANGE",e[e.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",e[e.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",e[e.DEPTH_FUNC=2932]="DEPTH_FUNC",e[e.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",e[e.STENCIL_FUNC=2962]="STENCIL_FUNC",e[e.STENCIL_FAIL=2964]="STENCIL_FAIL",e[e.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",e[e.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",e[e.STENCIL_REF=2967]="STENCIL_REF",e[e.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",e[e.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",e[e.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",e[e.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",e[e.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",e[e.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",e[e.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",e[e.VIEWPORT=2978]="VIEWPORT",e[e.SCISSOR_BOX=3088]="SCISSOR_BOX",e[e.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",e[e.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",e[e.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",e[e.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",e[e.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",e[e.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",e[e.RED_BITS=3410]="RED_BITS",e[e.GREEN_BITS=3411]="GREEN_BITS",e[e.BLUE_BITS=3412]="BLUE_BITS",e[e.ALPHA_BITS=3413]="ALPHA_BITS",e[e.DEPTH_BITS=3414]="DEPTH_BITS",e[e.STENCIL_BITS=3415]="STENCIL_BITS",e[e.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",e[e.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",e[e.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",e[e.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",e[e.SAMPLES=32937]="SAMPLES",e[e.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",e[e.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",e[e.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",e[e.DONT_CARE=4352]="DONT_CARE",e[e.FASTEST=4353]="FASTEST",e[e.NICEST=4354]="NICEST",e[e.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER",e[e.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",e[e.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",e[e.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",e[e.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",e[e.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",e[e.SHADER_TYPE=35663]="SHADER_TYPE",e[e.DELETE_STATUS=35712]="DELETE_STATUS",e[e.LINK_STATUS=35714]="LINK_STATUS",e[e.VALIDATE_STATUS=35715]="VALIDATE_STATUS",e[e.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",e[e.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",e[e.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",e[e.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",e[e.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP",e[e.VENDOR=7936]="VENDOR",e[e.RENDERER=7937]="RENDERER",e[e.VERSION=7938]="VERSION",e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",e[e.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",e[e.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",e[e.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",e[e.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE=5890]="TEXTURE",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",e[e.TEXTURE0=33984]="TEXTURE0",e[e.TEXTURE1=33985]="TEXTURE1",e[e.TEXTURE2=33986]="TEXTURE2",e[e.TEXTURE3=33987]="TEXTURE3",e[e.TEXTURE4=33988]="TEXTURE4",e[e.TEXTURE5=33989]="TEXTURE5",e[e.TEXTURE6=33990]="TEXTURE6",e[e.TEXTURE7=33991]="TEXTURE7",e[e.TEXTURE8=33992]="TEXTURE8",e[e.TEXTURE9=33993]="TEXTURE9",e[e.TEXTURE10=33994]="TEXTURE10",e[e.TEXTURE11=33995]="TEXTURE11",e[e.TEXTURE12=33996]="TEXTURE12",e[e.TEXTURE13=33997]="TEXTURE13",e[e.TEXTURE14=33998]="TEXTURE14",e[e.TEXTURE15=33999]="TEXTURE15",e[e.TEXTURE16=34e3]="TEXTURE16",e[e.TEXTURE17=34001]="TEXTURE17",e[e.TEXTURE18=34002]="TEXTURE18",e[e.TEXTURE19=34003]="TEXTURE19",e[e.TEXTURE20=34004]="TEXTURE20",e[e.TEXTURE21=34005]="TEXTURE21",e[e.TEXTURE22=34006]="TEXTURE22",e[e.TEXTURE23=34007]="TEXTURE23",e[e.TEXTURE24=34008]="TEXTURE24",e[e.TEXTURE25=34009]="TEXTURE25",e[e.TEXTURE26=34010]="TEXTURE26",e[e.TEXTURE27=34011]="TEXTURE27",e[e.TEXTURE28=34012]="TEXTURE28",e[e.TEXTURE29=34013]="TEXTURE29",e[e.TEXTURE30=34014]="TEXTURE30",e[e.TEXTURE31=34015]="TEXTURE31",e[e.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",e[e.REPEAT=10497]="REPEAT",e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",e[e.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",e[e.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",e[e.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",e[e.COMPILE_STATUS=35713]="COMPILE_STATUS",e[e.LOW_FLOAT=36336]="LOW_FLOAT",e[e.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",e[e.HIGH_FLOAT=36338]="HIGH_FLOAT",e[e.LOW_INT=36339]="LOW_INT",e[e.MEDIUM_INT=36340]="MEDIUM_INT",e[e.HIGH_INT=36341]="HIGH_INT",e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.RENDERBUFFER=36161]="RENDERBUFFER",e[e.RGBA4=32854]="RGBA4",e[e.RGB5_A1=32855]="RGB5_A1",e[e.RGB565=36194]="RGB565",e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.STENCIL_INDEX=6401]="STENCIL_INDEX",e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e[e.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",e[e.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",e[e.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",e[e.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",e[e.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",e[e.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",e[e.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",e[e.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",e[e.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",e[e.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",e[e.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",e[e.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",e[e.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",e[e.NONE=0]="NONE",e[e.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",e[e.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",e[e.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",e[e.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",e[e.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",e}({}),Pe,Be,rt,Ge,St,Ft,Yt,qt,dr,Lr,Xr,Bn,cn,Vn=(Pe=(0,yt.b2)(),Be=(0,yt.f3)(ot.IMapService),rt=(0,yt.f3)(ot.IRendererService),Ge=(0,yt.f3)(ot.IGlobalConfigService),St=(0,yt.f3)(ot.IInteractionService),Ft=(0,yt.f3)(ot.ILayerService),Pe(Yt=(qt=function(){function e(){var r=this;(0,Q.Z)(this,e),(0,B.Z)(this,"pickedColors",void 0),(0,B.Z)(this,"pickedTileLayers",[]),Ni(this,"mapService",dr,this),Ni(this,"rendererService",Lr,this),Ni(this,"configService",Xr,this),Ni(this,"interactionService",Bn,this),Ni(this,"layerService",cn,this),(0,B.Z)(this,"pickingFBO",void 0),(0,B.Z)(this,"width",0),(0,B.Z)(this,"height",0),(0,B.Z)(this,"alreadyInPicking",!1),(0,B.Z)(this,"pickBufferScale",1),(0,B.Z)(this,"pickFromPickingFBO",function(t,n){var i=n.x,o=n.y,s=n.lngLat,l=n.type,f=n.target,v=!1,y=r.rendererService,b=y.readPixels,T=y.getContainer,M=r.getContainerSize(T()),O=M.width,F=M.height;O*=wa,F*=wa;var $=t.getLayerConfig(),G=$.enableHighlight,ue=$.enableSelect,xe=i*wa,ze=o*wa;if(xe>O-1*wa||xe<0||ze>F-1*wa||ze<0)return!1;var Je=b({x:Math.floor(xe/r.pickBufferScale),y:Math.floor((F-(o+1)*wa)/r.pickBufferScale),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:r.pickingFBO});if(r.pickedColors=Je,Je[0]!==0||Je[1]!==0||Je[2]!==0){var ht=Oa(Je),gt=t.layerPickService.getFeatureById(ht);ht!==t.getCurrentPickId()&&l==="mousemove"&&(l="mouseenter");var Ot={x:i,y:o,type:l,lngLat:s,featureId:ht,feature:gt,target:f};gt&&(v=!0,t.setCurrentPickId(ht),r.triggerHoverOnLayer(t,Ot))}else{var tr={x:i,y:o,lngLat:s,type:t.getCurrentPickId()!==null&&l==="mousemove"?"mouseout":"un"+l,featureId:null,target:f,feature:null};r.triggerHoverOnLayer(t,(0,V.Z)((0,V.Z)({},tr),{},{type:"unpick"})),r.triggerHoverOnLayer(t,tr),t.setCurrentPickId(null)}if(G&&t.layerPickService.highlightPickedFeature(Je),ue&&l==="click"&&(Je==null?void 0:Je.toString())!==[0,0,0,0].toString()){var Ir=Oa(Je);t.getCurrentSelectedId()===null||Ir!==t.getCurrentSelectedId()?(t.layerPickService.selectFeature(Je),t.setCurrentSelectedId(Ir)):(t.layerPickService.selectFeature(new Uint8Array([0,0,0,0])),t.setCurrentSelectedId(null))}return v})}return(0,j.Z)(e,[{key:"init",value:function(t){var n=this.rendererService,i=n.createTexture2D,o=n.createFramebuffer,s=n.getContainer,l=this.getContainerSize(s()),f=l.width,v=l.height;f*=wa,v*=wa,this.pickBufferScale=this.configService.getSceneConfig(t).pickBufferScale||1,this.pickingFBO=o({color:i({width:Math.round(f/this.pickBufferScale),height:Math.round(v/this.pickBufferScale),wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE})}),this.interactionService.on(a.Hover,this.pickingAllLayer.bind(this))}},{key:"boxPickLayer",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o,s){var l=this,f,v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:f=this.rendererService,v=f.useFramebuffer,y=f.clear,this.resizePickingFBO(),v(this.pickingFBO,function(){y({framebuffer:l.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),i.hooks.beforePickingEncode.call(),i.renderModels({ispick:!0}),i.hooks.afterPickingEncode.call();var M=l.pickBox(i,o);s(M)});case 3:case"end":return T.stop()}},n,this)}));function t(n,i,o){return r.apply(this,arguments)}return t}()},{key:"pickBox",value:function(t,n){var i=this,o=n.map(function(Ir){var Er=Ir<0?0:Ir;return Math.floor(Er*wa/i.pickBufferScale)}),s=(0,Sn.Z)(o,4),l=s[0],f=s[1],v=s[2],y=s[3],b=this.rendererService,T=b.readPixels,M=b.getContainer,O=this.getContainerSize(M()),F=O.width,$=O.height;if(F*=wa,$*=wa,l>(F-1)*wa/this.pickBufferScale||v<0||f>($-1)*wa/this.pickBufferScale||y<0)return[];for(var G=Math.min(F/this.pickBufferScale,v)-l,ue=Math.min($/this.pickBufferScale,y)-f,xe=T({x:l,y:Math.floor($/this.pickBufferScale-(y+1)),width:G,height:ue,data:new Uint8Array(G*ue*4),framebuffer:this.pickingFBO}),ze=[],Je={},ht=0;ht<xe.length/4;ht=ht+1){var gt=xe.slice(ht*4,ht*4+4),Ot=Oa(gt);if(Ot!==-1&&!Je[Ot]){var tr=t.layerPickService.getFeatureById(Ot);ze.push((0,V.Z)((0,V.Z)({},tr),{},{pickedFeatureIdx:Ot})),Je[Ot]=!0}}return ze}},{key:"handleCursor",value:function(t,n){var i=t.getLayerConfig(),o=i.cursor,s=o===void 0?"":o,l=i.cursorEnabled;if(l){var f=this.mapService.version,v=f==="GAODE2.x"?this.mapService.getMapContainer():this.mapService.getMarkerContainer(),y=v==null?void 0:v.style.getPropertyValue("cursor");n==="unmousemove"&&y!==""?v==null||v.style.setProperty("cursor",""):n==="mousemove"&&(v==null||v.style.setProperty("cursor",s))}}},{key:"destroy",value:function(){this.pickingFBO.destroy(),this.pickingFBO=null}},{key:"getContainerSize",value:function(t){return t.getContext?{width:t.width/wa,height:t.height/wa}:t.getBoundingClientRect()}},{key:"pickingAllLayer",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i){return ge().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!(!this.layerService.needPick(i.type)||!this.isPickingAllLayer())){s.next=2;break}return s.abrupt("return");case 2:return this.alreadyInPicking=!0,s.next=5,this.pickingLayers(i);case 5:this.layerService.renderLayers(),this.alreadyInPicking=!1;case 7:case"end":return s.stop()}},n,this)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"isPickingAllLayer",value:function(){return!(this.alreadyInPicking||this.layerService.alreadyInRendering||this.interactionService.indragging||!this.layerService.getShaderPickStat())}},{key:"resizePickingFBO",value:function(){var t=this.rendererService.getContainer,n=this.getContainerSize(t()),i=n.width,o=n.height;i*=wa,o*=wa,(this.width!==i||this.height!==o)&&(this.pickingFBO.resize({width:Math.round(i/this.pickBufferScale),height:Math.round(o/this.pickBufferScale)}),this.width=i,this.height=o)}},{key:"pickingLayers",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i){var o=this,s,l,f;return ge().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:s=this.rendererService,l=s.useFramebuffer,f=s.clear,this.resizePickingFBO(),l(this.pickingFBO,function(){var b=o.layerService.getRenderList();b.filter(function(T){return T.needPick(i.type)}).reverse().some(function(T){f({framebuffer:o.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),T.layerPickService.pickRender(i);var M=o.pickFromPickingFBO(T,i);return o.layerService.pickedLayerId=M?+T.id:-1,M&&!T.getLayerConfig().enablePropagation})});case 3:case"end":return y.stop()}},n,this)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"triggerHoverOnLayer",value:function(t,n){ne(n)&&(this.handleCursor(t,n.type),t.emit(n.type,n))}}]),e}(),dr=ki(qt.prototype,"mapService",[Be],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Lr=ki(qt.prototype,"rendererService",[rt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xr=ki(qt.prototype,"configService",[Ge],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Bn=ki(qt.prototype,"interactionService",[St],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),cn=ki(qt.prototype,"layerService",[Ft],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qt))||Yt),pn=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;(0,Q.Z)(this,e),(0,B.Z)(this,"autoStart",void 0),(0,B.Z)(this,"startTime",0),(0,B.Z)(this,"oldTime",0),(0,B.Z)(this,"running",!1),(0,B.Z)(this,"elapsedTime",0),this.autoStart=r}return(0,j.Z)(e,[{key:"start",value:function(){this.startTime=(typeof performance=="undefined"?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}},{key:"stop",value:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}},{key:"getElapsedTime",value:function(){return this.getDelta(),this.elapsedTime}},{key:"getDelta",value:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var n=(typeof performance=="undefined"?Date:performance).now();t=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=t}return t}}]),e}(),Ei,ti,Rn,Di,gi,Ui,jn,ia,za;function eo(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=uo(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function uo(e,r){if(e){if(typeof e=="string")return Za(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Za(e,r)}}function Za(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ho(e){var r=Go();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function Go(){if(typeof Reflect=="undefined"||!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(e){return!1}}var Uo=oi.throttle,Vs=(Ei=(0,yt.b2)(),ti=(0,yt.f3)(ot.IRendererService),Rn=(0,yt.f3)(ot.IMapService),Di=(0,yt.f3)(ot.IDebugService),Ei(gi=(Ui=function(e){(0,Le.Z)(t,e);var r=ho(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"pickedLayerId",-1),(0,B.Z)((0,Fe.Z)(n),"clock",new pn),(0,B.Z)((0,Fe.Z)(n),"alreadyInRendering",!1),(0,B.Z)((0,Fe.Z)(n),"layers",[]),(0,B.Z)((0,Fe.Z)(n),"layerList",[]),(0,B.Z)((0,Fe.Z)(n),"layerRenderID",void 0),(0,B.Z)((0,Fe.Z)(n),"sceneInited",!1),(0,B.Z)((0,Fe.Z)(n),"animateInstanceCount",0),(0,B.Z)((0,Fe.Z)(n),"shaderPicking",!0),(0,B.Z)((0,Fe.Z)(n),"enableRender",!0),Ni((0,Fe.Z)(n),"renderService",jn,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"mapService",ia,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"debugService",za,(0,Fe.Z)(n)),(0,B.Z)((0,Fe.Z)(n),"reRender",Uo(function(){n.renderLayers()},32)),(0,B.Z)((0,Fe.Z)(n),"throttleRenderLayers",Uo(function(){n.renderLayers()},16)),n}return(0,j.Z)(t,[{key:"needPick",value:function(i){return this.layerList.some(function(o){return o.needPick(i)})}},{key:"add",value:function(i){var o=this;this.layers.push(i),this.sceneInited&&i.init().then(function(){o.renderLayers()})}},{key:"addMask",value:function(i){var o=this;this.sceneInited&&i.init().then(function(){o.renderLayers()})}},{key:"initLayers",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s=this;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:this.sceneInited=!0,this.layers.forEach(function(){var v=(0,Pt.Z)(ge().mark(function y(b){return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(b.startInit){M.next=4;break}return M.next=3,b.init();case 3:s.updateLayerRenderList();case 4:case"end":return M.stop()}},y)}));return function(y){return v.apply(this,arguments)}}());case 2:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSceneInited",value:function(){return this.sceneInited}},{key:"getRenderList",value:function(){return this.layerList}},{key:"getLayers",value:function(){return this.layers}},{key:"getLayer",value:function(i){return this.layers.find(function(o){return o.id===i})}},{key:"getLayerByName",value:function(i){return this.layers.find(function(o){return o.name===i})}},{key:"remove",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s,l){var f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:l?(f=l.layerChildren.indexOf(s),f>-1&&l.layerChildren.splice(f,1)):(v=this.layers.indexOf(s),v>-1&&this.layers.splice(v,1)),s.destroy(),this.reRender(),this.emit("layerChange",this.layers);case 4:case"end":return b.stop()}},o,this)}));function i(o,s){return n.apply(this,arguments)}return i}()},{key:"removeAllLayers",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:this.destroy(),this.reRender();case 2:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"setEnableRender",value:function(i){this.enableRender=i}},{key:"renderLayers",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b;return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(!(this.alreadyInRendering||!this.enableRender)){M.next=2;break}return M.abrupt("return");case 2:this.updateLayerRenderList(),s=this.debugService.generateRenderUid(),this.debugService.renderStart(s),this.alreadyInRendering=!0,this.clear(),this.renderService.beginFrame(),l=eo(this.layerList),M.prev=9,l.s();case 11:if((f=l.n()).done){M.next=24;break}if(v=f.value,y=v.getLayerConfig(),b=y.enableMask,v.masks.filter(function(O){return O.inited}).length>0&&b&&this.renderMask(v.masks),!v.getLayerConfig().enableMultiPassRenderer){M.next=20;break}return M.next=18,v.renderMultiPass();case 18:M.next=22;break;case 20:return M.next=22,v.render();case 22:M.next=11;break;case 24:M.next=29;break;case 26:M.prev=26,M.t0=M.catch(9),l.e(M.t0);case 29:return M.prev=29,l.f(),M.finish(29);case 32:this.renderService.endFrame(),this.debugService.renderEnd(s),this.alreadyInRendering=!1;case 35:case"end":return M.stop()}},o,this,[[9,26,29,32]])}));function i(){return n.apply(this,arguments)}return i}()},{key:"renderMask",value:function(i){var o=0;this.renderService.clear({stencil:0,depth:1,framebuffer:null});var s=i.length>1?hc.MULTIPLE:hc.SINGLE,l=eo(i),f;try{for(l.s();!(f=l.n()).done;){var v=f.value;v.render({isStencil:!0,stencilType:s,stencilIndex:o++})}}catch(y){l.e(y)}finally{l.f()}}},{key:"beforeRenderData",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,s.hooks.beforeRenderData.promise();case 2:l=v.sent,l&&this.renderLayers();case 4:case"end":return v.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"renderTileLayerMask",value:function(i){var o=0,s=i.getLayerConfig(),l=s.enableMask,f=l===void 0?!0:l,v=i.tileMask?1:0,y=i.masks.filter(function(F){return F.inited});v=v+(f?y.length:1);var b=v>1?hc.MULTIPLE:hc.SINGLE;if((i.tileMask||y.length&&f)&&this.renderService.clear({stencil:0,depth:1,framebuffer:null}),y.length&&f){var T=eo(y),M;try{for(T.s();!(M=T.n()).done;){var O=M.value;O.render({isStencil:!0,stencilType:b,stencilIndex:o++})}}catch(F){T.e(F)}finally{T.f()}}i.tileMask&&i.tileMask.render({isStencil:!0,stencilType:b,stencilIndex:o++,stencilOperation:Qp.OR})}},{key:"renderTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.renderTileLayerMask(s),!s.getLayerConfig().enableMultiPassRenderer){f.next=6;break}return f.next=4,s.renderMultiPass();case 4:f.next=8;break;case 6:return f.next=8,s.render();case 8:case"end":return f.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"updateLayerRenderList",value:function(){var i=this;this.layerList=[],this.layers.filter(function(o){return o.inited}).filter(function(o){return o.isVisible()}).sort(function(o,s){return o.zIndex-s.zIndex}).forEach(function(o){i.layerList.push(o)})}},{key:"destroy",value:function(){this.layers.forEach(function(i){i.destroy()}),this.layers=[],this.layerList=[],this.emit("layerChange",this.layers)}},{key:"startAnimate",value:function(){this.animateInstanceCount++===0&&(this.clock.start(),this.runRender())}},{key:"stopAnimate",value:function(){--this.animateInstanceCount===0&&(this.stopRender(),this.clock.stop())}},{key:"getOESTextureFloat",value:function(){return this.renderService.extensionObject.OES_texture_float}},{key:"enableShaderPick",value:function(){this.shaderPicking=!0}},{key:"disableShaderPick",value:function(){this.shaderPicking=!1}},{key:"getShaderPickStat",value:function(){return this.shaderPicking}},{key:"clear",value:function(){var i=fi(this.mapService.bgColor);this.renderService.clear({color:i,depth:1,stencil:0,framebuffer:null})}},{key:"runRender",value:function(){this.renderLayers(),this.layerRenderID=window.requestAnimationFrame(this.runRender.bind(this))}},{key:"stopRender",value:function(){window.cancelAnimationFrame(this.layerRenderID)}}]),t}(io.EventEmitter),jn=ki(Ui.prototype,"renderService",[ti],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ia=ki(Ui.prototype,"mapService",[Rn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),za=ki(Ui.prototype,"debugService",[Di],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ui))||gi),ka=L(98787),js=oi.isNil,So=function(){function e(r){var t=this;(0,Q.Z)(this,e),(0,B.Z)(this,"name",void 0),(0,B.Z)(this,"type",void 0),(0,B.Z)(this,"scale",void 0),(0,B.Z)(this,"descriptor",void 0),(0,B.Z)(this,"featureBufferLayout",[]),(0,B.Z)(this,"needRescale",!1),(0,B.Z)(this,"needRemapping",!1),(0,B.Z)(this,"needRegenerateVertices",!1),(0,B.Z)(this,"featureRange",{startIndex:0,endIndex:1/0}),(0,B.Z)(this,"vertexAttribute",void 0),(0,B.Z)(this,"defaultCallback",function(n){if(n.length===0){var i;return((i=t.scale)===null||i===void 0?void 0:i.defaultValues)||[]}return n.map(function(o,s){var l,f=(l=t.scale)===null||l===void 0?void 0:l.scalers[s].func,v=f(o);return v})}),this.setProps(r)}return(0,j.Z)(e,[{key:"setProps",value:function(t){Object.assign(this,t)}},{key:"mapping",value:function(t){var n;if((n=this.scale)!==null&&n!==void 0&&n.callback){var i,o=(i=this.scale)===null||i===void 0?void 0:i.callback.apply(i,(0,Kt.Z)(t));if(!js(o))return[o]}return this.defaultCallback(t)}},{key:"resetDescriptor",value:function(){this.descriptor&&(this.descriptor.buffer.data=[])}}]),e}(),rs=["buffer","update","name"],ji=["buffer","update","name"],fa,va,$i,Hs,ns,Ba,Oo=(fa={},(0,B.Z)(fa,R.FLOAT,4),(0,B.Z)(fa,R.UNSIGNED_BYTE,1),(0,B.Z)(fa,R.UNSIGNED_SHORT,2),fa),ws=(va=(0,yt.b2)(),$i=(0,yt.f3)(ot.IRendererService),va(Hs=(ns=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"attributesAndIndices",void 0),Ni(this,"rendererService",Ba,this),(0,B.Z)(this,"attributes",[]),(0,B.Z)(this,"triangulation",void 0),(0,B.Z)(this,"featureLayout",{sizePerElement:0,elements:[]})}return(0,j.Z)(e,[{key:"registerStyleAttribute",value:function(t){var n=this.getLayerStyleAttribute(t.name||"");return n?n.setProps(t):(n=new So(t),this.attributes.push(n)),n}},{key:"unRegisterStyleAttribute",value:function(t){var n=this.attributes.findIndex(function(i){return i.name===t});n>-1&&this.attributes.splice(n,1)}},{key:"updateScaleAttribute",value:function(t){this.attributes.forEach(function(n){var i,o=n.name,s=(i=n.scale)===null||i===void 0?void 0:i.field;(t[o]||s&&t[s])&&(n.needRescale=!0,n.needRemapping=!0,n.needRegenerateVertices=!0)})}},{key:"updateStyleAttribute",value:function(t,n,i){var o=this.getLayerStyleAttribute(t);o||(o=this.registerStyleAttribute((0,V.Z)((0,V.Z)({},n),{},{name:t})));var s=n.scale;s&&o&&(o.scale=s,o.needRescale=!0,o.needRemapping=!0,o.needRegenerateVertices=!0,i&&i.featureRange&&(o.featureRange=i.featureRange))}},{key:"getLayerStyleAttributes",value:function(){return this.attributes}},{key:"getLayerStyleAttribute",value:function(t){return this.attributes.find(function(n){return n.name===t})}},{key:"getLayerAttributeScale",value:function(t){var n,i=this.getLayerStyleAttribute(t),o=i==null||(n=i.scale)===null||n===void 0?void 0:n.scalers;return o&&o[0]?o[0].func:null}},{key:"updateAttributeByFeatureRange",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,l=this.attributes.find(function(Je){return Je.name===t});if(l&&l.descriptor){var f=l.descriptor,v=f.update,y=f.buffer,b=f.size,T=b===void 0?0:b,M=Oo[y.type||R.FLOAT];if(v){var O=this.featureLayout,F=O.elements,$=O.sizePerElement,G=F.slice(i,o);if(!G.length)return;var ue=G[0].offset,xe=ue*T*M,ze=G.map(function(Je,ht){for(var gt=Je.featureIdx,Ot=Je.vertices,tr=Je.normals,Ir=Ot.length/$,Er=[],mn=0;mn<Ir;mn++){var Ln=tr?tr.slice(mn*3,mn*3+3):[];Er.push.apply(Er,(0,Kt.Z)(v(n[gt],gt,Ot.slice(mn*$,mn*$+$),ht,Ln)))}return Er}).reduce(function(Je,ht){return Je.push.apply(Je,(0,Kt.Z)(ht)),Je},[]);l.vertexAttribute.updateBuffer({data:ze,offset:xe}),s==null||s.emit("legend:".concat(t),{type:t,attr:l})}}}},{key:"createAttributesAndIndices",value:function(t,n,i){var o=this;this.featureLayout={sizePerElement:0,elements:[]},n&&(this.triangulation=n);var s=this.attributes.map(function(G){return G.resetDescriptor(),G.descriptor}),l=0,f=0,v=[],y=3;t.forEach(function(G,ue){var xe=o.triangulation(G,i),ze=xe.indices,Je=xe.vertices,ht=xe.normals,gt=xe.size,Ot=xe.indexes,tr=xe.count;typeof tr=="number"&&(f+=tr),ze.forEach(function(Ln){v.push(Ln+l)}),y=gt;var Ir=Je.length/gt;o.featureLayout.sizePerElement=y,o.featureLayout.elements.push({featureIdx:ue,vertices:Je,normals:ht,offset:l}),l+=Ir;for(var Er=function(Fi){var xa=(ht==null?void 0:ht.slice(Fi*3,Fi*3+3))||[],is=Je.slice(Fi*gt,Fi*gt+gt),_s=0;Ot&&Ot[Fi]!==void 0&&(_s=Ot[Fi]),s.forEach(function(as,lu){if(as&&as.update){var Ac;(Ac=as.buffer.data).push.apply(Ac,(0,Kt.Z)(as.update(G,ue,is,Fi,xa,_s)))}})},mn=0;mn<Ir;mn++)Er(mn)});var b=this.rendererService,T=b.createAttribute,M=b.createBuffer,O=b.createElements,F={};s.forEach(function(G,ue){if(G){var xe=G.buffer,ze=G.update,Je=G.name,ht=(0,ka.Z)(G,rs),gt=T((0,V.Z)({buffer:M(xe)},ht));F[G.name||""]=gt,o.attributes[ue].vertexAttribute=gt}});var $=O({data:v,type:R.UNSIGNED_INT,count:v.length});return this.attributesAndIndices={attributes:F,elements:$,count:f},this.attributesAndIndices}},{key:"createAttributes",value:function(t,n){var i=this;this.featureLayout={sizePerElement:0,elements:[]},n&&(this.triangulation=n);var o=this.attributes.map(function(M){return M.resetDescriptor(),M.descriptor}),s=0,l=[],f=3;t.forEach(function(M,O){var F=i.triangulation(M),$=F.indices,G=F.vertices,ue=F.normals,xe=F.size,ze=F.indexes;$.forEach(function(Ot){l.push(Ot+s)}),f=xe;var Je=G.length/xe;i.featureLayout.sizePerElement=f,i.featureLayout.elements.push({featureIdx:O,vertices:G,normals:ue,offset:s}),s+=Je;for(var ht=function(tr){var Ir=(ue==null?void 0:ue.slice(tr*3,tr*3+3))||[],Er=G.slice(tr*xe,tr*xe+xe),mn=0;ze&&ze[tr]!==void 0&&(mn=ze[tr]),o.forEach(function(Ln,Fi){if(Ln&&Ln.update){var xa;(xa=Ln.buffer.data).push.apply(xa,(0,Kt.Z)(Ln.update(M,O,Er,tr,Ir,mn)))}})},gt=0;gt<Je;gt++)ht(gt)});var v=this.rendererService,y=v.createAttribute,b=v.createBuffer,T={};return o.forEach(function(M,O){if(M){var F=M.buffer,$=M.update,G=M.name,ue=(0,ka.Z)(M,ji),xe=y((0,V.Z)({buffer:b(F)},ue));T[M.name||""]=xe,i.attributes[O].vertexAttribute=xe}}),{attributes:T}}},{key:"clearAllAttributes",value:function(){var t;this.attributes.forEach(function(n){n.vertexAttribute&&n.vertexAttribute.destroy()}),(t=this.attributesAndIndices)===null||t===void 0||t.elements.destroy(),this.attributes=[]}}]),e}(),Ba=ki(ns.prototype,"rendererService",[$i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ns))||Hs),Ki=L(93738);function Zl(e,r,t,n){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function l(y){try{v(n.next(y))}catch(b){s(b)}}function f(y){try{v(n.throw(y))}catch(b){s(b)}}function v(y){y.done?o(y.value):i(y.value).then(l,f)}v((n=n.apply(e,r||[])).next())})}function su(e,r){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(v){return function(y){return f([v,y])}}function f(v){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=v[0]&2?i.return:v[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,v[1])).done)return o;switch(i=0,o&&(v=[v[0]&2,o.value]),v[0]){case 0:case 1:o=v;break;case 4:return t.label++,{value:v[1],done:!1};case 5:t.label++,i=v[1],v=[0];continue;case 7:v=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!o||v[1]>o[0]&&v[1]<o[3])){t.label=v[1];break}if(v[0]===6&&t.label<o[1]){t.label=o[1],o=v;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(v);break}o[2]&&t.ops.pop(),t.trys.pop();continue}v=r.call(e,t)}catch(y){v=[6,y],i=0}finally{n=o=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}}function vl(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var n=t.call(e),i,o=[],s;try{for(;(r===void 0||r-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return o}function to(e,r,t){if(t||arguments.length===2)for(var n=0,i=r.length,o;n<i;n++)(o||!(n in r))&&(o||(o=Array.prototype.slice.call(r,0,n)),o[n]=r[n]);return e.concat(o||Array.prototype.slice.call(r))}function Vl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $u={exports:{}},Ef={exports:{}},pc={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=t;function t(n){return n&&typeof n.length=="number"&&n.length>=0&&n.length%1===0}e.exports=r.default})(pc,pc.exports);var Cs={},dc={exports:{}},Jf={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];var o=n.pop();return t.call(this,n,o)}},e.exports=r.default})(Jf,Jf.exports);var vc={};Object.defineProperty(vc,"__esModule",{value:!0}),vc.fallback=td,vc.wrap=Hc;var Ep=vc.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,ed=vc.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,Xd=vc.hasNextTick=typeof Ki=="object"&&typeof Ki.nextTick=="function";function td(e){setTimeout(e,0)}function Hc(e){return function(r){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return e(function(){return r.apply(void 0,t)})}}var Sf;Ep?Sf=queueMicrotask:ed?Sf=setImmediate:Xd?Sf=Ki.nextTick:Sf=td,vc.default=Hc(Sf),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=f;var t=Jf.exports,n=l(t),i=vc,o=l(i),s=Cs;function l(b){return b&&b.__esModule?b:{default:b}}function f(b){return(0,s.isAsync)(b)?function(){for(var T=[],M=arguments.length;M--;)T[M]=arguments[M];var O=T.pop(),F=b.apply(this,T);return v(F,O)}:(0,n.default)(function(T,M){var O;try{O=b.apply(this,T)}catch(F){return M(F)}if(O&&typeof O.then=="function")return v(O,M);M(null,O)})}function v(b,T){return b.then(function(M){y(T,null,M)},function(M){y(T,M&&M.message?M:new Error(M))})}function y(b,T,M){try{b(T,M)}catch(O){(0,o.default)(function(F){throw F},O)}}e.exports=r.default}(dc,dc.exports),Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.isAsyncIterable=Cs.isAsyncGenerator=Cs.isAsync=void 0;var Sp=dc.exports,eh=Ap(Sp);function Ap(e){return e&&e.__esModule?e:{default:e}}function rd(e){return e[Symbol.toStringTag]==="AsyncFunction"}function $d(e){return e[Symbol.toStringTag]==="AsyncGenerator"}function nd(e){return typeof e[Symbol.asyncIterator]=="function"}function id(e){if(typeof e!="function")throw new Error("expected a function");return rd(e)?(0,eh.default)(e):e}Cs.default=id,Cs.isAsync=rd,Cs.isAsyncGenerator=$d,Cs.isAsyncIterable=nd;var Wc={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=t;function t(n,i){if(i===void 0&&(i=n.length),!i)throw new Error("arity is undefined");function o(){for(var s=this,l=[],f=arguments.length;f--;)l[f]=arguments[f];return typeof l[i-1]=="function"?n.apply(this,l):new Promise(function(v,y){l[i-1]=function(b){for(var T=[],M=arguments.length-1;M-- >0;)T[M]=arguments[M+1];if(b)return y(b);v(T.length>1?T:T[0])},n.apply(s,l)})}return o}e.exports=r.default})(Wc,Wc.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=pc.exports,n=f(t),i=Cs,o=f(i),s=Wc.exports,l=f(s);function f(v){return v&&v.__esModule?v:{default:v}}r.default=(0,l.default)(function(v,y,b){var T=(0,n.default)(y)?[]:{};v(y,function(M,O,F){(0,o.default)(M)(function($){for(var G,ue=[],xe=arguments.length-1;xe-- >0;)ue[xe]=arguments[xe+1];ue.length<2&&(G=ue,ue=G[0]),T[O]=ue,F($)})},function(M){return b(M,T)})},3),e.exports=r.default}(Ef,Ef.exports);var kh={exports:{}},th={exports:{}},Bh={exports:{}},rh={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=t;function t(n){function i(){for(var o=[],s=arguments.length;s--;)o[s]=arguments[s];if(n!==null){var l=n;n=null,l.apply(this,o)}}return Object.assign(i,n),i}e.exports=r.default})(rh,rh.exports);var nh={exports:{}},Tp={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()},e.exports=r.default})(Tp,Tp.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=y;var t=pc.exports,n=s(t),i=Tp.exports,o=s(i);function s(b){return b&&b.__esModule?b:{default:b}}function l(b){var T=-1,M=b.length;return function(){return++T<M?{value:b[T],key:T}:null}}function f(b){var T=-1;return function(){var O=b.next();return O.done?null:(T++,{value:O.value,key:T})}}function v(b){var T=b?Object.keys(b):[],M=-1,O=T.length;return function F(){var $=T[++M];return $==="__proto__"?F():M<O?{value:b[$],key:$}:null}}function y(b){if((0,n.default)(b))return l(b);var T=(0,o.default)(b);return T?f(T):v(b)}e.exports=r.default}(nh,nh.exports);var Gc={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=t;function t(n){return function(){for(var i=[],o=arguments.length;o--;)i[o]=arguments[o];if(n===null)throw new Error("Callback was already called.");var s=n;n=null,s.apply(this,i)}}e.exports=r.default})(Gc,Gc.exports);var Lh={exports:{}},mc={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t={};r.default=t,e.exports=r.default})(mc,mc.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=o;var t=mc.exports,n=i(t);function i(s){return s&&s.__esModule?s:{default:s}}function o(s,l,f,v){var y=!1,b=!1,T=!1,M=0,O=0;function F(){M>=l||T||y||(T=!0,s.next().then(function(ue){var xe=ue.value,ze=ue.done;if(!(b||y)){if(T=!1,ze){y=!0,M<=0&&v(null);return}M++,f(xe,O,$),O++,F()}}).catch(G))}function $(ue,xe){if(M-=1,!b){if(ue)return G(ue);if(ue===!1){y=!0,b=!0;return}if(xe===n.default||y&&M<=0)return y=!0,v(null);F()}}function G(ue){b||(T=!1,y=!0,v(ue))}F()}e.exports=r.default}(Lh,Lh.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=rh.exports,n=M(t),i=nh.exports,o=M(i),s=Gc.exports,l=M(s),f=Cs,v=Lh.exports,y=M(v),b=mc.exports,T=M(b);function M(O){return O&&O.__esModule?O:{default:O}}r.default=function(O){return function(F,$,G){if(G=(0,n.default)(G),O<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!F)return G(null);if((0,f.isAsyncGenerator)(F))return(0,y.default)(F,O,$,G);if((0,f.isAsyncIterable)(F))return(0,y.default)(F[Symbol.asyncIterator](),O,$,G);var ue=(0,o.default)(F),xe=!1,ze=!1,Je=0,ht=!1;function gt(tr,Ir){if(!ze)if(Je-=1,tr)xe=!0,G(tr);else if(tr===!1)xe=!0,ze=!0;else{if(Ir===T.default||xe&&Je<=0)return xe=!0,G(null);ht||Ot()}}function Ot(){for(ht=!0;Je<O&&!xe;){var tr=ue();if(tr===null){xe=!0,Je<=0&&G(null);return}Je+=1,$(tr.value,tr.key,(0,l.default)(gt))}ht=!1}Ot()}},e.exports=r.default}(Bh,Bh.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=Bh.exports,n=f(t),i=Cs,o=f(i),s=Wc.exports,l=f(s);function f(y){return y&&y.__esModule?y:{default:y}}function v(y,b,T,M){return(0,n.default)(b)(y,(0,o.default)(T),M)}r.default=(0,l.default)(v,4),e.exports=r.default}(th,th.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=th.exports,n=s(t),i=Wc.exports,o=s(i);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,v,y){return(0,n.default)(f,1,v,y)}r.default=(0,o.default)(l,3),e.exports=r.default}(kh,kh.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=l;var t=Ef.exports,n=s(t),i=kh.exports,o=s(i);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,v){return(0,n.default)(o.default,f,v)}e.exports=r.default}($u,$u.exports);var ih=Vl($u.exports),xu=function(){function e(){this.args=[],this.tasks=[]}return e.prototype.call=function(){for(var r=arguments,t=[],n=0;n<arguments.length;n++)t[n]=r[n];return this.args=t,ih(this.tasks)},e.prototype.tap=function(r,t){var n=this;this.tasks.push(function(i){t.apply(void 0,to([],vl(n.args),!1)),i(null,r)})},e}(),ad={exports:{}},Yd={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=pc.exports,n=$(t),i=mc.exports,o=$(i),s=th.exports,l=$(s),f=rh.exports,v=$(f),y=Gc.exports,b=$(y),T=Cs,M=$(T),O=Wc.exports,F=$(O);function $(ze){return ze&&ze.__esModule?ze:{default:ze}}function G(ze,Je,ht){ht=(0,v.default)(ht);var gt=0,Ot=0,tr=ze.length,Ir=!1;tr===0&&ht(null);function Er(mn,Ln){mn===!1&&(Ir=!0),Ir!==!0&&(mn?ht(mn):(++Ot===tr||Ln===o.default)&&ht(null))}for(;gt<tr;gt++)Je(ze[gt],gt,(0,b.default)(Er))}function ue(ze,Je,ht){return(0,l.default)(ze,1/0,Je,ht)}function xe(ze,Je,ht){var gt=(0,n.default)(ze)?G:ue;return gt(ze,(0,M.default)(Je),ht)}r.default=(0,F.default)(xe,3),e.exports=r.default})(Yd,Yd.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=l;var t=Yd.exports,n=s(t),i=Ef.exports,o=s(i);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,v){return(0,o.default)(n.default,f,v)}e.exports=r.default}(ad,ad.exports);var Hv=Vl(ad.exports),S0=function(){function e(){this.tasks=[]}return e.prototype.promise=function(){return Hv(this.tasks)},e.prototype.tapPromise=function(r,t){var n=this;this.tasks.push(function(i){return Zl(n,void 0,void 0,function(){return su(this,function(o){switch(o.label){case 0:return[4,t()];case 1:return o.sent(),i(null,r),[2]}})})})},e}(),od={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=rh.exports,n=y(t),i=Gc.exports,o=y(i),s=Cs,l=y(s),f=Wc.exports,v=y(f);function y(T){return T&&T.__esModule?T:{default:T}}function b(T,M){if(M=(0,n.default)(M),!Array.isArray(T))return M(new Error("First argument to waterfall must be an array of functions"));if(!T.length)return M();var O=0;function F(G){var ue=(0,l.default)(T[O++]);ue.apply(void 0,G.concat([(0,o.default)($)]))}function $(G){for(var ue=[],xe=arguments.length-1;xe-- >0;)ue[xe]=arguments[xe+1];if(G!==!1){if(G||O===T.length)return M.apply(void 0,[G].concat(ue));F(ue)}}F([])}r.default=(0,v.default)(b),e.exports=r.default})(od,od.exports);var ig=Vl(od.exports),qd=function(){function e(){this.tasks=[]}return e.prototype.call=function(){return ig(this.tasks)},e.prototype.tap=function(r,t){this.tasks.length===0?this.tasks.push(function(n){var i=t();n(i?null:!1,i)}):this.tasks.push(function(n,i){var o=t.apply(void 0,to([],vl(n),!1));i(o?null:!1,r)})},e}(),po=function(){function e(){this.tasks=[]}return e.prototype.call=function(){return ih(this.tasks)},e.prototype.tap=function(r,t){this.tasks.push(function(n){var i=t();n(i,r)})},e}(),gc=function(){function e(){this.args=[],this.tasks=[]}return e.prototype.promise=function(){for(var r=arguments,t=[],n=0;n<arguments.length;n++)t[n]=r[n];return this.args=t,ih(this.tasks)},e.prototype.tapPromise=function(r,t){var n=this;this.tasks.push(function(i){return Zl(n,void 0,void 0,function(){return su(this,function(o){switch(o.label){case 0:return[4,t.apply(void 0,to([],vl(this.args),!1))];case 1:return o.sent(),i(null,r),[2]}})})})},e}(),A0=function(){function e(){this.args=[],this.tasks=[]}return e.prototype.promise=function(){for(var r=arguments,t=[],n=0;n<arguments.length;n++)t[n]=r[n];return this.args=t,ih(this.tasks)},e.prototype.tapPromise=function(r,t){var n=this;this.tasks.push(function(i){return Zl(n,void 0,void 0,function(){var o;return su(this,function(s){switch(s.label){case 0:return[4,t.apply(void 0,to([],vl(this.args),!1))];case 1:return o=s.sent(),i(o,r),[2]}})})})},e}(),ah=function(){function e(){this.tasks=[]}return e.prototype.promise=function(){return ig(this.tasks)},e.prototype.tapPromise=function(r,t){this.tasks.length===0?this.tasks.push(function(n){t().then(function(i){n(null,i)})}):this.tasks.push(function(n,i){t(n).then(function(o){i(null,o)})})},e}(),Kd=L(73827),ag=L.n(Kd),sd,_c,ud,wp,ld,cd,Qd,Wv,Cp,Gv,Xv,$v,Yv,qv,bu,fd,Kv,yc,Ws,Qv,oh,Nh,Uh,zh,Zh,Jv,em,tm,rm,Jd,ev,Xc,nm,tv,rv;function og(e){var r=im();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function im(){if(typeof Reflect=="undefined"||!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(e){return!1}}var sg=(sd=(0,yt.b2)(),_c=(0,yt.f3)(ot.SceneID),ud=(0,yt.f3)(ot.IIconService),wp=(0,yt.f3)(ot.IFontService),ld=(0,yt.f3)(ot.IControlService),cd=(0,yt.f3)(ot.IGlobalConfigService),Qd=(0,yt.f3)(ot.IMapService),Wv=(0,yt.f3)(ot.ICoordinateSystemService),Cp=(0,yt.f3)(ot.IRendererService),Gv=(0,yt.f3)(ot.ILayerService),Xv=(0,yt.f3)(ot.IDebugService),$v=(0,yt.f3)(ot.ICameraService),Yv=(0,yt.f3)(ot.IInteractionService),qv=(0,yt.f3)(ot.IPickingService),bu=(0,yt.f3)(ot.IShaderModuleService),fd=(0,yt.f3)(ot.IMarkerService),Kv=(0,yt.f3)(ot.IPopupService),sd(yc=(Ws=function(e){(0,Le.Z)(t,e);var r=og(t);function t(){var n;return(0,Q.Z)(this,t),n=r.call(this),(0,B.Z)((0,Fe.Z)(n),"destroyed",!1),(0,B.Z)((0,Fe.Z)(n),"loaded",!1),Ni((0,Fe.Z)(n),"id",Qv,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"iconService",oh,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"fontService",Nh,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"controlService",Uh,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"configService",zh,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"map",Zh,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"coordinateSystemService",Jv,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"rendererService",em,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"layerService",tm,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"debugService",rm,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"cameraService",Jd,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"interactionService",ev,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"pickingService",Xc,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"shaderModuleService",nm,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"markerService",tv,(0,Fe.Z)(n)),Ni((0,Fe.Z)(n),"popupService",rv,(0,Fe.Z)(n)),(0,B.Z)((0,Fe.Z)(n),"inited",!1),(0,B.Z)((0,Fe.Z)(n),"initPromise",void 0),(0,B.Z)((0,Fe.Z)(n),"rendering",!1),(0,B.Z)((0,Fe.Z)(n),"$container",void 0),(0,B.Z)((0,Fe.Z)(n),"canvas",void 0),(0,B.Z)((0,Fe.Z)(n),"markerContainer",void 0),(0,B.Z)((0,Fe.Z)(n),"hooks",void 0),(0,B.Z)((0,Fe.Z)(n),"handleWindowResized",function(){n.emit("resize"),n.$container&&(n.initContainer(),ku(),n.coordinateSystemService.needRefresh=!0,n.render())}),(0,B.Z)((0,Fe.Z)(n),"handleMapCameraChanged",function(i){n.cameraService.update(i),n.render()}),n.hooks={init:new gc},n}return(0,j.Z)(t,[{key:"init",value:function(i){var o=this;this.configService.setSceneConfig(this.id,i),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.iconService.on("imageUpdate",function(){return o.render()}),this.fontService.init(),this.hooks.init.tapPromise("initMap",(0,Pt.Z)(ge().mark(function s(){return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return o.debugService.log("map.mapInitStart",{type:o.map.version}),f.next=3,new Promise(function(v){o.map.onCameraChanged(function(y){o.cameraService.init(),o.cameraService.update(y),v()}),o.map.init()});case 3:o.map.onCameraChanged(o.handleMapCameraChanged),o.map.addMarkerContainer(),o.markerService.addMarkers(),o.markerService.addMarkerLayers(),o.popupService.initPopup(),o.interactionService.init(),o.interactionService.on(a.Drag,o.addSceneEvent.bind(o));case 10:case"end":return f.stop()}},s)}))),this.hooks.init.tapPromise("initRenderer",(0,Pt.Z)(ge().mark(function s(){var l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(f=((l=o.map)===null||l===void 0?void 0:l.getOverlayContainer())||void 0,f?o.$container=f:o.$container=X(o.configService.getSceneConfig(o.id).id||""),!o.$container){b.next=13;break}return o.canvas=ta("canvas","",o.$container),o.setCanvas(),b.next=7,o.rendererService.init(o.canvas,o.configService.getSceneConfig(o.id),i.gl);case 7:o.registerContextLost(),o.initContainer(),ag()(o.$container,o.handleWindowResized),window.matchMedia&&((v=window.matchMedia("screen and (-webkit-min-device-pixel-ratio: 1.5)"))===null||v===void 0||v.addListener(o.handleWindowResized)),b.next=14;break;case 13:console.error("\u5BB9\u5668 id \u4E0D\u5B58\u5728");case 14:o.pickingService.init(o.id);case 15:case"end":return b.stop()}},s)}))),this.render()}},{key:"registerContextLost",value:function(){var i=this,o=this.rendererService.getCanvas();o&&o.addEventListener("webglcontextlost",function(){return i.emit("webglcontextlost")})}},{key:"initMiniScene",value:function(i){var o=this;this.configService.setSceneConfig(this.id,i),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.iconService.on("imageUpdate",function(){return o.render()}),this.fontService.init(),this.hooks.init.tapPromise("initMap",(0,Pt.Z)(ge().mark(function s(){return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,new Promise(function(v){o.map.onCameraChanged(function(y){o.cameraService.init(),o.cameraService.update(y),o.map.version!=="GAODE2.x"&&v()}),o.map.initMiniMap()});case 2:o.map.onCameraChanged(o.handleMapCameraChanged),o.interactionService.init(),o.interactionService.on(a.Drag,o.addSceneEvent.bind(o));case 5:case"end":return f.stop()}},s)}))),this.hooks.init.tapPromise("initRenderer",(0,Pt.Z)(ge().mark(function s(){var l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(l=i.canvas,o.$container=l||null,!o.$container){v.next=7;break}return v.next=5,o.rendererService.init(i.canvas,o.configService.getSceneConfig(o.id),void 0);case 5:v.next=8;break;case 7:console.error("\u5BB9\u5668 id \u4E0D\u5B58\u5728");case 8:o.pickingService.init(o.id);case 9:case"end":return v.stop()}},s)}))),this.initPromise=this.hooks.init.promise(),this.render()}},{key:"addLayer",value:function(i){this.layerService.sceneService=this,this.layerService.add(i)}},{key:"addMask",value:function(i){this.layerService.sceneService=this,this.layerService.addMask(i)}},{key:"render",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!(this.rendering||this.destroyed)){l.next=2;break}return l.abrupt("return");case 2:if(this.rendering=!0,this.inited){l.next=16;break}return l.next=6,this.hooks.init.promise();case 6:return this.destroyed&&this.destroy(),l.next=9,this.layerService.initLayers();case 9:this.layerService.renderLayers(),this.controlService.addControls(),this.loaded=!0,this.emit("loaded"),this.inited=!0,l.next=20;break;case 16:return l.next=18,this.layerService.initLayers();case 18:return l.next=20,this.layerService.renderLayers();case 20:this.rendering=!1;case 21:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"addFontFace",value:function(i,o){this.fontService.addFontFace(i,o)}},{key:"getSceneContainer",value:function(){return this.$container}},{key:"exportPng",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return f=(l=this.$container)===null||l===void 0?void 0:l.getElementsByTagName("canvas")[0],b.next=3,this.render();case 3:return v=s==="jpg"?f==null?void 0:f.toDataURL("image/jpeg"):f==null?void 0:f.toDataURL("image/png"),b.abrupt("return",v);case 5:case"end":return b.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"getSceneConfig",value:function(){return this.configService.getSceneConfig(this.id)}},{key:"getPointSizeRange",value:function(){return this.rendererService.getPointSizeRange()}},{key:"addMarkerContainer",value:function(){var i=this.$container.parentElement;i!==null&&(this.markerContainer=ta("div","l7-marker-container",i))}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"destroy",value:function(){var i=this,o;if(!this.inited){this.destroyed=!0;return}if((0,Kd.unbind)(this.$container,this.handleWindowResized),window.matchMedia){var s;(s=window.matchMedia("screen and (min-resolution: 2dppx)"))===null||s===void 0||s.removeListener(this.handleWindowResized)}this.pickingService.destroy(),this.layerService.destroy(),this.interactionService.destroy(),this.controlService.destroy(),this.markerService.destroy(),this.fontService.destroy(),this.iconService.destroy(),this.removeAllListeners(),this.inited=!1,this.map.destroy(),setTimeout(function(){var l;(l=i.$container)===null||l===void 0||l.removeChild(i.canvas),i.canvas=null,i.rendererService.destroy()}),(o=this.$container)===null||o===void 0||(o=o.parentNode)===null||o===void 0||o.removeChild(this.$container),this.emit("destroy")}},{key:"initContainer",value:function(){var i,o,s=wa,l=((i=this.$container)===null||i===void 0?void 0:i.clientWidth)||400,f=((o=this.$container)===null||o===void 0?void 0:o.clientHeight)||300,v=this.canvas;v&&(v.width=l*s,v.height=f*s),this.rendererService.viewport({x:0,y:0,width:s*l,height:s*f})}},{key:"setCanvas",value:function(){var i,o,s=wa,l=((i=this.$container)===null||i===void 0?void 0:i.clientWidth)||400,f=((o=this.$container)===null||o===void 0?void 0:o.clientHeight)||300,v=this.canvas;v.width=l*s,v.height=f*s,v.style.width="100%",v.style.height="100%"}},{key:"addSceneEvent",value:function(i){this.emit(i.type,i)}}]),t}(io.EventEmitter),Qv=ki(Ws.prototype,"id",[_c],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oh=ki(Ws.prototype,"iconService",[ud],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Nh=ki(Ws.prototype,"fontService",[wp],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Uh=ki(Ws.prototype,"controlService",[ld],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),zh=ki(Ws.prototype,"configService",[cd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zh=ki(Ws.prototype,"map",[Qd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Jv=ki(Ws.prototype,"coordinateSystemService",[Wv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),em=ki(Ws.prototype,"rendererService",[Cp],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tm=ki(Ws.prototype,"layerService",[Gv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rm=ki(Ws.prototype,"debugService",[Xv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Jd=ki(Ws.prototype,"cameraService",[$v],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ev=ki(Ws.prototype,"interactionService",[Yv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xc=ki(Ws.prototype,"pickingService",[qv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nm=ki(Ws.prototype,"shaderModuleService",[bu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tv=ki(Ws.prototype,"markerService",[fd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rv=ki(Ws.prototype,"popupService",[Kv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ws))||yc);function ug(e){var r=0;switch(e){case"vec2":case"ivec2":r=2;break;case"vec3":case"ivec3":r=3;break;case"vec4":case"ivec4":case"mat2":r=4;break;case"mat3":r=9;break;case"mat4":r=16;break;default:}return r}var nv=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function am(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t={};return e=e.replace(nv,function(n,i,o){var s=o.split(":"),l=s[0].trim(),f="";switch(s.length>1&&(f=s[1].trim()),i){case"bool":f=f==="true";break;case"float":case"int":f=Number(f);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":f?f=f.replace("[","").replace("]","").split(",").reduce(function(v,y){return v.push(Number(y.trim())),v},[]):f=new Array(ug(i)).fill(0);break;default:}return t[l]=f,"".concat(r?"uniform ":"").concat(i," ").concat(l,`;
|
|
`)}),{content:e,uniforms:t}}function Vh(e){var r=am(e,!0),t=r.content,n=r.uniforms;return t=t.replace(/(\s*uniform\s*.*\s*){((?:\s*.*\s*)*?)};/g,function(i,o,s){s=s.trim().replace(/^.*$/gm,function(y){return"uniform ".concat(y)});var l=am(s),f=l.content,v=l.uniforms;return Object.assign(n,v),"".concat(o,`{
|
|
`).concat(f,`
|
|
};`)}),{content:t,uniforms:n}}function om(e){var r={};return e.replace(nv,function(t,n,i){var o=i.trim();return r[o]?"":(r[o]=!0,"uniform ".concat(n," ").concat(o,`;
|
|
`))})}var hd,lg,cg=oi.uniq,fg="#define PI 3.14159265359",T0=`#define SHIFT_RIGHT17 1.0 / 131072.0
|
|
#define SHIFT_RIGHT18 1.0 / 262144.0
|
|
#define SHIFT_RIGHT19 1.0 / 524288.0
|
|
#define SHIFT_RIGHT20 1.0 / 1048576.0
|
|
#define SHIFT_RIGHT21 1.0 / 2097152.0
|
|
#define SHIFT_RIGHT22 1.0 / 4194304.0
|
|
#define SHIFT_RIGHT23 1.0 / 8388608.0
|
|
#define SHIFT_RIGHT24 1.0 / 16777216.0
|
|
|
|
#define SHIFT_LEFT17 131072.0
|
|
#define SHIFT_LEFT18 262144.0
|
|
#define SHIFT_LEFT19 524288.0
|
|
#define SHIFT_LEFT20 1048576.0
|
|
#define SHIFT_LEFT21 2097152.0
|
|
#define SHIFT_LEFT22 4194304.0
|
|
#define SHIFT_LEFT23 8388608.0
|
|
#define SHIFT_LEFT24 16777216.0
|
|
|
|
vec2 unpack_float(float packedValue) {
|
|
int packedIntValue = int(packedValue);
|
|
int v0 = packedIntValue / 256;
|
|
return vec2(v0, packedIntValue - v0 * 256);
|
|
}
|
|
|
|
vec4 decode_color(vec2 encodedColor) {
|
|
return vec4(
|
|
unpack_float(encodedColor[0]) / 255.0,
|
|
unpack_float(encodedColor[1]) / 255.0
|
|
);
|
|
}
|
|
`,hg=`layout(std140) uniform SceneUniforms {
|
|
mat4 u_ViewMatrix;
|
|
mat4 u_ProjectionMatrix;
|
|
mat4 u_ViewProjectionMatrix;
|
|
mat4 u_ModelMatrix;
|
|
mat4 u_Mvp;
|
|
vec4 u_ViewportCenterProjection;
|
|
vec3 u_PixelsPerDegree;
|
|
float u_Zoom;
|
|
vec3 u_PixelsPerDegree2;
|
|
float u_ZoomScale;
|
|
vec3 u_PixelsPerMeter;
|
|
float u_CoordinateSystem;
|
|
vec3 u_CameraPosition;
|
|
float u_DevicePixelRatio;
|
|
vec2 u_ViewportCenter;
|
|
vec2 u_ViewportSize;
|
|
vec2 u_sceneCenterMercator;
|
|
float u_FocalDistance;
|
|
};`,pg=`layout(std140) uniform PickingUniforms {
|
|
vec4 u_HighlightColor;
|
|
vec4 u_SelectColor;
|
|
vec3 u_PickingColor;
|
|
float u_PickingStage;
|
|
vec3 u_CurrentSelectedId;
|
|
float u_PickingThreshold;
|
|
float u_PickingBuffer;
|
|
float u_shaderPick;
|
|
float u_EnableSelect;
|
|
float u_activeMix;
|
|
};`,w0=`#define ambientRatio 0.5
|
|
#define diffuseRatio 0.3
|
|
#define specularRatio 0.2
|
|
|
|
|
|
float calc_lighting(vec4 pos) {
|
|
|
|
vec3 worldPos = vec3(pos * u_ModelMatrix);
|
|
|
|
vec3 worldNormal = a_Normal;
|
|
// //cal light weight
|
|
vec3 viewDir = normalize(u_CameraPosition - worldPos);
|
|
|
|
vec3 lightDir = normalize(vec3(1, -10.5, 12));
|
|
|
|
vec3 halfDir = normalize(viewDir+lightDir);
|
|
// //lambert
|
|
float lambert = dot(worldNormal, lightDir);
|
|
//specular
|
|
float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);
|
|
//sum to light weight
|
|
float lightWeight = ambientRatio + diffuseRatio * lambert + specularRatio * specular;
|
|
|
|
return lightWeight;
|
|
}
|
|
`,C0=`// Blinn-Phong model
|
|
// apply lighting in vertex shader instead of fragment shader
|
|
// @see https://learnopengl.com/Advanced-Lighting/Advanced-Lighting
|
|
uniform float u_Ambient : 1.0;
|
|
uniform float u_Diffuse : 1.0;
|
|
uniform float u_Specular : 1.0;
|
|
uniform int u_NumOfDirectionalLights : 1;
|
|
uniform int u_NumOfSpotLights : 0;
|
|
|
|
#define SHININESS 32.0
|
|
#define MAX_NUM_OF_DIRECTIONAL_LIGHTS 3
|
|
#define MAX_NUM_OF_SPOT_LIGHTS 3
|
|
|
|
struct DirectionalLight {
|
|
vec3 direction;
|
|
vec3 ambient;
|
|
vec3 diffuse;
|
|
vec3 specular;
|
|
};
|
|
|
|
struct SpotLight {
|
|
vec3 position;
|
|
vec3 direction;
|
|
vec3 ambient;
|
|
vec3 diffuse;
|
|
vec3 specular;
|
|
float constant;
|
|
float linear;
|
|
float quadratic;
|
|
float angle;
|
|
float blur;
|
|
float exponent;
|
|
};
|
|
|
|
uniform DirectionalLight u_DirectionalLights[MAX_NUM_OF_DIRECTIONAL_LIGHTS];
|
|
uniform SpotLight u_SpotLights[MAX_NUM_OF_SPOT_LIGHTS];
|
|
|
|
vec3 calc_directional_light(DirectionalLight light, vec3 normal, vec3 viewDir) {
|
|
vec3 lightDir = normalize(light.direction);
|
|
// diffuse shading
|
|
float diff = max(dot(normal, lightDir), 0.0);
|
|
// Blinn-Phong specular shading
|
|
vec3 halfwayDir = normalize(lightDir + viewDir);
|
|
float spec = pow(max(dot(normal, halfwayDir), 0.0), SHININESS);
|
|
|
|
vec3 ambient = light.ambient * u_Ambient;
|
|
vec3 diffuse = light.diffuse * diff * u_Diffuse;
|
|
vec3 specular = light.specular * spec * u_Specular;
|
|
|
|
return ambient + diffuse + specular;
|
|
}
|
|
|
|
// vec3 calc_spot_light(SpotLight light, vec3 normal, vec3 fragPos, vec3 viewDir) {
|
|
// vec3 lightDir = normalize(light.position - fragPos);
|
|
// // diffuse shading
|
|
// float diff = max(dot(normal, lightDir), 0.0);
|
|
// // specular shading
|
|
// vec3 reflectDir = reflect(-lightDir, normal);
|
|
// float spec = pow(max(dot(viewDir, reflectDir), 0.0), SHININESS);
|
|
// // attenuation
|
|
// float distance = length(light.position - fragPos);
|
|
// float attenuation = 1.0 / (light.constant + light.linear * distance +
|
|
// light.quadratic * (distance * distance));
|
|
|
|
// vec3 ambient = light.ambient * u_Ambient;
|
|
// vec3 diffuse = light.diffuse * diff * u_Diffuse;
|
|
// vec3 specular = light.specular * spec * u_Specular;
|
|
|
|
// float spotEffect = dot(normalize(light.direction), -lightDir);
|
|
// float spotCosCutoff = cos(light.angle / 180.0 * PI);
|
|
// float spotCosOuterCutoff = cos((light.angle + light.blur) / 180.0 * PI);
|
|
// float spotCosInnerCutoff = cos((light.angle - light.blur) / 180.0 * PI);
|
|
// if (spotEffect > spotCosCutoff) {
|
|
// spotEffect = pow(smoothstep(spotCosOuterCutoff, spotCosInnerCutoff, spotEffect), light.exponent);
|
|
// } else {
|
|
// spotEffect = 0.0;
|
|
// }
|
|
|
|
// return ambient + attenuation * (spotEffect * diffuse + specular);
|
|
// }
|
|
|
|
vec3 calc_lighting(vec3 position, vec3 normal, vec3 viewDir) {
|
|
vec3 weight = vec3(0.0);
|
|
for (int i = 0; i < MAX_NUM_OF_DIRECTIONAL_LIGHTS; i++) {
|
|
if (i >= u_NumOfDirectionalLights) {
|
|
break;
|
|
}
|
|
weight += calc_directional_light(u_DirectionalLights[i], normal, viewDir);
|
|
}
|
|
// for (int i = 0; i < MAX_NUM_OF_SPOT_LIGHTS; i++) {
|
|
// if (i >= u_NumOfSpotLights) {
|
|
// break;
|
|
// }
|
|
// weight += calc_spot_light(u_SpotLights[i], normal, position, viewDir);
|
|
// }
|
|
return weight;
|
|
}
|
|
`,R0=`
|
|
in vec4 v_PickingResult;
|
|
|
|
#pragma include "picking_uniforms"
|
|
|
|
#define PICKING_NONE 0.0
|
|
#define PICKING_ENCODE 1.0
|
|
#define PICKING_HIGHLIGHT 2.0
|
|
#define COLOR_SCALE 1. / 255.
|
|
|
|
#define HIGHLIGHT 1.0
|
|
#define SELECT 2.0
|
|
|
|
/*
|
|
* Returns highlight color if this item is selected.
|
|
*/
|
|
vec4 filterHighlightColor(vec4 color, float weight) {
|
|
// float selected = v_PickingResult.a;
|
|
bool selected = bool(v_PickingResult.a);
|
|
|
|
// if (selected == SELECT) {
|
|
if (selected) {
|
|
// // \u70B9\u51FB\u9009\u4E2D\u72B6\u6001
|
|
// vec4 selectColor = u_SelectColor * COLOR_SCALE;
|
|
// return selectColor;
|
|
// } else if (selected == HIGHLIGHT) {
|
|
// // hover \u9AD8\u4EAE\u72B6\u6001
|
|
vec4 highLightColor = u_HighlightColor * COLOR_SCALE;
|
|
|
|
float highLightAlpha = highLightColor.a;
|
|
float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));
|
|
|
|
vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);
|
|
return vec4(mix(resultRGB * weight, color.rgb, u_activeMix), color.a);
|
|
} else {
|
|
return color;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Returns picking color if picking enabled else unmodified argument.
|
|
*/
|
|
vec4 filterPickingColor(vec4 color) {
|
|
vec3 pickingColor = v_PickingResult.rgb;
|
|
if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {
|
|
discard;
|
|
}
|
|
return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;
|
|
}
|
|
|
|
/*
|
|
* Returns picking color if picking is enabled if not
|
|
* highlight color if this item is selected, otherwise unmodified argument.
|
|
*/
|
|
vec4 filterColor(vec4 color) {
|
|
// \u8FC7\u6EE4\u591A\u4F59\u7684 shader \u8BA1\u7B97
|
|
// return color;
|
|
if(u_shaderPick < 0.5) {
|
|
return color; // \u6682\u65F6\u53BB\u9664 \u76F4\u63A5\u53D6\u6D88\u8BA1\u7B97\u5728\u9009\u4E2D\u65F6\u62D6\u62FD\u5730\u56FE\u4F1A\u6709\u95EE\u9898
|
|
} else {
|
|
return filterPickingColor(filterHighlightColor(color, 1.0));
|
|
}
|
|
|
|
}
|
|
|
|
vec4 filterColorAlpha(vec4 color, float alpha) {
|
|
// \u8FC7\u6EE4\u591A\u4F59\u7684 shader \u8BA1\u7B97
|
|
// return color;
|
|
if(u_shaderPick < 0.5) {
|
|
return color; // \u6682\u65F6\u53BB\u9664 \u76F4\u63A5\u53D6\u6D88\u8BA1\u7B97\u5728\u9009\u4E2D\u65F6\u62D6\u62FD\u5730\u56FE\u4F1A\u6709\u95EE\u9898
|
|
} else {
|
|
return filterPickingColor(filterHighlightColor(color, alpha));
|
|
}
|
|
}
|
|
|
|
`,M0=`layout(location = 2) in vec3 a_PickingColor;
|
|
out vec4 v_PickingResult;
|
|
|
|
#pragma include "picking_uniforms"
|
|
|
|
#define PICKING_NONE 0.0
|
|
#define PICKING_ENCODE 1.0
|
|
#define PICKING_HIGHLIGHT 2.0
|
|
#define COLOR_SCALE 1. / 255.
|
|
|
|
#define NORMAL 0.0
|
|
#define HIGHLIGHT 1.0
|
|
#define SELECT 2.0
|
|
|
|
bool isVertexPicked(vec3 vertexColor) {
|
|
return distance(vertexColor,u_PickingColor.rgb) < 0.01;
|
|
}
|
|
|
|
// \u5224\u65AD\u5F53\u524D\u70B9\u662F\u5426\u5DF2\u7ECF\u88AB select \u9009\u4E2D
|
|
bool isVertexSelected(vec3 vertexColor) {
|
|
return distance(vertexColor,u_CurrentSelectedId.rgb) < 0.01;
|
|
}
|
|
|
|
void setPickingColor(vec3 pickingColor) {
|
|
if(u_shaderPick < 0.5) {
|
|
return;
|
|
}
|
|
// compares only in highlight stage
|
|
|
|
v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));
|
|
|
|
// Stores the picking color so that the fragment shader can render it during picking
|
|
v_PickingResult.rgb = pickingColor * COLOR_SCALE;
|
|
}
|
|
|
|
float setPickingSize(float x) {
|
|
return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;
|
|
}
|
|
|
|
float setPickingOrder(float z) {
|
|
bool selected = bool(v_PickingResult.a);
|
|
return selected ? z + 1. : 0.;
|
|
}
|
|
`,$c=`
|
|
#define E 2.718281828459045
|
|
vec2 ProjectFlat(vec2 lnglat){
|
|
float maxs=85.0511287798;
|
|
float lat=max(min(maxs,lnglat.y),-maxs);
|
|
float scale= 268435456.;
|
|
float d=PI/180.;
|
|
float x=lnglat.x*d;
|
|
float y=lat*d;
|
|
y=log(tan((PI/4.)+(y/2.)));
|
|
|
|
float a=.5/PI,
|
|
b=.5,
|
|
c=-.5/PI;
|
|
d=.5;
|
|
x=scale*(a*x+b);
|
|
y=scale*(c*y+d);
|
|
return vec2(x,y);
|
|
}
|
|
|
|
vec2 unProjectFlat(vec2 px){
|
|
float a=.5/PI;
|
|
float b=.5;
|
|
float c=-.5/PI;
|
|
float d=.5;
|
|
float scale = 268435456.;
|
|
float x=(px.x/scale-b)/a;
|
|
float y=(px.y/scale-d)/c;
|
|
y=(atan(pow(E,y))-(PI/4.))*2.;
|
|
d=PI/180.;
|
|
float lat=y/d;
|
|
float lng=x/d;
|
|
return vec2(lng,lat);
|
|
}
|
|
|
|
float pixelDistance(vec2 from, vec2 to) {
|
|
vec2 a1 = ProjectFlat(from);
|
|
vec2 b1 = ProjectFlat(to);
|
|
return distance(a1, b1);
|
|
}
|
|
|
|
// gaode2.0
|
|
vec2 customProject(vec2 lnglat) { // \u7ECF\u7EAC\u5EA6 => \u5E73\u9762\u5750\u6807
|
|
float t = lnglat.x;
|
|
float e = lnglat.y;
|
|
float Sm = 180.0 / PI;
|
|
float Tm = 6378137.0;
|
|
float Rm = PI / 180.0;
|
|
float r = 85.0511287798;
|
|
e = max(min(r, e), -r);
|
|
t *= Rm;
|
|
e *= Rm;
|
|
e = log(tan(PI / 4.0 + e / 2.0));
|
|
return vec2(t * Tm, e * Tm);
|
|
}
|
|
|
|
vec2 unProjCustomCoord(vec2 point) { // \u5E73\u9762\u5750\u6807 => \u7ECF\u7EAC\u5EA6
|
|
float Sm = 57.29577951308232; //180 / Math.PI
|
|
float Tm = 6378137.0;
|
|
float t = point.x;
|
|
float e = point.y;
|
|
return vec2(t / Tm * Sm, (2.0 * atan(exp(e / Tm)) - PI / 2.0) * Sm);
|
|
}
|
|
|
|
|
|
float customPixelDistance(vec2 from, vec2 to) {
|
|
vec2 a1 = ProjectFlat(from);
|
|
vec2 b1 = ProjectFlat(to);
|
|
return distance(a1, b1);
|
|
}`,pd=`#define TILE_SIZE 512.0
|
|
#define PI 3.1415926536
|
|
#define WORLD_SCALE TILE_SIZE / (PI * 2.0)
|
|
#define EARTH_CIRCUMFERENCE 40.03e6
|
|
|
|
#define COORDINATE_SYSTEM_LNGLAT 1.0 // mapbox
|
|
#define COORDINATE_SYSTEM_LNGLAT_OFFSET 2.0 // mapbox offset
|
|
#define COORDINATE_SYSTEM_VECTOR_TILE 3.0
|
|
#define COORDINATE_SYSTEM_IDENTITY 4.0
|
|
#define COORDINATE_SYSTEM_P20 5.0 // amap
|
|
#define COORDINATE_SYSTEM_P20_OFFSET 6.0 // amap offset
|
|
#define COORDINATE_SYSTEM_METER_OFFSET 7.0
|
|
|
|
#define COORDINATE_SYSTEM_P20_2 8.0 // amap2.0
|
|
#pragma include "scene_uniforms"
|
|
|
|
|
|
// web mercator coords -> world coords
|
|
vec2 project_mercator(vec2 lnglat) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.0
|
|
return lnglat;
|
|
}
|
|
float x = lnglat.x;
|
|
return vec2(
|
|
radians(x) + PI,
|
|
PI - log(tan(PI * 0.25 + radians(lnglat.y) * 0.5))
|
|
);
|
|
}
|
|
|
|
float project_scale(float meters) {
|
|
return meters * u_PixelsPerMeter.z;
|
|
}
|
|
|
|
|
|
// offset coords -> world coords
|
|
vec4 project_offset(vec4 offset) {
|
|
float dy = offset.y;
|
|
dy = clamp(dy, -1., 1.);
|
|
vec3 pixels_per_unit = u_PixelsPerDegree + u_PixelsPerDegree2 * dy;
|
|
return vec4(offset.xyz * pixels_per_unit, offset.w);
|
|
}
|
|
|
|
vec3 project_normal(vec3 normal) {
|
|
vec4 normal_modelspace = u_ModelMatrix * vec4(normal, 0.0);
|
|
return normalize(normal_modelspace.xyz * u_PixelsPerMeter);
|
|
}
|
|
|
|
vec3 project_offset_normal(vec3 vector) {
|
|
if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01
|
|
|| u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// normals generated by the polygon tesselator are in lnglat offsets instead of meters
|
|
return normalize(vector * u_PixelsPerDegree);
|
|
}
|
|
return project_normal(vector);
|
|
}
|
|
// || u_CoordinateSystem < COORDINATE_SYSTEM_P20_OFFSET + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_P20_OFFSET - 0.01
|
|
// reverse Y
|
|
vec3 reverse_offset_normal(vec3 vector) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 ||u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET ) {
|
|
return vector * vec3(1.0, -1.0, 1.0);
|
|
}
|
|
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.0
|
|
return vector;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
vec4 project_mvt_offset_position(vec4 position) {
|
|
float a = COORDINATE_SYSTEM_LNGLAT_OFFSET;
|
|
float b = COORDINATE_SYSTEM_P20_OFFSET;
|
|
float c = COORDINATE_SYSTEM_LNGLAT;
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
return project_offset(vec4(0.0, 0.0, position.z, position.w));
|
|
}
|
|
if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) {
|
|
return vec4(
|
|
project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,
|
|
project_scale(position.z),
|
|
position.w
|
|
);
|
|
}
|
|
return position;
|
|
}
|
|
|
|
vec4 project_position(vec4 position) {
|
|
float a = COORDINATE_SYSTEM_LNGLAT_OFFSET;
|
|
float b = COORDINATE_SYSTEM_P20_OFFSET;
|
|
float c = COORDINATE_SYSTEM_LNGLAT;
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET
|
|
|| u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
float X = position.x - u_ViewportCenter.x;
|
|
float Y = position.y - u_ViewportCenter.y;
|
|
return project_offset(vec4(X, Y, position.z, position.w));
|
|
}
|
|
if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) {
|
|
return vec4(
|
|
project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,
|
|
project_scale(position.z),
|
|
position.w
|
|
);
|
|
}
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {
|
|
return vec4(
|
|
(project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale - vec2(215440491., 106744817.)) * vec2(1., -1.),
|
|
project_scale(position.z),
|
|
position.w
|
|
);
|
|
}
|
|
|
|
// if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
|
|
|
|
// return vec4(
|
|
// position.xy,
|
|
// project_scale(position.z),
|
|
// position.w);
|
|
// }
|
|
return position;
|
|
|
|
// TODO: \u74E6\u7247\u5750\u6807\u7CFB & \u5E38\u89C4\u4E16\u754C\u5750\u6807\u7CFB
|
|
}
|
|
vec2 project_pixel_size_to_clipspace(vec2 pixels) {
|
|
vec2 offset = pixels / u_ViewportSize * u_DevicePixelRatio * 2.0;
|
|
return offset * u_FocalDistance;
|
|
}
|
|
|
|
|
|
|
|
float project_pixel_allmap(float pixel) {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
|
|
return pixel * pow(2.0, u_Zoom);
|
|
}
|
|
return pixel * u_FocalDistance ;
|
|
}
|
|
|
|
// \u9002\u914D\u7EB9\u7406\u8D34\u56FE\u7684\u7B49\u50CF\u7D20\u5927\u5C0F
|
|
float project_pixel_texture(float pixel) {
|
|
// mapbox zoom > 12
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
return pixel * pow(0.5, u_Zoom) * u_FocalDistance ;
|
|
}
|
|
|
|
// amap2 zoom > 12
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom))* u_FocalDistance ;
|
|
}
|
|
|
|
// amap zoom > 12
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
return pixel * pow(0.5, u_Zoom)* u_FocalDistance ;
|
|
}
|
|
|
|
// amap zoom < 12
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {
|
|
return pixel * pow(2.0, (20.0 - u_Zoom))* u_FocalDistance ;
|
|
}
|
|
return pixel * 2.0 * u_FocalDistance;;
|
|
}
|
|
|
|
// \u5728\u4E0D\u8BBA\u4EC0\u4E48\u5E95\u56FE\u4E0B\u9700\u8981\u7EDF\u4E00\u5904\u7406\u7684\u65F6\u5019\u4F7F\u7528
|
|
float project_float_pixel(float pixel) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// mapbox P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
|
|
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// amap P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
|
|
return pixel * pow(2.0, (19.0 - u_Zoom));
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// amap2 P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
|
|
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom))* u_FocalDistance ;
|
|
}
|
|
return pixel * u_FocalDistance;
|
|
}
|
|
|
|
// Project meter into the unit of pixel which used in the camera world space
|
|
float project_float_meter(float meter) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// Since the zoom level uniform is updated by mapservice and it's alread been subtracted by 1
|
|
// Not sure if we are supposed to do that again
|
|
return meter;
|
|
} else {
|
|
return project_float_pixel(meter);
|
|
}
|
|
|
|
// TODO: change the following code to make adaptations for amap
|
|
return u_FocalDistance * TILE_SIZE * pow(2.0, u_Zoom) * meter / EARTH_CIRCUMFERENCE;
|
|
}
|
|
|
|
float project_pixel(float pixel) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// amap P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
|
|
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// amap2 P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
|
|
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
return pixel * u_FocalDistance;
|
|
}
|
|
vec2 project_pixel(vec2 pixel) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
|
|
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
|
|
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
return pixel * -1. * u_FocalDistance;
|
|
}
|
|
vec3 project_pixel(vec3 pixel) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
|
|
return pixel * pow(2.0, (19.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
|
|
return pixel * pow(2.0, (19.0 - 3.0 - u_Zoom)) * u_FocalDistance ;
|
|
}
|
|
return pixel * -1. * u_FocalDistance;
|
|
}
|
|
|
|
vec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||
|
|
u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// Needs to be divided with project_uCommonUnitsPerMeter
|
|
position.w *= u_PixelsPerMeter.z;
|
|
}
|
|
|
|
return viewProjectionMatrix * position + center;
|
|
}
|
|
|
|
// Projects from common space coordinates to clip space
|
|
vec4 project_common_position_to_clipspace(vec4 position) {
|
|
return project_common_position_to_clipspace(
|
|
position,
|
|
u_ViewProjectionMatrix,
|
|
u_ViewportCenterProjection
|
|
);
|
|
}
|
|
|
|
vec4 unproject_clipspace_to_position(vec4 clipspacePos, mat4 u_InverseViewProjectionMatrix) {
|
|
vec4 pos = u_InverseViewProjectionMatrix * (clipspacePos - u_ViewportCenterProjection);
|
|
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||
|
|
u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// Needs to be divided with project_uCommonUnitsPerMeter
|
|
pos.w = pos.w / u_PixelsPerMeter.z;
|
|
}
|
|
return pos;
|
|
}
|
|
|
|
|
|
bool isEqual( float a, float b) {
|
|
return a< b + 0.001 && a > b - 0.001;
|
|
}
|
|
|
|
// \u652F\u6301 GaodeV2\u3001Mapbox
|
|
vec4 project_common_position_to_clipspace_v2(vec4 position) {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
return u_Mvp * position;
|
|
} else {
|
|
return project_common_position_to_clipspace(position);
|
|
}
|
|
}
|
|
`,dg=`vec2 rotate_matrix(vec2 v, float a) {
|
|
float b = a / 180.0 * 3.1415926535897932384626433832795;
|
|
float s = sin(b);
|
|
float c = cos(b);
|
|
mat2 m = mat2(c, s, -s, c);
|
|
return m * v;
|
|
}`,dd=`/**
|
|
* 2D signed distance field functions
|
|
* @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm
|
|
*/
|
|
|
|
float ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }
|
|
|
|
float sdCircle(vec2 p, float r) {
|
|
return length(p) - r;
|
|
}
|
|
|
|
float sdEquilateralTriangle(vec2 p) {
|
|
float k = sqrt(3.0);
|
|
p.x = abs(p.x) - 1.0;
|
|
p.y = p.y + 1.0/k;
|
|
if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;
|
|
p.x -= clamp( p.x, -2.0, 0.0 );
|
|
return -length(p)*sign(p.y);
|
|
}
|
|
|
|
float sdBox(vec2 p, vec2 b) {
|
|
vec2 d = abs(p)-b;
|
|
return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);
|
|
}
|
|
|
|
float sdPentagon(vec2 p, float r) {
|
|
vec3 k = vec3(0.809016994,0.587785252,0.726542528);
|
|
p.x = abs(p.x);
|
|
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
|
|
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
|
|
p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);
|
|
return length(p)*sign(p.y);
|
|
}
|
|
|
|
float sdHexagon(vec2 p, float r) {
|
|
vec3 k = vec3(-0.866025404,0.5,0.577350269);
|
|
p = abs(p);
|
|
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
|
|
p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);
|
|
return length(p)*sign(p.y);
|
|
}
|
|
|
|
float sdOctogon(vec2 p, float r) {
|
|
vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );
|
|
p = abs(p);
|
|
p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);
|
|
p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);
|
|
p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);
|
|
return length(p)*sign(p.y);
|
|
}
|
|
|
|
float sdHexagram(vec2 p, float r) {
|
|
vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);
|
|
p = abs(p);
|
|
p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;
|
|
p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;
|
|
p -= vec2(clamp(p.x,r*k.z,r*k.w),r);
|
|
return length(p)*sign(p.y);
|
|
}
|
|
|
|
float sdRhombus(vec2 p, vec2 b) {
|
|
vec2 q = abs(p);
|
|
float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);
|
|
float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );
|
|
return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );
|
|
}
|
|
|
|
float sdVesica(vec2 p, float r, float d) {
|
|
p = abs(p);
|
|
float b = sqrt(r*r-d*d); // can delay this sqrt
|
|
return ((p.y-b)*d>p.x*b)
|
|
? length(p-vec2(0.0,b))
|
|
: length(p-vec2(-d,0.0))-r;
|
|
}
|
|
`,sm=/precision\s+(high|low|medium)p\s+float/,V_=`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
precision highp float;
|
|
#else
|
|
precision mediump float;
|
|
#endif
|
|
`,J2=/#pragma include (["^+"]?["[a-zA-Z_0-9](.*)"]*?)/g,eS=/void\s+main\s*\([^)]*\)\s*\{\n?/,WB=/}\n?[^{}]*$/,tS=(hd=(0,yt.b2)(),hd(lg=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"moduleCache",{}),(0,B.Z)(this,"rawContentCache",{})}return(0,j.Z)(e,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("common",{vs:fg,fs:fg}),this.registerModule("decode",{vs:T0,fs:""}),this.registerModule("scene_uniforms",{vs:hg,fs:hg}),this.registerModule("picking_uniforms",{vs:pg,fs:pg}),this.registerModule("projection",{vs:pd,fs:pd}),this.registerModule("project",{vs:$c,fs:""}),this.registerModule("sdf_2d",{vs:"",fs:dd}),this.registerModule("lighting",{vs:C0,fs:""}),this.registerModule("light",{vs:w0,fs:""}),this.registerModule("picking",{vs:M0,fs:R0}),this.registerModule("rotation_2d",{vs:dg,fs:""})}},{key:"registerModule",value:function(t,n){n.vs=n.vs.replace(/\r\n/g,`
|
|
`),n.fs=n.fs.replace(/\r\n/g,`
|
|
`);var i=n.vs,o=n.fs,s=n.uniforms,l=n.inject,f=Vh(i),v=f.content,y=f.uniforms,b=Vh(o),T=b.content,M=b.uniforms;this.rawContentCache[t]={fs:T,inject:l,uniforms:(0,V.Z)((0,V.Z)((0,V.Z)({},y),M),s),vs:v}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var n=this,i=this.rawContentCache[t].vs,o=this.rawContentCache[t].fs,s=this.rawContentCache[t].inject,l={};s!=null&&s["vs:#decl"]&&(i=(s==null?void 0:s["vs:#decl"])+i,l=Vh(s==null?void 0:s["vs:#decl"]).uniforms),s!=null&&s["vs:#main-start"]&&(i=i.replace(eS,function(G){return G+(s==null?void 0:s["vs:#main-start"])})),s!=null&&s["fs:#decl"]&&(o=(s==null?void 0:s["fs:#decl"])+o);var f=this.processModule(i,[],"vs"),v=f.content,y=f.includeList,b=this.processModule(o,[],"fs"),T=b.content,M=b.includeList,O="",F=cg(y.concat(M).concat(t)).reduce(function(G,ue){return(0,V.Z)((0,V.Z)({},G),n.rawContentCache[ue].uniforms)},(0,V.Z)({},l));sm.test(T)||(O=O+V_),O=O+T;var $="";return sm.test(v)||($=$+V_),$=$+v,this.moduleCache[t]={fs:O.trim(),uniforms:F,vs:$.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,n,i){var o=this,s=t.replace(J2,function(l,f){var v=f.split(" "),y=v[0].replace(/"/g,"");if(n.indexOf(y)>-1)return"";var b=o.rawContentCache[y][i];n.push(y);var T=o.processModule(b,n,i),M=T.content;return M});return{content:s,includeList:n}}},{key:"injectDefines",value:function(t){var n=Object.keys(t).reduce(function(i,o){return i+"#define ".concat(o.toUpperCase()," ").concat(t[o],`;
|
|
`)},`
|
|
`);return n}}]),e}())||lg);function rS(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&(e=(0,Ee.Z)(e),e!==null););return e}function Ra(){return typeof Reflect!="undefined"&&Reflect.get?Ra=Reflect.get.bind():Ra=function(r,t,n){var i=rS(r,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(arguments.length<3?r:n):o.value}},Ra.apply(this,arguments)}var iv=function(e){return e.Normal="normal",e.PostProcessing="post-processing",e}({}),j_,H_,vg=(j_=(0,yt.b2)(),j_(H_=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"shaderModuleService",void 0),(0,B.Z)(this,"rendererService",void 0),(0,B.Z)(this,"cameraService",void 0),(0,B.Z)(this,"mapService",void 0),(0,B.Z)(this,"interactionService",void 0),(0,B.Z)(this,"layerService",void 0),(0,B.Z)(this,"config",void 0)}return(0,j.Z)(e,[{key:"getName",value:function(){return""}},{key:"getType",value:function(){return iv.Normal}},{key:"init",value:function(t,n){this.config=n,this.rendererService=t.getContainer().get(ot.IRendererService),this.cameraService=t.getContainer().get(ot.ICameraService),this.mapService=t.getContainer().get(ot.IMapService),this.interactionService=t.getContainer().get(ot.IInteractionService),this.layerService=t.getContainer().get(ot.ILayerService),this.shaderModuleService=t.getContainer().get(ot.IShaderModuleService)}},{key:"render",value:function(t){}}]),e}())||H_),W_,G_;function nS(e){var r=iS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function iS(){if(typeof Reflect=="undefined"||!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(e){return!1}}var aS=(W_=(0,yt.b2)(),W_(G_=function(e){(0,Le.Z)(t,e);var r=nS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getName",value:function(){return"clear"}},{key:"init",value:function(i,o){Ra((0,Ee.Z)(t.prototype),"init",this).call(this,i,o)}},{key:"render",value:function(){this.rendererService.clear({color:[0,0,0,0],depth:1,framebuffer:null})}}]),t}(vg))||G_),X_,$_,Y_,I0,q_;function oS(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=sS(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function sS(e,r){if(e){if(typeof e=="string")return K_(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return K_(e,r)}}function K_(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var uS=(X_=(0,yt.b2)(),$_=(0,yt.f3)(ot.IPostProcessor),X_(Y_=(I0=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"passes",[]),Ni(this,"postProcessor",q_,this),(0,B.Z)(this,"layer",void 0),(0,B.Z)(this,"renderFlag",void 0),(0,B.Z)(this,"width",0),(0,B.Z)(this,"height",0)}return(0,j.Z)(e,[{key:"setLayer",value:function(t){this.layer=t}},{key:"setRenderFlag",value:function(t){this.renderFlag=t}},{key:"getRenderFlag",value:function(){return this.renderFlag}},{key:"getPostProcessor",value:function(){return this.postProcessor}},{key:"render",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){var i,o,s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:i=oS(this.passes),f.prev=1,i.s();case 3:if((o=i.n()).done){f.next=9;break}return s=o.value,f.next=7,s.render(this.layer);case 7:f.next=3;break;case 9:f.next=14;break;case 11:f.prev=11,f.t0=f.catch(1),i.e(f.t0);case 14:return f.prev=14,i.f(),f.finish(14);case 17:return f.next=19,this.postProcessor.render(this.layer);case 19:case"end":return f.stop()}},n,this,[[1,11,14,17]])}));function t(){return r.apply(this,arguments)}return t}()},{key:"resize",value:function(t,n){(this.width!==t||this.height!==n)&&(this.postProcessor.resize(t,n),this.width=t,this.height=n)}},{key:"add",value:function(t,n){t.getType()===iv.PostProcessing?this.postProcessor.add(t,this.layer,n):(t.init(this.layer,n),this.passes.push(t))}},{key:"insert",value:function(t,n,i){t.init(this.layer,n),this.passes.splice(i,0,t)}},{key:"destroy",value:function(){this.passes.length=0}}]),e}(),q_=ki(I0.prototype,"postProcessor",[$_],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),I0))||Y_),Q_,J_;function lS(e){var r=cS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function cS(){if(typeof Reflect=="undefined"||!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(e){return!1}}var fS=(Q_=(0,yt.b2)(),Q_(J_=function(e){(0,Le.Z)(t,e);var r=lS(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"pickingFBO",void 0),(0,B.Z)((0,Fe.Z)(n),"layer",void 0),(0,B.Z)((0,Fe.Z)(n),"width",0),(0,B.Z)((0,Fe.Z)(n),"height",0),(0,B.Z)((0,Fe.Z)(n),"alreadyInRendering",!1),(0,B.Z)((0,Fe.Z)(n),"pickFromPickingFBO",function(l){var f=l.x,v=l.y,y=l.lngLat,b=l.type;if(!(!n.layer.isVisible()||!n.layer.needPick(b))){var T=n.rendererService,M=T.getViewportSize,O=T.readPixels,F=T.useFramebuffer,$=M(),G=$.width,ue=$.height,xe=n.layer.getLayerConfig(),ze=xe.enableHighlight,Je=xe.enableSelect,ht=f*wa,gt=v*wa;if(!(ht>G||ht<0||gt>ue||gt<0)){var Ot;F(n.pickingFBO,function(){var tr;if(Ot=O({x:Math.round(ht),y:Math.round(ue-(v+1)*wa),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:n.pickingFBO}),Ot[0]!==0||Ot[1]!==0||Ot[2]!==0){var Ir=Oa(Ot),Er=n.layer.getSource().getFeatureById(Ir),mn={x:f,y:v,type:b,lngLat:y,featureId:Ir,feature:Er};Er&&(n.layer.setCurrentPickId(Ir),n.triggerHoverOnLayer(mn))}else{var Ln={x:f,y:v,lngLat:y,type:n.layer.getCurrentPickId()===null?"un"+b:"mouseout",featureId:null,feature:null};n.triggerHoverOnLayer((0,V.Z)((0,V.Z)({},Ln),{},{type:"unpick"})),n.triggerHoverOnLayer(Ln),n.layer.setCurrentPickId(null)}ze&&n.highlightPickedFeature(Ot),Je&&b==="click"&&((tr=Ot)===null||tr===void 0?void 0:tr.toString())!==[0,0,0,0].toString()&&n.selectFeature(Ot)})}}}),n}return(0,j.Z)(t,[{key:"getType",value:function(){return iv.Normal}},{key:"getName",value:function(){return"pixelPicking"}},{key:"init",value:function(i,o){Ra((0,Ee.Z)(t.prototype),"init",this).call(this,i,o),this.layer=i;var s=this.rendererService,l=s.createTexture2D,f=s.createFramebuffer,v=s.getViewportSize,y=v(),b=y.width,T=y.height;this.pickingFBO=f({color:l({width:b,height:T,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE})}),this.interactionService.on(a.Hover,this.pickFromPickingFBO),this.interactionService.on(a.Select,this.selectFeatureHandle.bind(this)),this.interactionService.on(a.Active,this.highlightFeatureHandle.bind(this))}},{key:"render",value:function(i){var o=this;if(!this.alreadyInRendering){var s=this.rendererService,l=s.getViewportSize,f=s.useFramebuffer,v=s.clear,y=l(),b=y.width,T=y.height;this.alreadyInRendering=!0,(this.width!==b||this.height!==T)&&(this.pickingFBO.resize({width:b,height:T}),this.width=b,this.height=T),f(this.pickingFBO,function(){v({framebuffer:o.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var M=o.layer.multiPassRenderer.getRenderFlag();o.layer.multiPassRenderer.setRenderFlag(!1),i.hooks.beforePickingEncode.call(),i.render(),i.hooks.afterPickingEncode.call(),o.layer.multiPassRenderer.setRenderFlag(M),o.alreadyInRendering=!1})}}},{key:"triggerHoverOnLayer",value:function(i){this.layer.emit(i.type,i)}},{key:"highlightPickedFeature",value:function(i){var o=(0,Sn.Z)(i,3),s=o[0],l=o[1],f=o[2];this.layer.hooks.beforeHighlight.call([s,l,f]),this.layerService.renderLayers()}},{key:"selectFeature",value:function(i){var o=(0,Sn.Z)(i,3),s=o[0],l=o[1],f=o[2];this.layer.hooks.beforeSelect.call([s,l,f]),this.layerService.renderLayers()}},{key:"selectFeatureHandle",value:function(i){var o=i.featureId,s=sa(o);this.selectFeature(new Uint8Array(s))}},{key:"highlightFeatureHandle",value:function(i){var o=i.featureId,s=sa(o);this.highlightPickedFeature(new Uint8Array(s))}}]),t}(vg))||J_),ey,ty,ry,P0,ny,hS=oi.camelCase,pS=oi.isNil,dS=oi.upperFirst,vS=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,jh=(ey=(0,yt.b2)(),ty=(0,yt.f3)(ot.IShaderModuleService),ey(ry=(P0=function(){function e(){(0,Q.Z)(this,e),Ni(this,"shaderModuleService",ny,this),(0,B.Z)(this,"rendererService",void 0),(0,B.Z)(this,"config",void 0),(0,B.Z)(this,"quad",vS),(0,B.Z)(this,"enabled",!0),(0,B.Z)(this,"renderToScreen",!1),(0,B.Z)(this,"model",void 0),(0,B.Z)(this,"name",void 0),(0,B.Z)(this,"optionsToUpdate",{})}return(0,j.Z)(e,[{key:"getName",value:function(){return this.name}},{key:"setName",value:function(t){this.name=t}},{key:"getType",value:function(){return iv.PostProcessing}},{key:"init",value:function(t,n){this.config=n,this.rendererService=t.getContainer().get(ot.IRendererService),this.shaderModuleService=t.getContainer().get(ot.IShaderModuleService);var i=this.rendererService,o=i.createAttribute,s=i.createBuffer,l=i.createModel,f=this.setupShaders(),v=f.vs,y=f.fs,b=f.uniforms;this.model=l({vs:v,fs:y,attributes:{a_Position:o({buffer:s({data:[-4,-4,4,-4,0,4],type:R.FLOAT}),size:2})},uniforms:(0,V.Z)((0,V.Z)({u_Texture:null},b),this.config&&this.convertOptionsToUniforms(this.config)),depth:{enable:!1},count:3,blend:{enable:this.getName()==="copy"}})}},{key:"render",value:function(t,n){var i=this,o=t.multiPassRenderer.getPostProcessor(),s=this.rendererService,l=s.useFramebuffer,f=s.getViewportSize,v=s.clear,y=f(),b=y.width,T=y.height;l(this.renderToScreen?null:o.getWriteFBO(),function(){v({framebuffer:o.getWriteFBO(),color:[0,0,0,0],depth:1,stencil:0});var M=(0,V.Z)({u_BloomFinal:0,u_Texture:o.getReadFBO(),u_ViewportSize:[b,T]},i.convertOptionsToUniforms(i.optionsToUpdate));n&&(M.u_BloomFinal=1,M.u_Texture2=n),i.model.draw({uniforms:M})})}},{key:"isEnabled",value:function(){return this.enabled}},{key:"setEnabled",value:function(t){this.enabled=t}},{key:"setRenderToScreen",value:function(t){this.renderToScreen=t}},{key:"updateOptions",value:function(t){this.optionsToUpdate=(0,V.Z)((0,V.Z)({},this.optionsToUpdate),t)}},{key:"setupShaders",value:function(){throw new Error("Method not implemented.")}},{key:"convertOptionsToUniforms",value:function(t){var n={};return Object.keys(t).forEach(function(i){pS(t[i])||(n["u_".concat(dS(hS(i)))]=t[i])}),n}}]),e}(),ny=ki(P0.prototype,"shaderModuleService",[ty],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),P0))||ry),iy,ay;function mS(e){var r=gS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function gS(){if(typeof Reflect=="undefined"||!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(e){return!1}}var _S=`varying vec2 v_UV;
|
|
|
|
uniform float u_BloomFinal: 0.0;
|
|
uniform sampler2D u_Texture;
|
|
uniform sampler2D u_Texture2;
|
|
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform float u_radius: 5.0;
|
|
uniform float u_intensity: 0.3;
|
|
uniform float u_baseRadio: 0.5;
|
|
|
|
// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl
|
|
vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
|
|
vec4 color = vec4(0.0);
|
|
vec2 off1 = vec2(1.3846153846) * direction;
|
|
vec2 off2 = vec2(3.2307692308) * direction;
|
|
color += texture2D(image, uv) * 0.2270270270;
|
|
color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;
|
|
color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;
|
|
return color;
|
|
}
|
|
|
|
float luminance(vec4 color) {
|
|
return 0.2125 * color.r + 0.7154 * color.g + 0.0721 * color.b;
|
|
}
|
|
|
|
void main() {
|
|
// vec4 baseColor = texture2D(u_Texture, v_UV);
|
|
|
|
float r = sqrt(u_radius);
|
|
|
|
vec4 c1 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(u_radius, 0.0));
|
|
// c1 *= luminance(c1);
|
|
vec4 c2 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(0.0, u_radius));
|
|
// c2 *= luminance(c2);
|
|
vec4 c3 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, r));
|
|
// c3 *= luminance(c3);
|
|
vec4 c4 = blur9(u_Texture, v_UV, u_ViewportSize, vec2(r, -r));
|
|
// c4 *= luminance(c4);
|
|
vec4 inbloomColor = (c1 + c2 + c3 + c4) * 0.25;
|
|
|
|
// float lum = luminance(inbloomColor);
|
|
// inbloomColor.rgb *= lum;
|
|
|
|
if(u_BloomFinal > 0.0) {
|
|
vec4 baseColor = texture2D(u_Texture2, v_UV);
|
|
float baselum = luminance(baseColor);
|
|
gl_FragColor = mix(inbloomColor, baseColor, u_baseRadio);
|
|
if(baselum <= 0.2) {
|
|
gl_FragColor = inbloomColor * u_intensity;
|
|
}
|
|
} else {
|
|
gl_FragColor = inbloomColor;
|
|
}
|
|
}`,yS=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,O0=oi.isNil,xS=(iy=(0,yt.b2)(),iy(ay=function(e){(0,Le.Z)(t,e);var r=mS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:yS,fs:_S});var i=this.shaderModuleService.getModule("blur-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}},{key:"convertOptionsToUniforms",value:function(i){var o={};return O0(i.bloomRadius)||(o.u_radius=i.bloomRadius),O0(i.bloomIntensity)||(o.u_intensity=i.bloomIntensity),O0(i.bloomBaseRadio)||(o.u_baseRadio=i.bloomBaseRadio),o}}]),t}(jh))||ay),oy,sy;function bS(e){var r=ES();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function ES(){if(typeof Reflect=="undefined"||!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(e){return!1}}var SS=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform vec2 u_BlurDir: [1.0, 0.0];
|
|
|
|
// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl
|
|
vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
|
|
vec4 color = vec4(0.0);
|
|
vec2 off1 = vec2(1.3846153846) * direction;
|
|
vec2 off2 = vec2(3.2307692308) * direction;
|
|
color += texture2D(image, uv) * 0.2270270270;
|
|
color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;
|
|
color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;
|
|
return color;
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir);
|
|
}`,AS=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,TS=oi.isNil,wS=(oy=(0,yt.b2)(),oy(sy=function(e){(0,Le.Z)(t,e);var r=bS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:AS,fs:SS});var i=this.shaderModuleService.getModule("blur-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}},{key:"convertOptionsToUniforms",value:function(i){var o={};return TS(i.blurRadius)||(o.u_BlurDir=[i.blurRadius,0]),o}}]),t}(jh))||sy),uy,ly;function CS(e){var r=RS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function RS(){if(typeof Reflect=="undefined"||!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(e){return!1}}var MS=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform vec2 u_BlurDir: [1.0, 0.0];
|
|
|
|
// https://github.com/Jam3/glsl-fast-gaussian-blur/blob/master/9.glsl
|
|
vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
|
|
vec4 color = vec4(0.0);
|
|
vec2 off1 = vec2(1.3846153846) * direction;
|
|
vec2 off2 = vec2(3.2307692308) * direction;
|
|
color += texture2D(image, uv) * 0.2270270270;
|
|
color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;
|
|
color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;
|
|
color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;
|
|
return color;
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = blur9(u_Texture, v_UV, u_ViewportSize, u_BlurDir);
|
|
}`,IS=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,PS=oi.isNil,OS=(uy=(0,yt.b2)(),uy(ly=function(e){(0,Le.Z)(t,e);var r=CS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("blur-pass",{vs:IS,fs:MS});var i=this.shaderModuleService.getModule("blur-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}},{key:"convertOptionsToUniforms",value:function(i){var o={};return PS(i.blurRadius)||(o.u_BlurDir=[0,i.blurRadius]),o}}]),t}(jh))||ly),cy,fy;function DS(e){var r=FS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function FS(){if(typeof Reflect=="undefined"||!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(e){return!1}}var kS=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform vec2 u_Center : [0.5, 0.5];
|
|
uniform float u_Angle : 0;
|
|
uniform float u_Size : 8;
|
|
|
|
#pragma include "common"
|
|
|
|
float scale = PI / u_Size;
|
|
|
|
float pattern(float u_Angle, vec2 texSize, vec2 texCoord) {
|
|
float s = sin(u_Angle), c = cos(u_Angle);
|
|
vec2 tex = texCoord * texSize - u_Center * texSize;
|
|
vec2 point = vec2(
|
|
c * tex.x - s * tex.y,
|
|
s * tex.x + c * tex.y
|
|
) * scale;
|
|
return (sin(point.x) * sin(point.y)) * 4.0;
|
|
}
|
|
|
|
// https://github.com/evanw/glfx.js/blob/master/src/filters/fun/colorhalftone.js
|
|
vec4 colorHalftone_filterColor(vec4 color, vec2 texSize, vec2 texCoord) {
|
|
vec3 cmy = 1.0 - color.rgb;
|
|
float k = min(cmy.x, min(cmy.y, cmy.z));
|
|
cmy = (cmy - k) / (1.0 - k);
|
|
cmy = clamp(
|
|
cmy * 10.0 - 3.0 + vec3(
|
|
pattern(u_Angle + 0.26179, texSize, texCoord),
|
|
pattern(u_Angle + 1.30899, texSize, texCoord),
|
|
pattern(u_Angle, texSize, texCoord)
|
|
),
|
|
0.0,
|
|
1.0
|
|
);
|
|
k = clamp(k * 10.0 - 5.0 + pattern(u_Angle + 0.78539, texSize, texCoord), 0.0, 1.0);
|
|
return vec4(1.0 - cmy - k, color.a);
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
gl_FragColor = colorHalftone_filterColor(gl_FragColor, u_ViewportSize, v_UV);
|
|
}`,BS=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,LS=(cy=(0,yt.b2)(),cy(fy=function(e){(0,Le.Z)(t,e);var r=DS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("colorhalftone-pass",{vs:BS,fs:kS});var i=this.shaderModuleService.getModule("colorhalftone-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}}]),t}(jh))||fy),hy,py;function NS(e){var r=US();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function US(){if(typeof Reflect=="undefined"||!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(e){return!1}}var zS=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
}`,ZS=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,VS=(hy=(0,yt.b2)(),hy(py=function(e){(0,Le.Z)(t,e);var r=NS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("copy-pass",{vs:ZS,fs:zS}),this.shaderModuleService.getModule("copy-pass")}}]),t}(jh))||py),dy,vy;function jS(e){var r=HS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function HS(){if(typeof Reflect=="undefined"||!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(e){return!1}}var WS=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform vec2 u_Center : [0.5, 0.5];
|
|
uniform float u_Scale : 10;
|
|
|
|
// https://github.com/evanw/glfx.js/blob/master/src/filters/fun/hexagonalpixelate.js
|
|
vec4 hexagonalPixelate_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
vec2 tex = (texCoord * texSize - u_Center * texSize) / u_Scale;
|
|
tex.y /= 0.866025404;
|
|
tex.x -= tex.y * 0.5;
|
|
vec2 a;
|
|
if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) {
|
|
a = vec2(floor(tex.x), floor(tex.y));
|
|
}
|
|
else a = vec2(ceil(tex.x), ceil(tex.y));
|
|
vec2 b = vec2(ceil(tex.x), floor(tex.y));
|
|
vec2 c = vec2(floor(tex.x), ceil(tex.y));
|
|
vec3 TEX = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y);
|
|
vec3 A = vec3(a.x, a.y, 1.0 - a.x - a.y);
|
|
vec3 B = vec3(b.x, b.y, 1.0 - b.x - b.y);
|
|
vec3 C = vec3(c.x, c.y, 1.0 - c.x - c.y);
|
|
float alen = length(TEX - A);
|
|
float blen = length(TEX - B);
|
|
float clen = length(TEX - C);
|
|
vec2 choice;
|
|
if (alen < blen) {
|
|
if (alen < clen) choice = a;
|
|
else choice = c;
|
|
} else {
|
|
if (blen < clen) choice = b;
|
|
else choice = c;
|
|
}
|
|
choice.x += choice.y * 0.5;
|
|
choice.y *= 0.866025404;
|
|
choice *= u_Scale / texSize;
|
|
return texture2D(texture, choice + u_Center);
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
gl_FragColor = hexagonalPixelate_sampleColor(u_Texture, u_ViewportSize, v_UV);
|
|
}`,GS=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,XS=(dy=(0,yt.b2)(),dy(vy=function(e){(0,Le.Z)(t,e);var r=jS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("hexagonalpixelate-pass",{vs:GS,fs:WS});var i=this.shaderModuleService.getModule("hexagonalpixelate-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}}]),t}(jh))||vy),gy,_y;function $S(e){var r=YS();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function YS(){if(typeof Reflect=="undefined"||!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(e){return!1}}var qS=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
uniform vec2 u_ViewportSize: [1.0, 1.0];
|
|
uniform float u_Strength : 0.6;
|
|
|
|
vec4 ink_sampleColor(sampler2D texture, vec2 texSize, vec2 texCoord) {
|
|
vec2 dx = vec2(1.0 / texSize.x, 0.0);
|
|
vec2 dy = vec2(0.0, 1.0 / texSize.y);
|
|
vec4 color = texture2D(texture, texCoord);
|
|
float bigTotal = 0.0;
|
|
float smallTotal = 0.0;
|
|
vec3 bigAverage = vec3(0.0);
|
|
vec3 smallAverage = vec3(0.0);
|
|
for (float x = -2.0; x <= 2.0; x += 1.0) {
|
|
for (float y = -2.0; y <= 2.0; y += 1.0) {
|
|
vec3 sample = texture2D(texture, texCoord + dx * x + dy * y).rgb;
|
|
bigAverage += sample;
|
|
bigTotal += 1.0;
|
|
if (abs(x) + abs(y) < 2.0) {
|
|
smallAverage += sample;
|
|
smallTotal += 1.0;
|
|
}
|
|
}
|
|
}
|
|
vec3 edge = max(vec3(0.0), bigAverage / bigTotal - smallAverage / smallTotal);
|
|
float power = u_Strength * u_Strength * u_Strength * u_Strength * u_Strength;
|
|
return vec4(color.rgb - dot(edge, edge) * power * 100000.0, color.a);
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
gl_FragColor = ink_sampleColor(u_Texture, u_ViewportSize, v_UV);
|
|
}`,KS=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,QS=(gy=(0,yt.b2)(),gy(_y=function(e){(0,Le.Z)(t,e);var r=$S(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){this.shaderModuleService.registerModule("ink-pass",{vs:KS,fs:qS});var i=this.shaderModuleService.getModule("ink-pass"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),v=f.width,y=f.height;return{vs:o,fs:s,uniforms:(0,V.Z)((0,V.Z)({},l),{},{u_ViewportSize:[v,y]})}}}]),t}(jh))||_y),yy,xy;function JS(e){var r=eA();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function eA(){if(typeof Reflect=="undefined"||!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(e){return!1}}var tA=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
uniform float u_Amount : 0.5;
|
|
|
|
float rand(vec2 co) {
|
|
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
|
|
}
|
|
|
|
// https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js
|
|
vec4 noise_filterColor(vec4 color, vec2 texCoord) {
|
|
float diff = (rand(texCoord) - 0.5) * u_Amount;
|
|
color.r += diff;
|
|
color.g += diff;
|
|
color.b += diff;
|
|
return color;
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
gl_FragColor = noise_filterColor(gl_FragColor, v_UV);
|
|
}`,rA=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,nA=(yy=(0,yt.b2)(),yy(xy=function(e){(0,Le.Z)(t,e);var r=JS(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("noise-pass",{vs:rA,fs:tA}),this.shaderModuleService.getModule("noise-pass")}}]),t}(jh))||xy),by,Ey;function iA(e){var r=aA();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function aA(){if(typeof Reflect=="undefined"||!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(e){return!1}}var oA=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`,sA=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
uniform float u_Amount : 0.5;
|
|
|
|
// https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/sepia.js
|
|
vec4 sepia_filterColor(vec4 color) {
|
|
float r = color.r;
|
|
float g = color.g;
|
|
float b = color.b;
|
|
color.r =
|
|
min(1.0, (r * (1.0 - (0.607 * u_Amount))) + (g * (0.769 * u_Amount)) + (b * (0.189 * u_Amount)));
|
|
color.g = min(1.0, (r * 0.349 * u_Amount) + (g * (1.0 - (0.314 * u_Amount))) + (b * 0.168 * u_Amount));
|
|
color.b = min(1.0, (r * 0.272 * u_Amount) + (g * 0.534 * u_Amount) + (b * (1.0 - (0.869 * u_Amount))));
|
|
return color;
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
gl_FragColor = sepia_filterColor(gl_FragColor);
|
|
}`,uA=(by=(0,yt.b2)(),by(Ey=function(e){(0,Le.Z)(t,e);var r=iA(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"setupShaders",value:function(){return this.shaderModuleService.registerModule("sepia-pass",{vs:oA,fs:sA}),this.shaderModuleService.getModule("sepia-pass")}}]),t}(jh))||Ey),Sy,Ay,Ty,wy,av,Cy,lA=(Sy=(0,yt.b2)(),Ay=(0,yt.f3)(ot.IRendererService),Ty=(0,yt.zY)(),Sy(wy=(av=function(){function e(){(0,Q.Z)(this,e),Ni(this,"rendererService",Cy,this),(0,B.Z)(this,"passes",[]),(0,B.Z)(this,"readFBO",void 0),(0,B.Z)(this,"writeFBO",void 0)}return(0,j.Z)(e,[{key:"getReadFBO",value:function(){return this.readFBO}},{key:"getWriteFBO",value:function(){return this.writeFBO}},{key:"getCurrentFBOTex",value:function(){var t=this.rendererService,n=t.getViewportSize,i=t.createTexture2D,o=n(),s=o.width,l=o.height;return i({x:0,y:0,width:s,height:l,copy:!0})}},{key:"getReadFBOTex",value:function(){var t=this,n=this.rendererService.useFramebuffer;return new Promise(function(i){n(t.readFBO,(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:i(t.getCurrentFBOTex());case 1:case"end":return l.stop()}},o)})))})}},{key:"renderBloomPass",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o){var s,l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,this.getReadFBOTex();case 2:s=v.sent,l=0;case 4:if(!(l<4)){v.next=11;break}return v.next=7,o.render(i,s);case 7:this.swap(),l++,v.next=4;break;case 11:case"end":return v.stop()}},n,this)}));function t(n,i){return r.apply(this,arguments)}return t}()},{key:"render",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i){var o,s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:o=0;case 1:if(!(o<this.passes.length)){f.next=15;break}if(s=this.passes[o],s.setRenderToScreen(this.isLastEnabledPass(o)),s.getName()!=="bloom"){f.next=9;break}return f.next=7,this.renderBloomPass(i,s);case 7:f.next=12;break;case 9:return f.next=11,s.render(i);case 11:o!==this.passes.length-1&&this.swap();case 12:o++,f.next=1;break;case 15:case"end":return f.stop()}},n,this)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"resize",value:function(t,n){this.readFBO.resize({width:t,height:n}),this.writeFBO.resize({width:t,height:n})}},{key:"add",value:function(t,n,i){t.init(n,i),this.passes.push(t)}},{key:"insert",value:function(t,n,i,o){t.init(i,o),this.passes.splice(n,0,t)}},{key:"getPostProcessingPassByName",value:function(t){return this.passes.find(function(n){return n.getName()===t})}},{key:"init",value:function(){var t=this.rendererService,n=t.createFramebuffer,i=t.createTexture2D;this.readFBO=n({color:i({width:1,height:1,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE})}),this.writeFBO=n({color:i({width:1,height:1,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE})})}},{key:"isLastEnabledPass",value:function(t){for(var n=t+1;n<this.passes.length;n++)if(this.passes[n].isEnabled())return!1;return!0}},{key:"swap",value:function(){var t=this.readFBO;this.readFBO=this.writeFBO,this.writeFBO=t}}]),e}(),Cy=ki(av.prototype,"rendererService",[Ay],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ki(av.prototype,"init",[Ty],Object.getOwnPropertyDescriptor(av.prototype,"init"),av.prototype),av))||wy),Ry,My;function cA(e){var r=fA();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function fA(){if(typeof Reflect=="undefined"||!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(e){return!1}}var hA=(Ry=(0,yt.b2)(),Ry(My=function(e){(0,Le.Z)(t,e);var r=cA(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getType",value:function(){return iv.Normal}},{key:"getName",value:function(){return"render"}},{key:"init",value:function(i,o){Ra((0,Ee.Z)(t.prototype),"init",this).call(this,i,o)}},{key:"render",value:function(i){var o=this.rendererService,s=o.useFramebuffer,l=o.clear,f=i.multiPassRenderer.getPostProcessor().getReadFBO();s(f,function(){l({color:[0,0,0,0],depth:1,stencil:0,framebuffer:f}),i.multiPassRenderer.setRenderFlag(!1),i.models.forEach(function(v){v.draw({uniforms:i.layerModel.getUninforms()})}),i.multiPassRenderer.setRenderFlag(!0)})}}]),t}(vg))||My),Iy,Py,Oy,D0,Dy;function pA(e){var r=dA();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function dA(){if(typeof Reflect=="undefined"||!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(e){return!1}}var vA=`uniform float u_opacity : 1.0;
|
|
uniform float u_MixRatio : 0.5;
|
|
|
|
uniform sampler2D u_Diffuse1;
|
|
uniform sampler2D u_Diffuse2;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
vec4 texel1 = texture2D(u_Diffuse1, v_UV);
|
|
vec4 texel2 = texture2D(u_Diffuse2, v_UV);
|
|
gl_FragColor = u_opacity * mix(texel1, texel2, u_MixRatio);
|
|
}
|
|
`,Fy=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
}`,mA=`attribute vec2 a_Position;
|
|
|
|
varying vec2 v_UV;
|
|
|
|
void main() {
|
|
v_UV = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
}`;function ky(e,r){for(var t=0,n=1/r,i=e;i>0;)t=t+n*(i%r),i=Math.floor(i/r),n=n/r;return t}var gA=1,_A=(Iy=(0,yt.b2)(),Py=(0,yt.f3)(ot.IShaderModuleService),Iy(Oy=(D0=function(e){(0,Le.Z)(t,e);var r=pA(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),Ni((0,Fe.Z)(n),"shaderModuleService",Dy,(0,Fe.Z)(n)),(0,B.Z)((0,Fe.Z)(n),"haltonSequence",[]),(0,B.Z)((0,Fe.Z)(n),"accumulatingId",0),(0,B.Z)((0,Fe.Z)(n),"frame",0),(0,B.Z)((0,Fe.Z)(n),"timer",void 0),(0,B.Z)((0,Fe.Z)(n),"sampleRenderTarget",void 0),(0,B.Z)((0,Fe.Z)(n),"prevRenderTarget",void 0),(0,B.Z)((0,Fe.Z)(n),"outputRenderTarget",void 0),(0,B.Z)((0,Fe.Z)(n),"copyRenderTarget",void 0),(0,B.Z)((0,Fe.Z)(n),"blendModel",void 0),(0,B.Z)((0,Fe.Z)(n),"outputModel",void 0),(0,B.Z)((0,Fe.Z)(n),"copyModel",void 0),n}return(0,j.Z)(t,[{key:"getType",value:function(){return iv.Normal}},{key:"getName",value:function(){return"taa"}},{key:"init",value:function(i,o){Ra((0,Ee.Z)(t.prototype),"init",this).call(this,i,o);var s=this.rendererService,l=s.createFramebuffer,f=s.createTexture2D;this.sampleRenderTarget=l({color:f({width:1,height:1,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE})}),this.prevRenderTarget=l({color:f({width:1,height:1,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE})}),this.outputRenderTarget=l({color:f({width:1,height:1,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE})}),this.copyRenderTarget=l({color:f({width:1,height:1,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE})});for(var v=0;v<30;v++)this.haltonSequence.push([ky(v,2),ky(v,3)]);this.blendModel=this.createTriangleModel("blend-pass",vA),this.outputModel=this.createTriangleModel("copy-pass",Fy,{blend:{enable:!0,func:{srcRGB:R.ONE,dstRGB:R.ONE_MINUS_SRC_ALPHA,srcAlpha:R.ONE,dstAlpha:R.ONE_MINUS_SRC_ALPHA},equation:{rgb:R.FUNC_ADD,alpha:R.FUNC_ADD}}}),this.copyModel=this.createTriangleModel("copy-pass",Fy)}},{key:"render",value:function(i){var o=this,s=this.rendererService,l=s.clear,f=s.getViewportSize,v=s.useFramebuffer,y=f(),b=y.width,T=y.height;this.sampleRenderTarget.resize({width:b,height:T}),this.prevRenderTarget.resize({width:b,height:T}),this.outputRenderTarget.resize({width:b,height:T}),this.copyRenderTarget.resize({width:b,height:T}),this.resetFrame(),this.stopAccumulating();var M=i.multiPassRenderer.getPostProcessor().getReadFBO();v(M,function(){l({color:[0,0,0,0],depth:1,stencil:0,framebuffer:M}),i.multiPassRenderer.setRenderFlag(!1),i.render(),i.multiPassRenderer.setRenderFlag(!0)});var O=function F($){!o.accumulatingId||$!==o.accumulatingId||o.isFinished()||(o.doRender(i),window.requestAnimationFrame(function(){F($)}))};this.accumulatingId=gA++,this.timer=window.setTimeout(function(){O(o.accumulatingId)},50)}},{key:"doRender",value:function(i){var o=this,s=this.rendererService,l=s.clear,f=s.getViewportSize,v=s.useFramebuffer,y=f(),b=y.width,T=y.height,M=i.getLayerConfig(),O=M.jitterScale,F=O===void 0?1:O,$=this.haltonSequence[this.frame%this.haltonSequence.length];this.cameraService.jitterProjectionMatrix(($[0]*2-1)/b*F,($[1]*2-1)/T*F),i.multiPassRenderer.setRenderFlag(!1),i.hooks.beforeRender.call(),v(this.sampleRenderTarget,function(){l({color:[0,0,0,0],depth:1,stencil:0,framebuffer:o.sampleRenderTarget}),i.render()}),i.hooks.afterRender.call(),i.multiPassRenderer.setRenderFlag(!0);var G=i.getLayerConfig();v(this.outputRenderTarget,function(){o.blendModel.draw({uniforms:{u_opacity:G.opacity||1,u_MixRatio:o.frame===0?1:.9,u_Diffuse1:o.sampleRenderTarget,u_Diffuse2:o.frame===0?i.multiPassRenderer.getPostProcessor().getReadFBO():o.prevRenderTarget}})}),this.frame===0&&l({color:[0,0,0,0],depth:1,stencil:0,framebuffer:this.copyRenderTarget}),this.frame>=1&&(v(this.copyRenderTarget,function(){o.outputModel.draw({uniforms:{u_Texture:o.outputRenderTarget}})}),v(i.multiPassRenderer.getPostProcessor().getReadFBO(),function(){o.copyModel.draw({uniforms:{u_Texture:o.copyRenderTarget}})}),i.multiPassRenderer.getPostProcessor().render(i));var ue=this.prevRenderTarget;this.prevRenderTarget=this.outputRenderTarget,this.outputRenderTarget=ue,this.frame++,this.cameraService.clearJitterProjectionMatrix()}},{key:"isFinished",value:function(){return this.frame>=this.haltonSequence.length}},{key:"resetFrame",value:function(){this.frame=0}},{key:"stopAccumulating",value:function(){this.accumulatingId=0,window.clearTimeout(this.timer)}},{key:"createTriangleModel",value:function(i,o,s){this.shaderModuleService.registerModule(i,{vs:mA,fs:o});var l=this.shaderModuleService.getModule(i),f=l.vs,v=l.fs,y=l.uniforms,b=this.rendererService,T=b.createAttribute,M=b.createBuffer,O=b.createModel;return O((0,V.Z)({vs:f,fs:v,attributes:{a_Position:T({buffer:M({data:[-4,-4,4,-4,0,4],type:R.FLOAT}),size:2})},uniforms:(0,V.Z)({},y),depth:{enable:!1},count:3},s))}}]),t}(vg),Dy=ki(D0.prototype,"shaderModuleService",[Py],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),D0))||Oy),um=new yt.W2;um.bind(ot.IGlobalConfigService).to($a).inSingletonScope(),(0,yt.GW)((0,yt.b2)(),io.EventEmitter),um.bind(ot.IEventEmitter).to(io.EventEmitter);var By=(0,vr.Z)(um,!1),F0=function(r){var t=By.lazyInject(r);return function(n,i,o){t.call(this,n,i),o&&(o.initializer=function(){return n[i]})}},GB=function(r){var t=By.lazyMultiInject(r);return function(n,i,o){t.call(this,n,i),o&&(o.initializer=function(){return n[i]})}},jl=um,yA=0;function xA(){var e=new yt.W2;return e.parent=um,e.bind(ot.SceneID).toConstantValue("".concat(yA++)),e.bind(ot.IShaderModuleService).to(tS).inSingletonScope(),e.bind(ot.ILayerService).to(Vs).inSingletonScope(),e.bind(ot.IDebugService).to(ts).inSingletonScope(),e.bind(ot.ISceneService).to(sg).inSingletonScope(),e.bind(ot.ICameraService).to(ur).inSingletonScope(),e.bind(ot.ICoordinateSystemService).to(xp).inSingletonScope(),e.bind(ot.IInteractionService).to(N).inSingletonScope(),e.bind(ot.IPickingService).to(Vn).inSingletonScope(),e.bind(ot.IControlService).to(ii).inSingletonScope(),e.bind(ot.IMarkerService).to(dl).inSingletonScope(),e.bind(ot.IIconService).to(st).inSingletonScope(),e.bind(ot.IFontService).to(Te).inSingletonScope(),e.bind(ot.IPopupService).to(Vd).inSingletonScope(),e.bind(ot.INormalPass).to(aS).whenTargetNamed("clear"),e.bind(ot.INormalPass).to(fS).whenTargetNamed("pixelPicking"),e.bind(ot.INormalPass).to(hA).whenTargetNamed("render"),e.bind(ot.INormalPass).to(_A).whenTargetNamed("taa"),e.bind(ot.IFactoryNormalPass).toFactory(function(r){return function(t){return r.container.getNamed(ot.INormalPass,t)}}),e.bind(ot.IPostProcessingPass).to(VS).whenTargetNamed("copy"),e.bind(ot.IPostProcessingPass).to(xS).whenTargetNamed("bloom"),e.bind(ot.IPostProcessingPass).to(wS).whenTargetNamed("blurH"),e.bind(ot.IPostProcessingPass).to(OS).whenTargetNamed("blurV"),e.bind(ot.IPostProcessingPass).to(nA).whenTargetNamed("noise"),e.bind(ot.IPostProcessingPass).to(uA).whenTargetNamed("sepia"),e.bind(ot.IPostProcessingPass).to(LS).whenTargetNamed("colorHalftone"),e.bind(ot.IPostProcessingPass).to(XS).whenTargetNamed("hexagonalPixelate"),e.bind(ot.IPostProcessingPass).to(QS).whenTargetNamed("ink"),e.bind(ot.IFactoryPostProcessingPass).toFactory(function(r){return function(t){var n=r.container.getNamed(ot.IPostProcessingPass,t);return n.setName(t),n}}),e}function lm(e){var r=new yt.W2;return r.parent=e,r.bind(ot.IStyleAttributeService).to(ws).inSingletonScope(),r.bind(ot.IMultiPassRenderer).to(uS).inSingletonScope(),r.bind(ot.IPostProcessor).to(lA).inSingletonScope(),r}var bA=null;function XB(e){return bA.indexOf(e)}var Ly=oi.clamp,EA=2,$B=4,SA=64,YB=128,AA=256,TA=512,qB=8192,KB=16384,QB=32768,wA=null,Ny=131072,JB=262144,CA=524288,eL=1048576,RA=2097152,tL=4194304,MA=8388608,IA=16777216,PA=null;function mg(e,r){return e=Ly(Math.floor(e),0,255),r=Ly(Math.floor(r),0,255),256*e+r}function rL(e){var r=e.color,t=e.radius,n=e.tileX,i=e.tileY,o=e.shape,s=e.opacity,l=e.stroke,f=e.strokeWidth,v=e.strokeOpacity,y=[],b=[],T=[],M=[mg(r[0],r[1]),mg(r[2],r[3])],O=[mg(l[0],l[1]),mg(l[2],l[3])];return[[-1,-1],[1,-1],[1,1],[-1,1]].forEach(function(F){var $=_slicedToArray(F,2),G=$[0],ue=$[1];y.push([].concat(M,[(G+1)*MA+(ue+1)*RA+getShapeIndex(o)*Ny+t,(n+512)*CA+(i+512)*SA])),b.push([].concat(O,[f,v])),T.push([s,0,0,0])}),{packedBuffer:y,packedBuffer2:b,packedBuffer3:T}}function nL(e,r){if(e===0&&!r)return 0;if(e===1&&r)return 4294967295;var t=r?1:0,n=Math.floor(e*127);return n*PA+t*IA+n*Ny+t*wA+n*TA+t*AA+n*EA+t}var vd={ProjectionMatrix:"u_ProjectionMatrix",ViewMatrix:"u_ViewMatrix",ViewProjectionMatrix:"u_ViewProjectionMatrix",Zoom:"u_Zoom",ZoomScale:"u_ZoomScale",FocalDistance:"u_FocalDistance",CameraPosition:"u_CameraPosition"},Rs={MapInitStart:"mapInitStart",LayerInitStart:"layerInitStart",LayerInitEnd:"layerInitEnd",SourceInitStart:"sourceInitStart",SourceInitEnd:"sourceInitEnd",ScaleInitStart:"scaleInitStart",ScaleInitEnd:"scaleInitEnd",MappingStart:"mappingStart",MappingEnd:"mappingEnd",BuildModelStart:"buildModelStart",BuildModelEnd:"buildModelEnd"},ro=function(e){return e.LINEAR="linear",e.SEQUENTIAL="sequential",e.POWER="power",e.LOG="log",e.IDENTITY="identity",e.TIME="time",e.QUANTILE="quantile",e.QUANTIZE="quantize",e.THRESHOLD="threshold",e.CAT="cat",e.DIVERGING="diverging",e}({}),ov=function(e){return e.CONSTANT="constant",e.VARIABLE="variable",e}({}),dn=function(e){return e[e.Attribute=0]="Attribute",e[e.InstancedAttribute=1]="InstancedAttribute",e[e.Uniform=2]="Uniform",e}({}),OA=["mapload","mapchange","mapAfterFrameChange"],gg=["loaded","fontloaded","maploaded","resize","destroy","dragstart","dragging","dragend","dragcancel"],Eu=function(e){return e.IMAGE="image",e.CUSTOMIMAGE="customImage",e.ARRAYBUFFER="arraybuffer",e.RGB="rgb",e.TERRAINRGB="terrainRGB",e.CUSTOMRGB="customRGB",e.CUSTOMARRAYBUFFER="customArrayBuffer",e.CUSTOMTERRAINRGB="customTerrainRGB",e}({}),DA=function(){var e=(0,Pt.Z)(ge().mark(function r(t,n,i,o){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",new Promise(function(f,v){n({x:t.x,y:t.y,z:t.z},function(y,b){if(y||b.length===0){v(y);return}b&&$r([{data:b,bands:[0]}],i,o,function(T,M){T?v(T):M&&f(M)})})}));case 1:case"end":return l.stop()}},r)}));return function(t,n,i,o){return e.apply(this,arguments)}}(),FA=function(){var e=(0,Pt.Z)(ge().mark(function r(t,n){return ge().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",new Promise(function(s,l){n({x:t.x,y:t.y,z:t.z},function(f,v){if(f||!v){l(f);return}v instanceof ArrayBuffer?cu(v,function(y,b){y&&l(y),s(b)}):v instanceof HTMLImageElement?s(v):l(f)})}));case 1:case"end":return o.stop()}},r)}));return function(t,n){return e.apply(this,arguments)}}();function kA(e,r){return Array.isArray(e)?typeof e[0]=="string"?e.map(function(t){return h(t,r)}):e.map(function(t){return{url:h(t.url,r),bands:t.bands||[0]}}):h(e,r)}function BA(e){return typeof e=="string"?[{url:e,bands:[0]}]:typeof e[0]=="string"?e.map(function(r){return{url:r,bands:[0]}}):e}function Uy(e,r){e.xhrCancel=function(){r.map(function(t){t.abort()})}}var LA=function(){var e=(0,Pt.Z)(ge().mark(function r(t,n,i,o,s){var l,f,v,y,b,T;return ge().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(l=BA(n.url),!(l.length>1)){O.next=15;break}return O.next=4,NA(l,n);case 4:if(f=O.sent,v=f.rasterFiles,y=f.xhrList,b=f.errList,Uy(t,y),!(b.length>0)){O.next=12;break}return i(b,null),O.abrupt("return");case 12:$r(v,o,s,i),O.next=17;break;case 15:T=Ai(n,function(F,$){if(F)i(F);else if($){var G=[{data:$,bands:l[0].bands}];$r(G,o,s,i)}}),Uy(t,[T]);case 17:case"end":return O.stop()}},r)}));return function(t,n,i,o,s){return e.apply(this,arguments)}}();function NA(e,r){return k0.apply(this,arguments)}function k0(){return k0=(0,Pt.Z)(ge().mark(function e(r,t){var n,i,o,s,l,f,v,y,b,T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:n=[],i=[],o=[],s=0;case 4:if(!(s<r.length)){F.next=20;break}return l=r[s],f=(0,V.Z)((0,V.Z)({},t),{},{url:l.url}),v=l.bands,F.next=10,qi((0,V.Z)((0,V.Z)({},f),{},{type:"arrayBuffer"}));case 10:y=F.sent,b=y.err,T=y.data,M=y.xhr,b&&o.push(b),i.push(M),n.push({data:T,bands:v});case 17:s++,F.next=4;break;case 20:return F.abrupt("return",{rasterFiles:n,xhrList:i,errList:o});case 21:case"end":return F.stop()}},e)})),k0.apply(this,arguments)}var UA=function(){var e=(0,Pt.Z)(ge().mark(function r(t,n,i,o,s){var l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return l={url:kA(t,n)},v.abrupt("return",new Promise(function(y,b){LA(i,l,function(T,M){T?b(T):M&&y(M)},o,s)}));case 2:case"end":return v.stop()}},r)}));return function(t,n,i,o,s){return e.apply(this,arguments)}}(),zy=function(){var e=(0,Pt.Z)(ge().mark(function r(t,n,i,o){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return l=Array.isArray(t)?t[0]:t,o.wmtsOptions?(f=(o==null?void 0:o.getURLFromTemplate)||d,s=f(l,(0,V.Z)((0,V.Z)({},n),o.wmtsOptions))):(v=(o==null?void 0:o.getURLFromTemplate)||h,s=v(l,n)),b.abrupt("return",new Promise(function(T,M){var O,F=Pa({url:s,type:(o==null||(O=o.requestParameters)===null||O===void 0?void 0:O.type)||"arrayBuffer"},function($,G){$?M($):G&&T(G)},o.transformResponse);i.xhrCancel=function(){return F.cancel()}}));case 3:case"end":return b.stop()}},r)}));return function(t,n,i,o){return e.apply(this,arguments)}}(),Zy=function(){return{rasterData:new Uint8Array([0]),width:1,height:1}},zA={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0},iL=[Eu.ARRAYBUFFER,Eu.RGB];function ZA(e){return!!(Array.isArray(e)&&e.length===0||!Array.isArray(e)&&typeof e!="string")}function VA(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ZA(e))throw new Error("tile server url is error");var t=(r==null?void 0:r.dataType)||Eu.IMAGE;t===Eu.RGB&&(t=Eu.ARRAYBUFFER);var n=function(s,l){switch(t){case Eu.IMAGE:return zy(e,s,l,r);case Eu.CUSTOMIMAGE:case Eu.CUSTOMTERRAINRGB:return FA(l,r==null?void 0:r.getCustomData);case Eu.ARRAYBUFFER:return UA(e,s,l,(r==null?void 0:r.format)||Zy,r==null?void 0:r.operation);case Eu.CUSTOMARRAYBUFFER:case Eu.CUSTOMRGB:return DA(l,r==null?void 0:r.getCustomData,(r==null?void 0:r.format)||Zy,r==null?void 0:r.operation);default:return zy(e,s,l,r)}},i=(0,V.Z)((0,V.Z)((0,V.Z)({},zA),r),{},{getTileData:n});return{data:e,dataArray:[],tilesetOptions:i,isTile:!0}}var jA=["extent","min","max","width","height","format","operation"];function HA(e,r){var t=r.extent,n=r.min,i=r.max,o=r.width,s=r.height,l=r.format,f=r.operation,v=(0,ka.Z)(r,jA),y;if(l===void 0||gf(e))y=Array.from(e);else{var b=Array.isArray(e)?e:[e];y=an(b,l,f)}var T={_id:1,dataArray:[(0,V.Z)((0,V.Z)({_id:1,data:y,width:o,height:s},v),{},{min:n,max:i,coordinates:[[t[0],t[1]],[t[2],t[3]]]})]};return T}var WA={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0},GA=function(){var e=(0,Pt.Z)(ge().mark(function r(t){return ge().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o){var s=(0,Sn.Z)(t.bounds,4),l=s[0],f=s[1],v=s[2],y=s[3],b={layers:{testTile:{features:[{type:"Feature",properties:{key:t.x+"/"+t.y+"/"+t.z,x:(l+v)/2,y:(f+y)/2},geometry:{type:"LineString",coordinates:[[v,y],[v,f],[l,f],[l,f]]}}]}}};o(b)}));case 1:case"end":return i.stop()}},r)}));return function(t){return e.apply(this,arguments)}}();function XA(e,r){var t=function(o){return GA(o)},n=(0,V.Z)((0,V.Z)((0,V.Z)({},WA),r),{},{getTileData:t});return{data:e,dataArray:[],tilesetOptions:n,isTile:!0}}var $A=L(39720),YA=L.n($A);function Vy(e,r){var t=r.radius,n=t===void 0?40:t,i=r.maxZoom,o=i===void 0?18:i,s=r.minZoom,l=s===void 0?0:s,f=r.zoom,v=f===void 0?2:f;if(e.pointIndex){var y=e.pointIndex.getClusters(e.extent,Math.floor(v));return e.dataArray=qA(y),e}var b=new(YA())({radius:n,minZoom:l,maxZoom:o}),T={type:"FeatureCollection",features:[]};return T.features=e.dataArray.map(function(M){return{type:"Feature",geometry:{type:"Point",coordinates:M.coordinates},properties:(0,V.Z)({},M)}}),b.load(T.features),b}function qA(e){return e.map(function(r,t){return(0,V.Z)({coordinates:r.geometry.coordinates,_id:t+1},r.properties)})}function KA(e){if(e.length===0)throw new Error("max requires at least one data point");for(var r=e[0],t=1;t<e.length;t++)e[t]>r&&(r=e[t]);return r}function QA(e){if(e.length===0)throw new Error("min requires at least one data point");for(var r=e[0],t=1;t<e.length;t++)e[t]<r&&(r=e[t]);return r}function jy(e){if(e.length===0)return 0;for(var r=e[0],t=0,n,i=1;i<e.length;i++)n=r+e[i]*1,Math.abs(r)>=Math.abs(e[i])?t+=r-n+e[i]:t+=e[i]-n+r,r=n;return r+t*1}function JA(e){if(e.length===0)throw new Error("mean requires at least one data point");return jy(e)/e.length}var eT={min:QA,max:KA,mean:JA,sum:jy};function tT(e){var r=rT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function rT(){if(typeof Reflect=="undefined"||!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(e){return!1}}var nT=oi.cloneDeep,Hy=oi.isFunction,iT=oi.isString,aT=oi.mergeWith;function oT(e,r){if(Array.isArray(r))return r}var sT=function(e){(0,Le.Z)(t,e);var r=tT(t);function t(n,i){var o;return(0,Q.Z)(this,t),o=r.call(this),(0,B.Z)((0,Fe.Z)(o),"type","source"),(0,B.Z)((0,Fe.Z)(o),"isTile",!1),(0,B.Z)((0,Fe.Z)(o),"inited",!1),(0,B.Z)((0,Fe.Z)(o),"hooks",{init:new xu}),(0,B.Z)((0,Fe.Z)(o),"parser",{type:"geojson"}),(0,B.Z)((0,Fe.Z)(o),"transforms",[]),(0,B.Z)((0,Fe.Z)(o),"cluster",!1),(0,B.Z)((0,Fe.Z)(o),"clusterOptions",{enable:!1,radius:40,maxZoom:20,zoom:-99,method:"count"}),(0,B.Z)((0,Fe.Z)(o),"invalidExtent",!1),(0,B.Z)((0,Fe.Z)(o),"dataArrayChanged",!1),(0,B.Z)((0,Fe.Z)(o),"cfg",{autoRender:!0}),o.originData=n,o.initCfg(i),o.init().then(function(){o.inited=!0,o.emit("update",{type:"inited"})}),o}return(0,j.Z)(t,[{key:"getSourceCfg",value:function(){return this.cfg}},{key:"getClusters",value:function(i){return this.clusterIndex.getClusters(this.caculClusterExtent(2),i)}},{key:"getClustersLeaves",value:function(i){return this.clusterIndex.getLeaves(i,1/0)}},{key:"getParserType",value:function(){return this.parser.type}},{key:"updateClusterData",value:function(i){var o=this,s=this.clusterOptions,l=s.method,f=l===void 0?"sum":l,v=s.field,y=this.clusterIndex.getClusters(this.caculClusterExtent(2),Math.floor(i));this.clusterOptions.zoom=i,y.forEach(function(b){b.id||(b.properties.point_count=1)}),(v||Hy(f))&&(y=y.map(function(b){var T=b.id;if(T){var M=o.clusterIndex.getLeaves(T,1/0),O=M.map(function(G){return G.properties}),F;if(iT(f)&&v){var $=mf(O,v);F=eT[f]($)}Hy(f)&&(F=f(O)),b.properties.stat=F}else b.properties.point_count=1;return b})),this.data=fe("geojson")({type:"FeatureCollection",features:y}),this.executeTrans()}},{key:"getFeatureById",value:function(i){var o=this.parser,s=o.type,l=s===void 0?"geojson":s,f=o.geometry;if(l==="geojson"&&!this.cluster){var v=i<this.originData.features.length?this.originData.features[i]:"null",y=nT(v);if(y!=null&&y.properties&&(this.transforms.length!==0||this.dataArrayChanged)){var b=this.data.dataArray.find(function(T){return T._id===i});y.properties=b}return y}else return l==="json"&&f?this.data.dataArray.find(function(T){return T._id===i}):i<this.data.dataArray.length?this.data.dataArray[i]:"null"}},{key:"updateFeaturePropertiesById",value:function(i,o){this.data.dataArray=this.data.dataArray.map(function(s){return s._id===i?(0,V.Z)((0,V.Z)({},s),o):s}),this.dataArrayChanged=!0,this.emit("update",{type:"update"})}},{key:"getFeatureId",value:function(i,o){var s=this.data.dataArray.find(function(l){return l[i]===o});return s==null?void 0:s._id}},{key:"setData",value:function(i,o){var s=this;this.originData=i,this.dataArrayChanged=!1,this.initCfg(o),this.init().then(function(){s.emit("update",{type:"update"})})}},{key:"reloadAllTile",value:function(){var i;(i=this.tileset)===null||i===void 0||i.reloadAll()}},{key:"reloadTilebyId",value:function(i,o,s){var l;(l=this.tileset)===null||l===void 0||l.reloadTileById(i,o,s)}},{key:"reloadTileByLnglat",value:function(i,o,s){var l;(l=this.tileset)===null||l===void 0||l.reloadTileByLnglat(i,o,s)}},{key:"getTileExtent",value:function(i,o){var s;return(s=this.tileset)===null||s===void 0?void 0:s.getTileExtent(i,o)}},{key:"getTileByZXY",value:function(i,o,s){var l;return(l=this.tileset)===null||l===void 0?void 0:l.getTileByZXY(i,o,s)}},{key:"reloadTileByExtent",value:function(i,o){var s;(s=this.tileset)===null||s===void 0||s.reloadTileByExtent(i,o)}},{key:"destroy",value:function(){var i;this.removeAllListeners(),this.originData=null,this.clusterIndex=null,this.data=null,(i=this.tileset)===null||i===void 0||i.destroy()}},{key:"processData",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s=this;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",new Promise(function(v,y){try{s.excuteParser(),s.initCluster(),s.executeTrans(),v({})}catch(b){y(b)}}));case 1:case"end":return f.stop()}},o)}));function i(){return n.apply(this,arguments)}return i}()},{key:"initCfg",value:function(i){this.cfg=aT(this.cfg,i,oT);var o=this.cfg;o&&(o.parser&&(this.parser=o.parser),o.transforms&&(this.transforms=o.transforms),this.cluster=o.cluster||!1,o.clusterOptions&&(this.cluster=!0,this.clusterOptions=(0,V.Z)((0,V.Z)({},this.clusterOptions),o.clusterOptions)))}},{key:"init",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.inited=!1,l.next=3,this.processData();case 3:this.inited=!0;case 4:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"excuteParser",value:function(){var i=this.parser,o=i.type||"geojson",s=fe(o);this.data=s(this.originData,i),this.tileset=this.initTileset(),!i.cancelExtent&&(this.extent=Cl(this.data.dataArray),this.setCenter(this.extent),this.invalidExtent=this.extent[0]===this.extent[2]||this.extent[1]===this.extent[3])}},{key:"setCenter",value:function(i){this.center=[(i[0]+i[2])/2,(i[1]+i[3])/2],(isNaN(this.center[0])||isNaN(this.center[1]))&&(this.center=[108.92361111111111,34.54083333333333])}},{key:"initTileset",value:function(){var i=this.data.tilesetOptions;if(i){if(this.isTile=!0,this.tileset)return this.tileset.updateOptions(i),this.tileset;var o=new ff((0,V.Z)({},i));return o}}},{key:"executeTrans",value:function(){var i=this,o=this.transforms;o.forEach(function(s){var l=s.type,f=Qe(l)(i.data,s);Object.assign(i.data,f)})}},{key:"initCluster",value:function(){if(this.cluster){var i=this.clusterOptions||{};this.clusterIndex=Vy(this.data,i)}}},{key:"caculClusterExtent",value:function(i){var o=[[-1/0,-1/0],[1/0,1/0]];return this.invalidExtent||(o=of(pa(this.extent),i)),o[0].concat(o[1])}}]),t}(io.EventEmitter);function uT(e,r){var t=r.callback;return t&&(e.dataArray=e.dataArray.filter(t)),e}function Wy(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=lT(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function lT(e,r){if(e){if(typeof e=="string")return Gy(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Gy(e,r)}}function Gy(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var B0=6378e3;function cT(e,r){var t=e.dataArray,n=r.size,i=n===void 0?10:n,o=i/(2*Math.PI*B0)*(256<<20)/2,s=fT(t,i),l=s.gridHash,f=s.gridOffset,v=vT(l,f,r);return{yOffset:o,xOffset:o,radius:o,type:"grid",dataArray:v}}function fT(e,r){var t=1/0,n=-1/0,i,o=Wy(e),s;try{for(o.s();!(s=o.n()).done;){var l=s.value;i=l.coordinates[1],Number.isFinite(i)&&(t=i<t?i:t,n=i>n?i:n)}}catch(xe){o.e(xe)}finally{o.f()}var f=(t+n)/2,v=hT(r,f);if(v.xOffset<=0||v.yOffset<=0)return{gridHash:{},gridOffset:v};var y={},b=Wy(e),T;try{for(b.s();!(T=b.n()).done;){var M=T.value,O=M.coordinates[1],F=M.coordinates[0];if(Number.isFinite(O)&&Number.isFinite(F)){var $=Math.floor((O+90)/v.yOffset),G=Math.floor((F+180)/v.xOffset),ue="".concat($,"-").concat(G);y[ue]=y[ue]||{count:0,points:[]},y[ue].count+=1,y[ue].points.push(M)}}}catch(xe){b.e(xe)}finally{b.f()}return{gridHash:y,gridOffset:v}}function hT(e,r){var t=pT(e),n=dT(r,e);return{yOffset:t,xOffset:n}}function pT(e){return e/B0*(180/Math.PI)}function dT(e,r){return r/B0*(180/Math.PI)/Math.cos(e*Math.PI/180)}function vT(e,r,t){return Object.keys(e).reduce(function(n,i,o){var s=i.split("-"),l=parseInt(s[0],10),f=parseInt(s[1],10),v={};if(t.field&&t.method){var y=lf(e[i].points,t.field);v[t.method]=Il[t.method](y)}return Object.assign(v,{_id:o,coordinates:Fo([-180+r.xOffset*(f+.5),-90+r.yOffset*(l+.5)]),rawData:e[i].points,count:e[i].count}),n.push(v),n},[])}var sv=Math.PI/3,mT=[0,sv,2*sv,3*sv,4*sv,5*sv];function gT(e){return e[0]}function _T(e){return e[1]}function yT(){var e=0,r=0,t=1,n=1,i=gT,o=_T,s,l,f;function v(b){var T={},M=[],O,F=b.length;for(O=0;O<F;++O)if(!(isNaN(G=+i.call(null,$=b[O],O,b))||isNaN(ue=+o.call(null,$,O,b)))){var $,G,ue,xe=Math.round(ue=ue/f),ze=Math.round(G=G/l-(xe&1)/2),Je=ue-xe;if(Math.abs(Je)*3>1){var ht=G-ze,gt=ze+(G<ze?-1:1)/2,Ot=xe+(ue<xe?-1:1),tr=G-gt,Ir=ue-Ot;ht*ht+Je*Je>tr*tr+Ir*Ir&&(ze=gt+(xe&1?1:-1)/2,xe=Ot)}var Er=ze+"-"+xe,mn=T[Er];mn?mn.push($):(M.push(mn=T[Er]=[$]),mn.x=(ze+(xe&1)/2)*l,mn.y=xe*f)}return M}function y(b){var T=0,M=0;return mT.map(function(O){var F=Math.sin(O)*b,$=-Math.cos(O)*b,G=F-T,ue=$-M;return T=F,M=$,[G,ue]})}return v.hexagon=function(b){return"m"+y(b==null?s:+b).join("l")+"z"},v.centers=function(){for(var b=[],T=Math.round(r/f),M=Math.round(e/l),O=T*f;O<n+s;O+=f,++T)for(var F=M*l+(T&1)*l/2;F<t+l/2;F+=l)b.push([F,O]);return b},v.mesh=function(){var b=y(s).slice(0,4).join("l");return v.centers().map(function(T){return"M"+T+"m"+b}).join("")},v.x=function(b){return arguments.length?(i=b,v):i},v.y=function(b){return arguments.length?(o=b,v):o},v.radius=function(b){return arguments.length?(s=+b,l=s*2*Math.sin(sv),f=s*1.5,v):s},v.size=function(b){return arguments.length?(e=r=0,t=+b[0],n=+b[1],v):[t-e,n-r]},v.extent=function(b){return arguments.length?(e=+b[0][0],r=+b[0][1],t=+b[1][0],n=+b[1][1],v):[[e,r],[t,n]]},v.radius(1)}var xT=6378e3;function bT(e,r){var t=e.dataArray,n=r.size,i=n===void 0?10:n,o=r.method,s=o===void 0?"sum":o,l=i/(2*Math.PI*xT)*(256<<20)/2,f=t.map(function(T){var M=Fo(T.coordinates),O=(0,Sn.Z)(M,2),F=O[0],$=O[1];return(0,V.Z)((0,V.Z)({},T),{},{coordinates:[F,$]})}),v=yT().radius(l).x(function(T){return T.coordinates[0]}).y(function(T){return T.coordinates[1]}),y=v(f),b={dataArray:y.map(function(T,M){var O;if(r.field&&s){var F=lf(T,r.field);T[s]=Il[s](F)}return O={},(0,B.Z)(O,r.method,T[s]),(0,B.Z)(O,"count",T.length),(0,B.Z)(O,"rawData",T),(0,B.Z)(O,"coordinates",[T.x,T.y]),(0,B.Z)(O,"_id",M),O}),radius:l,xOffset:l,yOffset:l,type:"hexagon"};return b}function ET(e,r){var t=r.sourceField,n=r.targetField,i=r.data,o={};return i.forEach(function(s){o[s[t]]=s}),e.dataArray=e.dataArray.map(function(s){var l=s[n];return(0,V.Z)((0,V.Z)({},s),o[l])}),e}function ST(e,r){var t=r.callback;return t&&(e.dataArray=e.dataArray.map(t)),e}se("rasterTile",VA),se("mvt",Ur),se("geojsonvt",z),se("testTile",XA),se("geojson",pp),se("jsonTile",pr),se("image",Ae),se("csv",_f),se("json",Zc),se("raster",ui),se("rasterRgb",HA),ae("cluster",Vy),ae("filter",uT),ae("join",ET),ae("map",ST),ae("grid",cT),ae("hexagon",bT);var Xy=sT;function AT(e){var r=TT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function TT(){if(typeof Reflect=="undefined"||!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(e){return!1}}var wT=function(e){(0,Le.Z)(t,e);var r=AT(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this),(0,B.Z)((0,Fe.Z)(i),"added",!1),(0,B.Z)((0,Fe.Z)(i),"eventHandle",function(o){i.polyfillEvent(o),i.emit(o.type,{target:o,data:i.markerOption.extData,lngLat:i.lngLat})}),i.markerOption=(0,V.Z)((0,V.Z)({},i.getDefault()),n),tc(["update","onMove","onMapClick"],(0,Fe.Z)(i)),i.init(),i}return(0,j.Z)(t,[{key:"getMarkerLayerContainerSize",value:function(){}},{key:"getDefault",value:function(){return{element:void 0,anchor:ma.BOTTOM,offsets:[0,0],color:"#5B8FF9",draggable:!1}}},{key:"addTo",value:function(i){this.scene=i,this.mapsService=i.get(ot.IMapService),this.sceneSerive=i.get(ot.ISceneService);var o=this.markerOption.element;return this.mapsService.getMarkerContainer().appendChild(o),this.registerMarkerEvent(o),this.mapsService.on("camerachange",this.update),this.update(),this.added=!0,this.emit("added"),this}},{key:"remove",value:function(){this.mapsService&&(this.mapsService.off("click",this.onMapClick),this.mapsService.off("move",this.update),this.mapsService.off("moveend",this.update),this.mapsService.off("camerachange",this.update)),this.unRegisterMarkerEvent(),this.removeAllListeners();var i=this.markerOption.element;return i&&Ii(i),this.popup&&this.popup.remove(),this}},{key:"setLnglat",value:function(i){return this.lngLat=i,Array.isArray(i)&&(this.lngLat={lng:i[0],lat:i[1]}),this.popup&&this.popup.setLnglat(this.lngLat),this.update(),this}},{key:"getLnglat",value:function(){return this.lngLat}},{key:"getElement",value:function(){return this.markerOption.element}},{key:"setElement",value:function(i){var o=this;if(!this.added)return this.once("added",function(){o.setElement(i)}),this;var s=this.markerOption.element;return s&&Ii(s),this.markerOption.element=i,this.init(),this.mapsService.getMarkerContainer().appendChild(i),this.registerMarkerEvent(i),this.update(),this}},{key:"openPopup",value:function(){var i=this;if(!this.added)return this.once("added",function(){i.openPopup()}),this;var o=this.popup;return o?(o.isOpen()||o.addTo(this.scene),this):this}},{key:"closePopup",value:function(){var i=this;this.added||this.once("added",function(){i.closePopup()});var o=this.popup;return o&&o.remove(),this}},{key:"setPopup",value:function(i){return this.popup=i,this.lngLat&&this.popup.setLnglat(this.lngLat),this}},{key:"togglePopup",value:function(){var i=this.popup;if(i)i.isOpen()?i.remove():i.addTo(this.scene);else return this;return this}},{key:"getPopup",value:function(){return this.popup}},{key:"getOffset",value:function(){return this.markerOption.offsets}},{key:"setDraggable",value:function(i){throw new Error("Method not implemented.")}},{key:"isDraggable",value:function(){return this.markerOption.draggable}},{key:"getExtData",value:function(){return this.markerOption.extData}},{key:"setExtData",value:function(i){this.markerOption.extData=i}},{key:"update",value:function(){if(this.mapsService){var i=this.markerOption,o=i.element,s=i.anchor;this.updatePosition(),Fu(o,"".concat(Aa[s]))}}},{key:"onMapClick",value:function(i){var o=this.markerOption.element;this.popup&&o&&this.togglePopup()}},{key:"getCurrentContainerSize",value:function(){var i=this.mapsService.getContainer();return{containerHeight:(i==null?void 0:i.scrollHeight)||0,containerWidth:(i==null?void 0:i.scrollWidth)||0,bounds:this.mapsService.getBounds()}}},{key:"updatePosition",value:function(){if(this.mapsService){var i=this.markerOption,o=i.element,s=i.offsets,l=this.lngLat,f=l.lng,v=l.lat,y=this.mapsService.lngLatToContainer([f,v]);if(o){o.style.display="block",o.style.whiteSpace="nowrap";var b=this.getMarkerLayerContainerSize()||this.getCurrentContainerSize(),T=b.containerHeight,M=b.containerWidth,O=b.bounds;if(!O)return;if(Math.abs(O[0][0])>180||Math.abs(O[1][0])>180){if(y.x>M){var F=this.mapsService.lngLatToContainer([f-360,v]);y.x=F.x}if(y.x<0){var $=this.mapsService.lngLatToContainer([f+360,v]);y.x=$.x}}(y.x>M||y.x<0||y.y>T||y.y<0)&&(o.style.display="none"),o.style.left=y.x+s[0]+"px",o.style.top=y.y-s[1]+"px"}}}},{key:"init",value:function(){var i=this,o=this.markerOption.element,s=this.markerOption,l=s.color,f=s.anchor;if(!o){this.defaultMarker=!0,o=ta("div"),this.markerOption.element=o;var v=document.createElementNS("http://www.w3.org/2000/svg","svg");v.setAttributeNS(null,"display","block"),v.setAttributeNS(null,"height","48px"),v.setAttributeNS(null,"width","48px"),v.setAttributeNS(null,"viewBox","0 0 1024 1024");var y=document.createElementNS("http://www.w3.org/2000/svg","path");y.setAttributeNS(null,"d","M512 490.666667C453.12 490.666667 405.333333 442.88 405.333333 384 405.333333 325.12 453.12 277.333333 512 277.333333 570.88 277.333333 618.666667 325.12 618.666667 384 618.666667 442.88 570.88 490.666667 512 490.666667M512 85.333333C346.88 85.333333 213.333333 218.88 213.333333 384 213.333333 608 512 938.666667 512 938.666667 512 938.666667 810.666667 608 810.666667 384 810.666667 218.88 677.12 85.333333 512 85.333333Z"),y.setAttributeNS(null,"fill",l),v.appendChild(y),o.appendChild(v)}fu(o,"l7-marker"),Object.keys(this.markerOption.style||{}).forEach(function(b){var T,M,O=((T=i.markerOption)===null||T===void 0?void 0:T.style)&&((M=i.markerOption)===null||M===void 0?void 0:M.style[b]);o&&(o.style[b]=O)}),$l(o,f,"marker")}},{key:"registerMarkerEvent",value:function(i){i.addEventListener("click",this.onMapClick),i.addEventListener("mousemove",this.eventHandle),i.addEventListener("click",this.eventHandle),i.addEventListener("mousedown",this.eventHandle),i.addEventListener("mouseup",this.eventHandle),i.addEventListener("dblclick",this.eventHandle),i.addEventListener("contextmenu",this.eventHandle),i.addEventListener("mouseover",this.eventHandle),i.addEventListener("mouseout",this.eventHandle),i.addEventListener("touchstart",this.eventHandle),i.addEventListener("touchend",this.eventHandle)}},{key:"unRegisterMarkerEvent",value:function(){var i=this.getElement();i.removeEventListener("click",this.onMapClick),i.removeEventListener("mousemove",this.eventHandle),i.removeEventListener("click",this.eventHandle),i.removeEventListener("mousedown",this.eventHandle),i.removeEventListener("mouseup",this.eventHandle),i.removeEventListener("dblclick",this.eventHandle),i.removeEventListener("contextmenu",this.eventHandle),i.removeEventListener("mouseover",this.eventHandle),i.removeEventListener("mouseout",this.eventHandle),i.removeEventListener("touchstart",this.eventHandle),i.removeEventListener("touchend",this.eventHandle)}},{key:"polyfillEvent",value:function(i){!this.mapsService||this.mapsService.version!=="GAODE2.x"||ec()||(i.type==="touchstart"&&(this.touchStartTime=Date.now()),i.type==="touchend"&&Date.now()-this.touchStartTime<300&&this.emit("click",{target:i,data:this.markerOption.extData,lngLat:this.lngLat}))}},{key:"addDragHandler",value:function(i){return null}},{key:"onUp",value:function(i){throw new Error("Method not implemented.")}}]),t}(io.EventEmitter);function aL(e){var r=CT();return function(){var n=_getPrototypeOf(e),i;if(r){var o=_getPrototypeOf(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function CT(){if(typeof Reflect=="undefined"||!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(e){return!1}}var oL=oi.merge,sL=null,uL=L(16604);function RT(e){var r=MT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function MT(){if(typeof Reflect=="undefined"||!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(e){return!1}}var uv=function(e){(0,Le.Z)(t,e);var r=RT(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this),t.controlCount++,i.controlOption=(0,V.Z)((0,V.Z)({},i.getDefault(n)),n||{}),i}return(0,j.Z)(t,[{key:"getOptions",value:function(){return this.controlOption}},{key:"setOptions",value:function(i){var o=this.getDefault(i);Object.entries(i).forEach(function(s){var l=(0,Sn.Z)(s,2),f=l[0],v=l[1];v===void 0&&(i[f]=o[f])}),"position"in i&&this.setPosition(i.position),"className"in i&&this.setClassName(i.className),"style"in i&&this.setStyle(i.style),this.controlOption=(0,V.Z)((0,V.Z)({},this.controlOption),i)}},{key:"addTo",value:function(i){this.mapsService=i.get(ot.IMapService),this.renderService=i.get(ot.IRendererService),this.layerService=i.get(ot.ILayerService),this.controlService=i.get(ot.IControlService),this.configService=i.get(ot.IGlobalConfigService),this.scene=i.get(ot.ISceneService),this.sceneContainer=i,this.isShow=!0,this.container=this.onAdd(),fu(this.container,"l7-control");var o=this.controlOption,s=o.className,l=o.style;return s&&this.setClassName(s),l&&this.setStyle(l),this.insertContainer(),this.emit("add",this),this}},{key:"remove",value:function(){if(!this.mapsService)return this;Ii(this.container),this.onRemove(),this.emit("remove",this)}},{key:"onAdd",value:function(){return ta("div")}},{key:"onRemove",value:function(){}},{key:"show",value:function(){var i=this.container;Du(i,"l7-control--hide"),this.isShow=!0,this.emit("show",this)}},{key:"hide",value:function(){var i=this.container;fu(i,"l7-control--hide"),this.isShow=!1,this.emit("hide",this)}},{key:"getDefault",value:function(i){return{position:xr.TOPRIGHT,name:"".concat(t.controlCount)}}},{key:"getContainer",value:function(){return this.container}},{key:"getIsShow",value:function(){return this.isShow}},{key:"_refocusOnMap",value:function(i){if(this.mapsService&&i&&i.screenX>0&&i.screenY>0){var o=this.mapsService.getContainer();o!==null&&o.focus()}}},{key:"setPosition",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xr.TOPLEFT,o=this.controlService;return o&&o.removeControl(this),this.controlOption.position=i,o&&o.addControl(this,this.sceneContainer),this}},{key:"setClassName",value:function(i){var o=this.container,s=this.controlOption.className;s&&Du(o,s),i&&fu(o,i)}},{key:"setStyle",value:function(i){var o=this.container;i?o.setAttribute("style",i):o.removeAttribute("style")}},{key:"insertContainer",value:function(){var i=this.controlOption.position,o=this.container;if(i instanceof Element)i.appendChild(o);else{var s=this.controlService.controlCorners[i];["bottomleft","bottomright","righttop","rightbottom"].includes(i)?s.insertBefore(o,s.firstChild):s.appendChild(o)}}},{key:"checkUpdateOption",value:function(i,o){return o.some(function(s){return s in i})}}]),t}(vu());(0,B.Z)(uv,"controlCount",0);function IT(e){var r=PT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function PT(){if(typeof Reflect=="undefined"||!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(e){return!1}}var _g=function(e){(0,Le.Z)(t,e);var r=IT(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"isDisable",!1),n}return(0,j.Z)(t,[{key:"setIsDisable",value:function(i){if(this.isDisable=i,i){var o;(o=this.button)===null||o===void 0||o.setAttribute("disabled","true")}else{var s;(s=this.button)===null||s===void 0||s.removeAttribute("disabled")}}},{key:"createButton",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return ta("button","l7-button-control ".concat(i))}},{key:"onAdd",value:function(){this.button=this.createButton(),this.isDisable=!1;var i=this.controlOption,o=i.title,s=i.btnText,l=i.btnIcon;return this.setBtnTitle(o),this.setBtnText(s),this.setBtnIcon(l),this.button}},{key:"onRemove",value:function(){this.button=this.buttonIcon=this.buttonText=void 0,this.isDisable=!1}},{key:"setOptions",value:function(i){var o=i.title,s=i.btnText,l=i.btnIcon;this.checkUpdateOption(i,["title"])&&this.setBtnTitle(o),this.checkUpdateOption(i,["btnIcon"])&&this.setBtnIcon(l),this.checkUpdateOption(i,["btnText"])&&this.setBtnText(s),Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i)}},{key:"setBtnTitle",value:function(i){var o;(o=this.button)===null||o===void 0||o.setAttribute("title",i!=null?i:"")}},{key:"setBtnIcon",value:function(i){if(this.buttonIcon&&Ii(this.buttonIcon),i){var o,s=(o=this.button)===null||o===void 0?void 0:o.firstChild;if(s){var l;(l=this.button)===null||l===void 0||l.insertBefore(i,s)}else{var f;(f=this.button)===null||f===void 0||f.appendChild(i)}this.buttonIcon=i}}},{key:"setBtnText",value:function(i){if(this.button)if(Du(this.button,"l7-button-control--row"),Du(this.button,"l7-button-control--column"),i){var o=this.buttonText;if(!o){var s;o=ta("div","l7-button-control__text"),(s=this.button)===null||s===void 0||s.appendChild(o),this.buttonText=o}o.innerText=i,fu(this.button,this.controlOption.vertical?"l7-button-control--column":"l7-button-control--row")}else!i&&this.buttonText&&(Ii(this.buttonText),this.buttonText=void 0)}}]),t}(uv);function OT(e){var r=DT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function DT(){if(typeof Reflect=="undefined"||!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(e){return!1}}var $y=function(e){(0,Le.Z)(t,e);var r=OT(t);function t(n,i){var o;return(0,Q.Z)(this,t),o=r.call(this),(0,B.Z)((0,Fe.Z)(o),"isShow",!1),(0,B.Z)((0,Fe.Z)(o),"timeout",null),(0,B.Z)((0,Fe.Z)(o),"show",function(){return o.isShow||!o.contentDOM.innerHTML||(o.resetPopperPosition(),Du(o.popperDOM,"l7-popper-hide"),o.isShow=!0,o.option.unique&&t.conflictPopperList.forEach(function(s){s!==(0,Fe.Z)(o)&&s.isShow&&s.hide()}),o.emit("show"),window.addEventListener("pointerdown",o.onPopperUnClick)),(0,Fe.Z)(o)}),(0,B.Z)((0,Fe.Z)(o),"hide",function(){return o.isShow&&(fu(o.popperDOM,"l7-popper-hide"),o.isShow=!1,o.emit("hide"),window.removeEventListener("pointerdown",o.onPopperUnClick)),(0,Fe.Z)(o)}),(0,B.Z)((0,Fe.Z)(o),"setHideTimeout",function(){o.timeout||(o.timeout=window.setTimeout(function(){o.isShow&&(o.hide(),o.timeout=null)},300))}),(0,B.Z)((0,Fe.Z)(o),"clearHideTimeout",function(){o.timeout&&(window.clearTimeout(o.timeout),o.timeout=null)}),(0,B.Z)((0,Fe.Z)(o),"onBtnClick",function(){o.isShow?o.hide():o.show()}),(0,B.Z)((0,Fe.Z)(o),"onPopperUnClick",function(s){Tl(s.target,[".l7-button-control",".l7-popper-content"])||o.hide()}),(0,B.Z)((0,Fe.Z)(o),"onBtnMouseLeave",function(){o.setHideTimeout()}),(0,B.Z)((0,Fe.Z)(o),"onBtnMouseMove",function(){o.clearHideTimeout(),!o.isShow&&o.show()}),o.button=n,o.option=i,o.init(),i.unique&&t.conflictPopperList.push((0,Fe.Z)(o)),o}return(0,j.Z)(t,[{key:"buttonRect",get:function(){return this.button.getBoundingClientRect()}},{key:"getPopperDOM",value:function(){return this.popperDOM}},{key:"getIsShow",value:function(){return this.isShow}},{key:"getContent",value:function(){return this.content}},{key:"setContent",value:function(i){typeof i=="string"?this.contentDOM.innerHTML=i:i instanceof HTMLElement&&(ca(this.contentDOM),this.contentDOM.appendChild(i)),this.content=i}},{key:"init",value:function(){var i=this.option.trigger;this.popperDOM=this.createPopper(),i==="click"?this.button.addEventListener("click",this.onBtnClick):(this.button.addEventListener("mousemove",this.onBtnMouseMove),this.button.addEventListener("mouseleave",this.onBtnMouseLeave),this.popperDOM.addEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.addEventListener("mouseleave",this.onBtnMouseLeave))}},{key:"destroy",value:function(){this.button.removeEventListener("click",this.onBtnClick),this.button.removeEventListener("mousemove",this.onBtnMouseMove),this.button.removeEventListener("mousemove",this.onBtnMouseLeave),this.popperDOM.removeEventListener("mousemove",this.onBtnMouseMove),this.popperDOM.removeEventListener("mouseleave",this.onBtnMouseLeave),Ii(this.popperDOM)}},{key:"resetPopperPosition",value:function(){var i={},o=this.option,s=o.container,l=o.offset,f=l===void 0?[0,0]:l,v=o.placement,y=(0,Sn.Z)(f,2),b=y[0],T=y[1],M=this.button.getBoundingClientRect(),O=s.getBoundingClientRect(),F=gh(M,O),$=F.left,G=F.right,ue=F.top,xe=F.bottom,ze=!1,Je=!1;/^(left|right)/.test(v)?(v.includes("left")?i.right="".concat(M.width+G,"px"):v.includes("right")&&(i.left="".concat(M.width+$,"px")),v.includes("start")?i.top="".concat(ue,"px"):v.includes("end")?i.bottom="".concat(xe,"px"):(i.top="".concat(ue+M.height/2,"px"),Je=!0,i.transform="translate(".concat(b,"px, calc(").concat(T,"px - 50%))"))):/^(top|bottom)/.test(v)&&(v.includes("top")?i.bottom="".concat(M.height+xe,"px"):v.includes("bottom")&&(i.top="".concat(M.height+ue,"px")),v.includes("start")?i.left="".concat($,"px"):v.includes("end")?i.right="".concat(G,"px"):(i.left="".concat($+M.width/2,"px"),ze=!0,i.transform="translate(calc(".concat(b,"px - 50%), ").concat(T,"px)"))),i.transform="translate(calc(".concat(b,"px - ").concat(ze?"50%":"0%","), calc(").concat(T,"px - ").concat(Je?"50%":"0%",")");var ht=v.split("-");ht.length&&fu(this.popperDOM,ht.map(function(gt){return"l7-popper-".concat(gt)}).join(" ")),Qs(this.popperDOM,rl(i))}},{key:"createPopper",value:function(){var i=this.option,o=i.container,s=i.className,l=s===void 0?"":s,f=i.content,v=ta("div","l7-popper l7-popper-hide ".concat(l)),y=ta("div","l7-popper-content"),b=ta("div","l7-popper-arrow");return v.appendChild(y),v.appendChild(b),o.appendChild(v),this.popperDOM=v,this.contentDOM=y,f&&this.setContent(f),v}}]),t}(io.EventEmitter);(0,B.Z)($y,"conflictPopperList",[]);function FT(e){var r=kT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function kT(){if(typeof Reflect=="undefined"||!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(e){return!1}}var BT={topleft:"right-start",topcenter:"bottom",topright:"left-start",bottomleft:"right-end",bottomcenter:"top",bottomright:"left-end",lefttop:"bottom-start",leftcenter:"right",leftbottom:"top-start",righttop:"bottom-end",rightcenter:"left",rightbottom:"top-end"},LT=function(e){(0,Le.Z)(t,e);var r=FT(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getPopper",value:function(){return this.popper}},{key:"hide",value:function(){this.popper.hide(),Ra((0,Ee.Z)(t.prototype),"hide",this).call(this)}},{key:"getDefault",value:function(i){var o,s=Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i),l=(o=i==null?void 0:i.position)!==null&&o!==void 0?o:s.position;return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{popperPlacement:l instanceof Element?"bottom":BT[l],popperTrigger:"click"})}},{key:"onAdd",value:function(){var i=Ra((0,Ee.Z)(t.prototype),"onAdd",this).call(this);return this.initPopper(),i}},{key:"onRemove",value:function(){this.popper.destroy()}},{key:"initPopper",value:function(){var i=this,o=this.controlOption,s=o.popperClassName,l=o.popperPlacement,f=o.popperTrigger,v=this.mapsService.getMapContainer();return this.popper=new $y(this.button,{className:s,placement:l,trigger:f,container:v,unique:!0}),this.popper.on("show",function(){i.emit("popperShow",i)}).on("hide",function(){i.emit("popperHide",i)}),this.popper}},{key:"setOptions",value:function(i){if(Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i),this.checkUpdateOption(i,["popperPlacement","popperTrigger","popperClassName"])){var o=this.popper.getContent();this.popper.destroy(),this.initPopper(),this.popper.setContent(o)}}}]),t}(_g);function NT(e){var r=UT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function UT(){if(typeof Reflect=="undefined"||!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(e){return!1}}var Rp=function(e){return e.ActiveOptionClassName="l7-select-control-item-active",e.OptionValueAttrKey="data-option-value",e.OptionIndexAttrKey="data-option-index",e}(Rp||{}),Yy=function(e){(0,Le.Z)(t,e);var r=NT(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"selectValue",[]),(0,B.Z)((0,Fe.Z)(n),"createNormalOption",function(l){var f=n.selectValue.includes(l.value),v=ta("div","l7-select-control-item ".concat(f?Rp.ActiveOptionClassName:""));n.getIsMultiple()&&v.appendChild(n.createCheckbox(f)),l.icon&&v.appendChild(l.icon);var y=ta("span");return y.innerText=l.text,v.appendChild(y),v}),(0,B.Z)((0,Fe.Z)(n),"onItemClick",function(l){if(n.getIsMultiple()){var f=n.selectValue.findIndex(function(v){return v===l.value});f>-1?n.selectValue.splice(f,1):n.selectValue=[].concat((0,Kt.Z)(n.selectValue),[l.value])}else n.selectValue=[l.value];n.setSelectValue(n.selectValue)}),n}return(0,j.Z)(t,[{key:"setOptions",value:function(i){Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i);var o=i.options;o&&this.popper.setContent(this.getPopperContent(o))}},{key:"onAdd",value:function(){var i=Ra((0,Ee.Z)(t.prototype),"onAdd",this).call(this),o=this.controlOption.defaultValue;return o&&(this.selectValue=this.transSelectValue(o)),this.popper.setContent(this.getPopperContent(this.controlOption.options)),i}},{key:"getSelectValue",value:function(){return this.getIsMultiple()?this.selectValue:this.selectValue[0]}},{key:"setSelectValue",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,l=this.transSelectValue(i);this.optionDOMList.forEach(function(f){var v=f.getAttribute(Rp.OptionValueAttrKey),y=o.getIsMultiple()?f.querySelector("input[type=checkbox]"):void 0;l.includes(v)?(fu(f,Rp.ActiveOptionClassName),y&&Ql(y,!0)):(Du(f,Rp.ActiveOptionClassName),y&&Ql(y,!1))}),this.selectValue=l,s&&this.emit("selectChange",this.getIsMultiple()?l:l[0])}},{key:"getIsMultiple",value:function(){return!1}},{key:"getPopperContent",value:function(i){var o=this,s=this.isImageOptions(),l=ta("div",s?"l7-select-control--image":"l7-select-control--normal");this.getIsMultiple()&&fu(l,"l7-select-control--multiple");var f=i.map(function(v,y){var b=s?o.createImageOption(v):o.createNormalOption(v);return b.setAttribute(Rp.OptionValueAttrKey,v.value),b.setAttribute(Rp.OptionIndexAttrKey,window.String(y)),b.addEventListener("click",o.onItemClick.bind(o,v)),b});return l.append.apply(l,(0,Kt.Z)(f)),this.optionDOMList=f,l}},{key:"createImageOption",value:function(i){var o=this.selectValue.includes(i.value),s=ta("div","l7-select-control-item ".concat(o?Rp.ActiveOptionClassName:"")),l=ta("img");l.setAttribute("src",i.img),tf(l),s.appendChild(l);var f=ta("div","l7-select-control-item-row");this.getIsMultiple()&&s.appendChild(this.createCheckbox(o));var v=ta("span");return v.innerText=i.text,f.appendChild(v),s.appendChild(f),s}},{key:"createCheckbox",value:function(i){var o=ta("input");return o.setAttribute("type","checkbox"),i&&Ql(o,!0),o}},{key:"isImageOptions",value:function(){return!!this.controlOption.options.find(function(i){return i.img})}},{key:"transSelectValue",value:function(i){return Array.isArray(i)?i:[i]}}]),t}(LT),Hh=function(r){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.classList.add("l7-iconfont"),t.setAttribute("aria-hidden","true");var n=document.createElementNS("http://www.w3.org/2000/svg","use");return n.setAttributeNS("http://www.w3.org/1999/xlink","href","#".concat(r)),t.appendChild(n),t};function zT(e){var r=ZT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function ZT(){if(typeof Reflect=="undefined"||!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(e){return!1}}var VT=function(e){(0,Le.Z)(t,e);var r=zT(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"onClick",(0,Pt.Z)(ge().mark(function l(){var f;return ge().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(f=n.controlOption.onExport,y.t0=f==null,y.t0){y.next=8;break}return y.t1=f,y.next=6,n.getImage();case 6:y.t2=y.sent,(0,y.t1)(y.t2);case 8:case"end":return y.stop()}},l)}))),(0,B.Z)((0,Fe.Z)(n),"mergeImage",(0,Pt.Z)(ge().mark(function l(){var f,v,y,b,T,M,O,F,$,G,ue,xe,ze,Je,ht=arguments;return ge().wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:for(y=n.controlOption.imageType,b=(f=(v=n.mapsService.getContainer())===null||v===void 0?void 0:v.getBoundingClientRect())!==null&&f!==void 0?f:{},T=b.width,M=T===void 0?0:T,O=b.height,F=O===void 0?0:O,$=document.createElement("canvas"),$.width=M,$.height=F,G=$.getContext("2d"),ue=ht.length,xe=new Array(ue),ze=0;ze<ue;ze++)xe[ze]=ht[ze];return Ot.next=9,Promise.all(xe.map(function(tr){return new Promise(function(Ir){var Er=new Image;Er.onload=function(){Ir(Er)},Er.src=tr})}));case 9:return Je=Ot.sent,Je.forEach(function(tr){G==null||G.drawImage(tr,0,0,M,F)}),Ot.abrupt("return",$.toDataURL("image/".concat(y)));case 12:case"end":return Ot.stop()}},l)}))),n}return(0,j.Z)(t,[{key:"onAdd",value:function(){var i=Ra((0,Ee.Z)(t.prototype),"onAdd",this).call(this);return i.addEventListener("click",this.onClick),i}},{key:"getDefault",value:function(i){return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u5BFC\u51FA\u56FE\u7247",btnIcon:Hh("l7-icon-export-picture"),imageType:"png"})}},{key:"getImage",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,this.mapsService.exportMap("png");case 2:return s=v.sent,v.next=5,this.scene.exportPng("png");case 5:return l=v.sent,v.abrupt("return",this.mergeImage.apply(this,(0,Kt.Z)([s,l].filter(function(y){return y}))));case 7:case"end":return v.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()}]),t}(_g);function jT(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=HT(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function HT(e,r){if(e){if(typeof e=="string")return qy(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return qy(e,r)}}function qy(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Ky=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Wh=function(){if(typeof document=="undefined")return!1;for(var e=Ky[0],r={},t=0,n=Ky;t<n.length;t++){var i=n[t],o=i==null?void 0:i[1];if(o in document){var s=jT(i.entries()),l;try{for(s.s();!(l=s.n()).done;){var f=(0,Sn.Z)(l.value,2),v=f[0],y=f[1];r[e[v]]=y}}catch(b){s.e(b)}finally{s.f()}return r}}return!1}(),Qy={change:Wh.fullscreenchange,error:Wh.fullscreenerror},xc={request:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document.documentElement,t=arguments.length>1?arguments[1]:void 0;return new Promise(function(n,i){var o=function l(){xc.off("change",l),n()};xc.on("change",o);var s=r[Wh.requestFullscreen](t);s instanceof Promise&&s.then(o).catch(i)})},exit:function(){return new Promise(function(r,t){if(!xc.isFullscreen){r();return}var n=function o(){xc.off("change",o),r()};xc.on("change",n);var i=document[Wh.exitFullscreen]();i instanceof Promise&&i.then(n).catch(t)})},toggle:function(r,t){return xc.isFullscreen?xc.exit():xc.request(r,t)},onchange:function(r){xc.on("change",r)},onerror:function(r){xc.on("error",r)},on:function(r,t){var n=Qy[r];n&&document.addEventListener(n,t,!1)},off:function(r,t){var n=Qy[r];n&&document.removeEventListener(n,t,!1)},raw:Wh};Object.defineProperties(xc,{isFullscreen:{get:function(){return!!document[Wh.fullscreenElement]}},element:{enumerable:!0,get:function(){var r;return(r=document[Wh.fullscreenElement])!==null&&r!==void 0?r:void 0}},isEnabled:{enumerable:!0,get:function(){return!!document[Wh.fullscreenEnabled]}}}),Wh||(xc={isEnabled:!1});var L0=xc;function WT(e){var r=GT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function GT(){if(typeof Reflect=="undefined"||!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(e){return!1}}var XT=function(e){(0,Le.Z)(t,e);var r=WT(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this,n),(0,B.Z)((0,Fe.Z)(i),"isFullscreen",!1),(0,B.Z)((0,Fe.Z)(i),"toggleFullscreen",(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!L0.isEnabled){l.next=3;break}return l.next=3,L0.toggle(i.mapContainer);case 3:case"end":return l.stop()}},o)}))),(0,B.Z)((0,Fe.Z)(i),"onClick",function(){i.toggleFullscreen()}),(0,B.Z)((0,Fe.Z)(i),"onFullscreenChange",function(){i.isFullscreen=!!document.fullscreenElement;var o=i.controlOption,s=o.btnText,l=o.btnIcon,f=o.title,v=o.exitBtnText,y=o.exitBtnIcon,b=o.exitTitle;i.isFullscreen?(i.setBtnTitle(b),i.setBtnText(v),i.setBtnIcon(y)):(i.setBtnTitle(f),i.setBtnText(s),i.setBtnIcon(l)),i.emit("fullscreenChange",i.isFullscreen)}),L0.isEnabled||console.warn("\u5F53\u524D\u6D4F\u89C8\u5668\u73AF\u5883\u4E0D\u652F\u6301\u5BF9\u5730\u56FE\u5168\u5C4F\u5316"),i}return(0,j.Z)(t,[{key:"setOptions",value:function(i){var o=i.exitBtnText,s=i.exitBtnIcon,l=i.exitTitle;this.isFullscreen&&(this.checkUpdateOption(i,["exitBtnIcon"])&&this.setBtnIcon(s),this.checkUpdateOption(i,["exitBtnText"])&&this.setBtnText(o),this.checkUpdateOption(i,["exitTitle"])&&this.setBtnTitle(l)),Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i)}},{key:"onAdd",value:function(){var i=Ra((0,Ee.Z)(t.prototype),"onAdd",this).call(this);return i.addEventListener("click",this.onClick),this.mapContainer=Ds(this.scene.getSceneConfig().id),this.mapContainer.addEventListener("fullscreenchange",this.onFullscreenChange),i}},{key:"onRemove",value:function(){Ra((0,Ee.Z)(t.prototype),"onRemove",this).call(this),this.mapContainer.removeEventListener("fullscreenchange",this.onFullscreenChange)}},{key:"getDefault",value:function(i){return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u5168\u5C4F",btnIcon:Hh("l7-icon-fullscreen"),exitTitle:"\u9000\u51FA\u5168\u5C4F",exitBtnIcon:Hh("l7-icon-exit-fullscreen")})}}]),t}(_g);function $T(e){var r=YT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function YT(){if(typeof Reflect=="undefined"||!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(e){return!1}}var qT=function(e){(0,Le.Z)(t,e);var r=$T(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this,n),(0,B.Z)((0,Fe.Z)(i),"getGeoLocation",function(){return new Promise(function(o,s){window.navigator.geolocation.getCurrentPosition(function(l){var f=l.coords,v=f!=null?f:{},y=v.longitude,b=v.latitude;!isNaN(y)&&!isNaN(b)?o([y,b]):s()},function(l){s(l)})})}),(0,B.Z)((0,Fe.Z)(i),"onClick",(0,Pt.Z)(ge().mark(function o(){var s,l,f;return ge().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(window.navigator.geolocation){y.next=2;break}return y.abrupt("return");case 2:return s=i.controlOption.transform,y.next=5,i.getGeoLocation();case 5:if(l=y.sent,f=i.mapsService.getZoom(),y.t0=i.mapsService,y.t1=f>15?f:15,!s){y.next=15;break}return y.next=12,s(l);case 12:y.t2=y.sent,y.next=16;break;case 15:y.t2=l;case 16:y.t3=y.t2,y.t0.setZoomAndCenter.call(y.t0,y.t1,y.t3);case 18:case"end":return y.stop()}},o)}))),window.navigator.geolocation||console.warn("\u5F53\u524D\u6D4F\u89C8\u5668\u73AF\u5883\u4E0D\u652F\u6301\u83B7\u53D6\u5730\u7406\u5B9A\u4F4D"),i}return(0,j.Z)(t,[{key:"getDefault",value:function(i){return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u5B9A\u4F4D",btnIcon:Hh("l7-icon-reposition")})}},{key:"onAdd",value:function(){var i=Ra((0,Ee.Z)(t.prototype),"onAdd",this).call(this);return i.addEventListener("click",this.onClick),i}}]),t}(_g);function KT(e){var r=QT();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function QT(){if(typeof Reflect=="undefined"||!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(e){return!1}}function Jy(e){return Object.keys(e!=null?e:{}).every(function(r){return["layer","name","img"].includes(r)})}var e1=function(e){(0,Le.Z)(t,e);var r=KT(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"onLayerChange",function(){var l;(l=n.controlOption.layers)!==null&&l!==void 0&&l.length||(n.selectValue=n.getLayerVisible(),n.setOptions({options:n.getLayerOptions()}))}),(0,B.Z)((0,Fe.Z)(n),"onLayerVisibleChane",function(){n.setSelectValue(n.getLayerVisible())}),(0,B.Z)((0,Fe.Z)(n),"onSelectChange",function(){n.layers.forEach(function(l){var f=n.selectValue.includes(l.name),v=l.isVisible();f&&!v&&l.show(),!f&&v&&l.hide()})}),n}return(0,j.Z)(t,[{key:"layers",get:function(){var i=this.layerService,o=this.controlOption.layers;if(Array.isArray(o)&&o.length){var s=[];return o.forEach(function(l){if(l instanceof Object&&(Jy(l)?s.push(l.layer):s.push(l)),typeof l=="string"){var f=i.getLayer(l)||i.getLayerByName(l);f&&s.push(f)}}),s}return i.getLayers()||[]}},{key:"getDefault",value:function(i){return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u56FE\u5C42\u63A7\u5236",btnIcon:Hh("l7-icon-layer"),options:[]})}},{key:"getLayerVisible",value:function(){return this.layers.filter(function(i){return i.isVisible()}).map(function(i){return i.name})}},{key:"getLayerOptions",value:function(){var i=this,o=this.controlOption.layers,s=o==null?void 0:o.every(function(l){return l.img});return o?o==null?void 0:o.map(function(l){if(Jy(l))return{text:l.name||l.layer.name,value:l.layer.name,img:s?l.img:void 0};if(typeof l=="string"){var f=i.layerService.getLayer(l)||i.layerService.getLayerByName(l);return{text:f==null?void 0:f.name,value:f==null?void 0:f.name}}return{text:l.name,value:l.name}}):this.layers.map(function(l){return{text:l.name,value:l.name}})}},{key:"setOptions",value:function(i){var o=this.checkUpdateOption(i,["layers"]);Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i),o&&(this.selectValue=this.getLayerVisible(),this.controlOption.options=this.getLayerOptions(),this.popper.setContent(this.getPopperContent(this.controlOption.options)))}},{key:"onAdd",value:function(){var i;return(i=this.controlOption.options)!==null&&i!==void 0&&i.length||(this.controlOption.options=this.getLayerOptions()),this.controlOption.defaultValue||(this.controlOption.defaultValue=this.getLayerVisible()),this.on("selectChange",this.onSelectChange),this.layerService.on("layerChange",this.onLayerChange),Ra((0,Ee.Z)(t.prototype),"onAdd",this).call(this)}},{key:"onRemove",value:function(){this.off("selectChange",this.onSelectChange),this.layerService.off("layerChange",this.onLayerChange)}},{key:"getIsMultiple",value:function(){return!0}}]),t}(Yy);function JT(e){var r=ew();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function ew(){if(typeof Reflect=="undefined"||!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(e){return!1}}var t1=function(e){(0,Le.Z)(t,e);var r=JT(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getDefault",value:function(){return{position:xr.BOTTOMLEFT,name:"logo",href:"https://l7.antv.antgroup.com/",img:"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*GRb1TKp4HcMAAAAAAAAAAAAAARQnAQ"}}},{key:"onAdd",value:function(){var i=ta("div","l7-control-logo");return this.setLogoContent(i),i}},{key:"onRemove",value:function(){return null}},{key:"setOptions",value:function(i){Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i),this.checkUpdateOption(i,["img","href"])&&(ca(this.container),this.setLogoContent(this.container))}},{key:"setLogoContent",value:function(i){var o=this.controlOption,s=o.href,l=o.img,f=ta("img");if(f.setAttribute("src",l),f.setAttribute("aria-label","AntV logo"),tf(f),s){var v=ta("a","l7-control-logo-link");v.target="_blank",v.href=s,v.rel="noopener nofollow",v.setAttribute("rel","noopener nofollow"),v.appendChild(f),i.appendChild(v)}else i.appendChild(f)}}]),t}(uv),tw={normal:{text:"\u6807\u51C6",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*qdFDSbvIalgAAAAAAAAAAAAADmJ7AQ/original"},light:{text:"\u6708\u5149\u94F6",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*d-vcRLzu8WIAAAAAAAAAAAAADmJ7AQ/original"},dark:{text:"\u5E7B\u5F71\u9ED1",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*HMbRTI3XnpIAAAAAAAAAAAAADmJ7AQ/original"},fresh:{text:"\u8349\u8272\u9752",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*kqaGQ5kjSiAAAAAAAAAAAAAADmJ7AQ/original"},grey:{text:"\u96C5\u58EB\u7070",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*XegrTpZIbqAAAAAAAAAAAAAADmJ7AQ/original"},graffiti:{text:"\u6D82\u9E26",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*G5g9SZ_Jg4cAAAAAAAAAAAAADmJ7AQ/original"},macaron:{text:"\u9A6C\u5361\u9F99",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*irVvQbDpQMwAAAAAAAAAAAAADmJ7AQ/original"},darkblue:{text:"\u6781\u591C\u84DD",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*lKRzQYB4iR0AAAAAAAAAAAAADmJ7AQ/original"},wine:{text:"\u9171\u7C7D",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*orY0T7QL-lwAAAAAAAAAAAAADmJ7AQ/original"}},rw={normal:{text:"\u6807\u51C6",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*kIyZTok4Uk0AAAAAAAAAAAAADmJ7AQ/original"},light:{text:"\u4EAE",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Z3JRQKDI-cIAAAAAAAAAAAAADmJ7AQ/original"},dark:{text:"\u6697",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*d7HCQbfmyaoAAAAAAAAAAAAADmJ7AQ/original"},satellite:{text:"\u536B\u661F",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*TytUT6pS9okAAAAAAAAAAAAADmJ7AQ/original"},outdoors:{text:"\u6237\u5916",img:"https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*hWwFSYJEFWsAAAAAAAAAAAAADmJ7AQ/original"}};function nw(e){var r=iw();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function iw(){if(typeof Reflect=="undefined"||!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(e){return!1}}var aw=function(e){(0,Le.Z)(t,e);var r=nw(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"onMapThemeChange",function(){n.mapsService.setMapStyle(n.selectValue[0])}),n}return(0,j.Z)(t,[{key:"getDefault",value:function(i){return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u5730\u56FE\u6837\u5F0F",btnIcon:Hh("l7-icon-color"),options:[]})}},{key:"getStyleOptions",value:function(){var i=this.mapsService.getType()==="mapbox"?rw:tw;return Object.entries(this.mapsService.getMapStyleConfig()).filter(function(o){var s=(0,Sn.Z)(o,2),l=s[0],f=s[1];return typeof f=="string"&&l!=="blank"}).map(function(o){var s,l=(0,Sn.Z)(o,2),f=l[0],v=l[1],y=(s=i[f])!==null&&s!==void 0?s:{},b=y.text,T=y.img;return{text:b!=null?b:f,value:v,img:T,key:f}})}},{key:"getMapStyle",value:function(){return this.mapsService.getMapStyle()}},{key:"onAdd",value:function(){var i,o=this;if((i=this.controlOption.options)!==null&&i!==void 0&&i.length||(this.controlOption.options=this.getStyleOptions()),this.controlOption.defaultValue){var s,l,f=this.controlOption.defaultValue;this.controlOption.defaultValue=(s=(l=this.controlOption.options.find(function(y){return y.key===f}))===null||l===void 0?void 0:l.value)!==null&&s!==void 0?s:f}else{var v=this.getMapStyle();v?this.controlOption.defaultValue=v:this.mapsService.map.once("styledata",function(){var y=o.mapsService.getMapStyle();o.controlOption.defaultValue=y,o.setSelectValue(y,!1)})}return this.on("selectChange",this.onMapThemeChange),Ra((0,Ee.Z)(t.prototype),"onAdd",this).call(this)}},{key:"getIsMultiple",value:function(){return!1}}]),t}(Yy);function ow(e){var r=sw();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function sw(){if(typeof Reflect=="undefined"||!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(e){return!1}}var uw=function(e){(0,Le.Z)(t,e);var r=ow(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"location",[0,0]),(0,B.Z)((0,Fe.Z)(n),"onMouseMove",function(l){var f=n.location,v=l.lngLat||l.lnglat,y=n.controlOption.transform;v&&(f=[v.lng,v.lat]),n.location=f,y&&(f=y(f)),n.insertLocation2HTML(f),n.emit("locationChange",f)}),n}return(0,j.Z)(t,[{key:"getLocation",value:function(){return this.location}},{key:"getDefault",value:function(i){return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{position:xr.BOTTOMLEFT,transform:function(s){var l=(0,Sn.Z)(s,2),f=l[0],v=l[1];return[+(+f).toFixed(6),+(+v).toFixed(6)]}})}},{key:"onAdd",value:function(){var i=ta("div","l7-control-mouse-location");return i.innerHTML=" ",this.mapsService.on("mousemove",this.onMouseMove),i}},{key:"onRemove",value:function(){this.mapsService.off("mousemove",this.onMouseMove)}},{key:"insertLocation2HTML",value:function(i){this.container.innerText=i.join(", ")}}]),t}(uv);function lw(e){var r=cw();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function cw(){if(typeof Reflect=="undefined"||!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(e){return!1}}var fw=function(e){(0,Le.Z)(t,e);var r=lw(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"update",function(){var l=n.mapsService,f=n.controlOption.maxWidth,v=l.getSize()[1]/2,y=l.containerToLngLat([0,v]),b=l.containerToLngLat([f,v]),T=Eh([y.lng,y.lat],[b.lng,b.lat]);n.updateScales(T)}),n}return(0,j.Z)(t,[{key:"getDefault",value:function(i){return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{name:"scale",position:xr.BOTTOMLEFT,maxWidth:100,metric:!0,updateWhenIdle:!1,imperial:!1,lockWidth:!0})}},{key:"onAdd",value:function(){var i="l7-control-scale",o=ta("div",i);this.resetScaleLines(o);var s=this.controlOption.updateWhenIdle;return this.mapsService.on(s?"moveend":"mapmove",this.update),this.mapsService.on(s?"zoomend":"zoomchange",this.update),o}},{key:"onRemove",value:function(){var i=this.controlOption.updateWhenIdle;this.mapsService.off(i?"zoomend":"zoomchange",this.update),this.mapsService.off(i?"moveend":"mapmove",this.update)}},{key:"setOptions",value:function(i){Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i),this.checkUpdateOption(i,["lockWidth","maxWidth","metric","updateWhenIdle","imperial"])&&this.resetScaleLines(this.container)}},{key:"updateScales",value:function(i){var o=this.controlOption,s=o.metric,l=o.imperial;s&&i&&this.updateMetric(i),l&&i&&this.updateImperial(i)}},{key:"resetScaleLines",value:function(i){ca(i);var o=this.controlOption,s=o.metric,l=o.imperial,f=o.maxWidth,v=o.lockWidth;v&&Qs(i,"width: ".concat(f,"px")),s&&(this.mScale=ta("div","l7-control-scale-line",i)),l&&(this.iScale=ta("div","l7-control-scale-line",i)),this.update()}},{key:"updateScale",value:function(i,o,s){var l=this.controlOption.maxWidth;i.style.width=Math.round(l*s)+"px",i.innerHTML=o}},{key:"getRoundNum",value:function(i){var o=Math.pow(10,(Math.floor(i)+"").length-1),s=i/o;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,o*s}},{key:"updateMetric",value:function(i){var o=this.getRoundNum(i),s=o<1e3?o+" m":o/1e3+" km";this.updateScale(this.mScale,s,o/i)}},{key:"updateImperial",value:function(i){var o=i*3.2808399,s,l,f;o>5280?(s=o/5280,l=this.getRoundNum(s),this.updateScale(this.iScale,l+" mi",l/s)):(f=this.getRoundNum(o),this.updateScale(this.iScale,f+" ft",f/o))}}]),t}(uv);function hw(e){var r=pw();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function pw(){if(typeof Reflect=="undefined"||!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(e){return!1}}var dw=function(e){(0,Le.Z)(t,e);var r=hw(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"zoomIn",function(){!n.disabled&&n.mapsService.getZoom()<n.mapsService.getMaxZoom()&&n.mapsService.zoomIn()}),(0,B.Z)((0,Fe.Z)(n),"zoomOut",function(){!n.disabled&&n.mapsService.getZoom()>n.mapsService.getMinZoom()&&n.mapsService.zoomOut()}),(0,B.Z)((0,Fe.Z)(n),"updateDisabled",function(){var l=n.mapsService;n.zoomInButton.removeAttribute("disabled"),n.zoomOutButton.removeAttribute("disabled"),(n.disabled||l.getZoom()<=l.getMinZoom())&&n.zoomOutButton.setAttribute("disabled","true"),n.controlOption.showZoom&&n.zoomNumDiv&&(n.zoomNumDiv.innerText=String(Math.floor(l.getZoom()))),(n.disabled||l.getZoom()>=l.getMaxZoom())&&n.zoomInButton.setAttribute("disabled","true")}),n}return(0,j.Z)(t,[{key:"getDefault",value:function(i){return(0,V.Z)((0,V.Z)({},Ra((0,Ee.Z)(t.prototype),"getDefault",this).call(this,i)),{},{position:xr.BOTTOMRIGHT,name:"zoom",zoomInText:Hh("l7-icon-enlarge"),zoomInTitle:"Zoom in",zoomOutText:Hh("l7-icon-narrow"),zoomOutTitle:"Zoom out",showZoom:!1})}},{key:"setOptions",value:function(i){Ra((0,Ee.Z)(t.prototype),"setOptions",this).call(this,i),this.checkUpdateOption(i,["zoomInText","zoomInTitle","zoomOutText","zoomOutTitle","showZoom"])&&this.resetButtonGroup(this.container)}},{key:"onAdd",value:function(){var i=ta("div","l7-control-zoom");return this.resetButtonGroup(i),this.mapsService.on("zoomend",this.updateDisabled),this.mapsService.on("zoomchange",this.updateDisabled),i}},{key:"onRemove",value:function(){this.mapsService.off("zoomend",this.updateDisabled),this.mapsService.off("zoomchange",this.updateDisabled)}},{key:"disable",value:function(){return this.disabled=!0,this.updateDisabled(),this}},{key:"enable",value:function(){return this.disabled=!1,this.updateDisabled(),this}},{key:"resetButtonGroup",value:function(i){ca(i),this.zoomInButton=this.createButton(this.controlOption.zoomInText,this.controlOption.zoomInTitle,"l7-button-control",i,this.zoomIn),this.controlOption.showZoom&&(this.zoomNumDiv=this.createButton("0","","l7-button-control l7-control-zoom__number",i)),this.zoomOutButton=this.createButton(this.controlOption.zoomOutText,this.controlOption.zoomOutTitle,"l7-button-control",i,this.zoomOut),this.updateDisabled()}},{key:"createButton",value:function(i,o,s,l,f){var v=ta("button",s,l);return typeof i=="string"?v.innerHTML=i:v.append(i),v.title=o,f&&v.addEventListener("click",f),v}}]),t}(uv);function vw(e){var r=mw();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function mw(){if(typeof Reflect=="undefined"||!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(e){return!1}}var r1=function(e){(0,Le.Z)(t,e);var r=vw(t);function t(n){var i;(0,Q.Z)(this,t),i=r.call(this),(0,B.Z)((0,Fe.Z)(i),"isShow",!0),(0,B.Z)((0,Fe.Z)(i),"onMouseMove",function(s){var l,f=i.mapsService.getMapContainer(),v=(l=f==null?void 0:f.getBoundingClientRect())!==null&&l!==void 0?l:{},y=v.left,b=y===void 0?0:y,T=v.top,M=T===void 0?0:T;i.setPopupPosition(s.clientX-b,s.clientY-M)}),(0,B.Z)((0,Fe.Z)(i),"updateLngLatPosition",function(){if(!(!i.mapsService||i.popupOption.followCursor)){var s=i.lngLat,l=s.lng,f=s.lat,v=i.mapsService.lngLatToContainer([l,f]),y=v.x,b=v.y;i.setPopupPosition(y,b)}}),(0,B.Z)((0,Fe.Z)(i),"onKeyDown",function(s){s.keyCode===27&&i.remove()}),(0,B.Z)((0,Fe.Z)(i),"onCloseButtonClick",function(s){s.stopPropagation&&s.stopPropagation(),i.hide()}),(0,B.Z)((0,Fe.Z)(i),"update",function(){var s=!!i.lngLat,l=i.popupOption,f=l.className,v=l.style,y=l.maxWidth,b=l.anchor,T=l.stopPropagation;if(!(!i.mapsService||!s||!i.content)){var M=i.mapsService.getMarkerContainer();if(!i.container&&M&&(i.container=ta("div","l7-popup ".concat(f!=null?f:""," ").concat(i.isShow?"":"l7-popup-hide"),M),v&&i.container.setAttribute("style",v),i.tip=ta("div","l7-popup-tip",i.container),i.container.appendChild(i.content),T&&["mousemove","mousedown","mouseup","click","dblclick"].forEach(function($){i.container.addEventListener($,function(G){G.stopPropagation()})}),i.container.style.whiteSpace="nowrap"),i.updateLngLatPosition(),Fu(i.container,"".concat(Aa[b])),$l(i.container,b,"popup"),y){var O=i.container.getBoundingClientRect(),F=O.width;F>parseFloat(y)&&(i.container.style.width=y)}else i.container.style.removeProperty("width")}}),i.popupOption=(0,V.Z)((0,V.Z)({},i.getDefault(n!=null?n:{})),n);var o=i.popupOption.lngLat;return o&&(i.lngLat=o),i}return(0,j.Z)(t,[{key:"lngLat",get:function(){var i;return(i=this.popupOption.lngLat)!==null&&i!==void 0?i:{lng:0,lat:0}},set:function(i){this.popupOption.lngLat=i}},{key:"getIsShow",value:function(){return this.isShow}},{key:"addTo",value:function(i){this.mapsService=i.get(ot.IMapService),this.sceneService=i.get(ot.ISceneService),this.layerService=i.get(ot.ILayerService),this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update),this.scene=i,this.update(),this.updateCloseOnClick(),this.updateCloseOnEsc(),this.updateFollowCursor();var o=this.popupOption,s=o.html,l=o.text,f=o.title;return s?this.setHTML(s):l&&this.setText(l),f&&this.setTitle(f),this.emit("open"),this}},{key:"remove",value:function(){if(this!==null&&this!==void 0&&this.isOpen())return this.content&&Ii(this.content),this.container&&(Ii(this.container),delete this.container),this.mapsService&&(this.mapsService.off("camerachange",this.update),this.mapsService.off("viewchange",this.update),this.updateCloseOnClick(!0),this.updateCloseOnEsc(!0),this.updateFollowCursor(!0),delete this.mapsService),this.emit("close"),this}},{key:"getOptions",value:function(){return this.popupOption}},{key:"setOptions",value:function(i){return this.show(),this.popupOption=(0,V.Z)((0,V.Z)({},this.popupOption),i),this.checkUpdateOption(i,["html","text","title","closeButton","closeButtonOffsets","maxWidth","anchor","stopPropagation","className","style","lngLat","offsets"])&&(this.container&&(Ii(this.container),this.container=void 0),this.popupOption.html?this.setHTML(this.popupOption.html):this.popupOption.text&&this.setText(this.popupOption.text),this.popupOption.title&&this.setTitle(this.popupOption.title)),this.checkUpdateOption(i,["closeOnEsc"])&&this.updateCloseOnEsc(),this.checkUpdateOption(i,["closeOnClick"])&&this.updateCloseOnClick(),this.checkUpdateOption(i,["followCursor"])&&this.updateFollowCursor(),this.checkUpdateOption(i,["html"])&&i.html?this.setHTML(i.html):this.checkUpdateOption(i,["text"])&&i.text&&this.setText(i.text),this.checkUpdateOption(i,["lngLat"])&&i.lngLat&&this.setLnglat(i.lngLat),this}},{key:"open",value:function(){return this.addTo(this.scene),this}},{key:"close",value:function(){return this.remove(),this}},{key:"show",value:function(){if(!this.isShow)return this.container&&Du(this.container,"l7-popup-hide"),this.isShow=!0,this.emit("show"),this}},{key:"hide",value:function(){if(this.isShow)return this.container&&fu(this.container,"l7-popup-hide"),this.isShow=!1,this.emit("hide"),this}},{key:"setHTML",value:function(i){return this.popupOption.html=i,this.setDOMContent(i)}},{key:"setText",value:function(i){return this.popupOption.text=i,this.setDOMContent(window.document.createTextNode(i))}},{key:"setTitle",value:function(i){this.show(),this.popupOption.title=i,i?(this.contentTitle||(this.contentTitle=ta("div","l7-popup-content__title"),this.content.firstChild?this.content.insertBefore(this.contentTitle,this.content.firstChild):this.content.append(this.contentTitle)),ca(this.contentTitle),np(this.contentTitle,i)):this.contentTitle&&(Ii(this.contentTitle),this.contentTitle=void 0)}},{key:"panToPopup",value:function(){var i=this.lngLat,o=i.lng,s=i.lat;return this.popupOption.autoPan&&this.mapsService.panTo([o,s]),this}},{key:"setLngLat",value:function(i){return this.setLnglat(i)}},{key:"setLnglat",value:function(i){var o=this;return this.show(),this.lngLat=i,Array.isArray(i)&&(this.lngLat={lng:i[0],lat:i[1]}),this.mapsService&&(this.mapsService.off("camerachange",this.update),this.mapsService.off("viewchange",this.update),this.mapsService.on("camerachange",this.update),this.mapsService.on("viewchange",this.update)),this.update(),this.popupOption.autoPan&&setTimeout(function(){o.panToPopup()},0),this}},{key:"getLnglat",value:function(){return this.lngLat}},{key:"setMaxWidth",value:function(i){return this.popupOption.maxWidth=i,this.update(),this}},{key:"isOpen",value:function(){return!!this.mapsService}},{key:"getDefault",value:function(i){return{closeButton:!0,closeOnClick:!1,maxWidth:"240px",offsets:[0,0],anchor:ma.BOTTOM,stopPropagation:!0,autoPan:!1,autoClose:!0,closeOnEsc:!1,followCursor:!1}}},{key:"setDOMContent",value:function(i){return this.show(),this.createContent(),np(this.contentPanel,i),this.update(),this}},{key:"updateCloseOnClick",value:function(i){var o=this,s=this.mapsService;s&&(s==null||s.off("click",this.onCloseButtonClick),this.popupOption.closeOnClick&&!i&&requestAnimationFrame(function(){s==null||s.on("click",o.onCloseButtonClick)}))}},{key:"updateCloseOnEsc",value:function(i){window.removeEventListener("keydown",this.onKeyDown),this.popupOption.closeOnEsc&&!i&&window.addEventListener("keydown",this.onKeyDown)}},{key:"updateFollowCursor",value:function(i){var o,s=(o=this.mapsService)===null||o===void 0?void 0:o.getContainer();s&&(s==null||s.removeEventListener("mousemove",this.onMouseMove),this.popupOption.followCursor&&!i&&(s==null||s.addEventListener("mousemove",this.onMouseMove)))}},{key:"createContent",value:function(){var i=this;if(this.content&&Ii(this.content),this.contentTitle=void 0,this.content=ta("div","l7-popup-content",this.container),this.setTitle(this.popupOption.title),this.popupOption.closeButton){var o=Hh("l7-icon-guanbi");fu(o,"l7-popup-close-button"),this.content.appendChild(o),this.popupOption.closeButtonOffsets&&(o.style.right=this.popupOption.closeButtonOffsets[0]+"px",o.style.top=this.popupOption.closeButtonOffsets[1]+"px"),o.setAttribute("aria-label","Close popup"),o.addEventListener("click",function(){i.hide()}),o.addEventListener("pointerup",function(s){s.stopPropagation()}),o.addEventListener("pointerdown",function(s){s.stopPropagation()}),this.closeButton=o}else this.closeButton=void 0;this.contentPanel=ta("div","l7-popup-content__panel",this.content)}},{key:"setPopupPosition",value:function(i,o){if(this.container){var s=this.popupOption.offsets;this.container.style.left=i+s[0]+"px",this.container.style.top=o-s[1]+"px"}}},{key:"checkUpdateOption",value:function(i,o){return o.some(function(s){return s in i})}}]),t}(io.EventEmitter);function lL(e){var r=gw();return function(){var n=_getPrototypeOf(e),i;if(r){var o=_getPrototypeOf(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function gw(){if(typeof Reflect=="undefined"||!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(e){return!1}}var cL=oi.get,fL=null;function _w(e,r){var t=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(t||n)&&(r||(r=document),!!r)){var i=r.head||r.getElementsByTagName("head")[0];if(!i){i=r.createElement("head");var o=r.body||r.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):r.documentElement.appendChild(i)}var s=r.createElement("style");return s.type="text/css",s.styleSheet?s.styleSheet.cssText=e:s.appendChild(r.createTextNode(e)),i.appendChild(s),s}}_w(`.l7-marker-container {
|
|
position: absolute;
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
}
|
|
.l7-marker {
|
|
position: absolute !important;
|
|
top: 0;
|
|
left: 0;
|
|
z-index: 5;
|
|
cursor: pointer;
|
|
}
|
|
.l7-marker-cluster {
|
|
width: 40px;
|
|
height: 40px;
|
|
background-color: rgba(181, 226, 140, 0.6);
|
|
background-clip: padding-box;
|
|
border-radius: 20px;
|
|
}
|
|
.l7-marker-cluster div {
|
|
width: 30px;
|
|
height: 30px;
|
|
margin-top: 5px;
|
|
margin-left: 5px;
|
|
font: 12px 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
text-align: center;
|
|
background-color: rgba(110, 204, 57, 0.6);
|
|
border-radius: 15px;
|
|
}
|
|
.l7-marker-cluster span {
|
|
line-height: 30px;
|
|
}
|
|
.l7-touch .l7-control-attribution,
|
|
.l7-touch .l7-control-layers,
|
|
.l7-touch .l7-bar {
|
|
-webkit-box-shadow: none;
|
|
box-shadow: none;
|
|
}
|
|
.l7-touch .l7-control-layers,
|
|
.l7-touch .l7-bar {
|
|
background-clip: padding-box;
|
|
border: 2px solid rgba(0, 0, 0, 0.2);
|
|
}
|
|
.mapboxgl-ctrl-logo,
|
|
.amap-logo {
|
|
display: none !important;
|
|
}
|
|
.l7-select-box {
|
|
border: 3px dashed gray;
|
|
border-radius: 2px;
|
|
position: absolute;
|
|
z-index: 999;
|
|
-webkit-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
.l7-control-container {
|
|
font: 12px/1.5 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
}
|
|
.l7-control-container .l7-control {
|
|
position: relative;
|
|
z-index: 999;
|
|
float: left;
|
|
clear: both;
|
|
color: #595959;
|
|
font-size: 12px;
|
|
pointer-events: visiblePainted;
|
|
/* IE 9-10 doesn't have auto */
|
|
pointer-events: auto;
|
|
}
|
|
.l7-control-container .l7-control.l7-control--hide {
|
|
display: none;
|
|
}
|
|
.l7-control-container .l7-top {
|
|
top: 0;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
position: absolute;
|
|
z-index: 999;
|
|
pointer-events: none;
|
|
}
|
|
.l7-control-container .l7-top .l7-control:not(.l7-control--hide) {
|
|
margin-top: 8px;
|
|
}
|
|
.l7-control-container .l7-right {
|
|
right: 0;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
position: absolute;
|
|
z-index: 999;
|
|
pointer-events: none;
|
|
}
|
|
.l7-control-container .l7-right .l7-control:not(.l7-control--hide) {
|
|
margin-right: 8px;
|
|
}
|
|
.l7-control-container .l7-bottom {
|
|
bottom: 0;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
position: absolute;
|
|
z-index: 999;
|
|
pointer-events: none;
|
|
}
|
|
.l7-control-container .l7-bottom .l7-control:not(.l7-control--hide) {
|
|
margin-bottom: 8px;
|
|
}
|
|
.l7-control-container .l7-left {
|
|
left: 0;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
position: absolute;
|
|
z-index: 999;
|
|
pointer-events: none;
|
|
}
|
|
.l7-control-container .l7-left .l7-control:not(.l7-control--hide) {
|
|
margin-left: 8px;
|
|
}
|
|
.l7-control-container .l7-center {
|
|
position: absolute;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-pack: center;
|
|
-ms-flex-pack: center;
|
|
justify-content: center;
|
|
}
|
|
.l7-control-container .l7-center.l7-top,
|
|
.l7-control-container .l7-center.l7-bottom {
|
|
width: 100%;
|
|
}
|
|
.l7-control-container .l7-center.l7-left,
|
|
.l7-control-container .l7-center.l7-right {
|
|
height: 100%;
|
|
}
|
|
.l7-control-container .l7-center .l7-control {
|
|
margin-right: 8px;
|
|
margin-bottom: 8px;
|
|
}
|
|
.l7-control-container .l7-row {
|
|
-webkit-box-orient: horizontal;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: row;
|
|
flex-direction: row;
|
|
}
|
|
.l7-control-container .l7-row.l7-top {
|
|
-webkit-box-align: start;
|
|
-ms-flex-align: start;
|
|
align-items: flex-start;
|
|
}
|
|
.l7-control-container .l7-row.l7-bottom {
|
|
-webkit-box-align: end;
|
|
-ms-flex-align: end;
|
|
align-items: flex-end;
|
|
}
|
|
.l7-control-container .l7-column {
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
.l7-control-container .l7-column.l7-left {
|
|
-webkit-box-align: start;
|
|
-ms-flex-align: start;
|
|
align-items: flex-start;
|
|
}
|
|
.l7-control-container .l7-column.l7-right {
|
|
-webkit-box-align: end;
|
|
-ms-flex-align: end;
|
|
align-items: flex-end;
|
|
}
|
|
.l7-button-control {
|
|
min-width: 28px;
|
|
height: 28px;
|
|
background-color: #fff;
|
|
border-width: 0;
|
|
border-radius: 2px;
|
|
outline: 0;
|
|
cursor: pointer;
|
|
-webkit-transition: all 0.2s;
|
|
transition: all 0.2s;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-pack: center;
|
|
-ms-flex-pack: center;
|
|
justify-content: center;
|
|
-webkit-box-align: center;
|
|
-ms-flex-align: center;
|
|
align-items: center;
|
|
padding: 0 6px;
|
|
-webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
line-height: 16px;
|
|
}
|
|
.l7-button-control .l7-iconfont {
|
|
fill: #595959;
|
|
color: #595959;
|
|
width: 16px;
|
|
height: 16px;
|
|
}
|
|
.l7-button-control.l7-button-control--row {
|
|
padding: 0 16px 0 13px;
|
|
}
|
|
.l7-button-control.l7-button-control--row * + .l7-button-control__text {
|
|
margin-left: 8px;
|
|
}
|
|
.l7-button-control.l7-button-control--column {
|
|
height: 44px;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
.l7-button-control.l7-button-control--column .l7-iconfont {
|
|
margin-top: 3px;
|
|
}
|
|
.l7-button-control.l7-button-control--column .l7-button-control__text {
|
|
margin-top: 3px;
|
|
font-size: 10px;
|
|
-webkit-transform: scale(0.83333);
|
|
transform: scale(0.83333);
|
|
}
|
|
.l7-button-control:not(:disabled):hover {
|
|
background-color: #f3f3f3;
|
|
}
|
|
.l7-button-control:not(:disabled):active {
|
|
background-color: #f3f3f3;
|
|
}
|
|
.l7-button-control:disabled {
|
|
background-color: #fafafa;
|
|
color: #bdbdbd;
|
|
cursor: not-allowed;
|
|
}
|
|
.l7-button-control:disabled .l7-iconfont {
|
|
fill: #bdbdbd;
|
|
color: #bdbdbd;
|
|
}
|
|
.l7-button-control:disabled:hover {
|
|
background-color: #fafafa;
|
|
}
|
|
.l7-button-control:disabled:active {
|
|
background-color: #fafafa;
|
|
}
|
|
.l7-popper {
|
|
position: absolute;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-pack: center;
|
|
-ms-flex-pack: center;
|
|
justify-content: center;
|
|
-webkit-box-align: center;
|
|
-ms-flex-align: center;
|
|
align-items: center;
|
|
z-index: 5;
|
|
color: #595959;
|
|
}
|
|
.l7-popper.l7-popper-hide {
|
|
display: none;
|
|
}
|
|
.l7-popper .l7-popper-content {
|
|
min-height: 28px;
|
|
background: #fff;
|
|
border-radius: 2px;
|
|
-webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
}
|
|
.l7-popper .l7-popper-arrow {
|
|
width: 0;
|
|
height: 0;
|
|
border-width: 4px;
|
|
border-style: solid;
|
|
border-top-color: transparent;
|
|
border-bottom-color: transparent;
|
|
border-left-color: transparent;
|
|
border-right-color: transparent;
|
|
-webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
}
|
|
.l7-popper.l7-popper-left {
|
|
-webkit-box-orient: horizontal;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: row;
|
|
flex-direction: row;
|
|
}
|
|
.l7-popper.l7-popper-left .l7-popper-arrow {
|
|
border-left-color: #fff;
|
|
margin: 10px 0;
|
|
}
|
|
.l7-popper.l7-popper-right {
|
|
-webkit-box-orient: horizontal;
|
|
-webkit-box-direction: reverse;
|
|
-ms-flex-direction: row-reverse;
|
|
flex-direction: row-reverse;
|
|
}
|
|
.l7-popper.l7-popper-right .l7-popper-arrow {
|
|
border-right-color: #fff;
|
|
margin: 10px 0;
|
|
}
|
|
.l7-popper.l7-popper-top {
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
.l7-popper.l7-popper-top .l7-popper-arrow {
|
|
border-top-color: #fff;
|
|
margin: 0 10px;
|
|
}
|
|
.l7-popper.l7-popper-bottom {
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: reverse;
|
|
-ms-flex-direction: column-reverse;
|
|
flex-direction: column-reverse;
|
|
}
|
|
.l7-popper.l7-popper-bottom .l7-popper-arrow {
|
|
border-bottom-color: #fff;
|
|
margin: 0 10px;
|
|
}
|
|
.l7-popper.l7-popper-start {
|
|
-webkit-box-align: start;
|
|
-ms-flex-align: start;
|
|
align-items: flex-start;
|
|
}
|
|
.l7-popper.l7-popper-end {
|
|
-webkit-box-align: end;
|
|
-ms-flex-align: end;
|
|
align-items: flex-end;
|
|
}
|
|
.l7-select-control--normal {
|
|
padding: 4px 0;
|
|
}
|
|
.l7-select-control--normal .l7-select-control-item {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-align: center;
|
|
-ms-flex-align: center;
|
|
align-items: center;
|
|
height: 24px;
|
|
padding: 0 16px;
|
|
font-size: 12px;
|
|
line-height: 24px;
|
|
}
|
|
.l7-select-control--normal .l7-select-control-item > * + * {
|
|
margin-left: 6px;
|
|
}
|
|
.l7-select-control--normal .l7-select-control-item input[type='checkbox'] {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
.l7-select-control--normal .l7-select-control-item:hover {
|
|
background-color: #f3f3f3;
|
|
}
|
|
.l7-select-control--image {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-ms-flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
-webkit-box-align: start;
|
|
-ms-flex-align: start;
|
|
align-items: flex-start;
|
|
-webkit-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
max-width: 460px;
|
|
max-height: 400px;
|
|
margin: 12px 0 0 12px;
|
|
overflow-x: hidden;
|
|
overflow-y: auto;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item {
|
|
position: relative;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-flex: 0;
|
|
-ms-flex: 0 0 calc((100% - (12px + 9px) * 2) / 3);
|
|
flex: 0 0 calc((100% - (12px + 9px) * 2) / 3);
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
-webkit-box-pack: center;
|
|
-ms-flex-pack: center;
|
|
justify-content: center;
|
|
-webkit-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
margin-right: 12px;
|
|
margin-bottom: 12px;
|
|
overflow: hidden;
|
|
font-size: 12px;
|
|
border: 1px solid #fff;
|
|
border-radius: 2px;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item img {
|
|
width: 100%;
|
|
height: 80px;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item input[type='checkbox'] {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item .l7-select-control-item-row {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-align: center;
|
|
-ms-flex-align: center;
|
|
align-items: center;
|
|
-webkit-box-pack: center;
|
|
-ms-flex-pack: center;
|
|
justify-content: center;
|
|
line-height: 26px;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item .l7-select-control-item-row > * + * {
|
|
margin-left: 8px;
|
|
}
|
|
.l7-select-control--image .l7-select-control-item.l7-select-control-item-active {
|
|
border-color: #0370fe;
|
|
}
|
|
.l7-select-control-item {
|
|
cursor: pointer;
|
|
}
|
|
.l7-select-control-item input[type='checkbox'] {
|
|
margin: 0;
|
|
cursor: pointer;
|
|
}
|
|
.l7-select-control--multiple .l7-select-control-item:hover {
|
|
background-color: transparent;
|
|
}
|
|
.l7-control-logo {
|
|
width: 89px;
|
|
height: 16px;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
.l7-control-logo img {
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
.l7-control-logo .l7-control-logo-link {
|
|
display: block;
|
|
cursor: pointer;
|
|
}
|
|
.l7-control-logo .l7-control-logo-link img {
|
|
cursor: pointer;
|
|
}
|
|
.l7-control-mouse-location {
|
|
background-color: #fff;
|
|
border-radius: 2px;
|
|
-webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
padding: 2px 4px;
|
|
min-width: 130px;
|
|
}
|
|
.l7-control-zoom {
|
|
overflow: hidden;
|
|
border-radius: 2px;
|
|
-webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.15);
|
|
}
|
|
.l7-control-zoom .l7-button-control {
|
|
font-size: 16px;
|
|
border-bottom: 1px solid #f0f0f0;
|
|
border-radius: 0;
|
|
-webkit-box-shadow: 0 0 0;
|
|
box-shadow: 0 0 0;
|
|
}
|
|
.l7-control-zoom .l7-button-control .l7-iconfont {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
.l7-control-zoom .l7-button-control:last-child {
|
|
border-bottom: 0;
|
|
}
|
|
.l7-control-zoom .l7-control-zoom__number {
|
|
color: #595959;
|
|
padding: 0;
|
|
}
|
|
.l7-control-zoom .l7-control-zoom__number:hover {
|
|
background-color: #fff;
|
|
}
|
|
.l7-control-scale {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
.l7-control-scale .l7-control-scale-line {
|
|
-webkit-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
padding: 2px 5px 1px;
|
|
overflow: hidden;
|
|
color: #595959;
|
|
font-size: 10px;
|
|
line-height: 1.1;
|
|
white-space: nowrap;
|
|
background: #fff;
|
|
border: 2px solid #000;
|
|
border-top: 0;
|
|
-webkit-transition: width 0.1s;
|
|
transition: width 0.1s;
|
|
}
|
|
.l7-control-scale .l7-control-scale-line + .l7-control-scale .l7-control-scale-line {
|
|
margin-top: -2px;
|
|
border-top: 2px solid #777;
|
|
border-bottom: none;
|
|
}
|
|
.l7-right .l7-control-scale {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
-webkit-box-align: end;
|
|
-ms-flex-align: end;
|
|
align-items: flex-end;
|
|
}
|
|
.l7-right .l7-control-scale .l7-control-scale-line {
|
|
text-align: right;
|
|
}
|
|
.l7-popup {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
z-index: 5;
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
will-change: transform;
|
|
pointer-events: none;
|
|
}
|
|
.l7-popup.l7-popup-hide {
|
|
display: none;
|
|
}
|
|
.l7-popup .l7-popup-content {
|
|
position: relative;
|
|
padding: 16px;
|
|
font-size: 14px;
|
|
background: #fff;
|
|
border-radius: 3px;
|
|
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
}
|
|
.l7-popup .l7-popup-content .l7-popup-content__title {
|
|
margin-bottom: 8px;
|
|
font-weight: bold;
|
|
}
|
|
.l7-popup .l7-popup-content .l7-popup-close-button,
|
|
.l7-popup .l7-popup-content .l7-popup-content__title,
|
|
.l7-popup .l7-popup-content .l7-popup-content__panel {
|
|
white-space: normal;
|
|
-webkit-user-select: text;
|
|
-moz-user-select: text;
|
|
-ms-user-select: text;
|
|
user-select: text;
|
|
pointer-events: initial;
|
|
}
|
|
.l7-popup .l7-popup-content .l7-popup-close-button {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
width: 18px;
|
|
height: 18px;
|
|
padding: 0;
|
|
font-size: 14px;
|
|
line-height: 18px;
|
|
text-align: center;
|
|
background-color: transparent;
|
|
border: 0;
|
|
border-radius: 0 3px 0 0;
|
|
cursor: pointer;
|
|
}
|
|
.l7-popup .l7-popup-tip {
|
|
position: relative;
|
|
z-index: 1;
|
|
width: 0;
|
|
height: 0;
|
|
border: 10px solid transparent;
|
|
}
|
|
.l7-popup.l7-popup-anchor-bottom,
|
|
.l7-popup.l7-popup-anchor-bottom-left,
|
|
.l7-popup.l7-popup-anchor-bottom-right {
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: reverse;
|
|
-ms-flex-direction: column-reverse;
|
|
flex-direction: column-reverse;
|
|
}
|
|
.l7-popup.l7-popup-anchor-bottom .l7-popup-tip,
|
|
.l7-popup.l7-popup-anchor-bottom-left .l7-popup-tip,
|
|
.l7-popup.l7-popup-anchor-bottom-right .l7-popup-tip {
|
|
bottom: 1px;
|
|
}
|
|
.l7-popup.l7-popup-anchor-top,
|
|
.l7-popup.l7-popup-anchor-top-left,
|
|
.l7-popup.l7-popup-anchor-top-right {
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
.l7-popup.l7-popup-anchor-top .l7-popup-tip,
|
|
.l7-popup.l7-popup-anchor-top-left .l7-popup-tip,
|
|
.l7-popup.l7-popup-anchor-top-right .l7-popup-tip {
|
|
top: 1px;
|
|
}
|
|
.l7-popup.l7-popup-anchor-left {
|
|
-webkit-box-orient: horizontal;
|
|
-webkit-box-direction: normal;
|
|
-ms-flex-direction: row;
|
|
flex-direction: row;
|
|
}
|
|
.l7-popup.l7-popup-anchor-right {
|
|
-webkit-box-orient: horizontal;
|
|
-webkit-box-direction: reverse;
|
|
-ms-flex-direction: row-reverse;
|
|
flex-direction: row-reverse;
|
|
}
|
|
.l7-popup-anchor-top .l7-popup-tip {
|
|
position: relative;
|
|
-webkit-align-self: center;
|
|
-ms-flex-item-align: center;
|
|
align-self: center;
|
|
border-top: none;
|
|
border-bottom-color: #fff;
|
|
}
|
|
.l7-popup-anchor-top-left .l7-popup-tip {
|
|
-webkit-align-self: flex-start;
|
|
-ms-flex-item-align: start;
|
|
align-self: flex-start;
|
|
border-top: none;
|
|
border-bottom-color: #fff;
|
|
border-left: none;
|
|
}
|
|
.l7-popup-anchor-top-right .l7-popup-tip {
|
|
-webkit-align-self: flex-end;
|
|
-ms-flex-item-align: end;
|
|
align-self: flex-end;
|
|
border-top: none;
|
|
border-right: none;
|
|
border-bottom-color: #fff;
|
|
}
|
|
.l7-popup-anchor-bottom .l7-popup-tip {
|
|
-webkit-align-self: center;
|
|
-ms-flex-item-align: center;
|
|
align-self: center;
|
|
border-top-color: #fff;
|
|
border-bottom: none;
|
|
}
|
|
.l7-popup-anchor-bottom-left .l7-popup-tip {
|
|
-webkit-align-self: flex-start;
|
|
-ms-flex-item-align: start;
|
|
align-self: flex-start;
|
|
border-top-color: #fff;
|
|
border-bottom: none;
|
|
border-left: none;
|
|
}
|
|
.l7-popup-anchor-bottom-right .l7-popup-tip {
|
|
-webkit-align-self: flex-end;
|
|
-ms-flex-item-align: end;
|
|
align-self: flex-end;
|
|
border-top-color: #fff;
|
|
border-right: none;
|
|
border-bottom: none;
|
|
}
|
|
.l7-popup-anchor-left .l7-popup-tip {
|
|
-webkit-align-self: center;
|
|
-ms-flex-item-align: center;
|
|
align-self: center;
|
|
border-right-color: #fff;
|
|
border-left: none;
|
|
}
|
|
.l7-popup-anchor-right .l7-popup-tip {
|
|
right: 1px;
|
|
-webkit-align-self: center;
|
|
-ms-flex-item-align: center;
|
|
align-self: center;
|
|
border-right: none;
|
|
border-left-color: #fff;
|
|
}
|
|
.l7-popup-anchor-top-left .l7-popup-content {
|
|
border-top-left-radius: 0;
|
|
}
|
|
.l7-popup-anchor-top-right .l7-popup-content {
|
|
border-top-right-radius: 0;
|
|
}
|
|
.l7-popup-anchor-bottom-left .l7-popup-content {
|
|
border-bottom-left-radius: 0;
|
|
}
|
|
.l7-popup-anchor-bottom-right .l7-popup-content {
|
|
border-bottom-right-radius: 0;
|
|
}
|
|
.l7-popup-track-pointer {
|
|
display: none;
|
|
}
|
|
.l7-popup-track-pointer * {
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
pointer-events: none;
|
|
}
|
|
.l7-map:hover .l7-popup-track-pointer {
|
|
display: -webkit-box;
|
|
display: -ms-flexbox;
|
|
display: flex;
|
|
}
|
|
.l7-map:active .l7-popup-track-pointer {
|
|
display: none;
|
|
}
|
|
.l7-layer-popup__row {
|
|
font-size: 12px;
|
|
}
|
|
.l7-layer-popup__row + .l7-layer-popup__row {
|
|
margin-top: 4px;
|
|
}
|
|
`);var Mp,n1=(Mp={},(0,B.Z)(Mp,Zs.additive,{enable:!0,func:{srcRGB:R.ONE,dstRGB:R.ONE,srcAlpha:1,dstAlpha:1}}),(0,B.Z)(Mp,Zs.none,{enable:!1}),(0,B.Z)(Mp,Zs.normal,{enable:!0,func:{srcRGB:R.SRC_ALPHA,dstRGB:R.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}),(0,B.Z)(Mp,Zs.subtractive,{enable:!0,func:{srcRGB:R.ONE,dstRGB:R.ONE,srcAlpha:R.ZERO,dstAlpha:R.ONE_MINUS_SRC_COLOR},equation:{rgb:R.FUNC_SUBTRACT,alpha:R.FUNC_SUBTRACT}}),(0,B.Z)(Mp,Zs.max,{enable:!0,func:{srcRGB:R.ONE,dstRGB:R.ONE},equation:{rgb:R.MAX_EXT}}),(0,B.Z)(Mp,Zs.min,{enable:!0,func:{srcRGB:R.ONE,dstRGB:R.ONE},equation:{rgb:R.MIN_EXT}}),Mp);function i1(e){return e.map(function(r){return typeof r=="string"&&(r=[r,{}]),r})}function a1(e,r,t,n){var i=e.multiPassRenderer,o=e.getLayerConfig(),s=o.enableTAA;return s?i.add(n("taa")):i.add(n("render")),i1(r).forEach(function(l){var f=(0,Sn.Z)(l,2),v=f[0],y=f[1];i.add(t(v),y)}),i.add(t("copy")),i}var yw=function(){function e(r){(0,Q.Z)(this,e),this.layer=r}return(0,j.Z)(e,[{key:"pickRender",value:function(t){var n=this.layer.getContainer(),i=n.get(ot.ILayerService),o=this.layer;if(o.tileLayer)return o.tileLayer.pickRender(t);o.hooks.beforePickingEncode.call(),i.renderTileLayerMask(o),o.renderModels({ispick:!0}),o.hooks.afterPickingEncode.call()}},{key:"pick",value:function(t,n){var i=this.layer.getContainer(),o=i.get(ot.IPickingService);return t.type==="RasterLayer"?this.pickRasterLayer(t,n):(this.pickRender(n),o.pickFromPickingFBO(t,n))}},{key:"pickRasterLayer",value:function(t,n,i){var o=this.layer.getContainer(),s=o.get(ot.IPickingService),l=o.get(ot.IMapService),f=this.layer.getSource().extent,v=yh(n.lngLat,f),y={x:n.x,y:n.y,type:n.type,lngLat:n.lngLat,target:n,rasterValue:null},b=i||t;if(v){var T=this.readRasterValue(t,f,l,n.x,n.y);return y.rasterValue=T,s.triggerHoverOnLayer(b,y),!0}else return y.type=n.type==="mousemove"?"mouseout":"un"+n.type,s.triggerHoverOnLayer(b,(0,V.Z)((0,V.Z)({},y),{},{type:"unpick"})),s.triggerHoverOnLayer(b,y),!1}},{key:"readRasterValue",value:function(t,n,i,o,s){var l=t.getSource().data.dataArray[0],f=(0,Sn.Z)(n,4),v=f[0],y=v===void 0?0:v,b=f[1],T=b===void 0?0:b,M=f[2],O=M===void 0?10:M,F=f[3],$=F===void 0?-10:F,G=i.lngLatToContainer([y,T]),ue=i.lngLatToContainer([O,$]),xe=ue.x-G.x,ze=G.y-ue.y,Je=[(o-G.x)/xe,(s-ue.y)/ze],ht=l.width||1,gt=l.height||1,Ot=Math.floor(Je[0]*ht),tr=Math.floor(Je[1]*gt),Ir=Math.max(0,tr-1)*ht+Ot,Er=l.data[Ir];return Er}},{key:"selectFeature",value:function(t){var n=this.layer,i=(0,Sn.Z)(t,3),o=i[0],s=i[1],l=i[2];n.hooks.beforeSelect.call([o,s,l])}},{key:"highlightPickedFeature",value:function(t){var n=(0,Sn.Z)(t,3),i=n[0],o=n[1],s=n[2];this.layer.hooks.beforeHighlight.call([i,o,s])}},{key:"getFeatureById",value:function(t){return this.layer.getSource().getFeatureById(t)}}]),e}(),xw=function(){function e(r){(0,Q.Z)(this,e),this.layer=r;var t=this.layer.getContainer();this.rendererService=t.get(ot.IRendererService)}return(0,j.Z)(e,[{key:"getColorTexture",value:function(t,n){var i=this.getTextureKey(t,n);return this.key===i?this.colorTexture:(this.createColorTexture(t,n),this.key=i,this.colorTexture)}},{key:"createColorTexture",value:function(t,n){var i=this.rendererService.createTexture2D,o=this.getColorRampBar(t,n),s=i({data:new Uint8Array(o.data),width:o.width,height:o.height,flipY:!1});return this.colorTexture=s,s}},{key:"setColorTexture",value:function(t,n,i){this.key=this.getTextureKey(n,i),this.colorTexture=t}},{key:"destroy",value:function(){var t;(t=this.colorTexture)===null||t===void 0||t.destroy()}},{key:"getColorRampBar",value:function(t,n){switch(t.type){case"cat":return $o(t);case"quantize":return Vo(t);case"custom":return Ru(t,n);case"linear":return ha(t,n);default:return Ao(t)}}},{key:"getTextureKey",value:function(t,n){var i;return"".concat(t.colors.join("_"),"_").concat(t==null||(i=t.positions)===null||i===void 0?void 0:i.join("_"),"_").concat(t.type,"_").concat(n==null?void 0:n.join("_"))}}]),e}(),bw=["passes"],Ew=["moduleName","vertexShader","fragmentShader","inject","triangulation","styleOption"],o1,N0,s1;function Sw(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Aw(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function Aw(e,r){if(e){if(typeof e=="string")return u1(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return u1(e,r)}}function u1(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Tw(e){var r=ww();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function ww(){if(typeof Reflect=="undefined"||!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(e){return!1}}var U0=oi.isEqual,l1=oi.isFunction,c1=oi.isNumber,Su=oi.isObject,Cw=oi.isPlainObject,Rw=oi.isUndefined,f1=0,Ip=(o1=F0(ot.IGlobalConfigService),N0=function(e){(0,Le.Z)(t,e);var r=Tw(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,Q.Z)(this,t),n=r.call(this),(0,B.Z)((0,Fe.Z)(n),"id","".concat(f1++)),(0,B.Z)((0,Fe.Z)(n),"name","".concat(f1)),(0,B.Z)((0,Fe.Z)(n),"visible",!0),(0,B.Z)((0,Fe.Z)(n),"zIndex",0),(0,B.Z)((0,Fe.Z)(n),"inited",!1),(0,B.Z)((0,Fe.Z)(n),"layerModelNeedUpdate",!1),(0,B.Z)((0,Fe.Z)(n),"pickedFeatureID",null),(0,B.Z)((0,Fe.Z)(n),"selectedFeatureID",null),(0,B.Z)((0,Fe.Z)(n),"styleNeedUpdate",!1),(0,B.Z)((0,Fe.Z)(n),"forceRender",!1),(0,B.Z)((0,Fe.Z)(n),"clusterZoom",0),(0,B.Z)((0,Fe.Z)(n),"defaultSourceConfig",{data:[],options:{parser:{type:"json"}}}),(0,B.Z)((0,Fe.Z)(n),"dataState",{dataSourceNeedUpdate:!1,dataMappingNeedUpdate:!1,filterNeedUpdate:!1,featureScaleNeedUpdate:!1,StyleAttrNeedUpdate:!1}),(0,B.Z)((0,Fe.Z)(n),"hooks",{init:new A0,afterInit:new po,beforeRender:new po,beforeRenderData:new ah,afterRender:new xu,beforePickingEncode:new xu,afterPickingEncode:new xu,beforeHighlight:new xu(["pickedColor"]),afterHighlight:new xu,beforeSelect:new xu(["pickedColor"]),afterSelect:new xu,beforeDestroy:new xu,afterDestroy:new xu}),(0,B.Z)((0,Fe.Z)(n),"models",[]),(0,B.Z)((0,Fe.Z)(n),"startInit",!1),(0,B.Z)((0,Fe.Z)(n),"layerChildren",[]),(0,B.Z)((0,Fe.Z)(n),"masks",[]),Ni((0,Fe.Z)(n),"configService",s1,(0,Fe.Z)(n)),(0,B.Z)((0,Fe.Z)(n),"animateOptions",{enable:!1}),(0,B.Z)((0,Fe.Z)(n),"currentPickId",null),(0,B.Z)((0,Fe.Z)(n),"encodeStyleAttribute",{}),(0,B.Z)((0,Fe.Z)(n),"enableShaderEncodeStyles",[]),(0,B.Z)((0,Fe.Z)(n),"enableDataEncodeStyles",[]),(0,B.Z)((0,Fe.Z)(n),"enablg",[]),(0,B.Z)((0,Fe.Z)(n),"pendingStyleAttributes",[]),(0,B.Z)((0,Fe.Z)(n),"scaleOptions",{}),(0,B.Z)((0,Fe.Z)(n),"animateStatus",!1),(0,B.Z)((0,Fe.Z)(n),"isDestroyed",!1),(0,B.Z)((0,Fe.Z)(n),"encodeDataLength",0),(0,B.Z)((0,Fe.Z)(n),"sourceEvent",function(){n.dataState.dataSourceNeedUpdate=!0;var o=n.getLayerConfig();o&&o.autoFit&&n.fitBounds(o.fitBoundsOptions);var s=n.layerSource.getSourceCfg().autoRender;s&&setTimeout(function(){n.reRender()},10)}),n.name=i.name||n.id,n.zIndex=i.zIndex||0,n.rawConfig=i,n}return(0,j.Z)(t,[{key:"addMask",value:function(i){this.masks.push(i),this.enableMask()}},{key:"removeMask",value:function(i){var o=this.masks.indexOf(i);o>-1&&this.masks.splice(o,1)}},{key:"disableMask",value:function(){this.updateLayerConfig({enableMask:!1})}},{key:"enableMask",value:function(){this.updateLayerConfig({enableMask:!0})}},{key:"addMaskLayer",value:function(i){this.masks.push(i)}},{key:"removeMaskLayer",value:function(i){var o=this.masks.indexOf(i);o>-1&&this.masks.splice(o,1),i.destroy()}},{key:"getAttribute",value:function(i){return this.styleAttributeService.getLayerStyleAttribute(i)}},{key:"getLayerConfig",value:function(){return this.configService.getLayerConfig(this.id)}},{key:"updateLayerConfig",value:function(i){var o=this;if(Object.keys(i).map(function(l){l in o.rawConfig&&(o.rawConfig[l]=i[l])}),!this.startInit)this.needUpdateConfig=(0,V.Z)((0,V.Z)({},this.needUpdateConfig),i);else{var s=this.container.get(ot.SceneID);this.configService.setLayerConfig(s,this.id,(0,V.Z)((0,V.Z)((0,V.Z)({},this.configService.getLayerConfig(this.id)),this.needUpdateConfig),i)),this.needUpdateConfig={}}}},{key:"setContainer",value:function(i,o){this.container=i,this.sceneContainer=o}},{key:"getContainer",value:function(){return this.container}},{key:"addPlugin",value:function(i){return this.plugins.push(i),this}},{key:"init",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s=this,l,f,v,y,b,T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:l=this.container.get(ot.SceneID),this.startInit=!0,this.configService.setLayerConfig(l,this.id,this.rawConfig),this.layerType=this.rawConfig.layerType,this.iconService=this.container.get(ot.IIconService),this.fontService=this.container.get(ot.IFontService),this.rendererService=this.container.get(ot.IRendererService),this.layerService=this.container.get(ot.ILayerService),this.debugService=this.container.get(ot.IDebugService),this.interactionService=this.container.get(ot.IInteractionService),this.pickingService=this.container.get(ot.IPickingService),this.mapService=this.container.get(ot.IMapService),f=this.getLayerConfig(),v=f.enableMultiPassRenderer,y=f.passes,v&&y!==null&&y!==void 0&&y.length&&y.length>0&&this.mapService.on("mapAfterFrameChange",function(){s.renderLayers()}),this.cameraService=this.container.get(ot.ICameraService),this.coordinateService=this.container.get(ot.ICoordinateSystemService),this.shaderModuleService=this.container.get(ot.IShaderModuleService),this.postProcessingPassFactory=this.container.get(ot.IFactoryPostProcessingPass),this.normalPassFactory=this.container.get(ot.IFactoryNormalPass),this.styleAttributeService=this.container.get(ot.IStyleAttributeService),v&&(this.multiPassRenderer=this.container.get(ot.IMultiPassRenderer),this.multiPassRenderer.setLayer(this)),this.pendingStyleAttributes.forEach(function($){var G=$.attributeName,ue=$.attributeField,xe=$.attributeValues,ze=$.updateOptions;s.styleAttributeService.updateStyleAttribute(G,{scale:(0,V.Z)({field:ue},s.splitValuesAndCallbackInAttribute(xe,ue?void 0:s.getLayerConfig()[G]))},ze)}),this.pendingStyleAttributes=[],this.plugins=this.container.getAll(ot.ILayerPlugin),b=Sw(this.plugins);try{for(b.s();!(T=b.n()).done;)M=T.value,M.apply(this,{rendererService:this.rendererService,mapService:this.mapService,styleAttributeService:this.styleAttributeService,normalPassFactory:this.normalPassFactory,postProcessingPassFactory:this.postProcessingPassFactory})}catch($){b.e($)}finally{b.f()}return this.layerPickService=new yw(this),this.textureService=new xw(this),this.log(Rs.LayerInitStart),F.next=31,this.hooks.init.promise();case 31:this.log(Rs.LayerInitEnd),this.inited=!0,this.emit("inited",{target:this,type:"inited"}),this.emit("add",{target:this,type:"add"}),this.hooks.afterInit.call();case 36:case"end":return F.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"log",value:function(i){var o,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"init";if(!(this.tileLayer||this.isTileLayer)){var l="".concat(this.id,".").concat(s,".").concat(i),f={id:this.id,type:this.type};(o=this.debugService)===null||o===void 0||o.log(l,f)}}},{key:"updateModelData",value:function(i){i.attributes&&i.elements?this.models.map(function(o){o.updateAttributesAndElements(i.attributes,i.elements)}):console.warn("data error")}},{key:"setLayerPickService",value:function(i){this.layerPickService=i}},{key:"prepareBuildModel",value:function(){Object.keys(this.needUpdateConfig||{}).length!==0&&this.updateLayerConfig({});var i=this.getLayerConfig(),o=i.animateOption;o!=null&&o.enable&&(this.layerService.startAnimate(),this.animateStatus=!0)}},{key:"color",value:function(i,o,s){return this.updateStyleAttribute("color",i,o,s),this}},{key:"texture",value:function(i,o,s){return this.updateStyleAttribute("texture",i,o,s),this}},{key:"rotate",value:function(i,o,s){return this.updateStyleAttribute("rotate",i,o,s),this}},{key:"size",value:function(i,o,s){return this.updateStyleAttribute("size",i,o,s),this}},{key:"filter",value:function(i,o,s){var l=this.updateStyleAttribute("filter",i,o,s);return this.dataState.dataSourceNeedUpdate=l&&this.inited,this}},{key:"shape",value:function(i,o,s){this.shapeOption={field:i,values:o};var l=this.updateStyleAttribute("shape",i,o,s);return this.dataState.dataSourceNeedUpdate=l&&this.inited,this}},{key:"label",value:function(i,o,s){return this.pendingStyleAttributes.push({attributeName:"label",attributeField:i,attributeValues:o,updateOptions:s}),this}},{key:"animate",value:function(i){var o={};return Su(i)?(o.enable=!0,o=(0,V.Z)((0,V.Z)({},o),i)):o.enable=i,this.updateLayerConfig({animateOption:o}),this}},{key:"source",value:function(i,o){return(i==null?void 0:i.type)==="source"?(this.setSource(i),this):(this.sourceOption={data:i,options:o},this.clusterZoom=0,this)}},{key:"setData",value:function(i,o){var s=this;return this.inited?(this.log(Rs.SourceInitStart,ds.UPDATE),this.layerSource.setData(i,o),this.log(Rs.SourceInitEnd,ds.UPDATE)):this.on("inited",function(){s.log(Rs.SourceInitStart,ds.UPDATE);var l=s.getSource();l?s.layerSource.setData(i,o):s.source(new Xy(i,o)),s.layerSource.once("update",function(){s.log(Rs.SourceInitEnd,ds.UPDATE)})}),this}},{key:"style",value:function(i){var o=this,s=i.passes,l=(0,ka.Z)(i,bw);s&&i1(s).forEach(function(v){var y=o.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(v[0]);y&&y.updateOptions(v[1])}),l.borderColor&&(l.stroke=l.borderColor),l.borderWidth&&(l.strokeWidth=l.borderWidth);var f=l;return Object.keys(l).forEach(function(v){var y=l[v];Array.isArray(y)&&y.length===2&&!c1(y[0])&&!c1(y[1])&&(f[v]={field:y[0],value:y[1]})}),this.encodeStyle(f),this.updateLayerConfig(f),this}},{key:"encodeStyle",value:function(i){var o=this;Object.keys(i).forEach(function(s){[].concat((0,Kt.Z)(o.enableShaderEncodeStyles),(0,Kt.Z)(o.enableDataEncodeStyles)).includes(s)&&Cw(i[s])&&(i[s].field||i[s].value)&&!U0(o.encodeStyleAttribute[s],i[s])?(o.encodeStyleAttribute[s]=i[s],o.updateStyleAttribute(s,i[s].field,i[s].value),o.inited&&(o.dataState.dataMappingNeedUpdate=!0)):o.encodeStyleAttribute[s]&&(delete o.encodeStyleAttribute[s],o.dataState.dataSourceNeedUpdate=!0)})}},{key:"scale",value:function(i,o){var s=(0,V.Z)({},this.scaleOptions);if(Su(i)?this.scaleOptions=(0,V.Z)((0,V.Z)({},this.scaleOptions),i):this.scaleOptions[i]=o,this.styleAttributeService&&!U0(s,this.scaleOptions)){var l=Su(i)?i:(0,B.Z)({},i,o);this.styleAttributeService.updateScaleAttribute(l)}return this}},{key:"renderLayers",value:function(){this.rendering=!0,this.layerService.reRender(),this.rendering=!1}},{key:"render",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.tileLayer?(this.tileLayer.render(),this):(this.layerService.beforeRenderData(this),this.encodeDataLength<=0&&!this.forceRender?this:(this.renderModels(i),this))}},{key:"renderMultiPass",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!(this.encodeDataLength<=0&&!this.forceRender)){l.next=2;break}return l.abrupt("return");case 2:if(!(this.multiPassRenderer&&this.multiPassRenderer.getRenderFlag())){l.next=7;break}return l.next=5,this.multiPassRenderer.render();case 5:l.next=8;break;case 7:this.multiPassRenderer?this.renderModels():this.renderModels();case 8:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"active",value:function(i){var o={};return o.enableHighlight=Su(i)?!0:i,Su(i)?(o.enableHighlight=!0,i.color&&(o.highlightColor=i.color),i.mix&&(o.activeMix=i.mix)):o.enableHighlight=!!i,this.updateLayerConfig(o),this}},{key:"setActive",value:function(i,o){var s=this;if(Su(i)){var l=i.x,f=l===void 0?0:l,v=i.y,y=v===void 0?0:v;this.updateLayerConfig({highlightColor:Su(o)?o.color:this.getLayerConfig().highlightColor,activeMix:Su(o)?o.mix:this.getLayerConfig().activeMix}),this.pick({x:f,y})}else this.updateLayerConfig({pickedFeatureID:i,highlightColor:Su(o)?o.color:this.getLayerConfig().highlightColor,activeMix:Su(o)?o.mix:this.getLayerConfig().activeMix}),this.hooks.beforeHighlight.call(sa(i)).then(function(){setTimeout(function(){s.reRender()},1)})}},{key:"select",value:function(i){var o={};return o.enableSelect=Su(i)?!0:i,Su(i)?(o.enableSelect=!0,i.color&&(o.selectColor=i.color),i.mix&&(o.selectMix=i.mix)):o.enableSelect=!!i,this.updateLayerConfig(o),this}},{key:"setSelect",value:function(i,o){var s=this;if(Su(i)){var l=i.x,f=l===void 0?0:l,v=i.y,y=v===void 0?0:v;this.updateLayerConfig({selectColor:Su(o)?o.color:this.getLayerConfig().selectColor,selectMix:Su(o)?o.mix:this.getLayerConfig().selectMix}),this.pick({x:f,y})}else this.updateLayerConfig({pickedFeatureID:i,selectColor:Su(o)?o.color:this.getLayerConfig().selectColor,selectMix:Su(o)?o.mix:this.getLayerConfig().selectMix}),this.hooks.beforeSelect.call(sa(i)).then(function(){setTimeout(function(){s.reRender()},1)})}},{key:"setBlend",value:function(i){return this.updateLayerConfig({blend:i}),this.reRender(),this}},{key:"show",value:function(){return this.updateLayerConfig({visible:!0}),this.reRender(),this.emit("show"),this}},{key:"hide",value:function(){return this.updateLayerConfig({visible:!1}),this.reRender(),this.emit("hide"),this}},{key:"setIndex",value:function(i){return this.zIndex=i,this.layerService.updateLayerRenderList(),this.layerService.renderLayers(),this}},{key:"setCurrentPickId",value:function(i){this.currentPickId=i}},{key:"getCurrentPickId",value:function(){return this.currentPickId}},{key:"setCurrentSelectedId",value:function(i){this.selectedFeatureID=i}},{key:"getCurrentSelectedId",value:function(){return this.selectedFeatureID}},{key:"isVisible",value:function(){var i=this.mapService.getZoom(),o=this.getLayerConfig(),s=o.visible,l=o.minZoom,f=l===void 0?-1/0:l,v=o.maxZoom,y=v===void 0?1/0:v;return!!s&&i>=f&&i<y}},{key:"setMultiPass",value:function(i,o){if(this.updateLayerConfig({enableMultiPassRenderer:i}),o&&this.updateLayerConfig({passes:o}),i){var s=this.getLayerConfig(),l=s.passes,f=l===void 0?[]:l;this.multiPassRenderer=a1(this,f,this.postProcessingPassFactory,this.normalPassFactory),this.multiPassRenderer.setRenderFlag(!0);var v=this.rendererService.getViewportSize(),y=v.width,b=v.height;this.multiPassRenderer.resize(y,b)}return this}},{key:"setMinZoom",value:function(i){return this.updateLayerConfig({minZoom:i}),this}},{key:"getMinZoom",value:function(){var i=this.getLayerConfig(),o=i.minZoom;return o}},{key:"getMaxZoom",value:function(){var i=this.getLayerConfig(),o=i.maxZoom;return o}},{key:"get",value:function(i){var o=this.getLayerConfig();return o[i]}},{key:"setMaxZoom",value:function(i){return this.updateLayerConfig({maxZoom:i}),this}},{key:"setAutoFit",value:function(i){return this.updateLayerConfig({autoFit:i}),this}},{key:"fitBounds",value:function(i){if(!this.inited)return this.updateLayerConfig({autoFit:!0}),this;var o=this.getSource(),s=o.extent,l=s.some(function(f){return Math.abs(f)===1/0});return l?this:(this.mapService.fitBounds([[s[0],s[1]],[s[2],s[3]]],i),this)}},{key:"destroy",value:function(){var i,o,s,l,f,v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.isDestroyed){(i=this.layerModel)===null||i===void 0||i.uniformBuffers.forEach(function(T){T.destroy()}),this.layerChildren.map(function(T){return T.destroy(!1)}),this.layerChildren=[];var y=this.getLayerConfig(),b=y.maskfence;b&&(this.masks.map(function(T){return T.destroy(!1)}),this.masks=[]),this.hooks.beforeDestroy.call(),this.layerSource.off("update",this.sourceEvent),(o=this.multiPassRenderer)===null||o===void 0||o.destroy(),this.textureService.destroy(),this.styleAttributeService.clearAllAttributes(),this.hooks.afterDestroy.call(),(s=this.layerModel)===null||s===void 0||s.clearModels(v),(l=this.tileLayer)===null||l===void 0||l.destroy(),this.models=[],(f=this.debugService)===null||f===void 0||f.removeLog(this.id),this.emit("remove",{target:this,type:"remove"}),this.emit("destroy",{target:this,type:"destroy"}),this.removeAllListeners(),this.isDestroyed=!0}}},{key:"clear",value:function(){this.styleAttributeService.clearAllAttributes()}},{key:"clearModels",value:function(){var i;this.models.forEach(function(o){return o.destroy()}),(i=this.layerModel)===null||i===void 0||i.clearModels(),this.models=[]}},{key:"isDirty",value:function(){return!!(this.styleAttributeService.getLayerStyleAttributes()||[]).filter(function(i){return i.needRescale||i.needRemapping||i.needRegenerateVertices}).length}},{key:"setSource",value:function(i){var o=this;if(this.layerSource&&this.layerSource.off("update",this.sourceEvent),this.layerSource=i,this.clusterZoom=0,this.inited&&this.layerSource.cluster){var s=this.mapService.getZoom();this.layerSource.updateClusterData(s)}this.layerSource.inited&&this.sourceEvent(),this.layerSource.on("update",function(l){var f=l.type;if(o.coordCenter===void 0){var v,y=o.layerSource.center;o.coordCenter=y,(v=o.mapService)!==null&&v!==void 0&&v.setCoordCenter&&o.mapService.setCoordCenter(y)}if(f==="update"){if(o.tileLayer){o.tileLayer.reload();return}o.sourceEvent()}})}},{key:"getSource",value:function(){return this.layerSource}},{key:"getScaleOptions",value:function(){return this.scaleOptions}},{key:"setEncodedData",value:function(i){this.encodedData=i,this.encodeDataLength=i.length}},{key:"getEncodedData",value:function(){return this.encodedData}},{key:"getScale",value:function(i){return this.styleAttributeService.getLayerAttributeScale(i)}},{key:"getLegend",value:function(i){var o,s,l,f=this.styleAttributeService.getLayerStyleAttribute(i),v=(f==null||(o=f.scale)===null||o===void 0?void 0:o.scalers)||[];return{type:(s=v[0].option)===null||s===void 0?void 0:s.type,field:f==null||(l=f.scale)===null||l===void 0?void 0:l.field,items:this.getLegendItems(i)}}},{key:"getLegendItems",value:function(i){var o=this.styleAttributeService.getLayerAttributeScale(i);if(!o)return[];if(o.invertExtent){var s=o.range().map(function(v){return(0,B.Z)({value:o.invertExtent(v)},i,v)});return s}else if(o.ticks){var l=o.ticks().map(function(v){return(0,B.Z)({value:v},i,o(v))});return l}else if(o!=null&&o.domain){var f=o.domain().filter(function(v){return!Rw(v)}).map(function(v){return(0,B.Z)({value:v},i,o(v))});return f}return[]}},{key:"pick",value:function(i){var o=i.x,s=i.y;this.interactionService.triggerHover({x:o,y:s})}},{key:"boxSelect",value:function(i,o){this.pickingService.boxPickLayer(this,i,o)}},{key:"buildLayerModel",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l=this,f,v,y,b,T,M,O,F,$,G,ue,xe;return ge().wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:return f=s.moduleName,v=s.vertexShader,y=s.fragmentShader,b=s.inject,T=s.triangulation,M=s.styleOption,O=(0,ka.Z)(s,Ew),this.shaderModuleService.registerModule(f,{vs:v,fs:y,inject:b}),F=this.shaderModuleService.getModule(f),$=F.vs,G=F.fs,ue=F.uniforms,xe=this.rendererService.createModel,Je.abrupt("return",new Promise(function(ht){var gt=l.styleAttributeService.createAttributesAndIndices(l.encodedData,T,M),Ot=gt.attributes,tr=gt.elements,Ir=gt.count,Er=(0,V.Z)({attributes:Ot,uniforms:ue,fs:G,vs:$,elements:tr,blend:n1[Zs.normal],uniformBuffers:[].concat((0,Kt.Z)(l.layerModel.uniformBuffers),(0,Kt.Z)(l.rendererService.uniformBuffers)),textures:l.layerModel.textures},O);Ir&&(Er.count=Ir);var mn=xe(Er);ht(mn)}));case 5:case"end":return Je.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"createAttributes",value:function(i){var o=i.triangulation,s=this.styleAttributeService.createAttributes(this.encodedData,o),l=s.attributes;return l}},{key:"getTime",value:function(){return this.layerService.clock.getDelta()}},{key:"setAnimateStartTime",value:function(){this.animateStartTime=this.layerService.clock.getElapsedTime()}},{key:"stopAnimate",value:function(){this.animateStatus&&(this.layerService.stopAnimate(),this.animateStatus=!1,this.updateLayerConfig({animateOption:{enable:!1}}))}},{key:"getLayerAnimateTime",value:function(){return this.layerService.clock.getElapsedTime()-this.animateStartTime}},{key:"needPick",value:function(i){var o=this.getLayerConfig(),s=o.enableHighlight,l=s===void 0?!0:s,f=o.enableSelect,v=f===void 0?!0:f,y=this.eventNames().indexOf(i)!==-1||this.eventNames().indexOf("un"+i)!==-1;return(i==="click"||i==="dblclick")&&v&&(y=!0),i==="mousemove"&&(l||this.eventNames().indexOf("mouseenter")!==-1||this.eventNames().indexOf("unmousemove")!==-1||this.eventNames().indexOf("mouseout")!==-1)&&(y=!0),this.isVisible()&&y}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return l.stop()}},o)}));function i(){return n.apply(this,arguments)}return i}()},{key:"rebuildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.buildModels();case 2:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"renderMulPass",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,s.render();case 2:case"end":return f.stop()}},o)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"renderModels",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.encodeDataLength<=0&&!this.forceRender?(this.clearModels(),this):(this.hooks.beforeRender.call(),this.models.forEach(function(s){s.draw({uniforms:i.layerModel.getUninforms(),blend:i.layerModel.getBlend(),stencil:i.layerModel.getStencil(o)},(o==null?void 0:o.ispick)||!1)}),this.hooks.afterRender.call(),this)}},{key:"updateStyleAttribute",value:function(i,o,s,l){var f=this.configService.getAttributeConfig(this.id)||{};return U0(f[i],{field:o,values:s})?!1:(["color","size","texture","rotate","filter","label","shape"].indexOf(i)!==-1&&this.configService.setAttributeConfig(this.id,(0,B.Z)({},i,{field:o,values:s})),this.startInit?this.styleAttributeService.updateStyleAttribute(i,{scale:(0,V.Z)({field:o},this.splitValuesAndCallbackInAttribute(s,this.getLayerConfig()[o]))},l):this.pendingStyleAttributes.push({attributeName:i,attributeField:o,attributeValues:s,updateOptions:l}),!0)}},{key:"getLayerAttributeConfig",value:function(){return this.configService.getAttributeConfig(this.id)}},{key:"getShaderPickStat",value:function(){return this.layerService.getShaderPickStat()}},{key:"setEarthTime",value:function(i){console.warn("empty fn")}},{key:"processData",value:function(i){return i}},{key:"getModelType",value:function(){throw new Error("Method not implemented.")}},{key:"getDefaultConfig",value:function(){return{}}},{key:"initLayerModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.models.forEach(function(f){return f.destroy()}),this.models=[],l.next=4,this.layerModel.initModels();case 4:this.models=l.sent;case 5:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"reRender",value:function(){this.inited&&this.layerService.reRender()}},{key:"splitValuesAndCallbackInAttribute",value:function(i){return{values:l1(i)?void 0:i,callback:l1(i)?i:void 0}}}]),t}(io.EventEmitter),s1=ki(N0.prototype,"configService",[o1],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),N0);function Mw(e,r){return{enable:e,mask:255,func:{cmp:R.EQUAL,ref:r?1:0,mask:1}}}function h1(e){return e.maskOperation===Qp.OR?{enable:!0,mask:255,func:{cmp:R.ALWAYS,ref:1,mask:255},opFront:{fail:R.KEEP,zfail:R.REPLACE,zpass:R.REPLACE}}:{enable:!0,mask:255,func:{cmp:e.stencilType===hc.SINGLE||e.stencilIndex===0?R.ALWAYS:R.LESS,ref:e.stencilType===hc.SINGLE?1:e.stencilIndex===0?2:1,mask:255},opFront:{fail:R.KEEP,zfail:R.REPLACE,zpass:R.REPLACE}}}var Iw={opacity:1,stroke:[1,0,0,1],offsets:[0,0],rotation:0,extrusionBase:0,strokeOpacity:1,thetaOffset:.314},yg={opacity:"float",stroke:"vec4",offsets:"vec2",textOffset:"vec2",rotation:"float",extrusionBase:"float",strokeOpacity:"float",thetaOffset:"float"};function hL(e){var r="";return Object.keys(e).forEach(function(t){var n=e[t];Array.isArray(n)?r+="vec".concat(n.length," ").concat(t,`;
|
|
`):r+="flot ".concat(t,`;
|
|
`)}),r}function p1(e){return Math.ceil(e/4)*4}var Ms=function(e){return e[e.POSITION=0]="POSITION",e[e.COLOR=1]="COLOR",e[e.VERTEX_ID=2]="VERTEX_ID",e[e.PICKING_COLOR=3]="PICKING_COLOR",e[e.STROKE=4]="STROKE",e[e.OPACITY=5]="OPACITY",e[e.OFFSETS=6]="OFFSETS",e[e.ROTATION=7]="ROTATION",e[e.EXTRUSION_BASE=8]="EXTRUSION_BASE",e[e.SIZE=9]="SIZE",e[e.SHAPE=10]="SHAPE",e[e.EXTRUDE=11]="EXTRUDE",e[e.MAX=12]="MAX",e[e.NORMAL=13]="NORMAL",e}({});function Pw(e){switch(e){case"rotation":return{name:"Rotation",type:dn.Attribute,descriptor:{name:"a_Rotation",shaderLocation:Ms.ROTATION,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(t){var n=t.rotation,i=n===void 0?0:n;return Array.isArray(i)?[i[0]]:[i]}}};case"stroke":return{name:"stroke",type:dn.Attribute,descriptor:{name:"a_Stroke",shaderLocation:Ms.STROKE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:4,update:function(t){var n=t.stroke,i=n===void 0?[1,1,1,1]:n;return i}}};case"opacity":return{name:"opacity",type:dn.Attribute,descriptor:{name:"a_Opacity",shaderLocation:Ms.OPACITY,buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(t){var n=t.opacity,i=n===void 0?1:n;return[i]}}};case"extrusionBase":return{name:"extrusionBase",type:dn.Attribute,descriptor:{name:"a_ExtrusionBase",shaderLocation:Ms.EXTRUSION_BASE,buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(t){var n=t.extrusionBase,i=n===void 0?0:n;return[i]}}};case"offsets":return{name:"offsets",type:dn.Attribute,descriptor:{name:"a_Offsets",shaderLocation:Ms.OFFSETS,buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(t){var n=t.offsets;return n}}};case"thetaOffset":return{name:"thetaOffset",type:dn.Attribute,descriptor:{name:"a_ThetaOffset",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(t){var n=t.thetaOffset,i=n===void 0?1:n;return[i]}}};default:return}}var d1,z0,v1,m1={opacity:Ms.OPACITY,stroke:Ms.STROKE,offsets:Ms.OFFSETS,rotation:Ms.ROTATION,extrusionBase:Ms.EXTRUSION_BASE},Ma=(d1=F0(ot.IGlobalConfigService),z0=function(){function e(r){(0,Q.Z)(this,e),(0,B.Z)(this,"uniformBuffers",[]),(0,B.Z)(this,"textures",[]),(0,B.Z)(this,"preStyleAttribute",{}),(0,B.Z)(this,"encodeStyleAttribute",{}),Ni(this,"configService",v1,this),this.layer=r,this.rendererService=r.getContainer().get(ot.IRendererService),this.pickingService=r.getContainer().get(ot.IPickingService),this.shaderModuleService=r.getContainer().get(ot.IShaderModuleService),this.styleAttributeService=r.getContainer().get(ot.IStyleAttributeService),this.mapService=r.getContainer().get(ot.IMapService),this.iconService=r.getContainer().get(ot.IIconService),this.fontService=r.getContainer().get(ot.IFontService),this.cameraService=r.getContainer().get(ot.ICameraService),this.layerService=r.getContainer().get(ot.ILayerService),this.registerStyleAttribute(),this.registerBuiltinAttributes(),this.startModelAnimate();var t=this.rendererService.createTexture2D;this.createTexture2D=t}return(0,j.Z)(e,[{key:"getBlend",value:function(){var t=this.layer.getLayerConfig(),n=t.blend,i=n===void 0?"normal":n;return n1[Zs[i]]}},{key:"getStencil",value:function(t){var n=this.layer.getLayerConfig(),i=n.mask,o=i===void 0?!1:i,s=n.maskInside,l=s===void 0?!0:s,f=n.enableMask,v=n.maskOperation,y=v===void 0?Qp.AND:v;if(this.layer.type==="MaskLayer")return h1({isStencil:!0,stencilType:hc.SINGLE});if(t.isStencil)return h1((0,V.Z)((0,V.Z)({},t),{},{maskOperation:y}));var b=o||f&&this.layer.masks.length!==0||this.layer.tileMask!==void 0;return Mw(b,l)}},{key:"getDefaultStyle",value:function(){return{}}},{key:"getUninforms",value:function(){throw new Error("Method not implemented.")}},{key:"getAnimateUniforms",value:function(){return{}}},{key:"needUpdate",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){return ge().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",!1);case 1:case"end":return o.stop()}},n)}));function t(){return r.apply(this,arguments)}return t}()},{key:"buildModels",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){return ge().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return o.stop()}},n)}));function t(){return r.apply(this,arguments)}return t}()},{key:"initModels",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){return ge().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return o.stop()}},n)}));function t(){return r.apply(this,arguments)}return t}()},{key:"clearModels",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0}},{key:"getAttribute",value:function(){throw new Error("Method not implemented.")}},{key:"render",value:function(t){throw new Error("Method not implemented.")}},{key:"registerBuiltinAttributes",value:function(){throw new Error("Method not implemented.")}},{key:"animateOption2Array",value:function(t){return[t.enable?0:1,t.duration||4,t.interval||.2,t.trailLength||.1]}},{key:"startModelAnimate",value:function(){var t=this.layer.getLayerConfig(),n=t.animateOption;n.enable&&this.layer.setAnimateStartTime()}},{key:"getInject",value:function(){var t=this.layer.encodeStyleAttribute,n="",i=[];this.layer.enableShaderEncodeStyles.forEach(function(l){t[l]?n+="#define USE_ATTRIBUTE_".concat(l.toUpperCase(),` 0.0;
|
|
|
|
`):i.push(" ".concat(yg[l]," u_").concat(l,";")),n+=`
|
|
#ifdef USE_ATTRIBUTE_`.concat(l.toUpperCase(),`
|
|
layout(location = `).concat(m1[l],") in ").concat(yg[l]," a_").concat(l.charAt(0).toUpperCase()+l.slice(1),`;
|
|
#endif
|
|
|
|
`)});var o=i.length?`
|
|
layout(std140) uniform AttributeUniforms {
|
|
`.concat(i.join(`
|
|
`),`
|
|
};
|
|
`):"";n+=o;var s="";return this.layer.enableShaderEncodeStyles.forEach(function(l){s+=`
|
|
|
|
#ifdef USE_ATTRIBUTE_`.concat(l.toUpperCase(),`
|
|
`).concat(yg[l]," ").concat(l," = a_").concat(l.charAt(0).toUpperCase()+l.slice(1),`;
|
|
#else
|
|
`).concat(yg[l]," ").concat(l," = u_").concat(l,`;
|
|
#endif
|
|
|
|
`)}),{"vs:#decl":n,"fs:#decl":o,"vs:#main-start":s}}},{key:"getStyleAttribute",value:function(){var t=this,n={};return this.layer.enableShaderEncodeStyles.forEach(function(i){if(!t.layer.encodeStyleAttribute[i]){var o=t.layer.getLayerConfig()[i],s=typeof o=="undefined"?Iw[i]:o;i==="stroke"&&(s=fi(s)),n["u_"+i]=s}}),n}},{key:"registerStyleAttribute",value:function(){var t=this;Object.keys(this.layer.encodeStyleAttribute).forEach(function(n){var i=Pw(n);i&&(t.styleAttributeService.registerStyleAttribute(i),i.descriptor&&(i.descriptor.shaderLocation=m1[n]))})}},{key:"updateEncodeAttribute",value:function(t,n){this.encodeStyleAttribute[t]=n}},{key:"initUniformsBuffer",value:function(){var t=this.getUniformsBufferInfo(this.getStyleAttribute()),n=this.getCommonUniformsInfo();this.attributeUnifoms=this.rendererService.createBuffer({data:new Float32Array(p1(t.uniformsLength)),isUBO:!0}),this.commonUnifoms=this.rendererService.createBuffer({data:new Float32Array(p1(n.uniformsLength)),isUBO:!0}),this.uniformBuffers=[this.attributeUnifoms,this.commonUnifoms]}},{key:"getUniformsBufferInfo",value:function(t){var n=0,i=[];return Object.values(t).forEach(function(o){Array.isArray(o)?(i.push.apply(i,(0,Kt.Z)(o)),n+=o.length):(i.push(o),n+=1)}),{uniformsOption:t,uniformsLength:n,uniformsArray:i}}},{key:"getCommonUniformsInfo",value:function(){return{uniformsLength:0,uniformsArray:[],uniformsOption:{}}}},{key:"updateStyleUnifoms",value:function(){var t=this.getUniformsBufferInfo(this.getStyleAttribute()),n=t.uniformsArray,i=this.getCommonUniformsInfo(),o=i.uniformsArray;this.attributeUnifoms.subData({offset:0,data:new Uint8Array(new Float32Array(n).buffer)}),this.commonUnifoms.subData({offset:0,data:new Uint8Array(new Float32Array(o).buffer)})}}]),e}(),v1=ki(z0.prototype,"configService",[d1],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),z0),Z0=100,pL=36,dL=40;function g1(e){return e/180*Math.acos(-1)}function _1(e){var r=g1(e[0])+Math.PI/2,t=g1(e[1]),n=Z0+Math.random()*.4,i=n*Math.cos(t)*Math.cos(r),o=n*Math.cos(t)*Math.sin(r),s=n*Math.sin(t);return[o,s,i]}function vL(e,r){var t=mat4.create(),n=mat4.create(),i=vec3.fromValues(0,1,0),o=vec3.fromValues(0,0,0);r=r||{},e=typeof e!="undefined"?e:1;for(var s=typeof r.segments!="undefined"?r.segments:32,l=2+s,f=2*l,v=[],y=[],b=[],T=[],M=[],O=[],F=0;F<=l;F++){for(var $=F/l,G=$*Math.PI,ue=0;ue<=f;ue++){var xe=ue/f,ze=xe*Math.PI*2;mat4.identity(n),mat4.rotateZ(n,n,-G),mat4.identity(t),mat4.rotateY(t,t,ze),vec3.transformMat4(o,i,n),vec3.transformMat4(o,o,t),vec3.scale(o,o,-e),b.push(o.slice()),T.push.apply(T,_toConsumableArray(o.slice())),vec3.normalize(o,o),M.push.apply(M,_toConsumableArray(o.slice())),O.push([xe,1-$]),T.push(xe,1-$)}if(F>0)for(var Je=b.length,ht=Je-2*(f+1);ht+f+2<Je;ht++)v.push([ht,ht+1,ht+f+1]),y.push(ht,ht+1,ht+f+1),v.push([ht+f+1,ht+1,ht+f+2]),y.push(ht+f+1,ht+1,ht+f+2)}return{cells:v,positions:b,uvs:O,positionsArr:T,indicesArr:y,normalArr:M}}var xg=Or.Ue(),mL=Or.Ue(),Gs=Or.Ue(),Pp=Or.Ue(),lv=Or.Ue();function V0(e,r,t,n,i){Or.IH(e,t,n),Or.Fv(e,e),r=Or.al(-e[1],e[0]);var o=Or.al(-t[1],t[0]);return[i/Or.AK(r,o),r]}function Op(e,r){return Or.t8(e,-r[1],r[0])}function cv(e,r,t){return Or.lu(e,r,t),Or.Fv(e,e),e}function j0(e,r){return e[0]===r[0]&&e[1]===r[1]}function gL(e){for(var r=new Map,t=0;t<e.length;t++){var n=e[0].toString()+"-"+e[1].toString();r.get(n)?(e.splice(t,1),t++):r.set(n,n)}return e}var Ow=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,Q.Z)(this,e),(0,B.Z)(this,"lastFlip",-1),(0,B.Z)(this,"miter",Or.al(0,0)),(0,B.Z)(this,"started",!1),(0,B.Z)(this,"dash",!1),(0,B.Z)(this,"totalDistance",0),(0,B.Z)(this,"currentIndex",0),this.join=r.join||"miter",this.cap=r.cap||"butt",this.miterLimit=r.miterLimit||10,this.thickness=r.thickness||1,this.dash=r.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0,indexes:[]}}return(0,j.Z)(e,[{key:"simpleExtrude",value:function(t){var n=this.complex;if(t.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var i=t.length,o=n.startIndex,s=1;s<i;s++){var l=t[s-1],f=t[s],v=s<t.length-1?t[s+1]:null,y=this.simpleSegment(n,o,l,f,v);o+=y}if(this.dash)for(var b=0;b<n.positions.length/6;b++)n.positions[b*6+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"simpleExtrude_gaode2",value:function(t,n){var i=this.complex;if(t.length<=1)return i;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var o=t.length,s=i.startIndex,l=1;l<o;l++){var f,v,y,b=t[l-1];b.push((f=n[l-1][2])!==null&&f!==void 0?f:0);var T=n[l-1],M=t[l];M.push((v=n[l][2])!==null&&v!==void 0?v:0);var O=n[l],F=l<t.length-1?[].concat((0,Kt.Z)(t[l+1]),[(y=n[l+1][2])!==null&&y!==void 0?y:0]):null,$=l<n.length-1?n[l+1]:null,G=this.simpleSegment(i,s,b,M,F,T,O,$);s+=G}if(this.dash)for(var ue=0;ue<i.positions.length/6;ue++)i.positions[ue*6+5]=this.totalDistance;return i.startIndex=i.positions.length/6,i}},{key:"extrude_gaode2",value:function(t,n){var i=this.complex;if(t.length<=1)return i;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var o=t.length,s=i.startIndex,l=1;l<o;l++){var f,v,y,b=t[l-1];b.push((f=n[l-1][2])!==null&&f!==void 0?f:0);var T=n[l-1],M=t[l];M.push((v=n[l][2])!==null&&v!==void 0?v:0);var O=n[l],F=l<t.length-1?[].concat((0,Kt.Z)(t[l+1]),[(y=n[l+1][2])!==null&&y!==void 0?y:0]):null,$=l<n.length-1?n[l+1]:null,G=this.segment_gaode2(i,s,b,M,F,T,O,$);s+=G}if(this.dash)for(var ue=0;ue<i.positions.length/6;ue++)i.positions[ue*6+5]=this.totalDistance;return i.startIndex=i.positions.length/6,i}},{key:"extrude",value:function(t){var n=this.complex;if(t.length<=1)return n;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var i=t.length,o=n.startIndex,s=1;s<i;s++){var l=t[s-1],f=t[s],v=s<t.length-1?t[s+1]:null,y=this.segment(n,o,l,f,v);o+=y}if(this.dash)for(var b=0;b<n.positions.length/6;b++)n.positions[b*6+5]=this.totalDistance;return n.startIndex=n.positions.length/6,n}},{key:"simpleSegment",value:function(t,n,i,o,s){var l=0,f=t.indices,v=t.positions,y=t.normals,b=Fo([o[0],o[1]]),T=Fo([i[0],i[1]]);cv(Gs,b,T);var M=0;if(this.dash&&(M=this.lineSegmentDistance(b,T),this.totalDistance+=M),this.normal||(this.normal=Or.Ue(),Op(this.normal,Gs)),this.started||(this.started=!0,this.extrusions(v,y,i,this.normal,this.thickness,this.totalDistance-M)),f.push(n+0,n+1,n+2),!s)Op(this.normal,Gs),this.extrusions(v,y,o,this.normal,this.thickness,this.totalDistance),f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),l+=2;else{var O=Fo([s[0],s[1]]);j0(b,O)&&Or.IH(O,b,Or.Fv(O,Or.$X(O,b,T))),cv(Pp,O,b);var F=V0(lv,Or.Ue(),Gs,Pp,this.thickness),$=(0,Sn.Z)(F,2),G=$[0],ue=$[1],xe=Or.AK(lv,this.normal)<0?-1:1;this.extrusions(v,y,o,ue,G,this.totalDistance),f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),xe=-1,Or.JG(this.normal,ue),l+=2,this.lastFlip=xe}return l}},{key:"segment_gaode2",value:function(t,n,i,o,s,l,f,v){var y=0,b=t.indices,T=t.positions,M=t.normals,O=this.cap==="square",F=this.join==="bevel",$=Fo([f[0],f[1]]),G=Fo([l[0],l[1]]);cv(Gs,o,i);var ue=0;if(this.dash&&(ue=this.lineSegmentDistance($,G),this.totalDistance+=ue),this.normal||(this.normal=Or.Ue(),Op(this.normal,Gs)),!this.started)if(this.started=!0,O){var xe=Or.Ue(),ze=Or.Ue();Or.IH(xe,this.normal,Gs),Or.IH(ze,this.normal,Gs),M.push(ze[0],ze[1],0),M.push(xe[0],xe[1],0),T.push(i[0],i[1],i[2]|0,this.totalDistance-ue,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),T.push(i[0],i[1],i[2]|0,this.totalDistance-ue,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(T,M,i,this.normal,this.thickness,this.totalDistance-ue);if(b.push(n+0,n+1,n+2),s){j0(o,s)&&Or.IH(s,o,Or.Fv(s,Or.$X(s,o,i))),cv(Pp,s,o);var gt=V0(lv,Or.Ue(),Gs,Pp,this.thickness),Ot=(0,Sn.Z)(gt,2),tr=Ot[0],Ir=Ot[1],Er=Or.AK(lv,this.normal)<0?-1:1,mn=F;if(!mn&&this.join==="miter"){var Ln=tr;Ln>this.miterLimit&&(mn=!0)}mn?(M.push(this.normal[0],this.normal[1],0),M.push(Ir[0],Ir[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,b.push.apply(b,(0,Kt.Z)(this.lastFlip!==-Er?[n,n+2,n+3]:[n+2,n+1,n+3])),b.push(n+2,n+3,n+4),Op(xg,Pp),Or.JG(this.normal,xg),M.push(this.normal[0],this.normal[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*Er,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,y+=3):(this.extrusions(T,M,o,Ir,tr,this.totalDistance),b.push.apply(b,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),Er=-1,Or.JG(this.normal,Ir),y+=2),this.lastFlip=Er}else{if(Op(this.normal,Gs),O){var Je=Or.Ue(),ht=Or.Ue();Or.lu(ht,Gs,this.normal),Or.IH(Je,Gs,this.normal),M.push(ht[0],ht[1],0),M.push(Je[0],Je[1],0),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),T.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(T,M,o,this.normal,this.thickness,this.totalDistance);b.push.apply(b,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),y+=2}return y}},{key:"segment",value:function(t,n,i,o,s){var l=0,f=t.indices,v=t.positions,y=t.normals,b=this.cap==="square",T=this.join==="bevel",M=Fo([o[0],o[1]]),O=Fo([i[0],i[1]]);cv(Gs,M,O);var F=0;if(this.dash&&(F=this.lineSegmentDistance(M,O),this.totalDistance+=F),this.normal||(this.normal=Or.Ue(),Op(this.normal,Gs)),!this.started)if(this.started=!0,b){var $=Or.Ue(),G=Or.Ue();Or.IH($,this.normal,Gs),Or.IH(G,this.normal,Gs),y.push(G[0],G[1],0),y.push($[0],$[1],0),v.push(i[0],i[1],i[2]|0,this.totalDistance-F,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),v.push(i[0],i[1],i[2]|0,this.totalDistance-F,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(v,y,i,this.normal,this.thickness,this.totalDistance-F);if(f.push(n+0,n+1,n+2),s){var ze=Fo([s[0],s[1]]);j0(M,ze)&&Or.IH(ze,M,Or.Fv(ze,Or.$X(ze,M,O))),cv(Pp,ze,M);var Je=V0(lv,Or.Ue(),Gs,Pp,this.thickness),ht=(0,Sn.Z)(Je,2),gt=ht[0],Ot=ht[1],tr=Or.AK(lv,this.normal)<0?-1:1,Ir=T;if(!Ir&&this.join==="miter"){var Er=gt;Er>this.miterLimit&&(Ir=!0)}Ir?(y.push(this.normal[0],this.normal[1],0),y.push(Ot[0],Ot[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,f.push.apply(f,(0,Kt.Z)(this.lastFlip!==-tr?[n,n+2,n+3]:[n+2,n+1,n+3])),f.push(n+2,n+3,n+4),Op(xg,Pp),Or.JG(this.normal,xg),y.push(this.normal[0],this.normal[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,-this.thickness*tr,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,l+=3):(this.extrusions(v,y,o,Ot,gt,this.totalDistance),f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),tr=-1,Or.JG(this.normal,Ot),l+=2),this.lastFlip=tr}else{if(Op(this.normal,Gs),b){var ue=Or.Ue(),xe=Or.Ue();Or.lu(xe,Gs,this.normal),Or.IH(ue,Gs,this.normal),y.push(xe[0],xe[1],0),y.push(ue[0],ue[1],0),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),v.push(o[0],o[1],o[2]|0,this.totalDistance,this.thickness,o[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(v,y,o,this.normal,this.thickness,this.totalDistance);f.push.apply(f,(0,Kt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),l+=2}return l}},{key:"extrusions",value:function(t,n,i,o,s,l){n.push(o[0],o[1],0),n.push(o[0],o[1],0),t.push(i[0],i[1],i[2]|0,l,-s,i[2]|0),this.complex.indexes.push(this.currentIndex),t.push(i[0],i[1],i[2]|0,l,s,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}},{key:"lineSegmentDistance",value:function(t,n){var i=n[0]-t[0],o=n[1]-t[1];return Math.sqrt(i*i+o*o)}}]),e}(),La=L(68072);function Dw(e){var r=e[0][0],t=e[0][e[0].length-1];r[0]===t[0]&&r[1]===t[1]&&(e[0]=e[0].slice(0,e[0].length-1));for(var n=e[0].length,i=fs().flatten(e),o=i.vertices,s=i.dimensions,l=[],f=[],v=0;v<o.length/s;v++)s===2?l.push(o[v*2],o[v*2+1],1):l.push(o[v*3],o[v*3+1],1);var y=fs()(i.vertices,i.holes,i.dimensions);f.push.apply(f,(0,Kt.Z)(y));for(var b=function(){var O=i.vertices.slice(T*s,(T+1)*s),F=i.vertices.slice((T+1)*s,(T+2)*s);F.length===0&&(F=i.vertices.slice(0,s));var $=l.length/3;l.push(O[0],O[1],1,F[0],F[1],1,O[0],O[1],0,F[0],F[1],0),f.push.apply(f,(0,Kt.Z)([0,2,1,2,3,1].map(function(G){return G+$})))},T=0;T<n;T++)b();return{positions:l,index:f}}function Fw(e){var r=fs().flatten(e),t=fs()(r.vertices,r.holes,r.dimensions);return{positions:r.vertices,index:t}}function y1(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=e[0][0],n=e[0][e[0].length-1];t[0]===n[0]&&t[1]===n[1]&&(e[0]=e[0].slice(0,e[0].length-1));for(var i=e[0].length,o=fs().flatten(e),s=o.vertices,l=o.dimensions,f=[],v=[],y=[],b=0;b<s.length/l;b++)f.push(s[b*l],s[b*l+1],1,-1,-1),y.push(0,0,1);var T=fs()(o.vertices,o.holes,o.dimensions);v.push.apply(v,(0,Kt.Z)(T));for(var M=function(){var $=o.vertices.slice(O*l,(O+1)*l),G=o.vertices.slice((O+1)*l,(O+2)*l);G.length===0&&(G=o.vertices.slice(0,l));var ue=f.length/5;f.push($[0],$[1],1,0,0,G[0],G[1],1,.1,0,$[0],$[1],0,0,.8,G[0],G[1],0,.1,.8);var xe=kw([G[0],G[1],1],[$[0],$[1],0],[$[0],$[1],1],r);y.push.apply(y,(0,Kt.Z)(xe).concat((0,Kt.Z)(xe),(0,Kt.Z)(xe),(0,Kt.Z)(xe))),v.push.apply(v,(0,Kt.Z)([1,2,0,3,2,1].map(function(ze){return ze+ue})))},O=0;O<i;O++)M();return{positions:f,index:v,normals:y}}function kw(e,r,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=La.create(),o=La.create(),s=La.create();n&&(e=Bu(e),r=Bu(r),t=Bu(t));var l=La.fromValues.apply(La,(0,Kt.Z)(e)),f=La.fromValues.apply(La,(0,Kt.Z)(r)),v=La.fromValues.apply(La,(0,Kt.Z)(t));La.sub(i,v,f),La.sub(o,l,f),La.cross(s,i,o);var y=La.create();return La.normalize(y,s),y}var Yc,cm=function(e){return e.CYLINDER="cylinder",e.SQUARECOLUMN="squareColumn",e.TRIANGLECOLUMN="triangleColumn",e.HEXAGONCOLUMN="hexagonColumn",e.PENTAGONCOLUMN="pentagonColumn",e}({}),fm=function(e){return e.CIRCLE="circle",e.SQUARE="square",e.TRIANGLE="triangle",e.HEXAGON="hexagon",e.PENTAGON="pentagon",e}({});function hm(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=Math.PI*2/e,n=[],i=0;i<e;i++)n.push(t*i+r*Math.PI/12);var o=n.map(function(s){var l=Math.sin(s+Math.PI/4),f=Math.cos(s+Math.PI/4);return[l,f,0]});return o}function H0(){return hm(30)}function x1(){return hm(4)}function b1(){return hm(3)}function E1(){return hm(6,1)}function S1(){return hm(5)}var fv=(Yc={},(0,B.Z)(Yc,fm.CIRCLE,H0),(0,B.Z)(Yc,fm.HEXAGON,E1),(0,B.Z)(Yc,fm.TRIANGLE,b1),(0,B.Z)(Yc,fm.SQUARE,x1),(0,B.Z)(Yc,fm.PENTAGON,S1),(0,B.Z)(Yc,cm.CYLINDER,H0),(0,B.Z)(Yc,cm.HEXAGONCOLUMN,E1),(0,B.Z)(Yc,cm.TRIANGLECOLUMN,b1),(0,B.Z)(Yc,cm.SQUARECOLUMN,x1),(0,B.Z)(Yc,cm.PENTAGONCOLUMN,S1),Yc),bg={};function Eg(e){var r=Fs(e.coordinates);return{vertices:[].concat((0,Kt.Z)(r),(0,Kt.Z)(r),(0,Kt.Z)(r),(0,Kt.Z)(r)),indices:[0,1,2,2,3,0],size:r.length}}function A1(e){var r=Fs(e.coordinates),t=_1(r);return{vertices:[].concat((0,Kt.Z)(t),(0,Kt.Z)(t),(0,Kt.Z)(t),(0,Kt.Z)(t)),indices:[0,1,2,2,3,0],size:t.length}}function W0(e){var r=e.shape,t=Vw(r,!1),n=t.positions,i=t.index,o=t.normals;return{vertices:n,indices:i,normals:o,size:5}}function Bw(e){var r=Fs(e.coordinates);return{vertices:(0,Kt.Z)(r),indices:[0],size:r.length}}function G0(e){var r=e.coordinates,t=e.originCoordinates,n=e.version,i=new Ow({dash:!0,join:"bevel"});if(n==="GAODE2.x"){var o=r;Array.isArray(o[0][0])||(o=[r]);var s=t;Array.isArray(s[0][0])||(s=[t]);for(var l=0;l<o.length;l++){var f=o[l],v=s[l];i.extrude_gaode2(f,v)}}else{var y=r;y[0]&&!Array.isArray(y[0][0])&&(y=[r]),y.forEach(function(T){i.extrude(T)})}var b=i.complex;return{vertices:b.positions,indices:b.indices,normals:b.normals,indexes:b.indexes,size:6}}function _L(e){var r=e.coordinates.flat(),t=1,n=1;return{vertices:[1,0,0].concat(_toConsumableArray(r),[1,2,-3],_toConsumableArray(r),[1,1,-3],_toConsumableArray(r),[0,1,0],_toConsumableArray(r),[0,0,0],_toConsumableArray(r),[1,0,0],_toConsumableArray(r),[1,2,-3],_toConsumableArray(r),[1,1,-3],_toConsumableArray(r),[0,1,0],_toConsumableArray(r),[0,0,0],_toConsumableArray(r)),normals:[-t,2*n,1,2*n,-n,1,n,-n,1,n,-n,1,-t,-n,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],indices:[0,1,2,0,2,3,0,3,4,5,6,7,5,7,8,5,8,9],size:7}}function Lw(e){var r=e.coordinates,t=[];if(!Array.isArray(r[0]))return{vertices:[],indices:[],normals:[],size:6,count:0};var n=Nw(r),i=n.results,o=n.totalDistance;return i.map(function(s){t.push(s[0],s[1],s[2],s[3],0,o)}),{vertices:t,indices:[],normals:[],size:6,count:i.length}}function yL(e){var r=e.coordinates,t=[];if(!Array.isArray(r[0]))return{vertices:[],indices:[],size:4,count:0};var n=Uw(r),i=n.results;return i.map(function(o){t.push(o[0],o[1],o[2],o[3])}),{vertices:t,indices:[],size:4,count:i.length}}function T1(e,r){var t=r[0]-e[0],n=r[1]-e[1];return Math.sqrt(t*t+n*n)}function hv(e,r){return e.length<3&&e.push(0),r!==void 0&&e.push(r),e}function Nw(e){var r=e;Array.isArray(r)&&Array.isArray(r[0])&&Array.isArray(r[0][0])&&(r=e.flat());var t=0;if(r.length<2)return{results:r,totalDistance:0};var n=[],i=hv(r[0],t);n.push(i);for(var o=1;o<r.length-1;o++){var s=T1(r[o-1],r[o]);t+=s;var l=hv(r[o],t);n.push(l),n.push(l)}var f=T1(r[r.length-2],r[r.length-1]);return t+=f,n.push(hv(r[r.length-1],t)),{results:n,totalDistance:t}}function Uw(e){if(e.length<2)return{results:e};var r=[],t=hv(e[0]);r.push(t);for(var n=1;n<e.length-1;n++){var i=hv(e[n]);r.push(i),r.push(i)}return r.push(hv(e[e.length-1])),{results:r}}function X0(e){var r=e.coordinates,t=fs().flatten(r),n=t.vertices,i=t.dimensions,o=t.holes;return{indices:fs()(n,o,i),vertices:n,size:i}}function zw(e){var r=e.coordinates,t=fs().flatten(r),n=t.vertices,i=t.dimensions,o=t.holes;return{indices:fs()(n,o,i),vertices:Zw(n),size:i+4}}function Zw(e){for(var r=[],t=sf(e),n=t.center,i=t.radius,o=0;o<e.length;o+=2){var s=e[o],l=e[o+1];r.push.apply(r,[s,l,0].concat((0,Kt.Z)(n),[i]))}return r}function $0(e){var r=e.coordinates,t=y1(r,!0),n=t.positions,i=t.index,o=t.normals;return{vertices:n,indices:i,normals:o,size:5}}function w1(e){var r=e.shape,t=Hw(r),n=t.positions,i=t.index;return{vertices:n,indices:i,size:3}}function Sg(e){var r=e.coordinates,t=[].concat((0,Kt.Z)(r[0]),[0,0,1,r[1][0],r[0][1],0,1,1],(0,Kt.Z)(r[1]),[0,1,0],(0,Kt.Z)(r[0]),[0,0,1],(0,Kt.Z)(r[1]),[0,1,0,r[0][0],r[1][1],0,0,0]),n=[0,1,2,3,4,5];return{vertices:t,indices:n,size:5}}function Ag(e,r){for(var t=r.segmentNumber,n=t===void 0?30:t,i=e.coordinates,o=[],s=[],l=function(y){o.push(y,1,y,i[0][0],i[0][1],i[1][0],i[1][1],y,-1,y,i[0][0],i[0][1],i[1][0],i[1][1]),y!==n-1&&s.push.apply(s,(0,Kt.Z)([0,1,2,1,3,2].map(function(b){return y*2+b})))},f=0;f<n;f++)l(f);return{vertices:o,indices:s,size:7}}function C1(e){var r=e.coordinates;r.length===2&&r.push(0);var t=Tg(-1,1),n=Tg(1,1),i=Tg(-1,-1),o=Tg(1,-1),s=[].concat((0,Kt.Z)(r),(0,Kt.Z)(t),(0,Kt.Z)(r),(0,Kt.Z)(i),(0,Kt.Z)(r),(0,Kt.Z)(o),(0,Kt.Z)(r),(0,Kt.Z)(n)),l=[0,1,2,3,0,2];return{vertices:s,indices:l,size:5}}function Vw(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(bg&&bg[e])return bg[e];var t=fv[e]?fv[e]():fv.cylinder(),n=y1([t],r);return bg[e]=n,n}function xL(e,r){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=new Float32Array(e.length/t*3),o,s,l,f=vec3.create(),v=vec3.create(),y=vec3.create(),b=0,T=r.length;b<T;b+=3){o=r[b+0]*3,s=r[b+1]*3,l=r[b+2]*3;var M=[e[o],e[o+1]],O=[e[s],e[s+1]],F=[e[l],e[l+1]];n&&(M=lngLatToMeters(M),O=lngLatToMeters(O),F=lngLatToMeters(F));var $=M,G=_slicedToArray($,2),ue=G[0],xe=G[1],ze=vec3.fromValues(ue,xe,e[o+2]),Je=O,ht=_slicedToArray(Je,2),gt=ht[0],Ot=ht[1],tr=vec3.fromValues(gt,Ot,e[s+2]),Ir=F,Er=_slicedToArray(Ir,2),mn=Er[0],Ln=Er[1],Fi=vec3.fromValues(mn,Ln,e[l+2]);vec3.sub(f,Fi,tr),vec3.sub(v,ze,tr),vec3.cross(y,f,v),i[o]+=f[0],i[o+1]+=f[1],i[o+2]+=f[2],i[s]+=f[0],i[s+1]+=f[1],i[s+2]+=f[2],i[l]+=f[0],i[l+1]+=f[1],i[l+2]+=f[2]}return jw(i),i}function jw(e){for(var r=0,t=e.length;r<t;r+=3){var n=vec3.fromValues(e[r],e[r+1],e[r+2]),i=vec3.create();vec3.normalize(i,n),e.set(i,r)}}function bL(e){var r=e[0][0],t=e[0][e[0].length-1];return r[0]===t[0]&&r[1]===t[1]}function Hw(e){var r=["cylinder","triangleColumn","hexagonColumn","squareColumn"],t=fv[e]?fv[e]():fv.circle(),n=r.indexOf(e)===-1?Fw([t]):Dw([t]);return n}function Tg(e,r){var t=(e+1)/2,n=(r+1)/2;return[t,n]}function EL(){var e=primitiveSphere(EARTH_RADIUS,{segments:EARTH_SEGMENTS}),r=e.positionsArr,t=e.indicesArr,n=e.normalArr;return{vertices:r,indices:t,size:5,normals:n}}function SL(){var e=primitiveSphere(EARTH_RADIUS+EARTH_RADIUS_OUTER,{segments:EARTH_SEGMENTS}),r=e.positionsArr,t=e.indicesArr,n=e.normalArr;return{vertices:r,indices:t,size:5,normals:n}}function Ww(e){var r=Gw();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function Gw(){if(typeof Reflect=="undefined"||!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(e){return!1}}var Xw=`uniform float u_opacity: 1.0;
|
|
uniform vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];
|
|
uniform vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];
|
|
uniform vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];
|
|
uniform float u_near : 0;
|
|
uniform float u_far : 1;
|
|
varying vec4 v_Color;
|
|
varying vec2 v_texCoord;
|
|
uniform float u_Zoom : 1;
|
|
uniform float u_time;
|
|
|
|
uniform float u_circleSweep;
|
|
uniform float u_cityMinSize;
|
|
uniform vec3 u_circleSweepColor;
|
|
uniform float u_circleSweepSpeed;
|
|
|
|
varying float v_worldDis;
|
|
|
|
#pragma include "picking"
|
|
|
|
vec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) {
|
|
float s = step(hot, n);
|
|
vec3 color = mix(brightColor,vec3(0.9,0.9,1.0),n);
|
|
|
|
return mix(darkColor, color, s);
|
|
}
|
|
float random (vec2 st) {
|
|
return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);
|
|
}
|
|
|
|
float LinearizeDepth()
|
|
{
|
|
float z = gl_FragCoord.z * 2.0 - 1.0;
|
|
return (2.0 * u_near * u_far) / (u_far + u_near - z * (u_far - u_near));
|
|
}
|
|
|
|
vec3 fog(vec3 color, vec3 fogColor, float depth){
|
|
float fogFactor=clamp(depth,0.0,1.0);
|
|
vec3 output_color=mix(fogColor,color,fogFactor);
|
|
return output_color;
|
|
}
|
|
|
|
float sdRect(vec2 p, vec2 sz) {
|
|
vec2 d = abs(p) - sz;
|
|
float outside = length(max(d, 0.));
|
|
float inside = min(max(d.x, d.y), 0.);
|
|
return outside + inside;
|
|
}
|
|
|
|
void main() {
|
|
gl_FragColor = v_Color;
|
|
vec3 baseColor = u_baseColor.xyz;
|
|
vec3 brightColor = u_brightColor.xyz;
|
|
vec3 windowColor = u_windowColor.xyz;
|
|
float targetColId = 5.;
|
|
float depth = 1.0 - LinearizeDepth() / u_far * u_Zoom;
|
|
vec3 fogColor = vec3(23.0/255.0,31.0/255.0,51.0/255.0);
|
|
if(v_texCoord.x < 0.) { //\u9876\u90E8\u989C\u8272
|
|
vec3 foggedColor = fog(baseColor.xyz + vec3(0.12*0.9,0.2*0.9,0.3*0.9),fogColor,depth);
|
|
gl_FragColor = vec4( foggedColor, v_Color.w);
|
|
}else { // \u4FA7\u9762\u989C\u8272
|
|
vec2 st = v_texCoord;
|
|
vec2 UvScale = v_texCoord;
|
|
float tStep = min(0.08,max(0.05* (18.0-u_Zoom),0.02));
|
|
float tStart = 0.25 * tStep;
|
|
float tEnd = 0.75 * tStep;
|
|
float u = mod(UvScale.x, tStep);
|
|
float v = mod(UvScale.y, tStep);
|
|
float ux = floor(UvScale.x/tStep);
|
|
float uy = floor(UvScale.y/tStep);
|
|
float n = random(vec2(ux,uy));
|
|
float lightP = u_time;
|
|
float head = 1.0- step(0.005,st.y);
|
|
/*step3*/
|
|
// \u5C06\u7A97\u6237\u989C\u8272\u548C\u5899\u9762\u989C\u8272\u533A\u522B\u5F00\u6765
|
|
float sU = step(tStart, u) - step(tEnd, u);
|
|
float sV = step(tStart, v) - step(tEnd, v);
|
|
vec2 windowSize = vec2(abs(tEnd-tStart),abs(tEnd-tStart));
|
|
float dist = sdRect(vec2(u,v), windowSize);
|
|
float s = sU * sV;
|
|
|
|
float curColId = floor(UvScale.x / tStep);
|
|
float sCol = step(targetColId - 0.2, curColId) - step(targetColId + 0.2, curColId);
|
|
|
|
float mLightP = mod(lightP, 2.);
|
|
float sRow = step(mLightP - 0.2, st.y) - step(mLightP, st.y);
|
|
if(ux == targetColId){
|
|
n =0.;
|
|
}
|
|
float timeP = min(0.75, abs ( sin(u_time/3.0) ) );
|
|
float hot = smoothstep(1.0,0.0,timeP);
|
|
vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), s);
|
|
//vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), 1.0);
|
|
float sFinal = s * sCol * sRow;
|
|
color += mix(baseColor, brightColor, sFinal*n);
|
|
if (st.y<0.01){
|
|
color = baseColor;
|
|
}
|
|
if(head ==1.0) { // \u9876\u90E8\u4EAE\u7EBF
|
|
color = brightColor;
|
|
}
|
|
color = color * v_Color.rgb;
|
|
|
|
vec3 foggedColor = fog(color,fogColor,depth);
|
|
|
|
gl_FragColor = vec4(foggedColor,1.0);
|
|
}
|
|
|
|
|
|
if(u_circleSweep > 0.0 && v_worldDis < u_cityMinSize) {
|
|
float r = fract(((v_worldDis/u_cityMinSize) - u_time * u_circleSweepSpeed) * 2.0);
|
|
gl_FragColor.rgb += r * r * u_circleSweepColor;
|
|
}
|
|
|
|
gl_FragColor.a *= u_opacity;
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,$w=`precision highp float;
|
|
|
|
#define ambientRatio 0.5
|
|
#define diffuseRatio 0.3
|
|
#define specularRatio 0.2
|
|
|
|
attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec3 a_Normal;
|
|
attribute float a_Size;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
attribute vec2 a_Uv;
|
|
varying vec2 v_texCoord;
|
|
|
|
varying vec4 v_Color;
|
|
|
|
uniform float u_circleSweep;
|
|
uniform vec2 u_cityCenter;
|
|
|
|
varying float v_worldDis;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
|
|
void main() {
|
|
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);
|
|
vec4 project_pos = project_position(pos);
|
|
|
|
v_texCoord = a_Uv;
|
|
|
|
if(u_circleSweep > 0.0) {
|
|
vec2 lnglatscale = vec2(0.0);
|
|
if(u_CoordinateSystem != COORDINATE_SYSTEM_P20_2) {
|
|
lnglatscale = (a_Position.xy - u_cityCenter) * vec2(0.0, 0.135);
|
|
}
|
|
v_worldDis = length(a_Position.xy + lnglatscale - u_cityCenter);
|
|
}
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
|
|
} else {
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
}
|
|
|
|
float lightWeight = calc_lighting(pos);
|
|
// v_Color = a_Color;
|
|
v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,Yw=function(e){(0,Le.Z)(t,e);var r=Ww(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.baseColor,f=l===void 0?"rgb(16,16,16)":l,v=i.brightColor,y=v===void 0?"rgb(255,176,38)":v,b=i.windowColor,T=b===void 0?"rgb(30,60,89)":b,M=i.time,O=M===void 0?0:M,F=i.sweep,$=F===void 0?{enable:!1,sweepRadius:1,sweepColor:"rgb(255, 255, 255)",sweepSpeed:.4,sweepCenter:this.cityCenter}:F;return{u_cityCenter:$.sweepCenter||this.cityCenter,u_cityMinSize:this.cityMinSize*$.sweepRadius,u_circleSweep:$.enable?1:0,u_circleSweepColor:fi($.sweepColor).slice(0,3),u_circleSweepSpeed:$.sweepSpeed,u_opacity:s,u_baseColor:fi(f),u_brightColor:fi(y),u_windowColor:fi(T),u_time:this.layer.getLayerAnimateTime()||O}}},{key:"calCityGeo",value:function(){var i=(0,Sn.Z)(this.layer.getSource().extent,4),o=i[0],s=i[1],l=i[2],f=i[3];if(this.mapService.version==="GAODE2.x"){this.cityCenter=this.mapService.lngLatToCoord([(l+o)/2,(f+s)/2]);var v=this.mapService.lngLatToCoord([l,f]),y=this.mapService.lngLatToCoord([o,s]);this.cityMinSize=Math.sqrt(Math.pow(v[0]-y[0],2)+Math.pow(v[1]-y[1],2))/4}else{var b=l-o,T=f-s;this.cityCenter=[(l+o)/2,(f+s)/2],this.cityMinSize=Math.sqrt(Math.pow(b,2)+Math.pow(T,2))/4}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.calCityGeo(),this.startModelAnimate(),l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"cityBuilding",vertexShader:$w,fragmentShader:Xw,triangulation:$0,depth:{enable:!0},cull:{enable:!0,face:R.BACK}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f,v){return v}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?10:s;return Array.isArray(l)?[l[0]]:[l]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_Uv",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}})}}]),t}(Ma);function qw(e){var r=Kw();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function Kw(){if(typeof Reflect=="undefined"||!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(e){return!1}}var Qw=function(e){(0,Le.Z)(t,e);var r=qw(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"type","CityBuildingLayer"),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.layerModel=new Yw(this),l.next=3,this.initLayerModels();case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"setLight",value:function(i){this.updateLayerConfig({time:i})}},{key:"getModelType",value:function(){return"citybuilding"}}]),t}(Ip);function Jw(e){var r=eC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function eC(){if(typeof Reflect=="undefined"||!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(e){return!1}}var tC=`precision highp float;\r
|
|
// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\r
|
|
attribute vec3 a_Position;\r
|
|
// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\r
|
|
attribute vec3 a_Pos;\r
|
|
attribute float a_Size;\r
|
|
attribute vec4 a_Color;\r
|
|
uniform vec2 u_radius;\r
|
|
uniform float u_coverage: 0.9;\r
|
|
uniform float u_angle: 0;\r
|
|
uniform mat4 u_ModelMatrix;\r
|
|
\r
|
|
varying vec4 v_color;\r
|
|
\r
|
|
uniform vec2 u_sceneCenterMercator;\r
|
|
\r
|
|
#pragma include "projection"\r
|
|
#pragma include "project"\r
|
|
#pragma include "picking"\r
|
|
\r
|
|
void main() {\r
|
|
v_color = a_Color;\r
|
|
\r
|
|
mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\r
|
|
vec2 offset = a_Position.xy * u_radius * rotationMatrix * u_coverage ;\r
|
|
// vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r
|
|
// vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r
|
|
// gl_Position = project_common_position_to_clipspace(project_pos);\r
|
|
\r
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\r
|
|
vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r
|
|
vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807\r
|
|
vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\r
|
|
gl_Position = u_Mvp * (project_pos);\r
|
|
} else {\r
|
|
vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r
|
|
vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r
|
|
gl_Position = project_common_position_to_clipspace(project_pos);\r
|
|
}\r
|
|
\r
|
|
setPickingColor(a_PickingColor);\r
|
|
}\r
|
|
`,rC=`precision highp float;
|
|
varying vec4 v_color;
|
|
uniform float u_opacity: 1;
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
gl_FragColor = v_color;
|
|
gl_FragColor.a *= u_opacity;
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,nC=function(e){(0,Le.Z)(t,e);var r=Jw(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=i.coverage,l=i.angle;return{u_opacity:o||1,u_coverage:s||.9,u_angle:l||0,u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset]}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"heatmapGrid",vertexShader:tC,fragmentShader:rC,triangulation:w1,primitive:R.TRIANGLES,depth:{enable:!1}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:dn.Attribute,descriptor:{name:"a_Pos",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=o.version==="GAODE2.x"?o.originCoordinates:o.coordinates;return[s[0],s[1],0]}}})}}]),t}(Ma);function iC(e){var r=aC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function aC(){if(typeof Reflect=="undefined"||!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(e){return!1}}var oC=`precision highp float;
|
|
// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807
|
|
attribute vec3 a_Position;
|
|
// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807
|
|
attribute vec3 a_Pos;
|
|
|
|
attribute vec3 a_Normal;
|
|
attribute float a_Size;
|
|
attribute vec4 a_Color;
|
|
uniform vec2 u_radius;
|
|
uniform float u_coverage: 0.9;
|
|
uniform float u_angle: 0;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
varying vec4 v_color;
|
|
|
|
uniform vec2 u_sceneCenterMercator;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
|
|
void main() {
|
|
mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));
|
|
vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));
|
|
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
|
|
vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u7ECF\u7EAC\u5EA6
|
|
vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807
|
|
vec4 project_pos = project_position(vec4(customLnglat, a_Position.z * a_Size, 1.0));
|
|
|
|
float lightWeight = calc_lighting(project_pos);
|
|
v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);
|
|
|
|
gl_Position = u_Mvp * vec4(customLnglat , a_Position.z * a_Size, 1.0);
|
|
} else {
|
|
vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u5B9E\u9645\u7684\u7ECF\u7EAC\u5EA6
|
|
vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));
|
|
|
|
float lightWeight = calc_lighting(project_pos);
|
|
v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);
|
|
|
|
gl_Position = project_common_position_to_clipspace(project_pos);
|
|
}
|
|
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,sC=`precision highp float;
|
|
varying vec4 v_color;
|
|
uniform float u_opacity: 1;
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
gl_FragColor = v_color;
|
|
gl_FragColor.a *= u_opacity;
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,uC=function(e){(0,Le.Z)(t,e);var r=iC(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=i.coverage,l=i.angle;return{u_opacity:o||1,u_coverage:s||1,u_angle:l||0,u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset]}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"heatmapGrid3d",vertexShader:oC,fragmentShader:sC,triangulation:W0,primitive:R.TRIANGLES,depth:{enable:!0}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size;return Array.isArray(s)?[s[0]]:[s]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f,v){return v}}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:dn.Attribute,descriptor:{name:"a_Pos",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=o.version==="GAODE2.x"?o.originCoordinates:o.coordinates;return[s[0],s[1],0]}}})}}]),t}(Ma);function lC(e,r){for(var t=[],n=[],i=[],o=e+1,s=r+1,l=e/2,f=r/2,v=0;v<s;v++)for(var y=v-f,b=0;b<o;b++){var T=b-l;n.push(T/l,-y/f,0),i.push(b/e),i.push(1-v/r)}for(var M=0;M<r;M++)for(var O=0;O<e;O++){var F=O+o*M,$=O+o*(M+1),G=O+1+o*(M+1),ue=O+1+o*M;t.push(F,$,ue),t.push($,G,ue)}return{vertices:n,indices:t,uvs:i}}var R1,M1;function cC(e){var r=fC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function fC(){if(typeof Reflect=="undefined"||!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(e){return!1}}var hC=`uniform sampler2D u_texture;
|
|
uniform sampler2D u_colorTexture;
|
|
uniform float u_opacity;
|
|
varying vec2 v_texCoord;
|
|
varying float v_intensity;
|
|
|
|
void main(){
|
|
|
|
float intensity = texture2D(u_texture, v_texCoord).r;
|
|
vec4 color = texture2D(u_colorTexture,vec2(intensity, 0));
|
|
gl_FragColor = color;
|
|
// gl_FragColor.a = color.a * smoothstep(0.1,0.2,intensity)* u_opacity;
|
|
gl_FragColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;
|
|
}
|
|
`,pC=`precision highp float;
|
|
attribute vec3 a_Position;
|
|
attribute vec2 a_Uv;
|
|
uniform sampler2D u_texture;
|
|
varying vec2 v_texCoord;
|
|
uniform mat4 u_ModelMatrix;
|
|
uniform mat4 u_InverseViewProjectionMatrix;
|
|
uniform mat4 u_ViewProjectionMatrixUncentered;
|
|
varying float v_intensity;
|
|
|
|
|
|
vec2 toBezier(float t, vec2 P0, vec2 P1, vec2 P2, vec2 P3) {
|
|
float t2 = t * t;
|
|
float one_minus_t = 1.0 - t;
|
|
float one_minus_t2 = one_minus_t * one_minus_t;
|
|
return (P0 * one_minus_t2 * one_minus_t + P1 * 3.0 * t * one_minus_t2 + P2 * 3.0 * t2 * one_minus_t + P3 * t2 * t);
|
|
}
|
|
vec2 toBezier(float t, vec4 p){
|
|
return toBezier(t, vec2(0.0, 0.0), vec2(p.x, p.y), vec2(p.z, p.w), vec2(1.0, 1.0));
|
|
}
|
|
#pragma include "projection"
|
|
void main() {
|
|
v_texCoord = a_Uv;
|
|
|
|
vec2 pos = a_Uv * vec2(2.0) - vec2(1.0); // \u5C06\u539F\u672C 0 -> 1 \u7684 uv \u8F6C\u6362\u4E3A -1 -> 1 \u7684\u6807\u51C6\u5750\u6807\u7A7A\u95F4\uFF08NDC\uFF09
|
|
|
|
vec4 p1 = vec4(pos, 0.0, 1.0); // x/y \u5E73\u9762\u4E0A\u7684\u70B9\uFF08z == 0\uFF09\u53EF\u4EE5\u8BA4\u4E3A\u662F\u4E09\u7EF4\u4E0A\u7684\u70B9\u88AB\u6295\u5F71\u5230\u5E73\u9762\u540E\u7684\u70B9
|
|
vec4 p2 = vec4(pos, 1.0, 1.0); // \u5E73\u884C\u4E8Ex/y\u5E73\u9762\u3001z==1 \u7684\u5E73\u9762\u4E0A\u7684\u70B9
|
|
|
|
vec4 inverseP1 = u_InverseViewProjectionMatrix * p1; // \u6839\u636E\u89C6\u56FE\u6295\u5F71\u77E9\u9635\u7684\u9006\u77E9\u9635\u5E73\u9762\u4E0A\u7684\u53CD\u7B97\u51FA\u4E09\u7EF4\u7A7A\u95F4\u4E2D\u7684\u70B9\uFF08p1\u5E73\u9762\u4E0A\u7684\u70B9\uFF09
|
|
vec4 inverseP2 = u_InverseViewProjectionMatrix * p2;
|
|
|
|
inverseP1 = inverseP1 / inverseP1.w; // \u5F52\u4E00\u5316\u64CD\u4F5C\uFF08\u5F52\u4E00\u5316\u540E\u4E3A\u4E16\u754C\u5750\u6807\uFF09
|
|
inverseP2 = inverseP2 / inverseP2.w;
|
|
|
|
float zPos = (0.0 - inverseP1.z) / (inverseP2.z - inverseP1.z); // ??
|
|
vec4 position = inverseP1 + zPos * (inverseP2 - inverseP1);
|
|
|
|
vec4 b= vec4(0.5000, 0.0, 1.0, 0.5000);
|
|
float fh;
|
|
|
|
v_intensity = texture2D(u_texture, v_texCoord).r;
|
|
fh = toBezier(v_intensity, b).y;
|
|
gl_Position = u_ViewProjectionMatrixUncentered * vec4(position.xy, fh * project_pixel(50.), 1.0);
|
|
|
|
}
|
|
`,dC=`uniform sampler2D u_texture; // \u70ED\u529B\u5F3A\u5EA6\u56FE
|
|
uniform sampler2D u_colorTexture; // \u6839\u636E\u5F3A\u5EA6\u5206\u5E03\u7684\u8272\u5E26
|
|
uniform float u_opacity;
|
|
varying vec2 v_texCoord;
|
|
|
|
uniform vec2 u_ViewportSize;
|
|
|
|
float getBlurIndusty() {
|
|
float vW = 2.0/u_ViewportSize.x;
|
|
float vH = 2.0/u_ViewportSize.y;
|
|
vec2 vUv = v_texCoord;
|
|
float i11 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y + 1.0 * vH) ).r;
|
|
float i12 = texture2D( u_texture, vec2( vUv.x - 0.0 * vW, vUv.y + 1.0 * vH) ).r;
|
|
float i13 = texture2D( u_texture, vec2( vUv.x + 1.0 * vW, vUv.y + 1.0 * vH) ).r;
|
|
|
|
float i21 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y) ).r;
|
|
float i22 = texture2D( u_texture, vec2( vUv.x , vUv.y) ).r;
|
|
float i23 = texture2D( u_texture, vec2( vUv.x + 1.0 * vW, vUv.y) ).r;
|
|
|
|
float i31 = texture2D( u_texture, vec2( vUv.x - 1.0 * vW, vUv.y-1.0*vH) ).r;
|
|
float i32 = texture2D( u_texture, vec2( vUv.x - 0.0 * vW, vUv.y-1.0*vH) ).r;
|
|
float i33 = texture2D( u_texture, vec2( vUv.x + 1.0 * vW, vUv.y-1.0*vH) ).r;
|
|
|
|
return(
|
|
i11 +
|
|
i12 +
|
|
i13 +
|
|
i21 +
|
|
i21 +
|
|
i22 +
|
|
i23 +
|
|
i31 +
|
|
i32 +
|
|
i33
|
|
)/9.0;
|
|
}
|
|
|
|
|
|
void main(){
|
|
// float intensity = texture2D(u_texture, v_texCoord).r;
|
|
float intensity = getBlurIndusty();
|
|
vec4 color = texture2D(u_colorTexture, vec2(intensity, 0.0));
|
|
|
|
gl_FragColor =color;
|
|
gl_FragColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;
|
|
|
|
}
|
|
`,vC=`precision highp float;
|
|
attribute vec3 a_Position;
|
|
attribute vec2 a_Uv;
|
|
varying vec2 v_texCoord;
|
|
|
|
void main() {
|
|
v_texCoord = a_Uv;
|
|
|
|
gl_Position = vec4(a_Position.xy, 0, 1.);
|
|
}
|
|
`,mC=`precision highp float;
|
|
uniform float u_intensity;
|
|
varying float v_weight;
|
|
varying vec2 v_extrude;
|
|
#define GAUSS_COEF 0.3989422804014327
|
|
void main(){
|
|
float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);
|
|
float val = v_weight * u_intensity * GAUSS_COEF * exp(d);
|
|
gl_FragColor = vec4(val, 1., 1., 1.);
|
|
}
|
|
`,gC=`precision highp float;
|
|
attribute vec3 a_Position;
|
|
attribute float a_Size;
|
|
attribute vec2 a_Dir;
|
|
uniform float u_intensity;
|
|
uniform float u_radius;
|
|
varying vec2 v_extrude;
|
|
varying float v_weight;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
#define GAUSS_COEF 0.3989422804014327
|
|
|
|
#pragma include "projection"
|
|
|
|
void main(){
|
|
v_weight = a_Size;
|
|
float ZERO = 1.0 / 255.0 / 16.0;
|
|
float extrude_x = a_Dir.x * 2.0 -1.0;
|
|
float extrude_y = a_Dir.y * 2.0 -1.0;
|
|
vec2 extrude_dir = normalize(vec2(extrude_x,extrude_y));
|
|
float S = sqrt(-2.0 * log(ZERO / a_Size / u_intensity / GAUSS_COEF)) / 2.5;
|
|
v_extrude = extrude_dir * S;
|
|
|
|
vec2 offset = project_pixel(v_extrude * u_radius);
|
|
vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));
|
|
|
|
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * (vec4(project_pos.xy + offset, 0.0, 1.0));
|
|
} else {
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));
|
|
}
|
|
}
|
|
`,_C=oi.isEqual,I1=(R1=(0,yt.b2)(),R1(M1=function(e){(0,Le.Z)(t,e);var r=cC(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"render",value:function(i){var o=this,s=this.rendererService,l=s.clear,f=s.useFramebuffer,v=this.layer.getLayerConfig(),y=v.rampColors;f(this.heatmapFramerBuffer,function(){l({color:[0,0,0,0],depth:1,stencil:0,framebuffer:o.heatmapFramerBuffer}),o.drawIntensityMode()}),_C(this.preRampColors,y)||this.updateColorTexture(),this.shapeType==="heatmap"?this.drawColorMode(i):this.draw3DHeatMap(i)}},{key:"getUninforms",value:function(){throw new Error("Method not implemented.")}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M,O,F;return ge().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return l=this.rendererService,f=l.createFramebuffer,v=l.getViewportSize,y=l.createTexture2D,b=this.styleAttributeService.getLayerStyleAttribute("shape"),T=(b==null||(s=b.scale)===null||s===void 0?void 0:s.field)||"heatmap",this.shapeType=T,G.next=6,this.buildHeatMapIntensity();case 6:return this.intensityModel=G.sent,this.colorModel=T==="heatmap"?this.buildHeatmapColor():this.build3dHeatMap(),M=v(),O=M.width,F=M.height,this.heatmapFramerBuffer=f({color:y({width:Math.floor(O/4),height:Math.floor(F/4),wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE,min:R.LINEAR,mag:R.LINEAR}),depth:!1}),this.updateColorTexture(),G.abrupt("return",[this.intensityModel,this.colorModel]);case 12:case"end":return G.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"dir",type:dn.Attribute,descriptor:{name:"a_Dir",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?1:s;return[l]}}})}},{key:"buildHeatMapIntensity",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.layer.triangulation=C1,f.next=3,this.layer.buildLayerModel({moduleName:"heatmapIntensity",vertexShader:gC,fragmentShader:mC,triangulation:C1,depth:{enable:!1},cull:{enable:!0,face:ea(this.mapService.version)}});case 3:return s=f.sent,f.abrupt("return",s);case 5:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildHeatmapColor",value:function(){this.shaderModuleService.registerModule("heatmapColor",{vs:vC,fs:dC});var i=this.shaderModuleService.getModule("heatmapColor"),o=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService,v=f.createAttribute,y=f.createElements,b=f.createBuffer,T=f.createModel;return T({vs:o,fs:s,attributes:{a_Position:v({buffer:b({data:[-1,1,0,1,1,0,-1,-1,0,1,-1,0],type:R.FLOAT}),size:3}),a_Uv:v({buffer:b({data:[0,1,1,1,0,0,1,0],type:R.FLOAT}),size:2})},uniforms:(0,V.Z)({},l),depth:{enable:!1},elements:y({data:[0,2,1,2,3,1],type:R.UNSIGNED_INT,count:6})})}},{key:"drawIntensityMode",value:function(){var i,o=this.layer.getLayerConfig(),s=o.opacity,l=o.intensity,f=l===void 0?10:l,v=o.radius,y=v===void 0?5:v;this.layerService.beforeRenderData(this.layer),this.layer.hooks.beforeRender.call(),(i=this.intensityModel)===null||i===void 0||i.draw({uniforms:{u_opacity:s||1,u_radius:y,u_intensity:f},blend:{enable:!0,func:{srcRGB:R.ONE,srcAlpha:1,dstRGB:R.ONE,dstAlpha:1}},stencil:{enable:!1,mask:255,func:{cmp:514,ref:1,mask:255}}}),this.layer.hooks.afterRender.call()}},{key:"drawColorMode",value:function(i){var o,s=this.layer.getLayerConfig(),l=s.opacity;(o=this.colorModel)===null||o===void 0||o.draw({uniforms:{u_opacity:l||1,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer},blend:this.getBlend(),stencil:this.getStencil(i)})}},{key:"draw3DHeatMap",value:function(i){var o,s=this.layer.getLayerConfig(),l=s.opacity,f=me.create();me.invert(f,this.cameraService.getViewProjectionMatrixUncentered()),(o=this.colorModel)===null||o===void 0||o.draw({uniforms:{u_opacity:l||1,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer,u_ViewProjectionMatrixUncentered:this.cameraService.getViewProjectionMatrixUncentered(),u_InverseViewProjectionMatrix:(0,Kt.Z)(f)},blend:{enable:!0,func:{srcRGB:R.SRC_ALPHA,srcAlpha:1,dstRGB:R.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},stencil:this.getStencil(i)})}},{key:"build3dHeatMap",value:function(){var i=this.rendererService.getViewportSize,o=i(),s=o.width,l=o.height,f=lC(s/4,l/4);this.shaderModuleService.registerModule("heatmap3dColor",{vs:pC,fs:hC});var v=this.shaderModuleService.getModule("heatmap3dColor"),y=v.vs,b=v.fs,T=v.uniforms,M=this.rendererService,O=M.createAttribute,F=M.createElements,$=M.createBuffer,G=M.createModel;return G({vs:y,fs:b,attributes:{a_Position:O({buffer:$({data:f.vertices,type:R.FLOAT}),size:3}),a_Uv:O({buffer:$({data:f.uvs,type:R.FLOAT}),size:2})},primitive:R.TRIANGLES,uniforms:(0,V.Z)({},T),depth:{enable:!0},blend:{enable:!0,func:{srcRGB:R.SRC_ALPHA,srcAlpha:1,dstRGB:R.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},elements:F({data:f.indices,type:R.UNSIGNED_INT,count:f.indices.length})})}},{key:"updateStyle",value:function(){this.updateColorTexture()}},{key:"updateColorTexture",value:function(){var i=this.rendererService.createTexture2D;this.texture&&this.texture.destroy();var o=this.layer.getLayerConfig(),s=o.rampColors,l=Ao(s);this.colorTexture=i({data:new Uint8Array(l.data),width:l.width,height:l.height,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE,min:R.NEAREST,mag:R.NEAREST,flipY:!1}),this.preRampColors=s}}]),t}(Ma))||M1);function yC(e){var r=xC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function xC(){if(typeof Reflect=="undefined"||!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(e){return!1}}var bC=`precision highp float;
|
|
varying vec4 v_color;
|
|
uniform float u_opacity: 1;
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
gl_FragColor = v_color;
|
|
gl_FragColor.a *= u_opacity;
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,EC=`precision highp float;
|
|
// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807
|
|
attribute vec3 a_Position;
|
|
// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807
|
|
attribute vec3 a_Pos;
|
|
attribute float a_Size;
|
|
attribute vec4 a_Color;
|
|
uniform vec2 u_radius;
|
|
uniform float u_coverage: 0.9;
|
|
uniform float u_angle: 0;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
varying vec4 v_color;
|
|
|
|
uniform vec2 u_sceneCenterMercator;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
v_color = a_Color;
|
|
|
|
mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));
|
|
vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));
|
|
vec2 lnglat = unProjectFlat(a_Pos.xy + offset);
|
|
|
|
// vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));
|
|
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
// gl_Position = u_Mvp * (vec4(project_pos.xy, 0., 1.0));
|
|
// gl_Position = u_Mvp * (vec4(a_Pos.xy + offset, 0., 1.0));
|
|
vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator;
|
|
vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));
|
|
gl_Position = u_Mvp * vec4(project_pos.xy, 0.0, 1.0);
|
|
} else {
|
|
vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));
|
|
}
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,SC=function(e){(0,Le.Z)(t,e);var r=yC(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=i.coverage,l=i.angle;return{u_opacity:o||1,u_coverage:s||.9,u_angle:l||0,u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset]}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"heatmapHexagon",vertexShader:EC,fragmentShader:bC,triangulation:w1,depth:{enable:!1},primitive:R.TRIANGLES});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:dn.Attribute,descriptor:{name:"a_Pos",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=o.version==="GAODE2.x"?o.originCoordinates:o.coordinates;return[s[0],s[1],0]}}})}}]),t}(Ma),AC={heatmap:I1,heatmap3d:I1,grid:nC,grid3d:uC,hexagon:SC},TC=AC;function wC(e){var r=CC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function CC(){if(typeof Reflect=="undefined"||!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(e){return!1}}var RC=function(e){(0,Le.Z)(t,e);var r=wC(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"type","HeatMapLayer"),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel=new TC[s](this),f.next=4,this.initLayerModels();case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"renderModels",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=this.getModelType();return s==="heatmap"?(this.layerModel&&this.layerModel.render(o),this):this.encodeDataLength<=0&&!this.forceRender?this:(this.hooks.beforeRender.call(),this.models.forEach(function(l){return l.draw({uniforms:i.layerModel.getUninforms(),blend:i.layerModel.getBlend(),stencil:i.layerModel.getStencil(o)})}),this.hooks.afterRender.call(),this)}},{key:"updateModelData",value:function(i){i.attributes&&i.elements?this.models[0].updateAttributesAndElements(i.attributes,i.elements):console.warn("data error")}},{key:"getModelType",value:function(){var i,o=this.styleAttributeService.getLayerStyleAttribute("shape"),s=this.getLayerConfig(),l=s.shape3d,f=this.getSource(),v=f.data.type,y=(o==null||(i=o.scale)===null||i===void 0?void 0:i.field)||"heatmap";return y==="heatmap"||y==="heatmap3d"?"heatmap":v==="hexagon"?(l==null?void 0:l.indexOf(y))===-1?"hexagon":"grid3d":v==="grid"?(l==null?void 0:l.indexOf(y))===-1?"grid":"grid3d":"heatmap"}}]),t}(Ip);function MC(e){var r=IC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function IC(){if(typeof Reflect=="undefined"||!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(e){return!1}}var PC=`precision mediump float;
|
|
uniform float u_opacity: 1.0;
|
|
uniform sampler2D u_texture;
|
|
varying vec2 v_texCoord;
|
|
void main() {
|
|
vec4 color = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y));
|
|
gl_FragColor = color;
|
|
gl_FragColor.a *= u_opacity;
|
|
if(gl_FragColor.a < 0.01)
|
|
discard;
|
|
}
|
|
`,OC=`precision highp float;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
attribute vec3 a_Position;
|
|
attribute vec2 a_Uv;
|
|
varying vec2 v_texCoord;
|
|
#pragma include "projection"
|
|
void main() {
|
|
v_texCoord = a_Uv;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
|
|
|
|
}
|
|
`,DC=function(e){(0,Le.Z)(t,e);var r=MC(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity;return{u_opacity:o||1,u_texture:this.texture}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.layer.getSource(),l=this.rendererService.createTexture2D,this.texture=l({height:0,width:0}),b.next=5,s.data.images;case 5:return f=b.sent,this.texture=l({data:f[0],width:f[0].width,height:f[0].height,mag:R.LINEAR,min:R.LINEAR}),b.next=9,this.layer.buildLayerModel({moduleName:"rasterImage",vertexShader:OC,fragmentShader:PC,triangulation:Sg,primitive:R.TRIANGLES,blend:{enable:!0},depth:{enable:!1}});case 9:return v=b.sent,b.abrupt("return",[v]);case 11:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_Uv",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}})}}]),t}(Ma),FC={image:DC},kC=FC;function BC(e){var r=LC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function LC(){if(typeof Reflect=="undefined"||!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(e){return!1}}var P1=function(e){(0,Le.Z)(t,e);var r=BC(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"type","ImageLayer"),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel=new kC[s](this),f.next=4,this.initLayerModels();case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),o={image:{}};return o[i]}},{key:"getModelType",value:function(){return"image"}}]),t}(Ip);function NC(e){var r=UC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function UC(){if(typeof Reflect=="undefined"||!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(e){return!1}}var zC=`varying vec4 v_dash_array;
|
|
varying vec4 v_color;
|
|
varying float v_distance_ratio;
|
|
|
|
uniform float segmentNumber;
|
|
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
gl_FragColor = v_color;
|
|
|
|
float flag = 0.;
|
|
float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {
|
|
flag = 1.;
|
|
};
|
|
gl_FragColor.a *=flag;
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}`,ZC=`
|
|
attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec4 a_Instance;
|
|
attribute float a_Size;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform float segmentNumber;
|
|
varying vec4 v_color;
|
|
|
|
|
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
uniform float u_lineDir: 1.0;
|
|
varying vec4 v_dash_array;
|
|
varying float v_distance_ratio;
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
float bezier3(vec3 arr, float t) {
|
|
float ut = 1. - t;
|
|
return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;
|
|
}
|
|
vec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) {
|
|
vec2 center = target - source;
|
|
float r = length(center);
|
|
float theta = atan(center.y, center.x);
|
|
float thetaOffset = arcThetaOffset;
|
|
float r2 = r / 2.0 / cos(thetaOffset);
|
|
float theta2 = theta + thetaOffset;
|
|
vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);
|
|
if(u_lineDir == 1.0) { // \u6B63\u5411
|
|
return mid;
|
|
} else { // \u9006\u5411
|
|
// (mid + vmin)/2 = (s + t)/2
|
|
vec2 vmid = source + target - mid;
|
|
return vmid;
|
|
}
|
|
// return mid;
|
|
}
|
|
float getSegmentRatio(float index) {
|
|
// dash: index / (segmentNumber - 1.);
|
|
// normal: smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
|
|
return index / (segmentNumber - 1.);
|
|
}
|
|
vec2 interpolate (vec2 source, vec2 target, float t, float arcThetaOffset) {
|
|
// if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation
|
|
vec2 mid = midPoint(source, target, arcThetaOffset);
|
|
vec3 x = vec3(source.x, mid.x, target.x);
|
|
vec3 y = vec3(source.y, mid.y, target.y);
|
|
return vec2(bezier3(x ,t), bezier3(y,t));
|
|
}
|
|
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;
|
|
return offset;
|
|
}
|
|
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
|
|
}
|
|
|
|
void main() {
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
|
|
vec2 source = a_Instance.rg; // \u8D77\u59CB\u70B9
|
|
vec2 target = a_Instance.ba; // \u7EC8\u70B9
|
|
float segmentIndex = a_Position.x;
|
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
|
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
|
|
vec2 s = source;
|
|
vec2 t = target;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
s = unProjCustomCoord(source);
|
|
t = unProjCustomCoord(target);
|
|
}
|
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;
|
|
|
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
|
|
vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio, thetaOffset), 0.0, 1.0));
|
|
vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio, thetaOffset), 0.0, 1.0));
|
|
|
|
|
|
vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0));
|
|
|
|
gl_PointSize = 5.0;
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,VC=`
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
uniform float u_textureBlend;
|
|
uniform float u_blur : 0.9;
|
|
uniform float u_line_type: 0.0;
|
|
// varying vec2 v_normal;
|
|
varying vec4 v_dash_array;
|
|
varying vec4 v_color;
|
|
|
|
uniform float u_time;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
|
|
uniform float u_line_texture;
|
|
uniform sampler2D u_texture;
|
|
uniform vec2 u_textSize;
|
|
|
|
uniform float segmentNumber;
|
|
varying vec2 v_iconMapUV;
|
|
varying vec4 v_lineData;
|
|
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
|
|
gl_FragColor = v_color;
|
|
|
|
|
|
if(u_animate.x == Animate && u_line_texture != LineTexture) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- v_lineData.b, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
// alpha = smoothstep(0., 1., alpha);
|
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
gl_FragColor.a *= alpha;
|
|
}
|
|
|
|
// \u5F53\u5B58\u5728\u8D34\u56FE\u65F6\u5728\u5E95\u8272\u4E0A\u8D34\u4E0A\u8D34\u56FE
|
|
if(u_line_texture == LineTexture) { // while load texture
|
|
float arcRadio = smoothstep( 0.0, 1.0, (v_lineData.r / segmentNumber));
|
|
// float arcRadio = smoothstep( 0.0, 1.0, d_distance_ratio);
|
|
|
|
float count = v_lineData.g; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
|
|
|
|
float time = 0.0;
|
|
if(u_animate.x == Animate) {
|
|
time = u_time / u_animate.y;
|
|
}
|
|
float redioCount = arcRadio * count;
|
|
|
|
float u = fract(redioCount - time);
|
|
float v = v_lineData.a; // \u6A2A\u5411 v
|
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
|
|
vec4 pattern = texture2D(u_texture, uv);
|
|
|
|
if(u_animate.x == Animate) {
|
|
float currentPlane = floor(redioCount - time);
|
|
float textureStep = floor(count * u_animate.z);
|
|
float a = mod(currentPlane, textureStep);
|
|
if(a < textureStep - 1.0) {
|
|
pattern = vec4(0.0);
|
|
}
|
|
}
|
|
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
gl_FragColor = filterColor(gl_FragColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(gl_FragColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
gl_FragColor = filterColor(pattern);
|
|
}
|
|
|
|
} else {
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
}`,jC=`#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec4 a_Instance;
|
|
attribute float a_Size;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform float segmentNumber;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
varying vec4 v_color;
|
|
|
|
uniform float u_lineDir: 1.0;
|
|
|
|
uniform float u_icon_step: 100;
|
|
uniform float u_line_texture: 0.0;
|
|
attribute vec2 a_iconMapUV;
|
|
varying vec2 v_iconMapUV;
|
|
varying vec4 v_lineData;
|
|
varying vec2 v_distance_ratio;
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
float bezier3(vec3 arr, float t) {
|
|
float ut = 1. - t;
|
|
return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;
|
|
}
|
|
vec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) {
|
|
vec2 center = target - source;
|
|
float r = length(center);
|
|
float theta = atan(center.y, center.x);
|
|
float thetaOffset = arcThetaOffset;
|
|
float r2 = r / 2.0 / cos(thetaOffset);
|
|
float theta2 = theta + thetaOffset;
|
|
vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);
|
|
if(u_lineDir == 1.0) { // \u6B63\u5411
|
|
return mid;
|
|
} else { // \u9006\u5411
|
|
// (mid + vmin)/2 = (s + t)/2
|
|
vec2 vmid = source + target - mid;
|
|
return vmid;
|
|
}
|
|
// return mid;
|
|
}
|
|
float getSegmentRatio(float index) {
|
|
// dash: index / (segmentNumber - 1.);
|
|
// normal: smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
|
|
return smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
|
|
// return index / (segmentNumber - 1.);
|
|
}
|
|
vec2 interpolate (vec2 source, vec2 target, float t, float arcThetaOffset) {
|
|
// if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation
|
|
vec2 mid = midPoint(source, target, arcThetaOffset);
|
|
vec3 x = vec3(source.x, mid.x, target.x);
|
|
vec3 y = vec3(source.y, mid.y, target.y);
|
|
return vec2(bezier3(x ,t), bezier3(y,t));
|
|
}
|
|
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;
|
|
return offset;
|
|
}
|
|
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
|
|
}
|
|
|
|
void main() {
|
|
v_color = a_Color;
|
|
v_color.a = v_color.a * opacity;
|
|
|
|
vec2 source = a_Instance.rg; // \u8D77\u59CB\u70B9
|
|
vec2 target = a_Instance.ba; // \u7EC8\u70B9
|
|
float segmentIndex = a_Position.x;
|
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
|
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
float d_distance_ratio;
|
|
|
|
if(u_animate.x == Animate) {
|
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
if(u_lineDir != 1.0) {
|
|
d_distance_ratio = 1.0 - d_distance_ratio;
|
|
}
|
|
}
|
|
|
|
v_lineData.b = d_distance_ratio;
|
|
|
|
vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio, thetaOffset), 0.0, 1.0));
|
|
vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio, thetaOffset), 0.0, 1.0));
|
|
|
|
|
|
vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));
|
|
|
|
|
|
float d_segmentIndex = a_Position.x + 1.0; // \u5F53\u524D\u9876\u70B9\u5728\u5F27\u7EBF\u4E2D\u6240\u5904\u7684\u5206\u6BB5\u4F4D\u7F6E
|
|
v_lineData.r = d_segmentIndex;
|
|
|
|
if(LineTexture == u_line_texture) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F
|
|
|
|
float arcDistrance = length(source - target); // \u8D77\u59CB\u70B9\u548C\u7EC8\u70B9\u7684\u8DDD\u79BB
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap
|
|
arcDistrance *= 1000000.0;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox
|
|
// arcDistrance *= 8.0;
|
|
arcDistrance = project_pixel_allmap(arcDistrance);
|
|
}
|
|
v_iconMapUV = a_iconMapUV;
|
|
|
|
float pixelLen = project_pixel_texture(u_icon_step); // \u8D34\u56FE\u6CBF\u5F27\u7EBF\u65B9\u5411\u7684\u957F\u5EA6 - \u968F\u5730\u56FE\u7F29\u653E\u6539\u53D8
|
|
float texCount = floor(arcDistrance/pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
|
|
v_lineData.g = texCount;
|
|
|
|
float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB
|
|
float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB
|
|
v_lineData.a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,HC=`varying vec4 v_color;
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
// \u5F53\u524D\u9876\u70B9\u5728\u5F27\u7EBF\u4E2D\u6240\u5904\u7684\u5206\u6BB5\u4F4D\u7F6E
|
|
|
|
gl_FragColor = v_color;
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}`,WC=`
|
|
attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec4 a_Instance;
|
|
attribute float a_Size;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform float segmentNumber;
|
|
varying vec4 v_color;
|
|
varying float v_segmentIndex;
|
|
|
|
uniform float u_lineDir: 1.0;
|
|
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
|
|
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
float bezier3(vec3 arr, float t) {
|
|
float ut = 1. - t;
|
|
return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;
|
|
}
|
|
vec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) {
|
|
vec2 center = target - source;
|
|
float r = length(center);
|
|
float theta = atan(center.y, center.x);
|
|
float thetaOffset = arcThetaOffset;
|
|
float r2 = r / 2.0 / cos(thetaOffset);
|
|
float theta2 = theta + thetaOffset;
|
|
vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);
|
|
if(u_lineDir == 1.0) { // \u6B63\u5411
|
|
return mid;
|
|
} else { // \u9006\u5411
|
|
// (mid + vmin)/2 = (s + t)/2
|
|
vec2 vmid = source + target - mid;
|
|
return vmid;
|
|
}
|
|
// return mid;
|
|
}
|
|
float getSegmentRatio(float index) {
|
|
return smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
|
|
}
|
|
vec2 interpolate (vec2 source, vec2 target, float t, float arcThetaOffset) {
|
|
// if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation
|
|
vec2 mid = midPoint(source, target, arcThetaOffset);
|
|
vec3 x = vec3(source.x, mid.x, target.x);
|
|
vec3 y = vec3(source.y, mid.y, target.y);
|
|
return vec2(bezier3(x ,t), bezier3(y,t));
|
|
}
|
|
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;
|
|
return offset;
|
|
}
|
|
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
|
|
}
|
|
|
|
void main() {
|
|
v_color = a_Color;
|
|
|
|
vec2 source = a_Instance.rg; // \u8D77\u59CB\u70B9
|
|
vec2 target = a_Instance.ba; // \u7EC8\u70B9
|
|
float segmentIndex = a_Position.x;
|
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
|
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
float d_distance_ratio;
|
|
vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio, thetaOffset), 0.0, 1.0));
|
|
vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio, thetaOffset), 0.0, 1.0));
|
|
// v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
//unProjCustomCoord
|
|
|
|
vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));
|
|
|
|
|
|
float d_segmentIndex = a_Position.x + 1.0; // \u5F53\u524D\u9876\u70B9\u5728\u5F27\u7EBF\u4E2D\u6240\u5904\u7684\u5206\u6BB5\u4F4D\u7F6E
|
|
|
|
v_color = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);
|
|
v_color.a *= opacity;
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,GC={solid:0,dash:1},AL=oi.isNumber,XC=function(e){(0,Le.Z)(t,e);var r=NC(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"updateTexture",function(){var l=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=l({data:n.iconService.getCanvas(),mag:R.NEAREST,min:R.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128})}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.sourceColor,f=i.targetColor,v=i.textureBlend,y=v===void 0?"normal":v,b=i.lineType,T=b===void 0?"solid":b,M=i.dashArray,O=M===void 0?[10,5]:M,F=i.forward,$=F===void 0?!0:F,G=i.lineTexture,ue=G===void 0?!1:G,xe=i.iconStep,ze=xe===void 0?100:xe,Je=i.segmentNumber,ht=Je===void 0?30:Je;O.length===2&&O.push(0,0);var gt=0,Ot=[0,0,0,0],tr=[0,0,0,0];return l&&f&&(Ot=fi(l),tr=fi(f),gt=1),this.rendererService.getDirty()&&this.texture.bind(),(0,V.Z)({u_textureBlend:y==="normal"?0:1,segmentNumber:ht,u_line_type:GC[T||"solid"],u_dash_array:O,u_blur:.9,u_lineDir:$?1:-1,u_texture:this.texture,u_line_texture:ue?1:0,u_icon_step:ze,u_textSize:[1024,this.iconService.canvasHeight||128],u_linearColor:gt,u_sourceColor:Ot,u_targetColor:tr},this.getStyleAttribute())}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption;return{u_animate:this.animateOption2Array(o),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"getShaders",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,s=i.targetColor,l=i.lineType;return l==="dash"?{frag:zC,vert:ZC,type:"Dash"}:o&&s?{frag:HC,vert:WC,type:"Linear"}:{frag:VC,vert:jC,type:""}}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return s=this.layer.getLayerConfig(),l=s.segmentNumber,f=l===void 0?30:l,v=this.getShaders(),y=v.frag,b=v.vert,T=v.type,F.next=4,this.layer.buildLayerModel({moduleName:"lineArc2d"+T,vertexShader:b,fragmentShader:y,inject:this.getInject(),triangulation:Ag,depth:{enable:!1},styleOption:{segmentNumber:f}});case 4:return M=F.sent,F.abrupt("return",[M]);case 6:case"end":return F.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.size,f=l===void 0?1:l;return Array.isArray(f)?[f[0]]:[f]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:dn.Attribute,descriptor:{name:"a_Instance",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:4,update:function(s,l,f){return[f[3],f[4],f[5],f[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.texture,v=l[f]||{x:0,y:0},y=v.x,b=v.y;return[y,b]}}})}}]),t}(Ma);function $C(e){var r=YC();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function YC(){if(typeof Reflect=="undefined"||!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(e){return!1}}var qC=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
uniform float u_textureBlend;
|
|
uniform float u_blur : 0.9;
|
|
uniform float u_line_type: 0.0;
|
|
// varying vec2 v_normal;
|
|
varying vec4 v_dash_array;
|
|
varying vec4 v_color;
|
|
varying vec4 v_line_data;
|
|
|
|
uniform float u_line_texture: 0.0;
|
|
uniform sampler2D u_texture;
|
|
uniform vec2 u_textSize;
|
|
varying float v_segmentIndex;
|
|
uniform float segmentNumber;
|
|
|
|
|
|
varying vec2 v_iconMapUV;
|
|
|
|
uniform float u_time;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
|
|
float d_distance_ratio = v_line_data.g; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
|
|
gl_FragColor = v_color;
|
|
|
|
if(u_line_type == LineTypeDash) {
|
|
float flag = 0.;
|
|
float dashLength = mod(d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {
|
|
flag = 1.;
|
|
}
|
|
gl_FragColor.a *=flag;
|
|
}
|
|
|
|
if(u_animate.x == Animate && u_line_texture != LineTexture) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
// alpha = smoothstep(0., 1., alpha);
|
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
gl_FragColor.a *= alpha;
|
|
|
|
// u_animate
|
|
// x enable
|
|
// y duration
|
|
// z interval
|
|
// w trailLength
|
|
}
|
|
|
|
if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture
|
|
// float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber));
|
|
float arcRadio = v_segmentIndex / (segmentNumber - 1.0);
|
|
float count = v_line_data.b; // // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
|
|
|
|
float time = 0.0;
|
|
if(u_animate.x == Animate) {
|
|
time = u_time / u_animate.y;
|
|
}
|
|
float redioCount = arcRadio * count;
|
|
|
|
float u = fract(redioCount - time);
|
|
|
|
float v = v_line_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
|
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
vec4 pattern = texture2D(u_texture, uv);
|
|
|
|
if(u_animate.x == Animate) {
|
|
float currentPlane = floor(redioCount - time);
|
|
float textureStep = floor(count * u_animate.z);
|
|
float a = mod(currentPlane, textureStep);
|
|
if(a < textureStep - 1.0) {
|
|
pattern = vec4(0.0);
|
|
}
|
|
}
|
|
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
gl_FragColor = filterColor(gl_FragColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(gl_FragColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
discard;
|
|
} else {
|
|
gl_FragColor = filterColor(pattern);
|
|
}
|
|
}
|
|
|
|
} else {
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
}
|
|
`,KC=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
attribute vec3 a_Position;
|
|
attribute vec4 a_Instance;
|
|
attribute vec4 a_Color;
|
|
attribute float a_Size;
|
|
|
|
uniform float u_globel;
|
|
uniform float u_globel_radius;
|
|
uniform float u_global_height: 10;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform float segmentNumber;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
varying vec4 v_color;
|
|
|
|
uniform float u_line_type: 0.0;
|
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
varying vec4 v_dash_array;
|
|
|
|
uniform float u_icon_step: 100;
|
|
uniform float u_line_texture: 0.0;
|
|
varying float v_segmentIndex;
|
|
|
|
attribute vec2 a_iconMapUV;
|
|
varying vec2 v_iconMapUV;
|
|
varying vec4 v_line_data;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
float maps (float value, float start1, float stop1, float start2, float stop2) {
|
|
return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
|
|
}
|
|
|
|
float getSegmentRatio(float index) {
|
|
return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));
|
|
}
|
|
|
|
float paraboloid(vec2 source, vec2 target, float ratio) {
|
|
vec2 x = mix(source, target, ratio);
|
|
vec2 center = mix(source, target, 0.5);
|
|
float dSourceCenter = distance(source, center);
|
|
float dXCenter = distance(x, center);
|
|
return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);
|
|
}
|
|
|
|
vec3 getPos(vec2 source, vec2 target, float segmentRatio) {
|
|
float vertex_height = paraboloid(source, target, segmentRatio);
|
|
|
|
return vec3(
|
|
mix(source, target, segmentRatio),
|
|
sqrt(max(0.0, vertex_height))
|
|
);
|
|
}
|
|
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
|
|
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;
|
|
|
|
return offset;
|
|
}
|
|
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
|
|
}
|
|
|
|
float torad(float deg) {
|
|
return (deg / 180.0) * acos(-1.0);
|
|
}
|
|
|
|
vec3 lglt2xyz(vec2 lnglat) {
|
|
float pi = 3.1415926;
|
|
// + Math.PI/2 \u662F\u4E3A\u4E86\u5BF9\u9F50\u5750\u6807
|
|
float lng = torad(lnglat.x) + pi / 2.0;
|
|
float lat = torad(lnglat.y);
|
|
|
|
// \u624B\u52A8\u589E\u52A0\u4E00\u4E9B\u504F\u79FB\uFF0C\u51CF\u8F7B\u9762\u7684\u51B2\u7A81
|
|
float radius = u_globel_radius;
|
|
|
|
float z = radius * cos(lat) * cos(lng);
|
|
float x = radius * cos(lat) * sin(lng);
|
|
float y = radius * sin(lat);
|
|
return vec3(x, y, z);
|
|
}
|
|
|
|
void main() {
|
|
|
|
v_color = a_Color;
|
|
v_color.a = v_color.a * opacity;
|
|
vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;
|
|
vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;
|
|
float segmentIndex = a_Position.x;
|
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
|
|
float d_distance_ratio;
|
|
if(u_line_type == LineTypeDash) {
|
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
vec2 s = source;
|
|
vec2 t = target;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
s = unProjCustomCoord(source);
|
|
t = unProjCustomCoord(target);
|
|
}
|
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
}
|
|
if(u_animate.x == Animate) {
|
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
}
|
|
v_line_data.g = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
|
|
|
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
vec3 curr = getPos(source, target, segmentRatio);
|
|
vec3 next = getPos(source, target, nextSegmentRatio);
|
|
vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
// v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
|
|
|
|
v_segmentIndex = a_Position.x;
|
|
if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F
|
|
|
|
float arcDistrance = length(source - target);
|
|
float pixelLen = project_pixel_texture(u_icon_step);
|
|
v_line_data.b = floor(arcDistrance/pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
|
|
|
|
vec2 projectOffset = project_pixel(offset);
|
|
float lineOffsetWidth = length(projectOffset + projectOffset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB
|
|
float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB
|
|
v_line_data.a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
|
|
|
|
v_iconMapUV = a_iconMapUV;
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + project_pixel(offset), curr.z * thetaOffset, 1.0));
|
|
|
|
// \u5730\u7403\u6A21\u5F0F
|
|
if(u_globel > 0.0) {
|
|
vec3 startLngLat = lglt2xyz(a_Instance.rg);
|
|
vec3 endLngLat = lglt2xyz(a_Instance.ba);
|
|
float globalRadius = length(startLngLat);
|
|
|
|
vec3 lineDir = normalize(endLngLat - startLngLat);
|
|
vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);
|
|
|
|
// \u7EBF\u7684\u504F\u79FB
|
|
vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;
|
|
// \u8BA1\u7B97\u8D77\u59CB\u70B9\u548C\u7EC8\u6B62\u70B9\u7684\u8DDD\u79BB
|
|
float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;
|
|
// \u8BA1\u7B97\u98DE\u7EBF\u5404\u4E2A\u8282\u70B9\u76F8\u5E94\u7684\u9AD8\u5EA6
|
|
float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;
|
|
// \u5730\u7403\u70B9\u4F4D
|
|
vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;
|
|
|
|
gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);
|
|
}
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,QC=`
|
|
#define Animate 0.0
|
|
uniform float u_time;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
varying vec4 v_Color;
|
|
|
|
varying float v_distance_ratio;
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
|
|
gl_FragColor = v_Color;
|
|
|
|
if(u_animate.x == Animate) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
// alpha = smoothstep(0., 1., alpha);
|
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
gl_FragColor.a *= alpha;
|
|
|
|
// u_animate
|
|
// x enable
|
|
// y duration
|
|
// z interval
|
|
// w trailLength
|
|
}
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,JC=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
attribute vec3 a_Position;
|
|
attribute vec4 a_Instance;
|
|
attribute vec4 a_Color;
|
|
attribute float a_Size;
|
|
attribute vec2 a_iconMapUV;
|
|
|
|
uniform float u_globel;
|
|
uniform float u_globel_radius;
|
|
uniform float u_global_height: 10;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform float segmentNumber;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
|
|
uniform float u_line_type: 0.0;
|
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
uniform float u_icon_step: 100;
|
|
uniform float u_line_texture: 0.0;
|
|
varying float v_distance_ratio;
|
|
|
|
varying vec4 v_dash_array;
|
|
varying vec4 v_color;
|
|
varying vec2 v_iconMapUV;
|
|
varying vec4 v_Color;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
float maps (float value, float start1, float stop1, float start2, float stop2) {
|
|
return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
|
|
}
|
|
|
|
float getSegmentRatio(float index) {
|
|
return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));
|
|
}
|
|
|
|
float paraboloid(vec2 source, vec2 target, float ratio) {
|
|
vec2 x = mix(source, target, ratio);
|
|
vec2 center = mix(source, target, 0.5);
|
|
float dSourceCenter = distance(source, center);
|
|
float dXCenter = distance(x, center);
|
|
return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);
|
|
}
|
|
|
|
vec3 getPos(vec2 source, vec2 target, float segmentRatio) {
|
|
float vertex_height = paraboloid(source, target, segmentRatio);
|
|
|
|
return vec3(
|
|
mix(source, target, segmentRatio),
|
|
sqrt(max(0.0, vertex_height))
|
|
);
|
|
}
|
|
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
|
|
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;
|
|
|
|
return offset;
|
|
}
|
|
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
|
|
}
|
|
|
|
float torad(float deg) {
|
|
return (deg / 180.0) * acos(-1.0);
|
|
}
|
|
|
|
vec3 lglt2xyz(vec2 lnglat) {
|
|
float pi = 3.1415926;
|
|
// + Math.PI/2 \u662F\u4E3A\u4E86\u5BF9\u9F50\u5750\u6807
|
|
float lng = torad(lnglat.x) + pi / 2.0;
|
|
float lat = torad(lnglat.y);
|
|
|
|
// \u624B\u52A8\u589E\u52A0\u4E00\u4E9B\u504F\u79FB\uFF0C\u51CF\u8F7B\u9762\u7684\u51B2\u7A81
|
|
float radius = u_globel_radius;
|
|
|
|
float z = radius * cos(lat) * cos(lng);
|
|
float x = radius * cos(lat) * sin(lng);
|
|
float y = radius * sin(lat);
|
|
return vec3(x, y, z);
|
|
}
|
|
|
|
void main() {
|
|
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
|
|
|
|
v_color = a_Color;
|
|
vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;
|
|
vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;
|
|
float segmentIndex = a_Position.x;
|
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
|
|
float d_distance_ratio;
|
|
if(u_line_type == LineTypeDash) {
|
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
// float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;
|
|
vec2 s = source;
|
|
vec2 t = target;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
s = unProjCustomCoord(source);
|
|
t = unProjCustomCoord(target);
|
|
}
|
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
}
|
|
if(u_animate.x == Animate) {
|
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
}
|
|
|
|
|
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
vec3 curr = getPos(source, target, segmentRatio);
|
|
vec3 next = getPos(source, target, nextSegmentRatio);
|
|
vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
|
|
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
|
|
v_Color = mix(u_sourceColor, u_targetColor, a_Position.x/segmentNumber);
|
|
|
|
v_Color.a *= opacity;
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));
|
|
|
|
// \u5730\u7403\u6A21\u5F0F
|
|
if(u_globel > 0.0) {
|
|
vec3 startLngLat = lglt2xyz(a_Instance.rg);
|
|
vec3 endLngLat = lglt2xyz(a_Instance.ba);
|
|
float globalRadius = length(startLngLat);
|
|
|
|
vec3 lineDir = normalize(endLngLat - startLngLat);
|
|
vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);
|
|
|
|
// \u7EBF\u7684\u504F\u79FB
|
|
vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;
|
|
// \u8BA1\u7B97\u8D77\u59CB\u70B9\u548C\u7EC8\u6B62\u70B9\u7684\u8DDD\u79BB
|
|
float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;
|
|
// \u8BA1\u7B97\u98DE\u7EBF\u5404\u4E2A\u8282\u70B9\u76F8\u5E94\u7684\u9AD8\u5EA6
|
|
float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;
|
|
// \u5730\u7403\u70B9\u4F4D
|
|
vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;
|
|
|
|
gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);
|
|
}
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,e3={solid:0,dash:1},t3=function(e){(0,Le.Z)(t,e);var r=$C(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"updateTexture",function(){var l=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=l({data:n.iconService.getCanvas(),mag:R.NEAREST,min:R.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128})}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,s=i.targetColor,l=i.textureBlend,f=l===void 0?"normal":l,v=i.lineType,y=v===void 0?"solid":v,b=i.dashArray,T=b===void 0?[10,5]:b,M=i.lineTexture,O=M===void 0?!1:M,F=i.iconStep,$=F===void 0?100:F,G=i.segmentNumber,ue=G===void 0?30:G,xe=i.globalArcHeight,ze=xe===void 0?10:xe;T.length===2&&T.push(0,0);var Je=0,ht=[0,0,0,0],gt=[0,0,0,0];return o&&s&&(ht=fi(o),gt=fi(s),Je=1),this.rendererService.getDirty()&&this.texture.bind(),(0,V.Z)({u_globel:this.mapService.version==="GLOBEL"?1:0,u_globel_radius:Z0,u_global_height:ze,u_textureBlend:f==="normal"?0:1,segmentNumber:ue,u_line_type:e3[y]||0,u_dash_array:T,u_texture:this.texture,u_line_texture:O?1:0,u_icon_step:$,u_textSize:[1024,this.iconService.canvasHeight||128],u_linearColor:Je,u_sourceColor:ht,u_targetColor:gt},this.getStyleAttribute())}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption;return{u_animate:this.animateOption2Array(o),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"getShaders",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,s=i.targetColor;return o&&s?{frag:QC,vert:JC,type:"Linear"}:{frag:qC,vert:KC,type:""}}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return s=this.layer.getLayerConfig(),l=s.segmentNumber,f=l===void 0?30:l,v=this.getShaders(),y=v.frag,b=v.vert,T=v.type,F.next=4,this.layer.buildLayerModel({moduleName:"lineArc3d"+T,vertexShader:b,fragmentShader:y,inject:this.getInject(),triangulation:Ag,styleOption:{segmentNumber:f}});case 4:return M=F.sent,F.abrupt("return",[M]);case 6:case"end":return F.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.size,f=l===void 0?1:l;return Array.isArray(f)?[f[0]]:[f]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:dn.Attribute,descriptor:{name:"a_Instance",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:4,update:function(s,l,f){return[f[3],f[4],f[5],f[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.texture,v=l[f]||{x:0,y:0},y=v.x,b=v.y;return[y,b]}}})}}]),t}(Ma);function r3(e){var r=n3();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function n3(){if(typeof Reflect=="undefined"||!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(e){return!1}}var i3=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
uniform float u_textureBlend;
|
|
uniform float u_blur : 0.9;
|
|
uniform float u_line_type: 0.0;
|
|
// varying vec2 v_normal;
|
|
varying vec4 v_dash_array;
|
|
varying vec4 v_color;
|
|
varying vec4 v_line_data;
|
|
|
|
uniform float u_line_texture: 0.0;
|
|
uniform sampler2D u_texture;
|
|
uniform vec2 u_textSize;
|
|
varying float v_segmentIndex;
|
|
uniform float segmentNumber;
|
|
|
|
|
|
varying vec2 v_iconMapUV;
|
|
|
|
uniform float u_time;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
|
|
float d_distance_ratio = v_line_data.g; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
|
|
gl_FragColor = v_color;
|
|
|
|
if(u_line_type == LineTypeDash) {
|
|
float flag = 0.;
|
|
float dashLength = mod(d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {
|
|
flag = 1.;
|
|
}
|
|
gl_FragColor.a *=flag;
|
|
}
|
|
|
|
if(u_animate.x == Animate && u_line_texture != LineTexture) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
// alpha = smoothstep(0., 1., alpha);
|
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
gl_FragColor.a *= alpha;
|
|
|
|
// u_animate
|
|
// x enable
|
|
// y duration
|
|
// z interval
|
|
// w trailLength
|
|
}
|
|
|
|
if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture
|
|
// float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber));
|
|
float arcRadio = v_segmentIndex / (segmentNumber - 1.0);
|
|
float count = v_line_data.b; // // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
|
|
|
|
float time = 0.0;
|
|
if(u_animate.x == Animate) {
|
|
time = u_time / u_animate.y;
|
|
}
|
|
float redioCount = arcRadio * count;
|
|
|
|
float u = fract(redioCount - time);
|
|
|
|
float v = v_line_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
|
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
vec4 pattern = texture2D(u_texture, uv);
|
|
|
|
if(u_animate.x == Animate) {
|
|
float currentPlane = floor(redioCount - time);
|
|
float textureStep = floor(count * u_animate.z);
|
|
float a = mod(currentPlane, textureStep);
|
|
if(a < textureStep - 1.0) {
|
|
pattern = vec4(0.0);
|
|
}
|
|
}
|
|
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
gl_FragColor = filterColor(gl_FragColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(gl_FragColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
discard;
|
|
} else {
|
|
gl_FragColor = filterColor(pattern);
|
|
}
|
|
}
|
|
|
|
} else {
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
}
|
|
`,a3=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
attribute vec3 a_Position;
|
|
attribute vec4 a_Instance;
|
|
attribute vec4 a_Color;
|
|
attribute float a_Size;
|
|
|
|
uniform float u_globel;
|
|
uniform float u_globel_radius;
|
|
uniform float u_global_height: 10;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform float segmentNumber;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
varying vec4 v_color;
|
|
|
|
uniform float u_line_type: 0.0;
|
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
varying vec4 v_dash_array;
|
|
|
|
uniform float u_icon_step: 100;
|
|
uniform float u_line_texture: 0.0;
|
|
varying float v_segmentIndex;
|
|
|
|
attribute vec2 a_iconMapUV;
|
|
varying vec2 v_iconMapUV;
|
|
varying vec4 v_line_data;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
float maps (float value, float start1, float stop1, float start2, float stop2) {
|
|
return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
|
|
}
|
|
|
|
float getSegmentRatio(float index) {
|
|
return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));
|
|
}
|
|
|
|
float paraboloid(vec2 source, vec2 target, float ratio) {
|
|
vec2 x = mix(source, target, ratio);
|
|
vec2 center = mix(source, target, 0.5);
|
|
float dSourceCenter = distance(source, center);
|
|
float dXCenter = distance(x, center);
|
|
return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);
|
|
}
|
|
|
|
vec3 getPos(vec2 source, vec2 target, float segmentRatio) {
|
|
float vertex_height = paraboloid(source, target, segmentRatio);
|
|
|
|
return vec3(
|
|
mix(source, target, segmentRatio),
|
|
sqrt(max(0.0, vertex_height))
|
|
);
|
|
}
|
|
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
|
|
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;
|
|
|
|
return offset;
|
|
}
|
|
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
|
|
}
|
|
|
|
float torad(float deg) {
|
|
return (deg / 180.0) * acos(-1.0);
|
|
}
|
|
|
|
vec3 lglt2xyz(vec2 lnglat) {
|
|
float pi = 3.1415926;
|
|
// + Math.PI/2 \u662F\u4E3A\u4E86\u5BF9\u9F50\u5750\u6807
|
|
float lng = torad(lnglat.x) + pi / 2.0;
|
|
float lat = torad(lnglat.y);
|
|
|
|
// \u624B\u52A8\u589E\u52A0\u4E00\u4E9B\u504F\u79FB\uFF0C\u51CF\u8F7B\u9762\u7684\u51B2\u7A81
|
|
float radius = u_globel_radius;
|
|
|
|
float z = radius * cos(lat) * cos(lng);
|
|
float x = radius * cos(lat) * sin(lng);
|
|
float y = radius * sin(lat);
|
|
return vec3(x, y, z);
|
|
}
|
|
|
|
void main() {
|
|
|
|
v_color = a_Color;
|
|
v_color.a = v_color.a * opacity;
|
|
vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;
|
|
vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;
|
|
float segmentIndex = a_Position.x;
|
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
|
|
float d_distance_ratio;
|
|
if(u_line_type == LineTypeDash) {
|
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
vec2 s = source;
|
|
vec2 t = target;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
s = unProjCustomCoord(source);
|
|
t = unProjCustomCoord(target);
|
|
}
|
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
}
|
|
if(u_animate.x == Animate) {
|
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
}
|
|
v_line_data.g = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
|
|
|
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
vec3 curr = getPos(source, target, segmentRatio);
|
|
vec3 next = getPos(source, target, nextSegmentRatio);
|
|
vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
// v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
|
|
|
|
v_segmentIndex = a_Position.x;
|
|
if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F
|
|
|
|
float arcDistrance = length(source - target);
|
|
float pixelLen = project_pixel_texture(u_icon_step);
|
|
v_line_data.b = floor(arcDistrance/pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
|
|
|
|
vec2 projectOffset = project_pixel(offset);
|
|
float lineOffsetWidth = length(projectOffset + projectOffset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB
|
|
float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB
|
|
v_line_data.a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
|
|
|
|
v_iconMapUV = a_iconMapUV;
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + project_pixel(offset), curr.z * thetaOffset, 1.0));
|
|
|
|
// \u5730\u7403\u6A21\u5F0F
|
|
if(u_globel > 0.0) {
|
|
vec3 startLngLat = lglt2xyz(a_Instance.rg);
|
|
vec3 endLngLat = lglt2xyz(a_Instance.ba);
|
|
float globalRadius = length(startLngLat);
|
|
|
|
vec3 lineDir = normalize(endLngLat - startLngLat);
|
|
vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);
|
|
|
|
// \u7EBF\u7684\u504F\u79FB
|
|
vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;
|
|
// \u8BA1\u7B97\u8D77\u59CB\u70B9\u548C\u7EC8\u6B62\u70B9\u7684\u8DDD\u79BB
|
|
float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;
|
|
// \u8BA1\u7B97\u98DE\u7EBF\u5404\u4E2A\u8282\u70B9\u76F8\u5E94\u7684\u9AD8\u5EA6
|
|
float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;
|
|
// \u5730\u7403\u70B9\u4F4D
|
|
vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;
|
|
|
|
gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);
|
|
}
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,o3=`
|
|
#define Animate 0.0
|
|
uniform float u_time;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
varying vec4 v_Color;
|
|
|
|
varying float v_distance_ratio;
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
|
|
gl_FragColor = v_Color;
|
|
|
|
if(u_animate.x == Animate) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
// alpha = smoothstep(0., 1., alpha);
|
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
gl_FragColor.a *= alpha;
|
|
|
|
// u_animate
|
|
// x enable
|
|
// y duration
|
|
// z interval
|
|
// w trailLength
|
|
}
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,s3=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
attribute vec3 a_Position;
|
|
attribute vec4 a_Instance;
|
|
attribute vec4 a_Color;
|
|
attribute float a_Size;
|
|
attribute vec2 a_iconMapUV;
|
|
|
|
uniform float u_globel;
|
|
uniform float u_globel_radius;
|
|
uniform float u_global_height: 10;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform float segmentNumber;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
|
|
uniform float u_line_type: 0.0;
|
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
uniform float u_icon_step: 100;
|
|
uniform float u_line_texture: 0.0;
|
|
varying float v_distance_ratio;
|
|
|
|
varying vec4 v_dash_array;
|
|
varying vec4 v_color;
|
|
varying vec2 v_iconMapUV;
|
|
varying vec4 v_Color;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
float maps (float value, float start1, float stop1, float start2, float stop2) {
|
|
return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
|
|
}
|
|
|
|
float getSegmentRatio(float index) {
|
|
return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));
|
|
}
|
|
|
|
float paraboloid(vec2 source, vec2 target, float ratio) {
|
|
vec2 x = mix(source, target, ratio);
|
|
vec2 center = mix(source, target, 0.5);
|
|
float dSourceCenter = distance(source, center);
|
|
float dXCenter = distance(x, center);
|
|
return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);
|
|
}
|
|
|
|
vec3 getPos(vec2 source, vec2 target, float segmentRatio) {
|
|
float vertex_height = paraboloid(source, target, segmentRatio);
|
|
|
|
return vec3(
|
|
mix(source, target, segmentRatio),
|
|
sqrt(max(0.0, vertex_height))
|
|
);
|
|
}
|
|
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
|
|
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;
|
|
|
|
return offset;
|
|
}
|
|
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
|
|
}
|
|
|
|
float torad(float deg) {
|
|
return (deg / 180.0) * acos(-1.0);
|
|
}
|
|
|
|
vec3 lglt2xyz(vec2 lnglat) {
|
|
float pi = 3.1415926;
|
|
// + Math.PI/2 \u662F\u4E3A\u4E86\u5BF9\u9F50\u5750\u6807
|
|
float lng = torad(lnglat.x) + pi / 2.0;
|
|
float lat = torad(lnglat.y);
|
|
|
|
// \u624B\u52A8\u589E\u52A0\u4E00\u4E9B\u504F\u79FB\uFF0C\u51CF\u8F7B\u9762\u7684\u51B2\u7A81
|
|
float radius = u_globel_radius;
|
|
|
|
float z = radius * cos(lat) * cos(lng);
|
|
float x = radius * cos(lat) * sin(lng);
|
|
float y = radius * sin(lat);
|
|
return vec3(x, y, z);
|
|
}
|
|
|
|
void main() {
|
|
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
|
|
|
|
v_color = a_Color;
|
|
vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;
|
|
vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;
|
|
float segmentIndex = a_Position.x;
|
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
|
|
float d_distance_ratio;
|
|
if(u_line_type == LineTypeDash) {
|
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
// float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;
|
|
vec2 s = source;
|
|
vec2 t = target;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
s = unProjCustomCoord(source);
|
|
t = unProjCustomCoord(target);
|
|
}
|
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
}
|
|
if(u_animate.x == Animate) {
|
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
}
|
|
|
|
|
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
vec3 curr = getPos(source, target, segmentRatio);
|
|
vec3 next = getPos(source, target, nextSegmentRatio);
|
|
vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
|
|
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
|
|
v_Color = mix(u_sourceColor, u_targetColor, a_Position.x/segmentNumber);
|
|
|
|
v_Color.a *= opacity;
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));
|
|
|
|
// \u5730\u7403\u6A21\u5F0F
|
|
if(u_globel > 0.0) {
|
|
vec3 startLngLat = lglt2xyz(a_Instance.rg);
|
|
vec3 endLngLat = lglt2xyz(a_Instance.ba);
|
|
float globalRadius = length(startLngLat);
|
|
|
|
vec3 lineDir = normalize(endLngLat - startLngLat);
|
|
vec3 midPointDir = normalize((startLngLat + endLngLat)/2.0);
|
|
|
|
// \u7EBF\u7684\u504F\u79FB
|
|
vec3 lnglatOffset = cross(lineDir, midPointDir) * a_Position.y;
|
|
// \u8BA1\u7B97\u8D77\u59CB\u70B9\u548C\u7EC8\u6B62\u70B9\u7684\u8DDD\u79BB
|
|
float lnglatLength = length(a_Instance.rg - a_Instance.ba)/50.0;
|
|
// \u8BA1\u7B97\u98DE\u7EBF\u5404\u4E2A\u8282\u70B9\u76F8\u5E94\u7684\u9AD8\u5EA6
|
|
float lineHeight = u_global_height * (-4.0*segmentRatio*segmentRatio + 4.0 * segmentRatio) * lnglatLength;
|
|
// \u5730\u7403\u70B9\u4F4D
|
|
vec3 globalPoint = normalize(mix(startLngLat, endLngLat, segmentRatio)) * (globalRadius + lineHeight) + lnglatOffset * a_Size;
|
|
|
|
gl_Position = u_ViewProjectionMatrix * vec4(globalPoint, 1.0);
|
|
}
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,u3={solid:0,dash:1},l3=function(e){(0,Le.Z)(t,e);var r=r3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"updateTexture",function(){var l=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=l({data:n.iconService.getCanvas(),mag:R.NEAREST,min:R.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128})}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.sourceColor,f=i.targetColor,v=i.textureBlend,y=v===void 0?"normal":v,b=i.lineType,T=b===void 0?"solid":b,M=i.dashArray,O=M===void 0?[10,5]:M,F=i.lineTexture,$=F===void 0?!1:F,G=i.iconStep,ue=G===void 0?100:G,xe=i.segmentNumber,ze=xe===void 0?30:xe,Je=i.globalArcHeight,ht=Je===void 0?10:Je;O.length===2&&O.push(0,0);var gt=0,Ot=[0,0,0,0],tr=[0,0,0,0];return l&&f&&(Ot=fi(l),tr=fi(f),gt=1),this.rendererService.getDirty()&&this.texture.bind(),{u_globel:1,u_globel_radius:Z0,u_global_height:ht,u_opacity:s,u_textureBlend:y==="normal"?0:1,segmentNumber:ze,u_line_type:u3[T]||0,u_dash_array:O,u_texture:this.texture,u_line_texture:$?1:0,u_icon_step:ue,u_textSize:[1024,this.iconService.canvasHeight||128],u_linearColor:gt,u_sourceColor:Ot,u_targetColor:tr}}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption;return{u_animate:this.animateOption2Array(o),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"getShaders",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,s=i.targetColor;return o&&s?{frag:o3,vert:s3,type:"Linear"}:{frag:i3,vert:a3,type:""}}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return s=this.layer.getLayerConfig(),l=s.segmentNumber,f=l===void 0?30:l,v=this.getShaders(),y=v.frag,b=v.vert,T=v.type,F.next=4,this.layer.buildLayerModel({moduleName:"lineEarthArc3d"+T,vertexShader:b,fragmentShader:y,triangulation:Ag,depth:{enable:!0},styleOption:{segmentNumber:f}});case 4:return M=F.sent,F.abrupt("return",[M]);case 6:case"end":return F.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.size,f=l===void 0?1:l;return Array.isArray(f)?[f[0]]:[f]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:dn.Attribute,descriptor:{name:"a_Instance",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:4,update:function(s,l,f){return[f[3],f[4],f[5],f[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.texture,v=l[f]||{x:0,y:0},y=v.x,b=v.y;return[y,b]}}})}}]),t}(Ma),O1={circle:2,triangle:2,diamond:4,rect:2,classic:3,halfTriangle:2,none:0},Hl=1/2;function c3(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,o=i===void 0?1:i;return{vertices:[0,Hl*e,1*e*n,-(o+Hl)*e,1*e*n,(o-Hl)*e,0,Hl*e,1*e*n,-(o+Hl)*e,1*e*n,(o-Hl)*e],indices:[3,4,5],outLineIndices:[0,1,2],normals:[1*e,-2*e,1,-2*e,1.5*e,1,1*e,1.5*e,1,0,0,0,0,0,0,0,0,0],dimensions:2}}function f3(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,o=i===void 0?3:i;return{vertices:[0,0,1*e*n,1*o,1*e*n,-1*o,0,0,1*e*n,1*o,1*e*n,-1*o],outLineIndices:[0,1,2],indices:[3,4,5],normals:[0,-1.5*e,1,2,1*e,1,-2,1*e,1,0,0,0,0,0,0,0,0,0],dimensions:2}}function h3(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,o=i===void 0?2:i;return{vertices:[0,o/2,e*n*1,o/2,e*n*1,-o/2,0,-o/2,0,o/2,e*n*1,o/2,e*n*1,-o/2,0,-o/2],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-e,1,1,0,1,0,-e,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function p3(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,o=i===void 0?3:i;return{vertices:[0,0,1*n*e,.5*o,2*n*e,0,1*n*e,-.5*o,0,0,1*n*e,.5*o,2*n*e,0,1*n*e,-.5*o],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-e,1,1,0,1,0,-e,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function v3(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,o=i===void 0?3:i;return{vertices:[0,0,2*e*n,1*o,1.5*e*n,0,2*e*n,-1*o,0,0,2*e*n,1*o,1.5*e*n,0,2*e*n,-1*o],dimensions:2,indices:[4,5,6,4,6,7],outLineIndices:[0,1,2,0,2,3],normals:[0,-e,1,1,0,1,0,-e,1,-1,-0,1,0,0,0,0,0,0,0,0,0,0,0,0]}}function m3(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,o=i===void 0?2:i,s=H0(),l=fs().flatten([s]),f=fs()(l.vertices,l.holes,l.dimensions),v=s.map(function(y){return[y[0]*n*e,y[1]*o]}).flat();return{vertices:[].concat((0,Kt.Z)(v),(0,Kt.Z)(v)),dimensions:2,indices:f.map(function(y){return y+s.length}),outLineIndices:f,normals:[].concat((0,Kt.Z)(s.map(function(y){return[y[1]*o,y[0]*n*e,1]}).flat()),(0,Kt.Z)(new Array(s.length*3).fill(0)))}}function g3(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0,n=(0,cl.Z)(t.source)==="object"?t.source.type:t.source,i=(0,cl.Z)(t.target)==="object"?t.target.type:t.target,o=(0,cl.Z)(t.source)==="object"?t.source:{},s=o.width,l=s===void 0?n?O1[n]:0:s,f=o.height,v=f===void 0?2:f,y=(0,cl.Z)(t.target)==="object"?t.target:{},b=y.width,T=b===void 0?i?O1[i]:0:b,M=y.height,O=M===void 0?2:M;return{vertices:[0,Hl,1*l].concat((0,Kt.Z)(e),[1,Hl,-1*T],(0,Kt.Z)(e),[1,-Hl,-1*T],(0,Kt.Z)(e),[0,-Hl,1*l],(0,Kt.Z)(e),[0,Hl,1*l],(0,Kt.Z)(e),[1,Hl,-1*T],(0,Kt.Z)(e),[1,-Hl,-1*T],(0,Kt.Z)(e),[0,-Hl,1*l],(0,Kt.Z)(e)),outLineIndices:[0,1,2,0,2,3].map(function(F){return F+r}),indices:[4,5,6,4,6,7].map(function(F){return F+r}),normals:[1,-1,1,1,1,1,-1,0,1,-1,0,1,0,0,0,0,0,0,0,0,0,0,0,0],dimensions:2}}function D1(e,r){var t=(0,cl.Z)(e)==="object"?e.type:e,n=r==="source"?1:-1,i=(0,cl.Z)(e)==="object"?e:{};switch(t){case"circle":return m3(n,i);case"triangle":return f3(n,i);case"diamond":return p3(n,i);case"rect":return h3(n,i);case"classic":return v3(n,i);case"halfTriangle":return c3(n,i);default:return{vertices:[],indices:[],normals:[],dimensions:2,outLineIndices:[],outLineNormals:[]}}}function _3(e){var r=e.coordinates.flat(),t=1,n=1;return{vertices:[1,0,0].concat((0,Kt.Z)(r),[1,2,-3],(0,Kt.Z)(r),[1,1,-3],(0,Kt.Z)(r),[0,1,0],(0,Kt.Z)(r),[0,0,0],(0,Kt.Z)(r),[1,0,0],(0,Kt.Z)(r),[1,2,-3],(0,Kt.Z)(r),[1,1,-3],(0,Kt.Z)(r),[0,1,0],(0,Kt.Z)(r),[0,0,0],(0,Kt.Z)(r)),normals:[-t,2*n,1,2*n,-n,1,n,-n,1,n,-n,1,-t,-n,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],indices:[0,1,2,0,2,3,0,3,4,5,6,7,5,7,8,5,8,9],size:7}}function y3(e,r){return r?x3(e,r):_3(e)}function x3(e,r){var t=e.coordinates.flat(),n=r,i=n.target,o=i===void 0?"classic":i,s=n.source,l=s===void 0?"circle":s,f=F1(D1(l,"source"),t,0,0),v=g3(t,f.vertices.length/7,r),y=F1(D1(o,"target"),t,1,f.vertices.length/7+v.vertices.length/7),b={vertices:[].concat((0,Kt.Z)(f.vertices),(0,Kt.Z)(v.vertices),(0,Kt.Z)(y.vertices)),indices:[].concat((0,Kt.Z)(f.outLineIndices),(0,Kt.Z)(v.outLineIndices),(0,Kt.Z)(y.outLineIndices),(0,Kt.Z)(f.indices),(0,Kt.Z)(v.indices),(0,Kt.Z)(y.indices)),normals:[].concat((0,Kt.Z)(f.normals),(0,Kt.Z)(v.normals),(0,Kt.Z)(y.normals)),size:7};return b}function F1(e,r){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=[],o=e.vertices,s=e.indices,l=e.dimensions,f=e.outLineIndices,v=0;v<o.length;v+=l)i.push.apply(i,[t,o[v+1],o[v]].concat((0,Kt.Z)(r)));return(0,V.Z)((0,V.Z)({},e),{},{vertices:i,indices:s.map(function(y){return y+n}),outLineIndices:f.map(function(y){return y+n})})}function b3(e){var r=E3();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function E3(){if(typeof Reflect=="undefined"||!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(e){return!1}}var S3=`#extension GL_OES_standard_derivatives : enable
|
|
|
|
varying vec4 v_color;
|
|
|
|
|
|
// line texture
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
gl_FragColor = v_color;
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,A3=`attribute vec4 a_Color;
|
|
attribute vec2 a_Size;
|
|
attribute vec4 a_Instance;
|
|
attribute vec3 a_Normal;
|
|
attribute vec3 a_Position;
|
|
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
varying vec4 v_color;
|
|
uniform float u_gap_width: 1.0;
|
|
uniform float u_stroke_width: 1.0;
|
|
uniform float u_stroke_opacity: 1.0;
|
|
|
|
vec2 project_pixel_offset(vec2 offsets) {
|
|
|
|
vec2 data = project_pixel(offsets);
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
|
|
return data;
|
|
}
|
|
|
|
return vec2(data.x, -data.y);;
|
|
}
|
|
|
|
vec2 line_dir(vec2 target, vec2 source) {
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
|
|
return normalize(target - source);
|
|
}
|
|
return normalize(ProjectFlat(target) - ProjectFlat(source));
|
|
}
|
|
|
|
float flag_gap() {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
|
|
return 1.;
|
|
}
|
|
return -1.;
|
|
|
|
}
|
|
|
|
|
|
void main() {
|
|
|
|
// \u900F\u660E\u5EA6\u8BA1\u7B97
|
|
vec2 source = a_Instance.rg; // \u8D77\u59CB\u70B9
|
|
vec2 target = a_Instance.ba; // \u7EC8\u70B9
|
|
vec2 flowlineDir = line_dir(target,source);
|
|
vec2 perpendicularDir = vec2(flowlineDir.y, flowlineDir.x); // mapbox || \u9AD8\u5FB7
|
|
|
|
|
|
vec2 position = mix(source, target, a_Position.x);
|
|
|
|
float lengthCommon = length(project_position(vec4(target,0,1)) - project_position(vec4(source,0,1))); //
|
|
vec2 offsetDistances = a_Size.x * project_pixel_offset(vec2(a_Position.y, a_Position.z)); // Mapbox || \u9AD8\u5FB7
|
|
vec2 limitedOffsetDistances = clamp(
|
|
offsetDistances,
|
|
project_pixel(-lengthCommon*.2), project_pixel(lengthCommon*.2)
|
|
);
|
|
|
|
|
|
float startOffsetCommon = project_pixel(offsets[0]);
|
|
float endOffsetCommon = project_pixel(offsets[1]);
|
|
float endpointOffset = mix(
|
|
clamp(startOffsetCommon, 0.0, lengthCommon*.2),
|
|
-clamp(endOffsetCommon, 0.0, lengthCommon*.2),
|
|
a_Position.x
|
|
);
|
|
|
|
vec2 normalsCommon = u_stroke_width * project_pixel_offset(vec2(a_Normal.x, a_Normal.y)); // mapbox || \u9AD8\u5FB7
|
|
|
|
float gapCommon = flag_gap() * project_pixel(u_gap_width);
|
|
vec3 offsetCommon = vec3(
|
|
flowlineDir * (limitedOffsetDistances[1] + normalsCommon.y + endpointOffset * 1.05) -
|
|
perpendicularDir * (limitedOffsetDistances[0] + gapCommon + normalsCommon.x),
|
|
0.0
|
|
);
|
|
|
|
|
|
vec4 project_pos = project_position(vec4(position.xy, 0, 1.0));
|
|
|
|
vec4 fillColor = vec4(a_Color.rgb, a_Color.a * opacity);
|
|
v_color = mix(fillColor, vec4(u_stroke.xyz, u_stroke.w * fillColor.w * u_stroke_opacity), a_Normal.z);
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offsetCommon.xy, 0., 1.0));
|
|
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,T3=function(e){(0,Le.Z)(t,e);var r=b3(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.gapWidth,s=o===void 0?2:o,l=i.strokeWidth,f=l===void 0?1:l,v=i.stroke,y=v===void 0?"#000":v,b=i.strokeOpacity,T=b===void 0?1:b;return(0,V.Z)({u_gap_width:s,u_stroke_width:f,u_stroke:fi(y),u_stroke_opacity:T},this.getStyleAttribute())}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"flow_line",vertexShader:A3,fragmentShader:S3,inject:this.getInject(),triangulation:y3,styleOption:this.layer.getLayerConfig().symbol,primitive:R.TRIANGLES,depth:{enable:!1},pick:!1});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o){var s=o.size,l=s===void 0?1:s;return Array.isArray(l)?[l[0],l[1]]:[l,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:dn.Attribute,descriptor:{name:"a_Instance",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:4,update:function(o,s,l){return[l[3],l[4],l[5],l[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f,v){return v}}})}}]),t}(Ma);function w3(e){var r=C3();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function C3(){if(typeof Reflect=="undefined"||!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(e){return!1}}var R3=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
uniform float u_textureBlend;
|
|
uniform float u_blur : 0.9;
|
|
uniform float u_line_type: 0.0;
|
|
// varying vec2 v_normal;
|
|
varying vec4 v_dash_array;
|
|
varying float v_distance_ratio;
|
|
varying vec4 v_color;
|
|
|
|
uniform float u_time;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
|
|
uniform float u_line_texture: 0.0;
|
|
uniform sampler2D u_texture;
|
|
uniform vec2 u_textSize;
|
|
uniform float segmentNumber;
|
|
|
|
varying vec2 v_iconMapUV;
|
|
|
|
uniform float u_linearColor: 0;
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
varying vec4 v_line_data;
|
|
|
|
#pragma include "picking"
|
|
#pragma include "project"
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
|
|
float animateSpeed = 0.0;
|
|
float d_segmentIndex = v_line_data.g;
|
|
|
|
// \u8BBE\u7F6E\u5F27\u7EBF\u7684\u5E95\u8272
|
|
if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272
|
|
gl_FragColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);
|
|
gl_FragColor.a *= v_color.a;
|
|
} else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272
|
|
gl_FragColor = v_color;
|
|
}
|
|
|
|
// float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));
|
|
// float blur = smoothstep(1.0, u_blur, length(v_normal.xy));
|
|
if(u_line_type == LineTypeDash) {
|
|
float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {
|
|
// \u5B9E\u7EBF\u90E8\u5206
|
|
} else {
|
|
// \u865A\u7EBF\u90E8\u5206
|
|
discard;
|
|
};
|
|
}
|
|
|
|
// \u8BBE\u7F6E\u5F27\u7EBF\u7684\u52A8\u753B\u6A21\u5F0F
|
|
if(u_animate.x == Animate) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
alpha = smoothstep(0., 1., alpha);
|
|
gl_FragColor.a *= alpha;
|
|
}
|
|
|
|
// \u8BBE\u7F6E\u5F27\u7EBF\u7684\u8D34\u56FE
|
|
if(LineTexture == u_line_texture && u_line_type != LineTypeDash) {
|
|
float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0)));
|
|
// float arcRadio = d_segmentIndex / (segmentNumber - 1.0);
|
|
float count = v_line_data.b; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
|
|
float u = fract(arcRadio * count - animateSpeed * count);
|
|
// float u = fract(arcRadio * count - animateSpeed);
|
|
if(u_animate.x == Animate) {
|
|
u = gl_FragColor.a/v_color.a;
|
|
}
|
|
|
|
float v = v_line_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
|
|
|
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
vec4 pattern = texture2D(u_texture, uv);
|
|
|
|
// \u8BBE\u7F6E\u8D34\u56FE\u548C\u5E95\u8272\u7684\u53E0\u52A0\u6A21\u5F0F
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
gl_FragColor = filterColor(gl_FragColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(gl_FragColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
gl_FragColor = filterColor(pattern);
|
|
}
|
|
} else {
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
|
|
// gl_FragColor = filterColor(gl_FragColor);
|
|
}`,M3=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec4 a_Instance;
|
|
attribute float a_Size;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform float segmentNumber;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
varying vec4 v_color;
|
|
|
|
varying float v_distance_ratio;
|
|
uniform float u_line_type: 0.0;
|
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
varying vec4 v_dash_array;
|
|
|
|
uniform float u_icon_step: 100;
|
|
uniform float u_line_texture: 0.0;
|
|
|
|
attribute vec2 a_iconMapUV;
|
|
varying vec2 v_iconMapUV;
|
|
varying vec4 v_line_data;
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
float maps (float value, float start1, float stop1, float start2, float stop2) {
|
|
return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
|
|
}
|
|
|
|
float getSegmentRatio(float index) {
|
|
return index / (segmentNumber - 1.);
|
|
}
|
|
|
|
float paraboloid(vec2 source, vec2 target, float ratio) {
|
|
vec2 x = mix(source, target, ratio);
|
|
vec2 center = mix(source, target, 0.5);
|
|
float dSourceCenter = distance(source, center);
|
|
float dXCenter = distance(x, center);
|
|
return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);
|
|
}
|
|
|
|
vec3 getPos(vec2 source, vec2 target, float segmentRatio) {
|
|
float vertex_height = paraboloid(source, target, segmentRatio);
|
|
|
|
return vec3(
|
|
mix(source, target, segmentRatio),
|
|
sqrt(max(0.0, vertex_height))
|
|
);
|
|
}
|
|
vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size)/ 2.0;
|
|
return offset;
|
|
}
|
|
vec2 getNormal(vec2 line_clipspace, float offset_direction) {
|
|
// normalized direction of the line
|
|
vec2 dir_screenspace = normalize(line_clipspace);
|
|
// rotate by 90 degrees
|
|
dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
|
|
return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);
|
|
}
|
|
float getAngularDist (vec2 source, vec2 target) {
|
|
vec2 delta = source - target;
|
|
vec2 sin_half_delta = sin(delta / 2.0);
|
|
float a =
|
|
sin_half_delta.y * sin_half_delta.y +
|
|
cos(source.y) * cos(target.y) *
|
|
sin_half_delta.x * sin_half_delta.x;
|
|
return 2.0 * atan(sqrt(a), sqrt(1.0 - a));
|
|
}
|
|
|
|
vec2 midPoint(vec2 source, vec2 target) {
|
|
vec2 center = target - source;
|
|
float r = length(center);
|
|
float theta = atan(center.y, center.x);
|
|
float thetaOffset = 0.314;
|
|
float r2 = r / 2.0 / cos(thetaOffset);
|
|
float theta2 = theta + thetaOffset;
|
|
vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);
|
|
return mid;
|
|
}
|
|
float bezier3(vec3 arr, float t) {
|
|
float ut = 1. - t;
|
|
return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;
|
|
}
|
|
|
|
vec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {
|
|
// if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
vec2 mid = midPoint(source, target);
|
|
vec3 x = vec3(source.x, mid.x, target.x);
|
|
vec3 y = vec3(source.y, mid.y, target.y);
|
|
return vec2(bezier3(x ,t), bezier3(y,t));
|
|
}else {
|
|
if(abs(angularDist - PI) < 0.001) {
|
|
return (1.0 - t) * source + t * target;
|
|
}
|
|
float a = sin((1.0 - t) * angularDist) / sin(angularDist);
|
|
float b = sin(t * angularDist) / sin(angularDist);
|
|
vec2 sin_source = sin(source);
|
|
vec2 cos_source = cos(source);
|
|
vec2 sin_target = sin(target);
|
|
vec2 cos_target = cos(target);
|
|
float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;
|
|
float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;
|
|
float z = a * sin_source.y + b * sin_target.y;
|
|
return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
v_color = a_Color;
|
|
v_color.a = v_color.a * opacity;
|
|
vec2 source = radians(a_Instance.rg);
|
|
vec2 target = radians(a_Instance.ba);
|
|
float angularDist = getAngularDist(source, target);
|
|
float segmentIndex = a_Position.x;
|
|
float segmentRatio = getSegmentRatio(segmentIndex);
|
|
float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
|
|
|
|
if(u_line_type == LineTypeDash) {
|
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
vec2 s = source;
|
|
vec2 t = target;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
s = unProjCustomCoord(source);
|
|
t = unProjCustomCoord(target);
|
|
}
|
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
total_Distance = total_Distance*16.0; // total_Distance*16.0 \u8C03\u6574\u9ED8\u8BA4\u7684\u6548\u679C
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;
|
|
}
|
|
|
|
if(u_animate.x == Animate) {
|
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
}
|
|
|
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0));
|
|
vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0));
|
|
// v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);
|
|
vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));
|
|
// vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0));
|
|
// gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));
|
|
|
|
v_line_data.g = a_Position.x; // \u8BE5\u9876\u70B9\u5728\u5F27\u7EBF\u4E0A\u7684\u5206\u6BB5\u6392\u5E8F
|
|
if(LineTexture == u_line_texture) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F
|
|
// float mapZoomScale = u_CoordinateSystem !== COORDINATE_SYSTEM_P20_2?10000000.0:1.0;
|
|
float d_arcDistrance = length(source - target);
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap
|
|
d_arcDistrance = d_arcDistrance * 1000000.0;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox
|
|
d_arcDistrance = project_pixel_allmap(d_arcDistrance);
|
|
}
|
|
float d_pixelLen = project_pixel(u_icon_step)/8.0;
|
|
v_line_data.b = floor(d_arcDistrance/d_pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF
|
|
|
|
float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB
|
|
float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB
|
|
v_line_data.a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
|
|
|
|
v_iconMapUV = a_iconMapUV;
|
|
}
|
|
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(curr.xy + offset, 0, 1.0));
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
|
|
`,I3={solid:0,dash:1},P3=function(e){(0,Le.Z)(t,e);var r=w3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"updateTexture",function(){var l=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=l({data:n.iconService.getCanvas(),mag:R.NEAREST,min:R.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128})}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,s=i.targetColor,l=i.textureBlend,f=l===void 0?"normal":l,v=i.lineType,y=v===void 0?"solid":v,b=i.dashArray,T=b===void 0?[10,5]:b,M=i.lineTexture,O=M===void 0?!1:M,F=i.iconStep,$=F===void 0?100:F,G=i.segmentNumber,ue=G===void 0?30:G;T.length===2&&T.push(0,0),this.rendererService.getDirty()&&this.texture.bind();var xe=0,ze=[0,0,0,0],Je=[0,0,0,0];return o&&s&&(ze=fi(o),Je=fi(s),xe=1),(0,V.Z)({u_textureBlend:f==="normal"?0:1,segmentNumber:ue,u_line_type:I3[y]||0,u_dash_array:T,u_texture:this.texture,u_line_texture:O?1:0,u_icon_step:$,u_textSize:[1024,this.iconService.canvasHeight||128],u_linearColor:xe,u_sourceColor:ze,u_targetColor:Je},this.getStyleAttribute())}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption;return{u_animate:this.animateOption2Array(o),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.layer.getLayerConfig(),l=s.segmentNumber,f=l===void 0?30:l,b.next=3,this.layer.buildLayerModel({moduleName:"lineGreatCircle",vertexShader:M3,fragmentShader:R3,triangulation:Ag,styleOption:{segmentNumber:f},inject:this.getInject(),depth:{enable:!1}});case 3:return v=b.sent,b.abrupt("return",[v]);case 5:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.size,f=l===void 0?1:l;return Array.isArray(f)?[f[0]]:[f]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:dn.Attribute,descriptor:{name:"a_Instance",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:4,update:function(s,l,f){return[f[3],f[4],f[5],f[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.texture,v=l[f]||{x:0,y:0},y=v.x,b=v.y;return[y,b]}}})}}]),t}(Ma),TL=function(e){return e[e.solid=0]="solid",e[e.dash=1]="dash",e}({}),wg=function(e){return e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e}({}),O3=function(e){return e.NORMAL="normal",e.REPLACE="replace",e}({}),Y0=function(e){return e[e.pixel=0]="pixel",e[e.meter=1]="meter",e}({}),wL=function(e){return e.ALWAYS="always",e.DRAGEND="dragend",e}({});function D3(e){var r=F3();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function F3(){if(typeof Reflect=="undefined"||!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(e){return!1}}var k3=`#define LineTypeSolid 0.0
|
|
varying vec4 v_color;
|
|
|
|
// dash
|
|
varying vec4 v_dash_array;
|
|
varying float v_d_distance_ratio;
|
|
|
|
#pragma include "picking"
|
|
|
|
uniform float u_time;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // \u63A7\u5236\u8FD0\u52A8
|
|
|
|
// [animate, duration, interval, trailLength],
|
|
void main() {
|
|
|
|
gl_FragColor = v_color;
|
|
|
|
float dashLength = mod(v_d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);
|
|
if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {
|
|
// \u5B9E\u7EBF\u90E8\u5206
|
|
} else {
|
|
// \u865A\u7EBF\u90E8\u5206
|
|
discard;
|
|
};
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,B3=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
|
|
attribute float a_Miter;
|
|
attribute vec4 a_Color;
|
|
attribute vec2 a_Size;
|
|
attribute vec3 a_Normal;
|
|
attribute vec3 a_Position;
|
|
|
|
attribute vec2 a_iconMapUV;
|
|
|
|
// dash line
|
|
attribute float a_Total_Distance;
|
|
attribute vec2 a_DistanceAndIndex;
|
|
uniform float u_raisingHeight: 0.0;
|
|
uniform float u_heightfixed: 0.0;
|
|
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
|
|
uniform float u_vertexScale: 1.0;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
varying vec4 v_color;
|
|
varying vec4 v_dash_array;
|
|
varying float v_d_distance_ratio;
|
|
|
|
|
|
void main() {
|
|
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
|
|
vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);
|
|
vec2 offset = project_pixel(size.xy);
|
|
v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance;
|
|
|
|
|
|
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
|
|
|
|
float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5 vertex height
|
|
float lineHeight = a_Size.y; // size \u7B2C\u4E8C\u4E2A\u53C2\u6570\u4EE3\u8868\u7684\u9AD8\u5EA6 [linewidth, lineheight]
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
lineHeight *= 0.2; // \u4FDD\u6301\u548C amap/mapbox \u4E00\u81F4\u7684\u6548\u679C
|
|
h *= 0.2;
|
|
if(u_heightfixed < 1.0) {
|
|
lineHeight = project_pixel(a_Size.y);
|
|
}
|
|
gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0));
|
|
} else {
|
|
// mapbox - amap
|
|
|
|
// \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// mapbox
|
|
// \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
h *= mapboxZoomScale;
|
|
h += u_raisingHeight * mapboxZoomScale;
|
|
if(u_heightfixed > 0.0) {
|
|
lineHeight *= mapboxZoomScale;
|
|
}
|
|
|
|
} else {
|
|
// amap
|
|
h += u_raisingHeight;
|
|
// lineHeight \u9876\u70B9\u504F\u79FB\u9AD8\u5EA6
|
|
if(u_heightfixed < 1.0) {
|
|
lineHeight *= pow(2.0, 20.0 - u_Zoom);
|
|
}
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight + h, 1.0));
|
|
}
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,L3=`#extension GL_OES_standard_derivatives : enable
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
uniform float u_textureBlend;
|
|
|
|
uniform float u_strokeWidth: 0.0;
|
|
|
|
uniform vec3 u_blur;
|
|
varying vec4 v_color;
|
|
varying vec4 v_stroke;
|
|
|
|
// line texture
|
|
uniform float u_line_texture;
|
|
uniform sampler2D u_texture;
|
|
uniform vec2 u_textSize;
|
|
varying vec2 v_iconMapUV;
|
|
varying vec4 v_texture_data;
|
|
|
|
|
|
#pragma include "picking"
|
|
|
|
uniform float u_time;
|
|
uniform vec4 u_animate: [ 1, 2., 1.0, 0.2 ]; // \u63A7\u5236\u8FD0\u52A8
|
|
// [animate, duration, interval, trailLength],
|
|
void main() {
|
|
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
|
|
float d_distance_ratio = v_texture_data.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
|
|
gl_FragColor = v_color;
|
|
// anti-alias
|
|
// float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));
|
|
if(u_animate.x == Animate) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
alpha = smoothstep(0., 1., alpha);
|
|
gl_FragColor.a *= alpha;
|
|
}
|
|
|
|
if(u_line_texture == LineTexture) { // while load texture
|
|
float aDistance = v_texture_data.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB
|
|
float d_texPixelLen = v_texture_data.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E
|
|
float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);
|
|
float v = v_texture_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
|
|
|
|
// v = max(smoothstep(0.95, 1.0, v), v);
|
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
vec4 pattern = texture2D(u_texture, uv);
|
|
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
gl_FragColor += pattern;
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(gl_FragColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
gl_FragColor = pattern;
|
|
}
|
|
}
|
|
|
|
float v = v_texture_data.a;
|
|
float strokeWidth = min(0.5, u_strokeWidth);
|
|
// \u7ED8\u5236 border
|
|
if(strokeWidth > 0.01) {
|
|
float borderOuterWidth = strokeWidth / 2.0;
|
|
|
|
|
|
if(v >= 1.0 - strokeWidth || v <= strokeWidth) {
|
|
if(v > strokeWidth) { // \u5916\u4FA7
|
|
float linear = smoothstep(0.0, 1.0, (v - (1.0 - strokeWidth))/strokeWidth);
|
|
// float linear = step(0.0, (v - (1.0 - borderWidth))/borderWidth);
|
|
gl_FragColor.rgb = mix(gl_FragColor.rgb, v_stroke.rgb, linear);
|
|
} else if(v <= strokeWidth) {
|
|
float linear = smoothstep(0.0, 1.0, v/strokeWidth);
|
|
gl_FragColor.rgb = mix(v_stroke.rgb, gl_FragColor.rgb, linear);
|
|
}
|
|
}
|
|
|
|
if(v < borderOuterWidth) {
|
|
gl_FragColor.a = mix(0.0, gl_FragColor.a, v/borderOuterWidth);
|
|
} else if(v > 1.0 - borderOuterWidth) {
|
|
gl_FragColor.a = mix(gl_FragColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);
|
|
}
|
|
}
|
|
|
|
// blur
|
|
float blurV = v_texture_data.a;
|
|
if(blurV < 0.5) {
|
|
gl_FragColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5);
|
|
} else {
|
|
gl_FragColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5);
|
|
}
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,k1=`
|
|
#define Animate 0.0
|
|
|
|
attribute float a_Miter;
|
|
attribute vec4 a_Color;
|
|
attribute vec2 a_Size;
|
|
attribute vec3 a_Normal;
|
|
attribute vec3 a_Position;
|
|
|
|
attribute vec2 a_iconMapUV;
|
|
|
|
// dash line
|
|
attribute float a_Total_Distance;
|
|
attribute vec2 a_DistanceAndIndex;
|
|
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
uniform float u_icon_step: 100;
|
|
|
|
uniform float u_heightfixed: 0.0;
|
|
uniform float u_vertexScale: 1.0;
|
|
uniform float u_raisingHeight: 0.0;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
varying vec4 v_color;
|
|
varying vec4 v_stroke;
|
|
|
|
// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09
|
|
varying vec2 v_iconMapUV;
|
|
|
|
|
|
uniform float u_linearColor: 0;
|
|
uniform float u_arrow: 0.0;
|
|
uniform float u_arrowHeight: 3.0;
|
|
uniform float u_arrowWidth: 2.0;
|
|
uniform float u_tailWidth: 1.0;
|
|
|
|
varying vec4 v_texture_data;
|
|
|
|
vec2 calculateArrow(vec2 offset) {
|
|
/*
|
|
* \u5728\u652F\u6301\u7BAD\u5934\u7684\u65F6\u5019\uFF0C\u7B2C\u4E8C\u3001\u7B2C\u4E09\u7EC4\u9876\u70B9\u662F\u989D\u5916\u63D2\u5165\u7528\u4E8E\u6784\u5EFA\u9876\u70B9\u7684
|
|
*/
|
|
float arrowFlag = -1.0;
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// \u9AD8\u5FB7 2.0 \u7684\u65CB\u8F6C\u89D2\u5EA6\u4E0D\u540C
|
|
arrowFlag = 1.0;
|
|
}
|
|
float pi = arrowFlag * 3.1415926/2.;
|
|
if(a_Miter < 0.) {
|
|
// \u6839\u636E\u7EBF\u7684\u4E24\u4FA7\u504F\u79FB\u4E0D\u540C\u3001\u65CB\u8F6C\u7684\u65B9\u5411\u76F8\u53CD
|
|
pi = -pi;
|
|
}
|
|
highp float angle_sin = sin(pi);
|
|
highp float angle_cos = cos(pi);
|
|
// \u8BA1\u7B97\u5782\u76F4\u4E0E\u7EBF\u65B9\u5411\u7684\u65CB\u8F6C\u77E9\u9635
|
|
mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);
|
|
float arrowWidth = u_arrowWidth;
|
|
float arrowHeight = u_arrowHeight;
|
|
|
|
vec2 arrowOffset = vec2(0.0);
|
|
/*
|
|
* a_DistanceAndIndex.y \u7528\u4E8E\u6807\u8BB0\u5F53\u524D\u9876\u70B9\u5C5E\u4E8E\u54EA\u4E00\u7EC4\uFF08\u4E24\u4E2A\u9876\u70B9\u4E00\u7EC4\uFF0C\u6784\u6210\u7EBF\u7684\u5176\u5B9E\u662F\u77E9\u5F62\uFF0C\u6700\u7B80\u9700\u8981\u56DB\u4E2A\u9876\u70B9\u3001\u4E24\u7EC4\u9876\u70B9\u6784\u6210\uFF09
|
|
*/
|
|
if(a_DistanceAndIndex.y == 0.0) {
|
|
// \u7BAD\u5934\u5C16\u90E8
|
|
offset = vec2(0.0);
|
|
} else if(a_DistanceAndIndex.y == 1.0) {
|
|
// \u7BAD\u5934\u4E24\u4FA7
|
|
arrowOffset = rotation_matrix*(offset * arrowHeight);
|
|
offset += arrowOffset; // \u6CBF\u7EBF\u504F\u79FB
|
|
offset = offset * arrowWidth; // \u5782\u76F4\u7EBF\u5411\u5916\u504F\u79FB\uFF08\u662F\u6784\u5EFA\u7BAD\u5934\u4E24\u4FA7\u7684\u9876\u70B9\uFF09
|
|
} else if(a_DistanceAndIndex.y == 2.0 || a_DistanceAndIndex.y == 3.0 || a_DistanceAndIndex.y == 4.0) {
|
|
// \u504F\u79FB\u5176\u4F59\u7684\u70B9\u4F4D\uFF08\u5C06\u957F\u5EA6\u8BA9\u4F4D\u7ED9\u7BAD\u5934\uFF09
|
|
arrowOffset = rotation_matrix*(offset * arrowHeight) * arrowWidth;
|
|
offset += arrowOffset;// \u6CBF\u7EBF\u504F\u79FB
|
|
}
|
|
|
|
return offset;
|
|
}
|
|
|
|
void main() {
|
|
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
|
|
|
|
|
|
float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E
|
|
|
|
v_iconMapUV = a_iconMapUV;
|
|
d_texPixelLen = project_float_pixel(u_icon_step);
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
d_texPixelLen *= 10.0;
|
|
}
|
|
|
|
v_color = a_Color;
|
|
v_color.a *= opacity;
|
|
v_stroke = stroke;
|
|
|
|
vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);
|
|
|
|
vec2 offset = project_pixel(size.xy);
|
|
|
|
float lineDistance = a_DistanceAndIndex.x;
|
|
float currentLinePointRatio = lineDistance / a_Total_Distance;
|
|
|
|
if(u_arrow > 0.0) {
|
|
// \u8BA1\u7B97\u7BAD\u5934
|
|
offset = calculateArrow(offset);
|
|
|
|
if(a_DistanceAndIndex.y > 4.0) {
|
|
offset *= mix(1.0, u_tailWidth, currentLinePointRatio);
|
|
}
|
|
}
|
|
|
|
float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\uFF08\u5411\u4E24\u4FA7\u504F\u79FB\u7684\u548C\uFF09
|
|
float linePixelSize = project_pixel(a_Size.x) * 2.0; // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB \u5355\u4FA7 * 2
|
|
float texV = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
|
|
|
|
v_texture_data = vec4(currentLinePointRatio, lineDistance, d_texPixelLen, texV);
|
|
// \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570
|
|
|
|
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
|
|
|
|
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));
|
|
|
|
float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5 vertex height
|
|
float lineHeight = a_Size.y; // size \u7B2C\u4E8C\u4E2A\u53C2\u6570\u4EE3\u8868\u7684\u9AD8\u5EA6 [linewidth, lineheight]
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
lineHeight *= 0.2; // \u4FDD\u6301\u548C amap/mapbox \u4E00\u81F4\u7684\u6548\u679C
|
|
h *= 0.2;
|
|
if(u_heightfixed < 1.0) {
|
|
lineHeight = project_pixel(a_Size.y);
|
|
}
|
|
gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0));
|
|
} else {
|
|
// mapbox - amap
|
|
|
|
// \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// mapbox
|
|
// \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
h *= mapboxZoomScale;
|
|
h += u_raisingHeight * mapboxZoomScale;
|
|
if(u_heightfixed > 0.0) {
|
|
lineHeight *= mapboxZoomScale;
|
|
}
|
|
|
|
} else {
|
|
// amap
|
|
h += u_raisingHeight;
|
|
// lineHeight \u9876\u70B9\u504F\u79FB\u9AD8\u5EA6
|
|
if(u_heightfixed < 1.0) {
|
|
lineHeight *= pow(2.0, 20.0 - u_Zoom);
|
|
}
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight + h, 1.0));
|
|
}
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,N3=`varying vec4 v_color;
|
|
varying vec4 v_texture_data;
|
|
uniform float u_linearDir: 1.0;
|
|
uniform float u_linearColor: 0;
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
|
|
#pragma include "picking"
|
|
|
|
|
|
void main() {
|
|
float linearRadio = v_texture_data.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
|
|
if(u_linearDir < 1.0) {
|
|
linearRadio = v_texture_data.a;
|
|
}
|
|
|
|
if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272
|
|
gl_FragColor = mix(u_sourceColor, u_targetColor, linearRadio);
|
|
gl_FragColor.a *= v_color.a;
|
|
} else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272
|
|
gl_FragColor = v_color;
|
|
}
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,U3={solid:0,dash:1},B1=function(e){(0,Le.Z)(t,e);var r=D3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"textureEventFlag",!1),(0,B.Z)((0,Fe.Z)(n),"texture",n.createTexture2D({data:[0,0,0,0],mag:R.NEAREST,min:R.NEAREST,premultiplyAlpha:!1,width:1,height:1})),(0,B.Z)((0,Fe.Z)(n),"updateTexture",function(){var l=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=l({data:n.iconService.getCanvas(),mag:R.NEAREST,min:R.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128})}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,s=i.targetColor,l=i.textureBlend,f=l===void 0?"normal":l,v=i.lineType,y=v===void 0?"solid":v,b=i.dashArray,T=b===void 0?[10,5,0,0]:b,M=i.lineTexture,O=M===void 0?!1:M,F=i.iconStep,$=F===void 0?100:F,G=i.vertexHeightScale,ue=G===void 0?20:G,xe=i.strokeWidth,ze=xe===void 0?0:xe,Je=i.raisingHeight,ht=Je===void 0?0:Je,gt=i.heightfixed,Ot=gt===void 0?!1:gt,tr=i.linearDir,Ir=tr===void 0?wg.VERTICAL:tr,Er=i.blur,mn=Er===void 0?[1,1,1]:Er;T.length===2&&T.push(0,0),this.rendererService.getDirty()&&this.texture&&this.texture.bind();var Ln=0,Fi=[0,0,0,0],xa=[0,0,0,0];return o&&s&&(Fi=fi(o),xa=fi(s),Ln=1),(0,V.Z)({u_textureBlend:f===O3.NORMAL?0:1,u_line_type:U3[y],u_dash_array:T,u_blur:mn,u_texture:this.texture,u_line_texture:O?1:0,u_icon_step:$,u_textSize:[1024,this.iconService.canvasHeight||128],u_strokeWidth:ze,u_linearDir:Ir===wg.VERTICAL?1:0,u_linearColor:Ln,u_sourceColor:Fi,u_targetColor:xa,u_heightfixed:Number(Ot),u_vertexScale:ue,u_raisingHeight:Number(ht)},this.getStyleAttribute())}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption;return{u_animate:this.animateOption2Array(o),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.textureEventFlag||(this.textureEventFlag=!0,this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture)),l.abrupt("return",this.buildModels());case 2:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return s=this.layer.getLayerConfig(),l=s.depth,f=l===void 0?!1:l,v=this.getShaders(),y=v.frag,b=v.vert,T=v.type,this.layer.triangulation=jp,F.next=5,this.layer.buildLayerModel({moduleName:"line"+T,vertexShader:b,fragmentShader:y,triangulation:jp,inject:this.getInject(),depth:{enable:f}});case 5:return M=F.sent,F.abrupt("return",[M]);case 7:case"end":return F.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,s=i.targetColor,l=i.lineType;return l==="dash"?{frag:k3,vert:B3,type:"Dash"}:o&&s?{frag:N3,vert:k1,type:"Linear"}:{frag:L3,vert:k1,type:""}}},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"distanceAndIndex",type:dn.Attribute,descriptor:{name:"a_DistanceAndIndex",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(s,l,f,v,y,b){return b===void 0?[f[3],10]:[f[3],b]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:dn.Attribute,descriptor:{name:"a_Total_Distance",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s,l,f){return[f[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(s){var l=s.size,f=l===void 0?1:l;return Array.isArray(f)?[f[0],f[1]]:[f,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(s,l,f,v,y){return y}}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:dn.Attribute,descriptor:{name:"a_Miter",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s,l,f){return[f[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.texture,v=l[f]||{x:0,y:0},y=v.x,b=v.y;return[y,b]}}})}}]),t}(Ma);function z3(e){var r=Z3();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function Z3(){if(typeof Reflect=="undefined"||!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(e){return!1}}var V3=`
|
|
varying vec4 v_Color;
|
|
#pragma include "picking"
|
|
void main() {
|
|
|
|
gl_FragColor = v_Color; // \u5168\u5C40\u900F\u660E\u5EA6
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,j3=`
|
|
attribute float a_Miter;
|
|
attribute vec2 a_Size;
|
|
attribute vec3 a_Normal;
|
|
attribute vec3 a_Position;
|
|
|
|
// dash line
|
|
attribute float a_Total_Distance;
|
|
attribute vec2 a_DistanceAndIndex;
|
|
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
uniform float u_heightfixed: 0.0;
|
|
uniform float u_vertexScale: 1.0;
|
|
uniform float u_raisingHeight: 0.0;
|
|
uniform sampler2D u_texture;
|
|
uniform float u_linearDir: 1.0;
|
|
varying vec4 v_Color;
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
|
|
void main() {
|
|
|
|
|
|
vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);
|
|
|
|
vec2 offset = project_pixel(size.xy);
|
|
|
|
float lineDistance = a_DistanceAndIndex.x;
|
|
float currentLinePointRatio = lineDistance / a_Total_Distance;
|
|
|
|
|
|
float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\uFF08\u5411\u4E24\u4FA7\u504F\u79FB\u7684\u548C\uFF09
|
|
float linePixelSize = project_pixel(a_Size.x) * 2.0; // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB \u5355\u4FA7 * 2
|
|
float texV = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
|
|
|
|
float linearRadio =currentLinePointRatio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
|
|
if(u_linearDir < 1.0) {
|
|
linearRadio = texV;
|
|
}
|
|
|
|
v_Color = texture2D(u_texture, vec2(linearRadio, 0.5));
|
|
|
|
v_Color.a *= opacity; // \u5168\u5C40\u900F\u660E\u5EA6
|
|
|
|
|
|
|
|
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
|
|
|
|
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));
|
|
|
|
float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5 vertex height
|
|
float lineHeight = a_Size.y; // size \u7B2C\u4E8C\u4E2A\u53C2\u6570\u4EE3\u8868\u7684\u9AD8\u5EA6 [linewidth, lineheight]
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
lineHeight *= 0.2; // \u4FDD\u6301\u548C amap/mapbox \u4E00\u81F4\u7684\u6548\u679C
|
|
h *= 0.2;
|
|
if(u_heightfixed < 1.0) {
|
|
lineHeight = project_pixel(a_Size.y);
|
|
}
|
|
gl_Position = u_Mvp * (vec4(project_pos.xy + offset, lineHeight + h + u_raisingHeight, 1.0));
|
|
} else {
|
|
// mapbox - amap
|
|
|
|
// \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// mapbox
|
|
// \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
h *= mapboxZoomScale;
|
|
h += u_raisingHeight * mapboxZoomScale;
|
|
if(u_heightfixed > 0.0) {
|
|
lineHeight *= mapboxZoomScale;
|
|
}
|
|
|
|
} else {
|
|
// amap
|
|
h += u_raisingHeight;
|
|
// lineHeight \u9876\u70B9\u504F\u79FB\u9AD8\u5EA6
|
|
if(u_heightfixed < 1.0) {
|
|
lineHeight *= pow(2.0, 20.0 - u_Zoom);
|
|
}
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, lineHeight + h, 1.0));
|
|
}
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,CL=oi.isNumber,H3=function(e){(0,Le.Z)(t,e);var r=z3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"updateTexture",function(){var l=n.rendererService.createTexture2D;n.colorTexture&&n.colorTexture.destroy();var f=n.layer.getLayerConfig(),v=f.rampColors,y=Ao(v);n.colorTexture=l({data:new Uint8Array(y.data),width:y.width,height:y.height,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE,min:R.NEAREST,mag:R.NEAREST,flipY:!1})}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.vertexHeightScale,f=l===void 0?20:l,v=i.raisingHeight,y=v===void 0?0:v,b=i.heightfixed,T=b===void 0?!1:b,M=i.linearDir,O=M===void 0?wg.VERTICAL:M;return this.rendererService.getDirty()&&this.colorTexture.bind(),(0,V.Z)({u_linearDir:O===wg.VERTICAL?1:0,u_texture:this.colorTexture,u_heightfixed:Number(T),u_vertexScale:f,u_raisingHeight:Number(y)},this.getStyleAttribute())}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.updateTexture(),l.abrupt("return",this.buildModels());case 2:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.colorTexture)===null||i===void 0||i.destroy()}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.layer.getLayerConfig(),l=s.depth,f=l===void 0?!1:l,this.layer.triangulation=G0,b.next=4,this.layer.buildLayerModel({moduleName:"lineRampColors",vertexShader:j3,fragmentShader:V3,triangulation:G0,inject:this.getInject(),depth:{enable:f}});case 4:return v=b.sent,b.abrupt("return",[v]);case 6:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"distanceAndIndex",type:dn.Attribute,descriptor:{name:"a_DistanceAndIndex",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l,f,v,y){return y===void 0?[l[3],10]:[l[3],y]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:dn.Attribute,descriptor:{name:"a_Total_Distance",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o,s,l){return[l[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o){var s=o.size,l=s===void 0?1:s;return Array.isArray(l)?[l[0],l[1]]:[l,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f,v){return v}}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:dn.Attribute,descriptor:{name:"a_Miter",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o,s,l){return[l[4]]}}})}}]),t}(Ma);function W3(e){var r=G3();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function G3(){if(typeof Reflect=="undefined"||!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(e){return!1}}var X3=`
|
|
varying vec4 v_color;
|
|
void main() {
|
|
gl_FragColor = v_color;
|
|
|
|
}
|
|
`,$3=`uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
varying float v_distanceScale;
|
|
varying vec4 v_color;
|
|
void main() {
|
|
gl_FragColor = mix(u_sourceColor, u_targetColor, v_distanceScale);
|
|
gl_FragColor.a *= v_color.a; // \u5168\u5C40\u900F\u660E\u5EA6
|
|
}
|
|
`,L1=`attribute vec4 a_Color;
|
|
attribute vec2 a_Size;
|
|
attribute vec3 a_Position;
|
|
|
|
attribute float a_Total_Distance;
|
|
attribute float a_Distance;
|
|
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
uniform float u_vertexScale: 1.0;
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
|
|
|
|
|
|
#pragma include "projection"
|
|
|
|
varying vec4 v_color;
|
|
varying float v_distanceScale;
|
|
|
|
void main() {
|
|
|
|
v_color = a_Color;
|
|
v_distanceScale = a_Distance / a_Total_Distance;
|
|
v_color.a = v_color.a * opacity;
|
|
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
|
|
|
|
float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * (vec4(project_pos.xy, project_pixel(a_Size.y) + h * 0.2, 1.0));
|
|
} else {
|
|
float lineHeight = a_Size.y;
|
|
// \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
// \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8
|
|
h *= 2.0/pow(2.0, 20.0 - u_Zoom);
|
|
}
|
|
|
|
// amap1.x
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8
|
|
lineHeight *= pow(2.0, 20.0 - u_Zoom);
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, lineHeight + h, 1.0));
|
|
gl_PointSize = 10.0;
|
|
}
|
|
}
|
|
`,RL=oi.isNumber,Y3=function(e){(0,Le.Z)(t,e);var r=W3(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.sourceColor,f=i.targetColor,v=i.vertexHeightScale,y=v===void 0?20:v,b=0,T=[0,0,0,0],M=[0,0,0,0];return l&&f&&(T=fi(l),M=fi(f),b=1),(0,V.Z)({u_linearColor:b,u_sourceColor:T,u_targetColor:M,u_vertexScale:y},this.getStyleAttribute())}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,s=i.targetColor;return o&&s?{frag:$3,vert:L1,type:"lineSimpleLinear"}:{frag:X3,vert:L1,type:"lineSimpleNormal"}}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return s=this.getShaders(),l=s.frag,f=s.vert,v=s.type,T.next=3,this.layer.buildLayerModel({moduleName:v,vertexShader:f,fragmentShader:l,triangulation:Lw,inject:this.getInject(),primitive:R.LINES,depth:{enable:!1},pick:!1});case 3:return y=T.sent,T.abrupt("return",[y]);case 5:case"end":return T.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"distance",type:dn.Attribute,descriptor:{name:"a_Distance",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o,s,l){return[l[3]]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:dn.Attribute,descriptor:{name:"a_Total_Distance",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o,s,l){return[l[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o){var s=o.size,l=s===void 0?1:s;return Array.isArray(l)?[l[0],l[1]]:[l,0]}}})}}]),t}(Ma);function q3(e){var r=K3();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function K3(){if(typeof Reflect=="undefined"||!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(e){return!1}}var Q3=`#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
// line texture
|
|
uniform float u_line_texture;
|
|
uniform sampler2D u_texture;
|
|
uniform vec2 u_textSize;
|
|
uniform float u_linearColor: 0;
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
uniform float u_textureBlend;
|
|
uniform float u_iconStepCount;
|
|
uniform float u_time;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // \u63A7\u5236\u8FD0\u52A8
|
|
|
|
varying vec2 v_iconMapUV;
|
|
varying float v_blur;
|
|
varying float v_radio;
|
|
varying vec4 v_color;
|
|
varying vec4 v_dataset;
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
|
|
float d_distance_ratio = v_dataset.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
|
|
float v = v_dataset.a;
|
|
|
|
if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272
|
|
gl_FragColor = mix(u_sourceColor, u_targetColor, v);
|
|
} else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272
|
|
gl_FragColor = v_color;
|
|
}
|
|
|
|
gl_FragColor.a *= v_color.a; // \u5168\u5C40\u900F\u660E\u5EA6
|
|
if(u_animate.x == Animate) {
|
|
animateSpeed = u_time / u_animate.y;
|
|
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);
|
|
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
alpha = smoothstep(0., 1., alpha);
|
|
gl_FragColor.a *= alpha;
|
|
}
|
|
|
|
if(u_line_texture == LineTexture) { // while load texture
|
|
float aDistance = v_dataset.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB
|
|
float d_texPixelLen = v_dataset.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E
|
|
float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);
|
|
float v = v_dataset.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C
|
|
|
|
// \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 start
|
|
float flag = 0.0;
|
|
if(u > 1.0/u_iconStepCount) {
|
|
flag = 1.0;
|
|
}
|
|
u = fract(u*u_iconStepCount);
|
|
// \u8BA1\u7B97\u7EB9\u7406\u95F4\u9694 end
|
|
|
|
vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
|
|
vec4 pattern = texture2D(u_texture, uv);
|
|
|
|
// Tip: \u5224\u65AD\u7EB9\u7406\u95F4\u9694
|
|
if(flag > 0.0) {
|
|
pattern = vec4(0.0);
|
|
}
|
|
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
gl_FragColor = filterColor(gl_FragColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(gl_FragColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
gl_FragColor = filterColor(pattern);
|
|
}
|
|
}
|
|
|
|
|
|
// blur - AA
|
|
if(v < v_blur) {
|
|
gl_FragColor.a = mix(0.0, gl_FragColor.a, v/v_blur);
|
|
} else if(v > 1.0 - v_blur) {
|
|
gl_FragColor.a = mix(gl_FragColor.a, 0.0, (v - (1.0 - v_blur))/v_blur);
|
|
}
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,J3=`#define Animate 0.0
|
|
|
|
attribute float a_Miter;
|
|
attribute vec4 a_Color;
|
|
attribute vec2 a_Size;
|
|
attribute vec3 a_Normal;
|
|
attribute vec3 a_Position;
|
|
attribute vec2 a_iconMapUV;
|
|
attribute float a_Total_Distance;
|
|
attribute float a_Distance;
|
|
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
uniform float u_icon_step: 100;
|
|
uniform float u_heightfixed;
|
|
uniform float u_linearColor: 0;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09
|
|
varying vec2 v_iconMapUV;
|
|
varying vec4 v_color;
|
|
varying float v_blur;
|
|
varying float v_radio;
|
|
varying vec4 v_dataset;
|
|
|
|
void main() {
|
|
|
|
|
|
float d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
|
|
float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E
|
|
|
|
v_iconMapUV = a_iconMapUV;
|
|
if(u_heightfixed < 1.0) { // \u9AD8\u5EA6\u968F zoom \u8C03\u6574
|
|
d_texPixelLen = project_pixel(u_icon_step);
|
|
} else {
|
|
d_texPixelLen = u_icon_step;
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
d_texPixelLen *= 10.0;
|
|
}
|
|
|
|
if(u_animate.x == Animate || u_linearColor == 1.0) {
|
|
d_distance_ratio = a_Distance / a_Total_Distance;
|
|
}
|
|
|
|
float miter = (a_Miter + 1.0)/2.0;
|
|
// \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570
|
|
v_dataset[0] = d_distance_ratio; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B
|
|
v_dataset[1] = a_Distance; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB
|
|
v_dataset[2] = d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E
|
|
v_dataset[3] = miter; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C 0 - 1
|
|
|
|
vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
|
|
|
|
float originSize = a_Size.x; // \u56FA\u5B9A\u9AD8\u5EA6
|
|
if(u_heightfixed < 1.0) {
|
|
originSize = project_float_meter(a_Size.x); // \u9AD8\u5EA6\u968F zoom \u8C03\u6574
|
|
}
|
|
|
|
|
|
float wallHeight = originSize * miter;
|
|
float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));
|
|
|
|
v_blur = min(project_float_pixel(2.0) / originSize, 0.05);
|
|
v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));
|
|
} else {
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));
|
|
}
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,eR=function(e){(0,Le.Z)(t,e);var r=q3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"updateTexture",function(){var l=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=l({data:n.iconService.getCanvas(),mag:R.NEAREST,min:R.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128})}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.sourceColor,s=i.targetColor,l=i.textureBlend,f=l===void 0?"normal":l,v=i.heightfixed,y=v===void 0?!1:v,b=i.lineTexture,T=b===void 0?!1:b,M=i.iconStep,O=M===void 0?100:M,F=i.iconStepCount,$=F===void 0?1:F;this.rendererService.getDirty()&&this.texture.bind();var G=0,ue=[0,0,0,0],xe=[0,0,0,0];return o&&s&&(ue=fi(o),xe=fi(s),G=1),(0,V.Z)({u_heightfixed:Number(y),u_textureBlend:f==="normal"?0:1,u_texture:this.texture,u_line_texture:T?1:0,u_iconStepCount:$,u_icon_step:O,u_textSize:[1024,this.iconService.canvasHeight||128],u_linearColor:G,u_sourceColor:ue,u_targetColor:xe},this.getStyleAttribute())}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption;return{u_animate:this.animateOption2Array(o),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"lineWall",vertexShader:J3,fragmentShader:Q3,triangulation:G0,inject:this.getInject(),depth:{enable:!1},blend:this.getBlend()});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"distance",type:dn.Attribute,descriptor:{name:"a_Distance",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s,l,f){return[f[3]]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:dn.Attribute,descriptor:{name:"a_Total_Distance",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s,l,f){return[f[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(s){var l=s.size,f=l===void 0?1:l;return Array.isArray(f)?[f[0],f[1]]:[f,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(s,l,f,v,y){return y}}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:dn.Attribute,descriptor:{name:"a_Miter",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s,l,f){return[f[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_iconMapUV",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.texture,v=l[f]||{x:0,y:0},y=v.x,b=v.y;return[y,b]}}})}}]),t}(Ma),tR={arc:XC,arc3d:t3,greatcircle:P3,wall:eR,line:B1,simple:Y3,linearline:H3,earthArc3d:l3,flowline:T3},rR=tR;function nR(e){var r=iR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function iR(){if(typeof Reflect=="undefined"||!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(e){return!1}}var q0=function(e){(0,Le.Z)(t,e);var r=nR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"type","LineLayer"),(0,B.Z)((0,Fe.Z)(n),"enableShaderEncodeStyles",["opacity","offsets","stroke","thetaOffset"]),(0,B.Z)((0,Fe.Z)(n),"arrowInsertCount",0),(0,B.Z)((0,Fe.Z)(n),"defaultSourceConfig",{data:[{lng1:100,lat1:30,lng2:130,lat2:30}],options:{parser:{type:"json",x:"lng1",y:"lat1",x1:"lng2",y1:"lat2"}}}),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel=new rR[s](this),f.next=4,this.initLayerModels();case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),o={line:{},linearline:{},simple:{},wall:{},arc3d:{blend:"additive"},arc:{blend:"additive"},greatcircle:{blend:"additive"},tileLine:{},earthArc3d:{},flowline:{},arrow:{}};return o[i]}},{key:"getModelType",value:function(){var i;if(this.layerType)return this.layerType;var o=this.styleAttributeService.getLayerStyleAttribute("shape"),s=o==null||(i=o.scale)===null||i===void 0?void 0:i.field;return s||"line"}},{key:"processData",value:function(i){if(this.getModelType()!=="simple")return i;var o=[];return i.map(function(s){if(Array.isArray(s.coordinates)&&Array.isArray(s.coordinates[0])&&Array.isArray(s.coordinates[0][0])){var l=(0,V.Z)({},s);s.coordinates.map(function(f){o.push((0,V.Z)((0,V.Z)({},l),{},{coordinates:f}))})}else o.push(s)}),o}}]),t}(Ip);function aR(e){var r=oR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function oR(){if(typeof Reflect=="undefined"||!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(e){return!1}}var sR=`
|
|
uniform float u_additive;
|
|
uniform float u_stroke_opacity : 1;
|
|
|
|
uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
|
|
varying vec4 v_color;
|
|
varying float v_blur;
|
|
varying float v_innerRadius;
|
|
|
|
#pragma include "picking"
|
|
void main() {
|
|
vec2 center = vec2(0.5);
|
|
|
|
// Tip: \u7247\u5143\u5230\u4E2D\u5FC3\u70B9\u7684\u8DDD\u79BB 0 - 1
|
|
float fragmengTocenter = distance(center, gl_PointCoord) * 2.0;
|
|
// Tip: \u7247\u5143\u7684\u526A\u5207\u6210\u5706\u5F62
|
|
float circleClipOpacity = 1.0 - smoothstep(v_blur, 1.0, fragmengTocenter);
|
|
|
|
|
|
if(v_innerRadius < 0.99) {
|
|
// \u5F53\u5B58\u5728 stroke \u4E14 stroke > 0.01
|
|
float blurWidth = (1.0 - v_blur)/2.0;
|
|
vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);
|
|
if(fragmengTocenter > v_innerRadius + blurWidth) {
|
|
gl_FragColor = stroke;
|
|
} else if(fragmengTocenter > v_innerRadius - blurWidth){
|
|
float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);
|
|
gl_FragColor = mix(v_color, stroke, mixR);
|
|
} else {
|
|
gl_FragColor = v_color;
|
|
}
|
|
} else {
|
|
// \u5F53\u4E0D\u5B58\u5728 stroke \u6216 stroke <= 0.01
|
|
gl_FragColor = v_color;
|
|
}
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
|
|
if(u_additive > 0.0) {
|
|
gl_FragColor *= circleClipOpacity;
|
|
} else {
|
|
gl_FragColor.a *= circleClipOpacity;
|
|
}
|
|
|
|
}
|
|
`,uR=`
|
|
attribute vec3 a_Position;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
attribute float a_Size;
|
|
attribute vec4 a_Color;
|
|
varying vec4 v_color;
|
|
|
|
uniform float u_opacity : 1;
|
|
uniform vec2 u_offsets;
|
|
uniform float u_stroke_width;
|
|
|
|
varying float v_blur;
|
|
varying float v_innerRadius;
|
|
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
#pragma include "project"
|
|
void main() {
|
|
v_color = vec4(a_Color.xyz, a_Color.w * u_opacity);
|
|
v_blur = 1.0 - max(2.0/a_Size, 0.05);
|
|
v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0);
|
|
|
|
vec2 offset = project_pixel(u_offsets);
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * vec4(a_Position.xy + offset, a_Position.z, 1.0);
|
|
} else { // else
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);
|
|
gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));
|
|
}
|
|
|
|
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`;function N1(e){var r=e.coordinates;return{vertices:(0,Kt.Z)(r),indices:[0],size:r.length}}var lR=function(e){(0,Le.Z)(t,e);var r=aR(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getDefaultStyle",value:function(){return{blend:"additive"}}},{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.offsets,f=l===void 0?[0,0]:l,v=i.blend,y=i.strokeOpacity,b=y===void 0?1:y,T=i.strokeWidth,M=T===void 0?0:T,O=i.stroke,F=O===void 0?"#fff":O;return{u_additive:v==="additive"?1:0,u_opacity:s,u_offsets:f,u_stroke_opacity:b,u_stroke_width:M,u_stroke_color:fi(F)}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.layer.triangulation=N1,f.next=3,this.layer.buildLayerModel({moduleName:"pointSimple",vertexShader:uR,fragmentShader:sR,triangulation:N1,depth:{enable:!1},primitive:R.POINTS});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?1:s;return Array.isArray(l)?[l[0]]:[l]}}})}}]),t}(Ma);function cR(e){var r=fR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function fR(){if(typeof Reflect=="undefined"||!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(e){return!1}}var hR=`varying vec4 v_color;
|
|
uniform float u_opacity: 1.0;
|
|
|
|
uniform float u_pickLight: 0.0;
|
|
|
|
#pragma include "picking"
|
|
|
|
|
|
uniform float u_linearColor: 0;
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
|
|
uniform float u_opacitylinear: 0.0;
|
|
uniform float u_opacitylinear_dir: 1.0;
|
|
varying float v_lightWeight;
|
|
varying float v_barLinearZ;
|
|
void main() {
|
|
|
|
gl_FragColor = v_color;
|
|
|
|
// \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8
|
|
if(u_opacitylinear > 0.0) {
|
|
gl_FragColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ;
|
|
}
|
|
|
|
// picking
|
|
if(u_pickLight > 0.0) {
|
|
gl_FragColor = filterColorAlpha(gl_FragColor, v_lightWeight);
|
|
} else {
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
}
|
|
`,pR=`precision highp float;
|
|
|
|
#define pi 3.1415926535
|
|
#define ambientRatio 0.5
|
|
#define diffuseRatio 0.3
|
|
#define specularRatio 0.2
|
|
|
|
attribute vec3 a_Position;
|
|
attribute vec3 a_Pos;
|
|
attribute vec4 a_Color;
|
|
attribute vec3 a_Size;
|
|
attribute vec3 a_Normal;
|
|
|
|
uniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
uniform float u_globel;
|
|
uniform float u_r;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
varying vec4 v_color;
|
|
|
|
uniform float u_opacity : 1;
|
|
uniform float u_lightEnable: 1;
|
|
varying float v_lightWeight;
|
|
varying float v_barLinearZ;
|
|
// \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
float getYRadian(float x, float z) {
|
|
if(x > 0.0 && z > 0.0) {
|
|
return atan(x/z);
|
|
} else if(x > 0.0 && z <= 0.0){
|
|
return atan(-z/x) + pi/2.0;
|
|
} else if(x <= 0.0 && z <= 0.0) {
|
|
return pi + atan(x/z); //atan(x/z) +
|
|
} else {
|
|
return atan(z/-x) + pi*3.0/2.0;
|
|
}
|
|
}
|
|
|
|
float getXRadian(float y, float r) {
|
|
return atan(y/r);
|
|
}
|
|
|
|
void main() {
|
|
|
|
|
|
float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF
|
|
|
|
textureOffset = opacityAndOffset.g;
|
|
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
|
|
vec3 size = a_Size * a_Position;
|
|
|
|
// a_Position.z \u662F\u5728\u6784\u5EFA\u7F51\u683C\u7684\u65F6\u5019\u4F20\u5165\u7684\u6807\u51C6\u503C 0 - 1\uFF0C\u5728\u63D2\u503C\u5668\u63D2\u503C\u53EF\u4EE5\u83B7\u53D6 0\uFF5E1 \u7EBF\u6027\u6E10\u53D8\u7684\u503C
|
|
v_barLinearZ = a_Position.z;
|
|
|
|
vec3 offset = size; // \u63A7\u5236\u5706\u67F1\u4F53\u7684\u5927\u5C0F - \u4ECE\u6807\u51C6\u5355\u4F4D\u5706\u67F1\u4F53\u8FDB\u884C\u504F\u79FB
|
|
if(u_heightfixed < 1.0) { // \u5706\u67F1\u4F53\u4E0D\u56FA\u5B9A\u9AD8\u5EA6
|
|
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
|
|
offset = offset * pow(2.0, (19.0 - u_Zoom));
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
|
|
offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));
|
|
}
|
|
} else {// \u5706\u67F1\u4F53\u56FA\u5B9A\u9AD8\u5EA6 \uFF08 \u5904\u7406 mapbox \uFF09
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
offset *= 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
}
|
|
}
|
|
|
|
|
|
vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));
|
|
|
|
// u_r \u63A7\u5236\u5706\u67F1\u7684\u751F\u957F
|
|
vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);
|
|
|
|
// \u5706\u67F1\u5149\u7167\u6548\u679C
|
|
float lightWeight = 1.0;
|
|
if(u_lightEnable > 0.0) { // \u53D6\u6D88\u4E09\u5143\u8868\u8FBE\u5F0F\uFF0C\u589E\u5F3A\u5065\u58EE\u6027
|
|
lightWeight = calc_lighting(pos);
|
|
}
|
|
v_lightWeight = lightWeight;
|
|
// \u8BBE\u7F6E\u5706\u67F1\u7684\u5E95\u8272
|
|
if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272
|
|
v_color = mix(u_sourceColor, u_targetColor, barLinearZ);
|
|
v_color.rgb *= lightWeight;
|
|
} else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272
|
|
v_color = a_Color;
|
|
}
|
|
v_color.a *= u_opacity;
|
|
|
|
|
|
// \u5728\u5730\u7403\u6A21\u5F0F\u4E0B\uFF0C\u5C06\u539F\u672C\u5782\u76F4\u4E8E xy \u5E73\u9762\u7684\u5706\u67F1\u8C03\u6574\u59FF\u6001\u5230\u9002\u5E94\u5706\u7684\u89D2\u5EA6
|
|
//\u65CB\u8F6C\u77E9\u9635mx\uFF0C\u521B\u5EFA\u7ED5x\u8F74\u65CB\u8F6C\u77E9\u9635
|
|
float r = sqrt(a_Pos.z*a_Pos.z + a_Pos.x*a_Pos.x);
|
|
float xRadian = getXRadian(a_Pos.y, r);
|
|
float xcos = cos(xRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u4F59\u5F26\u503C
|
|
float xsin = sin(xRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u6B63\u5F26\u503C
|
|
mat4 mx = mat4(
|
|
1,0,0,0,
|
|
0,xcos,-xsin,0,
|
|
0,xsin,xcos,0,
|
|
0,0,0,1);
|
|
|
|
//\u65CB\u8F6C\u77E9\u9635my\uFF0C\u521B\u5EFA\u7ED5y\u8F74\u65CB\u8F6C\u77E9\u9635
|
|
float yRadian = getYRadian(a_Pos.x, a_Pos.z);
|
|
float ycos = cos(yRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u4F59\u5F26\u503C
|
|
float ysin = sin(yRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u6B63\u5F26\u503C
|
|
mat4 my = mat4(
|
|
ycos,0,-ysin,0,
|
|
0,1,0,0,
|
|
ysin,0,ycos,0,
|
|
0,0,0,1);
|
|
|
|
gl_Position = u_ViewProjectionMatrix * vec4(( my * mx * vec4(a_Position * a_Size, 1.0)).xyz + a_Pos, 1.0);
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,dR=oi.isNumber,vR=function(e){(0,Le.Z)(t,e);var r=cR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"raiseCount",0),(0,B.Z)((0,Fe.Z)(n),"raiseRepeat",0),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption,s=o===void 0?{enable:!1,speed:.01,repeat:!1}:o,l=i.opacity,f=l===void 0?1:l,v=i.sourceColor,y=i.targetColor,b=i.pickLight,T=b===void 0?!1:b,M=i.heightfixed,O=M===void 0?!1:M,F=i.opacityLinear,$=F===void 0?{enable:!1,dir:"up"}:F,G=i.lightEnable,ue=G===void 0?!0:G,xe=0,ze=[0,0,0,0],Je=[0,0,0,0];if(v&&y&&(ze=fi(v),Je=fi(y),xe=1),this.raiseCount<1&&this.raiseRepeat>0&&s.enable){var ht=s.speed,gt=ht===void 0?.01:ht;this.raiseCount+=gt,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}return{u_pickLight:Number(T),u_heightfixed:Number(O),u_r:s.enable&&this.raiseRepeat>0?this.raiseCount:1,u_opacity:dR(f)?f:1,u_linearColor:xe,u_sourceColor:ze,u_targetColor:Je,u_opacitylinear:Number($.enable),u_opacitylinear_dir:$.dir==="up"?1:0,u_lightEnable:Number(ue)}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.layer.getLayerConfig(),l=s.animateOption.repeat,f=l===void 0?1:l,this.raiseRepeat=f,b.next=4,this.layer.buildLayerModel({moduleName:"pointEarthExtrude",vertexShader:pR,fragmentShader:hR,triangulation:W0,depth:{enable:!0},cull:{enable:!0,face:ea(this.mapService.version)},blend:this.getBlend()});case 4:return v=b.sent,b.abrupt("return",[v]);case 6:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=o.size;if(s){var l=[];return Array.isArray(s)&&(l=s.length===2?[s[0],s[0],s[1]]:s),Array.isArray(s)||(l=[s,s,s]),l}else return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f,v){return v}}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:dn.Attribute,descriptor:{name:"a_Pos",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=Fs(o.coordinates);return _1([s[0],s[1]])}}})}}]),t}(Ma);function mR(e){var r=gR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function gR(){if(typeof Reflect=="undefined"||!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(e){return!1}}var _R=`uniform float u_additive;
|
|
uniform float u_opacity : 1;
|
|
uniform float u_stroke_opacity : 1;
|
|
uniform float u_stroke_width : 2;
|
|
|
|
varying vec4 v_data;
|
|
varying vec4 v_color;
|
|
varying float v_radius;
|
|
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
|
|
|
|
void main() {
|
|
int shape = int(floor(v_data.w + 0.5));
|
|
|
|
vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;
|
|
|
|
lowp float antialiasblur = v_data.z;
|
|
float r = v_radius / (v_radius + strokeWidth);
|
|
|
|
float outer_df;
|
|
float inner_df;
|
|
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
|
|
if (shape == 0) {
|
|
outer_df = sdCircle(v_data.xy, 1.0);
|
|
inner_df = sdCircle(v_data.xy, r);
|
|
} else if (shape == 1) {
|
|
outer_df = sdEquilateralTriangle(1.1 * v_data.xy);
|
|
inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);
|
|
} else if (shape == 2) {
|
|
outer_df = sdBox(v_data.xy, vec2(1.));
|
|
inner_df = sdBox(v_data.xy, vec2(r));
|
|
} else if (shape == 3) {
|
|
outer_df = sdPentagon(v_data.xy, 0.8);
|
|
inner_df = sdPentagon(v_data.xy, r * 0.8);
|
|
} else if (shape == 4) {
|
|
outer_df = sdHexagon(v_data.xy, 0.8);
|
|
inner_df = sdHexagon(v_data.xy, r * 0.8);
|
|
} else if (shape == 5) {
|
|
outer_df = sdOctogon(v_data.xy, 1.0);
|
|
inner_df = sdOctogon(v_data.xy, r);
|
|
} else if (shape == 6) {
|
|
outer_df = sdHexagram(v_data.xy, 0.52);
|
|
inner_df = sdHexagram(v_data.xy, r * 0.52);
|
|
} else if (shape == 7) {
|
|
outer_df = sdRhombus(v_data.xy, vec2(1.0));
|
|
inner_df = sdRhombus(v_data.xy, vec2(r));
|
|
} else if (shape == 8) {
|
|
outer_df = sdVesica(v_data.xy, 1.1, 0.8);
|
|
inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);
|
|
}
|
|
|
|
if(outer_df > antialiasblur + 0.018) discard;
|
|
|
|
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
|
|
float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(
|
|
antialiasblur,
|
|
0.0,
|
|
inner_df
|
|
);
|
|
|
|
if(strokeWidth < 0.01) {
|
|
gl_FragColor = vec4(v_color.rgb, v_color.a * u_opacity);
|
|
} else {
|
|
gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), u_stroke_color * u_stroke_opacity, color_t);
|
|
}
|
|
|
|
if(u_additive > 0.0) {
|
|
gl_FragColor *= opacity_t;
|
|
gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);
|
|
} else {
|
|
gl_FragColor.a *= opacity_t;
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
}
|
|
`,yR=`attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec3 a_Extrude;
|
|
attribute float a_Size;
|
|
attribute float a_Shape;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
varying vec4 v_data;
|
|
varying vec4 v_color;
|
|
varying float v_radius;
|
|
|
|
uniform float u_opacity : 1;
|
|
uniform float u_stroke_opacity : 1;
|
|
uniform float u_stroke_width : 2;
|
|
uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
uniform vec2 u_offsets;
|
|
|
|
uniform float u_blur : 0.0;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
|
|
void main() {
|
|
vec3 extrude = a_Extrude;
|
|
float shape_type = a_Shape;
|
|
/*
|
|
* setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F
|
|
*/
|
|
float newSize = setPickingSize(a_Size);
|
|
// float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
|
|
|
|
// unpack color(vec2)
|
|
v_color = a_Color;
|
|
|
|
// radius(16-bit)
|
|
v_radius = newSize;
|
|
|
|
// anti-alias
|
|
// float antialiased_blur = -max(u_blur, antialiasblur);
|
|
float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);
|
|
|
|
// TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F
|
|
v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
|
|
|
|
|
|
gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + u_offsets, 1.0);
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,xR=function(e){(0,Le.Z)(t,e);var r=mR(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.strokeOpacity,f=l===void 0?1:l,v=i.strokeWidth,y=v===void 0?0:v,b=i.stroke,T=b===void 0?"rgba(0,0,0,0)":b,M=i.blend,O=i.blur,F=O===void 0?0:O;return{u_blur:F,u_additive:M==="additive"?1:0,u_opacity:s,u_stroke_opacity:f,u_stroke_width:y,u_stroke_color:fi(T)}}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption,s=o===void 0?{enable:!1}:o;return{u_animate:this.animateOption2Array(s),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.layer.triangulation=A1,f.next=3,this.layer.buildLayerModel({moduleName:"pointEarthFill",vertexShader:yR,fragmentShader:_R,triangulation:A1,depth:{enable:!0},blend:this.getBlend()});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"animateOption2Array",value:function(i){return[i.enable?0:1,i.speed||1,i.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"extrude",type:dn.Attribute,descriptor:{name:"a_Extrude",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(s,l,f,v){var y=(0,Sn.Z)(f,3),b=y[0],T=y[1],M=y[2],O=La.fromValues(0,0,1),F=La.fromValues(b,0,M),$=b>=0?La.angle(O,F):Math.PI*2-La.angle(O,F),G=Math.PI*2-Math.asin(T/100),ue=me.create();me.rotateY(ue,ue,$),me.rotateX(ue,ue,G);var xe=La.fromValues(1,1,0);La.transformMat4(xe,xe,ue),La.normalize(xe,xe);var ze=La.fromValues(-1,1,0);La.transformMat4(ze,ze,ue),La.normalize(ze,ze);var Je=La.fromValues(-1,-1,0);La.transformMat4(Je,Je,ue),La.normalize(Je,Je);var ht=La.fromValues(1,-1,0);La.transformMat4(ht,ht,ue),La.normalize(ht,ht);var gt=[].concat((0,Kt.Z)(xe),(0,Kt.Z)(ze),(0,Kt.Z)(Je),(0,Kt.Z)(ht)),Ot=v%4*3;return[gt[Ot],gt[Ot+1],gt[Ot+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.size,f=l===void 0?5:l;return Array.isArray(f)?[f[0]]:[f]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:dn.Attribute,descriptor:{name:"a_Shape",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.shape,f=l===void 0?2:l,v=i.layer.getLayerConfig().shape2d,y=v.indexOf(f);return[y]}}})}}]),t}(Ma);function bR(e){var r=ER();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function ER(){if(typeof Reflect=="undefined"||!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(e){return!1}}var SR=`in vec4 v_color;
|
|
in float v_lightWeight;
|
|
out vec4 outputColor;
|
|
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_pickLight;
|
|
float u_heightfixed;
|
|
float u_r;
|
|
float u_linearColor;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_opacitylinear;
|
|
float u_opacitylinear_dir;
|
|
float u_lightEnable;
|
|
};
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
outputColor = v_color;
|
|
// \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8
|
|
// picking
|
|
if(u_pickLight > 0.0) {
|
|
outputColor = filterColorAlpha(outputColor, v_lightWeight);
|
|
} else {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
}
|
|
`,AR=`#define pi 3.1415926535
|
|
#define ambientRatio 0.5
|
|
#define diffuseRatio 0.3
|
|
#define specularRatio 0.2
|
|
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in vec3 a_Size;
|
|
layout(location = 11) in vec3 a_Extrude;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_pickLight;
|
|
float u_heightfixed;
|
|
float u_r;
|
|
float u_linearColor;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_opacitylinear;
|
|
float u_opacitylinear_dir;
|
|
float u_lightEnable;
|
|
};
|
|
out vec4 v_color;
|
|
out float v_lightWeight;
|
|
out float v_barLinearZ;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
float getYRadian(float x, float z) {
|
|
if(x > 0.0 && z > 0.0) {
|
|
return atan(x/z);
|
|
} else if(x > 0.0 && z <= 0.0){
|
|
return atan(-z/x) + pi/2.0;
|
|
} else if(x <= 0.0 && z <= 0.0) {
|
|
return pi + atan(x/z); //atan(x/z) +
|
|
} else {
|
|
return atan(z/-x) + pi*3.0/2.0;
|
|
}
|
|
}
|
|
|
|
float getXRadian(float y, float r) {
|
|
return atan(y/r);
|
|
}
|
|
|
|
void main() {
|
|
|
|
|
|
vec3 size = a_Size * a_Position;
|
|
|
|
vec3 offset = size; // \u63A7\u5236\u5706\u67F1\u4F53\u7684\u5927\u5C0F - \u4ECE\u6807\u51C6\u5355\u4F4D\u5706\u67F1\u4F53\u8FDB\u884C\u504F\u79FB
|
|
|
|
if(u_heightfixed < 1.0) { // \u5706\u67F1\u4F53\u4E0D\u56FA\u5B9A\u9AD8\u5EA6
|
|
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
|
// P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1
|
|
offset = offset * pow(2.0, (19.0 - u_Zoom));
|
|
}
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
|
|
// P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3
|
|
offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));
|
|
}
|
|
} else {// \u5706\u67F1\u4F53\u56FA\u5B9A\u9AD8\u5EA6 \uFF08 \u5904\u7406 mapbox \uFF09
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
offset *= 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
}
|
|
}
|
|
|
|
|
|
vec4 project_pos = project_position(vec4(a_Extrude.xy, 0., 1.0));
|
|
|
|
// u_r \u63A7\u5236\u5706\u67F1\u7684\u751F\u957F
|
|
vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);
|
|
|
|
// // \u5706\u67F1\u5149\u7167\u6548\u679C
|
|
float lightWeight = 1.0;
|
|
|
|
if(u_lightEnable > 0.0) { // \u53D6\u6D88\u4E09\u5143\u8868\u8FBE\u5F0F\uFF0C\u589E\u5F3A\u5065\u58EE\u6027
|
|
lightWeight = calc_lighting(pos);
|
|
}
|
|
|
|
v_lightWeight = lightWeight;
|
|
|
|
v_color = a_Color;
|
|
|
|
// \u8BBE\u7F6E\u5706\u67F1\u7684\u5E95\u8272
|
|
if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272
|
|
v_color = mix(u_sourceColor, u_targetColor, a_Position.z);
|
|
v_color.a = v_color.a * opacity;
|
|
} else {
|
|
v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);
|
|
}
|
|
|
|
if(u_opacitylinear > 0.0) {
|
|
v_color.a *= u_opacitylinear_dir > 0.0 ? (1.0 - a_Position.z): a_Position.z;
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(pos);
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,U1=function(e){(0,Le.Z)(t,e);var r=bR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"raiseCount",0),(0,B.Z)((0,Fe.Z)(n),"raiseRepeat",0),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),o=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,V.Z)((0,V.Z)({},i.uniformsOption),o.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption,s=o===void 0?{enable:!1,speed:.01,repeat:!1}:o,l=i.sourceColor,f=i.targetColor,v=i.pickLight,y=v===void 0?!1:v,b=i.heightfixed,T=b===void 0?!1:b,M=i.opacityLinear,O=M===void 0?{enable:!1,dir:"up"}:M,F=i.lightEnable,$=F===void 0?!0:F,G=0,ue=[0,0,0,0],xe=[0,0,0,0];if(l&&f&&(ue=fi(l),xe=fi(f),G=1),this.raiseCount<1&&this.raiseRepeat>0&&s.enable){var ze=s.speed,Je=ze===void 0?.01:ze;this.raiseCount+=Je,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}var ht={u_pickLight:Number(y),u_heightfixed:Number(T),u_r:s.enable&&this.raiseRepeat>0?this.raiseCount:1,u_linearColor:G,u_sourceColor:ue,u_targetColor:xe,u_opacitylinear:Number(O.enable),u_opacitylinear_dir:O.dir==="up"?1:0,u_lightEnable:Number($)},gt=this.getUniformsBufferInfo(ht);return gt}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b;return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return s=this.layer.getLayerConfig(),l=s.depth,f=l===void 0?!0:l,v=s.animateOption.repeat,y=v===void 0?1:v,this.raiseRepeat=y,this.initUniformsBuffer(),M.next=5,this.layer.buildLayerModel({moduleName:"pointExtrude",vertexShader:AR,fragmentShader:SR,triangulation:W0,inject:this.getInject(),cull:{enable:!0,face:ea(this.mapService.version)},depth:{enable:f}});case 5:return b=M.sent,M.abrupt("return",[b]);case 7:case"end":return M.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",shaderLocation:Ms.SIZE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=o.size;if(s){var l=[];return Array.isArray(s)&&(l=s.length===2?[s[0],s[0],s[1]]:s),Array.isArray(s)||(l=[s,s,s]),l}else return[2,2,2]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",shaderLocation:Ms.NORMAL,buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f,v){return v}}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:dn.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ms.EXTRUDE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o){var s=Fs(o.coordinates);return[s[0],s[1],0]}}})}}]),t}(Ma);function TR(e){var r=wR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function wR(){if(typeof Reflect=="undefined"||!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(e){return!1}}var z1=`
|
|
uniform float u_additive;
|
|
|
|
|
|
varying vec4 v_data;
|
|
varying vec4 v_color;
|
|
varying float v_radius;
|
|
uniform float u_time;
|
|
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
lowp float antialiasblur = v_data.z;
|
|
float r = v_radius / (v_radius);
|
|
|
|
float outer_df;
|
|
float inner_df;
|
|
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
|
|
|
|
outer_df = sdCircle(v_data.xy, 1.0);
|
|
inner_df = sdCircle(v_data.xy, r);
|
|
|
|
|
|
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
|
|
float color_t = smoothstep(
|
|
antialiasblur,
|
|
0.0,
|
|
inner_df
|
|
);
|
|
float PI = 3.14159;
|
|
float N_RINGS = 3.0;
|
|
float FREQ = 1.0;
|
|
|
|
gl_FragColor = v_color;
|
|
|
|
float d = length(v_data.xy);
|
|
if(d > 0.5) {
|
|
discard;
|
|
}
|
|
float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0);
|
|
|
|
// \u6839\u636E\u53E0\u52A0\u6A21\u5F0F\u9009\u62E9\u6548\u679C
|
|
if(u_additive > 0.0) {
|
|
gl_FragColor *= intensity;
|
|
// \u4F18\u5316\u6C34\u6CE2\u70B9 blend additive \u6A21\u5F0F\u4E0B\u6709\u7684\u62FE\u53D6\u6548\u679C
|
|
gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);
|
|
} else {
|
|
gl_FragColor = vec4(gl_FragColor.xyz, gl_FragColor.a * intensity);
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
}
|
|
`,CR=`
|
|
layout(std140) uniform commonUniforms {
|
|
vec3 u_blur_height_fixed;
|
|
float u_stroke_width;
|
|
float u_additive;
|
|
float u_stroke_opacity;
|
|
float u_size_unit;
|
|
};
|
|
|
|
in vec4 v_color;
|
|
in vec4 v_stroke;
|
|
in vec4 v_data;
|
|
in float v_radius;
|
|
|
|
#pragma include "scene_uniforms"
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
int shape = int(floor(v_data.w + 0.5));
|
|
lowp float antialiasblur = v_data.z;
|
|
float r = v_radius / (v_radius + u_stroke_width);
|
|
|
|
float outer_df;
|
|
float inner_df;
|
|
// 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'
|
|
if (shape == 0) {
|
|
outer_df = sdCircle(v_data.xy, 1.0);
|
|
inner_df = sdCircle(v_data.xy, r);
|
|
} else if (shape == 1) {
|
|
outer_df = sdEquilateralTriangle(1.1 * v_data.xy);
|
|
inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);
|
|
} else if (shape == 2) {
|
|
outer_df = sdBox(v_data.xy, vec2(1.));
|
|
inner_df = sdBox(v_data.xy, vec2(r));
|
|
} else if (shape == 3) {
|
|
outer_df = sdPentagon(v_data.xy, 0.8);
|
|
inner_df = sdPentagon(v_data.xy, r * 0.8);
|
|
} else if (shape == 4) {
|
|
outer_df = sdHexagon(v_data.xy, 0.8);
|
|
inner_df = sdHexagon(v_data.xy, r * 0.8);
|
|
} else if (shape == 5) {
|
|
outer_df = sdOctogon(v_data.xy, 1.0);
|
|
inner_df = sdOctogon(v_data.xy, r);
|
|
} else if (shape == 6) {
|
|
outer_df = sdHexagram(v_data.xy, 0.52);
|
|
inner_df = sdHexagram(v_data.xy, r * 0.52);
|
|
} else if (shape == 7) {
|
|
outer_df = sdRhombus(v_data.xy, vec2(1.0));
|
|
inner_df = sdRhombus(v_data.xy, vec2(r));
|
|
} else if (shape == 8) {
|
|
outer_df = sdVesica(v_data.xy, 1.1, 0.8);
|
|
inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);
|
|
}
|
|
|
|
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
|
|
float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(
|
|
antialiasblur,
|
|
0.0,
|
|
inner_df
|
|
);
|
|
|
|
if(u_stroke_width < 0.01) {
|
|
outputColor = v_color;
|
|
} else {
|
|
outputColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);
|
|
}
|
|
|
|
if(u_additive > 0.0) {
|
|
outputColor *= opacity_t;
|
|
outputColor = filterColorAlpha(outputColor, outputColor.a);
|
|
} else {
|
|
outputColor.a *= opacity_t;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
// \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20
|
|
if(outputColor.a < 0.01) {
|
|
discard;
|
|
}
|
|
}
|
|
`,K0=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 11) in vec3 a_Extrude;
|
|
layout(location = 10) in float a_Shape;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec3 u_blur_height_fixed;
|
|
float u_stroke_width;
|
|
float u_additive;
|
|
float u_stroke_opacity;
|
|
float u_size_unit;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
out vec4 v_stroke;
|
|
out vec4 v_data;
|
|
out float v_radius;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
#pragma include "rotation_2d"
|
|
|
|
void main() {
|
|
// \u900F\u660E\u5EA6\u8BA1\u7B97
|
|
v_stroke = stroke;
|
|
vec3 extrude = a_Extrude;
|
|
float shape_type = a_Shape;
|
|
/*
|
|
* setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F
|
|
* u_meter2coord \u5728\u7B49\u9762\u79EF\u5927\u5C0F\u7684\u65F6\u5019\u8BBE\u7F6E\u5355\u4F4D
|
|
*/
|
|
float newSize = setPickingSize(a_Size);
|
|
// float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
|
|
|
|
|
|
|
|
// unpack color(vec2)
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
|
|
if(u_size_unit == 1.0) {
|
|
newSize = newSize * u_PixelsPerMeter.z;
|
|
}
|
|
|
|
v_radius = newSize;
|
|
|
|
// anti-alias
|
|
// float antialiased_blur = -max(u_blur, antialiasblur);
|
|
float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur_height_fixed.x);
|
|
|
|
vec2 offset = (extrude.xy * (newSize + u_stroke_width) + u_offsets);
|
|
vec3 aPosition = a_Position;
|
|
|
|
offset = project_pixel(offset);
|
|
offset = rotate_matrix(offset,rotation);
|
|
|
|
// TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F
|
|
v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
|
|
|
|
|
|
// vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));
|
|
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
|
|
|
|
float raisingHeight = u_blur_height_fixed.y;
|
|
|
|
if(u_blur_height_fixed.z < 1.0) { // false
|
|
raisingHeight = project_pixel(u_blur_height_fixed.y);
|
|
} else {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
raisingHeight = u_blur_height_fixed.y * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,Z1=function(e){(0,Le.Z)(t,e);var r=TR(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.strokeOpacity,s=o===void 0?1:o,l=i.strokeWidth,f=l===void 0?0:l,v=i.blend,y=i.blur,b=y===void 0?0:y,T=i.raisingHeight,M=T===void 0?0:T,O=i.heightfixed,F=O===void 0?!1:O,$=i.unit,G=$===void 0?"pixel":$,ue=(0,V.Z)({u_blur_height_fixed:[b,Number(M),Number(F)],u_additive:v==="additive"?1:0,u_stroke_opacity:s,u_stroke_width:f,u_size_unit:Y0[G]},this.getStyleAttribute()),xe=this.getStyleAttribute();return this.uniformBuffers[0].subData({offset:0,data:new Uint8Array(new Float32Array([].concat((0,Kt.Z)(xe.u_stroke),(0,Kt.Z)(xe.u_offsets),[xe.u_opacity,xe.u_rotation])).buffer)}),this.uniformBuffers[1].subData({offset:0,data:new Uint8Array(new Float32Array([].concat((0,Kt.Z)(ue.u_blur_height_fixed),[ue.u_stroke_width,ue.u_stroke_opacity,ue.u_additive,ue.u_size_unit])).buffer)}),ue}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption,s=o===void 0?{enable:!1}:o;return{u_animate:this.animateOption2Array(s),u_time:this.layer.getLayerAnimateTime()}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),pf)}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M,O,F;return ge().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return s=this.layer.getLayerConfig(),l=s.animateOption,f=l===void 0?{enable:!1}:l,v=this.getShaders(f),y=v.frag,b=v.vert,T=v.type,this.layer.triangulation=pf,M=this.rendererService.createBuffer({data:new Float32Array(8),isUBO:!0}),O=this.rendererService.createBuffer({data:new Float32Array(8),isUBO:!0}),this.uniformBuffers.push(M,O),G.next=8,this.layer.buildLayerModel({moduleName:T,vertexShader:b,fragmentShader:y,inject:this.getInject(),triangulation:pf,depth:{enable:!1}});case 8:return F=G.sent,G.abrupt("return",[F]);case 10:case"end":return G.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(i){if(i.enable)switch(i.type){case"wave":return{frag:z1,vert:K0,type:"pointWave"};default:return{frag:z1,vert:K0,type:"pointWave"}}else return{frag:CR,vert:K0,type:"pointFill"}}},{key:"animateOption2Array",value:function(i){return[i.enable?0:1,i.speed||1,i.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getLayerConfig().shape2d;this.styleAttributeService.registerStyleAttribute({name:"extrude",type:dn.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Ms.EXTRUDE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(s,l,f,v){var y=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],b=v%4*3;return[y[b],y[b+1],y[b+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",shaderLocation:Ms.SIZE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.size,f=l===void 0?5:l;return Array.isArray(f)?[f[0]]:[f]}}}),this.styleAttributeService.registerStyleAttribute({name:"shape",type:dn.Attribute,descriptor:{name:"a_Shape",shaderLocation:Ms.SHAPE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.shape,f=l===void 0?2:l,v=i.indexOf(f);return[v]}}})}}]),t}(Ma);function RR(e){var r=MR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function MR(){if(typeof Reflect=="undefined"||!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(e){return!1}}var IR=`uniform sampler2D u_texture;
|
|
uniform vec2 u_textSize;
|
|
uniform float u_opacity : 1;
|
|
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
varying vec2 v_uv; // \u672C\u8EAB\u7684 uv \u5750\u6807
|
|
varying vec2 v_Iconuv;
|
|
varying float v_opacity;
|
|
|
|
void main() {
|
|
|
|
vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;
|
|
gl_FragColor = texture2D(u_texture, pos);
|
|
gl_FragColor.a *= v_opacity;
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,PR=`attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec3 a_Extrude;
|
|
attribute float a_Size;
|
|
attribute vec2 a_Uv;
|
|
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform mat2 u_RotateMatrix;
|
|
uniform int u_size_unit;
|
|
|
|
varying vec2 v_uv; // \u672C\u8EAB\u7684 uv \u5750\u6807
|
|
varying vec2 v_Iconuv; // icon \u8D34\u56FE\u7684 uv \u5750\u6807
|
|
|
|
uniform float u_raisingHeight: 0.0;
|
|
uniform float u_heightfixed: 0.0;
|
|
varying float v_opacity;
|
|
// uniform vec2 u_offsets; // shader \u6CE8\u5165
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
#pragma include "rotation_2d"
|
|
|
|
void main() {
|
|
vec3 extrude = a_Extrude;
|
|
v_uv = (a_Extrude.xy + 1.0)/2.0;
|
|
v_uv.y = 1.0 - v_uv.y;
|
|
v_Iconuv = a_Uv;
|
|
v_opacity = opacity;
|
|
float newSize = a_Size;
|
|
if(u_size_unit == 1) {
|
|
newSize = newSize * u_PixelsPerMeter.z;
|
|
}
|
|
|
|
// vec2 offset = (u_RotateMatrix * extrude.xy * (a_Size) + textrueOffsets);
|
|
vec2 offset = (extrude.xy * (newSize) + offsets);
|
|
|
|
offset = rotate_matrix(offset,rotation);
|
|
|
|
vec3 aPosition = a_Position;
|
|
|
|
offset = project_pixel(offset);
|
|
|
|
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
float raisingHeight = u_raisingHeight;
|
|
if(u_heightfixed < 1.0) { // height fixed
|
|
raisingHeight = project_pixel(u_raisingHeight);
|
|
} else {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
raisingHeight = u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, 0.0, 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,OR=function(e){(0,Le.Z)(t,e);var r=RR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"meter2coord",1),(0,B.Z)((0,Fe.Z)(n),"isMeter",!1),(0,B.Z)((0,Fe.Z)(n),"radian",0),(0,B.Z)((0,Fe.Z)(n),"updateTexture",function(){var l=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),n.layerService.throttleRenderLayers();return}n.texture=l({data:n.iconService.getCanvas(),mag:R.LINEAR,min:R.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128,mipmap:!0})}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.raisingHeight,s=o===void 0?0:o,l=i.heightfixed,f=l===void 0?!1:l,v=i.unit,y=v===void 0?"pixel":v;return this.rendererService.getDirty()&&this.texture.bind(),(0,V.Z)({u_raisingHeight:Number(s),u_heightfixed:Number(f),u_size_unit:Y0[y],u_texture:this.texture,u_textSize:[1024,this.iconService.canvasHeight||128]},this.getStyleAttribute())}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),Eg)}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.iconService.on("imageUpdate",this.updateTexture),this.updateTexture(),l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"pointFillImage",vertexShader:PR,fragmentShader:IR,triangulation:Eg,depth:{enable:!1},inject:this.getInject(),cull:{enable:!0,face:ea(this.mapService.version)}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;this.iconService.off("imageUpdate",this.updateTexture),(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_Uv",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.shape,v=l[f]||{x:-64,y:-64},y=v.x,b=v.y;return[y,b]}}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:dn.Attribute,descriptor:{name:"a_Extrude",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(s,l,f,v){var y=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],b=v%4*3;return[y[b],y[b+1],y[b+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.size,f=l===void 0?5:l;return Array.isArray(f)?[f[0]]:[f]}}})}}]),t}(Ma);function DR(e){var r=FR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function FR(){if(typeof Reflect=="undefined"||!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(e){return!1}}var kR=`
|
|
uniform sampler2D u_texture;
|
|
varying vec4 v_color;
|
|
varying vec2 v_uv;
|
|
varying float v_opacity;
|
|
uniform vec2 u_textSize;
|
|
|
|
#pragma include "picking"
|
|
|
|
void main(){
|
|
vec2 pos = v_uv / u_textSize + gl_PointCoord / u_textSize * 64.;
|
|
vec4 textureColor;
|
|
|
|
// Y = 0.299R + 0.587G + 0.114B // \u4EAE\u5EA6\u63D0\u53D6
|
|
|
|
textureColor = texture2D(u_texture, pos);
|
|
|
|
// Tip: \u53BB\u9664\u8FB9\u7F18\u90E8\u5206 mipmap \u5BFC\u81F4\u7684\u6DF7\u5408\u53D8\u6697
|
|
float fragmengTocenter = distance(vec2(0.5), gl_PointCoord);
|
|
if(fragmengTocenter >= 0.5) {
|
|
float luma = 0.299 * textureColor.r + 0.587 * textureColor.g + 0.114 * textureColor.b;
|
|
textureColor.a *= luma;
|
|
}
|
|
|
|
|
|
|
|
if(all(lessThan(v_color, vec4(1.0+0.00001))) && all(greaterThan(v_color, vec4(1.0-0.00001))) || v_color==vec4(1.0)){
|
|
gl_FragColor= textureColor;
|
|
}else {
|
|
gl_FragColor= step(0.01, textureColor.z) * v_color;
|
|
}
|
|
gl_FragColor.a *= v_opacity;
|
|
if (gl_FragColor.a < 0.01) {
|
|
discard;
|
|
}
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,BR=`precision highp float;
|
|
attribute vec3 a_Position;
|
|
attribute vec4 a_Color;
|
|
attribute vec2 a_Uv;
|
|
attribute float a_Size;
|
|
varying vec4 v_color;
|
|
varying vec2 v_uv;
|
|
varying float v_opacity;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
uniform float u_raisingHeight: 0.0;
|
|
uniform float u_heightfixed: 0.0;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
|
|
v_color = a_Color;
|
|
v_opacity = opacity;
|
|
v_uv = a_Uv;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
|
|
vec2 offset = project_pixel(offsets);
|
|
|
|
float raisingHeight = u_raisingHeight;
|
|
if(u_heightfixed < 1.0) { // false
|
|
raisingHeight = project_pixel(u_raisingHeight);
|
|
} else {
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
raisingHeight = u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, raisingHeight, 1.0));
|
|
|
|
gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,V1=function(e){(0,Le.Z)(t,e);var r=DR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"updateTexture",function(){var l=n.rendererService.createTexture2D;if(n.texture){n.texture.update({data:n.iconService.getCanvas(),mag:"linear",min:"linear mipmap nearest",mipmap:!0}),setTimeout(function(){n.layerService.throttleRenderLayers()});return}n.texture=l({data:n.iconService.getCanvas(),mag:R.LINEAR,min:R.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128,mipmap:!0})}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.raisingHeight,s=o===void 0?0:o,l=i.heightfixed,f=l===void 0?!1:l;return this.rendererService.getDirty()&&this.texture.bind(),(0,V.Z)({u_raisingHeight:Number(s),u_heightfixed:Number(f),u_texture:this.texture,u_textSize:[1024,this.iconService.canvasHeight||128]},this.getStyleAttribute())}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.iconService.on("imageUpdate",this.updateTexture),this.updateTexture(),l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.iconService.off("imageUpdate",this.updateTexture)}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"pointImage",vertexShader:BR,fragmentShader:kR,triangulation:Bw,inject:this.getInject(),depth:{enable:!1},primitive:R.POINTS});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(s){var l=s.size,f=l===void 0?5:l;return Array.isArray(f)?[f[0]]:[f]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_Uv",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.shape,v=l[f]||{x:-64,y:-64},y=v.x,b=v.y;return[y,b]}}})}}]),t}(Ma);function LR(e){var r=NR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function NR(){if(typeof Reflect=="undefined"||!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(e){return!1}}var UR=`in vec4 v_color;
|
|
out vec4 outputColor;
|
|
void main() {
|
|
outputColor = v_color;
|
|
}`,zR=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
|
|
layout(std140) uniform u_Common {
|
|
float u_size_scale;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
|
|
void main() {
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
|
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * vec4(a_Position, 1.0);
|
|
} else {
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2., -a_Size /2., 0., 0.);
|
|
gl_Position = project_common_position_to_clipspace(project_pos);
|
|
}
|
|
|
|
gl_PointSize = a_Size * u_size_scale * 2.0 * u_DevicePixelRatio;
|
|
}
|
|
`;function j1(e){var r=e.coordinates;return{vertices:(0,Kt.Z)(r),indices:[0],size:r.length}}var H1=function(e){(0,Le.Z)(t,e);var r=LR(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getDefaultStyle",value:function(){return{blend:"additive"}}},{key:"getUninforms",value:function(){var i=this.getStyleAttribute();return this.uniformBuffers[0].subData({offset:0,data:new Uint8Array(new Float32Array([].concat((0,Kt.Z)(i.u_stroke),(0,Kt.Z)(i.u_offsets),[i.u_opacity,i.u_rotation])).buffer)}),this.uniformBuffers[1].subData({offset:0,data:new Uint8Array(new Float32Array([.5]).buffer)}),(0,V.Z)({u_size_scale:.5},i)}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f;return ge().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return this.layer.triangulation=j1,s=this.rendererService.createBuffer({data:new Float32Array(8),isUBO:!0}),l=this.rendererService.createBuffer({data:new Float32Array(4),isUBO:!0}),this.uniformBuffers.push(s,l),y.next=6,this.layer.buildLayerModel({moduleName:"pointNormal",vertexShader:zR,fragmentShader:UR,triangulation:j1,inject:this.getInject(),depth:{enable:!1},primitive:R.POINTS,pick:!1});case 6:return f=y.sent,y.abrupt("return",[f]);case 8:case"end":return y.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",shaderLocation:Ms.SIZE,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?1:s;return Array.isArray(l)?[l[0]]:[l]}}})}}]),t}(Ma);function ZR(e){var r=VR();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function VR(){if(typeof Reflect=="undefined"||!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(e){return!1}}var jR=`
|
|
uniform float u_additive;
|
|
uniform float u_opacity: 1.0;
|
|
|
|
varying vec4 v_data;
|
|
varying vec4 v_color;
|
|
varying float v_radius;
|
|
varying vec2 v_exteude;
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
lowp float antialiasblur = v_data.z;
|
|
float r = v_radius / (v_radius);
|
|
|
|
float outer_df = sdCircle(v_data.xy, 1.0);
|
|
float inner_df = sdCircle(v_data.xy, r);
|
|
|
|
float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
|
|
|
|
gl_FragColor = vec4(v_color.rgb, v_color.a * u_opacity);
|
|
|
|
if(u_additive > 0.0) {
|
|
gl_FragColor *= opacity_t;
|
|
} else {
|
|
gl_FragColor.a *= opacity_t;
|
|
}
|
|
|
|
if(gl_FragColor.a > 0.0) {
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
|
|
vec2 extrude = v_exteude;
|
|
vec2 dir = normalize(extrude);
|
|
vec2 baseDir = vec2(1.0, 0.0);
|
|
float pi = 3.14159265359;
|
|
float flag = sign(dir.y);
|
|
float rades = dot(dir, baseDir);
|
|
float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;
|
|
// simple AA
|
|
if(radar_v > 0.99) {
|
|
radar_v = 1.0 - (radar_v - 0.99)/0.01;
|
|
}
|
|
|
|
gl_FragColor.a *= radar_v;
|
|
}
|
|
`,HR=`attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec3 a_Extrude;
|
|
attribute float a_Size;
|
|
uniform float u_speed: 1.0;
|
|
uniform float u_time;
|
|
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform int u_size_unit;
|
|
|
|
varying vec4 v_data;
|
|
varying vec4 v_color;
|
|
varying float v_radius;
|
|
varying vec2 v_exteude;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
vec3 extrude = a_Extrude;
|
|
float newSize = setPickingSize(a_Size);
|
|
|
|
float time = u_time * u_speed;
|
|
mat2 rotateMatrix = mat2(
|
|
cos(time), sin(time),
|
|
-sin(time), cos(time)
|
|
);
|
|
v_exteude = rotateMatrix * a_Extrude.xy;
|
|
|
|
// unpack color(vec2)
|
|
v_color = a_Color;
|
|
|
|
// anti-alias
|
|
float blur = 0.0;
|
|
float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);
|
|
|
|
if(u_size_unit == 1) {
|
|
newSize = newSize * u_PixelsPerMeter.z;
|
|
}
|
|
// radius(16-bit)
|
|
v_radius = newSize;
|
|
|
|
vec2 offset = (extrude.xy * (newSize));
|
|
vec3 aPosition = a_Position;
|
|
|
|
// \u4E0D\u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D
|
|
offset = project_pixel(offset);
|
|
|
|
v_data = vec4(extrude.x, extrude.y, antialiasblur, -1.0);
|
|
|
|
vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,WR=function(e){(0,Le.Z)(t,e);var r=ZR(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.blend,f=i.speed,v=f===void 0?1:f,y=i.unit,b=y===void 0?"pixel":y;return{u_size_unit:Y0[b],u_speed:v,u_additive:l==="additive"?1:0,u_opacity:s}}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),o=i.animateOption,s=o===void 0?{enable:!1}:o;return{u_animate:this.animateOption2Array(s),u_time:this.layer.getLayerAnimateTime()}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),Eg)}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"pointRadar",vertexShader:HR,fragmentShader:jR,triangulation:Eg,depth:{enable:!1}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"animateOption2Array",value:function(i){return[i.enable?0:1,i.speed||1,i.rings||3,0]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"extrude",type:dn.Attribute,descriptor:{name:"a_Extrude",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f){var v=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],y=f%4*3;return[v[y],v[y+1],v[y+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?5:s;return Array.isArray(l)?[l[0]]:[l]}}})}}]),t}(Ma);function GR(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=XR(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function XR(e,r){if(e){if(typeof e=="string")return W1(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return W1(e,r)}}function W1(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var $R=function(){function e(r,t,n){(0,Q.Z)(this,e),(0,B.Z)(this,"boxCells",[]);var i=this.boxCells;this.xCellCount=Math.ceil(r/n),this.yCellCount=Math.ceil(t/n);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.push([]);this.boxKeys=[],this.bboxes=[],this.width=r,this.height=t,this.xScale=this.xCellCount/r,this.yScale=this.yCellCount/t,this.boxUid=0}return(0,j.Z)(e,[{key:"insert",value:function(t,n,i,o,s){this.forEachCell(n,i,o,s,this.insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(o),this.bboxes.push(s)}},{key:"query",value:function(t,n,i,o,s){return this.queryHitTest(t,n,i,o,!1,s)}},{key:"hitTest",value:function(t,n,i,o,s){return this.queryHitTest(t,n,i,o,!0,s)}},{key:"insertBoxCell",value:function(t,n,i,o,s,l){this.boxCells[s].push(l)}},{key:"queryHitTest",value:function(t,n,i,o,s,l){if(i<0||t>this.width||o<0||n>this.height)return s?!1:[];var f=[];if(t<=0&&n<=0&&this.width<=i&&this.height<=o){if(s)return!0;for(var v=0;v<this.boxKeys.length;v++)f.push({key:this.boxKeys[v],x1:this.bboxes[v*4],y1:this.bboxes[v*4+1],x2:this.bboxes[v*4+2],y2:this.bboxes[v*4+3]});return l?f.filter(l):f}var y={hitTest:s,seenUids:{box:{},circle:{}}};return this.forEachCell(t,n,i,o,this.queryCell,f,y,l),s?f.length>0:f}},{key:"queryCell",value:function(t,n,i,o,s,l,f,v){var y=f.seenUids,b=this.boxCells[s];if(b!==null){var T=this.bboxes,M=GR(b),O;try{for(M.s();!(O=M.n()).done;){var F=O.value;if(!y.box[F]){y.box[F]=!0;var $=F*4;if(t<=T[$+2]&&n<=T[$+3]&&i>=T[$+0]&&o>=T[$+1]&&(!v||v(this.boxKeys[F]))){if(f.hitTest)return l.push(!0),!0;l.push({key:this.boxKeys[F],x1:T[$],y1:T[$+1],x2:T[$+2],y2:T[$+3]})}}}}catch(G){M.e(G)}finally{M.f()}}return!1}},{key:"forEachCell",value:function(t,n,i,o,s,l,f,v){for(var y=this.convertToXCellCoord(t),b=this.convertToYCellCoord(n),T=this.convertToXCellCoord(i),M=this.convertToYCellCoord(o),O=y;O<=T;O++)for(var F=b;F<=M;F++){var $=this.xCellCount*F+O;if(s.call(this,t,n,i,o,$,l,f,v))return}}},{key:"convertToXCellCoord",value:function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}},{key:"convertToYCellCoord",value:function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}}]),e}(),YR=$R,qR=function(){function e(r,t){(0,Q.Z)(this,e),(0,B.Z)(this,"viewportPadding",100),this.width=r,this.height=t,this.viewportPadding=Math.max(r,t),this.grid=new YR(r+this.viewportPadding,t+this.viewportPadding,25),this.screenRightBoundary=r+this.viewportPadding,this.screenBottomBoundary=t+this.viewportPadding,this.gridRightBoundary=r+2*this.viewportPadding,this.gridBottomBoundary=t+2*this.viewportPadding}return(0,j.Z)(e,[{key:"placeCollisionBox",value:function(t){var n=t.x1+t.anchorPointX+this.viewportPadding,i=t.y1+t.anchorPointY+this.viewportPadding,o=t.x2+t.anchorPointX+this.viewportPadding,s=t.y2+t.anchorPointY+this.viewportPadding;return!this.isInsideGrid(n,i,o,s)||this.grid.hitTest(n,i,o,s)?{box:[]}:{box:[n,i,o,s]}}},{key:"insertCollisionBox",value:function(t,n){var i={featureIndex:n};this.grid.insert(i,t[0],t[1],t[2],t[3])}},{key:"project",value:function(t,n,i){var o=Fh.al(n,i,0,1),s=Fh.Ue(),l=me.fromValues.apply(me,(0,Kt.Z)(t));return Fh.fF(s,o,l),{x:(s[0]/s[3]+1)/2*this.width+this.viewportPadding,y:(-s[1]/s[3]+1)/2*this.height+this.viewportPadding}}},{key:"isInsideGrid",value:function(t,n,i,o){return i>=0&&t<this.gridRightBoundary&&o>=0&&n<this.gridBottomBoundary}}]),e}();function G1(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=KR(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function KR(e,r){if(e){if(typeof e=="string")return X1(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return X1(e,r)}}function X1(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function $1(e){var r=.5,t=.5;switch(e){case"right":case"top-right":case"bottom-right":r=1;break;case"left":case"top-left":case"bottom-left":r=0;break;default:r=.5}switch(e){case"bottom":case"bottom-right":case"bottom-left":t=1;break;case"top":case"top-right":case"top-left":t=0;break;default:t=.5}return{horizontalAlign:r,verticalAlign:t}}function Y1(e,r,t,n,i){if(i){var o=e[n],s=o.glyph;if(s)for(var l=r[s].advance*o.scale,f=(e[n].x+l)*i,v=t;v<=n;v++)e[v].x-=f}}function q1(e,r,t,n,i,o,s){var l=(r-t)*i,f=(-n*s+.5)*o,v=G1(e),y;try{for(v.s();!(y=v.n()).done;){var b=y.value;b.x+=l,b.y+=f}}catch(T){v.e(T)}finally{v.f()}}function QR(e,r,t,n,i,o,s){var l=-8,f=0,v=l,y=0,b=e.positionedGlyphs,T=o==="right"?1:o==="left"?0:.5,M=b.length;t.forEach(function(ue){if(ue.split("").forEach(function(ze){var Je=r[ze],ht=0;Je&&(b.push({glyph:ze,x:f,y:v+ht,vertical:!1,scale:1,metrics:Je}),f+=Je.advance+s)}),b.length!==M){var xe=f-s;y=Math.max(xe,y),Y1(b,r,M,b.length-1,T)}f=0,v-=n+5});var O=$1(i),F=O.horizontalAlign,$=O.verticalAlign;q1(b,T,F,$,y,n,t.length);var G=v-l;e.top+=-$*G,e.bottom=e.top-G,e.left+=-F*y,e.right=e.left+y}function JR(e,r,t,n,i,o,s){var l=-8,f=0,v=l,y=0,b=e.positionedGlyphs,T=o==="right"?1:o==="left"?0:.5,M=b.length;t.forEach(function(ue){var xe=r[ue],ze=0;if(xe&&(b.push({glyph:ue,x:xe.advance/2,y:v+ze,vertical:!1,scale:1,metrics:xe}),f+=xe.advance+s),b.length!==M){var Je=f-s;y=Math.max(Je,y),Y1(b,r,M,b.length-1,T)}f=0,v-=n+5});var O=$1(i),F=O.horizontalAlign,$=O.verticalAlign;q1(b,T,F,$,y,n,t.length);var G=v-l;e.top+=-$*G,e.bottom=e.top-G,e.left+=-F*y,e.right=e.left+y}function eM(e,r,t,n,i,o){var s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:[0,0],l=arguments.length>7?arguments[7]:void 0,f=e.split(`
|
|
`),v=[],y={positionedGlyphs:v,top:s[1],bottom:s[1],left:s[0],right:s[0],lineCount:f.length,text:e};return l?JR(y,r,f,t,n,i,o):QR(y,r,f,t,n,i,o),v.length?y:!1}function tM(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0],t=arguments.length>2?arguments[2]:void 0,n=e.positionedGlyphs,i=n===void 0?[]:n,o=[],s=G1(i),l;try{for(s.s();!(l=s.n()).done;){var f=l.value,v=f.metrics,y=4,b=v.advance*f.scale/2,T=t?[f.x+b,f.y]:[0,0],M=t?[0,0]:[f.x+b+r[0],f.y+r[1]],O=(0-y)*f.scale-b+M[0],F=(0-y)*f.scale+M[1],$=O+v.width*f.scale,G=F+v.height*f.scale,ue={x:O,y:F},xe={x:$,y:F},ze={x:O,y:G},Je={x:$,y:G};o.push({tl:ue,tr:xe,bl:ze,br:Je,tex:v,glyphOffset:T})}}catch(ht){s.e(ht)}finally{s.f()}return o}function rM(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=nM(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function nM(e,r){if(e){if(typeof e=="string")return K1(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return K1(e,r)}}function K1(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function iM(e){var r=aM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function aM(){if(typeof Reflect=="undefined"||!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(e){return!1}}var Q1=`#define SDF_PX 8.0
|
|
#define EDGE_GAMMA 0.105
|
|
#define FONT_SIZE 48.0
|
|
uniform sampler2D u_sdf_map;
|
|
uniform float u_gamma_scale : 0.5;
|
|
uniform float u_stroke_width : 2.0;
|
|
uniform float u_halo_blur : 0.5;
|
|
uniform float u_DevicePixelRatio;
|
|
|
|
varying vec4 v_color;
|
|
varying vec4 v_stroke_color;
|
|
varying vec2 v_uv;
|
|
varying float v_gamma_scale;
|
|
varying float v_fontScale;
|
|
|
|
|
|
#pragma include "picking"
|
|
void main() {
|
|
// get style data mapping
|
|
|
|
// get sdf from atlas
|
|
float dist = texture2D(u_sdf_map, v_uv).a;
|
|
|
|
lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;
|
|
highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;
|
|
|
|
highp float gamma_scaled = gamma * v_gamma_scale;
|
|
|
|
highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);
|
|
|
|
gl_FragColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));
|
|
|
|
gl_FragColor.a *= alpha;
|
|
// \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20
|
|
if (gl_FragColor.a < 0.01) {
|
|
discard;
|
|
}
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,J1=`#define SDF_PX 8.0
|
|
#define EDGE_GAMMA 0.105
|
|
#define FONT_SIZE 24.0
|
|
attribute vec3 a_Position;
|
|
attribute vec2 a_tex;
|
|
attribute vec2 a_textOffsets;
|
|
attribute vec4 a_Color;
|
|
attribute float a_Size;
|
|
|
|
uniform vec2 u_sdf_map_size;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform float u_raisingHeight: 0.0;
|
|
|
|
varying vec2 v_uv;
|
|
varying float v_gamma_scale;
|
|
varying vec4 v_color;
|
|
varying vec4 v_stroke_color;
|
|
varying float v_fontScale;
|
|
uniform float u_stroke_width : 2;
|
|
uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
#pragma include "rotation_2d"
|
|
|
|
void main() {
|
|
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
|
|
|
|
v_uv = a_tex / u_sdf_map_size;
|
|
|
|
|
|
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
v_stroke_color = vec4(u_stroke_color.xyz, u_stroke_color.w * opacity);
|
|
|
|
// \u6587\u672C\u7F29\u653E\u6BD4\u4F8B
|
|
float fontScale = a_Size / FONT_SIZE;
|
|
v_fontScale = fontScale;
|
|
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
// vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
|
|
vec2 offset = rotate_matrix(a_textOffsets,rotation);
|
|
|
|
// gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
|
|
|
|
float raiseHeight = u_raisingHeight;
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
raiseHeight = u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
|
|
vec4 projected_position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));
|
|
|
|
gl_Position = vec4(
|
|
projected_position.xy / projected_position.w + offset * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);
|
|
v_gamma_scale = gl_Position.w;
|
|
setPickingColor(a_PickingColor);
|
|
|
|
}
|
|
`,pm=oi.isEqual;function ex(e){var r=this,t=e.id,n=[],i=[];if(!r.glyphInfoMap||!r.glyphInfoMap[t])return{vertices:[],indices:[],size:7};var o=r.glyphInfoMap[t].centroid,s=o.length===2?[o[0],o[1],0]:o;return r.glyphInfoMap[t].glyphQuads.forEach(function(l,f){n.push.apply(n,(0,Kt.Z)(s).concat([l.tex.x,l.tex.y+l.tex.height,l.tl.x,l.tl.y],(0,Kt.Z)(s),[l.tex.x+l.tex.width,l.tex.y+l.tex.height,l.tr.x,l.tr.y],(0,Kt.Z)(s),[l.tex.x+l.tex.width,l.tex.y,l.br.x,l.br.y],(0,Kt.Z)(s),[l.tex.x,l.tex.y,l.bl.x,l.bl.y])),i.push(0+f*4,1+f*4,2+f*4,2+f*4,3+f*4,0+f*4)}),{vertices:n,indices:i,size:7}}var tx=function(e){(0,Le.Z)(t,e);var r=iM(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"glyphInfoMap",{}),(0,B.Z)((0,Fe.Z)(n),"currentZoom",-1),(0,B.Z)((0,Fe.Z)(n),"textureHeight",0),(0,B.Z)((0,Fe.Z)(n),"textCount",0),(0,B.Z)((0,Fe.Z)(n),"preTextStyle",{}),(0,B.Z)((0,Fe.Z)(n),"mapping",(0,Pt.Z)(ge().mark(function l(){return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return n.initGlyph(),n.updateTexture(),v.next=4,n.reBuildModel();case 4:case"end":return v.stop()}},l)}))),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.stroke,s=o===void 0?"#fff":o,l=i.strokeWidth,f=l===void 0?0:l,v=i.halo,y=v===void 0?.5:v,b=i.gamma,T=b===void 0?2:b,M=i.raisingHeight,O=M===void 0?0:M,F=this.getFontServiceMapping(),$=this.getFontServiceCanvas();return F&&Object.keys(F).length!==this.textCount&&$&&(this.updateTexture(),this.textCount=Object.keys(F).length),this.preTextStyle=this.getTextStyle(),(0,V.Z)({u_raisingHeight:Number(O),u_stroke_width:f,u_stroke_color:fi(s),u_sdf_map:this.texture,u_halo_blur:y,u_gamma_scale:T,u_sdf_map_size:[($==null?void 0:$.width)||1,($==null?void 0:$.height)||1]},this.getStyleAttribute())}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.bindEvent(),this.extent=this.textExtent(),this.rawEncodeData=this.layer.getEncodedData(),this.preTextStyle=this.getTextStyle(),l.abrupt("return",this.buildModels());case 5:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.layer.getLayerConfig(),l=s.textAllowOverlap,f=l===void 0?!1:l,this.initGlyph(),this.updateTexture(),f||this.filterGlyphs(),b.next=6,this.layer.buildLayerModel({moduleName:"pointText",vertexShader:J1,fragmentShader:Q1,inject:this.getInject(),triangulation:ex.bind(this),depth:{enable:!1}});case 6:return v=b.sent,b.abrupt("return",[v]);case 8:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"needUpdate",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M,O,F,$,G;return ge().wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:if(s=this.getTextStyle(),l=s.textAllowOverlap,f=l===void 0?!1:l,v=s.textAnchor,y=v===void 0?"center":v,b=s.textOffset,T=s.padding,M=s.fontFamily,O=s.fontWeight,!(!pm(T,this.preTextStyle.padding)||!pm(b,this.preTextStyle.textOffset)||!pm(y,this.preTextStyle.textAnchor)||!pm(M,this.preTextStyle.fontFamily)||!pm(O,this.preTextStyle.fontWeight))){xe.next=5;break}return xe.next=4,this.mapping();case 4:return xe.abrupt("return",!0);case 5:if(!f){xe.next=7;break}return xe.abrupt("return",!1);case 7:if(F=this.mapService.getZoom(),$=this.mapService.getBounds(),G=il(this.extent,$),!(Math.abs(this.currentZoom-F)>.5||!G||f!==this.preTextStyle.textAllowOverlap)){xe.next=14;break}return xe.next=13,this.reBuildModel();case 13:return xe.abrupt("return",!0);case 14:return xe.abrupt("return",!1);case 15:case"end":return xe.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.layer.off("remapping",this.mapping)}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"textOffsets",type:dn.Attribute,descriptor:{name:"a_textOffsets",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[5],l[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?12:s;return Array.isArray(l)?[l[0]]:[l]}}}),this.styleAttributeService.registerStyleAttribute({name:"textUv",type:dn.Attribute,descriptor:{name:"a_tex",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}})}},{key:"bindEvent",value:function(){this.layer.isTileLayer||this.layer.on("remapping",this.mapping)}},{key:"textExtent",value:function(){var i=this.mapService.getBounds();return of(i,.5)}},{key:"initTextFont",value:function(){var i=this.getTextStyle(),o=i.fontWeight,s=i.fontFamily,l=this.rawEncodeData,f=[];l.forEach(function(v){var y=v.shape,b=y===void 0?"":y;b=b.toString();var T=rM(b),M;try{for(T.s();!(M=T.n()).done;){var O=M.value;f.indexOf(O)===-1&&f.push(O)}}catch(F){T.e(F)}finally{T.f()}}),this.fontService.setFontOptions({characterSet:f,fontWeight:o,fontFamily:s,iconfont:!1})}},{key:"initIconFontTex",value:function(){var i=this.getTextStyle(),o=i.fontWeight,s=i.fontFamily,l=this.rawEncodeData,f=[];l.forEach(function(v){var y=v.shape,b=y===void 0?"":y;b="".concat(b),f.indexOf(b)===-1&&f.push(b)}),this.fontService.setFontOptions({characterSet:f,fontWeight:o,fontFamily:s,iconfont:!0})}},{key:"getTextStyle",value:function(){var i=this.layer.getLayerConfig(),o=i.fontWeight,s=o===void 0?"400":o,l=i.fontFamily,f=l===void 0?"sans-serif":l,v=i.textAllowOverlap,y=v===void 0?!1:v,b=i.padding,T=b===void 0?[0,0]:b,M=i.textAnchor,O=M===void 0?"center":M,F=i.textOffset,$=F===void 0?[0,0]:F,G=i.opacity,ue=G===void 0?1:G,xe=i.strokeOpacity,ze=xe===void 0?1:xe,Je=i.strokeWidth,ht=Je===void 0?0:Je,gt=i.stroke,Ot=gt===void 0?"#000":gt;return{fontWeight:s,fontFamily:f,textAllowOverlap:y,padding:T,textAnchor:O,textOffset:$,opacity:ue,strokeOpacity:ze,strokeWidth:ht,stroke:Ot}}},{key:"generateGlyphLayout",value:function(i){var o=this,s=this.getFontServiceMapping(),l=this.layer.getLayerConfig(),f=l.spacing,v=f===void 0?2:f,y=l.textAnchor,b=y===void 0?"center":y,T=l.textOffset,M=this.rawEncodeData;this.glyphInfo=M.map(function(O){var F=O.shape,$=F===void 0?"":F,G=O.id,ue=O.size,xe=ue===void 0?1:ue,ze=O.textOffset?O.textOffset:T||[0,0],Je=O.textAnchor?O.textAnchor:b||"center",ht=eM($.toString(),s,xe,Je,"left",v,ze,i),gt=tM(ht,ze,!1);return O.shaping=ht,O.glyphQuads=gt,O.centroid=Fs(O.coordinates),O.originCentroid=O.version==="GAODE2.x"?Fs(O.originCoordinates):O.originCentroid=O.centroid,o.glyphInfoMap[G]={shaping:ht,glyphQuads:gt,centroid:Fs(O.coordinates)},O})}},{key:"getFontServiceMapping",value:function(){var i=this.layer.getLayerConfig(),o=i.fontWeight,s=o===void 0?"400":o,l=i.fontFamily,f=l===void 0?"sans-serif":l;return this.fontService.getMappingByKey("".concat(f,"_").concat(s))}},{key:"getFontServiceCanvas",value:function(){var i=this.layer.getLayerConfig(),o=i.fontWeight,s=o===void 0?"400":o,l=i.fontFamily,f=l===void 0?"sans-serif":l;return this.fontService.getCanvasByKey("".concat(f,"_").concat(s))}},{key:"filterGlyphs",value:function(){var i=this,o=this.layer.getLayerConfig(),s=o.padding,l=s===void 0?[0,0]:s,f=o.textAllowOverlap,v=f===void 0?!1:f;if(!v){this.glyphInfoMap={},this.currentZoom=this.mapService.getZoom(),this.extent=this.textExtent();var y=this.rendererService.getViewportSize(),b=y.width,T=y.height,M=new qR(b,T),O=this.glyphInfo.filter(function(F){var $=F.shaping,G=F.id,ue=G===void 0?0:G,xe=F.version==="GAODE2.x"?F.originCentroid:F.centroid,ze=F.size,Je=ze/16,ht=i.mapService.lngLatToContainer(xe),gt=M.placeCollisionBox({x1:$.left*Je-l[0],x2:$.right*Je+l[0],y1:$.top*Je-l[1],y2:$.bottom*Je+l[1],anchorPointX:ht.x,anchorPointY:ht.y}),Ot=gt.box;return Ot&&Ot.length?(M.insertCollisionBox(Ot,ue),!0):!1});O.forEach(function(F){i.glyphInfoMap[F.id]=F})}}},{key:"initGlyph",value:function(){var i=this.layer.getLayerConfig(),o=i.iconfont,s=o===void 0?!1:o;s?this.initIconFontTex():this.initTextFont(),this.generateGlyphLayout(s)}},{key:"updateTexture",value:function(){var i=this.rendererService.createTexture2D,o=this.getFontServiceCanvas();this.textureHeight=o.height,this.texture&&this.texture.destroy(),this.texture=i({data:o,mag:R.LINEAR,min:R.LINEAR,width:o.width,height:o.height})}},{key:"reBuildModel",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.filterGlyphs(),f.next=3,this.layer.buildLayerModel({moduleName:"pointText",vertexShader:J1,fragmentShader:Q1,triangulation:ex.bind(this),inject:this.getInject(),depth:{enable:!1}});case 3:s=f.sent,this.layer.models=[s];case 5:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()}]),t}(Ma),oM={fillImage:OR,fill:Z1,radar:WR,image:V1,normal:H1,simplePoint:lR,extrude:U1,text:tx,earthFill:xR,earthExtrude:vR},sM=oM;function uM(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=lM(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var v=t.next();return o=v.done,v},e:function(v){s=!0,l=v},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function lM(e,r){if(e){if(typeof e=="string")return rx(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return rx(e,r)}}function rx(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function cM(e){var r=fM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function fM(){if(typeof Reflect=="undefined"||!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(e){return!1}}var Cg=function(e){(0,Le.Z)(t,e);var r=cM(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"type","PointLayer"),(0,B.Z)((0,Fe.Z)(n),"enableShaderEncodeStyles",["stroke","offsets","opacity","rotation"]),(0,B.Z)((0,Fe.Z)(n),"enableDataEncodeStyles",["textOffset","textAnchor"]),(0,B.Z)((0,Fe.Z)(n),"defaultSourceConfig",{data:[],options:{parser:{type:"json",x:"lng",y:"lat"}}}),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel&&this.layerModel.clearModels(),this.layerModel=new sM[s](this),f.next=5,this.initLayerModels();case 5:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"rebuildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.buildModels();case 2:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getModelTypeWillEmptyData",value:function(){if(this.shapeOption){var i=this.shapeOption,o=i.field,s=i.values,l=this.getLayerConfig(),f=l.shape2d,v=this.iconService.getIconMap();if(o&&(f==null?void 0:f.indexOf(o))!==-1)return"fill";if(s==="text")return"text";if(s&&s instanceof Array){var y=uM(s),b;try{for(y.s();!(b=y.n()).done;){var T=b.value;if(typeof T=="string"&&v.hasOwnProperty(T))return"image"}}catch(M){y.e(M)}finally{y.f()}}}return"normal"}},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),o={fillImage:{},normal:{blend:"additive"},radar:{},simplePoint:{},fill:{blend:"normal"},extrude:{},image:{},text:{blend:"normal"},tile:{},tileText:{},earthFill:{},earthExtrude:{}};return o[i]}},{key:"getModelType",value:function(){var i=this.getEncodedData(),o=this.getLayerConfig(),s=o.shape2d,l=o.shape3d,f=o.billboard,v=f===void 0?!0:f,y=this.iconService.getIconMap(),b=i.find(function(M){return M.hasOwnProperty("shape")});if(b){var T=b.shape;return T==="dot"?"normal":T==="simple"?"simplePoint":T==="radar"?"radar":this.layerType==="fillImage"||v===!1?"fillImage":(s==null?void 0:s.indexOf(T))!==-1?this.mapService.version==="GLOBEL"?"earthFill":"fill":(l==null?void 0:l.indexOf(T))!==-1?this.mapService.version==="GLOBEL"?"earthExtrude":"extrude":y.hasOwnProperty(T)?"image":"text"}else return this.getModelTypeWillEmptyData()}}]),t}(Ip);function hM(e){var r=pM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function pM(){if(typeof Reflect=="undefined"||!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(e){return!1}}var dM=`uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
uniform float u_linearColor: 0;
|
|
|
|
uniform float u_topsurface: 1.0;
|
|
uniform float u_sidesurface: 1.0;
|
|
|
|
varying vec4 v_Color;
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
|
|
// top face
|
|
if(u_topsurface < 1.0) {
|
|
discard;
|
|
}
|
|
|
|
gl_FragColor = v_Color;
|
|
|
|
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,vM=`precision highp float;
|
|
|
|
#define ambientRatio 0.5
|
|
#define diffuseRatio 0.3
|
|
#define specularRatio 0.2
|
|
|
|
attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec3 a_Normal;
|
|
attribute float a_Size;
|
|
attribute vec3 a_uvs;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
uniform float u_linearColor: 0;
|
|
|
|
uniform float u_topsurface: 1.0;
|
|
uniform float u_sidesurface: 1.0;
|
|
|
|
varying vec4 v_Color;
|
|
uniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
uniform float u_raisingHeight: 0.0;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
float isSide = a_Position.z;
|
|
float topU = a_uvs[0];
|
|
float topV = 1.0 - a_uvs[1];
|
|
float sidey = a_uvs[2];
|
|
|
|
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);
|
|
float lightWeight = calc_lighting(pos);
|
|
|
|
vec4 project_pos = project_position(pos);
|
|
|
|
if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6
|
|
project_pos.z = a_Position.z * a_Size;
|
|
project_pos.z += u_raisingHeight;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
project_pos.z *= mapboxZoomScale;
|
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
|
|
// Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9
|
|
if(isSide < 0.999) {
|
|
// side face
|
|
// if(u_sidesurface < 1.0) {
|
|
// discard;
|
|
// }
|
|
|
|
if(u_linearColor == 1.0) {
|
|
vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);
|
|
linearColor.rgb *= lightWeight;
|
|
v_Color = linearColor;
|
|
} else {
|
|
v_Color = a_Color;
|
|
}
|
|
|
|
} else {
|
|
v_Color = a_Color;
|
|
}
|
|
|
|
v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity);
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,mM=`uniform sampler2D u_texture;
|
|
uniform float u_opacity: 1.0;
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
uniform float u_linearColor: 0;
|
|
|
|
uniform float u_topsurface: 1.0;
|
|
uniform float u_sidesurface: 1.0;
|
|
|
|
varying vec4 v_Color;
|
|
varying vec3 v_uvs;
|
|
varying vec2 v_texture_data;
|
|
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
float opacity = u_opacity;
|
|
float isSide = v_texture_data.x;
|
|
float lightWeight = v_texture_data.y;
|
|
float topU = v_uvs[0];
|
|
float topV = 1.0 - v_uvs[1];
|
|
float sidey = v_uvs[2];
|
|
// Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9
|
|
if(isSide < 0.999) {// \u662F\u5426\u662F\u8FB9\u7F18
|
|
// side face
|
|
if(u_sidesurface < 1.0) {
|
|
discard;
|
|
}
|
|
|
|
if(u_linearColor == 1.0) {
|
|
vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);
|
|
linearColor.rgb *= lightWeight;
|
|
gl_FragColor = linearColor;
|
|
} else {
|
|
gl_FragColor = v_Color;
|
|
}
|
|
} else {
|
|
|
|
// top face
|
|
if(u_topsurface < 1.0) {
|
|
discard;
|
|
}
|
|
|
|
gl_FragColor = texture2D(u_texture, vec2(topU, topV));
|
|
// gl_FragColor = vec4(1.0, 0., 0., 1.0);
|
|
}
|
|
|
|
|
|
gl_FragColor.a *= opacity;
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,gM=`precision highp float;
|
|
|
|
#define ambientRatio 0.5
|
|
#define diffuseRatio 0.3
|
|
#define specularRatio 0.2
|
|
|
|
attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec3 a_Normal;
|
|
attribute float a_Size;
|
|
attribute vec3 a_uvs;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform sampler2D u_texture;
|
|
|
|
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
uniform float u_topsurface: 1.0;
|
|
uniform float u_sidesurface: 1.0;
|
|
varying vec4 v_Color;
|
|
uniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
uniform float u_raisingHeight: 0.0;
|
|
uniform float u_linearColor: 0.0;
|
|
|
|
varying vec2 v_texture_data;
|
|
varying vec3 v_uvs;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);
|
|
float lightWeight = calc_lighting(pos);
|
|
vec4 project_pos = project_position(pos);
|
|
v_uvs = a_uvs;
|
|
|
|
v_texture_data = vec2(a_Position.z, lightWeight);
|
|
|
|
if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6
|
|
project_pos.z = a_Position.z * a_Size;
|
|
project_pos.z += u_raisingHeight;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
project_pos.z *= mapboxZoomScale;
|
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
|
|
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,_M=`uniform float u_opacity: 1.0;
|
|
uniform vec4 u_sourceColor;
|
|
uniform vec4 u_targetColor;
|
|
uniform float u_linearColor: 0;
|
|
|
|
uniform float u_topsurface: 1.0;
|
|
uniform float u_sidesurface: 1.0;
|
|
|
|
varying vec4 v_Color;
|
|
varying vec3 v_uvs;
|
|
varying vec2 v_texture_data;
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
float opacity = u_opacity;
|
|
float isSide = v_texture_data.x;
|
|
float sidey = v_uvs[2];
|
|
float lightWeight = v_texture_data.y;
|
|
|
|
// Tip: \u90E8\u5206\u673A\u578B GPU \u8BA1\u7B97\u7CBE\u5EA6\u517C\u5BB9
|
|
if(isSide < 0.999) {
|
|
// side face
|
|
if(u_sidesurface < 1.0) {
|
|
discard;
|
|
}
|
|
|
|
if( u_linearColor == 1.0) {
|
|
// side use linear
|
|
vec4 linearColor = mix(u_targetColor, u_sourceColor, sidey);
|
|
linearColor.rgb *= lightWeight;
|
|
gl_FragColor = linearColor;
|
|
} else {
|
|
// side notuse linear
|
|
gl_FragColor = v_Color;
|
|
}
|
|
} else {
|
|
// top face
|
|
if(u_topsurface < 1.0) {
|
|
discard;
|
|
}
|
|
gl_FragColor = v_Color;
|
|
}
|
|
|
|
gl_FragColor.a *= opacity;
|
|
gl_FragColor = filterColorAlpha(gl_FragColor, lightWeight);
|
|
}
|
|
`,yM=`precision highp float;
|
|
|
|
#define ambientRatio 0.5
|
|
#define diffuseRatio 0.3
|
|
#define specularRatio 0.2
|
|
|
|
attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec3 a_Normal;
|
|
attribute float a_Size;
|
|
attribute vec3 a_uvs;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
uniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
uniform float u_raisingHeight: 0.0;
|
|
|
|
varying vec2 v_texture_data;
|
|
varying vec3 v_uvs;
|
|
varying vec4 v_Color;
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
|
|
v_uvs = a_uvs;
|
|
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
|
|
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);
|
|
vec4 project_pos = project_position(pos);
|
|
|
|
if(u_heightfixed > 0.0) { // \u5224\u65AD\u51E0\u4F55\u4F53\u662F\u5426\u56FA\u5B9A\u9AD8\u5EA6
|
|
project_pos.z = a_Position.z * a_Size;
|
|
project_pos.z += u_raisingHeight;
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
project_pos.z *= mapboxZoomScale;
|
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
float lightWeight = calc_lighting(pos);
|
|
v_texture_data = vec2(a_Position.z,lightWeight);
|
|
|
|
v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,xM=function(e){(0,Le.Z)(t,e);var r=hM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.heightfixed,s=o===void 0?!1:o,l=i.raisingHeight,f=l===void 0?0:l,v=i.topsurface,y=v===void 0?!0:v,b=i.sidesurface,T=b===void 0?!0:b,M=i.sourceColor,O=i.targetColor,F=0,$=[1,1,1,1],G=[1,1,1,1];return M&&O&&($=fi(M),G=fi(O),F=1),(0,V.Z)({u_topsurface:Number(y),u_sidesurface:Number(T),u_heightfixed:Number(s),u_raisingHeight:Number(f),u_linearColor:F,u_sourceColor:$,u_targetColor:G,u_texture:this.texture},this.getStyleAttribute())}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.loadTexture();case 2:return l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return s=this.getShaders(),l=s.frag,f=s.vert,v=s.type,T.next=3,this.layer.buildLayerModel({moduleName:v,vertexShader:f,fragmentShader:l,inject:this.getInject(),triangulation:$0});case 3:return y=T.sent,T.abrupt("return",[y]);case 5:case"end":return T.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){var i=this.layer.getLayerConfig(),o=i.pickLight,s=i.mapTexture;return s?{frag:mM,vert:gM,type:"polygonExtrudeTexture"}:o?{frag:_M,vert:yM,type:"polygonExtrudePickLight"}:{frag:dM,vert:vM,type:"polygonExtrude"}}},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getSource().extent,o=i,s=this.layer.coordCenter||this.layer.getSource().center,l=o[2]-o[0],f=o[3]-o[1];if(this.mapService.version==="GAODE2.x"){var v=this.mapService.coordToAMap2RelativeCoordinates([i[0],i[1]],s),y=(0,Sn.Z)(v,2),b=y[0],T=y[1],M=this.mapService.coordToAMap2RelativeCoordinates([i[2],i[3]],s),O=(0,Sn.Z)(M,2),F=O[0],$=O[1];l=F-b,f=$-T,o=[b,T,F,$]}this.styleAttributeService.registerStyleAttribute({name:"uvs",type:dn.Attribute,descriptor:{name:"a_uvs",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(ue,xe,ze){var Je=ze[0],ht=ze[1];return[(Je-o[0])/l,(ht-o[1])/f,ze[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(ue,xe,ze,Je,ht){return ht}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(ue){var xe=ue.size,ze=xe===void 0?10:xe;return Array.isArray(ze)?[ze[0]]:[ze]}}})}},{key:"loadTexture",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s=this,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(l=this.layer.getLayerConfig(),f=l.mapTexture,v=this.rendererService.createTexture2D,this.texture=v({height:0,width:0}),!f){b.next=5;break}return b.abrupt("return",new Promise(function(T,M){var O=new Image;O.crossOrigin="anonymous",O.src=f,O.onload=function(){return s.texture=v({data:O,width:O.width,height:O.height,wrapS:R.CLAMP_TO_EDGE,wrapT:R.CLAMP_TO_EDGE,min:R.LINEAR,mag:R.LINEAR}),T(null)},O.onerror=function(){M(new Error("image load error"))}}));case 5:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()}]),t}(Ma);function bM(e){var r=EM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function EM(){if(typeof Reflect=="undefined"||!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(e){return!1}}var SM=`
|
|
uniform float u_opacity: 1.0;
|
|
varying vec4 v_Color;
|
|
varying vec2 v_texture_data;
|
|
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
gl_FragColor = v_Color;
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,AM=`precision highp float;
|
|
|
|
#define ambientRatio 0.5
|
|
#define diffuseRatio 0.3
|
|
#define specularRatio 0.2
|
|
|
|
attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
attribute vec3 a_Normal;
|
|
attribute float a_Size;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
|
|
|
|
varying vec4 v_Color;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "light"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
|
|
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size + (1.0 - a_Position.z) * extrusionBase, 1.0);
|
|
float lightWeight = calc_lighting(pos);
|
|
vec4 project_pos = project_position(pos);
|
|
v_Color = a_Color;
|
|
v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity);
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,TM=function(e){(0,Le.Z)(t,e);var r=bM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){return(0,V.Z)({},this.getStyleAttribute())}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return s=this.getShaders(),l=s.frag,f=s.vert,v=s.type,T.next=3,this.layer.buildLayerModel({moduleName:v,vertexShader:f,fragmentShader:l,inject:this.getInject(),triangulation:$0});case 3:return y=T.sent,T.abrupt("return",[y]);case 5:case"end":return T.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){return{frag:SM,vert:AM,type:"polygonExtrude"}}},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:dn.Attribute,descriptor:{name:"a_Normal",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(o,s,l,f,v){return v}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:dn.Attribute,descriptor:{name:"a_Size",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(o){var s=o.size,l=s===void 0?10:s;return Array.isArray(l)?[l[0]]:[l]}}})}}]),t}(Ma);function wM(e){var r=CM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function CM(){if(typeof Reflect=="undefined"||!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(e){return!1}}var RM=`varying vec4 v_color;
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
gl_FragColor = v_color;
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,MM=`#pragma include "picking"
|
|
uniform float u_opacitylinear: 0.0;
|
|
uniform float u_dir: 1.0;
|
|
varying vec3 v_linear;
|
|
varying vec2 v_pos;
|
|
varying vec4 v_Color;
|
|
|
|
|
|
void main() {
|
|
gl_FragColor = v_Color;
|
|
if(u_opacitylinear > 0.0) {
|
|
gl_FragColor.a *= u_dir == 1.0 ? 1.0 - length(v_pos - v_linear.xy)/v_linear.z : length(v_pos - v_linear.xy)/v_linear.z;
|
|
}
|
|
gl_FragColor = filterColor(gl_FragColor);
|
|
}
|
|
`,IM=`attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
uniform float u_raisingHeight: 0.0;
|
|
|
|
varying vec4 v_Color;
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
uniform float u_opacitylinear: 0.0;
|
|
|
|
attribute vec3 a_linear;
|
|
varying vec3 v_linear;
|
|
varying vec2 v_pos;
|
|
|
|
void main() {
|
|
if(u_opacitylinear > 0.0) {
|
|
v_linear = a_linear;
|
|
v_pos = a_Position.xy;
|
|
}
|
|
v_Color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
project_pos.z += u_raisingHeight;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
project_pos.z *= mapboxZoomScale;
|
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
setPickingColor(a_PickingColor);
|
|
}`,PM=`attribute vec4 a_Color;
|
|
attribute vec3 a_Position;
|
|
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
uniform float u_raisingHeight: 0.0;
|
|
|
|
varying vec4 v_color;
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
|
|
|
|
// cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97
|
|
|
|
v_color = vec4(a_Color.xyz, a_Color.w * opacity);
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
|
|
project_pos.z += u_raisingHeight;
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
project_pos.z *= mapboxZoomScale;
|
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
}
|
|
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
|
|
`,OM=function(e){(0,Le.Z)(t,e);var r=wM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.raisingHeight,s=o===void 0?0:o,l=i.opacityLinear,f=l===void 0?{enable:!1,dir:"in"}:l;return(0,V.Z)({u_raisingHeight:Number(s),u_opacitylinear:Number(f.enable),u_dir:f.dir==="in"?1:0},this.getStyleAttribute())}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b;return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return s=this.getModelParams(),l=s.frag,f=s.vert,v=s.triangulation,y=s.type,this.layer.triangulation=v,M.next=4,this.layer.buildLayerModel({moduleName:y,vertexShader:f,fragmentShader:l,inject:this.getInject(),triangulation:v,primitive:R.TRIANGLES,depth:{enable:!1}});case 4:return b=M.sent,M.abrupt("return",[b]);case 6:case"end":return M.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getLayerConfig(),o=i.opacityLinear,s=o===void 0?{enable:!1,dir:"in"}:o;s.enable&&this.styleAttributeService.registerStyleAttribute({name:"linear",type:dn.Attribute,descriptor:{name:"a_linear",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:3,update:function(f,v,y){return[y[3],y[4],y[5]]}}})}},{key:"getModelParams",value:function(){var i=this.layer.getLayerConfig(),o=i.opacityLinear,s=o===void 0?{enable:!1}:o;return s.enable?{frag:MM,vert:IM,type:"polygonLinear",triangulation:zw}:{frag:RM,vert:PM,type:"polygonFill",triangulation:Id}}}]),t}(Ma);function DM(e){var r=FM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function FM(){if(typeof Reflect=="undefined"||!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(e){return!1}}var kM=`
|
|
uniform float u_time: 0.0;
|
|
uniform float u_opacity: 1.0;
|
|
|
|
varying vec2 v_uv;
|
|
|
|
float coast2water_fadedepth = 0.10;
|
|
float large_waveheight = .750; // change to adjust the "heavy" waves
|
|
float large_wavesize = 3.4; // factor to adjust the large wave size
|
|
float small_waveheight = 0.6; // change to adjust the small random waves
|
|
float small_wavesize = 0.5; // factor to ajust the small wave size
|
|
float water_softlight_fact = 15.; // range [1..200] (should be << smaller than glossy-fact)
|
|
float water_glossylight_fact= 120.; // range [1..200]
|
|
float particle_amount = 70.;
|
|
// vec3 watercolor = vec3(0.43, 0.60, 0.66); // 'transparent' low-water color (RGB)
|
|
// vec3 watercolor2 = vec3(0.06, 0.07, 0.11); // deep-water color (RGB, should be darker than the low-water color)
|
|
uniform vec4 u_watercolor;
|
|
uniform vec4 u_watercolor2;
|
|
vec3 water_specularcolor = vec3(1.3, 1.3, 0.9); // specular Color (RGB) of the water-highlights
|
|
#define light vec3(-0., sin(u_time*0.5)*.5 + .35, 2.8) // position of the sun
|
|
|
|
uniform sampler2D u_texture1;
|
|
uniform sampler2D u_texture2;
|
|
uniform sampler2D u_texture3;
|
|
|
|
|
|
|
|
float hash( float n ) {
|
|
return fract(sin(n)*43758.5453123);
|
|
}
|
|
|
|
// 2d noise function
|
|
float noise1( in vec2 x ) {
|
|
vec2 p = floor(x);
|
|
vec2 f = smoothstep(0.0, 1.0, fract(x));
|
|
float n = p.x + p.y*57.0;
|
|
return mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x),
|
|
mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y);
|
|
}
|
|
|
|
float noise(vec2 p) {
|
|
return texture2D(u_texture2,p*vec2(1./256.)).x;
|
|
}
|
|
|
|
vec4 highness(vec2 p) {
|
|
vec4 t = texture2D(u_texture1,fract(p));
|
|
float clipped = -2.0-smoothstep(3.,10.,t.a)*6.9-smoothstep(10.,100.,t.a)*89.9-smoothstep(0.,10000.,t.a)*10000.0;
|
|
return clamp(t, 0.0,3.0)+clamp(t/3.0-1.0, 0.0,1.0)+clamp(t/16.0-1.0, 0.0,1.0);
|
|
}
|
|
|
|
float height_map( vec2 p ) {
|
|
vec4 height=highness(p);
|
|
/*
|
|
height = -0.5+
|
|
0.5*smoothstep(-100.,0.,-height)+
|
|
2.75*smoothstep(0.,2.,height)+
|
|
1.75*smoothstep(2.,4.,height)+
|
|
2.75*smoothstep(4.,16.,height)+
|
|
1.5*smoothstep(16.,1000.,height);
|
|
*/
|
|
|
|
mat2 m = mat2( 0.9563*1.4, -0.2924*1.4, 0.2924*1.4, 0.9563*1.4 );
|
|
//p = p*6.;
|
|
float f = 0.6000*noise1( p ); p = m*p*1.1*6.;
|
|
f += 0.2500*noise( p ); p = m*p*1.32;
|
|
f += 0.1666*noise( p ); p = m*p*1.11;
|
|
f += 0.0834*noise( p ); p = m*p*1.12;
|
|
f += 0.0634*noise( p ); p = m*p*1.13;
|
|
f += 0.0444*noise( p ); p = m*p*1.14;
|
|
f += 0.0274*noise( p ); p = m*p*1.15;
|
|
f += 0.0134*noise( p ); p = m*p*1.16;
|
|
f += 0.0104*noise( p ); p = m*p*1.17;
|
|
f += 0.0084*noise( p );
|
|
f = .25*f+dot(height,vec4(-.03125,-.125,.25,.25))*.5;
|
|
const float FLAT_LEVEL = 0.92525;
|
|
//f = f*0.25+height*0.75;
|
|
if (f<FLAT_LEVEL)
|
|
f = f;
|
|
else
|
|
f = pow((f-FLAT_LEVEL)/(1.-FLAT_LEVEL), 2.)*(1.-FLAT_LEVEL)*2.0+FLAT_LEVEL; // makes a smooth coast-increase
|
|
return clamp(f, 0., 10.);
|
|
}
|
|
|
|
vec3 plasma_quintic( float x ) {
|
|
x = clamp( x, 0.0, 1.0);
|
|
vec4 x1 = vec4( 1.0, x, x * x, x * x * x ); // 1 x x2 x3
|
|
vec4 x2 = x1 * x1.w * x; // x4 x5 x6 x7
|
|
return vec3(
|
|
dot( x1.xyzw, vec4( +0.063861086, +1.992659096, -1.023901152, -0.490832805 ) ) + dot( x2.xy, vec2( +1.308442123, -0.914547012 ) ),
|
|
dot( x1.xyzw, vec4( +0.049718590, -0.791144343, +2.892305078, +0.811726816 ) ) + dot( x2.xy, vec2( -4.686502417, +2.717794514 ) ),
|
|
dot( x1.xyzw, vec4( +0.513275779, +1.580255060, -5.164414457, +4.559573646 ) ) + dot( x2.xy, vec2( -1.916810682, +0.570638854 ) ) );
|
|
}
|
|
|
|
vec4 color(vec2 p){
|
|
vec4 c1 = vec4(1.7,1.6,.9,1);
|
|
vec4 c2 = vec4(.2,.94,.1,1);
|
|
vec4 c3 = vec4(.3,.2,.0,1);
|
|
vec4 c4 = vec4(.99,.99,1.6,1);
|
|
vec4 v = highness(p);
|
|
float los = smoothstep(0.1,1.1,v.b);
|
|
float his = smoothstep(3.5,6.5,v.b);
|
|
float ces = smoothstep(1.,5.,v.a);
|
|
vec4 lo = mix(c1,c2,los);
|
|
vec4 hi = mix(c3,c4,his);
|
|
vec4 ce = mix(lo,hi,ces);
|
|
|
|
return vec4(plasma_quintic(ces),1).ragb;
|
|
}
|
|
|
|
vec3 terrain_map( vec2 p )
|
|
{
|
|
return color(p).rgb*0.75+0.25*vec3(0.7, .55, .4)+texture2D(u_texture3, fract(p*5.)).rgb*.5; // test-terrain is simply 'sandstone'
|
|
}
|
|
|
|
const mat2 m = mat2( 0.72, -1.60, 1.60, 0.72 );
|
|
|
|
float water_map( vec2 p, float height ) {
|
|
vec2 p2 = p*large_wavesize;
|
|
vec2 shift1 = 0.001*vec2( u_time*160.0*2.0, u_time*120.0*2.0 );
|
|
vec2 shift2 = 0.001*vec2( u_time*190.0*2.0, -u_time*130.0*2.0 );
|
|
|
|
// coarse crossing 'ocean' waves...
|
|
float f = 0.6000*noise( p );
|
|
f += 0.2500*noise( p*m );
|
|
f += 0.1666*noise( p*m*m );
|
|
float wave = sin(p2.x*0.622+p2.y*0.622+shift2.x*4.269)*large_waveheight*f*height*height ;
|
|
|
|
p *= small_wavesize;
|
|
f = 0.;
|
|
float amp = 1.0, s = .5;
|
|
for (int i=0; i<9; i++)
|
|
{ p = m*p*.947; f -= amp*abs(sin((noise( p+shift1*s )-.5)*2.)); amp = amp*.59; s*=-1.329; }
|
|
|
|
return wave+f*small_waveheight;
|
|
}
|
|
|
|
float nautic(vec2 p) {
|
|
p *= 18.;
|
|
float f = 0.;
|
|
float amp = 1.0, s = .5;
|
|
for (int i=0; i<3; i++)
|
|
{ p = m*p*1.2; f += amp*abs(smoothstep(0., 1., noise( p+u_time*s ))-.5); amp = amp*.5; s*=-1.227; }
|
|
return pow(1.-f, 5.);
|
|
}
|
|
|
|
float particles(vec2 p) {
|
|
p *= 200.;
|
|
float f = 0.;
|
|
float amp = 1.0, s = 1.5;
|
|
for (int i=0; i<3; i++)
|
|
{ p = m*p*1.2; f += amp*noise( p+u_time*s ); amp = amp*.5; s*=-1.227; }
|
|
return pow(f*.35, 7.)*particle_amount;
|
|
}
|
|
|
|
float test_shadow( vec2 xy, float height) {
|
|
vec3 r0 = vec3(xy, height);
|
|
vec3 rd = normalize( light - r0 );
|
|
|
|
float hit = 1.0;
|
|
float t = 0.001;
|
|
for (int j=1; j<25; j++)
|
|
{
|
|
vec3 p = r0 + t*rd;
|
|
float h = height_map( p.xy );
|
|
float height_diff = p.z - h;
|
|
if (height_diff<0.0)
|
|
{
|
|
return 0.0;
|
|
}
|
|
t += 0.01+height_diff*.02;
|
|
hit = min(hit, 2.*height_diff/t); // soft shaddow
|
|
}
|
|
return hit;
|
|
}
|
|
|
|
vec3 CalcTerrain(vec2 uv, float height) {
|
|
vec3 col = terrain_map( uv );
|
|
vec2 iResolution = vec2(512.);
|
|
float h1 = height_map(uv-vec2(0., 0.5)/ iResolution.xy);
|
|
float h2 = height_map(uv+vec2(0., 0.5)/ iResolution.xy);
|
|
float h3 = height_map(uv-vec2(0.5, 0.)/ iResolution.xy);
|
|
float h4 = height_map(uv+vec2(0.5, 0.)/ iResolution.xy);
|
|
vec3 norm = normalize(vec3(h3-h4, h1-h2, 1.));
|
|
vec3 r0 = vec3(uv, height);
|
|
vec3 rd = normalize( light - r0 );
|
|
float grad = dot(norm, rd);
|
|
col *= grad+pow(grad, 8.);
|
|
float terrainshade = test_shadow( uv, height );
|
|
col = mix(col*.25, col, terrainshade);
|
|
return col;
|
|
}
|
|
|
|
|
|
void main() {
|
|
vec3 watercolor = u_watercolor.rgb;
|
|
vec3 watercolor2 = u_watercolor2.rgb;
|
|
vec2 uv = v_uv;
|
|
float WATER_LEVEL = 0.84; // Water level (range: 0.0 - 2.0)
|
|
float deepwater_fadedepth = 0.4 + coast2water_fadedepth;
|
|
float height = height_map( uv );
|
|
vec3 col;
|
|
|
|
float waveheight = clamp(WATER_LEVEL*3.-1.5, 0., 1.);
|
|
float level = WATER_LEVEL + .2*water_map(uv*15. + vec2(u_time*.1), waveheight);
|
|
if (height > level)
|
|
{
|
|
col = CalcTerrain(uv, height);
|
|
}
|
|
if (height <= level)
|
|
{
|
|
vec2 dif = vec2(.0, .01);
|
|
vec2 pos = uv*15. + vec2(u_time*.01);
|
|
float h1 = water_map(pos-dif,waveheight);
|
|
float h2 = water_map(pos+dif,waveheight);
|
|
float h3 = water_map(pos-dif.yx,waveheight);
|
|
float h4 = water_map(pos+dif.yx,waveheight);
|
|
vec3 normwater = normalize(vec3(h3-h4, h1-h2, .125)); // norm-vector of the 'bumpy' water-plane
|
|
uv += normwater.xy*.002*(level-height);
|
|
|
|
col = CalcTerrain(uv, height);
|
|
|
|
float coastfade = clamp((level-height)/coast2water_fadedepth, 0., 1.);
|
|
float coastfade2= clamp((level-height)/deepwater_fadedepth, 0., 1.);
|
|
float intensity = col.r*.2126+col.g*.7152+col.b*.0722;
|
|
watercolor = mix(watercolor*intensity, watercolor2, smoothstep(0., 1., coastfade2));
|
|
|
|
vec3 r0 = vec3(uv, WATER_LEVEL);
|
|
vec3 rd = normalize( light - r0 ); // ray-direction to the light from water-position
|
|
float grad = dot(normwater, rd); // dot-product of norm-vector and light-direction
|
|
float specular = pow(grad, water_softlight_fact); // used for soft highlights
|
|
float specular2= pow(grad, water_glossylight_fact); // used for glossy highlights
|
|
float gradpos = dot(vec3(0., 0., 1.), rd);
|
|
float specular1= smoothstep(0., 1., pow(gradpos, 5.)); // used for diffusity (some darker corona around light's specular reflections...)
|
|
float watershade = test_shadow( uv, level );
|
|
watercolor *= 2.2+watershade;
|
|
watercolor += (.2+.8*watershade) * ((grad-1.0)*.5+specular) * .25;
|
|
watercolor /= (1.+specular1*1.25);
|
|
watercolor += watershade*specular2*water_specularcolor;
|
|
watercolor += watershade*coastfade*(1.-coastfade2)*(vec3(.5, .6, .7)*nautic(uv)+vec3(1., 1., 1.)*particles(uv));
|
|
|
|
col = mix(col, watercolor, coastfade);
|
|
}
|
|
|
|
|
|
float opacity = u_opacity;
|
|
gl_FragColor = vec4(col, opacity);
|
|
}
|
|
`,BM=`attribute vec2 a_uv;
|
|
attribute vec3 a_Position;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
varying vec2 v_uv;
|
|
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
v_uv = a_uv;
|
|
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
}
|
|
|
|
`,LM=oi.isNumber,NM=function(e){(0,Le.Z)(t,e);var r=DM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.watercolor,f=l===void 0?"#6D99A8":l,v=i.watercolor2,y=v===void 0?"#0F121C":v;return{u_texture1:this.texture1,u_texture2:this.texture2,u_texture3:this.texture3,u_watercolor:fi(f),u_watercolor2:fi(y),u_opacity:LM(s)?s:1}}},{key:"getAnimateUniforms",value:function(){return{u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.loadTexture(),l.abrupt("return",this.buildModels());case 2:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"polygonOcean",vertexShader:BM,fragmentShader:kM,triangulation:X0,primitive:R.TRIANGLES,depth:{enable:!1}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i,o,s;(i=this.texture1)===null||i===void 0||i.destroy(),(o=this.texture2)===null||o===void 0||o.destroy(),(s=this.texture3)===null||s===void 0||s.destroy()}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getSource().extent,o=(0,Sn.Z)(i,4),s=o[0],l=o[1],f=o[2],v=o[3],y=f-s,b=v-l;this.styleAttributeService.registerStyleAttribute({name:"oceanUv",type:dn.Attribute,descriptor:{name:"a_uv",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(M,O,F,$){var G=M.version==="GAODE2.x"?M.originCoordinates[0][$]:F,ue=(0,Sn.Z)(G,2),xe=ue[0],ze=ue[1];return[(xe-s)/y,(ze-l)/b]}}})}},{key:"loadTexture",value:function(){var i=this,o=this.rendererService.createTexture2D,s={height:0,width:0};this.texture1=o(s),this.texture2=o(s),this.texture3=o(s),l(function(v){i.texture1=f(v[0]),i.texture2=f(v[1]),i.texture3=f(v[2]),i.layerService.reRender()});function l(v){var y=0,b=[],T=["https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ","https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*MJ22QbpuCzIAAAAAAAAAAAAAARQnAQ","https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*-z2HSIVDsHIAAAAAAAAAAAAAARQnAQ"];T.map(function(M){var O=new Image;O.crossOrigin="",O.src=M,b.push(O),O.onload=function(){y++,y===3&&v(b)}})}function f(v){return o({data:v,width:v.width,height:v.height,wrapS:R.MIRRORED_REPEAT,wrapT:R.MIRRORED_REPEAT,min:R.LINEAR,mag:R.LINEAR})}}}]),t}(Ma);function UM(e){var r=zM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function zM(){if(typeof Reflect=="undefined"||!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(e){return!1}}var ZM=`uniform sampler2D u_texture;
|
|
uniform float u_time: 0.0;
|
|
uniform float u_speed: 1.0;
|
|
uniform float u_opacity: 1.0;
|
|
|
|
varying vec4 v_Color;
|
|
varying vec2 v_uv;
|
|
|
|
float rand(vec2 n) { return 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453); }
|
|
|
|
float water(vec3 p) {
|
|
float t = u_time * u_speed;
|
|
p.z += t * 2.; p.x += t * 2.;
|
|
vec3 c1 = texture2D(u_texture, p.xz / 30.).xyz;
|
|
p.z += t * 3.; p.x += t * 0.52;
|
|
vec3 c2 = texture2D(u_texture, p.xz / 30.).xyz;
|
|
p.z += t * 4.; p.x += t * 0.8;
|
|
vec3 c3 = texture2D(u_texture, p.xz / 30.).xyz;
|
|
c1 += c2 - c3;
|
|
float z = (c1.x + c1.y + c1.z) / 3.;
|
|
return p.y + z / 4.;
|
|
}
|
|
|
|
float map(vec3 p) {
|
|
float d = 100.0;
|
|
d = water(p);
|
|
return d;
|
|
}
|
|
|
|
float intersect(vec3 ro, vec3 rd) {
|
|
float d = 0.0;
|
|
for (int i = 0; i <= 100; i++) {
|
|
float h = map(ro + rd * d);
|
|
if (h < 0.1) return d;
|
|
d += h;
|
|
}
|
|
return 0.0;
|
|
}
|
|
|
|
vec3 norm(vec3 p) {
|
|
float eps = .1;
|
|
return normalize(vec3(
|
|
map(p + vec3(eps, 0, 0)) - map(p + vec3(-eps, 0, 0)),
|
|
map(p + vec3(0, eps, 0)) - map(p + vec3(0, -eps, 0)),
|
|
map(p + vec3(0, 0, eps)) - map(p + vec3(0, 0, -eps))
|
|
));
|
|
}
|
|
|
|
float calSpc() {
|
|
vec3 l1 = normalize(vec3(1, 1, 1));
|
|
vec3 ro = vec3(-3, 20, -8);
|
|
vec3 rc = vec3(0, 0, 0);
|
|
vec3 ww = normalize(rc - ro);
|
|
vec3 uu = normalize(cross(vec3(0,1,0), ww));
|
|
vec3 vv = normalize(cross(rc - ro, uu));
|
|
vec3 rd = normalize(uu * v_uv.x + vv * v_uv.y + ww);
|
|
float d = intersect(ro, rd);
|
|
vec3 p = ro + rd * d;
|
|
vec3 n = norm(p);
|
|
float spc = pow(max(0.0, dot(reflect(l1, n), rd)), 30.0);
|
|
return spc;
|
|
}
|
|
|
|
void main() {
|
|
float opacity = u_opacity;
|
|
gl_FragColor = v_Color;
|
|
gl_FragColor.a *= opacity;
|
|
|
|
float spc = calSpc();
|
|
gl_FragColor += spc * 0.4;
|
|
}
|
|
`,VM=`attribute vec4 a_Color;
|
|
attribute vec2 a_uv;
|
|
attribute vec3 a_Position;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
varying vec4 v_Color;
|
|
varying vec2 v_uv;
|
|
uniform float u_opacity: 1.0;
|
|
|
|
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
v_uv = a_uv;
|
|
|
|
v_Color = a_Color;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
}
|
|
|
|
`,jM=oi.isNumber,HM=function(e){(0,Le.Z)(t,e);var r=UM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.speed,f=l===void 0?.5:l;return{u_texture:this.texture,u_speed:f,u_opacity:jM(s)?s:1}}},{key:"getAnimateUniforms",value:function(){return{u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.loadTexture(),l.abrupt("return",this.buildModels());case 2:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"polygonWater",vertexShader:VM,fragmentShader:ZM,triangulation:X0,primitive:R.TRIANGLES,depth:{enable:!1}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getSource().extent,o=(0,Sn.Z)(i,4),s=o[0],l=o[1],f=o[2],v=o[3],y=f-s,b=v-l;this.styleAttributeService.registerStyleAttribute({name:"waterUv",type:dn.Attribute,descriptor:{name:"a_uv",buffer:{usage:R.STATIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(M,O,F,$){var G=M.version==="GAODE2.x"?M.originCoordinates[0][$]:F,ue=(0,Sn.Z)(G,2),xe=ue[0],ze=ue[1];return[(xe-s)/y,(ze-l)/b]}}})}},{key:"loadTexture",value:function(){var i=this,o=this.layer.getLayerConfig(),s=o.waterTexture,l=this.rendererService.createTexture2D;this.texture=l({height:0,width:0});var f=new Image;f.crossOrigin="",s?(console.warn("L7 recommend\uFF1Ahttps://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ"),f.src=s):f.src="https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ",f.onload=function(){i.texture=l({data:f,width:f.width,height:f.height,wrapS:R.MIRRORED_REPEAT,wrapT:R.MIRRORED_REPEAT,min:R.LINEAR,mag:R.LINEAR}),i.layerService.reRender()}}}]),t}(Ma),WM={fill:OM,line:B1,extrude:xM,text:tx,point_fill:Z1,point_image:V1,point_normal:H1,point_extrude:U1,water:HM,ocean:NM,extrusion:TM},GM=WM;function XM(e){var r=$M();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function $M(){if(typeof Reflect=="undefined"||!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(e){return!1}}var Rg=function(e){(0,Le.Z)(t,e);var r=XM(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"type","PolygonLayer"),(0,B.Z)((0,Fe.Z)(n),"enableShaderEncodeStyles",["opacity","extrusionBase","rotation","offsets","stroke"]),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel=new GM[s](this),f.next=4,this.initLayerModels();case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getModelType",value:function(){var i,o=this.styleAttributeService.getLayerStyleAttribute("shape"),s=o==null||(i=o.scale)===null||i===void 0?void 0:i.field;return s==="fill"||!s?"fill":s==="extrude"?"extrude":s==="extrusion"?"extrusion":s==="water"?"water":s==="ocean"?"ocean":s==="line"?"line":this.getPointModelType()}},{key:"getPointModelType",value:function(){var i=this.getEncodedData(),o=this.getLayerConfig(),s=o.shape2d,l=o.shape3d,f=this.iconService.getIconMap(),v=i.find(function(b){return b.hasOwnProperty("shape")});if(v){var y=v.shape;return y==="dot"?"point_normal":(s==null?void 0:s.indexOf(y))!==-1?"point_fill":(l==null?void 0:l.indexOf(y))!==-1?"point_extrude":f.hasOwnProperty(y)?"point_image":"text"}else return"fill"}}]),t}(Ip);function YM(e){var r=qM();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function qM(){if(typeof Reflect=="undefined"||!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(e){return!1}}var KM=`precision mediump float;
|
|
uniform float u_opacity: 1.0;
|
|
uniform sampler2D u_texture;
|
|
uniform sampler2D u_colorTexture;
|
|
uniform float u_min;
|
|
uniform float u_max;
|
|
uniform vec2 u_domain;
|
|
uniform float u_noDataValue;
|
|
uniform bool u_clampLow: true;
|
|
uniform bool u_clampHigh: true;
|
|
varying vec2 v_texCoord;
|
|
bool isnan_emu(float x) { return (x > 0.0 || x < 0.0) ? x != x : x != 0.0; }
|
|
|
|
|
|
void main() {
|
|
|
|
float value = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).r;
|
|
if (value == u_noDataValue || isnan_emu(value))
|
|
discard;
|
|
else if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1]))
|
|
discard;
|
|
else {
|
|
float normalisedValue =(value - u_domain[0]) / (u_domain[1] -u_domain[0]);
|
|
vec4 color = texture2D(u_colorTexture,vec2(normalisedValue, 0));
|
|
|
|
gl_FragColor = color;
|
|
gl_FragColor.a = gl_FragColor.a * u_opacity ;
|
|
if(gl_FragColor.a < 0.01)
|
|
discard;
|
|
|
|
}
|
|
}
|
|
`,QM=`precision highp float;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
attribute vec3 a_Position;
|
|
attribute vec2 a_Uv;
|
|
varying vec2 v_texCoord;
|
|
#pragma include "projection"
|
|
void main() {
|
|
v_texCoord = a_Uv;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
|
|
}
|
|
`,nx=function(e){(0,Le.Z)(t,e);var r=YM(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.clampLow,f=l===void 0?!0:l,v=i.clampHigh,y=v===void 0?!0:v,b=i.noDataValue,T=b===void 0?-9999999:b,M=i.domain,O=i.rampColors,F=M||Cc(O);return this.colorTexture=this.layer.textureService.getColorTexture(O,F),{u_opacity:s||1,u_texture:this.texture,u_domain:F,u_clampLow:f,u_clampHigh:typeof y!="undefined"?y:f,u_noDataValue:T,u_colorTexture:this.colorTexture}}},{key:"getRasterData",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l,f,v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(!Array.isArray(s.data)){T.next=4;break}return T.abrupt("return",{data:s.data,width:s.width,height:s.height});case 4:return T.next=6,s.data;case 6:return l=T.sent,f=l.rasterData,v=l.width,y=l.height,T.abrupt("return",{data:Array.from(f),width:v,height:y});case 11:case"end":return T.stop()}},o)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return s=this.layer.getSource(),l=this.rendererService.createTexture2D,f=s.data.dataArray[0],F.next=5,this.getRasterData(f);case 5:return v=F.sent,y=v.data,b=v.width,T=v.height,this.texture=l({data:y,width:b,height:T,format:R.LUMINANCE,type:R.FLOAT}),F.next=12,this.layer.buildLayerModel({moduleName:"rasterImageData",vertexShader:QM,fragmentShader:KM,triangulation:Sg,primitive:R.TRIANGLES,depth:{enable:!1}});case 12:return M=F.sent,F.abrupt("return",[M]);case 14:case"end":return F.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i,o;(i=this.texture)===null||i===void 0||i.destroy(),(o=this.colorTexture)===null||o===void 0||o.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_Uv",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}})}}]),t}(Ma),JM=["data"],eI=["rasterData"];function tI(e){var r=rI();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function rI(){if(typeof Reflect=="undefined"||!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(e){return!1}}var nI=`precision highp float;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
attribute vec3 a_Position;
|
|
attribute vec2 a_Uv;
|
|
varying vec2 v_texCoord;
|
|
#pragma include "projection"
|
|
void main() {
|
|
v_texCoord = a_Uv;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
|
|
}
|
|
`,iI=`precision mediump float;
|
|
uniform vec2 u_rminmax: vec2(0,255);
|
|
uniform vec2 u_gminmax: vec2(0,255);
|
|
uniform vec2 u_bminmax: vec2(0,255);
|
|
uniform float u_opacity: 1.0;
|
|
uniform sampler2D u_texture;
|
|
uniform float u_noDataValue : 0.0;
|
|
varying vec2 v_texCoord;
|
|
|
|
void main() {
|
|
vec3 rgb = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).rgb;
|
|
if(rgb == vec3(u_noDataValue)) {
|
|
gl_FragColor = vec4(0.0, 0, 0, 0.0);
|
|
} else {
|
|
gl_FragColor = vec4(rgb.r / (u_rminmax.y -u_rminmax.x), rgb.g /(u_gminmax.y -u_gminmax.x), rgb.b/ (u_bminmax.y - u_bminmax.x), u_opacity);
|
|
}
|
|
if(gl_FragColor.a < 0.01)
|
|
discard;
|
|
|
|
}`,aI=function(e){(0,Le.Z)(t,e);var r=tI(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"dataOption",{}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.noDataValue,f=l===void 0?0:l,v=this.dataOption,y=v.rMinMax,b=v.gMinMax,T=v.bMinMax;return{u_opacity:s||1,u_texture:this.texture,u_noDataValue:f,u_rminmax:y,u_gminmax:b,u_bminmax:T}}},{key:"getRasterData",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l,f,v,y,b;return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(!Array.isArray(s.data)){M.next=4;break}return l=s.data,f=(0,ka.Z)(s,JM),this.dataOption=f,M.abrupt("return",(0,V.Z)({data:l},f));case 4:return M.next=6,s.data;case 6:if(v=M.sent,y=v.rasterData,b=(0,ka.Z)(v,eI),this.dataOption=b,!Array.isArray(y)){M.next=14;break}return M.abrupt("return",(0,V.Z)({data:y},b));case 14:return M.abrupt("return",(0,V.Z)({data:Array.from(y)},b));case 15:case"end":return M.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return s=this.layer.getSource(),l=this.rendererService.createTexture2D,f=s.data.dataArray[0],F.next=5,this.getRasterData(f);case 5:return v=F.sent,y=v.data,b=v.width,T=v.height,this.texture=l({data:y,width:b,height:T,format:R.RGB,type:R.FLOAT}),F.next=12,this.layer.buildLayerModel({moduleName:"rasterImageDataRGBA",vertexShader:nI,fragmentShader:iI,triangulation:Sg,primitive:R.TRIANGLES,depth:{enable:!1}});case 12:return M=F.sent,F.abrupt("return",[M]);case 14:case"end":return F.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_Uv",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}})}}]),t}(Ma);function oI(e){var r=sI();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function sI(){if(typeof Reflect=="undefined"||!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(e){return!1}}var uI=`precision mediump float;
|
|
uniform float u_opacity: 1.0;
|
|
|
|
uniform sampler2D u_texture;
|
|
uniform sampler2D u_colorTexture;
|
|
|
|
varying vec2 v_texCoord;
|
|
|
|
uniform vec2 u_domain;
|
|
uniform float u_noDataValue;
|
|
uniform bool u_clampLow: true;
|
|
uniform bool u_clampHigh: true;
|
|
uniform vec4 u_unpack;
|
|
|
|
float getElevation(vec2 coord, float bias) {
|
|
// Convert encoded elevation value to meters
|
|
vec4 data = texture2D(u_texture, coord,bias) * 255.0;
|
|
data.a = -1.0;
|
|
return dot(data, u_unpack);
|
|
}
|
|
|
|
vec4 getColor(float value) {
|
|
float normalisedValue =(value- u_domain[0]) / (u_domain[1] - u_domain[0]);
|
|
vec2 coord = vec2(normalisedValue, 0);
|
|
return texture2D(u_colorTexture, coord);
|
|
}
|
|
|
|
void main() {
|
|
float value = getElevation(v_texCoord,0.0);
|
|
if (value == u_noDataValue) {
|
|
gl_FragColor = vec4(0.0, 0, 0, 0.0);
|
|
} else if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1])) {
|
|
gl_FragColor = vec4(0.0, 0, 0, 0.0);
|
|
} else {
|
|
|
|
gl_FragColor = getColor(value);
|
|
gl_FragColor.a = gl_FragColor.a * u_opacity ;
|
|
if(gl_FragColor.a < 0.01)
|
|
discard;
|
|
}
|
|
}
|
|
`,lI=`precision highp float;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
attribute vec3 a_Position;
|
|
attribute vec2 a_Uv;
|
|
varying vec2 v_texCoord;
|
|
#pragma include "projection"
|
|
void main() {
|
|
v_texCoord = a_Uv;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
|
|
}
|
|
`,cI=function(e){(0,Le.Z)(t,e);var r=oI(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=i.clampLow,l=s===void 0?!0:s,f=i.clampHigh,v=f===void 0?!0:f,y=i.noDataValue,b=y===void 0?-9999999:y,T=i.domain,M=i.rampColors,O=i.colorTexture,F=i.rScaler,$=F===void 0?6553.6:F,G=i.gScaler,ue=G===void 0?25.6:G,xe=i.bScaler,ze=xe===void 0?.1:xe,Je=i.offset,ht=Je===void 0?1e4:Je,gt=T||Cc(M),Ot=O;return O?this.layer.textureService.setColorTexture(O,M,gt):Ot=this.layer.textureService.getColorTexture(M,gt),{u_opacity:o||1,u_texture:this.texture,u_domain:gt,u_clampLow:l,u_clampHigh:typeof v!="undefined"?v:l,u_noDataValue:b,u_unpack:[$,ue,ze,ht],u_colorTexture:Ot}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.layer.getSource(),l=this.rendererService.createTexture2D,b.next=4,s.data.images;case 4:return f=b.sent,this.texture=l({data:f[0],width:f[0].width,height:f[0].height,min:R.LINEAR,mag:R.LINEAR}),b.next=8,this.layer.buildLayerModel({moduleName:"RasterTileDataImage",vertexShader:lI,fragmentShader:uI,triangulation:Sg,primitive:R.TRIANGLES,depth:{enable:!1}});case 8:return v=b.sent,b.abrupt("return",[v]);case 10:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy()}},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:dn.Attribute,descriptor:{name:"a_Uv",buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:2,update:function(o,s,l){return[l[3],l[4]]}}})}}]),t}(Ma),fI={raster:nx,rasterRgb:aI,raster3d:nx,rasterTerrainRgb:cI},hI=fI;function pI(e){var r=dI();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function dI(){if(typeof Reflect=="undefined"||!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(e){return!1}}var Mg=function(e){(0,Le.Z)(t,e);var r=pI(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"type","RasterLayer"),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel=new hI[s](this),f.next=4,this.initLayerModels();case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),o={raster:{},rasterRgb:{},raster3d:{},rasterTerrainRgb:{}};return o[i]}},{key:"getModelType",value:function(){var i=this.layerSource.getParserType();switch(i){case"raster":return"raster";case"rasterRgb":return"rasterRgb";case"image":return"rasterTerrainRgb";default:return"raster"}}}]),t}(Ip);function vI(e){var r=mI();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function mI(){if(typeof Reflect=="undefined"||!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(e){return!1}}var gI=`uniform float u_opacity : 1.0;
|
|
uniform vec4 u_color;
|
|
|
|
void main() {
|
|
gl_FragColor = u_color;
|
|
gl_FragColor.a *= u_opacity;
|
|
}
|
|
`,_I=`attribute vec3 a_Position;
|
|
uniform mat4 u_ModelMatrix;
|
|
|
|
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
|
|
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
|
|
} else {
|
|
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
}
|
|
}
|
|
|
|
`,yI=oi.isNumber,xI=function(e){(0,Le.Z)(t,e);var r=vI(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.layer.getLayerConfig(),o=i.opacity,s=o===void 0?1:o,l=i.color,f=l===void 0?"#000":l;return{u_opacity:yI(s)?s:0,u_color:fi(f)}}},{key:"initModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"mask",vertexShader:_I,fragmentShader:gI,triangulation:X0,depth:{enable:!1},pick:!1});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;i&&this.layerService.clear()}},{key:"registerBuiltinAttributes",value:function(){return""}}]),t}(Ma),bI={fill:xI},EI=bI;function SI(e){var r=AI();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function AI(){if(typeof Reflect=="undefined"||!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(e){return!1}}var ix=function(e){(0,Le.Z)(t,e);var r=SI(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"type","MaskLayer"),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel=new EI[s](this),f.next=4,this.initLayerModels();case 4:case"end":return f.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getModelType",value:function(){return"fill"}}]),t}(Ip),ax,ox,sx,ux,Ig,lx,cx,TI=oi.cloneDeep,wI=(ax=(0,yt.b2)(),ox=(0,yt.f3)(ot.IMapService),sx=(0,yt.f3)(ot.IFontService),ax(ux=(Ig=function(){function e(){(0,Q.Z)(this,e),Ni(this,"mapService",lx,this),Ni(this,"fontService",cx,this)}return(0,j.Z)(e,[{key:"apply",value:function(t,n){var i=this,o=n.styleAttributeService;t.hooks.init.tapPromise("DataMappingPlugin",(0,Pt.Z)(ge().mark(function s(){return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:t.log(Rs.MappingStart,ds.INIT),i.generateMaping(t,{styleAttributeService:o}),t.log(Rs.MappingEnd,ds.INIT);case 3:case"end":return f.stop()}},s)}))),t.hooks.beforeRenderData.tapPromise("DataMappingPlugin",function(){var s=(0,Pt.Z)(ge().mark(function l(f){var v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(f){b.next=2;break}return b.abrupt("return",f);case 2:return t.dataState.dataMappingNeedUpdate=!1,t.log(Rs.MappingStart,ds.UPDATE),v=i.generateMaping(t,{styleAttributeService:o}),t.log(Rs.MappingEnd,ds.UPDATE),b.abrupt("return",v);case 7:case"end":return b.stop()}},l)}));return function(l){return s.apply(this,arguments)}}()),t.hooks.beforeRender.tap("DataMappingPlugin",function(){var s=t.getSource();if(!(t.layerModelNeedUpdate||!s||!s.inited)){var l=o.getLayerStyleAttributes()||[],f=o.getLayerStyleAttribute("filter"),v=s.data.dataArray;if(!(Array.isArray(v)&&v.length===0)){var y=l.filter(function(M){return M.needRemapping}),b=v;if(f!=null&&f.needRemapping&&f!==null&&f!==void 0&&f.scale&&(b=v.filter(function(M){return i.applyAttributeMapping(f,M)[0]})),y.length){var T=i.mapping(t,y,b,t.getEncodedData());t.setEncodedData(T)}}}})}},{key:"generateMaping",value:function(t,n){var i=this,o=n.styleAttributeService,s=o.getLayerStyleAttributes()||[],l=o.getLayerStyleAttribute("filter"),f=t.getSource().data.dataArray,v=f;l!=null&&l.scale&&(v=f.filter(function(b){return i.applyAttributeMapping(l,b)[0]})),v=t.processData(v);var y=this.mapping(t,s,v,void 0);return t.setEncodedData(y),f.length===0&&t.encodeDataLength===0?!1:(t.emit("dataUpdate",null),!0)}},{key:"mapping",value:function(t,n,i,o){var s=this,l=n.filter(function(v){return v.scale!==void 0}).filter(function(v){return v.name!=="filter"}),f=i.map(function(v,y){var b=o?o[y]:{},T=(0,V.Z)({id:v._id,coordinates:v.coordinates},b);return l.forEach(function(M){var O=s.applyAttributeMapping(M,v);(M.name==="color"||M.name==="stroke")&&(O=O.map(function(F){return fi(F)})),T[M.name]=Array.isArray(O)&&O.length===1?O[0]:O,M.name==="shape"&&(T.shape=s.fontService.getIconFontKey(T[M.name]))}),T});return n.forEach(function(v){v.needRemapping=!1}),this.adjustData2Amap2Coordinates(f,t),this.adjustData2SimpleCoordinates(f),f}},{key:"adjustData2Amap2Coordinates",value:function(t,n){var i=this;if(t.length>0&&this.mapService.version==="GAODE2.x"){var o=n.coordCenter||n.getSource().center;t.filter(function(s){return!s.originCoordinates}).map(function(s){s.version="GAODE2.x",s.originCoordinates=TI(s.coordinates),s.coordinates=i.mapService.coordToAMap2RelativeCoordinates(s.coordinates,o)})}}},{key:"adjustData2SimpleCoordinates",value:function(t){var n=this;t.length>0&&this.mapService.version==="SIMPLE"&&t.map(function(i){i.simpleCoordinate||(i.coordinates=n.unProjectCoordinates(i.coordinates),i.simpleCoordinate=!0)})}},{key:"unProjectCoordinates",value:function(t){var n=this;if(typeof t[0]=="number")return this.mapService.simpleMapCoord.unproject(t);if(t[0]&&t[0][0]instanceof Array){var i=[];return t.map(function(s){var l=[];s.map(function(f){l.push(n.mapService.simpleMapCoord.unproject(f))}),i.push(l)}),i}else{var o=[];return t.map(function(s){o.push(n.mapService.simpleMapCoord.unproject(s))}),o}}},{key:"applyAttributeMapping",value:function(t,n){var i;if(!t.scale)return[];var o=(t==null||(i=t.scale)===null||i===void 0?void 0:i.scalers)||[],s=[];o.forEach(function(f){var v,y=f.field;(n.hasOwnProperty(y)||((v=t.scale)===null||v===void 0?void 0:v.type)==="variable")&&s.push(n[y])});var l=t.mapping?t.mapping(s):[];return l}},{key:"getArrowPoints",value:function(t,n){var i=[n[0]-t[0],n[1]-t[1]],o=kf(i),s=[t[0]+o[0]*1e-4,t[1]+o[1]*1e-4];return s}}]),e}(),lx=ki(Ig.prototype,"mapService",[ox],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),cx=ki(Ig.prototype,"fontService",[sx],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ig))||ux),fx,hx,CI=(fx=(0,yt.b2)(),fx(hx=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t){var n=this;this.mapService=t.getContainer().get(ot.IMapService),t.hooks.init.tapPromise("DataSourcePlugin",(0,Pt.Z)(ge().mark(function i(){var o,s,l,f;return ge().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(t.log(Rs.SourceInitStart,ds.INIT),o=t.getSource(),o||(s=t.sourceOption||t.defaultSourceConfig,l=s.data,f=s.options,o=new Xy(l,f),t.setSource(o)),!o.inited){y.next=8;break}n.updateClusterData(t),t.log(Rs.SourceInitEnd,ds.INIT),y.next=10;break;case 8:return y.next=10,new Promise(function(b){o.on("update",function(T){T.type==="inited"&&(n.updateClusterData(t),t.log(Rs.SourceInitEnd,ds.INIT)),b(null)})});case 10:case"end":return y.stop()}},i)}))),t.hooks.beforeRenderData.tapPromise("DataSourcePlugin",(0,Pt.Z)(ge().mark(function i(){var o,s,l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return o=n.updateClusterData(t),s=t.dataState.dataSourceNeedUpdate,t.dataState.dataSourceNeedUpdate=!1,l=o||s,v.abrupt("return",l);case 5:case"end":return v.stop()}},i)})))}},{key:"updateClusterData",value:function(t){if(t.isTileLayer||t.tileLayer||!t.getSource())return!1;var n=t.getSource(),i=n.cluster,o=n.clusterOptions.zoom,s=o===void 0?0:o,l=this.mapService.getZoom()-1,f=t.dataState.dataSourceNeedUpdate;return i&&f&&n.updateClusterData(Math.floor(l)),i&&Math.abs(t.clusterZoom-l)>=1?(s!==Math.floor(l)&&n.updateClusterData(Math.floor(l)),t.clusterZoom=l,!0):!1}}]),e}())||hx);function Q0(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}function px(e){return e.length===1&&(e=RI(e)),{left:function(r,t,n,i){for(n==null&&(n=0),i==null&&(i=r.length);n<i;){var o=n+i>>>1;e(r[o],t)<0?n=o+1:i=o}return n},right:function(r,t,n,i){for(n==null&&(n=0),i==null&&(i=r.length);n<i;){var o=n+i>>>1;e(r[o],t)>0?i=o:n=o+1}return n}}}function RI(e){return function(r,t){return Q0(e(r),t)}}var dx=px(Q0),MI=dx.right,ML=dx.left,Pg=MI;function vx(e,r){var t=e.length,n=-1,i,o,s;if(r==null){for(;++n<t;)if((i=e[n])!=null&&i>=i)for(o=s=i;++n<t;)(i=e[n])!=null&&(o>i&&(o=i),s<i&&(s=i))}else for(;++n<t;)if((i=r(e[n],n,e))!=null&&i>=i)for(o=s=i;++n<t;)(i=r(e[n],n,e))!=null&&(o>i&&(o=i),s<i&&(s=i));return[o,s]}var mx=Array.prototype,IL=mx.slice,PL=mx.map,J0=Math.sqrt(50),e_=Math.sqrt(10),t_=Math.sqrt(2);function gx(e,r,t){var n,i=-1,o,s,l;if(r=+r,e=+e,t=+t,e===r&&t>0)return[e];if((n=r<e)&&(o=e,e=r,r=o),(l=Og(e,r,t))===0||!isFinite(l))return[];if(l>0)for(e=Math.ceil(e/l),r=Math.floor(r/l),s=new Array(o=Math.ceil(r-e+1));++i<o;)s[i]=(e+i)*l;else for(e=Math.floor(e*l),r=Math.ceil(r*l),s=new Array(o=Math.ceil(e-r+1));++i<o;)s[i]=(e-i)/l;return n&&s.reverse(),s}function Og(e,r,t){var n=(r-e)/Math.max(0,t),i=Math.floor(Math.log(n)/Math.LN10),o=n/Math.pow(10,i);return i>=0?(o>=J0?10:o>=e_?5:o>=t_?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=J0?10:o>=e_?5:o>=t_?2:1)}function r_(e,r,t){var n=Math.abs(r-e)/Math.max(0,t),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),o=n/i;return o>=J0?i*=10:o>=e_?i*=5:o>=t_&&(i*=2),r<e?-i:i}function OL(){var e=identity,r=extent,t=sturges;function n(i){var o,s=i.length,l,f=new Array(s);for(o=0;o<s;++o)f[o]=e(i[o],o,i);var v=r(f),y=v[0],b=v[1],T=t(f,y,b);Array.isArray(T)||(T=tickStep(y,b,T),T=range(Math.ceil(y/T)*T,b,T));for(var M=T.length;T[0]<=y;)T.shift(),--M;for(;T[M-1]>b;)T.pop(),--M;var O=new Array(M+1),F;for(o=0;o<=M;++o)F=O[o]=[],F.x0=o>0?T[o-1]:y,F.x1=o<M?T[o]:b;for(o=0;o<s;++o)l=f[o],y<=l&&l<=b&&O[bisect(T,l,0,M)].push(i[o]);return O}return n.value=function(i){return arguments.length?(e=typeof i=="function"?i:constant(i),n):e},n.domain=function(i){return arguments.length?(r=typeof i=="function"?i:constant([i[0],i[1]]),n):r},n.thresholds=function(i){return arguments.length?(t=typeof i=="function"?i:Array.isArray(i)?constant(slice.call(i)):constant(i),n):t},n}function DL(e,r,t){return e=map.call(e,number).sort(ascending),Math.ceil((t-r)/(2*(quantile(e,.75)-quantile(e,.25))*Math.pow(e.length,-1/3)))}function II(e){return e===null?NaN:+e}function PI(e,r,t){if(t==null&&(t=II),!!(n=e.length)){if((r=+r)<=0||n<2)return+t(e[0],0,e);if(r>=1)return+t(e[n-1],n-1,e);var n,i=(n-1)*r,o=Math.floor(i),s=+t(e[o],o,e),l=+t(e[o+1],o+1,e);return s+(l-s)*(i-o)}}function _x(e,r,t,n,i){var o=e*e,s=o*e;return((1-3*e+3*o-s)*r+(4-6*o+3*s)*t+(1+3*e+3*o-3*s)*n+s*i)/6}function OI(e){var r=e.length-1;return function(t){var n=t<=0?t=0:t>=1?(t=1,r-1):Math.floor(t*r),i=e[n],o=e[n+1],s=n>0?e[n-1]:2*i-o,l=n<r-1?e[n+2]:2*o-i;return _x((t-n/r)*r,s,i,o,l)}}function DI(e){var r=e.length;return function(t){var n=Math.floor(((t%=1)<0?++t:t)*r),i=e[(n+r-1)%r],o=e[n%r],s=e[(n+1)%r],l=e[(n+2)%r];return _x((t-n/r)*r,i,o,s,l)}}function n_(e){return function(){return e}}function yx(e,r){return function(t){return e+t*r}}function FI(e,r,t){return e=Math.pow(e,t),r=Math.pow(r,t)-e,t=1/t,function(n){return Math.pow(e+n*r,t)}}function FL(e,r){var t=r-e;return t?yx(e,t>180||t<-180?t-360*Math.round(t/360):t):constant(isNaN(e)?r:e)}function kI(e){return(e=+e)==1?xx:function(r,t){return t-r?FI(r,t,e):n_(isNaN(r)?t:r)}}function xx(e,r){var t=r-e;return t?yx(e,t):n_(isNaN(e)?r:e)}var bx=function e(r){var t=kI(r);function n(i,o){var s=t((i=(0,os.B8)(i)).r,(o=(0,os.B8)(o)).r),l=t(i.g,o.g),f=t(i.b,o.b),v=xx(i.opacity,o.opacity);return function(y){return i.r=s(y),i.g=l(y),i.b=f(y),i.opacity=v(y),i+""}}return n.gamma=e,n}(1);function Ex(e){return function(r){var t=r.length,n=new Array(t),i=new Array(t),o=new Array(t),s,l;for(s=0;s<t;++s)l=(0,os.B8)(r[s]),n[s]=l.r||0,i[s]=l.g||0,o[s]=l.b||0;return n=e(n),i=e(i),o=e(o),l.opacity=1,function(f){return l.r=n(f),l.g=i(f),l.b=o(f),l+""}}}var BI=Ex(OI),kL=Ex(DI),qc="$";function Dg(){}Dg.prototype=Sx.prototype={constructor:Dg,has:function(e){return qc+e in this},get:function(e){return this[qc+e]},set:function(e,r){return this[qc+e]=r,this},remove:function(e){var r=qc+e;return r in this&&delete this[r]},clear:function(){for(var e in this)e[0]===qc&&delete this[e]},keys:function(){var e=[];for(var r in this)r[0]===qc&&e.push(r.slice(1));return e},values:function(){var e=[];for(var r in this)r[0]===qc&&e.push(this[r]);return e},entries:function(){var e=[];for(var r in this)r[0]===qc&&e.push({key:r.slice(1),value:this[r]});return e},size:function(){var e=0;for(var r in this)r[0]===qc&&++e;return e},empty:function(){for(var e in this)if(e[0]===qc)return!1;return!0},each:function(e){for(var r in this)r[0]===qc&&e(this[r],r.slice(1),this)}};function Sx(e,r){var t=new Dg;if(e instanceof Dg)e.each(function(l,f){t.set(f,l)});else if(Array.isArray(e)){var n=-1,i=e.length,o;if(r==null)for(;++n<i;)t.set(n,e[n]);else for(;++n<i;)t.set(r(o=e[n],n,e),o)}else if(e)for(var s in e)t.set(s,e[s]);return t}var i_=Sx;function BL(){var e=[],r=[],t,n,i;function o(l,f,v,y){if(f>=e.length)return t!=null&&l.sort(t),n!=null?n(l):l;for(var b=-1,T=l.length,M=e[f++],O,F,$=map(),G,ue=v();++b<T;)(G=$.get(O=M(F=l[b])+""))?G.push(F):$.set(O,[F]);return $.each(function(xe,ze){y(ue,ze,o(xe,f,v,y))}),ue}function s(l,f){if(++f>e.length)return l;var v,y=r[f-1];return n!=null&&f>=e.length?v=l.entries():(v=[],l.each(function(b,T){v.push({key:T,values:s(b,f)})})),y!=null?v.sort(function(b,T){return y(b.key,T.key)}):v}return i={object:function(l){return o(l,0,LI,NI)},map:function(l){return o(l,0,Ax,Tx)},entries:function(l){return s(o(l,0,Ax,Tx),0)},key:function(l){return e.push(l),i},sortKeys:function(l){return r[e.length-1]=l,i},sortValues:function(l){return t=l,i},rollup:function(l){return n=l,i}}}function LI(){return{}}function NI(e,r,t){e[r]=t}function Ax(){return map()}function Tx(e,r,t){e.set(r,t)}function Fg(){}var md=i_.prototype;Fg.prototype=UI.prototype={constructor:Fg,has:md.has,add:function(e){return e+="",this[qc+e]=e,this},remove:md.remove,clear:md.clear,values:md.keys,size:md.size,empty:md.empty,each:md.each};function UI(e,r){var t=new Fg;if(e instanceof Fg)e.each(function(o){t.add(o)});else if(e){var n=-1,i=e.length;if(r==null)for(;++n<i;)t.add(e[n]);else for(;++n<i;)t.add(r(e[n],n,e))}return t}var LL=null,Cx=Array.prototype,Rx=Cx.map,gd=Cx.slice;function Dp(e,r){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(r).domain(e);break}return this}function Mx(e,r){switch(arguments.length){case 0:break;case 1:this.interpolator(e);break;default:this.interpolator(r).domain(e);break}return this}var Ix={name:"implicit"};function kg(){var e=i_(),r=[],t=[],n=Ix;function i(o){var s=o+"",l=e.get(s);if(!l){if(n!==Ix)return n;e.set(s,l=r.push(o))}return t[(l-1)%t.length]}return i.domain=function(o){if(!arguments.length)return r.slice();r=[],e=i_();for(var s=-1,l=o.length,f,v;++s<l;)e.has(v=(f=o[s])+"")||e.set(v,r.push(f));return i},i.range=function(o){return arguments.length?(t=gd.call(o),i):t.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return kg(r,t).unknown(n)},Dp.apply(i,arguments),i}function Px(){var e=ordinal().unknown(void 0),r=e.domain,t=e.range,n=[0,1],i,o,s=!1,l=0,f=0,v=.5;delete e.unknown;function y(){var b=r().length,T=n[1]<n[0],M=n[T-0],O=n[1-T];i=(O-M)/Math.max(1,b-l+f*2),s&&(i=Math.floor(i)),M+=(O-M-i*(b-l))*v,o=i*(1-l),s&&(M=Math.round(M),o=Math.round(o));var F=sequence(b).map(function($){return M+i*$});return t(T?F.reverse():F)}return e.domain=function(b){return arguments.length?(r(b),y()):r()},e.range=function(b){return arguments.length?(n=[+b[0],+b[1]],y()):n.slice()},e.rangeRound=function(b){return n=[+b[0],+b[1]],s=!0,y()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(b){return arguments.length?(s=!!b,y()):s},e.padding=function(b){return arguments.length?(l=Math.min(1,f=+b),y()):l},e.paddingInner=function(b){return arguments.length?(l=Math.min(1,b),y()):l},e.paddingOuter=function(b){return arguments.length?(f=+b,y()):f},e.align=function(b){return arguments.length?(v=Math.max(0,Math.min(1,b)),y()):v},e.copy=function(){return Px(r(),n).round(s).paddingInner(l).paddingOuter(f).align(v)},initRange.apply(y(),arguments)}function Ox(e){var r=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Ox(r())},e}function NL(){return Ox(Px.apply(null,arguments).paddingInner(1))}function UL(e,r){return(isNumberArray(r)?numberArray:Dx)(e,r)}function Dx(e,r){var t=r?r.length:0,n=e?Math.min(t,e.length):0,i=new Array(n),o=new Array(t),s;for(s=0;s<n;++s)i[s]=s_(e[s],r[s]);for(;s<t;++s)o[s]=r[s];return function(l){for(s=0;s<n;++s)o[s]=i[s](l);return o}}function zI(e,r){var t=new Date;return e=+e,r=+r,function(n){return t.setTime(e*(1-n)+r*n),t}}function Bg(e,r){return e=+e,r=+r,function(t){return e*(1-t)+r*t}}function ZI(e,r){var t={},n={},i;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(i in r)i in e?t[i]=s_(e[i],r[i]):n[i]=r[i];return function(o){for(i in t)n[i]=t[i](o);return n}}var a_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,o_=new RegExp(a_.source,"g");function VI(e){return function(){return e}}function jI(e){return function(r){return e(r)+""}}function HI(e,r){var t=a_.lastIndex=o_.lastIndex=0,n,i,o,s=-1,l=[],f=[];for(e=e+"",r=r+"";(n=a_.exec(e))&&(i=o_.exec(r));)(o=i.index)>t&&(o=r.slice(t,o),l[s]?l[s]+=o:l[++s]=o),(n=n[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,f.push({i:s,x:Bg(n,i)})),t=o_.lastIndex;return t<r.length&&(o=r.slice(t),l[s]?l[s]+=o:l[++s]=o),l.length<2?f[0]?jI(f[0].x):VI(r):(r=f.length,function(v){for(var y=0,b;y<r;++y)l[(b=f[y]).i]=b.x(v);return l.join("")})}function WI(e,r){r||(r=[]);var t=e?Math.min(r.length,e.length):0,n=r.slice(),i;return function(o){for(i=0;i<t;++i)n[i]=e[i]*(1-o)+r[i]*o;return n}}function GI(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function s_(e,r){var t=typeof r,n;return r==null||t==="boolean"?n_(r):(t==="number"?Bg:t==="string"?(n=(0,os.ZP)(r))?(r=n,bx):HI:r instanceof os.ZP?bx:r instanceof Date?zI:GI(r)?WI:Array.isArray(r)?Dx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?ZI:Bg)(e,r)}function XI(e,r){return e=+e,r=+r,function(t){return Math.round(e*(1-t)+r*t)}}function $I(e){return function(){return e}}function YI(e){return+e}var Fx=[0,1];function Yu(e){return e}function u_(e,r){return(r-=e=+e)?function(t){return(t-e)/r}:$I(isNaN(r)?NaN:.5)}function kx(e){var r=e[0],t=e[e.length-1],n;return r>t&&(n=r,r=t,t=n),function(i){return Math.max(r,Math.min(t,i))}}function qI(e,r,t){var n=e[0],i=e[1],o=r[0],s=r[1];return i<n?(n=u_(i,n),o=t(s,o)):(n=u_(n,i),o=t(o,s)),function(l){return o(n(l))}}function KI(e,r,t){var n=Math.min(e.length,r.length)-1,i=new Array(n),o=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<n;)i[s]=u_(e[s],e[s+1]),o[s]=t(r[s],r[s+1]);return function(l){var f=Pg(e,l,1,n)-1;return o[f](i[f](l))}}function Lg(e,r){return r.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function l_(){var e=Fx,r=Fx,t=s_,n,i,o,s=Yu,l,f,v;function y(){return l=Math.min(e.length,r.length)>2?KI:qI,f=v=null,b}function b(T){return isNaN(T=+T)?o:(f||(f=l(e.map(n),r,t)))(n(s(T)))}return b.invert=function(T){return s(i((v||(v=l(r,e.map(n),Bg)))(T)))},b.domain=function(T){return arguments.length?(e=Rx.call(T,YI),s===Yu||(s=kx(e)),y()):e.slice()},b.range=function(T){return arguments.length?(r=gd.call(T),y()):r.slice()},b.rangeRound=function(T){return r=gd.call(T),t=XI,y()},b.clamp=function(T){return arguments.length?(s=T?kx(e):Yu,b):s!==Yu},b.interpolate=function(T){return arguments.length?(t=T,y()):t},b.unknown=function(T){return arguments.length?(o=T,b):o},function(T,M){return n=T,i=M,y()}}function Bx(e,r){return l_()(e,r)}var QI=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ng(e){if(!(r=QI.exec(e)))throw new Error("invalid format: "+e);var r;return new c_({fill:r[1],align:r[2],sign:r[3],symbol:r[4],zero:r[5],width:r[6],comma:r[7],precision:r[8]&&r[8].slice(1),trim:r[9],type:r[10]})}Ng.prototype=c_.prototype;function c_(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}c_.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function JI(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ug(e,r){if((t=(e=r?e.toExponential(r-1):e.toExponential()).indexOf("e"))<0)return null;var t,n=e.slice(0,t);return[n.length>1?n[0]+n.slice(2):n,+e.slice(t+1)]}function pv(e){return e=Ug(Math.abs(e)),e?e[1]:NaN}function eP(e,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(pv(r)/3)))*3-pv(Math.abs(e)))}function tP(e,r){return function(t,n){for(var i=t.length,o=[],s=0,l=e[0],f=0;i>0&&l>0&&(f+l+1>n&&(l=Math.max(1,n-f)),o.push(t.substring(i-=l,i+l)),!((f+=l+1)>n));)l=e[s=(s+1)%e.length];return o.reverse().join(r)}}function rP(e){return function(r){return r.replace(/[0-9]/g,function(t){return e[+t]})}}function nP(e){e:for(var r=e.length,t=1,n=-1,i;t<r;++t)switch(e[t]){case".":n=i=t;break;case"0":n===0&&(n=t),i=t;break;default:if(!+e[t])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Lx;function iP(e,r){var t=Ug(e,r);if(!t)return e+"";var n=t[0],i=t[1],o=i-(Lx=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return o===s?n:o>s?n+new Array(o-s+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Ug(e,Math.max(0,r+o-1))[0]}function Nx(e,r){var t=Ug(e,r);if(!t)return e+"";var n=t[0],i=t[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var Ux={"%":function(e,r){return(e*100).toFixed(r)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:JI,e:function(e,r){return e.toExponential(r)},f:function(e,r){return e.toFixed(r)},g:function(e,r){return e.toPrecision(r)},o:function(e){return Math.round(e).toString(8)},p:function(e,r){return Nx(e*100,r)},r:Nx,s:iP,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function zx(e){return e}var Zx=Array.prototype.map,Vx=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function aP(e){var r=e.grouping===void 0||e.thousands===void 0?zx:tP(Zx.call(e.grouping,Number),e.thousands+""),t=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?zx:rP(Zx.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"-":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function v(b){b=Ng(b);var T=b.fill,M=b.align,O=b.sign,F=b.symbol,$=b.zero,G=b.width,ue=b.comma,xe=b.precision,ze=b.trim,Je=b.type;Je==="n"?(ue=!0,Je="g"):Ux[Je]||(xe===void 0&&(xe=12),ze=!0,Je="g"),($||T==="0"&&M==="=")&&($=!0,T="0",M="=");var ht=F==="$"?t:F==="#"&&/[boxX]/.test(Je)?"0"+Je.toLowerCase():"",gt=F==="$"?n:/[%p]/.test(Je)?s:"",Ot=Ux[Je],tr=/[defgprs%]/.test(Je);xe=xe===void 0?6:/[gprs]/.test(Je)?Math.max(1,Math.min(21,xe)):Math.max(0,Math.min(20,xe));function Ir(Er){var mn=ht,Ln=gt,Fi,xa,is;if(Je==="c")Ln=Ot(Er)+Ln,Er="";else{Er=+Er;var _s=Er<0||1/Er<0;if(Er=isNaN(Er)?f:Ot(Math.abs(Er),xe),ze&&(Er=nP(Er)),_s&&+Er==0&&O!=="+"&&(_s=!1),mn=(_s?O==="("?O:l:O==="-"||O==="("?"":O)+mn,Ln=(Je==="s"?Vx[8+Lx/3]:"")+Ln+(_s&&O==="("?")":""),tr){for(Fi=-1,xa=Er.length;++Fi<xa;)if(is=Er.charCodeAt(Fi),48>is||is>57){Ln=(is===46?i+Er.slice(Fi+1):Er.slice(Fi))+Ln,Er=Er.slice(0,Fi);break}}}ue&&!$&&(Er=r(Er,1/0));var as=mn.length+Er.length+Ln.length,lu=as<G?new Array(G-as+1).join(T):"";switch(ue&&$&&(Er=r(lu+Er,lu.length?G-Ln.length:1/0),lu=""),M){case"<":Er=mn+Er+Ln+lu;break;case"=":Er=mn+lu+Er+Ln;break;case"^":Er=lu.slice(0,as=lu.length>>1)+mn+Er+Ln+lu.slice(as);break;default:Er=lu+mn+Er+Ln;break}return o(Er)}return Ir.toString=function(){return b+""},Ir}function y(b,T){var M=v((b=Ng(b),b.type="f",b)),O=Math.max(-8,Math.min(8,Math.floor(pv(T)/3)))*3,F=Math.pow(10,-O),$=Vx[8+O/3];return function(G){return M(F*G)+$}}return{format:v,formatPrefix:y}}var zg,f_,jx;oP({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function oP(e){return zg=aP(e),f_=zg.format,jx=zg.formatPrefix,zg}function sP(e,r){return e=Math.abs(e),r=Math.abs(r)-e,Math.max(0,pv(r)-pv(e))+1}function uP(e){return Math.max(0,-pv(Math.abs(e)))}function lP(e,r,t,n){var i=r_(e,r,t),o;switch(n=Ng(n==null?",f":n),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(r));return n.precision==null&&!isNaN(o=eP(i,s))&&(n.precision=o),jx(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=sP(i,Math.max(Math.abs(e),Math.abs(r))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=uP(i))&&(n.precision=o-(n.type==="%")*2);break}}return f_(n)}function dm(e){var r=e.domain;return e.ticks=function(t){var n=r();return gx(n[0],n[n.length-1],t==null?10:t)},e.tickFormat=function(t,n){var i=r();return lP(i[0],i[i.length-1],t==null?10:t,n)},e.nice=function(t){t==null&&(t=10);var n=r(),i=0,o=n.length-1,s=n[i],l=n[o],f;return l<s&&(f=s,s=l,l=f,f=i,i=o,o=f),f=Og(s,l,t),f>0?(s=Math.floor(s/f)*f,l=Math.ceil(l/f)*f,f=Og(s,l,t)):f<0&&(s=Math.ceil(s*f)/f,l=Math.floor(l*f)/f,f=Og(s,l,t)),f>0?(n[i]=Math.floor(s/f)*f,n[o]=Math.ceil(l/f)*f,r(n)):f<0&&(n[i]=Math.ceil(s*f)/f,n[o]=Math.floor(l*f)/f,r(n)),e},e}function Hx(){var e=Bx(Yu,Yu);return e.copy=function(){return Lg(e,Hx())},Dp.apply(e,arguments),dm(e)}function cP(e){var r;function t(n){return isNaN(n=+n)?r:n}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=map.call(n,number),t):e.slice()},t.unknown=function(n){return arguments.length?(r=n,t):r},t.copy=function(){return cP(e).unknown(r)},e=arguments.length?map.call(e,number):[0,1],linearish(t)}function Wx(e,r){e=e.slice();var t=0,n=e.length-1,i=e[t],o=e[n],s;return o<i&&(s=t,t=n,n=s,s=i,i=o,o=s),e[t]=r.floor(i),e[n]=r.ceil(o),e}function Gx(e){return Math.log(e)}function Xx(e){return Math.exp(e)}function fP(e){return-Math.log(-e)}function hP(e){return-Math.exp(-e)}function pP(e){return isFinite(e)?+("1e"+e):e<0?0:e}function dP(e){return e===10?pP:e===Math.E?Math.exp:function(r){return Math.pow(e,r)}}function vP(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),function(r){return Math.log(r)/e})}function $x(e){return function(r){return-e(-r)}}function mP(e){var r=e(Gx,Xx),t=r.domain,n=10,i,o;function s(){return i=vP(n),o=dP(n),t()[0]<0?(i=$x(i),o=$x(o),e(fP,hP)):e(Gx,Xx),r}return r.base=function(l){return arguments.length?(n=+l,s()):n},r.domain=function(l){return arguments.length?(t(l),s()):t()},r.ticks=function(l){var f=t(),v=f[0],y=f[f.length-1],b;(b=y<v)&&(T=v,v=y,y=T);var T=i(v),M=i(y),O,F,$,G=l==null?10:+l,ue=[];if(!(n%1)&&M-T<G){if(T=Math.round(T)-1,M=Math.round(M)+1,v>0){for(;T<M;++T)for(F=1,O=o(T);F<n;++F)if($=O*F,!($<v)){if($>y)break;ue.push($)}}else for(;T<M;++T)for(F=n-1,O=o(T);F>=1;--F)if($=O*F,!($<v)){if($>y)break;ue.push($)}}else ue=gx(T,M,Math.min(M-T,G)).map(o);return b?ue.reverse():ue},r.tickFormat=function(l,f){if(f==null&&(f=n===10?".0e":","),typeof f!="function"&&(f=f_(f)),l===1/0)return f;l==null&&(l=10);var v=Math.max(1,n*l/r.ticks().length);return function(y){var b=y/o(Math.round(i(y)));return b*n<n-.5&&(b*=n),b<=v?f(y):""}},r.nice=function(){return t(Wx(t(),{floor:function(l){return o(Math.floor(i(l)))},ceil:function(l){return o(Math.ceil(i(l)))}}))},r}function Yx(){var e=mP(l_()).domain([1,10]);return e.copy=function(){return Lg(e,Yx()).base(e.base())},Dp.apply(e,arguments),e}function qx(e){return function(r){return Math.sign(r)*Math.log1p(Math.abs(r/e))}}function Kx(e){return function(r){return Math.sign(r)*Math.expm1(Math.abs(r))*e}}function gP(e){var r=1,t=e(qx(r),Kx(r));return t.constant=function(n){return arguments.length?e(qx(r=+n),Kx(r)):r},linearish(t)}function _P(){var e=gP(transformer());return e.copy=function(){return copy(e,_P()).constant(e.constant())},initRange.apply(e,arguments)}function Qx(e){return function(r){return r<0?-Math.pow(-r,e):Math.pow(r,e)}}function yP(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function xP(e){return e<0?-e*e:e*e}function bP(e){var r=e(Yu,Yu),t=1;function n(){return t===1?e(Yu,Yu):t===.5?e(yP,xP):e(Qx(t),Qx(1/t))}return r.exponent=function(i){return arguments.length?(t=+i,n()):t},dm(r)}function h_(){var e=bP(l_());return e.copy=function(){return Lg(e,h_()).exponent(e.exponent())},Dp.apply(e,arguments),e}function zL(){return h_.apply(null,arguments).exponent(.5)}function Jx(){var e=[],r=[],t=[],n;function i(){var s=0,l=Math.max(1,r.length);for(t=new Array(l-1);++s<l;)t[s-1]=PI(e,s/l);return o}function o(s){return isNaN(s=+s)?n:r[Pg(t,s)]}return o.invertExtent=function(s){var l=r.indexOf(s);return l<0?[NaN,NaN]:[l>0?t[l-1]:e[0],l<t.length?t[l]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(var l=0,f=s.length,v;l<f;++l)v=s[l],v!=null&&!isNaN(v=+v)&&e.push(v);return e.sort(Q0),i()},o.range=function(s){return arguments.length?(r=gd.call(s),i()):r.slice()},o.unknown=function(s){return arguments.length?(n=s,o):n},o.quantiles=function(){return t.slice()},o.copy=function(){return Jx().domain(e).range(r).unknown(n)},Dp.apply(o,arguments)}function eb(){var e=0,r=1,t=1,n=[.5],i=[0,1],o;function s(f){return f<=f?i[Pg(n,f,0,t)]:o}function l(){var f=-1;for(n=new Array(t);++f<t;)n[f]=((f+1)*r-(f-t)*e)/(t+1);return s}return s.domain=function(f){return arguments.length?(e=+f[0],r=+f[1],l()):[e,r]},s.range=function(f){return arguments.length?(t=(i=gd.call(f)).length-1,l()):i.slice()},s.invertExtent=function(f){var v=i.indexOf(f);return v<0?[NaN,NaN]:v<1?[e,n[0]]:v>=t?[n[t-1],r]:[n[v-1],n[v]]},s.unknown=function(f){return arguments.length&&(o=f),s},s.thresholds=function(){return n.slice()},s.copy=function(){return eb().domain([e,r]).range(i).unknown(o)},Dp.apply(dm(s),arguments)}function tb(){var e=[.5],r=[0,1],t,n=1;function i(o){return o<=o?r[Pg(e,o,0,n)]:t}return i.domain=function(o){return arguments.length?(e=gd.call(o),n=Math.min(e.length,r.length-1),i):e.slice()},i.range=function(o){return arguments.length?(r=gd.call(o),n=Math.min(e.length,r.length-1),i):r.slice()},i.invertExtent=function(o){var s=r.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(t=o,i):t},i.copy=function(){return tb().domain(e).range(r).unknown(t)},Dp.apply(i,arguments)}var p_=new Date,d_=new Date;function ml(e,r,t,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=function(o){return e(o=new Date(+o)),o},i.ceil=function(o){return e(o=new Date(o-1)),r(o,1),e(o),o},i.round=function(o){var s=i(o),l=i.ceil(o);return o-s<l-o?s:l},i.offset=function(o,s){return r(o=new Date(+o),s==null?1:Math.floor(s)),o},i.range=function(o,s,l){var f=[],v;if(o=i.ceil(o),l=l==null?1:Math.floor(l),!(o<s)||!(l>0))return f;do f.push(v=new Date(+o)),r(o,l),e(o);while(v<o&&o<s);return f},i.filter=function(o){return ml(function(s){if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},function(s,l){if(s>=s)if(l<0)for(;++l<=0;)for(;r(s,-1),!o(s););else for(;--l>=0;)for(;r(s,1),!o(s););})},t&&(i.count=function(o,s){return p_.setTime(+o),d_.setTime(+s),e(p_),e(d_),Math.floor(t(p_,d_))},i.every=function(o){return o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?function(s){return n(s)%o===0}:function(s){return i.count(0,s)%o===0}):i}),i}var v_=ml(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,r){e.setFullYear(e.getFullYear()+r)},function(e,r){return r.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});v_.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:ml(function(r){r.setFullYear(Math.floor(r.getFullYear()/e)*e),r.setMonth(0,1),r.setHours(0,0,0,0)},function(r,t){r.setFullYear(r.getFullYear()+t*e)})};var dv=v_,ZL=v_.range,rb=ml(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,r){e.setMonth(e.getMonth()+r)},function(e,r){return r.getMonth()-e.getMonth()+(r.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()}),EP=rb,VL=rb.range,Zg=1e3,vm=6e4,nb=36e5,ib=864e5,ab=6048e5;function _d(e){return ml(function(r){r.setDate(r.getDate()-(r.getDay()+7-e)%7),r.setHours(0,0,0,0)},function(r,t){r.setDate(r.getDate()+t*7)},function(r,t){return(t-r-(t.getTimezoneOffset()-r.getTimezoneOffset())*vm)/ab})}var m_=_d(0),Vg=_d(1),SP=_d(2),AP=_d(3),vv=_d(4),TP=_d(5),wP=_d(6),jL=m_.range,HL=Vg.range,WL=SP.range,GL=AP.range,XL=vv.range,$L=TP.range,YL=wP.range,ob=ml(function(e){e.setHours(0,0,0,0)},function(e,r){e.setDate(e.getDate()+r)},function(e,r){return(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*vm)/ib},function(e){return e.getDate()-1}),g_=ob,qL=ob.range,sb=ml(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zg-e.getMinutes()*vm)},function(e,r){e.setTime(+e+r*nb)},function(e,r){return(r-e)/nb},function(e){return e.getHours()}),CP=sb,KL=sb.range,ub=ml(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zg)},function(e,r){e.setTime(+e+r*vm)},function(e,r){return(r-e)/vm},function(e){return e.getMinutes()}),RP=ub,QL=ub.range,lb=ml(function(e){e.setTime(e-e.getMilliseconds())},function(e,r){e.setTime(+e+r*Zg)},function(e,r){return(r-e)/Zg},function(e){return e.getUTCSeconds()}),MP=lb,JL=lb.range,jg=ml(function(){},function(e,r){e.setTime(+e+r)},function(e,r){return r-e});jg.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ml(function(r){r.setTime(Math.floor(r/e)*e)},function(r,t){r.setTime(+r+t*e)},function(r,t){return(t-r)/e}):jg};var IP=jg,eN=jg.range;function yd(e){return ml(function(r){r.setUTCDate(r.getUTCDate()-(r.getUTCDay()+7-e)%7),r.setUTCHours(0,0,0,0)},function(r,t){r.setUTCDate(r.getUTCDate()+t*7)},function(r,t){return(t-r)/ab})}var cb=yd(0),Hg=yd(1),PP=yd(2),OP=yd(3),mv=yd(4),DP=yd(5),FP=yd(6),tN=cb.range,rN=Hg.range,nN=PP.range,iN=OP.range,aN=mv.range,oN=DP.range,sN=FP.range,fb=ml(function(e){e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCDate(e.getUTCDate()+r)},function(e,r){return(r-e)/ib},function(e){return e.getUTCDate()-1}),hb=fb,uN=fb.range,__=ml(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r)},function(e,r){return r.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});__.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:ml(function(r){r.setUTCFullYear(Math.floor(r.getUTCFullYear()/e)*e),r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0)},function(r,t){r.setUTCFullYear(r.getUTCFullYear()+t*e)})};var mm=__,lN=__.range;function y_(e){if(0<=e.y&&e.y<100){var r=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return r.setFullYear(e.y),r}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function x_(e){if(0<=e.y&&e.y<100){var r=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return r.setUTCFullYear(e.y),r}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function gm(e,r,t){return{y:e,m:r,d:t,H:0,M:0,S:0,L:0}}function kP(e){var r=e.dateTime,t=e.date,n=e.time,i=e.periods,o=e.days,s=e.shortDays,l=e.months,f=e.shortMonths,v=_m(i),y=ym(i),b=_m(o),T=ym(o),M=_m(s),O=ym(s),F=_m(l),$=ym(l),G=_m(f),ue=ym(f),xe={a:_s,A:as,b:lu,B:Ac,c:null,d:_b,e:_b,f:i5,g:d5,G:m5,H:t5,I:r5,j:n5,L:yb,m:a5,M:o5,p:LB,q:NB,Q:Tb,s:wb,S:s5,u:u5,U:l5,V:c5,w:f5,W:h5,x:null,X:null,y:p5,Y:v5,Z:g5,"%":Ab},ze={a:UB,A:zB,b:ZB,B:VB,c:null,d:bb,e:bb,f:b5,g:P5,G:D5,H:_5,I:y5,j:x5,L:Eb,m:E5,M:S5,p:jB,q:HB,Q:Tb,s:wb,S:A5,u:T5,U:w5,V:C5,w:R5,W:M5,x:null,X:null,y:I5,Y:O5,Z:F5,"%":Ab},Je={a:Ir,A:Er,b:mn,B:Ln,c:Fi,d:mb,e:mb,f:KP,g:vb,G:db,H:gb,I:gb,j:XP,L:qP,m:GP,M:$P,p:tr,q:WP,Q:JP,s:e5,S:YP,u:zP,U:ZP,V:VP,w:UP,W:jP,x:xa,X:is,y:vb,Y:db,Z:HP,"%":QP};xe.x=ht(t,xe),xe.X=ht(n,xe),xe.c=ht(r,xe),ze.x=ht(t,ze),ze.X=ht(n,ze),ze.c=ht(r,ze);function ht(ai,ba){return function(ja){var gn=[],Xl=-1,Do=0,Tc=ai.length,wc,Rd,Q2;for(ja instanceof Date||(ja=new Date(+ja));++Xl<Tc;)ai.charCodeAt(Xl)===37&&(gn.push(ai.slice(Do,Xl)),(Rd=pb[wc=ai.charAt(++Xl)])!=null?wc=ai.charAt(++Xl):Rd=wc==="e"?" ":"0",(Q2=ba[wc])&&(wc=Q2(ja,Rd)),gn.push(wc),Do=Xl+1);return gn.push(ai.slice(Do,Xl)),gn.join("")}}function gt(ai,ba){return function(ja){var gn=gm(1900,void 0,1),Xl=Ot(gn,ai,ja+="",0),Do,Tc;if(Xl!=ja.length)return null;if("Q"in gn)return new Date(gn.Q);if("s"in gn)return new Date(gn.s*1e3+("L"in gn?gn.L:0));if(ba&&!("Z"in gn)&&(gn.Z=0),"p"in gn&&(gn.H=gn.H%12+gn.p*12),gn.m===void 0&&(gn.m="q"in gn?gn.q:0),"V"in gn){if(gn.V<1||gn.V>53)return null;"w"in gn||(gn.w=1),"Z"in gn?(Do=x_(gm(gn.y,0,1)),Tc=Do.getUTCDay(),Do=Tc>4||Tc===0?Hg.ceil(Do):Hg(Do),Do=hb.offset(Do,(gn.V-1)*7),gn.y=Do.getUTCFullYear(),gn.m=Do.getUTCMonth(),gn.d=Do.getUTCDate()+(gn.w+6)%7):(Do=y_(gm(gn.y,0,1)),Tc=Do.getDay(),Do=Tc>4||Tc===0?Vg.ceil(Do):Vg(Do),Do=g_.offset(Do,(gn.V-1)*7),gn.y=Do.getFullYear(),gn.m=Do.getMonth(),gn.d=Do.getDate()+(gn.w+6)%7)}else("W"in gn||"U"in gn)&&("w"in gn||(gn.w="u"in gn?gn.u%7:"W"in gn?1:0),Tc="Z"in gn?x_(gm(gn.y,0,1)).getUTCDay():y_(gm(gn.y,0,1)).getDay(),gn.m=0,gn.d="W"in gn?(gn.w+6)%7+gn.W*7-(Tc+5)%7:gn.w+gn.U*7-(Tc+6)%7);return"Z"in gn?(gn.H+=gn.Z/100|0,gn.M+=gn.Z%100,x_(gn)):y_(gn)}}function Ot(ai,ba,ja,gn){for(var Xl=0,Do=ba.length,Tc=ja.length,wc,Rd;Xl<Do;){if(gn>=Tc)return-1;if(wc=ba.charCodeAt(Xl++),wc===37){if(wc=ba.charAt(Xl++),Rd=Je[wc in pb?ba.charAt(Xl++):wc],!Rd||(gn=Rd(ai,ja,gn))<0)return-1}else if(wc!=ja.charCodeAt(gn++))return-1}return gn}function tr(ai,ba,ja){var gn=v.exec(ba.slice(ja));return gn?(ai.p=y[gn[0].toLowerCase()],ja+gn[0].length):-1}function Ir(ai,ba,ja){var gn=M.exec(ba.slice(ja));return gn?(ai.w=O[gn[0].toLowerCase()],ja+gn[0].length):-1}function Er(ai,ba,ja){var gn=b.exec(ba.slice(ja));return gn?(ai.w=T[gn[0].toLowerCase()],ja+gn[0].length):-1}function mn(ai,ba,ja){var gn=G.exec(ba.slice(ja));return gn?(ai.m=ue[gn[0].toLowerCase()],ja+gn[0].length):-1}function Ln(ai,ba,ja){var gn=F.exec(ba.slice(ja));return gn?(ai.m=$[gn[0].toLowerCase()],ja+gn[0].length):-1}function Fi(ai,ba,ja){return Ot(ai,r,ba,ja)}function xa(ai,ba,ja){return Ot(ai,t,ba,ja)}function is(ai,ba,ja){return Ot(ai,n,ba,ja)}function _s(ai){return s[ai.getDay()]}function as(ai){return o[ai.getDay()]}function lu(ai){return f[ai.getMonth()]}function Ac(ai){return l[ai.getMonth()]}function LB(ai){return i[+(ai.getHours()>=12)]}function NB(ai){return 1+~~(ai.getMonth()/3)}function UB(ai){return s[ai.getUTCDay()]}function zB(ai){return o[ai.getUTCDay()]}function ZB(ai){return f[ai.getUTCMonth()]}function VB(ai){return l[ai.getUTCMonth()]}function jB(ai){return i[+(ai.getUTCHours()>=12)]}function HB(ai){return 1+~~(ai.getUTCMonth()/3)}return{format:function(ai){var ba=ht(ai+="",xe);return ba.toString=function(){return ai},ba},parse:function(ai){var ba=gt(ai+="",!1);return ba.toString=function(){return ai},ba},utcFormat:function(ai){var ba=ht(ai+="",ze);return ba.toString=function(){return ai},ba},utcParse:function(ai){var ba=gt(ai+="",!0);return ba.toString=function(){return ai},ba}}}var pb={"-":"",_:" ",0:"0"},uu=/^\s*\d+/,BP=/^%/,LP=/[\\^$*+?|[\]().{}]/g;function Va(e,r,t){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o<t?new Array(t-o+1).join(r)+i:i)}function NP(e){return e.replace(LP,"\\$&")}function _m(e){return new RegExp("^(?:"+e.map(NP).join("|")+")","i")}function ym(e){for(var r={},t=-1,n=e.length;++t<n;)r[e[t].toLowerCase()]=t;return r}function UP(e,r,t){var n=uu.exec(r.slice(t,t+1));return n?(e.w=+n[0],t+n[0].length):-1}function zP(e,r,t){var n=uu.exec(r.slice(t,t+1));return n?(e.u=+n[0],t+n[0].length):-1}function ZP(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.U=+n[0],t+n[0].length):-1}function VP(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.V=+n[0],t+n[0].length):-1}function jP(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.W=+n[0],t+n[0].length):-1}function db(e,r,t){var n=uu.exec(r.slice(t,t+4));return n?(e.y=+n[0],t+n[0].length):-1}function vb(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),t+n[0].length):-1}function HP(e,r,t){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(r.slice(t,t+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),t+n[0].length):-1}function WP(e,r,t){var n=uu.exec(r.slice(t,t+1));return n?(e.q=n[0]*3-3,t+n[0].length):-1}function GP(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.m=n[0]-1,t+n[0].length):-1}function mb(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.d=+n[0],t+n[0].length):-1}function XP(e,r,t){var n=uu.exec(r.slice(t,t+3));return n?(e.m=0,e.d=+n[0],t+n[0].length):-1}function gb(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.H=+n[0],t+n[0].length):-1}function $P(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.M=+n[0],t+n[0].length):-1}function YP(e,r,t){var n=uu.exec(r.slice(t,t+2));return n?(e.S=+n[0],t+n[0].length):-1}function qP(e,r,t){var n=uu.exec(r.slice(t,t+3));return n?(e.L=+n[0],t+n[0].length):-1}function KP(e,r,t){var n=uu.exec(r.slice(t,t+6));return n?(e.L=Math.floor(n[0]/1e3),t+n[0].length):-1}function QP(e,r,t){var n=BP.exec(r.slice(t,t+1));return n?t+n[0].length:-1}function JP(e,r,t){var n=uu.exec(r.slice(t));return n?(e.Q=+n[0],t+n[0].length):-1}function e5(e,r,t){var n=uu.exec(r.slice(t));return n?(e.s=+n[0],t+n[0].length):-1}function _b(e,r){return Va(e.getDate(),r,2)}function t5(e,r){return Va(e.getHours(),r,2)}function r5(e,r){return Va(e.getHours()%12||12,r,2)}function n5(e,r){return Va(1+g_.count(dv(e),e),r,3)}function yb(e,r){return Va(e.getMilliseconds(),r,3)}function i5(e,r){return yb(e,r)+"000"}function a5(e,r){return Va(e.getMonth()+1,r,2)}function o5(e,r){return Va(e.getMinutes(),r,2)}function s5(e,r){return Va(e.getSeconds(),r,2)}function u5(e){var r=e.getDay();return r===0?7:r}function l5(e,r){return Va(m_.count(dv(e)-1,e),r,2)}function xb(e){var r=e.getDay();return r>=4||r===0?vv(e):vv.ceil(e)}function c5(e,r){return e=xb(e),Va(vv.count(dv(e),e)+(dv(e).getDay()===4),r,2)}function f5(e){return e.getDay()}function h5(e,r){return Va(Vg.count(dv(e)-1,e),r,2)}function p5(e,r){return Va(e.getFullYear()%100,r,2)}function d5(e,r){return e=xb(e),Va(e.getFullYear()%100,r,2)}function v5(e,r){return Va(e.getFullYear()%1e4,r,4)}function m5(e,r){var t=e.getDay();return e=t>=4||t===0?vv(e):vv.ceil(e),Va(e.getFullYear()%1e4,r,4)}function g5(e){var r=e.getTimezoneOffset();return(r>0?"-":(r*=-1,"+"))+Va(r/60|0,"0",2)+Va(r%60,"0",2)}function bb(e,r){return Va(e.getUTCDate(),r,2)}function _5(e,r){return Va(e.getUTCHours(),r,2)}function y5(e,r){return Va(e.getUTCHours()%12||12,r,2)}function x5(e,r){return Va(1+hb.count(mm(e),e),r,3)}function Eb(e,r){return Va(e.getUTCMilliseconds(),r,3)}function b5(e,r){return Eb(e,r)+"000"}function E5(e,r){return Va(e.getUTCMonth()+1,r,2)}function S5(e,r){return Va(e.getUTCMinutes(),r,2)}function A5(e,r){return Va(e.getUTCSeconds(),r,2)}function T5(e){var r=e.getUTCDay();return r===0?7:r}function w5(e,r){return Va(cb.count(mm(e)-1,e),r,2)}function Sb(e){var r=e.getUTCDay();return r>=4||r===0?mv(e):mv.ceil(e)}function C5(e,r){return e=Sb(e),Va(mv.count(mm(e),e)+(mm(e).getUTCDay()===4),r,2)}function R5(e){return e.getUTCDay()}function M5(e,r){return Va(Hg.count(mm(e)-1,e),r,2)}function I5(e,r){return Va(e.getUTCFullYear()%100,r,2)}function P5(e,r){return e=Sb(e),Va(e.getUTCFullYear()%100,r,2)}function O5(e,r){return Va(e.getUTCFullYear()%1e4,r,4)}function D5(e,r){var t=e.getUTCDay();return e=t>=4||t===0?mv(e):mv.ceil(e),Va(e.getUTCFullYear()%1e4,r,4)}function F5(){return"+0000"}function Ab(){return"%"}function Tb(e){return+e}function wb(e){return Math.floor(+e/1e3)}var gv,Cb,k5,B5,L5;N5({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function N5(e){return gv=kP(e),Cb=gv.format,k5=gv.parse,B5=gv.utcFormat,L5=gv.utcParse,gv}var xm=1e3,bm=xm*60,Em=bm*60,Sm=Em*24,U5=Sm*7,Rb=Sm*30,b_=Sm*365;function z5(e){return new Date(e)}function Z5(e){return e instanceof Date?+e:+new Date(+e)}function Mb(e,r,t,n,i,o,s,l,f){var v=Bx(Yu,Yu),y=v.invert,b=v.domain,T=f(".%L"),M=f(":%S"),O=f("%I:%M"),F=f("%I %p"),$=f("%a %d"),G=f("%b %d"),ue=f("%B"),xe=f("%Y"),ze=[[s,1,xm],[s,5,5*xm],[s,15,15*xm],[s,30,30*xm],[o,1,bm],[o,5,5*bm],[o,15,15*bm],[o,30,30*bm],[i,1,Em],[i,3,3*Em],[i,6,6*Em],[i,12,12*Em],[n,1,Sm],[n,2,2*Sm],[t,1,U5],[r,1,Rb],[r,3,3*Rb],[e,1,b_]];function Je(gt){return(s(gt)<gt?T:o(gt)<gt?M:i(gt)<gt?O:n(gt)<gt?F:r(gt)<gt?t(gt)<gt?$:G:e(gt)<gt?ue:xe)(gt)}function ht(gt,Ot,tr,Ir){if(gt==null&&(gt=10),typeof gt=="number"){var Er=Math.abs(tr-Ot)/gt,mn=px(function(Ln){return Ln[2]}).right(ze,Er);mn===ze.length?(Ir=r_(Ot/b_,tr/b_,gt),gt=e):mn?(mn=ze[Er/ze[mn-1][2]<ze[mn][2]/Er?mn-1:mn],Ir=mn[1],gt=mn[0]):(Ir=Math.max(r_(Ot,tr,gt),1),gt=l)}return Ir==null?gt:gt.every(Ir)}return v.invert=function(gt){return new Date(y(gt))},v.domain=function(gt){return arguments.length?b(Rx.call(gt,Z5)):b().map(z5)},v.ticks=function(gt,Ot){var tr=b(),Ir=tr[0],Er=tr[tr.length-1],mn=Er<Ir,Ln;return mn&&(Ln=Ir,Ir=Er,Er=Ln),Ln=ht(gt,Ir,Er,Ot),Ln=Ln?Ln.range(Ir,Er+1):[],mn?Ln.reverse():Ln},v.tickFormat=function(gt,Ot){return Ot==null?Je:f(Ot)},v.nice=function(gt,Ot){var tr=b();return(gt=ht(gt,tr[0],tr[tr.length-1],Ot))?b(Wx(tr,gt)):v},v.copy=function(){return Lg(v,Mb(e,r,t,n,i,o,s,l,f))},v}function V5(){return Dp.apply(Mb(dv,EP,m_,g_,CP,RP,MP,IP,Cb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function cN(){return initRange.apply(calendar(utcYear,utcMonth,utcWeek,utcDay,utcHour,utcMinute,utcSecond,utcMillisecond,utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Wg(){var e=0,r=1,t,n,i,o,s=Yu,l=!1,f;function v(y){return isNaN(y=+y)?f:s(i===0?.5:(y=(o(y)-t)*i,l?Math.max(0,Math.min(1,y)):y))}return v.domain=function(y){return arguments.length?(t=o(e=+y[0]),n=o(r=+y[1]),i=t===n?0:1/(n-t),v):[e,r]},v.clamp=function(y){return arguments.length?(l=!!y,v):l},v.interpolator=function(y){return arguments.length?(s=y,v):s},v.unknown=function(y){return arguments.length?(f=y,v):f},function(y){return o=y,t=y(e),n=y(r),i=t===n?0:1/(n-t),v}}function Am(e,r){return r.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Ib(){var e=dm(Wg()(Yu));return e.copy=function(){return Am(e,Ib())},Mx.apply(e,arguments)}function j5(){var e=loggish(Wg()).domain([1,10]);return e.copy=function(){return Am(e,j5()).base(e.base())},initInterpolator.apply(e,arguments)}function H5(){var e=symlogish(Wg());return e.copy=function(){return Am(e,H5()).constant(e.constant())},initInterpolator.apply(e,arguments)}function Pb(){var e=powish(Wg());return e.copy=function(){return Am(e,Pb()).exponent(e.exponent())},initInterpolator.apply(e,arguments)}function fN(){return Pb.apply(null,arguments).exponent(.5)}function W5(){var e=[],r=identity;function t(n){if(!isNaN(n=+n))return r((bisect(e,n)-1)/(e.length-1))}return t.domain=function(n){if(!arguments.length)return e.slice();e=[];for(var i=0,o=n.length,s;i<o;++i)s=n[i],s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(ascending),t},t.interpolator=function(n){return arguments.length?(r=n,t):r},t.copy=function(){return W5(r).domain(e)},initInterpolator.apply(t,arguments)}function Gg(){var e=0,r=.5,t=1,n,i,o,s,l,f=Yu,v,y=!1,b;function T(M){return isNaN(M=+M)?b:(M=.5+((M=+v(M))-i)*(M<i?s:l),f(y?Math.max(0,Math.min(1,M)):M))}return T.domain=function(M){return arguments.length?(n=v(e=+M[0]),i=v(r=+M[1]),o=v(t=+M[2]),s=n===i?0:.5/(i-n),l=i===o?0:.5/(o-i),T):[e,r,t]},T.clamp=function(M){return arguments.length?(y=!!M,T):y},T.interpolator=function(M){return arguments.length?(f=M,T):f},T.unknown=function(M){return arguments.length?(b=M,T):b},function(M){return v=M,n=M(e),i=M(r),o=M(t),s=n===i?0:.5/(i-n),l=i===o?0:.5/(o-i),T}}function Ob(){var e=dm(Gg()(Yu));return e.copy=function(){return Am(e,Ob())},Mx.apply(e,arguments)}function G5(){var e=loggish(Gg()).domain([.1,1,10]);return e.copy=function(){return copy(e,G5()).base(e.base())},initInterpolator.apply(e,arguments)}function X5(){var e=symlogish(Gg());return e.copy=function(){return copy(e,X5()).constant(e.constant())},initInterpolator.apply(e,arguments)}function Db(){var e=powish(Gg());return e.copy=function(){return copy(e,Db()).exponent(e.exponent())},initInterpolator.apply(e,arguments)}function hN(){return Db.apply(null,arguments).exponent(.5)}function Fb(e){var r,t=[];function n(i){return i==null?r:i}return n.invert=n,n.domain=n.range=function(i){return i?(t=i,i):t},n.unknown=function(i){return i?(r=i,i):r},n.copy=function(){return Fb(e).unknown(r)},n}var bc,kb,Bb,E_=oi.isNil,$5=oi.isString,Y5=oi.uniq,q5=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/,K5=(bc={},(0,B.Z)(bc,ro.LINEAR,Hx),(0,B.Z)(bc,ro.POWER,h_),(0,B.Z)(bc,ro.LOG,Yx),(0,B.Z)(bc,ro.IDENTITY,Fb),(0,B.Z)(bc,ro.SEQUENTIAL,Ib),(0,B.Z)(bc,ro.TIME,V5),(0,B.Z)(bc,ro.QUANTILE,Jx),(0,B.Z)(bc,ro.QUANTIZE,eb),(0,B.Z)(bc,ro.THRESHOLD,tb),(0,B.Z)(bc,ro.CAT,kg),(0,B.Z)(bc,ro.DIVERGING,Ob),bc),Q5=(kb=(0,yt.b2)(),kb(Bb=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"scaleOptions",{})}return(0,j.Z)(e,[{key:"apply",value:function(t,n){var i=this,o=n.styleAttributeService;t.hooks.init.tapPromise("FeatureScalePlugin",(0,Pt.Z)(ge().mark(function s(){var l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(t.log(Rs.ScaleInitStart,ds.INIT),i.scaleOptions=t.getScaleOptions(),f=o.getLayerStyleAttributes(),v=(l=t.getSource())===null||l===void 0?void 0:l.data.dataArray,!(Array.isArray(v)&&v.length===0)){b.next=8;break}return b.abrupt("return");case 8:i.caculateScalesForAttributes(f||[],v);case 9:t.log(Rs.ScaleInitEnd,ds.INIT);case 10:case"end":return b.stop()}},s)}))),t.hooks.beforeRenderData.tapPromise("FeatureScalePlugin",function(){var s=(0,Pt.Z)(ge().mark(function l(f){var v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(f){T.next=2;break}return T.abrupt("return",f);case 2:if(t.log(Rs.ScaleInitStart,ds.UPDATE),i.scaleOptions=t.getScaleOptions(),v=o.getLayerStyleAttributes(),y=t.getSource().data.dataArray,!(Array.isArray(y)&&y.length===0)){T.next=8;break}return T.abrupt("return",!0);case 8:return i.caculateScalesForAttributes(v||[],y),t.log(Rs.ScaleInitEnd,ds.UPDATE),t.layerModelNeedUpdate=!0,T.abrupt("return",!0);case 12:case"end":return T.stop()}},l)}));return function(l){return s.apply(this,arguments)}}()),t.hooks.beforeRender.tap("FeatureScalePlugin",function(){if(!t.layerModelNeedUpdate){i.scaleOptions=t.getScaleOptions();var s=o.getLayerStyleAttributes(),l=t.getSource().data.dataArray;if(!(Array.isArray(l)&&l.length===0)&&s){var f=s.filter(function(v){return v.needRescale});f.length&&i.caculateScalesForAttributes(f,l)}}})}},{key:"isNumber",value:function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},{key:"caculateScalesForAttributes",value:function(t,n){var i=this;t.forEach(function(o){if(o.scale){var s=o.scale,l=o.scale.field;s.names=i.parseFields(E_(l)?[]:l);var f=[];s.names.forEach(function(v){var y;f.push(i.createScale(v,o.name,(y=o.scale)===null||y===void 0?void 0:y.values,n))}),f.some(function(v){return v.type===ov.VARIABLE})?(s.type=ov.VARIABLE,f.forEach(function(v){if(!s.callback&&s.values!=="text"){var y;switch((y=v.option)===null||y===void 0?void 0:y.type){case ro.LOG:case ro.LINEAR:case ro.POWER:if(s.values&&s.values.length>2){var b=v.scale.ticks(s.values.length);v.scale.domain(b)}s.values?v.scale.range(s.values):v.scale.range(v.option.domain);break;case ro.QUANTILE:case ro.QUANTIZE:case ro.THRESHOLD:v.scale.range(s.values);break;case ro.IDENTITY:break;case ro.CAT:s.values?v.scale.range(s.values):v.scale.range(v.option.domain);break;case ro.DIVERGING:case ro.SEQUENTIAL:v.scale.interpolator(BI(s.values));break}}if(s.values==="text"){var T;v.scale.range((T=v.option)===null||T===void 0?void 0:T.domain)}})):(s.type=ov.CONSTANT,s.defaultValues=f.map(function(v,y){return v.scale(s.names[y])})),s.scalers=f.map(function(v){return{field:v.field,func:v.scale,option:v.option}}),o.needRescale=!1}})}},{key:"parseFields",value:function(t){return Array.isArray(t)?t:$5(t)?t.split("*"):[t]}},{key:"createScale",value:function(t,n,i,o){var s,l,f=this.scaleOptions[n]&&((s=this.scaleOptions[n])===null||s===void 0?void 0:s.field)===t?this.scaleOptions[n]:this.scaleOptions[t],v={field:t,scale:void 0,type:ov.VARIABLE,option:f};if(!o||!o.length)return f&&f.type?v.scale=this.createDefaultScale(f):(v.scale=kg([t]),v.type=ov.CONSTANT),v;var y=(l=o.find(function(M){return!E_(M[t])}))===null||l===void 0?void 0:l[t];if(this.isNumber(t)||E_(y)&&!f)v.scale=kg([t]),v.type=ov.CONSTANT;else{var b=f&&f.type||this.getDefaultType(y);i==="text"&&(b=ro.CAT),i===void 0&&(b=ro.IDENTITY);var T=this.createScaleConfig(b,t,f,o);v.scale=this.createDefaultScale(T),v.option=T}return v}},{key:"getDefaultType",value:function(t){var n=ro.LINEAR;return typeof t=="string"&&(n=q5.test(t)?ro.TIME:ro.CAT),n}},{key:"createScaleConfig",value:function(t,n,i,o){var s={type:t},l=(o==null?void 0:o.map(function(y){return y[n]}))||[];if(i!=null&&i.domain)s.domain=i==null?void 0:i.domain;else if(t===ro.CAT||t===ro.IDENTITY)s.domain=Y5(l);else if(t===ro.QUANTILE)s.domain=l;else if(t===ro.DIVERGING){var f=vx(l),v=(i==null?void 0:i.neutral)!==void 0?i==null?void 0:i.neutral:(f[0]+f[1])/2;s.domain=[f[0],v,f[1]]}else s.domain=vx(l);return(0,V.Z)((0,V.Z)({},s),i)}},{key:"createDefaultScale",value:function(t){var n=t.type,i=t.domain,o=t.unknown,s=t.clamp,l=t.nice,f=K5[n]();return i&&f.domain&&f.domain(i),o&&f.unknown(o),s!==void 0&&f.clamp&&f.clamp(s),l!==void 0&&f.nice&&f.nice(l),f}}]),e}())||Bb),Lb,Nb,J5=(Lb=(0,yt.b2)(),Lb(Nb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t){t.hooks.beforeRender.tap("LayerAnimateStylePlugin",function(){var n=t.animateStatus;n&&t.models.forEach(function(i){i.addUniforms((0,V.Z)({},t.layerModel.getAnimateUniforms()))})})}}]),e}())||Nb),Ub,zb,eO=(Ub=(0,yt.b2)(),Ub(zb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t){t.hooks.afterInit.tap("LayerMaskPlugin",function(){var n=t.getLayerConfig(),i=n.maskLayers,o=n.enableMask;if(!t.tileLayer&&i&&i.length>0){var s;(s=t.masks).push.apply(s,(0,Kt.Z)(i)),t.updateLayerConfig({mask:o})}})}}]),e}())||zb),tO=function(){function e(r){var t=r.rendererService,n=r.layerService,i=r.parent;(0,Q.Z)(this,e),(0,B.Z)(this,"tileResource",new Map),(0,B.Z)(this,"layerTiles",[]),this.rendererService=t,this.layerService=n,this.parent=i}return(0,j.Z)(e,[{key:"tiles",get:function(){return this.layerTiles}},{key:"hasTile",value:function(t){return this.layerTiles.some(function(n){return n.key===t})}},{key:"addTile",value:function(t){this.layerTiles.push(t)}},{key:"getTile",value:function(t){return this.layerTiles.find(function(n){return n.key===t})}},{key:"getVisibleTileBylngLat",value:function(t){return this.layerTiles.find(function(n){return n.isLoaded&&n.visible&&n.lnglatInBounds(t)})}},{key:"removeTile",value:function(t){var n=this.layerTiles.findIndex(function(o){return o.key===t}),i=this.layerTiles.splice(n,1);i[0]&&i[0].destroy()}},{key:"updateTileVisible",value:function(t){var n=this.getTile(t.key);if(t.isVisible)if(t.parent){var i=this.isChildrenLoaded(t.parent);n==null||n.updateVisible(i)}else n==null||n.updateVisible(!0);else if(t.parent){var o=this.isChildrenLoaded(t.parent);n==null||n.updateVisible(!o)}else n==null||n.updateVisible(!1)}},{key:"isParentLoaded",value:function(t){var n=t.parent;if(!n)return!0;var i=this.getTile(n==null?void 0:n.key);return!!(i!=null&&i.isLoaded)}},{key:"isChildrenLoaded",value:function(t){var n=this,i=t==null?void 0:t.children;return i.length===0?!0:i.every(function(o){var s=n.getTile(o==null?void 0:o.key);return s?(s==null?void 0:s.isLoaded)===!0:!0})}},{key:"render",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){var i=this,o,s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return o=this.getRenderLayers(),s=o.map(function(){var v=(0,Pt.Z)(ge().mark(function y(b){return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return M.next=2,i.layerService.renderTileLayer(b);case 2:case"end":return M.stop()}},y)}));return function(y){return v.apply(this,arguments)}}()),f.next=4,Promise.all(s);case 4:case"end":return f.stop()}},n,this)}));function t(){return r.apply(this,arguments)}return t}()},{key:"getRenderLayers",value:function(){var t=this.layerTiles.filter(function(i){return i.visible&&i.isLoaded}),n=[];return t.map(function(i){return n.push.apply(n,(0,Kt.Z)(i.getLayers()))}),n}},{key:"getLayers",value:function(){var t=this.layerTiles.filter(function(i){return i.isLoaded}),n=[];return t.map(function(i){return n.push.apply(n,(0,Kt.Z)(i.getLayers()))}),n}},{key:"getTiles",value:function(){return this.layerTiles}},{key:"destroy",value:function(){this.layerTiles.forEach(function(t){return t.destroy()}),this.tileResource.clear()}}]),e}(),rO=L(37824);function nO(e,r,t){t===void 0&&(t={});var n=Zr(e),i=Zr(r),o=rO.union(n.coordinates,i.coordinates);return o.length===0?null:o.length===1?Lt(o[0],t.properties):Kr(o,t.properties)}var iO=nO,aO=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"getCombineFeature",value:function(t){var n=null,i=t[0];return t.map(function(o){var s=Lt(o.coordinates);n===null?n=s:n=iO(n,s)}),i&&(n.properties=(0,V.Z)({},i)),n}}]),e}(),Tm="select",wm="active",oO=function(){function e(r){var t=r.layerService,n=r.tileLayerService,i=r.parent;(0,Q.Z)(this,e),(0,B.Z)(this,"tilePickID",new Map),this.layerService=t,this.tileLayerService=n,this.parent=i,this.tileSourceService=new aO}return(0,j.Z)(e,[{key:"pickRender",value:function(t){var n=this.tileLayerService.getVisibleTileBylngLat(t.lngLat);if(n){var i=n.getMainLayer();i==null||i.layerPickService.pickRender(t)}}},{key:"pick",value:function(t,n){var i=this.parent.getContainer(),o=i.get(ot.IPickingService);if(t.type==="RasterLayer"){var s=this.tileLayerService.getVisibleTileBylngLat(n.lngLat);if(s&&s.getMainLayer()!==void 0){var l=s.getMainLayer();return l.layerPickService.pickRasterLayer(l,n,this.parent)}return!1}return this.pickRender(n),o.pickFromPickingFBO(t,n)}},{key:"selectFeature",value:function(t){var n=(0,Sn.Z)(t,3),i=n[0],o=n[1],s=n[2],l=this.color2PickId(i,o,s);this.tilePickID.set(Tm,l),this.updateHighLight(i,o,s,Tm)}},{key:"highlightPickedFeature",value:function(t){var n=(0,Sn.Z)(t,3),i=n[0],o=n[1],s=n[2],l=this.color2PickId(i,o,s);this.tilePickID.set(wm,l),this.updateHighLight(i,o,s,wm)}},{key:"updateHighLight",value:function(t,n,i,o){this.tileLayerService.tiles.map(function(s){var l=s.getMainLayer();switch(o){case Tm:l==null||l.hooks.beforeSelect.call([t,n,i]);break;case wm:l==null||l.hooks.beforeHighlight.call([t,n,i]);break}})}},{key:"setPickState",value:function(){var t=this.tilePickID.get(Tm),n=this.tilePickID.get(wm);if(t){var i=this.pickId2Color(t),o=(0,Sn.Z)(i,3),s=o[0],l=o[1],f=o[2];this.updateHighLight(s,l,f,Tm);return}if(n){var v=this.pickId2Color(n),y=(0,Sn.Z)(v,3),b=y[0],T=y[1],M=y[2];this.updateHighLight(b,T,M,wm);return}}},{key:"color2PickId",value:function(t,n,i){return Oa(new Uint8Array([t,n,i]))}},{key:"pickId2Color",value:function(t){return sa(t)}},{key:"getFeatureById",value:function(t){var n=this.tileLayerService.getTiles().filter(function(o){return o.visible}),i=[];return n.forEach(function(o){i.push.apply(i,(0,Kt.Z)(o.getFeatureById(t)))}),i}},{key:"pickRasterLayer",value:function(t,n,i){return!1}}]),e}();function sO(e){return e==="PolygonLayer"?Rg:e==="LineLayer"?q0:Cg}function uO(e){return["PolygonLayer","LineLayer"].indexOf(e)!==-1}function lO(e){var r=cO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function cO(){if(typeof Reflect=="undefined"||!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(e){return!1}}var xd=function(e){(0,Le.Z)(t,e);var r=lO(t);function t(n,i){var o;return(0,Q.Z)(this,t),o=r.call(this),(0,B.Z)((0,Fe.Z)(o),"visible",!0),(0,B.Z)((0,Fe.Z)(o),"layers",[]),(0,B.Z)((0,Fe.Z)(o),"isLoaded",!1),(0,B.Z)((0,Fe.Z)(o),"tileMaskLayers",[]),o.parent=i,o.sourceTile=n,o.x=n.x,o.y=n.y,o.z=n.z,o.key="".concat(o.x,"_").concat(o.y,"_").concat(o.z),o}return(0,j.Z)(t,[{key:"getLayers",value:function(){return this.layers}},{key:"styleUpdate",value:function(){}},{key:"lnglatInBounds",value:function(i){var o=(0,Sn.Z)(this.sourceTile.bounds,4),s=o[0],l=o[1],f=o[2],v=o[3],y=i.lng,b=i.lat;return y>=s&&y<=f&&b>=l&&b<=v}},{key:"getLayerOptions",value:function(){var i,o=this.parent.getLayerConfig();return(0,V.Z)((0,V.Z)({},o),{},{textAllowOverlap:!0,autoFit:!1,maskLayers:this.getMaskLayer(),tileMask:uO(this.parent.type),mask:o.mask||((i=o.maskLayers)===null||i===void 0?void 0:i.length)!==0&&o.enableMask})}},{key:"getMaskLayer",value:function(){var i=this,o=this.parent.getLayerConfig(),s=o.maskLayers,l=[];return s==null||s.forEach(function(f){if(!f.tileLayer)return l.push(f),f;var v=f.tileLayer,y=v.getTile(i.sourceTile.key),b=y==null?void 0:y.getLayers()[0];b&&l.push(b)}),l}},{key:"addTileMask",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f;return ge().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return s=new Rg({visible:!1,enablePicking:!1}).source({type:"FeatureCollection",features:[this.sourceTile.bboxPolygon]},{parser:{type:"geojson",featureId:"id"}}).shape("fill").style({opacity:.5}),l=lm(this.parent.sceneContainer),s.setContainer(l,this.parent.sceneContainer),y.next=5,s.init();case 5:return this.tileMask=s,f=this.getMainLayer(),f!==void 0&&(f.tileMask=s),y.abrupt("return",s);case 9:case"end":return y.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"addMask",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s,l){var f;return ge().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return f=lm(this.parent.sceneContainer),l.setContainer(f,this.parent.sceneContainer),y.next=4,l.init();case 4:s.addMask(l),this.tileMaskLayers.push(l);case 6:case"end":return y.stop()}},o,this)}));function i(o,s){return n.apply(this,arguments)}return i}()},{key:"addLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(s){var l;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return s.isTileLayer=!0,l=lm(this.parent.sceneContainer),s.setContainer(l,this.parent.sceneContainer),this.layers.push(s),v.next=6,s.init();case 6:case"end":return v.stop()}},o,this)}));function i(o){return n.apply(this,arguments)}return i}()},{key:"updateVisible",value:function(i){this.visible=i,this.updateOptions("visible",i)}},{key:"updateOptions",value:function(i,o){this.layers.forEach(function(s){s.updateLayerConfig((0,B.Z)({},i,o))})}},{key:"getMainLayer",value:function(){return this.layers[0]}},{key:"getFeatures",value:function(i){return[]}},{key:"getFeatureById",value:function(i){return[]}},{key:"destroy",value:function(){var i;(i=this.tileMask)===null||i===void 0||i.destroy(),this.layers.forEach(function(o){return o.destroy()})}}]),t}(io.EventEmitter);function fO(e){var r=hO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function hO(){if(typeof Reflect=="undefined"||!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(e){return!1}}var pO=function(e){(0,Le.Z)(t,e);var r=fO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.getSourceOption(),l=s.data.features[0].properties,f=new q0().source(s.data,s.options).size(1).shape("line").color("red"),v=new Cg({minZoom:this.z-1,maxZoom:this.z+1,textAllowOverlap:!0}).source([l],{parser:{type:"json",x:"x",y:"y"}}).size(20).color("red").shape(this.key).style({stroke:"#fff",strokeWidth:2}),b.next=6,this.addLayer(f);case 6:return b.next=8,this.addLayer(v);case 8:this.isLoaded=!0;case 9:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.sourceTile.data.layers.testTile.features;return{data:{type:"FeatureCollection",features:o},options:{parser:{type:"geojson"},transforms:i.transforms}}}}]),t}(xd);function dO(e){var r=vO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function vO(){if(typeof Reflect=="undefined"||!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(e){return!1}}var mO=function(e){(0,Le.Z)(t,e);var r=dO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),v=new P1((0,V.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,O,F=T;v[F]((M=s[F])===null||M===void 0?void 0:M.field,(O=s[F])===null||O===void 0?void 0:O.values)}),b.next=7,this.addLayer(v);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:i.transforms}}}}]),t}(xd);function gO(e){var r=_O();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function _O(){if(typeof Reflect=="undefined"||!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(e){return!1}}var yO=function(e){(0,Le.Z)(t,e);var r=gO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),v=new ix((0,V.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,O,F=T;v[F]((M=s[F])===null||M===void 0?void 0:M.field,(O=s[F])===null||O===void 0?void 0:O.values)}),b.next=7,this.addLayer(v);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getFeatures",value:function(i){if(!i)return[];var o=this.sourceTile.data;return o.getTileData(i)}},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.parent.getLayerConfig(),s=o.sourceLayer,l=o.featureId,f=this.getFeatures(s);return{data:{type:"FeatureCollection",features:f},options:{parser:{type:"geojson",featureId:l},transforms:i.transforms}}}}]),t}(xd),xO=["rasterData"];function bO(e){var r=EO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function EO(){if(typeof Reflect=="undefined"||!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(e){return!1}}var SO=function(e){(0,Le.Z)(t,e);var r=bO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),v=new Mg((0,V.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,O,F=T;v[F]((M=s[F])===null||M===void 0?void 0:M.field,(O=s[F])===null||O===void 0?void 0:O.values)}),b.next=7,this.addLayer(v);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.sourceTile.data.data,s=o.rasterData,l=(0,ka.Z)(o,xO);return{data:s,options:{parser:(0,V.Z)({type:"rasterRgb",extent:this.sourceTile.bounds},l),transforms:i.transforms}}}}]),t}(xd);function AO(e){var r=TO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function TO(){if(typeof Reflect=="undefined"||!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(e){return!1}}var wO=function(e){(0,Le.Z)(t,e);var r=AO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v;return ge().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),v=new Mg((0,V.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,O,F=T;v[F]((M=s[F])===null||M===void 0?void 0:M.field,(O=s[F])===null||O===void 0?void 0:O.values)}),b.next=7,this.addLayer(v);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource();return{data:this.sourceTile.data,options:{parser:{type:"image",extent:this.sourceTile.bounds},transforms:i.transforms}}}}]),t}(xd),CO=["rasterData"];function RO(e){var r=MO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function MO(){if(typeof Reflect=="undefined"||!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(e){return!1}}var IO={positions:[0,1],colors:["#000","#fff"]},PO=function(e){(0,Le.Z)(t,e);var r=RO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y,b,T;return ge().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),v=this.getLayerOptions(),y=v.rampColors,b=v.domain,this.colorTexture=this.parent.textureService.getColorTexture(y,b),T=new Mg((0,V.Z)((0,V.Z)({},l),{},{colorTexture:this.colorTexture})).source(f.data,f.options),s&&Object.keys(s).forEach(function(F){var $,G,ue=F;T[ue](($=s[ue])===null||$===void 0?void 0:$.field,(G=s[ue])===null||G===void 0?void 0:G.values)}),O.next=9,this.addLayer(T);case 9:this.isLoaded=!0;case 10:case"end":return O.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.sourceTile.data.data,s=o.rasterData,l=(0,ka.Z)(o,CO);return{data:s,options:{parser:(0,V.Z)({type:"raster",extent:this.sourceTile.bounds},l),transforms:i.transforms}}}},{key:"styleUpdate",value:function(){for(var i=this,o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];var f=s,v=f.rampColors,y=v===void 0?IO:v,b=f.domain;this.colorTexture=this.parent.textureService.getColorTexture(y,b||Cc(y)),this.layers.forEach(function(T){return T.style({colorTexture:i.colorTexture})})}},{key:"destroy",value:function(){this.layers.forEach(function(i){return i.destroy()})}}]),t}(xd);function OO(e){var r=DO();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function DO(){if(typeof Reflect=="undefined"||!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(e){return!1}}var Xg=function(e){(0,Le.Z)(t,e);var r=OO(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"initTileLayer",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s,l,f,v,y;return ge().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=sO(this.parent.type),v=this.getSourceOption(),v){T.next=8;break}return this.isLoaded=!0,this.emit("loaded"),T.abrupt("return");case 8:return y=new f((0,V.Z)({},l)).source(v.data,v.options),Object.keys(s).forEach(function(M){var O,F,$=M;y[$]((O=s[$])===null||O===void 0?void 0:O.field,(F=s[$])===null||F===void 0?void 0:F.values)}),T.next=12,this.addLayer(y);case 12:if(!l.tileMask){T.next=15;break}return T.next=15,this.addTileMask();case 15:this.setLayerMinMaxZoom(y),this.isLoaded=!0,this.emit("loaded");case 18:case"end":return T.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),o=this.parent.getLayerConfig(),s=o.sourceLayer,l=s===void 0?"defaultLayer":s,f=o.featureId,v=f===void 0?"id":f,y=this.getFeatures(l);return{data:{type:"FeatureCollection",features:y},options:{parser:{type:"geojson",featureId:v},transforms:i.transforms}}}},{key:"setLayerMinMaxZoom",value:function(i){i.getModelType()==="text"&&i.updateLayerConfig({maxZoom:this.z+1,minZoom:this.z-1})}},{key:"getFeatures",value:function(i){var o=this.sourceTile.data;return o.getTileData(i)}},{key:"getFeatureById",value:function(i){var o=this.getMainLayer();if(!o)return[];var s=o.getSource().data.dataArray.filter(function(l){return l._id===i});return s}}]),t}(xd);function FO(e){var r=e.type;switch(r){case"PolygonLayer":return Xg;case"LineLayer":return Xg;case"PointLayer":return Xg;case"TileDebugLayer":return pO;case"MaskLayer":return yO;case"RasterLayer":var t=e.getSource().parser.dataType;switch(t){case Eu.RGB:case Eu.CUSTOMRGB:return SO;case Eu.ARRAYBUFFER:case Eu.CUSTOMARRAYBUFFER:return PO;case Eu.TERRAINRGB:case Eu.CUSTOMTERRAINRGB:return wO;default:return mO}default:return Xg}}var kO=["shape","color","size","style","animate","filter","rotate","scale","setBlend","setSelect","setActive","disableMask","enableMask"],BO=oi.debounce,Zb=function(){function e(r){var t=this;(0,Q.Z)(this,e),(0,B.Z)(this,"initedTileset",!1),(0,B.Z)(this,"mapchange",function(){var i;if(t.parent.isVisible()!==!1){var o=t.getCurrentView(),s=o.latLonBounds,l=o.zoom;if(t.mapService.version==="GAODE1.x"){var f=t.parent.getLayerConfig(),v=f.visible;l<2&&v?(t.parent.updateLayerConfig({visible:!1}),t.layerService.reRender()):l>=2&&!v&&(t.parent.updateLayerConfig({visible:!0}),t.layerService.reRender())}t.lastViewStates&&t.lastViewStates.zoom===l&&t.lastViewStates.latLonBounds.toString()===s.toString()||(t.lastViewStates={zoom:l,latLonBounds:s},(i=t.tilesetManager)===null||i===void 0||i.throttleUpdate(l,s))}}),(0,B.Z)(this,"viewchange",BO(this.mapchange,24)),this.parent=r;var n=this.parent.getContainer();this.rendererService=n.get(ot.IRendererService),this.layerService=n.get(ot.ILayerService),this.mapService=n.get(ot.IMapService),this.pickingService=n.get(ot.IPickingService),this.tileLayerService=new tO({rendererService:this.rendererService,layerService:this.layerService,parent:r}),this.tilePickService=new oO({tileLayerService:this.tileLayerService,layerService:this.layerService,parent:r}),this.parent.setLayerPickService(this.tilePickService),this.proxy(r),this.initTileSetManager()}return(0,j.Z)(e,[{key:"initTileSetManager",value:function(){var t,n=this.parent.getSource();if(this.tilesetManager=n.tileset,this.initedTileset||(this.bindTilesetEvent(),this.initedTileset=!0),this.parent.isVisible()!==!1){var i=this.getCurrentView(),o=i.latLonBounds,s=i.zoom;(t=this.tilesetManager)===null||t===void 0||t.update(s,o)}}},{key:"getCurrentView",value:function(){var t=this.mapService.getBounds(),n=[t[0][0],t[0][1],t[1][0],t[1][1]],i=this.mapService.getZoom();return{latLonBounds:n,zoom:i}}},{key:"bindTilesetEvent",value:function(){var t=this;this.tilesetManager.on("tile-loaded",function(n){}),this.tilesetManager.on("tile-unload",function(n){t.tileUnLoad(n)}),this.tilesetManager.on("tile-error",function(n,i){t.tileError(n)}),this.tilesetManager.on("tile-update",function(){t.tileUpdate()}),this.mapService.on("zoomend",this.mapchange),this.mapService.on("moveend",this.viewchange)}},{key:"render",value:function(){this.tileLayerService.render()}},{key:"getLayers",value:function(){return this.tileLayerService.getLayers()}},{key:"getTiles",value:function(){return this.tileLayerService.getTiles()}},{key:"getTile",value:function(t){return this.tileLayerService.getTile(t)}},{key:"tileLoaded",value:function(t){}},{key:"tileError",value:function(t){console.warn("error:",t)}},{key:"destroy",value:function(){var t;this.mapService.off("zoomend",this.mapchange),this.mapService.off("moveend",this.viewchange),(t=this.tilesetManager)===null||t===void 0||t.destroy(),this.tileLayerService.destroy()}},{key:"reload",value:function(){var t;this.tilesetManager.clear();var n=this.getCurrentView(),i=n.latLonBounds,o=n.zoom;(t=this.tilesetManager)===null||t===void 0||t.update(o,i)}},{key:"tileUnLoad",value:function(t){this.tileLayerService.removeTile(t.key)}},{key:"tileUpdate",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){var i=this,o,s;return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.tilesetManager){f.next=2;break}return f.abrupt("return");case 2:return o=this.parent.getMinZoom(),s=this.parent.getMaxZoom(),f.next=6,Promise.all(this.tilesetManager.tiles.filter(function(v){return v.isLoaded}).filter(function(v){return v.isVisibleChange}).filter(function(v){return v.data}).filter(function(v){return v.z>=o&&v.z<s}).map(function(){var v=(0,Pt.Z)(ge().mark(function y(b){var T,M;return ge().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:if(i.tileLayerService.hasTile(b.key)){F.next=9;break}return T=FO(i.parent),M=new T(b,i.parent),F.next=5,M.initTileLayer();case 5:i.tilePickService.setPickState(),M.getLayers().length!==0&&(i.tileLayerService.addTile(M),i.tileLayerService.updateTileVisible(b),i.layerService.reRender()),F.next=12;break;case 9:i.tileLayerService.updateTileVisible(b),i.tilePickService.setPickState(),i.layerService.reRender();case 12:case"end":return F.stop()}},y)}));return function(y){return v.apply(this,arguments)}}()));case 6:this.tilesetManager.isLoaded&&this.parent.emit("tiles-loaded",this.tilesetManager.currentTiles);case 7:case"end":return f.stop()}},n,this)}));function t(){return r.apply(this,arguments)}return t}()},{key:"setPickState",value:function(t){}},{key:"pickRender",value:function(t){this.tilePickService.pickRender(t)}},{key:"selectFeature",value:function(t){this.tilePickService.selectFeature(t)}},{key:"highlightPickedFeature",value:function(t){this.tilePickService.highlightPickedFeature(t)}},{key:"proxy",value:function(t){var n=this;kO.forEach(function(i){var o=t[i].bind(t);t[i]=function(){for(var s=arguments.length,l=new Array(s),f=0;f<s;f++)l[f]=arguments[f];return o.apply(void 0,l),n.getLayers().map(function(v){v[i].apply(v,l)}),i==="style"&&n.getTiles().forEach(function(v){return v.styleUpdate.apply(v,l)}),t}})}}]),e}(),Vb,jb,LO=(Vb=(0,yt.b2)(),Vb(jb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"build",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i){return ge().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return i.prepareBuildModel(),s.next=3,i.buildModels();case 3:case"end":return s.stop()}},n)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"initLayerModel",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i){return ge().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,this.build(i);case 2:i.styleNeedUpdate=!1;case 3:case"end":return s.stop()}},n,this)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"prepareLayerModel",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i){return ge().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,this.build(i);case 2:i.styleNeedUpdate=!1;case 3:case"end":return s.stop()}},n,this)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"apply",value:function(t){var n=this;t.hooks.init.tapPromise("LayerModelPlugin",(0,Pt.Z)(ge().mark(function i(){return ge().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!t.getSource().isTile){s.next=4;break}return t.prepareBuildModel(),t.tileLayer=new Zb(t),s.abrupt("return");case 4:return t.log(Rs.BuildModelStart,ds.INIT),s.next=7,n.initLayerModel(t);case 7:t.log(Rs.BuildModelEnd,ds.INIT);case 8:case"end":return s.stop()}},i)}))),t.hooks.beforeRenderData.tapPromise("LayerModelPlugin",function(){var i=(0,Pt.Z)(ge().mark(function o(s){return ge().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(s){f.next=2;break}return f.abrupt("return",!1);case 2:if(!t.getSource().isTile){f.next=5;break}return t.tileLayer=new Zb(t),f.abrupt("return",!1);case 5:return t.log(Rs.BuildModelStart,ds.UPDATE),f.next=8,n.prepareLayerModel(t);case 8:return t.log(Rs.BuildModelEnd,ds.UPDATE),f.abrupt("return",!0);case 10:case"end":return f.stop()}},o)}));return function(o){return i.apply(this,arguments)}}())}}]),e}())||jb),Hb,Wb,NO=(Hb=(0,yt.b2)(),Hb(Wb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t){t.hooks.afterInit.tap("LayerStylePlugin",function(){var n=t.getLayerConfig(),i=n.autoFit,o=n.fitBoundsOptions;i&&t.fitBounds(o),t.styleNeedUpdate=!1})}}]),e}())||Wb),Gb,Xb,UO=["type"],$b={directional:{lights:"u_DirectionalLights",num:"u_NumOfDirectionalLights"},spot:{lights:"u_SpotLights",num:"u_NumOfSpotLights"}},zO={type:"directional",direction:[1,10.5,12],ambient:[.2,.2,.2],diffuse:[.6,.6,.6],specular:[.1,.1,.1]},ZO={direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0]},VO={position:[0,0,0],direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],constant:1,linear:0,quadratic:0,angle:14,exponent:40,blur:5};function jO(e){var r={u_DirectionalLights:new Array(3).fill((0,V.Z)({},ZO)),u_NumOfDirectionalLights:0,u_SpotLights:new Array(3).fill((0,V.Z)({},VO)),u_NumOfSpotLights:0};return(!e||!e.length)&&(e=[zO]),e.forEach(function(t){var n=t.type,i=n===void 0?"directional":n,o=(0,ka.Z)(t,UO),s=$b[i].lights,l=$b[i].num,f=r[l];r[s][f]=(0,V.Z)((0,V.Z)({},r[s][f]),o),r[l]++}),r}var HO=(Gb=(0,yt.b2)(),Gb(Xb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t){t.hooks.beforeRender.tap("LightingPlugin",function(){var n=t.getLayerConfig(),i=n.enableLighting;i&&t.models.forEach(function(o){return o.addUniforms((0,V.Z)({},jO()))})})}}]),e}())||Xb),Yb,qb,WO=(Yb=(0,yt.b2)(),Yb(qb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t,n){var i=this,o=n.rendererService,s=n.postProcessingPassFactory,l=n.normalPassFactory;t.hooks.init.tapPromise("MultiPassRendererPlugin",function(){var f=t.getLayerConfig(),v=f.enableMultiPassRenderer,y=f.passes,b=y===void 0?[]:y;i.enabled=!!v&&t.getLayerConfig().enableMultiPassRenderer!==!1,i.enabled&&(t.multiPassRenderer=a1(t,b,s,l),t.multiPassRenderer.setRenderFlag(!0))}),t.hooks.beforeRender.tap("MultiPassRendererPlugin",function(){if(i.enabled){var f=o.getViewportSize(),v=f.width,y=f.height;t.multiPassRenderer.resize(v,y)}})}}]),e}())||qb),Kb,Qb,_v={NONE:0,ENCODE:1,HIGHLIGHT:2},GO=(Kb=(0,yt.b2)(),Kb(Qb=function(){function e(){(0,Q.Z)(this,e),(0,B.Z)(this,"PickOption",{u_HighlightColor:[1,0,0,1],u_SelectColor:[1,0,0,1],u_PickingColor:[0,0,0],u_PickingStage:0,u_CurrentSelectedId:[0,0,0],u_PickingThreshold:10,u_PickingBuffer:0,u_shaderPick:0,u_EnableSelect:0,u_activeMix:0})}return(0,j.Z)(e,[{key:"pickOption2Array",value:function(){return Object.values(this.PickOption).flat()}},{key:"updatePickOption",value:function(t,n){var i=this;Object.keys(t).forEach(function(o){i.PickOption[o]=t[o]}),n.uniformBuffers[1].subData({offset:0,data:new Uint8Array(new Float32Array(this.pickOption2Array()))})}},{key:"apply",value:function(t,n){var i=this,o=n.rendererService,s=n.styleAttributeService;if(!o.uniformBuffers[1]){var l=o.createBuffer({data:new Float32Array(this.pickOption2Array().length),isUBO:!0});o.uniformBuffers[1]=l,this.updatePickOption({},o)}t.hooks.init.tapPromise("PixelPickingPlugin",function(){var f=t.getLayerConfig(),v=f.enablePicking;s.registerStyleAttribute({name:"pickingColor",type:dn.Attribute,descriptor:{name:"a_PickingColor",shaderLocation:Ms.PICKING_COLOR,buffer:{data:[],type:R.FLOAT},size:3,update:function(b){var T=b.id;return v?sa(T):[0,0,0]}}})}),t.hooks.beforePickingEncode.tap("PixelPickingPlugin",function(){var f=t.getLayerConfig(),v=f.enablePicking;v&&t.isVisible()&&(i.updatePickOption({u_PickingStage:_v.ENCODE},o),t.models.forEach(function(y){return y.addUniforms({u_PickingStage:_v.ENCODE})}))}),t.hooks.afterPickingEncode.tap("PixelPickingPlugin",function(){var f=t.getLayerConfig(),v=f.enablePicking;v&&t.isVisible()&&(i.updatePickOption({u_PickingStage:_v.HIGHLIGHT},o),t.models.forEach(function(y){return y.addUniforms({u_PickingStage:_v.HIGHLIGHT})}))}),t.hooks.beforeHighlight.tap("PixelPickingPlugin",function(f){var v=t.getLayerConfig(),y=v.highlightColor,b=v.activeMix,T=b===void 0?0:b,M=typeof y=="string"?fi(y):y||[1,0,0,1];t.updateLayerConfig({pickedFeatureID:Oa(new Uint8Array(f))});var O={u_PickingStage:_v.HIGHLIGHT,u_PickingColor:f,u_HighlightColor:M.map(function(F){return F*255}),u_activeMix:T};i.updatePickOption(O,o),t.models.forEach(function(F){return F.addUniforms(O)})}),t.hooks.beforeSelect.tap("PixelPickingPlugin",function(f){var v=t.getLayerConfig(),y=v.selectColor,b=v.selectMix,T=b===void 0?0:b,M=typeof y=="string"?fi(y):y||[1,0,0,1];t.updateLayerConfig({pickedFeatureID:Oa(new Uint8Array(f))});var O={u_PickingStage:_v.HIGHLIGHT,u_PickingColor:f,u_HighlightColor:M.map(function(F){return F*255}),u_activeMix:T,u_CurrentSelectedId:f,u_SelectColor:M.map(function(F){return F*255}),u_EnableSelect:1};console.log(O),i.updatePickOption(O,o),t.models.forEach(function(F){return F.addUniforms(O)})})}}]),e}())||Qb),XO=["mvt","geojsonvt","testTile"];function $O(e){var r=e.getSource();return XO.includes(r.parser.type)}function pN(e){return e.getContext?{width:e.width/DOM.DPR,height:e.height/DOM.DPR}:e.getBoundingClientRect()}var Jb,eE,YO=(Jb=(0,yt.b2)(),Jb(eE=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t,n){var i=this,o=n.styleAttributeService;t.hooks.init.tapPromise("RegisterStyleAttributePlugin",function(){$O(t)||i.registerBuiltinAttributes(o,t)})}},{key:"registerBuiltinAttributes",value:function(t,n){if(n.type==="MaskLayer"){this.registerPositionAttribute(t);return}this.registerPositionAttribute(t),this.registerColorAttribute(t),this.registerVertexIdAttribute(t)}},{key:"registerPositionAttribute",value:function(t){t.registerStyleAttribute({name:"position",type:dn.Attribute,descriptor:{name:"a_Position",shaderLocation:Ms.POSITION,buffer:{data:[],type:R.FLOAT},size:3,update:function(i,o,s){return s.length===2?[s[0],s[1],0]:[s[0],s[1],s[2]]}}})}},{key:"registerColorAttribute",value:function(t){t.registerStyleAttribute({name:"color",type:dn.Attribute,descriptor:{name:"a_Color",shaderLocation:Ms.COLOR,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:4,update:function(i){var o=i.color;return!o||!o.length?[1,1,1,1]:o}}})}},{key:"registerVertexIdAttribute",value:function(t){t.registerStyleAttribute({name:"vertexId",type:dn.Attribute,descriptor:{name:"a_vertexId",shaderLocation:Ms.VERTEX_ID,buffer:{usage:R.DYNAMIC_DRAW,data:[],type:R.FLOAT},size:1,update:function(i,o){return[o]}}})}}]),e}())||eE),tE,rE,nE,iE,aE,oE,sE,bd,uE,lE,cE,fE,hE,qO=(tE=(0,yt.b2)(),rE=(0,yt.f3)(ot.ICameraService),nE=(0,yt.f3)(ot.ICoordinateSystemService),iE=(0,yt.f3)(ot.IRendererService),aE=(0,yt.f3)(ot.IMapService),oE=(0,yt.f3)(ot.ILayerService),tE(sE=(bd=function(){function e(){(0,Q.Z)(this,e),Ni(this,"cameraService",uE,this),Ni(this,"coordinateSystemService",lE,this),Ni(this,"rendererService",cE,this),Ni(this,"mapService",fE,this),Ni(this,"layerService",hE,this)}return(0,j.Z)(e,[{key:"apply",value:function(t){var n=this,i=this.mapService.version,o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],s=[0,0],l;this.rendererService.uniformBuffers[0]||(l=this.rendererService.createBuffer({data:new Float32Array(16*5+4*6+4),isUBO:!0}),this.rendererService.uniformBuffers[0]=l),t.hooks.beforeRender.tap("ShaderUniformPlugin",function(){var f=t.getLayerConfig().tileOrigin;n.coordinateSystemService.refresh(f),i==="GAODE2.x"&&(n.setLayerCenter(t),o=n.mapService.map.customCoords.getMVPMatrix(),s=n.mapService.getCustomCoordCenter());var v=n.rendererService.getViewportSize(),y=v.width,b=v.height,T=n.generateUBO(o,s,y,b),M=T.data,O=T.uniforms;n.layerService.alreadyInRendering&&l&&l.subData({offset:0,data:M}),t.models.forEach(function(F){F.addUniforms((0,V.Z)((0,V.Z)({},O),{},{u_PickingBuffer:t.getLayerConfig().pickingBuffer||0,u_shaderPick:Number(t.getShaderPickStat())}))})})}},{key:"setLayerCenter",value:function(t){t.coordCenter===void 0&&(t.coordCenter=t.getSource().center),this.mapService.setCoordCenter&&this.mapService.setCoordCenter(t.coordCenter)}},{key:"generateUBO",value:function(t,n,i,o){var s,l=this.cameraService.getProjectionMatrix(),f=this.cameraService.getViewMatrix(),v=this.cameraService.getViewProjectionMatrix(),y=this.cameraService.getModelMatrix(),b=this.coordinateSystemService.getViewportCenterProjection(),T=this.coordinateSystemService.getPixelsPerDegree(),M=this.cameraService.getZoom(),O=this.coordinateSystemService.getPixelsPerDegree2(),F=this.cameraService.getZoomScale(),$=this.coordinateSystemService.getPixelsPerMeter(),G=this.coordinateSystemService.getCoordinateSystem(),ue=this.cameraService.getCameraPosition(),xe=window.devicePixelRatio,ze=this.coordinateSystemService.getViewportCenter(),Je=[i,o],ht=this.cameraService.getFocalDistance(),gt=[].concat((0,Kt.Z)(f),(0,Kt.Z)(l),(0,Kt.Z)(v),(0,Kt.Z)(y),(0,Kt.Z)(t),(0,Kt.Z)(b),(0,Kt.Z)(T),[M],(0,Kt.Z)(O),[F],(0,Kt.Z)($),[G],(0,Kt.Z)(ue),[xe],(0,Kt.Z)(ze),Je,(0,Kt.Z)(n),[ht,0]);return{data:gt,uniforms:(s={},(0,B.Z)(s,vd.ProjectionMatrix,l),(0,B.Z)(s,vd.ViewMatrix,f),(0,B.Z)(s,vd.ViewProjectionMatrix,v),(0,B.Z)(s,vd.Zoom,M),(0,B.Z)(s,vd.ZoomScale,F),(0,B.Z)(s,vd.FocalDistance,ht),(0,B.Z)(s,vd.CameraPosition,ue),(0,B.Z)(s,Kf.CoordinateSystem,G),(0,B.Z)(s,Kf.ViewportCenter,ze),(0,B.Z)(s,Kf.ViewportCenterProjection,b),(0,B.Z)(s,Kf.PixelsPerDegree,T),(0,B.Z)(s,Kf.PixelsPerDegree2,O),(0,B.Z)(s,Kf.PixelsPerMeter,$),(0,B.Z)(s,Kf.Mvp,t),(0,B.Z)(s,"u_sceneCenterMercator",n),(0,B.Z)(s,"u_ViewportSize",Je),(0,B.Z)(s,"u_ModelMatrix",y),(0,B.Z)(s,"u_DevicePixelRatio",xe),s)}}}]),e}(),uE=ki(bd.prototype,"cameraService",[rE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lE=ki(bd.prototype,"coordinateSystemService",[nE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),cE=ki(bd.prototype,"rendererService",[iE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fE=ki(bd.prototype,"mapService",[aE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hE=ki(bd.prototype,"layerService",[oE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bd))||sE),pE,dE,KO=(pE=(0,yt.b2)(),pE(dE=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t){t.hooks.beforeRender.tap("UpdateModelPlugin",function(){t.layerModel&&t.layerModel.needUpdate().then(function(n){n&&t.renderLayers()})}),t.hooks.afterRender.tap("UpdateModelPlugin",function(){t.layerModelNeedUpdate=!1})}}]),e}())||dE),vE,mE,QO=(vE=(0,yt.b2)(),vE(mE=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t,n){var i=this,o=n.styleAttributeService;t.hooks.init.tapPromise("UpdateStyleAttributePlugin",function(){i.initStyleAttribute(t,{styleAttributeService:o})}),t.hooks.beforeRender.tap("UpdateStyleAttributePlugin",function(){t.layerModelNeedUpdate||t.inited&&i.updateStyleAttribute(t,{styleAttributeService:o})})}},{key:"updateStyleAttribute",value:function(t,n){var i=n.styleAttributeService,o=i.getLayerStyleAttributes()||[],s=i.getLayerStyleAttribute("filter");if(s&&s.needRegenerateVertices){t.layerModelNeedUpdate=!0,o.forEach(function(l){return l.needRegenerateVertices=!1});return}o.filter(function(l){return l.needRegenerateVertices}).forEach(function(l){i.updateAttributeByFeatureRange(l.name,t.getEncodedData(),l.featureRange.startIndex,l.featureRange.endIndex,t),l.needRegenerateVertices=!1})}},{key:"initStyleAttribute",value:function(t,n){var i=n.styleAttributeService,o=i.getLayerStyleAttributes()||[];o.filter(function(s){return s.needRegenerateVertices}).forEach(function(s){i.updateAttributeByFeatureRange(s.name,t.getEncodedData(),s.featureRange.startIndex,s.featureRange.endIndex),s.needRegenerateVertices=!1})}}]),e}())||mE);jl.bind(ot.ILayerPlugin).to(CI).inRequestScope(),jl.bind(ot.ILayerPlugin).to(YO).inRequestScope(),jl.bind(ot.ILayerPlugin).to(Q5).inRequestScope(),jl.bind(ot.ILayerPlugin).to(wI).inRequestScope(),jl.bind(ot.ILayerPlugin).to(NO).inRequestScope(),jl.bind(ot.ILayerPlugin).to(eO).inRequestScope(),jl.bind(ot.ILayerPlugin).to(QO).inRequestScope(),jl.bind(ot.ILayerPlugin).to(KO).inRequestScope(),jl.bind(ot.ILayerPlugin).to(WO).inRequestScope(),jl.bind(ot.ILayerPlugin).to(qO).inRequestScope(),jl.bind(ot.ILayerPlugin).to(J5).inRequestScope(),jl.bind(ot.ILayerPlugin).to(HO).inRequestScope(),jl.bind(ot.ILayerPlugin).to(GO).inRequestScope(),jl.bind(ot.ILayerPlugin).to(LO).inRequestScope();var JO=L(63663),e4=L.n(JO),t4=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.buffer,i=t.offset,o=t.stride,s=t.normalized,l=t.size,f=t.divisor;this.buffer=n,this.attribute={buffer:n.get(),offset:i||0,stride:o||0,normalized:s||!1,divisor:f||0},l&&(this.attribute.size=l)}return(0,j.Z)(e,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),e}(),Gh,Cm,Fp,Kc,Rm,kp,Mm,$g,sh,Ed,Au,uh,lh,Yg,r4=(Gh={},(0,B.Z)(Gh,R.POINTS,"points"),(0,B.Z)(Gh,R.LINES,"lines"),(0,B.Z)(Gh,R.LINE_LOOP,"line loop"),(0,B.Z)(Gh,R.LINE_STRIP,"line strip"),(0,B.Z)(Gh,R.TRIANGLES,"triangles"),(0,B.Z)(Gh,R.TRIANGLE_FAN,"triangle fan"),(0,B.Z)(Gh,R.TRIANGLE_STRIP,"triangle strip"),Gh),gE=(Cm={},(0,B.Z)(Cm,R.STATIC_DRAW,"static"),(0,B.Z)(Cm,R.DYNAMIC_DRAW,"dynamic"),(0,B.Z)(Cm,R.STREAM_DRAW,"stream"),Cm),S_=(Fp={},(0,B.Z)(Fp,R.BYTE,"int8"),(0,B.Z)(Fp,R.INT,"int32"),(0,B.Z)(Fp,R.UNSIGNED_BYTE,"uint8"),(0,B.Z)(Fp,R.UNSIGNED_SHORT,"uint16"),(0,B.Z)(Fp,R.UNSIGNED_INT,"uint32"),(0,B.Z)(Fp,R.FLOAT,"float"),Fp),n4=(Kc={},(0,B.Z)(Kc,R.ALPHA,"alpha"),(0,B.Z)(Kc,R.LUMINANCE,"luminance"),(0,B.Z)(Kc,R.LUMINANCE_ALPHA,"luminance alpha"),(0,B.Z)(Kc,R.RGB,"rgb"),(0,B.Z)(Kc,R.RGBA,"rgba"),(0,B.Z)(Kc,R.RGBA4,"rgba4"),(0,B.Z)(Kc,R.RGB5_A1,"rgb5 a1"),(0,B.Z)(Kc,R.RGB565,"rgb565"),(0,B.Z)(Kc,R.DEPTH_COMPONENT,"depth"),(0,B.Z)(Kc,R.DEPTH_STENCIL,"depth stencil"),Kc),i4=(Rm={},(0,B.Z)(Rm,R.DONT_CARE,"dont care"),(0,B.Z)(Rm,R.NICEST,"nice"),(0,B.Z)(Rm,R.FASTEST,"fast"),Rm),_E=(kp={},(0,B.Z)(kp,R.NEAREST,"nearest"),(0,B.Z)(kp,R.LINEAR,"linear"),(0,B.Z)(kp,R.LINEAR_MIPMAP_LINEAR,"mipmap"),(0,B.Z)(kp,R.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),(0,B.Z)(kp,R.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),(0,B.Z)(kp,R.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),kp),yE=(Mm={},(0,B.Z)(Mm,R.REPEAT,"repeat"),(0,B.Z)(Mm,R.CLAMP_TO_EDGE,"clamp"),(0,B.Z)(Mm,R.MIRRORED_REPEAT,"mirror"),Mm),a4=($g={},(0,B.Z)($g,R.NONE,"none"),(0,B.Z)($g,R.BROWSER_DEFAULT_WEBGL,"browser"),$g),o4=(sh={},(0,B.Z)(sh,R.NEVER,"never"),(0,B.Z)(sh,R.ALWAYS,"always"),(0,B.Z)(sh,R.LESS,"less"),(0,B.Z)(sh,R.LEQUAL,"lequal"),(0,B.Z)(sh,R.GREATER,"greater"),(0,B.Z)(sh,R.GEQUAL,"gequal"),(0,B.Z)(sh,R.EQUAL,"equal"),(0,B.Z)(sh,R.NOTEQUAL,"notequal"),sh),xE=(Ed={},(0,B.Z)(Ed,R.FUNC_ADD,"add"),(0,B.Z)(Ed,R.MIN_EXT,"min"),(0,B.Z)(Ed,R.MAX_EXT,"max"),(0,B.Z)(Ed,R.FUNC_SUBTRACT,"subtract"),(0,B.Z)(Ed,R.FUNC_REVERSE_SUBTRACT,"reverse subtract"),Ed),qg=(Au={},(0,B.Z)(Au,R.ZERO,"zero"),(0,B.Z)(Au,R.ONE,"one"),(0,B.Z)(Au,R.SRC_COLOR,"src color"),(0,B.Z)(Au,R.ONE_MINUS_SRC_COLOR,"one minus src color"),(0,B.Z)(Au,R.SRC_ALPHA,"src alpha"),(0,B.Z)(Au,R.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),(0,B.Z)(Au,R.DST_COLOR,"dst color"),(0,B.Z)(Au,R.ONE_MINUS_DST_COLOR,"one minus dst color"),(0,B.Z)(Au,R.DST_ALPHA,"dst alpha"),(0,B.Z)(Au,R.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),(0,B.Z)(Au,R.CONSTANT_COLOR,"constant color"),(0,B.Z)(Au,R.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),(0,B.Z)(Au,R.CONSTANT_ALPHA,"constant alpha"),(0,B.Z)(Au,R.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),(0,B.Z)(Au,R.SRC_ALPHA_SATURATE,"src alpha saturate"),Au),s4=(uh={},(0,B.Z)(uh,R.NEVER,"never"),(0,B.Z)(uh,R.ALWAYS,"always"),(0,B.Z)(uh,R.LESS,"less"),(0,B.Z)(uh,R.LEQUAL,"lequal"),(0,B.Z)(uh,R.GREATER,"greater"),(0,B.Z)(uh,R.GEQUAL,"gequal"),(0,B.Z)(uh,R.EQUAL,"equal"),(0,B.Z)(uh,R.NOTEQUAL,"notequal"),uh),yv=(lh={},(0,B.Z)(lh,R.ZERO,"zero"),(0,B.Z)(lh,R.KEEP,"keep"),(0,B.Z)(lh,R.REPLACE,"replace"),(0,B.Z)(lh,R.INVERT,"invert"),(0,B.Z)(lh,R.INCR,"increment"),(0,B.Z)(lh,R.DECR,"decrement"),(0,B.Z)(lh,R.INCR_WRAP,"increment wrap"),(0,B.Z)(lh,R.DECR_WRAP,"decrement wrap"),lh),u4=(Yg={},(0,B.Z)(Yg,R.FRONT,"front"),(0,B.Z)(Yg,R.BACK,"back"),Yg),l4=function(){function e(r,t){(0,Q.Z)(this,e),(0,B.Z)(this,"isDestroyed",!1);var n=t.data,i=t.usage,o=t.type;this.buffer=r.buffer({data:n,usage:gE[i||R.STATIC_DRAW],type:S_[o||R.UNSIGNED_BYTE]})}return(0,j.Z)(e,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.isDestroyed||this.buffer.destroy(),this.isDestroyed=!0}},{key:"subData",value:function(t){var n=t.data,i=t.offset;this.buffer.subdata(n,i)}}]),e}(),c4=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.data,i=t.usage,o=t.type,s=t.count;this.elements=r.elements({data:n,usage:gE[i||R.STATIC_DRAW],type:S_[o||R.UNSIGNED_BYTE],count:s})}return(0,j.Z)(e,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var n=t.data;this.elements.subdata(n)}},{key:"destroy",value:function(){}}]),e}(),f4=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.width,i=t.height,o=t.color,s=t.colors,l={width:n,height:i};Array.isArray(s)&&(l.colors=s.map(function(f){return f.get()})),o&&typeof o!="boolean"&&(l.color=o.get()),this.framebuffer=r.framebuffer(l)}return(0,j.Z)(e,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var n=t.width,i=t.height;this.framebuffer.resize(n,i)}}]),e}(),xv=L(72909),Bp=L(63385),h4=L(58046),Mn=L(21769),bE=L(69687),We;(function(e){e[e.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",e[e.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",e[e.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.FUNC_ADD=32774]="FUNC_ADD",e[e.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",e[e.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",e[e.BLEND_EQUATION=32777]="BLEND_EQUATION",e[e.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",e[e.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",e[e.BLEND_DST_RGB=32968]="BLEND_DST_RGB",e[e.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",e[e.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",e[e.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",e[e.BLEND_COLOR=32773]="BLEND_COLOR",e[e.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",e[e.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",e[e.LINE_WIDTH=2849]="LINE_WIDTH",e[e.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",e[e.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",e[e.CULL_FACE_MODE=2885]="CULL_FACE_MODE",e[e.FRONT_FACE=2886]="FRONT_FACE",e[e.DEPTH_RANGE=2928]="DEPTH_RANGE",e[e.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",e[e.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",e[e.DEPTH_FUNC=2932]="DEPTH_FUNC",e[e.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",e[e.STENCIL_FUNC=2962]="STENCIL_FUNC",e[e.STENCIL_FAIL=2964]="STENCIL_FAIL",e[e.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",e[e.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",e[e.STENCIL_REF=2967]="STENCIL_REF",e[e.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",e[e.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",e[e.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",e[e.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",e[e.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",e[e.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",e[e.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",e[e.VIEWPORT=2978]="VIEWPORT",e[e.SCISSOR_BOX=3088]="SCISSOR_BOX",e[e.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",e[e.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",e[e.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",e[e.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",e[e.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",e[e.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",e[e.RED_BITS=3410]="RED_BITS",e[e.GREEN_BITS=3411]="GREEN_BITS",e[e.BLUE_BITS=3412]="BLUE_BITS",e[e.ALPHA_BITS=3413]="ALPHA_BITS",e[e.DEPTH_BITS=3414]="DEPTH_BITS",e[e.STENCIL_BITS=3415]="STENCIL_BITS",e[e.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",e[e.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",e[e.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",e[e.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",e[e.SAMPLES=32937]="SAMPLES",e[e.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",e[e.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",e[e.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",e[e.VENDOR=7936]="VENDOR",e[e.RENDERER=7937]="RENDERER",e[e.VERSION=7938]="VERSION",e[e.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",e[e.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",e[e.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.BUFFER_SIZE=34660]="BUFFER_SIZE",e[e.BUFFER_USAGE=34661]="BUFFER_USAGE",e[e.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",e[e.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",e[e.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",e[e.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",e[e.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",e[e.CULL_FACE=2884]="CULL_FACE",e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK",e[e.BLEND=3042]="BLEND",e[e.DEPTH_TEST=2929]="DEPTH_TEST",e[e.DITHER=3024]="DITHER",e[e.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",e[e.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",e[e.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",e[e.SCISSOR_TEST=3089]="SCISSOR_TEST",e[e.STENCIL_TEST=2960]="STENCIL_TEST",e[e.NO_ERROR=0]="NO_ERROR",e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",e[e.CW=2304]="CW",e[e.CCW=2305]="CCW",e[e.DONT_CARE=4352]="DONT_CARE",e[e.FASTEST=4353]="FASTEST",e[e.NICEST=4354]="NICEST",e[e.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.DOUBLE=5130]="DOUBLE",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER",e[e.COMPILE_STATUS=35713]="COMPILE_STATUS",e[e.DELETE_STATUS=35712]="DELETE_STATUS",e[e.LINK_STATUS=35714]="LINK_STATUS",e[e.VALIDATE_STATUS=35715]="VALIDATE_STATUS",e[e.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",e[e.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",e[e.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",e[e.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",e[e.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",e[e.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",e[e.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",e[e.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",e[e.SHADER_TYPE=35663]="SHADER_TYPE",e[e.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",e[e.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",e[e.NEVER=512]="NEVER",e[e.ALWAYS=519]="ALWAYS",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.GEQUAL=518]="GEQUAL",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP",e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",e[e.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",e[e.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",e[e.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",e[e.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE=5890]="TEXTURE",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",e[e.TEXTURE0=33984]="TEXTURE0",e[e.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",e[e.REPEAT=10497]="REPEAT",e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",e[e.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.LOW_FLOAT=36336]="LOW_FLOAT",e[e.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",e[e.HIGH_FLOAT=36338]="HIGH_FLOAT",e[e.LOW_INT=36339]="LOW_INT",e[e.MEDIUM_INT=36340]="MEDIUM_INT",e[e.HIGH_INT=36341]="HIGH_INT",e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.RENDERBUFFER=36161]="RENDERBUFFER",e[e.RGBA4=32854]="RGBA4",e[e.RGB5_A1=32855]="RGB5_A1",e[e.RGB565=36194]="RGB565",e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.STENCIL_INDEX=6401]="STENCIL_INDEX",e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e[e.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",e[e.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",e[e.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",e[e.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",e[e.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",e[e.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",e[e.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",e[e.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",e[e.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",e[e.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",e[e.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",e[e.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",e[e.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",e[e.NONE=0]="NONE",e[e.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",e[e.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",e[e.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",e[e.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",e[e.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",e[e.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",e[e.READ_BUFFER=3074]="READ_BUFFER",e[e.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",e[e.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",e[e.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",e[e.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",e[e.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",e[e.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",e[e.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",e[e.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",e[e.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",e[e.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",e[e.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",e[e.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",e[e.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",e[e.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",e[e.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",e[e.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",e[e.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",e[e.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",e[e.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",e[e.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",e[e.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",e[e.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",e[e.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",e[e.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",e[e.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",e[e.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",e[e.RED=6403]="RED",e[e.RGB8=32849]="RGB8",e[e.RGBA8=32856]="RGBA8",e[e.RGB10_A2=32857]="RGB10_A2",e[e.TEXTURE_3D=32879]="TEXTURE_3D",e[e.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",e[e.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",e[e.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",e[e.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",e[e.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",e[e.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",e[e.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",e[e.SRGB=35904]="SRGB",e[e.SRGB8=35905]="SRGB8",e[e.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",e[e.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",e[e.RGBA32F=34836]="RGBA32F",e[e.RGB32F=34837]="RGB32F",e[e.RGBA16F=34842]="RGBA16F",e[e.RGB16F=34843]="RGB16F",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",e[e.R11F_G11F_B10F=35898]="R11F_G11F_B10F",e[e.RGB9_E5=35901]="RGB9_E5",e[e.RGBA32UI=36208]="RGBA32UI",e[e.RGB32UI=36209]="RGB32UI",e[e.RGBA16UI=36214]="RGBA16UI",e[e.RGB16UI=36215]="RGB16UI",e[e.RGBA8UI=36220]="RGBA8UI",e[e.RGB8UI=36221]="RGB8UI",e[e.RGBA32I=36226]="RGBA32I",e[e.RGB32I=36227]="RGB32I",e[e.RGBA16I=36232]="RGBA16I",e[e.RGB16I=36233]="RGB16I",e[e.RGBA8I=36238]="RGBA8I",e[e.RGB8I=36239]="RGB8I",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.R8=33321]="R8",e[e.RG8=33323]="RG8",e[e.R16F=33325]="R16F",e[e.R32F=33326]="R32F",e[e.RG16F=33327]="RG16F",e[e.RG32F=33328]="RG32F",e[e.R8I=33329]="R8I",e[e.R8UI=33330]="R8UI",e[e.R16I=33331]="R16I",e[e.R16UI=33332]="R16UI",e[e.R32I=33333]="R32I",e[e.R32UI=33334]="R32UI",e[e.RG8I=33335]="RG8I",e[e.RG8UI=33336]="RG8UI",e[e.RG16I=33337]="RG16I",e[e.RG16UI=33338]="RG16UI",e[e.RG32I=33339]="RG32I",e[e.RG32UI=33340]="RG32UI",e[e.R8_SNORM=36756]="R8_SNORM",e[e.RG8_SNORM=36757]="RG8_SNORM",e[e.RGB8_SNORM=36758]="RGB8_SNORM",e[e.RGBA8_SNORM=36759]="RGBA8_SNORM",e[e.RGB10_A2UI=36975]="RGB10_A2UI",e[e.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",e[e.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.HALF_FLOAT=5131]="HALF_FLOAT",e[e.RG=33319]="RG",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",e[e.CURRENT_QUERY=34917]="CURRENT_QUERY",e[e.QUERY_RESULT=34918]="QUERY_RESULT",e[e.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",e[e.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",e[e.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",e[e.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",e[e.DRAW_BUFFER0=34853]="DRAW_BUFFER0",e[e.DRAW_BUFFER1=34854]="DRAW_BUFFER1",e[e.DRAW_BUFFER2=34855]="DRAW_BUFFER2",e[e.DRAW_BUFFER3=34856]="DRAW_BUFFER3",e[e.DRAW_BUFFER4=34857]="DRAW_BUFFER4",e[e.DRAW_BUFFER5=34858]="DRAW_BUFFER5",e[e.DRAW_BUFFER6=34859]="DRAW_BUFFER6",e[e.DRAW_BUFFER7=34860]="DRAW_BUFFER7",e[e.DRAW_BUFFER8=34861]="DRAW_BUFFER8",e[e.DRAW_BUFFER9=34862]="DRAW_BUFFER9",e[e.DRAW_BUFFER10=34863]="DRAW_BUFFER10",e[e.DRAW_BUFFER11=34864]="DRAW_BUFFER11",e[e.DRAW_BUFFER12=34865]="DRAW_BUFFER12",e[e.DRAW_BUFFER13=34866]="DRAW_BUFFER13",e[e.DRAW_BUFFER14=34867]="DRAW_BUFFER14",e[e.DRAW_BUFFER15=34868]="DRAW_BUFFER15",e[e.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",e[e.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",e[e.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",e[e.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",e[e.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",e[e.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",e[e.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",e[e.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",e[e.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",e[e.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",e[e.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",e[e.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",e[e.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",e[e.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",e[e.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",e[e.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",e[e.SAMPLER_3D=35679]="SAMPLER_3D",e[e.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",e[e.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",e[e.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",e[e.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",e[e.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",e[e.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",e[e.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",e[e.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",e[e.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",e[e.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",e[e.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",e[e.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",e[e.MAX_SAMPLES=36183]="MAX_SAMPLES",e[e.SAMPLER_BINDING=35097]="SAMPLER_BINDING",e[e.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",e[e.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",e[e.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",e[e.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",e[e.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",e[e.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",e[e.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",e[e.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",e[e.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",e[e.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",e[e.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",e[e.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",e[e.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",e[e.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",e[e.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",e[e.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",e[e.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",e[e.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",e[e.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",e[e.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",e[e.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",e[e.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",e[e.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",e[e.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",e[e.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",e[e.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",e[e.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",e[e.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",e[e.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",e[e.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",e[e.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",e[e.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",e[e.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",e[e.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",e[e.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",e[e.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",e[e.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",e[e.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",e[e.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e[e.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",e[e.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",e[e.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",e[e.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",e[e.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",e[e.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",e[e.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",e[e.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",e[e.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",e[e.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",e[e.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",e[e.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",e[e.UNIFORM_TYPE=35383]="UNIFORM_TYPE",e[e.UNIFORM_SIZE=35384]="UNIFORM_SIZE",e[e.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",e[e.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",e[e.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",e[e.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",e[e.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",e[e.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",e[e.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",e[e.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",e[e.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",e[e.OBJECT_TYPE=37138]="OBJECT_TYPE",e[e.SYNC_CONDITION=37139]="SYNC_CONDITION",e[e.SYNC_STATUS=37140]="SYNC_STATUS",e[e.SYNC_FLAGS=37141]="SYNC_FLAGS",e[e.SYNC_FENCE=37142]="SYNC_FENCE",e[e.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",e[e.UNSIGNALED=37144]="UNSIGNALED",e[e.SIGNALED=37145]="SIGNALED",e[e.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",e[e.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",e[e.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",e[e.WAIT_FAILED=37149]="WAIT_FAILED",e[e.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",e[e.COLOR=6144]="COLOR",e[e.DEPTH=6145]="DEPTH",e[e.STENCIL=6146]="STENCIL",e[e.MIN=32775]="MIN",e[e.MAX=32776]="MAX",e[e.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",e[e.STREAM_READ=35041]="STREAM_READ",e[e.STREAM_COPY=35042]="STREAM_COPY",e[e.STATIC_READ=35045]="STATIC_READ",e[e.STATIC_COPY=35046]="STATIC_COPY",e[e.DYNAMIC_READ=35049]="DYNAMIC_READ",e[e.DYNAMIC_COPY=35050]="DYNAMIC_COPY",e[e.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",e[e.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",e[e.INVALID_INDEX=4294967295]="INVALID_INDEX",e[e.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",e[e.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",e[e.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",e[e.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",e[e.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",e[e.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",e[e.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",e[e.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",e[e.UNSIGNED_INT_24_8_WEBGL=34042]="UNSIGNED_INT_24_8_WEBGL",e[e.HALF_FLOAT_OES=36193]="HALF_FLOAT_OES",e[e.RGBA32F_EXT=34836]="RGBA32F_EXT",e[e.RGB32F_EXT=34837]="RGB32F_EXT",e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",e[e.UNSIGNED_NORMALIZED_EXT=35863]="UNSIGNED_NORMALIZED_EXT",e[e.MIN_EXT=32775]="MIN_EXT",e[e.MAX_EXT=32776]="MAX_EXT",e[e.SRGB_EXT=35904]="SRGB_EXT",e[e.SRGB_ALPHA_EXT=35906]="SRGB_ALPHA_EXT",e[e.SRGB8_ALPHA8_EXT=35907]="SRGB8_ALPHA8_EXT",e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",e[e.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT_OES",e[e.COLOR_ATTACHMENT0_WEBGL=36064]="COLOR_ATTACHMENT0_WEBGL",e[e.COLOR_ATTACHMENT1_WEBGL=36065]="COLOR_ATTACHMENT1_WEBGL",e[e.COLOR_ATTACHMENT2_WEBGL=36066]="COLOR_ATTACHMENT2_WEBGL",e[e.COLOR_ATTACHMENT3_WEBGL=36067]="COLOR_ATTACHMENT3_WEBGL",e[e.COLOR_ATTACHMENT4_WEBGL=36068]="COLOR_ATTACHMENT4_WEBGL",e[e.COLOR_ATTACHMENT5_WEBGL=36069]="COLOR_ATTACHMENT5_WEBGL",e[e.COLOR_ATTACHMENT6_WEBGL=36070]="COLOR_ATTACHMENT6_WEBGL",e[e.COLOR_ATTACHMENT7_WEBGL=36071]="COLOR_ATTACHMENT7_WEBGL",e[e.COLOR_ATTACHMENT8_WEBGL=36072]="COLOR_ATTACHMENT8_WEBGL",e[e.COLOR_ATTACHMENT9_WEBGL=36073]="COLOR_ATTACHMENT9_WEBGL",e[e.COLOR_ATTACHMENT10_WEBGL=36074]="COLOR_ATTACHMENT10_WEBGL",e[e.COLOR_ATTACHMENT11_WEBGL=36075]="COLOR_ATTACHMENT11_WEBGL",e[e.COLOR_ATTACHMENT12_WEBGL=36076]="COLOR_ATTACHMENT12_WEBGL",e[e.COLOR_ATTACHMENT13_WEBGL=36077]="COLOR_ATTACHMENT13_WEBGL",e[e.COLOR_ATTACHMENT14_WEBGL=36078]="COLOR_ATTACHMENT14_WEBGL",e[e.COLOR_ATTACHMENT15_WEBGL=36079]="COLOR_ATTACHMENT15_WEBGL",e[e.DRAW_BUFFER0_WEBGL=34853]="DRAW_BUFFER0_WEBGL",e[e.DRAW_BUFFER1_WEBGL=34854]="DRAW_BUFFER1_WEBGL",e[e.DRAW_BUFFER2_WEBGL=34855]="DRAW_BUFFER2_WEBGL",e[e.DRAW_BUFFER3_WEBGL=34856]="DRAW_BUFFER3_WEBGL",e[e.DRAW_BUFFER4_WEBGL=34857]="DRAW_BUFFER4_WEBGL",e[e.DRAW_BUFFER5_WEBGL=34858]="DRAW_BUFFER5_WEBGL",e[e.DRAW_BUFFER6_WEBGL=34859]="DRAW_BUFFER6_WEBGL",e[e.DRAW_BUFFER7_WEBGL=34860]="DRAW_BUFFER7_WEBGL",e[e.DRAW_BUFFER8_WEBGL=34861]="DRAW_BUFFER8_WEBGL",e[e.DRAW_BUFFER9_WEBGL=34862]="DRAW_BUFFER9_WEBGL",e[e.DRAW_BUFFER10_WEBGL=34863]="DRAW_BUFFER10_WEBGL",e[e.DRAW_BUFFER11_WEBGL=34864]="DRAW_BUFFER11_WEBGL",e[e.DRAW_BUFFER12_WEBGL=34865]="DRAW_BUFFER12_WEBGL",e[e.DRAW_BUFFER13_WEBGL=34866]="DRAW_BUFFER13_WEBGL",e[e.DRAW_BUFFER14_WEBGL=34867]="DRAW_BUFFER14_WEBGL",e[e.DRAW_BUFFER15_WEBGL=34868]="DRAW_BUFFER15_WEBGL",e[e.MAX_COLOR_ATTACHMENTS_WEBGL=36063]="MAX_COLOR_ATTACHMENTS_WEBGL",e[e.MAX_DRAW_BUFFERS_WEBGL=34852]="MAX_DRAW_BUFFERS_WEBGL",e[e.VERTEX_ARRAY_BINDING_OES=34229]="VERTEX_ARRAY_BINDING_OES",e[e.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",e[e.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",e[e.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",e[e.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",e[e.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",e[e.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",e[e.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT"})(We||(We={}));var ya;(function(e){e[e.Buffer=0]="Buffer",e[e.Texture=1]="Texture",e[e.RenderTarget=2]="RenderTarget",e[e.Sampler=3]="Sampler",e[e.Program=4]="Program",e[e.Bindings=5]="Bindings",e[e.InputLayout=6]="InputLayout",e[e.RenderPipeline=7]="RenderPipeline",e[e.ComputePipeline=8]="ComputePipeline",e[e.Readback=9]="Readback",e[e.QueryPool=10]="QueryPool"})(ya||(ya={}));var _a;(function(e){e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS"})(_a||(_a={}));var Im;(function(e){e[e.CCW=2305]="CCW",e[e.CW=2304]="CW"})(Im||(Im={}));var Wl;(function(e){e[e.NONE=0]="NONE",e[e.FRONT=1]="FRONT",e[e.BACK=2]="BACK",e[e.FRONT_AND_BACK=3]="FRONT_AND_BACK"})(Wl||(Wl={}));var la;(function(e){e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC=768]="SRC",e[e.ONE_MINUS_SRC=769]="ONE_MINUS_SRC",e[e.DST=774]="DST",e[e.ONE_MINUS_DST=775]="ONE_MINUS_DST",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.CONST=32769]="CONST",e[e.ONE_MINUS_CONSTANT=32770]="ONE_MINUS_CONSTANT",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE"})(la||(la={}));var Tu;(function(e){e[e.ADD=32774]="ADD",e[e.SUBSTRACT=32778]="SUBSTRACT",e[e.REVERSE_SUBSTRACT=32779]="REVERSE_SUBSTRACT",e[e.MIN=32775]="MIN",e[e.MAX=32776]="MAX"})(Tu||(Tu={}));var gl;(function(e){e[e.CLAMP_TO_EDGE=0]="CLAMP_TO_EDGE",e[e.REPEAT=1]="REPEAT",e[e.MIRRORED_REPEAT=2]="MIRRORED_REPEAT"})(gl||(gl={}));var vs;(function(e){e[e.POINT=0]="POINT",e[e.BILINEAR=1]="BILINEAR"})(vs||(vs={}));var Xs;(function(e){e[e.NO_MIP=0]="NO_MIP",e[e.NEAREST=1]="NEAREST",e[e.LINEAR=2]="LINEAR"})(Xs||(Xs={}));var ms;(function(e){e[e.POINTS=0]="POINTS",e[e.TRIANGLES=1]="TRIANGLES",e[e.TRIANGLE_STRIP=2]="TRIANGLE_STRIP",e[e.LINES=3]="LINES",e[e.LINE_STRIP=4]="LINE_STRIP"})(ms||(ms={}));var no;(function(e){e[e.MAP_READ=1]="MAP_READ",e[e.MAP_WRITE=2]="MAP_WRITE",e[e.COPY_SRC=4]="COPY_SRC",e[e.COPY_DST=8]="COPY_DST",e[e.INDEX=16]="INDEX",e[e.VERTEX=32]="VERTEX",e[e.UNIFORM=64]="UNIFORM",e[e.STORAGE=128]="STORAGE",e[e.INDIRECT=256]="INDIRECT",e[e.QUERY_RESOLVE=512]="QUERY_RESOLVE"})(no||(no={}));var Af;(function(e){e[e.STATIC=1]="STATIC",e[e.DYNAMIC=2]="DYNAMIC"})(Af||(Af={}));var Sd;(function(e){e[e.VERTEX=1]="VERTEX",e[e.INSTANCE=2]="INSTANCE"})(Sd||(Sd={}));var EE;(function(e){e.LOADED="loaded"})(EE||(EE={}));var Gi;(function(e){e[e.TEXTURE_2D=0]="TEXTURE_2D",e[e.TEXTURE_2D_ARRAY=1]="TEXTURE_2D_ARRAY",e[e.TEXTURE_3D=2]="TEXTURE_3D",e[e.TEXTURE_CUBE_MAP=3]="TEXTURE_CUBE_MAP"})(Gi||(Gi={}));var Ec;(function(e){e[e.SAMPLED=1]="SAMPLED",e[e.RENDER_TARGET=2]="RENDER_TARGET"})(Ec||(Ec={}));var wu;(function(e){e[e.NONE=0]="NONE",e[e.RED=1]="RED",e[e.GREEN=2]="GREEN",e[e.BLUE=4]="BLUE",e[e.ALPHA=8]="ALPHA",e[e.RGB=7]="RGB",e[e.ALL=15]="ALL"})(wu||(wu={}));var qu;(function(e){e[e.KEEP=7680]="KEEP",e[e.ZERO=0]="ZERO",e[e.REPLACE=7681]="REPLACE",e[e.INVERT=5386]="INVERT",e[e.INCREMENT_CLAMP=7682]="INCREMENT_CLAMP",e[e.DECREMENT_CLAMP=7683]="DECREMENT_CLAMP",e[e.INCREMENT_WRAP=34055]="INCREMENT_WRAP",e[e.DECREMENT_WRAP=34056]="DECREMENT_WRAP"})(qu||(qu={}));function dN(e,r,t,n){var i=Gi.TEXTURE_2D,o=1,s=Ec.SAMPLED;return{dimension:i,format:e,width:r,height:t,depthOrArrayLayers:o,mipLevelCount:n,usage:s}}var zo;(function(e){e[e.Float=0]="Float",e[e.Uint=1]="Uint",e[e.Sint=2]="Sint",e[e.Depth=3]="Depth"})(zo||(zo={}));var bv;(function(e){e[e.LOWER_LEFT=0]="LOWER_LEFT",e[e.UPPER_LEFT=1]="UPPER_LEFT"})(bv||(bv={}));var Ev;(function(e){e[e.NEGATIVE_ONE=0]="NEGATIVE_ONE",e[e.ZERO=1]="ZERO"})(Ev||(Ev={}));var Kg;(function(e){e[e.OcclusionConservative=0]="OcclusionConservative"})(Kg||(Kg={}));var Rr;(function(e){e[e.U8=1]="U8",e[e.U16=2]="U16",e[e.U32=3]="U32",e[e.S8=4]="S8",e[e.S16=5]="S16",e[e.S32=6]="S32",e[e.F16=7]="F16",e[e.F32=8]="F32",e[e.BC1=65]="BC1",e[e.BC2=66]="BC2",e[e.BC3=67]="BC3",e[e.BC4_UNORM=68]="BC4_UNORM",e[e.BC4_SNORM=69]="BC4_SNORM",e[e.BC5_UNORM=70]="BC5_UNORM",e[e.BC5_SNORM=71]="BC5_SNORM",e[e.U16_PACKED_5551=97]="U16_PACKED_5551",e[e.U16_PACKED_565=98]="U16_PACKED_565",e[e.D24=129]="D24",e[e.D32F=130]="D32F",e[e.D24S8=131]="D24S8",e[e.D32FS8=132]="D32FS8"})(Rr||(Rr={}));var Wn;(function(e){e[e.R=1]="R",e[e.RG=2]="RG",e[e.RGB=3]="RGB",e[e.RGBA=4]="RGBA",e[e.A=5]="A"})(Wn||(Wn={}));function vN(e){return e}var wn;(function(e){e[e.None=0]="None",e[e.Normalized=1]="Normalized",e[e.sRGB=2]="sRGB",e[e.Depth=4]="Depth",e[e.Stencil=8]="Stencil",e[e.RenderTarget=16]="RenderTarget",e[e.Luminance=32]="Luminance"})(wn||(wn={}));function li(e,r,t){return e<<16|r<<8|t}var Mt;(function(e){e[e.ALPHA=li(Rr.U8,Wn.A,wn.None)]="ALPHA",e[e.U8_LUMINANCE=li(Rr.U8,Wn.A,wn.Luminance)]="U8_LUMINANCE",e[e.F16_LUMINANCE=li(Rr.F16,Wn.A,wn.Luminance)]="F16_LUMINANCE",e[e.F32_LUMINANCE=li(Rr.F32,Wn.A,wn.Luminance)]="F32_LUMINANCE",e[e.F16_R=li(Rr.F16,Wn.R,wn.None)]="F16_R",e[e.F16_RG=li(Rr.F16,Wn.RG,wn.None)]="F16_RG",e[e.F16_RGB=li(Rr.F16,Wn.RGB,wn.None)]="F16_RGB",e[e.F16_RGBA=li(Rr.F16,Wn.RGBA,wn.None)]="F16_RGBA",e[e.F32_R=li(Rr.F32,Wn.R,wn.None)]="F32_R",e[e.F32_RG=li(Rr.F32,Wn.RG,wn.None)]="F32_RG",e[e.F32_RGB=li(Rr.F32,Wn.RGB,wn.None)]="F32_RGB",e[e.F32_RGBA=li(Rr.F32,Wn.RGBA,wn.None)]="F32_RGBA",e[e.U8_R=li(Rr.U8,Wn.R,wn.None)]="U8_R",e[e.U8_R_NORM=li(Rr.U8,Wn.R,wn.Normalized)]="U8_R_NORM",e[e.U8_RG=li(Rr.U8,Wn.RG,wn.None)]="U8_RG",e[e.U8_RG_NORM=li(Rr.U8,Wn.RG,wn.Normalized)]="U8_RG_NORM",e[e.U8_RGB=li(Rr.U8,Wn.RGB,wn.None)]="U8_RGB",e[e.U8_RGB_NORM=li(Rr.U8,Wn.RGB,wn.Normalized)]="U8_RGB_NORM",e[e.U8_RGB_SRGB=li(Rr.U8,Wn.RGB,wn.sRGB|wn.Normalized)]="U8_RGB_SRGB",e[e.U8_RGBA=li(Rr.U8,Wn.RGBA,wn.None)]="U8_RGBA",e[e.U8_RGBA_NORM=li(Rr.U8,Wn.RGBA,wn.Normalized)]="U8_RGBA_NORM",e[e.U8_RGBA_SRGB=li(Rr.U8,Wn.RGBA,wn.sRGB|wn.Normalized)]="U8_RGBA_SRGB",e[e.U16_R=li(Rr.U16,Wn.R,wn.None)]="U16_R",e[e.U16_R_NORM=li(Rr.U16,Wn.R,wn.Normalized)]="U16_R_NORM",e[e.U16_RG_NORM=li(Rr.U16,Wn.RG,wn.Normalized)]="U16_RG_NORM",e[e.U16_RGBA_NORM=li(Rr.U16,Wn.RGBA,wn.Normalized)]="U16_RGBA_NORM",e[e.U16_RGB=li(Rr.U16,Wn.RGB,wn.None)]="U16_RGB",e[e.U32_R=li(Rr.U32,Wn.R,wn.None)]="U32_R",e[e.U32_RG=li(Rr.U32,Wn.RG,wn.None)]="U32_RG",e[e.S8_R=li(Rr.S8,Wn.R,wn.None)]="S8_R",e[e.S8_R_NORM=li(Rr.S8,Wn.R,wn.Normalized)]="S8_R_NORM",e[e.S8_RG_NORM=li(Rr.S8,Wn.RG,wn.Normalized)]="S8_RG_NORM",e[e.S8_RGB_NORM=li(Rr.S8,Wn.RGB,wn.Normalized)]="S8_RGB_NORM",e[e.S8_RGBA_NORM=li(Rr.S8,Wn.RGBA,wn.Normalized)]="S8_RGBA_NORM",e[e.S16_R=li(Rr.S16,Wn.R,wn.None)]="S16_R",e[e.S16_RG=li(Rr.S16,Wn.RG,wn.None)]="S16_RG",e[e.S16_RG_NORM=li(Rr.S16,Wn.RG,wn.Normalized)]="S16_RG_NORM",e[e.S16_RGB_NORM=li(Rr.S16,Wn.RGB,wn.Normalized)]="S16_RGB_NORM",e[e.S16_RGBA=li(Rr.S16,Wn.RGBA,wn.None)]="S16_RGBA",e[e.S16_RGBA_NORM=li(Rr.S16,Wn.RGBA,wn.Normalized)]="S16_RGBA_NORM",e[e.S32_R=li(Rr.S32,Wn.R,wn.None)]="S32_R",e[e.U16_RGBA_5551=li(Rr.U16_PACKED_5551,Wn.RGBA,wn.Normalized)]="U16_RGBA_5551",e[e.U16_RGB_565=li(Rr.U16_PACKED_565,Wn.RGB,wn.Normalized)]="U16_RGB_565",e[e.BC1=li(Rr.BC1,Wn.RGBA,wn.Normalized)]="BC1",e[e.BC1_SRGB=li(Rr.BC1,Wn.RGBA,wn.Normalized|wn.sRGB)]="BC1_SRGB",e[e.BC2=li(Rr.BC2,Wn.RGBA,wn.Normalized)]="BC2",e[e.BC2_SRGB=li(Rr.BC2,Wn.RGBA,wn.Normalized|wn.sRGB)]="BC2_SRGB",e[e.BC3=li(Rr.BC3,Wn.RGBA,wn.Normalized)]="BC3",e[e.BC3_SRGB=li(Rr.BC3,Wn.RGBA,wn.Normalized|wn.sRGB)]="BC3_SRGB",e[e.BC4_UNORM=li(Rr.BC4_UNORM,Wn.R,wn.Normalized)]="BC4_UNORM",e[e.BC4_SNORM=li(Rr.BC4_SNORM,Wn.R,wn.Normalized)]="BC4_SNORM",e[e.BC5_UNORM=li(Rr.BC5_UNORM,Wn.RG,wn.Normalized)]="BC5_UNORM",e[e.BC5_SNORM=li(Rr.BC5_SNORM,Wn.RG,wn.Normalized)]="BC5_SNORM",e[e.D24=li(Rr.D24,Wn.R,wn.Depth)]="D24",e[e.D24_S8=li(Rr.D24S8,Wn.RG,wn.Depth|wn.Stencil)]="D24_S8",e[e.D32F=li(Rr.D32F,Wn.R,wn.Depth)]="D32F",e[e.D32F_S8=li(Rr.D32FS8,Wn.RG,wn.Depth|wn.Stencil)]="D32F_S8",e[e.U8_RGB_RT=li(Rr.U8,Wn.RGB,wn.RenderTarget|wn.Normalized)]="U8_RGB_RT",e[e.U8_RGBA_RT=li(Rr.U8,Wn.RGBA,wn.RenderTarget|wn.Normalized)]="U8_RGBA_RT",e[e.U8_RGBA_RT_SRGB=li(Rr.U8,Wn.RGBA,wn.RenderTarget|wn.Normalized|wn.sRGB)]="U8_RGBA_RT_SRGB"})(Mt||(Mt={}));function Qg(e){return e>>>8&255}function ch(e){return e>>>16&255}function Sv(e){return e&255}function SE(e){switch(e){case Rr.F32:case Rr.U32:case Rr.S32:return 4;case Rr.U16:case Rr.S16:case Rr.F16:return 2;case Rr.U8:case Rr.S8:return 1;default:throw new Error("whoops")}}function AE(e){return SE(ch(e))}function mN(e){return Qg(e)}function p4(e){var r=SE(ch(e)),t=Qg(e);return r*t}function gN(e,r){return e&4294967040|r}function _N(e,r){return e&4294902015|r<<8}function TE(e){var r=Sv(e);if(r&wn.Depth)return zo.Depth;if(r&wn.Normalized)return zo.Float;var t=ch(e);if(t===Rr.F16||t===Rr.F32)return zo.Float;if(t===Rr.U8||t===Rr.U16||t===Rr.U32)return zo.Uint;if(t===Rr.S8||t===Rr.S16||t===Rr.S32)return zo.Sint;throw new Error("whoops")}function Bi(e,r){if(r===void 0&&(r=""),!e)throw new Error("Assert fail: ".concat(r))}function Ad(e){if(e!=null)return e;throw new Error("Missing object")}function wE(e,r){return e.r===r.r&&e.g===r.g&&e.b===r.b&&e.a===r.a}function CE(e,r){e.r=r.r,e.g=r.g,e.b=r.b,e.a=r.a}function RE(e){var r=e.r,t=e.g,n=e.b,i=e.a;return{r,g:t,b:n,a:i}}function Jg(e,r,t,n){return n===void 0&&(n=1),{r:e,g:r,b:t,a:n}}var A_=Jg(0,0,0,0),yN=Jg(0,0,0,1),d4=Jg(1,1,1,0),xN=Jg(1,1,1,1),Av=!0;function bN(e,r){r===void 0&&(r=Av),r&&(e[10]=-e[10],e[14]=-e[14])}function EN(e,r){r===void 0&&(r=Av),r&&(e[10]=-e[10],e[14]=-e[14]+1)}function v4(e,r){if(r===void 0&&(r=Av),r)switch(e){case _a.LESS:return _a.GREATER;case _a.LEQUAL:return _a.GEQUAL;case _a.GEQUAL:return _a.LEQUAL;case _a.GREATER:return _a.LESS;default:return e}else return e}function SN(e,r){return r===void 0&&(r=Av),r?1-e:e}function AN(e,r){return r===void 0&&(r=Av),r?-e:e}function TN(e,r,t,n){if(n===void 0&&(n=Av),t=v4(t,n),t===_a.LESS)return e<r;if(t===_a.LEQUAL)return e<=r;if(t===_a.GREATER)return e>r;if(t===_a.GEQUAL)return e>=r;throw new Error("whoops")}function e0(e){return!!(e&&!(e&e-1))}function Tv(e,r){return e!=null?e:r}function m4(e){return e===void 0?null:e}function wN(e,r,t){e.length=r,e.fill(t)}function t0(e,r){var t=r-1;return e+t&~t}function CN(e,r){return((e+r-1)/r|0)*r}function g4(e,r,t){for(var n=0,i=e.length;n<i;){var o=n+(i-n>>>1),s=t(r,e[o]);s<0?i=o:n=o+1}return n}function RN(e,r,t){var n=g4(e,r,t);e.splice(n,0,r)}function MN(e,r,t){return t?e|=r:e&=~r,e}function _4(e,r){for(var t=new Array(e),n=0;n<e;n++)t[n]=r();return t}function y4(e,r){r===void 0&&(r=1);var t=e.split(`
|
|
`);return t.map(function(n,i){return"".concat(x4(""+(r+i),4," ")," ").concat(n)}).join(`
|
|
`)}function x4(e,r,t){for(t===void 0&&(t="0");e.length<r;)e="".concat(t).concat(e);return e}function IN(e,r){for(var t=[],n=e;n<e+r;n++)t.push(n);return t}function ME(e,r){e.blendDstFactor=r.blendDstFactor,e.blendSrcFactor=r.blendSrcFactor,e.blendMode=r.blendMode}function r0(e,r){return e===void 0&&(e={}),e.compare=r.compare,e.depthFailOp=r.depthFailOp,e.passOp=r.passOp,e.failOp=r.failOp,e}function IE(e,r){return e===void 0&&(e={rgbBlendState:{},alphaBlendState:{},channelWriteMask:0}),ME(e.rgbBlendState,r.rgbBlendState),ME(e.alphaBlendState,r.alphaBlendState),e.channelWriteMask=r.channelWriteMask,e}function T_(e,r){e.length!==r.length&&(e.length=r.length);for(var t=0;t<r.length;t++)e[t]=IE(e[t],r[t])}function b4(e,r){r.attachmentsState!==void 0&&T_(e.attachmentsState,r.attachmentsState),e.blendConstant&&r.blendConstant&&CE(e.blendConstant,r.blendConstant),e.depthCompare=Tv(r.depthCompare,e.depthCompare),e.depthWrite=Tv(r.depthWrite,e.depthWrite),e.stencilWrite=Tv(r.stencilWrite,e.stencilWrite),e.stencilFront&&r.stencilFront&&r0(e.stencilFront,r.stencilFront),e.stencilBack&&r.stencilBack&&r0(e.stencilBack,r.stencilBack),e.cullMode=Tv(r.cullMode,e.cullMode),e.frontFace=Tv(r.frontFace,e.frontFace),e.polygonOffset=Tv(r.polygonOffset,e.polygonOffset)}function wv(e){var r=Object.assign({},e);return r.attachmentsState=[],T_(r.attachmentsState,e.attachmentsState),r.blendConstant=r.blendConstant&&RE(r.blendConstant),r.stencilFront=r0(void 0,e.stencilFront),r.stencilBack=r0(void 0,e.stencilBack),r}function E4(e,r){r.channelWriteMask!==void 0&&(e.channelWriteMask=r.channelWriteMask),r.rgbBlendMode!==void 0&&(e.rgbBlendState.blendMode=r.rgbBlendMode),r.alphaBlendMode!==void 0&&(e.alphaBlendState.blendMode=r.alphaBlendMode),r.rgbBlendSrcFactor!==void 0&&(e.rgbBlendState.blendSrcFactor=r.rgbBlendSrcFactor),r.alphaBlendSrcFactor!==void 0&&(e.alphaBlendState.blendSrcFactor=r.alphaBlendSrcFactor),r.rgbBlendDstFactor!==void 0&&(e.rgbBlendState.blendDstFactor=r.rgbBlendDstFactor),r.alphaBlendDstFactor!==void 0&&(e.alphaBlendState.blendDstFactor=r.alphaBlendDstFactor)}var PE={blendMode:Tu.ADD,blendSrcFactor:la.ONE,blendDstFactor:la.ZERO},Td={attachmentsState:[{channelWriteMask:wu.ALL,rgbBlendState:PE,alphaBlendState:PE}],blendConstant:RE(A_),depthWrite:!0,depthCompare:_a.LEQUAL,stencilWrite:!1,stencilFront:{compare:_a.ALWAYS,passOp:qu.KEEP,depthFailOp:qu.KEEP,failOp:qu.KEEP},stencilBack:{compare:_a.ALWAYS,passOp:qu.KEEP,depthFailOp:qu.KEEP,failOp:qu.KEEP},cullMode:Wl.NONE,frontFace:Im.CCW,polygonOffset:!1};function S4(e,r){e===void 0&&(e=null),r===void 0&&(r=Td);var t=wv(r);return e!==null&&b4(t,e),t}var PN=S4({depthCompare:_a.ALWAYS,depthWrite:!1},Td);function ON(e,r){return e.attachmentsState===void 0&&(e.attachmentsState=[],T_(e.attachmentsState,Td.attachmentsState)),E4(e.attachmentsState[0],r),e}var OE={texture:null,sampler:null,formatKind:zo.Float,dimension:Gi.TEXTURE_2D};function Cv(e,r,t){if(e.length!==r.length)return!1;for(var n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0}function Pm(e,r){for(var t=Array(e.length),n=0;n<e.length;n++)t[n]=r(e[n]);return t}function A4(e,r){return e.buffer===r.buffer&&e.size===r.size&&e.binding===r.binding&&e.offset===r.offset}function T4(e,r){return e===null?r===null:r===null?!1:e.sampler===r.sampler&&e.texture===r.texture&&e.dimension===r.dimension&&e.formatKind===r.formatKind&&e.comparison===r.comparison}function DN(e,r){return e.samplerBindings=e.samplerBindings||[],e.uniformBufferBindings=e.uniformBufferBindings||[],r.samplerBindings=r.samplerBindings||[],r.uniformBufferBindings=r.uniformBufferBindings||[],!(e.samplerBindings.length!==r.samplerBindings.length||!Cv(e.samplerBindings,r.samplerBindings,T4)||!Cv(e.uniformBufferBindings,r.uniformBufferBindings,A4))}function DE(e,r){return e.blendMode==r.blendMode&&e.blendSrcFactor===r.blendSrcFactor&&e.blendDstFactor===r.blendDstFactor}function w4(e,r){return!(!DE(e.rgbBlendState,r.rgbBlendState)||!DE(e.alphaBlendState,r.alphaBlendState)||e.channelWriteMask!==r.channelWriteMask)}function n0(e,r){return e.compare==r.compare&&e.depthFailOp===r.depthFailOp&&e.failOp===r.failOp&&e.passOp===r.passOp}function C4(e,r){return!Cv(e.attachmentsState,r.attachmentsState,w4)||e.blendConstant&&r.blendConstant&&!wE(e.blendConstant,r.blendConstant)||e.stencilFront&&r.stencilFront&&!n0(e.stencilFront,r.stencilFront)||e.stencilBack&&r.stencilBack&&!n0(e.stencilBack,r.stencilBack)?!1:e.depthCompare===r.depthCompare&&e.depthWrite===r.depthWrite&&e.stencilWrite===r.stencilWrite&&e.cullMode===r.cullMode&&e.frontFace===r.frontFace&&e.polygonOffset===r.polygonOffset}function FE(e,r){return e.id===r.id}function R4(e,r){return e===r}function FN(e,r){return!(e.topology!==r.topology||e.inputLayout!==r.inputLayout||e.sampleCount!==r.sampleCount||e.megaStateDescriptor&&r.megaStateDescriptor&&!C4(e.megaStateDescriptor,r.megaStateDescriptor)||!FE(e.program,r.program)||!Cv(e.colorAttachmentFormats,r.colorAttachmentFormats,R4)||e.depthStencilAttachmentFormat!==r.depthStencilAttachmentFormat)}function M4(e,r){return e.offset===r.offset&&e.shaderLocation===r.shaderLocation&&e.format===r.format&&e.divisor===r.divisor}function I4(e,r){return isNil(e)?isNil(r):isNil(r)?!1:e.arrayStride===r.arrayStride&&e.stepMode===r.stepMode&&Cv(e.attributes,r.attributes,M4)}function kN(e,r){return!(e.indexBufferFormat!==r.indexBufferFormat||!Cv(e.vertexBufferDescriptors,r.vertexBufferDescriptors,I4)||!FE(e.program,r.program))}function BN(e,r){return e.addressModeU===r.addressModeU&&e.addressModeV===r.addressModeV&&e.minFilter===r.minFilter&&e.magFilter===r.magFilter&&e.mipmapFilter===r.mipmapFilter&&e.lodMinClamp===r.lodMinClamp&&e.lodMaxClamp===r.lodMaxClamp&&e.maxAnisotropy===r.maxAnisotropy&&e.compareFunction===r.compareFunction}function P4(e){var r=e.sampler,t=e.texture,n=e.dimension,i=e.formatKind,o=e.comparison;return{sampler:r,texture:t,dimension:n,formatKind:i,comparison:o}}function kE(e){var r=e.buffer,t=e.size,n=e.binding,i=e.offset;return{binding:n,buffer:r,offset:i,size:t}}function LN(e){var r=e.samplerBindings&&Pm(e.samplerBindings,P4),t=e.uniformBufferBindings&&Pm(e.uniformBufferBindings,kE),n=e.storageBufferBindings&&Pm(e.storageBufferBindings,kE);return{samplerBindings:r,uniformBufferBindings:t,storageBufferBindings:n,pipeline:e.pipeline}}function NN(e){var r=e.inputLayout,t=e.program,n=e.topology,i=e.megaStateDescriptor&&wv(e.megaStateDescriptor),o=e.colorAttachmentFormats.slice(),s=e.depthStencilAttachmentFormat,l=e.sampleCount;return{inputLayout:r,megaStateDescriptor:i,program:t,topology:n,colorAttachmentFormats:o,depthStencilAttachmentFormat:s,sampleCount:l}}function O4(e){var r=e.shaderLocation,t=e.format,n=e.offset,i=e.divisor;return{shaderLocation:r,format:t,offset:n,divisor:i}}function D4(e){if(isNil(e))return e;var r=e.arrayStride,t=e.stepMode,n=Pm(e.attributes,O4);return{arrayStride:r,stepMode:t,attributes:n}}function UN(e){var r=Pm(e.vertexBufferDescriptors,D4),t=e.indexBufferFormat,n=e.program;return{vertexBufferDescriptors:r,indexBufferFormat:t,program:n}}var aa,F4=/([^[]*)(\[[0-9]+\])?/;function k4(e){if(e[e.length-1]!=="]")return{name:e,length:1,isArray:!1};var r=e.match(F4);if(!r||r.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(e));return{name:r[1],length:Number(r[2])||1,isArray:!!r[2]}}function _l(){var e=null;return function(r,t,n){var i=e!==n;return i&&(r.uniform1i(t,n),e=n),i}}function Zo(e,r,t,n){var i=null,o=null;return function(s,l,f){var v=r(f,t),y=v.length,b=!1;if(i===null)i=new Float32Array(y),o=y,b=!0;else{Bi(o===y,"Uniform length cannot change.");for(var T=0;T<y;++T)if(v[T]!==i[T]){b=!0;break}}return b&&(n(s,e,l,v),i.set(v)),b}}function Ku(e,r,t,n){e[r](t,n)}function Xh(e,r,t,n){e[r](t,!1,n)}var B4={},L4={},N4={},BE=[0];function w_(e,r,t,n){r===1&&typeof e=="boolean"&&(e=e?1:0),Number.isFinite(e)&&(BE[0]=e,e=BE);var i=e.length;if(e instanceof t)return e;var o=n[i];o||(o=new t(i),n[i]=o);for(var s=0;s<i;s++)o[s]=e[s];return o}function Sc(e,r){return w_(e,r,Float32Array,B4)}function Lp(e,r){return w_(e,r,Int32Array,L4)}function i0(e,r){return w_(e,r,Uint32Array,N4)}var U4=(aa={},aa[We.FLOAT]=Zo.bind(null,"uniform1fv",Sc,1,Ku),aa[We.FLOAT_VEC2]=Zo.bind(null,"uniform2fv",Sc,2,Ku),aa[We.FLOAT_VEC3]=Zo.bind(null,"uniform3fv",Sc,3,Ku),aa[We.FLOAT_VEC4]=Zo.bind(null,"uniform4fv",Sc,4,Ku),aa[We.INT]=Zo.bind(null,"uniform1iv",Lp,1,Ku),aa[We.INT_VEC2]=Zo.bind(null,"uniform2iv",Lp,2,Ku),aa[We.INT_VEC3]=Zo.bind(null,"uniform3iv",Lp,3,Ku),aa[We.INT_VEC4]=Zo.bind(null,"uniform4iv",Lp,4,Ku),aa[We.BOOL]=Zo.bind(null,"uniform1iv",Lp,1,Ku),aa[We.BOOL_VEC2]=Zo.bind(null,"uniform2iv",Lp,2,Ku),aa[We.BOOL_VEC3]=Zo.bind(null,"uniform3iv",Lp,3,Ku),aa[We.BOOL_VEC4]=Zo.bind(null,"uniform4iv",Lp,4,Ku),aa[We.FLOAT_MAT2]=Zo.bind(null,"uniformMatrix2fv",Sc,4,Xh),aa[We.FLOAT_MAT3]=Zo.bind(null,"uniformMatrix3fv",Sc,9,Xh),aa[We.FLOAT_MAT4]=Zo.bind(null,"uniformMatrix4fv",Sc,16,Xh),aa[We.UNSIGNED_INT]=Zo.bind(null,"uniform1uiv",i0,1,Ku),aa[We.UNSIGNED_INT_VEC2]=Zo.bind(null,"uniform2uiv",i0,2,Ku),aa[We.UNSIGNED_INT_VEC3]=Zo.bind(null,"uniform3uiv",i0,3,Ku),aa[We.UNSIGNED_INT_VEC4]=Zo.bind(null,"uniform4uiv",i0,4,Ku),aa[We.FLOAT_MAT2x3]=Zo.bind(null,"uniformMatrix2x3fv",Sc,6,Xh),aa[We.FLOAT_MAT2x4]=Zo.bind(null,"uniformMatrix2x4fv",Sc,8,Xh),aa[We.FLOAT_MAT3x2]=Zo.bind(null,"uniformMatrix3x2fv",Sc,6,Xh),aa[We.FLOAT_MAT3x4]=Zo.bind(null,"uniformMatrix3x4fv",Sc,12,Xh),aa[We.FLOAT_MAT4x2]=Zo.bind(null,"uniformMatrix4x2fv",Sc,8,Xh),aa[We.FLOAT_MAT4x3]=Zo.bind(null,"uniformMatrix4x3fv",Sc,12,Xh),aa[We.SAMPLER_2D]=_l,aa[We.SAMPLER_CUBE]=_l,aa[We.SAMPLER_3D]=_l,aa[We.SAMPLER_2D_SHADOW]=_l,aa[We.SAMPLER_2D_ARRAY]=_l,aa[We.SAMPLER_2D_ARRAY_SHADOW]=_l,aa[We.SAMPLER_CUBE_SHADOW]=_l,aa[We.INT_SAMPLER_2D]=_l,aa[We.INT_SAMPLER_3D]=_l,aa[We.INT_SAMPLER_CUBE]=_l,aa[We.INT_SAMPLER_2D_ARRAY]=_l,aa[We.UNSIGNED_INT_SAMPLER_2D]=_l,aa[We.UNSIGNED_INT_SAMPLER_3D]=_l,aa[We.UNSIGNED_INT_SAMPLER_CUBE]=_l,aa[We.UNSIGNED_INT_SAMPLER_2D_ARRAY]=_l,aa);function LE(e,r,t){var n=U4[t.type];if(!n)throw new Error("Unknown GLSL uniform type ".concat(t.type));return n().bind(null,e,r)}var z4={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121};function Z4(e){return Object.prototype.toString.call(e)in z4}function Om(e,r){return"#define ".concat(e," ").concat(r)}function V4(e){var r={};return e.replace(/^\s*#define\s*(\S*)\s*(\S*)\s*$/gm,function(t,n,i){var o=Number(i);return r[n]=isNaN(o)?i:o,""}),r}function j4(e,r){var t=[];return e.replace(/^\s*layout\(location\s*=\s*(\S*)\)\s*in\s+\S+\s*(.*);$/gm,function(n,i,o){var s=Number(i);return t.push({location:isNaN(s)?r[i]:s,name:o}),""}),t}function zN(e){var r=[],t=[];return e.replace(/\s*struct\s*(.*)\s*{((?:\s*.*\s*)*?)};/g,function(n,i,o){var s=[];return o.trim().replace(`\r
|
|
`,`
|
|
`).split(`
|
|
`).forEach(function(l){var f=__read(l.trim().split(/\s+/),2),v=f[0],y=f[1];s.push({type:v.trim(),name:y.replace(";","").trim()})}),t.push({type:i.trim(),uniforms:s}),""}),e.replace(/\s*uniform(?:\s+)(?:\w+)(?:\s?){([^]*?)};?/g,function(n,i){return i.trim().replace(`\r
|
|
`,`
|
|
`).split(`
|
|
`).forEach(function(o){var s=o.trim().split(" "),l=s[0]||"",f=s[1]||"",v=f.indexOf("[")>-1;if(f=f.replace(";","").replace("[","").trim(),!l.startsWith("#")){if(l){var y=t.find(function(M){return l===M.type});if(y)if(v)for(var b=function(M){y.uniforms.forEach(function(O){r.push("".concat(f,"[").concat(M,"].").concat(O.name))})},T=0;T<5;T++)b(T);else y.uniforms.forEach(function(M){r.push("".concat(f,".").concat(M.name))})}f&&r.push(f)}}),""}),r}function NE(e){if(e===void 0)return null;var r=/binding\s*=\s*(\d+)/.exec(e);if(r!==null){var t=parseInt(r[1],10);if(!Number.isNaN(t))return t}return null}function H4(e){var r="",t=e;return[t,r]}function Np(e,r,t,n,i){var o;n===void 0&&(n=null),i===void 0&&(i=!0);var s=e.glslVersion==="#version 100",l=r==="frag"&&((o=t.match(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm))===null||o===void 0?void 0:o.length)>1,f=t.replace(`\r
|
|
`,`
|
|
`).split(`
|
|
`).map(function(ht){return ht.replace(/[/][/].*$/,"")}).filter(function(ht){var gt=!ht||/^\s+$/.test(ht);return!gt}),v="";n!==null&&(v=Object.keys(n).map(function(ht){return Om(ht,n[ht])}).join(`
|
|
`));var y=f.find(function(ht){return ht.startsWith("precision")})||"precision mediump float;",b=i?f.filter(function(ht){return!ht.startsWith("precision")}).join(`
|
|
`):f.join(`
|
|
`),T="";if(e.viewportOrigin===bv.UPPER_LEFT&&(T+="".concat(Om("VIEWPORT_ORIGIN_TL","1"),`
|
|
`)),e.clipSpaceNearZ===Ev.ZERO&&(T+="".concat(Om("CLIPSPACE_NEAR_ZERO","1"),`
|
|
`)),e.explicitBindingLocations){var M=0,O=0,F=0;b=b.replace(/^(layout\((.*)\))?\s*uniform(.+{)$/gm,function(ht,gt,Ot,tr){var Ir=Ot?"".concat(Ot,", "):"";return"layout(".concat(Ir,"set = ").concat(M,", binding = ").concat(O++,") uniform ").concat(tr)}),M++,O=0,Bi(e.separateSamplerTextures),b=b.replace(/^(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(ht,gt,Ot,tr,Ir){var Er=NE(Ot);Er===null&&(Er=O++);var mn=(0,Mn.CR)(H4(tr),2),Ln=mn[0],Fi=mn[1];return r==="frag"?`
|
|
layout(set = `.concat(M,", binding = ").concat(Er*2+0,") uniform texture").concat(Ln," T_").concat(Ir,`;
|
|
layout(set = `).concat(M,", binding = ").concat(Er*2+1,") uniform sampler").concat(Fi," S_").concat(Ir,";").trim():""}),b=b.replace(r==="frag"?/^\s*\b(varying|in)\b/gm:/^\s*\b(varying|out)\b/gm,function(ht,gt){return"layout(location = ".concat(F++,") ").concat(gt)}),T+="".concat(Om("gl_VertexID","gl_VertexIndex"),`
|
|
`),T+="".concat(Om("gl_InstanceID","gl_InstanceIndex"),`
|
|
`),y=y.replace(/^precision (.*) sampler(.*);$/gm,"")}else{var $=0;b=b.replace(/^(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(ht,gt,Ot,tr,Ir){var Er=NE(Ot);return Er===null&&(Er=$++),"uniform sampler".concat(tr," ").concat(Ir,"; // BINDING=").concat(Er)})}if(e.separateSamplerTextures)b=b.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(ht,gt,Ot){return"sampler".concat(gt,"(T_").concat(Ot,", S_").concat(Ot,")")}),b=b.replace(/\bTEXTURE\((.*?)\)/g,function(ht,gt){return"T_".concat(gt)});else{var G=[];b=b.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(ht,gt,Ot){return G.push([Ot,gt]),Ot}),s&&G.forEach(function(ht){var gt=(0,Mn.CR)(ht,2),Ot=gt[0],tr=gt[1];b=b.replace(new RegExp("texture\\(".concat(Ot),"g"),function(){return"texture".concat(tr,"(").concat(Ot)})}),b=b.replace(/\bTEXTURE\((.*?)\)/g,function(ht,gt){return gt})}var ue="".concat(s?"":e.glslVersion,`
|
|
`).concat(s&&l?`#extension GL_EXT_draw_buffers : require
|
|
`:"",`
|
|
`).concat(s&&r==="frag"?`#extension GL_OES_standard_derivatives : enable
|
|
`:"").concat(i?y:"",`
|
|
`).concat(T||"").concat(v?v+`
|
|
`:"",`
|
|
`).concat(b,`
|
|
`).trim();if(e.explicitBindingLocations&&r==="frag"&&(ue=ue.replace(/^\b(out)\b/g,function(ht,gt){return"layout(location = 0) ".concat(gt)})),s){if(r==="frag"&&(ue=ue.replace(/^\s*in\s+(\S+)\s*(.*);$/gm,function(ht,gt,Ot){return"varying ".concat(gt," ").concat(Ot,`;
|
|
`)})),r==="vert"&&(ue=ue.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(ht,gt,Ot){return"varying ".concat(gt," ").concat(Ot,`;
|
|
`)}),ue=ue.replace(/^\s*layout\(location\s*=\s*\S*\)\s*in\s+(\S+)\s*(.*);$/gm,function(ht,gt,Ot){return"attribute ".concat(gt," ").concat(Ot,`;
|
|
`)})),ue=ue.replace(/\s*uniform\s*.*\s*{((?:\s*.*\s*)*?)};/g,function(ht,gt){return gt.trim().replace(/^.*$/gm,function(Ot){var tr=Ot.trim();return tr.startsWith("#")?tr:Ot?"uniform ".concat(tr):""})}),r==="frag")if(l){var xe=[];ue=ue.replace(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm,function(ht,gt){return xe.push(gt),"vec4 ".concat(gt,`;
|
|
`)});var ze=ue.lastIndexOf("}");ue=ue.substring(0,ze)+`
|
|
`.concat(xe.map(function(ht,gt){return"gl_FragData[".concat(gt,"] = ").concat(ht,`;
|
|
`)}).join(`
|
|
`))+ue.substring(ze)}else{var Je;if(ue=ue.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(ht,gt,Ot){return Je=Ot,"".concat(gt," ").concat(Ot,`;
|
|
`)}),Je){var ze=ue.lastIndexOf("}");ue=ue.substring(0,ze)+`
|
|
gl_FragColor = vec4(`.concat(Je,`);
|
|
`)+ue.substring(ze)}}ue=ue.replace(/^\s*layout\((.*)\)/gm,"")}return ue}function ZN(e,r,t,n){n===void 0&&(n=null);var i=Np(e,"vert",r,n),o=Np(e,"frag",t,n);return{vert:r,frag:t,preprocessedVert:i,preprocessedFrag:o}}var Tf=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=e.call(this)||this;return o.id=n,o.device=i,o.device.resourceCreationTracker!==null&&o.device.resourceCreationTracker.trackResourceCreated(o),o}return r.prototype.destroy=function(){this.device.resourceCreationTracker!==null&&this.device.resourceCreationTracker.trackResourceDestroyed(this)},r}(bE.Z),W4=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.Bindings;var l=o.uniformBufferBindings,f=o.samplerBindings;return s.uniformBufferBindings=l||[],s.samplerBindings=f||[],s.bindingLayouts=s.createBindingLayouts(),s}return r.prototype.createBindingLayouts=function(){var t=0,n=0,i=[],o=this.uniformBufferBindings.length,s=this.samplerBindings.length;return i.push({firstUniformBuffer:t,numUniformBuffers:o,firstSampler:n,numSamplers:s}),t+=o,n+=s,{numUniformBuffers:t,numSamplers:n,bindingLayoutTables:i}},r}(Tf);function Hn(e){return typeof WebGL2RenderingContext!="undefined"&&e instanceof WebGL2RenderingContext?!0:!!(e&&e._version===2)}function UE(e){var r=ch(e);switch(r){case Rr.BC1:case Rr.BC2:case Rr.BC3:case Rr.BC4_UNORM:case Rr.BC4_SNORM:case Rr.BC5_UNORM:case Rr.BC5_SNORM:return!0;default:return!1}}function zE(e){var r=Sv(e);if(r&wn.Normalized)return!1;var t=ch(e);return t===Rr.S8||t===Rr.S16||t===Rr.S32||t===Rr.U8||t===Rr.U16||t===Rr.U32}function G4(e){switch(e){case Af.STATIC:return We.STATIC_DRAW;case Af.DYNAMIC:return We.DYNAMIC_DRAW}}function ZE(e){if(e&no.INDEX)return We.ELEMENT_ARRAY_BUFFER;if(e&no.VERTEX)return We.ARRAY_BUFFER;if(e&no.UNIFORM)return We.UNIFORM_BUFFER}function X4(e){switch(e){case ms.TRIANGLES:return We.TRIANGLES;case ms.POINTS:return We.POINTS;case ms.TRIANGLE_STRIP:return We.TRIANGLE_STRIP;case ms.LINES:return We.LINES;case ms.LINE_STRIP:return We.LINE_STRIP;default:throw new Error("Unknown primitive topology mode")}}function $4(e){switch(e){case Rr.U8:return We.UNSIGNED_BYTE;case Rr.U16:return We.UNSIGNED_SHORT;case Rr.U32:return We.UNSIGNED_INT;case Rr.S8:return We.BYTE;case Rr.S16:return We.SHORT;case Rr.S32:return We.INT;case Rr.F16:return We.HALF_FLOAT;case Rr.F32:return We.FLOAT;default:throw new Error("whoops")}}function Y4(e){switch(e){case Wn.R:return 1;case Wn.RG:return 2;case Wn.RGB:return 3;case Wn.RGBA:return 4;default:return 1}}function q4(e){var r=ch(e),t=Qg(e),n=Sv(e),i=$4(r),o=Y4(t),s=!!(n&wn.Normalized);return{size:o,type:i,normalized:s}}function K4(e){switch(e){case Mt.U8_R:return We.UNSIGNED_BYTE;case Mt.U16_R:return We.UNSIGNED_SHORT;case Mt.U32_R:return We.UNSIGNED_INT;default:throw new Error("whoops")}}function Dm(e){switch(e){case gl.CLAMP_TO_EDGE:return We.CLAMP_TO_EDGE;case gl.REPEAT:return We.REPEAT;case gl.MIRRORED_REPEAT:return We.MIRRORED_REPEAT;default:throw new Error("whoops")}}function a0(e,r){if(r===Xs.LINEAR&&e===vs.BILINEAR)return We.LINEAR_MIPMAP_LINEAR;if(r===Xs.LINEAR&&e===vs.POINT)return We.NEAREST_MIPMAP_LINEAR;if(r===Xs.NEAREST&&e===vs.BILINEAR)return We.LINEAR_MIPMAP_NEAREST;if(r===Xs.NEAREST&&e===vs.POINT)return We.NEAREST_MIPMAP_NEAREST;if(r===Xs.NO_MIP&&e===vs.BILINEAR)return We.LINEAR;if(r===Xs.NO_MIP&&e===vs.POINT)return We.NEAREST;throw new Error("Unknown texture filter mode")}function Rv(e,r){r===void 0&&(r=0);var t=e;return t.gl_buffer_pages[r/t.pageByteSize|0]}function Mv(e){var r=e;return r.gl_texture}function C_(e){var r=e;return r.gl_sampler}function Fm(e,r){e.name=r,e.__SPECTOR_Metadata={name:r}}function VE(e,r){for(var t=[];;){var n=r.exec(e);if(!n)break;t.push(n)}return t}function Up(e){return e.blendMode==Tu.ADD&&e.blendSrcFactor==la.ONE&&e.blendDstFactor===la.ZERO}function Q4(e){switch(e){case Kg.OcclusionConservative:return We.ANY_SAMPLES_PASSED_CONSERVATIVE;default:throw new Error("whoops")}}function J4(e){if(e===Gi.TEXTURE_2D)return We.TEXTURE_2D;if(e===Gi.TEXTURE_2D_ARRAY)return We.TEXTURE_2D_ARRAY;if(e===Gi.TEXTURE_CUBE_MAP)return We.TEXTURE_CUBE_MAP;if(e===Gi.TEXTURE_3D)return We.TEXTURE_3D;throw new Error("whoops")}function R_(e,r,t,n){return!(e%t!==0||r%n!==0)}var eD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.Buffer;var l=o.viewOrSize,f=o.usage,v=o.hint,y=v===void 0?Af.STATIC:v,b=i.uniformBufferMaxPageByteSize,T=i.gl,M=f&no.UNIFORM;M||(Hn(T)?T.bindVertexArray(null):i.OES_vertex_array_object.bindVertexArrayOES(null));var O=(0,xv.Z)(l)?t0(l,4):t0(l.byteLength,4);s.gl_buffer_pages=[];var F;if(M){for(var $=O;$>0;)s.gl_buffer_pages.push(s.createBufferPage(Math.min($,b),f,y)),$-=b;F=b}else s.gl_buffer_pages.push(s.createBufferPage(O,f,y)),F=O;return s.pageByteSize=F,s.byteSize=O,s.usage=f,s.gl_target=ZE(f),(0,xv.Z)(l)||s.setSubData(0,new Uint8Array(l.buffer)),M||(Hn(T)?T.bindVertexArray(s.device.currentBoundVAO):i.OES_vertex_array_object.bindVertexArrayOES(s.device.currentBoundVAO)),s}return r.prototype.setSubData=function(t,n,i,o){i===void 0&&(i=0),o===void 0&&(o=n.byteLength-i);for(var s=this.device.gl,l=this.pageByteSize,f=t+o,v=t,y=t%l;v<f;){var b=Hn(s)?s.COPY_WRITE_BUFFER:this.gl_target,T=Rv(this,v);if(T.ubo)return;s.bindBuffer(b,T),Hn(s)?s.bufferSubData(b,y,n,i,Math.min(f-v,l)):s.bufferSubData(b,y,n),v+=l,y=0,i+=l,this.device.debugGroupStatisticsBufferUpload()}},r.prototype.destroy=function(){e.prototype.destroy.call(this);for(var t=0;t<this.gl_buffer_pages.length;t++)this.gl_buffer_pages[t].ubo||this.device.gl.deleteBuffer(this.gl_buffer_pages[t]);this.gl_buffer_pages=[]},r.prototype.createBufferPage=function(t,n,i){var o=this.device.gl,s=n&no.UNIFORM;if(!Hn(o)&&s)return{ubo:!0};var l=this.device.ensureResourceExists(o.createBuffer()),f=ZE(n),v=G4(i);return o.bindBuffer(f,l),o.bufferData(f,t,v),l},r}(Tf),tD=function(e){(0,Mn.ZT)(r,e);function r(t){var n,i,o,s,l=t.id,f=t.device,v=t.descriptor,y,b=e.call(this,{id:l,device:f})||this;b.type=ya.InputLayout;var T=v.vertexBufferDescriptors,M=v.indexBufferFormat,O=v.program;Bi(M===Mt.U16_R||M===Mt.U32_R||M===null);var F=M!==null?K4(M):null,$=M!==null?AE(M):null,G=b.device.gl,ue=b.device.ensureResourceExists(Hn(G)?G.createVertexArray():f.OES_vertex_array_object.createVertexArrayOES());Hn(G)?G.bindVertexArray(ue):f.OES_vertex_array_object.bindVertexArrayOES(ue),G.bindBuffer(G.ARRAY_BUFFER,Rv(b.device.fallbackVertexBuffer));try{for(var xe=(0,Mn.XA)(v.vertexBufferDescriptors),ze=xe.next();!ze.done;ze=xe.next()){var Je=ze.value,ht=Je.stepMode,gt=Je.attributes;try{for(var Ot=(o=void 0,(0,Mn.XA)(gt)),tr=Ot.next();!tr.done;tr=Ot.next()){var Ir=tr.value,Er=Ir.shaderLocation,mn=Ir.format,Ln=Ir.divisor,Fi=Ln===void 0?1:Ln,xa=Hn(G)?Er:(y=O.attributes[Er])===null||y===void 0?void 0:y.location,is=q4(mn);if(Ir.vertexFormat=is,!(0,Bp.Z)(xa)){zE(mn);var _s=is.size,as=is.type,lu=is.normalized;G.vertexAttribPointer(xa,_s,as,lu,0,0),ht===Sd.INSTANCE&&(Hn(G)?G.vertexAttribDivisor(xa,Fi):f.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(xa,Fi)),G.enableVertexAttribArray(xa)}}}catch(Ac){o={error:Ac}}finally{try{tr&&!tr.done&&(s=Ot.return)&&s.call(Ot)}finally{if(o)throw o.error}}}}catch(Ac){n={error:Ac}}finally{try{ze&&!ze.done&&(i=xe.return)&&i.call(xe)}finally{if(n)throw n.error}}return Hn(G)?G.bindVertexArray(null):f.OES_vertex_array_object.bindVertexArrayOES(null),b.vertexBufferDescriptors=T,b.vao=ue,b.indexBufferFormat=M,b.indexBufferType=F,b.indexBufferCompByteSize=$,b.program=O,b}return r.prototype.destroy=function(){e.prototype.destroy.call(this),this.device.currentBoundVAO===this.vao&&(Hn(this.device.gl)?(this.device.gl.bindVertexArray(null),this.device.gl.deleteVertexArray(this.vao)):(this.device.OES_vertex_array_object.bindVertexArrayOES(null),this.device.OES_vertex_array_object.deleteVertexArrayOES(this.vao)),this.device.currentBoundVAO=null)},r}(Tf),M_=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=t.fake,l=e.call(this,{id:n,device:i})||this;l.type=ya.Texture,o=(0,Mn.pi)({dimension:Gi.TEXTURE_2D,depthOrArrayLayers:1,mipLevelCount:1},o);var f=l.device.gl,v,y,b=l.clampmipLevelCount(o);if(l.immutable=o.usage===Ec.RENDER_TARGET,l.pixelStore=o.pixelStore,l.format=o.format,l.dimension=o.dimension,l.formatKind=TE(o.format),l.width=o.width,l.height=o.height,l.depthOrArrayLayers=o.depthOrArrayLayers,l.mipmaps=b>=1,!s){y=l.device.ensureResourceExists(f.createTexture());var T=l.device.translateTextureType(o.format),M=l.device.translateTextureInternalFormat(o.format);if(l.device.setActiveTexture(f.TEXTURE0),l.device.currentTextures[0]=null,l.preprocessImage(),o.dimension===Gi.TEXTURE_2D){if(v=We.TEXTURE_2D,f.bindTexture(v,y),l.immutable)if(Hn(f))f.texStorage2D(v,b,M,o.width,o.height);else{var O=(M===We.DEPTH_COMPONENT||l.isNPOT(),0);(l.format===Mt.D32F||l.format===Mt.D24_S8)&&!Hn(f)&&!i.WEBGL_depth_texture||(f.texImage2D(v,O,M,o.width,o.height,0,M,T,null),l.mipmaps&&(l.mipmaps=!1,f.texParameteri(We.TEXTURE_2D,We.TEXTURE_MIN_FILTER,We.LINEAR),f.texParameteri(We.TEXTURE_2D,We.TEXTURE_WRAP_S,We.CLAMP_TO_EDGE),f.texParameteri(We.TEXTURE_2D,We.TEXTURE_WRAP_T,We.CLAMP_TO_EDGE)))}Bi(o.depthOrArrayLayers===1)}else if(o.dimension===Gi.TEXTURE_2D_ARRAY)v=We.TEXTURE_2D_ARRAY,f.bindTexture(v,y),l.immutable&&Hn(f)&&f.texStorage3D(v,b,M,o.width,o.height,o.depthOrArrayLayers);else if(o.dimension===Gi.TEXTURE_3D)v=We.TEXTURE_3D,f.bindTexture(v,y),l.immutable&&Hn(f)&&f.texStorage3D(v,b,M,o.width,o.height,o.depthOrArrayLayers);else if(o.dimension===Gi.TEXTURE_CUBE_MAP)v=We.TEXTURE_CUBE_MAP,f.bindTexture(v,y),l.immutable&&Hn(f)&&f.texStorage2D(v,b,M,o.width,o.height),Bi(o.depthOrArrayLayers===6);else throw new Error("whoops")}return l.gl_texture=y,l.gl_target=v,l.mipLevelCount=b,l}return r.prototype.setImageData=function(t,n){n===void 0&&(n=0);var i=this.device.gl;UE(this.format);var o=this.gl_target===We.TEXTURE_3D||this.gl_target===We.TEXTURE_2D_ARRAY,s=this.gl_target===We.TEXTURE_CUBE_MAP,l=Z4(t[0]);this.device.setActiveTexture(i.TEXTURE0),this.device.currentTextures[0]=null;var f=t[0],v,y;l?(v=this.width,y=this.height):(v=f.width,y=f.height,this.width=v,this.height=y),i.bindTexture(this.gl_target,this.gl_texture);var b=this.device.translateTextureFormat(this.format),T=this.device.translateTextureType(this.format);this.preprocessImage();for(var M=0;M<this.depthOrArrayLayers;M++){var O=t[M],F=this.gl_target;s&&(F=We.TEXTURE_CUBE_MAP_POSITIVE_X+M%6),this.immutable?i.texSubImage2D(F,n,0,0,v,y,b,T,O):Hn(i)?o?i.texImage3D(F,n,b,v,y,this.depthOrArrayLayers,0,b,T,O):i.texImage2D(F,n,b,v,y,0,b,T,O):l?i.texImage2D(F,n,b,v,y,0,b,T,O):i.texImage2D(F,n,b,b,T,O)}this.mipmaps&&this.generateMipmap(o)},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.device.gl.deleteTexture(Mv(this))},r.prototype.clampmipLevelCount=function(t){if(t.dimension===Gi.TEXTURE_2D_ARRAY&&t.depthOrArrayLayers>1){var n=ch(t.format);if(n===Rr.BC1)for(var i=t.width,o=t.height,s=0;s<t.mipLevelCount;s++){if(i<=2||o<=2)return s-1;i=Math.max(i/2|0,1),o=Math.max(o/2|0,1)}}return t.mipLevelCount},r.prototype.preprocessImage=function(){var t=this.device.gl;this.pixelStore&&(this.pixelStore.unpackFlipY&&t.pixelStorei(We.UNPACK_FLIP_Y_WEBGL,!0),this.pixelStore.packAlignment&&t.pixelStorei(We.PACK_ALIGNMENT,this.pixelStore.packAlignment),this.pixelStore.unpackAlignment&&t.pixelStorei(We.UNPACK_ALIGNMENT,this.pixelStore.unpackAlignment))},r.prototype.generateMipmap=function(t){t===void 0&&(t=!1);var n=this.device.gl;return!Hn(n)&&this.isNPOT()?this:(this.gl_texture&&this.gl_target&&(n.bindTexture(this.gl_target,this.gl_texture),t?(n.texParameteri(this.gl_target,We.TEXTURE_BASE_LEVEL,0),n.texParameteri(this.gl_target,We.TEXTURE_MAX_LEVEL,Math.log2(this.width)),n.texParameteri(this.gl_target,We.TEXTURE_MIN_FILTER,We.LINEAR_MIPMAP_LINEAR),n.texParameteri(this.gl_target,We.TEXTURE_MAG_FILTER,We.LINEAR)):n.texParameteri(We.TEXTURE_2D,We.TEXTURE_MIN_FILTER,We.NEAREST_MIPMAP_LINEAR),n.generateMipmap(this.gl_target),n.bindTexture(this.gl_target,null)),this)},r.prototype.isNPOT=function(){var t=this.device.gl;return Hn(t)?!1:!e0(this.width)||!e0(this.height)},r}(Tf),rD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.RenderTarget,s.gl_renderbuffer=null,s.texture=null;var l=s.device.gl,f=o.format,v=o.width,y=o.height,b=o.sampleCount,T=b===void 0?1:b,M=o.texture,O=!1;if((f===Mt.D32F||f===Mt.D24_S8)&&M&&!Hn(l)&&!i.WEBGL_depth_texture&&(M.destroy(),s.texture=null,O=!0),!O&&M)s.texture=M;else{s.gl_renderbuffer=s.device.ensureResourceExists(l.createRenderbuffer()),l.bindRenderbuffer(l.RENDERBUFFER,s.gl_renderbuffer);var F=s.device.translateTextureInternalFormat(f,!0);Hn(l)&&T>1?l.renderbufferStorageMultisample(We.RENDERBUFFER,T,F,v,y):l.renderbufferStorage(We.RENDERBUFFER,F,v,y)}return s.format=f,s.width=v,s.height=y,s.sampleCount=T,s}return r.prototype.destroy=function(){e.prototype.destroy.call(this),this.gl_renderbuffer!==null&&this.device.gl.deleteRenderbuffer(this.gl_renderbuffer),this.texture&&this.texture.destroy()},r}(Tf),Gl;(function(e){e[e.NeedsCompile=0]="NeedsCompile",e[e.Compiling=1]="Compiling",e[e.NeedsBind=2]="NeedsBind",e[e.ReadyToUse=3]="ReadyToUse"})(Gl||(Gl={}));var nD=function(e){(0,Mn.ZT)(r,e);function r(t,n){var i=t.id,o=t.device,s=t.descriptor,l=e.call(this,{id:i,device:o})||this;l.rawVertexGLSL=n,l.type=ya.Program,l.uniformSetters={},l.attributes=[];var f=l.device.gl;return l.descriptor=s,l.gl_program=l.device.ensureResourceExists(f.createProgram()),l.gl_shader_vert=null,l.gl_shader_frag=null,l.compileState=Gl.NeedsCompile,l.tryCompileProgram(),l}return r.prototype.destroy=function(){e.prototype.destroy.call(this),this.device.gl.deleteProgram(this.gl_program),this.device.gl.deleteShader(this.gl_shader_vert),this.device.gl.deleteShader(this.gl_shader_frag)},r.prototype.tryCompileProgram=function(){var t,n;Bi(this.compileState===Gl.NeedsCompile);var i=this.descriptor,o=this.device.gl;!((t=i.vertex)===null||t===void 0)&&t.glsl&&(!((n=i.fragment)===null||n===void 0)&&n.glsl)&&(this.gl_shader_vert=this.compileShader(i.vertex.glsl,o.VERTEX_SHADER),this.gl_shader_frag=this.compileShader(i.fragment.glsl,o.FRAGMENT_SHADER),o.attachShader(this.gl_program,this.gl_shader_vert),o.attachShader(this.gl_program,this.gl_shader_frag),o.linkProgram(this.gl_program),this.compileState=Gl.Compiling,Hn(o)||(this.readUniformLocationsFromLinkedProgram(),this.readAttributesFromLinkedProgram()))},r.prototype.readAttributesFromLinkedProgram=function(){for(var t,n=this.device.gl,i=n.getProgramParameter(this.gl_program,n.ACTIVE_ATTRIBUTES),o=V4(this.descriptor.vertex.glsl),s=j4(this.rawVertexGLSL,o),l=function(y){var b=n.getActiveAttrib(f.gl_program,y),T=b.name,M=b.type,O=b.size,F=n.getAttribLocation(f.gl_program,T),$=(t=s.find(function(G){return G.name===T}))===null||t===void 0?void 0:t.location;F>=0&&!(0,Bp.Z)($)&&(f.attributes[$]={name:T,location:F,type:M,size:O})},f=this,v=0;v<i;v++)l(v)},r.prototype.readUniformLocationsFromLinkedProgram=function(){for(var t=this.device.gl,n=t.getProgramParameter(this.gl_program,t.ACTIVE_UNIFORMS),i=0;i<n;i++){var o=t.getActiveUniform(this.gl_program,i),s=k4(o.name).name,l=t.getUniformLocation(this.gl_program,s);if(this.uniformSetters[s]=LE(t,l,o),o&&o.size>1)for(var f=0;f<o.size;f++)l=t.getUniformLocation(this.gl_program,"".concat(s,"[").concat(f,"]")),this.uniformSetters["".concat(s,"[").concat(f,"]")]=LE(t,l,o)}},r.prototype.compileShader=function(t,n){var i=this.device.gl,o=this.device.ensureResourceExists(i.createShader(n));return i.shaderSource(o,t),i.compileShader(o),o},r.prototype.setUniformsLegacy=function(t){t===void 0&&(t={});var n=this.device.gl;if(!Hn(n)){var i=!1;for(var o in t){i||(n.useProgram(this.gl_program),i=!0);var s=t[o],l=this.uniformSetters[o];if(l){var f=s;f instanceof M_&&(f=f.textureIndex),l(f)}}}return this},r}(Tf),iD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.QueryPool;var l=s.device.gl;if(Hn(l)){var f=o.elemCount,v=o.type;s.gl_query=_4(f,function(){return s.device.ensureResourceExists(l.createQuery())}),s.gl_query_type=Q4(v)}return s}return r.prototype.queryResultOcclusion=function(t){var n=this.device.gl;if(Hn(n)){var i=this.gl_query[t];return n.getQueryParameter(i,n.QUERY_RESULT_AVAILABLE)?!!n.getQueryParameter(i,n.QUERY_RESULT):null}return null},r.prototype.destroy=function(){e.prototype.destroy.call(this);var t=this.device.gl;if(Hn(t))for(var n=0;n<this.gl_query.length;n++)t.deleteQuery(this.gl_query[n])},r}(Tf),aD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=e.call(this,{id:n,device:i})||this;return o.type=ya.Readback,o.gl_pbo=null,o.gl_sync=null,o}return r.prototype.clientWaitAsync=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=10);var o=this.device.gl;return new Promise(function(s,l){function f(){var v=o.clientWaitSync(t,n,0);if(v==o.WAIT_FAILED){l();return}if(v==o.TIMEOUT_EXPIRED){setTimeout(f,(0,h4.Z)(i,0,o.MAX_CLIENT_WAIT_TIMEOUT_WEBGL));return}s()}f()})},r.prototype.getBufferSubDataAsync=function(t,n,i,o,s,l){return(0,Mn.mG)(this,void 0,void 0,function(){var f;return(0,Mn.Jh)(this,function(v){switch(v.label){case 0:return f=this.device.gl,Hn(f)?(this.gl_sync=f.fenceSync(f.SYNC_GPU_COMMANDS_COMPLETE,0),f.flush(),[4,this.clientWaitAsync(this.gl_sync,0,10)]):[3,2];case 1:return v.sent(),f.bindBuffer(t,n),f.getBufferSubData(t,i,o,s,l),f.bindBuffer(t,null),[2,o];case 2:return[2]}})})},r.prototype.readTexture=function(t,n,i,o,s,l,f,v){return f===void 0&&(f=0),v===void 0&&(v=l.byteLength||0),(0,Mn.mG)(this,void 0,void 0,function(){var y,b,T,M,O;return(0,Mn.Jh)(this,function(F){return y=this.device.gl,b=t,T=this.device.translateTextureFormat(b.format),M=this.device.translateTextureType(b.format),O=p4(b.format),Hn(y)?(this.gl_pbo=this.device.ensureResourceExists(y.createBuffer()),y.bindBuffer(y.PIXEL_PACK_BUFFER,this.gl_pbo),y.bufferData(y.PIXEL_PACK_BUFFER,v,y.STREAM_READ),y.bindBuffer(y.PIXEL_PACK_BUFFER,null),y.bindFramebuffer(We.READ_FRAMEBUFFER,this.device.readbackFramebuffer),y.framebufferTexture2D(We.READ_FRAMEBUFFER,We.COLOR_ATTACHMENT0,We.TEXTURE_2D,b.gl_texture,0),y.bindBuffer(y.PIXEL_PACK_BUFFER,this.gl_pbo),y.readPixels(n,i,o,s,T,M,f*O),y.bindBuffer(y.PIXEL_PACK_BUFFER,null),[2,this.getBufferSubDataAsync(y.PIXEL_PACK_BUFFER,this.gl_pbo,0,l,f,0)]):[2,this.readTextureSync(t,n,i,o,s,l,f,v)]})})},r.prototype.readTextureSync=function(t,n,i,o,s,l,f,v){v===void 0&&(v=l.byteLength||0);var y=this.device.gl,b=t,T=this.device.translateTextureType(b.format);return y.bindFramebuffer(We.FRAMEBUFFER,this.device.readbackFramebuffer),y.framebufferTexture2D(We.FRAMEBUFFER,We.COLOR_ATTACHMENT0,We.TEXTURE_2D,b.gl_texture,0),y.pixelStorei(y.PACK_ALIGNMENT,4),y.readPixels(n,i,o,s,y.RGBA,T,l),l},r.prototype.readBuffer=function(t,n,i,o,s){return(0,Mn.mG)(this,void 0,void 0,function(){var l;return(0,Mn.Jh)(this,function(f){return l=this.device.gl,Hn(l)?[2,this.getBufferSubDataAsync(l.ARRAY_BUFFER,Rv(t,n),n,i,o,s)]:[2,Promise.reject()]})})},r.prototype.destroy=function(){e.prototype.destroy.call(this),Hn(this.device.gl)&&(this.gl_sync!==null&&this.device.gl.deleteSync(this.gl_sync),this.gl_pbo!==null&&this.device.gl.deleteBuffer(this.gl_pbo))},r}(Tf),oD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s,l,f=e.call(this,{id:n,device:i})||this;return f.type=ya.RenderPipeline,f.drawMode=X4((s=o.topology)!==null&&s!==void 0?s:ms.TRIANGLES),f.program=o.program,f.inputLayout=o.inputLayout,f.megaState=(0,Mn.pi)((0,Mn.pi)({},wv(Td)),o.megaStateDescriptor),f.colorAttachmentFormats=o.colorAttachmentFormats.slice(),f.depthStencilAttachmentFormat=o.depthStencilAttachmentFormat,f.sampleCount=(l=o.sampleCount)!==null&&l!==void 0?l:1,f}return r}(Tf),sD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;return s.type=ya.ComputePipeline,s.descriptor=o,s}return r}(Tf),uD=function(){function e(){this.liveObjects=new Set,this.creationStacks=new Map,this.deletionStacks=new Map}return e.prototype.trackResourceCreated=function(r){this.creationStacks.set(r,new Error().stack),this.liveObjects.add(r)},e.prototype.trackResourceDestroyed=function(r){this.deletionStacks.has(r)&&console.warn("Object double freed:",r,`
|
|
|
|
Creation stack: `,this.creationStacks.get(r),`
|
|
|
|
Deletion stack: `,this.deletionStacks.get(r),`
|
|
|
|
This stack: `,new Error().stack),this.deletionStacks.set(r,new Error().stack),this.liveObjects.delete(r)},e.prototype.checkForLeaks=function(){var r,t;try{for(var n=(0,Mn.XA)(this.liveObjects.values()),i=n.next();!i.done;i=n.next()){var o=i.value;console.warn("Object leaked:",o,"Creation stack:",this.creationStacks.get(o))}}catch(s){r={error:s}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}},e.prototype.setResourceLeakCheck=function(r,t){t?this.liveObjects.add(r):this.liveObjects.delete(r)},e}(),lD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s,l,f=e.call(this,{id:n,device:i})||this;f.type=ya.Sampler;var v=f.device.gl;if(Hn(v)){var y=f.device.ensureResourceExists(v.createSampler());v.samplerParameteri(y,We.TEXTURE_WRAP_S,Dm(o.addressModeU)),v.samplerParameteri(y,We.TEXTURE_WRAP_T,Dm(o.addressModeV)),v.samplerParameteri(y,We.TEXTURE_WRAP_R,Dm((s=o.addressModeW)!==null&&s!==void 0?s:o.addressModeU)),v.samplerParameteri(y,We.TEXTURE_MIN_FILTER,a0(o.minFilter,o.mipmapFilter)),v.samplerParameteri(y,We.TEXTURE_MAG_FILTER,a0(o.magFilter,Xs.NO_MIP)),o.lodMinClamp!==void 0&&v.samplerParameterf(y,We.TEXTURE_MIN_LOD,o.lodMinClamp),o.lodMaxClamp!==void 0&&v.samplerParameterf(y,We.TEXTURE_MAX_LOD,o.lodMaxClamp),o.compareFunction!==void 0&&(v.samplerParameteri(y,v.TEXTURE_COMPARE_MODE,v.COMPARE_REF_TO_TEXTURE),v.samplerParameteri(y,v.TEXTURE_COMPARE_FUNC,o.compareFunction));var b=(l=o.maxAnisotropy)!==null&&l!==void 0?l:1;b>1&&f.device.EXT_texture_filter_anisotropic!==null&&(Bi(o.minFilter===vs.BILINEAR&&o.magFilter===vs.BILINEAR&&o.mipmapFilter===Xs.LINEAR),v.samplerParameterf(y,f.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,b)),f.gl_sampler=y}else f.descriptor=o;return f}return r.prototype.setTextureParameters=function(t,n,i){var o,s=this.device.gl,l=this.descriptor;this.isNPOT(n,i)?s.texParameteri(We.TEXTURE_2D,We.TEXTURE_MIN_FILTER,We.LINEAR):s.texParameteri(t,We.TEXTURE_MIN_FILTER,a0(l.minFilter,l.mipmapFilter)),s.texParameteri(We.TEXTURE_2D,We.TEXTURE_WRAP_S,Dm(l.addressModeU)),s.texParameteri(We.TEXTURE_2D,We.TEXTURE_WRAP_T,Dm(l.addressModeV)),s.texParameteri(t,We.TEXTURE_MAG_FILTER,a0(l.magFilter,Xs.NO_MIP));var f=(o=l.maxAnisotropy)!==null&&o!==void 0?o:1;f>1&&this.device.EXT_texture_filter_anisotropic!==null&&(Bi(l.minFilter===vs.BILINEAR&&l.magFilter===vs.BILINEAR&&l.mipmapFilter===Xs.LINEAR),s.texParameteri(t,this.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,f))},r.prototype.destroy=function(){e.prototype.destroy.call(this),Hn(this.device.gl)&&this.device.gl.deleteSampler(C_(this))},r.prototype.isNPOT=function(t,n){return!e0(t)||!e0(n)},r}(Tf),cD=function(){function e(){}return e.prototype.dispatchWorkgroups=function(r,t,n){},e.prototype.dispatchWorkgroupsIndirect=function(r,t){},e.prototype.setPipeline=function(r){},e.prototype.setBindings=function(r){},e.prototype.pushDebugGroup=function(r){},e.prototype.popDebugGroup=function(){},e.prototype.insertDebugMarker=function(r){},e}(),jE=65536,fD=/uniform(?:\s+)(\w+)(?:\s?){([^]*?)}/g,hD=function(){function e(r,t){this.shaderDebug=!1,this.OES_vertex_array_object=null,this.ANGLE_instanced_arrays=null,this.OES_texture_float=null,this.OES_draw_buffers_indexed=null,this.WEBGL_draw_buffers=null,this.WEBGL_depth_texture=null,this.WEBGL_color_buffer_float=null,this.EXT_color_buffer_half_float=null,this.WEBGL_compressed_texture_s3tc=null,this.WEBGL_compressed_texture_s3tc_srgb=null,this.EXT_texture_compression_rgtc=null,this.EXT_texture_filter_anisotropic=null,this.KHR_parallel_shader_compile=null,this.EXT_texture_norm16=null,this.EXT_color_buffer_float=null,this.OES_texture_float_linear=null,this.OES_texture_half_float_linear=null,this.scTexture=null,this.scPlatformFramebuffer=null,this.currentActiveTexture=null,this.currentBoundVAO=null,this.currentProgram=null,this.resourceCreationTracker=null,this.resourceUniqueId=0,this.currentColorAttachments=[],this.currentColorAttachmentLevels=[],this.currentColorResolveTos=[],this.currentColorResolveToLevels=[],this.currentSampleCount=-1,this.currentIndexBufferByteOffset=null,this.currentMegaState=wv(Td),this.currentSamplers=[],this.currentTextures=[],this.currentUniformBuffers=[],this.currentUniformBufferByteOffsets=[],this.currentUniformBufferByteSizes=[],this.currentScissorEnabled=!1,this.currentStencilRef=null,this.currentRenderPassDescriptor=null,this.currentRenderPassDescriptorStack=[],this.debugGroupStack=[],this.resolveColorAttachmentsChanged=!1,this.resolveDepthStencilAttachmentsChanged=!1,this.explicitBindingLocations=!1,this.separateSamplerTextures=!1,this.viewportOrigin=bv.LOWER_LEFT,this.clipSpaceNearZ=Ev.NEGATIVE_ONE,this.supportMRT=!1,this.inBlitRenderPass=!1,this.supportedSampleCounts=[],this.occlusionQueriesRecommended=!1,this.computeShadersSupported=!1,this.gl=r,this.contextAttributes=Ad(r.getContextAttributes()),Hn(r)?(this.EXT_texture_norm16=r.getExtension("EXT_texture_norm16"),this.EXT_color_buffer_float=r.getExtension("EXT_color_buffer_float")):(this.OES_vertex_array_object=r.getExtension("OES_vertex_array_object"),this.ANGLE_instanced_arrays=r.getExtension("ANGLE_instanced_arrays"),this.OES_texture_float=r.getExtension("OES_texture_float"),this.WEBGL_draw_buffers=r.getExtension("WEBGL_draw_buffers"),this.WEBGL_depth_texture=r.getExtension("WEBGL_depth_texture"),this.WEBGL_color_buffer_float=r.getExtension("WEBGL_color_buffer_float"),this.EXT_color_buffer_half_float=r.getExtension("EXT_color_buffer_half_float"),r.getExtension("EXT_frag_depth"),r.getExtension("OES_element_index_uint"),r.getExtension("OES_standard_derivatives")),this.WEBGL_compressed_texture_s3tc=r.getExtension("WEBGL_compressed_texture_s3tc"),this.WEBGL_compressed_texture_s3tc_srgb=r.getExtension("WEBGL_compressed_texture_s3tc_srgb"),this.EXT_texture_compression_rgtc=r.getExtension("EXT_texture_compression_rgtc"),this.EXT_texture_filter_anisotropic=r.getExtension("EXT_texture_filter_anisotropic"),this.EXT_texture_norm16=r.getExtension("EXT_texture_norm16"),this.OES_texture_float_linear=r.getExtension("OES_texture_float_linear"),this.OES_texture_half_float_linear=r.getExtension("OES_texture_half_float_linear"),this.KHR_parallel_shader_compile=r.getExtension("KHR_parallel_shader_compile"),Hn(r)?(this.platformString="WebGL2",this.glslVersion="#version 300 es"):(this.platformString="WebGL1",this.glslVersion="#version 100"),this.scTexture=new M_({id:this.getNextUniqueId(),device:this,descriptor:{width:0,height:0,depthOrArrayLayers:1,dimension:Gi.TEXTURE_2D,mipLevelCount:1,usage:Ec.RENDER_TARGET,format:this.contextAttributes.alpha===!1?Mt.U8_RGB_RT:Mt.U8_RGBA_RT},fake:!0}),this.scTexture.formatKind=zo.Float,this.scTexture.gl_target=null,this.scTexture.gl_texture=null,this.resolveColorReadFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.resolveColorDrawFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.resolveDepthStencilReadFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.resolveDepthStencilDrawFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.renderPassDrawFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.readbackFramebuffer=this.ensureResourceExists(r.createFramebuffer()),this.fallbackTexture2D=this.createFallbackTexture(Gi.TEXTURE_2D,zo.Float),this.fallbackTexture2DDepth=this.createFallbackTexture(Gi.TEXTURE_2D,zo.Depth),this.fallbackVertexBuffer=this.createBuffer({viewOrSize:1,usage:no.VERTEX,hint:Af.STATIC}),Hn(r)&&(this.fallbackTexture2DArray=this.createFallbackTexture(Gi.TEXTURE_2D_ARRAY,zo.Float),this.fallbackTexture3D=this.createFallbackTexture(Gi.TEXTURE_3D,zo.Float),this.fallbackTextureCube=this.createFallbackTexture(Gi.TEXTURE_CUBE_MAP,zo.Float)),this.currentMegaState.depthCompare=_a.LESS,this.currentMegaState.depthWrite=!1,this.currentMegaState.attachmentsState[0].channelWriteMask=wu.ALL,r.enable(r.DEPTH_TEST),r.enable(r.STENCIL_TEST),this.checkLimits(),t.shaderDebug&&(this.shaderDebug=!0),t.trackResources&&(this.resourceCreationTracker=new uD)}return e.prototype.destroy=function(){this.blitBindings&&this.blitBindings.destroy(),this.blitInputLayout&&this.blitInputLayout.destroy(),this.blitRenderPipeline&&this.blitRenderPipeline.destroy(),this.blitVertexBuffer&&this.blitVertexBuffer.destroy(),this.blitProgram&&this.blitProgram.destroy()},e.prototype.createFallbackTexture=function(r,t){var n=r===Gi.TEXTURE_CUBE_MAP?6:1,i=t===zo.Depth?Mt.D32F:Mt.U8_RGBA_NORM,o=this.createTexture({dimension:r,format:i,usage:Ec.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1});return t===zo.Float&&o.setImageData([new Uint8Array(4*n)]),Mv(o)},e.prototype.getNextUniqueId=function(){return++this.resourceUniqueId},e.prototype.checkLimits=function(){var r=this.gl;if(this.maxVertexAttribs=r.getParameter(We.MAX_VERTEX_ATTRIBS),Hn(r)){this.uniformBufferMaxPageByteSize=Math.min(r.getParameter(We.MAX_UNIFORM_BLOCK_SIZE),jE),this.uniformBufferWordAlignment=r.getParameter(r.UNIFORM_BUFFER_OFFSET_ALIGNMENT)/4;var t=r.getInternalformatParameter(r.RENDERBUFFER,r.DEPTH32F_STENCIL8,r.SAMPLES);this.supportedSampleCounts=t?(0,Mn.ev)([],(0,Mn.CR)(t),!1):[],this.occlusionQueriesRecommended=!0}else this.uniformBufferWordAlignment=64,this.uniformBufferMaxPageByteSize=jE;this.uniformBufferMaxPageWordSize=this.uniformBufferMaxPageByteSize/4,this.supportedSampleCounts.includes(1)||this.supportedSampleCounts.push(1),this.supportedSampleCounts.sort(function(n,i){return n-i})},e.prototype.configureSwapChain=function(r,t,n){var i=this.scTexture;i.width=r,i.height=t,this.scPlatformFramebuffer=m4(n)},e.prototype.getDevice=function(){return this},e.prototype.getCanvas=function(){return this.gl.canvas},e.prototype.getOnscreenTexture=function(){return this.scTexture},e.prototype.beginFrame=function(){},e.prototype.endFrame=function(){},e.prototype.translateTextureInternalFormat=function(r,t){switch(t===void 0&&(t=!1),r){case Mt.ALPHA:return We.ALPHA;case Mt.U8_LUMINANCE:case Mt.F16_LUMINANCE:case Mt.F32_LUMINANCE:return We.LUMINANCE;case Mt.F16_R:return We.R16F;case Mt.F16_RG:return We.RG16F;case Mt.F16_RGB:return We.RGB16F;case Mt.F16_RGBA:return We.RGBA16F;case Mt.F32_R:return We.R32F;case Mt.F32_RG:return We.RG32F;case Mt.F32_RGB:return We.RGB32F;case Mt.F32_RGBA:return Hn(this.gl)?We.RGBA32F:t?this.WEBGL_color_buffer_float.RGBA32F_EXT:We.RGBA;case Mt.U8_R_NORM:return We.R8;case Mt.U8_RG_NORM:return We.RG8;case Mt.U8_RGB_NORM:case Mt.U8_RGB_RT:return We.RGB8;case Mt.U8_RGB_SRGB:return We.SRGB8;case Mt.U8_RGBA_NORM:case Mt.U8_RGBA_RT:return Hn(this.gl)?We.RGBA8:t?We.RGBA4:We.RGBA;case Mt.U8_RGBA:return We.RGBA;case Mt.U8_RGBA_SRGB:case Mt.U8_RGBA_RT_SRGB:return We.SRGB8_ALPHA8;case Mt.U16_R:return We.R16UI;case Mt.U16_R_NORM:return this.EXT_texture_norm16.R16_EXT;case Mt.U16_RG_NORM:return this.EXT_texture_norm16.RG16_EXT;case Mt.U16_RGBA_NORM:return this.EXT_texture_norm16.RGBA16_EXT;case Mt.U16_RGBA_5551:return We.RGB5_A1;case Mt.U16_RGB_565:return We.RGB565;case Mt.U32_R:return We.R32UI;case Mt.S8_RGBA_NORM:return We.RGBA8_SNORM;case Mt.S8_RG_NORM:return We.RG8_SNORM;case Mt.BC1:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT;case Mt.BC1_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;case Mt.BC2:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT;case Mt.BC2_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;case Mt.BC3:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT;case Mt.BC3_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;case Mt.BC4_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_RGTC1_EXT;case Mt.BC4_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT;case Mt.BC5_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT;case Mt.BC5_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;case Mt.D32F_S8:return Hn(this.gl)?We.DEPTH32F_STENCIL8:this.WEBGL_depth_texture?We.DEPTH_STENCIL:We.DEPTH_COMPONENT16;case Mt.D24_S8:return Hn(this.gl)?We.DEPTH24_STENCIL8:this.WEBGL_depth_texture?We.DEPTH_STENCIL:We.DEPTH_COMPONENT16;case Mt.D32F:return Hn(this.gl)?We.DEPTH_COMPONENT32F:this.WEBGL_depth_texture?We.DEPTH_COMPONENT:We.DEPTH_COMPONENT16;case Mt.D24:return Hn(this.gl)?We.DEPTH_COMPONENT24:this.WEBGL_depth_texture?We.DEPTH_COMPONENT:We.DEPTH_COMPONENT16;default:throw new Error("whoops")}},e.prototype.translateTextureType=function(r){var t=ch(r);switch(t){case Rr.U8:return We.UNSIGNED_BYTE;case Rr.U16:return We.UNSIGNED_SHORT;case Rr.U32:return We.UNSIGNED_INT;case Rr.S8:return We.BYTE;case Rr.F16:return We.HALF_FLOAT;case Rr.F32:return We.FLOAT;case Rr.U16_PACKED_5551:return We.UNSIGNED_SHORT_5_5_5_1;case Rr.D32F:return Hn(this.gl)?We.FLOAT:this.WEBGL_depth_texture?We.UNSIGNED_INT:We.UNSIGNED_BYTE;case Rr.D24:return Hn(this.gl)?We.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?We.UNSIGNED_SHORT:We.UNSIGNED_BYTE;case Rr.D24S8:return Hn(this.gl)?We.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?We.UNSIGNED_INT_24_8_WEBGL:We.UNSIGNED_BYTE;case Rr.D32FS8:return We.FLOAT_32_UNSIGNED_INT_24_8_REV;default:throw new Error("whoops")}},e.prototype.translateTextureFormat=function(r){if(UE(r)||r===Mt.F32_LUMINANCE||r===Mt.U8_LUMINANCE)return this.translateTextureInternalFormat(r);var t=Hn(this.gl)||!Hn(this.gl)&&!!this.WEBGL_depth_texture;switch(r){case Mt.D24_S8:case Mt.D32F_S8:return t?We.DEPTH_STENCIL:We.RGBA;case Mt.D24:case Mt.D32F:return t?We.DEPTH_COMPONENT:We.RGBA}var n=zE(r),i=Qg(r);switch(i){case Wn.A:return We.ALPHA;case Wn.R:return n?We.RED_INTEGER:We.RED;case Wn.RG:return n?We.RG_INTEGER:We.RG;case Wn.RGB:return n?We.RGB_INTEGER:We.RGB;case Wn.RGBA:return We.RGBA}},e.prototype.setActiveTexture=function(r){this.currentActiveTexture!==r&&(this.gl.activeTexture(r),this.currentActiveTexture=r)},e.prototype.bindVAO=function(r){this.currentBoundVAO!==r&&(Hn(this.gl)?this.gl.bindVertexArray(r):this.OES_vertex_array_object.bindVertexArrayOES(r),this.currentBoundVAO=r)},e.prototype.programCompiled=function(r){Bi(r.compileState!==Gl.NeedsCompile),r.compileState===Gl.Compiling&&(r.compileState=Gl.NeedsBind,this.shaderDebug&&this.checkProgramCompilationForErrors(r))},e.prototype.useProgram=function(r){this.currentProgram!==r&&(this.programCompiled(r),this.gl.useProgram(r.gl_program),this.currentProgram=r)},e.prototype.ensureResourceExists=function(r){if(r===null){var t=this.gl.getError();throw new Error("Created resource is null; GL error encountered: ".concat(t))}else return r},e.prototype.createBuffer=function(r){return new eD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createTexture=function(r){return new M_({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createSampler=function(r){return new lD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderTarget=function(r){return new rD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderTargetFromTexture=function(r){var t=r,n=t.format,i=t.width,o=t.height,s=t.mipLevelCount;return Bi(s===1),this.createRenderTarget({format:n,width:i,height:o,sampleCount:1,texture:r})},e.prototype.createProgram=function(r){var t,n,i,o=(t=r.vertex)===null||t===void 0?void 0:t.glsl;return!((n=r.vertex)===null||n===void 0)&&n.glsl&&(r.vertex.glsl=Np(this.queryVendorInfo(),"vert",r.vertex.glsl)),!((i=r.fragment)===null||i===void 0)&&i.glsl&&(r.fragment.glsl=Np(this.queryVendorInfo(),"frag",r.fragment.glsl)),this.createProgramSimple(r,o)},e.prototype.createProgramSimple=function(r,t){var n=new nD({id:this.getNextUniqueId(),device:this,descriptor:r},t);return n},e.prototype.createBindings=function(r){return new W4({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createInputLayout=function(r){return new tD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderPipeline=function(r){return new oD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createComputePass=function(){return new cD},e.prototype.createComputePipeline=function(r){return new sD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createReadback=function(){return new aD({id:this.getNextUniqueId(),device:this})},e.prototype.createQueryPool=function(r,t){return new iD({id:this.getNextUniqueId(),device:this,descriptor:{type:r,elemCount:t}})},e.prototype.formatRenderPassDescriptor=function(r){var t,n,i,o,s,l,f=r.colorAttachment;r.depthClearValue=(t=r.depthClearValue)!==null&&t!==void 0?t:"load",r.stencilClearValue=(n=r.stencilClearValue)!==null&&n!==void 0?n:"load";for(var v=0;v<f.length;v++)r.colorAttachmentLevel||(r.colorAttachmentLevel=[]),r.colorAttachmentLevel[v]=(i=r.colorAttachmentLevel[v])!==null&&i!==void 0?i:0,r.colorResolveToLevel||(r.colorResolveToLevel=[]),r.colorResolveToLevel[v]=(o=r.colorResolveToLevel[v])!==null&&o!==void 0?o:0,r.colorClearColor||(r.colorClearColor=[]),r.colorClearColor[v]=(s=r.colorClearColor[v])!==null&&s!==void 0?s:"load",r.colorStore||(r.colorStore=[]),r.colorStore[v]=(l=r.colorStore[v])!==null&&l!==void 0?l:!1},e.prototype.createRenderPass=function(r){this.currentRenderPassDescriptor!==null&&this.currentRenderPassDescriptorStack.push(this.currentRenderPassDescriptor),this.currentRenderPassDescriptor=r,this.formatRenderPassDescriptor(r);var t=r.colorAttachment,n=r.colorAttachmentLevel,i=r.colorClearColor,o=r.colorResolveTo,s=r.colorResolveToLevel,l=r.depthStencilAttachment,f=r.depthClearValue,v=r.stencilClearValue,y=r.depthStencilResolveTo;this.setRenderPassParametersBegin(t.length);for(var b=0;b<t.length;b++)this.setRenderPassParametersColor(b,t[b],n[b],o[b],s[b]);this.setRenderPassParametersDepthStencil(l,y),this.validateCurrentAttachments();for(var b=0;b<t.length;b++){var T=i[b];T!=="load"&&this.setRenderPassParametersClearColor(b,T.r,T.g,T.b,T.a)}return this.setRenderPassParametersClearDepthStencil(f,v),this},e.prototype.submitPass=function(r){Bi(this.currentRenderPassDescriptor!==null),this.endPass(),this.currentRenderPassDescriptorStack.length?this.currentRenderPassDescriptor=this.currentRenderPassDescriptorStack.pop():this.currentRenderPassDescriptor=null},e.prototype.copySubTexture2D=function(r,t,n,i,o,s){var l=this.gl,f=r,v=i;if(Bi(v.mipLevelCount===1),Bi(f.mipLevelCount===1),Hn(l))f===this.scTexture?l.bindFramebuffer(l.DRAW_FRAMEBUFFER,this.scPlatformFramebuffer):(l.bindFramebuffer(l.DRAW_FRAMEBUFFER,this.resolveColorDrawFramebuffer),this.bindFramebufferAttachment(l.DRAW_FRAMEBUFFER,l.COLOR_ATTACHMENT0,f,0)),l.bindFramebuffer(l.READ_FRAMEBUFFER,this.resolveColorReadFramebuffer),this.bindFramebufferAttachment(l.READ_FRAMEBUFFER,l.COLOR_ATTACHMENT0,v,0),l.blitFramebuffer(o,s,o+v.width,s+v.height,t,n,t+v.width,n+v.height,l.COLOR_BUFFER_BIT,l.LINEAR),l.bindFramebuffer(l.READ_FRAMEBUFFER,null),l.bindFramebuffer(l.DRAW_FRAMEBUFFER,null);else if(f===this.scTexture){var y=this.createRenderTargetFromTexture(i);this.submitBlitRenderPass(y,f)}},e.prototype.queryLimits=function(){return this},e.prototype.queryTextureFormatSupported=function(r,t,n){switch(r){case Mt.BC1_SRGB:case Mt.BC2_SRGB:case Mt.BC3_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb!==null?R_(t,n,4,4):!1;case Mt.BC1:case Mt.BC2:case Mt.BC3:return this.WEBGL_compressed_texture_s3tc!==null?R_(t,n,4,4):!1;case Mt.BC4_UNORM:case Mt.BC4_SNORM:case Mt.BC5_UNORM:case Mt.BC5_SNORM:return this.EXT_texture_compression_rgtc!==null?R_(t,n,4,4):!1;case Mt.U16_R_NORM:case Mt.U16_RG_NORM:case Mt.U16_RGBA_NORM:return this.EXT_texture_norm16!==null;case Mt.F32_R:case Mt.F32_RG:case Mt.F32_RGB:case Mt.F32_RGBA:return this.OES_texture_float_linear!==null;case Mt.F16_R:case Mt.F16_RG:case Mt.F16_RGB:case Mt.F16_RGBA:return this.OES_texture_half_float_linear!==null;default:return!0}},e.prototype.queryProgramReady=function(r){var t=this.gl;if(r.compileState===Gl.NeedsCompile)throw new Error("whoops");if(r.compileState===Gl.Compiling){var n=void 0;return this.KHR_parallel_shader_compile!==null?n=t.getProgramParameter(r.gl_program,this.KHR_parallel_shader_compile.COMPLETION_STATUS_KHR):n=!0,n&&this.programCompiled(r),n}return r.compileState===Gl.NeedsBind||r.compileState===Gl.ReadyToUse},e.prototype.queryPlatformAvailable=function(){return this.gl.isContextLost()},e.prototype.queryVendorInfo=function(){return this},e.prototype.queryRenderPass=function(r){return this.currentRenderPassDescriptor},e.prototype.queryRenderTarget=function(r){var t=r;return t},e.prototype.setResourceName=function(r,t){if(r.name=t,r.type===ya.Buffer)for(var n=r.gl_buffer_pages,i=0;i<n.length;i++)Fm(n[i],"".concat(t," Page ").concat(i));else if(r.type===ya.Texture)Fm(Mv(r),t);else if(r.type===ya.Sampler)Fm(C_(r),t);else if(r.type===ya.RenderTarget){var o=r.gl_renderbuffer;o!==null&&Fm(o,t)}else r.type===ya.InputLayout&&Fm(r.vao,t)},e.prototype.setResourceLeakCheck=function(r,t){this.resourceCreationTracker!==null&&this.resourceCreationTracker.setResourceLeakCheck(r,t)},e.prototype.checkForLeaks=function(){this.resourceCreationTracker!==null&&this.resourceCreationTracker.checkForLeaks()},e.prototype.pushDebugGroup=function(r){},e.prototype.popDebugGroup=function(){},e.prototype.insertDebugMarker=function(r){},e.prototype.programPatched=function(r,t){Bi(this.shaderDebug)},e.prototype.getBufferData=function(r,t,n){n===void 0&&(n=0);var i=this.gl;Hn(i)&&(i.bindBuffer(i.COPY_READ_BUFFER,Rv(r,n*4)),i.getBufferSubData(i.COPY_READ_BUFFER,n*4,t))},e.prototype.debugGroupStatisticsDrawCall=function(r){r===void 0&&(r=1);for(var t=this.debugGroupStack.length-1;t>=0;t--)this.debugGroupStack[t].drawCallCount+=r},e.prototype.debugGroupStatisticsBufferUpload=function(r){r===void 0&&(r=1);for(var t=this.debugGroupStack.length-1;t>=0;t--)this.debugGroupStack[t].bufferUploadCount+=r},e.prototype.debugGroupStatisticsTextureBind=function(r){r===void 0&&(r=1);for(var t=this.debugGroupStack.length-1;t>=0;t--)this.debugGroupStack[t].textureBindCount+=r},e.prototype.debugGroupStatisticsTriangles=function(r){for(var t=this.debugGroupStack.length-1;t>=0;t--)this.debugGroupStack[t].triangleCount+=r},e.prototype.reportShaderError=function(r,t){var n=this.gl,i=n.getShaderParameter(r,n.COMPILE_STATUS);if(!i){console.error(y4(t));var o=n.getExtension("WEBGL_debug_shaders");o&&console.error(o.getTranslatedShaderSource(r)),console.error(n.getShaderInfoLog(r))}return i},e.prototype.checkProgramCompilationForErrors=function(r){var t=this.gl,n=r.gl_program;if(!t.getProgramParameter(n,t.LINK_STATUS)){var i=r.descriptor;if(!this.reportShaderError(r.gl_shader_vert,i.vertex.glsl)||!this.reportShaderError(r.gl_shader_frag,i.fragment.glsl))return;console.error(t.getProgramInfoLog(r.gl_program))}},e.prototype.bindFramebufferAttachment=function(r,t,n,i){var o=this.gl;if((0,Bp.Z)(n))o.framebufferRenderbuffer(r,t,o.RENDERBUFFER,null);else if(n.type===ya.RenderTarget)n.gl_renderbuffer!==null?o.framebufferRenderbuffer(r,t,o.RENDERBUFFER,n.gl_renderbuffer):n.texture!==null&&o.framebufferTexture2D(r,t,We.TEXTURE_2D,Mv(n.texture),i);else if(n.type===ya.Texture){var s=Mv(n);n.dimension===Gi.TEXTURE_2D?o.framebufferTexture2D(r,t,We.TEXTURE_2D,s,i):Hn(o)&&(n.dimension,Gi.TEXTURE_2D_ARRAY)}},e.prototype.bindFramebufferDepthStencilAttachment=function(r,t){var n=this.gl,i=(0,Bp.Z)(t)?wn.Depth|wn.Stencil:Sv(t.format),o=!!(i&wn.Depth),s=!!(i&wn.Stencil);if(o&&s){var l=Hn(this.gl)||!Hn(this.gl)&&!!this.WEBGL_depth_texture;l?this.bindFramebufferAttachment(r,n.DEPTH_STENCIL_ATTACHMENT,t,0):this.bindFramebufferAttachment(r,n.DEPTH_ATTACHMENT,t,0)}else o?(this.bindFramebufferAttachment(r,n.DEPTH_ATTACHMENT,t,0),this.bindFramebufferAttachment(r,n.STENCIL_ATTACHMENT,null,0)):s&&(this.bindFramebufferAttachment(r,n.STENCIL_ATTACHMENT,t,0),this.bindFramebufferAttachment(r,n.DEPTH_ATTACHMENT,null,0))},e.prototype.validateCurrentAttachments=function(){for(var r=-1,t=-1,n=-1,i=0;i<this.currentColorAttachments.length;i++){var o=this.currentColorAttachments[i];o!==null&&(r===-1?(r=o.sampleCount,t=o.width,n=o.height):(Bi(r===o.sampleCount),Bi(t===o.width),Bi(n===o.height)))}this.currentDepthStencilAttachment&&(r===-1?r=this.currentDepthStencilAttachment.sampleCount:(Bi(r===this.currentDepthStencilAttachment.sampleCount),Bi(t===this.currentDepthStencilAttachment.width),Bi(n===this.currentDepthStencilAttachment.height))),this.currentSampleCount=r},e.prototype.setRenderPassParametersBegin=function(r){var t=this.gl;if(Hn(t)?t.bindFramebuffer(We.DRAW_FRAMEBUFFER,this.renderPassDrawFramebuffer):this.inBlitRenderPass||t.bindFramebuffer(We.FRAMEBUFFER,this.renderPassDrawFramebuffer),Hn(t)?t.drawBuffers([We.COLOR_ATTACHMENT0,We.COLOR_ATTACHMENT1,We.COLOR_ATTACHMENT2,We.COLOR_ATTACHMENT3]):!this.inBlitRenderPass&&this.WEBGL_draw_buffers&&this.WEBGL_draw_buffers.drawBuffersWEBGL([We.COLOR_ATTACHMENT0_WEBGL,We.COLOR_ATTACHMENT1_WEBGL,We.COLOR_ATTACHMENT2_WEBGL,We.COLOR_ATTACHMENT3_WEBGL]),!this.inBlitRenderPass)for(var n=r;n<this.currentColorAttachments.length;n++){var i=Hn(t)?We.DRAW_FRAMEBUFFER:We.FRAMEBUFFER,o=Hn(t)?We.COLOR_ATTACHMENT0:We.COLOR_ATTACHMENT0_WEBGL;t.framebufferRenderbuffer(i,o+n,We.RENDERBUFFER,null),t.framebufferTexture2D(i,o+n,We.TEXTURE_2D,null,0)}this.currentColorAttachments.length=r},e.prototype.setRenderPassParametersColor=function(r,t,n,i,o){var s=this.gl,l=Hn(s);(this.currentColorAttachments[r]!==t||this.currentColorAttachmentLevels[r]!==n)&&(this.currentColorAttachments[r]=t,this.currentColorAttachmentLevels[r]=n,(l||!l&&this.WEBGL_draw_buffers)&&this.bindFramebufferAttachment(l?We.DRAW_FRAMEBUFFER:We.FRAMEBUFFER,(l?We.COLOR_ATTACHMENT0:We.COLOR_ATTACHMENT0_WEBGL)+r,t,n),this.resolveColorAttachmentsChanged=!0),(this.currentColorResolveTos[r]!==i||this.currentColorResolveToLevels[r]!==o)&&(this.currentColorResolveTos[r]=i,this.currentColorResolveToLevels[r]=o,i!==null&&(this.resolveColorAttachmentsChanged=!0))},e.prototype.setRenderPassParametersDepthStencil=function(r,t){var n=this.gl;this.currentDepthStencilAttachment!==r&&(this.currentDepthStencilAttachment=r,this.inBlitRenderPass||this.bindFramebufferDepthStencilAttachment(Hn(n)?We.DRAW_FRAMEBUFFER:We.FRAMEBUFFER,this.currentDepthStencilAttachment),this.resolveDepthStencilAttachmentsChanged=!0),this.currentDepthStencilResolveTo!==t&&(this.currentDepthStencilResolveTo=t,t&&(this.resolveDepthStencilAttachmentsChanged=!0))},e.prototype.setRenderPassParametersClearColor=function(r,t,n,i,o){var s=this.gl;if(this.OES_draw_buffers_indexed!==null){var l=this.currentMegaState.attachmentsState[r];l&&l.channelWriteMask!==wu.ALL&&(this.OES_draw_buffers_indexed.colorMaskiOES(r,!0,!0,!0,!0),l.channelWriteMask=wu.ALL)}else{var l=this.currentMegaState.attachmentsState[0];l&&l.channelWriteMask!==wu.ALL&&(s.colorMask(!0,!0,!0,!0),l.channelWriteMask=wu.ALL)}this.setScissorRectEnabled(!1),Hn(s)?s.clearBufferfv(s.COLOR,r,[t,n,i,o]):(s.clearColor(t,n,i,o),s.clear(s.COLOR_BUFFER_BIT))},e.prototype.setRenderPassParametersClearDepthStencil=function(r,t){r===void 0&&(r="load"),t===void 0&&(t="load");var n=this.gl;r!=="load"&&(Bi(!!this.currentDepthStencilAttachment),this.currentMegaState.depthWrite||(n.depthMask(!0),this.currentMegaState.depthWrite=!0),Hn(n)?n.clearBufferfv(n.DEPTH,0,[r]):(n.clearDepth(r),n.clear(n.DEPTH_BUFFER_BIT))),t!=="load"&&(Bi(!!this.currentDepthStencilAttachment),this.currentMegaState.stencilWrite||(n.enable(n.STENCIL_TEST),n.stencilMask(255),this.currentMegaState.stencilWrite=!0),Hn(n)?n.clearBufferiv(n.STENCIL,0,[t]):(n.clearStencil(t),n.clear(n.STENCIL_BUFFER_BIT)))},e.prototype.setBindings=function(r){var t,n=this.gl,i=r,o=i.uniformBufferBindings,s=i.samplerBindings,l=i.bindingLayouts;Bi(0<l.bindingLayoutTables.length);var f=l.bindingLayoutTables[0];Bi(o.length>=f.numUniformBuffers),Bi(s.length>=f.numSamplers);for(var v=0;v<o.length;v++){var y=o[v];if(y.size!==0){var b=f.firstUniformBuffer+v,T=y.buffer,M=y.offset||0,O=y.size||T.byteSize;if(T!==this.currentUniformBuffers[b]||M!==this.currentUniformBufferByteOffsets[b]||O!==this.currentUniformBufferByteSizes[b]){var F=M%T.pageByteSize,$=T.gl_buffer_pages[M/T.pageByteSize|0];Bi(F+O<=T.pageByteSize),Hn(n)&&n.bindBufferRange(n.UNIFORM_BUFFER,b,$,F,O),this.currentUniformBuffers[b]=T,this.currentUniformBufferByteOffsets[b]=M,this.currentUniformBufferByteSizes[b]=O}}}for(var v=0;v<f.numSamplers;v++){var y=s[v],G=f.firstSampler+v,ue=y!==null&&y.sampler!==null?C_(y.sampler):null,xe=y!==null&&y.texture!==null?Mv(y.texture):null;if(this.currentSamplers[G]!==ue&&(Hn(n)&&n.bindSampler(G,ue),this.currentSamplers[G]=ue),this.currentTextures[G]!==xe){if(this.setActiveTexture(n.TEXTURE0+G),xe!==null){var ze=Ad(y).texture,Je=ze.gl_target,ht=ze.width,gt=ze.height;y.texture.textureIndex=G,n.bindTexture(Je,xe),Hn(n)||(t=y.sampler)===null||t===void 0||t.setTextureParameters(Je,ht,gt),this.debugGroupStatisticsTextureBind()}else{var Ot=(0,Mn.pi)((0,Mn.pi)({},y),OE),tr=Ot.dimension,Ir=Ot.formatKind,Je=J4(tr);n.bindTexture(Je,this.getFallbackTexture((0,Mn.pi)({gl_target:Je,formatKind:Ir},Ot)))}this.currentTextures[G]=xe}}},e.prototype.setViewport=function(r,t,n,i){var o=this.gl;o.viewport(r,t,n,i)},e.prototype.setScissorRect=function(r,t,n,i){var o=this.gl;this.setScissorRectEnabled(!0),o.scissor(r,t,n,i)},e.prototype.applyAttachmentStateIndexed=function(r,t,n){var i=this.gl,o=this.OES_draw_buffers_indexed;t.channelWriteMask!==n.channelWriteMask&&(o.colorMaskiOES(r,!!(n.channelWriteMask&wu.RED),!!(n.channelWriteMask&wu.GREEN),!!(n.channelWriteMask&wu.BLUE),!!(n.channelWriteMask&wu.ALPHA)),t.channelWriteMask=n.channelWriteMask);var s=t.rgbBlendState.blendMode!==n.rgbBlendState.blendMode||t.alphaBlendState.blendMode!==n.alphaBlendState.blendMode,l=t.rgbBlendState.blendSrcFactor!==n.rgbBlendState.blendSrcFactor||t.alphaBlendState.blendSrcFactor!==n.alphaBlendState.blendSrcFactor||t.rgbBlendState.blendDstFactor!==n.rgbBlendState.blendDstFactor||t.alphaBlendState.blendDstFactor!==n.alphaBlendState.blendDstFactor;(l||s)&&(Up(t.rgbBlendState)&&Up(t.alphaBlendState)?o.enableiOES(r,i.BLEND):Up(n.rgbBlendState)&&Up(n.alphaBlendState)&&o.disableiOES(r,i.BLEND)),s&&(o.blendEquationSeparateiOES(r,n.rgbBlendState.blendMode,n.alphaBlendState.blendMode),t.rgbBlendState.blendMode=n.rgbBlendState.blendMode,t.alphaBlendState.blendMode=n.alphaBlendState.blendMode),l&&(o.blendFuncSeparateiOES(r,n.rgbBlendState.blendSrcFactor,n.rgbBlendState.blendDstFactor,n.alphaBlendState.blendSrcFactor,n.alphaBlendState.blendDstFactor),t.rgbBlendState.blendSrcFactor=n.rgbBlendState.blendSrcFactor,t.alphaBlendState.blendSrcFactor=n.alphaBlendState.blendSrcFactor,t.rgbBlendState.blendDstFactor=n.rgbBlendState.blendDstFactor,t.alphaBlendState.blendDstFactor=n.alphaBlendState.blendDstFactor)},e.prototype.applyAttachmentState=function(r,t){var n=this.gl;r.channelWriteMask!==t.channelWriteMask&&(n.colorMask(!!(t.channelWriteMask&wu.RED),!!(t.channelWriteMask&wu.GREEN),!!(t.channelWriteMask&wu.BLUE),!!(t.channelWriteMask&wu.ALPHA)),r.channelWriteMask=t.channelWriteMask);var i=r.rgbBlendState.blendMode!==t.rgbBlendState.blendMode||r.alphaBlendState.blendMode!==t.alphaBlendState.blendMode,o=r.rgbBlendState.blendSrcFactor!==t.rgbBlendState.blendSrcFactor||r.alphaBlendState.blendSrcFactor!==t.alphaBlendState.blendSrcFactor||r.rgbBlendState.blendDstFactor!==t.rgbBlendState.blendDstFactor||r.alphaBlendState.blendDstFactor!==t.alphaBlendState.blendDstFactor;(o||i)&&(Up(r.rgbBlendState)&&Up(r.alphaBlendState)?n.enable(n.BLEND):Up(t.rgbBlendState)&&Up(t.alphaBlendState)&&n.disable(n.BLEND)),i&&(n.blendEquationSeparate(t.rgbBlendState.blendMode,t.alphaBlendState.blendMode),r.rgbBlendState.blendMode=t.rgbBlendState.blendMode,r.alphaBlendState.blendMode=t.alphaBlendState.blendMode),o&&(n.blendFuncSeparate(t.rgbBlendState.blendSrcFactor,t.rgbBlendState.blendDstFactor,t.alphaBlendState.blendSrcFactor,t.alphaBlendState.blendDstFactor),r.rgbBlendState.blendSrcFactor=t.rgbBlendState.blendSrcFactor,r.alphaBlendState.blendSrcFactor=t.alphaBlendState.blendSrcFactor,r.rgbBlendState.blendDstFactor=t.rgbBlendState.blendDstFactor,r.alphaBlendState.blendDstFactor=t.alphaBlendState.blendDstFactor)},e.prototype.setMegaState=function(r){var t=this.gl,n=this.currentMegaState;if(this.OES_draw_buffers_indexed!==null)for(var i=0;i<r.attachmentsState.length;i++)this.applyAttachmentStateIndexed(i,n.attachmentsState[0],r.attachmentsState[0]);else Bi(r.attachmentsState.length===1),this.applyAttachmentState(n.attachmentsState[0],r.attachmentsState[0]);if(wE(n.blendConstant,r.blendConstant)||(t.blendColor(r.blendConstant.r,r.blendConstant.g,r.blendConstant.b,r.blendConstant.a),CE(n.blendConstant,r.blendConstant)),n.depthCompare!==r.depthCompare&&(t.depthFunc(r.depthCompare),n.depthCompare=r.depthCompare),!!n.depthWrite!=!!r.depthWrite&&(t.depthMask(r.depthWrite),n.depthWrite=r.depthWrite),!!n.stencilWrite!=!!r.stencilWrite&&(t.stencilMask(r.stencilWrite?255:0),n.stencilWrite=r.stencilWrite),!n0(n.stencilFront,r.stencilFront)){var o=r.stencilFront,s=o.passOp,l=o.failOp,f=o.depthFailOp,v=o.compare;(n.stencilFront.passOp!==s||n.stencilFront.failOp!==l||n.stencilFront.depthFailOp!==f)&&(t.stencilOpSeparate(t.FRONT,l,f,s),n.stencilFront.passOp=s,n.stencilFront.failOp=l,n.stencilFront.depthFailOp=f),n.stencilFront.compare!==v&&(this.setStencilReference(0),n.stencilFront.compare=v)}if(!n0(n.stencilBack,r.stencilBack)){var y=r.stencilBack,s=y.passOp,l=y.failOp,f=y.depthFailOp,v=y.compare;(n.stencilBack.passOp!==s||n.stencilBack.failOp!==l||n.stencilBack.depthFailOp!==f)&&(t.stencilOpSeparate(t.BACK,l,f,s),n.stencilBack.passOp=s,n.stencilBack.failOp=l,n.stencilBack.depthFailOp=f),n.stencilBack.compare!==v&&(this.setStencilReference(0),n.stencilBack.compare=v)}n.cullMode!==r.cullMode&&(n.cullMode===Wl.NONE?t.enable(t.CULL_FACE):r.cullMode===Wl.NONE&&t.disable(t.CULL_FACE),r.cullMode===Wl.BACK?t.cullFace(t.BACK):r.cullMode===Wl.FRONT?t.cullFace(t.FRONT):r.cullMode===Wl.FRONT_AND_BACK&&t.cullFace(t.FRONT_AND_BACK),n.cullMode=r.cullMode),n.frontFace!==r.frontFace&&(t.frontFace(r.frontFace),n.frontFace=r.frontFace),n.polygonOffset!==r.polygonOffset&&(r.polygonOffset?(t.polygonOffset(1,1),t.enable(t.POLYGON_OFFSET_FILL)):t.disable(t.POLYGON_OFFSET_FILL),n.polygonOffset=r.polygonOffset)},e.prototype.validatePipelineFormats=function(r){for(var t=0;t<this.currentColorAttachments.length;t++)var n=this.currentColorAttachments[t];this.currentDepthStencilAttachment&&Bi(this.currentDepthStencilAttachment.format===r.depthStencilAttachmentFormat),this.currentSampleCount!==-1&&Bi(this.currentSampleCount===r.sampleCount)},e.prototype.setPipeline=function(r){this.currentPipeline=r,this.validatePipelineFormats(this.currentPipeline),this.setMegaState(this.currentPipeline.megaState);var t=this.currentPipeline.program;if(this.useProgram(t),t.compileState===Gl.NeedsBind){var n=this.gl,i=t.gl_program,o=t.descriptor,s=VE(o.vertex.glsl,fD);if(Hn(n))for(var l=0;l<s.length;l++){var f=(0,Mn.CR)(s[l],2),v=f[1],y=n.getUniformBlockIndex(i,v);y!==-1&&y!==4294967295&&n.uniformBlockBinding(i,y,l)}for(var b=VE(o.fragment.glsl,/^uniform .*sampler\S+ (\w+);\s* \/\/ BINDING=(\d+)$/gm),l=0;l<b.length;l++){var T=(0,Mn.CR)(b[l],3),M=T[1],O=T[2],F=n.getUniformLocation(i,M);n.uniform1i(F,parseInt(O))}t.compileState=Gl.ReadyToUse}},e.prototype.setVertexInput=function(r,t,n){var i,o,s;if(r!==null){Bi(this.currentPipeline.inputLayout===r);var l=r;this.bindVAO(l.vao);for(var f=this.gl,v=0;v<l.vertexBufferDescriptors.length;v++){var y=l.vertexBufferDescriptors[v],b=y.arrayStride,T=y.attributes;try{for(var M=(i=void 0,(0,Mn.XA)(T)),O=M.next();!O.done;O=M.next()){var F=O.value,$=F.shaderLocation,G=F.offset,ue=Hn(f)?$:(s=l.program.attributes[$])===null||s===void 0?void 0:s.location;if(!(0,Bp.Z)(ue)){var xe=t[v];if(xe===null)continue;var ze=F.vertexFormat;f.bindBuffer(f.ARRAY_BUFFER,Rv(xe.buffer));var Je=(xe.offset||0)+G;f.vertexAttribPointer(ue,ze.size,ze.type,ze.normalized,b,Je)}}}catch(gt){i={error:gt}}finally{try{O&&!O.done&&(o=M.return)&&o.call(M)}finally{if(i)throw i.error}}}if(Bi(n!==null==(l.indexBufferFormat!==null)),n!==null){var ht=n.buffer;Bi(ht.usage===no.INDEX),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,Rv(ht)),this.currentIndexBufferByteOffset=n.offset||0}else this.currentIndexBufferByteOffset=null}else Bi(this.currentPipeline.inputLayout===null),Bi(n===null),this.bindVAO(null),this.currentIndexBufferByteOffset=0},e.prototype.setStencilReference=function(r){this.currentStencilRef!==r&&(this.currentStencilRef=r,this.applyStencil())},e.prototype.draw=function(r,t,n,i){var o,s=this.gl,l=this.currentPipeline;if(t){var f=[l.drawMode,n||0,r,t];Hn(s)?s.drawArraysInstanced.apply(s,(0,Mn.ev)([],(0,Mn.CR)(f),!1)):(o=this.ANGLE_instanced_arrays).drawArraysInstancedANGLE.apply(o,(0,Mn.ev)([],(0,Mn.CR)(f),!1))}else s.drawArrays(l.drawMode,n,r);this.debugGroupStatisticsDrawCall(),this.debugGroupStatisticsTriangles(r/3*Math.max(t,1))},e.prototype.drawIndexed=function(r,t,n,i,o){var s,l=this.gl,f=this.currentPipeline,v=Ad(f.inputLayout),y=Ad(this.currentIndexBufferByteOffset)+n*v.indexBufferCompByteSize;if(t){var b=[f.drawMode,r,v.indexBufferType,y,t];Hn(l)?l.drawElementsInstanced.apply(l,(0,Mn.ev)([],(0,Mn.CR)(b),!1)):(s=this.ANGLE_instanced_arrays).drawElementsInstancedANGLE.apply(s,(0,Mn.ev)([],(0,Mn.CR)(b),!1))}else l.drawElements(f.drawMode,r,v.indexBufferType,y);this.debugGroupStatisticsDrawCall(),this.debugGroupStatisticsTriangles(r/3*Math.max(t,1))},e.prototype.drawIndirect=function(r,t){},e.prototype.drawIndexedIndirect=function(r,t){},e.prototype.beginOcclusionQuery=function(r){var t=this.gl;if(Hn(t)){var n=this.currentRenderPassDescriptor.occlusionQueryPool;t.beginQuery(n.gl_query_type,n.gl_query[r])}},e.prototype.endOcclusionQuery=function(){var r=this.gl;if(Hn(r)){var t=this.currentRenderPassDescriptor.occlusionQueryPool;r.endQuery(t.gl_query_type)}},e.prototype.pipelineQueryReady=function(r){var t=r;return this.queryProgramReady(t.program)},e.prototype.pipelineForceReady=function(r){},e.prototype.endPass=function(){for(var r=this.gl,t=Hn(r),n=!1,i=0;i<this.currentColorAttachments.length;i++){var o=this.currentColorAttachments[i];if(o!==null){var s=this.currentColorResolveTos[i],l=!1;s!==null&&(Bi(o.width===s.width&&o.height===s.height),this.setScissorRectEnabled(!1),t&&r.bindFramebuffer(r.READ_FRAMEBUFFER,this.resolveColorReadFramebuffer),this.resolveColorAttachmentsChanged&&t&&this.bindFramebufferAttachment(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,o,this.currentColorAttachmentLevels[i]),l=!0,s===this.scTexture?r.bindFramebuffer(t?We.DRAW_FRAMEBUFFER:We.FRAMEBUFFER,this.scPlatformFramebuffer):(r.bindFramebuffer(t?We.DRAW_FRAMEBUFFER:We.FRAMEBUFFER,this.resolveColorDrawFramebuffer),this.resolveColorAttachmentsChanged&&r.framebufferTexture2D(t?We.DRAW_FRAMEBUFFER:We.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,s.gl_texture,this.currentColorResolveToLevels[i])),t?(r.blitFramebuffer(0,0,o.width,o.height,0,0,s.width,s.height,r.COLOR_BUFFER_BIT,r.LINEAR),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null)):this.submitBlitRenderPass(o,s),n=!0),this.currentRenderPassDescriptor.colorStore[i]||l||(r.bindFramebuffer(t?We.READ_FRAMEBUFFER:We.FRAMEBUFFER,this.resolveColorReadFramebuffer),this.resolveColorAttachmentsChanged&&this.bindFramebufferAttachment(t?We.READ_FRAMEBUFFER:We.FRAMEBUFFER,r.COLOR_ATTACHMENT0,o,this.currentColorAttachmentLevels[i])),r.bindFramebuffer(t?We.READ_FRAMEBUFFER:We.FRAMEBUFFER,null)}}this.resolveColorAttachmentsChanged=!1;var f=this.currentDepthStencilAttachment;if(f){var v=this.currentDepthStencilResolveTo,l=!1;v&&(Bi(f.width===v.width&&f.height===v.height),this.setScissorRectEnabled(!1),r.bindFramebuffer(t?We.READ_FRAMEBUFFER:We.FRAMEBUFFER,this.resolveDepthStencilReadFramebuffer),r.bindFramebuffer(t?We.DRAW_FRAMEBUFFER:We.FRAMEBUFFER,this.resolveDepthStencilDrawFramebuffer),this.resolveDepthStencilAttachmentsChanged&&(this.bindFramebufferDepthStencilAttachment(t?We.READ_FRAMEBUFFER:We.FRAMEBUFFER,f),this.bindFramebufferDepthStencilAttachment(t?We.DRAW_FRAMEBUFFER:We.FRAMEBUFFER,v)),l=!0,t&&r.blitFramebuffer(0,0,f.width,f.height,0,0,v.width,v.height,r.DEPTH_BUFFER_BIT,r.NEAREST),r.bindFramebuffer(t?We.DRAW_FRAMEBUFFER:We.FRAMEBUFFER,null),n=!0),this.currentRenderPassDescriptor.depthStencilStore||(l||(r.bindFramebuffer(t?We.READ_FRAMEBUFFER:We.FRAMEBUFFER,this.resolveDepthStencilReadFramebuffer),this.resolveDepthStencilAttachmentsChanged&&this.bindFramebufferDepthStencilAttachment(t?We.READ_FRAMEBUFFER:We.FRAMEBUFFER,f),l=!0),t&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[r.DEPTH_STENCIL_ATTACHMENT])),l&&r.bindFramebuffer(t?We.READ_FRAMEBUFFER:We.FRAMEBUFFER,null),this.resolveDepthStencilAttachmentsChanged=!1}n||r.bindFramebuffer(t?We.DRAW_FRAMEBUFFER:We.FRAMEBUFFER,null)},e.prototype.setScissorRectEnabled=function(r){if(this.currentScissorEnabled!==r){var t=this.gl;r?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),this.currentScissorEnabled=r}},e.prototype.applyStencil=function(){(0,Bp.Z)(this.currentStencilRef)||(this.gl.stencilFuncSeparate(We.FRONT,this.currentMegaState.stencilFront.compare,this.currentStencilRef,255),this.gl.stencilFuncSeparate(We.BACK,this.currentMegaState.stencilBack.compare,this.currentStencilRef,255))},e.prototype.getFallbackTexture=function(r){var t=r.gl_target,n=r.formatKind;if(t===We.TEXTURE_2D)return n===zo.Depth?this.fallbackTexture2DDepth:this.fallbackTexture2D;if(t===We.TEXTURE_2D_ARRAY)return this.fallbackTexture2DArray;if(t===We.TEXTURE_3D)return this.fallbackTexture3D;if(t===We.TEXTURE_CUBE_MAP)return this.fallbackTextureCube;throw new Error("whoops")},e.prototype.submitBlitRenderPass=function(r,t){this.blitRenderPipeline||(this.blitProgram=this.createProgram({vertex:{glsl:`layout(location = 0) in vec2 a_Position;
|
|
out vec2 v_TexCoord;
|
|
void main() {
|
|
v_TexCoord = 0.5 * (a_Position + 1.0);
|
|
gl_Position = vec4(a_Position, 0., 1.);
|
|
|
|
#ifdef VIEWPORT_ORIGIN_TL
|
|
v_TexCoord.y = 1.0 - v_TexCoord.y;
|
|
#endif
|
|
}`},fragment:{glsl:`uniform sampler2D u_Texture;
|
|
in vec2 v_TexCoord;
|
|
out vec4 outputColor;
|
|
void main() {
|
|
outputColor = texture(SAMPLER_2D(u_Texture), v_TexCoord);
|
|
}`}}),this.blitVertexBuffer=this.createBuffer({usage:no.VERTEX|no.COPY_DST,viewOrSize:new Float32Array([-4,-4,4,-4,0,4])}),this.blitInputLayout=this.createInputLayout({vertexBufferDescriptors:[{arrayStride:4*2,stepMode:Sd.VERTEX,attributes:[{format:Mt.F32_RG,offset:4*0,shaderLocation:0}]}],indexBufferFormat:null,program:this.blitProgram}),this.blitRenderPipeline=this.createRenderPipeline({topology:ms.TRIANGLES,sampleCount:1,program:this.blitProgram,colorAttachmentFormats:[Mt.U8_RGBA_RT],depthStencilAttachmentFormat:null,inputLayout:this.blitInputLayout,megaStateDescriptor:wv(Td)}),this.blitBindings=this.createBindings({samplerBindings:[{sampler:null,texture:r.texture}],uniformBufferBindings:[]}),this.blitProgram.setUniformsLegacy({u_Texture:r}));var n=this.currentRenderPassDescriptor;this.currentRenderPassDescriptor=null,this.inBlitRenderPass=!0;var i=this.createRenderPass({colorAttachment:[r],colorResolveTo:[t],colorClearColor:[d4]}),o=this.getCanvas(),s=o.width,l=o.height;i.setPipeline(this.blitRenderPipeline),i.setBindings(this.blitBindings),i.setVertexInput(this.blitInputLayout,[{buffer:this.blitVertexBuffer}],null),i.setViewport(0,0,s,l),this.gl.disable(this.gl.BLEND),i.draw(3,0),this.gl.enable(this.gl.BLEND),this.currentRenderPassDescriptor=n,this.inBlitRenderPass=!1},e}(),pD=function(){function e(r){this.pluginOptions=r}return e.prototype.createSwapChain=function(r){return(0,Mn.mG)(this,void 0,void 0,function(){var t,n,i,o,s,l,f,v,y,b,T;return(0,Mn.Jh)(this,function(M){return t=this.pluginOptions,n=t.targets,i=t.xrCompatible,o=t.antialias,s=o===void 0?!1:o,l=t.preserveDrawingBuffer,f=l===void 0?!1:l,v=t.premultipliedAlpha,y=v===void 0?!0:v,b={antialias:s,preserveDrawingBuffer:f,stencil:!0,premultipliedAlpha:y,xrCompatible:i},this.handleContextEvents(r),n.includes("webgl2")&&(T=r.getContext("webgl2",b)||r.getContext("experimental-webgl2",b)),!T&&n.includes("webgl1")&&(T=r.getContext("webgl",b)||r.getContext("experimental-webgl",b)),[2,new hD(T,{shaderDebug:!0,trackResources:!0})]})})},e.prototype.handleContextEvents=function(r){var t=this.pluginOptions,n=t.onContextLost,i=t.onContextRestored,o=t.onContextCreationError;o&&r.addEventListener("webglcontextcreationerror",o,!1),n&&r.addEventListener("webglcontextlost",n,!1),i&&r.addEventListener("webglcontextrestored",i,!1)},e}();let gs;const HE=typeof TextDecoder!="undefined"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder!="undefined"&&HE.decode();let km=null;function o0(){return(km===null||km.byteLength===0)&&(km=new Uint8Array(gs.memory.buffer)),km}function s0(e,r){return e=e>>>0,HE.decode(o0().subarray(e,e+r))}const $h=new Array(128).fill(void 0);$h.push(void 0,null,!0,!1);let Bm=$h.length;function dD(e){Bm===$h.length&&$h.push($h.length+1);const r=Bm;return Bm=$h[r],$h[r]=e,r}function u0(e){return $h[e]}function vD(e){e<132||($h[e]=Bm,Bm=e)}function mD(e){const r=u0(e);return vD(e),r}let Lm=0;const l0=typeof TextEncoder!="undefined"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},gD=typeof l0.encodeInto=="function"?function(e,r){return l0.encodeInto(e,r)}:function(e,r){const t=l0.encode(e);return r.set(t),{read:e.length,written:t.length}};function I_(e,r,t){if(t===void 0){const l=l0.encode(e),f=r(l.length,1)>>>0;return o0().subarray(f,f+l.length).set(l),Lm=l.length,f}let n=e.length,i=r(n,1)>>>0;const o=o0();let s=0;for(;s<n;s++){const l=e.charCodeAt(s);if(l>127)break;o[i+s]=l}if(s!==n){s!==0&&(e=e.slice(s)),i=t(i,n,n=s+e.length*3,1)>>>0;const l=o0().subarray(i+s,i+n),f=gD(e,l);s+=f.written}return Lm=s,i}let Nm=null;function c0(){return(Nm===null||Nm.byteLength===0)&&(Nm=new Int32Array(gs.memory.buffer)),Nm}function _D(e,r,t){let n,i;try{const l=gs.__wbindgen_add_to_stack_pointer(-16),f=I_(e,gs.__wbindgen_malloc,gs.__wbindgen_realloc),v=Lm,y=I_(r,gs.__wbindgen_malloc,gs.__wbindgen_realloc),b=Lm;gs.glsl_compile(l,f,v,y,b,t);var o=c0()[l/4+0],s=c0()[l/4+1];return n=o,i=s,s0(o,s)}finally{gs.__wbindgen_add_to_stack_pointer(16),gs.__wbindgen_free(n,i,1)}}class Um{static __wrap(r){r=r>>>0;const t=Object.create(Um.prototype);return t.__wbg_ptr=r,t}__destroy_into_raw(){const r=this.__wbg_ptr;return this.__wbg_ptr=0,r}free(){const r=this.__destroy_into_raw();gs.__wbg_wgslcomposer_free(r)}constructor(){const r=gs.wgslcomposer_new();return Um.__wrap(r)}wgsl_compile(r){let t,n;try{const s=gs.__wbindgen_add_to_stack_pointer(-16),l=I_(r,gs.__wbindgen_malloc,gs.__wbindgen_realloc),f=Lm;gs.wgslcomposer_wgsl_compile(s,this.__wbg_ptr,l,f);var i=c0()[s/4+0],o=c0()[s/4+1];return t=i,n=o,s0(i,o)}finally{gs.__wbindgen_add_to_stack_pointer(16),gs.__wbindgen_free(t,n,1)}}}function yD(e,r){return Z_(this,null,function*(){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return yield WebAssembly.instantiateStreaming(e,r)}catch(n){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}const t=yield e.arrayBuffer();return yield WebAssembly.instantiate(t,r)}else{const t=yield WebAssembly.instantiate(e,r);return t instanceof WebAssembly.Instance?{instance:t,module:e}:t}})}function xD(){const e={};return e.wbg={},e.wbg.__wbindgen_string_new=function(r,t){const n=s0(r,t);return dD(n)},e.wbg.__wbindgen_object_drop_ref=function(r){mD(r)},e.wbg.__wbg_log_1d3ae0273d8f4f8a=function(r){console.log(u0(r))},e.wbg.__wbg_log_576ca876af0d4a77=function(r,t){console.log(u0(r),u0(t))},e.wbg.__wbindgen_throw=function(r,t){throw new Error(s0(r,t))},e}function bD(e,r){return gs=e.exports,WE.__wbindgen_wasm_module=r,Nm=null,km=null,gs}function WE(e){return Z_(this,null,function*(){if(gs!==void 0)return gs;const r=xD();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:t,module:n}=yield yD(yield e,r);return bD(t,n)})}var yl;(function(e){e[e.COPY_SRC=1]="COPY_SRC",e[e.COPY_DST=2]="COPY_DST",e[e.TEXTURE_BINDING=4]="TEXTURE_BINDING",e[e.STORAGE_BINDING=8]="STORAGE_BINDING",e[e.STORAGE=8]="STORAGE",e[e.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(yl||(yl={}));var P_;(function(e){e[e.READ=1]="READ",e[e.WRITE=2]="WRITE"})(P_||(P_={}));function ED(e){var r=0;return e&Ec.SAMPLED&&(r|=yl.TEXTURE_BINDING|yl.COPY_DST),e&Ec.RENDER_TARGET&&(r|=yl.RENDER_ATTACHMENT|yl.TEXTURE_BINDING|yl.COPY_SRC|yl.COPY_DST),r}function O_(e){if(e===Mt.U8_R_NORM)return"r8unorm";if(e===Mt.U8_RG_NORM)return"rg8unorm";if(e===Mt.U8_RGBA_RT)return"bgra8unorm";if(e===Mt.U8_RGBA_RT_SRGB)return"bgra8unorm-srgb";if(e===Mt.U8_RGBA_NORM)return"rgba8unorm";if(e===Mt.U8_RGBA_SRGB)return"rgba8unorm-srgb";if(e===Mt.S8_R_NORM)return"r8snorm";if(e===Mt.S8_RG_NORM)return"rg8snorm";if(e===Mt.S8_RGBA_NORM)return"rgba8snorm";if(e===Mt.U32_R)return"r32uint";if(e===Mt.F16_RGBA)return"rgba16float";if(e===Mt.F32_RGBA)return"rgba32float";if(e===Mt.D24)return"depth24plus";if(e===Mt.D24_S8)return"depth24plus-stencil8";if(e===Mt.D32F)return"depth32float";if(e===Mt.D32F_S8)return"depth32float-stencil8";if(e===Mt.BC1)return"bc1-rgba-unorm";if(e===Mt.BC1_SRGB)return"bc1-rgba-unorm-srgb";if(e===Mt.BC2)return"bc2-rgba-unorm";if(e===Mt.BC2_SRGB)return"bc2-rgba-unorm-srgb";if(e===Mt.BC3)return"bc3-rgba-unorm";if(e===Mt.BC3_SRGB)return"bc3-rgba-unorm-srgb";if(e===Mt.BC4_SNORM)return"bc4-r-snorm";if(e===Mt.BC4_UNORM)return"bc4-r-unorm";if(e===Mt.BC5_SNORM)return"bc5-rg-snorm";if(e===Mt.BC5_UNORM)return"bc5-rg-unorm";throw"whoops"}function SD(e){if(e===Gi.TEXTURE_2D)return"2d";if(e===Gi.TEXTURE_CUBE_MAP)return"2d";if(e===Gi.TEXTURE_2D_ARRAY)return"2d";if(e===Gi.TEXTURE_3D)return"3d";throw new Error("whoops")}function AD(e){if(e===Gi.TEXTURE_2D)return"2d";if(e===Gi.TEXTURE_CUBE_MAP)return"cube";if(e===Gi.TEXTURE_2D_ARRAY)return"2d-array";if(e===Gi.TEXTURE_3D)return"3d";throw new Error("whoops")}function TD(e){var r=0;return e&no.INDEX&&(r|=GPUBufferUsage.INDEX),e&no.VERTEX&&(r|=GPUBufferUsage.VERTEX),e&no.UNIFORM&&(r|=GPUBufferUsage.UNIFORM),e&no.STORAGE&&(r|=GPUBufferUsage.STORAGE),e&no.COPY_SRC&&(r|=GPUBufferUsage.COPY_SRC),r|=GPUBufferUsage.COPY_DST,r}function D_(e){if(e===gl.CLAMP_TO_EDGE)return"clamp-to-edge";if(e===gl.REPEAT)return"repeat";if(e===gl.MIRRORED_REPEAT)return"mirror-repeat";throw new Error("whoops")}function GE(e){if(e===vs.BILINEAR)return"linear";if(e===vs.POINT)return"nearest";throw new Error("whoops")}function wD(e){if(e===Xs.LINEAR)return"linear";if(e===Xs.NEAREST)return"nearest";if(e===Xs.NO_MIP)return"nearest";throw new Error("whoops")}function Iv(e){var r=e;return r.gpuBuffer}function CD(e){var r=e;return r.gpuSampler}function RD(e){var r=e;return r.querySet}function MD(e){if(e===Kg.OcclusionConservative)return"occlusion";throw new Error("whoops")}function ID(e){switch(e){case ms.TRIANGLES:return"triangle-list";case ms.POINTS:return"point-list";case ms.TRIANGLE_STRIP:return"triangle-strip";case ms.LINES:return"line-list";case ms.LINE_STRIP:return"line-strip";default:throw new Error("Unknown primitive topology mode")}}function PD(e){if(e===Wl.NONE)return"none";if(e===Wl.FRONT)return"front";if(e===Wl.BACK)return"back";throw new Error("whoops")}function OD(e){if(e===Im.CCW)return"ccw";if(e===Im.CW)return"cw";throw new Error("whoops")}function DD(e,r){return{topology:ID(e),cullMode:PD(r.cullMode),frontFace:OD(r.frontFace)}}function XE(e){if(e===la.ZERO)return"zero";if(e===la.ONE)return"one";if(e===la.SRC)return"src";if(e===la.ONE_MINUS_SRC)return"one-minus-src";if(e===la.DST)return"dst";if(e===la.ONE_MINUS_DST)return"one-minus-dst";if(e===la.SRC_ALPHA)return"src-alpha";if(e===la.ONE_MINUS_SRC_ALPHA)return"one-minus-src-alpha";if(e===la.DST_ALPHA)return"dst-alpha";if(e===la.ONE_MINUS_DST_ALPHA)return"one-minus-dst-alpha";if(e===la.CONST)return"constant";if(e===la.ONE_MINUS_CONSTANT)return"one-minus-constant";if(e===la.SRC_ALPHA_SATURATE)return"src-alpha-saturated";throw new Error("whoops")}function FD(e){if(e===Tu.ADD)return"add";if(e===Tu.SUBSTRACT)return"subtract";if(e===Tu.REVERSE_SUBSTRACT)return"reverse-subtract";if(e===Tu.MIN)return"min";if(e===Tu.MAX)return"max";throw new Error("whoops")}function $E(e){return{operation:FD(e.blendMode),srcFactor:XE(e.blendSrcFactor),dstFactor:XE(e.blendDstFactor)}}function YE(e){return e.blendMode===Tu.ADD&&e.blendSrcFactor===la.ONE&&e.blendDstFactor===la.ZERO}function kD(e){if(!(YE(e.rgbBlendState)&&YE(e.alphaBlendState)))return{color:$E(e.rgbBlendState),alpha:$E(e.alphaBlendState)}}function BD(e,r){return{format:O_(r),blend:kD(e),writeMask:e.channelWriteMask}}function LD(e,r){return r.attachmentsState.map(function(t,n){return BD(t,e[n])})}function f0(e){if(e===_a.NEVER)return"never";if(e===_a.LESS)return"less";if(e===_a.EQUAL)return"equal";if(e===_a.LEQUAL)return"less-equal";if(e===_a.GREATER)return"greater";if(e===_a.NOTEQUAL)return"not-equal";if(e===_a.GEQUAL)return"greater-equal";if(e===_a.ALWAYS)return"always";throw new Error("whoops")}function Pv(e){if(e===qu.KEEP)return"keep";if(e===qu.REPLACE)return"replace";if(e===qu.ZERO)return"zero";if(e===qu.DECREMENT_CLAMP)return"decrement-clamp";if(e===qu.DECREMENT_WRAP)return"decrement-wrap";if(e===qu.INCREMENT_CLAMP)return"increment-clamp";if(e===qu.INCREMENT_WRAP)return"increment-wrap";if(e===qu.INVERT)return"invert";throw new Error("whoops")}function ND(e,r){if(!(0,Bp.Z)(e))return{format:O_(e),depthWriteEnabled:!!r.depthWrite,depthCompare:f0(r.depthCompare),depthBias:r.polygonOffset?1:0,depthBiasSlopeScale:r.polygonOffset?1:0,stencilFront:{compare:f0(r.stencilFront.compare),passOp:Pv(r.stencilFront.passOp),failOp:Pv(r.stencilFront.failOp),depthFailOp:Pv(r.stencilFront.depthFailOp)},stencilBack:{compare:f0(r.stencilBack.compare),passOp:Pv(r.stencilBack.passOp),failOp:Pv(r.stencilBack.failOp),depthFailOp:Pv(r.stencilBack.depthFailOp)},stencilReadMask:1,stencilWriteMask:1}}function UD(e){if(e!==null){if(e===Mt.U16_R)return"uint16";if(e===Mt.U32_R)return"uint32";throw new Error("whoops")}}function zD(e){if(e===Sd.VERTEX)return"vertex";if(e===Sd.INSTANCE)return"instance";throw new Error("whoops")}function ZD(e){if(e===Mt.U8_R)return"uint8x2";if(e===Mt.U8_RG)return"uint8x2";if(e===Mt.U8_RGB)return"uint8x4";if(e===Mt.U8_RGBA)return"uint8x4";if(e===Mt.U8_RG_NORM)return"unorm8x2";if(e===Mt.U8_RGBA_NORM)return"unorm8x4";if(e===Mt.S8_RGB_NORM)return"snorm8x4";if(e===Mt.S8_RGBA_NORM)return"snorm8x4";if(e===Mt.U16_RG_NORM)return"unorm16x2";if(e===Mt.U16_RGBA_NORM)return"unorm16x4";if(e===Mt.S16_RG_NORM)return"snorm16x2";if(e===Mt.S16_RGBA_NORM)return"snorm16x4";if(e===Mt.S16_RG)return"uint16x2";if(e===Mt.F16_RG)return"float16x2";if(e===Mt.F16_RGBA)return"float16x4";if(e===Mt.F32_R)return"float32";if(e===Mt.F32_RG)return"float32x2";if(e===Mt.F32_RGB)return"float32x3";if(e===Mt.F32_RGBA)return"float32x4";throw"whoops"}function VD(e){var r=ch(e);switch(r){case Rr.BC1:case Rr.BC2:case Rr.BC3:case Rr.BC4_SNORM:case Rr.BC4_UNORM:case Rr.BC5_SNORM:case Rr.BC5_UNORM:return!0;default:return!1}}function jD(e){var r=ch(e);switch(r){case Rr.BC1:case Rr.BC2:case Rr.BC3:case Rr.BC4_SNORM:case Rr.BC4_UNORM:case Rr.BC5_SNORM:case Rr.BC5_UNORM:return 4;default:return 1}}function qE(e,r,t,n){switch(t===void 0&&(t=!1),e){case Mt.S8_R:case Mt.S8_R_NORM:case Mt.S8_RG_NORM:case Mt.S8_RGB_NORM:case Mt.S8_RGBA_NORM:{var i=r instanceof ArrayBuffer?new Int8Array(r):new Int8Array(r);return n&&i.set(new Int8Array(n)),i}case Mt.U8_R:case Mt.U8_R_NORM:case Mt.U8_RG:case Mt.U8_RG_NORM:case Mt.U8_RGB:case Mt.U8_RGB_NORM:case Mt.U8_RGB_SRGB:case Mt.U8_RGBA:case Mt.U8_RGBA_NORM:case Mt.U8_RGBA_SRGB:{var o=r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r);return n&&o.set(new Uint8Array(n)),o}case Mt.S16_R:case Mt.S16_RG:case Mt.S16_RG_NORM:case Mt.S16_RGB_NORM:case Mt.S16_RGBA:case Mt.S16_RGBA_NORM:{var s=r instanceof ArrayBuffer?new Int16Array(r):new Int16Array(t?r/2:r);return n&&s.set(new Int16Array(n)),s}case Mt.U16_R:case Mt.U16_RGB:case Mt.U16_RGBA_5551:case Mt.U16_RGBA_NORM:case Mt.U16_RG_NORM:case Mt.U16_R_NORM:{var l=r instanceof ArrayBuffer?new Uint16Array(r):new Uint16Array(t?r/2:r);return n&&l.set(new Uint16Array(n)),l}case Mt.S32_R:{var f=r instanceof ArrayBuffer?new Int32Array(r):new Int32Array(t?r/4:r);return n&&f.set(new Int32Array(n)),f}case Mt.U32_R:case Mt.U32_RG:{var v=r instanceof ArrayBuffer?new Uint32Array(r):new Uint32Array(t?r/4:r);return n&&v.set(new Uint32Array(n)),v}case Mt.F32_R:case Mt.F32_RG:case Mt.F32_RGB:case Mt.F32_RGBA:{var y=r instanceof ArrayBuffer?new Float32Array(r):new Float32Array(t?r/4:r);return n&&y.set(new Float32Array(n)),y}}var b=r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r);return n&&b.set(new Uint8Array(n)),b}function HD(e){var r=(e&32768)>>15,t=(e&31744)>>10,n=e&1023;return t===0?(r?-1:1)*Math.pow(2,-14)*(n/Math.pow(2,10)):t==31?n?NaN:(r?-1:1)*(1/0):(r?-1:1)*Math.pow(2,t-15)*(1+n/Math.pow(2,10))}var fh=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=e.call(this)||this;return o.id=n,o.device=i,o}return r.prototype.destroy=function(){},r}(bE.Z),WD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.Bindings;var l=o.pipeline;Bi(!!l);var f=o.uniformBufferBindings,v=o.storageBufferBindings,y=o.samplerBindings;s.numUniformBuffers=(f==null?void 0:f.length)||0;var b=[[],[]],T=0;if(v&&v.length)for(var M=0;M<v.length;M++){var O=o.storageBufferBindings[M],F=O.binding,$=O.size,G=O.offset,ue=O.buffer,xe={buffer:Iv(ue),offset:G!=null?G:0,size:$};b[0].push({binding:F!=null?F:T++,resource:xe})}if(f&&f.length)for(var M=0;M<f.length;M++){var ze=o.uniformBufferBindings[M],F=ze.binding,$=ze.size,G=ze.offset,ue=ze.buffer,xe={buffer:Iv(ue),offset:G!=null?G:0,size:$};b[0].push({binding:F!=null?F:T++,resource:xe})}if(y&&y.length){T=0;for(var M=0;M<y.length;M++){var Je=(0,Mn.pi)((0,Mn.pi)({},y[M]),OE),F=o.samplerBindings[M],ht=F.texture!==null?F.texture:s.device.getFallbackTexture(Je);Je.dimension=ht.dimension,Je.formatKind=TE(ht.format);var gt=ht.gpuTextureView;b[1].push({binding:T++,resource:gt});var Ot=F.sampler!==null?F.sampler:s.device.getFallbackSampler(Je),tr=CD(Ot);b[1].push({binding:T++,resource:tr})}}return s.gpuBindGroup=b.filter(function(Ir){return Ir.length>0}).map(function(Ir,Er){return s.device.device.createBindGroup({layout:l.getBindGroupLayout(Er),entries:Ir})}),s}return r}(fh),GD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.Buffer;var l=o.usage,f=o.viewOrSize,v=!!(l&no.MAP_READ);s.usage=TD(l),v&&(s.usage=no.MAP_READ|no.COPY_DST);var y=!(0,xv.Z)(f);if(s.view=(0,xv.Z)(f)?null:f,s.size=(0,xv.Z)(f)?t0(f,4):t0(f.byteLength,4),(0,xv.Z)(f))s.gpuBuffer=s.device.device.createBuffer({usage:s.usage,size:s.size,mappedAtCreation:v?y:!1});else{s.gpuBuffer=s.device.device.createBuffer({usage:s.usage,size:s.size,mappedAtCreation:!0});var b=f&&f.constructor||Float32Array;new b(s.gpuBuffer.getMappedRange()).set(f),s.gpuBuffer.unmap()}return s}return r.prototype.setSubData=function(t,n,i,o){i===void 0&&(i=0),o===void 0&&(o=0);var s=this.gpuBuffer;o=o||n.byteLength,o=Math.min(o,this.size-t);var l=n.byteOffset+i,f=l+o,v=o+3&-4;if(v!==o){var y=new Uint8Array(n.buffer.slice(l,f));n=new Uint8Array(v),n.set(y),i=0,l=0,f=v,o=v}for(var b=1024*1024*15,T=0;f-(l+T)>b;)this.device.device.queue.writeBuffer(s,t+T,n.buffer,l+T,b),T+=b;this.device.device.queue.writeBuffer(s,t+T,n.buffer,l+T,o-T)},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.gpuBuffer.destroy()},r}(fh),XD=function(){function e(){this.commandEncoder=null,this.gpuComputePassEncoder=null}return e.prototype.dispatchWorkgroups=function(r,t,n){this.gpuComputePassEncoder.dispatchWorkgroups(r,t,n)},e.prototype.dispatchWorkgroupsIndirect=function(r,t){this.gpuComputePassEncoder.dispatchWorkgroupsIndirect(r.gpuBuffer,t)},e.prototype.finish=function(){return this.gpuComputePassEncoder.end(),this.gpuComputePassEncoder=null,this.commandEncoder.finish()},e.prototype.beginComputePass=function(){Bi(this.gpuComputePassEncoder===null),this.gpuComputePassEncoder=this.commandEncoder.beginComputePass(this.gpuComputePassDescriptor)},e.prototype.setPipeline=function(r){var t=r,n=Ad(t.gpuComputePipeline);this.gpuComputePassEncoder.setPipeline(n)},e.prototype.setBindings=function(r){var t=r;this.gpuComputePassEncoder.setBindGroup(0,t.gpuBindGroup[0])},e.prototype.pushDebugGroup=function(r){this.gpuComputePassEncoder.pushDebugGroup(r)},e.prototype.popDebugGroup=function(){this.gpuComputePassEncoder.popDebugGroup()},e.prototype.insertDebugMarker=function(r){this.gpuComputePassEncoder.insertDebugMarker(r)},e}(),$D=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.ComputePipeline,s.gpuComputePipeline=null,s.descriptor=o;var l=o.program,f=l.computeStage;if(f===null)return s;var v={layout:"auto",compute:(0,Mn.pi)({},f)};return s.gpuComputePipeline=s.device.device.createComputePipeline(v),s.name!==void 0&&(s.gpuComputePipeline.label=s.name),s}return r.prototype.getBindGroupLayout=function(t){return this.gpuComputePipeline.getBindGroupLayout(t)},r}(fh),YD=function(e){(0,Mn.ZT)(r,e);function r(t){var n,i,o,s,l=t.id,f=t.device,v=t.descriptor,y=e.call(this,{id:l,device:f})||this;y.type=ya.InputLayout;var b=[];try{for(var T=(0,Mn.XA)(v.vertexBufferDescriptors),M=T.next();!M.done;M=T.next()){var O=M.value,F=O.arrayStride,$=O.stepMode,G=O.attributes;b.push({arrayStride:F,stepMode:zD($),attributes:[]});try{for(var ue=(o=void 0,(0,Mn.XA)(G)),xe=ue.next();!xe.done;xe=ue.next()){var ze=xe.value,Je=ze.shaderLocation,ht=ze.format,gt=ze.offset;b[b.length-1].attributes.push({shaderLocation:Je,format:ZD(ht),offset:gt})}}catch(Ot){o={error:Ot}}finally{try{xe&&!xe.done&&(s=ue.return)&&s.call(ue)}finally{if(o)throw o.error}}}}catch(Ot){n={error:Ot}}finally{try{M&&!M.done&&(i=T.return)&&i.call(T)}finally{if(n)throw n.error}}return y.indexFormat=UD(v.indexBufferFormat),y.buffers=b,y}return r}(fh),KE=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;return s.type=ya.Program,s.vertexStage=null,s.fragmentStage=null,s.computeStage=null,s.descriptor=o,o.vertex&&(s.vertexStage=s.createShaderStage(o.vertex,"vertex")),o.fragment&&(s.fragmentStage=s.createShaderStage(o.fragment,"fragment")),o.compute&&(s.computeStage=s.createShaderStage(o.compute,"compute")),s}return r.prototype.setUniformsLegacy=function(t){},r.prototype.createShaderStage=function(t,n){var i,o,s=t.glsl,l=t.wgsl,f=t.entryPoint,v=!1,y=l;if(!y)try{y=this.device.glsl_compile(s,n,v)}catch($){throw console.error($,s),new Error("whoops")}var b=function($){if(!y.includes($))return"continue";y=y.replace("var T_".concat($,": texture_2d<f32>;"),"var T_".concat($,": texture_depth_2d;")),y=y.replace(new RegExp("textureSample\\(T_".concat($,"(.*)\\);$"),"gm"),function(G,ue){return"vec4<f32>(textureSample(T_".concat($).concat(ue,"), 0.0, 0.0, 0.0);")})};try{for(var T=(0,Mn.XA)(["u_TextureFramebufferDepth"]),M=T.next();!M.done;M=T.next()){var O=M.value;b(O)}}catch($){i={error:$}}finally{try{M&&!M.done&&(o=T.return)&&o.call(T)}finally{if(i)throw i.error}}var F=this.device.device.createShaderModule({code:y});return{module:F,entryPoint:f||"main"}},r}(fh),qD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=ya.QueryPool;var l=o.elemCount,f=o.type;return s.querySet=s.device.device.createQuerySet({type:MD(f),count:l}),s.resolveBuffer=s.device.device.createBuffer({size:l*8,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),s.cpuBuffer=s.device.device.createBuffer({size:l*8,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),s.results=null,s}return r.prototype.queryResultOcclusion=function(t){return this.results===null?null:this.results[t]!==BigInt(0)},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.querySet.destroy(),this.resolveBuffer.destroy(),this.cpuBuffer.destroy()},r}(fh),KD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=e.call(this,{id:n,device:i})||this;return o.type=ya.Readback,o}return r.prototype.readTexture=function(t,n,i,o,s,l,f,v){return f===void 0&&(f=0),(0,Mn.mG)(this,void 0,void 0,function(){var y,b,T,M,O,F,$,G;return(0,Mn.Jh)(this,function(ue){return y=t,b=0,T=this.getBlockInformationFromFormat(y.gpuTextureformat),M=Math.ceil(o/T.width)*T.length,O=Math.ceil(M/256)*256,F=O*s,$=this.device.createBuffer({usage:no.STORAGE|no.MAP_READ|no.COPY_DST,hint:Af.STATIC,viewOrSize:F}),G=this.device.device.createCommandEncoder(),G.copyTextureToBuffer({texture:y.gpuTexture,mipLevel:0,origin:{x:n,y:i,z:Math.max(b,0)}},{buffer:$.gpuBuffer,offset:0,bytesPerRow:O},{width:o,height:s,depthOrArrayLayers:1}),this.device.device.queue.submit([G.finish()]),[2,this.readBuffer($,0,l.byteLength===F?l:null,f,F,y.format)]})})},r.prototype.readTextureSync=function(t,n,i,o,s,l,f,v){throw new Error("ERROR_MSG_METHOD_NOT_IMPLEMENTED")},r.prototype.readBuffer=function(t,n,i,o,s,l,f,v){var y=this;n===void 0&&(n=0),i===void 0&&(i=null),s===void 0&&(s=0),l===void 0&&(l=Mt.U8_RGB),f===void 0&&(f=!1);var b=t,T=s||b.size,M=i||b.view,O=M&&M.constructor&&M.constructor.BYTES_PER_ELEMENT||AE(l),F=b;if(!(b.usage&no.MAP_READ&&b.usage&no.COPY_DST)){var $=this.device.device.createCommandEncoder();F=this.device.createBuffer({usage:no.STORAGE|no.MAP_READ|no.COPY_DST,hint:Af.STATIC,viewOrSize:T}),$.copyBufferToBuffer(b.gpuBuffer,n,F.gpuBuffer,0,T),this.device.device.queue.submit([$.finish()])}return new Promise(function(G,ue){F.gpuBuffer.mapAsync(P_.READ,n,T).then(function(){var xe=F.gpuBuffer.getMappedRange(n,T),ze=M;if(f)ze===null?ze=qE(l,T,!0,xe):ze=qE(l,ze.buffer,void 0,xe);else if(ze===null)switch(O){case 1:ze=new Uint8Array(T),ze.set(new Uint8Array(xe));break;case 2:ze=y.getHalfFloatAsFloatRGBAArrayBuffer(T/2,xe);break;case 4:ze=new Float32Array(T/4),ze.set(new Float32Array(xe));break}else switch(O){case 1:ze=new Uint8Array(ze.buffer),ze.set(new Uint8Array(xe));break;case 2:ze=y.getHalfFloatAsFloatRGBAArrayBuffer(T/2,xe,M);break;case 4:var Je=M&&M.constructor||Float32Array;ze=new Je(ze.buffer),ze.set(new Je(xe));break}F.gpuBuffer.unmap(),G(ze)},function(xe){return ue(xe)})})},r.prototype.getHalfFloatAsFloatRGBAArrayBuffer=function(t,n,i){i||(i=new Float32Array(t));for(var o=new Uint16Array(n);t--;)i[t]=HD(o[t]);return i},r.prototype.getBlockInformationFromFormat=function(t){switch(t){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":return{width:1,height:1,length:1};case"r16uint":case"r16sint":case"r16float":case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":return{width:1,height:1,length:2};case"r32uint":case"r32sint":case"r32float":case"rg16uint":case"rg16sint":case"rg16float":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb9e5ufloat":case"rgb10a2unorm":case"rg11b10ufloat":return{width:1,height:1,length:4};case"rg32uint":case"rg32sint":case"rg32float":case"rgba16uint":case"rgba16sint":case"rgba16float":return{width:1,height:1,length:8};case"rgba32uint":case"rgba32sint":case"rgba32float":return{width:1,height:1,length:16};case"stencil8":throw new Error("No fixed size for Stencil8 format!");case"depth16unorm":return{width:1,height:1,length:2};case"depth24plus":throw new Error("No fixed size for Depth24Plus format!");case"depth24plus-stencil8":throw new Error("No fixed size for Depth24PlusStencil8 format!");case"depth32float":return{width:1,height:1,length:4};case"depth32float-stencil8":return{width:1,height:1,length:5};case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc5-rg-unorm":case"bc5-rg-snorm":return{width:4,height:4,length:16};case"bc4-r-unorm":case"bc4-r-snorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":return{width:4,height:4,length:8};default:return{width:1,height:1,length:4}}},r}(fh),QD=function(){function e(r){this.device=r,this.commandEncoder=null,this.gpuRenderPassEncoder=null,this.gfxColorAttachment=[],this.gfxColorAttachmentLevel=[],this.gfxColorResolveTo=[],this.gfxColorResolveToLevel=[],this.gfxDepthStencilAttachment=null,this.gfxDepthStencilResolveTo=null,this.gpuColorAttachments=[],this.gpuDepthStencilAttachment={view:null,depthLoadOp:"load",depthStoreOp:"store",stencilLoadOp:"load",stencilStoreOp:"store"},this.gpuRenderPassDescriptor={colorAttachments:this.gpuColorAttachments,depthStencilAttachment:this.gpuDepthStencilAttachment}}return e.prototype.getTextureView=function(r,t){return Bi(t<r.mipLevelCount),r.mipLevelCount===1?r.gpuTextureView:r.gpuTexture.createView({baseMipLevel:t,mipLevelCount:1})},e.prototype.setRenderPassDescriptor=function(r){var t,n,i,o,s,l;this.descriptor=r,this.gpuRenderPassDescriptor.colorAttachments=this.gpuColorAttachments;var f=r.colorAttachment.length;this.gfxColorAttachment.length=f,this.gfxColorResolveTo.length=f;for(var v=0;v<r.colorAttachment.length;v++){var y=r.colorAttachment[v],b=r.colorResolveTo[v];if(y===null&&b!==null&&(y=b,b=null),this.gfxColorAttachment[v]=y,this.gfxColorResolveTo[v]=b,this.gfxColorAttachmentLevel[v]=((t=r.colorAttachmentLevel)===null||t===void 0?void 0:t[v])||0,this.gfxColorResolveToLevel[v]=((n=r.colorResolveToLevel)===null||n===void 0?void 0:n[v])||0,y!==null){this.gpuColorAttachments[v]===void 0&&(this.gpuColorAttachments[v]={});var T=this.gpuColorAttachments[v];T.view=this.getTextureView(y,((i=this.gfxColorAttachmentLevel)===null||i===void 0?void 0:i[v])||0);var M=(s=(o=r.colorClearColor)===null||o===void 0?void 0:o[v])!==null&&s!==void 0?s:"load";M==="load"?T.loadOp="load":(T.loadOp="clear",T.clearValue=M),T.storeOp=!((l=r.colorStore)===null||l===void 0)&&l[v]?"store":"discard",T.resolveTarget=void 0,b!==null&&(y.sampleCount>1?T.resolveTarget=this.getTextureView(b,this.gfxColorResolveToLevel[v]):T.storeOp="store")}else{this.gpuColorAttachments.length=v,this.gfxColorAttachment.length=v,this.gfxColorResolveTo.length=v;break}}if(this.gfxDepthStencilAttachment=r.depthStencilAttachment,this.gfxDepthStencilResolveTo=r.depthStencilResolveTo,r.depthStencilAttachment){var O=r.depthStencilAttachment,T=this.gpuDepthStencilAttachment;T.view=O.gpuTextureView;var F=!!(Sv(O.format)&wn.Depth);F?(r.depthClearValue==="load"?T.depthLoadOp="load":(T.depthLoadOp="clear",T.depthClearValue=r.depthClearValue),r.depthStencilStore||this.gfxDepthStencilResolveTo!==null?T.depthStoreOp="store":T.depthStoreOp="discard"):(T.depthLoadOp=void 0,T.depthStoreOp=void 0);var $=!!(Sv(O.format)&wn.Stencil);$?(r.stencilClearValue==="load"?T.stencilLoadOp="load":(T.stencilLoadOp="clear",T.stencilClearValue=r.stencilClearValue),r.depthStencilStore||this.gfxDepthStencilResolveTo!==null?T.stencilStoreOp="store":T.stencilStoreOp="discard"):(T.stencilLoadOp=void 0,T.stencilStoreOp=void 0),this.gpuRenderPassDescriptor.depthStencilAttachment=this.gpuDepthStencilAttachment}else this.gpuRenderPassDescriptor.depthStencilAttachment=void 0;this.gpuRenderPassDescriptor.occlusionQuerySet=(0,Bp.Z)(r.occlusionQueryPool)?void 0:RD(r.occlusionQueryPool)},e.prototype.beginRenderPass=function(r){Bi(this.gpuRenderPassEncoder===null),this.setRenderPassDescriptor(r),this.gpuRenderPassEncoder=this.commandEncoder.beginRenderPass(this.gpuRenderPassDescriptor)},e.prototype.flipY=function(r,t){var n=this.device.swapChainHeight;return n-r-t},e.prototype.setViewport=function(r,t,n,i,o,s){o===void 0&&(o=0),s===void 0&&(s=1),this.gpuRenderPassEncoder.setViewport(r,this.flipY(t,i),n,i,o,s)},e.prototype.setScissorRect=function(r,t,n,i){this.gpuRenderPassEncoder.setScissorRect(r,this.flipY(t,i),n,i)},e.prototype.setPipeline=function(r){var t=r,n=Ad(t.gpuRenderPipeline);this.gpuRenderPassEncoder.setPipeline(n)},e.prototype.setVertexInput=function(r,t,n){if(r!==null){var i=r;n!==null&&this.gpuRenderPassEncoder.setIndexBuffer(Iv(n.buffer),Ad(i.indexFormat),n.offset);for(var o=0;o<t.length;o++){var s=t[o];s!==null&&this.gpuRenderPassEncoder.setVertexBuffer(o,Iv(s.buffer),s.offset)}}},e.prototype.setBindings=function(r){var t=r;this.gpuRenderPassEncoder.setBindGroup(0,t.gpuBindGroup[0]),t.gpuBindGroup[1]&&this.gpuRenderPassEncoder.setBindGroup(1,t.gpuBindGroup[1])},e.prototype.setStencilReference=function(r){this.gpuRenderPassEncoder.setStencilReference(r)},e.prototype.draw=function(r,t,n,i){this.gpuRenderPassEncoder.draw(r,t,n,i)},e.prototype.drawIndexed=function(r,t,n,i,o){this.gpuRenderPassEncoder.drawIndexed(r,t,n,i,o)},e.prototype.drawIndirect=function(r,t){this.gpuRenderPassEncoder.drawIndirect(Iv(r),t)},e.prototype.drawIndexedIndirect=function(r,t){this.gpuRenderPassEncoder.drawIndexedIndirect(Iv(r),t)},e.prototype.beginOcclusionQuery=function(r){this.gpuRenderPassEncoder.beginOcclusionQuery(r)},e.prototype.endOcclusionQuery=function(){this.gpuRenderPassEncoder.endOcclusionQuery()},e.prototype.pushDebugGroup=function(r){this.gpuRenderPassEncoder.pushDebugGroup(r)},e.prototype.popDebugGroup=function(){this.gpuRenderPassEncoder.popDebugGroup()},e.prototype.insertDebugMarker=function(r){this.gpuRenderPassEncoder.insertDebugMarker(r)},e.prototype.finish=function(){this.gpuRenderPassEncoder.end(),this.gpuRenderPassEncoder=null;for(var r=0;r<this.gfxColorAttachment.length;r++){var t=this.gfxColorAttachment[r],n=this.gfxColorResolveTo[r];t!==null&&n!==null&&t.sampleCount===1&&this.copyAttachment(n,this.gfxColorAttachmentLevel[r],t,this.gfxColorResolveToLevel[r])}return this.gfxDepthStencilAttachment&&this.gfxDepthStencilResolveTo&&(this.gfxDepthStencilAttachment.sampleCount>1||this.copyAttachment(this.gfxDepthStencilResolveTo,0,this.gfxDepthStencilAttachment,0)),this.commandEncoder.finish()},e.prototype.copyAttachment=function(r,t,n,i){Bi(n.sampleCount===1);var o={texture:n.gpuTexture,mipLevel:i},s={texture:r.gpuTexture,mipLevel:t};Bi(n.width>>>i===r.width>>>t),Bi(n.height>>>i===r.height>>>t),Bi(!!(n.usage&yl.COPY_SRC)),Bi(!!(r.usage&yl.COPY_DST)),this.commandEncoder.copyTextureToTexture(o,s,[r.width,r.height,1])},e}(),JD=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=e.call(this,{id:n,device:i})||this;return s.type=ya.RenderPipeline,s.isCreatingAsync=!1,s.gpuRenderPipeline=null,s.descriptor=o,s.device.createRenderPipelineInternal(s,!1),s}return r.prototype.getBindGroupLayout=function(t){return this.gpuRenderPipeline.getBindGroupLayout(t)},r}(fh),eF=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s,l,f=e.call(this,{id:n,device:i})||this;f.type=ya.Sampler;var v=o.lodMinClamp,y=o.mipmapFilter===Xs.NO_MIP?o.lodMinClamp:o.lodMaxClamp,b=(s=o.maxAnisotropy)!==null&&s!==void 0?s:1;return b>1&&Bi(o.minFilter===vs.BILINEAR&&o.magFilter===vs.BILINEAR&&o.mipmapFilter===Xs.LINEAR),f.gpuSampler=f.device.device.createSampler({addressModeU:D_(o.addressModeU),addressModeV:D_(o.addressModeV),addressModeW:D_((l=o.addressModeW)!==null&&l!==void 0?l:o.addressModeU),lodMinClamp:v,lodMaxClamp:y,minFilter:GE(o.minFilter),magFilter:GE(o.magFilter),mipmapFilter:wD(o.mipmapFilter),compare:o.compareFunction!==void 0?f0(o.compareFunction):void 0,maxAnisotropy:b}),f}return r}(fh),h0=function(e){(0,Mn.ZT)(r,e);function r(t){var n=t.id,i=t.device,o=t.descriptor,s=t.skipCreate,l=t.sampleCount,f=e.call(this,{id:n,device:i})||this;f.type=ya.Texture;var v=o.format,y=o.dimension,b=o.width,T=o.height,M=o.depthOrArrayLayers,O=o.mipLevelCount,F=o.usage;return f.device.createTextureShared({format:v,dimension:y!=null?y:Gi.TEXTURE_2D,width:b,height:T,depthOrArrayLayers:M!=null?M:1,mipLevelCount:O!=null?O:1,usage:F,sampleCount:l!=null?l:1},f,s),f}return r.prototype.textureFromImageBitmapOrCanvas=function(t,n,i){for(var o=n[0].width,s=n[0].height,l={size:{width:o,height:s,depthOrArrayLayers:i},format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT},f=t.createTexture(l),v=0;v<n.length;v++)t.queue.copyExternalImageToTexture({source:n[v]},{texture:f,origin:[0,0,v]},[o,s]);return[f,o,s]},r.prototype.isImageBitmapOrCanvases=function(t){var n=t[0];return n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof OffscreenCanvas},r.prototype.isVideo=function(t){var n=t[0];return n instanceof HTMLVideoElement},r.prototype.setImageData=function(t,n){var i,o=this.device.device,s,l,f;this.isImageBitmapOrCanvases(t)?(i=(0,Mn.CR)(this.textureFromImageBitmapOrCanvas(o,t,this.depthOrArrayLayers),3),s=i[0],l=i[1],f=i[2]):this.isVideo(t)&&(s=o.importExternalTexture({source:t[0]})),this.width=l,this.height=f,this.gpuTexture=s,this.gpuTextureView=s.createView({dimension:AD(this.dimension)})},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.gpuTexture.destroy()},r}(fh),tF=function(){function e(r,t,n,i,o,s){this.swapChainWidth=0,this.swapChainHeight=0,this.swapChainTextureUsage=yl.RENDER_ATTACHMENT|yl.COPY_DST,this._resourceUniqueId=0,this.renderPassPool=[],this.computePassPool=[],this.featureTextureCompressionBC=!1,this.platformString="WebGPU",this.glslVersion="#version 440",this.explicitBindingLocations=!0,this.separateSamplerTextures=!0,this.viewportOrigin=bv.UPPER_LEFT,this.clipSpaceNearZ=Ev.ZERO,this.supportsSyncPipelineCompilation=!1,this.supportMRT=!0,this.device=t,this.canvas=n,this.canvasContext=i,this.glsl_compile=o,this.WGSLComposer=s,this.fallbackTexture2D=this.createFallbackTexture(Gi.TEXTURE_2D,zo.Float),this.setResourceName(this.fallbackTexture2D,"Fallback Texture2D"),this.fallbackTexture2DDepth=this.createFallbackTexture(Gi.TEXTURE_2D,zo.Depth),this.setResourceName(this.fallbackTexture2DDepth,"Fallback Depth Texture2D"),this.fallbackTexture2DArray=this.createFallbackTexture(Gi.TEXTURE_2D_ARRAY,zo.Float),this.setResourceName(this.fallbackTexture2DArray,"Fallback Texture2DArray"),this.fallbackTexture3D=this.createFallbackTexture(Gi.TEXTURE_3D,zo.Float),this.setResourceName(this.fallbackTexture3D,"Fallback Texture3D"),this.fallbackTextureCube=this.createFallbackTexture(Gi.TEXTURE_CUBE_MAP,zo.Float),this.setResourceName(this.fallbackTextureCube,"Fallback TextureCube"),this.fallbackSamplerFiltering=this.createSampler({addressModeU:gl.REPEAT,addressModeV:gl.REPEAT,minFilter:vs.POINT,magFilter:vs.POINT,mipmapFilter:Xs.NEAREST}),this.setResourceName(this.fallbackSamplerFiltering,"Fallback Sampler Filtering"),this.fallbackSamplerComparison=this.createSampler({addressModeU:gl.REPEAT,addressModeV:gl.REPEAT,minFilter:vs.POINT,magFilter:vs.POINT,mipmapFilter:Xs.NEAREST,compareFunction:_a.ALWAYS}),this.setResourceName(this.fallbackSamplerComparison,"Fallback Sampler Comparison Filtering"),this.device.features&&(this.featureTextureCompressionBC=this.device.features.has("texture-compression-bc")),this.device.onuncapturederror=function(l){console.error(l.error)},this.swapChainFormat=navigator.gpu.getPreferredCanvasFormat(),this.canvasContext.configure({device:this.device,format:this.swapChainFormat,usage:this.swapChainTextureUsage,alphaMode:"premultiplied"})}return e.prototype.destroy=function(){},e.prototype.configureSwapChain=function(r,t){this.swapChainWidth===r&&this.swapChainHeight===t||(this.swapChainWidth=r,this.swapChainHeight=t)},e.prototype.getOnscreenTexture=function(){var r=this.canvasContext.getCurrentTexture(),t=r.createView(),n=new h0({id:0,device:this,descriptor:{format:Mt.U8_RGBA_RT,width:this.swapChainWidth,height:this.swapChainHeight,depthOrArrayLayers:0,dimension:Gi.TEXTURE_2D,mipLevelCount:1,usage:this.swapChainTextureUsage},skipCreate:!0});return n.depthOrArrayLayers=1,n.sampleCount=1,n.gpuTexture=r,n.gpuTextureView=t,n.name="Onscreen",this.setResourceName(n,"Onscreen Texture"),n},e.prototype.getDevice=function(){return this},e.prototype.getCanvas=function(){return this.canvas},e.prototype.beginFrame=function(){},e.prototype.endFrame=function(){},e.prototype.getNextUniqueId=function(){return++this._resourceUniqueId},e.prototype.createBuffer=function(r){return new GD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createTexture=function(r){return new h0({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createSampler=function(r){return new eF({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderTarget=function(r){var t=new h0({id:this.getNextUniqueId(),device:this,descriptor:(0,Mn.pi)((0,Mn.pi)({},r),{dimension:Gi.TEXTURE_2D,mipLevelCount:1,depthOrArrayLayers:1,usage:Ec.RENDER_TARGET}),sampleCount:r.sampleCount});return t.depthOrArrayLayers=1,t.type=ya.RenderTarget,t},e.prototype.createRenderTargetFromTexture=function(r){var t=r,n=t.format,i=t.width,o=t.height,s=t.depthOrArrayLayers,l=t.sampleCount,f=t.mipLevelCount,v=t.gpuTexture,y=t.gpuTextureView,b=t.usage;Bi(!!(b&yl.RENDER_ATTACHMENT));var T=new h0({id:this.getNextUniqueId(),device:this,descriptor:{format:n,width:i,height:o,depthOrArrayLayers:s,dimension:Gi.TEXTURE_2D,mipLevelCount:f,usage:b},skipCreate:!0});return T.depthOrArrayLayers=s,T.sampleCount=l,T.gpuTexture=v,T.gpuTextureView=y,T},e.prototype.createProgram=function(r){var t,n;return!((t=r.vertex)===null||t===void 0)&&t.glsl&&(r.vertex.glsl=Np(this.queryVendorInfo(),"vert",r.vertex.glsl)),!((n=r.fragment)===null||n===void 0)&&n.glsl&&(r.fragment.glsl=Np(this.queryVendorInfo(),"frag",r.fragment.glsl)),new KE({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createProgramSimple=function(r){return new KE({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createTextureShared=function(r,t,n){var i={width:r.width,height:r.height,depthOrArrayLayers:r.depthOrArrayLayers},o=r.mipLevelCount,s=O_(r.format),l=SD(r.dimension),f=ED(r.usage);if(t.gpuTextureformat=s,t.dimension=r.dimension,t.format=r.format,t.width=r.width,t.height=r.height,t.depthOrArrayLayers=r.depthOrArrayLayers,t.mipLevelCount=o,t.usage=f,t.sampleCount=r.sampleCount,!n){var v=this.device.createTexture({size:i,mipLevelCount:o,format:s,dimension:l,sampleCount:r.sampleCount,usage:f}),y=v.createView();t.gpuTexture=v,t.gpuTextureView=y}},e.prototype.getFallbackSampler=function(r){var t=r.formatKind;return t===zo.Depth&&r.comparison?this.fallbackSamplerComparison:this.fallbackSamplerFiltering},e.prototype.getFallbackTexture=function(r){var t=r.dimension,n=r.formatKind;if(t===Gi.TEXTURE_2D)return n===zo.Depth?this.fallbackTexture2DDepth:this.fallbackTexture2D;if(t===Gi.TEXTURE_2D_ARRAY)return this.fallbackTexture2DArray;if(t===Gi.TEXTURE_3D)return this.fallbackTexture3D;if(t===Gi.TEXTURE_CUBE_MAP)return this.fallbackTextureCube;throw new Error("whoops")},e.prototype.createFallbackTexture=function(r,t){var n=r===Gi.TEXTURE_CUBE_MAP?6:1,i=t===zo.Float?Mt.U8_RGBA_NORM:Mt.D24;return this.createTexture({dimension:r,format:i,usage:Ec.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1})},e.prototype.createBindings=function(r){return new WD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createInputLayout=function(r){return new YD({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createComputePipeline=function(r){return new $D({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderPipeline=function(r){return new JD({id:this.getNextUniqueId(),device:this,descriptor:(0,Mn.pi)({},r)})},e.prototype.createQueryPool=function(r,t){return new qD({id:this.getNextUniqueId(),device:this,descriptor:{type:r,elemCount:t}})},e.prototype.createRenderPipelineInternal=function(r,t){var n;if(r.gpuRenderPipeline===null){var i=r.descriptor,o=i.program,s=o.vertexStage,l=o.fragmentStage;if(!(s===null||l===null)){var f=i.megaStateDescriptor||{},v=f.stencilBack,y=f.stencilFront,b=(0,Mn._T)(f,["stencilBack","stencilFront"]),T=wv(Td);i.megaStateDescriptor=(0,Mn.pi)((0,Mn.pi)((0,Mn.pi)({},T),{stencilBack:(0,Mn.pi)((0,Mn.pi)({},T.stencilBack),v),stencilFront:(0,Mn.pi)((0,Mn.pi)({},T.stencilFront),y)}),b);var M=i.megaStateDescriptor.attachmentsState[0];i.colorAttachmentFormats.forEach(function(ze,Je){i.megaStateDescriptor.attachmentsState[Je]||(i.megaStateDescriptor.attachmentsState[Je]=IE(void 0,M))});var O=DD((n=i.topology)!==null&&n!==void 0?n:ms.TRIANGLES,i.megaStateDescriptor),F=LD(i.colorAttachmentFormats,i.megaStateDescriptor),$=ND(i.depthStencilAttachmentFormat,i.megaStateDescriptor),G=void 0;i.inputLayout!==null&&(G=i.inputLayout.buffers);var ue=i.sampleCount,xe={layout:"auto",vertex:(0,Mn.pi)((0,Mn.pi)({},s),{buffers:G}),primitive:O,depthStencil:$,multisample:{count:ue},fragment:(0,Mn.pi)((0,Mn.pi)({},l),{targets:F})};r.gpuRenderPipeline=this.device.createRenderPipeline(xe)}}},e.prototype.createReadback=function(){return new KD({id:this.getNextUniqueId(),device:this})},e.prototype.createRenderPass=function(r){var t=this.renderPassPool.pop();return t===void 0&&(t=new QD(this)),t.commandEncoder=this.device.createCommandEncoder(),t.beginRenderPass(r),t},e.prototype.createComputePass=function(){var r=this.computePassPool.pop();return r===void 0&&(r=new XD),r.commandEncoder=this.device.createCommandEncoder(),r.beginComputePass(),r},e.prototype.submitPass=function(r){var t=this.device.queue,n=r,i=n.finish();t.submit([i]),n.commandEncoder=null},e.prototype.copySubTexture2D=function(r,t,n,i,o,s){var l=this.device.createCommandEncoder(),f=r,v=i,y={texture:v.gpuTexture,origin:[o,s,0]},b={texture:f.gpuTexture,origin:[t,n,0]};Bi(!!(v.usage&yl.COPY_SRC)),Bi(!!(f.usage&yl.COPY_DST)),l.copyTextureToTexture(y,b,[v.width,v.height,1]),this.device.queue.submit([l.finish()])},e.prototype.queryLimits=function(){return{uniformBufferMaxPageWordSize:this.device.limits.maxUniformBufferBindingSize>>>2,uniformBufferWordAlignment:this.device.limits.minUniformBufferOffsetAlignment>>>2,supportedSampleCounts:[1],occlusionQueriesRecommended:!0,computeShadersSupported:!0}},e.prototype.queryTextureFormatSupported=function(r,t,n){if(VD(r)){if(!this.featureTextureCompressionBC)return!1;var i=jD(r);return t%i!==0||n%i!==0?!1:this.featureTextureCompressionBC}switch(r){case Mt.U16_RGBA_NORM:return!1;case Mt.F32_RGBA:return!1}return!0},e.prototype.queryPlatformAvailable=function(){return!0},e.prototype.queryVendorInfo=function(){return this},e.prototype.queryRenderPass=function(r){var t=r;return t.descriptor},e.prototype.queryRenderTarget=function(r){var t=r;return t},e.prototype.setResourceName=function(r,t){if(r.name=t,r.type===ya.Buffer){var n=r;n.gpuBuffer.label=t}else if(r.type===ya.Texture){var n=r;n.gpuTexture.label=t,n.gpuTextureView.label=t}else if(r.type===ya.RenderTarget){var n=r;n.gpuTexture.label=t,n.gpuTextureView.label=t}else if(r.type===ya.Sampler){var n=r;n.gpuSampler.label=t}else if(r.type===ya.RenderPipeline){var n=r;n.gpuRenderPipeline!==null&&(n.gpuRenderPipeline.label=t)}},e.prototype.setResourceLeakCheck=function(r,t){},e.prototype.checkForLeaks=function(){},e.prototype.programPatched=function(r){},e.prototype.pipelineQueryReady=function(r){var t=r;return t.gpuRenderPipeline!==null},e.prototype.pipelineForceReady=function(r){var t=r;this.createRenderPipelineInternal(t,!1)},e}(),rF=function(){function e(r){this.pluginOptions=r}return e.prototype.createSwapChain=function(r){return(0,Mn.mG)(this,void 0,void 0,function(){var t,n,i,o,s,l,f,v;return(0,Mn.Jh)(this,function(y){switch(y.label){case 0:if(globalThis.navigator.gpu===void 0)return[2,null];t=null,y.label=1;case 1:return y.trys.push([1,3,,4]),n=this.pluginOptions.xrCompatible,[4,globalThis.navigator.gpu.requestAdapter({xrCompatible:n})];case 2:return t=y.sent(),[3,4];case 3:return i=y.sent(),console.log(i),[3,4];case 4:return t===null?[2,null]:(o=["depth32float-stencil8","texture-compression-bc"],s=o.filter(function(b){return t.features.has(b)}),[4,t.requestDevice({requiredFeatures:s})]);case 5:if(l=y.sent(),l&&(f=this.pluginOptions.onContextLost,l.lost.then(function(){f&&f()})),l===null)return[2,null];if(v=r.getContext("webgpu"),!v)return[2,null];y.label=6;case 6:return y.trys.push([6,8,,9]),[4,WE(this.pluginOptions.shaderCompilerPath)];case 7:return y.sent(),[3,9];case 8:return y.sent(),[3,9];case 9:return[2,new tF(t,l,r,v,_D,Um&&new Um)]}})})},e}(),nF=oi.isPlainObject,iF=oi.isTypedArray,aF=function(){function e(r,t){(0,Q.Z)(this,e),(0,B.Z)(this,"destroyed",!1),(0,B.Z)(this,"uniforms",{}),this.reGl=r;var n=t.vs,i=t.fs,o=t.attributes,s=t.uniforms,l=t.primitive,f=t.count,v=t.elements,y=t.depth,b=t.cull,T=t.instances,M={platformString:"WebGL1",glslVersion:"#version 100",explicitBindingLocations:!1,separateSamplerTextures:!1,viewportOrigin:bv.LOWER_LEFT,clipSpaceNearZ:Ev.NEGATIVE_ONE,supportMRT:!1},O={};this.options=t,s&&(this.uniforms=this.extractUniforms(s),Object.keys(s).forEach(function(G){O[G]=r.prop(G)}));var F={};Object.keys(o).forEach(function(G){F[G]=o[G].get()});var $={attributes:F,frag:om(Np(M,"frag",i,null,!1)),uniforms:O,vert:om(Np(M,"vert",n,null,!1)),colorMask:r.prop("colorMask"),lineWidth:1,blend:{enable:r.prop("blend.enable"),func:r.prop("blend.func"),equation:r.prop("blend.equation"),color:r.prop("blend.color")},stencil:{enable:r.prop("stencil.enable"),mask:r.prop("stencil.mask"),func:r.prop("stencil.func"),opFront:r.prop("stencil.opFront"),opBack:r.prop("stencil.opBack")},primitive:r4[l===void 0?R.TRIANGLES:l]};T&&($.instances=T),f?$.count=f:v&&($.elements=v.get()),this.initDepthDrawParams({depth:y},$),this.initCullDrawParams({cull:b},$),this.drawCommand=r($),this.drawParams=$}return(0,j.Z)(e,[{key:"updateAttributesAndElements",value:function(t,n){var i={};Object.keys(t).forEach(function(o){i[o]=t[o].get()}),this.drawParams.attributes=i,this.drawParams.elements=n.get(),this.drawCommand=this.reGl(this.drawParams)}},{key:"updateAttributes",value:function(t){var n={};Object.keys(t).forEach(function(i){n[i]=t[i].get()}),this.drawParams.attributes=n,this.drawCommand=this.reGl(this.drawParams)}},{key:"addUniforms",value:function(t){this.uniforms=(0,V.Z)((0,V.Z)({},this.uniforms),this.extractUniforms(t))}},{key:"draw",value:function(t,n){if(!(this.drawParams.attributes&&Object.keys(this.drawParams.attributes).length===0)){var i=(0,V.Z)((0,V.Z)({},this.uniforms),this.extractUniforms(t.uniforms||{})),o={};Object.keys(i).forEach(function(s){var l=(0,cl.Z)(i[s]);l==="boolean"||l==="number"||Array.isArray(i[s])||i[s].BYTES_PER_ELEMENT?o[s]=i[s]:o[s]=i[s].get()}),o.blend=n?this.getBlendDrawParams({blend:{enable:!1}}):this.getBlendDrawParams(t),o.stencil=this.getStencilDrawParams(t),o.colorMask=this.getColorMaskDrawParams(t,n),this.drawCommand(o)}}},{key:"destroy",value:function(){var t;(t=this.drawParams)===null||t===void 0||(t=t.elements)===null||t===void 0||t.destroy(),this.options.attributes&&Object.values(this.options.attributes).forEach(function(n){n==null||n.destroy()}),this.destroyed=!0}},{key:"initDepthDrawParams",value:function(t,n){var i=t.depth;i&&(n.depth={enable:i.enable===void 0?!0:!!i.enable,mask:i.mask===void 0?!0:!!i.mask,func:o4[i.func||R.LESS],range:i.range||[0,1]})}},{key:"getBlendDrawParams",value:function(t){var n=t.blend,i=n||{},o=i.enable,s=i.func,l=i.equation,f=i.color,v=f===void 0?[0,0,0,0]:f;return{enable:!!o,func:{srcRGB:qg[s&&s.srcRGB||R.SRC_ALPHA],srcAlpha:qg[s&&s.srcAlpha||R.SRC_ALPHA],dstRGB:qg[s&&s.dstRGB||R.ONE_MINUS_SRC_ALPHA],dstAlpha:qg[s&&s.dstAlpha||R.ONE_MINUS_SRC_ALPHA]},equation:{rgb:xE[l&&l.rgb||R.FUNC_ADD],alpha:xE[l&&l.alpha||R.FUNC_ADD]},color:v}}},{key:"getStencilDrawParams",value:function(t){var n=t.stencil,i=n||{},o=i.enable,s=i.mask,l=s===void 0?-1:s,f=i.func,v=f===void 0?{cmp:R.ALWAYS,ref:0,mask:-1}:f,y=i.opFront,b=y===void 0?{fail:R.KEEP,zfail:R.KEEP,zpass:R.KEEP}:y,T=i.opBack,M=T===void 0?{fail:R.KEEP,zfail:R.KEEP,zpass:R.KEEP}:T;return{enable:!!o,mask:l,func:(0,V.Z)((0,V.Z)({},v),{},{cmp:s4[v.cmp]}),opFront:{fail:yv[b.fail],zfail:yv[b.zfail],zpass:yv[b.zpass]},opBack:{fail:yv[M.fail],zfail:yv[M.zfail],zpass:yv[M.zpass]}}}},{key:"getColorMaskDrawParams",value:function(t,n){var i=t.stencil,o=i!=null&&i.enable&&i.opFront&&!n?[!1,!1,!1,!1]:[!0,!0,!0,!0];return o}},{key:"initCullDrawParams",value:function(t,n){var i=t.cull;if(i){var o=i.enable,s=i.face,l=s===void 0?R.BACK:s;n.cull={enable:!!o,face:u4[l]}}}},{key:"extractUniforms",value:function(t){var n=this,i={};return Object.keys(t).forEach(function(o){n.extractUniformsRecursively(o,t[o],i,"")}),i}},{key:"extractUniformsRecursively",value:function(t,n,i,o){var s=this;if(n===null||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&typeof n[0]=="number"||iF(n)||n===""||"resize"in n){i["".concat(o&&o+".").concat(t)]=n;return}nF(n)&&Object.keys(n).forEach(function(l){s.extractUniformsRecursively(l,n[l],i,"".concat(o&&o+".").concat(t))}),Array.isArray(n)&&n.forEach(function(l,f){Object.keys(l).forEach(function(v){s.extractUniformsRecursively(v,l[v],i,"".concat(o&&o+".").concat(t,"[").concat(f,"]"))})})}}]),e}(),oF=function(){function e(r,t){(0,Q.Z)(this,e),(0,B.Z)(this,"isDestroy",!1);var n=t.data,i=t.type,o=i===void 0?R.UNSIGNED_BYTE:i,s=t.width,l=t.height,f=t.flipY,v=f===void 0?!1:f,y=t.format,b=y===void 0?R.RGBA:y,T=t.mipmap,M=T===void 0?!1:T,O=t.wrapS,F=O===void 0?R.CLAMP_TO_EDGE:O,$=t.wrapT,G=$===void 0?R.CLAMP_TO_EDGE:$,ue=t.aniso,xe=ue===void 0?0:ue,ze=t.alignment,Je=ze===void 0?1:ze,ht=t.premultiplyAlpha,gt=ht===void 0?!1:ht,Ot=t.mag,tr=Ot===void 0?R.NEAREST:Ot,Ir=t.min,Er=Ir===void 0?R.NEAREST:Ir,mn=t.colorSpace,Ln=mn===void 0?R.BROWSER_DEFAULT_WEBGL:mn,Fi=t.x,xa=Fi===void 0?0:Fi,is=t.y,_s=is===void 0?0:is,as=t.copy,lu=as===void 0?!1:as;this.width=s,this.height=l;var Ac={width:s,height:l,type:S_[o],format:n4[b],wrapS:yE[F],wrapT:yE[G],mag:_E[tr],min:_E[Er],alignment:Je,flipY:v,colorSpace:a4[Ln],premultiplyAlpha:gt,aniso:xe,x:xa,y:_s,copy:lu};n&&(Ac.data=n),typeof M=="number"?Ac.mipmap=i4[M]:typeof M=="boolean"&&(Ac.mipmap=M),this.texture=r.texture(Ac)}return(0,j.Z)(e,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.texture(t)}},{key:"bind",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var n=t.width,i=t.height;this.texture.resize(n,i),this.width=n,this.height=i}},{key:"getSize",value:function(){return[this.width,this.height]}},{key:"destroy",value:function(){if(!this.isDestroy){var t;(t=this.texture)===null||t===void 0||t.destroy()}this.isDestroy=!0}}]),e}(),QE,JE,sF=(QE=(0,yt.b2)(),QE(JE=function(){function e(){var r=this;(0,Q.Z)(this,e),(0,B.Z)(this,"uniformBuffers",[]),(0,B.Z)(this,"createModel",function(t){return new aF(r.gl,t)}),(0,B.Z)(this,"createAttribute",function(t){return new t4(r.gl,t)}),(0,B.Z)(this,"createBuffer",function(t){return new l4(r.gl,t)}),(0,B.Z)(this,"createElements",function(t){return new c4(r.gl,t)}),(0,B.Z)(this,"createTexture2D",function(t){return new oF(r.gl,t)}),(0,B.Z)(this,"createFramebuffer",function(t){return new f4(r.gl,t)}),(0,B.Z)(this,"useFramebuffer",function(t,n){r.gl({framebuffer:t?t.get():null})(n)}),(0,B.Z)(this,"clear",function(t){var n,i=t.color,o=t.depth,s=t.stencil,l=t.framebuffer,f=l===void 0?null:l,v={color:i,depth:o,stencil:s};v.framebuffer=f===null?f:f.get(),(n=r.gl)===null||n===void 0||n.clear(v)}),(0,B.Z)(this,"viewport",function(t){var n=t.x,i=t.y,o=t.width,s=t.height;r.gl._gl.viewport(n,i,o,s),r.width=o,r.height=s,r.gl._refresh()}),(0,B.Z)(this,"readPixels",function(t){var n=t.framebuffer,i=t.x,o=t.y,s=t.width,l=t.height,f={x:i,y:o,width:s,height:l};return n&&(f.framebuffer=n.get()),r.gl.read(f)}),(0,B.Z)(this,"getViewportSize",function(){return{width:r.gl._gl.drawingBufferWidth,height:r.gl._gl.drawingBufferHeight}}),(0,B.Z)(this,"getContainer",function(){var t;return(t=r.canvas)===null||t===void 0?void 0:t.parentElement}),(0,B.Z)(this,"getCanvas",function(){return r.canvas}),(0,B.Z)(this,"getGLContext",function(){return r.gl._gl}),(0,B.Z)(this,"destroy",function(){var t;r.canvas=null,(t=r.gl)===null||t===void 0||(t=t._gl)===null||t===void 0||(t=t.getExtension("WEBGL_lose_context"))===null||t===void 0||t.loseContext(),r.gl.destroy(),r.gl=null})}return(0,j.Z)(e,[{key:"init",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o,s){var l=this;return ge().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(this.canvas=i,!s){v.next=5;break}this.gl=s,v.next=8;break;case 5:return v.next=7,new Promise(function(y,b){e4()({canvas:l.canvas,attributes:{alpha:!0,antialias:o.antialias,premultipliedAlpha:!0,preserveDrawingBuffer:o.preserveDrawingBuffer,stencil:o.stencil},extensions:["OES_element_index_uint","OES_standard_derivatives","ANGLE_instanced_arrays"],optionalExtensions:["oes_texture_float_linear","OES_texture_float","EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture","WEBGL_lose_context"],profile:!0,onDone:function(M,O){(M||!O)&&b(M),y(O)}})});case 7:this.gl=v.sent;case 8:this.extensionObject={OES_texture_float:this.testExtension("OES_texture_float")};case 9:case"end":return v.stop()}},n,this)}));function t(n,i,o){return r.apply(this,arguments)}return t}()},{key:"getPointSizeRange",value:function(){return this.gl._gl.getParameter(this.gl._gl.ALIASED_POINT_SIZE_RANGE)}},{key:"testExtension",value:function(t){return!!this.getGLContext().getExtension(t)}},{key:"setState",value:function(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!0,equation:"add"},framebuffer:null}),this.gl._refresh()}},{key:"setBaseState",value:function(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!1,equation:"add"},framebuffer:null}),this.gl._refresh()}},{key:"setCustomLayerDefaults",value:function(){var t=this.getGLContext();t.disable(t.CULL_FACE)}},{key:"setDirty",value:function(t){this.isDirty=t}},{key:"getDirty",value:function(){return this.isDirty}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),e}())||JE),uF=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.buffer,i=t.offset,o=t.stride,s=t.normalized,l=t.size,f=t.divisor,v=t.shaderLocation;this.buffer=n,this.attribute={shaderLocation:v,buffer:n.get(),offset:i||0,stride:o||0,normalized:s||!1,divisor:f||0},l&&(this.attribute.size=l)}return(0,j.Z)(e,[{key:"get",value:function(){return this.buffer}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),e}(),zp,Yh,Ov,zm,Zm,hh,p0,wd,Cu,d0=(zp={},(0,B.Z)(zp,R.FLOAT,Float32Array),(0,B.Z)(zp,R.UNSIGNED_BYTE,Uint8Array),(0,B.Z)(zp,R.SHORT,Int16Array),(0,B.Z)(zp,R.UNSIGNED_SHORT,Uint16Array),(0,B.Z)(zp,R.INT,Int32Array),(0,B.Z)(zp,R.UNSIGNED_INT,Uint32Array),zp),lF=(Yh={},(0,B.Z)(Yh,R.POINTS,ms.POINTS),(0,B.Z)(Yh,R.LINES,ms.LINES),(0,B.Z)(Yh,R.LINE_LOOP,ms.LINES),(0,B.Z)(Yh,R.LINE_STRIP,ms.LINE_STRIP),(0,B.Z)(Yh,R.TRIANGLES,ms.TRIANGLES),(0,B.Z)(Yh,R.TRIANGLE_FAN,ms.TRIANGLES),(0,B.Z)(Yh,R.TRIANGLE_STRIP,ms.TRIANGLE_STRIP),Yh),cF=(Ov={},(0,B.Z)(Ov,1,Mt.F32_R),(0,B.Z)(Ov,2,Mt.F32_RG),(0,B.Z)(Ov,3,Mt.F32_RGB),(0,B.Z)(Ov,4,Mt.F32_RGBA),Ov),fF=(zm={},(0,B.Z)(zm,R.STATIC_DRAW,Af.STATIC),(0,B.Z)(zm,R.DYNAMIC_DRAW,Af.DYNAMIC),(0,B.Z)(zm,R.STREAM_DRAW,Af.DYNAMIC),zm),e2=(Zm={},(0,B.Z)(Zm,R.REPEAT,gl.REPEAT),(0,B.Z)(Zm,R.CLAMP_TO_EDGE,gl.CLAMP_TO_EDGE),(0,B.Z)(Zm,R.MIRRORED_REPEAT,gl.MIRRORED_REPEAT),Zm),hF=(hh={},(0,B.Z)(hh,R.NEVER,_a.NEVER),(0,B.Z)(hh,R.ALWAYS,_a.ALWAYS),(0,B.Z)(hh,R.LESS,_a.LESS),(0,B.Z)(hh,R.LEQUAL,_a.LEQUAL),(0,B.Z)(hh,R.GREATER,_a.GREATER),(0,B.Z)(hh,R.GEQUAL,_a.GEQUAL),(0,B.Z)(hh,R.EQUAL,_a.EQUAL),(0,B.Z)(hh,R.NOTEQUAL,_a.NOTEQUAL),hh),pF=(p0={},(0,B.Z)(p0,R.FRONT,Wl.FRONT),(0,B.Z)(p0,R.BACK,Wl.BACK),p0),t2=(wd={},(0,B.Z)(wd,R.FUNC_ADD,Tu.ADD),(0,B.Z)(wd,R.MIN_EXT,Tu.MIN),(0,B.Z)(wd,R.MAX_EXT,Tu.MAX),(0,B.Z)(wd,R.FUNC_SUBTRACT,Tu.SUBSTRACT),(0,B.Z)(wd,R.FUNC_REVERSE_SUBTRACT,Tu.REVERSE_SUBSTRACT),wd),v0=(Cu={},(0,B.Z)(Cu,R.ZERO,la.ZERO),(0,B.Z)(Cu,R.ONE,la.ONE),(0,B.Z)(Cu,R.SRC_COLOR,la.SRC),(0,B.Z)(Cu,R.ONE_MINUS_SRC_COLOR,la.ONE_MINUS_SRC),(0,B.Z)(Cu,R.SRC_ALPHA,la.SRC_ALPHA),(0,B.Z)(Cu,R.ONE_MINUS_SRC_ALPHA,la.ONE_MINUS_SRC_ALPHA),(0,B.Z)(Cu,R.DST_COLOR,la.DST),(0,B.Z)(Cu,R.ONE_MINUS_DST_COLOR,la.ONE_MINUS_DST),(0,B.Z)(Cu,R.DST_ALPHA,la.DST_ALPHA),(0,B.Z)(Cu,R.ONE_MINUS_DST_ALPHA,la.ONE_MINUS_DST_ALPHA),(0,B.Z)(Cu,R.CONSTANT_COLOR,la.CONST),(0,B.Z)(Cu,R.ONE_MINUS_CONSTANT_COLOR,la.ONE_MINUS_CONSTANT),(0,B.Z)(Cu,R.CONSTANT_ALPHA,la.CONST),(0,B.Z)(Cu,R.ONE_MINUS_CONSTANT_ALPHA,la.ONE_MINUS_CONSTANT),(0,B.Z)(Cu,R.SRC_ALPHA_SATURATE,la.SRC_ALPHA_SATURATE),Cu),dF={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121};function m0(e){return Object.prototype.toString.call(e)in dF}var vF=function(){function e(r,t){(0,Q.Z)(this,e),(0,B.Z)(this,"isDestroyed",!1);var n=t.data,i=t.usage,o=t.type,s=t.isUBO,l;m0(n)?l=n:l=new d0[this.type||R.FLOAT](n),this.type=o,this.size=l.byteLength,this.buffer=r.createBuffer({viewOrSize:l,usage:s?no.UNIFORM:no.VERTEX,hint:fF[i||R.STATIC_DRAW]})}return(0,j.Z)(e,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.isDestroyed||this.buffer.destroy(),this.isDestroyed=!0}},{key:"subData",value:function(t){var n=t.data,i=t.offset,o;m0(n)?o=n:o=new d0[this.type||R.FLOAT](n),this.buffer.setSubData(i,new Uint8Array(o.buffer))}}]),e}(),mF=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.data,i=t.type,o=t.count,s=o===void 0?0:o,l;m0(n)?l=n:l=new d0[this.type||R.UNSIGNED_INT](n),this.type=i,this.count=s,this.indexBuffer=r.createBuffer({viewOrSize:l,usage:no.INDEX})}return(0,j.Z)(e,[{key:"get",value:function(){return this.indexBuffer}},{key:"subData",value:function(t){var n=t.data,i;m0(n)?i=n:i=new d0[this.type||R.UNSIGNED_INT](n),this.indexBuffer.setSubData(0,new Uint8Array(i.buffer))}},{key:"destroy",value:function(){this.indexBuffer.destroy()}}]),e}();function gF(e){return!1}var _F=function(){function e(r,t){(0,Q.Z)(this,e),(0,B.Z)(this,"isDestroy",!1);var n=t.data,i=t.type,o=i===void 0?R.UNSIGNED_BYTE:i,s=t.width,l=t.height,f=t.flipY,v=f===void 0?!1:f,y=t.format,b=y===void 0?R.RGBA:y,T=t.wrapS,M=T===void 0?R.CLAMP_TO_EDGE:T,O=t.wrapT,F=O===void 0?R.CLAMP_TO_EDGE:O,$=t.alignment,G=$===void 0?1:$;this.width=s,this.height=l;var ue=Mt.U8_RGBA_RT;if(o===R.UNSIGNED_BYTE&&b===R.RGBA)ue=Mt.U8_RGBA_RT;else if(b===R.LUMINANCE&&o===R.FLOAT)ue=Mt.F32_LUMINANCE;else if(b===R.LUMINANCE&&o===R.UNSIGNED_BYTE)ue=Mt.U8_LUMINANCE;else throw new Error("create texture error, type: ".concat(o,", format: ").concat(b));this.texture=r.createTexture({format:ue,width:s,height:l,usage:Ec.SAMPLED,pixelStore:{unpackFlipY:v,packAlignment:G}}),n&&this.texture.setImageData([n]),this.sampler=r.createSampler({addressModeU:e2[M],addressModeV:e2[F],minFilter:vs.POINT,magFilter:vs.BILINEAR,mipmapFilter:Xs.NO_MIP,lodMinClamp:0,lodMaxClamp:0})}return(0,j.Z)(e,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(t){var n=t.data;this.texture.setImageData([n])}},{key:"bind",value:function(){}},{key:"resize",value:function(t){var n=t.width,i=t.height;this.width=n,this.height=i}},{key:"getSize",value:function(){return[this.width,this.height]}},{key:"destroy",value:function(){if(!this.isDestroy){var t;(t=this.texture)===null||t===void 0||t.destroy()}this.isDestroy=!0}}]),e}(),yF=function(){function e(r,t){(0,Q.Z)(this,e),this.device=r;var n=t.width,i=t.height,o=t.color;gF(o)?(this.renderTarget=r.createRenderTargetFromTexture(o.get()),this.width=o.width,this.height=o.height):n&&i&&(this.renderTarget=r.createRenderTarget({format:Mt.U8_RGBA_RT,width:n,height:i}),this.width=n,this.height=i)}return(0,j.Z)(e,[{key:"get",value:function(){return this.renderTarget}},{key:"destroy",value:function(){this.renderTarget.destroy()}},{key:"resize",value:function(t){var n=t.width,i=t.height;(this.width!==n||this.height!==i)&&(this.renderTarget&&this.renderTarget.destroy(),this.renderTarget=this.device.createRenderTarget({format:Mt.U8_RGBA_RT,width:n,height:i}),this.width=n,this.height=i)}}]),e}(),xF=oi.isPlainObject,bF=oi.isTypedArray,EF=function(){function e(r,t){var n=this;(0,Q.Z)(this,e),(0,B.Z)(this,"destroyed",!1),(0,B.Z)(this,"uniforms",{}),(0,B.Z)(this,"vertexBuffers",[]),this.device=r,this.options=t;var i=t.vs,o=t.fs,s=t.attributes,l=t.uniforms,f=t.count,v=t.elements;this.options=t;var y=r.createProgram({vertex:{glsl:i},fragment:{glsl:o}});this.program=y,l&&(this.uniforms=this.extractUniforms(l));var b=[],T=0;Object.keys(s).forEach(function(O){var F=s[O],$=F.get();n.vertexBuffers.push($.get());var G=F.attribute,ue=G.offset,xe=ue===void 0?0:ue,ze=G.stride,Je=ze===void 0?0:ze,ht=G.size,gt=ht===void 0?1:ht,Ot=G.divisor,tr=Ot===void 0?0:Ot,Ir=G.shaderLocation,Er=Ir===void 0?0:Ir;b.push({arrayStride:Je||gt*4,stepMode:Sd.VERTEX,attributes:[{format:cF[gt],shaderLocation:Er,offset:xe,divisor:tr}]}),T=$.size/gt}),f||(this.options.count=T),v&&(this.indexBuffer=v.get());var M=r.createInputLayout({vertexBufferDescriptors:b,indexBufferFormat:v?Mt.U32_R:null,program:y});this.inputLayout=M,this.pipeline=this.createPipeline(t)}return(0,j.Z)(e,[{key:"createPipeline",value:function(t){var n=t.primitive,i=n===void 0?R.TRIANGLES:n,o=t.depth,s=t.cull,l=t.blend,f=this.initDepthDrawParams({depth:o}),v=!!(f&&f.enable),y=this.initCullDrawParams({cull:s}),b=!!(y&&y.enable),T=this.getBlendDrawParams({blend:l}),M=!!(T&&T.enable);return this.device.createRenderPipeline({inputLayout:this.inputLayout,program:this.program,topology:lF[i],colorAttachmentFormats:[Mt.U8_RGBA_RT],depthStencilAttachmentFormat:Mt.D24_S8,megaStateDescriptor:{attachmentsState:[{channelWriteMask:wu.ALL,rgbBlendState:{blendMode:M&&T.equation.rgb||Tu.ADD,blendSrcFactor:M&&T.func.srcRGB||la.SRC_ALPHA,blendDstFactor:M&&T.func.dstRGB||la.ONE_MINUS_SRC_ALPHA},alphaBlendState:{blendMode:M&&T.equation.alpha||Tu.ADD,blendSrcFactor:M&&T.func.srcAlpha||la.ONE,blendDstFactor:M&&T.func.dstAlpha||la.ONE_MINUS_SRC_ALPHA}}],blendConstant:A_,depthWrite:v,depthCompare:v&&f.func||_a.LESS,cullMode:b&&y.face||Wl.NONE,stencilWrite:!1}})}},{key:"updateAttributesAndElements",value:function(){}},{key:"updateAttributes",value:function(){}},{key:"addUniforms",value:function(t){this.uniforms=(0,V.Z)((0,V.Z)({},this.uniforms),this.extractUniforms(t))}},{key:"draw",value:function(t){var n=(0,V.Z)((0,V.Z)({},this.options),t),i=n.count,o=i===void 0?0:i,s=n.instances,l=n.elements,f=n.uniforms,v=f===void 0?{}:f,y=n.uniformBuffers,b=n.textures;this.uniforms=(0,V.Z)((0,V.Z)({},this.uniforms),this.extractUniforms(v));var T=this.device,M=T.width,O=T.height,F=this.device.renderPass;if(this.pipeline=this.createPipeline(n),F.setPipeline(this.pipeline),F.setVertexInput(this.inputLayout,this.vertexBuffers.map(function(G){return{buffer:G}}),l?{buffer:this.indexBuffer,offset:0}:null),F.setViewport(0,0,M,O),y&&(this.bindings=this.device.createBindings({pipeline:this.pipeline,uniformBufferBindings:y.map(function(G,ue){var xe=G;return{binding:ue,buffer:xe.get(),size:xe.size}}),samplerBindings:b==null?void 0:b.map(function(G){return{texture:G.texture,sampler:G.sampler}})})),this.bindings&&(F.setBindings(this.bindings),this.program.setUniformsLegacy(this.uniforms)),l){var $=l.count;$===0?F.draw(o,s):F.drawIndexed($,s)}else F.draw(o,s)}},{key:"destroy",value:function(){var t,n,i;this.program.destroy(),(t=this.vertexBuffers)===null||t===void 0||t.forEach(function(o){return o.destroy()}),(n=this.indexBuffer)===null||n===void 0||n.destroy(),(i=this.bindings)===null||i===void 0||i.destroy(),this.inputLayout.destroy(),this.pipeline.destroy(),this.destroyed=!0}},{key:"initDepthDrawParams",value:function(t){var n=t.depth;if(n)return{enable:n.enable===void 0?!0:!!n.enable,mask:n.mask===void 0?!0:!!n.mask,func:hF[n.func||R.LESS],range:n.range||[0,1]}}},{key:"getBlendDrawParams",value:function(t){var n=t.blend,i=n||{},o=i.enable,s=i.func,l=i.equation,f=i.color,v=f===void 0?[0,0,0,0]:f;return{enable:!!o,func:{srcRGB:v0[s&&s.srcRGB||R.SRC_ALPHA],srcAlpha:v0[s&&s.srcAlpha||R.SRC_ALPHA],dstRGB:v0[s&&s.dstRGB||R.ONE_MINUS_SRC_ALPHA],dstAlpha:v0[s&&s.dstAlpha||R.ONE_MINUS_SRC_ALPHA]},equation:{rgb:t2[l&&l.rgb||R.FUNC_ADD],alpha:t2[l&&l.alpha||R.FUNC_ADD]},color:v}}},{key:"initCullDrawParams",value:function(t){var n=t.cull;if(n){var i=n.enable,o=n.face,s=o===void 0?R.BACK:o;return{enable:!!i,face:pF[s]}}}},{key:"extractUniforms",value:function(t){var n=this,i={};return Object.keys(t).forEach(function(o){n.extractUniformsRecursively(o,t[o],i,"")}),i}},{key:"extractUniformsRecursively",value:function(t,n,i,o){var s=this;if(n===null||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&typeof n[0]=="number"||bF(n)||n===""||"resize"in n){i["".concat(o&&o+".").concat(t)]=n;return}xF(n)&&Object.keys(n).forEach(function(l){s.extractUniformsRecursively(l,n[l],i,"".concat(o&&o+".").concat(t))}),Array.isArray(n)&&n.forEach(function(l,f){Object.keys(l).forEach(function(v){s.extractUniformsRecursively(v,l[v],i,"".concat(o&&o+".").concat(t,"[").concat(f,"]"))})})}}]),e}();function SF(e){return typeof WebGL2RenderingContext!="undefined"&&e instanceof WebGL2RenderingContext?!0:!!(e&&e._version===2)}var r2,n2,AF=(r2=(0,yt.b2)(),r2(n2=function(){function e(){var r=this;(0,Q.Z)(this,e),(0,B.Z)(this,"uniformBuffers",[]),(0,B.Z)(this,"createModel",function(t){return new EF(r.device,t)}),(0,B.Z)(this,"createAttribute",function(t){return new uF(r.device,t)}),(0,B.Z)(this,"createBuffer",function(t){return new vF(r.device,t)}),(0,B.Z)(this,"createElements",function(t){return new mF(r.device,t)}),(0,B.Z)(this,"createTexture2D",function(t){return new _F(r.device,t)}),(0,B.Z)(this,"createFramebuffer",function(t){return new yF(r.device,t)}),(0,B.Z)(this,"useFramebuffer",function(){}),(0,B.Z)(this,"clear",function(){}),(0,B.Z)(this,"viewport",function(t){var n=t.width,i=t.height;r.width=n,r.height=i,r.device.width=n,r.device.height=i}),(0,B.Z)(this,"readPixels",function(){return new Uint8Array}),(0,B.Z)(this,"getViewportSize",function(){return{width:r.device.width,height:r.device.height}}),(0,B.Z)(this,"getContainer",function(){var t;return(t=r.canvas)===null||t===void 0?void 0:t.parentElement}),(0,B.Z)(this,"getCanvas",function(){return r.canvas}),(0,B.Z)(this,"getGLContext",function(){return r.device.gl}),(0,B.Z)(this,"destroy",function(){var t;r.canvas=null,(t=r.uniformBuffers)===null||t===void 0||t.forEach(function(n){n.destroy()}),r.device.destroy()})}return(0,j.Z)(e,[{key:"init",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o){var s,l,f,v,y,b;return ge().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return s=o.enableWebGPU,l=o.shaderCompilerPath,this.canvas=i,f=s?new rF({shaderCompilerPath:l}):new pD({targets:["webgl2","webgl1"],onContextLost:function(F){console.warn("context lost",F)},onContextCreationError:function(F){console.warn("context creation error",F)},onContextRestored:function(F){console.warn("context restored",F)}}),M.next=5,f.createSwapChain(i);case 5:v=M.sent,v.configureSwapChain(i.width,i.height),this.device=v.getDevice(),this.swapChain=v,y=this.device.gl,this.extensionObject={OES_texture_float:!SF(y)&&this.device.OES_texture_float},b=this.device.createTexture({format:Mt.U8_RGBA_RT,width:i.width,height:i.height,usage:Ec.RENDER_TARGET}),this.renderTarget=this.device.createRenderTargetFromTexture(b),this.mainDepthRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:Mt.D24_S8,width:i.width,height:i.height,usage:Ec.RENDER_TARGET}));case 14:case"end":return M.stop()}},n,this)}));function t(n,i){return r.apply(this,arguments)}return t}()},{key:"beginFrame",value:function(){var t=this.swapChain.getOnscreenTexture();this.renderPass=this.device.createRenderPass({colorAttachment:[this.renderTarget],colorResolveTo:[t],colorClearColor:[A_],depthStencilAttachment:this.mainDepthRT,depthClearValue:1}),this.device.renderPass=this.renderPass}},{key:"endFrame",value:function(){this.device.submitPass(this.renderPass)}},{key:"getPointSizeRange",value:function(){var t=this.device.gl;return t.getParameter(t.ALIASED_POINT_SIZE_RANGE)}},{key:"testExtension",value:function(t){return!!this.getGLContext().getExtension(t)}},{key:"setState",value:function(){}},{key:"setBaseState",value:function(){}},{key:"setCustomLayerDefaults",value:function(){}},{key:"setDirty",value:function(t){this.isDirty=t}},{key:"getDirty",value:function(){return this.isDirty}}]),e}())||n2);function TF(e){var r=wF();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function wF(){if(typeof Reflect=="undefined"||!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(e){return!1}}var F_=["selectstart","selecting","selectend"],CF=function(e){(0,Le.Z)(t,e);var r=TF(t);function t(n){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,Q.Z)(this,t),i=r.call(this),(0,B.Z)((0,Fe.Z)(i),"isEnable",!1),(0,B.Z)((0,Fe.Z)(i),"onDragStart",function(s){i.box.style.display="block",i.startEvent=i.endEvent=s,i.syncBoxBound(),i.emit("selectstart",i.getLngLatBox(),i.startEvent,i.endEvent)}),(0,B.Z)((0,Fe.Z)(i),"onDragging",function(s){i.endEvent=s,i.syncBoxBound(),i.emit("selecting",i.getLngLatBox(),i.startEvent,i.endEvent)}),(0,B.Z)((0,Fe.Z)(i),"onDragEnd",function(s){i.endEvent=s,i.box.style.display="none",i.emit("selectend",i.getLngLatBox(),i.startEvent,i.endEvent)}),i.scene=n,i.options=o,i}return(0,j.Z)(t,[{key:"container",get:function(){return this.scene.getMapService().getMarkerContainer()}},{key:"enable",value:function(){if(!this.isEnable){var i=this.options.className;if(this.scene.setMapStatus({dragEnable:!1}),this.container.style.cursor="crosshair",!this.box){var o=ta("div",void 0,this.container);o.classList.add("l7-select-box"),i&&o.classList.add(i),o.style.display="none",this.box=o}this.scene.on("dragstart",this.onDragStart),this.scene.on("dragging",this.onDragging),this.scene.on("dragend",this.onDragEnd),this.isEnable=!0}}},{key:"disable",value:function(){this.isEnable&&(this.scene.setMapStatus({dragEnable:!0}),this.container.style.cursor="auto",this.scene.off("dragstart",this.onDragStart),this.scene.off("dragging",this.onDragging),this.scene.off("dragend",this.onDragEnd),this.isEnable=!1)}},{key:"syncBoxBound",value:function(){var i=this.startEvent,o=i.x,s=i.y,l=this.endEvent,f=l.x,v=l.y,y=Math.min(o,f),b=Math.min(s,v),T=Math.abs(o-f),M=Math.abs(s-v);this.box.style.top="".concat(b,"px"),this.box.style.left="".concat(y,"px"),this.box.style.width="".concat(T,"px"),this.box.style.height="".concat(M,"px")}},{key:"getLngLatBox",value:function(){var i=this.startEvent.lngLat,o=i.lng,s=i.lat,l=this.endEvent.lngLat,f=l.lng,v=l.lat;return op([[o,s],[f,v]])}}]),t}(io.EventEmitter),RF=function(){function e(r){(0,Q.Z)(this,e);var t=r.id,n=r.map,i=r.canvas,o=r.hasBaseMap,s=r.renderer,l=s===void 0?"regl":s,f=xA();this.container=f,n.setContainer(f,t,i,o),f.bind(ot.IRendererService).to(l==="regl"?sF:AF).inSingletonScope(),this.sceneService=f.get(ot.ISceneService),this.mapService=f.get(ot.IMapService),this.iconService=f.get(ot.IIconService),this.fontService=f.get(ot.IFontService),this.controlService=f.get(ot.IControlService),this.layerService=f.get(ot.ILayerService),this.debugService=f.get(ot.IDebugService),this.debugService.setEnable(r.debug),this.markerService=f.get(ot.IMarkerService),this.interactionService=f.get(ot.IInteractionService),this.popupService=f.get(ot.IPopupService),this.boxSelect=new CF(this,{}),this.initComponent(t),this.sceneService.init(r),this.initControl()}return(0,j.Z)(e,[{key:"map",get:function(){return this.mapService.map}},{key:"loaded",get:function(){return this.sceneService.loaded}},{key:"getServiceContainer",value:function(){return this.container}},{key:"getSize",value:function(){return this.mapService.getSize()}},{key:"getMinZoom",value:function(){return this.mapService.getMinZoom()}},{key:"getMaxZoom",value:function(){return this.mapService.getMaxZoom()}},{key:"getType",value:function(){return this.mapService.getType()}},{key:"getMapContainer",value:function(){return this.mapService.getMapContainer()}},{key:"getMapCanvasContainer",value:function(){return this.mapService.getMapCanvasContainer()}},{key:"getMapService",value:function(){return this.mapService}},{key:"getDebugService",value:function(){return this.debugService}},{key:"exportPng",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i){return ge().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",this.sceneService.exportPng(i));case 1:case"end":return s.stop()}},n,this)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"exportMap",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i){return ge().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",this.sceneService.exportPng(i));case 1:case"end":return s.stop()}},n,this)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"registerRenderService",value:function(t){var n=this;if(this.sceneService.loaded){var i=new t(this);i.init()}else this.on("loaded",function(){var o=new t(n);o.init()})}},{key:"setBgColor",value:function(t){this.mapService.setBgColor(t)}},{key:"addLayer",value:function(t){var n=this,i=lm(this.container);if(t.setContainer(i,this.container),this.sceneService.addLayer(t),t.inited){var o=this.initMask(t);this.addMask(o,t.id)}else t.on("inited",function(){var s=n.initMask(t);n.addMask(s,t.id)})}},{key:"initMask",value:function(t){var n=t.getLayerConfig(),i=n.mask,o=n.maskfence,s=n.maskColor,l=s===void 0?"#000":s,f=n.maskOpacity,v=f===void 0?0:f;if(!(!i||!o)){var y=new ix().source(o).shape("fill").style({color:l,opacity:v});return y}}},{key:"addMask",value:function(t,n){if(t){var i=this.getLayer(n);if(i){var o=lm(this.container);t.setContainer(o,this.container),i.addMaskLayer(t),this.sceneService.addMask(t)}else console.warn("parent layer not find!")}}},{key:"getPickedLayer",value:function(){return this.layerService.pickedLayerId}},{key:"getLayers",value:function(){return this.layerService.getLayers()}},{key:"getLayer",value:function(t){return this.layerService.getLayer(t)}},{key:"getLayerByName",value:function(t){return this.layerService.getLayerByName(t)}},{key:"removeLayer",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.layerService.remove(i,o);case 2:case"end":return l.stop()}},n,this)}));function t(n,i){return r.apply(this,arguments)}return t}()},{key:"removeAllLayer",value:function(){var r=(0,Pt.Z)(ge().mark(function n(){return ge().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.layerService.removeAllLayers();case 2:case"end":return o.stop()}},n,this)}));function t(){return r.apply(this,arguments)}return t}()},{key:"render",value:function(){this.sceneService.render()}},{key:"setEnableRender",value:function(t){this.layerService.setEnableRender(t)}},{key:"addIconFont",value:function(t,n){this.fontService.addIconFont(t,n)}},{key:"addIconFonts",value:function(t){var n=this;t.forEach(function(i){var o=(0,Sn.Z)(i,2),s=o[0],l=o[1];n.fontService.addIconFont(s,l)})}},{key:"addFontFace",value:function(t,n){var i=this;this.fontService.once("fontloaded",function(o){i.emit("fontloaded",o)}),this.fontService.addFontFace(t,n)}},{key:"addImage",value:function(){var r=(0,Pt.Z)(ge().mark(function n(i,o){return ge().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.iconService.addImage(i,o);case 2:case"end":return l.stop()}},n,this)}));function t(n,i){return r.apply(this,arguments)}return t}()},{key:"hasImage",value:function(t){return this.iconService.hasImage(t)}},{key:"removeImage",value:function(t){this.iconService.removeImage(t)}},{key:"addIconFontGlyphs",value:function(t,n){this.fontService.addIconGlyphs(n)}},{key:"addControl",value:function(t){this.controlService.addControl(t,this.container)}},{key:"removeControl",value:function(t){this.controlService.removeControl(t)}},{key:"getControlByName",value:function(t){return this.controlService.getControlByName(t)}},{key:"addMarker",value:function(t){this.markerService.addMarker(t)}},{key:"addMarkerLayer",value:function(t){this.markerService.addMarkerLayer(t)}},{key:"removeMarkerLayer",value:function(t){this.markerService.removeMarkerLayer(t)}},{key:"removeAllMarkers",value:function(){this.markerService.removeAllMarkers()}},{key:"removeAllMakers",value:function(){console.warn("removeAllMakers \u5DF2\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528 removeAllMarkers"),this.markerService.removeAllMarkers()}},{key:"addPopup",value:function(t){this.popupService.addPopup(t)}},{key:"removePopup",value:function(t){this.popupService.removePopup(t)}},{key:"on",value:function(t,n){if(F_.includes(t)){var i;(i=this.boxSelect)===null||i===void 0||i.on(t,n)}else gg.includes(t)?this.sceneService.on(t,n):this.mapService.on(t,n)}},{key:"once",value:function(t,n){if(F_.includes(t)){var i;(i=this.boxSelect)===null||i===void 0||i.once(t,n)}else gg.includes(t)?this.sceneService.once(t,n):this.mapService.once(t,n)}},{key:"emit",value:function(t,n){gg.indexOf(t)===-1?this.mapService.on(t,n):this.sceneService.emit(t,n)}},{key:"off",value:function(t,n){if(F_.includes(t)){var i;(i=this.boxSelect)===null||i===void 0||i.off(t,n)}else gg.includes(t)?this.sceneService.off(t,n):this.mapService.off(t,n)}},{key:"getZoom",value:function(){return this.mapService.getZoom()}},{key:"getCenter",value:function(t){return this.mapService.getCenter(t)}},{key:"setCenter",value:function(t,n){return this.mapService.setCenter(t,n)}},{key:"getPitch",value:function(){return this.mapService.getPitch()}},{key:"setPitch",value:function(t){return this.mapService.setPitch(t)}},{key:"getRotation",value:function(){return this.mapService.getRotation()}},{key:"getBounds",value:function(){return this.mapService.getBounds()}},{key:"setRotation",value:function(t){this.mapService.setRotation(t)}},{key:"zoomIn",value:function(){this.mapService.zoomIn()}},{key:"zoomOut",value:function(){this.mapService.zoomOut()}},{key:"panTo",value:function(t){this.mapService.panTo(t)}},{key:"panBy",value:function(t,n){this.mapService.panBy(t,n)}},{key:"getContainer",value:function(){return this.mapService.getContainer()}},{key:"setZoom",value:function(t){this.mapService.setZoom(t)}},{key:"fitBounds",value:function(t,n){var i=this.sceneService.getSceneConfig(),o=i.fitBoundsOptions,s=i.animate;this.mapService.fitBounds(t,n||(0,V.Z)((0,V.Z)({},o),{},{animate:s}))}},{key:"setZoomAndCenter",value:function(t,n){this.mapService.setZoomAndCenter(t,n)}},{key:"setMapStyle",value:function(t){this.mapService.setMapStyle(t)}},{key:"setMapStatus",value:function(t){this.mapService.setMapStatus(t)}},{key:"pixelToLngLat",value:function(t){return this.mapService.pixelToLngLat(t)}},{key:"lngLatToPixel",value:function(t){return this.mapService.lngLatToPixel(t)}},{key:"containerToLngLat",value:function(t){return this.mapService.containerToLngLat(t)}},{key:"lngLatToContainer",value:function(t){return this.mapService.lngLatToContainer(t)}},{key:"destroy",value:function(){this.sceneService.destroy()}},{key:"registerPostProcessingPass",value:function(t,n){this.container.bind(ot.IPostProcessingPass).to(t).whenTargetNamed(n)}},{key:"enableShaderPick",value:function(){this.layerService.enableShaderPick()}},{key:"diasbleShaderPick",value:function(){this.layerService.disableShaderPick()}},{key:"enableBoxSelect",value:function(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.boxSelect.enable(),n&&this.boxSelect.once("selectend",function(){t.disableBoxSelect()})}},{key:"disableBoxSelect",value:function(){this.boxSelect.disable()}},{key:"getProtocol",value:function(t){return en.REGISTERED_PROTOCOLS[t]}},{key:"getPointSizeRange",value:function(){return this.sceneService.getPointSizeRange()}},{key:"initComponent",value:function(t){this.controlService.init({container:Ds(t)},this.container),this.markerService.init(this.container),this.popupService.init(this.container)}},{key:"initControl",value:function(){var t=this.sceneService.getSceneConfig(),n=t.logoVisible,i=t.logoPosition;n&&this.addControl(new t1({position:i}))}}],[{key:"addProtocol",value:function(t,n){en.REGISTERED_PROTOCOLS[t]=n}},{key:"removeProtocol",value:function(t){delete en.REGISTERED_PROTOCOLS[t]}}]),e}(),VN="2.20.5";function Vm(e){"@babel/helpers - typeof";return Vm=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},Vm(e)}function i2(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function jN(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?i2(Object(t),!0).forEach(function(n){MF(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i2(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function MF(e,r,t){return r=IF(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function IF(e){var r=PF(e,"string");return Vm(r)==="symbol"?r:String(r)}function PF(e,r){if(Vm(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Vm(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function HN(e,r){return kF(e)||FF(e,r)||DF(e,r)||OF()}function OF(){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 DF(e,r){if(e){if(typeof e=="string")return a2(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a2(e,r)}}function a2(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function FF(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,o,s,l=[],f=!0,v=!1;try{if(o=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=o.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(y){v=!0,i=y}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(v)throw i}}return l}}function kF(e){if(Array.isArray(e))return e}var WN=null,GN=null,o2,k_,s2,BF=(o2=F0(ot.IGlobalConfigService),k_=function(){function e(r){(0,Q.Z)(this,e),Ni(this,"configService",s2,this),this.config=r}return(0,j.Z)(e,[{key:"setContainer",value:function(t,n,i,o){t.bind(ot.MapConfig).toConstantValue((0,V.Z)((0,V.Z)({},this.config),{},{id:n,canvas:i,hasBaseMap:o})),t.bind(ot.IMapService).to(this.getServiceConstructor()).inSingletonScope()}},{key:"getServiceConstructor",value:function(){throw new Error("Method not implemented.")}}]),e}(),s2=ki(k_.prototype,"configService",[o2],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),k_),LF=L(80966),jm=L.n(LF),NF=function(){function e(r){(0,Q.Z)(this,e),(0,B.Z)(this,"size",1e4),this.size=r||1e4}return(0,j.Z)(e,[{key:"setSize",value:function(t){this.size=t}},{key:"getSize",value:function(){return[this.size,this.size]}},{key:"mercatorXfromLng",value:function(t){return(180+t)/360*this.size}},{key:"mercatorYfromLat",value:function(t){return(1-(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360)*this.size}},{key:"lngFromMercatorX",value:function(t){return t/this.size*360-180}},{key:"latFromMercatorY",value:function(t){var n=180-(1-t/this.size)*360;return 360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}},{key:"project",value:function(t){var n=this.mercatorXfromLng(t[0]),i=this.mercatorYfromLat(t[1]);return[n,i]}},{key:"unproject",value:function(t){var n=this.lngFromMercatorX(t[0]),i=this.latFromMercatorY(t[1]);return[n,i]}}]),e}(),UF={light:"mapbox://styles/zcxduo/ck2ypyb1r3q9o1co1766dex29",dark:"mapbox://styles/zcxduo/ck241p6413s0b1cpayzldv7x7",normal:"mapbox://styles/mapbox/streets-v11",blank:{version:8,sources:{},layers:[{id:"background",type:"background",layout:{visibility:"none"}}]}},u2,l2,c2,f2,h2,p2,Dv,d2,v2,m2,g2,_2={mapmove:"move",camerachange:"move",zoomchange:"zoom",dragging:"drag"},zF=12,ZF=(u2=(0,yt.b2)(),l2=(0,yt.f3)(ot.MapConfig),c2=(0,yt.f3)(ot.IGlobalConfigService),f2=(0,yt.f3)(ot.ICoordinateSystemService),h2=(0,yt.f3)(ot.IEventEmitter),u2(p2=(Dv=function(){function e(){var r=this;(0,Q.Z)(this,e),(0,B.Z)(this,"version","DEFAUlTMAP"),(0,B.Z)(this,"simpleMapCoord",new NF),(0,B.Z)(this,"bgColor","rgba(0.0, 0.0, 0.0, 0.0)"),Ni(this,"config",d2,this),Ni(this,"configService",v2,this),Ni(this,"coordinateSystemService",m2,this),Ni(this,"eventEmitter",g2,this),(0,B.Z)(this,"handleCameraChanged",function(t){var n=r.map.getCenter(),i=n.lat,o=n.lng;r.emit("mapchange"),r.viewport.syncWithMapCamera({bearing:r.map.getBearing(),center:[o,i],viewportHeight:r.map.transform.height,pitch:r.map.getPitch(),viewportWidth:r.map.transform.width,zoom:r.map.getZoom(),cameraHeight:0}),r.updateCoordinateSystemService(),r.cameraChangedCallback(r.viewport)})}return(0,j.Z)(e,[{key:"setBgColor",value:function(t){this.bgColor=t}},{key:"addMarkerContainer",value:function(){var t=this.map.getCanvasContainer();this.markerContainer=ta("div","l7-marker-container",t),this.markerContainer.setAttribute("tabindex","-1")}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"getOverlayContainer",value:function(){}},{key:"on",value:function(t,n){OA.indexOf(t)!==-1?this.eventEmitter.on(t,n):this.map.on(_2[t]||t,n)}},{key:"off",value:function(t,n){this.map.off(_2[t]||t,n),this.eventEmitter.off(t,n)}},{key:"getContainer",value:function(){return this.map.getContainer()}},{key:"getMapCanvasContainer",value:function(){return this.map.getCanvasContainer()}},{key:"getSize",value:function(){if(this.version==="SIMPLE")return this.simpleMapCoord.getSize();var t=this.map.transform;return[t.width,t.height]}},{key:"getType",value:function(){return"default"}},{key:"getZoom",value:function(){return this.map.getZoom()}},{key:"setZoom",value:function(t){return this.map.setZoom(t)}},{key:"getCenter",value:function(){return this.map.getCenter()}},{key:"setCenter",value:function(t){this.map.setCenter(t)}},{key:"getPitch",value:function(){return this.map.getPitch()}},{key:"getRotation",value:function(){return this.map.getBearing()}},{key:"getBounds",value:function(){return this.map.getBounds().toArray()}},{key:"getMinZoom",value:function(){return this.map.getMinZoom()}},{key:"getMaxZoom",value:function(){return this.map.getMaxZoom()}},{key:"setRotation",value:function(t){this.map.setBearing(t)}},{key:"zoomIn",value:function(t,n){this.map.zoomIn(t,n)}},{key:"zoomOut",value:function(t,n){this.map.zoomOut(t,n)}},{key:"setPitch",value:function(t){return this.map.setPitch(t)}},{key:"panTo",value:function(t){this.map.panTo(t)}},{key:"panBy",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.map.panBy([t,n])}},{key:"fitBounds",value:function(t,n){this.map.fitBounds(t,n)}},{key:"setMaxZoom",value:function(t){this.map.setMaxZoom(t)}},{key:"setMinZoom",value:function(t){this.map.setMinZoom(t)}},{key:"setMapStatus",value:function(t){t.doubleClickZoom===!0&&this.map.doubleClickZoom.enable(),t.doubleClickZoom===!1&&this.map.doubleClickZoom.disable(),t.dragEnable===!1&&this.map.dragPan.disable(),t.dragEnable===!0&&this.map.dragPan.enable(),t.rotateEnable===!1&&this.map.dragRotate.disable(),t.dragEnable===!0&&this.map.dragRotate.enable(),t.keyboardEnable===!1&&this.map.keyboard.disable(),t.keyboardEnable===!0&&this.map.keyboard.enable(),t.zoomEnable===!1&&this.map.scrollZoom.disable(),t.zoomEnable===!0&&this.map.scrollZoom.enable()}},{key:"setZoomAndCenter",value:function(t,n){this.map.flyTo({zoom:t,center:n})}},{key:"setMapStyle",value:function(t){this.map.setStyle(this.getMapStyleValue(t))}},{key:"meterToCoord",value:function(t,n){return 1}},{key:"pixelToLngLat",value:function(t){return this.map.unproject(t)}},{key:"lngLatToPixel",value:function(t){return this.map.project(t)}},{key:"containerToLngLat",value:function(t){return this.map.unproject(t)}},{key:"lngLatToContainer",value:function(t){return this.map.project(t)}},{key:"getMapStyle",value:function(){try{var t,n=(t=this.map.getStyle().sprite)!==null&&t!==void 0?t:"";return/^mapbox:\/\/sprites\/zcxduo\/\w+\/\w+$/.test(n)?n==null?void 0:n.replace(/\/\w+$/,"").replace(/sprites/,"styles"):n}catch(i){return""}}},{key:"getMapStyleConfig",value:function(){return UF}},{key:"getMapStyleValue",value:function(t){var n;return(n=this.getMapStyleConfig()[t])!==null&&n!==void 0?n:t}},{key:"destroy",value:function(){this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}},{key:"emit",value:function(t){for(var n,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];(n=this.eventEmitter).emit.apply(n,[t].concat(o))}},{key:"once",value:function(t){for(var n,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];(n=this.eventEmitter).once.apply(n,[t].concat(o))}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"exportMap",value:function(t){var n=this.map.getCanvas(),i=t==="jpg"?n==null?void 0:n.toDataURL("image/jpeg"):n==null?void 0:n.toDataURL("image/png");return i}},{key:"onCameraChanged",value:function(t){this.cameraChangedCallback=t}},{key:"creatMapContainer",value:function(t){var n=t;return typeof t=="string"&&(n=document.getElementById(t)),n}},{key:"updateView",value:function(t){this.emit("mapchange"),this.viewport.syncWithMapCamera({bearing:t.bearing,center:t.center,viewportHeight:t.viewportHeight,pitch:t.pitch,viewportWidth:t.viewportWidth,zoom:t.zoom,cameraHeight:0}),this.updateCoordinateSystemService(),this.cameraChangedCallback(this.viewport)}},{key:"updateCoordinateSystemService",value:function(){var t=this.config.offsetCoordinate,n=t===void 0?!0:t;this.viewport.getZoom()>zF&&n?this.coordinateSystemService.setCoordinateSystem(zl.LNGLAT_OFFSET):this.coordinateSystemService.setCoordinateSystem(zl.LNGLAT)}}]),e}(),d2=ki(Dv.prototype,"config",[l2],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),v2=ki(Dv.prototype,"configService",[c2],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),m2=ki(Dv.prototype,"coordinateSystemService",[f2],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g2=ki(Dv.prototype,"eventEmitter",[h2],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Dv))||p2);function Hm(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function g0(e,r){var t=Fh.fF([],r,e);return Fh.bA(t,t,1/t[3]),t}function XN(e,r){var t=e%r;return t<0?r+t:t}function $N(e,r,t){return t*r+(1-t)*e}function Cd(e,r){if(!e)throw new Error(r||"viewport-mercator-project: assertion failed.")}var wf=Math.PI,y2=wf/4,qh=wf/180,x2=180/wf,B_=512,L_=4003e4,VF=1.5;function b2(e){return Math.pow(2,e)}function jF(e){return Math.log2(e)}function _0(e,r){var t=(0,Sn.Z)(e,2),n=t[0],i=t[1];Cd(Number.isFinite(n)&&Number.isFinite(r)),Cd(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude"),r*=B_;var o=n*qh,s=i*qh,l=r*(o+wf)/(2*wf),f=r*(wf-Math.log(Math.tan(y2+s*.5)))/(2*wf);return[l,f]}function N_(e,r){var t=(0,Sn.Z)(e,2),n=t[0],i=t[1];r*=B_;var o=n/r*(2*wf)-wf,s=2*(Math.atan(Math.exp(wf-i/r*(2*wf)))-y2);return[o*x2,s*x2]}function YN(e){var r=e.latitude;assert(Number.isFinite(r));var t=Math.cos(r*qh);return jF(L_*t)-9}function E2(e){var r=e.latitude,t=e.longitude,n=e.zoom,i=e.scale,o=e.highPrecision,s=o===void 0?!1:o;i=i!==void 0?i:b2(n),Cd(Number.isFinite(r)&&Number.isFinite(t)&&Number.isFinite(i));var l={},f=B_*i,v=Math.cos(r*qh),y=f/360,b=y/v,T=f/L_/v;if(l.pixelsPerMeter=[T,-T,T],l.metersPerPixel=[1/T,-1/T,1/T],l.pixelsPerDegree=[y,-b,T],l.degreesPerPixel=[1/y,-1/b,1/T],s){var M=qh*Math.tan(r*qh)/v,O=y*M/2,F=f/L_*M,$=F/b*T;l.pixelsPerDegree2=[0,-O,F],l.pixelsPerMeter2=[$,0,$]}return l}function qN(e,r){var t=_slicedToArray(e,3),n=t[0],i=t[1],o=t[2],s=_slicedToArray(r,3),l=s[0],f=s[1],v=s[2],y=1,b=E2({longitude:n,latitude:i,scale:y,highPrecision:!0}),T=b.pixelsPerMeter,M=b.pixelsPerMeter2,O=_0(e,y);O[0]+=l*(T[0]+M[0]*f),O[1]+=f*(T[1]+M[1]*f);var F=N_(O,y),$=(o||0)+(v||0);return Number.isFinite(o)||Number.isFinite(v)?[F[0],F[1],$]:F}function HF(e){var r=e.height,t=e.pitch,n=e.bearing,i=e.altitude,o=e.center,s=o===void 0?null:o,l=e.flipY,f=l===void 0?!1:l,v=Hm();return me.translate(v,v,[0,0,-i]),me.scale(v,v,[1,1,1/r]),me.rotateX(v,v,-t*qh),me.rotateZ(v,v,n*qh),f&&me.scale(v,v,[1,-1,1]),s&&me.translate(v,v,La.negate([],s)),v}function WF(e){var r=e.width,t=e.height,n=e.altitude,i=n===void 0?VF:n,o=e.pitch,s=o===void 0?0:o,l=e.nearZMultiplier,f=l===void 0?1:l,v=e.farZMultiplier,y=v===void 0?1:v,b=s*qh,T=Math.atan(.5/i),M=Math.sin(T)*i/Math.sin(Math.PI/2-b-T),O=Math.cos(Math.PI/2-b)*M+i;return{fov:2*Math.atan(t/2/i),aspect:r/t,focalDistance:i,near:f,far:O*y}}function GF(e){var r=e.width,t=e.height,n=e.pitch,i=e.altitude,o=e.nearZMultiplier,s=e.farZMultiplier,l=WF({width:r,height:t,altitude:i,pitch:n,nearZMultiplier:o,farZMultiplier:s}),f=l.fov,v=l.aspect,y=l.near,b=l.far,T=me.perspective([],f,v,y,b);return T}function XF(e,r){var t=(0,Sn.Z)(e,3),n=t[0],i=t[1],o=t[2],s=o===void 0?0:o;return Cd(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(s)),g0(r,[n,i,s,1])}function S2(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(0,Sn.Z)(e,3),i=n[0],o=n[1],s=n[2];if(Cd(Number.isFinite(i)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(s)){var l=g0(r,[i,o,s,1]);return l}var f=g0(r,[i,o,0,1]),v=g0(r,[i,o,1,1]),y=f[2],b=v[2],T=y===b?0:((t||0)-y)/(b-y);return Or.t7([],f,v,T)}var A2=Hm(),$F=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.width,n=r.height,i=r.viewMatrix,o=i===void 0?A2:i,s=r.projectionMatrix,l=s===void 0?A2:s;(0,Q.Z)(this,e),this.width=t||1,this.height=n||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=o,this.projectionMatrix=l;var f=Hm();me.multiply(f,f,this.projectionMatrix),me.multiply(f,f,this.viewMatrix),this.viewProjectionMatrix=f;var v=Hm();me.scale(v,v,[this.width/2,-this.height/2,1]),me.translate(v,v,[1,-1,0]),me.multiply(v,v,this.viewProjectionMatrix);var y=me.invert(Hm(),v);if(!y)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=v,this.pixelUnprojectionMatrix=y,this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}return(0,j.Z)(e,[{key:"equals",value:function(t){return t instanceof e?t.width===this.width&&t.height===this.height&&me.equals(t.projectionMatrix,this.projectionMatrix)&&me.equals(t.viewMatrix,this.viewMatrix):!1}},{key:"project",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.topLeft,o=i===void 0?!0:i,s=this.projectPosition(t),l=XF(s,this.pixelProjectionMatrix),f=(0,Sn.Z)(l,2),v=f[0],y=f[1],b=o?y:this.height-y;return t.length===2?[v,b]:[v,b,l[2]]}},{key:"unproject",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.topLeft,o=i===void 0?!0:i,s=n.targetZ,l=(0,Sn.Z)(t,3),f=l[0],v=l[1],y=l[2],b=o?v:this.height-v,T=s&&s*this.pixelsPerMeter,M=S2([f,b,y],this.pixelUnprojectionMatrix,T),O=this.unprojectPosition(M),F=(0,Sn.Z)(O,3),$=F[0],G=F[1],ue=F[2];return Number.isFinite(y)?[$,G,ue]:Number.isFinite(s)?[$,G,s]:[$,G]}},{key:"projectPosition",value:function(t){var n=this.projectFlat(t),i=(0,Sn.Z)(n,2),o=i[0],s=i[1],l=(t[2]||0)*this.pixelsPerMeter;return[o,s,l]}},{key:"unprojectPosition",value:function(t){var n=this.unprojectFlat(t),i=(0,Sn.Z)(n,2),o=i[0],s=i[1],l=(t[2]||0)/this.pixelsPerMeter;return[o,s,l]}},{key:"projectFlat",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return t}},{key:"unprojectFlat",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return t}}]),e}();function YF(e){var r=e.width,t=e.height,n=e.bounds,i=e.minExtent,o=i===void 0?0:i,s=e.maxZoom,l=s===void 0?24:s,f=e.padding,v=f===void 0?0:f,y=e.offset,b=y===void 0?[0,0]:y,T=(0,Sn.Z)(n,2),M=(0,Sn.Z)(T[0],2),O=M[0],F=M[1],$=(0,Sn.Z)(T[1],2),G=$[0],ue=$[1];if(Number.isFinite(v)){var xe=v;v={top:xe,bottom:xe,left:xe,right:xe}}else Cd(Number.isFinite(v.top)&&Number.isFinite(v.bottom)&&Number.isFinite(v.left)&&Number.isFinite(v.right));var ze=new T2({width:r,height:t,longitude:0,latitude:0,zoom:0}),Je=ze.project([O,ue]),ht=ze.project([G,F]),gt=[Math.max(Math.abs(ht[0]-Je[0]),o),Math.max(Math.abs(ht[1]-Je[1]),o)],Ot=[r-v.left-v.right-Math.abs(b[0])*2,t-v.top-v.bottom-Math.abs(b[1])*2];Cd(Ot[0]>0&&Ot[1]>0);var tr=Ot[0]/gt[0],Ir=Ot[1]/gt[1],Er=(v.right-v.left)/2/tr,mn=(v.bottom-v.top)/2/Ir,Ln=[(ht[0]+Je[0])/2+Er,(ht[1]+Je[1])/2+mn],Fi=ze.unproject(Ln),xa=ze.zoom+Math.log2(Math.abs(Math.min(tr,Ir)));return{longitude:Fi[0],latitude:Fi[1],zoom:Math.min(xa,l)}}var T2=function(e){(0,Le.Z)(r,e);function r(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.width,o=n.height,s=n.latitude,l=s===void 0?0:s,f=n.longitude,v=f===void 0?0:f,y=n.zoom,b=y===void 0?0:y,T=n.pitch,M=T===void 0?0:T,O=n.bearing,F=O===void 0?0:O,$=n.altitude,G=$===void 0?1.5:$,ue=n.nearZMultiplier,xe=n.farZMultiplier;(0,Q.Z)(this,r),i=i||1,o=o||1;var ze=b2(b);G=Math.max(.75,G);var Je=_0([v,l],ze);Je[2]=0;var ht=GF({width:i,height:o,pitch:M,bearing:F,altitude:G,nearZMultiplier:ue||1/o,farZMultiplier:xe||1.01}),gt=HF({height:o,center:Je,pitch:M,bearing:F,altitude:G,flipY:!0});return t=(0,at.Z)(this,(0,Ee.Z)(r).call(this,{width:i,height:o,viewMatrix:gt,projectionMatrix:ht})),t.latitude=l,t.longitude=v,t.zoom=b,t.pitch=M,t.bearing=F,t.altitude=G,t.scale=ze,t.center=Je,t.pixelsPerMeter=E2((0,Fe.Z)((0,Fe.Z)(t))).pixelsPerMeter[2],Object.freeze((0,Fe.Z)((0,Fe.Z)(t))),t}return(0,j.Z)(r,[{key:"projectFlat",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return _0(n,i)}},{key:"unprojectFlat",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return N_(n,i)}},{key:"getMapCenterByLngLatPosition",value:function(n){var i=n.lngLat,o=n.pos,s=S2(o,this.pixelUnprojectionMatrix),l=_0(i,this.scale),f=Or.IH([],l,Or.tk([],s)),v=Or.IH([],this.center,f);return N_(v,this.scale)}},{key:"getLocationAtPoint",value:function(n){var i=n.lngLat,o=n.pos;return this.getMapCenterByLngLatPosition({lngLat:i,pos:o})}},{key:"fitBounds",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.width,s=this.height,l=YF(Object.assign({width:o,height:s,bounds:n},i)),f=l.longitude,v=l.latitude,y=l.zoom;return new r({width:o,height:s,longitude:f,latitude:v,zoom:y})}}]),r}($F),qF=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"syncWithMapCamera",value:function(t){var n=t.center,i=t.zoom,o=t.pitch,s=t.bearing,l=t.viewportHeight,f=t.viewportWidth;this.viewport=new T2({width:f,height:l,longitude:n&&n[0],latitude:n&&n[1],zoom:i,pitch:o,bearing:s})}},{key:"getZoom",value:function(){return this.viewport.zoom}},{key:"getZoomScale",value:function(){return Math.pow(2,this.getZoom())}},{key:"getCenter",value:function(){return[this.viewport.longitude,this.viewport.latitude]}},{key:"getProjectionMatrix",value:function(){return this.viewport.projectionMatrix}},{key:"getModelMatrix",value:function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}},{key:"getViewMatrix",value:function(){return this.viewport.viewMatrix}},{key:"getViewMatrixUncentered",value:function(){return this.viewport.viewMatrixUncentered}},{key:"getViewProjectionMatrix",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewport.viewProjectionMatrix}},{key:"getFocalDistance",value:function(){return 1}},{key:"projectFlat",value:function(t,n){return this.viewport.projectFlat(t,n)}}]),e}(),KF=["id","attributionControl","style","token","rotation","mapInstance"],w2,C2;function QF(e){var r=JF();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function JF(){if(typeof Reflect=="undefined"||!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(e){return!1}}function ek(e,r){var t=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(t||n)&&(r||(r=document),!!r)){var i=r.head||r.getElementsByTagName("head")[0];if(!i){i=r.createElement("head");var o=r.body||r.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):r.documentElement.appendChild(i)}var s=r.createElement("style");return s.type="text/css",s.styleSheet?s.styleSheet.cssText=e:s.appendChild(r.createTextNode(e)),i.appendChild(s),s}}ek(`.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{-ms-touch-action:pinch-zoom;touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{-ms-touch-action:none;touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;-webkit-transform:translate(0);transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){-webkit-box-shadow:0 0 0 2px ButtonText;box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{-webkit-box-shadow:0 0 2px 2px #0096ff;box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{-webkit-box-shadow:0 0 2px 2px #0096ff;box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){-webkit-box-shadow:none;box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;-webkit-box-sizing:border-box;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-box;display:-ms-flexbox;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.1);box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:-webkit-box;display:-ms-flexbox;display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:"";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 0 3px rgba(0,0,0,.35);box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);transform:scale(3);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}`),window.mapboxgl=jm();var tk=0,R2="101MlGsZ2AmmA&access_token=pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p0MG01MXRqMW45cjQzb2R6b2ptc3J4MSJ9.zA2W0IkI0c6KaAhJfk9bWg",rk=(w2=(0,yt.b2)(),w2(C2=function(e){(0,Le.Z)(t,e);var r=QF(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r.call.apply(r,[this].concat(o)),(0,B.Z)((0,Fe.Z)(n),"version","MAPBOX"),n}return(0,j.Z)(t,[{key:"getType",value:function(){return"mapbox"}},{key:"lngLatToCoord",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{x:0,y:0,z:0},s=this.lngLatToMercator(i,0),l=s.x,f=s.y;return[l-o.x,f-o.y]}},{key:"lngLatToMercator",value:function(i,o){var s=window.mapboxgl.MercatorCoordinate.fromLngLat(i,o),l=s.x,f=l===void 0?0:l,v=s.y,y=v===void 0?0:v,b=s.z,T=b===void 0?0:b;return{x:f,y,z:T}}},{key:"getModelMatrix",value:function(i,o,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[1,1,1],f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{x:0,y:0,z:0},v=window.mapboxgl.MercatorCoordinate.fromLngLat(i,o),y=v.meterInMercatorCoordinateUnits(),b=me.create();return me.translate(b,b,La.fromValues(v.x-f.x,v.y-f.y,v.z||0-f.z)),me.scale(b,b,La.fromValues(y*l[0],-y*l[1],y*l[2])),me.rotateX(b,b,s[0]),me.rotateY(b,b,s[1]),me.rotateZ(b,b,s[2]),b}},{key:"init",value:function(){var n=(0,Pt.Z)(ge().mark(function o(){var s=this,l,f,v,y,b,T,M,O,F,$,G,ue,xe;return ge().wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:l=this.config,f=l.id,v=f===void 0?"map":f,y=l.attributionControl,b=y===void 0?!1:y,T=l.style,M=T===void 0?"light":T,O=l.token,F=O===void 0?R2:O,$=l.rotation,G=$===void 0?0:$,ue=l.mapInstance,xe=(0,ka.Z)(l,KF),this.viewport=new qF,!ue&&!window.mapboxgl&&console.error(this.configService.getSceneWarninfo("SDK")),F===R2&&M!=="blank"&&!window.mapboxgl.accessToken&&!ue&&console.warn(this.configService.getSceneWarninfo("MapToken")),!ue&&!window.mapboxgl.accessToken&&(window.mapboxgl.accessToken=F),ue?(this.map=ue,this.$mapContainer=this.map.getContainer()):(this.$mapContainer=this.creatMapContainer(v),this.map=new window.mapboxgl.Map((0,V.Z)({container:this.$mapContainer,style:this.getMapStyleValue(M),attributionControl:b,bearing:G},xe))),this.map.on("load",function(){s.handleCameraChanged()}),this.map.on("move",this.handleCameraChanged),this.handleCameraChanged();case 9:case"end":return Je.stop()}},o,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"destroy",value:function(){var i;(i=this.$mapContainer)===null||i===void 0||(i=i.parentNode)===null||i===void 0||i.removeChild(this.$mapContainer),this.eventEmitter.removeAllListeners(),this.map&&(this.map.remove(),this.$mapContainer=null)}},{key:"emit",value:function(i){for(var o,s=arguments.length,l=new Array(s>1?s-1:0),f=1;f<s;f++)l[f-1]=arguments[f];(o=this.eventEmitter).emit.apply(o,[i].concat(l))}},{key:"once",value:function(i){for(var o,s=arguments.length,l=new Array(s>1?s-1:0),f=1;f<s;f++)l[f-1]=arguments[f];(o=this.eventEmitter).once.apply(o,[i].concat(l))}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"meterToCoord",value:function(i,o){var s=new(jm()).LngLat(i[0],i[1]),l=new(jm()).LngLat(o[0],o[1]),f=s.distanceTo(l),v=jm().MercatorCoordinate.fromLngLat({lng:i[0],lat:i[1]}),y=jm().MercatorCoordinate.fromLngLat({lng:o[0],lat:o[1]}),b=v.x,T=v.y,M=y.x,O=y.y,F=Math.sqrt(Math.pow(b-M,2)+Math.pow(T-O,2))*4194304*2;return F/f}},{key:"exportMap",value:function(i){var o=this.map.getCanvas(),s=i==="jpg"?o==null?void 0:o.toDataURL("image/jpeg"):o==null?void 0:o.toDataURL("image/png");return s}},{key:"creatMapContainer",value:function(i){var o=i;typeof i=="string"&&(o=document.getElementById(i));var s=document.createElement("div");return s.style.cssText+=`
|
|
position: absolute;
|
|
top: 0;
|
|
height: 100%;
|
|
width: 100%;
|
|
`,s.id="l7_mapbox_div"+tk++,o.appendChild(s),s}}]),t}(ZF))||C2);function nk(e){var r=ik();return function(){var n=(0,Ee.Z)(e),i;if(r){var o=(0,Ee.Z)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,at.Z)(this,i)}}function ik(){if(typeof Reflect=="undefined"||!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(e){return!1}}function ak(e,r){var t=typeof my!="undefined"&&!!my&&typeof my.showToast=="function"&&my.isFRM!==!0,n=typeof wx!="undefined"&&wx!==null&&(typeof wx.request!="undefined"||typeof wx.miniProgram!="undefined");if(!(t||n)&&(r||(r=document),!!r)){var i=r.head||r.getElementsByTagName("head")[0];if(!i){i=r.createElement("head");var o=r.body||r.getElementsByTagName("body")[0];o?o.parentNode.insertBefore(i,o):r.documentElement.appendChild(i)}var s=r.createElement("style");return s.type="text/css",s.styleSheet?s.styleSheet.cssText=e:s.appendChild(r.createTextNode(e)),i.appendChild(s),s}}ak(`.mapboxgl-ctrl-logo {
|
|
display: none !important;
|
|
}
|
|
`);var ok=function(e){(0,Le.Z)(t,e);var r=nk(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getServiceConstructor",value:function(){return rk}}]),t}(BF);function Wm(e){"@babel/helpers - typeof";return Wm=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},Wm(e)}function M2(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function I2(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?M2(Object(t),!0).forEach(function(n){sk(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):M2(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function sk(e,r,t){return r=uk(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function uk(e){var r=lk(e,"string");return Wm(r)==="symbol"?r:String(r)}function lk(e,r){if(Wm(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Wm(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function ck(e,r){return dk(e)||pk(e,r)||hk(e,r)||fk()}function fk(){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 hk(e,r){if(e){if(typeof e=="string")return P2(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return P2(e,r)}}function P2(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function pk(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,o,s,l=[],f=!0,v=!1;try{if(o=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=o.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(y){v=!0,i=y}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(v)throw i}}return l}}function dk(e){if(Array.isArray(e))return e}var vk=q.memo(function(e){var r=e.style,t=e.className,n=e.map,i=e.option,o=e.onSceneLoaded,s=(0,q.createRef)(),l=(0,q.useState)(),f=ck(l,2),v=f[0],y=f[1];return(0,q.useEffect)(function(){var b=new RF(I2(I2({id:s.current},i),{},{map:new ok(n)}));return b.on("loaded",function(){y(b),o&&o(b)}),function(){b.destroy()}},[]),(0,q.useEffect)(function(){v&&n.style&&v.setMapStyle(n.style)},[JSON.stringify(n.style)]),(0,q.useEffect)(function(){v&&n.zoom&&v.setZoom(n.zoom)},[n.zoom]),(0,q.useEffect)(function(){v&&n.center&&v.setCenter(n.center)},[JSON.stringify(n.center)]),(0,q.useEffect)(function(){v&&n.pitch!==void 0&&v.setPitch(n.pitch||0)},[n.pitch]),(0,q.useEffect)(function(){v&&n.rotation&&v.setRotation(n.rotation)},[n.rotation]),q.createElement(he.Provider,{value:v},(0,q.createElement)("div",{ref:s,style:r,className:t},v&&e.children))}),mk=vk;function Gm(e){"@babel/helpers - typeof";return Gm=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},Gm(e)}function O2(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function KN(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?O2(Object(t),!0).forEach(function(n){gk(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):O2(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function gk(e,r,t){return r=_k(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _k(e){var r=yk(e,"string");return Gm(r)==="symbol"?r:String(r)}function yk(e,r){if(Gm(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Gm(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function QN(e,r){return Sk(e)||Ek(e,r)||bk(e,r)||xk()}function xk(){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 bk(e,r){if(e){if(typeof e=="string")return D2(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return D2(e,r)}}function D2(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ek(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,o,s,l=[],f=!0,v=!1;try{if(o=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=o.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(y){v=!0,i=y}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(v)throw i}}return l}}function Sk(e){if(Array.isArray(e))return e}var JN=null,e6=null;function Xm(e){"@babel/helpers - typeof";return Xm=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},Xm(e)}function F2(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function t6(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?F2(Object(t),!0).forEach(function(n){Ak(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):F2(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Ak(e,r,t){return r=Tk(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Tk(e){var r=wk(e,"string");return Xm(r)==="symbol"?r:String(r)}function wk(e,r){if(Xm(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Xm(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function r6(e,r){return Ik(e)||Mk(e,r)||Rk(e,r)||Ck()}function Ck(){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 Rk(e,r){if(e){if(typeof e=="string")return k2(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return k2(e,r)}}function k2(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Mk(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,o,s,l=[],f=!0,v=!1;try{if(o=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=o.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(y){v=!0,i=y}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(v)throw i}}return l}}function Ik(e){if(Array.isArray(e))return e}var n6=null,i6=null;function $m(e){"@babel/helpers - typeof";return $m=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},$m(e)}function B2(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function a6(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?B2(Object(t),!0).forEach(function(n){Pk(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):B2(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Pk(e,r,t){return r=Ok(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ok(e){var r=Dk(e,"string");return $m(r)==="symbol"?r:String(r)}function Dk(e,r){if($m(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if($m(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function o6(e,r){return Lk(e)||Bk(e,r)||kk(e,r)||Fk()}function Fk(){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 kk(e,r){if(e){if(typeof e=="string")return L2(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return L2(e,r)}}function L2(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Bk(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,o,s,l=[],f=!0,v=!1;try{if(o=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=o.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(y){v=!0,i=y}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(v)throw i}}return l}}function Lk(e){if(Array.isArray(e))return e}var s6=null,u6=null;function l6(e,r){return Zk(e)||zk(e,r)||Uk(e,r)||Nk()}function Nk(){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 Uk(e,r){if(e){if(typeof e=="string")return N2(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return N2(e,r)}}function N2(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function zk(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,o,s,l=[],f=!0,v=!1;try{if(o=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=o.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(y){v=!0,i=y}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(v)throw i}}return l}}function Zk(e){if(Array.isArray(e))return e}var c6=null;function Ym(e){"@babel/helpers - typeof";return Ym=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},Ym(e)}var f6=null;function U2(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function h6(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?U2(Object(t),!0).forEach(function(n){Vk(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):U2(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Vk(e,r,t){return r=jk(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function jk(e){var r=Hk(e,"string");return Ym(r)==="symbol"?r:String(r)}function Hk(e,r){if(Ym(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Ym(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function p6(e,r){if(e==null)return{};var t=Wk(e,r),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function Wk(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}var d6={exportImage:VT,fullscreen:XT,geoLocate:qT,layer:e1,layerSwitch:e1,logo:t1,mapTheme:aw,mouseLocation:uw,zoom:dw,scale:fw},v6=null,z2=L(50374);function Z2(e,r){return Yk(e)||$k(e,r)||Xk(e,r)||Gk()}function Gk(){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 Xk(e,r){if(e){if(typeof e=="string")return V2(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return V2(e,r)}}function V2(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function $k(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,o,s,l=[],f=!0,v=!1;try{if(o=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=o.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(y){v=!0,i=y}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(v)throw i}}return l}}function Yk(e){if(Array.isArray(e))return e}var j2=q.useEffect,H2=q.useState,qk=/\B([A-Z])/g,Kk=function(r){return r.replace(qk,"-$1").toLowerCase()};function m6(e){var r=e.className,t=e.style,n=e.children,i=e.position,o=H2(),s=Z2(o,2),l=s[0],f=s[1],v=useSceneValue(),y=H2(function(){return document.createElement("div")}),b=Z2(y,1),T=b[0];return j2(function(){var M=new Control({position:i});return M.onAdd=function(){if(r&&(T.className=r),t){var O=Object.keys(t).map(function(F){return"".concat(Kk(F),":").concat(t[F])}).join(";");T.style.cssText=O}return T},M.onRemove=function(){},f(M),v.addControl(M),function(){v.removeControl(M)}},[]),j2(function(){l&&l.setPosition(i||"bottomleft")},[i]),createPortal(n,T)}var W2=(0,q.createContext)({});function g6(){return useContext(W2)}var Qk=q.memo(function(r){var t=r.layer,n=r.active;return t.active(n.option),null},ys()),Jk=q.memo(function(r){var t=r.layer,n=r.animate;return t.animate(n),null},ys()),eB=q.memo(function(r){var t=r.layer,n=r.color;return n.field?t.color(n.field,n.values):t.color(n.values),null},ys()),tB=q.memo(function(r){var t=r.layer,n=r.filter;return n.field&&t.filter(n.field,n.values),null},ys()),rB=q.memo(function(r){var t=r.layer,n=r.scale;return t.scale(n.values),null},ys()),nB=q.memo(function(r){var t=r.layer,n=r.select;return t.select(n.option),null},ys()),iB=q.memo(function(r){var t=r.layer,n=r.shape;return n.field?t.shape(n.field,n.values):t.shape(n.values),null},ys()),aB=q.memo(function(r){var t=r.layer,n=r.size;return n.field?t.size(n.field,n.values):t.size(n.values),null},ys()),oB=["data"];function sB(e,r){if(e==null)return{};var t=uB(e,r),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function uB(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}var lB=q.memo(function(r){var t=r.layer,n=r.source,i=n.data,o=sB(n,oB);return t.inited?t.setData(i,o):t.source(i,o),o.autoFit&&t.fitBounds(o&&o.fitBoundsOptions),null},ys()),_6=q.useEffect,cB=q.memo(function(r){var t=r.layer,n=r.style;return t.style(n),null},ys());function fB(e,r){return vB(e)||dB(e,r)||pB(e,r)||hB()}function hB(){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 pB(e,r){if(e){if(typeof e=="string")return G2(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return G2(e,r)}}function G2(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function dB(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,o,s,l=[],f=!0,v=!1;try{if(o=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=o.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(y){v=!0,i=y}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(v)throw i}}return l}}function vB(e){if(Array.isArray(e))return e}var qm=q.useEffect,mB=q.useState;function X2(e,r){var t=r.source,n=r.color,i=r.shape,o=r.style,s=r.size,l=r.scale,f=r.active,v=r.select,y=r.filter,b=r.animate,T=r.options,M=r.onLayerLoaded,O=_(),F=mB(function(){var ue;switch(e){case"polygonLayer":ue=new Rg(T);break;case"lineLayer":ue=new q0(T);break;case"pointLayer":ue=new Cg(T);break;case"heatmapLayer":ue=new RC(T);break;case"rasterLayer":ue=new Mg(T);break;case"imageLayer":ue=new P1(T);break;case"citybuildingLayer":ue=new Qw(T);break;default:ue=new Rg(T)}return ue.on("inited",function(){M&&M(ue,O)}),ue}),$=fB(F,1),G=$[0];return qm(function(){return O.addLayer(G),function(){O.removeLayer(G)}},[]),qm(function(){G.inited&&T&&G.updateLayerConfig(T)},[T==null?void 0:T.minZoom,T==null?void 0:T.maxZoom,T==null?void 0:T.visible]),qm(function(){G.inited&&(T!=null&&T.zIndex)&&G.setIndex(T.zIndex)},[T==null?void 0:T.zIndex]),qm(function(){G.inited&&(T!=null&&T.blend)&&G.setBlend(T.blend)},[T==null?void 0:T.blend]),qm(function(){O.render()}),q.createElement(W2.Provider,{value:G},q.createElement(lB,{layer:G,source:t}),l&&q.createElement(rB,{layer:G,scale:l}),n&&q.createElement(eB,{layer:G,color:n}),s&&q.createElement(aB,{layer:G,size:s}),i&&q.createElement(iB,{layer:G,shape:i}),o&&q.createElement(cB,{layer:G,style:o}),f&&q.createElement(Qk,{layer:G,active:f}),v&&q.createElement(nB,{layer:G,select:v}),y&&q.createElement(tB,{layer:G,filter:y}),b&&q.createElement(Jk,{layer:G,animate:b}),r.children)}var y6=null,x6=null,gB=q.memo(function(r){return X2("pointLayer",r)}),_B=q.memo(function(r){return X2("heatmapLayer",r)}),b6=null,E6=null,S6=null,A6=q.useEffect,T6=null,w6=null;function Fv(e){"@babel/helpers - typeof";return Fv=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},Fv(e)}function $2(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function y0(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?$2(Object(t),!0).forEach(function(n){yB(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$2(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function yB(e,r,t){return r=q2(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function xB(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Y2(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,q2(n.key),n)}}function bB(e,r,t){return r&&Y2(e.prototype,r),t&&Y2(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function q2(e){var r=EB(e,"string");return Fv(r)==="symbol"?r:String(r)}function EB(e,r){if(Fv(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Fv(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function SB(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&U_(e,r)}function U_(e,r){return U_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},U_(e,r)}function AB(e){var r=CB();return function(){var n=x0(e),i;if(r){var o=x0(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return TB(this,i)}}function TB(e,r){if(r&&(Fv(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wB(e)}function wB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CB(){if(typeof Reflect=="undefined"||!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(e){return!1}}function x0(e){return x0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x0(e)}var C6=function(e){SB(t,e);var r=AB(t);function t(n){var i;return xB(this,t),i=r.call(this,n),i.el=void 0,i.scene=void 0,i.popup=void 0,i.el=document.createElement("div"),i}return bB(t,[{key:"componentDidMount",value:function(){var i,o=this.props,s=o.lnglat,l=o.children,f=o.option,v=o.lngLat,y=new r1(y0(y0({},f),{},{stopPropagation:(i=this.props.option)===null||i===void 0?void 0:i.stopPropagation}));s&&y.setLnglat(s),v&&y.setLnglat(v),l&&y.setHTML(this.el),this.popup=y,this.scene.addPopup(y)}},{key:"componentDidUpdate",value:function(i){var o,s,l,f,v,y,b=Array.isArray(i.lnglat)?i.lnglat:[i==null||(o=i.lnglat)===null||o===void 0?void 0:o.lng,i==null||(s=i.lnglat)===null||s===void 0?void 0:s.lat],T=Array.isArray(this.props.lnglat)?this.props.lnglat:[(l=this.props)===null||l===void 0||(f=l.lnglat)===null||f===void 0?void 0:f.lng,(v=this.props)===null||v===void 0||(y=v.lnglat)===null||y===void 0?void 0:y.lat],M=b.toString()!==T.toString();if(M){var O;this.popup.remove(),this.popup=new r1(y0(y0({},this.props.option),{},{stopPropagation:(O=this.props.option)===null||O===void 0?void 0:O.stopPropagation})),this.popup.setLnglat(this.props.lnglat),this.popup.setHTML(this.el),this.scene.addPopup(this.popup)}}},{key:"componentWillUnmount",value:function(){this.popup.remove()}},{key:"render",value:function(){var i=this;return q.createElement(he.Consumer,{},function(o){return o&&(i.scene=o),(0,z2.createPortal)(i.props.children,i.el)})}}]),t}(q.PureComponent);function kv(e){"@babel/helpers - typeof";return kv=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},kv(e)}function RB(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function K2(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,IB(n.key),n)}}function MB(e,r,t){return r&&K2(e.prototype,r),t&&K2(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function IB(e){var r=PB(e,"string");return kv(r)==="symbol"?r:String(r)}function PB(e,r){if(kv(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(kv(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function OB(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&z_(e,r)}function z_(e,r){return z_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},z_(e,r)}function DB(e){var r=BB();return function(){var n=b0(e),i;if(r){var o=b0(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return FB(this,i)}}function FB(e,r){if(r&&(kv(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kB(e)}function kB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function BB(){if(typeof Reflect=="undefined"||!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(e){return!1}}function b0(e){return b0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},b0(e)}var R6=function(e){OB(t,e);var r=DB(t);function t(n){var i;return RB(this,t),i=r.call(this,n),i.el=void 0,i.scene=void 0,i.marker=void 0,i.el=document.createElement("div"),i}return MB(t,[{key:"componentDidMount",value:function(){var i=this.props,o=i.lnglat,s=i.children,l=i.option,f=i.onMarkerLoaded,v=new wT(l);o&&v.setLnglat(o),s&&v.setElement(this.el),this.marker=v,f&&f(v),this.scene.addMarker(v)}},{key:"componentDidUpdate",value:function(i){var o,s=JSON.stringify(i==null?void 0:i.lnglat)!==JSON.stringify((o=this.props)===null||o===void 0?void 0:o.lnglat);s&&this.props.lnglat&&this.marker.setLnglat(this.props.lnglat)}},{key:"componentWillUnmount",value:function(){this.marker&&this.marker.remove()}},{key:"render",value:function(){var i=this;return q.createElement(he.Consumer,{},function(o){return o&&(i.scene=o),(0,z2.createPortal)(i.props.children,i.el)})}}]),t}(q.PureComponent),M6=q.useEffect,I6=null,P6=null,O6=q.useEffect,D6=null},70309:function(rr){rr.exports=ee;function ee(he,_){var le=he&&he.type,U;if(le==="FeatureCollection")for(U=0;U<he.features.length;U++)ee(he.features[U],_);else if(le==="GeometryCollection")for(U=0;U<he.geometries.length;U++)ee(he.geometries[U],_);else if(le==="Feature")ee(he.geometry,_);else if(le==="Polygon")L(he.coordinates,_);else if(le==="MultiPolygon")for(U=0;U<he.coordinates.length;U++)L(he.coordinates[U],_);return he}function L(he,_){if(he.length!==0){q(he[0],_);for(var le=1;le<he.length;le++)q(he[le],!_)}}function q(he,_){for(var le=0,U=0,fe=0,se=he.length,Qe=se-1;fe<se;Qe=fe++){var ae=(he[fe][0]-he[Qe][0])*(he[Qe][1]+he[fe][1]),et=le+ae;U+=Math.abs(le)>=Math.abs(ae)?le-et+ae:ae-et+le,le=et}le+U>=0!=!!_&&he.reverse()}},56834:function(rr){"use strict";rr.exports=ee;function ee(L,q){this.x=L,this.y=q}ee.prototype={clone:function(){return new ee(this.x,this.y)},add:function(L){return this.clone()._add(L)},sub:function(L){return this.clone()._sub(L)},multByPoint:function(L){return this.clone()._multByPoint(L)},divByPoint:function(L){return this.clone()._divByPoint(L)},mult:function(L){return this.clone()._mult(L)},div:function(L){return this.clone()._div(L)},rotate:function(L){return this.clone()._rotate(L)},rotateAround:function(L,q){return this.clone()._rotateAround(L,q)},matMult:function(L){return this.clone()._matMult(L)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(L){return this.x===L.x&&this.y===L.y},dist:function(L){return Math.sqrt(this.distSqr(L))},distSqr:function(L){var q=L.x-this.x,he=L.y-this.y;return q*q+he*he},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(L){return Math.atan2(this.y-L.y,this.x-L.x)},angleWith:function(L){return this.angleWithSep(L.x,L.y)},angleWithSep:function(L,q){return Math.atan2(this.x*q-this.y*L,this.x*L+this.y*q)},_matMult:function(L){var q=L[0]*this.x+L[1]*this.y,he=L[2]*this.x+L[3]*this.y;return this.x=q,this.y=he,this},_add:function(L){return this.x+=L.x,this.y+=L.y,this},_sub:function(L){return this.x-=L.x,this.y-=L.y,this},_mult:function(L){return this.x*=L,this.y*=L,this},_div:function(L){return this.x/=L,this.y/=L,this},_multByPoint:function(L){return this.x*=L.x,this.y*=L.y,this},_divByPoint:function(L){return this.x/=L.x,this.y/=L.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var L=this.y;return this.y=this.x,this.x=-L,this},_rotate:function(L){var q=Math.cos(L),he=Math.sin(L),_=q*this.x-he*this.y,le=he*this.x+q*this.y;return this.x=_,this.y=le,this},_rotateAround:function(L,q){var he=Math.cos(L),_=Math.sin(L),le=q.x+he*(this.x-q.x)-_*(this.y-q.y),U=q.y+_*(this.x-q.x)+he*(this.y-q.y);return this.x=le,this.y=U,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ee.convert=function(L){return L instanceof ee?L:Array.isArray(L)?new ee(L[0],L[1]):L}},45188:function(rr){"use strict";rr.exports=L,rr.exports.default=L;var ee=1e20;function L(U,fe,se,Qe,ae,et){this.fontSize=U||24,this.buffer=fe===void 0?3:fe,this.cutoff=Qe||.25,this.fontFamily=ae||"sans-serif",this.fontWeight=et||"normal",this.radius=se||8;var dt=this.size=this.fontSize+this.buffer*2,Ye=dt+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=dt,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(Ye*Ye),this.gridInner=new Float64Array(Ye*Ye),this.f=new Float64Array(Ye),this.z=new Float64Array(Ye+1),this.v=new Uint16Array(Ye),this.useMetrics=this.ctx.measureText("A").actualBoundingBoxLeft!==void 0,this.middle=Math.round(dt/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function q(U,fe,se,Qe,ae,et,dt){et.fill(ee,0,fe*se),dt.fill(0,0,fe*se);for(var Ye=(fe-Qe)/2,wt=0;wt<ae;wt++)for(var Xt=0;Xt<Qe;Xt++){var Zt=(wt+Ye)*fe+Xt+Ye,nr=U.data[4*(wt*Qe+Xt)+3]/255;if(nr===1)et[Zt]=0,dt[Zt]=ee;else if(nr===0)et[Zt]=ee,dt[Zt]=0;else{var Vt=Math.max(0,.5-nr),xt=Math.max(0,nr-.5);et[Zt]=Vt*Vt,dt[Zt]=xt*xt}}}function he(U,fe,se,Qe,ae,et,dt){for(var Ye=0;Ye<fe*se;Ye++){var wt=Math.sqrt(Qe[Ye])-Math.sqrt(ae[Ye]);U[Ye]=Math.round(255-255*(wt/et+dt))}}L.prototype._draw=function(U,fe){var se=this.ctx.measureText(U),Qe=se.width,ae=2*this.buffer,et,dt,Ye,wt,Xt,Zt,nr,Vt;fe&&this.useMetrics?(Xt=Math.floor(se.actualBoundingBoxAscent),Vt=this.buffer+Math.ceil(se.actualBoundingBoxAscent),Zt=this.buffer,nr=this.buffer,dt=Math.min(this.size,Math.ceil(se.actualBoundingBoxRight-se.actualBoundingBoxLeft)),wt=Math.min(this.size-Zt,Math.ceil(se.actualBoundingBoxAscent+se.actualBoundingBoxDescent)),et=dt+ae,Ye=wt+ae,this.ctx.textBaseline="alphabetic"):(et=dt=this.size,Ye=wt=this.size,Xt=19*this.fontSize/24,Zt=nr=0,Vt=this.middle,this.ctx.textBaseline="middle");var xt;dt&&wt&&(this.ctx.clearRect(nr,Zt,dt,wt),this.ctx.fillText(U,this.buffer,Vt),xt=this.ctx.getImageData(nr,Zt,dt,wt));var bt=new Uint8ClampedArray(et*Ye);return q(xt,et,Ye,dt,wt,this.gridOuter,this.gridInner),_(this.gridOuter,et,Ye,this.f,this.v,this.z),_(this.gridInner,et,Ye,this.f,this.v,this.z),he(bt,et,Ye,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:bt,metrics:{width:dt,height:wt,sdfWidth:et,sdfHeight:Ye,top:Xt,left:0,advance:Qe}}},L.prototype.draw=function(U){return this._draw(U,!1).data},L.prototype.drawWithMetrics=function(U){return this._draw(U,!0)};function _(U,fe,se,Qe,ae,et){for(var dt=0;dt<fe;dt++)le(U,dt,fe,se,Qe,ae,et);for(var Ye=0;Ye<se;Ye++)le(U,Ye*fe,1,fe,Qe,ae,et)}function le(U,fe,se,Qe,ae,et,dt){var Ye,wt,Xt,Zt;for(et[0]=0,dt[0]=-ee,dt[1]=ee,Ye=0;Ye<Qe;Ye++)ae[Ye]=U[fe+Ye*se];for(Ye=1,wt=0,Xt=0;Ye<Qe;Ye++){do Zt=et[wt],Xt=(ae[Ye]-ae[Zt]+Ye*Ye-Zt*Zt)/(Ye-Zt)/2;while(Xt<=dt[wt]&&--wt>-1);wt++,et[wt]=Ye,dt[wt]=Xt,dt[wt+1]=ee}for(Ye=0,wt=0;Ye<Qe;Ye++){for(;dt[wt+1]<Ye;)wt++;Zt=et[wt],U[fe+Ye*se]=ae[Zt]+(Ye-Zt)*(Ye-Zt)}}},85143:function(rr,ee,L){rr.exports.VectorTile=L(7317),L(26305),L(65336)},7317:function(rr,ee,L){"use strict";var q=L(65336);rr.exports=he;function he(le,U){this.layers=le.readFields(_,{},U)}function _(le,U,fe){if(le===3){var se=new q(fe,fe.readVarint()+fe.pos);se.length&&(U[se.name]=se)}}},26305:function(rr,ee,L){"use strict";var q=L(56834);rr.exports=he;function he(se,Qe,ae,et,dt){this.properties={},this.extent=ae,this.type=0,this._pbf=se,this._geometry=-1,this._keys=et,this._values=dt,se.readFields(_,this,Qe)}function _(se,Qe,ae){se==1?Qe.id=ae.readVarint():se==2?le(ae,Qe):se==3?Qe.type=ae.readVarint():se==4&&(Qe._geometry=ae.pos)}function le(se,Qe){for(var ae=se.readVarint()+se.pos;se.pos<ae;){var et=Qe._keys[se.readVarint()],dt=Qe._values[se.readVarint()];Qe.properties[et]=dt}}he.types=["Unknown","Point","LineString","Polygon"],he.prototype.loadGeometry=function(){var se=this._pbf;se.pos=this._geometry;for(var Qe=se.readVarint()+se.pos,ae=1,et=0,dt=0,Ye=0,wt=[],Xt;se.pos<Qe;){if(et<=0){var Zt=se.readVarint();ae=Zt&7,et=Zt>>3}if(et--,ae===1||ae===2)dt+=se.readSVarint(),Ye+=se.readSVarint(),ae===1&&(Xt&&wt.push(Xt),Xt=[]),Xt.push(new q(dt,Ye));else if(ae===7)Xt&&Xt.push(Xt[0].clone());else throw new Error("unknown command "+ae)}return Xt&&wt.push(Xt),wt},he.prototype.bbox=function(){var se=this._pbf;se.pos=this._geometry;for(var Qe=se.readVarint()+se.pos,ae=1,et=0,dt=0,Ye=0,wt=1/0,Xt=-1/0,Zt=1/0,nr=-1/0;se.pos<Qe;){if(et<=0){var Vt=se.readVarint();ae=Vt&7,et=Vt>>3}if(et--,ae===1||ae===2)dt+=se.readSVarint(),Ye+=se.readSVarint(),dt<wt&&(wt=dt),dt>Xt&&(Xt=dt),Ye<Zt&&(Zt=Ye),Ye>nr&&(nr=Ye);else if(ae!==7)throw new Error("unknown command "+ae)}return[wt,Zt,Xt,nr]},he.prototype.toGeoJSON=function(se,Qe,ae){var et=this.extent*Math.pow(2,ae),dt=this.extent*se,Ye=this.extent*Qe,wt=this.loadGeometry(),Xt=he.types[this.type],Zt,nr;function Vt(Tr){for(var hr=0;hr<Tr.length;hr++){var lr=Tr[hr],At=180-(lr.y+Ye)*360/et;Tr[hr]=[(lr.x+dt)*360/et-180,360/Math.PI*Math.atan(Math.exp(At*Math.PI/180))-90]}}switch(this.type){case 1:var xt=[];for(Zt=0;Zt<wt.length;Zt++)xt[Zt]=wt[Zt][0];wt=xt,Vt(wt);break;case 2:for(Zt=0;Zt<wt.length;Zt++)Vt(wt[Zt]);break;case 3:for(wt=U(wt),Zt=0;Zt<wt.length;Zt++)for(nr=0;nr<wt[Zt].length;nr++)Vt(wt[Zt][nr]);break}wt.length===1?wt=wt[0]:Xt="Multi"+Xt;var bt={type:"Feature",geometry:{type:Xt,coordinates:wt},properties:this.properties};return"id"in this&&(bt.id=this.id),bt};function U(se){var Qe=se.length;if(Qe<=1)return[se];for(var ae=[],et,dt,Ye=0;Ye<Qe;Ye++){var wt=fe(se[Ye]);wt!==0&&(dt===void 0&&(dt=wt<0),dt===wt<0?(et&&ae.push(et),et=[se[Ye]]):et.push(se[Ye]))}return et&&ae.push(et),ae}function fe(se){for(var Qe=0,ae=0,et=se.length,dt=et-1,Ye,wt;ae<et;dt=ae++)Ye=se[ae],wt=se[dt],Qe+=(wt.x-Ye.x)*(Ye.y+wt.y);return Qe}},65336:function(rr,ee,L){"use strict";var q=L(26305);rr.exports=he;function he(U,fe){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=U,this._keys=[],this._values=[],this._features=[],U.readFields(_,this,fe),this.length=this._features.length}function _(U,fe,se){U===15?fe.version=se.readVarint():U===1?fe.name=se.readString():U===5?fe.extent=se.readVarint():U===2?fe._features.push(se.pos):U===3?fe._keys.push(se.readString()):U===4&&fe._values.push(le(se))}function le(U){for(var fe=null,se=U.readVarint()+U.pos;U.pos<se;){var Qe=U.readVarint()>>3;fe=Qe===1?U.readString():Qe===2?U.readFloat():Qe===3?U.readDouble():Qe===4?U.readVarint64():Qe===5?U.readVarint():Qe===6?U.readSVarint():Qe===7?U.readBoolean():null}return fe}he.prototype.feature=function(U){if(U<0||U>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[U];var fe=this._pbf.readVarint()+this._pbf.pos;return new q(this._pbf,fe,this.extent,this._keys,this._values)}},18283:function(rr,ee,L){"use strict";L.d(ee,{Z:function(){return nt}});var q=L(79685),he=L(68591),_=L.n(he),le=L(3139),U=L(99248),fe=L(73064),se=L(57196),Qe=L(55095),ae=function(te,Ce){var we={};for(var Xe in te)Object.prototype.hasOwnProperty.call(te,Xe)&&Ce.indexOf(Xe)<0&&(we[Xe]=te[Xe]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,Xe=Object.getOwnPropertySymbols(te);Lt<Xe.length;Lt++)Ce.indexOf(Xe[Lt])<0&&Object.prototype.propertyIsEnumerable.call(te,Xe[Lt])&&(we[Xe[Lt]]=te[Xe[Lt]]);return we},dt=te=>{var{prefixCls:Ce,className:we,hoverable:Xe=!0}=te,Lt=ae(te,["prefixCls","className","hoverable"]);const{getPrefixCls:Ht}=q.useContext(U.E_),on=Ht("card",Ce),Jr=_()(`${on}-grid`,we,{[`${on}-grid-hoverable`]:Xe});return q.createElement("div",Object.assign({},Lt,{className:Jr}))},Ye=L(26477),wt=L(4614),Xt=L(44244),Zt=L(25830);const nr=te=>{const{antCls:Ce,componentCls:we,headerHeight:Xe,cardPaddingBase:Lt,tabsMarginBottom:Ht}=te;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:Xe,marginBottom:-1,padding:`0 ${(0,Ye.bf)(Lt)}`,color:te.colorTextHeading,fontWeight:te.fontWeightStrong,fontSize:te.headerFontSize,background:te.headerBg,borderBottom:`${(0,Ye.bf)(te.lineWidth)} ${te.lineType} ${te.colorBorderSecondary}`,borderRadius:`${(0,Ye.bf)(te.borderRadiusLG)} ${(0,Ye.bf)(te.borderRadiusLG)} 0 0`},(0,wt.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},wt.vS),{[`
|
|
> ${we}-typography,
|
|
> ${we}-typography-edit-content
|
|
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${Ce}-tabs-top`]:{clear:"both",marginBottom:Ht,color:te.colorText,fontWeight:"normal",fontSize:te.fontSize,"&-bar":{borderBottom:`${(0,Ye.bf)(te.lineWidth)} ${te.lineType} ${te.colorBorderSecondary}`}}})},Vt=te=>{const{cardPaddingBase:Ce,colorBorderSecondary:we,cardShadow:Xe,lineWidth:Lt}=te;return{width:"33.33%",padding:Ce,border:0,borderRadius:0,boxShadow:`
|
|
${(0,Ye.bf)(Lt)} 0 0 0 ${we},
|
|
0 ${(0,Ye.bf)(Lt)} 0 0 ${we},
|
|
${(0,Ye.bf)(Lt)} ${(0,Ye.bf)(Lt)} 0 0 ${we},
|
|
${(0,Ye.bf)(Lt)} 0 0 0 ${we} inset,
|
|
0 ${(0,Ye.bf)(Lt)} 0 0 ${we} inset;
|
|
`,transition:`all ${te.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:Xe}}},xt=te=>{const{componentCls:Ce,iconCls:we,actionsLiMargin:Xe,cardActionsIconSize:Lt,colorBorderSecondary:Ht,actionsBg:on}=te;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:on,borderTop:`${(0,Ye.bf)(te.lineWidth)} ${te.lineType} ${Ht}`,display:"flex",borderRadius:`0 0 ${(0,Ye.bf)(te.borderRadiusLG)} ${(0,Ye.bf)(te.borderRadiusLG)}`},(0,wt.dF)()),{"& > li":{margin:Xe,color:te.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:te.calc(te.cardActionsIconSize).mul(2).equal(),fontSize:te.fontSize,lineHeight:te.lineHeight,cursor:"pointer","&:hover":{color:te.colorPrimary,transition:`color ${te.motionDurationMid}`},[`a:not(${Ce}-btn), > ${we}`]:{display:"inline-block",width:"100%",color:te.colorTextDescription,lineHeight:(0,Ye.bf)(te.fontHeight),transition:`color ${te.motionDurationMid}`,"&:hover":{color:te.colorPrimary}},[`> ${we}`]:{fontSize:Lt,lineHeight:(0,Ye.bf)(te.calc(Lt).mul(te.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${(0,Ye.bf)(te.lineWidth)} ${te.lineType} ${Ht}`}}})},bt=te=>Object.assign(Object.assign({margin:`${(0,Ye.bf)(te.calc(te.marginXXS).mul(-1).equal())} 0`,display:"flex"},(0,wt.dF)()),{"&-avatar":{paddingInlineEnd:te.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:te.marginXS}},"&-title":Object.assign({color:te.colorTextHeading,fontWeight:te.fontWeightStrong,fontSize:te.fontSizeLG},wt.vS),"&-description":{color:te.colorTextDescription}}),Tr=te=>{const{componentCls:Ce,cardPaddingBase:we,colorFillAlter:Xe}=te;return{[`${Ce}-head`]:{padding:`0 ${(0,Ye.bf)(we)}`,background:Xe,"&-title":{fontSize:te.fontSize}},[`${Ce}-body`]:{padding:`${(0,Ye.bf)(te.padding)} ${(0,Ye.bf)(we)}`}}},hr=te=>{const{componentCls:Ce}=te;return{overflow:"hidden",[`${Ce}-body`]:{userSelect:"none"}}},lr=te=>{const{antCls:Ce,componentCls:we,cardShadow:Xe,cardHeadPadding:Lt,colorBorderSecondary:Ht,boxShadowTertiary:on,cardPaddingBase:Jr,extraColor:Hr}=te;return{[we]:Object.assign(Object.assign({},(0,wt.Wf)(te)),{position:"relative",background:te.colorBgContainer,borderRadius:te.borderRadiusLG,[`&:not(${we}-bordered)`]:{boxShadow:on},[`${we}-head`]:nr(te),[`${we}-extra`]:{marginInlineStart:"auto",color:Hr,fontWeight:"normal",fontSize:te.fontSize},[`${we}-body`]:Object.assign({padding:Jr,borderRadius:` 0 0 ${(0,Ye.bf)(te.borderRadiusLG)} ${(0,Ye.bf)(te.borderRadiusLG)}`},(0,wt.dF)()),[`${we}-grid`]:Vt(te),[`${we}-cover`]:{"> *":{display:"block",width:"100%"},[`img, img + ${Ce}-image-mask`]:{borderRadius:`${(0,Ye.bf)(te.borderRadiusLG)} ${(0,Ye.bf)(te.borderRadiusLG)} 0 0`}},[`${we}-actions`]:xt(te),[`${we}-meta`]:bt(te)}),[`${we}-bordered`]:{border:`${(0,Ye.bf)(te.lineWidth)} ${te.lineType} ${Ht}`,[`${we}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${we}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${te.motionDurationMid}, border-color ${te.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:Xe}},[`${we}-contain-grid`]:{borderRadius:`${(0,Ye.bf)(te.borderRadiusLG)} ${(0,Ye.bf)(te.borderRadiusLG)} 0 0 `,[`${we}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${we}-loading) ${we}-body`]:{marginBlockStart:te.calc(te.lineWidth).mul(-1).equal(),marginInlineStart:te.calc(te.lineWidth).mul(-1).equal(),padding:0}},[`${we}-contain-tabs`]:{[`> ${we}-head`]:{minHeight:0,[`${we}-head-title, ${we}-extra`]:{paddingTop:Lt}}},[`${we}-type-inner`]:Tr(te),[`${we}-loading`]:hr(te),[`${we}-rtl`]:{direction:"rtl"}}},At=te=>{const{componentCls:Ce,cardPaddingSM:we,headerHeightSM:Xe,headerFontSizeSM:Lt}=te;return{[`${Ce}-small`]:{[`> ${Ce}-head`]:{minHeight:Xe,padding:`0 ${(0,Ye.bf)(we)}`,fontSize:Lt,[`> ${Ce}-head-wrapper`]:{[`> ${Ce}-extra`]:{fontSize:te.fontSize}}},[`> ${Ce}-body`]:{padding:we}},[`${Ce}-small${Ce}-contain-tabs`]:{[`> ${Ce}-head`]:{[`${Ce}-head-title, ${Ce}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}},ut=te=>({headerBg:"transparent",headerFontSize:te.fontSizeLG,headerFontSizeSM:te.fontSize,headerHeight:te.fontSizeLG*te.lineHeightLG+te.padding*2,headerHeightSM:te.fontSize*te.lineHeight+te.paddingXS*2,actionsBg:te.colorBgContainer,actionsLiMargin:`${te.paddingSM}px 0`,tabsMarginBottom:-te.padding-te.lineWidth,extraColor:te.colorText});var It=(0,Xt.I$)("Card",te=>{const Ce=(0,Zt.TS)(te,{cardShadow:te.boxShadowCard,cardHeadPadding:te.padding,cardPaddingBase:te.paddingLG,cardActionsIconSize:te.fontSize,cardPaddingSM:12});return[lr(Ce),At(Ce)]},ut),qe=function(te,Ce){var we={};for(var Xe in te)Object.prototype.hasOwnProperty.call(te,Xe)&&Ce.indexOf(Xe)<0&&(we[Xe]=te[Xe]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,Xe=Object.getOwnPropertySymbols(te);Lt<Xe.length;Lt++)Ce.indexOf(Xe[Lt])<0&&Object.prototype.propertyIsEnumerable.call(te,Xe[Lt])&&(we[Xe[Lt]]=te[Xe[Lt]]);return we};const Ct=te=>{const{prefixCls:Ce,actions:we=[]}=te;return q.createElement("ul",{className:`${Ce}-actions`},we.map((Xe,Lt)=>{const Ht=`action-${Lt}`;return q.createElement("li",{style:{width:`${100/we.length}%`},key:Ht},q.createElement("span",null,Xe))}))};var re=q.forwardRef((te,Ce)=>{const{prefixCls:we,className:Xe,rootClassName:Lt,style:Ht,extra:on,headStyle:Jr={},bodyStyle:Hr={},title:Un,loading:bn,bordered:Kr=!0,size:Mi,type:Si,cover:Ri,actions:Gn,tabList:Dn,children:Ya,activeTabKey:Yi,defaultActiveTabKey:Na,tabBarExtraContent:Dt,hoverable:k,tabProps:ie={}}=te,ve=qe(te,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:Ze,direction:_t,card:Wt}=q.useContext(U.E_),Sr=J=>{var oe;(oe=te.onTabChange)===null||oe===void 0||oe.call(te,J)},He=q.useMemo(()=>{let J=!1;return q.Children.forEach(Ya,oe=>{oe&&oe.type&&oe.type===dt&&(J=!0)}),J},[Ya]),Et=Ze("card",we),[cr,mr]=It(Et),Zr=q.createElement(se.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},Ya),Fn=Yi!==void 0,En=Object.assign(Object.assign({},ie),{[Fn?"activeKey":"defaultActiveKey"]:Fn?Yi:Na,tabBarExtraContent:Dt});let Cn;const fn=(0,fe.Z)(Mi),ni=!fn||fn==="default"?"large":fn,Yn=Dn?q.createElement(Qe.Z,Object.assign({size:ni},En,{className:`${Et}-head-tabs`,onChange:Sr,items:Dn.map(J=>{var{tab:oe}=J,be=qe(J,["tab"]);return Object.assign({label:oe},be)})})):null;(Un||on||Yn)&&(Cn=q.createElement("div",{className:`${Et}-head`,style:Jr},q.createElement("div",{className:`${Et}-head-wrapper`},Un&&q.createElement("div",{className:`${Et}-head-title`},Un),on&&q.createElement("div",{className:`${Et}-extra`},on)),Yn));const oa=Ri?q.createElement("div",{className:`${Et}-cover`},Ri):null,Qi=q.createElement("div",{className:`${Et}-body`,style:Hr},bn?Zr:Ya),lo=Gn&&Gn.length?q.createElement(Ct,{prefixCls:Et,actions:Gn}):null,Is=(0,le.Z)(ve,["onTabChange"]),hi=_()(Et,Wt==null?void 0:Wt.className,{[`${Et}-loading`]:bn,[`${Et}-bordered`]:Kr,[`${Et}-hoverable`]:k,[`${Et}-contain-grid`]:He,[`${Et}-contain-tabs`]:Dn&&Dn.length,[`${Et}-${fn}`]:fn,[`${Et}-type-${Si}`]:!!Si,[`${Et}-rtl`]:_t==="rtl"},Xe,Lt,mr),W=Object.assign(Object.assign({},Wt==null?void 0:Wt.style),Ht);return cr(q.createElement("div",Object.assign({ref:Ce},Is,{className:hi,style:W}),Cn,oa,Qi,lo))}),V=function(te,Ce){var we={};for(var Xe in te)Object.prototype.hasOwnProperty.call(te,Xe)&&Ce.indexOf(Xe)<0&&(we[Xe]=te[Xe]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,Xe=Object.getOwnPropertySymbols(te);Lt<Xe.length;Lt++)Ce.indexOf(Xe[Lt])<0&&Object.prototype.propertyIsEnumerable.call(te,Xe[Lt])&&(we[Xe[Lt]]=te[Xe[Lt]]);return we},Me=te=>{const{prefixCls:Ce,className:we,avatar:Xe,title:Lt,description:Ht}=te,on=V(te,["prefixCls","className","avatar","title","description"]),{getPrefixCls:Jr}=q.useContext(U.E_),Hr=Jr("card",Ce),Un=_()(`${Hr}-meta`,we),bn=Xe?q.createElement("div",{className:`${Hr}-meta-avatar`},Xe):null,Kr=Lt?q.createElement("div",{className:`${Hr}-meta-title`},Lt):null,Mi=Ht?q.createElement("div",{className:`${Hr}-meta-description`},Ht):null,Si=Kr||Mi?q.createElement("div",{className:`${Hr}-meta-detail`},Kr,Mi):null;return q.createElement("div",Object.assign({},on,{className:Un}),bn,Si)};const Se=re;Se.Grid=dt,Se.Meta=Me;var nt=Se},45161:function(rr,ee,L){"use strict";L.d(ee,{Z:function(){return It}});var q=L(79685),he=L(28120),_=L(23196),le=L(68591),U=L.n(le),fe=L(99248),se=L(57196),ae=qe=>{const{value:Ct,formatter:fr,precision:re,decimalSeparator:V,groupSeparator:K="",prefixCls:Me}=qe;let Se;if(typeof fr=="function")Se=fr(Ct);else{const nt=String(Ct),te=nt.match(/^(-?)(\d*)(\.(\d+))?$/);if(!te||nt==="-")Se=nt;else{const Ce=te[1];let we=te[2]||"0",Xe=te[4]||"";we=we.replace(/\B(?=(\d{3})+(?!\d))/g,K),typeof re=="number"&&(Xe=Xe.padEnd(re,"0").slice(0,re>0?re:0)),Xe&&(Xe=`${V}${Xe}`),Se=[q.createElement("span",{key:"int",className:`${Me}-content-value-int`},Ce,we),Xe&&q.createElement("span",{key:"decimal",className:`${Me}-content-value-decimal`},Xe)]}}return q.createElement("span",{className:`${Me}-content-value`},Se)},et=L(4614),dt=L(44244),Ye=L(25830);const wt=qe=>{const{componentCls:Ct,marginXXS:fr,padding:re,colorTextDescription:V,titleFontSize:K,colorTextHeading:Me,contentFontSize:Se,fontFamily:nt}=qe;return{[`${Ct}`]:Object.assign(Object.assign({},(0,et.Wf)(qe)),{[`${Ct}-title`]:{marginBottom:fr,color:V,fontSize:K},[`${Ct}-skeleton`]:{paddingTop:re},[`${Ct}-content`]:{color:Me,fontSize:Se,fontFamily:nt,[`${Ct}-content-value`]:{display:"inline-block",direction:"ltr"},[`${Ct}-content-prefix, ${Ct}-content-suffix`]:{display:"inline-block"},[`${Ct}-content-prefix`]:{marginInlineEnd:fr},[`${Ct}-content-suffix`]:{marginInlineStart:fr}}})}},Xt=qe=>{const{fontSizeHeading3:Ct,fontSize:fr}=qe;return{titleFontSize:fr,contentFontSize:Ct}};var Zt=(0,dt.I$)("Statistic",qe=>{const Ct=(0,Ye.TS)(qe,{});return[wt(Ct)]},Xt),Vt=qe=>{const{prefixCls:Ct,className:fr,rootClassName:re,style:V,valueStyle:K,value:Me=0,title:Se,valueRender:nt,prefix:te,suffix:Ce,loading:we=!1,onMouseEnter:Xe,onMouseLeave:Lt,decimalSeparator:Ht=".",groupSeparator:on=","}=qe,{getPrefixCls:Jr,direction:Hr,statistic:Un}=q.useContext(fe.E_),bn=Jr("statistic",Ct),[Kr,Mi]=Zt(bn),Si=q.createElement(ae,Object.assign({decimalSeparator:Ht,groupSeparator:on,prefixCls:bn},qe,{value:Me})),Ri=U()(bn,{[`${bn}-rtl`]:Hr==="rtl"},Un==null?void 0:Un.className,fr,re,Mi);return Kr(q.createElement("div",{className:Ri,style:Object.assign(Object.assign({},Un==null?void 0:Un.style),V),onMouseEnter:Xe,onMouseLeave:Lt},Se&&q.createElement("div",{className:`${bn}-title`},Se),q.createElement(se.Z,{paragraph:!1,loading:we,className:`${bn}-skeleton`},q.createElement("div",{style:K,className:`${bn}-content`},te&&q.createElement("span",{className:`${bn}-content-prefix`},te),nt?nt(Si):Si,Ce&&q.createElement("span",{className:`${bn}-content-suffix`},Ce)))))};const xt=[["Y",1e3*60*60*24*365],["M",1e3*60*60*24*30],["D",1e3*60*60*24],["H",1e3*60*60],["m",1e3*60],["s",1e3],["S",1]];function bt(qe,Ct){let fr=qe;const re=/\[[^\]]*]/g,V=(Ct.match(re)||[]).map(nt=>nt.slice(1,-1)),K=Ct.replace(re,"[]"),Me=xt.reduce((nt,te)=>{let[Ce,we]=te;if(nt.includes(Ce)){const Xe=Math.floor(fr/we);return fr-=Xe*we,nt.replace(new RegExp(`${Ce}+`,"g"),Lt=>{const Ht=Lt.length;return Xe.toString().padStart(Ht,"0")})}return nt},K);let Se=0;return Me.replace(re,()=>{const nt=V[Se];return Se+=1,nt})}function Tr(qe,Ct){const{format:fr=""}=Ct,re=new Date(qe).getTime(),V=Date.now(),K=Math.max(re-V,0);return bt(K,fr)}const hr=1e3/30;function lr(qe){return new Date(qe).getTime()}const At=qe=>{const{value:Ct,format:fr="HH:mm:ss",onChange:re,onFinish:V}=qe,K=(0,he.Z)(),Me=q.useRef(null),Se=()=>{V==null||V(),Me.current&&(clearInterval(Me.current),Me.current=null)},nt=()=>{const we=lr(Ct);we>=Date.now()&&(Me.current=setInterval(()=>{K(),re==null||re(we-Date.now()),we<Date.now()&&Se()},hr))};q.useEffect(()=>(nt(),()=>{Me.current&&(clearInterval(Me.current),Me.current=null)}),[Ct]);const te=(we,Xe)=>Tr(we,Object.assign(Object.assign({},Xe),{format:fr})),Ce=we=>(0,_.Tm)(we,{title:void 0});return q.createElement(Vt,Object.assign({},qe,{valueRender:Ce,formatter:te}))};var ut=q.memo(At);Vt.Countdown=ut;var It=Vt},89675:function(rr){"use strict";rr.exports=ee,rr.exports.default=ee;function ee(K,Me,Se){Se=Se||2;var nt=Me&&Me.length,te=nt?Me[0]*Se:K.length,Ce=L(K,0,te,Se,!0),we=[];if(!Ce||Ce.next===Ce.prev)return we;var Xe,Lt,Ht,on,Jr,Hr,Un;if(nt&&(Ce=se(K,Me,Ce,Se)),K.length>80*Se){Xe=Ht=K[0],Lt=on=K[1];for(var bn=Se;bn<te;bn+=Se)Jr=K[bn],Hr=K[bn+1],Jr<Xe&&(Xe=Jr),Hr<Lt&&(Lt=Hr),Jr>Ht&&(Ht=Jr),Hr>on&&(on=Hr);Un=Math.max(Ht-Xe,on-Lt),Un=Un!==0?32767/Un:0}return he(Ce,we,Se,Xe,Lt,Un,0),we}function L(K,Me,Se,nt,te){var Ce,we;if(te===V(K,Me,Se,nt)>0)for(Ce=Me;Ce<Se;Ce+=nt)we=Ct(Ce,K[Ce],K[Ce+1],we);else for(Ce=Se-nt;Ce>=Me;Ce-=nt)we=Ct(Ce,K[Ce],K[Ce+1],we);return we&&bt(we,we.next)&&(fr(we),we=we.next),we}function q(K,Me){if(!K)return K;Me||(Me=K);var Se=K,nt;do if(nt=!1,!Se.steiner&&(bt(Se,Se.next)||xt(Se.prev,Se,Se.next)===0)){if(fr(Se),Se=Me=Se.prev,Se===Se.next)break;nt=!0}else Se=Se.next;while(nt||Se!==Me);return Me}function he(K,Me,Se,nt,te,Ce,we){if(K){!we&&Ce&&Ye(K,nt,te,Ce);for(var Xe=K,Lt,Ht;K.prev!==K.next;){if(Lt=K.prev,Ht=K.next,Ce?le(K,nt,te,Ce):_(K)){Me.push(Lt.i/Se|0),Me.push(K.i/Se|0),Me.push(Ht.i/Se|0),fr(K),K=Ht.next,Xe=Ht.next;continue}if(K=Ht,K===Xe){we?we===1?(K=U(q(K),Me,Se),he(K,Me,Se,nt,te,Ce,2)):we===2&&fe(K,Me,Se,nt,te,Ce):he(q(K),Me,Se,nt,te,Ce,1);break}}}}function _(K){var Me=K.prev,Se=K,nt=K.next;if(xt(Me,Se,nt)>=0)return!1;for(var te=Me.x,Ce=Se.x,we=nt.x,Xe=Me.y,Lt=Se.y,Ht=nt.y,on=te<Ce?te<we?te:we:Ce<we?Ce:we,Jr=Xe<Lt?Xe<Ht?Xe:Ht:Lt<Ht?Lt:Ht,Hr=te>Ce?te>we?te:we:Ce>we?Ce:we,Un=Xe>Lt?Xe>Ht?Xe:Ht:Lt>Ht?Lt:Ht,bn=nt.next;bn!==Me;){if(bn.x>=on&&bn.x<=Hr&&bn.y>=Jr&&bn.y<=Un&&nr(te,Xe,Ce,Lt,we,Ht,bn.x,bn.y)&&xt(bn.prev,bn,bn.next)>=0)return!1;bn=bn.next}return!0}function le(K,Me,Se,nt){var te=K.prev,Ce=K,we=K.next;if(xt(te,Ce,we)>=0)return!1;for(var Xe=te.x,Lt=Ce.x,Ht=we.x,on=te.y,Jr=Ce.y,Hr=we.y,Un=Xe<Lt?Xe<Ht?Xe:Ht:Lt<Ht?Lt:Ht,bn=on<Jr?on<Hr?on:Hr:Jr<Hr?Jr:Hr,Kr=Xe>Lt?Xe>Ht?Xe:Ht:Lt>Ht?Lt:Ht,Mi=on>Jr?on>Hr?on:Hr:Jr>Hr?Jr:Hr,Si=Xt(Un,bn,Me,Se,nt),Ri=Xt(Kr,Mi,Me,Se,nt),Gn=K.prevZ,Dn=K.nextZ;Gn&&Gn.z>=Si&&Dn&&Dn.z<=Ri;){if(Gn.x>=Un&&Gn.x<=Kr&&Gn.y>=bn&&Gn.y<=Mi&&Gn!==te&&Gn!==we&&nr(Xe,on,Lt,Jr,Ht,Hr,Gn.x,Gn.y)&&xt(Gn.prev,Gn,Gn.next)>=0||(Gn=Gn.prevZ,Dn.x>=Un&&Dn.x<=Kr&&Dn.y>=bn&&Dn.y<=Mi&&Dn!==te&&Dn!==we&&nr(Xe,on,Lt,Jr,Ht,Hr,Dn.x,Dn.y)&&xt(Dn.prev,Dn,Dn.next)>=0))return!1;Dn=Dn.nextZ}for(;Gn&&Gn.z>=Si;){if(Gn.x>=Un&&Gn.x<=Kr&&Gn.y>=bn&&Gn.y<=Mi&&Gn!==te&&Gn!==we&&nr(Xe,on,Lt,Jr,Ht,Hr,Gn.x,Gn.y)&&xt(Gn.prev,Gn,Gn.next)>=0)return!1;Gn=Gn.prevZ}for(;Dn&&Dn.z<=Ri;){if(Dn.x>=Un&&Dn.x<=Kr&&Dn.y>=bn&&Dn.y<=Mi&&Dn!==te&&Dn!==we&&nr(Xe,on,Lt,Jr,Ht,Hr,Dn.x,Dn.y)&&xt(Dn.prev,Dn,Dn.next)>=0)return!1;Dn=Dn.nextZ}return!0}function U(K,Me,Se){var nt=K;do{var te=nt.prev,Ce=nt.next.next;!bt(te,Ce)&&Tr(te,nt,nt.next,Ce)&&ut(te,Ce)&&ut(Ce,te)&&(Me.push(te.i/Se|0),Me.push(nt.i/Se|0),Me.push(Ce.i/Se|0),fr(nt),fr(nt.next),nt=K=Ce),nt=nt.next}while(nt!==K);return q(nt)}function fe(K,Me,Se,nt,te,Ce){var we=K;do{for(var Xe=we.next.next;Xe!==we.prev;){if(we.i!==Xe.i&&Vt(we,Xe)){var Lt=qe(we,Xe);we=q(we,we.next),Lt=q(Lt,Lt.next),he(we,Me,Se,nt,te,Ce,0),he(Lt,Me,Se,nt,te,Ce,0);return}Xe=Xe.next}we=we.next}while(we!==K)}function se(K,Me,Se,nt){var te=[],Ce,we,Xe,Lt,Ht;for(Ce=0,we=Me.length;Ce<we;Ce++)Xe=Me[Ce]*nt,Lt=Ce<we-1?Me[Ce+1]*nt:K.length,Ht=L(K,Xe,Lt,nt,!1),Ht===Ht.next&&(Ht.steiner=!0),te.push(Zt(Ht));for(te.sort(Qe),Ce=0;Ce<te.length;Ce++)Se=ae(te[Ce],Se);return Se}function Qe(K,Me){return K.x-Me.x}function ae(K,Me){var Se=et(K,Me);if(!Se)return Me;var nt=qe(Se,K);return q(nt,nt.next),q(Se,Se.next)}function et(K,Me){var Se=Me,nt=K.x,te=K.y,Ce=-1/0,we;do{if(te<=Se.y&&te>=Se.next.y&&Se.next.y!==Se.y){var Xe=Se.x+(te-Se.y)*(Se.next.x-Se.x)/(Se.next.y-Se.y);if(Xe<=nt&&Xe>Ce&&(Ce=Xe,we=Se.x<Se.next.x?Se:Se.next,Xe===nt))return we}Se=Se.next}while(Se!==Me);if(!we)return null;var Lt=we,Ht=we.x,on=we.y,Jr=1/0,Hr;Se=we;do nt>=Se.x&&Se.x>=Ht&&nt!==Se.x&&nr(te<on?nt:Ce,te,Ht,on,te<on?Ce:nt,te,Se.x,Se.y)&&(Hr=Math.abs(te-Se.y)/(nt-Se.x),ut(Se,K)&&(Hr<Jr||Hr===Jr&&(Se.x>we.x||Se.x===we.x&&dt(we,Se)))&&(we=Se,Jr=Hr)),Se=Se.next;while(Se!==Lt);return we}function dt(K,Me){return xt(K.prev,K,Me.prev)<0&&xt(Me.next,K,K.next)<0}function Ye(K,Me,Se,nt){var te=K;do te.z===0&&(te.z=Xt(te.x,te.y,Me,Se,nt)),te.prevZ=te.prev,te.nextZ=te.next,te=te.next;while(te!==K);te.prevZ.nextZ=null,te.prevZ=null,wt(te)}function wt(K){var Me,Se,nt,te,Ce,we,Xe,Lt,Ht=1;do{for(Se=K,K=null,Ce=null,we=0;Se;){for(we++,nt=Se,Xe=0,Me=0;Me<Ht&&(Xe++,nt=nt.nextZ,!!nt);Me++);for(Lt=Ht;Xe>0||Lt>0&&nt;)Xe!==0&&(Lt===0||!nt||Se.z<=nt.z)?(te=Se,Se=Se.nextZ,Xe--):(te=nt,nt=nt.nextZ,Lt--),Ce?Ce.nextZ=te:K=te,te.prevZ=Ce,Ce=te;Se=nt}Ce.nextZ=null,Ht*=2}while(we>1);return K}function Xt(K,Me,Se,nt,te){return K=(K-Se)*te|0,Me=(Me-nt)*te|0,K=(K|K<<8)&16711935,K=(K|K<<4)&252645135,K=(K|K<<2)&858993459,K=(K|K<<1)&1431655765,Me=(Me|Me<<8)&16711935,Me=(Me|Me<<4)&252645135,Me=(Me|Me<<2)&858993459,Me=(Me|Me<<1)&1431655765,K|Me<<1}function Zt(K){var Me=K,Se=K;do(Me.x<Se.x||Me.x===Se.x&&Me.y<Se.y)&&(Se=Me),Me=Me.next;while(Me!==K);return Se}function nr(K,Me,Se,nt,te,Ce,we,Xe){return(te-we)*(Me-Xe)>=(K-we)*(Ce-Xe)&&(K-we)*(nt-Xe)>=(Se-we)*(Me-Xe)&&(Se-we)*(Ce-Xe)>=(te-we)*(nt-Xe)}function Vt(K,Me){return K.next.i!==Me.i&&K.prev.i!==Me.i&&!At(K,Me)&&(ut(K,Me)&&ut(Me,K)&&It(K,Me)&&(xt(K.prev,K,Me.prev)||xt(K,Me.prev,Me))||bt(K,Me)&&xt(K.prev,K,K.next)>0&&xt(Me.prev,Me,Me.next)>0)}function xt(K,Me,Se){return(Me.y-K.y)*(Se.x-Me.x)-(Me.x-K.x)*(Se.y-Me.y)}function bt(K,Me){return K.x===Me.x&&K.y===Me.y}function Tr(K,Me,Se,nt){var te=lr(xt(K,Me,Se)),Ce=lr(xt(K,Me,nt)),we=lr(xt(Se,nt,K)),Xe=lr(xt(Se,nt,Me));return!!(te!==Ce&&we!==Xe||te===0&&hr(K,Se,Me)||Ce===0&&hr(K,nt,Me)||we===0&&hr(Se,K,nt)||Xe===0&&hr(Se,Me,nt))}function hr(K,Me,Se){return Me.x<=Math.max(K.x,Se.x)&&Me.x>=Math.min(K.x,Se.x)&&Me.y<=Math.max(K.y,Se.y)&&Me.y>=Math.min(K.y,Se.y)}function lr(K){return K>0?1:K<0?-1:0}function At(K,Me){var Se=K;do{if(Se.i!==K.i&&Se.next.i!==K.i&&Se.i!==Me.i&&Se.next.i!==Me.i&&Tr(Se,Se.next,K,Me))return!0;Se=Se.next}while(Se!==K);return!1}function ut(K,Me){return xt(K.prev,K,K.next)<0?xt(K,Me,K.next)>=0&&xt(K,K.prev,Me)>=0:xt(K,Me,K.prev)<0||xt(K,K.next,Me)<0}function It(K,Me){var Se=K,nt=!1,te=(K.x+Me.x)/2,Ce=(K.y+Me.y)/2;do Se.y>Ce!=Se.next.y>Ce&&Se.next.y!==Se.y&&te<(Se.next.x-Se.x)*(Ce-Se.y)/(Se.next.y-Se.y)+Se.x&&(nt=!nt),Se=Se.next;while(Se!==K);return nt}function qe(K,Me){var Se=new re(K.i,K.x,K.y),nt=new re(Me.i,Me.x,Me.y),te=K.next,Ce=Me.prev;return K.next=Me,Me.prev=K,Se.next=te,te.prev=Se,nt.next=Se,Se.prev=nt,Ce.next=nt,nt.prev=Ce,nt}function Ct(K,Me,Se,nt){var te=new re(K,Me,Se);return nt?(te.next=nt.next,te.prev=nt,nt.next.prev=te,nt.next=te):(te.prev=te,te.next=te),te}function fr(K){K.next.prev=K.prev,K.prev.next=K.next,K.prevZ&&(K.prevZ.nextZ=K.nextZ),K.nextZ&&(K.nextZ.prevZ=K.prevZ)}function re(K,Me,Se){this.i=K,this.x=Me,this.y=Se,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}ee.deviation=function(K,Me,Se,nt){var te=Me&&Me.length,Ce=te?Me[0]*Se:K.length,we=Math.abs(V(K,0,Ce,Se));if(te)for(var Xe=0,Lt=Me.length;Xe<Lt;Xe++){var Ht=Me[Xe]*Se,on=Xe<Lt-1?Me[Xe+1]*Se:K.length;we-=Math.abs(V(K,Ht,on,Se))}var Jr=0;for(Xe=0;Xe<nt.length;Xe+=3){var Hr=nt[Xe]*Se,Un=nt[Xe+1]*Se,bn=nt[Xe+2]*Se;Jr+=Math.abs((K[Hr]-K[bn])*(K[Un+1]-K[Hr+1])-(K[Hr]-K[Un])*(K[bn+1]-K[Hr+1]))}return we===0&&Jr===0?0:Math.abs((Jr-we)/we)};function V(K,Me,Se,nt){for(var te=0,Ce=Me,we=Se-nt;Ce<Se;Ce+=nt)te+=(K[we]-K[Ce])*(K[Ce+1]+K[we+1]),we=Ce;return te}ee.flatten=function(K){for(var Me=K[0][0].length,Se={vertices:[],holes:[],dimensions:Me},nt=0,te=0;te<K.length;te++){for(var Ce=0;Ce<K[te].length;Ce++)for(var we=0;we<Me;we++)Se.vertices.push(K[te][Ce][we]);te>0&&(nt+=K[te-1].length,Se.holes.push(nt))}return Se}},73827:function(rr){function ee(q){var he=q.target||q.srcElement;he.__resizeRAF__&&cancelAnimationFrame(he.__resizeRAF__),he.__resizeRAF__=requestAnimationFrame(function(){var _=he.__resizeTrigger__,le=_&&_.__resizeListeners__;le&&le.forEach(function(U){U.call(_,q)})})}var L=function(he,_){var le=this,U=le.document,fe,se=U.attachEvent;typeof navigator!="undefined"&&(fe=navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/Edge/));function Qe(){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__,this.contentDocument.defaultView.addEventListener("resize",ee)}if(!he.__resizeListeners__)if(he.__resizeListeners__=[],se)he.__resizeTrigger__=he,he.attachEvent("onresize",ee);else{getComputedStyle(he).position==="static"&&(he.style.position="relative");var ae=he.__resizeTrigger__=U.createElement("object");ae.setAttribute("style","position: absolute; top: 0; left: 0; height: 100%; width: 100%; pointer-events: none; z-index: -1; opacity: 0;"),ae.setAttribute("class","resize-sensor"),ae.setAttribute("tabindex","-1"),ae.setAttribute("title",""),ae.__resizeElement__=he,ae.onload=Qe,ae.type="text/html",fe&&he.appendChild(ae),ae.data="about:blank",fe||he.appendChild(ae)}he.__resizeListeners__.push(_)};rr.exports=typeof window=="undefined"?L:L.bind(window),rr.exports.unbind=function(q,he){var _=document.attachEvent,le=q.__resizeListeners__||[];if(he){var U=le.indexOf(he);U!==-1&&le.splice(U,1)}else le=q.__resizeListeners__=[];if(!le.length){if(_)q.detachEvent("onresize",ee);else if(q.__resizeTrigger__){var fe=q.__resizeTrigger__.contentDocument,se=fe&&fe.defaultView;se&&(se.removeEventListener("resize",ee),delete se.__resizeTrigger__),q.__resizeTrigger__=!q.removeChild(q.__resizeTrigger__)}delete q.__resizeListeners__}}},11488:function(rr){"use strict";var ee=Object.prototype.hasOwnProperty,L="~";function q(){}Object.create&&(q.prototype=Object.create(null),new q().__proto__||(L=!1));function he(fe,se,Qe){this.fn=fe,this.context=se,this.once=Qe||!1}function _(fe,se,Qe,ae,et){if(typeof Qe!="function")throw new TypeError("The listener must be a function");var dt=new he(Qe,ae||fe,et),Ye=L?L+se:se;return fe._events[Ye]?fe._events[Ye].fn?fe._events[Ye]=[fe._events[Ye],dt]:fe._events[Ye].push(dt):(fe._events[Ye]=dt,fe._eventsCount++),fe}function le(fe,se){--fe._eventsCount===0?fe._events=new q:delete fe._events[se]}function U(){this._events=new q,this._eventsCount=0}U.prototype.eventNames=function(){var se=[],Qe,ae;if(this._eventsCount===0)return se;for(ae in Qe=this._events)ee.call(Qe,ae)&&se.push(L?ae.slice(1):ae);return Object.getOwnPropertySymbols?se.concat(Object.getOwnPropertySymbols(Qe)):se},U.prototype.listeners=function(se){var Qe=L?L+se:se,ae=this._events[Qe];if(!ae)return[];if(ae.fn)return[ae.fn];for(var et=0,dt=ae.length,Ye=new Array(dt);et<dt;et++)Ye[et]=ae[et].fn;return Ye},U.prototype.listenerCount=function(se){var Qe=L?L+se:se,ae=this._events[Qe];return ae?ae.fn?1:ae.length:0},U.prototype.emit=function(se,Qe,ae,et,dt,Ye){var wt=L?L+se:se;if(!this._events[wt])return!1;var Xt=this._events[wt],Zt=arguments.length,nr,Vt;if(Xt.fn){switch(Xt.once&&this.removeListener(se,Xt.fn,void 0,!0),Zt){case 1:return Xt.fn.call(Xt.context),!0;case 2:return Xt.fn.call(Xt.context,Qe),!0;case 3:return Xt.fn.call(Xt.context,Qe,ae),!0;case 4:return Xt.fn.call(Xt.context,Qe,ae,et),!0;case 5:return Xt.fn.call(Xt.context,Qe,ae,et,dt),!0;case 6:return Xt.fn.call(Xt.context,Qe,ae,et,dt,Ye),!0}for(Vt=1,nr=new Array(Zt-1);Vt<Zt;Vt++)nr[Vt-1]=arguments[Vt];Xt.fn.apply(Xt.context,nr)}else{var xt=Xt.length,bt;for(Vt=0;Vt<xt;Vt++)switch(Xt[Vt].once&&this.removeListener(se,Xt[Vt].fn,void 0,!0),Zt){case 1:Xt[Vt].fn.call(Xt[Vt].context);break;case 2:Xt[Vt].fn.call(Xt[Vt].context,Qe);break;case 3:Xt[Vt].fn.call(Xt[Vt].context,Qe,ae);break;case 4:Xt[Vt].fn.call(Xt[Vt].context,Qe,ae,et);break;default:if(!nr)for(bt=1,nr=new Array(Zt-1);bt<Zt;bt++)nr[bt-1]=arguments[bt];Xt[Vt].fn.apply(Xt[Vt].context,nr)}}return!0},U.prototype.on=function(se,Qe,ae){return _(this,se,Qe,ae,!1)},U.prototype.once=function(se,Qe,ae){return _(this,se,Qe,ae,!0)},U.prototype.removeListener=function(se,Qe,ae,et){var dt=L?L+se:se;if(!this._events[dt])return this;if(!Qe)return le(this,dt),this;var Ye=this._events[dt];if(Ye.fn)Ye.fn===Qe&&(!et||Ye.once)&&(!ae||Ye.context===ae)&&le(this,dt);else{for(var wt=0,Xt=[],Zt=Ye.length;wt<Zt;wt++)(Ye[wt].fn!==Qe||et&&!Ye[wt].once||ae&&Ye[wt].context!==ae)&&Xt.push(Ye[wt]);Xt.length?this._events[dt]=Xt.length===1?Xt[0]:Xt:le(this,dt)}return this},U.prototype.removeAllListeners=function(se){var Qe;return se?(Qe=L?L+se:se,this._events[Qe]&&le(this,Qe)):(this._events=new q,this._eventsCount=0),this},U.prototype.off=U.prototype.removeListener,U.prototype.addListener=U.prototype.on,U.prefixed=L,U.EventEmitter=U,rr.exports=U},75772:function(rr,ee,L){var q;(function(he,_,le,U){"use strict";var fe=["","webkit","Moz","MS","ms","o"],se=_.createElement("div"),Qe="function",ae=Math.round,et=Math.abs,dt=Date.now;function Ye(de,Re,ct){return setTimeout(Tr(de,ct),Re)}function wt(de,Re,ct){return Array.isArray(de)?(Xt(de,ct[Re],ct),!0):!1}function Xt(de,Re,ct){var or;if(de)if(de.forEach)de.forEach(Re,ct);else if(de.length!==U)for(or=0;or<de.length;)Re.call(ct,de[or],or,de),or++;else for(or in de)de.hasOwnProperty(or)&&Re.call(ct,de[or],or,de)}function Zt(de,Re,ct){var or="DEPRECATED METHOD: "+Re+`
|
|
`+ct+` AT
|
|
`;return function(){var jr=new Error("get-stack-trace"),In=jr&&jr.stack?jr.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Hi=he.console&&(he.console.warn||he.console.log);return Hi&&Hi.call(he.console,or,In),de.apply(this,arguments)}}var nr;typeof Object.assign!="function"?nr=function(Re){if(Re===U||Re===null)throw new TypeError("Cannot convert undefined or null to object");for(var ct=Object(Re),or=1;or<arguments.length;or++){var jr=arguments[or];if(jr!==U&&jr!==null)for(var In in jr)jr.hasOwnProperty(In)&&(ct[In]=jr[In])}return ct}:nr=Object.assign;var Vt=Zt(function(Re,ct,or){for(var jr=Object.keys(ct),In=0;In<jr.length;)(!or||or&&Re[jr[In]]===U)&&(Re[jr[In]]=ct[jr[In]]),In++;return Re},"extend","Use `assign`."),xt=Zt(function(Re,ct){return Vt(Re,ct,!0)},"merge","Use `assign`.");function bt(de,Re,ct){var or=Re.prototype,jr;jr=de.prototype=Object.create(or),jr.constructor=de,jr._super=or,ct&&nr(jr,ct)}function Tr(de,Re){return function(){return de.apply(Re,arguments)}}function hr(de,Re){return typeof de==Qe?de.apply(Re&&Re[0]||U,Re):de}function lr(de,Re){return de===U?Re:de}function At(de,Re,ct){Xt(Ct(Re),function(or){de.addEventListener(or,ct,!1)})}function ut(de,Re,ct){Xt(Ct(Re),function(or){de.removeEventListener(or,ct,!1)})}function It(de,Re){for(;de;){if(de==Re)return!0;de=de.parentNode}return!1}function qe(de,Re){return de.indexOf(Re)>-1}function Ct(de){return de.trim().split(/\s+/g)}function fr(de,Re,ct){if(de.indexOf&&!ct)return de.indexOf(Re);for(var or=0;or<de.length;){if(ct&&de[or][ct]==Re||!ct&&de[or]===Re)return or;or++}return-1}function re(de){return Array.prototype.slice.call(de,0)}function V(de,Re,ct){for(var or=[],jr=[],In=0;In<de.length;){var Hi=Re?de[In][Re]:de[In];fr(jr,Hi)<0&&or.push(de[In]),jr[In]=Hi,In++}return ct&&(Re?or=or.sort(function(To,co){return To[Re]>co[Re]}):or=or.sort()),or}function K(de,Re){for(var ct,or,jr=Re[0].toUpperCase()+Re.slice(1),In=0;In<fe.length;){if(ct=fe[In],or=ct?ct+jr:Re,or in de)return or;In++}return U}var Me=1;function Se(){return Me++}function nt(de){var Re=de.ownerDocument||de;return Re.defaultView||Re.parentWindow||he}var te=/mobile|tablet|ip(ad|hone|od)|android/i,Ce="ontouchstart"in he,we=K(he,"PointerEvent")!==U,Xe=Ce&&te.test(navigator.userAgent),Lt="touch",Ht="pen",on="mouse",Jr="kinect",Hr=25,Un=1,bn=2,Kr=4,Mi=8,Si=1,Ri=2,Gn=4,Dn=8,Ya=16,Yi=Ri|Gn,Na=Dn|Ya,Dt=Yi|Na,k=["x","y"],ie=["clientX","clientY"];function ve(de,Re){var ct=this;this.manager=de,this.callback=Re,this.element=de.element,this.target=de.options.inputTarget,this.domHandler=function(or){hr(de.options.enable,[de])&&ct.handler(or)},this.init()}ve.prototype={handler:function(){},init:function(){this.evEl&&At(this.element,this.evEl,this.domHandler),this.evTarget&&At(this.target,this.evTarget,this.domHandler),this.evWin&&At(nt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&ut(this.element,this.evEl,this.domHandler),this.evTarget&&ut(this.target,this.evTarget,this.domHandler),this.evWin&&ut(nt(this.element),this.evWin,this.domHandler)}};function Ze(de){var Re,ct=de.options.inputClass;return ct?Re=ct:we?Re=J:Xe?Re=Le:Ce?Re=wr:Re=Qi,new Re(de,_t)}function _t(de,Re,ct){var or=ct.pointers.length,jr=ct.changedPointers.length,In=Re&Un&&or-jr===0,Hi=Re&(Kr|Mi)&&or-jr===0;ct.isFirst=!!In,ct.isFinal=!!Hi,In&&(de.session={}),ct.eventType=Re,Wt(de,ct),de.emit("hammer.input",ct),de.recognize(ct),de.session.prevInput=ct}function Wt(de,Re){var ct=de.session,or=Re.pointers,jr=or.length;ct.firstInput||(ct.firstInput=Et(Re)),jr>1&&!ct.firstMultiple?ct.firstMultiple=Et(Re):jr===1&&(ct.firstMultiple=!1);var In=ct.firstInput,Hi=ct.firstMultiple,vo=Hi?Hi.center:In.center,To=Re.center=cr(or);Re.timeStamp=dt(),Re.deltaTime=Re.timeStamp-In.timeStamp,Re.angle=En(vo,To),Re.distance=Fn(vo,To),Sr(ct,Re),Re.offsetDirection=Zr(Re.deltaX,Re.deltaY);var co=mr(Re.deltaTime,Re.deltaX,Re.deltaY);Re.overallVelocityX=co.x,Re.overallVelocityY=co.y,Re.overallVelocity=et(co.x)>et(co.y)?co.x:co.y,Re.scale=Hi?fn(Hi.pointers,or):1,Re.rotation=Hi?Cn(Hi.pointers,or):0,Re.maxPointers=ct.prevInput?Re.pointers.length>ct.prevInput.maxPointers?Re.pointers.length:ct.prevInput.maxPointers:Re.pointers.length,He(ct,Re);var Ps=de.element;It(Re.srcEvent.target,Ps)&&(Ps=Re.srcEvent.target),Re.target=Ps}function Sr(de,Re){var ct=Re.center,or=de.offsetDelta||{},jr=de.prevDelta||{},In=de.prevInput||{};(Re.eventType===Un||In.eventType===Kr)&&(jr=de.prevDelta={x:In.deltaX||0,y:In.deltaY||0},or=de.offsetDelta={x:ct.x,y:ct.y}),Re.deltaX=jr.x+(ct.x-or.x),Re.deltaY=jr.y+(ct.y-or.y)}function He(de,Re){var ct=de.lastInterval||Re,or=Re.timeStamp-ct.timeStamp,jr,In,Hi,vo;if(Re.eventType!=Mi&&(or>Hr||ct.velocity===U)){var To=Re.deltaX-ct.deltaX,co=Re.deltaY-ct.deltaY,Ps=mr(or,To,co);In=Ps.x,Hi=Ps.y,jr=et(Ps.x)>et(Ps.y)?Ps.x:Ps.y,vo=Zr(To,co),de.lastInterval=Re}else jr=ct.velocity,In=ct.velocityX,Hi=ct.velocityY,vo=ct.direction;Re.velocity=jr,Re.velocityX=In,Re.velocityY=Hi,Re.direction=vo}function Et(de){for(var Re=[],ct=0;ct<de.pointers.length;)Re[ct]={clientX:ae(de.pointers[ct].clientX),clientY:ae(de.pointers[ct].clientY)},ct++;return{timeStamp:dt(),pointers:Re,center:cr(Re),deltaX:de.deltaX,deltaY:de.deltaY}}function cr(de){var Re=de.length;if(Re===1)return{x:ae(de[0].clientX),y:ae(de[0].clientY)};for(var ct=0,or=0,jr=0;jr<Re;)ct+=de[jr].clientX,or+=de[jr].clientY,jr++;return{x:ae(ct/Re),y:ae(or/Re)}}function mr(de,Re,ct){return{x:Re/de||0,y:ct/de||0}}function Zr(de,Re){return de===Re?Si:et(de)>=et(Re)?de<0?Ri:Gn:Re<0?Dn:Ya}function Fn(de,Re,ct){ct||(ct=k);var or=Re[ct[0]]-de[ct[0]],jr=Re[ct[1]]-de[ct[1]];return Math.sqrt(or*or+jr*jr)}function En(de,Re,ct){ct||(ct=k);var or=Re[ct[0]]-de[ct[0]],jr=Re[ct[1]]-de[ct[1]];return Math.atan2(jr,or)*180/Math.PI}function Cn(de,Re){return En(Re[1],Re[0],ie)+En(de[1],de[0],ie)}function fn(de,Re){return Fn(Re[0],Re[1],ie)/Fn(de[0],de[1],ie)}var ni={mousedown:Un,mousemove:bn,mouseup:Kr},Yn="mousedown",oa="mousemove mouseup";function Qi(){this.evEl=Yn,this.evWin=oa,this.pressed=!1,ve.apply(this,arguments)}bt(Qi,ve,{handler:function(Re){var ct=ni[Re.type];ct&Un&&Re.button===0&&(this.pressed=!0),ct&bn&&Re.which!==1&&(ct=Kr),this.pressed&&(ct&Kr&&(this.pressed=!1),this.callback(this.manager,ct,{pointers:[Re],changedPointers:[Re],pointerType:on,srcEvent:Re}))}});var lo={pointerdown:Un,pointermove:bn,pointerup:Kr,pointercancel:Mi,pointerout:Mi},Is={2:Lt,3:Ht,4:on,5:Jr},hi="pointerdown",W="pointermove pointerup pointercancel";he.MSPointerEvent&&!he.PointerEvent&&(hi="MSPointerDown",W="MSPointerMove MSPointerUp MSPointerCancel");function J(){this.evEl=hi,this.evWin=W,ve.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}bt(J,ve,{handler:function(Re){var ct=this.store,or=!1,jr=Re.type.toLowerCase().replace("ms",""),In=lo[jr],Hi=Is[Re.pointerType]||Re.pointerType,vo=Hi==Lt,To=fr(ct,Re.pointerId,"pointerId");In&Un&&(Re.button===0||vo)?To<0&&(ct.push(Re),To=ct.length-1):In&(Kr|Mi)&&(or=!0),!(To<0)&&(ct[To]=Re,this.callback(this.manager,In,{pointers:ct,changedPointers:[Re],pointerType:Hi,srcEvent:Re}),or&&ct.splice(To,1))}});var oe={touchstart:Un,touchmove:bn,touchend:Kr,touchcancel:Mi},be="touchstart",Oe="touchstart touchmove touchend touchcancel";function it(){this.evTarget=be,this.evWin=Oe,this.started=!1,ve.apply(this,arguments)}bt(it,ve,{handler:function(Re){var ct=oe[Re.type];if(ct===Un&&(this.started=!0),!!this.started){var or=pt.call(this,Re,ct);ct&(Kr|Mi)&&or[0].length-or[1].length===0&&(this.started=!1),this.callback(this.manager,ct,{pointers:or[0],changedPointers:or[1],pointerType:Lt,srcEvent:Re})}}});function pt(de,Re){var ct=re(de.touches),or=re(de.changedTouches);return Re&(Kr|Mi)&&(ct=V(ct.concat(or),"identifier",!0)),[ct,or]}var j={touchstart:Un,touchmove:bn,touchend:Kr,touchcancel:Mi},Q="touchstart touchmove touchend touchcancel";function Le(){this.evTarget=Q,this.targetIds={},ve.apply(this,arguments)}bt(Le,ve,{handler:function(Re){var ct=j[Re.type],or=at.call(this,Re,ct);or&&this.callback(this.manager,ct,{pointers:or[0],changedPointers:or[1],pointerType:Lt,srcEvent:Re})}});function at(de,Re){var ct=re(de.touches),or=this.targetIds;if(Re&(Un|bn)&&ct.length===1)return or[ct[0].identifier]=!0,[ct,ct];var jr,In,Hi=re(de.changedTouches),vo=[],To=this.target;if(In=ct.filter(function(co){return It(co.target,To)}),Re===Un)for(jr=0;jr<In.length;)or[In[jr].identifier]=!0,jr++;for(jr=0;jr<Hi.length;)or[Hi[jr].identifier]&&vo.push(Hi[jr]),Re&(Kr|Mi)&&delete or[Hi[jr].identifier],jr++;if(vo.length)return[V(In.concat(vo),"identifier",!0),vo]}var Ee=2500,ir=25;function wr(){ve.apply(this,arguments);var de=Tr(this.handler,this);this.touch=new Le(this.manager,de),this.mouse=new Qi(this.manager,de),this.primaryTouch=null,this.lastTouches=[]}bt(wr,ve,{handler:function(Re,ct,or){var jr=or.pointerType==Lt,In=or.pointerType==on;if(!(In&&or.sourceCapabilities&&or.sourceCapabilities.firesTouchEvents)){if(jr)An.call(this,ct,or);else if(In&&sr.call(this,or))return;this.callback(Re,ct,or)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function An(de,Re){de&Un?(this.primaryTouch=Re.changedPointers[0].identifier,sn.call(this,Re)):de&(Kr|Mi)&&sn.call(this,Re)}function sn(de){var Re=de.changedPointers[0];if(Re.identifier===this.primaryTouch){var ct={x:Re.clientX,y:Re.clientY};this.lastTouches.push(ct);var or=this.lastTouches,jr=function(){var In=or.indexOf(ct);In>-1&&or.splice(In,1)};setTimeout(jr,Ee)}}function sr(de){for(var Re=de.srcEvent.clientX,ct=de.srcEvent.clientY,or=0;or<this.lastTouches.length;or++){var jr=this.lastTouches[or],In=Math.abs(Re-jr.x),Hi=Math.abs(ct-jr.y);if(In<=ir&&Hi<=ir)return!0}return!1}var en=K(se.style,"touchAction"),Wr=en!==U,Yr="compute",pi="auto",tn="manipulation",vi="none",qi="pan-x",ci="pan-y",zi=Ji();function Ai(de,Re){this.manager=de,this.set(Re)}Ai.prototype={set:function(de){de==Yr&&(de=this.compute()),Wr&&this.manager.element.style&&zi[de]&&(this.manager.element.style[en]=de),this.actions=de.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var de=[];return Xt(this.manager.recognizers,function(Re){hr(Re.options.enable,[Re])&&(de=de.concat(Re.getTouchAction()))}),Xo(de.join(" "))},preventDefaults:function(de){var Re=de.srcEvent,ct=de.offsetDirection;if(this.manager.session.prevented){Re.preventDefault();return}var or=this.actions,jr=qe(or,vi)&&!zi[vi],In=qe(or,ci)&&!zi[ci],Hi=qe(or,qi)&&!zi[qi];if(jr){var vo=de.pointers.length===1,To=de.distance<2,co=de.deltaTime<250;if(vo&&To&&co)return}if(!(Hi&&In)&&(jr||In&&ct&Yi||Hi&&ct&Na))return this.preventSrc(Re)},preventSrc:function(de){this.manager.session.prevented=!0,de.preventDefault()}};function Xo(de){if(qe(de,vi))return vi;var Re=qe(de,qi),ct=qe(de,ci);return Re&&ct?vi:Re||ct?Re?qi:ci:qe(de,tn)?tn:pi}function Ji(){if(!Wr)return!1;var de={},Re=he.CSS&&he.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(ct){de[ct]=Re?he.CSS.supports("touch-action",ct):!0}),de}var Ia=1,Ti=2,mi=4,wi=8,Pa=wi,cu=16,ma=32;function Aa(de){this.options=nr({},this.defaults,de||{}),this.id=Se(),this.manager=null,this.options.enable=lr(this.options.enable,!0),this.state=Ia,this.simultaneous={},this.requireFail=[]}Aa.prototype={defaults:{},set:function(de){return nr(this.options,de),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(de){if(wt(de,"recognizeWith",this))return this;var Re=this.simultaneous;return de=Ta(de,this),Re[de.id]||(Re[de.id]=de,de.recognizeWith(this)),this},dropRecognizeWith:function(de){return wt(de,"dropRecognizeWith",this)?this:(de=Ta(de,this),delete this.simultaneous[de.id],this)},requireFailure:function(de){if(wt(de,"requireFailure",this))return this;var Re=this.requireFail;return de=Ta(de,this),fr(Re,de)===-1&&(Re.push(de),de.requireFailure(this)),this},dropRequireFailure:function(de){if(wt(de,"dropRequireFailure",this))return this;de=Ta(de,this);var Re=fr(this.requireFail,de);return Re>-1&&this.requireFail.splice(Re,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(de){return!!this.simultaneous[de.id]},emit:function(de){var Re=this,ct=this.state;function or(jr){Re.manager.emit(jr,de)}ct<wi&&or(Re.options.event+$l(ct)),or(Re.options.event),de.additionalEvent&&or(de.additionalEvent),ct>=wi&&or(Re.options.event+$l(ct))},tryEmit:function(de){if(this.canEmit())return this.emit(de);this.state=ma},canEmit:function(){for(var de=0;de<this.requireFail.length;){if(!(this.requireFail[de].state&(ma|Ia)))return!1;de++}return!0},recognize:function(de){var Re=nr({},de);if(!hr(this.options.enable,[this,Re])){this.reset(),this.state=ma;return}this.state&(Pa|cu|ma)&&(this.state=Ia),this.state=this.process(Re),this.state&(Ti|mi|wi|cu)&&this.tryEmit(Re)},process:function(de){},getTouchAction:function(){},reset:function(){}};function $l(de){return de&cu?"cancel":de&wi?"end":de&mi?"move":de&Ti?"start":""}function os(de){return de==Ya?"down":de==Dn?"up":de==Ri?"left":de==Gn?"right":""}function Ta(de,Re){var ct=Re.manager;return ct?ct.get(de):de}function fi(){Aa.apply(this,arguments)}bt(fi,Aa,{defaults:{pointers:1},attrTest:function(de){var Re=this.options.pointers;return Re===0||de.pointers.length===Re},process:function(de){var Re=this.state,ct=de.eventType,or=Re&(Ti|mi),jr=this.attrTest(de);return or&&(ct&Mi||!jr)?Re|cu:or||jr?ct&Kr?Re|wi:Re&Ti?Re|mi:Ti:ma}});function Oa(){fi.apply(this,arguments),this.pX=null,this.pY=null}bt(Oa,fi,{defaults:{event:"pan",threshold:10,pointers:1,direction:Dt},getTouchAction:function(){var de=this.options.direction,Re=[];return de&Yi&&Re.push(ci),de&Na&&Re.push(qi),Re},directionTest:function(de){var Re=this.options,ct=!0,or=de.distance,jr=de.direction,In=de.deltaX,Hi=de.deltaY;return jr&Re.direction||(Re.direction&Yi?(jr=In===0?Si:In<0?Ri:Gn,ct=In!=this.pX,or=Math.abs(de.deltaX)):(jr=Hi===0?Si:Hi<0?Dn:Ya,ct=Hi!=this.pY,or=Math.abs(de.deltaY))),de.direction=jr,ct&&or>Re.threshold&&jr&Re.direction},attrTest:function(de){return fi.prototype.attrTest.call(this,de)&&(this.state&Ti||!(this.state&Ti)&&this.directionTest(de))},emit:function(de){this.pX=de.deltaX,this.pY=de.deltaY;var Re=os(de.direction);Re&&(de.additionalEvent=this.options.event+Re),this._super.emit.call(this,de)}});function sa(){fi.apply(this,arguments)}bt(sa,fi,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[vi]},attrTest:function(de){return this._super.attrTest.call(this,de)&&(Math.abs(de.scale-1)>this.options.threshold||this.state&Ti)},emit:function(de){if(de.scale!==1){var Re=de.scale<1?"in":"out";de.additionalEvent=this.options.event+Re}this._super.emit.call(this,de)}});function Ao(){Aa.apply(this,arguments),this._timer=null,this._input=null}bt(Ao,Aa,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[pi]},process:function(de){var Re=this.options,ct=de.pointers.length===Re.pointers,or=de.distance<Re.threshold,jr=de.deltaTime>Re.time;if(this._input=de,!or||!ct||de.eventType&(Kr|Mi)&&!jr)this.reset();else if(de.eventType&Un)this.reset(),this._timer=Ye(function(){this.state=Pa,this.tryEmit()},Re.time,this);else if(de.eventType&Kr)return Pa;return ma},reset:function(){clearTimeout(this._timer)},emit:function(de){this.state===Pa&&(de&&de.eventType&Kr?this.manager.emit(this.options.event+"up",de):(this._input.timeStamp=dt(),this.manager.emit(this.options.event,this._input)))}});function ha(){fi.apply(this,arguments)}bt(ha,fi,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[vi]},attrTest:function(de){return this._super.attrTest.call(this,de)&&(Math.abs(de.rotation)>this.options.threshold||this.state&Ti)}});function $o(){fi.apply(this,arguments)}bt($o,fi,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Yi|Na,pointers:1},getTouchAction:function(){return Oa.prototype.getTouchAction.call(this)},attrTest:function(de){var Re=this.options.direction,ct;return Re&(Yi|Na)?ct=de.overallVelocity:Re&Yi?ct=de.overallVelocityX:Re&Na&&(ct=de.overallVelocityY),this._super.attrTest.call(this,de)&&Re&de.offsetDirection&&de.distance>this.options.threshold&&de.maxPointers==this.options.pointers&&et(ct)>this.options.velocity&&de.eventType&Kr},emit:function(de){var Re=os(de.offsetDirection);Re&&this.manager.emit(this.options.event+Re,de),this.manager.emit(this.options.event,de)}});function Vo(){Aa.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}bt(Vo,Aa,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[tn]},process:function(de){var Re=this.options,ct=de.pointers.length===Re.pointers,or=de.distance<Re.threshold,jr=de.deltaTime<Re.time;if(this.reset(),de.eventType&Un&&this.count===0)return this.failTimeout();if(or&&jr&&ct){if(de.eventType!=Kr)return this.failTimeout();var In=this.pTime?de.timeStamp-this.pTime<Re.interval:!0,Hi=!this.pCenter||Fn(this.pCenter,de.center)<Re.posThreshold;this.pTime=de.timeStamp,this.pCenter=de.center,!Hi||!In?this.count=1:this.count+=1,this._input=de;var vo=this.count%Re.taps;if(vo===0)return this.hasRequireFailures()?(this._timer=Ye(function(){this.state=Pa,this.tryEmit()},Re.interval,this),Ti):Pa}return ma},failTimeout:function(){return this._timer=Ye(function(){this.state=ma},this.options.interval,this),ma},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Pa&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ru(de,Re){return Re=Re||{},Re.recognizers=lr(Re.recognizers,Ru.defaults.preset),new Ea(de,Re)}Ru.VERSION="2.0.7",Ru.defaults={domEvents:!1,touchAction:Yr,enable:!0,inputTarget:null,inputClass:null,preset:[[ha,{enable:!1}],[sa,{enable:!1},["rotate"]],[$o,{direction:Yi}],[Oa,{direction:Yi},["swipe"]],[Vo],[Vo,{event:"doubletap",taps:2},["tap"]],[Ao]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ss=1,Cc=2;function Ea(de,Re){this.options=nr({},Ru.defaults,Re||{}),this.options.inputTarget=this.options.inputTarget||de,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=de,this.input=Ze(this),this.touchAction=new Ai(this,this.options.touchAction),ea(this,!0),Xt(this.options.recognizers,function(ct){var or=this.add(new ct[0](ct[1]));ct[2]&&or.recognizeWith(ct[2]),ct[3]&&or.requireFailure(ct[3])},this)}Ea.prototype={set:function(de){return nr(this.options,de),de.touchAction&&this.touchAction.update(),de.inputTarget&&(this.input.destroy(),this.input.target=de.inputTarget,this.input.init()),this},stop:function(de){this.session.stopped=de?Cc:ss},recognize:function(de){var Re=this.session;if(!Re.stopped){this.touchAction.preventDefaults(de);var ct,or=this.recognizers,jr=Re.curRecognizer;(!jr||jr&&jr.state&Pa)&&(jr=Re.curRecognizer=null);for(var In=0;In<or.length;)ct=or[In],Re.stopped!==Cc&&(!jr||ct==jr||ct.canRecognizeWith(jr))?ct.recognize(de):ct.reset(),!jr&&ct.state&(Ti|mi|wi)&&(jr=Re.curRecognizer=ct),In++}},get:function(de){if(de instanceof Aa)return de;for(var Re=this.recognizers,ct=0;ct<Re.length;ct++)if(Re[ct].options.event==de)return Re[ct];return null},add:function(de){if(wt(de,"add",this))return this;var Re=this.get(de.options.event);return Re&&this.remove(Re),this.recognizers.push(de),de.manager=this,this.touchAction.update(),de},remove:function(de){if(wt(de,"remove",this))return this;if(de=this.get(de),de){var Re=this.recognizers,ct=fr(Re,de);ct!==-1&&(Re.splice(ct,1),this.touchAction.update())}return this},on:function(de,Re){if(de!==U&&Re!==U){var ct=this.handlers;return Xt(Ct(de),function(or){ct[or]=ct[or]||[],ct[or].push(Re)}),this}},off:function(de,Re){if(de!==U){var ct=this.handlers;return Xt(Ct(de),function(or){Re?ct[or]&&ct[or].splice(fr(ct[or],Re),1):delete ct[or]}),this}},emit:function(de,Re){this.options.domEvents&&Kt(de,Re);var ct=this.handlers[de]&&this.handlers[de].slice();if(!(!ct||!ct.length)){Re.type=de,Re.preventDefault=function(){Re.srcEvent.preventDefault()};for(var or=0;or<ct.length;)ct[or](Re),or++}},destroy:function(){this.element&&ea(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function ea(de,Re){var ct=de.element;if(ct.style){var or;Xt(de.options.cssProps,function(jr,In){or=K(ct.style,In),Re?(de.oldCssProps[or]=ct.style[or],ct.style[or]=jr):ct.style[or]=de.oldCssProps[or]||""}),Re||(de.oldCssProps={})}}function Kt(de,Re){var ct=_.createEvent("Event");ct.initEvent(de,!0,!0),ct.gesture=Re,Re.target.dispatchEvent(ct)}nr(Ru,{INPUT_START:Un,INPUT_MOVE:bn,INPUT_END:Kr,INPUT_CANCEL:Mi,STATE_POSSIBLE:Ia,STATE_BEGAN:Ti,STATE_CHANGED:mi,STATE_ENDED:wi,STATE_RECOGNIZED:Pa,STATE_CANCELLED:cu,STATE_FAILED:ma,DIRECTION_NONE:Si,DIRECTION_LEFT:Ri,DIRECTION_RIGHT:Gn,DIRECTION_UP:Dn,DIRECTION_DOWN:Ya,DIRECTION_HORIZONTAL:Yi,DIRECTION_VERTICAL:Na,DIRECTION_ALL:Dt,Manager:Ea,Input:ve,TouchAction:Ai,TouchInput:Le,MouseInput:Qi,PointerEventInput:J,TouchMouseInput:wr,SingleTouchInput:it,Recognizer:Aa,AttrRecognizer:fi,Tap:Vo,Pan:Oa,Swipe:$o,Pinch:sa,Rotate:ha,Press:Ao,on:At,off:ut,each:Xt,merge:xt,extend:Vt,assign:nr,inherit:bt,bindFn:Tr,prefixed:K});var Sn=typeof he!="undefined"?he:typeof self!="undefined"?self:{};Sn.Hammer=Ru,q=function(){return Ru}.call(ee,L,ee,rr),q!==U&&(rr.exports=q)})(window,document,"Hammer")},34686:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0});var L=Symbol.for("INJECTION");function q(fe,se,Qe,ae){function et(){return ae&&!Reflect.hasMetadata(L,this,se)&&Reflect.defineMetadata(L,Qe(),this,se),Reflect.hasMetadata(L,this,se)?Reflect.getMetadata(L,this,se):Qe()}function dt(Ye){Reflect.defineMetadata(L,Ye,this,se)}Object.defineProperty(fe,se,{configurable:!0,enumerable:!0,get:et,set:dt})}function he(fe,se){return function(Qe){return function(ae,et){var dt=function(){return fe.get(Qe)};q(ae,et,dt,se)}}}ee.makePropertyInjectDecorator=he;function _(fe,se){return function(Qe,ae){return function(et,dt){var Ye=function(){return fe.getNamed(Qe,ae)};q(et,dt,Ye,se)}}}ee.makePropertyInjectNamedDecorator=_;function le(fe,se){return function(Qe,ae,et){return function(dt,Ye){var wt=function(){return fe.getTagged(Qe,ae,et)};q(dt,Ye,wt,se)}}}ee.makePropertyInjectTaggedDecorator=le;function U(fe,se){return function(Qe){return function(ae,et){var dt=function(){return fe.getAll(Qe)};q(ae,et,dt,se)}}}ee.makePropertyMultiInjectDecorator=U},82615:function(rr,ee,L){"use strict";var q;q={value:!0};var he=L(34686);function _(le,U){U===void 0&&(U=!0);var fe=he.makePropertyInjectDecorator(le,U),se=he.makePropertyInjectNamedDecorator(le,U),Qe=he.makePropertyInjectTaggedDecorator(le,U),ae=he.makePropertyMultiInjectDecorator(le,U);return{lazyInject:fe,lazyInjectNamed:se,lazyInjectTagged:Qe,lazyMultiInject:ae}}ee.Z=_},90333:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.tagProperty=ee.tagParameter=ee.decorate=void 0;var q=L(52050),he=L(91193);function _(ae,et,dt,Ye){var wt=he.TAGGED;U(wt,ae,et,Ye,dt)}ee.tagParameter=_;function le(ae,et,dt){var Ye=he.TAGGED_PROP;U(Ye,ae.constructor,et,dt)}ee.tagProperty=le;function U(ae,et,dt,Ye,wt){var Xt={},Zt=typeof wt=="number",nr=wt!==void 0&&Zt?wt.toString():dt;if(Zt&&dt!==void 0)throw new Error(q.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(ae,et)&&(Xt=Reflect.getMetadata(ae,et));var Vt=Xt[nr];if(!Array.isArray(Vt))Vt=[];else for(var xt=0,bt=Vt;xt<bt.length;xt++){var Tr=bt[xt];if(Tr.key===Ye.key)throw new Error(q.DUPLICATED_METADATA+" "+Tr.key.toString())}Vt.push(Ye),Xt[nr]=Vt,Reflect.defineMetadata(ae,Xt,et)}function fe(ae,et){Reflect.decorate(ae,et)}function se(ae,et){return function(dt,Ye){et(dt,Ye,ae)}}function Qe(ae,et,dt){typeof dt=="number"?fe([se(dt,ae)],et):typeof dt=="string"?Reflect.decorate([ae],et,dt):fe([ae],et)}ee.decorate=Qe},70105:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.inject=ee.LazyServiceIdentifer=void 0;var q=L(52050),he=L(91193),_=L(55650),le=L(90333),U=function(){function se(Qe){this._cb=Qe}return se.prototype.unwrap=function(){return this._cb()},se}();ee.LazyServiceIdentifer=U;function fe(se){return function(Qe,ae,et){if(se===void 0)throw new Error(q.UNDEFINED_INJECT_ANNOTATION(Qe.name));var dt=new _.Metadata(he.INJECT_TAG,se);typeof et=="number"?le.tagParameter(Qe,ae,et,dt):le.tagProperty(Qe,ae,dt)}}ee.inject=fe},9719:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.injectable=void 0;var q=L(52050),he=L(91193);function _(){return function(le){if(Reflect.hasOwnMetadata(he.PARAM_TYPES,le))throw new Error(q.DUPLICATED_INJECTABLE_DECORATOR);var U=Reflect.getMetadata(he.DESIGN_PARAM_TYPES,le)||[];return Reflect.defineMetadata(he.PARAM_TYPES,U,le),le}}ee.injectable=_},81623:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.multiInject=void 0;var q=L(91193),he=L(55650),_=L(90333);function le(U){return function(fe,se,Qe){var ae=new he.Metadata(q.MULTI_INJECT_TAG,U);typeof Qe=="number"?_.tagParameter(fe,se,Qe,ae):_.tagProperty(fe,se,ae)}}ee.multiInject=le},69481:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.named=void 0;var q=L(91193),he=L(55650),_=L(90333);function le(U){return function(fe,se,Qe){var ae=new he.Metadata(q.NAMED_TAG,U);typeof Qe=="number"?_.tagParameter(fe,se,Qe,ae):_.tagProperty(fe,se,ae)}}ee.named=le},35231:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.optional=void 0;var q=L(91193),he=L(55650),_=L(90333);function le(){return function(U,fe,se){var Qe=new he.Metadata(q.OPTIONAL_TAG,!0);typeof se=="number"?_.tagParameter(U,fe,se,Qe):_.tagProperty(U,fe,Qe)}}ee.optional=le},17419:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.postConstruct=void 0;var q=L(52050),he=L(91193),_=L(55650);function le(){return function(U,fe,se){var Qe=new _.Metadata(he.POST_CONSTRUCT,fe);if(Reflect.hasOwnMetadata(he.POST_CONSTRUCT,U.constructor))throw new Error(q.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(he.POST_CONSTRUCT,Qe,U.constructor)}}ee.postConstruct=le},97404:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.tagged=void 0;var q=L(55650),he=L(90333);function _(le,U){return function(fe,se,Qe){var ae=new q.Metadata(le,U);typeof Qe=="number"?he.tagParameter(fe,se,Qe,ae):he.tagProperty(fe,se,ae)}}ee.tagged=_},11580:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.targetName=void 0;var q=L(91193),he=L(55650),_=L(90333);function le(U){return function(fe,se,Qe){var ae=new he.Metadata(q.NAME_TAG,U);_.tagParameter(fe,se,Qe,ae)}}ee.targetName=le},8814:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.unmanaged=void 0;var q=L(91193),he=L(55650),_=L(90333);function le(){return function(U,fe,se){var Qe=new he.Metadata(q.UNMANAGED_TAG,!0);_.tagParameter(U,fe,se,Qe)}}ee.unmanaged=le},45210:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Binding=void 0;var q=L(88795),he=L(18576),_=function(){function le(U,fe){this.id=he.id(),this.activated=!1,this.serviceIdentifier=U,this.scope=fe,this.type=q.BindingTypeEnum.Invalid,this.constraint=function(se){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return le.prototype.clone=function(){var U=new le(this.serviceIdentifier,this.scope);return U.activated=U.scope===q.BindingScopeEnum.Singleton?this.activated:!1,U.implementationType=this.implementationType,U.dynamicValue=this.dynamicValue,U.scope=this.scope,U.type=this.type,U.factory=this.factory,U.provider=this.provider,U.constraint=this.constraint,U.onActivation=this.onActivation,U.cache=this.cache,U},le}();ee.Binding=_},44276:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingCount=void 0;var L={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};ee.BindingCount=L},52050:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.STACK_OVERFLOW=ee.CIRCULAR_DEPENDENCY_IN_FACTORY=ee.POST_CONSTRUCT_ERROR=ee.MULTIPLE_POST_CONSTRUCT_METHODS=ee.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=ee.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=ee.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=ee.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=ee.ARGUMENTS_LENGTH_MISMATCH=ee.INVALID_DECORATOR_OPERATION=ee.INVALID_TO_SELF_VALUE=ee.INVALID_FUNCTION_BINDING=ee.INVALID_MIDDLEWARE_RETURN=ee.NO_MORE_SNAPSHOTS_AVAILABLE=ee.INVALID_BINDING_TYPE=ee.NOT_IMPLEMENTED=ee.CIRCULAR_DEPENDENCY=ee.UNDEFINED_INJECT_ANNOTATION=ee.MISSING_INJECT_ANNOTATION=ee.MISSING_INJECTABLE_ANNOTATION=ee.NOT_REGISTERED=ee.CANNOT_UNBIND=ee.AMBIGUOUS_MATCH=ee.KEY_NOT_FOUND=ee.NULL_ARGUMENT=ee.DUPLICATED_METADATA=ee.DUPLICATED_INJECTABLE_DECORATOR=void 0,ee.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",ee.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",ee.NULL_ARGUMENT="NULL argument",ee.KEY_NOT_FOUND="Key Not Found",ee.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",ee.CANNOT_UNBIND="Could not unbind serviceIdentifier:",ee.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",ee.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",ee.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";var L=function(le){return"@inject called with undefined this could mean that the class "+le+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."};ee.UNDEFINED_INJECT_ANNOTATION=L,ee.CIRCULAR_DEPENDENCY="Circular dependency found:",ee.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",ee.INVALID_BINDING_TYPE="Invalid binding type:",ee.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",ee.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",ee.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",ee.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",ee.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";var q=function(){for(var le=[],U=0;U<arguments.length;U++)le[U]=arguments[U];return"The number of constructor arguments in the derived class "+(le[0]+" must be >= than the number of constructor arguments of its base class.")};ee.ARGUMENTS_LENGTH_MISMATCH=q,ee.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",ee.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",ee.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",ee.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",ee.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";var he=function(){for(var le=[],U=0;U<arguments.length;U++)le[U]=arguments[U];return"@postConstruct error in class "+le[0]+": "+le[1]};ee.POST_CONSTRUCT_ERROR=he;var _=function(){for(var le=[],U=0;U<arguments.length;U++)le[U]=arguments[U];return"It looks like there is a circular dependency "+("in one of the '"+le[0]+"' bindings. Please investigate bindings with")+("service identifier '"+le[1]+"'.")};ee.CIRCULAR_DEPENDENCY_IN_FACTORY=_,ee.STACK_OVERFLOW="Maximum call stack size exceeded"},88795:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.TargetTypeEnum=ee.BindingTypeEnum=ee.BindingScopeEnum=void 0;var L={Request:"Request",Singleton:"Singleton",Transient:"Transient"};ee.BindingScopeEnum=L;var q={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};ee.BindingTypeEnum=q;var he={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};ee.TargetTypeEnum=he},91193:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.NON_CUSTOM_TAG_KEYS=ee.POST_CONSTRUCT=ee.DESIGN_PARAM_TYPES=ee.PARAM_TYPES=ee.TAGGED_PROP=ee.TAGGED=ee.MULTI_INJECT_TAG=ee.INJECT_TAG=ee.OPTIONAL_TAG=ee.UNMANAGED_TAG=ee.NAME_TAG=ee.NAMED_TAG=void 0,ee.NAMED_TAG="named",ee.NAME_TAG="name",ee.UNMANAGED_TAG="unmanaged",ee.OPTIONAL_TAG="optional",ee.INJECT_TAG="inject",ee.MULTI_INJECT_TAG="multi_inject",ee.TAGGED="inversify:tagged",ee.TAGGED_PROP="inversify:tagged_props",ee.PARAM_TYPES="inversify:paramtypes",ee.DESIGN_PARAM_TYPES="design:paramtypes",ee.POST_CONSTRUCT="post_construct";function L(){return[ee.INJECT_TAG,ee.MULTI_INJECT_TAG,ee.NAME_TAG,ee.UNMANAGED_TAG,ee.NAMED_TAG,ee.OPTIONAL_TAG]}ee.NON_CUSTOM_TAG_KEYS=L()},46769:function(rr,ee,L){"use strict";var q=this&&this.__awaiter||function(Vt,xt,bt,Tr){function hr(lr){return lr instanceof bt?lr:new bt(function(At){At(lr)})}return new(bt||(bt=Promise))(function(lr,At){function ut(Ct){try{qe(Tr.next(Ct))}catch(fr){At(fr)}}function It(Ct){try{qe(Tr.throw(Ct))}catch(fr){At(fr)}}function qe(Ct){Ct.done?lr(Ct.value):hr(Ct.value).then(ut,It)}qe((Tr=Tr.apply(Vt,xt||[])).next())})},he=this&&this.__generator||function(Vt,xt){var bt={label:0,sent:function(){if(lr[0]&1)throw lr[1];return lr[1]},trys:[],ops:[]},Tr,hr,lr,At;return At={next:ut(0),throw:ut(1),return:ut(2)},typeof Symbol=="function"&&(At[Symbol.iterator]=function(){return this}),At;function ut(qe){return function(Ct){return It([qe,Ct])}}function It(qe){if(Tr)throw new TypeError("Generator is already executing.");for(;bt;)try{if(Tr=1,hr&&(lr=qe[0]&2?hr.return:qe[0]?hr.throw||((lr=hr.return)&&lr.call(hr),0):hr.next)&&!(lr=lr.call(hr,qe[1])).done)return lr;switch(hr=0,lr&&(qe=[qe[0]&2,lr.value]),qe[0]){case 0:case 1:lr=qe;break;case 4:return bt.label++,{value:qe[1],done:!1};case 5:bt.label++,hr=qe[1],qe=[0];continue;case 7:qe=bt.ops.pop(),bt.trys.pop();continue;default:if(lr=bt.trys,!(lr=lr.length>0&&lr[lr.length-1])&&(qe[0]===6||qe[0]===2)){bt=0;continue}if(qe[0]===3&&(!lr||qe[1]>lr[0]&&qe[1]<lr[3])){bt.label=qe[1];break}if(qe[0]===6&&bt.label<lr[1]){bt.label=lr[1],lr=qe;break}if(lr&&bt.label<lr[2]){bt.label=lr[2],bt.ops.push(qe);break}lr[2]&&bt.ops.pop(),bt.trys.pop();continue}qe=xt.call(Vt,bt)}catch(Ct){qe=[6,Ct],hr=0}finally{Tr=lr=0}if(qe[0]&5)throw qe[1];return{value:qe[0]?qe[1]:void 0,done:!0}}},_=this&&this.__spreadArray||function(Vt,xt){for(var bt=0,Tr=xt.length,hr=Vt.length;bt<Tr;bt++,hr++)Vt[hr]=xt[bt];return Vt};Object.defineProperty(ee,"__esModule",{value:!0}),ee.Container=void 0;var le=L(45210),U=L(52050),fe=L(88795),se=L(91193),Qe=L(54594),ae=L(53353),et=L(87536),dt=L(43085),Ye=L(18576),wt=L(80030),Xt=L(80522),Zt=L(96382),nr=function(){function Vt(xt){this._appliedMiddleware=[];var bt=xt||{};if(typeof bt!="object")throw new Error(""+U.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(bt.defaultScope===void 0)bt.defaultScope=fe.BindingScopeEnum.Transient;else if(bt.defaultScope!==fe.BindingScopeEnum.Singleton&&bt.defaultScope!==fe.BindingScopeEnum.Transient&&bt.defaultScope!==fe.BindingScopeEnum.Request)throw new Error(""+U.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(bt.autoBindInjectable===void 0)bt.autoBindInjectable=!1;else if(typeof bt.autoBindInjectable!="boolean")throw new Error(""+U.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(bt.skipBaseClassChecks===void 0)bt.skipBaseClassChecks=!1;else if(typeof bt.skipBaseClassChecks!="boolean")throw new Error(""+U.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:bt.autoBindInjectable,defaultScope:bt.defaultScope,skipBaseClassChecks:bt.skipBaseClassChecks},this.id=Ye.id(),this._bindingDictionary=new Zt.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new Qe.MetadataReader}return Vt.merge=function(xt,bt){for(var Tr=[],hr=2;hr<arguments.length;hr++)Tr[hr-2]=arguments[hr];var lr=new Vt,At=_([xt,bt],Tr).map(function(qe){return ae.getBindingDictionary(qe)}),ut=ae.getBindingDictionary(lr);function It(qe,Ct){qe.traverse(function(fr,re){re.forEach(function(V){Ct.add(V.serviceIdentifier,V.clone())})})}return At.forEach(function(qe){It(qe,ut)}),lr},Vt.prototype.load=function(){for(var xt=[],bt=0;bt<arguments.length;bt++)xt[bt]=arguments[bt];for(var Tr=this._getContainerModuleHelpersFactory(),hr=0,lr=xt;hr<lr.length;hr++){var At=lr[hr],ut=Tr(At.id);At.registry(ut.bindFunction,ut.unbindFunction,ut.isboundFunction,ut.rebindFunction)}},Vt.prototype.loadAsync=function(){for(var xt=[],bt=0;bt<arguments.length;bt++)xt[bt]=arguments[bt];return q(this,void 0,void 0,function(){var Tr,hr,lr,At,ut;return he(this,function(It){switch(It.label){case 0:Tr=this._getContainerModuleHelpersFactory(),hr=0,lr=xt,It.label=1;case 1:return hr<lr.length?(At=lr[hr],ut=Tr(At.id),[4,At.registry(ut.bindFunction,ut.unbindFunction,ut.isboundFunction,ut.rebindFunction)]):[3,4];case 2:It.sent(),It.label=3;case 3:return hr++,[3,1];case 4:return[2]}})})},Vt.prototype.unload=function(){for(var xt=this,bt=[],Tr=0;Tr<arguments.length;Tr++)bt[Tr]=arguments[Tr];var hr=function(lr){return function(At){return At.moduleId===lr}};bt.forEach(function(lr){var At=hr(lr.id);xt._bindingDictionary.removeByCondition(At)})},Vt.prototype.bind=function(xt){var bt=this.options.defaultScope||fe.BindingScopeEnum.Transient,Tr=new le.Binding(xt,bt);return this._bindingDictionary.add(xt,Tr),new dt.BindingToSyntax(Tr)},Vt.prototype.rebind=function(xt){return this.unbind(xt),this.bind(xt)},Vt.prototype.unbind=function(xt){try{this._bindingDictionary.remove(xt)}catch(bt){throw new Error(U.CANNOT_UNBIND+" "+wt.getServiceIdentifierAsString(xt))}},Vt.prototype.unbindAll=function(){this._bindingDictionary=new Zt.Lookup},Vt.prototype.isBound=function(xt){var bt=this._bindingDictionary.hasKey(xt);return!bt&&this.parent&&(bt=this.parent.isBound(xt)),bt},Vt.prototype.isBoundNamed=function(xt,bt){return this.isBoundTagged(xt,se.NAMED_TAG,bt)},Vt.prototype.isBoundTagged=function(xt,bt,Tr){var hr=!1;if(this._bindingDictionary.hasKey(xt)){var lr=this._bindingDictionary.get(xt),At=ae.createMockRequest(this,xt,bt,Tr);hr=lr.some(function(ut){return ut.constraint(At)})}return!hr&&this.parent&&(hr=this.parent.isBoundTagged(xt,bt,Tr)),hr},Vt.prototype.snapshot=function(){this._snapshots.push(Xt.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},Vt.prototype.restore=function(){var xt=this._snapshots.pop();if(xt===void 0)throw new Error(U.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=xt.bindings,this._middleware=xt.middleware},Vt.prototype.createChild=function(xt){var bt=new Vt(xt||this.options);return bt.parent=this,bt},Vt.prototype.applyMiddleware=function(){for(var xt=[],bt=0;bt<arguments.length;bt++)xt[bt]=arguments[bt];this._appliedMiddleware=this._appliedMiddleware.concat(xt);var Tr=this._middleware?this._middleware:this._planAndResolve();this._middleware=xt.reduce(function(hr,lr){return lr(hr)},Tr)},Vt.prototype.applyCustomMetadataReader=function(xt){this._metadataReader=xt},Vt.prototype.get=function(xt){return this._get(!1,!1,fe.TargetTypeEnum.Variable,xt)},Vt.prototype.getTagged=function(xt,bt,Tr){return this._get(!1,!1,fe.TargetTypeEnum.Variable,xt,bt,Tr)},Vt.prototype.getNamed=function(xt,bt){return this.getTagged(xt,se.NAMED_TAG,bt)},Vt.prototype.getAll=function(xt){return this._get(!0,!0,fe.TargetTypeEnum.Variable,xt)},Vt.prototype.getAllTagged=function(xt,bt,Tr){return this._get(!1,!0,fe.TargetTypeEnum.Variable,xt,bt,Tr)},Vt.prototype.getAllNamed=function(xt,bt){return this.getAllTagged(xt,se.NAMED_TAG,bt)},Vt.prototype.resolve=function(xt){var bt=this.createChild();return bt.bind(xt).toSelf(),this._appliedMiddleware.forEach(function(Tr){bt.applyMiddleware(Tr)}),bt.get(xt)},Vt.prototype._getContainerModuleHelpersFactory=function(){var xt=this,bt=function(ut,It){ut._binding.moduleId=It},Tr=function(ut){return function(It){var qe=xt.bind.bind(xt),Ct=qe(It);return bt(Ct,ut),Ct}},hr=function(ut){return function(It){var qe=xt.unbind.bind(xt);qe(It)}},lr=function(ut){return function(It){var qe=xt.isBound.bind(xt);return qe(It)}},At=function(ut){return function(It){var qe=xt.rebind.bind(xt),Ct=qe(It);return bt(Ct,ut),Ct}};return function(ut){return{bindFunction:Tr(ut),isboundFunction:lr(ut),rebindFunction:At(ut),unbindFunction:hr(ut)}}},Vt.prototype._get=function(xt,bt,Tr,hr,lr,At){var ut=null,It={avoidConstraints:xt,contextInterceptor:function(qe){return qe},isMultiInject:bt,key:lr,serviceIdentifier:hr,targetType:Tr,value:At};if(this._middleware){if(ut=this._middleware(It),ut==null)throw new Error(U.INVALID_MIDDLEWARE_RETURN)}else ut=this._planAndResolve()(It);return ut},Vt.prototype._planAndResolve=function(){var xt=this;return function(bt){var Tr=ae.plan(xt._metadataReader,xt,bt.isMultiInject,bt.targetType,bt.serviceIdentifier,bt.key,bt.value,bt.avoidConstraints);Tr=bt.contextInterceptor(Tr);var hr=et.resolve(Tr);return hr}},Vt}();ee.Container=nr},69377:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.AsyncContainerModule=ee.ContainerModule=void 0;var q=L(18576),he=function(){function le(U){this.id=q.id(),this.registry=U}return le}();ee.ContainerModule=he;var _=function(){function le(U){this.id=q.id(),this.registry=U}return le}();ee.AsyncContainerModule=_},80522:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.ContainerSnapshot=void 0;var L=function(){function q(){}return q.of=function(he,_){var le=new q;return le.bindings=he,le.middleware=_,le},q}();ee.ContainerSnapshot=L},96382:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Lookup=void 0;var q=L(52050),he=function(){function _(){this._map=new Map}return _.prototype.getMap=function(){return this._map},_.prototype.add=function(le,U){if(le==null)throw new Error(q.NULL_ARGUMENT);if(U==null)throw new Error(q.NULL_ARGUMENT);var fe=this._map.get(le);fe!==void 0?(fe.push(U),this._map.set(le,fe)):this._map.set(le,[U])},_.prototype.get=function(le){if(le==null)throw new Error(q.NULL_ARGUMENT);var U=this._map.get(le);if(U!==void 0)return U;throw new Error(q.KEY_NOT_FOUND)},_.prototype.remove=function(le){if(le==null)throw new Error(q.NULL_ARGUMENT);if(!this._map.delete(le))throw new Error(q.KEY_NOT_FOUND)},_.prototype.removeByCondition=function(le){var U=this;this._map.forEach(function(fe,se){var Qe=fe.filter(function(ae){return!le(ae)});Qe.length>0?U._map.set(se,Qe):U._map.delete(se)})},_.prototype.hasKey=function(le){if(le==null)throw new Error(q.NULL_ARGUMENT);return this._map.has(le)},_.prototype.clone=function(){var le=new _;return this._map.forEach(function(U,fe){U.forEach(function(se){return le.add(fe,se.clone())})}),le},_.prototype.traverse=function(le){this._map.forEach(function(U,fe){le(fe,U)})},_}();ee.Lookup=he},31331:function(rr,ee,L){"use strict";var q;q={value:!0},q=q=q=q=q=q=ee.GW=q=q=ee.zY=q=q=q=q=q=ee.f3=q=q=ee.b2=q=q=q=q=q=ee.W2=q=void 0;var he=L(91193);q=he;var _=L(46769);Object.defineProperty(ee,"W2",{enumerable:!0,get:function(){return _.Container}});var le=L(88795);q={enumerable:!0,get:function(){return le.BindingScopeEnum}},q={enumerable:!0,get:function(){return le.BindingTypeEnum}},q={enumerable:!0,get:function(){return le.TargetTypeEnum}};var U=L(69377);q={enumerable:!0,get:function(){return U.AsyncContainerModule}},q={enumerable:!0,get:function(){return U.ContainerModule}};var fe=L(9719);Object.defineProperty(ee,"b2",{enumerable:!0,get:function(){return fe.injectable}});var se=L(97404);q={enumerable:!0,get:function(){return se.tagged}};var Qe=L(69481);q={enumerable:!0,get:function(){return Qe.named}};var ae=L(70105);Object.defineProperty(ee,"f3",{enumerable:!0,get:function(){return ae.inject}}),q={enumerable:!0,get:function(){return ae.LazyServiceIdentifer}};var et=L(35231);q={enumerable:!0,get:function(){return et.optional}};var dt=L(8814);q={enumerable:!0,get:function(){return dt.unmanaged}};var Ye=L(81623);q={enumerable:!0,get:function(){return Ye.multiInject}};var wt=L(11580);q={enumerable:!0,get:function(){return wt.targetName}};var Xt=L(17419);Object.defineProperty(ee,"zY",{enumerable:!0,get:function(){return Xt.postConstruct}});var Zt=L(54594);q={enumerable:!0,get:function(){return Zt.MetadataReader}};var nr=L(18576);q={enumerable:!0,get:function(){return nr.id}};var Vt=L(90333);Object.defineProperty(ee,"GW",{enumerable:!0,get:function(){return Vt.decorate}});var xt=L(18307);q={enumerable:!0,get:function(){return xt.traverseAncerstors}},q={enumerable:!0,get:function(){return xt.taggedConstraint}},q={enumerable:!0,get:function(){return xt.namedConstraint}},q={enumerable:!0,get:function(){return xt.typeConstraint}};var bt=L(80030);q={enumerable:!0,get:function(){return bt.getServiceIdentifierAsString}};var Tr=L(55605);q={enumerable:!0,get:function(){return Tr.multiBindToService}}},52887:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Context=void 0;var q=L(18576),he=function(){function _(le){this.id=q.id(),this.container=le}return _.prototype.addPlan=function(le){this.plan=le},_.prototype.setCurrentRequest=function(le){this.currentRequest=le},_}();ee.Context=he},55650:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Metadata=void 0;var q=L(91193),he=function(){function _(le,U){this.key=le,this.value=U}return _.prototype.toString=function(){return this.key===q.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},_}();ee.Metadata=he},54594:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.MetadataReader=void 0;var q=L(91193),he=function(){function _(){}return _.prototype.getConstructorMetadata=function(le){var U=Reflect.getMetadata(q.PARAM_TYPES,le),fe=Reflect.getMetadata(q.TAGGED,le);return{compilerGeneratedMetadata:U,userGeneratedMetadata:fe||{}}},_.prototype.getPropertiesMetadata=function(le){var U=Reflect.getMetadata(q.TAGGED_PROP,le)||[];return U},_}();ee.MetadataReader=he},21800:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Plan=void 0;var L=function(){function q(he,_){this.parentContext=he,this.rootRequest=_}return q}();ee.Plan=L},53353:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.getBindingDictionary=ee.createMockRequest=ee.plan=void 0;var q=L(44276),he=L(52050),_=L(88795),le=L(91193),U=L(83817),fe=L(80030),se=L(52887),Qe=L(55650),ae=L(21800),et=L(73630),dt=L(13571),Ye=L(79060);function wt(hr){return hr._bindingDictionary}ee.getBindingDictionary=wt;function Xt(hr,lr,At,ut,It,qe){var Ct=hr?le.MULTI_INJECT_TAG:le.INJECT_TAG,fr=new Qe.Metadata(Ct,At),re=new Ye.Target(lr,ut,At,fr);if(It!==void 0){var V=new Qe.Metadata(It,qe);re.metadata.push(V)}return re}function Zt(hr,lr,At,ut,It){var qe=xt(At.container,It.serviceIdentifier),Ct=[];return qe.length===q.BindingCount.NoBindingsAvailable&&At.container.options.autoBindInjectable&&typeof It.serviceIdentifier=="function"&&hr.getConstructorMetadata(It.serviceIdentifier).compilerGeneratedMetadata&&(At.container.bind(It.serviceIdentifier).toSelf(),qe=xt(At.container,It.serviceIdentifier)),lr?Ct=qe:Ct=qe.filter(function(fr){var re=new dt.Request(fr.serviceIdentifier,At,ut,fr,It);return fr.constraint(re)}),nr(It.serviceIdentifier,Ct,It,At.container),Ct}function nr(hr,lr,At,ut){switch(lr.length){case q.BindingCount.NoBindingsAvailable:if(At.isOptional())return lr;var It=fe.getServiceIdentifierAsString(hr),qe=he.NOT_REGISTERED;throw qe+=fe.listMetadataForTarget(It,At),qe+=fe.listRegisteredBindingsForServiceIdentifier(ut,It,xt),new Error(qe);case q.BindingCount.OnlyOneBindingAvailable:if(!At.isArray())return lr;case q.BindingCount.MultipleBindingsAvailable:default:if(At.isArray())return lr;var It=fe.getServiceIdentifierAsString(hr),qe=he.AMBIGUOUS_MATCH+" "+It;throw qe+=fe.listRegisteredBindingsForServiceIdentifier(ut,It,xt),new Error(qe)}}function Vt(hr,lr,At,ut,It,qe){var Ct,fr;if(It===null){Ct=Zt(hr,lr,ut,null,qe),fr=new dt.Request(At,ut,null,Ct,qe);var re=new ae.Plan(ut,fr);ut.addPlan(re)}else Ct=Zt(hr,lr,ut,It,qe),fr=It.addChildRequest(qe.serviceIdentifier,Ct,qe);Ct.forEach(function(V){var K=null;if(qe.isArray())K=fr.addChildRequest(V.serviceIdentifier,V,qe);else{if(V.cache)return;K=fr}if(V.type===_.BindingTypeEnum.Instance&&V.implementationType!==null){var Me=et.getDependencies(hr,V.implementationType);if(!ut.container.options.skipBaseClassChecks){var Se=et.getBaseClassDependencyCount(hr,V.implementationType);if(Me.length<Se){var nt=he.ARGUMENTS_LENGTH_MISMATCH(et.getFunctionName(V.implementationType));throw new Error(nt)}}Me.forEach(function(te){Vt(hr,!1,te.serviceIdentifier,ut,K,te)})}})}function xt(hr,lr){var At=[],ut=wt(hr);return ut.hasKey(lr)?At=ut.get(lr):hr.parent!==null&&(At=xt(hr.parent,lr)),At}function bt(hr,lr,At,ut,It,qe,Ct,fr){fr===void 0&&(fr=!1);var re=new se.Context(lr),V=Xt(At,ut,It,"",qe,Ct);try{return Vt(hr,fr,It,re,null,V),re}catch(K){throw U.isStackOverflowExeption(K)&&re.plan&&fe.circularDependencyToException(re.plan.rootRequest),K}}ee.plan=bt;function Tr(hr,lr,At,ut){var It=new Ye.Target(_.TargetTypeEnum.Variable,"",lr,new Qe.Metadata(At,ut)),qe=new se.Context(hr),Ct=new dt.Request(lr,qe,null,[],It);return Ct}ee.createMockRequest=Tr},83925:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.QueryableString=void 0;var L=function(){function q(he){this.str=he}return q.prototype.startsWith=function(he){return this.str.indexOf(he)===0},q.prototype.endsWith=function(he){var _="",le=he.split("").reverse().join("");return _=this.str.split("").reverse().join(""),this.startsWith.call({str:_},le)},q.prototype.contains=function(he){return this.str.indexOf(he)!==-1},q.prototype.equals=function(he){return this.str===he},q.prototype.value=function(){return this.str},q}();ee.QueryableString=L},73630:function(rr,ee,L){"use strict";var q=this&&this.__spreadArray||function(Zt,nr){for(var Vt=0,xt=nr.length,bt=Zt.length;Vt<xt;Vt++,bt++)Zt[bt]=nr[Vt];return Zt};Object.defineProperty(ee,"__esModule",{value:!0}),ee.getFunctionName=ee.getBaseClassDependencyCount=ee.getDependencies=void 0;var he=L(70105),_=L(52050),le=L(88795),U=L(91193),fe=L(80030);Object.defineProperty(ee,"getFunctionName",{enumerable:!0,get:function(){return fe.getFunctionName}});var se=L(79060);function Qe(Zt,nr){var Vt=fe.getFunctionName(nr),xt=ae(Zt,Vt,nr,!1);return xt}ee.getDependencies=Qe;function ae(Zt,nr,Vt,xt){var bt=Zt.getConstructorMetadata(Vt),Tr=bt.compilerGeneratedMetadata;if(Tr===void 0){var hr=_.MISSING_INJECTABLE_ANNOTATION+" "+nr+".";throw new Error(hr)}var lr=bt.userGeneratedMetadata,At=Object.keys(lr),ut=Vt.length===0&&At.length>0,It=At.length>Vt.length,qe=ut||It?At.length:Vt.length,Ct=dt(xt,nr,Tr,lr,qe),fr=Ye(Zt,Vt),re=q(q([],Ct),fr);return re}function et(Zt,nr,Vt,xt,bt){var Tr=bt[Zt.toString()]||[],hr=Xt(Tr),lr=hr.unmanaged!==!0,At=xt[Zt],ut=hr.inject||hr.multiInject;if(At=ut||At,At instanceof he.LazyServiceIdentifer&&(At=At.unwrap()),lr){var It=At===Object,qe=At===Function,Ct=At===void 0,fr=It||qe||Ct;if(!nr&&fr){var re=_.MISSING_INJECT_ANNOTATION+" argument "+Zt+" in class "+Vt+".";throw new Error(re)}var V=new se.Target(le.TargetTypeEnum.ConstructorArgument,hr.targetName,At);return V.metadata=Tr,V}return null}function dt(Zt,nr,Vt,xt,bt){for(var Tr=[],hr=0;hr<bt;hr++){var lr=hr,At=et(lr,Zt,nr,Vt,xt);At!==null&&Tr.push(At)}return Tr}function Ye(Zt,nr){for(var Vt=Zt.getPropertiesMetadata(nr),xt=[],bt=Object.keys(Vt),Tr=0,hr=bt;Tr<hr.length;Tr++){var lr=hr[Tr],At=Vt[lr],ut=Xt(Vt[lr]),It=ut.targetName||lr,qe=ut.inject||ut.multiInject,Ct=new se.Target(le.TargetTypeEnum.ClassProperty,It,qe);Ct.metadata=At,xt.push(Ct)}var fr=Object.getPrototypeOf(nr.prototype).constructor;if(fr!==Object){var re=Ye(Zt,fr);xt=q(q([],xt),re)}return xt}function wt(Zt,nr){var Vt=Object.getPrototypeOf(nr.prototype).constructor;if(Vt!==Object){var xt=fe.getFunctionName(Vt),bt=ae(Zt,xt,Vt,!0),Tr=bt.map(function(At){return At.metadata.filter(function(ut){return ut.key===U.UNMANAGED_TAG})}),hr=[].concat.apply([],Tr).length,lr=bt.length-hr;return lr>0?lr:wt(Zt,Vt)}else return 0}ee.getBaseClassDependencyCount=wt;function Xt(Zt){var nr={};return Zt.forEach(function(Vt){nr[Vt.key.toString()]=Vt.value}),{inject:nr[U.INJECT_TAG],multiInject:nr[U.MULTI_INJECT_TAG],targetName:nr[U.NAME_TAG],unmanaged:nr[U.UNMANAGED_TAG]}}},13571:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Request=void 0;var q=L(18576),he=function(){function _(le,U,fe,se,Qe){this.id=q.id(),this.serviceIdentifier=le,this.parentContext=U,this.parentRequest=fe,this.target=Qe,this.childRequests=[],this.bindings=Array.isArray(se)?se:[se],this.requestScope=fe===null?new Map:null}return _.prototype.addChildRequest=function(le,U,fe){var se=new _(le,this.parentContext,this,U,fe);return this.childRequests.push(se),se},_}();ee.Request=he},79060:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.Target=void 0;var q=L(91193),he=L(18576),_=L(55650),le=L(83925),U=function(){function fe(se,Qe,ae,et){this.id=he.id(),this.type=se,this.serviceIdentifier=ae,this.name=new le.QueryableString(Qe||""),this.metadata=new Array;var dt=null;typeof et=="string"?dt=new _.Metadata(q.NAMED_TAG,et):et instanceof _.Metadata&&(dt=et),dt!==null&&this.metadata.push(dt)}return fe.prototype.hasTag=function(se){for(var Qe=0,ae=this.metadata;Qe<ae.length;Qe++){var et=ae[Qe];if(et.key===se)return!0}return!1},fe.prototype.isArray=function(){return this.hasTag(q.MULTI_INJECT_TAG)},fe.prototype.matchesArray=function(se){return this.matchesTag(q.MULTI_INJECT_TAG)(se)},fe.prototype.isNamed=function(){return this.hasTag(q.NAMED_TAG)},fe.prototype.isTagged=function(){return this.metadata.some(function(se){return q.NON_CUSTOM_TAG_KEYS.every(function(Qe){return se.key!==Qe})})},fe.prototype.isOptional=function(){return this.matchesTag(q.OPTIONAL_TAG)(!0)},fe.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(se){return se.key===q.NAMED_TAG})[0]:null},fe.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(se){return q.NON_CUSTOM_TAG_KEYS.every(function(Qe){return se.key!==Qe})}):null},fe.prototype.matchesNamedTag=function(se){return this.matchesTag(q.NAMED_TAG)(se)},fe.prototype.matchesTag=function(se){var Qe=this;return function(ae){for(var et=0,dt=Qe.metadata;et<dt.length;et++){var Ye=dt[et];if(Ye.key===se&&Ye.value===ae)return!0}return!1}},fe}();ee.Target=U},10003:function(rr,ee,L){"use strict";var q=this&&this.__spreadArray||function(ae,et){for(var dt=0,Ye=et.length,wt=ae.length;dt<Ye;dt++,wt++)ae[wt]=et[dt];return ae};Object.defineProperty(ee,"__esModule",{value:!0}),ee.resolveInstance=void 0;var he=L(52050),_=L(88795),le=L(91193);function U(ae,et,dt){var Ye=et.filter(function(Xt){return Xt.target!==null&&Xt.target.type===_.TargetTypeEnum.ClassProperty}),wt=Ye.map(dt);return Ye.forEach(function(Xt,Zt){var nr="";nr=Xt.target.name.value();var Vt=wt[Zt];ae[nr]=Vt}),ae}function fe(ae,et){return new(ae.bind.apply(ae,q([void 0],et)))}function se(ae,et){if(Reflect.hasMetadata(le.POST_CONSTRUCT,ae)){var dt=Reflect.getMetadata(le.POST_CONSTRUCT,ae);try{et[dt.value]()}catch(Ye){throw new Error(he.POST_CONSTRUCT_ERROR(ae.name,Ye.message))}}}function Qe(ae,et,dt){var Ye=null;if(et.length>0){var wt=et.filter(function(Zt){return Zt.target!==null&&Zt.target.type===_.TargetTypeEnum.ConstructorArgument}),Xt=wt.map(dt);Ye=fe(ae,Xt),Ye=U(Ye,et,dt)}else Ye=new ae;return se(ae,Ye),Ye}ee.resolveInstance=Qe},87536:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.resolve=void 0;var q=L(52050),he=L(88795),_=L(83817),le=L(80030),U=L(10003),fe=function(ae,et,dt){try{return dt()}catch(Ye){throw _.isStackOverflowExeption(Ye)?new Error(q.CIRCULAR_DEPENDENCY_IN_FACTORY(ae,et.toString())):Ye}},se=function(ae){return function(et){et.parentContext.setCurrentRequest(et);var dt=et.bindings,Ye=et.childRequests,wt=et.target&&et.target.isArray(),Xt=!et.parentRequest||!et.parentRequest.target||!et.target||!et.parentRequest.target.matchesArray(et.target.serviceIdentifier);if(wt&&Xt)return Ye.map(function(Tr){var hr=se(ae);return hr(Tr)});var Zt=null;if(et.target.isOptional()&&dt.length===0)return;var nr=dt[0],Vt=nr.scope===he.BindingScopeEnum.Singleton,xt=nr.scope===he.BindingScopeEnum.Request;if(Vt&&nr.activated)return nr.cache;if(xt&&ae!==null&&ae.has(nr.id))return ae.get(nr.id);if(nr.type===he.BindingTypeEnum.ConstantValue)Zt=nr.cache,nr.activated=!0;else if(nr.type===he.BindingTypeEnum.Function)Zt=nr.cache,nr.activated=!0;else if(nr.type===he.BindingTypeEnum.Constructor)Zt=nr.implementationType;else if(nr.type===he.BindingTypeEnum.DynamicValue&&nr.dynamicValue!==null)Zt=fe("toDynamicValue",nr.serviceIdentifier,function(){return nr.dynamicValue(et.parentContext)});else if(nr.type===he.BindingTypeEnum.Factory&&nr.factory!==null)Zt=fe("toFactory",nr.serviceIdentifier,function(){return nr.factory(et.parentContext)});else if(nr.type===he.BindingTypeEnum.Provider&&nr.provider!==null)Zt=fe("toProvider",nr.serviceIdentifier,function(){return nr.provider(et.parentContext)});else if(nr.type===he.BindingTypeEnum.Instance&&nr.implementationType!==null)Zt=U.resolveInstance(nr.implementationType,Ye,se(ae));else{var bt=le.getServiceIdentifierAsString(et.serviceIdentifier);throw new Error(q.INVALID_BINDING_TYPE+" "+bt)}return typeof nr.onActivation=="function"&&(Zt=nr.onActivation(et.parentContext,Zt)),Vt&&(nr.cache=Zt,nr.activated=!0),xt&&ae!==null&&!ae.has(nr.id)&&ae.set(nr.id,Zt),Zt}};function Qe(ae){var et=se(ae.plan.rootRequest.requestScope);return et(ae.plan.rootRequest)}ee.resolve=Qe},55404:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingInSyntax=void 0;var q=L(88795),he=L(65408),_=function(){function le(U){this._binding=U}return le.prototype.inRequestScope=function(){return this._binding.scope=q.BindingScopeEnum.Request,new he.BindingWhenOnSyntax(this._binding)},le.prototype.inSingletonScope=function(){return this._binding.scope=q.BindingScopeEnum.Singleton,new he.BindingWhenOnSyntax(this._binding)},le.prototype.inTransientScope=function(){return this._binding.scope=q.BindingScopeEnum.Transient,new he.BindingWhenOnSyntax(this._binding)},le}();ee.BindingInSyntax=_},48971:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingInWhenOnSyntax=void 0;var q=L(55404),he=L(37326),_=L(64957),le=function(){function U(fe){this._binding=fe,this._bindingWhenSyntax=new _.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new he.BindingOnSyntax(this._binding),this._bindingInSyntax=new q.BindingInSyntax(fe)}return U.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},U.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},U.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},U.prototype.when=function(fe){return this._bindingWhenSyntax.when(fe)},U.prototype.whenTargetNamed=function(fe){return this._bindingWhenSyntax.whenTargetNamed(fe)},U.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},U.prototype.whenTargetTagged=function(fe,se){return this._bindingWhenSyntax.whenTargetTagged(fe,se)},U.prototype.whenInjectedInto=function(fe){return this._bindingWhenSyntax.whenInjectedInto(fe)},U.prototype.whenParentNamed=function(fe){return this._bindingWhenSyntax.whenParentNamed(fe)},U.prototype.whenParentTagged=function(fe,se){return this._bindingWhenSyntax.whenParentTagged(fe,se)},U.prototype.whenAnyAncestorIs=function(fe){return this._bindingWhenSyntax.whenAnyAncestorIs(fe)},U.prototype.whenNoAncestorIs=function(fe){return this._bindingWhenSyntax.whenNoAncestorIs(fe)},U.prototype.whenAnyAncestorNamed=function(fe){return this._bindingWhenSyntax.whenAnyAncestorNamed(fe)},U.prototype.whenAnyAncestorTagged=function(fe,se){return this._bindingWhenSyntax.whenAnyAncestorTagged(fe,se)},U.prototype.whenNoAncestorNamed=function(fe){return this._bindingWhenSyntax.whenNoAncestorNamed(fe)},U.prototype.whenNoAncestorTagged=function(fe,se){return this._bindingWhenSyntax.whenNoAncestorTagged(fe,se)},U.prototype.whenAnyAncestorMatches=function(fe){return this._bindingWhenSyntax.whenAnyAncestorMatches(fe)},U.prototype.whenNoAncestorMatches=function(fe){return this._bindingWhenSyntax.whenNoAncestorMatches(fe)},U.prototype.onActivation=function(fe){return this._bindingOnSyntax.onActivation(fe)},U}();ee.BindingInWhenOnSyntax=le},37326:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingOnSyntax=void 0;var q=L(64957),he=function(){function _(le){this._binding=le}return _.prototype.onActivation=function(le){return this._binding.onActivation=le,new q.BindingWhenSyntax(this._binding)},_}();ee.BindingOnSyntax=he},43085:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingToSyntax=void 0;var q=L(52050),he=L(88795),_=L(48971),le=L(65408),U=function(){function fe(se){this._binding=se}return fe.prototype.to=function(se){return this._binding.type=he.BindingTypeEnum.Instance,this._binding.implementationType=se,new _.BindingInWhenOnSyntax(this._binding)},fe.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+q.INVALID_TO_SELF_VALUE);var se=this._binding.serviceIdentifier;return this.to(se)},fe.prototype.toConstantValue=function(se){return this._binding.type=he.BindingTypeEnum.ConstantValue,this._binding.cache=se,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=he.BindingScopeEnum.Singleton,new le.BindingWhenOnSyntax(this._binding)},fe.prototype.toDynamicValue=function(se){return this._binding.type=he.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=se,this._binding.implementationType=null,new _.BindingInWhenOnSyntax(this._binding)},fe.prototype.toConstructor=function(se){return this._binding.type=he.BindingTypeEnum.Constructor,this._binding.implementationType=se,this._binding.scope=he.BindingScopeEnum.Singleton,new le.BindingWhenOnSyntax(this._binding)},fe.prototype.toFactory=function(se){return this._binding.type=he.BindingTypeEnum.Factory,this._binding.factory=se,this._binding.scope=he.BindingScopeEnum.Singleton,new le.BindingWhenOnSyntax(this._binding)},fe.prototype.toFunction=function(se){if(typeof se!="function")throw new Error(q.INVALID_FUNCTION_BINDING);var Qe=this.toConstantValue(se);return this._binding.type=he.BindingTypeEnum.Function,this._binding.scope=he.BindingScopeEnum.Singleton,Qe},fe.prototype.toAutoFactory=function(se){return this._binding.type=he.BindingTypeEnum.Factory,this._binding.factory=function(Qe){var ae=function(){return Qe.container.get(se)};return ae},this._binding.scope=he.BindingScopeEnum.Singleton,new le.BindingWhenOnSyntax(this._binding)},fe.prototype.toProvider=function(se){return this._binding.type=he.BindingTypeEnum.Provider,this._binding.provider=se,this._binding.scope=he.BindingScopeEnum.Singleton,new le.BindingWhenOnSyntax(this._binding)},fe.prototype.toService=function(se){this.toDynamicValue(function(Qe){return Qe.container.get(se)})},fe}();ee.BindingToSyntax=U},65408:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingWhenOnSyntax=void 0;var q=L(37326),he=L(64957),_=function(){function le(U){this._binding=U,this._bindingWhenSyntax=new he.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new q.BindingOnSyntax(this._binding)}return le.prototype.when=function(U){return this._bindingWhenSyntax.when(U)},le.prototype.whenTargetNamed=function(U){return this._bindingWhenSyntax.whenTargetNamed(U)},le.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},le.prototype.whenTargetTagged=function(U,fe){return this._bindingWhenSyntax.whenTargetTagged(U,fe)},le.prototype.whenInjectedInto=function(U){return this._bindingWhenSyntax.whenInjectedInto(U)},le.prototype.whenParentNamed=function(U){return this._bindingWhenSyntax.whenParentNamed(U)},le.prototype.whenParentTagged=function(U,fe){return this._bindingWhenSyntax.whenParentTagged(U,fe)},le.prototype.whenAnyAncestorIs=function(U){return this._bindingWhenSyntax.whenAnyAncestorIs(U)},le.prototype.whenNoAncestorIs=function(U){return this._bindingWhenSyntax.whenNoAncestorIs(U)},le.prototype.whenAnyAncestorNamed=function(U){return this._bindingWhenSyntax.whenAnyAncestorNamed(U)},le.prototype.whenAnyAncestorTagged=function(U,fe){return this._bindingWhenSyntax.whenAnyAncestorTagged(U,fe)},le.prototype.whenNoAncestorNamed=function(U){return this._bindingWhenSyntax.whenNoAncestorNamed(U)},le.prototype.whenNoAncestorTagged=function(U,fe){return this._bindingWhenSyntax.whenNoAncestorTagged(U,fe)},le.prototype.whenAnyAncestorMatches=function(U){return this._bindingWhenSyntax.whenAnyAncestorMatches(U)},le.prototype.whenNoAncestorMatches=function(U){return this._bindingWhenSyntax.whenNoAncestorMatches(U)},le.prototype.onActivation=function(U){return this._bindingOnSyntax.onActivation(U)},le}();ee.BindingWhenOnSyntax=_},64957:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.BindingWhenSyntax=void 0;var q=L(37326),he=L(18307),_=function(){function le(U){this._binding=U}return le.prototype.when=function(U){return this._binding.constraint=U,new q.BindingOnSyntax(this._binding)},le.prototype.whenTargetNamed=function(U){return this._binding.constraint=he.namedConstraint(U),new q.BindingOnSyntax(this._binding)},le.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(U){var fe=U.target!==null&&!U.target.isNamed()&&!U.target.isTagged();return fe},new q.BindingOnSyntax(this._binding)},le.prototype.whenTargetTagged=function(U,fe){return this._binding.constraint=he.taggedConstraint(U)(fe),new q.BindingOnSyntax(this._binding)},le.prototype.whenInjectedInto=function(U){return this._binding.constraint=function(fe){return he.typeConstraint(U)(fe.parentRequest)},new q.BindingOnSyntax(this._binding)},le.prototype.whenParentNamed=function(U){return this._binding.constraint=function(fe){return he.namedConstraint(U)(fe.parentRequest)},new q.BindingOnSyntax(this._binding)},le.prototype.whenParentTagged=function(U,fe){return this._binding.constraint=function(se){return he.taggedConstraint(U)(fe)(se.parentRequest)},new q.BindingOnSyntax(this._binding)},le.prototype.whenAnyAncestorIs=function(U){return this._binding.constraint=function(fe){return he.traverseAncerstors(fe,he.typeConstraint(U))},new q.BindingOnSyntax(this._binding)},le.prototype.whenNoAncestorIs=function(U){return this._binding.constraint=function(fe){return!he.traverseAncerstors(fe,he.typeConstraint(U))},new q.BindingOnSyntax(this._binding)},le.prototype.whenAnyAncestorNamed=function(U){return this._binding.constraint=function(fe){return he.traverseAncerstors(fe,he.namedConstraint(U))},new q.BindingOnSyntax(this._binding)},le.prototype.whenNoAncestorNamed=function(U){return this._binding.constraint=function(fe){return!he.traverseAncerstors(fe,he.namedConstraint(U))},new q.BindingOnSyntax(this._binding)},le.prototype.whenAnyAncestorTagged=function(U,fe){return this._binding.constraint=function(se){return he.traverseAncerstors(se,he.taggedConstraint(U)(fe))},new q.BindingOnSyntax(this._binding)},le.prototype.whenNoAncestorTagged=function(U,fe){return this._binding.constraint=function(se){return!he.traverseAncerstors(se,he.taggedConstraint(U)(fe))},new q.BindingOnSyntax(this._binding)},le.prototype.whenAnyAncestorMatches=function(U){return this._binding.constraint=function(fe){return he.traverseAncerstors(fe,U)},new q.BindingOnSyntax(this._binding)},le.prototype.whenNoAncestorMatches=function(U){return this._binding.constraint=function(fe){return!he.traverseAncerstors(fe,U)},new q.BindingOnSyntax(this._binding)},le}();ee.BindingWhenSyntax=_},18307:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.typeConstraint=ee.namedConstraint=ee.taggedConstraint=ee.traverseAncerstors=void 0;var q=L(91193),he=L(55650),_=function(se,Qe){var ae=se.parentRequest;return ae!==null?Qe(ae)?!0:_(ae,Qe):!1};ee.traverseAncerstors=_;var le=function(se){return function(Qe){var ae=function(et){return et!==null&&et.target!==null&&et.target.matchesTag(se)(Qe)};return ae.metaData=new he.Metadata(se,Qe),ae}};ee.taggedConstraint=le;var U=le(q.NAMED_TAG);ee.namedConstraint=U;var fe=function(se){return function(Qe){var ae=null;if(Qe!==null)if(ae=Qe.bindings[0],typeof se=="string"){var et=ae.serviceIdentifier;return et===se}else{var dt=Qe.bindings[0].implementationType;return se===dt}return!1}};ee.typeConstraint=fe},55605:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.multiBindToService=void 0;var L=function(q){return function(he){return function(){for(var _=[],le=0;le<arguments.length;le++)_[le]=arguments[le];return _.forEach(function(U){return q.bind(U).toService(he)})}}};ee.multiBindToService=L},83817:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.isStackOverflowExeption=void 0;var q=L(52050);function he(_){return _ instanceof RangeError||_.message===q.STACK_OVERFLOW}ee.isStackOverflowExeption=he},18576:function(rr,ee){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.id=void 0;var L=0;function q(){return L++}ee.id=q},80030:function(rr,ee,L){"use strict";Object.defineProperty(ee,"__esModule",{value:!0}),ee.circularDependencyToException=ee.listMetadataForTarget=ee.listRegisteredBindingsForServiceIdentifier=ee.getServiceIdentifierAsString=ee.getFunctionName=void 0;var q=L(52050);function he(ae){if(typeof ae=="function"){var et=ae;return et.name}else{if(typeof ae=="symbol")return ae.toString();var et=ae;return et}}ee.getServiceIdentifierAsString=he;function _(ae,et,dt){var Ye="",wt=dt(ae,et);return wt.length!==0&&(Ye=`
|
|
Registered bindings:`,wt.forEach(function(Xt){var Zt="Object";Xt.implementationType!==null&&(Zt=Qe(Xt.implementationType)),Ye=Ye+`
|
|
`+Zt,Xt.constraint.metaData&&(Ye=Ye+" - "+Xt.constraint.metaData)})),Ye}ee.listRegisteredBindingsForServiceIdentifier=_;function le(ae,et){return ae.parentRequest===null?!1:ae.parentRequest.serviceIdentifier===et?!0:le(ae.parentRequest,et)}function U(ae){function et(Ye,wt){wt===void 0&&(wt=[]);var Xt=he(Ye.serviceIdentifier);return wt.push(Xt),Ye.parentRequest!==null?et(Ye.parentRequest,wt):wt}var dt=et(ae);return dt.reverse().join(" --> ")}function fe(ae){ae.childRequests.forEach(function(et){if(le(et,et.serviceIdentifier)){var dt=U(et);throw new Error(q.CIRCULAR_DEPENDENCY+" "+dt)}else fe(et)})}ee.circularDependencyToException=fe;function se(ae,et){if(et.isTagged()||et.isNamed()){var dt="",Ye=et.getNamedTag(),wt=et.getCustomTags();return Ye!==null&&(dt+=Ye.toString()+`
|
|
`),wt!==null&&wt.forEach(function(Xt){dt+=Xt.toString()+`
|
|
`})," "+ae+`
|
|
`+ae+" - "+dt}else return" "+ae}ee.listMetadataForTarget=se;function Qe(ae){if(ae.name)return ae.name;var et=ae.toString(),dt=et.match(/^function\s*([^\s(]+)/);return dt?dt[1]:"Anonymous function: "+et}ee.getFunctionName=Qe},91746:function(rr,ee,L){var q=L(28889);function he(_,le){var U=_==null?0:_.length;return!!U&&q(_,le,0)>-1}rr.exports=he},88416:function(rr){function ee(L,q,he){for(var _=-1,le=L==null?0:L.length;++_<le;)if(he(q,L[_]))return!0;return!1}rr.exports=ee},9194:function(rr){function ee(L,q,he){return L===L&&(he!==void 0&&(L=L<=he?L:he),q!==void 0&&(L=L>=q?L:q)),L}rr.exports=ee},31187:function(rr){function ee(L,q,he,_){for(var le=L.length,U=he+(_?1:-1);_?U--:++U<le;)if(q(L[U],U,L))return U;return-1}rr.exports=ee},28889:function(rr,ee,L){var q=L(31187),he=L(66696),_=L(40721);function le(U,fe,se){return fe===fe?_(U,fe,se):q(U,he,se)}rr.exports=le},73128:function(rr){function ee(L,q,he,_){for(var le=he-1,U=L.length;++le<U;)if(_(L[le],q))return le;return-1}rr.exports=ee},66696:function(rr){function ee(L){return L!==L}rr.exports=ee},15645:function(rr,ee,L){var q=L(85772),he=L(28889),_=L(73128),le=L(9809),U=L(87704),fe=Array.prototype,se=fe.splice;function Qe(ae,et,dt,Ye){var wt=Ye?_:he,Xt=-1,Zt=et.length,nr=ae;for(ae===et&&(et=U(et)),dt&&(nr=q(ae,le(dt)));++Xt<Zt;)for(var Vt=0,xt=et[Xt],bt=dt?dt(xt):xt;(Vt=wt(nr,bt,Vt,Ye))>-1;)nr!==ae&&se.call(nr,Vt,1),se.call(ae,Vt,1);return ae}rr.exports=Qe},90798:function(rr,ee,L){var q=L(89023),he=L(91746),_=L(88416),le=L(32959),U=L(51407),fe=L(13772),se=200;function Qe(ae,et,dt){var Ye=-1,wt=he,Xt=ae.length,Zt=!0,nr=[],Vt=nr;if(dt)Zt=!1,wt=_;else if(Xt>=se){var xt=et?null:U(ae);if(xt)return fe(xt);Zt=!1,wt=le,Vt=new q}else Vt=et?[]:nr;e:for(;++Ye<Xt;){var bt=ae[Ye],Tr=et?et(bt):bt;if(bt=dt||bt!==0?bt:0,Zt&&Tr===Tr){for(var hr=Vt.length;hr--;)if(Vt[hr]===Tr)continue e;et&&Vt.push(Tr),nr.push(bt)}else wt(Vt,Tr,dt)||(Vt!==nr&&Vt.push(Tr),nr.push(bt))}return nr}rr.exports=Qe},51407:function(rr,ee,L){var q=L(44426),he=L(15295),_=L(13772),le=1/0,U=q&&1/_(new q([,-0]))[1]==le?function(fe){return new q(fe)}:he;rr.exports=U},40721:function(rr){function ee(L,q,he){for(var _=he-1,le=L.length;++_<le;)if(L[_]===q)return _;return-1}rr.exports=ee},3659:function(rr,ee,L){var q=L(9194),he=L(47338);function _(le,U,fe){return fe===void 0&&(fe=U,U=void 0),fe!==void 0&&(fe=he(fe),fe=fe===fe?fe:0),U!==void 0&&(U=he(U),U=U===U?U:0),q(he(le),U,fe)}rr.exports=_},46400:function(rr,ee,L){var q=L(51683),he=L(64841),_="[object Boolean]";function le(U){return U===!0||U===!1||he(U)&&q(U)==_}rr.exports=le},10347:function(rr,ee,L){var q=L(26796);function he(_,le){return q(_,le)}rr.exports=he},94394:function(rr){function ee(L){return L==null}rr.exports=ee},65604:function(rr,ee,L){var q=L(51683),he=L(64841),_="[object Number]";function le(U){return typeof U=="number"||he(U)&&q(U)==_}rr.exports=le},42493:function(rr){function ee(L){return L===void 0}rr.exports=ee},62016:function(rr,ee,L){var q=L(3033),he=L(80667),_=he(function(le,U,fe,se){q(le,U,fe,se)});rr.exports=_},15295:function(rr){function ee(){}rr.exports=ee},3689:function(rr,ee,L){var q=L(31878),he=L(80787),_=q(he);rr.exports=_},80787:function(rr,ee,L){var q=L(15645);function he(_,le){return _&&_.length&&le&&le.length?q(_,le):_}rr.exports=he},66058:function(rr,ee,L){var q=L(90798);function he(_){return _&&_.length?q(_):[]}rr.exports=he},80966:function(rr){(function(ee,L){rr.exports=L()})(this,function(){"use strict";var ee,L,q;function he(_,le){if(!ee)ee=le;else if(!L)L=le;else{var U="var sharedChunk = {}; ("+ee+")(sharedChunk); ("+L+")(sharedChunk);",fe={};ee(fe),q=le(fe),typeof window!="undefined"&&(q.workerUrl=window.URL.createObjectURL(new Blob([U],{type:"text/javascript"})))}}return he(["exports"],function(_){"use strict";function le(a,u){return a(u={exports:{}},u.exports),u.exports}var U=fe;function fe(a,u,c,m){this.cx=3*a,this.bx=3*(c-a)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*u,this.by=3*(m-u)-this.cy,this.ay=1-this.cy-this.by,this.p1x=a,this.p1y=m,this.p2x=c,this.p2y=m}fe.prototype.sampleCurveX=function(a){return((this.ax*a+this.bx)*a+this.cx)*a},fe.prototype.sampleCurveY=function(a){return((this.ay*a+this.by)*a+this.cy)*a},fe.prototype.sampleCurveDerivativeX=function(a){return(3*this.ax*a+2*this.bx)*a+this.cx},fe.prototype.solveCurveX=function(a,u){var c,m,x,E,A;for(u===void 0&&(u=1e-6),x=a,A=0;A<8;A++){if(E=this.sampleCurveX(x)-a,Math.abs(E)<u)return x;var I=this.sampleCurveDerivativeX(x);if(Math.abs(I)<1e-6)break;x-=E/I}if((x=a)<(c=0))return c;if(x>(m=1))return m;for(;c<m;){if(E=this.sampleCurveX(x),Math.abs(E-a)<u)return x;a>E?c=x:m=x,x=.5*(m-c)+c}return x},fe.prototype.solve=function(a,u){return this.sampleCurveY(this.solveCurveX(a,u))};var se=Qe;function Qe(a,u){this.x=a,this.y=u}Qe.prototype={clone:function(){return new Qe(this.x,this.y)},add:function(a){return this.clone()._add(a)},sub:function(a){return this.clone()._sub(a)},multByPoint:function(a){return this.clone()._multByPoint(a)},divByPoint:function(a){return this.clone()._divByPoint(a)},mult:function(a){return this.clone()._mult(a)},div:function(a){return this.clone()._div(a)},rotate:function(a){return this.clone()._rotate(a)},rotateAround:function(a,u){return this.clone()._rotateAround(a,u)},matMult:function(a){return this.clone()._matMult(a)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(a){return this.x===a.x&&this.y===a.y},dist:function(a){return Math.sqrt(this.distSqr(a))},distSqr:function(a){var u=a.x-this.x,c=a.y-this.y;return u*u+c*c},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(a){return Math.atan2(this.y-a.y,this.x-a.x)},angleWith:function(a){return this.angleWithSep(a.x,a.y)},angleWithSep:function(a,u){return Math.atan2(this.x*u-this.y*a,this.x*a+this.y*u)},_matMult:function(a){var u=a[2]*this.x+a[3]*this.y;return this.x=a[0]*this.x+a[1]*this.y,this.y=u,this},_add:function(a){return this.x+=a.x,this.y+=a.y,this},_sub:function(a){return this.x-=a.x,this.y-=a.y,this},_mult:function(a){return this.x*=a,this.y*=a,this},_div:function(a){return this.x/=a,this.y/=a,this},_multByPoint:function(a){return this.x*=a.x,this.y*=a.y,this},_divByPoint:function(a){return this.x/=a.x,this.y/=a.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var a=this.y;return this.y=this.x,this.x=-a,this},_rotate:function(a){var u=Math.cos(a),c=Math.sin(a),m=c*this.x+u*this.y;return this.x=u*this.x-c*this.y,this.y=m,this},_rotateAround:function(a,u){var c=Math.cos(a),m=Math.sin(a),x=u.y+m*(this.x-u.x)+c*(this.y-u.y);return this.x=u.x+c*(this.x-u.x)-m*(this.y-u.y),this.y=x,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Qe.convert=function(a){return a instanceof Qe?a:Array.isArray(a)?new Qe(a[0],a[1]):a};var ae=typeof self!="undefined"?self:{},et=Math.pow(2,53)-1;function dt(a,u,c,m){var x=new U(a,u,c,m);return function(E){return x.solve(E)}}var Ye=dt(.25,.1,.25,1);function wt(a,u,c){return Math.min(c,Math.max(u,a))}function Xt(a,u,c){var m=c-u,x=((a-u)%m+m)%m+u;return x===u?c:x}function Zt(a){for(var u=[],c=arguments.length-1;c-- >0;)u[c]=arguments[c+1];for(var m=0,x=u;m<x.length;m+=1){var E=x[m];for(var A in E)a[A]=E[A]}return a}var nr=1;function Vt(){return nr++}function xt(){return function a(u){return u?(u^16*Math.random()>>u/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,a)}()}function bt(a){return!!a&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(a)}function Tr(a,u){a.forEach(function(c){u[c]&&(u[c]=u[c].bind(u))})}function hr(a,u){return a.indexOf(u,a.length-u.length)!==-1}function lr(a,u,c){var m={};for(var x in a)m[x]=u.call(c||this,a[x],x,a);return m}function At(a,u,c){var m={};for(var x in a)u.call(c||this,a[x],x,a)&&(m[x]=a[x]);return m}function ut(a){return Array.isArray(a)?a.map(ut):typeof a=="object"&&a?lr(a,ut):a}var It={};function qe(a){It[a]||(typeof console!="undefined"&&console.warn(a),It[a]=!0)}function Ct(a,u,c){return(c.y-a.y)*(u.x-a.x)>(u.y-a.y)*(c.x-a.x)}function fr(a){for(var u=0,c=0,m=a.length,x=m-1,E=void 0,A=void 0;c<m;x=c++)u+=((A=a[x]).x-(E=a[c]).x)*(E.y+A.y);return u}function re(){return typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope}function V(a){var u={};if(a.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(m,x,E,A){var I=E||A;return u[x]=!I||I.toLowerCase(),""}),u["max-age"]){var c=parseInt(u["max-age"],10);isNaN(c)?delete u["max-age"]:u["max-age"]=c}return u}var K=null;function Me(a){if(K==null){var u=a.navigator?a.navigator.userAgent:null;K=!!a.safari||!(!u||!(/\b(iPad|iPhone|iPod)\b/.test(u)||u.match("Safari")&&!u.match("Chrome")))}return K}function Se(a){try{var u=ae[a];return u.setItem("_mapbox_test_",1),u.removeItem("_mapbox_test_"),!0}catch(c){return!1}}var nt,te,Ce,we,Xe=ae.performance&&ae.performance.now?ae.performance.now.bind(ae.performance):Date.now.bind(Date),Lt=ae.requestAnimationFrame||ae.mozRequestAnimationFrame||ae.webkitRequestAnimationFrame||ae.msRequestAnimationFrame,Ht=ae.cancelAnimationFrame||ae.mozCancelAnimationFrame||ae.webkitCancelAnimationFrame||ae.msCancelAnimationFrame,on={now:Xe,frame:function(a){var u=Lt(a);return{cancel:function(){return Ht(u)}}},getImageData:function(a,u){u===void 0&&(u=0);var c=ae.document.createElement("canvas"),m=c.getContext("2d");if(!m)throw new Error("failed to create canvas 2d context");return c.width=a.width,c.height=a.height,m.drawImage(a,0,0,a.width,a.height),m.getImageData(-u,-u,a.width+2*u,a.height+2*u)},resolveURL:function(a){return nt||(nt=ae.document.createElement("a")),nt.href=a,nt.href},hardwareConcurrency:ae.navigator&&ae.navigator.hardwareConcurrency||4,get devicePixelRatio(){return ae.devicePixelRatio},get prefersReducedMotion(){return!!ae.matchMedia&&(te==null&&(te=ae.matchMedia("(prefers-reduced-motion: reduce)")),te.matches)}},Jr={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Hr={supported:!1,testSupport:function(a){!Un&&we&&(bn?Kr(a):Ce=a)}},Un=!1,bn=!1;function Kr(a){var u=a.createTexture();a.bindTexture(a.TEXTURE_2D,u);try{if(a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,we),a.isContextLost())return;Hr.supported=!0}catch(c){}a.deleteTexture(u),Un=!0}ae.document&&((we=ae.document.createElement("img")).onload=function(){Ce&&Kr(Ce),Ce=null,bn=!0},we.onerror=function(){Un=!0,Ce=null},we.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var Mi="01",Si=function(a,u){this._transformRequestFn=a,this._customAccessToken=u,this._createSkuToken()};function Ri(a){return a.indexOf("mapbox:")===0}Si.prototype._createSkuToken=function(){var a=function(){for(var u="",c=0;c<10;c++)u+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Mi,u].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=a.token,this._skuTokenExpiresAt=a.tokenExpiresAt},Si.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Si.prototype.transformRequest=function(a,u){return this._transformRequestFn&&this._transformRequestFn(a,u)||{url:a}},Si.prototype.normalizeStyleURL=function(a,u){if(!Ri(a))return a;var c=Yi(a);return c.path="/styles/v1"+c.path,this._makeAPIURL(c,this._customAccessToken||u)},Si.prototype.normalizeGlyphsURL=function(a,u){if(!Ri(a))return a;var c=Yi(a);return c.path="/fonts/v1"+c.path,this._makeAPIURL(c,this._customAccessToken||u)},Si.prototype.normalizeSourceURL=function(a,u){if(!Ri(a))return a;var c=Yi(a);return c.path="/v4/"+c.authority+".json",c.params.push("secure"),this._makeAPIURL(c,this._customAccessToken||u)},Si.prototype.normalizeSpriteURL=function(a,u,c,m){var x=Yi(a);return Ri(a)?(x.path="/styles/v1"+x.path+"/sprite"+u+c,this._makeAPIURL(x,this._customAccessToken||m)):(x.path+=""+u+c,Na(x))},Si.prototype.normalizeTileURL=function(a,u){if(this._isSkuTokenExpired()&&this._createSkuToken(),a&&!Ri(a))return a;var c=Yi(a);c.path=c.path.replace(/(\.(png|jpg)\d*)(?=$)/,(on.devicePixelRatio>=2||u===512?"@2x":"")+(Hr.supported?".webp":"$1")),c.path=c.path.replace(/^.+\/v4\//,"/"),c.path="/v4"+c.path;var m=this._customAccessToken||function(x){for(var E=0,A=x;E<A.length;E+=1){var I=A[E].match(/^access_token=(.*)$/);if(I)return I[1]}return null}(c.params)||Jr.ACCESS_TOKEN;return Jr.REQUIRE_ACCESS_TOKEN&&m&&this._skuToken&&c.params.push("sku="+this._skuToken),this._makeAPIURL(c,m)},Si.prototype.canonicalizeTileURL=function(a,u){var c=Yi(a);if(!c.path.match(/(^\/v4\/)/)||!c.path.match(/\.[\w]+$/))return a;var m="mapbox://tiles/";m+=c.path.replace("/v4/","");var x=c.params;return u&&(x=x.filter(function(E){return!E.match(/^access_token=/)})),x.length&&(m+="?"+x.join("&")),m},Si.prototype.canonicalizeTileset=function(a,u){for(var c=!!u&&Ri(u),m=[],x=0,E=a.tiles||[];x<E.length;x+=1){var A=E[x];Dn(A)?m.push(this.canonicalizeTileURL(A,c)):m.push(A)}return m},Si.prototype._makeAPIURL=function(a,u){var c="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",m=Yi(Jr.API_URL);if(a.protocol=m.protocol,a.authority=m.authority,a.protocol==="http"){var x=a.params.indexOf("secure");x>=0&&a.params.splice(x,1)}if(m.path!=="/"&&(a.path=""+m.path+a.path),!Jr.REQUIRE_ACCESS_TOKEN)return Na(a);if(!(u=u||Jr.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+c);if(u[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+c);return a.params=a.params.filter(function(E){return E.indexOf("access_token")===-1}),a.params.push("access_token="+u),Na(a)};var Gn=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Dn(a){return Gn.test(a)}var Ya=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Yi(a){var u=a.match(Ya);if(!u)throw new Error("Unable to parse URL object");return{protocol:u[1],authority:u[2],path:u[3]||"/",params:u[4]?u[4].split("&"):[]}}function Na(a){var u=a.params.length?"?"+a.params.join("&"):"";return a.protocol+"://"+a.authority+a.path+u}function Dt(a){if(!a)return null;var u=a.split(".");if(!u||u.length!==3)return null;try{return JSON.parse(decodeURIComponent(ae.atob(u[1]).split("").map(function(c){return"%"+("00"+c.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch(c){return null}}var k=function(a){this.type=a,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};k.prototype.getStorageKey=function(a){var u,c=Dt(Jr.ACCESS_TOKEN);return u=c&&c.u?ae.btoa(encodeURIComponent(c.u).replace(/%([0-9A-F]{2})/g,function(m,x){return String.fromCharCode(+("0x"+x))})):Jr.ACCESS_TOKEN||"",a?"mapbox.eventData."+a+":"+u:"mapbox.eventData:"+u},k.prototype.fetchEventData=function(){var a=Se("localStorage"),u=this.getStorageKey(),c=this.getStorageKey("uuid");if(a)try{var m=ae.localStorage.getItem(u);m&&(this.eventData=JSON.parse(m));var x=ae.localStorage.getItem(c);x&&(this.anonId=x)}catch(E){qe("Unable to read from LocalStorage")}},k.prototype.saveEventData=function(){var a=Se("localStorage"),u=this.getStorageKey(),c=this.getStorageKey("uuid");if(a)try{ae.localStorage.setItem(c,this.anonId),Object.keys(this.eventData).length>=1&&ae.localStorage.setItem(u,JSON.stringify(this.eventData))}catch(m){qe("Unable to write to LocalStorage")}},k.prototype.processRequests=function(a){},k.prototype.postEvent=function(a,u,c,m){var x=this;if(Jr.EVENTS_URL){var E=Yi(Jr.EVENTS_URL);E.params.push("access_token="+(m||Jr.ACCESS_TOKEN||""));var A={event:this.type,created:new Date(a).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:Mi,userId:this.anonId},I=u?Zt(A,u):A,D={url:Na(E),headers:{"Content-Type":"text/plain"},body:JSON.stringify([I])};this.pendingRequest=hi(D,function(N){x.pendingRequest=null,c(N),x.saveEventData(),x.processRequests(m)})}},k.prototype.queueRequest=function(a,u){this.queue.push(a),this.processRequests(u)};var ie,ve,Ze=function(a){function u(){a.call(this,"map.load"),this.success={},this.skuToken=""}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.postMapLoadEvent=function(c,m,x,E){this.skuToken=x;var A=!(!E&&!Jr.ACCESS_TOKEN),I=Array.isArray(c)&&c.some(function(D){return Ri(D)||Dn(D)});Jr.EVENTS_URL&&A&&I&&this.queueRequest({id:m,timestamp:Date.now()},E)},u.prototype.processRequests=function(c){var m=this;if(!this.pendingRequest&&this.queue.length!==0){var x=this.queue.shift(),E=x.id,A=x.timestamp;E&&this.success[E]||(this.anonId||this.fetchEventData(),bt(this.anonId)||(this.anonId=xt()),this.postEvent(A,{skuToken:this.skuToken},function(I){I||E&&(m.success[E]=!0)},c))}},u}(k),_t=new(function(a){function u(c){a.call(this,"appUserTurnstile"),this._customAccessToken=c}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.postTurnstileEvent=function(c,m){Jr.EVENTS_URL&&Jr.ACCESS_TOKEN&&Array.isArray(c)&&c.some(function(x){return Ri(x)||Dn(x)})&&this.queueRequest(Date.now(),m)},u.prototype.processRequests=function(c){var m=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var x=Dt(Jr.ACCESS_TOKEN),E=x?x.u:Jr.ACCESS_TOKEN,A=E!==this.eventData.tokenU;bt(this.anonId)||(this.anonId=xt(),A=!0);var I=this.queue.shift();if(this.eventData.lastSuccess){var D=new Date(this.eventData.lastSuccess),N=new Date(I),H=(I-this.eventData.lastSuccess)/864e5;A=A||H>=1||H<-1||D.getDate()!==N.getDate()}else A=!0;if(!A)return this.processRequests();this.postEvent(I,{"enabled.telemetry":!1},function(X){X||(m.eventData.lastSuccess=I,m.eventData.tokenU=E)},c)}},u}(k)),Wt=_t.postTurnstileEvent.bind(_t),Sr=new Ze,He=Sr.postMapLoadEvent.bind(Sr),Et=500,cr=50;function mr(){ae.caches&&!ie&&(ie=ae.caches.open("mapbox-tiles"))}function Zr(a){var u=a.indexOf("?");return u<0?a:a.slice(0,u)}var Fn,En=1/0;function Cn(){return Fn==null&&(Fn=ae.OffscreenCanvas&&new ae.OffscreenCanvas(1,1).getContext("2d")&&typeof ae.createImageBitmap=="function"),Fn}var fn={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(fn);var ni=function(a){function u(c,m,x){m===401&&Dn(x)&&(c+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),a.call(this,c),this.status=m,this.url=x,this.name=this.constructor.name,this.message=c}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},u}(Error),Yn=re()?function(){return self.worker&&self.worker.referrer}:function(){return(ae.location.protocol==="blob:"?ae.parent:ae).location.href},oa,Qi,lo=function(a,u){if(!(/^file:/.test(c=a.url)||/^file:/.test(Yn())&&!/^\w+:/.test(c))){if(ae.fetch&&ae.Request&&ae.AbortController&&ae.Request.prototype.hasOwnProperty("signal"))return function(m,x){var E,A=new ae.AbortController,I=new ae.Request(m.url,{method:m.method||"GET",body:m.body,credentials:m.credentials,headers:m.headers,referrer:Yn(),signal:A.signal}),D=!1,N=!1,H=(E=I.url).indexOf("sku=")>0&&Dn(E);m.type==="json"&&I.headers.set("Accept","application/json");var X=function(R,Pe,Be){if(!N){if(R&&R.message!=="SecurityError"&&qe(R),Pe&&Be)return ne(Pe);var rt=Date.now();ae.fetch(I).then(function(Ge){if(Ge.ok){var St=H?Ge.clone():null;return ne(Ge,St,rt)}return x(new ni(Ge.statusText,Ge.status,m.url))}).catch(function(Ge){Ge.code!==20&&x(new Error(Ge.message))})}},ne=function(R,Pe,Be){(m.type==="arrayBuffer"?R.arrayBuffer():m.type==="json"?R.json():R.text()).then(function(rt){N||(Pe&&Be&&function(Ge,St,Ft){if(mr(),ie){var Yt={status:St.status,statusText:St.statusText,headers:new ae.Headers};St.headers.forEach(function(dr,Lr){return Yt.headers.set(Lr,dr)});var qt=V(St.headers.get("Cache-Control")||"");qt["no-store"]||(qt["max-age"]&&Yt.headers.set("Expires",new Date(Ft+1e3*qt["max-age"]).toUTCString()),new Date(Yt.headers.get("Expires")).getTime()-Ft<42e4||function(dr,Lr){if(ve===void 0)try{new Response(new ReadableStream),ve=!0}catch(Xr){ve=!1}ve?Lr(dr.body):dr.blob().then(Lr)}(St,function(dr){var Lr=new ae.Response(dr,Yt);mr(),ie&&ie.then(function(Xr){return Xr.put(Zr(Ge.url),Lr)}).catch(function(Xr){return qe(Xr.message)})}))}}(I,Pe,Be),D=!0,x(null,rt,R.headers.get("Cache-Control"),R.headers.get("Expires")))}).catch(function(rt){N||x(new Error(rt.message))})};return H?function(R,Pe){if(mr(),!ie)return Pe(null);var Be=Zr(R.url);ie.then(function(rt){rt.match(Be).then(function(Ge){var St=function(Ft){if(!Ft)return!1;var Yt=new Date(Ft.headers.get("Expires")||0),qt=V(Ft.headers.get("Cache-Control")||"");return Yt>Date.now()&&!qt["no-cache"]}(Ge);rt.delete(Be),St&&rt.put(Be,Ge.clone()),Pe(null,Ge,St)}).catch(Pe)}).catch(Pe)}(I,X):X(null,null),{cancel:function(){N=!0,D||A.abort()}}}(a,u);if(re()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",a,u,void 0,!0)}var c;return function(m,x){var E=new ae.XMLHttpRequest;for(var A in E.open(m.method||"GET",m.url,!0),m.type==="arrayBuffer"&&(E.responseType="arraybuffer"),m.headers)E.setRequestHeader(A,m.headers[A]);return m.type==="json"&&(E.responseType="text",E.setRequestHeader("Accept","application/json")),E.withCredentials=m.credentials==="include",E.onerror=function(){x(new Error(E.statusText))},E.onload=function(){if((E.status>=200&&E.status<300||E.status===0)&&E.response!==null){var I=E.response;if(m.type==="json")try{I=JSON.parse(E.response)}catch(D){return x(D)}x(null,I,E.getResponseHeader("Cache-Control"),E.getResponseHeader("Expires"))}else x(new ni(E.statusText,E.status,m.url))},E.send(m.body),{cancel:function(){return E.abort()}}}(a,u)},Is=function(a,u){return lo(Zt(a,{type:"arrayBuffer"}),u)},hi=function(a,u){return lo(Zt(a,{method:"POST"}),u)},W="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";oa=[],Qi=0;var J=function(a,u){if(Hr.supported&&(a.headers||(a.headers={}),a.headers.accept="image/webp,*/*"),Qi>=Jr.MAX_PARALLEL_IMAGE_REQUESTS){var c={requestParameters:a,callback:u,cancelled:!1,cancel:function(){this.cancelled=!0}};return oa.push(c),c}Qi++;var m=!1,x=function(){if(!m)for(m=!0,Qi--;oa.length&&Qi<Jr.MAX_PARALLEL_IMAGE_REQUESTS;){var A=oa.shift();A.cancelled||(A.cancel=J(A.requestParameters,A.callback).cancel)}},E=Is(a,function(A,I,D,N){x(),A?u(A):I&&(Cn()?function(H,X){var ne=new ae.Blob([new Uint8Array(H)],{type:"image/png"});ae.createImageBitmap(ne).then(function(R){X(null,R)}).catch(function(R){X(new Error("Could not load image because of "+R.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(I,u):function(H,X,ne,R){var Pe=new ae.Image,Be=ae.URL;Pe.onload=function(){X(null,Pe),Be.revokeObjectURL(Pe.src),Pe.onload=null,ae.requestAnimationFrame(function(){Pe.src=W})},Pe.onerror=function(){return X(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var rt=new ae.Blob([new Uint8Array(H)],{type:"image/png"});Pe.cacheControl=ne,Pe.expires=R,Pe.src=H.byteLength?Be.createObjectURL(rt):W}(I,u,D,N))});return{cancel:function(){E.cancel(),x()}}};function oe(a,u,c){c[a]&&c[a].indexOf(u)!==-1||(c[a]=c[a]||[],c[a].push(u))}function be(a,u,c){if(c&&c[a]){var m=c[a].indexOf(u);m!==-1&&c[a].splice(m,1)}}var Oe=function(a,u){u===void 0&&(u={}),Zt(this,u),this.type=a},it=function(a){function u(c,m){m===void 0&&(m={}),a.call(this,"error",Zt({error:c},m))}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u}(Oe),pt=function(){};pt.prototype.on=function(a,u){return this._listeners=this._listeners||{},oe(a,u,this._listeners),this},pt.prototype.off=function(a,u){return be(a,u,this._listeners),be(a,u,this._oneTimeListeners),this},pt.prototype.once=function(a,u){return this._oneTimeListeners=this._oneTimeListeners||{},oe(a,u,this._oneTimeListeners),this},pt.prototype.fire=function(a,u){typeof a=="string"&&(a=new Oe(a,u||{}));var c=a.type;if(this.listens(c)){a.target=this;for(var m=0,x=this._listeners&&this._listeners[c]?this._listeners[c].slice():[];m<x.length;m+=1)x[m].call(this,a);for(var E=0,A=this._oneTimeListeners&&this._oneTimeListeners[c]?this._oneTimeListeners[c].slice():[];E<A.length;E+=1){var I=A[E];be(c,I,this._oneTimeListeners),I.call(this,a)}var D=this._eventedParent;D&&(Zt(a,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),D.fire(a))}else a instanceof it&&console.error(a.error);return this},pt.prototype.listens=function(a){return this._listeners&&this._listeners[a]&&this._listeners[a].length>0||this._oneTimeListeners&&this._oneTimeListeners[a]&&this._oneTimeListeners[a].length>0||this._eventedParent&&this._eventedParent.listens(a)},pt.prototype.setEventedParent=function(a,u){return this._eventedParent=a,this._eventedParentData=u,this};var j={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Q=function(a,u,c,m){this.message=(a?a+": ":"")+c,m&&(this.identifier=m),u!=null&&u.__line__&&(this.line=u.__line__)};function Le(a){var u=a.value;return u?[new Q(a.key,u,"constants have been deprecated as of v8")]:[]}function at(a){for(var u=[],c=arguments.length-1;c-- >0;)u[c]=arguments[c+1];for(var m=0,x=u;m<x.length;m+=1){var E=x[m];for(var A in E)a[A]=E[A]}return a}function Ee(a){return a instanceof Number||a instanceof String||a instanceof Boolean?a.valueOf():a}function ir(a){if(Array.isArray(a))return a.map(ir);if(a instanceof Object&&!(a instanceof Number||a instanceof String||a instanceof Boolean)){var u={};for(var c in a)u[c]=ir(a[c]);return u}return Ee(a)}var wr=function(a){function u(c,m){a.call(this,m),this.message=m,this.key=c}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u}(Error),An=function(a,u){u===void 0&&(u=[]),this.parent=a,this.bindings={};for(var c=0,m=u;c<m.length;c+=1){var x=m[c];this.bindings[x[0]]=x[1]}};An.prototype.concat=function(a){return new An(this,a)},An.prototype.get=function(a){if(this.bindings[a])return this.bindings[a];if(this.parent)return this.parent.get(a);throw new Error(a+" not found in scope.")},An.prototype.has=function(a){return!!this.bindings[a]||!!this.parent&&this.parent.has(a)};var sn={kind:"null"},sr={kind:"number"},en={kind:"string"},Wr={kind:"boolean"},Yr={kind:"color"},pi={kind:"object"},tn={kind:"value"},vi={kind:"collator"},qi={kind:"formatted"},ci={kind:"resolvedImage"};function zi(a,u){return{kind:"array",itemType:a,N:u}}function Ai(a){if(a.kind==="array"){var u=Ai(a.itemType);return typeof a.N=="number"?"array<"+u+", "+a.N+">":a.itemType.kind==="value"?"array":"array<"+u+">"}return a.kind}var Xo=[sn,sr,en,Wr,Yr,qi,pi,zi(tn),ci];function Ji(a,u){if(u.kind==="error")return null;if(a.kind==="array"){if(u.kind==="array"&&(u.N===0&&u.itemType.kind==="value"||!Ji(a.itemType,u.itemType))&&(typeof a.N!="number"||a.N===u.N))return null}else{if(a.kind===u.kind)return null;if(a.kind==="value"){for(var c=0,m=Xo;c<m.length;c+=1)if(!Ji(m[c],u))return null}}return"Expected "+Ai(a)+" but found "+Ai(u)+" instead."}function Ia(a,u){return u.some(function(c){return c.kind===a.kind})}function Ti(a,u){return u.some(function(c){return c==="null"?a===null:c==="array"?Array.isArray(a):c==="object"?a&&!Array.isArray(a)&&typeof a=="object":c===typeof a})}var mi=le(function(a,u){var c={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],rebeccapurple:[102,51,153,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 m(I){return(I=Math.round(I))<0?0:I>255?255:I}function x(I){return m(I[I.length-1]==="%"?parseFloat(I)/100*255:parseInt(I))}function E(I){return(D=I[I.length-1]==="%"?parseFloat(I)/100:parseFloat(I))<0?0:D>1?1:D;var D}function A(I,D,N){return N<0?N+=1:N>1&&(N-=1),6*N<1?I+(D-I)*N*6:2*N<1?D:3*N<2?I+(D-I)*(2/3-N)*6:I}try{u.parseCSSColor=function(I){var D,N=I.replace(/ /g,"").toLowerCase();if(N in c)return c[N].slice();if(N[0]==="#")return N.length===4?(D=parseInt(N.substr(1),16))>=0&&D<=4095?[(3840&D)>>4|(3840&D)>>8,240&D|(240&D)>>4,15&D|(15&D)<<4,1]:null:N.length===7&&(D=parseInt(N.substr(1),16))>=0&&D<=16777215?[(16711680&D)>>16,(65280&D)>>8,255&D,1]:null;var H=N.indexOf("("),X=N.indexOf(")");if(H!==-1&&X+1===N.length){var ne=N.substr(0,H),R=N.substr(H+1,X-(H+1)).split(","),Pe=1;switch(ne){case"rgba":if(R.length!==4)return null;Pe=E(R.pop());case"rgb":return R.length!==3?null:[x(R[0]),x(R[1]),x(R[2]),Pe];case"hsla":if(R.length!==4)return null;Pe=E(R.pop());case"hsl":if(R.length!==3)return null;var Be=(parseFloat(R[0])%360+360)%360/360,rt=E(R[1]),Ge=E(R[2]),St=Ge<=.5?Ge*(rt+1):Ge+rt-Ge*rt,Ft=2*Ge-St;return[m(255*A(Ft,St,Be+1/3)),m(255*A(Ft,St,Be)),m(255*A(Ft,St,Be-1/3)),Pe];default:return null}}return null}}catch(I){}}).parseCSSColor,wi=function(a,u,c,m){m===void 0&&(m=1),this.r=a,this.g=u,this.b=c,this.a=m};wi.parse=function(a){if(a){if(a instanceof wi)return a;if(typeof a=="string"){var u=mi(a);if(u)return new wi(u[0]/255*u[3],u[1]/255*u[3],u[2]/255*u[3],u[3])}}},wi.prototype.toString=function(){var a=this.toArray(),u=a[1],c=a[2],m=a[3];return"rgba("+Math.round(a[0])+","+Math.round(u)+","+Math.round(c)+","+m+")"},wi.prototype.toArray=function(){var a=this.a;return a===0?[0,0,0,0]:[255*this.r/a,255*this.g/a,255*this.b/a,a]},wi.black=new wi(0,0,0,1),wi.white=new wi(1,1,1,1),wi.transparent=new wi(0,0,0,0),wi.red=new wi(1,0,0,1);var Pa=function(a,u,c){this.sensitivity=a?u?"variant":"case":u?"accent":"base",this.locale=c,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Pa.prototype.compare=function(a,u){return this.collator.compare(a,u)},Pa.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var cu=function(a,u,c,m,x){this.text=a,this.image=u,this.scale=c,this.fontStack=m,this.textColor=x},ma=function(a){this.sections=a};ma.fromString=function(a){return new ma([new cu(a,null,null,null,null)])},ma.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(a){return a.text.length!==0||a.image&&a.image.name.length!==0})},ma.factory=function(a){return a instanceof ma?a:ma.fromString(a)},ma.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(a){return a.text}).join("")},ma.prototype.serialize=function(){for(var a=["format"],u=0,c=this.sections;u<c.length;u+=1){var m=c[u];if(m.image)a.push(["image",m.image.name]);else{a.push(m.text);var x={};m.fontStack&&(x["text-font"]=["literal",m.fontStack.split(",")]),m.scale&&(x["font-scale"]=m.scale),m.textColor&&(x["text-color"]=["rgba"].concat(m.textColor.toArray())),a.push(x)}}return a};var Aa=function(a){this.name=a.name,this.available=a.available};function $l(a,u,c,m){return typeof a=="number"&&a>=0&&a<=255&&typeof u=="number"&&u>=0&&u<=255&&typeof c=="number"&&c>=0&&c<=255?m===void 0||typeof m=="number"&&m>=0&&m<=1?null:"Invalid rgba value ["+[a,u,c,m].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof m=="number"?[a,u,c,m]:[a,u,c]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function os(a){if(a===null||typeof a=="string"||typeof a=="boolean"||typeof a=="number"||a instanceof wi||a instanceof Pa||a instanceof ma||a instanceof Aa)return!0;if(Array.isArray(a)){for(var u=0,c=a;u<c.length;u+=1)if(!os(c[u]))return!1;return!0}if(typeof a=="object"){for(var m in a)if(!os(a[m]))return!1;return!0}return!1}function Ta(a){if(a===null)return sn;if(typeof a=="string")return en;if(typeof a=="boolean")return Wr;if(typeof a=="number")return sr;if(a instanceof wi)return Yr;if(a instanceof Pa)return vi;if(a instanceof ma)return qi;if(a instanceof Aa)return ci;if(Array.isArray(a)){for(var u,c=a.length,m=0,x=a;m<x.length;m+=1){var E=Ta(x[m]);if(u){if(u===E)continue;u=tn;break}u=E}return zi(u||tn,c)}return pi}function fi(a){var u=typeof a;return a===null?"":u==="string"||u==="number"||u==="boolean"?String(a):a instanceof wi||a instanceof ma||a instanceof Aa?a.toString():JSON.stringify(a)}Aa.prototype.toString=function(){return this.name},Aa.fromString=function(a){return a?new Aa({name:a,available:!1}):null},Aa.prototype.serialize=function(){return["image",this.name]};var Oa=function(a,u){this.type=a,this.value=u};Oa.parse=function(a,u){if(a.length!==2)return u.error("'literal' expression requires exactly one argument, but found "+(a.length-1)+" instead.");if(!os(a[1]))return u.error("invalid value");var c=a[1],m=Ta(c),x=u.expectedType;return m.kind!=="array"||m.N!==0||!x||x.kind!=="array"||typeof x.N=="number"&&x.N!==0||(m=x),new Oa(m,c)},Oa.prototype.evaluate=function(){return this.value},Oa.prototype.eachChild=function(){},Oa.prototype.outputDefined=function(){return!0},Oa.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof wi?["rgba"].concat(this.value.toArray()):this.value instanceof ma?this.value.serialize():this.value};var sa=function(a){this.name="ExpressionEvaluationError",this.message=a};sa.prototype.toJSON=function(){return this.message};var Ao={string:en,number:sr,boolean:Wr,object:pi},ha=function(a,u){this.type=a,this.args=u};ha.parse=function(a,u){if(a.length<2)return u.error("Expected at least one argument.");var c,m=1,x=a[0];if(x==="array"){var E,A;if(a.length>2){var I=a[1];if(typeof I!="string"||!(I in Ao)||I==="object")return u.error('The item type argument of "array" must be one of string, number, boolean',1);E=Ao[I],m++}else E=tn;if(a.length>3){if(a[2]!==null&&(typeof a[2]!="number"||a[2]<0||a[2]!==Math.floor(a[2])))return u.error('The length argument to "array" must be a positive integer literal',2);A=a[2],m++}c=zi(E,A)}else c=Ao[x];for(var D=[];m<a.length;m++){var N=u.parse(a[m],m,tn);if(!N)return null;D.push(N)}return new ha(c,D)},ha.prototype.evaluate=function(a){for(var u=0;u<this.args.length;u++){var c=this.args[u].evaluate(a);if(!Ji(this.type,Ta(c)))return c;if(u===this.args.length-1)throw new sa("Expected value to be of type "+Ai(this.type)+", but found "+Ai(Ta(c))+" instead.")}return null},ha.prototype.eachChild=function(a){this.args.forEach(a)},ha.prototype.outputDefined=function(){return this.args.every(function(a){return a.outputDefined()})},ha.prototype.serialize=function(){var a=this.type,u=[a.kind];if(a.kind==="array"){var c=a.itemType;if(c.kind==="string"||c.kind==="number"||c.kind==="boolean"){u.push(c.kind);var m=a.N;(typeof m=="number"||this.args.length>1)&&u.push(m)}}return u.concat(this.args.map(function(x){return x.serialize()}))};var $o=function(a){this.type=qi,this.sections=a};$o.parse=function(a,u){if(a.length<2)return u.error("Expected at least one argument.");var c=a[1];if(!Array.isArray(c)&&typeof c=="object")return u.error("First argument must be an image or text section.");for(var m=[],x=!1,E=1;E<=a.length-1;++E){var A=a[E];if(x&&typeof A=="object"&&!Array.isArray(A)){x=!1;var I=null;if(A["font-scale"]&&!(I=u.parse(A["font-scale"],1,sr)))return null;var D=null;if(A["text-font"]&&!(D=u.parse(A["text-font"],1,zi(en))))return null;var N=null;if(A["text-color"]&&!(N=u.parse(A["text-color"],1,Yr)))return null;var H=m[m.length-1];H.scale=I,H.font=D,H.textColor=N}else{var X=u.parse(a[E],1,tn);if(!X)return null;var ne=X.type.kind;if(ne!=="string"&&ne!=="value"&&ne!=="null"&&ne!=="resolvedImage")return u.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,m.push({content:X,scale:null,font:null,textColor:null})}}return new $o(m)},$o.prototype.evaluate=function(a){return new ma(this.sections.map(function(u){var c=u.content.evaluate(a);return Ta(c)===ci?new cu("",c,null,null,null):new cu(fi(c),null,u.scale?u.scale.evaluate(a):null,u.font?u.font.evaluate(a).join(","):null,u.textColor?u.textColor.evaluate(a):null)}))},$o.prototype.eachChild=function(a){for(var u=0,c=this.sections;u<c.length;u+=1){var m=c[u];a(m.content),m.scale&&a(m.scale),m.font&&a(m.font),m.textColor&&a(m.textColor)}},$o.prototype.outputDefined=function(){return!1},$o.prototype.serialize=function(){for(var a=["format"],u=0,c=this.sections;u<c.length;u+=1){var m=c[u];a.push(m.content.serialize());var x={};m.scale&&(x["font-scale"]=m.scale.serialize()),m.font&&(x["text-font"]=m.font.serialize()),m.textColor&&(x["text-color"]=m.textColor.serialize()),a.push(x)}return a};var Vo=function(a){this.type=ci,this.input=a};Vo.parse=function(a,u){if(a.length!==2)return u.error("Expected two arguments.");var c=u.parse(a[1],1,en);return c?new Vo(c):u.error("No image name provided.")},Vo.prototype.evaluate=function(a){var u=this.input.evaluate(a),c=Aa.fromString(u);return c&&a.availableImages&&(c.available=a.availableImages.indexOf(u)>-1),c},Vo.prototype.eachChild=function(a){a(this.input)},Vo.prototype.outputDefined=function(){return!1},Vo.prototype.serialize=function(){return["image",this.input.serialize()]};var Ru={"to-boolean":Wr,"to-color":Yr,"to-number":sr,"to-string":en},ss=function(a,u){this.type=a,this.args=u};ss.parse=function(a,u){if(a.length<2)return u.error("Expected at least one argument.");var c=a[0];if((c==="to-boolean"||c==="to-string")&&a.length!==2)return u.error("Expected one argument.");for(var m=Ru[c],x=[],E=1;E<a.length;E++){var A=u.parse(a[E],E,tn);if(!A)return null;x.push(A)}return new ss(m,x)},ss.prototype.evaluate=function(a){if(this.type.kind==="boolean")return!!this.args[0].evaluate(a);if(this.type.kind==="color"){for(var u,c,m=0,x=this.args;m<x.length;m+=1){if(c=null,(u=x[m].evaluate(a))instanceof wi)return u;if(typeof u=="string"){var E=a.parseColor(u);if(E)return E}else if(Array.isArray(u)&&!(c=u.length<3||u.length>4?"Invalid rbga value "+JSON.stringify(u)+": expected an array containing either three or four numeric values.":$l(u[0],u[1],u[2],u[3])))return new wi(u[0]/255,u[1]/255,u[2]/255,u[3])}throw new sa(c||"Could not parse color from value '"+(typeof u=="string"?u:String(JSON.stringify(u)))+"'")}if(this.type.kind==="number"){for(var A=null,I=0,D=this.args;I<D.length;I+=1){if((A=D[I].evaluate(a))===null)return 0;var N=Number(A);if(!isNaN(N))return N}throw new sa("Could not convert "+JSON.stringify(A)+" to number.")}return this.type.kind==="formatted"?ma.fromString(fi(this.args[0].evaluate(a))):this.type.kind==="resolvedImage"?Aa.fromString(fi(this.args[0].evaluate(a))):fi(this.args[0].evaluate(a))},ss.prototype.eachChild=function(a){this.args.forEach(a)},ss.prototype.outputDefined=function(){return this.args.every(function(a){return a.outputDefined()})},ss.prototype.serialize=function(){if(this.type.kind==="formatted")return new $o([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Vo(this.args[0]).serialize();var a=["to-"+this.type.kind];return this.eachChild(function(u){a.push(u.serialize())}),a};var Cc=["Unknown","Point","LineString","Polygon"],Ea=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Ea.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Ea.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?Cc[this.feature.type]:this.feature.type:null},Ea.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Ea.prototype.canonicalID=function(){return this.canonical},Ea.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Ea.prototype.parseColor=function(a){var u=this._parseColorCache[a];return u||(u=this._parseColorCache[a]=wi.parse(a)),u};var ea=function(a,u,c,m){this.name=a,this.type=u,this._evaluate=c,this.args=m};ea.prototype.evaluate=function(a){return this._evaluate(a,this.args)},ea.prototype.eachChild=function(a){this.args.forEach(a)},ea.prototype.outputDefined=function(){return!1},ea.prototype.serialize=function(){return[this.name].concat(this.args.map(function(a){return a.serialize()}))},ea.parse=function(a,u){var c,m=a[0],x=ea.definitions[m];if(!x)return u.error('Unknown expression "'+m+'". If you wanted a literal array, use ["literal", [...]].',0);for(var E=Array.isArray(x)?x[0]:x.type,A=Array.isArray(x)?[[x[1],x[2]]]:x.overloads,I=A.filter(function(Vn){var pn=Vn[0];return!Array.isArray(pn)||pn.length===a.length-1}),D=null,N=0,H=I;N<H.length;N+=1){var X=H[N],ne=X[0],R=X[1];D=new Qu(u.registry,u.path,null,u.scope);for(var Pe=[],Be=!1,rt=1;rt<a.length;rt++){var Ge=a[rt],St=Array.isArray(ne)?ne[rt-1]:ne.type,Ft=D.parse(Ge,1+Pe.length,St);if(!Ft){Be=!0;break}Pe.push(Ft)}if(!Be)if(Array.isArray(ne)&&ne.length!==Pe.length)D.error("Expected "+ne.length+" arguments, but found "+Pe.length+" instead.");else{for(var Yt=0;Yt<Pe.length;Yt++){var qt=Array.isArray(ne)?ne[Yt]:ne.type,dr=Pe[Yt];D.concat(Yt+1).checkSubtype(qt,dr.type)}if(D.errors.length===0)return new ea(m,E,R,Pe)}}if(I.length===1)(c=u.errors).push.apply(c,D.errors);else{for(var Lr=(I.length?I:A).map(function(Vn){var pn;return pn=Vn[0],Array.isArray(pn)?"("+pn.map(Ai).join(", ")+")":"("+Ai(pn.type)+"...)"}).join(" | "),Xr=[],Bn=1;Bn<a.length;Bn++){var cn=u.parse(a[Bn],1+Xr.length);if(!cn)return null;Xr.push(Ai(cn.type))}u.error("Expected arguments of type "+Lr+", but found ("+Xr.join(", ")+") instead.")}return null},ea.register=function(a,u){for(var c in ea.definitions=u,u)a[c]=ea};var Kt=function(a,u,c){this.type=vi,this.locale=c,this.caseSensitive=a,this.diacriticSensitive=u};function Sn(a,u){a[0]=Math.min(a[0],u[0]),a[1]=Math.min(a[1],u[1]),a[2]=Math.max(a[2],u[0]),a[3]=Math.max(a[3],u[1])}function de(a,u){return!(a[0]<=u[0]||a[2]>=u[2]||a[1]<=u[1]||a[3]>=u[3])}function Re(a,u){var c=(180+a[0])/360,m=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a[1]*Math.PI/360)))/360,x=Math.pow(2,u.z);return[Math.round(c*x*8192),Math.round(m*x*8192)]}function ct(a,u,c){return u[1]>a[1]!=c[1]>a[1]&&a[0]<(c[0]-u[0])*(a[1]-u[1])/(c[1]-u[1])+u[0]}function or(a,u){for(var c,m,x,E,A,I,D,N=!1,H=0,X=u.length;H<X;H++)for(var ne=u[H],R=0,Pe=ne.length;R<Pe-1;R++){if((E=(c=a)[0]-(m=ne[R])[0])*(D=c[1]-(x=ne[R+1])[1])-(I=c[0]-x[0])*(A=c[1]-m[1])==0&&E*I<=0&&A*D<=0)return!1;ct(a,ne[R],ne[R+1])&&(N=!N)}return N}function jr(a,u){for(var c=0;c<u.length;c++)if(or(a,u[c]))return!0;return!1}function In(a,u,c,m){var x=m[0]-c[0],E=m[1]-c[1],A=(a[0]-c[0])*E-x*(a[1]-c[1]),I=(u[0]-c[0])*E-x*(u[1]-c[1]);return A>0&&I<0||A<0&&I>0}function Hi(a,u,c){for(var m=0,x=c;m<x.length;m+=1)for(var E=x[m],A=0;A<E.length-1;++A)if((X=[(H=E[A+1])[0]-(N=E[A])[0],H[1]-N[1]])[0]*(ne=[(D=u)[0]-(I=a)[0],D[1]-I[1]])[1]-X[1]*ne[0]!=0&&In(I,D,N,H)&&In(N,H,I,D))return!0;var I,D,N,H,X,ne;return!1}function vo(a,u){for(var c=0;c<a.length;++c)if(!or(a[c],u))return!1;for(var m=0;m<a.length-1;++m)if(Hi(a[m],a[m+1],u))return!1;return!0}function To(a,u){for(var c=0;c<u.length;c++)if(vo(a,u[c]))return!0;return!1}function co(a,u,c){for(var m=[],x=0;x<a.length;x++){for(var E=[],A=0;A<a[x].length;A++){var I=Re(a[x][A],c);Sn(u,I),E.push(I)}m.push(E)}return m}function Ps(a,u,c){for(var m=[],x=0;x<a.length;x++){var E=co(a[x],u,c);m.push(E)}return m}function ys(a,u,c,m){if(a[0]<c[0]||a[0]>c[2]){var x=.5*m,E=a[0]-c[0]>x?-m:c[0]-a[0]>x?m:0;E===0&&(E=a[0]-c[2]>x?-m:c[2]-a[0]>x?m:0),a[0]+=E}Sn(u,a)}function Kh(a,u,c,m){for(var x=8192*Math.pow(2,m.z),E=[8192*m.x,8192*m.y],A=[],I=0,D=a;I<D.length;I+=1)for(var N=0,H=D[I];N<H.length;N+=1){var X=H[N],ne=[X.x+E[0],X.y+E[1]];ys(ne,u,c,x),A.push(ne)}return A}function Cf(a,u,c,m){for(var x,E=8192*Math.pow(2,m.z),A=[8192*m.x,8192*m.y],I=[],D=0,N=a;D<N.length;D+=1){for(var H=[],X=0,ne=N[D];X<ne.length;X+=1){var R=ne[X],Pe=[R.x+A[0],R.y+A[1]];Sn(u,Pe),H.push(Pe)}I.push(H)}if(u[2]-u[0]<=E/2){(x=u)[0]=x[1]=1/0,x[2]=x[3]=-1/0;for(var Be=0,rt=I;Be<rt.length;Be+=1)for(var Ge=0,St=rt[Be];Ge<St.length;Ge+=1)ys(St[Ge],u,c,E)}return I}Kt.parse=function(a,u){if(a.length!==2)return u.error("Expected one argument.");var c=a[1];if(typeof c!="object"||Array.isArray(c))return u.error("Collator options argument must be an object.");var m=u.parse(c["case-sensitive"]!==void 0&&c["case-sensitive"],1,Wr);if(!m)return null;var x=u.parse(c["diacritic-sensitive"]!==void 0&&c["diacritic-sensitive"],1,Wr);if(!x)return null;var E=null;return c.locale&&!(E=u.parse(c.locale,1,en))?null:new Kt(m,x,E)},Kt.prototype.evaluate=function(a){return new Pa(this.caseSensitive.evaluate(a),this.diacriticSensitive.evaluate(a),this.locale?this.locale.evaluate(a):null)},Kt.prototype.eachChild=function(a){a(this.caseSensitive),a(this.diacriticSensitive),this.locale&&a(this.locale)},Kt.prototype.outputDefined=function(){return!1},Kt.prototype.serialize=function(){var a={};return a["case-sensitive"]=this.caseSensitive.serialize(),a["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(a.locale=this.locale.serialize()),["collator",a]};var jo=function(a,u){this.type=Wr,this.geojson=a,this.geometries=u};function xl(a){if(a instanceof ea&&(a.name==="get"&&a.args.length===1||a.name==="feature-state"||a.name==="has"&&a.args.length===1||a.name==="properties"||a.name==="geometry-type"||a.name==="id"||/^filter-/.test(a.name))||a instanceof jo)return!1;var u=!0;return a.eachChild(function(c){u&&!xl(c)&&(u=!1)}),u}function bl(a){if(a instanceof ea&&a.name==="feature-state")return!1;var u=!0;return a.eachChild(function(c){u&&!bl(c)&&(u=!1)}),u}function Mu(a,u){if(a instanceof ea&&u.indexOf(a.name)>=0)return!1;var c=!0;return a.eachChild(function(m){c&&!Mu(m,u)&&(c=!1)}),c}jo.parse=function(a,u){if(a.length!==2)return u.error("'within' expression requires exactly one argument, but found "+(a.length-1)+" instead.");if(os(a[1])){var c=a[1];if(c.type==="FeatureCollection")for(var m=0;m<c.features.length;++m){var x=c.features[m].geometry.type;if(x==="Polygon"||x==="MultiPolygon")return new jo(c,c.features[m].geometry)}else if(c.type==="Feature"){var E=c.geometry.type;if(E==="Polygon"||E==="MultiPolygon")return new jo(c,c.geometry)}else if(c.type==="Polygon"||c.type==="MultiPolygon")return new jo(c,c)}return u.error("'within' expression requires valid geojson object that contains polygon geometry type.")},jo.prototype.evaluate=function(a){if(a.geometry()!=null&&a.canonicalID()!=null){if(a.geometryType()==="Point")return function(u,c){var m=[1/0,1/0,-1/0,-1/0],x=[1/0,1/0,-1/0,-1/0],E=u.canonicalID();if(c.type==="Polygon"){var A=co(c.coordinates,x,E),I=Kh(u.geometry(),m,x,E);if(!de(m,x))return!1;for(var D=0,N=I;D<N.length;D+=1)if(!or(N[D],A))return!1}if(c.type==="MultiPolygon"){var H=Ps(c.coordinates,x,E),X=Kh(u.geometry(),m,x,E);if(!de(m,x))return!1;for(var ne=0,R=X;ne<R.length;ne+=1)if(!jr(R[ne],H))return!1}return!0}(a,this.geometries);if(a.geometryType()==="LineString")return function(u,c){var m=[1/0,1/0,-1/0,-1/0],x=[1/0,1/0,-1/0,-1/0],E=u.canonicalID();if(c.type==="Polygon"){var A=co(c.coordinates,x,E),I=Cf(u.geometry(),m,x,E);if(!de(m,x))return!1;for(var D=0,N=I;D<N.length;D+=1)if(!vo(N[D],A))return!1}if(c.type==="MultiPolygon"){var H=Ps(c.coordinates,x,E),X=Cf(u.geometry(),m,x,E);if(!de(m,x))return!1;for(var ne=0,R=X;ne<R.length;ne+=1)if(!To(R[ne],H))return!1}return!0}(a,this.geometries)}return!1},jo.prototype.eachChild=function(){},jo.prototype.outputDefined=function(){return!0},jo.prototype.serialize=function(){return["within",this.geojson]};var Iu=function(a,u){this.type=u.type,this.name=a,this.boundExpression=u};Iu.parse=function(a,u){if(a.length!==2||typeof a[1]!="string")return u.error("'var' expression requires exactly one string literal argument.");var c=a[1];return u.scope.has(c)?new Iu(c,u.scope.get(c)):u.error('Unknown variable "'+c+'". Make sure "'+c+'" has been bound in an enclosing "let" expression before using it.',1)},Iu.prototype.evaluate=function(a){return this.boundExpression.evaluate(a)},Iu.prototype.eachChild=function(){},Iu.prototype.outputDefined=function(){return!1},Iu.prototype.serialize=function(){return["var",this.name]};var Qu=function(a,u,c,m,x){u===void 0&&(u=[]),m===void 0&&(m=new An),x===void 0&&(x=[]),this.registry=a,this.path=u,this.key=u.map(function(E){return"["+E+"]"}).join(""),this.scope=m,this.errors=x,this.expectedType=c};function Qc(a,u){for(var c,m=a.length-1,x=0,E=m,A=0;x<=E;)if((c=a[A=Math.floor((x+E)/2)])<=u){if(A===m||u<a[A+1])return A;x=A+1}else{if(!(c>u))throw new sa("Input is not a number.");E=A-1}return 0}Qu.prototype.parse=function(a,u,c,m,x){return x===void 0&&(x={}),u?this.concat(u,c,m)._parse(a,x):this._parse(a,x)},Qu.prototype._parse=function(a,u){function c(N,H,X){return X==="assert"?new ha(H,[N]):X==="coerce"?new ss(H,[N]):N}if(a!==null&&typeof a!="string"&&typeof a!="boolean"&&typeof a!="number"||(a=["literal",a]),Array.isArray(a)){if(a.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var m=a[0];if(typeof m!="string")return this.error("Expression name must be a string, but found "+typeof m+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var x=this.registry[m];if(x){var E=x.parse(a,this);if(!E)return null;if(this.expectedType){var A=this.expectedType,I=E.type;if(A.kind!=="string"&&A.kind!=="number"&&A.kind!=="boolean"&&A.kind!=="object"&&A.kind!=="array"||I.kind!=="value")if(A.kind!=="color"&&A.kind!=="formatted"&&A.kind!=="resolvedImage"||I.kind!=="value"&&I.kind!=="string"){if(this.checkSubtype(A,I))return null}else E=c(E,A,u.typeAnnotation||"coerce");else E=c(E,A,u.typeAnnotation||"assert")}if(!(E instanceof Oa)&&E.type.kind!=="resolvedImage"&&function N(H){if(H instanceof Iu)return N(H.boundExpression);if(H instanceof ea&&H.name==="error"||H instanceof Kt||H instanceof jo)return!1;var X=H instanceof ss||H instanceof ha,ne=!0;return H.eachChild(function(R){ne=X?ne&&N(R):ne&&R instanceof Oa}),!!ne&&xl(H)&&Mu(H,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(E)){var D=new Ea;try{E=new Oa(E.type,E.evaluate(D))}catch(N){return this.error(N.message),null}}return E}return this.error('Unknown expression "'+m+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(a===void 0?"'undefined' value invalid. Use null instead.":typeof a=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof a+" instead.")},Qu.prototype.concat=function(a,u,c){var m=typeof a=="number"?this.path.concat(a):this.path,x=c?this.scope.concat(c):this.scope;return new Qu(this.registry,m,u||null,x,this.errors)},Qu.prototype.error=function(a){for(var u=[],c=arguments.length-1;c-- >0;)u[c]=arguments[c+1];var m=""+this.key+u.map(function(x){return"["+x+"]"}).join("");this.errors.push(new wr(m,a))},Qu.prototype.checkSubtype=function(a,u){var c=Ji(a,u);return c&&this.error(c),c};var Os=function(a,u,c){this.type=a,this.input=u,this.labels=[],this.outputs=[];for(var m=0,x=c;m<x.length;m+=1){var E=x[m],A=E[1];this.labels.push(E[0]),this.outputs.push(A)}};function qa(a,u,c){return a*(1-c)+u*c}Os.parse=function(a,u){if(a.length-1<4)return u.error("Expected at least 4 arguments, but found only "+(a.length-1)+".");if((a.length-1)%2!=0)return u.error("Expected an even number of arguments.");var c=u.parse(a[1],1,sr);if(!c)return null;var m=[],x=null;u.expectedType&&u.expectedType.kind!=="value"&&(x=u.expectedType);for(var E=1;E<a.length;E+=2){var A=E===1?-1/0:a[E],I=a[E+1],D=E,N=E+1;if(typeof A!="number")return u.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',D);if(m.length&&m[m.length-1][0]>=A)return u.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',D);var H=u.parse(I,N,x);if(!H)return null;x=x||H.type,m.push([A,H])}return new Os(x,c,m)},Os.prototype.evaluate=function(a){var u=this.labels,c=this.outputs;if(u.length===1)return c[0].evaluate(a);var m=this.input.evaluate(a);if(m<=u[0])return c[0].evaluate(a);var x=u.length;return m>=u[x-1]?c[x-1].evaluate(a):c[Qc(u,m)].evaluate(a)},Os.prototype.eachChild=function(a){a(this.input);for(var u=0,c=this.outputs;u<c.length;u+=1)a(c[u])},Os.prototype.outputDefined=function(){return this.outputs.every(function(a){return a.outputDefined()})},Os.prototype.serialize=function(){for(var a=["step",this.input.serialize()],u=0;u<this.labels.length;u++)u>0&&a.push(this.labels[u]),a.push(this.outputs[u].serialize());return a};var El=Object.freeze({__proto__:null,number:qa,color:function(a,u,c){return new wi(qa(a.r,u.r,c),qa(a.g,u.g,c),qa(a.b,u.b,c),qa(a.a,u.a,c))},array:function(a,u,c){return a.map(function(m,x){return qa(m,u[x],c)})}}),Ju=6/29*3*(6/29),Rf=Math.PI/180,Qh=180/Math.PI;function Mf(a){return a>.008856451679035631?Math.pow(a,1/3):a/Ju+4/29}function ph(a){return a>6/29?a*a*a:Ju*(a-4/29)}function dh(a){return 255*(a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055)}function vh(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Jh(a){var u=vh(a.r),c=vh(a.g),m=vh(a.b),x=Mf((.4124564*u+.3575761*c+.1804375*m)/.95047),E=Mf((.2126729*u+.7151522*c+.072175*m)/1);return{l:116*E-16,a:500*(x-E),b:200*(E-Mf((.0193339*u+.119192*c+.9503041*m)/1.08883)),alpha:a.a}}function ep(a){var u=(a.l+16)/116,c=isNaN(a.a)?u:u+a.a/500,m=isNaN(a.b)?u:u-a.b/200;return u=1*ph(u),c=.95047*ph(c),m=1.08883*ph(m),new wi(dh(3.2404542*c-1.5371385*u-.4985314*m),dh(-.969266*c+1.8760108*u+.041556*m),dh(.0556434*c-.2040259*u+1.0572252*m),a.alpha)}function Zp(a,u,c){var m=u-a;return a+c*(m>180||m<-180?m-360*Math.round(m/360):m)}var Jc={forward:Jh,reverse:ep,interpolate:function(a,u,c){return{l:qa(a.l,u.l,c),a:qa(a.a,u.a,c),b:qa(a.b,u.b,c),alpha:qa(a.alpha,u.alpha,c)}}},Pu={forward:function(a){var u=Jh(a),c=u.l,m=u.a,x=u.b,E=Math.atan2(x,m)*Qh;return{h:E<0?E+360:E,c:Math.sqrt(m*m+x*x),l:c,alpha:a.a}},reverse:function(a){var u=a.h*Rf,c=a.c;return ep({l:a.l,a:Math.cos(u)*c,b:Math.sin(u)*c,alpha:a.alpha})},interpolate:function(a,u,c){return{h:Zp(a.h,u.h,c),c:qa(a.c,u.c,c),l:qa(a.l,u.l,c),alpha:qa(a.alpha,u.alpha,c)}}},tp=Object.freeze({__proto__:null,lab:Jc,hcl:Pu}),Ho=function(a,u,c,m,x){this.type=a,this.operator=u,this.interpolation=c,this.input=m,this.labels=[],this.outputs=[];for(var E=0,A=x;E<A.length;E+=1){var I=A[E],D=I[1];this.labels.push(I[0]),this.outputs.push(D)}};function Yl(a,u,c,m){var x=m-c,E=a-c;return x===0?0:u===1?E/x:(Math.pow(u,E)-1)/(Math.pow(u,x)-1)}Ho.interpolationFactor=function(a,u,c,m){var x=0;if(a.name==="exponential")x=Yl(u,a.base,c,m);else if(a.name==="linear")x=Yl(u,1,c,m);else if(a.name==="cubic-bezier"){var E=a.controlPoints;x=new U(E[0],E[1],E[2],E[3]).solve(Yl(u,1,c,m))}return x},Ho.parse=function(a,u){var c=a[0],m=a[1],x=a[2],E=a.slice(3);if(!Array.isArray(m)||m.length===0)return u.error("Expected an interpolation type expression.",1);if(m[0]==="linear")m={name:"linear"};else if(m[0]==="exponential"){var A=m[1];if(typeof A!="number")return u.error("Exponential interpolation requires a numeric base.",1,1);m={name:"exponential",base:A}}else{if(m[0]!=="cubic-bezier")return u.error("Unknown interpolation type "+String(m[0]),1,0);var I=m.slice(1);if(I.length!==4||I.some(function(rt){return typeof rt!="number"||rt<0||rt>1}))return u.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);m={name:"cubic-bezier",controlPoints:I}}if(a.length-1<4)return u.error("Expected at least 4 arguments, but found only "+(a.length-1)+".");if((a.length-1)%2!=0)return u.error("Expected an even number of arguments.");if(!(x=u.parse(x,2,sr)))return null;var D=[],N=null;c==="interpolate-hcl"||c==="interpolate-lab"?N=Yr:u.expectedType&&u.expectedType.kind!=="value"&&(N=u.expectedType);for(var H=0;H<E.length;H+=2){var X=E[H],ne=E[H+1],R=H+3,Pe=H+4;if(typeof X!="number")return u.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',R);if(D.length&&D[D.length-1][0]>=X)return u.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',R);var Be=u.parse(ne,Pe,N);if(!Be)return null;N=N||Be.type,D.push([X,Be])}return N.kind==="number"||N.kind==="color"||N.kind==="array"&&N.itemType.kind==="number"&&typeof N.N=="number"?new Ho(N,c,m,x,D):u.error("Type "+Ai(N)+" is not interpolatable.")},Ho.prototype.evaluate=function(a){var u=this.labels,c=this.outputs;if(u.length===1)return c[0].evaluate(a);var m=this.input.evaluate(a);if(m<=u[0])return c[0].evaluate(a);var x=u.length;if(m>=u[x-1])return c[x-1].evaluate(a);var E=Qc(u,m),A=Ho.interpolationFactor(this.interpolation,m,u[E],u[E+1]),I=c[E].evaluate(a),D=c[E+1].evaluate(a);return this.operator==="interpolate"?El[this.type.kind.toLowerCase()](I,D,A):this.operator==="interpolate-hcl"?Pu.reverse(Pu.interpolate(Pu.forward(I),Pu.forward(D),A)):Jc.reverse(Jc.interpolate(Jc.forward(I),Jc.forward(D),A))},Ho.prototype.eachChild=function(a){a(this.input);for(var u=0,c=this.outputs;u<c.length;u+=1)a(c[u])},Ho.prototype.outputDefined=function(){return this.outputs.every(function(a){return a.outputDefined()})},Ho.prototype.serialize=function(){var a;a=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var u=[this.operator,a,this.input.serialize()],c=0;c<this.labels.length;c++)u.push(this.labels[c],this.outputs[c].serialize());return u};var Sl=function(a,u){this.type=a,this.args=u};Sl.parse=function(a,u){if(a.length<2)return u.error("Expectected at least one argument.");var c=null,m=u.expectedType;m&&m.kind!=="value"&&(c=m);for(var x=[],E=0,A=a.slice(1);E<A.length;E+=1){var I=u.parse(A[E],1+x.length,c,void 0,{typeAnnotation:"omit"});if(!I)return null;c=c||I.type,x.push(I)}var D=m&&x.some(function(N){return Ji(m,N.type)});return new Sl(D?tn:c,x)},Sl.prototype.evaluate=function(a){for(var u,c=null,m=0,x=0,E=this.args;x<E.length&&(m++,(c=E[x].evaluate(a))&&c instanceof Aa&&!c.available&&(u||(u=c.name),c=null,m===this.args.length&&(c=u)),c===null);x+=1);return c},Sl.prototype.eachChild=function(a){this.args.forEach(a)},Sl.prototype.outputDefined=function(){return this.args.every(function(a){return a.outputDefined()})},Sl.prototype.serialize=function(){var a=["coalesce"];return this.eachChild(function(u){a.push(u.serialize())}),a};var $s=function(a,u){this.type=u.type,this.bindings=[].concat(a),this.result=u};$s.prototype.evaluate=function(a){return this.result.evaluate(a)},$s.prototype.eachChild=function(a){for(var u=0,c=this.bindings;u<c.length;u+=1)a(c[u][1]);a(this.result)},$s.parse=function(a,u){if(a.length<4)return u.error("Expected at least 3 arguments, but found "+(a.length-1)+" instead.");for(var c=[],m=1;m<a.length-1;m+=2){var x=a[m];if(typeof x!="string")return u.error("Expected string, but found "+typeof x+" instead.",m);if(/[^a-zA-Z0-9_]/.test(x))return u.error("Variable names must contain only alphanumeric characters or '_'.",m);var E=u.parse(a[m+1],m+1);if(!E)return null;c.push([x,E])}var A=u.parse(a[a.length-1],a.length-1,u.expectedType,c);return A?new $s(c,A):null},$s.prototype.outputDefined=function(){return this.result.outputDefined()},$s.prototype.serialize=function(){for(var a=["let"],u=0,c=this.bindings;u<c.length;u+=1){var m=c[u];a.push(m[0],m[1].serialize())}return a.push(this.result.serialize()),a};var Al=function(a,u,c){this.type=a,this.index=u,this.input=c};Al.parse=function(a,u){if(a.length!==3)return u.error("Expected 2 arguments, but found "+(a.length-1)+" instead.");var c=u.parse(a[1],1,sr),m=u.parse(a[2],2,zi(u.expectedType||tn));return c&&m?new Al(m.type.itemType,c,m):null},Al.prototype.evaluate=function(a){var u=this.index.evaluate(a),c=this.input.evaluate(a);if(u<0)throw new sa("Array index out of bounds: "+u+" < 0.");if(u>=c.length)throw new sa("Array index out of bounds: "+u+" > "+(c.length-1)+".");if(u!==Math.floor(u))throw new sa("Array index must be an integer, but found "+u+" instead.");return c[u]},Al.prototype.eachChild=function(a){a(this.index),a(this.input)},Al.prototype.outputDefined=function(){return!1},Al.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var oi=function(a,u){this.type=Wr,this.needle=a,this.haystack=u};oi.parse=function(a,u){if(a.length!==3)return u.error("Expected 2 arguments, but found "+(a.length-1)+" instead.");var c=u.parse(a[1],1,tn),m=u.parse(a[2],2,tn);return c&&m?Ia(c.type,[Wr,en,sr,sn,tn])?new oi(c,m):u.error("Expected first argument to be of type boolean, string, number or null, but found "+Ai(c.type)+" instead"):null},oi.prototype.evaluate=function(a){var u=this.needle.evaluate(a),c=this.haystack.evaluate(a);if(!c)return!1;if(!Ti(u,["boolean","string","number","null"]))throw new sa("Expected first argument to be of type boolean, string, number or null, but found "+Ai(Ta(u))+" instead.");if(!Ti(c,["string","array"]))throw new sa("Expected second argument to be of type array or string, but found "+Ai(Ta(c))+" instead.");return c.indexOf(u)>=0},oi.prototype.eachChild=function(a){a(this.needle),a(this.haystack)},oi.prototype.outputDefined=function(){return!0},oi.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var el=function(a,u,c){this.type=sr,this.needle=a,this.haystack=u,this.fromIndex=c};el.parse=function(a,u){if(a.length<=2||a.length>=5)return u.error("Expected 3 or 4 arguments, but found "+(a.length-1)+" instead.");var c=u.parse(a[1],1,tn),m=u.parse(a[2],2,tn);if(!c||!m)return null;if(!Ia(c.type,[Wr,en,sr,sn,tn]))return u.error("Expected first argument to be of type boolean, string, number or null, but found "+Ai(c.type)+" instead");if(a.length===4){var x=u.parse(a[3],3,sr);return x?new el(c,m,x):null}return new el(c,m)},el.prototype.evaluate=function(a){var u=this.needle.evaluate(a),c=this.haystack.evaluate(a);if(!Ti(u,["boolean","string","number","null"]))throw new sa("Expected first argument to be of type boolean, string, number or null, but found "+Ai(Ta(u))+" instead.");if(!Ti(c,["string","array"]))throw new sa("Expected second argument to be of type array or string, but found "+Ai(Ta(c))+" instead.");if(this.fromIndex){var m=this.fromIndex.evaluate(a);return c.indexOf(u,m)}return c.indexOf(u)},el.prototype.eachChild=function(a){a(this.needle),a(this.haystack),this.fromIndex&&a(this.fromIndex)},el.prototype.outputDefined=function(){return!1},el.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var a=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),a]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Ds=function(a,u,c,m,x,E){this.inputType=a,this.type=u,this.input=c,this.cases=m,this.outputs=x,this.otherwise=E};Ds.parse=function(a,u){if(a.length<5)return u.error("Expected at least 4 arguments, but found only "+(a.length-1)+".");if(a.length%2!=1)return u.error("Expected an even number of arguments.");var c,m;u.expectedType&&u.expectedType.kind!=="value"&&(m=u.expectedType);for(var x={},E=[],A=2;A<a.length-1;A+=2){var I=a[A],D=a[A+1];Array.isArray(I)||(I=[I]);var N=u.concat(A);if(I.length===0)return N.error("Expected at least one branch label.");for(var H=0,X=I;H<X.length;H+=1){var ne=X[H];if(typeof ne!="number"&&typeof ne!="string")return N.error("Branch labels must be numbers or strings.");if(typeof ne=="number"&&Math.abs(ne)>Number.MAX_SAFE_INTEGER)return N.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof ne=="number"&&Math.floor(ne)!==ne)return N.error("Numeric branch labels must be integer values.");if(c){if(N.checkSubtype(c,Ta(ne)))return null}else c=Ta(ne);if(x[String(ne)]!==void 0)return N.error("Branch labels must be unique.");x[String(ne)]=E.length}var R=u.parse(D,A,m);if(!R)return null;m=m||R.type,E.push(R)}var Pe=u.parse(a[1],1,tn);if(!Pe)return null;var Be=u.parse(a[a.length-1],a.length-1,m);return Be?Pe.type.kind!=="value"&&u.concat(1).checkSubtype(c,Pe.type)?null:new Ds(c,m,Pe,x,E,Be):null},Ds.prototype.evaluate=function(a){var u=this.input.evaluate(a);return(Ta(u)===this.inputType&&this.outputs[this.cases[u]]||this.otherwise).evaluate(a)},Ds.prototype.eachChild=function(a){a(this.input),this.outputs.forEach(a),a(this.otherwise)},Ds.prototype.outputDefined=function(){return this.outputs.every(function(a){return a.outputDefined()})&&this.otherwise.outputDefined()},Ds.prototype.serialize=function(){for(var a=this,u=["match",this.input.serialize()],c=[],m={},x=0,E=Object.keys(this.cases).sort();x<E.length;x+=1){var A=E[x];(X=m[this.cases[A]])===void 0?(m[this.cases[A]]=c.length,c.push([this.cases[A],[A]])):c[X][1].push(A)}for(var I=function(R){return a.inputType.kind==="number"?Number(R):R},D=0,N=c;D<N.length;D+=1){var H=N[D],X=H[0],ne=H[1];u.push(ne.length===1?I(ne[0]):ne.map(I)),u.push(this.outputs[outputIndex$1].serialize())}return u.push(this.otherwise.serialize()),u};var Ou=function(a,u,c){this.type=a,this.branches=u,this.otherwise=c};Ou.parse=function(a,u){if(a.length<4)return u.error("Expected at least 3 arguments, but found only "+(a.length-1)+".");if(a.length%2!=0)return u.error("Expected an odd number of arguments.");var c;u.expectedType&&u.expectedType.kind!=="value"&&(c=u.expectedType);for(var m=[],x=1;x<a.length-1;x+=2){var E=u.parse(a[x],x,Wr);if(!E)return null;var A=u.parse(a[x+1],x+1,c);if(!A)return null;m.push([E,A]),c=c||A.type}var I=u.parse(a[a.length-1],a.length-1,c);return I?new Ou(c,m,I):null},Ou.prototype.evaluate=function(a){for(var u=0,c=this.branches;u<c.length;u+=1){var m=c[u],x=m[1];if(m[0].evaluate(a))return x.evaluate(a)}return this.otherwise.evaluate(a)},Ou.prototype.eachChild=function(a){for(var u=0,c=this.branches;u<c.length;u+=1){var m=c[u],x=m[1];a(m[0]),a(x)}a(this.otherwise)},Ou.prototype.outputDefined=function(){return this.branches.every(function(a){return a[1].outputDefined()})&&this.otherwise.outputDefined()},Ou.prototype.serialize=function(){var a=["case"];return this.eachChild(function(u){a.push(u.serialize())}),a};var tl=function(a,u,c,m){this.type=a,this.input=u,this.beginIndex=c,this.endIndex=m};function rp(a,u){return a==="=="||a==="!="?u.kind==="boolean"||u.kind==="string"||u.kind==="number"||u.kind==="null"||u.kind==="value":u.kind==="string"||u.kind==="number"||u.kind==="value"}function ta(a,u,c,m){return m.compare(u,c)===0}function Ii(a,u,c){var m=a!=="=="&&a!=="!=";return function(){function x(E,A,I){this.type=Wr,this.lhs=E,this.rhs=A,this.collator=I,this.hasUntypedArgument=E.type.kind==="value"||A.type.kind==="value"}return x.parse=function(E,A){if(E.length!==3&&E.length!==4)return A.error("Expected two or three arguments.");var I=E[0],D=A.parse(E[1],1,tn);if(!D)return null;if(!rp(I,D.type))return A.concat(1).error('"'+I+`" comparisons are not supported for type '`+Ai(D.type)+"'.");var N=A.parse(E[2],2,tn);if(!N)return null;if(!rp(I,N.type))return A.concat(2).error('"'+I+`" comparisons are not supported for type '`+Ai(N.type)+"'.");if(D.type.kind!==N.type.kind&&D.type.kind!=="value"&&N.type.kind!=="value")return A.error("Cannot compare types '"+Ai(D.type)+"' and '"+Ai(N.type)+"'.");m&&(D.type.kind==="value"&&N.type.kind!=="value"?D=new ha(N.type,[D]):D.type.kind!=="value"&&N.type.kind==="value"&&(N=new ha(D.type,[N])));var H=null;if(E.length===4){if(D.type.kind!=="string"&&N.type.kind!=="string"&&D.type.kind!=="value"&&N.type.kind!=="value")return A.error("Cannot use collator to compare non-string types.");if(!(H=A.parse(E[3],3,vi)))return null}return new x(D,N,H)},x.prototype.evaluate=function(E){var A=this.lhs.evaluate(E),I=this.rhs.evaluate(E);if(m&&this.hasUntypedArgument){var D=Ta(A),N=Ta(I);if(D.kind!==N.kind||D.kind!=="string"&&D.kind!=="number")throw new sa('Expected arguments for "'+a+'" to be (string, string) or (number, number), but found ('+D.kind+", "+N.kind+") instead.")}if(this.collator&&!m&&this.hasUntypedArgument){var H=Ta(A),X=Ta(I);if(H.kind!=="string"||X.kind!=="string")return u(E,A,I)}return this.collator?c(E,A,I,this.collator.evaluate(E)):u(E,A,I)},x.prototype.eachChild=function(E){E(this.lhs),E(this.rhs),this.collator&&E(this.collator)},x.prototype.outputDefined=function(){return!0},x.prototype.serialize=function(){var E=[a];return this.eachChild(function(A){E.push(A.serialize())}),E},x}()}tl.parse=function(a,u){if(a.length<=2||a.length>=5)return u.error("Expected 3 or 4 arguments, but found "+(a.length-1)+" instead.");var c=u.parse(a[1],1,tn),m=u.parse(a[2],2,sr);if(!c||!m)return null;if(!Ia(c.type,[zi(tn),en,tn]))return u.error("Expected first argument to be of type array or string, but found "+Ai(c.type)+" instead");if(a.length===4){var x=u.parse(a[3],3,sr);return x?new tl(c.type,c,m,x):null}return new tl(c.type,c,m)},tl.prototype.evaluate=function(a){var u=this.input.evaluate(a),c=this.beginIndex.evaluate(a);if(!Ti(u,["string","array"]))throw new sa("Expected first argument to be of type array or string, but found "+Ai(Ta(u))+" instead.");if(this.endIndex){var m=this.endIndex.evaluate(a);return u.slice(c,m)}return u.slice(c)},tl.prototype.eachChild=function(a){a(this.input),a(this.beginIndex),this.endIndex&&a(this.endIndex)},tl.prototype.outputDefined=function(){return!1},tl.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var a=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),a]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var fu=Ii("==",function(a,u,c){return u===c},ta),Du=Ii("!=",function(a,u,c){return u!==c},function(a,u,c,m){return!ta(0,u,c,m)}),mh=Ii("<",function(a,u,c){return u<c},function(a,u,c,m){return m.compare(u,c)<0}),Ha=Ii(">",function(a,u,c){return u>c},function(a,u,c,m){return m.compare(u,c)>0}),ef=Ii("<=",function(a,u,c){return u<=c},function(a,u,c,m){return m.compare(u,c)<=0}),Vp=Ii(">=",function(a,u,c){return u>=c},function(a,u,c,m){return m.compare(u,c)>=0}),xs=function(a,u,c,m,x){this.type=en,this.number=a,this.locale=u,this.currency=c,this.minFractionDigits=m,this.maxFractionDigits=x};xs.parse=function(a,u){if(a.length!==3)return u.error("Expected two arguments.");var c=u.parse(a[1],1,sr);if(!c)return null;var m=a[2];if(typeof m!="object"||Array.isArray(m))return u.error("NumberFormat options argument must be an object.");var x=null;if(m.locale&&!(x=u.parse(m.locale,1,en)))return null;var E=null;if(m.currency&&!(E=u.parse(m.currency,1,en)))return null;var A=null;if(m["min-fraction-digits"]&&!(A=u.parse(m["min-fraction-digits"],1,sr)))return null;var I=null;return m["max-fraction-digits"]&&!(I=u.parse(m["max-fraction-digits"],1,sr))?null:new xs(c,x,E,A,I)},xs.prototype.evaluate=function(a){return new Intl.NumberFormat(this.locale?this.locale.evaluate(a):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(a):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(a):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(a):void 0}).format(this.number.evaluate(a))},xs.prototype.eachChild=function(a){a(this.number),this.locale&&a(this.locale),this.currency&&a(this.currency),this.minFractionDigits&&a(this.minFractionDigits),this.maxFractionDigits&&a(this.maxFractionDigits)},xs.prototype.outputDefined=function(){return!1},xs.prototype.serialize=function(){var a={};return this.locale&&(a.locale=this.locale.serialize()),this.currency&&(a.currency=this.currency.serialize()),this.minFractionDigits&&(a["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(a["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),a]};var Fu=function(a){this.type=sr,this.input=a};Fu.parse=function(a,u){if(a.length!==2)return u.error("Expected 1 argument, but found "+(a.length-1)+" instead.");var c=u.parse(a[1],1);return c?c.type.kind!=="array"&&c.type.kind!=="string"&&c.type.kind!=="value"?u.error("Expected argument of type string or array, but found "+Ai(c.type)+" instead."):new Fu(c):null},Fu.prototype.evaluate=function(a){var u=this.input.evaluate(a);if(typeof u=="string"||Array.isArray(u))return u.length;throw new sa("Expected value to be of type string or array, but found "+Ai(Ta(u))+" instead.")},Fu.prototype.eachChild=function(a){a(this.input)},Fu.prototype.outputDefined=function(){return!1},Fu.prototype.serialize=function(){var a=["length"];return this.eachChild(function(u){a.push(u.serialize())}),a};var ku={"==":fu,"!=":Du,">":Ha,"<":mh,">=":Vp,"<=":ef,array:ha,at:Al,boolean:ha,case:Ou,coalesce:Sl,collator:Kt,format:$o,image:Vo,in:oi,"index-of":el,interpolate:Ho,"interpolate-hcl":Ho,"interpolate-lab":Ho,length:Fu,let:$s,literal:Oa,match:Ds,number:ha,"number-format":xs,object:ha,slice:tl,step:Os,string:ha,"to-boolean":ss,"to-color":ss,"to-number":ss,"to-string":ss,var:Iu,within:jo};function ql(a,u){var c=u[0],m=u[1],x=u[2],E=u[3];c=c.evaluate(a),m=m.evaluate(a),x=x.evaluate(a);var A=E?E.evaluate(a):1,I=$l(c,m,x,A);if(I)throw new sa(I);return new wi(c/255*A,m/255*A,x/255*A,A)}function If(a,u){return a in u}function wa(a,u){var c=u[a];return c===void 0?null:c}function Qs(a){return{type:a}}function Rc(a){return{result:"success",value:a}}function Kl(a){return{result:"error",value:a}}function rl(a){return a["property-type"]==="data-driven"||a["property-type"]==="cross-faded-data-driven"}function gh(a){return!!a.expression&&a.expression.parameters.indexOf("zoom")>-1}function Ql(a){return!!a.expression&&a.expression.interpolated}function ca(a){return a instanceof Number?"number":a instanceof String?"string":a instanceof Boolean?"boolean":Array.isArray(a)?"array":a===null?"null":typeof a}function tf(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function np(a){return a}function Tl(a,u,c){return a!==void 0?a:u!==void 0?u:c!==void 0?c:void 0}function Jl(a,u,c,m,x){return Tl(typeof c===x?m[c]:void 0,a.default,u.default)}function _h(a,u,c){if(ca(c)!=="number")return Tl(a.default,u.default);var m=a.stops.length;if(m===1||c<=a.stops[0][0])return a.stops[0][1];if(c>=a.stops[m-1][0])return a.stops[m-1][1];var x=Qc(a.stops.map(function(E){return E[0]}),c);return a.stops[x][1]}function Pf(a,u,c){var m=a.base!==void 0?a.base:1;if(ca(c)!=="number")return Tl(a.default,u.default);var x=a.stops.length;if(x===1||c<=a.stops[0][0])return a.stops[0][1];if(c>=a.stops[x-1][0])return a.stops[x-1][1];var E=Qc(a.stops.map(function(X){return X[0]}),c),A=function(X,ne,R,Pe){var Be=Pe-R,rt=X-R;return Be===0?0:ne===1?rt/Be:(Math.pow(ne,rt)-1)/(Math.pow(ne,Be)-1)}(c,m,a.stops[E][0],a.stops[E+1][0]),I=a.stops[E][1],D=a.stops[E+1][1],N=El[u.type]||np;if(a.colorSpace&&a.colorSpace!=="rgb"){var H=tp[a.colorSpace];N=function(X,ne){return H.reverse(H.interpolate(H.forward(X),H.forward(ne),A))}}return typeof I.evaluate=="function"?{evaluate:function(){for(var X=[],ne=arguments.length;ne--;)X[ne]=arguments[ne];var R=I.evaluate.apply(void 0,X),Pe=D.evaluate.apply(void 0,X);if(R!==void 0&&Pe!==void 0)return N(R,Pe,A)}}:N(I,D,A)}function wl(a,u,c){return u.type==="color"?c=wi.parse(c):u.type==="formatted"?c=ma.fromString(c.toString()):u.type==="resolvedImage"?c=Aa.fromString(c.toString()):ca(c)===u.type||u.type==="enum"&&u.values[c]||(c=void 0),Tl(c,a.default,u.default)}ea.register(ku,{error:[{kind:"error"},[en],function(a,u){throw new sa(u[0].evaluate(a))}],typeof:[en,[tn],function(a,u){return Ai(Ta(u[0].evaluate(a)))}],"to-rgba":[zi(sr,4),[Yr],function(a,u){return u[0].evaluate(a).toArray()}],rgb:[Yr,[sr,sr,sr],ql],rgba:[Yr,[sr,sr,sr,sr],ql],has:{type:Wr,overloads:[[[en],function(a,u){return If(u[0].evaluate(a),a.properties())}],[[en,pi],function(a,u){var c=u[1];return If(u[0].evaluate(a),c.evaluate(a))}]]},get:{type:tn,overloads:[[[en],function(a,u){return wa(u[0].evaluate(a),a.properties())}],[[en,pi],function(a,u){var c=u[1];return wa(u[0].evaluate(a),c.evaluate(a))}]]},"feature-state":[tn,[en],function(a,u){return wa(u[0].evaluate(a),a.featureState||{})}],properties:[pi,[],function(a){return a.properties()}],"geometry-type":[en,[],function(a){return a.geometryType()}],id:[tn,[],function(a){return a.id()}],zoom:[sr,[],function(a){return a.globals.zoom}],"heatmap-density":[sr,[],function(a){return a.globals.heatmapDensity||0}],"line-progress":[sr,[],function(a){return a.globals.lineProgress||0}],accumulated:[tn,[],function(a){return a.globals.accumulated===void 0?null:a.globals.accumulated}],"+":[sr,Qs(sr),function(a,u){for(var c=0,m=0,x=u;m<x.length;m+=1)c+=x[m].evaluate(a);return c}],"*":[sr,Qs(sr),function(a,u){for(var c=1,m=0,x=u;m<x.length;m+=1)c*=x[m].evaluate(a);return c}],"-":{type:sr,overloads:[[[sr,sr],function(a,u){var c=u[1];return u[0].evaluate(a)-c.evaluate(a)}],[[sr],function(a,u){return-u[0].evaluate(a)}]]},"/":[sr,[sr,sr],function(a,u){var c=u[1];return u[0].evaluate(a)/c.evaluate(a)}],"%":[sr,[sr,sr],function(a,u){var c=u[1];return u[0].evaluate(a)%c.evaluate(a)}],ln2:[sr,[],function(){return Math.LN2}],pi:[sr,[],function(){return Math.PI}],e:[sr,[],function(){return Math.E}],"^":[sr,[sr,sr],function(a,u){var c=u[1];return Math.pow(u[0].evaluate(a),c.evaluate(a))}],sqrt:[sr,[sr],function(a,u){return Math.sqrt(u[0].evaluate(a))}],log10:[sr,[sr],function(a,u){return Math.log(u[0].evaluate(a))/Math.LN10}],ln:[sr,[sr],function(a,u){return Math.log(u[0].evaluate(a))}],log2:[sr,[sr],function(a,u){return Math.log(u[0].evaluate(a))/Math.LN2}],sin:[sr,[sr],function(a,u){return Math.sin(u[0].evaluate(a))}],cos:[sr,[sr],function(a,u){return Math.cos(u[0].evaluate(a))}],tan:[sr,[sr],function(a,u){return Math.tan(u[0].evaluate(a))}],asin:[sr,[sr],function(a,u){return Math.asin(u[0].evaluate(a))}],acos:[sr,[sr],function(a,u){return Math.acos(u[0].evaluate(a))}],atan:[sr,[sr],function(a,u){return Math.atan(u[0].evaluate(a))}],min:[sr,Qs(sr),function(a,u){return Math.min.apply(Math,u.map(function(c){return c.evaluate(a)}))}],max:[sr,Qs(sr),function(a,u){return Math.max.apply(Math,u.map(function(c){return c.evaluate(a)}))}],abs:[sr,[sr],function(a,u){return Math.abs(u[0].evaluate(a))}],round:[sr,[sr],function(a,u){var c=u[0].evaluate(a);return c<0?-Math.round(-c):Math.round(c)}],floor:[sr,[sr],function(a,u){return Math.floor(u[0].evaluate(a))}],ceil:[sr,[sr],function(a,u){return Math.ceil(u[0].evaluate(a))}],"filter-==":[Wr,[en,tn],function(a,u){var c=u[0],m=u[1];return a.properties()[c.value]===m.value}],"filter-id-==":[Wr,[tn],function(a,u){var c=u[0];return a.id()===c.value}],"filter-type-==":[Wr,[en],function(a,u){var c=u[0];return a.geometryType()===c.value}],"filter-<":[Wr,[en,tn],function(a,u){var c=u[0],m=u[1],x=a.properties()[c.value],E=m.value;return typeof x==typeof E&&x<E}],"filter-id-<":[Wr,[tn],function(a,u){var c=u[0],m=a.id(),x=c.value;return typeof m==typeof x&&m<x}],"filter->":[Wr,[en,tn],function(a,u){var c=u[0],m=u[1],x=a.properties()[c.value],E=m.value;return typeof x==typeof E&&x>E}],"filter-id->":[Wr,[tn],function(a,u){var c=u[0],m=a.id(),x=c.value;return typeof m==typeof x&&m>x}],"filter-<=":[Wr,[en,tn],function(a,u){var c=u[0],m=u[1],x=a.properties()[c.value],E=m.value;return typeof x==typeof E&&x<=E}],"filter-id-<=":[Wr,[tn],function(a,u){var c=u[0],m=a.id(),x=c.value;return typeof m==typeof x&&m<=x}],"filter->=":[Wr,[en,tn],function(a,u){var c=u[0],m=u[1],x=a.properties()[c.value],E=m.value;return typeof x==typeof E&&x>=E}],"filter-id->=":[Wr,[tn],function(a,u){var c=u[0],m=a.id(),x=c.value;return typeof m==typeof x&&m>=x}],"filter-has":[Wr,[tn],function(a,u){return u[0].value in a.properties()}],"filter-has-id":[Wr,[],function(a){return a.id()!==null&&a.id()!==void 0}],"filter-type-in":[Wr,[zi(en)],function(a,u){return u[0].value.indexOf(a.geometryType())>=0}],"filter-id-in":[Wr,[zi(tn)],function(a,u){return u[0].value.indexOf(a.id())>=0}],"filter-in-small":[Wr,[en,zi(tn)],function(a,u){var c=u[0];return u[1].value.indexOf(a.properties()[c.value])>=0}],"filter-in-large":[Wr,[en,zi(tn)],function(a,u){var c=u[0],m=u[1];return function(x,E,A,I){for(;A<=I;){var D=A+I>>1;if(E[D]===x)return!0;E[D]>x?I=D-1:A=D+1}return!1}(a.properties()[c.value],m.value,0,m.value.length-1)}],all:{type:Wr,overloads:[[[Wr,Wr],function(a,u){var c=u[1];return u[0].evaluate(a)&&c.evaluate(a)}],[Qs(Wr),function(a,u){for(var c=0,m=u;c<m.length;c+=1)if(!m[c].evaluate(a))return!1;return!0}]]},any:{type:Wr,overloads:[[[Wr,Wr],function(a,u){var c=u[1];return u[0].evaluate(a)||c.evaluate(a)}],[Qs(Wr),function(a,u){for(var c=0,m=u;c<m.length;c+=1)if(m[c].evaluate(a))return!0;return!1}]]},"!":[Wr,[Wr],function(a,u){return!u[0].evaluate(a)}],"is-supported-script":[Wr,[en],function(a,u){var c=a.globals&&a.globals.isSupportedScript;return!c||c(u[0].evaluate(a))}],upcase:[en,[en],function(a,u){return u[0].evaluate(a).toUpperCase()}],downcase:[en,[en],function(a,u){return u[0].evaluate(a).toLowerCase()}],concat:[en,Qs(tn),function(a,u){return u.map(function(c){return fi(c.evaluate(a))}).join("")}],"resolved-locale":[en,[vi],function(a,u){return u[0].evaluate(a).resolvedLocale()}]});var hu=function(a,u){this.expression=a,this._warningHistory={},this._evaluator=new Ea,this._defaultValue=u?function(c){return c.type==="color"&&tf(c.default)?new wi(0,0,0,0):c.type==="color"?wi.parse(c.default)||null:c.default===void 0?null:c.default}(u):null,this._enumValues=u&&u.type==="enum"?u.values:null};function Mc(a){return Array.isArray(a)&&a.length>0&&typeof a[0]=="string"&&a[0]in ku}function rf(a,u){var c=new Qu(ku,[],u?function(x){var E={color:Yr,string:en,number:sr,enum:en,boolean:Wr,formatted:qi,resolvedImage:ci};return x.type==="array"?zi(E[x.value]||tn,x.length):E[x.type]}(u):void 0),m=c.parse(a,void 0,void 0,void 0,u&&u.type==="string"?{typeAnnotation:"coerce"}:void 0);return m?Rc(new hu(m,u)):Kl(c.errors)}hu.prototype.evaluateWithoutErrorHandling=function(a,u,c,m,x,E){return this._evaluator.globals=a,this._evaluator.feature=u,this._evaluator.featureState=c,this._evaluator.canonical=m,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=E,this.expression.evaluate(this._evaluator)},hu.prototype.evaluate=function(a,u,c,m,x,E){this._evaluator.globals=a,this._evaluator.feature=u||null,this._evaluator.featureState=c||null,this._evaluator.canonical=m,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=E||null;try{var A=this.expression.evaluate(this._evaluator);if(A==null||typeof A=="number"&&A!=A)return this._defaultValue;if(this._enumValues&&!(A in this._enumValues))throw new sa("Expected value to be one of "+Object.keys(this._enumValues).map(function(I){return JSON.stringify(I)}).join(", ")+", but found "+JSON.stringify(A)+" instead.");return A}catch(I){return this._warningHistory[I.message]||(this._warningHistory[I.message]=!0,typeof console!="undefined"&&console.warn(I.message)),this._defaultValue}};var ec=function(a,u){this.kind=a,this._styleExpression=u,this.isStateDependent=a!=="constant"&&!bl(u.expression)};ec.prototype.evaluateWithoutErrorHandling=function(a,u,c,m,x,E){return this._styleExpression.evaluateWithoutErrorHandling(a,u,c,m,x,E)},ec.prototype.evaluate=function(a,u,c,m,x,E){return this._styleExpression.evaluate(a,u,c,m,x,E)};var tc=function(a,u,c,m){this.kind=a,this.zoomStops=c,this._styleExpression=u,this.isStateDependent=a!=="camera"&&!bl(u.expression),this.interpolationType=m};function ip(a,u){if((a=rf(a,u)).result==="error")return a;var c=a.value.expression,m=xl(c);if(!m&&!rl(u))return Kl([new wr("","data expressions not supported")]);var x=Mu(c,["zoom"]);if(!x&&!gh(u))return Kl([new wr("","zoom expressions not supported")]);var E=function A(I){var D=null;if(I instanceof $s)D=A(I.result);else if(I instanceof Sl)for(var N=0,H=I.args;N<H.length&&!(D=A(H[N]));N+=1);else(I instanceof Os||I instanceof Ho)&&I.input instanceof ea&&I.input.name==="zoom"&&(D=I);return D instanceof wr||I.eachChild(function(X){var ne=A(X);ne instanceof wr?D=ne:!D&&ne?D=new wr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&ne&&D!==ne&&(D=new wr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}(c);return E||x?E instanceof wr?Kl([E]):E instanceof Ho&&!Ql(u)?Kl([new wr("",'"interpolate" expressions cannot be used with this property')]):Rc(E?new tc(m?"camera":"composite",a.value,E.labels,E instanceof Ho?E.interpolation:void 0):new ec(m?"constant":"source",a.value)):Kl([new wr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}tc.prototype.evaluateWithoutErrorHandling=function(a,u,c,m,x,E){return this._styleExpression.evaluateWithoutErrorHandling(a,u,c,m,x,E)},tc.prototype.evaluate=function(a,u,c,m,x,E){return this._styleExpression.evaluate(a,u,c,m,x,E)},tc.prototype.interpolationFactor=function(a,u,c){return this.interpolationType?Ho.interpolationFactor(this.interpolationType,a,u,c):0};var nl=function(a,u){this._parameters=a,this._specification=u,at(this,function c(m,x){var E,A,I,D=x.type==="color",N=m.stops&&typeof m.stops[0][0]=="object",H=N||!(N||m.property!==void 0),X=m.type||(Ql(x)?"exponential":"interval");if(D&&((m=at({},m)).stops&&(m.stops=m.stops.map(function(cn){return[cn[0],wi.parse(cn[1])]})),m.default=wi.parse(m.default?m.default:x.default)),m.colorSpace&&m.colorSpace!=="rgb"&&!tp[m.colorSpace])throw new Error("Unknown color space: "+m.colorSpace);if(X==="exponential")E=Pf;else if(X==="interval")E=_h;else if(X==="categorical"){E=Jl,A=Object.create(null);for(var ne=0,R=m.stops;ne<R.length;ne+=1){var Pe=R[ne];A[Pe[0]]=Pe[1]}I=typeof m.stops[0][0]}else{if(X!=="identity")throw new Error('Unknown function type "'+X+'"');E=wl}if(N){for(var Be={},rt=[],Ge=0;Ge<m.stops.length;Ge++){var St=m.stops[Ge],Ft=St[0].zoom;Be[Ft]===void 0&&(Be[Ft]={zoom:Ft,type:m.type,property:m.property,default:m.default,stops:[]},rt.push(Ft)),Be[Ft].stops.push([St[0].value,St[1]])}for(var Yt=[],qt=0,dr=rt;qt<dr.length;qt+=1){var Lr=dr[qt];Yt.push([Be[Lr].zoom,c(Be[Lr],x)])}var Xr={name:"linear"};return{kind:"composite",interpolationType:Xr,interpolationFactor:Ho.interpolationFactor.bind(void 0,Xr),zoomStops:Yt.map(function(cn){return cn[0]}),evaluate:function(cn,Vn){var pn=cn.zoom;return Pf({stops:Yt,base:m.base},x,pn).evaluate(pn,Vn)}}}if(H){var Bn=X==="exponential"?{name:"exponential",base:m.base!==void 0?m.base:1}:null;return{kind:"camera",interpolationType:Bn,interpolationFactor:Ho.interpolationFactor.bind(void 0,Bn),zoomStops:m.stops.map(function(cn){return cn[0]}),evaluate:function(cn){return E(m,x,cn.zoom,A,I)}}}return{kind:"source",evaluate:function(cn,Vn){var pn=Vn&&Vn.properties?Vn.properties[m.property]:void 0;return pn===void 0?Tl(m.default,x.default):E(m,x,pn,A,I)}}}(this._parameters,this._specification))};function Js(a){var u=a.key,c=a.value,m=a.valueSpec||{},x=a.objectElementValidators||{},E=a.style,A=a.styleSpec,I=[],D=ca(c);if(D!=="object")return[new Q(u,c,"object expected, "+D+" found")];for(var N in c){var H=N.split(".")[0],X=m[H]||m["*"],ne=void 0;if(x[H])ne=x[H];else if(m[H])ne=Li;else if(x["*"])ne=x["*"];else{if(!m["*"]){I.push(new Q(u,c[N],'unknown property "'+N+'"'));continue}ne=Li}I=I.concat(ne({key:(u&&u+".")+N,value:c[N],valueSpec:X,style:E,styleSpec:A,object:c,objectKey:N},c))}for(var R in m)x[R]||m[R].required&&m[R].default===void 0&&c[R]===void 0&&I.push(new Q(u,c,'missing required property "'+R+'"'));return I}function nf(a){var u=a.value,c=a.valueSpec,m=a.style,x=a.styleSpec,E=a.key,A=a.arrayElementValidator||Li;if(ca(u)!=="array")return[new Q(E,u,"array expected, "+ca(u)+" found")];if(c.length&&u.length!==c.length)return[new Q(E,u,"array length "+c.length+" expected, length "+u.length+" found")];if(c["min-length"]&&u.length<c["min-length"])return[new Q(E,u,"array length at least "+c["min-length"]+" expected, length "+u.length+" found")];var I={type:c.value,values:c.values};x.$version<7&&(I.function=c.function),ca(c.value)==="object"&&(I=c.value);for(var D=[],N=0;N<u.length;N++)D=D.concat(A({array:u,arrayIndex:N,value:u[N],valueSpec:I,style:m,styleSpec:x,key:E+"["+N+"]"}));return D}function Ic(a){var u=a.key,c=a.value,m=a.valueSpec,x=ca(c);return x==="number"&&c!=c&&(x="NaN"),x!=="number"?[new Q(u,c,"number expected, "+x+" found")]:"minimum"in m&&c<m.minimum?[new Q(u,c,c+" is less than the minimum value "+m.minimum)]:"maximum"in m&&c>m.maximum?[new Q(u,c,c+" is greater than the maximum value "+m.maximum)]:[]}function yh(a){var u,c,m,x=a.valueSpec,E=Ee(a.value.type),A={},I=E!=="categorical"&&a.value.property===void 0,D=!I,N=ca(a.value.stops)==="array"&&ca(a.value.stops[0])==="array"&&ca(a.value.stops[0][0])==="object",H=Js({key:a.key,value:a.value,valueSpec:a.styleSpec.function,style:a.style,styleSpec:a.styleSpec,objectElementValidators:{stops:function(R){if(E==="identity")return[new Q(R.key,R.value,'identity function may not have a "stops" property')];var Pe=[],Be=R.value;return Pe=Pe.concat(nf({key:R.key,value:Be,valueSpec:R.valueSpec,style:R.style,styleSpec:R.styleSpec,arrayElementValidator:X})),ca(Be)==="array"&&Be.length===0&&Pe.push(new Q(R.key,Be,"array must have at least one stop")),Pe},default:function(R){return Li({key:R.key,value:R.value,valueSpec:x,style:R.style,styleSpec:R.styleSpec})}}});return E==="identity"&&I&&H.push(new Q(a.key,a.value,'missing required property "property"')),E==="identity"||a.value.stops||H.push(new Q(a.key,a.value,'missing required property "stops"')),E==="exponential"&&a.valueSpec.expression&&!Ql(a.valueSpec)&&H.push(new Q(a.key,a.value,"exponential functions not supported")),a.styleSpec.$version>=8&&(D&&!rl(a.valueSpec)?H.push(new Q(a.key,a.value,"property functions not supported")):I&&!gh(a.valueSpec)&&H.push(new Q(a.key,a.value,"zoom functions not supported"))),E!=="categorical"&&!N||a.value.property!==void 0||H.push(new Q(a.key,a.value,'"property" property is required')),H;function X(R){var Pe=[],Be=R.value,rt=R.key;if(ca(Be)!=="array")return[new Q(rt,Be,"array expected, "+ca(Be)+" found")];if(Be.length!==2)return[new Q(rt,Be,"array length 2 expected, length "+Be.length+" found")];if(N){if(ca(Be[0])!=="object")return[new Q(rt,Be,"object expected, "+ca(Be[0])+" found")];if(Be[0].zoom===void 0)return[new Q(rt,Be,"object stop key must have zoom")];if(Be[0].value===void 0)return[new Q(rt,Be,"object stop key must have value")];if(m&&m>Ee(Be[0].zoom))return[new Q(rt,Be[0].zoom,"stop zoom values must appear in ascending order")];Ee(Be[0].zoom)!==m&&(m=Ee(Be[0].zoom),c=void 0,A={}),Pe=Pe.concat(Js({key:rt+"[0]",value:Be[0],valueSpec:{zoom:{}},style:R.style,styleSpec:R.styleSpec,objectElementValidators:{zoom:Ic,value:ne}}))}else Pe=Pe.concat(ne({key:rt+"[0]",value:Be[0],valueSpec:{},style:R.style,styleSpec:R.styleSpec},Be));return Mc(ir(Be[1]))?Pe.concat([new Q(rt+"[1]",Be[1],"expressions are not allowed in function stops.")]):Pe.concat(Li({key:rt+"[1]",value:Be[1],valueSpec:x,style:R.style,styleSpec:R.styleSpec}))}function ne(R,Pe){var Be=ca(R.value),rt=Ee(R.value),Ge=R.value!==null?R.value:Pe;if(u){if(Be!==u)return[new Q(R.key,Ge,Be+" stop domain type must match previous stop domain type "+u)]}else u=Be;if(Be!=="number"&&Be!=="string"&&Be!=="boolean")return[new Q(R.key,Ge,"stop domain value must be a number, string, or boolean")];if(Be!=="number"&&E!=="categorical"){var St="number expected, "+Be+" found";return rl(x)&&E===void 0&&(St+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Q(R.key,Ge,St)]}return E!=="categorical"||Be!=="number"||isFinite(rt)&&Math.floor(rt)===rt?E!=="categorical"&&Be==="number"&&c!==void 0&&rt<c?[new Q(R.key,Ge,"stop domain values must appear in ascending order")]:(c=rt,E==="categorical"&&rt in A?[new Q(R.key,Ge,"stop domain values must be unique")]:(A[rt]=!0,[])):[new Q(R.key,Ge,"integer expected, found "+rt)]}}function Cl(a){var u=(a.expressionContext==="property"?ip:rf)(ir(a.value),a.valueSpec);if(u.result==="error")return u.value.map(function(m){return new Q(""+a.key+m.key,a.value,m.message)});var c=u.value.expression||u.value._styleExpression.expression;if(a.expressionContext==="property"&&a.propertyKey==="text-font"&&!c.outputDefined())return[new Q(a.key,a.value,'Invalid data expression for "'+a.propertyKey+'". Output values must be contained as literals within the expression.')];if(a.expressionContext==="property"&&a.propertyType==="layout"&&!bl(c))return[new Q(a.key,a.value,'"feature-state" data expressions are not supported with layout properties.')];if(a.expressionContext==="filter"&&!bl(c))return[new Q(a.key,a.value,'"feature-state" data expressions are not supported with filters.')];if(a.expressionContext&&a.expressionContext.indexOf("cluster")===0){if(!Mu(c,["zoom","feature-state"]))return[new Q(a.key,a.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(a.expressionContext==="cluster-initial"&&!xl(c))return[new Q(a.key,a.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function pu(a){var u=a.key,c=a.value,m=a.valueSpec,x=[];return Array.isArray(m.values)?m.values.indexOf(Ee(c))===-1&&x.push(new Q(u,c,"expected one of ["+m.values.join(", ")+"], "+JSON.stringify(c)+" found")):Object.keys(m.values).indexOf(Ee(c))===-1&&x.push(new Q(u,c,"expected one of ["+Object.keys(m.values).join(", ")+"], "+JSON.stringify(c)+" found")),x}function af(a){if(a===!0||a===!1)return!0;if(!Array.isArray(a)||a.length===0)return!1;switch(a[0]){case"has":return a.length>=2&&a[1]!=="$id"&&a[1]!=="$type";case"in":return a.length>=3&&(typeof a[1]!="string"||Array.isArray(a[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return a.length!==3||Array.isArray(a[1])||Array.isArray(a[2]);case"any":case"all":for(var u=0,c=a.slice(1);u<c.length;u+=1){var m=c[u];if(!af(m)&&typeof m!="boolean")return!1}return!0;default:return!0}}nl.deserialize=function(a){return new nl(a._parameters,a._specification)},nl.serialize=function(a){return{_parameters:a._parameters,_specification:a._specification}};var Pc={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Bu(a){if(a==null)return{filter:function(){return!0},needGeometry:!1};af(a)||(a=Of(a));var u=rf(a,Pc);if(u.result==="error")throw new Error(u.value.map(function(c){return c.key+": "+c.message}).join(", "));return{filter:function(c,m,x){return u.value.evaluate(c,m,{},x)},needGeometry:function c(m){if(!Array.isArray(m))return!1;if(m[0]==="within")return!0;for(var x=1;x<m.length;x++)if(c(m[x]))return!0;return!1}(a)}}function Md(a,u){return a<u?-1:a>u?1:0}function Of(a){if(!a)return!0;var u,c=a[0];return a.length<=1?c!=="any":c==="=="?xh(a[1],a[2],"=="):c==="!="?bh(xh(a[1],a[2],"==")):c==="<"||c===">"||c==="<="||c===">="?xh(a[1],a[2],c):c==="any"?(u=a.slice(1),["any"].concat(u.map(Of))):c==="all"?["all"].concat(a.slice(1).map(Of)):c==="none"?["all"].concat(a.slice(1).map(Of).map(bh)):c==="in"?Df(a[1],a.slice(2)):c==="!in"?bh(Df(a[1],a.slice(2))):c==="has"?Fo(a[1]):c==="!has"?bh(Fo(a[1])):c!=="within"||a}function xh(a,u,c){switch(a){case"$type":return["filter-type-"+c,u];case"$id":return["filter-id-"+c,u];default:return["filter-"+c,a,u]}}function Df(a,u){if(u.length===0)return!1;switch(a){case"$type":return["filter-type-in",["literal",u]];case"$id":return["filter-id-in",["literal",u]];default:return u.length>200&&!u.some(function(c){return typeof c!=typeof u[0]})?["filter-in-large",a,["literal",u.sort(Md)]]:["filter-in-small",a,["literal",u]]}}function Fo(a){switch(a){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",a]}}function bh(a){return["!",a]}function ap(a){return af(ir(a.value))?Cl(at({},a,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function u(c){var m=c.value,x=c.key;if(ca(m)!=="array")return[new Q(x,m,"array expected, "+ca(m)+" found")];var E,A=c.styleSpec,I=[];if(m.length<1)return[new Q(x,m,"filter array must have at least 1 element")];switch(I=I.concat(pu({key:x+"[0]",value:m[0],valueSpec:A.filter_operator,style:c.style,styleSpec:c.styleSpec})),Ee(m[0])){case"<":case"<=":case">":case">=":m.length>=2&&Ee(m[1])==="$type"&&I.push(new Q(x,m,'"$type" cannot be use with operator "'+m[0]+'"'));case"==":case"!=":m.length!==3&&I.push(new Q(x,m,'filter array for operator "'+m[0]+'" must have 3 elements'));case"in":case"!in":m.length>=2&&(E=ca(m[1]))!=="string"&&I.push(new Q(x+"[1]",m[1],"string expected, "+E+" found"));for(var D=2;D<m.length;D++)E=ca(m[D]),Ee(m[1])==="$type"?I=I.concat(pu({key:x+"["+D+"]",value:m[D],valueSpec:A.geometry_type,style:c.style,styleSpec:c.styleSpec})):E!=="string"&&E!=="number"&&E!=="boolean"&&I.push(new Q(x+"["+D+"]",m[D],"string, number, or boolean expected, "+E+" found"));break;case"any":case"all":case"none":for(var N=1;N<m.length;N++)I=I.concat(u({key:x+"["+N+"]",value:m[N],style:c.style,styleSpec:c.styleSpec}));break;case"has":case"!has":E=ca(m[1]),m.length!==2?I.push(new Q(x,m,'filter array for "'+m[0]+'" operator must have 2 elements')):E!=="string"&&I.push(new Q(x+"[1]",m[1],"string expected, "+E+" found"));break;case"within":E=ca(m[1]),m.length!==2?I.push(new Q(x,m,'filter array for "'+m[0]+'" operator must have 2 elements')):E!=="object"&&I.push(new Q(x+"[1]",m[1],"object expected, "+E+" found"))}return I}(a)}function Ff(a,u){var c=a.key,m=a.style,x=a.styleSpec,E=a.value,A=a.objectKey,I=x[u+"_"+a.layerType];if(!I)return[];var D=A.match(/^(.*)-transition$/);if(u==="paint"&&D&&I[D[1]]&&I[D[1]].transition)return Li({key:c,value:E,valueSpec:x.transition,style:m,styleSpec:x});var N,H=a.valueSpec||I[A];if(!H)return[new Q(c,E,'unknown property "'+A+'"')];if(ca(E)==="string"&&rl(H)&&!H.tokens&&(N=/^{([^}]+)}$/.exec(E)))return[new Q(c,E,'"'+A+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(N[1])+" }`.")];var X=[];return a.layerType==="symbol"&&(A==="text-field"&&m&&!m.glyphs&&X.push(new Q(c,E,'use of "text-field" requires a style "glyphs" property')),A==="text-font"&&tf(ir(E))&&Ee(E.type)==="identity"&&X.push(new Q(c,E,'"text-font" does not support identity functions'))),X.concat(Li({key:a.key,value:E,valueSpec:H,style:m,styleSpec:x,expressionContext:"property",propertyType:u,propertyKey:A}))}function Eh(a){return Ff(a,"paint")}function Oc(a){return Ff(a,"layout")}function of(a){var u=[],c=a.value,m=a.key,x=a.style,E=a.styleSpec;c.type||c.ref||u.push(new Q(m,c,'either "type" or "ref" is required'));var A,I=Ee(c.type),D=Ee(c.ref);if(c.id)for(var N=Ee(c.id),H=0;H<a.arrayIndex;H++){var X=x.layers[H];Ee(X.id)===N&&u.push(new Q(m,c.id,'duplicate layer id "'+c.id+'", previously used at line '+X.id.__line__))}if("ref"in c)["type","source","source-layer","filter","layout"].forEach(function(Pe){Pe in c&&u.push(new Q(m,c[Pe],'"'+Pe+'" is prohibited for ref layers'))}),x.layers.forEach(function(Pe){Ee(Pe.id)===D&&(A=Pe)}),A?A.ref?u.push(new Q(m,c.ref,"ref cannot reference another ref layer")):I=Ee(A.type):u.push(new Q(m,c.ref,'ref layer "'+D+'" not found'));else if(I!=="background")if(c.source){var ne=x.sources&&x.sources[c.source],R=ne&&Ee(ne.type);ne?R==="vector"&&I==="raster"?u.push(new Q(m,c.source,'layer "'+c.id+'" requires a raster source')):R==="raster"&&I!=="raster"?u.push(new Q(m,c.source,'layer "'+c.id+'" requires a vector source')):R!=="vector"||c["source-layer"]?R==="raster-dem"&&I!=="hillshade"?u.push(new Q(m,c.source,"raster-dem source can only be used with layer type 'hillshade'.")):I!=="line"||!c.paint||!c.paint["line-gradient"]||R==="geojson"&&ne.lineMetrics||u.push(new Q(m,c,'layer "'+c.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):u.push(new Q(m,c,'layer "'+c.id+'" must specify a "source-layer"')):u.push(new Q(m,c.source,'source "'+c.source+'" not found'))}else u.push(new Q(m,c,'missing required property "source"'));return u=u.concat(Js({key:m,value:c,valueSpec:E.layer,style:a.style,styleSpec:a.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Li({key:m+".type",value:c.type,valueSpec:E.layer.type,style:a.style,styleSpec:a.styleSpec,object:c,objectKey:"type"})},filter:ap,layout:function(Pe){return Js({layer:c,key:Pe.key,value:Pe.value,style:Pe.style,styleSpec:Pe.styleSpec,objectElementValidators:{"*":function(Be){return Oc(at({layerType:I},Be))}}})},paint:function(Pe){return Js({layer:c,key:Pe.key,value:Pe.value,style:Pe.style,styleSpec:Pe.styleSpec,objectElementValidators:{"*":function(Be){return Eh(at({layerType:I},Be))}}})}}}))}function il(a){var u=a.value,c=a.key,m=ca(u);return m!=="string"?[new Q(c,u,"string expected, "+m+" found")]:[]}var pa={promoteId:function(a){var u=a.key,c=a.value;if(ca(c)==="string")return il({key:u,value:c});var m=[];for(var x in c)m.push.apply(m,il({key:u+"."+x,value:c[x]}));return m}};function kf(a){var u=a.value,c=a.key,m=a.styleSpec,x=a.style;if(!u.type)return[new Q(c,u,'"type" is required')];var E,A=Ee(u.type);switch(A){case"vector":case"raster":case"raster-dem":return Js({key:c,value:u,valueSpec:m["source_"+A.replace("-","_")],style:a.style,styleSpec:m,objectElementValidators:pa});case"geojson":if(E=Js({key:c,value:u,valueSpec:m.source_geojson,style:x,styleSpec:m,objectElementValidators:pa}),u.cluster)for(var I in u.clusterProperties){var D=u.clusterProperties[I],N=D[0],H=typeof N=="string"?[N,["accumulated"],["get",I]]:N;E.push.apply(E,Cl({key:c+"."+I+".map",value:D[1],expressionContext:"cluster-map"})),E.push.apply(E,Cl({key:c+"."+I+".reduce",value:H,expressionContext:"cluster-reduce"}))}return E;case"video":return Js({key:c,value:u,valueSpec:m.source_video,style:x,styleSpec:m});case"image":return Js({key:c,value:u,valueSpec:m.source_image,style:x,styleSpec:m});case"canvas":return[new Q(c,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return pu({key:c+".type",value:u.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:x,styleSpec:m})}}function du(a){var u=a.value,c=a.styleSpec,m=c.light,x=a.style,E=[],A=ca(u);if(u===void 0)return E;if(A!=="object")return E.concat([new Q("light",u,"object expected, "+A+" found")]);for(var I in u){var D=I.match(/^(.*)-transition$/);E=E.concat(D&&m[D[1]]&&m[D[1]].transition?Li({key:I,value:u[I],valueSpec:c.transition,style:x,styleSpec:c}):m[I]?Li({key:I,value:u[I],valueSpec:m[I],style:x,styleSpec:c}):[new Q(I,u[I],'unknown property "'+I+'"')])}return E}var Rl={"*":function(){return[]},array:nf,boolean:function(a){var u=a.value,c=a.key,m=ca(u);return m!=="boolean"?[new Q(c,u,"boolean expected, "+m+" found")]:[]},number:Ic,color:function(a){var u=a.key,c=a.value,m=ca(c);return m!=="string"?[new Q(u,c,"color expected, "+m+" found")]:mi(c)===null?[new Q(u,c,'color expected, "'+c+'" found')]:[]},constants:Le,enum:pu,filter:ap,function:yh,layer:of,object:Js,source:kf,light:du,string:il,formatted:function(a){return il(a).length===0?[]:Cl(a)},resolvedImage:function(a){return il(a).length===0?[]:Cl(a)}};function Li(a){var u=a.value,c=a.valueSpec,m=a.styleSpec;return c.expression&&tf(Ee(u))?yh(a):c.expression&&Mc(ir(u))?Cl(a):c.type&&Rl[c.type]?Rl[c.type](a):Js(at({},a,{valueSpec:c.type?m[c.type]:c}))}function Ca(a){var u=a.value,c=a.key,m=il(a);return m.length||(u.indexOf("{fontstack}")===-1&&m.push(new Q(c,u,'"glyphs" url must include a "{fontstack}" token')),u.indexOf("{range}")===-1&&m.push(new Q(c,u,'"glyphs" url must include a "{range}" token'))),m}function Ys(a,u){u===void 0&&(u=j);var c=[];return c=c.concat(Li({key:"",value:a,valueSpec:u.$root,styleSpec:u,style:a,objectElementValidators:{glyphs:Ca,"*":function(){return[]}}})),a.constants&&(c=c.concat(Le({key:"constants",value:a.constants,style:a,styleSpec:u}))),Bf(c)}function Bf(a){return[].concat(a).sort(function(u,c){return u.line-c.line})}function Fs(a){return function(){for(var u=[],c=arguments.length;c--;)u[c]=arguments[c];return Bf(a.apply(this,u))}}Ys.source=Fs(kf),Ys.light=Fs(du),Ys.layer=Fs(of),Ys.filter=Fs(ap),Ys.paintProperty=Fs(Eh),Ys.layoutProperty=Fs(Oc);var sf=Ys,op=sf.light,Sh=sf.paintProperty,Lf=sf.layoutProperty;function Ml(a,u){var c=!1;if(u&&u.length)for(var m=0,x=u;m<x.length;m+=1)a.fire(new it(new Error(x[m].message))),c=!0;return c}var ko=Wa;function Wa(a,u,c){var m=this.cells=[];if(a instanceof ArrayBuffer){this.arrayBuffer=a;var x=new Int32Array(this.arrayBuffer);a=x[0],this.d=(u=x[1])+2*(c=x[2]);for(var E=0;E<this.d*this.d;E++){var A=x[3+E],I=x[3+E+1];m.push(A===I?null:x.subarray(A,I))}var D=x[3+m.length+1];this.keys=x.subarray(x[3+m.length],D),this.bboxes=x.subarray(D),this.insert=this._insertReadonly}else{this.d=u+2*c;for(var N=0;N<this.d*this.d;N++)m.push([]);this.keys=[],this.bboxes=[]}this.n=u,this.extent=a,this.padding=c,this.scale=u/a,this.uid=0;var H=c/u*a;this.min=-H,this.max=a+H}Wa.prototype.insert=function(a,u,c,m,x){this._forEachCell(u,c,m,x,this._insertCell,this.uid++),this.keys.push(a),this.bboxes.push(u),this.bboxes.push(c),this.bboxes.push(m),this.bboxes.push(x)},Wa.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Wa.prototype._insertCell=function(a,u,c,m,x,E){this.cells[x].push(E)},Wa.prototype.query=function(a,u,c,m,x){var E=this.min,A=this.max;if(a<=E&&u<=E&&A<=c&&A<=m&&!x)return Array.prototype.slice.call(this.keys);var I=[];return this._forEachCell(a,u,c,m,this._queryCell,I,{},x),I},Wa.prototype._queryCell=function(a,u,c,m,x,E,A,I){var D=this.cells[x];if(D!==null)for(var N=this.keys,H=this.bboxes,X=0;X<D.length;X++){var ne=D[X];if(A[ne]===void 0){var R=4*ne;(I?I(H[R+0],H[R+1],H[R+2],H[R+3]):a<=H[R+2]&&u<=H[R+3]&&c>=H[R+0]&&m>=H[R+1])?(A[ne]=!0,E.push(N[ne])):A[ne]=!1}}},Wa.prototype._forEachCell=function(a,u,c,m,x,E,A,I){for(var D=this._convertToCellCoord(a),N=this._convertToCellCoord(u),H=this._convertToCellCoord(c),X=this._convertToCellCoord(m),ne=D;ne<=H;ne++)for(var R=N;R<=X;R++){var Pe=this.d*R+ne;if((!I||I(this._convertFromCellCoord(ne),this._convertFromCellCoord(R),this._convertFromCellCoord(ne+1),this._convertFromCellCoord(R+1)))&&x.call(this,a,u,c,m,Pe,E,A,I))return}},Wa.prototype._convertFromCellCoord=function(a){return(a-this.padding)/this.scale},Wa.prototype._convertToCellCoord=function(a){return Math.max(0,Math.min(this.d-1,Math.floor(a*this.scale)+this.padding))},Wa.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var a=this.cells,u=3+this.cells.length+1+1,c=0,m=0;m<this.cells.length;m++)c+=this.cells[m].length;var x=new Int32Array(u+c+this.keys.length+this.bboxes.length);x[0]=this.extent,x[1]=this.n,x[2]=this.padding;for(var E=u,A=0;A<a.length;A++){var I=a[A];x[3+A]=E,x.set(I,E),E+=I.length}return x[3+a.length]=E,x.set(this.keys,E),x[3+a.length+1]=E+=this.keys.length,x.set(this.bboxes,E),E+=this.bboxes.length,x.buffer};var al=ae.ImageData,Ah=ae.ImageBitmap,Ka={};function _n(a,u,c){c===void 0&&(c={}),Object.defineProperty(u,"_classRegistryKey",{value:a,writeable:!1}),Ka[a]={klass:u,omit:c.omit||[],shallow:c.shallow||[]}}for(var ks in _n("Object",Object),ko.serialize=function(a,u){var c=a.toArrayBuffer();return u&&u.push(c),{buffer:c}},ko.deserialize=function(a){return new ko(a.buffer)},_n("Grid",ko),_n("Color",wi),_n("Error",Error),_n("ResolvedImage",Aa),_n("StylePropertyFunction",nl),_n("StyleExpression",hu,{omit:["_evaluator"]}),_n("ZoomDependentExpression",tc),_n("ZoomConstantExpression",ec),_n("CompoundExpression",ea,{omit:["_evaluate"]}),ku)ku[ks]._classRegistryKey||_n("Expression_"+ks,ku[ks]);function uf(a){return a&&typeof ArrayBuffer!="undefined"&&(a instanceof ArrayBuffer||a.constructor&&a.constructor.name==="ArrayBuffer")}function rc(a){return Ah&&a instanceof Ah}function us(a,u){if(a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="string"||a instanceof Boolean||a instanceof Number||a instanceof String||a instanceof Date||a instanceof RegExp)return a;if(uf(a)||rc(a))return u&&u.push(a),a;if(ArrayBuffer.isView(a)){var c=a;return u&&u.push(c.buffer),c}if(a instanceof al)return u&&u.push(a.data.buffer),a;if(Array.isArray(a)){for(var m=[],x=0,E=a;x<E.length;x+=1)m.push(us(E[x],u));return m}if(typeof a=="object"){var A=a.constructor,I=A._classRegistryKey;if(!I)throw new Error("can't serialize object of unregistered class");var D=A.serialize?A.serialize(a,u):{};if(!A.serialize){for(var N in a)if(a.hasOwnProperty(N)&&!(Ka[I].omit.indexOf(N)>=0)){var H=a[N];D[N]=Ka[I].shallow.indexOf(N)>=0?H:us(H,u)}a instanceof Error&&(D.message=a.message)}if(D.$name)throw new Error("$name property is reserved for worker serialization logic.");return I!=="Object"&&(D.$name=I),D}throw new Error("can't serialize object of type "+typeof a)}function ga(a){if(a==null||typeof a=="boolean"||typeof a=="number"||typeof a=="string"||a instanceof Boolean||a instanceof Number||a instanceof String||a instanceof Date||a instanceof RegExp||uf(a)||rc(a)||ArrayBuffer.isView(a)||a instanceof al)return a;if(Array.isArray(a))return a.map(ga);if(typeof a=="object"){var u=a.$name||"Object",c=Ka[u].klass;if(!c)throw new Error("can't deserialize unregistered class "+u);if(c.deserialize)return c.deserialize(a);for(var m=Object.create(c.prototype),x=0,E=Object.keys(a);x<E.length;x+=1){var A=E[x];if(A!=="$name"){var I=a[A];m[A]=Ka[u].shallow.indexOf(A)>=0?I:ga(I)}}return m}throw new Error("can't deserialize object of type "+typeof a)}var Th=function(){this.first=!0};Th.prototype.update=function(a,u){var c=Math.floor(a);return this.first?(this.first=!1,this.lastIntegerZoom=c,this.lastIntegerZoomTime=0,this.lastZoom=a,this.lastFloorZoom=c,!0):(this.lastFloorZoom>c?(this.lastIntegerZoom=c+1,this.lastIntegerZoomTime=u):this.lastFloorZoom<c&&(this.lastIntegerZoom=c,this.lastIntegerZoomTime=u),a!==this.lastZoom&&(this.lastZoom=a,this.lastFloorZoom=c,!0))};var qr={"Latin-1 Supplement":function(a){return a>=128&&a<=255},Arabic:function(a){return a>=1536&&a<=1791},"Arabic Supplement":function(a){return a>=1872&&a<=1919},"Arabic Extended-A":function(a){return a>=2208&&a<=2303},"Hangul Jamo":function(a){return a>=4352&&a<=4607},"Unified Canadian Aboriginal Syllabics":function(a){return a>=5120&&a<=5759},Khmer:function(a){return a>=6016&&a<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(a){return a>=6320&&a<=6399},"General Punctuation":function(a){return a>=8192&&a<=8303},"Letterlike Symbols":function(a){return a>=8448&&a<=8527},"Number Forms":function(a){return a>=8528&&a<=8591},"Miscellaneous Technical":function(a){return a>=8960&&a<=9215},"Control Pictures":function(a){return a>=9216&&a<=9279},"Optical Character Recognition":function(a){return a>=9280&&a<=9311},"Enclosed Alphanumerics":function(a){return a>=9312&&a<=9471},"Geometric Shapes":function(a){return a>=9632&&a<=9727},"Miscellaneous Symbols":function(a){return a>=9728&&a<=9983},"Miscellaneous Symbols and Arrows":function(a){return a>=11008&&a<=11263},"CJK Radicals Supplement":function(a){return a>=11904&&a<=12031},"Kangxi Radicals":function(a){return a>=12032&&a<=12255},"Ideographic Description Characters":function(a){return a>=12272&&a<=12287},"CJK Symbols and Punctuation":function(a){return a>=12288&&a<=12351},Hiragana:function(a){return a>=12352&&a<=12447},Katakana:function(a){return a>=12448&&a<=12543},Bopomofo:function(a){return a>=12544&&a<=12591},"Hangul Compatibility Jamo":function(a){return a>=12592&&a<=12687},Kanbun:function(a){return a>=12688&&a<=12703},"Bopomofo Extended":function(a){return a>=12704&&a<=12735},"CJK Strokes":function(a){return a>=12736&&a<=12783},"Katakana Phonetic Extensions":function(a){return a>=12784&&a<=12799},"Enclosed CJK Letters and Months":function(a){return a>=12800&&a<=13055},"CJK Compatibility":function(a){return a>=13056&&a<=13311},"CJK Unified Ideographs Extension A":function(a){return a>=13312&&a<=19903},"Yijing Hexagram Symbols":function(a){return a>=19904&&a<=19967},"CJK Unified Ideographs":function(a){return a>=19968&&a<=40959},"Yi Syllables":function(a){return a>=40960&&a<=42127},"Yi Radicals":function(a){return a>=42128&&a<=42191},"Hangul Jamo Extended-A":function(a){return a>=43360&&a<=43391},"Hangul Syllables":function(a){return a>=44032&&a<=55215},"Hangul Jamo Extended-B":function(a){return a>=55216&&a<=55295},"Private Use Area":function(a){return a>=57344&&a<=63743},"CJK Compatibility Ideographs":function(a){return a>=63744&&a<=64255},"Arabic Presentation Forms-A":function(a){return a>=64336&&a<=65023},"Vertical Forms":function(a){return a>=65040&&a<=65055},"CJK Compatibility Forms":function(a){return a>=65072&&a<=65103},"Small Form Variants":function(a){return a>=65104&&a<=65135},"Arabic Presentation Forms-B":function(a){return a>=65136&&a<=65279},"Halfwidth and Fullwidth Forms":function(a){return a>=65280&&a<=65519}};function ol(a){for(var u=0,c=a;u<c.length;u+=1)if(Dc(c[u].charCodeAt(0)))return!0;return!1}function Dc(a){return!(a!==746&&a!==747&&(a<4352||!(qr["Bopomofo Extended"](a)||qr.Bopomofo(a)||qr["CJK Compatibility Forms"](a)&&!(a>=65097&&a<=65103)||qr["CJK Compatibility Ideographs"](a)||qr["CJK Compatibility"](a)||qr["CJK Radicals Supplement"](a)||qr["CJK Strokes"](a)||!(!qr["CJK Symbols and Punctuation"](a)||a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||qr["CJK Unified Ideographs Extension A"](a)||qr["CJK Unified Ideographs"](a)||qr["Enclosed CJK Letters and Months"](a)||qr["Hangul Compatibility Jamo"](a)||qr["Hangul Jamo Extended-A"](a)||qr["Hangul Jamo Extended-B"](a)||qr["Hangul Jamo"](a)||qr["Hangul Syllables"](a)||qr.Hiragana(a)||qr["Ideographic Description Characters"](a)||qr.Kanbun(a)||qr["Kangxi Radicals"](a)||qr["Katakana Phonetic Extensions"](a)||qr.Katakana(a)&&a!==12540||!(!qr["Halfwidth and Fullwidth Forms"](a)||a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||!(!qr["Small Form Variants"](a)||a>=65112&&a<=65118||a>=65123&&a<=65126)||qr["Unified Canadian Aboriginal Syllabics"](a)||qr["Unified Canadian Aboriginal Syllabics Extended"](a)||qr["Vertical Forms"](a)||qr["Yijing Hexagram Symbols"](a)||qr["Yi Syllables"](a)||qr["Yi Radicals"](a))))}function wh(a){return!(Dc(a)||function(u){return!!(qr["Latin-1 Supplement"](u)&&(u===167||u===169||u===174||u===177||u===188||u===189||u===190||u===215||u===247)||qr["General Punctuation"](u)&&(u===8214||u===8224||u===8225||u===8240||u===8241||u===8251||u===8252||u===8258||u===8263||u===8264||u===8265||u===8273)||qr["Letterlike Symbols"](u)||qr["Number Forms"](u)||qr["Miscellaneous Technical"](u)&&(u>=8960&&u<=8967||u>=8972&&u<=8991||u>=8996&&u<=9e3||u===9003||u>=9085&&u<=9114||u>=9150&&u<=9165||u===9167||u>=9169&&u<=9179||u>=9186&&u<=9215)||qr["Control Pictures"](u)&&u!==9251||qr["Optical Character Recognition"](u)||qr["Enclosed Alphanumerics"](u)||qr["Geometric Shapes"](u)||qr["Miscellaneous Symbols"](u)&&!(u>=9754&&u<=9759)||qr["Miscellaneous Symbols and Arrows"](u)&&(u>=11026&&u<=11055||u>=11088&&u<=11097||u>=11192&&u<=11243)||qr["CJK Symbols and Punctuation"](u)||qr.Katakana(u)||qr["Private Use Area"](u)||qr["CJK Compatibility Forms"](u)||qr["Small Form Variants"](u)||qr["Halfwidth and Fullwidth Forms"](u)||u===8734||u===8756||u===8757||u>=9984&&u<=10087||u>=10102&&u<=10131||u===65532||u===65533)}(a))}function eu(a){return a>=1424&&a<=2303||qr["Arabic Presentation Forms-A"](a)||qr["Arabic Presentation Forms-B"](a)}function Bs(a,u){return!(!u&&eu(a)||a>=2304&&a<=3583||a>=3840&&a<=4255||qr.Khmer(a))}function Nf(a){for(var u=0,c=a;u<c.length;u+=1)if(eu(c[u].charCodeAt(0)))return!0;return!1}var Uf=null,Yo="unavailable",Lu=null,sp=function(a){a&&typeof a=="string"&&a.indexOf("NetworkError")>-1&&(Yo="error"),Uf&&Uf(a)};function Il(){lf.fire(new Oe("pluginStateChange",{pluginStatus:Yo,pluginURL:Lu}))}var lf=new pt,up=function(){return Yo},Pt=function(){if(Yo!=="deferred"||!Lu)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Yo="loading",Il(),Lu&&Is({url:Lu},function(a){a?sp(a):(Yo="loaded",Il())})},Fe={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Yo==="loaded"||Fe.applyArabicShaping!=null},isLoading:function(){return Yo==="loading"},setState:function(a){Yo=a.pluginStatus,Lu=a.pluginURL},isParsed:function(){return Fe.applyArabicShaping!=null&&Fe.processBidirectionalText!=null&&Fe.processStyledBidirectionalText!=null},getPluginURL:function(){return Lu}},B=function(a,u){this.zoom=a,u?(this.now=u.now,this.fadeDuration=u.fadeDuration,this.zoomHistory=u.zoomHistory,this.transition=u.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Th,this.transition={})};B.prototype.isSupportedScript=function(a){return function(u,c){for(var m=0,x=u;m<x.length;m+=1)if(!Bs(x[m].charCodeAt(0),c))return!1;return!0}(a,Fe.isLoaded())},B.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},B.prototype.getCrossfadeParameters=function(){var a=this.zoom,u=a-Math.floor(a),c=this.crossFadingFactor();return a>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:u+(1-u)*c}:{fromScale:.5,toScale:1,t:1-(1-c)*u}};var qs=function(a,u){this.property=a,this.value=u,this.expression=function(c,m){if(tf(c))return new nl(c,m);if(Mc(c)){var x=ip(c,m);if(x.result==="error")throw new Error(x.value.map(function(A){return A.key+": "+A.message}).join(", "));return x.value}var E=c;return typeof c=="string"&&m.type==="color"&&(E=wi.parse(c)),{kind:"constant",evaluate:function(){return E}}}(u===void 0?a.specification.default:u,a.specification)};qs.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},qs.prototype.possiblyEvaluate=function(a,u,c){return this.property.possiblyEvaluate(this,a,u,c)};var ge=function(a){this.property=a,this.value=new qs(a,void 0)};ge.prototype.transitioned=function(a,u){return new io(this.property,this.value,u,Zt({},a.transition,this.transition),a.now)},ge.prototype.untransitioned=function(){return new io(this.property,this.value,null,{},0)};var Bo=function(a){this._properties=a,this._values=Object.create(a.defaultTransitionablePropertyValues)};Bo.prototype.getValue=function(a){return ut(this._values[a].value.value)},Bo.prototype.setValue=function(a,u){this._values.hasOwnProperty(a)||(this._values[a]=new ge(this._values[a].property)),this._values[a].value=new qs(this._values[a].property,u===null?void 0:ut(u))},Bo.prototype.getTransition=function(a){return ut(this._values[a].transition)},Bo.prototype.setTransition=function(a,u){this._values.hasOwnProperty(a)||(this._values[a]=new ge(this._values[a].property)),this._values[a].transition=ut(u)||void 0},Bo.prototype.serialize=function(){for(var a={},u=0,c=Object.keys(this._values);u<c.length;u+=1){var m=c[u],x=this.getValue(m);x!==void 0&&(a[m]=x);var E=this.getTransition(m);E!==void 0&&(a[m+"-transition"]=E)}return a},Bo.prototype.transitioned=function(a,u){for(var c=new vu(this._properties),m=0,x=Object.keys(this._values);m<x.length;m+=1){var E=x[m];c._values[E]=this._values[E].transitioned(a,u._values[E])}return c},Bo.prototype.untransitioned=function(){for(var a=new vu(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var m=c[u];a._values[m]=this._values[m].untransitioned()}return a};var io=function(a,u,c,m,x){this.property=a,this.value=u,this.begin=x+m.delay||0,this.end=this.begin+m.duration||0,a.specification.transition&&(m.delay||m.duration)&&(this.prior=c)};io.prototype.possiblyEvaluate=function(a,u,c){var m=a.now||0,x=this.value.possiblyEvaluate(a,u,c),E=this.prior;if(E){if(m>this.end)return this.prior=null,x;if(this.value.isDataDriven())return this.prior=null,x;if(m<this.begin)return E.possiblyEvaluate(a,u,c);var A=(m-this.begin)/(this.end-this.begin);return this.property.interpolate(E.possiblyEvaluate(a,u,c),x,function(I){if(I<=0)return 0;if(I>=1)return 1;var D=I*I,N=D*I;return 4*(I<.5?N:3*(I-D)+N-.75)}(A))}return x};var vu=function(a){this._properties=a,this._values=Object.create(a.defaultTransitioningPropertyValues)};vu.prototype.possiblyEvaluate=function(a,u,c){for(var m=new nc(this._properties),x=0,E=Object.keys(this._values);x<E.length;x+=1){var A=E[x];m._values[A]=this._values[A].possiblyEvaluate(a,u,c)}return m},vu.prototype.hasTransition=function(){for(var a=0,u=Object.keys(this._values);a<u.length;a+=1)if(this._values[u[a]].prior)return!0;return!1};var bs=function(a){this._properties=a,this._values=Object.create(a.defaultPropertyValues)};bs.prototype.getValue=function(a){return ut(this._values[a].value)},bs.prototype.setValue=function(a,u){this._values[a]=new qs(this._values[a].property,u===null?void 0:ut(u))},bs.prototype.serialize=function(){for(var a={},u=0,c=Object.keys(this._values);u<c.length;u+=1){var m=c[u],x=this.getValue(m);x!==void 0&&(a[m]=x)}return a},bs.prototype.possiblyEvaluate=function(a,u,c){for(var m=new nc(this._properties),x=0,E=Object.keys(this._values);x<E.length;x+=1){var A=E[x];m._values[A]=this._values[A].possiblyEvaluate(a,u,c)}return m};var Da=function(a,u,c){this.property=a,this.value=u,this.parameters=c};Da.prototype.isConstant=function(){return this.value.kind==="constant"},Da.prototype.constantOr=function(a){return this.value.kind==="constant"?this.value.value:a},Da.prototype.evaluate=function(a,u,c,m){return this.property.evaluate(this.value,this.parameters,a,u,c,m)};var nc=function(a){this._properties=a,this._values=Object.create(a.defaultPossiblyEvaluatedValues)};nc.prototype.get=function(a){return this._values[a]};var kn=function(a){this.specification=a};kn.prototype.possiblyEvaluate=function(a,u){return a.expression.evaluate(u)},kn.prototype.interpolate=function(a,u,c){var m=El[this.specification.type];return m?m(a,u,c):a};var yn=function(a,u){this.specification=a,this.overrides=u};yn.prototype.possiblyEvaluate=function(a,u,c,m){return new Da(this,a.expression.kind==="constant"||a.expression.kind==="camera"?{kind:"constant",value:a.expression.evaluate(u,null,{},c,m)}:a.expression,u)},yn.prototype.interpolate=function(a,u,c){if(a.value.kind!=="constant"||u.value.kind!=="constant")return a;if(a.value.value===void 0||u.value.value===void 0)return new Da(this,{kind:"constant",value:void 0},a.parameters);var m=El[this.specification.type];return m?new Da(this,{kind:"constant",value:m(a.value.value,u.value.value,c)},a.parameters):a},yn.prototype.evaluate=function(a,u,c,m,x,E){return a.kind==="constant"?a.value:a.evaluate(u,c,m,x,E)};var Ls=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.possiblyEvaluate=function(c,m,x,E){if(c.value===void 0)return new Da(this,{kind:"constant",value:void 0},m);if(c.expression.kind==="constant"){var A=c.expression.evaluate(m,null,{},x,E),I=c.property.specification.type==="resolvedImage"&&typeof A!="string"?A.name:A,D=this._calculate(I,I,I,m);return new Da(this,{kind:"constant",value:D},m)}if(c.expression.kind==="camera"){var N=this._calculate(c.expression.evaluate({zoom:m.zoom-1}),c.expression.evaluate({zoom:m.zoom}),c.expression.evaluate({zoom:m.zoom+1}),m);return new Da(this,{kind:"constant",value:N},m)}return new Da(this,c.expression,m)},u.prototype.evaluate=function(c,m,x,E,A,I){if(c.kind==="source"){var D=c.evaluate(m,x,E,A,I);return this._calculate(D,D,D,m)}return c.kind==="composite"?this._calculate(c.evaluate({zoom:Math.floor(m.zoom)-1},x,E),c.evaluate({zoom:Math.floor(m.zoom)},x,E),c.evaluate({zoom:Math.floor(m.zoom)+1},x,E),m):c.value},u.prototype._calculate=function(c,m,x,E){return E.zoom>E.zoomHistory.lastIntegerZoom?{from:c,to:m}:{from:x,to:m}},u.prototype.interpolate=function(c){return c},u}(yn),qo=function(a){this.specification=a};qo.prototype.possiblyEvaluate=function(a,u,c,m){if(a.value!==void 0){if(a.expression.kind==="constant"){var x=a.expression.evaluate(u,null,{},c,m);return this._calculate(x,x,x,u)}return this._calculate(a.expression.evaluate(new B(Math.floor(u.zoom-1),u)),a.expression.evaluate(new B(Math.floor(u.zoom),u)),a.expression.evaluate(new B(Math.floor(u.zoom+1),u)),u)}},qo.prototype._calculate=function(a,u,c,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:a,to:u}:{from:c,to:u}},qo.prototype.interpolate=function(a){return a};var mu=function(a){this.specification=a};mu.prototype.possiblyEvaluate=function(a,u,c,m){return!!a.expression.evaluate(u,null,{},c,m)},mu.prototype.interpolate=function(){return!1};var Fa=function(a){for(var u in this.properties=a,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],a){var c=a[u];c.specification.overridable&&this.overridableProperties.push(u);var m=this.defaultPropertyValues[u]=new qs(c,void 0),x=this.defaultTransitionablePropertyValues[u]=new ge(c);this.defaultTransitioningPropertyValues[u]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=m.possiblyEvaluate({})}};_n("DataDrivenProperty",yn),_n("DataConstantProperty",kn),_n("CrossFadedDataDrivenProperty",Ls),_n("CrossFadedProperty",qo),_n("ColorRampProperty",mu);var Ns=function(a){function u(c,m){if(a.call(this),this.id=c.id,this.type=c.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},c.type!=="custom"&&(this.metadata=(c=c).metadata,this.minzoom=c.minzoom,this.maxzoom=c.maxzoom,c.type!=="background"&&(this.source=c.source,this.sourceLayer=c["source-layer"],this.filter=c.filter),m.layout&&(this._unevaluatedLayout=new bs(m.layout)),m.paint)){for(var x in this._transitionablePaint=new Bo(m.paint),c.paint)this.setPaintProperty(x,c.paint[x],{validate:!1});for(var E in c.layout)this.setLayoutProperty(E,c.layout[E],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new nc(m.paint)}}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},u.prototype.getLayoutProperty=function(c){return c==="visibility"?this.visibility:this._unevaluatedLayout.getValue(c)},u.prototype.setLayoutProperty=function(c,m,x){x===void 0&&(x={}),m!=null&&this._validate(Lf,"layers."+this.id+".layout."+c,c,m,x)||(c!=="visibility"?this._unevaluatedLayout.setValue(c,m):this.visibility=m)},u.prototype.getPaintProperty=function(c){return hr(c,"-transition")?this._transitionablePaint.getTransition(c.slice(0,-11)):this._transitionablePaint.getValue(c)},u.prototype.setPaintProperty=function(c,m,x){if(x===void 0&&(x={}),m!=null&&this._validate(Sh,"layers."+this.id+".paint."+c,c,m,x))return!1;if(hr(c,"-transition"))return this._transitionablePaint.setTransition(c.slice(0,-11),m||void 0),!1;var E=this._transitionablePaint._values[c],A=E.property.specification["property-type"]==="cross-faded-data-driven",I=E.value.isDataDriven(),D=E.value;this._transitionablePaint.setValue(c,m),this._handleSpecialPaintPropertyUpdate(c);var N=this._transitionablePaint._values[c].value;return N.isDataDriven()||I||A||this._handleOverridablePaintPropertyUpdate(c,D,N)},u.prototype._handleSpecialPaintPropertyUpdate=function(c){},u.prototype._handleOverridablePaintPropertyUpdate=function(c,m,x){return!1},u.prototype.isHidden=function(c){return!!(this.minzoom&&c<this.minzoom)||!!(this.maxzoom&&c>=this.maxzoom)||this.visibility==="none"},u.prototype.updateTransitions=function(c){this._transitioningPaint=this._transitionablePaint.transitioned(c,this._transitioningPaint)},u.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},u.prototype.recalculate=function(c,m){c.getCrossfadeParameters&&(this._crossfadeParameters=c.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(c,void 0,m)),this.paint=this._transitioningPaint.possiblyEvaluate(c,void 0,m)},u.prototype.serialize=function(){var c={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(c.layout=c.layout||{},c.layout.visibility=this.visibility),At(c,function(m,x){return!(m===void 0||x==="layout"&&!Object.keys(m).length||x==="paint"&&!Object.keys(m).length)})},u.prototype._validate=function(c,m,x,E,A){return A===void 0&&(A={}),(!A||A.validate!==!1)&&Ml(this,c.call(sf,{key:m,layerType:this.type,objectKey:x,value:E,styleSpec:j,style:{glyphs:!0,sprite:!0}}))},u.prototype.is3D=function(){return!1},u.prototype.isTileClipped=function(){return!1},u.prototype.hasOffscreenPass=function(){return!1},u.prototype.resize=function(){},u.prototype.isStateDependent=function(){for(var c in this.paint._values){var m=this.paint.get(c);if(m instanceof Da&&rl(m.property.specification)&&(m.value.kind==="source"||m.value.kind==="composite")&&m.value.isStateDependent)return!0}return!1},u}(pt),Ks={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Fc=function(a,u){this._structArray=a,this._pos1=u*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},ra=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function wo(a,u){u===void 0&&(u=1);var c=0,m=0;return{members:a.map(function(x){var E=Ks[x.type].BYTES_PER_ELEMENT,A=c=Ch(c,Math.max(u,E)),I=x.components||1;return m=Math.max(m,E),c+=E*I,{name:x.name,type:x.type,components:I,offset:A}}),size:Ch(c,Math.max(m,u)),alignment:u}}function Ch(a,u){return Math.ceil(a/u)*u}ra.serialize=function(a,u){return a._trim(),u&&(a.isTransferred=!0,u.push(a.arrayBuffer)),{length:a.length,arrayBuffer:a.arrayBuffer}},ra.deserialize=function(a){var u=Object.create(this.prototype);return u.arrayBuffer=a.arrayBuffer,u.length=a.length,u.capacity=a.arrayBuffer.byteLength/u.bytesPerElement,u._refreshViews(),u},ra.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ra.prototype.clear=function(){this.length=0},ra.prototype.resize=function(a){this.reserve(a),this.length=a},ra.prototype.reserve=function(a){if(a>this.capacity){this.capacity=Math.max(a,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var u=this.uint8;this._refreshViews(),u&&this.uint8.set(u)}},ra.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Pl=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m){var x=this.length;return this.resize(x+1),this.emplace(x,c,m)},u.prototype.emplace=function(c,m,x){var E=2*c;return this.int16[E+0]=m,this.int16[E+1]=x,c},u}(ra);Pl.prototype.bytesPerElement=4,_n("StructArrayLayout2i4",Pl);var zf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E){var A=this.length;return this.resize(A+1),this.emplace(A,c,m,x,E)},u.prototype.emplace=function(c,m,x,E,A){var I=4*c;return this.int16[I+0]=m,this.int16[I+1]=x,this.int16[I+2]=E,this.int16[I+3]=A,c},u}(ra);zf.prototype.bytesPerElement=8,_n("StructArrayLayout4i8",zf);var gu=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I){var D=this.length;return this.resize(D+1),this.emplace(D,c,m,x,E,A,I)},u.prototype.emplace=function(c,m,x,E,A,I,D){var N=6*c;return this.int16[N+0]=m,this.int16[N+1]=x,this.int16[N+2]=E,this.int16[N+3]=A,this.int16[N+4]=I,this.int16[N+5]=D,c},u}(ra);gu.prototype.bytesPerElement=12,_n("StructArrayLayout2i4i12",gu);var Es=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I){var D=this.length;return this.resize(D+1),this.emplace(D,c,m,x,E,A,I)},u.prototype.emplace=function(c,m,x,E,A,I,D){var N=4*c,H=8*c;return this.int16[N+0]=m,this.int16[N+1]=x,this.uint8[H+4]=E,this.uint8[H+5]=A,this.uint8[H+6]=I,this.uint8[H+7]=D,c},u}(ra);Es.prototype.bytesPerElement=8,_n("StructArrayLayout2i4ub8",Es);var ic=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m){var x=this.length;return this.resize(x+1),this.emplace(x,c,m)},u.prototype.emplace=function(c,m,x){var E=2*c;return this.float32[E+0]=m,this.float32[E+1]=x,c},u}(ra);ic.prototype.bytesPerElement=8,_n("StructArrayLayout2f8",ic);var Nu=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I,D,N,H,X){var ne=this.length;return this.resize(ne+1),this.emplace(ne,c,m,x,E,A,I,D,N,H,X)},u.prototype.emplace=function(c,m,x,E,A,I,D,N,H,X,ne){var R=10*c;return this.uint16[R+0]=m,this.uint16[R+1]=x,this.uint16[R+2]=E,this.uint16[R+3]=A,this.uint16[R+4]=I,this.uint16[R+5]=D,this.uint16[R+6]=N,this.uint16[R+7]=H,this.uint16[R+8]=X,this.uint16[R+9]=ne,c},u}(ra);Nu.prototype.bytesPerElement=20,_n("StructArrayLayout10ui20",Nu);var Zf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I,D,N,H,X,ne,R){var Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,c,m,x,E,A,I,D,N,H,X,ne,R)},u.prototype.emplace=function(c,m,x,E,A,I,D,N,H,X,ne,R,Pe){var Be=12*c;return this.int16[Be+0]=m,this.int16[Be+1]=x,this.int16[Be+2]=E,this.int16[Be+3]=A,this.uint16[Be+4]=I,this.uint16[Be+5]=D,this.uint16[Be+6]=N,this.uint16[Be+7]=H,this.int16[Be+8]=X,this.int16[Be+9]=ne,this.int16[Be+10]=R,this.int16[Be+11]=Pe,c},u}(ra);Zf.prototype.bytesPerElement=24,_n("StructArrayLayout4i4ui4i24",Zf);var kc=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x){var E=this.length;return this.resize(E+1),this.emplace(E,c,m,x)},u.prototype.emplace=function(c,m,x,E){var A=3*c;return this.float32[A+0]=m,this.float32[A+1]=x,this.float32[A+2]=E,c},u}(ra);kc.prototype.bytesPerElement=12,_n("StructArrayLayout3f12",kc);var cf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c){var m=this.length;return this.resize(m+1),this.emplace(m,c)},u.prototype.emplace=function(c,m){return this.uint32[1*c+0]=m,c},u}(ra);cf.prototype.bytesPerElement=4,_n("StructArrayLayout1ul4",cf);var Vf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I,D,N,H){var X=this.length;return this.resize(X+1),this.emplace(X,c,m,x,E,A,I,D,N,H)},u.prototype.emplace=function(c,m,x,E,A,I,D,N,H,X){var ne=10*c,R=5*c;return this.int16[ne+0]=m,this.int16[ne+1]=x,this.int16[ne+2]=E,this.int16[ne+3]=A,this.int16[ne+4]=I,this.int16[ne+5]=D,this.uint32[R+3]=N,this.uint16[ne+8]=H,this.uint16[ne+9]=X,c},u}(ra);Vf.prototype.bytesPerElement=20,_n("StructArrayLayout6i1ul2ui20",Vf);var ac=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I){var D=this.length;return this.resize(D+1),this.emplace(D,c,m,x,E,A,I)},u.prototype.emplace=function(c,m,x,E,A,I,D){var N=6*c;return this.int16[N+0]=m,this.int16[N+1]=x,this.int16[N+2]=E,this.int16[N+3]=A,this.int16[N+4]=I,this.int16[N+5]=D,c},u}(ra);ac.prototype.bytesPerElement=12,_n("StructArrayLayout2i2i2i12",ac);var oc=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A){var I=this.length;return this.resize(I+1),this.emplace(I,c,m,x,E,A)},u.prototype.emplace=function(c,m,x,E,A,I){var D=4*c,N=8*c;return this.float32[D+0]=m,this.float32[D+1]=x,this.float32[D+2]=E,this.int16[N+6]=A,this.int16[N+7]=I,c},u}(ra);oc.prototype.bytesPerElement=16,_n("StructArrayLayout2f1f2i16",oc);var Uu=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E){var A=this.length;return this.resize(A+1),this.emplace(A,c,m,x,E)},u.prototype.emplace=function(c,m,x,E,A){var I=12*c,D=3*c;return this.uint8[I+0]=m,this.uint8[I+1]=x,this.float32[D+1]=E,this.float32[D+2]=A,c},u}(ra);Uu.prototype.bytesPerElement=12,_n("StructArrayLayout2ub2f12",Uu);var zu=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x){var E=this.length;return this.resize(E+1),this.emplace(E,c,m,x)},u.prototype.emplace=function(c,m,x,E){var A=3*c;return this.uint16[A+0]=m,this.uint16[A+1]=x,this.uint16[A+2]=E,c},u}(ra);zu.prototype.bytesPerElement=6,_n("StructArrayLayout3ui6",zu);var tu=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St){var Ft=this.length;return this.resize(Ft+1),this.emplace(Ft,c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St)},u.prototype.emplace=function(c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St,Ft){var Yt=24*c,qt=12*c,dr=48*c;return this.int16[Yt+0]=m,this.int16[Yt+1]=x,this.uint16[Yt+2]=E,this.uint16[Yt+3]=A,this.uint32[qt+2]=I,this.uint32[qt+3]=D,this.uint32[qt+4]=N,this.uint16[Yt+10]=H,this.uint16[Yt+11]=X,this.uint16[Yt+12]=ne,this.float32[qt+7]=R,this.float32[qt+8]=Pe,this.uint8[dr+36]=Be,this.uint8[dr+37]=rt,this.uint8[dr+38]=Ge,this.uint32[qt+10]=St,this.int16[Yt+22]=Ft,c},u}(ra);tu.prototype.bytesPerElement=48,_n("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",tu);var jf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St,Ft,Yt,qt,dr,Lr,Xr,Bn,cn,Vn,pn,Ei){var ti=this.length;return this.resize(ti+1),this.emplace(ti,c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St,Ft,Yt,qt,dr,Lr,Xr,Bn,cn,Vn,pn,Ei)},u.prototype.emplace=function(c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be,rt,Ge,St,Ft,Yt,qt,dr,Lr,Xr,Bn,cn,Vn,pn,Ei,ti){var Rn=34*c,Di=17*c;return this.int16[Rn+0]=m,this.int16[Rn+1]=x,this.int16[Rn+2]=E,this.int16[Rn+3]=A,this.int16[Rn+4]=I,this.int16[Rn+5]=D,this.int16[Rn+6]=N,this.int16[Rn+7]=H,this.uint16[Rn+8]=X,this.uint16[Rn+9]=ne,this.uint16[Rn+10]=R,this.uint16[Rn+11]=Pe,this.uint16[Rn+12]=Be,this.uint16[Rn+13]=rt,this.uint16[Rn+14]=Ge,this.uint16[Rn+15]=St,this.uint16[Rn+16]=Ft,this.uint16[Rn+17]=Yt,this.uint16[Rn+18]=qt,this.uint16[Rn+19]=dr,this.uint16[Rn+20]=Lr,this.uint16[Rn+21]=Xr,this.uint16[Rn+22]=Bn,this.uint32[Di+12]=cn,this.float32[Di+13]=Vn,this.float32[Di+14]=pn,this.float32[Di+15]=Ei,this.float32[Di+16]=ti,c},u}(ra);jf.prototype.bytesPerElement=68,_n("StructArrayLayout8i15ui1ul4f68",jf);var Ol=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c){var m=this.length;return this.resize(m+1),this.emplace(m,c)},u.prototype.emplace=function(c,m){return this.float32[1*c+0]=m,c},u}(ra);Ol.prototype.bytesPerElement=4,_n("StructArrayLayout1f4",Ol);var ru=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x){var E=this.length;return this.resize(E+1),this.emplace(E,c,m,x)},u.prototype.emplace=function(c,m,x,E){var A=3*c;return this.int16[A+0]=m,this.int16[A+1]=x,this.int16[A+2]=E,c},u}(ra);ru.prototype.bytesPerElement=6,_n("StructArrayLayout3i6",ru);var Dl=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x){var E=this.length;return this.resize(E+1),this.emplace(E,c,m,x)},u.prototype.emplace=function(c,m,x,E){var A=4*c;return this.uint32[2*c+0]=m,this.uint16[A+2]=x,this.uint16[A+3]=E,c},u}(ra);Dl.prototype.bytesPerElement=8,_n("StructArrayLayout1ul2ui8",Dl);var ff=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m){var x=this.length;return this.resize(x+1),this.emplace(x,c,m)},u.prototype.emplace=function(c,m,x){var E=2*c;return this.uint16[E+0]=m,this.uint16[E+1]=x,c},u}(ra);ff.prototype.bytesPerElement=4,_n("StructArrayLayout2ui4",ff);var Rh=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c){var m=this.length;return this.resize(m+1),this.emplace(m,c)},u.prototype.emplace=function(c,m){return this.uint16[1*c+0]=m,c},u}(ra);Rh.prototype.bytesPerElement=2,_n("StructArrayLayout1ui2",Rh);var Hf=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},u.prototype.emplaceBack=function(c,m,x,E){var A=this.length;return this.resize(A+1),this.emplace(A,c,m,x,E)},u.prototype.emplace=function(c,m,x,E,A){var I=4*c;return this.float32[I+0]=m,this.float32[I+1]=x,this.float32[I+2]=E,this.float32[I+3]=A,c},u}(ra);Hf.prototype.bytesPerElement=16,_n("StructArrayLayout4f16",Hf);var h=function(a){function u(){a.apply(this,arguments)}a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var c={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return c.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},c.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},c.x1.get=function(){return this._structArray.int16[this._pos2+2]},c.y1.get=function(){return this._structArray.int16[this._pos2+3]},c.x2.get=function(){return this._structArray.int16[this._pos2+4]},c.y2.get=function(){return this._structArray.int16[this._pos2+5]},c.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},c.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},c.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},c.anchorPoint.get=function(){return new se(this.anchorPointX,this.anchorPointY)},Object.defineProperties(u.prototype,c),u}(Fc);h.prototype.size=20;var d=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.get=function(c){return new h(this,c)},u}(Vf);_n("CollisionBoxArray",d);var p=function(a){function u(){a.apply(this,arguments)}a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var c={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return c.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},c.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},c.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},c.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},c.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},c.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},c.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},c.segment.get=function(){return this._structArray.uint16[this._pos2+10]},c.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},c.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},c.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},c.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},c.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},c.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},c.placedOrientation.set=function(m){this._structArray.uint8[this._pos1+37]=m},c.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},c.hidden.set=function(m){this._structArray.uint8[this._pos1+38]=m},c.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},c.crossTileID.set=function(m){this._structArray.uint32[this._pos4+10]=m},c.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(u.prototype,c),u}(Fc);p.prototype.size=48;var g=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.get=function(c){return new p(this,c)},u}(tu);_n("PlacedSymbolArray",g);var S=function(a){function u(){a.apply(this,arguments)}a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var c={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return c.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},c.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},c.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},c.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},c.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},c.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},c.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},c.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},c.key.get=function(){return this._structArray.uint16[this._pos2+8]},c.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},c.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},c.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},c.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},c.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},c.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},c.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},c.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},c.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},c.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},c.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},c.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},c.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},c.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},c.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},c.crossTileID.set=function(m){this._structArray.uint32[this._pos4+12]=m},c.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},c.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},c.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},c.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(u.prototype,c),u}(Fc);S.prototype.size=68;var w=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.get=function(c){return new S(this,c)},u}(jf);_n("SymbolInstanceArray",w);var C=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.getoffsetX=function(c){return this.float32[1*c+0]},u}(Ol);_n("GlyphOffsetArray",C);var P=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.getx=function(c){return this.int16[3*c+0]},u.prototype.gety=function(c){return this.int16[3*c+1]},u.prototype.gettileUnitDistanceFromAnchor=function(c){return this.int16[3*c+2]},u}(ru);_n("SymbolLineVertexArray",P);var Z=function(a){function u(){a.apply(this,arguments)}a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var c={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return c.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},c.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},c.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(u.prototype,c),u}(Fc);Z.prototype.size=8;var Y=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.get=function(c){return new Z(this,c)},u}(Dl);_n("FeatureIndexArray",Y);var pe=wo([{name:"a_pos",components:2,type:"Int16"}],4).members,_e=function(a){a===void 0&&(a=[]),this.segments=a};function ye(a,u){return 256*(a=wt(Math.floor(a),0,255))+wt(Math.floor(u),0,255)}_e.prototype.prepareSegment=function(a,u,c,m){var x=this.segments[this.segments.length-1];return a>_e.MAX_VERTEX_ARRAY_LENGTH&&qe("Max vertices per segment is "+_e.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+a),(!x||x.vertexLength+a>_e.MAX_VERTEX_ARRAY_LENGTH||x.sortKey!==m)&&(x={vertexOffset:u.length,primitiveOffset:c.length,vertexLength:0,primitiveLength:0},m!==void 0&&(x.sortKey=m),this.segments.push(x)),x},_e.prototype.get=function(){return this.segments},_e.prototype.destroy=function(){for(var a=0,u=this.segments;a<u.length;a+=1){var c=u[a];for(var m in c.vaos)c.vaos[m].destroy()}},_e.simpleSegment=function(a,u,c,m){return new _e([{vertexOffset:a,primitiveOffset:u,vertexLength:c,primitiveLength:m,vaos:{},sortKey:0}])},_e.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,_n("SegmentVector",_e);var Ue=wo([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),ke=le(function(a){a.exports=function(u,c){var m,x,E,A,I,D,N,H;for(x=u.length-(m=3&u.length),E=c,I=3432918353,D=461845907,H=0;H<x;)N=255&u.charCodeAt(H)|(255&u.charCodeAt(++H))<<8|(255&u.charCodeAt(++H))<<16|(255&u.charCodeAt(++H))<<24,++H,E=27492+(65535&(A=5*(65535&(E=(E^=N=(65535&(N=(N=(65535&N)*I+(((N>>>16)*I&65535)<<16)&4294967295)<<15|N>>>17))*D+(((N>>>16)*D&65535)<<16)&4294967295)<<13|E>>>19))+((5*(E>>>16)&65535)<<16)&4294967295))+((58964+(A>>>16)&65535)<<16);switch(N=0,m){case 3:N^=(255&u.charCodeAt(H+2))<<16;case 2:N^=(255&u.charCodeAt(H+1))<<8;case 1:E^=N=(65535&(N=(N=(65535&(N^=255&u.charCodeAt(H)))*I+(((N>>>16)*I&65535)<<16)&4294967295)<<15|N>>>17))*D+(((N>>>16)*D&65535)<<16)&4294967295}return E^=u.length,E=2246822507*(65535&(E^=E>>>16))+((2246822507*(E>>>16)&65535)<<16)&4294967295,E=3266489909*(65535&(E^=E>>>13))+((3266489909*(E>>>16)&65535)<<16)&4294967295,(E^=E>>>16)>>>0}}),Ke=le(function(a){a.exports=function(u,c){for(var m,x=u.length,E=c^x,A=0;x>=4;)m=1540483477*(65535&(m=255&u.charCodeAt(A)|(255&u.charCodeAt(++A))<<8|(255&u.charCodeAt(++A))<<16|(255&u.charCodeAt(++A))<<24))+((1540483477*(m>>>16)&65535)<<16),E=1540483477*(65535&E)+((1540483477*(E>>>16)&65535)<<16)^(m=1540483477*(65535&(m^=m>>>24))+((1540483477*(m>>>16)&65535)<<16)),x-=4,++A;switch(x){case 3:E^=(255&u.charCodeAt(A+2))<<16;case 2:E^=(255&u.charCodeAt(A+1))<<8;case 1:E=1540483477*(65535&(E^=255&u.charCodeAt(A)))+((1540483477*(E>>>16)&65535)<<16)}return E=1540483477*(65535&(E^=E>>>13))+((1540483477*(E>>>16)&65535)<<16),(E^=E>>>15)>>>0}}),Ie=ke,$e=Ke;Ie.murmur3=ke,Ie.murmur2=$e;var vt=function(){this.ids=[],this.positions=[],this.indexed=!1};vt.prototype.add=function(a,u,c,m){this.ids.push(Jt(a)),this.positions.push(u,c,m)},vt.prototype.getPositions=function(a){for(var u=Jt(a),c=0,m=this.ids.length-1;c<m;){var x=c+m>>1;this.ids[x]>=u?m=x:c=x+1}for(var E=[];this.ids[c]===u;)E.push({index:this.positions[3*c],start:this.positions[3*c+1],end:this.positions[3*c+2]}),c++;return E},vt.serialize=function(a,u){var c=new Float64Array(a.ids),m=new Uint32Array(a.positions);return function x(E,A,I,D){for(;I<D;){for(var N=E[I+D>>1],H=I-1,X=D+1;;){do H++;while(E[H]<N);do X--;while(E[X]>N);if(H>=X)break;zt(E,H,X),zt(A,3*H,3*X),zt(A,3*H+1,3*X+1),zt(A,3*H+2,3*X+2)}X-I<D-X?(x(E,A,I,X),I=X+1):(x(E,A,X+1,D),D=X)}}(c,m,0,c.length-1),u&&u.push(c.buffer,m.buffer),{ids:c,positions:m}},vt.deserialize=function(a){var u=new vt;return u.ids=a.ids,u.positions=a.positions,u.indexed=!0,u};var Rt=Math.pow(2,53)-1;function Jt(a){var u=+a;return!isNaN(u)&&u<=Rt?u:Ie(String(a))}function zt(a,u,c){var m=a[u];a[u]=a[c],a[c]=m}_n("FeaturePositionMap",vt);var ar=function(a,u){this.gl=a.gl,this.location=u},_r=function(a){function u(c,m){a.call(this,c,m),this.current=0}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.set=function(c){this.current!==c&&(this.current=c,this.gl.uniform1i(this.location,c))},u}(ar),Nr=function(a){function u(c,m){a.call(this,c,m),this.current=0}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.set=function(c){this.current!==c&&(this.current=c,this.gl.uniform1f(this.location,c))},u}(ar),kr=function(a){function u(c,m){a.call(this,c,m),this.current=[0,0]}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.set=function(c){c[0]===this.current[0]&&c[1]===this.current[1]||(this.current=c,this.gl.uniform2f(this.location,c[0],c[1]))},u}(ar),un=function(a){function u(c,m){a.call(this,c,m),this.current=[0,0,0]}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.set=function(c){c[0]===this.current[0]&&c[1]===this.current[1]&&c[2]===this.current[2]||(this.current=c,this.gl.uniform3f(this.location,c[0],c[1],c[2]))},u}(ar),Pn=function(a){function u(c,m){a.call(this,c,m),this.current=[0,0,0,0]}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.set=function(c){c[0]===this.current[0]&&c[1]===this.current[1]&&c[2]===this.current[2]&&c[3]===this.current[3]||(this.current=c,this.gl.uniform4f(this.location,c[0],c[1],c[2],c[3]))},u}(ar),zn=function(a){function u(c,m){a.call(this,c,m),this.current=wi.transparent}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.set=function(c){c.r===this.current.r&&c.g===this.current.g&&c.b===this.current.b&&c.a===this.current.a||(this.current=c,this.gl.uniform4f(this.location,c.r,c.g,c.b,c.a))},u}(ar),Zn=new Float32Array(16),Wi=function(a){function u(c,m){a.call(this,c,m),this.current=Zn}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.set=function(c){if(c[12]!==this.current[12]||c[0]!==this.current[0])return this.current=c,void this.gl.uniformMatrix4fv(this.location,!1,c);for(var m=1;m<16;m++)if(c[m]!==this.current[m]){this.current=c,this.gl.uniformMatrix4fv(this.location,!1,c);break}},u}(ar);function vn(a){return[ye(255*a.r,255*a.g),ye(255*a.b,255*a.a)]}var ei=function(a,u,c){this.value=a,this.uniformNames=u.map(function(m){return"u_"+m}),this.type=c};ei.prototype.setUniform=function(a,u,c){a.set(c.constantOr(this.value))},ei.prototype.getBinding=function(a,u,c){return this.type==="color"?new zn(a,u):new Nr(a,u)};var _i=function(a,u){this.uniformNames=u.map(function(c){return"u_"+c}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};_i.prototype.setConstantPatternPositions=function(a,u){this.pixelRatioFrom=u.pixelRatio,this.pixelRatioTo=a.pixelRatio,this.patternFrom=u.tlbr,this.patternTo=a.tlbr},_i.prototype.setUniform=function(a,u,c,m){var x=m==="u_pattern_to"?this.patternTo:m==="u_pattern_from"?this.patternFrom:m==="u_pixel_ratio_to"?this.pixelRatioTo:m==="u_pixel_ratio_from"?this.pixelRatioFrom:null;x&&a.set(x)},_i.prototype.getBinding=function(a,u,c){return c.substr(0,9)==="u_pattern"?new Pn(a,u):new Nr(a,u)};var ri=function(a,u,c,m){this.expression=a,this.type=c,this.maxValue=0,this.paintVertexAttributes=u.map(function(x){return{name:"a_"+x,type:"Float32",components:c==="color"?2:1,offset:0}}),this.paintVertexArray=new m};ri.prototype.populatePaintArray=function(a,u,c,m,x){var E=this.paintVertexArray.length,A=this.expression.evaluate(new B(0),u,{},m,[],x);this.paintVertexArray.resize(a),this._setPaintValue(E,a,A)},ri.prototype.updatePaintArray=function(a,u,c,m){var x=this.expression.evaluate({zoom:0},c,m);this._setPaintValue(a,u,x)},ri.prototype._setPaintValue=function(a,u,c){if(this.type==="color")for(var m=vn(c),x=a;x<u;x++)this.paintVertexArray.emplace(x,m[0],m[1]);else{for(var E=a;E<u;E++)this.paintVertexArray.emplace(E,c);this.maxValue=Math.max(this.maxValue,Math.abs(c))}},ri.prototype.upload=function(a){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=a.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ri.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var qn=function(a,u,c,m,x,E){this.expression=a,this.uniformNames=u.map(function(A){return"u_"+A+"_t"}),this.type=c,this.useIntegerZoom=m,this.zoom=x,this.maxValue=0,this.paintVertexAttributes=u.map(function(A){return{name:"a_"+A,type:"Float32",components:c==="color"?4:2,offset:0}}),this.paintVertexArray=new E};qn.prototype.populatePaintArray=function(a,u,c,m,x){var E=this.expression.evaluate(new B(this.zoom),u,{},m,[],x),A=this.expression.evaluate(new B(this.zoom+1),u,{},m,[],x),I=this.paintVertexArray.length;this.paintVertexArray.resize(a),this._setPaintValue(I,a,E,A)},qn.prototype.updatePaintArray=function(a,u,c,m){var x=this.expression.evaluate({zoom:this.zoom},c,m),E=this.expression.evaluate({zoom:this.zoom+1},c,m);this._setPaintValue(a,u,x,E)},qn.prototype._setPaintValue=function(a,u,c,m){if(this.type==="color")for(var x=vn(c),E=vn(m),A=a;A<u;A++)this.paintVertexArray.emplace(A,x[0],x[1],E[0],E[1]);else{for(var I=a;I<u;I++)this.paintVertexArray.emplace(I,c,m);this.maxValue=Math.max(this.maxValue,Math.abs(c),Math.abs(m))}},qn.prototype.upload=function(a){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=a.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},qn.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},qn.prototype.setUniform=function(a,u){var c=this.useIntegerZoom?Math.floor(u.zoom):u.zoom,m=wt(this.expression.interpolationFactor(c,this.zoom,this.zoom+1),0,1);a.set(m)},qn.prototype.getBinding=function(a,u,c){return new Nr(a,u)};var di=function(a,u,c,m,x,E){this.expression=a,this.type=u,this.useIntegerZoom=c,this.zoom=m,this.layerId=E,this.zoomInPaintVertexArray=new x,this.zoomOutPaintVertexArray=new x};di.prototype.populatePaintArray=function(a,u,c){var m=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(a),this.zoomOutPaintVertexArray.resize(a),this._setPaintValues(m,a,u.patterns&&u.patterns[this.layerId],c)},di.prototype.updatePaintArray=function(a,u,c,m,x){this._setPaintValues(a,u,c.patterns&&c.patterns[this.layerId],x)},di.prototype._setPaintValues=function(a,u,c,m){if(m&&c){var x=m[c.min],E=m[c.mid],A=m[c.max];if(x&&E&&A)for(var I=a;I<u;I++)this.zoomInPaintVertexArray.emplace(I,E.tl[0],E.tl[1],E.br[0],E.br[1],x.tl[0],x.tl[1],x.br[0],x.br[1],E.pixelRatio,x.pixelRatio),this.zoomOutPaintVertexArray.emplace(I,E.tl[0],E.tl[1],E.br[0],E.br[1],A.tl[0],A.tl[1],A.br[0],A.br[1],E.pixelRatio,A.pixelRatio)}},di.prototype.upload=function(a){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=a.createVertexBuffer(this.zoomInPaintVertexArray,Ue.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=a.createVertexBuffer(this.zoomOutPaintVertexArray,Ue.members,this.expression.isStateDependent))},di.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Jn=function(a,u,c){this.binders={},this._buffers=[];var m=[];for(var x in a.paint._values)if(c(x)){var E=a.paint.get(x);if(E instanceof Da&&rl(E.property.specification)){var A=Co(x,a.type),I=E.value,D=E.property.specification.type,N=E.property.useIntegerZoom,H=E.property.specification["property-type"],X=H==="cross-faded"||H==="cross-faded-data-driven";if(I.kind==="constant")this.binders[x]=X?new _i(I.value,A):new ei(I.value,A,D),m.push("/u_"+x);else if(I.kind==="source"||X){var ne=Ua(x,D,"source");this.binders[x]=X?new di(I,D,N,u,ne,a.id):new ri(I,A,D,ne),m.push("/a_"+x)}else{var R=Ua(x,D,"composite");this.binders[x]=new qn(I,A,D,N,u,R),m.push("/z_"+x)}}}this.cacheKey=m.sort().join("")};Jn.prototype.getMaxValue=function(a){var u=this.binders[a];return u instanceof ri||u instanceof qn?u.maxValue:0},Jn.prototype.populatePaintArrays=function(a,u,c,m,x){for(var E in this.binders){var A=this.binders[E];(A instanceof ri||A instanceof qn||A instanceof di)&&A.populatePaintArray(a,u,c,m,x)}},Jn.prototype.setConstantPatternPositions=function(a,u){for(var c in this.binders){var m=this.binders[c];m instanceof _i&&m.setConstantPatternPositions(a,u)}},Jn.prototype.updatePaintArrays=function(a,u,c,m,x){var E=!1;for(var A in a)for(var I=0,D=u.getPositions(A);I<D.length;I+=1){var N=D[I],H=c.feature(N.index);for(var X in this.binders){var ne=this.binders[X];if((ne instanceof ri||ne instanceof qn||ne instanceof di)&&ne.expression.isStateDependent===!0){var R=m.paint.get(X);ne.expression=R.value,ne.updatePaintArray(N.start,N.end,H,a[A],x),E=!0}}}return E},Jn.prototype.defines=function(){var a=[];for(var u in this.binders){var c=this.binders[u];(c instanceof ei||c instanceof _i)&&a.push.apply(a,c.uniformNames.map(function(m){return"#define HAS_UNIFORM_"+m}))}return a},Jn.prototype.getBinderAttributes=function(){var a=[];for(var u in this.binders){var c=this.binders[u];if(c instanceof ri||c instanceof qn)for(var m=0;m<c.paintVertexAttributes.length;m++)a.push(c.paintVertexAttributes[m].name);else if(c instanceof di)for(var x=0;x<Ue.members.length;x++)a.push(Ue.members[x].name)}return a},Jn.prototype.getBinderUniforms=function(){var a=[];for(var u in this.binders){var c=this.binders[u];if(c instanceof ei||c instanceof _i||c instanceof qn)for(var m=0,x=c.uniformNames;m<x.length;m+=1)a.push(x[m])}return a},Jn.prototype.getPaintVertexBuffers=function(){return this._buffers},Jn.prototype.getUniforms=function(a,u){var c=[];for(var m in this.binders){var x=this.binders[m];if(x instanceof ei||x instanceof _i||x instanceof qn)for(var E=0,A=x.uniformNames;E<A.length;E+=1){var I=A[E];if(u[I]){var D=x.getBinding(a,u[I],I);c.push({name:I,property:m,binding:D})}}}return c},Jn.prototype.setUniforms=function(a,u,c,m){for(var x=0,E=u;x<E.length;x+=1){var A=E[x],I=A.name,D=A.property;this.binders[D].setUniform(A.binding,m,c.get(D),I)}},Jn.prototype.updatePaintBuffers=function(a){for(var u in this._buffers=[],this.binders){var c=this.binders[u];if(a&&c instanceof di){var m=a.fromScale===2?c.zoomInPaintVertexBuffer:c.zoomOutPaintVertexBuffer;m&&this._buffers.push(m)}else(c instanceof ri||c instanceof qn)&&c.paintVertexBuffer&&this._buffers.push(c.paintVertexBuffer)}},Jn.prototype.upload=function(a){for(var u in this.binders){var c=this.binders[u];(c instanceof ri||c instanceof qn||c instanceof di)&&c.upload(a)}this.updatePaintBuffers()},Jn.prototype.destroy=function(){for(var a in this.binders){var u=this.binders[a];(u instanceof ri||u instanceof qn||u instanceof di)&&u.destroy()}};var Kn=function(a,u,c){c===void 0&&(c=function(){return!0}),this.programConfigurations={};for(var m=0,x=a;m<x.length;m+=1){var E=x[m];this.programConfigurations[E.id]=new Jn(E,u,c)}this.needsUpload=!1,this._featureMap=new vt,this._bufferOffset=0};function Co(a,u){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[a]||[a.replace(u+"-","").replace(/-/g,"_")]}function Ua(a,u,c){var m={color:{source:ic,composite:Hf},number:{source:Ol,composite:ic}},x=function(E){return{"line-pattern":{source:Nu,composite:Nu},"fill-pattern":{source:Nu,composite:Nu},"fill-extrusion-pattern":{source:Nu,composite:Nu}}[E]}(a);return x&&x[c]||m[u][c]}Kn.prototype.populatePaintArrays=function(a,u,c,m,x,E){for(var A in this.programConfigurations)this.programConfigurations[A].populatePaintArrays(a,u,m,x,E);u.id!==void 0&&this._featureMap.add(u.id,c,this._bufferOffset,a),this._bufferOffset=a,this.needsUpload=!0},Kn.prototype.updatePaintArrays=function(a,u,c,m){for(var x=0,E=c;x<E.length;x+=1){var A=E[x];this.needsUpload=this.programConfigurations[A.id].updatePaintArrays(a,this._featureMap,u,A,m)||this.needsUpload}},Kn.prototype.get=function(a){return this.programConfigurations[a]},Kn.prototype.upload=function(a){if(this.needsUpload){for(var u in this.programConfigurations)this.programConfigurations[u].upload(a);this.needsUpload=!1}},Kn.prototype.destroy=function(){for(var a in this.programConfigurations)this.programConfigurations[a].destroy()},_n("ConstantBinder",ei),_n("CrossFadedConstantBinder",_i),_n("SourceExpressionBinder",ri),_n("CrossFadedCompositeBinder",di),_n("CompositeExpressionBinder",qn),_n("ProgramConfiguration",Jn,{omit:["_buffers"]}),_n("ProgramConfigurationSet",Kn);var Ro=Math.pow(2,14)-1,Lo=-Ro-1;function Ga(a){for(var u=8192/a.extent,c=a.loadGeometry(),m=0;m<c.length;m++)for(var x=c[m],E=0;E<x.length;E++){var A=x[E],I=Math.round(A.x*u),D=Math.round(A.y*u);A.x=wt(I,Lo,Ro),A.y=wt(D,Lo,Ro),(I<A.x||I>A.x+1||D<A.y||D>A.y+1)&&qe("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return c}function Xa(a,u){return{type:a.type,id:a.id,properties:a.properties,geometry:u?Ga(a):[]}}function Ss(a,u,c,m,x){a.emplaceBack(2*u+(m+1)/2,2*c+(x+1)/2)}var ls=function(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(function(u){return u.id}),this.index=a.index,this.hasPattern=!1,this.layoutVertexArray=new Pl,this.indexArray=new zu,this.segments=new _e,this.programConfigurations=new Kn(a.layers,a.zoom),this.stateDependentLayerIds=this.layers.filter(function(u){return u.isStateDependent()}).map(function(u){return u.id})};function Zu(a,u){for(var c=0;c<a.length;c++)if(iu(u,a[c]))return!0;for(var m=0;m<u.length;m++)if(iu(a,u[m]))return!0;return!!sl(a,u)}function cs(a,u,c){return!!iu(a,u)||!!ul(u,a,c)}function nu(a,u){if(a.length===1)return Vu(u,a[0]);for(var c=0;c<u.length;c++)for(var m=u[c],x=0;x<m.length;x++)if(iu(a,m[x]))return!0;for(var E=0;E<a.length;E++)if(Vu(u,a[E]))return!0;for(var A=0;A<u.length;A++)if(sl(a,u[A]))return!0;return!1}function Us(a,u,c){if(a.length>1){if(sl(a,u))return!0;for(var m=0;m<u.length;m++)if(ul(u[m],a,c))return!0}for(var x=0;x<a.length;x++)if(ul(a[x],u,c))return!0;return!1}function sl(a,u){if(a.length===0||u.length===0)return!1;for(var c=0;c<a.length-1;c++)for(var m=a[c],x=a[c+1],E=0;E<u.length-1;E++)if(Fl(m,x,u[E],u[E+1]))return!0;return!1}function Fl(a,u,c,m){return Ct(a,c,m)!==Ct(u,c,m)&&Ct(a,u,c)!==Ct(a,u,m)}function ul(a,u,c){var m=c*c;if(u.length===1)return a.distSqr(u[0])<m;for(var x=1;x<u.length;x++)if(kl(a,u[x-1],u[x])<m)return!0;return!1}function kl(a,u,c){var m=u.distSqr(c);if(m===0)return a.distSqr(u);var x=((a.x-u.x)*(c.x-u.x)+(a.y-u.y)*(c.y-u.y))/m;return a.distSqr(x<0?u:x>1?c:c.sub(u)._mult(x)._add(u))}function Vu(a,u){for(var c,m,x,E=!1,A=0;A<a.length;A++)for(var I=0,D=(c=a[A]).length-1;I<c.length;D=I++)(m=c[I]).y>u.y!=(x=c[D]).y>u.y&&u.x<(x.x-m.x)*(u.y-m.y)/(x.y-m.y)+m.x&&(E=!E);return E}function iu(a,u){for(var c=!1,m=0,x=a.length-1;m<a.length;x=m++){var E=a[m],A=a[x];E.y>u.y!=A.y>u.y&&u.x<(A.x-E.x)*(u.y-E.y)/(A.y-E.y)+E.x&&(c=!c)}return c}function ju(a,u,c){var m=c[0],x=c[2];if(a.x<m.x&&u.x<m.x||a.x>x.x&&u.x>x.x||a.y<m.y&&u.y<m.y||a.y>x.y&&u.y>x.y)return!1;var E=Ct(a,u,c[0]);return E!==Ct(a,u,c[1])||E!==Ct(a,u,c[2])||E!==Ct(a,u,c[3])}function Ko(a,u,c){var m=u.paint.get(a).value;return m.kind==="constant"?m.value:c.programConfigurations.get(u.id).getMaxValue(a)}function Qa(a){return Math.sqrt(a[0]*a[0]+a[1]*a[1])}function As(a,u,c,m,x){if(!u[0]&&!u[1])return a;var E=se.convert(u)._mult(x);c==="viewport"&&E._rotate(-m);for(var A=[],I=0;I<a.length;I++)A.push(a[I].sub(E));return A}ls.prototype.populate=function(a,u,c){var m=this.layers[0],x=[],E=null;m.type==="circle"&&(E=m.layout.get("circle-sort-key"));for(var A=0,I=a;A<I.length;A+=1){var D=I[A],N=D.feature,H=D.id,X=D.index,ne=D.sourceLayerIndex,R=this.layers[0]._featureFilter.needGeometry,Pe=Xa(N,R);if(this.layers[0]._featureFilter.filter(new B(this.zoom),Pe,c)){var Be=E?E.evaluate(Pe,{},c):void 0,rt={id:H,properties:N.properties,type:N.type,sourceLayerIndex:ne,index:X,geometry:R?Pe.geometry:Ga(N),patterns:{},sortKey:Be};x.push(rt)}}E&&x.sort(function(Xr,Bn){return Xr.sortKey-Bn.sortKey});for(var Ge=0,St=x;Ge<St.length;Ge+=1){var Ft=St[Ge],Yt=Ft.geometry,qt=Ft.index,dr=Ft.sourceLayerIndex,Lr=a[qt].feature;this.addFeature(Ft,Yt,qt,c),u.featureIndex.insert(Lr,Yt,qt,dr,this.index)}},ls.prototype.update=function(a,u,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,u,this.stateDependentLayers,c)},ls.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ls.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ls.prototype.upload=function(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,pe),this.indexBuffer=a.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(a),this.uploaded=!0},ls.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ls.prototype.addFeature=function(a,u,c,m){for(var x=0,E=u;x<E.length;x+=1)for(var A=0,I=E[x];A<I.length;A+=1){var D=I[A],N=D.x,H=D.y;if(!(N<0||N>=8192||H<0||H>=8192)){var X=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,a.sortKey),ne=X.vertexLength;Ss(this.layoutVertexArray,N,H,-1,-1),Ss(this.layoutVertexArray,N,H,1,-1),Ss(this.layoutVertexArray,N,H,1,1),Ss(this.layoutVertexArray,N,H,-1,1),this.indexArray.emplaceBack(ne,ne+1,ne+2),this.indexArray.emplaceBack(ne,ne+3,ne+2),X.vertexLength+=4,X.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,c,{},m)},_n("CircleBucket",ls,{omit:["layers"]});var au=new Fa({"circle-sort-key":new yn(j.layout_circle["circle-sort-key"])}),Hu={paint:new Fa({"circle-radius":new yn(j.paint_circle["circle-radius"]),"circle-color":new yn(j.paint_circle["circle-color"]),"circle-blur":new yn(j.paint_circle["circle-blur"]),"circle-opacity":new yn(j.paint_circle["circle-opacity"]),"circle-translate":new kn(j.paint_circle["circle-translate"]),"circle-translate-anchor":new kn(j.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new kn(j.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new kn(j.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new yn(j.paint_circle["circle-stroke-width"]),"circle-stroke-color":new yn(j.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new yn(j.paint_circle["circle-stroke-opacity"])}),layout:au},Zi=typeof Float32Array!="undefined"?Float32Array:Array;function mo(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}function ao(a,u,c){var m=u[0],x=u[1],E=u[2],A=u[3],I=u[4],D=u[5],N=u[6],H=u[7],X=u[8],ne=u[9],R=u[10],Pe=u[11],Be=u[12],rt=u[13],Ge=u[14],St=u[15],Ft=c[0],Yt=c[1],qt=c[2],dr=c[3];return a[0]=Ft*m+Yt*I+qt*X+dr*Be,a[1]=Ft*x+Yt*D+qt*ne+dr*rt,a[2]=Ft*E+Yt*N+qt*R+dr*Ge,a[3]=Ft*A+Yt*H+qt*Pe+dr*St,a[4]=(Ft=c[4])*m+(Yt=c[5])*I+(qt=c[6])*X+(dr=c[7])*Be,a[5]=Ft*x+Yt*D+qt*ne+dr*rt,a[6]=Ft*E+Yt*N+qt*R+dr*Ge,a[7]=Ft*A+Yt*H+qt*Pe+dr*St,a[8]=(Ft=c[8])*m+(Yt=c[9])*I+(qt=c[10])*X+(dr=c[11])*Be,a[9]=Ft*x+Yt*D+qt*ne+dr*rt,a[10]=Ft*E+Yt*N+qt*R+dr*Ge,a[11]=Ft*A+Yt*H+qt*Pe+dr*St,a[12]=(Ft=c[12])*m+(Yt=c[13])*I+(qt=c[14])*X+(dr=c[15])*Be,a[13]=Ft*x+Yt*D+qt*ne+dr*rt,a[14]=Ft*E+Yt*N+qt*R+dr*Ge,a[15]=Ft*A+Yt*H+qt*Pe+dr*St,a}Math.hypot||(Math.hypot=function(){for(var a=arguments,u=0,c=arguments.length;c--;)u+=a[c]*a[c];return Math.sqrt(u)});var ou,Bc=ao;function Bl(a,u,c){var m=u[0],x=u[1],E=u[2],A=u[3];return a[0]=c[0]*m+c[4]*x+c[8]*E+c[12]*A,a[1]=c[1]*m+c[5]*x+c[9]*E+c[13]*A,a[2]=c[2]*m+c[6]*x+c[10]*E+c[14]*A,a[3]=c[3]*m+c[7]*x+c[11]*E+c[15]*A,a}ou=new Zi(3),Zi!=Float32Array&&(ou[0]=0,ou[1]=0,ou[2]=0),function(){var a=new Zi(4);Zi!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0,a[3]=0)}();var fs=(function(){var a=new Zi(2);Zi!=Float32Array&&(a[0]=0,a[1]=0)}(),function(a){function u(c){a.call(this,c,Hu)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.createBucket=function(c){return new ls(c)},u.prototype.queryRadius=function(c){var m=c;return Ko("circle-radius",this,m)+Ko("circle-stroke-width",this,m)+Qa(this.paint.get("circle-translate"))},u.prototype.queryIntersectsFeature=function(c,m,x,E,A,I,D,N){for(var H=As(c,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),I.angle,D),X=this.paint.get("circle-radius").evaluate(m,x)+this.paint.get("circle-stroke-width").evaluate(m,x),ne=this.paint.get("circle-pitch-alignment")==="map",R=ne?H:function(Lr,Xr){return Lr.map(function(Bn){return Or(Bn,Xr)})}(H,N),Pe=ne?X*D:X,Be=0,rt=E;Be<rt.length;Be+=1)for(var Ge=0,St=rt[Be];Ge<St.length;Ge+=1){var Ft=St[Ge],Yt=ne?Ft:Or(Ft,N),qt=Pe,dr=Bl([],[Ft.x,Ft.y,0,1],N);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?qt*=dr[3]/I.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(qt*=I.cameraToCenterDistance/dr[3]),cs(R,Yt,qt))return!0}return!1},u}(Ns));function Or(a,u){var c=Bl([],[a.x,a.y,0,1],u);return new se(c[0]/c[3],c[1]/c[3])}var Wu=function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u}(ls);function Gu(a,u,c,m){var x=u.width,E=u.height;if(m){if(m instanceof Uint8ClampedArray)m=new Uint8Array(m.buffer);else if(m.length!==x*E*c)throw new RangeError("mismatched image size")}else m=new Uint8Array(x*E*c);return a.width=x,a.height=E,a.data=m,a}function oo(a,u,c){var m=u.width,x=u.height;if(m!==a.width||x!==a.height){var E=Gu({},{width:m,height:x},c);Ll(a,E,{x:0,y:0},{x:0,y:0},{width:Math.min(a.width,m),height:Math.min(a.height,x)},c),a.width=m,a.height=x,a.data=E.data}}function Ll(a,u,c,m,x,E){if(x.width===0||x.height===0)return u;if(x.width>a.width||x.height>a.height||c.x>a.width-x.width||c.y>a.height-x.height)throw new RangeError("out of range source coordinates for image copy");if(x.width>u.width||x.height>u.height||m.x>u.width-x.width||m.y>u.height-x.height)throw new RangeError("out of range destination coordinates for image copy");for(var A=a.data,I=u.data,D=0;D<x.height;D++)for(var N=((c.y+D)*a.width+c.x)*E,H=((m.y+D)*u.width+m.x)*E,X=0;X<x.width*E;X++)I[H+X]=A[N+X];return u}_n("HeatmapBucket",Wu,{omit:["layers"]});var _u=function(a,u){Gu(this,a,1,u)};_u.prototype.resize=function(a){oo(this,a,1)},_u.prototype.clone=function(){return new _u({width:this.width,height:this.height},new Uint8Array(this.data))},_u.copy=function(a,u,c,m,x){Ll(a,u,c,m,x,1)};var Qo=function(a,u){Gu(this,a,4,u)};Qo.prototype.resize=function(a){oo(this,a,4)},Qo.prototype.replace=function(a,u){u?this.data.set(a):this.data=a instanceof Uint8ClampedArray?new Uint8Array(a.buffer):a},Qo.prototype.clone=function(){return new Qo({width:this.width,height:this.height},new Uint8Array(this.data))},Qo.copy=function(a,u,c,m,x){Ll(a,u,c,m,x,4)},_n("AlphaImage",_u),_n("RGBAImage",Qo);var sc={paint:new Fa({"heatmap-radius":new yn(j.paint_heatmap["heatmap-radius"]),"heatmap-weight":new yn(j.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new kn(j.paint_heatmap["heatmap-intensity"]),"heatmap-color":new mu(j.paint_heatmap["heatmap-color"]),"heatmap-opacity":new kn(j.paint_heatmap["heatmap-opacity"])})};function hf(a){var u={},c=a.resolution||256,m=a.clips?a.clips.length:1,x=a.image||new Qo({width:c,height:m}),E=function(Pe,Be,rt){u[a.evaluationKey]=rt;var Ge=a.expression.evaluate(u);x.data[Pe+Be+0]=Math.floor(255*Ge.r/Ge.a),x.data[Pe+Be+1]=Math.floor(255*Ge.g/Ge.a),x.data[Pe+Be+2]=Math.floor(255*Ge.b/Ge.a),x.data[Pe+Be+3]=Math.floor(255*Ge.a)};if(a.clips)for(var A=0,I=0;A<m;++A,I+=4*c)for(var D=0,N=0;D<c;D++,N+=4){var H=D/(c-1),X=a.clips[A];E(I,N,X.start*(1-H)+X.end*H)}else for(var ne=0,R=0;ne<c;ne++,R+=4)E(0,R,ne/(c-1));return x}var Lc=function(a){function u(c){a.call(this,c,sc),this._updateColorRamp()}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.createBucket=function(c){return new Wu(c)},u.prototype._handleSpecialPaintPropertyUpdate=function(c){c==="heatmap-color"&&this._updateColorRamp()},u.prototype._updateColorRamp=function(){this.colorRamp=hf({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},u.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},u.prototype.queryRadius=function(){return 0},u.prototype.queryIntersectsFeature=function(){return!1},u.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},u}(Ns),Km={paint:new Fa({"hillshade-illumination-direction":new kn(j.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new kn(j.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new kn(j.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new kn(j.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new kn(j.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new kn(j.paint_hillshade["hillshade-accent-color"])})},Bv=function(a){function u(c){a.call(this,c,Km)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},u}(Ns),jp=wo([{name:"a_pos",components:2,type:"Int16"}],4).members,pf=lp,Id=lp;function lp(a,u,c){c=c||2;var m,x,E,A,I,D,N,H=u&&u.length,X=H?u[0]*c:a.length,ne=Pd(a,0,X,c,!0),R=[];if(!ne||ne.next===ne.prev)return R;if(H&&(ne=function(Be,rt,Ge,St){var Ft,Yt,qt,dr=[];for(Ft=0,Yt=rt.length;Ft<Yt;Ft++)(qt=Pd(Be,rt[Ft]*St,Ft<Yt-1?rt[Ft+1]*St:Be.length,St,!1))===qt.next&&(qt.steiner=!0),dr.push(cp(qt));for(dr.sort(Jm),Ft=0;Ft<dr.length;Ft++)Fd(dr[Ft],Ge),Ge=Nc(Ge,Ge.next);return Ge}(a,u,ne,c)),a.length>80*c){m=E=a[0],x=A=a[1];for(var Pe=c;Pe<X;Pe+=c)(I=a[Pe])<m&&(m=I),(D=a[Pe+1])<x&&(x=D),I>E&&(E=I),D>A&&(A=D);N=(N=Math.max(E-m,A-x))!==0?1/N:0}return Mh(ne,R,c,m,x,N),R}function Pd(a,u,c,m,x){var E,A;if(x===_f(a,u,c,m)>0)for(E=u;E<c;E+=m)A=gf(E,a[E],a[E+1],A);else for(E=c-m;E>=u;E-=m)A=gf(E,a[E],a[E+1],A);return A&&uc(A,A.next)&&(ll(A),A=A.next),A}function Nc(a,u){if(!a)return a;u||(u=a);var c,m=a;do if(c=!1,m.steiner||!uc(m,m.next)&&so(m.prev,m,m.next)!==0)m=m.next;else{if(ll(m),(m=u=m.prev)===m.next)break;c=!0}while(c||m!==u);return u}function Mh(a,u,c,m,x,E,A){if(a){!A&&E&&function(H,X,ne,R){var Pe=H;do Pe.z===null&&(Pe.z=Wf(Pe.x,Pe.y,X,ne,R)),Pe.prevZ=Pe.prev,Pe.nextZ=Pe.next,Pe=Pe.next;while(Pe!==H);Pe.prevZ.nextZ=null,Pe.prevZ=null,function(Be){var rt,Ge,St,Ft,Yt,qt,dr,Lr,Xr=1;do{for(Ge=Be,Be=null,Yt=null,qt=0;Ge;){for(qt++,St=Ge,dr=0,rt=0;rt<Xr&&(dr++,St=St.nextZ);rt++);for(Lr=Xr;dr>0||Lr>0&&St;)dr!==0&&(Lr===0||!St||Ge.z<=St.z)?(Ft=Ge,Ge=Ge.nextZ,dr--):(Ft=St,St=St.nextZ,Lr--),Yt?Yt.nextZ=Ft:Be=Ft,Ft.prevZ=Yt,Yt=Ft;Ge=St}Yt.nextZ=null,Xr*=2}while(qt>1)}(Pe)}(a,m,x,E);for(var I,D,N=a;a.prev!==a.next;)if(I=a.prev,D=a.next,E?Qm(a,m,x,E):Od(a))u.push(I.i/c),u.push(a.i/c),u.push(D.i/c),ll(a),a=D.next,N=D.next;else if((a=D)===N){A?A===1?Mh(a=Hp(Nc(a),u,c),u,c,m,x,E,2):A===2&&Dd(a,u,c,m,x,E):Mh(Nc(a),u,c,m,x,E,1);break}}}function Od(a){var u=a.prev,c=a,m=a.next;if(so(u,c,m)>=0)return!1;for(var x=a.next.next;x!==a.prev;){if(df(u.x,u.y,c.x,c.y,m.x,m.y,x.x,x.y)&&so(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function Qm(a,u,c,m){var x=a.prev,E=a,A=a.next;if(so(x,E,A)>=0)return!1;for(var I=x.x>E.x?x.x>A.x?x.x:A.x:E.x>A.x?E.x:A.x,D=x.y>E.y?x.y>A.y?x.y:A.y:E.y>A.y?E.y:A.y,N=Wf(x.x<E.x?x.x<A.x?x.x:A.x:E.x<A.x?E.x:A.x,x.y<E.y?x.y<A.y?x.y:A.y:E.y<A.y?E.y:A.y,u,c,m),H=Wf(I,D,u,c,m),X=a.prevZ,ne=a.nextZ;X&&X.z>=N&&ne&&ne.z<=H;){if(X!==a.prev&&X!==a.next&&df(x.x,x.y,E.x,E.y,A.x,A.y,X.x,X.y)&&so(X.prev,X,X.next)>=0||(X=X.prevZ,ne!==a.prev&&ne!==a.next&&df(x.x,x.y,E.x,E.y,A.x,A.y,ne.x,ne.y)&&so(ne.prev,ne,ne.next)>=0))return!1;ne=ne.nextZ}for(;X&&X.z>=N;){if(X!==a.prev&&X!==a.next&&df(x.x,x.y,E.x,E.y,A.x,A.y,X.x,X.y)&&so(X.prev,X,X.next)>=0)return!1;X=X.prevZ}for(;ne&&ne.z<=H;){if(ne!==a.prev&&ne!==a.next&&df(x.x,x.y,E.x,E.y,A.x,A.y,ne.x,ne.y)&&so(ne.prev,ne,ne.next)>=0)return!1;ne=ne.nextZ}return!0}function Hp(a,u,c){var m=a;do{var x=m.prev,E=m.next.next;!uc(x,E)&&hp(x,m,m.next,E)&&zc(x,E)&&zc(E,x)&&(u.push(x.i/c),u.push(m.i/c),u.push(E.i/c),ll(m),ll(m.next),m=a=E),m=m.next}while(m!==a);return Nc(m)}function Dd(a,u,c,m,x,E){var A=a;do{for(var I=A.next.next;I!==A.prev;){if(A.i!==I.i&&fp(A,I)){var D=Ih(A,I);return A=Nc(A,A.next),D=Nc(D,D.next),Mh(A,u,c,m,x,E),void Mh(D,u,c,m,x,E)}I=I.next}A=A.next}while(A!==a)}function Jm(a,u){return a.x-u.x}function Fd(a,u){if(u=function(m,x){var E,A=x,I=m.x,D=m.y,N=-1/0;do{if(D<=A.y&&D>=A.next.y&&A.next.y!==A.y){var H=A.x+(D-A.y)*(A.next.x-A.x)/(A.next.y-A.y);if(H<=I&&H>N){if(N=H,H===I){if(D===A.y)return A;if(D===A.next.y)return A.next}E=A.x<A.next.x?A:A.next}}A=A.next}while(A!==x);if(!E)return null;if(I===N)return E;var X,ne=E,R=E.x,Pe=E.y,Be=1/0;A=E;do I>=A.x&&A.x>=R&&I!==A.x&&df(D<Pe?I:N,D,R,Pe,D<Pe?N:I,D,A.x,A.y)&&(X=Math.abs(D-A.y)/(I-A.x),zc(A,m)&&(X<Be||X===Be&&(A.x>E.x||A.x===E.x&&Uc(E,A)))&&(E=A,Be=X)),A=A.next;while(A!==ne);return E}(a,u)){var c=Ih(u,a);Nc(u,u.next),Nc(c,c.next)}}function Uc(a,u){return so(a.prev,a,u.prev)<0&&so(u.next,a,a.next)<0}function Wf(a,u,c,m,x){return(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=32767*(a-c)*x)|a<<8))|a<<4))|a<<2))|a<<1))|(u=1431655765&((u=858993459&((u=252645135&((u=16711935&((u=32767*(u-m)*x)|u<<8))|u<<4))|u<<2))|u<<1))<<1}function cp(a){var u=a,c=a;do(u.x<c.x||u.x===c.x&&u.y<c.y)&&(c=u),u=u.next;while(u!==a);return c}function df(a,u,c,m,x,E,A,I){return(x-A)*(u-I)-(a-A)*(E-I)>=0&&(a-A)*(m-I)-(c-A)*(u-I)>=0&&(c-A)*(E-I)-(x-A)*(m-I)>=0}function fp(a,u){return a.next.i!==u.i&&a.prev.i!==u.i&&!function(c,m){var x=c;do{if(x.i!==c.i&&x.next.i!==c.i&&x.i!==m.i&&x.next.i!==m.i&&hp(x,x.next,c,m))return!0;x=x.next}while(x!==c);return!1}(a,u)&&(zc(a,u)&&zc(u,a)&&function(c,m){var x=c,E=!1,A=(c.x+m.x)/2,I=(c.y+m.y)/2;do x.y>I!=x.next.y>I&&x.next.y!==x.y&&A<(x.next.x-x.x)*(I-x.y)/(x.next.y-x.y)+x.x&&(E=!E),x=x.next;while(x!==c);return E}(a,u)&&(so(a.prev,a,u.prev)||so(a,u.prev,u))||uc(a,u)&&so(a.prev,a,a.next)>0&&so(u.prev,u,u.next)>0)}function so(a,u,c){return(u.y-a.y)*(c.x-u.x)-(u.x-a.x)*(c.y-u.y)}function uc(a,u){return a.x===u.x&&a.y===u.y}function hp(a,u,c,m){var x=mf(so(a,u,c)),E=mf(so(a,u,m)),A=mf(so(c,m,a)),I=mf(so(c,m,u));return x!==E&&A!==I||!(x!==0||!vf(a,c,u))||!(E!==0||!vf(a,m,u))||!(A!==0||!vf(c,a,m))||!(I!==0||!vf(c,u,m))}function vf(a,u,c){return u.x<=Math.max(a.x,c.x)&&u.x>=Math.min(a.x,c.x)&&u.y<=Math.max(a.y,c.y)&&u.y>=Math.min(a.y,c.y)}function mf(a){return a>0?1:a<0?-1:0}function zc(a,u){return so(a.prev,a,a.next)<0?so(a,u,a.next)>=0&&so(a,a.prev,u)>=0:so(a,u,a.prev)<0||so(a,a.next,u)<0}function Ih(a,u){var c=new Zc(a.i,a.x,a.y),m=new Zc(u.i,u.x,u.y),x=a.next,E=u.prev;return a.next=u,u.prev=a,c.next=x,x.prev=c,m.next=c,c.prev=m,E.next=m,m.prev=E,m}function gf(a,u,c,m){var x=new Zc(a,u,c);return m?(x.next=m.next,x.prev=m,m.next.prev=x,m.next=x):(x.prev=x,x.next=x),x}function ll(a){a.next.prev=a.prev,a.prev.next=a.next,a.prevZ&&(a.prevZ.nextZ=a.nextZ),a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function Zc(a,u,c){this.i=a,this.x=u,this.y=c,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _f(a,u,c,m){for(var x=0,E=u,A=c-m;E<c;E+=m)x+=(a[A]-a[E])*(a[E+1]+a[A+1]),A=E;return x}function cl(a,u,c,m,x){(function E(A,I,D,N,H){for(;N>D;){if(N-D>600){var X=N-D+1,ne=I-D+1,R=Math.log(X),Pe=.5*Math.exp(2*R/3),Be=.5*Math.sqrt(R*Pe*(X-Pe)/X)*(ne-X/2<0?-1:1);E(A,I,Math.max(D,Math.floor(I-ne*Pe/X+Be)),Math.min(N,Math.floor(I+(X-ne)*Pe/X+Be)),H)}var rt=A[I],Ge=D,St=N;for(lc(A,D,I),H(A[N],rt)>0&&lc(A,D,N);Ge<St;){for(lc(A,Ge,St),Ge++,St--;H(A[Ge],rt)<0;)Ge++;for(;H(A[St],rt)>0;)St--}H(A[D],rt)===0?lc(A,D,St):lc(A,++St,N),St<=I&&(D=St+1),I<=St&&(N=St-1)}})(a,u,c||0,m||a.length-1,x||yf)}function lc(a,u,c){var m=a[u];a[u]=a[c],a[c]=m}function yf(a,u){return a<u?-1:a>u?1:0}function pp(a,u){var c=a.length;if(c<=1)return[a];for(var m,x,E=[],A=0;A<c;A++){var I=fr(a[A]);I!==0&&(a[A].area=Math.abs(I),x===void 0&&(x=I<0),x===I<0?(m&&E.push(m),m=[a[A]]):m.push(a[A]))}if(m&&E.push(m),u>1)for(var D=0;D<E.length;D++)E[D].length<=u||(cl(E[D],u,1,E[D].length-1,Ph),E[D]=E[D].slice(0,u));return E}function Ph(a,u){return u.area-a.area}function Wp(a,u,c){for(var m=c.patternDependencies,x=!1,E=0,A=u;E<A.length;E+=1){var I=A[E].paint.get(a+"-pattern");I.isConstant()||(x=!0);var D=I.constantOr(null);D&&(x=!0,m[D.to]=!0,m[D.from]=!0)}return x}function xf(a,u,c,m,x){for(var E=x.patternDependencies,A=0,I=u;A<I.length;A+=1){var D=I[A],N=D.paint.get(a+"-pattern").value;if(N.kind!=="constant"){var H=N.evaluate({zoom:m-1},c,{},x.availableImages),X=N.evaluate({zoom:m},c,{},x.availableImages),ne=N.evaluate({zoom:m+1},c,{},x.availableImages);X=X&&X.name?X.name:X,ne=ne&&ne.name?ne.name:ne,E[H=H&&H.name?H.name:H]=!0,E[X]=!0,E[ne]=!0,c.patterns[D.id]={min:H,mid:X,max:ne}}}return c}lp.deviation=function(a,u,c,m){var x=u&&u.length,E=Math.abs(_f(a,0,x?u[0]*c:a.length,c));if(x)for(var A=0,I=u.length;A<I;A++)E-=Math.abs(_f(a,u[A]*c,A<I-1?u[A+1]*c:a.length,c));var D=0;for(A=0;A<m.length;A+=3){var N=m[A]*c,H=m[A+1]*c,X=m[A+2]*c;D+=Math.abs((a[N]-a[X])*(a[H+1]-a[N+1])-(a[N]-a[H])*(a[X+1]-a[N+1]))}return E===0&&D===0?0:Math.abs((D-E)/E)},lp.flatten=function(a){for(var u=a[0][0].length,c={vertices:[],holes:[],dimensions:u},m=0,x=0;x<a.length;x++){for(var E=0;E<a[x].length;E++)for(var A=0;A<u;A++)c.vertices.push(a[x][E][A]);x>0&&c.holes.push(m+=a[x-1].length)}return c},pf.default=Id;var fl=function(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(function(u){return u.id}),this.index=a.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Pl,this.indexArray=new zu,this.indexArray2=new ff,this.programConfigurations=new Kn(a.layers,a.zoom),this.segments=new _e,this.segments2=new _e,this.stateDependentLayerIds=this.layers.filter(function(u){return u.isStateDependent()}).map(function(u){return u.id})};fl.prototype.populate=function(a,u,c){this.hasPattern=Wp("fill",this.layers,u);for(var m=this.layers[0].layout.get("fill-sort-key"),x=[],E=0,A=a;E<A.length;E+=1){var I=A[E],D=I.feature,N=I.id,H=I.index,X=I.sourceLayerIndex,ne=this.layers[0]._featureFilter.needGeometry,R=Xa(D,ne);if(this.layers[0]._featureFilter.filter(new B(this.zoom),R,c)){var Pe=m?m.evaluate(R,{},c,u.availableImages):void 0,Be={id:N,properties:D.properties,type:D.type,sourceLayerIndex:X,index:H,geometry:ne?R.geometry:Ga(D),patterns:{},sortKey:Pe};x.push(Be)}}m&&x.sort(function(Lr,Xr){return Lr.sortKey-Xr.sortKey});for(var rt=0,Ge=x;rt<Ge.length;rt+=1){var St=Ge[rt],Ft=St.geometry,Yt=St.index,qt=St.sourceLayerIndex;if(this.hasPattern){var dr=xf("fill",this.layers,St,this.zoom,u);this.patternFeatures.push(dr)}else this.addFeature(St,Ft,Yt,c,{});u.featureIndex.insert(a[Yt].feature,Ft,Yt,qt,this.index)}},fl.prototype.update=function(a,u,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,u,this.stateDependentLayers,c)},fl.prototype.addFeatures=function(a,u,c){for(var m=0,x=this.patternFeatures;m<x.length;m+=1){var E=x[m];this.addFeature(E,E.geometry,E.index,u,c)}},fl.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},fl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},fl.prototype.upload=function(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,jp),this.indexBuffer=a.createIndexBuffer(this.indexArray),this.indexBuffer2=a.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(a),this.uploaded=!0},fl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},fl.prototype.addFeature=function(a,u,c,m,x){for(var E=0,A=pp(u,500);E<A.length;E+=1){for(var I=A[E],D=0,N=0,H=I;N<H.length;N+=1)D+=H[N].length;for(var X=this.segments.prepareSegment(D,this.layoutVertexArray,this.indexArray),ne=X.vertexLength,R=[],Pe=[],Be=0,rt=I;Be<rt.length;Be+=1){var Ge=rt[Be];if(Ge.length!==0){Ge!==I[0]&&Pe.push(R.length/2);var St=this.segments2.prepareSegment(Ge.length,this.layoutVertexArray,this.indexArray2),Ft=St.vertexLength;this.layoutVertexArray.emplaceBack(Ge[0].x,Ge[0].y),this.indexArray2.emplaceBack(Ft+Ge.length-1,Ft),R.push(Ge[0].x),R.push(Ge[0].y);for(var Yt=1;Yt<Ge.length;Yt++)this.layoutVertexArray.emplaceBack(Ge[Yt].x,Ge[Yt].y),this.indexArray2.emplaceBack(Ft+Yt-1,Ft+Yt),R.push(Ge[Yt].x),R.push(Ge[Yt].y);St.vertexLength+=Ge.length,St.primitiveLength+=Ge.length}}for(var qt=pf(R,Pe),dr=0;dr<qt.length;dr+=3)this.indexArray.emplaceBack(ne+qt[dr],ne+qt[dr+1],ne+qt[dr+2]);X.vertexLength+=D,X.primitiveLength+=qt.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,c,x,m)},_n("FillBucket",fl,{omit:["layers","patternFeatures"]});var Nl=new Fa({"fill-sort-key":new yn(j.layout_fill["fill-sort-key"])}),kd={paint:new Fa({"fill-antialias":new kn(j.paint_fill["fill-antialias"]),"fill-opacity":new yn(j.paint_fill["fill-opacity"]),"fill-color":new yn(j.paint_fill["fill-color"]),"fill-outline-color":new yn(j.paint_fill["fill-outline-color"]),"fill-translate":new kn(j.paint_fill["fill-translate"]),"fill-translate-anchor":new kn(j.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ls(j.paint_fill["fill-pattern"])}),layout:Nl},Oh=function(a){function u(c){a.call(this,c,kd)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.recalculate=function(c,m){a.prototype.recalculate.call(this,c,m);var x=this.paint._values["fill-outline-color"];x.value.kind==="constant"&&x.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},u.prototype.createBucket=function(c){return new fl(c)},u.prototype.queryRadius=function(){return Qa(this.paint.get("fill-translate"))},u.prototype.queryIntersectsFeature=function(c,m,x,E,A,I,D){return nu(As(c,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),I.angle,D),E)},u.prototype.isTileClipped=function(){return!0},u}(Ns),Gp=wo([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,dp=cc;function cc(a,u,c,m,x){this.properties={},this.extent=c,this.type=0,this._pbf=a,this._geometry=-1,this._keys=m,this._values=x,a.readFields(Bd,this,u)}function Bd(a,u,c){a==1?u.id=c.readVarint():a==2?function(m,x){for(var E=m.readVarint()+m.pos;m.pos<E;){var A=x._keys[m.readVarint()],I=x._values[m.readVarint()];x.properties[A]=I}}(c,u):a==3?u.type=c.readVarint():a==4&&(u._geometry=c.pos)}function hl(a){for(var u,c,m=0,x=0,E=a.length,A=E-1;x<E;A=x++)m+=((c=a[A]).x-(u=a[x]).x)*(u.y+c.y);return m}cc.types=["Unknown","Point","LineString","Polygon"],cc.prototype.loadGeometry=function(){var a=this._pbf;a.pos=this._geometry;for(var u,c=a.readVarint()+a.pos,m=1,x=0,E=0,A=0,I=[];a.pos<c;){if(x<=0){var D=a.readVarint();m=7&D,x=D>>3}if(x--,m===1||m===2)E+=a.readSVarint(),A+=a.readSVarint(),m===1&&(u&&I.push(u),u=[]),u.push(new se(E,A));else{if(m!==7)throw new Error("unknown command "+m);u&&u.push(u[0].clone())}}return u&&I.push(u),I},cc.prototype.bbox=function(){var a=this._pbf;a.pos=this._geometry;for(var u=a.readVarint()+a.pos,c=1,m=0,x=0,E=0,A=1/0,I=-1/0,D=1/0,N=-1/0;a.pos<u;){if(m<=0){var H=a.readVarint();c=7&H,m=H>>3}if(m--,c===1||c===2)(x+=a.readSVarint())<A&&(A=x),x>I&&(I=x),(E+=a.readSVarint())<D&&(D=E),E>N&&(N=E);else if(c!==7)throw new Error("unknown command "+c)}return[A,D,I,N]},cc.prototype.toGeoJSON=function(a,u,c){var m,x,E=this.extent*Math.pow(2,c),A=this.extent*a,I=this.extent*u,D=this.loadGeometry(),N=cc.types[this.type];function H(R){for(var Pe=0;Pe<R.length;Pe++){var Be=R[Pe];R[Pe]=[360*(Be.x+A)/E-180,360/Math.PI*Math.atan(Math.exp((180-360*(Be.y+I)/E)*Math.PI/180))-90]}}switch(this.type){case 1:var X=[];for(m=0;m<D.length;m++)X[m]=D[m][0];H(D=X);break;case 2:for(m=0;m<D.length;m++)H(D[m]);break;case 3:for(D=function(R){var Pe=R.length;if(Pe<=1)return[R];for(var Be,rt,Ge=[],St=0;St<Pe;St++){var Ft=hl(R[St]);Ft!==0&&(rt===void 0&&(rt=Ft<0),rt===Ft<0?(Be&&Ge.push(Be),Be=[R[St]]):Be.push(R[St]))}return Be&&Ge.push(Be),Ge}(D),m=0;m<D.length;m++)for(x=0;x<D[m].length;x++)H(D[m][x])}D.length===1?D=D[0]:N="Multi"+N;var ne={type:"Feature",geometry:{type:N,coordinates:D},properties:this.properties};return"id"in this&&(ne.id=this.id),ne};var pl=bf;function bf(a,u){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=a,this._keys=[],this._values=[],this._features=[],a.readFields(fc,this,u),this.length=this._features.length}function fc(a,u,c){a===15?u.version=c.readVarint():a===1?u.name=c.readString():a===5?u.extent=c.readVarint():a===2?u._features.push(c.pos):a===3?u._keys.push(c.readString()):a===4&&u._values.push(function(m){for(var x=null,E=m.readVarint()+m.pos;m.pos<E;){var A=m.readVarint()>>3;x=A===1?m.readString():A===2?m.readFloat():A===3?m.readDouble():A===4?m.readVarint64():A===5?m.readVarint():A===6?m.readSVarint():A===7?m.readBoolean():null}return x}(c))}function Xp(a,u,c){if(a===3){var m=new pl(c,c.readVarint()+c.pos);m.length&&(u[m.name]=m)}}bf.prototype.feature=function(a){if(a<0||a>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[a];var u=this._pbf.readVarint()+this._pbf.pos;return new dp(this._pbf,u,this.extent,this._keys,this._values)};var Ul={VectorTile:function(a,u){this.layers=a.readFields(Xp,{},u)},VectorTileFeature:dp,VectorTileLayer:pl},Gf=Ul.VectorTileFeature.types,vp=Math.pow(2,13);function Ts(a,u,c,m,x,E,A,I){a.emplaceBack(u,c,2*Math.floor(m*vp)+A,x*vp*2,E*vp*2,Math.round(I))}var hs=function(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(function(u){return u.id}),this.index=a.index,this.hasPattern=!1,this.layoutVertexArray=new gu,this.indexArray=new zu,this.programConfigurations=new Kn(a.layers,a.zoom),this.segments=new _e,this.stateDependentLayerIds=this.layers.filter(function(u){return u.isStateDependent()}).map(function(u){return u.id})};function go(a,u){return a.x===u.x&&(a.x<0||a.x>8192)||a.y===u.y&&(a.y<0||a.y>8192)}hs.prototype.populate=function(a,u,c){this.features=[],this.hasPattern=Wp("fill-extrusion",this.layers,u);for(var m=0,x=a;m<x.length;m+=1){var E=x[m],A=E.feature,I=E.id,D=E.index,N=E.sourceLayerIndex,H=this.layers[0]._featureFilter.needGeometry,X=Xa(A,H);if(this.layers[0]._featureFilter.filter(new B(this.zoom),X,c)){var ne={id:I,sourceLayerIndex:N,index:D,geometry:H?X.geometry:Ga(A),properties:A.properties,type:A.type,patterns:{}};this.hasPattern?this.features.push(xf("fill-extrusion",this.layers,ne,this.zoom,u)):this.addFeature(ne,ne.geometry,D,c,{}),u.featureIndex.insert(A,ne.geometry,D,N,this.index,!0)}}},hs.prototype.addFeatures=function(a,u,c){for(var m=0,x=this.features;m<x.length;m+=1){var E=x[m];this.addFeature(E,E.geometry,E.index,u,c)}},hs.prototype.update=function(a,u,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,u,this.stateDependentLayers,c)},hs.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},hs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},hs.prototype.upload=function(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,Gp),this.indexBuffer=a.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(a),this.uploaded=!0},hs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},hs.prototype.addFeature=function(a,u,c,m,x){for(var E=0,A=pp(u,500);E<A.length;E+=1){for(var I=A[E],D=0,N=0,H=I;N<H.length;N+=1)D+=H[N].length;for(var X=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),ne=0,R=I;ne<R.length;ne+=1){var Pe=R[ne];if(Pe.length!==0&&!((Di=Pe).every(function(gi){return gi.x<0})||Di.every(function(gi){return gi.x>8192})||Di.every(function(gi){return gi.y<0})||Di.every(function(gi){return gi.y>8192})))for(var Be=0,rt=0;rt<Pe.length;rt++){var Ge=Pe[rt];if(rt>=1){var St=Pe[rt-1];if(!go(Ge,St)){X.vertexLength+4>_e.MAX_VERTEX_ARRAY_LENGTH&&(X=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Ft=Ge.sub(St)._perp()._unit(),Yt=St.dist(Ge);Be+Yt>32768&&(Be=0),Ts(this.layoutVertexArray,Ge.x,Ge.y,Ft.x,Ft.y,0,0,Be),Ts(this.layoutVertexArray,Ge.x,Ge.y,Ft.x,Ft.y,0,1,Be),Ts(this.layoutVertexArray,St.x,St.y,Ft.x,Ft.y,0,0,Be+=Yt),Ts(this.layoutVertexArray,St.x,St.y,Ft.x,Ft.y,0,1,Be);var qt=X.vertexLength;this.indexArray.emplaceBack(qt,qt+2,qt+1),this.indexArray.emplaceBack(qt+1,qt+2,qt+3),X.vertexLength+=4,X.primitiveLength+=2}}}}if(X.vertexLength+D>_e.MAX_VERTEX_ARRAY_LENGTH&&(X=this.segments.prepareSegment(D,this.layoutVertexArray,this.indexArray)),Gf[a.type]==="Polygon"){for(var dr=[],Lr=[],Xr=X.vertexLength,Bn=0,cn=I;Bn<cn.length;Bn+=1){var Vn=cn[Bn];if(Vn.length!==0){Vn!==I[0]&&Lr.push(dr.length/2);for(var pn=0;pn<Vn.length;pn++){var Ei=Vn[pn];Ts(this.layoutVertexArray,Ei.x,Ei.y,0,0,1,1,0),dr.push(Ei.x),dr.push(Ei.y)}}}for(var ti=pf(dr,Lr),Rn=0;Rn<ti.length;Rn+=3)this.indexArray.emplaceBack(Xr+ti[Rn],Xr+ti[Rn+2],Xr+ti[Rn+1]);X.primitiveLength+=ti.length/3,X.vertexLength+=D}}var Di;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,c,x,m)},_n("FillExtrusionBucket",hs,{omit:["layers","features"]});var zs={paint:new Fa({"fill-extrusion-opacity":new kn(j["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new yn(j["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new kn(j["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new kn(j["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ls(j["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new yn(j["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new yn(j["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new kn(j["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},$p=function(a){function u(c){a.call(this,c,zs)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.createBucket=function(c){return new hs(c)},u.prototype.queryRadius=function(){return Qa(this.paint.get("fill-extrusion-translate"))},u.prototype.is3D=function(){return!0},u.prototype.queryIntersectsFeature=function(c,m,x,E,A,I,D,N){var H=As(c,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),I.angle,D),X=this.paint.get("fill-extrusion-height").evaluate(m,x),ne=this.paint.get("fill-extrusion-base").evaluate(m,x),R=function(Be,rt,Ge,St){for(var Ft=[],Yt=0,qt=Be;Yt<qt.length;Yt+=1){var dr=qt[Yt],Lr=[dr.x,dr.y,0,1];Bl(Lr,Lr,rt),Ft.push(new se(Lr[0]/Lr[3],Lr[1]/Lr[3]))}return Ft}(H,N),Pe=function(Be,rt,Ge,St){for(var Ft=[],Yt=[],qt=St[8]*rt,dr=St[9]*rt,Lr=St[10]*rt,Xr=St[11]*rt,Bn=St[8]*Ge,cn=St[9]*Ge,Vn=St[10]*Ge,pn=St[11]*Ge,Ei=0,ti=Be;Ei<ti.length;Ei+=1){for(var Rn=[],Di=[],gi=0,Ui=ti[Ei];gi<Ui.length;gi+=1){var jn=Ui[gi],ia=jn.x,za=jn.y,eo=St[0]*ia+St[4]*za+St[12],uo=St[1]*ia+St[5]*za+St[13],Za=St[2]*ia+St[6]*za+St[14],ho=St[3]*ia+St[7]*za+St[15],Go=Za+Lr,Uo=ho+Xr,Vs=eo+Bn,ka=uo+cn,js=Za+Vn,So=ho+pn,rs=new se((eo+qt)/Uo,(uo+dr)/Uo);rs.z=Go/Uo,Rn.push(rs);var ji=new se(Vs/So,ka/So);ji.z=js/So,Di.push(ji)}Ft.push(Rn),Yt.push(Di)}return[Ft,Yt]}(E,ne,X,N);return function(Be,rt,Ge){var St=1/0;nu(Ge,rt)&&(St=Ld(Ge,rt[0]));for(var Ft=0;Ft<rt.length;Ft++)for(var Yt=rt[Ft],qt=Be[Ft],dr=0;dr<Yt.length-1;dr++){var Lr=Yt[dr],Xr=[Lr,Yt[dr+1],qt[dr+1],qt[dr],Lr];Zu(Ge,Xr)&&(St=Math.min(St,Ld(Ge,Xr)))}return St!==1/0&&St}(Pe[0],Pe[1],R)},u}(Ns);function Xf(a,u){return a.x*u.x+a.y*u.y}function Ld(a,u){if(a.length===1){for(var c,m=0,x=u[m++];!c||x.equals(c);)if(!(c=u[m++]))return 1/0;for(;m<u.length;m++){var E=u[m],A=a[0],I=c.sub(x),D=E.sub(x),N=A.sub(x),H=Xf(I,I),X=Xf(I,D),ne=Xf(D,D),R=Xf(N,I),Pe=Xf(N,D),Be=H*ne-X*X,rt=(ne*R-X*Pe)/Be,Ge=(H*Pe-X*R)/Be,St=x.z*(1-rt-Ge)+c.z*rt+E.z*Ge;if(isFinite(St))return St}return 1/0}for(var Ft=1/0,Yt=0,qt=u;Yt<qt.length;Yt+=1)Ft=Math.min(Ft,qt[Yt].z);return Ft}var Lv=wo([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Yp=wo([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Nd=Ul.VectorTileFeature.types,Nv=Math.cos(Math.PI/180*37.5),Dh=Math.pow(2,14)/.5,Jo=function(a){var u=this;this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(function(c){return c.id}),this.index=a.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(c){u.gradients[c.id]={}}),this.layoutVertexArray=new Es,this.layoutVertexArray2=new ic,this.indexArray=new zu,this.programConfigurations=new Kn(a.layers,a.zoom),this.segments=new _e,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(c){return c.isStateDependent()}).map(function(c){return c.id})};Jo.prototype.populate=function(a,u,c){this.hasPattern=Wp("line",this.layers,u);for(var m=this.layers[0].layout.get("line-sort-key"),x=[],E=0,A=a;E<A.length;E+=1){var I=A[E],D=I.feature,N=I.id,H=I.index,X=I.sourceLayerIndex,ne=this.layers[0]._featureFilter.needGeometry,R=Xa(D,ne);if(this.layers[0]._featureFilter.filter(new B(this.zoom),R,c)){var Pe=m?m.evaluate(R,{},c):void 0,Be={id:N,properties:D.properties,type:D.type,sourceLayerIndex:X,index:H,geometry:ne?R.geometry:Ga(D),patterns:{},sortKey:Pe};x.push(Be)}}m&&x.sort(function(Lr,Xr){return Lr.sortKey-Xr.sortKey});for(var rt=0,Ge=x;rt<Ge.length;rt+=1){var St=Ge[rt],Ft=St.geometry,Yt=St.index,qt=St.sourceLayerIndex;if(this.hasPattern){var dr=xf("line",this.layers,St,this.zoom,u);this.patternFeatures.push(dr)}else this.addFeature(St,Ft,Yt,c,{});u.featureIndex.insert(a[Yt].feature,Ft,Yt,qt,this.index)}},Jo.prototype.update=function(a,u,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,u,this.stateDependentLayers,c)},Jo.prototype.addFeatures=function(a,u,c){for(var m=0,x=this.patternFeatures;m<x.length;m+=1){var E=x[m];this.addFeature(E,E.geometry,E.index,u,c)}},Jo.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Jo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Jo.prototype.upload=function(a){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=a.createVertexBuffer(this.layoutVertexArray2,Yp)),this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,Lv),this.indexBuffer=a.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(a),this.uploaded=!0},Jo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Jo.prototype.lineFeatureClips=function(a){if(a.properties&&a.properties.hasOwnProperty("mapbox_clip_start")&&a.properties.hasOwnProperty("mapbox_clip_end"))return{start:+a.properties.mapbox_clip_start,end:+a.properties.mapbox_clip_end}},Jo.prototype.addFeature=function(a,u,c,m,x){var E=this.layers[0].layout,A=E.get("line-join").evaluate(a,{}),I=E.get("line-cap"),D=E.get("line-miter-limit"),N=E.get("line-round-limit");this.lineClips=this.lineFeatureClips(a);for(var H=0,X=u;H<X.length;H+=1)this.addLine(X[H],a,A,I,D,N);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,c,x,m)},Jo.prototype.addLine=function(a,u,c,m,x,E){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var A=0;A<a.length-1;A++)this.totalDistance+=a[A].dist(a[A+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var I=Nd[u.type]==="Polygon",D=a.length;D>=2&&a[D-1].equals(a[D-2]);)D--;for(var N=0;N<D-1&&a[N].equals(a[N+1]);)N++;if(!(D<(I?3:2))){c==="bevel"&&(x=1.05);var H,X=this.overscaling<=16?122880/(512*this.overscaling):0,ne=this.segments.prepareSegment(10*D,this.layoutVertexArray,this.indexArray),R=void 0,Pe=void 0,Be=void 0,rt=void 0;this.e1=this.e2=-1,I&&(rt=a[N].sub(H=a[D-2])._unit()._perp());for(var Ge=N;Ge<D;Ge++)if(!(Pe=Ge===D-1?I?a[N+1]:void 0:a[Ge+1])||!a[Ge].equals(Pe)){rt&&(Be=rt),H&&(R=H),H=a[Ge],rt=Pe?Pe.sub(H)._unit()._perp():Be;var St=(Be=Be||rt).add(rt);St.x===0&&St.y===0||St._unit();var Ft=Be.x*rt.x+Be.y*rt.y,Yt=St.x*rt.x+St.y*rt.y,qt=Yt!==0?1/Yt:1/0,dr=2*Math.sqrt(2-2*Yt),Lr=Yt<Nv&&R&&Pe,Xr=Be.x*rt.y-Be.y*rt.x>0;if(Lr&&Ge>N){var Bn=H.dist(R);if(Bn>2*X){var cn=H.sub(H.sub(R)._mult(X/Bn)._round());this.updateDistance(R,cn),this.addCurrentVertex(cn,Be,0,0,ne),R=cn}}var Vn=R&&Pe,pn=Vn?c:I?"butt":m;if(Vn&&pn==="round"&&(qt<E?pn="miter":qt<=2&&(pn="fakeround")),pn==="miter"&&qt>x&&(pn="bevel"),pn==="bevel"&&(qt>2&&(pn="flipbevel"),qt<x&&(pn="miter")),R&&this.updateDistance(R,H),pn==="miter")St._mult(qt),this.addCurrentVertex(H,St,0,0,ne);else if(pn==="flipbevel"){if(qt>100)St=rt.mult(-1);else{var Ei=qt*Be.add(rt).mag()/Be.sub(rt).mag();St._perp()._mult(Ei*(Xr?-1:1))}this.addCurrentVertex(H,St,0,0,ne),this.addCurrentVertex(H,St.mult(-1),0,0,ne)}else if(pn==="bevel"||pn==="fakeround"){var ti=-Math.sqrt(qt*qt-1),Rn=Xr?ti:0,Di=Xr?0:ti;if(R&&this.addCurrentVertex(H,Be,Rn,Di,ne),pn==="fakeround")for(var gi=Math.round(180*dr/Math.PI/20),Ui=1;Ui<gi;Ui++){var jn=Ui/gi;if(jn!==.5){var ia=jn-.5;jn+=jn*ia*(jn-1)*((1.0904+Ft*(Ft*(3.55645-1.43519*Ft)-3.2452))*ia*ia+(.848013+Ft*(.215638*Ft-1.06021)))}var za=rt.sub(Be)._mult(jn)._add(Be)._unit()._mult(Xr?-1:1);this.addHalfVertex(H,za.x,za.y,!1,Xr,0,ne)}Pe&&this.addCurrentVertex(H,rt,-Rn,-Di,ne)}else if(pn==="butt")this.addCurrentVertex(H,St,0,0,ne);else if(pn==="square"){var eo=R?1:-1;this.addCurrentVertex(H,St,eo,eo,ne)}else pn==="round"&&(R&&(this.addCurrentVertex(H,Be,0,0,ne),this.addCurrentVertex(H,Be,1,1,ne,!0)),Pe&&(this.addCurrentVertex(H,rt,-1,-1,ne,!0),this.addCurrentVertex(H,rt,0,0,ne)));if(Lr&&Ge<D-1){var uo=H.dist(Pe);if(uo>2*X){var Za=H.add(Pe.sub(H)._mult(X/uo)._round());this.updateDistance(H,Za),this.addCurrentVertex(Za,rt,0,0,ne),H=Za}}}}},Jo.prototype.addCurrentVertex=function(a,u,c,m,x,E){E===void 0&&(E=!1);var A=u.y*m-u.x,I=-u.y-u.x*m;this.addHalfVertex(a,u.x+u.y*c,u.y-u.x*c,E,!1,c,x),this.addHalfVertex(a,A,I,E,!0,-m,x),this.distance>Dh/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(a,u,c,m,x,E))},Jo.prototype.addHalfVertex=function(a,u,c,m,x,E,A){var I=.5*(this.lineClips?this.scaledDistance*(Dh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((a.x<<1)+(m?1:0),(a.y<<1)+(x?1:0),Math.round(63*u)+128,Math.round(63*c)+128,1+(E===0?0:E<0?-1:1)|(63&I)<<2,I>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var D=A.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,D),A.primitiveLength++),x?this.e2=D:this.e1=D},Jo.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Jo.prototype.updateDistance=function(a,u){this.distance+=a.dist(u),this.updateScaledDistance()},_n("LineBucket",Jo,{omit:["layers","patternFeatures"]});var Uv=new Fa({"line-cap":new kn(j.layout_line["line-cap"]),"line-join":new yn(j.layout_line["line-join"]),"line-miter-limit":new kn(j.layout_line["line-miter-limit"]),"line-round-limit":new kn(j.layout_line["line-round-limit"]),"line-sort-key":new yn(j.layout_line["line-sort-key"])}),$f={paint:new Fa({"line-opacity":new yn(j.paint_line["line-opacity"]),"line-color":new yn(j.paint_line["line-color"]),"line-translate":new kn(j.paint_line["line-translate"]),"line-translate-anchor":new kn(j.paint_line["line-translate-anchor"]),"line-width":new yn(j.paint_line["line-width"]),"line-gap-width":new yn(j.paint_line["line-gap-width"]),"line-offset":new yn(j.paint_line["line-offset"]),"line-blur":new yn(j.paint_line["line-blur"]),"line-dasharray":new qo(j.paint_line["line-dasharray"]),"line-pattern":new Ls(j.paint_line["line-pattern"]),"line-gradient":new mu(j.paint_line["line-gradient"])}),layout:Uv},qp=new(function(a){function u(){a.apply(this,arguments)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.possiblyEvaluate=function(c,m){return m=new B(Math.floor(m.zoom),{now:m.now,fadeDuration:m.fadeDuration,zoomHistory:m.zoomHistory,transition:m.transition}),a.prototype.possiblyEvaluate.call(this,c,m)},u.prototype.evaluate=function(c,m,x,E){return m=Zt({},m,{zoom:Math.floor(m.zoom)}),a.prototype.evaluate.call(this,c,m,x,E)},u}(yn))($f.paint.properties["line-width"].specification);qp.useIntegerZoom=!0;var Ud=function(a){function u(c){a.call(this,c,$f),this.gradientVersion=0}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype._handleSpecialPaintPropertyUpdate=function(c){c==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Os,this.gradientVersion=(this.gradientVersion+1)%et)},u.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},u.prototype.recalculate=function(c,m){a.prototype.recalculate.call(this,c,m),this.paint._values["line-floorwidth"]=qp.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,c)},u.prototype.createBucket=function(c){return new Jo(c)},u.prototype.queryRadius=function(c){var m=c,x=Kp(Ko("line-width",this,m),Ko("line-gap-width",this,m)),E=Ko("line-offset",this,m);return x/2+Math.abs(E)+Qa(this.paint.get("line-translate"))},u.prototype.queryIntersectsFeature=function(c,m,x,E,A,I,D){var N=As(c,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),I.angle,D),H=D/2*Kp(this.paint.get("line-width").evaluate(m,x),this.paint.get("line-gap-width").evaluate(m,x)),X=this.paint.get("line-offset").evaluate(m,x);return X&&(E=function(ne,R){for(var Pe=[],Be=new se(0,0),rt=0;rt<ne.length;rt++){for(var Ge=ne[rt],St=[],Ft=0;Ft<Ge.length;Ft++){var Yt=Ge[Ft],qt=Ge[Ft+1],dr=Ft===0?Be:Yt.sub(Ge[Ft-1])._unit()._perp(),Lr=Ft===Ge.length-1?Be:qt.sub(Yt)._unit()._perp(),Xr=dr._add(Lr)._unit();Xr._mult(1/(Xr.x*Lr.x+Xr.y*Lr.y)),St.push(Xr._mult(R)._add(Yt))}Pe.push(St)}return Pe}(E,X*D)),function(ne,R,Pe){for(var Be=0;Be<R.length;Be++){var rt=R[Be];if(ne.length>=3){for(var Ge=0;Ge<rt.length;Ge++)if(iu(ne,rt[Ge]))return!0}if(Us(ne,rt,Pe))return!0}return!1}(N,E,H)},u.prototype.isTileClipped=function(){return!0},u}(Ns);function Kp(a,u){return u>0?u+2*a:a}var zv=wo([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Zv=wo([{name:"a_projected_pos",components:3,type:"Float32"}],4),zd=(wo([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),wo([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Zd=(wo([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),wo([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),z=wo([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ae(a,u,c){return a.sections.forEach(function(m){m.text=function(x,E,A){var I=E.layout.get("text-transform").evaluate(A,{});return I==="uppercase"?x=x.toLocaleUpperCase():I==="lowercase"&&(x=x.toLocaleLowerCase()),Fe.applyArabicShaping&&(x=Fe.applyArabicShaping(x)),x}(m.text,u,c)}),a}wo([{name:"triangle",components:3,type:"Uint16"}]),wo([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),wo([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),wo([{type:"Float32",name:"offsetX"}]),wo([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var je={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"},jt=function(a,u,c,m,x){var E,A,I=8*x-m-1,D=(1<<I)-1,N=D>>1,H=-7,X=c?x-1:0,ne=c?-1:1,R=a[u+X];for(X+=ne,E=R&(1<<-H)-1,R>>=-H,H+=I;H>0;E=256*E+a[u+X],X+=ne,H-=8);for(A=E&(1<<-H)-1,E>>=-H,H+=m;H>0;A=256*A+a[u+X],X+=ne,H-=8);if(E===0)E=1-N;else{if(E===D)return A?NaN:1/0*(R?-1:1);A+=Math.pow(2,m),E-=N}return(R?-1:1)*A*Math.pow(2,E-m)},pr=function(a,u,c,m,x,E){var A,I,D,N=8*E-x-1,H=(1<<N)-1,X=H>>1,ne=x===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=m?0:E-1,Pe=m?1:-1,Be=u<0||u===0&&1/u<0?1:0;for(u=Math.abs(u),isNaN(u)||u===1/0?(I=isNaN(u)?1:0,A=H):(A=Math.floor(Math.log(u)/Math.LN2),u*(D=Math.pow(2,-A))<1&&(A--,D*=2),(u+=A+X>=1?ne/D:ne*Math.pow(2,1-X))*D>=2&&(A++,D/=2),A+X>=H?(I=0,A=H):A+X>=1?(I=(u*D-1)*Math.pow(2,x),A+=X):(I=u*Math.pow(2,X-1)*Math.pow(2,x),A=0));x>=8;a[c+R]=255&I,R+=Pe,I/=256,x-=8);for(A=A<<x|I,N+=x;N>0;a[c+R]=255&A,R+=Pe,A/=256,N-=8);a[c+R-Pe]|=128*Be},Gt=kt;function kt(a){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(a)?a:new Uint8Array(a||0),this.pos=0,this.type=0,this.length=this.buf.length}kt.Varint=0,kt.Fixed64=1,kt.Bytes=2,kt.Fixed32=5;var Dr=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");function Cr(a){return a.type===kt.Bytes?a.readVarint()+a.pos:a.pos+1}function Vr(a,u,c){return c?4294967296*u+(a>>>0):4294967296*(u>>>0)+(a>>>0)}function Br(a,u,c){var m=u<=16383?1:u<=2097151?2:u<=268435455?3:Math.floor(Math.log(u)/(7*Math.LN2));c.realloc(m);for(var x=c.pos-1;x>=a;x--)c.buf[x+m]=c.buf[x]}function Ur(a,u){for(var c=0;c<a.length;c++)u.writeVarint(a[c])}function Gr(a,u){for(var c=0;c<a.length;c++)u.writeSVarint(a[c])}function Ar(a,u){for(var c=0;c<a.length;c++)u.writeFloat(a[c])}function zr(a,u){for(var c=0;c<a.length;c++)u.writeDouble(a[c])}function Tt(a,u){for(var c=0;c<a.length;c++)u.writeBoolean(a[c])}function er(a,u){for(var c=0;c<a.length;c++)u.writeFixed32(a[c])}function Fr(a,u){for(var c=0;c<a.length;c++)u.writeSFixed32(a[c])}function rn(a,u){for(var c=0;c<a.length;c++)u.writeFixed64(a[c])}function yr(a,u){for(var c=0;c<a.length;c++)u.writeSFixed64(a[c])}function an(a,u){return(a[u]|a[u+1]<<8|a[u+2]<<16)+16777216*a[u+3]}function Pr(a,u,c){a[c]=u,a[c+1]=u>>>8,a[c+2]=u>>>16,a[c+3]=u>>>24}function nn(a,u){return(a[u]|a[u+1]<<8|a[u+2]<<16)+(a[u+3]<<24)}function br(a,u,c){a===1&&c.readMessage($r,u)}function $r(a,u,c){if(a===3){var m=c.readMessage(Nn,{}),x=m.width,E=m.height,A=m.left,I=m.top,D=m.advance;u.push({id:m.id,bitmap:new _u({width:x+6,height:E+6},m.bitmap),metrics:{width:x,height:E,left:A,top:I,advance:D}})}}function Nn(a,u,c){a===1?u.id=c.readVarint():a===2?u.bitmap=c.readBytes():a===3?u.width=c.readVarint():a===4?u.height=c.readVarint():a===5?u.left=c.readSVarint():a===6?u.top=c.readSVarint():a===7&&(u.advance=c.readVarint())}function ui(a){for(var u=0,c=0,m=0,x=a;m<x.length;m+=1){var E=x[m];u+=E.w*E.h,c=Math.max(c,E.w)}a.sort(function(Be,rt){return rt.h-Be.h});for(var A=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(u/.95)),c),h:1/0}],I=0,D=0,N=0,H=a;N<H.length;N+=1)for(var X=H[N],ne=A.length-1;ne>=0;ne--){var R=A[ne];if(!(X.w>R.w||X.h>R.h)){if(X.x=R.x,X.y=R.y,D=Math.max(D,X.y+X.h),I=Math.max(I,X.x+X.w),X.w===R.w&&X.h===R.h){var Pe=A.pop();ne<A.length&&(A[ne]=Pe)}else X.h===R.h?(R.x+=X.w,R.w-=X.w):X.w===R.w?(R.y+=X.h,R.h-=X.h):(A.push({x:R.x+X.w,y:R.y,w:R.w-X.w,h:X.h}),R.y+=X.h,R.h-=X.h);break}}return{w:I,h:D,fill:u/(I*D)||0}}kt.prototype={destroy:function(){this.buf=null},readFields:function(a,u,c){for(c=c||this.length;this.pos<c;){var m=this.readVarint(),x=m>>3,E=this.pos;this.type=7&m,a(x,u,this),this.pos===E&&this.skip(m)}return u},readMessage:function(a,u){return this.readFields(a,u,this.readVarint()+this.pos)},readFixed32:function(){var a=an(this.buf,this.pos);return this.pos+=4,a},readSFixed32:function(){var a=nn(this.buf,this.pos);return this.pos+=4,a},readFixed64:function(){var a=an(this.buf,this.pos)+4294967296*an(this.buf,this.pos+4);return this.pos+=8,a},readSFixed64:function(){var a=an(this.buf,this.pos)+4294967296*nn(this.buf,this.pos+4);return this.pos+=8,a},readFloat:function(){var a=jt(this.buf,this.pos,!0,23,4);return this.pos+=4,a},readDouble:function(){var a=jt(this.buf,this.pos,!0,52,8);return this.pos+=8,a},readVarint:function(a){var u,c,m=this.buf;return u=127&(c=m[this.pos++]),c<128?u:(u|=(127&(c=m[this.pos++]))<<7,c<128?u:(u|=(127&(c=m[this.pos++]))<<14,c<128?u:(u|=(127&(c=m[this.pos++]))<<21,c<128?u:function(x,E,A){var I,D,N=A.buf;if(I=(112&(D=N[A.pos++]))>>4,D<128||(I|=(127&(D=N[A.pos++]))<<3,D<128)||(I|=(127&(D=N[A.pos++]))<<10,D<128)||(I|=(127&(D=N[A.pos++]))<<17,D<128)||(I|=(127&(D=N[A.pos++]))<<24,D<128)||(I|=(1&(D=N[A.pos++]))<<31,D<128))return Vr(x,I,E);throw new Error("Expected varint not more than 10 bytes")}(u|=(15&(c=m[this.pos]))<<28,a,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var a=this.readVarint();return a%2==1?(a+1)/-2:a/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var a=this.readVarint()+this.pos,u=this.pos;return this.pos=a,a-u>=12&&Dr?function(c,m,x){return Dr.decode(c.subarray(m,x))}(this.buf,u,a):function(c,m,x){for(var E="",A=m;A<x;){var I,D,N,H=c[A],X=null,ne=H>239?4:H>223?3:H>191?2:1;if(A+ne>x)break;ne===1?H<128&&(X=H):ne===2?(192&(I=c[A+1]))==128&&(X=(31&H)<<6|63&I)<=127&&(X=null):ne===3?(D=c[A+2],(192&(I=c[A+1]))==128&&(192&D)==128&&((X=(15&H)<<12|(63&I)<<6|63&D)<=2047||X>=55296&&X<=57343)&&(X=null)):ne===4&&(D=c[A+2],N=c[A+3],(192&(I=c[A+1]))==128&&(192&D)==128&&(192&N)==128&&((X=(15&H)<<18|(63&I)<<12|(63&D)<<6|63&N)<=65535||X>=1114112)&&(X=null)),X===null?(X=65533,ne=1):X>65535&&(X-=65536,E+=String.fromCharCode(X>>>10&1023|55296),X=56320|1023&X),E+=String.fromCharCode(X),A+=ne}return E}(this.buf,u,a)},readBytes:function(){var a=this.readVarint()+this.pos,u=this.buf.subarray(this.pos,a);return this.pos=a,u},readPackedVarint:function(a,u){if(this.type!==kt.Bytes)return a.push(this.readVarint(u));var c=Cr(this);for(a=a||[];this.pos<c;)a.push(this.readVarint(u));return a},readPackedSVarint:function(a){if(this.type!==kt.Bytes)return a.push(this.readSVarint());var u=Cr(this);for(a=a||[];this.pos<u;)a.push(this.readSVarint());return a},readPackedBoolean:function(a){if(this.type!==kt.Bytes)return a.push(this.readBoolean());var u=Cr(this);for(a=a||[];this.pos<u;)a.push(this.readBoolean());return a},readPackedFloat:function(a){if(this.type!==kt.Bytes)return a.push(this.readFloat());var u=Cr(this);for(a=a||[];this.pos<u;)a.push(this.readFloat());return a},readPackedDouble:function(a){if(this.type!==kt.Bytes)return a.push(this.readDouble());var u=Cr(this);for(a=a||[];this.pos<u;)a.push(this.readDouble());return a},readPackedFixed32:function(a){if(this.type!==kt.Bytes)return a.push(this.readFixed32());var u=Cr(this);for(a=a||[];this.pos<u;)a.push(this.readFixed32());return a},readPackedSFixed32:function(a){if(this.type!==kt.Bytes)return a.push(this.readSFixed32());var u=Cr(this);for(a=a||[];this.pos<u;)a.push(this.readSFixed32());return a},readPackedFixed64:function(a){if(this.type!==kt.Bytes)return a.push(this.readFixed64());var u=Cr(this);for(a=a||[];this.pos<u;)a.push(this.readFixed64());return a},readPackedSFixed64:function(a){if(this.type!==kt.Bytes)return a.push(this.readSFixed64());var u=Cr(this);for(a=a||[];this.pos<u;)a.push(this.readSFixed64());return a},skip:function(a){var u=7&a;if(u===kt.Varint)for(;this.buf[this.pos++]>127;);else if(u===kt.Bytes)this.pos=this.readVarint()+this.pos;else if(u===kt.Fixed32)this.pos+=4;else{if(u!==kt.Fixed64)throw new Error("Unimplemented type: "+u);this.pos+=8}},writeTag:function(a,u){this.writeVarint(a<<3|u)},realloc:function(a){for(var u=this.length||16;u<this.pos+a;)u*=2;if(u!==this.length){var c=new Uint8Array(u);c.set(this.buf),this.buf=c,this.length=u}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(a){this.realloc(4),Pr(this.buf,a,this.pos),this.pos+=4},writeSFixed32:function(a){this.realloc(4),Pr(this.buf,a,this.pos),this.pos+=4},writeFixed64:function(a){this.realloc(8),Pr(this.buf,-1&a,this.pos),Pr(this.buf,Math.floor(a*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(a){this.realloc(8),Pr(this.buf,-1&a,this.pos),Pr(this.buf,Math.floor(a*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(a){(a=+a||0)>268435455||a<0?function(u,c){var m,x;if(u>=0?(m=u%4294967296|0,x=u/4294967296|0):(x=~(-u/4294967296),4294967295^(m=~(-u%4294967296))?m=m+1|0:(m=0,x=x+1|0)),u>=18446744073709552e3||u<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");c.realloc(10),function(E,A,I){I.buf[I.pos++]=127&E|128,E>>>=7,I.buf[I.pos++]=127&E|128,E>>>=7,I.buf[I.pos++]=127&E|128,E>>>=7,I.buf[I.pos++]=127&E|128,I.buf[I.pos]=127&(E>>>=7)}(m,0,c),function(E,A){var I=(7&E)<<4;A.buf[A.pos++]|=I|((E>>>=3)?128:0),E&&(A.buf[A.pos++]=127&E|((E>>>=7)?128:0),E&&(A.buf[A.pos++]=127&E|((E>>>=7)?128:0),E&&(A.buf[A.pos++]=127&E|((E>>>=7)?128:0),E&&(A.buf[A.pos++]=127&E|((E>>>=7)?128:0),E&&(A.buf[A.pos++]=127&E)))))}(x,c)}(a,this):(this.realloc(4),this.buf[this.pos++]=127&a|(a>127?128:0),a<=127||(this.buf[this.pos++]=127&(a>>>=7)|(a>127?128:0),a<=127||(this.buf[this.pos++]=127&(a>>>=7)|(a>127?128:0),a<=127||(this.buf[this.pos++]=a>>>7&127))))},writeSVarint:function(a){this.writeVarint(a<0?2*-a-1:2*a)},writeBoolean:function(a){this.writeVarint(!!a)},writeString:function(a){a=String(a),this.realloc(4*a.length),this.pos++;var u=this.pos;this.pos=function(m,x,E){for(var A,I,D=0;D<x.length;D++){if((A=x.charCodeAt(D))>55295&&A<57344){if(!I){A>56319||D+1===x.length?(m[E++]=239,m[E++]=191,m[E++]=189):I=A;continue}if(A<56320){m[E++]=239,m[E++]=191,m[E++]=189,I=A;continue}A=I-55296<<10|A-56320|65536,I=null}else I&&(m[E++]=239,m[E++]=191,m[E++]=189,I=null);A<128?m[E++]=A:(A<2048?m[E++]=A>>6|192:(A<65536?m[E++]=A>>12|224:(m[E++]=A>>18|240,m[E++]=A>>12&63|128),m[E++]=A>>6&63|128),m[E++]=63&A|128)}return E}(this.buf,a,this.pos);var c=this.pos-u;c>=128&&Br(u,c,this),this.pos=u-1,this.writeVarint(c),this.pos+=c},writeFloat:function(a){this.realloc(4),pr(this.buf,a,this.pos,!0,23,4),this.pos+=4},writeDouble:function(a){this.realloc(8),pr(this.buf,a,this.pos,!0,52,8),this.pos+=8},writeBytes:function(a){var u=a.length;this.writeVarint(u),this.realloc(u);for(var c=0;c<u;c++)this.buf[this.pos++]=a[c]},writeRawMessage:function(a,u){this.pos++;var c=this.pos;a(u,this);var m=this.pos-c;m>=128&&Br(c,m,this),this.pos=c-1,this.writeVarint(m),this.pos+=m},writeMessage:function(a,u,c){this.writeTag(a,kt.Bytes),this.writeRawMessage(u,c)},writePackedVarint:function(a,u){u.length&&this.writeMessage(a,Ur,u)},writePackedSVarint:function(a,u){u.length&&this.writeMessage(a,Gr,u)},writePackedBoolean:function(a,u){u.length&&this.writeMessage(a,Tt,u)},writePackedFloat:function(a,u){u.length&&this.writeMessage(a,Ar,u)},writePackedDouble:function(a,u){u.length&&this.writeMessage(a,zr,u)},writePackedFixed32:function(a,u){u.length&&this.writeMessage(a,er,u)},writePackedSFixed32:function(a,u){u.length&&this.writeMessage(a,Fr,u)},writePackedFixed64:function(a,u){u.length&&this.writeMessage(a,rn,u)},writePackedSFixed64:function(a,u){u.length&&this.writeMessage(a,yr,u)},writeBytesField:function(a,u){this.writeTag(a,kt.Bytes),this.writeBytes(u)},writeFixed32Field:function(a,u){this.writeTag(a,kt.Fixed32),this.writeFixed32(u)},writeSFixed32Field:function(a,u){this.writeTag(a,kt.Fixed32),this.writeSFixed32(u)},writeFixed64Field:function(a,u){this.writeTag(a,kt.Fixed64),this.writeFixed64(u)},writeSFixed64Field:function(a,u){this.writeTag(a,kt.Fixed64),this.writeSFixed64(u)},writeVarintField:function(a,u){this.writeTag(a,kt.Varint),this.writeVarint(u)},writeSVarintField:function(a,u){this.writeTag(a,kt.Varint),this.writeSVarint(u)},writeStringField:function(a,u){this.writeTag(a,kt.Bytes),this.writeString(u)},writeFloatField:function(a,u){this.writeTag(a,kt.Fixed32),this.writeFloat(u)},writeDoubleField:function(a,u){this.writeTag(a,kt.Fixed64),this.writeDouble(u)},writeBooleanField:function(a,u){this.writeVarintField(a,!!u)}};var Qr=function(a,u){var c=u.pixelRatio,m=u.version,x=u.stretchX,E=u.stretchY,A=u.content;this.paddedRect=a,this.pixelRatio=c,this.stretchX=x,this.stretchY=E,this.content=A,this.version=m},yt={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};yt.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},yt.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},yt.tlbr.get=function(){return this.tl.concat(this.br)},yt.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Qr.prototype,yt);var vr=function(a,u){var c={},m={};this.haveRenderCallbacks=[];var x=[];this.addImages(a,c,x),this.addImages(u,m,x);var E=ui(x),A=new Qo({width:E.w||1,height:E.h||1});for(var I in a){var D=a[I],N=c[I].paddedRect;Qo.copy(D.data,A,{x:0,y:0},{x:N.x+1,y:N.y+1},D.data)}for(var H in u){var X=u[H],ne=m[H].paddedRect,R=ne.x+1,Pe=ne.y+1,Be=X.data.width,rt=X.data.height;Qo.copy(X.data,A,{x:0,y:0},{x:R,y:Pe},X.data),Qo.copy(X.data,A,{x:0,y:rt-1},{x:R,y:Pe-1},{width:Be,height:1}),Qo.copy(X.data,A,{x:0,y:0},{x:R,y:Pe+rt},{width:Be,height:1}),Qo.copy(X.data,A,{x:Be-1,y:0},{x:R-1,y:Pe},{width:1,height:rt}),Qo.copy(X.data,A,{x:0,y:0},{x:R+Be,y:Pe},{width:1,height:rt})}this.image=A,this.iconPositions=c,this.patternPositions=m};vr.prototype.addImages=function(a,u,c){for(var m in a){var x=a[m],E={x:0,y:0,w:x.data.width+2,h:x.data.height+2};c.push(E),u[m]=new Qr(E,x),x.hasRenderCallback&&this.haveRenderCallbacks.push(m)}},vr.prototype.patchUpdatedImages=function(a,u){for(var c in a.dispatchRenderCallbacks(this.haveRenderCallbacks),a.updatedImages)this.patchUpdatedImage(this.iconPositions[c],a.getImage(c),u),this.patchUpdatedImage(this.patternPositions[c],a.getImage(c),u)},vr.prototype.patchUpdatedImage=function(a,u,c){if(a&&u&&a.version!==u.version){a.version=u.version;var m=a.tl;c.update(u.data,void 0,{x:m[0],y:m[1]})}},_n("ImagePosition",Qr),_n("ImageAtlas",vr);var ot={horizontal:1,vertical:2,horizontalOnly:3},Ci=function(){this.scale=1,this.fontStack="",this.imageName=null};Ci.forText=function(a,u){var c=new Ci;return c.scale=a||1,c.fontStack=u,c},Ci.forImage=function(a){var u=new Ci;return u.imageName=a,u};var ln=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function yi(a,u,c,m,x,E,A,I,D,N,H,X,ne,R,Pe,Be){var rt,Ge=ln.fromFeature(a,x);X===ot.vertical&&Ge.verticalizePunctuation();var St=Fe.processBidirectionalText,Ft=Fe.processStyledBidirectionalText;if(St&&Ge.sections.length===1){rt=[];for(var Yt=0,qt=St(Ge.toString(),fo(Ge,N,E,u,m,R,Pe));Yt<qt.length;Yt+=1){var dr=qt[Yt],Lr=new ln;Lr.text=dr,Lr.sections=Ge.sections;for(var Xr=0;Xr<dr.length;Xr++)Lr.sectionIndex.push(0);rt.push(Lr)}}else if(Ft){rt=[];for(var Bn=0,cn=Ft(Ge.text,Ge.sectionIndex,fo(Ge,N,E,u,m,R,Pe));Bn<cn.length;Bn+=1){var Vn=cn[Bn],pn=new ln;pn.text=Vn[0],pn.sectionIndex=Vn[1],pn.sections=Ge.sections,rt.push(pn)}}else rt=function(Rn,Di){for(var gi=[],Ui=Rn.text,jn=0,ia=0,za=Di;ia<za.length;ia+=1){var eo=za[ia];gi.push(Rn.substring(jn,eo)),jn=eo}return jn<Ui.length&&gi.push(Rn.substring(jn,Ui.length)),gi}(Ge,fo(Ge,N,E,u,m,R,Pe));var Ei=[],ti={positionedLines:Ei,text:Ge.toString(),top:H[1],bottom:H[1],left:H[0],right:H[0],writingMode:X,iconsInText:!1,verticalizable:!1};return function(Rn,Di,gi,Ui,jn,ia,za,eo,uo,Za,ho,Go){for(var Uo=0,Vs=-17,ka=0,js=0,So=eo==="right"?1:eo==="left"?0:.5,rs=0,ji=0,fa=jn;ji<fa.length;ji+=1){var va=fa[ji];va.trim();var $i=va.getMaxScale(),Hs=24*($i-1),ns={positionedGlyphs:[],lineOffset:0};Rn.positionedLines[rs]=ns;var Ba=ns.positionedGlyphs,Oo=0;if(va.length()){for(var ws=0;ws<va.length();ws++){var Ki=va.getSection(ws),Zl=va.getSectionIndex(ws),su=va.getCharCode(ws),vl=0,to=null,Vl=null,$u=null,Ef=24,pc=!(uo===ot.horizontal||!ho&&!Dc(su)||ho&&(si[su]||(Hc=su,qr.Arabic(Hc)||qr["Arabic Supplement"](Hc)||qr["Arabic Extended-A"](Hc)||qr["Arabic Presentation Forms-A"](Hc)||qr["Arabic Presentation Forms-B"](Hc))));if(Ki.imageName){var Cs=Ui[Ki.imageName];if(!Cs)continue;$u=Ki.imageName,Rn.iconsInText=Rn.iconsInText||!0,Vl=Cs.paddedRect;var dc=Cs.displaySize;Ki.scale=24*Ki.scale/Go,vl=Hs+(24-dc[1]*Ki.scale),Ef=(to={width:dc[0],height:dc[1],left:1,top:-3,advance:pc?dc[1]:dc[0]}).advance;var Jf=pc?dc[0]*Ki.scale-24*$i:dc[1]*Ki.scale-24*$i;Jf>0&&Jf>Oo&&(Oo=Jf)}else{var vc=gi[Ki.fontStack],Ep=vc&&vc[su];if(Ep&&Ep.rect)Vl=Ep.rect,to=Ep.metrics;else{var ed=Di[Ki.fontStack],Xd=ed&&ed[su];if(!Xd)continue;to=Xd.metrics}vl=24*($i-Ki.scale)}pc?(Rn.verticalizable=!0,Ba.push({glyph:su,imageName:$u,x:Uo,y:Vs+vl,vertical:pc,scale:Ki.scale,fontStack:Ki.fontStack,sectionIndex:Zl,metrics:to,rect:Vl}),Uo+=Ef*Ki.scale+Za):(Ba.push({glyph:su,imageName:$u,x:Uo,y:Vs+vl,vertical:pc,scale:Ki.scale,fontStack:Ki.fontStack,sectionIndex:Zl,metrics:to,rect:Vl}),Uo+=to.advance*Ki.scale+Za)}Ba.length!==0&&(ka=Math.max(Uo-Za,ka),yo(Ba,0,Ba.length-1,So,Oo)),Uo=0;var td=ia*$i+Oo;ns.lineOffset=Math.max(Oo,Hs),Vs+=td,js=Math.max(td,js),++rs}else Vs+=ia,++rs}var Hc,Sf=Vs- -17,Sp=Sa(za),eh=Sp.horizontalAlign,Ap=Sp.verticalAlign;(function(rd,$d,nd,id,Wc,kh,th,Bh,rh){var nh,Tp=($d-nd)*Wc;nh=kh!==th?-Bh*id- -17:(-id*rh+.5)*th;for(var Gc=0,Lh=rd;Gc<Lh.length;Gc+=1)for(var mc=0,ih=Lh[Gc].positionedGlyphs;mc<ih.length;mc+=1){var xu=ih[mc];xu.x+=Tp,xu.y+=nh}})(Rn.positionedLines,So,eh,Ap,ka,js,ia,Sf,jn.length),Rn.top+=-Ap*Sf,Rn.bottom=Rn.top+Sf,Rn.left+=-eh*ka,Rn.right=Rn.left+ka}(ti,u,c,m,rt,A,I,D,X,N,ne,Be),!function(Rn){for(var Di=0,gi=Rn;Di<gi.length;Di+=1)if(gi[Di].positionedGlyphs.length!==0)return!1;return!0}(Ei)&&ti}ln.fromFeature=function(a,u){for(var c=new ln,m=0;m<a.sections.length;m++){var x=a.sections[m];x.image?c.addImageSection(x):c.addTextSection(x,u)}return c},ln.prototype.length=function(){return this.text.length},ln.prototype.getSection=function(a){return this.sections[this.sectionIndex[a]]},ln.prototype.getSectionIndex=function(a){return this.sectionIndex[a]},ln.prototype.getCharCode=function(a){return this.text.charCodeAt(a)},ln.prototype.verticalizePunctuation=function(){this.text=function(a){for(var u="",c=0;c<a.length;c++){var m=a.charCodeAt(c+1)||null,x=a.charCodeAt(c-1)||null;u+=m&&wh(m)&&!je[a[c+1]]||x&&wh(x)&&!je[a[c-1]]||!je[a[c]]?a[c]:je[a[c]]}return u}(this.text)},ln.prototype.trim=function(){for(var a=0,u=0;u<this.text.length&&si[this.text.charCodeAt(u)];u++)a++;for(var c=this.text.length,m=this.text.length-1;m>=0&&m>=a&&si[this.text.charCodeAt(m)];m--)c--;this.text=this.text.substring(a,c),this.sectionIndex=this.sectionIndex.slice(a,c)},ln.prototype.substring=function(a,u){var c=new ln;return c.text=this.text.substring(a,u),c.sectionIndex=this.sectionIndex.slice(a,u),c.sections=this.sections,c},ln.prototype.toString=function(){return this.text},ln.prototype.getMaxScale=function(){var a=this;return this.sectionIndex.reduce(function(u,c){return Math.max(u,a.sections[c].scale)},0)},ln.prototype.addTextSection=function(a,u){this.text+=a.text,this.sections.push(Ci.forText(a.scale,a.fontStack||u));for(var c=this.sections.length-1,m=0;m<a.text.length;++m)this.sectionIndex.push(c)},ln.prototype.addImageSection=function(a){var u=a.image?a.image.name:"";if(u.length!==0){var c=this.getNextImageSectionCharCode();c?(this.text+=String.fromCharCode(c),this.sections.push(Ci.forImage(u)),this.sectionIndex.push(this.sections.length-1)):qe("Reached maximum number of images 6401")}else qe("Can't add FormattedSection with an empty image.")},ln.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var si={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Qn={};function Vi(a,u,c,m,x,E){if(u.imageName){var A=m[u.imageName];return A?A.displaySize[0]*u.scale*24/E+x:0}var I=c[u.fontStack],D=I&&I[a];return D?D.metrics.advance*u.scale+x:0}function _o(a,u,c,m){var x=Math.pow(a-u,2);return m?a<u?x/2:2*x:x+Math.abs(c)*c}function Wo(a,u,c){var m=0;return a===10&&(m-=1e4),c&&(m+=150),a!==40&&a!==65288||(m+=50),u!==41&&u!==65289||(m+=50),m}function Pi(a,u,c,m,x,E){for(var A=null,I=_o(u,c,x,E),D=0,N=m;D<N.length;D+=1){var H=N[D],X=_o(u-H.x,c,x,E)+H.badness;X<=I&&(A=H,I=X)}return{index:a,x:u,priorBreak:A,badness:I}}function fo(a,u,c,m,x,E,A){if(E!=="point")return[];if(!a)return[];for(var I,D=[],N=function(rt,Ge,St,Ft,Yt,qt){for(var dr=0,Lr=0;Lr<rt.length();Lr++){var Xr=rt.getSection(Lr);dr+=Vi(rt.getCharCode(Lr),Xr,Ft,Yt,Ge,qt)}return dr/Math.max(1,Math.ceil(dr/St))}(a,u,c,m,x,A),H=a.text.indexOf("\u200B")>=0,X=0,ne=0;ne<a.length();ne++){var R=a.getSection(ne),Pe=a.getCharCode(ne);if(si[Pe]||(X+=Vi(Pe,R,m,x,u,A)),ne<a.length()-1){var Be=!((I=Pe)<11904||!(qr["Bopomofo Extended"](I)||qr.Bopomofo(I)||qr["CJK Compatibility Forms"](I)||qr["CJK Compatibility Ideographs"](I)||qr["CJK Compatibility"](I)||qr["CJK Radicals Supplement"](I)||qr["CJK Strokes"](I)||qr["CJK Symbols and Punctuation"](I)||qr["CJK Unified Ideographs Extension A"](I)||qr["CJK Unified Ideographs"](I)||qr["Enclosed CJK Letters and Months"](I)||qr["Halfwidth and Fullwidth Forms"](I)||qr.Hiragana(I)||qr["Ideographic Description Characters"](I)||qr["Kangxi Radicals"](I)||qr["Katakana Phonetic Extensions"](I)||qr.Katakana(I)||qr["Vertical Forms"](I)||qr["Yi Radicals"](I)||qr["Yi Syllables"](I)));(Qn[Pe]||Be||R.imageName)&&D.push(Pi(ne+1,X,N,D,Wo(Pe,a.getCharCode(ne+1),Be&&H),!1))}}return function rt(Ge){return Ge?rt(Ge.priorBreak).concat(Ge.index):[]}(Pi(a.length(),X,N,D,0,!0))}function Sa(a){var u=.5,c=.5;switch(a){case"right":case"top-right":case"bottom-right":u=1;break;case"left":case"top-left":case"bottom-left":u=0}switch(a){case"bottom":case"bottom-right":case"bottom-left":c=1;break;case"top":case"top-right":case"top-left":c=0}return{horizontalAlign:u,verticalAlign:c}}function yo(a,u,c,m,x){if(m||x)for(var E=a[c],A=(a[c].x+E.metrics.advance*E.scale)*m,I=u;I<=c;I++)a[I].x-=A,a[I].y+=x}function xo(a,u,c,m,x,E){var A,I=a.image;if(I.content){var D=I.content,N=I.pixelRatio||1;A=[D[0]/N,D[1]/N,I.displaySize[0]-D[2]/N,I.displaySize[1]-D[3]/N]}var H,X,ne,R,Pe=u.left*E,Be=u.right*E;c==="width"||c==="both"?(R=x[0]+Pe-m[3],X=x[0]+Be+m[1]):X=(R=x[0]+(Pe+Be-I.displaySize[0])/2)+I.displaySize[0];var rt=u.top*E,Ge=u.bottom*E;return c==="height"||c==="both"?(H=x[1]+rt-m[0],ne=x[1]+Ge+m[2]):ne=(H=x[1]+(rt+Ge-I.displaySize[1])/2)+I.displaySize[1],{image:I,top:H,right:X,bottom:ne,left:R,collisionPadding:A}}Qn[10]=!0,Qn[32]=!0,Qn[38]=!0,Qn[40]=!0,Qn[41]=!0,Qn[43]=!0,Qn[45]=!0,Qn[47]=!0,Qn[173]=!0,Qn[183]=!0,Qn[8203]=!0,Qn[8208]=!0,Qn[8211]=!0,Qn[8231]=!0;var Ja=function(a){function u(c,m,x,E){a.call(this,c,m),this.angle=x,E!==void 0&&(this.segment=E)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.clone=function(){return new u(this.x,this.y,this.angle,this.segment)},u}(se);function Mo(a,u){var c=u.expression;if(c.kind==="constant")return{kind:"constant",layoutSize:c.evaluate(new B(a+1))};if(c.kind==="source")return{kind:"source"};for(var m=c.zoomStops,x=c.interpolationType,E=0;E<m.length&&m[E]<=a;)E++;for(var A=E=Math.max(0,E-1);A<m.length&&m[A]<a+1;)A++;A=Math.min(m.length-1,A);var I=m[E],D=m[A];return c.kind==="composite"?{kind:"composite",minZoom:I,maxZoom:D,interpolationType:x}:{kind:"camera",minZoom:I,maxZoom:D,minSize:c.evaluate(new B(I)),maxSize:c.evaluate(new B(D)),interpolationType:x}}function ps(a,u,c){var m=u.uSize,x=c.lowerSize;return a.kind==="source"?x/128:a.kind==="composite"?qa(x/128,c.upperSize/128,u.uSizeT):m}function Io(a,u){var c=0,m=0;if(a.kind==="constant")m=a.layoutSize;else if(a.kind!=="source"){var x=a.interpolationType,E=x?wt(Ho.interpolationFactor(x,u,a.minZoom,a.maxZoom),0,1):0;a.kind==="camera"?m=qa(a.minSize,a.maxSize,E):c=E}return{uSizeT:c,uSize:m}}_n("Anchor",Ja);var xi=Object.freeze({__proto__:null,getSizeData:Mo,evaluateSizeForFeature:ps,evaluateSizeForZoom:Io,SIZE_PACK_FACTOR:128});function es(a,u,c,m,x){if(u.segment===void 0)return!0;for(var E=u,A=u.segment+1,I=0;I>-c/2;){if(--A<0)return!1;I-=a[A].dist(E),E=a[A]}I+=a[A].dist(a[A+1]),A++;for(var D=[],N=0;I<c/2;){var H=a[A],X=a[A+1];if(!X)return!1;var ne=a[A-1].angleTo(H)-H.angleTo(X);for(ne=Math.abs((ne+3*Math.PI)%(2*Math.PI)-Math.PI),D.push({distance:I,angleDelta:ne}),N+=ne;I-D[0].distance>m;)N-=D.shift().angleDelta;if(N>x)return!1;A++,I+=H.dist(X)}return!0}function ua(a){for(var u=0,c=0;c<a.length-1;c++)u+=a[c].dist(a[c+1]);return u}function Xn(a,u,c){return a?.6*u*c:0}function Oi(a,u){return Math.max(a?a.right-a.left:0,u?u.right-u.left:0)}function Xi(a,u,c,m,x,E){for(var A=Xn(c,x,E),I=Oi(c,m)*E,D=0,N=ua(a)/2,H=0;H<a.length-1;H++){var X=a[H],ne=a[H+1],R=X.dist(ne);if(D+R>N){var Pe=(N-D)/R,Be=qa(X.x,ne.x,Pe),rt=qa(X.y,ne.y,Pe),Ge=new Ja(Be,rt,ne.angleTo(X),H);return Ge._round(),!A||es(a,Ge,I,A,u)?Ge:void 0}D+=R}}function bo(a,u,c,m,x,E,A,I,D){var N=Xn(m,E,A),H=Oi(m,x),X=H*A,ne=a[0].x===0||a[0].x===D||a[0].y===0||a[0].y===D;return u-X<u/4&&(u=X+u/4),function R(Pe,Be,rt,Ge,St,Ft,Yt,qt,dr){for(var Lr=Ft/2,Xr=ua(Pe),Bn=0,cn=Be-rt,Vn=[],pn=0;pn<Pe.length-1;pn++){for(var Ei=Pe[pn],ti=Pe[pn+1],Rn=Ei.dist(ti),Di=ti.angleTo(Ei);cn+rt<Bn+Rn;){var gi=((cn+=rt)-Bn)/Rn,Ui=qa(Ei.x,ti.x,gi),jn=qa(Ei.y,ti.y,gi);if(Ui>=0&&Ui<dr&&jn>=0&&jn<dr&&cn-Lr>=0&&cn+Lr<=Xr){var ia=new Ja(Ui,jn,Di,pn);ia._round(),Ge&&!es(Pe,ia,Ft,Ge,St)||Vn.push(ia)}}Bn+=Rn}return qt||Vn.length||Yt||(Vn=R(Pe,Bn/2,rt,Ge,St,Ft,Yt,!0,dr)),Vn}(a,ne?u/2*I%u:(H/2+2*E)*A*I%u,u,N,c,X,ne,!1,D)}function Xu(a,u,c,m,x){for(var E=[],A=0;A<a.length;A++)for(var I=a[A],D=void 0,N=0;N<I.length-1;N++){var H=I[N],X=I[N+1];H.x<u&&X.x<u||(H.x<u?H=new se(u,H.y+(u-H.x)/(X.x-H.x)*(X.y-H.y))._round():X.x<u&&(X=new se(u,H.y+(u-H.x)/(X.x-H.x)*(X.y-H.y))._round()),H.y<c&&X.y<c||(H.y<c?H=new se(H.x+(c-H.y)/(X.y-H.y)*(X.x-H.x),c)._round():X.y<c&&(X=new se(H.x+(c-H.y)/(X.y-H.y)*(X.x-H.x),c)._round()),H.x>=m&&X.x>=m||(H.x>=m?H=new se(m,H.y+(m-H.x)/(X.x-H.x)*(X.y-H.y))._round():X.x>=m&&(X=new se(m,H.y+(m-H.x)/(X.x-H.x)*(X.y-H.y))._round()),H.y>=x&&X.y>=x||(H.y>=x?H=new se(H.x+(x-H.y)/(X.y-H.y)*(X.x-H.x),x)._round():X.y>=x&&(X=new se(H.x+(x-H.y)/(X.y-H.y)*(X.x-H.x),x)._round()),D&&H.equals(D[D.length-1])||E.push(D=[H]),D.push(X)))))}return E}function Ne(a,u,c,m){var x=[],E=a.image,A=E.pixelRatio,I=E.paddedRect.w-2,D=E.paddedRect.h-2,N=a.right-a.left,H=a.bottom-a.top,X=E.stretchX||[[0,I]],ne=E.stretchY||[[0,D]],R=function(Ui,jn){return Ui+jn[1]-jn[0]},Pe=X.reduce(R,0),Be=ne.reduce(R,0),rt=I-Pe,Ge=D-Be,St=0,Ft=Pe,Yt=0,qt=Be,dr=0,Lr=rt,Xr=0,Bn=Ge;if(E.content&&m){var cn=E.content;St=$t(X,0,cn[0]),Yt=$t(ne,0,cn[1]),Ft=$t(X,cn[0],cn[2]),qt=$t(ne,cn[1],cn[3]),dr=cn[0]-St,Xr=cn[1]-Yt,Lr=cn[2]-cn[0]-Ft,Bn=cn[3]-cn[1]-qt}var Vn=function(Ui,jn,ia,za){var eo=hn(Ui.stretch-St,Ft,N,a.left),uo=bi(Ui.fixed-dr,Lr,Ui.stretch,Pe),Za=hn(jn.stretch-Yt,qt,H,a.top),ho=bi(jn.fixed-Xr,Bn,jn.stretch,Be),Go=hn(ia.stretch-St,Ft,N,a.left),Uo=bi(ia.fixed-dr,Lr,ia.stretch,Pe),Vs=hn(za.stretch-Yt,qt,H,a.top),ka=bi(za.fixed-Xr,Bn,za.stretch,Be),js=new se(eo,Za),So=new se(Go,Za),rs=new se(Go,Vs),ji=new se(eo,Vs),fa=new se(uo/A,ho/A),va=new se(Uo/A,ka/A),$i=u*Math.PI/180;if($i){var Hs=Math.sin($i),ns=Math.cos($i),Ba=[ns,-Hs,Hs,ns];js._matMult(Ba),So._matMult(Ba),ji._matMult(Ba),rs._matMult(Ba)}var Oo=Ui.stretch+Ui.fixed,ws=jn.stretch+jn.fixed;return{tl:js,tr:So,bl:ji,br:rs,tex:{x:E.paddedRect.x+1+Oo,y:E.paddedRect.y+1+ws,w:ia.stretch+ia.fixed-Oo,h:za.stretch+za.fixed-ws},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:fa,pixelOffsetBR:va,minFontScaleX:Lr/A/N,minFontScaleY:Bn/A/H,isSDF:c}};if(m&&(E.stretchX||E.stretchY))for(var pn=Nt(X,rt,Pe),Ei=Nt(ne,Ge,Be),ti=0;ti<pn.length-1;ti++)for(var Rn=pn[ti],Di=pn[ti+1],gi=0;gi<Ei.length-1;gi++)x.push(Vn(Rn,Ei[gi],Di,Ei[gi+1]));else x.push(Vn({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:I+1},{fixed:0,stretch:D+1}));return x}function $t(a,u,c){for(var m=0,x=0,E=a;x<E.length;x+=1){var A=E[x];m+=Math.max(u,Math.min(c,A[1]))-Math.max(u,Math.min(c,A[0]))}return m}function Nt(a,u,c){for(var m=[{fixed:-1,stretch:0}],x=0,E=a;x<E.length;x+=1){var A=E[x],I=A[0],D=A[1],N=m[m.length-1];m.push({fixed:I-N.stretch,stretch:N.stretch}),m.push({fixed:I-N.stretch,stretch:N.stretch+(D-I)})}return m.push({fixed:u+1,stretch:c}),m}function hn(a,u,c,m){return a/u*c+m}function bi(a,u,c,m){return a-u*c/m}var da=function(a,u,c,m,x,E,A,I,D,N){if(this.boxStartIndex=a.length,D){var H=E.top,X=E.bottom,ne=E.collisionPadding;ne&&(H-=ne[1],X+=ne[3]);var R=X-H;R>0&&(R=Math.max(10,R),this.circleDiameter=R)}else{var Pe=E.top*A-I,Be=E.bottom*A+I,rt=E.left*A-I,Ge=E.right*A+I,St=E.collisionPadding;if(St&&(rt-=St[0]*A,Pe-=St[1]*A,Ge+=St[2]*A,Be+=St[3]*A),N){var Ft=new se(rt,Pe),Yt=new se(Ge,Pe),qt=new se(rt,Be),dr=new se(Ge,Be),Lr=N*Math.PI/180;Ft._rotate(Lr),Yt._rotate(Lr),qt._rotate(Lr),dr._rotate(Lr),rt=Math.min(Ft.x,Yt.x,qt.x,dr.x),Ge=Math.max(Ft.x,Yt.x,qt.x,dr.x),Pe=Math.min(Ft.y,Yt.y,qt.y,dr.y),Be=Math.max(Ft.y,Yt.y,qt.y,dr.y)}a.emplaceBack(u.x,u.y,rt,Pe,Ge,Be,c,m,x)}this.boxEndIndex=a.length},ce=function(a,u){if(a===void 0&&(a=[]),u===void 0&&(u=Te),this.data=a,this.length=this.data.length,this.compare=u,this.length>0)for(var c=(this.length>>1)-1;c>=0;c--)this._down(c)};function Te(a,u){return a<u?-1:a>u?1:0}function Ve(a,u,c){u===void 0&&(u=1),c===void 0&&(c=!1);for(var m=1/0,x=1/0,E=-1/0,A=-1/0,I=a[0],D=0;D<I.length;D++){var N=I[D];(!D||N.x<m)&&(m=N.x),(!D||N.y<x)&&(x=N.y),(!D||N.x>E)&&(E=N.x),(!D||N.y>A)&&(A=N.y)}var H=Math.min(E-m,A-x),X=H/2,ne=new ce([],Ut);if(H===0)return new se(m,x);for(var R=m;R<E;R+=H)for(var Pe=x;Pe<A;Pe+=H)ne.push(new Bt(R+X,Pe+X,X,a));for(var Be=function(St){for(var Ft=0,Yt=0,qt=0,dr=St[0],Lr=0,Xr=dr.length,Bn=Xr-1;Lr<Xr;Bn=Lr++){var cn=dr[Lr],Vn=dr[Bn],pn=cn.x*Vn.y-Vn.x*cn.y;Yt+=(cn.x+Vn.x)*pn,qt+=(cn.y+Vn.y)*pn,Ft+=3*pn}return new Bt(Yt/Ft,qt/Ft,0,St)}(a),rt=ne.length;ne.length;){var Ge=ne.pop();(Ge.d>Be.d||!Be.d)&&(Be=Ge,c&&console.log("found best %d after %d probes",Math.round(1e4*Ge.d)/1e4,rt)),Ge.max-Be.d<=u||(ne.push(new Bt(Ge.p.x-(X=Ge.h/2),Ge.p.y-X,X,a)),ne.push(new Bt(Ge.p.x+X,Ge.p.y-X,X,a)),ne.push(new Bt(Ge.p.x-X,Ge.p.y+X,X,a)),ne.push(new Bt(Ge.p.x+X,Ge.p.y+X,X,a)),rt+=4)}return c&&(console.log("num probes: "+rt),console.log("best distance: "+Be.d)),Be.p}function Ut(a,u){return u.max-a.max}function Bt(a,u,c,m){this.p=new se(a,u),this.h=c,this.d=function(x,E){for(var A=!1,I=1/0,D=0;D<E.length;D++)for(var N=E[D],H=0,X=N.length,ne=X-1;H<X;ne=H++){var R=N[H],Pe=N[ne];R.y>x.y!=Pe.y>x.y&&x.x<(Pe.x-R.x)*(x.y-R.y)/(Pe.y-R.y)+R.x&&(A=!A),I=Math.min(I,kl(x,R,Pe))}return(A?1:-1)*Math.sqrt(I)}(this.p,m),this.max=this.d+this.h*Math.SQRT2}ce.prototype.push=function(a){this.data.push(a),this.length++,this._up(this.length-1)},ce.prototype.pop=function(){if(this.length!==0){var a=this.data[0],u=this.data.pop();return this.length--,this.length>0&&(this.data[0]=u,this._down(0)),a}},ce.prototype.peek=function(){return this.data[0]},ce.prototype._up=function(a){for(var u=this.data,c=this.compare,m=u[a];a>0;){var x=a-1>>1,E=u[x];if(c(m,E)>=0)break;u[a]=E,a=x}u[a]=m},ce.prototype._down=function(a){for(var u=this.data,c=this.compare,m=this.length>>1,x=u[a];a<m;){var E=1+(a<<1),A=u[E],I=E+1;if(I<this.length&&c(u[I],A)<0&&(E=I,A=u[I]),c(A,x)>=0)break;u[a]=A,a=E}u[a]=x};var tt=Number.POSITIVE_INFINITY;function ft(a,u){return u[1]!==tt?function(c,m,x){var E=0,A=0;switch(m=Math.abs(m),x=Math.abs(x),c){case"top-right":case"top-left":case"top":A=x-7;break;case"bottom-right":case"bottom-left":case"bottom":A=7-x}switch(c){case"top-right":case"bottom-right":case"right":E=-m;break;case"top-left":case"bottom-left":case"left":E=m}return[E,A]}(a,u[0],u[1]):function(c,m){var x=0,E=0;m<0&&(m=0);var A=m/Math.sqrt(2);switch(c){case"top-right":case"top-left":E=A-7;break;case"bottom-right":case"bottom-left":E=7-A;break;case"bottom":E=7-m;break;case"top":E=m-7}switch(c){case"top-right":case"bottom-right":x=-A;break;case"top-left":case"bottom-left":x=A;break;case"left":x=m;break;case"right":x=-m}return[x,E]}(a,u[0])}function mt(a){switch(a){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function De(a,u,c,m,x,E,A,I,D,N,H,X,ne,R,Pe){var Be=function(Yt,qt,dr,Lr,Xr,Bn,cn,Vn){for(var pn=Lr.layout.get("text-rotate").evaluate(Bn,{})*Math.PI/180,Ei=[],ti=0,Rn=qt.positionedLines;ti<Rn.length;ti+=1)for(var Di=Rn[ti],gi=0,Ui=Di.positionedGlyphs;gi<Ui.length;gi+=1){var jn=Ui[gi];if(jn.rect){var ia=jn.rect||{},za=4,eo=!0,uo=1,Za=0,ho=(Xr||Vn)&&jn.vertical,Go=jn.metrics.advance*jn.scale/2;if(Vn&&qt.verticalizable&&(Za=Di.lineOffset/2-(jn.imageName?-(24-jn.metrics.width*jn.scale)/2:24*(jn.scale-1))),jn.imageName){var Uo=cn[jn.imageName];eo=Uo.sdf,za=1/(uo=Uo.pixelRatio)}var Vs=Xr?[jn.x+Go,jn.y]:[0,0],ka=Xr?[0,0]:[jn.x+Go+dr[0],jn.y+dr[1]-Za],js=[0,0];ho&&(js=ka,ka=[0,0]);var So=(jn.metrics.left-za)*jn.scale-Go+ka[0],rs=(-jn.metrics.top-za)*jn.scale+ka[1],ji=So+ia.w*jn.scale/uo,fa=rs+ia.h*jn.scale/uo,va=new se(So,rs),$i=new se(ji,rs),Hs=new se(So,fa),ns=new se(ji,fa);if(ho){var Ba=new se(-Go,Go- -17),Oo=-Math.PI/2,ws=12-Go,Ki=new se(22-ws,-(jn.imageName?ws:0)),Zl=new(Function.prototype.bind.apply(se,[null].concat(js)));va._rotateAround(Oo,Ba)._add(Ki)._add(Zl),$i._rotateAround(Oo,Ba)._add(Ki)._add(Zl),Hs._rotateAround(Oo,Ba)._add(Ki)._add(Zl),ns._rotateAround(Oo,Ba)._add(Ki)._add(Zl)}if(pn){var su=Math.sin(pn),vl=Math.cos(pn),to=[vl,-su,su,vl];va._matMult(to),$i._matMult(to),Hs._matMult(to),ns._matMult(to)}var Vl=new se(0,0),$u=new se(0,0);Ei.push({tl:va,tr:$i,bl:Hs,br:ns,tex:ia,writingMode:qt.writingMode,glyphOffset:Vs,sectionIndex:jn.sectionIndex,isSDF:eo,pixelOffsetTL:Vl,pixelOffsetBR:$u,minFontScaleX:0,minFontScaleY:0})}}return Ei}(0,c,I,x,E,A,m,a.allowVerticalPlacement),rt=a.textSizeData,Ge=null;rt.kind==="source"?(Ge=[128*x.layout.get("text-size").evaluate(A,{})])[0]>32640&&qe(a.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):rt.kind==="composite"&&((Ge=[128*R.compositeTextSizes[0].evaluate(A,{},Pe),128*R.compositeTextSizes[1].evaluate(A,{},Pe)])[0]>32640||Ge[1]>32640)&&qe(a.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),a.addSymbols(a.text,Be,Ge,I,E,A,N,u,D.lineStartIndex,D.lineLength,ne,Pe);for(var St=0,Ft=H;St<Ft.length;St+=1)X[Ft[St]]=a.text.placedSymbolArray.length-1;return 4*Be.length}function st(a){for(var u in a)return a[u];return null}function me(a,u,c,m){var x=a.compareText;if(u in x){for(var E=x[u],A=E.length-1;A>=0;A--)if(m.dist(E[A])<c)return!0}else x[u]=[];return x[u].push(m),!1}var lt=Ul.VectorTileFeature.types,Qt=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ur(a,u,c,m,x,E,A,I,D,N,H,X,ne){var R=I?Math.min(32640,Math.round(I[0])):0,Pe=I?Math.min(32640,Math.round(I[1])):0;a.emplaceBack(u,c,Math.round(32*m),Math.round(32*x),E,A,(R<<1)+(D?1:0),Pe,16*N,16*H,256*X,256*ne)}function xr(a,u,c){a.emplaceBack(u.x,u.y,c),a.emplaceBack(u.x,u.y,c),a.emplaceBack(u.x,u.y,c),a.emplaceBack(u.x,u.y,c)}function gr(a){for(var u=0,c=a.sections;u<c.length;u+=1)if(Nf(c[u].text))return!0;return!1}var Mr=function(a){this.layoutVertexArray=new Zf,this.indexArray=new zu,this.programConfigurations=a,this.segments=new _e,this.dynamicLayoutVertexArray=new kc,this.opacityVertexArray=new cf,this.placedSymbolArray=new g};Mr.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},Mr.prototype.upload=function(a,u,c,m){this.isEmpty()||(c&&(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,zv.members),this.indexBuffer=a.createIndexBuffer(this.indexArray,u),this.dynamicLayoutVertexBuffer=a.createVertexBuffer(this.dynamicLayoutVertexArray,Zv.members,!0),this.opacityVertexBuffer=a.createVertexBuffer(this.opacityVertexArray,Qt,!0),this.opacityVertexBuffer.itemSize=1),(c||m)&&this.programConfigurations.upload(a))},Mr.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},_n("SymbolBuffers",Mr);var On=function(a,u,c){this.layoutVertexArray=new a,this.layoutAttributes=u,this.indexArray=new c,this.segments=new _e,this.collisionVertexArray=new Uu};On.prototype.upload=function(a){this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=a.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=a.createVertexBuffer(this.collisionVertexArray,zd.members,!0)},On.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},_n("CollisionBuffers",On);var xn=function(a){this.collisionBoxArray=a.collisionBoxArray,this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(function(E){return E.id}),this.index=a.index,this.pixelRatio=a.pixelRatio,this.sourceLayerIndex=a.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=mo([]),this.placementViewportMatrix=mo([]);var u=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Mo(this.zoom,u["text-size"]),this.iconSizeData=Mo(this.zoom,u["icon-size"]);var c=this.layers[0].layout,m=c.get("symbol-sort-key"),x=c.get("symbol-z-order");this.canOverlap=c.get("text-allow-overlap")||c.get("icon-allow-overlap")||c.get("text-ignore-placement")||c.get("icon-ignore-placement"),this.sortFeaturesByKey=x!=="viewport-y"&&m.constantOr(1)!==void 0,this.sortFeaturesByY=(x==="viewport-y"||x==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,c.get("symbol-placement")==="point"&&(this.writingModes=c.get("text-writing-mode").map(function(E){return ot[E]})),this.stateDependentLayerIds=this.layers.filter(function(E){return E.isStateDependent()}).map(function(E){return E.id}),this.sourceID=a.sourceID};xn.prototype.createArrays=function(){this.text=new Mr(new Kn(this.layers,this.zoom,function(a){return/^text/.test(a)})),this.icon=new Mr(new Kn(this.layers,this.zoom,function(a){return/^icon/.test(a)})),this.glyphOffsetArray=new C,this.lineVertexArray=new P,this.symbolInstances=new w},xn.prototype.calculateGlyphDependencies=function(a,u,c,m,x){for(var E=0;E<a.length;E++)if(u[a.charCodeAt(E)]=!0,(c||m)&&x){var A=je[a.charAt(E)];A&&(u[A.charCodeAt(0)]=!0)}},xn.prototype.populate=function(a,u,c){var m=this.layers[0],x=m.layout,E=x.get("text-font"),A=x.get("text-field"),I=x.get("icon-image"),D=(A.value.kind!=="constant"||A.value.value instanceof ma&&!A.value.value.isEmpty()||A.value.value.toString().length>0)&&(E.value.kind!=="constant"||E.value.value.length>0),N=I.value.kind!=="constant"||!!I.value.value||Object.keys(I.parameters).length>0,H=x.get("symbol-sort-key");if(this.features=[],D||N){for(var X=u.iconDependencies,ne=u.glyphDependencies,R=u.availableImages,Pe=new B(this.zoom),Be=0,rt=a;Be<rt.length;Be+=1){var Ge=rt[Be],St=Ge.feature,Ft=Ge.id,Yt=Ge.index,qt=Ge.sourceLayerIndex,dr=m._featureFilter.needGeometry,Lr=Xa(St,dr);if(m._featureFilter.filter(Pe,Lr,c)){dr||(Lr.geometry=Ga(St));var Xr=void 0;if(D){var Bn=m.getValueAndResolveTokens("text-field",Lr,c,R),cn=ma.factory(Bn);gr(cn)&&(this.hasRTLText=!0),(!this.hasRTLText||up()==="unavailable"||this.hasRTLText&&Fe.isParsed())&&(Xr=Ae(cn,m,Lr))}var Vn=void 0;if(N){var pn=m.getValueAndResolveTokens("icon-image",Lr,c,R);Vn=pn instanceof Aa?pn:Aa.fromString(pn)}if(Xr||Vn){var Ei=this.sortFeaturesByKey?H.evaluate(Lr,{},c):void 0;if(this.features.push({id:Ft,text:Xr,icon:Vn,index:Yt,sourceLayerIndex:qt,geometry:Lr.geometry,properties:St.properties,type:lt[St.type],sortKey:Ei}),Vn&&(X[Vn.name]=!0),Xr){var ti=E.evaluate(Lr,{},c).join(","),Rn=x.get("text-rotation-alignment")==="map"&&x.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ot.vertical)>=0;for(var Di=0,gi=Xr.sections;Di<gi.length;Di+=1){var Ui=gi[Di];if(Ui.image)X[Ui.image.name]=!0;else{var jn=ol(Xr.toString()),ia=Ui.fontStack||ti,za=ne[ia]=ne[ia]||{};this.calculateGlyphDependencies(Ui.text,za,Rn,this.allowVerticalPlacement,jn)}}}}}}x.get("symbol-placement")==="line"&&(this.features=function(eo){var uo={},Za={},ho=[],Go=0;function Uo(Ba){ho.push(eo[Ba]),Go++}function Vs(Ba,Oo,ws){var Ki=Za[Ba];return delete Za[Ba],Za[Oo]=Ki,ho[Ki].geometry[0].pop(),ho[Ki].geometry[0]=ho[Ki].geometry[0].concat(ws[0]),Ki}function ka(Ba,Oo,ws){var Ki=uo[Oo];return delete uo[Oo],uo[Ba]=Ki,ho[Ki].geometry[0].shift(),ho[Ki].geometry[0]=ws[0].concat(ho[Ki].geometry[0]),Ki}function js(Ba,Oo,ws){var Ki=ws?Oo[0][Oo[0].length-1]:Oo[0][0];return Ba+":"+Ki.x+":"+Ki.y}for(var So=0;So<eo.length;So++){var rs=eo[So],ji=rs.geometry,fa=rs.text?rs.text.toString():null;if(fa){var va=js(fa,ji),$i=js(fa,ji,!0);if(va in Za&&$i in uo&&Za[va]!==uo[$i]){var Hs=ka(va,$i,ji),ns=Vs(va,$i,ho[Hs].geometry);delete uo[va],delete Za[$i],Za[js(fa,ho[ns].geometry,!0)]=ns,ho[Hs].geometry=null}else va in Za?Vs(va,$i,ji):$i in uo?ka(va,$i,ji):(Uo(So),uo[va]=Go-1,Za[$i]=Go-1)}else Uo(So)}return ho.filter(function(Ba){return Ba.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(eo,uo){return eo.sortKey-uo.sortKey})}},xn.prototype.update=function(a,u,c){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(a,u,this.layers,c),this.icon.programConfigurations.updatePaintArrays(a,u,this.layers,c))},xn.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},xn.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},xn.prototype.upload=function(a){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(a),this.iconCollisionBox.upload(a)),this.text.upload(a,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(a,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},xn.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},xn.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},xn.prototype.addToLineVertexArray=function(a,u){var c=this.lineVertexArray.length;if(a.segment!==void 0){for(var m=a.dist(u[a.segment+1]),x=a.dist(u[a.segment]),E={},A=a.segment+1;A<u.length;A++)E[A]={x:u[A].x,y:u[A].y,tileUnitDistanceFromAnchor:m},A<u.length-1&&(m+=u[A+1].dist(u[A]));for(var I=a.segment||0;I>=0;I--)E[I]={x:u[I].x,y:u[I].y,tileUnitDistanceFromAnchor:x},I>0&&(x+=u[I-1].dist(u[I]));for(var D=0;D<u.length;D++){var N=E[D];this.lineVertexArray.emplaceBack(N.x,N.y,N.tileUnitDistanceFromAnchor)}}return{lineStartIndex:c,lineLength:this.lineVertexArray.length-c}},xn.prototype.addSymbols=function(a,u,c,m,x,E,A,I,D,N,H,X){for(var ne=a.indexArray,R=a.layoutVertexArray,Pe=a.segments.prepareSegment(4*u.length,R,ne,this.canOverlap?E.sortKey:void 0),Be=this.glyphOffsetArray.length,rt=Pe.vertexLength,Ge=this.allowVerticalPlacement&&A===ot.vertical?Math.PI/2:0,St=E.text&&E.text.sections,Ft=0;Ft<u.length;Ft++){var Yt=u[Ft],qt=Yt.tl,dr=Yt.tr,Lr=Yt.bl,Xr=Yt.br,Bn=Yt.tex,cn=Yt.pixelOffsetTL,Vn=Yt.pixelOffsetBR,pn=Yt.minFontScaleX,Ei=Yt.minFontScaleY,ti=Yt.glyphOffset,Rn=Yt.isSDF,Di=Yt.sectionIndex,gi=Pe.vertexLength,Ui=ti[1];ur(R,I.x,I.y,qt.x,Ui+qt.y,Bn.x,Bn.y,c,Rn,cn.x,cn.y,pn,Ei),ur(R,I.x,I.y,dr.x,Ui+dr.y,Bn.x+Bn.w,Bn.y,c,Rn,Vn.x,cn.y,pn,Ei),ur(R,I.x,I.y,Lr.x,Ui+Lr.y,Bn.x,Bn.y+Bn.h,c,Rn,cn.x,Vn.y,pn,Ei),ur(R,I.x,I.y,Xr.x,Ui+Xr.y,Bn.x+Bn.w,Bn.y+Bn.h,c,Rn,Vn.x,Vn.y,pn,Ei),xr(a.dynamicLayoutVertexArray,I,Ge),ne.emplaceBack(gi,gi+1,gi+2),ne.emplaceBack(gi+1,gi+2,gi+3),Pe.vertexLength+=4,Pe.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(ti[0]),Ft!==u.length-1&&Di===u[Ft+1].sectionIndex||a.programConfigurations.populatePaintArrays(R.length,E,E.index,{},X,St&&St[Di])}a.placedSymbolArray.emplaceBack(I.x,I.y,Be,this.glyphOffsetArray.length-Be,rt,D,N,I.segment,c?c[0]:0,c?c[1]:0,m[0],m[1],A,0,!1,0,H)},xn.prototype._addCollisionDebugVertex=function(a,u,c,m,x,E){return u.emplaceBack(0,0),a.emplaceBack(c.x,c.y,m,x,Math.round(E.x),Math.round(E.y))},xn.prototype.addCollisionDebugVertices=function(a,u,c,m,x,E,A){var I=x.segments.prepareSegment(4,x.layoutVertexArray,x.indexArray),D=I.vertexLength,N=x.layoutVertexArray,H=x.collisionVertexArray,X=A.anchorX,ne=A.anchorY;this._addCollisionDebugVertex(N,H,E,X,ne,new se(a,u)),this._addCollisionDebugVertex(N,H,E,X,ne,new se(c,u)),this._addCollisionDebugVertex(N,H,E,X,ne,new se(c,m)),this._addCollisionDebugVertex(N,H,E,X,ne,new se(a,m)),I.vertexLength+=4;var R=x.indexArray;R.emplaceBack(D,D+1),R.emplaceBack(D+1,D+2),R.emplaceBack(D+2,D+3),R.emplaceBack(D+3,D),I.primitiveLength+=4},xn.prototype.addDebugCollisionBoxes=function(a,u,c,m){for(var x=a;x<u;x++){var E=this.collisionBoxArray.get(x);this.addCollisionDebugVertices(E.x1,E.y1,E.x2,E.y2,m?this.textCollisionBox:this.iconCollisionBox,E.anchorPoint,c)}},xn.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new On(ac,Zd.members,ff),this.iconCollisionBox=new On(ac,Zd.members,ff);for(var a=0;a<this.symbolInstances.length;a++){var u=this.symbolInstances.get(a);this.addDebugCollisionBoxes(u.textBoxStartIndex,u.textBoxEndIndex,u,!0),this.addDebugCollisionBoxes(u.verticalTextBoxStartIndex,u.verticalTextBoxEndIndex,u,!0),this.addDebugCollisionBoxes(u.iconBoxStartIndex,u.iconBoxEndIndex,u,!1),this.addDebugCollisionBoxes(u.verticalIconBoxStartIndex,u.verticalIconBoxEndIndex,u,!1)}},xn.prototype._deserializeCollisionBoxesForSymbol=function(a,u,c,m,x,E,A,I,D){for(var N={},H=u;H<c;H++){var X=a.get(H);N.textBox={x1:X.x1,y1:X.y1,x2:X.x2,y2:X.y2,anchorPointX:X.anchorPointX,anchorPointY:X.anchorPointY},N.textFeatureIndex=X.featureIndex;break}for(var ne=m;ne<x;ne++){var R=a.get(ne);N.verticalTextBox={x1:R.x1,y1:R.y1,x2:R.x2,y2:R.y2,anchorPointX:R.anchorPointX,anchorPointY:R.anchorPointY},N.verticalTextFeatureIndex=R.featureIndex;break}for(var Pe=E;Pe<A;Pe++){var Be=a.get(Pe);N.iconBox={x1:Be.x1,y1:Be.y1,x2:Be.x2,y2:Be.y2,anchorPointX:Be.anchorPointX,anchorPointY:Be.anchorPointY},N.iconFeatureIndex=Be.featureIndex;break}for(var rt=I;rt<D;rt++){var Ge=a.get(rt);N.verticalIconBox={x1:Ge.x1,y1:Ge.y1,x2:Ge.x2,y2:Ge.y2,anchorPointX:Ge.anchorPointX,anchorPointY:Ge.anchorPointY},N.verticalIconFeatureIndex=Ge.featureIndex;break}return N},xn.prototype.deserializeCollisionBoxes=function(a){this.collisionArrays=[];for(var u=0;u<this.symbolInstances.length;u++){var c=this.symbolInstances.get(u);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(a,c.textBoxStartIndex,c.textBoxEndIndex,c.verticalTextBoxStartIndex,c.verticalTextBoxEndIndex,c.iconBoxStartIndex,c.iconBoxEndIndex,c.verticalIconBoxStartIndex,c.verticalIconBoxEndIndex))}},xn.prototype.hasTextData=function(){return this.text.segments.get().length>0},xn.prototype.hasIconData=function(){return this.icon.segments.get().length>0},xn.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},xn.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},xn.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},xn.prototype.addIndicesForPlacedSymbol=function(a,u){for(var c=a.placedSymbolArray.get(u),m=c.vertexStartIndex+4*c.numGlyphs,x=c.vertexStartIndex;x<m;x+=4)a.indexArray.emplaceBack(x,x+1,x+2),a.indexArray.emplaceBack(x+1,x+2,x+3)},xn.prototype.getSortedSymbolIndexes=function(a){if(this.sortedAngle===a&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var u=Math.sin(a),c=Math.cos(a),m=[],x=[],E=[],A=0;A<this.symbolInstances.length;++A){E.push(A);var I=this.symbolInstances.get(A);m.push(0|Math.round(u*I.anchorX+c*I.anchorY)),x.push(I.featureIndex)}return E.sort(function(D,N){return m[D]-m[N]||x[N]-x[D]}),E},xn.prototype.addToSortKeyRanges=function(a,u){var c=this.sortKeyRanges[this.sortKeyRanges.length-1];c&&c.sortKey===u?c.symbolInstanceEnd=a+1:this.sortKeyRanges.push({sortKey:u,symbolInstanceStart:a,symbolInstanceEnd:a+1})},xn.prototype.sortFeatures=function(a){var u=this;if(this.sortFeaturesByY&&this.sortedAngle!==a&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(a),this.sortedAngle=a,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var c=0,m=this.symbolInstanceIndexes;c<m.length;c+=1){var x=this.symbolInstances.get(m[c]);this.featureSortOrder.push(x.featureIndex),[x.rightJustifiedTextSymbolIndex,x.centerJustifiedTextSymbolIndex,x.leftJustifiedTextSymbolIndex].forEach(function(E,A,I){E>=0&&I.indexOf(E)===A&&u.addIndicesForPlacedSymbol(u.text,E)}),x.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,x.verticalPlacedTextSymbolIndex),x.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,x.placedIconSymbolIndex),x.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,x.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},_n("SymbolBucket",xn,{omit:["layers","collisionBoxArray","features","compareText"]}),xn.MAX_GLYPHS=65535,xn.addDynamicAttributes=xr;var Tn=new Fa({"symbol-placement":new kn(j.layout_symbol["symbol-placement"]),"symbol-spacing":new kn(j.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new kn(j.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yn(j.layout_symbol["symbol-sort-key"]),"symbol-z-order":new kn(j.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new kn(j.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new kn(j.layout_symbol["icon-ignore-placement"]),"icon-optional":new kn(j.layout_symbol["icon-optional"]),"icon-rotation-alignment":new kn(j.layout_symbol["icon-rotation-alignment"]),"icon-size":new yn(j.layout_symbol["icon-size"]),"icon-text-fit":new kn(j.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new kn(j.layout_symbol["icon-text-fit-padding"]),"icon-image":new yn(j.layout_symbol["icon-image"]),"icon-rotate":new yn(j.layout_symbol["icon-rotate"]),"icon-padding":new kn(j.layout_symbol["icon-padding"]),"icon-keep-upright":new kn(j.layout_symbol["icon-keep-upright"]),"icon-offset":new yn(j.layout_symbol["icon-offset"]),"icon-anchor":new yn(j.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new kn(j.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new kn(j.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new kn(j.layout_symbol["text-rotation-alignment"]),"text-field":new yn(j.layout_symbol["text-field"]),"text-font":new yn(j.layout_symbol["text-font"]),"text-size":new yn(j.layout_symbol["text-size"]),"text-max-width":new yn(j.layout_symbol["text-max-width"]),"text-line-height":new kn(j.layout_symbol["text-line-height"]),"text-letter-spacing":new yn(j.layout_symbol["text-letter-spacing"]),"text-justify":new yn(j.layout_symbol["text-justify"]),"text-radial-offset":new yn(j.layout_symbol["text-radial-offset"]),"text-variable-anchor":new kn(j.layout_symbol["text-variable-anchor"]),"text-anchor":new yn(j.layout_symbol["text-anchor"]),"text-max-angle":new kn(j.layout_symbol["text-max-angle"]),"text-writing-mode":new kn(j.layout_symbol["text-writing-mode"]),"text-rotate":new yn(j.layout_symbol["text-rotate"]),"text-padding":new kn(j.layout_symbol["text-padding"]),"text-keep-upright":new kn(j.layout_symbol["text-keep-upright"]),"text-transform":new yn(j.layout_symbol["text-transform"]),"text-offset":new yn(j.layout_symbol["text-offset"]),"text-allow-overlap":new kn(j.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new kn(j.layout_symbol["text-ignore-placement"]),"text-optional":new kn(j.layout_symbol["text-optional"])}),$n={paint:new Fa({"icon-opacity":new yn(j.paint_symbol["icon-opacity"]),"icon-color":new yn(j.paint_symbol["icon-color"]),"icon-halo-color":new yn(j.paint_symbol["icon-halo-color"]),"icon-halo-width":new yn(j.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yn(j.paint_symbol["icon-halo-blur"]),"icon-translate":new kn(j.paint_symbol["icon-translate"]),"icon-translate-anchor":new kn(j.paint_symbol["icon-translate-anchor"]),"text-opacity":new yn(j.paint_symbol["text-opacity"]),"text-color":new yn(j.paint_symbol["text-color"],{runtimeType:Yr,getOverride:function(a){return a.textColor},hasOverride:function(a){return!!a.textColor}}),"text-halo-color":new yn(j.paint_symbol["text-halo-color"]),"text-halo-width":new yn(j.paint_symbol["text-halo-width"]),"text-halo-blur":new yn(j.paint_symbol["text-halo-blur"]),"text-translate":new kn(j.paint_symbol["text-translate"]),"text-translate-anchor":new kn(j.paint_symbol["text-translate-anchor"])}),layout:Tn},ii=function(a){this.type=a.property.overrides?a.property.overrides.runtimeType:sn,this.defaultValue=a};ii.prototype.evaluate=function(a){if(a.formattedSection){var u=this.defaultValue.property.overrides;if(u&&u.hasOverride(a.formattedSection))return u.getOverride(a.formattedSection)}return a.feature&&a.featureState?this.defaultValue.evaluate(a.feature,a.featureState):this.defaultValue.property.specification.default},ii.prototype.eachChild=function(a){this.defaultValue.isConstant()||a(this.defaultValue.value._styleExpression.expression)},ii.prototype.outputDefined=function(){return!1},ii.prototype.serialize=function(){return null},_n("FormatSectionOverride",ii,{omit:["defaultValue"]});var na=function(a){function u(c){a.call(this,c,$n)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.recalculate=function(c,m){if(a.prototype.recalculate.call(this,c,m),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var x=this.layout.get("text-writing-mode");if(x){for(var E=[],A=0,I=x;A<I.length;A+=1){var D=I[A];E.indexOf(D)<0&&E.push(D)}this.layout._values["text-writing-mode"]=E}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},u.prototype.getValueAndResolveTokens=function(c,m,x,E){var A=this.layout.get(c).evaluate(m,{},x,E),I=this._unevaluatedLayout._values[c];return I.isDataDriven()||Mc(I.value)||!A?A:function(D,N){return N.replace(/{([^{}]+)}/g,function(H,X){return X in D?String(D[X]):""})}(m.properties,A)},u.prototype.createBucket=function(c){return new xn(c)},u.prototype.queryRadius=function(){return 0},u.prototype.queryIntersectsFeature=function(){return!1},u.prototype._setPaintOverrides=function(){for(var c=0,m=$n.paint.overridableProperties;c<m.length;c+=1){var x=m[c];if(u.hasPaintOverride(this.layout,x)){var E,A=this.paint.get(x),I=new ii(A),D=new hu(I,A.property.specification);E=A.value.kind==="constant"||A.value.kind==="source"?new ec("source",D):new tc("composite",D,A.value.zoomStops,A.value._interpolationType),this.paint._values[x]=new Da(A.property,E,A.parameters)}}},u.prototype._handleOverridablePaintPropertyUpdate=function(c,m,x){return!(!this.layout||m.isDataDriven()||x.isDataDriven())&&u.hasPaintOverride(this.layout,c)},u.hasPaintOverride=function(c,m){var x=c.get("text-field"),E=$n.paint.properties[m],A=!1,I=function(H){for(var X=0,ne=H;X<ne.length;X+=1)if(E.overrides&&E.overrides.hasOverride(ne[X]))return void(A=!0)};if(x.value.kind==="constant"&&x.value.value instanceof ma)I(x.value.value.sections);else if(x.value.kind==="source"){var D=function(H){A||(H instanceof Oa&&Ta(H.value)===qi?I(H.value.sections):H instanceof $o?I(H.sections):H.eachChild(D))},N=x.value;N._styleExpression&&D(N._styleExpression.expression)}return A},u}(Ns),Eo={paint:new Fa({"background-color":new kn(j.paint_background["background-color"]),"background-pattern":new qo(j.paint_background["background-pattern"]),"background-opacity":new kn(j.paint_background["background-opacity"])})},dl=function(a){function u(c){a.call(this,c,Eo)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u}(Ns),mp={paint:new Fa({"raster-opacity":new kn(j.paint_raster["raster-opacity"]),"raster-hue-rotate":new kn(j.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new kn(j.paint_raster["raster-brightness-min"]),"raster-brightness-max":new kn(j.paint_raster["raster-brightness-max"]),"raster-saturation":new kn(j.paint_raster["raster-saturation"]),"raster-contrast":new kn(j.paint_raster["raster-contrast"]),"raster-resampling":new kn(j.paint_raster["raster-resampling"]),"raster-fade-duration":new kn(j.paint_raster["raster-fade-duration"])})},yu=function(a){function u(c){a.call(this,c,mp)}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u}(Ns),Vd=function(a){function u(c){a.call(this,c,{}),this.implementation=c}return a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u,u.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},u.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},u.prototype.recalculate=function(){},u.prototype.updateTransitions=function(){},u.prototype.hasTransition=function(){},u.prototype.serialize=function(){},u.prototype.onAdd=function(c){this.implementation.onAdd&&this.implementation.onAdd(c,c.painter.context.gl)},u.prototype.onRemove=function(c){this.implementation.onRemove&&this.implementation.onRemove(c,c.painter.context.gl)},u}(Ns),Zs={circle:fs,heatmap:Lc,hillshade:Bv,fill:Oh,"fill-extrusion":$p,line:Ud,symbol:na,background:dl,raster:yu},hc=ae.HTMLImageElement,Qp=ae.HTMLCanvasElement,ds=ae.HTMLVideoElement,eg=ae.ImageData,jd=ae.ImageBitmap,Yf=function(a,u,c,m){this.context=a,this.format=c,this.texture=a.gl.createTexture(),this.update(u,m)};Yf.prototype.update=function(a,u,c){var m=a.width,x=a.height,E=!(this.size&&this.size[0]===m&&this.size[1]===x||c),A=this.context,I=A.gl;if(this.useMipmap=!!(u&&u.useMipmap),I.bindTexture(I.TEXTURE_2D,this.texture),A.pixelStoreUnpackFlipY.set(!1),A.pixelStoreUnpack.set(1),A.pixelStoreUnpackPremultiplyAlpha.set(this.format===I.RGBA&&(!u||u.premultiply!==!1)),E)this.size=[m,x],a instanceof hc||a instanceof Qp||a instanceof ds||a instanceof eg||jd&&a instanceof jd?I.texImage2D(I.TEXTURE_2D,0,this.format,this.format,I.UNSIGNED_BYTE,a):I.texImage2D(I.TEXTURE_2D,0,this.format,m,x,0,this.format,I.UNSIGNED_BYTE,a.data);else{var D=c||{x:0,y:0},N=D.x,H=D.y;a instanceof hc||a instanceof Qp||a instanceof ds||a instanceof eg||jd&&a instanceof jd?I.texSubImage2D(I.TEXTURE_2D,0,N,H,I.RGBA,I.UNSIGNED_BYTE,a):I.texSubImage2D(I.TEXTURE_2D,0,N,H,m,x,I.RGBA,I.UNSIGNED_BYTE,a.data)}this.useMipmap&&this.isSizePowerOfTwo()&&I.generateMipmap(I.TEXTURE_2D)},Yf.prototype.bind=function(a,u,c){var m=this.context.gl;m.bindTexture(m.TEXTURE_2D,this.texture),c!==m.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(c=m.LINEAR),a!==this.filter&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,a),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,c||a),this.filter=a),u!==this.wrap&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,u),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,u),this.wrap=u)},Yf.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Yf.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Hd=function(a){var u=this;this._callback=a,this._triggered=!1,typeof MessageChannel!="undefined"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){u._triggered=!1,u._callback()})};Hd.prototype.trigger=function(){var a=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){a._triggered=!1,a._callback()},0))},Hd.prototype.remove=function(){delete this._channel,this._callback=function(){}};var gp=function(a,u,c){this.target=a,this.parent=u,this.mapId=c,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Tr(["receive","process"],this),this.invoker=new Hd(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=re()?a:ae};function tg(a,u,c){var m=2*Math.PI*6378137/256/Math.pow(2,c);return[a*m-2*Math.PI*6378137/2,u*m-2*Math.PI*6378137/2]}gp.prototype.send=function(a,u,c,m,x){var E=this;x===void 0&&(x=!1);var A=Math.round(1e18*Math.random()).toString(36).substring(0,10);c&&(this.callbacks[A]=c);var I=Me(this.globalScope)?void 0:[];return this.target.postMessage({id:A,type:a,hasCallback:!!c,targetMapId:m,mustQueue:x,sourceMapId:this.mapId,data:us(u,I)},I),{cancel:function(){c&&delete E.callbacks[A],E.target.postMessage({id:A,type:"<cancel>",targetMapId:m,sourceMapId:E.mapId})}}},gp.prototype.receive=function(a){var u=a.data,c=u.id;if(c&&(!u.targetMapId||this.mapId===u.targetMapId))if(u.type==="<cancel>"){delete this.tasks[c];var m=this.cancelCallbacks[c];delete this.cancelCallbacks[c],m&&m()}else re()||u.mustQueue?(this.tasks[c]=u,this.taskQueue.push(c),this.invoker.trigger()):this.processTask(c,u)},gp.prototype.process=function(){if(this.taskQueue.length){var a=this.taskQueue.shift(),u=this.tasks[a];delete this.tasks[a],this.taskQueue.length&&this.invoker.trigger(),u&&this.processTask(a,u)}},gp.prototype.processTask=function(a,u){var c=this;if(u.type==="<response>"){var m=this.callbacks[a];delete this.callbacks[a],m&&(u.error?m(ga(u.error)):m(null,ga(u.data)))}else{var x=!1,E=Me(this.globalScope)?void 0:[],A=u.hasCallback?function(H,X){x=!0,delete c.cancelCallbacks[a],c.target.postMessage({id:a,type:"<response>",sourceMapId:c.mapId,error:H?us(H):null,data:us(X,E)},E)}:function(H){x=!0},I=null,D=ga(u.data);if(this.parent[u.type])I=this.parent[u.type](u.sourceMapId,D,A);else if(this.parent.getWorkerSource){var N=u.type.split(".");I=this.parent.getWorkerSource(u.sourceMapId,N[0],D.source)[N[1]](D,A)}else A(new Error("Could not find function "+u.type));!x&&I&&I.cancel&&(this.cancelCallbacks[a]=I.cancel)}},gp.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var No=function(a,u){a&&(u?this.setSouthWest(a).setNorthEast(u):a.length===4?this.setSouthWest([a[0],a[1]]).setNorthEast([a[2],a[3]]):this.setSouthWest(a[0]).setNorthEast(a[1]))};No.prototype.setNorthEast=function(a){return this._ne=a instanceof $a?new $a(a.lng,a.lat):$a.convert(a),this},No.prototype.setSouthWest=function(a){return this._sw=a instanceof $a?new $a(a.lng,a.lat):$a.convert(a),this},No.prototype.extend=function(a){var u,c,m=this._sw,x=this._ne;if(a instanceof $a)u=a,c=a;else{if(!(a instanceof No))return Array.isArray(a)?a.length===4||a.every(Array.isArray)?this.extend(No.convert(a)):this.extend($a.convert(a)):this;if(c=a._ne,!(u=a._sw)||!c)return this}return m||x?(m.lng=Math.min(u.lng,m.lng),m.lat=Math.min(u.lat,m.lat),x.lng=Math.max(c.lng,x.lng),x.lat=Math.max(c.lat,x.lat)):(this._sw=new $a(u.lng,u.lat),this._ne=new $a(c.lng,c.lat)),this},No.prototype.getCenter=function(){return new $a((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},No.prototype.getSouthWest=function(){return this._sw},No.prototype.getNorthEast=function(){return this._ne},No.prototype.getNorthWest=function(){return new $a(this.getWest(),this.getNorth())},No.prototype.getSouthEast=function(){return new $a(this.getEast(),this.getSouth())},No.prototype.getWest=function(){return this._sw.lng},No.prototype.getSouth=function(){return this._sw.lat},No.prototype.getEast=function(){return this._ne.lng},No.prototype.getNorth=function(){return this._ne.lat},No.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},No.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},No.prototype.isEmpty=function(){return!(this._sw&&this._ne)},No.prototype.contains=function(a){var u=$a.convert(a),c=u.lng,m=u.lat,x=this._sw.lng<=c&&c<=this._ne.lng;return this._sw.lng>this._ne.lng&&(x=this._sw.lng>=c&&c>=this._ne.lng),this._sw.lat<=m&&m<=this._ne.lat&&x},No.convert=function(a){return!a||a instanceof No?a:new No(a)};var $a=function(a,u){if(isNaN(a)||isNaN(u))throw new Error("Invalid LngLat object: ("+a+", "+u+")");if(this.lng=+a,this.lat=+u,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};$a.prototype.wrap=function(){return new $a(Xt(this.lng,-180,180),this.lat)},$a.prototype.toArray=function(){return[this.lng,this.lat]},$a.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},$a.prototype.distanceTo=function(a){var u=Math.PI/180,c=this.lat*u,m=a.lat*u,x=Math.sin(c)*Math.sin(m)+Math.cos(c)*Math.cos(m)*Math.cos((a.lng-this.lng)*u);return 63710088e-1*Math.acos(Math.min(x,1))},$a.prototype.toBounds=function(a){a===void 0&&(a=0);var u=360*a/40075017,c=u/Math.cos(Math.PI/180*this.lat);return new No(new $a(this.lng-c,this.lat-u),new $a(this.lng+c,this.lat+u))},$a.convert=function(a){if(a instanceof $a)return a;if(Array.isArray(a)&&(a.length===2||a.length===3))return new $a(Number(a[0]),Number(a[1]));if(!Array.isArray(a)&&typeof a=="object"&&a!==null)return new $a(Number("lng"in a?a.lng:a.lon),Number(a.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Ni=2*Math.PI*63710088e-1;function ki(a){return Ni*Math.cos(a*Math.PI/180)}function Fh(a){return(180+a)/360}function Wd(a){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360)))/360}function rg(a,u){return a/ki(u)}function Gd(a){return 360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90}var qf=function(a,u,c){c===void 0&&(c=0),this.x=+a,this.y=+u,this.z=+c};qf.fromLngLat=function(a,u){u===void 0&&(u=0);var c=$a.convert(a);return new qf(Fh(c.lng),Wd(c.lat),rg(u,c.lat))},qf.prototype.toLngLat=function(){return new $a(360*this.x-180,Gd(this.y))},qf.prototype.toAltitude=function(){return this.z*ki(Gd(this.y))},qf.prototype.meterInMercatorCoordinateUnits=function(){return 1/Ni*(a=Gd(this.y),1/Math.cos(a*Math.PI/180));var a};var zl=function(a,u,c){this.z=a,this.x=u,this.y=c,this.key=_p(0,a,a,u,c)};zl.prototype.equals=function(a){return this.z===a.z&&this.x===a.x&&this.y===a.y},zl.prototype.url=function(a,u){var c,m,x,E,A,I=(m=this.y,x=this.z,E=tg(256*(c=this.x),256*(m=Math.pow(2,x)-m-1),x),A=tg(256*(c+1),256*(m+1),x),E[0]+","+E[1]+","+A[0]+","+A[1]),D=function(N,H,X){for(var ne,R="",Pe=N;Pe>0;Pe--)R+=(H&(ne=1<<Pe-1)?1:0)+(X&ne?2:0);return R}(this.z,this.x,this.y);return a[(this.x+this.y)%a.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(u==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",D).replace("{bbox-epsg-3857}",I)},zl.prototype.getTilePoint=function(a){var u=Math.pow(2,this.z);return new se(8192*(a.x*u-this.x),8192*(a.y*u-this.y))},zl.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Kf=function(a,u){this.wrap=a,this.canonical=u,this.key=_p(a,u.z,u.z,u.x,u.y)},Po=function(a,u,c,m,x){this.overscaledZ=a,this.wrap=u,this.canonical=new zl(c,+m,+x),this.key=_p(u,a,c,m,x)};function _p(a,u,c,m,x){(a*=2)<0&&(a=-1*a-1);var E=1<<c;return(E*E*a+E*x+m).toString(36)+c.toString(36)+u.toString(36)}Po.prototype.equals=function(a){return this.overscaledZ===a.overscaledZ&&this.wrap===a.wrap&&this.canonical.equals(a.canonical)},Po.prototype.scaledTo=function(a){var u=this.canonical.z-a;return a>this.canonical.z?new Po(a,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Po(a,this.wrap,a,this.canonical.x>>u,this.canonical.y>>u)},Po.prototype.calculateScaledKey=function(a,u){var c=this.canonical.z-a;return a>this.canonical.z?_p(this.wrap*+u,a,this.canonical.z,this.canonical.x,this.canonical.y):_p(this.wrap*+u,a,a,this.canonical.x>>c,this.canonical.y>>c)},Po.prototype.isChildOf=function(a){if(a.wrap!==this.wrap)return!1;var u=this.canonical.z-a.canonical.z;return a.overscaledZ===0||a.overscaledZ<this.overscaledZ&&a.canonical.x===this.canonical.x>>u&&a.canonical.y===this.canonical.y>>u},Po.prototype.children=function(a){if(this.overscaledZ>=a)return[new Po(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var u=this.canonical.z+1,c=2*this.canonical.x,m=2*this.canonical.y;return[new Po(u,this.wrap,u,c,m),new Po(u,this.wrap,u,c+1,m),new Po(u,this.wrap,u,c,m+1),new Po(u,this.wrap,u,c+1,m+1)]},Po.prototype.isLessThan=function(a){return this.wrap<a.wrap||!(this.wrap>a.wrap)&&(this.overscaledZ<a.overscaledZ||!(this.overscaledZ>a.overscaledZ)&&(this.canonical.x<a.canonical.x||!(this.canonical.x>a.canonical.x)&&this.canonical.y<a.canonical.y))},Po.prototype.wrapped=function(){return new Po(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Po.prototype.unwrapTo=function(a){return new Po(this.overscaledZ,a,this.canonical.z,this.canonical.x,this.canonical.y)},Po.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Po.prototype.toUnwrapped=function(){return new Kf(this.wrap,this.canonical)},Po.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Po.prototype.getTilePoint=function(a){return this.canonical.getTilePoint(new qf(a.x-this.wrap,a.y))},_n("CanonicalTileID",zl),_n("OverscaledTileID",Po,{omit:["posMatrix"]});var Vc=function(a,u,c){if(this.uid=a,u.height!==u.width)throw new RangeError("DEM tiles must be square");if(c&&c!=="mapbox"&&c!=="terrarium")return qe('"'+c+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=u.height;var m=this.dim=u.height-2;this.data=new Uint32Array(u.data.buffer),this.encoding=c||"mapbox";for(var x=0;x<m;x++)this.data[this._idx(-1,x)]=this.data[this._idx(0,x)],this.data[this._idx(m,x)]=this.data[this._idx(m-1,x)],this.data[this._idx(x,-1)]=this.data[this._idx(x,0)],this.data[this._idx(x,m)]=this.data[this._idx(x,m-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(m,-1)]=this.data[this._idx(m-1,0)],this.data[this._idx(-1,m)]=this.data[this._idx(0,m-1)],this.data[this._idx(m,m)]=this.data[this._idx(m-1,m-1)]};Vc.prototype.get=function(a,u){var c=new Uint8Array(this.data.buffer),m=4*this._idx(a,u);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(c[m],c[m+1],c[m+2])},Vc.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Vc.prototype._idx=function(a,u){if(a<-1||a>=this.dim+1||u<-1||u>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(u+1)*this.stride+(a+1)},Vc.prototype._unpackMapbox=function(a,u,c){return(256*a*256+256*u+c)/10-1e4},Vc.prototype._unpackTerrarium=function(a,u,c){return 256*a+u+c/256-32768},Vc.prototype.getPixels=function(){return new Qo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Vc.prototype.backfillBorder=function(a,u,c){if(this.dim!==a.dim)throw new Error("dem dimension mismatch");var m=u*this.dim,x=u*this.dim+this.dim,E=c*this.dim,A=c*this.dim+this.dim;switch(u){case-1:m=x-1;break;case 1:x=m+1}switch(c){case-1:E=A-1;break;case 1:A=E+1}for(var I=-u*this.dim,D=-c*this.dim,N=E;N<A;N++)for(var H=m;H<x;H++)this.data[this._idx(H,N)]=a.data[this._idx(H+I,N+D)]},_n("DEMData",Vc);var yp=function(a){this._stringToNumber={},this._numberToString=[];for(var u=0;u<a.length;u++){var c=a[u];this._stringToNumber[c]=u,this._numberToString[u]=c}};yp.prototype.encode=function(a){return this._stringToNumber[a]},yp.prototype.decode=function(a){return this._numberToString[a]};var Jp=function(a,u,c,m,x){this.type="Feature",this._vectorTileFeature=a,a._z=u,a._x=c,a._y=m,this.properties=a.properties,this.id=x},Vv={geometry:{configurable:!0}};Vv.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Vv.geometry.set=function(a){this._geometry=a},Jp.prototype.toJSON=function(){var a={geometry:this.geometry};for(var u in this)u!=="_geometry"&&u!=="_vectorTileFeature"&&(a[u]=this[u]);return a},Object.defineProperties(Jp.prototype,Vv);var xp=function(){this.state={},this.stateChanges={},this.deletedStates={}};xp.prototype.updateState=function(a,u,c){var m=String(u);if(this.stateChanges[a]=this.stateChanges[a]||{},this.stateChanges[a][m]=this.stateChanges[a][m]||{},Zt(this.stateChanges[a][m],c),this.deletedStates[a]===null)for(var x in this.deletedStates[a]={},this.state[a])x!==m&&(this.deletedStates[a][x]=null);else if(this.deletedStates[a]&&this.deletedStates[a][m]===null)for(var E in this.deletedStates[a][m]={},this.state[a][m])c[E]||(this.deletedStates[a][m][E]=null);else for(var A in c)this.deletedStates[a]&&this.deletedStates[a][m]&&this.deletedStates[a][m][A]===null&&delete this.deletedStates[a][m][A]},xp.prototype.removeFeatureState=function(a,u,c){if(this.deletedStates[a]!==null){var m=String(u);if(this.deletedStates[a]=this.deletedStates[a]||{},c&&u!==void 0)this.deletedStates[a][m]!==null&&(this.deletedStates[a][m]=this.deletedStates[a][m]||{},this.deletedStates[a][m][c]=null);else if(u!==void 0)if(this.stateChanges[a]&&this.stateChanges[a][m])for(c in this.deletedStates[a][m]={},this.stateChanges[a][m])this.deletedStates[a][m][c]=null;else this.deletedStates[a][m]=null;else this.deletedStates[a]=null}},xp.prototype.getState=function(a,u){var c=String(u),m=Zt({},(this.state[a]||{})[c],(this.stateChanges[a]||{})[c]);if(this.deletedStates[a]===null)return{};if(this.deletedStates[a]){var x=this.deletedStates[a][u];if(x===null)return{};for(var E in x)delete m[E]}return m},xp.prototype.initializeTileState=function(a,u){a.setFeatureState(this.state,u)},xp.prototype.coalesceChanges=function(a,u){var c={};for(var m in this.stateChanges){this.state[m]=this.state[m]||{};var x={};for(var E in this.stateChanges[m])this.state[m][E]||(this.state[m][E]={}),Zt(this.state[m][E],this.stateChanges[m][E]),x[E]=this.state[m][E];c[m]=x}for(var A in this.deletedStates){this.state[A]=this.state[A]||{};var I={};if(this.deletedStates[A]===null)for(var D in this.state[A])I[D]={},this.state[A][D]={};else for(var N in this.deletedStates[A]){if(this.deletedStates[A][N]===null)this.state[A][N]={};else for(var H=0,X=Object.keys(this.deletedStates[A][N]);H<X.length;H+=1)delete this.state[A][N][X[H]];I[N]=this.state[A][N]}c[A]=c[A]||{},Zt(c[A],I)}if(this.stateChanges={},this.deletedStates={},Object.keys(c).length!==0)for(var ne in a)a[ne].setFeatureState(c,u)};var jc=function(a,u){this.tileID=a,this.x=a.canonical.x,this.y=a.canonical.y,this.z=a.canonical.z,this.grid=new ko(8192,16,0),this.grid3D=new ko(8192,16,0),this.featureIndexArray=new Y,this.promoteId=u};function jv(a,u,c,m,x){return lr(a,function(E,A){var I=u instanceof nc?u.get(A):null;return I&&I.evaluate?I.evaluate(c,m,x):I})}function ng(a){for(var u=1/0,c=1/0,m=-1/0,x=-1/0,E=0,A=a;E<A.length;E+=1){var I=A[E];u=Math.min(u,I.x),c=Math.min(c,I.y),m=Math.max(m,I.x),x=Math.max(x,I.y)}return{minX:u,minY:c,maxX:m,maxY:x}}function E0(a,u){return u-a}jc.prototype.insert=function(a,u,c,m,x,E){var A=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(c,m,x);for(var I=E?this.grid3D:this.grid,D=0;D<u.length;D++){for(var N=u[D],H=[1/0,1/0,-1/0,-1/0],X=0;X<N.length;X++){var ne=N[X];H[0]=Math.min(H[0],ne.x),H[1]=Math.min(H[1],ne.y),H[2]=Math.max(H[2],ne.x),H[3]=Math.max(H[3],ne.y)}H[0]<8192&&H[1]<8192&&H[2]>=0&&H[3]>=0&&I.insert(A,H[0],H[1],H[2],H[3])}},jc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ul.VectorTile(new Gt(this.rawTileData)).layers,this.sourceLayerCoder=new yp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},jc.prototype.query=function(a,u,c,m){var x=this;this.loadVTLayers();for(var E=a.params||{},A=8192/a.tileSize/a.scale,I=Bu(E.filter),D=a.queryGeometry,N=a.queryPadding*A,H=ng(D),X=this.grid.query(H.minX-N,H.minY-N,H.maxX+N,H.maxY+N),ne=ng(a.cameraQueryGeometry),R=this.grid3D.query(ne.minX-N,ne.minY-N,ne.maxX+N,ne.maxY+N,function(Yt,qt,dr,Lr){return function(Xr,Bn,cn,Vn,pn){for(var Ei=0,ti=Xr;Ei<ti.length;Ei+=1){var Rn=ti[Ei];if(Bn<=Rn.x&&cn<=Rn.y&&Vn>=Rn.x&&pn>=Rn.y)return!0}var Di=[new se(Bn,cn),new se(Bn,pn),new se(Vn,pn),new se(Vn,cn)];if(Xr.length>2){for(var gi=0,Ui=Di;gi<Ui.length;gi+=1)if(iu(Xr,Ui[gi]))return!0}for(var jn=0;jn<Xr.length-1;jn++)if(ju(Xr[jn],Xr[jn+1],Di))return!0;return!1}(a.cameraQueryGeometry,Yt-N,qt-N,dr+N,Lr+N)}),Pe=0,Be=R;Pe<Be.length;Pe+=1)X.push(Be[Pe]);X.sort(E0);for(var rt,Ge={},St=function(Yt){var qt=X[Yt];if(qt!==rt){rt=qt;var dr=x.featureIndexArray.get(qt),Lr=null;x.loadMatchingFeature(Ge,dr.bucketIndex,dr.sourceLayerIndex,dr.featureIndex,I,E.layers,E.availableImages,u,c,m,function(Xr,Bn,cn){return Lr||(Lr=Ga(Xr)),Bn.queryIntersectsFeature(D,Xr,cn,Lr,x.z,a.transform,A,a.pixelPosMatrix)})}},Ft=0;Ft<X.length;Ft++)St(Ft);return Ge},jc.prototype.loadMatchingFeature=function(a,u,c,m,x,E,A,I,D,N,H){var X=this.bucketLayerIDs[u];if(!E||function(Xr,Bn){for(var cn=0;cn<Xr.length;cn++)if(Bn.indexOf(Xr[cn])>=0)return!0;return!1}(E,X)){var ne=this.sourceLayerCoder.decode(c),R=this.vtLayers[ne].feature(m);if(x.needGeometry){var Pe=Xa(R,!0);if(!x.filter(new B(this.tileID.overscaledZ),Pe,this.tileID.canonical))return}else if(!x.filter(new B(this.tileID.overscaledZ),R))return;for(var Be=this.getId(R,ne),rt=0;rt<X.length;rt++){var Ge=X[rt];if(!(E&&E.indexOf(Ge)<0)){var St=I[Ge];if(St){var Ft={};Be!==void 0&&N&&(Ft=N.getState(St.sourceLayer||"_geojsonTileLayer",Be));var Yt=Zt({},D[Ge]);Yt.paint=jv(Yt.paint,St.paint,R,Ft,A),Yt.layout=jv(Yt.layout,St.layout,R,Ft,A);var qt=!H||H(R,St,Ft);if(qt){var dr=new Jp(R,this.z,this.x,this.y,Be);dr.layer=Yt;var Lr=a[Ge];Lr===void 0&&(Lr=a[Ge]=[]),Lr.push({featureIndex:m,feature:dr,intersectionZ:qt})}}}}}},jc.prototype.lookupSymbolFeatures=function(a,u,c,m,x,E,A,I){var D={};this.loadVTLayers();for(var N=Bu(x),H=0,X=a;H<X.length;H+=1)this.loadMatchingFeature(D,c,m,X[H],N,E,A,I,u);return D},jc.prototype.hasLayer=function(a){for(var u=0,c=this.bucketLayerIDs;u<c.length;u+=1)for(var m=0,x=c[u];m<x.length;m+=1)if(a===x[m])return!0;return!1},jc.prototype.getId=function(a,u){var c=a.id;return this.promoteId&&typeof(c=a.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[u]])=="boolean"&&(c=Number(c)),c},_n("FeatureIndex",jc,{omit:["rawTileData","sourceLayerCoder"]});var ts=function(a,u){this.tileID=a,this.uid=Vt(),this.uses=0,this.tileSize=u,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ts.prototype.registerFadeDuration=function(a){var u=a+this.timeAdded;u<on.now()||this.fadeEndTime&&u<this.fadeEndTime||(this.fadeEndTime=u)},ts.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},ts.prototype.loadVectorData=function(a,u,c){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",a){for(var m in a.featureIndex&&(this.latestFeatureIndex=a.featureIndex,a.rawTileData?(this.latestRawTileData=a.rawTileData,this.latestFeatureIndex.rawTileData=a.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=a.collisionBoxArray,this.buckets=function(N,H){var X={};if(!H)return X;for(var ne=function(){var Be=Pe[R],rt=Be.layerIds.map(function(Ft){return H.getLayer(Ft)}).filter(Boolean);if(rt.length!==0){Be.layers=rt,Be.stateDependentLayerIds&&(Be.stateDependentLayers=Be.stateDependentLayerIds.map(function(Ft){return rt.filter(function(Yt){return Yt.id===Ft})[0]}));for(var Ge=0,St=rt;Ge<St.length;Ge+=1)X[St[Ge].id]=Be}},R=0,Pe=N;R<Pe.length;R+=1)ne();return X}(a.buckets,u.style),this.hasSymbolBuckets=!1,this.buckets){var x=this.buckets[m];if(x instanceof xn){if(this.hasSymbolBuckets=!0,!c)break;x.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var E in this.buckets){var A=this.buckets[E];if(A instanceof xn&&A.hasRTLText){this.hasRTLText=!0,Fe.isLoading()||Fe.isLoaded()||up()!=="deferred"||Pt();break}}for(var I in this.queryPadding=0,this.buckets){var D=this.buckets[I];this.queryPadding=Math.max(this.queryPadding,u.style.getLayer(I).queryRadius(D))}a.imageAtlas&&(this.imageAtlas=a.imageAtlas),a.glyphAtlasImage&&(this.glyphAtlasImage=a.glyphAtlasImage)}else this.collisionBoxArray=new d},ts.prototype.unloadVectorData=function(){for(var a in this.buckets)this.buckets[a].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ts.prototype.getBucket=function(a){return this.buckets[a.id]},ts.prototype.upload=function(a){for(var u in this.buckets){var c=this.buckets[u];c.uploadPending()&&c.upload(a)}var m=a.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Yf(a,this.imageAtlas.image,m.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Yf(a,this.glyphAtlasImage,m.ALPHA),this.glyphAtlasImage=null)},ts.prototype.prepare=function(a){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(a,this.imageAtlasTexture)},ts.prototype.queryRenderedFeatures=function(a,u,c,m,x,E,A,I,D,N){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:m,cameraQueryGeometry:x,scale:E,tileSize:this.tileSize,pixelPosMatrix:N,transform:I,params:A,queryPadding:this.queryPadding*D},a,u,c):{}},ts.prototype.querySourceFeatures=function(a,u){var c=this.latestFeatureIndex;if(c&&c.rawTileData){var m=c.loadVTLayers(),x=u?u.sourceLayer:"",E=m._geojsonTileLayer||m[x];if(E)for(var A=Bu(u&&u.filter),I=this.tileID.canonical,D=I.z,N=I.x,H=I.y,X={z:D,x:N,y:H},ne=0;ne<E.length;ne++){var R=E.feature(ne);if(A.needGeometry){var Pe=Xa(R,!0);if(!A.filter(new B(this.tileID.overscaledZ),Pe,this.tileID.canonical))continue}else if(!A.filter(new B(this.tileID.overscaledZ),R))continue;var Be=c.getId(R,x),rt=new Jp(R,D,N,H,Be);rt.tile=X,a.push(rt)}}},ts.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},ts.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ts.prototype.setExpiryData=function(a){var u=this.expirationTime;if(a.cacheControl){var c=V(a.cacheControl);c["max-age"]&&(this.expirationTime=Date.now()+1e3*c["max-age"])}else a.expires&&(this.expirationTime=new Date(a.expires).getTime());if(this.expirationTime){var m=Date.now(),x=!1;if(this.expirationTime>m)x=!1;else if(u)if(this.expirationTime<u)x=!0;else{var E=this.expirationTime-u;E?this.expirationTime=m+Math.max(E,3e4):x=!0}else x=!0;x?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ts.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)},ts.prototype.setFeatureState=function(a,u){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(a).length!==0){var c=this.latestFeatureIndex.loadVTLayers();for(var m in this.buckets)if(u.style.hasLayer(m)){var x=this.buckets[m],E=x.layers[0].sourceLayer||"_geojsonTileLayer",A=c[E],I=a[E];if(A&&I&&Object.keys(I).length!==0){x.update(I,A,this.imageAtlas&&this.imageAtlas.patternPositions||{});var D=u&&u.style&&u.style.getLayer(m);D&&(this.queryPadding=Math.max(this.queryPadding,D.queryRadius(x)))}}}},ts.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},ts.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<on.now()},ts.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ts.prototype.setHoldDuration=function(a){this.symbolFadeHoldUntil=on.now()+a},ts.prototype.setDependencies=function(a,u){for(var c={},m=0,x=u;m<x.length;m+=1)c[x[m]]=!0;this.dependencies[a]=c},ts.prototype.hasDependency=function(a,u){for(var c=0,m=a;c<m.length;c+=1){var x=this.dependencies[m[c]];if(x){for(var E=0,A=u;E<A.length;E+=1)if(x[A[E]])return!0}}return!1};var Qf=ae.performance,bp=function(a){this._marks={start:[a.url,"start"].join("#"),end:[a.url,"end"].join("#"),measure:a.url.toString()},Qf.mark(this._marks.start)};bp.prototype.finish=function(){Qf.mark(this._marks.end);var a=Qf.getEntriesByName(this._marks.measure);return a.length===0&&(Qf.measure(this._marks.measure,this._marks.start,this._marks.end),a=Qf.getEntriesByName(this._marks.measure),Qf.clearMarks(this._marks.start),Qf.clearMarks(this._marks.end),Qf.clearMeasures(this._marks.measure)),a},_.Actor=gp,_.AlphaImage=_u,_.CanonicalTileID=zl,_.CollisionBoxArray=d,_.Color=wi,_.DEMData=Vc,_.DataConstantProperty=kn,_.DictionaryCoder=yp,_.EXTENT=8192,_.ErrorEvent=it,_.EvaluationParameters=B,_.Event=Oe,_.Evented=pt,_.FeatureIndex=jc,_.FillBucket=fl,_.FillExtrusionBucket=hs,_.ImageAtlas=vr,_.ImagePosition=Qr,_.LineBucket=Jo,_.LngLat=$a,_.LngLatBounds=No,_.MercatorCoordinate=qf,_.ONE_EM=24,_.OverscaledTileID=Po,_.Point=se,_.Point$1=se,_.Properties=Fa,_.Protobuf=Gt,_.RGBAImage=Qo,_.RequestManager=Si,_.RequestPerformance=bp,_.ResourceType=fn,_.SegmentVector=_e,_.SourceFeatureState=xp,_.StructArrayLayout1ui2=Rh,_.StructArrayLayout2f1f2i16=oc,_.StructArrayLayout2i4=Pl,_.StructArrayLayout3ui6=zu,_.StructArrayLayout4i8=zf,_.SymbolBucket=xn,_.Texture=Yf,_.Tile=ts,_.Transitionable=Bo,_.Uniform1f=Nr,_.Uniform1i=_r,_.Uniform2f=kr,_.Uniform3f=un,_.Uniform4f=Pn,_.UniformColor=zn,_.UniformMatrix4f=Wi,_.UnwrappedTileID=Kf,_.ValidationError=Q,_.WritingMode=ot,_.ZoomHistory=Th,_.add=function(a,u,c){return a[0]=u[0]+c[0],a[1]=u[1]+c[1],a[2]=u[2]+c[2],a},_.addDynamicAttributes=xr,_.asyncAll=function(a,u,c){if(!a.length)return c(null,[]);var m=a.length,x=new Array(a.length),E=null;a.forEach(function(A,I){u(A,function(D,N){D&&(E=D),x[I]=N,--m==0&&c(E,x)})})},_.bezier=dt,_.bindAll=Tr,_.browser=on,_.cacheEntryPossiblyAdded=function(a){++En>cr&&(a.getActor().send("enforceCacheSizeLimit",Et),En=0)},_.clamp=wt,_.clearTileCache=function(a){var u=ae.caches.delete("mapbox-tiles");a&&u.catch(a).then(function(){return a()})},_.clipLine=Xu,_.clone=function(a){var u=new Zi(16);return u[0]=a[0],u[1]=a[1],u[2]=a[2],u[3]=a[3],u[4]=a[4],u[5]=a[5],u[6]=a[6],u[7]=a[7],u[8]=a[8],u[9]=a[9],u[10]=a[10],u[11]=a[11],u[12]=a[12],u[13]=a[13],u[14]=a[14],u[15]=a[15],u},_.clone$1=ut,_.clone$2=function(a){var u=new Zi(3);return u[0]=a[0],u[1]=a[1],u[2]=a[2],u},_.collisionCircleLayout=z,_.config=Jr,_.create=function(){var a=new Zi(16);return Zi!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=0,a[12]=0,a[13]=0,a[14]=0),a[0]=1,a[5]=1,a[10]=1,a[15]=1,a},_.create$1=function(){var a=new Zi(9);return Zi!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[5]=0,a[6]=0,a[7]=0),a[0]=1,a[4]=1,a[8]=1,a},_.create$2=function(){var a=new Zi(4);return Zi!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a},_.createCommonjsModule=le,_.createExpression=rf,_.createLayout=wo,_.createStyleLayer=function(a){return a.type==="custom"?new Vd(a):new Zs[a.type](a)},_.cross=function(a,u,c){var m=u[0],x=u[1],E=u[2],A=c[0],I=c[1],D=c[2];return a[0]=x*D-E*I,a[1]=E*A-m*D,a[2]=m*I-x*A,a},_.deepEqual=function a(u,c){if(Array.isArray(u)){if(!Array.isArray(c)||u.length!==c.length)return!1;for(var m=0;m<u.length;m++)if(!a(u[m],c[m]))return!1;return!0}if(typeof u=="object"&&u!==null&&c!==null){if(typeof c!="object"||Object.keys(u).length!==Object.keys(c).length)return!1;for(var x in u)if(!a(u[x],c[x]))return!1;return!0}return u===c},_.dot=function(a,u){return a[0]*u[0]+a[1]*u[1]+a[2]*u[2]},_.dot$1=function(a,u){return a[0]*u[0]+a[1]*u[1]+a[2]*u[2]+a[3]*u[3]},_.ease=Ye,_.emitValidationErrors=Ml,_.endsWith=hr,_.enforceCacheSizeLimit=function(a){mr(),ie&&ie.then(function(u){u.keys().then(function(c){for(var m=0;m<c.length-a;m++)u.delete(c[m])})})},_.evaluateSizeForFeature=ps,_.evaluateSizeForZoom=Io,_.evaluateVariableOffset=ft,_.evented=lf,_.extend=Zt,_.featureFilter=Bu,_.filterObject=At,_.fromRotation=function(a,u){var c=Math.sin(u),m=Math.cos(u);return a[0]=m,a[1]=c,a[2]=0,a[3]=-c,a[4]=m,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},_.getAnchorAlignment=Sa,_.getAnchorJustification=mt,_.getArrayBuffer=Is,_.getImage=J,_.getJSON=function(a,u){return lo(Zt(a,{type:"json"}),u)},_.getRTLTextPluginStatus=up,_.getReferrer=Yn,_.getVideo=function(a,u){var c,m,x=ae.document.createElement("video");x.muted=!0,x.onloadstart=function(){u(null,x)};for(var E=0;E<a.length;E++){var A=ae.document.createElement("source");c=a[E],m=void 0,(m=ae.document.createElement("a")).href=c,(m.protocol!==ae.document.location.protocol||m.host!==ae.document.location.host)&&(x.crossOrigin="Anonymous"),A.src=a[E],x.appendChild(A)}return{cancel:function(){}}},_.identity=mo,_.invert=function(a,u){var c=u[0],m=u[1],x=u[2],E=u[3],A=u[4],I=u[5],D=u[6],N=u[7],H=u[8],X=u[9],ne=u[10],R=u[11],Pe=u[12],Be=u[13],rt=u[14],Ge=u[15],St=c*I-m*A,Ft=c*D-x*A,Yt=c*N-E*A,qt=m*D-x*I,dr=m*N-E*I,Lr=x*N-E*D,Xr=H*Be-X*Pe,Bn=H*rt-ne*Pe,cn=H*Ge-R*Pe,Vn=X*rt-ne*Be,pn=X*Ge-R*Be,Ei=ne*Ge-R*rt,ti=St*Ei-Ft*pn+Yt*Vn+qt*cn-dr*Bn+Lr*Xr;return ti?(a[0]=(I*Ei-D*pn+N*Vn)*(ti=1/ti),a[1]=(x*pn-m*Ei-E*Vn)*ti,a[2]=(Be*Lr-rt*dr+Ge*qt)*ti,a[3]=(ne*dr-X*Lr-R*qt)*ti,a[4]=(D*cn-A*Ei-N*Bn)*ti,a[5]=(c*Ei-x*cn+E*Bn)*ti,a[6]=(rt*Yt-Pe*Lr-Ge*Ft)*ti,a[7]=(H*Lr-ne*Yt+R*Ft)*ti,a[8]=(A*pn-I*cn+N*Xr)*ti,a[9]=(m*cn-c*pn-E*Xr)*ti,a[10]=(Pe*dr-Be*Yt+Ge*St)*ti,a[11]=(X*Yt-H*dr-R*St)*ti,a[12]=(I*Bn-A*Vn-D*Xr)*ti,a[13]=(c*Vn-m*Bn+x*Xr)*ti,a[14]=(Be*Ft-Pe*qt-rt*St)*ti,a[15]=(H*qt-X*Ft+ne*St)*ti,a):null},_.isChar=qr,_.isMapboxURL=Ri,_.keysDifference=function(a,u){var c=[];for(var m in a)m in u||c.push(m);return c},_.makeRequest=lo,_.mapObject=lr,_.mercatorXfromLng=Fh,_.mercatorYfromLat=Wd,_.mercatorZfromAltitude=rg,_.mul=Bc,_.multiply=ao,_.mvt=Ul,_.nextPowerOfTwo=function(a){return a<=1?1:Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))},_.normalize=function(a,u){var c=u[0],m=u[1],x=u[2],E=c*c+m*m+x*x;return E>0&&(E=1/Math.sqrt(E)),a[0]=u[0]*E,a[1]=u[1]*E,a[2]=u[2]*E,a},_.number=qa,_.offscreenCanvasSupported=Cn,_.ortho=function(a,u,c,m,x,E,A){var I=1/(u-c),D=1/(m-x),N=1/(E-A);return a[0]=-2*I,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*D,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*N,a[11]=0,a[12]=(u+c)*I,a[13]=(x+m)*D,a[14]=(A+E)*N,a[15]=1,a},_.parseGlyphPBF=function(a){return new Gt(a).readFields(br,[])},_.pbf=Gt,_.performSymbolLayout=function(a,u,c,m,x,E,A){a.createArrays(),a.tilePixelRatio=8192/(512*a.overscaling),a.compareText={},a.iconsNeedLinear=!1;var I=a.layers[0].layout,D=a.layers[0]._unevaluatedLayout._values,N={};if(a.textSizeData.kind==="composite"){var H=a.textSizeData,X=H.maxZoom;N.compositeTextSizes=[D["text-size"].possiblyEvaluate(new B(H.minZoom),A),D["text-size"].possiblyEvaluate(new B(X),A)]}if(a.iconSizeData.kind==="composite"){var ne=a.iconSizeData,R=ne.maxZoom;N.compositeIconSizes=[D["icon-size"].possiblyEvaluate(new B(ne.minZoom),A),D["icon-size"].possiblyEvaluate(new B(R),A)]}N.layoutTextSize=D["text-size"].possiblyEvaluate(new B(a.zoom+1),A),N.layoutIconSize=D["icon-size"].possiblyEvaluate(new B(a.zoom+1),A),N.textMaxSize=D["text-size"].possiblyEvaluate(new B(18));for(var Pe=24*I.get("text-line-height"),Be=I.get("text-rotation-alignment")==="map"&&I.get("symbol-placement")!=="point",rt=I.get("text-keep-upright"),Ge=I.get("text-size"),St=function(){var qt=Yt[Ft],dr=I.get("text-font").evaluate(qt,{},A).join(","),Lr=Ge.evaluate(qt,{},A),Xr=N.layoutTextSize.evaluate(qt,{},A),Bn=N.layoutIconSize.evaluate(qt,{},A),cn={horizontal:{},vertical:void 0},Vn=qt.text,pn=[0,0];if(Vn){var Ei=Vn.toString(),ti=24*I.get("text-letter-spacing").evaluate(qt,{},A),Rn=function(ji){for(var fa=0,va=ji;fa<va.length;fa+=1)if($i=va[fa].charCodeAt(0),qr.Arabic($i)||qr["Arabic Supplement"]($i)||qr["Arabic Extended-A"]($i)||qr["Arabic Presentation Forms-A"]($i)||qr["Arabic Presentation Forms-B"]($i))return!1;var $i;return!0}(Ei)?ti:0,Di=I.get("text-anchor").evaluate(qt,{},A),gi=I.get("text-variable-anchor");if(!gi){var Ui=I.get("text-radial-offset").evaluate(qt,{},A);pn=Ui?ft(Di,[24*Ui,tt]):I.get("text-offset").evaluate(qt,{},A).map(function(ji){return 24*ji})}var jn=Be?"center":I.get("text-justify").evaluate(qt,{},A),ia=I.get("symbol-placement"),za=ia==="point"?24*I.get("text-max-width").evaluate(qt,{},A):0,eo=function(){a.allowVerticalPlacement&&ol(Ei)&&(cn.vertical=yi(Vn,u,c,x,dr,za,Pe,Di,"left",Rn,pn,ot.vertical,!0,ia,Xr,Lr))};if(!Be&&gi){for(var uo=jn==="auto"?gi.map(function(ji){return mt(ji)}):[jn],Za=!1,ho=0;ho<uo.length;ho++){var Go=uo[ho];if(!cn.horizontal[Go])if(Za)cn.horizontal[Go]=cn.horizontal[0];else{var Uo=yi(Vn,u,c,x,dr,za,Pe,"center",Go,Rn,pn,ot.horizontal,!1,ia,Xr,Lr);Uo&&(cn.horizontal[Go]=Uo,Za=Uo.positionedLines.length===1)}}eo()}else{jn==="auto"&&(jn=mt(Di));var Vs=yi(Vn,u,c,x,dr,za,Pe,Di,jn,Rn,pn,ot.horizontal,!1,ia,Xr,Lr);Vs&&(cn.horizontal[jn]=Vs),eo(),ol(Ei)&&Be&&rt&&(cn.vertical=yi(Vn,u,c,x,dr,za,Pe,Di,jn,Rn,pn,ot.vertical,!1,ia,Xr,Lr))}}var ka=void 0,js=!1;if(qt.icon&&qt.icon.name){var So=m[qt.icon.name];So&&(ka=function(ji,fa,va){var $i=Sa(va),Hs=fa[0]-ji.displaySize[0]*$i.horizontalAlign,ns=fa[1]-ji.displaySize[1]*$i.verticalAlign;return{image:ji,top:ns,bottom:ns+ji.displaySize[1],left:Hs,right:Hs+ji.displaySize[0]}}(x[qt.icon.name],I.get("icon-offset").evaluate(qt,{},A),I.get("icon-anchor").evaluate(qt,{},A)),js=So.sdf,a.sdfIcons===void 0?a.sdfIcons=So.sdf:a.sdfIcons!==So.sdf&&qe("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(So.pixelRatio!==a.pixelRatio||I.get("icon-rotate").constantOr(1)!==0)&&(a.iconsNeedLinear=!0))}var rs=st(cn.horizontal)||cn.vertical;a.iconsInText=!!rs&&rs.iconsInText,(rs||ka)&&function(ji,fa,va,$i,Hs,ns,Ba,Oo,ws,Ki,Zl){var su=ns.textMaxSize.evaluate(fa,{});su===void 0&&(su=Ba);var vl,to=ji.layers[0].layout,Vl=to.get("icon-offset").evaluate(fa,{},Zl),$u=st(va.horizontal),Ef=Ba/24,pc=ji.tilePixelRatio*Ef,Cs=ji.tilePixelRatio*su/24,dc=ji.tilePixelRatio*Oo,Jf=ji.tilePixelRatio*to.get("symbol-spacing"),vc=to.get("text-padding")*ji.tilePixelRatio,Ep=to.get("icon-padding")*ji.tilePixelRatio,ed=to.get("text-max-angle")/180*Math.PI,Xd=to.get("text-rotation-alignment")==="map"&&to.get("symbol-placement")!=="point",td=to.get("icon-rotation-alignment")==="map"&&to.get("symbol-placement")!=="point",Hc=to.get("symbol-placement"),Sf=Jf/2,Sp=to.get("icon-text-fit");$i&&Sp!=="none"&&(ji.allowVerticalPlacement&&va.vertical&&(vl=xo($i,va.vertical,Sp,to.get("icon-text-fit-padding"),Vl,Ef)),$u&&($i=xo($i,$u,Sp,to.get("icon-text-fit-padding"),Vl,Ef)));var eh=function(ig,qd){qd.x<0||qd.x>=8192||qd.y<0||qd.y>=8192||function(po,gc,A0,ah,Kd,ag,sd,_c,ud,wp,ld,cd,Qd,Wv,Cp,Gv,Xv,$v,Yv,qv,bu,fd,Kv,yc,Ws){var Qv,oh,Nh,Uh,zh,Zh=po.addToLineVertexArray(gc,A0),Jv=0,em=0,tm=0,rm=0,Jd=-1,ev=-1,Xc={},nm=Ie(""),tv=0,rv=0;if(_c._unevaluatedLayout.getValue("text-radial-offset")===void 0?(tv=(Qv=_c.layout.get("text-offset").evaluate(bu,{},yc).map(function(dd){return 24*dd}))[0],rv=Qv[1]):(tv=24*_c.layout.get("text-radial-offset").evaluate(bu,{},yc),rv=tt),po.allowVerticalPlacement&&ah.vertical){var og=_c.layout.get("text-rotate").evaluate(bu,{},yc)+90;Uh=new da(ud,gc,wp,ld,cd,ah.vertical,Qd,Wv,Cp,og),sd&&(zh=new da(ud,gc,wp,ld,cd,sd,Xv,$v,Cp,og))}if(Kd){var im=_c.layout.get("icon-rotate").evaluate(bu,{}),sg=_c.layout.get("icon-text-fit")!=="none",ug=Ne(Kd,im,Kv,sg),nv=sd?Ne(sd,im,Kv,sg):void 0;Nh=new da(ud,gc,wp,ld,cd,Kd,Xv,$v,!1,im),Jv=4*ug.length;var am=po.iconSizeData,Vh=null;am.kind==="source"?(Vh=[128*_c.layout.get("icon-size").evaluate(bu,{})])[0]>32640&&qe(po.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):am.kind==="composite"&&((Vh=[128*fd.compositeIconSizes[0].evaluate(bu,{},yc),128*fd.compositeIconSizes[1].evaluate(bu,{},yc)])[0]>32640||Vh[1]>32640)&&qe(po.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),po.addSymbols(po.icon,ug,Vh,qv,Yv,bu,!1,gc,Zh.lineStartIndex,Zh.lineLength,-1,yc),Jd=po.icon.placedSymbolArray.length-1,nv&&(em=4*nv.length,po.addSymbols(po.icon,nv,Vh,qv,Yv,bu,ot.vertical,gc,Zh.lineStartIndex,Zh.lineLength,-1,yc),ev=po.icon.placedSymbolArray.length-1)}for(var om in ah.horizontal){var hd=ah.horizontal[om];if(!oh){nm=Ie(hd.text);var lg=_c.layout.get("text-rotate").evaluate(bu,{},yc);oh=new da(ud,gc,wp,ld,cd,hd,Qd,Wv,Cp,lg)}var cg=hd.positionedLines.length===1;if(tm+=De(po,gc,hd,ag,_c,Cp,bu,Gv,Zh,ah.vertical?ot.horizontal:ot.horizontalOnly,cg?Object.keys(ah.horizontal):[om],Xc,Jd,fd,yc),cg)break}ah.vertical&&(rm+=De(po,gc,ah.vertical,ag,_c,Cp,bu,Gv,Zh,ot.vertical,["vertical"],Xc,ev,fd,yc));var fg=oh?oh.boxStartIndex:po.collisionBoxArray.length,T0=oh?oh.boxEndIndex:po.collisionBoxArray.length,hg=Uh?Uh.boxStartIndex:po.collisionBoxArray.length,pg=Uh?Uh.boxEndIndex:po.collisionBoxArray.length,w0=Nh?Nh.boxStartIndex:po.collisionBoxArray.length,C0=Nh?Nh.boxEndIndex:po.collisionBoxArray.length,R0=zh?zh.boxStartIndex:po.collisionBoxArray.length,M0=zh?zh.boxEndIndex:po.collisionBoxArray.length,$c=-1,pd=function(dd,sm){return dd&&dd.circleDiameter?Math.max(dd.circleDiameter,sm):sm};$c=pd(oh,$c),$c=pd(Uh,$c),$c=pd(Nh,$c);var dg=($c=pd(zh,$c))>-1?1:0;dg&&($c*=Ws/24),po.glyphOffsetArray.length>=xn.MAX_GLYPHS&&qe("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),bu.sortKey!==void 0&&po.addToSortKeyRanges(po.symbolInstances.length,bu.sortKey),po.symbolInstances.emplaceBack(gc.x,gc.y,Xc.right>=0?Xc.right:-1,Xc.center>=0?Xc.center:-1,Xc.left>=0?Xc.left:-1,Xc.vertical||-1,Jd,ev,nm,fg,T0,hg,pg,w0,C0,R0,M0,wp,tm,rm,Jv,em,dg,0,Qd,tv,rv,$c)}(ji,qd,ig,va,$i,Hs,vl,ji.layers[0],ji.collisionBoxArray,fa.index,fa.sourceLayerIndex,ji.index,pc,vc,Xd,ws,dc,Ep,td,Vl,fa,ns,Ki,Zl,Ba)};if(Hc==="line")for(var Ap=0,rd=Xu(fa.geometry,0,0,8192,8192);Ap<rd.length;Ap+=1)for(var $d=rd[Ap],nd=0,id=bo($d,Jf,ed,va.vertical||$u,$i,24,Cs,ji.overscaling,8192);nd<id.length;nd+=1){var Wc=id[nd];$u&&me(ji,$u.text,Sf,Wc)||eh($d,Wc)}else if(Hc==="line-center")for(var kh=0,th=fa.geometry;kh<th.length;kh+=1){var Bh=th[kh];if(Bh.length>1){var rh=Xi(Bh,ed,va.vertical||$u,$i,24,Cs);rh&&eh(Bh,rh)}}else if(fa.type==="Polygon")for(var nh=0,Tp=pp(fa.geometry,0);nh<Tp.length;nh+=1){var Gc=Tp[nh],Lh=Ve(Gc,16);eh(Gc[0],new Ja(Lh.x,Lh.y,0))}else if(fa.type==="LineString")for(var mc=0,ih=fa.geometry;mc<ih.length;mc+=1){var xu=ih[mc];eh(xu,new Ja(xu[0].x,xu[0].y,0))}else if(fa.type==="Point")for(var ad=0,Yd=fa.geometry;ad<Yd.length;ad+=1)for(var Hv=0,S0=Yd[ad];Hv<S0.length;Hv+=1){var od=S0[Hv];eh([od],new Ja(od.x,od.y,0))}}(a,qt,cn,ka,m,N,Xr,Bn,pn,js,A)},Ft=0,Yt=a.features;Ft<Yt.length;Ft+=1)St();E&&a.generateCollisionDebugBuffers()},_.perspective=function(a,u,c,m,x){var E,A=1/Math.tan(u/2);return a[0]=A/c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=A,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[11]=-1,a[12]=0,a[13]=0,a[15]=0,x!=null&&x!==1/0?(a[10]=(x+m)*(E=1/(m-x)),a[14]=2*x*m*E):(a[10]=-1,a[14]=-2*m),a},_.pick=function(a,u){for(var c={},m=0;m<u.length;m++){var x=u[m];x in a&&(c[x]=a[x])}return c},_.plugin=Fe,_.polygonIntersectsPolygon=Zu,_.postMapLoadEvent=He,_.postTurnstileEvent=Wt,_.potpack=ui,_.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],_.register=_n,_.registerForPluginStateChange=function(a){return a({pluginStatus:Yo,pluginURL:Lu}),lf.on("pluginStateChange",a),a},_.renderColorRamp=hf,_.rotate=function(a,u,c){var m=u[0],x=u[1],E=u[2],A=u[3],I=Math.sin(c),D=Math.cos(c);return a[0]=m*D+E*I,a[1]=x*D+A*I,a[2]=m*-I+E*D,a[3]=x*-I+A*D,a},_.rotateX=function(a,u,c){var m=Math.sin(c),x=Math.cos(c),E=u[4],A=u[5],I=u[6],D=u[7],N=u[8],H=u[9],X=u[10],ne=u[11];return u!==a&&(a[0]=u[0],a[1]=u[1],a[2]=u[2],a[3]=u[3],a[12]=u[12],a[13]=u[13],a[14]=u[14],a[15]=u[15]),a[4]=E*x+N*m,a[5]=A*x+H*m,a[6]=I*x+X*m,a[7]=D*x+ne*m,a[8]=N*x-E*m,a[9]=H*x-A*m,a[10]=X*x-I*m,a[11]=ne*x-D*m,a},_.rotateZ=function(a,u,c){var m=Math.sin(c),x=Math.cos(c),E=u[0],A=u[1],I=u[2],D=u[3],N=u[4],H=u[5],X=u[6],ne=u[7];return u!==a&&(a[8]=u[8],a[9]=u[9],a[10]=u[10],a[11]=u[11],a[12]=u[12],a[13]=u[13],a[14]=u[14],a[15]=u[15]),a[0]=E*x+N*m,a[1]=A*x+H*m,a[2]=I*x+X*m,a[3]=D*x+ne*m,a[4]=N*x-E*m,a[5]=H*x-A*m,a[6]=X*x-I*m,a[7]=ne*x-D*m,a},_.scale=function(a,u,c){var m=c[0],x=c[1],E=c[2];return a[0]=u[0]*m,a[1]=u[1]*m,a[2]=u[2]*m,a[3]=u[3]*m,a[4]=u[4]*x,a[5]=u[5]*x,a[6]=u[6]*x,a[7]=u[7]*x,a[8]=u[8]*E,a[9]=u[9]*E,a[10]=u[10]*E,a[11]=u[11]*E,a[12]=u[12],a[13]=u[13],a[14]=u[14],a[15]=u[15],a},_.scale$1=function(a,u,c){return a[0]=u[0]*c,a[1]=u[1]*c,a[2]=u[2]*c,a[3]=u[3]*c,a},_.scale$2=function(a,u,c){return a[0]=u[0]*c,a[1]=u[1]*c,a[2]=u[2]*c,a},_.setCacheLimits=function(a,u){Et=a,cr=u},_.setRTLTextPlugin=function(a,u,c){if(c===void 0&&(c=!1),Yo==="deferred"||Yo==="loading"||Yo==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");Lu=on.resolveURL(a),Yo="deferred",Uf=u,Il(),c||Pt()},_.sphericalToCartesian=function(a){var u=a[0],c=a[1],m=a[2];return c+=90,c*=Math.PI/180,m*=Math.PI/180,{x:u*Math.cos(c)*Math.sin(m),y:u*Math.sin(c)*Math.sin(m),z:u*Math.cos(m)}},_.sqrLen=function(a){var u=a[0],c=a[1];return u*u+c*c},_.styleSpec=j,_.sub=function(a,u,c){return a[0]=u[0]-c[0],a[1]=u[1]-c[1],a[2]=u[2]-c[2],a},_.symbolSize=xi,_.transformMat3=function(a,u,c){var m=u[0],x=u[1],E=u[2];return a[0]=m*c[0]+x*c[3]+E*c[6],a[1]=m*c[1]+x*c[4]+E*c[7],a[2]=m*c[2]+x*c[5]+E*c[8],a},_.transformMat4=Bl,_.translate=function(a,u,c){var m,x,E,A,I,D,N,H,X,ne,R,Pe,Be=c[0],rt=c[1],Ge=c[2];return u===a?(a[12]=u[0]*Be+u[4]*rt+u[8]*Ge+u[12],a[13]=u[1]*Be+u[5]*rt+u[9]*Ge+u[13],a[14]=u[2]*Be+u[6]*rt+u[10]*Ge+u[14],a[15]=u[3]*Be+u[7]*rt+u[11]*Ge+u[15]):(x=u[1],E=u[2],A=u[3],I=u[4],D=u[5],N=u[6],H=u[7],X=u[8],ne=u[9],R=u[10],Pe=u[11],a[0]=m=u[0],a[1]=x,a[2]=E,a[3]=A,a[4]=I,a[5]=D,a[6]=N,a[7]=H,a[8]=X,a[9]=ne,a[10]=R,a[11]=Pe,a[12]=m*Be+I*rt+X*Ge+u[12],a[13]=x*Be+D*rt+ne*Ge+u[13],a[14]=E*Be+N*rt+R*Ge+u[14],a[15]=A*Be+H*rt+Pe*Ge+u[15]),a},_.triggerPluginCompletionEvent=sp,_.uniqueId=Vt,_.validateCustomStyleLayer=function(a){var u=[],c=a.id;return c===void 0&&u.push({message:"layers."+c+': missing required property "id"'}),a.render===void 0&&u.push({message:"layers."+c+': missing required method "render"'}),a.renderingMode&&a.renderingMode!=="2d"&&a.renderingMode!=="3d"&&u.push({message:"layers."+c+': property "renderingMode" must be either "2d" or "3d"'}),u},_.validateLight=op,_.validateStyle=sf,_.values=function(a){var u=[];for(var c in a)u.push(a[c]);return u},_.vectorTile=Ul,_.version="1.13.3",_.warnOnce=qe,_.webpSupported=Hr,_.window=ae,_.wrap=Xt}),he(["./shared"],function(_){"use strict";function le(W){var J=typeof W;if(J==="number"||J==="boolean"||J==="string"||W==null)return JSON.stringify(W);if(Array.isArray(W)){for(var oe="[",be=0,Oe=W;be<Oe.length;be+=1)oe+=le(Oe[be])+",";return oe+"]"}for(var it=Object.keys(W).sort(),pt="{",j=0;j<it.length;j++)pt+=JSON.stringify(it[j])+":"+le(W[it[j]])+",";return pt+"}"}function U(W){for(var J="",oe=0,be=_.refProperties;oe<be.length;oe+=1)J+="/"+le(W[be[oe]]);return J}var fe=function(W){this.keyCache={},W&&this.replace(W)};fe.prototype.replace=function(W){this._layerConfigs={},this._layers={},this.update(W,[])},fe.prototype.update=function(W,J){for(var oe=this,be=0,Oe=W;be<Oe.length;be+=1){var it=Oe[be];this._layerConfigs[it.id]=it;var pt=this._layers[it.id]=_.createStyleLayer(it);pt._featureFilter=_.featureFilter(pt.filter),this.keyCache[it.id]&&delete this.keyCache[it.id]}for(var j=0,Q=J;j<Q.length;j+=1){var Le=Q[j];delete this.keyCache[Le],delete this._layerConfigs[Le],delete this._layers[Le]}this.familiesBySource={};for(var at=0,Ee=function(Wr,Yr){for(var pi={},tn=0;tn<Wr.length;tn++){var vi=Yr&&Yr[Wr[tn].id]||U(Wr[tn]);Yr&&(Yr[Wr[tn].id]=vi);var qi=pi[vi];qi||(qi=pi[vi]=[]),qi.push(Wr[tn])}var ci=[];for(var zi in pi)ci.push(pi[zi]);return ci}(_.values(this._layerConfigs),this.keyCache);at<Ee.length;at+=1){var ir=Ee[at].map(function(Wr){return oe._layers[Wr.id]}),wr=ir[0];if(wr.visibility!=="none"){var An=wr.source||"",sn=this.familiesBySource[An];sn||(sn=this.familiesBySource[An]={});var sr=wr.sourceLayer||"_geojsonTileLayer",en=sn[sr];en||(en=sn[sr]=[]),en.push(ir)}}};var se=function(W){var J={},oe=[];for(var be in W){var Oe=W[be],it=J[be]={};for(var pt in Oe){var j=Oe[+pt];if(j&&j.bitmap.width!==0&&j.bitmap.height!==0){var Q={x:0,y:0,w:j.bitmap.width+2,h:j.bitmap.height+2};oe.push(Q),it[pt]={rect:Q,metrics:j.metrics}}}}var Le=_.potpack(oe),at=new _.AlphaImage({width:Le.w||1,height:Le.h||1});for(var Ee in W){var ir=W[Ee];for(var wr in ir){var An=ir[+wr];if(An&&An.bitmap.width!==0&&An.bitmap.height!==0){var sn=J[Ee][wr].rect;_.AlphaImage.copy(An.bitmap,at,{x:0,y:0},{x:sn.x+1,y:sn.y+1},An.bitmap)}}}this.image=at,this.positions=J};_.register("GlyphAtlas",se);var Qe=function(W){this.tileID=new _.OverscaledTileID(W.tileID.overscaledZ,W.tileID.wrap,W.tileID.canonical.z,W.tileID.canonical.x,W.tileID.canonical.y),this.uid=W.uid,this.zoom=W.zoom,this.pixelRatio=W.pixelRatio,this.tileSize=W.tileSize,this.source=W.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=W.showCollisionBoxes,this.collectResourceTiming=!!W.collectResourceTiming,this.returnDependencies=!!W.returnDependencies,this.promoteId=W.promoteId};function ae(W,J,oe){for(var be=new _.EvaluationParameters(J),Oe=0,it=W;Oe<it.length;Oe+=1)it[Oe].recalculate(be,oe)}function et(W,J){var oe=_.getArrayBuffer(W.request,function(be,Oe,it,pt){be?J(be):Oe&&J(null,{vectorTile:new _.vectorTile.VectorTile(new _.pbf(Oe)),rawData:Oe,cacheControl:it,expires:pt})});return function(){oe.cancel(),J()}}Qe.prototype.parse=function(W,J,oe,be,Oe){var it=this;this.status="parsing",this.data=W,this.collisionBoxArray=new _.CollisionBoxArray;var pt=new _.DictionaryCoder(Object.keys(W.layers).sort()),j=new _.FeatureIndex(this.tileID,this.promoteId);j.bucketLayerIDs=[];var Q,Le,at,Ee,ir={},wr={featureIndex:j,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:oe},An=J.familiesBySource[this.source];for(var sn in An){var sr=W.layers[sn];if(sr){sr.version===1&&_.warnOnce('Vector tile source "'+this.source+'" layer "'+sn+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var en=pt.encode(sn),Wr=[],Yr=0;Yr<sr.length;Yr++){var pi=sr.feature(Yr),tn=j.getId(pi,sn);Wr.push({feature:pi,id:tn,index:Yr,sourceLayerIndex:en})}for(var vi=0,qi=An[sn];vi<qi.length;vi+=1){var ci=qi[vi],zi=ci[0];zi.minzoom&&this.zoom<Math.floor(zi.minzoom)||zi.maxzoom&&this.zoom>=zi.maxzoom||zi.visibility!=="none"&&(ae(ci,this.zoom,oe),(ir[zi.id]=zi.createBucket({index:j.bucketLayerIDs.length,layers:ci,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:en,sourceID:this.source})).populate(Wr,wr,this.tileID.canonical),j.bucketLayerIDs.push(ci.map(function(Ti){return Ti.id})))}}}var Ai=_.mapObject(wr.glyphDependencies,function(Ti){return Object.keys(Ti).map(Number)});Object.keys(Ai).length?be.send("getGlyphs",{uid:this.uid,stacks:Ai},function(Ti,mi){Q||(Q=Ti,Le=mi,Ia.call(it))}):Le={};var Xo=Object.keys(wr.iconDependencies);Xo.length?be.send("getImages",{icons:Xo,source:this.source,tileID:this.tileID,type:"icons"},function(Ti,mi){Q||(Q=Ti,at=mi,Ia.call(it))}):at={};var Ji=Object.keys(wr.patternDependencies);function Ia(){if(Q)return Oe(Q);if(Le&&at&&Ee){var Ti=new se(Le),mi=new _.ImageAtlas(at,Ee);for(var wi in ir){var Pa=ir[wi];Pa instanceof _.SymbolBucket?(ae(Pa.layers,this.zoom,oe),_.performSymbolLayout(Pa,Le,Ti.positions,at,mi.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Pa.hasPattern&&(Pa instanceof _.LineBucket||Pa instanceof _.FillBucket||Pa instanceof _.FillExtrusionBucket)&&(ae(Pa.layers,this.zoom,oe),Pa.addFeatures(wr,this.tileID.canonical,mi.patternPositions))}this.status="done",Oe(null,{buckets:_.values(ir).filter(function(cu){return!cu.isEmpty()}),featureIndex:j,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ti.image,imageAtlas:mi,glyphMap:this.returnDependencies?Le:null,iconMap:this.returnDependencies?at:null,glyphPositions:this.returnDependencies?Ti.positions:null})}}Ji.length?be.send("getImages",{icons:Ji,source:this.source,tileID:this.tileID,type:"patterns"},function(Ti,mi){Q||(Q=Ti,Ee=mi,Ia.call(it))}):Ee={},Ia.call(this)};var dt=function(W,J,oe,be){this.actor=W,this.layerIndex=J,this.availableImages=oe,this.loadVectorData=be||et,this.loading={},this.loaded={}};dt.prototype.loadTile=function(W,J){var oe=this,be=W.uid;this.loading||(this.loading={});var Oe=!!(W&&W.request&&W.request.collectResourceTiming)&&new _.RequestPerformance(W.request),it=this.loading[be]=new Qe(W);it.abort=this.loadVectorData(W,function(pt,j){if(delete oe.loading[be],pt||!j)return it.status="done",oe.loaded[be]=it,J(pt);var Q=j.rawData,Le={};j.expires&&(Le.expires=j.expires),j.cacheControl&&(Le.cacheControl=j.cacheControl);var at={};if(Oe){var Ee=Oe.finish();Ee&&(at.resourceTiming=JSON.parse(JSON.stringify(Ee)))}it.vectorTile=j.vectorTile,it.parse(j.vectorTile,oe.layerIndex,oe.availableImages,oe.actor,function(ir,wr){if(ir||!wr)return J(ir);J(null,_.extend({rawTileData:Q.slice(0)},wr,Le,at))}),oe.loaded=oe.loaded||{},oe.loaded[be]=it})},dt.prototype.reloadTile=function(W,J){var oe=this,be=this.loaded,Oe=W.uid,it=this;if(be&&be[Oe]){var pt=be[Oe];pt.showCollisionBoxes=W.showCollisionBoxes;var j=function(Q,Le){var at=pt.reloadCallback;at&&(delete pt.reloadCallback,pt.parse(pt.vectorTile,it.layerIndex,oe.availableImages,it.actor,at)),J(Q,Le)};pt.status==="parsing"?pt.reloadCallback=j:pt.status==="done"&&(pt.vectorTile?pt.parse(pt.vectorTile,this.layerIndex,this.availableImages,this.actor,j):j())}},dt.prototype.abortTile=function(W,J){var oe=this.loading,be=W.uid;oe&&oe[be]&&oe[be].abort&&(oe[be].abort(),delete oe[be]),J()},dt.prototype.removeTile=function(W,J){var oe=this.loaded,be=W.uid;oe&&oe[be]&&delete oe[be],J()};var Ye=_.window.ImageBitmap,wt=function(){this.loaded={}};function Xt(W,J){if(W.length!==0){Zt(W[0],J);for(var oe=1;oe<W.length;oe++)Zt(W[oe],!J)}}function Zt(W,J){for(var oe=0,be=0,Oe=0,it=W.length,pt=it-1;Oe<it;pt=Oe++){var j=(W[Oe][0]-W[pt][0])*(W[pt][1]+W[Oe][1]),Q=oe+j;be+=Math.abs(oe)>=Math.abs(j)?oe-Q+j:j-Q+oe,oe=Q}oe+be>=0!=!!J&&W.reverse()}wt.prototype.loadTile=function(W,J){var oe=W.uid,be=W.encoding,Oe=W.rawImageData,it=Ye&&Oe instanceof Ye?this.getImageData(Oe):Oe,pt=new _.DEMData(oe,it,be);this.loaded=this.loaded||{},this.loaded[oe]=pt,J(null,pt)},wt.prototype.getImageData=function(W){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(W.width,W.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=W.width,this.offscreenCanvas.height=W.height,this.offscreenCanvasContext.drawImage(W,0,0,W.width,W.height);var J=this.offscreenCanvasContext.getImageData(-1,-1,W.width+2,W.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new _.RGBAImage({width:J.width,height:J.height},J.data)},wt.prototype.removeTile=function(W){var J=this.loaded,oe=W.uid;J&&J[oe]&&delete J[oe]};var nr=_.vectorTile.VectorTileFeature.prototype.toGeoJSON,Vt=function(W){this._feature=W,this.extent=_.EXTENT,this.type=W.type,this.properties=W.tags,"id"in W&&!isNaN(W.id)&&(this.id=parseInt(W.id,10))};Vt.prototype.loadGeometry=function(){if(this._feature.type===1){for(var W=[],J=0,oe=this._feature.geometry;J<oe.length;J+=1){var be=oe[J];W.push([new _.Point$1(be[0],be[1])])}return W}for(var Oe=[],it=0,pt=this._feature.geometry;it<pt.length;it+=1){for(var j=[],Q=0,Le=pt[it];Q<Le.length;Q+=1){var at=Le[Q];j.push(new _.Point$1(at[0],at[1]))}Oe.push(j)}return Oe},Vt.prototype.toGeoJSON=function(W,J,oe){return nr.call(this,W,J,oe)};var xt=function(W){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=_.EXTENT,this.length=W.length,this._features=W};xt.prototype.feature=function(W){return new Vt(this._features[W])};var bt=_.vectorTile.VectorTileFeature,Tr=hr;function hr(W,J){this.options=J||{},this.features=W,this.length=W.length}function lr(W,J){this.id=typeof W.id=="number"?W.id:void 0,this.type=W.type,this.rawGeometry=W.type===1?[W.geometry]:W.geometry,this.properties=W.tags,this.extent=J||4096}hr.prototype.feature=function(W){return new lr(this.features[W],this.options.extent)},lr.prototype.loadGeometry=function(){var W=this.rawGeometry;this.geometry=[];for(var J=0;J<W.length;J++){for(var oe=W[J],be=[],Oe=0;Oe<oe.length;Oe++)be.push(new _.Point$1(oe[Oe][0],oe[Oe][1]));this.geometry.push(be)}return this.geometry},lr.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var W=this.geometry,J=1/0,oe=-1/0,be=1/0,Oe=-1/0,it=0;it<W.length;it++)for(var pt=W[it],j=0;j<pt.length;j++){var Q=pt[j];J=Math.min(J,Q.x),oe=Math.max(oe,Q.x),be=Math.min(be,Q.y),Oe=Math.max(Oe,Q.y)}return[J,be,oe,Oe]},lr.prototype.toGeoJSON=bt.prototype.toGeoJSON;var At=It,ut=Tr;function It(W){var J=new _.pbf;return function(oe,be){for(var Oe in oe.layers)be.writeMessage(3,qe,oe.layers[Oe])}(W,J),J.finish()}function qe(W,J){var oe;J.writeVarintField(15,W.version||1),J.writeStringField(1,W.name||""),J.writeVarintField(5,W.extent||4096);var be={keys:[],values:[],keycache:{},valuecache:{}};for(oe=0;oe<W.length;oe++)be.feature=W.feature(oe),J.writeMessage(2,Ct,be);var Oe=be.keys;for(oe=0;oe<Oe.length;oe++)J.writeStringField(3,Oe[oe]);var it=be.values;for(oe=0;oe<it.length;oe++)J.writeMessage(4,Me,it[oe])}function Ct(W,J){var oe=W.feature;oe.id!==void 0&&J.writeVarintField(1,oe.id),J.writeMessage(2,fr,W),J.writeVarintField(3,oe.type),J.writeMessage(4,K,oe)}function fr(W,J){var oe=W.feature,be=W.keys,Oe=W.values,it=W.keycache,pt=W.valuecache;for(var j in oe.properties){var Q=it[j];Q===void 0&&(be.push(j),it[j]=Q=be.length-1),J.writeVarint(Q);var Le=oe.properties[j],at=typeof Le;at!=="string"&&at!=="boolean"&&at!=="number"&&(Le=JSON.stringify(Le));var Ee=at+":"+Le,ir=pt[Ee];ir===void 0&&(Oe.push(Le),pt[Ee]=ir=Oe.length-1),J.writeVarint(ir)}}function re(W,J){return(J<<3)+(7&W)}function V(W){return W<<1^W>>31}function K(W,J){for(var oe=W.loadGeometry(),be=W.type,Oe=0,it=0,pt=oe.length,j=0;j<pt;j++){var Q=oe[j],Le=1;be===1&&(Le=Q.length),J.writeVarint(re(1,Le));for(var at=be===3?Q.length-1:Q.length,Ee=0;Ee<at;Ee++){Ee===1&&be!==1&&J.writeVarint(re(2,at-1));var ir=Q[Ee].x-Oe,wr=Q[Ee].y-it;J.writeVarint(V(ir)),J.writeVarint(V(wr)),Oe+=ir,it+=wr}be===3&&J.writeVarint(re(7,1))}}function Me(W,J){var oe=typeof W;oe==="string"?J.writeStringField(1,W):oe==="boolean"?J.writeBooleanField(7,W):oe==="number"&&(W%1!=0?J.writeDoubleField(3,W):W<0?J.writeSVarintField(6,W):J.writeVarintField(5,W))}function Se(W,J,oe,be){nt(W,oe,be),nt(J,2*oe,2*be),nt(J,2*oe+1,2*be+1)}function nt(W,J,oe){var be=W[J];W[J]=W[oe],W[oe]=be}function te(W,J,oe,be){var Oe=W-oe,it=J-be;return Oe*Oe+it*it}At.fromVectorTileJs=It,At.fromGeojsonVt=function(W,J){J=J||{};var oe={};for(var be in W)oe[be]=new Tr(W[be].features,J),oe[be].name=be,oe[be].version=J.version,oe[be].extent=J.extent;return It({layers:oe})},At.GeoJSONWrapper=ut;var Ce=function(W){return W[0]},we=function(W){return W[1]},Xe=function(W,J,oe,be,Oe){J===void 0&&(J=Ce),oe===void 0&&(oe=we),be===void 0&&(be=64),Oe===void 0&&(Oe=Float64Array),this.nodeSize=be,this.points=W;for(var it=W.length<65536?Uint16Array:Uint32Array,pt=this.ids=new it(W.length),j=this.coords=new Oe(2*W.length),Q=0;Q<W.length;Q++)pt[Q]=Q,j[2*Q]=J(W[Q]),j[2*Q+1]=oe(W[Q]);(function Le(at,Ee,ir,wr,An,sn){if(!(An-wr<=ir)){var sr=wr+An>>1;(function en(Wr,Yr,pi,tn,vi,qi){for(;vi>tn;){if(vi-tn>600){var ci=vi-tn+1,zi=pi-tn+1,Ai=Math.log(ci),Xo=.5*Math.exp(2*Ai/3),Ji=.5*Math.sqrt(Ai*Xo*(ci-Xo)/ci)*(zi-ci/2<0?-1:1);en(Wr,Yr,pi,Math.max(tn,Math.floor(pi-zi*Xo/ci+Ji)),Math.min(vi,Math.floor(pi+(ci-zi)*Xo/ci+Ji)),qi)}var Ia=Yr[2*pi+qi],Ti=tn,mi=vi;for(Se(Wr,Yr,tn,pi),Yr[2*vi+qi]>Ia&&Se(Wr,Yr,tn,vi);Ti<mi;){for(Se(Wr,Yr,Ti,mi),Ti++,mi--;Yr[2*Ti+qi]<Ia;)Ti++;for(;Yr[2*mi+qi]>Ia;)mi--}Yr[2*tn+qi]===Ia?Se(Wr,Yr,tn,mi):Se(Wr,Yr,++mi,vi),mi<=pi&&(tn=mi+1),pi<=mi&&(vi=mi-1)}})(at,Ee,sr,wr,An,sn%2),Le(at,Ee,ir,wr,sr-1,sn+1),Le(at,Ee,ir,sr+1,An,sn+1)}})(pt,j,be,0,pt.length-1,0)};Xe.prototype.range=function(W,J,oe,be){return function(Oe,it,pt,j,Q,Le,at){for(var Ee,ir,wr=[0,Oe.length-1,0],An=[];wr.length;){var sn=wr.pop(),sr=wr.pop(),en=wr.pop();if(sr-en<=at)for(var Wr=en;Wr<=sr;Wr++)ir=it[2*Wr+1],(Ee=it[2*Wr])>=pt&&Ee<=Q&&ir>=j&&ir<=Le&&An.push(Oe[Wr]);else{var Yr=Math.floor((en+sr)/2);ir=it[2*Yr+1],(Ee=it[2*Yr])>=pt&&Ee<=Q&&ir>=j&&ir<=Le&&An.push(Oe[Yr]);var pi=(sn+1)%2;(sn===0?pt<=Ee:j<=ir)&&(wr.push(en),wr.push(Yr-1),wr.push(pi)),(sn===0?Q>=Ee:Le>=ir)&&(wr.push(Yr+1),wr.push(sr),wr.push(pi))}}return An}(this.ids,this.coords,W,J,oe,be,this.nodeSize)},Xe.prototype.within=function(W,J,oe){return function(be,Oe,it,pt,j,Q){for(var Le=[0,be.length-1,0],at=[],Ee=j*j;Le.length;){var ir=Le.pop(),wr=Le.pop(),An=Le.pop();if(wr-An<=Q)for(var sn=An;sn<=wr;sn++)te(Oe[2*sn],Oe[2*sn+1],it,pt)<=Ee&&at.push(be[sn]);else{var sr=Math.floor((An+wr)/2),en=Oe[2*sr],Wr=Oe[2*sr+1];te(en,Wr,it,pt)<=Ee&&at.push(be[sr]);var Yr=(ir+1)%2;(ir===0?it-j<=en:pt-j<=Wr)&&(Le.push(An),Le.push(sr-1),Le.push(Yr)),(ir===0?it+j>=en:pt+j>=Wr)&&(Le.push(sr+1),Le.push(wr),Le.push(Yr))}}return at}(this.ids,this.coords,W,J,oe,this.nodeSize)};var Lt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(W){return W}},Ht=function(W){this.options=Mi(Object.create(Lt),W),this.trees=new Array(this.options.maxZoom+1)};function on(W,J,oe,be,Oe){return{x:W,y:J,zoom:1/0,id:oe,parentId:-1,numPoints:be,properties:Oe}}function Jr(W,J){var oe=W.geometry.coordinates,be=oe[1];return{x:bn(oe[0]),y:Kr(be),zoom:1/0,index:J,parentId:-1}}function Hr(W){return{type:"Feature",id:W.id,properties:Un(W),geometry:{type:"Point",coordinates:[(be=W.x,360*(be-.5)),(J=W.y,oe=(180-360*J)*Math.PI/180,360*Math.atan(Math.exp(oe))/Math.PI-90)]}};var J,oe,be}function Un(W){var J=W.numPoints,oe=J>=1e4?Math.round(J/1e3)+"k":J>=1e3?Math.round(J/100)/10+"k":J;return Mi(Mi({},W.properties),{cluster:!0,cluster_id:W.id,point_count:J,point_count_abbreviated:oe})}function bn(W){return W/360+.5}function Kr(W){var J=Math.sin(W*Math.PI/180),oe=.5-.25*Math.log((1+J)/(1-J))/Math.PI;return oe<0?0:oe>1?1:oe}function Mi(W,J){for(var oe in J)W[oe]=J[oe];return W}function Si(W){return W.x}function Ri(W){return W.y}function Gn(W,J,oe,be,Oe,it){var pt=Oe-oe,j=it-be;if(pt!==0||j!==0){var Q=((W-oe)*pt+(J-be)*j)/(pt*pt+j*j);Q>1?(oe=Oe,be=it):Q>0&&(oe+=pt*Q,be+=j*Q)}return(pt=W-oe)*pt+(j=J-be)*j}function Dn(W,J,oe,be){var Oe={id:W===void 0?null:W,type:J,geometry:oe,tags:be,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(it){var pt=it.geometry,j=it.type;if(j==="Point"||j==="MultiPoint"||j==="LineString")Ya(it,pt);else if(j==="Polygon"||j==="MultiLineString")for(var Q=0;Q<pt.length;Q++)Ya(it,pt[Q]);else if(j==="MultiPolygon")for(Q=0;Q<pt.length;Q++)for(var Le=0;Le<pt[Q].length;Le++)Ya(it,pt[Q][Le])}(Oe),Oe}function Ya(W,J){for(var oe=0;oe<J.length;oe+=3)W.minX=Math.min(W.minX,J[oe]),W.minY=Math.min(W.minY,J[oe+1]),W.maxX=Math.max(W.maxX,J[oe]),W.maxY=Math.max(W.maxY,J[oe+1])}function Yi(W,J,oe,be){if(J.geometry){var Oe=J.geometry.coordinates,it=J.geometry.type,pt=Math.pow(oe.tolerance/((1<<oe.maxZoom)*oe.extent),2),j=[],Q=J.id;if(oe.promoteId?Q=J.properties[oe.promoteId]:oe.generateId&&(Q=be||0),it==="Point")Na(Oe,j);else if(it==="MultiPoint")for(var Le=0;Le<Oe.length;Le++)Na(Oe[Le],j);else if(it==="LineString")Dt(Oe,j,pt,!1);else if(it==="MultiLineString"){if(oe.lineMetrics){for(Le=0;Le<Oe.length;Le++)Dt(Oe[Le],j=[],pt,!1),W.push(Dn(Q,"LineString",j,J.properties));return}k(Oe,j,pt,!1)}else if(it==="Polygon")k(Oe,j,pt,!0);else{if(it!=="MultiPolygon"){if(it==="GeometryCollection"){for(Le=0;Le<J.geometry.geometries.length;Le++)Yi(W,{id:Q,geometry:J.geometry.geometries[Le],properties:J.properties},oe,be);return}throw new Error("Input data is not a valid GeoJSON object.")}for(Le=0;Le<Oe.length;Le++){var at=[];k(Oe[Le],at,pt,!0),j.push(at)}}W.push(Dn(Q,it,j,J.properties))}}function Na(W,J){J.push(ie(W[0])),J.push(ve(W[1])),J.push(0)}function Dt(W,J,oe,be){for(var Oe,it,pt=0,j=0;j<W.length;j++){var Q=ie(W[j][0]),Le=ve(W[j][1]);J.push(Q),J.push(Le),J.push(0),j>0&&(pt+=be?(Oe*Le-Q*it)/2:Math.sqrt(Math.pow(Q-Oe,2)+Math.pow(Le-it,2))),Oe=Q,it=Le}var at=J.length-3;J[2]=1,function Ee(ir,wr,An,sn){for(var sr,en=sn,Wr=An-wr>>1,Yr=An-wr,pi=ir[wr],tn=ir[wr+1],vi=ir[An],qi=ir[An+1],ci=wr+3;ci<An;ci+=3){var zi=Gn(ir[ci],ir[ci+1],pi,tn,vi,qi);if(zi>en)sr=ci,en=zi;else if(zi===en){var Ai=Math.abs(ci-Wr);Ai<Yr&&(sr=ci,Yr=Ai)}}en>sn&&(sr-wr>3&&Ee(ir,wr,sr,sn),ir[sr+2]=en,An-sr>3&&Ee(ir,sr,An,sn))}(J,0,at,oe),J[at+2]=1,J.size=Math.abs(pt),J.start=0,J.end=J.size}function k(W,J,oe,be){for(var Oe=0;Oe<W.length;Oe++){var it=[];Dt(W[Oe],it,oe,be),J.push(it)}}function ie(W){return W/360+.5}function ve(W){var J=Math.sin(W*Math.PI/180),oe=.5-.25*Math.log((1+J)/(1-J))/Math.PI;return oe<0?0:oe>1?1:oe}function Ze(W,J,oe,be,Oe,it,pt,j){if(be/=J,it>=(oe/=J)&&pt<be)return W;if(pt<oe||it>=be)return null;for(var Q=[],Le=0;Le<W.length;Le++){var at=W[Le],Ee=at.geometry,ir=at.type,wr=Oe===0?at.minX:at.minY,An=Oe===0?at.maxX:at.maxY;if(wr>=oe&&An<be)Q.push(at);else if(!(An<oe||wr>=be)){var sn=[];if(ir==="Point"||ir==="MultiPoint")_t(Ee,sn,oe,be,Oe);else if(ir==="LineString")Wt(Ee,sn,oe,be,Oe,!1,j.lineMetrics);else if(ir==="MultiLineString")He(Ee,sn,oe,be,Oe,!1);else if(ir==="Polygon")He(Ee,sn,oe,be,Oe,!0);else if(ir==="MultiPolygon")for(var sr=0;sr<Ee.length;sr++){var en=[];He(Ee[sr],en,oe,be,Oe,!0),en.length&&sn.push(en)}if(sn.length){if(j.lineMetrics&&ir==="LineString"){for(sr=0;sr<sn.length;sr++)Q.push(Dn(at.id,ir,sn[sr],at.tags));continue}ir!=="LineString"&&ir!=="MultiLineString"||(sn.length===1?(ir="LineString",sn=sn[0]):ir="MultiLineString"),ir!=="Point"&&ir!=="MultiPoint"||(ir=sn.length===3?"Point":"MultiPoint"),Q.push(Dn(at.id,ir,sn,at.tags))}}}return Q.length?Q:null}function _t(W,J,oe,be,Oe){for(var it=0;it<W.length;it+=3){var pt=W[it+Oe];pt>=oe&&pt<=be&&(J.push(W[it]),J.push(W[it+1]),J.push(W[it+2]))}}function Wt(W,J,oe,be,Oe,it,pt){for(var j,Q,Le=Sr(W),at=Oe===0?cr:mr,Ee=W.start,ir=0;ir<W.length-3;ir+=3){var wr=W[ir],An=W[ir+1],sn=W[ir+2],sr=W[ir+3],en=W[ir+4],Wr=Oe===0?wr:An,Yr=Oe===0?sr:en,pi=!1;pt&&(j=Math.sqrt(Math.pow(wr-sr,2)+Math.pow(An-en,2))),Wr<oe?Yr>oe&&(Q=at(Le,wr,An,sr,en,oe),pt&&(Le.start=Ee+j*Q)):Wr>be?Yr<be&&(Q=at(Le,wr,An,sr,en,be),pt&&(Le.start=Ee+j*Q)):Et(Le,wr,An,sn),Yr<oe&&Wr>=oe&&(Q=at(Le,wr,An,sr,en,oe),pi=!0),Yr>be&&Wr<=be&&(Q=at(Le,wr,An,sr,en,be),pi=!0),!it&&pi&&(pt&&(Le.end=Ee+j*Q),J.push(Le),Le=Sr(W)),pt&&(Ee+=j)}var tn=W.length-3;wr=W[tn],An=W[tn+1],sn=W[tn+2],(Wr=Oe===0?wr:An)>=oe&&Wr<=be&&Et(Le,wr,An,sn),tn=Le.length-3,it&&tn>=3&&(Le[tn]!==Le[0]||Le[tn+1]!==Le[1])&&Et(Le,Le[0],Le[1],Le[2]),Le.length&&J.push(Le)}function Sr(W){var J=[];return J.size=W.size,J.start=W.start,J.end=W.end,J}function He(W,J,oe,be,Oe,it){for(var pt=0;pt<W.length;pt++)Wt(W[pt],J,oe,be,Oe,it,!1)}function Et(W,J,oe,be){W.push(J),W.push(oe),W.push(be)}function cr(W,J,oe,be,Oe,it){var pt=(it-J)/(be-J);return W.push(it),W.push(oe+(Oe-oe)*pt),W.push(1),pt}function mr(W,J,oe,be,Oe,it){var pt=(it-oe)/(Oe-oe);return W.push(J+(be-J)*pt),W.push(it),W.push(1),pt}function Zr(W,J){for(var oe=[],be=0;be<W.length;be++){var Oe,it=W[be],pt=it.type;if(pt==="Point"||pt==="MultiPoint"||pt==="LineString")Oe=Fn(it.geometry,J);else if(pt==="MultiLineString"||pt==="Polygon"){Oe=[];for(var j=0;j<it.geometry.length;j++)Oe.push(Fn(it.geometry[j],J))}else if(pt==="MultiPolygon")for(Oe=[],j=0;j<it.geometry.length;j++){for(var Q=[],Le=0;Le<it.geometry[j].length;Le++)Q.push(Fn(it.geometry[j][Le],J));Oe.push(Q)}oe.push(Dn(it.id,pt,Oe,it.tags))}return oe}function Fn(W,J){var oe=[];oe.size=W.size,W.start!==void 0&&(oe.start=W.start,oe.end=W.end);for(var be=0;be<W.length;be+=3)oe.push(W[be]+J,W[be+1],W[be+2]);return oe}function En(W,J){if(W.transformed)return W;var oe,be,Oe,it=1<<W.z,pt=W.x,j=W.y;for(oe=0;oe<W.features.length;oe++){var Q=W.features[oe],Le=Q.geometry,at=Q.type;if(Q.geometry=[],at===1)for(be=0;be<Le.length;be+=2)Q.geometry.push(Cn(Le[be],Le[be+1],J,it,pt,j));else for(be=0;be<Le.length;be++){var Ee=[];for(Oe=0;Oe<Le[be].length;Oe+=2)Ee.push(Cn(Le[be][Oe],Le[be][Oe+1],J,it,pt,j));Q.geometry.push(Ee)}}return W.transformed=!0,W}function Cn(W,J,oe,be,Oe,it){return[Math.round(oe*(W*be-Oe)),Math.round(oe*(J*be-it))]}function fn(W,J,oe,be,Oe){for(var it=J===Oe.maxZoom?0:Oe.tolerance/((1<<J)*Oe.extent),pt={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:oe,y:be,z:J,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},j=0;j<W.length;j++){pt.numFeatures++,ni(pt,W[j],it,Oe);var Q=W[j].minX,Le=W[j].minY,at=W[j].maxX,Ee=W[j].maxY;Q<pt.minX&&(pt.minX=Q),Le<pt.minY&&(pt.minY=Le),at>pt.maxX&&(pt.maxX=at),Ee>pt.maxY&&(pt.maxY=Ee)}return pt}function ni(W,J,oe,be){var Oe=J.geometry,it=J.type,pt=[];if(it==="Point"||it==="MultiPoint")for(var j=0;j<Oe.length;j+=3)pt.push(Oe[j]),pt.push(Oe[j+1]),W.numPoints++,W.numSimplified++;else if(it==="LineString")Yn(pt,Oe,W,oe,!1,!1);else if(it==="MultiLineString"||it==="Polygon")for(j=0;j<Oe.length;j++)Yn(pt,Oe[j],W,oe,it==="Polygon",j===0);else if(it==="MultiPolygon")for(var Q=0;Q<Oe.length;Q++){var Le=Oe[Q];for(j=0;j<Le.length;j++)Yn(pt,Le[j],W,oe,!0,j===0)}if(pt.length){var at=J.tags||null;if(it==="LineString"&&be.lineMetrics){for(var Ee in at={},J.tags)at[Ee]=J.tags[Ee];at.mapbox_clip_start=Oe.start/Oe.size,at.mapbox_clip_end=Oe.end/Oe.size}var ir={geometry:pt,type:it==="Polygon"||it==="MultiPolygon"?3:it==="LineString"||it==="MultiLineString"?2:1,tags:at};J.id!==null&&(ir.id=J.id),W.features.push(ir)}}function Yn(W,J,oe,be,Oe,it){var pt=be*be;if(be>0&&J.size<(Oe?pt:be))oe.numPoints+=J.length/3;else{for(var j=[],Q=0;Q<J.length;Q+=3)(be===0||J[Q+2]>pt)&&(oe.numSimplified++,j.push(J[Q]),j.push(J[Q+1])),oe.numPoints++;Oe&&function(Le,at){for(var Ee=0,ir=0,wr=Le.length,An=wr-2;ir<wr;An=ir,ir+=2)Ee+=(Le[ir]-Le[An])*(Le[ir+1]+Le[An+1]);if(Ee>0===at)for(ir=0,wr=Le.length;ir<wr/2;ir+=2){var sn=Le[ir],sr=Le[ir+1];Le[ir]=Le[wr-2-ir],Le[ir+1]=Le[wr-1-ir],Le[wr-2-ir]=sn,Le[wr-1-ir]=sr}}(j,it),W.push(j)}}function oa(W,J){var oe=(J=this.options=function(Oe,it){for(var pt in it)Oe[pt]=it[pt];return Oe}(Object.create(this.options),J)).debug;if(oe&&console.time("preprocess data"),J.maxZoom<0||J.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(J.promoteId&&J.generateId)throw new Error("promoteId and generateId cannot be used together.");var be=function(Oe,it){var pt=[];if(Oe.type==="FeatureCollection")for(var j=0;j<Oe.features.length;j++)Yi(pt,Oe.features[j],it,j);else Yi(pt,Oe.type==="Feature"?Oe:{geometry:Oe},it);return pt}(W,J);this.tiles={},this.tileCoords=[],oe&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",J.indexMaxZoom,J.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(be=function(Oe,it){var pt=it.buffer/it.extent,j=Oe,Q=Ze(Oe,1,-1-pt,pt,0,-1,2,it),Le=Ze(Oe,1,1-pt,2+pt,0,-1,2,it);return(Q||Le)&&(j=Ze(Oe,1,-pt,1+pt,0,-1,2,it)||[],Q&&(j=Zr(Q,1).concat(j)),Le&&(j=j.concat(Zr(Le,-1)))),j}(be,J)).length&&this.splitTile(be,0,0,0),oe&&(be.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Qi(W,J,oe){return 32*((1<<W)*oe+J)+W}function lo(W,J){var oe=W.tileID.canonical;if(!this._geoJSONIndex)return J(null,null);var be=this._geoJSONIndex.getTile(oe.z,oe.x,oe.y);if(!be)return J(null,null);var Oe=new xt(be.features),it=At(Oe);it.byteOffset===0&&it.byteLength===it.buffer.byteLength||(it=new Uint8Array(it)),J(null,{vectorTile:Oe,rawData:it.buffer})}Ht.prototype.load=function(W){var J=this.options,oe=J.log,be=J.minZoom,Oe=J.maxZoom,it=J.nodeSize;oe&&console.time("total time");var pt="prepare "+W.length+" points";oe&&console.time(pt),this.points=W;for(var j=[],Q=0;Q<W.length;Q++)W[Q].geometry&&j.push(Jr(W[Q],Q));this.trees[Oe+1]=new Xe(j,Si,Ri,it,Float32Array),oe&&console.timeEnd(pt);for(var Le=Oe;Le>=be;Le--){var at=+Date.now();j=this._cluster(j,Le),this.trees[Le]=new Xe(j,Si,Ri,it,Float32Array),oe&&console.log("z%d: %d clusters in %dms",Le,j.length,+Date.now()-at)}return oe&&console.timeEnd("total time"),this},Ht.prototype.getClusters=function(W,J){var oe=((W[0]+180)%360+360)%360-180,be=Math.max(-90,Math.min(90,W[1])),Oe=W[2]===180?180:((W[2]+180)%360+360)%360-180,it=Math.max(-90,Math.min(90,W[3]));if(W[2]-W[0]>=360)oe=-180,Oe=180;else if(oe>Oe){var pt=this.getClusters([oe,be,180,it],J),j=this.getClusters([-180,be,Oe,it],J);return pt.concat(j)}for(var Q=this.trees[this._limitZoom(J)],Le=[],at=0,Ee=Q.range(bn(oe),Kr(it),bn(Oe),Kr(be));at<Ee.length;at+=1){var ir=Q.points[Ee[at]];Le.push(ir.numPoints?Hr(ir):this.points[ir.index])}return Le},Ht.prototype.getChildren=function(W){var J=this._getOriginId(W),oe=this._getOriginZoom(W),be="No cluster with the specified id.",Oe=this.trees[oe];if(!Oe)throw new Error(be);var it=Oe.points[J];if(!it)throw new Error(be);for(var pt=this.options.radius/(this.options.extent*Math.pow(2,oe-1)),j=[],Q=0,Le=Oe.within(it.x,it.y,pt);Q<Le.length;Q+=1){var at=Oe.points[Le[Q]];at.parentId===W&&j.push(at.numPoints?Hr(at):this.points[at.index])}if(j.length===0)throw new Error(be);return j},Ht.prototype.getLeaves=function(W,J,oe){var be=[];return this._appendLeaves(be,W,J=J||10,oe=oe||0,0),be},Ht.prototype.getTile=function(W,J,oe){var be=this.trees[this._limitZoom(W)],Oe=Math.pow(2,W),it=this.options,pt=it.radius/it.extent,j=(oe-pt)/Oe,Q=(oe+1+pt)/Oe,Le={features:[]};return this._addTileFeatures(be.range((J-pt)/Oe,j,(J+1+pt)/Oe,Q),be.points,J,oe,Oe,Le),J===0&&this._addTileFeatures(be.range(1-pt/Oe,j,1,Q),be.points,Oe,oe,Oe,Le),J===Oe-1&&this._addTileFeatures(be.range(0,j,pt/Oe,Q),be.points,-1,oe,Oe,Le),Le.features.length?Le:null},Ht.prototype.getClusterExpansionZoom=function(W){for(var J=this._getOriginZoom(W)-1;J<=this.options.maxZoom;){var oe=this.getChildren(W);if(J++,oe.length!==1)break;W=oe[0].properties.cluster_id}return J},Ht.prototype._appendLeaves=function(W,J,oe,be,Oe){for(var it=0,pt=this.getChildren(J);it<pt.length;it+=1){var j=pt[it],Q=j.properties;if(Q&&Q.cluster?Oe+Q.point_count<=be?Oe+=Q.point_count:Oe=this._appendLeaves(W,Q.cluster_id,oe,be,Oe):Oe<be?Oe++:W.push(j),W.length===oe)break}return Oe},Ht.prototype._addTileFeatures=function(W,J,oe,be,Oe,it){for(var pt=0,j=W;pt<j.length;pt+=1){var Q=J[j[pt]],Le=Q.numPoints,at={type:1,geometry:[[Math.round(this.options.extent*(Q.x*Oe-oe)),Math.round(this.options.extent*(Q.y*Oe-be))]],tags:Le?Un(Q):this.points[Q.index].properties},Ee=void 0;Le?Ee=Q.id:this.options.generateId?Ee=Q.index:this.points[Q.index].id&&(Ee=this.points[Q.index].id),Ee!==void 0&&(at.id=Ee),it.features.push(at)}},Ht.prototype._limitZoom=function(W){return Math.max(this.options.minZoom,Math.min(+W,this.options.maxZoom+1))},Ht.prototype._cluster=function(W,J){for(var oe=[],be=this.options,Oe=be.reduce,it=be.minPoints,pt=be.radius/(be.extent*Math.pow(2,J)),j=0;j<W.length;j++){var Q=W[j];if(!(Q.zoom<=J)){Q.zoom=J;for(var Le=this.trees[J+1],at=Le.within(Q.x,Q.y,pt),Ee=Q.numPoints||1,ir=Ee,wr=0,An=at;wr<An.length;wr+=1){var sn=Le.points[An[wr]];sn.zoom>J&&(ir+=sn.numPoints||1)}if(ir>=it){for(var sr=Q.x*Ee,en=Q.y*Ee,Wr=Oe&&Ee>1?this._map(Q,!0):null,Yr=(j<<5)+(J+1)+this.points.length,pi=0,tn=at;pi<tn.length;pi+=1){var vi=Le.points[tn[pi]];if(!(vi.zoom<=J)){vi.zoom=J;var qi=vi.numPoints||1;sr+=vi.x*qi,en+=vi.y*qi,vi.parentId=Yr,Oe&&(Wr||(Wr=this._map(Q,!0)),Oe(Wr,this._map(vi)))}}Q.parentId=Yr,oe.push(on(sr/ir,en/ir,Yr,ir,Wr))}else if(oe.push(Q),ir>1)for(var ci=0,zi=at;ci<zi.length;ci+=1){var Ai=Le.points[zi[ci]];Ai.zoom<=J||(Ai.zoom=J,oe.push(Ai))}}}return oe},Ht.prototype._getOriginId=function(W){return W-this.points.length>>5},Ht.prototype._getOriginZoom=function(W){return(W-this.points.length)%32},Ht.prototype._map=function(W,J){if(W.numPoints)return J?Mi({},W.properties):W.properties;var oe=this.points[W.index].properties,be=this.options.map(oe);return J&&be===oe?Mi({},be):be},oa.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},oa.prototype.splitTile=function(W,J,oe,be,Oe,it,pt){for(var j=[W,J,oe,be],Q=this.options,Le=Q.debug;j.length;){be=j.pop(),oe=j.pop(),J=j.pop(),W=j.pop();var at=1<<J,Ee=Qi(J,oe,be),ir=this.tiles[Ee];if(!ir&&(Le>1&&console.time("creation"),ir=this.tiles[Ee]=fn(W,J,oe,be,Q),this.tileCoords.push({z:J,x:oe,y:be}),Le)){Le>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",J,oe,be,ir.numFeatures,ir.numPoints,ir.numSimplified),console.timeEnd("creation"));var wr="z"+J;this.stats[wr]=(this.stats[wr]||0)+1,this.total++}if(ir.source=W,Oe){if(J===Q.maxZoom||J===Oe)continue;var An=1<<Oe-J;if(oe!==Math.floor(it/An)||be!==Math.floor(pt/An))continue}else if(J===Q.indexMaxZoom||ir.numPoints<=Q.indexMaxPoints)continue;if(ir.source=null,W.length!==0){Le>1&&console.time("clipping");var sn,sr,en,Wr,Yr,pi,tn=.5*Q.buffer/Q.extent,vi=.5-tn,qi=.5+tn,ci=1+tn;sn=sr=en=Wr=null,Yr=Ze(W,at,oe-tn,oe+qi,0,ir.minX,ir.maxX,Q),pi=Ze(W,at,oe+vi,oe+ci,0,ir.minX,ir.maxX,Q),W=null,Yr&&(sn=Ze(Yr,at,be-tn,be+qi,1,ir.minY,ir.maxY,Q),sr=Ze(Yr,at,be+vi,be+ci,1,ir.minY,ir.maxY,Q),Yr=null),pi&&(en=Ze(pi,at,be-tn,be+qi,1,ir.minY,ir.maxY,Q),Wr=Ze(pi,at,be+vi,be+ci,1,ir.minY,ir.maxY,Q),pi=null),Le>1&&console.timeEnd("clipping"),j.push(sn||[],J+1,2*oe,2*be),j.push(sr||[],J+1,2*oe,2*be+1),j.push(en||[],J+1,2*oe+1,2*be),j.push(Wr||[],J+1,2*oe+1,2*be+1)}}},oa.prototype.getTile=function(W,J,oe){var be=this.options,Oe=be.extent,it=be.debug;if(W<0||W>24)return null;var pt=1<<W,j=Qi(W,J=(J%pt+pt)%pt,oe);if(this.tiles[j])return En(this.tiles[j],Oe);it>1&&console.log("drilling down to z%d-%d-%d",W,J,oe);for(var Q,Le=W,at=J,Ee=oe;!Q&&Le>0;)Le--,at=Math.floor(at/2),Ee=Math.floor(Ee/2),Q=this.tiles[Qi(Le,at,Ee)];return Q&&Q.source?(it>1&&console.log("found parent tile z%d-%d-%d",Le,at,Ee),it>1&&console.time("drilling down"),this.splitTile(Q.source,Le,at,Ee,W,J,oe),it>1&&console.timeEnd("drilling down"),this.tiles[j]?En(this.tiles[j],Oe):null):null};var Is=function(W){function J(oe,be,Oe,it){W.call(this,oe,be,Oe,lo),it&&(this.loadGeoJSON=it)}return W&&(J.__proto__=W),(J.prototype=Object.create(W&&W.prototype)).constructor=J,J.prototype.loadData=function(oe,be){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=be,this._pendingLoadDataParams=oe,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},J.prototype._loadData=function(){var oe=this;if(this._pendingCallback&&this._pendingLoadDataParams){var be=this._pendingCallback,Oe=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var it=!!(Oe&&Oe.request&&Oe.request.collectResourceTiming)&&new _.RequestPerformance(Oe.request);this.loadGeoJSON(Oe,function(pt,j){if(pt||!j)return be(pt);if(typeof j!="object")return be(new Error("Input data given to '"+Oe.source+"' is not a valid GeoJSON object."));(function ir(wr,An){var sn,sr=wr&&wr.type;if(sr==="FeatureCollection")for(sn=0;sn<wr.features.length;sn++)ir(wr.features[sn],An);else if(sr==="GeometryCollection")for(sn=0;sn<wr.geometries.length;sn++)ir(wr.geometries[sn],An);else if(sr==="Feature")ir(wr.geometry,An);else if(sr==="Polygon")Xt(wr.coordinates,An);else if(sr==="MultiPolygon")for(sn=0;sn<wr.coordinates.length;sn++)Xt(wr.coordinates[sn],An);return wr})(j,!0);try{if(Oe.filter){var Q=_.createExpression(Oe.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Q.result==="error")throw new Error(Q.value.map(function(ir){return ir.key+": "+ir.message}).join(", "));var Le=j.features.filter(function(ir){return Q.value.evaluate({zoom:0},ir)});j={type:"FeatureCollection",features:Le}}oe._geoJSONIndex=Oe.cluster?new Ht(function(ir){var wr=ir.superclusterOptions,An=ir.clusterProperties;if(!An||!wr)return wr;for(var sn={},sr={},en={accumulated:null,zoom:0},Wr={properties:null},Yr=Object.keys(An),pi=0,tn=Yr;pi<tn.length;pi+=1){var vi=tn[pi],qi=An[vi],ci=qi[0],zi=_.createExpression(qi[1]),Ai=_.createExpression(typeof ci=="string"?[ci,["accumulated"],["get",vi]]:ci);sn[vi]=zi.value,sr[vi]=Ai.value}return wr.map=function(Xo){Wr.properties=Xo;for(var Ji={},Ia=0,Ti=Yr;Ia<Ti.length;Ia+=1){var mi=Ti[Ia];Ji[mi]=sn[mi].evaluate(en,Wr)}return Ji},wr.reduce=function(Xo,Ji){Wr.properties=Ji;for(var Ia=0,Ti=Yr;Ia<Ti.length;Ia+=1){var mi=Ti[Ia];en.accumulated=Xo[mi],Xo[mi]=sr[mi].evaluate(en,Wr)}},wr}(Oe)).load(j.features):function(ir,wr){return new oa(ir,wr)}(j,Oe.geojsonVtOptions)}catch(ir){return be(ir)}oe.loaded={};var at={};if(it){var Ee=it.finish();Ee&&(at.resourceTiming={},at.resourceTiming[Oe.source]=JSON.parse(JSON.stringify(Ee)))}be(null,at)})}},J.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},J.prototype.reloadTile=function(oe,be){var Oe=this.loaded;return Oe&&Oe[oe.uid]?W.prototype.reloadTile.call(this,oe,be):this.loadTile(oe,be)},J.prototype.loadGeoJSON=function(oe,be){if(oe.request)_.getJSON(oe.request,be);else{if(typeof oe.data!="string")return be(new Error("Input data given to '"+oe.source+"' is not a valid GeoJSON object."));try{return be(null,JSON.parse(oe.data))}catch(Oe){return be(new Error("Input data given to '"+oe.source+"' is not a valid GeoJSON object."))}}},J.prototype.removeSource=function(oe,be){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),be()},J.prototype.getClusterExpansionZoom=function(oe,be){try{be(null,this._geoJSONIndex.getClusterExpansionZoom(oe.clusterId))}catch(Oe){be(Oe)}},J.prototype.getClusterChildren=function(oe,be){try{be(null,this._geoJSONIndex.getChildren(oe.clusterId))}catch(Oe){be(Oe)}},J.prototype.getClusterLeaves=function(oe,be){try{be(null,this._geoJSONIndex.getLeaves(oe.clusterId,oe.limit,oe.offset))}catch(Oe){be(Oe)}},J}(dt),hi=function(W){var J=this;this.self=W,this.actor=new _.Actor(W,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:dt,geojson:Is},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(oe,be){if(J.workerSourceTypes[oe])throw new Error('Worker source with name "'+oe+'" already registered.');J.workerSourceTypes[oe]=be},this.self.registerRTLTextPlugin=function(oe){if(_.plugin.isParsed())throw new Error("RTL text plugin already registered.");_.plugin.applyArabicShaping=oe.applyArabicShaping,_.plugin.processBidirectionalText=oe.processBidirectionalText,_.plugin.processStyledBidirectionalText=oe.processStyledBidirectionalText}};return hi.prototype.setReferrer=function(W,J){this.referrer=J},hi.prototype.setImages=function(W,J,oe){for(var be in this.availableImages[W]=J,this.workerSources[W]){var Oe=this.workerSources[W][be];for(var it in Oe)Oe[it].availableImages=J}oe()},hi.prototype.setLayers=function(W,J,oe){this.getLayerIndex(W).replace(J),oe()},hi.prototype.updateLayers=function(W,J,oe){this.getLayerIndex(W).update(J.layers,J.removedIds),oe()},hi.prototype.loadTile=function(W,J,oe){this.getWorkerSource(W,J.type,J.source).loadTile(J,oe)},hi.prototype.loadDEMTile=function(W,J,oe){this.getDEMWorkerSource(W,J.source).loadTile(J,oe)},hi.prototype.reloadTile=function(W,J,oe){this.getWorkerSource(W,J.type,J.source).reloadTile(J,oe)},hi.prototype.abortTile=function(W,J,oe){this.getWorkerSource(W,J.type,J.source).abortTile(J,oe)},hi.prototype.removeTile=function(W,J,oe){this.getWorkerSource(W,J.type,J.source).removeTile(J,oe)},hi.prototype.removeDEMTile=function(W,J){this.getDEMWorkerSource(W,J.source).removeTile(J)},hi.prototype.removeSource=function(W,J,oe){if(this.workerSources[W]&&this.workerSources[W][J.type]&&this.workerSources[W][J.type][J.source]){var be=this.workerSources[W][J.type][J.source];delete this.workerSources[W][J.type][J.source],be.removeSource!==void 0?be.removeSource(J,oe):oe()}},hi.prototype.loadWorkerSource=function(W,J,oe){try{this.self.importScripts(J.url),oe()}catch(be){oe(be.toString())}},hi.prototype.syncRTLPluginState=function(W,J,oe){try{_.plugin.setState(J);var be=_.plugin.getPluginURL();if(_.plugin.isLoaded()&&!_.plugin.isParsed()&&be!=null){this.self.importScripts(be);var Oe=_.plugin.isParsed();oe(Oe?void 0:new Error("RTL Text Plugin failed to import scripts from "+be),Oe)}}catch(it){oe(it.toString())}},hi.prototype.getAvailableImages=function(W){var J=this.availableImages[W];return J||(J=[]),J},hi.prototype.getLayerIndex=function(W){var J=this.layerIndexes[W];return J||(J=this.layerIndexes[W]=new fe),J},hi.prototype.getWorkerSource=function(W,J,oe){var be=this;return this.workerSources[W]||(this.workerSources[W]={}),this.workerSources[W][J]||(this.workerSources[W][J]={}),this.workerSources[W][J][oe]||(this.workerSources[W][J][oe]=new this.workerSourceTypes[J]({send:function(Oe,it,pt){be.actor.send(Oe,it,pt,W)}},this.getLayerIndex(W),this.getAvailableImages(W))),this.workerSources[W][J][oe]},hi.prototype.getDEMWorkerSource=function(W,J){return this.demWorkerSources[W]||(this.demWorkerSources[W]={}),this.demWorkerSources[W][J]||(this.demWorkerSources[W][J]=new wt),this.demWorkerSources[W][J]},hi.prototype.enforceCacheSizeLimit=function(W,J){_.enforceCacheSizeLimit(J)},typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope&&(self.worker=new hi(self)),hi}),he(["./shared"],function(_){"use strict";var le=_.createCommonjsModule(function(h){function d(S){return!p(S)}function p(S){return typeof window=="undefined"||typeof document=="undefined"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var C,P,Z=new Blob([""],{type:"text/javascript"}),Y=URL.createObjectURL(Z);try{P=new Worker(Y),C=!0}catch(pe){C=!1}return P&&P.terminate(),URL.revokeObjectURL(Y),C}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var C=document.createElement("canvas");C.width=C.height=1;var P=C.getContext("2d");if(!P)return!1;var Z=P.getImageData(0,0,1,1);return Z&&Z.width===C.width}()?(g[w=S&&S.failIfMajorPerformanceCaveat]===void 0&&(g[w]=function(C){var P=function(Y){var pe=document.createElement("canvas"),_e=Object.create(d.webGLContextAttributes);return _e.failIfMajorPerformanceCaveat=Y,pe.probablySupportsContext?pe.probablySupportsContext("webgl",_e)||pe.probablySupportsContext("experimental-webgl",_e):pe.supportsContext?pe.supportsContext("webgl",_e)||pe.supportsContext("experimental-webgl",_e):pe.getContext("webgl",_e)||pe.getContext("experimental-webgl",_e)}(C);if(!P)return!1;var Z=P.createShader(P.VERTEX_SHADER);return!(!Z||P.isContextLost())&&(P.shaderSource(Z,"void main() {}"),P.compileShader(Z),P.getShaderParameter(Z,P.COMPILE_STATUS)===!0)}(w)),g[w]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var w}h.exports?h.exports=d:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=d,window.mapboxgl.notSupportedReason=p);var g={};d.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),U={create:function(h,d,p){var g=_.window.document.createElement(h);return d!==void 0&&(g.className=d),p&&p.appendChild(g),g},createNS:function(h,d){return _.window.document.createElementNS(h,d)}},fe=_.window.document&&_.window.document.documentElement.style;function se(h){if(!fe)return h[0];for(var d=0;d<h.length;d++)if(h[d]in fe)return h[d];return h[0]}var Qe,ae=se(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);U.disableDrag=function(){fe&&ae&&(Qe=fe[ae],fe[ae]="none")},U.enableDrag=function(){fe&&ae&&(fe[ae]=Qe)};var et=se(["transform","WebkitTransform"]);U.setTransform=function(h,d){h.style[et]=d};var dt=!1;try{var Ye=Object.defineProperty({},"passive",{get:function(){dt=!0}});_.window.addEventListener("test",Ye,Ye),_.window.removeEventListener("test",Ye,Ye)}catch(h){dt=!1}U.addEventListener=function(h,d,p,g){g===void 0&&(g={}),h.addEventListener(d,p,"passive"in g&&dt?g:g.capture)},U.removeEventListener=function(h,d,p,g){g===void 0&&(g={}),h.removeEventListener(d,p,"passive"in g&&dt?g:g.capture)};var wt=function(h){h.preventDefault(),h.stopPropagation(),_.window.removeEventListener("click",wt,!0)};function Xt(h){var d=h.userImage;return!!(d&&d.render&&d.render())&&(h.data.replace(new Uint8Array(d.data.buffer)),!0)}U.suppressClick=function(){_.window.addEventListener("click",wt,!0),_.window.setTimeout(function(){_.window.removeEventListener("click",wt,!0)},0)},U.mousePos=function(h,d){var p=h.getBoundingClientRect();return new _.Point(d.clientX-p.left-h.clientLeft,d.clientY-p.top-h.clientTop)},U.touchPos=function(h,d){for(var p=h.getBoundingClientRect(),g=[],S=0;S<d.length;S++)g.push(new _.Point(d[S].clientX-p.left-h.clientLeft,d[S].clientY-p.top-h.clientTop));return g},U.mouseButton=function(h){return _.window.InstallTrigger!==void 0&&h.button===2&&h.ctrlKey&&_.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:h.button},U.remove=function(h){h.parentNode&&h.parentNode.removeChild(h)};var Zt=function(h){function d(){h.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new _.RGBAImage({width:1,height:1}),this.dirty=!0}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.isLoaded=function(){return this.loaded},d.prototype.setLoaded=function(p){if(this.loaded!==p&&(this.loaded=p,p)){for(var g=0,S=this.requestors;g<S.length;g+=1){var w=S[g];this._notify(w.ids,w.callback)}this.requestors=[]}},d.prototype.getImage=function(p){return this.images[p]},d.prototype.addImage=function(p,g){this._validate(p,g)&&(this.images[p]=g)},d.prototype._validate=function(p,g){var S=!0;return this._validateStretch(g.stretchX,g.data&&g.data.width)||(this.fire(new _.ErrorEvent(new Error('Image "'+p+'" has invalid "stretchX" value'))),S=!1),this._validateStretch(g.stretchY,g.data&&g.data.height)||(this.fire(new _.ErrorEvent(new Error('Image "'+p+'" has invalid "stretchY" value'))),S=!1),this._validateContent(g.content,g)||(this.fire(new _.ErrorEvent(new Error('Image "'+p+'" has invalid "content" value'))),S=!1),S},d.prototype._validateStretch=function(p,g){if(!p)return!0;for(var S=0,w=0,C=p;w<C.length;w+=1){var P=C[w];if(P[0]<S||P[1]<P[0]||g<P[1])return!1;S=P[1]}return!0},d.prototype._validateContent=function(p,g){return!(p&&(p.length!==4||p[0]<0||g.data.width<p[0]||p[1]<0||g.data.height<p[1]||p[2]<0||g.data.width<p[2]||p[3]<0||g.data.height<p[3]||p[2]<p[0]||p[3]<p[1]))},d.prototype.updateImage=function(p,g){g.version=this.images[p].version+1,this.images[p]=g,this.updatedImages[p]=!0},d.prototype.removeImage=function(p){var g=this.images[p];delete this.images[p],delete this.patterns[p],g.userImage&&g.userImage.onRemove&&g.userImage.onRemove()},d.prototype.listImages=function(){return Object.keys(this.images)},d.prototype.getImages=function(p,g){var S=!0;if(!this.isLoaded())for(var w=0,C=p;w<C.length;w+=1)this.images[C[w]]||(S=!1);this.isLoaded()||S?this._notify(p,g):this.requestors.push({ids:p,callback:g})},d.prototype._notify=function(p,g){for(var S={},w=0,C=p;w<C.length;w+=1){var P=C[w];this.images[P]||this.fire(new _.Event("styleimagemissing",{id:P}));var Z=this.images[P];Z?S[P]={data:Z.data.clone(),pixelRatio:Z.pixelRatio,sdf:Z.sdf,version:Z.version,stretchX:Z.stretchX,stretchY:Z.stretchY,content:Z.content,hasRenderCallback:!!(Z.userImage&&Z.userImage.render)}:_.warnOnce('Image "'+P+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}g(null,S)},d.prototype.getPixelSize=function(){var p=this.atlasImage;return{width:p.width,height:p.height}},d.prototype.getPattern=function(p){var g=this.patterns[p],S=this.getImage(p);if(!S)return null;if(g&&g.position.version===S.version)return g.position;if(g)g.position.version=S.version;else{var w={w:S.data.width+2,h:S.data.height+2,x:0,y:0},C=new _.ImagePosition(w,S);this.patterns[p]={bin:w,position:C}}return this._updatePatternAtlas(),this.patterns[p].position},d.prototype.bind=function(p){var g=p.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new _.Texture(p,this.atlasImage,g.RGBA),this.atlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE)},d.prototype._updatePatternAtlas=function(){var p=[];for(var g in this.patterns)p.push(this.patterns[g].bin);var S=_.potpack(p),w=S.w,C=S.h,P=this.atlasImage;for(var Z in P.resize({width:w||1,height:C||1}),this.patterns){var Y=this.patterns[Z].bin,pe=Y.x+1,_e=Y.y+1,ye=this.images[Z].data,Ue=ye.width,ke=ye.height;_.RGBAImage.copy(ye,P,{x:0,y:0},{x:pe,y:_e},{width:Ue,height:ke}),_.RGBAImage.copy(ye,P,{x:0,y:ke-1},{x:pe,y:_e-1},{width:Ue,height:1}),_.RGBAImage.copy(ye,P,{x:0,y:0},{x:pe,y:_e+ke},{width:Ue,height:1}),_.RGBAImage.copy(ye,P,{x:Ue-1,y:0},{x:pe-1,y:_e},{width:1,height:ke}),_.RGBAImage.copy(ye,P,{x:0,y:0},{x:pe+Ue,y:_e},{width:1,height:ke})}this.dirty=!0},d.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},d.prototype.dispatchRenderCallbacks=function(p){for(var g=0,S=p;g<S.length;g+=1){var w=S[g];if(!this.callbackDispatchedThisFrame[w]){this.callbackDispatchedThisFrame[w]=!0;var C=this.images[w];Xt(C)&&this.updateImage(w,C)}}},d}(_.Evented),nr=bt,Vt=bt,xt=1e20;function bt(h,d,p,g,S,w){this.fontSize=h||24,this.buffer=d===void 0?3:d,this.cutoff=g||.25,this.fontFamily=S||"sans-serif",this.fontWeight=w||"normal",this.radius=p||8;var C=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=C,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(C*C),this.gridInner=new Float64Array(C*C),this.f=new Float64Array(C),this.d=new Float64Array(C),this.z=new Float64Array(C+1),this.v=new Int16Array(C),this.middle=Math.round(C/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Tr(h,d,p,g,S,w,C){for(var P=0;P<d;P++){for(var Z=0;Z<p;Z++)g[Z]=h[Z*d+P];for(hr(g,S,w,C,p),Z=0;Z<p;Z++)h[Z*d+P]=S[Z]}for(Z=0;Z<p;Z++){for(P=0;P<d;P++)g[P]=h[Z*d+P];for(hr(g,S,w,C,d),P=0;P<d;P++)h[Z*d+P]=Math.sqrt(S[P])}}function hr(h,d,p,g,S){p[0]=0,g[0]=-xt,g[1]=+xt;for(var w=1,C=0;w<S;w++){for(var P=(h[w]+w*w-(h[p[C]]+p[C]*p[C]))/(2*w-2*p[C]);P<=g[C];)C--,P=(h[w]+w*w-(h[p[C]]+p[C]*p[C]))/(2*w-2*p[C]);p[++C]=w,g[C]=P,g[C+1]=+xt}for(w=0,C=0;w<S;w++){for(;g[C+1]<w;)C++;d[w]=(w-p[C])*(w-p[C])+h[p[C]]}}bt.prototype.draw=function(h){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(h,this.buffer,this.middle);for(var d=this.ctx.getImageData(0,0,this.size,this.size),p=new Uint8ClampedArray(this.size*this.size),g=0;g<this.size*this.size;g++){var S=d.data[4*g+3]/255;this.gridOuter[g]=S===1?0:S===0?xt:Math.pow(Math.max(0,.5-S),2),this.gridInner[g]=S===1?xt:S===0?0:Math.pow(Math.max(0,S-.5),2)}for(Tr(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),Tr(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),g=0;g<this.size*this.size;g++)p[g]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[g]-this.gridInner[g])/this.radius+this.cutoff))));return p},nr.default=Vt;var lr=function(h,d){this.requestManager=h,this.localIdeographFontFamily=d,this.entries={}};lr.prototype.setURL=function(h){this.url=h},lr.prototype.getGlyphs=function(h,d){var p=this,g=[];for(var S in h)for(var w=0,C=h[S];w<C.length;w+=1)g.push({stack:S,id:C[w]});_.asyncAll(g,function(P,Z){var Y=P.stack,pe=P.id,_e=p.entries[Y];_e||(_e=p.entries[Y]={glyphs:{},requests:{},ranges:{}});var ye=_e.glyphs[pe];if(ye===void 0){if(ye=p._tinySDF(_e,Y,pe))return _e.glyphs[pe]=ye,void Z(null,{stack:Y,id:pe,glyph:ye});var Ue=Math.floor(pe/256);if(256*Ue>65535)Z(new Error("glyphs > 65535 not supported"));else if(_e.ranges[Ue])Z(null,{stack:Y,id:pe,glyph:ye});else{var ke=_e.requests[Ue];ke||(ke=_e.requests[Ue]=[],lr.loadGlyphRange(Y,Ue,p.url,p.requestManager,function(Ke,Ie){if(Ie){for(var $e in Ie)p._doesCharSupportLocalGlyph(+$e)||(_e.glyphs[+$e]=Ie[+$e]);_e.ranges[Ue]=!0}for(var vt=0,Rt=ke;vt<Rt.length;vt+=1)(0,Rt[vt])(Ke,Ie);delete _e.requests[Ue]})),ke.push(function(Ke,Ie){Ke?Z(Ke):Ie&&Z(null,{stack:Y,id:pe,glyph:Ie[pe]||null})})}}else Z(null,{stack:Y,id:pe,glyph:ye})},function(P,Z){if(P)d(P);else if(Z){for(var Y={},pe=0,_e=Z;pe<_e.length;pe+=1){var ye=_e[pe],Ue=ye.stack,ke=ye.id,Ke=ye.glyph;(Y[Ue]||(Y[Ue]={}))[ke]=Ke&&{id:Ke.id,bitmap:Ke.bitmap.clone(),metrics:Ke.metrics}}d(null,Y)}})},lr.prototype._doesCharSupportLocalGlyph=function(h){return!!this.localIdeographFontFamily&&(_.isChar["CJK Unified Ideographs"](h)||_.isChar["Hangul Syllables"](h)||_.isChar.Hiragana(h)||_.isChar.Katakana(h))},lr.prototype._tinySDF=function(h,d,p){var g=this.localIdeographFontFamily;if(g&&this._doesCharSupportLocalGlyph(p)){var S=h.tinySDF;if(!S){var w="400";/bold/i.test(d)?w="900":/medium/i.test(d)?w="500":/light/i.test(d)&&(w="200"),S=h.tinySDF=new lr.TinySDF(24,3,8,.25,g,w)}return{id:p,bitmap:new _.AlphaImage({width:30,height:30},S.draw(String.fromCharCode(p))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},lr.loadGlyphRange=function(h,d,p,g,S){var w=256*d,C=w+255,P=g.transformRequest(g.normalizeGlyphsURL(p).replace("{fontstack}",h).replace("{range}",w+"-"+C),_.ResourceType.Glyphs);_.getArrayBuffer(P,function(Z,Y){if(Z)S(Z);else if(Y){for(var pe={},_e=0,ye=_.parseGlyphPBF(Y);_e<ye.length;_e+=1){var Ue=ye[_e];pe[Ue.id]=Ue}S(null,pe)}})},lr.TinySDF=nr;var At=function(){this.specification=_.styleSpec.light.position};At.prototype.possiblyEvaluate=function(h,d){return _.sphericalToCartesian(h.expression.evaluate(d))},At.prototype.interpolate=function(h,d,p){return{x:_.number(h.x,d.x,p),y:_.number(h.y,d.y,p),z:_.number(h.z,d.z,p)}};var ut=new _.Properties({anchor:new _.DataConstantProperty(_.styleSpec.light.anchor),position:new At,color:new _.DataConstantProperty(_.styleSpec.light.color),intensity:new _.DataConstantProperty(_.styleSpec.light.intensity)}),It=function(h){function d(p){h.call(this),this._transitionable=new _.Transitionable(ut),this.setLight(p),this._transitioning=this._transitionable.untransitioned()}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getLight=function(){return this._transitionable.serialize()},d.prototype.setLight=function(p,g){if(g===void 0&&(g={}),!this._validate(_.validateLight,p,g))for(var S in p){var w=p[S];_.endsWith(S,"-transition")?this._transitionable.setTransition(S.slice(0,-11),w):this._transitionable.setValue(S,w)}},d.prototype.updateTransitions=function(p){this._transitioning=this._transitionable.transitioned(p,this._transitioning)},d.prototype.hasTransition=function(){return this._transitioning.hasTransition()},d.prototype.recalculate=function(p){this.properties=this._transitioning.possiblyEvaluate(p)},d.prototype._validate=function(p,g,S){return(!S||S.validate!==!1)&&_.emitValidationErrors(this,p.call(_.validateStyle,_.extend({value:g,style:{glyphs:!0,sprite:!0},styleSpec:_.styleSpec})))},d}(_.Evented),qe=function(h,d){this.width=h,this.height=d,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};qe.prototype.getDash=function(h,d){var p=h.join(",")+String(d);return this.dashEntry[p]||(this.dashEntry[p]=this.addDash(h,d)),this.dashEntry[p]},qe.prototype.getDashRanges=function(h,d,p){var g=[],S=h.length%2==1?-h[h.length-1]*p:0,w=h[0]*p,C=!0;g.push({left:S,right:w,isDash:C,zeroLength:h[0]===0});for(var P=h[0],Z=1;Z<h.length;Z++){var Y=h[Z];g.push({left:S=P*p,right:w=(P+=Y)*p,isDash:C=!C,zeroLength:Y===0})}return g},qe.prototype.addRoundDash=function(h,d,p){for(var g=d/2,S=-p;S<=p;S++)for(var w=this.width*(this.nextRow+p+S),C=0,P=h[C],Z=0;Z<this.width;Z++){Z/P.right>1&&(P=h[++C]);var Y=Math.abs(Z-P.left),pe=Math.abs(Z-P.right),_e=Math.min(Y,pe),ye=void 0,Ue=S/p*(g+1);if(P.isDash){var ke=g-Math.abs(Ue);ye=Math.sqrt(_e*_e+ke*ke)}else ye=g-Math.sqrt(_e*_e+Ue*Ue);this.data[w+Z]=Math.max(0,Math.min(255,ye+128))}},qe.prototype.addRegularDash=function(h){for(var d=h.length-1;d>=0;--d){var p=h[d],g=h[d+1];p.zeroLength?h.splice(d,1):g&&g.isDash===p.isDash&&(g.left=p.left,h.splice(d,1))}var S=h[0],w=h[h.length-1];S.isDash===w.isDash&&(S.left=w.left-this.width,w.right=S.right+this.width);for(var C=this.width*this.nextRow,P=0,Z=h[P],Y=0;Y<this.width;Y++){Y/Z.right>1&&(Z=h[++P]);var pe=Math.abs(Y-Z.left),_e=Math.abs(Y-Z.right),ye=Math.min(pe,_e);this.data[C+Y]=Math.max(0,Math.min(255,(Z.isDash?ye:-ye)+128))}},qe.prototype.addDash=function(h,d){var p=d?7:0,g=2*p+1;if(this.nextRow+g>this.height)return _.warnOnce("LineAtlas out of space"),null;for(var S=0,w=0;w<h.length;w++)S+=h[w];if(S!==0){var C=this.width/S,P=this.getDashRanges(h,this.width,C);d?this.addRoundDash(P,C,p):this.addRegularDash(P)}var Z={y:(this.nextRow+p+.5)/this.height,height:2*p/this.height,width:S};return this.nextRow+=g,this.dirty=!0,Z},qe.prototype.bind=function(h){var d=h.gl;this.texture?(d.bindTexture(d.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,d.texSubImage2D(d.TEXTURE_2D,0,0,0,this.width,this.height,d.ALPHA,d.UNSIGNED_BYTE,this.data))):(this.texture=d.createTexture(),d.bindTexture(d.TEXTURE_2D,this.texture),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.REPEAT),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.REPEAT),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texImage2D(d.TEXTURE_2D,0,d.ALPHA,this.width,this.height,0,d.ALPHA,d.UNSIGNED_BYTE,this.data))};var Ct=function h(d,p){this.workerPool=d,this.actors=[],this.currentActor=0,this.id=_.uniqueId();for(var g=this.workerPool.acquire(this.id),S=0;S<g.length;S++){var w=new h.Actor(g[S],p,this.id);w.name="Worker "+S,this.actors.push(w)}};function fr(h,d,p){var g=function(S,w){if(S)return p(S);if(w){var C=_.pick(_.extend(w,h),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);w.vector_layers&&(C.vectorLayers=w.vector_layers,C.vectorLayerIds=C.vectorLayers.map(function(P){return P.id})),C.tiles=d.canonicalizeTileset(C,h.url),p(null,C)}};return h.url?_.getJSON(d.transformRequest(d.normalizeSourceURL(h.url),_.ResourceType.Source),g):_.browser.frame(function(){return g(null,h)})}Ct.prototype.broadcast=function(h,d,p){_.asyncAll(this.actors,function(g,S){g.send(h,d,S)},p=p||function(){})},Ct.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Ct.prototype.remove=function(){this.actors.forEach(function(h){h.remove()}),this.actors=[],this.workerPool.release(this.id)},Ct.Actor=_.Actor;var re=function(h,d,p){this.bounds=_.LngLatBounds.convert(this.validateBounds(h)),this.minzoom=d||0,this.maxzoom=p||24};re.prototype.validateBounds=function(h){return Array.isArray(h)&&h.length===4?[Math.max(-180,h[0]),Math.max(-90,h[1]),Math.min(180,h[2]),Math.min(90,h[3])]:[-180,-90,180,90]},re.prototype.contains=function(h){var d=Math.pow(2,h.z),p=Math.floor(_.mercatorXfromLng(this.bounds.getWest())*d),g=Math.floor(_.mercatorYfromLat(this.bounds.getNorth())*d),S=Math.ceil(_.mercatorXfromLng(this.bounds.getEast())*d),w=Math.ceil(_.mercatorYfromLat(this.bounds.getSouth())*d);return h.x>=p&&h.x<S&&h.y>=g&&h.y<w};var V=function(h){function d(p,g,S,w){if(h.call(this),this.id=p,this.dispatcher=S,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,_.extend(this,_.pick(g,["url","scheme","tileSize","promoteId"])),this._options=_.extend({type:"vector"},g),this._collectResourceTiming=g.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(w)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.load=function(){var p=this;this._loaded=!1,this.fire(new _.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=fr(this._options,this.map._requestManager,function(g,S){p._tileJSONRequest=null,p._loaded=!0,g?p.fire(new _.ErrorEvent(g)):S&&(_.extend(p,S),S.bounds&&(p.tileBounds=new re(S.bounds,p.minzoom,p.maxzoom)),_.postTurnstileEvent(S.tiles,p.map._requestManager._customAccessToken),_.postMapLoadEvent(S.tiles,p.map._getMapId(),p.map._requestManager._skuToken,p.map._requestManager._customAccessToken),p.fire(new _.Event("data",{dataType:"source",sourceDataType:"metadata"})),p.fire(new _.Event("data",{dataType:"source",sourceDataType:"content"})))})},d.prototype.loaded=function(){return this._loaded},d.prototype.hasTile=function(p){return!this.tileBounds||this.tileBounds.contains(p.canonical)},d.prototype.onAdd=function(p){this.map=p,this.load()},d.prototype.setSourceProperty=function(p){this._tileJSONRequest&&this._tileJSONRequest.cancel(),p(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},d.prototype.setTiles=function(p){var g=this;return this.setSourceProperty(function(){g._options.tiles=p}),this},d.prototype.setUrl=function(p){var g=this;return this.setSourceProperty(function(){g.url=p,g._options.url=p}),this},d.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},d.prototype.serialize=function(){return _.extend({},this._options)},d.prototype.loadTile=function(p,g){var S=this.map._requestManager.normalizeTileURL(p.tileID.canonical.url(this.tiles,this.scheme)),w={request:this.map._requestManager.transformRequest(S,_.ResourceType.Tile),uid:p.uid,tileID:p.tileID,zoom:p.tileID.overscaledZ,tileSize:this.tileSize*p.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:_.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function C(P,Z){return delete p.request,p.aborted?g(null):P&&P.status!==404?g(P):(Z&&Z.resourceTiming&&(p.resourceTiming=Z.resourceTiming),this.map._refreshExpiredTiles&&Z&&p.setExpiryData(Z),p.loadVectorData(Z,this.map.painter),_.cacheEntryPossiblyAdded(this.dispatcher),g(null),void(p.reloadCallback&&(this.loadTile(p,p.reloadCallback),p.reloadCallback=null)))}w.request.collectResourceTiming=this._collectResourceTiming,p.actor&&p.state!=="expired"?p.state==="loading"?p.reloadCallback=g:p.request=p.actor.send("reloadTile",w,C.bind(this)):(p.actor=this.dispatcher.getActor(),p.request=p.actor.send("loadTile",w,C.bind(this)))},d.prototype.abortTile=function(p){p.request&&(p.request.cancel(),delete p.request),p.actor&&p.actor.send("abortTile",{uid:p.uid,type:this.type,source:this.id},void 0)},d.prototype.unloadTile=function(p){p.unloadVectorData(),p.actor&&p.actor.send("removeTile",{uid:p.uid,type:this.type,source:this.id},void 0)},d.prototype.hasTransition=function(){return!1},d}(_.Evented),K=function(h){function d(p,g,S,w){h.call(this),this.id=p,this.dispatcher=S,this.setEventedParent(w),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=_.extend({type:"raster"},g),_.extend(this,_.pick(g,["url","scheme","tileSize"]))}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.load=function(){var p=this;this._loaded=!1,this.fire(new _.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=fr(this._options,this.map._requestManager,function(g,S){p._tileJSONRequest=null,p._loaded=!0,g?p.fire(new _.ErrorEvent(g)):S&&(_.extend(p,S),S.bounds&&(p.tileBounds=new re(S.bounds,p.minzoom,p.maxzoom)),_.postTurnstileEvent(S.tiles),_.postMapLoadEvent(S.tiles,p.map._getMapId(),p.map._requestManager._skuToken),p.fire(new _.Event("data",{dataType:"source",sourceDataType:"metadata"})),p.fire(new _.Event("data",{dataType:"source",sourceDataType:"content"})))})},d.prototype.loaded=function(){return this._loaded},d.prototype.onAdd=function(p){this.map=p,this.load()},d.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},d.prototype.serialize=function(){return _.extend({},this._options)},d.prototype.hasTile=function(p){return!this.tileBounds||this.tileBounds.contains(p.canonical)},d.prototype.loadTile=function(p,g){var S=this,w=this.map._requestManager.normalizeTileURL(p.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);p.request=_.getImage(this.map._requestManager.transformRequest(w,_.ResourceType.Tile),function(C,P){if(delete p.request,p.aborted)p.state="unloaded",g(null);else if(C)p.state="errored",g(C);else if(P){S.map._refreshExpiredTiles&&p.setExpiryData(P),delete P.cacheControl,delete P.expires;var Z=S.map.painter.context,Y=Z.gl;p.texture=S.map.painter.getTileTexture(P.width),p.texture?p.texture.update(P,{useMipmap:!0}):(p.texture=new _.Texture(Z,P,Y.RGBA,{useMipmap:!0}),p.texture.bind(Y.LINEAR,Y.CLAMP_TO_EDGE,Y.LINEAR_MIPMAP_NEAREST),Z.extTextureFilterAnisotropic&&Y.texParameterf(Y.TEXTURE_2D,Z.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Z.extTextureFilterAnisotropicMax)),p.state="loaded",_.cacheEntryPossiblyAdded(S.dispatcher),g(null)}})},d.prototype.abortTile=function(p,g){p.request&&(p.request.cancel(),delete p.request),g()},d.prototype.unloadTile=function(p,g){p.texture&&this.map.painter.saveTileTexture(p.texture),g()},d.prototype.hasTransition=function(){return!1},d}(_.Evented),Me=function(h){function d(p,g,S,w){h.call(this,p,g,S,w),this.type="raster-dem",this.maxzoom=22,this._options=_.extend({type:"raster-dem"},g),this.encoding=g.encoding||"mapbox"}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},d.prototype.loadTile=function(p,g){var S=this.map._requestManager.normalizeTileURL(p.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function w(C,P){C&&(p.state="errored",g(C)),P&&(p.dem=P,p.needsHillshadePrepare=!0,p.state="loaded",g(null))}p.request=_.getImage(this.map._requestManager.transformRequest(S,_.ResourceType.Tile),function(C,P){if(delete p.request,p.aborted)p.state="unloaded",g(null);else if(C)p.state="errored",g(C);else if(P){this.map._refreshExpiredTiles&&p.setExpiryData(P),delete P.cacheControl,delete P.expires;var Z=_.window.ImageBitmap&&P instanceof _.window.ImageBitmap&&_.offscreenCanvasSupported()?P:_.browser.getImageData(P,1),Y={uid:p.uid,coord:p.tileID,source:this.id,rawImageData:Z,encoding:this.encoding};p.actor&&p.state!=="expired"||(p.actor=this.dispatcher.getActor(),p.actor.send("loadDEMTile",Y,w.bind(this)))}}.bind(this)),p.neighboringTiles=this._getNeighboringTiles(p.tileID)},d.prototype._getNeighboringTiles=function(p){var g=p.canonical,S=Math.pow(2,g.z),w=(g.x-1+S)%S,C=g.x===0?p.wrap-1:p.wrap,P=(g.x+1+S)%S,Z=g.x+1===S?p.wrap+1:p.wrap,Y={};return Y[new _.OverscaledTileID(p.overscaledZ,C,g.z,w,g.y).key]={backfilled:!1},Y[new _.OverscaledTileID(p.overscaledZ,Z,g.z,P,g.y).key]={backfilled:!1},g.y>0&&(Y[new _.OverscaledTileID(p.overscaledZ,C,g.z,w,g.y-1).key]={backfilled:!1},Y[new _.OverscaledTileID(p.overscaledZ,p.wrap,g.z,g.x,g.y-1).key]={backfilled:!1},Y[new _.OverscaledTileID(p.overscaledZ,Z,g.z,P,g.y-1).key]={backfilled:!1}),g.y+1<S&&(Y[new _.OverscaledTileID(p.overscaledZ,C,g.z,w,g.y+1).key]={backfilled:!1},Y[new _.OverscaledTileID(p.overscaledZ,p.wrap,g.z,g.x,g.y+1).key]={backfilled:!1},Y[new _.OverscaledTileID(p.overscaledZ,Z,g.z,P,g.y+1).key]={backfilled:!1}),Y},d.prototype.unloadTile=function(p){p.demTexture&&this.map.painter.saveTileTexture(p.demTexture),p.fbo&&(p.fbo.destroy(),delete p.fbo),p.dem&&delete p.dem,delete p.neighboringTiles,p.state="unloaded",p.actor&&p.actor.send("removeDEMTile",{uid:p.uid,source:this.id})},d}(K),Se=function(h){function d(p,g,S,w){h.call(this),this.id=p,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=S.getActor(),this.setEventedParent(w),this._data=g.data,this._options=_.extend({},g),this._collectResourceTiming=g.collectResourceTiming,this._resourceTiming=[],g.maxzoom!==void 0&&(this.maxzoom=g.maxzoom),g.type&&(this.type=g.type),g.attribution&&(this.attribution=g.attribution),this.promoteId=g.promoteId;var C=_.EXTENT/this.tileSize;this.workerOptions=_.extend({source:this.id,cluster:g.cluster||!1,geojsonVtOptions:{buffer:(g.buffer!==void 0?g.buffer:128)*C,tolerance:(g.tolerance!==void 0?g.tolerance:.375)*C,extent:_.EXTENT,maxZoom:this.maxzoom,lineMetrics:g.lineMetrics||!1,generateId:g.generateId||!1},superclusterOptions:{maxZoom:g.clusterMaxZoom!==void 0?Math.min(g.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,g.clusterMinPoints||2),extent:_.EXTENT,radius:(g.clusterRadius||50)*C,log:!1,generateId:g.generateId||!1},clusterProperties:g.clusterProperties,filter:g.filter},g.workerOptions)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.load=function(){var p=this;this.fire(new _.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(g){if(g)p.fire(new _.ErrorEvent(g));else{var S={dataType:"source",sourceDataType:"metadata"};p._collectResourceTiming&&p._resourceTiming&&p._resourceTiming.length>0&&(S.resourceTiming=p._resourceTiming,p._resourceTiming=[]),p.fire(new _.Event("data",S))}})},d.prototype.onAdd=function(p){this.map=p,this.load()},d.prototype.setData=function(p){var g=this;return this._data=p,this.fire(new _.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(S){if(S)g.fire(new _.ErrorEvent(S));else{var w={dataType:"source",sourceDataType:"content"};g._collectResourceTiming&&g._resourceTiming&&g._resourceTiming.length>0&&(w.resourceTiming=g._resourceTiming,g._resourceTiming=[]),g.fire(new _.Event("data",w))}}),this},d.prototype.getClusterExpansionZoom=function(p,g){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:p,source:this.id},g),this},d.prototype.getClusterChildren=function(p,g){return this.actor.send("geojson.getClusterChildren",{clusterId:p,source:this.id},g),this},d.prototype.getClusterLeaves=function(p,g,S,w){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:p,limit:g,offset:S},w),this},d.prototype._updateWorkerData=function(p){var g=this;this._loaded=!1;var S=_.extend({},this.workerOptions),w=this._data;typeof w=="string"?(S.request=this.map._requestManager.transformRequest(_.browser.resolveURL(w),_.ResourceType.Source),S.request.collectResourceTiming=this._collectResourceTiming):S.data=JSON.stringify(w),this.actor.send(this.type+".loadData",S,function(C,P){g._removed||P&&P.abandoned||(g._loaded=!0,P&&P.resourceTiming&&P.resourceTiming[g.id]&&(g._resourceTiming=P.resourceTiming[g.id].slice(0)),g.actor.send(g.type+".coalesce",{source:S.source},null),p(C))})},d.prototype.loaded=function(){return this._loaded},d.prototype.loadTile=function(p,g){var S=this,w=p.actor?"reloadTile":"loadTile";p.actor=this.actor,p.request=this.actor.send(w,{type:this.type,uid:p.uid,tileID:p.tileID,zoom:p.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:_.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},function(C,P){return delete p.request,p.unloadVectorData(),p.aborted?g(null):C?g(C):(p.loadVectorData(P,S.map.painter,w==="reloadTile"),g(null))})},d.prototype.abortTile=function(p){p.request&&(p.request.cancel(),delete p.request),p.aborted=!0},d.prototype.unloadTile=function(p){p.unloadVectorData(),this.actor.send("removeTile",{uid:p.uid,type:this.type,source:this.id})},d.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},d.prototype.serialize=function(){return _.extend({},this._options,{type:this.type,data:this._data})},d.prototype.hasTransition=function(){return!1},d}(_.Evented),nt=_.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),te=function(h){function d(p,g,S,w){h.call(this),this.id=p,this.dispatcher=S,this.coordinates=g.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(w),this.options=g}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.load=function(p,g){var S=this;this._loaded=!1,this.fire(new _.Event("dataloading",{dataType:"source"})),this.url=this.options.url,_.getImage(this.map._requestManager.transformRequest(this.url,_.ResourceType.Image),function(w,C){S._loaded=!0,w?S.fire(new _.ErrorEvent(w)):C&&(S.image=C,p&&(S.coordinates=p),g&&g(),S._finishLoading())})},d.prototype.loaded=function(){return this._loaded},d.prototype.updateImage=function(p){var g=this;return this.image&&p.url?(this.options.url=p.url,this.load(p.coordinates,function(){g.texture=null}),this):this},d.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new _.Event("data",{dataType:"source",sourceDataType:"metadata"})))},d.prototype.onAdd=function(p){this.map=p,this.load()},d.prototype.setCoordinates=function(p){var g=this;this.coordinates=p;var S=p.map(_.MercatorCoordinate.fromLngLat);this.tileID=function(C){for(var P=1/0,Z=1/0,Y=-1/0,pe=-1/0,_e=0,ye=C;_e<ye.length;_e+=1){var Ue=ye[_e];P=Math.min(P,Ue.x),Z=Math.min(Z,Ue.y),Y=Math.max(Y,Ue.x),pe=Math.max(pe,Ue.y)}var ke=Math.max(Y-P,pe-Z),Ke=Math.max(0,Math.floor(-Math.log(ke)/Math.LN2)),Ie=Math.pow(2,Ke);return new _.CanonicalTileID(Ke,Math.floor((P+Y)/2*Ie),Math.floor((Z+pe)/2*Ie))}(S),this.minzoom=this.maxzoom=this.tileID.z;var w=S.map(function(C){return g.tileID.getTilePoint(C)._round()});return this._boundsArray=new _.StructArrayLayout4i8,this._boundsArray.emplaceBack(w[0].x,w[0].y,0,0),this._boundsArray.emplaceBack(w[1].x,w[1].y,_.EXTENT,0),this._boundsArray.emplaceBack(w[3].x,w[3].y,0,_.EXTENT),this._boundsArray.emplaceBack(w[2].x,w[2].y,_.EXTENT,_.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new _.Event("data",{dataType:"source",sourceDataType:"content"})),this},d.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var p=this.map.painter.context,g=p.gl;for(var S in this.boundsBuffer||(this.boundsBuffer=p.createVertexBuffer(this._boundsArray,nt.members)),this.boundsSegments||(this.boundsSegments=_.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new _.Texture(p,this.image,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE)),this.tiles){var w=this.tiles[S];w.state!=="loaded"&&(w.state="loaded",w.texture=this.texture)}}},d.prototype.loadTile=function(p,g){this.tileID&&this.tileID.equals(p.tileID.canonical)?(this.tiles[String(p.tileID.wrap)]=p,p.buckets={},g(null)):(p.state="errored",g(null))},d.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},d.prototype.hasTransition=function(){return!1},d}(_.Evented),Ce=function(h){function d(p,g,S,w){h.call(this,p,g,S,w),this.roundZoom=!0,this.type="video",this.options=g}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.load=function(){var p=this;this._loaded=!1;var g=this.options;this.urls=[];for(var S=0,w=g.urls;S<w.length;S+=1)this.urls.push(this.map._requestManager.transformRequest(w[S],_.ResourceType.Source).url);_.getVideo(this.urls,function(C,P){p._loaded=!0,C?p.fire(new _.ErrorEvent(C)):P&&(p.video=P,p.video.loop=!0,p.video.setAttribute("playsinline",""),p.video.addEventListener("playing",function(){p.map.triggerRepaint()}),p.map&&p.video.play(),p._finishLoading())})},d.prototype.pause=function(){this.video&&this.video.pause()},d.prototype.play=function(){this.video&&this.video.play()},d.prototype.seek=function(p){if(this.video){var g=this.video.seekable;p<g.start(0)||p>g.end(0)?this.fire(new _.ErrorEvent(new _.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+g.start(0)+" and "+g.end(0)+"-second mark."))):this.video.currentTime=p}},d.prototype.getVideo=function(){return this.video},d.prototype.onAdd=function(p){this.map||(this.map=p,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},d.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var p=this.map.painter.context,g=p.gl;for(var S in this.boundsBuffer||(this.boundsBuffer=p.createVertexBuffer(this._boundsArray,nt.members)),this.boundsSegments||(this.boundsSegments=_.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE),g.texSubImage2D(g.TEXTURE_2D,0,0,0,g.RGBA,g.UNSIGNED_BYTE,this.video)):(this.texture=new _.Texture(p,this.video,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE)),this.tiles){var w=this.tiles[S];w.state!=="loaded"&&(w.state="loaded",w.texture=this.texture)}}},d.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},d.prototype.hasTransition=function(){return this.video&&!this.video.paused},d}(te),we=function(h){function d(p,g,S,w){h.call(this,p,g,S,w),g.coordinates?Array.isArray(g.coordinates)&&g.coordinates.length===4&&!g.coordinates.some(function(C){return!Array.isArray(C)||C.length!==2||C.some(function(P){return typeof P!="number"})})||this.fire(new _.ErrorEvent(new _.ValidationError("sources."+p,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new _.ErrorEvent(new _.ValidationError("sources."+p,null,'missing required property "coordinates"'))),g.animate&&typeof g.animate!="boolean"&&this.fire(new _.ErrorEvent(new _.ValidationError("sources."+p,null,'optional "animate" property must be a boolean value'))),g.canvas?typeof g.canvas=="string"||g.canvas instanceof _.window.HTMLCanvasElement||this.fire(new _.ErrorEvent(new _.ValidationError("sources."+p,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new _.ErrorEvent(new _.ValidationError("sources."+p,null,'missing required property "canvas"'))),this.options=g,this.animate=g.animate===void 0||g.animate}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof _.window.HTMLCanvasElement?this.options.canvas:_.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new _.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},d.prototype.getCanvas=function(){return this.canvas},d.prototype.onAdd=function(p){this.map=p,this.load(),this.canvas&&this.animate&&this.play()},d.prototype.onRemove=function(){this.pause()},d.prototype.prepare=function(){var p=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,p=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,p=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var g=this.map.painter.context,S=g.gl;for(var w in this.boundsBuffer||(this.boundsBuffer=g.createVertexBuffer(this._boundsArray,nt.members)),this.boundsSegments||(this.boundsSegments=_.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(p||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new _.Texture(g,this.canvas,S.RGBA,{premultiply:!0}),this.tiles){var C=this.tiles[w];C.state!=="loaded"&&(C.state="loaded",C.texture=this.texture)}}},d.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},d.prototype.hasTransition=function(){return this._playing},d.prototype._hasInvalidDimensions=function(){for(var p=0,g=[this.canvas.width,this.canvas.height];p<g.length;p+=1){var S=g[p];if(isNaN(S)||S<=0)return!0}return!1},d}(te),Xe={vector:V,raster:K,"raster-dem":Me,geojson:Se,video:Ce,image:te,canvas:we};function Lt(h,d){var p=_.identity([]);return _.translate(p,p,[1,1,0]),_.scale(p,p,[.5*h.width,.5*h.height,1]),_.multiply(p,p,h.calculatePosMatrix(d.toUnwrapped()))}function Ht(h,d,p,g,S,w){var C=function(Ke,Ie,$e){if(Ke)for(var vt=0,Rt=Ke;vt<Rt.length;vt+=1){var Jt=Ie[Rt[vt]];if(Jt&&Jt.source===$e&&Jt.type==="fill-extrusion")return!0}else for(var zt in Ie){var ar=Ie[zt];if(ar.source===$e&&ar.type==="fill-extrusion")return!0}return!1}(S&&S.layers,d,h.id),P=w.maxPitchScaleFactor(),Z=h.tilesIn(g,P,C);Z.sort(on);for(var Y=[],pe=0,_e=Z;pe<_e.length;pe+=1){var ye=_e[pe];Y.push({wrappedTileID:ye.tileID.wrapped().key,queryResults:ye.tile.queryRenderedFeatures(d,p,h._state,ye.queryGeometry,ye.cameraQueryGeometry,ye.scale,S,w,P,Lt(h.transform,ye.tileID))})}var Ue=function(Ke){for(var Ie={},$e={},vt=0,Rt=Ke;vt<Rt.length;vt+=1){var Jt=Rt[vt],zt=Jt.queryResults,ar=Jt.wrappedTileID,_r=$e[ar]=$e[ar]||{};for(var Nr in zt)for(var kr=zt[Nr],un=_r[Nr]=_r[Nr]||{},Pn=Ie[Nr]=Ie[Nr]||[],zn=0,Zn=kr;zn<Zn.length;zn+=1){var Wi=Zn[zn];un[Wi.featureIndex]||(un[Wi.featureIndex]=!0,Pn.push(Wi))}}return Ie}(Y);for(var ke in Ue)Ue[ke].forEach(function(Ke){var Ie=Ke.feature,$e=h.getFeatureState(Ie.layer["source-layer"],Ie.id);Ie.source=Ie.layer.source,Ie.layer["source-layer"]&&(Ie.sourceLayer=Ie.layer["source-layer"]),Ie.state=$e});return Ue}function on(h,d){var p=h.tileID,g=d.tileID;return p.overscaledZ-g.overscaledZ||p.canonical.y-g.canonical.y||p.wrap-g.wrap||p.canonical.x-g.canonical.x}var Jr=function(h,d){this.max=h,this.onRemove=d,this.reset()};Jr.prototype.reset=function(){for(var h in this.data)for(var d=0,p=this.data[h];d<p.length;d+=1){var g=p[d];g.timeout&&clearTimeout(g.timeout),this.onRemove(g.value)}return this.data={},this.order=[],this},Jr.prototype.add=function(h,d,p){var g=this,S=h.wrapped().key;this.data[S]===void 0&&(this.data[S]=[]);var w={value:d,timeout:void 0};if(p!==void 0&&(w.timeout=setTimeout(function(){g.remove(h,w)},p)),this.data[S].push(w),this.order.push(S),this.order.length>this.max){var C=this._getAndRemoveByKey(this.order[0]);C&&this.onRemove(C)}return this},Jr.prototype.has=function(h){return h.wrapped().key in this.data},Jr.prototype.getAndRemove=function(h){return this.has(h)?this._getAndRemoveByKey(h.wrapped().key):null},Jr.prototype._getAndRemoveByKey=function(h){var d=this.data[h].shift();return d.timeout&&clearTimeout(d.timeout),this.data[h].length===0&&delete this.data[h],this.order.splice(this.order.indexOf(h),1),d.value},Jr.prototype.getByKey=function(h){var d=this.data[h];return d?d[0].value:null},Jr.prototype.get=function(h){return this.has(h)?this.data[h.wrapped().key][0].value:null},Jr.prototype.remove=function(h,d){if(!this.has(h))return this;var p=h.wrapped().key,g=d===void 0?0:this.data[p].indexOf(d),S=this.data[p][g];return this.data[p].splice(g,1),S.timeout&&clearTimeout(S.timeout),this.data[p].length===0&&delete this.data[p],this.onRemove(S.value),this.order.splice(this.order.indexOf(p),1),this},Jr.prototype.setMaxSize=function(h){for(this.max=h;this.order.length>this.max;){var d=this._getAndRemoveByKey(this.order[0]);d&&this.onRemove(d)}return this},Jr.prototype.filter=function(h){var d=[];for(var p in this.data)for(var g=0,S=this.data[p];g<S.length;g+=1){var w=S[g];h(w.value)||d.push(w)}for(var C=0,P=d;C<P.length;C+=1){var Z=P[C];this.remove(Z.value.tileID,Z)}};var Hr=function(h,d,p){this.context=h;var g=h.gl;this.buffer=g.createBuffer(),this.dynamicDraw=!!p,this.context.unbindVAO(),h.bindElementBuffer.set(this.buffer),g.bufferData(g.ELEMENT_ARRAY_BUFFER,d.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete d.arrayBuffer};Hr.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Hr.prototype.updateData=function(h){var d=this.context.gl;this.context.unbindVAO(),this.bind(),d.bufferSubData(d.ELEMENT_ARRAY_BUFFER,0,h.arrayBuffer)},Hr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Un={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},bn=function(h,d,p,g){this.length=d.length,this.attributes=p,this.itemSize=d.bytesPerElement,this.dynamicDraw=g,this.context=h;var S=h.gl;this.buffer=S.createBuffer(),h.bindVertexBuffer.set(this.buffer),S.bufferData(S.ARRAY_BUFFER,d.arrayBuffer,this.dynamicDraw?S.DYNAMIC_DRAW:S.STATIC_DRAW),this.dynamicDraw||delete d.arrayBuffer};bn.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},bn.prototype.updateData=function(h){var d=this.context.gl;this.bind(),d.bufferSubData(d.ARRAY_BUFFER,0,h.arrayBuffer)},bn.prototype.enableAttributes=function(h,d){for(var p=0;p<this.attributes.length;p++){var g=d.attributes[this.attributes[p].name];g!==void 0&&h.enableVertexAttribArray(g)}},bn.prototype.setVertexAttribPointers=function(h,d,p){for(var g=0;g<this.attributes.length;g++){var S=this.attributes[g],w=d.attributes[S.name];w!==void 0&&h.vertexAttribPointer(w,S.components,h[Un[S.type]],!1,this.itemSize,S.offset+this.itemSize*(p||0))}},bn.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Kr=function(h){this.gl=h.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};Kr.prototype.get=function(){return this.current},Kr.prototype.set=function(h){},Kr.prototype.getDefault=function(){return this.default},Kr.prototype.setDefault=function(){this.set(this.default)};var Mi=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return _.Color.transparent},d.prototype.set=function(p){var g=this.current;(p.r!==g.r||p.g!==g.g||p.b!==g.b||p.a!==g.a||this.dirty)&&(this.gl.clearColor(p.r,p.g,p.b,p.a),this.current=p,this.dirty=!1)},d}(Kr),Si=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return 1},d.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.clearDepth(p),this.current=p,this.dirty=!1)},d}(Kr),Ri=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return 0},d.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.clearStencil(p),this.current=p,this.dirty=!1)},d}(Kr),Gn=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return[!0,!0,!0,!0]},d.prototype.set=function(p){var g=this.current;(p[0]!==g[0]||p[1]!==g[1]||p[2]!==g[2]||p[3]!==g[3]||this.dirty)&&(this.gl.colorMask(p[0],p[1],p[2],p[3]),this.current=p,this.dirty=!1)},d}(Kr),Dn=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return!0},d.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.depthMask(p),this.current=p,this.dirty=!1)},d}(Kr),Ya=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return 255},d.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.stencilMask(p),this.current=p,this.dirty=!1)},d}(Kr),Yi=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},d.prototype.set=function(p){var g=this.current;(p.func!==g.func||p.ref!==g.ref||p.mask!==g.mask||this.dirty)&&(this.gl.stencilFunc(p.func,p.ref,p.mask),this.current=p,this.dirty=!1)},d}(Kr),Na=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){var p=this.gl;return[p.KEEP,p.KEEP,p.KEEP]},d.prototype.set=function(p){var g=this.current;(p[0]!==g[0]||p[1]!==g[1]||p[2]!==g[2]||this.dirty)&&(this.gl.stencilOp(p[0],p[1],p[2]),this.current=p,this.dirty=!1)},d}(Kr),Dt=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return!1},d.prototype.set=function(p){if(p!==this.current||this.dirty){var g=this.gl;p?g.enable(g.STENCIL_TEST):g.disable(g.STENCIL_TEST),this.current=p,this.dirty=!1}},d}(Kr),k=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return[0,1]},d.prototype.set=function(p){var g=this.current;(p[0]!==g[0]||p[1]!==g[1]||this.dirty)&&(this.gl.depthRange(p[0],p[1]),this.current=p,this.dirty=!1)},d}(Kr),ie=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return!1},d.prototype.set=function(p){if(p!==this.current||this.dirty){var g=this.gl;p?g.enable(g.DEPTH_TEST):g.disable(g.DEPTH_TEST),this.current=p,this.dirty=!1}},d}(Kr),ve=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return this.gl.LESS},d.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.depthFunc(p),this.current=p,this.dirty=!1)},d}(Kr),Ze=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return!1},d.prototype.set=function(p){if(p!==this.current||this.dirty){var g=this.gl;p?g.enable(g.BLEND):g.disable(g.BLEND),this.current=p,this.dirty=!1}},d}(Kr),_t=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){var p=this.gl;return[p.ONE,p.ZERO]},d.prototype.set=function(p){var g=this.current;(p[0]!==g[0]||p[1]!==g[1]||this.dirty)&&(this.gl.blendFunc(p[0],p[1]),this.current=p,this.dirty=!1)},d}(Kr),Wt=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return _.Color.transparent},d.prototype.set=function(p){var g=this.current;(p.r!==g.r||p.g!==g.g||p.b!==g.b||p.a!==g.a||this.dirty)&&(this.gl.blendColor(p.r,p.g,p.b,p.a),this.current=p,this.dirty=!1)},d}(Kr),Sr=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return this.gl.FUNC_ADD},d.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.blendEquation(p),this.current=p,this.dirty=!1)},d}(Kr),He=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return!1},d.prototype.set=function(p){if(p!==this.current||this.dirty){var g=this.gl;p?g.enable(g.CULL_FACE):g.disable(g.CULL_FACE),this.current=p,this.dirty=!1}},d}(Kr),Et=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return this.gl.BACK},d.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.cullFace(p),this.current=p,this.dirty=!1)},d}(Kr),cr=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return this.gl.CCW},d.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.frontFace(p),this.current=p,this.dirty=!1)},d}(Kr),mr=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return null},d.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.useProgram(p),this.current=p,this.dirty=!1)},d}(Kr),Zr=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return this.gl.TEXTURE0},d.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.activeTexture(p),this.current=p,this.dirty=!1)},d}(Kr),Fn=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){var p=this.gl;return[0,0,p.drawingBufferWidth,p.drawingBufferHeight]},d.prototype.set=function(p){var g=this.current;(p[0]!==g[0]||p[1]!==g[1]||p[2]!==g[2]||p[3]!==g[3]||this.dirty)&&(this.gl.viewport(p[0],p[1],p[2],p[3]),this.current=p,this.dirty=!1)},d}(Kr),En=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return null},d.prototype.set=function(p){if(p!==this.current||this.dirty){var g=this.gl;g.bindFramebuffer(g.FRAMEBUFFER,p),this.current=p,this.dirty=!1}},d}(Kr),Cn=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return null},d.prototype.set=function(p){if(p!==this.current||this.dirty){var g=this.gl;g.bindRenderbuffer(g.RENDERBUFFER,p),this.current=p,this.dirty=!1}},d}(Kr),fn=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return null},d.prototype.set=function(p){if(p!==this.current||this.dirty){var g=this.gl;g.bindTexture(g.TEXTURE_2D,p),this.current=p,this.dirty=!1}},d}(Kr),ni=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return null},d.prototype.set=function(p){if(p!==this.current||this.dirty){var g=this.gl;g.bindBuffer(g.ARRAY_BUFFER,p),this.current=p,this.dirty=!1}},d}(Kr),Yn=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return null},d.prototype.set=function(p){var g=this.gl;g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,p),this.current=p,this.dirty=!1},d}(Kr),oa=function(h){function d(p){h.call(this,p),this.vao=p.extVertexArrayObject}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return null},d.prototype.set=function(p){this.vao&&(p!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(p),this.current=p,this.dirty=!1)},d}(Kr),Qi=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return 4},d.prototype.set=function(p){if(p!==this.current||this.dirty){var g=this.gl;g.pixelStorei(g.UNPACK_ALIGNMENT,p),this.current=p,this.dirty=!1}},d}(Kr),lo=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return!1},d.prototype.set=function(p){if(p!==this.current||this.dirty){var g=this.gl;g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,p),this.current=p,this.dirty=!1}},d}(Kr),Is=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return!1},d.prototype.set=function(p){if(p!==this.current||this.dirty){var g=this.gl;g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,p),this.current=p,this.dirty=!1}},d}(Kr),hi=function(h){function d(p,g){h.call(this,p),this.context=p,this.parent=g}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getDefault=function(){return null},d}(Kr),W=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.setDirty=function(){this.dirty=!0},d.prototype.set=function(p){if(p!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var g=this.gl;g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,p,0),this.current=p,this.dirty=!1}},d}(hi),J=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.set=function(p){if(p!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var g=this.gl;g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_ATTACHMENT,g.RENDERBUFFER,p),this.current=p,this.dirty=!1}},d}(hi),oe=function(h,d,p,g){this.context=h,this.width=d,this.height=p;var S=this.framebuffer=h.gl.createFramebuffer();this.colorAttachment=new W(h,S),g&&(this.depthAttachment=new J(h,S))};oe.prototype.destroy=function(){var h=this.context.gl,d=this.colorAttachment.get();if(d&&h.deleteTexture(d),this.depthAttachment){var p=this.depthAttachment.get();p&&h.deleteRenderbuffer(p)}h.deleteFramebuffer(this.framebuffer)};var be=function(h,d,p){this.func=h,this.mask=d,this.range=p};be.ReadOnly=!1,be.ReadWrite=!0,be.disabled=new be(519,be.ReadOnly,[0,1]);var Oe=function(h,d,p,g,S,w){this.test=h,this.ref=d,this.mask=p,this.fail=g,this.depthFail=S,this.pass=w};Oe.disabled=new Oe({func:519,mask:0},0,0,7680,7680,7680);var it=function(h,d,p){this.blendFunction=h,this.blendColor=d,this.mask=p};it.disabled=new it(it.Replace=[1,0],_.Color.transparent,[!1,!1,!1,!1]),it.unblended=new it(it.Replace,_.Color.transparent,[!0,!0,!0,!0]),it.alphaBlended=new it([1,771],_.Color.transparent,[!0,!0,!0,!0]);var pt=function(h,d,p){this.enable=h,this.mode=d,this.frontFace=p};pt.disabled=new pt(!1,1029,2305),pt.backCCW=new pt(!0,1029,2305);var j=function(h){this.gl=h,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Mi(this),this.clearDepth=new Si(this),this.clearStencil=new Ri(this),this.colorMask=new Gn(this),this.depthMask=new Dn(this),this.stencilMask=new Ya(this),this.stencilFunc=new Yi(this),this.stencilOp=new Na(this),this.stencilTest=new Dt(this),this.depthRange=new k(this),this.depthTest=new ie(this),this.depthFunc=new ve(this),this.blend=new Ze(this),this.blendFunc=new _t(this),this.blendColor=new Wt(this),this.blendEquation=new Sr(this),this.cullFace=new He(this),this.cullFaceSide=new Et(this),this.frontFace=new cr(this),this.program=new mr(this),this.activeTexture=new Zr(this),this.viewport=new Fn(this),this.bindFramebuffer=new En(this),this.bindRenderbuffer=new Cn(this),this.bindTexture=new fn(this),this.bindVertexBuffer=new ni(this),this.bindElementBuffer=new Yn(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new oa(this),this.pixelStoreUnpack=new Qi(this),this.pixelStoreUnpackPremultiplyAlpha=new lo(this),this.pixelStoreUnpackFlipY=new Is(this),this.extTextureFilterAnisotropic=h.getExtension("EXT_texture_filter_anisotropic")||h.getExtension("MOZ_EXT_texture_filter_anisotropic")||h.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=h.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=h.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(h.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=h.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=h.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=h.getParameter(h.MAX_TEXTURE_SIZE)};j.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},j.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},j.prototype.createIndexBuffer=function(h,d){return new Hr(this,h,d)},j.prototype.createVertexBuffer=function(h,d,p){return new bn(this,h,d,p)},j.prototype.createRenderbuffer=function(h,d,p){var g=this.gl,S=g.createRenderbuffer();return this.bindRenderbuffer.set(S),g.renderbufferStorage(g.RENDERBUFFER,h,d,p),this.bindRenderbuffer.set(null),S},j.prototype.createFramebuffer=function(h,d,p){return new oe(this,h,d,p)},j.prototype.clear=function(h){var d=h.color,p=h.depth,g=this.gl,S=0;d&&(S|=g.COLOR_BUFFER_BIT,this.clearColor.set(d),this.colorMask.set([!0,!0,!0,!0])),p!==void 0&&(S|=g.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(p),this.depthMask.set(!0)),g.clear(S)},j.prototype.setCullFace=function(h){h.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(h.mode),this.frontFace.set(h.frontFace))},j.prototype.setDepthMode=function(h){h.func!==this.gl.ALWAYS||h.mask?(this.depthTest.set(!0),this.depthFunc.set(h.func),this.depthMask.set(h.mask),this.depthRange.set(h.range)):this.depthTest.set(!1)},j.prototype.setStencilMode=function(h){h.test.func!==this.gl.ALWAYS||h.mask?(this.stencilTest.set(!0),this.stencilMask.set(h.mask),this.stencilOp.set([h.fail,h.depthFail,h.pass]),this.stencilFunc.set({func:h.test.func,ref:h.ref,mask:h.test.mask})):this.stencilTest.set(!1)},j.prototype.setColorMode=function(h){_.deepEqual(h.blendFunction,it.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(h.blendFunction),this.blendColor.set(h.blendColor)),this.colorMask.set(h.mask)},j.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Q=function(h){function d(p,g,S){var w=this;h.call(this),this.id=p,this.dispatcher=S,this.on("data",function(C){C.dataType==="source"&&C.sourceDataType==="metadata"&&(w._sourceLoaded=!0),w._sourceLoaded&&!w._paused&&C.dataType==="source"&&C.sourceDataType==="content"&&(w.reload(),w.transform&&w.update(w.transform))}),this.on("error",function(){w._sourceErrored=!0}),this._source=function(C,P,Z,Y){var pe=new Xe[P.type](C,P,Z,Y);if(pe.id!==C)throw new Error("Expected Source id to be "+C+" instead of "+pe.id);return _.bindAll(["load","abort","unload","serialize","prepare"],pe),pe}(p,g,S,this),this._tiles={},this._cache=new Jr(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new _.SourceFeatureState}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.onAdd=function(p){this.map=p,this._maxTileCacheSize=p?p._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(p)},d.prototype.onRemove=function(p){this._source&&this._source.onRemove&&this._source.onRemove(p)},d.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var p in this._tiles){var g=this._tiles[p];if(g.state!=="loaded"&&g.state!=="errored")return!1}return!0},d.prototype.getSource=function(){return this._source},d.prototype.pause=function(){this._paused=!0},d.prototype.resume=function(){if(this._paused){var p=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,p&&this.reload(),this.transform&&this.update(this.transform)}},d.prototype._loadTile=function(p,g){return this._source.loadTile(p,g)},d.prototype._unloadTile=function(p){if(this._source.unloadTile)return this._source.unloadTile(p,function(){})},d.prototype._abortTile=function(p){if(this._source.abortTile)return this._source.abortTile(p,function(){})},d.prototype.serialize=function(){return this._source.serialize()},d.prototype.prepare=function(p){for(var g in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var S=this._tiles[g];S.upload(p),S.prepare(this.map.style.imageManager)}},d.prototype.getIds=function(){return _.values(this._tiles).map(function(p){return p.tileID}).sort(Le).map(function(p){return p.key})},d.prototype.getRenderableIds=function(p){var g=this,S=[];for(var w in this._tiles)this._isIdRenderable(w,p)&&S.push(this._tiles[w]);return p?S.sort(function(C,P){var Z=C.tileID,Y=P.tileID,pe=new _.Point(Z.canonical.x,Z.canonical.y)._rotate(g.transform.angle),_e=new _.Point(Y.canonical.x,Y.canonical.y)._rotate(g.transform.angle);return Z.overscaledZ-Y.overscaledZ||_e.y-pe.y||_e.x-pe.x}).map(function(C){return C.tileID.key}):S.map(function(C){return C.tileID}).sort(Le).map(function(C){return C.key})},d.prototype.hasRenderableParent=function(p){var g=this.findLoadedParent(p,0);return!!g&&this._isIdRenderable(g.tileID.key)},d.prototype._isIdRenderable=function(p,g){return this._tiles[p]&&this._tiles[p].hasData()&&!this._coveredTiles[p]&&(g||!this._tiles[p].holdingForFade())},d.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var p in this._cache.reset(),this._tiles)this._tiles[p].state!=="errored"&&this._reloadTile(p,"reloading")},d.prototype._reloadTile=function(p,g){var S=this._tiles[p];S&&(S.state!=="loading"&&(S.state=g),this._loadTile(S,this._tileLoaded.bind(this,S,p,g)))},d.prototype._tileLoaded=function(p,g,S,w){if(w)return p.state="errored",void(w.status!==404?this._source.fire(new _.ErrorEvent(w,{tile:p})):this.update(this.transform));p.timeAdded=_.browser.now(),S==="expired"&&(p.refreshedUponExpiration=!0),this._setTileReloadTimer(g,p),this.getSource().type==="raster-dem"&&p.dem&&this._backfillDEM(p),this._state.initializeTileState(p,this.map?this.map.painter:null),this._source.fire(new _.Event("data",{dataType:"source",tile:p,coord:p.tileID}))},d.prototype._backfillDEM=function(p){for(var g=this.getRenderableIds(),S=0;S<g.length;S++){var w=g[S];if(p.neighboringTiles&&p.neighboringTiles[w]){var C=this.getTileByID(w);P(p,C),P(C,p)}}function P(Z,Y){Z.needsHillshadePrepare=!0;var pe=Y.tileID.canonical.x-Z.tileID.canonical.x,_e=Y.tileID.canonical.y-Z.tileID.canonical.y,ye=Math.pow(2,Z.tileID.canonical.z),Ue=Y.tileID.key;pe===0&&_e===0||Math.abs(_e)>1||(Math.abs(pe)>1&&(Math.abs(pe+ye)===1?pe+=ye:Math.abs(pe-ye)===1&&(pe-=ye)),Y.dem&&Z.dem&&(Z.dem.backfillBorder(Y.dem,pe,_e),Z.neighboringTiles&&Z.neighboringTiles[Ue]&&(Z.neighboringTiles[Ue].backfilled=!0)))}},d.prototype.getTile=function(p){return this.getTileByID(p.key)},d.prototype.getTileByID=function(p){return this._tiles[p]},d.prototype._retainLoadedChildren=function(p,g,S,w){for(var C in this._tiles){var P=this._tiles[C];if(!(w[C]||!P.hasData()||P.tileID.overscaledZ<=g||P.tileID.overscaledZ>S)){for(var Z=P.tileID;P&&P.tileID.overscaledZ>g+1;){var Y=P.tileID.scaledTo(P.tileID.overscaledZ-1);(P=this._tiles[Y.key])&&P.hasData()&&(Z=Y)}for(var pe=Z;pe.overscaledZ>g;)if(p[(pe=pe.scaledTo(pe.overscaledZ-1)).key]){w[Z.key]=Z;break}}}},d.prototype.findLoadedParent=function(p,g){if(p.key in this._loadedParentTiles){var S=this._loadedParentTiles[p.key];return S&&S.tileID.overscaledZ>=g?S:null}for(var w=p.overscaledZ-1;w>=g;w--){var C=p.scaledTo(w),P=this._getLoadedTile(C);if(P)return P}},d.prototype._getLoadedTile=function(p){var g=this._tiles[p.key];return g&&g.hasData()?g:this._cache.getByKey(p.wrapped().key)},d.prototype.updateCacheSize=function(p){var g=Math.ceil(p.width/this._source.tileSize)+1,S=Math.ceil(p.height/this._source.tileSize)+1,w=Math.floor(g*S*5),C=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,w):w;this._cache.setMaxSize(C)},d.prototype.handleWrapJump=function(p){var g=Math.round((p-(this._prevLng===void 0?p:this._prevLng))/360);if(this._prevLng=p,g){var S={};for(var w in this._tiles){var C=this._tiles[w];C.tileID=C.tileID.unwrapTo(C.tileID.wrap+g),S[C.tileID.key]=C}for(var P in this._tiles=S,this._timers)clearTimeout(this._timers[P]),delete this._timers[P];for(var Z in this._tiles)this._setTileReloadTimer(Z,this._tiles[Z])}},d.prototype.update=function(p){var g=this;if(this.transform=p,this._sourceLoaded&&!this._paused){var S;this.updateCacheSize(p),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?S=p.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(_r){return new _.OverscaledTileID(_r.canonical.z,_r.wrap,_r.canonical.z,_r.canonical.x,_r.canonical.y)}):(S=p.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(S=S.filter(function(_r){return g._source.hasTile(_r)}))):S=[];var w=p.coveringZoomLevel(this._source),C=Math.max(w-d.maxOverzooming,this._source.minzoom),P=Math.max(w+d.maxUnderzooming,this._source.minzoom),Z=this._updateRetainedTiles(S,w);if(at(this._source.type)){for(var Y={},pe={},_e=0,ye=Object.keys(Z);_e<ye.length;_e+=1){var Ue=ye[_e],ke=Z[Ue],Ke=this._tiles[Ue];if(Ke&&!(Ke.fadeEndTime&&Ke.fadeEndTime<=_.browser.now())){var Ie=this.findLoadedParent(ke,C);Ie&&(this._addTile(Ie.tileID),Y[Ie.tileID.key]=Ie.tileID),pe[Ue]=ke}}for(var $e in this._retainLoadedChildren(pe,w,P,Z),Y)Z[$e]||(this._coveredTiles[$e]=!0,Z[$e]=Y[$e])}for(var vt in Z)this._tiles[vt].clearFadeHold();for(var Rt=0,Jt=_.keysDifference(this._tiles,Z);Rt<Jt.length;Rt+=1){var zt=Jt[Rt],ar=this._tiles[zt];ar.hasSymbolBuckets&&!ar.holdingForFade()?ar.setHoldDuration(this.map._fadeDuration):ar.hasSymbolBuckets&&!ar.symbolFadeFinished()||this._removeTile(zt)}this._updateLoadedParentTileCache()}},d.prototype.releaseSymbolFadeTiles=function(){for(var p in this._tiles)this._tiles[p].holdingForFade()&&this._removeTile(p)},d.prototype._updateRetainedTiles=function(p,g){for(var S={},w={},C=Math.max(g-d.maxOverzooming,this._source.minzoom),P=Math.max(g+d.maxUnderzooming,this._source.minzoom),Z={},Y=0,pe=p;Y<pe.length;Y+=1){var _e=pe[Y],ye=this._addTile(_e);S[_e.key]=_e,ye.hasData()||g<this._source.maxzoom&&(Z[_e.key]=_e)}this._retainLoadedChildren(Z,g,P,S);for(var Ue=0,ke=p;Ue<ke.length;Ue+=1){var Ke=ke[Ue],Ie=this._tiles[Ke.key];if(!Ie.hasData()){if(g+1>this._source.maxzoom){var $e=Ke.children(this._source.maxzoom)[0],vt=this.getTile($e);if(vt&&vt.hasData()){S[$e.key]=$e;continue}}else{var Rt=Ke.children(this._source.maxzoom);if(S[Rt[0].key]&&S[Rt[1].key]&&S[Rt[2].key]&&S[Rt[3].key])continue}for(var Jt=Ie.wasRequested(),zt=Ke.overscaledZ-1;zt>=C;--zt){var ar=Ke.scaledTo(zt);if(w[ar.key]||(w[ar.key]=!0,!(Ie=this.getTile(ar))&&Jt&&(Ie=this._addTile(ar)),Ie&&(S[ar.key]=ar,Jt=Ie.wasRequested(),Ie.hasData())))break}}}return S},d.prototype._updateLoadedParentTileCache=function(){for(var p in this._loadedParentTiles={},this._tiles){for(var g=[],S=void 0,w=this._tiles[p].tileID;w.overscaledZ>0;){if(w.key in this._loadedParentTiles){S=this._loadedParentTiles[w.key];break}g.push(w.key);var C=w.scaledTo(w.overscaledZ-1);if(S=this._getLoadedTile(C))break;w=C}for(var P=0,Z=g;P<Z.length;P+=1)this._loadedParentTiles[Z[P]]=S}},d.prototype._addTile=function(p){var g=this._tiles[p.key];if(g)return g;(g=this._cache.getAndRemove(p))&&(this._setTileReloadTimer(p.key,g),g.tileID=p,this._state.initializeTileState(g,this.map?this.map.painter:null),this._cacheTimers[p.key]&&(clearTimeout(this._cacheTimers[p.key]),delete this._cacheTimers[p.key],this._setTileReloadTimer(p.key,g)));var S=!!g;return S||(g=new _.Tile(p,this._source.tileSize*p.overscaleFactor()),this._loadTile(g,this._tileLoaded.bind(this,g,p.key,g.state))),g?(g.uses++,this._tiles[p.key]=g,S||this._source.fire(new _.Event("dataloading",{tile:g,coord:g.tileID,dataType:"source"})),g):null},d.prototype._setTileReloadTimer=function(p,g){var S=this;p in this._timers&&(clearTimeout(this._timers[p]),delete this._timers[p]);var w=g.getExpiryTimeout();w&&(this._timers[p]=setTimeout(function(){S._reloadTile(p,"expired"),delete S._timers[p]},w))},d.prototype._removeTile=function(p){var g=this._tiles[p];g&&(g.uses--,delete this._tiles[p],this._timers[p]&&(clearTimeout(this._timers[p]),delete this._timers[p]),g.uses>0||(g.hasData()&&g.state!=="reloading"?this._cache.add(g.tileID,g,g.getExpiryTimeout()):(g.aborted=!0,this._abortTile(g),this._unloadTile(g))))},d.prototype.clearTiles=function(){for(var p in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(p);this._cache.reset()},d.prototype.tilesIn=function(p,g,S){var w=this,C=[],P=this.transform;if(!P)return C;for(var Z=S?P.getCameraQueryGeometry(p):p,Y=p.map(function(zt){return P.pointCoordinate(zt)}),pe=Z.map(function(zt){return P.pointCoordinate(zt)}),_e=this.getIds(),ye=1/0,Ue=1/0,ke=-1/0,Ke=-1/0,Ie=0,$e=pe;Ie<$e.length;Ie+=1){var vt=$e[Ie];ye=Math.min(ye,vt.x),Ue=Math.min(Ue,vt.y),ke=Math.max(ke,vt.x),Ke=Math.max(Ke,vt.y)}for(var Rt=function(zt){var ar=w._tiles[_e[zt]];if(!ar.holdingForFade()){var _r=ar.tileID,Nr=Math.pow(2,P.zoom-ar.tileID.overscaledZ),kr=g*ar.queryPadding*_.EXTENT/ar.tileSize/Nr,un=[_r.getTilePoint(new _.MercatorCoordinate(ye,Ue)),_r.getTilePoint(new _.MercatorCoordinate(ke,Ke))];if(un[0].x-kr<_.EXTENT&&un[0].y-kr<_.EXTENT&&un[1].x+kr>=0&&un[1].y+kr>=0){var Pn=Y.map(function(Zn){return _r.getTilePoint(Zn)}),zn=pe.map(function(Zn){return _r.getTilePoint(Zn)});C.push({tile:ar,tileID:_r,queryGeometry:Pn,cameraQueryGeometry:zn,scale:Nr})}}},Jt=0;Jt<_e.length;Jt++)Rt(Jt);return C},d.prototype.getVisibleCoordinates=function(p){for(var g=this,S=this.getRenderableIds(p).map(function(Z){return g._tiles[Z].tileID}),w=0,C=S;w<C.length;w+=1){var P=C[w];P.posMatrix=this.transform.calculatePosMatrix(P.toUnwrapped())}return S},d.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(at(this._source.type))for(var p in this._tiles){var g=this._tiles[p];if(g.fadeEndTime!==void 0&&g.fadeEndTime>=_.browser.now())return!0}return!1},d.prototype.setFeatureState=function(p,g,S){this._state.updateState(p=p||"_geojsonTileLayer",g,S)},d.prototype.removeFeatureState=function(p,g,S){this._state.removeFeatureState(p=p||"_geojsonTileLayer",g,S)},d.prototype.getFeatureState=function(p,g){return this._state.getState(p=p||"_geojsonTileLayer",g)},d.prototype.setDependencies=function(p,g,S){var w=this._tiles[p];w&&w.setDependencies(g,S)},d.prototype.reloadTilesForDependencies=function(p,g){for(var S in this._tiles)this._tiles[S].hasDependency(p,g)&&this._reloadTile(S,"reloading");this._cache.filter(function(w){return!w.hasDependency(p,g)})},d}(_.Evented);function Le(h,d){var p=Math.abs(2*h.wrap)-+(h.wrap<0),g=Math.abs(2*d.wrap)-+(d.wrap<0);return h.overscaledZ-d.overscaledZ||g-p||d.canonical.y-h.canonical.y||d.canonical.x-h.canonical.x}function at(h){return h==="raster"||h==="image"||h==="video"}function Ee(){return new _.window.Worker(Hf.workerUrl)}Q.maxOverzooming=10,Q.maxUnderzooming=3;var ir="mapboxgl_preloaded_worker_pool",wr=function(){this.active={}};wr.prototype.acquire=function(h){if(!this.workers)for(this.workers=[];this.workers.length<wr.workerCount;)this.workers.push(new Ee);return this.active[h]=!0,this.workers.slice()},wr.prototype.release=function(h){delete this.active[h],this.numActive()===0&&(this.workers.forEach(function(d){d.terminate()}),this.workers=null)},wr.prototype.isPreloaded=function(){return!!this.active[ir]},wr.prototype.numActive=function(){return Object.keys(this.active).length};var An,sn=Math.floor(_.browser.hardwareConcurrency/2);function sr(){return An||(An=new wr),An}function en(h,d){var p={};for(var g in h)g!=="ref"&&(p[g]=h[g]);return _.refProperties.forEach(function(S){S in d&&(p[S]=d[S])}),p}function Wr(h){h=h.slice();for(var d=Object.create(null),p=0;p<h.length;p++)d[h[p].id]=h[p];for(var g=0;g<h.length;g++)"ref"in h[g]&&(h[g]=en(h[g],d[h[g].ref]));return h}wr.workerCount=Math.max(Math.min(sn,6),1);var Yr={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function pi(h,d,p){p.push({command:Yr.addSource,args:[h,d[h]]})}function tn(h,d,p){d.push({command:Yr.removeSource,args:[h]}),p[h]=!0}function vi(h,d,p,g){tn(h,p,g),pi(h,d,p)}function qi(h,d,p){var g;for(g in h[p])if(h[p].hasOwnProperty(g)&&g!=="data"&&!_.deepEqual(h[p][g],d[p][g]))return!1;for(g in d[p])if(d[p].hasOwnProperty(g)&&g!=="data"&&!_.deepEqual(h[p][g],d[p][g]))return!1;return!0}function ci(h,d,p,g,S,w){var C;for(C in d=d||{},h=h||{})h.hasOwnProperty(C)&&(_.deepEqual(h[C],d[C])||p.push({command:w,args:[g,C,d[C],S]}));for(C in d)d.hasOwnProperty(C)&&!h.hasOwnProperty(C)&&(_.deepEqual(h[C],d[C])||p.push({command:w,args:[g,C,d[C],S]}))}function zi(h){return h.id}function Ai(h,d){return h[d.id]=d,h}var Xo=function(h,d){this.reset(h,d)};Xo.prototype.reset=function(h,d){this.points=h||[],this._distances=[0];for(var p=1;p<this.points.length;p++)this._distances[p]=this._distances[p-1]+this.points[p].dist(this.points[p-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(d||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Xo.prototype.lerp=function(h){if(this.points.length===1)return this.points[0];h=_.clamp(h,0,1);for(var d=1,p=this._distances[d],g=h*this.paddedLength+this.padding;p<g&&d<this._distances.length;)p=this._distances[++d];var S=d-1,w=this._distances[S],C=p-w,P=C>0?(g-w)/C:0;return this.points[S].mult(1-P).add(this.points[d].mult(P))};var Ji=function(h,d,p){var g=this.boxCells=[],S=this.circleCells=[];this.xCellCount=Math.ceil(h/p),this.yCellCount=Math.ceil(d/p);for(var w=0;w<this.xCellCount*this.yCellCount;w++)g.push([]),S.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=h,this.height=d,this.xScale=this.xCellCount/h,this.yScale=this.yCellCount/d,this.boxUid=0,this.circleUid=0};function Ia(h,d,p,g,S){var w=_.create();return d?(_.scale(w,w,[1/S,1/S,1]),p||_.rotateZ(w,w,g.angle)):_.multiply(w,g.labelPlaneMatrix,h),w}function Ti(h,d,p,g,S){if(d){var w=_.clone(h);return _.scale(w,w,[S,S,1]),p||_.rotateZ(w,w,-g.angle),w}return g.glCoordMatrix}function mi(h,d){var p=[h.x,h.y,0,1];sa(p,p,d);var g=p[3];return{point:new _.Point(p[0]/g,p[1]/g),signedDistanceFromCamera:g}}function wi(h,d){return .5+h/d*.5}function Pa(h,d){var p=h[0]/h[3],g=h[1]/h[3];return p>=-d[0]&&p<=d[0]&&g>=-d[1]&&g<=d[1]}function cu(h,d,p,g,S,w,C,P){var Z=g?h.textSizeData:h.iconSizeData,Y=_.evaluateSizeForZoom(Z,p.transform.zoom),pe=[256/p.width*2+1,256/p.height*2+1],_e=g?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;_e.clear();for(var ye=h.lineVertexArray,Ue=g?h.text.placedSymbolArray:h.icon.placedSymbolArray,ke=p.transform.width/p.transform.height,Ke=!1,Ie=0;Ie<Ue.length;Ie++){var $e=Ue.get(Ie);if($e.hidden||$e.writingMode===_.WritingMode.vertical&&!Ke)Oa($e.numGlyphs,_e);else{Ke=!1;var vt=[$e.anchorX,$e.anchorY,0,1];if(_.transformMat4(vt,vt,d),Pa(vt,pe)){var Rt=wi(p.transform.cameraToCenterDistance,vt[3]),Jt=_.evaluateSizeForFeature(Z,Y,$e),zt=C?Jt/Rt:Jt*Rt,ar=new _.Point($e.anchorX,$e.anchorY),_r=mi(ar,S).point,Nr={},kr=$l($e,zt,!1,P,d,S,w,h.glyphOffsetArray,ye,_e,_r,ar,Nr,ke);Ke=kr.useVertical,(kr.notEnoughRoom||Ke||kr.needsFlipping&&$l($e,zt,!0,P,d,S,w,h.glyphOffsetArray,ye,_e,_r,ar,Nr,ke).notEnoughRoom)&&Oa($e.numGlyphs,_e)}else Oa($e.numGlyphs,_e)}}g?h.text.dynamicLayoutVertexBuffer.updateData(_e):h.icon.dynamicLayoutVertexBuffer.updateData(_e)}function ma(h,d,p,g,S,w,C,P,Z,Y,pe){var _e=P.glyphStartIndex+P.numGlyphs,ye=P.lineStartIndex,Ue=P.lineStartIndex+P.lineLength,ke=d.getoffsetX(P.glyphStartIndex),Ke=d.getoffsetX(_e-1),Ie=Ta(h*ke,p,g,S,w,C,P.segment,ye,Ue,Z,Y,pe);if(!Ie)return null;var $e=Ta(h*Ke,p,g,S,w,C,P.segment,ye,Ue,Z,Y,pe);return $e?{first:Ie,last:$e}:null}function Aa(h,d,p,g){return h===_.WritingMode.horizontal&&Math.abs(p.y-d.y)>Math.abs(p.x-d.x)*g?{useVertical:!0}:(h===_.WritingMode.vertical?d.y<p.y:d.x>p.x)?{needsFlipping:!0}:null}function $l(h,d,p,g,S,w,C,P,Z,Y,pe,_e,ye,Ue){var ke,Ke=d/24,Ie=h.lineOffsetX*Ke,$e=h.lineOffsetY*Ke;if(h.numGlyphs>1){var vt=h.glyphStartIndex+h.numGlyphs,Rt=h.lineStartIndex,Jt=h.lineStartIndex+h.lineLength,zt=ma(Ke,P,Ie,$e,p,pe,_e,h,Z,w,ye);if(!zt)return{notEnoughRoom:!0};var ar=mi(zt.first.point,C).point,_r=mi(zt.last.point,C).point;if(g&&!p){var Nr=Aa(h.writingMode,ar,_r,Ue);if(Nr)return Nr}ke=[zt.first];for(var kr=h.glyphStartIndex+1;kr<vt-1;kr++)ke.push(Ta(Ke*P.getoffsetX(kr),Ie,$e,p,pe,_e,h.segment,Rt,Jt,Z,w,ye));ke.push(zt.last)}else{if(g&&!p){var un=mi(_e,S).point,Pn=h.lineStartIndex+h.segment+1,zn=new _.Point(Z.getx(Pn),Z.gety(Pn)),Zn=mi(zn,S),Wi=Zn.signedDistanceFromCamera>0?Zn.point:os(_e,zn,un,1,S),vn=Aa(h.writingMode,un,Wi,Ue);if(vn)return vn}var ei=Ta(Ke*P.getoffsetX(h.glyphStartIndex),Ie,$e,p,pe,_e,h.segment,h.lineStartIndex,h.lineStartIndex+h.lineLength,Z,w,ye);if(!ei)return{notEnoughRoom:!0};ke=[ei]}for(var _i=0,ri=ke;_i<ri.length;_i+=1){var qn=ri[_i];_.addDynamicAttributes(Y,qn.point,qn.angle)}return{}}function os(h,d,p,g,S){var w=mi(h.add(h.sub(d)._unit()),S).point,C=p.sub(w);return p.add(C._mult(g/C.mag()))}function Ta(h,d,p,g,S,w,C,P,Z,Y,pe,_e){var ye=g?h-d:h+d,Ue=ye>0?1:-1,ke=0;g&&(Ue*=-1,ke=Math.PI),Ue<0&&(ke+=Math.PI);for(var Ke=Ue>0?P+C:P+C+1,Ie=S,$e=S,vt=0,Rt=0,Jt=Math.abs(ye),zt=[];vt+Rt<=Jt;){if((Ke+=Ue)<P||Ke>=Z)return null;if($e=Ie,zt.push(Ie),(Ie=_e[Ke])===void 0){var ar=new _.Point(Y.getx(Ke),Y.gety(Ke)),_r=mi(ar,pe);if(_r.signedDistanceFromCamera>0)Ie=_e[Ke]=_r.point;else{var Nr=Ke-Ue;Ie=os(vt===0?w:new _.Point(Y.getx(Nr),Y.gety(Nr)),ar,$e,Jt-vt+1,pe)}}vt+=Rt,Rt=$e.dist(Ie)}var kr=(Jt-vt)/Rt,un=Ie.sub($e),Pn=un.mult(kr)._add($e);Pn._add(un._unit()._perp()._mult(p*Ue));var zn=ke+Math.atan2(Ie.y-$e.y,Ie.x-$e.x);return zt.push(Pn),{point:Pn,angle:zn,path:zt}}Ji.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ji.prototype.insert=function(h,d,p,g,S){this._forEachCell(d,p,g,S,this._insertBoxCell,this.boxUid++),this.boxKeys.push(h),this.bboxes.push(d),this.bboxes.push(p),this.bboxes.push(g),this.bboxes.push(S)},Ji.prototype.insertCircle=function(h,d,p,g){this._forEachCell(d-g,p-g,d+g,p+g,this._insertCircleCell,this.circleUid++),this.circleKeys.push(h),this.circles.push(d),this.circles.push(p),this.circles.push(g)},Ji.prototype._insertBoxCell=function(h,d,p,g,S,w){this.boxCells[S].push(w)},Ji.prototype._insertCircleCell=function(h,d,p,g,S,w){this.circleCells[S].push(w)},Ji.prototype._query=function(h,d,p,g,S,w){if(p<0||h>this.width||g<0||d>this.height)return!S&&[];var C=[];if(h<=0&&d<=0&&this.width<=p&&this.height<=g){if(S)return!0;for(var P=0;P<this.boxKeys.length;P++)C.push({key:this.boxKeys[P],x1:this.bboxes[4*P],y1:this.bboxes[4*P+1],x2:this.bboxes[4*P+2],y2:this.bboxes[4*P+3]});for(var Z=0;Z<this.circleKeys.length;Z++){var Y=this.circles[3*Z],pe=this.circles[3*Z+1],_e=this.circles[3*Z+2];C.push({key:this.circleKeys[Z],x1:Y-_e,y1:pe-_e,x2:Y+_e,y2:pe+_e})}return w?C.filter(w):C}return this._forEachCell(h,d,p,g,this._queryCell,C,{hitTest:S,seenUids:{box:{},circle:{}}},w),S?C.length>0:C},Ji.prototype._queryCircle=function(h,d,p,g,S){var w=h-p,C=h+p,P=d-p,Z=d+p;if(C<0||w>this.width||Z<0||P>this.height)return!g&&[];var Y=[];return this._forEachCell(w,P,C,Z,this._queryCellCircle,Y,{hitTest:g,circle:{x:h,y:d,radius:p},seenUids:{box:{},circle:{}}},S),g?Y.length>0:Y},Ji.prototype.query=function(h,d,p,g,S){return this._query(h,d,p,g,!1,S)},Ji.prototype.hitTest=function(h,d,p,g,S){return this._query(h,d,p,g,!0,S)},Ji.prototype.hitTestCircle=function(h,d,p,g){return this._queryCircle(h,d,p,!0,g)},Ji.prototype._queryCell=function(h,d,p,g,S,w,C,P){var Z=C.seenUids,Y=this.boxCells[S];if(Y!==null)for(var pe=this.bboxes,_e=0,ye=Y;_e<ye.length;_e+=1){var Ue=ye[_e];if(!Z.box[Ue]){Z.box[Ue]=!0;var ke=4*Ue;if(h<=pe[ke+2]&&d<=pe[ke+3]&&p>=pe[ke+0]&&g>=pe[ke+1]&&(!P||P(this.boxKeys[Ue]))){if(C.hitTest)return w.push(!0),!0;w.push({key:this.boxKeys[Ue],x1:pe[ke],y1:pe[ke+1],x2:pe[ke+2],y2:pe[ke+3]})}}}var Ke=this.circleCells[S];if(Ke!==null)for(var Ie=this.circles,$e=0,vt=Ke;$e<vt.length;$e+=1){var Rt=vt[$e];if(!Z.circle[Rt]){Z.circle[Rt]=!0;var Jt=3*Rt;if(this._circleAndRectCollide(Ie[Jt],Ie[Jt+1],Ie[Jt+2],h,d,p,g)&&(!P||P(this.circleKeys[Rt]))){if(C.hitTest)return w.push(!0),!0;var zt=Ie[Jt],ar=Ie[Jt+1],_r=Ie[Jt+2];w.push({key:this.circleKeys[Rt],x1:zt-_r,y1:ar-_r,x2:zt+_r,y2:ar+_r})}}}},Ji.prototype._queryCellCircle=function(h,d,p,g,S,w,C,P){var Z=C.circle,Y=C.seenUids,pe=this.boxCells[S];if(pe!==null)for(var _e=this.bboxes,ye=0,Ue=pe;ye<Ue.length;ye+=1){var ke=Ue[ye];if(!Y.box[ke]){Y.box[ke]=!0;var Ke=4*ke;if(this._circleAndRectCollide(Z.x,Z.y,Z.radius,_e[Ke+0],_e[Ke+1],_e[Ke+2],_e[Ke+3])&&(!P||P(this.boxKeys[ke])))return w.push(!0),!0}}var Ie=this.circleCells[S];if(Ie!==null)for(var $e=this.circles,vt=0,Rt=Ie;vt<Rt.length;vt+=1){var Jt=Rt[vt];if(!Y.circle[Jt]){Y.circle[Jt]=!0;var zt=3*Jt;if(this._circlesCollide($e[zt],$e[zt+1],$e[zt+2],Z.x,Z.y,Z.radius)&&(!P||P(this.circleKeys[Jt])))return w.push(!0),!0}}},Ji.prototype._forEachCell=function(h,d,p,g,S,w,C,P){for(var Z=this._convertToXCellCoord(h),Y=this._convertToYCellCoord(d),pe=this._convertToXCellCoord(p),_e=this._convertToYCellCoord(g),ye=Z;ye<=pe;ye++)for(var Ue=Y;Ue<=_e;Ue++)if(S.call(this,h,d,p,g,this.xCellCount*Ue+ye,w,C,P))return},Ji.prototype._convertToXCellCoord=function(h){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(h*this.xScale)))},Ji.prototype._convertToYCellCoord=function(h){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(h*this.yScale)))},Ji.prototype._circlesCollide=function(h,d,p,g,S,w){var C=g-h,P=S-d,Z=p+w;return Z*Z>C*C+P*P},Ji.prototype._circleAndRectCollide=function(h,d,p,g,S,w,C){var P=(w-g)/2,Z=Math.abs(h-(g+P));if(Z>P+p)return!1;var Y=(C-S)/2,pe=Math.abs(d-(S+Y));if(pe>Y+p)return!1;if(Z<=P||pe<=Y)return!0;var _e=Z-P,ye=pe-Y;return _e*_e+ye*ye<=p*p};var fi=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Oa(h,d){for(var p=0;p<h;p++){var g=d.length;d.resize(g+4),d.float32.set(fi,3*g)}}function sa(h,d,p){var g=d[0],S=d[1];return h[0]=p[0]*g+p[4]*S+p[12],h[1]=p[1]*g+p[5]*S+p[13],h[3]=p[3]*g+p[7]*S+p[15],h}var Ao=function(h,d,p){d===void 0&&(d=new Ji(h.width+200,h.height+200,25)),p===void 0&&(p=new Ji(h.width+200,h.height+200,25)),this.transform=h,this.grid=d,this.ignoredGrid=p,this.pitchfactor=Math.cos(h._pitch)*h.cameraToCenterDistance,this.screenRightBoundary=h.width+100,this.screenBottomBoundary=h.height+100,this.gridRightBoundary=h.width+200,this.gridBottomBoundary=h.height+200};function ha(h,d,p){return d*(_.EXTENT/(h.tileSize*Math.pow(2,p-h.tileID.overscaledZ)))}Ao.prototype.placeCollisionBox=function(h,d,p,g,S){var w=this.projectAndGetPerspectiveRatio(g,h.anchorPointX,h.anchorPointY),C=p*w.perspectiveRatio,P=h.x1*C+w.point.x,Z=h.y1*C+w.point.y,Y=h.x2*C+w.point.x,pe=h.y2*C+w.point.y;return!this.isInsideGrid(P,Z,Y,pe)||!d&&this.grid.hitTest(P,Z,Y,pe,S)?{box:[],offscreen:!1}:{box:[P,Z,Y,pe],offscreen:this.isOffscreen(P,Z,Y,pe)}},Ao.prototype.placeCollisionCircles=function(h,d,p,g,S,w,C,P,Z,Y,pe,_e,ye){var Ue=[],ke=new _.Point(d.anchorX,d.anchorY),Ke=mi(ke,w),Ie=wi(this.transform.cameraToCenterDistance,Ke.signedDistanceFromCamera),$e=(Y?S/Ie:S*Ie)/_.ONE_EM,vt=mi(ke,C).point,Rt=ma($e,g,d.lineOffsetX*$e,d.lineOffsetY*$e,!1,vt,ke,d,p,C,{}),Jt=!1,zt=!1,ar=!0;if(Rt){for(var _r=.5*_e*Ie+ye,Nr=new _.Point(-100,-100),kr=new _.Point(this.screenRightBoundary,this.screenBottomBoundary),un=new Xo,Pn=Rt.first,zn=Rt.last,Zn=[],Wi=Pn.path.length-1;Wi>=1;Wi--)Zn.push(Pn.path[Wi]);for(var vn=1;vn<zn.path.length;vn++)Zn.push(zn.path[vn]);var ei=2.5*_r;if(P){var _i=Zn.map(function(Us){return mi(Us,P)});Zn=_i.some(function(Us){return Us.signedDistanceFromCamera<=0})?[]:_i.map(function(Us){return Us.point})}var ri=[];if(Zn.length>0){for(var qn=Zn[0].clone(),di=Zn[0].clone(),Jn=1;Jn<Zn.length;Jn++)qn.x=Math.min(qn.x,Zn[Jn].x),qn.y=Math.min(qn.y,Zn[Jn].y),di.x=Math.max(di.x,Zn[Jn].x),di.y=Math.max(di.y,Zn[Jn].y);ri=qn.x>=Nr.x&&di.x<=kr.x&&qn.y>=Nr.y&&di.y<=kr.y?[Zn]:di.x<Nr.x||qn.x>kr.x||di.y<Nr.y||qn.y>kr.y?[]:_.clipLine([Zn],Nr.x,Nr.y,kr.x,kr.y)}for(var Kn=0,Co=ri;Kn<Co.length;Kn+=1){var Ua;un.reset(Co[Kn],.25*_r),Ua=un.length<=.5*_r?1:Math.ceil(un.paddedLength/ei)+1;for(var Ro=0;Ro<Ua;Ro++){var Lo=Ro/Math.max(Ua-1,1),Ga=un.lerp(Lo),Xa=Ga.x+100,Ss=Ga.y+100;Ue.push(Xa,Ss,_r,0);var ls=Xa-_r,Zu=Ss-_r,cs=Xa+_r,nu=Ss+_r;if(ar=ar&&this.isOffscreen(ls,Zu,cs,nu),zt=zt||this.isInsideGrid(ls,Zu,cs,nu),!h&&this.grid.hitTestCircle(Xa,Ss,_r,pe)&&(Jt=!0,!Z))return{circles:[],offscreen:!1,collisionDetected:Jt}}}}return{circles:!Z&&Jt||!zt?[]:Ue,offscreen:ar,collisionDetected:Jt}},Ao.prototype.queryRenderedSymbols=function(h){if(h.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var d=[],p=1/0,g=1/0,S=-1/0,w=-1/0,C=0,P=h;C<P.length;C+=1){var Z=P[C],Y=new _.Point(Z.x+100,Z.y+100);p=Math.min(p,Y.x),g=Math.min(g,Y.y),S=Math.max(S,Y.x),w=Math.max(w,Y.y),d.push(Y)}for(var pe={},_e={},ye=0,Ue=this.grid.query(p,g,S,w).concat(this.ignoredGrid.query(p,g,S,w));ye<Ue.length;ye+=1){var ke=Ue[ye],Ke=ke.key;if(pe[Ke.bucketInstanceId]===void 0&&(pe[Ke.bucketInstanceId]={}),!pe[Ke.bucketInstanceId][Ke.featureIndex]){var Ie=[new _.Point(ke.x1,ke.y1),new _.Point(ke.x2,ke.y1),new _.Point(ke.x2,ke.y2),new _.Point(ke.x1,ke.y2)];_.polygonIntersectsPolygon(d,Ie)&&(pe[Ke.bucketInstanceId][Ke.featureIndex]=!0,_e[Ke.bucketInstanceId]===void 0&&(_e[Ke.bucketInstanceId]=[]),_e[Ke.bucketInstanceId].push(Ke.featureIndex))}}return _e},Ao.prototype.insertCollisionBox=function(h,d,p,g,S){(d?this.ignoredGrid:this.grid).insert({bucketInstanceId:p,featureIndex:g,collisionGroupID:S},h[0],h[1],h[2],h[3])},Ao.prototype.insertCollisionCircles=function(h,d,p,g,S){for(var w=d?this.ignoredGrid:this.grid,C={bucketInstanceId:p,featureIndex:g,collisionGroupID:S},P=0;P<h.length;P+=4)w.insertCircle(C,h[P],h[P+1],h[P+2])},Ao.prototype.projectAndGetPerspectiveRatio=function(h,d,p){var g=[d,p,0,1];return sa(g,g,h),{point:new _.Point((g[0]/g[3]+1)/2*this.transform.width+100,(-g[1]/g[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/g[3]*.5}},Ao.prototype.isOffscreen=function(h,d,p,g){return p<100||h>=this.screenRightBoundary||g<100||d>this.screenBottomBoundary},Ao.prototype.isInsideGrid=function(h,d,p,g){return p>=0&&h<this.gridRightBoundary&&g>=0&&d<this.gridBottomBoundary},Ao.prototype.getViewportMatrix=function(){var h=_.identity([]);return _.translate(h,h,[-100,-100,0]),h};var $o=function(h,d,p,g){this.opacity=h?Math.max(0,Math.min(1,h.opacity+(h.placed?d:-d))):g&&p?1:0,this.placed=p};$o.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Vo=function(h,d,p,g,S){this.text=new $o(h?h.text:null,d,p,S),this.icon=new $o(h?h.icon:null,d,g,S)};Vo.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Ru=function(h,d,p){this.text=h,this.icon=d,this.skipFade=p},ss=function(){this.invProjMatrix=_.create(),this.viewportMatrix=_.create(),this.circles=[]},Cc=function(h,d,p,g,S){this.bucketInstanceId=h,this.featureIndex=d,this.sourceLayerIndex=p,this.bucketIndex=g,this.tileID=S},Ea=function(h){this.crossSourceCollisions=h,this.maxGroupID=0,this.collisionGroups={}};function ea(h,d,p,g,S){var w=_.getAnchorAlignment(h),C=-(w.horizontalAlign-.5)*d,P=-(w.verticalAlign-.5)*p,Z=_.evaluateVariableOffset(h,g);return new _.Point(C+Z[0]*S,P+Z[1]*S)}function Kt(h,d,p,g,S,w){var C=h.x1,P=h.x2,Z=h.y1,Y=h.y2,pe=h.anchorPointX,_e=h.anchorPointY,ye=new _.Point(d,p);return g&&ye._rotate(S?w:-w),{x1:C+ye.x,y1:Z+ye.y,x2:P+ye.x,y2:Y+ye.y,anchorPointX:pe,anchorPointY:_e}}Ea.prototype.get=function(h){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[h]){var d=++this.maxGroupID;this.collisionGroups[h]={ID:d,predicate:function(p){return p.collisionGroupID===d}}}return this.collisionGroups[h]};var Sn=function(h,d,p,g){this.transform=h.clone(),this.collisionIndex=new Ao(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=d,this.retainedQueryData={},this.collisionGroups=new Ea(p),this.collisionCircleArrays={},this.prevPlacement=g,g&&(g.prevPlacement=void 0),this.placedOrientations={}};function de(h,d,p,g,S){h.emplaceBack(d?1:0,p?1:0,g||0,S||0),h.emplaceBack(d?1:0,p?1:0,g||0,S||0),h.emplaceBack(d?1:0,p?1:0,g||0,S||0),h.emplaceBack(d?1:0,p?1:0,g||0,S||0)}Sn.prototype.getBucketParts=function(h,d,p,g){var S=p.getBucket(d),w=p.latestFeatureIndex;if(S&&w&&d.id===S.layerIds[0]){var C=p.collisionBoxArray,P=S.layers[0].layout,Z=Math.pow(2,this.transform.zoom-p.tileID.overscaledZ),Y=p.tileSize/_.EXTENT,pe=this.transform.calculatePosMatrix(p.tileID.toUnwrapped()),_e=P.get("text-pitch-alignment")==="map",ye=P.get("text-rotation-alignment")==="map",Ue=ha(p,1,this.transform.zoom),ke=Ia(pe,_e,ye,this.transform,Ue),Ke=null;if(_e){var Ie=Ti(pe,_e,ye,this.transform,Ue);Ke=_.multiply([],this.transform.labelPlaneMatrix,Ie)}this.retainedQueryData[S.bucketInstanceId]=new Cc(S.bucketInstanceId,w,S.sourceLayerIndex,S.index,p.tileID);var $e={bucket:S,layout:P,posMatrix:pe,textLabelPlaneMatrix:ke,labelToScreenMatrix:Ke,scale:Z,textPixelRatio:Y,holdingForFade:p.holdingForFade(),collisionBoxArray:C,partiallyEvaluatedTextSize:_.evaluateSizeForZoom(S.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(S.sourceID)};if(g)for(var vt=0,Rt=S.sortKeyRanges;vt<Rt.length;vt+=1){var Jt=Rt[vt];h.push({sortKey:Jt.sortKey,symbolInstanceStart:Jt.symbolInstanceStart,symbolInstanceEnd:Jt.symbolInstanceEnd,parameters:$e})}else h.push({symbolInstanceStart:0,symbolInstanceEnd:S.symbolInstances.length,parameters:$e})}},Sn.prototype.attemptAnchorPlacement=function(h,d,p,g,S,w,C,P,Z,Y,pe,_e,ye,Ue,ke){var Ke,Ie=[_e.textOffset0,_e.textOffset1],$e=ea(h,p,g,Ie,S),vt=this.collisionIndex.placeCollisionBox(Kt(d,$e.x,$e.y,w,C,this.transform.angle),pe,P,Z,Y.predicate);if(!ke||this.collisionIndex.placeCollisionBox(Kt(ke,$e.x,$e.y,w,C,this.transform.angle),pe,P,Z,Y.predicate).box.length!==0)return vt.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[_e.crossTileID]&&this.prevPlacement.placements[_e.crossTileID]&&this.prevPlacement.placements[_e.crossTileID].text&&(Ke=this.prevPlacement.variableOffsets[_e.crossTileID].anchor),this.variableOffsets[_e.crossTileID]={textOffset:Ie,width:p,height:g,anchor:h,textBoxScale:S,prevAnchor:Ke},this.markUsedJustification(ye,h,_e,Ue),ye.allowVerticalPlacement&&(this.markUsedOrientation(ye,Ue,_e),this.placedOrientations[_e.crossTileID]=Ue),{shift:$e,placedGlyphBoxes:vt}):void 0},Sn.prototype.placeLayerBucketPart=function(h,d,p){var g=this,S=h.parameters,w=S.bucket,C=S.layout,P=S.posMatrix,Z=S.textLabelPlaneMatrix,Y=S.labelToScreenMatrix,pe=S.textPixelRatio,_e=S.holdingForFade,ye=S.collisionBoxArray,Ue=S.partiallyEvaluatedTextSize,ke=S.collisionGroup,Ke=C.get("text-optional"),Ie=C.get("icon-optional"),$e=C.get("text-allow-overlap"),vt=C.get("icon-allow-overlap"),Rt=C.get("text-rotation-alignment")==="map",Jt=C.get("text-pitch-alignment")==="map",zt=C.get("icon-text-fit")!=="none",ar=C.get("symbol-z-order")==="viewport-y",_r=$e&&(vt||!w.hasIconData()||Ie),Nr=vt&&($e||!w.hasTextData()||Ke);!w.collisionArrays&&ye&&w.deserializeCollisionBoxes(ye);var kr=function(vn,ei){if(!d[vn.crossTileID])if(_e)g.placements[vn.crossTileID]=new Ru(!1,!1,!1);else{var _i,ri=!1,qn=!1,di=!0,Jn=null,Kn={box:null,offscreen:null},Co={box:null,offscreen:null},Ua=null,Ro=null,Lo=0,Ga=0,Xa=0;ei.textFeatureIndex?Lo=ei.textFeatureIndex:vn.useRuntimeCollisionCircles&&(Lo=vn.featureIndex),ei.verticalTextFeatureIndex&&(Ga=ei.verticalTextFeatureIndex);var Ss=ei.textBox;if(Ss){var ls=function(Zi){var mo=_.WritingMode.horizontal;if(w.allowVerticalPlacement&&!Zi&&g.prevPlacement){var ao=g.prevPlacement.placedOrientations[vn.crossTileID];ao&&(g.placedOrientations[vn.crossTileID]=ao,g.markUsedOrientation(w,mo=ao,vn))}return mo},Zu=function(Zi,mo){if(w.allowVerticalPlacement&&vn.numVerticalGlyphVertices>0&&ei.verticalTextBox)for(var ao=0,ou=w.writingModes;ao<ou.length&&(ou[ao]===_.WritingMode.vertical?(Kn=mo(),Co=Kn):Kn=Zi(),!(Kn&&Kn.box&&Kn.box.length));ao+=1);else Kn=Zi()};if(C.get("text-variable-anchor")){var cs=C.get("text-variable-anchor");if(g.prevPlacement&&g.prevPlacement.variableOffsets[vn.crossTileID]){var nu=g.prevPlacement.variableOffsets[vn.crossTileID];cs.indexOf(nu.anchor)>0&&(cs=cs.filter(function(Zi){return Zi!==nu.anchor})).unshift(nu.anchor)}var Us=function(Zi,mo,ao){for(var ou=Zi.x2-Zi.x1,Bc=Zi.y2-Zi.y1,Bl=vn.textBoxScale,fs=zt&&!vt?mo:null,Or={box:[],offscreen:!1},Wu=$e?2*cs.length:cs.length,Gu=0;Gu<Wu;++Gu){var oo=g.attemptAnchorPlacement(cs[Gu%cs.length],Zi,ou,Bc,Bl,Rt,Jt,pe,P,ke,Gu>=cs.length,vn,w,ao,fs);if(oo&&(Or=oo.placedGlyphBoxes)&&Or.box&&Or.box.length){ri=!0,Jn=oo.shift;break}}return Or};Zu(function(){return Us(Ss,ei.iconBox,_.WritingMode.horizontal)},function(){var Zi=ei.verticalTextBox;return w.allowVerticalPlacement&&!(Kn&&Kn.box&&Kn.box.length)&&vn.numVerticalGlyphVertices>0&&Zi?Us(Zi,ei.verticalIconBox,_.WritingMode.vertical):{box:null,offscreen:null}}),Kn&&(ri=Kn.box,di=Kn.offscreen);var sl=ls(Kn&&Kn.box);if(!ri&&g.prevPlacement){var Fl=g.prevPlacement.variableOffsets[vn.crossTileID];Fl&&(g.variableOffsets[vn.crossTileID]=Fl,g.markUsedJustification(w,Fl.anchor,vn,sl))}}else{var ul=function(Zi,mo){var ao=g.collisionIndex.placeCollisionBox(Zi,$e,pe,P,ke.predicate);return ao&&ao.box&&ao.box.length&&(g.markUsedOrientation(w,mo,vn),g.placedOrientations[vn.crossTileID]=mo),ao};Zu(function(){return ul(Ss,_.WritingMode.horizontal)},function(){var Zi=ei.verticalTextBox;return w.allowVerticalPlacement&&vn.numVerticalGlyphVertices>0&&Zi?ul(Zi,_.WritingMode.vertical):{box:null,offscreen:null}}),ls(Kn&&Kn.box&&Kn.box.length)}}if(ri=(_i=Kn)&&_i.box&&_i.box.length>0,di=_i&&_i.offscreen,vn.useRuntimeCollisionCircles){var kl=w.text.placedSymbolArray.get(vn.centerJustifiedTextSymbolIndex),Vu=_.evaluateSizeForFeature(w.textSizeData,Ue,kl),iu=C.get("text-padding");Ua=g.collisionIndex.placeCollisionCircles($e,kl,w.lineVertexArray,w.glyphOffsetArray,Vu,P,Z,Y,p,Jt,ke.predicate,vn.collisionCircleDiameter,iu),ri=$e||Ua.circles.length>0&&!Ua.collisionDetected,di=di&&Ua.offscreen}if(ei.iconFeatureIndex&&(Xa=ei.iconFeatureIndex),ei.iconBox){var ju=function(Zi){var mo=zt&&Jn?Kt(Zi,Jn.x,Jn.y,Rt,Jt,g.transform.angle):Zi;return g.collisionIndex.placeCollisionBox(mo,vt,pe,P,ke.predicate)};qn=Co&&Co.box&&Co.box.length&&ei.verticalIconBox?(Ro=ju(ei.verticalIconBox)).box.length>0:(Ro=ju(ei.iconBox)).box.length>0,di=di&&Ro.offscreen}var Ko=Ke||vn.numHorizontalGlyphVertices===0&&vn.numVerticalGlyphVertices===0,Qa=Ie||vn.numIconVertices===0;if(Ko||Qa?Qa?Ko||(qn=qn&&ri):ri=qn&&ri:qn=ri=qn&&ri,ri&&_i&&_i.box&&g.collisionIndex.insertCollisionBox(_i.box,C.get("text-ignore-placement"),w.bucketInstanceId,Co&&Co.box&&Ga?Ga:Lo,ke.ID),qn&&Ro&&g.collisionIndex.insertCollisionBox(Ro.box,C.get("icon-ignore-placement"),w.bucketInstanceId,Xa,ke.ID),Ua&&(ri&&g.collisionIndex.insertCollisionCircles(Ua.circles,C.get("text-ignore-placement"),w.bucketInstanceId,Lo,ke.ID),p)){var As=w.bucketInstanceId,au=g.collisionCircleArrays[As];au===void 0&&(au=g.collisionCircleArrays[As]=new ss);for(var Hu=0;Hu<Ua.circles.length;Hu+=4)au.circles.push(Ua.circles[Hu+0]),au.circles.push(Ua.circles[Hu+1]),au.circles.push(Ua.circles[Hu+2]),au.circles.push(Ua.collisionDetected?1:0)}g.placements[vn.crossTileID]=new Ru(ri||_r,qn||Nr,di||w.justReloaded),d[vn.crossTileID]=!0}};if(ar)for(var un=w.getSortedSymbolIndexes(this.transform.angle),Pn=un.length-1;Pn>=0;--Pn){var zn=un[Pn];kr(w.symbolInstances.get(zn),w.collisionArrays[zn])}else for(var Zn=h.symbolInstanceStart;Zn<h.symbolInstanceEnd;Zn++)kr(w.symbolInstances.get(Zn),w.collisionArrays[Zn]);if(p&&w.bucketInstanceId in this.collisionCircleArrays){var Wi=this.collisionCircleArrays[w.bucketInstanceId];_.invert(Wi.invProjMatrix,P),Wi.viewportMatrix=this.collisionIndex.getViewportMatrix()}w.justReloaded=!1},Sn.prototype.markUsedJustification=function(h,d,p,g){var S;S=g===_.WritingMode.vertical?p.verticalPlacedTextSymbolIndex:{left:p.leftJustifiedTextSymbolIndex,center:p.centerJustifiedTextSymbolIndex,right:p.rightJustifiedTextSymbolIndex}[_.getAnchorJustification(d)];for(var w=0,C=[p.leftJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.rightJustifiedTextSymbolIndex,p.verticalPlacedTextSymbolIndex];w<C.length;w+=1){var P=C[w];P>=0&&(h.text.placedSymbolArray.get(P).crossTileID=S>=0&&P!==S?0:p.crossTileID)}},Sn.prototype.markUsedOrientation=function(h,d,p){for(var g=d===_.WritingMode.horizontal||d===_.WritingMode.horizontalOnly?d:0,S=d===_.WritingMode.vertical?d:0,w=0,C=[p.leftJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.rightJustifiedTextSymbolIndex];w<C.length;w+=1)h.text.placedSymbolArray.get(C[w]).placedOrientation=g;p.verticalPlacedTextSymbolIndex&&(h.text.placedSymbolArray.get(p.verticalPlacedTextSymbolIndex).placedOrientation=S)},Sn.prototype.commit=function(h){this.commitTime=h,this.zoomAtLastRecencyCheck=this.transform.zoom;var d=this.prevPlacement,p=!1;this.prevZoomAdjustment=d?d.zoomAdjustment(this.transform.zoom):0;var g=d?d.symbolFadeChange(h):1,S=d?d.opacities:{},w=d?d.variableOffsets:{},C=d?d.placedOrientations:{};for(var P in this.placements){var Z=this.placements[P],Y=S[P];Y?(this.opacities[P]=new Vo(Y,g,Z.text,Z.icon),p=p||Z.text!==Y.text.placed||Z.icon!==Y.icon.placed):(this.opacities[P]=new Vo(null,g,Z.text,Z.icon,Z.skipFade),p=p||Z.text||Z.icon)}for(var pe in S){var _e=S[pe];if(!this.opacities[pe]){var ye=new Vo(_e,g,!1,!1);ye.isHidden()||(this.opacities[pe]=ye,p=p||_e.text.placed||_e.icon.placed)}}for(var Ue in w)this.variableOffsets[Ue]||!this.opacities[Ue]||this.opacities[Ue].isHidden()||(this.variableOffsets[Ue]=w[Ue]);for(var ke in C)this.placedOrientations[ke]||!this.opacities[ke]||this.opacities[ke].isHidden()||(this.placedOrientations[ke]=C[ke]);p?this.lastPlacementChangeTime=h:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=d?d.lastPlacementChangeTime:h)},Sn.prototype.updateLayerOpacities=function(h,d){for(var p={},g=0,S=d;g<S.length;g+=1){var w=S[g],C=w.getBucket(h);C&&w.latestFeatureIndex&&h.id===C.layerIds[0]&&this.updateBucketOpacities(C,p,w.collisionBoxArray)}},Sn.prototype.updateBucketOpacities=function(h,d,p){var g=this;h.hasTextData()&&h.text.opacityVertexArray.clear(),h.hasIconData()&&h.icon.opacityVertexArray.clear(),h.hasIconCollisionBoxData()&&h.iconCollisionBox.collisionVertexArray.clear(),h.hasTextCollisionBoxData()&&h.textCollisionBox.collisionVertexArray.clear();var S=h.layers[0].layout,w=new Vo(null,0,!1,!1,!0),C=S.get("text-allow-overlap"),P=S.get("icon-allow-overlap"),Z=S.get("text-variable-anchor"),Y=S.get("text-rotation-alignment")==="map",pe=S.get("text-pitch-alignment")==="map",_e=S.get("icon-text-fit")!=="none",ye=new Vo(null,0,C&&(P||!h.hasIconData()||S.get("icon-optional")),P&&(C||!h.hasTextData()||S.get("text-optional")),!0);!h.collisionArrays&&p&&(h.hasIconCollisionBoxData()||h.hasTextCollisionBoxData())&&h.deserializeCollisionBoxes(p);for(var Ue=function($e,vt,Rt){for(var Jt=0;Jt<vt/4;Jt++)$e.opacityVertexArray.emplaceBack(Rt)},ke=function($e){var vt=h.symbolInstances.get($e),Rt=vt.numHorizontalGlyphVertices,Jt=vt.numVerticalGlyphVertices,zt=vt.crossTileID,ar=g.opacities[zt];d[zt]?ar=w:ar||(g.opacities[zt]=ar=ye),d[zt]=!0;var _r=vt.numIconVertices>0,Nr=g.placedOrientations[vt.crossTileID],kr=Nr===_.WritingMode.vertical,un=Nr===_.WritingMode.horizontal||Nr===_.WritingMode.horizontalOnly;if(Rt>0||Jt>0){var Pn=To(ar.text);Ue(h.text,Rt,kr?co:Pn),Ue(h.text,Jt,un?co:Pn);var zn=ar.text.isHidden();[vt.rightJustifiedTextSymbolIndex,vt.centerJustifiedTextSymbolIndex,vt.leftJustifiedTextSymbolIndex].forEach(function(Kn){Kn>=0&&(h.text.placedSymbolArray.get(Kn).hidden=zn||kr?1:0)}),vt.verticalPlacedTextSymbolIndex>=0&&(h.text.placedSymbolArray.get(vt.verticalPlacedTextSymbolIndex).hidden=zn||un?1:0);var Zn=g.variableOffsets[vt.crossTileID];Zn&&g.markUsedJustification(h,Zn.anchor,vt,Nr);var Wi=g.placedOrientations[vt.crossTileID];Wi&&(g.markUsedJustification(h,"left",vt,Wi),g.markUsedOrientation(h,Wi,vt))}if(_r){var vn=To(ar.icon),ei=!(_e&&vt.verticalPlacedIconSymbolIndex&&kr);vt.placedIconSymbolIndex>=0&&(Ue(h.icon,vt.numIconVertices,ei?vn:co),h.icon.placedSymbolArray.get(vt.placedIconSymbolIndex).hidden=ar.icon.isHidden()),vt.verticalPlacedIconSymbolIndex>=0&&(Ue(h.icon,vt.numVerticalIconVertices,ei?co:vn),h.icon.placedSymbolArray.get(vt.verticalPlacedIconSymbolIndex).hidden=ar.icon.isHidden())}if(h.hasIconCollisionBoxData()||h.hasTextCollisionBoxData()){var _i=h.collisionArrays[$e];if(_i){var ri=new _.Point(0,0);if(_i.textBox||_i.verticalTextBox){var qn=!0;if(Z){var di=g.variableOffsets[zt];di?(ri=ea(di.anchor,di.width,di.height,di.textOffset,di.textBoxScale),Y&&ri._rotate(pe?g.transform.angle:-g.transform.angle)):qn=!1}_i.textBox&&de(h.textCollisionBox.collisionVertexArray,ar.text.placed,!qn||kr,ri.x,ri.y),_i.verticalTextBox&&de(h.textCollisionBox.collisionVertexArray,ar.text.placed,!qn||un,ri.x,ri.y)}var Jn=!!(!un&&_i.verticalIconBox);_i.iconBox&&de(h.iconCollisionBox.collisionVertexArray,ar.icon.placed,Jn,_e?ri.x:0,_e?ri.y:0),_i.verticalIconBox&&de(h.iconCollisionBox.collisionVertexArray,ar.icon.placed,!Jn,_e?ri.x:0,_e?ri.y:0)}}},Ke=0;Ke<h.symbolInstances.length;Ke++)ke(Ke);if(h.sortFeatures(this.transform.angle),this.retainedQueryData[h.bucketInstanceId]&&(this.retainedQueryData[h.bucketInstanceId].featureSortOrder=h.featureSortOrder),h.hasTextData()&&h.text.opacityVertexBuffer&&h.text.opacityVertexBuffer.updateData(h.text.opacityVertexArray),h.hasIconData()&&h.icon.opacityVertexBuffer&&h.icon.opacityVertexBuffer.updateData(h.icon.opacityVertexArray),h.hasIconCollisionBoxData()&&h.iconCollisionBox.collisionVertexBuffer&&h.iconCollisionBox.collisionVertexBuffer.updateData(h.iconCollisionBox.collisionVertexArray),h.hasTextCollisionBoxData()&&h.textCollisionBox.collisionVertexBuffer&&h.textCollisionBox.collisionVertexBuffer.updateData(h.textCollisionBox.collisionVertexArray),h.bucketInstanceId in this.collisionCircleArrays){var Ie=this.collisionCircleArrays[h.bucketInstanceId];h.placementInvProjMatrix=Ie.invProjMatrix,h.placementViewportMatrix=Ie.viewportMatrix,h.collisionCircleArray=Ie.circles,delete this.collisionCircleArrays[h.bucketInstanceId]}},Sn.prototype.symbolFadeChange=function(h){return this.fadeDuration===0?1:(h-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Sn.prototype.zoomAdjustment=function(h){return Math.max(0,(this.transform.zoom-h)/1.5)},Sn.prototype.hasTransitions=function(h){return this.stale||h-this.lastPlacementChangeTime<this.fadeDuration},Sn.prototype.stillRecent=function(h,d){var p=this.zoomAtLastRecencyCheck===d?1-this.zoomAdjustment(d):1;return this.zoomAtLastRecencyCheck=d,this.commitTime+this.fadeDuration*p>h},Sn.prototype.setStale=function(){this.stale=!0};var Re=Math.pow(2,25),ct=Math.pow(2,24),or=Math.pow(2,17),jr=Math.pow(2,16),In=Math.pow(2,9),Hi=Math.pow(2,8),vo=Math.pow(2,1);function To(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;var d=h.placed?1:0,p=Math.floor(127*h.opacity);return p*Re+d*ct+p*or+d*jr+p*In+d*Hi+p*vo+d}var co=0,Ps=function(h){this._sortAcrossTiles=h.layout.get("symbol-z-order")!=="viewport-y"&&h.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Ps.prototype.continuePlacement=function(h,d,p,g,S){for(var w=this._bucketParts;this._currentTileIndex<h.length;)if(d.getBucketParts(w,g,h[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,S())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,w.sort(function(C,P){return C.sortKey-P.sortKey}));this._currentPartIndex<w.length;)if(d.placeLayerBucketPart(w[this._currentPartIndex],this._seenCrossTileIDs,p),this._currentPartIndex++,S())return!0;return!1};var ys=function(h,d,p,g,S,w,C){this.placement=new Sn(h,S,w,C),this._currentPlacementIndex=d.length-1,this._forceFullPlacement=p,this._showCollisionBoxes=g,this._done=!1};ys.prototype.isDone=function(){return this._done},ys.prototype.continuePlacement=function(h,d,p){for(var g=this,S=_.browser.now(),w=function(){var Z=_.browser.now()-S;return!g._forceFullPlacement&&Z>2};this._currentPlacementIndex>=0;){var C=d[h[this._currentPlacementIndex]],P=this.placement.collisionIndex.transform.zoom;if(C.type==="symbol"&&(!C.minzoom||C.minzoom<=P)&&(!C.maxzoom||C.maxzoom>P)){if(this._inProgressLayer||(this._inProgressLayer=new Ps(C)),this._inProgressLayer.continuePlacement(p[C.source],this.placement,this._showCollisionBoxes,C,w))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ys.prototype.commit=function(h){return this.placement.commit(h),this.placement};var Kh=512/_.EXTENT/2,Cf=function(h,d,p){this.tileID=h,this.indexedSymbolInstances={},this.bucketInstanceId=p;for(var g=0;g<d.length;g++){var S=d.get(g),w=S.key;this.indexedSymbolInstances[w]||(this.indexedSymbolInstances[w]=[]),this.indexedSymbolInstances[w].push({crossTileID:S.crossTileID,coord:this.getScaledCoordinates(S,h)})}};Cf.prototype.getScaledCoordinates=function(h,d){var p=Kh/Math.pow(2,d.canonical.z-this.tileID.canonical.z);return{x:Math.floor((d.canonical.x*_.EXTENT+h.anchorX)*p),y:Math.floor((d.canonical.y*_.EXTENT+h.anchorY)*p)}},Cf.prototype.findMatches=function(h,d,p){for(var g=this.tileID.canonical.z<d.canonical.z?1:Math.pow(2,this.tileID.canonical.z-d.canonical.z),S=0;S<h.length;S++){var w=h.get(S);if(!w.crossTileID){var C=this.indexedSymbolInstances[w.key];if(C)for(var P=this.getScaledCoordinates(w,d),Z=0,Y=C;Z<Y.length;Z+=1){var pe=Y[Z];if(Math.abs(pe.coord.x-P.x)<=g&&Math.abs(pe.coord.y-P.y)<=g&&!p[pe.crossTileID]){p[pe.crossTileID]=!0,w.crossTileID=pe.crossTileID;break}}}}};var jo=function(){this.maxCrossTileID=0};jo.prototype.generate=function(){return++this.maxCrossTileID};var xl=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};xl.prototype.handleWrapJump=function(h){var d=Math.round((h-this.lng)/360);if(d!==0)for(var p in this.indexes){var g=this.indexes[p],S={};for(var w in g){var C=g[w];C.tileID=C.tileID.unwrapTo(C.tileID.wrap+d),S[C.tileID.key]=C}this.indexes[p]=S}this.lng=h},xl.prototype.addBucket=function(h,d,p){if(this.indexes[h.overscaledZ]&&this.indexes[h.overscaledZ][h.key]){if(this.indexes[h.overscaledZ][h.key].bucketInstanceId===d.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(h.overscaledZ,this.indexes[h.overscaledZ][h.key])}for(var g=0;g<d.symbolInstances.length;g++)d.symbolInstances.get(g).crossTileID=0;this.usedCrossTileIDs[h.overscaledZ]||(this.usedCrossTileIDs[h.overscaledZ]={});var S=this.usedCrossTileIDs[h.overscaledZ];for(var w in this.indexes){var C=this.indexes[w];if(Number(w)>h.overscaledZ)for(var P in C){var Z=C[P];Z.tileID.isChildOf(h)&&Z.findMatches(d.symbolInstances,h,S)}else{var Y=C[h.scaledTo(Number(w)).key];Y&&Y.findMatches(d.symbolInstances,h,S)}}for(var pe=0;pe<d.symbolInstances.length;pe++){var _e=d.symbolInstances.get(pe);_e.crossTileID||(_e.crossTileID=p.generate(),S[_e.crossTileID]=!0)}return this.indexes[h.overscaledZ]===void 0&&(this.indexes[h.overscaledZ]={}),this.indexes[h.overscaledZ][h.key]=new Cf(h,d.symbolInstances,d.bucketInstanceId),!0},xl.prototype.removeBucketCrossTileIDs=function(h,d){for(var p in d.indexedSymbolInstances)for(var g=0,S=d.indexedSymbolInstances[p];g<S.length;g+=1)delete this.usedCrossTileIDs[h][S[g].crossTileID]},xl.prototype.removeStaleBuckets=function(h){var d=!1;for(var p in this.indexes){var g=this.indexes[p];for(var S in g)h[g[S].bucketInstanceId]||(this.removeBucketCrossTileIDs(p,g[S]),delete g[S],d=!0)}return d};var bl=function(){this.layerIndexes={},this.crossTileIDs=new jo,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};bl.prototype.addLayer=function(h,d,p){var g=this.layerIndexes[h.id];g===void 0&&(g=this.layerIndexes[h.id]=new xl);var S=!1,w={};g.handleWrapJump(p);for(var C=0,P=d;C<P.length;C+=1){var Z=P[C],Y=Z.getBucket(h);Y&&h.id===Y.layerIds[0]&&(Y.bucketInstanceId||(Y.bucketInstanceId=++this.maxBucketInstanceId),g.addBucket(Z.tileID,Y,this.crossTileIDs)&&(S=!0),w[Y.bucketInstanceId]=!0)}return g.removeStaleBuckets(w)&&(S=!0),S},bl.prototype.pruneUnusedLayers=function(h){var d={};for(var p in h.forEach(function(g){d[g]=!0}),this.layerIndexes)d[p]||delete this.layerIndexes[p]};var Mu=function(h,d){return _.emitValidationErrors(h,d&&d.filter(function(p){return p.identifier!=="source.canvas"}))},Iu=_.pick(Yr,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Qu=_.pick(Yr,["setCenter","setZoom","setBearing","setPitch"]),Qc=function(){var h={},d=_.styleSpec.$version;for(var p in _.styleSpec.$root){var g,S=_.styleSpec.$root[p];S.required&&(g=p==="version"?d:S.type==="array"?[]:{})!=null&&(h[p]=g)}return h}(),Os=function(h){function d(p,g){var S=this;g===void 0&&(g={}),h.call(this),this.map=p,this.dispatcher=new Ct(sr(),this),this.imageManager=new Zt,this.imageManager.setEventedParent(this),this.glyphManager=new lr(p._requestManager,g.localIdeographFontFamily),this.lineAtlas=new qe(256,512),this.crossTileSymbolIndex=new bl,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new _.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",_.getReferrer());var w=this;this._rtlTextPluginCallback=d.registerForPluginStateChange(function(C){w.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:C.pluginStatus,pluginURL:C.pluginURL},function(P,Z){if(_.triggerPluginCompletionEvent(P),Z&&Z.every(function(pe){return pe}))for(var Y in w.sourceCaches)w.sourceCaches[Y].reload()})}),this.on("data",function(C){if(C.dataType==="source"&&C.sourceDataType==="metadata"){var P=S.sourceCaches[C.sourceId];if(P){var Z=P.getSource();if(Z&&Z.vectorLayerIds)for(var Y in S._layers){var pe=S._layers[Y];pe.source===Z.id&&S._validateLayer(pe)}}}})}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.loadURL=function(p,g){var S=this;g===void 0&&(g={}),this.fire(new _.Event("dataloading",{dataType:"style"}));var w=typeof g.validate=="boolean"?g.validate:!_.isMapboxURL(p);p=this.map._requestManager.normalizeStyleURL(p,g.accessToken);var C=this.map._requestManager.transformRequest(p,_.ResourceType.Style);this._request=_.getJSON(C,function(P,Z){S._request=null,P?S.fire(new _.ErrorEvent(P)):Z&&S._load(Z,w)})},d.prototype.loadJSON=function(p,g){var S=this;g===void 0&&(g={}),this.fire(new _.Event("dataloading",{dataType:"style"})),this._request=_.browser.frame(function(){S._request=null,S._load(p,g.validate!==!1)})},d.prototype.loadEmpty=function(){this.fire(new _.Event("dataloading",{dataType:"style"})),this._load(Qc,!1)},d.prototype._load=function(p,g){if(!g||!Mu(this,_.validateStyle(p))){for(var S in this._loaded=!0,this.stylesheet=p,p.sources)this.addSource(S,p.sources[S],{validate:!1});p.sprite?this._loadSprite(p.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(p.glyphs);var w=Wr(this.stylesheet.layers);this._order=w.map(function(Y){return Y.id}),this._layers={},this._serializedLayers={};for(var C=0,P=w;C<P.length;C+=1){var Z=P[C];(Z=_.createStyleLayer(Z)).setEventedParent(this,{layer:{id:Z.id}}),this._layers[Z.id]=Z,this._serializedLayers[Z.id]=Z.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new It(this.stylesheet.light),this.fire(new _.Event("data",{dataType:"style"})),this.fire(new _.Event("style.load"))}},d.prototype._loadSprite=function(p){var g=this;this._spriteRequest=function(S,w,C){var P,Z,Y,pe=_.browser.devicePixelRatio>1?"@2x":"",_e=_.getJSON(w.transformRequest(w.normalizeSpriteURL(S,pe,".json"),_.ResourceType.SpriteJSON),function(ke,Ke){_e=null,Y||(Y=ke,P=Ke,Ue())}),ye=_.getImage(w.transformRequest(w.normalizeSpriteURL(S,pe,".png"),_.ResourceType.SpriteImage),function(ke,Ke){ye=null,Y||(Y=ke,Z=Ke,Ue())});function Ue(){if(Y)C(Y);else if(P&&Z){var ke=_.browser.getImageData(Z),Ke={};for(var Ie in P){var $e=P[Ie],vt=$e.width,Rt=$e.height,Jt=$e.x,zt=$e.y,ar=$e.sdf,_r=$e.pixelRatio,Nr=$e.stretchX,kr=$e.stretchY,un=$e.content,Pn=new _.RGBAImage({width:vt,height:Rt});_.RGBAImage.copy(ke,Pn,{x:Jt,y:zt},{x:0,y:0},{width:vt,height:Rt}),Ke[Ie]={data:Pn,pixelRatio:_r,sdf:ar,stretchX:Nr,stretchY:kr,content:un}}C(null,Ke)}}return{cancel:function(){_e&&(_e.cancel(),_e=null),ye&&(ye.cancel(),ye=null)}}}(p,this.map._requestManager,function(S,w){if(g._spriteRequest=null,S)g.fire(new _.ErrorEvent(S));else if(w)for(var C in w)g.imageManager.addImage(C,w[C]);g.imageManager.setLoaded(!0),g._availableImages=g.imageManager.listImages(),g.dispatcher.broadcast("setImages",g._availableImages),g.fire(new _.Event("data",{dataType:"style"}))})},d.prototype._validateLayer=function(p){var g=this.sourceCaches[p.source];if(g){var S=p.sourceLayer;if(S){var w=g.getSource();(w.type==="geojson"||w.vectorLayerIds&&w.vectorLayerIds.indexOf(S)===-1)&&this.fire(new _.ErrorEvent(new Error('Source layer "'+S+'" does not exist on source "'+w.id+'" as specified by style layer "'+p.id+'"')))}}},d.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var p in this.sourceCaches)if(!this.sourceCaches[p].loaded())return!1;return!!this.imageManager.isLoaded()},d.prototype._serializeLayers=function(p){for(var g=[],S=0,w=p;S<w.length;S+=1){var C=this._layers[w[S]];C.type!=="custom"&&g.push(C.serialize())}return g},d.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var p in this.sourceCaches)if(this.sourceCaches[p].hasTransition())return!0;for(var g in this._layers)if(this._layers[g].hasTransition())return!0;return!1},d.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},d.prototype.update=function(p){if(this._loaded){var g=this._changed;if(this._changed){var S=Object.keys(this._updatedLayers),w=Object.keys(this._removedLayers);for(var C in(S.length||w.length)&&this._updateWorkerLayers(S,w),this._updatedSources){var P=this._updatedSources[C];P==="reload"?this._reloadSource(C):P==="clear"&&this._clearSource(C)}for(var Z in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[Z].updateTransitions(p);this.light.updateTransitions(p),this._resetUpdates()}var Y={};for(var pe in this.sourceCaches){var _e=this.sourceCaches[pe];Y[pe]=_e.used,_e.used=!1}for(var ye=0,Ue=this._order;ye<Ue.length;ye+=1){var ke=this._layers[Ue[ye]];ke.recalculate(p,this._availableImages),!ke.isHidden(p.zoom)&&ke.source&&(this.sourceCaches[ke.source].used=!0)}for(var Ke in Y){var Ie=this.sourceCaches[Ke];Y[Ke]!==Ie.used&&Ie.fire(new _.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:Ke}))}this.light.recalculate(p),this.z=p.zoom,g&&this.fire(new _.Event("data",{dataType:"style"}))}},d.prototype._updateTilesForChangedImages=function(){var p=Object.keys(this._changedImages);if(p.length){for(var g in this.sourceCaches)this.sourceCaches[g].reloadTilesForDependencies(["icons","patterns"],p);this._changedImages={}}},d.prototype._updateWorkerLayers=function(p,g){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(p),removedIds:g})},d.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},d.prototype.setState=function(p){var g=this;if(this._checkLoaded(),Mu(this,_.validateStyle(p)))return!1;(p=_.clone$1(p)).layers=Wr(p.layers);var S=function(C,P){if(!C)return[{command:Yr.setStyle,args:[P]}];var Z=[];try{if(!_.deepEqual(C.version,P.version))return[{command:Yr.setStyle,args:[P]}];_.deepEqual(C.center,P.center)||Z.push({command:Yr.setCenter,args:[P.center]}),_.deepEqual(C.zoom,P.zoom)||Z.push({command:Yr.setZoom,args:[P.zoom]}),_.deepEqual(C.bearing,P.bearing)||Z.push({command:Yr.setBearing,args:[P.bearing]}),_.deepEqual(C.pitch,P.pitch)||Z.push({command:Yr.setPitch,args:[P.pitch]}),_.deepEqual(C.sprite,P.sprite)||Z.push({command:Yr.setSprite,args:[P.sprite]}),_.deepEqual(C.glyphs,P.glyphs)||Z.push({command:Yr.setGlyphs,args:[P.glyphs]}),_.deepEqual(C.transition,P.transition)||Z.push({command:Yr.setTransition,args:[P.transition]}),_.deepEqual(C.light,P.light)||Z.push({command:Yr.setLight,args:[P.light]});var Y={},pe=[];(function(ye,Ue,ke,Ke){var Ie;for(Ie in Ue=Ue||{},ye=ye||{})ye.hasOwnProperty(Ie)&&(Ue.hasOwnProperty(Ie)||tn(Ie,ke,Ke));for(Ie in Ue)Ue.hasOwnProperty(Ie)&&(ye.hasOwnProperty(Ie)?_.deepEqual(ye[Ie],Ue[Ie])||(ye[Ie].type==="geojson"&&Ue[Ie].type==="geojson"&&qi(ye,Ue,Ie)?ke.push({command:Yr.setGeoJSONSourceData,args:[Ie,Ue[Ie].data]}):vi(Ie,Ue,ke,Ke)):pi(Ie,Ue,ke))})(C.sources,P.sources,pe,Y);var _e=[];C.layers&&C.layers.forEach(function(ye){Y[ye.source]?Z.push({command:Yr.removeLayer,args:[ye.id]}):_e.push(ye)}),Z=Z.concat(pe),function(ye,Ue,ke){Ue=Ue||[];var Ke,Ie,$e,vt,Rt,Jt,zt,ar=(ye=ye||[]).map(zi),_r=Ue.map(zi),Nr=ye.reduce(Ai,{}),kr=Ue.reduce(Ai,{}),un=ar.slice(),Pn=Object.create(null);for(Ke=0,Ie=0;Ke<ar.length;Ke++)kr.hasOwnProperty($e=ar[Ke])?Ie++:(ke.push({command:Yr.removeLayer,args:[$e]}),un.splice(un.indexOf($e,Ie),1));for(Ke=0,Ie=0;Ke<_r.length;Ke++)un[un.length-1-Ke]!==($e=_r[_r.length-1-Ke])&&(Nr.hasOwnProperty($e)?(ke.push({command:Yr.removeLayer,args:[$e]}),un.splice(un.lastIndexOf($e,un.length-Ie),1)):Ie++,ke.push({command:Yr.addLayer,args:[kr[$e],Jt=un[un.length-Ke]]}),un.splice(un.length-Ke,0,$e),Pn[$e]=!0);for(Ke=0;Ke<_r.length;Ke++)if(vt=Nr[$e=_r[Ke]],Rt=kr[$e],!Pn[$e]&&!_.deepEqual(vt,Rt))if(_.deepEqual(vt.source,Rt.source)&&_.deepEqual(vt["source-layer"],Rt["source-layer"])&&_.deepEqual(vt.type,Rt.type)){for(zt in ci(vt.layout,Rt.layout,ke,$e,null,Yr.setLayoutProperty),ci(vt.paint,Rt.paint,ke,$e,null,Yr.setPaintProperty),_.deepEqual(vt.filter,Rt.filter)||ke.push({command:Yr.setFilter,args:[$e,Rt.filter]}),_.deepEqual(vt.minzoom,Rt.minzoom)&&_.deepEqual(vt.maxzoom,Rt.maxzoom)||ke.push({command:Yr.setLayerZoomRange,args:[$e,Rt.minzoom,Rt.maxzoom]}),vt)vt.hasOwnProperty(zt)&&zt!=="layout"&&zt!=="paint"&&zt!=="filter"&&zt!=="metadata"&&zt!=="minzoom"&&zt!=="maxzoom"&&(zt.indexOf("paint.")===0?ci(vt[zt],Rt[zt],ke,$e,zt.slice(6),Yr.setPaintProperty):_.deepEqual(vt[zt],Rt[zt])||ke.push({command:Yr.setLayerProperty,args:[$e,zt,Rt[zt]]}));for(zt in Rt)Rt.hasOwnProperty(zt)&&!vt.hasOwnProperty(zt)&&zt!=="layout"&&zt!=="paint"&&zt!=="filter"&&zt!=="metadata"&&zt!=="minzoom"&&zt!=="maxzoom"&&(zt.indexOf("paint.")===0?ci(vt[zt],Rt[zt],ke,$e,zt.slice(6),Yr.setPaintProperty):_.deepEqual(vt[zt],Rt[zt])||ke.push({command:Yr.setLayerProperty,args:[$e,zt,Rt[zt]]}))}else ke.push({command:Yr.removeLayer,args:[$e]}),Jt=un[un.lastIndexOf($e)+1],ke.push({command:Yr.addLayer,args:[Rt,Jt]})}(_e,P.layers,Z)}catch(ye){console.warn("Unable to compute style diff:",ye),Z=[{command:Yr.setStyle,args:[P]}]}return Z}(this.serialize(),p).filter(function(C){return!(C.command in Qu)});if(S.length===0)return!1;var w=S.filter(function(C){return!(C.command in Iu)});if(w.length>0)throw new Error("Unimplemented: "+w.map(function(C){return C.command}).join(", ")+".");return S.forEach(function(C){C.command!=="setTransition"&&g[C.command].apply(g,C.args)}),this.stylesheet=p,!0},d.prototype.addImage=function(p,g){if(this.getImage(p))return this.fire(new _.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(p,g),this._afterImageUpdated(p)},d.prototype.updateImage=function(p,g){this.imageManager.updateImage(p,g)},d.prototype.getImage=function(p){return this.imageManager.getImage(p)},d.prototype.removeImage=function(p){if(!this.getImage(p))return this.fire(new _.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(p),this._afterImageUpdated(p)},d.prototype._afterImageUpdated=function(p){this._availableImages=this.imageManager.listImages(),this._changedImages[p]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new _.Event("data",{dataType:"style"}))},d.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},d.prototype.addSource=function(p,g,S){var w=this;if(S===void 0&&(S={}),this._checkLoaded(),this.sourceCaches[p]!==void 0)throw new Error("There is already a source with this ID");if(!g.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(g).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(g.type)>=0&&this._validate(_.validateStyle.source,"sources."+p,g,null,S))){this.map&&this.map._collectResourceTiming&&(g.collectResourceTiming=!0);var C=this.sourceCaches[p]=new Q(p,g,this.dispatcher);C.style=this,C.setEventedParent(this,function(){return{isSourceLoaded:w.loaded(),source:C.serialize(),sourceId:p}}),C.onAdd(this.map),this._changed=!0}},d.prototype.removeSource=function(p){if(this._checkLoaded(),this.sourceCaches[p]===void 0)throw new Error("There is no source with this ID");for(var g in this._layers)if(this._layers[g].source===p)return this.fire(new _.ErrorEvent(new Error('Source "'+p+'" cannot be removed while layer "'+g+'" is using it.')));var S=this.sourceCaches[p];delete this.sourceCaches[p],delete this._updatedSources[p],S.fire(new _.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:p})),S.setEventedParent(null),S.clearTiles(),S.onRemove&&S.onRemove(this.map),this._changed=!0},d.prototype.setGeoJSONSourceData=function(p,g){this._checkLoaded(),this.sourceCaches[p].getSource().setData(g),this._changed=!0},d.prototype.getSource=function(p){return this.sourceCaches[p]&&this.sourceCaches[p].getSource()},d.prototype.addLayer=function(p,g,S){S===void 0&&(S={}),this._checkLoaded();var w=p.id;if(this.getLayer(w))this.fire(new _.ErrorEvent(new Error('Layer with id "'+w+'" already exists on this map')));else{var C;if(p.type==="custom"){if(Mu(this,_.validateCustomStyleLayer(p)))return;C=_.createStyleLayer(p)}else{if(typeof p.source=="object"&&(this.addSource(w,p.source),p=_.clone$1(p),p=_.extend(p,{source:w})),this._validate(_.validateStyle.layer,"layers."+w,p,{arrayIndex:-1},S))return;C=_.createStyleLayer(p),this._validateLayer(C),C.setEventedParent(this,{layer:{id:w}}),this._serializedLayers[C.id]=C.serialize()}var P=g?this._order.indexOf(g):this._order.length;if(g&&P===-1)this.fire(new _.ErrorEvent(new Error('Layer with id "'+g+'" does not exist on this map.')));else{if(this._order.splice(P,0,w),this._layerOrderChanged=!0,this._layers[w]=C,this._removedLayers[w]&&C.source&&C.type!=="custom"){var Z=this._removedLayers[w];delete this._removedLayers[w],Z.type!==C.type?this._updatedSources[C.source]="clear":(this._updatedSources[C.source]="reload",this.sourceCaches[C.source].pause())}this._updateLayer(C),C.onAdd&&C.onAdd(this.map)}}},d.prototype.moveLayer=function(p,g){if(this._checkLoaded(),this._changed=!0,this._layers[p]){if(p!==g){var S=this._order.indexOf(p);this._order.splice(S,1);var w=g?this._order.indexOf(g):this._order.length;g&&w===-1?this.fire(new _.ErrorEvent(new Error('Layer with id "'+g+'" does not exist on this map.'))):(this._order.splice(w,0,p),this._layerOrderChanged=!0)}}else this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be moved.")))},d.prototype.removeLayer=function(p){this._checkLoaded();var g=this._layers[p];if(g){g.setEventedParent(null);var S=this._order.indexOf(p);this._order.splice(S,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[p]=g,delete this._layers[p],delete this._serializedLayers[p],delete this._updatedLayers[p],delete this._updatedPaintProps[p],g.onRemove&&g.onRemove(this.map)}else this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be removed.")))},d.prototype.getLayer=function(p){return this._layers[p]},d.prototype.hasLayer=function(p){return p in this._layers},d.prototype.setLayerZoomRange=function(p,g,S){this._checkLoaded();var w=this.getLayer(p);w?w.minzoom===g&&w.maxzoom===S||(g!=null&&(w.minzoom=g),S!=null&&(w.maxzoom=S),this._updateLayer(w)):this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot have zoom extent.")))},d.prototype.setFilter=function(p,g,S){S===void 0&&(S={}),this._checkLoaded();var w=this.getLayer(p);if(w){if(!_.deepEqual(w.filter,g))return g==null?(w.filter=void 0,void this._updateLayer(w)):void(this._validate(_.validateStyle.filter,"layers."+w.id+".filter",g,null,S)||(w.filter=_.clone$1(g),this._updateLayer(w)))}else this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be filtered.")))},d.prototype.getFilter=function(p){return _.clone$1(this.getLayer(p).filter)},d.prototype.setLayoutProperty=function(p,g,S,w){w===void 0&&(w={}),this._checkLoaded();var C=this.getLayer(p);C?_.deepEqual(C.getLayoutProperty(g),S)||(C.setLayoutProperty(g,S,w),this._updateLayer(C)):this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be styled.")))},d.prototype.getLayoutProperty=function(p,g){var S=this.getLayer(p);if(S)return S.getLayoutProperty(g);this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style.")))},d.prototype.setPaintProperty=function(p,g,S,w){w===void 0&&(w={}),this._checkLoaded();var C=this.getLayer(p);C?_.deepEqual(C.getPaintProperty(g),S)||(C.setPaintProperty(g,S,w)&&this._updateLayer(C),this._changed=!0,this._updatedPaintProps[p]=!0):this.fire(new _.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be styled.")))},d.prototype.getPaintProperty=function(p,g){return this.getLayer(p).getPaintProperty(g)},d.prototype.setFeatureState=function(p,g){this._checkLoaded();var S=p.source,w=p.sourceLayer,C=this.sourceCaches[S];if(C!==void 0){var P=C.getSource().type;P==="geojson"&&w?this.fire(new _.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):P!=="vector"||w?(p.id===void 0&&this.fire(new _.ErrorEvent(new Error("The feature id parameter must be provided."))),C.setFeatureState(w,p.id,g)):this.fire(new _.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new _.ErrorEvent(new Error("The source '"+S+"' does not exist in the map's style.")))},d.prototype.removeFeatureState=function(p,g){this._checkLoaded();var S=p.source,w=this.sourceCaches[S];if(w!==void 0){var C=w.getSource().type,P=C==="vector"?p.sourceLayer:void 0;C!=="vector"||P?g&&typeof p.id!="string"&&typeof p.id!="number"?this.fire(new _.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):w.removeFeatureState(P,p.id,g):this.fire(new _.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new _.ErrorEvent(new Error("The source '"+S+"' does not exist in the map's style.")))},d.prototype.getFeatureState=function(p){this._checkLoaded();var g=p.source,S=p.sourceLayer,w=this.sourceCaches[g];if(w!==void 0){if(w.getSource().type!=="vector"||S)return p.id===void 0&&this.fire(new _.ErrorEvent(new Error("The feature id parameter must be provided."))),w.getFeatureState(S,p.id);this.fire(new _.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new _.ErrorEvent(new Error("The source '"+g+"' does not exist in the map's style.")))},d.prototype.getTransition=function(){return _.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},d.prototype.serialize=function(){return _.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:_.mapObject(this.sourceCaches,function(p){return p.serialize()}),layers:this._serializeLayers(this._order)},function(p){return p!==void 0})},d.prototype._updateLayer=function(p){this._updatedLayers[p.id]=!0,p.source&&!this._updatedSources[p.source]&&this.sourceCaches[p.source].getSource().type!=="raster"&&(this._updatedSources[p.source]="reload",this.sourceCaches[p.source].pause()),this._changed=!0},d.prototype._flattenAndSortRenderedFeatures=function(p){for(var g=this,S=function(Nr){return g._layers[Nr].type==="fill-extrusion"},w={},C=[],P=this._order.length-1;P>=0;P--){var Z=this._order[P];if(S(Z)){w[Z]=P;for(var Y=0,pe=p;Y<pe.length;Y+=1){var _e=pe[Y][Z];if(_e)for(var ye=0,Ue=_e;ye<Ue.length;ye+=1)C.push(Ue[ye])}}}C.sort(function(Nr,kr){return kr.intersectionZ-Nr.intersectionZ});for(var ke=[],Ke=this._order.length-1;Ke>=0;Ke--){var Ie=this._order[Ke];if(S(Ie))for(var $e=C.length-1;$e>=0;$e--){var vt=C[$e].feature;if(w[vt.layer.id]<Ke)break;ke.push(vt),C.pop()}else for(var Rt=0,Jt=p;Rt<Jt.length;Rt+=1){var zt=Jt[Rt][Ie];if(zt)for(var ar=0,_r=zt;ar<_r.length;ar+=1)ke.push(_r[ar].feature)}}return ke},d.prototype.queryRenderedFeatures=function(p,g,S){g&&g.filter&&this._validate(_.validateStyle.filter,"queryRenderedFeatures.filter",g.filter,null,g);var w={};if(g&&g.layers){if(!Array.isArray(g.layers))return this.fire(new _.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var C=0,P=g.layers;C<P.length;C+=1){var Z=P[C],Y=this._layers[Z];if(!Y)return this.fire(new _.ErrorEvent(new Error("The layer '"+Z+"' does not exist in the map's style and cannot be queried for features."))),[];w[Y.source]=!0}}var pe=[];for(var _e in g.availableImages=this._availableImages,this.sourceCaches)g.layers&&!w[_e]||pe.push(Ht(this.sourceCaches[_e],this._layers,this._serializedLayers,p,g,S));return this.placement&&pe.push(function(ye,Ue,ke,Ke,Ie,$e,vt){for(var Rt={},Jt=$e.queryRenderedSymbols(Ke),zt=[],ar=0,_r=Object.keys(Jt).map(Number);ar<_r.length;ar+=1)zt.push(vt[_r[ar]]);zt.sort(on);for(var Nr=function(){var Zn=un[kr],Wi=Zn.featureIndex.lookupSymbolFeatures(Jt[Zn.bucketInstanceId],Ue,Zn.bucketIndex,Zn.sourceLayerIndex,Ie.filter,Ie.layers,Ie.availableImages,ye);for(var vn in Wi){var ei=Rt[vn]=Rt[vn]||[],_i=Wi[vn];_i.sort(function(di,Jn){var Kn=Zn.featureSortOrder;if(Kn){var Co=Kn.indexOf(di.featureIndex);return Kn.indexOf(Jn.featureIndex)-Co}return Jn.featureIndex-di.featureIndex});for(var ri=0,qn=_i;ri<qn.length;ri+=1)ei.push(qn[ri])}},kr=0,un=zt;kr<un.length;kr+=1)Nr();var Pn=function(Zn){Rt[Zn].forEach(function(Wi){var vn=Wi.feature,ei=ke[ye[Zn].source].getFeatureState(vn.layer["source-layer"],vn.id);vn.source=vn.layer.source,vn.layer["source-layer"]&&(vn.sourceLayer=vn.layer["source-layer"]),vn.state=ei})};for(var zn in Rt)Pn(zn);return Rt}(this._layers,this._serializedLayers,this.sourceCaches,p,g,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(pe)},d.prototype.querySourceFeatures=function(p,g){g&&g.filter&&this._validate(_.validateStyle.filter,"querySourceFeatures.filter",g.filter,null,g);var S=this.sourceCaches[p];return S?function(w,C){for(var P=w.getRenderableIds().map(function(Ue){return w.getTileByID(Ue)}),Z=[],Y={},pe=0;pe<P.length;pe++){var _e=P[pe],ye=_e.tileID.canonical.key;Y[ye]||(Y[ye]=!0,_e.querySourceFeatures(Z,C))}return Z}(S,g):[]},d.prototype.addSourceType=function(p,g,S){return d.getSourceType(p)?S(new Error('A source type called "'+p+'" already exists.')):(d.setSourceType(p,g),g.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:p,url:g.workerSourceURL},S):S(null,null))},d.prototype.getLight=function(){return this.light.getLight()},d.prototype.setLight=function(p,g){g===void 0&&(g={}),this._checkLoaded();var S=this.light.getLight(),w=!1;for(var C in p)if(!_.deepEqual(p[C],S[C])){w=!0;break}if(w){var P={now:_.browser.now(),transition:_.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(p,g),this.light.updateTransitions(P)}},d.prototype._validate=function(p,g,S,w,C){return C===void 0&&(C={}),(!C||C.validate!==!1)&&Mu(this,p.call(_.validateStyle,_.extend({key:g,style:this.serialize(),value:S,styleSpec:_.styleSpec},w)))},d.prototype._remove=function(){for(var p in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),_.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[p].setEventedParent(null);for(var g in this.sourceCaches)this.sourceCaches[g].clearTiles(),this.sourceCaches[g].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},d.prototype._clearSource=function(p){this.sourceCaches[p].clearTiles()},d.prototype._reloadSource=function(p){this.sourceCaches[p].resume(),this.sourceCaches[p].reload()},d.prototype._updateSources=function(p){for(var g in this.sourceCaches)this.sourceCaches[g].update(p)},d.prototype._generateCollisionBoxes=function(){for(var p in this.sourceCaches)this._reloadSource(p)},d.prototype._updatePlacement=function(p,g,S,w,C){C===void 0&&(C=!1);for(var P=!1,Z=!1,Y={},pe=0,_e=this._order;pe<_e.length;pe+=1){var ye=this._layers[_e[pe]];if(ye.type==="symbol"){if(!Y[ye.source]){var Ue=this.sourceCaches[ye.source];Y[ye.source]=Ue.getRenderableIds(!0).map(function(vt){return Ue.getTileByID(vt)}).sort(function(vt,Rt){return Rt.tileID.overscaledZ-vt.tileID.overscaledZ||(vt.tileID.isLessThan(Rt.tileID)?-1:1)})}var ke=this.crossTileSymbolIndex.addLayer(ye,Y[ye.source],p.center.lng);P=P||ke}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((C=C||this._layerOrderChanged||S===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(_.browser.now(),p.zoom))&&(this.pauseablePlacement=new ys(p,this._order,C,g,S,w,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Y),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(_.browser.now()),Z=!0),P&&this.pauseablePlacement.placement.setStale()),Z||P)for(var Ke=0,Ie=this._order;Ke<Ie.length;Ke+=1){var $e=this._layers[Ie[Ke]];$e.type==="symbol"&&this.placement.updateLayerOpacities($e,Y[$e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(_.browser.now())},d.prototype._releaseSymbolFadeTiles=function(){for(var p in this.sourceCaches)this.sourceCaches[p].releaseSymbolFadeTiles()},d.prototype.getImages=function(p,g,S){this.imageManager.getImages(g.icons,S),this._updateTilesForChangedImages();var w=this.sourceCaches[g.source];w&&w.setDependencies(g.tileID.key,g.type,g.icons)},d.prototype.getGlyphs=function(p,g,S){this.glyphManager.getGlyphs(g.stacks,S)},d.prototype.getResource=function(p,g,S){return _.makeRequest(g,S)},d}(_.Evented);Os.getSourceType=function(h){return Xe[h]},Os.setSourceType=function(h,d){Xe[h]=d},Os.registerForPluginStateChange=_.registerForPluginStateChange;var qa=_.createLayout([{name:"a_pos",type:"Int16",components:2}]),El=Ii(`#ifdef GL_ES
|
|
precision mediump float;
|
|
#else
|
|
#if !defined(lowp)
|
|
#define lowp
|
|
#endif
|
|
#if !defined(mediump)
|
|
#define mediump
|
|
#endif
|
|
#if !defined(highp)
|
|
#define highp
|
|
#endif
|
|
#endif`,`#ifdef GL_ES
|
|
precision highp float;
|
|
#else
|
|
#if !defined(lowp)
|
|
#define lowp
|
|
#endif
|
|
#if !defined(mediump)
|
|
#define mediump
|
|
#endif
|
|
#if !defined(highp)
|
|
#define highp
|
|
#endif
|
|
#endif
|
|
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
|
|
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}`),Ju=Ii(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Rf=Ii(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Qh=Ii(`varying vec3 v_data;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define mediump float radius
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define highp vec4 stroke_color
|
|
#pragma mapbox: define mediump float stroke_width
|
|
#pragma mapbox: define lowp float stroke_opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize mediump float radius
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|
#pragma mapbox: initialize mediump float stroke_width
|
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define mediump float radius
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define highp vec4 stroke_color
|
|
#pragma mapbox: define mediump float stroke_width
|
|
#pragma mapbox: define lowp float stroke_opacity
|
|
void main(void) {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize mediump float radius
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|
#pragma mapbox: initialize mediump float stroke_width
|
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),Mf=Ii("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),ph=Ii(`uniform highp float u_intensity;varying vec2 v_extrude;
|
|
#pragma mapbox: define highp float weight
|
|
#define GAUSS_COEF 0.3989422804014327
|
|
void main() {
|
|
#pragma mapbox: initialize highp float weight
|
|
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
|
|
#pragma mapbox: define highp float weight
|
|
#pragma mapbox: define mediump float radius
|
|
const highp float ZERO=1.0/255.0/16.0;
|
|
#define GAUSS_COEF 0.3989422804014327
|
|
void main(void) {
|
|
#pragma mapbox: initialize highp float weight
|
|
#pragma mapbox: initialize mediump float radius
|
|
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),dh=Ii(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(0.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),vh=Ii("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Jh=Ii("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),ep=Ii("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),Zp=Ii(`#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
gl_FragColor=color*opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
gl_Position=u_matrix*vec4(a_pos,0,1);}`),Jc=Ii(`varying vec2 v_pos;
|
|
#pragma mapbox: define highp vec4 outline_color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 outline_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
|
|
#pragma mapbox: define highp vec4 outline_color
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 outline_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),Pu=Ii(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),tp=Ii(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),Ho=Ii(`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;
|
|
#pragma mapbox: define highp float base
|
|
#pragma mapbox: define highp float height
|
|
#pragma mapbox: define highp vec4 color
|
|
void main() {
|
|
#pragma mapbox: initialize highp float base
|
|
#pragma mapbox: initialize highp float height
|
|
#pragma mapbox: initialize highp vec4 color
|
|
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),Yl=Ii(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
#pragma mapbox: define lowp float base
|
|
#pragma mapbox: define lowp float height
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float base
|
|
#pragma mapbox: initialize lowp float height
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
#pragma mapbox: define lowp float base
|
|
#pragma mapbox: define lowp float height
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float base
|
|
#pragma mapbox: initialize lowp float height
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
|
|
? a_pos
|
|
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),Sl=Ii(`#ifdef GL_ES
|
|
precision highp float;
|
|
#endif
|
|
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),$s=Ii(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
|
|
#define PI 3.141592653589793
|
|
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),Al=Ii(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float width
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float width
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),oi=Ii(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float width
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float width
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),el=Ii(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
#define LINE_DISTANCE_SCALE 2.0
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define mediump float width
|
|
#pragma mapbox: define lowp float floorwidth
|
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
#pragma mapbox: define lowp float pixel_ratio_to
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize mediump float width
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
#pragma mapbox: initialize mediump vec4 pattern_from
|
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),Ds=Ii(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float width
|
|
#pragma mapbox: define lowp float floorwidth
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float width
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`
|
|
#define scale 0.015873016
|
|
#define LINE_DISTANCE_SCALE 2.0
|
|
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
#pragma mapbox: define highp vec4 color
|
|
#pragma mapbox: define lowp float blur
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define mediump float gapwidth
|
|
#pragma mapbox: define lowp float offset
|
|
#pragma mapbox: define mediump float width
|
|
#pragma mapbox: define lowp float floorwidth
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 color
|
|
#pragma mapbox: initialize lowp float blur
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize mediump float gapwidth
|
|
#pragma mapbox: initialize lowp float offset
|
|
#pragma mapbox: initialize mediump float width
|
|
#pragma mapbox: initialize lowp float floorwidth
|
|
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),Ou=Ii(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),tl=Ii(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
|
|
#pragma mapbox: define lowp float opacity
|
|
void main() {
|
|
#pragma mapbox: initialize lowp float opacity
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),rp=Ii(`#define SDF_PX 8.0
|
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),ta=Ii(`#define SDF_PX 8.0
|
|
#define SDF 1.0
|
|
#define ICON 0.0
|
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
|
|
#ifdef OVERDRAW_INSPECTOR
|
|
gl_FragColor=vec4(1.0);
|
|
#endif
|
|
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
|
|
#pragma mapbox: define highp vec4 fill_color
|
|
#pragma mapbox: define highp vec4 halo_color
|
|
#pragma mapbox: define lowp float opacity
|
|
#pragma mapbox: define lowp float halo_width
|
|
#pragma mapbox: define lowp float halo_blur
|
|
void main() {
|
|
#pragma mapbox: initialize highp vec4 fill_color
|
|
#pragma mapbox: initialize highp vec4 halo_color
|
|
#pragma mapbox: initialize lowp float opacity
|
|
#pragma mapbox: initialize lowp float halo_width
|
|
#pragma mapbox: initialize lowp float halo_blur
|
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function Ii(h,d){var p=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,g=d.match(/attribute ([\w]+) ([\w]+)/g),S=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),w=d.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),C=w?w.concat(S):S,P={};return{fragmentSource:h=h.replace(p,function(Z,Y,pe,_e,ye){return P[ye]=!0,Y==="define"?`
|
|
#ifndef HAS_UNIFORM_u_`+ye+`
|
|
varying `+pe+" "+_e+" "+ye+`;
|
|
#else
|
|
uniform `+pe+" "+_e+" u_"+ye+`;
|
|
#endif
|
|
`:`
|
|
#ifdef HAS_UNIFORM_u_`+ye+`
|
|
`+pe+" "+_e+" "+ye+" = u_"+ye+`;
|
|
#endif
|
|
`}),vertexSource:d=d.replace(p,function(Z,Y,pe,_e,ye){var Ue=_e==="float"?"vec2":"vec4",ke=ye.match(/color/)?"color":Ue;return P[ye]?Y==="define"?`
|
|
#ifndef HAS_UNIFORM_u_`+ye+`
|
|
uniform lowp float u_`+ye+`_t;
|
|
attribute `+pe+" "+Ue+" a_"+ye+`;
|
|
varying `+pe+" "+_e+" "+ye+`;
|
|
#else
|
|
uniform `+pe+" "+_e+" u_"+ye+`;
|
|
#endif
|
|
`:ke==="vec4"?`
|
|
#ifndef HAS_UNIFORM_u_`+ye+`
|
|
`+ye+" = a_"+ye+`;
|
|
#else
|
|
`+pe+" "+_e+" "+ye+" = u_"+ye+`;
|
|
#endif
|
|
`:`
|
|
#ifndef HAS_UNIFORM_u_`+ye+`
|
|
`+ye+" = unpack_mix_"+ke+"(a_"+ye+", u_"+ye+`_t);
|
|
#else
|
|
`+pe+" "+_e+" "+ye+" = u_"+ye+`;
|
|
#endif
|
|
`:Y==="define"?`
|
|
#ifndef HAS_UNIFORM_u_`+ye+`
|
|
uniform lowp float u_`+ye+`_t;
|
|
attribute `+pe+" "+Ue+" a_"+ye+`;
|
|
#else
|
|
uniform `+pe+" "+_e+" u_"+ye+`;
|
|
#endif
|
|
`:ke==="vec4"?`
|
|
#ifndef HAS_UNIFORM_u_`+ye+`
|
|
`+pe+" "+_e+" "+ye+" = a_"+ye+`;
|
|
#else
|
|
`+pe+" "+_e+" "+ye+" = u_"+ye+`;
|
|
#endif
|
|
`:`
|
|
#ifndef HAS_UNIFORM_u_`+ye+`
|
|
`+pe+" "+_e+" "+ye+" = unpack_mix_"+ke+"(a_"+ye+", u_"+ye+`_t);
|
|
#else
|
|
`+pe+" "+_e+" "+ye+" = u_"+ye+`;
|
|
#endif
|
|
`}),staticAttributes:g,staticUniforms:C}}var fu=Object.freeze({__proto__:null,prelude:El,background:Ju,backgroundPattern:Rf,circle:Qh,clippingMask:Mf,heatmap:ph,heatmapTexture:dh,collisionBox:vh,collisionCircle:Jh,debug:ep,fill:Zp,fillOutline:Jc,fillOutlinePattern:Pu,fillPattern:tp,fillExtrusion:Ho,fillExtrusionPattern:Yl,hillshadePrepare:Sl,hillshade:$s,line:Al,lineGradient:oi,linePattern:el,lineSDF:Ds,raster:Ou,symbolIcon:tl,symbolSDF:rp,symbolTextAndIcon:ta}),Du=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function mh(h){for(var d=[],p=0;p<h.length;p++)if(h[p]!==null){var g=h[p].split(" ");d.push(g.pop())}return d}Du.prototype.bind=function(h,d,p,g,S,w,C,P){this.context=h;for(var Z=this.boundPaintVertexBuffers.length!==g.length,Y=0;!Z&&Y<g.length;Y++)this.boundPaintVertexBuffers[Y]!==g[Y]&&(Z=!0);h.extVertexArrayObject&&this.vao&&this.boundProgram===d&&this.boundLayoutVertexBuffer===p&&!Z&&this.boundIndexBuffer===S&&this.boundVertexOffset===w&&this.boundDynamicVertexBuffer===C&&this.boundDynamicVertexBuffer2===P?(h.bindVertexArrayOES.set(this.vao),C&&C.bind(),S&&S.dynamicDraw&&S.bind(),P&&P.bind()):this.freshBind(d,p,g,S,w,C,P)},Du.prototype.freshBind=function(h,d,p,g,S,w,C){var P,Z=h.numAttributes,Y=this.context,pe=Y.gl;if(Y.extVertexArrayObject)this.vao&&this.destroy(),this.vao=Y.extVertexArrayObject.createVertexArrayOES(),Y.bindVertexArrayOES.set(this.vao),P=0,this.boundProgram=h,this.boundLayoutVertexBuffer=d,this.boundPaintVertexBuffers=p,this.boundIndexBuffer=g,this.boundVertexOffset=S,this.boundDynamicVertexBuffer=w,this.boundDynamicVertexBuffer2=C;else{P=Y.currentNumAttributes||0;for(var _e=Z;_e<P;_e++)pe.disableVertexAttribArray(_e)}d.enableAttributes(pe,h);for(var ye=0,Ue=p;ye<Ue.length;ye+=1)Ue[ye].enableAttributes(pe,h);w&&w.enableAttributes(pe,h),C&&C.enableAttributes(pe,h),d.bind(),d.setVertexAttribPointers(pe,h,S);for(var ke=0,Ke=p;ke<Ke.length;ke+=1){var Ie=Ke[ke];Ie.bind(),Ie.setVertexAttribPointers(pe,h,S)}w&&(w.bind(),w.setVertexAttribPointers(pe,h,S)),g&&g.bind(),C&&(C.bind(),C.setVertexAttribPointers(pe,h,S)),Y.currentNumAttributes=Z},Du.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var Ha=function(h,d,p,g,S,w){var C=h.gl;this.program=C.createProgram();for(var P=mh(p.staticAttributes),Z=g?g.getBinderAttributes():[],Y=P.concat(Z),pe=p.staticUniforms?mh(p.staticUniforms):[],_e=g?g.getBinderUniforms():[],ye=[],Ue=0,ke=pe.concat(_e);Ue<ke.length;Ue+=1){var Ke=ke[Ue];ye.indexOf(Ke)<0&&ye.push(Ke)}var Ie=g?g.defines():[];w&&Ie.push("#define OVERDRAW_INSPECTOR;");var $e=Ie.concat(El.fragmentSource,p.fragmentSource).join(`
|
|
`),vt=Ie.concat(El.vertexSource,p.vertexSource).join(`
|
|
`),Rt=C.createShader(C.FRAGMENT_SHADER);if(C.isContextLost())this.failedToCreate=!0;else{C.shaderSource(Rt,$e),C.compileShader(Rt),C.attachShader(this.program,Rt);var Jt=C.createShader(C.VERTEX_SHADER);if(C.isContextLost())this.failedToCreate=!0;else{C.shaderSource(Jt,vt),C.compileShader(Jt),C.attachShader(this.program,Jt),this.attributes={};var zt={};this.numAttributes=Y.length;for(var ar=0;ar<this.numAttributes;ar++)Y[ar]&&(C.bindAttribLocation(this.program,ar,Y[ar]),this.attributes[Y[ar]]=ar);C.linkProgram(this.program),C.deleteShader(Jt),C.deleteShader(Rt);for(var _r=0;_r<ye.length;_r++){var Nr=ye[_r];if(Nr&&!zt[Nr]){var kr=C.getUniformLocation(this.program,Nr);kr&&(zt[Nr]=kr)}}this.fixedUniforms=S(h,zt),this.binderUniforms=g?g.getUniforms(h,zt):[]}}};function ef(h,d,p){var g=1/ha(p,1,d.transform.tileZoom),S=Math.pow(2,p.tileID.overscaledZ),w=p.tileSize*Math.pow(2,d.transform.tileZoom)/S,C=w*(p.tileID.canonical.x+p.tileID.wrap*S),P=w*p.tileID.canonical.y;return{u_image:0,u_texsize:p.imageAtlasTexture.size,u_scale:[g,h.fromScale,h.toScale],u_fade:h.t,u_pixel_coord_upper:[C>>16,P>>16],u_pixel_coord_lower:[65535&C,65535&P]}}Ha.prototype.draw=function(h,d,p,g,S,w,C,P,Z,Y,pe,_e,ye,Ue,ke,Ke){var Ie,$e=h.gl;if(!this.failedToCreate){for(var vt in h.program.set(this.program),h.setDepthMode(p),h.setStencilMode(g),h.setColorMode(S),h.setCullFace(w),this.fixedUniforms)this.fixedUniforms[vt].set(C[vt]);Ue&&Ue.setUniforms(h,this.binderUniforms,_e,{zoom:ye});for(var Rt=(Ie={},Ie[$e.LINES]=2,Ie[$e.TRIANGLES]=3,Ie[$e.LINE_STRIP]=1,Ie)[d],Jt=0,zt=pe.get();Jt<zt.length;Jt+=1){var ar=zt[Jt],_r=ar.vaos||(ar.vaos={});(_r[P]||(_r[P]=new Du)).bind(h,this,Z,Ue?Ue.getPaintVertexBuffers():[],Y,ar.vertexOffset,ke,Ke),$e.drawElements(d,ar.primitiveLength*Rt,$e.UNSIGNED_SHORT,ar.primitiveOffset*Rt*2)}}};var Vp=function(h,d,p,g){var S=d.style.light,w=S.properties.get("position"),C=[w.x,w.y,w.z],P=_.create$1();S.properties.get("anchor")==="viewport"&&_.fromRotation(P,-d.transform.angle),_.transformMat3(C,C,P);var Z=S.properties.get("color");return{u_matrix:h,u_lightpos:C,u_lightintensity:S.properties.get("intensity"),u_lightcolor:[Z.r,Z.g,Z.b],u_vertical_gradient:+p,u_opacity:g}},xs=function(h,d,p,g,S,w,C){return _.extend(Vp(h,d,p,g),ef(w,d,C),{u_height_factor:-Math.pow(2,S.overscaledZ)/C.tileSize/8})},Fu=function(h){return{u_matrix:h}},ku=function(h,d,p,g){return _.extend(Fu(h),ef(p,d,g))},ql=function(h,d){return{u_matrix:h,u_world:d}},If=function(h,d,p,g,S){return _.extend(ku(h,d,p,g),{u_world:S})},wa=function(h,d,p,g){var S,w,C=h.transform;if(g.paint.get("circle-pitch-alignment")==="map"){var P=ha(p,1,C.zoom);S=!0,w=[P,P]}else S=!1,w=C.pixelsToGLUnits;return{u_camera_to_center_distance:C.cameraToCenterDistance,u_scale_with_map:+(g.paint.get("circle-pitch-scale")==="map"),u_matrix:h.translatePosMatrix(d.posMatrix,p,g.paint.get("circle-translate"),g.paint.get("circle-translate-anchor")),u_pitch_with_map:+S,u_device_pixel_ratio:_.browser.devicePixelRatio,u_extrude_scale:w}},Qs=function(h,d,p){var g=ha(p,1,d.zoom),S=Math.pow(2,d.zoom-p.tileID.overscaledZ),w=p.tileID.overscaleFactor();return{u_matrix:h,u_camera_to_center_distance:d.cameraToCenterDistance,u_pixels_to_tile_units:g,u_extrude_scale:[d.pixelsToGLUnits[0]/(g*S),d.pixelsToGLUnits[1]/(g*S)],u_overscale_factor:w}},Rc=function(h,d,p){return{u_matrix:h,u_inv_matrix:d,u_camera_to_center_distance:p.cameraToCenterDistance,u_viewport_size:[p.width,p.height]}},Kl=function(h,d,p){return p===void 0&&(p=1),{u_matrix:h,u_color:d,u_overlay:0,u_overlay_scale:p}},rl=function(h){return{u_matrix:h}},gh=function(h,d,p,g){return{u_matrix:h,u_extrude_scale:ha(d,1,p),u_intensity:g}},Ql=function(h,d,p){var g=h.transform;return{u_matrix:Jl(h,d,p),u_ratio:1/ha(d,1,g.zoom),u_device_pixel_ratio:_.browser.devicePixelRatio,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},ca=function(h,d,p,g){return _.extend(Ql(h,d,p),{u_image:0,u_image_height:g})},tf=function(h,d,p,g){var S=h.transform,w=Tl(d,S);return{u_matrix:Jl(h,d,p),u_texsize:d.imageAtlasTexture.size,u_ratio:1/ha(d,1,S.zoom),u_device_pixel_ratio:_.browser.devicePixelRatio,u_image:0,u_scale:[w,g.fromScale,g.toScale],u_fade:g.t,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]]}},np=function(h,d,p,g,S){var w=h.lineAtlas,C=Tl(d,h.transform),P=p.layout.get("line-cap")==="round",Z=w.getDash(g.from,P),Y=w.getDash(g.to,P),pe=Z.width*S.fromScale,_e=Y.width*S.toScale;return _.extend(Ql(h,d,p),{u_patternscale_a:[C/pe,-Z.height/2],u_patternscale_b:[C/_e,-Y.height/2],u_sdfgamma:w.width/(256*Math.min(pe,_e)*_.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:Z.y,u_tex_y_b:Y.y,u_mix:S.t})};function Tl(h,d){return 1/ha(h,1,d.tileZoom)}function Jl(h,d,p){return h.translatePosMatrix(d.tileID.posMatrix,d,p.paint.get("line-translate"),p.paint.get("line-translate-anchor"))}var _h=function(h,d,p,g,S){return{u_matrix:h,u_tl_parent:d,u_scale_parent:p,u_buffer_scale:1,u_fade_t:g.mix,u_opacity:g.opacity*S.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:S.paint.get("raster-brightness-min"),u_brightness_high:S.paint.get("raster-brightness-max"),u_saturation_factor:(C=S.paint.get("raster-saturation"),C>0?1-1/(1.001-C):-C),u_contrast_factor:(w=S.paint.get("raster-contrast"),w>0?1/(1-w):1+w),u_spin_weights:Pf(S.paint.get("raster-hue-rotate"))};var w,C};function Pf(h){h*=Math.PI/180;var d=Math.sin(h),p=Math.cos(h);return[(2*p+1)/3,(-Math.sqrt(3)*d-p+1)/3,(Math.sqrt(3)*d-p+1)/3]}var wl,hu=function(h,d,p,g,S,w,C,P,Z,Y){var pe=S.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:d?d.uSizeT:0,u_size:d?d.uSize:0,u_camera_to_center_distance:pe.cameraToCenterDistance,u_pitch:pe.pitch/360*2*Math.PI,u_rotate_symbol:+p,u_aspect_ratio:pe.width/pe.height,u_fade_change:S.options.fadeDuration?S.symbolFadeChange:1,u_matrix:w,u_label_plane_matrix:C,u_coord_matrix:P,u_is_text:+Z,u_pitch_with_map:+g,u_texsize:Y,u_texture:0}},Mc=function(h,d,p,g,S,w,C,P,Z,Y,pe){var _e=S.transform;return _.extend(hu(h,d,p,g,S,w,C,P,Z,Y),{u_gamma_scale:g?Math.cos(_e._pitch)*_e.cameraToCenterDistance:1,u_device_pixel_ratio:_.browser.devicePixelRatio,u_is_halo:+pe})},rf=function(h,d,p,g,S,w,C,P,Z,Y){return _.extend(Mc(h,d,p,g,S,w,C,P,!0,Z,!0),{u_texsize_icon:Y,u_texture_icon:1})},ec=function(h,d,p){return{u_matrix:h,u_opacity:d,u_color:p}},tc=function(h,d,p,g,S,w){return _.extend(function(C,P,Z,Y){var pe=Z.imageManager.getPattern(C.from.toString()),_e=Z.imageManager.getPattern(C.to.toString()),ye=Z.imageManager.getPixelSize(),Ue=ye.width,ke=ye.height,Ke=Math.pow(2,Y.tileID.overscaledZ),Ie=Y.tileSize*Math.pow(2,Z.transform.tileZoom)/Ke,$e=Ie*(Y.tileID.canonical.x+Y.tileID.wrap*Ke),vt=Ie*Y.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:pe.tl,u_pattern_br_a:pe.br,u_pattern_tl_b:_e.tl,u_pattern_br_b:_e.br,u_texsize:[Ue,ke],u_mix:P.t,u_pattern_size_a:pe.displaySize,u_pattern_size_b:_e.displaySize,u_scale_a:P.fromScale,u_scale_b:P.toScale,u_tile_units_to_pixels:1/ha(Y,1,Z.transform.tileZoom),u_pixel_coord_upper:[$e>>16,vt>>16],u_pixel_coord_lower:[65535&$e,65535&vt]}}(g,w,p,S),{u_matrix:h,u_opacity:d})},ip={fillExtrusion:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_lightpos:new _.Uniform3f(h,d.u_lightpos),u_lightintensity:new _.Uniform1f(h,d.u_lightintensity),u_lightcolor:new _.Uniform3f(h,d.u_lightcolor),u_vertical_gradient:new _.Uniform1f(h,d.u_vertical_gradient),u_opacity:new _.Uniform1f(h,d.u_opacity)}},fillExtrusionPattern:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_lightpos:new _.Uniform3f(h,d.u_lightpos),u_lightintensity:new _.Uniform1f(h,d.u_lightintensity),u_lightcolor:new _.Uniform3f(h,d.u_lightcolor),u_vertical_gradient:new _.Uniform1f(h,d.u_vertical_gradient),u_height_factor:new _.Uniform1f(h,d.u_height_factor),u_image:new _.Uniform1i(h,d.u_image),u_texsize:new _.Uniform2f(h,d.u_texsize),u_pixel_coord_upper:new _.Uniform2f(h,d.u_pixel_coord_upper),u_pixel_coord_lower:new _.Uniform2f(h,d.u_pixel_coord_lower),u_scale:new _.Uniform3f(h,d.u_scale),u_fade:new _.Uniform1f(h,d.u_fade),u_opacity:new _.Uniform1f(h,d.u_opacity)}},fill:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix)}},fillPattern:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_image:new _.Uniform1i(h,d.u_image),u_texsize:new _.Uniform2f(h,d.u_texsize),u_pixel_coord_upper:new _.Uniform2f(h,d.u_pixel_coord_upper),u_pixel_coord_lower:new _.Uniform2f(h,d.u_pixel_coord_lower),u_scale:new _.Uniform3f(h,d.u_scale),u_fade:new _.Uniform1f(h,d.u_fade)}},fillOutline:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_world:new _.Uniform2f(h,d.u_world)}},fillOutlinePattern:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_world:new _.Uniform2f(h,d.u_world),u_image:new _.Uniform1i(h,d.u_image),u_texsize:new _.Uniform2f(h,d.u_texsize),u_pixel_coord_upper:new _.Uniform2f(h,d.u_pixel_coord_upper),u_pixel_coord_lower:new _.Uniform2f(h,d.u_pixel_coord_lower),u_scale:new _.Uniform3f(h,d.u_scale),u_fade:new _.Uniform1f(h,d.u_fade)}},circle:function(h,d){return{u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_scale_with_map:new _.Uniform1i(h,d.u_scale_with_map),u_pitch_with_map:new _.Uniform1i(h,d.u_pitch_with_map),u_extrude_scale:new _.Uniform2f(h,d.u_extrude_scale),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_matrix:new _.UniformMatrix4f(h,d.u_matrix)}},collisionBox:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_pixels_to_tile_units:new _.Uniform1f(h,d.u_pixels_to_tile_units),u_extrude_scale:new _.Uniform2f(h,d.u_extrude_scale),u_overscale_factor:new _.Uniform1f(h,d.u_overscale_factor)}},collisionCircle:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_inv_matrix:new _.UniformMatrix4f(h,d.u_inv_matrix),u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_viewport_size:new _.Uniform2f(h,d.u_viewport_size)}},debug:function(h,d){return{u_color:new _.UniformColor(h,d.u_color),u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_overlay:new _.Uniform1i(h,d.u_overlay),u_overlay_scale:new _.Uniform1f(h,d.u_overlay_scale)}},clippingMask:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix)}},heatmap:function(h,d){return{u_extrude_scale:new _.Uniform1f(h,d.u_extrude_scale),u_intensity:new _.Uniform1f(h,d.u_intensity),u_matrix:new _.UniformMatrix4f(h,d.u_matrix)}},heatmapTexture:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_world:new _.Uniform2f(h,d.u_world),u_image:new _.Uniform1i(h,d.u_image),u_color_ramp:new _.Uniform1i(h,d.u_color_ramp),u_opacity:new _.Uniform1f(h,d.u_opacity)}},hillshade:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_image:new _.Uniform1i(h,d.u_image),u_latrange:new _.Uniform2f(h,d.u_latrange),u_light:new _.Uniform2f(h,d.u_light),u_shadow:new _.UniformColor(h,d.u_shadow),u_highlight:new _.UniformColor(h,d.u_highlight),u_accent:new _.UniformColor(h,d.u_accent)}},hillshadePrepare:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_image:new _.Uniform1i(h,d.u_image),u_dimension:new _.Uniform2f(h,d.u_dimension),u_zoom:new _.Uniform1f(h,d.u_zoom),u_unpack:new _.Uniform4f(h,d.u_unpack)}},line:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_ratio:new _.Uniform1f(h,d.u_ratio),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_units_to_pixels:new _.Uniform2f(h,d.u_units_to_pixels)}},lineGradient:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_ratio:new _.Uniform1f(h,d.u_ratio),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_units_to_pixels:new _.Uniform2f(h,d.u_units_to_pixels),u_image:new _.Uniform1i(h,d.u_image),u_image_height:new _.Uniform1f(h,d.u_image_height)}},linePattern:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_texsize:new _.Uniform2f(h,d.u_texsize),u_ratio:new _.Uniform1f(h,d.u_ratio),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_image:new _.Uniform1i(h,d.u_image),u_units_to_pixels:new _.Uniform2f(h,d.u_units_to_pixels),u_scale:new _.Uniform3f(h,d.u_scale),u_fade:new _.Uniform1f(h,d.u_fade)}},lineSDF:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_ratio:new _.Uniform1f(h,d.u_ratio),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_units_to_pixels:new _.Uniform2f(h,d.u_units_to_pixels),u_patternscale_a:new _.Uniform2f(h,d.u_patternscale_a),u_patternscale_b:new _.Uniform2f(h,d.u_patternscale_b),u_sdfgamma:new _.Uniform1f(h,d.u_sdfgamma),u_image:new _.Uniform1i(h,d.u_image),u_tex_y_a:new _.Uniform1f(h,d.u_tex_y_a),u_tex_y_b:new _.Uniform1f(h,d.u_tex_y_b),u_mix:new _.Uniform1f(h,d.u_mix)}},raster:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_tl_parent:new _.Uniform2f(h,d.u_tl_parent),u_scale_parent:new _.Uniform1f(h,d.u_scale_parent),u_buffer_scale:new _.Uniform1f(h,d.u_buffer_scale),u_fade_t:new _.Uniform1f(h,d.u_fade_t),u_opacity:new _.Uniform1f(h,d.u_opacity),u_image0:new _.Uniform1i(h,d.u_image0),u_image1:new _.Uniform1i(h,d.u_image1),u_brightness_low:new _.Uniform1f(h,d.u_brightness_low),u_brightness_high:new _.Uniform1f(h,d.u_brightness_high),u_saturation_factor:new _.Uniform1f(h,d.u_saturation_factor),u_contrast_factor:new _.Uniform1f(h,d.u_contrast_factor),u_spin_weights:new _.Uniform3f(h,d.u_spin_weights)}},symbolIcon:function(h,d){return{u_is_size_zoom_constant:new _.Uniform1i(h,d.u_is_size_zoom_constant),u_is_size_feature_constant:new _.Uniform1i(h,d.u_is_size_feature_constant),u_size_t:new _.Uniform1f(h,d.u_size_t),u_size:new _.Uniform1f(h,d.u_size),u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_pitch:new _.Uniform1f(h,d.u_pitch),u_rotate_symbol:new _.Uniform1i(h,d.u_rotate_symbol),u_aspect_ratio:new _.Uniform1f(h,d.u_aspect_ratio),u_fade_change:new _.Uniform1f(h,d.u_fade_change),u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_label_plane_matrix:new _.UniformMatrix4f(h,d.u_label_plane_matrix),u_coord_matrix:new _.UniformMatrix4f(h,d.u_coord_matrix),u_is_text:new _.Uniform1i(h,d.u_is_text),u_pitch_with_map:new _.Uniform1i(h,d.u_pitch_with_map),u_texsize:new _.Uniform2f(h,d.u_texsize),u_texture:new _.Uniform1i(h,d.u_texture)}},symbolSDF:function(h,d){return{u_is_size_zoom_constant:new _.Uniform1i(h,d.u_is_size_zoom_constant),u_is_size_feature_constant:new _.Uniform1i(h,d.u_is_size_feature_constant),u_size_t:new _.Uniform1f(h,d.u_size_t),u_size:new _.Uniform1f(h,d.u_size),u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_pitch:new _.Uniform1f(h,d.u_pitch),u_rotate_symbol:new _.Uniform1i(h,d.u_rotate_symbol),u_aspect_ratio:new _.Uniform1f(h,d.u_aspect_ratio),u_fade_change:new _.Uniform1f(h,d.u_fade_change),u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_label_plane_matrix:new _.UniformMatrix4f(h,d.u_label_plane_matrix),u_coord_matrix:new _.UniformMatrix4f(h,d.u_coord_matrix),u_is_text:new _.Uniform1i(h,d.u_is_text),u_pitch_with_map:new _.Uniform1i(h,d.u_pitch_with_map),u_texsize:new _.Uniform2f(h,d.u_texsize),u_texture:new _.Uniform1i(h,d.u_texture),u_gamma_scale:new _.Uniform1f(h,d.u_gamma_scale),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_is_halo:new _.Uniform1i(h,d.u_is_halo)}},symbolTextAndIcon:function(h,d){return{u_is_size_zoom_constant:new _.Uniform1i(h,d.u_is_size_zoom_constant),u_is_size_feature_constant:new _.Uniform1i(h,d.u_is_size_feature_constant),u_size_t:new _.Uniform1f(h,d.u_size_t),u_size:new _.Uniform1f(h,d.u_size),u_camera_to_center_distance:new _.Uniform1f(h,d.u_camera_to_center_distance),u_pitch:new _.Uniform1f(h,d.u_pitch),u_rotate_symbol:new _.Uniform1i(h,d.u_rotate_symbol),u_aspect_ratio:new _.Uniform1f(h,d.u_aspect_ratio),u_fade_change:new _.Uniform1f(h,d.u_fade_change),u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_label_plane_matrix:new _.UniformMatrix4f(h,d.u_label_plane_matrix),u_coord_matrix:new _.UniformMatrix4f(h,d.u_coord_matrix),u_is_text:new _.Uniform1i(h,d.u_is_text),u_pitch_with_map:new _.Uniform1i(h,d.u_pitch_with_map),u_texsize:new _.Uniform2f(h,d.u_texsize),u_texsize_icon:new _.Uniform2f(h,d.u_texsize_icon),u_texture:new _.Uniform1i(h,d.u_texture),u_texture_icon:new _.Uniform1i(h,d.u_texture_icon),u_gamma_scale:new _.Uniform1f(h,d.u_gamma_scale),u_device_pixel_ratio:new _.Uniform1f(h,d.u_device_pixel_ratio),u_is_halo:new _.Uniform1i(h,d.u_is_halo)}},background:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_opacity:new _.Uniform1f(h,d.u_opacity),u_color:new _.UniformColor(h,d.u_color)}},backgroundPattern:function(h,d){return{u_matrix:new _.UniformMatrix4f(h,d.u_matrix),u_opacity:new _.Uniform1f(h,d.u_opacity),u_image:new _.Uniform1i(h,d.u_image),u_pattern_tl_a:new _.Uniform2f(h,d.u_pattern_tl_a),u_pattern_br_a:new _.Uniform2f(h,d.u_pattern_br_a),u_pattern_tl_b:new _.Uniform2f(h,d.u_pattern_tl_b),u_pattern_br_b:new _.Uniform2f(h,d.u_pattern_br_b),u_texsize:new _.Uniform2f(h,d.u_texsize),u_mix:new _.Uniform1f(h,d.u_mix),u_pattern_size_a:new _.Uniform2f(h,d.u_pattern_size_a),u_pattern_size_b:new _.Uniform2f(h,d.u_pattern_size_b),u_scale_a:new _.Uniform1f(h,d.u_scale_a),u_scale_b:new _.Uniform1f(h,d.u_scale_b),u_pixel_coord_upper:new _.Uniform2f(h,d.u_pixel_coord_upper),u_pixel_coord_lower:new _.Uniform2f(h,d.u_pixel_coord_lower),u_tile_units_to_pixels:new _.Uniform1f(h,d.u_tile_units_to_pixels)}}};function nl(h,d,p,g,S,w,C){for(var P=h.context,Z=P.gl,Y=h.useProgram("collisionBox"),pe=[],_e=0,ye=0,Ue=0;Ue<g.length;Ue++){var ke=g[Ue],Ke=d.getTile(ke),Ie=Ke.getBucket(p);if(Ie){var $e=ke.posMatrix;S[0]===0&&S[1]===0||($e=h.translatePosMatrix(ke.posMatrix,Ke,S,w));var vt=C?Ie.textCollisionBox:Ie.iconCollisionBox,Rt=Ie.collisionCircleArray;if(Rt.length>0){var Jt=_.create(),zt=$e;_.mul(Jt,Ie.placementInvProjMatrix,h.transform.glCoordMatrix),_.mul(Jt,Jt,Ie.placementViewportMatrix),pe.push({circleArray:Rt,circleOffset:ye,transform:zt,invTransform:Jt}),ye=_e+=Rt.length/4}vt&&Y.draw(P,Z.LINES,be.disabled,Oe.disabled,h.colorModeForRenderPass(),pt.disabled,Qs($e,h.transform,Ke),p.id,vt.layoutVertexBuffer,vt.indexBuffer,vt.segments,null,h.transform.zoom,null,null,vt.collisionVertexBuffer)}}if(C&&pe.length){var ar=h.useProgram("collisionCircle"),_r=new _.StructArrayLayout2f1f2i16;_r.resize(4*_e),_r._trim();for(var Nr=0,kr=0,un=pe;kr<un.length;kr+=1)for(var Pn=un[kr],zn=0;zn<Pn.circleArray.length/4;zn++){var Zn=4*zn,Wi=Pn.circleArray[Zn+0],vn=Pn.circleArray[Zn+1],ei=Pn.circleArray[Zn+2],_i=Pn.circleArray[Zn+3];_r.emplace(Nr++,Wi,vn,ei,_i,0),_r.emplace(Nr++,Wi,vn,ei,_i,1),_r.emplace(Nr++,Wi,vn,ei,_i,2),_r.emplace(Nr++,Wi,vn,ei,_i,3)}(!wl||wl.length<2*_e)&&(wl=function(Ua){var Ro=2*Ua,Lo=new _.StructArrayLayout3ui6;Lo.resize(Ro),Lo._trim();for(var Ga=0;Ga<Ro;Ga++){var Xa=6*Ga;Lo.uint16[Xa+0]=4*Ga+0,Lo.uint16[Xa+1]=4*Ga+1,Lo.uint16[Xa+2]=4*Ga+2,Lo.uint16[Xa+3]=4*Ga+2,Lo.uint16[Xa+4]=4*Ga+3,Lo.uint16[Xa+5]=4*Ga+0}return Lo}(_e));for(var ri=P.createIndexBuffer(wl,!0),qn=P.createVertexBuffer(_r,_.collisionCircleLayout.members,!0),di=0,Jn=pe;di<Jn.length;di+=1){var Kn=Jn[di],Co=Rc(Kn.transform,Kn.invTransform,h.transform);ar.draw(P,Z.TRIANGLES,be.disabled,Oe.disabled,h.colorModeForRenderPass(),pt.disabled,Co,p.id,qn,ri,_.SegmentVector.simpleSegment(0,2*Kn.circleOffset,Kn.circleArray.length,Kn.circleArray.length/2),null,h.transform.zoom,null,null,null)}qn.destroy(),ri.destroy()}}var Js=_.identity(new Float32Array(16));function nf(h,d,p,g,S,w){var C=_.getAnchorAlignment(h),P=-(C.horizontalAlign-.5)*d,Z=-(C.verticalAlign-.5)*p,Y=_.evaluateVariableOffset(h,g);return new _.Point((P/S+Y[0])*w,(Z/S+Y[1])*w)}function Ic(h,d,p,g,S,w,C,P,Z,Y,pe){var _e=h.text.placedSymbolArray,ye=h.text.dynamicLayoutVertexArray,Ue=h.icon.dynamicLayoutVertexArray,ke={};ye.clear();for(var Ke=0;Ke<_e.length;Ke++){var Ie=_e.get(Ke),$e=Ie.hidden||!Ie.crossTileID||h.allowVerticalPlacement&&!Ie.placedOrientation?null:g[Ie.crossTileID];if($e){var vt=new _.Point(Ie.anchorX,Ie.anchorY),Rt=mi(vt,p?P:C),Jt=wi(w.cameraToCenterDistance,Rt.signedDistanceFromCamera),zt=S.evaluateSizeForFeature(h.textSizeData,Y,Ie)*Jt/_.ONE_EM;p&&(zt*=h.tilePixelRatio/Z);for(var ar=nf($e.anchor,$e.width,$e.height,$e.textOffset,$e.textBoxScale,zt),_r=p?mi(vt.add(ar),C).point:Rt.point.add(d?ar.rotate(-w.angle):ar),Nr=h.allowVerticalPlacement&&Ie.placedOrientation===_.WritingMode.vertical?Math.PI/2:0,kr=0;kr<Ie.numGlyphs;kr++)_.addDynamicAttributes(ye,_r,Nr);pe&&Ie.associatedIconIndex>=0&&(ke[Ie.associatedIconIndex]={shiftedAnchor:_r,angle:Nr})}else Oa(Ie.numGlyphs,ye)}if(pe){Ue.clear();for(var un=h.icon.placedSymbolArray,Pn=0;Pn<un.length;Pn++){var zn=un.get(Pn);if(zn.hidden)Oa(zn.numGlyphs,Ue);else{var Zn=ke[Pn];if(Zn)for(var Wi=0;Wi<zn.numGlyphs;Wi++)_.addDynamicAttributes(Ue,Zn.shiftedAnchor,Zn.angle);else Oa(zn.numGlyphs,Ue)}}h.icon.dynamicLayoutVertexBuffer.updateData(Ue)}h.text.dynamicLayoutVertexBuffer.updateData(ye)}function yh(h,d,p){return p.iconsInText&&d?"symbolTextAndIcon":h?"symbolSDF":"symbolIcon"}function Cl(h,d,p,g,S,w,C,P,Z,Y,pe,_e){for(var ye=h.context,Ue=ye.gl,ke=h.transform,Ke=P==="map",Ie=Z==="map",$e=Ke&&p.layout.get("symbol-placement")!=="point",vt=Ke&&!Ie&&!$e,Rt=p.layout.get("symbol-sort-key").constantOr(1)!==void 0,Jt=!1,zt=h.depthModeForSublayer(0,be.ReadOnly),ar=p.layout.get("text-variable-anchor"),_r=[],Nr=0,kr=g;Nr<kr.length;Nr+=1){var un=kr[Nr],Pn=d.getTile(un),zn=Pn.getBucket(p);if(zn){var Zn=S?zn.text:zn.icon;if(Zn&&Zn.segments.get().length){var Wi=Zn.programConfigurations.get(p.id),vn=S||zn.sdfIcons,ei=S?zn.textSizeData:zn.iconSizeData,_i=Ie||ke.pitch!==0,ri=h.useProgram(yh(vn,S,zn),Wi),qn=_.evaluateSizeForZoom(ei,ke.zoom),di=void 0,Jn=[0,0],Kn=void 0,Co=void 0,Ua=null,Ro=void 0;if(S)Kn=Pn.glyphAtlasTexture,Co=Ue.LINEAR,di=Pn.glyphAtlasTexture.size,zn.iconsInText&&(Jn=Pn.imageAtlasTexture.size,Ua=Pn.imageAtlasTexture,Ro=_i||h.options.rotating||h.options.zooming||ei.kind==="composite"||ei.kind==="camera"?Ue.LINEAR:Ue.NEAREST);else{var Lo=p.layout.get("icon-size").constantOr(0)!==1||zn.iconsNeedLinear;Kn=Pn.imageAtlasTexture,Co=vn||h.options.rotating||h.options.zooming||Lo||_i?Ue.LINEAR:Ue.NEAREST,di=Pn.imageAtlasTexture.size}var Ga=ha(Pn,1,h.transform.zoom),Xa=Ia(un.posMatrix,Ie,Ke,h.transform,Ga),Ss=Ti(un.posMatrix,Ie,Ke,h.transform,Ga),ls=ar&&zn.hasTextData(),Zu=p.layout.get("icon-text-fit")!=="none"&&ls&&zn.hasIconData();$e&&cu(zn,un.posMatrix,h,S,Xa,Ss,Ie,Y);var cs=h.translatePosMatrix(un.posMatrix,Pn,w,C),nu=$e||S&&ar||Zu?Js:Xa,Us=h.translatePosMatrix(Ss,Pn,w,C,!0),sl=vn&&p.paint.get(S?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Fl={program:ri,buffers:Zn,uniformValues:vn?zn.iconsInText?rf(ei.kind,qn,vt,Ie,h,cs,nu,Us,di,Jn):Mc(ei.kind,qn,vt,Ie,h,cs,nu,Us,S,di,!0):hu(ei.kind,qn,vt,Ie,h,cs,nu,Us,S,di),atlasTexture:Kn,atlasTextureIcon:Ua,atlasInterpolation:Co,atlasInterpolationIcon:Ro,isSDF:vn,hasHalo:sl};if(Rt&&zn.canOverlap){Jt=!0;for(var ul=0,kl=Zn.segments.get();ul<kl.length;ul+=1){var Vu=kl[ul];_r.push({segments:new _.SegmentVector([Vu]),sortKey:Vu.sortKey,state:Fl})}}else _r.push({segments:Zn.segments,sortKey:0,state:Fl})}}}Jt&&_r.sort(function(au,Hu){return au.sortKey-Hu.sortKey});for(var iu=0,ju=_r;iu<ju.length;iu+=1){var Ko=ju[iu],Qa=Ko.state;if(ye.activeTexture.set(Ue.TEXTURE0),Qa.atlasTexture.bind(Qa.atlasInterpolation,Ue.CLAMP_TO_EDGE),Qa.atlasTextureIcon&&(ye.activeTexture.set(Ue.TEXTURE1),Qa.atlasTextureIcon&&Qa.atlasTextureIcon.bind(Qa.atlasInterpolationIcon,Ue.CLAMP_TO_EDGE)),Qa.isSDF){var As=Qa.uniformValues;Qa.hasHalo&&(As.u_is_halo=1,pu(Qa.buffers,Ko.segments,p,h,Qa.program,zt,pe,_e,As)),As.u_is_halo=0}pu(Qa.buffers,Ko.segments,p,h,Qa.program,zt,pe,_e,Qa.uniformValues)}}function pu(h,d,p,g,S,w,C,P,Z){var Y=g.context;S.draw(Y,Y.gl.TRIANGLES,w,C,P,pt.disabled,Z,p.id,h.layoutVertexBuffer,h.indexBuffer,d,p.paint,g.transform.zoom,h.programConfigurations.get(p.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function af(h,d,p,g,S,w,C){var P,Z,Y,pe,_e,ye=h.context.gl,Ue=p.paint.get("fill-pattern"),ke=Ue&&Ue.constantOr(1),Ke=p.getCrossfadeParameters();C?(Z=ke&&!p.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",P=ye.LINES):(Z=ke?"fillPattern":"fill",P=ye.TRIANGLES);for(var Ie=0,$e=g;Ie<$e.length;Ie+=1){var vt=$e[Ie],Rt=d.getTile(vt);if(!ke||Rt.patternsLoaded()){var Jt=Rt.getBucket(p);if(Jt){var zt=Jt.programConfigurations.get(p.id),ar=h.useProgram(Z,zt);ke&&(h.context.activeTexture.set(ye.TEXTURE0),Rt.imageAtlasTexture.bind(ye.LINEAR,ye.CLAMP_TO_EDGE),zt.updatePaintBuffers(Ke));var _r=Ue.constantOr(null);if(_r&&Rt.imageAtlas){var Nr=Rt.imageAtlas,kr=Nr.patternPositions[_r.to.toString()],un=Nr.patternPositions[_r.from.toString()];kr&&un&&zt.setConstantPatternPositions(kr,un)}var Pn=h.translatePosMatrix(vt.posMatrix,Rt,p.paint.get("fill-translate"),p.paint.get("fill-translate-anchor"));if(C){pe=Jt.indexBuffer2,_e=Jt.segments2;var zn=[ye.drawingBufferWidth,ye.drawingBufferHeight];Y=Z==="fillOutlinePattern"&&ke?If(Pn,h,Ke,Rt,zn):ql(Pn,zn)}else pe=Jt.indexBuffer,_e=Jt.segments,Y=ke?ku(Pn,h,Ke,Rt):Fu(Pn);ar.draw(h.context,P,S,h.stencilModeForClipping(vt),w,pt.disabled,Y,p.id,Jt.layoutVertexBuffer,pe,_e,p.paint,h.transform.zoom,zt)}}}}function Pc(h,d,p,g,S,w,C){for(var P=h.context,Z=P.gl,Y=p.paint.get("fill-extrusion-pattern"),pe=Y.constantOr(1),_e=p.getCrossfadeParameters(),ye=p.paint.get("fill-extrusion-opacity"),Ue=0,ke=g;Ue<ke.length;Ue+=1){var Ke=ke[Ue],Ie=d.getTile(Ke),$e=Ie.getBucket(p);if($e){var vt=$e.programConfigurations.get(p.id),Rt=h.useProgram(pe?"fillExtrusionPattern":"fillExtrusion",vt);pe&&(h.context.activeTexture.set(Z.TEXTURE0),Ie.imageAtlasTexture.bind(Z.LINEAR,Z.CLAMP_TO_EDGE),vt.updatePaintBuffers(_e));var Jt=Y.constantOr(null);if(Jt&&Ie.imageAtlas){var zt=Ie.imageAtlas,ar=zt.patternPositions[Jt.to.toString()],_r=zt.patternPositions[Jt.from.toString()];ar&&_r&&vt.setConstantPatternPositions(ar,_r)}var Nr=h.translatePosMatrix(Ke.posMatrix,Ie,p.paint.get("fill-extrusion-translate"),p.paint.get("fill-extrusion-translate-anchor")),kr=p.paint.get("fill-extrusion-vertical-gradient"),un=pe?xs(Nr,h,kr,ye,Ke,_e,Ie):Vp(Nr,h,kr,ye);Rt.draw(P,P.gl.TRIANGLES,S,w,C,pt.backCCW,un,p.id,$e.layoutVertexBuffer,$e.indexBuffer,$e.segments,p.paint,h.transform.zoom,vt)}}}function Bu(h,d,p,g,S,w){var C=h.context,P=C.gl,Z=d.fbo;if(Z){var Y=h.useProgram("hillshade");C.activeTexture.set(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,Z.colorAttachment.get());var pe=function(_e,ye,Ue){var ke=Ue.paint.get("hillshade-shadow-color"),Ke=Ue.paint.get("hillshade-highlight-color"),Ie=Ue.paint.get("hillshade-accent-color"),$e=Ue.paint.get("hillshade-illumination-direction")*(Math.PI/180);Ue.paint.get("hillshade-illumination-anchor")==="viewport"&&($e-=_e.transform.angle);var vt,Rt,Jt,zt=!_e.options.moving;return{u_matrix:_e.transform.calculatePosMatrix(ye.tileID.toUnwrapped(),zt),u_image:0,u_latrange:(vt=ye.tileID,Rt=Math.pow(2,vt.canonical.z),Jt=vt.canonical.y,[new _.MercatorCoordinate(0,Jt/Rt).toLngLat().lat,new _.MercatorCoordinate(0,(Jt+1)/Rt).toLngLat().lat]),u_light:[Ue.paint.get("hillshade-exaggeration"),$e],u_shadow:ke,u_highlight:Ke,u_accent:Ie}}(h,d,p);Y.draw(C,P.TRIANGLES,g,S,w,pt.disabled,pe,p.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}}function Md(h,d,p,g,S,w){var C=h.context,P=C.gl,Z=d.dem;if(Z&&Z.data){var Y=Z.dim,pe=Z.stride,_e=Z.getPixels();if(C.activeTexture.set(P.TEXTURE1),C.pixelStoreUnpackPremultiplyAlpha.set(!1),d.demTexture=d.demTexture||h.getTileTexture(pe),d.demTexture){var ye=d.demTexture;ye.update(_e,{premultiply:!1}),ye.bind(P.NEAREST,P.CLAMP_TO_EDGE)}else d.demTexture=new _.Texture(C,_e,P.RGBA,{premultiply:!1}),d.demTexture.bind(P.NEAREST,P.CLAMP_TO_EDGE);C.activeTexture.set(P.TEXTURE0);var Ue=d.fbo;if(!Ue){var ke=new _.Texture(C,{width:Y,height:Y,data:null},P.RGBA);ke.bind(P.LINEAR,P.CLAMP_TO_EDGE),(Ue=d.fbo=C.createFramebuffer(Y,Y,!0)).colorAttachment.set(ke.texture)}C.bindFramebuffer.set(Ue.framebuffer),C.viewport.set([0,0,Y,Y]),h.useProgram("hillshadePrepare").draw(C,P.TRIANGLES,g,S,w,pt.disabled,function(Ke,Ie){var $e=Ie.stride,vt=_.create();return _.ortho(vt,0,_.EXTENT,-_.EXTENT,0,0,1),_.translate(vt,vt,[0,-_.EXTENT,0]),{u_matrix:vt,u_image:1,u_dimension:[$e,$e],u_zoom:Ke.overscaledZ,u_unpack:Ie.getUnpackVector()}}(d.tileID,Z),p.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments),d.needsHillshadePrepare=!1}}function Of(h,d,p,g,S){var w=g.paint.get("raster-fade-duration");if(w>0){var C=_.browser.now(),P=(C-h.timeAdded)/w,Z=d?(C-d.timeAdded)/w:-1,Y=p.getSource(),pe=S.coveringZoomLevel({tileSize:Y.tileSize,roundZoom:Y.roundZoom}),_e=!d||Math.abs(d.tileID.overscaledZ-pe)>Math.abs(h.tileID.overscaledZ-pe),ye=_e&&h.refreshedUponExpiration?1:_.clamp(_e?P:1-Z,0,1);return h.refreshedUponExpiration&&P>=1&&(h.refreshedUponExpiration=!1),d?{opacity:1,mix:1-ye}:{opacity:ye,mix:0}}return{opacity:1,mix:0}}var xh=new _.Color(1,0,0,1),Df=new _.Color(0,1,0,1),Fo=new _.Color(0,0,1,1),bh=new _.Color(1,0,1,1),ap=new _.Color(0,1,1,1);function Ff(h,d,p,g){Oc(h,0,d+p/2,h.transform.width,p,g)}function Eh(h,d,p,g){Oc(h,d-p/2,0,p,h.transform.height,g)}function Oc(h,d,p,g,S,w){var C=h.context,P=C.gl;P.enable(P.SCISSOR_TEST),P.scissor(d*_.browser.devicePixelRatio,p*_.browser.devicePixelRatio,g*_.browser.devicePixelRatio,S*_.browser.devicePixelRatio),C.clear({color:w}),P.disable(P.SCISSOR_TEST)}function of(h,d,p){var g=h.context,S=g.gl,w=p.posMatrix,C=h.useProgram("debug"),P=be.disabled,Z=Oe.disabled,Y=h.colorModeForRenderPass();g.activeTexture.set(S.TEXTURE0),h.emptyTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),C.draw(g,S.LINE_STRIP,P,Z,Y,pt.disabled,Kl(w,_.Color.red),"$debug",h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments);var pe=d.getTileByID(p.key).latestRawTileData,_e=Math.floor((pe&&pe.byteLength||0)/1024),ye=d.getTile(p).tileSize,Ue=512/Math.min(ye,512)*(p.overscaledZ/h.transform.zoom)*.5,ke=p.canonical.toString();p.overscaledZ!==p.canonical.z&&(ke+=" => "+p.overscaledZ),function(Ke,Ie){Ke.initDebugOverlayCanvas();var $e=Ke.debugOverlayCanvas,vt=Ke.context.gl,Rt=Ke.debugOverlayCanvas.getContext("2d");Rt.clearRect(0,0,$e.width,$e.height),Rt.shadowColor="white",Rt.shadowBlur=2,Rt.lineWidth=1.5,Rt.strokeStyle="white",Rt.textBaseline="top",Rt.font="bold 36px Open Sans, sans-serif",Rt.fillText(Ie,5,5),Rt.strokeText(Ie,5,5),Ke.debugOverlayTexture.update($e),Ke.debugOverlayTexture.bind(vt.LINEAR,vt.CLAMP_TO_EDGE)}(h,ke+" "+_e+"kb"),C.draw(g,S.TRIANGLES,P,Z,it.alphaBlended,pt.disabled,Kl(w,_.Color.transparent,Ue),"$debug",h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments)}var il={symbol:function(h,d,p,g,S){if(h.renderPass==="translucent"){var w=Oe.disabled,C=h.colorModeForRenderPass();p.layout.get("text-variable-anchor")&&function(P,Z,Y,pe,_e,ye,Ue){for(var ke=Z.transform,Ke=_e==="map",Ie=ye==="map",$e=0,vt=P;$e<vt.length;$e+=1){var Rt=vt[$e],Jt=pe.getTile(Rt),zt=Jt.getBucket(Y);if(zt&&zt.text&&zt.text.segments.get().length){var ar=_.evaluateSizeForZoom(zt.textSizeData,ke.zoom),_r=ha(Jt,1,Z.transform.zoom),Nr=Ia(Rt.posMatrix,Ie,Ke,Z.transform,_r),kr=Y.layout.get("icon-text-fit")!=="none"&&zt.hasIconData();if(ar){var un=Math.pow(2,ke.zoom-Jt.tileID.overscaledZ);Ic(zt,Ke,Ie,Ue,_.symbolSize,ke,Nr,Rt.posMatrix,un,ar,kr)}}}}(g,h,p,d,p.layout.get("text-rotation-alignment"),p.layout.get("text-pitch-alignment"),S),p.paint.get("icon-opacity").constantOr(1)!==0&&Cl(h,d,p,g,!1,p.paint.get("icon-translate"),p.paint.get("icon-translate-anchor"),p.layout.get("icon-rotation-alignment"),p.layout.get("icon-pitch-alignment"),p.layout.get("icon-keep-upright"),w,C),p.paint.get("text-opacity").constantOr(1)!==0&&Cl(h,d,p,g,!0,p.paint.get("text-translate"),p.paint.get("text-translate-anchor"),p.layout.get("text-rotation-alignment"),p.layout.get("text-pitch-alignment"),p.layout.get("text-keep-upright"),w,C),d.map.showCollisionBoxes&&(nl(h,d,p,g,p.paint.get("text-translate"),p.paint.get("text-translate-anchor"),!0),nl(h,d,p,g,p.paint.get("icon-translate"),p.paint.get("icon-translate-anchor"),!1))}},circle:function(h,d,p,g){if(h.renderPass==="translucent"){var S=p.paint.get("circle-opacity"),w=p.paint.get("circle-stroke-width"),C=p.paint.get("circle-stroke-opacity"),P=p.layout.get("circle-sort-key").constantOr(1)!==void 0;if(S.constantOr(1)!==0||w.constantOr(1)!==0&&C.constantOr(1)!==0){for(var Z=h.context,Y=Z.gl,pe=h.depthModeForSublayer(0,be.ReadOnly),_e=Oe.disabled,ye=h.colorModeForRenderPass(),Ue=[],ke=0;ke<g.length;ke++){var Ke=g[ke],Ie=d.getTile(Ke),$e=Ie.getBucket(p);if($e){var vt=$e.programConfigurations.get(p.id),Rt={programConfiguration:vt,program:h.useProgram("circle",vt),layoutVertexBuffer:$e.layoutVertexBuffer,indexBuffer:$e.indexBuffer,uniformValues:wa(h,Ke,Ie,p)};if(P)for(var Jt=0,zt=$e.segments.get();Jt<zt.length;Jt+=1){var ar=zt[Jt];Ue.push({segments:new _.SegmentVector([ar]),sortKey:ar.sortKey,state:Rt})}else Ue.push({segments:$e.segments,sortKey:0,state:Rt})}}P&&Ue.sort(function(Pn,zn){return Pn.sortKey-zn.sortKey});for(var _r=0,Nr=Ue;_r<Nr.length;_r+=1){var kr=Nr[_r],un=kr.state;un.program.draw(Z,Y.TRIANGLES,pe,_e,ye,pt.disabled,un.uniformValues,p.id,un.layoutVertexBuffer,un.indexBuffer,kr.segments,p.paint,h.transform.zoom,un.programConfiguration)}}}},heatmap:function(h,d,p,g){if(p.paint.get("heatmap-opacity")!==0)if(h.renderPass==="offscreen"){var S=h.context,w=S.gl,C=Oe.disabled,P=new it([w.ONE,w.ONE],_.Color.transparent,[!0,!0,!0,!0]);(function(Ue,ke,Ke){var Ie=Ue.gl;Ue.activeTexture.set(Ie.TEXTURE1),Ue.viewport.set([0,0,ke.width/4,ke.height/4]);var $e=Ke.heatmapFbo;if($e)Ie.bindTexture(Ie.TEXTURE_2D,$e.colorAttachment.get()),Ue.bindFramebuffer.set($e.framebuffer);else{var vt=Ie.createTexture();Ie.bindTexture(Ie.TEXTURE_2D,vt),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_S,Ie.CLAMP_TO_EDGE),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_T,Ie.CLAMP_TO_EDGE),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MIN_FILTER,Ie.LINEAR),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MAG_FILTER,Ie.LINEAR),$e=Ke.heatmapFbo=Ue.createFramebuffer(ke.width/4,ke.height/4,!1),function(Rt,Jt,zt,ar){var _r=Rt.gl;_r.texImage2D(_r.TEXTURE_2D,0,_r.RGBA,Jt.width/4,Jt.height/4,0,_r.RGBA,Rt.extRenderToTextureHalfFloat?Rt.extTextureHalfFloat.HALF_FLOAT_OES:_r.UNSIGNED_BYTE,null),ar.colorAttachment.set(zt)}(Ue,ke,vt,$e)}})(S,h,p),S.clear({color:_.Color.transparent});for(var Z=0;Z<g.length;Z++){var Y=g[Z];if(!d.hasRenderableParent(Y)){var pe=d.getTile(Y),_e=pe.getBucket(p);if(_e){var ye=_e.programConfigurations.get(p.id);h.useProgram("heatmap",ye).draw(S,w.TRIANGLES,be.disabled,C,P,pt.disabled,gh(Y.posMatrix,pe,h.transform.zoom,p.paint.get("heatmap-intensity")),p.id,_e.layoutVertexBuffer,_e.indexBuffer,_e.segments,p.paint,h.transform.zoom,ye)}}}S.viewport.set([0,0,h.width,h.height])}else h.renderPass==="translucent"&&(h.context.setColorMode(h.colorModeForRenderPass()),function(Ue,ke){var Ke=Ue.context,Ie=Ke.gl,$e=ke.heatmapFbo;if($e){Ke.activeTexture.set(Ie.TEXTURE0),Ie.bindTexture(Ie.TEXTURE_2D,$e.colorAttachment.get()),Ke.activeTexture.set(Ie.TEXTURE1);var vt=ke.colorRampTexture;vt||(vt=ke.colorRampTexture=new _.Texture(Ke,ke.colorRamp,Ie.RGBA)),vt.bind(Ie.LINEAR,Ie.CLAMP_TO_EDGE),Ue.useProgram("heatmapTexture").draw(Ke,Ie.TRIANGLES,be.disabled,Oe.disabled,Ue.colorModeForRenderPass(),pt.disabled,function(Rt,Jt,zt,ar){var _r=_.create();_.ortho(_r,0,Rt.width,Rt.height,0,0,1);var Nr=Rt.context.gl;return{u_matrix:_r,u_world:[Nr.drawingBufferWidth,Nr.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:Jt.paint.get("heatmap-opacity")}}(Ue,ke),ke.id,Ue.viewportBuffer,Ue.quadTriangleIndexBuffer,Ue.viewportSegments,ke.paint,Ue.transform.zoom)}}(h,p))},line:function(h,d,p,g){if(h.renderPass==="translucent"){var S=p.paint.get("line-opacity"),w=p.paint.get("line-width");if(S.constantOr(1)!==0&&w.constantOr(1)!==0)for(var C=h.depthModeForSublayer(0,be.ReadOnly),P=h.colorModeForRenderPass(),Z=p.paint.get("line-dasharray"),Y=p.paint.get("line-pattern"),pe=Y.constantOr(1),_e=p.paint.get("line-gradient"),ye=p.getCrossfadeParameters(),Ue=pe?"linePattern":Z?"lineSDF":_e?"lineGradient":"line",ke=h.context,Ke=ke.gl,Ie=!0,$e=0,vt=g;$e<vt.length;$e+=1){var Rt=vt[$e],Jt=d.getTile(Rt);if(!pe||Jt.patternsLoaded()){var zt=Jt.getBucket(p);if(zt){var ar=zt.programConfigurations.get(p.id),_r=h.context.program.get(),Nr=h.useProgram(Ue,ar),kr=Ie||Nr.program!==_r,un=Y.constantOr(null);if(un&&Jt.imageAtlas){var Pn=Jt.imageAtlas,zn=Pn.patternPositions[un.to.toString()],Zn=Pn.patternPositions[un.from.toString()];zn&&Zn&&ar.setConstantPatternPositions(zn,Zn)}var Wi=pe?tf(h,Jt,p,ye):Z?np(h,Jt,p,Z,ye):_e?ca(h,Jt,p,zt.lineClipsArray.length):Ql(h,Jt,p);if(pe)ke.activeTexture.set(Ke.TEXTURE0),Jt.imageAtlasTexture.bind(Ke.LINEAR,Ke.CLAMP_TO_EDGE),ar.updatePaintBuffers(ye);else if(Z&&(kr||h.lineAtlas.dirty))ke.activeTexture.set(Ke.TEXTURE0),h.lineAtlas.bind(ke);else if(_e){var vn=zt.gradients[p.id],ei=vn.texture;if(p.gradientVersion!==vn.version){var _i=256;if(p.stepInterpolant){var ri=d.getSource().maxzoom,qn=Rt.canonical.z===ri?Math.ceil(1<<h.transform.maxZoom-Rt.canonical.z):1;_i=_.clamp(_.nextPowerOfTwo(zt.maxLineLength/_.EXTENT*1024*qn),256,ke.maxTextureSize)}vn.gradient=_.renderColorRamp({expression:p.gradientExpression(),evaluationKey:"lineProgress",resolution:_i,image:vn.gradient||void 0,clips:zt.lineClipsArray}),vn.texture?vn.texture.update(vn.gradient):vn.texture=new _.Texture(ke,vn.gradient,Ke.RGBA),vn.version=p.gradientVersion,ei=vn.texture}ke.activeTexture.set(Ke.TEXTURE0),ei.bind(p.stepInterpolant?Ke.NEAREST:Ke.LINEAR,Ke.CLAMP_TO_EDGE)}Nr.draw(ke,Ke.TRIANGLES,C,h.stencilModeForClipping(Rt),P,pt.disabled,Wi,p.id,zt.layoutVertexBuffer,zt.indexBuffer,zt.segments,p.paint,h.transform.zoom,ar,zt.layoutVertexBuffer2),Ie=!1}}}}},fill:function(h,d,p,g){var S=p.paint.get("fill-color"),w=p.paint.get("fill-opacity");if(w.constantOr(1)!==0){var C=h.colorModeForRenderPass(),P=p.paint.get("fill-pattern"),Z=h.opaquePassEnabledForLayer()&&!P.constantOr(1)&&S.constantOr(_.Color.transparent).a===1&&w.constantOr(0)===1?"opaque":"translucent";if(h.renderPass===Z){var Y=h.depthModeForSublayer(1,h.renderPass==="opaque"?be.ReadWrite:be.ReadOnly);af(h,d,p,g,Y,C,!1)}if(h.renderPass==="translucent"&&p.paint.get("fill-antialias")){var pe=h.depthModeForSublayer(p.getPaintProperty("fill-outline-color")?2:0,be.ReadOnly);af(h,d,p,g,pe,C,!0)}}},"fill-extrusion":function(h,d,p,g){var S=p.paint.get("fill-extrusion-opacity");if(S!==0&&h.renderPass==="translucent"){var w=new be(h.context.gl.LEQUAL,be.ReadWrite,h.depthRangeFor3D);if(S!==1||p.paint.get("fill-extrusion-pattern").constantOr(1))Pc(h,d,p,g,w,Oe.disabled,it.disabled),Pc(h,d,p,g,w,h.stencilModeFor3D(),h.colorModeForRenderPass());else{var C=h.colorModeForRenderPass();Pc(h,d,p,g,w,Oe.disabled,C)}}},hillshade:function(h,d,p,g){if(h.renderPass==="offscreen"||h.renderPass==="translucent"){for(var S=h.context,w=h.depthModeForSublayer(0,be.ReadOnly),C=h.colorModeForRenderPass(),P=h.renderPass==="translucent"?h.stencilConfigForOverlap(g):[{},g],Z=P[0],Y=0,pe=P[1];Y<pe.length;Y+=1){var _e=pe[Y],ye=d.getTile(_e);ye.needsHillshadePrepare&&h.renderPass==="offscreen"?Md(h,ye,p,w,Oe.disabled,C):h.renderPass==="translucent"&&Bu(h,ye,p,w,Z[_e.overscaledZ],C)}S.viewport.set([0,0,h.width,h.height])}},raster:function(h,d,p,g){if(h.renderPass==="translucent"&&p.paint.get("raster-opacity")!==0&&g.length)for(var S=h.context,w=S.gl,C=d.getSource(),P=h.useProgram("raster"),Z=h.colorModeForRenderPass(),Y=C instanceof te?[{},g]:h.stencilConfigForOverlap(g),pe=Y[0],_e=Y[1],ye=_e[_e.length-1].overscaledZ,Ue=!h.options.moving,ke=0,Ke=_e;ke<Ke.length;ke+=1){var Ie=Ke[ke],$e=h.depthModeForSublayer(Ie.overscaledZ-ye,p.paint.get("raster-opacity")===1?be.ReadWrite:be.ReadOnly,w.LESS),vt=d.getTile(Ie),Rt=h.transform.calculatePosMatrix(Ie.toUnwrapped(),Ue);vt.registerFadeDuration(p.paint.get("raster-fade-duration"));var Jt=d.findLoadedParent(Ie,0),zt=Of(vt,Jt,d,p,h.transform),ar=void 0,_r=void 0,Nr=p.paint.get("raster-resampling")==="nearest"?w.NEAREST:w.LINEAR;S.activeTexture.set(w.TEXTURE0),vt.texture.bind(Nr,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST),S.activeTexture.set(w.TEXTURE1),Jt?(Jt.texture.bind(Nr,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST),ar=Math.pow(2,Jt.tileID.overscaledZ-vt.tileID.overscaledZ),_r=[vt.tileID.canonical.x*ar%1,vt.tileID.canonical.y*ar%1]):vt.texture.bind(Nr,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST);var kr=_h(Rt,_r||[0,0],ar||1,zt,p);C instanceof te?P.draw(S,w.TRIANGLES,$e,Oe.disabled,Z,pt.disabled,kr,p.id,C.boundsBuffer,h.quadTriangleIndexBuffer,C.boundsSegments):P.draw(S,w.TRIANGLES,$e,pe[Ie.overscaledZ],Z,pt.disabled,kr,p.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}},background:function(h,d,p){var g=p.paint.get("background-color"),S=p.paint.get("background-opacity");if(S!==0){var w=h.context,C=w.gl,P=h.transform,Z=P.tileSize,Y=p.paint.get("background-pattern");if(!h.isPatternMissing(Y)){var pe=!Y&&g.a===1&&S===1&&h.opaquePassEnabledForLayer()?"opaque":"translucent";if(h.renderPass===pe){var _e=Oe.disabled,ye=h.depthModeForSublayer(0,pe==="opaque"?be.ReadWrite:be.ReadOnly),Ue=h.colorModeForRenderPass(),ke=h.useProgram(Y?"backgroundPattern":"background"),Ke=P.coveringTiles({tileSize:Z});Y&&(w.activeTexture.set(C.TEXTURE0),h.imageManager.bind(h.context));for(var Ie=p.getCrossfadeParameters(),$e=0,vt=Ke;$e<vt.length;$e+=1){var Rt=vt[$e],Jt=h.transform.calculatePosMatrix(Rt.toUnwrapped()),zt=Y?tc(Jt,S,h,Y,{tileID:Rt,tileSize:Z},Ie):ec(Jt,S,g);ke.draw(w,C.TRIANGLES,ye,_e,Ue,pt.disabled,zt,p.id,h.tileExtentBuffer,h.quadTriangleIndexBuffer,h.tileExtentSegments)}}}}},debug:function(h,d,p){for(var g=0;g<p.length;g++)of(h,d,p[g])},custom:function(h,d,p){var g=h.context,S=p.implementation;if(h.renderPass==="offscreen"){var w=S.prerender;w&&(h.setCustomLayerDefaults(),g.setColorMode(h.colorModeForRenderPass()),w.call(S,g.gl,h.transform.customLayerMatrix()),g.setDirty(),h.setBaseState())}else if(h.renderPass==="translucent"){h.setCustomLayerDefaults(),g.setColorMode(h.colorModeForRenderPass()),g.setStencilMode(Oe.disabled);var C=S.renderingMode==="3d"?new be(h.context.gl.LEQUAL,be.ReadWrite,h.depthRangeFor3D):h.depthModeForSublayer(0,be.ReadOnly);g.setDepthMode(C),S.render(g.gl,h.transform.customLayerMatrix()),g.setDirty(),h.setBaseState(),g.bindFramebuffer.set(null)}}},pa=function(h,d){this.context=new j(h),this.transform=d,this._tileTextures={},this.setup(),this.numSublayers=Q.maxUnderzooming+Q.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new bl,this.gpuTimers={}};pa.prototype.resize=function(h,d){if(this.width=h*_.browser.devicePixelRatio,this.height=d*_.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var p=0,g=this.style._order;p<g.length;p+=1)this.style._layers[g[p]].resize()},pa.prototype.setup=function(){var h=this.context,d=new _.StructArrayLayout2i4;d.emplaceBack(0,0),d.emplaceBack(_.EXTENT,0),d.emplaceBack(0,_.EXTENT),d.emplaceBack(_.EXTENT,_.EXTENT),this.tileExtentBuffer=h.createVertexBuffer(d,qa.members),this.tileExtentSegments=_.SegmentVector.simpleSegment(0,0,4,2);var p=new _.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(_.EXTENT,0),p.emplaceBack(0,_.EXTENT),p.emplaceBack(_.EXTENT,_.EXTENT),this.debugBuffer=h.createVertexBuffer(p,qa.members),this.debugSegments=_.SegmentVector.simpleSegment(0,0,4,5);var g=new _.StructArrayLayout4i8;g.emplaceBack(0,0,0,0),g.emplaceBack(_.EXTENT,0,_.EXTENT,0),g.emplaceBack(0,_.EXTENT,0,_.EXTENT),g.emplaceBack(_.EXTENT,_.EXTENT,_.EXTENT,_.EXTENT),this.rasterBoundsBuffer=h.createVertexBuffer(g,nt.members),this.rasterBoundsSegments=_.SegmentVector.simpleSegment(0,0,4,2);var S=new _.StructArrayLayout2i4;S.emplaceBack(0,0),S.emplaceBack(1,0),S.emplaceBack(0,1),S.emplaceBack(1,1),this.viewportBuffer=h.createVertexBuffer(S,qa.members),this.viewportSegments=_.SegmentVector.simpleSegment(0,0,4,2);var w=new _.StructArrayLayout1ui2;w.emplaceBack(0),w.emplaceBack(1),w.emplaceBack(3),w.emplaceBack(2),w.emplaceBack(0),this.tileBorderIndexBuffer=h.createIndexBuffer(w);var C=new _.StructArrayLayout3ui6;C.emplaceBack(0,1,2),C.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=h.createIndexBuffer(C),this.emptyTexture=new _.Texture(h,{width:1,height:1,data:new Uint8Array([0,0,0,0])},h.gl.RGBA);var P=this.context.gl;this.stencilClearMode=new Oe({func:P.ALWAYS,mask:0},0,255,P.ZERO,P.ZERO,P.ZERO)},pa.prototype.clearStencil=function(){var h=this.context,d=h.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var p=_.create();_.ortho(p,0,this.width,this.height,0,0,1),_.scale(p,p,[d.drawingBufferWidth,d.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(h,d.TRIANGLES,be.disabled,this.stencilClearMode,it.disabled,pt.disabled,rl(p),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},pa.prototype._renderTileClippingMasks=function(h,d){if(this.currentStencilSource!==h.source&&h.isTileClipped()&&d&&d.length){this.currentStencilSource=h.source;var p=this.context,g=p.gl;this.nextStencilID+d.length>256&&this.clearStencil(),p.setColorMode(it.disabled),p.setDepthMode(be.disabled);var S=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var w=0,C=d;w<C.length;w+=1){var P=C[w],Z=this._tileClippingMaskIDs[P.key]=this.nextStencilID++;S.draw(p,g.TRIANGLES,be.disabled,new Oe({func:g.ALWAYS,mask:0},Z,255,g.KEEP,g.KEEP,g.REPLACE),it.disabled,pt.disabled,rl(P.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},pa.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var h=this.nextStencilID++,d=this.context.gl;return new Oe({func:d.NOTEQUAL,mask:255},h,255,d.KEEP,d.KEEP,d.REPLACE)},pa.prototype.stencilModeForClipping=function(h){var d=this.context.gl;return new Oe({func:d.EQUAL,mask:255},this._tileClippingMaskIDs[h.key],0,d.KEEP,d.KEEP,d.REPLACE)},pa.prototype.stencilConfigForOverlap=function(h){var d,p=this.context.gl,g=h.sort(function(Z,Y){return Y.overscaledZ-Z.overscaledZ}),S=g[g.length-1].overscaledZ,w=g[0].overscaledZ-S+1;if(w>1){this.currentStencilSource=void 0,this.nextStencilID+w>256&&this.clearStencil();for(var C={},P=0;P<w;P++)C[P+S]=new Oe({func:p.GEQUAL,mask:255},P+this.nextStencilID,255,p.KEEP,p.KEEP,p.REPLACE);return this.nextStencilID+=w,[C,g]}return[(d={},d[S]=Oe.disabled,d),g]},pa.prototype.colorModeForRenderPass=function(){var h=this.context.gl;return this._showOverdrawInspector?new it([h.CONSTANT_COLOR,h.ONE],new _.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?it.unblended:it.alphaBlended},pa.prototype.depthModeForSublayer=function(h,d,p){if(!this.opaquePassEnabledForLayer())return be.disabled;var g=1-((1+this.currentLayer)*this.numSublayers+h)*this.depthEpsilon;return new be(p||this.context.gl.LEQUAL,d,[g,g])},pa.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},pa.prototype.render=function(h,d){var p=this;this.style=h,this.options=d,this.lineAtlas=h.lineAtlas,this.imageManager=h.imageManager,this.glyphManager=h.glyphManager,this.symbolFadeChange=h.placement.symbolFadeChange(_.browser.now()),this.imageManager.beginFrame();var g=this.style._order,S=this.style.sourceCaches;for(var w in S){var C=S[w];C.used&&C.prepare(this.context)}var P,Z,Y={},pe={},_e={};for(var ye in S){var Ue=S[ye];Y[ye]=Ue.getVisibleCoordinates(),pe[ye]=Y[ye].slice().reverse(),_e[ye]=Ue.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var ke=0;ke<g.length;ke++)if(this.style._layers[g[ke]].is3D()){this.opaquePassCutoff=ke;break}this.renderPass="offscreen";for(var Ke=0,Ie=g;Ke<Ie.length;Ke+=1){var $e=this.style._layers[Ie[Ke]];if($e.hasOffscreenPass()&&!$e.isHidden(this.transform.zoom)){var vt=pe[$e.source];($e.type==="custom"||vt.length)&&this.renderLayer(this,S[$e.source],$e,vt)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:d.showOverdrawInspector?_.Color.black:_.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=d.showOverdrawInspector,this.depthRangeFor3D=[0,1-(h._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=g.length-1;this.currentLayer>=0;this.currentLayer--){var Rt=this.style._layers[g[this.currentLayer]],Jt=S[Rt.source],zt=Y[Rt.source];this._renderTileClippingMasks(Rt,zt),this.renderLayer(this,Jt,Rt,zt)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<g.length;this.currentLayer++){var ar=this.style._layers[g[this.currentLayer]],_r=S[ar.source],Nr=(ar.type==="symbol"?_e:pe)[ar.source];this._renderTileClippingMasks(ar,Y[ar.source]),this.renderLayer(this,_r,ar,Nr)}this.options.showTileBoundaries&&(_.values(this.style._layers).forEach(function(kr){kr.source&&!kr.isHidden(p.transform.zoom)&&(kr.source!==(Z&&Z.id)&&(Z=p.style.sourceCaches[kr.source]),(!P||P.getSource().maxzoom<Z.getSource().maxzoom)&&(P=Z))}),P&&il.debug(this,P,P.getVisibleCoordinates())),this.options.showPadding&&function(kr){var un=kr.transform.padding;Ff(kr,kr.transform.height-(un.top||0),3,xh),Ff(kr,un.bottom||0,3,Df),Eh(kr,un.left||0,3,Fo),Eh(kr,kr.transform.width-(un.right||0),3,bh);var Pn=kr.transform.centerPoint;(function(zn,Zn,Wi,vn){Oc(zn,Zn-1,Wi-10,2,20,vn),Oc(zn,Zn-10,Wi-1,20,2,vn)})(kr,Pn.x,kr.transform.height-Pn.y,ap)}(this),this.context.setDefault()},pa.prototype.renderLayer=function(h,d,p,g){p.isHidden(this.transform.zoom)||(p.type==="background"||p.type==="custom"||g.length)&&(this.id=p.id,this.gpuTimingStart(p),il[p.type](h,d,p,g,this.style.placement.variableOffsets),this.gpuTimingEnd())},pa.prototype.gpuTimingStart=function(h){if(this.options.gpuTiming){var d=this.context.extTimerQuery,p=this.gpuTimers[h.id];p||(p=this.gpuTimers[h.id]={calls:0,cpuTime:0,query:d.createQueryEXT()}),p.calls++,d.beginQueryEXT(d.TIME_ELAPSED_EXT,p.query)}},pa.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var h=this.context.extTimerQuery;h.endQueryEXT(h.TIME_ELAPSED_EXT)}},pa.prototype.collectGpuTimers=function(){var h=this.gpuTimers;return this.gpuTimers={},h},pa.prototype.queryGpuTimers=function(h){var d={};for(var p in h){var g=h[p],S=this.context.extTimerQuery,w=S.getQueryObjectEXT(g.query,S.QUERY_RESULT_EXT)/1e6;S.deleteQueryEXT(g.query),d[p]=w}return d},pa.prototype.translatePosMatrix=function(h,d,p,g,S){if(!p[0]&&!p[1])return h;var w=S?g==="map"?this.transform.angle:0:g==="viewport"?-this.transform.angle:0;if(w){var C=Math.sin(w),P=Math.cos(w);p=[p[0]*P-p[1]*C,p[0]*C+p[1]*P]}var Z=[S?p[0]:ha(d,p[0],this.transform.zoom),S?p[1]:ha(d,p[1],this.transform.zoom),0],Y=new Float32Array(16);return _.translate(Y,h,Z),Y},pa.prototype.saveTileTexture=function(h){var d=this._tileTextures[h.size[0]];d?d.push(h):this._tileTextures[h.size[0]]=[h]},pa.prototype.getTileTexture=function(h){var d=this._tileTextures[h];return d&&d.length>0?d.pop():null},pa.prototype.isPatternMissing=function(h){if(!h)return!1;if(!h.from||!h.to)return!0;var d=this.imageManager.getPattern(h.from.toString()),p=this.imageManager.getPattern(h.to.toString());return!d||!p},pa.prototype.useProgram=function(h,d){this.cache=this.cache||{};var p=""+h+(d?d.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[p]||(this.cache[p]=new Ha(this.context,h,fu[h],d,ip[h],this._showOverdrawInspector)),this.cache[p]},pa.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},pa.prototype.setBaseState=function(){var h=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(h.FUNC_ADD)},pa.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=_.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new _.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},pa.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var kf=function(h,d){this.points=h,this.planes=d};kf.fromInvProjectionMatrix=function(h,d,p){var g=Math.pow(2,p),S=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(C){return _.transformMat4([],C,h)}).map(function(C){return _.scale$1([],C,1/C[3]/d*g)}),w=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(C){var P=_.sub([],S[C[0]],S[C[1]]),Z=_.sub([],S[C[2]],S[C[1]]),Y=_.normalize([],_.cross([],P,Z)),pe=-_.dot(Y,S[C[1]]);return Y.concat(pe)});return new kf(S,w)};var du=function(h,d){this.min=h,this.max=d,this.center=_.scale$2([],_.add([],this.min,this.max),.5)};du.prototype.quadrant=function(h){for(var d=[h%2==0,h<2],p=_.clone$2(this.min),g=_.clone$2(this.max),S=0;S<d.length;S++)p[S]=d[S]?this.min[S]:this.center[S],g[S]=d[S]?this.center[S]:this.max[S];return g[2]=this.max[2],new du(p,g)},du.prototype.distanceX=function(h){return Math.max(Math.min(this.max[0],h[0]),this.min[0])-h[0]},du.prototype.distanceY=function(h){return Math.max(Math.min(this.max[1],h[1]),this.min[1])-h[1]},du.prototype.intersects=function(h){for(var d=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],p=!0,g=0;g<h.planes.length;g++){for(var S=h.planes[g],w=0,C=0;C<d.length;C++)w+=_.dot$1(S,d[C])>=0;if(w===0)return 0;w!==d.length&&(p=!1)}if(p)return 2;for(var P=0;P<3;P++){for(var Z=Number.MAX_VALUE,Y=-Number.MAX_VALUE,pe=0;pe<h.points.length;pe++){var _e=h.points[pe][P]-this.min[P];Z=Math.min(Z,_e),Y=Math.max(Y,_e)}if(Y<0||Z>this.max[P]-this.min[P])return 0}return 1};var Rl=function(h,d,p,g){if(h===void 0&&(h=0),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=0),isNaN(h)||h<0||isNaN(d)||d<0||isNaN(p)||p<0||isNaN(g)||g<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=h,this.bottom=d,this.left=p,this.right=g};Rl.prototype.interpolate=function(h,d,p){return d.top!=null&&h.top!=null&&(this.top=_.number(h.top,d.top,p)),d.bottom!=null&&h.bottom!=null&&(this.bottom=_.number(h.bottom,d.bottom,p)),d.left!=null&&h.left!=null&&(this.left=_.number(h.left,d.left,p)),d.right!=null&&h.right!=null&&(this.right=_.number(h.right,d.right,p)),this},Rl.prototype.getCenter=function(h,d){var p=_.clamp((this.left+h-this.right)/2,0,h),g=_.clamp((this.top+d-this.bottom)/2,0,d);return new _.Point(p,g)},Rl.prototype.equals=function(h){return this.top===h.top&&this.bottom===h.bottom&&this.left===h.left&&this.right===h.right},Rl.prototype.clone=function(){return new Rl(this.top,this.bottom,this.left,this.right)},Rl.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Li=function(h,d,p,g,S){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=S===void 0||S,this._minZoom=h||0,this._maxZoom=d||22,this._minPitch=p==null?0:p,this._maxPitch=g==null?60:g,this.setMaxBounds(),this.width=0,this.height=0,this._center=new _.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Rl,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ca={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Li.prototype.clone=function(){var h=new Li(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return h.tileSize=this.tileSize,h.latRange=this.latRange,h.width=this.width,h.height=this.height,h._center=this._center,h.zoom=this.zoom,h.angle=this.angle,h._fov=this._fov,h._pitch=this._pitch,h._unmodified=this._unmodified,h._edgeInsets=this._edgeInsets.clone(),h._calcMatrices(),h},Ca.minZoom.get=function(){return this._minZoom},Ca.minZoom.set=function(h){this._minZoom!==h&&(this._minZoom=h,this.zoom=Math.max(this.zoom,h))},Ca.maxZoom.get=function(){return this._maxZoom},Ca.maxZoom.set=function(h){this._maxZoom!==h&&(this._maxZoom=h,this.zoom=Math.min(this.zoom,h))},Ca.minPitch.get=function(){return this._minPitch},Ca.minPitch.set=function(h){this._minPitch!==h&&(this._minPitch=h,this.pitch=Math.max(this.pitch,h))},Ca.maxPitch.get=function(){return this._maxPitch},Ca.maxPitch.set=function(h){this._maxPitch!==h&&(this._maxPitch=h,this.pitch=Math.min(this.pitch,h))},Ca.renderWorldCopies.get=function(){return this._renderWorldCopies},Ca.renderWorldCopies.set=function(h){h===void 0?h=!0:h===null&&(h=!1),this._renderWorldCopies=h},Ca.worldSize.get=function(){return this.tileSize*this.scale},Ca.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ca.size.get=function(){return new _.Point(this.width,this.height)},Ca.bearing.get=function(){return-this.angle/Math.PI*180},Ca.bearing.set=function(h){var d=-_.wrap(h,-180,180)*Math.PI/180;this.angle!==d&&(this._unmodified=!1,this.angle=d,this._calcMatrices(),this.rotationMatrix=_.create$2(),_.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ca.pitch.get=function(){return this._pitch/Math.PI*180},Ca.pitch.set=function(h){var d=_.clamp(h,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==d&&(this._unmodified=!1,this._pitch=d,this._calcMatrices())},Ca.fov.get=function(){return this._fov/Math.PI*180},Ca.fov.set=function(h){h=Math.max(.01,Math.min(60,h)),this._fov!==h&&(this._unmodified=!1,this._fov=h/180*Math.PI,this._calcMatrices())},Ca.zoom.get=function(){return this._zoom},Ca.zoom.set=function(h){var d=Math.min(Math.max(h,this.minZoom),this.maxZoom);this._zoom!==d&&(this._unmodified=!1,this._zoom=d,this.scale=this.zoomScale(d),this.tileZoom=Math.floor(d),this.zoomFraction=d-this.tileZoom,this._constrain(),this._calcMatrices())},Ca.center.get=function(){return this._center},Ca.center.set=function(h){h.lat===this._center.lat&&h.lng===this._center.lng||(this._unmodified=!1,this._center=h,this._constrain(),this._calcMatrices())},Ca.padding.get=function(){return this._edgeInsets.toJSON()},Ca.padding.set=function(h){this._edgeInsets.equals(h)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,h,1),this._calcMatrices())},Ca.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Li.prototype.isPaddingEqual=function(h){return this._edgeInsets.equals(h)},Li.prototype.interpolatePadding=function(h,d,p){this._unmodified=!1,this._edgeInsets.interpolate(h,d,p),this._constrain(),this._calcMatrices()},Li.prototype.coveringZoomLevel=function(h){var d=(h.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/h.tileSize));return Math.max(0,d)},Li.prototype.getVisibleUnwrappedCoordinates=function(h){var d=[new _.UnwrappedTileID(0,h)];if(this._renderWorldCopies)for(var p=this.pointCoordinate(new _.Point(0,0)),g=this.pointCoordinate(new _.Point(this.width,0)),S=this.pointCoordinate(new _.Point(this.width,this.height)),w=this.pointCoordinate(new _.Point(0,this.height)),C=Math.floor(Math.min(p.x,g.x,S.x,w.x)),P=Math.floor(Math.max(p.x,g.x,S.x,w.x)),Z=C-1;Z<=P+1;Z++)Z!==0&&d.push(new _.UnwrappedTileID(Z,h));return d},Li.prototype.coveringTiles=function(h){var d=this.coveringZoomLevel(h),p=d;if(h.minzoom!==void 0&&d<h.minzoom)return[];h.maxzoom!==void 0&&d>h.maxzoom&&(d=h.maxzoom);var g=_.MercatorCoordinate.fromLngLat(this.center),S=Math.pow(2,d),w=[S*g.x,S*g.y,0],C=kf.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,d),P=h.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(P=d);var Z=function(kr){return{aabb:new du([kr*S,0,0],[(kr+1)*S,S,0]),zoom:0,x:0,y:0,wrap:kr,fullyVisible:!1}},Y=[],pe=[],_e=d,ye=h.reparseOverscaled?p:d;if(this._renderWorldCopies)for(var Ue=1;Ue<=3;Ue++)Y.push(Z(-Ue)),Y.push(Z(Ue));for(Y.push(Z(0));Y.length>0;){var ke=Y.pop(),Ke=ke.x,Ie=ke.y,$e=ke.fullyVisible;if(!$e){var vt=ke.aabb.intersects(C);if(vt===0)continue;$e=vt===2}var Rt=ke.aabb.distanceX(w),Jt=ke.aabb.distanceY(w),zt=Math.max(Math.abs(Rt),Math.abs(Jt));if(ke.zoom===_e||zt>3+(1<<_e-ke.zoom)-2&&ke.zoom>=P)pe.push({tileID:new _.OverscaledTileID(ke.zoom===_e?ye:ke.zoom,ke.wrap,ke.zoom,Ke,Ie),distanceSq:_.sqrLen([w[0]-.5-Ke,w[1]-.5-Ie])});else for(var ar=0;ar<4;ar++){var _r=(Ke<<1)+ar%2,Nr=(Ie<<1)+(ar>>1);Y.push({aabb:ke.aabb.quadrant(ar),zoom:ke.zoom+1,x:_r,y:Nr,wrap:ke.wrap,fullyVisible:$e})}}return pe.sort(function(kr,un){return kr.distanceSq-un.distanceSq}).map(function(kr){return kr.tileID})},Li.prototype.resize=function(h,d){this.width=h,this.height=d,this.pixelsToGLUnits=[2/h,-2/d],this._constrain(),this._calcMatrices()},Ca.unmodified.get=function(){return this._unmodified},Li.prototype.zoomScale=function(h){return Math.pow(2,h)},Li.prototype.scaleZoom=function(h){return Math.log(h)/Math.LN2},Li.prototype.project=function(h){var d=_.clamp(h.lat,-this.maxValidLatitude,this.maxValidLatitude);return new _.Point(_.mercatorXfromLng(h.lng)*this.worldSize,_.mercatorYfromLat(d)*this.worldSize)},Li.prototype.unproject=function(h){return new _.MercatorCoordinate(h.x/this.worldSize,h.y/this.worldSize).toLngLat()},Ca.point.get=function(){return this.project(this.center)},Li.prototype.setLocationAtPoint=function(h,d){var p=this.pointCoordinate(d),g=this.pointCoordinate(this.centerPoint),S=this.locationCoordinate(h),w=new _.MercatorCoordinate(S.x-(p.x-g.x),S.y-(p.y-g.y));this.center=this.coordinateLocation(w),this._renderWorldCopies&&(this.center=this.center.wrap())},Li.prototype.locationPoint=function(h){return this.coordinatePoint(this.locationCoordinate(h))},Li.prototype.pointLocation=function(h){return this.coordinateLocation(this.pointCoordinate(h))},Li.prototype.locationCoordinate=function(h){return _.MercatorCoordinate.fromLngLat(h)},Li.prototype.coordinateLocation=function(h){return h.toLngLat()},Li.prototype.pointCoordinate=function(h){var d=[h.x,h.y,0,1],p=[h.x,h.y,1,1];_.transformMat4(d,d,this.pixelMatrixInverse),_.transformMat4(p,p,this.pixelMatrixInverse);var g=d[3],S=p[3],w=d[1]/g,C=p[1]/S,P=d[2]/g,Z=p[2]/S,Y=P===Z?0:(0-P)/(Z-P);return new _.MercatorCoordinate(_.number(d[0]/g,p[0]/S,Y)/this.worldSize,_.number(w,C,Y)/this.worldSize)},Li.prototype.coordinatePoint=function(h){var d=[h.x*this.worldSize,h.y*this.worldSize,0,1];return _.transformMat4(d,d,this.pixelMatrix),new _.Point(d[0]/d[3],d[1]/d[3])},Li.prototype.getBounds=function(){return new _.LngLatBounds().extend(this.pointLocation(new _.Point(0,0))).extend(this.pointLocation(new _.Point(this.width,0))).extend(this.pointLocation(new _.Point(this.width,this.height))).extend(this.pointLocation(new _.Point(0,this.height)))},Li.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new _.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Li.prototype.setMaxBounds=function(h){h?(this.lngRange=[h.getWest(),h.getEast()],this.latRange=[h.getSouth(),h.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Li.prototype.calculatePosMatrix=function(h,d){d===void 0&&(d=!1);var p=h.key,g=d?this._alignedPosMatrixCache:this._posMatrixCache;if(g[p])return g[p];var S=h.canonical,w=this.worldSize/this.zoomScale(S.z),C=S.x+Math.pow(2,S.z)*h.wrap,P=_.identity(new Float64Array(16));return _.translate(P,P,[C*w,S.y*w,0]),_.scale(P,P,[w/_.EXTENT,w/_.EXTENT,1]),_.multiply(P,d?this.alignedProjMatrix:this.projMatrix,P),g[p]=new Float32Array(P),g[p]},Li.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Li.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var h,d,p,g,S=-90,w=90,C=-180,P=180,Z=this.size,Y=this._unmodified;if(this.latRange){var pe=this.latRange;S=_.mercatorYfromLat(pe[1])*this.worldSize,h=(w=_.mercatorYfromLat(pe[0])*this.worldSize)-S<Z.y?Z.y/(w-S):0}if(this.lngRange){var _e=this.lngRange;C=_.mercatorXfromLng(_e[0])*this.worldSize,d=(P=_.mercatorXfromLng(_e[1])*this.worldSize)-C<Z.x?Z.x/(P-C):0}var ye=this.point,Ue=Math.max(d||0,h||0);if(Ue)return this.center=this.unproject(new _.Point(d?(P+C)/2:ye.x,h?(w+S)/2:ye.y)),this.zoom+=this.scaleZoom(Ue),this._unmodified=Y,void(this._constraining=!1);if(this.latRange){var ke=ye.y,Ke=Z.y/2;ke-Ke<S&&(g=S+Ke),ke+Ke>w&&(g=w-Ke)}if(this.lngRange){var Ie=ye.x,$e=Z.x/2;Ie-$e<C&&(p=C+$e),Ie+$e>P&&(p=P-$e)}p===void 0&&g===void 0||(this.center=this.unproject(new _.Point(p!==void 0?p:ye.x,g!==void 0?g:ye.y))),this._unmodified=Y,this._constraining=!1}},Li.prototype._calcMatrices=function(){if(this.height){var h=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var d=Math.PI/2+this._pitch,p=this._fov*(.5+h.y/this.height),g=Math.sin(p)*this.cameraToCenterDistance/Math.sin(_.clamp(Math.PI-d-p,.01,Math.PI-.01)),S=this.point,w=S.x,C=S.y,P=1.01*(Math.cos(Math.PI/2-this._pitch)*g+this.cameraToCenterDistance),Z=this.height/50,Y=new Float64Array(16);_.perspective(Y,this._fov,this.width/this.height,Z,P),Y[8]=2*-h.x/this.width,Y[9]=2*h.y/this.height,_.scale(Y,Y,[1,-1,1]),_.translate(Y,Y,[0,0,-this.cameraToCenterDistance]),_.rotateX(Y,Y,this._pitch),_.rotateZ(Y,Y,this.angle),_.translate(Y,Y,[-w,-C,0]),this.mercatorMatrix=_.scale([],Y,[this.worldSize,this.worldSize,this.worldSize]),_.scale(Y,Y,[1,1,_.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Y,this.invProjMatrix=_.invert([],this.projMatrix);var pe=this.width%2/2,_e=this.height%2/2,ye=Math.cos(this.angle),Ue=Math.sin(this.angle),ke=w-Math.round(w)+ye*pe+Ue*_e,Ke=C-Math.round(C)+ye*_e+Ue*pe,Ie=new Float64Array(Y);if(_.translate(Ie,Ie,[ke>.5?ke-1:ke,Ke>.5?Ke-1:Ke,0]),this.alignedProjMatrix=Ie,Y=_.create(),_.scale(Y,Y,[this.width/2,-this.height/2,1]),_.translate(Y,Y,[1,-1,0]),this.labelPlaneMatrix=Y,Y=_.create(),_.scale(Y,Y,[1,-1,1]),_.translate(Y,Y,[-1,-1,0]),_.scale(Y,Y,[2/this.width,2/this.height,1]),this.glCoordMatrix=Y,this.pixelMatrix=_.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(Y=_.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=Y,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Li.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var h=this.pointCoordinate(new _.Point(0,0)),d=[h.x*this.worldSize,h.y*this.worldSize,0,1];return _.transformMat4(d,d,this.pixelMatrix)[3]/this.cameraToCenterDistance},Li.prototype.getCameraPoint=function(){var h=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new _.Point(0,h))},Li.prototype.getCameraQueryGeometry=function(h){var d=this.getCameraPoint();if(h.length===1)return[h[0],d];for(var p=d.x,g=d.y,S=d.x,w=d.y,C=0,P=h;C<P.length;C+=1){var Z=P[C];p=Math.min(p,Z.x),g=Math.min(g,Z.y),S=Math.max(S,Z.x),w=Math.max(w,Z.y)}return[new _.Point(p,g),new _.Point(S,g),new _.Point(S,w),new _.Point(p,w),new _.Point(p,g)]},Object.defineProperties(Li.prototype,Ca);var Ys=function(h){var d,p,g,S;this._hashName=h&&encodeURIComponent(h),_.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(d=this._updateHashUnthrottled.bind(this),p=!1,g=null,S=function(){g=null,p&&(d(),g=setTimeout(S,300),p=!1)},function(){return p=!0,g||S(),g})};Ys.prototype.addTo=function(h){return this._map=h,_.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Ys.prototype.remove=function(){return _.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Ys.prototype.getHashString=function(h){var d=this._map.getCenter(),p=Math.round(100*this._map.getZoom())/100,g=Math.ceil((p*Math.LN2+Math.log(512/360/.5))/Math.LN10),S=Math.pow(10,g),w=Math.round(d.lng*S)/S,C=Math.round(d.lat*S)/S,P=this._map.getBearing(),Z=this._map.getPitch(),Y="";if(Y+=h?"/"+w+"/"+C+"/"+p:p+"/"+C+"/"+w,(P||Z)&&(Y+="/"+Math.round(10*P)/10),Z&&(Y+="/"+Math.round(Z)),this._hashName){var pe=this._hashName,_e=!1,ye=_.window.location.hash.slice(1).split("&").map(function(Ue){var ke=Ue.split("=")[0];return ke===pe?(_e=!0,ke+"="+Y):Ue}).filter(function(Ue){return Ue});return _e||ye.push(pe+"="+Y),"#"+ye.join("&")}return"#"+Y},Ys.prototype._getCurrentHash=function(){var h,d=this,p=_.window.location.hash.replace("#","");return this._hashName?(p.split("&").map(function(g){return g.split("=")}).forEach(function(g){g[0]===d._hashName&&(h=g)}),(h&&h[1]||"").split("/")):p.split("/")},Ys.prototype._onHashChange=function(){var h=this._getCurrentHash();if(h.length>=3&&!h.some(function(p){return isNaN(p)})){var d=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(h[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+h[2],+h[1]],zoom:+h[0],bearing:d,pitch:+(h[4]||0)}),!0}return!1},Ys.prototype._updateHashUnthrottled=function(){var h=_.window.location.href.replace(/(#.+)?$/,this.getHashString());try{_.window.history.replaceState(_.window.history.state,null,h)}catch(d){}};var Bf={linearity:.3,easing:_.bezier(0,0,.3,1)},Fs=_.extend({deceleration:2500,maxSpeed:1400},Bf),sf=_.extend({deceleration:20,maxSpeed:1400},Bf),op=_.extend({deceleration:1e3,maxSpeed:360},Bf),Sh=_.extend({deceleration:1e3,maxSpeed:90},Bf),Lf=function(h){this._map=h,this.clear()};function Ml(h,d){(!h.duration||h.duration<d.duration)&&(h.duration=d.duration,h.easing=d.easing)}function ko(h,d,p){var g=p.maxSpeed,S=p.linearity,w=p.deceleration,C=_.clamp(h*S/(d/1e3),-g,g),P=Math.abs(C)/(w*S);return{easing:p.easing,duration:1e3*P,amount:C*(P/2)}}Lf.prototype.clear=function(){this._inertiaBuffer=[]},Lf.prototype.record=function(h){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:_.browser.now(),settings:h})},Lf.prototype._drainInertiaBuffer=function(){for(var h=this._inertiaBuffer,d=_.browser.now();h.length>0&&d-h[0].time>160;)h.shift()},Lf.prototype._onMoveEnd=function(h){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var d={zoom:0,bearing:0,pitch:0,pan:new _.Point(0,0),pinchAround:void 0,around:void 0},p=0,g=this._inertiaBuffer;p<g.length;p+=1){var S=g[p].settings;d.zoom+=S.zoomDelta||0,d.bearing+=S.bearingDelta||0,d.pitch+=S.pitchDelta||0,S.panDelta&&d.pan._add(S.panDelta),S.around&&(d.around=S.around),S.pinchAround&&(d.pinchAround=S.pinchAround)}var w=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,C={};if(d.pan.mag()){var P=ko(d.pan.mag(),w,_.extend({},Fs,h||{}));C.offset=d.pan.mult(P.amount/d.pan.mag()),C.center=this._map.transform.center,Ml(C,P)}if(d.zoom){var Z=ko(d.zoom,w,sf);C.zoom=this._map.transform.zoom+Z.amount,Ml(C,Z)}if(d.bearing){var Y=ko(d.bearing,w,op);C.bearing=this._map.transform.bearing+_.clamp(Y.amount,-179,179),Ml(C,Y)}if(d.pitch){var pe=ko(d.pitch,w,Sh);C.pitch=this._map.transform.pitch+pe.amount,Ml(C,pe)}if(C.zoom||C.bearing){var _e=d.pinchAround===void 0?d.around:d.pinchAround;C.around=_e?this._map.unproject(_e):this._map.getCenter()}return this.clear(),_.extend(C,{noMoveStart:!0})}};var Wa=function(h){function d(g,S,w,C){C===void 0&&(C={});var P=U.mousePos(S.getCanvasContainer(),w),Z=S.unproject(P);h.call(this,g,_.extend({point:P,lngLat:Z,originalEvent:w},C)),this._defaultPrevented=!1,this.target=S}h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d;var p={defaultPrevented:{configurable:!0}};return d.prototype.preventDefault=function(){this._defaultPrevented=!0},p.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(d.prototype,p),d}(_.Event),al=function(h){function d(g,S,w){var C=g==="touchend"?w.changedTouches:w.touches,P=U.touchPos(S.getCanvasContainer(),C),Z=P.map(function(_e){return S.unproject(_e)}),Y=P.reduce(function(_e,ye,Ue,ke){return _e.add(ye.div(ke.length))},new _.Point(0,0)),pe=S.unproject(Y);h.call(this,g,{points:P,point:Y,lngLats:Z,lngLat:pe,originalEvent:w}),this._defaultPrevented=!1}h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d;var p={defaultPrevented:{configurable:!0}};return d.prototype.preventDefault=function(){this._defaultPrevented=!0},p.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(d.prototype,p),d}(_.Event),Ah=function(h){function d(g,S,w){h.call(this,g,{originalEvent:w}),this._defaultPrevented=!1}h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d;var p={defaultPrevented:{configurable:!0}};return d.prototype.preventDefault=function(){this._defaultPrevented=!0},p.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(d.prototype,p),d}(_.Event),Ka=function(h,d){this._map=h,this._clickTolerance=d.clickTolerance};Ka.prototype.reset=function(){delete this._mousedownPos},Ka.prototype.wheel=function(h){return this._firePreventable(new Ah(h.type,this._map,h))},Ka.prototype.mousedown=function(h,d){return this._mousedownPos=d,this._firePreventable(new Wa(h.type,this._map,h))},Ka.prototype.mouseup=function(h){this._map.fire(new Wa(h.type,this._map,h))},Ka.prototype.click=function(h,d){this._mousedownPos&&this._mousedownPos.dist(d)>=this._clickTolerance||this._map.fire(new Wa(h.type,this._map,h))},Ka.prototype.dblclick=function(h){return this._firePreventable(new Wa(h.type,this._map,h))},Ka.prototype.mouseover=function(h){this._map.fire(new Wa(h.type,this._map,h))},Ka.prototype.mouseout=function(h){this._map.fire(new Wa(h.type,this._map,h))},Ka.prototype.touchstart=function(h){return this._firePreventable(new al(h.type,this._map,h))},Ka.prototype.touchmove=function(h){this._map.fire(new al(h.type,this._map,h))},Ka.prototype.touchend=function(h){this._map.fire(new al(h.type,this._map,h))},Ka.prototype.touchcancel=function(h){this._map.fire(new al(h.type,this._map,h))},Ka.prototype._firePreventable=function(h){if(this._map.fire(h),h.defaultPrevented)return{}},Ka.prototype.isEnabled=function(){return!0},Ka.prototype.isActive=function(){return!1},Ka.prototype.enable=function(){},Ka.prototype.disable=function(){};var _n=function(h){this._map=h};_n.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},_n.prototype.mousemove=function(h){this._map.fire(new Wa(h.type,this._map,h))},_n.prototype.mousedown=function(){this._delayContextMenu=!0},_n.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Wa("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},_n.prototype.contextmenu=function(h){this._delayContextMenu?this._contextMenuEvent=h:this._map.fire(new Wa(h.type,this._map,h)),this._map.listens("contextmenu")&&h.preventDefault()},_n.prototype.isEnabled=function(){return!0},_n.prototype.isActive=function(){return!1},_n.prototype.enable=function(){},_n.prototype.disable=function(){};var ks=function(h,d){this._map=h,this._el=h.getCanvasContainer(),this._container=h.getContainer(),this._clickTolerance=d.clickTolerance||1};function uf(h,d){for(var p={},g=0;g<h.length;g++)p[h[g].identifier]=d[g];return p}ks.prototype.isEnabled=function(){return!!this._enabled},ks.prototype.isActive=function(){return!!this._active},ks.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},ks.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ks.prototype.mousedown=function(h,d){this.isEnabled()&&h.shiftKey&&h.button===0&&(U.disableDrag(),this._startPos=this._lastPos=d,this._active=!0)},ks.prototype.mousemoveWindow=function(h,d){if(this._active){var p=d;if(!(this._lastPos.equals(p)||!this._box&&p.dist(this._startPos)<this._clickTolerance)){var g=this._startPos;this._lastPos=p,this._box||(this._box=U.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",h));var S=Math.min(g.x,p.x),w=Math.max(g.x,p.x),C=Math.min(g.y,p.y),P=Math.max(g.y,p.y);U.setTransform(this._box,"translate("+S+"px,"+C+"px)"),this._box.style.width=w-S+"px",this._box.style.height=P-C+"px"}}},ks.prototype.mouseupWindow=function(h,d){var p=this;if(this._active&&h.button===0){var g=this._startPos,S=d;if(this.reset(),U.suppressClick(),g.x!==S.x||g.y!==S.y)return this._map.fire(new _.Event("boxzoomend",{originalEvent:h})),{cameraAnimation:function(w){return w.fitScreenCoordinates(g,S,p._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",h)}},ks.prototype.keydown=function(h){this._active&&h.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",h))},ks.prototype.blur=function(){this.reset()},ks.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(U.remove(this._box),this._box=null),U.enableDrag(),delete this._startPos,delete this._lastPos},ks.prototype._fireEvent=function(h,d){return this._map.fire(new _.Event(h,{originalEvent:d}))};var rc=function(h){this.reset(),this.numTouches=h.numTouches};rc.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},rc.prototype.touchstart=function(h,d,p){(this.centroid||p.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=h.timeStamp),p.length===this.numTouches&&(this.centroid=function(g){for(var S=new _.Point(0,0),w=0,C=g;w<C.length;w+=1)S._add(C[w]);return S.div(g.length)}(d),this.touches=uf(p,d)))},rc.prototype.touchmove=function(h,d,p){if(!this.aborted&&this.centroid){var g=uf(p,d);for(var S in this.touches){var w=g[S];(!w||w.dist(this.touches[S])>30)&&(this.aborted=!0)}}},rc.prototype.touchend=function(h,d,p){if((!this.centroid||h.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){var g=!this.aborted&&this.centroid;if(this.reset(),g)return g}};var us=function(h){this.singleTap=new rc(h),this.numTaps=h.numTaps,this.reset()};us.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},us.prototype.touchstart=function(h,d,p){this.singleTap.touchstart(h,d,p)},us.prototype.touchmove=function(h,d,p){this.singleTap.touchmove(h,d,p)},us.prototype.touchend=function(h,d,p){var g=this.singleTap.touchend(h,d,p);if(g){var S=h.timeStamp-this.lastTime<500,w=!this.lastTap||this.lastTap.dist(g)<30;if(S&&w||this.reset(),this.count++,this.lastTime=h.timeStamp,this.lastTap=g,this.count===this.numTaps)return this.reset(),g}};var ga=function(){this._zoomIn=new us({numTouches:1,numTaps:2}),this._zoomOut=new us({numTouches:2,numTaps:1}),this.reset()};ga.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},ga.prototype.touchstart=function(h,d,p){this._zoomIn.touchstart(h,d,p),this._zoomOut.touchstart(h,d,p)},ga.prototype.touchmove=function(h,d,p){this._zoomIn.touchmove(h,d,p),this._zoomOut.touchmove(h,d,p)},ga.prototype.touchend=function(h,d,p){var g=this,S=this._zoomIn.touchend(h,d,p),w=this._zoomOut.touchend(h,d,p);return S?(this._active=!0,h.preventDefault(),setTimeout(function(){return g.reset()},0),{cameraAnimation:function(C){return C.easeTo({duration:300,zoom:C.getZoom()+1,around:C.unproject(S)},{originalEvent:h})}}):w?(this._active=!0,h.preventDefault(),setTimeout(function(){return g.reset()},0),{cameraAnimation:function(C){return C.easeTo({duration:300,zoom:C.getZoom()-1,around:C.unproject(w)},{originalEvent:h})}}):void 0},ga.prototype.touchcancel=function(){this.reset()},ga.prototype.enable=function(){this._enabled=!0},ga.prototype.disable=function(){this._enabled=!1,this.reset()},ga.prototype.isEnabled=function(){return this._enabled},ga.prototype.isActive=function(){return this._active};var Th={0:1,2:2},qr=function(h){this.reset(),this._clickTolerance=h.clickTolerance||1};qr.prototype.blur=function(){this.reset()},qr.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},qr.prototype._correctButton=function(h,d){return!1},qr.prototype._move=function(h,d){return{}},qr.prototype.mousedown=function(h,d){if(!this._lastPoint){var p=U.mouseButton(h);this._correctButton(h,p)&&(this._lastPoint=d,this._eventButton=p)}},qr.prototype.mousemoveWindow=function(h,d){var p=this._lastPoint;if(p){if(h.preventDefault(),function(g,S){var w=Th[S];return g.buttons===void 0||(g.buttons&w)!==w}(h,this._eventButton))this.reset();else if(this._moved||!(d.dist(p)<this._clickTolerance))return this._moved=!0,this._lastPoint=d,this._move(p,d)}},qr.prototype.mouseupWindow=function(h){this._lastPoint&&U.mouseButton(h)===this._eventButton&&(this._moved&&U.suppressClick(),this.reset())},qr.prototype.enable=function(){this._enabled=!0},qr.prototype.disable=function(){this._enabled=!1,this.reset()},qr.prototype.isEnabled=function(){return this._enabled},qr.prototype.isActive=function(){return this._active};var ol=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.mousedown=function(p,g){h.prototype.mousedown.call(this,p,g),this._lastPoint&&(this._active=!0)},d.prototype._correctButton=function(p,g){return g===0&&!p.ctrlKey},d.prototype._move=function(p,g){return{around:g,panDelta:g.sub(p)}},d}(qr),Dc=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype._correctButton=function(p,g){return g===0&&p.ctrlKey||g===2},d.prototype._move=function(p,g){var S=.8*(g.x-p.x);if(S)return this._active=!0,{bearingDelta:S}},d.prototype.contextmenu=function(p){p.preventDefault()},d}(qr),wh=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype._correctButton=function(p,g){return g===0&&p.ctrlKey||g===2},d.prototype._move=function(p,g){var S=-.5*(g.y-p.y);if(S)return this._active=!0,{pitchDelta:S}},d.prototype.contextmenu=function(p){p.preventDefault()},d}(qr),eu=function(h){this._minTouches=1,this._clickTolerance=h.clickTolerance||1,this.reset()};eu.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new _.Point(0,0)},eu.prototype.touchstart=function(h,d,p){return this._calculateTransform(h,d,p)},eu.prototype.touchmove=function(h,d,p){if(this._active&&!(p.length<this._minTouches))return h.preventDefault(),this._calculateTransform(h,d,p)},eu.prototype.touchend=function(h,d,p){this._calculateTransform(h,d,p),this._active&&p.length<this._minTouches&&this.reset()},eu.prototype.touchcancel=function(){this.reset()},eu.prototype._calculateTransform=function(h,d,p){p.length>0&&(this._active=!0);var g=uf(p,d),S=new _.Point(0,0),w=new _.Point(0,0),C=0;for(var P in g){var Z=g[P],Y=this._touches[P];Y&&(S._add(Z),w._add(Z.sub(Y)),C++,g[P]=Z)}if(this._touches=g,!(C<this._minTouches)&&w.mag()){var pe=w.div(C);if(this._sum._add(pe),!(this._sum.mag()<this._clickTolerance))return{around:S.div(C),panDelta:pe}}},eu.prototype.enable=function(){this._enabled=!0},eu.prototype.disable=function(){this._enabled=!1,this.reset()},eu.prototype.isEnabled=function(){return this._enabled},eu.prototype.isActive=function(){return this._active};var Bs=function(){this.reset()};function Nf(h,d,p){for(var g=0;g<h.length;g++)if(h[g].identifier===p)return d[g]}function Uf(h,d){return Math.log(h/d)/Math.LN2}Bs.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Bs.prototype._start=function(h){},Bs.prototype._move=function(h,d,p){return{}},Bs.prototype.touchstart=function(h,d,p){this._firstTwoTouches||p.length<2||(this._firstTwoTouches=[p[0].identifier,p[1].identifier],this._start([d[0],d[1]]))},Bs.prototype.touchmove=function(h,d,p){if(this._firstTwoTouches){h.preventDefault();var g=this._firstTwoTouches,S=g[1],w=Nf(p,d,g[0]),C=Nf(p,d,S);if(w&&C){var P=this._aroundCenter?null:w.add(C).div(2);return this._move([w,C],P,h)}}},Bs.prototype.touchend=function(h,d,p){if(this._firstTwoTouches){var g=this._firstTwoTouches,S=g[1],w=Nf(p,d,g[0]),C=Nf(p,d,S);w&&C||(this._active&&U.suppressClick(),this.reset())}},Bs.prototype.touchcancel=function(){this.reset()},Bs.prototype.enable=function(h){this._enabled=!0,this._aroundCenter=!!h&&h.around==="center"},Bs.prototype.disable=function(){this._enabled=!1,this.reset()},Bs.prototype.isEnabled=function(){return this._enabled},Bs.prototype.isActive=function(){return this._active};var Yo=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.reset=function(){h.prototype.reset.call(this),delete this._distance,delete this._startDistance},d.prototype._start=function(p){this._startDistance=this._distance=p[0].dist(p[1])},d.prototype._move=function(p,g){var S=this._distance;if(this._distance=p[0].dist(p[1]),this._active||!(Math.abs(Uf(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Uf(this._distance,S),pinchAround:g}},d}(Bs);function Lu(h,d){return 180*h.angleWith(d)/Math.PI}var sp=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.reset=function(){h.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},d.prototype._start=function(p){this._startVector=this._vector=p[0].sub(p[1]),this._minDiameter=p[0].dist(p[1])},d.prototype._move=function(p,g){var S=this._vector;if(this._vector=p[0].sub(p[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Lu(this._vector,S),pinchAround:g}},d.prototype._isBelowThreshold=function(p){this._minDiameter=Math.min(this._minDiameter,p.mag());var g=25/(Math.PI*this._minDiameter)*360,S=Lu(p,this._startVector);return Math.abs(S)<g},d}(Bs);function Il(h){return Math.abs(h.y)>Math.abs(h.x)}var lf=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.reset=function(){h.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},d.prototype._start=function(p){this._lastPoints=p,Il(p[0].sub(p[1]))&&(this._valid=!1)},d.prototype._move=function(p,g,S){var w=p[0].sub(this._lastPoints[0]),C=p[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(w,C,S.timeStamp),this._valid)return this._lastPoints=p,this._active=!0,{pitchDelta:(w.y+C.y)/2*-.5}},d.prototype.gestureBeginsVertically=function(p,g,S){if(this._valid!==void 0)return this._valid;var w=p.mag()>=2,C=g.mag()>=2;if(w||C){if(!w||!C)return this._firstMove===void 0&&(this._firstMove=S),S-this._firstMove<100&&void 0;var P=p.y>0==g.y>0;return Il(p)&&Il(g)&&P}},d}(Bs),up={panStep:100,bearingStep:15,pitchStep:10},Pt=function(){var h=up;this._panStep=h.panStep,this._bearingStep=h.bearingStep,this._pitchStep=h.pitchStep,this._rotationDisabled=!1};function Fe(h){return h*(2-h)}Pt.prototype.blur=function(){this.reset()},Pt.prototype.reset=function(){this._active=!1},Pt.prototype.keydown=function(h){var d=this;if(!(h.altKey||h.ctrlKey||h.metaKey)){var p=0,g=0,S=0,w=0,C=0;switch(h.keyCode){case 61:case 107:case 171:case 187:p=1;break;case 189:case 109:case 173:p=-1;break;case 37:h.shiftKey?g=-1:(h.preventDefault(),w=-1);break;case 39:h.shiftKey?g=1:(h.preventDefault(),w=1);break;case 38:h.shiftKey?S=1:(h.preventDefault(),C=-1);break;case 40:h.shiftKey?S=-1:(h.preventDefault(),C=1);break;default:return}return this._rotationDisabled&&(g=0,S=0),{cameraAnimation:function(P){var Z=P.getZoom();P.easeTo({duration:300,easeId:"keyboardHandler",easing:Fe,zoom:p?Math.round(Z)+p*(h.shiftKey?2:1):Z,bearing:P.getBearing()+g*d._bearingStep,pitch:P.getPitch()+S*d._pitchStep,offset:[-w*d._panStep,-C*d._panStep],center:P.getCenter()},{originalEvent:h})}}}},Pt.prototype.enable=function(){this._enabled=!0},Pt.prototype.disable=function(){this._enabled=!1,this.reset()},Pt.prototype.isEnabled=function(){return this._enabled},Pt.prototype.isActive=function(){return this._active},Pt.prototype.disableRotation=function(){this._rotationDisabled=!0},Pt.prototype.enableRotation=function(){this._rotationDisabled=!1};var B=function(h,d){this._map=h,this._el=h.getCanvasContainer(),this._handler=d,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,_.bindAll(["_onTimeout"],this)};B.prototype.setZoomRate=function(h){this._defaultZoomRate=h},B.prototype.setWheelZoomRate=function(h){this._wheelZoomRate=h},B.prototype.isEnabled=function(){return!!this._enabled},B.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},B.prototype.isZooming=function(){return!!this._zooming},B.prototype.enable=function(h){this.isEnabled()||(this._enabled=!0,this._aroundCenter=h&&h.around==="center")},B.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},B.prototype.wheel=function(h){if(this.isEnabled()){var d=h.deltaMode===_.window.WheelEvent.DOM_DELTA_LINE?40*h.deltaY:h.deltaY,p=_.browser.now(),g=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,d!==0&&d%4.000244140625==0?this._type="wheel":d!==0&&Math.abs(d)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=d,this._timeout=setTimeout(this._onTimeout,40,h)):this._type||(this._type=Math.abs(g*d)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,d+=this._lastValue)),h.shiftKey&&d&&(d/=4),this._type&&(this._lastWheelEvent=h,this._delta-=d,this._active||this._start(h)),h.preventDefault()}},B.prototype._onTimeout=function(h){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(h)},B.prototype._start=function(h){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var d=U.mousePos(this._el,h);this._around=_.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(d)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},B.prototype.renderFrame=function(){var h=this;if(this._frameId&&(this._frameId=null,this.isActive())){var d=this._map.transform;if(this._delta!==0){var p=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,g=2/(1+Math.exp(-Math.abs(this._delta*p)));this._delta<0&&g!==0&&(g=1/g);var S=typeof this._targetZoom=="number"?d.zoomScale(this._targetZoom):d.scale;this._targetZoom=Math.min(d.maxZoom,Math.max(d.minZoom,d.scaleZoom(S*g))),this._type==="wheel"&&(this._startZoom=d.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var w,C=typeof this._targetZoom=="number"?this._targetZoom:d.zoom,P=this._startZoom,Z=this._easing,Y=!1;if(this._type==="wheel"&&P&&Z){var pe=Math.min((_.browser.now()-this._lastWheelEventTime)/200,1),_e=Z(pe);w=_.number(P,C,_e),pe<1?this._frameId||(this._frameId=!0):Y=!0}else w=C,Y=!0;return this._active=!0,Y&&(this._active=!1,this._finishTimeout=setTimeout(function(){h._zooming=!1,h._handler._triggerRenderFrame(),delete h._targetZoom,delete h._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!Y,zoomDelta:w-d.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},B.prototype._smoothOutEasing=function(h){var d=_.ease;if(this._prevEase){var p=this._prevEase,g=(_.browser.now()-p.start)/p.duration,S=p.easing(g+.01)-p.easing(g),w=.27/Math.sqrt(S*S+1e-4)*.01,C=Math.sqrt(.0729-w*w);d=_.bezier(w,C,.25,1)}return this._prevEase={start:_.browser.now(),duration:h,easing:d},d},B.prototype.blur=function(){this.reset()},B.prototype.reset=function(){this._active=!1};var qs=function(h,d){this._clickZoom=h,this._tapZoom=d};qs.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},qs.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},qs.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},qs.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ge=function(){this.reset()};ge.prototype.reset=function(){this._active=!1},ge.prototype.blur=function(){this.reset()},ge.prototype.dblclick=function(h,d){return h.preventDefault(),{cameraAnimation:function(p){p.easeTo({duration:300,zoom:p.getZoom()+(h.shiftKey?-1:1),around:p.unproject(d)},{originalEvent:h})}}},ge.prototype.enable=function(){this._enabled=!0},ge.prototype.disable=function(){this._enabled=!1,this.reset()},ge.prototype.isEnabled=function(){return this._enabled},ge.prototype.isActive=function(){return this._active};var Bo=function(){this._tap=new us({numTouches:1,numTaps:1}),this.reset()};Bo.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Bo.prototype.touchstart=function(h,d,p){this._swipePoint||(this._tapTime&&h.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?p.length>0&&(this._swipePoint=d[0],this._swipeTouch=p[0].identifier):this._tap.touchstart(h,d,p))},Bo.prototype.touchmove=function(h,d,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;var g=d[0],S=g.y-this._swipePoint.y;return this._swipePoint=g,h.preventDefault(),this._active=!0,{zoomDelta:S/128}}}else this._tap.touchmove(h,d,p)},Bo.prototype.touchend=function(h,d,p){this._tapTime?this._swipePoint&&p.length===0&&this.reset():this._tap.touchend(h,d,p)&&(this._tapTime=h.timeStamp)},Bo.prototype.touchcancel=function(){this.reset()},Bo.prototype.enable=function(){this._enabled=!0},Bo.prototype.disable=function(){this._enabled=!1,this.reset()},Bo.prototype.isEnabled=function(){return this._enabled},Bo.prototype.isActive=function(){return this._active};var io=function(h,d,p){this._el=h,this._mousePan=d,this._touchPan=p};io.prototype.enable=function(h){this._inertiaOptions=h||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},io.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},io.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},io.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var vu=function(h,d,p){this._pitchWithRotate=h.pitchWithRotate,this._mouseRotate=d,this._mousePitch=p};vu.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},vu.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},vu.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},vu.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var bs=function(h,d,p,g){this._el=h,this._touchZoom=d,this._touchRotate=p,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0};bs.prototype.enable=function(h){this._touchZoom.enable(h),this._rotationDisabled||this._touchRotate.enable(h),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},bs.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},bs.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},bs.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},bs.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},bs.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Da=function(h){return h.zoom||h.drag||h.pitch||h.rotate},nc=function(h){function d(){h.apply(this,arguments)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d}(_.Event);function kn(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta}var yn=function(h,d){this._map=h,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Lf(h),this._bearingSnap=d.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(d),_.bindAll(["handleEvent","handleWindowEvent"],this);var p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[_.window.document,"mousemove",{capture:!0}],[_.window.document,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[_.window,"blur",void 0]];for(var g=0,S=this._listeners;g<S.length;g+=1){var w=S[g],C=w[0];U.addEventListener(C,w[1],C===_.window.document?this.handleWindowEvent:this.handleEvent,w[2])}};yn.prototype.destroy=function(){for(var h=0,d=this._listeners;h<d.length;h+=1){var p=d[h],g=p[0];U.removeEventListener(g,p[1],g===_.window.document?this.handleWindowEvent:this.handleEvent,p[2])}},yn.prototype._addDefaultHandlers=function(h){var d=this._map,p=d.getCanvasContainer();this._add("mapEvent",new Ka(d,h));var g=d.boxZoom=new ks(d,h);this._add("boxZoom",g);var S=new ga,w=new ge;d.doubleClickZoom=new qs(w,S),this._add("tapZoom",S),this._add("clickZoom",w);var C=new Bo;this._add("tapDragZoom",C);var P=d.touchPitch=new lf;this._add("touchPitch",P);var Z=new Dc(h),Y=new wh(h);d.dragRotate=new vu(h,Z,Y),this._add("mouseRotate",Z,["mousePitch"]),this._add("mousePitch",Y,["mouseRotate"]);var pe=new ol(h),_e=new eu(h);d.dragPan=new io(p,pe,_e),this._add("mousePan",pe),this._add("touchPan",_e,["touchZoom","touchRotate"]);var ye=new sp,Ue=new Yo;d.touchZoomRotate=new bs(p,Ue,ye,C),this._add("touchRotate",ye,["touchPan","touchZoom"]),this._add("touchZoom",Ue,["touchPan","touchRotate"]);var ke=d.scrollZoom=new B(d,this);this._add("scrollZoom",ke,["mousePan"]);var Ke=d.keyboard=new Pt;this._add("keyboard",Ke),this._add("blockableMapEvent",new _n(d));for(var Ie=0,$e=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];Ie<$e.length;Ie+=1){var vt=$e[Ie];h.interactive&&h[vt]&&d[vt].enable(h[vt])}},yn.prototype._add=function(h,d,p){this._handlers.push({handlerName:h,handler:d,allowed:p}),this._handlersById[h]=d},yn.prototype.stop=function(h){if(!this._updatingCamera){for(var d=0,p=this._handlers;d<p.length;d+=1)p[d].handler.reset();this._inertia.clear(),this._fireEvents({},{},h),this._changes=[]}},yn.prototype.isActive=function(){for(var h=0,d=this._handlers;h<d.length;h+=1)if(d[h].handler.isActive())return!0;return!1},yn.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},yn.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},yn.prototype.isMoving=function(){return!!Da(this._eventsInProgress)||this.isZooming()},yn.prototype._blockedByActive=function(h,d,p){for(var g in h)if(g!==p&&(!d||d.indexOf(g)<0))return!0;return!1},yn.prototype.handleWindowEvent=function(h){this.handleEvent(h,h.type+"Window")},yn.prototype._getMapTouches=function(h){for(var d=[],p=0,g=h;p<g.length;p+=1){var S=g[p];this._el.contains(S.target)&&d.push(S)}return d},yn.prototype.handleEvent=function(h,d){this._updatingCamera=!0;for(var p=h.type==="renderFrame"?void 0:h,g={needsRenderFrame:!1},S={},w={},C=h.touches?this._getMapTouches(h.touches):void 0,P=C?U.touchPos(this._el,C):U.mousePos(this._el,h),Z=0,Y=this._handlers;Z<Y.length;Z+=1){var pe=Y[Z],_e=pe.handlerName,ye=pe.handler,Ue=pe.allowed;if(ye.isEnabled()){var ke=void 0;this._blockedByActive(w,Ue,_e)?ye.reset():ye[d||h.type]&&(ke=ye[d||h.type](h,P,C),this.mergeHandlerResult(g,S,ke,_e,p),ke&&ke.needsRenderFrame&&this._triggerRenderFrame()),(ke||ye.isActive())&&(w[_e]=ye)}}var Ke={};for(var Ie in this._previousActiveHandlers)w[Ie]||(Ke[Ie]=p);this._previousActiveHandlers=w,(Object.keys(Ke).length||kn(g))&&(this._changes.push([g,S,Ke]),this._triggerRenderFrame()),(Object.keys(w).length||kn(g))&&this._map._stop(!0),this._updatingCamera=!1;var $e=g.cameraAnimation;$e&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],$e(this._map))},yn.prototype.mergeHandlerResult=function(h,d,p,g,S){if(p){_.extend(h,p);var w={handlerName:g,originalEvent:p.originalEvent||S};p.zoomDelta!==void 0&&(d.zoom=w),p.panDelta!==void 0&&(d.drag=w),p.pitchDelta!==void 0&&(d.pitch=w),p.bearingDelta!==void 0&&(d.rotate=w)}},yn.prototype._applyChanges=function(){for(var h={},d={},p={},g=0,S=this._changes;g<S.length;g+=1){var w=S[g],C=w[0],P=w[1],Z=w[2];C.panDelta&&(h.panDelta=(h.panDelta||new _.Point(0,0))._add(C.panDelta)),C.zoomDelta&&(h.zoomDelta=(h.zoomDelta||0)+C.zoomDelta),C.bearingDelta&&(h.bearingDelta=(h.bearingDelta||0)+C.bearingDelta),C.pitchDelta&&(h.pitchDelta=(h.pitchDelta||0)+C.pitchDelta),C.around!==void 0&&(h.around=C.around),C.pinchAround!==void 0&&(h.pinchAround=C.pinchAround),C.noInertia&&(h.noInertia=C.noInertia),_.extend(d,P),_.extend(p,Z)}this._updateMapTransform(h,d,p),this._changes=[]},yn.prototype._updateMapTransform=function(h,d,p){var g=this._map,S=g.transform;if(!kn(h))return this._fireEvents(d,p,!0);var w=h.panDelta,C=h.zoomDelta,P=h.bearingDelta,Z=h.pitchDelta,Y=h.around,pe=h.pinchAround;pe!==void 0&&(Y=pe),g._stop(!0),Y=Y||g.transform.centerPoint;var _e=S.pointLocation(w?Y.sub(w):Y);P&&(S.bearing+=P),Z&&(S.pitch+=Z),C&&(S.zoom+=C),S.setLocationAtPoint(_e,Y),this._map._update(),h.noInertia||this._inertia.record(h),this._fireEvents(d,p,!0)},yn.prototype._fireEvents=function(h,d,p){var g=this,S=Da(this._eventsInProgress),w=Da(h),C={};for(var P in h)this._eventsInProgress[P]||(C[P+"start"]=h[P].originalEvent),this._eventsInProgress[P]=h[P];for(var Z in!S&&w&&this._fireEvent("movestart",w.originalEvent),C)this._fireEvent(Z,C[Z]);for(var Y in w&&this._fireEvent("move",w.originalEvent),h)this._fireEvent(Y,h[Y].originalEvent);var pe,_e={};for(var ye in this._eventsInProgress){var Ue=this._eventsInProgress[ye],ke=Ue.handlerName,Ke=Ue.originalEvent;this._handlersById[ke].isActive()||(delete this._eventsInProgress[ye],_e[ye+"end"]=pe=d[ke]||Ke)}for(var Ie in _e)this._fireEvent(Ie,_e[Ie]);var $e=Da(this._eventsInProgress);if(p&&(S||w)&&!$e){this._updatingCamera=!0;var vt=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Rt=function(Jt){return Jt!==0&&-g._bearingSnap<Jt&&Jt<g._bearingSnap};vt?(Rt(vt.bearing||this._map.getBearing())&&(vt.bearing=0),this._map.easeTo(vt,{originalEvent:pe})):(this._map.fire(new _.Event("moveend",{originalEvent:pe})),Rt(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},yn.prototype._fireEvent=function(h,d){this._map.fire(new _.Event(h,d?{originalEvent:d}:{}))},yn.prototype._requestFrame=function(){var h=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(d){delete h._frameId,h.handleEvent(new nc("renderFrame",{timeStamp:d})),h._applyChanges()})},yn.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var Ls=function(h){function d(p,g){h.call(this),this._moving=!1,this._zooming=!1,this.transform=p,this._bearingSnap=g.bearingSnap,_.bindAll(["_renderFrameCallback"],this)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.getCenter=function(){return new _.LngLat(this.transform.center.lng,this.transform.center.lat)},d.prototype.setCenter=function(p,g){return this.jumpTo({center:p},g)},d.prototype.panBy=function(p,g,S){return p=_.Point.convert(p).mult(-1),this.panTo(this.transform.center,_.extend({offset:p},g),S)},d.prototype.panTo=function(p,g,S){return this.easeTo(_.extend({center:p},g),S)},d.prototype.getZoom=function(){return this.transform.zoom},d.prototype.setZoom=function(p,g){return this.jumpTo({zoom:p},g),this},d.prototype.zoomTo=function(p,g,S){return this.easeTo(_.extend({zoom:p},g),S)},d.prototype.zoomIn=function(p,g){return this.zoomTo(this.getZoom()+1,p,g),this},d.prototype.zoomOut=function(p,g){return this.zoomTo(this.getZoom()-1,p,g),this},d.prototype.getBearing=function(){return this.transform.bearing},d.prototype.setBearing=function(p,g){return this.jumpTo({bearing:p},g),this},d.prototype.getPadding=function(){return this.transform.padding},d.prototype.setPadding=function(p,g){return this.jumpTo({padding:p},g),this},d.prototype.rotateTo=function(p,g,S){return this.easeTo(_.extend({bearing:p},g),S)},d.prototype.resetNorth=function(p,g){return this.rotateTo(0,_.extend({duration:1e3},p),g),this},d.prototype.resetNorthPitch=function(p,g){return this.easeTo(_.extend({bearing:0,pitch:0,duration:1e3},p),g),this},d.prototype.snapToNorth=function(p,g){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(p,g):this},d.prototype.getPitch=function(){return this.transform.pitch},d.prototype.setPitch=function(p,g){return this.jumpTo({pitch:p},g),this},d.prototype.cameraForBounds=function(p,g){p=_.LngLatBounds.convert(p);var S=g&&g.bearing||0;return this._cameraForBoxAndBearing(p.getNorthWest(),p.getSouthEast(),S,g)},d.prototype._cameraForBoxAndBearing=function(p,g,S,w){var C={top:0,bottom:0,right:0,left:0};if(typeof(w=_.extend({padding:C,offset:[0,0],maxZoom:this.transform.maxZoom},w)).padding=="number"){var P=w.padding;w.padding={top:P,bottom:P,right:P,left:P}}w.padding=_.extend(C,w.padding);var Z=this.transform,Y=Z.padding,pe=Z.project(_.LngLat.convert(p)),_e=Z.project(_.LngLat.convert(g)),ye=pe.rotate(-S*Math.PI/180),Ue=_e.rotate(-S*Math.PI/180),ke=new _.Point(Math.max(ye.x,Ue.x),Math.max(ye.y,Ue.y)),Ke=new _.Point(Math.min(ye.x,Ue.x),Math.min(ye.y,Ue.y)),Ie=ke.sub(Ke),$e=(Z.width-(Y.left+Y.right+w.padding.left+w.padding.right))/Ie.x,vt=(Z.height-(Y.top+Y.bottom+w.padding.top+w.padding.bottom))/Ie.y;if(!(vt<0||$e<0)){var Rt=Math.min(Z.scaleZoom(Z.scale*Math.min($e,vt)),w.maxZoom),Jt=typeof w.offset.x=="number"?new _.Point(w.offset.x,w.offset.y):_.Point.convert(w.offset),zt=new _.Point((w.padding.left-w.padding.right)/2,(w.padding.top-w.padding.bottom)/2).rotate(S*Math.PI/180),ar=Jt.add(zt).mult(Z.scale/Z.zoomScale(Rt));return{center:Z.unproject(pe.add(_e).div(2).sub(ar)),zoom:Rt,bearing:S}}_.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},d.prototype.fitBounds=function(p,g,S){return this._fitInternal(this.cameraForBounds(p,g),g,S)},d.prototype.fitScreenCoordinates=function(p,g,S,w,C){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(_.Point.convert(p)),this.transform.pointLocation(_.Point.convert(g)),S,w),w,C)},d.prototype._fitInternal=function(p,g,S){return p?(delete(g=_.extend(p,g)).padding,g.linear?this.easeTo(g,S):this.flyTo(g,S)):this},d.prototype.jumpTo=function(p,g){this.stop();var S=this.transform,w=!1,C=!1,P=!1;return"zoom"in p&&S.zoom!==+p.zoom&&(w=!0,S.zoom=+p.zoom),p.center!==void 0&&(S.center=_.LngLat.convert(p.center)),"bearing"in p&&S.bearing!==+p.bearing&&(C=!0,S.bearing=+p.bearing),"pitch"in p&&S.pitch!==+p.pitch&&(P=!0,S.pitch=+p.pitch),p.padding==null||S.isPaddingEqual(p.padding)||(S.padding=p.padding),this.fire(new _.Event("movestart",g)).fire(new _.Event("move",g)),w&&this.fire(new _.Event("zoomstart",g)).fire(new _.Event("zoom",g)).fire(new _.Event("zoomend",g)),C&&this.fire(new _.Event("rotatestart",g)).fire(new _.Event("rotate",g)).fire(new _.Event("rotateend",g)),P&&this.fire(new _.Event("pitchstart",g)).fire(new _.Event("pitch",g)).fire(new _.Event("pitchend",g)),this.fire(new _.Event("moveend",g))},d.prototype.easeTo=function(p,g){var S=this;this._stop(!1,p.easeId),((p=_.extend({offset:[0,0],duration:500,easing:_.ease},p)).animate===!1||!p.essential&&_.browser.prefersReducedMotion)&&(p.duration=0);var w=this.transform,C=this.getZoom(),P=this.getBearing(),Z=this.getPitch(),Y=this.getPadding(),pe="zoom"in p?+p.zoom:C,_e="bearing"in p?this._normalizeBearing(p.bearing,P):P,ye="pitch"in p?+p.pitch:Z,Ue="padding"in p?p.padding:w.padding,ke=_.Point.convert(p.offset),Ke=w.centerPoint.add(ke),Ie=w.pointLocation(Ke),$e=_.LngLat.convert(p.center||Ie);this._normalizeCenter($e);var vt,Rt,Jt=w.project(Ie),zt=w.project($e).sub(Jt),ar=w.zoomScale(pe-C);p.around&&(vt=_.LngLat.convert(p.around),Rt=w.locationPoint(vt));var _r={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||pe!==C,this._rotating=this._rotating||P!==_e,this._pitching=this._pitching||ye!==Z,this._padding=!w.isPaddingEqual(Ue),this._easeId=p.easeId,this._prepareEase(g,p.noMoveStart,_r),this._ease(function(Nr){if(S._zooming&&(w.zoom=_.number(C,pe,Nr)),S._rotating&&(w.bearing=_.number(P,_e,Nr)),S._pitching&&(w.pitch=_.number(Z,ye,Nr)),S._padding&&(w.interpolatePadding(Y,Ue,Nr),Ke=w.centerPoint.add(ke)),vt)w.setLocationAtPoint(vt,Rt);else{var kr=w.zoomScale(w.zoom-C),un=pe>C?Math.min(2,ar):Math.max(.5,ar),Pn=Math.pow(un,1-Nr),zn=w.unproject(Jt.add(zt.mult(Nr*Pn)).mult(kr));w.setLocationAtPoint(w.renderWorldCopies?zn.wrap():zn,Ke)}S._fireMoveEvents(g)},function(Nr){S._afterEase(g,Nr)},p),this},d.prototype._prepareEase=function(p,g,S){S===void 0&&(S={}),this._moving=!0,g||S.moving||this.fire(new _.Event("movestart",p)),this._zooming&&!S.zooming&&this.fire(new _.Event("zoomstart",p)),this._rotating&&!S.rotating&&this.fire(new _.Event("rotatestart",p)),this._pitching&&!S.pitching&&this.fire(new _.Event("pitchstart",p))},d.prototype._fireMoveEvents=function(p){this.fire(new _.Event("move",p)),this._zooming&&this.fire(new _.Event("zoom",p)),this._rotating&&this.fire(new _.Event("rotate",p)),this._pitching&&this.fire(new _.Event("pitch",p))},d.prototype._afterEase=function(p,g){if(!this._easeId||!g||this._easeId!==g){delete this._easeId;var S=this._zooming,w=this._rotating,C=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,S&&this.fire(new _.Event("zoomend",p)),w&&this.fire(new _.Event("rotateend",p)),C&&this.fire(new _.Event("pitchend",p)),this.fire(new _.Event("moveend",p))}},d.prototype.flyTo=function(p,g){var S=this;if(!p.essential&&_.browser.prefersReducedMotion){var w=_.pick(p,["center","zoom","bearing","pitch","around"]);return this.jumpTo(w,g)}this.stop(),p=_.extend({offset:[0,0],speed:1.2,curve:1.42,easing:_.ease},p);var C=this.transform,P=this.getZoom(),Z=this.getBearing(),Y=this.getPitch(),pe=this.getPadding(),_e="zoom"in p?_.clamp(+p.zoom,C.minZoom,C.maxZoom):P,ye="bearing"in p?this._normalizeBearing(p.bearing,Z):Z,Ue="pitch"in p?+p.pitch:Y,ke="padding"in p?p.padding:C.padding,Ke=C.zoomScale(_e-P),Ie=_.Point.convert(p.offset),$e=C.centerPoint.add(Ie),vt=C.pointLocation($e),Rt=_.LngLat.convert(p.center||vt);this._normalizeCenter(Rt);var Jt=C.project(vt),zt=C.project(Rt).sub(Jt),ar=p.curve,_r=Math.max(C.width,C.height),Nr=_r/Ke,kr=zt.mag();if("minZoom"in p){var un=_.clamp(Math.min(p.minZoom,P,_e),C.minZoom,C.maxZoom),Pn=_r/C.zoomScale(un-P);ar=Math.sqrt(Pn/kr*2)}var zn=ar*ar;function Zn(Jn){var Kn=(Nr*Nr-_r*_r+(Jn?-1:1)*zn*zn*kr*kr)/(2*(Jn?Nr:_r)*zn*kr);return Math.log(Math.sqrt(Kn*Kn+1)-Kn)}function Wi(Jn){return(Math.exp(Jn)-Math.exp(-Jn))/2}function vn(Jn){return(Math.exp(Jn)+Math.exp(-Jn))/2}var ei=Zn(0),_i=function(Jn){return vn(ei)/vn(ei+ar*Jn)},ri=function(Jn){return _r*((vn(ei)*(Wi(Kn=ei+ar*Jn)/vn(Kn))-Wi(ei))/zn)/kr;var Kn},qn=(Zn(1)-ei)/ar;if(Math.abs(kr)<1e-6||!isFinite(qn)){if(Math.abs(_r-Nr)<1e-6)return this.easeTo(p,g);var di=Nr<_r?-1:1;qn=Math.abs(Math.log(Nr/_r))/ar,ri=function(){return 0},_i=function(Jn){return Math.exp(di*ar*Jn)}}return p.duration="duration"in p?+p.duration:1e3*qn/("screenSpeed"in p?+p.screenSpeed/ar:+p.speed),p.maxDuration&&p.duration>p.maxDuration&&(p.duration=0),this._zooming=!0,this._rotating=Z!==ye,this._pitching=Ue!==Y,this._padding=!C.isPaddingEqual(ke),this._prepareEase(g,!1),this._ease(function(Jn){var Kn=Jn*qn,Co=1/_i(Kn);C.zoom=Jn===1?_e:P+C.scaleZoom(Co),S._rotating&&(C.bearing=_.number(Z,ye,Jn)),S._pitching&&(C.pitch=_.number(Y,Ue,Jn)),S._padding&&(C.interpolatePadding(pe,ke,Jn),$e=C.centerPoint.add(Ie));var Ua=Jn===1?Rt:C.unproject(Jt.add(zt.mult(ri(Kn))).mult(Co));C.setLocationAtPoint(C.renderWorldCopies?Ua.wrap():Ua,$e),S._fireMoveEvents(g)},function(){return S._afterEase(g)},p),this},d.prototype.isEasing=function(){return!!this._easeFrameId},d.prototype.stop=function(){return this._stop()},d.prototype._stop=function(p,g){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var S=this._onEaseEnd;delete this._onEaseEnd,S.call(this,g)}if(!p){var w=this.handlers;w&&w.stop(!1)}return this},d.prototype._ease=function(p,g,S){S.animate===!1||S.duration===0?(p(1),g()):(this._easeStart=_.browser.now(),this._easeOptions=S,this._onEaseFrame=p,this._onEaseEnd=g,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},d.prototype._renderFrameCallback=function(){var p=Math.min((_.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(p)),p<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},d.prototype._normalizeBearing=function(p,g){p=_.wrap(p,-180,180);var S=Math.abs(p-g);return Math.abs(p-360-g)<S&&(p-=360),Math.abs(p+360-g)<S&&(p+=360),p},d.prototype._normalizeCenter=function(p){var g=this.transform;if(g.renderWorldCopies&&!g.lngRange){var S=p.lng-g.center.lng;p.lng+=S>180?-360:S<-180?360:0}},d}(_.Evented),qo=function(h){h===void 0&&(h={}),this.options=h,_.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};qo.prototype.getDefaultPosition=function(){return"bottom-right"},qo.prototype.onAdd=function(h){var d=this.options&&this.options.compact;return this._map=h,this._container=U.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=U.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=U.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),d&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),d===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},qo.prototype.onRemove=function(){U.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},qo.prototype._setElementTitle=function(h,d){var p=this._map._getUIString("AttributionControl."+d);h.title=p,h.setAttribute("aria-label",p)},qo.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},qo.prototype._updateEditLink=function(){var h=this._editLink;h||(h=this._editLink=this._container.querySelector(".mapbox-improve-map"));var d=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||_.config.ACCESS_TOKEN}];if(h){var p=d.reduce(function(g,S,w){return S.value&&(g+=S.key+"="+S.value+(w<d.length-1?"&":"")),g},"?");h.href=_.config.FEEDBACK_URL+"/"+p+(this._map._hash?this._map._hash.getHashString(!0):""),h.rel="noopener nofollow",this._setElementTitle(h,"MapFeedback")}},qo.prototype._updateData=function(h){!h||h.sourceDataType!=="metadata"&&h.sourceDataType!=="visibility"&&h.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},qo.prototype._updateAttributions=function(){if(this._map.style){var h=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?h=h.concat(this.options.customAttribution.map(function(P){return typeof P!="string"?"":P})):typeof this.options.customAttribution=="string"&&h.push(this.options.customAttribution)),this._map.style.stylesheet){var d=this._map.style.stylesheet;this.styleOwner=d.owner,this.styleId=d.id}var p=this._map.style.sourceCaches;for(var g in p){var S=p[g];if(S.used){var w=S.getSource();w.attribution&&h.indexOf(w.attribution)<0&&h.push(w.attribution)}}h.sort(function(P,Z){return P.length-Z.length});var C=(h=h.filter(function(P,Z){for(var Y=Z+1;Y<h.length;Y++)if(h[Y].indexOf(P)>=0)return!1;return!0})).join(" | ");C!==this._attribHTML&&(this._attribHTML=C,h.length?(this._innerContainer.innerHTML=C,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},qo.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var mu=function(){_.bindAll(["_updateLogo"],this),_.bindAll(["_updateCompact"],this)};mu.prototype.onAdd=function(h){this._map=h,this._container=U.create("div","mapboxgl-ctrl");var d=U.create("a","mapboxgl-ctrl-logo");return d.target="_blank",d.rel="noopener nofollow",d.href="https://www.mapbox.com/",d.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),d.setAttribute("rel","noopener nofollow"),this._container.appendChild(d),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},mu.prototype.onRemove=function(){U.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},mu.prototype.getDefaultPosition=function(){return"bottom-left"},mu.prototype._updateLogo=function(h){h&&h.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},mu.prototype._logoRequired=function(){if(this._map.style){var h=this._map.style.sourceCaches;for(var d in h)if(h[d].getSource().mapbox_logo)return!0;return!1}},mu.prototype._updateCompact=function(){var h=this._container.children;if(h.length){var d=h[0];this._map.getCanvasContainer().offsetWidth<250?d.classList.add("mapboxgl-compact"):d.classList.remove("mapboxgl-compact")}};var Fa=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Fa.prototype.add=function(h){var d=++this._id;return this._queue.push({callback:h,id:d,cancelled:!1}),d},Fa.prototype.remove=function(h){for(var d=this._currentlyRunning,p=0,g=d?this._queue.concat(d):this._queue;p<g.length;p+=1){var S=g[p];if(S.id===h)return void(S.cancelled=!0)}},Fa.prototype.run=function(h){h===void 0&&(h=0);var d=this._currentlyRunning=this._queue;this._queue=[];for(var p=0,g=d;p<g.length;p+=1){var S=g[p];if(!S.cancelled&&(S.callback(h),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Fa.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Ns={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},Ks=_.window.HTMLImageElement,Fc=_.window.HTMLElement,ra=_.window.ImageBitmap,wo={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Ch=function(h){function d(g){var S=this;if((g=_.extend({},wo,g)).minZoom!=null&&g.maxZoom!=null&&g.minZoom>g.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(g.minPitch!=null&&g.maxPitch!=null&&g.minPitch>g.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(g.minPitch!=null&&g.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(g.maxPitch!=null&&g.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var w=new Li(g.minZoom,g.maxZoom,g.minPitch,g.maxPitch,g.renderWorldCopies);if(h.call(this,w,g),this._interactive=g.interactive,this._maxTileCacheSize=g.maxTileCacheSize,this._failIfMajorPerformanceCaveat=g.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=g.preserveDrawingBuffer,this._antialias=g.antialias,this._trackResize=g.trackResize,this._bearingSnap=g.bearingSnap,this._refreshExpiredTiles=g.refreshExpiredTiles,this._fadeDuration=g.fadeDuration,this._crossSourceCollisions=g.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=g.collectResourceTiming,this._renderTaskQueue=new Fa,this._controls=[],this._mapId=_.uniqueId(),this._locale=_.extend({},Ns,g.locale),this._clickTolerance=g.clickTolerance,this._requestManager=new _.RequestManager(g.transformRequest,g.accessToken),typeof g.container=="string"){if(this._container=_.window.document.getElementById(g.container),!this._container)throw new Error("Container '"+g.container+"' not found.")}else{if(!(g.container instanceof Fc))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=g.container}if(g.maxBounds&&this.setMaxBounds(g.maxBounds),_.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return S._update(!1)}),this.on("moveend",function(){return S._update(!1)}),this.on("zoom",function(){return S._update(!0)}),_.window!==void 0&&(_.window.addEventListener("online",this._onWindowOnline,!1),_.window.addEventListener("resize",this._onWindowResize,!1),_.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new yn(this,g),this._hash=g.hash&&new Ys(typeof g.hash=="string"&&g.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch}),g.bounds&&(this.resize(),this.fitBounds(g.bounds,_.extend({},g.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=g.localIdeographFontFamily,g.style&&this.setStyle(g.style,{localIdeographFontFamily:g.localIdeographFontFamily}),g.attributionControl&&this.addControl(new qo({customAttribution:g.customAttribution})),this.addControl(new mu,g.logoPosition),this.on("style.load",function(){S.transform.unmodified&&S.jumpTo(S.style.stylesheet)}),this.on("data",function(C){S._update(C.dataType==="style"),S.fire(new _.Event(C.dataType+"data",C))}),this.on("dataloading",function(C){S.fire(new _.Event(C.dataType+"dataloading",C))})}h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d;var p={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return d.prototype._getMapId=function(){return this._mapId},d.prototype.addControl=function(g,S){if(S===void 0&&(S=g.getDefaultPosition?g.getDefaultPosition():"top-right"),!g||!g.onAdd)return this.fire(new _.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var w=g.onAdd(this);this._controls.push(g);var C=this._controlPositions[S];return S.indexOf("bottom")!==-1?C.insertBefore(w,C.firstChild):C.appendChild(w),this},d.prototype.removeControl=function(g){if(!g||!g.onRemove)return this.fire(new _.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var S=this._controls.indexOf(g);return S>-1&&this._controls.splice(S,1),g.onRemove(this),this},d.prototype.hasControl=function(g){return this._controls.indexOf(g)>-1},d.prototype.resize=function(g){var S=this._containerDimensions(),w=S[0],C=S[1];if(w===this.transform.width&&C===this.transform.height)return this;this._resizeCanvas(w,C),this.transform.resize(w,C),this.painter.resize(w,C);var P=!this._moving;return P&&this.fire(new _.Event("movestart",g)).fire(new _.Event("move",g)),this.fire(new _.Event("resize",g)),P&&this.fire(new _.Event("moveend",g)),this},d.prototype.getBounds=function(){return this.transform.getBounds()},d.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},d.prototype.setMaxBounds=function(g){return this.transform.setMaxBounds(_.LngLatBounds.convert(g)),this._update()},d.prototype.setMinZoom=function(g){if((g=g==null?-2:g)>=-2&&g<=this.transform.maxZoom)return this.transform.minZoom=g,this._update(),this.getZoom()<g&&this.setZoom(g),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},d.prototype.getMinZoom=function(){return this.transform.minZoom},d.prototype.setMaxZoom=function(g){if((g=g==null?22:g)>=this.transform.minZoom)return this.transform.maxZoom=g,this._update(),this.getZoom()>g&&this.setZoom(g),this;throw new Error("maxZoom must be greater than the current minZoom")},d.prototype.getMaxZoom=function(){return this.transform.maxZoom},d.prototype.setMinPitch=function(g){if((g=g==null?0:g)<0)throw new Error("minPitch must be greater than or equal to 0");if(g>=0&&g<=this.transform.maxPitch)return this.transform.minPitch=g,this._update(),this.getPitch()<g&&this.setPitch(g),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},d.prototype.getMinPitch=function(){return this.transform.minPitch},d.prototype.setMaxPitch=function(g){if((g=g==null?60:g)>60)throw new Error("maxPitch must be less than or equal to 60");if(g>=this.transform.minPitch)return this.transform.maxPitch=g,this._update(),this.getPitch()>g&&this.setPitch(g),this;throw new Error("maxPitch must be greater than the current minPitch")},d.prototype.getMaxPitch=function(){return this.transform.maxPitch},d.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},d.prototype.setRenderWorldCopies=function(g){return this.transform.renderWorldCopies=g,this._update()},d.prototype.project=function(g){return this.transform.locationPoint(_.LngLat.convert(g))},d.prototype.unproject=function(g){return this.transform.pointLocation(_.Point.convert(g))},d.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},d.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},d.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},d.prototype._createDelegatedListener=function(g,S,w){var C,P=this;if(g==="mouseenter"||g==="mouseover"){var Z=!1;return{layer:S,listener:w,delegates:{mousemove:function(pe){var _e=P.getLayer(S)?P.queryRenderedFeatures(pe.point,{layers:[S]}):[];_e.length?Z||(Z=!0,w.call(P,new Wa(g,P,pe.originalEvent,{features:_e}))):Z=!1},mouseout:function(){Z=!1}}}}if(g==="mouseleave"||g==="mouseout"){var Y=!1;return{layer:S,listener:w,delegates:{mousemove:function(pe){(P.getLayer(S)?P.queryRenderedFeatures(pe.point,{layers:[S]}):[]).length?Y=!0:Y&&(Y=!1,w.call(P,new Wa(g,P,pe.originalEvent)))},mouseout:function(pe){Y&&(Y=!1,w.call(P,new Wa(g,P,pe.originalEvent)))}}}}return{layer:S,listener:w,delegates:(C={},C[g]=function(pe){var _e=P.getLayer(S)?P.queryRenderedFeatures(pe.point,{layers:[S]}):[];_e.length&&(pe.features=_e,w.call(P,pe),delete pe.features)},C)}},d.prototype.on=function(g,S,w){if(w===void 0)return h.prototype.on.call(this,g,S);var C=this._createDelegatedListener(g,S,w);for(var P in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[g]=this._delegatedListeners[g]||[],this._delegatedListeners[g].push(C),C.delegates)this.on(P,C.delegates[P]);return this},d.prototype.once=function(g,S,w){if(w===void 0)return h.prototype.once.call(this,g,S);var C=this._createDelegatedListener(g,S,w);for(var P in C.delegates)this.once(P,C.delegates[P]);return this},d.prototype.off=function(g,S,w){var C=this;return w===void 0?h.prototype.off.call(this,g,S):(this._delegatedListeners&&this._delegatedListeners[g]&&function(P){for(var Z=P[g],Y=0;Y<Z.length;Y++){var pe=Z[Y];if(pe.layer===S&&pe.listener===w){for(var _e in pe.delegates)C.off(_e,pe.delegates[_e]);return Z.splice(Y,1),C}}}(this._delegatedListeners),this)},d.prototype.queryRenderedFeatures=function(g,S){if(!this.style)return[];var w;if(S!==void 0||g===void 0||g instanceof _.Point||Array.isArray(g)||(S=g,g=void 0),S=S||{},(g=g||[[0,0],[this.transform.width,this.transform.height]])instanceof _.Point||typeof g[0]=="number")w=[_.Point.convert(g)];else{var C=_.Point.convert(g[0]),P=_.Point.convert(g[1]);w=[C,new _.Point(P.x,C.y),P,new _.Point(C.x,P.y),C]}return this.style.queryRenderedFeatures(w,S,this.transform)},d.prototype.querySourceFeatures=function(g,S){return this.style.querySourceFeatures(g,S)},d.prototype.setStyle=function(g,S){return(S=_.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},S)).diff!==!1&&S.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&g?(this._diffStyle(g,S),this):(this._localIdeographFontFamily=S.localIdeographFontFamily,this._updateStyle(g,S))},d.prototype._getUIString=function(g){var S=this._locale[g];if(S==null)throw new Error("Missing UI string '"+g+"'");return S},d.prototype._updateStyle=function(g,S){return this.style&&(this.style.setEventedParent(null),this.style._remove()),g?(this.style=new Os(this,S||{}),this.style.setEventedParent(this,{style:this.style}),typeof g=="string"?this.style.loadURL(g):this.style.loadJSON(g),this):(delete this.style,this)},d.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Os(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},d.prototype._diffStyle=function(g,S){var w=this;if(typeof g=="string"){var C=this._requestManager.normalizeStyleURL(g),P=this._requestManager.transformRequest(C,_.ResourceType.Style);_.getJSON(P,function(Z,Y){Z?w.fire(new _.ErrorEvent(Z)):Y&&w._updateDiff(Y,S)})}else typeof g=="object"&&this._updateDiff(g,S)},d.prototype._updateDiff=function(g,S){try{this.style.setState(g)&&this._update(!0)}catch(w){_.warnOnce("Unable to perform style diff: "+(w.message||w.error||w)+". Rebuilding the style from scratch."),this._updateStyle(g,S)}},d.prototype.getStyle=function(){if(this.style)return this.style.serialize()},d.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():_.warnOnce("There is no style added to the map.")},d.prototype.addSource=function(g,S){return this._lazyInitEmptyStyle(),this.style.addSource(g,S),this._update(!0)},d.prototype.isSourceLoaded=function(g){var S=this.style&&this.style.sourceCaches[g];if(S!==void 0)return S.loaded();this.fire(new _.ErrorEvent(new Error("There is no source with ID '"+g+"'")))},d.prototype.areTilesLoaded=function(){var g=this.style&&this.style.sourceCaches;for(var S in g){var w=g[S]._tiles;for(var C in w){var P=w[C];if(P.state!=="loaded"&&P.state!=="errored")return!1}}return!0},d.prototype.addSourceType=function(g,S,w){return this._lazyInitEmptyStyle(),this.style.addSourceType(g,S,w)},d.prototype.removeSource=function(g){return this.style.removeSource(g),this._update(!0)},d.prototype.getSource=function(g){return this.style.getSource(g)},d.prototype.addImage=function(g,S,w){w===void 0&&(w={});var C=w.pixelRatio;C===void 0&&(C=1);var P=w.sdf;P===void 0&&(P=!1);var Z=w.stretchX,Y=w.stretchY,pe=w.content;if(this._lazyInitEmptyStyle(),S instanceof Ks||ra&&S instanceof ra){var _e=_.browser.getImageData(S);this.style.addImage(g,{data:new _.RGBAImage({width:_e.width,height:_e.height},_e.data),pixelRatio:C,stretchX:Z,stretchY:Y,content:pe,sdf:P,version:0})}else{if(S.width===void 0||S.height===void 0)return this.fire(new _.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var ye=S;this.style.addImage(g,{data:new _.RGBAImage({width:S.width,height:S.height},new Uint8Array(S.data)),pixelRatio:C,stretchX:Z,stretchY:Y,content:pe,sdf:P,version:0,userImage:ye}),ye.onAdd&&ye.onAdd(this,g)}},d.prototype.updateImage=function(g,S){var w=this.style.getImage(g);if(!w)return this.fire(new _.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var C=S instanceof Ks||ra&&S instanceof ra?_.browser.getImageData(S):S,P=C.width,Z=C.height,Y=C.data;return P===void 0||Z===void 0?this.fire(new _.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):P!==w.data.width||Z!==w.data.height?this.fire(new _.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(w.data.replace(Y,!(S instanceof Ks||ra&&S instanceof ra)),void this.style.updateImage(g,w))},d.prototype.hasImage=function(g){return g?!!this.style.getImage(g):(this.fire(new _.ErrorEvent(new Error("Missing required image id"))),!1)},d.prototype.removeImage=function(g){this.style.removeImage(g)},d.prototype.loadImage=function(g,S){_.getImage(this._requestManager.transformRequest(g,_.ResourceType.Image),S)},d.prototype.listImages=function(){return this.style.listImages()},d.prototype.addLayer=function(g,S){return this._lazyInitEmptyStyle(),this.style.addLayer(g,S),this._update(!0)},d.prototype.moveLayer=function(g,S){return this.style.moveLayer(g,S),this._update(!0)},d.prototype.removeLayer=function(g){return this.style.removeLayer(g),this._update(!0)},d.prototype.getLayer=function(g){return this.style.getLayer(g)},d.prototype.setLayerZoomRange=function(g,S,w){return this.style.setLayerZoomRange(g,S,w),this._update(!0)},d.prototype.setFilter=function(g,S,w){return w===void 0&&(w={}),this.style.setFilter(g,S,w),this._update(!0)},d.prototype.getFilter=function(g){return this.style.getFilter(g)},d.prototype.setPaintProperty=function(g,S,w,C){return C===void 0&&(C={}),this.style.setPaintProperty(g,S,w,C),this._update(!0)},d.prototype.getPaintProperty=function(g,S){return this.style.getPaintProperty(g,S)},d.prototype.setLayoutProperty=function(g,S,w,C){return C===void 0&&(C={}),this.style.setLayoutProperty(g,S,w,C),this._update(!0)},d.prototype.getLayoutProperty=function(g,S){return this.style.getLayoutProperty(g,S)},d.prototype.setLight=function(g,S){return S===void 0&&(S={}),this._lazyInitEmptyStyle(),this.style.setLight(g,S),this._update(!0)},d.prototype.getLight=function(){return this.style.getLight()},d.prototype.setFeatureState=function(g,S){return this.style.setFeatureState(g,S),this._update()},d.prototype.removeFeatureState=function(g,S){return this.style.removeFeatureState(g,S),this._update()},d.prototype.getFeatureState=function(g){return this.style.getFeatureState(g)},d.prototype.getContainer=function(){return this._container},d.prototype.getCanvasContainer=function(){return this._canvasContainer},d.prototype.getCanvas=function(){return this._canvas},d.prototype._containerDimensions=function(){var g=0,S=0;return this._container&&(g=this._container.clientWidth||400,S=this._container.clientHeight||300),[g,S]},d.prototype._detectMissingCSS=function(){_.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&_.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},d.prototype._setupContainer=function(){var g=this._container;g.classList.add("mapboxgl-map"),(this._missingCSSCanary=U.create("div","mapboxgl-canary",g)).style.visibility="hidden",this._detectMissingCSS();var S=this._canvasContainer=U.create("div","mapboxgl-canvas-container",g);this._interactive&&S.classList.add("mapboxgl-interactive"),this._canvas=U.create("canvas","mapboxgl-canvas",S),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var w=this._containerDimensions();this._resizeCanvas(w[0],w[1]);var C=this._controlContainer=U.create("div","mapboxgl-control-container",g),P=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(Z){P[Z]=U.create("div","mapboxgl-ctrl-"+Z,C)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},d.prototype._resizeCanvas=function(g,S){var w=_.browser.devicePixelRatio||1;this._canvas.width=w*g,this._canvas.height=w*S,this._canvas.style.width=g+"px",this._canvas.style.height=S+"px"},d.prototype._setupPainter=function(){var g=_.extend({},le.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),S=this._canvas.getContext("webgl",g)||this._canvas.getContext("experimental-webgl",g);S?(this.painter=new pa(S,this.transform),_.webpSupported.testSupport(S)):this.fire(new _.ErrorEvent(new Error("Failed to initialize WebGL")))},d.prototype._contextLost=function(g){g.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new _.Event("webglcontextlost",{originalEvent:g}))},d.prototype._contextRestored=function(g){this._setupPainter(),this.resize(),this._update(),this.fire(new _.Event("webglcontextrestored",{originalEvent:g}))},d.prototype._onMapScroll=function(g){if(g.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},d.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},d.prototype._update=function(g){return this.style?(this._styleDirty=this._styleDirty||g,this._sourcesDirty=!0,this.triggerRepaint(),this):this},d.prototype._requestRenderFrame=function(g){return this._update(),this._renderTaskQueue.add(g)},d.prototype._cancelRenderFrame=function(g){this._renderTaskQueue.remove(g)},d.prototype._render=function(g){var S,w=this,C=0,P=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(S=P.createQueryEXT(),P.beginQueryEXT(P.TIME_ELAPSED_EXT,S),C=_.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(g),!this._removed){var Z=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var Y=this.transform.zoom,pe=_.browser.now();this.style.zoomHistory.update(Y,pe);var _e=new _.EvaluationParameters(Y,{now:pe,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),ye=_e.crossFadingFactor();ye===1&&ye===this._crossFadingFactor||(Z=!0,this._crossFadingFactor=ye),this.style.update(_e)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new _.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new _.Event("load"))),this.style&&(this.style.hasTransitions()||Z)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var Ue=_.browser.now()-C;P.endQueryEXT(P.TIME_ELAPSED_EXT,S),setTimeout(function(){var Ie=P.getQueryObjectEXT(S,P.QUERY_RESULT_EXT)/1e6;P.deleteQueryEXT(S),w.fire(new _.Event("gpu-timing-frame",{cpuTime:Ue,gpuTime:Ie}))},50)}if(this.listens("gpu-timing-layer")){var ke=this.painter.collectGpuTimers();setTimeout(function(){var Ie=w.painter.queryGpuTimers(ke);w.fire(new _.Event("gpu-timing-layer",{layerTimes:Ie}))},50)}var Ke=this._sourcesDirty||this._styleDirty||this._placementDirty;return Ke||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new _.Event("idle")),!this._loaded||this._fullyLoaded||Ke||(this._fullyLoaded=!0),this}},d.prototype.remove=function(){this._hash&&this._hash.remove();for(var g=0,S=this._controls;g<S.length;g+=1)S[g].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),_.window!==void 0&&(_.window.removeEventListener("resize",this._onWindowResize,!1),_.window.removeEventListener("orientationchange",this._onWindowResize,!1),_.window.removeEventListener("online",this._onWindowOnline,!1));var w=this.painter.context.gl.getExtension("WEBGL_lose_context");w&&w.loseContext(),Pl(this._canvasContainer),Pl(this._controlContainer),Pl(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new _.Event("remove"))},d.prototype.triggerRepaint=function(){var g=this;this.style&&!this._frame&&(this._frame=_.browser.frame(function(S){g._frame=null,g._render(S)}))},d.prototype._onWindowOnline=function(){this._update()},d.prototype._onWindowResize=function(g){this._trackResize&&this.resize({originalEvent:g})._update()},p.showTileBoundaries.get=function(){return!!this._showTileBoundaries},p.showTileBoundaries.set=function(g){this._showTileBoundaries!==g&&(this._showTileBoundaries=g,this._update())},p.showPadding.get=function(){return!!this._showPadding},p.showPadding.set=function(g){this._showPadding!==g&&(this._showPadding=g,this._update())},p.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},p.showCollisionBoxes.set=function(g){this._showCollisionBoxes!==g&&(this._showCollisionBoxes=g,g?this.style._generateCollisionBoxes():this._update())},p.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},p.showOverdrawInspector.set=function(g){this._showOverdrawInspector!==g&&(this._showOverdrawInspector=g,this._update())},p.repaint.get=function(){return!!this._repaint},p.repaint.set=function(g){this._repaint!==g&&(this._repaint=g,this.triggerRepaint())},p.vertices.get=function(){return!!this._vertices},p.vertices.set=function(g){this._vertices=g,this._update()},d.prototype._setCacheLimits=function(g,S){_.setCacheLimits(g,S)},p.version.get=function(){return _.version},Object.defineProperties(d.prototype,p),d}(Ls);function Pl(h){h.parentNode&&h.parentNode.removeChild(h)}var zf={showCompass:!0,showZoom:!0,visualizePitch:!1},gu=function(h){var d=this;this.options=_.extend({},zf,h),this._container=U.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(p){return p.preventDefault()}),this.options.showZoom&&(_.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(p){return d._map.zoomIn({},{originalEvent:p})}),U.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(p){return d._map.zoomOut({},{originalEvent:p})}),U.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(_.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(p){d.options.visualizePitch?d._map.resetNorthPitch({},{originalEvent:p}):d._map.resetNorth({},{originalEvent:p})}),this._compassIcon=U.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};gu.prototype._updateZoomButtons=function(){var h=this._map.getZoom(),d=h===this._map.getMaxZoom(),p=h===this._map.getMinZoom();this._zoomInButton.disabled=d,this._zoomOutButton.disabled=p,this._zoomInButton.setAttribute("aria-disabled",d.toString()),this._zoomOutButton.setAttribute("aria-disabled",p.toString())},gu.prototype._rotateCompassArrow=function(){var h=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=h},gu.prototype.onAdd=function(h){return this._map=h,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Es(this._map,this._compass,this.options.visualizePitch)),this._container},gu.prototype.onRemove=function(){U.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},gu.prototype._createButton=function(h,d){var p=U.create("button",h,this._container);return p.type="button",p.addEventListener("click",d),p},gu.prototype._setButtonTitle=function(h,d){var p=this._map._getUIString("NavigationControl."+d);h.title=p,h.setAttribute("aria-label",p)};var Es=function(h,d,p){p===void 0&&(p=!1),this._clickTolerance=10,this.element=d,this.mouseRotate=new Dc({clickTolerance:h.dragRotate._mouseRotate._clickTolerance}),this.map=h,p&&(this.mousePitch=new wh({clickTolerance:h.dragRotate._mousePitch._clickTolerance})),_.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),U.addEventListener(d,"mousedown",this.mousedown),U.addEventListener(d,"touchstart",this.touchstart,{passive:!1}),U.addEventListener(d,"touchmove",this.touchmove),U.addEventListener(d,"touchend",this.touchend),U.addEventListener(d,"touchcancel",this.reset)};function ic(h,d,p){if(h=new _.LngLat(h.lng,h.lat),d){var g=new _.LngLat(h.lng-360,h.lat),S=new _.LngLat(h.lng+360,h.lat),w=p.locationPoint(h).distSqr(d);p.locationPoint(g).distSqr(d)<w?h=g:p.locationPoint(S).distSqr(d)<w&&(h=S)}for(;Math.abs(h.lng-p.center.lng)>180;){var C=p.locationPoint(h);if(C.x>=0&&C.y>=0&&C.x<=p.width&&C.y<=p.height)break;h.lng>p.center.lng?h.lng-=360:h.lng+=360}return h}Es.prototype.down=function(h,d){this.mouseRotate.mousedown(h,d),this.mousePitch&&this.mousePitch.mousedown(h,d),U.disableDrag()},Es.prototype.move=function(h,d){var p=this.map,g=this.mouseRotate.mousemoveWindow(h,d);if(g&&g.bearingDelta&&p.setBearing(p.getBearing()+g.bearingDelta),this.mousePitch){var S=this.mousePitch.mousemoveWindow(h,d);S&&S.pitchDelta&&p.setPitch(p.getPitch()+S.pitchDelta)}},Es.prototype.off=function(){var h=this.element;U.removeEventListener(h,"mousedown",this.mousedown),U.removeEventListener(h,"touchstart",this.touchstart,{passive:!1}),U.removeEventListener(h,"touchmove",this.touchmove),U.removeEventListener(h,"touchend",this.touchend),U.removeEventListener(h,"touchcancel",this.reset),this.offTemp()},Es.prototype.offTemp=function(){U.enableDrag(),U.removeEventListener(_.window,"mousemove",this.mousemove),U.removeEventListener(_.window,"mouseup",this.mouseup)},Es.prototype.mousedown=function(h){this.down(_.extend({},h,{ctrlKey:!0,preventDefault:function(){return h.preventDefault()}}),U.mousePos(this.element,h)),U.addEventListener(_.window,"mousemove",this.mousemove),U.addEventListener(_.window,"mouseup",this.mouseup)},Es.prototype.mousemove=function(h){this.move(h,U.mousePos(this.element,h))},Es.prototype.mouseup=function(h){this.mouseRotate.mouseupWindow(h),this.mousePitch&&this.mousePitch.mouseupWindow(h),this.offTemp()},Es.prototype.touchstart=function(h){h.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=U.touchPos(this.element,h.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return h.preventDefault()}},this._startPos))},Es.prototype.touchmove=function(h){h.targetTouches.length!==1?this.reset():(this._lastPos=U.touchPos(this.element,h.targetTouches)[0],this.move({preventDefault:function(){return h.preventDefault()}},this._lastPos))},Es.prototype.touchend=function(h){h.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Es.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Nu={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Zf(h,d,p){var g=h.classList;for(var S in Nu)g.remove("mapboxgl-"+p+"-anchor-"+S);g.add("mapboxgl-"+p+"-anchor-"+d)}var kc,cf=function(h){function d(p,g){if(h.call(this),(p instanceof _.window.HTMLElement||g)&&(p=_.extend({element:p},g)),_.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=p&&p.anchor||"center",this._color=p&&p.color||"#3FB1CE",this._scale=p&&p.scale||1,this._draggable=p&&p.draggable||!1,this._clickTolerance=p&&p.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=p&&p.rotation||0,this._rotationAlignment=p&&p.rotationAlignment||"auto",this._pitchAlignment=p&&p.pitchAlignment&&p.pitchAlignment!=="auto"?p.pitchAlignment:this._rotationAlignment,p&&p.element)this._element=p.element,this._offset=_.Point.convert(p&&p.offset||[0,0]);else{this._defaultMarker=!0,this._element=U.create("div"),this._element.setAttribute("aria-label","Map marker");var S=U.createNS("http://www.w3.org/2000/svg","svg");S.setAttributeNS(null,"display","block"),S.setAttributeNS(null,"height","41px"),S.setAttributeNS(null,"width","27px"),S.setAttributeNS(null,"viewBox","0 0 27 41");var w=U.createNS("http://www.w3.org/2000/svg","g");w.setAttributeNS(null,"stroke","none"),w.setAttributeNS(null,"stroke-width","1"),w.setAttributeNS(null,"fill","none"),w.setAttributeNS(null,"fill-rule","evenodd");var C=U.createNS("http://www.w3.org/2000/svg","g");C.setAttributeNS(null,"fill-rule","nonzero");var P=U.createNS("http://www.w3.org/2000/svg","g");P.setAttributeNS(null,"transform","translate(3.0, 29.0)"),P.setAttributeNS(null,"fill","#000000");for(var Z=0,Y=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];Z<Y.length;Z+=1){var pe=Y[Z],_e=U.createNS("http://www.w3.org/2000/svg","ellipse");_e.setAttributeNS(null,"opacity","0.04"),_e.setAttributeNS(null,"cx","10.5"),_e.setAttributeNS(null,"cy","5.80029008"),_e.setAttributeNS(null,"rx",pe.rx),_e.setAttributeNS(null,"ry",pe.ry),P.appendChild(_e)}var ye=U.createNS("http://www.w3.org/2000/svg","g");ye.setAttributeNS(null,"fill",this._color);var Ue=U.createNS("http://www.w3.org/2000/svg","path");Ue.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),ye.appendChild(Ue);var ke=U.createNS("http://www.w3.org/2000/svg","g");ke.setAttributeNS(null,"opacity","0.25"),ke.setAttributeNS(null,"fill","#000000");var Ke=U.createNS("http://www.w3.org/2000/svg","path");Ke.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),ke.appendChild(Ke);var Ie=U.createNS("http://www.w3.org/2000/svg","g");Ie.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Ie.setAttributeNS(null,"fill","#FFFFFF");var $e=U.createNS("http://www.w3.org/2000/svg","g");$e.setAttributeNS(null,"transform","translate(8.0, 8.0)");var vt=U.createNS("http://www.w3.org/2000/svg","circle");vt.setAttributeNS(null,"fill","#000000"),vt.setAttributeNS(null,"opacity","0.25"),vt.setAttributeNS(null,"cx","5.5"),vt.setAttributeNS(null,"cy","5.5"),vt.setAttributeNS(null,"r","5.4999962");var Rt=U.createNS("http://www.w3.org/2000/svg","circle");Rt.setAttributeNS(null,"fill","#FFFFFF"),Rt.setAttributeNS(null,"cx","5.5"),Rt.setAttributeNS(null,"cy","5.5"),Rt.setAttributeNS(null,"r","5.4999962"),$e.appendChild(vt),$e.appendChild(Rt),C.appendChild(P),C.appendChild(ye),C.appendChild(ke),C.appendChild(Ie),C.appendChild($e),S.appendChild(C),S.setAttributeNS(null,"height",41*this._scale+"px"),S.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(S),this._offset=_.Point.convert(p&&p.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(Jt){Jt.preventDefault()}),this._element.addEventListener("mousedown",function(Jt){Jt.preventDefault()}),Zf(this._element,this._anchor,"marker"),this._popup=null}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.addTo=function(p){return this.remove(),this._map=p,p.getCanvasContainer().appendChild(this._element),p.on("move",this._update),p.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},d.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),U.remove(this._element),this._popup&&this._popup.remove(),this},d.prototype.getLngLat=function(){return this._lngLat},d.prototype.setLngLat=function(p){return this._lngLat=_.LngLat.convert(p),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},d.prototype.getElement=function(){return this._element},d.prototype.setPopup=function(p){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),p){if(!("offset"in p.options)){var g=Math.sqrt(Math.pow(13.5,2)/2);p.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[g,-1*(24.6+g)],"bottom-right":[-g,-1*(24.6+g)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=p,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},d.prototype._onKeyPress=function(p){var g=p.code,S=p.charCode||p.keyCode;g!=="Space"&&g!=="Enter"&&S!==32&&S!==13||this.togglePopup()},d.prototype._onMapClick=function(p){var g=p.originalEvent.target,S=this._element;this._popup&&(g===S||S.contains(g))&&this.togglePopup()},d.prototype.getPopup=function(){return this._popup},d.prototype.togglePopup=function(){var p=this._popup;return p?(p.isOpen()?p.remove():p.addTo(this._map),this):this},d.prototype._update=function(p){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=ic(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var g="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?g="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(g="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var S="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?S="rotateX(0deg)":this._pitchAlignment==="map"&&(S="rotateX("+this._map.getPitch()+"deg)"),p&&p.type!=="moveend"||(this._pos=this._pos.round()),U.setTransform(this._element,Nu[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+S+" "+g)}},d.prototype.getOffset=function(){return this._offset},d.prototype.setOffset=function(p){return this._offset=_.Point.convert(p),this._update(),this},d.prototype._onMove=function(p){if(!this._isDragging){var g=this._clickTolerance||this._map._clickTolerance;this._isDragging=p.point.dist(this._pointerdownPos)>=g}this._isDragging&&(this._pos=p.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new _.Event("dragstart"))),this.fire(new _.Event("drag")))},d.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new _.Event("dragend")),this._state="inactive"},d.prototype._addDragHandler=function(p){this._element.contains(p.originalEvent.target)&&(p.preventDefault(),this._positionDelta=p.point.sub(this._pos).add(this._offset),this._pointerdownPos=p.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},d.prototype.setDraggable=function(p){return this._draggable=!!p,this._map&&(p?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},d.prototype.isDraggable=function(){return this._draggable},d.prototype.setRotation=function(p){return this._rotation=p||0,this._update(),this},d.prototype.getRotation=function(){return this._rotation},d.prototype.setRotationAlignment=function(p){return this._rotationAlignment=p||"auto",this._update(),this},d.prototype.getRotationAlignment=function(){return this._rotationAlignment},d.prototype.setPitchAlignment=function(p){return this._pitchAlignment=p&&p!=="auto"?p:this._rotationAlignment,this._update(),this},d.prototype.getPitchAlignment=function(){return this._pitchAlignment},d}(_.Evented),Vf={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ac=0,oc=!1,Uu=function(h){function d(p){h.call(this),this.options=_.extend({},Vf,p),_.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.onAdd=function(p){var g;return this._map=p,this._container=U.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),g=this._setupUI,kc!==void 0?g(kc):_.window.navigator.permissions!==void 0?_.window.navigator.permissions.query({name:"geolocation"}).then(function(S){g(kc=S.state!=="denied")}):g(kc=!!_.window.navigator.geolocation),this._container},d.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(_.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),U.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ac=0,oc=!1},d.prototype._isOutOfMapMaxBounds=function(p){var g=this._map.getMaxBounds(),S=p.coords;return g&&(S.longitude<g.getWest()||S.longitude>g.getEast()||S.latitude<g.getSouth()||S.latitude>g.getNorth())},d.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},d.prototype._onSuccess=function(p){if(this._map){if(this._isOutOfMapMaxBounds(p))return this._setErrorState(),this.fire(new _.Event("outofmaxbounds",p)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=p,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(p),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(p),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new _.Event("geolocate",p)),this._finish()}},d.prototype._updateCamera=function(p){var g=new _.LngLat(p.coords.longitude,p.coords.latitude),S=p.coords.accuracy,w=this._map.getBearing(),C=_.extend({bearing:w},this.options.fitBoundsOptions);this._map.fitBounds(g.toBounds(S),C,{geolocateSource:!0})},d.prototype._updateMarker=function(p){if(p){var g=new _.LngLat(p.coords.longitude,p.coords.latitude);this._accuracyCircleMarker.setLngLat(g).addTo(this._map),this._userLocationDotMarker.setLngLat(g).addTo(this._map),this._accuracy=p.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},d.prototype._updateCircleRadius=function(){var p=this._map._container.clientHeight/2,g=this._map.unproject([0,p]),S=this._map.unproject([1,p]),w=g.distanceTo(S),C=Math.ceil(2*this._accuracy/w);this._circleElement.style.width=C+"px",this._circleElement.style.height=C+"px"},d.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},d.prototype._onError=function(p){if(this._map){if(this.options.trackUserLocation)if(p.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var g=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=g,this._geolocateButton.setAttribute("aria-label",g),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(p.code===3&&oc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new _.Event("error",p)),this._finish()}},d.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},d.prototype._setupUI=function(p){var g=this;if(this._container.addEventListener("contextmenu",function(C){return C.preventDefault()}),this._geolocateButton=U.create("button","mapboxgl-ctrl-geolocate",this._container),U.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",p===!1){_.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var S=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=S,this._geolocateButton.setAttribute("aria-label",S)}else{var w=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=w,this._geolocateButton.setAttribute("aria-label",w)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=U.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new cf(this._dotElement),this._circleElement=U.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new cf({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(C){C.geolocateSource||g._watchState!=="ACTIVE_LOCK"||C.originalEvent&&C.originalEvent.type==="resize"||(g._watchState="BACKGROUND",g._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),g._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),g.fire(new _.Event("trackuserlocationend")))})},d.prototype.trigger=function(){if(!this._setup)return _.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new _.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ac--,oc=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new _.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new _.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var p;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++ac>1?(p={maximumAge:6e5,timeout:0},oc=!0):(p=this.options.positionOptions,oc=!1),this._geolocationWatchID=_.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,p)}}else _.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},d.prototype._clearWatch=function(){_.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},d}(_.Evented),zu={maxWidth:100,unit:"metric"},tu=function(h){this.options=_.extend({},zu,h),_.bindAll(["_onMove","setUnit"],this)};function jf(h,d,p){var g=p&&p.maxWidth||100,S=h._container.clientHeight/2,w=h.unproject([0,S]),C=h.unproject([g,S]),P=w.distanceTo(C);if(p&&p.unit==="imperial"){var Z=3.2808*P;Z>5280?Ol(d,g,Z/5280,h._getUIString("ScaleControl.Miles")):Ol(d,g,Z,h._getUIString("ScaleControl.Feet"))}else p&&p.unit==="nautical"?Ol(d,g,P/1852,h._getUIString("ScaleControl.NauticalMiles")):P>=1e3?Ol(d,g,P/1e3,h._getUIString("ScaleControl.Kilometers")):Ol(d,g,P,h._getUIString("ScaleControl.Meters"))}function Ol(h,d,p,g){var S,w,C,P=(S=p,(w=Math.pow(10,(""+Math.floor(S)).length-1))*(C=(C=S/w)>=10?10:C>=5?5:C>=3?3:C>=2?2:C>=1?1:function(Z){var Y=Math.pow(10,Math.ceil(-Math.log(Z)/Math.LN10));return Math.round(Z*Y)/Y}(C)));h.style.width=d*(P/p)+"px",h.innerHTML=P+" "+g}tu.prototype.getDefaultPosition=function(){return"bottom-left"},tu.prototype._onMove=function(){jf(this._map,this._container,this.options)},tu.prototype.onAdd=function(h){return this._map=h,this._container=U.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},tu.prototype.onRemove=function(){U.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},tu.prototype.setUnit=function(h){this.options.unit=h,jf(this._map,this._container,this.options)};var ru=function(h){this._fullscreen=!1,h&&h.container&&(h.container instanceof _.window.HTMLElement?this._container=h.container:_.warnOnce("Full screen control 'container' must be a DOM element.")),_.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in _.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in _.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in _.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in _.window.document&&(this._fullscreenchange="MSFullscreenChange")};ru.prototype.onAdd=function(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=U.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",_.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ru.prototype.onRemove=function(){U.remove(this._controlContainer),this._map=null,_.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ru.prototype._checkFullscreenSupport=function(){return!!(_.window.document.fullscreenEnabled||_.window.document.mozFullScreenEnabled||_.window.document.msFullscreenEnabled||_.window.document.webkitFullscreenEnabled)},ru.prototype._setupUI=function(){var h=this._fullscreenButton=U.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);U.create("span","mapboxgl-ctrl-icon",h).setAttribute("aria-hidden",!0),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),_.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ru.prototype._updateTitle=function(){var h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h},ru.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ru.prototype._isFullscreen=function(){return this._fullscreen},ru.prototype._changeIcon=function(){(_.window.document.fullscreenElement||_.window.document.mozFullScreenElement||_.window.document.webkitFullscreenElement||_.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ru.prototype._onClickFullscreen=function(){this._isFullscreen()?_.window.document.exitFullscreen?_.window.document.exitFullscreen():_.window.document.mozCancelFullScreen?_.window.document.mozCancelFullScreen():_.window.document.msExitFullscreen?_.window.document.msExitFullscreen():_.window.document.webkitCancelFullScreen&&_.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Dl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ff=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Rh=function(h){function d(p){h.call(this),this.options=_.extend(Object.create(Dl),p),_.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return h&&(d.__proto__=h),(d.prototype=Object.create(h&&h.prototype)).constructor=d,d.prototype.addTo=function(p){return this._map&&this.remove(),this._map=p,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new _.Event("open")),this},d.prototype.isOpen=function(){return!!this._map},d.prototype.remove=function(){return this._content&&U.remove(this._content),this._container&&(U.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new _.Event("close")),this},d.prototype.getLngLat=function(){return this._lngLat},d.prototype.setLngLat=function(p){return this._lngLat=_.LngLat.convert(p),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},d.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},d.prototype.getElement=function(){return this._container},d.prototype.setText=function(p){return this.setDOMContent(_.window.document.createTextNode(p))},d.prototype.setHTML=function(p){var g,S=_.window.document.createDocumentFragment(),w=_.window.document.createElement("body");for(w.innerHTML=p;g=w.firstChild;)S.appendChild(g);return this.setDOMContent(S)},d.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},d.prototype.setMaxWidth=function(p){return this.options.maxWidth=p,this._update(),this},d.prototype.setDOMContent=function(p){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=U.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(p),this._createCloseButton(),this._update(),this._focusFirstElement(),this},d.prototype.addClassName=function(p){this._container&&this._container.classList.add(p)},d.prototype.removeClassName=function(p){this._container&&this._container.classList.remove(p)},d.prototype.setOffset=function(p){return this.options.offset=p,this._update(),this},d.prototype.toggleClassName=function(p){if(this._container)return this._container.classList.toggle(p)},d.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=U.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},d.prototype._onMouseUp=function(p){this._update(p.point)},d.prototype._onMouseMove=function(p){this._update(p.point)},d.prototype._onDrag=function(p){this._update(p.point)},d.prototype._update=function(p){var g=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=U.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=U.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(_e){return g._container.classList.add(_e)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ic(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||p)){var S=this._pos=this._trackPointer&&p?p:this._map.project(this._lngLat),w=this.options.anchor,C=function _e(ye){if(ye){if(typeof ye=="number"){var Ue=Math.round(Math.sqrt(.5*Math.pow(ye,2)));return{center:new _.Point(0,0),top:new _.Point(0,ye),"top-left":new _.Point(Ue,Ue),"top-right":new _.Point(-Ue,Ue),bottom:new _.Point(0,-ye),"bottom-left":new _.Point(Ue,-Ue),"bottom-right":new _.Point(-Ue,-Ue),left:new _.Point(ye,0),right:new _.Point(-ye,0)}}if(ye instanceof _.Point||Array.isArray(ye)){var ke=_.Point.convert(ye);return{center:ke,top:ke,"top-left":ke,"top-right":ke,bottom:ke,"bottom-left":ke,"bottom-right":ke,left:ke,right:ke}}return{center:_.Point.convert(ye.center||[0,0]),top:_.Point.convert(ye.top||[0,0]),"top-left":_.Point.convert(ye["top-left"]||[0,0]),"top-right":_.Point.convert(ye["top-right"]||[0,0]),bottom:_.Point.convert(ye.bottom||[0,0]),"bottom-left":_.Point.convert(ye["bottom-left"]||[0,0]),"bottom-right":_.Point.convert(ye["bottom-right"]||[0,0]),left:_.Point.convert(ye.left||[0,0]),right:_.Point.convert(ye.right||[0,0])}}return _e(new _.Point(0,0))}(this.options.offset);if(!w){var P,Z=this._container.offsetWidth,Y=this._container.offsetHeight;P=S.y+C.bottom.y<Y?["top"]:S.y>this._map.transform.height-Y?["bottom"]:[],S.x<Z/2?P.push("left"):S.x>this._map.transform.width-Z/2&&P.push("right"),w=P.length===0?"bottom":P.join("-")}var pe=S.add(C[w]).round();U.setTransform(this._container,Nu[w]+" translate("+pe.x+"px,"+pe.y+"px)"),Zf(this._container,w,"popup")}},d.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var p=this._container.querySelector(ff);p&&p.focus()}},d.prototype._onClose=function(){this.remove()},d}(_.Evented),Hf={version:_.version,supported:le,setRTLTextPlugin:_.setRTLTextPlugin,getRTLTextPluginStatus:_.getRTLTextPluginStatus,Map:Ch,NavigationControl:gu,GeolocateControl:Uu,AttributionControl:qo,ScaleControl:tu,FullscreenControl:ru,Popup:Rh,Marker:cf,Style:Os,LngLat:_.LngLat,LngLatBounds:_.LngLatBounds,Point:_.Point,MercatorCoordinate:_.MercatorCoordinate,Evented:_.Evented,config:_.config,prewarm:function(){sr().acquire(ir)},clearPrewarmedResources:function(){var h=An;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(ir),An=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return _.config.ACCESS_TOKEN},set accessToken(h){_.config.ACCESS_TOKEN=h},get baseApiUrl(){return _.config.API_URL},set baseApiUrl(h){_.config.API_URL=h},get workerCount(){return wr.workerCount},set workerCount(h){wr.workerCount=h},get maxParallelImageRequests(){return _.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(h){_.config.MAX_PARALLEL_IMAGE_REQUESTS=h},clearStorage:function(h){_.clearTileCache(h)},workerUrl:""};return Hf}),q})},43548:function(rr,ee,L){"use strict";rr.exports=he;var q=L(11542);function he(re){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(re)?re:new Uint8Array(re||0),this.pos=0,this.type=0,this.length=this.buf.length}he.Varint=0,he.Fixed64=1,he.Bytes=2,he.Fixed32=5;var _=65536*65536,le=1/_,U=12,fe=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");he.prototype={destroy:function(){this.buf=null},readFields:function(re,V,K){for(K=K||this.length;this.pos<K;){var Me=this.readVarint(),Se=Me>>3,nt=this.pos;this.type=Me&7,re(Se,V,this),this.pos===nt&&this.skip(Me)}return V},readMessage:function(re,V){return this.readFields(re,V,this.readVarint()+this.pos)},readFixed32:function(){var re=At(this.buf,this.pos);return this.pos+=4,re},readSFixed32:function(){var re=It(this.buf,this.pos);return this.pos+=4,re},readFixed64:function(){var re=At(this.buf,this.pos)+At(this.buf,this.pos+4)*_;return this.pos+=8,re},readSFixed64:function(){var re=At(this.buf,this.pos)+It(this.buf,this.pos+4)*_;return this.pos+=8,re},readFloat:function(){var re=q.read(this.buf,this.pos,!0,23,4);return this.pos+=4,re},readDouble:function(){var re=q.read(this.buf,this.pos,!0,52,8);return this.pos+=8,re},readVarint:function(re){var V=this.buf,K,Me;return Me=V[this.pos++],K=Me&127,Me<128||(Me=V[this.pos++],K|=(Me&127)<<7,Me<128)||(Me=V[this.pos++],K|=(Me&127)<<14,Me<128)||(Me=V[this.pos++],K|=(Me&127)<<21,Me<128)?K:(Me=V[this.pos],K|=(Me&15)<<28,se(K,re,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var re=this.readVarint();return re%2===1?(re+1)/-2:re/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var re=this.readVarint()+this.pos,V=this.pos;return this.pos=re,re-V>=U&&fe?Ct(this.buf,V,re):qe(this.buf,V,re)},readBytes:function(){var re=this.readVarint()+this.pos,V=this.buf.subarray(this.pos,re);return this.pos=re,V},readPackedVarint:function(re,V){if(this.type!==he.Bytes)return re.push(this.readVarint(V));var K=Qe(this);for(re=re||[];this.pos<K;)re.push(this.readVarint(V));return re},readPackedSVarint:function(re){if(this.type!==he.Bytes)return re.push(this.readSVarint());var V=Qe(this);for(re=re||[];this.pos<V;)re.push(this.readSVarint());return re},readPackedBoolean:function(re){if(this.type!==he.Bytes)return re.push(this.readBoolean());var V=Qe(this);for(re=re||[];this.pos<V;)re.push(this.readBoolean());return re},readPackedFloat:function(re){if(this.type!==he.Bytes)return re.push(this.readFloat());var V=Qe(this);for(re=re||[];this.pos<V;)re.push(this.readFloat());return re},readPackedDouble:function(re){if(this.type!==he.Bytes)return re.push(this.readDouble());var V=Qe(this);for(re=re||[];this.pos<V;)re.push(this.readDouble());return re},readPackedFixed32:function(re){if(this.type!==he.Bytes)return re.push(this.readFixed32());var V=Qe(this);for(re=re||[];this.pos<V;)re.push(this.readFixed32());return re},readPackedSFixed32:function(re){if(this.type!==he.Bytes)return re.push(this.readSFixed32());var V=Qe(this);for(re=re||[];this.pos<V;)re.push(this.readSFixed32());return re},readPackedFixed64:function(re){if(this.type!==he.Bytes)return re.push(this.readFixed64());var V=Qe(this);for(re=re||[];this.pos<V;)re.push(this.readFixed64());return re},readPackedSFixed64:function(re){if(this.type!==he.Bytes)return re.push(this.readSFixed64());var V=Qe(this);for(re=re||[];this.pos<V;)re.push(this.readSFixed64());return re},skip:function(re){var V=re&7;if(V===he.Varint)for(;this.buf[this.pos++]>127;);else if(V===he.Bytes)this.pos=this.readVarint()+this.pos;else if(V===he.Fixed32)this.pos+=4;else if(V===he.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+V)},writeTag:function(re,V){this.writeVarint(re<<3|V)},realloc:function(re){for(var V=this.length||16;V<this.pos+re;)V*=2;if(V!==this.length){var K=new Uint8Array(V);K.set(this.buf),this.buf=K,this.length=V}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(re){this.realloc(4),ut(this.buf,re,this.pos),this.pos+=4},writeSFixed32:function(re){this.realloc(4),ut(this.buf,re,this.pos),this.pos+=4},writeFixed64:function(re){this.realloc(8),ut(this.buf,re&-1,this.pos),ut(this.buf,Math.floor(re*le),this.pos+4),this.pos+=8},writeSFixed64:function(re){this.realloc(8),ut(this.buf,re&-1,this.pos),ut(this.buf,Math.floor(re*le),this.pos+4),this.pos+=8},writeVarint:function(re){if(re=+re||0,re>268435455||re<0){et(re,this);return}this.realloc(4),this.buf[this.pos++]=re&127|(re>127?128:0),!(re<=127)&&(this.buf[this.pos++]=(re>>>=7)&127|(re>127?128:0),!(re<=127)&&(this.buf[this.pos++]=(re>>>=7)&127|(re>127?128:0),!(re<=127)&&(this.buf[this.pos++]=re>>>7&127)))},writeSVarint:function(re){this.writeVarint(re<0?-re*2-1:re*2)},writeBoolean:function(re){this.writeVarint(!!re)},writeString:function(re){re=String(re),this.realloc(re.length*4),this.pos++;var V=this.pos;this.pos=fr(this.buf,re,this.pos);var K=this.pos-V;K>=128&&wt(V,K,this),this.pos=V-1,this.writeVarint(K),this.pos+=K},writeFloat:function(re){this.realloc(4),q.write(this.buf,re,this.pos,!0,23,4),this.pos+=4},writeDouble:function(re){this.realloc(8),q.write(this.buf,re,this.pos,!0,52,8),this.pos+=8},writeBytes:function(re){var V=re.length;this.writeVarint(V),this.realloc(V);for(var K=0;K<V;K++)this.buf[this.pos++]=re[K]},writeRawMessage:function(re,V){this.pos++;var K=this.pos;re(V,this);var Me=this.pos-K;Me>=128&&wt(K,Me,this),this.pos=K-1,this.writeVarint(Me),this.pos+=Me},writeMessage:function(re,V,K){this.writeTag(re,he.Bytes),this.writeRawMessage(V,K)},writePackedVarint:function(re,V){V.length&&this.writeMessage(re,Xt,V)},writePackedSVarint:function(re,V){V.length&&this.writeMessage(re,Zt,V)},writePackedBoolean:function(re,V){V.length&&this.writeMessage(re,xt,V)},writePackedFloat:function(re,V){V.length&&this.writeMessage(re,nr,V)},writePackedDouble:function(re,V){V.length&&this.writeMessage(re,Vt,V)},writePackedFixed32:function(re,V){V.length&&this.writeMessage(re,bt,V)},writePackedSFixed32:function(re,V){V.length&&this.writeMessage(re,Tr,V)},writePackedFixed64:function(re,V){V.length&&this.writeMessage(re,hr,V)},writePackedSFixed64:function(re,V){V.length&&this.writeMessage(re,lr,V)},writeBytesField:function(re,V){this.writeTag(re,he.Bytes),this.writeBytes(V)},writeFixed32Field:function(re,V){this.writeTag(re,he.Fixed32),this.writeFixed32(V)},writeSFixed32Field:function(re,V){this.writeTag(re,he.Fixed32),this.writeSFixed32(V)},writeFixed64Field:function(re,V){this.writeTag(re,he.Fixed64),this.writeFixed64(V)},writeSFixed64Field:function(re,V){this.writeTag(re,he.Fixed64),this.writeSFixed64(V)},writeVarintField:function(re,V){this.writeTag(re,he.Varint),this.writeVarint(V)},writeSVarintField:function(re,V){this.writeTag(re,he.Varint),this.writeSVarint(V)},writeStringField:function(re,V){this.writeTag(re,he.Bytes),this.writeString(V)},writeFloatField:function(re,V){this.writeTag(re,he.Fixed32),this.writeFloat(V)},writeDoubleField:function(re,V){this.writeTag(re,he.Fixed64),this.writeDouble(V)},writeBooleanField:function(re,V){this.writeVarintField(re,!!V)}};function se(re,V,K){var Me=K.buf,Se,nt;if(nt=Me[K.pos++],Se=(nt&112)>>4,nt<128||(nt=Me[K.pos++],Se|=(nt&127)<<3,nt<128)||(nt=Me[K.pos++],Se|=(nt&127)<<10,nt<128)||(nt=Me[K.pos++],Se|=(nt&127)<<17,nt<128)||(nt=Me[K.pos++],Se|=(nt&127)<<24,nt<128)||(nt=Me[K.pos++],Se|=(nt&1)<<31,nt<128))return ae(re,Se,V);throw new Error("Expected varint not more than 10 bytes")}function Qe(re){return re.type===he.Bytes?re.readVarint()+re.pos:re.pos+1}function ae(re,V,K){return K?V*4294967296+(re>>>0):(V>>>0)*4294967296+(re>>>0)}function et(re,V){var K,Me;if(re>=0?(K=re%4294967296|0,Me=re/4294967296|0):(K=~(-re%4294967296),Me=~(-re/4294967296),K^4294967295?K=K+1|0:(K=0,Me=Me+1|0)),re>=18446744073709552e3||re<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");V.realloc(10),dt(K,Me,V),Ye(Me,V)}function dt(re,V,K){K.buf[K.pos++]=re&127|128,re>>>=7,K.buf[K.pos++]=re&127|128,re>>>=7,K.buf[K.pos++]=re&127|128,re>>>=7,K.buf[K.pos++]=re&127|128,re>>>=7,K.buf[K.pos]=re&127}function Ye(re,V){var K=(re&7)<<4;V.buf[V.pos++]|=K|((re>>>=3)?128:0),re&&(V.buf[V.pos++]=re&127|((re>>>=7)?128:0),re&&(V.buf[V.pos++]=re&127|((re>>>=7)?128:0),re&&(V.buf[V.pos++]=re&127|((re>>>=7)?128:0),re&&(V.buf[V.pos++]=re&127|((re>>>=7)?128:0),re&&(V.buf[V.pos++]=re&127)))))}function wt(re,V,K){var Me=V<=16383?1:V<=2097151?2:V<=268435455?3:Math.floor(Math.log(V)/(Math.LN2*7));K.realloc(Me);for(var Se=K.pos-1;Se>=re;Se--)K.buf[Se+Me]=K.buf[Se]}function Xt(re,V){for(var K=0;K<re.length;K++)V.writeVarint(re[K])}function Zt(re,V){for(var K=0;K<re.length;K++)V.writeSVarint(re[K])}function nr(re,V){for(var K=0;K<re.length;K++)V.writeFloat(re[K])}function Vt(re,V){for(var K=0;K<re.length;K++)V.writeDouble(re[K])}function xt(re,V){for(var K=0;K<re.length;K++)V.writeBoolean(re[K])}function bt(re,V){for(var K=0;K<re.length;K++)V.writeFixed32(re[K])}function Tr(re,V){for(var K=0;K<re.length;K++)V.writeSFixed32(re[K])}function hr(re,V){for(var K=0;K<re.length;K++)V.writeFixed64(re[K])}function lr(re,V){for(var K=0;K<re.length;K++)V.writeSFixed64(re[K])}function At(re,V){return(re[V]|re[V+1]<<8|re[V+2]<<16)+re[V+3]*16777216}function ut(re,V,K){re[K]=V,re[K+1]=V>>>8,re[K+2]=V>>>16,re[K+3]=V>>>24}function It(re,V){return(re[V]|re[V+1]<<8|re[V+2]<<16)+(re[V+3]<<24)}function qe(re,V,K){for(var Me="",Se=V;Se<K;){var nt=re[Se],te=null,Ce=nt>239?4:nt>223?3:nt>191?2:1;if(Se+Ce>K)break;var we,Xe,Lt;Ce===1?nt<128&&(te=nt):Ce===2?(we=re[Se+1],(we&192)===128&&(te=(nt&31)<<6|we&63,te<=127&&(te=null))):Ce===3?(we=re[Se+1],Xe=re[Se+2],(we&192)===128&&(Xe&192)===128&&(te=(nt&15)<<12|(we&63)<<6|Xe&63,(te<=2047||te>=55296&&te<=57343)&&(te=null))):Ce===4&&(we=re[Se+1],Xe=re[Se+2],Lt=re[Se+3],(we&192)===128&&(Xe&192)===128&&(Lt&192)===128&&(te=(nt&15)<<18|(we&63)<<12|(Xe&63)<<6|Lt&63,(te<=65535||te>=1114112)&&(te=null))),te===null?(te=65533,Ce=1):te>65535&&(te-=65536,Me+=String.fromCharCode(te>>>10&1023|55296),te=56320|te&1023),Me+=String.fromCharCode(te),Se+=Ce}return Me}function Ct(re,V,K){return fe.decode(re.subarray(V,K))}function fr(re,V,K){for(var Me=0,Se,nt;Me<V.length;Me++){if(Se=V.charCodeAt(Me),Se>55295&&Se<57344)if(nt)if(Se<56320){re[K++]=239,re[K++]=191,re[K++]=189,nt=Se;continue}else Se=nt-55296<<10|Se-56320|65536,nt=null;else{Se>56319||Me+1===V.length?(re[K++]=239,re[K++]=191,re[K++]=189):nt=Se;continue}else nt&&(re[K++]=239,re[K++]=191,re[K++]=189,nt=null);Se<128?re[K++]=Se:(Se<2048?re[K++]=Se>>6|192:(Se<65536?re[K++]=Se>>12|224:(re[K++]=Se>>18|240,re[K++]=Se>>12&63|128),re[K++]=Se>>6&63|128),re[K++]=Se&63|128)}return K}},37824:function(rr,ee,L){var q=L(93738);(function(he,_){rr.exports=_()})(this,function(){"use strict";function he(Dt,k){if(!(Dt instanceof k))throw new TypeError("Cannot call a class as a function")}function _(Dt,k){for(var ie=0;ie<k.length;ie++){var ve=k[ie];ve.enumerable=ve.enumerable||!1,ve.configurable=!0,"value"in ve&&(ve.writable=!0),Object.defineProperty(Dt,ve.key,ve)}}function le(Dt,k,ie){return k&&_(Dt.prototype,k),ie&&_(Dt,ie),Dt}var U=function(){function Dt(k,ie){this.next=null,this.key=k,this.data=ie,this.left=null,this.right=null}return Dt}();function fe(Dt,k){return Dt>k?1:Dt<k?-1:0}function se(Dt,k,ie){for(var ve=new U(null,null),Ze=ve,_t=ve;;){var Wt=ie(Dt,k.key);if(Wt<0){if(k.left===null)break;if(ie(Dt,k.left.key)<0){var Sr=k.left;if(k.left=Sr.right,Sr.right=k,k=Sr,k.left===null)break}_t.left=k,_t=k,k=k.left}else if(Wt>0){if(k.right===null)break;if(ie(Dt,k.right.key)>0){var Sr=k.right;if(k.right=Sr.left,Sr.left=k,k=Sr,k.right===null)break}Ze.right=k,Ze=k,k=k.right}else break}return Ze.right=k.left,_t.left=k.right,k.left=ve.right,k.right=ve.left,k}function Qe(Dt,k,ie,ve){var Ze=new U(Dt,k);if(ie===null)return Ze.left=Ze.right=null,Ze;ie=se(Dt,ie,ve);var _t=ve(Dt,ie.key);return _t<0?(Ze.left=ie.left,Ze.right=ie,ie.left=null):_t>=0&&(Ze.right=ie.right,Ze.left=ie,ie.right=null),Ze}function ae(Dt,k,ie){var ve=null,Ze=null;if(k){k=se(Dt,k,ie);var _t=ie(k.key,Dt);_t===0?(ve=k.left,Ze=k.right):_t<0?(Ze=k.right,k.right=null,ve=k):(ve=k.left,k.left=null,Ze=k)}return{left:ve,right:Ze}}function et(Dt,k,ie){return k===null?Dt:(Dt===null||(k=se(Dt.key,k,ie),k.left=Dt),k)}function dt(Dt,k,ie,ve,Ze){if(Dt){ve(""+k+(ie?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+Ze(Dt)+`
|
|
`);var _t=k+(ie?" ":"\u2502 ");Dt.left&&dt(Dt.left,_t,!1,ve,Ze),Dt.right&&dt(Dt.right,_t,!0,ve,Ze)}}var Ye=function(){function Dt(k){k===void 0&&(k=fe),this._root=null,this._size=0,this._comparator=k}return Dt.prototype.insert=function(k,ie){return this._size++,this._root=Qe(k,ie,this._root,this._comparator)},Dt.prototype.add=function(k,ie){var ve=new U(k,ie);this._root===null&&(ve.left=ve.right=null,this._size++,this._root=ve);var Ze=this._comparator,_t=se(k,this._root,Ze),Wt=Ze(k,_t.key);return Wt===0?this._root=_t:(Wt<0?(ve.left=_t.left,ve.right=_t,_t.left=null):Wt>0&&(ve.right=_t.right,ve.left=_t,_t.right=null),this._size++,this._root=ve),this._root},Dt.prototype.remove=function(k){this._root=this._remove(k,this._root,this._comparator)},Dt.prototype._remove=function(k,ie,ve){var Ze;if(ie===null)return null;ie=se(k,ie,ve);var _t=ve(k,ie.key);return _t===0?(ie.left===null?Ze=ie.right:(Ze=se(k,ie.left,ve),Ze.right=ie.right),this._size--,Ze):ie},Dt.prototype.pop=function(){var k=this._root;if(k){for(;k.left;)k=k.left;return this._root=se(k.key,this._root,this._comparator),this._root=this._remove(k.key,this._root,this._comparator),{key:k.key,data:k.data}}return null},Dt.prototype.findStatic=function(k){for(var ie=this._root,ve=this._comparator;ie;){var Ze=ve(k,ie.key);if(Ze===0)return ie;Ze<0?ie=ie.left:ie=ie.right}return null},Dt.prototype.find=function(k){return this._root&&(this._root=se(k,this._root,this._comparator),this._comparator(k,this._root.key)!==0)?null:this._root},Dt.prototype.contains=function(k){for(var ie=this._root,ve=this._comparator;ie;){var Ze=ve(k,ie.key);if(Ze===0)return!0;Ze<0?ie=ie.left:ie=ie.right}return!1},Dt.prototype.forEach=function(k,ie){for(var ve=this._root,Ze=[],_t=!1;!_t;)ve!==null?(Ze.push(ve),ve=ve.left):Ze.length!==0?(ve=Ze.pop(),k.call(ie,ve),ve=ve.right):_t=!0;return this},Dt.prototype.range=function(k,ie,ve,Ze){for(var _t=[],Wt=this._comparator,Sr=this._root,He;_t.length!==0||Sr;)if(Sr)_t.push(Sr),Sr=Sr.left;else{if(Sr=_t.pop(),He=Wt(Sr.key,ie),He>0)break;if(Wt(Sr.key,k)>=0&&ve.call(Ze,Sr))return this;Sr=Sr.right}return this},Dt.prototype.keys=function(){var k=[];return this.forEach(function(ie){var ve=ie.key;return k.push(ve)}),k},Dt.prototype.values=function(){var k=[];return this.forEach(function(ie){var ve=ie.data;return k.push(ve)}),k},Dt.prototype.min=function(){return this._root?this.minNode(this._root).key:null},Dt.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},Dt.prototype.minNode=function(k){if(k===void 0&&(k=this._root),k)for(;k.left;)k=k.left;return k},Dt.prototype.maxNode=function(k){if(k===void 0&&(k=this._root),k)for(;k.right;)k=k.right;return k},Dt.prototype.at=function(k){for(var ie=this._root,ve=!1,Ze=0,_t=[];!ve;)if(ie)_t.push(ie),ie=ie.left;else if(_t.length>0){if(ie=_t.pop(),Ze===k)return ie;Ze++,ie=ie.right}else ve=!0;return null},Dt.prototype.next=function(k){var ie=this._root,ve=null;if(k.right){for(ve=k.right;ve.left;)ve=ve.left;return ve}for(var Ze=this._comparator;ie;){var _t=Ze(k.key,ie.key);if(_t===0)break;_t<0?(ve=ie,ie=ie.left):ie=ie.right}return ve},Dt.prototype.prev=function(k){var ie=this._root,ve=null;if(k.left!==null){for(ve=k.left;ve.right;)ve=ve.right;return ve}for(var Ze=this._comparator;ie;){var _t=Ze(k.key,ie.key);if(_t===0)break;_t<0?ie=ie.left:(ve=ie,ie=ie.right)}return ve},Dt.prototype.clear=function(){return this._root=null,this._size=0,this},Dt.prototype.toList=function(){return Zt(this._root)},Dt.prototype.load=function(k,ie,ve){ie===void 0&&(ie=[]),ve===void 0&&(ve=!1);var Ze=k.length,_t=this._comparator;if(ve&&xt(k,ie,0,Ze-1,_t),this._root===null)this._root=wt(k,ie,0,Ze),this._size=Ze;else{var Wt=Vt(this.toList(),Xt(k,ie),_t);Ze=this._size+Ze,this._root=nr({head:Wt},0,Ze)}return this},Dt.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(Dt.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(Dt.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),Dt.prototype.toString=function(k){k===void 0&&(k=function(Ze){return String(Ze.key)});var ie=[];return dt(this._root,"",!0,function(ve){return ie.push(ve)},k),ie.join("")},Dt.prototype.update=function(k,ie,ve){var Ze=this._comparator,_t=ae(k,this._root,Ze),Wt=_t.left,Sr=_t.right;Ze(k,ie)<0?Sr=Qe(ie,ve,Sr,Ze):Wt=Qe(ie,ve,Wt,Ze),this._root=et(Wt,Sr,Ze)},Dt.prototype.split=function(k){return ae(k,this._root,this._comparator)},Dt}();function wt(Dt,k,ie,ve){var Ze=ve-ie;if(Ze>0){var _t=ie+Math.floor(Ze/2),Wt=Dt[_t],Sr=k[_t],He=new U(Wt,Sr);return He.left=wt(Dt,k,ie,_t),He.right=wt(Dt,k,_t+1,ve),He}return null}function Xt(Dt,k){for(var ie=new U(null,null),ve=ie,Ze=0;Ze<Dt.length;Ze++)ve=ve.next=new U(Dt[Ze],k[Ze]);return ve.next=null,ie.next}function Zt(Dt){for(var k=Dt,ie=[],ve=!1,Ze=new U(null,null),_t=Ze;!ve;)k?(ie.push(k),k=k.left):ie.length>0?(k=_t=_t.next=ie.pop(),k=k.right):ve=!0;return _t.next=null,Ze.next}function nr(Dt,k,ie){var ve=ie-k;if(ve>0){var Ze=k+Math.floor(ve/2),_t=nr(Dt,k,Ze),Wt=Dt.head;return Wt.left=_t,Dt.head=Dt.head.next,Wt.right=nr(Dt,Ze+1,ie),Wt}return null}function Vt(Dt,k,ie){for(var ve=new U(null,null),Ze=ve,_t=Dt,Wt=k;_t!==null&&Wt!==null;)ie(_t.key,Wt.key)<0?(Ze.next=_t,_t=_t.next):(Ze.next=Wt,Wt=Wt.next),Ze=Ze.next;return _t!==null?Ze.next=_t:Wt!==null&&(Ze.next=Wt),ve.next}function xt(Dt,k,ie,ve,Ze){if(!(ie>=ve)){for(var _t=Dt[ie+ve>>1],Wt=ie-1,Sr=ve+1;;){do Wt++;while(Ze(Dt[Wt],_t)<0);do Sr--;while(Ze(Dt[Sr],_t)>0);if(Wt>=Sr)break;var He=Dt[Wt];Dt[Wt]=Dt[Sr],Dt[Sr]=He,He=k[Wt],k[Wt]=k[Sr],k[Sr]=He}xt(Dt,k,ie,Sr,Ze),xt(Dt,k,Sr+1,ve,Ze)}}var bt=function(k,ie){return k.ll.x<=ie.x&&ie.x<=k.ur.x&&k.ll.y<=ie.y&&ie.y<=k.ur.y},Tr=function(k,ie){if(ie.ur.x<k.ll.x||k.ur.x<ie.ll.x||ie.ur.y<k.ll.y||k.ur.y<ie.ll.y)return null;var ve=k.ll.x<ie.ll.x?ie.ll.x:k.ll.x,Ze=k.ur.x<ie.ur.x?k.ur.x:ie.ur.x,_t=k.ll.y<ie.ll.y?ie.ll.y:k.ll.y,Wt=k.ur.y<ie.ur.y?k.ur.y:ie.ur.y;return{ll:{x:ve,y:_t},ur:{x:Ze,y:Wt}}},hr=Number.EPSILON;hr===void 0&&(hr=Math.pow(2,-52));var lr=hr*hr,At=function(k,ie){if(-hr<k&&k<hr&&-hr<ie&&ie<hr)return 0;var ve=k-ie;return ve*ve<lr*k*ie?0:k<ie?-1:1},ut=function(){function Dt(){he(this,Dt),this.reset()}return le(Dt,[{key:"reset",value:function(){this.xRounder=new It,this.yRounder=new It}},{key:"round",value:function(ie,ve){return{x:this.xRounder.round(ie),y:this.yRounder.round(ve)}}}]),Dt}(),It=function(){function Dt(){he(this,Dt),this.tree=new Ye,this.round(0)}return le(Dt,[{key:"round",value:function(ie){var ve=this.tree.add(ie),Ze=this.tree.prev(ve);if(Ze!==null&&At(ve.key,Ze.key)===0)return this.tree.remove(ie),Ze.key;var _t=this.tree.next(ve);return _t!==null&&At(ve.key,_t.key)===0?(this.tree.remove(ie),_t.key):ie}}]),Dt}(),qe=new ut,Ct=function(k,ie){return k.x*ie.y-k.y*ie.x},fr=function(k,ie){return k.x*ie.x+k.y*ie.y},re=function(k,ie,ve){var Ze={x:ie.x-k.x,y:ie.y-k.y},_t={x:ve.x-k.x,y:ve.y-k.y},Wt=Ct(Ze,_t);return At(Wt,0)},V=function(k){return Math.sqrt(fr(k,k))},K=function(k,ie,ve){var Ze={x:ie.x-k.x,y:ie.y-k.y},_t={x:ve.x-k.x,y:ve.y-k.y};return Ct(_t,Ze)/V(_t)/V(Ze)},Me=function(k,ie,ve){var Ze={x:ie.x-k.x,y:ie.y-k.y},_t={x:ve.x-k.x,y:ve.y-k.y};return fr(_t,Ze)/V(_t)/V(Ze)},Se=function(k,ie,ve){return ie.y===0?null:{x:k.x+ie.x/ie.y*(ve-k.y),y:ve}},nt=function(k,ie,ve){return ie.x===0?null:{x:ve,y:k.y+ie.y/ie.x*(ve-k.x)}},te=function(k,ie,ve,Ze){if(ie.x===0)return nt(ve,Ze,k.x);if(Ze.x===0)return nt(k,ie,ve.x);if(ie.y===0)return Se(ve,Ze,k.y);if(Ze.y===0)return Se(k,ie,ve.y);var _t=Ct(ie,Ze);if(_t==0)return null;var Wt={x:ve.x-k.x,y:ve.y-k.y},Sr=Ct(Wt,ie)/_t,He=Ct(Wt,Ze)/_t,Et=k.x+He*ie.x,cr=ve.x+Sr*Ze.x,mr=k.y+He*ie.y,Zr=ve.y+Sr*Ze.y,Fn=(Et+cr)/2,En=(mr+Zr)/2;return{x:Fn,y:En}},Ce=function(){le(Dt,null,[{key:"compare",value:function(ie,ve){var Ze=Dt.comparePoints(ie.point,ve.point);return Ze!==0?Ze:(ie.point!==ve.point&&ie.link(ve),ie.isLeft!==ve.isLeft?ie.isLeft?1:-1:Xe.compare(ie.segment,ve.segment))}},{key:"comparePoints",value:function(ie,ve){return ie.x<ve.x?-1:ie.x>ve.x?1:ie.y<ve.y?-1:ie.y>ve.y?1:0}}]);function Dt(k,ie){he(this,Dt),k.events===void 0?k.events=[this]:k.events.push(this),this.point=k,this.isLeft=ie}return le(Dt,[{key:"link",value:function(ie){if(ie.point===this.point)throw new Error("Tried to link already linked events");for(var ve=ie.point.events,Ze=0,_t=ve.length;Ze<_t;Ze++){var Wt=ve[Ze];this.point.events.push(Wt),Wt.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var ie=this.point.events.length,ve=0;ve<ie;ve++){var Ze=this.point.events[ve];if(Ze.segment.consumedBy===void 0)for(var _t=ve+1;_t<ie;_t++){var Wt=this.point.events[_t];Wt.consumedBy===void 0&&Ze.otherSE.point.events===Wt.otherSE.point.events&&Ze.segment.consume(Wt.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var ie=[],ve=0,Ze=this.point.events.length;ve<Ze;ve++){var _t=this.point.events[ve];_t!==this&&!_t.segment.ringOut&&_t.segment.isInResult()&&ie.push(_t)}return ie}},{key:"getLeftmostComparator",value:function(ie){var ve=this,Ze=new Map,_t=function(Sr){var He=Sr.otherSE;Ze.set(Sr,{sine:K(ve.point,ie.point,He.point),cosine:Me(ve.point,ie.point,He.point)})};return function(Wt,Sr){Ze.has(Wt)||_t(Wt),Ze.has(Sr)||_t(Sr);var He=Ze.get(Wt),Et=He.sine,cr=He.cosine,mr=Ze.get(Sr),Zr=mr.sine,Fn=mr.cosine;return Et>=0&&Zr>=0?cr<Fn?1:cr>Fn?-1:0:Et<0&&Zr<0?cr<Fn?-1:cr>Fn?1:0:Zr<Et?-1:Zr>Et?1:0}}}]),Dt}(),we=0,Xe=function(){le(Dt,null,[{key:"compare",value:function(ie,ve){var Ze=ie.leftSE.point.x,_t=ve.leftSE.point.x,Wt=ie.rightSE.point.x,Sr=ve.rightSE.point.x;if(Sr<Ze)return 1;if(Wt<_t)return-1;var He=ie.leftSE.point.y,Et=ve.leftSE.point.y,cr=ie.rightSE.point.y,mr=ve.rightSE.point.y;if(Ze<_t){if(Et<He&&Et<cr)return 1;if(Et>He&&Et>cr)return-1;var Zr=ie.comparePoint(ve.leftSE.point);if(Zr<0)return 1;if(Zr>0)return-1;var Fn=ve.comparePoint(ie.rightSE.point);return Fn!==0?Fn:-1}if(Ze>_t){if(He<Et&&He<mr)return-1;if(He>Et&&He>mr)return 1;var En=ve.comparePoint(ie.leftSE.point);if(En!==0)return En;var Cn=ie.comparePoint(ve.rightSE.point);return Cn<0?1:Cn>0?-1:1}if(He<Et)return-1;if(He>Et)return 1;if(Wt<Sr){var fn=ve.comparePoint(ie.rightSE.point);if(fn!==0)return fn}if(Wt>Sr){var ni=ie.comparePoint(ve.rightSE.point);if(ni<0)return 1;if(ni>0)return-1}if(Wt!==Sr){var Yn=cr-He,oa=Wt-Ze,Qi=mr-Et,lo=Sr-_t;if(Yn>oa&&Qi<lo)return 1;if(Yn<oa&&Qi>lo)return-1}return Wt>Sr?1:Wt<Sr||cr<mr?-1:cr>mr?1:ie.id<ve.id?-1:ie.id>ve.id?1:0}}]);function Dt(k,ie,ve,Ze){he(this,Dt),this.id=++we,this.leftSE=k,k.segment=this,k.otherSE=ie,this.rightSE=ie,ie.segment=this,ie.otherSE=k,this.rings=ve,this.windings=Ze}return le(Dt,[{key:"replaceRightSE",value:function(ie){this.rightSE=ie,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var ie=this.leftSE.point.y,ve=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:ie<ve?ie:ve},ur:{x:this.rightSE.point.x,y:ie>ve?ie:ve}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(ie){return ie.x===this.leftSE.point.x&&ie.y===this.leftSE.point.y||ie.x===this.rightSE.point.x&&ie.y===this.rightSE.point.y}},{key:"comparePoint",value:function(ie){if(this.isAnEndpoint(ie))return 0;var ve=this.leftSE.point,Ze=this.rightSE.point,_t=this.vector();if(ve.x===Ze.x)return ie.x===ve.x?0:ie.x<ve.x?1:-1;var Wt=(ie.y-ve.y)/_t.y,Sr=ve.x+Wt*_t.x;if(ie.x===Sr)return 0;var He=(ie.x-ve.x)/_t.x,Et=ve.y+He*_t.y;return ie.y===Et?0:ie.y<Et?-1:1}},{key:"getIntersection",value:function(ie){var ve=this.bbox(),Ze=ie.bbox(),_t=Tr(ve,Ze);if(_t===null)return null;var Wt=this.leftSE.point,Sr=this.rightSE.point,He=ie.leftSE.point,Et=ie.rightSE.point,cr=bt(ve,He)&&this.comparePoint(He)===0,mr=bt(Ze,Wt)&&ie.comparePoint(Wt)===0,Zr=bt(ve,Et)&&this.comparePoint(Et)===0,Fn=bt(Ze,Sr)&&ie.comparePoint(Sr)===0;if(mr&&cr)return Fn&&!Zr?Sr:!Fn&&Zr?Et:null;if(mr)return Zr&&Wt.x===Et.x&&Wt.y===Et.y?null:Wt;if(cr)return Fn&&Sr.x===He.x&&Sr.y===He.y?null:He;if(Fn&&Zr)return null;if(Fn)return Sr;if(Zr)return Et;var En=te(Wt,this.vector(),He,ie.vector());return En===null||!bt(_t,En)?null:qe.round(En.x,En.y)}},{key:"split",value:function(ie){var ve=[],Ze=ie.events!==void 0,_t=new Ce(ie,!0),Wt=new Ce(ie,!1),Sr=this.rightSE;this.replaceRightSE(Wt),ve.push(Wt),ve.push(_t);var He=new Dt(_t,Sr,this.rings.slice(),this.windings.slice());return Ce.comparePoints(He.leftSE.point,He.rightSE.point)>0&&He.swapEvents(),Ce.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),Ze&&(_t.checkForConsuming(),Wt.checkForConsuming()),ve}},{key:"swapEvents",value:function(){var ie=this.rightSE;this.rightSE=this.leftSE,this.leftSE=ie,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var ve=0,Ze=this.windings.length;ve<Ze;ve++)this.windings[ve]*=-1}},{key:"consume",value:function(ie){for(var ve=this,Ze=ie;ve.consumedBy;)ve=ve.consumedBy;for(;Ze.consumedBy;)Ze=Ze.consumedBy;var _t=Dt.compare(ve,Ze);if(_t!==0){if(_t>0){var Wt=ve;ve=Ze,Ze=Wt}if(ve.prev===Ze){var Sr=ve;ve=Ze,Ze=Sr}for(var He=0,Et=Ze.rings.length;He<Et;He++){var cr=Ze.rings[He],mr=Ze.windings[He],Zr=ve.rings.indexOf(cr);Zr===-1?(ve.rings.push(cr),ve.windings.push(mr)):ve.windings[Zr]+=mr}Ze.rings=null,Ze.windings=null,Ze.consumedBy=ve,Ze.leftSE.consumedBy=ve.leftSE,Ze.rightSE.consumedBy=ve.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var ie=this.prev.consumedBy||this.prev;this._beforeState=ie.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var ie=this.beforeState();this._afterState={rings:ie.rings.slice(0),windings:ie.windings.slice(0),multiPolys:[]};for(var ve=this._afterState.rings,Ze=this._afterState.windings,_t=this._afterState.multiPolys,Wt=0,Sr=this.rings.length;Wt<Sr;Wt++){var He=this.rings[Wt],Et=this.windings[Wt],cr=ve.indexOf(He);cr===-1?(ve.push(He),Ze.push(Et)):Ze[cr]+=Et}for(var mr=[],Zr=[],Fn=0,En=ve.length;Fn<En;Fn++)if(Ze[Fn]!==0){var Cn=ve[Fn],fn=Cn.poly;if(Zr.indexOf(fn)===-1)if(Cn.isExterior)mr.push(fn);else{Zr.indexOf(fn)===-1&&Zr.push(fn);var ni=mr.indexOf(Cn.poly);ni!==-1&&mr.splice(ni,1)}}for(var Yn=0,oa=mr.length;Yn<oa;Yn++){var Qi=mr[Yn].multiPoly;_t.indexOf(Qi)===-1&&_t.push(Qi)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var ie=this.beforeState().multiPolys,ve=this.afterState().multiPolys;switch(Ri.type){case"union":{var Ze=ie.length===0,_t=ve.length===0;this._isInResult=Ze!==_t;break}case"intersection":{var Wt,Sr;ie.length<ve.length?(Wt=ie.length,Sr=ve.length):(Wt=ve.length,Sr=ie.length),this._isInResult=Sr===Ri.numMultiPolys&&Wt<Sr;break}case"xor":{var He=Math.abs(ie.length-ve.length);this._isInResult=He%2===1;break}case"difference":{var Et=function(mr){return mr.length===1&&mr[0].isSubject};this._isInResult=Et(ie)!==Et(ve);break}default:throw new Error("Unrecognized operation type found ".concat(Ri.type))}return this._isInResult}}],[{key:"fromRing",value:function(ie,ve,Ze){var _t,Wt,Sr,He=Ce.comparePoints(ie,ve);if(He<0)_t=ie,Wt=ve,Sr=1;else if(He>0)_t=ve,Wt=ie,Sr=-1;else throw new Error("Tried to create degenerate segment at [".concat(ie.x,", ").concat(ie.y,"]"));var Et=new Ce(_t,!0),cr=new Ce(Wt,!1);return new Dt(Et,cr,[Ze],[Sr])}}]),Dt}(),Lt=function(){function Dt(k,ie,ve){if(he(this,Dt),!Array.isArray(k)||k.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=ie,this.isExterior=ve,this.segments=[],typeof k[0][0]!="number"||typeof k[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var Ze=qe.round(k[0][0],k[0][1]);this.bbox={ll:{x:Ze.x,y:Ze.y},ur:{x:Ze.x,y:Ze.y}};for(var _t=Ze,Wt=1,Sr=k.length;Wt<Sr;Wt++){if(typeof k[Wt][0]!="number"||typeof k[Wt][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var He=qe.round(k[Wt][0],k[Wt][1]);He.x===_t.x&&He.y===_t.y||(this.segments.push(Xe.fromRing(_t,He,this)),He.x<this.bbox.ll.x&&(this.bbox.ll.x=He.x),He.y<this.bbox.ll.y&&(this.bbox.ll.y=He.y),He.x>this.bbox.ur.x&&(this.bbox.ur.x=He.x),He.y>this.bbox.ur.y&&(this.bbox.ur.y=He.y),_t=He)}(Ze.x!==_t.x||Ze.y!==_t.y)&&this.segments.push(Xe.fromRing(_t,Ze,this))}return le(Dt,[{key:"getSweepEvents",value:function(){for(var ie=[],ve=0,Ze=this.segments.length;ve<Ze;ve++){var _t=this.segments[ve];ie.push(_t.leftSE),ie.push(_t.rightSE)}return ie}}]),Dt}(),Ht=function(){function Dt(k,ie){if(he(this,Dt),!Array.isArray(k))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Lt(k[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var ve=1,Ze=k.length;ve<Ze;ve++){var _t=new Lt(k[ve],this,!1);_t.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=_t.bbox.ll.x),_t.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=_t.bbox.ll.y),_t.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=_t.bbox.ur.x),_t.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=_t.bbox.ur.y),this.interiorRings.push(_t)}this.multiPoly=ie}return le(Dt,[{key:"getSweepEvents",value:function(){for(var ie=this.exteriorRing.getSweepEvents(),ve=0,Ze=this.interiorRings.length;ve<Ze;ve++)for(var _t=this.interiorRings[ve].getSweepEvents(),Wt=0,Sr=_t.length;Wt<Sr;Wt++)ie.push(_t[Wt]);return ie}}]),Dt}(),on=function(){function Dt(k,ie){if(he(this,Dt),!Array.isArray(k))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof k[0][0][0]=="number"&&(k=[k])}catch(Wt){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var ve=0,Ze=k.length;ve<Ze;ve++){var _t=new Ht(k[ve],this);_t.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=_t.bbox.ll.x),_t.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=_t.bbox.ll.y),_t.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=_t.bbox.ur.x),_t.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=_t.bbox.ur.y),this.polys.push(_t)}this.isSubject=ie}return le(Dt,[{key:"getSweepEvents",value:function(){for(var ie=[],ve=0,Ze=this.polys.length;ve<Ze;ve++)for(var _t=this.polys[ve].getSweepEvents(),Wt=0,Sr=_t.length;Wt<Sr;Wt++)ie.push(_t[Wt]);return ie}}]),Dt}(),Jr=function(){le(Dt,null,[{key:"factory",value:function(ie){for(var ve=[],Ze=0,_t=ie.length;Ze<_t;Ze++){var Wt=ie[Ze];if(!(!Wt.isInResult()||Wt.ringOut)){for(var Sr=null,He=Wt.leftSE,Et=Wt.rightSE,cr=[He],mr=He.point,Zr=[];Sr=He,He=Et,cr.push(He),He.point!==mr;)for(;;){var Fn=He.getAvailableLinkedEvents();if(Fn.length===0){var En=cr[0].point,Cn=cr[cr.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(En.x,",")+" ".concat(En.y,"]. Last matching segment found ends at")+" [".concat(Cn.x,", ").concat(Cn.y,"]."))}if(Fn.length===1){Et=Fn[0].otherSE;break}for(var fn=null,ni=0,Yn=Zr.length;ni<Yn;ni++)if(Zr[ni].point===He.point){fn=ni;break}if(fn!==null){var oa=Zr.splice(fn)[0],Qi=cr.splice(oa.index);Qi.unshift(Qi[0].otherSE),ve.push(new Dt(Qi.reverse()));continue}Zr.push({index:cr.length,point:He.point});var lo=He.getLeftmostComparator(Sr);Et=Fn.sort(lo)[0].otherSE;break}ve.push(new Dt(cr))}}return ve}}]);function Dt(k){he(this,Dt),this.events=k;for(var ie=0,ve=k.length;ie<ve;ie++)k[ie].segment.ringOut=this;this.poly=null}return le(Dt,[{key:"getGeom",value:function(){for(var ie=this.events[0].point,ve=[ie],Ze=1,_t=this.events.length-1;Ze<_t;Ze++){var Wt=this.events[Ze].point,Sr=this.events[Ze+1].point;re(Wt,ie,Sr)!==0&&(ve.push(Wt),ie=Wt)}if(ve.length===1)return null;var He=ve[0],Et=ve[1];re(He,ie,Et)===0&&ve.shift(),ve.push(ve[0]);for(var cr=this.isExteriorRing()?1:-1,mr=this.isExteriorRing()?0:ve.length-1,Zr=this.isExteriorRing()?ve.length:-1,Fn=[],En=mr;En!=Zr;En+=cr)Fn.push([ve[En].x,ve[En].y]);return Fn}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var ie=this.enclosingRing();this._isExteriorRing=ie?!ie.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var ie=this.events[0],ve=1,Ze=this.events.length;ve<Ze;ve++){var _t=this.events[ve];Ce.compare(ie,_t)>0&&(ie=_t)}for(var Wt=ie.segment.prevInResult(),Sr=Wt?Wt.prevInResult():null;;){if(!Wt)return null;if(!Sr)return Wt.ringOut;if(Sr.ringOut!==Wt.ringOut)return Sr.ringOut.enclosingRing()!==Wt.ringOut?Wt.ringOut:Wt.ringOut.enclosingRing();Wt=Sr.prevInResult(),Sr=Wt?Wt.prevInResult():null}}}]),Dt}(),Hr=function(){function Dt(k){he(this,Dt),this.exteriorRing=k,k.poly=this,this.interiorRings=[]}return le(Dt,[{key:"addInterior",value:function(ie){this.interiorRings.push(ie),ie.poly=this}},{key:"getGeom",value:function(){var ie=[this.exteriorRing.getGeom()];if(ie[0]===null)return null;for(var ve=0,Ze=this.interiorRings.length;ve<Ze;ve++){var _t=this.interiorRings[ve].getGeom();_t!==null&&ie.push(_t)}return ie}}]),Dt}(),Un=function(){function Dt(k){he(this,Dt),this.rings=k,this.polys=this._composePolys(k)}return le(Dt,[{key:"getGeom",value:function(){for(var ie=[],ve=0,Ze=this.polys.length;ve<Ze;ve++){var _t=this.polys[ve].getGeom();_t!==null&&ie.push(_t)}return ie}},{key:"_composePolys",value:function(ie){for(var ve=[],Ze=0,_t=ie.length;Ze<_t;Ze++){var Wt=ie[Ze];if(!Wt.poly)if(Wt.isExteriorRing())ve.push(new Hr(Wt));else{var Sr=Wt.enclosingRing();Sr.poly||ve.push(new Hr(Sr)),Sr.poly.addInterior(Wt)}}return ve}}]),Dt}(),bn=function(){function Dt(k){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xe.compare;he(this,Dt),this.queue=k,this.tree=new Ye(ie),this.segments=[]}return le(Dt,[{key:"process",value:function(ie){var ve=ie.segment,Ze=[];if(ie.consumedBy)return ie.isLeft?this.queue.remove(ie.otherSE):this.tree.remove(ve),Ze;var _t=ie.isLeft?this.tree.insert(ve):this.tree.find(ve);if(!_t)throw new Error("Unable to find segment #".concat(ve.id," ")+"[".concat(ve.leftSE.point.x,", ").concat(ve.leftSE.point.y,"] -> ")+"[".concat(ve.rightSE.point.x,", ").concat(ve.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var Wt=_t,Sr=_t,He=void 0,Et=void 0;He===void 0;)Wt=this.tree.prev(Wt),Wt===null?He=null:Wt.key.consumedBy===void 0&&(He=Wt.key);for(;Et===void 0;)Sr=this.tree.next(Sr),Sr===null?Et=null:Sr.key.consumedBy===void 0&&(Et=Sr.key);if(ie.isLeft){var cr=null;if(He){var mr=He.getIntersection(ve);if(mr!==null&&(ve.isAnEndpoint(mr)||(cr=mr),!He.isAnEndpoint(mr)))for(var Zr=this._splitSafely(He,mr),Fn=0,En=Zr.length;Fn<En;Fn++)Ze.push(Zr[Fn])}var Cn=null;if(Et){var fn=Et.getIntersection(ve);if(fn!==null&&(ve.isAnEndpoint(fn)||(Cn=fn),!Et.isAnEndpoint(fn)))for(var ni=this._splitSafely(Et,fn),Yn=0,oa=ni.length;Yn<oa;Yn++)Ze.push(ni[Yn])}if(cr!==null||Cn!==null){var Qi=null;if(cr===null)Qi=Cn;else if(Cn===null)Qi=cr;else{var lo=Ce.comparePoints(cr,Cn);Qi=lo<=0?cr:Cn}this.queue.remove(ve.rightSE),Ze.push(ve.rightSE);for(var Is=ve.split(Qi),hi=0,W=Is.length;hi<W;hi++)Ze.push(Is[hi])}Ze.length>0?(this.tree.remove(ve),Ze.push(ie)):(this.segments.push(ve),ve.prev=He)}else{if(He&&Et){var J=He.getIntersection(Et);if(J!==null){if(!He.isAnEndpoint(J))for(var oe=this._splitSafely(He,J),be=0,Oe=oe.length;be<Oe;be++)Ze.push(oe[be]);if(!Et.isAnEndpoint(J))for(var it=this._splitSafely(Et,J),pt=0,j=it.length;pt<j;pt++)Ze.push(it[pt])}}this.tree.remove(ve)}return Ze}},{key:"_splitSafely",value:function(ie,ve){this.tree.remove(ie);var Ze=ie.rightSE;this.queue.remove(Ze);var _t=ie.split(ve);return _t.push(Ze),ie.consumedBy===void 0&&this.tree.insert(ie),_t}}]),Dt}(),Kr=typeof q!="undefined"&&{NODE_ENV:"production",PUBLIC_PATH:"/"}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Mi=typeof q!="undefined"&&{NODE_ENV:"production",PUBLIC_PATH:"/"}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Si=function(){function Dt(){he(this,Dt)}return le(Dt,[{key:"run",value:function(ie,ve,Ze){Ri.type=ie,qe.reset();for(var _t=[new on(ve,!0)],Wt=0,Sr=Ze.length;Wt<Sr;Wt++)_t.push(new on(Ze[Wt],!1));if(Ri.numMultiPolys=_t.length,Ri.type==="difference")for(var He=_t[0],Et=1;Et<_t.length;)Tr(_t[Et].bbox,He.bbox)!==null?Et++:_t.splice(Et,1);if(Ri.type==="intersection"){for(var cr=0,mr=_t.length;cr<mr;cr++)for(var Zr=_t[cr],Fn=cr+1,En=_t.length;Fn<En;Fn++)if(Tr(Zr.bbox,_t[Fn].bbox)===null)return[]}for(var Cn=new Ye(Ce.compare),fn=0,ni=_t.length;fn<ni;fn++)for(var Yn=_t[fn].getSweepEvents(),oa=0,Qi=Yn.length;oa<Qi;oa++)if(Cn.insert(Yn[oa]),Cn.size>Kr)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var lo=new bn(Cn),Is=Cn.size,hi=Cn.pop();hi;){var W=hi.key;if(Cn.size===Is){var J=W.segment;throw new Error("Unable to pop() ".concat(W.isLeft?"left":"right"," SweepEvent ")+"[".concat(W.point.x,", ").concat(W.point.y,"] from segment #").concat(J.id," ")+"[".concat(J.leftSE.point.x,", ").concat(J.leftSE.point.y,"] -> ")+"[".concat(J.rightSE.point.x,", ").concat(J.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(Cn.size>Kr)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(lo.segments.length>Mi)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var oe=lo.process(W),be=0,Oe=oe.length;be<Oe;be++){var it=oe[be];it.consumedBy===void 0&&Cn.insert(it)}Is=Cn.size,hi=Cn.pop()}qe.reset();var pt=Jr.factory(lo.segments),j=new Un(pt);return j.getGeom()}}]),Dt}(),Ri=new Si,Gn=function(k){for(var ie=arguments.length,ve=new Array(ie>1?ie-1:0),Ze=1;Ze<ie;Ze++)ve[Ze-1]=arguments[Ze];return Ri.run("union",k,ve)},Dn=function(k){for(var ie=arguments.length,ve=new Array(ie>1?ie-1:0),Ze=1;Ze<ie;Ze++)ve[Ze-1]=arguments[Ze];return Ri.run("intersection",k,ve)},Ya=function(k){for(var ie=arguments.length,ve=new Array(ie>1?ie-1:0),Ze=1;Ze<ie;Ze++)ve[Ze-1]=arguments[Ze];return Ri.run("xor",k,ve)},Yi=function(k){for(var ie=arguments.length,ve=new Array(ie>1?ie-1:0),Ze=1;Ze<ie;Ze++)ve[Ze-1]=arguments[Ze];return Ri.run("difference",k,ve)},Na={union:Gn,intersection:Dn,xor:Ya,difference:Yi};return Na})},56034:function(rr,ee,L){var q=L(93738);var he;(function(_){(function(le){var U=typeof L.g=="object"?L.g:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),fe=se(_);typeof U.Reflect=="undefined"?U.Reflect=_:fe=se(U.Reflect,fe),le(fe);function se(Qe,ae){return function(et,dt){typeof Qe[et]!="function"&&Object.defineProperty(Qe,et,{configurable:!0,writable:!0,value:dt}),ae&&ae(et,dt)}}})(function(le){var U=Object.prototype.hasOwnProperty,fe=typeof Symbol=="function",se=fe&&typeof Symbol.toPrimitive!="undefined"?Symbol.toPrimitive:"@@toPrimitive",Qe=fe&&typeof Symbol.iterator!="undefined"?Symbol.iterator:"@@iterator",ae=typeof Object.create=="function",et={__proto__:[]}instanceof Array,dt=!ae&&!et,Ye={create:ae?function(){return Sr(Object.create(null))}:et?function(){return Sr({__proto__:null})}:function(){return Sr({})},has:dt?function(He,Et){return U.call(He,Et)}:function(He,Et){return Et in He},get:dt?function(He,Et){return U.call(He,Et)?He[Et]:void 0}:function(He,Et){return He[Et]}},wt=Object.getPrototypeOf(Function),Xt=typeof q=="object"&&q["env"]&&q["env"].REFLECT_METADATA_USE_MAP_POLYFILL==="true",Zt=!Xt&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ze(),nr=!Xt&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:_t(),Vt=!Xt&&typeof WeakMap=="function"?WeakMap:Wt(),xt=new Vt;function bt(He,Et,cr,mr){if(Ht(cr)){if(!Ri(He))throw new TypeError;if(!Dn(Et))throw new TypeError;return re(He,Et)}else{if(!Ri(He))throw new TypeError;if(!Hr(Et))throw new TypeError;if(!Hr(mr)&&!Ht(mr)&&!on(mr))throw new TypeError;return on(mr)&&(mr=void 0),cr=Si(cr),V(He,Et,cr,mr)}}le("decorate",bt);function Tr(He,Et){function cr(mr,Zr){if(!Hr(mr))throw new TypeError;if(!Ht(Zr)&&!Ya(Zr))throw new TypeError;Ce(He,Et,mr,Zr)}return cr}le("metadata",Tr);function hr(He,Et,cr,mr){if(!Hr(cr))throw new TypeError;return Ht(mr)||(mr=Si(mr)),Ce(He,Et,cr,mr)}le("defineMetadata",hr);function lr(He,Et,cr){if(!Hr(Et))throw new TypeError;return Ht(cr)||(cr=Si(cr)),Me(He,Et,cr)}le("hasMetadata",lr);function At(He,Et,cr){if(!Hr(Et))throw new TypeError;return Ht(cr)||(cr=Si(cr)),Se(He,Et,cr)}le("hasOwnMetadata",At);function ut(He,Et,cr){if(!Hr(Et))throw new TypeError;return Ht(cr)||(cr=Si(cr)),nt(He,Et,cr)}le("getMetadata",ut);function It(He,Et,cr){if(!Hr(Et))throw new TypeError;return Ht(cr)||(cr=Si(cr)),te(He,Et,cr)}le("getOwnMetadata",It);function qe(He,Et){if(!Hr(He))throw new TypeError;return Ht(Et)||(Et=Si(Et)),we(He,Et)}le("getMetadataKeys",qe);function Ct(He,Et){if(!Hr(He))throw new TypeError;return Ht(Et)||(Et=Si(Et)),Xe(He,Et)}le("getOwnMetadataKeys",Ct);function fr(He,Et,cr){if(!Hr(Et))throw new TypeError;Ht(cr)||(cr=Si(cr));var mr=K(Et,cr,!1);if(Ht(mr)||!mr.delete(He))return!1;if(mr.size>0)return!0;var Zr=xt.get(Et);return Zr.delete(cr),Zr.size>0||xt.delete(Et),!0}le("deleteMetadata",fr);function re(He,Et){for(var cr=He.length-1;cr>=0;--cr){var mr=He[cr],Zr=mr(Et);if(!Ht(Zr)&&!on(Zr)){if(!Dn(Zr))throw new TypeError;Et=Zr}}return Et}function V(He,Et,cr,mr){for(var Zr=He.length-1;Zr>=0;--Zr){var Fn=He[Zr],En=Fn(Et,cr,mr);if(!Ht(En)&&!on(En)){if(!Hr(En))throw new TypeError;mr=En}}return mr}function K(He,Et,cr){var mr=xt.get(He);if(Ht(mr)){if(!cr)return;mr=new Zt,xt.set(He,mr)}var Zr=mr.get(Et);if(Ht(Zr)){if(!cr)return;Zr=new Zt,mr.set(Et,Zr)}return Zr}function Me(He,Et,cr){var mr=Se(He,Et,cr);if(mr)return!0;var Zr=ve(Et);return on(Zr)?!1:Me(He,Zr,cr)}function Se(He,Et,cr){var mr=K(Et,cr,!1);return Ht(mr)?!1:Kr(mr.has(He))}function nt(He,Et,cr){var mr=Se(He,Et,cr);if(mr)return te(He,Et,cr);var Zr=ve(Et);if(!on(Zr))return nt(He,Zr,cr)}function te(He,Et,cr){var mr=K(Et,cr,!1);if(!Ht(mr))return mr.get(He)}function Ce(He,Et,cr,mr){var Zr=K(cr,mr,!0);Zr.set(He,Et)}function we(He,Et){var cr=Xe(He,Et),mr=ve(He);if(mr===null)return cr;var Zr=we(mr,Et);if(Zr.length<=0)return cr;if(cr.length<=0)return Zr;for(var Fn=new nr,En=[],Cn=0,fn=cr;Cn<fn.length;Cn++){var ni=fn[Cn],Yn=Fn.has(ni);Yn||(Fn.add(ni),En.push(ni))}for(var oa=0,Qi=Zr;oa<Qi.length;oa++){var ni=Qi[oa],Yn=Fn.has(ni);Yn||(Fn.add(ni),En.push(ni))}return En}function Xe(He,Et){var cr=[],mr=K(He,Et,!1);if(Ht(mr))return cr;for(var Zr=mr.keys(),Fn=Na(Zr),En=0;;){var Cn=k(Fn);if(!Cn)return cr.length=En,cr;var fn=Dt(Cn);try{cr[En]=fn}catch(ni){try{ie(Fn)}finally{throw ni}}En++}}function Lt(He){if(He===null)return 1;switch(typeof He){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return He===null?1:6;default:return 6}}function Ht(He){return He===void 0}function on(He){return He===null}function Jr(He){return typeof He=="symbol"}function Hr(He){return typeof He=="object"?He!==null:typeof He=="function"}function Un(He,Et){switch(Lt(He)){case 0:return He;case 1:return He;case 2:return He;case 3:return He;case 4:return He;case 5:return He}var cr=Et===3?"string":Et===5?"number":"default",mr=Yi(He,se);if(mr!==void 0){var Zr=mr.call(He,cr);if(Hr(Zr))throw new TypeError;return Zr}return bn(He,cr==="default"?"number":cr)}function bn(He,Et){if(Et==="string"){var cr=He.toString;if(Gn(cr)){var mr=cr.call(He);if(!Hr(mr))return mr}var Zr=He.valueOf;if(Gn(Zr)){var mr=Zr.call(He);if(!Hr(mr))return mr}}else{var Zr=He.valueOf;if(Gn(Zr)){var mr=Zr.call(He);if(!Hr(mr))return mr}var Fn=He.toString;if(Gn(Fn)){var mr=Fn.call(He);if(!Hr(mr))return mr}}throw new TypeError}function Kr(He){return!!He}function Mi(He){return""+He}function Si(He){var Et=Un(He,3);return Jr(Et)?Et:Mi(Et)}function Ri(He){return Array.isArray?Array.isArray(He):He instanceof Object?He instanceof Array:Object.prototype.toString.call(He)==="[object Array]"}function Gn(He){return typeof He=="function"}function Dn(He){return typeof He=="function"}function Ya(He){switch(Lt(He)){case 3:return!0;case 4:return!0;default:return!1}}function Yi(He,Et){var cr=He[Et];if(cr!=null){if(!Gn(cr))throw new TypeError;return cr}}function Na(He){var Et=Yi(He,Qe);if(!Gn(Et))throw new TypeError;var cr=Et.call(He);if(!Hr(cr))throw new TypeError;return cr}function Dt(He){return He.value}function k(He){var Et=He.next();return Et.done?!1:Et}function ie(He){var Et=He.return;Et&&Et.call(He)}function ve(He){var Et=Object.getPrototypeOf(He);if(typeof He!="function"||He===wt||Et!==wt)return Et;var cr=He.prototype,mr=cr&&Object.getPrototypeOf(cr);if(mr==null||mr===Object.prototype)return Et;var Zr=mr.constructor;return typeof Zr!="function"||Zr===He?Et:Zr}function Ze(){var He={},Et=[],cr=function(){function En(Cn,fn,ni){this._index=0,this._keys=Cn,this._values=fn,this._selector=ni}return En.prototype["@@iterator"]=function(){return this},En.prototype[Qe]=function(){return this},En.prototype.next=function(){var Cn=this._index;if(Cn>=0&&Cn<this._keys.length){var fn=this._selector(this._keys[Cn],this._values[Cn]);return Cn+1>=this._keys.length?(this._index=-1,this._keys=Et,this._values=Et):this._index++,{value:fn,done:!1}}return{value:void 0,done:!0}},En.prototype.throw=function(Cn){throw this._index>=0&&(this._index=-1,this._keys=Et,this._values=Et),Cn},En.prototype.return=function(Cn){return this._index>=0&&(this._index=-1,this._keys=Et,this._values=Et),{value:Cn,done:!0}},En}();return function(){function En(){this._keys=[],this._values=[],this._cacheKey=He,this._cacheIndex=-2}return Object.defineProperty(En.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),En.prototype.has=function(Cn){return this._find(Cn,!1)>=0},En.prototype.get=function(Cn){var fn=this._find(Cn,!1);return fn>=0?this._values[fn]:void 0},En.prototype.set=function(Cn,fn){var ni=this._find(Cn,!0);return this._values[ni]=fn,this},En.prototype.delete=function(Cn){var fn=this._find(Cn,!1);if(fn>=0){for(var ni=this._keys.length,Yn=fn+1;Yn<ni;Yn++)this._keys[Yn-1]=this._keys[Yn],this._values[Yn-1]=this._values[Yn];return this._keys.length--,this._values.length--,Cn===this._cacheKey&&(this._cacheKey=He,this._cacheIndex=-2),!0}return!1},En.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=He,this._cacheIndex=-2},En.prototype.keys=function(){return new cr(this._keys,this._values,mr)},En.prototype.values=function(){return new cr(this._keys,this._values,Zr)},En.prototype.entries=function(){return new cr(this._keys,this._values,Fn)},En.prototype["@@iterator"]=function(){return this.entries()},En.prototype[Qe]=function(){return this.entries()},En.prototype._find=function(Cn,fn){return this._cacheKey!==Cn&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=Cn)),this._cacheIndex<0&&fn&&(this._cacheIndex=this._keys.length,this._keys.push(Cn),this._values.push(void 0)),this._cacheIndex},En}();function mr(En,Cn){return En}function Zr(En,Cn){return Cn}function Fn(En,Cn){return[En,Cn]}}function _t(){return function(){function He(){this._map=new Zt}return Object.defineProperty(He.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),He.prototype.has=function(Et){return this._map.has(Et)},He.prototype.add=function(Et){return this._map.set(Et,Et),this},He.prototype.delete=function(Et){return this._map.delete(Et)},He.prototype.clear=function(){this._map.clear()},He.prototype.keys=function(){return this._map.keys()},He.prototype.values=function(){return this._map.values()},He.prototype.entries=function(){return this._map.entries()},He.prototype["@@iterator"]=function(){return this.keys()},He.prototype[Qe]=function(){return this.keys()},He}()}function Wt(){var He=16,Et=Ye.create(),cr=mr();return function(){function fn(){this._key=mr()}return fn.prototype.has=function(ni){var Yn=Zr(ni,!1);return Yn!==void 0?Ye.has(Yn,this._key):!1},fn.prototype.get=function(ni){var Yn=Zr(ni,!1);return Yn!==void 0?Ye.get(Yn,this._key):void 0},fn.prototype.set=function(ni,Yn){var oa=Zr(ni,!0);return oa[this._key]=Yn,this},fn.prototype.delete=function(ni){var Yn=Zr(ni,!1);return Yn!==void 0?delete Yn[this._key]:!1},fn.prototype.clear=function(){this._key=mr()},fn}();function mr(){var fn;do fn="@@WeakMap@@"+Cn();while(Ye.has(Et,fn));return Et[fn]=!0,fn}function Zr(fn,ni){if(!U.call(fn,cr)){if(!ni)return;Object.defineProperty(fn,cr,{value:Ye.create()})}return fn[cr]}function Fn(fn,ni){for(var Yn=0;Yn<ni;++Yn)fn[Yn]=Math.random()*255|0;return fn}function En(fn){return typeof Uint8Array=="function"?typeof crypto!="undefined"?crypto.getRandomValues(new Uint8Array(fn)):typeof msCrypto!="undefined"?msCrypto.getRandomValues(new Uint8Array(fn)):Fn(new Uint8Array(fn),fn):Fn(new Array(fn),fn)}function Cn(){var fn=En(He);fn[6]=fn[6]&79|64,fn[8]=fn[8]&191|128;for(var ni="",Yn=0;Yn<He;++Yn){var oa=fn[Yn];(Yn===4||Yn===6||Yn===8)&&(ni+="-"),oa<16&&(ni+="0"),ni+=oa.toString(16).toLowerCase()}return ni}}function Sr(He){return He.__=void 0,delete He.__,He}})})(he||(he={}))},63663:function(rr){(function(ee,L){rr.exports=L()})(this,function(){"use strict";var ee=function(z){return z instanceof Uint8Array||z instanceof Uint16Array||z instanceof Uint32Array||z instanceof Int8Array||z instanceof Int16Array||z instanceof Int32Array||z instanceof Float32Array||z instanceof Float64Array||z instanceof Uint8ClampedArray},L=function(z,Ae){for(var je=Object.keys(Ae),jt=0;jt<je.length;++jt)z[je[jt]]=Ae[je[jt]];return z},q=`
|
|
`;function he(z){return typeof atob!="undefined"?atob(z):"base64:"+z}function _(z){var Ae=new Error("(regl) "+z);throw console.error(Ae),Ae}function le(z,Ae){z||_(Ae)}function U(z){return z?": "+z:""}function fe(z,Ae,je){z in Ae||_("unknown parameter ("+z+")"+U(je)+". possible values: "+Object.keys(Ae).join())}function se(z,Ae){ee(z)||_("invalid parameter type"+U(Ae)+". must be a typed array")}function Qe(z,Ae){switch(Ae){case"number":return typeof z=="number";case"object":return typeof z=="object";case"string":return typeof z=="string";case"boolean":return typeof z=="boolean";case"function":return typeof z=="function";case"undefined":return typeof z=="undefined";case"symbol":return typeof z=="symbol"}}function ae(z,Ae,je){Qe(z,Ae)||_("invalid parameter type"+U(je)+". expected "+Ae+", got "+typeof z)}function et(z,Ae){z>=0&&(z|0)===z||_("invalid parameter type, ("+z+")"+U(Ae)+". must be a nonnegative integer")}function dt(z,Ae,je){Ae.indexOf(z)<0&&_("invalid value"+U(je)+". must be one of: "+Ae)}var Ye=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function wt(z){Object.keys(z).forEach(function(Ae){Ye.indexOf(Ae)<0&&_('invalid regl constructor argument "'+Ae+'". must be one of '+Ye)})}function Xt(z,Ae){for(z=z+"";z.length<Ae;)z=" "+z;return z}function Zt(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function nr(z,Ae){this.number=z,this.line=Ae,this.errors=[]}function Vt(z,Ae,je){this.file=z,this.line=Ae,this.message=je}function xt(){var z=new Error,Ae=(z.stack||z).toString(),je=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(Ae);if(je)return je[1];var jt=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(Ae);return jt?jt[1]:"unknown"}function bt(){var z=new Error,Ae=(z.stack||z).toString(),je=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(Ae);if(je)return je[1];var jt=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(Ae);return jt?jt[1]:"unknown"}function Tr(z,Ae){var je=z.split(`
|
|
`),jt=1,pr=0,Gt={unknown:new Zt,0:new Zt};Gt.unknown.name=Gt[0].name=Ae||xt(),Gt.unknown.lines.push(new nr(0,""));for(var kt=0;kt<je.length;++kt){var Dr=je[kt],Cr=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(Dr);if(Cr)switch(Cr[1]){case"line":var Vr=/(\d+)(\s+\d+)?/.exec(Cr[2]);Vr&&(jt=Vr[1]|0,Vr[2]&&(pr=Vr[2]|0,pr in Gt||(Gt[pr]=new Zt)));break;case"define":var Br=/SHADER_NAME(_B64)?\s+(.*)$/.exec(Cr[2]);Br&&(Gt[pr].name=Br[1]?he(Br[2]):Br[2]);break}Gt[pr].lines.push(new nr(jt++,Dr))}return Object.keys(Gt).forEach(function(Ur){var Gr=Gt[Ur];Gr.lines.forEach(function(Ar){Gr.index[Ar.number]=Ar})}),Gt}function hr(z){var Ae=[];return z.split(`
|
|
`).forEach(function(je){if(!(je.length<5)){var jt=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(je);jt?Ae.push(new Vt(jt[1]|0,jt[2]|0,jt[3].trim())):je.length>0&&Ae.push(new Vt("unknown",0,je))}}),Ae}function lr(z,Ae){Ae.forEach(function(je){var jt=z[je.file];if(jt){var pr=jt.index[je.line];if(pr){pr.errors.push(je),jt.hasErrors=!0;return}}z.unknown.hasErrors=!0,z.unknown.lines[0].errors.push(je)})}function At(z,Ae,je,jt,pr){if(!z.getShaderParameter(Ae,z.COMPILE_STATUS)){var Gt=z.getShaderInfoLog(Ae),kt=jt===z.FRAGMENT_SHADER?"fragment":"vertex";V(je,"string",kt+" shader source must be a string",pr);var Dr=Tr(je,pr),Cr=hr(Gt);lr(Dr,Cr),Object.keys(Dr).forEach(function(Vr){var Br=Dr[Vr];if(!Br.hasErrors)return;var Ur=[""],Gr=[""];function Ar(zr,Tt){Ur.push(zr),Gr.push(Tt||"")}Ar("file number "+Vr+": "+Br.name+`
|
|
`,"color:red;text-decoration:underline;font-weight:bold"),Br.lines.forEach(function(zr){if(zr.errors.length>0){Ar(Xt(zr.number,4)+"| ","background-color:yellow; font-weight:bold"),Ar(zr.line+q,"color:red; background-color:yellow; font-weight:bold");var Tt=0;zr.errors.forEach(function(er){var Fr=er.message,rn=/^\s*'(.*)'\s*:\s*(.*)$/.exec(Fr);if(rn){var yr=rn[1];switch(Fr=rn[2],yr){case"assign":yr="=";break}Tt=Math.max(zr.line.indexOf(yr,Tt),0)}else Tt=0;Ar(Xt("| ",6)),Ar(Xt("^^^",Tt+3)+q,"font-weight:bold"),Ar(Xt("| ",6)),Ar(Fr+q,"font-weight:bold")}),Ar(Xt("| ",6)+q)}else Ar(Xt(zr.number,4)+"| "),Ar(zr.line+q,"color:red")}),typeof document!="undefined"&&!window.chrome?(Gr[0]=Ur.join("%c"),console.log.apply(console,Gr)):console.log(Ur.join(""))}),le.raise("Error compiling "+kt+" shader, "+Dr[0].name)}}function ut(z,Ae,je,jt,pr){if(!z.getProgramParameter(Ae,z.LINK_STATUS)){var Gt=z.getProgramInfoLog(Ae),kt=Tr(je,pr),Dr=Tr(jt,pr),Cr='Error linking program with vertex shader, "'+Dr[0].name+'", and fragment shader "'+kt[0].name+'"';typeof document!="undefined"?console.log("%c"+Cr+q+"%c"+Gt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(Cr+q+Gt),le.raise(Cr)}}function It(z){z._commandRef=xt()}function qe(z,Ae,je,jt){It(z);function pr(Cr){return Cr?jt.id(Cr):0}z._fragId=pr(z.static.frag),z._vertId=pr(z.static.vert);function Gt(Cr,Vr){Object.keys(Vr).forEach(function(Br){Cr[jt.id(Br)]=!0})}var kt=z._uniformSet={};Gt(kt,Ae.static),Gt(kt,Ae.dynamic);var Dr=z._attributeSet={};Gt(Dr,je.static),Gt(Dr,je.dynamic),z._hasCount="count"in z.static||"count"in z.dynamic||"elements"in z.static||"elements"in z.dynamic}function Ct(z,Ae){var je=bt();_(z+" in command "+(Ae||xt())+(je==="unknown"?"":" called from "+je))}function fr(z,Ae,je){z||Ct(Ae,je||xt())}function re(z,Ae,je,jt){z in Ae||Ct("unknown parameter ("+z+")"+U(je)+". possible values: "+Object.keys(Ae).join(),jt||xt())}function V(z,Ae,je,jt){Qe(z,Ae)||Ct("invalid parameter type"+U(je)+". expected "+Ae+", got "+typeof z,jt||xt())}function K(z){z()}function Me(z,Ae,je){z.texture?dt(z.texture._texture.internalformat,Ae,"unsupported texture format for attachment"):dt(z.renderbuffer._renderbuffer.format,je,"unsupported renderbuffer format for attachment")}var Se=33071,nt=9728,te=9984,Ce=9985,we=9986,Xe=9987,Lt=5120,Ht=5121,on=5122,Jr=5123,Hr=5124,Un=5125,bn=5126,Kr=32819,Mi=32820,Si=33635,Ri=34042,Gn=36193,Dn={};Dn[Lt]=Dn[Ht]=1,Dn[on]=Dn[Jr]=Dn[Gn]=Dn[Si]=Dn[Kr]=Dn[Mi]=2,Dn[Hr]=Dn[Un]=Dn[bn]=Dn[Ri]=4;function Ya(z,Ae){return z===Mi||z===Kr||z===Si?2:z===Ri?4:Dn[z]*Ae}function Yi(z){return!(z&z-1)&&!!z}function Na(z,Ae,je){var jt,pr=Ae.width,Gt=Ae.height,kt=Ae.channels;le(pr>0&&pr<=je.maxTextureSize&&Gt>0&&Gt<=je.maxTextureSize,"invalid texture shape"),(z.wrapS!==Se||z.wrapT!==Se)&&le(Yi(pr)&&Yi(Gt),"incompatible wrap mode for texture, both width and height must be power of 2"),Ae.mipmask===1?pr!==1&&Gt!==1&&le(z.minFilter!==te&&z.minFilter!==we&&z.minFilter!==Ce&&z.minFilter!==Xe,"min filter requires mipmap"):(le(Yi(pr)&&Yi(Gt),"texture must be a square power of 2 to support mipmapping"),le(Ae.mipmask===(pr<<1)-1,"missing or incomplete mipmap data")),Ae.type===bn&&(je.extensions.indexOf("oes_texture_float_linear")<0&&le(z.minFilter===nt&&z.magFilter===nt,"filter not supported, must enable oes_texture_float_linear"),le(!z.genMipmaps,"mipmap generation not supported with float textures"));var Dr=Ae.images;for(jt=0;jt<16;++jt)if(Dr[jt]){var Cr=pr>>jt,Vr=Gt>>jt;le(Ae.mipmask&1<<jt,"missing mipmap data");var Br=Dr[jt];if(le(Br.width===Cr&&Br.height===Vr,"invalid shape for mip images"),le(Br.format===Ae.format&&Br.internalformat===Ae.internalformat&&Br.type===Ae.type,"incompatible type for mip image"),!Br.compressed)if(Br.data){var Ur=Math.ceil(Ya(Br.type,kt)*Cr/Br.unpackAlignment)*Br.unpackAlignment;le(Br.data.byteLength===Ur*Vr,"invalid data for image, buffer size is inconsistent with image format")}else Br.element||Br.copy}else z.genMipmaps||le((Ae.mipmask&1<<jt)===0,"extra mipmap data");Ae.compressed&&le(!z.genMipmaps,"mipmap generation for compressed images not supported")}function Dt(z,Ae,je,jt){var pr=z.width,Gt=z.height,kt=z.channels;le(pr>0&&pr<=jt.maxTextureSize&&Gt>0&&Gt<=jt.maxTextureSize,"invalid texture shape"),le(pr===Gt,"cube map must be square"),le(Ae.wrapS===Se&&Ae.wrapT===Se,"wrap mode not supported by cube map");for(var Dr=0;Dr<je.length;++Dr){var Cr=je[Dr];le(Cr.width===pr&&Cr.height===Gt,"inconsistent cube map face shape"),Ae.genMipmaps&&(le(!Cr.compressed,"can not generate mipmap for compressed textures"),le(Cr.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var Vr=Cr.images,Br=0;Br<16;++Br){var Ur=Vr[Br];if(Ur){var Gr=pr>>Br,Ar=Gt>>Br;le(Cr.mipmask&1<<Br,"missing mipmap data"),le(Ur.width===Gr&&Ur.height===Ar,"invalid shape for mip images"),le(Ur.format===z.format&&Ur.internalformat===z.internalformat&&Ur.type===z.type,"incompatible type for mip image"),Ur.compressed||(Ur.data?le(Ur.data.byteLength===Gr*Ar*Math.max(Ya(Ur.type,kt),Ur.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):Ur.element||Ur.copy)}}}}var k=L(le,{optional:K,raise:_,commandRaise:Ct,command:fr,parameter:fe,commandParameter:re,constructor:wt,type:ae,commandType:V,isTypedArray:se,nni:et,oneOf:dt,shaderError:At,linkError:ut,callSite:bt,saveCommandRef:It,saveDrawInfo:qe,framebufferFormat:Me,guessCommand:xt,texture2D:Na,textureCube:Dt}),ie=0,ve=0;function Ze(z,Ae){this.id=ie++,this.type=z,this.data=Ae}function _t(z){return z.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Wt(z){if(z.length===0)return[];var Ae=z.charAt(0),je=z.charAt(z.length-1);if(z.length>1&&Ae===je&&(Ae==='"'||Ae==="'"))return['"'+_t(z.substr(1,z.length-2))+'"'];var jt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(z);if(jt)return Wt(z.substr(0,jt.index)).concat(Wt(jt[1])).concat(Wt(z.substr(jt.index+jt[0].length)));var pr=z.split(".");if(pr.length===1)return['"'+_t(z)+'"'];for(var Gt=[],kt=0;kt<pr.length;++kt)Gt=Gt.concat(Wt(pr[kt]));return Gt}function Sr(z){return"["+Wt(z).join("][")+"]"}function He(z,Ae){return new Ze(z,Sr(Ae+""))}function Et(z){return typeof z=="function"&&!z._reglType||z instanceof Ze}function cr(z,Ae){return typeof z=="function"?new Ze(ve,z):z}var mr={DynamicVariable:Ze,define:He,isDynamic:Et,unbox:cr,accessor:Sr},Zr={next:typeof requestAnimationFrame=="function"?function(z){return requestAnimationFrame(z)}:function(z){return setTimeout(z,16)},cancel:typeof cancelAnimationFrame=="function"?function(z){return cancelAnimationFrame(z)}:clearTimeout},Fn=typeof performance!="undefined"&&performance.now?function(){return performance.now()}:function(){return+new Date};function En(){var z={"":0},Ae=[""];return{id:function(je){var jt=z[je];return jt||(jt=z[je]=Ae.length,Ae.push(je),jt)},str:function(je){return Ae[je]}}}function Cn(z,Ae,je){var jt=document.createElement("canvas");L(jt.style,{border:0,margin:0,padding:0,top:0,left:0}),z.appendChild(jt),z===document.body&&(jt.style.position="absolute",L(z.style,{margin:0,padding:0}));function pr(){var Dr=window.innerWidth,Cr=window.innerHeight;if(z!==document.body){var Vr=z.getBoundingClientRect();Dr=Vr.right-Vr.left,Cr=Vr.bottom-Vr.top}jt.width=je*Dr,jt.height=je*Cr,L(jt.style,{width:Dr+"px",height:Cr+"px"})}var Gt;z!==document.body&&typeof ResizeObserver=="function"?(Gt=new ResizeObserver(function(){setTimeout(pr)}),Gt.observe(z)):window.addEventListener("resize",pr,!1);function kt(){Gt?Gt.disconnect():window.removeEventListener("resize",pr),z.removeChild(jt)}return pr(),{canvas:jt,onDestroy:kt}}function fn(z,Ae){function je(jt){try{return z.getContext(jt,Ae)}catch(pr){return null}}return je("webgl")||je("experimental-webgl")||je("webgl-experimental")}function ni(z){return typeof z.nodeName=="string"&&typeof z.appendChild=="function"&&typeof z.getBoundingClientRect=="function"}function Yn(z){return typeof z.drawArrays=="function"||typeof z.drawElements=="function"}function oa(z){return typeof z=="string"?z.split():(k(Array.isArray(z),"invalid extension array"),z)}function Qi(z){return typeof z=="string"?(k(typeof document!="undefined","not supported outside of DOM"),document.querySelector(z)):z}function lo(z){var Ae=z||{},je,jt,pr,Gt,kt={},Dr=[],Cr=[],Vr=typeof window=="undefined"?1:window.devicePixelRatio,Br=!1,Ur=function(zr){zr&&k.raise(zr)},Gr=function(){};if(typeof Ae=="string"?(k(typeof document!="undefined","selector queries only supported in DOM enviroments"),je=document.querySelector(Ae),k(je,"invalid query string for element")):typeof Ae=="object"?ni(Ae)?je=Ae:Yn(Ae)?(Gt=Ae,pr=Gt.canvas):(k.constructor(Ae),"gl"in Ae?Gt=Ae.gl:"canvas"in Ae?pr=Qi(Ae.canvas):"container"in Ae&&(jt=Qi(Ae.container)),"attributes"in Ae&&(kt=Ae.attributes,k.type(kt,"object","invalid context attributes")),"extensions"in Ae&&(Dr=oa(Ae.extensions)),"optionalExtensions"in Ae&&(Cr=oa(Ae.optionalExtensions)),"onDone"in Ae&&(k.type(Ae.onDone,"function","invalid or missing onDone callback"),Ur=Ae.onDone),"profile"in Ae&&(Br=!!Ae.profile),"pixelRatio"in Ae&&(Vr=+Ae.pixelRatio,k(Vr>0,"invalid pixel ratio"))):k.raise("invalid arguments to regl"),je&&(je.nodeName.toLowerCase()==="canvas"?pr=je:jt=je),!Gt){if(!pr){k(typeof document!="undefined","must manually specify webgl context outside of DOM environments");var Ar=Cn(jt||document.body,Ur,Vr);if(!Ar)return null;pr=Ar.canvas,Gr=Ar.onDestroy}kt.premultipliedAlpha===void 0&&(kt.premultipliedAlpha=!0),Gt=fn(pr,kt)}return Gt?{gl:Gt,canvas:pr,container:jt,extensions:Dr,optionalExtensions:Cr,pixelRatio:Vr,profile:Br,onDone:Ur,onDestroy:Gr}:(Gr(),Ur("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Is(z,Ae){var je={};function jt(kt){k.type(kt,"string","extension name must be string");var Dr=kt.toLowerCase(),Cr;try{Cr=je[Dr]=z.getExtension(Dr)}catch(Vr){}return!!Cr}for(var pr=0;pr<Ae.extensions.length;++pr){var Gt=Ae.extensions[pr];if(!jt(Gt))return Ae.onDestroy(),Ae.onDone('"'+Gt+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return Ae.optionalExtensions.forEach(jt),{extensions:je,restore:function(){Object.keys(je).forEach(function(kt){if(je[kt]&&!jt(kt))throw new Error("(regl): error restoring extension "+kt)})}}}function hi(z,Ae){for(var je=Array(z),jt=0;jt<z;++jt)je[jt]=Ae(jt);return je}var W=5120,J=5121,oe=5122,be=5123,Oe=5124,it=5125,pt=5126;function j(z){for(var Ae=16;Ae<=1<<28;Ae*=16)if(z<=Ae)return Ae;return 0}function Q(z){var Ae,je;return Ae=(z>65535)<<4,z>>>=Ae,je=(z>255)<<3,z>>>=je,Ae|=je,je=(z>15)<<2,z>>>=je,Ae|=je,je=(z>3)<<1,z>>>=je,Ae|=je,Ae|z>>1}function Le(){var z=hi(8,function(){return[]});function Ae(Gt){var kt=j(Gt),Dr=z[Q(kt)>>2];return Dr.length>0?Dr.pop():new ArrayBuffer(kt)}function je(Gt){z[Q(Gt.byteLength)>>2].push(Gt)}function jt(Gt,kt){var Dr=null;switch(Gt){case W:Dr=new Int8Array(Ae(kt),0,kt);break;case J:Dr=new Uint8Array(Ae(kt),0,kt);break;case oe:Dr=new Int16Array(Ae(2*kt),0,kt);break;case be:Dr=new Uint16Array(Ae(2*kt),0,kt);break;case Oe:Dr=new Int32Array(Ae(4*kt),0,kt);break;case it:Dr=new Uint32Array(Ae(4*kt),0,kt);break;case pt:Dr=new Float32Array(Ae(4*kt),0,kt);break;default:return null}return Dr.length!==kt?Dr.subarray(0,kt):Dr}function pr(Gt){je(Gt.buffer)}return{alloc:Ae,free:je,allocType:jt,freeType:pr}}var at=Le();at.zero=Le();var Ee=3408,ir=3410,wr=3411,An=3412,sn=3413,sr=3414,en=3415,Wr=33901,Yr=33902,pi=3379,tn=3386,vi=34921,qi=36347,ci=36348,zi=35661,Ai=35660,Xo=34930,Ji=36349,Ia=34076,Ti=34024,mi=7936,wi=7937,Pa=7938,cu=35724,ma=34047,Aa=36063,$l=34852,os=3553,Ta=34067,fi=34069,Oa=33984,sa=6408,Ao=5126,ha=5121,$o=36160,Vo=36053,Ru=36064,ss=16384,Cc=function(z,Ae){var je=1;Ae.ext_texture_filter_anisotropic&&(je=z.getParameter(ma));var jt=1,pr=1;Ae.webgl_draw_buffers&&(jt=z.getParameter($l),pr=z.getParameter(Aa));var Gt=!!Ae.oes_texture_float;if(Gt){var kt=z.createTexture();z.bindTexture(os,kt),z.texImage2D(os,0,sa,1,1,0,sa,Ao,null);var Dr=z.createFramebuffer();if(z.bindFramebuffer($o,Dr),z.framebufferTexture2D($o,Ru,os,kt,0),z.bindTexture(os,null),z.checkFramebufferStatus($o)!==Vo)Gt=!1;else{z.viewport(0,0,1,1),z.clearColor(1,0,0,1),z.clear(ss);var Cr=at.allocType(Ao,4);z.readPixels(0,0,1,1,sa,Ao,Cr),z.getError()?Gt=!1:(z.deleteFramebuffer(Dr),z.deleteTexture(kt),Gt=Cr[0]===1),at.freeType(Cr)}}var Vr=typeof navigator!="undefined"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Br=!0;if(!Vr){var Ur=z.createTexture(),Gr=at.allocType(ha,36);z.activeTexture(Oa),z.bindTexture(Ta,Ur),z.texImage2D(fi,0,sa,3,3,0,sa,ha,Gr),at.freeType(Gr),z.bindTexture(Ta,null),z.deleteTexture(Ur),Br=!z.getError()}return{colorBits:[z.getParameter(ir),z.getParameter(wr),z.getParameter(An),z.getParameter(sn)],depthBits:z.getParameter(sr),stencilBits:z.getParameter(en),subpixelBits:z.getParameter(Ee),extensions:Object.keys(Ae).filter(function(Ar){return!!Ae[Ar]}),maxAnisotropic:je,maxDrawbuffers:jt,maxColorAttachments:pr,pointSizeDims:z.getParameter(Wr),lineWidthDims:z.getParameter(Yr),maxViewportDims:z.getParameter(tn),maxCombinedTextureUnits:z.getParameter(zi),maxCubeMapSize:z.getParameter(Ia),maxRenderbufferSize:z.getParameter(Ti),maxTextureUnits:z.getParameter(Xo),maxTextureSize:z.getParameter(pi),maxAttributes:z.getParameter(vi),maxVertexUniforms:z.getParameter(qi),maxVertexTextureUnits:z.getParameter(Ai),maxVaryingVectors:z.getParameter(ci),maxFragmentUniforms:z.getParameter(Ji),glsl:z.getParameter(cu),renderer:z.getParameter(wi),vendor:z.getParameter(mi),version:z.getParameter(Pa),readFloat:Gt,npotTextureCube:Br}};function Ea(z){return!!z&&typeof z=="object"&&Array.isArray(z.shape)&&Array.isArray(z.stride)&&typeof z.offset=="number"&&z.shape.length===z.stride.length&&(Array.isArray(z.data)||ee(z.data))}var ea=function(z){return Object.keys(z).map(function(Ae){return z[Ae]})},Kt={shape:jr,flatten:or};function Sn(z,Ae,je){for(var jt=0;jt<Ae;++jt)je[jt]=z[jt]}function de(z,Ae,je,jt){for(var pr=0,Gt=0;Gt<Ae;++Gt)for(var kt=z[Gt],Dr=0;Dr<je;++Dr)jt[pr++]=kt[Dr]}function Re(z,Ae,je,jt,pr,Gt){for(var kt=Gt,Dr=0;Dr<Ae;++Dr)for(var Cr=z[Dr],Vr=0;Vr<je;++Vr)for(var Br=Cr[Vr],Ur=0;Ur<jt;++Ur)pr[kt++]=Br[Ur]}function ct(z,Ae,je,jt,pr){for(var Gt=1,kt=je+1;kt<Ae.length;++kt)Gt*=Ae[kt];var Dr=Ae[je];if(Ae.length-je===4){var Cr=Ae[je+1],Vr=Ae[je+2],Br=Ae[je+3];for(kt=0;kt<Dr;++kt)Re(z[kt],Cr,Vr,Br,jt,pr),pr+=Gt}else for(kt=0;kt<Dr;++kt)ct(z[kt],Ae,je+1,jt,pr),pr+=Gt}function or(z,Ae,je,jt){var pr=1;if(Ae.length)for(var Gt=0;Gt<Ae.length;++Gt)pr*=Ae[Gt];else pr=0;var kt=jt||at.allocType(je,pr);switch(Ae.length){case 0:break;case 1:Sn(z,Ae[0],kt);break;case 2:de(z,Ae[0],Ae[1],kt);break;case 3:Re(z,Ae[0],Ae[1],Ae[2],kt,0);break;default:ct(z,Ae,0,kt,0)}return kt}function jr(z){for(var Ae=[],je=z;je.length;je=je[0])Ae.push(je.length);return Ae}var In={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},Hi=5120,vo=5122,To=5124,co=5121,Ps=5123,ys=5125,Kh=5126,Cf=5126,jo={int8:Hi,int16:vo,int32:To,uint8:co,uint16:Ps,uint32:ys,float:Kh,float32:Cf},xl=35048,bl=35040,Mu={dynamic:xl,stream:bl,static:35044},Iu=Kt.flatten,Qu=Kt.shape,Qc=35044,Os=35040,qa=5121,El=5126,Ju=[];Ju[5120]=1,Ju[5122]=2,Ju[5124]=4,Ju[5121]=1,Ju[5123]=2,Ju[5125]=4,Ju[5126]=4;function Rf(z){return In[Object.prototype.toString.call(z)]|0}function Qh(z,Ae){for(var je=0;je<Ae.length;++je)z[je]=Ae[je]}function Mf(z,Ae,je,jt,pr,Gt,kt){for(var Dr=0,Cr=0;Cr<je;++Cr)for(var Vr=0;Vr<jt;++Vr)z[Dr++]=Ae[pr*Cr+Gt*Vr+kt]}function ph(z,Ae,je,jt){var pr=0,Gt={};function kt(Tt){this.id=pr++,this.buffer=z.createBuffer(),this.type=Tt,this.usage=Qc,this.byteLength=0,this.dimension=1,this.dtype=qa,this.persistentData=null,je.profile&&(this.stats={size:0})}kt.prototype.bind=function(){z.bindBuffer(this.type,this.buffer)},kt.prototype.destroy=function(){Gr(this)};var Dr=[];function Cr(Tt,er){var Fr=Dr.pop();return Fr||(Fr=new kt(Tt)),Fr.bind(),Ur(Fr,er,Os,0,1,!1),Fr}function Vr(Tt){Dr.push(Tt)}function Br(Tt,er,Fr){Tt.byteLength=er.byteLength,z.bufferData(Tt.type,er,Fr)}function Ur(Tt,er,Fr,rn,yr,an){var Pr;if(Tt.usage=Fr,Array.isArray(er)){if(Tt.dtype=rn||El,er.length>0){var nn;if(Array.isArray(er[0])){Pr=Qu(er);for(var br=1,$r=1;$r<Pr.length;++$r)br*=Pr[$r];Tt.dimension=br,nn=Iu(er,Pr,Tt.dtype),Br(Tt,nn,Fr),an?Tt.persistentData=nn:at.freeType(nn)}else if(typeof er[0]=="number"){Tt.dimension=yr;var Nn=at.allocType(Tt.dtype,er.length);Qh(Nn,er),Br(Tt,Nn,Fr),an?Tt.persistentData=Nn:at.freeType(Nn)}else ee(er[0])?(Tt.dimension=er[0].length,Tt.dtype=rn||Rf(er[0])||El,nn=Iu(er,[er.length,er[0].length],Tt.dtype),Br(Tt,nn,Fr),an?Tt.persistentData=nn:at.freeType(nn)):k.raise("invalid buffer data")}}else if(ee(er))Tt.dtype=rn||Rf(er),Tt.dimension=yr,Br(Tt,er,Fr),an&&(Tt.persistentData=new Uint8Array(new Uint8Array(er.buffer)));else if(Ea(er)){Pr=er.shape;var ui=er.stride,Qr=er.offset,yt=0,vr=0,ot=0,Ci=0;Pr.length===1?(yt=Pr[0],vr=1,ot=ui[0],Ci=0):Pr.length===2?(yt=Pr[0],vr=Pr[1],ot=ui[0],Ci=ui[1]):k.raise("invalid shape"),Tt.dtype=rn||Rf(er.data)||El,Tt.dimension=vr;var ln=at.allocType(Tt.dtype,yt*vr);Mf(ln,er.data,yt,vr,ot,Ci,Qr),Br(Tt,ln,Fr),an?Tt.persistentData=ln:at.freeType(ln)}else er instanceof ArrayBuffer?(Tt.dtype=qa,Tt.dimension=yr,Br(Tt,er,Fr),an&&(Tt.persistentData=new Uint8Array(new Uint8Array(er)))):k.raise("invalid buffer data")}function Gr(Tt){Ae.bufferCount--,jt(Tt);var er=Tt.buffer;k(er,"buffer must not be deleted already"),z.deleteBuffer(er),Tt.buffer=null,delete Gt[Tt.id]}function Ar(Tt,er,Fr,rn){Ae.bufferCount++;var yr=new kt(er);Gt[yr.id]=yr;function an(br){var $r=Qc,Nn=null,ui=0,Qr=0,yt=1;return Array.isArray(br)||ee(br)||Ea(br)||br instanceof ArrayBuffer?Nn=br:typeof br=="number"?ui=br|0:br&&(k.type(br,"object","buffer arguments must be an object, a number or an array"),"data"in br&&(k(Nn===null||Array.isArray(Nn)||ee(Nn)||Ea(Nn),"invalid data for buffer"),Nn=br.data),"usage"in br&&(k.parameter(br.usage,Mu,"invalid buffer usage"),$r=Mu[br.usage]),"type"in br&&(k.parameter(br.type,jo,"invalid buffer type"),Qr=jo[br.type]),"dimension"in br&&(k.type(br.dimension,"number","invalid dimension"),yt=br.dimension|0),"length"in br&&(k.nni(ui,"buffer length must be a nonnegative integer"),ui=br.length|0)),yr.bind(),Nn?Ur(yr,Nn,$r,Qr,yt,rn):(ui&&z.bufferData(yr.type,ui,$r),yr.dtype=Qr||qa,yr.usage=$r,yr.dimension=yt,yr.byteLength=ui),je.profile&&(yr.stats.size=yr.byteLength*Ju[yr.dtype]),an}function Pr(br,$r){k($r+br.byteLength<=yr.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+br.byteLength+" starting from offset "+$r+" to a buffer of size "+yr.byteLength),z.bufferSubData(yr.type,$r,br)}function nn(br,$r){var Nn=($r||0)|0,ui;if(yr.bind(),ee(br)||br instanceof ArrayBuffer)Pr(br,Nn);else if(Array.isArray(br)){if(br.length>0)if(typeof br[0]=="number"){var Qr=at.allocType(yr.dtype,br.length);Qh(Qr,br),Pr(Qr,Nn),at.freeType(Qr)}else if(Array.isArray(br[0])||ee(br[0])){ui=Qu(br);var yt=Iu(br,ui,yr.dtype);Pr(yt,Nn),at.freeType(yt)}else k.raise("invalid buffer data")}else if(Ea(br)){ui=br.shape;var vr=br.stride,ot=0,Ci=0,ln=0,yi=0;ui.length===1?(ot=ui[0],Ci=1,ln=vr[0],yi=0):ui.length===2?(ot=ui[0],Ci=ui[1],ln=vr[0],yi=vr[1]):k.raise("invalid shape");var si=Array.isArray(br.data)?yr.dtype:Rf(br.data),Qn=at.allocType(si,ot*Ci);Mf(Qn,br.data,ot,Ci,ln,yi,br.offset),Pr(Qn,Nn),at.freeType(Qn)}else k.raise("invalid data for buffer subdata");return an}return Fr||an(Tt),an._reglType="buffer",an._buffer=yr,an.subdata=nn,je.profile&&(an.stats=yr.stats),an.destroy=function(){Gr(yr)},an}function zr(){ea(Gt).forEach(function(Tt){Tt.buffer=z.createBuffer(),z.bindBuffer(Tt.type,Tt.buffer),z.bufferData(Tt.type,Tt.persistentData||Tt.byteLength,Tt.usage)})}return je.profile&&(Ae.getTotalBufferSize=function(){var Tt=0;return Object.keys(Gt).forEach(function(er){Tt+=Gt[er].stats.size}),Tt}),{create:Ar,createStream:Cr,destroyStream:Vr,clear:function(){ea(Gt).forEach(Gr),Dr.forEach(Gr)},getBuffer:function(Tt){return Tt&&Tt._buffer instanceof kt?Tt._buffer:null},restore:zr,_initBuffer:Ur}}var dh=0,vh=0,Jh=1,ep=1,Zp=4,Jc=4,Pu={points:dh,point:vh,lines:Jh,line:ep,triangles:Zp,triangle:Jc,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},tp=0,Ho=1,Yl=4,Sl=5120,$s=5121,Al=5122,oi=5123,el=5124,Ds=5125,Ou=34963,tl=35040,rp=35044;function ta(z,Ae,je,jt){var pr={},Gt=0,kt={uint8:$s,uint16:oi};Ae.oes_element_index_uint&&(kt.uint32=Ds);function Dr(zr){this.id=Gt++,pr[this.id]=this,this.buffer=zr,this.primType=Yl,this.vertCount=0,this.type=0}Dr.prototype.bind=function(){this.buffer.bind()};var Cr=[];function Vr(zr){var Tt=Cr.pop();return Tt||(Tt=new Dr(je.create(null,Ou,!0,!1)._buffer)),Ur(Tt,zr,tl,-1,-1,0,0),Tt}function Br(zr){Cr.push(zr)}function Ur(zr,Tt,er,Fr,rn,yr,an){zr.buffer.bind();var Pr;if(Tt){var nn=an;!an&&(!ee(Tt)||Ea(Tt)&&!ee(Tt.data))&&(nn=Ae.oes_element_index_uint?Ds:oi),je._initBuffer(zr.buffer,Tt,er,nn,3)}else z.bufferData(Ou,yr,er),zr.buffer.dtype=Pr||$s,zr.buffer.usage=er,zr.buffer.dimension=3,zr.buffer.byteLength=yr;if(Pr=an,!an){switch(zr.buffer.dtype){case $s:case Sl:Pr=$s;break;case oi:case Al:Pr=oi;break;case Ds:case el:Pr=Ds;break;default:k.raise("unsupported type for element array")}zr.buffer.dtype=Pr}zr.type=Pr,k(Pr!==Ds||!!Ae.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var br=rn;br<0&&(br=zr.buffer.byteLength,Pr===oi?br>>=1:Pr===Ds&&(br>>=2)),zr.vertCount=br;var $r=Fr;if(Fr<0){$r=Yl;var Nn=zr.buffer.dimension;Nn===1&&($r=tp),Nn===2&&($r=Ho),Nn===3&&($r=Yl)}zr.primType=$r}function Gr(zr){jt.elementsCount--,k(zr.buffer!==null,"must not double destroy elements"),delete pr[zr.id],zr.buffer.destroy(),zr.buffer=null}function Ar(zr,Tt){var er=je.create(null,Ou,!0),Fr=new Dr(er._buffer);jt.elementsCount++;function rn(yr){if(!yr)er(),Fr.primType=Yl,Fr.vertCount=0,Fr.type=$s;else if(typeof yr=="number")er(yr),Fr.primType=Yl,Fr.vertCount=yr|0,Fr.type=$s;else{var an=null,Pr=rp,nn=-1,br=-1,$r=0,Nn=0;Array.isArray(yr)||ee(yr)||Ea(yr)?an=yr:(k.type(yr,"object","invalid arguments for elements"),"data"in yr&&(an=yr.data,k(Array.isArray(an)||ee(an)||Ea(an),"invalid data for element buffer")),"usage"in yr&&(k.parameter(yr.usage,Mu,"invalid element buffer usage"),Pr=Mu[yr.usage]),"primitive"in yr&&(k.parameter(yr.primitive,Pu,"invalid element buffer primitive"),nn=Pu[yr.primitive]),"count"in yr&&(k(typeof yr.count=="number"&&yr.count>=0,"invalid vertex count for elements"),br=yr.count|0),"type"in yr&&(k.parameter(yr.type,kt,"invalid buffer type"),Nn=kt[yr.type]),"length"in yr?$r=yr.length|0:($r=br,Nn===oi||Nn===Al?$r*=2:(Nn===Ds||Nn===el)&&($r*=4))),Ur(Fr,an,Pr,nn,br,$r,Nn)}return rn}return rn(zr),rn._reglType="elements",rn._elements=Fr,rn.subdata=function(yr,an){return er.subdata(yr,an),rn},rn.destroy=function(){Gr(Fr)},rn}return{create:Ar,createStream:Vr,destroyStream:Br,getElements:function(zr){return typeof zr=="function"&&zr._elements instanceof Dr?zr._elements:null},clear:function(){ea(pr).forEach(Gr)}}}var Ii=new Float32Array(1),fu=new Uint32Array(Ii.buffer),Du=5123;function mh(z){for(var Ae=at.allocType(Du,z.length),je=0;je<z.length;++je)if(isNaN(z[je]))Ae[je]=65535;else if(z[je]===1/0)Ae[je]=31744;else if(z[je]===-1/0)Ae[je]=64512;else{Ii[0]=z[je];var jt=fu[0],pr=jt>>>31<<15,Gt=(jt<<1>>>24)-127,kt=jt>>13&1024-1;if(Gt<-24)Ae[je]=pr;else if(Gt<-14){var Dr=-14-Gt;Ae[je]=pr+(kt+1024>>Dr)}else Gt>15?Ae[je]=pr+31744:Ae[je]=pr+(Gt+15<<10)+kt}return Ae}function Ha(z){return Array.isArray(z)||ee(z)}var ef=function(z){return!(z&z-1)&&!!z},Vp=34467,xs=3553,Fu=34067,ku=34069,ql=6408,If=6406,wa=6407,Qs=6409,Rc=6410,Kl=32854,rl=32855,gh=36194,Ql=32819,ca=32820,tf=33635,np=34042,Tl=6402,Jl=34041,_h=35904,Pf=35906,wl=36193,hu=33776,Mc=33777,rf=33778,ec=33779,tc=35986,ip=35987,nl=34798,Js=35840,nf=35841,Ic=35842,yh=35843,Cl=36196,pu=5121,af=5123,Pc=5125,Bu=5126,Md=10242,Of=10243,xh=10497,Df=33071,Fo=33648,bh=10240,ap=10241,Ff=9728,Eh=9729,Oc=9984,of=9985,il=9986,pa=9987,kf=33170,du=4352,Rl=4353,Li=4354,Ca=34046,Ys=3317,Bf=37440,Fs=37441,sf=37443,op=37444,Sh=33984,Lf=[Oc,il,of,pa],Ml=[0,Qs,Rc,wa,ql],ko={};ko[Qs]=ko[If]=ko[Tl]=1,ko[Jl]=ko[Rc]=2,ko[wa]=ko[_h]=3,ko[ql]=ko[Pf]=4;function Wa(z){return"[object "+z+"]"}var al=Wa("HTMLCanvasElement"),Ah=Wa("OffscreenCanvas"),Ka=Wa("CanvasRenderingContext2D"),_n=Wa("ImageBitmap"),ks=Wa("HTMLImageElement"),uf=Wa("HTMLVideoElement"),rc=Object.keys(In).concat([al,Ah,Ka,_n,ks,uf]),us=[];us[pu]=1,us[Bu]=4,us[wl]=2,us[af]=2,us[Pc]=4;var ga=[];ga[Kl]=2,ga[rl]=2,ga[gh]=2,ga[Jl]=4,ga[hu]=.5,ga[Mc]=.5,ga[rf]=1,ga[ec]=1,ga[tc]=.5,ga[ip]=1,ga[nl]=1,ga[Js]=.5,ga[nf]=.25,ga[Ic]=.5,ga[yh]=.25,ga[Cl]=.5;function Th(z){return Array.isArray(z)&&(z.length===0||typeof z[0]=="number")}function qr(z){if(!Array.isArray(z))return!1;var Ae=z.length;return!(Ae===0||!Ha(z[0]))}function ol(z){return Object.prototype.toString.call(z)}function Dc(z){return ol(z)===al}function wh(z){return ol(z)===Ah}function eu(z){return ol(z)===Ka}function Bs(z){return ol(z)===_n}function Nf(z){return ol(z)===ks}function Uf(z){return ol(z)===uf}function Yo(z){if(!z)return!1;var Ae=ol(z);return rc.indexOf(Ae)>=0?!0:Th(z)||qr(z)||Ea(z)}function Lu(z){return In[Object.prototype.toString.call(z)]|0}function sp(z,Ae){var je=Ae.length;switch(z.type){case pu:case af:case Pc:case Bu:var jt=at.allocType(z.type,je);jt.set(Ae),z.data=jt;break;case wl:z.data=mh(Ae);break;default:k.raise("unsupported texture type, must specify a typed array")}}function Il(z,Ae){return at.allocType(z.type===wl?Bu:z.type,Ae)}function lf(z,Ae){z.type===wl?(z.data=mh(Ae),at.freeType(Ae)):z.data=Ae}function up(z,Ae,je,jt,pr,Gt){for(var kt=z.width,Dr=z.height,Cr=z.channels,Vr=kt*Dr*Cr,Br=Il(z,Vr),Ur=0,Gr=0;Gr<Dr;++Gr)for(var Ar=0;Ar<kt;++Ar)for(var zr=0;zr<Cr;++zr)Br[Ur++]=Ae[je*Ar+jt*Gr+pr*zr+Gt];lf(z,Br)}function Pt(z,Ae,je,jt,pr,Gt){var kt;if(typeof ga[z]!="undefined"?kt=ga[z]:kt=ko[z]*us[Ae],Gt&&(kt*=6),pr){for(var Dr=0,Cr=je;Cr>=1;)Dr+=kt*Cr*Cr,Cr/=2;return Dr}else return kt*je*jt}function Fe(z,Ae,je,jt,pr,Gt,kt){var Dr={"don't care":du,"dont care":du,nice:Li,fast:Rl},Cr={repeat:xh,clamp:Df,mirror:Fo},Vr={nearest:Ff,linear:Eh},Br=L({mipmap:pa,"nearest mipmap nearest":Oc,"linear mipmap nearest":of,"nearest mipmap linear":il,"linear mipmap linear":pa},Vr),Ur={none:0,browser:op},Gr={uint8:pu,rgba4:Ql,rgb565:tf,"rgb5 a1":ca},Ar={alpha:If,luminance:Qs,"luminance alpha":Rc,rgb:wa,rgba:ql,rgba4:Kl,"rgb5 a1":rl,rgb565:gh},zr={};Ae.ext_srgb&&(Ar.srgb=_h,Ar.srgba=Pf),Ae.oes_texture_float&&(Gr.float32=Gr.float=Bu),Ae.oes_texture_half_float&&(Gr.float16=Gr["half float"]=wl),Ae.webgl_depth_texture&&(L(Ar,{depth:Tl,"depth stencil":Jl}),L(Gr,{uint16:af,uint32:Pc,"depth stencil":np})),Ae.webgl_compressed_texture_s3tc&&L(zr,{"rgb s3tc dxt1":hu,"rgba s3tc dxt1":Mc,"rgba s3tc dxt3":rf,"rgba s3tc dxt5":ec}),Ae.webgl_compressed_texture_atc&&L(zr,{"rgb atc":tc,"rgba atc explicit alpha":ip,"rgba atc interpolated alpha":nl}),Ae.webgl_compressed_texture_pvrtc&&L(zr,{"rgb pvrtc 4bppv1":Js,"rgb pvrtc 2bppv1":nf,"rgba pvrtc 4bppv1":Ic,"rgba pvrtc 2bppv1":yh}),Ae.webgl_compressed_texture_etc1&&(zr["rgb etc1"]=Cl);var Tt=Array.prototype.slice.call(z.getParameter(Vp));Object.keys(zr).forEach(function(Ne){var $t=zr[Ne];Tt.indexOf($t)>=0&&(Ar[Ne]=$t)});var er=Object.keys(Ar);je.textureFormats=er;var Fr=[];Object.keys(Ar).forEach(function(Ne){var $t=Ar[Ne];Fr[$t]=Ne});var rn=[];Object.keys(Gr).forEach(function(Ne){var $t=Gr[Ne];rn[$t]=Ne});var yr=[];Object.keys(Vr).forEach(function(Ne){var $t=Vr[Ne];yr[$t]=Ne});var an=[];Object.keys(Br).forEach(function(Ne){var $t=Br[Ne];an[$t]=Ne});var Pr=[];Object.keys(Cr).forEach(function(Ne){var $t=Cr[Ne];Pr[$t]=Ne});var nn=er.reduce(function(Ne,$t){var Nt=Ar[$t];return Nt===Qs||Nt===If||Nt===Qs||Nt===Rc||Nt===Tl||Nt===Jl||Ae.ext_srgb&&(Nt===_h||Nt===Pf)?Ne[Nt]=Nt:Nt===rl||$t.indexOf("rgba")>=0?Ne[Nt]=ql:Ne[Nt]=wa,Ne},{});function br(){this.internalformat=ql,this.format=ql,this.type=pu,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=op,this.width=0,this.height=0,this.channels=0}function $r(Ne,$t){Ne.internalformat=$t.internalformat,Ne.format=$t.format,Ne.type=$t.type,Ne.compressed=$t.compressed,Ne.premultiplyAlpha=$t.premultiplyAlpha,Ne.flipY=$t.flipY,Ne.unpackAlignment=$t.unpackAlignment,Ne.colorSpace=$t.colorSpace,Ne.width=$t.width,Ne.height=$t.height,Ne.channels=$t.channels}function Nn(Ne,$t){if(!(typeof $t!="object"||!$t)){if("premultiplyAlpha"in $t&&(k.type($t.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),Ne.premultiplyAlpha=$t.premultiplyAlpha),"flipY"in $t&&(k.type($t.flipY,"boolean","invalid texture flip"),Ne.flipY=$t.flipY),"alignment"in $t&&(k.oneOf($t.alignment,[1,2,4,8],"invalid texture unpack alignment"),Ne.unpackAlignment=$t.alignment),"colorSpace"in $t&&(k.parameter($t.colorSpace,Ur,"invalid colorSpace"),Ne.colorSpace=Ur[$t.colorSpace]),"type"in $t){var Nt=$t.type;k(Ae.oes_texture_float||!(Nt==="float"||Nt==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),k(Ae.oes_texture_half_float||!(Nt==="half float"||Nt==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),k(Ae.webgl_depth_texture||!(Nt==="uint16"||Nt==="uint32"||Nt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),k.parameter(Nt,Gr,"invalid texture type"),Ne.type=Gr[Nt]}var hn=Ne.width,bi=Ne.height,da=Ne.channels,ce=!1;"shape"in $t?(k(Array.isArray($t.shape)&&$t.shape.length>=2,"shape must be an array"),hn=$t.shape[0],bi=$t.shape[1],$t.shape.length===3&&(da=$t.shape[2],k(da>0&&da<=4,"invalid number of channels"),ce=!0),k(hn>=0&&hn<=je.maxTextureSize,"invalid width"),k(bi>=0&&bi<=je.maxTextureSize,"invalid height")):("radius"in $t&&(hn=bi=$t.radius,k(hn>=0&&hn<=je.maxTextureSize,"invalid radius")),"width"in $t&&(hn=$t.width,k(hn>=0&&hn<=je.maxTextureSize,"invalid width")),"height"in $t&&(bi=$t.height,k(bi>=0&&bi<=je.maxTextureSize,"invalid height")),"channels"in $t&&(da=$t.channels,k(da>0&&da<=4,"invalid number of channels"),ce=!0)),Ne.width=hn|0,Ne.height=bi|0,Ne.channels=da|0;var Te=!1;if("format"in $t){var Ve=$t.format;k(Ae.webgl_depth_texture||!(Ve==="depth"||Ve==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),k.parameter(Ve,Ar,"invalid texture format");var Ut=Ne.internalformat=Ar[Ve];Ne.format=nn[Ut],Ve in Gr&&("type"in $t||(Ne.type=Gr[Ve])),Ve in zr&&(Ne.compressed=!0),Te=!0}!ce&&Te?Ne.channels=ko[Ne.format]:ce&&!Te?Ne.channels!==Ml[Ne.format]&&(Ne.format=Ne.internalformat=Ml[Ne.channels]):Te&&ce&&k(Ne.channels===ko[Ne.format],"number of channels inconsistent with specified format")}}function ui(Ne){z.pixelStorei(Bf,Ne.flipY),z.pixelStorei(Fs,Ne.premultiplyAlpha),z.pixelStorei(sf,Ne.colorSpace),z.pixelStorei(Ys,Ne.unpackAlignment)}function Qr(){br.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function yt(Ne,$t){var Nt=null;if(Yo($t)?Nt=$t:$t&&(k.type($t,"object","invalid pixel data type"),Nn(Ne,$t),"x"in $t&&(Ne.xOffset=$t.x|0),"y"in $t&&(Ne.yOffset=$t.y|0),Yo($t.data)&&(Nt=$t.data)),k(!Ne.compressed||Nt instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),$t.copy){k(!Nt,"can not specify copy and data field for the same texture");var hn=pr.viewportWidth,bi=pr.viewportHeight;Ne.width=Ne.width||hn-Ne.xOffset,Ne.height=Ne.height||bi-Ne.yOffset,Ne.needsCopy=!0,k(Ne.xOffset>=0&&Ne.xOffset<hn&&Ne.yOffset>=0&&Ne.yOffset<bi&&Ne.width>0&&Ne.width<=hn&&Ne.height>0&&Ne.height<=bi,"copy texture read out of bounds")}else if(!Nt)Ne.width=Ne.width||1,Ne.height=Ne.height||1,Ne.channels=Ne.channels||4;else if(ee(Nt))Ne.channels=Ne.channels||4,Ne.data=Nt,!("type"in $t)&&Ne.type===pu&&(Ne.type=Lu(Nt));else if(Th(Nt))Ne.channels=Ne.channels||4,sp(Ne,Nt),Ne.alignment=1,Ne.needsFree=!0;else if(Ea(Nt)){var da=Nt.data;!Array.isArray(da)&&Ne.type===pu&&(Ne.type=Lu(da));var ce=Nt.shape,Te=Nt.stride,Ve,Ut,Bt,tt,ft,mt;ce.length===3?(Bt=ce[2],mt=Te[2]):(k(ce.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Bt=1,mt=1),Ve=ce[0],Ut=ce[1],tt=Te[0],ft=Te[1],Ne.alignment=1,Ne.width=Ve,Ne.height=Ut,Ne.channels=Bt,Ne.format=Ne.internalformat=Ml[Bt],Ne.needsFree=!0,up(Ne,da,tt,ft,mt,Nt.offset)}else if(Dc(Nt)||wh(Nt)||eu(Nt))Dc(Nt)||wh(Nt)?Ne.element=Nt:Ne.element=Nt.canvas,Ne.width=Ne.element.width,Ne.height=Ne.element.height,Ne.channels=4;else if(Bs(Nt))Ne.element=Nt,Ne.width=Nt.width,Ne.height=Nt.height,Ne.channels=4;else if(Nf(Nt))Ne.element=Nt,Ne.width=Nt.naturalWidth,Ne.height=Nt.naturalHeight,Ne.channels=4;else if(Uf(Nt))Ne.element=Nt,Ne.width=Nt.videoWidth,Ne.height=Nt.videoHeight,Ne.channels=4;else if(qr(Nt)){var De=Ne.width||Nt[0].length,st=Ne.height||Nt.length,me=Ne.channels;Ha(Nt[0][0])?me=me||Nt[0][0].length:me=me||1;for(var lt=Kt.shape(Nt),Qt=1,ur=0;ur<lt.length;++ur)Qt*=lt[ur];var xr=Il(Ne,Qt);Kt.flatten(Nt,lt,"",xr),lf(Ne,xr),Ne.alignment=1,Ne.width=De,Ne.height=st,Ne.channels=me,Ne.format=Ne.internalformat=Ml[me],Ne.needsFree=!0}Ne.type===Bu?k(je.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):Ne.type===wl&&k(je.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function vr(Ne,$t,Nt){var hn=Ne.element,bi=Ne.data,da=Ne.internalformat,ce=Ne.format,Te=Ne.type,Ve=Ne.width,Ut=Ne.height;ui(Ne),hn?z.texImage2D($t,Nt,ce,ce,Te,hn):Ne.compressed?z.compressedTexImage2D($t,Nt,da,Ve,Ut,0,bi):Ne.needsCopy?(jt(),z.copyTexImage2D($t,Nt,ce,Ne.xOffset,Ne.yOffset,Ve,Ut,0)):z.texImage2D($t,Nt,ce,Ve,Ut,0,ce,Te,bi||null)}function ot(Ne,$t,Nt,hn,bi){var da=Ne.element,ce=Ne.data,Te=Ne.internalformat,Ve=Ne.format,Ut=Ne.type,Bt=Ne.width,tt=Ne.height;ui(Ne),da?z.texSubImage2D($t,bi,Nt,hn,Ve,Ut,da):Ne.compressed?z.compressedTexSubImage2D($t,bi,Nt,hn,Te,Bt,tt,ce):Ne.needsCopy?(jt(),z.copyTexSubImage2D($t,bi,Nt,hn,Ne.xOffset,Ne.yOffset,Bt,tt)):z.texSubImage2D($t,bi,Nt,hn,Bt,tt,Ve,Ut,ce)}var Ci=[];function ln(){return Ci.pop()||new Qr}function yi(Ne){Ne.needsFree&&at.freeType(Ne.data),Qr.call(Ne),Ci.push(Ne)}function si(){br.call(this),this.genMipmaps=!1,this.mipmapHint=du,this.mipmask=0,this.images=Array(16)}function Qn(Ne,$t,Nt){var hn=Ne.images[0]=ln();Ne.mipmask=1,hn.width=Ne.width=$t,hn.height=Ne.height=Nt,hn.channels=Ne.channels=4}function Vi(Ne,$t){var Nt=null;if(Yo($t))Nt=Ne.images[0]=ln(),$r(Nt,Ne),yt(Nt,$t),Ne.mipmask=1;else if(Nn(Ne,$t),Array.isArray($t.mipmap))for(var hn=$t.mipmap,bi=0;bi<hn.length;++bi)Nt=Ne.images[bi]=ln(),$r(Nt,Ne),Nt.width>>=bi,Nt.height>>=bi,yt(Nt,hn[bi]),Ne.mipmask|=1<<bi;else Nt=Ne.images[0]=ln(),$r(Nt,Ne),yt(Nt,$t),Ne.mipmask=1;$r(Ne,Ne.images[0]),Ne.compressed&&(Ne.internalformat===hu||Ne.internalformat===Mc||Ne.internalformat===rf||Ne.internalformat===ec)&&k(Ne.width%4===0&&Ne.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function _o(Ne,$t){for(var Nt=Ne.images,hn=0;hn<Nt.length;++hn){if(!Nt[hn])return;vr(Nt[hn],$t,hn)}}var Wo=[];function Pi(){var Ne=Wo.pop()||new si;br.call(Ne),Ne.mipmask=0;for(var $t=0;$t<16;++$t)Ne.images[$t]=null;return Ne}function fo(Ne){for(var $t=Ne.images,Nt=0;Nt<$t.length;++Nt)$t[Nt]&&yi($t[Nt]),$t[Nt]=null;Wo.push(Ne)}function Sa(){this.minFilter=Ff,this.magFilter=Ff,this.wrapS=Df,this.wrapT=Df,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=du}function yo(Ne,$t){if("min"in $t){var Nt=$t.min;k.parameter(Nt,Br),Ne.minFilter=Br[Nt],Lf.indexOf(Ne.minFilter)>=0&&!("faces"in $t)&&(Ne.genMipmaps=!0)}if("mag"in $t){var hn=$t.mag;k.parameter(hn,Vr),Ne.magFilter=Vr[hn]}var bi=Ne.wrapS,da=Ne.wrapT;if("wrap"in $t){var ce=$t.wrap;typeof ce=="string"?(k.parameter(ce,Cr),bi=da=Cr[ce]):Array.isArray(ce)&&(k.parameter(ce[0],Cr),k.parameter(ce[1],Cr),bi=Cr[ce[0]],da=Cr[ce[1]])}else{if("wrapS"in $t){var Te=$t.wrapS;k.parameter(Te,Cr),bi=Cr[Te]}if("wrapT"in $t){var Ve=$t.wrapT;k.parameter(Ve,Cr),da=Cr[Ve]}}if(Ne.wrapS=bi,Ne.wrapT=da,"anisotropic"in $t){var Ut=$t.anisotropic;k(typeof Ut=="number"&&Ut>=1&&Ut<=je.maxAnisotropic,"aniso samples must be between 1 and "),Ne.anisotropic=$t.anisotropic}if("mipmap"in $t){var Bt=!1;switch(typeof $t.mipmap){case"string":k.parameter($t.mipmap,Dr,"invalid mipmap hint"),Ne.mipmapHint=Dr[$t.mipmap],Ne.genMipmaps=!0,Bt=!0;break;case"boolean":Bt=Ne.genMipmaps=$t.mipmap;break;case"object":k(Array.isArray($t.mipmap),"invalid mipmap type"),Ne.genMipmaps=!1,Bt=!0;break;default:k.raise("invalid mipmap type")}Bt&&!("min"in $t)&&(Ne.minFilter=Oc)}}function xo(Ne,$t){z.texParameteri($t,ap,Ne.minFilter),z.texParameteri($t,bh,Ne.magFilter),z.texParameteri($t,Md,Ne.wrapS),z.texParameteri($t,Of,Ne.wrapT),Ae.ext_texture_filter_anisotropic&&z.texParameteri($t,Ca,Ne.anisotropic),Ne.genMipmaps&&(z.hint(kf,Ne.mipmapHint),z.generateMipmap($t))}var Ja=0,Mo={},ps=je.maxTextureUnits,Io=Array(ps).map(function(){return null});function xi(Ne){br.call(this),this.mipmask=0,this.internalformat=ql,this.id=Ja++,this.refCount=1,this.target=Ne,this.texture=z.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Sa,kt.profile&&(this.stats={size:0})}function es(Ne){z.activeTexture(Sh),z.bindTexture(Ne.target,Ne.texture)}function ua(){var Ne=Io[0];Ne?z.bindTexture(Ne.target,Ne.texture):z.bindTexture(xs,null)}function Xn(Ne){var $t=Ne.texture;k($t,"must not double destroy texture");var Nt=Ne.unit,hn=Ne.target;Nt>=0&&(z.activeTexture(Sh+Nt),z.bindTexture(hn,null),Io[Nt]=null),z.deleteTexture($t),Ne.texture=null,Ne.params=null,Ne.pixels=null,Ne.refCount=0,delete Mo[Ne.id],Gt.textureCount--}L(xi.prototype,{bind:function(){var Ne=this;Ne.bindCount+=1;var $t=Ne.unit;if($t<0){for(var Nt=0;Nt<ps;++Nt){var hn=Io[Nt];if(hn){if(hn.bindCount>0)continue;hn.unit=-1}Io[Nt]=Ne,$t=Nt;break}$t>=ps&&k.raise("insufficient number of texture units"),kt.profile&&Gt.maxTextureUnits<$t+1&&(Gt.maxTextureUnits=$t+1),Ne.unit=$t,z.activeTexture(Sh+$t),z.bindTexture(Ne.target,Ne.texture)}return $t},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Xn(this)}});function Oi(Ne,$t){var Nt=new xi(xs);Mo[Nt.id]=Nt,Gt.textureCount++;function hn(ce,Te){var Ve=Nt.texInfo;Sa.call(Ve);var Ut=Pi();return typeof ce=="number"?typeof Te=="number"?Qn(Ut,ce|0,Te|0):Qn(Ut,ce|0,ce|0):ce?(k.type(ce,"object","invalid arguments to regl.texture"),yo(Ve,ce),Vi(Ut,ce)):Qn(Ut,1,1),Ve.genMipmaps&&(Ut.mipmask=(Ut.width<<1)-1),Nt.mipmask=Ut.mipmask,$r(Nt,Ut),k.texture2D(Ve,Ut,je),Nt.internalformat=Ut.internalformat,hn.width=Ut.width,hn.height=Ut.height,es(Nt),_o(Ut,xs),xo(Ve,xs),ua(),fo(Ut),kt.profile&&(Nt.stats.size=Pt(Nt.internalformat,Nt.type,Ut.width,Ut.height,Ve.genMipmaps,!1)),hn.format=Fr[Nt.internalformat],hn.type=rn[Nt.type],hn.mag=yr[Ve.magFilter],hn.min=an[Ve.minFilter],hn.wrapS=Pr[Ve.wrapS],hn.wrapT=Pr[Ve.wrapT],hn}function bi(ce,Te,Ve,Ut){k(!!ce,"must specify image data");var Bt=Te|0,tt=Ve|0,ft=Ut|0,mt=ln();return $r(mt,Nt),mt.width=0,mt.height=0,yt(mt,ce),mt.width=mt.width||(Nt.width>>ft)-Bt,mt.height=mt.height||(Nt.height>>ft)-tt,k(Nt.type===mt.type&&Nt.format===mt.format&&Nt.internalformat===mt.internalformat,"incompatible format for texture.subimage"),k(Bt>=0&&tt>=0&&Bt+mt.width<=Nt.width&&tt+mt.height<=Nt.height,"texture.subimage write out of bounds"),k(Nt.mipmask&1<<ft,"missing mipmap data"),k(mt.data||mt.element||mt.needsCopy,"missing image data"),es(Nt),ot(mt,xs,Bt,tt,ft),ua(),yi(mt),hn}function da(ce,Te){var Ve=ce|0,Ut=Te|0||Ve;if(Ve===Nt.width&&Ut===Nt.height)return hn;hn.width=Nt.width=Ve,hn.height=Nt.height=Ut,es(Nt);for(var Bt=0;Nt.mipmask>>Bt;++Bt){var tt=Ve>>Bt,ft=Ut>>Bt;if(!tt||!ft)break;z.texImage2D(xs,Bt,Nt.format,tt,ft,0,Nt.format,Nt.type,null)}return ua(),kt.profile&&(Nt.stats.size=Pt(Nt.internalformat,Nt.type,Ve,Ut,!1,!1)),hn}return hn(Ne,$t),hn.subimage=bi,hn.resize=da,hn._reglType="texture2d",hn._texture=Nt,kt.profile&&(hn.stats=Nt.stats),hn.destroy=function(){Nt.decRef()},hn}function Xi(Ne,$t,Nt,hn,bi,da){var ce=new xi(Fu);Mo[ce.id]=ce,Gt.cubeCount++;var Te=new Array(6);function Ve(tt,ft,mt,De,st,me){var lt,Qt=ce.texInfo;for(Sa.call(Qt),lt=0;lt<6;++lt)Te[lt]=Pi();if(typeof tt=="number"||!tt){var ur=tt|0||1;for(lt=0;lt<6;++lt)Qn(Te[lt],ur,ur)}else if(typeof tt=="object")if(ft)Vi(Te[0],tt),Vi(Te[1],ft),Vi(Te[2],mt),Vi(Te[3],De),Vi(Te[4],st),Vi(Te[5],me);else if(yo(Qt,tt),Nn(ce,tt),"faces"in tt){var xr=tt.faces;for(k(Array.isArray(xr)&&xr.length===6,"cube faces must be a length 6 array"),lt=0;lt<6;++lt)k(typeof xr[lt]=="object"&&!!xr[lt],"invalid input for cube map face"),$r(Te[lt],ce),Vi(Te[lt],xr[lt])}else for(lt=0;lt<6;++lt)Vi(Te[lt],tt);else k.raise("invalid arguments to cube map");for($r(ce,Te[0]),je.npotTextureCube||k(ef(ce.width)&&ef(ce.height),"your browser does not support non power or two texture dimensions"),Qt.genMipmaps?ce.mipmask=(Te[0].width<<1)-1:ce.mipmask=Te[0].mipmask,k.textureCube(ce,Qt,Te,je),ce.internalformat=Te[0].internalformat,Ve.width=Te[0].width,Ve.height=Te[0].height,es(ce),lt=0;lt<6;++lt)_o(Te[lt],ku+lt);for(xo(Qt,Fu),ua(),kt.profile&&(ce.stats.size=Pt(ce.internalformat,ce.type,Ve.width,Ve.height,Qt.genMipmaps,!0)),Ve.format=Fr[ce.internalformat],Ve.type=rn[ce.type],Ve.mag=yr[Qt.magFilter],Ve.min=an[Qt.minFilter],Ve.wrapS=Pr[Qt.wrapS],Ve.wrapT=Pr[Qt.wrapT],lt=0;lt<6;++lt)fo(Te[lt]);return Ve}function Ut(tt,ft,mt,De,st){k(!!ft,"must specify image data"),k(typeof tt=="number"&&tt===(tt|0)&&tt>=0&&tt<6,"invalid face");var me=mt|0,lt=De|0,Qt=st|0,ur=ln();return $r(ur,ce),ur.width=0,ur.height=0,yt(ur,ft),ur.width=ur.width||(ce.width>>Qt)-me,ur.height=ur.height||(ce.height>>Qt)-lt,k(ce.type===ur.type&&ce.format===ur.format&&ce.internalformat===ur.internalformat,"incompatible format for texture.subimage"),k(me>=0&<>=0&&me+ur.width<=ce.width&<+ur.height<=ce.height,"texture.subimage write out of bounds"),k(ce.mipmask&1<<Qt,"missing mipmap data"),k(ur.data||ur.element||ur.needsCopy,"missing image data"),es(ce),ot(ur,ku+tt,me,lt,Qt),ua(),yi(ur),Ve}function Bt(tt){var ft=tt|0;if(ft!==ce.width){Ve.width=ce.width=ft,Ve.height=ce.height=ft,es(ce);for(var mt=0;mt<6;++mt)for(var De=0;ce.mipmask>>De;++De)z.texImage2D(ku+mt,De,ce.format,ft>>De,ft>>De,0,ce.format,ce.type,null);return ua(),kt.profile&&(ce.stats.size=Pt(ce.internalformat,ce.type,Ve.width,Ve.height,!1,!0)),Ve}}return Ve(Ne,$t,Nt,hn,bi,da),Ve.subimage=Ut,Ve.resize=Bt,Ve._reglType="textureCube",Ve._texture=ce,kt.profile&&(Ve.stats=ce.stats),Ve.destroy=function(){ce.decRef()},Ve}function bo(){for(var Ne=0;Ne<ps;++Ne)z.activeTexture(Sh+Ne),z.bindTexture(xs,null),Io[Ne]=null;ea(Mo).forEach(Xn),Gt.cubeCount=0,Gt.textureCount=0}kt.profile&&(Gt.getTotalTextureSize=function(){var Ne=0;return Object.keys(Mo).forEach(function($t){Ne+=Mo[$t].stats.size}),Ne});function Xu(){for(var Ne=0;Ne<ps;++Ne){var $t=Io[Ne];$t&&($t.bindCount=0,$t.unit=-1,Io[Ne]=null)}ea(Mo).forEach(function(Nt){Nt.texture=z.createTexture(),z.bindTexture(Nt.target,Nt.texture);for(var hn=0;hn<32;++hn)if(Nt.mipmask&1<<hn)if(Nt.target===xs)z.texImage2D(xs,hn,Nt.internalformat,Nt.width>>hn,Nt.height>>hn,0,Nt.internalformat,Nt.type,null);else for(var bi=0;bi<6;++bi)z.texImage2D(ku+bi,hn,Nt.internalformat,Nt.width>>hn,Nt.height>>hn,0,Nt.internalformat,Nt.type,null);xo(Nt.texInfo,Nt.target)})}return{create2D:Oi,createCube:Xi,clear:bo,getTexture:function(Ne){return null},restore:Xu}}var B=36161,qs=32854,ge=32855,Bo=36194,io=33189,vu=36168,bs=34041,Da=35907,nc=34836,kn=34842,yn=34843,Ls=[];Ls[qs]=2,Ls[ge]=2,Ls[Bo]=2,Ls[io]=2,Ls[vu]=1,Ls[bs]=4,Ls[Da]=4,Ls[nc]=16,Ls[kn]=8,Ls[yn]=6;function qo(z,Ae,je){return Ls[z]*Ae*je}var mu=function(z,Ae,je,jt,pr){var Gt={rgba4:qs,rgb565:Bo,"rgb5 a1":ge,depth:io,stencil:vu,"depth stencil":bs};Ae.ext_srgb&&(Gt.srgba=Da),Ae.ext_color_buffer_half_float&&(Gt.rgba16f=kn,Gt.rgb16f=yn),Ae.webgl_color_buffer_float&&(Gt.rgba32f=nc);var kt=[];Object.keys(Gt).forEach(function(Ar){var zr=Gt[Ar];kt[zr]=Ar});var Dr=0,Cr={};function Vr(Ar){this.id=Dr++,this.refCount=1,this.renderbuffer=Ar,this.format=qs,this.width=0,this.height=0,pr.profile&&(this.stats={size:0})}Vr.prototype.decRef=function(){--this.refCount<=0&&Br(this)};function Br(Ar){var zr=Ar.renderbuffer;k(zr,"must not double destroy renderbuffer"),z.bindRenderbuffer(B,null),z.deleteRenderbuffer(zr),Ar.renderbuffer=null,Ar.refCount=0,delete Cr[Ar.id],jt.renderbufferCount--}function Ur(Ar,zr){var Tt=new Vr(z.createRenderbuffer());Cr[Tt.id]=Tt,jt.renderbufferCount++;function er(rn,yr){var an=0,Pr=0,nn=qs;if(typeof rn=="object"&&rn){var br=rn;if("shape"in br){var $r=br.shape;k(Array.isArray($r)&&$r.length>=2,"invalid renderbuffer shape"),an=$r[0]|0,Pr=$r[1]|0}else"radius"in br&&(an=Pr=br.radius|0),"width"in br&&(an=br.width|0),"height"in br&&(Pr=br.height|0);"format"in br&&(k.parameter(br.format,Gt,"invalid renderbuffer format"),nn=Gt[br.format])}else typeof rn=="number"?(an=rn|0,typeof yr=="number"?Pr=yr|0:Pr=an):rn?k.raise("invalid arguments to renderbuffer constructor"):an=Pr=1;if(k(an>0&&Pr>0&&an<=je.maxRenderbufferSize&&Pr<=je.maxRenderbufferSize,"invalid renderbuffer size"),!(an===Tt.width&&Pr===Tt.height&&nn===Tt.format))return er.width=Tt.width=an,er.height=Tt.height=Pr,Tt.format=nn,z.bindRenderbuffer(B,Tt.renderbuffer),z.renderbufferStorage(B,nn,an,Pr),k(z.getError()===0,"invalid render buffer format"),pr.profile&&(Tt.stats.size=qo(Tt.format,Tt.width,Tt.height)),er.format=kt[Tt.format],er}function Fr(rn,yr){var an=rn|0,Pr=yr|0||an;return an===Tt.width&&Pr===Tt.height||(k(an>0&&Pr>0&&an<=je.maxRenderbufferSize&&Pr<=je.maxRenderbufferSize,"invalid renderbuffer size"),er.width=Tt.width=an,er.height=Tt.height=Pr,z.bindRenderbuffer(B,Tt.renderbuffer),z.renderbufferStorage(B,Tt.format,an,Pr),k(z.getError()===0,"invalid render buffer format"),pr.profile&&(Tt.stats.size=qo(Tt.format,Tt.width,Tt.height))),er}return er(Ar,zr),er.resize=Fr,er._reglType="renderbuffer",er._renderbuffer=Tt,pr.profile&&(er.stats=Tt.stats),er.destroy=function(){Tt.decRef()},er}pr.profile&&(jt.getTotalRenderbufferSize=function(){var Ar=0;return Object.keys(Cr).forEach(function(zr){Ar+=Cr[zr].stats.size}),Ar});function Gr(){ea(Cr).forEach(function(Ar){Ar.renderbuffer=z.createRenderbuffer(),z.bindRenderbuffer(B,Ar.renderbuffer),z.renderbufferStorage(B,Ar.format,Ar.width,Ar.height)}),z.bindRenderbuffer(B,null)}return{create:Ur,clear:function(){ea(Cr).forEach(Br)},restore:Gr}},Fa=36160,Ns=36161,Ks=3553,Fc=34069,ra=36064,wo=36096,Ch=36128,Pl=33306,zf=36053,gu=36054,Es=36055,ic=36057,Nu=36061,Zf=36193,kc=5121,cf=5126,Vf=6407,ac=6408,oc=6402,Uu=[Vf,ac],zu=[];zu[ac]=4,zu[Vf]=3;var tu=[];tu[kc]=1,tu[cf]=4,tu[Zf]=2;var jf=32854,Ol=32855,ru=36194,Dl=33189,ff=36168,Rh=34041,Hf=35907,h=34836,d=34842,p=34843,g=[jf,Ol,ru,Hf,d,p,h],S={};S[zf]="complete",S[gu]="incomplete attachment",S[ic]="incomplete dimensions",S[Es]="incomplete, missing attachment",S[Nu]="unsupported";function w(z,Ae,je,jt,pr,Gt){var kt={cur:null,next:null,dirty:!1,setFBO:null},Dr=["rgba"],Cr=["rgba4","rgb565","rgb5 a1"];Ae.ext_srgb&&Cr.push("srgba"),Ae.ext_color_buffer_half_float&&Cr.push("rgba16f","rgb16f"),Ae.webgl_color_buffer_float&&Cr.push("rgba32f");var Vr=["uint8"];Ae.oes_texture_half_float&&Vr.push("half float","float16"),Ae.oes_texture_float&&Vr.push("float","float32");function Br(Qr,yt,vr){this.target=Qr,this.texture=yt,this.renderbuffer=vr;var ot=0,Ci=0;yt?(ot=yt.width,Ci=yt.height):vr&&(ot=vr.width,Ci=vr.height),this.width=ot,this.height=Ci}function Ur(Qr){Qr&&(Qr.texture&&Qr.texture._texture.decRef(),Qr.renderbuffer&&Qr.renderbuffer._renderbuffer.decRef())}function Gr(Qr,yt,vr){if(Qr)if(Qr.texture){var ot=Qr.texture._texture,Ci=Math.max(1,ot.width),ln=Math.max(1,ot.height);k(Ci===yt&&ln===vr,"inconsistent width/height for supplied texture"),ot.refCount+=1}else{var yi=Qr.renderbuffer._renderbuffer;k(yi.width===yt&&yi.height===vr,"inconsistent width/height for renderbuffer"),yi.refCount+=1}}function Ar(Qr,yt){yt&&(yt.texture?z.framebufferTexture2D(Fa,Qr,yt.target,yt.texture._texture.texture,0):z.framebufferRenderbuffer(Fa,Qr,Ns,yt.renderbuffer._renderbuffer.renderbuffer))}function zr(Qr){var yt=Ks,vr=null,ot=null,Ci=Qr;typeof Qr=="object"&&(Ci=Qr.data,"target"in Qr&&(yt=Qr.target|0)),k.type(Ci,"function","invalid attachment data");var ln=Ci._reglType;return ln==="texture2d"?(vr=Ci,k(yt===Ks)):ln==="textureCube"?(vr=Ci,k(yt>=Fc&&yt<Fc+6,"invalid cube map target")):ln==="renderbuffer"?(ot=Ci,yt=Ns):k.raise("invalid regl object for attachment"),new Br(yt,vr,ot)}function Tt(Qr,yt,vr,ot,Ci){if(vr){var ln=jt.create2D({width:Qr,height:yt,format:ot,type:Ci});return ln._texture.refCount=0,new Br(Ks,ln,null)}else{var yi=pr.create({width:Qr,height:yt,format:ot});return yi._renderbuffer.refCount=0,new Br(Ns,null,yi)}}function er(Qr){return Qr&&(Qr.texture||Qr.renderbuffer)}function Fr(Qr,yt,vr){Qr&&(Qr.texture?Qr.texture.resize(yt,vr):Qr.renderbuffer&&Qr.renderbuffer.resize(yt,vr),Qr.width=yt,Qr.height=vr)}var rn=0,yr={};function an(){this.id=rn++,yr[this.id]=this,this.framebuffer=z.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Pr(Qr){Qr.colorAttachments.forEach(Ur),Ur(Qr.depthAttachment),Ur(Qr.stencilAttachment),Ur(Qr.depthStencilAttachment)}function nn(Qr){var yt=Qr.framebuffer;k(yt,"must not double destroy framebuffer"),z.deleteFramebuffer(yt),Qr.framebuffer=null,Gt.framebufferCount--,delete yr[Qr.id]}function br(Qr){var yt;z.bindFramebuffer(Fa,Qr.framebuffer);var vr=Qr.colorAttachments;for(yt=0;yt<vr.length;++yt)Ar(ra+yt,vr[yt]);for(yt=vr.length;yt<je.maxColorAttachments;++yt)z.framebufferTexture2D(Fa,ra+yt,Ks,null,0);z.framebufferTexture2D(Fa,Pl,Ks,null,0),z.framebufferTexture2D(Fa,wo,Ks,null,0),z.framebufferTexture2D(Fa,Ch,Ks,null,0),Ar(wo,Qr.depthAttachment),Ar(Ch,Qr.stencilAttachment),Ar(Pl,Qr.depthStencilAttachment);var ot=z.checkFramebufferStatus(Fa);!z.isContextLost()&&ot!==zf&&k.raise("framebuffer configuration not supported, status = "+S[ot]),z.bindFramebuffer(Fa,kt.next?kt.next.framebuffer:null),kt.cur=kt.next,z.getError()}function $r(Qr,yt){var vr=new an;Gt.framebufferCount++;function ot(ln,yi){var si;k(kt.next!==vr,"can not update framebuffer which is currently in use");var Qn=0,Vi=0,_o=!0,Wo=!0,Pi=null,fo=!0,Sa="rgba",yo="uint8",xo=1,Ja=null,Mo=null,ps=null,Io=!1;if(typeof ln=="number")Qn=ln|0,Vi=yi|0||Qn;else if(!ln)Qn=Vi=1;else{k.type(ln,"object","invalid arguments for framebuffer");var xi=ln;if("shape"in xi){var es=xi.shape;k(Array.isArray(es)&&es.length>=2,"invalid shape for framebuffer"),Qn=es[0],Vi=es[1]}else"radius"in xi&&(Qn=Vi=xi.radius),"width"in xi&&(Qn=xi.width),"height"in xi&&(Vi=xi.height);("color"in xi||"colors"in xi)&&(Pi=xi.color||xi.colors,Array.isArray(Pi)&&k(Pi.length===1||Ae.webgl_draw_buffers,"multiple render targets not supported")),Pi||("colorCount"in xi&&(xo=xi.colorCount|0,k(xo>0,"invalid color buffer count")),"colorTexture"in xi&&(fo=!!xi.colorTexture,Sa="rgba4"),"colorType"in xi&&(yo=xi.colorType,fo?(k(Ae.oes_texture_float||!(yo==="float"||yo==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),k(Ae.oes_texture_half_float||!(yo==="half float"||yo==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):yo==="half float"||yo==="float16"?(k(Ae.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),Sa="rgba16f"):(yo==="float"||yo==="float32")&&(k(Ae.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),Sa="rgba32f"),k.oneOf(yo,Vr,"invalid color type")),"colorFormat"in xi&&(Sa=xi.colorFormat,Dr.indexOf(Sa)>=0?fo=!0:Cr.indexOf(Sa)>=0?fo=!1:fo?k.oneOf(xi.colorFormat,Dr,"invalid color format for texture"):k.oneOf(xi.colorFormat,Cr,"invalid color format for renderbuffer"))),("depthTexture"in xi||"depthStencilTexture"in xi)&&(Io=!!(xi.depthTexture||xi.depthStencilTexture),k(!Io||Ae.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in xi&&(typeof xi.depth=="boolean"?_o=xi.depth:(Ja=xi.depth,Wo=!1)),"stencil"in xi&&(typeof xi.stencil=="boolean"?Wo=xi.stencil:(Mo=xi.stencil,_o=!1)),"depthStencil"in xi&&(typeof xi.depthStencil=="boolean"?_o=Wo=xi.depthStencil:(ps=xi.depthStencil,_o=!1,Wo=!1))}var ua=null,Xn=null,Oi=null,Xi=null;if(Array.isArray(Pi))ua=Pi.map(zr);else if(Pi)ua=[zr(Pi)];else for(ua=new Array(xo),si=0;si<xo;++si)ua[si]=Tt(Qn,Vi,fo,Sa,yo);k(Ae.webgl_draw_buffers||ua.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),k(ua.length<=je.maxColorAttachments,"too many color attachments, not supported"),Qn=Qn||ua[0].width,Vi=Vi||ua[0].height,Ja?Xn=zr(Ja):_o&&!Wo&&(Xn=Tt(Qn,Vi,Io,"depth","uint32")),Mo?Oi=zr(Mo):Wo&&!_o&&(Oi=Tt(Qn,Vi,!1,"stencil","uint8")),ps?Xi=zr(ps):!Ja&&!Mo&&Wo&&_o&&(Xi=Tt(Qn,Vi,Io,"depth stencil","depth stencil")),k(!!Ja+!!Mo+!!ps<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var bo=null;for(si=0;si<ua.length;++si)if(Gr(ua[si],Qn,Vi),k(!ua[si]||ua[si].texture&&Uu.indexOf(ua[si].texture._texture.format)>=0||ua[si].renderbuffer&&g.indexOf(ua[si].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+si+" is invalid"),ua[si]&&ua[si].texture){var Xu=zu[ua[si].texture._texture.format]*tu[ua[si].texture._texture.type];bo===null?bo=Xu:k(bo===Xu,"all color attachments much have the same number of bits per pixel.")}return Gr(Xn,Qn,Vi),k(!Xn||Xn.texture&&Xn.texture._texture.format===oc||Xn.renderbuffer&&Xn.renderbuffer._renderbuffer.format===Dl,"invalid depth attachment for framebuffer object"),Gr(Oi,Qn,Vi),k(!Oi||Oi.renderbuffer&&Oi.renderbuffer._renderbuffer.format===ff,"invalid stencil attachment for framebuffer object"),Gr(Xi,Qn,Vi),k(!Xi||Xi.texture&&Xi.texture._texture.format===Rh||Xi.renderbuffer&&Xi.renderbuffer._renderbuffer.format===Rh,"invalid depth-stencil attachment for framebuffer object"),Pr(vr),vr.width=Qn,vr.height=Vi,vr.colorAttachments=ua,vr.depthAttachment=Xn,vr.stencilAttachment=Oi,vr.depthStencilAttachment=Xi,ot.color=ua.map(er),ot.depth=er(Xn),ot.stencil=er(Oi),ot.depthStencil=er(Xi),ot.width=vr.width,ot.height=vr.height,br(vr),ot}function Ci(ln,yi){k(kt.next!==vr,"can not resize a framebuffer which is currently in use");var si=Math.max(ln|0,1),Qn=Math.max(yi|0||si,1);if(si===vr.width&&Qn===vr.height)return ot;for(var Vi=vr.colorAttachments,_o=0;_o<Vi.length;++_o)Fr(Vi[_o],si,Qn);return Fr(vr.depthAttachment,si,Qn),Fr(vr.stencilAttachment,si,Qn),Fr(vr.depthStencilAttachment,si,Qn),vr.width=ot.width=si,vr.height=ot.height=Qn,br(vr),ot}return ot(Qr,yt),L(ot,{resize:Ci,_reglType:"framebuffer",_framebuffer:vr,destroy:function(){nn(vr),Pr(vr)},use:function(ln){kt.setFBO({framebuffer:ot},ln)}})}function Nn(Qr){var yt=Array(6);function vr(Ci){var ln;k(yt.indexOf(kt.next)<0,"can not update framebuffer which is currently in use");var yi={color:null},si=0,Qn=null,Vi="rgba",_o="uint8",Wo=1;if(typeof Ci=="number")si=Ci|0;else if(!Ci)si=1;else{k.type(Ci,"object","invalid arguments for framebuffer");var Pi=Ci;if("shape"in Pi){var fo=Pi.shape;k(Array.isArray(fo)&&fo.length>=2,"invalid shape for framebuffer"),k(fo[0]===fo[1],"cube framebuffer must be square"),si=fo[0]}else"radius"in Pi&&(si=Pi.radius|0),"width"in Pi?(si=Pi.width|0,"height"in Pi&&k(Pi.height===si,"must be square")):"height"in Pi&&(si=Pi.height|0);("color"in Pi||"colors"in Pi)&&(Qn=Pi.color||Pi.colors,Array.isArray(Qn)&&k(Qn.length===1||Ae.webgl_draw_buffers,"multiple render targets not supported")),Qn||("colorCount"in Pi&&(Wo=Pi.colorCount|0,k(Wo>0,"invalid color buffer count")),"colorType"in Pi&&(k.oneOf(Pi.colorType,Vr,"invalid color type"),_o=Pi.colorType),"colorFormat"in Pi&&(Vi=Pi.colorFormat,k.oneOf(Pi.colorFormat,Dr,"invalid color format for texture"))),"depth"in Pi&&(yi.depth=Pi.depth),"stencil"in Pi&&(yi.stencil=Pi.stencil),"depthStencil"in Pi&&(yi.depthStencil=Pi.depthStencil)}var Sa;if(Qn)if(Array.isArray(Qn))for(Sa=[],ln=0;ln<Qn.length;++ln)Sa[ln]=Qn[ln];else Sa=[Qn];else{Sa=Array(Wo);var yo={radius:si,format:Vi,type:_o};for(ln=0;ln<Wo;++ln)Sa[ln]=jt.createCube(yo)}for(yi.color=Array(Sa.length),ln=0;ln<Sa.length;++ln){var xo=Sa[ln];k(typeof xo=="function"&&xo._reglType==="textureCube","invalid cube map"),si=si||xo.width,k(xo.width===si&&xo.height===si,"invalid cube map shape"),yi.color[ln]={target:Fc,data:Sa[ln]}}for(ln=0;ln<6;++ln){for(var Ja=0;Ja<Sa.length;++Ja)yi.color[Ja].target=Fc+ln;ln>0&&(yi.depth=yt[0].depth,yi.stencil=yt[0].stencil,yi.depthStencil=yt[0].depthStencil),yt[ln]?yt[ln](yi):yt[ln]=$r(yi)}return L(vr,{width:si,height:si,color:Sa})}function ot(Ci){var ln,yi=Ci|0;if(k(yi>0&&yi<=je.maxCubeMapSize,"invalid radius for cube fbo"),yi===vr.width)return vr;var si=vr.color;for(ln=0;ln<si.length;++ln)si[ln].resize(yi);for(ln=0;ln<6;++ln)yt[ln].resize(yi);return vr.width=vr.height=yi,vr}return vr(Qr),L(vr,{faces:yt,resize:ot,_reglType:"framebufferCube",destroy:function(){yt.forEach(function(Ci){Ci.destroy()})}})}function ui(){kt.cur=null,kt.next=null,kt.dirty=!0,ea(yr).forEach(function(Qr){Qr.framebuffer=z.createFramebuffer(),br(Qr)})}return L(kt,{getFramebuffer:function(Qr){if(typeof Qr=="function"&&Qr._reglType==="framebuffer"){var yt=Qr._framebuffer;if(yt instanceof an)return yt}return null},create:$r,createCube:Nn,clear:function(){ea(yr).forEach(nn)},restore:ui})}var C=5126,P=34962;function Z(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=C,this.offset=0,this.stride=0,this.divisor=0}function Y(z,Ae,je,jt,pr){for(var Gt=je.maxAttributes,kt=new Array(Gt),Dr=0;Dr<Gt;++Dr)kt[Dr]=new Z;var Cr=0,Vr={},Br={Record:Z,scope:{},state:kt,currentVAO:null,targetVAO:null,restore:Gr()?yr:function(){},createVAO:an,getVAO:zr,destroyBuffer:Ur,setVAO:Gr()?Tt:er,clear:Gr()?Fr:function(){}};function Ur(Pr){for(var nn=0;nn<kt.length;++nn){var br=kt[nn];br.buffer===Pr&&(z.disableVertexAttribArray(nn),br.buffer=null)}}function Gr(){return Ae.oes_vertex_array_object}function Ar(){return Ae.angle_instanced_arrays}function zr(Pr){return typeof Pr=="function"&&Pr._vao?Pr._vao:null}function Tt(Pr){if(Pr!==Br.currentVAO){var nn=Gr();Pr?nn.bindVertexArrayOES(Pr.vao):nn.bindVertexArrayOES(null),Br.currentVAO=Pr}}function er(Pr){if(Pr!==Br.currentVAO){if(Pr)Pr.bindAttrs();else for(var nn=Ar(),br=0;br<kt.length;++br){var $r=kt[br];$r.buffer?(z.enableVertexAttribArray(br),z.vertexAttribPointer(br,$r.size,$r.type,$r.normalized,$r.stride,$r.offfset),nn&&nn.vertexAttribDivisorANGLE(br,$r.divisor)):(z.disableVertexAttribArray(br),z.vertexAttrib4f(br,$r.x,$r.y,$r.z,$r.w))}Br.currentVAO=Pr}}function Fr(){ea(Vr).forEach(function(Pr){Pr.destroy()})}function rn(){this.id=++Cr,this.attributes=[];var Pr=Gr();Pr?this.vao=Pr.createVertexArrayOES():this.vao=null,Vr[this.id]=this,this.buffers=[]}rn.prototype.bindAttrs=function(){for(var Pr=Ar(),nn=this.attributes,br=0;br<nn.length;++br){var $r=nn[br];$r.buffer?(z.enableVertexAttribArray(br),z.bindBuffer(P,$r.buffer.buffer),z.vertexAttribPointer(br,$r.size,$r.type,$r.normalized,$r.stride,$r.offset),Pr&&Pr.vertexAttribDivisorANGLE(br,$r.divisor)):(z.disableVertexAttribArray(br),z.vertexAttrib4f(br,$r.x,$r.y,$r.z,$r.w))}for(var Nn=nn.length;Nn<Gt;++Nn)z.disableVertexAttribArray(Nn)},rn.prototype.refresh=function(){var Pr=Gr();Pr&&(Pr.bindVertexArrayOES(this.vao),this.bindAttrs(),Br.currentVAO=this)},rn.prototype.destroy=function(){if(this.vao){var Pr=Gr();this===Br.currentVAO&&(Br.currentVAO=null,Pr.bindVertexArrayOES(null)),Pr.deleteVertexArrayOES(this.vao),this.vao=null}Vr[this.id]&&(delete Vr[this.id],jt.vaoCount-=1)};function yr(){var Pr=Gr();Pr&&ea(Vr).forEach(function(nn){nn.refresh()})}function an(Pr){var nn=new rn;jt.vaoCount+=1;function br($r){k(Array.isArray($r),"arguments to vertex array constructor must be an array"),k($r.length<Gt,"too many attributes"),k($r.length>0,"must specify at least one attribute");for(var Nn=0;Nn<nn.buffers.length;++Nn)nn.buffers[Nn].destroy();nn.buffers.length=0;var ui=nn.attributes;ui.length=$r.length;for(var Qr=0;Qr<$r.length;++Qr){var yt=$r[Qr],vr=ui[Qr]=new Z;if(Array.isArray(yt)||ee(yt)||Ea(yt)){var ot=pr.create(yt,P,!1,!0);vr.buffer=pr.getBuffer(ot),vr.size=vr.buffer.dimension|0,vr.normalized=!1,vr.type=vr.buffer.dtype,vr.offset=0,vr.stride=0,vr.divisor=0,vr.state=1,nn.buffers.push(ot)}else pr.getBuffer(yt)?(vr.buffer=pr.getBuffer(yt),vr.size=vr.buffer.dimension|0,vr.normalized=!1,vr.type=vr.buffer.dtype,vr.offset=0,vr.stride=0,vr.divisor=0,vr.state=1):pr.getBuffer(yt.buffer)?(vr.buffer=pr.getBuffer(yt.buffer),vr.size=(+yt.size||vr.buffer.dimension)|0,vr.normalized=!!yt.normalized||!1,"type"in yt?(k.parameter(yt.type,jo,"invalid buffer type"),vr.type=jo[yt.type]):vr.type=vr.buffer.dtype,vr.offset=(yt.offset||0)|0,vr.stride=(yt.stride||0)|0,vr.divisor=(yt.divisor||0)|0,vr.state=1,k(vr.size>=1&&vr.size<=4,"size must be between 1 and 4"),k(vr.offset>=0,"invalid offset"),k(vr.stride>=0&&vr.stride<=255,"stride must be between 0 and 255"),k(vr.divisor>=0,"divisor must be positive"),k(!vr.divisor||!!Ae.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in yt?(k(Qr>0,"first attribute must not be a constant"),vr.x=+yt.x||0,vr.y=+yt.y||0,vr.z=+yt.z||0,vr.w=+yt.w||0,vr.state=2):k(!1,"invalid attribute spec for location "+Qr)}return nn.refresh(),br}return br.destroy=function(){nn.destroy()},br._vao=nn,br._reglType="vao",br(Pr)}return Br}var pe=35632,_e=35633,ye=35718,Ue=35721;function ke(z,Ae,je,jt){var pr={},Gt={};function kt(Tt,er,Fr,rn){this.name=Tt,this.id=er,this.location=Fr,this.info=rn}function Dr(Tt,er){for(var Fr=0;Fr<Tt.length;++Fr)if(Tt[Fr].id===er.id){Tt[Fr].location=er.location;return}Tt.push(er)}function Cr(Tt,er,Fr){var rn=Tt===pe?pr:Gt,yr=rn[er];if(!yr){var an=Ae.str(er);yr=z.createShader(Tt),z.shaderSource(yr,an),z.compileShader(yr),k.shaderError(z,yr,an,Tt,Fr),rn[er]=yr}return yr}var Vr={},Br=[],Ur=0;function Gr(Tt,er){this.id=Ur++,this.fragId=Tt,this.vertId=er,this.program=null,this.uniforms=[],this.attributes=[],jt.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function Ar(Tt,er,Fr){var rn,yr,an=Cr(pe,Tt.fragId),Pr=Cr(_e,Tt.vertId),nn=Tt.program=z.createProgram();if(z.attachShader(nn,an),z.attachShader(nn,Pr),Fr)for(rn=0;rn<Fr.length;++rn){var br=Fr[rn];z.bindAttribLocation(nn,br[0],br[1])}z.linkProgram(nn),k.linkError(z,nn,Ae.str(Tt.fragId),Ae.str(Tt.vertId),er);var $r=z.getProgramParameter(nn,ye);jt.profile&&(Tt.stats.uniformsCount=$r);var Nn=Tt.uniforms;for(rn=0;rn<$r;++rn)if(yr=z.getActiveUniform(nn,rn),yr)if(yr.size>1)for(var ui=0;ui<yr.size;++ui){var Qr=yr.name.replace("[0]","["+ui+"]");Dr(Nn,new kt(Qr,Ae.id(Qr),z.getUniformLocation(nn,Qr),yr))}else Dr(Nn,new kt(yr.name,Ae.id(yr.name),z.getUniformLocation(nn,yr.name),yr));var yt=z.getProgramParameter(nn,Ue);jt.profile&&(Tt.stats.attributesCount=yt);var vr=Tt.attributes;for(rn=0;rn<yt;++rn)yr=z.getActiveAttrib(nn,rn),yr&&Dr(vr,new kt(yr.name,Ae.id(yr.name),z.getAttribLocation(nn,yr.name),yr))}jt.profile&&(je.getMaxUniformsCount=function(){var Tt=0;return Br.forEach(function(er){er.stats.uniformsCount>Tt&&(Tt=er.stats.uniformsCount)}),Tt},je.getMaxAttributesCount=function(){var Tt=0;return Br.forEach(function(er){er.stats.attributesCount>Tt&&(Tt=er.stats.attributesCount)}),Tt});function zr(){pr={},Gt={};for(var Tt=0;Tt<Br.length;++Tt)Ar(Br[Tt],null,Br[Tt].attributes.map(function(er){return[er.location,er.name]}))}return{clear:function(){var Tt=z.deleteShader.bind(z);ea(pr).forEach(Tt),pr={},ea(Gt).forEach(Tt),Gt={},Br.forEach(function(er){z.deleteProgram(er.program)}),Br.length=0,Vr={},je.shaderCount=0},program:function(Tt,er,Fr,rn){k.command(Tt>=0,"missing vertex shader",Fr),k.command(er>=0,"missing fragment shader",Fr);var yr=Vr[er];yr||(yr=Vr[er]={});var an=yr[Tt];if(an&&!rn)return an;var Pr=new Gr(er,Tt);return je.shaderCount++,Ar(Pr,Fr,rn),an||(yr[Tt]=Pr),Br.push(Pr),Pr},restore:zr,shader:Cr,frag:-1,vert:-1}}var Ke=6408,Ie=5121,$e=3333,vt=5126;function Rt(z,Ae,je,jt,pr,Gt,kt){function Dr(Br){var Ur;Ae.next===null?(k(pr.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),Ur=Ie):(k(Ae.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),Ur=Ae.next.colorAttachments[0].texture._texture.type,Gt.oes_texture_float?(k(Ur===Ie||Ur===vt,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),Ur===vt&&k(kt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):k(Ur===Ie,"Reading from a framebuffer is only allowed for the type 'uint8'"));var Gr=0,Ar=0,zr=jt.framebufferWidth,Tt=jt.framebufferHeight,er=null;ee(Br)?er=Br:Br&&(k.type(Br,"object","invalid arguments to regl.read()"),Gr=Br.x|0,Ar=Br.y|0,k(Gr>=0&&Gr<jt.framebufferWidth,"invalid x offset for regl.read"),k(Ar>=0&&Ar<jt.framebufferHeight,"invalid y offset for regl.read"),zr=(Br.width||jt.framebufferWidth-Gr)|0,Tt=(Br.height||jt.framebufferHeight-Ar)|0,er=Br.data||null),er&&(Ur===Ie?k(er instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):Ur===vt&&k(er instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),k(zr>0&&zr+Gr<=jt.framebufferWidth,"invalid width for read pixels"),k(Tt>0&&Tt+Ar<=jt.framebufferHeight,"invalid height for read pixels"),je();var Fr=zr*Tt*4;return er||(Ur===Ie?er=new Uint8Array(Fr):Ur===vt&&(er=er||new Float32Array(Fr))),k.isTypedArray(er,"data buffer for regl.read() must be a typedarray"),k(er.byteLength>=Fr,"data buffer for regl.read() too small"),z.pixelStorei($e,4),z.readPixels(Gr,Ar,zr,Tt,Ke,Ur,er),er}function Cr(Br){var Ur;return Ae.setFBO({framebuffer:Br.framebuffer},function(){Ur=Dr(Br)}),Ur}function Vr(Br){return!Br||!("framebuffer"in Br)?Dr(Br):Cr(Br)}return Vr}function Jt(z){return Array.prototype.slice.call(z)}function zt(z){return Jt(z).join("")}function ar(){var z=0,Ae=[],je=[];function jt(Ur){for(var Gr=0;Gr<je.length;++Gr)if(je[Gr]===Ur)return Ae[Gr];var Ar="g"+z++;return Ae.push(Ar),je.push(Ur),Ar}function pr(){var Ur=[];function Gr(){Ur.push.apply(Ur,Jt(arguments))}var Ar=[];function zr(){var Tt="v"+z++;return Ar.push(Tt),arguments.length>0&&(Ur.push(Tt,"="),Ur.push.apply(Ur,Jt(arguments)),Ur.push(";")),Tt}return L(Gr,{def:zr,toString:function(){return zt([Ar.length>0?"var "+Ar.join(",")+";":"",zt(Ur)])}})}function Gt(){var Ur=pr(),Gr=pr(),Ar=Ur.toString,zr=Gr.toString;function Tt(er,Fr){Gr(er,Fr,"=",Ur.def(er,Fr),";")}return L(function(){Ur.apply(Ur,Jt(arguments))},{def:Ur.def,entry:Ur,exit:Gr,save:Tt,set:function(er,Fr,rn){Tt(er,Fr),Ur(er,Fr,"=",rn,";")},toString:function(){return Ar()+zr()}})}function kt(){var Ur=zt(arguments),Gr=Gt(),Ar=Gt(),zr=Gr.toString,Tt=Ar.toString;return L(Gr,{then:function(){return Gr.apply(Gr,Jt(arguments)),this},else:function(){return Ar.apply(Ar,Jt(arguments)),this},toString:function(){var er=Tt();return er&&(er="else{"+er+"}"),zt(["if(",Ur,"){",zr(),"}",er])}})}var Dr=pr(),Cr={};function Vr(Ur,Gr){var Ar=[];function zr(){var yr="a"+Ar.length;return Ar.push(yr),yr}Gr=Gr||0;for(var Tt=0;Tt<Gr;++Tt)zr();var er=Gt(),Fr=er.toString,rn=Cr[Ur]=L(er,{arg:zr,toString:function(){return zt(["function(",Ar.join(),"){",Fr(),"}"])}});return rn}function Br(){var Ur=['"use strict";',Dr,"return {"];Object.keys(Cr).forEach(function(zr){Ur.push('"',zr,'":',Cr[zr].toString(),",")}),Ur.push("}");var Gr=zt(Ur).replace(/;/g,`;
|
|
`).replace(/}/g,`}
|
|
`).replace(/{/g,`{
|
|
`),Ar=Function.apply(null,Ae.concat(Gr));return Ar.apply(null,je)}return{global:Dr,link:jt,block:pr,proc:Vr,scope:Gt,cond:kt,compile:Br}}var _r="xyzw".split(""),Nr=5121,kr=1,un=2,Pn=0,zn=1,Zn=2,Wi=3,vn=4,ei="dither",_i="blend.enable",ri="blend.color",qn="blend.equation",di="blend.func",Jn="depth.enable",Kn="depth.func",Co="depth.range",Ua="depth.mask",Ro="colorMask",Lo="cull.enable",Ga="cull.face",Xa="frontFace",Ss="lineWidth",ls="polygonOffset.enable",Zu="polygonOffset.offset",cs="sample.alpha",nu="sample.enable",Us="sample.coverage",sl="stencil.enable",Fl="stencil.mask",ul="stencil.func",kl="stencil.opFront",Vu="stencil.opBack",iu="scissor.enable",ju="scissor.box",Ko="viewport",Qa="profile",As="framebuffer",au="vert",Hu="frag",Zi="elements",mo="primitive",ao="count",ou="offset",Bc="instances",Bl="vao",fs="Width",Or="Height",Wu=As+fs,Gu=As+Or,oo=Ko+fs,Ll=Ko+Or,_u="drawingBuffer",Qo=_u+fs,sc=_u+Or,hf=[di,qn,ul,kl,Vu,Us,Ko,ju,Zu],Lc=34962,Km=34963,Bv=35632,jp=35633,pf=3553,Id=34067,lp=2884,Pd=3042,Nc=3024,Mh=2960,Od=2929,Qm=3089,Hp=32823,Dd=32926,Jm=32928,Fd=5126,Uc=35664,Wf=35665,cp=35666,df=5124,fp=35667,so=35668,uc=35669,hp=35670,vf=35671,mf=35672,zc=35673,Ih=35674,gf=35675,ll=35676,Zc=35678,_f=35680,cl=4,lc=1028,yf=1029,pp=2304,Ph=2305,Wp=32775,xf=32776,fl=519,Nl=7680,kd=0,Oh=1,Gp=32774,dp=513,cc=36160,Bd=36064,hl={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},pl=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],bf={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},fc={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Xp={frag:Bv,vert:jp},Ul={cw:pp,ccw:Ph};function Gf(z){return Array.isArray(z)||ee(z)||Ea(z)}function vp(z){return z.sort(function(Ae,je){return Ae===Ko?-1:je===Ko?1:Ae<je?-1:1})}function Ts(z,Ae,je,jt){this.thisDep=z,this.contextDep=Ae,this.propDep=je,this.append=jt}function hs(z){return z&&!(z.thisDep||z.contextDep||z.propDep)}function go(z){return new Ts(!1,!1,!1,z)}function zs(z,Ae){var je=z.type;if(je===Pn){var jt=z.data.length;return new Ts(!0,jt>=1,jt>=2,Ae)}else if(je===vn){var pr=z.data;return new Ts(pr.thisDep,pr.contextDep,pr.propDep,Ae)}else return new Ts(je===Wi,je===Zn,je===zn,Ae)}var $p=new Ts(!1,!1,!1,function(){});function Xf(z,Ae,je,jt,pr,Gt,kt,Dr,Cr,Vr,Br,Ur,Gr,Ar,zr){var Tt=Vr.Record,er={add:32774,subtract:32778,"reverse subtract":32779};je.ext_blend_minmax&&(er.min=Wp,er.max=xf);var Fr=je.angle_instanced_arrays,rn=je.webgl_draw_buffers,yr={dirty:!0,profile:zr.profile},an={},Pr=[],nn={},br={};function $r(ce){return ce.replace(".","_")}function Nn(ce,Te,Ve){var Ut=$r(ce);Pr.push(ce),an[Ut]=yr[Ut]=!!Ve,nn[Ut]=Te}function ui(ce,Te,Ve){var Ut=$r(ce);Pr.push(ce),Array.isArray(Ve)?(yr[Ut]=Ve.slice(),an[Ut]=Ve.slice()):yr[Ut]=an[Ut]=Ve,br[Ut]=Te}Nn(ei,Nc),Nn(_i,Pd),ui(ri,"blendColor",[0,0,0,0]),ui(qn,"blendEquationSeparate",[Gp,Gp]),ui(di,"blendFuncSeparate",[Oh,kd,Oh,kd]),Nn(Jn,Od,!0),ui(Kn,"depthFunc",dp),ui(Co,"depthRange",[0,1]),ui(Ua,"depthMask",!0),ui(Ro,Ro,[!0,!0,!0,!0]),Nn(Lo,lp),ui(Ga,"cullFace",yf),ui(Xa,Xa,Ph),ui(Ss,Ss,1),Nn(ls,Hp),ui(Zu,"polygonOffset",[0,0]),Nn(cs,Dd),Nn(nu,Jm),ui(Us,"sampleCoverage",[1,!1]),Nn(sl,Mh),ui(Fl,"stencilMask",-1),ui(ul,"stencilFunc",[fl,0,-1]),ui(kl,"stencilOpSeparate",[lc,Nl,Nl,Nl]),ui(Vu,"stencilOpSeparate",[yf,Nl,Nl,Nl]),Nn(iu,Qm),ui(ju,"scissor",[0,0,z.drawingBufferWidth,z.drawingBufferHeight]),ui(Ko,Ko,[0,0,z.drawingBufferWidth,z.drawingBufferHeight]);var Qr={gl:z,context:Gr,strings:Ae,next:an,current:yr,draw:Ur,elements:Gt,buffer:pr,shader:Br,attributes:Vr.state,vao:Vr,uniforms:Cr,framebuffer:Dr,extensions:je,timer:Ar,isBufferArgs:Gf},yt={primTypes:Pu,compareFuncs:bf,blendFuncs:hl,blendEquations:er,stencilOps:fc,glTypes:jo,orientationType:Ul};k.optional(function(){Qr.isArrayLike=Ha}),rn&&(yt.backBuffer=[yf],yt.drawBuffer=hi(jt.maxDrawbuffers,function(ce){return ce===0?[0]:hi(ce,function(Te){return Bd+Te})}));var vr=0;function ot(){var ce=ar(),Te=ce.link,Ve=ce.global;ce.id=vr++,ce.batchId="0";var Ut=Te(Qr),Bt=ce.shared={props:"a0"};Object.keys(Qr).forEach(function(st){Bt[st]=Ve.def(Ut,".",st)}),k.optional(function(){ce.CHECK=Te(k),ce.commandStr=k.guessCommand(),ce.command=Te(ce.commandStr),ce.assert=function(st,me,lt){st("if(!(",me,"))",this.CHECK,".commandRaise(",Te(lt),",",this.command,");")},yt.invalidBlendCombinations=pl});var tt=ce.next={},ft=ce.current={};Object.keys(br).forEach(function(st){Array.isArray(yr[st])&&(tt[st]=Ve.def(Bt.next,".",st),ft[st]=Ve.def(Bt.current,".",st))});var mt=ce.constants={};Object.keys(yt).forEach(function(st){mt[st]=Ve.def(JSON.stringify(yt[st]))}),ce.invoke=function(st,me){switch(me.type){case Pn:var lt=["this",Bt.context,Bt.props,ce.batchId];return st.def(Te(me.data),".call(",lt.slice(0,Math.max(me.data.length+1,4)),")");case zn:return st.def(Bt.props,me.data);case Zn:return st.def(Bt.context,me.data);case Wi:return st.def("this",me.data);case vn:return me.data.append(ce,st),me.data.ref}},ce.attribCache={};var De={};return ce.scopeAttrib=function(st){var me=Ae.id(st);if(me in De)return De[me];var lt=Vr.scope[me];lt||(lt=Vr.scope[me]=new Tt);var Qt=De[me]=Te(lt);return Qt},ce}function Ci(ce){var Te=ce.static,Ve=ce.dynamic,Ut;if(Qa in Te){var Bt=!!Te[Qa];Ut=go(function(ft,mt){return Bt}),Ut.enable=Bt}else if(Qa in Ve){var tt=Ve[Qa];Ut=zs(tt,function(ft,mt){return ft.invoke(mt,tt)})}return Ut}function ln(ce,Te){var Ve=ce.static,Ut=ce.dynamic;if(As in Ve){var Bt=Ve[As];return Bt?(Bt=Dr.getFramebuffer(Bt),k.command(Bt,"invalid framebuffer object"),go(function(ft,mt){var De=ft.link(Bt),st=ft.shared;mt.set(st.framebuffer,".next",De);var me=st.context;return mt.set(me,"."+Wu,De+".width"),mt.set(me,"."+Gu,De+".height"),De})):go(function(ft,mt){var De=ft.shared;mt.set(De.framebuffer,".next","null");var st=De.context;return mt.set(st,"."+Wu,st+"."+Qo),mt.set(st,"."+Gu,st+"."+sc),"null"})}else if(As in Ut){var tt=Ut[As];return zs(tt,function(ft,mt){var De=ft.invoke(mt,tt),st=ft.shared,me=st.framebuffer,lt=mt.def(me,".getFramebuffer(",De,")");k.optional(function(){ft.assert(mt,"!"+De+"||"+lt,"invalid framebuffer object")}),mt.set(me,".next",lt);var Qt=st.context;return mt.set(Qt,"."+Wu,lt+"?"+lt+".width:"+Qt+"."+Qo),mt.set(Qt,"."+Gu,lt+"?"+lt+".height:"+Qt+"."+sc),lt})}else return null}function yi(ce,Te,Ve){var Ut=ce.static,Bt=ce.dynamic;function tt(De){if(De in Ut){var st=Ut[De];k.commandType(st,"object","invalid "+De,Ve.commandStr);var me=!0,lt=st.x|0,Qt=st.y|0,ur,xr;return"width"in st?(ur=st.width|0,k.command(ur>=0,"invalid "+De,Ve.commandStr)):me=!1,"height"in st?(xr=st.height|0,k.command(xr>=0,"invalid "+De,Ve.commandStr)):me=!1,new Ts(!me&&Te&&Te.thisDep,!me&&Te&&Te.contextDep,!me&&Te&&Te.propDep,function(On,xn){var Tn=On.shared.context,$n=ur;"width"in st||($n=xn.def(Tn,".",Wu,"-",lt));var ii=xr;return"height"in st||(ii=xn.def(Tn,".",Gu,"-",Qt)),[lt,Qt,$n,ii]})}else if(De in Bt){var gr=Bt[De],Mr=zs(gr,function(On,xn){var Tn=On.invoke(xn,gr);k.optional(function(){On.assert(xn,Tn+"&&typeof "+Tn+'==="object"',"invalid "+De)});var $n=On.shared.context,ii=xn.def(Tn,".x|0"),na=xn.def(Tn,".y|0"),Eo=xn.def('"width" in ',Tn,"?",Tn,".width|0:","(",$n,".",Wu,"-",ii,")"),dl=xn.def('"height" in ',Tn,"?",Tn,".height|0:","(",$n,".",Gu,"-",na,")");return k.optional(function(){On.assert(xn,Eo+">=0&&"+dl+">=0","invalid "+De)}),[ii,na,Eo,dl]});return Te&&(Mr.thisDep=Mr.thisDep||Te.thisDep,Mr.contextDep=Mr.contextDep||Te.contextDep,Mr.propDep=Mr.propDep||Te.propDep),Mr}else return Te?new Ts(Te.thisDep,Te.contextDep,Te.propDep,function(On,xn){var Tn=On.shared.context;return[0,0,xn.def(Tn,".",Wu),xn.def(Tn,".",Gu)]}):null}var ft=tt(Ko);if(ft){var mt=ft;ft=new Ts(ft.thisDep,ft.contextDep,ft.propDep,function(De,st){var me=mt.append(De,st),lt=De.shared.context;return st.set(lt,"."+oo,me[2]),st.set(lt,"."+Ll,me[3]),me})}return{viewport:ft,scissor_box:tt(ju)}}function si(ce,Te){var Ve=ce.static,Ut=typeof Ve[Hu]=="string"&&typeof Ve[au]=="string";if(Ut){if(Object.keys(Te.dynamic).length>0)return null;var Bt=Te.static,tt=Object.keys(Bt);if(tt.length>0&&typeof Bt[tt[0]]=="number"){for(var ft=[],mt=0;mt<tt.length;++mt)k(typeof Bt[tt[mt]]=="number","must specify all vertex attribute locations when using vaos"),ft.push([Bt[tt[mt]]|0,tt[mt]]);return ft}}return null}function Qn(ce,Te,Ve){var Ut=ce.static,Bt=ce.dynamic;function tt(me){if(me in Ut){var lt=Ae.id(Ut[me]);k.optional(function(){Br.shader(Xp[me],lt,k.guessCommand())});var Qt=go(function(){return lt});return Qt.id=lt,Qt}else if(me in Bt){var ur=Bt[me];return zs(ur,function(xr,gr){var Mr=xr.invoke(gr,ur),On=gr.def(xr.shared.strings,".id(",Mr,")");return k.optional(function(){gr(xr.shared.shader,".shader(",Xp[me],",",On,",",xr.command,");")}),On})}return null}var ft=tt(Hu),mt=tt(au),De=null,st;return hs(ft)&&hs(mt)?(De=Br.program(mt.id,ft.id,null,Ve),st=go(function(me,lt){return me.link(De)})):st=new Ts(ft&&ft.thisDep||mt&&mt.thisDep,ft&&ft.contextDep||mt&&mt.contextDep,ft&&ft.propDep||mt&&mt.propDep,function(me,lt){var Qt=me.shared.shader,ur;ft?ur=ft.append(me,lt):ur=lt.def(Qt,".",Hu);var xr;mt?xr=mt.append(me,lt):xr=lt.def(Qt,".",au);var gr=Qt+".program("+xr+","+ur;return k.optional(function(){gr+=","+me.command}),lt.def(gr+")")}),{frag:ft,vert:mt,progVar:st,program:De}}function Vi(ce,Te){var Ve=ce.static,Ut=ce.dynamic;function Bt(){if(Zi in Ve){var me=Ve[Zi];Gf(me)?me=Gt.getElements(Gt.create(me,!0)):me&&(me=Gt.getElements(me),k.command(me,"invalid elements",Te.commandStr));var lt=go(function(ur,xr){if(me){var gr=ur.link(me);return ur.ELEMENTS=gr,gr}return ur.ELEMENTS=null,null});return lt.value=me,lt}else if(Zi in Ut){var Qt=Ut[Zi];return zs(Qt,function(ur,xr){var gr=ur.shared,Mr=gr.isBufferArgs,On=gr.elements,xn=ur.invoke(xr,Qt),Tn=xr.def("null"),$n=xr.def(Mr,"(",xn,")"),ii=ur.cond($n).then(Tn,"=",On,".createStream(",xn,");").else(Tn,"=",On,".getElements(",xn,");");return k.optional(function(){ur.assert(ii.else,"!"+xn+"||"+Tn,"invalid elements")}),xr.entry(ii),xr.exit(ur.cond($n).then(On,".destroyStream(",Tn,");")),ur.ELEMENTS=Tn,Tn})}return null}var tt=Bt();function ft(){if(mo in Ve){var me=Ve[mo];return k.commandParameter(me,Pu,"invalid primitve",Te.commandStr),go(function(Qt,ur){return Pu[me]})}else if(mo in Ut){var lt=Ut[mo];return zs(lt,function(Qt,ur){var xr=Qt.constants.primTypes,gr=Qt.invoke(ur,lt);return k.optional(function(){Qt.assert(ur,gr+" in "+xr,"invalid primitive, must be one of "+Object.keys(Pu))}),ur.def(xr,"[",gr,"]")})}else if(tt)return hs(tt)?tt.value?go(function(Qt,ur){return ur.def(Qt.ELEMENTS,".primType")}):go(function(){return cl}):new Ts(tt.thisDep,tt.contextDep,tt.propDep,function(Qt,ur){var xr=Qt.ELEMENTS;return ur.def(xr,"?",xr,".primType:",cl)});return null}function mt(me,lt){if(me in Ve){var Qt=Ve[me]|0;return k.command(!lt||Qt>=0,"invalid "+me,Te.commandStr),go(function(xr,gr){return lt&&(xr.OFFSET=Qt),Qt})}else if(me in Ut){var ur=Ut[me];return zs(ur,function(xr,gr){var Mr=xr.invoke(gr,ur);return lt&&(xr.OFFSET=Mr,k.optional(function(){xr.assert(gr,Mr+">=0","invalid "+me)})),Mr})}else if(lt&&tt)return go(function(xr,gr){return xr.OFFSET="0",0});return null}var De=mt(ou,!0);function st(){if(ao in Ve){var me=Ve[ao]|0;return k.command(typeof me=="number"&&me>=0,"invalid vertex count",Te.commandStr),go(function(){return me})}else if(ao in Ut){var lt=Ut[ao];return zs(lt,function(xr,gr){var Mr=xr.invoke(gr,lt);return k.optional(function(){xr.assert(gr,"typeof "+Mr+'==="number"&&'+Mr+">=0&&"+Mr+"===("+Mr+"|0)","invalid vertex count")}),Mr})}else if(tt)if(hs(tt)){if(tt)return De?new Ts(De.thisDep,De.contextDep,De.propDep,function(xr,gr){var Mr=gr.def(xr.ELEMENTS,".vertCount-",xr.OFFSET);return k.optional(function(){xr.assert(gr,Mr+">=0","invalid vertex offset/element buffer too small")}),Mr}):go(function(xr,gr){return gr.def(xr.ELEMENTS,".vertCount")});var Qt=go(function(){return-1});return k.optional(function(){Qt.MISSING=!0}),Qt}else{var ur=new Ts(tt.thisDep||De.thisDep,tt.contextDep||De.contextDep,tt.propDep||De.propDep,function(xr,gr){var Mr=xr.ELEMENTS;return xr.OFFSET?gr.def(Mr,"?",Mr,".vertCount-",xr.OFFSET,":-1"):gr.def(Mr,"?",Mr,".vertCount:-1")});return k.optional(function(){ur.DYNAMIC=!0}),ur}return null}return{elements:tt,primitive:ft(),count:st(),instances:mt(Bc,!1),offset:De}}function _o(ce,Te){var Ve=ce.static,Ut=ce.dynamic,Bt={};return Pr.forEach(function(tt){var ft=$r(tt);function mt(De,st){if(tt in Ve){var me=De(Ve[tt]);Bt[ft]=go(function(){return me})}else if(tt in Ut){var lt=Ut[tt];Bt[ft]=zs(lt,function(Qt,ur){return st(Qt,ur,Qt.invoke(ur,lt))})}}switch(tt){case Lo:case _i:case ei:case sl:case Jn:case iu:case ls:case cs:case nu:case Ua:return mt(function(De){return k.commandType(De,"boolean",tt,Te.commandStr),De},function(De,st,me){return k.optional(function(){De.assert(st,"typeof "+me+'==="boolean"',"invalid flag "+tt,De.commandStr)}),me});case Kn:return mt(function(De){return k.commandParameter(De,bf,"invalid "+tt,Te.commandStr),bf[De]},function(De,st,me){var lt=De.constants.compareFuncs;return k.optional(function(){De.assert(st,me+" in "+lt,"invalid "+tt+", must be one of "+Object.keys(bf))}),st.def(lt,"[",me,"]")});case Co:return mt(function(De){return k.command(Ha(De)&&De.length===2&&typeof De[0]=="number"&&typeof De[1]=="number"&&De[0]<=De[1],"depth range is 2d array",Te.commandStr),De},function(De,st,me){k.optional(function(){De.assert(st,De.shared.isArrayLike+"("+me+")&&"+me+".length===2&&typeof "+me+'[0]==="number"&&typeof '+me+'[1]==="number"&&'+me+"[0]<="+me+"[1]","depth range must be a 2d array")});var lt=st.def("+",me,"[0]"),Qt=st.def("+",me,"[1]");return[lt,Qt]});case di:return mt(function(De){k.commandType(De,"object","blend.func",Te.commandStr);var st="srcRGB"in De?De.srcRGB:De.src,me="srcAlpha"in De?De.srcAlpha:De.src,lt="dstRGB"in De?De.dstRGB:De.dst,Qt="dstAlpha"in De?De.dstAlpha:De.dst;return k.commandParameter(st,hl,ft+".srcRGB",Te.commandStr),k.commandParameter(me,hl,ft+".srcAlpha",Te.commandStr),k.commandParameter(lt,hl,ft+".dstRGB",Te.commandStr),k.commandParameter(Qt,hl,ft+".dstAlpha",Te.commandStr),k.command(pl.indexOf(st+", "+lt)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+st+", "+lt+")",Te.commandStr),[hl[st],hl[lt],hl[me],hl[Qt]]},function(De,st,me){var lt=De.constants.blendFuncs;k.optional(function(){De.assert(st,me+"&&typeof "+me+'==="object"',"invalid blend func, must be an object")});function Qt(Tn,$n){var ii=st.def('"',Tn,$n,'" in ',me,"?",me,".",Tn,$n,":",me,".",Tn);return k.optional(function(){De.assert(st,ii+" in "+lt,"invalid "+tt+"."+Tn+$n+", must be one of "+Object.keys(hl))}),ii}var ur=Qt("src","RGB"),xr=Qt("dst","RGB");k.optional(function(){var Tn=De.constants.invalidBlendCombinations;De.assert(st,Tn+".indexOf("+ur+'+", "+'+xr+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var gr=st.def(lt,"[",ur,"]"),Mr=st.def(lt,"[",Qt("src","Alpha"),"]"),On=st.def(lt,"[",xr,"]"),xn=st.def(lt,"[",Qt("dst","Alpha"),"]");return[gr,On,Mr,xn]});case qn:return mt(function(De){if(typeof De=="string")return k.commandParameter(De,er,"invalid "+tt,Te.commandStr),[er[De],er[De]];if(typeof De=="object")return k.commandParameter(De.rgb,er,tt+".rgb",Te.commandStr),k.commandParameter(De.alpha,er,tt+".alpha",Te.commandStr),[er[De.rgb],er[De.alpha]];k.commandRaise("invalid blend.equation",Te.commandStr)},function(De,st,me){var lt=De.constants.blendEquations,Qt=st.def(),ur=st.def(),xr=De.cond("typeof ",me,'==="string"');return k.optional(function(){function gr(Mr,On,xn){De.assert(Mr,xn+" in "+lt,"invalid "+On+", must be one of "+Object.keys(er))}gr(xr.then,tt,me),De.assert(xr.else,me+"&&typeof "+me+'==="object"',"invalid "+tt),gr(xr.else,tt+".rgb",me+".rgb"),gr(xr.else,tt+".alpha",me+".alpha")}),xr.then(Qt,"=",ur,"=",lt,"[",me,"];"),xr.else(Qt,"=",lt,"[",me,".rgb];",ur,"=",lt,"[",me,".alpha];"),st(xr),[Qt,ur]});case ri:return mt(function(De){return k.command(Ha(De)&&De.length===4,"blend.color must be a 4d array",Te.commandStr),hi(4,function(st){return+De[st]})},function(De,st,me){return k.optional(function(){De.assert(st,De.shared.isArrayLike+"("+me+")&&"+me+".length===4","blend.color must be a 4d array")}),hi(4,function(lt){return st.def("+",me,"[",lt,"]")})});case Fl:return mt(function(De){return k.commandType(De,"number",ft,Te.commandStr),De|0},function(De,st,me){return k.optional(function(){De.assert(st,"typeof "+me+'==="number"',"invalid stencil.mask")}),st.def(me,"|0")});case ul:return mt(function(De){k.commandType(De,"object",ft,Te.commandStr);var st=De.cmp||"keep",me=De.ref||0,lt="mask"in De?De.mask:-1;return k.commandParameter(st,bf,tt+".cmp",Te.commandStr),k.commandType(me,"number",tt+".ref",Te.commandStr),k.commandType(lt,"number",tt+".mask",Te.commandStr),[bf[st],me,lt]},function(De,st,me){var lt=De.constants.compareFuncs;k.optional(function(){function gr(){De.assert(st,Array.prototype.join.call(arguments,""),"invalid stencil.func")}gr(me+"&&typeof ",me,'==="object"'),gr('!("cmp" in ',me,")||(",me,".cmp in ",lt,")")});var Qt=st.def('"cmp" in ',me,"?",lt,"[",me,".cmp]",":",Nl),ur=st.def(me,".ref|0"),xr=st.def('"mask" in ',me,"?",me,".mask|0:-1");return[Qt,ur,xr]});case kl:case Vu:return mt(function(De){k.commandType(De,"object",ft,Te.commandStr);var st=De.fail||"keep",me=De.zfail||"keep",lt=De.zpass||"keep";return k.commandParameter(st,fc,tt+".fail",Te.commandStr),k.commandParameter(me,fc,tt+".zfail",Te.commandStr),k.commandParameter(lt,fc,tt+".zpass",Te.commandStr),[tt===Vu?yf:lc,fc[st],fc[me],fc[lt]]},function(De,st,me){var lt=De.constants.stencilOps;k.optional(function(){De.assert(st,me+"&&typeof "+me+'==="object"',"invalid "+tt)});function Qt(ur){return k.optional(function(){De.assert(st,'!("'+ur+'" in '+me+")||("+me+"."+ur+" in "+lt+")","invalid "+tt+"."+ur+", must be one of "+Object.keys(fc))}),st.def('"',ur,'" in ',me,"?",lt,"[",me,".",ur,"]:",Nl)}return[tt===Vu?yf:lc,Qt("fail"),Qt("zfail"),Qt("zpass")]});case Zu:return mt(function(De){k.commandType(De,"object",ft,Te.commandStr);var st=De.factor|0,me=De.units|0;return k.commandType(st,"number",ft+".factor",Te.commandStr),k.commandType(me,"number",ft+".units",Te.commandStr),[st,me]},function(De,st,me){k.optional(function(){De.assert(st,me+"&&typeof "+me+'==="object"',"invalid "+tt)});var lt=st.def(me,".factor|0"),Qt=st.def(me,".units|0");return[lt,Qt]});case Ga:return mt(function(De){var st=0;return De==="front"?st=lc:De==="back"&&(st=yf),k.command(!!st,ft,Te.commandStr),st},function(De,st,me){return k.optional(function(){De.assert(st,me+'==="front"||'+me+'==="back"',"invalid cull.face")}),st.def(me,'==="front"?',lc,":",yf)});case Ss:return mt(function(De){return k.command(typeof De=="number"&&De>=jt.lineWidthDims[0]&&De<=jt.lineWidthDims[1],"invalid line width, must be a positive number between "+jt.lineWidthDims[0]+" and "+jt.lineWidthDims[1],Te.commandStr),De},function(De,st,me){return k.optional(function(){De.assert(st,"typeof "+me+'==="number"&&'+me+">="+jt.lineWidthDims[0]+"&&"+me+"<="+jt.lineWidthDims[1],"invalid line width")}),me});case Xa:return mt(function(De){return k.commandParameter(De,Ul,ft,Te.commandStr),Ul[De]},function(De,st,me){return k.optional(function(){De.assert(st,me+'==="cw"||'+me+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),st.def(me+'==="cw"?'+pp+":"+Ph)});case Ro:return mt(function(De){return k.command(Ha(De)&&De.length===4,"color.mask must be length 4 array",Te.commandStr),De.map(function(st){return!!st})},function(De,st,me){return k.optional(function(){De.assert(st,De.shared.isArrayLike+"("+me+")&&"+me+".length===4","invalid color.mask")}),hi(4,function(lt){return"!!"+me+"["+lt+"]"})});case Us:return mt(function(De){k.command(typeof De=="object"&&De,ft,Te.commandStr);var st="value"in De?De.value:1,me=!!De.invert;return k.command(typeof st=="number"&&st>=0&&st<=1,"sample.coverage.value must be a number between 0 and 1",Te.commandStr),[st,me]},function(De,st,me){k.optional(function(){De.assert(st,me+"&&typeof "+me+'==="object"',"invalid sample.coverage")});var lt=st.def('"value" in ',me,"?+",me,".value:1"),Qt=st.def("!!",me,".invert");return[lt,Qt]})}}),Bt}function Wo(ce,Te){var Ve=ce.static,Ut=ce.dynamic,Bt={};return Object.keys(Ve).forEach(function(tt){var ft=Ve[tt],mt;if(typeof ft=="number"||typeof ft=="boolean")mt=go(function(){return ft});else if(typeof ft=="function"){var De=ft._reglType;De==="texture2d"||De==="textureCube"?mt=go(function(st){return st.link(ft)}):De==="framebuffer"||De==="framebufferCube"?(k.command(ft.color.length>0,'missing color attachment for framebuffer sent to uniform "'+tt+'"',Te.commandStr),mt=go(function(st){return st.link(ft.color[0])})):k.commandRaise('invalid data for uniform "'+tt+'"',Te.commandStr)}else Ha(ft)?mt=go(function(st){var me=st.global.def("[",hi(ft.length,function(lt){return k.command(typeof ft[lt]=="number"||typeof ft[lt]=="boolean","invalid uniform "+tt,st.commandStr),ft[lt]}),"]");return me}):k.commandRaise('invalid or missing data for uniform "'+tt+'"',Te.commandStr);mt.value=ft,Bt[tt]=mt}),Object.keys(Ut).forEach(function(tt){var ft=Ut[tt];Bt[tt]=zs(ft,function(mt,De){return mt.invoke(De,ft)})}),Bt}function Pi(ce,Te){var Ve=ce.static,Ut=ce.dynamic,Bt={};return Object.keys(Ve).forEach(function(tt){var ft=Ve[tt],mt=Ae.id(tt),De=new Tt;if(Gf(ft))De.state=kr,De.buffer=pr.getBuffer(pr.create(ft,Lc,!1,!0)),De.type=0;else{var st=pr.getBuffer(ft);if(st)De.state=kr,De.buffer=st,De.type=0;else if(k.command(typeof ft=="object"&&ft,"invalid data for attribute "+tt,Te.commandStr),"constant"in ft){var me=ft.constant;De.buffer="null",De.state=un,typeof me=="number"?De.x=me:(k.command(Ha(me)&&me.length>0&&me.length<=4,"invalid constant for attribute "+tt,Te.commandStr),_r.forEach(function(On,xn){xn<me.length&&(De[On]=me[xn])}))}else{Gf(ft.buffer)?st=pr.getBuffer(pr.create(ft.buffer,Lc,!1,!0)):st=pr.getBuffer(ft.buffer),k.command(!!st,'missing buffer for attribute "'+tt+'"',Te.commandStr);var lt=ft.offset|0;k.command(lt>=0,'invalid offset for attribute "'+tt+'"',Te.commandStr);var Qt=ft.stride|0;k.command(Qt>=0&&Qt<256,'invalid stride for attribute "'+tt+'", must be integer betweeen [0, 255]',Te.commandStr);var ur=ft.size|0;k.command(!("size"in ft)||ur>0&&ur<=4,'invalid size for attribute "'+tt+'", must be 1,2,3,4',Te.commandStr);var xr=!!ft.normalized,gr=0;"type"in ft&&(k.commandParameter(ft.type,jo,"invalid type for attribute "+tt,Te.commandStr),gr=jo[ft.type]);var Mr=ft.divisor|0;"divisor"in ft&&(k.command(Mr===0||Fr,'cannot specify divisor for attribute "'+tt+'", instancing not supported',Te.commandStr),k.command(Mr>=0,'invalid divisor for attribute "'+tt+'"',Te.commandStr)),k.optional(function(){var On=Te.commandStr,xn=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(ft).forEach(function(Tn){k.command(xn.indexOf(Tn)>=0,'unknown parameter "'+Tn+'" for attribute pointer "'+tt+'" (valid parameters are '+xn+")",On)})}),De.buffer=st,De.state=kr,De.size=ur,De.normalized=xr,De.type=gr||st.dtype,De.offset=lt,De.stride=Qt,De.divisor=Mr}}Bt[tt]=go(function(On,xn){var Tn=On.attribCache;if(mt in Tn)return Tn[mt];var $n={isStream:!1};return Object.keys(De).forEach(function(ii){$n[ii]=De[ii]}),De.buffer&&($n.buffer=On.link(De.buffer),$n.type=$n.type||$n.buffer+".dtype"),Tn[mt]=$n,$n})}),Object.keys(Ut).forEach(function(tt){var ft=Ut[tt];function mt(De,st){var me=De.invoke(st,ft),lt=De.shared,Qt=De.constants,ur=lt.isBufferArgs,xr=lt.buffer;k.optional(function(){De.assert(st,me+"&&(typeof "+me+'==="object"||typeof '+me+'==="function")&&('+ur+"("+me+")||"+xr+".getBuffer("+me+")||"+xr+".getBuffer("+me+".buffer)||"+ur+"("+me+'.buffer)||("constant" in '+me+"&&(typeof "+me+'.constant==="number"||'+lt.isArrayLike+"("+me+".constant))))",'invalid dynamic attribute "'+tt+'"')});var gr={isStream:st.def(!1)},Mr=new Tt;Mr.state=kr,Object.keys(Mr).forEach(function($n){gr[$n]=st.def(""+Mr[$n])});var On=gr.buffer,xn=gr.type;st("if(",ur,"(",me,")){",gr.isStream,"=true;",On,"=",xr,".createStream(",Lc,",",me,");",xn,"=",On,".dtype;","}else{",On,"=",xr,".getBuffer(",me,");","if(",On,"){",xn,"=",On,".dtype;",'}else if("constant" in ',me,"){",gr.state,"=",un,";","if(typeof "+me+'.constant === "number"){',gr[_r[0]],"=",me,".constant;",_r.slice(1).map(function($n){return gr[$n]}).join("="),"=0;","}else{",_r.map(function($n,ii){return gr[$n]+"="+me+".constant.length>"+ii+"?"+me+".constant["+ii+"]:0;"}).join(""),"}}else{","if(",ur,"(",me,".buffer)){",On,"=",xr,".createStream(",Lc,",",me,".buffer);","}else{",On,"=",xr,".getBuffer(",me,".buffer);","}",xn,'="type" in ',me,"?",Qt.glTypes,"[",me,".type]:",On,".dtype;",gr.normalized,"=!!",me,".normalized;");function Tn($n){st(gr[$n],"=",me,".",$n,"|0;")}return Tn("size"),Tn("offset"),Tn("stride"),Tn("divisor"),st("}}"),st.exit("if(",gr.isStream,"){",xr,".destroyStream(",On,");","}"),gr}Bt[tt]=zs(ft,mt)}),Bt}function fo(ce,Te){var Ve=ce.static,Ut=ce.dynamic;if(Bl in Ve){var Bt=Ve[Bl];return Bt!==null&&Vr.getVAO(Bt)===null&&(Bt=Vr.createVAO(Bt)),go(function(ft){return ft.link(Vr.getVAO(Bt))})}else if(Bl in Ut){var tt=Ut[Bl];return zs(tt,function(ft,mt){var De=ft.invoke(mt,tt);return mt.def(ft.shared.vao+".getVAO("+De+")")})}return null}function Sa(ce){var Te=ce.static,Ve=ce.dynamic,Ut={};return Object.keys(Te).forEach(function(Bt){var tt=Te[Bt];Ut[Bt]=go(function(ft,mt){return typeof tt=="number"||typeof tt=="boolean"?""+tt:ft.link(tt)})}),Object.keys(Ve).forEach(function(Bt){var tt=Ve[Bt];Ut[Bt]=zs(tt,function(ft,mt){return ft.invoke(mt,tt)})}),Ut}function yo(ce,Te,Ve,Ut,Bt){var tt=ce.static,ft=ce.dynamic;k.optional(function(){var Tn=[As,au,Hu,Zi,mo,ou,ao,Bc,Qa,Bl].concat(Pr);function $n(ii){Object.keys(ii).forEach(function(na){k.command(Tn.indexOf(na)>=0,'unknown parameter "'+na+'"',Bt.commandStr)})}$n(tt),$n(ft)});var mt=si(ce,Te),De=ln(ce,Bt),st=yi(ce,De,Bt),me=Vi(ce,Bt),lt=_o(ce,Bt),Qt=Qn(ce,Bt,mt);function ur(Tn){var $n=st[Tn];$n&&(lt[Tn]=$n)}ur(Ko),ur($r(ju));var xr=Object.keys(lt).length>0,gr={framebuffer:De,draw:me,shader:Qt,state:lt,dirty:xr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(gr.profile=Ci(ce,Bt),gr.uniforms=Wo(Ve,Bt),gr.drawVAO=gr.scopeVAO=fo(ce,Bt),!gr.drawVAO&&Qt.program&&!mt&&je.angle_instanced_arrays){var Mr=!0,On=Qt.program.attributes.map(function(Tn){var $n=Te.static[Tn];return Mr=Mr&&!!$n,$n});if(Mr&&On.length>0){var xn=Vr.getVAO(Vr.createVAO(On));gr.drawVAO=new Ts(null,null,null,function(Tn,$n){return Tn.link(xn)}),gr.useVAO=!0}}return mt?gr.useVAO=!0:gr.attributes=Pi(Te,Bt),gr.context=Sa(Ut,Bt),gr}function xo(ce,Te,Ve){var Ut=ce.shared,Bt=Ut.context,tt=ce.scope();Object.keys(Ve).forEach(function(ft){Te.save(Bt,"."+ft);var mt=Ve[ft];tt(Bt,".",ft,"=",mt.append(ce,Te),";")}),Te(tt)}function Ja(ce,Te,Ve,Ut){var Bt=ce.shared,tt=Bt.gl,ft=Bt.framebuffer,mt;rn&&(mt=Te.def(Bt.extensions,".webgl_draw_buffers"));var De=ce.constants,st=De.drawBuffer,me=De.backBuffer,lt;Ve?lt=Ve.append(ce,Te):lt=Te.def(ft,".next"),Ut||Te("if(",lt,"!==",ft,".cur){"),Te("if(",lt,"){",tt,".bindFramebuffer(",cc,",",lt,".framebuffer);"),rn&&Te(mt,".drawBuffersWEBGL(",st,"[",lt,".colorAttachments.length]);"),Te("}else{",tt,".bindFramebuffer(",cc,",null);"),rn&&Te(mt,".drawBuffersWEBGL(",me,");"),Te("}",ft,".cur=",lt,";"),Ut||Te("}")}function Mo(ce,Te,Ve){var Ut=ce.shared,Bt=Ut.gl,tt=ce.current,ft=ce.next,mt=Ut.current,De=Ut.next,st=ce.cond(mt,".dirty");Pr.forEach(function(me){var lt=$r(me);if(!(lt in Ve.state)){var Qt,ur;if(lt in ft){Qt=ft[lt],ur=tt[lt];var xr=hi(yr[lt].length,function(Mr){return st.def(Qt,"[",Mr,"]")});st(ce.cond(xr.map(function(Mr,On){return Mr+"!=="+ur+"["+On+"]"}).join("||")).then(Bt,".",br[lt],"(",xr,");",xr.map(function(Mr,On){return ur+"["+On+"]="+Mr}).join(";"),";"))}else{Qt=st.def(De,".",lt);var gr=ce.cond(Qt,"!==",mt,".",lt);st(gr),lt in nn?gr(ce.cond(Qt).then(Bt,".enable(",nn[lt],");").else(Bt,".disable(",nn[lt],");"),mt,".",lt,"=",Qt,";"):gr(Bt,".",br[lt],"(",Qt,");",mt,".",lt,"=",Qt,";")}}}),Object.keys(Ve.state).length===0&&st(mt,".dirty=false;"),Te(st)}function ps(ce,Te,Ve,Ut){var Bt=ce.shared,tt=ce.current,ft=Bt.current,mt=Bt.gl;vp(Object.keys(Ve)).forEach(function(De){var st=Ve[De];if(!(Ut&&!Ut(st))){var me=st.append(ce,Te);if(nn[De]){var lt=nn[De];hs(st)?me?Te(mt,".enable(",lt,");"):Te(mt,".disable(",lt,");"):Te(ce.cond(me).then(mt,".enable(",lt,");").else(mt,".disable(",lt,");")),Te(ft,".",De,"=",me,";")}else if(Ha(me)){var Qt=tt[De];Te(mt,".",br[De],"(",me,");",me.map(function(ur,xr){return Qt+"["+xr+"]="+ur}).join(";"),";")}else Te(mt,".",br[De],"(",me,");",ft,".",De,"=",me,";")}})}function Io(ce,Te){Fr&&(ce.instancing=Te.def(ce.shared.extensions,".angle_instanced_arrays"))}function xi(ce,Te,Ve,Ut,Bt){var tt=ce.shared,ft=ce.stats,mt=tt.current,De=tt.timer,st=Ve.profile;function me(){return typeof performance=="undefined"?"Date.now()":"performance.now()"}var lt,Qt;function ur(Tn){lt=Te.def(),Tn(lt,"=",me(),";"),typeof Bt=="string"?Tn(ft,".count+=",Bt,";"):Tn(ft,".count++;"),Ar&&(Ut?(Qt=Te.def(),Tn(Qt,"=",De,".getNumPendingQueries();")):Tn(De,".beginQuery(",ft,");"))}function xr(Tn){Tn(ft,".cpuTime+=",me(),"-",lt,";"),Ar&&(Ut?Tn(De,".pushScopeStats(",Qt,",",De,".getNumPendingQueries(),",ft,");"):Tn(De,".endQuery();"))}function gr(Tn){var $n=Te.def(mt,".profile");Te(mt,".profile=",Tn,";"),Te.exit(mt,".profile=",$n,";")}var Mr;if(st){if(hs(st)){st.enable?(ur(Te),xr(Te.exit),gr("true")):gr("false");return}Mr=st.append(ce,Te),gr(Mr)}else Mr=Te.def(mt,".profile");var On=ce.block();ur(On),Te("if(",Mr,"){",On,"}");var xn=ce.block();xr(xn),Te.exit("if(",Mr,"){",xn,"}")}function es(ce,Te,Ve,Ut,Bt){var tt=ce.shared;function ft(De){switch(De){case Uc:case fp:case vf:return 2;case Wf:case so:case mf:return 3;case cp:case uc:case zc:return 4;default:return 1}}function mt(De,st,me){var lt=tt.gl,Qt=Te.def(De,".location"),ur=Te.def(tt.attributes,"[",Qt,"]"),xr=me.state,gr=me.buffer,Mr=[me.x,me.y,me.z,me.w],On=["buffer","normalized","offset","stride"];function xn(){Te("if(!",ur,".buffer){",lt,".enableVertexAttribArray(",Qt,");}");var $n=me.type,ii;if(me.size?ii=Te.def(me.size,"||",st):ii=st,Te("if(",ur,".type!==",$n,"||",ur,".size!==",ii,"||",On.map(function(Eo){return ur+"."+Eo+"!=="+me[Eo]}).join("||"),"){",lt,".bindBuffer(",Lc,",",gr,".buffer);",lt,".vertexAttribPointer(",[Qt,ii,$n,me.normalized,me.stride,me.offset],");",ur,".type=",$n,";",ur,".size=",ii,";",On.map(function(Eo){return ur+"."+Eo+"="+me[Eo]+";"}).join(""),"}"),Fr){var na=me.divisor;Te("if(",ur,".divisor!==",na,"){",ce.instancing,".vertexAttribDivisorANGLE(",[Qt,na],");",ur,".divisor=",na,";}")}}function Tn(){Te("if(",ur,".buffer){",lt,".disableVertexAttribArray(",Qt,");",ur,".buffer=null;","}if(",_r.map(function($n,ii){return ur+"."+$n+"!=="+Mr[ii]}).join("||"),"){",lt,".vertexAttrib4f(",Qt,",",Mr,");",_r.map(function($n,ii){return ur+"."+$n+"="+Mr[ii]+";"}).join(""),"}")}xr===kr?xn():xr===un?Tn():(Te("if(",xr,"===",kr,"){"),xn(),Te("}else{"),Tn(),Te("}"))}Ut.forEach(function(De){var st=De.name,me=Ve.attributes[st],lt;if(me){if(!Bt(me))return;lt=me.append(ce,Te)}else{if(!Bt($p))return;var Qt=ce.scopeAttrib(st);k.optional(function(){ce.assert(Te,Qt+".state","missing attribute "+st)}),lt={},Object.keys(new Tt).forEach(function(ur){lt[ur]=Te.def(Qt,".",ur)})}mt(ce.link(De),ft(De.info.type),lt)})}function ua(ce,Te,Ve,Ut,Bt){for(var tt=ce.shared,ft=tt.gl,mt,De=0;De<Ut.length;++De){var st=Ut[De],me=st.name,lt=st.info.type,Qt=Ve.uniforms[me],ur=ce.link(st),xr=ur+".location",gr;if(Qt){if(!Bt(Qt))continue;if(hs(Qt)){var Mr=Qt.value;if(k.command(Mr!==null&&typeof Mr!="undefined",'missing uniform "'+me+'"',ce.commandStr),lt===Zc||lt===_f){k.command(typeof Mr=="function"&&(lt===Zc&&(Mr._reglType==="texture2d"||Mr._reglType==="framebuffer")||lt===_f&&(Mr._reglType==="textureCube"||Mr._reglType==="framebufferCube")),"invalid texture for uniform "+me,ce.commandStr);var On=ce.link(Mr._texture||Mr.color[0]._texture);Te(ft,".uniform1i(",xr,",",On+".bind());"),Te.exit(On,".unbind();")}else if(lt===Ih||lt===gf||lt===ll){k.optional(function(){k.command(Ha(Mr),"invalid matrix for uniform "+me,ce.commandStr),k.command(lt===Ih&&Mr.length===4||lt===gf&&Mr.length===9||lt===ll&&Mr.length===16,"invalid length for matrix uniform "+me,ce.commandStr)});var xn=ce.global.def("new Float32Array(["+Array.prototype.slice.call(Mr)+"])"),Tn=2;lt===gf?Tn=3:lt===ll&&(Tn=4),Te(ft,".uniformMatrix",Tn,"fv(",xr,",false,",xn,");")}else{switch(lt){case Fd:k.commandType(Mr,"number","uniform "+me,ce.commandStr),mt="1f";break;case Uc:k.command(Ha(Mr)&&Mr.length===2,"uniform "+me,ce.commandStr),mt="2f";break;case Wf:k.command(Ha(Mr)&&Mr.length===3,"uniform "+me,ce.commandStr),mt="3f";break;case cp:k.command(Ha(Mr)&&Mr.length===4,"uniform "+me,ce.commandStr),mt="4f";break;case hp:k.commandType(Mr,"boolean","uniform "+me,ce.commandStr),mt="1i";break;case df:k.commandType(Mr,"number","uniform "+me,ce.commandStr),mt="1i";break;case vf:k.command(Ha(Mr)&&Mr.length===2,"uniform "+me,ce.commandStr),mt="2i";break;case fp:k.command(Ha(Mr)&&Mr.length===2,"uniform "+me,ce.commandStr),mt="2i";break;case mf:k.command(Ha(Mr)&&Mr.length===3,"uniform "+me,ce.commandStr),mt="3i";break;case so:k.command(Ha(Mr)&&Mr.length===3,"uniform "+me,ce.commandStr),mt="3i";break;case zc:k.command(Ha(Mr)&&Mr.length===4,"uniform "+me,ce.commandStr),mt="4i";break;case uc:k.command(Ha(Mr)&&Mr.length===4,"uniform "+me,ce.commandStr),mt="4i";break}Te(ft,".uniform",mt,"(",xr,",",Ha(Mr)?Array.prototype.slice.call(Mr):Mr,");")}continue}else gr=Qt.append(ce,Te)}else{if(!Bt($p))continue;gr=Te.def(tt.uniforms,"[",Ae.id(me),"]")}lt===Zc?Te("if(",gr,"&&",gr,'._reglType==="framebuffer"){',gr,"=",gr,".color[0];","}"):lt===_f&&Te("if(",gr,"&&",gr,'._reglType==="framebufferCube"){',gr,"=",gr,".color[0];","}"),k.optional(function(){function dl(Zs,hc){ce.assert(Te,Zs,'bad data or missing for uniform "'+me+'". '+hc)}function mp(Zs){dl("typeof "+gr+'==="'+Zs+'"',"invalid type, expected "+Zs)}function yu(Zs,hc){dl(tt.isArrayLike+"("+gr+")&&"+gr+".length==="+Zs,"invalid vector, should have length "+Zs,ce.commandStr)}function Vd(Zs){dl("typeof "+gr+'==="function"&&'+gr+'._reglType==="texture'+(Zs===pf?"2d":"Cube")+'"',"invalid texture type",ce.commandStr)}switch(lt){case df:mp("number");break;case fp:yu(2,"number");break;case so:yu(3,"number");break;case uc:yu(4,"number");break;case Fd:mp("number");break;case Uc:yu(2,"number");break;case Wf:yu(3,"number");break;case cp:yu(4,"number");break;case hp:mp("boolean");break;case vf:yu(2,"boolean");break;case mf:yu(3,"boolean");break;case zc:yu(4,"boolean");break;case Ih:yu(4,"number");break;case gf:yu(9,"number");break;case ll:yu(16,"number");break;case Zc:Vd(pf);break;case _f:Vd(Id);break}});var $n=1;switch(lt){case Zc:case _f:var ii=Te.def(gr,"._texture");Te(ft,".uniform1i(",xr,",",ii,".bind());"),Te.exit(ii,".unbind();");continue;case df:case hp:mt="1i";break;case fp:case vf:mt="2i",$n=2;break;case so:case mf:mt="3i",$n=3;break;case uc:case zc:mt="4i",$n=4;break;case Fd:mt="1f";break;case Uc:mt="2f",$n=2;break;case Wf:mt="3f",$n=3;break;case cp:mt="4f",$n=4;break;case Ih:mt="Matrix2fv";break;case gf:mt="Matrix3fv";break;case ll:mt="Matrix4fv";break}if(Te(ft,".uniform",mt,"(",xr,","),mt.charAt(0)==="M"){var na=Math.pow(lt-Ih+2,2),Eo=ce.global.def("new Float32Array(",na,")");Te("false,(Array.isArray(",gr,")||",gr," instanceof Float32Array)?",gr,":(",hi(na,function(dl){return Eo+"["+dl+"]="+gr+"["+dl+"]"}),",",Eo,")")}else $n>1?Te(hi($n,function(dl){return gr+"["+dl+"]"})):Te(gr);Te(");")}}function Xn(ce,Te,Ve,Ut){var Bt=ce.shared,tt=Bt.gl,ft=Bt.draw,mt=Ut.draw;function De(){var ii=mt.elements,na,Eo=Te;return ii?((ii.contextDep&&Ut.contextDynamic||ii.propDep)&&(Eo=Ve),na=ii.append(ce,Eo)):na=Eo.def(ft,".",Zi),na&&Eo("if("+na+")"+tt+".bindBuffer("+Km+","+na+".buffer.buffer);"),na}function st(){var ii=mt.count,na,Eo=Te;return ii?((ii.contextDep&&Ut.contextDynamic||ii.propDep)&&(Eo=Ve),na=ii.append(ce,Eo),k.optional(function(){ii.MISSING&&ce.assert(Te,"false","missing vertex count"),ii.DYNAMIC&&ce.assert(Eo,na+">=0","missing vertex count")})):(na=Eo.def(ft,".",ao),k.optional(function(){ce.assert(Eo,na+">=0","missing vertex count")})),na}var me=De();function lt(ii){var na=mt[ii];return na?na.contextDep&&Ut.contextDynamic||na.propDep?na.append(ce,Ve):na.append(ce,Te):Te.def(ft,".",ii)}var Qt=lt(mo),ur=lt(ou),xr=st();if(typeof xr=="number"){if(xr===0)return}else Ve("if(",xr,"){"),Ve.exit("}");var gr,Mr;Fr&&(gr=lt(Bc),Mr=ce.instancing);var On=me+".type",xn=mt.elements&&hs(mt.elements);function Tn(){function ii(){Ve(Mr,".drawElementsInstancedANGLE(",[Qt,xr,On,ur+"<<(("+On+"-"+Nr+")>>1)",gr],");")}function na(){Ve(Mr,".drawArraysInstancedANGLE(",[Qt,ur,xr,gr],");")}me?xn?ii():(Ve("if(",me,"){"),ii(),Ve("}else{"),na(),Ve("}")):na()}function $n(){function ii(){Ve(tt+".drawElements("+[Qt,xr,On,ur+"<<(("+On+"-"+Nr+")>>1)"]+");")}function na(){Ve(tt+".drawArrays("+[Qt,ur,xr]+");")}me?xn?ii():(Ve("if(",me,"){"),ii(),Ve("}else{"),na(),Ve("}")):na()}Fr&&(typeof gr!="number"||gr>=0)?typeof gr=="string"?(Ve("if(",gr,">0){"),Tn(),Ve("}else if(",gr,"<0){"),$n(),Ve("}")):Tn():$n()}function Oi(ce,Te,Ve,Ut,Bt){var tt=ot(),ft=tt.proc("body",Bt);return k.optional(function(){tt.commandStr=Te.commandStr,tt.command=tt.link(Te.commandStr)}),Fr&&(tt.instancing=ft.def(tt.shared.extensions,".angle_instanced_arrays")),ce(tt,ft,Ve,Ut),tt.compile().body}function Xi(ce,Te,Ve,Ut){Io(ce,Te),Ve.useVAO?Ve.drawVAO?Te(ce.shared.vao,".setVAO(",Ve.drawVAO.append(ce,Te),");"):Te(ce.shared.vao,".setVAO(",ce.shared.vao,".targetVAO);"):(Te(ce.shared.vao,".setVAO(null);"),es(ce,Te,Ve,Ut.attributes,function(){return!0})),ua(ce,Te,Ve,Ut.uniforms,function(){return!0}),Xn(ce,Te,Te,Ve)}function bo(ce,Te){var Ve=ce.proc("draw",1);Io(ce,Ve),xo(ce,Ve,Te.context),Ja(ce,Ve,Te.framebuffer),Mo(ce,Ve,Te),ps(ce,Ve,Te.state),xi(ce,Ve,Te,!1,!0);var Ut=Te.shader.progVar.append(ce,Ve);if(Ve(ce.shared.gl,".useProgram(",Ut,".program);"),Te.shader.program)Xi(ce,Ve,Te,Te.shader.program);else{Ve(ce.shared.vao,".setVAO(null);");var Bt=ce.global.def("{}"),tt=Ve.def(Ut,".id"),ft=Ve.def(Bt,"[",tt,"]");Ve(ce.cond(ft).then(ft,".call(this,a0);").else(ft,"=",Bt,"[",tt,"]=",ce.link(function(mt){return Oi(Xi,ce,Te,mt,1)}),"(",Ut,");",ft,".call(this,a0);"))}Object.keys(Te.state).length>0&&Ve(ce.shared.current,".dirty=true;")}function Xu(ce,Te,Ve,Ut){ce.batchId="a1",Io(ce,Te);function Bt(){return!0}es(ce,Te,Ve,Ut.attributes,Bt),ua(ce,Te,Ve,Ut.uniforms,Bt),Xn(ce,Te,Te,Ve)}function Ne(ce,Te,Ve,Ut){Io(ce,Te);var Bt=Ve.contextDep,tt=Te.def(),ft="a0",mt="a1",De=Te.def();ce.shared.props=De,ce.batchId=tt;var st=ce.scope(),me=ce.scope();Te(st.entry,"for(",tt,"=0;",tt,"<",mt,";++",tt,"){",De,"=",ft,"[",tt,"];",me,"}",st.exit);function lt(On){return On.contextDep&&Bt||On.propDep}function Qt(On){return!lt(On)}if(Ve.needsContext&&xo(ce,me,Ve.context),Ve.needsFramebuffer&&Ja(ce,me,Ve.framebuffer),ps(ce,me,Ve.state,lt),Ve.profile&<(Ve.profile)&&xi(ce,me,Ve,!1,!0),Ut)Ve.useVAO?Ve.drawVAO?lt(Ve.drawVAO)?me(ce.shared.vao,".setVAO(",Ve.drawVAO.append(ce,me),");"):st(ce.shared.vao,".setVAO(",Ve.drawVAO.append(ce,st),");"):st(ce.shared.vao,".setVAO(",ce.shared.vao,".targetVAO);"):(st(ce.shared.vao,".setVAO(null);"),es(ce,st,Ve,Ut.attributes,Qt),es(ce,me,Ve,Ut.attributes,lt)),ua(ce,st,Ve,Ut.uniforms,Qt),ua(ce,me,Ve,Ut.uniforms,lt),Xn(ce,st,me,Ve);else{var ur=ce.global.def("{}"),xr=Ve.shader.progVar.append(ce,me),gr=me.def(xr,".id"),Mr=me.def(ur,"[",gr,"]");me(ce.shared.gl,".useProgram(",xr,".program);","if(!",Mr,"){",Mr,"=",ur,"[",gr,"]=",ce.link(function(On){return Oi(Xu,ce,Ve,On,2)}),"(",xr,");}",Mr,".call(this,a0[",tt,"],",tt,");")}}function $t(ce,Te){var Ve=ce.proc("batch",2);ce.batchId="0",Io(ce,Ve);var Ut=!1,Bt=!0;Object.keys(Te.context).forEach(function(ur){Ut=Ut||Te.context[ur].propDep}),Ut||(xo(ce,Ve,Te.context),Bt=!1);var tt=Te.framebuffer,ft=!1;tt?(tt.propDep?Ut=ft=!0:tt.contextDep&&Ut&&(ft=!0),ft||Ja(ce,Ve,tt)):Ja(ce,Ve,null),Te.state.viewport&&Te.state.viewport.propDep&&(Ut=!0);function mt(ur){return ur.contextDep&&Ut||ur.propDep}Mo(ce,Ve,Te),ps(ce,Ve,Te.state,function(ur){return!mt(ur)}),(!Te.profile||!mt(Te.profile))&&xi(ce,Ve,Te,!1,"a1"),Te.contextDep=Ut,Te.needsContext=Bt,Te.needsFramebuffer=ft;var De=Te.shader.progVar;if(De.contextDep&&Ut||De.propDep)Ne(ce,Ve,Te,null);else{var st=De.append(ce,Ve);if(Ve(ce.shared.gl,".useProgram(",st,".program);"),Te.shader.program)Ne(ce,Ve,Te,Te.shader.program);else{Ve(ce.shared.vao,".setVAO(null);");var me=ce.global.def("{}"),lt=Ve.def(st,".id"),Qt=Ve.def(me,"[",lt,"]");Ve(ce.cond(Qt).then(Qt,".call(this,a0,a1);").else(Qt,"=",me,"[",lt,"]=",ce.link(function(ur){return Oi(Ne,ce,Te,ur,2)}),"(",st,");",Qt,".call(this,a0,a1);"))}}Object.keys(Te.state).length>0&&Ve(ce.shared.current,".dirty=true;")}function Nt(ce,Te){var Ve=ce.proc("scope",3);ce.batchId="a2";var Ut=ce.shared,Bt=Ut.current;xo(ce,Ve,Te.context),Te.framebuffer&&Te.framebuffer.append(ce,Ve),vp(Object.keys(Te.state)).forEach(function(ft){var mt=Te.state[ft],De=mt.append(ce,Ve);Ha(De)?De.forEach(function(st,me){Ve.set(ce.next[ft],"["+me+"]",st)}):Ve.set(Ut.next,"."+ft,De)}),xi(ce,Ve,Te,!0,!0),[Zi,ou,ao,Bc,mo].forEach(function(ft){var mt=Te.draw[ft];mt&&Ve.set(Ut.draw,"."+ft,""+mt.append(ce,Ve))}),Object.keys(Te.uniforms).forEach(function(ft){Ve.set(Ut.uniforms,"["+Ae.id(ft)+"]",Te.uniforms[ft].append(ce,Ve))}),Object.keys(Te.attributes).forEach(function(ft){var mt=Te.attributes[ft].append(ce,Ve),De=ce.scopeAttrib(ft);Object.keys(new Tt).forEach(function(st){Ve.set(De,"."+st,mt[st])})}),Te.scopeVAO&&Ve.set(Ut.vao,".targetVAO",Te.scopeVAO.append(ce,Ve));function tt(ft){var mt=Te.shader[ft];mt&&Ve.set(Ut.shader,"."+ft,mt.append(ce,Ve))}tt(au),tt(Hu),Object.keys(Te.state).length>0&&(Ve(Bt,".dirty=true;"),Ve.exit(Bt,".dirty=true;")),Ve("a1(",ce.shared.context,",a0,",ce.batchId,");")}function hn(ce){if(!(typeof ce!="object"||Ha(ce))){for(var Te=Object.keys(ce),Ve=0;Ve<Te.length;++Ve)if(mr.isDynamic(ce[Te[Ve]]))return!0;return!1}}function bi(ce,Te,Ve){var Ut=Te.static[Ve];if(!Ut||!hn(Ut))return;var Bt=ce.global,tt=Object.keys(Ut),ft=!1,mt=!1,De=!1,st=ce.global.def("{}");tt.forEach(function(lt){var Qt=Ut[lt];if(mr.isDynamic(Qt)){typeof Qt=="function"&&(Qt=Ut[lt]=mr.unbox(Qt));var ur=zs(Qt,null);ft=ft||ur.thisDep,De=De||ur.propDep,mt=mt||ur.contextDep}else{switch(Bt(st,".",lt,"="),typeof Qt){case"number":Bt(Qt);break;case"string":Bt('"',Qt,'"');break;case"object":Array.isArray(Qt)&&Bt("[",Qt.join(),"]");break;default:Bt(ce.link(Qt));break}Bt(";")}});function me(lt,Qt){tt.forEach(function(ur){var xr=Ut[ur];if(mr.isDynamic(xr)){var gr=lt.invoke(Qt,xr);Qt(st,".",ur,"=",gr,";")}})}Te.dynamic[Ve]=new mr.DynamicVariable(vn,{thisDep:ft,contextDep:mt,propDep:De,ref:st,append:me}),delete Te.static[Ve]}function da(ce,Te,Ve,Ut,Bt){var tt=ot();tt.stats=tt.link(Bt),Object.keys(Te.static).forEach(function(mt){bi(tt,Te,mt)}),hf.forEach(function(mt){bi(tt,ce,mt)});var ft=yo(ce,Te,Ve,Ut,tt);return bo(tt,ft),Nt(tt,ft),$t(tt,ft),tt.compile()}return{next:an,current:yr,procs:function(){var ce=ot(),Te=ce.proc("poll"),Ve=ce.proc("refresh"),Ut=ce.block();Te(Ut),Ve(Ut);var Bt=ce.shared,tt=Bt.gl,ft=Bt.next,mt=Bt.current;Ut(mt,".dirty=false;"),Ja(ce,Te),Ja(ce,Ve,null,!0);var De;Fr&&(De=ce.link(Fr)),je.oes_vertex_array_object&&Ve(ce.link(je.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var st=0;st<jt.maxAttributes;++st){var me=Ve.def(Bt.attributes,"[",st,"]"),lt=ce.cond(me,".buffer");lt.then(tt,".enableVertexAttribArray(",st,");",tt,".bindBuffer(",Lc,",",me,".buffer.buffer);",tt,".vertexAttribPointer(",st,",",me,".size,",me,".type,",me,".normalized,",me,".stride,",me,".offset);").else(tt,".disableVertexAttribArray(",st,");",tt,".vertexAttrib4f(",st,",",me,".x,",me,".y,",me,".z,",me,".w);",me,".buffer=null;"),Ve(lt),Fr&&Ve(De,".vertexAttribDivisorANGLE(",st,",",me,".divisor);")}return Ve(ce.shared.vao,".currentVAO=null;",ce.shared.vao,".setVAO(",ce.shared.vao,".targetVAO);"),Object.keys(nn).forEach(function(Qt){var ur=nn[Qt],xr=Ut.def(ft,".",Qt),gr=ce.block();gr("if(",xr,"){",tt,".enable(",ur,")}else{",tt,".disable(",ur,")}",mt,".",Qt,"=",xr,";"),Ve(gr),Te("if(",xr,"!==",mt,".",Qt,"){",gr,"}")}),Object.keys(br).forEach(function(Qt){var ur=br[Qt],xr=yr[Qt],gr,Mr,On=ce.block();if(On(tt,".",ur,"("),Ha(xr)){var xn=xr.length;gr=ce.global.def(ft,".",Qt),Mr=ce.global.def(mt,".",Qt),On(hi(xn,function(Tn){return gr+"["+Tn+"]"}),");",hi(xn,function(Tn){return Mr+"["+Tn+"]="+gr+"["+Tn+"];"}).join("")),Te("if(",hi(xn,function(Tn){return gr+"["+Tn+"]!=="+Mr+"["+Tn+"]"}).join("||"),"){",On,"}")}else gr=Ut.def(ft,".",Qt),Mr=Ut.def(mt,".",Qt),On(gr,");",mt,".",Qt,"=",gr,";"),Te("if(",gr,"!==",Mr,"){",On,"}");Ve(On)}),ce.compile()}(),compile:da}}function Ld(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var Lv=34918,Yp=34919,Nd=35007,Nv=function(z,Ae){if(!Ae.ext_disjoint_timer_query)return null;var je=[];function jt(){return je.pop()||Ae.ext_disjoint_timer_query.createQueryEXT()}function pr(Fr){je.push(Fr)}var Gt=[];function kt(Fr){var rn=jt();Ae.ext_disjoint_timer_query.beginQueryEXT(Nd,rn),Gt.push(rn),Ar(Gt.length-1,Gt.length,Fr)}function Dr(){Ae.ext_disjoint_timer_query.endQueryEXT(Nd)}function Cr(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var Vr=[];function Br(){return Vr.pop()||new Cr}function Ur(Fr){Vr.push(Fr)}var Gr=[];function Ar(Fr,rn,yr){var an=Br();an.startQueryIndex=Fr,an.endQueryIndex=rn,an.sum=0,an.stats=yr,Gr.push(an)}var zr=[],Tt=[];function er(){var Fr,rn,yr=Gt.length;if(yr!==0){Tt.length=Math.max(Tt.length,yr+1),zr.length=Math.max(zr.length,yr+1),zr[0]=0,Tt[0]=0;var an=0;for(Fr=0,rn=0;rn<Gt.length;++rn){var Pr=Gt[rn];Ae.ext_disjoint_timer_query.getQueryObjectEXT(Pr,Yp)?(an+=Ae.ext_disjoint_timer_query.getQueryObjectEXT(Pr,Lv),pr(Pr)):Gt[Fr++]=Pr,zr[rn+1]=an,Tt[rn+1]=Fr}for(Gt.length=Fr,Fr=0,rn=0;rn<Gr.length;++rn){var nn=Gr[rn],br=nn.startQueryIndex,$r=nn.endQueryIndex;nn.sum+=zr[$r]-zr[br];var Nn=Tt[br],ui=Tt[$r];ui===Nn?(nn.stats.gpuTime+=nn.sum/1e6,Ur(nn)):(nn.startQueryIndex=Nn,nn.endQueryIndex=ui,Gr[Fr++]=nn)}Gr.length=Fr}}return{beginQuery:kt,endQuery:Dr,pushScopeStats:Ar,update:er,getNumPendingQueries:function(){return Gt.length},clear:function(){je.push.apply(je,Gt);for(var Fr=0;Fr<je.length;Fr++)Ae.ext_disjoint_timer_query.deleteQueryEXT(je[Fr]);Gt.length=0,je.length=0},restore:function(){Gt.length=0,je.length=0}}},Dh=16384,Jo=256,Uv=1024,$f=34962,qp="webglcontextlost",Ud="webglcontextrestored",Kp=1,zv=2,Zv=3;function zd(z,Ae){for(var je=0;je<z.length;++je)if(z[je]===Ae)return je;return-1}function Zd(z){var Ae=lo(z);if(!Ae)return null;var je=Ae.gl,jt=je.getContextAttributes(),pr=je.isContextLost(),Gt=Is(je,Ae);if(!Gt)return null;var kt=En(),Dr=Ld(),Cr=Gt.extensions,Vr=Nv(je,Cr),Br=Fn(),Ur=je.drawingBufferWidth,Gr=je.drawingBufferHeight,Ar={tick:0,time:0,viewportWidth:Ur,viewportHeight:Gr,framebufferWidth:Ur,framebufferHeight:Gr,drawingBufferWidth:Ur,drawingBufferHeight:Gr,pixelRatio:Ae.pixelRatio},zr={},Tt={elements:null,primitive:4,count:-1,offset:0,instances:-1},er=Cc(je,Cr),Fr=ph(je,Dr,Ae,yr),rn=Y(je,Cr,er,Dr,Fr);function yr(Xn){return rn.destroyBuffer(Xn)}var an=ta(je,Cr,Fr,Dr),Pr=ke(je,kt,Dr,Ae),nn=Fe(je,Cr,er,function(){Nn.procs.poll()},Ar,Dr,Ae),br=mu(je,Cr,er,Dr,Ae),$r=w(je,Cr,er,nn,br,Dr),Nn=Xf(je,kt,Cr,er,Fr,an,nn,$r,zr,rn,Pr,Tt,Ar,Vr,Ae),ui=Rt(je,$r,Nn.procs.poll,Ar,jt,Cr,er),Qr=Nn.next,yt=je.canvas,vr=[],ot=[],Ci=[],ln=[Ae.onDestroy],yi=null;function si(){if(vr.length===0){Vr&&Vr.update(),yi=null;return}yi=Zr.next(si),ps();for(var Xn=vr.length-1;Xn>=0;--Xn){var Oi=vr[Xn];Oi&&Oi(Ar,null,0)}je.flush(),Vr&&Vr.update()}function Qn(){!yi&&vr.length>0&&(yi=Zr.next(si))}function Vi(){yi&&(Zr.cancel(si),yi=null)}function _o(Xn){Xn.preventDefault(),pr=!0,Vi(),ot.forEach(function(Oi){Oi()})}function Wo(Xn){je.getError(),pr=!1,Gt.restore(),Pr.restore(),Fr.restore(),nn.restore(),br.restore(),$r.restore(),rn.restore(),Vr&&Vr.restore(),Nn.procs.refresh(),Qn(),Ci.forEach(function(Oi){Oi()})}yt&&(yt.addEventListener(qp,_o,!1),yt.addEventListener(Ud,Wo,!1));function Pi(){vr.length=0,Vi(),yt&&(yt.removeEventListener(qp,_o),yt.removeEventListener(Ud,Wo)),Pr.clear(),$r.clear(),br.clear(),nn.clear(),an.clear(),Fr.clear(),rn.clear(),Vr&&Vr.clear(),ln.forEach(function(Xn){Xn()})}function fo(Xn){k(!!Xn,"invalid args to regl({...})"),k.type(Xn,"object","invalid args to regl({...})");function Oi(Bt){var tt=L({},Bt);delete tt.uniforms,delete tt.attributes,delete tt.context,delete tt.vao,"stencil"in tt&&tt.stencil.op&&(tt.stencil.opBack=tt.stencil.opFront=tt.stencil.op,delete tt.stencil.op);function ft(mt){if(mt in tt){var De=tt[mt];delete tt[mt],Object.keys(De).forEach(function(st){tt[mt+"."+st]=De[st]})}}return ft("blend"),ft("depth"),ft("cull"),ft("stencil"),ft("polygonOffset"),ft("scissor"),ft("sample"),"vao"in Bt&&(tt.vao=Bt.vao),tt}function Xi(Bt){var tt={},ft={};return Object.keys(Bt).forEach(function(mt){var De=Bt[mt];mr.isDynamic(De)?ft[mt]=mr.unbox(De,mt):tt[mt]=De}),{dynamic:ft,static:tt}}var bo=Xi(Xn.context||{}),Xu=Xi(Xn.uniforms||{}),Ne=Xi(Xn.attributes||{}),$t=Xi(Oi(Xn)),Nt={gpuTime:0,cpuTime:0,count:0},hn=Nn.compile($t,Ne,Xu,bo,Nt),bi=hn.draw,da=hn.batch,ce=hn.scope,Te=[];function Ve(Bt){for(;Te.length<Bt;)Te.push(null);return Te}function Ut(Bt,tt){var ft;if(pr&&k.raise("context lost"),typeof Bt=="function")return ce.call(this,null,Bt,0);if(typeof tt=="function")if(typeof Bt=="number")for(ft=0;ft<Bt;++ft)ce.call(this,null,tt,ft);else if(Array.isArray(Bt))for(ft=0;ft<Bt.length;++ft)ce.call(this,Bt[ft],tt,ft);else return ce.call(this,Bt,tt,0);else if(typeof Bt=="number"){if(Bt>0)return da.call(this,Ve(Bt|0),Bt|0)}else if(Array.isArray(Bt)){if(Bt.length)return da.call(this,Bt,Bt.length)}else return bi.call(this,Bt)}return L(Ut,{stats:Nt})}var Sa=$r.setFBO=fo({framebuffer:mr.define.call(null,Kp,"framebuffer")});function yo(Xn,Oi){var Xi=0;Nn.procs.poll();var bo=Oi.color;bo&&(je.clearColor(+bo[0]||0,+bo[1]||0,+bo[2]||0,+bo[3]||0),Xi|=Dh),"depth"in Oi&&(je.clearDepth(+Oi.depth),Xi|=Jo),"stencil"in Oi&&(je.clearStencil(Oi.stencil|0),Xi|=Uv),k(!!Xi,"called regl.clear with no buffer specified"),je.clear(Xi)}function xo(Xn){if(k(typeof Xn=="object"&&Xn,"regl.clear() takes an object as input"),"framebuffer"in Xn)if(Xn.framebuffer&&Xn.framebuffer_reglType==="framebufferCube")for(var Oi=0;Oi<6;++Oi)Sa(L({framebuffer:Xn.framebuffer.faces[Oi]},Xn),yo);else Sa(Xn,yo);else yo(null,Xn)}function Ja(Xn){k.type(Xn,"function","regl.frame() callback must be a function"),vr.push(Xn);function Oi(){var Xi=zd(vr,Xn);k(Xi>=0,"cannot cancel a frame twice");function bo(){var Xu=zd(vr,bo);vr[Xu]=vr[vr.length-1],vr.length-=1,vr.length<=0&&Vi()}vr[Xi]=bo}return Qn(),{cancel:Oi}}function Mo(){var Xn=Qr.viewport,Oi=Qr.scissor_box;Xn[0]=Xn[1]=Oi[0]=Oi[1]=0,Ar.viewportWidth=Ar.framebufferWidth=Ar.drawingBufferWidth=Xn[2]=Oi[2]=je.drawingBufferWidth,Ar.viewportHeight=Ar.framebufferHeight=Ar.drawingBufferHeight=Xn[3]=Oi[3]=je.drawingBufferHeight}function ps(){Ar.tick+=1,Ar.time=xi(),Mo(),Nn.procs.poll()}function Io(){Mo(),Nn.procs.refresh(),Vr&&Vr.update()}function xi(){return(Fn()-Br)/1e3}Io();function es(Xn,Oi){k.type(Oi,"function","listener callback must be a function");var Xi;switch(Xn){case"frame":return Ja(Oi);case"lost":Xi=ot;break;case"restore":Xi=Ci;break;case"destroy":Xi=ln;break;default:k.raise("invalid event, must be one of frame,lost,restore,destroy")}return Xi.push(Oi),{cancel:function(){for(var bo=0;bo<Xi.length;++bo)if(Xi[bo]===Oi){Xi[bo]=Xi[Xi.length-1],Xi.pop();return}}}}var ua=L(fo,{clear:xo,prop:mr.define.bind(null,Kp),context:mr.define.bind(null,zv),this:mr.define.bind(null,Zv),draw:fo({}),buffer:function(Xn){return Fr.create(Xn,$f,!1,!1)},elements:function(Xn){return an.create(Xn,!1)},texture:nn.create2D,cube:nn.createCube,renderbuffer:br.create,framebuffer:$r.create,framebufferCube:$r.createCube,vao:rn.createVAO,attributes:jt,frame:Ja,on:es,limits:er,hasExtension:function(Xn){return er.extensions.indexOf(Xn.toLowerCase())>=0},read:ui,destroy:Pi,_gl:je,_refresh:Io,poll:function(){ps(),Vr&&Vr.update()},now:xi,stats:Dr});return Ae.onDone(null,ua),ua}return Zd})},39720:function(rr){(function(ee,L){rr.exports=L()})(this,function(){"use strict";function ee(At,ut,It,qe,Ct,fr){if(!(Ct-qe<=It)){var re=qe+Ct>>1;L(At,ut,re,qe,Ct,fr%2),ee(At,ut,It,qe,re-1,fr+1),ee(At,ut,It,re+1,Ct,fr+1)}}function L(At,ut,It,qe,Ct,fr){for(;Ct>qe;){if(Ct-qe>600){var re=Ct-qe+1,V=It-qe+1,K=Math.log(re),Me=.5*Math.exp(2*K/3),Se=.5*Math.sqrt(K*Me*(re-Me)/re)*(V-re/2<0?-1:1),nt=Math.max(qe,Math.floor(It-V*Me/re+Se)),te=Math.min(Ct,Math.floor(It+(re-V)*Me/re+Se));L(At,ut,It,nt,te,fr)}var Ce=ut[2*It+fr],we=qe,Xe=Ct;for(q(At,ut,qe,It),ut[2*Ct+fr]>Ce&&q(At,ut,qe,Ct);we<Xe;){for(q(At,ut,we,Xe),we++,Xe--;ut[2*we+fr]<Ce;)we++;for(;ut[2*Xe+fr]>Ce;)Xe--}ut[2*qe+fr]===Ce?q(At,ut,qe,Xe):(Xe++,q(At,ut,Xe,Ct)),Xe<=It&&(qe=Xe+1),It<=Xe&&(Ct=Xe-1)}}function q(At,ut,It,qe){he(At,It,qe),he(ut,2*It,2*qe),he(ut,2*It+1,2*qe+1)}function he(At,ut,It){var qe=At[ut];At[ut]=At[It],At[It]=qe}function _(At,ut,It,qe,Ct,fr,re){for(var V=[0,At.length-1,0],K=[],Me,Se;V.length;){var nt=V.pop(),te=V.pop(),Ce=V.pop();if(te-Ce<=re){for(var we=Ce;we<=te;we++)Me=ut[2*we],Se=ut[2*we+1],Me>=It&&Me<=Ct&&Se>=qe&&Se<=fr&&K.push(At[we]);continue}var Xe=Math.floor((Ce+te)/2);Me=ut[2*Xe],Se=ut[2*Xe+1],Me>=It&&Me<=Ct&&Se>=qe&&Se<=fr&&K.push(At[Xe]);var Lt=(nt+1)%2;(nt===0?It<=Me:qe<=Se)&&(V.push(Ce),V.push(Xe-1),V.push(Lt)),(nt===0?Ct>=Me:fr>=Se)&&(V.push(Xe+1),V.push(te),V.push(Lt))}return K}function le(At,ut,It,qe,Ct,fr){for(var re=[0,At.length-1,0],V=[],K=Ct*Ct;re.length;){var Me=re.pop(),Se=re.pop(),nt=re.pop();if(Se-nt<=fr){for(var te=nt;te<=Se;te++)U(ut[2*te],ut[2*te+1],It,qe)<=K&&V.push(At[te]);continue}var Ce=Math.floor((nt+Se)/2),we=ut[2*Ce],Xe=ut[2*Ce+1];U(we,Xe,It,qe)<=K&&V.push(At[Ce]);var Lt=(Me+1)%2;(Me===0?It-Ct<=we:qe-Ct<=Xe)&&(re.push(nt),re.push(Ce-1),re.push(Lt)),(Me===0?It+Ct>=we:qe+Ct>=Xe)&&(re.push(Ce+1),re.push(Se),re.push(Lt))}return V}function U(At,ut,It,qe){var Ct=At-It,fr=ut-qe;return Ct*Ct+fr*fr}var fe=function(At){return At[0]},se=function(At){return At[1]},Qe=function(ut,It,qe,Ct,fr){It===void 0&&(It=fe),qe===void 0&&(qe=se),Ct===void 0&&(Ct=64),fr===void 0&&(fr=Float64Array),this.nodeSize=Ct,this.points=ut;for(var re=ut.length<65536?Uint16Array:Uint32Array,V=this.ids=new re(ut.length),K=this.coords=new fr(ut.length*2),Me=0;Me<ut.length;Me++)V[Me]=Me,K[2*Me]=It(ut[Me]),K[2*Me+1]=qe(ut[Me]);ee(V,K,Ct,0,V.length-1,0)};Qe.prototype.range=function(ut,It,qe,Ct){return _(this.ids,this.coords,ut,It,qe,Ct,this.nodeSize)},Qe.prototype.within=function(ut,It,qe){return le(this.ids,this.coords,ut,It,qe,this.nodeSize)};var ae={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(At){return At}},et=Math.fround||function(At){return function(ut){return At[0]=+ut,At[0]}}(new Float32Array(1)),dt=function(ut){this.options=Tr(Object.create(ae),ut),this.trees=new Array(this.options.maxZoom+1)};dt.prototype.load=function(ut){var It=this.options,qe=It.log,Ct=It.minZoom,fr=It.maxZoom,re=It.nodeSize;qe&&console.time("total time");var V="prepare "+ut.length+" points";qe&&console.time(V),this.points=ut;for(var K=[],Me=0;Me<ut.length;Me++)ut[Me].geometry&&K.push(wt(ut[Me],Me));this.trees[fr+1]=new Qe(K,hr,lr,re,Float32Array),qe&&console.timeEnd(V);for(var Se=fr;Se>=Ct;Se--){var nt=+Date.now();K=this._cluster(K,Se),this.trees[Se]=new Qe(K,hr,lr,re,Float32Array),qe&&console.log("z%d: %d clusters in %dms",Se,K.length,+Date.now()-nt)}return qe&&console.timeEnd("total time"),this},dt.prototype.getClusters=function(ut,It){var qe=((ut[0]+180)%360+360)%360-180,Ct=Math.max(-90,Math.min(90,ut[1])),fr=ut[2]===180?180:((ut[2]+180)%360+360)%360-180,re=Math.max(-90,Math.min(90,ut[3]));if(ut[2]-ut[0]>=360)qe=-180,fr=180;else if(qe>fr){var V=this.getClusters([qe,Ct,180,re],It),K=this.getClusters([-180,Ct,fr,re],It);return V.concat(K)}for(var Me=this.trees[this._limitZoom(It)],Se=Me.range(nr(qe),Vt(re),nr(fr),Vt(Ct)),nt=[],te=0,Ce=Se;te<Ce.length;te+=1){var we=Ce[te],Xe=Me.points[we];nt.push(Xe.numPoints?Xt(Xe):this.points[Xe.index])}return nt},dt.prototype.getChildren=function(ut){var It=this._getOriginId(ut),qe=this._getOriginZoom(ut),Ct="No cluster with the specified id.",fr=this.trees[qe];if(!fr)throw new Error(Ct);var re=fr.points[It];if(!re)throw new Error(Ct);for(var V=this.options.radius/(this.options.extent*Math.pow(2,qe-1)),K=fr.within(re.x,re.y,V),Me=[],Se=0,nt=K;Se<nt.length;Se+=1){var te=nt[Se],Ce=fr.points[te];Ce.parentId===ut&&Me.push(Ce.numPoints?Xt(Ce):this.points[Ce.index])}if(Me.length===0)throw new Error(Ct);return Me},dt.prototype.getLeaves=function(ut,It,qe){It=It||10,qe=qe||0;var Ct=[];return this._appendLeaves(Ct,ut,It,qe,0),Ct},dt.prototype.getTile=function(ut,It,qe){var Ct=this.trees[this._limitZoom(ut)],fr=Math.pow(2,ut),re=this.options,V=re.extent,K=re.radius,Me=K/V,Se=(qe-Me)/fr,nt=(qe+1+Me)/fr,te={features:[]};return this._addTileFeatures(Ct.range((It-Me)/fr,Se,(It+1+Me)/fr,nt),Ct.points,It,qe,fr,te),It===0&&this._addTileFeatures(Ct.range(1-Me/fr,Se,1,nt),Ct.points,fr,qe,fr,te),It===fr-1&&this._addTileFeatures(Ct.range(0,Se,Me/fr,nt),Ct.points,-1,qe,fr,te),te.features.length?te:null},dt.prototype.getClusterExpansionZoom=function(ut){for(var It=this._getOriginZoom(ut)-1;It<=this.options.maxZoom;){var qe=this.getChildren(ut);if(It++,qe.length!==1)break;ut=qe[0].properties.cluster_id}return It},dt.prototype._appendLeaves=function(ut,It,qe,Ct,fr){for(var re=this.getChildren(It),V=0,K=re;V<K.length;V+=1){var Me=K[V],Se=Me.properties;if(Se&&Se.cluster?fr+Se.point_count<=Ct?fr+=Se.point_count:fr=this._appendLeaves(ut,Se.cluster_id,qe,Ct,fr):fr<Ct?fr++:ut.push(Me),ut.length===qe)break}return fr},dt.prototype._addTileFeatures=function(ut,It,qe,Ct,fr,re){for(var V=0,K=ut;V<K.length;V+=1){var Me=K[V],Se=It[Me],nt=Se.numPoints,te=void 0,Ce=void 0,we=void 0;if(nt)te=Zt(Se),Ce=Se.x,we=Se.y;else{var Xe=this.points[Se.index];te=Xe.properties,Ce=nr(Xe.geometry.coordinates[0]),we=Vt(Xe.geometry.coordinates[1])}var Lt={type:1,geometry:[[Math.round(this.options.extent*(Ce*fr-qe)),Math.round(this.options.extent*(we*fr-Ct))]],tags:te},Ht=void 0;nt?Ht=Se.id:this.options.generateId?Ht=Se.index:this.points[Se.index].id&&(Ht=this.points[Se.index].id),Ht!==void 0&&(Lt.id=Ht),re.features.push(Lt)}},dt.prototype._limitZoom=function(ut){return Math.max(this.options.minZoom,Math.min(Math.floor(+ut),this.options.maxZoom+1))},dt.prototype._cluster=function(ut,It){for(var qe=[],Ct=this.options,fr=Ct.radius,re=Ct.extent,V=Ct.reduce,K=Ct.minPoints,Me=fr/(re*Math.pow(2,It)),Se=0;Se<ut.length;Se++){var nt=ut[Se];if(!(nt.zoom<=It)){nt.zoom=It;for(var te=this.trees[It+1],Ce=te.within(nt.x,nt.y,Me),we=nt.numPoints||1,Xe=we,Lt=0,Ht=Ce;Lt<Ht.length;Lt+=1){var on=Ht[Lt],Jr=te.points[on];Jr.zoom>It&&(Xe+=Jr.numPoints||1)}if(Xe>we&&Xe>=K){for(var Hr=nt.x*we,Un=nt.y*we,bn=V&&we>1?this._map(nt,!0):null,Kr=(Se<<5)+(It+1)+this.points.length,Mi=0,Si=Ce;Mi<Si.length;Mi+=1){var Ri=Si[Mi],Gn=te.points[Ri];if(!(Gn.zoom<=It)){Gn.zoom=It;var Dn=Gn.numPoints||1;Hr+=Gn.x*Dn,Un+=Gn.y*Dn,Gn.parentId=Kr,V&&(bn||(bn=this._map(nt,!0)),V(bn,this._map(Gn)))}}nt.parentId=Kr,qe.push(Ye(Hr/Xe,Un/Xe,Kr,Xe,bn))}else if(qe.push(nt),Xe>1)for(var Ya=0,Yi=Ce;Ya<Yi.length;Ya+=1){var Na=Yi[Ya],Dt=te.points[Na];Dt.zoom<=It||(Dt.zoom=It,qe.push(Dt))}}}return qe},dt.prototype._getOriginId=function(ut){return ut-this.points.length>>5},dt.prototype._getOriginZoom=function(ut){return(ut-this.points.length)%32},dt.prototype._map=function(ut,It){if(ut.numPoints)return It?Tr({},ut.properties):ut.properties;var qe=this.points[ut.index].properties,Ct=this.options.map(qe);return It&&Ct===qe?Tr({},Ct):Ct};function Ye(At,ut,It,qe,Ct){return{x:et(At),y:et(ut),zoom:1/0,id:It,parentId:-1,numPoints:qe,properties:Ct}}function wt(At,ut){var It=At.geometry.coordinates,qe=It[0],Ct=It[1];return{x:et(nr(qe)),y:et(Vt(Ct)),zoom:1/0,index:ut,parentId:-1}}function Xt(At){return{type:"Feature",id:At.id,properties:Zt(At),geometry:{type:"Point",coordinates:[xt(At.x),bt(At.y)]}}}function Zt(At){var ut=At.numPoints,It=ut>=1e4?Math.round(ut/1e3)+"k":ut>=1e3?Math.round(ut/100)/10+"k":ut;return Tr(Tr({},At.properties),{cluster:!0,cluster_id:At.id,point_count:ut,point_count_abbreviated:It})}function nr(At){return At/360+.5}function Vt(At){var ut=Math.sin(At*Math.PI/180),It=.5-.25*Math.log((1+ut)/(1-ut))/Math.PI;return It<0?0:It>1?1:It}function xt(At){return(At-.5)*360}function bt(At){var ut=(180-At*360)*Math.PI/180;return 360*Math.atan(Math.exp(ut))/Math.PI-90}function Tr(At,ut){for(var It in ut)At[It]=ut[It];return At}function hr(At){return At.x}function lr(At){return At.y}return dt})},58576:function(rr,ee,L){var q=L(85057).default;function he(){"use strict";rr.exports=he=function(){return le},rr.exports.__esModule=!0,rr.exports.default=rr.exports;var _,le={},U=Object.prototype,fe=U.hasOwnProperty,se=Object.defineProperty||function(te,Ce,we){te[Ce]=we.value},Qe=typeof Symbol=="function"?Symbol:{},ae=Qe.iterator||"@@iterator",et=Qe.asyncIterator||"@@asyncIterator",dt=Qe.toStringTag||"@@toStringTag";function Ye(te,Ce,we){return Object.defineProperty(te,Ce,{value:we,enumerable:!0,configurable:!0,writable:!0}),te[Ce]}try{Ye({},"")}catch(te){Ye=function(we,Xe,Lt){return we[Xe]=Lt}}function wt(te,Ce,we,Xe){var Lt=Ce&&Ce.prototype instanceof Tr?Ce:Tr,Ht=Object.create(Lt.prototype),on=new Se(Xe||[]);return se(Ht,"_invoke",{value:re(te,we,on)}),Ht}function Xt(te,Ce,we){try{return{type:"normal",arg:te.call(Ce,we)}}catch(Xe){return{type:"throw",arg:Xe}}}le.wrap=wt;var Zt="suspendedStart",nr="suspendedYield",Vt="executing",xt="completed",bt={};function Tr(){}function hr(){}function lr(){}var At={};Ye(At,ae,function(){return this});var ut=Object.getPrototypeOf,It=ut&&ut(ut(nt([])));It&&It!==U&&fe.call(It,ae)&&(At=It);var qe=lr.prototype=Tr.prototype=Object.create(At);function Ct(te){["next","throw","return"].forEach(function(Ce){Ye(te,Ce,function(we){return this._invoke(Ce,we)})})}function fr(te,Ce){function we(Lt,Ht,on,Jr){var Hr=Xt(te[Lt],te,Ht);if(Hr.type!=="throw"){var Un=Hr.arg,bn=Un.value;return bn&&q(bn)=="object"&&fe.call(bn,"__await")?Ce.resolve(bn.__await).then(function(Kr){we("next",Kr,on,Jr)},function(Kr){we("throw",Kr,on,Jr)}):Ce.resolve(bn).then(function(Kr){Un.value=Kr,on(Un)},function(Kr){return we("throw",Kr,on,Jr)})}Jr(Hr.arg)}var Xe;se(this,"_invoke",{value:function(Ht,on){function Jr(){return new Ce(function(Hr,Un){we(Ht,on,Hr,Un)})}return Xe=Xe?Xe.then(Jr,Jr):Jr()}})}function re(te,Ce,we){var Xe=Zt;return function(Lt,Ht){if(Xe===Vt)throw new Error("Generator is already running");if(Xe===xt){if(Lt==="throw")throw Ht;return{value:_,done:!0}}for(we.method=Lt,we.arg=Ht;;){var on=we.delegate;if(on){var Jr=V(on,we);if(Jr){if(Jr===bt)continue;return Jr}}if(we.method==="next")we.sent=we._sent=we.arg;else if(we.method==="throw"){if(Xe===Zt)throw Xe=xt,we.arg;we.dispatchException(we.arg)}else we.method==="return"&&we.abrupt("return",we.arg);Xe=Vt;var Hr=Xt(te,Ce,we);if(Hr.type==="normal"){if(Xe=we.done?xt:nr,Hr.arg===bt)continue;return{value:Hr.arg,done:we.done}}Hr.type==="throw"&&(Xe=xt,we.method="throw",we.arg=Hr.arg)}}}function V(te,Ce){var we=Ce.method,Xe=te.iterator[we];if(Xe===_)return Ce.delegate=null,we==="throw"&&te.iterator.return&&(Ce.method="return",Ce.arg=_,V(te,Ce),Ce.method==="throw")||we!=="return"&&(Ce.method="throw",Ce.arg=new TypeError("The iterator does not provide a '"+we+"' method")),bt;var Lt=Xt(Xe,te.iterator,Ce.arg);if(Lt.type==="throw")return Ce.method="throw",Ce.arg=Lt.arg,Ce.delegate=null,bt;var Ht=Lt.arg;return Ht?Ht.done?(Ce[te.resultName]=Ht.value,Ce.next=te.nextLoc,Ce.method!=="return"&&(Ce.method="next",Ce.arg=_),Ce.delegate=null,bt):Ht:(Ce.method="throw",Ce.arg=new TypeError("iterator result is not an object"),Ce.delegate=null,bt)}function K(te){var Ce={tryLoc:te[0]};1 in te&&(Ce.catchLoc=te[1]),2 in te&&(Ce.finallyLoc=te[2],Ce.afterLoc=te[3]),this.tryEntries.push(Ce)}function Me(te){var Ce=te.completion||{};Ce.type="normal",delete Ce.arg,te.completion=Ce}function Se(te){this.tryEntries=[{tryLoc:"root"}],te.forEach(K,this),this.reset(!0)}function nt(te){if(te||te===""){var Ce=te[ae];if(Ce)return Ce.call(te);if(typeof te.next=="function")return te;if(!isNaN(te.length)){var we=-1,Xe=function Lt(){for(;++we<te.length;)if(fe.call(te,we))return Lt.value=te[we],Lt.done=!1,Lt;return Lt.value=_,Lt.done=!0,Lt};return Xe.next=Xe}}throw new TypeError(q(te)+" is not iterable")}return hr.prototype=lr,se(qe,"constructor",{value:lr,configurable:!0}),se(lr,"constructor",{value:hr,configurable:!0}),hr.displayName=Ye(lr,dt,"GeneratorFunction"),le.isGeneratorFunction=function(te){var Ce=typeof te=="function"&&te.constructor;return!!Ce&&(Ce===hr||(Ce.displayName||Ce.name)==="GeneratorFunction")},le.mark=function(te){return Object.setPrototypeOf?Object.setPrototypeOf(te,lr):(te.__proto__=lr,Ye(te,dt,"GeneratorFunction")),te.prototype=Object.create(qe),te},le.awrap=function(te){return{__await:te}},Ct(fr.prototype),Ye(fr.prototype,et,function(){return this}),le.AsyncIterator=fr,le.async=function(te,Ce,we,Xe,Lt){Lt===void 0&&(Lt=Promise);var Ht=new fr(wt(te,Ce,we,Xe),Lt);return le.isGeneratorFunction(Ce)?Ht:Ht.next().then(function(on){return on.done?on.value:Ht.next()})},Ct(qe),Ye(qe,dt,"Generator"),Ye(qe,ae,function(){return this}),Ye(qe,"toString",function(){return"[object Generator]"}),le.keys=function(te){var Ce=Object(te),we=[];for(var Xe in Ce)we.push(Xe);return we.reverse(),function Lt(){for(;we.length;){var Ht=we.pop();if(Ht in Ce)return Lt.value=Ht,Lt.done=!1,Lt}return Lt.done=!0,Lt}},le.values=nt,Se.prototype={constructor:Se,reset:function(Ce){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(Me),!Ce)for(var we in this)we.charAt(0)==="t"&&fe.call(this,we)&&!isNaN(+we.slice(1))&&(this[we]=_)},stop:function(){this.done=!0;var Ce=this.tryEntries[0].completion;if(Ce.type==="throw")throw Ce.arg;return this.rval},dispatchException:function(Ce){if(this.done)throw Ce;var we=this;function Xe(Un,bn){return on.type="throw",on.arg=Ce,we.next=Un,bn&&(we.method="next",we.arg=_),!!bn}for(var Lt=this.tryEntries.length-1;Lt>=0;--Lt){var Ht=this.tryEntries[Lt],on=Ht.completion;if(Ht.tryLoc==="root")return Xe("end");if(Ht.tryLoc<=this.prev){var Jr=fe.call(Ht,"catchLoc"),Hr=fe.call(Ht,"finallyLoc");if(Jr&&Hr){if(this.prev<Ht.catchLoc)return Xe(Ht.catchLoc,!0);if(this.prev<Ht.finallyLoc)return Xe(Ht.finallyLoc)}else if(Jr){if(this.prev<Ht.catchLoc)return Xe(Ht.catchLoc,!0)}else{if(!Hr)throw new Error("try statement without catch or finally");if(this.prev<Ht.finallyLoc)return Xe(Ht.finallyLoc)}}}},abrupt:function(Ce,we){for(var Xe=this.tryEntries.length-1;Xe>=0;--Xe){var Lt=this.tryEntries[Xe];if(Lt.tryLoc<=this.prev&&fe.call(Lt,"finallyLoc")&&this.prev<Lt.finallyLoc){var Ht=Lt;break}}Ht&&(Ce==="break"||Ce==="continue")&&Ht.tryLoc<=we&&we<=Ht.finallyLoc&&(Ht=null);var on=Ht?Ht.completion:{};return on.type=Ce,on.arg=we,Ht?(this.method="next",this.next=Ht.finallyLoc,bt):this.complete(on)},complete:function(Ce,we){if(Ce.type==="throw")throw Ce.arg;return Ce.type==="break"||Ce.type==="continue"?this.next=Ce.arg:Ce.type==="return"?(this.rval=this.arg=Ce.arg,this.method="return",this.next="end"):Ce.type==="normal"&&we&&(this.next=we),bt},finish:function(Ce){for(var we=this.tryEntries.length-1;we>=0;--we){var Xe=this.tryEntries[we];if(Xe.finallyLoc===Ce)return this.complete(Xe.completion,Xe.afterLoc),Me(Xe),bt}},catch:function(Ce){for(var we=this.tryEntries.length-1;we>=0;--we){var Xe=this.tryEntries[we];if(Xe.tryLoc===Ce){var Lt=Xe.completion;if(Lt.type==="throw"){var Ht=Lt.arg;Me(Xe)}return Ht}}throw new Error("illegal catch attempt")},delegateYield:function(Ce,we,Xe){return this.delegate={iterator:nt(Ce),resultName:we,nextLoc:Xe},this.method==="next"&&(this.arg=_),bt}},le}rr.exports=he,rr.exports.__esModule=!0,rr.exports.default=rr.exports},85057:function(rr){function ee(L){"@babel/helpers - typeof";return rr.exports=ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},rr.exports.__esModule=!0,rr.exports.default=rr.exports,ee(L)}rr.exports=ee,rr.exports.__esModule=!0,rr.exports.default=rr.exports},29972:function(rr,ee,L){var q=L(58576)();rr.exports=q;try{regeneratorRuntime=q}catch(he){typeof globalThis=="object"?globalThis.regeneratorRuntime=q:Function("r","regeneratorRuntime = r")(q)}}}]);
|
|
}());
|