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.
6646 lines
2.1 MiB
6646 lines
2.1 MiB
var Zy=(sr,ne,U)=>new Promise((te,ye)=>{var y=pe=>{try{Z(U.next(pe))}catch(fe){ye(fe)}},he=pe=>{try{Z(U.throw(pe))}catch(fe){ye(fe)}},Z=pe=>pe.done?te(pe.value):Promise.resolve(pe.value).then(y,he);Z((U=U.apply(sr,ne)).next())});(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[8307],{52698:function(sr,ne,U){"use strict";var te=U(50959),ye=U(75788),y=function(){return y=Object.assign||function(Z){for(var pe,fe=1,it=arguments.length;fe<it;fe++){pe=arguments[fe];for(var ce in pe)Object.prototype.hasOwnProperty.call(pe,ce)&&(Z[ce]=pe[ce])}return Z},y.apply(this,arguments)},he=function(Z){return te.createElement(ye.P,y({},Z,{chartType:"Area"}))};ne.Z=he},3e3:function(sr,ne,U){"use strict";var te=U(50959),ye=U(75788),y=function(){return y=Object.assign||function(Z){for(var pe,fe=1,it=arguments.length;fe<it;fe++){pe=arguments[fe];for(var ce in pe)Object.prototype.hasOwnProperty.call(pe,ce)&&(Z[ce]=pe[ce])}return Z},y.apply(this,arguments)},he=function(Z){return te.createElement(ye.P,y({},Z,{chartType:"Gauge"}))};ne.Z=he},4623:function(sr,ne,U){"use strict";var te=U(50959),ye=U(75788),y=function(){return y=Object.assign||function(Z){for(var pe,fe=1,it=arguments.length;fe<it;fe++){pe=arguments[fe];for(var ce in pe)Object.prototype.hasOwnProperty.call(pe,ce)&&(Z[ce]=pe[ce])}return Z},y.apply(this,arguments)},he=function(Z){return te.createElement(ye.P,y({},Z,{chartType:"Liquid"}))};ne.Z=he},84098:function(sr,ne,U){"use strict";var te=U(50959),ye=U(75788),y=function(){return y=Object.assign||function(Z){for(var pe,fe=1,it=arguments.length;fe<it;fe++){pe=arguments[fe];for(var ce in pe)Object.prototype.hasOwnProperty.call(pe,ce)&&(Z[ce]=pe[ce])}return Z},y.apply(this,arguments)},he=function(Z){return te.createElement(ye.P,y({},Z,{chartType:"WordCloud"}))};ne.Z=he},46268:function(sr,ne,U){"use strict";U.d(ne,{f:function(){return tt}});var te=U(88357),ye=U(38751),y=U(82187),he=U.n(y),Z=U(50959),pe=U(84341),fe=U(35361),it=U(34829),ce=function(Xt){return(0,te.Z)({},Xt.componentCls,{width:"100%","&-wide":{maxWidth:1152,margin:"0 auto"}})};function rt(Ot){return(0,it.Xj)("ProLayoutGridContent",function(Xt){var Yt=(0,fe.Z)((0,fe.Z)({},Xt),{},{componentCls:".".concat(Ot)});return[ce(Yt)]})}var vt=U(11527),tt=function(Xt){var Yt=(0,Z.useContext)(pe.X),ar=Xt.children,Zt=Xt.contentWidth,bt=Xt.className,St=Xt.style,Rr=(0,Z.useContext)(ye.ZP.ConfigContext),gr=Rr.getPrefixCls,fr=Xt.prefixCls||gr("pro"),Mt=Zt||Yt.contentWidth,ft="".concat(fr,"-grid-content"),kt=rt(ft),qe=kt.wrapSSR,Dt=kt.hashId,dr=Mt==="Fixed"&&Yt.layout==="top";return qe((0,vt.jsx)("div",{className:he()(ft,Dt,bt,(0,te.Z)({},"".concat(ft,"-wide"),dr)),style:St,children:(0,vt.jsx)("div",{className:"".concat(fr,"-grid-content-children ").concat(Dt).trim(),children:ar})}))}},35375:function(sr,ne,U){"use strict";U.d(ne,{S:function(){return fe}});var te=U(35361),ye=U(56929),y=U(13089),he=U(50959),Z=U(11527),pe=["isLoading","pastDelay","timedOut","error","retry"],fe=function(ce){var rt=ce.isLoading,vt=ce.pastDelay,tt=ce.timedOut,Ot=ce.error,Xt=ce.retry,Yt=(0,ye.Z)(ce,pe);return(0,Z.jsx)("div",{style:{paddingBlockStart:100,textAlign:"center"},children:(0,Z.jsx)(y.Z,(0,te.Z)({size:"large"},Yt))})}},84341:function(sr,ne,U){"use strict";U.d(ne,{X:function(){return ye}});var te=U(50959),ye=(0,te.createContext)({})},95460: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(sr){try{let ce=function(){Z||(Z=!0,y())},rt=function(){try{he.documentElement.doScroll("left")}catch(vt){return void setTimeout(rt,50)}ce()};var fe=ce,it=rt,U=(U=document.getElementsByTagName("script"))[U.length-1],ne=U.getAttribute("data-injectcss"),U=U.getAttribute("data-disable-injectsvg");if(!U){var te,ye,y,he,Z,pe=function(tt,Ot){Ot.parentNode.insertBefore(tt,Ot)};if(ne&&!sr.__iconfont__svg__cssinject__){sr.__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(vt){console&&console.log(vt)}}te=function(){var tt,Ot=document.createElement("div");Ot.innerHTML=sr._iconfont_svg_string_3580659,(Ot=Ot.getElementsByTagName("svg")[0])&&(Ot.setAttribute("aria-hidden","true"),Ot.style.position="absolute",Ot.style.width=0,Ot.style.height=0,Ot.style.overflow="hidden",Ot=Ot,(tt=document.body).firstChild?pe(Ot,tt.firstChild):tt.appendChild(Ot))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(te,0):(ye=function(){document.removeEventListener("DOMContentLoaded",ye,!1),te()},document.addEventListener("DOMContentLoaded",ye,!1)):document.attachEvent&&(y=te,he=sr.document,Z=!1,rt(),he.onreadystatechange=function(){he.readyState=="complete"&&(he.onreadystatechange=null,ce())})}}catch(ce){}}(window)},72493:function(sr,ne,U){"use strict";U.d(ne,{zP:function(){return aB},JE:function(){return nL},ns:function(){return iB}});var te=U(50959),ye=(0,te.createContext)({});function y(){return(0,te.useContext)(ye)}var he={},Z={},pe=function(r){return Z[r]},fe=function(r,t){Z[r]=t},it=function(r){return he[r]},ce=function(r,t){he[r]=t},rt={},vt={},tt=34,Ot=10,Xt=13;function Yt(e){return new Function("d","return {"+e.map(function(r,t){return JSON.stringify(r)+": d["+t+'] || ""'}).join(",")+"}")}function ar(e,r){var t=Yt(e);return function(n,i){return r(t(n),i,e)}}function Zt(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 bt(e,r){var t=e+"",n=t.length;return n<r?new Array(r-n+1).join(0)+t:t}function St(e){return e<0?"-"+bt(-e,6):e>9999?"+"+bt(e,6):bt(e,4)}function Rr(e){var r=e.getUTCHours(),t=e.getUTCMinutes(),n=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":St(e.getUTCFullYear(),4)+"-"+bt(e.getUTCMonth()+1,2)+"-"+bt(e.getUTCDate(),2)+(i?"T"+bt(r,2)+":"+bt(t,2)+":"+bt(n,2)+"."+bt(i,3)+"Z":n?"T"+bt(r,2)+":"+bt(t,2)+":"+bt(n,2)+"Z":t||r?"T"+bt(r,2)+":"+bt(t,2)+"Z":"")}function gr(e){var r=new RegExp('["'+e+`
|
|
\r]`),t=e.charCodeAt(0);function n(b,T){var M,P,D=i(b,function(G,q){if(M)return M(G,q-1);P=G,M=T?ar(G,T):Yt(G)});return D.columns=P||[],D}function i(b,T){var M=[],P=b.length,D=0,G=0,q,se=P<=0,Se=!1;b.charCodeAt(P-1)===Ot&&--P,b.charCodeAt(P-1)===Xt&&--P;function Ve(){if(se)return vt;if(Se)return Se=!1,rt;var st,at=D,At;if(b.charCodeAt(at)===tt){for(;D++<P&&b.charCodeAt(D)!==tt||b.charCodeAt(++D)===tt;);return(st=D)>=P?se=!0:(At=b.charCodeAt(D++))===Ot?Se=!0:At===Xt&&(Se=!0,b.charCodeAt(D)===Ot&&++D),b.slice(at+1,st-1).replace(/""/g,'"')}for(;D<P;){if((At=b.charCodeAt(st=D++))===Ot)Se=!0;else if(At===Xt)Se=!0,b.charCodeAt(D)===Ot&&++D;else if(At!==t)continue;return b.slice(at,st)}return se=!0,b.slice(at,P)}for(;(q=Ve())!==vt;){for(var nt=[];q!==rt&&q!==vt;)nt.push(q),q=Ve();T&&(nt=T(nt,G++))==null||M.push(nt)}return M}function a(b,T){return b.map(function(M){return T.map(function(P){return _(M[P])}).join(e)})}function s(b,T){return T==null&&(T=Zt(b)),[T.map(_).join(e)].concat(a(b,T)).join(`
|
|
`)}function l(b,T){return T==null&&(T=Zt(b)),a(b,T).join(`
|
|
`)}function f(b){return b.map(d).join(`
|
|
`)}function d(b){return b.map(_).join(e)}function _(b){return b==null?"":b instanceof Date?Rr(b):r.test(b+="")?'"'+b.replace(/"/g,'""')+'"':b}return{parse:n,parseRows:i,format:s,formatBody:l,formatRows:f,formatRow:d,formatValue:_}}var fr=gr(","),Mt=fr.parse,ft=fr.parseRows,kt=fr.format,qe=fr.formatBody,Dt=fr.formatRows,dr=fr.formatRow,oe=fr.formatValue,H=U(35361),re=63710088e-1,Be={centimeters:re*100,centimetres:re*100,degrees:re/111325,feet:re*3.28084,inches:re*39.37,kilometers:re/1e3,kilometres:re/1e3,meters:re,metres:re,miles:re/1609.344,millimeters:re*1e3,millimetres:re*1e3,nauticalmiles:re/1852,radians:1,yards:re*1.0936},we={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/re,yards:1.0936133},ut={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 ie(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 Le(e,r,t){switch(t===void 0&&(t={}),e){case"Point":return Pe(r).geometry;case"LineString":return Jr(r).geometry;case"Polygon":return Vt(r).geometry;case"MultiPoint":return bn(r).geometry;case"MultiLineString":return Dn(r).geometry;case"MultiPolygon":return rn(r).geometry;default:throw new Error(e+" is invalid")}}function Pe(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(!Ea(e[0])||!Ea(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return ie(n,r,t)}function Ge(e,r,t){return t===void 0&&(t={}),Mr(e.map(function(n){return Pe(n,r)}),t)}function Vt(e,r,t){t===void 0&&(t={});for(var n=0,i=e;n<i.length;n++){var a=i[n];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:e};return ie(l,r,t)}function Et(e,r,t){return t===void 0&&(t={}),Mr(e.map(function(n){return Vt(n,r)}),t)}function Jr(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 ie(n,r,t)}function on(e,r,t){return t===void 0&&(t={}),Mr(e.map(function(n){return Jr(n,r)}),t)}function Mr(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 Dn(e,r,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:e};return ie(n,r,t)}function bn(e,r,t){t===void 0&&(t={});var n={type:"MultiPoint",coordinates:e};return ie(n,r,t)}function rn(e,r,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:e};return ie(n,r,t)}function yi(e,r,t){t===void 0&&(t={});var n={type:"GeometryCollection",geometries:e};return ie(n,r,t)}function ti(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 Zi(e,r){r===void 0&&(r="kilometers");var t=Be[r];if(!t)throw new Error(r+" units is invalid");return e*t}function En(e,r){r===void 0&&(r="kilometers");var t=Be[r];if(!t)throw new Error(r+" units is invalid");return e/t}function Rn(e,r){return ki(En(e,r))}function sa(e){var r=e%360;return r<0&&(r+=360),r}function ki(e){var r=e%(2*Math.PI);return r*180/Math.PI}function ba(e){var r=e%360;return r*Math.PI/180}function fo(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 Zi(En(e,r),t)}function Re(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=ut[r];if(!n)throw new Error("invalid original units");var i=ut[t];if(!i)throw new Error("invalid final units");return e/n*i}function Ea(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function va(e){return!!e&&e.constructor===Object}function Za(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(!Ea(r))throw new Error("bbox must only contain numbers")})}function Ms(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 ho(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 Zo(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 jt(e){if(e.length>1&&isNumber(e[0])&&isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return jt(e[0]);throw new Error("coordinates must only contain numbers")}function pr(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 Vr(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 en(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 a=i[n];if(!a||a.type!=="Feature"||!a.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!a.geometry||a.geometry.type!==r)throw new Error("Invalid input to "+t+": must be a "+r+", given "+a.geometry.type)}}function Ln(e){return e.type==="Feature"?e.geometry:e}function Gi(e,r){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}function ue(e,r,t){if(e!==null)for(var n,i,a,s,l,f,d,_=0,b=0,T,M=e.type,P=M==="FeatureCollection",D=M==="Feature",G=P?e.features.length:1,q=0;q<G;q++){d=P?e.features[q].geometry:D?e.geometry:e,T=d?d.type==="GeometryCollection":!1,l=T?d.geometries.length:1;for(var se=0;se<l;se++){var Se=0,Ve=0;if(s=T?d.geometries[se]:d,s!==null){f=s.coordinates;var nt=s.type;switch(_=t&&(nt==="Polygon"||nt==="MultiPolygon")?1:0,nt){case null:break;case"Point":if(r(f,b,q,Se,Ve)===!1)return!1;b++,Se++;break;case"LineString":case"MultiPoint":for(n=0;n<f.length;n++){if(r(f[n],b,q,Se,Ve)===!1)return!1;b++,nt==="MultiPoint"&&Se++}nt==="LineString"&&Se++;break;case"Polygon":case"MultiLineString":for(n=0;n<f.length;n++){for(i=0;i<f[n].length-_;i++){if(r(f[n][i],b,q,Se,Ve)===!1)return!1;b++}nt==="MultiLineString"&&Se++,nt==="Polygon"&&Ve++}nt==="Polygon"&&Se++;break;case"MultiPolygon":for(n=0;n<f.length;n++){for(Ve=0,i=0;i<f[n].length;i++){for(a=0;a<f[n][i].length-_;a++){if(r(f[n][i][a],b,q,Se,Ve)===!1)return!1;b++}Ve++}Se++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(ue(s.geometries[n],r,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function k(e,r,t,n){var i=t;return ue(e,function(a,s,l,f,d){s===0&&t===void 0?i=a:i=r(i,a,s,l,f,d)},n),i}function z(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 ae(e,r,t){var n=t;return z(e,function(i,a){a===0&&t===void 0?n=i:n=r(n,i,a)}),n}function Ee(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 De(e,r,t){var n=t;return Ee(e,function(i,a){a===0&&t===void 0?n=i:n=r(n,i,a)}),n}function zt(e){var r=[];return ue(e,function(t){r.push(t)}),r}function Tt(e,r){var t,n,i,a,s,l,f,d,_,b,T=0,M=e.type==="FeatureCollection",P=e.type==="Feature",D=M?e.features.length:1;for(t=0;t<D;t++){for(l=M?e.features[t].geometry:P?e.geometry:e,d=M?e.features[t].properties:P?e.properties:{},_=M?e.features[t].bbox:P?e.bbox:void 0,b=M?e.features[t].id:P?e.id:void 0,f=l?l.type==="GeometryCollection":!1,s=f?l.geometries.length:1,i=0;i<s;i++){if(a=f?l.geometries[i]:l,a===null){if(r(null,T,d,_,b)===!1)return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(r(a,T,d,_,b)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<a.geometries.length;n++)if(r(a.geometries[n],T,d,_,b)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}T++}}function Rt(e,r,t){var n=t;return Tt(e,function(i,a,s,l,f){a===0&&t===void 0?n=i:n=r(n,i,a,s,l,f)}),n}function dt(e,r){Tt(e,function(t,n,i,a,s){var l=t===null?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return r(ie(t,i,{bbox:a,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 d=0;d<t.coordinates.length;d++){var _=t.coordinates[d],b={type:f,coordinates:_};if(r(ie(b,i),n,d)===!1)return!1}})}function N(e,r,t){var n=t;return dt(e,function(i,a,s){a===0&&s===0&&t===void 0?n=i:n=r(n,i,a,s)}),n}function B(e,r){dt(e,function(t,n,i){var a=0;if(t.geometry){var s=t.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var l,f=0,d=0,_=0;if(ue(t,function(b,T,M,P,D){if(l===void 0||n>f||P>d||D>_){l=b,f=n,d=P,_=D,a=0;return}var G=lineString([l,b],t.properties);if(r(G,n,i,D,a)===!1)return!1;a++,l=b})===!1)return!1}}})}function $(e,r,t){var n=t,i=!1;return B(e,function(a,s,l,f,d){i===!1&&t===void 0?n=a:n=r(n,a,s,l,f,d),i=!0}),n}function ee(e,r){if(!e)throw new Error("geojson is required");dt(e,function(t,n,i){if(t.geometry!==null){var a=t.geometry.type,s=t.geometry.coordinates;switch(a){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 xe(e,r,t){var n=t;return ee(e,function(i,a,s,l){a===0&&t===void 0?n=i:n=r(n,i,a,s,l)}),n}function Ue(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,a=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 a<0&&(a=f.length+a-1),lineString([f[a],f[a+1]],s,r);case"Polygon":return i<0&&(i=f.length+i),a<0&&(a=f[i].length+a-1),lineString([f[i][a],f[i][a+1]],s,r);case"MultiLineString":return n<0&&(n=f.length+n),a<0&&(a=f[n].length+a-1),lineString([f[n][a],f[n][a+1]],s,r);case"MultiPolygon":return n<0&&(n=f.length+n),i<0&&(i=f[n].length+i),a<0&&(a=f[n][i].length-a-1),lineString([f[n][i][a],f[n][i][a+1]],s,r)}throw new Error("geojson is invalid")}function Qe(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,a=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 a<0&&(a=f.length+a),point(f[a],s,r);case"Polygon":return i<0&&(i=f.length+i),a<0&&(a=f[i].length+a),point(f[i][a],s,r);case"MultiLineString":return n<0&&(n=f.length+n),a<0&&(a=f[n].length+a),point(f[n][a],s,r);case"MultiPolygon":return n<0&&(n=f.length+n),i<0&&(i=f[n].length+i),a<0&&(a=f[n][i].length-a),point(f[n][i][a],s,r)}throw new Error("geojson is invalid")}var j=U(97086),Q=U(5952),Fe=U(90242),et=U(70657),Ae=U(82028),$t=U(92569);function yr(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch(r){return typeof e=="function"}}var nn=U(41081);function Qr(e,r,t){return(0,nn.Z)()?Qr=Reflect.construct.bind():Qr=function(i,a,s){var l=[null];l.push.apply(l,a);var f=Function.bind.apply(i,l),d=new f;return s&&(0,$t.Z)(d,s.prototype),d},Qr.apply(null,arguments)}function tr(e){var r=typeof Map=="function"?new Map:void 0;return tr=function(n){if(n===null||!yr(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 Qr(n,arguments,(0,Ae.Z)(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),(0,$t.Z)(i,n)},tr(e)}var Xr={REGISTERED_PROTOCOLS:{}};function zr(e){var r=jr();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function jr(){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 Jn=function(r){return Xr.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]},ln=function(e){(0,Fe.Z)(t,e);var r=zr(t);function t(n,i,a,s){var l;return(0,Q.Z)(this,t),l=r.call(this,"AJAXError: ".concat(i," (").concat(n,"): ").concat(a)),l.status=n,l.statusText=i,l.url=a,l.body=s,l}return(0,j.Z)(t)}(tr(Error));function hi(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 a=t.response;if(e.type==="json")try{a=JSON.parse(t.response)}catch(l){return r(l)}r(null,a,t.getResponseHeader("Cache-Control"),t.getResponseHeader("Expires"),t)}else{var s=new Blob([t.response],{type:t.getResponseHeader("Content-Type")});r(new ln(t.status,t.statusText,n.toString(),s))}},t.cancel=t.abort,t.send(e.body),t}function Vi(e){return new Promise(function(r,t){hi(e,function(n,i,a,s,l){n?t({err:n,data:null,xhr:l}):r({err:null,data:i,cacheControl:a,expires:s,xhr:l})})})}function ci(e,r){return hi(e,r)}var Li=function(r,t){var n=Jn(r.url)||ci;return n((0,H.Z)((0,H.Z)({},r),{},{type:"json"}),t)},Ei=function(r,t){var n=Jn(r.url)||ci;return n((0,H.Z)((0,H.Z)({},r),{},{type:"arrayBuffer"}),t)},ns=function(r,t){return ci(_objectSpread(_objectSpread({},r),{},{method:"POST"}),t)},Qi=function(r,t){return ci((0,H.Z)((0,H.Z)({},r),{},{method:"GET"}),t)};function Pa(e){var r=window.document.createElement("a");return r.href=e,r.protocol===window.document.location.protocol&&r.host===window.document.location.host}var Si="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function di(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=Si})},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):Si}function Ai(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 Oa=function(r,t,n){var i=function(s,l){if(s)t(s);else if(l){var f=typeof createImageBitmap=="function",d=n?n(l):l;f?Ai(d,t):di(d,t)}};return r.type==="json"?Li(r,i):Ei(r,i)},vu=function(r,t){var n=typeof createImageBitmap=="function";n?Ai(r,t):di(r,t)},fa=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}({}),Ra={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 Gl(e,r,t){var n=e.classList;for(var i in Ra)Ra.hasOwnProperty(i)&&n.remove("l7-".concat(t,"-anchor-").concat(i));n.add("l7-".concat(t,"-anchor-").concat(r))}var vs=U(52617);function Ma(e){return typeof e=="string"?!!d3.color(e):!1}function vi(e){var r=vs.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 ka(e){var r=e&&e[0],t=e&&e[1],n=e&&e[2],i=r+t*256+n*65536-1;return i}function na(e){return[e+1&255,e+1>>8&255,e+1>>8>>8&255]}function Vo(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),a=e.positions[0],s=e.positions[e.positions.length-1],l=0;l<e.colors.length;++l){var f=(e.positions[l]-a)/(s-a);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 ca(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),a=r[1]-r[0],s=0;s<e.colors.length;++s){var l=Math.max((e.positions[s]-r[0])/a,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,d=ms(n,f);return t=null,n=null,d}function is(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,a){var s=vi(e.colors[a]);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 qo(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 a=t.getImageData(0,0,256,1).data,s=ms(t,a);return r=null,t=null,s}function Du(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 a=0;a<e.colors.length;a++)n.beginPath(),n.lineWidth=2,n.strokeStyle=e.colors[a],n.moveTo((e.positions[a]-r[0])/i*255,0),n.lineTo((e.positions[a+1]-r[0])/i*255,0),n.stroke();var s=n.getImageData(0,0,256,1).data,l=ms(n,s);return t=null,n=null,l}function ms(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 yc(e){switch(e.type){case"cat":return[0,255];default:return[0,1]}}var Sa={BACK:1029,FRONT:1028};function Ji(e){switch(e){case"GAODE1.x":return Sa.BACK;case"GAODE2.x":return Sa.BACK;case"MAPBOX":return Sa.FRONT;case"SIMPLE":return Sa.FRONT;case"GLOBEL":return Sa.BACK;case"DEBAULT":return Sa.FRONT;default:return Sa.FRONT}}var Qt=U(30360),_n=U(959),ge=U(35636),ke=U.n(ge),gt=U(32222),lr=U.n(gt),Kr=U(66292),kn=U.n(Kr),ji=U(65439),go=U.n(ji),Co=U(98071),po=U.n(Co),Ls=U(31223),Is=U.n(Ls),ep=U(46207),Af=U.n(ep),Ko=U(59933),El=U.n(Ko),Sl=U(69143),Lu=U.n(Sl),Bu=U(56549),Ju=U.n(Bu),$c=U(73806),Bs=U.n($c),qa=U(67929),Al=U.n(qa),el=U(53954),Tf=U.n(el),tp=U(25066),wf=U.n(tp),hh=U(38209),ph=U.n(hh),dh=U(4363),rp=U.n(dh),np=U(42950),zp=U.n(np),Yc=U(92042),Fu=U.n(Yc),ip=U(36838),Qo=U.n(ip),Xl=U(89300),Tl=U.n(Xl),Ks=U(47638),wl=U.n(Ks),ui={isNil:Af(),merge:Al(),throttle:ph(),isString:Ju(),debounce:kn(),pull:wf(),isTypedArray:Bs(),isPlainObject:Lu(),isNumber:El(),isBoolean:po(),isEqual:Is(),cloneDeep:lr(),uniq:rp(),clamp:ke(),upperFirst:zp(),get:go(),mergeWith:Tf(),isFunction:Fu(),isObject:Qo(),isUndefined:Tl(),camelCase:wl()},tl=ui.pull;function Fs(e){var r=e;return typeof e=="string"&&(r=window.document.getElementById(e)),r}function Nu(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function rl(e){return Nu(e).split(/\s+/)}function ap(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 Yi(e,r,t){var n=window.document.createElement(e);return r&&(n.className=r||""),t&&t.appendChild(n),n}function Ci(e){var r=e.parentNode;r&&r.removeChild(e)}function ou(e,r){if(e.classList!==void 0)for(var t=rl(r),n=0,i=t.length;n<i;n++)e.classList.add(t[n]);else if(!Cf(e,r)){var a=Rf(e);Va(e,(a?a+" ":"")+r)}}function mu(e,r){if(e.classList!==void 0){var t=rl(r);t.forEach(function(n){e.classList.remove(n)})}else Va(e,Nu((" "+Rf(e)+" ").replace(" "+r+" "," ")))}function Cf(e,r){if(e.classList!==void 0)return e.classList.contains(r);var t=Rf(e);return t.length>0&&new RegExp("(^|\\s)"+r+"(\\s|$)").test(t)}function Va(e,r){e instanceof HTMLElement?e.className=r:e.className.baseVal=r}function vh(e,r,t){t===void 0?Cf(e,r)?mu(e,r):ou(e,r):t?ou(e,r):mu(e,r)}function Rf(e){return e instanceof SVGElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}function Ns(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}var nl=ap(["transform","WebkitTransform"]);function gu(e,r){e.style[nl]=r}function Cl(){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 mh(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 _c(){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 a=i.split("="),s=(0,_n.Z)(a,1),l=s[0];return l==="initial-scale"});return n?n.split("=")[1]*1:1}var ua=_c()<1?1:window.devicePixelRatio;function xc(e,r){e.setAttribute("style","".concat(e.style.cssText).concat(r))}function il(e){return e.split(";").map(function(r){return r.trim()}).filter(function(r){return r})}function Rl(e,r){var t,n=il((t=e.getAttribute("style"))!==null&&t!==void 0?t:""),i=il(r),a=tl.apply(void 0,[n].concat((0,Qt.Z)(i)));e.setAttribute("style",a.join(";"))}function gh(e){return Object.entries(e).map(function(r){var t=(0,_n.Z)(r,2),n=t[0],i=t[1];return"".concat(n,": ").concat(i)}).join(";")}function qc(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 ha(e,r){e.checked=r,r?e.setAttribute("checked","true"):e.removeAttribute("checked")}function Ml(e){e.innerHTML=""}function op(e){e.setAttribute("draggable","false")}function al(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,Qt.Z)(r)):e.append(r)}function Kc(e,r){for(var t=Array.isArray(r)?r:[r],n=e;n instanceof Element&&n!==window.document.body;){var i,a;if(t.find(function(s){var l;return(l=n)===null||l===void 0?void 0:l.matches(s)}))return n;n=(i=(a=n)===null||a===void 0?void 0:a.parentElement)!==null&&i!==void 0?i:null}}var Qc;function Mf(e){return typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap}function ol(){return typeof importScripts=="function"}var $l=ol()?function(){return self.worker&&self.worker.referrer}:function(){return(window.location.protocol==="blob:"?window.parent:window).location.href},Uu=(Qc=navigator)===null||Qc===void 0?void 0:Qc.userAgent,Jc=!!Uu.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),bc=Uu.indexOf("Android")>-1||Uu.indexOf("Adr")>-1;function Yl(){for(var e=Uu,r=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],t=!0,n=0,i=r;n<i.length;n++){var a=i[n];if(e.indexOf(a)>0){t=!1;break}}return t}function yh(e,r){e.forEach(function(t){r[t]&&(r[t]=r[t].bind(r))})}var Ec=null;function Us(e){var r=[1/0,1/0,-1/0,-1/0];return ue(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}Us.default=Us;var _h=Us;function ef(e){return typeof e=="number"}var Sc=2*Math.PI*6378137/2;function Il(e,r){var t=(0,_n.Z)(r,4),n=t[0],i=t[1],a=t[2],s=t[3];return e.lng>n&&e.lng<=a&&e.lat>i&&e.lat<=s}function zu(e){var r=[1/0,1/0,-1/0,-1/0];return e.forEach(function(t){var n=t.coordinates;ql(r,n)}),r}function ql(e,r){return Array.isArray(r[0])?r.forEach(function(t){ql(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 If(e,r){return sl(e,r)}function sl(e,r){return Array.isArray(e[0])?e.map(function(t){return sl(t,r)}):r(e)}function xh(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=sp(e,r);var n=e[0],i=e[1],a=n*Sc/180,s=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);return s=s*Sc/180,t.enable&&(a=Number(a.toFixed(t.decimal)),s=Number(s.toFixed(t.decimal))),e.length===3?[a,s,e[2]]:[a,s]}function bh(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,t=e[0],n=e[1],i=t/Sc*180,a=n/Sc*180;return a=180/Math.PI*(2*Math.atan(Math.exp(a*Math.PI/180))-Math.PI/2),r!=null&&(i=Number(i.toFixed(r)),a=Number(a.toFixed(r))),e.length===3?[i,a,e[2]]:[i,a]}function Eh(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 Pf(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 sp(e,r){if(r===!1)return e;var t=Eh(e[0]),n=Pf(e[1]);return n>85&&(n=85),n<-85&&(n=-85),e.length===3?[t,n,e[2]]:[t,n]}function ja(e){var r=85.0511287798,t=Math.max(Math.min(r,e[1]),-r),n=256<<20,i=Math.PI/180,a=e[0]*i,s=t*i;s=Math.log(Math.tan(Math.PI/4+s/2));var l=.5/Math.PI,f=.5,d=-.5/Math.PI;return i=.5,a=n*(l*a+f),s=n*(d*s+i),[Math.floor(a),Math.floor(s)]}function up(e){var r=.5/Math.PI,t=.5,n=-.5/Math.PI,i=.5,a=256<<20,s=_slicedToArray(e,2),l=s[0],f=s[1];l=(l/a-t)/r,f=(f/a-i)/n,f=(Math.atan(Math.pow(Math.E,f))-Math.PI/4)*2,i=Math.PI/180;var d=f/i,_=l/i;return[_,d]}function Of(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 lp(e,r){var t=Math.PI/180,n=6378137,i=e/n/t,a=2*(Math.atan(Math.exp(r/n))-Math.PI/4)/t;return[i,a]}function Kl(e,r,t){var n=ba(r[1]-e[1]),i=ba(r[0]-e[0]),a=ba(e[1]),s=ba(r[1]),l=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(i/2),2)*Math.cos(a)*Math.cos(s);return Zi(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),t="meters")}function cp(e){var r=Math.PI/180,t=85.0511287798,n=6378137,i=Math.max(Math.min(t,e[1]),-t),a=Math.sin(i*r),s=n*e[0]*r,l=n*Math.log((1+a)/(1-a))/2;return[s,l]}function Zu(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 ma(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 Ql(e){return[[e[0],e[1]],[e[2],e[3]]]}function Vu(e){var r=ul(e,[0,0]);return[e[0]/r,e[1]/r]}function ul(e,r){return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function Bi(e,r){return e[0]*r[0]+e[1]*r[1]}function ga(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function su(e,r){return Math.acos(Bi(e,r)/(ga(e)*ga(r)))*180/Math.PI}function tf(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 rf(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=[],a=0;a<e.length-1;a++){var s=e[a],l=e[a+1],f=ul(s,l);n+=f;var d=[s[0]-l[0],s[1]-l[1]],_=tf(t,d);if(a>0){var b=i[a-1].rotation;b-_>360-b+_&&(_=_+360)}i.push({start:s,end:l,dis:f,rotation:_,duration:0})}return i.map(function(T){T.duration=r*(T.dis/n)}),i}}function Qs(e){if(ef(e[0]))return e;if(ef(e[0][0]))throw new Error("\u5F53\u524D\u6570\u636E\u4E0D\u652F\u6301\u6807\u6CE8");if(ef(e[0][0][0])){var r=e,t=0,n=0,i=0;return r.forEach(function(a){a.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 fp(e){for(var r=e[0],t=e[1],n=e[0],i=e[1],a=0,s=0,l=0,f=0;f<e.length;f+=2){var d=e[f],_=e[f+1];d&&_&&(r=Math.max(d,r),t=Math.max(_,t),n=Math.min(d,n),i=Math.min(_,i),a+=d,s+=_,l++)}return{center:[a/l,s/l],radius:Math.sqrt(Math.pow(r-n,2)+Math.pow(t-i,2))/2}}function kf(e){return _h(Mr([Jr(e)]))}function Df(e){var r=131,t=137,n=0;e+="x";for(var i=Math.floor(9007199254740991/t),a=0;a<e.length;a++)n>i&&(n=Math.floor(n/t)),n=n*r+e.charCodeAt(a);return n}function Jl(e){e=e.toString();for(var r=5381,t=e.length;t;)r=r*33^e.charCodeAt(--t);return r>>>0}function Ro(){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 Ha=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 nf(e,r,t,n,i){var a=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*(a-1))/(a-1)),n?gs(e,r,l,n,i):gs(e,r,l,.314,i)}function Ac(e,r){var t=1-r;return(e[0]*t+e[1]*r)*t+(e[1]*t+e[2]*r)*r}function io(e,r){return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function xn(e,r,t){var n=[r[0]-e[0],r[1]-e[1]],i=io(n,[0,0]),a=Math.atan2(n[1],n[0]),s=i/2/Math.cos(t),l=a+t,f=[s*Math.cos(l)+e[0],s*Math.sin(l)+e[1]];return f}function gs(e,r,t,n,i){if(i===MapType["GAODE2.x"]){var a=amap2Project(e[0],e[1]),s=amap2Project(r[0],r[1]),l=xn(a,s,n),f=[a[0],l[0],s[0]],d=[a[1],l[1],s[1]];return[].concat(_toConsumableArray(amap2UnProject(Ac(f,t),Ac(d,t))),[0])}else{var _=xn(e,r,n),b=[e[0],_[0],r[0]],T=[e[1],_[1],r[1]];return[Ac(b,t),Ac(T,t),0]}}function Lf(e,r,t,n,i){var a=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),Bf(e,r,l,i)}function Tc(e,r){var t=[r[0]-e[0],r[1]-e[1]],n=calDistance(t,[0,0]),i=Math.atan2(t[1],t[0]),a=.314,s=n/2/Math.cos(a),l=i+a,f=[s*Math.cos(l)+e[0],s*Math.sin(l)+e[1]];return f}function as(e,r){var t=1-r;return(e[0]*t+e[1]*r)*t+(e[1]*t+e[2]*r)*r}function pa(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 Bf(e,r,t,n){var i=[degreesToRadians(e[0]),degreesToRadians(e[1])],a=[degreesToRadians(r[0]),degreesToRadians(r[1])];if(n==="GAODE2.x"){var s=Tc(i,a),l=[i[0],s[0],a[0]],f=[i[1],s[1],a[1]];return[as(l,t),as(f,t),0]}else{var d=pa(i,a);if(Math.abs(d-Math.PI)<.001)return[(1-t)*i[0]+t*a[0],(1-t)*i[1]+t*a[1]];var _=Math.sin((1-t)*d)/Math.sin(d),b=Math.sin(t*d)/Math.sin(d),T=[Math.sin(i[0]),Math.sin(i[1])],M=[Math.cos(i[0]),Math.cos(i[1])],P=[Math.sin(a[0]),Math.sin(a[1])],D=[Math.cos(a[0]),Math.cos(a[1])],G=_*M[1]*M[0]+b*D[1]*D[0],q=_*M[1]*T[0]+b*D[1]*P[0],se=_*T[1]+b*P[1];return[radiansToDegrees(Math.atan2(q,G)),radiansToDegrees(Math.atan2(se,Math.sqrt(G*G+q*q)))]}}function sn(e,r){for(var t=0,n=[],i=0;i<e.length-1;i++){var a=e[i],s=e[i+1],l=af(a,s),f=t;t+=l,n.push({p1:a,p2:s,totalDistance:t,distance:l,lastTotalDistance:f})}for(var d=t*r,_,b,T=0,M=n;T<M.length;T++){var P=M[T],D=P.totalDistance;if(D>d){var G=P.p1,q=P.p2,se=(d-P.lastTotalDistance)/P.distance,Se=ll(q,G,se);_=Se[0],b=Se[1];break}}return{lng:_,lat:b,height:0}}function ll(e,r,t){return[e[0]*t+r[0]*(1-t),e[1]*t+r[1]*(1-t)]}function af(e,r){return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function of(e,r){var t=r.featureId,n=e.data.dataArray;return typeof t=="number"&&(n=n.filter(function(i){var a=i.id;return a===t})),n.map(function(i){var a=zs(i,r);return _objectSpread(_objectSpread({},i),a)})}function yu(e,r){return new Promise(function(t){e.inited?t(of(e,r)):e.once("update",function(){t(of(e,r))})})}function zs(e,r){var t=r.offset,n=r.shape,i=r.thetaOffset,a=r.mapVersion,s=r.segmentNumber,l=s===void 0?30:s,f=r.autoFit,d=f===void 0?!0:f,_=e.coordinates;if(n==="line")return pathLineAtOffset(_,t);var b=_[0],T=_[1],M=typeof i=="string"?e[i]||0:i,P;switch(n){case"arc":P=arcLineAtOffset;break;case"greatcircle":P=greatCircleLineAtOffset;break;default:P=arcLineAtOffset}var D=P(b,T,t,M,a,l,d),G=_slicedToArray(D,3),q=G[0],se=G[1],Se=G[2];return{lng:q,lat:se,height:Se}}var Ff=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 ys(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 _u(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 hp(e){if(e.length===0)throw new Error("mean requires at least one data point");return _u(e)/e.length}function wc(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,a=1;a<e.length+1;a++)e[a]!==r?(i>n&&(n=i,t=r),i=1,r=e[a]):i++;return t*1}var Cc={min:ys,max:Nf,mean:hp,sum:_u,mode:wc};function Uf(e,r){return e.map(function(t){return t[r]})}function Js(e,r){return Cc[e](r)}var Ft=U(73356),Me=U(1378),F=U(88357),eu=U(22887),_e=U.n(eu);function Pl(e,r){r===void 0&&(r={});var t=Number(e[0]),n=Number(e[1]),i=Number(e[2]),a=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,a],f=[i,a],d=[i,n];return Vt([[s,d,f,l,s]],r.properties,{bbox:e,id:r.id})}var Ka=U(11312),Zs=U.n(Ka),Mo=function(e){return e.Realtime="realtime",e.Overlap="overlap",e.Replace="replace",e}({}),_s=function(e){return e.Loading="Loading",e.Loaded="Loaded",e.Failure="Failure",e.Cancelled="Cancelled",e}({}),Bn=0,An=1,os=2;function ss(e){e.forEach(function(r){r.isCurrent&&(r.isVisible=r.isLoaded)})}function xu(e){e.forEach(function(r){r.properties.state=Bn}),e.forEach(function(r){r.isCurrent&&!tu(r)&&bu(r)}),e.forEach(function(r){r.isVisible=!!(r.properties.state&os)})}function Ba(e){e.forEach(function(t){t.properties.state=Bn}),e.forEach(function(t){t.isCurrent&&tu(t)});var r=e.slice().sort(function(t,n){return t.z-n.z});r.forEach(function(t){t.isVisible=!!(t.properties.state&os),t.children.length&&(t.isVisible||t.properties.state&An)?t.children.forEach(function(n){n.properties.state=An}):t.isCurrent&&bu(t)})}function tu(e){for(;e;){if(e.isLoaded)return e.properties.state|=os,!0;e=e.parent}return!1}function bu(e){e.children.forEach(function(r){r.isLoaded?r.properties.state|=os:bu(r)})}var Eu,oa=256,yo=[-1/0,-1/0,1/0,1/0],Sh=.2,Ol=5,zf=(Eu={},(0,F.Z)(Eu,Mo.Realtime,ss),(0,F.Z)(Eu,Mo.Overlap,xu),(0,F.Z)(Eu,Mo.Replace,Ba),Eu),cl=function(){};function xs(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 ec(e,r,t){var n=e/Math.pow(2,t)*360-180,i=Math.PI-2*Math.PI*r/Math.pow(2,t),a=180/Math.PI*Math.atan(.5*(Math.exp(i)-Math.exp(-i)));return[n,a]}var Su=function(r,t,n){var i=ec(r,t,n),a=(0,_n.Z)(i,2),s=a[0],l=a[1],f=ec(r+1,t+1,n),d=(0,_n.Z)(f,2),_=d[0],b=d[1];return[s,b,_,l]};function Zf(e){var r=e.zoom,t=e.latLonBounds,n=e.maxZoom,i=n===void 0?1/0:n,a=e.minZoom,s=a===void 0?0:a,l=e.zoomOffset,f=l===void 0?0:l,d=e.extent,_=d===void 0?yo:d,b=Math.ceil(r)+f;if(Number.isFinite(s)&&b<s)return[];Number.isFinite(i)&&b>i&&(b=i);for(var T=(0,_n.Z)(t,4),M=T[0],P=T[1],D=T[2],G=T[3],q=[Math.max(M,_[0]),Math.max(P,_[1]),Math.min(D,_[2]),Math.min(G,_[3])],se=[],Se=xs(q[0],q[1],b),Ve=(0,_n.Z)(Se,2),nt=Ve[0],st=Ve[1],at=xs(q[2],q[3],b),At=(0,_n.Z)(at,2),Wt=At[0],Sr=At[1],_r=nt;_r<=Wt;_r++)for(var Gr=Sr;Gr<=st;Gr++)se.push({x:_r,y:Gr,z:b});var Cn=(Wt+nt)/2,wi=(st+Sr)/2,la=function(Yo,Uo){return Math.abs(Yo-Cn)+Math.abs(Uo-wi)};return se.sort(function(co,Yo){return la(co.x,co.y)-la(Yo.x,Yo.y)}),se}var Rc=function(r,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=Math.pow(2,n),s=a-1,l=a,f=r,d=t;return i&&(f<0?f=f+l:f>s&&(f=f%l)),{warpX:f,warpY:d}};function sf(e){var r=Vf();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function Vf(){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=function(e){(0,Fe.Z)(t,e);var r=sf(t);function t(n){var i;(0,Q.Z)(this,t),i=r.call(this),(0,F.Z)((0,Me.Z)(i),"tileSize",256),(0,F.Z)((0,Me.Z)(i),"isVisible",!1),(0,F.Z)((0,Me.Z)(i),"isCurrent",!1),(0,F.Z)((0,Me.Z)(i),"isVisibleChange",!1),(0,F.Z)((0,Me.Z)(i),"loadedLayers",0),(0,F.Z)((0,Me.Z)(i),"isLayerLoaded",!1),(0,F.Z)((0,Me.Z)(i),"isLoad",!1),(0,F.Z)((0,Me.Z)(i),"isChildLoad",!1),(0,F.Z)((0,Me.Z)(i),"parent",null),(0,F.Z)((0,Me.Z)(i),"children",[]),(0,F.Z)((0,Me.Z)(i),"data",null),(0,F.Z)((0,Me.Z)(i),"properties",{}),(0,F.Z)((0,Me.Z)(i),"loadDataId",0);var a=n.x,s=n.y,l=n.z,f=n.tileSize,d=n.warp,_=d===void 0?!0:d;return i.x=a,i.y=s,i.z=l,i.warp=_||!0,i.tileSize=f,i}return(0,j.Z)(t,[{key:"isLoading",get:function(){return this.loadStatus===_s.Loading}},{key:"isLoaded",get:function(){return this.loadStatus===_s.Loaded}},{key:"isFailure",get:function(){return this.loadStatus===_s.Failure}},{key:"setTileLayerLoaded",value:function(){this.isLayerLoaded=!0}},{key:"isCancelled",get:function(){return this.loadStatus===_s.Cancelled}},{key:"isDone",get:function(){return[_s.Loaded,_s.Cancelled,_s.Failure].includes(this.loadStatus)}},{key:"bounds",get:function(){return Su(this.x,this.y,this.z)}},{key:"bboxPolygon",get:function(){var i=(0,_n.Z)(this.bounds,4),a=i[0],s=i[1],l=i[2],f=i[3],d=[(l-a)/2,(f-s)/2],_=Pl(this.bounds,{properties:{key:this.key,id:this.key,bbox:this.bounds,center:d,meta:`
|
|
`.concat(this.key,`
|
|
`)}});return _}},{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,Ft.Z)(_e().mark(function a(s){var l,f,d,_,b,T,M,P,D,G,q,se,Se,Ve,nt,st,at;return _e().wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return l=s.getData,f=s.onLoad,d=s.onError,this.loadDataId++,_=this.loadDataId,this.isLoading&&this.abortLoad(),this.abortController=new AbortController,this.loadStatus=_s.Loading,b=null,Wt.prev=7,M=this.x,P=this.y,D=this.z,G=this.bounds,q=this.tileSize,se=this.warp,Se=Rc(M,P,D,se),Ve=Se.warpX,nt=Se.warpY,st=this.abortController.signal,at={x:Ve,y:nt,z:D,bounds:G,tileSize:q,signal:st,warp:se},Wt.next=14,l(at,this);case 14:b=Wt.sent,Wt.next=20;break;case 17:Wt.prev=17,Wt.t0=Wt.catch(7),T=Wt.t0;case 20:if(_===this.loadDataId){Wt.next=22;break}return Wt.abrupt("return");case 22:if(!(this.isCancelled&&!b)){Wt.next=24;break}return Wt.abrupt("return");case 24:if(!(T||!b)){Wt.next=28;break}return this.loadStatus=_s.Failure,d(T,this),Wt.abrupt("return");case 28:this.loadStatus=_s.Loaded,this.data=b,f(this);case 31:case"end":return Wt.stop()}},a,this,[[7,17]])}));function i(a){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=_s.Cancelled,this.abortController.abort(),this.xhrCancel&&this.xhrCancel())}}]),t}(Ka.EventEmitter),rc=function(r,t){var n=Ql(r),i=Zu(n,t),a=360*3-180,s=85.0511287798065,l=[Math.max(i[0][0],-a),Math.max(i[0][1],-s),Math.min(i[1][0],a),Math.min(i[1][1],s)];return l},Ah=function(r,t){var n=Ql(r),i=Ql(t),a=ma(n,i);return a};function us(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Au(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function Au(e,r){if(e){if(typeof e=="string")return uf(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 uf(e,r)}}function uf(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 kl(e){var r=uu();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function uu(){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 Th=ui.throttle,ju=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}({}),jf=function(e){(0,Fe.Z)(t,e);var r=kl(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this),(0,F.Z)((0,Me.Z)(i),"currentTiles",[]),(0,F.Z)((0,Me.Z)(i),"cacheTiles",new Map),(0,F.Z)((0,Me.Z)(i),"throttleUpdate",Th(function(a,s){i.update(a,s)},16)),(0,F.Z)((0,Me.Z)(i),"onTileLoad",function(a){i.emit(ju.TileLoaded,a),i.updateTileVisible(),i.loadFinished()}),(0,F.Z)((0,Me.Z)(i),"onTileError",function(a,s){i.emit(ju.TileError,{error:a,tile:s}),i.updateTileVisible(),i.loadFinished()}),(0,F.Z)((0,Me.Z)(i),"onTileUnload",function(a){i.emit(ju.TileUnload,a),i.loadFinished()}),i.options={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,extent:yo,getTileData:cl,warp:!0,updateStrategy:Mo.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(a,s){return a.z-s.z});return i}},{key:"updateOptions",value:function(i){var a=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,H.Z)((0,H.Z)((0,H.Z)({},this.options),i),{},{minZoom:a,maxZoom:s})}},{key:"update",value:function(i,a){var s=this,l=Math.max(0,Math.ceil(i));if(!(this.lastViewStates&&this.lastViewStates.zoom===l&&Ah(this.lastViewStates.latLonBoundsBuffer,a))){var f=rc(a,Sh);this.lastViewStates={zoom:l,latLonBounds:a,latLonBoundsBuffer:f},this.currentZoom=l;var d=!1,_=this.getTileIndices(l,f).filter(function(b){return s.options.warp||b.x>=0&&b.x<Math.pow(2,l)});this.emit(ju.TilesLoadStart),this.currentTiles=_.map(function(b){var T=b.x,M=b.y,P=b.z,D=s.getTile(T,M,P);if(D){var G,q,se=((G=D)===null||G===void 0?void 0:G.isFailure)||((q=D)===null||q===void 0?void 0:q.isCancelled);return se&&D.loadData({getData:s.options.getTileData,onLoad:s.onTileLoad,onError:s.onTileError}),D}return D=s.createTile(T,M,P),d=!0,D}),d&&this.resizeCacheTiles(),this.updateTileVisible(),this.pruneRequests()}}},{key:"reloadAll",value:function(){var i=us(this.cacheTiles),a;try{for(i.s();!(a=i.n()).done;){var s=(0,_n.Z)(a.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(d){i.e(d)}finally{i.f()}}},{key:"reloadTileById",value:function(i,a,s){var l=this.cacheTiles.get("".concat(a,",").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,a,s){var l=this.getTileByLngLat(i,a,s);l&&this.reloadTileById(l.z,l.x,l.y)}},{key:"reloadTileByExtent",value:function(i,a){var s=this,l=this.getTileIndices(a,i);l.forEach(function(f){s.reloadTileById(f.z,f.x,f.y)})}},{key:"pruneRequests",value:function(){var i=[],a=us(this.cacheTiles.values()),s;try{for(a.s();!(s=a.n()).done;){var l=s.value;l.isLoading&&!l.isCurrent&&!l.isVisible&&i.push(l)}}catch(d){a.e(d)}finally{a.f()}for(;i.length>0;){var f=i.shift();f.abortLoad()}}},{key:"getTileByLngLat",value:function(i,a,s){var l=this.options.zoomOffset,f=Math.ceil(s)+l,d=xs(i,a,f),_=this.tiles.filter(function(b){return b.key==="".concat(d[0],"_").concat(d[1],"_").concat(f)});return _[0]}},{key:"getTileExtent",value:function(i,a){return this.getTileIndices(a,i)}},{key:"getTileByZXY",value:function(i,a,s){var l=this.tiles.filter(function(f){return f.key==="".concat(a,"_").concat(s,"_").concat(i)});return l[0]}},{key:"clear",value:function(){var i=us(this.cacheTiles.values()),a;try{for(i.s();!(a=i.n()).done;){var s=a.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,a=new Map,s=us(this.cacheTiles.values()),l;try{for(s.s();!(l=s.n()).done;){var f=l.value;a.set(f.key,f.isVisible),f.isCurrent=!1,f.isVisible=!1}}catch(P){s.e(P)}finally{s.f()}var d=us(this.currentTiles),_;try{for(d.s();!(_=d.n()).done;){var b=_.value;b.isCurrent=!0,b.isVisible=!0}}catch(P){d.e(P)}finally{d.f()}var T=Array.from(this.cacheTiles.values());typeof i=="function"?i(T):zf[i](T);var M=!1;Array.from(this.cacheTiles.values()).forEach(function(P){P.isVisible!==a.get(P.key)?(P.isVisibleChange=!0,M=!0):P.isVisibleChange=!1}),M&&this.emit(ju.TileUpdate)}},{key:"getTileIndices",value:function(i,a){var s=this.options,l=s.tileSize,f=s.extent,d=s.zoomOffset,_=Math.floor(this.options.maxZoom),b=Math.ceil(this.options.minZoom),T=Zf({maxZoom:_,minZoom:b,zoomOffset:d,tileSize:l,zoom:i,latLonBounds:a,extent:f});return T}},{key:"getTileId",value:function(i,a,s){var l="".concat(i,",").concat(a,",").concat(s);return l}},{key:"loadFinished",value:function(){var i=!this.currentTiles.some(function(a){return!a.isDone});return i&&this.emit(ju.TilesLoadFinished),i}},{key:"getTile",value:function(i,a,s){var l=this.getTileId(i,a,s),f=this.cacheTiles.get(l);return f}},{key:"createTile",value:function(i,a,s){var l=this.getTileId(i,a,s),f=new tc({x:i,y:a,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=Ol*this.currentTiles.length,a=this.cacheTiles.size>i;if(a){var s=us(this.cacheTiles),l;try{for(s.s();!(l=s.n()).done;){var f=(0,_n.Z)(l.value,2),d=f[0],_=f[1];if(!_.isVisible&&!this.currentTiles.includes(_)&&(this.cacheTiles.delete(d),this.onTileUnload(_)),this.cacheTiles.size<=i)break}}catch(b){s.e(b)}finally{s.f()}}this.rebuildTileTree()}},{key:"rebuildTileTree",value:function(){var i=us(this.cacheTiles.values()),a;try{for(i.s();!(a=i.n()).done;){var s=a.value;s.parent=null,s.children.length=0}}catch(b){i.e(b)}finally{i.f()}var l=us(this.cacheTiles.values()),f;try{for(l.s();!(f=l.n()).done;){var d=f.value,_=this.getNearestAncestor(d.x,d.y,d.z);d.parent=_,_!=null&&_.children&&_.children.push(d)}}catch(b){l.e(b)}finally{l.f()}}},{key:"getNearestAncestor",value:function(i,a,s){for(;s>this.options.minZoom;){i=Math.floor(i/2),a=Math.floor(a/2),s=s-1;var l=this.getTile(i,a,s);if(l)return l}return null}}]),t}(Zs());function wh(e){return/(?=.*{box})(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}function h(e){var r=[],t=/\{([a-z])-([a-z])\}/.exec(e);if(t){var n=t[1].charCodeAt(0),i=t[2].charCodeAt(0),a;for(a=n;a<=i;++a)r.push(e.replace(t[0],String.fromCharCode(a)));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 v(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,a=h(e),s=Math.abs(t+n)%a.length,l=Jn(a[s])?"".concat(a[s],"/{z}/{x}/{y}"):a[s];return l.replace(/\{x\}/g,t.toString()).replace(/\{y\}/g,n.toString()).replace(/\{z\}/g,i.toString()).replace(/\{bbox\}/g,Su(t,n,i).join(",")).replace(/\{-y\}/g,(Math.pow(2,i)-n-1).toString())}function p(e,r){var t=r.x,n=r.y,i=r.z,a=r.layer,s=r.version,l=s===void 0?"1.0.0":s,f=r.style,d=f===void 0?"default":f,_=r.format,b=r.service,T=b===void 0?"WMTS":b,M=r.tileMatrixset,P="".concat(e,"&SERVICE=").concat(T,"&REQUEST=GetTile&VERSION=").concat(l,"&LAYER=").concat(a,"&STYLE=").concat(d,"&TILEMATRIXSET=").concat(M,"&FORMAT=").concat(_,"&TILECOL=").concat(t,"&TILEROW=").concat(n,"&TILEMATRIX=").concat(i);return P}function g(e,r){if(!e)throw new Error(r||"web worker helper assertion failed.")}var S={self:typeof self!="undefined"&&self,window:typeof window!="undefined"&&window,document:typeof document!="undefined"&&document},w=S.self||S.window||{},C=S.window||S.self||{},O=S.self||S.window||{},X=S.document||{},J=typeof importScripts=="function",me=typeof window!="undefined"&&typeof window.orientation!="undefined",be=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,a){n.resolve=i,n.reject=a})}return e.prototype.postMessage=function(r,t){this.workerThread.postMessage({source:"Main thread",type:r,payload:t})},e.prototype.done=function(r){g(this.isRunning,"WorkerJob isRunning false."),this.isRunning=!1,this.resolve(r)},e.prototype.error=function(r){g(this.isRunning,"WorkerJob isRunning false."),this.isRunning=!1,this.reject(r)},e}(),Te=be,je=new Map;function Ze(e){g(e.source&&!e.url||!e.source&&e.url);var r=je.get(e.source||e.url);return r||(e.url&&(r=lt(e.url),je.set(e.url,r)),e.source&&(r=Ne(e.source),je.set(e.source,r))),g(r),r}function lt(e){if(!e.startsWith("http"))return e;var r=ot(e);return Ne(r)}function Ne(e){var r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function ot(e){return`try {
|
|
importScripts('`+e+`');
|
|
} catch (error) {
|
|
console.error(error);
|
|
throw error;
|
|
}`}function _t(e,r,t){r===void 0&&(r=!0);var n=t||new Set;if(e){if(Lt(e))n.add(e);else if(Lt(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(var i in e)_t(e[i],r,n)}}return t===void 0?Array.from(n):[]}function Lt(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 ir=function(){},qt=function(){function e(r){this.terminated=!1,this.loadableURL="";var t=r.name,n=r.source,i=r.url;g(n||i),this.name=t,this.source=n,this.url=i,this.onMessage=ir,this.onError=function(a){return console.log(a)},this.worker=this.createBrowserWorker()}return e.isSupported=function(){return typeof Worker!="undefined"},e.prototype.destroy=function(){this.onMessage=ir,this.onError=ir,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||_t(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=Ze({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}(),cr=qt,br=function(){return br=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},br.apply(this,arguments)},Hr=function(e,r,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function l(_){try{d(n.next(_))}catch(b){s(b)}}function f(_){try{d(n.throw(_))}catch(b){s(b)}}function d(_){_.done?a(_.value):i(_.value).then(l,f)}d((n=n.apply(e,r||[])).next())})},Fr=function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(d){return function(_){return f([d,_])}}function f(d){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=d[0]&2?i.return:d[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,d[1])).done)return a;switch(i=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,i=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]<a[3])){t.label=d[1];break}if(d[0]===6&&t.label<a[1]){t.label=a[1],a=d;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(d);break}a[2]&&t.ops.pop(),t.trys.pop();continue}d=r.call(e,t)}catch(_){d=[6,_],i=0}finally{n=a=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},hn=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=br(br({},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,a,s){return i.done(s)}),n===void 0&&(n=function(i,a){return i.error(a)}),Hr(this,void 0,void 0,function(){var i,a=this;return Fr(this,function(s){switch(s.label){case 0:return i=new Promise(function(l){return a.jobQueue.push({name:r,onMessage:t,onError:n,onStart:l}),a}),this.startQueuedJob(),[4,i];case 1:return[2,s.sent()]}})})},e.prototype.startQueuedJob=function(){return Hr(this,void 0,void 0,function(){var r,t,n;return Fr(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 Te(t.name,r),r.onMessage=function(a){return t.onMessage(n,a.type,a.payload)},r.onError=function(a){return t.onError(n,a)},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 cr({name:r,source:this.source,url:this.url})}return null},e.prototype.getMaxConcurrency=function(){return me?this.maxMobileConcurrency:this.maxConcurrency},e}(),Un=hn,Fn=function(){return Fn=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},Fn.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.")},zi={maxConcurrency:3,maxMobileConcurrency:1,onDebug:function(){},reuseWorkers:!0},gn=function(){function e(r){this.workerPools=new Map,this.props=Fn({},zi),this.setProps(r),this.workerPools=new Map}return e.isSupported=function(){return cr.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 a=i.value;a.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=Fn(Fn({},this.props),r);try{for(var i=zn(this.workerPools.values()),a=i.next();!a.done;a=i.next()){var s=a.value;s.setProps(this.getWorkerPoolProps())}}catch(l){t={error:l}}finally{try{a&&!a.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,a=this.workerPools.get(t);return a||(a=new Un({name:t,source:n,url:i}),a.setProps(this.getWorkerPoolProps()),this.workerPools.set(t,a)),a},e.prototype.getWorkerPoolProps=function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}},e}(),ii=null,pi=new Map,ri=function(){function e(){}return Object.defineProperty(e,"onmessage",{set:function(r){self.onmessage=function(t){if(fi(t)){var n=t.data,i=n.type,a=n.payload;r(i,a)}}},enumerable:!1,configurable:!0}),e.addEventListener=function(r){var t=pi.get(r);t||(t=function(n){if(fi(n)){var i=n.data,a=i.type,s=i.payload;r(a,s)}}),self.addEventListener("message",t)},e.removeEventListener=function(r){var t=pi.get(r);pi.delete(r),self.removeEventListener("message",t)},e.postMessage=function(r,t){if(self){var n={source:"Worker thread",type:r,payload:t},i=_t(t);self.postMessage(n,i)}},e}(),Kn=null;function fi(e){var r=e.type,t=e.data;return r==="message"&&t&&typeof t.source=="string"&&t.source==="Main thread"}function Qn(e){return JSON.parse(Gn(e))}function Gn(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 Io(e){return""+e.name}function Qa(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 Po=function(e,r,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function l(_){try{d(n.next(_))}catch(b){s(b)}}function f(_){try{d(n.throw(_))}catch(b){s(b)}}function d(_){_.done?a(_.value):i(_.value).then(l,f)}d((n=n.apply(e,r||[])).next())})},_o=function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(d){return function(_){return f([d,_])}}function f(d){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=d[0]&2?i.return:d[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,d[1])).done)return a;switch(i=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,i=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]<a[3])){t.label=d[1];break}if(d[0]===6&&t.label<a[1]){t.label=a[1],a=d;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(d);break}a[2]&&t.ops.pop(),t.trys.pop();continue}d=r.call(e,t)}catch(_){d=[6,_],i=0}finally{n=a=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}};function Wa(e,r){return WorkerFarm.isSupported()?e.worker&&(r==null?void 0:r.worker):!1}function Ja(e,r,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),Po(this,void 0,void 0,function(){var i,a,s,l,f,d,_,b;return _o(this,function(T){switch(T.label){case 0:return i=getWorkerName(e),a=getWorkerURL(e,t),s=WorkerFarm.getWorkerFarm(t),l=s.getWorkerPool({name:i,url:a}),f=t.jobName||e.name,[4,l.startJob(f,bs.bind(null,n))];case 1:return d=T.sent(),_=removeNontransferableOptions(t),d.postMessage("process",{input:r,options:_}),[4,d.result];case 2:return b=T.sent(),[2,b.result]}})})}function bs(e,r,t,n){return Po(this,void 0,void 0,function(){var i,a,s,l,f,d,_;return _o(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:a=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:a,error:"Worker not set up to process on main thread"}),[2]);case 5:return f=b.sent(),r.postMessage("done",{id:a,result:f}),[3,7];case 6:return d=b.sent(),_=d instanceof Error?d.message:"unknown error",r.postMessage("error",{id:a,error:_}),[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 Es=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}(),fl=null,Ss=function(e,r,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function l(_){try{d(n.next(_))}catch(b){s(b)}}function f(_){try{d(n.throw(_))}catch(b){s(b)}}function d(_){_.done?a(_.value):i(_.value).then(l,f)}d((n=n.apply(e,r||[])).next())})},lu=function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(d){return function(_){return f([d,_])}}function f(d){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=d[0]&2?i.return:d[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,d[1])).done)return a;switch(i=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,i=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]<a[3])){t.label=d[1];break}if(d[0]===6&&t.label<a[1]){t.label=a[1],a=d;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(d);break}a[2]&&t.ops.pop(),t.trys.pop();continue}d=r.call(e,t)}catch(_){d=[6,_],i=0}finally{n=a=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},Vs=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(a){t[a]=e[a]&&function(s){return new Promise(function(l,f){s=e[a](s),i(l,f,s.done,s.value)})}}function i(a,s,l,f){Promise.resolve(f).then(function(d){a({value:d,done:l})},s)}},Mc=0,Hu,Tu;function nc(e,r){var t=this;if(typeof self!="undefined"){var n={process:hl};WorkerBody.onmessage=function(i,a){return Ss(t,void 0,void 0,function(){var s,l,f,d,_,b,T,M,P,D,G;return lu(this,function(q){switch(q.label){case 0:switch(q.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(a.input,a.options||{},n)];case 2:return l=q.sent(),WorkerBody.postMessage("done",{result:l}),[3,18];case 3:if(!r)throw new Error("Worker does not support batched processing");Hu=new AsyncQueue,Tu=a.options||{},f=r(Hu,Tu,n),q.label=4;case 4:q.trys.push([4,9,10,15]),d=Vs(f),q.label=5;case 5:return[4,d.next()];case 6:if(_=q.sent(),!!_.done)return[3,8];b=_.value,WorkerBody.postMessage("output-batch",{result:b}),q.label=7;case 7:return[3,5];case 8:return[3,15];case 9:return T=q.sent(),D={error:T},[3,15];case 10:return q.trys.push([10,,13,14]),_&&!_.done&&(G=d.return)?[4,G.call(d)]:[3,12];case 11:q.sent(),q.label=12;case 12:return[3,14];case 13:if(D)throw D.error;return[7];case 14:return[7];case 15:return WorkerBody.postMessage("done",{}),[3,18];case 16:return Hu.push(a.input),[3,18];case 17:return Hu.close(),[3,18];case 18:return[3,20];case 19:return M=q.sent(),P=M instanceof Error?M.message:"",WorkerBody.postMessage("error",{error:P}),[3,20];case 20:return[2]}})})}}}function hl(e,r){return r===void 0&&(r={}),new Promise(function(t,n){var i=Mc++,a=function(l,f){if(f.id===i)switch(l){case"done":WorkerBody.removeEventListener(a),t(f.result);break;case"error":WorkerBody.removeEventListener(a),n(f.error);break;default:}};WorkerBody.addEventListener(a);var s={id:i,input:e,options:r};WorkerBody.postMessage("process",s)})}var cu=function(e,r,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function l(_){try{d(n.next(_))}catch(b){s(b)}}function f(_){try{d(n.throw(_))}catch(b){s(b)}}function d(_){_.done?a(_.value):i(_.value).then(l,f)}d((n=n.apply(e,r||[])).next())})},pl=function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(d){return function(_){return f([d,_])}}function f(d){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=d[0]&2?i.return:d[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,d[1])).done)return a;switch(i=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,i=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]<a[3])){t.label=d[1];break}if(d[0]===6&&t.label<a[1]){t.label=a[1],a=d;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(d);break}a[2]&&t.ops.pop(),t.trys.pop();continue}d=r.call(e,t)}catch(_){d=[6,_],i=0}finally{n=a=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},Oo={};function ao(e,r,t){return r===void 0&&(r=null),t===void 0&&(t={}),cu(this,void 0,void 0,function(){return pl(this,function(n){switch(n.label){case 0:return r&&(e=Ps(e,r,t)),Oo[e]=Oo[e]||fu(e),[4,Oo[e]];case 1:return[2,n.sent()]}})})}function Ps(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 fu(e){return cu(this,void 0,void 0,function(){var r,t,n;return pl(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,wu(n,e)]}})})}function wu(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 Fi="0.0.3",Jo={id:"null",name:"null",module:"web-worker-helper",options:{}};function oo(e){var r=e.color;return!r||!r.length?[1,1,1,1]:r}function hu(e,r,t){return t.length===2?[t[0],t[1],0]:[t[0],t[1],t[2]]}function Ic(e){var r=e.filter;return r?[1]:[0]}function Wu(e,r){return[r]}var Ch=U(75734),ko=U.n(Ch),Dr=U(38015),js=Dr.Ue(),Rh=Dr.Ue(),Do=Dr.Ue(),ru=Dr.Ue(),Lo=Dr.Ue();function pp(e,r,t,n,i){Dr.IH(e,t,n),Dr.Fv(e,e),r=Dr.al(-e[1],e[0]);var a=Dr.al(-t[1],t[0]);return[i/Dr.AK(r,a),r]}function ic(e,r){return Dr.t8(e,-r[1],r[0])}function dl(e,r,t){return Dr.lu(e,r,t),Dr.Fv(e,e),e}function Zp(e,r){return e[0]===r[0]&&e[1]===r[1]}function ag(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 zv=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,Q.Z)(this,e),(0,F.Z)(this,"lastFlip",-1),(0,F.Z)(this,"miter",Dr.al(0,0)),(0,F.Z)(this,"started",!1),(0,F.Z)(this,"dash",!1),(0,F.Z)(this,"totalDistance",0),(0,F.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 a=t.length,s=i.startIndex,l=1;l<a;l++){var f,d,_,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((d=n[l][2])!==null&&d!==void 0?d:0);var P=n[l],D=l<t.length-1?[].concat((0,Qt.Z)(t[l+1]),[(_=n[l+1][2])!==null&&_!==void 0?_:0]):null,G=l<n.length-1?n[l+1]:null,q=this.segment_gaode2(i,s,b,M,D,T,P,G);s+=q}if(this.dash)for(var se=0;se<i.positions.length/6;se++)i.positions[se*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 a=t.length,s=i.startIndex,l=1;l<a;l++){var f,d,_,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((d=n[l][2])!==null&&d!==void 0?d:0);var P=n[l],D=l<t.length-1?[].concat((0,Qt.Z)(t[l+1]),[(_=n[l+1][2])!==null&&_!==void 0?_:0]):null,G=l<n.length-1?n[l+1]:null,q=this.simpleSegment(i,s,b,M,D,T,P,G);s+=q}if(this.dash)for(var se=0;se<i.positions.length/6;se++)i.positions[se*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,a=n.startIndex,s=1;s<i;s++){var l=t[s-1],f=t[s],d=s<t.length-1?t[s+1]:null,_=this.segment(n,a,l,f,d);a+=_}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,a=n.startIndex,s=1;s<i;s++){var l=t[s-1],f=t[s],d=s<t.length-1?t[s+1]:null,_=this.simpleSegment(n,a,l,f,d);a+=_}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,a,s,l,f,d){var _=0,b=t.indices,T=t.positions,M=t.normals,P=this.cap==="square",D=this.join==="bevel",G=ja([f[0],f[1]]),q=ja([l[0],l[1]]);dl(Do,a,i);var se=0;if(this.dash&&(se=this.lineSegmentDistance(G,q),this.totalDistance+=se),this.normal||(this.normal=Dr.Ue(),ic(this.normal,Do)),!this.started)if(this.started=!0,P){var Se=Dr.Ue(),Ve=Dr.Ue();Dr.IH(Se,this.normal,Do),Dr.IH(Ve,this.normal,Do),M.push(Ve[0],Ve[1],0),M.push(Se[0],Se[1],0),T.push(i[0],i[1],i[2]|0,this.totalDistance-se,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),T.push(i[0],i[1],i[2]|0,this.totalDistance-se,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-se);if(b.push(n+0,n+1,n+2),s){Zp(a,s)&&Dr.IH(s,a,Dr.Fv(s,Dr.$X(s,a,i))),dl(ru,s,a);var at=pp(Lo,Dr.Ue(),Do,ru,this.thickness),At=(0,_n.Z)(at,2),Wt=At[0],Sr=At[1],_r=Dr.AK(Lo,this.normal)<0?-1:1,Gr=D;if(!Gr&&this.join==="miter"){var Cn=Wt;Cn>this.miterLimit&&(Gr=!0)}Gr?(M.push(this.normal[0],this.normal[1],0),M.push(Sr[0],Sr[1],0),T.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*_r,a[2]|0),this.complex.indexes.push(this.currentIndex),T.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness*_r,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,b.push.apply(b,(0,Qt.Z)(this.lastFlip!==-_r?[n,n+2,n+3]:[n+2,n+1,n+3])),b.push(n+2,n+3,n+4),ic(js,ru),Dr.JG(this.normal,js),M.push(this.normal[0],this.normal[1],0),T.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*_r,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,_+=3):(this.extrusions(T,M,a,Sr,Wt,this.totalDistance),b.push.apply(b,(0,Qt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),_r=-1,Dr.JG(this.normal,Sr),_+=2),this.lastFlip=_r}else{if(ic(this.normal,Do),P){var nt=Dr.Ue(),st=Dr.Ue();Dr.lu(st,Do,this.normal),Dr.IH(nt,Do,this.normal),M.push(st[0],st[1],0),M.push(nt[0],nt[1],0),T.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),T.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(T,M,a,this.normal,this.thickness,this.totalDistance);b.push.apply(b,(0,Qt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),_+=2}return _}},{key:"simpleSegment",value:function(t,n,i,a,s){var l=0,f=t.indices,d=t.positions,_=t.normals,b=ja([a[0],a[1]]),T=ja([i[0],i[1]]);dl(Do,b,T);var M=0;if(this.dash&&(M=this.lineSegmentDistance(b,T),this.totalDistance+=M),this.normal||(this.normal=Dr.Ue(),ic(this.normal,Do)),this.started||(this.started=!0,this.extrusions(d,_,i,this.normal,this.thickness,this.totalDistance-M)),f.push(n+0,n+1,n+2),!s)ic(this.normal,Do),this.extrusions(d,_,a,this.normal,this.thickness,this.totalDistance),f.push.apply(f,(0,Qt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),l+=2;else{var P=ja([s[0],s[1]]);Zp(b,P)&&Dr.IH(P,b,Dr.Fv(P,Dr.$X(P,b,T))),dl(ru,P,b);var D=pp(Lo,Dr.Ue(),Do,ru,this.thickness),G=(0,_n.Z)(D,2),q=G[0],se=G[1],Se=Dr.AK(Lo,this.normal)<0?-1:1;this.extrusions(d,_,a,se,q,this.totalDistance),f.push.apply(f,(0,Qt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),Se=-1,Dr.JG(this.normal,se),l+=2,this.lastFlip=Se}return l}},{key:"segment",value:function(t,n,i,a,s){var l=0,f=t.indices,d=t.positions,_=t.normals,b=this.cap==="square",T=this.join==="bevel",M=ja([a[0],a[1]]),P=ja([i[0],i[1]]);dl(Do,M,P);var D=0;if(this.dash&&(D=this.lineSegmentDistance(M,P),this.totalDistance+=D),this.normal||(this.normal=Dr.Ue(),ic(this.normal,Do)),!this.started)if(this.started=!0,b){var G=Dr.Ue(),q=Dr.Ue();Dr.IH(G,this.normal,Do),Dr.IH(q,this.normal,Do),_.push(q[0],q[1],0),_.push(G[0],G[1],0),d.push(i[0],i[1],i[2]|0,this.totalDistance-D,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),d.push(i[0],i[1],i[2]|0,this.totalDistance-D,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(d,_,i,this.normal,this.thickness,this.totalDistance-D);if(f.push(n+0,n+1,n+2),s){var Ve=ja([s[0],s[1]]);Zp(M,Ve)&&Dr.IH(Ve,M,Dr.Fv(Ve,Dr.$X(Ve,M,P))),dl(ru,Ve,M);var nt=pp(Lo,Dr.Ue(),Do,ru,this.thickness),st=(0,_n.Z)(nt,2),at=st[0],At=st[1],Wt=Dr.AK(Lo,this.normal)<0?-1:1,Sr=T;if(!Sr&&this.join==="miter"){var _r=at;_r>this.miterLimit&&(Sr=!0)}Sr?(_.push(this.normal[0],this.normal[1],0),_.push(At[0],At[1],0),d.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*Wt,a[2]|0),this.complex.indexes.push(this.currentIndex),d.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness*Wt,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,f.push.apply(f,(0,Qt.Z)(this.lastFlip!==-Wt?[n,n+2,n+3]:[n+2,n+1,n+3])),f.push(n+2,n+3,n+4),ic(js,ru),Dr.JG(this.normal,js),_.push(this.normal[0],this.normal[1],0),d.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*Wt,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,l+=3):(this.extrusions(d,_,a,At,at,this.totalDistance),f.push.apply(f,(0,Qt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),Wt=-1,Dr.JG(this.normal,At),l+=2),this.lastFlip=Wt}else{if(ic(this.normal,Do),b){var se=Dr.Ue(),Se=Dr.Ue();Dr.lu(Se,Do,this.normal),Dr.IH(se,Do,this.normal),_.push(Se[0],Se[1],0),_.push(se[0],se[1],0),d.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),d.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(d,_,a,this.normal,this.thickness,this.totalDistance);f.push.apply(f,(0,Qt.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,a,s,l){n.push(a[0],a[1],0),n.push(a[0],a[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],a=n[1]-t[1];return Math.sqrt(i*i+a*a)}}]),e}();function Hf(e){var r=e.coordinates,t=e.originCoordinates,n=e.version,i=new zv({dash:!0,join:"bevel"});if(n==="GAODE2.x"){var a=r;Array.isArray(a[0][0])||(a=[r]);var s=t;Array.isArray(s[0][0])||(s=[t]);for(var l=0;l<a.length;l++){var f=a[l],d=s[l];i.extrude_gaode2(f,d)}}else{var _=r;_[0]&&!Array.isArray(_[0][0])&&(_=[r]),_.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 dp(e){var r=Qs(e.coordinates);return{vertices:[].concat((0,Qt.Z)(r),(0,Qt.Z)(r),(0,Qt.Z)(r),(0,Qt.Z)(r)),indices:[0,1,2,2,3,0],size:r.length}}function Mh(e){var r=e.coordinates,t=ko().flatten(r),n=t.vertices,i=t.dimensions,a=t.holes,s=ko()(n,a,i);return{indices:s,vertices:n,size:i}}var Dd=function(){var e=(0,Ft.Z)(_e().mark(function r(t){var n,i,a,s,l,f,d,_,b;return _e().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return n=t.descriptors,i=t.features,a=t.enablePicking,s=t.iconMap,l={a_Color:oo,a_Position:hu,filter:Ic,a_vertexId:Wu,a_PickingColor:function(D){var G=D.id;return a?na(G):[0,0,0]},a_DistanceAndIndex:function(D,G,q,se,Se,Ve){return Ve===void 0?[q[3],10]:[q[3],Ve]},a_Total_Distance:function(D,G,q){return[q[5]]},a_Size:function(D){var G=D.size,q=G===void 0?1:G;return Array.isArray(q)?[q[0],q[1]]:[q,0]},a_Normal:function(D,G,q,se,Se){return Se},a_Miter:function(D,G,q){return[q[4]]},a_iconMapUV:function(D){var G=D.texture,q=s[G]||{x:0,y:0},se=q.x,Se=q.y;return[se,Se]}},f={sizePerElement:0,elements:[]},d=0,_=[],b=3,i.forEach(function(P,D){var G=Hf(P),q=G.indices,se=G.vertices,Se=G.normals,Ve=G.size,nt=G.indexes;q.forEach(function(Wt){_.push(Wt+d)}),b=Ve;var st=se.length/Ve;f.sizePerElement=b,f.elements.push({featureIdx:D,vertices:se,normals:Se,offset:d}),d+=st;for(var at=function(Sr){var _r=(Se==null?void 0:Se.slice(Sr*3,Sr*3+3))||[],Gr=se.slice(Sr*Ve,Sr*Ve+Ve),Cn=0;nt&&nt[Sr]!==void 0&&(Cn=nt[Sr]),n.forEach(function(wi){if(wi&&l[wi.name]){var la;(la=wi.buffer.data).push.apply(la,(0,Qt.Z)(l[wi.name](P,D,Gr,Sr,_r,Cn)))}})},At=0;At<st;At++)at(At)}),M.abrupt("return",{descriptors:n,featureLayout:f,indices:_});case 8:case"end":return M.stop()}},r)}));return function(t){return e.apply(this,arguments)}}(),Pc=function(){var e=(0,Ft.Z)(_e().mark(function r(t){var n,i,a,s,l,f,d,_,b;return _e().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return n=t.descriptors,i=t.features,a=t.enablePicking,s=t.shape2d,l={a_Color:oo,a_Position:hu,filter:Ic,a_vertexId:Wu,a_PickingColor:function(D){var G=D.id;return a?na(G):[0,0,0]},a_Shape:function(D){var G=D.shape,q=G===void 0?2:G,se=s.indexOf(q);return[se]},a_Extrude:function(D,G,q,se){var Se=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],Ve=se%4*3;return[Se[Ve],Se[Ve+1],Se[Ve+2]]},a_Size:function(D){var G=D.size,q=G===void 0?5:G;return Array.isArray(q)?[q[0]]:[q]}},f={sizePerElement:0,elements:[]},d=0,_=[],b=3,i.forEach(function(P,D){var G=dp(P),q=G.indices,se=G.vertices,Se=G.normals,Ve=G.size,nt=G.indexes;q.forEach(function(Wt){_.push(Wt+d)}),b=Ve;var st=se.length/Ve;f.sizePerElement=b,f.elements.push({featureIdx:D,vertices:se,normals:Se,offset:d}),d+=st;for(var at=function(Sr){var _r=(Se==null?void 0:Se.slice(Sr*3,Sr*3+3))||[],Gr=se.slice(Sr*Ve,Sr*Ve+Ve),Cn=0;nt&&nt[Sr]!==void 0&&(Cn=nt[Sr]),n.forEach(function(wi){if(wi&&l[wi.name]){var la;(la=wi.buffer.data).push.apply(la,(0,Qt.Z)(l[wi.name](P,D,Gr,Sr,_r,Cn)))}})},At=0;At<st;At++)at(At)}),M.abrupt("return",{descriptors:n,featureLayout:f,indices:_});case 8:case"end":return M.stop()}},r)}));return function(t){return e.apply(this,arguments)}}(),Ih=function(){var e=(0,Ft.Z)(_e().mark(function r(t){var n,i,a,s,l,f,d,_;return _e().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return n=t.descriptors,i=t.features,a=t.enablePicking,s={a_Color:oo,a_Position:hu,filter:Ic,a_vertexId:Wu,a_PickingColor:function(P){var D=P.id;return a?na(D):[0,0,0]}},l={sizePerElement:0,elements:[]},f=0,d=[],_=3,i.forEach(function(M,P){var D=Mh(M),G=D.indices,q=D.vertices,se=D.normals,Se=D.size,Ve=D.indexes;G.forEach(function(At){d.push(At+f)}),_=Se;var nt=q.length/Se;l.sizePerElement=_,l.elements.push({featureIdx:P,vertices:q,normals:se,offset:f}),f+=nt;for(var st=function(Wt){var Sr=(se==null?void 0:se.slice(Wt*3,Wt*3+3))||[],_r=q.slice(Wt*Se,Wt*Se+Se),Gr=0;Ve&&Ve[Wt]!==void 0&&(Gr=Ve[Wt]),n.forEach(function(Cn){if(Cn&&s[Cn.name]){var wi;(wi=Cn.buffer.data).push.apply(wi,(0,Qt.Z)(s[Cn.name](M,P,_r,Wt,Sr,Gr)))}})},at=0;at<nt;at++)st(at)}),T.abrupt("return",{descriptors:n,featureLayout:l,indices:d});case 8:case"end":return T.stop()}},r)}));return function(t){return e.apply(this,arguments)}}(),Zv={pointFill:Pc,line:Dd,polygonFill:Ih},Ld=(0,H.Z)({},Zv);function og(e){return Vp.apply(this,arguments)}function Vp(){return Vp=_asyncToGenerator(_regeneratorRuntime.mark(function e(r){var t,n;return _regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(t=r.workerType,n=r.data,!Ld[t]){a.next=3;break}return a.abrupt("return",Ld[t](n));case 3:return a.abrupt("return",Promise.reject(new Error('Worker with type "'.concat(t,'" non-existent.'))));case 4:case"end":return a.stop()}},e)})),Vp.apply(this,arguments)}var Bd=new Map;function Fd(e,r){Bd.set(e,r)}function jp(e){var r=Bd.get(e);return r}var Dl="l7-worker",vp=3,Oc=!0;function Hp(e){registerWorkerSource(Dl,e)}function eo(){var e=getWorkerSource(Dl);if(!e)throw new Error("get worker failed by workerName: ".concat(Dl,"."));return e}function Wf(e,r){return Gf.apply(this,arguments)}function Gf(){return Gf=_asyncToGenerator(_regeneratorRuntime.mark(function e(r,t){var n,i,a,s,l;return _regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return n=eo(),i=WorkerFarm.getWorkerFarm({maxConcurrency:vp,reuseWorkers:Oc}),a=i.getWorkerPool({name:Dl,source:n}),d.next=5,a.startJob(Dl,function(_,b,T){return _.done(T)});case 5:return s=d.sent,s.postMessage("process",{input:{workerType:r,data:t}}),d.next=9,s.result;case 9:return l=d.sent,d.abrupt("return",l.result);case 11:case"end":return d.stop()}},e)})),Gf.apply(this,arguments)}function vl(e,r){return e==null?r:e}var lf=U(47903),kc=U.n(lf);function Xf(e,r){return e.map(function(t){return t[r]*1})}function $f(e){return e===void 0?!1:!Array.isArray(e)&&e.data!==void 0}function Dc(e){return Array.isArray(e)?e.length===0?!1:!!$f(e[0]):!1}function Lc(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number":!1}function ac(e){var r=Object.isFrozen(e)?ui.cloneDeep(e):e;return kc()(r,!0),r}function Wp(e,r){var t=r.x,n=r.y,i=r.x1,a=r.y1,s=r.coordinates,l=r.geometry,f=[];if(!Array.isArray(e))return{dataArray:[]};if(l)return e.filter(function(q){return q[l]&&q[l].type&&q[l].coordinates&&q[l].coordinates.length>0}).forEach(function(q,se){var Se=ac(q[l]);dt(Se,function(Ve){var nt=Zo(Ve),st=(0,H.Z)((0,H.Z)({},q),{},{_id:se,coordinates:nt});f.push(st)})}),{dataArray:f};for(var d=0;d<e.length;d++){var _=e[d],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=ac({type:T,coordinates:_[s]});b=M.coordinates}else if(t&&n&&i&&a){var P=[parseFloat(_[t]),parseFloat(_[n])],D=[parseFloat(_[i]),parseFloat(_[a])];b=[P,D]}else t&&n&&(b=[parseFloat(_[t]),parseFloat(_[n])]);var G=(0,H.Z)((0,H.Z)({},_),{},{_id:d,coordinates:b});f.push(G)}return{dataArray:f}}function oc(e,r){var t=Mt(e);return Wp(t,r)}var Hs=U(97382);function mp(e){for(var r=e.toString(),t=5381,n=r.length;n;)t=t*33^r.charCodeAt(--n);return t>>>0}function Gp(e,r){return r===void 0?null:(0,Hs.Z)(e.properties[r])*1==="number"?e.properties[r]*1:e.properties&&e.properties[r]?mp(e.properties[r]+"")%1000019:null}function Xp(e,r){var t=[],n={};return e.features?(e.features=e.features.filter(function(i){var a=i.geometry;return i!=null&&a&&a.type&&a.coordinates&&a.coordinates.length>0}),e=ac(e),e.features.length===0?{dataArray:[],featureKeys:n}:(dt(e,function(i,a){var s=Gp(i,r==null?void 0:r.featureId);s===null&&(s=a);var l=s,f=Zo(i),d=(0,H.Z)((0,H.Z)({},i.properties),{},{coordinates:f,_id:l});t.push(d)}),{dataArray:t,featureKeys:n})):(e.features=[],{dataArray:[]})}function Ph(e,r,t,n){for(var i=n,a=t-r>>1,s=t-r,l,f=e[r],d=e[r+1],_=e[t],b=e[t+1],T=r+3;T<t;T+=3){var M=ml(e[T],e[T+1],f,d,_,b);if(M>i)l=T,i=M;else if(M===i){var P=Math.abs(T-a);P<s&&(l=T,s=P)}}i>n&&(l-r>3&&Ph(e,r,l,n),e[l+2]=i,t-l>3&&Ph(e,l,t,n))}function ml(e,r,t,n,i,a){var s=i-t,l=a-n;if(s!==0||l!==0){var f=((e-t)*s+(r-n)*l)/(s*s+l*l);f>1?(t=i,n=a):f>0&&(t+=s*f,n+=l*f)}return s=e-t,l=r-n,s*s+l*l}function Gu(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 Nd(i),i}function Nd(e){var r=e.geometry,t=e.type;if(t==="Point"||t==="MultiPoint"||t==="LineString")gp(e,r);else if(t==="Polygon"||t==="MultiLineString")for(var n=0;n<r.length;n++)gp(e,r[n]);else if(t==="MultiPolygon")for(n=0;n<r.length;n++)for(var i=0;i<r[n].length;i++)gp(e,r[n][i])}function gp(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 Ud(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,a=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),a==="Point")Bc(i,l);else if(a==="MultiPoint")for(var d=0;d<i.length;d++)Bc(i[d],l);else if(a==="LineString")$p(i,l,s,!1);else if(a==="MultiLineString")if(t.lineMetrics){for(d=0;d<i.length;d++)l=[],$p(i[d],l,s,!1),e.push(Gu(f,"LineString",l,r.properties));return}else Xu(i,l,s,!1);else if(a==="Polygon")Xu(i,l,s,!0);else if(a==="MultiPolygon")for(d=0;d<i.length;d++){var _=[];Xu(i[d],_,s,!0),l.push(_)}else if(a==="GeometryCollection"){for(d=0;d<r.geometry.geometries.length;d++)Oh(e,{id:f,geometry:r.geometry.geometries[d],properties:r.properties},t,n);return}else throw new Error("Input data is not a valid GeoJSON object.");e.push(Gu(f,a,l,r.properties))}}function Bc(e,r){r.push(yp(e[0])),r.push(Fc(e[1])),r.push(0)}function $p(e,r,t,n){for(var i,a,s=0,l=0;l<e.length;l++){var f=yp(e[l][0]),d=Fc(e[l][1]);r.push(f),r.push(d),r.push(0),l>0&&(n?s+=(i*d-f*a)/2:s+=Math.sqrt(Math.pow(f-i,2)+Math.pow(d-a,2))),i=f,a=d}var _=r.length-3;r[2]=1,Ph(r,0,_,t),r[_+2]=1,r.size=Math.abs(s),r.start=0,r.end=r.size}function Xu(e,r,t,n){for(var i=0;i<e.length;i++){var a=[];$p(e[i],a,t,n),r.push(a)}}function yp(e){return e/360+.5}function Fc(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 Ws(e,r,t,n,i,a,s,l){if(t/=r,n/=r,a>=t&&s<n)return e;if(s<t||a>=n)return null;for(var f=[],d=0;d<e.length;d++){var _=e[d],b=_.geometry,T=_.type,M=i===0?_.minX:_.minY,P=i===0?_.maxX:_.maxY;if(M>=t&&P<n){f.push(_);continue}else if(P<t||M>=n)continue;var D=[];if(T==="Point"||T==="MultiPoint")zd(b,D,t,n,i);else if(T==="LineString")sc(b,D,t,n,i,!1,l.lineMetrics);else if(T==="MultiLineString")Yf(b,D,t,n,i,!1);else if(T==="Polygon")Yf(b,D,t,n,i,!0);else if(T==="MultiPolygon")for(var G=0;G<b.length;G++){var q=[];Yf(b[G],q,t,n,i,!0),q.length&&D.push(q)}if(D.length){if(l.lineMetrics&&T==="LineString"){for(G=0;G<D.length;G++)f.push(Gu(_.id,T,D[G],_.tags));continue}(T==="LineString"||T==="MultiLineString")&&(D.length===1?(T="LineString",D=D[0]):T="MultiLineString"),(T==="Point"||T==="MultiPoint")&&(T=D.length===3?"Point":"MultiPoint"),f.push(Gu(_.id,T,D,_.tags))}}return f.length?f:null}function zd(e,r,t,n,i){for(var a=0;a<e.length;a+=3){var s=e[a+i];s>=t&&s<=n&&(r.push(e[a]),r.push(e[a+1]),r.push(e[a+2]))}}function sc(e,r,t,n,i,a,s){for(var l=kh(e),f=i===0?As:Bo,d=e.start,_,b,T=0;T<e.length-3;T+=3){var M=e[T],P=e[T+1],D=e[T+2],G=e[T+3],q=e[T+4],se=i===0?M:P,Se=i===0?G:q,Ve=!1;s&&(_=Math.sqrt(Math.pow(M-G,2)+Math.pow(P-q,2))),se<t?Se>t&&(b=f(l,M,P,G,q,t),s&&(l.start=d+_*b)):se>n?Se<n&&(b=f(l,M,P,G,q,n),s&&(l.start=d+_*b)):ls(l,M,P,D),Se<t&&se>=t&&(b=f(l,M,P,G,q,t),Ve=!0),Se>n&&se<=n&&(b=f(l,M,P,G,q,n),Ve=!0),!a&&Ve&&(s&&(l.end=d+_*b),r.push(l),l=kh(e)),s&&(d+=_)}var nt=e.length-3;M=e[nt],P=e[nt+1],D=e[nt+2],se=i===0?M:P,se>=t&&se<=n&&ls(l,M,P,D),nt=l.length-3,a&&nt>=3&&(l[nt]!==l[0]||l[nt+1]!==l[1])&&ls(l,l[0],l[1],l[2]),l.length&&r.push(l)}function kh(e){var r=[];return r.size=e.size,r.start=e.start,r.end=e.end,r}function Yf(e,r,t,n,i,a){for(var s=0;s<e.length;s++)sc(e[s],r,t,n,i,a,!1)}function ls(e,r,t,n){e.push(r),e.push(t),e.push(n)}function As(e,r,t,n,i,a){var s=(a-r)/(n-r);return e.push(a),e.push(t+(i-t)*s),e.push(1),s}function Bo(e,r,t,n,i,a){var s=(a-t)/(i-t);return e.push(r+(n-r)*s),e.push(a),e.push(1),s}function pu(e,r){var t=r.buffer/r.extent,n=e,i=Ws(e,1,-1-t,t,0,-1,2,r),a=Ws(e,1,1-t,2+t,0,-1,2,r);return(i||a)&&(n=Ws(e,1,-t,1+t,0,-1,2,r)||[],i&&(n=Yp(i,1).concat(n)),a&&(n=n.concat(Yp(a,-1)))),n}function Yp(e,r){for(var t=[],n=0;n<e.length;n++){var i=e[n],a=i.type,s;if(a==="Point"||a==="MultiPoint"||a==="LineString")s=cf(i.geometry,r);else if(a==="MultiLineString"||a==="Polygon"){s=[];for(var l=0;l<i.geometry.length;l++)s.push(cf(i.geometry[l],r))}else if(a==="MultiPolygon")for(s=[],l=0;l<i.geometry.length;l++){for(var f=[],d=0;d<i.geometry[l].length;d++)f.push(cf(i.geometry[l][d],r));s.push(f)}t.push(Gu(i.id,a,s,i.tags))}return t}function cf(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 qp(e,r){if(e.transformed)return e;var t=1<<e.z,n=e.x,i=e.y,a,s,l;for(a=0;a<e.features.length;a++){var f=e.features[a],d=f.geometry,_=f.type;if(f.geometry=[],_===1)for(s=0;s<d.length;s+=2)f.geometry.push(Zd(d[s],d[s+1],r,t,n,i));else for(s=0;s<d.length;s++){var b=[];for(l=0;l<d[s].length;l+=2)b.push(Zd(d[s][l],d[s][l+1],r,t,n,i));f.geometry.push(b)}}return e.transformed=!0,e}function Zd(e,r,t,n,i,a){return[Math.round(t*(e*n-i)),Math.round(t*(r*n-a))]}function Vv(e,r,t,n,i){for(var a=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++,Vd(s,e[l],a,i);var f=e[l].minX,d=e[l].minY,_=e[l].maxX,b=e[l].maxY;f<s.minX&&(s.minX=f),d<s.minY&&(s.minY=d),_>s.maxX&&(s.maxX=_),b>s.maxY&&(s.maxY=b)}return s}function Vd(e,r,t,n){var i=r.geometry,a=r.type,s=[];if(a==="Point"||a==="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(a==="LineString")Kp(s,i,e,t,!1,!1);else if(a==="MultiLineString"||a==="Polygon")for(l=0;l<i.length;l++)Kp(s,i[l],e,t,a==="Polygon",l===0);else if(a==="MultiPolygon")for(var f=0;f<i.length;f++){var d=i[f];for(l=0;l<d.length;l++)Kp(s,d[l],e,t,!0,l===0)}if(s.length){var _=r.tags||null;if(a==="LineString"&&n.lineMetrics){_={};for(var b in r.tags)_[b]=r.tags[b];_.mapbox_clip_start=i.start/i.size,_.mapbox_clip_end=i.end/i.size}var T={geometry:s,type:a==="Polygon"||a==="MultiPolygon"?3:a==="LineString"||a==="MultiLineString"?2:1,tags:_};r.id!==null&&(T.id=r.id),e.features.push(T)}}function Kp(e,r,t,n,i,a){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&&jd(l,a),e.push(l)}function jd(e,r){for(var t=0,n=0,i=e.length,a=i-2;n<i;a=n,n+=2)t+=(e[n]-e[a])*(e[n+1]+e[a+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 Os(e,r){return new _p(e,r)}function _p(e,r){r=this.options=Qp(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=Ud(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=pu(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)))}_p.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_p.prototype.splitTile=function(e,r,t,n,i,a,s){for(var l=[e,r,t,n],f=this.options,d=f.debug;l.length;){n=l.pop(),t=l.pop(),r=l.pop(),e=l.pop();var _=1<<r,b=xp(r,t,n),T=this.tiles[b];if(!T&&(d>1&&console.time("creation"),T=this.tiles[b]=Vv(e,r,t,n,f),this.tileCoords.push({z:r,x:t,y:n}),d)){d>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 P=1<<i-r;if(t!==Math.floor(a/P)||n!==Math.floor(s/P))continue}else if(r===f.indexMaxZoom||T.numPoints<=f.indexMaxPoints)continue;if(T.source=null,e.length!==0){d>1&&console.time("clipping");var D=.5*f.buffer/f.extent,G=.5-D,q=.5+D,se=1+D,Se,Ve,nt,st,at,At;Se=Ve=nt=st=null,at=Ws(e,_,t-D,t+q,0,T.minX,T.maxX,f),At=Ws(e,_,t+G,t+se,0,T.minX,T.maxX,f),e=null,at&&(Se=Ws(at,_,n-D,n+q,1,T.minY,T.maxY,f),Ve=Ws(at,_,n+G,n+se,1,T.minY,T.maxY,f),at=null),At&&(nt=Ws(At,_,n-D,n+q,1,T.minY,T.maxY,f),st=Ws(At,_,n+G,n+se,1,T.minY,T.maxY,f),At=null),d>1&&console.timeEnd("clipping"),l.push(Se||[],r+1,t*2,n*2),l.push(Ve||[],r+1,t*2,n*2+1),l.push(nt||[],r+1,t*2+1,n*2),l.push(st||[],r+1,t*2+1,n*2+1)}}},_p.prototype.getTile=function(e,r,t){var n=this.options,i=n.extent,a=n.debug;if(e<0||e>24)return null;var s=1<<e;r=(r%s+s)%s;var l=xp(e,r,t);if(this.tiles[l])return qp(this.tiles[l],i);a>1&&console.log("drilling down to z%d-%d-%d",e,r,t);for(var f=e,d=r,_=t,b;!b&&f>0;)f--,d=Math.floor(d/2),_=Math.floor(_/2),b=this.tiles[xp(f,d,_)];return!b||!b.source?null:(a>1&&console.log("found parent tile z%d-%d-%d",f,d,_),a>1&&console.time("drilling down"),this.splitTile(b.source,f,d,_,e,r,t),a>1&&console.timeEnd("drilling down"),this.tiles[l]?qp(this.tiles[l],i):null)};function xp(e,r,t){return((1<<e)*t+r)*32+e}function Qp(e,r){for(var t in r)e[t]=r[t];return e}var qf=function(){function e(r,t,n,i){(0,Q.Z)(this,e),(0,F.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}(),Jp={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0};function jv(e){for(var r=0,t=0,n=e.length,i=n-1,a,s;t<n;i=t++)a=e[t],s=e[i],r+=(s.x-a.x)*(a.y+s.y);return r}function Hv(e){var r=e.length;if(r<=1)return[e];for(var t=[],n,i,a=0;a<r;a++){var s=jv(e[a]);s!==0&&(i===void 0&&(i=s<0),i===s<0?(n&&t.push(n),n=[e[a]]):n.push(e[a]))}return n&&t.push(n),t}var Hd=["Unknown","Point","LineString","Polygon"];function Wd(e,r,t,n,i){var a=i.geometry,s=i.type,l=i.tags,f=i.id,d=e*Math.pow(2,n),_=e*r,b=e*t,T=Hd[s],M,P;function D(se){for(var Se=0;Se<se.length;Se++){var Ve=se[Se];if(Ve[3])break;var nt=180-(Ve[1]+b)*360/d,st=(Ve[0]+_)*360/d-180,at=360/Math.PI*Math.atan(Math.exp(nt*Math.PI/180))-90;se[Se]=[st,at,0,1]}}switch(s){case 1:var G=[];for(M=0;M<a.length;M++)G[M]=a[M][0];a=G,D(a);break;case 2:for(M=0;M<a.length;M++)D(a[M]);break;case 3:for(a=Hv(a),M=0;M<a.length;M++)for(P=0;P<a[M].length;P++)D(a[M][P]);break}a.length===1?a=a[0]:T="Multi"+T;var q={type:"Feature",geometry:{type:T,coordinates:a},properties:l,id:f,tileOrigin:[0,0],coord:""};return q}var W=function(){var e=(0,Ft.Z)(_e().mark(function r(t,n,i,a){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",new Promise(function(f){var d=n.getTile(t.z,t.x,t.y),_=d?d.features.map(function(M){return Wd(a,i.x,i.y,i.z,M)}):[],b={layers:{defaultLayer:{features:_}}},T=new qf(b,t.x,t.y,t.z);f(T)}));case 1:case"end":return l.stop()}},r)}));return function(t,n,i,a){return e.apply(this,arguments)}}();function Ce(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,H.Z)((0,H.Z)({},r),e.geojsonvtOptions)}function Ye(e,r){var t=Ce(r),n=t.extent||4096,i=Os(e,t),a=function(f,d){return W(d,i,f,n)},s=(0,H.Z)((0,H.Z)((0,H.Z)({},Jp),r),{},{getTileData:a});return{data:e,dataArray:[],tilesetOptions:s,isTile:!0}}function Kt(e,r){var t=r.extent,n=t===void 0?[121.168,30.2828,121.384,30.4219]:t,i=r.requestParameters,a=i===void 0?{}:i,s=new Promise(function(f){e instanceof HTMLImageElement||Mf(e)?f([e]):vr(e,a,function(d){f(d)})}),l={originData:e,images:s,_id:1,dataArray:[{_id:0,coordinates:[[n[0],n[1]],[n[2],n[3]]]}]};return l}function vr(e,r,t){var n=[];if(typeof e=="string")Oa((0,H.Z)((0,H.Z)({},r),{},{url:e}),function(s,l){l&&(n.push(l),t(n))});else{var i=e.length,a=0;e.forEach(function(s){Oa((0,H.Z)((0,H.Z)({},r),{},{url:s}),function(l,f){a++,f&&n.push(f),a===i&&t(n)})})}return Kt}var Jt=function(){var e=(0,Ft.Z)(_e().mark(function r(t,n,i,a){var s,l;return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return s={x:n.x,y:n.y,z:n.z},l=v(t,s),d.abrupt("return",new Promise(function(_){a?a(s,function(b,T){if(b||!T){var M={layers:{defaultLayer:{features:[]}}},P=new qf(M,n.x,n.y,n.z);_(P)}else{var D={layers:{defaultLayer:{features:T.features}}},G=new qf(D,n.x,n.y,n.z);_(G)}}):Qi((0,H.Z)((0,H.Z)({},i),{},{url:l}),function(b,T){if(b||!T){var M={layers:{defaultLayer:{features:[]}}},P=new qf(M,n.x,n.y,n.z);_(P)}else{var D=JSON.parse(T),G={layers:{defaultLayer:{features:D}}},q=new qf(G,n.x,n.y,n.z);_(q)}})}));case 3:case"end":return d.stop()}},r)}));return function(t,n,i,a){return e.apply(this,arguments)}}();function Ut(e,r){var t=function(a,s){return Jt(e,s,r==null?void 0:r.requestParameters,r.getCustomData)},n=(0,H.Z)((0,H.Z)({},r),{},{getTileData:t});return{dataArray:[],tilesetOptions:n,isTile:!0}}var Br=U(99996),Or=U(63713),Yr=U.n(Or),Nr=function(){function e(r,t,n,i){(0,Q.Z)(this,e),(0,F.Z)(this,"vectorLayerCache",{}),this.x=t,this.y=n,this.z=i,this.vectorTile=new Br.VectorTile(new(Yr())(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=[],a=0;a<n.length;a++){var s=n.feature(a),l=s.toGeoJSON(this.x,this.y,this.z);i.push((0,H.Z)((0,H.Z)({},l),{},{properties:(0,H.Z)({id:l.id},l.properties)}))}return this.vectorLayerCache[t]=i,i}},{key:"getFeatureById",value:function(){throw new Error("Method not implemented.")}}]),e}(),Wr={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0},tn=function(){var e=(0,Ft.Z)(_e().mark(function r(t,n,i,a,s){var l;return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return l=v(t,n),d.abrupt("return",new Promise(function(_){if(s)s({x:i.x,y:i.y,z:i.z},function(T,M){if(T||!M)_(void 0);else{var P=new Nr(M,i.x,i.y,i.z);_(P)}});else{var b=Ei((0,H.Z)((0,H.Z)({},a),{},{url:l}),function(T,M){if(T||!M)_(void 0);else{var P=new Nr(M,i.x,i.y,i.z);_(P)}});i.xhrCancel=function(){return b.cancel()}}}));case 2:case"end":return d.stop()}},r)}));return function(t,n,i,a,s){return e.apply(this,arguments)}}();function kr(e,r){var t=Array.isArray(e)?e[0]:e,n=function(s,l){return tn(t,s,l,r==null?void 0:r.requestParameters,r==null?void 0:r.getCustomData)},i=(0,H.Z)((0,H.Z)((0,H.Z)({},Wr),r),{},{getTileData:n});return{data:t,dataArray:[],tilesetOptions:i,isTile:!0}}function $r(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 Pt(e,r){for(var t=r[0],n=t.width,i=t.height,a=r.map(function(M){return M.rasterData}),s=n*i,l=[],f=JSON.stringify(e),d=0;d<s;d++){var _=JSON.parse(f),b=ur(_,a,d);if(typeof b=="number")l.push(b);else{var T=cn(_);l.push(T)}}return l}function ur(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(a){console.warn("Raster Data err!"),e[i]=0}break;default:ur(n,r,t)}})}function Ur(e){var r=(0,_n.Z)(e,3),t=r[0],n=r[1],i=n===void 0?-1:n,a=r[2],s=a===void 0?-1:a;if(t===void 0)return console.warn("Express err!"),["+",0,0];var l=t.replace(/\s+/g,"");return[l,i,s]}function cn(e){var r=Ur(e),t=r[0],n=r[1],i=r[2];return Array.isArray(n)&&(n=cn(e[1])),Array.isArray(i)&&(i=cn(e[2])),$r(t,n,i)}var Tr={nd:{type:"operation",expression:["/",["-",["band",1],["band",0]],["+",["band",1],["band",0]]]},rgb:{type:"function",method:pn}};function pn(e,r){for(var t=e[0].rasterData,n=e[1].rasterData,i=e[2].rasterData,a=[],s=(r==null?void 0:r.countCut)||[2,98],l=(0,_n.Z)(s,2),f=l[0],d=l[1],_=(r==null?void 0:r.RMinMax)||Ir(t,f,d),b=(r==null?void 0:r.GMinMax)||Ir(n,f,d),T=(r==null?void 0:r.BMinMax)||Ir(i,f,d),M=0;M<t.length;M++)a.push(Math.max(0,t[M]-_[0])),a.push(Math.max(0,n[M]-b[0])),a.push(Math.max(0,i[M]-T[0]));return{rasterData:a,rMinMax:_,gMinMax:b,bMinMax:T}}function Ir(e,r,t){var n=e.slice().sort(function(l,f){return l-f}),i=n.length,a=n[Math.ceil(i*r/100)],s=n[Math.ceil(i*t/100)];return[a,s]}function fn(e,r,t){return Ar.apply(this,arguments)}function Ar(){return Ar=(0,Ft.Z)(_e().mark(function e(r,t,n){var i,a,s,l,f,d;return _e().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,P=T.bands,D=P===void 0?[0]:P;return t(M,D)}));case 4:i=b.sent,a=[],i.forEach(function(T){Array.isArray(T)?a.push.apply(a,(0,Qt.Z)(T)):a.push(T)}),s=a[0],l=s.width,f=s.height,b.t0=(0,Hs.Z)(n),b.next=b.t0==="function"?11:b.t0==="object"?13:15;break;case 11:return d=n(a),b.abrupt("break",16);case 13:return Array.isArray(n)?d={rasterData:Pt(n,a)}:d=un(n,a),b.abrupt("break",16);case 15:d={rasterData:a[0].rasterData};case 16:return b.abrupt("return",(0,H.Z)((0,H.Z)({},d),{},{width:l,height:f}));case 17:case"end":return b.stop()}},e)})),Ar.apply(this,arguments)}function un(e,r){var t=Tr[e.type];if(t.type==="function")return t.method(r,e==null?void 0:e.options);if(t.type==="operation")return e.type==="rgb"?jn(t.expression,r):{rasterData:Pt(t.expression,r)}}function jn(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=Pt(e.r||["band",0],r),n=Pt(e.g||["band",0],r),i=Pt(e.b||["band",0],r);return[t,n,i]}function ai(e,r,t,n){return an.apply(this,arguments)}function an(){return an=(0,Ft.Z)(_e().mark(function e(r,t,n,i){var a;return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,fn(r,t,n);case 2:a=l.sent,i(null,{data:a});case 4:case"end":return l.stop()}},e)})),an.apply(this,arguments)}function Lr(e,r){var t=r.extent,n=r.width,i=r.height,a=r.min,s=r.max,l=r.format,f=r.operation,d,_,b;if(l===void 0||Lc(e))d=Array.from(e),_=n,b=i;else{var T=Array.isArray(e)?e:[e];d=fn(T,l,f)}var M={_id:1,dataArray:[{_id:1,data:d,width:_,height:b,min:a,max:s,coordinates:[[t[0],t[1]],[t[2],t[3]]]}]};return M}var xr=U(13351),er=U(14156),Ti=U(67754),Ke={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")},_i=U(25865),si=U.n(_i);function qn(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=qi(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function qi(e,r){if(e){if(typeof e=="string")return vo(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 vo(e,r)}}function vo(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 mo=30;function Ii(e){var r=e.characterSet,t=e.getFontWidth,n=e.fontHeight,i=e.buffer,a=e.maxCanvasWidth,s=e.mapping,l=s===void 0?{}:s,f=e.xOffset,d=f===void 0?0:f,_=e.yOffset,b=_===void 0?0:_,T=0,M=d;Array.from(r).forEach(function(D,G){if(!l[D]){var q=t(D,G);M+mo>a&&(M=0,T++),l[D]={x:M,y:b+T*mo,width:mo,height:mo,advance:q},M+=mo}});var P=n+i*2;return{mapping:l,xOffset:M,yOffset:b+T*P,canvasHeight:bo(b+(T+1)*P)}}function xo(e,r,t){var n=0,i=0,a=0,s=[],l={},f=qn(e),d;try{for(f.s();!(d=f.n()).done;){var _=d.value;if(!l[_.id]){var b=_.size;n+b+r>t&&(Aa(l,s,i),n=0,i=a+i+r,a=0,s=[]),s.push({icon:_,xOffset:n}),n=n+b+r,a=Math.max(a,b)}}}catch(M){f.e(M)}finally{f.f()}s.length>0&&Aa(l,s,i);var T=bo(a+i+r);return{mapping:l,canvasHeight:T}}function Aa(e,r,t){var n=qn(r),i;try{for(n.s();!(i=n.n()).done;){var a=i.value,s=a.icon,l=a.xOffset;e[s.id]=(0,H.Z)((0,H.Z)({},s),{},{x:l,y:t,image:s.image,width:s.width,height:s.height})}}catch(f){n.e(f)}finally{n.f()}}function bo(e){return Math.pow(2,Math.ceil(Math.log2(e)))}var Eo,Ga;function Fo(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ts(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function Ts(e,r){if(e){if(typeof e=="string")return So(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 So(e,r)}}function So(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 gi(e){var r=cs();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 ia=de(),Xn="sans-serif",Ri="normal",Xi=24,Ao=3,gl=.25,He=8,rr=1024,Ht=1,dn=1,xi=3,ya=null;function de(){for(var e=[],r=32;r<128;r++)e.push(String.fromCharCode(r));return e}function Oe(e,r,t,n){e.font="".concat(n," ").concat(t,"px ").concat(r),e.fillStyle="black",e.textBaseline="middle"}function $e(e,r){for(var t=0;t<e.length;t++)r.data[4*t+3]=e[t]}var Gt=(Eo=(0,er.b2)(),Eo(Ga=function(e){(0,Fe.Z)(t,e);var r=gi(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"fontAtlas",void 0),(0,F.Z)((0,Me.Z)(n),"iconFontMap",void 0),(0,F.Z)((0,Me.Z)(n),"iconFontGlyphs",{}),(0,F.Z)((0,Me.Z)(n),"fontOptions",void 0),(0,F.Z)((0,Me.Z)(n),"key",void 0),(0,F.Z)((0,Me.Z)(n),"cache",new Ff(xi)),n}return(0,j.Z)(t,[{key:"scale",get:function(){return dn}},{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 a=this.cache.get(i);return a&&a.data}},{key:"getMappingByKey",value:function(i){var a=this.cache.get(i);return a&&a.mapping||{}}},{key:"init",value:function(){this.cache.clear(),this.fontOptions={fontFamily:Xn,fontWeight:Ri,characterSet:ia,fontSize:Xi,buffer:Ao,sdf:!0,cutoff:gl,radius:He,iconfont:!1},this.key="",this.iconFontMap=new Map}},{key:"addIconGlyphs",value:function(i){var a=this;i.forEach(function(s){a.iconFontGlyphs[s.name]=s.unicode})}},{key:"addIconFont",value:function(i,a){this.iconFontMap.set(i,a)}},{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,H.Z)((0,H.Z)({},this.fontOptions),i),this.key=this.getKey();var a=this.getNewChars(this.key,this.fontOptions.characterSet),s=this.cache.get(this.key);if(!(s&&a.length===0)){var l=this.generateFontAtlas(this.key,a,s);this.fontAtlas=l,this.cache.set(this.key,l)}}},{key:"addFontFace",value:function(i,a){var s=this,l=document.createElement("style");l.type="text/css",l.innerText=`
|
|
@font-face{
|
|
font-family: '`.concat(i,`';
|
|
src: url('`).concat(a,`') format('woff2'),
|
|
url('`).concat(a,`') format('woff'),
|
|
url('`).concat(a,`') 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,a,s){var l=this.fontOptions,f=l.fontFamily,d=l.fontWeight,_=l.fontSize,b=l.buffer,T=l.sdf,M=l.radius,P=l.cutoff,D=l.iconfont,G=s&&s.data;G||(G=window.document.createElement("canvas"),G.width=rr);var q=G.getContext("2d",{willReadFrequently:!0});Oe(q,f,_,d);var se=Ii((0,H.Z)({getFontWidth:function(qs){return q.measureText(qs).width},fontHeight:_*dn,buffer:b,characterSet:a,maxCanvasWidth:rr},s&&{mapping:s.mapping,xOffset:s.xOffset,yOffset:s.yOffset})),Se=se.mapping,Ve=se.canvasHeight,nt=se.xOffset,st=se.yOffset,at=q.getImageData(0,0,G.width,G.height);if(G.height=Ve,q.putImageData(at,0,0),Oe(q,f,_,d),T){var At=new(si())(_,b,M,P,f,d),Wt=q.getImageData(0,0,At.size,At.size),Sr=Fo(a),_r;try{for(Sr.s();!(_r=Sr.n()).done;){var Gr=_r.value;if(D){var Cn=String.fromCharCode(parseInt(Gr.replace("&#x","").replace(";",""),16)),wi=At.draw(Cn);$e(wi,Wt)}else $e(At.draw(Gr),Wt);q.putImageData(Wt,Se[Gr].x,Se[Gr].y)}}catch(Uo){Sr.e(Uo)}finally{Sr.f()}}else{var la=Fo(a),co;try{for(la.s();!(co=la.n()).done;){var Yo=co.value;q.fillText(Yo,Se[Yo].x,Se[Yo].y+_*Ht)}}catch(Uo){la.e(Uo)}finally{la.f()}}return{xOffset:nt,yOffset:st,mapping:Se,data:G,width:G.width,height:G.height}}},{key:"getKey",value:function(){var i=this.fontOptions,a=i.fontFamily,s=i.fontWeight;return"".concat(a,"_").concat(s)}},{key:"getNewChars",value:function(i,a){var s=this.cache.get(i);if(!s)return a;var l=[],f=s.mapping,d=new Set(Object.keys(f)),_=new Set(a);return _.forEach(function(b){d.has(b)||l.push(b)}),l}}]),t}(Ka.EventEmitter))||Ga),Nt,ct;function yt(e){var r=xt();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function xt(){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 We=3,pt=1024,Ie=64,mt=(Nt=(0,er.b2)(),Nt(ct=function(e){(0,Fe.Z)(t,e);var r=yt(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"canvasHeight",128),(0,F.Z)((0,Me.Z)(n),"texture",void 0),(0,F.Z)((0,Me.Z)(n),"canvas",void 0),(0,F.Z)((0,Me.Z)(n),"iconData",void 0),(0,F.Z)((0,Me.Z)(n),"iconMap",void 0),(0,F.Z)((0,Me.Z)(n),"ctx",void 0),(0,F.Z)((0,Me.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,Ft.Z)(_e().mark(function a(s,l){var f,d;return _e().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:Ie}),this.updateIconMap(),b.next=6,this.loadImage(l);case 6:f=b.sent,d=this.iconData.find(function(T){return T.id===s}),d&&(d.image=f,d.width=f.width,d.height=f.height),this.update();case 10:case"end":return b.stop()}},a,this)}));function i(a,s){return n.apply(this,arguments)}return i}()},{key:"addImageMini",value:function(i,a,s){var l=this,f=s.getSceneConfig().canvas,d=f.createImage();if(this.loadingImageCount++,this.hasImage(i))throw new Error("Image Id already exists");this.iconData.push({id:i,size:Ie}),this.updateIconMap(),this.loadImageMini(a,f).then(function(_){d=_;var b=l.iconData.find(function(T){return T.id===i});b&&(b.image=d,b.width=d.width,b.height=d.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(a){return a.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(a,s){if(i instanceof HTMLImageElement){a(i);return}var l=new Image;l.crossOrigin="anonymous",l.onload=function(){a(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=pt,this.canvas.height=this.canvasHeight,Object.keys(this.iconMap).forEach(function(a){var s=i.iconMap[a],l=s.x,f=s.y,d=s.image,_=s.width,b=_===void 0?64:_,T=s.height,M=T===void 0?64:T,P=Math.max(b,M),D=P/Ie,G=M/D,q=b/D;d&&i.ctx.drawImage(d,l+(Ie-q)/2,f+(Ie-G)/2,q,G)})}},{key:"updateIconMap",value:function(){var i=xo(this.iconData,We,pt),a=i.mapping,s=i.canvasHeight;this.iconMap=a,this.canvasHeight=s}},{key:"loadImageMini",value:function(i,a){return new Promise(function(s,l){var f=a.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}(Ka.EventEmitter))||ct),Ct=U(39536),hr,Cr,Er=(hr=(0,er.b2)(),hr(Cr=function(){function e(){(0,Q.Z)(this,e),(0,F.Z)(this,"viewport",void 0),(0,F.Z)(this,"overridedViewProjectionMatrix",void 0),(0,F.Z)(this,"jitteredViewProjectionMatrix",void 0),(0,F.Z)(this,"jitteredProjectionMatrix",void 0),(0,F.Z)(this,"viewMatrixInverse",void 0),(0,F.Z)(this,"cameraPosition",void 0)}return(0,j.Z)(e,[{key:"init",value:function(){}},{key:"update",value:function(t){this.viewport=t,this.viewMatrixInverse=Ct.create(),Ct.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,_n.Z)(t,2),i=n[0],a=n[1];return[i,a]}},{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=Ct.fromTranslation(Ct.create(),[t,n,0]);this.jitteredProjectionMatrix=Ct.multiply(Ct.create(),i,this.viewport.getProjectionMatrix()),this.jitteredViewProjectionMatrix=Ct.multiply(Ct.create(),this.jitteredProjectionMatrix,this.viewport.getViewMatrix())}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0,this.jitteredViewProjectionMatrix=void 0}}]),e}())||Cr),wr=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}({}),On,Sn;function Tn(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=$n(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function $n(e,r){if(e){if(typeof e=="string")return ni(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 ni(e,r)}}function ni(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 aa={topleft:"column",topright:"column",bottomright:"column",bottomleft:"column",leftcenter:"column",rightcenter:"column",topcenter:"row",bottomcenter:"row",lefttop:"row",righttop:"row",leftbottom:"row",rightbottom:"row"},No=(On=(0,er.b2)(),On(Sn=function(){function e(){(0,Q.Z)(this,e),(0,F.Z)(this,"container",void 0),(0,F.Z)(this,"controlCorners",void 0),(0,F.Z)(this,"controlContainer",void 0),(0,F.Z)(this,"scene",void 0),(0,F.Z)(this,"mapsService",void 0),(0,F.Z)(this,"controls",[]),(0,F.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(Ke.IMapService),this.initControlPos()}},{key:"addControl",value:function(t,n){var i=n.get(Ke.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=Tn(this.controls),n;try{for(t.s();!(n=t.n()).done;){var i=n.value;i.remove()}}catch(a){t.e(a)}finally{t.f()}this.controls=[],this.clearControlPos()}},{key:"initControlPos",value:function(){var t=this.controlCorners={},n="l7-",i=this.controlContainer=Yi("div",n+"control-container",this.container);function a(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=l.map(function(d){return n+d}).join(" ");t[l.filter(function(d){return!["row","column"].includes(d)}).join("")]=Yi("div",f,i)}function s(l){var f=l.replace(/^(top|bottom|left|right|center)/,"$1-").split("-");return[].concat((0,Qt.Z)(f),[aa[l]])}Object.values(wr).forEach(function(l){a(s(l))}),this.checkCornerOverlap()}},{key:"clearControlPos",value:function(){for(var t in this.controlCorners)this.controlCorners[t]&&Ci(this.controlCorners[t]);this.controlContainer&&Ci(this.controlContainer)}},{key:"checkCornerOverlap",value:function(){var t=this,n=window.MutationObserver;if(n)for(var i=function(){var f=s[a],d=f.match(/^(top|bottom)(left|right)$/);if(d){var _=(0,_n.Z)(d,3),b=_[1],T=_[2],M=t.controlCorners["".concat(b).concat(T)],P=new n(function(D){var G=(0,_n.Z)(D,1),q=G[0].target;M&&(M.style[b]=q.clientHeight+"px")});P.observe(t.controlCorners["".concat(T).concat(b)],{childList:!0,attributes:!0})}},a=0,s=Object.keys(this.controlCorners);a<s.length;a++)i()}}]),e}())||Sn),$u,bp,Yu=($u=(0,er.b2)(),$u(bp=function(){function e(){(0,Q.Z)(this,e),(0,F.Z)(this,"container",void 0),(0,F.Z)(this,"scene",void 0),(0,F.Z)(this,"mapsService",void 0),(0,F.Z)(this,"markers",[]),(0,F.Z)(this,"markerLayers",[]),(0,F.Z)(this,"unAddMarkers",[]),(0,F.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(Ke.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}())||bp),ed,Ll,td=(ed=(0,er.b2)(),ed(Ll=function(){function e(){(0,Q.Z)(this,e),(0,F.Z)(this,"scene",void 0),(0,F.Z)(this,"mapsService",void 0),(0,F.Z)(this,"popups",[]),(0,F.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,Qt.Z)(this.popups),(0,Qt.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(Ke.IMapService)}}]),e}())||Ll),ff=function(e){return e.normal="normal",e.additive="additive",e.subtractive="subtractive",e.min="min",e.max="max",e.none="none",e}({}),Kf=function(e){return e.MULTIPLE="MULTIPLE",e.SINGLE="SINGLE",e}({}),rd=function(e){return e.AND="and",e.OR="or",e}({}),es=function(e){return e.INIT="init",e.UPDATE="update",e}({}),Dh={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"},Wv=Dh,Lh,Gv,jo=ui.merge,Xa={id:"map",logoPosition:"bottomleft",logoVisible:!0,antialias:!0,stencil:!0,preserveDrawingBuffer:!1,pickBufferScale:1,fitBoundsOptions:{animate:!1}},sg={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:rd.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},ug=(Lh=(0,er.b2)(),Lh(Gv=function(){function e(){(0,Q.Z)(this,e),(0,F.Z)(this,"sceneConfigCache",{}),(0,F.Z)(this,"layerConfigCache",{}),(0,F.Z)(this,"layerAttributeConfigCache",{})}return(0,j.Z)(e,[{key:"getSceneConfig",value:function(t){return this.sceneConfigCache[t]}},{key:"getSceneWarninfo",value:function(t){return Wv[t]}},{key:"setSceneConfig",value:function(t,n){this.sceneConfigCache[t]=(0,H.Z)((0,H.Z)({},Xa),n)}},{key:"getLayerConfig",value:function(t){return this.layerConfigCache[t]}},{key:"setLayerConfig",value:function(t,n,i){this.layerConfigCache[n]=(0,H.Z)({},jo({},this.sceneConfigCache[t],sg,i))}},{key:"getAttributeConfig",value:function(t){return this.layerAttributeConfigCache[t]}},{key:"setAttributeConfig",value:function(t,n){this.layerAttributeConfigCache[t]=(0,H.Z)((0,H.Z)({},this.layerAttributeConfigCache[t]),n)}},{key:"clean",value:function(){this.sceneConfigCache={},this.layerConfigCache={}}}]),e}())||Gv);function Di(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 Pi(e,r,t,n,i){var a={};return Object.keys(n).forEach(function(s){a[s]=n[s]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=t.slice().reverse().reduce(function(s,l){return l(e,r,s)||s},a),i&&a.initializer!==void 0&&(a.value=a.initializer?a.initializer.call(i):void 0,a.initializer=void 0),a.initializer===void 0&&(Object.defineProperty(e,r,a),a=null),a}var Bh=U(49953),nd=Math.PI/180,Fh=512,Qf=4003e4;function Xv(e){var r=e.latitude,t=r===void 0?0:r,n=e.zoom,i=n===void 0?0:n,a=e.scale,s=e.highPrecision,l=s===void 0?!1:s,f=e.flipY,d=f===void 0?!1:f;a=a!==void 0?a:Math.pow(2,i);var _={},b=Fh*a,T=Math.cos(t*nd),M=b/360,P=M/T,D=b/Qf/T;if(_.pixelsPerMeter=[D,-D,D],_.metersPerPixel=[1/D,-1/D,1/D],_.pixelsPerDegree=[M,-P,D],_.degreesPerPixel=[1/M,-1/P,1/D],l){var G=nd*Math.tan(t*nd)/T,q=M*G/2,se=b/Qf*G,Se=se/P*D;_.pixelsPerDegree2=[0,-q,se],_.pixelsPerMeter2=[Se,0,Se],d&&(_.pixelsPerDegree2[1]=-_.pixelsPerDegree2[1],_.pixelsPerMeter2[1]=-_.pixelsPerMeter2[1])}return d&&(_.pixelsPerMeter[1]=-_.pixelsPerMeter[1],_.metersPerPixel[1]=-_.metersPerPixel[1],_.pixelsPerDegree[1]=-_.pixelsPerDegree[1],_.degreesPerPixel[1]=-_.degreesPerPixel[1]),_}var to=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}({}),uc={CoordinateSystem:"u_CoordinateSystem",ViewportCenter:"u_ViewportCenter",ViewportCenterProjection:"u_ViewportCenterProjection",PixelsPerDegree:"u_PixelsPerDegree",PixelsPerDegree2:"u_PixelsPerDegree2",PixelsPerMeter:"u_PixelsPerMeter",Mvp:"u_Mvp"},Nc,id,ad,od,Nh,hf=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],lg=(Nc=(0,er.b2)(),id=(0,er.f3)(Ke.ICameraService),Nc(ad=(od=function(){function e(){(0,Q.Z)(this,e),(0,F.Z)(this,"needRefresh",!0),Di(this,"cameraService",Nh,this),(0,F.Z)(this,"coordinateSystem",void 0),(0,F.Z)(this,"viewportCenter",void 0),(0,F.Z)(this,"viewportCenterProjection",void 0),(0,F.Z)(this,"pixelsPerDegree",void 0),(0,F.Z)(this,"pixelsPerDegree2",void 0),(0,F.Z)(this,"pixelsPerMeter",void 0)}return(0,j.Z)(e,[{key:"refresh",value:function(t){var n=this.cameraService.getZoom(),i=this.cameraService.getZoomScale(),a=t||this.cameraService.getCenter(),s=Xv({latitude:a[1],zoom:n}),l=s.pixelsPerMeter,f=s.pixelsPerDegree;this.viewportCenter=a,this.viewportCenterProjection=[0,0,0,0],this.pixelsPerMeter=l,this.pixelsPerDegree=f,this.pixelsPerDegree2=[0,0,0],this.coordinateSystem===to.LNGLAT||this.coordinateSystem===to.P20?this.cameraService.setViewProjectionMatrix(void 0):this.coordinateSystem===to.LNGLAT_OFFSET?this.calculateLnglatOffset(a,n):this.coordinateSystem===to.P20_OFFSET&&this.calculateLnglatOffset(a,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,a){var s=Xv({latitude:t[1],zoom:n,scale:i,flipY:a,highPrecision:!0}),l=s.pixelsPerMeter,f=s.pixelsPerDegree,d=s.pixelsPerDegree2,_=this.cameraService.getViewMatrix(),b=this.cameraService.getProjectionMatrix(),T=Ct.multiply([],b,_),M=this.cameraService.projectFlat([Math.fround(t[0]),Math.fround(t[1])],Math.pow(2,n));this.viewportCenterProjection=Bh.fF([],[M[0],M[1],0,1],T),_=this.cameraService.getViewMatrixUncentered()||_,T=Ct.multiply([],b,_),T=Ct.multiply([],T,hf),this.cameraService.setViewProjectionMatrix(T),this.pixelsPerMeter=l,this.pixelsPerDegree=f,this.pixelsPerDegree2=d}}]),e}(),Nh=Pi(od.prototype,"cameraService",[id],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),od))||ad),$v,cg;function fs(e){var r=Jf();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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}}var fg=($v=(0,er.b2)(),$v(cg=function(e){(0,Fe.Z)(t,e);var r=fs(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"renderMap",new Map),(0,F.Z)((0,Me.Z)(n),"enable",!1),(0,F.Z)((0,Me.Z)(n),"renderEnable",!1),(0,F.Z)((0,Me.Z)(n),"cacheLogs",{}),n}return(0,j.Z)(t,[{key:"setEnable",value:function(i){this.enable=!!i}},{key:"log",value:function(i,a){var s=this;if(this.enable){var l=i.split("."),f=null;l.forEach(function(d,_){f!==null?(f[d]||(f[d]={}),_!==l.length-1&&(f=f[d])):(s.cacheLogs[d]||(s.cacheLogs[d]={}),_!==l.length-1&&(f=s.cacheLogs[d])),_===l.length-1&&(f[d]=(0,H.Z)((0,H.Z)({time:Date.now()},f[d]),a))})}}},{key:"getLog",value:function(i){var a=this;switch((0,Hs.Z)(i)){case"string":return this.cacheLogs[i];case"object":return i.map(function(s){return a.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?Ro():""}},{key:"renderDebug",value:function(i){this.renderEnable=i}},{key:"renderStart",value:function(i){if(!(!this.renderEnable||!this.enable)){var a=this.renderMap.get(i)||{};this.renderMap.set(i,(0,H.Z)((0,H.Z)({},a),{},{renderUid:i,renderStart:Date.now()}))}}},{key:"renderEnd",value:function(i){if(!(!this.renderEnable||!this.enable)){var a=this.renderMap.get(i);if(a){var s=a.renderStart,l=Date.now();this.emit("renderEnd",(0,H.Z)((0,H.Z)({},a),{},{renderEnd:l,renderDuration:l-s})),this.renderMap.delete(i)}}}},{key:"destroy",value:function(){this.cacheLogs=null,this.renderMap.clear()}}]),t}(Ka.EventEmitter))||cg),o=U(11553),u=U.n(o),c=function(e){return e.Hover="hover",e.Click="click",e.Select="select",e.Active="active",e.Drag="drag",e}({}),m,x,E,A,R;function L(e){var r=V();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function V(){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={panstart:"dragstart",panmove:"dragging",panend:"dragend",pancancel:"dragcancel"},K=(m=(0,er.b2)(),x=(0,er.f3)(Ke.IMapService),m(E=(A=function(e){(0,Fe.Z)(t,e);var r=L(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"indragging",!1),Di((0,Me.Z)(n),"mapService",R,(0,Me.Z)(n)),(0,F.Z)((0,Me.Z)(n),"hammertime",void 0),(0,F.Z)((0,Me.Z)(n),"lastClickTime",0),(0,F.Z)((0,Me.Z)(n),"lastClickXY",[-1,-1]),(0,F.Z)((0,Me.Z)(n),"clickTimer",void 0),(0,F.Z)((0,Me.Z)(n),"$containter",void 0),(0,F.Z)((0,Me.Z)(n),"onDrag",function(l){var f=n.interactionEvent(l);f.type=Y[f.type],f.type==="dragging"?n.indragging=!0:n.indragging=!1,n.emit(c.Drag,f)}),(0,F.Z)((0,Me.Z)(n),"onHammer",function(l){l.srcEvent.stopPropagation();var f=n.interactionEvent(l);n.emit(c.Hover,f)}),(0,F.Z)((0,Me.Z)(n),"onTouch",function(l){var f=l.touches[0];n.onHover({x:f.pageX,y:f.pageY,type:"touch"})}),(0,F.Z)((0,Me.Z)(n),"onHover",function(l){var f=l.clientX,d=l.clientY,_=f,b=d,T=l.type,M=n.mapService.getMapContainer();if(M){var P=M.getBoundingClientRect(),D=P.top,G=P.left;_=_-G-M.clientLeft,b=b-D-M.clientTop}var q=n.mapService.containerToLngLat([_,b]);if(T==="click"){n.isDoubleTap(_,b,q);return}if(T==="touch"){n.isDoubleTap(_,b,q);return}T!=="click"&&T!=="dblclick"&&n.emit(c.Hover,{x:_,y:b,lngLat:q,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(c.Hover)}},{key:"triggerHover",value:function(i){var a=i.x,s=i.y;this.emit(c.Hover,{x:a,y:s})}},{key:"triggerSelect",value:function(i){this.emit(c.Select,{featureId:i})}},{key:"triggerActive",value:function(i){this.emit(c.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 a=new(u()).Manager(i);a.add(new(u()).Tap({event:"dblclick",taps:2})),a.add(new(u()).Tap({event:"click"})),a.add(new(u()).Pan({threshold:0,pointers:0})),a.add(new(u()).Press({})),a.on("dblclick click",this.onHammer),a.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=a}}},{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 a=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 d=this.mapService.getMapContainer();if(d){var _=d.getBoundingClientRect(),b=_.top,T=_.left;l-=T,f-=b}var M=this.mapService.containerToLngLat([l,f]);return{x:l,y:f,lngLat:M,type:a,target:i.srcEvent}}},{key:"isDoubleTap",value:function(i,a,s){var l=this,f=new Date().getTime(),d="click";f-this.lastClickTime<400&&Math.abs(this.lastClickXY[0]-i)<10&&Math.abs(this.lastClickXY[1]-a)<10?(this.lastClickTime=0,this.lastClickXY=[-1,-1],this.clickTimer&&clearTimeout(this.clickTimer),d="dblclick",this.emit(c.Hover,{x:i,y:a,lngLat:s,type:d})):(this.lastClickTime=f,this.lastClickXY=[i,a],this.clickTimer=setTimeout(function(){d="click",l.emit(c.Hover,{x:i,y:a,lngLat:s,type:d})},400))}}]),t}(Zs()),R=Pi(A.prototype,"mapService",[x],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),A))||E),le=0;function ve(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(le++),t.classList.add("l7-scene"),r.appendChild(t),t}return null}function ze(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 a,s=Array.from(i.classList);if(s.includes("l7-marker")||s.includes("l7-popup")){t=!1;break}i=(a=i)===null||a===void 0?void 0:a.parentElement}return t}var I=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.RED=6403]="RED",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}({}),ht=function(e){return e[e.SAMPLED=0]="SAMPLED",e[e.RENDER_TARGET=1]="RENDER_TARGET",e}({}),Je,wt,Bt,nr,or,mr,Zr,qr,Nn,vn,Zn,mn,bi,ei=(Je=(0,er.b2)(),wt=(0,er.f3)(Ke.IMapService),Bt=(0,er.f3)(Ke.IRendererService),nr=(0,er.f3)(Ke.IGlobalConfigService),or=(0,er.f3)(Ke.IInteractionService),mr=(0,er.f3)(Ke.ILayerService),Je(Zr=(qr=function(){function e(){var r=this;(0,Q.Z)(this,e),(0,F.Z)(this,"pickedColors",void 0),(0,F.Z)(this,"pickedTileLayers",[]),Di(this,"mapService",Nn,this),Di(this,"rendererService",vn,this),Di(this,"configService",Zn,this),Di(this,"interactionService",mn,this),Di(this,"layerService",bi,this),(0,F.Z)(this,"pickingFBO",void 0),(0,F.Z)(this,"width",0),(0,F.Z)(this,"height",0),(0,F.Z)(this,"alreadyInPicking",!1),(0,F.Z)(this,"pickBufferScale",1),(0,F.Z)(this,"pickFromPickingFBO",function(t,n){var i=n.x,a=n.y,s=n.lngLat,l=n.type,f=n.target,d=!1,_=r.rendererService,b=_.readPixels,T=_.getContainer,M=r.getContainerSize(T()),P=M.width,D=M.height;P*=ua,D*=ua;var G=t.getLayerConfig(),q=G.enableHighlight,se=G.enableSelect,Se=i*ua,Ve=a*ua;if(Se>P-1*ua||Se<0||Ve>D-1*ua||Ve<0)return!1;var nt=b({x:Math.floor(Se/r.pickBufferScale),y:Math.floor((D-(a+1)*ua)/r.pickBufferScale),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:r.pickingFBO});if(r.pickedColors=nt,nt[0]!==0||nt[1]!==0||nt[2]!==0){var st=ka(nt),at=t.layerPickService.getFeatureById(st);st!==t.getCurrentPickId()&&l==="mousemove"&&(l="mouseenter");var At={x:i,y:a,type:l,lngLat:s,featureId:st,feature:at,target:f};at&&(d=!0,t.setCurrentPickId(st),r.triggerHoverOnLayer(t,At))}else{var Wt={x:i,y:a,lngLat:s,type:t.getCurrentPickId()!==null&&l==="mousemove"?"mouseout":"un"+l,featureId:null,target:f,feature:null};r.triggerHoverOnLayer(t,(0,H.Z)((0,H.Z)({},Wt),{},{type:"unpick"})),r.triggerHoverOnLayer(t,Wt),t.setCurrentPickId(null)}if(q&&t.layerPickService.highlightPickedFeature(nt),se&&l==="click"&&(nt==null?void 0:nt.toString())!==[0,0,0,0].toString()){var Sr=ka(nt);t.getCurrentSelectedId()===null||Sr!==t.getCurrentSelectedId()?(t.layerPickService.selectFeature(nt),t.setCurrentSelectedId(Sr)):(t.layerPickService.selectFeature(new Uint8Array([0,0,0,0])),t.setCurrentSelectedId(null))}return d})}return(0,j.Z)(e,[{key:"init",value:function(t){var n=this.rendererService,i=n.createTexture2D,a=n.createFramebuffer,s=n.getContainer,l=this.getContainerSize(s()),f=l.width,d=l.height;f*=ua,d*=ua,this.pickBufferScale=this.configService.getSceneConfig(t).pickBufferScale||1,f=Math.round(f/this.pickBufferScale),d=Math.round(d/this.pickBufferScale),this.pickingFBO=a({color:i({width:f,height:d,wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE,usage:ht.RENDER_TARGET}),depth:!0,width:f,height:d}),this.interactionService.on(c.Hover,this.pickingAllLayer.bind(this))}},{key:"boxPickLayer",value:function(){var r=(0,Ft.Z)(_e().mark(function n(i,a,s){var l=this,f,d,_;return _e().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:f=this.rendererService,d=f.useFramebuffer,_=f.clear,this.resizePickingFBO(),d(this.pickingFBO,function(){_({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,a);s(M)});case 3:case"end":return T.stop()}},n,this)}));function t(n,i,a){return r.apply(this,arguments)}return t}()},{key:"pickBox",value:function(t,n){var i=this,a=n.map(function(Sr){var _r=Sr<0?0:Sr;return Math.floor(_r*ua/i.pickBufferScale)}),s=(0,_n.Z)(a,4),l=s[0],f=s[1],d=s[2],_=s[3],b=this.rendererService,T=b.readPixels,M=b.getContainer,P=this.getContainerSize(M()),D=P.width,G=P.height;if(D*=ua,G*=ua,l>(D-1)*ua/this.pickBufferScale||d<0||f>(G-1)*ua/this.pickBufferScale||_<0)return[];for(var q=Math.min(D/this.pickBufferScale,d)-l,se=Math.min(G/this.pickBufferScale,_)-f,Se=T({x:l,y:Math.floor(G/this.pickBufferScale-(_+1)),width:q,height:se,data:new Uint8Array(q*se*4),framebuffer:this.pickingFBO}),Ve=[],nt={},st=0;st<Se.length/4;st=st+1){var at=Se.slice(st*4,st*4+4),At=ka(at);if(At!==-1&&!nt[At]){var Wt=t.layerPickService.getFeatureById(At);Ve.push((0,H.Z)((0,H.Z)({},Wt),{},{pickedFeatureIdx:At})),nt[At]=!0}}return Ve}},{key:"handleCursor",value:function(t,n){var i=t.getLayerConfig(),a=i.cursor,s=a===void 0?"":a,l=i.cursorEnabled;if(l){var f=this.mapService.version,d=f==="GAODE2.x"?this.mapService.getMapContainer():this.mapService.getMarkerContainer(),_=d==null?void 0:d.style.getPropertyValue("cursor");n==="unmousemove"&&_!==""?d==null||d.style.setProperty("cursor",""):n==="mousemove"&&(d==null||d.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/ua,height:t.height/ua}:t.getBoundingClientRect()}},{key:"pickingAllLayer",value:function(){var r=(0,Ft.Z)(_e().mark(function n(i){return _e().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,a=n.height;i*=ua,a*=ua,(this.width!==i||this.height!==a)&&(this.pickingFBO.resize({width:Math.round(i/this.pickBufferScale),height:Math.round(a/this.pickBufferScale)}),this.width=i,this.height=a)}},{key:"pickingLayers",value:function(){var r=(0,Ft.Z)(_e().mark(function n(i){var a=this,s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:s=this.rendererService.clear,this.resizePickingFBO(),this.rendererService.useFramebuffer(this.pickingFBO,function(){var d=a.layerService.getRenderList();d.filter(function(_){return _.needPick(i.type)}).reverse().some(function(_){s({framebuffer:a.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),_.layerPickService.pickRender(i);var b=a.pickFromPickingFBO(_,i);return a.layerService.pickedLayerId=b?+_.id:-1,b&&!_.getLayerConfig().enablePropagation})});case 3:case"end":return f.stop()}},n,this)}));function t(n){return r.apply(this,arguments)}return t}()},{key:"triggerHoverOnLayer",value:function(t,n){ze(n)&&(this.handleCursor(t,n.type),t.emit(n.type,n))}}]),e}(),Nn=Pi(qr.prototype,"mapService",[wt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vn=Pi(qr.prototype,"rendererService",[Bt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zn=Pi(qr.prototype,"configService",[nr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mn=Pi(qr.prototype,"interactionService",[or],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bi=Pi(qr.prototype,"layerService",[mr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qr))||Zr),Mn=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;(0,Q.Z)(this,e),(0,F.Z)(this,"autoStart",void 0),(0,F.Z)(this,"startTime",0),(0,F.Z)(this,"oldTime",0),(0,F.Z)(this,"running",!1),(0,F.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}(),Mi,mi,Hi,Hn,ea,Ta,so,ro,Fa;function $a(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=ts(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function ts(e,r){if(e){if(typeof e=="string")return Ho(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 Ho(e,r)}}function Ho(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 Gs(e){var r=hs();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 ks=ui.throttle,To=(Mi=(0,er.b2)(),mi=(0,er.f3)(Ke.IRendererService),Hi=(0,er.f3)(Ke.IMapService),Hn=(0,er.f3)(Ke.IDebugService),Mi(ea=(Ta=function(e){(0,Fe.Z)(t,e);var r=Gs(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"pickedLayerId",-1),(0,F.Z)((0,Me.Z)(n),"clock",new Mn),(0,F.Z)((0,Me.Z)(n),"alreadyInRendering",!1),(0,F.Z)((0,Me.Z)(n),"layers",[]),(0,F.Z)((0,Me.Z)(n),"layerList",[]),(0,F.Z)((0,Me.Z)(n),"layerRenderID",void 0),(0,F.Z)((0,Me.Z)(n),"sceneInited",!1),(0,F.Z)((0,Me.Z)(n),"animateInstanceCount",0),(0,F.Z)((0,Me.Z)(n),"shaderPicking",!0),(0,F.Z)((0,Me.Z)(n),"enableRender",!0),Di((0,Me.Z)(n),"renderService",so,(0,Me.Z)(n)),Di((0,Me.Z)(n),"mapService",ro,(0,Me.Z)(n)),Di((0,Me.Z)(n),"debugService",Fa,(0,Me.Z)(n)),(0,F.Z)((0,Me.Z)(n),"reRender",ks(function(){n.renderLayers()},32)),(0,F.Z)((0,Me.Z)(n),"throttleRenderLayers",ks(function(){n.renderLayers()},16)),n}return(0,j.Z)(t,[{key:"needPick",value:function(i){return this.layerList.some(function(a){return a.needPick(i)})}},{key:"add",value:function(i){var a=this;this.layers.push(i),this.sceneInited&&i.init().then(function(){a.renderLayers()})}},{key:"addMask",value:function(i){var a=this;this.sceneInited&&i.init().then(function(){a.renderLayers()})}},{key:"initLayers",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s=this;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:this.sceneInited=!0,this.layers.forEach(function(){var d=(0,Ft.Z)(_e().mark(function _(b){return _e().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()}},_)}));return function(_){return d.apply(this,arguments)}}());case 2:case"end":return f.stop()}},a,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(a){return a.id===i})}},{key:"getLayerByName",value:function(i){return this.layers.find(function(a){return a.name===i})}},{key:"remove",value:function(){var n=(0,Ft.Z)(_e().mark(function a(s,l){var f,d;return _e().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:l?(f=l.layerChildren.indexOf(s),f>-1&&l.layerChildren.splice(f,1)):(d=this.layers.indexOf(s),d>-1&&this.layers.splice(d,1)),s.destroy(),this.reRender(),this.emit("layerChange",this.layers);case 4:case"end":return b.stop()}},a,this)}));function i(a,s){return n.apply(this,arguments)}return i}()},{key:"removeAllLayers",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:this.destroy(),this.reRender();case 2:case"end":return l.stop()}},a,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,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b,T,M,P;return _e().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:if(!(this.alreadyInRendering||!this.enableRender)){G.next=2;break}return G.abrupt("return");case 2:this.updateLayerRenderList(),s=this.debugService.generateRenderUid(),this.debugService.renderStart(s),this.alreadyInRendering=!0,this.clear(),l=$a(this.layerList);try{for(l.s();!(f=l.n()).done;)d=f.value,d.prerender()}catch(q){l.e(q)}finally{l.f()}this.renderService.beginFrame(),_=$a(this.layerList),G.prev=11,_.s();case 13:if((b=_.n()).done){G.next=25;break}if(T=b.value,M=T.getLayerConfig(),P=M.enableMask,T.masks.filter(function(q){return q.inited}).length>0&&P&&this.renderMask(T.masks),!T.getLayerConfig().enableMultiPassRenderer){G.next=22;break}return G.next=20,T.renderMultiPass();case 20:G.next=23;break;case 22:T.render();case 23:G.next=13;break;case 25:G.next=30;break;case 27:G.prev=27,G.t0=G.catch(11),_.e(G.t0);case 30:return G.prev=30,_.f(),G.finish(30);case 33:this.renderService.endFrame(),this.debugService.renderEnd(s),this.alreadyInRendering=!1;case 36:case"end":return G.stop()}},a,this,[[11,27,30,33]])}));function i(){return n.apply(this,arguments)}return i}()},{key:"renderMask",value:function(i){var a=0;this.renderService.clear({stencil:0,depth:1,framebuffer:null});var s=i.length>1?Kf.MULTIPLE:Kf.SINGLE,l=$a(i),f;try{for(l.s();!(f=l.n()).done;){var d=f.value;d.render({isStencil:!0,stencilType:s,stencilIndex:a++})}}catch(_){l.e(_)}finally{l.f()}}},{key:"beforeRenderData",value:function(){var n=(0,Ft.Z)(_e().mark(function a(s){var l;return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,s.hooks.beforeRenderData.promise();case 2:l=d.sent,l&&this.renderLayers();case 4:case"end":return d.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"renderTileLayerMask",value:function(i){var a=0,s=i.getLayerConfig(),l=s.enableMask,f=l===void 0?!0:l,d=i.tileMask?1:0,_=i.masks.filter(function(D){return D.inited});d=d+(f?_.length:1);var b=d>1?Kf.MULTIPLE:Kf.SINGLE;if((i.tileMask||_.length&&f)&&this.renderService.clear({stencil:0,depth:1,framebuffer:null}),_.length&&f){var T=$a(_),M;try{for(T.s();!(M=T.n()).done;){var P=M.value;P.render({isStencil:!0,stencilType:b,stencilIndex:a++})}}catch(D){T.e(D)}finally{T.f()}}i.tileMask&&i.tileMask.render({isStencil:!0,stencilType:b,stencilIndex:a++,stencilOperation:rd.OR})}},{key:"renderTileLayer",value:function(){var n=(0,Ft.Z)(_e().mark(function a(s){return _e().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()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"updateLayerRenderList",value:function(){var i=this;this.layerList=[],this.layers.filter(function(a){return a.inited}).filter(function(a){return a.isVisible()}).sort(function(a,s){return a.zIndex-s.zIndex}).forEach(function(a){i.layerList.push(a)})}},{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=vi(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}(Ka.EventEmitter),so=Pi(Ta.prototype,"renderService",[mi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ro=Pi(Ta.prototype,"mapService",[Hi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fa=Pi(Ta.prototype,"debugService",[Hn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ta))||ea),wa=U(56929),Ni=ui.isNil,Ca=function(){function e(r){var t=this;(0,Q.Z)(this,e),(0,F.Z)(this,"name",void 0),(0,F.Z)(this,"type",void 0),(0,F.Z)(this,"scale",void 0),(0,F.Z)(this,"descriptor",void 0),(0,F.Z)(this,"featureBufferLayout",[]),(0,F.Z)(this,"needRescale",!1),(0,F.Z)(this,"needRemapping",!1),(0,F.Z)(this,"needRegenerateVertices",!1),(0,F.Z)(this,"featureRange",{startIndex:0,endIndex:1/0}),(0,F.Z)(this,"vertexAttribute",void 0),(0,F.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(a,s){var l,f=(l=t.scale)===null||l===void 0?void 0:l.scalers[s].func,d=f(a);return d})}),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,a=(i=this.scale)===null||i===void 0?void 0:i.callback.apply(i,(0,Qt.Z)(t));if(!Ni(a))return[a]}return this.defaultCallback(t)}},{key:"resetDescriptor",value:function(){this.descriptor&&(this.descriptor.buffer.data=[])}}]),e}(),da=["buffer","update","name"],Ki=["buffer","update","name"],ps,ws,Da,wo,ds,ta,Uc=(ps={},(0,F.Z)(ps,I.FLOAT,4),(0,F.Z)(ps,I.UNSIGNED_BYTE,1),(0,F.Z)(ps,I.UNSIGNED_SHORT,2),ps),qu=(ws=(0,er.b2)(),Da=(0,er.f3)(Ke.IRendererService),ws(wo=(ds=function(){function e(){(0,Q.Z)(this,e),(0,F.Z)(this,"attributesAndIndices",void 0),Di(this,"rendererService",ta,this),(0,F.Z)(this,"attributes",[]),(0,F.Z)(this,"triangulation",void 0),(0,F.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 Ca(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,a=n.name,s=(i=n.scale)===null||i===void 0?void 0:i.field;(t[a]||s&&t[s])&&(n.needRescale=!0,n.needRemapping=!0,n.needRegenerateVertices=!0)})}},{key:"updateStyleAttribute",value:function(t,n,i){var a=this.getLayerStyleAttribute(t);a||(a=this.registerStyleAttribute((0,H.Z)((0,H.Z)({},n),{},{name:t})));var s=n.scale;s&&a&&(a.scale=s,a.needRescale=!0,a.needRemapping=!0,a.needRegenerateVertices=!0,i&&i.featureRange&&(a.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),a=i==null||(n=i.scale)===null||n===void 0?void 0:n.scalers;return a&&a[0]?a[0].func:null}},{key:"updateAttributeByFeatureRange",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,l=this.attributes.find(function(nt){return nt.name===t});if(l&&l.descriptor){var f=l.descriptor,d=f.update,_=f.buffer,b=f.size,T=b===void 0?0:b,M=Uc[_.type||I.FLOAT];if(d){var P=this.featureLayout,D=P.elements,G=P.sizePerElement,q=D.slice(i,a);if(!q.length)return;var se=q[0].offset,Se=se*T*M,Ve=q.map(function(nt,st){for(var at=nt.featureIdx,At=nt.vertices,Wt=nt.normals,Sr=At.length/G,_r=[],Gr=0;Gr<Sr;Gr++){var Cn=Wt?Wt.slice(Gr*3,Gr*3+3):[];_r.push.apply(_r,(0,Qt.Z)(d(n[at],at,At.slice(Gr*G,Gr*G+G),st,Cn)))}return _r}).flat();l.vertexAttribute.updateBuffer({data:Ve,offset:Se}),s==null||s.emit("legend:".concat(t),{type:t,attr:l})}}}},{key:"createAttributesAndIndices",value:function(t,n,i){var a=this;this.featureLayout={sizePerElement:0,elements:[]},n&&(this.triangulation=n);var s=this.attributes.map(function(q){return q.resetDescriptor(),q.descriptor}),l=0,f=0,d=[],_=3;t.forEach(function(q,se){var Se=a.triangulation(q,i),Ve=Se.indices,nt=Se.vertices,st=Se.normals,at=Se.size,At=Se.indexes,Wt=Se.count;typeof Wt=="number"&&(f+=Wt),Ve.forEach(function(Cn){d.push(Cn+l)}),_=at;var Sr=nt.length/at;a.featureLayout.sizePerElement=_,a.featureLayout.elements.push({featureIdx:se,vertices:nt,normals:st,offset:l}),l+=Sr;for(var _r=function(wi){var la=(st==null?void 0:st.slice(wi*3,wi*3+3))||[],co=nt.slice(wi*at,wi*at+at),Yo=0;At&&At[wi]!==void 0&&(Yo=At[wi]),s.forEach(function(Uo,qs){if(Uo&&Uo.update){var bl;(bl=Uo.buffer.data).push.apply(bl,(0,Qt.Z)(Uo.update(q,se,co,wi,la,Yo)))}})},Gr=0;Gr<Sr;Gr++)_r(Gr)});var b=this.rendererService,T=b.createAttribute,M=b.createBuffer,P=b.createElements,D={};s.forEach(function(q,se){if(q){var Se=q.buffer,Ve=q.update,nt=q.name,st=(0,wa.Z)(q,da),at=T((0,H.Z)({buffer:M(Se)},st));D[q.name||""]=at,a.attributes[se].vertexAttribute=at}});var G=P({data:d,type:I.UNSIGNED_INT,count:d.length});return this.attributesAndIndices={attributes:D,elements:G,count:f},this.attributesAndIndices}},{key:"createAttributes",value:function(t,n){var i=this;this.featureLayout={sizePerElement:0,elements:[]},n&&(this.triangulation=n);var a=this.attributes.map(function(M){return M.resetDescriptor(),M.descriptor}),s=0,l=[],f=3;t.forEach(function(M,P){var D=i.triangulation(M),G=D.indices,q=D.vertices,se=D.normals,Se=D.size,Ve=D.indexes;G.forEach(function(At){l.push(At+s)}),f=Se;var nt=q.length/Se;i.featureLayout.sizePerElement=f,i.featureLayout.elements.push({featureIdx:P,vertices:q,normals:se,offset:s}),s+=nt;for(var st=function(Wt){var Sr=(se==null?void 0:se.slice(Wt*3,Wt*3+3))||[],_r=q.slice(Wt*Se,Wt*Se+Se),Gr=0;Ve&&Ve[Wt]!==void 0&&(Gr=Ve[Wt]),a.forEach(function(Cn,wi){if(Cn&&Cn.update){var la;(la=Cn.buffer.data).push.apply(la,(0,Qt.Z)(Cn.update(M,P,_r,Wt,Sr,Gr)))}})},at=0;at<nt;at++)st(at)});var d=this.rendererService,_=d.createAttribute,b=d.createBuffer,T={};return a.forEach(function(M,P){if(M){var D=M.buffer,G=M.update,q=M.name,se=(0,wa.Z)(M,Ki),Se=_((0,H.Z)({buffer:b(D)},se));T[M.name||""]=Se,i.attributes[P].vertexAttribute=Se}}),{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}(),ta=Pi(ds.prototype,"rendererService",[Da],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ds))||wo),Bl=U(14224);function uo(e,r,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function l(_){try{d(n.next(_))}catch(b){s(b)}}function f(_){try{d(n.throw(_))}catch(b){s(b)}}function d(_){_.done?a(_.value):i(_.value).then(l,f)}d((n=n.apply(e,r||[])).next())})}function Fl(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(d){return function(_){return f([d,_])}}function f(d){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=d[0]&2?i.return:d[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,d[1])).done)return a;switch(i=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,i=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]<a[3])){t.label=d[1];break}if(d[0]===6&&t.label<a[1]){t.label=a[1],a=d;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(d);break}a[2]&&t.ops.pop(),t.trys.pop();continue}d=r.call(e,t)}catch(_){d=[6,_],i=0}finally{n=a=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Cu(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var n=t.call(e),i,a=[],s;try{for(;(r===void 0||r-- >0)&&!(i=n.next()).done;)a.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 a}function pf(e,r,t){if(t||arguments.length===2)for(var n=0,i=r.length,a;n<i;n++)(a||!(n in r))&&(a||(a=Array.prototype.slice.call(r,0,n)),a[n]=r[n]);return e.concat(a||Array.prototype.slice.call(r))}function df(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eh={exports:{}},Nl={exports:{}},zc={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})(zc,zc.exports);var nu={},th={exports:{}},Uh={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 a=n.pop();return t.call(this,n,a)}},e.exports=r.default})(Uh,Uh.exports);var lc={};Object.defineProperty(lc,"__esModule",{value:!0}),lc.fallback=zh,lc.wrap=mf;var Gd=lc.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,vf=lc.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,sd=lc.hasNextTick=typeof Bl=="object"&&typeof Bl.nextTick=="function";function zh(e){setTimeout(e,0)}function mf(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 Zc;Gd?Zc=queueMicrotask:vf?Zc=setImmediate:sd?Zc=Bl.nextTick:Zc=zh,lc.default=mf(Zc),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=f;var t=Uh.exports,n=l(t),i=lc,a=l(i),s=nu;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 P=T.pop(),D=b.apply(this,T);return d(D,P)}:(0,n.default)(function(T,M){var P;try{P=b.apply(this,T)}catch(D){return M(D)}if(P&&typeof P.then=="function")return d(P,M);M(null,P)})}function d(b,T){return b.then(function(M){_(T,null,M)},function(M){_(T,M&&M.message?M:new Error(M))})}function _(b,T,M){try{b(T,M)}catch(P){(0,a.default)(function(D){throw D},P)}}e.exports=r.default}(th,th.exports),Object.defineProperty(nu,"__esModule",{value:!0}),nu.isAsyncIterable=nu.isAsyncGenerator=nu.isAsync=void 0;var Xd=th.exports,$d=ud(Xd);function ud(e){return e&&e.__esModule?e:{default:e}}function Ep(e){return e[Symbol.toStringTag]==="AsyncFunction"}function Yd(e){return e[Symbol.toStringTag]==="AsyncGenerator"}function ld(e){return typeof e[Symbol.asyncIterator]=="function"}function cd(e){if(typeof e!="function")throw new Error("expected a function");return Ep(e)?(0,$d.default)(e):e}nu.default=cd,nu.isAsync=Ep,nu.isAsyncGenerator=Yd,nu.isAsyncIterable=ld;var cc={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 a(){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(d,_){l[i-1]=function(b){for(var T=[],M=arguments.length-1;M-- >0;)T[M]=arguments[M+1];if(b)return _(b);d(T.length>1?T:T[0])},n.apply(s,l)})}return a}e.exports=r.default})(cc,cc.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=zc.exports,n=f(t),i=nu,a=f(i),s=cc.exports,l=f(s);function f(d){return d&&d.__esModule?d:{default:d}}r.default=(0,l.default)(function(d,_,b){var T=(0,n.default)(_)?[]:{};d(_,function(M,P,D){(0,a.default)(M)(function(G){for(var q,se=[],Se=arguments.length-1;Se-- >0;)se[Se]=arguments[Se+1];se.length<2&&(q=se,se=q[0]),T[P]=se,D(G)})},function(M){return b(M,T)})},3),e.exports=r.default}(Nl,Nl.exports);var Sp={exports:{}},gf={exports:{}},Ap={exports:{}},Vc={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=t;function t(n){function i(){for(var a=[],s=arguments.length;s--;)a[s]=arguments[s];if(n!==null){var l=n;n=null,l.apply(this,a)}}return Object.assign(i,n),i}e.exports=r.default})(Vc,Vc.exports);var Zh={exports:{}},yf={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})(yf,yf.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=_;var t=zc.exports,n=s(t),i=yf.exports,a=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 P=b.next();return P.done?null:(T++,{value:P.value,key:T})}}function d(b){var T=b?Object.keys(b):[],M=-1,P=T.length;return function D(){var G=T[++M];return G==="__proto__"?D():M<P?{value:b[G],key:G}:null}}function _(b){if((0,n.default)(b))return l(b);var T=(0,a.default)(b);return T?f(T):d(b)}e.exports=r.default}(Zh,Zh.exports);var _f={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=t;function t(n){return function(){for(var i=[],a=arguments.length;a--;)i[a]=arguments[a];if(n===null)throw new Error("Callback was already called.");var s=n;n=null,s.apply(this,i)}}e.exports=r.default})(_f,_f.exports);var rh={exports:{}},Vh={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t={};r.default=t,e.exports=r.default})(Vh,Vh.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=a;var t=Vh.exports,n=i(t);function i(s){return s&&s.__esModule?s:{default:s}}function a(s,l,f,d){var _=!1,b=!1,T=!1,M=0,P=0;function D(){M>=l||T||_||(T=!0,s.next().then(function(se){var Se=se.value,Ve=se.done;if(!(b||_)){if(T=!1,Ve){_=!0,M<=0&&d(null);return}M++,f(Se,P,G),P++,D()}}).catch(q))}function G(se,Se){if(M-=1,!b){if(se)return q(se);if(se===!1){_=!0,b=!0;return}if(Se===n.default||_&&M<=0)return _=!0,d(null);D()}}function q(se){b||(T=!1,_=!0,d(se))}D()}e.exports=r.default}(rh,rh.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=Vc.exports,n=M(t),i=Zh.exports,a=M(i),s=_f.exports,l=M(s),f=nu,d=rh.exports,_=M(d),b=Vh.exports,T=M(b);function M(P){return P&&P.__esModule?P:{default:P}}r.default=function(P){return function(D,G,q){if(q=(0,n.default)(q),P<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!D)return q(null);if((0,f.isAsyncGenerator)(D))return(0,_.default)(D,P,G,q);if((0,f.isAsyncIterable)(D))return(0,_.default)(D[Symbol.asyncIterator](),P,G,q);var se=(0,a.default)(D),Se=!1,Ve=!1,nt=0,st=!1;function at(Wt,Sr){if(!Ve)if(nt-=1,Wt)Se=!0,q(Wt);else if(Wt===!1)Se=!0,Ve=!0;else{if(Sr===T.default||Se&&nt<=0)return Se=!0,q(null);st||At()}}function At(){for(st=!0;nt<P&&!Se;){var Wt=se();if(Wt===null){Se=!0,nt<=0&&q(null);return}nt+=1,G(Wt.value,Wt.key,(0,l.default)(at))}st=!1}At()}},e.exports=r.default}(Ap,Ap.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=Ap.exports,n=f(t),i=nu,a=f(i),s=cc.exports,l=f(s);function f(_){return _&&_.__esModule?_:{default:_}}function d(_,b,T,M){return(0,n.default)(b)(_,(0,a.default)(T),M)}r.default=(0,l.default)(d,4),e.exports=r.default}(gf,gf.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=gf.exports,n=s(t),i=cc.exports,a=s(i);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,d,_){return(0,n.default)(f,1,d,_)}r.default=(0,a.default)(l,3),e.exports=r.default}(Sp,Sp.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=l;var t=Nl.exports,n=s(t),i=Sp.exports,a=s(i);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,d){return(0,n.default)(a.default,f,d)}e.exports=r.default}(eh,eh.exports);var fd=df(eh.exports),Ul=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,fd(this.tasks)},e.prototype.tap=function(r,t){var n=this;this.tasks.push(function(i){t.apply(void 0,pf([],Cu(n.args),!1)),i(null,r)})},e}(),qd={exports:{}},hd={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=zc.exports,n=G(t),i=Vh.exports,a=G(i),s=gf.exports,l=G(s),f=Vc.exports,d=G(f),_=_f.exports,b=G(_),T=nu,M=G(T),P=cc.exports,D=G(P);function G(Ve){return Ve&&Ve.__esModule?Ve:{default:Ve}}function q(Ve,nt,st){st=(0,d.default)(st);var at=0,At=0,Wt=Ve.length,Sr=!1;Wt===0&&st(null);function _r(Gr,Cn){Gr===!1&&(Sr=!0),Sr!==!0&&(Gr?st(Gr):(++At===Wt||Cn===a.default)&&st(null))}for(;at<Wt;at++)nt(Ve[at],at,(0,b.default)(_r))}function se(Ve,nt,st){return(0,l.default)(Ve,1/0,nt,st)}function Se(Ve,nt,st){var at=(0,n.default)(Ve)?q:se;return at(Ve,(0,M.default)(nt),st)}r.default=(0,D.default)(Se,3),e.exports=r.default})(hd,hd.exports),function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=l;var t=hd.exports,n=s(t),i=Nl.exports,a=s(i);function s(f){return f&&f.__esModule?f:{default:f}}function l(f,d){return(0,a.default)(n.default,f,d)}e.exports=r.default}(qd,qd.exports);var w0=df(qd.exports),Kd=function(){function e(){this.tasks=[]}return e.prototype.promise=function(){return w0(this.tasks)},e.prototype.tapPromise=function(r,t){var n=this;this.tasks.push(function(i){return uo(n,void 0,void 0,function(){return Fl(this,function(a){switch(a.label){case 0:return[4,t()];case 1:return a.sent(),i(null,r),[2]}})})})},e}(),lo={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=Vc.exports,n=_(t),i=_f.exports,a=_(i),s=nu,l=_(s),f=cc.exports,d=_(f);function _(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 P=0;function D(q){var se=(0,l.default)(T[P++]);se.apply(void 0,q.concat([(0,a.default)(G)]))}function G(q){for(var se=[],Se=arguments.length-1;Se-- >0;)se[Se]=arguments[Se+1];if(q!==!1){if(q||P===T.length)return M.apply(void 0,[q].concat(se));D(se)}}D([])}r.default=(0,d.default)(b),e.exports=r.default})(lo,lo.exports);var zl=df(lo.exports),Vy=function(){function e(){this.tasks=[]}return e.prototype.call=function(){return zl(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 a=t.apply(void 0,pf([],Cu(n),!1));i(a?null:!1,r)})},e}(),xf=function(){function e(){this.tasks=[]}return e.prototype.call=function(){return fd(this.tasks)},e.prototype.tap=function(r,t){this.tasks.push(function(n){var i=t();n(i,r)})},e}(),Yv=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,fd(this.tasks)},e.prototype.tapPromise=function(r,t){var n=this;this.tasks.push(function(i){return uo(n,void 0,void 0,function(){return Fl(this,function(a){switch(a.label){case 0:return[4,t.apply(void 0,pf([],Cu(this.args),!1))];case 1:return a.sent(),i(null,r),[2]}})})})},e}(),hg=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,fd(this.tasks)},e.prototype.tapPromise=function(r,t){var n=this;this.tasks.push(function(i){return uo(n,void 0,void 0,function(){var a;return Fl(this,function(s){switch(s.label){case 0:return[4,t.apply(void 0,pf([],Cu(this.args),!1))];case 1:return a=s.sent(),i(a,r),[2]}})})})},e}(),Qd=function(){function e(){this.tasks=[]}return e.prototype.promise=function(){return zl(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(a){i(null,a)})})},e}(),fc=U(31204),Jd=U.n(fc),Tp,pd,dd,ev,qv,wp,Kv,Qv,Jv,em,tm,Ru,vd,rm,hc,pg,nm,nh,Wo,jh,Hh,Wh,im,am,om,sm,tv,rv,jc,um,nv,iv,lm,av,cm;function dg(e){var r=fm();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 vg=(Tp=(0,er.b2)(),pd=(0,er.f3)(Ke.SceneID),dd=(0,er.f3)(Ke.IIconService),ev=(0,er.f3)(Ke.IFontService),qv=(0,er.f3)(Ke.IControlService),wp=(0,er.f3)(Ke.IGlobalConfigService),Kv=(0,er.f3)(Ke.IMapService),Qv=(0,er.f3)(Ke.ICoordinateSystemService),Jv=(0,er.f3)(Ke.IRendererService),em=(0,er.f3)(Ke.ILayerService),tm=(0,er.f3)(Ke.IDebugService),Ru=(0,er.f3)(Ke.ICameraService),vd=(0,er.f3)(Ke.IInteractionService),rm=(0,er.f3)(Ke.IPickingService),hc=(0,er.f3)(Ke.IShaderModuleService),pg=(0,er.f3)(Ke.IMarkerService),nm=(0,er.f3)(Ke.IPopupService),Tp(nh=(Wo=function(e){(0,Fe.Z)(t,e);var r=dg(t);function t(){var n;return(0,Q.Z)(this,t),n=r.call(this),(0,F.Z)((0,Me.Z)(n),"destroyed",!1),(0,F.Z)((0,Me.Z)(n),"loaded",!1),Di((0,Me.Z)(n),"id",jh,(0,Me.Z)(n)),Di((0,Me.Z)(n),"iconService",Hh,(0,Me.Z)(n)),Di((0,Me.Z)(n),"fontService",Wh,(0,Me.Z)(n)),Di((0,Me.Z)(n),"controlService",im,(0,Me.Z)(n)),Di((0,Me.Z)(n),"configService",am,(0,Me.Z)(n)),Di((0,Me.Z)(n),"map",om,(0,Me.Z)(n)),Di((0,Me.Z)(n),"coordinateSystemService",sm,(0,Me.Z)(n)),Di((0,Me.Z)(n),"rendererService",tv,(0,Me.Z)(n)),Di((0,Me.Z)(n),"layerService",rv,(0,Me.Z)(n)),Di((0,Me.Z)(n),"debugService",jc,(0,Me.Z)(n)),Di((0,Me.Z)(n),"cameraService",um,(0,Me.Z)(n)),Di((0,Me.Z)(n),"interactionService",nv,(0,Me.Z)(n)),Di((0,Me.Z)(n),"pickingService",iv,(0,Me.Z)(n)),Di((0,Me.Z)(n),"shaderModuleService",lm,(0,Me.Z)(n)),Di((0,Me.Z)(n),"markerService",av,(0,Me.Z)(n)),Di((0,Me.Z)(n),"popupService",cm,(0,Me.Z)(n)),(0,F.Z)((0,Me.Z)(n),"inited",!1),(0,F.Z)((0,Me.Z)(n),"initPromise",void 0),(0,F.Z)((0,Me.Z)(n),"rendering",!1),(0,F.Z)((0,Me.Z)(n),"$container",void 0),(0,F.Z)((0,Me.Z)(n),"canvas",void 0),(0,F.Z)((0,Me.Z)(n),"markerContainer",void 0),(0,F.Z)((0,Me.Z)(n),"hooks",void 0),(0,F.Z)((0,Me.Z)(n),"handleWindowResized",function(){n.emit("resize"),n.$container&&(n.initContainer(),Cl(),n.coordinateSystemService.needRefresh=!0,n.render())}),(0,F.Z)((0,Me.Z)(n),"handleMapCameraChanged",function(i){n.cameraService.update(i),n.render()}),n.hooks={init:new Yv},n}return(0,j.Z)(t,[{key:"init",value:function(i){var a=this;this.configService.setSceneConfig(this.id,i),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.iconService.on("imageUpdate",function(){return a.render()}),this.fontService.init(),this.hooks.init.tapPromise("initMap",(0,Ft.Z)(_e().mark(function s(){return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return a.debugService.log("map.mapInitStart",{type:a.map.version}),f.next=3,new Promise(function(d){a.map.onCameraChanged(function(_){a.cameraService.init(),a.cameraService.update(_),d()}),a.map.init()});case 3:a.map.onCameraChanged(a.handleMapCameraChanged),a.map.addMarkerContainer(),a.markerService.addMarkers(),a.markerService.addMarkerLayers(),a.popupService.initPopup(),a.interactionService.init(),a.interactionService.on(c.Drag,a.addSceneEvent.bind(a));case 10:case"end":return f.stop()}},s)}))),this.hooks.init.tapPromise("initRenderer",(0,Ft.Z)(_e().mark(function s(){var l,f,d;return _e().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(f=((l=a.map)===null||l===void 0?void 0:l.getOverlayContainer())||void 0,f?a.$container=f:a.$container=ve(a.configService.getSceneConfig(a.id).id||""),!a.$container){b.next=13;break}return a.canvas=Yi("canvas","",a.$container),a.setCanvas(),b.next=7,a.rendererService.init(a.canvas,a.configService.getSceneConfig(a.id),i.gl);case 7:a.registerContextLost(),a.initContainer(),Jd()(a.$container,a.handleWindowResized),window.matchMedia&&((d=window.matchMedia("screen and (-webkit-min-device-pixel-ratio: 1.5)"))===null||d===void 0||d.addListener(a.handleWindowResized)),b.next=14;break;case 13:console.error("\u5BB9\u5668 id \u4E0D\u5B58\u5728");case 14:a.pickingService.init(a.id);case 15:case"end":return b.stop()}},s)}))),this.render()}},{key:"registerContextLost",value:function(){var i=this,a=this.rendererService.getCanvas();a&&a.addEventListener("webglcontextlost",function(){return i.emit("webglcontextlost")})}},{key:"initMiniScene",value:function(i){var a=this;this.configService.setSceneConfig(this.id,i),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.iconService.on("imageUpdate",function(){return a.render()}),this.fontService.init(),this.hooks.init.tapPromise("initMap",(0,Ft.Z)(_e().mark(function s(){return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,new Promise(function(d){a.map.onCameraChanged(function(_){a.cameraService.init(),a.cameraService.update(_),a.map.version!=="GAODE2.x"&&d()}),a.map.initMiniMap()});case 2:a.map.onCameraChanged(a.handleMapCameraChanged),a.interactionService.init(),a.interactionService.on(c.Drag,a.addSceneEvent.bind(a));case 5:case"end":return f.stop()}},s)}))),this.hooks.init.tapPromise("initRenderer",(0,Ft.Z)(_e().mark(function s(){var l;return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(l=i.canvas,a.$container=l||null,!a.$container){d.next=7;break}return d.next=5,a.rendererService.init(i.canvas,a.configService.getSceneConfig(a.id),void 0);case 5:d.next=8;break;case 7:console.error("\u5BB9\u5668 id \u4E0D\u5B58\u5728");case 8:a.pickingService.init(a.id);case 9:case"end":return d.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,Ft.Z)(_e().mark(function a(){return _e().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()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"addFontFace",value:function(i,a){this.fontService.addFontFace(i,a)}},{key:"getSceneContainer",value:function(){return this.$container}},{key:"exportPng",value:function(){var n=(0,Ft.Z)(_e().mark(function a(s){var l,f,d;return _e().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 d=s==="jpg"?f==null?void 0:f.toDataURL("image/jpeg"):f==null?void 0:f.toDataURL("image/png"),b.abrupt("return",d);case 5:case"end":return b.stop()}},a,this)}));function i(a){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=Yi("div","l7-marker-container",i))}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"destroy",value:function(){var i=this,a;if(!this.inited){this.destroyed=!0;return}if((0,fc.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()}),(a=this.$container)===null||a===void 0||(a=a.parentNode)===null||a===void 0||a.removeChild(this.$container),this.emit("destroy")}},{key:"initContainer",value:function(){var i,a,s=ua,l=((i=this.$container)===null||i===void 0?void 0:i.clientWidth)||400,f=((a=this.$container)===null||a===void 0?void 0:a.clientHeight)||300,d=this.canvas;d&&(d.width=l*s,d.height=f*s),this.rendererService.viewport({x:0,y:0,width:s*l,height:s*f})}},{key:"setCanvas",value:function(){var i,a,s=ua,l=((i=this.$container)===null||i===void 0?void 0:i.clientWidth)||400,f=((a=this.$container)===null||a===void 0?void 0:a.clientHeight)||300,d=this.canvas;d.width=l*s,d.height=f*s,d.style.width="100%",d.style.height="100%"}},{key:"addSceneEvent",value:function(i){this.emit(i.type,i)}}]),t}(Ka.EventEmitter),jh=Pi(Wo.prototype,"id",[pd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hh=Pi(Wo.prototype,"iconService",[dd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wh=Pi(Wo.prototype,"fontService",[ev],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),im=Pi(Wo.prototype,"controlService",[qv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),am=Pi(Wo.prototype,"configService",[wp],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),om=Pi(Wo.prototype,"map",[Kv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sm=Pi(Wo.prototype,"coordinateSystemService",[Qv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tv=Pi(Wo.prototype,"rendererService",[Jv],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rv=Pi(Wo.prototype,"layerService",[em],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jc=Pi(Wo.prototype,"debugService",[tm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),um=Pi(Wo.prototype,"cameraService",[Ru],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nv=Pi(Wo.prototype,"interactionService",[vd],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),iv=Pi(Wo.prototype,"pickingService",[rm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lm=Pi(Wo.prototype,"shaderModuleService",[hc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),av=Pi(Wo.prototype,"markerService",[pg],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),cm=Pi(Wo.prototype,"popupService",[nm],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wo))||nh);function md(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 hm=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function gd(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t={};return e=e.replace(hm,function(n,i,a){var s=a.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(d,_){return d.push(Number(_.trim())),d},[]):f=new Array(md(i)).fill(0);break;default:}return t[l]=f,"".concat(r?"uniform ":"").concat(i," ").concat(l,`;
|
|
`)}),{content:e,uniforms:t}}function pm(e){var r=gd(e,!0),t=r.content,n=r.uniforms;return t=t.replace(/(\s*uniform\s*.*\s*){((?:\s*.*\s*)*?)};/g,function(i,a,s){s=s.trim().replace(/^.*$/gm,function(_){return"uniform ".concat(_)});var l=gd(s),f=l.content,d=l.uniforms;return Object.assign(n,d),"".concat(a,`{
|
|
`).concat(f,`
|
|
};`)}),{content:t,uniforms:n}}function dm(e){var r={};return e.replace(hm,function(t,n,i){var a=i.trim();return r[a]?"":(r[a]=!0,"uniform ".concat(n," ").concat(a,`;
|
|
`))})}var mg,gg,C0=ui.uniq,yg="#define PI 3.14159265359",R0=`#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
|
|
);
|
|
}
|
|
`,_g=`layout(std140) uniform SceneUniforms {
|
|
mat4 u_ViewMatrix;
|
|
mat4 u_ProjectionMatrix;
|
|
mat4 u_ViewProjectionMatrix;
|
|
mat4 u_ModelMatrix;
|
|
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;
|
|
float u_FocalDistance;
|
|
};
|
|
|
|
layout(std140) uniform LayerUniforms {
|
|
mat4 u_Mvp;
|
|
vec2 u_sceneCenterMercator;
|
|
};
|
|
`,xg=`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;
|
|
};`,M0=`#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;
|
|
}
|
|
`,Hc=`// 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_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);
|
|
}
|
|
return weight;
|
|
}
|
|
`,ov=`
|
|
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));
|
|
}
|
|
}
|
|
|
|
`,bg=`layout(location = 3) 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.;
|
|
}
|
|
`,yd=`
|
|
#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);
|
|
}`,vm=`#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);
|
|
}
|
|
}
|
|
`,n2=`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;
|
|
}`,i2=`/**
|
|
* 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;
|
|
}
|
|
`,jy=/precision\s+(high|low|medium)p\s+float/,Hy=`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
precision highp float;
|
|
#else
|
|
precision mediump float;
|
|
#endif
|
|
`,a2=/#pragma include (["^+"]?["[a-zA-Z_0-9](.*)"]*?)/g,o2=/void\s+main\s*\([^)]*\)\s*\{\n?/,OB=/}\n?[^{}]*$/,s2=(mg=(0,er.b2)(),mg(gg=function(){function e(){(0,Q.Z)(this,e),(0,F.Z)(this,"moduleCache",{}),(0,F.Z)(this,"rawContentCache",{})}return(0,j.Z)(e,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("common",{vs:yg,fs:yg}),this.registerModule("decode",{vs:R0,fs:""}),this.registerModule("scene_uniforms",{vs:_g,fs:_g}),this.registerModule("picking_uniforms",{vs:xg,fs:xg}),this.registerModule("projection",{vs:vm,fs:vm}),this.registerModule("project",{vs:yd,fs:""}),this.registerModule("sdf_2d",{vs:"",fs:i2}),this.registerModule("lighting",{vs:Hc,fs:""}),this.registerModule("light",{vs:M0,fs:""}),this.registerModule("picking",{vs:bg,fs:ov}),this.registerModule("rotation_2d",{vs:n2,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,a=n.fs,s=n.uniforms,l=n.inject,f=pm(i),d=f.content,_=f.uniforms,b=pm(a),T=b.content,M=b.uniforms;this.rawContentCache[t]={fs:T,inject:l,uniforms:(0,H.Z)((0,H.Z)((0,H.Z)({},_),M),s),vs:d}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var n=this,i=this.rawContentCache[t].vs,a=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=pm(s==null?void 0:s["vs:#decl"]).uniforms),s!=null&&s["vs:#main-start"]&&(i=i.replace(o2,function(q){return q+(s==null?void 0:s["vs:#main-start"])})),s!=null&&s["fs:#decl"]&&(a=(s==null?void 0:s["fs:#decl"])+a);var f=this.processModule(i,[],"vs"),d=f.content,_=f.includeList,b=this.processModule(a,[],"fs"),T=b.content,M=b.includeList,P="",D=C0(_.concat(M).concat(t)).reduce(function(q,se){return(0,H.Z)((0,H.Z)({},q),n.rawContentCache[se].uniforms)},(0,H.Z)({},l));jy.test(T)||(P=P+Hy),P=P+T;var G="";return jy.test(d)||(G=G+Hy),G=G+d,this.moduleCache[t]={fs:P.trim(),uniforms:D,vs:G.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,n,i){var a=this,s=t.replace(a2,function(l,f){var d=f.split(" "),_=d[0].replace(/"/g,"");if(n.indexOf(_)>-1)return"";var b=a.rawContentCache[_][i];n.push(_);var T=a.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,a){return i+"#define ".concat(a.toUpperCase()," ").concat(t[a],`;
|
|
`)},`
|
|
`);return n}}]),e}())||gg);function u2(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&(e=(0,Ae.Z)(e),e!==null););return e}function Ia(){return typeof Reflect!="undefined"&&Reflect.get?Ia=Reflect.get.bind():Ia=function(r,t,n){var i=u2(r,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?r:n):a.value}},Ia.apply(this,arguments)}var sv=function(e){return e.Normal="normal",e.PostProcessing="post-processing",e}({}),Wy,Gy,Eg=(Wy=(0,er.b2)(),Wy(Gy=function(){function e(){(0,Q.Z)(this,e),(0,F.Z)(this,"shaderModuleService",void 0),(0,F.Z)(this,"rendererService",void 0),(0,F.Z)(this,"cameraService",void 0),(0,F.Z)(this,"mapService",void 0),(0,F.Z)(this,"interactionService",void 0),(0,F.Z)(this,"layerService",void 0),(0,F.Z)(this,"config",void 0)}return(0,j.Z)(e,[{key:"getName",value:function(){return""}},{key:"getType",value:function(){return sv.Normal}},{key:"init",value:function(t,n){this.config=n,this.rendererService=t.getContainer().get(Ke.IRendererService),this.cameraService=t.getContainer().get(Ke.ICameraService),this.mapService=t.getContainer().get(Ke.IMapService),this.interactionService=t.getContainer().get(Ke.IInteractionService),this.layerService=t.getContainer().get(Ke.ILayerService),this.shaderModuleService=t.getContainer().get(Ke.IShaderModuleService)}},{key:"render",value:function(t){}}]),e}())||Gy),Xy,$y;function l2(e){var r=c2();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function c2(){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 f2=(Xy=(0,er.b2)(),Xy($y=function(e){(0,Fe.Z)(t,e);var r=l2(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,a){Ia((0,Ae.Z)(t.prototype),"init",this).call(this,i,a)}},{key:"render",value:function(){this.rendererService.clear({color:[0,0,0,0],depth:1,framebuffer:null})}}]),t}(Eg))||$y),Yy,qy,Ky,I0,Qy;function h2(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=p2(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function p2(e,r){if(e){if(typeof e=="string")return Jy(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 Jy(e,r)}}function Jy(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 d2=(Yy=(0,er.b2)(),qy=(0,er.f3)(Ke.IPostProcessor),Yy(Ky=(I0=function(){function e(){(0,Q.Z)(this,e),(0,F.Z)(this,"passes",[]),Di(this,"postProcessor",Qy,this),(0,F.Z)(this,"layer",void 0),(0,F.Z)(this,"renderFlag",void 0),(0,F.Z)(this,"width",0),(0,F.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,Ft.Z)(_e().mark(function n(){var i,a,s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:i=h2(this.passes),f.prev=1,i.s();case 3:if((a=i.n()).done){f.next=9;break}return s=a.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()===sv.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}(),Qy=Pi(I0.prototype,"postProcessor",[qy],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),I0))||Ky),e_,t_;function v2(e){var r=m2();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function m2(){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 g2=(e_=(0,er.b2)(),e_(t_=function(e){(0,Fe.Z)(t,e);var r=v2(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"pickingFBO",void 0),(0,F.Z)((0,Me.Z)(n),"layer",void 0),(0,F.Z)((0,Me.Z)(n),"width",0),(0,F.Z)((0,Me.Z)(n),"height",0),(0,F.Z)((0,Me.Z)(n),"alreadyInRendering",!1),(0,F.Z)((0,Me.Z)(n),"pickFromPickingFBO",function(l){var f=l.x,d=l.y,_=l.lngLat,b=l.type;if(!(!n.layer.isVisible()||!n.layer.needPick(b))){var T=n.rendererService,M=T.getViewportSize,P=T.readPixels,D=T.useFramebuffer,G=M(),q=G.width,se=G.height,Se=n.layer.getLayerConfig(),Ve=Se.enableHighlight,nt=Se.enableSelect,st=f*ua,at=d*ua;if(!(st>q||st<0||at>se||at<0)){var At;D(n.pickingFBO,function(){var Wt;if(At=P({x:Math.round(st),y:Math.round(se-(d+1)*ua),width:1,height:1,data:new Uint8Array(1*1*4),framebuffer:n.pickingFBO}),At[0]!==0||At[1]!==0||At[2]!==0){var Sr=ka(At),_r=n.layer.getSource().getFeatureById(Sr),Gr={x:f,y:d,type:b,lngLat:_,featureId:Sr,feature:_r};_r&&(n.layer.setCurrentPickId(Sr),n.triggerHoverOnLayer(Gr))}else{var Cn={x:f,y:d,lngLat:_,type:n.layer.getCurrentPickId()===null?"un"+b:"mouseout",featureId:null,feature:null};n.triggerHoverOnLayer((0,H.Z)((0,H.Z)({},Cn),{},{type:"unpick"})),n.triggerHoverOnLayer(Cn),n.layer.setCurrentPickId(null)}Ve&&n.highlightPickedFeature(At),nt&&b==="click"&&((Wt=At)===null||Wt===void 0?void 0:Wt.toString())!==[0,0,0,0].toString()&&n.selectFeature(At)})}}}),n}return(0,j.Z)(t,[{key:"getType",value:function(){return sv.Normal}},{key:"getName",value:function(){return"pixelPicking"}},{key:"init",value:function(i,a){Ia((0,Ae.Z)(t.prototype),"init",this).call(this,i,a),this.layer=i;var s=this.rendererService,l=s.createTexture2D,f=s.createFramebuffer,d=s.getViewportSize,_=d(),b=_.width,T=_.height;this.pickingFBO=f({color:l({width:b,height:T,wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE})}),this.interactionService.on(c.Hover,this.pickFromPickingFBO),this.interactionService.on(c.Select,this.selectFeatureHandle.bind(this)),this.interactionService.on(c.Active,this.highlightFeatureHandle.bind(this))}},{key:"render",value:function(i){var a=this;if(!this.alreadyInRendering){var s=this.rendererService,l=s.getViewportSize,f=s.useFramebuffer,d=s.clear,_=l(),b=_.width,T=_.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(){d({framebuffer:a.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var M=a.layer.multiPassRenderer.getRenderFlag();a.layer.multiPassRenderer.setRenderFlag(!1),i.hooks.beforePickingEncode.call(),i.render(),i.hooks.afterPickingEncode.call(),a.layer.multiPassRenderer.setRenderFlag(M),a.alreadyInRendering=!1})}}},{key:"triggerHoverOnLayer",value:function(i){this.layer.emit(i.type,i)}},{key:"highlightPickedFeature",value:function(i){var a=(0,_n.Z)(i,3),s=a[0],l=a[1],f=a[2];this.layer.hooks.beforeHighlight.call([s,l,f]),this.layerService.renderLayers()}},{key:"selectFeature",value:function(i){var a=(0,_n.Z)(i,3),s=a[0],l=a[1],f=a[2];this.layer.hooks.beforeSelect.call([s,l,f]),this.layerService.renderLayers()}},{key:"selectFeatureHandle",value:function(i){var a=i.featureId,s=na(a);this.selectFeature(new Uint8Array(s))}},{key:"highlightFeatureHandle",value:function(i){var a=i.featureId,s=na(a);this.highlightPickedFeature(new Uint8Array(s))}}]),t}(Eg))||t_),r_,n_,i_,P0,a_,y2=ui.camelCase,_2=ui.isNil,x2=ui.upperFirst,b2=`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.);
|
|
}`,Gh=(r_=(0,er.b2)(),n_=(0,er.f3)(Ke.IShaderModuleService),r_(i_=(P0=function(){function e(){(0,Q.Z)(this,e),Di(this,"shaderModuleService",a_,this),(0,F.Z)(this,"rendererService",void 0),(0,F.Z)(this,"config",void 0),(0,F.Z)(this,"quad",b2),(0,F.Z)(this,"enabled",!0),(0,F.Z)(this,"renderToScreen",!1),(0,F.Z)(this,"model",void 0),(0,F.Z)(this,"name",void 0),(0,F.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 sv.PostProcessing}},{key:"init",value:function(t,n){this.config=n,this.rendererService=t.getContainer().get(Ke.IRendererService),this.shaderModuleService=t.getContainer().get(Ke.IShaderModuleService);var i=this.rendererService,a=i.createAttribute,s=i.createBuffer,l=i.createModel,f=this.setupShaders(),d=f.vs,_=f.fs,b=f.uniforms;this.model=l({vs:d,fs:_,attributes:{a_Position:a({buffer:s({data:[-4,-4,4,-4,0,4],type:I.FLOAT}),size:2})},uniforms:(0,H.Z)((0,H.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,a=t.multiPassRenderer.getPostProcessor(),s=this.rendererService,l=s.useFramebuffer,f=s.getViewportSize,d=s.clear,_=f(),b=_.width,T=_.height;l(this.renderToScreen?null:a.getWriteFBO(),function(){d({framebuffer:a.getWriteFBO(),color:[0,0,0,0],depth:1,stencil:0});var M=(0,H.Z)({u_BloomFinal:0,u_Texture:a.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,H.Z)((0,H.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){_2(t[i])||(n["u_".concat(x2(y2(i)))]=t[i])}),n}}]),e}(),a_=Pi(P0.prototype,"shaderModuleService",[n_],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),P0))||i_),o_,s_;function E2(e){var r=S2();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function S2(){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 A2=`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;
|
|
}
|
|
}`,T2=`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=ui.isNil,w2=(o_=(0,er.b2)(),o_(s_=function(e){(0,Fe.Z)(t,e);var r=E2(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:T2,fs:A2});var i=this.shaderModuleService.getModule("blur-pass"),a=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),d=f.width,_=f.height;return{vs:a,fs:s,uniforms:(0,H.Z)((0,H.Z)({},l),{},{u_ViewportSize:[d,_]})}}},{key:"convertOptionsToUniforms",value:function(i){var a={};return O0(i.bloomRadius)||(a.u_radius=i.bloomRadius),O0(i.bloomIntensity)||(a.u_intensity=i.bloomIntensity),O0(i.bloomBaseRadio)||(a.u_baseRadio=i.bloomBaseRadio),a}}]),t}(Gh))||s_),u_,l_;function C2(e){var r=R2();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function R2(){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 M2=`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);
|
|
}`,I2=`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.);
|
|
}`,P2=ui.isNil,O2=(u_=(0,er.b2)(),u_(l_=function(e){(0,Fe.Z)(t,e);var r=C2(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:I2,fs:M2});var i=this.shaderModuleService.getModule("blur-pass"),a=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),d=f.width,_=f.height;return{vs:a,fs:s,uniforms:(0,H.Z)((0,H.Z)({},l),{},{u_ViewportSize:[d,_]})}}},{key:"convertOptionsToUniforms",value:function(i){var a={};return P2(i.blurRadius)||(a.u_BlurDir=[i.blurRadius,0]),a}}]),t}(Gh))||l_),c_,f_;function k2(e){var r=D2();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function D2(){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 L2=`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);
|
|
}`,B2=`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.);
|
|
}`,F2=ui.isNil,N2=(c_=(0,er.b2)(),c_(f_=function(e){(0,Fe.Z)(t,e);var r=k2(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:B2,fs:L2});var i=this.shaderModuleService.getModule("blur-pass"),a=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),d=f.width,_=f.height;return{vs:a,fs:s,uniforms:(0,H.Z)((0,H.Z)({},l),{},{u_ViewportSize:[d,_]})}}},{key:"convertOptionsToUniforms",value:function(i){var a={};return F2(i.blurRadius)||(a.u_BlurDir=[0,i.blurRadius]),a}}]),t}(Gh))||f_),h_,p_;function U2(e){var r=z2();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function z2(){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 Z2=`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);
|
|
}`,V2=`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.);
|
|
}`,j2=(h_=(0,er.b2)(),h_(p_=function(e){(0,Fe.Z)(t,e);var r=U2(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:V2,fs:Z2});var i=this.shaderModuleService.getModule("colorhalftone-pass"),a=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),d=f.width,_=f.height;return{vs:a,fs:s,uniforms:(0,H.Z)((0,H.Z)({},l),{},{u_ViewportSize:[d,_]})}}}]),t}(Gh))||p_),d_,v_;function H2(e){var r=W2();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function W2(){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 G2=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
}`,X2=`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.);
|
|
}`,$2=(d_=(0,er.b2)(),d_(v_=function(e){(0,Fe.Z)(t,e);var r=H2(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:X2,fs:G2}),this.shaderModuleService.getModule("copy-pass")}}]),t}(Gh))||v_),m_,g_;function Y2(e){var r=q2();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function q2(){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 K2=`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);
|
|
}`,Q2=`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.);
|
|
}`,J2=(m_=(0,er.b2)(),m_(g_=function(e){(0,Fe.Z)(t,e);var r=Y2(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:Q2,fs:K2});var i=this.shaderModuleService.getModule("hexagonalpixelate-pass"),a=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),d=f.width,_=f.height;return{vs:a,fs:s,uniforms:(0,H.Z)((0,H.Z)({},l),{},{u_ViewportSize:[d,_]})}}}]),t}(Gh))||g_),y_,__;function eA(e){var r=tA();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function tA(){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 rA=`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);
|
|
}`,nA=`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.);
|
|
}`,iA=(y_=(0,er.b2)(),y_(__=function(e){(0,Fe.Z)(t,e);var r=eA(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:nA,fs:rA});var i=this.shaderModuleService.getModule("ink-pass"),a=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService.getViewportSize(),d=f.width,_=f.height;return{vs:a,fs:s,uniforms:(0,H.Z)((0,H.Z)({},l),{},{u_ViewportSize:[d,_]})}}}]),t}(Gh))||__),x_,b_;function aA(e){var r=oA();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function oA(){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 sA=`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);
|
|
}`,uA=`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.);
|
|
}`,lA=(x_=(0,er.b2)(),x_(b_=function(e){(0,Fe.Z)(t,e);var r=aA(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:uA,fs:sA}),this.shaderModuleService.getModule("noise-pass")}}]),t}(Gh))||b_),E_,S_;function cA(e){var r=fA();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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=`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.);
|
|
}`,pA=`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);
|
|
}`,dA=(E_=(0,er.b2)(),E_(S_=function(e){(0,Fe.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:"setupShaders",value:function(){return this.shaderModuleService.registerModule("sepia-pass",{vs:hA,fs:pA}),this.shaderModuleService.getModule("sepia-pass")}}]),t}(Gh))||S_),A_,T_,w_,C_,uv,R_,vA=(A_=(0,er.b2)(),T_=(0,er.f3)(Ke.IRendererService),w_=(0,er.zY)(),A_(C_=(uv=function(){function e(){(0,Q.Z)(this,e),Di(this,"rendererService",R_,this),(0,F.Z)(this,"passes",[]),(0,F.Z)(this,"readFBO",void 0),(0,F.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,a=n(),s=a.width,l=a.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,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:i(t.getCurrentFBOTex());case 1:case"end":return l.stop()}},a)})))})}},{key:"renderBloomPass",value:function(){var r=(0,Ft.Z)(_e().mark(function n(i,a){var s,l;return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.getReadFBOTex();case 2:s=d.sent,l=0;case 4:if(!(l<4)){d.next=11;break}return d.next=7,a.render(i,s);case 7:this.swap(),l++,d.next=4;break;case 11:case"end":return d.stop()}},n,this)}));function t(n,i){return r.apply(this,arguments)}return t}()},{key:"render",value:function(){var r=(0,Ft.Z)(_e().mark(function n(i){var a,s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:a=0;case 1:if(!(a<this.passes.length)){f.next=15;break}if(s=this.passes[a],s.setRenderToScreen(this.isLastEnabledPass(a)),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:a!==this.passes.length-1&&this.swap();case 12:a++,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,a){t.init(i,a),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:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE})}),this.writeFBO=n({color:i({width:1,height:1,wrapS:I.CLAMP_TO_EDGE,wrapT:I.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}(),R_=Pi(uv.prototype,"rendererService",[T_],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Pi(uv.prototype,"init",[w_],Object.getOwnPropertyDescriptor(uv.prototype,"init"),uv.prototype),uv))||C_),M_,I_;function mA(e){var r=gA();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function gA(){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 yA=(M_=(0,er.b2)(),M_(I_=function(e){(0,Fe.Z)(t,e);var r=mA(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getType",value:function(){return sv.Normal}},{key:"getName",value:function(){return"render"}},{key:"init",value:function(i,a){Ia((0,Ae.Z)(t.prototype),"init",this).call(this,i,a)}},{key:"render",value:function(i){var a=this.rendererService,s=a.useFramebuffer,l=a.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(d){d.draw({uniforms:i.layerModel.getUninforms()})}),i.multiPassRenderer.setRenderFlag(!0)})}}]),t}(Eg))||I_),P_,O_,k_,k0,D_;function _A(e){var r=xA();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function xA(){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 bA=`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);
|
|
}
|
|
`,L_=`varying vec2 v_UV;
|
|
|
|
uniform sampler2D u_Texture;
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(texture2D(u_Texture, v_UV));
|
|
}`,EA=`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 B_(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 SA=1,AA=(P_=(0,er.b2)(),O_=(0,er.f3)(Ke.IShaderModuleService),P_(k_=(k0=function(e){(0,Fe.Z)(t,e);var r=_A(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),Di((0,Me.Z)(n),"shaderModuleService",D_,(0,Me.Z)(n)),(0,F.Z)((0,Me.Z)(n),"haltonSequence",[]),(0,F.Z)((0,Me.Z)(n),"accumulatingId",0),(0,F.Z)((0,Me.Z)(n),"frame",0),(0,F.Z)((0,Me.Z)(n),"timer",void 0),(0,F.Z)((0,Me.Z)(n),"sampleRenderTarget",void 0),(0,F.Z)((0,Me.Z)(n),"prevRenderTarget",void 0),(0,F.Z)((0,Me.Z)(n),"outputRenderTarget",void 0),(0,F.Z)((0,Me.Z)(n),"copyRenderTarget",void 0),(0,F.Z)((0,Me.Z)(n),"blendModel",void 0),(0,F.Z)((0,Me.Z)(n),"outputModel",void 0),(0,F.Z)((0,Me.Z)(n),"copyModel",void 0),n}return(0,j.Z)(t,[{key:"getType",value:function(){return sv.Normal}},{key:"getName",value:function(){return"taa"}},{key:"init",value:function(i,a){Ia((0,Ae.Z)(t.prototype),"init",this).call(this,i,a);var s=this.rendererService,l=s.createFramebuffer,f=s.createTexture2D;this.sampleRenderTarget=l({color:f({width:1,height:1,wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE})}),this.prevRenderTarget=l({color:f({width:1,height:1,wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE})}),this.outputRenderTarget=l({color:f({width:1,height:1,wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE})}),this.copyRenderTarget=l({color:f({width:1,height:1,wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE})});for(var d=0;d<30;d++)this.haltonSequence.push([B_(d,2),B_(d,3)]);this.blendModel=this.createTriangleModel("blend-pass",bA),this.outputModel=this.createTriangleModel("copy-pass",L_,{blend:{enable:!0,func:{srcRGB:I.ONE,dstRGB:I.ONE_MINUS_SRC_ALPHA,srcAlpha:I.ONE,dstAlpha:I.ONE_MINUS_SRC_ALPHA},equation:{rgb:I.FUNC_ADD,alpha:I.FUNC_ADD}}}),this.copyModel=this.createTriangleModel("copy-pass",L_)}},{key:"render",value:function(i){var a=this,s=this.rendererService,l=s.clear,f=s.getViewportSize,d=s.useFramebuffer,_=f(),b=_.width,T=_.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();d(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 P=function D(G){!a.accumulatingId||G!==a.accumulatingId||a.isFinished()||(a.doRender(i),window.requestAnimationFrame(function(){D(G)}))};this.accumulatingId=SA++,this.timer=window.setTimeout(function(){P(a.accumulatingId)},50)}},{key:"doRender",value:function(i){var a=this,s=this.rendererService,l=s.clear,f=s.getViewportSize,d=s.useFramebuffer,_=f(),b=_.width,T=_.height,M=i.getLayerConfig(),P=M.jitterScale,D=P===void 0?1:P,G=this.haltonSequence[this.frame%this.haltonSequence.length];this.cameraService.jitterProjectionMatrix((G[0]*2-1)/b*D,(G[1]*2-1)/T*D),i.multiPassRenderer.setRenderFlag(!1),i.hooks.beforeRender.call(),d(this.sampleRenderTarget,function(){l({color:[0,0,0,0],depth:1,stencil:0,framebuffer:a.sampleRenderTarget}),i.render()}),i.hooks.afterRender.call(),i.multiPassRenderer.setRenderFlag(!0);var q=i.getLayerConfig();d(this.outputRenderTarget,function(){a.blendModel.draw({uniforms:{u_opacity:q.opacity||1,u_MixRatio:a.frame===0?1:.9,u_Diffuse1:a.sampleRenderTarget,u_Diffuse2:a.frame===0?i.multiPassRenderer.getPostProcessor().getReadFBO():a.prevRenderTarget}})}),this.frame===0&&l({color:[0,0,0,0],depth:1,stencil:0,framebuffer:this.copyRenderTarget}),this.frame>=1&&(d(this.copyRenderTarget,function(){a.outputModel.draw({uniforms:{u_Texture:a.outputRenderTarget}})}),d(i.multiPassRenderer.getPostProcessor().getReadFBO(),function(){a.copyModel.draw({uniforms:{u_Texture:a.copyRenderTarget}})}),i.multiPassRenderer.getPostProcessor().render(i));var se=this.prevRenderTarget;this.prevRenderTarget=this.outputRenderTarget,this.outputRenderTarget=se,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,a,s){this.shaderModuleService.registerModule(i,{vs:EA,fs:a});var l=this.shaderModuleService.getModule(i),f=l.vs,d=l.fs,_=l.uniforms,b=this.rendererService,T=b.createAttribute,M=b.createBuffer,P=b.createModel;return P((0,H.Z)({vs:f,fs:d,attributes:{a_Position:T({buffer:M({data:[-4,-4,4,-4,0,4],type:I.FLOAT}),size:2})},uniforms:(0,H.Z)({},_),depth:{enable:!1},count:3},s))}}]),t}(Eg),D_=Pi(k0.prototype,"shaderModuleService",[O_],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),k0))||k_),mm=new er.W2;mm.bind(Ke.IGlobalConfigService).to(ug).inSingletonScope(),(0,er.GW)((0,er.b2)(),Ka.EventEmitter),mm.bind(Ke.IEventEmitter).to(Ka.EventEmitter);var F_=(0,Ti.Z)(mm,!1),D0=function(r){var t=F_.lazyInject(r);return function(n,i,a){t.call(this,n,i),a&&(a.initializer=function(){return n[i]})}},kB=function(r){var t=F_.lazyMultiInject(r);return function(n,i,a){t.call(this,n,i),a&&(a.initializer=function(){return n[i]})}},Zl=mm,TA=0;function wA(){var e=new er.W2;return e.parent=mm,e.bind(Ke.SceneID).toConstantValue("".concat(TA++)),e.bind(Ke.IShaderModuleService).to(s2).inSingletonScope(),e.bind(Ke.ILayerService).to(To).inSingletonScope(),e.bind(Ke.IDebugService).to(fg).inSingletonScope(),e.bind(Ke.ISceneService).to(vg).inSingletonScope(),e.bind(Ke.ICameraService).to(Er).inSingletonScope(),e.bind(Ke.ICoordinateSystemService).to(lg).inSingletonScope(),e.bind(Ke.IInteractionService).to(K).inSingletonScope(),e.bind(Ke.IPickingService).to(ei).inSingletonScope(),e.bind(Ke.IControlService).to(No).inSingletonScope(),e.bind(Ke.IMarkerService).to(Yu).inSingletonScope(),e.bind(Ke.IIconService).to(mt).inSingletonScope(),e.bind(Ke.IFontService).to(Gt).inSingletonScope(),e.bind(Ke.IPopupService).to(td).inSingletonScope(),e.bind(Ke.INormalPass).to(f2).whenTargetNamed("clear"),e.bind(Ke.INormalPass).to(g2).whenTargetNamed("pixelPicking"),e.bind(Ke.INormalPass).to(yA).whenTargetNamed("render"),e.bind(Ke.INormalPass).to(AA).whenTargetNamed("taa"),e.bind(Ke.IFactoryNormalPass).toFactory(function(r){return function(t){return r.container.getNamed(Ke.INormalPass,t)}}),e.bind(Ke.IPostProcessingPass).to($2).whenTargetNamed("copy"),e.bind(Ke.IPostProcessingPass).to(w2).whenTargetNamed("bloom"),e.bind(Ke.IPostProcessingPass).to(O2).whenTargetNamed("blurH"),e.bind(Ke.IPostProcessingPass).to(N2).whenTargetNamed("blurV"),e.bind(Ke.IPostProcessingPass).to(lA).whenTargetNamed("noise"),e.bind(Ke.IPostProcessingPass).to(dA).whenTargetNamed("sepia"),e.bind(Ke.IPostProcessingPass).to(j2).whenTargetNamed("colorHalftone"),e.bind(Ke.IPostProcessingPass).to(J2).whenTargetNamed("hexagonalPixelate"),e.bind(Ke.IPostProcessingPass).to(iA).whenTargetNamed("ink"),e.bind(Ke.IFactoryPostProcessingPass).toFactory(function(r){return function(t){var n=r.container.getNamed(Ke.IPostProcessingPass,t);return n.setName(t),n}}),e}function gm(e){var r=new er.W2;return r.parent=e,r.bind(Ke.IStyleAttributeService).to(qu).inSingletonScope(),r.bind(Ke.IMultiPassRenderer).to(d2).inSingletonScope(),r.bind(Ke.IPostProcessor).to(vA).inSingletonScope(),r}var CA=null;function DB(e){return CA.indexOf(e)}var N_=ui.clamp,RA=2,LB=4,MA=64,BB=128,IA=256,PA=512,FB=8192,NB=16384,UB=32768,OA=null,U_=131072,zB=262144,kA=524288,ZB=1048576,DA=2097152,VB=4194304,LA=8388608,BA=16777216,FA=null;function Sg(e,r){return e=N_(Math.floor(e),0,255),r=N_(Math.floor(r),0,255),256*e+r}function jB(e){var r=e.color,t=e.radius,n=e.tileX,i=e.tileY,a=e.shape,s=e.opacity,l=e.stroke,f=e.strokeWidth,d=e.strokeOpacity,_=[],b=[],T=[],M=[Sg(r[0],r[1]),Sg(r[2],r[3])],P=[Sg(l[0],l[1]),Sg(l[2],l[3])];return[[-1,-1],[1,-1],[1,1],[-1,1]].forEach(function(D){var G=_slicedToArray(D,2),q=G[0],se=G[1];_.push([].concat(M,[(q+1)*LA+(se+1)*DA+getShapeIndex(a)*U_+t,(n+512)*kA+(i+512)*MA])),b.push([].concat(P,[f,d])),T.push([s,0,0,0])}),{packedBuffer:_,packedBuffer2:b,packedBuffer3:T}}function HB(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*FA+t*BA+n*U_+t*OA+n*PA+t*IA+n*RA+t}var _d={ProjectionMatrix:"u_ProjectionMatrix",ViewMatrix:"u_ViewMatrix",ViewProjectionMatrix:"u_ViewProjectionMatrix",Zoom:"u_Zoom",ZoomScale:"u_ZoomScale",FocalDistance:"u_FocalDistance",CameraPosition:"u_CameraPosition"},Ds={MapInitStart:"mapInitStart",LayerInitStart:"layerInitStart",LayerInitEnd:"layerInitEnd",SourceInitStart:"sourceInitStart",SourceInitEnd:"sourceInitEnd",ScaleInitStart:"scaleInitStart",ScaleInitEnd:"scaleInitEnd",MappingStart:"mappingStart",MappingEnd:"mappingEnd",BuildModelStart:"buildModelStart",BuildModelEnd:"buildModelEnd"},Ya=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}({}),lv=function(e){return e.CONSTANT="constant",e.VARIABLE="variable",e}({}),In=function(e){return e[e.Attribute=0]="Attribute",e[e.InstancedAttribute=1]="InstancedAttribute",e[e.Uniform=2]="Uniform",e}({}),NA=["mapload","mapchange","mapAfterFrameChange"],Ag=["loaded","fontloaded","maploaded","resize","destroy","dragstart","dragging","dragend","dragcancel"],Mu=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}({}),UA=function(){var e=(0,Ft.Z)(_e().mark(function r(t,n,i,a){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",new Promise(function(f,d){n({x:t.x,y:t.y,z:t.z},function(_,b){if(_||b.length===0){d(_);return}b&&ai([{data:b,bands:[0]}],i,a,function(T,M){T?d(T):M&&f(M)})})}));case 1:case"end":return l.stop()}},r)}));return function(t,n,i,a){return e.apply(this,arguments)}}(),zA=function(){var e=(0,Ft.Z)(_e().mark(function r(t,n){return _e().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",new Promise(function(s,l){n({x:t.x,y:t.y,z:t.z},function(f,d){if(f||!d){l(f);return}d instanceof ArrayBuffer?vu(d,function(_,b){_&&l(_),s(b)}):d instanceof HTMLImageElement?s(d):l(f)})}));case 1:case"end":return a.stop()}},r)}));return function(t,n){return e.apply(this,arguments)}}();function ZA(e,r){return Array.isArray(e)?typeof e[0]=="string"?e.map(function(t){return v(t,r)}):e.map(function(t){return{url:v(t.url,r),bands:t.bands||[0]}}):v(e,r)}function VA(e){return typeof e=="string"?[{url:e,bands:[0]}]:typeof e[0]=="string"?e.map(function(r){return{url:r,bands:[0]}}):e}function z_(e,r){e.xhrCancel=function(){r.map(function(t){t.abort()})}}var jA=function(){var e=(0,Ft.Z)(_e().mark(function r(t,n,i,a,s){var l,f,d,_,b,T;return _e().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(l=VA(n.url),!(l.length>1)){P.next=15;break}return P.next=4,HA(l,n);case 4:if(f=P.sent,d=f.rasterFiles,_=f.xhrList,b=f.errList,z_(t,_),!(b.length>0)){P.next=12;break}return i(b,null),P.abrupt("return");case 12:ai(d,a,s,i),P.next=17;break;case 15:T=Ei(n,function(D,G){if(D)i(D);else if(G){var q=[{data:G,bands:l[0].bands}];ai(q,a,s,i)}}),z_(t,[T]);case 17:case"end":return P.stop()}},r)}));return function(t,n,i,a,s){return e.apply(this,arguments)}}();function HA(e,r){return L0.apply(this,arguments)}function L0(){return L0=(0,Ft.Z)(_e().mark(function e(r,t){var n,i,a,s,l,f,d,_,b,T,M;return _e().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:n=[],i=[],a=[],s=0;case 4:if(!(s<r.length)){D.next=20;break}return l=r[s],f=(0,H.Z)((0,H.Z)({},t),{},{url:l.url}),d=l.bands,D.next=10,Vi((0,H.Z)((0,H.Z)({},f),{},{type:"arrayBuffer"}));case 10:_=D.sent,b=_.err,T=_.data,M=_.xhr,b&&a.push(b),i.push(M),n.push({data:T,bands:d});case 17:s++,D.next=4;break;case 20:return D.abrupt("return",{rasterFiles:n,xhrList:i,errList:a});case 21:case"end":return D.stop()}},e)})),L0.apply(this,arguments)}var WA=function(){var e=(0,Ft.Z)(_e().mark(function r(t,n,i,a,s){var l;return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return l={url:ZA(t,n)},d.abrupt("return",new Promise(function(_,b){jA(i,l,function(T,M){T?b(T):M&&_(M)},a,s)}));case 2:case"end":return d.stop()}},r)}));return function(t,n,i,a,s){return e.apply(this,arguments)}}(),Z_=function(){var e=(0,Ft.Z)(_e().mark(function r(t,n,i,a){var s,l,f,d;return _e().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return l=Array.isArray(t)?t[0]:t,a.wmtsOptions?(f=(a==null?void 0:a.getURLFromTemplate)||p,s=f(l,(0,H.Z)((0,H.Z)({},n),a.wmtsOptions))):(d=(a==null?void 0:a.getURLFromTemplate)||v,s=d(l,n)),b.abrupt("return",new Promise(function(T,M){var P,D=Oa({url:s,type:(a==null||(P=a.requestParameters)===null||P===void 0?void 0:P.type)||"arrayBuffer"},function(G,q){G?M(G):q&&T(q)},a.transformResponse);i.xhrCancel=function(){return D.cancel()}}));case 3:case"end":return b.stop()}},r)}));return function(t,n,i,a){return e.apply(this,arguments)}}(),V_=function(){return{rasterData:new Uint8Array([0]),width:1,height:1}},GA={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0,warp:!0},WB=[Mu.ARRAYBUFFER,Mu.RGB];function XA(e){return!!(Array.isArray(e)&&e.length===0||!Array.isArray(e)&&typeof e!="string")}function $A(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(XA(e))throw new Error("tile server url is error");var t=(r==null?void 0:r.dataType)||Mu.IMAGE;t===Mu.RGB&&(t=Mu.ARRAYBUFFER);var n=function(s,l){switch(t){case Mu.IMAGE:return Z_(e,s,l,r);case Mu.CUSTOMIMAGE:case Mu.CUSTOMTERRAINRGB:return zA(l,r==null?void 0:r.getCustomData);case Mu.ARRAYBUFFER:return WA(e,s,l,(r==null?void 0:r.format)||V_,r==null?void 0:r.operation);case Mu.CUSTOMARRAYBUFFER:case Mu.CUSTOMRGB:return UA(l,r==null?void 0:r.getCustomData,(r==null?void 0:r.format)||V_,r==null?void 0:r.operation);default:return Z_(e,s,l,r)}},i=(0,H.Z)((0,H.Z)((0,H.Z)({},GA),r),{},{getTileData:n});return{data:e,dataArray:[],tilesetOptions:i,isTile:!0}}var YA=["extent","min","max","width","height","format","operation"];function qA(e,r){var t=r.extent,n=r.min,i=r.max,a=r.width,s=r.height,l=r.format,f=r.operation,d=(0,wa.Z)(r,YA),_;if(l===void 0||Lc(e))_=Array.from(e);else{var b=Array.isArray(e)?e:[e];_=fn(b,l,f)}var T={_id:1,dataArray:[(0,H.Z)((0,H.Z)({_id:1,data:_,width:a,height:s},d),{},{min:n,max:i,coordinates:[[t[0],t[1]],[t[2],t[3]]]})]};return T}var KA={tileSize:256,minZoom:0,maxZoom:1/0,zoomOffset:0},QA=function(){var e=(0,Ft.Z)(_e().mark(function r(t){return _e().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(a){var s=(0,_n.Z)(t.bounds,4),l=s[0],f=s[1],d=s[2],_=s[3],b={layers:{testTile:{features:[{type:"Feature",properties:{key:t.x+"/"+t.y+"/"+t.z,x:(l+d)/2,y:(f+_)/2},geometry:{type:"LineString",coordinates:[[d,_],[d,f],[l,f],[l,f]]}}]}}};a(b)}));case 1:case"end":return i.stop()}},r)}));return function(t){return e.apply(this,arguments)}}();function JA(e,r){var t=function(a){return QA(a)},n=(0,H.Z)((0,H.Z)((0,H.Z)({},KA),r),{},{getTileData:t});return{data:e,dataArray:[],tilesetOptions:n,isTile:!0}}var eT=["extent","width","height"];function tT(e,r){var t=r.extent,n=r.width,i=r.height,a=(0,wa.Z)(r,eT);e.length<3&&console.warn("RGB\u89E3\u6790\u9700\u8981\u4E09\u4E2A\u6CE2\u6BB5\u7684\u6570\u636E");for(var s=a.bands||[0,1,2],l=(0,_n.Z)(s,3),f=l[0],d=l[1],_=l[2],b=[e[f],e[d],e[_]],T=[],M=(a==null?void 0:a.countCut)||[2,98],P=(0,_n.Z)(M,2),D=P[0],G=P[1],q=(a==null?void 0:a.RMinMax)||Ir(b[0],D,G),se=(a==null?void 0:a.GMinMax)||Ir(b[1],D,G),Se=(a==null?void 0:a.BMinMax)||Ir(b[2],D,G),Ve=0;Ve<b[0].length;Ve++)T.push(Math.max(0,b[0][Ve]-q[0])),T.push(Math.max(0,b[1][Ve]-se[0])),T.push(Math.max(0,b[2][Ve]-Se[0]));var nt={_id:1,dataArray:[(0,H.Z)((0,H.Z)({_id:1,data:T,width:n,height:i,rMinMax:q,gMinMax:se,bMinMax:Se},a),{},{coordinates:[[t[0],t[1]],[t[2],t[3]]]})]};return nt}var rT=["extent","width","height"];function nT(e,r){var t=r.extent,n=r.width,i=r.height,a=(0,wa.Z)(r,rT);e.length<2&&console.warn("RGB\u89E3\u6790\u9700\u89812\u4E2A\u6CE2\u6BB5\u7684\u6570\u636E");for(var s=a.bands||[0,1],l=(0,_n.Z)(s,2),f=l[0],d=l[1],_=[e[f],e[d]],b=[],T=0;T<_[0].length;T++)b.push((_[1][T]-_[0][T])/(_[1][T]+_[0][T]));var M={_id:1,dataArray:[(0,H.Z)((0,H.Z)({_id:1,data:b,width:n,height:i},a),{},{coordinates:[[t[0],t[1]],[t[2],t[3]]]})]};return M}var iT=U(48096),aT=U.n(iT);function j_(e,r){var t=r.radius,n=t===void 0?40:t,i=r.maxZoom,a=i===void 0?18:i,s=r.minZoom,l=s===void 0?0:s,f=r.zoom,d=f===void 0?2:f;if(e.pointIndex){var _=e.pointIndex.getClusters(e.extent,Math.floor(d));return e.dataArray=oT(_),e}var b=new(aT())({radius:n,minZoom:l,maxZoom:a}),T={type:"FeatureCollection",features:[]};return T.features=e.dataArray.map(function(M){return{type:"Feature",geometry:{type:"Point",coordinates:M.coordinates},properties:(0,H.Z)({},M)}}),b.load(T.features),b}function oT(e){return e.map(function(r,t){return(0,H.Z)({coordinates:r.geometry.coordinates,_id:t+1},r.properties)})}function sT(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 uT(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 H_(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 lT(e){if(e.length===0)throw new Error("mean requires at least one data point");return H_(e)/e.length}var cT={min:uT,max:sT,mean:lT,sum:H_};function fT(e){var r=hT();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function hT(){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 pT=ui.cloneDeep,W_=ui.isFunction,dT=ui.isString,vT=ui.mergeWith;function mT(e,r){if(Array.isArray(r))return r}var gT=function(e){(0,Fe.Z)(t,e);var r=fT(t);function t(n,i){var a;return(0,Q.Z)(this,t),a=r.call(this),(0,F.Z)((0,Me.Z)(a),"type","source"),(0,F.Z)((0,Me.Z)(a),"isTile",!1),(0,F.Z)((0,Me.Z)(a),"inited",!1),(0,F.Z)((0,Me.Z)(a),"hooks",{init:new Ul}),(0,F.Z)((0,Me.Z)(a),"parser",{type:"geojson"}),(0,F.Z)((0,Me.Z)(a),"transforms",[]),(0,F.Z)((0,Me.Z)(a),"cluster",!1),(0,F.Z)((0,Me.Z)(a),"clusterOptions",{enable:!1,radius:40,maxZoom:20,zoom:-99,method:"count"}),(0,F.Z)((0,Me.Z)(a),"invalidExtent",!1),(0,F.Z)((0,Me.Z)(a),"dataArrayChanged",!1),(0,F.Z)((0,Me.Z)(a),"cfg",{autoRender:!0}),a.originData=n,a.initCfg(i),a.init().then(function(){a.inited=!0,a.emit("update",{type:"inited"})}),a}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 a=this,s=this.clusterOptions,l=s.method,f=l===void 0?"sum":l,d=s.field,_=this.clusterIndex.getClusters(this.caculClusterExtent(2),Math.floor(i));this.clusterOptions.zoom=i,_.forEach(function(b){b.id||(b.properties.point_count=1)}),(d||W_(f))&&(_=_.map(function(b){var T=b.id;if(T){var M=a.clusterIndex.getLeaves(T,1/0),P=M.map(function(q){return q.properties}),D;if(dT(f)&&d){var G=Xf(P,d);D=cT[f](G)}W_(f)&&(D=f(P)),b.properties.stat=D}else b.properties.point_count=1;return b})),this.data=pe("geojson")({type:"FeatureCollection",features:_}),this.executeTrans()}},{key:"getFeatureById",value:function(i){var a=this.parser,s=a.type,l=s===void 0?"geojson":s,f=a.geometry;if(l==="geojson"&&!this.cluster){var d=i<this.originData.features.length?this.originData.features[i]:"null",_=pT(d);if(_!=null&&_.properties&&(this.transforms.length!==0||this.dataArrayChanged)){var b=this.data.dataArray.find(function(T){return T._id===i});_.properties=b}return _}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,a){this.data.dataArray=this.data.dataArray.map(function(s){return s._id===i?(0,H.Z)((0,H.Z)({},s),a):s}),this.dataArrayChanged=!0,this.emit("update",{type:"update"})}},{key:"getFeatureId",value:function(i,a){var s=this.data.dataArray.find(function(l){return l[i]===a});return s==null?void 0:s._id}},{key:"setData",value:function(i,a){var s=this;this.originData=i,this.dataArrayChanged=!1,this.initCfg(a),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,a,s){var l;(l=this.tileset)===null||l===void 0||l.reloadTileById(i,a,s)}},{key:"reloadTileByLnglat",value:function(i,a,s){var l;(l=this.tileset)===null||l===void 0||l.reloadTileByLnglat(i,a,s)}},{key:"getTileExtent",value:function(i,a){var s;return(s=this.tileset)===null||s===void 0?void 0:s.getTileExtent(i,a)}},{key:"getTileByZXY",value:function(i,a,s){var l;return(l=this.tileset)===null||l===void 0?void 0:l.getTileByZXY(i,a,s)}},{key:"reloadTileByExtent",value:function(i,a){var s;(s=this.tileset)===null||s===void 0||s.reloadTileByExtent(i,a)}},{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,Ft.Z)(_e().mark(function a(){var s=this;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",new Promise(function(d,_){try{s.excuteParser(),s.initCluster(),s.executeTrans(),d({})}catch(b){_(b)}}));case 1:case"end":return f.stop()}},a)}));function i(){return n.apply(this,arguments)}return i}()},{key:"initCfg",value:function(i){this.cfg=vT(this.cfg,i,mT);var a=this.cfg;a&&(a.parser&&(this.parser=a.parser),a.transforms&&(this.transforms=a.transforms),this.cluster=a.cluster||!1,a.clusterOptions&&(this.cluster=!0,this.clusterOptions=(0,H.Z)((0,H.Z)({},this.clusterOptions),a.clusterOptions)))}},{key:"init",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().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()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"excuteParser",value:function(){var i=this.parser,a=i.type||"geojson",s=pe(a);this.data=s(this.originData,i),this.tileset=this.initTileset(),!i.cancelExtent&&(this.extent=zu(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 a=new jf((0,H.Z)({},i));return a}}},{key:"executeTrans",value:function(){var i=this,a=this.transforms;a.forEach(function(s){var l=s.type,f=it(l)(i.data,s);Object.assign(i.data,f)})}},{key:"initCluster",value:function(){if(this.cluster){var i=this.clusterOptions||{};this.clusterIndex=j_(this.data,i)}}},{key:"caculClusterExtent",value:function(i){var a=[[-1/0,-1/0],[1/0,1/0]];return this.invalidExtent||(a=Zu(Ql(this.extent),i)),a[0].concat(a[1])}}]),t}(Ka.EventEmitter);function yT(e,r){var t=r.callback;return t&&(e.dataArray=e.dataArray.filter(t)),e}function G_(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=_T(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function _T(e,r){if(e){if(typeof e=="string")return X_(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 X_(e,r)}}function X_(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 xT(e,r){var t=e.dataArray,n=r.size,i=n===void 0?10:n,a=i/(2*Math.PI*B0)*(256<<20)/2,s=bT(t,i),l=s.gridHash,f=s.gridOffset,d=TT(l,f,r);return{yOffset:a,xOffset:a,radius:a,type:"grid",dataArray:d}}function bT(e,r){var t=1/0,n=-1/0,i,a=G_(e),s;try{for(a.s();!(s=a.n()).done;){var l=s.value;i=l.coordinates[1],Number.isFinite(i)&&(t=i<t?i:t,n=i>n?i:n)}}catch(Se){a.e(Se)}finally{a.f()}var f=(t+n)/2,d=ET(r,f);if(d.xOffset<=0||d.yOffset<=0)return{gridHash:{},gridOffset:d};var _={},b=G_(e),T;try{for(b.s();!(T=b.n()).done;){var M=T.value,P=M.coordinates[1],D=M.coordinates[0];if(Number.isFinite(P)&&Number.isFinite(D)){var G=Math.floor((P+90)/d.yOffset),q=Math.floor((D+180)/d.xOffset),se="".concat(G,"-").concat(q);_[se]=_[se]||{count:0,points:[]},_[se].count+=1,_[se].points.push(M)}}}catch(Se){b.e(Se)}finally{b.f()}return{gridHash:_,gridOffset:d}}function ET(e,r){var t=ST(e),n=AT(r,e);return{yOffset:t,xOffset:n}}function ST(e){return e/B0*(180/Math.PI)}function AT(e,r){return r/B0*(180/Math.PI)/Math.cos(e*Math.PI/180)}function TT(e,r,t){return Object.keys(e).reduce(function(n,i,a){var s=i.split("-"),l=parseInt(s[0],10),f=parseInt(s[1],10),d={};if(t.field&&t.method){var _=Uf(e[i].points,t.field);d[t.method]=Cc[t.method](_)}return Object.assign(d,{_id:a,coordinates:ja([-180+r.xOffset*(f+.5),-90+r.yOffset*(l+.5)]),rawData:e[i].points,count:e[i].count}),n.push(d),n},[])}var cv=Math.PI/3,wT=[0,cv,2*cv,3*cv,4*cv,5*cv];function CT(e){return e[0]}function RT(e){return e[1]}function MT(){var e=0,r=0,t=1,n=1,i=CT,a=RT,s,l,f;function d(b){var T={},M=[],P,D=b.length;for(P=0;P<D;++P)if(!(isNaN(q=+i.call(null,G=b[P],P,b))||isNaN(se=+a.call(null,G,P,b)))){var G,q,se,Se=Math.round(se=se/f),Ve=Math.round(q=q/l-(Se&1)/2),nt=se-Se;if(Math.abs(nt)*3>1){var st=q-Ve,at=Ve+(q<Ve?-1:1)/2,At=Se+(se<Se?-1:1),Wt=q-at,Sr=se-At;st*st+nt*nt>Wt*Wt+Sr*Sr&&(Ve=at+(Se&1?1:-1)/2,Se=At)}var _r=Ve+"-"+Se,Gr=T[_r];Gr?Gr.push(G):(M.push(Gr=T[_r]=[G]),Gr.x=(Ve+(Se&1)/2)*l,Gr.y=Se*f)}return M}function _(b){var T=0,M=0;return wT.map(function(P){var D=Math.sin(P)*b,G=-Math.cos(P)*b,q=D-T,se=G-M;return T=D,M=G,[q,se]})}return d.hexagon=function(b){return"m"+_(b==null?s:+b).join("l")+"z"},d.centers=function(){for(var b=[],T=Math.round(r/f),M=Math.round(e/l),P=T*f;P<n+s;P+=f,++T)for(var D=M*l+(T&1)*l/2;D<t+l/2;D+=l)b.push([D,P]);return b},d.mesh=function(){var b=_(s).slice(0,4).join("l");return d.centers().map(function(T){return"M"+T+"m"+b}).join("")},d.x=function(b){return arguments.length?(i=b,d):i},d.y=function(b){return arguments.length?(a=b,d):a},d.radius=function(b){return arguments.length?(s=+b,l=s*2*Math.sin(cv),f=s*1.5,d):s},d.size=function(b){return arguments.length?(e=r=0,t=+b[0],n=+b[1],d):[t-e,n-r]},d.extent=function(b){return arguments.length?(e=+b[0][0],r=+b[0][1],t=+b[1][0],n=+b[1][1],d):[[e,r],[t,n]]},d.radius(1)}var IT=6378e3;function PT(e,r){var t=e.dataArray,n=r.size,i=n===void 0?10:n,a=r.method,s=a===void 0?"sum":a,l=i/(2*Math.PI*IT)*(256<<20)/2,f=t.map(function(T){var M=ja(T.coordinates),P=(0,_n.Z)(M,2),D=P[0],G=P[1];return(0,H.Z)((0,H.Z)({},T),{},{coordinates:[D,G]})}),d=MT().radius(l).x(function(T){return T.coordinates[0]}).y(function(T){return T.coordinates[1]}),_=d(f),b={dataArray:_.map(function(T,M){var P;if(r.field&&s){var D=Uf(T,r.field);T[s]=Cc[s](D)}return P={},(0,F.Z)(P,r.method,T[s]),(0,F.Z)(P,"count",T.length),(0,F.Z)(P,"rawData",T),(0,F.Z)(P,"coordinates",[T.x,T.y]),(0,F.Z)(P,"_id",M),P}),radius:l,xOffset:l,yOffset:l,type:"hexagon"};return b}function OT(e,r){var t=r.sourceField,n=r.targetField,i=r.data,a={};return i.forEach(function(s){a[s[t]]=s}),e.dataArray=e.dataArray.map(function(s){var l=s[n];return(0,H.Z)((0,H.Z)({},s),a[l])}),e}function kT(e,r){var t=r.callback;return t&&(e.dataArray=e.dataArray.map(t)),e}fe("rasterTile",$A),fe("mvt",kr),fe("geojsonvt",Ye),fe("testTile",JA),fe("geojson",Xp),fe("jsonTile",Ut),fe("image",Kt),fe("csv",oc),fe("json",Wp),fe("raster",Lr),fe("rasterRgb",qA),fe("rgb",tT),fe("ndi",nT),ce("cluster",j_),ce("filter",yT),ce("join",OT),ce("map",kT),ce("grid",xT),ce("hexagon",PT);var $_=gT;function DT(e){var r=LT();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function LT(){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=function(e){(0,Fe.Z)(t,e);var r=DT(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this),(0,F.Z)((0,Me.Z)(i),"added",!1),(0,F.Z)((0,Me.Z)(i),"eventHandle",function(a){i.polyfillEvent(a),i.emit(a.type,{target:a,data:i.markerOption.extData,lngLat:i.lngLat})}),i.markerOption=(0,H.Z)((0,H.Z)({},i.getDefault()),n),yh(["update","onMove","onMapClick"],(0,Me.Z)(i)),i.init(),i}return(0,j.Z)(t,[{key:"getMarkerLayerContainerSize",value:function(){}},{key:"getDefault",value:function(){return{element:void 0,anchor:fa.BOTTOM,offsets:[0,0],color:"#5B8FF9",draggable:!1}}},{key:"addTo",value:function(i){this.scene=i,this.mapsService=i.get(Ke.IMapService),this.sceneSerive=i.get(Ke.ISceneService);var a=this.markerOption.element;return this.mapsService.getMarkerContainer().appendChild(a),this.registerMarkerEvent(a),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&&Ci(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 a=this;if(!this.added)return this.once("added",function(){a.setElement(i)}),this;var s=this.markerOption.element;return s&&Ci(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 a=this.popup;return a?(a.isOpen()||a.addTo(this.scene),this):this}},{key:"closePopup",value:function(){var i=this;this.added||this.once("added",function(){i.closePopup()});var a=this.popup;return a&&a.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,a=i.element,s=i.anchor;this.updatePosition(),gu(a,"".concat(Ra[s]))}}},{key:"onMapClick",value:function(i){var a=this.markerOption.element;this.popup&&a&&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,a=i.element,s=i.offsets,l=this.lngLat,f=l.lng,d=l.lat,_=this.mapsService.lngLatToContainer([f,d]);if(a){a.style.display="block",a.style.whiteSpace="nowrap";var b=this.getMarkerLayerContainerSize()||this.getCurrentContainerSize(),T=b.containerHeight,M=b.containerWidth,P=b.bounds;if(!P)return;if(Math.abs(P[0][0])>180||Math.abs(P[1][0])>180){if(_.x>M){var D=this.mapsService.lngLatToContainer([f-360,d]);_.x=D.x}if(_.x<0){var G=this.mapsService.lngLatToContainer([f+360,d]);_.x=G.x}}(_.x>M||_.x<0||_.y>T||_.y<0)&&(a.style.display="none"),a.style.left=_.x+s[0]+"px",a.style.top=_.y-s[1]+"px"}}}},{key:"init",value:function(){var i=this,a=this.markerOption.element,s=this.markerOption,l=s.color,f=s.anchor;if(!a){this.defaultMarker=!0,a=Yi("div"),this.markerOption.element=a;var d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttributeNS(null,"display","block"),d.setAttributeNS(null,"height","48px"),d.setAttributeNS(null,"width","48px"),d.setAttributeNS(null,"viewBox","0 0 1024 1024");var _=document.createElementNS("http://www.w3.org/2000/svg","path");_.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"),_.setAttributeNS(null,"fill",l),d.appendChild(_),a.appendChild(d)}ou(a,"l7-marker"),Object.keys(this.markerOption.style||{}).forEach(function(b){var T,M,P=((T=i.markerOption)===null||T===void 0?void 0:T.style)&&((M=i.markerOption)===null||M===void 0?void 0:M.style[b]);a&&(a.style[b]=P)}),Gl(a,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"||Yl()||(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}(Ka.EventEmitter);function GB(e){var r=FT();return function(){var n=_getPrototypeOf(e),i;if(r){var a=_getPrototypeOf(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function FT(){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 XB=ui.merge,$B=null,YB=U(95460);function NT(e){var r=UT();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 fv=function(e){(0,Fe.Z)(t,e);var r=NT(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this),t.controlCount++,i.controlOption=(0,H.Z)((0,H.Z)({},i.getDefault(n)),n||{}),i}return(0,j.Z)(t,[{key:"getOptions",value:function(){return this.controlOption}},{key:"setOptions",value:function(i){var a=this.getDefault(i);Object.entries(i).forEach(function(s){var l=(0,_n.Z)(s,2),f=l[0],d=l[1];d===void 0&&(i[f]=a[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,H.Z)((0,H.Z)({},this.controlOption),i)}},{key:"addTo",value:function(i){this.mapsService=i.get(Ke.IMapService),this.renderService=i.get(Ke.IRendererService),this.layerService=i.get(Ke.ILayerService),this.controlService=i.get(Ke.IControlService),this.configService=i.get(Ke.IGlobalConfigService),this.scene=i.get(Ke.ISceneService),this.sceneContainer=i,this.isShow=!0,this.container=this.onAdd(),ou(this.container,"l7-control");var a=this.controlOption,s=a.className,l=a.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;Ci(this.container),this.onRemove(),this.emit("remove",this)}},{key:"onAdd",value:function(){return Yi("div")}},{key:"onRemove",value:function(){}},{key:"show",value:function(){var i=this.container;mu(i,"l7-control--hide"),this.isShow=!0,this.emit("show",this)}},{key:"hide",value:function(){var i=this.container;ou(i,"l7-control--hide"),this.isShow=!1,this.emit("hide",this)}},{key:"getDefault",value:function(i){return{position:wr.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 a=this.mapsService.getContainer();a!==null&&a.focus()}}},{key:"setPosition",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wr.TOPLEFT,a=this.controlService;return a&&a.removeControl(this),this.controlOption.position=i,a&&a.addControl(this,this.sceneContainer),this}},{key:"setClassName",value:function(i){var a=this.container,s=this.controlOption.className;s&&mu(a,s),i&&ou(a,i)}},{key:"setStyle",value:function(i){var a=this.container;i?a.setAttribute("style",i):a.removeAttribute("style")}},{key:"insertContainer",value:function(){var i=this.controlOption.position,a=this.container;if(i instanceof Element)i.appendChild(a);else{var s=this.controlService.controlCorners[i];["bottomleft","bottomright","righttop","rightbottom"].includes(i)?s.insertBefore(a,s.firstChild):s.appendChild(a)}}},{key:"checkUpdateOption",value:function(i,a){return a.some(function(s){return s in i})}}]),t}(Zs());(0,F.Z)(fv,"controlCount",0);function zT(e){var r=ZT();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 Tg=function(e){(0,Fe.Z)(t,e);var r=zT(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"isDisable",!1),n}return(0,j.Z)(t,[{key:"setIsDisable",value:function(i){if(this.isDisable=i,i){var a;(a=this.button)===null||a===void 0||a.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 Yi("button","l7-button-control ".concat(i))}},{key:"onAdd",value:function(){this.button=this.createButton(),this.isDisable=!1;var i=this.controlOption,a=i.title,s=i.btnText,l=i.btnIcon;return this.setBtnTitle(a),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 a=i.title,s=i.btnText,l=i.btnIcon;this.checkUpdateOption(i,["title"])&&this.setBtnTitle(a),this.checkUpdateOption(i,["btnIcon"])&&this.setBtnIcon(l),this.checkUpdateOption(i,["btnText"])&&this.setBtnText(s),Ia((0,Ae.Z)(t.prototype),"setOptions",this).call(this,i)}},{key:"setBtnTitle",value:function(i){var a;(a=this.button)===null||a===void 0||a.setAttribute("title",i!=null?i:"")}},{key:"setBtnIcon",value:function(i){if(this.buttonIcon&&Ci(this.buttonIcon),i){var a,s=(a=this.button)===null||a===void 0?void 0:a.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(mu(this.button,"l7-button-control--row"),mu(this.button,"l7-button-control--column"),i){var a=this.buttonText;if(!a){var s;a=Yi("div","l7-button-control__text"),(s=this.button)===null||s===void 0||s.appendChild(a),this.buttonText=a}a.innerText=i,ou(this.button,this.controlOption.vertical?"l7-button-control--column":"l7-button-control--row")}else!i&&this.buttonText&&(Ci(this.buttonText),this.buttonText=void 0)}}]),t}(fv);function VT(e){var r=jT();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function jT(){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,Fe.Z)(t,e);var r=VT(t);function t(n,i){var a;return(0,Q.Z)(this,t),a=r.call(this),(0,F.Z)((0,Me.Z)(a),"isShow",!1),(0,F.Z)((0,Me.Z)(a),"timeout",null),(0,F.Z)((0,Me.Z)(a),"show",function(){return a.isShow||!a.contentDOM.innerHTML||(a.resetPopperPosition(),mu(a.popperDOM,"l7-popper-hide"),a.isShow=!0,a.option.unique&&t.conflictPopperList.forEach(function(s){s!==(0,Me.Z)(a)&&s.isShow&&s.hide()}),a.emit("show"),window.addEventListener("pointerdown",a.onPopperUnClick)),(0,Me.Z)(a)}),(0,F.Z)((0,Me.Z)(a),"hide",function(){return a.isShow&&(ou(a.popperDOM,"l7-popper-hide"),a.isShow=!1,a.emit("hide"),window.removeEventListener("pointerdown",a.onPopperUnClick)),(0,Me.Z)(a)}),(0,F.Z)((0,Me.Z)(a),"setHideTimeout",function(){a.timeout||(a.timeout=window.setTimeout(function(){a.isShow&&(a.hide(),a.timeout=null)},300))}),(0,F.Z)((0,Me.Z)(a),"clearHideTimeout",function(){a.timeout&&(window.clearTimeout(a.timeout),a.timeout=null)}),(0,F.Z)((0,Me.Z)(a),"onBtnClick",function(){a.isShow?a.hide():a.show()}),(0,F.Z)((0,Me.Z)(a),"onPopperUnClick",function(s){Kc(s.target,[".l7-button-control",".l7-popper-content"])||a.hide()}),(0,F.Z)((0,Me.Z)(a),"onBtnMouseLeave",function(){a.setHideTimeout()}),(0,F.Z)((0,Me.Z)(a),"onBtnMouseMove",function(){a.clearHideTimeout(),!a.isShow&&a.show()}),a.button=n,a.option=i,a.init(),i.unique&&t.conflictPopperList.push((0,Me.Z)(a)),a}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&&(Ml(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),Ci(this.popperDOM)}},{key:"resetPopperPosition",value:function(){var i={},a=this.option,s=a.container,l=a.offset,f=l===void 0?[0,0]:l,d=a.placement,_=(0,_n.Z)(f,2),b=_[0],T=_[1],M=this.button.getBoundingClientRect(),P=s.getBoundingClientRect(),D=qc(M,P),G=D.left,q=D.right,se=D.top,Se=D.bottom,Ve=!1,nt=!1;/^(left|right)/.test(d)?(d.includes("left")?i.right="".concat(M.width+q,"px"):d.includes("right")&&(i.left="".concat(M.width+G,"px")),d.includes("start")?i.top="".concat(se,"px"):d.includes("end")?i.bottom="".concat(Se,"px"):(i.top="".concat(se+M.height/2,"px"),nt=!0,i.transform="translate(".concat(b,"px, calc(").concat(T,"px - 50%))"))):/^(top|bottom)/.test(d)&&(d.includes("top")?i.bottom="".concat(M.height+Se,"px"):d.includes("bottom")&&(i.top="".concat(M.height+se,"px")),d.includes("start")?i.left="".concat(G,"px"):d.includes("end")?i.right="".concat(q,"px"):(i.left="".concat(G+M.width/2,"px"),Ve=!0,i.transform="translate(calc(".concat(b,"px - 50%), ").concat(T,"px)"))),i.transform="translate(calc(".concat(b,"px - ").concat(Ve?"50%":"0%","), calc(").concat(T,"px - ").concat(nt?"50%":"0%",")");var st=d.split("-");st.length&&ou(this.popperDOM,st.map(function(at){return"l7-popper-".concat(at)}).join(" ")),xc(this.popperDOM,gh(i))}},{key:"createPopper",value:function(){var i=this.option,a=i.container,s=i.className,l=s===void 0?"":s,f=i.content,d=Yi("div","l7-popper l7-popper-hide ".concat(l)),_=Yi("div","l7-popper-content"),b=Yi("div","l7-popper-arrow");return d.appendChild(_),d.appendChild(b),a.appendChild(d),this.popperDOM=d,this.contentDOM=_,f&&this.setContent(f),d}}]),t}(Ka.EventEmitter);(0,F.Z)(Y_,"conflictPopperList",[]);function HT(e){var r=WT();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function WT(){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 GT={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"},XT=function(e){(0,Fe.Z)(t,e);var r=HT(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(),Ia((0,Ae.Z)(t.prototype),"hide",this).call(this)}},{key:"getDefault",value:function(i){var a,s=Ia((0,Ae.Z)(t.prototype),"getDefault",this).call(this,i),l=(a=i==null?void 0:i.position)!==null&&a!==void 0?a:s.position;return(0,H.Z)((0,H.Z)({},Ia((0,Ae.Z)(t.prototype),"getDefault",this).call(this,i)),{},{popperPlacement:l instanceof Element?"bottom":GT[l],popperTrigger:"click"})}},{key:"onAdd",value:function(){var i=Ia((0,Ae.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,a=this.controlOption,s=a.popperClassName,l=a.popperPlacement,f=a.popperTrigger,d=this.mapsService.getMapContainer();return this.popper=new Y_(this.button,{className:s,placement:l,trigger:f,container:d,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(Ia((0,Ae.Z)(t.prototype),"setOptions",this).call(this,i),this.checkUpdateOption(i,["popperPlacement","popperTrigger","popperClassName"])){var a=this.popper.getContent();this.popper.destroy(),this.initPopper(),this.popper.setContent(a)}}}]),t}(Tg);function $T(e){var r=YT();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 xd=function(e){return e.ActiveOptionClassName="l7-select-control-item-active",e.OptionValueAttrKey="data-option-value",e.OptionIndexAttrKey="data-option-index",e}(xd||{}),q_=function(e){(0,Fe.Z)(t,e);var r=$T(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"selectValue",[]),(0,F.Z)((0,Me.Z)(n),"createNormalOption",function(l){var f=n.selectValue.includes(l.value),d=Yi("div","l7-select-control-item ".concat(f?xd.ActiveOptionClassName:""));n.getIsMultiple()?d.appendChild(n.createCheckbox(f)):d.appendChild(n.createRadio(f)),l.icon&&d.appendChild(l.icon);var _=Yi("span");return _.innerText=l.text,d.appendChild(_),d}),(0,F.Z)((0,Me.Z)(n),"onItemClick",function(l){if(n.getIsMultiple()){var f=n.selectValue.findIndex(function(d){return d===l.value});f>-1?n.selectValue.splice(f,1):n.selectValue=[].concat((0,Qt.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){Ia((0,Ae.Z)(t.prototype),"setOptions",this).call(this,i);var a=i.options;a&&this.popper.setContent(this.getPopperContent(a))}},{key:"onAdd",value:function(){var i=Ia((0,Ae.Z)(t.prototype),"onAdd",this).call(this),a=this.controlOption.defaultValue;return a&&(this.selectValue=this.transSelectValue(a)),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 a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=this.transSelectValue(i);this.optionDOMList.forEach(function(l){var f=l.getAttribute(xd.OptionValueAttrKey),d=l.querySelector("input[type=checkbox]"),_=l.querySelector("input[type=radio]"),b=s.includes(f),T=function(P,D){vh(l,xd.ActiveOptionClassName,D),P&&ha(P,D)};T(d,b),T(_,b)}),this.selectValue=s,a&&this.emit("selectChange",this.getIsMultiple()?s:s[0])}},{key:"getIsMultiple",value:function(){return!1}},{key:"getPopperContent",value:function(i){var a=this,s=this.isImageOptions(),l=Yi("div",s?"l7-select-control--image":"l7-select-control--normal");this.getIsMultiple()&&ou(l,"l7-select-control--multiple");var f=i.map(function(d,_){var b=s?a.createImageOption(d):a.createNormalOption(d);return b.setAttribute(xd.OptionValueAttrKey,d.value),b.setAttribute(xd.OptionIndexAttrKey,window.String(_)),b.addEventListener("click",a.onItemClick.bind(a,d)),b});return l.append.apply(l,(0,Qt.Z)(f)),this.optionDOMList=f,l}},{key:"createImageOption",value:function(i){var a=this.selectValue.includes(i.value),s=Yi("div","l7-select-control-item ".concat(a?xd.ActiveOptionClassName:"")),l=Yi("img");l.setAttribute("src",i.img),op(l),s.appendChild(l);var f=Yi("div","l7-select-control-item-row");this.getIsMultiple()&&s.appendChild(this.createCheckbox(a));var d=Yi("span");return d.innerText=i.text,f.appendChild(d),s.appendChild(f),s}},{key:"createCheckbox",value:function(i){var a=Yi("input");return a.setAttribute("type","checkbox"),i&&ha(a,!0),a}},{key:"createRadio",value:function(i){var a=Yi("input");return a.setAttribute("type","radio"),i&&ha(a,!0),a}},{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}(XT),Xh=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 qT(e){var r=KT();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 QT=function(e){(0,Fe.Z)(t,e);var r=qT(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"onClick",(0,Ft.Z)(_e().mark(function l(){var f;return _e().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(f=n.controlOption.onExport,_.t0=f==null,_.t0){_.next=8;break}return _.t1=f,_.next=6,n.getImage();case 6:_.t2=_.sent,(0,_.t1)(_.t2);case 8:case"end":return _.stop()}},l)}))),(0,F.Z)((0,Me.Z)(n),"mergeImage",(0,Ft.Z)(_e().mark(function l(){var f,d,_,b,T,M,P,D,G,q,se,Se,Ve,nt,st=arguments;return _e().wrap(function(At){for(;;)switch(At.prev=At.next){case 0:for(_=n.controlOption.imageType,b=(f=(d=n.mapsService.getContainer())===null||d===void 0?void 0:d.getBoundingClientRect())!==null&&f!==void 0?f:{},T=b.width,M=T===void 0?0:T,P=b.height,D=P===void 0?0:P,G=document.createElement("canvas"),G.width=M,G.height=D,q=G.getContext("2d"),se=st.length,Se=new Array(se),Ve=0;Ve<se;Ve++)Se[Ve]=st[Ve];return At.next=9,Promise.all(Se.map(function(Wt){return new Promise(function(Sr){var _r=new Image;_r.onload=function(){Sr(_r)},_r.src=Wt})}));case 9:return nt=At.sent,nt.forEach(function(Wt){q==null||q.drawImage(Wt,0,0,M,D)}),At.abrupt("return",G.toDataURL("image/".concat(_)));case 12:case"end":return At.stop()}},l)}))),n}return(0,j.Z)(t,[{key:"onAdd",value:function(){var i=Ia((0,Ae.Z)(t.prototype),"onAdd",this).call(this);return i.addEventListener("click",this.onClick),i}},{key:"getDefault",value:function(i){return(0,H.Z)((0,H.Z)({},Ia((0,Ae.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u5BFC\u51FA\u56FE\u7247",btnIcon:Xh("l7-icon-export-picture"),imageType:"png"})}},{key:"getImage",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l;return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.mapsService.exportMap("png");case 2:return s=d.sent,d.next=5,this.scene.exportPng("png");case 5:return l=d.sent,d.abrupt("return",this.mergeImage.apply(this,(0,Qt.Z)([s,l].filter(function(_){return _}))));case 7:case"end":return d.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()}]),t}(Tg);function JT(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=ew(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function ew(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 Q_=[["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"]],$h=function(){if(typeof document=="undefined")return!1;for(var e=Q_[0],r={},t=0,n=Q_;t<n.length;t++){var i=n[t],a=i==null?void 0:i[1];if(a in document){var s=JT(i.entries()),l;try{for(s.s();!(l=s.n()).done;){var f=(0,_n.Z)(l.value,2),d=f[0],_=f[1];r[e[d]]=_}}catch(b){s.e(b)}finally{s.f()}return r}}return!1}(),J_={change:$h.fullscreenchange,error:$h.fullscreenerror},pc={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 a=function l(){pc.off("change",l),n()};pc.on("change",a);var s=r[$h.requestFullscreen](t);s instanceof Promise&&s.then(a).catch(i)})},exit:function(){return new Promise(function(r,t){if(!pc.isFullscreen){r();return}var n=function a(){pc.off("change",a),r()};pc.on("change",n);var i=document[$h.exitFullscreen]();i instanceof Promise&&i.then(n).catch(t)})},toggle:function(r,t){return pc.isFullscreen?pc.exit():pc.request(r,t)},onchange:function(r){pc.on("change",r)},onerror:function(r){pc.on("error",r)},on:function(r,t){var n=J_[r];n&&document.addEventListener(n,t,!1)},off:function(r,t){var n=J_[r];n&&document.removeEventListener(n,t,!1)},raw:$h};Object.defineProperties(pc,{isFullscreen:{get:function(){return!!document[$h.fullscreenElement]}},element:{enumerable:!0,get:function(){var r;return(r=document[$h.fullscreenElement])!==null&&r!==void 0?r:void 0}},isEnabled:{enumerable:!0,get:function(){return!!document[$h.fullscreenEnabled]}}}),$h||(pc={isEnabled:!1});var F0=pc;function tw(e){var r=rw();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function rw(){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 nw=function(e){(0,Fe.Z)(t,e);var r=tw(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this,n),(0,F.Z)((0,Me.Z)(i),"isFullscreen",!1),(0,F.Z)((0,Me.Z)(i),"toggleFullscreen",(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!F0.isEnabled){l.next=3;break}return l.next=3,F0.toggle(i.mapContainer);case 3:case"end":return l.stop()}},a)}))),(0,F.Z)((0,Me.Z)(i),"onClick",function(){i.toggleFullscreen()}),(0,F.Z)((0,Me.Z)(i),"onFullscreenChange",function(){i.isFullscreen=!!document.fullscreenElement;var a=i.controlOption,s=a.btnText,l=a.btnIcon,f=a.title,d=a.exitBtnText,_=a.exitBtnIcon,b=a.exitTitle;i.isFullscreen?(i.setBtnTitle(b),i.setBtnText(d),i.setBtnIcon(_)):(i.setBtnTitle(f),i.setBtnText(s),i.setBtnIcon(l)),i.emit("fullscreenChange",i.isFullscreen)}),F0.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 a=i.exitBtnText,s=i.exitBtnIcon,l=i.exitTitle;this.isFullscreen&&(this.checkUpdateOption(i,["exitBtnIcon"])&&this.setBtnIcon(s),this.checkUpdateOption(i,["exitBtnText"])&&this.setBtnText(a),this.checkUpdateOption(i,["exitTitle"])&&this.setBtnTitle(l)),Ia((0,Ae.Z)(t.prototype),"setOptions",this).call(this,i)}},{key:"onAdd",value:function(){var i=Ia((0,Ae.Z)(t.prototype),"onAdd",this).call(this);return i.addEventListener("click",this.onClick),this.mapContainer=Fs(this.scene.getSceneConfig().id),this.mapContainer.addEventListener("fullscreenchange",this.onFullscreenChange),i}},{key:"onRemove",value:function(){Ia((0,Ae.Z)(t.prototype),"onRemove",this).call(this),this.mapContainer.removeEventListener("fullscreenchange",this.onFullscreenChange)}},{key:"getDefault",value:function(i){return(0,H.Z)((0,H.Z)({},Ia((0,Ae.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u5168\u5C4F",btnIcon:Xh("l7-icon-fullscreen"),exitTitle:"\u9000\u51FA\u5168\u5C4F",exitBtnIcon:Xh("l7-icon-exit-fullscreen")})}}]),t}(Tg);function iw(e){var r=aw();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function aw(){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 ow=function(e){(0,Fe.Z)(t,e);var r=iw(t);function t(n){var i;return(0,Q.Z)(this,t),i=r.call(this,n),(0,F.Z)((0,Me.Z)(i),"getGeoLocation",function(){return new Promise(function(a,s){window.navigator.geolocation.getCurrentPosition(function(l){var f=l.coords,d=f!=null?f:{},_=d.longitude,b=d.latitude;!isNaN(_)&&!isNaN(b)?a([_,b]):s()},function(l){s(l)})})}),(0,F.Z)((0,Me.Z)(i),"onClick",(0,Ft.Z)(_e().mark(function a(){var s,l,f;return _e().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(window.navigator.geolocation){_.next=2;break}return _.abrupt("return");case 2:return s=i.controlOption.transform,_.next=5,i.getGeoLocation();case 5:if(l=_.sent,f=i.mapsService.getZoom(),_.t0=i.mapsService,_.t1=f>15?f:15,!s){_.next=15;break}return _.next=12,s(l);case 12:_.t2=_.sent,_.next=16;break;case 15:_.t2=l;case 16:_.t3=_.t2,_.t0.setZoomAndCenter.call(_.t0,_.t1,_.t3);case 18:case"end":return _.stop()}},a)}))),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,H.Z)((0,H.Z)({},Ia((0,Ae.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u5B9A\u4F4D",btnIcon:Xh("l7-icon-reposition")})}},{key:"onAdd",value:function(){var i=Ia((0,Ae.Z)(t.prototype),"onAdd",this).call(this);return i.addEventListener("click",this.onClick),i}}]),t}(Tg);function sw(e){var r=uw();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function uw(){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 e1(e){return Object.keys(e!=null?e:{}).every(function(r){return["layer","name","img"].includes(r)})}var t1=function(e){(0,Fe.Z)(t,e);var r=sw(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.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,F.Z)((0,Me.Z)(n),"onLayerVisibleChane",function(){n.setSelectValue(n.getLayerVisible())}),(0,F.Z)((0,Me.Z)(n),"onSelectChange",function(){n.layers.forEach(function(l){var f=n.selectValue.includes(l.name),d=l.isVisible();f&&!d&&l.show(),!f&&d&&l.hide()})}),n}return(0,j.Z)(t,[{key:"layers",get:function(){var i=this.layerService,a=this.controlOption.layers;if(Array.isArray(a)&&a.length){var s=[];return a.forEach(function(l){if(l instanceof Object&&(e1(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){var a;return(0,H.Z)((0,H.Z)({},Ia((0,Ae.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u56FE\u5C42\u63A7\u5236",btnIcon:Xh("l7-icon-layer"),options:[],multiple:(a=i==null?void 0:i.multiple)!==null&&a!==void 0?a:!0})}},{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,a=this.controlOption.layers,s=a==null?void 0:a.every(function(l){return l.img});return a?a==null?void 0:a.map(function(l){if(e1(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 a=this.checkUpdateOption(i,["layers","multiple"]);Ia((0,Ae.Z)(t.prototype),"setOptions",this).call(this,i),a&&(this.controlOption.multiple===!1&&this.handleSingleSelectionMode(),this.selectValue=this.getLayerVisible(),this.controlOption.options=this.getLayerOptions(),this.popper.setContent(this.getPopperContent(this.controlOption.options)))}},{key:"handleSingleSelectionMode",value:function(){this.layers.forEach(function(i,a){a===0?i.show():i.hide()})}},{key:"onAdd",value:function(){var i;return this.controlOption.multiple===!1&&this.handleSingleSelectionMode(),(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),Ia((0,Ae.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 this.controlOption.multiple}}]),t}(q_);function lw(e){var r=cw();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 r1=function(e){(0,Fe.Z)(t,e);var r=lw(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getDefault",value:function(){return{position:wr.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=Yi("div","l7-control-logo");return this.setLogoContent(i),i}},{key:"onRemove",value:function(){return null}},{key:"setOptions",value:function(i){Ia((0,Ae.Z)(t.prototype),"setOptions",this).call(this,i),this.checkUpdateOption(i,["img","href"])&&(Ml(this.container),this.setLogoContent(this.container))}},{key:"setLogoContent",value:function(i){var a=this.controlOption,s=a.href,l=a.img,f=Yi("img");if(f.setAttribute("src",l),f.setAttribute("aria-label","AntV logo"),op(f),s){var d=Yi("a","l7-control-logo-link");d.target="_blank",d.href=s,d.rel="noopener nofollow",d.setAttribute("rel","noopener nofollow"),d.appendChild(f),i.appendChild(d)}else i.appendChild(f)}}]),t}(fv),fw={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"}},hw={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 pw(e){var r=dw();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function dw(){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 vw=function(e){(0,Fe.Z)(t,e);var r=pw(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"onMapThemeChange",function(){n.mapsService.setMapStyle(n.selectValue[0])}),n}return(0,j.Z)(t,[{key:"getDefault",value:function(i){return(0,H.Z)((0,H.Z)({},Ia((0,Ae.Z)(t.prototype),"getDefault",this).call(this,i)),{},{title:"\u5730\u56FE\u6837\u5F0F",btnIcon:Xh("l7-icon-color"),options:[]})}},{key:"getStyleOptions",value:function(){var i=this.mapsService.getType()==="mapbox"?hw:fw;return Object.entries(this.mapsService.getMapStyleConfig()).filter(function(a){var s=(0,_n.Z)(a,2),l=s[0],f=s[1];return typeof f=="string"&&l!=="blank"}).map(function(a){var s,l=(0,_n.Z)(a,2),f=l[0],d=l[1],_=(s=i[f])!==null&&s!==void 0?s:{},b=_.text,T=_.img;return{text:b!=null?b:f,value:d,img:T,key:f}})}},{key:"getMapStyle",value:function(){return this.mapsService.getMapStyle()}},{key:"onAdd",value:function(){var i,a=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(_){return _.key===f}))===null||l===void 0?void 0:l.value)!==null&&s!==void 0?s:f}else{var d=this.getMapStyle();d?this.controlOption.defaultValue=d:this.mapsService.map.once("styledata",function(){var _=a.mapsService.getMapStyle();a.controlOption.defaultValue=_,a.setSelectValue(_,!1)})}return this.on("selectChange",this.onMapThemeChange),Ia((0,Ae.Z)(t.prototype),"onAdd",this).call(this)}},{key:"getIsMultiple",value:function(){return!1}}]),t}(q_);function mw(e){var r=gw();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 yw=function(e){(0,Fe.Z)(t,e);var r=mw(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"location",[0,0]),(0,F.Z)((0,Me.Z)(n),"onMouseMove",function(l){var f=n.location,d=l.lngLat||l.lnglat,_=n.controlOption.transform;d&&(f=[d.lng,d.lat]),n.location=f,_&&(f=_(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,H.Z)((0,H.Z)({},Ia((0,Ae.Z)(t.prototype),"getDefault",this).call(this,i)),{},{position:wr.BOTTOMLEFT,transform:function(s){var l=(0,_n.Z)(s,2),f=l[0],d=l[1];return[+(+f).toFixed(6),+(+d).toFixed(6)]}})}},{key:"onAdd",value:function(){var i=Yi("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}(fv);function _w(e){var r=xw();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function xw(){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 bw=function(e){(0,Fe.Z)(t,e);var r=_w(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"update",function(){var l=n.mapsService,f=n.controlOption.maxWidth,d=l.getSize()[1]/2,_=l.containerToLngLat([0,d]),b=l.containerToLngLat([f,d]),T=Kl([_.lng,_.lat],[b.lng,b.lat]);n.updateScales(T)}),n}return(0,j.Z)(t,[{key:"getDefault",value:function(i){return(0,H.Z)((0,H.Z)({},Ia((0,Ae.Z)(t.prototype),"getDefault",this).call(this,i)),{},{name:"scale",position:wr.BOTTOMLEFT,maxWidth:100,metric:!0,updateWhenIdle:!1,imperial:!1,lockWidth:!0})}},{key:"onAdd",value:function(){var i="l7-control-scale",a=Yi("div",i);this.resetScaleLines(a);var s=this.controlOption.updateWhenIdle;return this.mapsService.on(s?"moveend":"mapmove",this.update),this.mapsService.on(s?"zoomend":"zoomchange",this.update),a}},{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){Ia((0,Ae.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 a=this.controlOption,s=a.metric,l=a.imperial;s&&i&&this.updateMetric(i),l&&i&&this.updateImperial(i)}},{key:"resetScaleLines",value:function(i){Ml(i);var a=this.controlOption,s=a.metric,l=a.imperial,f=a.maxWidth,d=a.lockWidth;d&&xc(i,"width: ".concat(f,"px")),s&&(this.mScale=Yi("div","l7-control-scale-line",i)),l&&(this.iScale=Yi("div","l7-control-scale-line",i)),this.update()}},{key:"updateScale",value:function(i,a,s){var l=this.controlOption.maxWidth;i.style.width=Math.round(l*s)+"px",i.innerHTML=a}},{key:"getRoundNum",value:function(i){var a=Math.pow(10,(Math.floor(i)+"").length-1),s=i/a;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,a*s}},{key:"updateMetric",value:function(i){var a=this.getRoundNum(i),s=a<1e3?a+" m":a/1e3+" km";this.updateScale(this.mScale,s,a/i)}},{key:"updateImperial",value:function(i){var a=i*3.2808399,s,l,f;a>5280?(s=a/5280,l=this.getRoundNum(s),this.updateScale(this.iScale,l+" mi",l/s)):(f=this.getRoundNum(a),this.updateScale(this.iScale,f+" ft",f/a))}}]),t}(fv),Cp,n1=(Cp={},(0,F.Z)(Cp,ff.additive,{enable:!0,func:{srcRGB:I.ONE,dstRGB:I.ONE,srcAlpha:1,dstAlpha:1}}),(0,F.Z)(Cp,ff.none,{enable:!1}),(0,F.Z)(Cp,ff.normal,{enable:!0,func:{srcRGB:I.SRC_ALPHA,dstRGB:I.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}),(0,F.Z)(Cp,ff.subtractive,{enable:!0,func:{srcRGB:I.ONE,dstRGB:I.ONE,srcAlpha:I.ZERO,dstAlpha:I.ONE_MINUS_SRC_COLOR},equation:{rgb:I.FUNC_SUBTRACT,alpha:I.FUNC_SUBTRACT}}),(0,F.Z)(Cp,ff.max,{enable:!0,func:{srcRGB:I.ONE,dstRGB:I.ONE},equation:{rgb:I.MAX_EXT}}),(0,F.Z)(Cp,ff.min,{enable:!0,func:{srcRGB:I.ONE,dstRGB:I.ONE},equation:{rgb:I.MIN_EXT}}),Cp);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,a=e.getLayerConfig(),s=a.enableTAA;return s?i.add(n("taa")):i.add(n("render")),i1(r).forEach(function(l){var f=(0,_n.Z)(l,2),d=f[0],_=f[1];i.add(t(d),_)}),i.add(t("copy")),i}var Ew=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(Ke.ILayerService),a=this.layer;if(a.tileLayer)return a.tileLayer.pickRender(t);a.hooks.beforePickingEncode.call(),i.renderTileLayerMask(a),a.renderModels({ispick:!0}),a.hooks.afterPickingEncode.call()}},{key:"pick",value:function(t,n){var i=this.layer.getContainer(),a=i.get(Ke.IPickingService);return t.type==="RasterLayer"?this.pickRasterLayer(t,n):(this.pickRender(n),a.pickFromPickingFBO(t,n))}},{key:"pickRasterLayer",value:function(t,n,i){var a=this.layer.getContainer(),s=a.get(Ke.IPickingService),l=a.get(Ke.IMapService),f=this.layer.getSource().extent,d=Il(n.lngLat,f),_={x:n.x,y:n.y,type:n.type,lngLat:n.lngLat,target:n,rasterValue:null},b=i||t;if(d){var T=this.readRasterValue(t,f,l,n.x,n.y);return _.rasterValue=T,s.triggerHoverOnLayer(b,_),!0}else return _.type=n.type==="mousemove"?"mouseout":"un"+n.type,s.triggerHoverOnLayer(b,(0,H.Z)((0,H.Z)({},_),{},{type:"unpick"})),s.triggerHoverOnLayer(b,_),!1}},{key:"readRasterValue",value:function(t,n,i,a,s){var l=t.getSource().data.dataArray[0],f=(0,_n.Z)(n,4),d=f[0],_=d===void 0?0:d,b=f[1],T=b===void 0?0:b,M=f[2],P=M===void 0?10:M,D=f[3],G=D===void 0?-10:D,q=i.lngLatToContainer([_,T]),se=i.lngLatToContainer([P,G]),Se=se.x-q.x,Ve=q.y-se.y,nt=[(a-q.x)/Se,(s-se.y)/Ve],st=l.width||1,at=l.height||1,At=Math.floor(nt[0]*st),Wt=Math.floor(nt[1]*at),Sr=Math.max(0,Wt-1)*st+At,_r=l.data[Sr];return _r}},{key:"selectFeature",value:function(t){var n=this.layer,i=(0,_n.Z)(t,3),a=i[0],s=i[1],l=i[2];n.hooks.beforeSelect.call([a,s,l])}},{key:"highlightPickedFeature",value:function(t){var n=(0,_n.Z)(t,3),i=n[0],a=n[1],s=n[2];this.layer.hooks.beforeHighlight.call([i,a,s])}},{key:"getFeatureById",value:function(t){return this.layer.getSource().getFeatureById(t)}}]),e}(),Sw=function(){function e(r){(0,Q.Z)(this,e),this.layer=r;var t=this.layer.getContainer();this.rendererService=t.get(Ke.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,a=this.getColorRampBar(t,n),s=i({data:new Uint8Array(a.data),width:a.width,height:a.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 is(t);case"quantize":return qo(t);case"custom":return Du(t,n);case"linear":return ca(t,n);default:return Vo(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}(),Aw=["passes"],Tw=["moduleName","vertexShader","fragmentShader","inject","triangulation","styleOption"],o1,N0,s1;function ww(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Cw(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function Cw(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 Rw(e){var r=Mw();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 U0=ui.isEqual,l1=ui.isFunction,c1=ui.isNumber,Iu=ui.isObject,Iw=ui.isPlainObject,Pw=ui.isUndefined,f1=0,Rp=(o1=D0(Ke.IGlobalConfigService),N0=function(e){(0,Fe.Z)(t,e);var r=Rw(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,F.Z)((0,Me.Z)(n),"id","".concat(f1++)),(0,F.Z)((0,Me.Z)(n),"name","".concat(f1)),(0,F.Z)((0,Me.Z)(n),"visible",!0),(0,F.Z)((0,Me.Z)(n),"zIndex",0),(0,F.Z)((0,Me.Z)(n),"inited",!1),(0,F.Z)((0,Me.Z)(n),"layerModelNeedUpdate",!1),(0,F.Z)((0,Me.Z)(n),"pickedFeatureID",null),(0,F.Z)((0,Me.Z)(n),"selectedFeatureID",null),(0,F.Z)((0,Me.Z)(n),"styleNeedUpdate",!1),(0,F.Z)((0,Me.Z)(n),"forceRender",!1),(0,F.Z)((0,Me.Z)(n),"clusterZoom",0),(0,F.Z)((0,Me.Z)(n),"defaultSourceConfig",{data:[],options:{parser:{type:"json"}}}),(0,F.Z)((0,Me.Z)(n),"dataState",{dataSourceNeedUpdate:!1,dataMappingNeedUpdate:!1,filterNeedUpdate:!1,featureScaleNeedUpdate:!1,StyleAttrNeedUpdate:!1}),(0,F.Z)((0,Me.Z)(n),"hooks",{init:new hg,afterInit:new xf,beforeRender:new xf,beforeRenderData:new Qd,afterRender:new Ul,beforePickingEncode:new Ul,afterPickingEncode:new Ul,beforeHighlight:new Ul(["pickedColor"]),afterHighlight:new Ul,beforeSelect:new Ul(["pickedColor"]),afterSelect:new Ul,beforeDestroy:new Ul,afterDestroy:new Ul}),(0,F.Z)((0,Me.Z)(n),"models",[]),(0,F.Z)((0,Me.Z)(n),"startInit",!1),(0,F.Z)((0,Me.Z)(n),"layerChildren",[]),(0,F.Z)((0,Me.Z)(n),"masks",[]),Di((0,Me.Z)(n),"configService",s1,(0,Me.Z)(n)),(0,F.Z)((0,Me.Z)(n),"animateOptions",{enable:!1}),(0,F.Z)((0,Me.Z)(n),"currentPickId",null),(0,F.Z)((0,Me.Z)(n),"encodeStyleAttribute",{}),(0,F.Z)((0,Me.Z)(n),"enableShaderEncodeStyles",[]),(0,F.Z)((0,Me.Z)(n),"enableDataEncodeStyles",[]),(0,F.Z)((0,Me.Z)(n),"enablg",[]),(0,F.Z)((0,Me.Z)(n),"pendingStyleAttributes",[]),(0,F.Z)((0,Me.Z)(n),"scaleOptions",{}),(0,F.Z)((0,Me.Z)(n),"animateStatus",!1),(0,F.Z)((0,Me.Z)(n),"isDestroyed",!1),(0,F.Z)((0,Me.Z)(n),"uniformBuffers",[]),(0,F.Z)((0,Me.Z)(n),"encodeDataLength",0),(0,F.Z)((0,Me.Z)(n),"sourceEvent",function(){n.dataState.dataSourceNeedUpdate=!0;var a=n.getLayerConfig();a&&a.autoFit&&n.fitBounds(a.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.updateLayerConfig({maskLayers:this.masks}),this.enableMask()}},{key:"removeMask",value:function(i){var a=this.masks.indexOf(i);a>-1&&this.masks.splice(a,1),this.updateLayerConfig({maskLayers:this.masks})}},{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 a=this.masks.indexOf(i);a>-1&&this.masks.splice(a,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 a=this;if(Object.keys(i).map(function(l){l in a.rawConfig&&(a.rawConfig[l]=i[l])}),!this.startInit)this.needUpdateConfig=(0,H.Z)((0,H.Z)({},this.needUpdateConfig),i);else{var s=this.container.get(Ke.SceneID);this.configService.setLayerConfig(s,this.id,(0,H.Z)((0,H.Z)((0,H.Z)({},this.configService.getLayerConfig(this.id)),this.needUpdateConfig),i)),this.needUpdateConfig={}}}},{key:"setContainer",value:function(i,a){this.container=i,this.sceneContainer=a}},{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,Ft.Z)(_e().mark(function a(){var s=this,l,f,d,_,b,T,M;return _e().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:l=this.container.get(Ke.SceneID),this.startInit=!0,this.configService.setLayerConfig(l,this.id,this.rawConfig),this.layerType=this.rawConfig.layerType,this.iconService=this.container.get(Ke.IIconService),this.fontService=this.container.get(Ke.IFontService),this.rendererService=this.container.get(Ke.IRendererService),this.layerService=this.container.get(Ke.ILayerService),this.debugService=this.container.get(Ke.IDebugService),this.interactionService=this.container.get(Ke.IInteractionService),this.pickingService=this.container.get(Ke.IPickingService),this.mapService=this.container.get(Ke.IMapService),f=this.getLayerConfig(),d=f.enableMultiPassRenderer,_=f.passes,d&&_!==null&&_!==void 0&&_.length&&_.length>0&&this.mapService.on("mapAfterFrameChange",function(){s.renderLayers()}),this.cameraService=this.container.get(Ke.ICameraService),this.coordinateService=this.container.get(Ke.ICoordinateSystemService),this.shaderModuleService=this.container.get(Ke.IShaderModuleService),this.postProcessingPassFactory=this.container.get(Ke.IFactoryPostProcessingPass),this.normalPassFactory=this.container.get(Ke.IFactoryNormalPass),this.styleAttributeService=this.container.get(Ke.IStyleAttributeService),d&&(this.multiPassRenderer=this.container.get(Ke.IMultiPassRenderer),this.multiPassRenderer.setLayer(this)),this.pendingStyleAttributes.forEach(function(G){var q=G.attributeName,se=G.attributeField,Se=G.attributeValues,Ve=G.updateOptions;s.styleAttributeService.updateStyleAttribute(q,{scale:(0,H.Z)({field:se},s.splitValuesAndCallbackInAttribute(Se,se?void 0:s.getLayerConfig()[q]))},Ve)}),this.pendingStyleAttributes=[],this.plugins=this.container.getAll(Ke.ILayerPlugin),b=ww(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(G){b.e(G)}finally{b.f()}return this.layerPickService=new Ew(this),this.textureService=new Sw(this),this.log(Ds.LayerInitStart),D.next=31,this.hooks.init.promise();case 31:this.log(Ds.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 D.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"log",value:function(i){var a,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};(a=this.debugService)===null||a===void 0||a.log(l,f)}}},{key:"updateModelData",value:function(i){i.attributes&&i.elements?this.models.map(function(a){a.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(),a=i.animateOption;a!=null&&a.enable&&(this.layerService.startAnimate(),this.animateStatus=!0)}},{key:"color",value:function(i,a,s){return this.updateStyleAttribute("color",i,a,s),this}},{key:"texture",value:function(i,a,s){return this.updateStyleAttribute("texture",i,a,s),this}},{key:"rotate",value:function(i,a,s){return this.updateStyleAttribute("rotate",i,a,s),this}},{key:"size",value:function(i,a,s){return this.updateStyleAttribute("size",i,a,s),this}},{key:"filter",value:function(i,a,s){var l=this.updateStyleAttribute("filter",i,a,s);return this.dataState.dataSourceNeedUpdate=l&&this.inited,this}},{key:"shape",value:function(i,a,s){this.shapeOption={field:i,values:a};var l=this.updateStyleAttribute("shape",i,a,s);return this.dataState.dataSourceNeedUpdate=l&&this.inited,this}},{key:"label",value:function(i,a,s){return this.pendingStyleAttributes.push({attributeName:"label",attributeField:i,attributeValues:a,updateOptions:s}),this}},{key:"animate",value:function(i){var a={};return Iu(i)?(a.enable=!0,a=(0,H.Z)((0,H.Z)({},a),i)):a.enable=i,this.updateLayerConfig({animateOption:a}),this}},{key:"source",value:function(i,a){return(i==null?void 0:i.type)==="source"?(this.setSource(i),this):(this.sourceOption={data:i,options:a},this.clusterZoom=0,this)}},{key:"setData",value:function(i,a){var s=this;return this.inited?(this.log(Ds.SourceInitStart,es.UPDATE),this.layerSource.setData(i,a),this.log(Ds.SourceInitEnd,es.UPDATE)):this.on("inited",function(){s.log(Ds.SourceInitStart,es.UPDATE);var l=s.getSource();l?s.layerSource.setData(i,a):s.source(new $_(i,a)),s.layerSource.once("update",function(){s.log(Ds.SourceInitEnd,es.UPDATE)})}),this}},{key:"style",value:function(i){var a=this,s=i.passes,l=(0,wa.Z)(i,Aw);s&&i1(s).forEach(function(d){var _=a.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(d[0]);_&&_.updateOptions(d[1])}),l.borderColor&&(l.stroke=l.borderColor),l.borderWidth&&(l.strokeWidth=l.borderWidth);var f=l;return Object.keys(l).forEach(function(d){var _=l[d];Array.isArray(_)&&_.length===2&&!c1(_[0])&&!c1(_[1])&&(f[d]={field:_[0],value:_[1]})}),this.encodeStyle(f),this.updateLayerConfig(f),this}},{key:"encodeStyle",value:function(i){var a=this;Object.keys(i).forEach(function(s){[].concat((0,Qt.Z)(a.enableShaderEncodeStyles),(0,Qt.Z)(a.enableDataEncodeStyles)).includes(s)&&Iw(i[s])&&(i[s].field||i[s].value)&&!U0(a.encodeStyleAttribute[s],i[s])?(a.encodeStyleAttribute[s]=i[s],a.updateStyleAttribute(s,i[s].field,i[s].value),a.inited&&(a.dataState.dataMappingNeedUpdate=!0)):a.encodeStyleAttribute[s]&&(delete a.encodeStyleAttribute[s],a.dataState.dataSourceNeedUpdate=!0)})}},{key:"scale",value:function(i,a){var s=(0,H.Z)({},this.scaleOptions);if(Iu(i)?this.scaleOptions=(0,H.Z)((0,H.Z)({},this.scaleOptions),i):this.scaleOptions[i]=a,this.styleAttributeService&&!U0(s,this.scaleOptions)){var l=Iu(i)?i:(0,F.Z)({},i,a);this.styleAttributeService.updateScaleAttribute(l)}return this}},{key:"renderLayers",value:function(){this.rendering=!0,this.layerService.reRender(),this.rendering=!1}},{key:"prerender",value:function(){}},{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,Ft.Z)(_e().mark(function a(){return _e().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()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"active",value:function(i){var a={};return a.enableHighlight=Iu(i)?!0:i,Iu(i)?(a.enableHighlight=!0,i.color&&(a.highlightColor=i.color),i.mix&&(a.activeMix=i.mix)):a.enableHighlight=!!i,this.updateLayerConfig(a),this}},{key:"setActive",value:function(i,a){var s=this;if(Iu(i)){var l=i.x,f=l===void 0?0:l,d=i.y,_=d===void 0?0:d;this.updateLayerConfig({highlightColor:Iu(a)?a.color:this.getLayerConfig().highlightColor,activeMix:Iu(a)?a.mix:this.getLayerConfig().activeMix}),this.pick({x:f,y:_})}else this.updateLayerConfig({pickedFeatureID:i,highlightColor:Iu(a)?a.color:this.getLayerConfig().highlightColor,activeMix:Iu(a)?a.mix:this.getLayerConfig().activeMix}),this.hooks.beforeHighlight.call(na(i)).then(function(){setTimeout(function(){s.reRender()},1)})}},{key:"select",value:function(i){var a={};return a.enableSelect=Iu(i)?!0:i,Iu(i)?(a.enableSelect=!0,i.color&&(a.selectColor=i.color),i.mix&&(a.selectMix=i.mix)):a.enableSelect=!!i,this.updateLayerConfig(a),this}},{key:"setSelect",value:function(i,a){var s=this;if(Iu(i)){var l=i.x,f=l===void 0?0:l,d=i.y,_=d===void 0?0:d;this.updateLayerConfig({selectColor:Iu(a)?a.color:this.getLayerConfig().selectColor,selectMix:Iu(a)?a.mix:this.getLayerConfig().selectMix}),this.pick({x:f,y:_})}else this.updateLayerConfig({pickedFeatureID:i,selectColor:Iu(a)?a.color:this.getLayerConfig().selectColor,selectMix:Iu(a)?a.mix:this.getLayerConfig().selectMix}),this.hooks.beforeSelect.call(na(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(),a=this.getLayerConfig(),s=a.visible,l=a.minZoom,f=l===void 0?-1/0:l,d=a.maxZoom,_=d===void 0?1/0:d;return!!s&&i>=f&&i<_}},{key:"setMultiPass",value:function(i,a){if(this.updateLayerConfig({enableMultiPassRenderer:i}),a&&this.updateLayerConfig({passes:a}),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 d=this.rendererService.getViewportSize(),_=d.width,b=d.height;this.multiPassRenderer.resize(_,b)}return this}},{key:"setMinZoom",value:function(i){return this.updateLayerConfig({minZoom:i}),this}},{key:"getMinZoom",value:function(){var i=this.getLayerConfig(),a=i.minZoom;return a}},{key:"getMaxZoom",value:function(){var i=this.getLayerConfig(),a=i.maxZoom;return a}},{key:"get",value:function(i){var a=this.getLayerConfig();return a[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 a=this.getSource(),s=a.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,a,s,l,f,d=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 _=this.getLayerConfig(),b=_.maskfence;b&&(this.masks.map(function(T){return T.destroy(!1)}),this.masks=[]),this.hooks.beforeDestroy.call(),this.layerSource.off("update",this.sourceEvent),(a=this.multiPassRenderer)===null||a===void 0||a.destroy(),this.textureService.destroy(),this.styleAttributeService.clearAllAttributes(),this.hooks.afterDestroy.call(),(s=this.layerModel)===null||s===void 0||s.clearModels(d),(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(a){return a.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 a=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(a.coordCenter===void 0){var d,_=a.layerSource.center;a.coordCenter=_,(d=a.mapService)!==null&&d!==void 0&&d.setCoordCenter&&a.mapService.setCoordCenter(_)}if(f==="update"){if(a.tileLayer){a.tileLayer.reload();return}a.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 a,s,l,f=this.styleAttributeService.getLayerStyleAttribute(i),d=(f==null||(a=f.scale)===null||a===void 0?void 0:a.scalers)||[];return{type:(s=d[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 a=this.styleAttributeService.getLayerAttributeScale(i);if(!a)return[];if(a.invertExtent){var s=a.range().map(function(d){return(0,F.Z)({value:a.invertExtent(d)},i,d)});return s}else if(a.ticks){var l=a.ticks().map(function(d){return(0,F.Z)({value:d},i,a(d))});return l}else if(a!=null&&a.domain){var f=a.domain().filter(function(d){return!Pw(d)}).map(function(d){return(0,F.Z)({value:d},i,a(d))});return f}return[]}},{key:"pick",value:function(i){var a=i.x,s=i.y;this.interactionService.triggerHover({x:a,y:s})}},{key:"boxSelect",value:function(i,a){this.pickingService.boxPickLayer(this,i,a)}},{key:"buildLayerModel",value:function(){var n=(0,Ft.Z)(_e().mark(function a(s){var l=this,f,d,_,b,T,M,P,D,G,q,se,Se;return _e().wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:return f=s.moduleName,d=s.vertexShader,_=s.fragmentShader,b=s.inject,T=s.triangulation,M=s.styleOption,P=(0,wa.Z)(s,Tw),this.shaderModuleService.registerModule(f,{vs:d,fs:_,inject:b}),D=this.shaderModuleService.getModule(f),G=D.vs,q=D.fs,se=D.uniforms,Se=this.rendererService.createModel,nt.abrupt("return",new Promise(function(st){var at=l.styleAttributeService.createAttributesAndIndices(l.encodedData,T,M),At=at.attributes,Wt=at.elements,Sr=at.count,_r=(0,H.Z)({attributes:At,uniforms:se,fs:q,vs:G,elements:Wt,blend:n1[ff.normal],uniformBuffers:[].concat((0,Qt.Z)(l.layerModel.uniformBuffers),(0,Qt.Z)(l.rendererService.uniformBuffers),[l.getLayerUniformBuffer(),l.getPickingUniformBuffer()]),textures:l.layerModel.textures},P);Sr&&(_r.count=Sr);var Gr=Se(_r);st(Gr)}));case 5:case"end":return nt.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"createAttributes",value:function(i){var a=i.triangulation,s=this.styleAttributeService.createAttributes(this.encodedData,a),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 a=this.getLayerConfig(),s=a.enableHighlight,l=s===void 0?!0:s,f=a.enableSelect,d=f===void 0?!0:f,_=this.eventNames().indexOf(i)!==-1||this.eventNames().indexOf("un"+i)!==-1;return(i==="click"||i==="dblclick")&&d&&(_=!0),i==="mousemove"&&(l||this.eventNames().indexOf("mouseenter")!==-1||this.eventNames().indexOf("unmousemove")!==-1||this.eventNames().indexOf("mouseout")!==-1)&&(_=!0),this.isVisible()&&_}},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return l.stop()}},a)}));function i(){return n.apply(this,arguments)}return i}()},{key:"rebuildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.buildModels();case 2:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"renderMulPass",value:function(){var n=(0,Ft.Z)(_e().mark(function a(s){return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,s.render();case 2:case"end":return f.stop()}},a)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"renderModels",value:function(){var i=this,a=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(a),textures:i.layerModel.textures},(a==null?void 0:a.ispick)||!1)}),this.hooks.afterRender.call(),this)}},{key:"updateStyleAttribute",value:function(i,a,s,l){var f=this.configService.getAttributeConfig(this.id)||{};return U0(f[i],{field:a,values:s})?!1:(["color","size","texture","rotate","filter","label","shape"].indexOf(i)!==-1&&this.configService.setAttributeConfig(this.id,(0,F.Z)({},i,{field:a,values:s})),this.startInit?this.styleAttributeService.updateStyleAttribute(i,{scale:(0,H.Z)({field:a},this.splitValuesAndCallbackInAttribute(s,this.getLayerConfig()[a]))},l):this.pendingStyleAttributes.push({attributeName:i,attributeField:a,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,Ft.Z)(_e().mark(function a(){var s,l;return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return this.models.forEach(function(_){return _.destroy()}),this.models=[],this.uniformBuffers.forEach(function(_){_.destroy()}),this.uniformBuffers=[],s=this.rendererService.createBuffer({data:new Float32Array(20).fill(0),isUBO:!0}),this.uniformBuffers.push(s),l=this.rendererService.createBuffer({data:new Float32Array(20).fill(0),isUBO:!0}),this.uniformBuffers.push(l),d.next=10,this.layerModel.initModels();case 10:this.models=d.sent;case 11:case"end":return d.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getLayerUniformBuffer",value:function(){return this.uniformBuffers[0]}},{key:"getPickingUniformBuffer",value:function(){return this.uniformBuffers[1]}},{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}(Ka.EventEmitter),s1=Pi(N0.prototype,"configService",[o1],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),N0);function Ow(e,r){return{enable:e,mask:255,func:{cmp:I.EQUAL,ref:r?1:0,mask:1}}}function h1(e){return e.maskOperation===rd.OR?{enable:!0,mask:255,func:{cmp:I.ALWAYS,ref:1,mask:255},opFront:{fail:I.KEEP,zfail:I.REPLACE,zpass:I.REPLACE}}:{enable:!0,mask:255,func:{cmp:e.stencilType===Kf.SINGLE||e.stencilIndex===0?I.ALWAYS:I.LESS,ref:e.stencilType===Kf.SINGLE?1:e.stencilIndex===0?2:1,mask:255},opFront:{fail:I.KEEP,zfail:I.REPLACE,zpass:I.REPLACE}}}var Yn=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[e.UV=14]="UV",e[e.LINEAR=15]="LINEAR",e}({});function kw(e){switch(e){case"rotation":return{name:"Rotation",type:In.Attribute,descriptor:{name:"a_Rotation",shaderLocation:Yn.ROTATION,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.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:In.Attribute,descriptor:{name:"a_Stroke",shaderLocation:Yn.STROKE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.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:In.Attribute,descriptor:{name:"a_Opacity",shaderLocation:Yn.OPACITY,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(t){var n=t.opacity,i=n===void 0?1:n;return[i]}}};case"extrusionBase":return{name:"extrusionBase",type:In.Attribute,descriptor:{name:"a_ExtrusionBase",shaderLocation:Yn.EXTRUSION_BASE,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(t){var n=t.extrusionBase,i=n===void 0?0:n;return[i]}}};case"offsets":return{name:"offsets",type:In.Attribute,descriptor:{name:"a_Offsets",shaderLocation:Yn.OFFSETS,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(t){var n=t.offsets;return n}}};case"thetaOffset":return{name:"thetaOffset",type:In.Attribute,descriptor:{name:"a_ThetaOffset",shaderLocation:15,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(t){var n=t.thetaOffset,i=n===void 0?1:n;return[i]}}};default:return}}var Dw={opacity:1,stroke:[1,0,0,1],offsets:[0,0],rotation:0,extrusionBase:0,strokeOpacity:1,thetaOffset:.314},wg={opacity:"float",stroke:"vec4",offsets:"vec2",textOffset:"vec2",rotation:"float",extrusionBase:"float",strokeOpacity:"float",thetaOffset:"float"};function qB(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.max(Math.ceil(e/4)*4,4)}var d1,z0,v1,Z0={opacity:Yn.OPACITY,stroke:Yn.STROKE,offsets:Yn.OFFSETS,rotation:Yn.ROTATION,extrusionBase:Yn.EXTRUSION_BASE,thetaOffset:15},Na=(d1=D0(Ke.IGlobalConfigService),z0=function(){function e(r){(0,Q.Z)(this,e),(0,F.Z)(this,"uniformBuffers",[]),(0,F.Z)(this,"textures",[]),(0,F.Z)(this,"preStyleAttribute",{}),(0,F.Z)(this,"encodeStyleAttribute",{}),Di(this,"configService",v1,this),this.layer=r,this.rendererService=r.getContainer().get(Ke.IRendererService),this.pickingService=r.getContainer().get(Ke.IPickingService),this.shaderModuleService=r.getContainer().get(Ke.IShaderModuleService),this.styleAttributeService=r.getContainer().get(Ke.IStyleAttributeService),this.mapService=r.getContainer().get(Ke.IMapService),this.iconService=r.getContainer().get(Ke.IIconService),this.fontService=r.getContainer().get(Ke.IFontService),this.cameraService=r.getContainer().get(Ke.ICameraService),this.layerService=r.getContainer().get(Ke.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[ff[i]]}},{key:"getStencil",value:function(t){var n=this.layer.getLayerConfig(),i=n.mask,a=i===void 0?!1:i,s=n.maskInside,l=s===void 0?!0:s,f=n.enableMask,d=n.maskOperation,_=d===void 0?rd.AND:d;if(this.layer.type==="MaskLayer")return h1({isStencil:!0,stencilType:Kf.SINGLE});if(t.isStencil)return h1((0,H.Z)((0,H.Z)({},t),{},{maskOperation:_}));var b=a||f&&this.layer.masks.length!==0||this.layer.tileMask!==void 0;return Ow(b,l)}},{key:"getDefaultStyle",value:function(){return{}}},{key:"getUninforms",value:function(){var t=this.getCommonUniformsInfo(),n=this.getUniformsBufferInfo(this.getStyleAttribute());this.updateStyleUnifoms();var i=(0,H.Z)((0,H.Z)({},n.uniformsOption),t.uniformsOption);return!this.rendererService.hasOwnProperty("device")&&this.textures&&this.textures.length===1&&(i.u_texture=this.textures[0]),i}},{key:"getAnimateUniforms",value:function(){return{}}},{key:"needUpdate",value:function(){var r=(0,Ft.Z)(_e().mark(function n(){return _e().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",!1);case 1:case"end":return a.stop()}},n)}));function t(){return r.apply(this,arguments)}return t}()},{key:"buildModels",value:function(){var r=(0,Ft.Z)(_e().mark(function n(){return _e().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return a.stop()}},n)}));function t(){return r.apply(this,arguments)}return t}()},{key:"initModels",value:function(){var r=(0,Ft.Z)(_e().mark(function n(){return _e().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return a.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:"prerender",value:function(){}},{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(wg[l]," u_").concat(l,";"));var f=Z0[l];!f&&l==="THETA_OFFSET"&&(f=15),n+=`
|
|
#ifdef USE_ATTRIBUTE_`.concat(l.toUpperCase(),`
|
|
layout(location = `).concat(Z0[l],") in ").concat(wg[l]," a_").concat(l.charAt(0).toUpperCase()+l.slice(1),`;
|
|
#endif
|
|
|
|
`)});var a=i.length?`
|
|
layout(std140) uniform AttributeUniforms {
|
|
`.concat(i.join(`
|
|
`),`
|
|
};
|
|
`):"";n+=a;var s="";return this.layer.enableShaderEncodeStyles.forEach(function(l){s+=`
|
|
|
|
#ifdef USE_ATTRIBUTE_`.concat(l.toUpperCase(),`
|
|
`).concat(wg[l]," ").concat(l," = a_").concat(l.charAt(0).toUpperCase()+l.slice(1),`;
|
|
#else
|
|
`).concat(wg[l]," ").concat(l," = u_").concat(l,`;
|
|
#endif
|
|
|
|
`)}),{"vs:#decl":n,"fs:#decl":a,"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 a=t.layer.getLayerConfig()[i],s=typeof a=="undefined"?Dw[i]:a;i==="stroke"&&(s=vi(s)),n["u_"+i]=s}}),n}},{key:"registerStyleAttribute",value:function(){var t=this;Object.keys(this.layer.encodeStyleAttribute).forEach(function(n){var i=kw(n);i&&(t.styleAttributeService.registerStyleAttribute(i),i.descriptor&&(i.descriptor.shaderLocation=Z0[n]))})}},{key:"updateEncodeAttribute",value:function(t,n){this.encodeStyleAttribute[t]=n}},{key:"initUniformsBuffer",value:function(){var t=this.getUniformsBufferInfo(this.getStyleAttribute()),n=this.getCommonUniformsInfo();t.uniformsLength!==0&&(this.attributeUnifoms=this.rendererService.createBuffer({data:new Float32Array(p1(t.uniformsLength)).fill(0),isUBO:!0}),this.uniformBuffers.push(this.attributeUnifoms)),n.uniformsLength!==0&&(this.commonUnifoms=this.rendererService.createBuffer({data:new Float32Array(p1(n.uniformsLength)).fill(0),isUBO:!0}),this.uniformBuffers.push(this.commonUnifoms))}},{key:"getUniformsBufferInfo",value:function(t){var n=0,i=[];return Object.values(t).forEach(function(a){Array.isArray(a)?(i.push.apply(i,(0,Qt.Z)(a)),n+=a.length):typeof a=="number"?(i.push(a),n+=1):typeof a=="boolean"&&(i.push(Number(a)),n+=1)}),{uniformsOption:t,uniformsLength:n,uniformsArray:i}}},{key:"getCommonUniformsInfo",value:function(){return{uniformsLength:0,uniformsArray:[],uniformsOption:{}}}},{key:"updateStyleUnifoms",value:function(){var t,n,i=this.getUniformsBufferInfo(this.getStyleAttribute()),a=i.uniformsArray,s=this.getCommonUniformsInfo(),l=s.uniformsArray;(t=this.attributeUnifoms)===null||t===void 0||t.subData({offset:0,data:new Uint8Array(new Float32Array(a).buffer)}),(n=this.commonUnifoms)===null||n===void 0||n.subData({offset:0,data:new Uint8Array(new Float32Array(l).buffer)})}}]),e}(),v1=Pi(z0.prototype,"configService",[d1],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),z0),m1=100,KB=36,QB=40;function g1(e){return e/180*Math.acos(-1)}function y1(e){var r=g1(e[0])+Math.PI/2,t=g1(e[1]),n=m1+Math.random()*.4,i=n*Math.cos(t)*Math.cos(r),a=n*Math.cos(t)*Math.sin(r),s=n*Math.sin(t);return[a,s,i]}function JB(e,r){var t=mat4.create(),n=mat4.create(),i=vec3.fromValues(0,1,0),a=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,d=[],_=[],b=[],T=[],M=[],P=[],D=0;D<=l;D++){for(var G=D/l,q=G*Math.PI,se=0;se<=f;se++){var Se=se/f,Ve=Se*Math.PI*2;mat4.identity(n),mat4.rotateZ(n,n,-q),mat4.identity(t),mat4.rotateY(t,t,Ve),vec3.transformMat4(a,i,n),vec3.transformMat4(a,a,t),vec3.scale(a,a,-e),b.push(a.slice()),T.push.apply(T,_toConsumableArray(a.slice())),vec3.normalize(a,a),M.push.apply(M,_toConsumableArray(a.slice())),P.push([Se,1-G]),T.push(Se,1-G)}if(D>0)for(var nt=b.length,st=nt-2*(f+1);st+f+2<nt;st++)d.push([st,st+1,st+f+1]),_.push(st,st+1,st+f+1),d.push([st+f+1,st+1,st+f+2]),_.push(st+f+1,st+1,st+f+2)}return{cells:d,positions:b,uvs:P,positionsArr:T,indicesArr:_,normalArr:M}}var Cg=Dr.Ue(),eF=Dr.Ue(),Xs=Dr.Ue(),Mp=Dr.Ue(),hv=Dr.Ue();function V0(e,r,t,n,i){Dr.IH(e,t,n),Dr.Fv(e,e),r=Dr.al(-e[1],e[0]);var a=Dr.al(-t[1],t[0]);return[i/Dr.AK(r,a),r]}function Ip(e,r){return Dr.t8(e,-r[1],r[0])}function pv(e,r,t){return Dr.lu(e,r,t),Dr.Fv(e,e),e}function j0(e,r){return e[0]===r[0]&&e[1]===r[1]}function tF(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 Lw=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,Q.Z)(this,e),(0,F.Z)(this,"lastFlip",-1),(0,F.Z)(this,"miter",Dr.al(0,0)),(0,F.Z)(this,"started",!1),(0,F.Z)(this,"dash",!1),(0,F.Z)(this,"totalDistance",0),(0,F.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,a=n.startIndex,s=1;s<i;s++){var l=t[s-1],f=t[s],d=s<t.length-1?t[s+1]:null,_=this.simpleSegment(n,a,l,f,d);a+=_}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 a=t.length,s=i.startIndex,l=1;l<a;l++){var f,d,_,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((d=n[l][2])!==null&&d!==void 0?d:0);var P=n[l],D=l<t.length-1?[].concat((0,Qt.Z)(t[l+1]),[(_=n[l+1][2])!==null&&_!==void 0?_:0]):null,G=l<n.length-1?n[l+1]:null,q=this.simpleSegment(i,s,b,M,D,T,P,G);s+=q}if(this.dash)for(var se=0;se<i.positions.length/6;se++)i.positions[se*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 a=t.length,s=i.startIndex,l=1;l<a;l++){var f,d,_,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((d=n[l][2])!==null&&d!==void 0?d:0);var P=n[l],D=l<t.length-1?[].concat((0,Qt.Z)(t[l+1]),[(_=n[l+1][2])!==null&&_!==void 0?_:0]):null,G=l<n.length-1?n[l+1]:null,q=this.segment_gaode2(i,s,b,M,D,T,P,G);s+=q}if(this.dash)for(var se=0;se<i.positions.length/6;se++)i.positions[se*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,a=n.startIndex,s=1;s<i;s++){var l=t[s-1],f=t[s],d=s<t.length-1?t[s+1]:null,_=this.segment(n,a,l,f,d);a+=_}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,a,s){var l=0,f=t.indices,d=t.positions,_=t.normals,b=ja([a[0],a[1]]),T=ja([i[0],i[1]]);pv(Xs,b,T);var M=0;if(this.dash&&(M=this.lineSegmentDistance(b,T),this.totalDistance+=M),this.normal||(this.normal=Dr.Ue(),Ip(this.normal,Xs)),this.started||(this.started=!0,this.extrusions(d,_,i,this.normal,this.thickness,this.totalDistance-M)),f.push(n+0,n+1,n+2),!s)Ip(this.normal,Xs),this.extrusions(d,_,a,this.normal,this.thickness,this.totalDistance),f.push.apply(f,(0,Qt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),l+=2;else{var P=ja([s[0],s[1]]);j0(b,P)&&Dr.IH(P,b,Dr.Fv(P,Dr.$X(P,b,T))),pv(Mp,P,b);var D=V0(hv,Dr.Ue(),Xs,Mp,this.thickness),G=(0,_n.Z)(D,2),q=G[0],se=G[1],Se=Dr.AK(hv,this.normal)<0?-1:1;this.extrusions(d,_,a,se,q,this.totalDistance),f.push.apply(f,(0,Qt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),Se=-1,Dr.JG(this.normal,se),l+=2,this.lastFlip=Se}return l}},{key:"segment_gaode2",value:function(t,n,i,a,s,l,f,d){var _=0,b=t.indices,T=t.positions,M=t.normals,P=this.cap==="square",D=this.join==="bevel",G=ja([f[0],f[1]]),q=ja([l[0],l[1]]);pv(Xs,a,i);var se=0;if(this.dash&&(se=this.lineSegmentDistance(G,q),this.totalDistance+=se),this.normal||(this.normal=Dr.Ue(),Ip(this.normal,Xs)),!this.started)if(this.started=!0,P){var Se=Dr.Ue(),Ve=Dr.Ue();Dr.IH(Se,this.normal,Xs),Dr.IH(Ve,this.normal,Xs),M.push(Ve[0],Ve[1],0),M.push(Se[0],Se[1],0),T.push(i[0],i[1],i[2]|0,this.totalDistance-se,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),T.push(i[0],i[1],i[2]|0,this.totalDistance-se,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-se);if(b.push(n+0,n+1,n+2),s){j0(a,s)&&Dr.IH(s,a,Dr.Fv(s,Dr.$X(s,a,i))),pv(Mp,s,a);var at=V0(hv,Dr.Ue(),Xs,Mp,this.thickness),At=(0,_n.Z)(at,2),Wt=At[0],Sr=At[1],_r=Dr.AK(hv,this.normal)<0?-1:1,Gr=D;if(!Gr&&this.join==="miter"){var Cn=Wt;Cn>this.miterLimit&&(Gr=!0)}Gr?(M.push(this.normal[0],this.normal[1],0),M.push(Sr[0],Sr[1],0),T.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*_r,a[2]|0),this.complex.indexes.push(this.currentIndex),T.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness*_r,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,b.push.apply(b,(0,Qt.Z)(this.lastFlip!==-_r?[n,n+2,n+3]:[n+2,n+1,n+3])),b.push(n+2,n+3,n+4),Ip(Cg,Mp),Dr.JG(this.normal,Cg),M.push(this.normal[0],this.normal[1],0),T.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*_r,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,_+=3):(this.extrusions(T,M,a,Sr,Wt,this.totalDistance),b.push.apply(b,(0,Qt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),_r=-1,Dr.JG(this.normal,Sr),_+=2),this.lastFlip=_r}else{if(Ip(this.normal,Xs),P){var nt=Dr.Ue(),st=Dr.Ue();Dr.lu(st,Xs,this.normal),Dr.IH(nt,Xs,this.normal),M.push(st[0],st[1],0),M.push(nt[0],nt[1],0),T.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),T.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(T,M,a,this.normal,this.thickness,this.totalDistance);b.push.apply(b,(0,Qt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),_+=2}return _}},{key:"segment",value:function(t,n,i,a,s){var l=0,f=t.indices,d=t.positions,_=t.normals,b=this.cap==="square",T=this.join==="bevel",M=ja([a[0],a[1]]),P=ja([i[0],i[1]]);pv(Xs,M,P);var D=0;if(this.dash&&(D=this.lineSegmentDistance(M,P),this.totalDistance+=D),this.normal||(this.normal=Dr.Ue(),Ip(this.normal,Xs)),!this.started)if(this.started=!0,b){var G=Dr.Ue(),q=Dr.Ue();Dr.IH(G,this.normal,Xs),Dr.IH(q,this.normal,Xs),_.push(q[0],q[1],0),_.push(G[0],G[1],0),d.push(i[0],i[1],i[2]|0,this.totalDistance-D,-this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),d.push(i[0],i[1],i[2]|0,this.totalDistance-D,this.thickness,i[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(d,_,i,this.normal,this.thickness,this.totalDistance-D);if(f.push(n+0,n+1,n+2),s){var Ve=ja([s[0],s[1]]);j0(M,Ve)&&Dr.IH(Ve,M,Dr.Fv(Ve,Dr.$X(Ve,M,P))),pv(Mp,Ve,M);var nt=V0(hv,Dr.Ue(),Xs,Mp,this.thickness),st=(0,_n.Z)(nt,2),at=st[0],At=st[1],Wt=Dr.AK(hv,this.normal)<0?-1:1,Sr=T;if(!Sr&&this.join==="miter"){var _r=at;_r>this.miterLimit&&(Sr=!0)}Sr?(_.push(this.normal[0],this.normal[1],0),_.push(At[0],At[1],0),d.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*Wt,a[2]|0),this.complex.indexes.push(this.currentIndex),d.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness*Wt,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,f.push.apply(f,(0,Qt.Z)(this.lastFlip!==-Wt?[n,n+2,n+3]:[n+2,n+1,n+3])),f.push(n+2,n+3,n+4),Ip(Cg,Mp),Dr.JG(this.normal,Cg),_.push(this.normal[0],this.normal[1],0),d.push(a[0],a[1],a[2]|0,this.totalDistance,-this.thickness*Wt,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++,l+=3):(this.extrusions(d,_,a,At,at,this.totalDistance),f.push.apply(f,(0,Qt.Z)(this.lastFlip===1?[n,n+2,n+3]:[n+2,n+1,n+3])),Wt=-1,Dr.JG(this.normal,At),l+=2),this.lastFlip=Wt}else{if(Ip(this.normal,Xs),b){var se=Dr.Ue(),Se=Dr.Ue();Dr.lu(Se,Xs,this.normal),Dr.IH(se,Xs,this.normal),_.push(Se[0],Se[1],0),_.push(se[0],se[1],0),d.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),d.push(a[0],a[1],a[2]|0,this.totalDistance,this.thickness,a[2]|0),this.complex.indexes.push(this.currentIndex),this.currentIndex++}else this.extrusions(d,_,a,this.normal,this.thickness,this.totalDistance);f.push.apply(f,(0,Qt.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,a,s,l){n.push(a[0],a[1],0),n.push(a[0],a[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],a=n[1]-t[1];return Math.sqrt(i*i+a*a)}}]),e}(),La=U(54442);function Bw(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=ko().flatten(e),a=i.vertices,s=i.dimensions,l=[],f=[],d=0;d<a.length/s;d++)s===2?l.push(a[d*2],a[d*2+1],1):l.push(a[d*3],a[d*3+1],1);var _=ko()(i.vertices,i.holes,i.dimensions);f.push.apply(f,(0,Qt.Z)(_));for(var b=function(){var P=i.vertices.slice(T*s,(T+1)*s),D=i.vertices.slice((T+1)*s,(T+2)*s);D.length===0&&(D=i.vertices.slice(0,s));var G=l.length/3;l.push(P[0],P[1],1,D[0],D[1],1,P[0],P[1],0,D[0],D[1],0),f.push.apply(f,(0,Qt.Z)([0,2,1,2,3,1].map(function(q){return q+G})))},T=0;T<n;T++)b();return{positions:l,index:f}}function Fw(e){var r=ko().flatten(e),t=ko()(r.vertices,r.holes,r.dimensions);return{positions:r.vertices,index:t}}function _1(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,a=ko().flatten(e),s=a.vertices,l=a.dimensions,f=[],d=[],_=[],b=0;b<s.length/l;b++)f.push(s[b*l],s[b*l+1],1,-1,-1),_.push(0,0,1);var T=ko()(a.vertices,a.holes,a.dimensions);d.push.apply(d,(0,Qt.Z)(T));for(var M=function(){var G=a.vertices.slice(P*l,(P+1)*l),q=a.vertices.slice((P+1)*l,(P+2)*l);q.length===0&&(q=a.vertices.slice(0,l));var se=f.length/5;f.push(G[0],G[1],1,0,0,q[0],q[1],1,.1,0,G[0],G[1],0,0,.8,q[0],q[1],0,.1,.8);var Se=Nw([q[0],q[1],1],[G[0],G[1],0],[G[0],G[1],1],r);_.push.apply(_,(0,Qt.Z)(Se).concat((0,Qt.Z)(Se),(0,Qt.Z)(Se),(0,Qt.Z)(Se))),d.push.apply(d,(0,Qt.Z)([1,2,0,3,2,1].map(function(Ve){return Ve+se})))},P=0;P<i;P++)M();return{positions:f,index:d,normals:_}}function Nw(e,r,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=La.create(),a=La.create(),s=La.create();n&&(e=xh(e),r=xh(r),t=xh(t));var l=La.fromValues.apply(La,(0,Qt.Z)(e)),f=La.fromValues.apply(La,(0,Qt.Z)(r)),d=La.fromValues.apply(La,(0,Qt.Z)(t));La.sub(i,d,f),La.sub(a,l,f),La.cross(s,i,a);var _=La.create();return La.normalize(_,s),_}var Wc,ym=function(e){return e.CYLINDER="cylinder",e.SQUARECOLUMN="squareColumn",e.TRIANGLECOLUMN="triangleColumn",e.HEXAGONCOLUMN="hexagonColumn",e.PENTAGONCOLUMN="pentagonColumn",e}({}),_m=function(e){return e.CIRCLE="circle",e.SQUARE="square",e.TRIANGLE="triangle",e.HEXAGON="hexagon",e.PENTAGON="pentagon",e}({});function xm(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 a=n.map(function(s){var l=Math.sin(s+Math.PI/4),f=Math.cos(s+Math.PI/4);return[l,f,0]});return a}function H0(){return xm(30)}function x1(){return xm(4)}function b1(){return xm(3)}function E1(){return xm(6,1)}function S1(){return xm(5)}var dv=(Wc={},(0,F.Z)(Wc,_m.CIRCLE,H0),(0,F.Z)(Wc,_m.HEXAGON,E1),(0,F.Z)(Wc,_m.TRIANGLE,b1),(0,F.Z)(Wc,_m.SQUARE,x1),(0,F.Z)(Wc,_m.PENTAGON,S1),(0,F.Z)(Wc,ym.CYLINDER,H0),(0,F.Z)(Wc,ym.HEXAGONCOLUMN,E1),(0,F.Z)(Wc,ym.TRIANGLECOLUMN,b1),(0,F.Z)(Wc,ym.SQUARECOLUMN,x1),(0,F.Z)(Wc,ym.PENTAGONCOLUMN,S1),Wc),Rg={};function Mg(e){var r=Qs(e.coordinates);return{vertices:[].concat((0,Qt.Z)(r),(0,Qt.Z)(r),(0,Qt.Z)(r),(0,Qt.Z)(r)),indices:[0,1,2,2,3,0],size:r.length}}function A1(e){var r=Qs(e.coordinates),t=y1(r);return{vertices:[].concat((0,Qt.Z)(t),(0,Qt.Z)(t),(0,Qt.Z)(t),(0,Qt.Z)(t)),indices:[0,1,2,2,3,0],size:t.length}}function W0(e){var r=e.shape,t=Gw(r,!1),n=t.positions,i=t.index,a=t.normals;return{vertices:n,indices:i,normals:a,size:5}}function Uw(e){var r=Qs(e.coordinates);return{vertices:(0,Qt.Z)(r),indices:[0],size:r.length}}function zw(e){var r=e.coordinates,t=e.originCoordinates,n=e.version,i=new Lw({dash:!0,join:"bevel"});if(n==="GAODE2.x"){var a=r;Array.isArray(a[0][0])||(a=[r]);var s=t;Array.isArray(s[0][0])||(s=[t]);for(var l=0;l<a.length;l++){var f=a[l],d=s[l];i.extrude_gaode2(f,d)}}else{var _=r;_[0]&&!Array.isArray(_[0][0])&&(_=[r]),_.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 rF(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 Zw(e){var r=e.coordinates,t=e.originCoordinates,n=[];if(!Array.isArray(r[0]))return{vertices:[],indices:[],normals:[],size:6,count:0};var i=Vw(r,t),a=i.results,s=i.totalDistance;return a.map(function(l){n.push(l[0],l[1],l[2],l[3],0,s)}),{vertices:n,indices:[],normals:[],size:6,count:a.length}}function nF(e){var r=e.coordinates,t=[];if(!Array.isArray(r[0]))return{vertices:[],indices:[],size:4,count:0};var n=jw(r),i=n.results;return i.map(function(a){t.push(a[0],a[1],a[2],a[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 vv(e,r){return e.length<3&&e.push(0),r!==void 0&&e.push(r),e}function Vw(e,r){var t=e,n=r||e;Array.isArray(t)&&Array.isArray(t[0])&&Array.isArray(t[0][0])&&(t=r.flat(),n=r.flat());var i=0;if(t.length<2)return{results:t,totalDistance:0};var a=[],s=vv(t[0],i);a.push(s);for(var l=1;l<t.length-1;l++){var f=T1(ja(n[l-1]),ja(n[l]));i+=f;var d=vv(t[l],i);a.push(d),a.push(d)}var _=T1(ja(n[n.length-2]),ja(n[n.length-1]));return i+=_,a.push(vv(t[t.length-1],i)),{results:a,totalDistance:i}}function jw(e){if(e.length<2)return{results:e};var r=[],t=vv(e[0]);r.push(t);for(var n=1;n<e.length-1;n++){var i=vv(e[n]);r.push(i),r.push(i)}return r.push(vv(e[e.length-1])),{results:r}}function G0(e){var r=e.coordinates,t=ko().flatten(r),n=t.vertices,i=t.dimensions,a=t.holes;return{indices:ko()(n,a,i),vertices:n,size:i}}function Hw(e){var r=e.coordinates,t=ko().flatten(r),n=t.vertices,i=t.dimensions,a=t.holes;return{indices:ko()(n,a,i),vertices:Ww(n),size:i+4}}function Ww(e){for(var r=[],t=fp(e),n=t.center,i=t.radius,a=0;a<e.length;a+=2){var s=e[a],l=e[a+1];r.push.apply(r,[s,l,0].concat((0,Qt.Z)(n),[i]))}return r}function X0(e){var r=e.coordinates,t=_1(r,!0),n=t.positions,i=t.index,a=t.normals;return{vertices:n,indices:i,normals:a,size:5}}function w1(e){var r=e.shape,t=$w(r),n=t.positions,i=t.index;return{vertices:n,indices:i,size:3}}function Ig(e){var r=e.coordinates,t=[].concat((0,Qt.Z)(r[0]),[0,0,1,r[1][0],r[0][1],0,1,1],(0,Qt.Z)(r[1]),[0,1,0],(0,Qt.Z)(r[0]),[0,0,1],(0,Qt.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 $0(e,r){for(var t=r.segmentNumber,n=t===void 0?30:t,i=e.coordinates,a=[],s=[],l=function(_){a.push(_,1,_,i[0][0],i[0][1],i[1][0],i[1][1],_,-1,_,i[0][0],i[0][1],i[1][0],i[1][1]),_!==n-1&&s.push.apply(s,(0,Qt.Z)([0,1,2,1,3,2].map(function(b){return _*2+b})))},f=0;f<n;f++)l(f);return{vertices:a,indices:s,size:7}}function C1(e){var r=e.coordinates;r.length===2&&r.push(0);var t=Pg(-1,1),n=Pg(1,1),i=Pg(-1,-1),a=Pg(1,-1),s=[].concat((0,Qt.Z)(r),(0,Qt.Z)(t),(0,Qt.Z)(r),(0,Qt.Z)(i),(0,Qt.Z)(r),(0,Qt.Z)(a),(0,Qt.Z)(r),(0,Qt.Z)(n)),l=[0,1,2,3,0,2];return{vertices:s,indices:l,size:5}}function Gw(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Rg&&Rg[e])return Rg[e];var t=dv[e]?dv[e]():dv.cylinder(),n=_1([t],r);return Rg[e]=n,n}function iF(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),a,s,l,f=vec3.create(),d=vec3.create(),_=vec3.create(),b=0,T=r.length;b<T;b+=3){a=r[b+0]*3,s=r[b+1]*3,l=r[b+2]*3;var M=[e[a],e[a+1]],P=[e[s],e[s+1]],D=[e[l],e[l+1]];n&&(M=lngLatToMeters(M),P=lngLatToMeters(P),D=lngLatToMeters(D));var G=M,q=_slicedToArray(G,2),se=q[0],Se=q[1],Ve=vec3.fromValues(se,Se,e[a+2]),nt=P,st=_slicedToArray(nt,2),at=st[0],At=st[1],Wt=vec3.fromValues(at,At,e[s+2]),Sr=D,_r=_slicedToArray(Sr,2),Gr=_r[0],Cn=_r[1],wi=vec3.fromValues(Gr,Cn,e[l+2]);vec3.sub(f,wi,Wt),vec3.sub(d,Ve,Wt),vec3.cross(_,f,d),i[a]+=f[0],i[a+1]+=f[1],i[a+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 Xw(i),i}function Xw(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 aF(e){var r=e[0][0],t=e[0][e[0].length-1];return r[0]===t[0]&&r[1]===t[1]}function $w(e){var r=["cylinder","triangleColumn","hexagonColumn","squareColumn"],t=dv[e]?dv[e]():dv.circle(),n=r.indexOf(e)===-1?Fw([t]):Bw([t]);return n}function Pg(e,r){var t=(e+1)/2,n=(r+1)/2;return[t,n]}function oF(){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 sF(){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 Yw(e){var r=qw();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function qw(){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 Kw=`precision highp float;
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];
|
|
vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];
|
|
vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];
|
|
vec4 u_circleSweepColor;
|
|
vec2 u_cityCenter;
|
|
float u_circleSweep;
|
|
float u_cityMinSize;
|
|
float u_circleSweepSpeed;
|
|
float u_opacity: 1.0;
|
|
float u_near : 0;
|
|
float u_far : 1;
|
|
float u_time;
|
|
};
|
|
in vec4 v_Color;
|
|
in vec2 v_texCoord;
|
|
in float v_worldDis;
|
|
out vec4 outputColor;
|
|
|
|
#pragma include "picking"
|
|
#pragma include "scene_uniforms"
|
|
|
|
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() {
|
|
outputColor = 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);
|
|
outputColor = 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);
|
|
|
|
outputColor = 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);
|
|
outputColor.rgb += r * r * u_circleSweepColor.rgb;
|
|
}
|
|
|
|
outputColor.a *= u_opacity;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,Qw=`precision highp float;
|
|
|
|
#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 float a_Size;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
out vec2 v_texCoord;
|
|
out vec4 v_Color;
|
|
out float v_worldDis;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];
|
|
vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];
|
|
vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];
|
|
vec4 u_circleSweepColor;
|
|
vec2 u_cityCenter;
|
|
float u_circleSweep;
|
|
float u_cityMinSize;
|
|
float u_circleSweepSpeed;
|
|
float u_opacity: 1.0;
|
|
float u_near : 0;
|
|
float u_far : 1;
|
|
float u_time;
|
|
};
|
|
#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);
|
|
}
|
|
`,Jw=function(e){(0,Fe.Z)(t,e);var r=Yw(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.opacity,s=a===void 0?1:a,l=i.baseColor,f=l===void 0?"rgb(16,16,16)":l,d=i.brightColor,_=d===void 0?"rgb(255,176,38)":d,b=i.windowColor,T=b===void 0?"rgb(30,60,89)":b,M=i.time,P=M===void 0?0:M,D=i.sweep,G=D===void 0?{enable:!1,sweepRadius:1,sweepColor:"rgb(255, 255, 255)",sweepSpeed:.4,sweepCenter:this.cityCenter}:D,q={u_baseColor:vi(f),u_brightColor:vi(_),u_windowColor:vi(T),u_circleSweepColor:[].concat((0,Qt.Z)(vi(G.sweepColor).slice(0,3)),[1]),u_cityCenter:G.sweepCenter||this.cityCenter,u_circleSweep:G.enable?1:0,u_cityMinSize:this.cityMinSize*G.sweepRadius,u_circleSweepSpeed:G.sweepSpeed,u_opacity:s,u_near:0,u_far:1,u_time:this.layer.getLayerAnimateTime()||P},se=this.getUniformsBufferInfo(q);return se}},{key:"calCityGeo",value:function(){var i=(0,_n.Z)(this.layer.getSource().extent,4),a=i[0],s=i[1],l=i[2],f=i[3];if(this.mapService.version==="GAODE2.x"){this.cityCenter=this.mapService.lngLatToCoord([(l+a)/2,(f+s)/2]);var d=this.mapService.lngLatToCoord([l,f]),_=this.mapService.lngLatToCoord([a,s]);this.cityMinSize=Math.sqrt(Math.pow(d[0]-_[0],2)+Math.pow(d[1]-_[1],2))/4}else{var b=l-a,T=f-s;this.cityCenter=[(l+a)/2,(f+s)/2],this.cityMinSize=Math.sqrt(Math.pow(b,2)+Math.pow(T,2))/4}}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.calCityGeo(),this.initUniformsBuffer(),this.startModelAnimate(),l.abrupt("return",this.buildModels());case 4:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"cityBuilding",vertexShader:Qw,fragmentShader:Kw,triangulation:X0,depth:{enable:!0},inject:this.getInject(),cull:{enable:!0,face:I.BACK}});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:In.Attribute,descriptor:{name:"a_Normal",shaderLocation:Yn.NORMAL,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a,s,l,f,d){return d}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(a){var s=a.size,l=s===void 0?10:s;return Array.isArray(l)?[l[0]]:[l]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:In.Attribute,descriptor:{name:"a_Uv",shaderLocation:Yn.UV,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(a,s,l){return[l[3],l[4]]}}})}}]),t}(Na);function eC(e){var r=tC();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function tC(){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,Fe.Z)(t,e);var r=eC(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"type","CityBuildingLayer"),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.layerModel=new Jw(this),l.next=3,this.initLayerModels();case 3:case"end":return l.stop()}},a,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}(Rp);function nC(e){var r=iC();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 aC=`layout(location = 0) in vec3 a_Position;\r
|
|
layout(location = 1) in vec4 a_Color;\r
|
|
layout(location = 10) in vec3 a_Pos;\r
|
|
\r
|
|
layout(std140) uniform commonUniforms {\r
|
|
vec2 u_radius;\r
|
|
float u_opacity;\r
|
|
float u_coverage;\r
|
|
float u_angle;\r
|
|
};\r
|
|
\r
|
|
\r
|
|
out vec4 v_color;\r
|
|
\r
|
|
\r
|
|
#pragma include "projection"\r
|
|
#pragma include "project"\r
|
|
#pragma include "picking"\r
|
|
\r
|
|
void main() {\r
|
|
v_color = a_Color;\r
|
|
v_color.a *= u_opacity;\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
|
|
`,oC=`in vec4 v_color;
|
|
|
|
#pragma include "picking"
|
|
out vec4 outputColor;
|
|
void main() {
|
|
outputColor = v_color;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,sC=function(e){(0,Fe.Z)(t,e);var r=nC(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.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.opacity,s=i.coverage,l=i.angle,f={u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset],u_opacity:a||1,u_coverage:s||.9,u_angle:l||0},d=this.getUniformsBufferInfo(f);return d}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.initUniformsBuffer(),f.next=3,this.layer.buildLayerModel({moduleName:"heatmapGrid",vertexShader:aC,fragmentShader:oC,triangulation:w1,primitive:I.TRIANGLES,depth:{enable:!1}});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:In.Attribute,descriptor:{shaderLocation:10,name:"a_Pos",buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a){var s=a.version==="GAODE2.x"?a.originCoordinates:a.coordinates;return[s[0],s[1],0]}}})}}]),t}(Na);function uC(e){var r=lC();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 cC=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 10) in vec3 a_Pos;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec2 u_radius;
|
|
float u_opacity;
|
|
float u_coverage;
|
|
float u_angle;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
|
|
#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 * u_opacity);
|
|
|
|
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);
|
|
}
|
|
`,fC=`in vec4 v_color;
|
|
|
|
#pragma include "picking"
|
|
out vec4 outputColor;
|
|
void main() {
|
|
outputColor = v_color;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,hC=function(e){(0,Fe.Z)(t,e);var r=uC(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.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.opacity,s=i.coverage,l=i.angle,f={u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset],u_opacity:a||1,u_coverage:s||.9,u_angle:l||0},d=this.getUniformsBufferInfo(f);return d}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.initUniformsBuffer(),f.next=3,this.layer.buildLayerModel({moduleName:"heatmapGrid3d",vertexShader:cC,fragmentShader:fC,triangulation:W0,primitive:I.TRIANGLES,depth:{enable:!0}});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{shaderLocation:Yn.SIZE,name:"a_Size",buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(a){var s=a.size;return Array.isArray(s)?[s[0]]:[s]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:In.Attribute,descriptor:{name:"a_Normal",shaderLocation:Yn.NORMAL,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a,s,l,f,d){return d}}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:In.Attribute,descriptor:{name:"a_Pos",shaderLocation:10,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a){var s=a.version==="GAODE2.x"?a.originCoordinates:a.coordinates;return[s[0],s[1],0]}}})}}]),t}(Na),uF=U(18041);function pC(e,r){for(var t=[],n=[],i=[],a=e+1,s=r+1,l=e/2,f=r/2,d=0;d<s;d++)for(var _=d-f,b=0;b<a;b++){var T=b-l;n.push(T/l,-_/f,0),i.push(b/e),i.push(1-d/r)}for(var M=0;M<r;M++)for(var P=0;P<e;P++){var D=P+a*M,G=P+a*(M+1),q=P+1+a*(M+1),se=P+1+a*M;t.push(D,G,se),t.push(G,q,se)}return{vertices:n,indices:t,uvs:i}}var R1,M1;function dC(e){var r=vC();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function vC(){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 mC=`layout(std140) uniform commonUniforms {
|
|
mat4 u_ViewProjectionMatrixUncentered;
|
|
mat4 u_InverseViewProjectionMatrix;
|
|
float u_opacity;
|
|
float u_common_uniforms_padding1;
|
|
float u_common_uniforms_padding2;
|
|
float u_common_uniforms_padding3;
|
|
};
|
|
|
|
uniform sampler2D u_texture;
|
|
uniform sampler2D u_colorTexture;
|
|
|
|
in vec2 v_texCoord;
|
|
in float v_intensity;
|
|
out vec4 outputColor;
|
|
|
|
void main(){
|
|
|
|
float intensity = texture(SAMPLER_2D(u_texture), v_texCoord).r;
|
|
vec4 color = texture(SAMPLER_2D(u_colorTexture),vec2(intensity, 0));
|
|
outputColor = color;
|
|
// gl_FragColor.a = color.a * smoothstep(0.1,0.2,intensity)* u_opacity;
|
|
outputColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;
|
|
}
|
|
`,gC=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
mat4 u_ViewProjectionMatrixUncentered;
|
|
mat4 u_InverseViewProjectionMatrix;
|
|
float u_opacity;
|
|
float u_common_uniforms_padding1;
|
|
float u_common_uniforms_padding2;
|
|
float u_common_uniforms_padding3;
|
|
};
|
|
|
|
uniform sampler2D u_texture;
|
|
uniform sampler2D u_colorTexture;
|
|
|
|
out vec2 v_texCoord;
|
|
out 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"
|
|
#pragma include "project"
|
|
|
|
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 = texture(SAMPLER_2D(u_texture), v_texCoord).r;
|
|
fh = toBezier(v_intensity, b).y;
|
|
gl_Position = u_ViewProjectionMatrixUncentered * vec4(position.xy, fh * project_pixel(50.), 1.0);
|
|
|
|
}
|
|
`,yC=`uniform sampler2D u_texture; // \u70ED\u529B\u5F3A\u5EA6\u56FE
|
|
uniform sampler2D u_colorTexture; // \u6839\u636E\u5F3A\u5EA6\u5206\u5E03\u7684\u8272\u5E26
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_opacity;
|
|
float u_common_uniforms_padding1;
|
|
float u_common_uniforms_padding2;
|
|
float u_common_uniforms_padding3;
|
|
};
|
|
in vec2 v_texCoord;
|
|
out vec4 outputColor;
|
|
|
|
#pragma include "scene_uniforms"
|
|
|
|
float getBlurIndusty() {
|
|
float vW = 2.0/ u_ViewportSize.x;
|
|
float vH = 2.0/ u_ViewportSize.y;
|
|
vec2 vUv = v_texCoord;
|
|
float i11 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 1.0 * vW, vUv.y + 1.0 * vH) ).r;
|
|
float i12 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 0.0 * vW, vUv.y + 1.0 * vH) ).r;
|
|
float i13 = texture(SAMPLER_2D(u_texture), vec2( vUv.x + 1.0 * vW, vUv.y + 1.0 * vH) ).r;
|
|
|
|
float i21 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 1.0 * vW, vUv.y) ).r;
|
|
float i22 = texture(SAMPLER_2D(u_texture), vec2( vUv.x , vUv.y) ).r;
|
|
float i23 = texture(SAMPLER_2D(u_texture), vec2( vUv.x + 1.0 * vW, vUv.y) ).r;
|
|
|
|
float i31 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 1.0 * vW, vUv.y-1.0*vH) ).r;
|
|
float i32 = texture(SAMPLER_2D(u_texture), vec2( vUv.x - 0.0 * vW, vUv.y-1.0*vH) ).r;
|
|
float i33 = texture(SAMPLER_2D(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 = texture(u_texture, v_texCoord).r;
|
|
float intensity = getBlurIndusty();
|
|
vec4 color = texture(SAMPLER_2D(u_colorTexture), vec2(intensity, 0.0));
|
|
outputColor = color;
|
|
outputColor.a = color.a * smoothstep(0.,0.1,intensity) * u_opacity;
|
|
}
|
|
`,_C=`
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_opacity;
|
|
float u_common_uniforms_padding1;
|
|
float u_common_uniforms_padding2;
|
|
float u_common_uniforms_padding3;
|
|
};
|
|
|
|
#pragma include "scene_uniforms"
|
|
|
|
out vec2 v_texCoord;
|
|
void main() {
|
|
v_texCoord = a_Uv;
|
|
|
|
gl_Position = vec4(a_Position.xy, 0, 1.);
|
|
}
|
|
`,xC=`layout(std140) uniform commonUniforms {
|
|
float u_radius;
|
|
float u_intensity;
|
|
float u_common_uniforms_padding1;
|
|
float u_common_uniforms_padding2;
|
|
};
|
|
|
|
in float v_weight;
|
|
in vec2 v_extrude;
|
|
out vec4 outputColor;
|
|
#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);
|
|
outputColor = vec4(val, 1., 1., 1.);
|
|
}
|
|
`,bC=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 10) in vec2 a_Dir;
|
|
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_radius;
|
|
float u_intensity;
|
|
float u_common_uniforms_padding1;
|
|
float u_common_uniforms_padding2;
|
|
};
|
|
|
|
out vec2 v_extrude;
|
|
out float v_weight;
|
|
|
|
|
|
#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));
|
|
}
|
|
}
|
|
`,EC=ui.isEqual,I1=(R1=(0,er.b2)(),R1(M1=function(e){(0,Fe.Z)(t,e);var r=dC(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"colorModelUniformBuffer",[]),(0,F.Z)((0,Me.Z)(n),"heat3DModelUniformBuffer",[]),n}return(0,j.Z)(t,[{key:"prerender",value:function(){var i=this,a=this.rendererService,s=a.clear,l=a.useFramebuffer;l(this.heatmapFramerBuffer,function(){s({color:[0,0,0,0],depth:1,stencil:0,framebuffer:i.heatmapFramerBuffer}),i.drawIntensityMode()})}},{key:"render",value:function(i){var a=this.layer.getLayerConfig(),s=a.rampColors;EC(this.preRampColors,s)||this.updateColorTexture(),this.shapeType==="heatmap"?this.drawHeatMap(i):this.draw3DHeatMap(i)}},{key:"getUninforms",value:function(){throw new Error("Method not implemented.")}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b,T,M,P,D;return _e().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return l=this.rendererService,f=l.createFramebuffer,d=l.getViewportSize,_=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,q.next=6,this.buildHeatMapIntensity();case 6:return this.intensityModel=q.sent,this.colorModel=T==="heatmap"?this.buildHeatmap():this.build3dHeatMap(),M=d(),P=M.width,D=M.height,this.heatmapTexture=_({width:Math.floor(P/4),height:Math.floor(D/4),wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE,min:I.LINEAR,mag:I.LINEAR,usage:ht.RENDER_TARGET}),this.heatmapFramerBuffer=f({color:this.heatmapTexture,depth:!1}),this.updateColorTexture(),q.abrupt("return",[this.intensityModel,this.colorModel]);case 13:case"end":return q.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"dir",type:In.Attribute,descriptor:{name:"a_Dir",shaderLocation:10,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(a,s,l){return[l[3],l[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(a){var s=a.size,l=s===void 0?1:s;return[l]}}})}},{key:"buildHeatMapIntensity",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.uniformBuffers=[this.rendererService.createBuffer({data:new Float32Array(4).fill(0),isUBO:!0})],this.layer.triangulation=C1,f.next=4,this.layer.buildLayerModel({moduleName:"heatmapIntensity",vertexShader:bC,fragmentShader:xC,triangulation:C1,depth:{enable:!1},cull:{enable:!0,face:Ji(this.mapService.version)}});case 4:return s=f.sent,f.abrupt("return",s);case 6:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildHeatmap",value:function(){this.shaderModuleService.registerModule("heatmapColor",{vs:_C,fs:yC}),this.colorModelUniformBuffer=[this.rendererService.createBuffer({data:new Float32Array(4).fill(0),isUBO:!0})];var i=this.shaderModuleService.getModule("heatmapColor"),a=i.vs,s=i.fs,l=i.uniforms,f=this.rendererService,d=f.createAttribute,_=f.createElements,b=f.createBuffer,T=f.createModel;return T({vs:a,fs:s,uniformBuffers:[].concat((0,Qt.Z)(this.colorModelUniformBuffer),(0,Qt.Z)(this.rendererService.uniformBuffers)),attributes:{a_Position:d({shaderLocation:Yn.POSITION,buffer:b({data:[-1,1,0,1,1,0,-1,-1,0,1,-1,0],type:I.FLOAT}),size:3}),a_Uv:d({shaderLocation:Yn.UV,buffer:b({data:[0,1,1,1,0,0,1,0],type:I.FLOAT}),size:2})},uniforms:(0,H.Z)({},l),depth:{enable:!1},elements:_({data:[0,2,1,2,3,1],type:I.UNSIGNED_INT,count:6})})}},{key:"drawIntensityMode",value:function(){var i,a=this.layer.getLayerConfig(),s=a.intensity,l=s===void 0?10:s,f=a.radius,d=f===void 0?5:f,_={u_radius:d,u_intensity:l};this.uniformBuffers[0].subData({offset:0,data:[d,l]}),this.layerService.beforeRenderData(this.layer),this.layer.hooks.beforeRender.call(),(i=this.intensityModel)===null||i===void 0||i.draw({uniforms:_,blend:{enable:!0,func:{srcRGB:I.ONE,srcAlpha:1,dstRGB:I.ONE,dstAlpha:1}},stencil:{enable:!1,mask:255,func:{cmp:514,ref:1,mask:255}}}),this.layer.hooks.afterRender.call()}},{key:"drawHeatMap",value:function(i){var a,s=this.layer.getLayerConfig(),l=s.opacity,f=l===void 0?1:l,d={u_opacity:f,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer},_=[this.heatmapTexture,this.colorTexture];this.colorModelUniformBuffer[0].subData({offset:0,data:[f]}),(a=this.colorModel)===null||a===void 0||a.draw({uniforms:d,textures:_,blend:this.getBlend(),stencil:this.getStencil(i)})}},{key:"draw3DHeatMap",value:function(i){var a,s=this.layer.getLayerConfig(),l=s.opacity,f=l===void 0?1:l,d=Ct.create();Ct.invert(d,this.cameraService.getViewProjectionMatrixUncentered());var _={u_opacity:f,u_colorTexture:this.colorTexture,u_texture:this.heatmapFramerBuffer,u_ViewProjectionMatrixUncentered:this.cameraService.getViewProjectionMatrixUncentered(),u_InverseViewProjectionMatrix:(0,Qt.Z)(d)};this.heat3DModelUniformBuffer[0].subData({offset:0,data:[].concat((0,Qt.Z)(_.u_ViewProjectionMatrixUncentered),(0,Qt.Z)(_.u_InverseViewProjectionMatrix),[f])});var b=[this.heatmapTexture,this.colorTexture];(a=this.colorModel)===null||a===void 0||a.draw({uniforms:_,textures:b,blend:{enable:!0,func:{srcRGB:I.SRC_ALPHA,srcAlpha:1,dstRGB:I.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},stencil:this.getStencil(i)})}},{key:"build3dHeatMap",value:function(){var i=this.rendererService.getViewportSize,a=i(),s=a.width,l=a.height,f=pC(s/4,l/4);this.shaderModuleService.registerModule("heatmap3dColor",{vs:gC,fs:mC}),this.heat3DModelUniformBuffer=[this.rendererService.createBuffer({data:new Float32Array(16*2+4).fill(0),isUBO:!0})];var d=this.shaderModuleService.getModule("heatmap3dColor"),_=d.vs,b=d.fs,T=d.uniforms,M=this.rendererService,P=M.createAttribute,D=M.createElements,G=M.createBuffer,q=M.createModel;return q({vs:_,fs:b,attributes:{a_Position:P({shaderLocation:Yn.POSITION,buffer:G({data:f.vertices,type:I.FLOAT}),size:3}),a_Uv:P({shaderLocation:Yn.UV,buffer:G({data:f.uvs,type:I.FLOAT}),size:2})},primitive:I.TRIANGLES,uniformBuffers:[].concat((0,Qt.Z)(this.heat3DModelUniformBuffer),(0,Qt.Z)(this.rendererService.uniformBuffers)),uniforms:(0,H.Z)({},T),depth:{enable:!0},blend:{enable:!0,func:{srcRGB:I.SRC_ALPHA,srcAlpha:1,dstRGB:I.ONE_MINUS_SRC_ALPHA,dstAlpha:1}},elements:D({data:f.indices,type:I.UNSIGNED_INT,count:f.indices.length})})}},{key:"updateColorTexture",value:function(){var i=this.rendererService.createTexture2D;this.texture&&this.texture.destroy();var a=this.layer.getLayerConfig(),s=a.rampColors,l=Vo(s);this.colorTexture=i({data:new Uint8Array(l.data),width:l.width,height:l.height,wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE,min:I.NEAREST,mag:I.NEAREST,flipY:!1}),this.preRampColors=s}}]),t}(Na))||M1);function SC(e){var r=AC();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 TC=`in vec4 v_color;
|
|
|
|
#pragma include "picking"
|
|
out vec4 outputColor;
|
|
void main() {
|
|
outputColor = v_color;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,wC=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 10) in vec3 a_Pos;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec2 u_radius;
|
|
float u_opacity;
|
|
float u_coverage;
|
|
float u_angle;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
v_color = a_Color;
|
|
v_color.a *= u_opacity;
|
|
|
|
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);
|
|
}
|
|
`,CC=function(e){(0,Fe.Z)(t,e);var r=SC(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.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.opacity,s=i.coverage,l=i.angle,f={u_radius:[this.layer.getSource().data.xOffset,this.layer.getSource().data.yOffset],u_opacity:a||1,u_coverage:s||.9,u_angle:l||0},d=this.getUniformsBufferInfo(f);return d}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.initUniformsBuffer(),f.next=3,this.layer.buildLayerModel({moduleName:"heatmapHexagon",vertexShader:wC,fragmentShader:TC,triangulation:w1,depth:{enable:!1},primitive:I.TRIANGLES});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"pos",type:In.Attribute,descriptor:{name:"a_Pos",shaderLocation:10,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a){var s=a.version==="GAODE2.x"?a.originCoordinates:a.coordinates;return[s[0],s[1],0]}}})}}]),t}(Na),RC={heatmap:I1,heatmap3d:I1,grid:sC,grid3d:hC,hexagon:CC},MC=RC;function IC(e){var r=PC();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function PC(){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=function(e){(0,Fe.Z)(t,e);var r=IC(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"type","HeatMapLayer"),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel=new MC[s](this),f.next=4,this.initLayerModels();case 4:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"prerender",value:function(){var i=this.getModelType();i==="heatmap"&&this.layerModel&&this.layerModel.prerender()}},{key:"renderModels",value:function(){var i=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=this.getModelType();return s==="heatmap"?(this.layerModel&&this.layerModel.render(a),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(a)})}),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,a=this.styleAttributeService.getLayerStyleAttribute("shape"),s=this.getLayerConfig(),l=s.shape3d,f=this.getSource(),d=f.data.type,_=(a==null||(i=a.scale)===null||i===void 0?void 0:i.field)||"heatmap";return _==="heatmap"||_==="heatmap3d"?"heatmap":d==="hexagon"?(l==null?void 0:l.indexOf(_))===-1?"hexagon":"grid3d":d==="grid"?(l==null?void 0:l.indexOf(_))===-1?"grid":"grid3d":"heatmap"}}]),t}(Rp);function kC(e){var r=DC();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function DC(){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 LC=`uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniforms {
|
|
float u_opacity:1.0;
|
|
float u_brightness:1.0;
|
|
float u_contrast:1.0;
|
|
float u_saturation:1.0;
|
|
float u_gamma:1.0;
|
|
};
|
|
|
|
in vec2 v_texCoord;
|
|
out vec4 outputColor;
|
|
vec3 setContrast(vec3 rgb, float contrast) {
|
|
vec3 color = mix(vec3(0.5), rgb, contrast);
|
|
color = clamp(color, 0.0, 1.0);
|
|
return color;
|
|
}
|
|
vec3 setSaturation(vec3 rgb, float adjustment) {
|
|
const vec3 grayVector = vec3(0.2125, 0.7154, 0.0721);
|
|
vec3 intensity = vec3(dot(rgb, grayVector));
|
|
vec3 color = mix(intensity, rgb, adjustment);
|
|
color = clamp(color, 0.0, 1.0);
|
|
return color;
|
|
}
|
|
void main() {
|
|
vec4 color = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y));
|
|
//brightness
|
|
color.rgb = mix(vec3(0.0, 0.0, 0.0), color.rgb, u_brightness);
|
|
//contrast
|
|
color.rgb = setContrast(color.rgb, u_contrast);
|
|
// saturation
|
|
color.rgb = setSaturation(color.rgb, u_saturation);
|
|
// gamma
|
|
color.rgb = pow(color.rgb, vec3(u_gamma));
|
|
outputColor = color;
|
|
outputColor.a *= u_opacity;
|
|
if(outputColor.a < 0.01)
|
|
discard;
|
|
}
|
|
`,BC=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_opacity:1.0;
|
|
float u_brightness:1.0;
|
|
float u_contrast:1.0;
|
|
float u_saturation:1.0;
|
|
float u_gamma:1.0;
|
|
};
|
|
|
|
out 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));
|
|
|
|
}
|
|
`,FC=function(e){(0,Fe.Z)(t,e);var r=kC(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.color,s=a===void 0?"rgb(255,255,255)":a,l=i.opacity,f=i.brightness,d=i.contrast,_=i.saturation,b=i.gamma,T=vi(s),M={u_opacity:vl(l,1),u_brightness:vl(f,1),u_contrast:vl(d,1),u_saturation:vl(_,1),u_gamma:vl(b,1)};this.textures=[this.texture];var P=this.getUniformsBufferInfo(M);return P}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().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()}},a,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:"loadTexture",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f;return _e().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return s=this.rendererService.createTexture2D,this.texture=s({height:0,width:0}),l=this.layer.getSource(),_.next=5,l.data.images;case 5:f=_.sent,this.texture=s({data:f[0],width:f[0].width,height:f[0].height,mag:I.LINEAR,min:I.LINEAR});case 7:case"end":return _.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.initUniformsBuffer(),f.next=3,this.layer.buildLayerModel({moduleName:"rasterImage",vertexShader:BC,fragmentShader:LC,triangulation:Ig,primitive:I.TRIANGLES,blend:{enable:!0},depth:{enable:!1}});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:In.Attribute,descriptor:{name:"a_Uv",shaderLocation:Yn.UV,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(a,s,l){return[l[3],l[4]]}}})}}]),t}(Na),NC={image:FC},UC=NC;function zC(e){var r=ZC();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function ZC(){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,Fe.Z)(t,e);var r=zC(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"type","ImageLayer"),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel=new UC[s](this),f.next=4,this.initLayerModels();case 4:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),a={image:{}};return a[i]}},{key:"getModelType",value:function(){return"image"}}]),t}(Rp);function VC(e){var r=jC();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function jC(){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=`
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float segmentNumber;
|
|
float u_lineDir: 1.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_blur : 0.9;
|
|
float u_line_type: 0.0;
|
|
float u_time;
|
|
float u_linearColor: 0.0;
|
|
};
|
|
in vec2 v_iconMapUV;
|
|
in vec4 v_lineData;
|
|
in vec4 v_color;
|
|
//dash
|
|
in vec4 v_dash_array;
|
|
in float v_distance_ratio;
|
|
|
|
out vec4 outputColor;
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
if(u_dash_array!=vec4(0.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))) {
|
|
discard;
|
|
};
|
|
}
|
|
float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6
|
|
outputColor = 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);
|
|
outputColor.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 = texture(SAMPLER_2D(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;
|
|
outputColor = filterColor(outputColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(outputColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
outputColor = filterColor(pattern);
|
|
}
|
|
|
|
} else {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
}`,WC=`#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 12) in vec4 a_Instance;
|
|
layout(location = 14) in vec2 a_iconMapUV;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float segmentNumber;
|
|
float u_lineDir: 1.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_blur : 0.9;
|
|
float u_line_type: 0.0;
|
|
float u_time;
|
|
float u_linearColor: 0.0;
|
|
};
|
|
out vec4 v_color;
|
|
out vec2 v_iconMapUV;
|
|
out vec4 v_lineData;
|
|
//dash
|
|
out vec4 v_dash_array;
|
|
out 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 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() {
|
|
//vs\u4E2D\u8BA1\u7B97\u6E10\u53D8\u8272
|
|
if(u_linearColor==1.0){
|
|
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);
|
|
}
|
|
else{
|
|
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);
|
|
|
|
//\u8BA1\u7B97dashArray\u548CdistanceRatio \u8F93\u51FA\u5230\u7247\u5143
|
|
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;
|
|
|
|
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);
|
|
}
|
|
`,GC={solid:0,dash:1},lF=ui.isNumber,XC=function(e){(0,Fe.Z)(t,e);var r=VC(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.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:I.NEAREST,min:I.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128}),n.textures=[n.texture]}),n}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.sourceColor,s=i.targetColor,l=i.textureBlend,f=l===void 0?"normal":l,d=i.lineType,_=d===void 0?"solid":d,b=i.dashArray,T=b===void 0?[10,5]:b,M=i.forward,P=M===void 0?!0:M,D=i.lineTexture,G=D===void 0?!1:D,q=i.iconStep,se=q===void 0?100:q,Se=i.segmentNumber,Ve=Se===void 0?30:Se,nt=this.layer.getLayerConfig(),st=nt.animateOption,at=T;_!=="dash"&&(at=[0,0]),at.length===2&&at.push(0,0);var At=0,Wt=[0,0,0,0],Sr=[0,0,0,0];a&&s&&(Wt=vi(a),Sr=vi(s),At=1),this.rendererService.getDirty()&&this.texture.bind();var _r={u_animate:this.animateOption2Array(st),u_dash_array:at,u_sourceColor:Wt,u_targetColor:Sr,u_textSize:[1024,this.iconService.canvasHeight||128],segmentNumber:Ve,u_lineDir:P?1:-1,u_icon_step:se,u_line_texture:G?1:0,u_textureBlend:f==="normal"?0:1,u_blur:.9,u_line_type:GC[_||"solid"],u_time:this.layer.getLayerAnimateTime()||0,u_linearColor:At},Gr=this.getUniformsBufferInfo(_r);return Gr}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().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()}},a,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(){return{frag:HC,vert:WC,type:""}}},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b,T,M;return _e().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return this.initUniformsBuffer(),s=this.layer.getLayerConfig(),l=s.segmentNumber,f=l===void 0?30:l,d=this.getShaders(),_=d.frag,b=d.vert,T=d.type,D.next=5,this.layer.buildLayerModel({moduleName:"lineArc2d"+T,vertexShader:b,fragmentShader:_,inject:this.getInject(),triangulation:$0,depth:{enable:!1},styleOption:{segmentNumber:f}});case 5:return M=D.sent,D.abrupt("return",[M]);case 7:case"end":return D.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.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:In.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:4,update:function(s,l,f){return[f[3],f[4],f[5],f[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:In.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.texture,d=l[f]||{x:0,y:0},_=d.x,b=d.y;return[_,b]}}})}}]),t}(Na);function $C(e){var r=YC();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 sampler2D u_texture;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_globel;
|
|
float u_globel_radius;
|
|
float u_global_height: 10;
|
|
float segmentNumber;
|
|
float u_line_type: 0.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_time;
|
|
float u_linearColor: 0.0;
|
|
};
|
|
|
|
// varying vec2 v_normal;
|
|
in vec4 v_dash_array;
|
|
in vec4 v_color;
|
|
in vec4 v_line_data;
|
|
in float v_segmentIndex;
|
|
in vec2 v_iconMapUV;
|
|
|
|
out vec4 outputColor;
|
|
|
|
#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
|
|
outputColor = 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.;
|
|
}
|
|
outputColor.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);
|
|
outputColor.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 = texture(SAMPLER_2D(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;
|
|
outputColor = filterColor(outputColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(outputColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
discard;
|
|
} else {
|
|
outputColor = filterColor(pattern);
|
|
}
|
|
}
|
|
|
|
} else {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
}
|
|
`,KC=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 12) in vec4 a_Instance;
|
|
layout(location = 14) in vec2 a_iconMapUV;
|
|
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_globel;
|
|
float u_globel_radius;
|
|
float u_global_height: 10;
|
|
float segmentNumber;
|
|
float u_line_type: 0.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_time;
|
|
float u_linearColor: 0.0;
|
|
};
|
|
out vec4 v_color;
|
|
out vec4 v_dash_array;
|
|
out float v_segmentIndex;
|
|
out vec2 v_iconMapUV;
|
|
out 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() {
|
|
//vs\u4E2D\u8BA1\u7B97\u6E10\u53D8\u8272
|
|
if(u_linearColor==1.0){
|
|
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);
|
|
}
|
|
else{
|
|
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={solid:0,dash:1},O1=function(e){(0,Fe.Z)(t,e);var r=$C(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.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:I.NEAREST,min:I.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128}),n.textures=[n.texture]}),n}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.sourceColor,s=i.targetColor,l=i.textureBlend,f=l===void 0?"normal":l,d=i.lineType,_=d===void 0?"solid":d,b=i.dashArray,T=b===void 0?[10,5]:b,M=i.lineTexture,P=M===void 0?!1:M,D=i.iconStep,G=D===void 0?100:D,q=i.segmentNumber,se=q===void 0?30:q,Se=i.globalArcHeight,Ve=Se===void 0?10:Se,nt=this.layer.getLayerConfig(),st=nt.animateOption;T.length===2&&T.push(0,0);var at=0,At=[0,0,0,0],Wt=[0,0,0,0];a&&s&&(At=vi(a),Wt=vi(s),at=1),this.rendererService.getDirty()&&this.texture.bind();var Sr={u_animate:this.animateOption2Array(st),u_dash_array:T,u_sourceColor:At,u_targetColor:Wt,u_textSize:[1024,this.iconService.canvasHeight||128],u_globel:this.mapService.version==="GLOBEL"?1:0,u_globel_radius:m1,u_global_height:Ve,segmentNumber:se,u_line_type:QC[_]||0,u_icon_step:G,u_line_texture:P?1:0,u_textureBlend:f==="normal"?0:1,u_time:this.layer.getLayerAnimateTime()||0,u_linearColor:at},_r=this.getUniformsBufferInfo(Sr);return _r}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.initUniformsBuffer(),this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),l.abrupt("return",this.buildModels());case 4:case"end":return l.stop()}},a,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(){return{frag:qC,vert:KC,type:""}}},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b,T,M;return _e().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return s=this.layer.getLayerConfig(),l=s.segmentNumber,f=l===void 0?30:l,d=this.getShaders(),_=d.frag,b=d.vert,T=d.type,D.next=4,this.layer.buildLayerModel({moduleName:"lineArc3d"+T,vertexShader:b,fragmentShader:_,inject:this.getInject(),triangulation:$0,styleOption:{segmentNumber:f}});case 4:return M=D.sent,D.abrupt("return",[M]);case 6:case"end":return D.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.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:In.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:4,update:function(s,l,f){return[f[3],f[4],f[5],f[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:In.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.texture,d=l[f]||{x:0,y:0},_=d.x,b=d.y;return[_,b]}}})}}]),t}(Na),k1={circle:2,triangle:2,diamond:4,rect:2,classic:3,halfTriangle:2,none:0},Vl=1/2;function JC(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,a=i===void 0?1:i;return{vertices:[0,Vl*e,1*e*n,-(a+Vl)*e,1*e*n,(a-Vl)*e,0,Vl*e,1*e*n,-(a+Vl)*e,1*e*n,(a-Vl)*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 e3(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,a=i===void 0?3:i;return{vertices:[0,0,1*e*n,1*a,1*e*n,-1*a,0,0,1*e*n,1*a,1*e*n,-1*a],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 t3(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,a=i===void 0?2:i;return{vertices:[0,a/2,e*n*1,a/2,e*n*1,-a/2,0,-a/2,0,a/2,e*n*1,a/2,e*n*1,-a/2,0,-a/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 r3(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,a=i===void 0?3:i;return{vertices:[0,0,1*n*e,.5*a,2*n*e,0,1*n*e,-.5*a,0,0,1*n*e,.5*a,2*n*e,0,1*n*e,-.5*a],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 n3(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,a=i===void 0?3:i;return{vertices:[0,0,2*e*n,1*a,1.5*e*n,0,2*e*n,-1*a,0,0,2*e*n,1*a,1.5*e*n,0,2*e*n,-1*a],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 i3(e,r){var t=r.width,n=t===void 0?2:t,i=r.height,a=i===void 0?2:i,s=H0(),l=ko().flatten([s]),f=ko()(l.vertices,l.holes,l.dimensions),d=s.map(function(_){return[_[0]*n*e,_[1]*a]}).flat();return{vertices:[].concat((0,Qt.Z)(d),(0,Qt.Z)(d)),dimensions:2,indices:f.map(function(_){return _+s.length}),outLineIndices:f,normals:[].concat((0,Qt.Z)(s.map(function(_){return[_[1]*a,_[0]*n*e,1]}).flat()),(0,Qt.Z)(new Array(s.length*3).fill(0)))}}function a3(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0,n=(0,Hs.Z)(t.source)==="object"?t.source.type:t.source,i=(0,Hs.Z)(t.target)==="object"?t.target.type:t.target,a=(0,Hs.Z)(t.source)==="object"?t.source:{},s=a.width,l=s===void 0?n?k1[n]:0:s,f=a.height,d=f===void 0?2:f,_=(0,Hs.Z)(t.target)==="object"?t.target:{},b=_.width,T=b===void 0?i?k1[i]:0:b,M=_.height,P=M===void 0?2:M;return{vertices:[0,Vl,1*l].concat((0,Qt.Z)(e),[1,Vl,-1*T],(0,Qt.Z)(e),[1,-Vl,-1*T],(0,Qt.Z)(e),[0,-Vl,1*l],(0,Qt.Z)(e),[0,Vl,1*l],(0,Qt.Z)(e),[1,Vl,-1*T],(0,Qt.Z)(e),[1,-Vl,-1*T],(0,Qt.Z)(e),[0,-Vl,1*l],(0,Qt.Z)(e)),outLineIndices:[0,1,2,0,2,3].map(function(D){return D+r}),indices:[4,5,6,4,6,7].map(function(D){return D+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,Hs.Z)(e)==="object"?e.type:e,n=r==="source"?1:-1,i=(0,Hs.Z)(e)==="object"?e:{};switch(t){case"circle":return i3(n,i);case"triangle":return e3(n,i);case"diamond":return r3(n,i);case"rect":return t3(n,i);case"classic":return n3(n,i);case"halfTriangle":return JC(n,i);default:return{vertices:[],indices:[],normals:[],dimensions:2,outLineIndices:[],outLineNormals:[]}}}function o3(e){var r=e.coordinates.flat(),t=1,n=1;return{vertices:[1,0,0].concat((0,Qt.Z)(r),[1,2,-3],(0,Qt.Z)(r),[1,1,-3],(0,Qt.Z)(r),[0,1,0],(0,Qt.Z)(r),[0,0,0],(0,Qt.Z)(r),[1,0,0],(0,Qt.Z)(r),[1,2,-3],(0,Qt.Z)(r),[1,1,-3],(0,Qt.Z)(r),[0,1,0],(0,Qt.Z)(r),[0,0,0],(0,Qt.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 s3(e,r){return r?u3(e,r):o3(e)}function u3(e,r){var t=e.coordinates.flat(),n=r,i=n.target,a=i===void 0?"classic":i,s=n.source,l=s===void 0?"circle":s,f=L1(D1(l,"source"),t,0,0),d=a3(t,f.vertices.length/7,r),_=L1(D1(a,"target"),t,1,f.vertices.length/7+d.vertices.length/7),b={vertices:[].concat((0,Qt.Z)(f.vertices),(0,Qt.Z)(d.vertices),(0,Qt.Z)(_.vertices)),indices:[].concat((0,Qt.Z)(f.outLineIndices),(0,Qt.Z)(d.outLineIndices),(0,Qt.Z)(_.outLineIndices),(0,Qt.Z)(f.indices),(0,Qt.Z)(d.indices),(0,Qt.Z)(_.indices)),normals:[].concat((0,Qt.Z)(f.normals),(0,Qt.Z)(d.normals),(0,Qt.Z)(_.normals)),size:7};return b}function L1(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=[],a=e.vertices,s=e.indices,l=e.dimensions,f=e.outLineIndices,d=0;d<a.length;d+=l)i.push.apply(i,[t,a[d+1],a[d]].concat((0,Qt.Z)(r)));return(0,H.Z)((0,H.Z)({},e),{},{vertices:i,indices:s.map(function(_){return _+n}),outLineIndices:f.map(function(_){return _+n})})}function l3(e){var r=c3();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 f3=`// #extension GL_OES_standard_derivatives : enable
|
|
|
|
in vec4 v_color;
|
|
out vec4 outputColor;
|
|
|
|
|
|
// line texture
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
outputColor = v_color;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,h3=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in vec2 a_Size;
|
|
layout(location = 12) in vec4 a_Instance;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
float u_gap_width: 1.0;
|
|
float u_stroke_width: 1.0;
|
|
float u_stroke_opacity: 1.0;
|
|
};
|
|
|
|
#pragma include "projection"
|
|
#pragma include "project"
|
|
#pragma include "picking"
|
|
|
|
out vec4 v_color;
|
|
|
|
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);
|
|
}
|
|
`,p3=function(e){(0,Fe.Z)(t,e);var r=l3(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.gapWidth,s=a===void 0?2:a,l=i.strokeWidth,f=l===void 0?1:l,d=i.strokeOpacity,_=d===void 0?1:d,b={u_gap_width:s,u_stroke_width:f,u_stroke_opacity:_},T=this.getUniformsBufferInfo(b);return T}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.initUniformsBuffer(),l.abrupt("return",this.buildModels());case 2:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"flow_line",vertexShader:h3,fragmentShader:f3,inject:this.getInject(),triangulation:s3,styleOption:this.layer.getLayerConfig().symbol,primitive:I.TRIANGLES,depth:{enable:!1},pick:!1});case 2:return s=f.sent,f.abrupt("return",[s]);case 4:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(a){var s=a.size,l=s===void 0?1:s;return Array.isArray(l)?[l[0],l[1]]:[l,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:In.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:4,update:function(a,s,l){return[l[3],l[4],l[5],l[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:In.Attribute,descriptor:{name:"a_Normal",shaderLocation:Yn.NORMAL,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a,s,l,f,d){return d}}})}}]),t}(Na);function v3(e){var r=m3();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function m3(){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 g3=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float segmentNumber;
|
|
float u_line_type: 0.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_time;
|
|
float u_linearColor: 0;
|
|
};
|
|
|
|
in vec4 v_line_data;
|
|
in vec2 v_iconMapUV;
|
|
in vec4 v_dash_array;
|
|
in float v_distance_ratio;
|
|
in vec4 v_color;
|
|
|
|
out vec4 outputColor;
|
|
#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
|
|
outputColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);
|
|
outputColor.a *= v_color.a;
|
|
} else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272
|
|
outputColor = 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);
|
|
outputColor.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 = outputColor.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 = texture(SAMPLER_2D(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;
|
|
outputColor = filterColor(outputColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(outputColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
outputColor = filterColor(pattern);
|
|
}
|
|
} else {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
|
|
// gl_FragColor = filterColor(gl_FragColor);
|
|
}`,y3=`#define LineTypeSolid 0.0
|
|
#define LineTypeDash 1.0
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 12) in vec4 a_Instance;
|
|
layout(location = 14) in vec2 a_iconMapUV;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float segmentNumber;
|
|
float u_line_type: 0.0;
|
|
float u_icon_step: 100;
|
|
float u_line_texture: 0.0;
|
|
float u_textureBlend;
|
|
float u_time;
|
|
float u_linearColor: 0;
|
|
};
|
|
|
|
out vec4 v_dash_array;
|
|
out vec4 v_color;
|
|
out vec2 v_iconMapUV;
|
|
out vec4 v_line_data;
|
|
out float v_distance_ratio;
|
|
|
|
#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);
|
|
}
|
|
|
|
`,_3={solid:0,dash:1},x3=function(e){(0,Fe.Z)(t,e);var r=v3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.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:I.NEAREST,min:I.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128}),n.textures=[n.texture]}),n}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.sourceColor,s=i.targetColor,l=i.textureBlend,f=l===void 0?"normal":l,d=i.lineType,_=d===void 0?"solid":d,b=i.dashArray,T=b===void 0?[10,5]:b,M=i.lineTexture,P=M===void 0?!1:M,D=i.iconStep,G=D===void 0?100:D,q=i.segmentNumber,se=q===void 0?30:q,Se=this.layer.getLayerConfig(),Ve=Se.animateOption;T.length===2&&T.push(0,0),this.rendererService.getDirty()&&this.texture.bind();var nt=0,st=[0,0,0,0],at=[0,0,0,0];a&&s&&(st=vi(a),at=vi(s),nt=1);var At=this.layer.getLayerAnimateTime();isNaN(At)&&(At=0);var Wt={u_animate:this.animateOption2Array(Ve),u_dash_array:T,u_sourceColor:st,u_targetColor:at,u_textSize:[1024,this.iconService.canvasHeight||128],segmentNumber:se,u_line_type:_3[_]||0,u_icon_step:G,u_line_texture:P?1:0,u_textureBlend:f==="normal"?0:1,u_time:At,u_linearColor:nt},Sr=this.getUniformsBufferInfo(Wt);return Sr}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.initUniformsBuffer(),this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),l.abrupt("return",this.buildModels());case 4:case"end":return l.stop()}},a,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,Ft.Z)(_e().mark(function a(){var s,l,f,d;return _e().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:y3,fragmentShader:g3,triangulation:$0,styleOption:{segmentNumber:f},inject:this.getInject(),depth:{enable:!1}});case 3:return d=b.sent,b.abrupt("return",[d]);case 5:case"end":return b.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.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:In.Attribute,descriptor:{name:"a_Instance",shaderLocation:12,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:4,update:function(s,l,f){return[f[3],f[4],f[5],f[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:In.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.texture,d=l[f]||{x:0,y:0},_=d.x,b=d.y;return[_,b]}}})}}]),t}(Na),cF=function(e){return e[e.solid=0]="solid",e[e.dash=1]="dash",e}({}),B1=function(e){return e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e}({}),b3=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}({}),fF=function(e){return e.ALWAYS="always",e.DRAGEND="dragend",e}({});function E3(e){var r=S3();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function S3(){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 A3=`// #extension GL_OES_standard_derivatives : enable
|
|
#define Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array;
|
|
vec4 u_blur;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_icon_step: 100;
|
|
float u_heightfixed: 0.0;
|
|
float u_vertexScale: 1.0;
|
|
float u_raisingHeight: 0.0;
|
|
float u_strokeWidth: 0.0;
|
|
float u_textureBlend;
|
|
float u_line_texture;
|
|
float u_linearDir: 1.0;
|
|
float u_linearColor: 0;
|
|
float u_time;
|
|
};
|
|
|
|
in vec4 v_color;
|
|
in vec4 v_stroke;
|
|
in vec2 v_iconMapUV;
|
|
in vec4 v_texture_data;
|
|
// dash
|
|
in vec4 v_dash_array;
|
|
in float v_d_distance_ratio;
|
|
|
|
out vec4 outputColor;
|
|
#pragma include "picking"
|
|
|
|
// [animate, duration, interval, trailLength],
|
|
void main() {
|
|
if(u_dash_array!=vec4(0.0)){
|
|
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))) {
|
|
// \u865A\u7EBF\u90E8\u5206
|
|
discard;
|
|
};
|
|
}
|
|
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
|
|
if(u_linearDir < 1.0) {
|
|
d_distance_ratio = v_texture_data.a;
|
|
}
|
|
if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272
|
|
outputColor = mix(u_sourceColor, u_targetColor, d_distance_ratio);
|
|
outputColor.a *= v_color.a;
|
|
} else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272
|
|
outputColor = 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);
|
|
outputColor.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 = texture(SAMPLER_2D(u_texture), uv);
|
|
|
|
if(u_textureBlend == 0.0) { // normal
|
|
pattern.a = 0.0;
|
|
outputColor += pattern;
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(outputColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
outputColor = 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);
|
|
outputColor.rgb = mix(outputColor.rgb, v_stroke.rgb, linear);
|
|
} else if(v <= strokeWidth) {
|
|
float linear = smoothstep(0.0, 1.0, v/strokeWidth);
|
|
outputColor.rgb = mix(v_stroke.rgb, outputColor.rgb, linear);
|
|
}
|
|
}
|
|
|
|
if(v < borderOuterWidth) {
|
|
outputColor.a = mix(0.0, outputColor.a, v/borderOuterWidth);
|
|
} else if(v > 1.0 - borderOuterWidth) {
|
|
outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);
|
|
}
|
|
}
|
|
|
|
// blur
|
|
float blurV = v_texture_data.a;
|
|
if(blurV < 0.5) {
|
|
outputColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5);
|
|
} else {
|
|
outputColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5);
|
|
}
|
|
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,T3=`
|
|
#define Animate 0.0
|
|
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 10) in vec2 a_DistanceAndIndex;
|
|
layout(location = 9) in vec2 a_Size;
|
|
layout(location = 11) in float a_Total_Distance;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
layout(location = 15) in float a_Miter;
|
|
layout(location = 14) in vec2 a_iconMapUV;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_dash_array;
|
|
vec4 u_blur;
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_icon_step: 100;
|
|
float u_heightfixed: 0.0;
|
|
float u_vertexScale: 1.0;
|
|
float u_raisingHeight: 0.0;
|
|
float u_strokeWidth: 0.0;
|
|
float u_textureBlend;
|
|
float u_line_texture;
|
|
float u_linearDir: 1.0;
|
|
float u_linearColor: 0;
|
|
float u_time;
|
|
};
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
out vec4 v_color;
|
|
out vec4 v_stroke;
|
|
//dash
|
|
out vec4 v_dash_array;
|
|
out float v_d_distance_ratio;
|
|
|
|
// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09
|
|
out vec2 v_iconMapUV;
|
|
out vec4 v_texture_data;
|
|
|
|
void main() {
|
|
//dash\u8F93\u51FA
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;
|
|
v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance;
|
|
|
|
// 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;
|
|
|
|
|
|
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);
|
|
}
|
|
`,hF={solid:0,dash:1},F1=function(e){(0,Fe.Z)(t,e);var r=E3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"textureEventFlag",!1),(0,F.Z)((0,Me.Z)(n),"texture",n.createTexture2D({data:new Uint8Array([0,0,0,0]),width:1,height:1})),(0,F.Z)((0,Me.Z)(n),"updateTexture",function(){var l=n.rendererService.createTexture2D;if(n.textures.length===0&&(n.textures=[n.texture]),n.texture){n.texture.update({data:n.iconService.getCanvas()}),n.layer.render();return}n.texture=l({data:n.iconService.getCanvas(),mag:I.NEAREST,min:I.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128})}),n}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.sourceColor,s=i.targetColor,l=i.textureBlend,f=l===void 0?"normal":l,d=i.lineType,_=d===void 0?"solid":d,b=i.dashArray,T=b===void 0?[10,5,0,0]:b,M=i.lineTexture,P=M===void 0?!1:M,D=i.iconStep,G=D===void 0?100:D,q=i.vertexHeightScale,se=q===void 0?20:q,Se=i.strokeWidth,Ve=Se===void 0?0:Se,nt=i.raisingHeight,st=nt===void 0?0:nt,at=i.heightfixed,At=at===void 0?!1:at,Wt=i.linearDir,Sr=Wt===void 0?B1.VERTICAL:Wt,_r=i.blur,Gr=_r===void 0?[1,1,1,0]:_r,Cn=T;_!=="dash"&&(Cn=[0,0,0,0]),Cn.length===2&&Cn.push(0,0),this.rendererService.getDirty()&&this.texture&&this.texture.bind();var wi=this.layer.getLayerConfig(),la=wi.animateOption,co=0,Yo=[0,0,0,0],Uo=[0,0,0,0];a&&s&&(Yo=vi(a),Uo=vi(s),co=1);var qs={u_animate:this.animateOption2Array(la),u_dash_array:Cn,u_blur:Gr,u_sourceColor:Yo,u_targetColor:Uo,u_textSize:[1024,this.iconService.canvasHeight||128],u_icon_step:G,u_heightfixed:Number(At),u_vertexScale:se,u_raisingHeight:Number(st),u_strokeWidth:Ve,u_textureBlend:f===b3.NORMAL?0:1,u_line_texture:P?1:0,u_linearDir:Sr===B1.VERTICAL?1:0,u_linearColor:co,u_time:this.layer.getLayerAnimateTime()||0},bl=this.getUniformsBufferInfo(qs);return bl}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.initUniformsBuffer(),this.textureEventFlag||(this.textureEventFlag=!0,this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture)),l.abrupt("return",this.buildModels());case 3:case"end":return l.stop()}},a,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,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b,T,M;return _e().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return s=this.layer.getLayerConfig(),l=s.depth,f=l===void 0?!1:l,d=this.getShaders(),_=d.frag,b=d.vert,T=d.type,this.layer.triangulation=Hf,D.next=5,this.layer.buildLayerModel({moduleName:"line"+T,vertexShader:b,fragmentShader:_,triangulation:Hf,inject:this.getInject(),depth:{enable:f}});case 5:return M=D.sent,D.abrupt("return",[M]);case 7:case"end":return D.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){return{frag:A3,vert:T3,type:""}}},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"distanceAndIndex",type:In.Attribute,descriptor:{name:"a_DistanceAndIndex",shaderLocation:10,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(s,l,f,d,_,b){return b===void 0?[f[3],10]:[f[3],b]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:In.Attribute,descriptor:{name:"a_Total_Distance",shaderLocation:11,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(s,l,f){return[f[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.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:In.Attribute,descriptor:{name:"a_Normal",shaderLocation:Yn.NORMAL,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(s,l,f,d,_){return _}}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:In.Attribute,descriptor:{shaderLocation:15,name:"a_Miter",buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(s,l,f){return[f[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:In.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:Yn.UV,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.texture,d=l[f]||{x:0,y:0},_=d.x,b=d.y;return[_,b]}}})}}]),t}(Na);function w3(e){var r=C3();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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=`
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec4 u_dash_array;
|
|
float u_vertexScale: 1.0;
|
|
float u_linearColor: 0;
|
|
};
|
|
in float v_distanceScale;
|
|
in vec4 v_color;
|
|
//dash
|
|
in vec4 v_dash_array;
|
|
|
|
out vec4 outputColor;
|
|
void main() {
|
|
if(u_dash_array!=vec4(0.0)){
|
|
float dashLength = mod(v_distanceScale, 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))) {
|
|
// \u865A\u7EBF\u90E8\u5206
|
|
discard;
|
|
};
|
|
}
|
|
if(u_linearColor==1.0){
|
|
outputColor = mix(u_sourceColor, u_targetColor, v_distanceScale);
|
|
outputColor.a *= v_color.a; // \u5168\u5C40\u900F\u660E\u5EA6
|
|
}
|
|
else{
|
|
outputColor = v_color;
|
|
}
|
|
}
|
|
`,M3=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in vec4 a_SizeDistanceAndTotalDistance;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec4 u_dash_array;
|
|
float u_vertexScale: 1.0;
|
|
float u_linearColor: 0;
|
|
};
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
out vec4 v_color;
|
|
out float v_distanceScale;
|
|
out vec4 v_dash_array;
|
|
|
|
void main() {
|
|
//dash\u8F93\u51FA
|
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_SizeDistanceAndTotalDistance.a;
|
|
|
|
v_color = a_Color;
|
|
v_distanceScale = a_SizeDistanceAndTotalDistance.b / a_SizeDistanceAndTotalDistance.a;
|
|
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_SizeDistanceAndTotalDistance.y) + h * 0.2, 1.0));
|
|
} else {
|
|
float lineHeight = a_SizeDistanceAndTotalDistance.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;
|
|
}
|
|
}
|
|
`,pF=ui.isNumber,I3=function(e){(0,Fe.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:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.sourceColor,s=i.targetColor,l=i.lineType,f=l===void 0?"solid":l,d=i.dashArray,_=d===void 0?[10,5,0,0]:d,b=i.vertexHeightScale,T=b===void 0?20:b,M=_;f!=="dash"&&(M=[0,0,0,0]),M.length===2&&M.push(0,0);var P=0,D=[0,0,0,0],G=[0,0,0,0];a&&s&&(D=vi(a),G=vi(s),P=1);var q={u_sourceColor:D,u_targetColor:G,u_dash_array:M,u_vertexScale:T,u_linearColor:P},se=this.getUniformsBufferInfo(q);return se}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){return{frag:R3,vert:M3,type:"lineSimpleNormal"}}},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_;return _e().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return this.initUniformsBuffer(),s=this.getShaders(),l=s.frag,f=s.vert,d=s.type,T.next=4,this.layer.buildLayerModel({moduleName:d,vertexShader:f,fragmentShader:l,triangulation:Zw,inject:this.getInject(),primitive:I.LINES,depth:{enable:!1},pick:!1});case 4:return _=T.sent,T.abrupt("return",[_]);case 6:case"end":return T.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"sizeDistanceAndTotalDistance",type:In.Attribute,descriptor:{name:"a_SizeDistanceAndTotalDistance",shaderLocation:Yn.SIZE,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:4,update:function(a,s,l){var f=a.size,d=f===void 0?1:f,_=Array.isArray(d)?[d[0],d[1]]:[d,0];return[_[0],_[1],l[3],l[5]]}}})}}]),t}(Na);function P3(e){var r=O3();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function O3(){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 Animate 0.0
|
|
#define LineTexture 1.0
|
|
|
|
// line texture
|
|
|
|
uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_icon_step: 100;
|
|
float u_heightfixed;
|
|
float u_linearColor: 0;
|
|
float u_line_texture;
|
|
float u_textureBlend;
|
|
float u_iconStepCount;
|
|
float u_time;
|
|
};
|
|
in vec2 v_iconMapUV;
|
|
in float v_blur;
|
|
in float v_radio;
|
|
in vec4 v_color;
|
|
in vec4 v_dataset;
|
|
|
|
out vec4 outputColor;
|
|
#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
|
|
outputColor = mix(u_sourceColor, u_targetColor, v);
|
|
} else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272
|
|
outputColor = v_color;
|
|
}
|
|
|
|
outputColor.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);
|
|
outputColor.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 = texture(SAMPLER_2D(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;
|
|
outputColor = filterColor(outputColor + pattern);
|
|
} else { // replace
|
|
pattern.a *= v_color.a;
|
|
if(outputColor.a <= 0.0) {
|
|
pattern.a = 0.0;
|
|
}
|
|
outputColor = filterColor(pattern);
|
|
}
|
|
}
|
|
|
|
|
|
// blur - AA
|
|
if(v < v_blur) {
|
|
outputColor.a = mix(0.0, outputColor.a, v/v_blur);
|
|
} else if(v > 1.0 - v_blur) {
|
|
outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - v_blur))/v_blur);
|
|
}
|
|
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,D3=`#define Animate 0.0
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in vec2 a_Size;
|
|
layout(location = 10) in float a_Miter;
|
|
layout(location = 11) in float a_Total_Distance;
|
|
layout(location = 12) in vec4 a_Instance;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
layout(location = 14) in vec2 a_iconMapUV;
|
|
layout(location = 15) in float a_Distance;
|
|
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
vec2 u_textSize;
|
|
float u_icon_step: 100;
|
|
float u_heightfixed;
|
|
float u_linearColor: 0;
|
|
float u_line_texture;
|
|
float u_textureBlend;
|
|
float u_iconStepCount;
|
|
float u_time;
|
|
};
|
|
#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
|
|
out vec2 v_iconMapUV;
|
|
out vec4 v_color;
|
|
out float v_blur;
|
|
out float v_radio;
|
|
out 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);
|
|
}
|
|
`,L3=function(e){(0,Fe.Z)(t,e);var r=P3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.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:I.NEAREST,min:I.NEAREST,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128}),n.textures=[n.texture]}),n}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.sourceColor,s=i.targetColor,l=i.textureBlend,f=l===void 0?"normal":l,d=i.heightfixed,_=d===void 0?!1:d,b=i.lineTexture,T=b===void 0?!1:b,M=i.iconStep,P=M===void 0?100:M,D=i.iconStepCount,G=D===void 0?1:D,q=this.layer.getLayerConfig(),se=q.animateOption;this.rendererService.getDirty()&&this.texture.bind();var Se=0,Ve=[0,0,0,0],nt=[0,0,0,0];a&&s&&(Ve=vi(a),nt=vi(s),Se=1);var st={u_animate:this.animateOption2Array(se),u_sourceColor:Ve,u_targetColor:nt,u_textSize:[1024,this.iconService.canvasHeight||128],u_icon_step:P,u_heightfixed:Number(_),u_linearColor:Se,u_line_texture:T?1:0,u_textureBlend:f==="normal"?0:1,u_iconStepCount:G,u_time:this.layer.getLayerAnimateTime()||0},at=this.getUniformsBufferInfo(st);return at}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.initUniformsBuffer(),this.updateTexture(),this.iconService.on("imageUpdate",this.updateTexture),l.abrupt("return",this.buildModels());case 4:case"end":return l.stop()}},a,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,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.layer.buildLayerModel({moduleName:"lineWall",vertexShader:D3,fragmentShader:k3,triangulation:zw,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()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"distance",type:In.Attribute,descriptor:{name:"a_Distance",shaderLocation:15,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(s,l,f){return[f[3]]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:In.Attribute,descriptor:{name:"a_Total_Distance",shaderLocation:11,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(s,l,f){return[f[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.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:In.Attribute,descriptor:{name:"a_Normal",shaderLocation:Yn.NORMAL,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(s,l,f,d,_){return _}}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:In.Attribute,descriptor:{name:"a_Miter",shaderLocation:10,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(s,l,f){return[f[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:In.Attribute,descriptor:{name:"a_iconMapUV",shaderLocation:14,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.texture,d=l[f]||{x:0,y:0},_=d.x,b=d.y;return[_,b]}}})}}]),t}(Na),B3={arc:XC,arc3d:O1,greatcircle:x3,wall:L3,line:F1,simple:I3,flowline:p3,earthArc3d:O1},F3=B3;function N3(e){var r=U3();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function U3(){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,Fe.Z)(t,e);var r=N3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"type","LineLayer"),(0,F.Z)((0,Me.Z)(n),"enableShaderEncodeStyles",["stroke","offsets","opacity","thetaOffset"]),(0,F.Z)((0,Me.Z)(n),"arrowInsertCount",0),(0,F.Z)((0,Me.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,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel=new F3[s](this),f.next=4,this.initLayerModels();case 4:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),a={line:{},linearline:{},simple:{},wall:{},arc3d:{blend:"additive"},arc:{blend:"additive"},greatcircle:{blend:"additive"},tileLine:{},earthArc3d:{},flowline:{},arrow:{}};return a[i]}},{key:"getModelType",value:function(){var i;if(this.layerType)return this.layerType;var a=this.styleAttributeService.getLayerStyleAttribute("shape"),s=a==null||(i=a.scale)===null||i===void 0?void 0:i.field;return s||"line"}},{key:"processData",value:function(i){if(this.getModelType()!=="simple")return i;var a=[];return i.map(function(s){if(Array.isArray(s.coordinates)&&Array.isArray(s.coordinates[0])&&Array.isArray(s.coordinates[0][0])){var l=(0,H.Z)({},s);s.coordinates.map(function(f){a.push((0,H.Z)((0,H.Z)({},l),{},{coordinates:f}))})}else a.push(s)}),a}}]),t}(Rp);function z3(e){var r=Z3();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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=`
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_stroke_color;
|
|
float u_additive;
|
|
float u_stroke_opacity;
|
|
float u_stroke_width;
|
|
};
|
|
|
|
in vec4 v_color;
|
|
in float v_blur;
|
|
in float v_innerRadius;
|
|
|
|
out vec4 outputColor;
|
|
|
|
#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) {
|
|
outputColor = stroke;
|
|
} else if(fragmengTocenter > v_innerRadius - blurWidth){
|
|
float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);
|
|
outputColor = mix(v_color, stroke, mixR);
|
|
} else {
|
|
outputColor = v_color;
|
|
}
|
|
} else {
|
|
// \u5F53\u4E0D\u5B58\u5728 stroke \u6216 stroke <= 0.01
|
|
outputColor = v_color;
|
|
}
|
|
|
|
outputColor = filterColor(outputColor);
|
|
|
|
if(u_additive > 0.0) {
|
|
outputColor *= circleClipOpacity;
|
|
} else {
|
|
outputColor.a *= circleClipOpacity;
|
|
}
|
|
|
|
}
|
|
`,j3=`
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_stroke_color;
|
|
float u_additive;
|
|
float u_stroke_opacity;
|
|
float u_stroke_width;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
out float v_blur;
|
|
out float v_innerRadius;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
#pragma include "project"
|
|
void main() {
|
|
v_color = vec4(a_Color.xyz, a_Color.w * 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,Qt.Z)(r),indices:[0],size:r.length}}var H3=function(e){(0,Fe.Z)(t,e);var r=z3(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:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.blend,s=i.strokeOpacity,l=s===void 0?1:s,f=i.strokeWidth,d=f===void 0?0:f,_=i.stroke,b=_===void 0?"#fff":_,T={u_stroke_color:vi(b),u_additive:a==="additive"?1:0,u_stroke_opacity:l,u_stroke_width:d},M=this.getUniformsBufferInfo(T);return M}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.layer.triangulation=N1,this.initUniformsBuffer(),f.next=4,this.layer.buildLayerModel({moduleName:"pointSimple",vertexShader:j3,fragmentShader:V3,inject:this.getInject(),triangulation:N1,depth:{enable:!1},primitive:I.POINTS});case 4:return s=f.sent,f.abrupt("return",[s]);case 6:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(a){var s=a.size,l=s===void 0?1:s;return Array.isArray(l)?[l[0]]:[l]}}})}}]),t}(Na);function W3(e){var r=G3();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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=`precision highp float;
|
|
in vec4 v_color;
|
|
|
|
#pragma include "picking"
|
|
|
|
layout(std140) uniform commonUniform {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor: 0;
|
|
float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
float u_globel;
|
|
float u_r;
|
|
float u_pickLight: 0.0;
|
|
float u_opacitylinear: 0.0;
|
|
float u_opacitylinear_dir: 1.0;
|
|
float u_lightEnable: 1.0;
|
|
};
|
|
in float v_lightWeight;
|
|
in float v_barLinearZ;
|
|
out vec4 outputColor;
|
|
void main() {
|
|
|
|
outputColor = v_color;
|
|
|
|
// \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8
|
|
if(u_opacitylinear > 0.0) {
|
|
outputColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ;
|
|
}
|
|
|
|
// picking
|
|
if(u_pickLight > 0.0) {
|
|
outputColor = filterColorAlpha(outputColor, v_lightWeight);
|
|
} else {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
}
|
|
`,$3=`precision highp float;
|
|
|
|
#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_Pos;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
|
|
|
|
layout(std140) uniform commonUniform {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor: 0;
|
|
float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
float u_globel;
|
|
float u_r;
|
|
float u_pickLight: 0.0;
|
|
float u_opacitylinear: 0.0;
|
|
float u_opacitylinear_dir: 1.0;
|
|
float u_lightEnable: 1.0;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
out float v_lightWeight;
|
|
out 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() {
|
|
|
|
// 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, v_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);
|
|
}
|
|
`,Y3=ui.isNumber,q3=function(e){(0,Fe.Z)(t,e);var r=W3(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"raiseCount",0),(0,F.Z)((0,Me.Z)(n),"raiseRepeat",0),n}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.animateOption,s=a===void 0?{enable:!1,speed:.01,repeat:!1}:a,l=i.opacity,f=l===void 0?1:l,d=i.sourceColor,_=i.targetColor,b=i.pickLight,T=b===void 0?!1:b,M=i.heightfixed,P=M===void 0?!0:M,D=i.opacityLinear,G=D===void 0?{enable:!1,dir:"up"}:D,q=i.lightEnable,se=q===void 0?!0:q,Se=0,Ve=[0,0,0,0],nt=[0,0,0,0];if(d&&_&&(Ve=vi(d),nt=vi(_),Se=1),this.raiseCount<1&&this.raiseRepeat>0&&s.enable){var st=s.speed,at=st===void 0?.01:st;this.raiseCount+=at,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}var At={u_sourceColor:Ve,u_targetColor:nt,u_linearColor:Se,u_pickLight:Number(T),u_heightfixed:Number(P),u_r:s.enable&&this.raiseRepeat>0?this.raiseCount:1,u_opacity:Y3(f)?f:1,u_opacitylinear:Number(G.enable),u_opacitylinear_dir:G.dir==="up"?1:0,u_lightEnable:Number(se)},Wt=this.getUniformsBufferInfo(At);return Wt}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.initUniformsBuffer(),l.abrupt("return",this.buildModels());case 2:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d;return _e().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:$3,fragmentShader:X3,triangulation:W0,depth:{enable:!0},inject:this.getInject(),cull:{enable:!0,face:Ji(this.mapService.version)},blend:this.getBlend()});case 4:return d=b.sent,b.abrupt("return",[d]);case 6:case"end":return b.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a){var s=a.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:In.Attribute,descriptor:{name:"a_Normal",shaderLocation:Yn.NORMAL,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a,s,l,f,d){return d}}}),this.styleAttributeService.registerStyleAttribute({name:"pos",type:In.Attribute,descriptor:{name:"a_Pos",shaderLocation:15,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a){var s=Qs(a.coordinates);return y1([s[0],s[1]])}}})}}]),t}(Na);function K3(e){var r=Q3();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function Q3(){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 J3=`in vec4 v_data;
|
|
in vec4 v_color;
|
|
in float v_radius;
|
|
|
|
layout(std140) uniform commonUniform {
|
|
float u_additive;
|
|
float u_stroke_opacity : 1;
|
|
float u_stroke_width : 2;
|
|
float u_blur : 0.0;
|
|
};
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
int shape = int(floor(v_data.w + 0.5));
|
|
|
|
vec4 strokeColor = u_stroke == vec4(0.0) ? v_color : u_stroke;
|
|
|
|
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);
|
|
}
|
|
|
|
if(outer_df > antialiasblur + 0.018) discard;
|
|
|
|
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 = vec4(v_color.rgb, v_color.a * u_opacity);
|
|
} else {
|
|
outputColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * 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);
|
|
}
|
|
}
|
|
`,eR=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 10) in float a_Shape;
|
|
layout(location = 11) in vec3 a_Extrude;
|
|
|
|
layout(std140) uniform commonUniform {
|
|
float u_additive;
|
|
float u_stroke_opacity : 1;
|
|
float u_stroke_width : 2;
|
|
float u_blur : 0.0;
|
|
};
|
|
out vec4 v_data;
|
|
out vec4 v_color;
|
|
out float v_radius;
|
|
|
|
#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 + vec3(u_offsets,0.0), 1.0);
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}`,tR=function(e){(0,Fe.Z)(t,e);var r=K3(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.strokeOpacity,s=a===void 0?1:a,l=i.strokeWidth,f=l===void 0?0:l,d=i.blend,_=i.blur,b=_===void 0?0:_;this.layer.getLayerConfig();var T={u_additive:d==="additive"?1:0,u_stroke_opacity:s,u_stroke_width:f,u_blur:b},M=this.getUniformsBufferInfo(T);return M}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return this.initUniformsBuffer(),l.abrupt("return",this.buildModels());case 2:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().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:eR,fragmentShader:J3,triangulation:A1,inject:this.getInject(),depth:{enable:!0},blend:this.getBlend()});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},a,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:In.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Yn.EXTRUDE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(s,l,f,d){var _=(0,_n.Z)(f,3),b=_[0],T=_[1],M=_[2],P=La.fromValues(0,0,1),D=La.fromValues(b,0,M),G=b>=0?La.angle(P,D):Math.PI*2-La.angle(P,D),q=Math.PI*2-Math.asin(T/100),se=Ct.create();Ct.rotateY(se,se,G),Ct.rotateX(se,se,q);var Se=La.fromValues(1,1,0);La.transformMat4(Se,Se,se),La.normalize(Se,Se);var Ve=La.fromValues(-1,1,0);La.transformMat4(Ve,Ve,se),La.normalize(Ve,Ve);var nt=La.fromValues(-1,-1,0);La.transformMat4(nt,nt,se),La.normalize(nt,nt);var st=La.fromValues(1,-1,0);La.transformMat4(st,st,se),La.normalize(st,st);var at=[].concat((0,Qt.Z)(Se),(0,Qt.Z)(Ve),(0,Qt.Z)(nt),(0,Qt.Z)(st)),At=d%4*3;return[at[At],at[At+1],at[At+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.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:In.Attribute,descriptor:{name:"a_Shape",shaderLocation:Yn.SHAPE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(s){var l=s.shape,f=l===void 0?2:l,d=i.layer.getLayerConfig().shape2d,_=d.indexOf(f);return[_]}}})}}]),t}(Na);function rR(e){var r=nR();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 iR=`
|
|
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
|
|
|
|
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,Fe.Z)(t,e);var r=rR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"raiseCount",0),(0,F.Z)((0,Me.Z)(n),"raiseRepeat",0),n}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.animateOption,s=a===void 0?{enable:!1,speed:.01,repeat:!1}:a,l=i.sourceColor,f=i.targetColor,d=i.pickLight,_=d===void 0?!1:d,b=i.heightfixed,T=b===void 0?!1:b,M=i.opacityLinear,P=M===void 0?{enable:!1,dir:"up"}:M,D=i.lightEnable,G=D===void 0?!0:D,q=0,se=[0,0,0,0],Se=[0,0,0,0];if(l&&f&&(se=vi(l),Se=vi(f),q=1),this.raiseCount<1&&this.raiseRepeat>0&&s.enable){var Ve=s.speed,nt=Ve===void 0?.01:Ve;this.raiseCount+=nt,this.raiseCount>=1&&(this.raiseRepeat>1?(this.raiseCount=0,this.raiseRepeat--):this.raiseCount=1)}var st={u_pickLight:Number(_),u_heightfixed:Number(T),u_r:s.enable&&this.raiseRepeat>0?this.raiseCount:1,u_linearColor:q,u_sourceColor:se,u_targetColor:Se,u_opacitylinear:Number(P.enable),u_opacitylinear_dir:P.dir==="up"?1:0,u_lightEnable:Number(G)},at=this.getUniformsBufferInfo(st);return at}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b;return _e().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,d=s.animateOption.repeat,_=d===void 0?1:d,this.raiseRepeat=_,this.initUniformsBuffer(),M.next=5,this.layer.buildLayerModel({moduleName:"pointExtrude",vertexShader:aR,fragmentShader:iR,triangulation:W0,inject:this.getInject(),cull:{enable:!0,face:Ji(this.mapService.version)},depth:{enable:f}});case 5:return b=M.sent,M.abrupt("return",[b]);case 7:case"end":return M.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a){var s=a.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:In.Attribute,descriptor:{name:"a_Normal",shaderLocation:Yn.NORMAL,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a,s,l,f,d){return d}}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:In.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Yn.EXTRUDE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a){var s=Qs(a.coordinates);return[s[0],s[1],0]}}})}}]),t}(Na);function oR(e){var r=sR();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function sR(){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=`layout(std140) uniform commonUniforms {
|
|
vec3 u_blur_height_fixed;
|
|
float u_stroke_width;
|
|
float u_additive;
|
|
float u_stroke_opacity;
|
|
float u_size_unit;
|
|
float u_time;
|
|
vec4 u_animate;
|
|
};
|
|
|
|
|
|
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
|
|
);
|
|
|
|
float PI = 3.14159;
|
|
float N_RINGS = 3.0;
|
|
float FREQ = 1.0;
|
|
|
|
if(u_stroke_width < 0.01) {
|
|
outputColor = v_color;
|
|
} else {
|
|
outputColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);
|
|
}
|
|
float intensity = 1.0;
|
|
if(u_time!=-1.0){
|
|
//wave\u76F8\u5173\u903B\u8F91
|
|
float d = length(v_data.xy);
|
|
if(d > 0.5) {
|
|
discard;
|
|
}
|
|
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);
|
|
}
|
|
|
|
if(u_additive > 0.0) {
|
|
outputColor *= opacity_t;
|
|
outputColor *= intensity;//wave
|
|
outputColor = filterColorAlpha(outputColor, outputColor.a);
|
|
} else {
|
|
outputColor.a *= opacity_t;
|
|
outputColor.a *= intensity;//wave
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
// \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20
|
|
if(outputColor.a < 0.01) {
|
|
discard;
|
|
}
|
|
}
|
|
`,lR=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 10) in float a_Shape;
|
|
layout(location = 11) in vec3 a_Extrude;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec3 u_blur_height_fixed;
|
|
float u_stroke_width;
|
|
float u_additive;
|
|
float u_stroke_opacity;
|
|
float u_size_unit;
|
|
float u_time;
|
|
vec4 u_animate;
|
|
};
|
|
|
|
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,Fe.Z)(t,e);var r=oR(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.strokeOpacity,s=a===void 0?1:a,l=i.strokeWidth,f=l===void 0?0:l,d=i.blend,_=i.blur,b=_===void 0?0:_,T=i.raisingHeight,M=T===void 0?0:T,P=i.heightfixed,D=P===void 0?!1:P,G=i.unit,q=G===void 0?"pixel":G,se=this.getAnimateUniforms().u_time;isNaN(se)&&(se=-1);var Se={u_blur_height_fixed:[b,Number(M),Number(D)],u_stroke_width:f,u_additive:d==="additive"?1:0,u_stroke_opacity:s,u_size_unit:Y0[q],u_time:se,u_animate:this.getAnimateUniforms().u_animate},Ve=this.getUniformsBufferInfo(Se);return Ve}},{key:"getAnimateUniforms",value:function(){var i=this.layer.getLayerConfig(),a=i.animateOption,s=a===void 0?{enable:!1}:a;return{u_animate:this.animateOption2Array(s),u_time:this.layer.getLayerAnimateTime()}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),dp)}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b,T,M;return _e().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return s=this.layer.getLayerConfig(),l=s.animateOption,f=l===void 0?{enable:!1}:l,d=this.getShaders(f),_=d.frag,b=d.vert,T=d.type,this.layer.triangulation=dp,this.initUniformsBuffer(),D.next=6,this.layer.buildLayerModel({moduleName:T,vertexShader:b,fragmentShader:_,inject:this.getInject(),triangulation:dp,depth:{enable:!1}});case 6:return M=D.sent,D.abrupt("return",[M]);case 8:case"end":return D.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(i){return{frag:uR,vert:lR,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:In.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Yn.EXTRUDE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(s,l,f,d){var _=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],b=d%4*3;return[_[b],_[b+1],_[b+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.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:In.Attribute,descriptor:{name:"a_Shape",shaderLocation:Yn.SHAPE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(s){var l=s.shape,f=l===void 0?2:l,d=i.indexOf(f);return[d]}}})}}]),t}(Na);function cR(e){var r=fR();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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=`in vec4 v_color;
|
|
in vec2 v_uv;// \u672C\u8EAB\u7684 uv \u5750\u6807
|
|
in vec2 v_Iconuv;
|
|
in float v_opacity;
|
|
out vec4 outputColor;
|
|
|
|
uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniform {
|
|
vec2 u_textSize;
|
|
float u_heightfixed: 0.0;
|
|
float u_raisingHeight: 0.0;
|
|
float u_size_unit;
|
|
};
|
|
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
|
|
|
|
void main() {
|
|
vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;
|
|
outputColor = texture(SAMPLER_2D(u_texture), pos);
|
|
outputColor.a *= v_opacity;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,pR=`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 = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniform {
|
|
vec2 u_textSize;
|
|
float u_heightfixed: 0.0;
|
|
float u_raisingHeight: 0.0;
|
|
float u_size_unit;
|
|
};
|
|
|
|
out vec2 v_uv;
|
|
out vec2 v_Iconuv;
|
|
out float v_opacity;
|
|
|
|
|
|
#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.0) {
|
|
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);
|
|
}
|
|
`,dR=function(e){(0,Fe.Z)(t,e);var r=cR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"meter2coord",1),(0,F.Z)((0,Me.Z)(n),"isMeter",!1),(0,F.Z)((0,Me.Z)(n),"radian",0),(0,F.Z)((0,Me.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:I.LINEAR,min:I.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128,mipmap:!0}),n.textures=[n.texture]}),n}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.raisingHeight,s=a===void 0?0:a,l=i.heightfixed,f=l===void 0?!1:l,d=i.unit,_=d===void 0?"pixel":d;this.rendererService.getDirty()&&this.texture.bind();var b={u_textSize:[1024,this.iconService.canvasHeight||128],u_heightfixed:Number(f),u_raisingHeight:Number(s),u_size_unit:Y0[_],u_texture:this.texture};this.textures=[this.texture];var T=this.getUniformsBufferInfo(b);return T}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),Mg)}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().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()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.initUniformsBuffer(),f.next=3,this.layer.buildLayerModel({moduleName:"pointFillImage",vertexShader:pR,fragmentShader:hR,triangulation:Mg,depth:{enable:!1},inject:this.getInject(),cull:{enable:!0,face:Ji(this.mapService.version)}});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},a,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:In.Attribute,descriptor:{name:"a_Uv",shaderLocation:Yn.UV,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.shape,d=l[f]||{x:-64,y:-64},_=d.x,b=d.y;return[_,b]}}}),this.styleAttributeService.registerStyleAttribute({name:"extrude",type:In.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Yn.EXTRUDE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(s,l,f,d){var _=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],b=d%4*3;return[_[b],_[b+1],_[b+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(s){var l=s.size,f=l===void 0?5:l;return Array.isArray(f)?[f[0]]:[f]}}})}}]),t}(Na);function vR(e){var r=mR();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 gR=`layout(std140) uniform commonUniforms {
|
|
vec2 u_textSize;
|
|
float u_raisingHeight;
|
|
float u_heightfixed;
|
|
};
|
|
|
|
uniform sampler2D u_texture;
|
|
|
|
in vec4 v_color;
|
|
in vec2 v_uv;
|
|
in float v_opacity;
|
|
|
|
#pragma include "picking"
|
|
|
|
out vec4 outputColor;
|
|
|
|
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 = texture(SAMPLER_2D(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)){
|
|
outputColor= textureColor;
|
|
}else {
|
|
outputColor= step(0.01, textureColor.z) * v_color;
|
|
}
|
|
outputColor.a *= v_opacity;
|
|
if (outputColor.a < 0.01) {
|
|
discard;
|
|
}
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,yR=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec2 u_textSize;
|
|
float u_raisingHeight;
|
|
float u_heightfixed;
|
|
};
|
|
|
|
out vec4 v_color;
|
|
out vec2 v_uv;
|
|
out float v_opacity;
|
|
|
|
#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);
|
|
}
|
|
`,Z1=function(e){(0,Fe.Z)(t,e);var r=vR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.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:I.LINEAR,min:I.LINEAR_MIPMAP_LINEAR,premultiplyAlpha:!1,width:1024,height:n.iconService.canvasHeight||128,mipmap:!0})}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){this.rendererService.getDirty()&&this.texture.bind();var i=this.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.raisingHeight,s=a===void 0?0:a,l=i.heightfixed,f=l===void 0?!1:l,d={u_textSize:[1024,this.iconService.canvasHeight||128],u_raisingHeight:Number(s),u_heightfixed:Number(f),u_texture:this.texture};this.textures=[this.texture];var _=this.getUniformsBufferInfo(d);return _}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().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()}},a,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,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.initUniformsBuffer(),f.next=3,this.layer.buildLayerModel({moduleName:"pointImage",vertexShader:yR,fragmentShader:gR,triangulation:Uw,inject:this.getInject(),depth:{enable:!1},primitive:I.POINTS});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this;this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.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:In.Attribute,descriptor:{name:"a_Uv",shaderLocation:Yn.UV,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(s){var l=i.iconService.getIconMap(),f=s.shape,d=l[f]||{x:-64,y:-64},_=d.x,b=d.y;return[_,b]}}})}}]),t}(Na);function _R(e){var r=xR();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function xR(){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 bR=`in vec4 v_color;
|
|
out vec4 outputColor;
|
|
void main() {
|
|
outputColor = v_color;
|
|
}`,ER=`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 V1(e){var r=e.coordinates;return{vertices:(0,Qt.Z)(r),indices:[0],size:r.length}}var j1=function(e){(0,Fe.Z)(t,e);var r=_R(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:"getCommonUniformsInfo",value:function(){var i={u_size_scale:.5},a=this.getUniformsBufferInfo(i);return a}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.layer.triangulation=V1,this.initUniformsBuffer(),f.next=4,this.layer.buildLayerModel({moduleName:"pointNormal",vertexShader:ER,fragmentShader:bR,triangulation:V1,inject:this.getInject(),depth:{enable:!1},primitive:I.POINTS,pick:!1});case 4:return s=f.sent,f.abrupt("return",[s]);case 6:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(a){var s=a.size,l=s===void 0?1:s;return Array.isArray(l)?[l[0]]:[l]}}})}}]),t}(Na);function SR(e){var r=AR();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function AR(){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 TR=`
|
|
layout(std140) uniform commonUniorm{
|
|
float u_additive;
|
|
float u_size_unit;
|
|
float u_speed: 1.0;
|
|
float u_time;
|
|
};
|
|
in vec4 v_data;
|
|
in vec4 v_color;
|
|
in float v_radius;
|
|
in vec2 v_extrude;
|
|
#pragma include "sdf_2d"
|
|
#pragma include "picking"
|
|
|
|
out vec4 outputColor;
|
|
|
|
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);
|
|
|
|
outputColor = vec4(v_color.rgb, v_color.a);
|
|
|
|
if(u_additive > 0.0) {
|
|
outputColor *= opacity_t;
|
|
} else {
|
|
outputColor.a *= opacity_t;
|
|
}
|
|
|
|
if(outputColor.a > 0.0) {
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
|
|
vec2 extrude = v_extrude;
|
|
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;
|
|
}
|
|
|
|
outputColor.a *= radar_v;
|
|
}
|
|
`,wR=`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(std140) uniform commonUniorm {
|
|
float u_additive;
|
|
float u_size_unit;
|
|
float u_speed: 1.0;
|
|
float u_time;
|
|
};
|
|
|
|
out vec4 v_data;
|
|
out vec4 v_color;
|
|
out float v_radius;
|
|
out vec2 v_extrude;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
float newSize = setPickingSize(a_Size);
|
|
|
|
float time = u_time * u_speed;
|
|
mat2 rotateMatrix = mat2(
|
|
cos(time), sin(time),
|
|
-sin(time), cos(time)
|
|
);
|
|
v_extrude = rotateMatrix * a_Extrude.xy;
|
|
|
|
v_color = a_Color;
|
|
v_color.a *= opacity;
|
|
|
|
float blur = 0.0;
|
|
float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);
|
|
|
|
if(u_size_unit == 1.) {
|
|
newSize = newSize * u_PixelsPerMeter.z;
|
|
}
|
|
v_radius = newSize;
|
|
|
|
vec2 offset = (a_Extrude.xy * (newSize));
|
|
vec3 aPosition = a_Position;
|
|
|
|
offset = project_pixel(offset);
|
|
|
|
v_data = vec4(a_Extrude.x, a_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);
|
|
}
|
|
`,CR=function(e){(0,Fe.Z)(t,e);var r=SR(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.blend,s=i.speed,l=s===void 0?1:s,f=i.unit,d=f===void 0?"pixel":f,_={u_additive:a==="additive"?1:0,u_size_unit:Y0[d],u_speed:l,u_time:this.layer.getLayerAnimateTime()},b=this.getUniformsBufferInfo(_);return b}},{key:"getAnimateUniforms",value:function(){return{}}},{key:"getAttribute",value:function(){return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(),Mg)}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.initUniformsBuffer(),f.next=3,this.layer.buildLayerModel({moduleName:"pointRadar",vertexShader:wR,fragmentShader:TR,triangulation:Mg,inject:this.getInject(),depth:{enable:!1}});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},a,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:In.Attribute,descriptor:{name:"a_Extrude",shaderLocation:Yn.EXTRUDE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a,s,l,f){var d=[1,1,0,-1,1,0,-1,-1,0,1,-1,0],_=f%4*3;return[d[_],d[_+1],d[_+2]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{shaderLocation:Yn.SIZE,name:"a_Size",buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(a){var s=a.size,l=s===void 0?5:s;return Array.isArray(l)?[l[0]]:[l]}}})}}]),t}(Na);function RR(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=MR(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function MR(e,r){if(e){if(typeof e=="string")return H1(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 H1(e,r)}}function H1(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 IR=function(){function e(r,t,n){(0,Q.Z)(this,e),(0,F.Z)(this,"boxCells",[]);var i=this.boxCells;this.xCellCount=Math.ceil(r/n),this.yCellCount=Math.ceil(t/n);for(var a=0;a<this.xCellCount*this.yCellCount;a++)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,a,s){this.forEachCell(n,i,a,s,this.insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(a),this.bboxes.push(s)}},{key:"query",value:function(t,n,i,a,s){return this.queryHitTest(t,n,i,a,!1,s)}},{key:"hitTest",value:function(t,n,i,a,s){return this.queryHitTest(t,n,i,a,!0,s)}},{key:"insertBoxCell",value:function(t,n,i,a,s,l){this.boxCells[s].push(l)}},{key:"queryHitTest",value:function(t,n,i,a,s,l){if(i<0||t>this.width||a<0||n>this.height)return s?!1:[];var f=[];if(t<=0&&n<=0&&this.width<=i&&this.height<=a){if(s)return!0;for(var d=0;d<this.boxKeys.length;d++)f.push({key:this.boxKeys[d],x1:this.bboxes[d*4],y1:this.bboxes[d*4+1],x2:this.bboxes[d*4+2],y2:this.bboxes[d*4+3]});return l?f.filter(l):f}var _={hitTest:s,seenUids:{box:{},circle:{}}};return this.forEachCell(t,n,i,a,this.queryCell,f,_,l),s?f.length>0:f}},{key:"queryCell",value:function(t,n,i,a,s,l,f,d){var _=f.seenUids,b=this.boxCells[s];if(b!==null){var T=this.bboxes,M=RR(b),P;try{for(M.s();!(P=M.n()).done;){var D=P.value;if(!_.box[D]){_.box[D]=!0;var G=D*4;if(t<=T[G+2]&&n<=T[G+3]&&i>=T[G+0]&&a>=T[G+1]&&(!d||d(this.boxKeys[D]))){if(f.hitTest)return l.push(!0),!0;l.push({key:this.boxKeys[D],x1:T[G],y1:T[G+1],x2:T[G+2],y2:T[G+3]})}}}}catch(q){M.e(q)}finally{M.f()}}return!1}},{key:"forEachCell",value:function(t,n,i,a,s,l,f,d){for(var _=this.convertToXCellCoord(t),b=this.convertToYCellCoord(n),T=this.convertToXCellCoord(i),M=this.convertToYCellCoord(a),P=_;P<=T;P++)for(var D=b;D<=M;D++){var G=this.xCellCount*D+P;if(s.call(this,t,n,i,a,G,l,f,d))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}(),PR=IR,OR=function(){function e(r,t){(0,Q.Z)(this,e),(0,F.Z)(this,"viewportPadding",100),this.width=r,this.height=t,this.viewportPadding=Math.max(r,t),this.grid=new PR(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,a=t.x2+t.anchorPointX+this.viewportPadding,s=t.y2+t.anchorPointY+this.viewportPadding;return!this.isInsideGrid(n,i,a,s)||this.grid.hitTest(n,i,a,s)?{box:[]}:{box:[n,i,a,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 a=Bh.al(n,i,0,1),s=Bh.Ue(),l=Ct.fromValues.apply(Ct,(0,Qt.Z)(t));return Bh.fF(s,a,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,a){return i>=0&&t<this.gridRightBoundary&&a>=0&&n<this.gridBottomBoundary}}]),e}();function W1(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function kR(e,r){if(e){if(typeof e=="string")return G1(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 G1(e,r)}}function G1(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 X1(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 $1(e,r,t,n,i){if(i){var a=e[n],s=a.glyph;if(s)for(var l=r[s].advance*a.scale,f=(e[n].x+l)*i,d=t;d<=n;d++)e[d].x-=f}}function Y1(e,r,t,n,i,a,s){var l=(r-t)*i,f=(-n*s+.5)*a,d=W1(e),_;try{for(d.s();!(_=d.n()).done;){var b=_.value;b.x+=l,b.y+=f}}catch(T){d.e(T)}finally{d.f()}}function DR(e,r,t,n,i,a,s){var l=-8,f=0,d=l,_=0,b=e.positionedGlyphs,T=a==="right"?1:a==="left"?0:.5,M=b.length;t.forEach(function(se){if(se.split("").forEach(function(Ve){var nt=r[Ve],st=0;nt&&(b.push({glyph:Ve,x:f,y:d+st,vertical:!1,scale:1,metrics:nt}),f+=nt.advance+s)}),b.length!==M){var Se=f-s;_=Math.max(Se,_),$1(b,r,M,b.length-1,T)}f=0,d-=n+5});var P=X1(i),D=P.horizontalAlign,G=P.verticalAlign;Y1(b,T,D,G,_,n,t.length);var q=d-l;e.top+=-G*q,e.bottom=e.top-q,e.left+=-D*_,e.right=e.left+_}function LR(e,r,t,n,i,a,s){var l=-8,f=0,d=l,_=0,b=e.positionedGlyphs,T=a==="right"?1:a==="left"?0:.5,M=b.length;t.forEach(function(se){var Se=r[se],Ve=0;if(Se&&(b.push({glyph:se,x:Se.advance/2,y:d+Ve,vertical:!1,scale:1,metrics:Se}),f+=Se.advance+s),b.length!==M){var nt=f-s;_=Math.max(nt,_),$1(b,r,M,b.length-1,T)}f=0,d-=n+5});var P=X1(i),D=P.horizontalAlign,G=P.verticalAlign;Y1(b,T,D,G,_,n,t.length);var q=d-l;e.top+=-G*q,e.bottom=e.top-q,e.left+=-D*_,e.right=e.left+_}function BR(e,r,t,n,i,a){var s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:[0,0],l=arguments.length>7?arguments[7]:void 0,f=e.split(`
|
|
`),d=[],_={positionedGlyphs:d,top:s[1],bottom:s[1],left:s[0],right:s[0],lineCount:f.length,text:e};return l?LR(_,r,f,t,n,i,a):DR(_,r,f,t,n,i,a),d.length?_:!1}function FR(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,a=[],s=W1(i),l;try{for(s.s();!(l=s.n()).done;){var f=l.value,d=f.metrics,_=4,b=d.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]],P=(0-_)*f.scale-b+M[0],D=(0-_)*f.scale+M[1],G=P+d.width*f.scale,q=D+d.height*f.scale,se={x:P,y:D},Se={x:G,y:D},Ve={x:P,y:q},nt={x:G,y:q};a.push({tl:se,tr:Se,bl:Ve,br:nt,tex:d,glyphOffset:T})}}catch(st){s.e(st)}finally{s.f()}return a}function NR(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=UR(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function UR(e,r){if(e){if(typeof e=="string")return q1(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 q1(e,r)}}function q1(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 zR(e){var r=ZR();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function ZR(){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 K1=`#define SDF_PX 8.0
|
|
#define EDGE_GAMMA 0.105
|
|
#define FONT_SIZE 48.0
|
|
|
|
uniform sampler2D u_sdf_map;
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
vec2 u_sdf_map_size;
|
|
float u_raisingHeight: 0.0;
|
|
float u_stroke_width : 2;
|
|
float u_gamma_scale : 0.5;
|
|
float u_halo_blur : 0.5;
|
|
};
|
|
|
|
in vec4 v_color;
|
|
in vec4 v_stroke_color;
|
|
in vec2 v_uv;
|
|
in float v_gamma_scale;
|
|
in float v_fontScale;
|
|
out vec4 outputColor;
|
|
|
|
#pragma include "picking"
|
|
void main() {
|
|
// get style data mapping
|
|
|
|
// get sdf from atlas
|
|
float dist = texture(SAMPLER_2D(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);
|
|
|
|
outputColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));
|
|
|
|
outputColor.a *= alpha;
|
|
// \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20
|
|
if (outputColor.a < 0.01) {
|
|
discard;
|
|
}
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,Q1=`#define SDF_PX 8.0
|
|
#define EDGE_GAMMA 0.105
|
|
#define FONT_SIZE 24.0
|
|
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 10) in vec2 a_textOffsets;
|
|
layout(location = 14) in vec2 a_tex;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
|
|
vec2 u_sdf_map_size;
|
|
float u_raisingHeight: 0.0;
|
|
float u_stroke_width : 2;
|
|
float u_gamma_scale : 0.5;
|
|
float u_halo_blur : 0.5;
|
|
};
|
|
|
|
out vec2 v_uv;
|
|
out float v_gamma_scale;
|
|
out vec4 v_color;
|
|
out vec4 v_stroke_color;
|
|
out float v_fontScale;
|
|
|
|
|
|
|
|
#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);
|
|
|
|
}
|
|
`,bm=ui.isEqual;function J1(e){var r=this,t=e.id,n=[],i=[];if(!r.glyphInfoMap||!r.glyphInfoMap[t])return{vertices:[],indices:[],size:7};var a=r.glyphInfoMap[t].centroid,s=a.length===2?[a[0],a[1],0]:a;return r.glyphInfoMap[t].glyphQuads.forEach(function(l,f){n.push.apply(n,(0,Qt.Z)(s).concat([l.tex.x,l.tex.y+l.tex.height,l.tl.x,l.tl.y],(0,Qt.Z)(s),[l.tex.x+l.tex.width,l.tex.y+l.tex.height,l.tr.x,l.tr.y],(0,Qt.Z)(s),[l.tex.x+l.tex.width,l.tex.y,l.br.x,l.br.y],(0,Qt.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 ex=function(e){(0,Fe.Z)(t,e);var r=zR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"glyphInfoMap",{}),(0,F.Z)((0,Me.Z)(n),"currentZoom",-1),(0,F.Z)((0,Me.Z)(n),"textureHeight",0),(0,F.Z)((0,Me.Z)(n),"textCount",0),(0,F.Z)((0,Me.Z)(n),"preTextStyle",{}),(0,F.Z)((0,Me.Z)(n),"mapping",(0,Ft.Z)(_e().mark(function l(){return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return n.initGlyph(),n.updateTexture(),d.next=4,n.reBuildModel();case 4:case"end":return d.stop()}},l)}))),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption),{u_sdf_map:this.textures[0]})}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.stroke,s=a===void 0?"#fff":a,l=i.strokeWidth,f=l===void 0?0:l,d=i.halo,_=d===void 0?.5:d,b=i.gamma,T=b===void 0?2:b,M=i.raisingHeight,P=M===void 0?0:M,D=this.getFontServiceMapping(),G=this.getFontServiceCanvas();D&&Object.keys(D).length!==this.textCount&&G&&(this.updateTexture(),this.textCount=Object.keys(D).length),this.preTextStyle=this.getTextStyle();var q={u_stroke_color:vi(s),u_sdf_map_size:[(G==null?void 0:G.width)||1,(G==null?void 0:G.height)||1],u_raisingHeight:Number(P),u_stroke_width:f,u_gamma_scale:T,u_halo_blur:_},se=this.getUniformsBufferInfo(q);return se}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().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(),this.initUniformsBuffer(),l.abrupt("return",this.buildModels());case 6:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d;return _e().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:Q1,fragmentShader:K1,inject:this.getInject(),triangulation:J1.bind(this),depth:{enable:!1}});case 6:return d=b.sent,b.abrupt("return",[d]);case 8:case"end":return b.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"needUpdate",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b,T,M,P,D,G,q;return _e().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:if(s=this.getTextStyle(),l=s.textAllowOverlap,f=l===void 0?!1:l,d=s.textAnchor,_=d===void 0?"center":d,b=s.textOffset,T=s.padding,M=s.fontFamily,P=s.fontWeight,!(!bm(T,this.preTextStyle.padding)||!bm(b,this.preTextStyle.textOffset)||!bm(_,this.preTextStyle.textAnchor)||!bm(M,this.preTextStyle.fontFamily)||!bm(P,this.preTextStyle.fontWeight))){Se.next=5;break}return Se.next=4,this.mapping();case 4:return Se.abrupt("return",!0);case 5:if(!f){Se.next=7;break}return Se.abrupt("return",!1);case 7:if(D=this.mapService.getZoom(),G=this.mapService.getBounds(),q=ma(this.extent,G),!(Math.abs(this.currentZoom-D)>.5||!q||f!==this.preTextStyle.textAllowOverlap)){Se.next=14;break}return Se.next=13,this.reBuildModel();case 13:return Se.abrupt("return",!0);case 14:return Se.abrupt("return",!1);case 15:case"end":return Se.stop()}},a,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:In.Attribute,descriptor:{shaderLocation:10,name:"a_textOffsets",buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(a,s,l){return[l[5],l[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"textUv",type:In.Attribute,descriptor:{name:"a_tex",shaderLocation:Yn.UV,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(a,s,l){return[l[3],l[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(a){var s=a.size,l=s===void 0?12:s;return Array.isArray(l)?[l[0]]:[l]}}})}},{key:"bindEvent",value:function(){this.layer.isTileLayer||this.layer.on("remapping",this.mapping)}},{key:"textExtent",value:function(){var i=this.mapService.getBounds();return Zu(i,.5)}},{key:"initTextFont",value:function(){var i=this.getTextStyle(),a=i.fontWeight,s=i.fontFamily,l=this.rawEncodeData,f=[];l.forEach(function(d){var _=d.shape,b=_===void 0?"":_;b=b.toString();var T=NR(b),M;try{for(T.s();!(M=T.n()).done;){var P=M.value;f.indexOf(P)===-1&&f.push(P)}}catch(D){T.e(D)}finally{T.f()}}),this.fontService.setFontOptions({characterSet:f,fontWeight:a,fontFamily:s,iconfont:!1})}},{key:"initIconFontTex",value:function(){var i=this.getTextStyle(),a=i.fontWeight,s=i.fontFamily,l=this.rawEncodeData,f=[];l.forEach(function(d){var _=d.shape,b=_===void 0?"":_;b="".concat(b),f.indexOf(b)===-1&&f.push(b)}),this.fontService.setFontOptions({characterSet:f,fontWeight:a,fontFamily:s,iconfont:!0})}},{key:"getTextStyle",value:function(){var i=this.layer.getLayerConfig(),a=i.fontWeight,s=a===void 0?"400":a,l=i.fontFamily,f=l===void 0?"sans-serif":l,d=i.textAllowOverlap,_=d===void 0?!1:d,b=i.padding,T=b===void 0?[0,0]:b,M=i.textAnchor,P=M===void 0?"center":M,D=i.textOffset,G=D===void 0?[0,0]:D,q=i.opacity,se=q===void 0?1:q,Se=i.strokeOpacity,Ve=Se===void 0?1:Se,nt=i.strokeWidth,st=nt===void 0?0:nt,at=i.stroke,At=at===void 0?"#000":at;return{fontWeight:s,fontFamily:f,textAllowOverlap:_,padding:T,textAnchor:P,textOffset:G,opacity:se,strokeOpacity:Ve,strokeWidth:st,stroke:At}}},{key:"generateGlyphLayout",value:function(i){var a=this,s=this.getFontServiceMapping(),l=this.layer.getLayerConfig(),f=l.spacing,d=f===void 0?2:f,_=l.textAnchor,b=_===void 0?"center":_,T=l.textOffset,M=this.rawEncodeData;this.glyphInfo=M.map(function(P){var D=P.shape,G=D===void 0?"":D,q=P.id,se=P.size,Se=se===void 0?1:se,Ve=P.textOffset?P.textOffset:T||[0,0],nt=P.textAnchor?P.textAnchor:b||"center",st=BR(G.toString(),s,Se,nt,"left",d,Ve,i),at=FR(st,Ve,!1);return P.shaping=st,P.glyphQuads=at,P.centroid=Qs(P.coordinates),P.originCentroid=P.version==="GAODE2.x"?Qs(P.originCoordinates):P.originCentroid=P.centroid,a.glyphInfoMap[q]={shaping:st,glyphQuads:at,centroid:Qs(P.coordinates)},P})}},{key:"getFontServiceMapping",value:function(){var i=this.layer.getLayerConfig(),a=i.fontWeight,s=a===void 0?"400":a,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(),a=i.fontWeight,s=a===void 0?"400":a,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,a=this.layer.getLayerConfig(),s=a.padding,l=s===void 0?[0,0]:s,f=a.textAllowOverlap,d=f===void 0?!1:f;if(!d){this.glyphInfoMap={},this.currentZoom=this.mapService.getZoom(),this.extent=this.textExtent();var _=this.rendererService.getViewportSize(),b=_.width,T=_.height,M=new OR(b,T),P=this.glyphInfo.filter(function(D){var G=D.shaping,q=D.id,se=q===void 0?0:q,Se=D.version==="GAODE2.x"?D.originCentroid:D.centroid,Ve=D.size,nt=Ve/16,st=i.mapService.lngLatToContainer(Se),at=M.placeCollisionBox({x1:G.left*nt-l[0],x2:G.right*nt+l[0],y1:G.top*nt-l[1],y2:G.bottom*nt+l[1],anchorPointX:st.x,anchorPointY:st.y}),At=at.box;return At&&At.length?(M.insertCollisionBox(At,se),!0):!1});P.forEach(function(D){i.glyphInfoMap[D.id]=D})}}},{key:"initGlyph",value:function(){var i=this.layer.getLayerConfig(),a=i.iconfont,s=a===void 0?!1:a;s?this.initIconFontTex():this.initTextFont(),this.generateGlyphLayout(s)}},{key:"updateTexture",value:function(){var i=this.rendererService.createTexture2D,a=this.getFontServiceCanvas();this.textureHeight=a.height,this.texture&&this.texture.destroy(),this.texture=i({data:a,mag:I.LINEAR,min:I.LINEAR,width:a.width,height:a.height}),this.textures=[this.texture]}},{key:"reBuildModel",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.filterGlyphs(),f.next=3,this.layer.buildLayerModel({moduleName:"pointText",vertexShader:Q1,fragmentShader:K1,triangulation:J1.bind(this),inject:this.getInject(),depth:{enable:!1}});case 3:s=f.sent,this.layer.models=[s];case 5:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()}]),t}(Na),VR={fillImage:dR,fill:z1,radar:CR,image:Z1,normal:j1,simplePoint:H3,extrude:U1,text:ex,earthFill:tR,earthExtrude:q3},jR=VR;function HR(e,r){var t=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=WR(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(d){throw d},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 a=!0,s=!1,l;return{s:function(){t=t.call(e)},n:function(){var d=t.next();return a=d.done,d},e:function(d){s=!0,l=d},f:function(){try{!a&&t.return!=null&&t.return()}finally{if(s)throw l}}}}function WR(e,r){if(e){if(typeof e=="string")return tx(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 tx(e,r)}}function tx(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 GR(e){var r=XR();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function XR(){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 Og=function(e){(0,Fe.Z)(t,e);var r=GR(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"type","PointLayer"),(0,F.Z)((0,Me.Z)(n),"enableShaderEncodeStyles",["stroke","offsets","opacity","rotation"]),(0,F.Z)((0,Me.Z)(n),"enableDataEncodeStyles",["textOffset","textAnchor"]),(0,F.Z)((0,Me.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,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel&&this.layerModel.clearModels(),this.layerModel=new jR[s](this),f.next=5,this.initLayerModels();case 5:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"rebuildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.buildModels();case 2:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getModelTypeWillEmptyData",value:function(){if(this.shapeOption){var i=this.shapeOption,a=i.field,s=i.values,l=this.getLayerConfig(),f=l.shape2d,d=this.iconService.getIconMap();if(a&&(f==null?void 0:f.indexOf(a))!==-1)return"fill";if(s==="text")return"text";if(s&&s instanceof Array){var _=HR(s),b;try{for(_.s();!(b=_.n()).done;){var T=b.value;if(typeof T=="string"&&d.hasOwnProperty(T))return"image"}}catch(M){_.e(M)}finally{_.f()}}}return"normal"}},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),a={fillImage:{},normal:{blend:"additive"},radar:{},simplePoint:{},fill:{blend:"normal"},extrude:{},image:{},text:{blend:"normal"},tile:{},tileText:{},earthFill:{},earthExtrude:{}};return a[i]}},{key:"getModelType",value:function(){var i=this.getEncodedData(),a=this.getLayerConfig(),s=a.shape2d,l=a.shape3d,f=a.billboard,d=f===void 0?!0:f,_=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"||d===!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":_.hasOwnProperty(T)?"image":"text"}else return this.getModelTypeWillEmptyData()}}]),t}(Rp);function $R(e){var r=YR();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 qR=`layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
in vec4 v_Color;
|
|
#pragma include "picking"
|
|
out vec4 outputColor;
|
|
void main() {
|
|
|
|
// top face
|
|
if(u_topsurface < 1.0) {
|
|
discard;
|
|
}
|
|
|
|
outputColor = v_Color;
|
|
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,KR=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
layout(location = 14) in vec3 a_uvs;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
out vec4 v_Color;
|
|
|
|
#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);
|
|
}
|
|
`,QR=`uniform sampler2D u_texture;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
in vec4 v_Color;
|
|
in vec3 v_uvs;
|
|
in vec2 v_texture_data;
|
|
|
|
|
|
#pragma include "picking"
|
|
|
|
out vec4 outputColor;
|
|
|
|
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;
|
|
outputColor = linearColor;
|
|
} else {
|
|
outputColor = v_Color;
|
|
}
|
|
} else {
|
|
|
|
// top face
|
|
if(u_topsurface < 1.0) {
|
|
discard;
|
|
}
|
|
|
|
outputColor = texture(SAMPLER_2D(u_texture), vec2(topU, topV));
|
|
}
|
|
|
|
|
|
outputColor.a *= opacity;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,JR=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
layout(location = 14) in vec3 a_uvs;
|
|
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
out vec4 v_Color;
|
|
|
|
out vec2 v_texture_data;
|
|
out 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_Color = a_Color;
|
|
v_Color.a *= opacity;
|
|
|
|
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);
|
|
}
|
|
`,eM=`
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
in vec4 v_Color;
|
|
in vec3 v_uvs;
|
|
in vec2 v_texture_data;
|
|
out vec4 outputColor;
|
|
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
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;
|
|
outputColor = linearColor;
|
|
} else {
|
|
// side notuse linear
|
|
outputColor = v_Color;
|
|
}
|
|
} else {
|
|
// top face
|
|
if(u_topsurface < 1.0) {
|
|
discard;
|
|
}
|
|
outputColor = v_Color;
|
|
}
|
|
|
|
outputColor = filterColorAlpha(outputColor, lightWeight);
|
|
}
|
|
`,tM=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
layout(location = 14) in vec3 a_uvs;
|
|
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_sourceColor;
|
|
vec4 u_targetColor;
|
|
float u_linearColor;
|
|
float u_topsurface;
|
|
float u_sidesurface;
|
|
float u_heightfixed; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
out vec2 v_texture_data;
|
|
out vec3 v_uvs;
|
|
out 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 * opacity);
|
|
|
|
setPickingColor(a_PickingColor);
|
|
}
|
|
`,rM=function(e){(0,Fe.Z)(t,e);var r=$R(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.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.heightfixed,s=a===void 0?!1:a,l=i.raisingHeight,f=l===void 0?0:l,d=i.topsurface,_=d===void 0?!0:d,b=i.sidesurface,T=b===void 0?!0:b,M=i.sourceColor,P=i.targetColor,D=0,G=[1,1,1,1],q=[1,1,1,1];M&&P&&(G=vi(M),q=vi(P),D=1);var se={u_sourceColor:G,u_targetColor:q,u_linearColor:D,u_topsurface:Number(_),u_sidesurface:Number(T),u_heightfixed:Number(s),u_raisingHeight:Number(f),u_texture:this.texture};this.texture&&(this.textures=[this.texture]);var Se=this.getUniformsBufferInfo(se);return Se}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().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()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_;return _e().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return s=this.getShaders(),l=s.frag,f=s.vert,d=s.type,this.initUniformsBuffer(),T.next=4,this.layer.buildLayerModel({moduleName:d,vertexShader:f,fragmentShader:l,depth:{enable:!0},inject:this.getInject(),triangulation:X0});case 4:return _=T.sent,T.abrupt("return",[_]);case 6:case"end":return T.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){var i=this.layer.getLayerConfig(),a=i.pickLight,s=i.mapTexture;return s?{frag:QR,vert:JR,type:"polygonExtrudeTexture"}:a?{frag:eM,vert:tM,type:"polygonExtrudePickLight"}:{frag:qR,vert:KR,type:"polygonExtrude"}}},{key:"clearModels",value:function(){var i;(i=this.texture)===null||i===void 0||i.destroy(),this.textures=[]}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getSource().extent,a=i,s=this.layer.coordCenter||this.layer.getSource().center,l=a[2]-a[0],f=a[3]-a[1];if(this.mapService.version==="GAODE2.x"){var d=this.mapService.coordToAMap2RelativeCoordinates([i[0],i[1]],s),_=(0,_n.Z)(d,2),b=_[0],T=_[1],M=this.mapService.coordToAMap2RelativeCoordinates([i[2],i[3]],s),P=(0,_n.Z)(M,2),D=P[0],G=P[1];l=D-b,f=G-T,a=[b,T,D,G]}this.styleAttributeService.registerStyleAttribute({name:"uvs",type:In.Attribute,descriptor:{name:"a_uvs",shaderLocation:Yn.UV,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(se,Se,Ve){var nt=Ve[0],st=Ve[1];return[(nt-a[0])/l,(st-a[1])/f,Ve[4]]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:In.Attribute,descriptor:{name:"a_Normal",shaderLocation:Yn.NORMAL,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(se,Se,Ve,nt,st){return st}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(se){var Se=se.size,Ve=Se===void 0?10:Se;return Array.isArray(Ve)?[Ve[0]]:[Ve]}}})}},{key:"loadTexture",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s=this,l,f,d;return _e().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(l=this.layer.getLayerConfig(),f=l.mapTexture,d=this.rendererService.createTexture2D,this.texture=d({height:0,width:0}),!f){b.next=5;break}return b.abrupt("return",new Promise(function(T,M){var P=new Image;P.crossOrigin="anonymous",P.src=f,P.onload=function(){return s.texture=d({data:P,width:P.width,height:P.height,wrapS:I.CLAMP_TO_EDGE,wrapT:I.CLAMP_TO_EDGE,min:I.LINEAR,mag:I.LINEAR}),T(null)},P.onerror=function(){M(new Error("image load error"))}}));case 5:case"end":return b.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()}]),t}(Na);function nM(e){var r=iM();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 aM=`
|
|
in vec4 v_Color;
|
|
#pragma include "picking"
|
|
out vec4 outputColor;
|
|
void main() {
|
|
|
|
outputColor = v_Color;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,oM=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 9) in float a_Size;
|
|
layout(location = 13) in vec3 a_Normal;
|
|
|
|
out 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);
|
|
|
|
vec4 project_pos = project_position(pos);
|
|
float lightWeight = calc_lighting(project_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);
|
|
}
|
|
`,sM=function(e){(0,Fe.Z)(t,e);var r=nM(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.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i={},a=this.getUniformsBufferInfo(i);return a}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_;return _e().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return s=this.getShaders(),l=s.frag,f=s.vert,d=s.type,this.initUniformsBuffer(),T.next=4,this.layer.buildLayerModel({moduleName:d,vertexShader:f,fragmentShader:l,inject:this.getInject(),triangulation:X0,depth:{enable:!0}});case 4:return _=T.sent,T.abrupt("return",[_]);case 6:case"end":return T.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getShaders",value:function(){return{frag:aM,vert:oM,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:In.Attribute,descriptor:{name:"a_Normal",shaderLocation:Yn.NORMAL,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(a,s,l,f,d){return d}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:In.Attribute,descriptor:{name:"a_Size",shaderLocation:Yn.SIZE,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(a){var s=a.size,l=s===void 0?10:s;return Array.isArray(l)?[l[0]]:[l]}}})}}]),t}(Na);function uM(e){var r=lM();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function lM(){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 cM=`in vec4 v_color;
|
|
#pragma include "picking"
|
|
out vec4 outputColor;
|
|
void main() {
|
|
outputColor = v_color;
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,fM=`
|
|
layout(std140) uniform commonUniforms {
|
|
float u_raisingHeight;
|
|
float u_opacitylinear;
|
|
float u_dir;
|
|
};
|
|
|
|
in vec3 v_linear;
|
|
in vec2 v_pos;
|
|
in vec4 v_color;
|
|
out vec4 outputColor;
|
|
#pragma include "picking"
|
|
|
|
void main() {
|
|
outputColor = v_color;
|
|
if(u_opacitylinear > 0.0) {
|
|
outputColor.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;
|
|
}
|
|
outputColor = filterColor(outputColor);
|
|
}
|
|
`,hM=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 15) in vec3 a_linear;
|
|
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_raisingHeight;
|
|
float u_opacitylinear;
|
|
float u_dir;
|
|
};
|
|
|
|
|
|
out vec4 v_color;
|
|
|
|
#pragma include "projection"
|
|
#pragma include "picking"
|
|
|
|
out vec3 v_linear;
|
|
out 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=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
float u_raisingHeight;
|
|
};
|
|
|
|
|
|
out 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);
|
|
}
|
|
|
|
`,dM=function(e){(0,Fe.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.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.raisingHeight,s=a===void 0?0:a,l=i.opacityLinear,f=l===void 0?{enable:!1,dir:"in"}:l,d={u_raisingHeight:Number(s),u_opacitylinear:Number(f.enable),u_dir:f.dir==="in"?1:0},_=this.getUniformsBufferInfo(d);return _}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b;return _e().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return s=this.getModelParams(),l=s.frag,f=s.vert,d=s.triangulation,_=s.type,this.initUniformsBuffer(),this.layer.triangulation=d,M.next=5,this.layer.buildLayerModel({moduleName:_,vertexShader:f,fragmentShader:l,inject:this.getInject(),triangulation:d,primitive:I.TRIANGLES,depth:{enable:!1}});case 5:return b=M.sent,M.abrupt("return",[b]);case 7:case"end":return M.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getLayerConfig(),a=i.opacityLinear,s=a===void 0?{enable:!1,dir:"in"}:a;s.enable&&this.styleAttributeService.registerStyleAttribute({name:"linear",type:In.Attribute,descriptor:{name:"a_linear",shaderLocation:Yn.LINEAR,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:3,update:function(f,d,_){return[_[3],_[4],_[5]]}}})}},{key:"getModelParams",value:function(){var i=this.layer.getLayerConfig(),a=i.opacityLinear,s=a===void 0?{enable:!1}:a;return s.enable?{frag:fM,vert:hM,type:"polygonLinear",triangulation:Hw}:{frag:cM,vert:pM,type:"polygonFill",triangulation:Mh}}}]),t}(Na);function vM(e){var r=mM();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function mM(){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 gM=`
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_watercolor;
|
|
vec4 u_watercolor2;
|
|
float u_time;
|
|
};
|
|
|
|
in vec2 v_uv;
|
|
in float v_opacity;
|
|
out vec4 outputColor;
|
|
|
|
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 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 texture(SAMPLER_2D(u_texture2),p*vec2(1./256.)).x;
|
|
}
|
|
|
|
vec4 highness(vec2 p) {
|
|
vec4 t = texture(SAMPLER_2D(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)+texture(SAMPLER_2D(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);
|
|
}
|
|
|
|
outputColor = vec4(col, v_opacity);
|
|
}
|
|
`,yM=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 14) in vec2 a_uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec4 u_watercolor;
|
|
vec4 u_watercolor2;
|
|
float u_time;
|
|
};
|
|
|
|
|
|
out vec2 v_uv;
|
|
out float v_opacity;
|
|
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
v_uv = a_uv;
|
|
v_opacity = opacity;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
}
|
|
|
|
`,dF=ui.isNumber,_M=function(e){(0,Fe.Z)(t,e);var r=vM(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.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.watercolor,s=a===void 0?"#6D99A8":a,l=i.watercolor2,f=l===void 0?"#0F121C":l,d={u_watercolor:vi(s),u_watercolor2:vi(f),u_time:this.layer.getLayerAnimateTime(),u_texture1:this.texture1,u_texture2:this.texture2,u_texture3:this.texture3};this.textures=[this.texture1,this.texture2,this.texture3];var _=this.getUniformsBufferInfo(d);return _}},{key:"getAnimateUniforms",value:function(){return{u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().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()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.initUniformsBuffer(),f.next=3,this.layer.buildLayerModel({moduleName:"polygonOcean",vertexShader:yM,fragmentShader:gM,inject:this.getInject(),triangulation:G0,primitive:I.TRIANGLES,depth:{enable:!1}});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i,a,s;(i=this.texture1)===null||i===void 0||i.destroy(),(a=this.texture2)===null||a===void 0||a.destroy(),(s=this.texture3)===null||s===void 0||s.destroy()}},{key:"registerBuiltinAttributes",value:function(){var i=this.layer.getSource().extent,a=(0,_n.Z)(i,4),s=a[0],l=a[1],f=a[2],d=a[3],_=f-s,b=d-l;this.styleAttributeService.registerStyleAttribute({name:"oceanUv",type:In.Attribute,descriptor:{name:"a_uv",shaderLocation:Yn.UV,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(M,P,D,G){var q=M.version==="GAODE2.x"?M.originCoordinates[0][G]:D,se=(0,_n.Z)(q,2),Se=se[0],Ve=se[1];return[(Se-s)/_,(Ve-l)/b]}}})}},{key:"loadTexture",value:function(){var i=this,a=this.rendererService.createTexture2D,s={height:0,width:0};this.texture1=a(s),this.texture2=a(s),this.texture3=a(s),l(function(d){i.texture1=f(d[0]),i.texture2=f(d[1]),i.texture3=f(d[2]),i.layerService.reRender()});function l(d){var _=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 P=new Image;P.crossOrigin="",P.src=M,b.push(P),P.onload=function(){_++,_===3&&d(b)}})}function f(d){return a({data:d,width:d.width,height:d.height,wrapS:I.MIRRORED_REPEAT,wrapT:I.MIRRORED_REPEAT,min:I.LINEAR,mag:I.LINEAR})}}}]),t}(Na);function xM(e){var r=bM();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function bM(){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 EM=`uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniforms {
|
|
float u_speed;
|
|
float u_time;
|
|
};
|
|
|
|
out vec4 outputColor;
|
|
|
|
|
|
in vec4 v_Color;
|
|
in 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 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz;
|
|
p.z += t * 3.; p.x += t * 0.52;
|
|
vec3 c2 = texture(SAMPLER_2D(u_texture), p.xz / 30.).xyz;
|
|
p.z += t * 4.; p.x += t * 0.8;
|
|
vec3 c3 = texture(SAMPLER_2D(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() {
|
|
|
|
outputColor = v_Color;
|
|
float spc = calSpc();
|
|
outputColor += spc * 0.4;
|
|
}
|
|
`,SM=`layout(location = 0) in vec3 a_Position;
|
|
layout(location = 1) in vec4 a_Color;
|
|
layout(location = 14) in vec2 a_uv;
|
|
layout(std140) uniform commonUniforms {
|
|
float u_speed;
|
|
float u_time;
|
|
};
|
|
out vec4 v_Color;
|
|
out vec2 v_uv;
|
|
|
|
|
|
#pragma include "projection"
|
|
|
|
void main() {
|
|
v_uv = a_uv;
|
|
v_Color = a_Color;
|
|
v_Color.a *= opacity;
|
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
|
|
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
}
|
|
|
|
`,vF=ui.isNumber,AM=function(e){(0,Fe.Z)(t,e);var r=xM(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.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.speed,s=a===void 0?.5:a,l={u_speed:s,u_time:this.layer.getLayerAnimateTime(),u_texture:this.texture};this.textures=[this.texture];var f=this.getUniformsBufferInfo(l);return f}},{key:"getAnimateUniforms",value:function(){return{u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().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()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.initUniformsBuffer(),f.next=3,this.layer.buildLayerModel({moduleName:"polygonWater",vertexShader:SM,fragmentShader:EM,triangulation:G0,inject:this.getInject(),primitive:I.TRIANGLES,depth:{enable:!1}});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},a,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,a=(0,_n.Z)(i,4),s=a[0],l=a[1],f=a[2],d=a[3],_=f-s,b=d-l;this.styleAttributeService.registerStyleAttribute({name:"waterUv",type:In.Attribute,descriptor:{name:"a_uv",shaderLocation:Yn.UV,buffer:{usage:I.STATIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(M,P,D,G){var q=M.version==="GAODE2.x"?M.originCoordinates[0][G]:D,se=(0,_n.Z)(q,2),Se=se[0],Ve=se[1];return[(Se-s)/_,(Ve-l)/b]}}})}},{key:"loadTexture",value:function(){var i=this,a=this.layer.getLayerConfig(),s=a.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:I.MIRRORED_REPEAT,wrapT:I.MIRRORED_REPEAT,min:I.LINEAR,mag:I.LINEAR}),i.layerService.reRender()}}}]),t}(Na),TM={fill:dM,line:F1,extrude:rM,text:ex,point_fill:z1,point_image:Z1,point_normal:j1,point_extrude:U1,water:AM,ocean:_M,extrusion:sM},wM=TM;function CM(e){var r=RM();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function RM(){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 kg=function(e){(0,Fe.Z)(t,e);var r=CM(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"type","PolygonLayer"),(0,F.Z)((0,Me.Z)(n),"enableShaderEncodeStyles",["opacity","extrusionBase","rotation","offsets","stroke"]),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel=new wM[s](this),f.next=4,this.initLayerModels();case 4:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getModelType",value:function(){var i,a=this.styleAttributeService.getLayerStyleAttribute("shape"),s=a==null||(i=a.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(),a=this.getLayerConfig(),s=a.shape2d,l=a.shape3d,f=this.iconService.getIconMap(),d=i.find(function(b){return b.hasOwnProperty("shape")});if(d){var _=d.shape;return _==="dot"?"point_normal":(s==null?void 0:s.indexOf(_))!==-1?"point_fill":(l==null?void 0:l.indexOf(_))!==-1?"point_extrude":f.hasOwnProperty(_)?"point_image":"text"}else return"fill"}}]),t}(Rp);function MM(e){var r=IM();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 PM=`layout(std140) uniform commonUniforms {
|
|
vec2 u_domain;
|
|
float u_opacity;
|
|
float u_noDataValue;
|
|
bool u_clampLow;
|
|
bool u_clampHigh;
|
|
};
|
|
|
|
uniform sampler2D u_rasterTexture;
|
|
uniform sampler2D u_colorTexture;
|
|
|
|
in vec2 v_texCoord;
|
|
|
|
bool isnan_emu(float x) { return (x > 0.0 || x < 0.0) ? x != x : x != 0.0; }
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
// Can use any component here since u_rasterTexture is under luminance format.
|
|
float value = texture(SAMPLER_2D(u_rasterTexture), 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 = texture(SAMPLER_2D(u_colorTexture), vec2(normalisedValue, 0));
|
|
|
|
outputColor = color;
|
|
outputColor.a = outputColor.a * u_opacity ;
|
|
if (outputColor.a < 0.01)
|
|
discard;
|
|
}
|
|
}
|
|
`,OM=`
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec2 u_domain;
|
|
float u_opacity;
|
|
float u_noDataValue;
|
|
bool u_clampLow;
|
|
bool u_clampHigh;
|
|
};
|
|
|
|
out 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));
|
|
}
|
|
`,rx=function(e){(0,Fe.Z)(t,e);var r=MM(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.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.opacity,s=a===void 0?1:a,l=i.clampLow,f=l===void 0?!0:l,d=i.clampHigh,_=d===void 0?!0:d,b=i.noDataValue,T=b===void 0?-9999999:b,M=i.domain,P=i.rampColors,D=M||yc(P);this.colorTexture=this.layer.textureService.getColorTexture(P,D);var G={u_domain:D,u_opacity:s||1,u_noDataValue:T,u_clampLow:f,u_clampHigh:typeof _!="undefined"?_:f,u_rasterTexture:this.texture,u_colorTexture:this.colorTexture};this.textures=[this.texture,this.colorTexture];var q=this.getUniformsBufferInfo(G);return q}},{key:"getRasterData",value:function(){var n=(0,Ft.Z)(_e().mark(function a(s){var l,f,d,_;return _e().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,d=l.width,_=l.height,T.abrupt("return",{data:Array.from(f),width:d,height:_});case 11:case"end":return T.stop()}},a)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b,T,M,P,D;return _e().wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return this.initUniformsBuffer(),s=this.layer.getSource(),l=this.rendererService,f=l.createTexture2D,d=l.queryVerdorInfo,_=s.data.dataArray[0],q.next=6,this.getRasterData(_);case 6:return b=q.sent,T=b.data,M=b.width,P=b.height,this.texture=f({data:new Float32Array(T),width:M,height:P,format:d()==="WebGL1"?I.LUMINANCE:I.RED,type:I.FLOAT,alignment:1}),q.next=13,this.layer.buildLayerModel({moduleName:"rasterImageData",vertexShader:OM,fragmentShader:PM,triangulation:Ig,primitive:I.TRIANGLES,depth:{enable:!1}});case 13:return D=q.sent,q.abrupt("return",[D]);case 15:case"end":return q.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"clearModels",value:function(){var i,a;(i=this.texture)===null||i===void 0||i.destroy(),(a=this.colorTexture)===null||a===void 0||a.destroy()}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:In.Attribute,descriptor:{shaderLocation:Yn.UV,name:"a_Uv",buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(a,s,l){return[l[3],l[4]]}}})}}]),t}(Na),kM=["data"],DM=["rasterData"];function LM(e){var r=BM();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function BM(){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 FM=`uniform sampler2D u_texture;
|
|
layout(std140) uniform commonUniforms {
|
|
vec2 u_rminmax;
|
|
vec2 u_gminmax;
|
|
vec2 u_bminmax;
|
|
float u_opacity;
|
|
float u_noDataValue;
|
|
};
|
|
|
|
in vec2 v_texCoord;
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
|
|
vec3 rgb = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y)).rgb;
|
|
|
|
if(rgb == vec3(u_noDataValue)) {
|
|
outputColor = vec4(0.0, 0, 0, 0.0);
|
|
} else {
|
|
outputColor = 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(outputColor.a < 0.01)
|
|
discard;
|
|
|
|
}`,NM=`
|
|
layout(location = 0) in vec3 a_Position;
|
|
layout(location = 14) in vec2 a_Uv;
|
|
|
|
layout(std140) uniform commonUniforms {
|
|
vec2 u_rminmax;
|
|
vec2 u_gminmax;
|
|
vec2 u_bminmax;
|
|
float u_opacity;
|
|
float u_noDataValue;
|
|
};
|
|
|
|
out 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));
|
|
}
|
|
`,UM=function(e){(0,Fe.Z)(t,e);var r=LM(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"dataOption",{}),n}return(0,j.Z)(t,[{key:"getUninforms",value:function(){var i=this.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.opacity,s=a===void 0?1:a,l=i.noDataValue,f=l===void 0?0:l,d=this.dataOption,_=d.rMinMax,b=_===void 0?[0,255]:_,T=d.gMinMax,M=T===void 0?[0,255]:T,P=d.bMinMax,D=P===void 0?[0,255]:P,G={u_rminmax:b,u_gminmax:M,u_bminmax:D,u_opacity:s||1,u_noDataValue:f,u_texture:this.texture};this.textures=[this.texture];var q=this.getUniformsBufferInfo(G);return q}},{key:"getRasterData",value:function(){var n=(0,Ft.Z)(_e().mark(function a(s){var l,f,d,_,b;return _e().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,wa.Z)(s,kM),this.dataOption=f,M.abrupt("return",(0,H.Z)({data:l},f));case 4:return M.next=6,s.data;case 6:if(d=M.sent,_=d.rasterData,b=(0,wa.Z)(d,DM),this.dataOption=b,!Array.isArray(_)){M.next=14;break}return M.abrupt("return",(0,H.Z)({data:_},b));case 14:return M.abrupt("return",(0,H.Z)({data:Array.from(_)},b));case 15:case"end":return M.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b,T,M;return _e().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return this.initUniformsBuffer(),s=this.layer.getSource(),l=this.rendererService.createTexture2D,f=s.data.dataArray[0],D.next=6,this.getRasterData(f);case 6:return d=D.sent,_=d.data,b=d.width,T=d.height,this.texture=l({data:new Float32Array(_),width:b,height:T,format:I.RGB,type:I.FLOAT}),D.next=13,this.layer.buildLayerModel({moduleName:"rasterImageDataRGBA",vertexShader:NM,fragmentShader:FM,triangulation:Ig,primitive:I.TRIANGLES,depth:{enable:!1}});case 13:return M=D.sent,D.abrupt("return",[M]);case 15:case"end":return D.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},a,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:In.Attribute,descriptor:{name:"a_Uv",shaderLocation:Yn.UV,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(a,s,l){return[l[3],l[4]]}}})}}]),t}(Na);function zM(e){var r=ZM();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 VM=`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;
|
|
}
|
|
}
|
|
`,jM=`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));
|
|
}
|
|
`,HM=function(e){(0,Fe.Z)(t,e);var r=zM(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(),a=i.opacity,s=i.clampLow,l=s===void 0?!0:s,f=i.clampHigh,d=f===void 0?!0:f,_=i.noDataValue,b=_===void 0?-9999999:_,T=i.domain,M=i.rampColors,P=i.colorTexture,D=i.rScaler,G=D===void 0?6553.6:D,q=i.gScaler,se=q===void 0?25.6:q,Se=i.bScaler,Ve=Se===void 0?.1:Se,nt=i.offset,st=nt===void 0?1e4:nt,at=T||yc(M),At=P;return P?this.layer.textureService.setColorTexture(P,M,at):At=this.layer.textureService.getColorTexture(M,at),{u_opacity:a||1,u_texture:this.texture,u_domain:at,u_clampLow:l,u_clampHigh:typeof d!="undefined"?d:l,u_noDataValue:b,u_unpack:[G,se,Ve,st],u_colorTexture:At}}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f,d;return _e().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:I.LINEAR,mag:I.LINEAR}),b.next=8,this.layer.buildLayerModel({moduleName:"RasterTileDataImage",vertexShader:jM,fragmentShader:VM,triangulation:Ig,primitive:I.TRIANGLES,depth:{enable:!1}});case 8:return d=b.sent,b.abrupt("return",[d]);case 10:case"end":return b.stop()}},a,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,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.initModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"uv",type:In.Attribute,descriptor:{name:"a_Uv",buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:2,update:function(a,s,l){return[l[3],l[4]]}}})}}]),t}(Na),WM={raster:rx,rasterRgb:UM,raster3d:rx,rasterTerrainRgb:HM},GM=WM;function XM(e){var r=$M();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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 Dg=function(e){(0,Fe.Z)(t,e);var r=XM(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"type","RasterLayer"),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().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()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getDefaultConfig",value:function(){var i=this.getModelType(),a={raster:{},rasterRgb:{},raster3d:{},rasterTerrainRgb:{}};return a[i]}},{key:"getModelType",value:function(){var i=this.layerSource.getParserType();switch(i){case"raster":return"raster";case"rasterRgb":return"rasterRgb";case"rgb":return"rasterRgb";case"image":return"rasterTerrainRgb";default:return"raster"}}}]),t}(Rp);function YM(e){var r=qM();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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=`layout(std140) uniform commonUniorm {
|
|
vec4 u_color;
|
|
float u_opacity;
|
|
};
|
|
|
|
out vec4 outputColor;
|
|
|
|
void main() {
|
|
outputColor = u_color;
|
|
outputColor.a *= u_opacity;
|
|
}
|
|
`,QM=`layout(location = 0) in vec3 a_Position;
|
|
|
|
layout(std140) uniform commonUniorm {
|
|
vec4 u_color;
|
|
float u_opacity;
|
|
};
|
|
|
|
#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));
|
|
}
|
|
}
|
|
|
|
`,JM=function(e){(0,Fe.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.getCommonUniformsInfo(),a=this.getUniformsBufferInfo(this.getStyleAttribute());return this.updateStyleUnifoms(),(0,H.Z)((0,H.Z)({},i.uniformsOption),a.uniformsOption)}},{key:"getCommonUniformsInfo",value:function(){var i=this.layer.getLayerConfig(),a=i.opacity,s=a===void 0?1:a,l=i.color,f=l===void 0?"#000":l,d={u_color:vi(f),u_opacity:s||1},_=this.getUniformsBufferInfo(d);return _}},{key:"initModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.abrupt("return",this.buildModels());case 1:case"end":return l.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return this.initUniformsBuffer(),f.next=3,this.layer.buildLayerModel({moduleName:"mask",vertexShader:QM,fragmentShader:KM,triangulation:G0,depth:{enable:!1},pick:!1});case 3:return s=f.sent,f.abrupt("return",[s]);case 5:case"end":return f.stop()}},a,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}(Na),eI={fill:JM},tI=eI;function rI(e){var r=nI();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function nI(){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 nx=function(e){(0,Fe.Z)(t,e);var r=rI(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"type","MaskLayer"),n}return(0,j.Z)(t,[{key:"buildModels",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=this.getModelType(),this.layerModel=new tI[s](this),f.next=4,this.initLayerModels();case 4:case"end":return f.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getModelType",value:function(){return"fill"}}]),t}(Rp),ix,ax,ox,sx,Lg,ux,lx,iI=ui.cloneDeep,aI=(ix=(0,er.b2)(),ax=(0,er.f3)(Ke.IMapService),ox=(0,er.f3)(Ke.IFontService),ix(sx=(Lg=function(){function e(){(0,Q.Z)(this,e),Di(this,"mapService",ux,this),Di(this,"fontService",lx,this)}return(0,j.Z)(e,[{key:"apply",value:function(t,n){var i=this,a=n.styleAttributeService;t.hooks.init.tapPromise("DataMappingPlugin",(0,Ft.Z)(_e().mark(function s(){return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:t.log(Ds.MappingStart,es.INIT),i.generateMaping(t,{styleAttributeService:a}),t.log(Ds.MappingEnd,es.INIT);case 3:case"end":return f.stop()}},s)}))),t.hooks.beforeRenderData.tapPromise("DataMappingPlugin",function(){var s=(0,Ft.Z)(_e().mark(function l(f){var d;return _e().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(Ds.MappingStart,es.UPDATE),d=i.generateMaping(t,{styleAttributeService:a}),t.log(Ds.MappingEnd,es.UPDATE),b.abrupt("return",d);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=a.getLayerStyleAttributes()||[],f=a.getLayerStyleAttribute("filter"),d=s.data.dataArray;if(!(Array.isArray(d)&&d.length===0)){var _=l.filter(function(M){return M.needRemapping}),b=d;if(f!=null&&f.needRemapping&&f!==null&&f!==void 0&&f.scale&&(b=d.filter(function(M){return i.applyAttributeMapping(f,M)[0]})),_.length){var T=i.mapping(t,_,b,t.getEncodedData());t.setEncodedData(T)}}}})}},{key:"generateMaping",value:function(t,n){var i=this,a=n.styleAttributeService,s=a.getLayerStyleAttributes()||[],l=a.getLayerStyleAttribute("filter"),f=t.getSource().data.dataArray,d=f;l!=null&&l.scale&&(d=f.filter(function(b){return i.applyAttributeMapping(l,b)[0]})),d=t.processData(d);var _=this.mapping(t,s,d,void 0);return t.setEncodedData(_),t.emit("dataUpdate",null),!0}},{key:"mapping",value:function(t,n,i,a){var s=this,l=n.filter(function(d){return d.scale!==void 0}).filter(function(d){return d.name!=="filter"}),f=i.map(function(d,_){var b=a?a[_]:{},T=(0,H.Z)({id:d._id,coordinates:d.coordinates},b);return l.forEach(function(M){var P=s.applyAttributeMapping(M,d);(M.name==="color"||M.name==="stroke")&&(P=P.map(function(D){return vi(D)})),T[M.name]=Array.isArray(P)&&P.length===1?P[0]:P,M.name==="shape"&&(T.shape=s.fontService.getIconFontKey(T[M.name]))}),T});return n.forEach(function(d){d.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 a=n.coordCenter||n.getSource().center;t.filter(function(s){return!s.originCoordinates}).map(function(s){s.version="GAODE2.x",s.originCoordinates=iI(s.coordinates),s.coordinates=i.mapService.coordToAMap2RelativeCoordinates(s.coordinates,a)})}}},{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 a=[];return t.map(function(s){a.push(n.mapService.simpleMapCoord.unproject(s))}),a}}},{key:"applyAttributeMapping",value:function(t,n){var i;if(!t.scale)return[];var a=(t==null||(i=t.scale)===null||i===void 0?void 0:i.scalers)||[],s=[];a.forEach(function(f){var d,_=f.field;(n.hasOwnProperty(_)||((d=t.scale)===null||d===void 0?void 0:d.type)==="variable")&&s.push(n[_])});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]],a=Vu(i),s=[t[0]+a[0]*1e-4,t[1]+a[1]*1e-4];return s}}]),e}(),ux=Pi(Lg.prototype,"mapService",[ax],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lx=Pi(Lg.prototype,"fontService",[ox],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Lg))||sx),cx,fx,oI=(cx=(0,er.b2)(),cx(fx=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(Ke.IMapService),t.hooks.init.tapPromise("DataSourcePlugin",(0,Ft.Z)(_e().mark(function i(){var a,s,l,f;return _e().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(t.log(Ds.SourceInitStart,es.INIT),a=t.getSource(),a||(s=t.sourceOption||t.defaultSourceConfig,l=s.data,f=s.options,a=new $_(l,f),t.setSource(a)),!a.inited){_.next=8;break}n.updateClusterData(t),t.log(Ds.SourceInitEnd,es.INIT),_.next=10;break;case 8:return _.next=10,new Promise(function(b){a.on("update",function(T){T.type==="inited"&&(n.updateClusterData(t),t.log(Ds.SourceInitEnd,es.INIT)),b(null)})});case 10:case"end":return _.stop()}},i)}))),t.hooks.beforeRenderData.tapPromise("DataSourcePlugin",(0,Ft.Z)(_e().mark(function i(){var a,s,l;return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return a=n.updateClusterData(t),s=t.dataState.dataSourceNeedUpdate,t.dataState.dataSourceNeedUpdate=!1,l=a||s,d.abrupt("return",l);case 5:case"end":return d.stop()}},i)})))}},{key:"updateClusterData",value:function(t){if(t.isTileLayer||t.tileLayer||!t.getSource())return!1;var n=t.getSource(),i=n.cluster,a=n.clusterOptions.zoom,s=a===void 0?0:a,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}())||fx);function K0(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}function hx(e){return e.length===1&&(e=sI(e)),{left:function(r,t,n,i){for(n==null&&(n=0),i==null&&(i=r.length);n<i;){var a=n+i>>>1;e(r[a],t)<0?n=a+1:i=a}return n},right:function(r,t,n,i){for(n==null&&(n=0),i==null&&(i=r.length);n<i;){var a=n+i>>>1;e(r[a],t)>0?i=a:n=a+1}return n}}}function sI(e){return function(r,t){return K0(e(r),t)}}var px=hx(K0),uI=px.right,mF=px.left,Bg=uI;function dx(e,r){var t=e.length,n=-1,i,a,s;if(r==null){for(;++n<t;)if((i=e[n])!=null&&i>=i)for(a=s=i;++n<t;)(i=e[n])!=null&&(a>i&&(a=i),s<i&&(s=i))}else for(;++n<t;)if((i=r(e[n],n,e))!=null&&i>=i)for(a=s=i;++n<t;)(i=r(e[n],n,e))!=null&&(a>i&&(a=i),s<i&&(s=i));return[a,s]}var vx=Array.prototype,gF=vx.slice,yF=vx.map,Q0=Math.sqrt(50),J0=Math.sqrt(10),ey=Math.sqrt(2);function mx(e,r,t){var n,i=-1,a,s,l;if(r=+r,e=+e,t=+t,e===r&&t>0)return[e];if((n=r<e)&&(a=e,e=r,r=a),(l=Fg(e,r,t))===0||!isFinite(l))return[];if(l>0)for(e=Math.ceil(e/l),r=Math.floor(r/l),s=new Array(a=Math.ceil(r-e+1));++i<a;)s[i]=(e+i)*l;else for(e=Math.floor(e*l),r=Math.ceil(r*l),s=new Array(a=Math.ceil(e-r+1));++i<a;)s[i]=(e-i)/l;return n&&s.reverse(),s}function Fg(e,r,t){var n=(r-e)/Math.max(0,t),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=Q0?10:a>=J0?5:a>=ey?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=Q0?10:a>=J0?5:a>=ey?2:1)}function ty(e,r,t){var n=Math.abs(r-e)/Math.max(0,t),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=Q0?i*=10:a>=J0?i*=5:a>=ey&&(i*=2),r<e?-i:i}function _F(){var e=identity,r=extent,t=sturges;function n(i){var a,s=i.length,l,f=new Array(s);for(a=0;a<s;++a)f[a]=e(i[a],a,i);var d=r(f),_=d[0],b=d[1],T=t(f,_,b);Array.isArray(T)||(T=tickStep(_,b,T),T=range(Math.ceil(_/T)*T,b,T));for(var M=T.length;T[0]<=_;)T.shift(),--M;for(;T[M-1]>b;)T.pop(),--M;var P=new Array(M+1),D;for(a=0;a<=M;++a)D=P[a]=[],D.x0=a>0?T[a-1]:_,D.x1=a<M?T[a]:b;for(a=0;a<s;++a)l=f[a],_<=l&&l<=b&&P[bisect(T,l,0,M)].push(i[a]);return P}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 xF(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 lI(e){return e===null?NaN:+e}function cI(e,r,t){if(t==null&&(t=lI),!!(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,a=Math.floor(i),s=+t(e[a],a,e),l=+t(e[a+1],a+1,e);return s+(l-s)*(i-a)}}function gx(e,r,t,n,i){var a=e*e,s=a*e;return((1-3*e+3*a-s)*r+(4-6*a+3*s)*t+(1+3*e+3*a-3*s)*n+s*i)/6}function fI(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],a=e[n+1],s=n>0?e[n-1]:2*i-a,l=n<r-1?e[n+2]:2*a-i;return gx((t-n/r)*r,s,i,a,l)}}function hI(e){var r=e.length;return function(t){var n=Math.floor(((t%=1)<0?++t:t)*r),i=e[(n+r-1)%r],a=e[n%r],s=e[(n+1)%r],l=e[(n+2)%r];return gx((t-n/r)*r,i,a,s,l)}}function ry(e){return function(){return e}}function yx(e,r){return function(t){return e+t*r}}function pI(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 bF(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 dI(e){return(e=+e)==1?_x:function(r,t){return t-r?pI(r,t,e):ry(isNaN(r)?t:r)}}function _x(e,r){var t=r-e;return t?yx(e,t):ry(isNaN(e)?r:e)}var xx=function e(r){var t=dI(r);function n(i,a){var s=t((i=(0,vs.B8)(i)).r,(a=(0,vs.B8)(a)).r),l=t(i.g,a.g),f=t(i.b,a.b),d=_x(i.opacity,a.opacity);return function(_){return i.r=s(_),i.g=l(_),i.b=f(_),i.opacity=d(_),i+""}}return n.gamma=e,n}(1);function bx(e){return function(r){var t=r.length,n=new Array(t),i=new Array(t),a=new Array(t),s,l;for(s=0;s<t;++s)l=(0,vs.B8)(r[s]),n[s]=l.r||0,i[s]=l.g||0,a[s]=l.b||0;return n=e(n),i=e(i),a=e(a),l.opacity=1,function(f){return l.r=n(f),l.g=i(f),l.b=a(f),l+""}}}var vI=bx(fI),EF=bx(hI),Gc="$";function Ng(){}Ng.prototype=Ex.prototype={constructor:Ng,has:function(e){return Gc+e in this},get:function(e){return this[Gc+e]},set:function(e,r){return this[Gc+e]=r,this},remove:function(e){var r=Gc+e;return r in this&&delete this[r]},clear:function(){for(var e in this)e[0]===Gc&&delete this[e]},keys:function(){var e=[];for(var r in this)r[0]===Gc&&e.push(r.slice(1));return e},values:function(){var e=[];for(var r in this)r[0]===Gc&&e.push(this[r]);return e},entries:function(){var e=[];for(var r in this)r[0]===Gc&&e.push({key:r.slice(1),value:this[r]});return e},size:function(){var e=0;for(var r in this)r[0]===Gc&&++e;return e},empty:function(){for(var e in this)if(e[0]===Gc)return!1;return!0},each:function(e){for(var r in this)r[0]===Gc&&e(this[r],r.slice(1),this)}};function Ex(e,r){var t=new Ng;if(e instanceof Ng)e.each(function(l,f){t.set(f,l)});else if(Array.isArray(e)){var n=-1,i=e.length,a;if(r==null)for(;++n<i;)t.set(n,e[n]);else for(;++n<i;)t.set(r(a=e[n],n,e),a)}else if(e)for(var s in e)t.set(s,e[s]);return t}var ny=Ex;function SF(){var e=[],r=[],t,n,i;function a(l,f,d,_){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++],P,D,G=map(),q,se=d();++b<T;)(q=G.get(P=M(D=l[b])+""))?q.push(D):G.set(P,[D]);return G.each(function(Se,Ve){_(se,Ve,a(Se,f,d,_))}),se}function s(l,f){if(++f>e.length)return l;var d,_=r[f-1];return n!=null&&f>=e.length?d=l.entries():(d=[],l.each(function(b,T){d.push({key:T,values:s(b,f)})})),_!=null?d.sort(function(b,T){return _(b.key,T.key)}):d}return i={object:function(l){return a(l,0,mI,gI)},map:function(l){return a(l,0,Sx,Ax)},entries:function(l){return s(a(l,0,Sx,Ax),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 mI(){return{}}function gI(e,r,t){e[r]=t}function Sx(){return map()}function Ax(e,r,t){e.set(r,t)}function Ug(){}var bd=ny.prototype;Ug.prototype=yI.prototype={constructor:Ug,has:bd.has,add:function(e){return e+="",this[Gc+e]=e,this},remove:bd.remove,clear:bd.clear,values:bd.keys,size:bd.size,empty:bd.empty,each:bd.each};function yI(e,r){var t=new Ug;if(e instanceof Ug)e.each(function(a){t.add(a)});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 AF=null,Tx=Array.prototype,Cx=Tx.map,Ed=Tx.slice;function Pp(e,r){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(r).domain(e);break}return this}function Rx(e,r){switch(arguments.length){case 0:break;case 1:this.interpolator(e);break;default:this.interpolator(r).domain(e);break}return this}var Mx={name:"implicit"};function zg(){var e=ny(),r=[],t=[],n=Mx;function i(a){var s=a+"",l=e.get(s);if(!l){if(n!==Mx)return n;e.set(s,l=r.push(a))}return t[(l-1)%t.length]}return i.domain=function(a){if(!arguments.length)return r.slice();r=[],e=ny();for(var s=-1,l=a.length,f,d;++s<l;)e.has(d=(f=a[s])+"")||e.set(d,r.push(f));return i},i.range=function(a){return arguments.length?(t=Ed.call(a),i):t.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return zg(r,t).unknown(n)},Pp.apply(i,arguments),i}function Ix(){var e=ordinal().unknown(void 0),r=e.domain,t=e.range,n=[0,1],i,a,s=!1,l=0,f=0,d=.5;delete e.unknown;function _(){var b=r().length,T=n[1]<n[0],M=n[T-0],P=n[1-T];i=(P-M)/Math.max(1,b-l+f*2),s&&(i=Math.floor(i)),M+=(P-M-i*(b-l))*d,a=i*(1-l),s&&(M=Math.round(M),a=Math.round(a));var D=sequence(b).map(function(G){return M+i*G});return t(T?D.reverse():D)}return e.domain=function(b){return arguments.length?(r(b),_()):r()},e.range=function(b){return arguments.length?(n=[+b[0],+b[1]],_()):n.slice()},e.rangeRound=function(b){return n=[+b[0],+b[1]],s=!0,_()},e.bandwidth=function(){return a},e.step=function(){return i},e.round=function(b){return arguments.length?(s=!!b,_()):s},e.padding=function(b){return arguments.length?(l=Math.min(1,f=+b),_()):l},e.paddingInner=function(b){return arguments.length?(l=Math.min(1,b),_()):l},e.paddingOuter=function(b){return arguments.length?(f=+b,_()):f},e.align=function(b){return arguments.length?(d=Math.max(0,Math.min(1,b)),_()):d},e.copy=function(){return Ix(r(),n).round(s).paddingInner(l).paddingOuter(f).align(d)},initRange.apply(_(),arguments)}function Px(e){var r=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Px(r())},e}function TF(){return Px(Ix.apply(null,arguments).paddingInner(1))}function wF(e,r){return(isNumberArray(r)?numberArray:Ox)(e,r)}function Ox(e,r){var t=r?r.length:0,n=e?Math.min(t,e.length):0,i=new Array(n),a=new Array(t),s;for(s=0;s<n;++s)i[s]=oy(e[s],r[s]);for(;s<t;++s)a[s]=r[s];return function(l){for(s=0;s<n;++s)a[s]=i[s](l);return a}}function _I(e,r){var t=new Date;return e=+e,r=+r,function(n){return t.setTime(e*(1-n)+r*n),t}}function Zg(e,r){return e=+e,r=+r,function(t){return e*(1-t)+r*t}}function xI(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]=oy(e[i],r[i]):n[i]=r[i];return function(a){for(i in t)n[i]=t[i](a);return n}}var iy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ay=new RegExp(iy.source,"g");function bI(e){return function(){return e}}function EI(e){return function(r){return e(r)+""}}function SI(e,r){var t=iy.lastIndex=ay.lastIndex=0,n,i,a,s=-1,l=[],f=[];for(e=e+"",r=r+"";(n=iy.exec(e))&&(i=ay.exec(r));)(a=i.index)>t&&(a=r.slice(t,a),l[s]?l[s]+=a:l[++s]=a),(n=n[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,f.push({i:s,x:Zg(n,i)})),t=ay.lastIndex;return t<r.length&&(a=r.slice(t),l[s]?l[s]+=a:l[++s]=a),l.length<2?f[0]?EI(f[0].x):bI(r):(r=f.length,function(d){for(var _=0,b;_<r;++_)l[(b=f[_]).i]=b.x(d);return l.join("")})}function AI(e,r){r||(r=[]);var t=e?Math.min(r.length,e.length):0,n=r.slice(),i;return function(a){for(i=0;i<t;++i)n[i]=e[i]*(1-a)+r[i]*a;return n}}function TI(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function oy(e,r){var t=typeof r,n;return r==null||t==="boolean"?ry(r):(t==="number"?Zg:t==="string"?(n=(0,vs.ZP)(r))?(r=n,xx):SI:r instanceof vs.ZP?xx:r instanceof Date?_I:TI(r)?AI:Array.isArray(r)?Ox:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?xI:Zg)(e,r)}function wI(e,r){return e=+e,r=+r,function(t){return Math.round(e*(1-t)+r*t)}}function CI(e){return function(){return e}}function RI(e){return+e}var kx=[0,1];function Ku(e){return e}function sy(e,r){return(r-=e=+e)?function(t){return(t-e)/r}:CI(isNaN(r)?NaN:.5)}function Dx(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 MI(e,r,t){var n=e[0],i=e[1],a=r[0],s=r[1];return i<n?(n=sy(i,n),a=t(s,a)):(n=sy(n,i),a=t(a,s)),function(l){return a(n(l))}}function II(e,r,t){var n=Math.min(e.length,r.length)-1,i=new Array(n),a=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<n;)i[s]=sy(e[s],e[s+1]),a[s]=t(r[s],r[s+1]);return function(l){var f=Bg(e,l,1,n)-1;return a[f](i[f](l))}}function Vg(e,r){return r.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function uy(){var e=kx,r=kx,t=oy,n,i,a,s=Ku,l,f,d;function _(){return l=Math.min(e.length,r.length)>2?II:MI,f=d=null,b}function b(T){return isNaN(T=+T)?a:(f||(f=l(e.map(n),r,t)))(n(s(T)))}return b.invert=function(T){return s(i((d||(d=l(r,e.map(n),Zg)))(T)))},b.domain=function(T){return arguments.length?(e=Cx.call(T,RI),s===Ku||(s=Dx(e)),_()):e.slice()},b.range=function(T){return arguments.length?(r=Ed.call(T),_()):r.slice()},b.rangeRound=function(T){return r=Ed.call(T),t=wI,_()},b.clamp=function(T){return arguments.length?(s=T?Dx(e):Ku,b):s!==Ku},b.interpolate=function(T){return arguments.length?(t=T,_()):t},b.unknown=function(T){return arguments.length?(a=T,b):a},function(T,M){return n=T,i=M,_()}}function Lx(e,r){return uy()(e,r)}var PI=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function jg(e){if(!(r=PI.exec(e)))throw new Error("invalid format: "+e);var r;return new ly({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]})}jg.prototype=ly.prototype;function ly(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+""}ly.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 OI(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Hg(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 mv(e){return e=Hg(Math.abs(e)),e?e[1]:NaN}function kI(e,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(mv(r)/3)))*3-mv(Math.abs(e)))}function DI(e,r){return function(t,n){for(var i=t.length,a=[],s=0,l=e[0],f=0;i>0&&l>0&&(f+l+1>n&&(l=Math.max(1,n-f)),a.push(t.substring(i-=l,i+l)),!((f+=l+1)>n));)l=e[s=(s+1)%e.length];return a.reverse().join(r)}}function LI(e){return function(r){return r.replace(/[0-9]/g,function(t){return e[+t]})}}function BI(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 Bx;function FI(e,r){var t=Hg(e,r);if(!t)return e+"";var n=t[0],i=t[1],a=i-(Bx=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Hg(e,Math.max(0,r+a-1))[0]}function Fx(e,r){var t=Hg(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 Nx={"%":function(e,r){return(e*100).toFixed(r)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:OI,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 Fx(e*100,r)},r:Fx,s:FI,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function Ux(e){return e}var zx=Array.prototype.map,Zx=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function NI(e){var r=e.grouping===void 0||e.thousands===void 0?Ux:DI(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+"",a=e.numerals===void 0?Ux:LI(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 d(b){b=jg(b);var T=b.fill,M=b.align,P=b.sign,D=b.symbol,G=b.zero,q=b.width,se=b.comma,Se=b.precision,Ve=b.trim,nt=b.type;nt==="n"?(se=!0,nt="g"):Nx[nt]||(Se===void 0&&(Se=12),Ve=!0,nt="g"),(G||T==="0"&&M==="=")&&(G=!0,T="0",M="=");var st=D==="$"?t:D==="#"&&/[boxX]/.test(nt)?"0"+nt.toLowerCase():"",at=D==="$"?n:/[%p]/.test(nt)?s:"",At=Nx[nt],Wt=/[defgprs%]/.test(nt);Se=Se===void 0?6:/[gprs]/.test(nt)?Math.max(1,Math.min(21,Se)):Math.max(0,Math.min(20,Se));function Sr(_r){var Gr=st,Cn=at,wi,la,co;if(nt==="c")Cn=At(_r)+Cn,_r="";else{_r=+_r;var Yo=_r<0||1/_r<0;if(_r=isNaN(_r)?f:At(Math.abs(_r),Se),Ve&&(_r=BI(_r)),Yo&&+_r==0&&P!=="+"&&(Yo=!1),Gr=(Yo?P==="("?P:l:P==="-"||P==="("?"":P)+Gr,Cn=(nt==="s"?Zx[8+Bx/3]:"")+Cn+(Yo&&P==="("?")":""),Wt){for(wi=-1,la=_r.length;++wi<la;)if(co=_r.charCodeAt(wi),48>co||co>57){Cn=(co===46?i+_r.slice(wi+1):_r.slice(wi))+Cn,_r=_r.slice(0,wi);break}}}se&&!G&&(_r=r(_r,1/0));var Uo=Gr.length+_r.length+Cn.length,qs=Uo<q?new Array(q-Uo+1).join(T):"";switch(se&&G&&(_r=r(qs+_r,qs.length?q-Cn.length:1/0),qs=""),M){case"<":_r=Gr+_r+Cn+qs;break;case"=":_r=Gr+qs+_r+Cn;break;case"^":_r=qs.slice(0,Uo=qs.length>>1)+Gr+_r+Cn+qs.slice(Uo);break;default:_r=qs+Gr+_r+Cn;break}return a(_r)}return Sr.toString=function(){return b+""},Sr}function _(b,T){var M=d((b=jg(b),b.type="f",b)),P=Math.max(-8,Math.min(8,Math.floor(mv(T)/3)))*3,D=Math.pow(10,-P),G=Zx[8+P/3];return function(q){return M(D*q)+G}}return{format:d,formatPrefix:_}}var Wg,cy,Vx;UI({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function UI(e){return Wg=NI(e),cy=Wg.format,Vx=Wg.formatPrefix,Wg}function zI(e,r){return e=Math.abs(e),r=Math.abs(r)-e,Math.max(0,mv(r)-mv(e))+1}function ZI(e){return Math.max(0,-mv(Math.abs(e)))}function VI(e,r,t,n){var i=ty(e,r,t),a;switch(n=jg(n==null?",f":n),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(r));return n.precision==null&&!isNaN(a=kI(i,s))&&(n.precision=a),Vx(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=zI(i,Math.max(Math.abs(e),Math.abs(r))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=ZI(i))&&(n.precision=a-(n.type==="%")*2);break}}return cy(n)}function Em(e){var r=e.domain;return e.ticks=function(t){var n=r();return mx(n[0],n[n.length-1],t==null?10:t)},e.tickFormat=function(t,n){var i=r();return VI(i[0],i[i.length-1],t==null?10:t,n)},e.nice=function(t){t==null&&(t=10);var n=r(),i=0,a=n.length-1,s=n[i],l=n[a],f;return l<s&&(f=s,s=l,l=f,f=i,i=a,a=f),f=Fg(s,l,t),f>0?(s=Math.floor(s/f)*f,l=Math.ceil(l/f)*f,f=Fg(s,l,t)):f<0&&(s=Math.ceil(s*f)/f,l=Math.floor(l*f)/f,f=Fg(s,l,t)),f>0?(n[i]=Math.floor(s/f)*f,n[a]=Math.ceil(l/f)*f,r(n)):f<0&&(n[i]=Math.ceil(s*f)/f,n[a]=Math.floor(l*f)/f,r(n)),e},e}function jx(){var e=Lx(Ku,Ku);return e.copy=function(){return Vg(e,jx())},Pp.apply(e,arguments),Em(e)}function jI(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 jI(e).unknown(r)},e=arguments.length?map.call(e,number):[0,1],linearish(t)}function Hx(e,r){e=e.slice();var t=0,n=e.length-1,i=e[t],a=e[n],s;return a<i&&(s=t,t=n,n=s,s=i,i=a,a=s),e[t]=r.floor(i),e[n]=r.ceil(a),e}function Wx(e){return Math.log(e)}function Gx(e){return Math.exp(e)}function HI(e){return-Math.log(-e)}function WI(e){return-Math.exp(-e)}function GI(e){return isFinite(e)?+("1e"+e):e<0?0:e}function XI(e){return e===10?GI:e===Math.E?Math.exp:function(r){return Math.pow(e,r)}}function $I(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 Xx(e){return function(r){return-e(-r)}}function YI(e){var r=e(Wx,Gx),t=r.domain,n=10,i,a;function s(){return i=$I(n),a=XI(n),t()[0]<0?(i=Xx(i),a=Xx(a),e(HI,WI)):e(Wx,Gx),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(),d=f[0],_=f[f.length-1],b;(b=_<d)&&(T=d,d=_,_=T);var T=i(d),M=i(_),P,D,G,q=l==null?10:+l,se=[];if(!(n%1)&&M-T<q){if(T=Math.round(T)-1,M=Math.round(M)+1,d>0){for(;T<M;++T)for(D=1,P=a(T);D<n;++D)if(G=P*D,!(G<d)){if(G>_)break;se.push(G)}}else for(;T<M;++T)for(D=n-1,P=a(T);D>=1;--D)if(G=P*D,!(G<d)){if(G>_)break;se.push(G)}}else se=mx(T,M,Math.min(M-T,q)).map(a);return b?se.reverse():se},r.tickFormat=function(l,f){if(f==null&&(f=n===10?".0e":","),typeof f!="function"&&(f=cy(f)),l===1/0)return f;l==null&&(l=10);var d=Math.max(1,n*l/r.ticks().length);return function(_){var b=_/a(Math.round(i(_)));return b*n<n-.5&&(b*=n),b<=d?f(_):""}},r.nice=function(){return t(Hx(t(),{floor:function(l){return a(Math.floor(i(l)))},ceil:function(l){return a(Math.ceil(i(l)))}}))},r}function $x(){var e=YI(uy()).domain([1,10]);return e.copy=function(){return Vg(e,$x()).base(e.base())},Pp.apply(e,arguments),e}function Yx(e){return function(r){return Math.sign(r)*Math.log1p(Math.abs(r/e))}}function qx(e){return function(r){return Math.sign(r)*Math.expm1(Math.abs(r))*e}}function qI(e){var r=1,t=e(Yx(r),qx(r));return t.constant=function(n){return arguments.length?e(Yx(r=+n),qx(r)):r},linearish(t)}function KI(){var e=qI(transformer());return e.copy=function(){return copy(e,KI()).constant(e.constant())},initRange.apply(e,arguments)}function Kx(e){return function(r){return r<0?-Math.pow(-r,e):Math.pow(r,e)}}function QI(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function JI(e){return e<0?-e*e:e*e}function eP(e){var r=e(Ku,Ku),t=1;function n(){return t===1?e(Ku,Ku):t===.5?e(QI,JI):e(Kx(t),Kx(1/t))}return r.exponent=function(i){return arguments.length?(t=+i,n()):t},Em(r)}function fy(){var e=eP(uy());return e.copy=function(){return Vg(e,fy()).exponent(e.exponent())},Pp.apply(e,arguments),e}function CF(){return fy.apply(null,arguments).exponent(.5)}function Qx(){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]=cI(e,s/l);return a}function a(s){return isNaN(s=+s)?n:r[Bg(t,s)]}return a.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]]},a.domain=function(s){if(!arguments.length)return e.slice();e=[];for(var l=0,f=s.length,d;l<f;++l)d=s[l],d!=null&&!isNaN(d=+d)&&e.push(d);return e.sort(K0),i()},a.range=function(s){return arguments.length?(r=Ed.call(s),i()):r.slice()},a.unknown=function(s){return arguments.length?(n=s,a):n},a.quantiles=function(){return t.slice()},a.copy=function(){return Qx().domain(e).range(r).unknown(n)},Pp.apply(a,arguments)}function Jx(){var e=0,r=1,t=1,n=[.5],i=[0,1],a;function s(f){return f<=f?i[Bg(n,f,0,t)]:a}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=Ed.call(f)).length-1,l()):i.slice()},s.invertExtent=function(f){var d=i.indexOf(f);return d<0?[NaN,NaN]:d<1?[e,n[0]]:d>=t?[n[t-1],r]:[n[d-1],n[d]]},s.unknown=function(f){return arguments.length&&(a=f),s},s.thresholds=function(){return n.slice()},s.copy=function(){return Jx().domain([e,r]).range(i).unknown(a)},Pp.apply(Em(s),arguments)}function eb(){var e=[.5],r=[0,1],t,n=1;function i(a){return a<=a?r[Bg(e,a,0,n)]:t}return i.domain=function(a){return arguments.length?(e=Ed.call(a),n=Math.min(e.length,r.length-1),i):e.slice()},i.range=function(a){return arguments.length?(r=Ed.call(a),n=Math.min(e.length,r.length-1),i):r.slice()},i.invertExtent=function(a){var s=r.indexOf(a);return[e[s-1],e[s]]},i.unknown=function(a){return arguments.length?(t=a,i):t},i.copy=function(){return eb().domain(e).range(r).unknown(t)},Pp.apply(i,arguments)}var hy=new Date,py=new Date;function yl(e,r,t,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=function(a){return e(a=new Date(+a)),a},i.ceil=function(a){return e(a=new Date(a-1)),r(a,1),e(a),a},i.round=function(a){var s=i(a),l=i.ceil(a);return a-s<l-a?s:l},i.offset=function(a,s){return r(a=new Date(+a),s==null?1:Math.floor(s)),a},i.range=function(a,s,l){var f=[],d;if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<s)||!(l>0))return f;do f.push(d=new Date(+a)),r(a,l),e(a);while(d<a&&a<s);return f},i.filter=function(a){return yl(function(s){if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},function(s,l){if(s>=s)if(l<0)for(;++l<=0;)for(;r(s,-1),!a(s););else for(;--l>=0;)for(;r(s,1),!a(s););})},t&&(i.count=function(a,s){return hy.setTime(+a),py.setTime(+s),e(hy),e(py),Math.floor(t(hy,py))},i.every=function(a){return a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?function(s){return n(s)%a===0}:function(s){return i.count(0,s)%a===0}):i}),i}var dy=yl(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()});dy.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:yl(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 gv=dy,RF=dy.range,tb=yl(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()}),tP=tb,MF=tb.range,Gg=1e3,Sm=6e4,rb=36e5,nb=864e5,ib=6048e5;function Sd(e){return yl(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())*Sm)/ib})}var vy=Sd(0),Xg=Sd(1),rP=Sd(2),nP=Sd(3),yv=Sd(4),iP=Sd(5),aP=Sd(6),IF=vy.range,PF=Xg.range,OF=rP.range,kF=nP.range,DF=yv.range,LF=iP.range,BF=aP.range,ab=yl(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())*Sm)/nb},function(e){return e.getDate()-1}),gy=ab,FF=ab.range,ob=yl(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Gg-e.getMinutes()*Sm)},function(e,r){e.setTime(+e+r*rb)},function(e,r){return(r-e)/rb},function(e){return e.getHours()}),oP=ob,NF=ob.range,sb=yl(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Gg)},function(e,r){e.setTime(+e+r*Sm)},function(e,r){return(r-e)/Sm},function(e){return e.getMinutes()}),sP=sb,UF=sb.range,ub=yl(function(e){e.setTime(e-e.getMilliseconds())},function(e,r){e.setTime(+e+r*Gg)},function(e,r){return(r-e)/Gg},function(e){return e.getUTCSeconds()}),uP=ub,zF=ub.range,$g=yl(function(){},function(e,r){e.setTime(+e+r)},function(e,r){return r-e});$g.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?yl(function(r){r.setTime(Math.floor(r/e)*e)},function(r,t){r.setTime(+r+t*e)},function(r,t){return(t-r)/e}):$g};var lP=$g,ZF=$g.range;function Ad(e){return yl(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)/ib})}var lb=Ad(0),Yg=Ad(1),cP=Ad(2),fP=Ad(3),_v=Ad(4),hP=Ad(5),pP=Ad(6),VF=lb.range,jF=Yg.range,HF=cP.range,WF=fP.range,GF=_v.range,XF=hP.range,$F=pP.range,cb=yl(function(e){e.setUTCHours(0,0,0,0)},function(e,r){e.setUTCDate(e.getUTCDate()+r)},function(e,r){return(r-e)/nb},function(e){return e.getUTCDate()-1}),fb=cb,YF=cb.range,yy=yl(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()});yy.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:yl(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 Am=yy,qF=yy.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 xy(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 Tm(e,r,t){return{y:e,m:r,d:t,H:0,M:0,S:0,L:0}}function dP(e){var r=e.dateTime,t=e.date,n=e.time,i=e.periods,a=e.days,s=e.shortDays,l=e.months,f=e.shortMonths,d=wm(i),_=Cm(i),b=wm(a),T=Cm(a),M=wm(s),P=Cm(s),D=wm(l),G=Cm(l),q=wm(f),se=Cm(f),Se={a:Yo,A:Uo,b:qs,B:bl,c:null,d:gb,e:gb,f:FP,g:XP,G:YP,H:DP,I:LP,j:BP,L:yb,m:NP,M:UP,p:AB,q:TB,Q:Ab,s:Tb,S:zP,u:ZP,U:VP,V:jP,w:HP,W:WP,x:null,X:null,y:GP,Y:$P,Z:qP,"%":Sb},Ve={a:wB,A:CB,b:RB,B:MB,c:null,d:xb,e:xb,f:eO,g:cO,G:hO,H:KP,I:QP,j:JP,L:bb,m:tO,M:rO,p:IB,q:PB,Q:Ab,s:Tb,S:nO,u:iO,U:aO,V:oO,w:sO,W:uO,x:null,X:null,y:lO,Y:fO,Z:pO,"%":Sb},nt={a:Sr,A:_r,b:Gr,B:Cn,c:wi,d:vb,e:vb,f:IP,g:db,G:pb,H:mb,I:mb,j:wP,L:MP,m:TP,M:CP,p:Wt,q:AP,Q:OP,s:kP,S:RP,u:_P,U:xP,V:bP,w:yP,W:EP,x:la,X:co,y:db,Y:pb,Z:SP,"%":PP};Se.x=st(t,Se),Se.X=st(n,Se),Se.c=st(r,Se),Ve.x=st(t,Ve),Ve.X=st(n,Ve),Ve.c=st(r,Ve);function st(oi,xa){return function(za){var yn=[],Wl=-1,zo=0,mc=oi.length,gc,kd,r2;for(za instanceof Date||(za=new Date(+za));++Wl<mc;)oi.charCodeAt(Wl)===37&&(yn.push(oi.slice(zo,Wl)),(kd=hb[gc=oi.charAt(++Wl)])!=null?gc=oi.charAt(++Wl):kd=gc==="e"?" ":"0",(r2=xa[gc])&&(gc=r2(za,kd)),yn.push(gc),zo=Wl+1);return yn.push(oi.slice(zo,Wl)),yn.join("")}}function at(oi,xa){return function(za){var yn=Tm(1900,void 0,1),Wl=At(yn,oi,za+="",0),zo,mc;if(Wl!=za.length)return null;if("Q"in yn)return new Date(yn.Q);if("s"in yn)return new Date(yn.s*1e3+("L"in yn?yn.L:0));if(xa&&!("Z"in yn)&&(yn.Z=0),"p"in yn&&(yn.H=yn.H%12+yn.p*12),yn.m===void 0&&(yn.m="q"in yn?yn.q:0),"V"in yn){if(yn.V<1||yn.V>53)return null;"w"in yn||(yn.w=1),"Z"in yn?(zo=xy(Tm(yn.y,0,1)),mc=zo.getUTCDay(),zo=mc>4||mc===0?Yg.ceil(zo):Yg(zo),zo=fb.offset(zo,(yn.V-1)*7),yn.y=zo.getUTCFullYear(),yn.m=zo.getUTCMonth(),yn.d=zo.getUTCDate()+(yn.w+6)%7):(zo=_y(Tm(yn.y,0,1)),mc=zo.getDay(),zo=mc>4||mc===0?Xg.ceil(zo):Xg(zo),zo=gy.offset(zo,(yn.V-1)*7),yn.y=zo.getFullYear(),yn.m=zo.getMonth(),yn.d=zo.getDate()+(yn.w+6)%7)}else("W"in yn||"U"in yn)&&("w"in yn||(yn.w="u"in yn?yn.u%7:"W"in yn?1:0),mc="Z"in yn?xy(Tm(yn.y,0,1)).getUTCDay():_y(Tm(yn.y,0,1)).getDay(),yn.m=0,yn.d="W"in yn?(yn.w+6)%7+yn.W*7-(mc+5)%7:yn.w+yn.U*7-(mc+6)%7);return"Z"in yn?(yn.H+=yn.Z/100|0,yn.M+=yn.Z%100,xy(yn)):_y(yn)}}function At(oi,xa,za,yn){for(var Wl=0,zo=xa.length,mc=za.length,gc,kd;Wl<zo;){if(yn>=mc)return-1;if(gc=xa.charCodeAt(Wl++),gc===37){if(gc=xa.charAt(Wl++),kd=nt[gc in hb?xa.charAt(Wl++):gc],!kd||(yn=kd(oi,za,yn))<0)return-1}else if(gc!=za.charCodeAt(yn++))return-1}return yn}function Wt(oi,xa,za){var yn=d.exec(xa.slice(za));return yn?(oi.p=_[yn[0].toLowerCase()],za+yn[0].length):-1}function Sr(oi,xa,za){var yn=M.exec(xa.slice(za));return yn?(oi.w=P[yn[0].toLowerCase()],za+yn[0].length):-1}function _r(oi,xa,za){var yn=b.exec(xa.slice(za));return yn?(oi.w=T[yn[0].toLowerCase()],za+yn[0].length):-1}function Gr(oi,xa,za){var yn=q.exec(xa.slice(za));return yn?(oi.m=se[yn[0].toLowerCase()],za+yn[0].length):-1}function Cn(oi,xa,za){var yn=D.exec(xa.slice(za));return yn?(oi.m=G[yn[0].toLowerCase()],za+yn[0].length):-1}function wi(oi,xa,za){return At(oi,r,xa,za)}function la(oi,xa,za){return At(oi,t,xa,za)}function co(oi,xa,za){return At(oi,n,xa,za)}function Yo(oi){return s[oi.getDay()]}function Uo(oi){return a[oi.getDay()]}function qs(oi){return f[oi.getMonth()]}function bl(oi){return l[oi.getMonth()]}function AB(oi){return i[+(oi.getHours()>=12)]}function TB(oi){return 1+~~(oi.getMonth()/3)}function wB(oi){return s[oi.getUTCDay()]}function CB(oi){return a[oi.getUTCDay()]}function RB(oi){return f[oi.getUTCMonth()]}function MB(oi){return l[oi.getUTCMonth()]}function IB(oi){return i[+(oi.getUTCHours()>=12)]}function PB(oi){return 1+~~(oi.getUTCMonth()/3)}return{format:function(oi){var xa=st(oi+="",Se);return xa.toString=function(){return oi},xa},parse:function(oi){var xa=at(oi+="",!1);return xa.toString=function(){return oi},xa},utcFormat:function(oi){var xa=st(oi+="",Ve);return xa.toString=function(){return oi},xa},utcParse:function(oi){var xa=at(oi+="",!0);return xa.toString=function(){return oi},xa}}}var hb={"-":"",_:" ",0:"0"},du=/^\s*\d+/,vP=/^%/,mP=/[\\^$*+?|[\]().{}]/g;function Ua(e,r,t){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<t?new Array(t-a+1).join(r)+i:i)}function gP(e){return e.replace(mP,"\\$&")}function wm(e){return new RegExp("^(?:"+e.map(gP).join("|")+")","i")}function Cm(e){for(var r={},t=-1,n=e.length;++t<n;)r[e[t].toLowerCase()]=t;return r}function yP(e,r,t){var n=du.exec(r.slice(t,t+1));return n?(e.w=+n[0],t+n[0].length):-1}function _P(e,r,t){var n=du.exec(r.slice(t,t+1));return n?(e.u=+n[0],t+n[0].length):-1}function xP(e,r,t){var n=du.exec(r.slice(t,t+2));return n?(e.U=+n[0],t+n[0].length):-1}function bP(e,r,t){var n=du.exec(r.slice(t,t+2));return n?(e.V=+n[0],t+n[0].length):-1}function EP(e,r,t){var n=du.exec(r.slice(t,t+2));return n?(e.W=+n[0],t+n[0].length):-1}function pb(e,r,t){var n=du.exec(r.slice(t,t+4));return n?(e.y=+n[0],t+n[0].length):-1}function db(e,r,t){var n=du.exec(r.slice(t,t+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),t+n[0].length):-1}function SP(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 AP(e,r,t){var n=du.exec(r.slice(t,t+1));return n?(e.q=n[0]*3-3,t+n[0].length):-1}function TP(e,r,t){var n=du.exec(r.slice(t,t+2));return n?(e.m=n[0]-1,t+n[0].length):-1}function vb(e,r,t){var n=du.exec(r.slice(t,t+2));return n?(e.d=+n[0],t+n[0].length):-1}function wP(e,r,t){var n=du.exec(r.slice(t,t+3));return n?(e.m=0,e.d=+n[0],t+n[0].length):-1}function mb(e,r,t){var n=du.exec(r.slice(t,t+2));return n?(e.H=+n[0],t+n[0].length):-1}function CP(e,r,t){var n=du.exec(r.slice(t,t+2));return n?(e.M=+n[0],t+n[0].length):-1}function RP(e,r,t){var n=du.exec(r.slice(t,t+2));return n?(e.S=+n[0],t+n[0].length):-1}function MP(e,r,t){var n=du.exec(r.slice(t,t+3));return n?(e.L=+n[0],t+n[0].length):-1}function IP(e,r,t){var n=du.exec(r.slice(t,t+6));return n?(e.L=Math.floor(n[0]/1e3),t+n[0].length):-1}function PP(e,r,t){var n=vP.exec(r.slice(t,t+1));return n?t+n[0].length:-1}function OP(e,r,t){var n=du.exec(r.slice(t));return n?(e.Q=+n[0],t+n[0].length):-1}function kP(e,r,t){var n=du.exec(r.slice(t));return n?(e.s=+n[0],t+n[0].length):-1}function gb(e,r){return Ua(e.getDate(),r,2)}function DP(e,r){return Ua(e.getHours(),r,2)}function LP(e,r){return Ua(e.getHours()%12||12,r,2)}function BP(e,r){return Ua(1+gy.count(gv(e),e),r,3)}function yb(e,r){return Ua(e.getMilliseconds(),r,3)}function FP(e,r){return yb(e,r)+"000"}function NP(e,r){return Ua(e.getMonth()+1,r,2)}function UP(e,r){return Ua(e.getMinutes(),r,2)}function zP(e,r){return Ua(e.getSeconds(),r,2)}function ZP(e){var r=e.getDay();return r===0?7:r}function VP(e,r){return Ua(vy.count(gv(e)-1,e),r,2)}function _b(e){var r=e.getDay();return r>=4||r===0?yv(e):yv.ceil(e)}function jP(e,r){return e=_b(e),Ua(yv.count(gv(e),e)+(gv(e).getDay()===4),r,2)}function HP(e){return e.getDay()}function WP(e,r){return Ua(Xg.count(gv(e)-1,e),r,2)}function GP(e,r){return Ua(e.getFullYear()%100,r,2)}function XP(e,r){return e=_b(e),Ua(e.getFullYear()%100,r,2)}function $P(e,r){return Ua(e.getFullYear()%1e4,r,4)}function YP(e,r){var t=e.getDay();return e=t>=4||t===0?yv(e):yv.ceil(e),Ua(e.getFullYear()%1e4,r,4)}function qP(e){var r=e.getTimezoneOffset();return(r>0?"-":(r*=-1,"+"))+Ua(r/60|0,"0",2)+Ua(r%60,"0",2)}function xb(e,r){return Ua(e.getUTCDate(),r,2)}function KP(e,r){return Ua(e.getUTCHours(),r,2)}function QP(e,r){return Ua(e.getUTCHours()%12||12,r,2)}function JP(e,r){return Ua(1+fb.count(Am(e),e),r,3)}function bb(e,r){return Ua(e.getUTCMilliseconds(),r,3)}function eO(e,r){return bb(e,r)+"000"}function tO(e,r){return Ua(e.getUTCMonth()+1,r,2)}function rO(e,r){return Ua(e.getUTCMinutes(),r,2)}function nO(e,r){return Ua(e.getUTCSeconds(),r,2)}function iO(e){var r=e.getUTCDay();return r===0?7:r}function aO(e,r){return Ua(lb.count(Am(e)-1,e),r,2)}function Eb(e){var r=e.getUTCDay();return r>=4||r===0?_v(e):_v.ceil(e)}function oO(e,r){return e=Eb(e),Ua(_v.count(Am(e),e)+(Am(e).getUTCDay()===4),r,2)}function sO(e){return e.getUTCDay()}function uO(e,r){return Ua(Yg.count(Am(e)-1,e),r,2)}function lO(e,r){return Ua(e.getUTCFullYear()%100,r,2)}function cO(e,r){return e=Eb(e),Ua(e.getUTCFullYear()%100,r,2)}function fO(e,r){return Ua(e.getUTCFullYear()%1e4,r,4)}function hO(e,r){var t=e.getUTCDay();return e=t>=4||t===0?_v(e):_v.ceil(e),Ua(e.getUTCFullYear()%1e4,r,4)}function pO(){return"+0000"}function Sb(){return"%"}function Ab(e){return+e}function Tb(e){return Math.floor(+e/1e3)}var xv,wb,dO,vO,mO;gO({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 gO(e){return xv=dP(e),wb=xv.format,dO=xv.parse,vO=xv.utcFormat,mO=xv.utcParse,xv}var Rm=1e3,Mm=Rm*60,Im=Mm*60,Pm=Im*24,yO=Pm*7,Cb=Pm*30,by=Pm*365;function _O(e){return new Date(e)}function xO(e){return e instanceof Date?+e:+new Date(+e)}function Rb(e,r,t,n,i,a,s,l,f){var d=Lx(Ku,Ku),_=d.invert,b=d.domain,T=f(".%L"),M=f(":%S"),P=f("%I:%M"),D=f("%I %p"),G=f("%a %d"),q=f("%b %d"),se=f("%B"),Se=f("%Y"),Ve=[[s,1,Rm],[s,5,5*Rm],[s,15,15*Rm],[s,30,30*Rm],[a,1,Mm],[a,5,5*Mm],[a,15,15*Mm],[a,30,30*Mm],[i,1,Im],[i,3,3*Im],[i,6,6*Im],[i,12,12*Im],[n,1,Pm],[n,2,2*Pm],[t,1,yO],[r,1,Cb],[r,3,3*Cb],[e,1,by]];function nt(at){return(s(at)<at?T:a(at)<at?M:i(at)<at?P:n(at)<at?D:r(at)<at?t(at)<at?G:q:e(at)<at?se:Se)(at)}function st(at,At,Wt,Sr){if(at==null&&(at=10),typeof at=="number"){var _r=Math.abs(Wt-At)/at,Gr=hx(function(Cn){return Cn[2]}).right(Ve,_r);Gr===Ve.length?(Sr=ty(At/by,Wt/by,at),at=e):Gr?(Gr=Ve[_r/Ve[Gr-1][2]<Ve[Gr][2]/_r?Gr-1:Gr],Sr=Gr[1],at=Gr[0]):(Sr=Math.max(ty(At,Wt,at),1),at=l)}return Sr==null?at:at.every(Sr)}return d.invert=function(at){return new Date(_(at))},d.domain=function(at){return arguments.length?b(Cx.call(at,xO)):b().map(_O)},d.ticks=function(at,At){var Wt=b(),Sr=Wt[0],_r=Wt[Wt.length-1],Gr=_r<Sr,Cn;return Gr&&(Cn=Sr,Sr=_r,_r=Cn),Cn=st(at,Sr,_r,At),Cn=Cn?Cn.range(Sr,_r+1):[],Gr?Cn.reverse():Cn},d.tickFormat=function(at,At){return At==null?nt:f(At)},d.nice=function(at,At){var Wt=b();return(at=st(at,Wt[0],Wt[Wt.length-1],At))?b(Hx(Wt,at)):d},d.copy=function(){return Vg(d,Rb(e,r,t,n,i,a,s,l,f))},d}function bO(){return Pp.apply(Rb(gv,tP,vy,gy,oP,sP,uP,lP,wb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function KF(){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 qg(){var e=0,r=1,t,n,i,a,s=Ku,l=!1,f;function d(_){return isNaN(_=+_)?f:s(i===0?.5:(_=(a(_)-t)*i,l?Math.max(0,Math.min(1,_)):_))}return d.domain=function(_){return arguments.length?(t=a(e=+_[0]),n=a(r=+_[1]),i=t===n?0:1/(n-t),d):[e,r]},d.clamp=function(_){return arguments.length?(l=!!_,d):l},d.interpolator=function(_){return arguments.length?(s=_,d):s},d.unknown=function(_){return arguments.length?(f=_,d):f},function(_){return a=_,t=_(e),n=_(r),i=t===n?0:1/(n-t),d}}function Om(e,r){return r.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Mb(){var e=Em(qg()(Ku));return e.copy=function(){return Om(e,Mb())},Rx.apply(e,arguments)}function EO(){var e=loggish(qg()).domain([1,10]);return e.copy=function(){return Om(e,EO()).base(e.base())},initInterpolator.apply(e,arguments)}function SO(){var e=symlogish(qg());return e.copy=function(){return Om(e,SO()).constant(e.constant())},initInterpolator.apply(e,arguments)}function Ib(){var e=powish(qg());return e.copy=function(){return Om(e,Ib()).exponent(e.exponent())},initInterpolator.apply(e,arguments)}function QF(){return Ib.apply(null,arguments).exponent(.5)}function AO(){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,a=n.length,s;i<a;++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 AO(r).domain(e)},initInterpolator.apply(t,arguments)}function Kg(){var e=0,r=.5,t=1,n,i,a,s,l,f=Ku,d,_=!1,b;function T(M){return isNaN(M=+M)?b:(M=.5+((M=+d(M))-i)*(M<i?s:l),f(_?Math.max(0,Math.min(1,M)):M))}return T.domain=function(M){return arguments.length?(n=d(e=+M[0]),i=d(r=+M[1]),a=d(t=+M[2]),s=n===i?0:.5/(i-n),l=i===a?0:.5/(a-i),T):[e,r,t]},T.clamp=function(M){return arguments.length?(_=!!M,T):_},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 d=M,n=M(e),i=M(r),a=M(t),s=n===i?0:.5/(i-n),l=i===a?0:.5/(a-i),T}}function Pb(){var e=Em(Kg()(Ku));return e.copy=function(){return Om(e,Pb())},Rx.apply(e,arguments)}function TO(){var e=loggish(Kg()).domain([.1,1,10]);return e.copy=function(){return copy(e,TO()).base(e.base())},initInterpolator.apply(e,arguments)}function wO(){var e=symlogish(Kg());return e.copy=function(){return copy(e,wO()).constant(e.constant())},initInterpolator.apply(e,arguments)}function Ob(){var e=powish(Kg());return e.copy=function(){return copy(e,Ob()).exponent(e.exponent())},initInterpolator.apply(e,arguments)}function JF(){return Ob.apply(null,arguments).exponent(.5)}function kb(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 kb(e).unknown(r)},n}var dc,Db,Lb,Ey=ui.isNil,CO=ui.isString,RO=ui.uniq,MO=/^(?:(?!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]))?$/,IO=(dc={},(0,F.Z)(dc,Ya.LINEAR,jx),(0,F.Z)(dc,Ya.POWER,fy),(0,F.Z)(dc,Ya.LOG,$x),(0,F.Z)(dc,Ya.IDENTITY,kb),(0,F.Z)(dc,Ya.SEQUENTIAL,Mb),(0,F.Z)(dc,Ya.TIME,bO),(0,F.Z)(dc,Ya.QUANTILE,Qx),(0,F.Z)(dc,Ya.QUANTIZE,Jx),(0,F.Z)(dc,Ya.THRESHOLD,eb),(0,F.Z)(dc,Ya.CAT,zg),(0,F.Z)(dc,Ya.DIVERGING,Pb),dc),PO=(Db=(0,er.b2)(),Db(Lb=function(){function e(){(0,Q.Z)(this,e),(0,F.Z)(this,"scaleOptions",{})}return(0,j.Z)(e,[{key:"apply",value:function(t,n){var i=this,a=n.styleAttributeService;t.hooks.init.tapPromise("FeatureScalePlugin",(0,Ft.Z)(_e().mark(function s(){var l,f,d;return _e().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(t.log(Ds.ScaleInitStart,es.INIT),i.scaleOptions=t.getScaleOptions(),f=a.getLayerStyleAttributes(),d=(l=t.getSource())===null||l===void 0?void 0:l.data.dataArray,!(Array.isArray(d)&&d.length===0)){b.next=8;break}return b.abrupt("return");case 8:i.caculateScalesForAttributes(f||[],d);case 9:t.log(Ds.ScaleInitEnd,es.INIT);case 10:case"end":return b.stop()}},s)}))),t.hooks.beforeRenderData.tapPromise("FeatureScalePlugin",function(){var s=(0,Ft.Z)(_e().mark(function l(f){var d,_;return _e().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(Ds.ScaleInitStart,es.UPDATE),i.scaleOptions=t.getScaleOptions(),d=a.getLayerStyleAttributes(),_=t.getSource().data.dataArray,!(Array.isArray(_)&&_.length===0)){T.next=8;break}return T.abrupt("return",!0);case 8:return i.caculateScalesForAttributes(d||[],_),t.log(Ds.ScaleInitEnd,es.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=a.getLayerStyleAttributes(),l=t.getSource().data.dataArray;if(!(Array.isArray(l)&&l.length===0)&&s){var f=s.filter(function(d){return d.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(a){if(a.scale){var s=a.scale,l=a.scale.field;s.names=i.parseFields(Ey(l)?[]:l);var f=[];s.names.forEach(function(d){var _;f.push(i.createScale(d,a.name,(_=a.scale)===null||_===void 0?void 0:_.values,n))}),f.some(function(d){return d.type===lv.VARIABLE})?(s.type=lv.VARIABLE,f.forEach(function(d){if(!s.callback&&s.values!=="text"){var _;switch((_=d.option)===null||_===void 0?void 0:_.type){case Ya.LOG:case Ya.LINEAR:case Ya.POWER:if(s.values&&s.values.length>2){var b=d.scale.ticks(s.values.length);d.scale.domain(b)}s.values?d.scale.range(s.values):d.scale.range(d.option.domain);break;case Ya.QUANTILE:case Ya.QUANTIZE:case Ya.THRESHOLD:d.scale.range(s.values);break;case Ya.IDENTITY:break;case Ya.CAT:s.values?d.scale.range(s.values):d.scale.range(d.option.domain);break;case Ya.DIVERGING:case Ya.SEQUENTIAL:d.scale.interpolator(vI(s.values));break}}if(s.values==="text"){var T;d.scale.range((T=d.option)===null||T===void 0?void 0:T.domain)}})):(s.type=lv.CONSTANT,s.defaultValues=f.map(function(d,_){return d.scale(s.names[_])})),s.scalers=f.map(function(d){return{field:d.field,func:d.scale,option:d.option}}),a.needRescale=!1}})}},{key:"parseFields",value:function(t){return Array.isArray(t)?t:CO(t)?t.split("*"):[t]}},{key:"createScale",value:function(t,n,i,a){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],d={field:t,scale:void 0,type:lv.VARIABLE,option:f};if(!a||!a.length)return f&&f.type?d.scale=this.createDefaultScale(f):(d.scale=zg([t]),d.type=lv.CONSTANT),d;var _=(l=a.find(function(M){return!Ey(M[t])}))===null||l===void 0?void 0:l[t];if(this.isNumber(t)||Ey(_)&&!f)d.scale=zg([t]),d.type=lv.CONSTANT;else{var b=f&&f.type||this.getDefaultType(_);i==="text"&&(b=Ya.CAT),i===void 0&&(b=Ya.IDENTITY);var T=this.createScaleConfig(b,t,f,a);d.scale=this.createDefaultScale(T),d.option=T}return d}},{key:"getDefaultType",value:function(t){var n=Ya.LINEAR;return typeof t=="string"&&(n=MO.test(t)?Ya.TIME:Ya.CAT),n}},{key:"createScaleConfig",value:function(t,n,i,a){var s={type:t},l=[];if(t===Ya.QUANTILE){var f=new Map;a==null||a.forEach(function(b){f.set(b._id,b[n])}),l=Array.from(f.values())}else l=(a==null?void 0:a.map(function(b){return b[n]}))||[];if(i!=null&&i.domain)s.domain=i==null?void 0:i.domain;else if(t===Ya.CAT||t===Ya.IDENTITY)s.domain=RO(l);else if(t===Ya.QUANTILE)s.domain=l;else if(t===Ya.DIVERGING){var d=dx(l),_=(i==null?void 0:i.neutral)!==void 0?i==null?void 0:i.neutral:(d[0]+d[1])/2;s.domain=[d[0],_,d[1]]}else s.domain=dx(l);return(0,H.Z)((0,H.Z)({},s),i)}},{key:"createDefaultScale",value:function(t){var n=t.type,i=t.domain,a=t.unknown,s=t.clamp,l=t.nice,f=IO[n]();return i&&f.domain&&f.domain(i),a&&f.unknown(a),s!==void 0&&f.clamp&&f.clamp(s),l!==void 0&&f.nice&&f.nice(l),f}}]),e}())||Lb),Bb,Fb,OO=(Bb=(0,er.b2)(),Bb(Fb=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,H.Z)({},t.layerModel.getAnimateUniforms()))})})}}]),e}())||Fb),Nb,Ub,kO=(Nb=(0,er.b2)(),Nb(Ub=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,a=n.enableMask;if(!t.tileLayer&&i&&i.length>0){var s;(s=t.masks).push.apply(s,(0,Qt.Z)(i)),t.updateLayerConfig({mask:a})}})}}]),e}())||Ub),DO=function(){function e(r){var t=r.rendererService,n=r.layerService,i=r.parent;(0,Q.Z)(this,e),(0,F.Z)(this,"tileResource",new Map),(0,F.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(a){return a.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 a=this.isChildrenLoaded(t.parent);n==null||n.updateVisible(!a)}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(a){var s=n.getTile(a==null?void 0:a.key);return s?(s==null?void 0:s.isLoaded)===!0:!0})}},{key:"render",value:function(){var r=(0,Ft.Z)(_e().mark(function n(){var i=this,a,s;return _e().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return a=this.getRenderLayers(),s=a.map(function(){var d=(0,Ft.Z)(_e().mark(function _(b){return _e().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()}},_)}));return function(_){return d.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,Qt.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,Qt.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}(),LO=U(41227);function BO(e,r,t){t===void 0&&(t={});var n=Ln(e),i=Ln(r),a=LO.union(n.coordinates,i.coordinates);return a.length===0?null:a.length===1?Vt(a[0],t.properties):rn(a,t.properties)}var FO=BO,NO=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(a){var s=Vt(a.coordinates);n===null?n=s:n=FO(n,s)}),i&&(n.properties=(0,H.Z)({},i)),n}}]),e}(),km="select",Dm="active",UO=function(){function e(r){var t=r.layerService,n=r.tileLayerService,i=r.parent;(0,Q.Z)(this,e),(0,F.Z)(this,"tilePickID",new Map),this.layerService=t,this.tileLayerService=n,this.parent=i,this.tileSourceService=new NO}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(),a=i.get(Ke.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),a.pickFromPickingFBO(t,n)}},{key:"selectFeature",value:function(t){var n=(0,_n.Z)(t,3),i=n[0],a=n[1],s=n[2],l=this.color2PickId(i,a,s);this.tilePickID.set(km,l),this.updateHighLight(i,a,s,km)}},{key:"highlightPickedFeature",value:function(t){var n=(0,_n.Z)(t,3),i=n[0],a=n[1],s=n[2],l=this.color2PickId(i,a,s);this.tilePickID.set(Dm,l),this.updateHighLight(i,a,s,Dm)}},{key:"updateHighLight",value:function(t,n,i,a){this.tileLayerService.tiles.map(function(s){var l=s.getMainLayer();switch(a){case km:l==null||l.hooks.beforeSelect.call([t,n,i]);break;case Dm:l==null||l.hooks.beforeHighlight.call([t,n,i]);break}})}},{key:"setPickState",value:function(){var t=this.tilePickID.get(km),n=this.tilePickID.get(Dm);if(t){var i=this.pickId2Color(t),a=(0,_n.Z)(i,3),s=a[0],l=a[1],f=a[2];this.updateHighLight(s,l,f,km);return}if(n){var d=this.pickId2Color(n),_=(0,_n.Z)(d,3),b=_[0],T=_[1],M=_[2];this.updateHighLight(b,T,M,Dm);return}}},{key:"color2PickId",value:function(t,n,i){return ka(new Uint8Array([t,n,i]))}},{key:"pickId2Color",value:function(t){return na(t)}},{key:"getFeatureById",value:function(t){var n=this.tileLayerService.getTiles().filter(function(a){return a.visible}),i=[];return n.forEach(function(a){i.push.apply(i,(0,Qt.Z)(a.getFeatureById(t)))}),i}},{key:"pickRasterLayer",value:function(t,n,i){return!1}}]),e}();function zO(e){return e==="PolygonLayer"?kg:e==="LineLayer"?q0:Og}function ZO(e){return["PolygonLayer","LineLayer"].indexOf(e)!==-1}function VO(e){var r=jO();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function jO(){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 Td=function(e){(0,Fe.Z)(t,e);var r=VO(t);function t(n,i){var a;return(0,Q.Z)(this,t),a=r.call(this),(0,F.Z)((0,Me.Z)(a),"visible",!0),(0,F.Z)((0,Me.Z)(a),"layers",[]),(0,F.Z)((0,Me.Z)(a),"isLoaded",!1),(0,F.Z)((0,Me.Z)(a),"tileMaskLayers",[]),a.parent=i,a.sourceTile=n,a.x=n.x,a.y=n.y,a.z=n.z,a.key="".concat(a.x,"_").concat(a.y,"_").concat(a.z),a}return(0,j.Z)(t,[{key:"getLayers",value:function(){return this.layers}},{key:"styleUpdate",value:function(){}},{key:"lnglatInBounds",value:function(i){var a=(0,_n.Z)(this.sourceTile.bounds,4),s=a[0],l=a[1],f=a[2],d=a[3],_=i.lng,b=i.lat;return _>=s&&_<=f&&b>=l&&b<=d}},{key:"getLayerOptions",value:function(){var i,a=this.parent.getLayerConfig();return(0,H.Z)((0,H.Z)({},a),{},{textAllowOverlap:!0,autoFit:!1,maskLayers:this.getMaskLayer(),tileMask:ZO(this.parent.type),mask:a.mask||((i=a.maskLayers)===null||i===void 0?void 0:i.length)!==0&&a.enableMask})}},{key:"getMaskLayer",value:function(){var i=this,a=this.parent.getLayerConfig(),s=a.maskLayers,l=[];return s==null||s.forEach(function(f){if(!f.tileLayer)return l.push(f),f;var d=f.tileLayer,_=d.getTile(i.sourceTile.key),b=_==null?void 0:_.getLayers()[0];b&&l.push(b)}),l}},{key:"addTileMask",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s,l,f;return _e().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return s=new kg({visible:!1,enablePicking:!1}).source({type:"FeatureCollection",features:[this.sourceTile.bboxPolygon]},{parser:{type:"geojson",featureId:"id"}}).shape("fill").style({opacity:.5}),l=gm(this.parent.sceneContainer),s.setContainer(l,this.parent.sceneContainer),_.next=5,s.init();case 5:return this.tileMask=s,f=this.getMainLayer(),f!==void 0&&(f.tileMask=s),_.abrupt("return",s);case 9:case"end":return _.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"addMask",value:function(){var n=(0,Ft.Z)(_e().mark(function a(s,l){var f;return _e().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return f=gm(this.parent.sceneContainer),l.setContainer(f,this.parent.sceneContainer),_.next=4,l.init();case 4:s.addMask(l),this.tileMaskLayers.push(l);case 6:case"end":return _.stop()}},a,this)}));function i(a,s){return n.apply(this,arguments)}return i}()},{key:"addLayer",value:function(){var n=(0,Ft.Z)(_e().mark(function a(s){var l;return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return s.isTileLayer=!0,l=gm(this.parent.sceneContainer),s.setContainer(l,this.parent.sceneContainer),this.layers.push(s),d.next=6,s.init();case 6:case"end":return d.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"updateVisible",value:function(i){this.visible=i,this.updateOptions("visible",i)}},{key:"updateOptions",value:function(i,a){this.layers.forEach(function(s){s.updateLayerConfig((0,F.Z)({},i,a))})}},{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(a){return a.destroy()})}}]),t}(Ka.EventEmitter);function HO(e){var r=WO();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function WO(){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 GO=function(e){(0,Fe.Z)(t,e);var r=HO(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,Ft.Z)(_e().mark(function a(){var s,l,f,d;return _e().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"),d=new Og({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(d);case 8:this.isLoaded=!0;case 9:case"end":return b.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),a=this.sourceTile.data.layers.testTile.features;return{data:{type:"FeatureCollection",features:a},options:{parser:{type:"geojson"},transforms:i.transforms}}}}]),t}(Td);function XO(e){var r=$O();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.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,Fe.Z)(t,e);var r=XO(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,Ft.Z)(_e().mark(function a(){var s,l,f,d;return _e().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),d=new P1((0,H.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,P,D=T;d[D]((M=s[D])===null||M===void 0?void 0:M.field,(P=s[D])===null||P===void 0?void 0:P.values)}),b.next=7,this.addLayer(d);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},a,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}(Td);function qO(e){var r=KO();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function KO(){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 QO=function(e){(0,Fe.Z)(t,e);var r=qO(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,Ft.Z)(_e().mark(function a(){var s,l,f,d;return _e().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),d=new nx((0,H.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,P,D=T;d[D]((M=s[D])===null||M===void 0?void 0:M.field,(P=s[D])===null||P===void 0?void 0:P.values)}),b.next=7,this.addLayer(d);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getFeatures",value:function(i){if(!i)return[];var a=this.sourceTile.data;return a.getTileData(i)}},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),a=this.parent.getLayerConfig(),s=a.sourceLayer,l=a.featureId,f=this.getFeatures(s);return{data:{type:"FeatureCollection",features:f},options:{parser:{type:"geojson",featureId:l},transforms:i.transforms}}}}]),t}(Td),JO=["rasterData"];function e5(e){var r=t5();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function t5(){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 r5=function(e){(0,Fe.Z)(t,e);var r=e5(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,Ft.Z)(_e().mark(function a(){var s,l,f,d;return _e().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),d=new Dg((0,H.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,P,D=T;d[D]((M=s[D])===null||M===void 0?void 0:M.field,(P=s[D])===null||P===void 0?void 0:P.values)}),b.next=7,this.addLayer(d);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),a=this.sourceTile.data.data,s=a.rasterData,l=(0,wa.Z)(a,JO);return{data:s,options:{parser:(0,H.Z)({type:"rasterRgb",extent:this.sourceTile.bounds},l),transforms:i.transforms}}}}]),t}(Td);function n5(e){var r=i5();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function i5(){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 a5=function(e){(0,Fe.Z)(t,e);var r=n5(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,Ft.Z)(_e().mark(function a(){var s,l,f,d;return _e().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),d=new Dg((0,H.Z)({},l)).source(f.data,f.options),s&&Object.keys(s).forEach(function(T){var M,P,D=T;d[D]((M=s[D])===null||M===void 0?void 0:M.field,(P=s[D])===null||P===void 0?void 0:P.values)}),b.next=7,this.addLayer(d);case 7:this.isLoaded=!0;case 8:case"end":return b.stop()}},a,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}(Td),o5=["rasterData"];function s5(e){var r=u5();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function u5(){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 l5={positions:[0,1],colors:["#000","#fff"]},c5=function(e){(0,Fe.Z)(t,e);var r=s5(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,Ft.Z)(_e().mark(function a(){var s,l,f,d,_,b,T;return _e().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=this.getSourceOption(),d=this.getLayerOptions(),_=d.rampColors,b=d.domain,this.colorTexture=this.parent.textureService.getColorTexture(_,b),T=new Dg((0,H.Z)((0,H.Z)({},l),{},{colorTexture:this.colorTexture})).source(f.data,f.options),s&&Object.keys(s).forEach(function(D){var G,q,se=D;T[se]((G=s[se])===null||G===void 0?void 0:G.field,(q=s[se])===null||q===void 0?void 0:q.values)}),P.next=9,this.addLayer(T);case 9:this.isLoaded=!0;case 10:case"end":return P.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),a=this.sourceTile.data.data,s=a.rasterData,l=(0,wa.Z)(a,o5);return{data:s,options:{parser:(0,H.Z)({type:"raster",extent:this.sourceTile.bounds},l),transforms:i.transforms}}}},{key:"styleUpdate",value:function(){for(var i=this,a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var f=s,d=f.rampColors,_=d===void 0?l5:d,b=f.domain;this.colorTexture=this.parent.textureService.getColorTexture(_,b||yc(_)),this.layers.forEach(function(T){return T.style({colorTexture:i.colorTexture})})}},{key:"destroy",value:function(){this.layers.forEach(function(i){return i.destroy()})}}]),t}(Td);function f5(e){var r=h5();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function h5(){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 Qg=function(e){(0,Fe.Z)(t,e);var r=f5(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,Ft.Z)(_e().mark(function a(){var s,l,f,d,_;return _e().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(s=this.parent.getLayerAttributeConfig(),l=this.getLayerOptions(),f=zO(this.parent.type),d=this.getSourceOption(),d){T.next=8;break}return this.isLoaded=!0,this.emit("loaded"),T.abrupt("return");case 8:return _=new f((0,H.Z)({},l)).source(d.data,d.options),Object.keys(s).forEach(function(M){var P,D,G=M;_[G]((P=s[G])===null||P===void 0?void 0:P.field,(D=s[G])===null||D===void 0?void 0:D.values)}),T.next=12,this.addLayer(_);case 12:if(!l.tileMask){T.next=15;break}return T.next=15,this.addTileMask();case 15:this.setLayerMinMaxZoom(_),this.isLoaded=!0,this.emit("loaded");case 18:case"end":return T.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getSourceOption",value:function(){var i=this.parent.getSource(),a=this.parent.getLayerConfig(),s=a.sourceLayer,l=s===void 0?"defaultLayer":s,f=a.featureId,d=f===void 0?"id":f,_=this.getFeatures(l);return{data:{type:"FeatureCollection",features:_},options:{parser:{type:"geojson",featureId:d},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 a=this.sourceTile.data;return a.getTileData(i)}},{key:"getFeatureById",value:function(i){var a=this.getMainLayer();if(!a)return[];var s=a.getSource().data.dataArray.filter(function(l){return l._id===i});return s}}]),t}(Td);function p5(e){var r=e.type;switch(r){case"PolygonLayer":return Qg;case"LineLayer":return Qg;case"PointLayer":return Qg;case"TileDebugLayer":return GO;case"MaskLayer":return QO;case"RasterLayer":var t=e.getSource().parser.dataType;switch(t){case Mu.RGB:case Mu.CUSTOMRGB:return r5;case Mu.ARRAYBUFFER:case Mu.CUSTOMARRAYBUFFER:return c5;case Mu.TERRAINRGB:case Mu.CUSTOMTERRAINRGB:return a5;default:return YO}default:return Qg}}var d5=["shape","color","size","style","animate","filter","rotate","scale","setBlend","setSelect","setActive","disableMask","enableMask","addMask","removeMask"],v5=ui.debounce,zb=function(){function e(r){var t=this;(0,Q.Z)(this,e),(0,F.Z)(this,"initedTileset",!1),(0,F.Z)(this,"mapchange",function(){var i;if(t.parent.isVisible()!==!1){var a=t.getCurrentView(),s=a.latLonBounds,l=a.zoom;if(t.mapService.version==="GAODE1.x"){var f=t.parent.getLayerConfig(),d=f.visible;l<2&&d?(t.parent.updateLayerConfig({visible:!1}),t.layerService.reRender()):l>=2&&!d&&(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,F.Z)(this,"viewchange",v5(this.mapchange,24)),this.parent=r;var n=this.parent.getContainer();this.rendererService=n.get(Ke.IRendererService),this.layerService=n.get(Ke.ILayerService),this.mapService=n.get(Ke.IMapService),this.pickingService=n.get(Ke.IPickingService),this.tileLayerService=new DO({rendererService:this.rendererService,layerService:this.layerService,parent:r}),this.tilePickService=new UO({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(),a=i.latLonBounds,s=i.zoom;(t=this.tilesetManager)===null||t===void 0||t.update(s,a)}}},{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,a=n.zoom;(t=this.tilesetManager)===null||t===void 0||t.update(a,i)}},{key:"tileUnLoad",value:function(t){this.tileLayerService.removeTile(t.key)}},{key:"tileUpdate",value:function(){var r=(0,Ft.Z)(_e().mark(function n(){var i=this,a,s;return _e().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 a=this.parent.getMinZoom(),s=this.parent.getMaxZoom(),f.next=6,Promise.all(this.tilesetManager.tiles.filter(function(d){return d.isLoaded}).filter(function(d){return d.isVisibleChange}).filter(function(d){return d.data}).filter(function(d){return d.z>=a&&d.z<s}).map(function(){var d=(0,Ft.Z)(_e().mark(function _(b){var T,M;return _e().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(i.tileLayerService.hasTile(b.key)){D.next=9;break}return T=p5(i.parent),M=new T(b,i.parent),D.next=5,M.initTileLayer();case 5:i.tilePickService.setPickState(),M.getLayers().length!==0&&(i.tileLayerService.addTile(M),i.tileLayerService.updateTileVisible(b),i.layerService.reRender()),D.next=12;break;case 9:i.tileLayerService.updateTileVisible(b),i.tilePickService.setPickState(),i.layerService.reRender();case 12:case"end":return D.stop()}},_)}));return function(_){return d.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;d5.forEach(function(i){var a=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 a.apply(void 0,l),n.getLayers().map(function(d){d[i].apply(d,l)}),i==="style"&&n.getTiles().forEach(function(d){return d.styleUpdate.apply(d,l)}),t}})}}]),e}(),Zb,Vb,m5=(Zb=(0,er.b2)(),Zb(Vb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"build",value:function(){var r=(0,Ft.Z)(_e().mark(function n(i){return _e().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,Ft.Z)(_e().mark(function n(i){return _e().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,Ft.Z)(_e().mark(function n(i){return _e().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,Ft.Z)(_e().mark(function i(){return _e().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(Ds.BuildModelStart,es.INIT),s.next=7,n.initLayerModel(t);case 7:t.log(Ds.BuildModelEnd,es.INIT);case 8:case"end":return s.stop()}},i)}))),t.hooks.beforeRenderData.tapPromise("LayerModelPlugin",function(){var i=(0,Ft.Z)(_e().mark(function a(s){return _e().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(Ds.BuildModelStart,es.UPDATE),f.next=8,n.prepareLayerModel(t);case 8:return t.log(Ds.BuildModelEnd,es.UPDATE),f.abrupt("return",!0);case 10:case"end":return f.stop()}},a)}));return function(a){return i.apply(this,arguments)}}())}}]),e}())||Vb),jb,Hb,g5=(jb=(0,er.b2)(),jb(Hb=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,a=n.fitBoundsOptions;i&&t.fitBounds(a),t.styleNeedUpdate=!1})}}]),e}())||Hb),Wb,Gb,y5=["type"],Xb={directional:{lights:"u_DirectionalLights",num:"u_NumOfDirectionalLights"},spot:{lights:"u_SpotLights",num:"u_NumOfSpotLights"}},_5={type:"directional",direction:[1,10.5,12],ambient:[.2,.2,.2],diffuse:[.6,.6,.6],specular:[.1,.1,.1]},x5={direction:[0,0,0],ambient:[0,0,0],diffuse:[0,0,0],specular:[0,0,0]},b5={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 E5(e){var r={u_DirectionalLights:new Array(3).fill((0,H.Z)({},x5)),u_NumOfDirectionalLights:0,u_SpotLights:new Array(3).fill((0,H.Z)({},b5)),u_NumOfSpotLights:0};return(!e||!e.length)&&(e=[_5]),e.forEach(function(t){var n=t.type,i=n===void 0?"directional":n,a=(0,wa.Z)(t,y5),s=Xb[i].lights,l=Xb[i].num,f=r[l];r[s][f]=(0,H.Z)((0,H.Z)({},r[s][f]),a),r[l]++}),r}var S5=(Wb=(0,er.b2)(),Wb(Gb=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(a){return a.addUniforms((0,H.Z)({},E5()))})})}}]),e}())||Gb),$b,Yb,A5=($b=(0,er.b2)(),$b(Yb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t,n){var i=this,a=n.rendererService,s=n.postProcessingPassFactory,l=n.normalPassFactory;t.hooks.init.tapPromise("MultiPassRendererPlugin",function(){var f=t.getLayerConfig(),d=f.enableMultiPassRenderer,_=f.passes,b=_===void 0?[]:_;i.enabled=!!d&&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=a.getViewportSize(),d=f.width,_=f.height;t.multiPassRenderer.resize(d,_)}})}}]),e}())||Yb),qb,Kb,T5=ui.isNumber,bv={NONE:0,ENCODE:1,HIGHLIGHT:2},w5=(qb=(0,er.b2)(),qb(Kb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"pickOption2Array",value:function(){var t=[];return this.pickingUniformMap.forEach(function(n,i){T5(n)?t.push(n):t.push.apply(t,(0,Qt.Z)(n))}),t}},{key:"updatePickOption",value:function(t,n){var i=this;Object.keys(t).forEach(function(f){i.pickingUniformMap.set(f,t[f])});var a=n.getLayerConfig().pickingBuffer||0,s=Number(n.getShaderPickStat());this.pickingUniformMap.set("u_PickingBuffer",a),this.pickingUniformMap.set("u_shaderPick",s);var l=n.getPickingUniformBuffer();l.subData({offset:0,data:this.pickOption2Array()})}},{key:"apply",value:function(t,n){var i=this,a=n.rendererService,s=n.styleAttributeService,l;this.pickingUniformMap=new Map([["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]]),t.hooks.init.tapPromise("PixelPickingPlugin",function(){var f=t.getLayerConfig(),d=f.enablePicking;s.registerStyleAttribute({name:"pickingColor",type:In.Attribute,descriptor:{name:"a_PickingColor",shaderLocation:Yn.PICKING_COLOR,buffer:{data:[],type:I.FLOAT},size:3,update:function(b){var T=b.id;return d?na(T):[0,0,0]}}})}),t.hooks.beforePickingEncode.tap("PixelPickingPlugin",function(){var f=t.getLayerConfig(),d=f.enablePicking;d&&t.isVisible()&&(i.updatePickOption({u_PickingStage:bv.ENCODE},t),t.models.forEach(function(_){return _.addUniforms({u_PickingStage:bv.ENCODE})}))}),t.hooks.afterPickingEncode.tap("PixelPickingPlugin",function(){var f=t.getLayerConfig(),d=f.enablePicking;d&&t.isVisible()&&(i.updatePickOption({u_PickingStage:bv.HIGHLIGHT},t),t.models.forEach(function(_){return _.addUniforms({u_PickingStage:bv.HIGHLIGHT})}))}),t.hooks.beforeHighlight.tap("PixelPickingPlugin",function(f){var d=t.getLayerConfig(),_=d.highlightColor,b=d.activeMix,T=b===void 0?0:b,M=typeof _=="string"?vi(_):_||[1,0,0,1];t.updateLayerConfig({pickedFeatureID:ka(new Uint8Array(f))});var P={u_PickingStage:bv.HIGHLIGHT,u_PickingColor:f,u_HighlightColor:M.map(function(D){return D*255}),u_activeMix:T};i.updatePickOption(P,t),t.models.forEach(function(D){return D.addUniforms(P)})}),t.hooks.beforeSelect.tap("PixelPickingPlugin",function(f){var d=t.getLayerConfig(),_=d.selectColor,b=d.selectMix,T=b===void 0?0:b,M=typeof _=="string"?vi(_):_||[1,0,0,1];t.updateLayerConfig({pickedFeatureID:ka(new Uint8Array(f))});var P={u_PickingStage:bv.HIGHLIGHT,u_PickingColor:f,u_HighlightColor:M.map(function(D){return D*255}),u_activeMix:T,u_CurrentSelectedId:f,u_SelectColor:M.map(function(D){return D*255}),u_EnableSelect:1};i.updatePickOption(P,t),t.models.forEach(function(D){return D.addUniforms(P)})})}}]),e}())||Kb),C5=["mvt","geojsonvt","testTile"];function R5(e){var r=e.getSource();return C5.includes(r.parser.type)}function eN(e){return e.getContext?{width:e.width/DOM.DPR,height:e.height/DOM.DPR}:e.getBoundingClientRect()}var Qb,Jb,M5=(Qb=(0,er.b2)(),Qb(Jb=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t,n){var i=this,a=n.styleAttributeService;t.hooks.init.tapPromise("RegisterStyleAttributePlugin",function(){R5(t)||i.registerBuiltinAttributes(a,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:In.Attribute,descriptor:{name:"a_Position",shaderLocation:Yn.POSITION,buffer:{data:[],type:I.FLOAT},size:3,update:function(i,a,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:In.Attribute,descriptor:{name:"a_Color",shaderLocation:Yn.COLOR,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:4,update:function(i){var a=i.color;return!a||!a.length?[1,1,1,1]:a}}})}},{key:"registerVertexIdAttribute",value:function(t){t.registerStyleAttribute({name:"vertexId",type:In.Attribute,descriptor:{name:"a_vertexId",shaderLocation:Yn.VERTEX_ID,buffer:{usage:I.DYNAMIC_DRAW,data:[],type:I.FLOAT},size:1,update:function(i,a){return[a]}}})}}]),e}())||Jb),eE,tE,rE,nE,iE,aE,oE,wd,sE,uE,lE,cE,fE,I5=(eE=(0,er.b2)(),tE=(0,er.f3)(Ke.ICameraService),rE=(0,er.f3)(Ke.ICoordinateSystemService),nE=(0,er.f3)(Ke.IRendererService),iE=(0,er.f3)(Ke.IMapService),aE=(0,er.f3)(Ke.ILayerService),eE(oE=(wd=function(){function e(){(0,Q.Z)(this,e),Di(this,"cameraService",sE,this),Di(this,"coordinateSystemService",uE,this),Di(this,"rendererService",lE,this),Di(this,"mapService",cE,this),Di(this,"layerService",fE,this)}return(0,j.Z)(e,[{key:"apply",value:function(t){var n=this,i=this.mapService.version,a=[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*4+4*7),isUBO:!0}),this.rendererService.uniformBuffers[0]=l),t.hooks.beforeRender.tap("ShaderUniformPlugin",function(){var f=t.getLayerConfig().tileOrigin;if(n.coordinateSystemService.refresh(f),i==="GAODE2.x"){n.setLayerCenter(t),a=n.mapService.map.customCoords.getMVPMatrix(),s=n.mapService.getCustomCoordCenter();var d=t.getLayerUniformBuffer();d.subData({offset:0,data:new Uint8Array(new Float32Array([].concat((0,Qt.Z)(a),(0,Qt.Z)(s))).buffer)})}var _=n.rendererService.getViewportSize(),b=_.width,T=_.height,M=n.generateUBO(a,s,b,T),P=M.data,D=M.uniforms;n.layerService.alreadyInRendering&&l&&l.subData({offset:0,data:P}),t.models.forEach(function(G){G.addUniforms((0,H.Z)((0,H.Z)({},D),{},{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,a){var s,l=this.cameraService.getProjectionMatrix(),f=this.cameraService.getViewMatrix(),d=this.cameraService.getViewProjectionMatrix(),_=this.cameraService.getModelMatrix(),b=this.coordinateSystemService.getViewportCenterProjection(),T=this.coordinateSystemService.getPixelsPerDegree(),M=this.cameraService.getZoom(),P=this.coordinateSystemService.getPixelsPerDegree2(),D=this.cameraService.getZoomScale(),G=this.coordinateSystemService.getPixelsPerMeter(),q=this.coordinateSystemService.getCoordinateSystem(),se=this.cameraService.getCameraPosition(),Se=window.devicePixelRatio,Ve=this.coordinateSystemService.getViewportCenter(),nt=[i,a],st=this.cameraService.getFocalDistance(),at=[].concat((0,Qt.Z)(f),(0,Qt.Z)(l),(0,Qt.Z)(d),(0,Qt.Z)(_),(0,Qt.Z)(b),(0,Qt.Z)(T),[M],(0,Qt.Z)(P),[D],(0,Qt.Z)(G),[q],(0,Qt.Z)(se),[Se],(0,Qt.Z)(Ve),nt,[st,0,0,0]);return{data:at,uniforms:(s={},(0,F.Z)(s,_d.ProjectionMatrix,l),(0,F.Z)(s,_d.ViewMatrix,f),(0,F.Z)(s,_d.ViewProjectionMatrix,d),(0,F.Z)(s,_d.Zoom,M),(0,F.Z)(s,_d.ZoomScale,D),(0,F.Z)(s,_d.FocalDistance,st),(0,F.Z)(s,_d.CameraPosition,se),(0,F.Z)(s,uc.CoordinateSystem,q),(0,F.Z)(s,uc.ViewportCenter,Ve),(0,F.Z)(s,uc.ViewportCenterProjection,b),(0,F.Z)(s,uc.PixelsPerDegree,T),(0,F.Z)(s,uc.PixelsPerDegree2,P),(0,F.Z)(s,uc.PixelsPerMeter,G),(0,F.Z)(s,uc.Mvp,t),(0,F.Z)(s,"u_sceneCenterMercator",n),(0,F.Z)(s,"u_ViewportSize",nt),(0,F.Z)(s,"u_ModelMatrix",_),(0,F.Z)(s,"u_DevicePixelRatio",Se),s)}}}]),e}(),sE=Pi(wd.prototype,"cameraService",[tE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uE=Pi(wd.prototype,"coordinateSystemService",[rE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lE=Pi(wd.prototype,"rendererService",[nE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),cE=Pi(wd.prototype,"mapService",[iE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fE=Pi(wd.prototype,"layerService",[aE],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wd))||oE),hE,pE,P5=(hE=(0,er.b2)(),hE(pE=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}())||pE),dE,vE,O5=(dE=(0,er.b2)(),dE(vE=function(){function e(){(0,Q.Z)(this,e)}return(0,j.Z)(e,[{key:"apply",value:function(t,n){var i=this,a=n.styleAttributeService;t.hooks.init.tapPromise("UpdateStyleAttributePlugin",function(){i.initStyleAttribute(t,{styleAttributeService:a})}),t.hooks.beforeRender.tap("UpdateStyleAttributePlugin",function(){t.layerModelNeedUpdate||t.inited&&i.updateStyleAttribute(t,{styleAttributeService:a})})}},{key:"updateStyleAttribute",value:function(t,n){var i=n.styleAttributeService,a=i.getLayerStyleAttributes()||[],s=i.getLayerStyleAttribute("filter");if(s&&s.needRegenerateVertices){t.layerModelNeedUpdate=!0,a.forEach(function(l){return l.needRegenerateVertices=!1});return}a.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,a=i.getLayerStyleAttributes()||[];a.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}())||vE);Zl.bind(Ke.ILayerPlugin).to(oI).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(M5).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(PO).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(aI).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(g5).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(kO).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(O5).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(P5).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(A5).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(I5).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(OO).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(S5).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(w5).inRequestScope(),Zl.bind(Ke.ILayerPlugin).to(m5).inRequestScope();function tN(e){var r=k5();return function(){var n=_getPrototypeOf(e),i;if(r){var a=_getPrototypeOf(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function k5(){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 rN=null;function D5(e){var r=L5();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function L5(){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 B5=function(e){(0,Fe.Z)(t,e);var r=D5(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"zoomIn",function(){!n.disabled&&n.mapsService.getZoom()<n.mapsService.getMaxZoom()&&n.mapsService.zoomIn()}),(0,F.Z)((0,Me.Z)(n),"zoomOut",function(){!n.disabled&&n.mapsService.getZoom()>n.mapsService.getMinZoom()&&n.mapsService.zoomOut()}),(0,F.Z)((0,Me.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,H.Z)((0,H.Z)({},Ia((0,Ae.Z)(t.prototype),"getDefault",this).call(this,i)),{},{position:wr.BOTTOMRIGHT,name:"zoom",zoomInText:Xh("l7-icon-enlarge"),zoomInTitle:"Zoom in",zoomOutText:Xh("l7-icon-narrow"),zoomOutTitle:"Zoom out",showZoom:!1})}},{key:"setOptions",value:function(i){Ia((0,Ae.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=Yi("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){Ml(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,a,s,l,f){var d=Yi("button",s,l);return typeof i=="string"?d.innerHTML=i:d.append(i),d.title=a,f&&d.addEventListener("click",f),d}}]),t}(fv);function F5(e){var r=N5();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function N5(){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 mE=function(e){(0,Fe.Z)(t,e);var r=F5(t);function t(n){var i;(0,Q.Z)(this,t),i=r.call(this),(0,F.Z)((0,Me.Z)(i),"isShow",!0),(0,F.Z)((0,Me.Z)(i),"onMouseMove",function(s){var l,f=i.mapsService.getMapContainer(),d=(l=f==null?void 0:f.getBoundingClientRect())!==null&&l!==void 0?l:{},_=d.left,b=_===void 0?0:_,T=d.top,M=T===void 0?0:T;i.setPopupPosition(s.clientX-b,s.clientY-M)}),(0,F.Z)((0,Me.Z)(i),"updateLngLatPosition",function(){if(!(!i.mapsService||i.popupOption.followCursor)){var s=i.lngLat,l=s.lng,f=s.lat,d=i.mapsService.lngLatToContainer([l,f]),_=d.x,b=d.y;i.setPopupPosition(_,b)}}),(0,F.Z)((0,Me.Z)(i),"onKeyDown",function(s){s.keyCode===27&&i.remove()}),(0,F.Z)((0,Me.Z)(i),"onCloseButtonClick",function(s){s.stopPropagation&&s.stopPropagation(),i.hide()}),(0,F.Z)((0,Me.Z)(i),"update",function(){var s=!!i.lngLat,l=i.popupOption,f=l.className,d=l.style,_=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=Yi("div","l7-popup ".concat(f!=null?f:""," ").concat(i.isShow?"":"l7-popup-hide"),M),d&&i.container.setAttribute("style",d),i.tip=Yi("div","l7-popup-tip",i.container),i.container.appendChild(i.content),T&&["mousemove","mousedown","mouseup","click","dblclick"].forEach(function(G){i.container.addEventListener(G,function(q){q.stopPropagation()})}),i.container.style.whiteSpace="nowrap"),i.updateLngLatPosition(),gu(i.container,"".concat(Ra[b])),Gl(i.container,b,"popup"),_){var P=i.container.getBoundingClientRect(),D=P.width;D>parseFloat(_)&&(i.container.style.width=_)}else i.container.style.removeProperty("width")}}),i.popupOption=(0,H.Z)((0,H.Z)({},i.getDefault(n!=null?n:{})),n);var a=i.popupOption.lngLat;return a&&(i.lngLat=a),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(Ke.IMapService),this.sceneService=i.get(Ke.ISceneService),this.layerService=i.get(Ke.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 a=this.popupOption,s=a.html,l=a.text,f=a.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&&Ci(this.content),this.container&&(Ci(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,H.Z)((0,H.Z)({},this.popupOption),i),this.checkUpdateOption(i,["html","text","title","closeButton","closeButtonOffsets","maxWidth","anchor","stopPropagation","className","style","lngLat","offsets"])&&(this.container&&(Ci(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&&mu(this.container,"l7-popup-hide"),this.isShow=!0,this.emit("show"),this}},{key:"hide",value:function(){if(this.isShow)return this.container&&ou(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=Yi("div","l7-popup-content__title"),this.content.firstChild?this.content.insertBefore(this.contentTitle,this.content.firstChild):this.content.append(this.contentTitle)),Ml(this.contentTitle),al(this.contentTitle,i)):this.contentTitle&&(Ci(this.contentTitle),this.contentTitle=void 0)}},{key:"panToPopup",value:function(){var i=this.lngLat,a=i.lng,s=i.lat;return this.popupOption.autoPan&&this.mapsService.panTo([a,s]),this}},{key:"setLngLat",value:function(i){return this.setLnglat(i)}},{key:"setLnglat",value:function(i){var a=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(){a.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:fa.BOTTOM,stopPropagation:!0,autoPan:!1,autoClose:!0,closeOnEsc:!1,followCursor:!1}}},{key:"setDOMContent",value:function(i){return this.show(),this.createContent(),al(this.contentPanel,i),this.update(),this}},{key:"updateCloseOnClick",value:function(i){var a=this,s=this.mapsService;s&&(s==null||s.off("click",this.onCloseButtonClick),this.popupOption.closeOnClick&&!i&&requestAnimationFrame(function(){s==null||s.on("click",a.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 a,s=(a=this.mapsService)===null||a===void 0?void 0:a.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&&Ci(this.content),this.contentTitle=void 0,this.content=Yi("div","l7-popup-content",this.container),this.setTitle(this.popupOption.title),this.popupOption.closeButton){var a=Xh("l7-icon-guanbi");ou(a,"l7-popup-close-button"),this.content.appendChild(a),this.popupOption.closeButtonOffsets&&(a.style.right=this.popupOption.closeButtonOffsets[0]+"px",a.style.top=this.popupOption.closeButtonOffsets[1]+"px"),a.setAttribute("aria-label","Close popup"),a.addEventListener("click",function(){i.hide()}),a.addEventListener("pointerup",function(s){s.stopPropagation()}),a.addEventListener("pointerdown",function(s){s.stopPropagation()}),this.closeButton=a}else this.closeButton=void 0;this.contentPanel=Yi("div","l7-popup-content__panel",this.content)}},{key:"setPopupPosition",value:function(i,a){if(this.container){var s=this.popupOption.offsets;this.container.style.left=i+s[0]+"px",this.container.style.top=a-s[1]+"px"}}},{key:"checkUpdateOption",value:function(i,a){return a.some(function(s){return s in i})}}]),t}(Ka.EventEmitter);function nN(e){var r=U5();return function(){var n=_getPrototypeOf(e),i;if(r){var a=_getPrototypeOf(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function U5(){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 iN=ui.get,aN=null;function z5(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 a=r.body||r.getElementsByTagName("body")[0];a?a.parentNode.insertBefore(i,a):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}}z5(`.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 input[type='radio'] {
|
|
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;
|
|
}
|
|
.l7-control-swipe {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
z-index: 6;
|
|
-webkit-transform: translate(-50%, -50%);
|
|
transform: translate(-50%, -50%);
|
|
-ms-touch-action: none;
|
|
touch-action: none;
|
|
}
|
|
.l7-control-swipe_hide {
|
|
display: none;
|
|
}
|
|
.l7-control-swipe:before {
|
|
position: absolute;
|
|
top: -5000px;
|
|
bottom: -5000px;
|
|
left: 50%;
|
|
z-index: -1;
|
|
width: 4px;
|
|
background: #fff;
|
|
-webkit-transform: translate(-2px, 0);
|
|
transform: translate(-2px, 0);
|
|
content: '';
|
|
}
|
|
.l7-control-swipe.horizontal:before {
|
|
top: 50%;
|
|
right: -5000px;
|
|
bottom: auto;
|
|
left: -5000px;
|
|
width: auto;
|
|
height: 4px;
|
|
}
|
|
.l7-control-swipe__button {
|
|
display: block;
|
|
width: 28px;
|
|
height: 28px;
|
|
margin: 0;
|
|
padding: 0;
|
|
color: #595959;
|
|
font-weight: bold;
|
|
font-size: inherit;
|
|
text-align: center;
|
|
text-decoration: none;
|
|
background-color: #fff;
|
|
border: none;
|
|
border-radius: 2px;
|
|
outline: none;
|
|
}
|
|
.l7-control-swipe,
|
|
.l7-control-swipe__button {
|
|
cursor: ew-resize;
|
|
}
|
|
.l7-control-swipe.horizontal,
|
|
.l7-control-swipe.horizontal button {
|
|
cursor: ns-resize;
|
|
}
|
|
.l7-control-swipe:after,
|
|
.l7-control-swipe__button:before,
|
|
.l7-control-swipe__button:after {
|
|
position: absolute;
|
|
top: 25%;
|
|
bottom: 25%;
|
|
left: 50%;
|
|
width: 2px;
|
|
background: currentColor;
|
|
-webkit-transform: translate(-1px, 0);
|
|
transform: translate(-1px, 0);
|
|
content: '';
|
|
}
|
|
.l7-control-swipe__button:after {
|
|
-webkit-transform: translateX(4px);
|
|
transform: translateX(4px);
|
|
}
|
|
.l7-control-swipe__button:before {
|
|
-webkit-transform: translateX(-6px);
|
|
transform: translateX(-6px);
|
|
}
|
|
`);var Z5=U(79801),V5=U.n(Z5),j5=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.buffer,i=t.offset,a=t.stride,s=t.normalized,l=t.size,f=t.divisor;this.buffer=n,this.attribute={buffer:n.get(),offset:i||0,stride:a||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}(),Yh,Lm,Op,Xc,Bm,kp,Fm,Jg,ih,Cd,Pu,ah,oh,e0,H5=(Yh={},(0,F.Z)(Yh,I.POINTS,"points"),(0,F.Z)(Yh,I.LINES,"lines"),(0,F.Z)(Yh,I.LINE_LOOP,"line loop"),(0,F.Z)(Yh,I.LINE_STRIP,"line strip"),(0,F.Z)(Yh,I.TRIANGLES,"triangles"),(0,F.Z)(Yh,I.TRIANGLE_FAN,"triangle fan"),(0,F.Z)(Yh,I.TRIANGLE_STRIP,"triangle strip"),Yh),gE=(Lm={},(0,F.Z)(Lm,I.STATIC_DRAW,"static"),(0,F.Z)(Lm,I.DYNAMIC_DRAW,"dynamic"),(0,F.Z)(Lm,I.STREAM_DRAW,"stream"),Lm),Sy=(Op={},(0,F.Z)(Op,I.BYTE,"int8"),(0,F.Z)(Op,I.INT,"int32"),(0,F.Z)(Op,I.UNSIGNED_BYTE,"uint8"),(0,F.Z)(Op,I.UNSIGNED_SHORT,"uint16"),(0,F.Z)(Op,I.UNSIGNED_INT,"uint32"),(0,F.Z)(Op,I.FLOAT,"float"),Op),W5=(Xc={},(0,F.Z)(Xc,I.ALPHA,"alpha"),(0,F.Z)(Xc,I.LUMINANCE,"luminance"),(0,F.Z)(Xc,I.LUMINANCE_ALPHA,"luminance alpha"),(0,F.Z)(Xc,I.RGB,"rgb"),(0,F.Z)(Xc,I.RGBA,"rgba"),(0,F.Z)(Xc,I.RGBA4,"rgba4"),(0,F.Z)(Xc,I.RGB5_A1,"rgb5 a1"),(0,F.Z)(Xc,I.RGB565,"rgb565"),(0,F.Z)(Xc,I.DEPTH_COMPONENT,"depth"),(0,F.Z)(Xc,I.DEPTH_STENCIL,"depth stencil"),Xc),G5=(Bm={},(0,F.Z)(Bm,I.DONT_CARE,"dont care"),(0,F.Z)(Bm,I.NICEST,"nice"),(0,F.Z)(Bm,I.FASTEST,"fast"),Bm),yE=(kp={},(0,F.Z)(kp,I.NEAREST,"nearest"),(0,F.Z)(kp,I.LINEAR,"linear"),(0,F.Z)(kp,I.LINEAR_MIPMAP_LINEAR,"mipmap"),(0,F.Z)(kp,I.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),(0,F.Z)(kp,I.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),(0,F.Z)(kp,I.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),kp),_E=(Fm={},(0,F.Z)(Fm,I.REPEAT,"repeat"),(0,F.Z)(Fm,I.CLAMP_TO_EDGE,"clamp"),(0,F.Z)(Fm,I.MIRRORED_REPEAT,"mirror"),Fm),X5=(Jg={},(0,F.Z)(Jg,I.NONE,"none"),(0,F.Z)(Jg,I.BROWSER_DEFAULT_WEBGL,"browser"),Jg),$5=(ih={},(0,F.Z)(ih,I.NEVER,"never"),(0,F.Z)(ih,I.ALWAYS,"always"),(0,F.Z)(ih,I.LESS,"less"),(0,F.Z)(ih,I.LEQUAL,"lequal"),(0,F.Z)(ih,I.GREATER,"greater"),(0,F.Z)(ih,I.GEQUAL,"gequal"),(0,F.Z)(ih,I.EQUAL,"equal"),(0,F.Z)(ih,I.NOTEQUAL,"notequal"),ih),xE=(Cd={},(0,F.Z)(Cd,I.FUNC_ADD,"add"),(0,F.Z)(Cd,I.MIN_EXT,"min"),(0,F.Z)(Cd,I.MAX_EXT,"max"),(0,F.Z)(Cd,I.FUNC_SUBTRACT,"subtract"),(0,F.Z)(Cd,I.FUNC_REVERSE_SUBTRACT,"reverse subtract"),Cd),t0=(Pu={},(0,F.Z)(Pu,I.ZERO,"zero"),(0,F.Z)(Pu,I.ONE,"one"),(0,F.Z)(Pu,I.SRC_COLOR,"src color"),(0,F.Z)(Pu,I.ONE_MINUS_SRC_COLOR,"one minus src color"),(0,F.Z)(Pu,I.SRC_ALPHA,"src alpha"),(0,F.Z)(Pu,I.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),(0,F.Z)(Pu,I.DST_COLOR,"dst color"),(0,F.Z)(Pu,I.ONE_MINUS_DST_COLOR,"one minus dst color"),(0,F.Z)(Pu,I.DST_ALPHA,"dst alpha"),(0,F.Z)(Pu,I.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),(0,F.Z)(Pu,I.CONSTANT_COLOR,"constant color"),(0,F.Z)(Pu,I.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),(0,F.Z)(Pu,I.CONSTANT_ALPHA,"constant alpha"),(0,F.Z)(Pu,I.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),(0,F.Z)(Pu,I.SRC_ALPHA_SATURATE,"src alpha saturate"),Pu),Y5=(ah={},(0,F.Z)(ah,I.NEVER,"never"),(0,F.Z)(ah,I.ALWAYS,"always"),(0,F.Z)(ah,I.LESS,"less"),(0,F.Z)(ah,I.LEQUAL,"lequal"),(0,F.Z)(ah,I.GREATER,"greater"),(0,F.Z)(ah,I.GEQUAL,"gequal"),(0,F.Z)(ah,I.EQUAL,"equal"),(0,F.Z)(ah,I.NOTEQUAL,"notequal"),ah),Ev=(oh={},(0,F.Z)(oh,I.ZERO,"zero"),(0,F.Z)(oh,I.KEEP,"keep"),(0,F.Z)(oh,I.REPLACE,"replace"),(0,F.Z)(oh,I.INVERT,"invert"),(0,F.Z)(oh,I.INCR,"increment"),(0,F.Z)(oh,I.DECR,"decrement"),(0,F.Z)(oh,I.INCR_WRAP,"increment wrap"),(0,F.Z)(oh,I.DECR_WRAP,"decrement wrap"),oh),q5=(e0={},(0,F.Z)(e0,I.FRONT,"front"),(0,F.Z)(e0,I.BACK,"back"),e0),K5=function(){function e(r,t){(0,Q.Z)(this,e),(0,F.Z)(this,"isDestroyed",!1);var n=t.data,i=t.usage,a=t.type;this.buffer=r.buffer({data:n,usage:gE[i||I.STATIC_DRAW],type:Sy[a||I.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}(),Q5=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.data,i=t.usage,a=t.type,s=t.count;this.elements=r.elements({data:n,usage:gE[i||I.STATIC_DRAW],type:Sy[a||I.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}(),J5=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.width,i=t.height,a=t.color,s=t.colors,l={width:n,height:i};Array.isArray(s)&&(l.colors=s.map(function(f){return f.get()})),a&&typeof a!="boolean"&&(l.color=a.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}(),Sv=U(39696),Dp=U(58622),e4=U(39083),Pn=U(99938),bE=U(73983),Xe;(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"})(Xe||(Xe={}));var _a;(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"})(_a||(_a={}));var Ui;(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"})(Ui||(Ui={}));var Nm;(function(e){e[e.CCW=2305]="CCW",e[e.CW=2304]="CW"})(Nm||(Nm={}));var jl;(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"})(jl||(jl={}));var $i;(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"})($i||($i={}));var iu;(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"})(iu||(iu={}));var _l;(function(e){e[e.CLAMP_TO_EDGE=0]="CLAMP_TO_EDGE",e[e.REPEAT=1]="REPEAT",e[e.MIRRORED_REPEAT=2]="MIRRORED_REPEAT"})(_l||(_l={}));var rs;(function(e){e[e.POINT=0]="POINT",e[e.BILINEAR=1]="BILINEAR"})(rs||(rs={}));var $s;(function(e){e[e.NO_MIP=0]="NO_MIP",e[e.NEAREST=1]="NEAREST",e[e.LINEAR=2]="LINEAR"})($s||($s={}));var Cs;(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"})(Cs||(Cs={}));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 bf;(function(e){e[e.STATIC=1]="STATIC",e[e.DYNAMIC=2]="DYNAMIC"})(bf||(bf={}));var Rd;(function(e){e[e.VERTEX=1]="VERTEX",e[e.INSTANCE=2]="INSTANCE"})(Rd||(Rd={}));var EE;(function(e){e.LOADED="loaded"})(EE||(EE={}));var Wi;(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"})(Wi||(Wi={}));var Ou;(function(e){e[e.SAMPLED=1]="SAMPLED",e[e.RENDER_TARGET=2]="RENDER_TARGET",e[e.STORAGE=4]="STORAGE"})(Ou||(Ou={}));var au;(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"})(au||(au={}));var Go;(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"})(Go||(Go={}));function oN(e,r,t,n){var i=Wi.TEXTURE_2D,a=1,s=Ou.SAMPLED;return{dimension:i,format:e,width:r,height:t,depthOrArrayLayers:a,mipLevelCount:n,usage:s}}var Xo;(function(e){e[e.Float=0]="Float",e[e.Uint=1]="Uint",e[e.Sint=2]="Sint",e[e.Depth=3]="Depth"})(Xo||(Xo={}));var Av;(function(e){e[e.LOWER_LEFT=0]="LOWER_LEFT",e[e.UPPER_LEFT=1]="UPPER_LEFT"})(Av||(Av={}));var Tv;(function(e){e[e.NEGATIVE_ONE=0]="NEGATIVE_ONE",e[e.ZERO=1]="ZERO"})(Tv||(Tv={}));var r0;(function(e){e[e.OcclusionConservative=0]="OcclusionConservative"})(r0||(r0={}));var Pr;(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"})(Pr||(Pr={}));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 sN(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 It;(function(e){e[e.ALPHA=li(Pr.U8,Wn.A,wn.None)]="ALPHA",e[e.U8_LUMINANCE=li(Pr.U8,Wn.A,wn.Luminance)]="U8_LUMINANCE",e[e.F16_LUMINANCE=li(Pr.F16,Wn.A,wn.Luminance)]="F16_LUMINANCE",e[e.F32_LUMINANCE=li(Pr.F32,Wn.A,wn.Luminance)]="F32_LUMINANCE",e[e.F16_R=li(Pr.F16,Wn.R,wn.None)]="F16_R",e[e.F16_RG=li(Pr.F16,Wn.RG,wn.None)]="F16_RG",e[e.F16_RGB=li(Pr.F16,Wn.RGB,wn.None)]="F16_RGB",e[e.F16_RGBA=li(Pr.F16,Wn.RGBA,wn.None)]="F16_RGBA",e[e.F32_R=li(Pr.F32,Wn.R,wn.None)]="F32_R",e[e.F32_RG=li(Pr.F32,Wn.RG,wn.None)]="F32_RG",e[e.F32_RGB=li(Pr.F32,Wn.RGB,wn.None)]="F32_RGB",e[e.F32_RGBA=li(Pr.F32,Wn.RGBA,wn.None)]="F32_RGBA",e[e.U8_R=li(Pr.U8,Wn.R,wn.None)]="U8_R",e[e.U8_R_NORM=li(Pr.U8,Wn.R,wn.Normalized)]="U8_R_NORM",e[e.U8_RG=li(Pr.U8,Wn.RG,wn.None)]="U8_RG",e[e.U8_RG_NORM=li(Pr.U8,Wn.RG,wn.Normalized)]="U8_RG_NORM",e[e.U8_RGB=li(Pr.U8,Wn.RGB,wn.None)]="U8_RGB",e[e.U8_RGB_NORM=li(Pr.U8,Wn.RGB,wn.Normalized)]="U8_RGB_NORM",e[e.U8_RGB_SRGB=li(Pr.U8,Wn.RGB,wn.sRGB|wn.Normalized)]="U8_RGB_SRGB",e[e.U8_RGBA=li(Pr.U8,Wn.RGBA,wn.None)]="U8_RGBA",e[e.U8_RGBA_NORM=li(Pr.U8,Wn.RGBA,wn.Normalized)]="U8_RGBA_NORM",e[e.U8_RGBA_SRGB=li(Pr.U8,Wn.RGBA,wn.sRGB|wn.Normalized)]="U8_RGBA_SRGB",e[e.U16_R=li(Pr.U16,Wn.R,wn.None)]="U16_R",e[e.U16_R_NORM=li(Pr.U16,Wn.R,wn.Normalized)]="U16_R_NORM",e[e.U16_RG_NORM=li(Pr.U16,Wn.RG,wn.Normalized)]="U16_RG_NORM",e[e.U16_RGBA_NORM=li(Pr.U16,Wn.RGBA,wn.Normalized)]="U16_RGBA_NORM",e[e.U16_RGB=li(Pr.U16,Wn.RGB,wn.None)]="U16_RGB",e[e.U32_R=li(Pr.U32,Wn.R,wn.None)]="U32_R",e[e.U32_RG=li(Pr.U32,Wn.RG,wn.None)]="U32_RG",e[e.S8_R=li(Pr.S8,Wn.R,wn.None)]="S8_R",e[e.S8_R_NORM=li(Pr.S8,Wn.R,wn.Normalized)]="S8_R_NORM",e[e.S8_RG_NORM=li(Pr.S8,Wn.RG,wn.Normalized)]="S8_RG_NORM",e[e.S8_RGB_NORM=li(Pr.S8,Wn.RGB,wn.Normalized)]="S8_RGB_NORM",e[e.S8_RGBA_NORM=li(Pr.S8,Wn.RGBA,wn.Normalized)]="S8_RGBA_NORM",e[e.S16_R=li(Pr.S16,Wn.R,wn.None)]="S16_R",e[e.S16_RG=li(Pr.S16,Wn.RG,wn.None)]="S16_RG",e[e.S16_RG_NORM=li(Pr.S16,Wn.RG,wn.Normalized)]="S16_RG_NORM",e[e.S16_RGB_NORM=li(Pr.S16,Wn.RGB,wn.Normalized)]="S16_RGB_NORM",e[e.S16_RGBA=li(Pr.S16,Wn.RGBA,wn.None)]="S16_RGBA",e[e.S16_RGBA_NORM=li(Pr.S16,Wn.RGBA,wn.Normalized)]="S16_RGBA_NORM",e[e.S32_R=li(Pr.S32,Wn.R,wn.None)]="S32_R",e[e.U16_RGBA_5551=li(Pr.U16_PACKED_5551,Wn.RGBA,wn.Normalized)]="U16_RGBA_5551",e[e.U16_RGB_565=li(Pr.U16_PACKED_565,Wn.RGB,wn.Normalized)]="U16_RGB_565",e[e.BC1=li(Pr.BC1,Wn.RGBA,wn.Normalized)]="BC1",e[e.BC1_SRGB=li(Pr.BC1,Wn.RGBA,wn.Normalized|wn.sRGB)]="BC1_SRGB",e[e.BC2=li(Pr.BC2,Wn.RGBA,wn.Normalized)]="BC2",e[e.BC2_SRGB=li(Pr.BC2,Wn.RGBA,wn.Normalized|wn.sRGB)]="BC2_SRGB",e[e.BC3=li(Pr.BC3,Wn.RGBA,wn.Normalized)]="BC3",e[e.BC3_SRGB=li(Pr.BC3,Wn.RGBA,wn.Normalized|wn.sRGB)]="BC3_SRGB",e[e.BC4_UNORM=li(Pr.BC4_UNORM,Wn.R,wn.Normalized)]="BC4_UNORM",e[e.BC4_SNORM=li(Pr.BC4_SNORM,Wn.R,wn.Normalized)]="BC4_SNORM",e[e.BC5_UNORM=li(Pr.BC5_UNORM,Wn.RG,wn.Normalized)]="BC5_UNORM",e[e.BC5_SNORM=li(Pr.BC5_SNORM,Wn.RG,wn.Normalized)]="BC5_SNORM",e[e.D24=li(Pr.D24,Wn.R,wn.Depth)]="D24",e[e.D24_S8=li(Pr.D24S8,Wn.RG,wn.Depth|wn.Stencil)]="D24_S8",e[e.D32F=li(Pr.D32F,Wn.R,wn.Depth)]="D32F",e[e.D32F_S8=li(Pr.D32FS8,Wn.RG,wn.Depth|wn.Stencil)]="D32F_S8",e[e.U8_RGB_RT=li(Pr.U8,Wn.RGB,wn.RenderTarget|wn.Normalized)]="U8_RGB_RT",e[e.U8_RGBA_RT=li(Pr.U8,Wn.RGBA,wn.RenderTarget|wn.Normalized)]="U8_RGBA_RT",e[e.U8_RGBA_RT_SRGB=li(Pr.U8,Wn.RGBA,wn.RenderTarget|wn.Normalized|wn.sRGB)]="U8_RGBA_RT_SRGB"})(It||(It={}));function n0(e){return e>>>8&255}function sh(e){return e>>>16&255}function wv(e){return e&255}function SE(e){switch(e){case Pr.F32:case Pr.U32:case Pr.S32:return 4;case Pr.U16:case Pr.S16:case Pr.F16:return 2;case Pr.U8:case Pr.S8:return 1;default:throw new Error("whoops")}}function AE(e){return SE(sh(e))}function uN(e){return n0(e)}function t4(e){var r=SE(sh(e)),t=n0(e);return r*t}function lN(e,r){return e&4294967040|r}function cN(e,r){return e&4294902015|r<<8}function TE(e){var r=wv(e);if(r&wn.Depth)return Xo.Depth;if(r&wn.Normalized)return Xo.Float;var t=sh(e);if(t===Pr.F16||t===Pr.F32)return Xo.Float;if(t===Pr.U8||t===Pr.U16||t===Pr.U32)return Xo.Uint;if(t===Pr.S8||t===Pr.S16||t===Pr.S32)return Xo.Sint;throw new Error("whoops")}function Oi(e,r){if(r===void 0&&(r=""),!e)throw new Error("Assert fail: ".concat(r))}function Md(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 Um(e,r,t,n){return n===void 0&&(n=1),{r:e,g:r,b:t,a:n}}var Ay=Um(0,0,0,0),fN=Um(0,0,0,1),r4=Um(1,1,1,0),hN=Um(1,1,1,1),Cv=!0;function pN(e,r){r===void 0&&(r=Cv),r&&(e[10]=-e[10],e[14]=-e[14])}function dN(e,r){r===void 0&&(r=Cv),r&&(e[10]=-e[10],e[14]=-e[14]+1)}function n4(e,r){if(r===void 0&&(r=Cv),r)switch(e){case Ui.LESS:return Ui.GREATER;case Ui.LEQUAL:return Ui.GEQUAL;case Ui.GEQUAL:return Ui.LEQUAL;case Ui.GREATER:return Ui.LESS;default:return e}else return e}function vN(e,r){return r===void 0&&(r=Cv),r?1-e:e}function mN(e,r){return r===void 0&&(r=Cv),r?-e:e}function gN(e,r,t,n){if(n===void 0&&(n=Cv),t=n4(t,n),t===Ui.LESS)return e<r;if(t===Ui.LEQUAL)return e<=r;if(t===Ui.GREATER)return e>r;if(t===Ui.GEQUAL)return e>=r;throw new Error("whoops")}function i0(e){return!!(e&&!(e&e-1))}function Rv(e,r){return e!=null?e:r}function i4(e){return e===void 0?null:e}function yN(e,r,t){e.length=r,e.fill(t)}function a0(e,r){var t=r-1;return e+t&~t}function _N(e,r){return((e+r-1)/r|0)*r}function a4(e,r,t){for(var n=0,i=e.length;n<i;){var a=n+(i-n>>>1),s=t(r,e[a]);s<0?i=a:n=a+1}return n}function xN(e,r,t){var n=a4(e,r,t);e.splice(n,0,r)}function bN(e,r,t){return t?e|=r:e&=~r,e}function o4(e,r){for(var t=new Array(e),n=0;n<e;n++)t[n]=r();return t}function s4(e,r){r===void 0&&(r=1);var t=e.split(`
|
|
`);return t.map(function(n,i){return"".concat(u4(""+(r+i),4," ")," ").concat(n)}).join(`
|
|
`)}function u4(e,r,t){for(t===void 0&&(t="0");e.length<r;)e="".concat(t).concat(e);return e}function EN(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 o0(e,r){return e===void 0&&(e={}),e.compare=r.compare,e.depthFailOp=r.depthFailOp,e.passOp=r.passOp,e.failOp=r.failOp,e.mask=r.mask,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 Ty(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 l4(e,r){r.attachmentsState!==void 0&&Ty(e.attachmentsState,r.attachmentsState),e.blendConstant&&r.blendConstant&&CE(e.blendConstant,r.blendConstant),e.depthCompare=Rv(r.depthCompare,e.depthCompare),e.depthWrite=Rv(r.depthWrite,e.depthWrite),e.stencilWrite=Rv(r.stencilWrite,e.stencilWrite),e.stencilFront&&r.stencilFront&&o0(e.stencilFront,r.stencilFront),e.stencilBack&&r.stencilBack&&o0(e.stencilBack,r.stencilBack),e.cullMode=Rv(r.cullMode,e.cullMode),e.frontFace=Rv(r.frontFace,e.frontFace),e.polygonOffset=Rv(r.polygonOffset,e.polygonOffset)}function Mv(e){var r=Object.assign({},e);return r.attachmentsState=[],Ty(r.attachmentsState,e.attachmentsState),r.blendConstant=r.blendConstant&&RE(r.blendConstant),r.stencilFront=o0(void 0,e.stencilFront),r.stencilBack=o0(void 0,e.stencilBack),r}function c4(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:iu.ADD,blendSrcFactor:$i.ONE,blendDstFactor:$i.ZERO},Id={attachmentsState:[{channelWriteMask:au.ALL,rgbBlendState:PE,alphaBlendState:PE}],blendConstant:RE(Ay),depthWrite:!0,depthCompare:Ui.LEQUAL,stencilWrite:!1,stencilFront:{compare:Ui.ALWAYS,passOp:Go.KEEP,depthFailOp:Go.KEEP,failOp:Go.KEEP,mask:255},stencilBack:{compare:Ui.ALWAYS,passOp:Go.KEEP,depthFailOp:Go.KEEP,failOp:Go.KEEP,mask:255},cullMode:jl.NONE,frontFace:Nm.CCW,polygonOffset:!1};function f4(e,r){e===void 0&&(e=null),r===void 0&&(r=Id);var t=Mv(r);return e!==null&&l4(t,e),t}var SN=f4({depthCompare:Ui.ALWAYS,depthWrite:!1},Id);function AN(e,r){return e.attachmentsState===void 0&&(e.attachmentsState=[],Ty(e.attachmentsState,Id.attachmentsState)),c4(e.attachmentsState[0],r),e}var OE={texture:null,sampler:null,formatKind:Xo.Float,dimension:Wi.TEXTURE_2D};function Lp(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 Iv(e,r){for(var t=Array(e.length),n=0;n<e.length;n++)t[n]=r(e[n]);return t}function h4(e,r){return e.texture===r.texture&&e.binding===r.binding}function kE(e,r){return e.buffer===r.buffer&&e.size===r.size&&e.binding===r.binding&&e.offset===r.offset}function p4(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 TN(e,r){return e.samplerBindings=e.samplerBindings||[],e.uniformBufferBindings=e.uniformBufferBindings||[],e.storageBufferBindings=e.storageBufferBindings||[],e.storageTextureBindings=e.storageTextureBindings||[],r.samplerBindings=r.samplerBindings||[],r.uniformBufferBindings=r.uniformBufferBindings||[],r.storageBufferBindings=r.storageBufferBindings||[],r.storageTextureBindings=r.storageTextureBindings||[],!(e.samplerBindings.length!==r.samplerBindings.length||!Lp(e.samplerBindings,r.samplerBindings,p4)||!Lp(e.uniformBufferBindings,r.uniformBufferBindings,kE)||!Lp(e.storageBufferBindings,r.storageBufferBindings,kE)||!Lp(e.storageTextureBindings,r.storageTextureBindings,h4))}function DE(e,r){return e.blendMode==r.blendMode&&e.blendSrcFactor===r.blendSrcFactor&&e.blendDstFactor===r.blendDstFactor}function d4(e,r){return!(!DE(e.rgbBlendState,r.rgbBlendState)||!DE(e.alphaBlendState,r.alphaBlendState)||e.channelWriteMask!==r.channelWriteMask)}function s0(e,r){return e.compare==r.compare&&e.depthFailOp===r.depthFailOp&&e.failOp===r.failOp&&e.passOp===r.passOp&&e.mask===r.mask}function v4(e,r){return!Lp(e.attachmentsState,r.attachmentsState,d4)||e.blendConstant&&r.blendConstant&&!wE(e.blendConstant,r.blendConstant)||e.stencilFront&&r.stencilFront&&!s0(e.stencilFront,r.stencilFront)||e.stencilBack&&r.stencilBack&&!s0(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 LE(e,r){return e.id===r.id}function m4(e,r){return e===r}function wN(e,r){return!(e.topology!==r.topology||e.inputLayout!==r.inputLayout||e.sampleCount!==r.sampleCount||e.megaStateDescriptor&&r.megaStateDescriptor&&!v4(e.megaStateDescriptor,r.megaStateDescriptor)||!LE(e.program,r.program)||!Lp(e.colorAttachmentFormats,r.colorAttachmentFormats,m4)||e.depthStencilAttachmentFormat!==r.depthStencilAttachmentFormat)}function g4(e,r){return e.offset===r.offset&&e.shaderLocation===r.shaderLocation&&e.format===r.format&&e.divisor===r.divisor}function y4(e,r){return isNil(e)?isNil(r):isNil(r)?!1:e.arrayStride===r.arrayStride&&e.stepMode===r.stepMode&&Lp(e.attributes,r.attributes,g4)}function CN(e,r){return!(e.indexBufferFormat!==r.indexBufferFormat||!Lp(e.vertexBufferDescriptors,r.vertexBufferDescriptors,y4)||!LE(e.program,r.program))}function RN(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 _4(e){var r=e.sampler,t=e.texture,n=e.dimension,i=e.formatKind,a=e.comparison;return{sampler:r,texture:t,dimension:n,formatKind:i,comparison:a}}function BE(e){var r=e.buffer,t=e.size,n=e.binding,i=e.offset;return{binding:n,buffer:r,offset:i,size:t}}function x4(e){var r=e.binding,t=e.texture;return{binding:r,texture:t}}function MN(e){var r=e.samplerBindings&&Iv(e.samplerBindings,_4),t=e.uniformBufferBindings&&Iv(e.uniformBufferBindings,BE),n=e.storageBufferBindings&&Iv(e.storageBufferBindings,BE),i=e.storageTextureBindings&&Iv(e.storageTextureBindings,x4);return{samplerBindings:r,uniformBufferBindings:t,storageBufferBindings:n,storageTextureBindings:i,pipeline:e.pipeline}}function IN(e){var r=e.inputLayout,t=e.program,n=e.topology,i=e.megaStateDescriptor&&Mv(e.megaStateDescriptor),a=e.colorAttachmentFormats.slice(),s=e.depthStencilAttachmentFormat,l=e.sampleCount;return{inputLayout:r,megaStateDescriptor:i,program:t,topology:n,colorAttachmentFormats:a,depthStencilAttachmentFormat:s,sampleCount:l}}function b4(e){var r=e.shaderLocation,t=e.format,n=e.offset,i=e.divisor;return{shaderLocation:r,format:t,offset:n,divisor:i}}function E4(e){if(isNil(e))return e;var r=e.arrayStride,t=e.stepMode,n=Iv(e.attributes,b4);return{arrayStride:r,stepMode:t,attributes:n}}function PN(e){var r=Iv(e.vertexBufferDescriptors,E4),t=e.indexBufferFormat,n=e.program;return{vertexBufferDescriptors:r,indexBufferFormat:t,program:n}}var ra,S4=/([^[]*)(\[[0-9]+\])?/;function A4(e){if(e[e.length-1]!=="]")return{name:e,length:1,isArray:!1};var r=e.match(S4);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 xl(){var e=null;return function(r,t,n){var i=e!==n;return i&&(r.uniform1i(t,n),e=n),i}}function $o(e,r,t,n){var i=null,a=null;return function(s,l,f){var d=r(f,t),_=d.length,b=!1;if(i===null)i=new Float32Array(_),a=_,b=!0;else{Oi(a===_,"Uniform length cannot change.");for(var T=0;T<_;++T)if(d[T]!==i[T]){b=!0;break}}return b&&(n(s,e,l,d),i.set(d)),b}}function Qu(e,r,t,n){e[r](t,n)}function qh(e,r,t,n){e[r](t,!1,n)}var T4={},w4={},C4={},FE=[0];function wy(e,r,t,n){r===1&&typeof e=="boolean"&&(e=e?1:0),Number.isFinite(e)&&(FE[0]=e,e=FE);var i=e.length;if(e instanceof t)return e;var a=n[i];a||(a=new t(i),n[i]=a);for(var s=0;s<i;s++)a[s]=e[s];return a}function vc(e,r){return wy(e,r,Float32Array,T4)}function Bp(e,r){return wy(e,r,Int32Array,w4)}function u0(e,r){return wy(e,r,Uint32Array,C4)}var R4=(ra={},ra[Xe.FLOAT]=$o.bind(null,"uniform1fv",vc,1,Qu),ra[Xe.FLOAT_VEC2]=$o.bind(null,"uniform2fv",vc,2,Qu),ra[Xe.FLOAT_VEC3]=$o.bind(null,"uniform3fv",vc,3,Qu),ra[Xe.FLOAT_VEC4]=$o.bind(null,"uniform4fv",vc,4,Qu),ra[Xe.INT]=$o.bind(null,"uniform1iv",Bp,1,Qu),ra[Xe.INT_VEC2]=$o.bind(null,"uniform2iv",Bp,2,Qu),ra[Xe.INT_VEC3]=$o.bind(null,"uniform3iv",Bp,3,Qu),ra[Xe.INT_VEC4]=$o.bind(null,"uniform4iv",Bp,4,Qu),ra[Xe.BOOL]=$o.bind(null,"uniform1iv",Bp,1,Qu),ra[Xe.BOOL_VEC2]=$o.bind(null,"uniform2iv",Bp,2,Qu),ra[Xe.BOOL_VEC3]=$o.bind(null,"uniform3iv",Bp,3,Qu),ra[Xe.BOOL_VEC4]=$o.bind(null,"uniform4iv",Bp,4,Qu),ra[Xe.FLOAT_MAT2]=$o.bind(null,"uniformMatrix2fv",vc,4,qh),ra[Xe.FLOAT_MAT3]=$o.bind(null,"uniformMatrix3fv",vc,9,qh),ra[Xe.FLOAT_MAT4]=$o.bind(null,"uniformMatrix4fv",vc,16,qh),ra[Xe.UNSIGNED_INT]=$o.bind(null,"uniform1uiv",u0,1,Qu),ra[Xe.UNSIGNED_INT_VEC2]=$o.bind(null,"uniform2uiv",u0,2,Qu),ra[Xe.UNSIGNED_INT_VEC3]=$o.bind(null,"uniform3uiv",u0,3,Qu),ra[Xe.UNSIGNED_INT_VEC4]=$o.bind(null,"uniform4uiv",u0,4,Qu),ra[Xe.FLOAT_MAT2x3]=$o.bind(null,"uniformMatrix2x3fv",vc,6,qh),ra[Xe.FLOAT_MAT2x4]=$o.bind(null,"uniformMatrix2x4fv",vc,8,qh),ra[Xe.FLOAT_MAT3x2]=$o.bind(null,"uniformMatrix3x2fv",vc,6,qh),ra[Xe.FLOAT_MAT3x4]=$o.bind(null,"uniformMatrix3x4fv",vc,12,qh),ra[Xe.FLOAT_MAT4x2]=$o.bind(null,"uniformMatrix4x2fv",vc,8,qh),ra[Xe.FLOAT_MAT4x3]=$o.bind(null,"uniformMatrix4x3fv",vc,12,qh),ra[Xe.SAMPLER_2D]=xl,ra[Xe.SAMPLER_CUBE]=xl,ra[Xe.SAMPLER_3D]=xl,ra[Xe.SAMPLER_2D_SHADOW]=xl,ra[Xe.SAMPLER_2D_ARRAY]=xl,ra[Xe.SAMPLER_2D_ARRAY_SHADOW]=xl,ra[Xe.SAMPLER_CUBE_SHADOW]=xl,ra[Xe.INT_SAMPLER_2D]=xl,ra[Xe.INT_SAMPLER_3D]=xl,ra[Xe.INT_SAMPLER_CUBE]=xl,ra[Xe.INT_SAMPLER_2D_ARRAY]=xl,ra[Xe.UNSIGNED_INT_SAMPLER_2D]=xl,ra[Xe.UNSIGNED_INT_SAMPLER_3D]=xl,ra[Xe.UNSIGNED_INT_SAMPLER_CUBE]=xl,ra[Xe.UNSIGNED_INT_SAMPLER_2D_ARRAY]=xl,ra);function NE(e,r,t){var n=R4[t.type];if(!n)throw new Error("Unknown GLSL uniform type ".concat(t.type));return n().bind(null,e,r)}var M4={"[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 I4(e){return Object.prototype.toString.call(e)in M4}function zm(e,r){return"#define ".concat(e," ").concat(r)}function P4(e){var r={};return e.replace(/^\s*#define\s*(\S*)\s*(\S*)\s*$/gm,function(t,n,i){var a=Number(i);return r[n]=isNaN(a)?i:a,""}),r}function O4(e,r){var t=[];return e.replace(/^\s*layout\(location\s*=\s*(\S*)\)\s*in\s+\S+\s*(.*);$/gm,function(n,i,a){var s=Number(i);return t.push({location:isNaN(s)?r[i]:s,name:a}),""}),t}function ON(e){var r=[],t=[];return e.replace(/\s*struct\s*(.*)\s*{((?:\s*.*\s*)*?)};/g,function(n,i,a){var s=[];return a.trim().replace(`\r
|
|
`,`
|
|
`).split(`
|
|
`).forEach(function(l){var f=__read(l.trim().split(/\s+/),2),d=f[0],_=f[1];s.push({type:d.trim(),name:_.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(a){var s=a.trim().split(" "),l=s[0]||"",f=s[1]||"",d=f.indexOf("[")>-1;if(f=f.replace(";","").replace("[","").trim(),!l.startsWith("#")){if(l){var _=t.find(function(M){return l===M.type});if(_)if(d)for(var b=function(M){_.uniforms.forEach(function(P){r.push("".concat(f,"[").concat(M,"].").concat(P.name))})},T=0;T<5;T++)b(T);else _.uniforms.forEach(function(M){r.push("".concat(f,".").concat(M.name))})}f&&r.push(f)}}),""}),r}function UE(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 k4(e){var r="",t=e;return[t,r]}function Fp(e,r,t,n,i){var a;n===void 0&&(n=null),i===void 0&&(i=!0);var s=e.glslVersion==="#version 100",l=r==="frag"&&((a=t.match(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm))===null||a===void 0?void 0:a.length)>1,f=t.replace(`\r
|
|
`,`
|
|
`).split(`
|
|
`).map(function(st){return st.replace(/[/][/].*$/,"")}).filter(function(st){var at=!st||/^\s+$/.test(st);return!at}),d="";n!==null&&(d=Object.keys(n).map(function(st){return zm(st,n[st])}).join(`
|
|
`));var _=f.find(function(st){return st.startsWith("precision")})||"precision mediump float;",b=i?f.filter(function(st){return!st.startsWith("precision")}).join(`
|
|
`):f.join(`
|
|
`),T="";if(e.viewportOrigin===Av.UPPER_LEFT&&(T+="".concat(zm("VIEWPORT_ORIGIN_TL","1"),`
|
|
`)),e.clipSpaceNearZ===Tv.ZERO&&(T+="".concat(zm("CLIPSPACE_NEAR_ZERO","1"),`
|
|
`)),e.explicitBindingLocations){var M=0,P=0,D=0;b=b.replace(/^\s*(layout\((.*)\))?\s*uniform(.+{)$/gm,function(st,at,At,Wt){var Sr=At?"".concat(At,", "):"";return"layout(".concat(Sr,"set = ").concat(M,", binding = ").concat(P++,") uniform ").concat(Wt)}),M++,P=0,Oi(e.separateSamplerTextures),b=b.replace(/^\s*(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(st,at,At,Wt,Sr){var _r=UE(At);_r===null&&(_r=P++);var Gr=(0,Pn.CR)(k4(Wt),2),Cn=Gr[0],wi=Gr[1];return r==="frag"?`
|
|
layout(set = `.concat(M,", binding = ").concat(_r*2+0,") uniform texture").concat(Cn," T_").concat(Sr,`;
|
|
layout(set = `).concat(M,", binding = ").concat(_r*2+1,") uniform sampler").concat(wi," S_").concat(Sr,";").trim():""}),b=b.replace(r==="frag"?/^\s*\b(varying|in)\b/gm:/^\s*\b(varying|out)\b/gm,function(st,at){return"layout(location = ".concat(D++,") ").concat(at)}),T+="".concat(zm("gl_VertexID","gl_VertexIndex"),`
|
|
`),T+="".concat(zm("gl_InstanceID","gl_InstanceIndex"),`
|
|
`),_=_.replace(/^precision (.*) sampler(.*);$/gm,"")}else{var G=0;b=b.replace(/^\s*(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,function(st,at,At,Wt,Sr){var _r=UE(At);return _r===null&&(_r=G++),"uniform sampler".concat(Wt," ").concat(Sr,"; // BINDING=").concat(_r)})}if(e.separateSamplerTextures)b=b.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(st,at,At){return"sampler".concat(at,"(T_").concat(At,", S_").concat(At,")")}),b=b.replace(/\bTEXTURE\((.*?)\)/g,function(st,at){return"T_".concat(at)});else{var q=[];b=b.replace(/\bSAMPLER_(\w+)\((.*?)\)/g,function(st,at,At){return q.push([At,at]),At}),s&&q.forEach(function(st){var at=(0,Pn.CR)(st,2),At=at[0],Wt=at[1];b=b.replace(new RegExp("texture\\(".concat(At),"g"),function(){return"texture".concat(Wt,"(").concat(At)})}),b=b.replace(/\bTEXTURE\((.*?)\)/g,function(st,at){return at})}var se="".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?_:"",`
|
|
`).concat(T||"").concat(d?d+`
|
|
`:"",`
|
|
`).concat(b,`
|
|
`).trim();if(e.explicitBindingLocations&&r==="frag"&&(se=se.replace(/^\b(out)\b/g,function(st,at){return"layout(location = 0) ".concat(at)})),s){if(r==="frag"&&(se=se.replace(/^\s*in\s+(\S+)\s*(.*);$/gm,function(st,at,At){return"varying ".concat(at," ").concat(At,`;
|
|
`)})),r==="vert"&&(se=se.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(st,at,At){return"varying ".concat(at," ").concat(At,`;
|
|
`)}),se=se.replace(/^\s*layout\(location\s*=\s*\S*\)\s*in\s+(\S+)\s*(.*);$/gm,function(st,at,At){return"attribute ".concat(at," ").concat(At,`;
|
|
`)})),se=se.replace(/\s*uniform\s*.*\s*{((?:\s*.*\s*)*?)};/g,function(st,at){return at.trim().replace(/^.*$/gm,function(At){var Wt=At.trim();return Wt.startsWith("#")?Wt:At?"uniform ".concat(Wt):""})}),r==="frag")if(l){var Se=[];se=se.replace(/^\s*layout\(location\s*=\s*\d*\)\s*out\s+vec4\s*(.*);$/gm,function(st,at){return Se.push(at),"vec4 ".concat(at,`;
|
|
`)});var Ve=se.lastIndexOf("}");se=se.substring(0,Ve)+`
|
|
`.concat(Se.map(function(st,at){return"gl_FragData[".concat(at,"] = ").concat(st,`;
|
|
`)}).join(`
|
|
`))+se.substring(Ve)}else{var nt;if(se=se.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,function(st,at,At){return nt=At,"".concat(at," ").concat(At,`;
|
|
`)}),nt){var Ve=se.lastIndexOf("}");se=se.substring(0,Ve)+`
|
|
gl_FragColor = vec4(`.concat(nt,`);
|
|
`)+se.substring(Ve)}}se=se.replace(/^\s*layout\((.*)\)/gm,"")}return se}function kN(e,r,t,n){n===void 0&&(n=null);var i=Fp(e,"vert",r,n),a=Fp(e,"frag",t,n);return{vert:r,frag:t,preprocessedVert:i,preprocessedFrag:a}}var Ef=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=e.call(this)||this;return a.id=n,a.device=i,a.device.resourceCreationTracker!==null&&a.device.resourceCreationTracker.trackResourceCreated(a),a}return r.prototype.destroy=function(){this.device.resourceCreationTracker!==null&&this.device.resourceCreationTracker.trackResourceDestroyed(this)},r}(bE.Z),D4=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=_a.Bindings;var l=a.uniformBufferBindings,f=a.samplerBindings;return s.uniformBufferBindings=l||[],s.samplerBindings=f||[],s.bindingLayouts=s.createBindingLayouts(),s}return r.prototype.createBindingLayouts=function(){var t=0,n=0,i=[],a=this.uniformBufferBindings.length,s=this.samplerBindings.length;return i.push({firstUniformBuffer:t,numUniformBuffers:a,firstSampler:n,numSamplers:s}),t+=a,n+=s,{numUniformBuffers:t,numSamplers:n,bindingLayoutTables:i}},r}(Ef);function Vn(e){return typeof WebGL2RenderingContext!="undefined"&&e instanceof WebGL2RenderingContext?!0:!!(e&&e._version===2)}function zE(e){var r=sh(e);switch(r){case Pr.BC1:case Pr.BC2:case Pr.BC3:case Pr.BC4_UNORM:case Pr.BC4_SNORM:case Pr.BC5_UNORM:case Pr.BC5_SNORM:return!0;default:return!1}}function ZE(e){var r=wv(e);if(r&wn.Normalized)return!1;var t=sh(e);return t===Pr.S8||t===Pr.S16||t===Pr.S32||t===Pr.U8||t===Pr.U16||t===Pr.U32}function L4(e){switch(e){case bf.STATIC:return Xe.STATIC_DRAW;case bf.DYNAMIC:return Xe.DYNAMIC_DRAW}}function VE(e){if(e&no.INDEX)return Xe.ELEMENT_ARRAY_BUFFER;if(e&no.VERTEX)return Xe.ARRAY_BUFFER;if(e&no.UNIFORM)return Xe.UNIFORM_BUFFER}function B4(e){switch(e){case Cs.TRIANGLES:return Xe.TRIANGLES;case Cs.POINTS:return Xe.POINTS;case Cs.TRIANGLE_STRIP:return Xe.TRIANGLE_STRIP;case Cs.LINES:return Xe.LINES;case Cs.LINE_STRIP:return Xe.LINE_STRIP;default:throw new Error("Unknown primitive topology mode")}}function F4(e){switch(e){case Pr.U8:return Xe.UNSIGNED_BYTE;case Pr.U16:return Xe.UNSIGNED_SHORT;case Pr.U32:return Xe.UNSIGNED_INT;case Pr.S8:return Xe.BYTE;case Pr.S16:return Xe.SHORT;case Pr.S32:return Xe.INT;case Pr.F16:return Xe.HALF_FLOAT;case Pr.F32:return Xe.FLOAT;default:throw new Error("whoops")}}function N4(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 U4(e){var r=sh(e),t=n0(e),n=wv(e),i=F4(r),a=N4(t),s=!!(n&wn.Normalized);return{size:a,type:i,normalized:s}}function z4(e){switch(e){case It.U8_R:return Xe.UNSIGNED_BYTE;case It.U16_R:return Xe.UNSIGNED_SHORT;case It.U32_R:return Xe.UNSIGNED_INT;default:throw new Error("whoops")}}function Zm(e){switch(e){case _l.CLAMP_TO_EDGE:return Xe.CLAMP_TO_EDGE;case _l.REPEAT:return Xe.REPEAT;case _l.MIRRORED_REPEAT:return Xe.MIRRORED_REPEAT;default:throw new Error("whoops")}}function l0(e,r){if(r===$s.LINEAR&&e===rs.BILINEAR)return Xe.LINEAR_MIPMAP_LINEAR;if(r===$s.LINEAR&&e===rs.POINT)return Xe.NEAREST_MIPMAP_LINEAR;if(r===$s.NEAREST&&e===rs.BILINEAR)return Xe.LINEAR_MIPMAP_NEAREST;if(r===$s.NEAREST&&e===rs.POINT)return Xe.NEAREST_MIPMAP_NEAREST;if(r===$s.NO_MIP&&e===rs.BILINEAR)return Xe.LINEAR;if(r===$s.NO_MIP&&e===rs.POINT)return Xe.NEAREST;throw new Error("Unknown texture filter mode")}function Pv(e,r){r===void 0&&(r=0);var t=e;return t.gl_buffer_pages[r/t.pageByteSize|0]}function Ov(e){var r=e;return r.gl_texture}function Cy(e){var r=e;return r.gl_sampler}function Vm(e,r){e.name=r,e.__SPECTOR_Metadata={name:r}}function jE(e,r){for(var t=[];;){var n=r.exec(e);if(!n)break;t.push(n)}return t}function Np(e){return e.blendMode==iu.ADD&&e.blendSrcFactor==$i.ONE&&e.blendDstFactor===$i.ZERO}function Z4(e){switch(e){case r0.OcclusionConservative:return Xe.ANY_SAMPLES_PASSED_CONSERVATIVE;default:throw new Error("whoops")}}function V4(e){if(e===Wi.TEXTURE_2D)return Xe.TEXTURE_2D;if(e===Wi.TEXTURE_2D_ARRAY)return Xe.TEXTURE_2D_ARRAY;if(e===Wi.TEXTURE_CUBE_MAP)return Xe.TEXTURE_CUBE_MAP;if(e===Wi.TEXTURE_3D)return Xe.TEXTURE_3D;throw new Error("whoops")}function Ry(e,r,t,n){return!(e%t!==0||r%n!==0)}var j4=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=_a.Buffer;var l=a.viewOrSize,f=a.usage,d=a.hint,_=d===void 0?bf.STATIC:d,b=i.uniformBufferMaxPageByteSize,T=i.gl,M=f&no.UNIFORM;M||(Vn(T)?T.bindVertexArray(null):i.OES_vertex_array_object.bindVertexArrayOES(null));var P=(0,Sv.Z)(l)?a0(l,4):a0(l.byteLength,4);s.gl_buffer_pages=[];var D;if(M){for(var G=P;G>0;)s.gl_buffer_pages.push(s.createBufferPage(Math.min(G,b),f,_)),G-=b;D=b}else s.gl_buffer_pages.push(s.createBufferPage(P,f,_)),D=P;return s.pageByteSize=D,s.byteSize=P,s.usage=f,s.gl_target=VE(f),(0,Sv.Z)(l)||s.setSubData(0,new Uint8Array(l.buffer)),M||(Vn(T)?T.bindVertexArray(s.device.currentBoundVAO):i.OES_vertex_array_object.bindVertexArrayOES(s.device.currentBoundVAO)),s}return r.prototype.setSubData=function(t,n,i,a){i===void 0&&(i=0),a===void 0&&(a=n.byteLength-i);for(var s=this.device.gl,l=this.pageByteSize,f=t+a,d=t,_=t%l;d<f;){var b=Vn(s)?s.COPY_WRITE_BUFFER:this.gl_target,T=Pv(this,d);if(T.ubo)return;s.bindBuffer(b,T),Vn(s)?s.bufferSubData(b,_,n,i,Math.min(f-d,l)):s.bufferSubData(b,_,n),d+=l,_=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 a=this.device.gl,s=n&no.UNIFORM;if(!Vn(a)&&s)return{ubo:!0};var l=this.device.ensureResourceExists(a.createBuffer()),f=VE(n),d=L4(i);return a.bindBuffer(f,l),a.bufferData(f,t,d),l},r}(Ef),H4=function(e){(0,Pn.ZT)(r,e);function r(t){var n,i,a,s,l=t.id,f=t.device,d=t.descriptor,_,b=e.call(this,{id:l,device:f})||this;b.type=_a.InputLayout;var T=d.vertexBufferDescriptors,M=d.indexBufferFormat,P=d.program;Oi(M===It.U16_R||M===It.U32_R||M===null);var D=M!==null?z4(M):null,G=M!==null?AE(M):null,q=b.device.gl,se=b.device.ensureResourceExists(Vn(q)?q.createVertexArray():f.OES_vertex_array_object.createVertexArrayOES());Vn(q)?q.bindVertexArray(se):f.OES_vertex_array_object.bindVertexArrayOES(se),q.bindBuffer(q.ARRAY_BUFFER,Pv(b.device.fallbackVertexBuffer));try{for(var Se=(0,Pn.XA)(d.vertexBufferDescriptors),Ve=Se.next();!Ve.done;Ve=Se.next()){var nt=Ve.value,st=nt.stepMode,at=nt.attributes;try{for(var At=(a=void 0,(0,Pn.XA)(at)),Wt=At.next();!Wt.done;Wt=At.next()){var Sr=Wt.value,_r=Sr.shaderLocation,Gr=Sr.format,Cn=Sr.divisor,wi=Cn===void 0?1:Cn,la=Vn(q)?_r:(_=P.attributes[_r])===null||_===void 0?void 0:_.location,co=U4(Gr);if(Sr.vertexFormat=co,!(0,Dp.Z)(la)){ZE(Gr);var Yo=co.size,Uo=co.type,qs=co.normalized;q.vertexAttribPointer(la,Yo,Uo,qs,0,0),st===Rd.INSTANCE&&(Vn(q)?q.vertexAttribDivisor(la,wi):f.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(la,wi)),q.enableVertexAttribArray(la)}}}catch(bl){a={error:bl}}finally{try{Wt&&!Wt.done&&(s=At.return)&&s.call(At)}finally{if(a)throw a.error}}}}catch(bl){n={error:bl}}finally{try{Ve&&!Ve.done&&(i=Se.return)&&i.call(Se)}finally{if(n)throw n.error}}return Vn(q)?q.bindVertexArray(null):f.OES_vertex_array_object.bindVertexArrayOES(null),b.vertexBufferDescriptors=T,b.vao=se,b.indexBufferFormat=M,b.indexBufferType=D,b.indexBufferCompByteSize=G,b.program=P,b}return r.prototype.destroy=function(){e.prototype.destroy.call(this),this.device.currentBoundVAO===this.vao&&(Vn(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}(Ef),My=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=t.fake,l=e.call(this,{id:n,device:i})||this;l.type=_a.Texture,a=(0,Pn.pi)({dimension:Wi.TEXTURE_2D,depthOrArrayLayers:1,mipLevelCount:1},a);var f=l.device.gl,d,_,b=l.clampmipLevelCount(a);if(l.immutable=a.usage===Ou.RENDER_TARGET,l.pixelStore=a.pixelStore,l.format=a.format,l.dimension=a.dimension,l.formatKind=TE(a.format),l.width=a.width,l.height=a.height,l.depthOrArrayLayers=a.depthOrArrayLayers,l.mipmaps=b>=1,!s){_=l.device.ensureResourceExists(f.createTexture());var T=l.device.translateTextureType(a.format),M=l.device.translateTextureInternalFormat(a.format);if(l.device.setActiveTexture(f.TEXTURE0),l.device.currentTextures[0]=null,l.preprocessImage(),a.dimension===Wi.TEXTURE_2D){if(d=Xe.TEXTURE_2D,f.bindTexture(d,_),l.immutable)if(Vn(f))f.texStorage2D(d,b,M,a.width,a.height);else{var P=(M===Xe.DEPTH_COMPONENT||l.isNPOT(),0);(l.format===It.D32F||l.format===It.D24_S8)&&!Vn(f)&&!i.WEBGL_depth_texture||(f.texImage2D(d,P,M,a.width,a.height,0,M,T,null),l.mipmaps&&(l.mipmaps=!1,f.texParameteri(Xe.TEXTURE_2D,Xe.TEXTURE_MIN_FILTER,Xe.LINEAR),f.texParameteri(Xe.TEXTURE_2D,Xe.TEXTURE_WRAP_S,Xe.CLAMP_TO_EDGE),f.texParameteri(Xe.TEXTURE_2D,Xe.TEXTURE_WRAP_T,Xe.CLAMP_TO_EDGE)))}Oi(a.depthOrArrayLayers===1)}else if(a.dimension===Wi.TEXTURE_2D_ARRAY)d=Xe.TEXTURE_2D_ARRAY,f.bindTexture(d,_),l.immutable&&Vn(f)&&f.texStorage3D(d,b,M,a.width,a.height,a.depthOrArrayLayers);else if(a.dimension===Wi.TEXTURE_3D)d=Xe.TEXTURE_3D,f.bindTexture(d,_),l.immutable&&Vn(f)&&f.texStorage3D(d,b,M,a.width,a.height,a.depthOrArrayLayers);else if(a.dimension===Wi.TEXTURE_CUBE_MAP)d=Xe.TEXTURE_CUBE_MAP,f.bindTexture(d,_),l.immutable&&Vn(f)&&f.texStorage2D(d,b,M,a.width,a.height),Oi(a.depthOrArrayLayers===6);else throw new Error("whoops")}return l.gl_texture=_,l.gl_target=d,l.mipLevelCount=b,l}return r.prototype.setImageData=function(t,n){n===void 0&&(n=0);var i=this.device.gl;zE(this.format);var a=this.gl_target===Xe.TEXTURE_3D||this.gl_target===Xe.TEXTURE_2D_ARRAY,s=this.gl_target===Xe.TEXTURE_CUBE_MAP,l=I4(t[0]);this.device.setActiveTexture(i.TEXTURE0),this.device.currentTextures[0]=null;var f=t[0],d,_;l?(d=this.width,_=this.height):(d=f.width,_=f.height,this.width=d,this.height=_),i.bindTexture(this.gl_target,this.gl_texture);var b=this.device.translateTextureFormat(this.format),T=Vn(i)?this.device.translateInternalTextureFormat(this.format):b,M=this.device.translateTextureType(this.format);this.preprocessImage();for(var P=0;P<this.depthOrArrayLayers;P++){var D=t[P],G=this.gl_target;s&&(G=Xe.TEXTURE_CUBE_MAP_POSITIVE_X+P%6),this.immutable?i.texSubImage2D(G,n,0,0,d,_,b,M,D):Vn(i)?a?i.texImage3D(G,n,T,d,_,this.depthOrArrayLayers,0,b,M,D):i.texImage2D(G,n,T,d,_,0,b,M,D):l?i.texImage2D(G,n,b,d,_,0,b,M,D):i.texImage2D(G,n,b,b,M,D)}this.mipmaps&&this.generateMipmap(a)},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.device.gl.deleteTexture(Ov(this))},r.prototype.clampmipLevelCount=function(t){if(t.dimension===Wi.TEXTURE_2D_ARRAY&&t.depthOrArrayLayers>1){var n=sh(t.format);if(n===Pr.BC1)for(var i=t.width,a=t.height,s=0;s<t.mipLevelCount;s++){if(i<=2||a<=2)return s-1;i=Math.max(i/2|0,1),a=Math.max(a/2|0,1)}}return t.mipLevelCount},r.prototype.preprocessImage=function(){var t=this.device.gl;this.pixelStore&&(this.pixelStore.unpackFlipY&&t.pixelStorei(Xe.UNPACK_FLIP_Y_WEBGL,!0),this.pixelStore.packAlignment&&t.pixelStorei(Xe.PACK_ALIGNMENT,this.pixelStore.packAlignment),this.pixelStore.unpackAlignment&&t.pixelStorei(Xe.UNPACK_ALIGNMENT,this.pixelStore.unpackAlignment))},r.prototype.generateMipmap=function(t){t===void 0&&(t=!1);var n=this.device.gl;return!Vn(n)&&this.isNPOT()?this:(this.gl_texture&&this.gl_target&&(n.bindTexture(this.gl_target,this.gl_texture),t?(n.texParameteri(this.gl_target,Xe.TEXTURE_BASE_LEVEL,0),n.texParameteri(this.gl_target,Xe.TEXTURE_MAX_LEVEL,Math.log2(this.width)),n.texParameteri(this.gl_target,Xe.TEXTURE_MIN_FILTER,Xe.LINEAR_MIPMAP_LINEAR),n.texParameteri(this.gl_target,Xe.TEXTURE_MAG_FILTER,Xe.LINEAR)):n.texParameteri(Xe.TEXTURE_2D,Xe.TEXTURE_MIN_FILTER,Xe.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 Vn(t)?!1:!i0(this.width)||!i0(this.height)},r}(Ef),W4=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=_a.RenderTarget,s.gl_renderbuffer=null,s.texture=null;var l=s.device.gl,f=a.format,d=a.width,_=a.height,b=a.sampleCount,T=b===void 0?1:b,M=a.texture,P=!1;if((f===It.D32F||f===It.D24_S8)&&M&&!Vn(l)&&!i.WEBGL_depth_texture&&(M.destroy(),s.texture=null,P=!0),!P&&M)s.texture=M;else{s.gl_renderbuffer=s.device.ensureResourceExists(l.createRenderbuffer()),l.bindRenderbuffer(l.RENDERBUFFER,s.gl_renderbuffer);var D=s.device.translateTextureInternalFormat(f,!0);Vn(l)&&T>1?l.renderbufferStorageMultisample(Xe.RENDERBUFFER,T,D,d,_):l.renderbufferStorage(Xe.RENDERBUFFER,D,d,_)}return s.format=f,s.width=d,s.height=_,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}(Ef),Hl;(function(e){e[e.NeedsCompile=0]="NeedsCompile",e[e.Compiling=1]="Compiling",e[e.NeedsBind=2]="NeedsBind",e[e.ReadyToUse=3]="ReadyToUse"})(Hl||(Hl={}));var G4=function(e){(0,Pn.ZT)(r,e);function r(t,n){var i=t.id,a=t.device,s=t.descriptor,l=e.call(this,{id:i,device:a})||this;l.rawVertexGLSL=n,l.type=_a.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=Hl.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(){Oi(this.compileState===Hl.NeedsCompile);var t=this.descriptor,n=t.vertex,i=t.fragment,a=this.device.gl;n!=null&&n.glsl&&(i!=null&&i.glsl)&&(this.gl_shader_vert=this.compileShader(n.postprocess?n.postprocess(n.glsl):n.glsl,a.VERTEX_SHADER),this.gl_shader_frag=this.compileShader(i.postprocess?i.postprocess(i.glsl):i.glsl,a.FRAGMENT_SHADER),a.attachShader(this.gl_program,this.gl_shader_vert),a.attachShader(this.gl_program,this.gl_shader_frag),a.linkProgram(this.gl_program),this.compileState=Hl.Compiling,Vn(a)||(this.readUniformLocationsFromLinkedProgram(),this.readAttributesFromLinkedProgram()))},r.prototype.readAttributesFromLinkedProgram=function(){for(var t,n=this.device.gl,i=n.getProgramParameter(this.gl_program,n.ACTIVE_ATTRIBUTES),a=P4(this.descriptor.vertex.glsl),s=O4(this.rawVertexGLSL,a),l=function(_){var b=n.getActiveAttrib(f.gl_program,_),T=b.name,M=b.type,P=b.size,D=n.getAttribLocation(f.gl_program,T),G=(t=s.find(function(q){return q.name===T}))===null||t===void 0?void 0:t.location;D>=0&&!(0,Dp.Z)(G)&&(f.attributes[G]={name:T,location:D,type:M,size:P})},f=this,d=0;d<i;d++)l(d)},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 a=t.getActiveUniform(this.gl_program,i),s=A4(a.name).name,l=t.getUniformLocation(this.gl_program,s);if(this.uniformSetters[s]=NE(t,l,a),a&&a.size>1)for(var f=0;f<a.size;f++)l=t.getUniformLocation(this.gl_program,"".concat(s,"[").concat(f,"]")),this.uniformSetters["".concat(s,"[").concat(f,"]")]=NE(t,l,a)}},r.prototype.compileShader=function(t,n){var i=this.device.gl,a=this.device.ensureResourceExists(i.createShader(n));return i.shaderSource(a,t),i.compileShader(a),a},r.prototype.setUniformsLegacy=function(t){t===void 0&&(t={});var n=this.device.gl;if(!Vn(n)){var i=!1;for(var a in t){i||(n.useProgram(this.gl_program),i=!0);var s=t[a],l=this.uniformSetters[a];if(l){var f=s;f instanceof My&&(f=f.textureIndex),l(f)}}}return this},r}(Ef),X4=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=_a.QueryPool;var l=s.device.gl;if(Vn(l)){var f=a.elemCount,d=a.type;s.gl_query=o4(f,function(){return s.device.ensureResourceExists(l.createQuery())}),s.gl_query_type=Z4(d)}return s}return r.prototype.queryResultOcclusion=function(t){var n=this.device.gl;if(Vn(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(Vn(t))for(var n=0;n<this.gl_query.length;n++)t.deleteQuery(this.gl_query[n])},r}(Ef),$4=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=e.call(this,{id:n,device:i})||this;return a.type=_a.Readback,a.gl_pbo=null,a.gl_sync=null,a}return r.prototype.clientWaitAsync=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=10);var a=this.device.gl;return new Promise(function(s,l){function f(){var d=a.clientWaitSync(t,n,0);if(d==a.WAIT_FAILED){l();return}if(d==a.TIMEOUT_EXPIRED){setTimeout(f,(0,e4.Z)(i,0,a.MAX_CLIENT_WAIT_TIMEOUT_WEBGL));return}s()}f()})},r.prototype.getBufferSubDataAsync=function(t,n,i,a,s,l){return(0,Pn.mG)(this,void 0,void 0,function(){var f;return(0,Pn.Jh)(this,function(d){switch(d.label){case 0:return f=this.device.gl,Vn(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 d.sent(),f.bindBuffer(t,n),f.getBufferSubData(t,i,a,s,l),f.bindBuffer(t,null),[2,a];case 2:return[2]}})})},r.prototype.readTexture=function(t,n,i,a,s,l,f,d){return f===void 0&&(f=0),d===void 0&&(d=l.byteLength||0),(0,Pn.mG)(this,void 0,void 0,function(){var _,b,T,M,P;return(0,Pn.Jh)(this,function(D){return _=this.device.gl,b=t,T=this.device.translateTextureFormat(b.format),M=this.device.translateTextureType(b.format),P=t4(b.format),Vn(_)?(this.gl_pbo=this.device.ensureResourceExists(_.createBuffer()),_.bindBuffer(_.PIXEL_PACK_BUFFER,this.gl_pbo),_.bufferData(_.PIXEL_PACK_BUFFER,d,_.STREAM_READ),_.bindBuffer(_.PIXEL_PACK_BUFFER,null),_.bindFramebuffer(Xe.READ_FRAMEBUFFER,this.device.readbackFramebuffer),_.framebufferTexture2D(Xe.READ_FRAMEBUFFER,Xe.COLOR_ATTACHMENT0,Xe.TEXTURE_2D,b.gl_texture,0),_.bindBuffer(_.PIXEL_PACK_BUFFER,this.gl_pbo),_.readPixels(n,i,a,s,T,M,f*P),_.bindBuffer(_.PIXEL_PACK_BUFFER,null),[2,this.getBufferSubDataAsync(_.PIXEL_PACK_BUFFER,this.gl_pbo,0,l,f,0)]):[2,this.readTextureSync(t,n,i,a,s,l,f,d)]})})},r.prototype.readTextureSync=function(t,n,i,a,s,l,f,d){d===void 0&&(d=l.byteLength||0);var _=this.device.gl,b=t,T=this.device.translateTextureType(b.format);return _.bindFramebuffer(Xe.FRAMEBUFFER,this.device.readbackFramebuffer),_.framebufferTexture2D(Xe.FRAMEBUFFER,Xe.COLOR_ATTACHMENT0,Xe.TEXTURE_2D,b.gl_texture,0),_.pixelStorei(_.PACK_ALIGNMENT,4),_.readPixels(n,i,a,s,_.RGBA,T,l),l},r.prototype.readBuffer=function(t,n,i,a,s){return(0,Pn.mG)(this,void 0,void 0,function(){var l;return(0,Pn.Jh)(this,function(f){return l=this.device.gl,Vn(l)?[2,this.getBufferSubDataAsync(l.ARRAY_BUFFER,Pv(t,n),n,i,a,s)]:[2,Promise.reject()]})})},r.prototype.destroy=function(){e.prototype.destroy.call(this),Vn(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}(Ef),Y4=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s,l,f=e.call(this,{id:n,device:i})||this;return f.type=_a.RenderPipeline,f.drawMode=B4((s=a.topology)!==null&&s!==void 0?s:Cs.TRIANGLES),f.program=a.program,f.inputLayout=a.inputLayout,f.megaState=(0,Pn.pi)((0,Pn.pi)({},Mv(Id)),a.megaStateDescriptor),f.colorAttachmentFormats=a.colorAttachmentFormats.slice(),f.depthStencilAttachmentFormat=a.depthStencilAttachmentFormat,f.sampleCount=(l=a.sampleCount)!==null&&l!==void 0?l:1,f}return r}(Ef),q4=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=e.call(this,{id:n,device:i})||this;return s.type=_a.ComputePipeline,s.descriptor=a,s}return r}(Ef),K4=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,Pn.XA)(this.liveObjects.values()),i=n.next();!i.done;i=n.next()){var a=i.value;console.warn("Object leaked:",a,"Creation stack:",this.creationStacks.get(a))}}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}(),Q4=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s,l,f=e.call(this,{id:n,device:i})||this;f.type=_a.Sampler;var d=f.device.gl;if(Vn(d)){var _=f.device.ensureResourceExists(d.createSampler());d.samplerParameteri(_,Xe.TEXTURE_WRAP_S,Zm(a.addressModeU)),d.samplerParameteri(_,Xe.TEXTURE_WRAP_T,Zm(a.addressModeV)),d.samplerParameteri(_,Xe.TEXTURE_WRAP_R,Zm((s=a.addressModeW)!==null&&s!==void 0?s:a.addressModeU)),d.samplerParameteri(_,Xe.TEXTURE_MIN_FILTER,l0(a.minFilter,a.mipmapFilter)),d.samplerParameteri(_,Xe.TEXTURE_MAG_FILTER,l0(a.magFilter,$s.NO_MIP)),a.lodMinClamp!==void 0&&d.samplerParameterf(_,Xe.TEXTURE_MIN_LOD,a.lodMinClamp),a.lodMaxClamp!==void 0&&d.samplerParameterf(_,Xe.TEXTURE_MAX_LOD,a.lodMaxClamp),a.compareFunction!==void 0&&(d.samplerParameteri(_,d.TEXTURE_COMPARE_MODE,d.COMPARE_REF_TO_TEXTURE),d.samplerParameteri(_,d.TEXTURE_COMPARE_FUNC,a.compareFunction));var b=(l=a.maxAnisotropy)!==null&&l!==void 0?l:1;b>1&&f.device.EXT_texture_filter_anisotropic!==null&&(Oi(a.minFilter===rs.BILINEAR&&a.magFilter===rs.BILINEAR&&a.mipmapFilter===$s.LINEAR),d.samplerParameterf(_,f.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,b)),f.gl_sampler=_}else f.descriptor=a;return f}return r.prototype.setTextureParameters=function(t,n,i){var a,s=this.device.gl,l=this.descriptor;this.isNPOT(n,i)?s.texParameteri(Xe.TEXTURE_2D,Xe.TEXTURE_MIN_FILTER,Xe.LINEAR):s.texParameteri(t,Xe.TEXTURE_MIN_FILTER,l0(l.minFilter,l.mipmapFilter)),s.texParameteri(Xe.TEXTURE_2D,Xe.TEXTURE_WRAP_S,Zm(l.addressModeU)),s.texParameteri(Xe.TEXTURE_2D,Xe.TEXTURE_WRAP_T,Zm(l.addressModeV)),s.texParameteri(t,Xe.TEXTURE_MAG_FILTER,l0(l.magFilter,$s.NO_MIP));var f=(a=l.maxAnisotropy)!==null&&a!==void 0?a:1;f>1&&this.device.EXT_texture_filter_anisotropic!==null&&(Oi(l.minFilter===rs.BILINEAR&&l.magFilter===rs.BILINEAR&&l.mipmapFilter===$s.LINEAR),s.texParameteri(t,this.device.EXT_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT,f))},r.prototype.destroy=function(){e.prototype.destroy.call(this),Vn(this.device.gl)&&this.device.gl.deleteSampler(Cy(this))},r.prototype.isNPOT=function(t,n){return!i0(t)||!i0(n)},r}(Ef),J4=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}(),HE=65536,ek=/uniform(?:\s+)(\w+)(?:\s?){([^]*?)}/g,tk=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=Mv(Id),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=Av.LOWER_LEFT,this.clipSpaceNearZ=Tv.NEGATIVE_ONE,this.supportMRT=!1,this.inBlitRenderPass=!1,this.supportedSampleCounts=[],this.occlusionQueriesRecommended=!1,this.computeShadersSupported=!1,this.gl=r,this.contextAttributes=Md(r.getContextAttributes()),Vn(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"),Vn(r)?(this.platformString="WebGL2",this.glslVersion="#version 300 es"):(this.platformString="WebGL1",this.glslVersion="#version 100"),this.scTexture=new My({id:this.getNextUniqueId(),device:this,descriptor:{width:0,height:0,depthOrArrayLayers:1,dimension:Wi.TEXTURE_2D,mipLevelCount:1,usage:Ou.RENDER_TARGET,format:this.contextAttributes.alpha===!1?It.U8_RGB_RT:It.U8_RGBA_RT},fake:!0}),this.scTexture.formatKind=Xo.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(Wi.TEXTURE_2D,Xo.Float),this.fallbackTexture2DDepth=this.createFallbackTexture(Wi.TEXTURE_2D,Xo.Depth),this.fallbackVertexBuffer=this.createBuffer({viewOrSize:1,usage:no.VERTEX,hint:bf.STATIC}),Vn(r)&&(this.fallbackTexture2DArray=this.createFallbackTexture(Wi.TEXTURE_2D_ARRAY,Xo.Float),this.fallbackTexture3D=this.createFallbackTexture(Wi.TEXTURE_3D,Xo.Float),this.fallbackTextureCube=this.createFallbackTexture(Wi.TEXTURE_CUBE_MAP,Xo.Float)),this.currentMegaState.depthCompare=Ui.LESS,this.currentMegaState.depthWrite=!1,this.currentMegaState.attachmentsState[0].channelWriteMask=au.ALL,r.enable(r.DEPTH_TEST),r.enable(r.STENCIL_TEST),this.checkLimits(),t.shaderDebug&&(this.shaderDebug=!0),t.trackResources&&(this.resourceCreationTracker=new K4)}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===Wi.TEXTURE_CUBE_MAP?6:1,i=t===Xo.Depth?It.D32F:It.U8_RGBA_NORM,a=this.createTexture({dimension:r,format:i,usage:Ou.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1});return t===Xo.Float&&a.setImageData([new Uint8Array(4*n)]),Ov(a)},e.prototype.getNextUniqueId=function(){return++this.resourceUniqueId},e.prototype.checkLimits=function(){var r=this.gl;if(this.maxVertexAttribs=r.getParameter(Xe.MAX_VERTEX_ATTRIBS),Vn(r)){this.uniformBufferMaxPageByteSize=Math.min(r.getParameter(Xe.MAX_UNIFORM_BLOCK_SIZE),HE),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,Pn.ev)([],(0,Pn.CR)(t),!1):[],this.occlusionQueriesRecommended=!0}else this.uniformBufferWordAlignment=64,this.uniformBufferMaxPageByteSize=HE;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=i4(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 It.ALPHA:return Xe.ALPHA;case It.U8_LUMINANCE:case It.F16_LUMINANCE:case It.F32_LUMINANCE:return Xe.LUMINANCE;case It.F16_R:return Xe.R16F;case It.F16_RG:return Xe.RG16F;case It.F16_RGB:return Xe.RGB16F;case It.F16_RGBA:return Xe.RGBA16F;case It.F32_R:return Xe.R32F;case It.F32_RG:return Xe.RG32F;case It.F32_RGB:return Xe.RGB32F;case It.F32_RGBA:return Vn(this.gl)?Xe.RGBA32F:t?this.WEBGL_color_buffer_float.RGBA32F_EXT:Xe.RGBA;case It.U8_R_NORM:return Xe.R8;case It.U8_RG_NORM:return Xe.RG8;case It.U8_RGB_NORM:case It.U8_RGB_RT:return Xe.RGB8;case It.U8_RGB_SRGB:return Xe.SRGB8;case It.U8_RGBA_NORM:case It.U8_RGBA_RT:return Vn(this.gl)?Xe.RGBA8:t?Xe.RGBA4:Xe.RGBA;case It.U8_RGBA:return Xe.RGBA;case It.U8_RGBA_SRGB:case It.U8_RGBA_RT_SRGB:return Xe.SRGB8_ALPHA8;case It.U16_R:return Xe.R16UI;case It.U16_R_NORM:return this.EXT_texture_norm16.R16_EXT;case It.U16_RG_NORM:return this.EXT_texture_norm16.RG16_EXT;case It.U16_RGBA_NORM:return this.EXT_texture_norm16.RGBA16_EXT;case It.U16_RGBA_5551:return Xe.RGB5_A1;case It.U16_RGB_565:return Xe.RGB565;case It.U32_R:return Xe.R32UI;case It.S8_RGBA_NORM:return Xe.RGBA8_SNORM;case It.S8_RG_NORM:return Xe.RG8_SNORM;case It.BC1:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT;case It.BC1_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;case It.BC2:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT;case It.BC2_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;case It.BC3:return this.WEBGL_compressed_texture_s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT;case It.BC3_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;case It.BC4_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_RGTC1_EXT;case It.BC4_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT;case It.BC5_UNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT;case It.BC5_SNORM:return this.EXT_texture_compression_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;case It.D32F_S8:return Vn(this.gl)?Xe.DEPTH32F_STENCIL8:this.WEBGL_depth_texture?Xe.DEPTH_STENCIL:Xe.DEPTH_COMPONENT16;case It.D24_S8:return Vn(this.gl)?Xe.DEPTH24_STENCIL8:this.WEBGL_depth_texture?Xe.DEPTH_STENCIL:Xe.DEPTH_COMPONENT16;case It.D32F:return Vn(this.gl)?Xe.DEPTH_COMPONENT32F:this.WEBGL_depth_texture?Xe.DEPTH_COMPONENT:Xe.DEPTH_COMPONENT16;case It.D24:return Vn(this.gl)?Xe.DEPTH_COMPONENT24:this.WEBGL_depth_texture?Xe.DEPTH_COMPONENT:Xe.DEPTH_COMPONENT16;default:throw new Error("whoops")}},e.prototype.translateTextureType=function(r){var t=sh(r);switch(t){case Pr.U8:return Xe.UNSIGNED_BYTE;case Pr.U16:return Xe.UNSIGNED_SHORT;case Pr.U32:return Xe.UNSIGNED_INT;case Pr.S8:return Xe.BYTE;case Pr.F16:return Xe.HALF_FLOAT;case Pr.F32:return Xe.FLOAT;case Pr.U16_PACKED_5551:return Xe.UNSIGNED_SHORT_5_5_5_1;case Pr.D32F:return Vn(this.gl)?Xe.FLOAT:this.WEBGL_depth_texture?Xe.UNSIGNED_INT:Xe.UNSIGNED_BYTE;case Pr.D24:return Vn(this.gl)?Xe.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?Xe.UNSIGNED_SHORT:Xe.UNSIGNED_BYTE;case Pr.D24S8:return Vn(this.gl)?Xe.UNSIGNED_INT_24_8:this.WEBGL_depth_texture?Xe.UNSIGNED_INT_24_8_WEBGL:Xe.UNSIGNED_BYTE;case Pr.D32FS8:return Xe.FLOAT_32_UNSIGNED_INT_24_8_REV;default:throw new Error("whoops")}},e.prototype.translateInternalTextureFormat=function(r){switch(r){case It.F32_R:return Xe.R32F;case It.F32_RG:return Xe.RG32F;case It.F32_RGB:return Xe.RGB32F;case It.F32_RGBA:return Xe.RGBA32F;case It.F16_R:return Xe.R16F;case It.F16_RG:return Xe.RG16F;case It.F16_RGB:return Xe.RGB16F;case It.F16_RGBA:return Xe.RGBA16F}return this.translateTextureFormat(r)},e.prototype.translateTextureFormat=function(r){if(zE(r)||r===It.F32_LUMINANCE||r===It.U8_LUMINANCE)return this.translateTextureInternalFormat(r);var t=Vn(this.gl)||!Vn(this.gl)&&!!this.WEBGL_depth_texture;switch(r){case It.D24_S8:case It.D32F_S8:return t?Xe.DEPTH_STENCIL:Xe.RGBA;case It.D24:case It.D32F:return t?Xe.DEPTH_COMPONENT:Xe.RGBA}var n=ZE(r),i=n0(r);switch(i){case Wn.A:return Xe.ALPHA;case Wn.R:return n?Xe.RED_INTEGER:Xe.RED;case Wn.RG:return n?Xe.RG_INTEGER:Xe.RG;case Wn.RGB:return n?Xe.RGB_INTEGER:Xe.RGB;case Wn.RGBA:return Xe.RGBA}},e.prototype.setActiveTexture=function(r){this.currentActiveTexture!==r&&(this.gl.activeTexture(r),this.currentActiveTexture=r)},e.prototype.bindVAO=function(r){this.currentBoundVAO!==r&&(Vn(this.gl)?this.gl.bindVertexArray(r):this.OES_vertex_array_object.bindVertexArrayOES(r),this.currentBoundVAO=r)},e.prototype.programCompiled=function(r){Oi(r.compileState!==Hl.NeedsCompile),r.compileState===Hl.Compiling&&(r.compileState=Hl.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 j4({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createTexture=function(r){return new My({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createSampler=function(r){return new Q4({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderTarget=function(r){return new W4({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderTargetFromTexture=function(r){var t=r,n=t.format,i=t.width,a=t.height,s=t.mipLevelCount;return Oi(s===1),this.createRenderTarget({format:n,width:i,height:a,sampleCount:1,texture:r})},e.prototype.createProgram=function(r){var t,n,i,a=(t=r.vertex)===null||t===void 0?void 0:t.glsl;return!((n=r.vertex)===null||n===void 0)&&n.glsl&&(r.vertex.glsl=Fp(this.queryVendorInfo(),"vert",r.vertex.glsl)),!((i=r.fragment)===null||i===void 0)&&i.glsl&&(r.fragment.glsl=Fp(this.queryVendorInfo(),"frag",r.fragment.glsl)),this.createProgramSimple(r,a)},e.prototype.createProgramSimple=function(r,t){var n=new G4({id:this.getNextUniqueId(),device:this,descriptor:r},t);return n},e.prototype.createBindings=function(r){return new D4({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createInputLayout=function(r){return new H4({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderPipeline=function(r){return new Y4({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createComputePass=function(){return new J4},e.prototype.createComputePipeline=function(r){return new q4({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createReadback=function(){return new $4({id:this.getNextUniqueId(),device:this})},e.prototype.createQueryPool=function(r,t){return new X4({id:this.getNextUniqueId(),device:this,descriptor:{type:r,elemCount:t}})},e.prototype.formatRenderPassDescriptor=function(r){var t,n,i,a,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 d=0;d<f.length;d++)r.colorAttachmentLevel||(r.colorAttachmentLevel=[]),r.colorAttachmentLevel[d]=(i=r.colorAttachmentLevel[d])!==null&&i!==void 0?i:0,r.colorResolveToLevel||(r.colorResolveToLevel=[]),r.colorResolveToLevel[d]=(a=r.colorResolveToLevel[d])!==null&&a!==void 0?a:0,r.colorClearColor||(r.colorClearColor=[]),r.colorClearColor[d]=(s=r.colorClearColor[d])!==null&&s!==void 0?s:"load",r.colorStore||(r.colorStore=[]),r.colorStore[d]=(l=r.colorStore[d])!==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,a=r.colorResolveTo,s=r.colorResolveToLevel,l=r.depthStencilAttachment,f=r.depthClearValue,d=r.stencilClearValue,_=r.depthStencilResolveTo;this.setRenderPassParametersBegin(t.length);for(var b=0;b<t.length;b++)this.setRenderPassParametersColor(b,t[b],n[b],a[b],s[b]);this.setRenderPassParametersDepthStencil(l,_),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,d),this},e.prototype.submitPass=function(r){Oi(this.currentRenderPassDescriptor!==null),this.endPass(),this.currentRenderPassDescriptorStack.length?this.currentRenderPassDescriptor=this.currentRenderPassDescriptorStack.pop():this.currentRenderPassDescriptor=null},e.prototype.copySubTexture2D=function(r,t,n,i,a,s){var l=this.gl,f=r,d=i;if(Oi(d.mipLevelCount===1),Oi(f.mipLevelCount===1),Vn(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,d,0),l.blitFramebuffer(a,s,a+d.width,s+d.height,t,n,t+d.width,n+d.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 _=this.createRenderTargetFromTexture(i);this.submitBlitRenderPass(_,f)}},e.prototype.queryLimits=function(){return this},e.prototype.queryTextureFormatSupported=function(r,t,n){switch(r){case It.BC1_SRGB:case It.BC2_SRGB:case It.BC3_SRGB:return this.WEBGL_compressed_texture_s3tc_srgb!==null?Ry(t,n,4,4):!1;case It.BC1:case It.BC2:case It.BC3:return this.WEBGL_compressed_texture_s3tc!==null?Ry(t,n,4,4):!1;case It.BC4_UNORM:case It.BC4_SNORM:case It.BC5_UNORM:case It.BC5_SNORM:return this.EXT_texture_compression_rgtc!==null?Ry(t,n,4,4):!1;case It.U16_R_NORM:case It.U16_RG_NORM:case It.U16_RGBA_NORM:return this.EXT_texture_norm16!==null;case It.F32_R:case It.F32_RG:case It.F32_RGB:case It.F32_RGBA:return this.OES_texture_float_linear!==null;case It.F16_R:case It.F16_RG:case It.F16_RGB:case It.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===Hl.NeedsCompile)throw new Error("whoops");if(r.compileState===Hl.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===Hl.NeedsBind||r.compileState===Hl.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===_a.Buffer)for(var n=r.gl_buffer_pages,i=0;i<n.length;i++)Vm(n[i],"".concat(t," Page ").concat(i));else if(r.type===_a.Texture)Vm(Ov(r),t);else if(r.type===_a.Sampler)Vm(Cy(r),t);else if(r.type===_a.RenderTarget){var a=r.gl_renderbuffer;a!==null&&Vm(a,t)}else r.type===_a.InputLayout&&Vm(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){Oi(this.shaderDebug)},e.prototype.getBufferData=function(r,t,n){n===void 0&&(n=0);var i=this.gl;Vn(i)&&(i.bindBuffer(i.COPY_READ_BUFFER,Pv(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(s4(t));var a=n.getExtension("WEBGL_debug_shaders");a&&console.error(a.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 a=this.gl;if((0,Dp.Z)(n))a.framebufferRenderbuffer(r,t,a.RENDERBUFFER,null);else if(n.type===_a.RenderTarget)n.gl_renderbuffer!==null?a.framebufferRenderbuffer(r,t,a.RENDERBUFFER,n.gl_renderbuffer):n.texture!==null&&a.framebufferTexture2D(r,t,Xe.TEXTURE_2D,Ov(n.texture),i);else if(n.type===_a.Texture){var s=Ov(n);n.dimension===Wi.TEXTURE_2D?a.framebufferTexture2D(r,t,Xe.TEXTURE_2D,s,i):Vn(a)&&(n.dimension,Wi.TEXTURE_2D_ARRAY)}},e.prototype.bindFramebufferDepthStencilAttachment=function(r,t){var n=this.gl,i=(0,Dp.Z)(t)?wn.Depth|wn.Stencil:wv(t.format),a=!!(i&wn.Depth),s=!!(i&wn.Stencil);if(a&&s){var l=Vn(this.gl)||!Vn(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 a?(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 a=this.currentColorAttachments[i];a!==null&&(r===-1?(r=a.sampleCount,t=a.width,n=a.height):(Oi(r===a.sampleCount),Oi(t===a.width),Oi(n===a.height)))}this.currentDepthStencilAttachment&&(r===-1?r=this.currentDepthStencilAttachment.sampleCount:(Oi(r===this.currentDepthStencilAttachment.sampleCount),Oi(t===this.currentDepthStencilAttachment.width),Oi(n===this.currentDepthStencilAttachment.height))),this.currentSampleCount=r},e.prototype.setRenderPassParametersBegin=function(r){var t=this.gl;if(Vn(t)?t.bindFramebuffer(Xe.DRAW_FRAMEBUFFER,this.renderPassDrawFramebuffer):this.inBlitRenderPass||t.bindFramebuffer(Xe.FRAMEBUFFER,this.renderPassDrawFramebuffer),Vn(t)?t.drawBuffers([Xe.COLOR_ATTACHMENT0,Xe.COLOR_ATTACHMENT1,Xe.COLOR_ATTACHMENT2,Xe.COLOR_ATTACHMENT3]):!this.inBlitRenderPass&&this.WEBGL_draw_buffers&&this.WEBGL_draw_buffers.drawBuffersWEBGL([Xe.COLOR_ATTACHMENT0_WEBGL,Xe.COLOR_ATTACHMENT1_WEBGL,Xe.COLOR_ATTACHMENT2_WEBGL,Xe.COLOR_ATTACHMENT3_WEBGL]),!this.inBlitRenderPass)for(var n=r;n<this.currentColorAttachments.length;n++){var i=Vn(t)?Xe.DRAW_FRAMEBUFFER:Xe.FRAMEBUFFER,a=Vn(t)?Xe.COLOR_ATTACHMENT0:Xe.COLOR_ATTACHMENT0_WEBGL;t.framebufferRenderbuffer(i,a+n,Xe.RENDERBUFFER,null),t.framebufferTexture2D(i,a+n,Xe.TEXTURE_2D,null,0)}this.currentColorAttachments.length=r},e.prototype.setRenderPassParametersColor=function(r,t,n,i,a){var s=this.gl,l=Vn(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?Xe.DRAW_FRAMEBUFFER:Xe.FRAMEBUFFER,(l?Xe.COLOR_ATTACHMENT0:Xe.COLOR_ATTACHMENT0_WEBGL)+r,t,n),this.resolveColorAttachmentsChanged=!0),(this.currentColorResolveTos[r]!==i||this.currentColorResolveToLevels[r]!==a)&&(this.currentColorResolveTos[r]=i,this.currentColorResolveToLevels[r]=a,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(Vn(n)?Xe.DRAW_FRAMEBUFFER:Xe.FRAMEBUFFER,this.currentDepthStencilAttachment),this.resolveDepthStencilAttachmentsChanged=!0),this.currentDepthStencilResolveTo!==t&&(this.currentDepthStencilResolveTo=t,t&&(this.resolveDepthStencilAttachmentsChanged=!0))},e.prototype.setRenderPassParametersClearColor=function(r,t,n,i,a){var s=this.gl;if(this.OES_draw_buffers_indexed!==null){var l=this.currentMegaState.attachmentsState[r];l&&l.channelWriteMask!==au.ALL&&(this.OES_draw_buffers_indexed.colorMaskiOES(r,!0,!0,!0,!0),l.channelWriteMask=au.ALL)}else{var l=this.currentMegaState.attachmentsState[0];l&&l.channelWriteMask!==au.ALL&&(s.colorMask(!0,!0,!0,!0),l.channelWriteMask=au.ALL)}this.setScissorRectEnabled(!1),Vn(s)?s.clearBufferfv(s.COLOR,r,[t,n,i,a]):(s.clearColor(t,n,i,a),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"&&(Oi(!!this.currentDepthStencilAttachment),this.currentMegaState.depthWrite||(n.depthMask(!0),this.currentMegaState.depthWrite=!0),Vn(n)?n.clearBufferfv(n.DEPTH,0,[r]):(n.clearDepth(r),n.clear(n.DEPTH_BUFFER_BIT))),t!=="load"&&(Oi(!!this.currentDepthStencilAttachment),this.currentMegaState.stencilWrite||(n.enable(n.STENCIL_TEST),n.stencilMask(255),this.currentMegaState.stencilWrite=!0),Vn(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,a=i.uniformBufferBindings,s=i.samplerBindings,l=i.bindingLayouts;Oi(0<l.bindingLayoutTables.length);var f=l.bindingLayoutTables[0];Oi(a.length>=f.numUniformBuffers),Oi(s.length>=f.numSamplers);for(var d=0;d<a.length;d++){var _=a[d];if(_.size!==0){var b=f.firstUniformBuffer+d,T=_.buffer,M=_.offset||0,P=_.size||T.byteSize;if(T!==this.currentUniformBuffers[b]||M!==this.currentUniformBufferByteOffsets[b]||P!==this.currentUniformBufferByteSizes[b]){var D=M%T.pageByteSize,G=T.gl_buffer_pages[M/T.pageByteSize|0];Oi(D+P<=T.pageByteSize),Vn(n)&&n.bindBufferRange(n.UNIFORM_BUFFER,b,G,D,P),this.currentUniformBuffers[b]=T,this.currentUniformBufferByteOffsets[b]=M,this.currentUniformBufferByteSizes[b]=P}}}for(var d=0;d<f.numSamplers;d++){var _=s[d],q=f.firstSampler+d,se=_!==null&&_.sampler!==null?Cy(_.sampler):null,Se=_!==null&&_.texture!==null?Ov(_.texture):null;if(this.currentSamplers[q]!==se&&(Vn(n)&&n.bindSampler(q,se),this.currentSamplers[q]=se),this.currentTextures[q]!==Se){if(this.setActiveTexture(n.TEXTURE0+q),Se!==null){var Ve=Md(_).texture,nt=Ve.gl_target,st=Ve.width,at=Ve.height;_.texture.textureIndex=q,n.bindTexture(nt,Se),Vn(n)||(t=_.sampler)===null||t===void 0||t.setTextureParameters(nt,st,at),this.debugGroupStatisticsTextureBind()}else{var At=(0,Pn.pi)((0,Pn.pi)({},_),OE),Wt=At.dimension,Sr=At.formatKind,nt=V4(Wt);n.bindTexture(nt,this.getFallbackTexture((0,Pn.pi)({gl_target:nt,formatKind:Sr},At)))}this.currentTextures[q]=Se}}},e.prototype.setViewport=function(r,t,n,i){var a=this.gl;a.viewport(r,t,n,i)},e.prototype.setScissorRect=function(r,t,n,i){var a=this.gl;this.setScissorRectEnabled(!0),a.scissor(r,t,n,i)},e.prototype.applyAttachmentStateIndexed=function(r,t,n){var i=this.gl,a=this.OES_draw_buffers_indexed;t.channelWriteMask!==n.channelWriteMask&&(a.colorMaskiOES(r,!!(n.channelWriteMask&au.RED),!!(n.channelWriteMask&au.GREEN),!!(n.channelWriteMask&au.BLUE),!!(n.channelWriteMask&au.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)&&(Np(t.rgbBlendState)&&Np(t.alphaBlendState)?a.enableiOES(r,i.BLEND):Np(n.rgbBlendState)&&Np(n.alphaBlendState)&&a.disableiOES(r,i.BLEND)),s&&(a.blendEquationSeparateiOES(r,n.rgbBlendState.blendMode,n.alphaBlendState.blendMode),t.rgbBlendState.blendMode=n.rgbBlendState.blendMode,t.alphaBlendState.blendMode=n.alphaBlendState.blendMode),l&&(a.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&au.RED),!!(t.channelWriteMask&au.GREEN),!!(t.channelWriteMask&au.BLUE),!!(t.channelWriteMask&au.ALPHA)),r.channelWriteMask=t.channelWriteMask);var i=r.rgbBlendState.blendMode!==t.rgbBlendState.blendMode||r.alphaBlendState.blendMode!==t.alphaBlendState.blendMode,a=r.rgbBlendState.blendSrcFactor!==t.rgbBlendState.blendSrcFactor||r.alphaBlendState.blendSrcFactor!==t.alphaBlendState.blendSrcFactor||r.rgbBlendState.blendDstFactor!==t.rgbBlendState.blendDstFactor||r.alphaBlendState.blendDstFactor!==t.alphaBlendState.blendDstFactor;(a||i)&&(Np(r.rgbBlendState)&&Np(r.alphaBlendState)?n.enable(n.BLEND):Np(t.rgbBlendState)&&Np(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),a&&(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 Oi(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),!s0(n.stencilFront,r.stencilFront)){var a=r.stencilFront,s=a.passOp,l=a.failOp,f=a.depthFailOp,d=a.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!==d&&(this.setStencilReference(0),n.stencilFront.compare=d)}if(!s0(n.stencilBack,r.stencilBack)){var _=r.stencilBack,s=_.passOp,l=_.failOp,f=_.depthFailOp,d=_.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!==d&&(this.setStencilReference(0),n.stencilBack.compare=d)}(n.stencilFront.mask!==r.stencilFront.mask||n.stencilBack.mask!==r.stencilBack.mask)&&(n.stencilFront.mask=r.stencilFront.mask,n.stencilBack.mask=r.stencilBack.mask,this.applyStencil()),n.cullMode!==r.cullMode&&(n.cullMode===jl.NONE?t.enable(t.CULL_FACE):r.cullMode===jl.NONE&&t.disable(t.CULL_FACE),r.cullMode===jl.BACK?t.cullFace(t.BACK):r.cullMode===jl.FRONT?t.cullFace(t.FRONT):r.cullMode===jl.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&&Oi(this.currentDepthStencilAttachment.format===r.depthStencilAttachmentFormat),this.currentSampleCount!==-1&&Oi(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===Hl.NeedsBind){var n=this.gl,i=t.gl_program,a=t.descriptor,s=jE(a.vertex.glsl,ek);if(Vn(n))for(var l=0;l<s.length;l++){var f=(0,Pn.CR)(s[l],2),d=f[1],_=n.getUniformBlockIndex(i,d);_!==-1&&_!==4294967295&&n.uniformBlockBinding(i,_,l)}for(var b=jE(a.fragment.glsl,/^uniform .*sampler\S+ (\w+);\s* \/\/ BINDING=(\d+)$/gm),l=0;l<b.length;l++){var T=(0,Pn.CR)(b[l],3),M=T[1],P=T[2],D=n.getUniformLocation(i,M);n.uniform1i(D,parseInt(P))}t.compileState=Hl.ReadyToUse}},e.prototype.setVertexInput=function(r,t,n){var i,a,s;if(r!==null){Oi(this.currentPipeline.inputLayout===r);var l=r;this.bindVAO(l.vao);for(var f=this.gl,d=0;d<l.vertexBufferDescriptors.length;d++){var _=l.vertexBufferDescriptors[d],b=_.arrayStride,T=_.attributes;try{for(var M=(i=void 0,(0,Pn.XA)(T)),P=M.next();!P.done;P=M.next()){var D=P.value,G=D.shaderLocation,q=D.offset,se=Vn(f)?G:(s=l.program.attributes[G])===null||s===void 0?void 0:s.location;if(!(0,Dp.Z)(se)){var Se=t[d];if(Se===null)continue;var Ve=D.vertexFormat;f.bindBuffer(f.ARRAY_BUFFER,Pv(Se.buffer));var nt=(Se.offset||0)+q;f.vertexAttribPointer(se,Ve.size,Ve.type,Ve.normalized,b,nt)}}}catch(at){i={error:at}}finally{try{P&&!P.done&&(a=M.return)&&a.call(M)}finally{if(i)throw i.error}}}if(Oi(n!==null==(l.indexBufferFormat!==null)),n!==null){var st=n.buffer;Oi(st.usage===no.INDEX),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,Pv(st)),this.currentIndexBufferByteOffset=n.offset||0}else this.currentIndexBufferByteOffset=null}else Oi(this.currentPipeline.inputLayout===null),Oi(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 a,s=this.gl,l=this.currentPipeline;if(t){var f=[l.drawMode,n||0,r,t];Vn(s)?s.drawArraysInstanced.apply(s,(0,Pn.ev)([],(0,Pn.CR)(f),!1)):(a=this.ANGLE_instanced_arrays).drawArraysInstancedANGLE.apply(a,(0,Pn.ev)([],(0,Pn.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,a){var s,l=this.gl,f=this.currentPipeline,d=Md(f.inputLayout),_=Md(this.currentIndexBufferByteOffset)+n*d.indexBufferCompByteSize;if(t){var b=[f.drawMode,r,d.indexBufferType,_,t];Vn(l)?l.drawElementsInstanced.apply(l,(0,Pn.ev)([],(0,Pn.CR)(b),!1)):(s=this.ANGLE_instanced_arrays).drawElementsInstancedANGLE.apply(s,(0,Pn.ev)([],(0,Pn.CR)(b),!1))}else l.drawElements(f.drawMode,r,d.indexBufferType,_);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(Vn(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(Vn(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=Vn(r),n=!1,i=0;i<this.currentColorAttachments.length;i++){var a=this.currentColorAttachments[i];if(a!==null){var s=this.currentColorResolveTos[i],l=!1;s!==null&&(Oi(a.width===s.width&&a.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,a,this.currentColorAttachmentLevels[i]),l=!0,s===this.scTexture?r.bindFramebuffer(t?Xe.DRAW_FRAMEBUFFER:Xe.FRAMEBUFFER,this.scPlatformFramebuffer):(r.bindFramebuffer(t?Xe.DRAW_FRAMEBUFFER:Xe.FRAMEBUFFER,this.resolveColorDrawFramebuffer),this.resolveColorAttachmentsChanged&&r.framebufferTexture2D(t?Xe.DRAW_FRAMEBUFFER:Xe.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,s.gl_texture,this.currentColorResolveToLevels[i])),t?(r.blitFramebuffer(0,0,a.width,a.height,0,0,s.width,s.height,r.COLOR_BUFFER_BIT,r.LINEAR),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null)):this.submitBlitRenderPass(a,s),n=!0),this.currentRenderPassDescriptor.colorStore[i]||l||(r.bindFramebuffer(t?Xe.READ_FRAMEBUFFER:Xe.FRAMEBUFFER,this.resolveColorReadFramebuffer),this.resolveColorAttachmentsChanged&&this.bindFramebufferAttachment(t?Xe.READ_FRAMEBUFFER:Xe.FRAMEBUFFER,r.COLOR_ATTACHMENT0,a,this.currentColorAttachmentLevels[i])),r.bindFramebuffer(t?Xe.READ_FRAMEBUFFER:Xe.FRAMEBUFFER,null)}}this.resolveColorAttachmentsChanged=!1;var f=this.currentDepthStencilAttachment;if(f){var d=this.currentDepthStencilResolveTo,l=!1;d&&(Oi(f.width===d.width&&f.height===d.height),this.setScissorRectEnabled(!1),r.bindFramebuffer(t?Xe.READ_FRAMEBUFFER:Xe.FRAMEBUFFER,this.resolveDepthStencilReadFramebuffer),r.bindFramebuffer(t?Xe.DRAW_FRAMEBUFFER:Xe.FRAMEBUFFER,this.resolveDepthStencilDrawFramebuffer),this.resolveDepthStencilAttachmentsChanged&&(this.bindFramebufferDepthStencilAttachment(t?Xe.READ_FRAMEBUFFER:Xe.FRAMEBUFFER,f),this.bindFramebufferDepthStencilAttachment(t?Xe.DRAW_FRAMEBUFFER:Xe.FRAMEBUFFER,d)),l=!0,t&&r.blitFramebuffer(0,0,f.width,f.height,0,0,d.width,d.height,r.DEPTH_BUFFER_BIT,r.NEAREST),r.bindFramebuffer(t?Xe.DRAW_FRAMEBUFFER:Xe.FRAMEBUFFER,null),n=!0),this.currentRenderPassDescriptor.depthStencilStore||(l||(r.bindFramebuffer(t?Xe.READ_FRAMEBUFFER:Xe.FRAMEBUFFER,this.resolveDepthStencilReadFramebuffer),this.resolveDepthStencilAttachmentsChanged&&this.bindFramebufferDepthStencilAttachment(t?Xe.READ_FRAMEBUFFER:Xe.FRAMEBUFFER,f),l=!0),t&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[r.DEPTH_STENCIL_ATTACHMENT])),l&&r.bindFramebuffer(t?Xe.READ_FRAMEBUFFER:Xe.FRAMEBUFFER,null),this.resolveDepthStencilAttachmentsChanged=!1}n||r.bindFramebuffer(t?Xe.DRAW_FRAMEBUFFER:Xe.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,Dp.Z)(this.currentStencilRef)||(this.gl.stencilFuncSeparate(Xe.FRONT,this.currentMegaState.stencilFront.compare,this.currentStencilRef,this.currentMegaState.stencilFront.mask),this.gl.stencilFuncSeparate(Xe.BACK,this.currentMegaState.stencilBack.compare,this.currentStencilRef,this.currentMegaState.stencilBack.mask))},e.prototype.getFallbackTexture=function(r){var t=r.gl_target,n=r.formatKind;if(t===Xe.TEXTURE_2D)return n===Xo.Depth?this.fallbackTexture2DDepth:this.fallbackTexture2D;if(t===Xe.TEXTURE_2D_ARRAY)return this.fallbackTexture2DArray;if(t===Xe.TEXTURE_3D)return this.fallbackTexture3D;if(t===Xe.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:Rd.VERTEX,attributes:[{format:It.F32_RG,offset:4*0,shaderLocation:0}]}],indexBufferFormat:null,program:this.blitProgram}),this.blitRenderPipeline=this.createRenderPipeline({topology:Cs.TRIANGLES,sampleCount:1,program:this.blitProgram,colorAttachmentFormats:[It.U8_RGBA_RT],depthStencilAttachmentFormat:null,inputLayout:this.blitInputLayout,megaStateDescriptor:Mv(Id)}),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:[r4]}),a=this.getCanvas(),s=a.width,l=a.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}(),rk=function(){function e(r){this.pluginOptions=r}return e.prototype.createSwapChain=function(r){return(0,Pn.mG)(this,void 0,void 0,function(){var t,n,i,a,s,l,f,d,_,b,T;return(0,Pn.Jh)(this,function(M){return t=this.pluginOptions,n=t.targets,i=t.xrCompatible,a=t.antialias,s=a===void 0?!1:a,l=t.preserveDrawingBuffer,f=l===void 0?!1:l,d=t.premultipliedAlpha,_=d===void 0?!0:d,b={antialias:s,preserveDrawingBuffer:f,stencil:!0,premultipliedAlpha:_,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 tk(T,{shaderDebug:!0,trackResources:!0})]})})},e.prototype.handleContextEvents=function(r){var t=this.pluginOptions,n=t.onContextLost,i=t.onContextRestored,a=t.onContextCreationError;a&&r.addEventListener("webglcontextcreationerror",a,!1),n&&r.addEventListener("webglcontextlost",n,!1),i&&r.addEventListener("webglcontextrestored",i,!1)},e}();let Rs;const WE=typeof TextDecoder!="undefined"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder!="undefined"&&WE.decode();let jm=null;function c0(){return(jm===null||jm.byteLength===0)&&(jm=new Uint8Array(Rs.memory.buffer)),jm}function f0(e,r){return e=e>>>0,WE.decode(c0().subarray(e,e+r))}const Kh=new Array(128).fill(void 0);Kh.push(void 0,null,!0,!1);let Hm=Kh.length;function nk(e){Hm===Kh.length&&Kh.push(Kh.length+1);const r=Hm;return Hm=Kh[r],Kh[r]=e,r}function h0(e){return Kh[e]}function ik(e){e<132||(Kh[e]=Hm,Hm=e)}function ak(e){const r=h0(e);return ik(e),r}let Wm=0;const p0=typeof TextEncoder!="undefined"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},ok=typeof p0.encodeInto=="function"?function(e,r){return p0.encodeInto(e,r)}:function(e,r){const t=p0.encode(e);return r.set(t),{read:e.length,written:t.length}};function Iy(e,r,t){if(t===void 0){const l=p0.encode(e),f=r(l.length,1)>>>0;return c0().subarray(f,f+l.length).set(l),Wm=l.length,f}let n=e.length,i=r(n,1)>>>0;const a=c0();let s=0;for(;s<n;s++){const l=e.charCodeAt(s);if(l>127)break;a[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=c0().subarray(i+s,i+n),f=ok(e,l);s+=f.written}return Wm=s,i}let Gm=null;function d0(){return(Gm===null||Gm.byteLength===0)&&(Gm=new Int32Array(Rs.memory.buffer)),Gm}function sk(e,r,t){let n,i;try{const l=Rs.__wbindgen_add_to_stack_pointer(-16),f=Iy(e,Rs.__wbindgen_malloc,Rs.__wbindgen_realloc),d=Wm,_=Iy(r,Rs.__wbindgen_malloc,Rs.__wbindgen_realloc),b=Wm;Rs.glsl_compile(l,f,d,_,b,t);var a=d0()[l/4+0],s=d0()[l/4+1];return n=a,i=s,f0(a,s)}finally{Rs.__wbindgen_add_to_stack_pointer(16),Rs.__wbindgen_free(n,i,1)}}class Xm{static __wrap(r){r=r>>>0;const t=Object.create(Xm.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();Rs.__wbg_wgslcomposer_free(r)}constructor(){const r=Rs.wgslcomposer_new();return Xm.__wrap(r)}wgsl_compile(r){let t,n;try{const s=Rs.__wbindgen_add_to_stack_pointer(-16),l=Iy(r,Rs.__wbindgen_malloc,Rs.__wbindgen_realloc),f=Wm;Rs.wgslcomposer_wgsl_compile(s,this.__wbg_ptr,l,f);var i=d0()[s/4+0],a=d0()[s/4+1];return t=i,n=a,f0(i,a)}finally{Rs.__wbindgen_add_to_stack_pointer(16),Rs.__wbindgen_free(t,n,1)}}}function uk(e,r){return Zy(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 lk(){const e={};return e.wbg={},e.wbg.__wbindgen_string_new=function(r,t){const n=f0(r,t);return nk(n)},e.wbg.__wbindgen_object_drop_ref=function(r){ak(r)},e.wbg.__wbg_log_1d3ae0273d8f4f8a=function(r){console.log(h0(r))},e.wbg.__wbg_log_576ca876af0d4a77=function(r,t){console.log(h0(r),h0(t))},e.wbg.__wbindgen_throw=function(r,t){throw new Error(f0(r,t))},e}function ck(e,r){return Rs=e.exports,GE.__wbindgen_wasm_module=r,Gm=null,jm=null,Rs}function GE(e){return Zy(this,null,function*(){if(Rs!==void 0)return Rs;const r=lk();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:t,module:n}=yield uk(yield e,r);return ck(t,n)})}var Ys;(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"})(Ys||(Ys={}));var Py;(function(e){e[e.READ=1]="READ",e[e.WRITE=2]="WRITE"})(Py||(Py={}));function fk(e){var r=0;return e&Ou.SAMPLED&&(r|=Ys.TEXTURE_BINDING|Ys.COPY_DST|Ys.COPY_SRC),e&Ou.STORAGE&&(r|=Ys.TEXTURE_BINDING|Ys.STORAGE_BINDING|Ys.COPY_SRC|Ys.COPY_DST),e&Ou.RENDER_TARGET&&(r|=Ys.RENDER_ATTACHMENT|Ys.TEXTURE_BINDING|Ys.COPY_SRC|Ys.COPY_DST),r}function Oy(e){if(e===It.U8_R_NORM)return"r8unorm";if(e===It.S8_R_NORM)return"r8snorm";if(e===It.U8_RG_NORM)return"rg8unorm";if(e===It.S8_RG_NORM)return"rg8snorm";if(e===It.U32_R)return"r32uint";if(e===It.F32_R)return"r32float";if(e===It.U8_RGBA_RT)return"bgra8unorm";if(e===It.U8_RGBA_RT_SRGB)return"bgra8unorm-srgb";if(e===It.U8_RGBA_NORM)return"rgba8unorm";if(e===It.U8_RGBA_SRGB)return"rgba8unorm-srgb";if(e===It.S8_RGBA_NORM)return"rgba8snorm";if(e===It.F16_RGBA)return"rgba16float";if(e===It.F32_RGBA)return"rgba32float";if(e===It.D24)return"depth24plus";if(e===It.D24_S8)return"depth24plus-stencil8";if(e===It.D32F)return"depth32float";if(e===It.D32F_S8)return"depth32float-stencil8";if(e===It.BC1)return"bc1-rgba-unorm";if(e===It.BC1_SRGB)return"bc1-rgba-unorm-srgb";if(e===It.BC2)return"bc2-rgba-unorm";if(e===It.BC2_SRGB)return"bc2-rgba-unorm-srgb";if(e===It.BC3)return"bc3-rgba-unorm";if(e===It.BC3_SRGB)return"bc3-rgba-unorm-srgb";if(e===It.BC4_SNORM)return"bc4-r-snorm";if(e===It.BC4_UNORM)return"bc4-r-unorm";if(e===It.BC5_SNORM)return"bc5-rg-snorm";if(e===It.BC5_UNORM)return"bc5-rg-unorm";throw"whoops"}function hk(e){if(e===Wi.TEXTURE_2D)return"2d";if(e===Wi.TEXTURE_CUBE_MAP)return"2d";if(e===Wi.TEXTURE_2D_ARRAY)return"2d";if(e===Wi.TEXTURE_3D)return"3d";throw new Error("whoops")}function pk(e){if(e===Wi.TEXTURE_2D)return"2d";if(e===Wi.TEXTURE_CUBE_MAP)return"cube";if(e===Wi.TEXTURE_2D_ARRAY)return"2d-array";if(e===Wi.TEXTURE_3D)return"3d";throw new Error("whoops")}function dk(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 ky(e){if(e===_l.CLAMP_TO_EDGE)return"clamp-to-edge";if(e===_l.REPEAT)return"repeat";if(e===_l.MIRRORED_REPEAT)return"mirror-repeat";throw new Error("whoops")}function XE(e){if(e===rs.BILINEAR)return"linear";if(e===rs.POINT)return"nearest";throw new Error("whoops")}function vk(e){if(e===$s.LINEAR)return"linear";if(e===$s.NEAREST)return"nearest";if(e===$s.NO_MIP)return"nearest";throw new Error("whoops")}function kv(e){var r=e;return r.gpuBuffer}function mk(e){var r=e;return r.gpuSampler}function gk(e){var r=e;return r.querySet}function yk(e){if(e===r0.OcclusionConservative)return"occlusion";throw new Error("whoops")}function _k(e){switch(e){case Cs.TRIANGLES:return"triangle-list";case Cs.POINTS:return"point-list";case Cs.TRIANGLE_STRIP:return"triangle-strip";case Cs.LINES:return"line-list";case Cs.LINE_STRIP:return"line-strip";default:throw new Error("Unknown primitive topology mode")}}function xk(e){if(e===jl.NONE)return"none";if(e===jl.FRONT)return"front";if(e===jl.BACK)return"back";throw new Error("whoops")}function bk(e){if(e===Nm.CCW)return"ccw";if(e===Nm.CW)return"cw";throw new Error("whoops")}function Ek(e,r){return{topology:_k(e),cullMode:xk(r.cullMode),frontFace:bk(r.frontFace)}}function $E(e){if(e===$i.ZERO)return"zero";if(e===$i.ONE)return"one";if(e===$i.SRC)return"src";if(e===$i.ONE_MINUS_SRC)return"one-minus-src";if(e===$i.DST)return"dst";if(e===$i.ONE_MINUS_DST)return"one-minus-dst";if(e===$i.SRC_ALPHA)return"src-alpha";if(e===$i.ONE_MINUS_SRC_ALPHA)return"one-minus-src-alpha";if(e===$i.DST_ALPHA)return"dst-alpha";if(e===$i.ONE_MINUS_DST_ALPHA)return"one-minus-dst-alpha";if(e===$i.CONST)return"constant";if(e===$i.ONE_MINUS_CONSTANT)return"one-minus-constant";if(e===$i.SRC_ALPHA_SATURATE)return"src-alpha-saturated";throw new Error("whoops")}function Sk(e){if(e===iu.ADD)return"add";if(e===iu.SUBSTRACT)return"subtract";if(e===iu.REVERSE_SUBSTRACT)return"reverse-subtract";if(e===iu.MIN)return"min";if(e===iu.MAX)return"max";throw new Error("whoops")}function YE(e){return{operation:Sk(e.blendMode),srcFactor:$E(e.blendSrcFactor),dstFactor:$E(e.blendDstFactor)}}function qE(e){return e.blendMode===iu.ADD&&e.blendSrcFactor===$i.ONE&&e.blendDstFactor===$i.ZERO}function Ak(e){if(!(qE(e.rgbBlendState)&&qE(e.alphaBlendState)))return{color:YE(e.rgbBlendState),alpha:YE(e.alphaBlendState)}}function Tk(e,r){return{format:Oy(r),blend:Ak(e),writeMask:e.channelWriteMask}}function wk(e,r){return r.attachmentsState.map(function(t,n){return Tk(t,e[n])})}function v0(e){if(e===Ui.NEVER)return"never";if(e===Ui.LESS)return"less";if(e===Ui.EQUAL)return"equal";if(e===Ui.LEQUAL)return"less-equal";if(e===Ui.GREATER)return"greater";if(e===Ui.NOTEQUAL)return"not-equal";if(e===Ui.GEQUAL)return"greater-equal";if(e===Ui.ALWAYS)return"always";throw new Error("whoops")}function Dv(e){if(e===Go.KEEP)return"keep";if(e===Go.REPLACE)return"replace";if(e===Go.ZERO)return"zero";if(e===Go.DECREMENT_CLAMP)return"decrement-clamp";if(e===Go.DECREMENT_WRAP)return"decrement-wrap";if(e===Go.INCREMENT_CLAMP)return"increment-clamp";if(e===Go.INCREMENT_WRAP)return"increment-wrap";if(e===Go.INVERT)return"invert";throw new Error("whoops")}function Ck(e,r){if(!(0,Dp.Z)(e))return{format:Oy(e),depthWriteEnabled:!!r.depthWrite,depthCompare:v0(r.depthCompare),depthBias:r.polygonOffset?1:0,depthBiasSlopeScale:r.polygonOffset?1:0,stencilFront:{compare:v0(r.stencilFront.compare),passOp:Dv(r.stencilFront.passOp),failOp:Dv(r.stencilFront.failOp),depthFailOp:Dv(r.stencilFront.depthFailOp)},stencilBack:{compare:v0(r.stencilBack.compare),passOp:Dv(r.stencilBack.passOp),failOp:Dv(r.stencilBack.failOp),depthFailOp:Dv(r.stencilBack.depthFailOp)},stencilReadMask:1,stencilWriteMask:1}}function Rk(e){if(e!==null){if(e===It.U16_R)return"uint16";if(e===It.U32_R)return"uint32";throw new Error("whoops")}}function Mk(e){if(e===Rd.VERTEX)return"vertex";if(e===Rd.INSTANCE)return"instance";throw new Error("whoops")}function Ik(e){if(e===It.U8_R)return"uint8x2";if(e===It.U8_RG)return"uint8x2";if(e===It.U8_RGB)return"uint8x4";if(e===It.U8_RGBA)return"uint8x4";if(e===It.U8_RG_NORM)return"unorm8x2";if(e===It.U8_RGBA_NORM)return"unorm8x4";if(e===It.S8_RGB_NORM)return"snorm8x4";if(e===It.S8_RGBA_NORM)return"snorm8x4";if(e===It.U16_RG_NORM)return"unorm16x2";if(e===It.U16_RGBA_NORM)return"unorm16x4";if(e===It.S16_RG_NORM)return"snorm16x2";if(e===It.S16_RGBA_NORM)return"snorm16x4";if(e===It.S16_RG)return"uint16x2";if(e===It.F16_RG)return"float16x2";if(e===It.F16_RGBA)return"float16x4";if(e===It.F32_R)return"float32";if(e===It.F32_RG)return"float32x2";if(e===It.F32_RGB)return"float32x3";if(e===It.F32_RGBA)return"float32x4";throw"whoops"}function Pk(e){var r=sh(e);switch(r){case Pr.BC1:case Pr.BC2:case Pr.BC3:case Pr.BC4_SNORM:case Pr.BC4_UNORM:case Pr.BC5_SNORM:case Pr.BC5_UNORM:return!0;default:return!1}}function Ok(e){var r=sh(e);switch(r){case Pr.BC1:case Pr.BC2:case Pr.BC3:case Pr.BC4_SNORM:case Pr.BC4_UNORM:case Pr.BC5_SNORM:case Pr.BC5_UNORM:return 4;default:return 1}}function KE(e,r,t,n){switch(t===void 0&&(t=!1),e){case It.S8_R:case It.S8_R_NORM:case It.S8_RG_NORM:case It.S8_RGB_NORM:case It.S8_RGBA_NORM:{var i=r instanceof ArrayBuffer?new Int8Array(r):new Int8Array(r);return n&&i.set(new Int8Array(n)),i}case It.U8_R:case It.U8_R_NORM:case It.U8_RG:case It.U8_RG_NORM:case It.U8_RGB:case It.U8_RGB_NORM:case It.U8_RGB_SRGB:case It.U8_RGBA:case It.U8_RGBA_NORM:case It.U8_RGBA_SRGB:{var a=r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r);return n&&a.set(new Uint8Array(n)),a}case It.S16_R:case It.S16_RG:case It.S16_RG_NORM:case It.S16_RGB_NORM:case It.S16_RGBA:case It.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 It.U16_R:case It.U16_RGB:case It.U16_RGBA_5551:case It.U16_RGBA_NORM:case It.U16_RG_NORM:case It.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 It.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 It.U32_R:case It.U32_RG:{var d=r instanceof ArrayBuffer?new Uint32Array(r):new Uint32Array(t?r/4:r);return n&&d.set(new Uint32Array(n)),d}case It.F32_R:case It.F32_RG:case It.F32_RGB:case It.F32_RGBA:{var _=r instanceof ArrayBuffer?new Float32Array(r):new Float32Array(t?r/4:r);return n&&_.set(new Float32Array(n)),_}}var b=r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r);return n&&b.set(new Uint8Array(n)),b}function kk(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 uh=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=e.call(this)||this;return a.id=n,a.device=i,a}return r.prototype.destroy=function(){},r}(bE.Z),Dk=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s,l,f=e.call(this,{id:n,device:i})||this;f.type=_a.Bindings;var d=a.pipeline;Oi(!!d);var _=a.uniformBufferBindings,b=a.storageBufferBindings,T=a.samplerBindings,M=a.storageTextureBindings;f.numUniformBuffers=(_==null?void 0:_.length)||0;var P=[[],[],[],[]],D=0;if(_&&_.length)for(var G=0;G<_.length;G++){var q=a.uniformBufferBindings[G],se=q.binding,Se=q.size,Ve=q.offset,nt=q.buffer,st={buffer:kv(nt),offset:Ve!=null?Ve:0,size:Se};P[0].push({binding:se!=null?se:D++,resource:st})}if(T&&T.length){D=0;for(var G=0;G<T.length;G++){var at=(0,Pn.pi)((0,Pn.pi)({},T[G]),OE),se=a.samplerBindings[G],At=se.texture!==null?se.texture:f.device.getFallbackTexture(at);at.dimension=At.dimension,at.formatKind=TE(At.format);var Wt=At.gpuTextureView;if(P[1].push({binding:(s=se.textureBinding)!==null&&s!==void 0?s:D++,resource:Wt}),se.samplerBinding!==-1){var Sr=se.sampler!==null?se.sampler:f.device.getFallbackSampler(at),_r=mk(Sr);P[1].push({binding:(l=se.samplerBinding)!==null&&l!==void 0?l:D++,resource:_r})}}}if(b&&b.length){D=0;for(var G=0;G<b.length;G++){var Gr=a.storageBufferBindings[G],se=Gr.binding,Se=Gr.size,Ve=Gr.offset,nt=Gr.buffer,st={buffer:kv(nt),offset:Ve!=null?Ve:0,size:Se};P[2].push({binding:se!=null?se:D++,resource:st})}}if(M&&M.length){D=0;for(var G=0;G<M.length;G++){var Cn=a.storageTextureBindings[G],se=Cn.binding,At=Cn.texture,Wt=At.gpuTextureView;P[3].push({binding:se!=null?se:D++,resource:Wt})}}var wi=P.findLastIndex(function(la){return!!la.length});return f.gpuBindGroup=P.map(function(la,co){return co<=wi&&f.device.device.createBindGroup({layout:d.getBindGroupLayout(co),entries:la})}),f}return r}(uh),Lk=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=_a.Buffer;var l=a.usage,f=a.viewOrSize,d=!!(l&no.MAP_READ);s.usage=dk(l),d&&(s.usage=no.MAP_READ|no.COPY_DST);var _=!(0,Sv.Z)(f);if(s.view=(0,Sv.Z)(f)?null:f,s.size=(0,Sv.Z)(f)?a0(f,4):a0(f.byteLength,4),(0,Sv.Z)(f))s.gpuBuffer=s.device.device.createBuffer({usage:s.usage,size:s.size,mappedAtCreation:d?_:!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,a){i===void 0&&(i=0),a===void 0&&(a=0);var s=this.gpuBuffer;a=a||n.byteLength,a=Math.min(a,this.size-t);var l=n.byteOffset+i,f=l+a,d=a+3&-4;if(d!==a){var _=new Uint8Array(n.buffer.slice(l,f));n=new Uint8Array(d),n.set(_),i=0,l=0,f=d,a=d}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,a-T)},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.gpuBuffer.destroy()},r}(uh),Bk=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(){Oi(this.gpuComputePassEncoder===null),this.gpuComputePassEncoder=this.commandEncoder.beginComputePass(this.gpuComputePassDescriptor)},e.prototype.setPipeline=function(r){var t=r,n=Md(t.gpuComputePipeline);this.gpuComputePassEncoder.setPipeline(n)},e.prototype.setBindings=function(r){var t=this,n=r;n.gpuBindGroup.forEach(function(i,a){i&&t.gpuComputePassEncoder.setBindGroup(a,n.gpuBindGroup[a])})},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}(),Fk=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=_a.ComputePipeline,s.gpuComputePipeline=null,s.descriptor=a;var l=a.program,f=l.computeStage;if(f===null)return s;var d={layout:"auto",compute:(0,Pn.pi)({},f)};return s.gpuComputePipeline=s.device.device.createComputePipeline(d),s.name!==void 0&&(s.gpuComputePipeline.label=s.name),s}return r.prototype.getBindGroupLayout=function(t){return this.gpuComputePipeline.getBindGroupLayout(t)},r}(uh),Nk=function(e){(0,Pn.ZT)(r,e);function r(t){var n,i,a,s,l=t.id,f=t.device,d=t.descriptor,_=e.call(this,{id:l,device:f})||this;_.type=_a.InputLayout;var b=[];try{for(var T=(0,Pn.XA)(d.vertexBufferDescriptors),M=T.next();!M.done;M=T.next()){var P=M.value,D=P.arrayStride,G=P.stepMode,q=P.attributes;b.push({arrayStride:D,stepMode:Mk(G),attributes:[]});try{for(var se=(a=void 0,(0,Pn.XA)(q)),Se=se.next();!Se.done;Se=se.next()){var Ve=Se.value,nt=Ve.shaderLocation,st=Ve.format,at=Ve.offset;b[b.length-1].attributes.push({shaderLocation:nt,format:Ik(st),offset:at})}}catch(At){a={error:At}}finally{try{Se&&!Se.done&&(s=se.return)&&s.call(se)}finally{if(a)throw a.error}}}}catch(At){n={error:At}}finally{try{M&&!M.done&&(i=T.return)&&i.call(T)}finally{if(n)throw n.error}}return _.indexFormat=Rk(d.indexBufferFormat),_.buffers=b,_}return r}(uh),QE=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=e.call(this,{id:n,device:i})||this;return s.type=_a.Program,s.vertexStage=null,s.fragmentStage=null,s.computeStage=null,s.descriptor=a,a.vertex&&(s.vertexStage=s.createShaderStage(a.vertex,"vertex")),a.fragment&&(s.fragmentStage=s.createShaderStage(a.fragment,"fragment")),a.compute&&(s.computeStage=s.createShaderStage(a.compute,"compute")),s}return r.prototype.setUniformsLegacy=function(t){},r.prototype.createShaderStage=function(t,n){var i,a,s=t.glsl,l=t.wgsl,f=t.entryPoint,d=t.postprocess,_=!1,b=l;if(!b)try{b=this.device.glsl_compile(s,n,_)}catch(q){throw console.error(q,s),new Error("whoops")}var T=function(q){if(!b.includes(q))return"continue";b=b.replace("var T_".concat(q,": texture_2d<f32>;"),"var T_".concat(q,": texture_depth_2d;")),b=b.replace(new RegExp("textureSample\\(T_".concat(q,"(.*)\\);$"),"gm"),function(se,Se){return"vec4<f32>(textureSample(T_".concat(q).concat(Se,"), 0.0, 0.0, 0.0);")})};try{for(var M=(0,Pn.XA)(["u_TextureFramebufferDepth"]),P=M.next();!P.done;P=M.next()){var D=P.value;T(D)}}catch(q){i={error:q}}finally{try{P&&!P.done&&(a=M.return)&&a.call(M)}finally{if(i)throw i.error}}d&&(b=d(b));var G=this.device.device.createShaderModule({code:b});return{module:G,entryPoint:f||"main"}},r}(uh),Uk=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=e.call(this,{id:n,device:i})||this;s.type=_a.QueryPool;var l=a.elemCount,f=a.type;return s.querySet=s.device.device.createQuerySet({type:yk(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}(uh),zk=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=e.call(this,{id:n,device:i})||this;return a.type=_a.Readback,a}return r.prototype.readTexture=function(t,n,i,a,s,l,f,d){return f===void 0&&(f=0),(0,Pn.mG)(this,void 0,void 0,function(){var _,b,T,M,P,D,G,q;return(0,Pn.Jh)(this,function(se){return _=t,b=0,T=this.getBlockInformationFromFormat(_.gpuTextureformat),M=Math.ceil(a/T.width)*T.length,P=Math.ceil(M/256)*256,D=P*s,G=this.device.createBuffer({usage:no.STORAGE|no.MAP_READ|no.COPY_DST,hint:bf.STATIC,viewOrSize:D}),q=this.device.device.createCommandEncoder(),q.copyTextureToBuffer({texture:_.gpuTexture,mipLevel:0,origin:{x:n,y:i,z:Math.max(b,0)}},{buffer:G.gpuBuffer,offset:0,bytesPerRow:P},{width:a,height:s,depthOrArrayLayers:1}),this.device.device.queue.submit([q.finish()]),[2,this.readBuffer(G,0,l.byteLength===D?l:null,f,D,_.format,!0,!1,M,P,s)]})})},r.prototype.readTextureSync=function(t,n,i,a,s,l,f,d){throw new Error("ERROR_MSG_METHOD_NOT_IMPLEMENTED")},r.prototype.readBuffer=function(t,n,i,a,s,l,f,d,_,b,T){var M=this;n===void 0&&(n=0),i===void 0&&(i=null),s===void 0&&(s=0),l===void 0&&(l=It.U8_RGB),f===void 0&&(f=!1),_===void 0&&(_=0),b===void 0&&(b=0),T===void 0&&(T=0);var P=t,D=s||P.size,G=i||P.view,q=G&&G.constructor&&G.constructor.BYTES_PER_ELEMENT||AE(l),se=P;if(!(P.usage&no.MAP_READ&&P.usage&no.COPY_DST)){var Se=this.device.device.createCommandEncoder();se=this.device.createBuffer({usage:no.STORAGE|no.MAP_READ|no.COPY_DST,hint:bf.STATIC,viewOrSize:D}),Se.copyBufferToBuffer(P.gpuBuffer,n,se.gpuBuffer,0,D),this.device.device.queue.submit([Se.finish()])}return new Promise(function(Ve,nt){se.gpuBuffer.mapAsync(Py.READ,n,D).then(function(){var st=se.gpuBuffer.getMappedRange(n,D),at=G;if(f)at===null?at=KE(l,D,!0,st):at=KE(l,at.buffer,void 0,st);else if(at===null)switch(q){case 1:at=new Uint8Array(D),at.set(new Uint8Array(st));break;case 2:at=M.getHalfFloatAsFloatRGBAArrayBuffer(D/2,st);break;case 4:at=new Float32Array(D/4),at.set(new Float32Array(st));break}else switch(q){case 1:at=new Uint8Array(at.buffer),at.set(new Uint8Array(st));break;case 2:at=M.getHalfFloatAsFloatRGBAArrayBuffer(D/2,st,G);break;case 4:var At=G&&G.constructor||Float32Array;at=new At(at.buffer),at.set(new At(st));break}if(_!==b){q===1&&!f&&(_*=2,b*=2);for(var Wt=new Uint8Array(at.buffer),Sr=_,_r=0,Gr=1;Gr<T;++Gr){_r=Gr*b;for(var Cn=0;Cn<_;++Cn)Wt[Sr++]=Wt[_r++]}q!==0&&!f?at=new Float32Array(Wt.buffer,0,Sr/4):at=new Uint8Array(Wt.buffer,0,Sr)}se.gpuBuffer.unmap(),Ve(at)},function(st){return nt(st)})})},r.prototype.getHalfFloatAsFloatRGBAArrayBuffer=function(t,n,i){i||(i=new Float32Array(t));for(var a=new Uint16Array(n);t--;)i[t]=kk(a[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}(uh),Zk=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 Oi(t<r.mipLevelCount),r.mipLevelCount===1?r.gpuTextureView:r.gpuTexture.createView({baseMipLevel:t,mipLevelCount:1})},e.prototype.setRenderPassDescriptor=function(r){var t,n,i,a,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 d=0;d<r.colorAttachment.length;d++){var _=r.colorAttachment[d],b=r.colorResolveTo[d];if(_===null&&b!==null&&(_=b,b=null),this.gfxColorAttachment[d]=_,this.gfxColorResolveTo[d]=b,this.gfxColorAttachmentLevel[d]=((t=r.colorAttachmentLevel)===null||t===void 0?void 0:t[d])||0,this.gfxColorResolveToLevel[d]=((n=r.colorResolveToLevel)===null||n===void 0?void 0:n[d])||0,_!==null){this.gpuColorAttachments[d]===void 0&&(this.gpuColorAttachments[d]={});var T=this.gpuColorAttachments[d];T.view=this.getTextureView(_,((i=this.gfxColorAttachmentLevel)===null||i===void 0?void 0:i[d])||0);var M=(s=(a=r.colorClearColor)===null||a===void 0?void 0:a[d])!==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[d]?"store":"discard",T.resolveTarget=void 0,b!==null&&(_.sampleCount>1?T.resolveTarget=this.getTextureView(b,this.gfxColorResolveToLevel[d]):T.storeOp="store")}else{this.gpuColorAttachments.length=d,this.gfxColorAttachment.length=d,this.gfxColorResolveTo.length=d;break}}if(this.gfxDepthStencilAttachment=r.depthStencilAttachment,this.gfxDepthStencilResolveTo=r.depthStencilResolveTo,r.depthStencilAttachment){var P=r.depthStencilAttachment,T=this.gpuDepthStencilAttachment;T.view=P.gpuTextureView;var D=!!(wv(P.format)&wn.Depth);D?(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 G=!!(wv(P.format)&wn.Stencil);G?(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,Dp.Z)(r.occlusionQueryPool)?void 0:gk(r.occlusionQueryPool)},e.prototype.beginRenderPass=function(r){Oi(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,a,s){a===void 0&&(a=0),s===void 0&&(s=1),this.gpuRenderPassEncoder.setViewport(r,this.flipY(t,i),n,i,a,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=Md(t.gpuRenderPipeline);this.gpuRenderPassEncoder.setPipeline(n)},e.prototype.setVertexInput=function(r,t,n){if(r!==null){var i=r;n!==null&&this.gpuRenderPassEncoder.setIndexBuffer(kv(n.buffer),Md(i.indexFormat),n.offset);for(var a=0;a<t.length;a++){var s=t[a];s!==null&&this.gpuRenderPassEncoder.setVertexBuffer(a,kv(s.buffer),s.offset)}}},e.prototype.setBindings=function(r){var t=this,n=r;n.gpuBindGroup.forEach(function(i,a){i&&t.gpuRenderPassEncoder.setBindGroup(a,n.gpuBindGroup[a])})},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,a){this.gpuRenderPassEncoder.drawIndexed(r,t,n,i,a)},e.prototype.drawIndirect=function(r,t){this.gpuRenderPassEncoder.drawIndirect(kv(r),t)},e.prototype.drawIndexedIndirect=function(r,t){this.gpuRenderPassEncoder.drawIndexedIndirect(kv(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){Oi(n.sampleCount===1);var a={texture:n.gpuTexture,mipLevel:i},s={texture:r.gpuTexture,mipLevel:t};Oi(n.width>>>i===r.width>>>t),Oi(n.height>>>i===r.height>>>t),Oi(!!(n.usage&Ys.COPY_SRC)),Oi(!!(r.usage&Ys.COPY_DST)),this.commandEncoder.copyTextureToTexture(a,s,[r.width,r.height,1])},e}(),Vk=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=e.call(this,{id:n,device:i})||this;return s.type=_a.RenderPipeline,s.isCreatingAsync=!1,s.gpuRenderPipeline=null,s.descriptor=a,s.device.createRenderPipelineInternal(s,!1),s}return r.prototype.getBindGroupLayout=function(t){return this.gpuRenderPipeline.getBindGroupLayout(t)},r}(uh),jk=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s,l,f=e.call(this,{id:n,device:i})||this;f.type=_a.Sampler;var d=a.lodMinClamp,_=a.mipmapFilter===$s.NO_MIP?a.lodMinClamp:a.lodMaxClamp,b=(s=a.maxAnisotropy)!==null&&s!==void 0?s:1;return b>1&&Oi(a.minFilter===rs.BILINEAR&&a.magFilter===rs.BILINEAR&&a.mipmapFilter===$s.LINEAR),f.gpuSampler=f.device.device.createSampler({addressModeU:ky(a.addressModeU),addressModeV:ky(a.addressModeV),addressModeW:ky((l=a.addressModeW)!==null&&l!==void 0?l:a.addressModeU),lodMinClamp:d,lodMaxClamp:_,minFilter:XE(a.minFilter),magFilter:XE(a.magFilter),mipmapFilter:vk(a.mipmapFilter),compare:a.compareFunction!==void 0?v0(a.compareFunction):void 0,maxAnisotropy:b}),f}return r}(uh),m0=function(e){(0,Pn.ZT)(r,e);function r(t){var n=t.id,i=t.device,a=t.descriptor,s=t.skipCreate,l=t.sampleCount,f=e.call(this,{id:n,device:i})||this;f.type=_a.Texture,f.flipY=!1;var d=a.format,_=a.dimension,b=a.width,T=a.height,M=a.depthOrArrayLayers,P=a.mipLevelCount,D=a.usage,G=a.pixelStore;return f.flipY=!!(G!=null&&G.unpackFlipY),f.device.createTextureShared({format:d,dimension:_!=null?_:Wi.TEXTURE_2D,width:b,height:T,depthOrArrayLayers:M!=null?M:1,mipLevelCount:P!=null?P:1,usage:D,sampleCount:l!=null?l:1},f,s),f}return r.prototype.textureFromImageBitmapOrCanvas=function(t,n,i){for(var a=n[0].width,s=n[0].height,l={size:{width:a,height:s,depthOrArrayLayers:i},format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT},f=t.createTexture(l),d=0;d<n.length;d++)t.queue.copyExternalImageToTexture({source:n[d],flipY:this.flipY},{texture:f,origin:[0,0,d]},[a,s]);return[f,a,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,a=this,s=this.device.device,l,f,d;this.isImageBitmapOrCanvases(t)?(i=(0,Pn.CR)(this.textureFromImageBitmapOrCanvas(s,t,this.depthOrArrayLayers),3),l=i[0],f=i[1],d=i[2]):this.isVideo(t)?l=s.importExternalTexture({source:t[0]}):t.forEach(function(_){s.queue.writeTexture({texture:a.gpuTexture},_,{},{width:a.width,height:a.height})}),this.width=f,this.height=d,l&&(this.gpuTexture=l),this.gpuTextureView=this.gpuTexture.createView({dimension:pk(this.dimension)})},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.gpuTexture.destroy()},r}(uh),Hk=function(){function e(r,t,n,i,a,s){this.swapChainWidth=0,this.swapChainHeight=0,this.swapChainTextureUsage=Ys.RENDER_ATTACHMENT|Ys.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=Av.UPPER_LEFT,this.clipSpaceNearZ=Tv.ZERO,this.supportsSyncPipelineCompilation=!1,this.supportMRT=!0,this.device=t,this.canvas=n,this.canvasContext=i,this.glsl_compile=a,this.WGSLComposer=s,this.fallbackTexture2D=this.createFallbackTexture(Wi.TEXTURE_2D,Xo.Float),this.setResourceName(this.fallbackTexture2D,"Fallback Texture2D"),this.fallbackTexture2DDepth=this.createFallbackTexture(Wi.TEXTURE_2D,Xo.Depth),this.setResourceName(this.fallbackTexture2DDepth,"Fallback Depth Texture2D"),this.fallbackTexture2DArray=this.createFallbackTexture(Wi.TEXTURE_2D_ARRAY,Xo.Float),this.setResourceName(this.fallbackTexture2DArray,"Fallback Texture2DArray"),this.fallbackTexture3D=this.createFallbackTexture(Wi.TEXTURE_3D,Xo.Float),this.setResourceName(this.fallbackTexture3D,"Fallback Texture3D"),this.fallbackTextureCube=this.createFallbackTexture(Wi.TEXTURE_CUBE_MAP,Xo.Float),this.setResourceName(this.fallbackTextureCube,"Fallback TextureCube"),this.fallbackSamplerFiltering=this.createSampler({addressModeU:_l.REPEAT,addressModeV:_l.REPEAT,minFilter:rs.POINT,magFilter:rs.POINT,mipmapFilter:$s.NEAREST}),this.setResourceName(this.fallbackSamplerFiltering,"Fallback Sampler Filtering"),this.fallbackSamplerComparison=this.createSampler({addressModeU:_l.REPEAT,addressModeV:_l.REPEAT,minFilter:rs.POINT,magFilter:rs.POINT,mipmapFilter:$s.NEAREST,compareFunction:Ui.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 m0({id:0,device:this,descriptor:{format:It.U8_RGBA_RT,width:this.swapChainWidth,height:this.swapChainHeight,depthOrArrayLayers:0,dimension:Wi.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 Lk({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createTexture=function(r){return new m0({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createSampler=function(r){return new jk({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderTarget=function(r){var t=new m0({id:this.getNextUniqueId(),device:this,descriptor:(0,Pn.pi)((0,Pn.pi)({},r),{dimension:Wi.TEXTURE_2D,mipLevelCount:1,depthOrArrayLayers:1,usage:Ou.RENDER_TARGET}),sampleCount:r.sampleCount});return t.depthOrArrayLayers=1,t.type=_a.RenderTarget,t},e.prototype.createRenderTargetFromTexture=function(r){var t=r,n=t.format,i=t.width,a=t.height,s=t.depthOrArrayLayers,l=t.sampleCount,f=t.mipLevelCount,d=t.gpuTexture,_=t.gpuTextureView,b=t.usage;Oi(!!(b&Ys.RENDER_ATTACHMENT));var T=new m0({id:this.getNextUniqueId(),device:this,descriptor:{format:n,width:i,height:a,depthOrArrayLayers:s,dimension:Wi.TEXTURE_2D,mipLevelCount:f,usage:b},skipCreate:!0});return T.depthOrArrayLayers=s,T.sampleCount=l,T.gpuTexture=d,T.gpuTextureView=_,T},e.prototype.createProgram=function(r){var t,n;return!((t=r.vertex)===null||t===void 0)&&t.glsl&&(r.vertex.glsl=Fp(this.queryVendorInfo(),"vert",r.vertex.glsl)),!((n=r.fragment)===null||n===void 0)&&n.glsl&&(r.fragment.glsl=Fp(this.queryVendorInfo(),"frag",r.fragment.glsl)),new QE({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createProgramSimple=function(r){return new QE({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},a=r.mipLevelCount,s=Oy(r.format),l=hk(r.dimension),f=fk(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=a,t.usage=f,t.sampleCount=r.sampleCount,!n){var d=this.device.createTexture({size:i,mipLevelCount:a,format:s,dimension:l,sampleCount:r.sampleCount,usage:f}),_=d.createView();t.gpuTexture=d,t.gpuTextureView=_}},e.prototype.getFallbackSampler=function(r){var t=r.formatKind;return t===Xo.Depth&&r.comparison?this.fallbackSamplerComparison:this.fallbackSamplerFiltering},e.prototype.getFallbackTexture=function(r){var t=r.dimension,n=r.formatKind;if(t===Wi.TEXTURE_2D)return n===Xo.Depth?this.fallbackTexture2DDepth:this.fallbackTexture2D;if(t===Wi.TEXTURE_2D_ARRAY)return this.fallbackTexture2DArray;if(t===Wi.TEXTURE_3D)return this.fallbackTexture3D;if(t===Wi.TEXTURE_CUBE_MAP)return this.fallbackTextureCube;throw new Error("whoops")},e.prototype.createFallbackTexture=function(r,t){var n=r===Wi.TEXTURE_CUBE_MAP?6:1,i=t===Xo.Float?It.U8_RGBA_NORM:It.D24;return this.createTexture({dimension:r,format:i,usage:Ou.SAMPLED,width:1,height:1,depthOrArrayLayers:n,mipLevelCount:1})},e.prototype.createBindings=function(r){return new Dk({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createInputLayout=function(r){return new Nk({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createComputePipeline=function(r){return new Fk({id:this.getNextUniqueId(),device:this,descriptor:r})},e.prototype.createRenderPipeline=function(r){return new Vk({id:this.getNextUniqueId(),device:this,descriptor:(0,Pn.pi)({},r)})},e.prototype.createQueryPool=function(r,t){return new Uk({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,a=i.program,s=a.vertexStage,l=a.fragmentStage;if(!(s===null||l===null)){var f=i.megaStateDescriptor||{},d=f.stencilBack,_=f.stencilFront,b=(0,Pn._T)(f,["stencilBack","stencilFront"]),T=Mv(Id);i.megaStateDescriptor=(0,Pn.pi)((0,Pn.pi)((0,Pn.pi)({},T),{stencilBack:(0,Pn.pi)((0,Pn.pi)({},T.stencilBack),d),stencilFront:(0,Pn.pi)((0,Pn.pi)({},T.stencilFront),_)}),b);var M=i.megaStateDescriptor.attachmentsState[0];i.colorAttachmentFormats.forEach(function(Ve,nt){i.megaStateDescriptor.attachmentsState[nt]||(i.megaStateDescriptor.attachmentsState[nt]=IE(void 0,M))});var P=Ek((n=i.topology)!==null&&n!==void 0?n:Cs.TRIANGLES,i.megaStateDescriptor),D=wk(i.colorAttachmentFormats,i.megaStateDescriptor),G=Ck(i.depthStencilAttachmentFormat,i.megaStateDescriptor),q=void 0;i.inputLayout!==null&&(q=i.inputLayout.buffers);var se=i.sampleCount,Se={layout:"auto",vertex:(0,Pn.pi)((0,Pn.pi)({},s),{buffers:q}),primitive:P,depthStencil:G,multisample:{count:se},fragment:(0,Pn.pi)((0,Pn.pi)({},l),{targets:D})};r.gpuRenderPipeline=this.device.createRenderPipeline(Se)}}},e.prototype.createReadback=function(){return new zk({id:this.getNextUniqueId(),device:this})},e.prototype.createRenderPass=function(r){var t=this.renderPassPool.pop();return t===void 0&&(t=new Zk(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 Bk),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,a,s,l){var f=this.device.createCommandEncoder(),d=r,_=i,b={texture:_.gpuTexture,origin:[a,s,0],mipLevel:0,aspect:"all"},T={texture:d.gpuTexture,origin:[t,n,0],mipLevel:0,aspect:"all"};Oi(!!(_.usage&Ys.COPY_SRC)),Oi(!!(d.usage&Ys.COPY_DST)),f.copyTextureToTexture(b,T,[_.width,_.height,l||1]),this.device.queue.submit([f.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(Pk(r)){if(!this.featureTextureCompressionBC)return!1;var i=Ok(r);return t%i!==0||n%i!==0?!1:this.featureTextureCompressionBC}switch(r){case It.U16_RGBA_NORM:return!1;case It.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===_a.Buffer){var n=r;n.gpuBuffer.label=t}else if(r.type===_a.Texture){var n=r;n.gpuTexture.label=t,n.gpuTextureView.label=t}else if(r.type===_a.RenderTarget){var n=r;n.gpuTexture.label=t,n.gpuTextureView.label=t}else if(r.type===_a.Sampler){var n=r;n.gpuSampler.label=t}else if(r.type===_a.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}(),Wk=function(){function e(r){this.pluginOptions=r}return e.prototype.createSwapChain=function(r){return(0,Pn.mG)(this,void 0,void 0,function(){var t,n,i,a,s,l,f,d;return(0,Pn.Jh)(this,function(_){switch(_.label){case 0:if(globalThis.navigator.gpu===void 0)return[2,null];t=null,_.label=1;case 1:return _.trys.push([1,3,,4]),n=this.pluginOptions.xrCompatible,[4,globalThis.navigator.gpu.requestAdapter({xrCompatible:n})];case 2:return t=_.sent(),[3,4];case 3:return i=_.sent(),console.log(i),[3,4];case 4:return t===null?[2,null]:(a=["depth32float-stencil8","texture-compression-bc"],s=a.filter(function(b){return t.features.has(b)}),[4,t.requestDevice({requiredFeatures:s})]);case 5:if(l=_.sent(),l&&(f=this.pluginOptions.onContextLost,l.lost.then(function(){f&&f()})),l===null)return[2,null];if(d=r.getContext("webgpu"),!d)return[2,null];_.label=6;case 6:return _.trys.push([6,8,,9]),[4,GE(this.pluginOptions.shaderCompilerPath)];case 7:return _.sent(),[3,9];case 8:return _.sent(),[3,9];case 9:return[2,new Hk(t,l,r,d,sk,Xm&&new Xm)]}})})},e}(),Gk=ui.isPlainObject,Xk=ui.isTypedArray,$k=function(){function e(r,t){(0,Q.Z)(this,e),(0,F.Z)(this,"destroyed",!1),(0,F.Z)(this,"uniforms",{}),this.reGl=r;var n=t.vs,i=t.fs,a=t.attributes,s=t.uniforms,l=t.primitive,f=t.count,d=t.elements,_=t.depth,b=t.cull,T=t.instances,M={platformString:"WebGL1",glslVersion:"#version 100",explicitBindingLocations:!1,separateSamplerTextures:!1,viewportOrigin:Av.LOWER_LEFT,clipSpaceNearZ:Tv.NEGATIVE_ONE,supportMRT:!1},P={};this.options=t,s&&(this.uniforms=this.extractUniforms(s),Object.keys(s).forEach(function(Se){P[Se]=r.prop(Se)}));var D={};Object.keys(a).forEach(function(Se){D[Se]=a[Se].get()});var G=dm(Fp(M,"frag",i,null,!1)),q=dm(Fp(M,"vert",n,null,!1)),se={attributes:D,frag:G,uniforms:P,vert:q,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:H5[l===void 0?I.TRIANGLES:l]};T&&(se.instances=T),f?se.count=f:d&&(se.elements=d.get()),this.initDepthDrawParams({depth:_},se),this.initCullDrawParams({cull:b},se),this.drawCommand=r(se),this.drawParams=se}return(0,j.Z)(e,[{key:"updateAttributesAndElements",value:function(t,n){var i={};Object.keys(t).forEach(function(a){i[a]=t[a].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,H.Z)((0,H.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,H.Z)((0,H.Z)({},this.uniforms),this.extractUniforms(t.uniforms||{})),a={};Object.keys(i).forEach(function(s){var l=(0,Hs.Z)(i[s]);l==="boolean"||l==="number"||Array.isArray(i[s])||i[s].BYTES_PER_ELEMENT?a[s]=i[s]:a[s]=i[s].get()}),a.blend=n?this.getBlendDrawParams({blend:{enable:!1}}):this.getBlendDrawParams(t),a.stencil=this.getStencilDrawParams(t),a.colorMask=this.getColorMaskDrawParams(t,n),this.drawCommand(a)}}},{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:$5[i.func||I.LESS],range:i.range||[0,1]})}},{key:"getBlendDrawParams",value:function(t){var n=t.blend,i=n||{},a=i.enable,s=i.func,l=i.equation,f=i.color,d=f===void 0?[0,0,0,0]:f;return{enable:!!a,func:{srcRGB:t0[s&&s.srcRGB||I.SRC_ALPHA],srcAlpha:t0[s&&s.srcAlpha||I.SRC_ALPHA],dstRGB:t0[s&&s.dstRGB||I.ONE_MINUS_SRC_ALPHA],dstAlpha:t0[s&&s.dstAlpha||I.ONE_MINUS_SRC_ALPHA]},equation:{rgb:xE[l&&l.rgb||I.FUNC_ADD],alpha:xE[l&&l.alpha||I.FUNC_ADD]},color:d}}},{key:"getStencilDrawParams",value:function(t){var n=t.stencil,i=n||{},a=i.enable,s=i.mask,l=s===void 0?-1:s,f=i.func,d=f===void 0?{cmp:I.ALWAYS,ref:0,mask:-1}:f,_=i.opFront,b=_===void 0?{fail:I.KEEP,zfail:I.KEEP,zpass:I.KEEP}:_,T=i.opBack,M=T===void 0?{fail:I.KEEP,zfail:I.KEEP,zpass:I.KEEP}:T;return{enable:!!a,mask:l,func:(0,H.Z)((0,H.Z)({},d),{},{cmp:Y5[d.cmp]}),opFront:{fail:Ev[b.fail],zfail:Ev[b.zfail],zpass:Ev[b.zpass]},opBack:{fail:Ev[M.fail],zfail:Ev[M.zfail],zpass:Ev[M.zpass]}}}},{key:"getColorMaskDrawParams",value:function(t,n){var i=t.stencil,a=i!=null&&i.enable&&i.opFront&&!n?[!1,!1,!1,!1]:[!0,!0,!0,!0];return a}},{key:"initCullDrawParams",value:function(t,n){var i=t.cull;if(i){var a=i.enable,s=i.face,l=s===void 0?I.BACK:s;n.cull={enable:!!a,face:q5[l]}}}},{key:"extractUniforms",value:function(t){var n=this,i={};return Object.keys(t).forEach(function(a){n.extractUniformsRecursively(a,t[a],i,"")}),i}},{key:"extractUniformsRecursively",value:function(t,n,i,a){var s=this;if(n===null||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&typeof n[0]=="number"||Xk(n)||n===""||"resize"in n){i["".concat(a&&a+".").concat(t)]=n;return}Gk(n)&&Object.keys(n).forEach(function(l){s.extractUniformsRecursively(l,n[l],i,"".concat(a&&a+".").concat(t))}),Array.isArray(n)&&n.forEach(function(l,f){Object.keys(l).forEach(function(d){s.extractUniformsRecursively(d,l[d],i,"".concat(a&&a+".").concat(t,"[").concat(f,"]"))})})}}]),e}(),Yk=function(){function e(r,t){(0,Q.Z)(this,e),(0,F.Z)(this,"isDestroy",!1);var n=t.data,i=t.type,a=i===void 0?I.UNSIGNED_BYTE:i,s=t.width,l=t.height,f=t.flipY,d=f===void 0?!1:f,_=t.format,b=_===void 0?I.RGBA:_,T=t.mipmap,M=T===void 0?!1:T,P=t.wrapS,D=P===void 0?I.CLAMP_TO_EDGE:P,G=t.wrapT,q=G===void 0?I.CLAMP_TO_EDGE:G,se=t.aniso,Se=se===void 0?0:se,Ve=t.alignment,nt=Ve===void 0?1:Ve,st=t.premultiplyAlpha,at=st===void 0?!1:st,At=t.mag,Wt=At===void 0?I.NEAREST:At,Sr=t.min,_r=Sr===void 0?I.NEAREST:Sr,Gr=t.colorSpace,Cn=Gr===void 0?I.BROWSER_DEFAULT_WEBGL:Gr,wi=t.x,la=wi===void 0?0:wi,co=t.y,Yo=co===void 0?0:co,Uo=t.copy,qs=Uo===void 0?!1:Uo;this.width=s,this.height=l;var bl={width:s,height:l,type:Sy[a],format:W5[b],wrapS:_E[D],wrapT:_E[q],mag:yE[Wt],min:yE[_r],alignment:nt,flipY:d,colorSpace:X5[Cn],premultiplyAlpha:at,aniso:Se,x:la,y:Yo,copy:qs};n&&(bl.data=n),typeof M=="number"?bl.mipmap=G5[M]:typeof M=="boolean"&&(bl.mipmap=M),this.texture=r.texture(bl)}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}(),JE,eS,qk=(JE=(0,er.b2)(),JE(eS=function(){function e(){var r=this;(0,Q.Z)(this,e),(0,F.Z)(this,"uniformBuffers",[]),(0,F.Z)(this,"queryVerdorInfo",function(){return"WebGL1"}),(0,F.Z)(this,"createModel",function(t){return new $k(r.gl,t)}),(0,F.Z)(this,"createAttribute",function(t){return new j5(r.gl,t)}),(0,F.Z)(this,"createBuffer",function(t){return new K5(r.gl,t)}),(0,F.Z)(this,"createElements",function(t){return new Q5(r.gl,t)}),(0,F.Z)(this,"createTexture2D",function(t){return new Yk(r.gl,t)}),(0,F.Z)(this,"createFramebuffer",function(t){return new J5(r.gl,t)}),(0,F.Z)(this,"useFramebuffer",function(t,n){r.gl({framebuffer:t?t.get():null})(n)}),(0,F.Z)(this,"clear",function(t){var n,i=t.color,a=t.depth,s=t.stencil,l=t.framebuffer,f=l===void 0?null:l,d={color:i,depth:a,stencil:s};d.framebuffer=f===null?f:f.get(),(n=r.gl)===null||n===void 0||n.clear(d)}),(0,F.Z)(this,"viewport",function(t){var n=t.x,i=t.y,a=t.width,s=t.height;r.gl._gl.viewport(n,i,a,s),r.width=a,r.height=s,r.gl._refresh()}),(0,F.Z)(this,"readPixels",function(t){var n=t.framebuffer,i=t.x,a=t.y,s=t.width,l=t.height,f={x:i,y:a,width:s,height:l};return n&&(f.framebuffer=n.get()),r.gl.read(f)}),(0,F.Z)(this,"getViewportSize",function(){return{width:r.gl._gl.drawingBufferWidth,height:r.gl._gl.drawingBufferHeight}}),(0,F.Z)(this,"getContainer",function(){var t;return(t=r.canvas)===null||t===void 0?void 0:t.parentElement}),(0,F.Z)(this,"getCanvas",function(){return r.canvas}),(0,F.Z)(this,"getGLContext",function(){return r.gl._gl}),(0,F.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,Ft.Z)(_e().mark(function n(i,a,s){var l=this;return _e().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(this.canvas=i,!s){d.next=5;break}this.gl=s,d.next=8;break;case 5:return d.next=7,new Promise(function(_,b){V5()({canvas:l.canvas,attributes:{alpha:!0,antialias:a.antialias,premultipliedAlpha:!0,preserveDrawingBuffer:a.preserveDrawingBuffer,stencil:a.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,P){(M||!P)&&b(M),_(P)}})});case 7:this.gl=d.sent;case 8:this.extensionObject={OES_texture_float:this.testExtension("OES_texture_float")};case 9:case"end":return d.stop()}},n,this)}));function t(n,i,a){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}())||eS),Kk=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.buffer,i=t.offset,a=t.stride,s=t.normalized,l=t.size,f=t.divisor,d=t.shaderLocation;this.buffer=n,this.attribute={shaderLocation:d,buffer:n.get(),offset:i||0,stride:a||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}(),Up,Qh,Lv,$m,Ym,lh,g0,Pd,ku,ch,fh,y0=(Up={},(0,F.Z)(Up,I.FLOAT,Float32Array),(0,F.Z)(Up,I.UNSIGNED_BYTE,Uint8Array),(0,F.Z)(Up,I.SHORT,Int16Array),(0,F.Z)(Up,I.UNSIGNED_SHORT,Uint16Array),(0,F.Z)(Up,I.INT,Int32Array),(0,F.Z)(Up,I.UNSIGNED_INT,Uint32Array),Up),Qk=(Qh={},(0,F.Z)(Qh,I.POINTS,Cs.POINTS),(0,F.Z)(Qh,I.LINES,Cs.LINES),(0,F.Z)(Qh,I.LINE_LOOP,Cs.LINES),(0,F.Z)(Qh,I.LINE_STRIP,Cs.LINE_STRIP),(0,F.Z)(Qh,I.TRIANGLES,Cs.TRIANGLES),(0,F.Z)(Qh,I.TRIANGLE_FAN,Cs.TRIANGLES),(0,F.Z)(Qh,I.TRIANGLE_STRIP,Cs.TRIANGLE_STRIP),Qh),Jk=(Lv={},(0,F.Z)(Lv,1,It.F32_R),(0,F.Z)(Lv,2,It.F32_RG),(0,F.Z)(Lv,3,It.F32_RGB),(0,F.Z)(Lv,4,It.F32_RGBA),Lv),eD=($m={},(0,F.Z)($m,I.STATIC_DRAW,bf.STATIC),(0,F.Z)($m,I.DYNAMIC_DRAW,bf.DYNAMIC),(0,F.Z)($m,I.STREAM_DRAW,bf.DYNAMIC),$m),tS=(Ym={},(0,F.Z)(Ym,I.REPEAT,_l.REPEAT),(0,F.Z)(Ym,I.CLAMP_TO_EDGE,_l.CLAMP_TO_EDGE),(0,F.Z)(Ym,I.MIRRORED_REPEAT,_l.MIRRORED_REPEAT),Ym),tD=(lh={},(0,F.Z)(lh,I.NEVER,Ui.NEVER),(0,F.Z)(lh,I.ALWAYS,Ui.ALWAYS),(0,F.Z)(lh,I.LESS,Ui.LESS),(0,F.Z)(lh,I.LEQUAL,Ui.LEQUAL),(0,F.Z)(lh,I.GREATER,Ui.GREATER),(0,F.Z)(lh,I.GEQUAL,Ui.GEQUAL),(0,F.Z)(lh,I.EQUAL,Ui.EQUAL),(0,F.Z)(lh,I.NOTEQUAL,Ui.NOTEQUAL),lh),rD=(g0={},(0,F.Z)(g0,I.FRONT,jl.FRONT),(0,F.Z)(g0,I.BACK,jl.BACK),g0),rS=(Pd={},(0,F.Z)(Pd,I.FUNC_ADD,iu.ADD),(0,F.Z)(Pd,I.MIN_EXT,iu.MIN),(0,F.Z)(Pd,I.MAX_EXT,iu.MAX),(0,F.Z)(Pd,I.FUNC_SUBTRACT,iu.SUBSTRACT),(0,F.Z)(Pd,I.FUNC_REVERSE_SUBTRACT,iu.REVERSE_SUBSTRACT),Pd),_0=(ku={},(0,F.Z)(ku,I.ZERO,$i.ZERO),(0,F.Z)(ku,I.ONE,$i.ONE),(0,F.Z)(ku,I.SRC_COLOR,$i.SRC),(0,F.Z)(ku,I.ONE_MINUS_SRC_COLOR,$i.ONE_MINUS_SRC),(0,F.Z)(ku,I.SRC_ALPHA,$i.SRC_ALPHA),(0,F.Z)(ku,I.ONE_MINUS_SRC_ALPHA,$i.ONE_MINUS_SRC_ALPHA),(0,F.Z)(ku,I.DST_COLOR,$i.DST),(0,F.Z)(ku,I.ONE_MINUS_DST_COLOR,$i.ONE_MINUS_DST),(0,F.Z)(ku,I.DST_ALPHA,$i.DST_ALPHA),(0,F.Z)(ku,I.ONE_MINUS_DST_ALPHA,$i.ONE_MINUS_DST_ALPHA),(0,F.Z)(ku,I.CONSTANT_COLOR,$i.CONST),(0,F.Z)(ku,I.ONE_MINUS_CONSTANT_COLOR,$i.ONE_MINUS_CONSTANT),(0,F.Z)(ku,I.CONSTANT_ALPHA,$i.CONST),(0,F.Z)(ku,I.ONE_MINUS_CONSTANT_ALPHA,$i.ONE_MINUS_CONSTANT),(0,F.Z)(ku,I.SRC_ALPHA_SATURATE,$i.SRC_ALPHA_SATURATE),ku),Bv=(ch={},(0,F.Z)(ch,I.REPLACE,Go.REPLACE),(0,F.Z)(ch,I.KEEP,Go.KEEP),(0,F.Z)(ch,I.ZERO,Go.ZERO),(0,F.Z)(ch,I.INVERT,Go.INVERT),(0,F.Z)(ch,I.INCR,Go.INCREMENT_CLAMP),(0,F.Z)(ch,I.DECR,Go.DECREMENT_CLAMP),(0,F.Z)(ch,I.INCR_WRAP,Go.INCREMENT_WRAP),(0,F.Z)(ch,I.DECR_WRAP,Go.DECREMENT_WRAP),ch),nD=(fh={},(0,F.Z)(fh,I.ALWAYS,Ui.ALWAYS),(0,F.Z)(fh,I.EQUAL,Ui.EQUAL),(0,F.Z)(fh,I.GEQUAL,Ui.GEQUAL),(0,F.Z)(fh,I.GREATER,Ui.GREATER),(0,F.Z)(fh,I.LEQUAL,Ui.LEQUAL),(0,F.Z)(fh,I.LESS,Ui.LESS),(0,F.Z)(fh,I.NEVER,Ui.NEVER),(0,F.Z)(fh,I.NOTEQUAL,Ui.NOTEQUAL),fh),iD={"[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 x0(e){return Object.prototype.toString.call(e)in iD}var aD=function(){function e(r,t){(0,Q.Z)(this,e),(0,F.Z)(this,"isDestroyed",!1);var n=t.data,i=t.usage,a=t.type,s=t.isUBO,l=t.label,f;x0(n)?f=n:f=new y0[this.type||I.FLOAT](n),this.type=a,this.size=f.byteLength,this.buffer=r.createBuffer({viewOrSize:f,usage:s?no.UNIFORM:no.VERTEX,hint:eD[i||I.STATIC_DRAW]}),l&&r.setResourceName(this.buffer,l)}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,a;x0(n)?a=n:a=new y0[this.type||I.FLOAT](n),this.buffer.setSubData(i,new Uint8Array(a.buffer))}}]),e}(),oD=function(){function e(r,t){(0,Q.Z)(this,e);var n=t.data,i=t.type,a=t.count,s=a===void 0?0:a,l;x0(n)?l=n:l=new y0[this.type||I.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;x0(n)?i=n:i=new y0[this.type||I.UNSIGNED_INT](n),this.indexBuffer.setSubData(0,new Uint8Array(i.buffer))}},{key:"destroy",value:function(){this.indexBuffer.destroy()}}]),e}();function nS(e){return!!(e&&e.texture)}var iS=function(){function e(r,t){(0,Q.Z)(this,e),(0,F.Z)(this,"isDestroy",!1);var n=t.data,i=t.type,a=i===void 0?I.UNSIGNED_BYTE:i,s=t.width,l=t.height,f=t.flipY,d=f===void 0?!1:f,_=t.format,b=_===void 0?I.RGBA:_,T=t.wrapS,M=T===void 0?I.CLAMP_TO_EDGE:T,P=t.wrapT,D=P===void 0?I.CLAMP_TO_EDGE:P,G=t.aniso,q=G===void 0?0:G,se=t.alignment,Se=se===void 0?1:se,Ve=t.usage,nt=Ve===void 0?ht.SAMPLED:Ve,st=t.mipmap,at=st===void 0?!1:st,At=t.mag,Wt=At===void 0?I.NEAREST:At,Sr=t.min,_r=Sr===void 0?I.NEAREST:Sr;this.width=s,this.height=l;var Gr=It.U8_RGBA_RT;if(a===I.UNSIGNED_BYTE&&b===I.RGBA)Gr=It.U8_RGBA_RT;else if(a===I.UNSIGNED_BYTE&&b===I.LUMINANCE)Gr=It.U8_LUMINANCE;else if(a===I.FLOAT&&b===I.RGB)Gr=It.F32_RGB;else if(a===I.FLOAT&&b===I.RGBA)Gr=It.F32_RGBA;else if(a===I.FLOAT&&b===I.RED)Gr=It.F32_R;else throw new Error("create texture error, type: ".concat(a,", format: ").concat(b));this.texture=r.createTexture({format:Gr,width:s,height:l,usage:nt===ht.SAMPLED?Ou.SAMPLED:Ou.RENDER_TARGET,pixelStore:{unpackFlipY:d,packAlignment:Se},mipLevelCount:nt===ht.RENDER_TARGET||at?1:0}),n&&this.texture.setImageData([n]),this.sampler=r.createSampler({addressModeU:tS[M],addressModeV:tS[D],minFilter:_r===I.NEAREST?rs.POINT:rs.BILINEAR,magFilter:Wt===I.NEAREST?rs.POINT:rs.BILINEAR,mipmapFilter:$s.NO_MIP,maxAnisotropy:q})}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}(),aS=function(){function e(r,t){(0,Q.Z)(this,e),this.device=r,this.options=t,this.createColorRenderTarget(),this.createDepthRenderTarget()}return(0,j.Z)(e,[{key:"createColorRenderTarget",value:function(){var t=this.options,n=t.width,i=t.height,a=t.color;a&&(nS(a)?(this.colorTexture=a.get(),this.colorRenderTarget=this.device.createRenderTargetFromTexture(this.colorTexture),this.width=a.width,this.height=a.height):n&&i&&(this.colorTexture=this.device.createTexture({format:It.U8_RGBA_RT,usage:Ou.RENDER_TARGET,width:n,height:i}),this.colorRenderTarget=this.device.createRenderTargetFromTexture(this.colorTexture),this.width=n,this.height=i))}},{key:"createDepthRenderTarget",value:function(){var t=this.options,n=t.width,i=t.height,a=t.depth;a&&(nS(a)?(this.depthTexture=a.get(),this.depthRenderTarget=this.device.createRenderTargetFromTexture(this.depthTexture),this.width=a.width,this.height=a.height):n&&i&&(this.depthTexture=this.device.createTexture({format:It.D24_S8,usage:Ou.RENDER_TARGET,width:n,height:i}),this.depthRenderTarget=this.device.createRenderTargetFromTexture(this.depthTexture),this.width=n,this.height=i))}},{key:"get",value:function(){return this.colorRenderTarget}},{key:"destroy",value:function(){var t,n;(t=this.colorRenderTarget)===null||t===void 0||t.destroy(),(n=this.depthRenderTarget)===null||n===void 0||n.destroy()}},{key:"resize",value:function(t){var n=t.width,i=t.height;(this.width!==n||this.height!==i)&&(this.destroy(),this.options.width=n,this.options.height=i,this.createColorRenderTarget(),this.createDepthRenderTarget())}}]),e}(),sD=ui.isPlainObject,uD=ui.isTypedArray,lD=function(){function e(r,t,n){var i=this;(0,Q.Z)(this,e),(0,F.Z)(this,"destroyed",!1),(0,F.Z)(this,"uniforms",{}),(0,F.Z)(this,"vertexBuffers",[]),this.device=r,this.options=t,this.service=n;var a=t.vs,s=t.fs,l=t.attributes,f=t.uniforms,d=t.count,_=t.elements;this.options=t;var b=r.createProgram({vertex:{glsl:a},fragment:{glsl:s}});this.program=b,f&&(this.uniforms=this.extractUniforms(f));var T=[],M=0;Object.keys(l).forEach(function(D){var G=l[D],q=G.get();i.vertexBuffers.push(q.get());var se=G.attribute,Se=se.offset,Ve=Se===void 0?0:Se,nt=se.stride,st=nt===void 0?0:nt,at=se.size,At=at===void 0?1:at,Wt=se.divisor,Sr=Wt===void 0?0:Wt,_r=se.shaderLocation,Gr=_r===void 0?0:_r;T.push({arrayStride:st||At*4,stepMode:Rd.VERTEX,attributes:[{format:Jk[At],shaderLocation:Gr,offset:Ve,divisor:Sr}]}),M=q.size/At}),d||(this.options.count=M),_&&(this.indexBuffer=_.get());var P=r.createInputLayout({vertexBufferDescriptors:T,indexBufferFormat:_?It.U32_R:null,program:b});this.inputLayout=P,this.pipeline=this.createPipeline(t)}return(0,j.Z)(e,[{key:"createPipeline",value:function(t,n){var i=t.primitive,a=i===void 0?I.TRIANGLES:i,s=t.depth,l=t.cull,f=t.blend,d=t.stencil,_=this.initDepthDrawParams({depth:s}),b=!!(_&&_.enable),T=this.initCullDrawParams({cull:l}),M=!!(T&&T.enable),P=this.getBlendDrawParams({blend:f}),D=!!(P&&P.enable),G=this.getStencilDrawParams({stencil:d}),q=!!(G&&G.enable);return this.device.createRenderPipeline({inputLayout:this.inputLayout,program:this.program,topology:Qk[a],colorAttachmentFormats:[It.U8_RGBA_RT],depthStencilAttachmentFormat:It.D24_S8,megaStateDescriptor:{attachmentsState:[n?{channelWriteMask:au.ALL,rgbBlendState:{blendMode:iu.ADD,blendSrcFactor:$i.ONE,blendDstFactor:$i.ZERO},alphaBlendState:{blendMode:iu.ADD,blendSrcFactor:$i.ONE,blendDstFactor:$i.ZERO}}:{channelWriteMask:q&&G.opFront.zpass===Go.REPLACE?au.NONE:au.ALL,rgbBlendState:{blendMode:D&&P.equation.rgb||iu.ADD,blendSrcFactor:D&&P.func.srcRGB||$i.SRC_ALPHA,blendDstFactor:D&&P.func.dstRGB||$i.ONE_MINUS_SRC_ALPHA},alphaBlendState:{blendMode:D&&P.equation.alpha||iu.ADD,blendSrcFactor:D&&P.func.srcAlpha||$i.ONE,blendDstFactor:D&&P.func.dstAlpha||$i.ONE}}],blendConstant:D?Ay:void 0,depthWrite:b,depthCompare:b&&_.func||Ui.LESS,cullMode:M&&T.face||jl.NONE,stencilWrite:q,stencilFront:{compare:q?G.func.cmp:Ui.ALWAYS,passOp:G.opFront.zpass},stencilBack:{compare:q?G.func.cmp:Ui.ALWAYS,passOp:G.opBack.zpass}}})}},{key:"updateAttributesAndElements",value:function(){}},{key:"updateAttributes",value:function(){}},{key:"addUniforms",value:function(t){this.uniforms=(0,H.Z)((0,H.Z)({},this.uniforms),this.extractUniforms(t))}},{key:"draw",value:function(t,n){var i=this,a=(0,H.Z)((0,H.Z)({},this.options),t),s=a.count,l=s===void 0?0:s,f=a.instances,d=a.elements,_=a.uniforms,b=_===void 0?{}:_,T=a.uniformBuffers,M=a.textures;this.uniforms=(0,H.Z)((0,H.Z)({},this.uniforms),this.extractUniforms(b));var P=this.service,D=P.renderPass,G=P.currentFramebuffer,q=P.width,se=P.height;if(this.pipeline=this.createPipeline(a,n),D.setViewport(0,0,(G==null?void 0:G.width)||q,(G==null?void 0:G.height)||se),D.setPipeline(this.pipeline),D.setStencilReference(1),D.setVertexInput(this.inputLayout,this.vertexBuffers.map(function(Ve){return{buffer:Ve}}),d?{buffer:this.indexBuffer,offset:0}:null),T&&(this.bindings=this.device.createBindings({pipeline:this.pipeline,uniformBufferBindings:T.map(function(Ve,nt){var st=Ve;return{binding:nt,buffer:st.get(),size:st.size}}),samplerBindings:M==null?void 0:M.map(function(Ve){return{texture:Ve.texture,sampler:Ve.sampler}})})),this.bindings&&(D.setBindings(this.bindings),Object.keys(this.uniforms).forEach(function(Ve){var nt=i.uniforms[Ve];nt instanceof iS?i.uniforms[Ve]=nt.get():nt instanceof aS&&(i.uniforms[Ve]=nt.get().texture)}),this.program.setUniformsLegacy(this.uniforms)),d){var Se=d.count;Se===0?D.draw(l,f):D.drawIndexed(Se,f)}else D.draw(l,f)}},{key:"destroy",value:function(){var t,n,i;this.program.destroy(),(t=this.vertexBuffers)===null||t===void 0||t.forEach(function(a){return a.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:tD[n.func||I.LESS],range:n.range||[0,1]}}},{key:"getBlendDrawParams",value:function(t){var n=t.blend,i=n||{},a=i.enable,s=i.func,l=i.equation,f=i.color,d=f===void 0?[0,0,0,0]:f;return{enable:!!a,func:{srcRGB:_0[s&&s.srcRGB||I.SRC_ALPHA],srcAlpha:_0[s&&s.srcAlpha||I.SRC_ALPHA],dstRGB:_0[s&&s.dstRGB||I.ONE_MINUS_SRC_ALPHA],dstAlpha:_0[s&&s.dstAlpha||I.ONE_MINUS_SRC_ALPHA]},equation:{rgb:rS[l&&l.rgb||I.FUNC_ADD],alpha:rS[l&&l.alpha||I.FUNC_ADD]},color:d}}},{key:"getStencilDrawParams",value:function(t){var n=t.stencil,i=n||{},a=i.enable,s=i.mask,l=s===void 0?-1:s,f=i.func,d=f===void 0?{cmp:I.ALWAYS,ref:0,mask:-1}:f,_=i.opFront,b=_===void 0?{fail:I.KEEP,zfail:I.KEEP,zpass:I.KEEP}:_,T=i.opBack,M=T===void 0?{fail:I.KEEP,zfail:I.KEEP,zpass:I.KEEP}:T;return{enable:!!a,mask:l,func:(0,H.Z)((0,H.Z)({},d),{},{cmp:nD[d.cmp]}),opFront:{fail:Bv[b.fail],zfail:Bv[b.zfail],zpass:Bv[b.zpass]},opBack:{fail:Bv[M.fail],zfail:Bv[M.zfail],zpass:Bv[M.zpass]}}}},{key:"initCullDrawParams",value:function(t){var n=t.cull;if(n){var i=n.enable,a=n.face,s=a===void 0?I.BACK:a;return{enable:!!i,face:rD[s]}}}},{key:"extractUniforms",value:function(t){var n=this,i={};return Object.keys(t).forEach(function(a){n.extractUniformsRecursively(a,t[a],i,"")}),i}},{key:"extractUniformsRecursively",value:function(t,n,i,a){var s=this;if(n===null||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&typeof n[0]=="number"||uD(n)||n===""||"resize"in n){i["".concat(a&&a+".").concat(t)]=n;return}sD(n)&&Object.keys(n).forEach(function(l){s.extractUniformsRecursively(l,n[l],i,"".concat(a&&a+".").concat(t))}),Array.isArray(n)&&n.forEach(function(l,f){Object.keys(l).forEach(function(d){s.extractUniformsRecursively(d,l[d],i,"".concat(a&&a+".").concat(t,"[").concat(f,"]"))})})}}]),e}();function cD(e){return typeof WebGL2RenderingContext!="undefined"&&e instanceof WebGL2RenderingContext?!0:!!(e&&e._version===2)}var oS,sS,fD=(oS=(0,er.b2)(),oS(sS=function(){function e(){var r=this;(0,Q.Z)(this,e),(0,F.Z)(this,"uniformBuffers",[]),(0,F.Z)(this,"queryVerdorInfo",function(){return r.device.queryVendorInfo().platformString}),(0,F.Z)(this,"createModel",function(t){return new lD(r.device,t,r)}),(0,F.Z)(this,"createAttribute",function(t){return new Kk(r.device,t)}),(0,F.Z)(this,"createBuffer",function(t){return new aD(r.device,t)}),(0,F.Z)(this,"createElements",function(t){return new oD(r.device,t)}),(0,F.Z)(this,"createTexture2D",function(t){return new iS(r.device,t)}),(0,F.Z)(this,"createFramebuffer",function(t){return new aS(r.device,t)}),(0,F.Z)(this,"useFramebuffer",function(t,n){r.currentFramebuffer=t,r.beginFrame(),n(),r.endFrame(),r.currentFramebuffer=null}),(0,F.Z)(this,"clear",function(t){var n=t.color,i=t.depth,a=t.stencil,s=t.framebuffer,l=s===void 0?null:s;l&&(l.clearOptions={color:n,depth:i,stencil:a})}),(0,F.Z)(this,"viewport",function(t){var n=t.width,i=t.height;r.width=n,r.height=i}),(0,F.Z)(this,"readPixels",function(t){var n=t.framebuffer,i=t.x,a=t.y,s=t.width,l=t.height,f=r.device.createReadback(),d=n.colorTexture;return f.readTextureSync(d,i,a,s,l,new Uint8Array(s*l*4))}),(0,F.Z)(this,"getViewportSize",function(){return{width:r.width,height:r.height}}),(0,F.Z)(this,"getContainer",function(){var t;return(t=r.canvas)===null||t===void 0?void 0:t.parentElement}),(0,F.Z)(this,"getCanvas",function(){return r.canvas}),(0,F.Z)(this,"getGLContext",function(){return r.device.gl}),(0,F.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,Ft.Z)(_e().mark(function n(i,a){var s,l,f,d,_;return _e().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return s=a.enableWebGPU,l=a.shaderCompilerPath,this.canvas=i,f=s?new Wk({shaderCompilerPath:l}):new rk({targets:["webgl2","webgl1"],onContextLost:function(P){console.warn("context lost",P)},onContextCreationError:function(P){console.warn("context creation error",P)},onContextRestored:function(P){console.warn("context restored",P)}}),T.next=5,f.createSwapChain(i);case 5:d=T.sent,d.configureSwapChain(i.width,i.height),this.device=d.getDevice(),this.swapChain=d,this.currentFramebuffer=null,_=this.device.gl,this.extensionObject={OES_texture_float:!cD(_)&&this.device.OES_texture_float},this.mainColorRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:It.U8_RGBA_RT,width:i.width,height:i.height,usage:Ou.RENDER_TARGET})),this.mainDepthRT=this.device.createRenderTargetFromTexture(this.device.createTexture({format:It.D24_S8,width:i.width,height:i.height,usage:Ou.RENDER_TARGET}));case 14:case"end":return T.stop()}},n,this)}));function t(n,i){return r.apply(this,arguments)}return t}()},{key:"beginFrame",value:function(){var t=this.currentFramebuffer,n=this.swapChain,i=this.mainColorRT,a=this.mainDepthRT,s=n.getOnscreenTexture(),l=t?t.colorRenderTarget:i,f=t?null:s,d=t?t.depthRenderTarget:a,_=(t==null?void 0:t.clearOptions)||{},b=_.color,T=b===void 0?[0,0,0,0]:b,M=_.depth,P=M===void 0?1:M,D=_.stencil,G=D===void 0?0:D,q=l?Um(T[0]*255,T[1]*255,T[2]*255,T[3]):Ay,se=d?P:void 0,Se=d?G:void 0,Ve=this.device.createRenderPass({colorAttachment:[l],colorResolveTo:[f],colorClearColor:[q],depthStencilAttachment:d,depthClearValue:se,stencilClearValue:Se});this.renderPass=Ve}},{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}())||sS);function hD(e){var r=pD();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function pD(){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 Dy=["selectstart","selecting","selectend"],dD=function(e){(0,Fe.Z)(t,e);var r=hD(t);function t(n){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,Q.Z)(this,t),i=r.call(this),(0,F.Z)((0,Me.Z)(i),"isEnable",!1),(0,F.Z)((0,Me.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,F.Z)((0,Me.Z)(i),"onDragging",function(s){i.endEvent=s,i.syncBoxBound(),i.emit("selecting",i.getLngLatBox(),i.startEvent,i.endEvent)}),(0,F.Z)((0,Me.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=a,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 a=Yi("div",void 0,this.container);a.classList.add("l7-select-box"),i&&a.classList.add(i),a.style.display="none",this.box=a}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,a=i.x,s=i.y,l=this.endEvent,f=l.x,d=l.y,_=Math.min(a,f),b=Math.min(s,d),T=Math.abs(a-f),M=Math.abs(s-d);this.box.style.top="".concat(b,"px"),this.box.style.left="".concat(_,"px"),this.box.style.width="".concat(T,"px"),this.box.style.height="".concat(M,"px")}},{key:"getLngLatBox",value:function(){var i=this.startEvent.lngLat,a=i.lng,s=i.lat,l=this.endEvent.lngLat,f=l.lng,d=l.lat;return kf([[a,s],[f,d]])}}]),t}(Ka.EventEmitter),vD=function(){function e(r){(0,Q.Z)(this,e);var t=r.id,n=r.map,i=r.canvas,a=r.renderer,s=a===void 0?"regl":a,l=wA();this.container=l,n.setContainer(l,t,i),l.bind(Ke.IRendererService).to(s==="regl"?qk:fD).inSingletonScope(),this.sceneService=l.get(Ke.ISceneService),this.mapService=l.get(Ke.IMapService),this.iconService=l.get(Ke.IIconService),this.fontService=l.get(Ke.IFontService),this.controlService=l.get(Ke.IControlService),this.layerService=l.get(Ke.ILayerService),this.debugService=l.get(Ke.IDebugService),this.debugService.setEnable(r.debug),this.markerService=l.get(Ke.IMarkerService),this.interactionService=l.get(Ke.IInteractionService),this.popupService=l.get(Ke.IPopupService),this.boxSelect=new dD(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,Ft.Z)(_e().mark(function n(i){return _e().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,Ft.Z)(_e().mark(function n(i){return _e().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 a=new t(n);a.init()})}},{key:"setBgColor",value:function(t){this.mapService.setBgColor(t)}},{key:"addLayer",value:function(t){var n=this,i=gm(this.container);if(t.setContainer(i,this.container),this.sceneService.addLayer(t),t.inited){var a=this.initMask(t);this.addMask(a,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,a=n.maskfence,s=n.maskColor,l=s===void 0?"#000":s,f=n.maskOpacity,d=f===void 0?0:f;if(!(!i||!a)){var _=new nx().source(a).shape("fill").style({color:l,opacity:d});return _}}},{key:"addMask",value:function(t,n){if(t){var i=this.getLayer(n);if(i){var a=gm(this.container);t.setContainer(a,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,Ft.Z)(_e().mark(function n(i,a){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.layerService.remove(i,a);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,Ft.Z)(_e().mark(function n(){return _e().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.layerService.removeAllLayers();case 2:case"end":return a.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 a=(0,_n.Z)(i,2),s=a[0],l=a[1];n.fontService.addIconFont(s,l)})}},{key:"addFontFace",value:function(t,n){var i=this;this.fontService.once("fontloaded",function(a){i.emit("fontloaded",a)}),this.fontService.addFontFace(t,n)}},{key:"addImage",value:function(){var r=(0,Ft.Z)(_e().mark(function n(i,a){return _e().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.iconService.addImage(i,a);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(Dy.includes(t)){var i;(i=this.boxSelect)===null||i===void 0||i.on(t,n)}else Ag.includes(t)?this.sceneService.on(t,n):this.mapService.on(t,n)}},{key:"once",value:function(t,n){if(Dy.includes(t)){var i;(i=this.boxSelect)===null||i===void 0||i.once(t,n)}else Ag.includes(t)?this.sceneService.once(t,n):this.mapService.once(t,n)}},{key:"emit",value:function(t,n){Ag.indexOf(t)===-1?this.mapService.on(t,n):this.sceneService.emit(t,n)}},{key:"off",value:function(t,n){if(Dy.includes(t)){var i;(i=this.boxSelect)===null||i===void 0||i.off(t,n)}else Ag.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(),a=i.fitBoundsOptions,s=i.animate;this.mapService.fitBounds(t,n||(0,H.Z)((0,H.Z)({},a),{},{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(Ke.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 Xr.REGISTERED_PROTOCOLS[t]}},{key:"startAnimate",value:function(){this.layerService.startAnimate()}},{key:"stopAnimate",value:function(){this.layerService.stopAnimate()}},{key:"getPointSizeRange",value:function(){return this.sceneService.getPointSizeRange()}},{key:"initComponent",value:function(t){this.controlService.init({container:Fs(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 r1({position:i}))}}],[{key:"addProtocol",value:function(t,n){Xr.REGISTERED_PROTOCOLS[t]=n}},{key:"removeProtocol",value:function(t){delete Xr.REGISTERED_PROTOCOLS[t]}}]),e}(),DN="2.20.13";function qm(e){"@babel/helpers - typeof";return qm=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},qm(e)}function uS(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 LN(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?uS(Object(t),!0).forEach(function(n){mD(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):uS(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function mD(e,r,t){return r=gD(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function gD(e){var r=yD(e,"string");return qm(r)==="symbol"?r:String(r)}function yD(e,r){if(qm(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(qm(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function BN(e,r){return ED(e)||bD(e,r)||xD(e,r)||_D()}function _D(){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 xD(e,r){if(e){if(typeof e=="string")return lS(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 lS(e,r)}}function lS(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 bD(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,a,s,l=[],f=!0,d=!1;try{if(a=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=a.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(_){d=!0,i=_}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(d)throw i}}return l}}function ED(e){if(Array.isArray(e))return e}var FN=null,NN=null,cS,Ly,fS,SD=(cS=D0(Ke.IGlobalConfigService),Ly=function(){function e(r){(0,Q.Z)(this,e),Di(this,"configService",fS,this),this.config=r}return(0,j.Z)(e,[{key:"setContainer",value:function(t,n,i){t.bind(Ke.MapConfig).toConstantValue((0,H.Z)((0,H.Z)({},this.config),{},{id:n,canvas:i})),t.bind(Ke.IMapService).to(this.getServiceConstructor()).inSingletonScope()}},{key:"getServiceConstructor",value:function(){throw new Error("Method not implemented.")}}]),e}(),fS=Pi(Ly.prototype,"configService",[cS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ly),AD=U(86463),Km=U.n(AD),TD=function(){function e(r){(0,Q.Z)(this,e),(0,F.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}(),wD={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"}}]}},hS,pS,dS,vS,mS,gS,Fv,yS,_S,xS,bS,ES={mapmove:"move",camerachange:"move",zoomchange:"zoom",dragging:"drag"},CD=12,RD=(hS=(0,er.b2)(),pS=(0,er.f3)(Ke.MapConfig),dS=(0,er.f3)(Ke.IGlobalConfigService),vS=(0,er.f3)(Ke.ICoordinateSystemService),mS=(0,er.f3)(Ke.IEventEmitter),hS(gS=(Fv=function(){function e(){var r=this;(0,Q.Z)(this,e),(0,F.Z)(this,"version","DEFAUlTMAP"),(0,F.Z)(this,"simpleMapCoord",new TD),(0,F.Z)(this,"bgColor","rgba(0.0, 0.0, 0.0, 0.0)"),Di(this,"config",yS,this),Di(this,"configService",_S,this),Di(this,"coordinateSystemService",xS,this),Di(this,"eventEmitter",bS,this),(0,F.Z)(this,"handleCameraChanged",function(t){var n=r.map.getCenter(),i=n.lat,a=n.lng;r.emit("mapchange"),r.viewport.syncWithMapCamera({bearing:r.map.getBearing(),center:[a,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=Yi("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){NA.indexOf(t)!==-1?this.eventEmitter.on(t,n):this.map.on(ES[t]||t,n)}},{key:"off",value:function(t,n){this.map.off(ES[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 wD}},{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,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];(n=this.eventEmitter).emit.apply(n,[t].concat(a))}},{key:"once",value:function(t){for(var n,i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];(n=this.eventEmitter).once.apply(n,[t].concat(a))}},{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()>CD&&n?this.coordinateSystemService.setCoordinateSystem(to.LNGLAT_OFFSET):this.coordinateSystemService.setCoordinateSystem(to.LNGLAT)}}]),e}(),yS=Pi(Fv.prototype,"config",[pS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_S=Pi(Fv.prototype,"configService",[dS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xS=Pi(Fv.prototype,"coordinateSystemService",[vS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bS=Pi(Fv.prototype,"eventEmitter",[mS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fv))||gS);function Qm(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function b0(e,r){var t=Bh.fF([],r,e);return Bh.bA(t,t,1/t[3]),t}function UN(e,r){var t=e%r;return t<0?r+t:t}function zN(e,r,t){return t*r+(1-t)*e}function Od(e,r){if(!e)throw new Error(r||"viewport-mercator-project: assertion failed.")}var Sf=Math.PI,SS=Sf/4,Jh=Sf/180,AS=180/Sf,By=512,Fy=4003e4,MD=1.5;function TS(e){return Math.pow(2,e)}function ID(e){return Math.log2(e)}function E0(e,r){var t=(0,_n.Z)(e,2),n=t[0],i=t[1];Od(Number.isFinite(n)&&Number.isFinite(r)),Od(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude"),r*=By;var a=n*Jh,s=i*Jh,l=r*(a+Sf)/(2*Sf),f=r*(Sf-Math.log(Math.tan(SS+s*.5)))/(2*Sf);return[l,f]}function Ny(e,r){var t=(0,_n.Z)(e,2),n=t[0],i=t[1];r*=By;var a=n/r*(2*Sf)-Sf,s=2*(Math.atan(Math.exp(Sf-i/r*(2*Sf)))-SS);return[a*AS,s*AS]}function ZN(e){var r=e.latitude;assert(Number.isFinite(r));var t=Math.cos(r*Jh);return ID(Fy*t)-9}function wS(e){var r=e.latitude,t=e.longitude,n=e.zoom,i=e.scale,a=e.highPrecision,s=a===void 0?!1:a;i=i!==void 0?i:TS(n),Od(Number.isFinite(r)&&Number.isFinite(t)&&Number.isFinite(i));var l={},f=By*i,d=Math.cos(r*Jh),_=f/360,b=_/d,T=f/Fy/d;if(l.pixelsPerMeter=[T,-T,T],l.metersPerPixel=[1/T,-1/T,1/T],l.pixelsPerDegree=[_,-b,T],l.degreesPerPixel=[1/_,-1/b,1/T],s){var M=Jh*Math.tan(r*Jh)/d,P=_*M/2,D=f/Fy*M,G=D/b*T;l.pixelsPerDegree2=[0,-P,D],l.pixelsPerMeter2=[G,0,G]}return l}function VN(e,r){var t=_slicedToArray(e,3),n=t[0],i=t[1],a=t[2],s=_slicedToArray(r,3),l=s[0],f=s[1],d=s[2],_=1,b=wS({longitude:n,latitude:i,scale:_,highPrecision:!0}),T=b.pixelsPerMeter,M=b.pixelsPerMeter2,P=E0(e,_);P[0]+=l*(T[0]+M[0]*f),P[1]+=f*(T[1]+M[1]*f);var D=Ny(P,_),G=(a||0)+(d||0);return Number.isFinite(a)||Number.isFinite(d)?[D[0],D[1],G]:D}function PD(e){var r=e.height,t=e.pitch,n=e.bearing,i=e.altitude,a=e.center,s=a===void 0?null:a,l=e.flipY,f=l===void 0?!1:l,d=Qm();return Ct.translate(d,d,[0,0,-i]),Ct.scale(d,d,[1,1,1/r]),Ct.rotateX(d,d,-t*Jh),Ct.rotateZ(d,d,n*Jh),f&&Ct.scale(d,d,[1,-1,1]),s&&Ct.translate(d,d,La.negate([],s)),d}function OD(e){var r=e.width,t=e.height,n=e.altitude,i=n===void 0?MD:n,a=e.pitch,s=a===void 0?0:a,l=e.nearZMultiplier,f=l===void 0?1:l,d=e.farZMultiplier,_=d===void 0?1:d,b=s*Jh,T=Math.atan(.5/i),M=Math.sin(T)*i/Math.sin(Math.PI/2-b-T),P=Math.cos(Math.PI/2-b)*M+i;return{fov:2*Math.atan(t/2/i),aspect:r/t,focalDistance:i,near:f,far:P*_}}function kD(e){var r=e.width,t=e.height,n=e.pitch,i=e.altitude,a=e.nearZMultiplier,s=e.farZMultiplier,l=OD({width:r,height:t,altitude:i,pitch:n,nearZMultiplier:a,farZMultiplier:s}),f=l.fov,d=l.aspect,_=l.near,b=l.far,T=Ct.perspective([],f,d,_,b);return T}function DD(e,r){var t=(0,_n.Z)(e,3),n=t[0],i=t[1],a=t[2],s=a===void 0?0:a;return Od(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(s)),b0(r,[n,i,s,1])}function CS(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=(0,_n.Z)(e,3),i=n[0],a=n[1],s=n[2];if(Od(Number.isFinite(i)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(s)){var l=b0(r,[i,a,s,1]);return l}var f=b0(r,[i,a,0,1]),d=b0(r,[i,a,1,1]),_=f[2],b=d[2],T=_===b?0:((t||0)-_)/(b-_);return Dr.t7([],f,d,T)}var RS=Qm(),LD=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.width,n=r.height,i=r.viewMatrix,a=i===void 0?RS:i,s=r.projectionMatrix,l=s===void 0?RS:s;(0,Q.Z)(this,e),this.width=t||1,this.height=n||1,this.scale=1,this.pixelsPerMeter=1,this.viewMatrix=a,this.projectionMatrix=l;var f=Qm();Ct.multiply(f,f,this.projectionMatrix),Ct.multiply(f,f,this.viewMatrix),this.viewProjectionMatrix=f;var d=Qm();Ct.scale(d,d,[this.width/2,-this.height/2,1]),Ct.translate(d,d,[1,-1,0]),Ct.multiply(d,d,this.viewProjectionMatrix);var _=Ct.invert(Qm(),d);if(!_)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=d,this.pixelUnprojectionMatrix=_,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&&Ct.equals(t.projectionMatrix,this.projectionMatrix)&&Ct.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,a=i===void 0?!0:i,s=this.projectPosition(t),l=DD(s,this.pixelProjectionMatrix),f=(0,_n.Z)(l,2),d=f[0],_=f[1],b=a?_:this.height-_;return t.length===2?[d,b]:[d,b,l[2]]}},{key:"unproject",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.topLeft,a=i===void 0?!0:i,s=n.targetZ,l=(0,_n.Z)(t,3),f=l[0],d=l[1],_=l[2],b=a?d:this.height-d,T=s&&s*this.pixelsPerMeter,M=CS([f,b,_],this.pixelUnprojectionMatrix,T),P=this.unprojectPosition(M),D=(0,_n.Z)(P,3),G=D[0],q=D[1],se=D[2];return Number.isFinite(_)?[G,q,se]:Number.isFinite(s)?[G,q,s]:[G,q]}},{key:"projectPosition",value:function(t){var n=this.projectFlat(t),i=(0,_n.Z)(n,2),a=i[0],s=i[1],l=(t[2]||0)*this.pixelsPerMeter;return[a,s,l]}},{key:"unprojectPosition",value:function(t){var n=this.unprojectFlat(t),i=(0,_n.Z)(n,2),a=i[0],s=i[1],l=(t[2]||0)/this.pixelsPerMeter;return[a,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 BD(e){var r=e.width,t=e.height,n=e.bounds,i=e.minExtent,a=i===void 0?0:i,s=e.maxZoom,l=s===void 0?24:s,f=e.padding,d=f===void 0?0:f,_=e.offset,b=_===void 0?[0,0]:_,T=(0,_n.Z)(n,2),M=(0,_n.Z)(T[0],2),P=M[0],D=M[1],G=(0,_n.Z)(T[1],2),q=G[0],se=G[1];if(Number.isFinite(d)){var Se=d;d={top:Se,bottom:Se,left:Se,right:Se}}else Od(Number.isFinite(d.top)&&Number.isFinite(d.bottom)&&Number.isFinite(d.left)&&Number.isFinite(d.right));var Ve=new MS({width:r,height:t,longitude:0,latitude:0,zoom:0}),nt=Ve.project([P,se]),st=Ve.project([q,D]),at=[Math.max(Math.abs(st[0]-nt[0]),a),Math.max(Math.abs(st[1]-nt[1]),a)],At=[r-d.left-d.right-Math.abs(b[0])*2,t-d.top-d.bottom-Math.abs(b[1])*2];Od(At[0]>0&&At[1]>0);var Wt=At[0]/at[0],Sr=At[1]/at[1],_r=(d.right-d.left)/2/Wt,Gr=(d.bottom-d.top)/2/Sr,Cn=[(st[0]+nt[0])/2+_r,(st[1]+nt[1])/2+Gr],wi=Ve.unproject(Cn),la=Ve.zoom+Math.log2(Math.abs(Math.min(Wt,Sr)));return{longitude:wi[0],latitude:wi[1],zoom:Math.min(la,l)}}var MS=function(e){(0,Fe.Z)(r,e);function r(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.width,a=n.height,s=n.latitude,l=s===void 0?0:s,f=n.longitude,d=f===void 0?0:f,_=n.zoom,b=_===void 0?0:_,T=n.pitch,M=T===void 0?0:T,P=n.bearing,D=P===void 0?0:P,G=n.altitude,q=G===void 0?1.5:G,se=n.nearZMultiplier,Se=n.farZMultiplier;(0,Q.Z)(this,r),i=i||1,a=a||1;var Ve=TS(b);q=Math.max(.75,q);var nt=E0([d,l],Ve);nt[2]=0;var st=kD({width:i,height:a,pitch:M,bearing:D,altitude:q,nearZMultiplier:se||1/a,farZMultiplier:Se||1.01}),at=PD({height:a,center:nt,pitch:M,bearing:D,altitude:q,flipY:!0});return t=(0,et.Z)(this,(0,Ae.Z)(r).call(this,{width:i,height:a,viewMatrix:at,projectionMatrix:st})),t.latitude=l,t.longitude=d,t.zoom=b,t.pitch=M,t.bearing=D,t.altitude=q,t.scale=Ve,t.center=nt,t.pixelsPerMeter=wS((0,Me.Z)((0,Me.Z)(t))).pixelsPerMeter[2],Object.freeze((0,Me.Z)((0,Me.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 E0(n,i)}},{key:"unprojectFlat",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.scale;return Ny(n,i)}},{key:"getMapCenterByLngLatPosition",value:function(n){var i=n.lngLat,a=n.pos,s=CS(a,this.pixelUnprojectionMatrix),l=E0(i,this.scale),f=Dr.IH([],l,Dr.tk([],s)),d=Dr.IH([],this.center,f);return Ny(d,this.scale)}},{key:"getLocationAtPoint",value:function(n){var i=n.lngLat,a=n.pos;return this.getMapCenterByLngLatPosition({lngLat:i,pos:a})}},{key:"fitBounds",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.width,s=this.height,l=BD(Object.assign({width:a,height:s,bounds:n},i)),f=l.longitude,d=l.latitude,_=l.zoom;return new r({width:a,height:s,longitude:f,latitude:d,zoom:_})}}]),r}(LD),FD=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,a=t.pitch,s=t.bearing,l=t.viewportHeight,f=t.viewportWidth;this.viewport=new MS({width:f,height:l,longitude:n&&n[0],latitude:n&&n[1],zoom:i,pitch:a,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}(),ND=["id","attributionControl","style","token","rotation","mapInstance"],IS,PS;function UD(e){var r=zD();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function zD(){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 ZD(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 a=r.body||r.getElementsByTagName("body")[0];a?a.parentNode.insertBefore(i,a):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}}ZD(`.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=Km();var VD=0,OS="101MlGsZ2AmmA&access_token=pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p0MG01MXRqMW45cjQzb2R6b2ptc3J4MSJ9.zA2W0IkI0c6KaAhJfk9bWg",jD=(IS=(0,er.b2)(),IS(PS=function(e){(0,Fe.Z)(t,e);var r=UD(t);function t(){var n;(0,Q.Z)(this,t);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r.call.apply(r,[this].concat(a)),(0,F.Z)((0,Me.Z)(n),"version","MAPBOX"),n}return(0,j.Z)(t,[{key:"getType",value:function(){return"mapbox"}},{key:"lngLatToCoord",value:function(i){var a=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-a.x,f-a.y]}},{key:"lngLatToMercator",value:function(i,a){var s=window.mapboxgl.MercatorCoordinate.fromLngLat(i,a),l=s.x,f=l===void 0?0:l,d=s.y,_=d===void 0?0:d,b=s.z,T=b===void 0?0:b;return{x:f,y:_,z:T}}},{key:"getModelMatrix",value:function(i,a,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},d=window.mapboxgl.MercatorCoordinate.fromLngLat(i,a),_=d.meterInMercatorCoordinateUnits(),b=Ct.create();return Ct.translate(b,b,La.fromValues(d.x-f.x,d.y-f.y,d.z||0-f.z)),Ct.scale(b,b,La.fromValues(_*l[0],-_*l[1],_*l[2])),Ct.rotateX(b,b,s[0]),Ct.rotateY(b,b,s[1]),Ct.rotateZ(b,b,s[2]),b}},{key:"init",value:function(){var n=(0,Ft.Z)(_e().mark(function a(){var s=this,l,f,d,_,b,T,M,P,D,G,q,se,Se;return _e().wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:l=this.config,f=l.id,d=f===void 0?"map":f,_=l.attributionControl,b=_===void 0?!1:_,T=l.style,M=T===void 0?"light":T,P=l.token,D=P===void 0?OS:P,G=l.rotation,q=G===void 0?0:G,se=l.mapInstance,Se=(0,wa.Z)(l,ND),this.viewport=new FD,!se&&!window.mapboxgl&&console.error(this.configService.getSceneWarninfo("SDK")),D===OS&&M!=="blank"&&!window.mapboxgl.accessToken&&!se&&console.warn(this.configService.getSceneWarninfo("MapToken")),!se&&!window.mapboxgl.accessToken&&(window.mapboxgl.accessToken=D),se?(this.map=se,this.$mapContainer=this.map.getContainer()):(this.$mapContainer=this.creatMapContainer(d),this.map=new window.mapboxgl.Map((0,H.Z)({container:this.$mapContainer,style:this.getMapStyleValue(M),attributionControl:b,bearing:q},Se))),this.map.on("load",function(){s.handleCameraChanged()}),this.map.on("move",this.handleCameraChanged),this.handleCameraChanged();case 9:case"end":return nt.stop()}},a,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 a,s=arguments.length,l=new Array(s>1?s-1:0),f=1;f<s;f++)l[f-1]=arguments[f];(a=this.eventEmitter).emit.apply(a,[i].concat(l))}},{key:"once",value:function(i){for(var a,s=arguments.length,l=new Array(s>1?s-1:0),f=1;f<s;f++)l[f-1]=arguments[f];(a=this.eventEmitter).once.apply(a,[i].concat(l))}},{key:"getMapContainer",value:function(){return this.$mapContainer}},{key:"meterToCoord",value:function(i,a){var s=new(Km()).LngLat(i[0],i[1]),l=new(Km()).LngLat(a[0],a[1]),f=s.distanceTo(l),d=Km().MercatorCoordinate.fromLngLat({lng:i[0],lat:i[1]}),_=Km().MercatorCoordinate.fromLngLat({lng:a[0],lat:a[1]}),b=d.x,T=d.y,M=_.x,P=_.y,D=Math.sqrt(Math.pow(b-M,2)+Math.pow(T-P,2))*4194304*2;return D/f}},{key:"exportMap",value:function(i){var a=this.map.getCanvas(),s=i==="jpg"?a==null?void 0:a.toDataURL("image/jpeg"):a==null?void 0:a.toDataURL("image/png");return s}},{key:"creatMapContainer",value:function(i){var a=i;typeof i=="string"&&(a=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"+VD++,a.appendChild(s),s}}]),t}(RD))||PS);function HD(e){var r=WD();return function(){var n=(0,Ae.Z)(e),i;if(r){var a=(0,Ae.Z)(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return(0,et.Z)(this,i)}}function WD(){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 GD(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 a=r.body||r.getElementsByTagName("body")[0];a?a.parentNode.insertBefore(i,a):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}}GD(`.mapboxgl-ctrl-logo {
|
|
display: none !important;
|
|
}
|
|
`);var XD=function(e){(0,Fe.Z)(t,e);var r=HD(t);function t(){return(0,Q.Z)(this,t),r.apply(this,arguments)}return(0,j.Z)(t,[{key:"getServiceConstructor",value:function(){return jD}}]),t}(SD);function Jm(e){"@babel/helpers - typeof";return Jm=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},Jm(e)}function kS(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 DS(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?kS(Object(t),!0).forEach(function(n){$D(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):kS(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function $D(e,r,t){return r=YD(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function YD(e){var r=qD(e,"string");return Jm(r)==="symbol"?r:String(r)}function qD(e,r){if(Jm(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Jm(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function KD(e,r){return tL(e)||eL(e,r)||JD(e,r)||QD()}function QD(){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 JD(e,r){if(e){if(typeof e=="string")return LS(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 LS(e,r)}}function LS(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 eL(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,a,s,l=[],f=!0,d=!1;try{if(a=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=a.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(_){d=!0,i=_}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(d)throw i}}return l}}function tL(e){if(Array.isArray(e))return e}var rL=te.memo(function(e){var r=e.style,t=e.className,n=e.map,i=e.option,a=e.onSceneLoaded,s=(0,te.createRef)(),l=(0,te.useState)(),f=KD(l,2),d=f[0],_=f[1];return(0,te.useEffect)(function(){var b=new vD(DS(DS({id:s.current},i),{},{map:new XD(n)}));return b.on("loaded",function(){_(b),a&&a(b)}),function(){b.destroy()}},[]),(0,te.useEffect)(function(){d&&n.style&&d.setMapStyle(n.style)},[JSON.stringify(n.style)]),(0,te.useEffect)(function(){d&&n.zoom&&d.setZoom(n.zoom)},[n.zoom]),(0,te.useEffect)(function(){d&&n.center&&d.setCenter(n.center)},[JSON.stringify(n.center)]),(0,te.useEffect)(function(){d&&n.pitch!==void 0&&d.setPitch(n.pitch||0)},[n.pitch]),(0,te.useEffect)(function(){d&&n.rotation&&d.setRotation(n.rotation)},[n.rotation]),te.createElement(ye.Provider,{value:d},(0,te.createElement)("div",{ref:s,style:r,className:t},d&&e.children))}),nL=rL;function eg(e){"@babel/helpers - typeof";return eg=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},eg(e)}function BS(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?BS(Object(t),!0).forEach(function(n){iL(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):BS(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function iL(e,r,t){return r=aL(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function aL(e){var r=oL(e,"string");return eg(r)==="symbol"?r:String(r)}function oL(e,r){if(eg(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(eg(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function HN(e,r){return cL(e)||lL(e,r)||uL(e,r)||sL()}function sL(){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 uL(e,r){if(e){if(typeof e=="string")return FS(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 FS(e,r)}}function FS(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 lL(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,a,s,l=[],f=!0,d=!1;try{if(a=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=a.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(_){d=!0,i=_}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(d)throw i}}return l}}function cL(e){if(Array.isArray(e))return e}var WN=null,GN=null;function tg(e){"@babel/helpers - typeof";return tg=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},tg(e)}function NS(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 XN(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?NS(Object(t),!0).forEach(function(n){fL(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):NS(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function fL(e,r,t){return r=hL(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function hL(e){var r=pL(e,"string");return tg(r)==="symbol"?r:String(r)}function pL(e,r){if(tg(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(tg(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function $N(e,r){return gL(e)||mL(e,r)||vL(e,r)||dL()}function dL(){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 vL(e,r){if(e){if(typeof e=="string")return US(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 US(e,r)}}function US(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 mL(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,a,s,l=[],f=!0,d=!1;try{if(a=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=a.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(_){d=!0,i=_}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(d)throw i}}return l}}function gL(e){if(Array.isArray(e))return e}var YN=null,qN=null;function rg(e){"@babel/helpers - typeof";return rg=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},rg(e)}function zS(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?zS(Object(t),!0).forEach(function(n){yL(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zS(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function yL(e,r,t){return r=_L(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _L(e){var r=xL(e,"string");return rg(r)==="symbol"?r:String(r)}function xL(e,r){if(rg(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(rg(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function QN(e,r){return AL(e)||SL(e,r)||EL(e,r)||bL()}function bL(){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 EL(e,r){if(e){if(typeof e=="string")return ZS(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 ZS(e,r)}}function ZS(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 SL(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,a,s,l=[],f=!0,d=!1;try{if(a=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=a.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(_){d=!0,i=_}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(d)throw i}}return l}}function AL(e){if(Array.isArray(e))return e}var JN=null,e6=null;function t6(e,r){return RL(e)||CL(e,r)||wL(e,r)||TL()}function TL(){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 wL(e,r){if(e){if(typeof e=="string")return VS(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 VS(e,r)}}function VS(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 CL(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,a,s,l=[],f=!0,d=!1;try{if(a=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=a.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(_){d=!0,i=_}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(d)throw i}}return l}}function RL(e){if(Array.isArray(e))return e}var r6=null;function ng(e){"@babel/helpers - typeof";return ng=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},ng(e)}var n6=null;function jS(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 i6(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?jS(Object(t),!0).forEach(function(n){ML(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):jS(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function ML(e,r,t){return r=IL(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function IL(e){var r=PL(e,"string");return ng(r)==="symbol"?r:String(r)}function PL(e,r){if(ng(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(ng(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function a6(e,r){if(e==null)return{};var t=OL(e,r),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function OL(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}var o6={exportImage:QT,fullscreen:nw,geoLocate:ow,layer:t1,layerSwitch:t1,logo:r1,mapTheme:vw,mouseLocation:yw,zoom:B5,scale:bw},s6=null,HS=U(10422);function WS(e,r){return BL(e)||LL(e,r)||DL(e,r)||kL()}function kL(){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 DL(e,r){if(e){if(typeof e=="string")return GS(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 GS(e,r)}}function GS(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 LL(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,a,s,l=[],f=!0,d=!1;try{if(a=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=a.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(_){d=!0,i=_}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(d)throw i}}return l}}function BL(e){if(Array.isArray(e))return e}var XS=te.useEffect,$S=te.useState,FL=/\B([A-Z])/g,NL=function(r){return r.replace(FL,"-$1").toLowerCase()};function u6(e){var r=e.className,t=e.style,n=e.children,i=e.position,a=$S(),s=WS(a,2),l=s[0],f=s[1],d=useSceneValue(),_=$S(function(){return document.createElement("div")}),b=WS(_,1),T=b[0];return XS(function(){var M=new Control({position:i});return M.onAdd=function(){if(r&&(T.className=r),t){var P=Object.keys(t).map(function(D){return"".concat(NL(D),":").concat(t[D])}).join(";");T.style.cssText=P}return T},M.onRemove=function(){},f(M),d.addControl(M),function(){d.removeControl(M)}},[]),XS(function(){l&&l.setPosition(i||"bottomleft")},[i]),createPortal(n,T)}var YS=(0,te.createContext)({});function l6(){return useContext(YS)}var UL=te.memo(function(r){var t=r.layer,n=r.active;return t.active(n.option),null},Is()),zL=te.memo(function(r){var t=r.layer,n=r.animate;return t.animate(n),null},Is()),ZL=te.memo(function(r){var t=r.layer,n=r.color;return n.field?t.color(n.field,n.values):t.color(n.values),null},Is()),VL=te.memo(function(r){var t=r.layer,n=r.filter;return n.field&&t.filter(n.field,n.values),null},Is()),jL=te.memo(function(r){var t=r.layer,n=r.scale;return t.scale(n.values),null},Is()),HL=te.memo(function(r){var t=r.layer,n=r.select;return t.select(n.option),null},Is()),WL=te.memo(function(r){var t=r.layer,n=r.shape;return n.field?t.shape(n.field,n.values):t.shape(n.values),null},Is()),GL=te.memo(function(r){var t=r.layer,n=r.size;return n.field?t.size(n.field,n.values):t.size(n.values),null},Is()),XL=["data"];function $L(e,r){if(e==null)return{};var t=YL(e,r),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function YL(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}var qL=te.memo(function(r){var t=r.layer,n=r.source,i=n.data,a=$L(n,XL);return t.inited?t.setData(i,a):t.source(i,a),a.autoFit&&t.fitBounds(a&&a.fitBoundsOptions),null},Is()),c6=te.useEffect,KL=te.memo(function(r){var t=r.layer,n=r.style;return t.style(n),null},Is());function QL(e,r){return rB(e)||tB(e,r)||eB(e,r)||JL()}function JL(){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 eB(e,r){if(e){if(typeof e=="string")return qS(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 qS(e,r)}}function qS(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 tB(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,i,a,s,l=[],f=!0,d=!1;try{if(a=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=a.call(t)).done)&&(l.push(n.value),l.length!==r);f=!0);}catch(_){d=!0,i=_}finally{try{if(!f&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(d)throw i}}return l}}function rB(e){if(Array.isArray(e))return e}var ig=te.useEffect,nB=te.useState;function KS(e,r){var t=r.source,n=r.color,i=r.shape,a=r.style,s=r.size,l=r.scale,f=r.active,d=r.select,_=r.filter,b=r.animate,T=r.options,M=r.onLayerLoaded,P=y(),D=nB(function(){var se;switch(e){case"polygonLayer":se=new kg(T);break;case"lineLayer":se=new q0(T);break;case"pointLayer":se=new Og(T);break;case"heatmapLayer":se=new OC(T);break;case"rasterLayer":se=new Dg(T);break;case"imageLayer":se=new P1(T);break;case"citybuildingLayer":se=new rC(T);break;default:se=new kg(T)}return se.on("inited",function(){M&&M(se,P)}),se}),G=QL(D,1),q=G[0];return ig(function(){return P.addLayer(q),function(){P.removeLayer(q)}},[]),ig(function(){q.inited&&T&&q.updateLayerConfig(T)},[T==null?void 0:T.minZoom,T==null?void 0:T.maxZoom,T==null?void 0:T.visible]),ig(function(){q.inited&&(T!=null&&T.zIndex)&&q.setIndex(T.zIndex)},[T==null?void 0:T.zIndex]),ig(function(){q.inited&&(T!=null&&T.blend)&&q.setBlend(T.blend)},[T==null?void 0:T.blend]),ig(function(){P.render()}),te.createElement(YS.Provider,{value:q},te.createElement(qL,{layer:q,source:t}),l&&te.createElement(jL,{layer:q,scale:l}),n&&te.createElement(ZL,{layer:q,color:n}),s&&te.createElement(GL,{layer:q,size:s}),i&&te.createElement(WL,{layer:q,shape:i}),a&&te.createElement(KL,{layer:q,style:a}),f&&te.createElement(UL,{layer:q,active:f}),d&&te.createElement(HL,{layer:q,select:d}),_&&te.createElement(VL,{layer:q,filter:_}),b&&te.createElement(zL,{layer:q,animate:b}),r.children)}var f6=null,h6=null,iB=te.memo(function(r){return KS("pointLayer",r)}),aB=te.memo(function(r){return KS("heatmapLayer",r)}),p6=null,d6=null,v6=null,m6=te.useEffect,g6=null,y6=null;function Nv(e){"@babel/helpers - typeof";return Nv=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},Nv(e)}function QS(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 S0(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?QS(Object(t),!0).forEach(function(n){oB(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):QS(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function oB(e,r,t){return r=e2(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function sB(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function JS(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,e2(n.key),n)}}function uB(e,r,t){return r&&JS(e.prototype,r),t&&JS(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function e2(e){var r=lB(e,"string");return Nv(r)==="symbol"?r:String(r)}function lB(e,r){if(Nv(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Nv(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function cB(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&&Uy(e,r)}function Uy(e,r){return Uy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Uy(e,r)}function fB(e){var r=dB();return function(){var n=A0(e),i;if(r){var a=A0(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return hB(this,i)}}function hB(e,r){if(r&&(Nv(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pB(e)}function pB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dB(){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 A0(e){return A0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},A0(e)}var _6=function(e){cB(t,e);var r=fB(t);function t(n){var i;return sB(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 uB(t,[{key:"componentDidMount",value:function(){var i,a=this.props,s=a.lnglat,l=a.children,f=a.option,d=a.lngLat,_=new mE(S0(S0({},f),{},{stopPropagation:(i=this.props.option)===null||i===void 0?void 0:i.stopPropagation}));s&&_.setLnglat(s),d&&_.setLnglat(d),l&&_.setHTML(this.el),this.popup=_,this.scene.addPopup(_)}},{key:"componentDidUpdate",value:function(i){var a,s,l,f,d,_,b=Array.isArray(i.lnglat)?i.lnglat:[i==null||(a=i.lnglat)===null||a===void 0?void 0:a.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,(d=this.props)===null||d===void 0||(_=d.lnglat)===null||_===void 0?void 0:_.lat],M=b.toString()!==T.toString();if(M){var P;this.popup.remove(),this.popup=new mE(S0(S0({},this.props.option),{},{stopPropagation:(P=this.props.option)===null||P===void 0?void 0:P.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 te.createElement(ye.Consumer,{},function(a){return a&&(i.scene=a),(0,HS.createPortal)(i.props.children,i.el)})}}]),t}(te.PureComponent);function Uv(e){"@babel/helpers - typeof";return Uv=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},Uv(e)}function vB(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function t2(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,gB(n.key),n)}}function mB(e,r,t){return r&&t2(e.prototype,r),t&&t2(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gB(e){var r=yB(e,"string");return Uv(r)==="symbol"?r:String(r)}function yB(e,r){if(Uv(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Uv(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function _B(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&&zy(e,r)}function zy(e,r){return zy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},zy(e,r)}function xB(e){var r=SB();return function(){var n=T0(e),i;if(r){var a=T0(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return bB(this,i)}}function bB(e,r){if(r&&(Uv(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return EB(e)}function EB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SB(){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 T0(e){return T0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},T0(e)}var x6=function(e){_B(t,e);var r=xB(t);function t(n){var i;return vB(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,a=i.lnglat,s=i.children,l=i.option,f=i.onMarkerLoaded,d=new BT(l);a&&d.setLnglat(a),s&&d.setElement(this.el),this.marker=d,f&&f(d),this.scene.addMarker(d)}},{key:"componentDidUpdate",value:function(i){var a,s=JSON.stringify(i==null?void 0:i.lnglat)!==JSON.stringify((a=this.props)===null||a===void 0?void 0:a.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 te.createElement(ye.Consumer,{},function(a){return a&&(i.scene=a),(0,HS.createPortal)(i.props.children,i.el)})}}]),t}(te.PureComponent),b6=te.useEffect,E6=null,S6=null,A6=te.useEffect,T6=null},47903:function(sr){sr.exports=ne;function ne(ye,y){var he=ye&&ye.type,Z;if(he==="FeatureCollection")for(Z=0;Z<ye.features.length;Z++)ne(ye.features[Z],y);else if(he==="GeometryCollection")for(Z=0;Z<ye.geometries.length;Z++)ne(ye.geometries[Z],y);else if(he==="Feature")ne(ye.geometry,y);else if(he==="Polygon")U(ye.coordinates,y);else if(he==="MultiPolygon")for(Z=0;Z<ye.coordinates.length;Z++)U(ye.coordinates[Z],y);return ye}function U(ye,y){if(ye.length!==0){te(ye[0],y);for(var he=1;he<ye.length;he++)te(ye[he],!y)}}function te(ye,y){for(var he=0,Z=0,pe=0,fe=ye.length,it=fe-1;pe<fe;it=pe++){var ce=(ye[pe][0]-ye[it][0])*(ye[it][1]+ye[pe][1]),rt=he+ce;Z+=Math.abs(he)>=Math.abs(ce)?he-rt+ce:ce-rt+he,he=rt}he+Z>=0!=!!y&&ye.reverse()}},96542:function(sr){"use strict";sr.exports=ne;function ne(U,te){this.x=U,this.y=te}ne.prototype={clone:function(){return new ne(this.x,this.y)},add:function(U){return this.clone()._add(U)},sub:function(U){return this.clone()._sub(U)},multByPoint:function(U){return this.clone()._multByPoint(U)},divByPoint:function(U){return this.clone()._divByPoint(U)},mult:function(U){return this.clone()._mult(U)},div:function(U){return this.clone()._div(U)},rotate:function(U){return this.clone()._rotate(U)},rotateAround:function(U,te){return this.clone()._rotateAround(U,te)},matMult:function(U){return this.clone()._matMult(U)},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(U){return this.x===U.x&&this.y===U.y},dist:function(U){return Math.sqrt(this.distSqr(U))},distSqr:function(U){var te=U.x-this.x,ye=U.y-this.y;return te*te+ye*ye},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(U){return Math.atan2(this.y-U.y,this.x-U.x)},angleWith:function(U){return this.angleWithSep(U.x,U.y)},angleWithSep:function(U,te){return Math.atan2(this.x*te-this.y*U,this.x*U+this.y*te)},_matMult:function(U){var te=U[0]*this.x+U[1]*this.y,ye=U[2]*this.x+U[3]*this.y;return this.x=te,this.y=ye,this},_add:function(U){return this.x+=U.x,this.y+=U.y,this},_sub:function(U){return this.x-=U.x,this.y-=U.y,this},_mult:function(U){return this.x*=U,this.y*=U,this},_div:function(U){return this.x/=U,this.y/=U,this},_multByPoint:function(U){return this.x*=U.x,this.y*=U.y,this},_divByPoint:function(U){return this.x/=U.x,this.y/=U.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var U=this.y;return this.y=this.x,this.x=-U,this},_rotate:function(U){var te=Math.cos(U),ye=Math.sin(U),y=te*this.x-ye*this.y,he=ye*this.x+te*this.y;return this.x=y,this.y=he,this},_rotateAround:function(U,te){var ye=Math.cos(U),y=Math.sin(U),he=te.x+ye*(this.x-te.x)-y*(this.y-te.y),Z=te.y+y*(this.x-te.x)+ye*(this.y-te.y);return this.x=he,this.y=Z,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ne.convert=function(U){return U instanceof ne?U:Array.isArray(U)?new ne(U[0],U[1]):U}},25865:function(sr){"use strict";sr.exports=U,sr.exports.default=U;var ne=1e20;function U(Z,pe,fe,it,ce,rt){this.fontSize=Z||24,this.buffer=pe===void 0?3:pe,this.cutoff=it||.25,this.fontFamily=ce||"sans-serif",this.fontWeight=rt||"normal",this.radius=fe||8;var vt=this.size=this.fontSize+this.buffer*2,tt=vt+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=vt,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(tt*tt),this.gridInner=new Float64Array(tt*tt),this.f=new Float64Array(tt),this.z=new Float64Array(tt+1),this.v=new Uint16Array(tt),this.useMetrics=this.ctx.measureText("A").actualBoundingBoxLeft!==void 0,this.middle=Math.round(vt/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function te(Z,pe,fe,it,ce,rt,vt){rt.fill(ne,0,pe*fe),vt.fill(0,0,pe*fe);for(var tt=(pe-it)/2,Ot=0;Ot<ce;Ot++)for(var Xt=0;Xt<it;Xt++){var Yt=(Ot+tt)*pe+Xt+tt,ar=Z.data[4*(Ot*it+Xt)+3]/255;if(ar===1)rt[Yt]=0,vt[Yt]=ne;else if(ar===0)rt[Yt]=ne,vt[Yt]=0;else{var Zt=Math.max(0,.5-ar),bt=Math.max(0,ar-.5);rt[Yt]=Zt*Zt,vt[Yt]=bt*bt}}}function ye(Z,pe,fe,it,ce,rt,vt){for(var tt=0;tt<pe*fe;tt++){var Ot=Math.sqrt(it[tt])-Math.sqrt(ce[tt]);Z[tt]=Math.round(255-255*(Ot/rt+vt))}}U.prototype._draw=function(Z,pe){var fe=this.ctx.measureText(Z),it=fe.width,ce=2*this.buffer,rt,vt,tt,Ot,Xt,Yt,ar,Zt;pe&&this.useMetrics?(Xt=Math.floor(fe.actualBoundingBoxAscent),Zt=this.buffer+Math.ceil(fe.actualBoundingBoxAscent),Yt=this.buffer,ar=this.buffer,vt=Math.min(this.size,Math.ceil(fe.actualBoundingBoxRight-fe.actualBoundingBoxLeft)),Ot=Math.min(this.size-Yt,Math.ceil(fe.actualBoundingBoxAscent+fe.actualBoundingBoxDescent)),rt=vt+ce,tt=Ot+ce,this.ctx.textBaseline="alphabetic"):(rt=vt=this.size,tt=Ot=this.size,Xt=19*this.fontSize/24,Yt=ar=0,Zt=this.middle,this.ctx.textBaseline="middle");var bt;vt&&Ot&&(this.ctx.clearRect(ar,Yt,vt,Ot),this.ctx.fillText(Z,this.buffer,Zt),bt=this.ctx.getImageData(ar,Yt,vt,Ot));var St=new Uint8ClampedArray(rt*tt);return te(bt,rt,tt,vt,Ot,this.gridOuter,this.gridInner),y(this.gridOuter,rt,tt,this.f,this.v,this.z),y(this.gridInner,rt,tt,this.f,this.v,this.z),ye(St,rt,tt,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:St,metrics:{width:vt,height:Ot,sdfWidth:rt,sdfHeight:tt,top:Xt,left:0,advance:it}}},U.prototype.draw=function(Z){return this._draw(Z,!1).data},U.prototype.drawWithMetrics=function(Z){return this._draw(Z,!0)};function y(Z,pe,fe,it,ce,rt){for(var vt=0;vt<pe;vt++)he(Z,vt,pe,fe,it,ce,rt);for(var tt=0;tt<fe;tt++)he(Z,tt*pe,1,pe,it,ce,rt)}function he(Z,pe,fe,it,ce,rt,vt){var tt,Ot,Xt,Yt;for(rt[0]=0,vt[0]=-ne,vt[1]=ne,tt=0;tt<it;tt++)ce[tt]=Z[pe+tt*fe];for(tt=1,Ot=0,Xt=0;tt<it;tt++){do Yt=rt[Ot],Xt=(ce[tt]-ce[Yt]+tt*tt-Yt*Yt)/(tt-Yt)/2;while(Xt<=vt[Ot]&&--Ot>-1);Ot++,rt[Ot]=tt,vt[Ot]=Xt,vt[Ot+1]=ne}for(tt=0,Ot=0;tt<it;tt++){for(;vt[Ot+1]<tt;)Ot++;Yt=rt[Ot],Z[pe+tt*fe]=ce[Yt]+(tt-Yt)*(tt-Yt)}}},99996:function(sr,ne,U){sr.exports.VectorTile=U(14253),U(35752),U(143)},14253:function(sr,ne,U){"use strict";var te=U(143);sr.exports=ye;function ye(he,Z){this.layers=he.readFields(y,{},Z)}function y(he,Z,pe){if(he===3){var fe=new te(pe,pe.readVarint()+pe.pos);fe.length&&(Z[fe.name]=fe)}}},35752:function(sr,ne,U){"use strict";var te=U(96542);sr.exports=ye;function ye(fe,it,ce,rt,vt){this.properties={},this.extent=ce,this.type=0,this._pbf=fe,this._geometry=-1,this._keys=rt,this._values=vt,fe.readFields(y,this,it)}function y(fe,it,ce){fe==1?it.id=ce.readVarint():fe==2?he(ce,it):fe==3?it.type=ce.readVarint():fe==4&&(it._geometry=ce.pos)}function he(fe,it){for(var ce=fe.readVarint()+fe.pos;fe.pos<ce;){var rt=it._keys[fe.readVarint()],vt=it._values[fe.readVarint()];it.properties[rt]=vt}}ye.types=["Unknown","Point","LineString","Polygon"],ye.prototype.loadGeometry=function(){var fe=this._pbf;fe.pos=this._geometry;for(var it=fe.readVarint()+fe.pos,ce=1,rt=0,vt=0,tt=0,Ot=[],Xt;fe.pos<it;){if(rt<=0){var Yt=fe.readVarint();ce=Yt&7,rt=Yt>>3}if(rt--,ce===1||ce===2)vt+=fe.readSVarint(),tt+=fe.readSVarint(),ce===1&&(Xt&&Ot.push(Xt),Xt=[]),Xt.push(new te(vt,tt));else if(ce===7)Xt&&Xt.push(Xt[0].clone());else throw new Error("unknown command "+ce)}return Xt&&Ot.push(Xt),Ot},ye.prototype.bbox=function(){var fe=this._pbf;fe.pos=this._geometry;for(var it=fe.readVarint()+fe.pos,ce=1,rt=0,vt=0,tt=0,Ot=1/0,Xt=-1/0,Yt=1/0,ar=-1/0;fe.pos<it;){if(rt<=0){var Zt=fe.readVarint();ce=Zt&7,rt=Zt>>3}if(rt--,ce===1||ce===2)vt+=fe.readSVarint(),tt+=fe.readSVarint(),vt<Ot&&(Ot=vt),vt>Xt&&(Xt=vt),tt<Yt&&(Yt=tt),tt>ar&&(ar=tt);else if(ce!==7)throw new Error("unknown command "+ce)}return[Ot,Yt,Xt,ar]},ye.prototype.toGeoJSON=function(fe,it,ce){var rt=this.extent*Math.pow(2,ce),vt=this.extent*fe,tt=this.extent*it,Ot=this.loadGeometry(),Xt=ye.types[this.type],Yt,ar;function Zt(Rr){for(var gr=0;gr<Rr.length;gr++){var fr=Rr[gr],Mt=180-(fr.y+tt)*360/rt;Rr[gr]=[(fr.x+vt)*360/rt-180,360/Math.PI*Math.atan(Math.exp(Mt*Math.PI/180))-90]}}switch(this.type){case 1:var bt=[];for(Yt=0;Yt<Ot.length;Yt++)bt[Yt]=Ot[Yt][0];Ot=bt,Zt(Ot);break;case 2:for(Yt=0;Yt<Ot.length;Yt++)Zt(Ot[Yt]);break;case 3:for(Ot=Z(Ot),Yt=0;Yt<Ot.length;Yt++)for(ar=0;ar<Ot[Yt].length;ar++)Zt(Ot[Yt][ar]);break}Ot.length===1?Ot=Ot[0]:Xt="Multi"+Xt;var St={type:"Feature",geometry:{type:Xt,coordinates:Ot},properties:this.properties};return"id"in this&&(St.id=this.id),St};function Z(fe){var it=fe.length;if(it<=1)return[fe];for(var ce=[],rt,vt,tt=0;tt<it;tt++){var Ot=pe(fe[tt]);Ot!==0&&(vt===void 0&&(vt=Ot<0),vt===Ot<0?(rt&&ce.push(rt),rt=[fe[tt]]):rt.push(fe[tt]))}return rt&&ce.push(rt),ce}function pe(fe){for(var it=0,ce=0,rt=fe.length,vt=rt-1,tt,Ot;ce<rt;vt=ce++)tt=fe[ce],Ot=fe[vt],it+=(Ot.x-tt.x)*(tt.y+Ot.y);return it}},143:function(sr,ne,U){"use strict";var te=U(35752);sr.exports=ye;function ye(Z,pe){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=Z,this._keys=[],this._values=[],this._features=[],Z.readFields(y,this,pe),this.length=this._features.length}function y(Z,pe,fe){Z===15?pe.version=fe.readVarint():Z===1?pe.name=fe.readString():Z===5?pe.extent=fe.readVarint():Z===2?pe._features.push(fe.pos):Z===3?pe._keys.push(fe.readString()):Z===4&&pe._values.push(he(fe))}function he(Z){for(var pe=null,fe=Z.readVarint()+Z.pos;Z.pos<fe;){var it=Z.readVarint()>>3;pe=it===1?Z.readString():it===2?Z.readFloat():it===3?Z.readDouble():it===4?Z.readVarint64():it===5?Z.readVarint():it===6?Z.readSVarint():it===7?Z.readBoolean():null}return pe}ye.prototype.feature=function(Z){if(Z<0||Z>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[Z];var pe=this._pbf.readVarint()+this._pbf.pos;return new te(this._pbf,pe,this.extent,this._keys,this._values)}},16965:function(sr,ne,U){"use strict";U.d(ne,{Z:function(){return ut}});var te=U(50959),ye=U(82187),y=U.n(ye),he=U(87017),Z=U(92576),pe=U(50483),fe=U(9146),it=U(40622),ce=function(ie,Le){var Pe={};for(var Ge in ie)Object.prototype.hasOwnProperty.call(ie,Ge)&&Le.indexOf(Ge)<0&&(Pe[Ge]=ie[Ge]);if(ie!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Vt=0,Ge=Object.getOwnPropertySymbols(ie);Vt<Ge.length;Vt++)Le.indexOf(Ge[Vt])<0&&Object.prototype.propertyIsEnumerable.call(ie,Ge[Vt])&&(Pe[Ge[Vt]]=ie[Ge[Vt]]);return Pe},vt=ie=>{var{prefixCls:Le,className:Pe,hoverable:Ge=!0}=ie,Vt=ce(ie,["prefixCls","className","hoverable"]);const{getPrefixCls:Et}=te.useContext(Z.E_),Jr=Et("card",Le),on=y()(`${Jr}-grid`,Pe,{[`${Jr}-grid-hoverable`]:Ge});return te.createElement("div",Object.assign({},Vt,{className:on}))},tt=U(25446),Ot=U(55985),Xt=U(87077),Yt=U(37324);const ar=ie=>{const{antCls:Le,componentCls:Pe,headerHeight:Ge,cardPaddingBase:Vt,tabsMarginBottom:Et}=ie;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:Ge,marginBottom:-1,padding:`0 ${(0,tt.bf)(Vt)}`,color:ie.colorTextHeading,fontWeight:ie.fontWeightStrong,fontSize:ie.headerFontSize,background:ie.headerBg,borderBottom:`${(0,tt.bf)(ie.lineWidth)} ${ie.lineType} ${ie.colorBorderSecondary}`,borderRadius:`${(0,tt.bf)(ie.borderRadiusLG)} ${(0,tt.bf)(ie.borderRadiusLG)} 0 0`},(0,Ot.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},Ot.vS),{[`
|
|
> ${Pe}-typography,
|
|
> ${Pe}-typography-edit-content
|
|
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${Le}-tabs-top`]:{clear:"both",marginBottom:Et,color:ie.colorText,fontWeight:"normal",fontSize:ie.fontSize,"&-bar":{borderBottom:`${(0,tt.bf)(ie.lineWidth)} ${ie.lineType} ${ie.colorBorderSecondary}`}}})},Zt=ie=>{const{cardPaddingBase:Le,colorBorderSecondary:Pe,cardShadow:Ge,lineWidth:Vt}=ie;return{width:"33.33%",padding:Le,border:0,borderRadius:0,boxShadow:`
|
|
${(0,tt.bf)(Vt)} 0 0 0 ${Pe},
|
|
0 ${(0,tt.bf)(Vt)} 0 0 ${Pe},
|
|
${(0,tt.bf)(Vt)} ${(0,tt.bf)(Vt)} 0 0 ${Pe},
|
|
${(0,tt.bf)(Vt)} 0 0 0 ${Pe} inset,
|
|
0 ${(0,tt.bf)(Vt)} 0 0 ${Pe} inset;
|
|
`,transition:`all ${ie.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:Ge}}},bt=ie=>{const{componentCls:Le,iconCls:Pe,actionsLiMargin:Ge,cardActionsIconSize:Vt,colorBorderSecondary:Et,actionsBg:Jr}=ie;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:Jr,borderTop:`${(0,tt.bf)(ie.lineWidth)} ${ie.lineType} ${Et}`,display:"flex",borderRadius:`0 0 ${(0,tt.bf)(ie.borderRadiusLG)} ${(0,tt.bf)(ie.borderRadiusLG)}`},(0,Ot.dF)()),{"& > li":{margin:Ge,color:ie.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:ie.calc(ie.cardActionsIconSize).mul(2).equal(),fontSize:ie.fontSize,lineHeight:ie.lineHeight,cursor:"pointer","&:hover":{color:ie.colorPrimary,transition:`color ${ie.motionDurationMid}`},[`a:not(${Le}-btn), > ${Pe}`]:{display:"inline-block",width:"100%",color:ie.colorTextDescription,lineHeight:(0,tt.bf)(ie.fontHeight),transition:`color ${ie.motionDurationMid}`,"&:hover":{color:ie.colorPrimary}},[`> ${Pe}`]:{fontSize:Vt,lineHeight:(0,tt.bf)(ie.calc(Vt).mul(ie.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${(0,tt.bf)(ie.lineWidth)} ${ie.lineType} ${Et}`}}})},St=ie=>Object.assign(Object.assign({margin:`${(0,tt.bf)(ie.calc(ie.marginXXS).mul(-1).equal())} 0`,display:"flex"},(0,Ot.dF)()),{"&-avatar":{paddingInlineEnd:ie.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:ie.marginXS}},"&-title":Object.assign({color:ie.colorTextHeading,fontWeight:ie.fontWeightStrong,fontSize:ie.fontSizeLG},Ot.vS),"&-description":{color:ie.colorTextDescription}}),Rr=ie=>{const{componentCls:Le,cardPaddingBase:Pe,colorFillAlter:Ge}=ie;return{[`${Le}-head`]:{padding:`0 ${(0,tt.bf)(Pe)}`,background:Ge,"&-title":{fontSize:ie.fontSize}},[`${Le}-body`]:{padding:`${(0,tt.bf)(ie.padding)} ${(0,tt.bf)(Pe)}`}}},gr=ie=>{const{componentCls:Le}=ie;return{overflow:"hidden",[`${Le}-body`]:{userSelect:"none"}}},fr=ie=>{const{antCls:Le,componentCls:Pe,cardShadow:Ge,cardHeadPadding:Vt,colorBorderSecondary:Et,boxShadowTertiary:Jr,cardPaddingBase:on,extraColor:Mr}=ie;return{[Pe]:Object.assign(Object.assign({},(0,Ot.Wf)(ie)),{position:"relative",background:ie.colorBgContainer,borderRadius:ie.borderRadiusLG,[`&:not(${Pe}-bordered)`]:{boxShadow:Jr},[`${Pe}-head`]:ar(ie),[`${Pe}-extra`]:{marginInlineStart:"auto",color:Mr,fontWeight:"normal",fontSize:ie.fontSize},[`${Pe}-body`]:Object.assign({padding:on,borderRadius:` 0 0 ${(0,tt.bf)(ie.borderRadiusLG)} ${(0,tt.bf)(ie.borderRadiusLG)}`},(0,Ot.dF)()),[`${Pe}-grid`]:Zt(ie),[`${Pe}-cover`]:{"> *":{display:"block",width:"100%"},[`img, img + ${Le}-image-mask`]:{borderRadius:`${(0,tt.bf)(ie.borderRadiusLG)} ${(0,tt.bf)(ie.borderRadiusLG)} 0 0`}},[`${Pe}-actions`]:bt(ie),[`${Pe}-meta`]:St(ie)}),[`${Pe}-bordered`]:{border:`${(0,tt.bf)(ie.lineWidth)} ${ie.lineType} ${Et}`,[`${Pe}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${Pe}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${ie.motionDurationMid}, border-color ${ie.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:Ge}},[`${Pe}-contain-grid`]:{borderRadius:`${(0,tt.bf)(ie.borderRadiusLG)} ${(0,tt.bf)(ie.borderRadiusLG)} 0 0 `,[`${Pe}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${Pe}-loading) ${Pe}-body`]:{marginBlockStart:ie.calc(ie.lineWidth).mul(-1).equal(),marginInlineStart:ie.calc(ie.lineWidth).mul(-1).equal(),padding:0}},[`${Pe}-contain-tabs`]:{[`> ${Pe}-head`]:{minHeight:0,[`${Pe}-head-title, ${Pe}-extra`]:{paddingTop:Vt}}},[`${Pe}-type-inner`]:Rr(ie),[`${Pe}-loading`]:gr(ie),[`${Pe}-rtl`]:{direction:"rtl"}}},Mt=ie=>{const{componentCls:Le,cardPaddingSM:Pe,headerHeightSM:Ge,headerFontSizeSM:Vt}=ie;return{[`${Le}-small`]:{[`> ${Le}-head`]:{minHeight:Ge,padding:`0 ${(0,tt.bf)(Pe)}`,fontSize:Vt,[`> ${Le}-head-wrapper`]:{[`> ${Le}-extra`]:{fontSize:ie.fontSize}}},[`> ${Le}-body`]:{padding:Pe}},[`${Le}-small${Le}-contain-tabs`]:{[`> ${Le}-head`]:{[`${Le}-head-title, ${Le}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}},ft=ie=>({headerBg:"transparent",headerFontSize:ie.fontSizeLG,headerFontSizeSM:ie.fontSize,headerHeight:ie.fontSizeLG*ie.lineHeightLG+ie.padding*2,headerHeightSM:ie.fontSize*ie.lineHeight+ie.paddingXS*2,actionsBg:ie.colorBgContainer,actionsLiMargin:`${ie.paddingSM}px 0`,tabsMarginBottom:-ie.padding-ie.lineWidth,extraColor:ie.colorText});var kt=(0,Xt.I$)("Card",ie=>{const Le=(0,Yt.TS)(ie,{cardShadow:ie.boxShadowCard,cardHeadPadding:ie.padding,cardPaddingBase:ie.paddingLG,cardActionsIconSize:ie.fontSize,cardPaddingSM:12});return[fr(Le),Mt(Le)]},ft),qe=function(ie,Le){var Pe={};for(var Ge in ie)Object.prototype.hasOwnProperty.call(ie,Ge)&&Le.indexOf(Ge)<0&&(Pe[Ge]=ie[Ge]);if(ie!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Vt=0,Ge=Object.getOwnPropertySymbols(ie);Vt<Ge.length;Vt++)Le.indexOf(Ge[Vt])<0&&Object.prototype.propertyIsEnumerable.call(ie,Ge[Vt])&&(Pe[Ge[Vt]]=ie[Ge[Vt]]);return Pe};const Dt=ie=>{const{prefixCls:Le,actions:Pe=[]}=ie;return te.createElement("ul",{className:`${Le}-actions`},Pe.map((Ge,Vt)=>{const Et=`action-${Vt}`;return te.createElement("li",{style:{width:`${100/Pe.length}%`},key:Et},te.createElement("span",null,Ge))}))};var oe=te.forwardRef((ie,Le)=>{const{prefixCls:Pe,className:Ge,rootClassName:Vt,style:Et,extra:Jr,headStyle:on={},bodyStyle:Mr={},title:Dn,loading:bn,bordered:rn=!0,size:yi,type:ti,cover:Zi,actions:En,tabList:Rn,children:sa,activeTabKey:ki,defaultActiveTabKey:ba,tabBarExtraContent:fo,hoverable:Re,tabProps:Ea={}}=ie,va=qe(ie,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:Za,direction:Ms,card:ho}=te.useContext(Z.E_),Zo=$=>{var ee;(ee=ie.onTabChange)===null||ee===void 0||ee.call(ie,$)},jt=te.useMemo(()=>{let $=!1;return te.Children.forEach(sa,ee=>{ee&&ee.type&&ee.type===vt&&($=!0)}),$},[sa]),pr=Za("card",Pe),[Vr,en,Ln]=kt(pr),Gi=te.createElement(fe.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},sa),ue=ki!==void 0,k=Object.assign(Object.assign({},Ea),{[ue?"activeKey":"defaultActiveKey"]:ue?ki:ba,tabBarExtraContent:fo});let z;const ae=(0,pe.Z)(yi),Ee=!ae||ae==="default"?"large":ae,De=Rn?te.createElement(it.Z,Object.assign({size:Ee},k,{className:`${pr}-head-tabs`,onChange:Zo,items:Rn.map($=>{var{tab:ee}=$,xe=qe($,["tab"]);return Object.assign({label:ee},xe)})})):null;(Dn||Jr||De)&&(z=te.createElement("div",{className:`${pr}-head`,style:on},te.createElement("div",{className:`${pr}-head-wrapper`},Dn&&te.createElement("div",{className:`${pr}-head-title`},Dn),Jr&&te.createElement("div",{className:`${pr}-extra`},Jr)),De));const zt=Zi?te.createElement("div",{className:`${pr}-cover`},Zi):null,Tt=te.createElement("div",{className:`${pr}-body`,style:Mr},bn?Gi:sa),Rt=En&&En.length?te.createElement(Dt,{prefixCls:pr,actions:En}):null,dt=(0,he.Z)(va,["onTabChange"]),N=y()(pr,ho==null?void 0:ho.className,{[`${pr}-loading`]:bn,[`${pr}-bordered`]:rn,[`${pr}-hoverable`]:Re,[`${pr}-contain-grid`]:jt,[`${pr}-contain-tabs`]:Rn&&Rn.length,[`${pr}-${ae}`]:ae,[`${pr}-type-${ti}`]:!!ti,[`${pr}-rtl`]:Ms==="rtl"},Ge,Vt,en,Ln),B=Object.assign(Object.assign({},ho==null?void 0:ho.style),Et);return Vr(te.createElement("div",Object.assign({ref:Le},dt,{className:N,style:B}),z,zt,Tt,Rt))}),H=function(ie,Le){var Pe={};for(var Ge in ie)Object.prototype.hasOwnProperty.call(ie,Ge)&&Le.indexOf(Ge)<0&&(Pe[Ge]=ie[Ge]);if(ie!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Vt=0,Ge=Object.getOwnPropertySymbols(ie);Vt<Ge.length;Vt++)Le.indexOf(Ge[Vt])<0&&Object.prototype.propertyIsEnumerable.call(ie,Ge[Vt])&&(Pe[Ge[Vt]]=ie[Ge[Vt]]);return Pe},Be=ie=>{const{prefixCls:Le,className:Pe,avatar:Ge,title:Vt,description:Et}=ie,Jr=H(ie,["prefixCls","className","avatar","title","description"]),{getPrefixCls:on}=te.useContext(Z.E_),Mr=on("card",Le),Dn=y()(`${Mr}-meta`,Pe),bn=Ge?te.createElement("div",{className:`${Mr}-meta-avatar`},Ge):null,rn=Vt?te.createElement("div",{className:`${Mr}-meta-title`},Vt):null,yi=Et?te.createElement("div",{className:`${Mr}-meta-description`},Et):null,ti=rn||yi?te.createElement("div",{className:`${Mr}-meta-detail`},rn,yi):null;return te.createElement("div",Object.assign({},Jr,{className:Dn}),bn,ti)};const we=oe;we.Grid=vt,we.Meta=Be;var ut=we},24223:function(sr,ne,U){"use strict";U.d(ne,{Z:function(){return kt}});var te=U(50959),ye=U(97950),y=U(37865),he=U(82187),Z=U.n(he),pe=U(92576),fe=U(9146),ce=qe=>{const{value:Dt,formatter:dr,precision:oe,decimalSeparator:H,groupSeparator:re="",prefixCls:Be}=qe;let we;if(typeof dr=="function")we=dr(Dt);else{const ut=String(Dt),ie=ut.match(/^(-?)(\d*)(\.(\d+))?$/);if(!ie||ut==="-")we=ut;else{const Le=ie[1];let Pe=ie[2]||"0",Ge=ie[4]||"";Pe=Pe.replace(/\B(?=(\d{3})+(?!\d))/g,re),typeof oe=="number"&&(Ge=Ge.padEnd(oe,"0").slice(0,oe>0?oe:0)),Ge&&(Ge=`${H}${Ge}`),we=[te.createElement("span",{key:"int",className:`${Be}-content-value-int`},Le,Pe),Ge&&te.createElement("span",{key:"decimal",className:`${Be}-content-value-decimal`},Ge)]}}return te.createElement("span",{className:`${Be}-content-value`},we)},rt=U(55985),vt=U(87077),tt=U(37324);const Ot=qe=>{const{componentCls:Dt,marginXXS:dr,padding:oe,colorTextDescription:H,titleFontSize:re,colorTextHeading:Be,contentFontSize:we,fontFamily:ut}=qe;return{[`${Dt}`]:Object.assign(Object.assign({},(0,rt.Wf)(qe)),{[`${Dt}-title`]:{marginBottom:dr,color:H,fontSize:re},[`${Dt}-skeleton`]:{paddingTop:oe},[`${Dt}-content`]:{color:Be,fontSize:we,fontFamily:ut,[`${Dt}-content-value`]:{display:"inline-block",direction:"ltr"},[`${Dt}-content-prefix, ${Dt}-content-suffix`]:{display:"inline-block"},[`${Dt}-content-prefix`]:{marginInlineEnd:dr},[`${Dt}-content-suffix`]:{marginInlineStart:dr}}})}},Xt=qe=>{const{fontSizeHeading3:Dt,fontSize:dr}=qe;return{titleFontSize:dr,contentFontSize:Dt}};var Yt=(0,vt.I$)("Statistic",qe=>{const Dt=(0,tt.TS)(qe,{});return[Ot(Dt)]},Xt),Zt=qe=>{const{prefixCls:Dt,className:dr,rootClassName:oe,style:H,valueStyle:re,value:Be=0,title:we,valueRender:ut,prefix:ie,suffix:Le,loading:Pe=!1,onMouseEnter:Ge,onMouseLeave:Vt,decimalSeparator:Et=".",groupSeparator:Jr=","}=qe,{getPrefixCls:on,direction:Mr,statistic:Dn}=te.useContext(pe.E_),bn=on("statistic",Dt),[rn,yi,ti]=Yt(bn),Zi=te.createElement(ce,Object.assign({decimalSeparator:Et,groupSeparator:Jr,prefixCls:bn},qe,{value:Be})),En=Z()(bn,{[`${bn}-rtl`]:Mr==="rtl"},Dn==null?void 0:Dn.className,dr,oe,yi,ti);return rn(te.createElement("div",{className:En,style:Object.assign(Object.assign({},Dn==null?void 0:Dn.style),H),onMouseEnter:Ge,onMouseLeave:Vt},we&&te.createElement("div",{className:`${bn}-title`},we),te.createElement(fe.Z,{paragraph:!1,loading:Pe,className:`${bn}-skeleton`},te.createElement("div",{style:re,className:`${bn}-content`},ie&&te.createElement("span",{className:`${bn}-content-prefix`},ie),ut?ut(Zi):Zi,Le&&te.createElement("span",{className:`${bn}-content-suffix`},Le)))))};const bt=[["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 St(qe,Dt){let dr=qe;const oe=/\[[^\]]*]/g,H=(Dt.match(oe)||[]).map(ut=>ut.slice(1,-1)),re=Dt.replace(oe,"[]"),Be=bt.reduce((ut,ie)=>{let[Le,Pe]=ie;if(ut.includes(Le)){const Ge=Math.floor(dr/Pe);return dr-=Ge*Pe,ut.replace(new RegExp(`${Le}+`,"g"),Vt=>{const Et=Vt.length;return Ge.toString().padStart(Et,"0")})}return ut},re);let we=0;return Be.replace(oe,()=>{const ut=H[we];return we+=1,ut})}function Rr(qe,Dt){const{format:dr=""}=Dt,oe=new Date(qe).getTime(),H=Date.now(),re=Math.max(oe-H,0);return St(re,dr)}const gr=1e3/30;function fr(qe){return new Date(qe).getTime()}const Mt=qe=>{const{value:Dt,format:dr="HH:mm:ss",onChange:oe,onFinish:H}=qe,re=(0,ye.Z)(),Be=te.useRef(null),we=()=>{H==null||H(),Be.current&&(clearInterval(Be.current),Be.current=null)},ut=()=>{const Pe=fr(Dt);Pe>=Date.now()&&(Be.current=setInterval(()=>{re(),oe==null||oe(Pe-Date.now()),Pe<Date.now()&&we()},gr))};te.useEffect(()=>(ut(),()=>{Be.current&&(clearInterval(Be.current),Be.current=null)}),[Dt]);const ie=(Pe,Ge)=>Rr(Pe,Object.assign(Object.assign({},Ge),{format:dr})),Le=Pe=>(0,y.Tm)(Pe,{title:void 0});return te.createElement(Zt,Object.assign({},qe,{valueRender:Le,formatter:ie}))};var ft=te.memo(Mt);Zt.Countdown=ft;var kt=Zt},75734:function(sr){"use strict";sr.exports=ne,sr.exports.default=ne;function ne(re,Be,we){we=we||2;var ut=Be&&Be.length,ie=ut?Be[0]*we:re.length,Le=U(re,0,ie,we,!0),Pe=[];if(!Le||Le.next===Le.prev)return Pe;var Ge,Vt,Et,Jr,on,Mr,Dn;if(ut&&(Le=fe(re,Be,Le,we)),re.length>80*we){Ge=Et=re[0],Vt=Jr=re[1];for(var bn=we;bn<ie;bn+=we)on=re[bn],Mr=re[bn+1],on<Ge&&(Ge=on),Mr<Vt&&(Vt=Mr),on>Et&&(Et=on),Mr>Jr&&(Jr=Mr);Dn=Math.max(Et-Ge,Jr-Vt),Dn=Dn!==0?32767/Dn:0}return ye(Le,Pe,we,Ge,Vt,Dn,0),Pe}function U(re,Be,we,ut,ie){var Le,Pe;if(ie===H(re,Be,we,ut)>0)for(Le=Be;Le<we;Le+=ut)Pe=Dt(Le,re[Le],re[Le+1],Pe);else for(Le=we-ut;Le>=Be;Le-=ut)Pe=Dt(Le,re[Le],re[Le+1],Pe);return Pe&&St(Pe,Pe.next)&&(dr(Pe),Pe=Pe.next),Pe}function te(re,Be){if(!re)return re;Be||(Be=re);var we=re,ut;do if(ut=!1,!we.steiner&&(St(we,we.next)||bt(we.prev,we,we.next)===0)){if(dr(we),we=Be=we.prev,we===we.next)break;ut=!0}else we=we.next;while(ut||we!==Be);return Be}function ye(re,Be,we,ut,ie,Le,Pe){if(re){!Pe&&Le&&tt(re,ut,ie,Le);for(var Ge=re,Vt,Et;re.prev!==re.next;){if(Vt=re.prev,Et=re.next,Le?he(re,ut,ie,Le):y(re)){Be.push(Vt.i/we|0),Be.push(re.i/we|0),Be.push(Et.i/we|0),dr(re),re=Et.next,Ge=Et.next;continue}if(re=Et,re===Ge){Pe?Pe===1?(re=Z(te(re),Be,we),ye(re,Be,we,ut,ie,Le,2)):Pe===2&&pe(re,Be,we,ut,ie,Le):ye(te(re),Be,we,ut,ie,Le,1);break}}}}function y(re){var Be=re.prev,we=re,ut=re.next;if(bt(Be,we,ut)>=0)return!1;for(var ie=Be.x,Le=we.x,Pe=ut.x,Ge=Be.y,Vt=we.y,Et=ut.y,Jr=ie<Le?ie<Pe?ie:Pe:Le<Pe?Le:Pe,on=Ge<Vt?Ge<Et?Ge:Et:Vt<Et?Vt:Et,Mr=ie>Le?ie>Pe?ie:Pe:Le>Pe?Le:Pe,Dn=Ge>Vt?Ge>Et?Ge:Et:Vt>Et?Vt:Et,bn=ut.next;bn!==Be;){if(bn.x>=Jr&&bn.x<=Mr&&bn.y>=on&&bn.y<=Dn&&ar(ie,Ge,Le,Vt,Pe,Et,bn.x,bn.y)&&bt(bn.prev,bn,bn.next)>=0)return!1;bn=bn.next}return!0}function he(re,Be,we,ut){var ie=re.prev,Le=re,Pe=re.next;if(bt(ie,Le,Pe)>=0)return!1;for(var Ge=ie.x,Vt=Le.x,Et=Pe.x,Jr=ie.y,on=Le.y,Mr=Pe.y,Dn=Ge<Vt?Ge<Et?Ge:Et:Vt<Et?Vt:Et,bn=Jr<on?Jr<Mr?Jr:Mr:on<Mr?on:Mr,rn=Ge>Vt?Ge>Et?Ge:Et:Vt>Et?Vt:Et,yi=Jr>on?Jr>Mr?Jr:Mr:on>Mr?on:Mr,ti=Xt(Dn,bn,Be,we,ut),Zi=Xt(rn,yi,Be,we,ut),En=re.prevZ,Rn=re.nextZ;En&&En.z>=ti&&Rn&&Rn.z<=Zi;){if(En.x>=Dn&&En.x<=rn&&En.y>=bn&&En.y<=yi&&En!==ie&&En!==Pe&&ar(Ge,Jr,Vt,on,Et,Mr,En.x,En.y)&&bt(En.prev,En,En.next)>=0||(En=En.prevZ,Rn.x>=Dn&&Rn.x<=rn&&Rn.y>=bn&&Rn.y<=yi&&Rn!==ie&&Rn!==Pe&&ar(Ge,Jr,Vt,on,Et,Mr,Rn.x,Rn.y)&&bt(Rn.prev,Rn,Rn.next)>=0))return!1;Rn=Rn.nextZ}for(;En&&En.z>=ti;){if(En.x>=Dn&&En.x<=rn&&En.y>=bn&&En.y<=yi&&En!==ie&&En!==Pe&&ar(Ge,Jr,Vt,on,Et,Mr,En.x,En.y)&&bt(En.prev,En,En.next)>=0)return!1;En=En.prevZ}for(;Rn&&Rn.z<=Zi;){if(Rn.x>=Dn&&Rn.x<=rn&&Rn.y>=bn&&Rn.y<=yi&&Rn!==ie&&Rn!==Pe&&ar(Ge,Jr,Vt,on,Et,Mr,Rn.x,Rn.y)&&bt(Rn.prev,Rn,Rn.next)>=0)return!1;Rn=Rn.nextZ}return!0}function Z(re,Be,we){var ut=re;do{var ie=ut.prev,Le=ut.next.next;!St(ie,Le)&&Rr(ie,ut,ut.next,Le)&&ft(ie,Le)&&ft(Le,ie)&&(Be.push(ie.i/we|0),Be.push(ut.i/we|0),Be.push(Le.i/we|0),dr(ut),dr(ut.next),ut=re=Le),ut=ut.next}while(ut!==re);return te(ut)}function pe(re,Be,we,ut,ie,Le){var Pe=re;do{for(var Ge=Pe.next.next;Ge!==Pe.prev;){if(Pe.i!==Ge.i&&Zt(Pe,Ge)){var Vt=qe(Pe,Ge);Pe=te(Pe,Pe.next),Vt=te(Vt,Vt.next),ye(Pe,Be,we,ut,ie,Le,0),ye(Vt,Be,we,ut,ie,Le,0);return}Ge=Ge.next}Pe=Pe.next}while(Pe!==re)}function fe(re,Be,we,ut){var ie=[],Le,Pe,Ge,Vt,Et;for(Le=0,Pe=Be.length;Le<Pe;Le++)Ge=Be[Le]*ut,Vt=Le<Pe-1?Be[Le+1]*ut:re.length,Et=U(re,Ge,Vt,ut,!1),Et===Et.next&&(Et.steiner=!0),ie.push(Yt(Et));for(ie.sort(it),Le=0;Le<ie.length;Le++)we=ce(ie[Le],we);return we}function it(re,Be){return re.x-Be.x}function ce(re,Be){var we=rt(re,Be);if(!we)return Be;var ut=qe(we,re);return te(ut,ut.next),te(we,we.next)}function rt(re,Be){var we=Be,ut=re.x,ie=re.y,Le=-1/0,Pe;do{if(ie<=we.y&&ie>=we.next.y&&we.next.y!==we.y){var Ge=we.x+(ie-we.y)*(we.next.x-we.x)/(we.next.y-we.y);if(Ge<=ut&&Ge>Le&&(Le=Ge,Pe=we.x<we.next.x?we:we.next,Ge===ut))return Pe}we=we.next}while(we!==Be);if(!Pe)return null;var Vt=Pe,Et=Pe.x,Jr=Pe.y,on=1/0,Mr;we=Pe;do ut>=we.x&&we.x>=Et&&ut!==we.x&&ar(ie<Jr?ut:Le,ie,Et,Jr,ie<Jr?Le:ut,ie,we.x,we.y)&&(Mr=Math.abs(ie-we.y)/(ut-we.x),ft(we,re)&&(Mr<on||Mr===on&&(we.x>Pe.x||we.x===Pe.x&&vt(Pe,we)))&&(Pe=we,on=Mr)),we=we.next;while(we!==Vt);return Pe}function vt(re,Be){return bt(re.prev,re,Be.prev)<0&&bt(Be.next,re,re.next)<0}function tt(re,Be,we,ut){var ie=re;do ie.z===0&&(ie.z=Xt(ie.x,ie.y,Be,we,ut)),ie.prevZ=ie.prev,ie.nextZ=ie.next,ie=ie.next;while(ie!==re);ie.prevZ.nextZ=null,ie.prevZ=null,Ot(ie)}function Ot(re){var Be,we,ut,ie,Le,Pe,Ge,Vt,Et=1;do{for(we=re,re=null,Le=null,Pe=0;we;){for(Pe++,ut=we,Ge=0,Be=0;Be<Et&&(Ge++,ut=ut.nextZ,!!ut);Be++);for(Vt=Et;Ge>0||Vt>0&&ut;)Ge!==0&&(Vt===0||!ut||we.z<=ut.z)?(ie=we,we=we.nextZ,Ge--):(ie=ut,ut=ut.nextZ,Vt--),Le?Le.nextZ=ie:re=ie,ie.prevZ=Le,Le=ie;we=ut}Le.nextZ=null,Et*=2}while(Pe>1);return re}function Xt(re,Be,we,ut,ie){return re=(re-we)*ie|0,Be=(Be-ut)*ie|0,re=(re|re<<8)&16711935,re=(re|re<<4)&252645135,re=(re|re<<2)&858993459,re=(re|re<<1)&1431655765,Be=(Be|Be<<8)&16711935,Be=(Be|Be<<4)&252645135,Be=(Be|Be<<2)&858993459,Be=(Be|Be<<1)&1431655765,re|Be<<1}function Yt(re){var Be=re,we=re;do(Be.x<we.x||Be.x===we.x&&Be.y<we.y)&&(we=Be),Be=Be.next;while(Be!==re);return we}function ar(re,Be,we,ut,ie,Le,Pe,Ge){return(ie-Pe)*(Be-Ge)>=(re-Pe)*(Le-Ge)&&(re-Pe)*(ut-Ge)>=(we-Pe)*(Be-Ge)&&(we-Pe)*(Le-Ge)>=(ie-Pe)*(ut-Ge)}function Zt(re,Be){return re.next.i!==Be.i&&re.prev.i!==Be.i&&!Mt(re,Be)&&(ft(re,Be)&&ft(Be,re)&&kt(re,Be)&&(bt(re.prev,re,Be.prev)||bt(re,Be.prev,Be))||St(re,Be)&&bt(re.prev,re,re.next)>0&&bt(Be.prev,Be,Be.next)>0)}function bt(re,Be,we){return(Be.y-re.y)*(we.x-Be.x)-(Be.x-re.x)*(we.y-Be.y)}function St(re,Be){return re.x===Be.x&&re.y===Be.y}function Rr(re,Be,we,ut){var ie=fr(bt(re,Be,we)),Le=fr(bt(re,Be,ut)),Pe=fr(bt(we,ut,re)),Ge=fr(bt(we,ut,Be));return!!(ie!==Le&&Pe!==Ge||ie===0&&gr(re,we,Be)||Le===0&&gr(re,ut,Be)||Pe===0&&gr(we,re,ut)||Ge===0&&gr(we,Be,ut))}function gr(re,Be,we){return Be.x<=Math.max(re.x,we.x)&&Be.x>=Math.min(re.x,we.x)&&Be.y<=Math.max(re.y,we.y)&&Be.y>=Math.min(re.y,we.y)}function fr(re){return re>0?1:re<0?-1:0}function Mt(re,Be){var we=re;do{if(we.i!==re.i&&we.next.i!==re.i&&we.i!==Be.i&&we.next.i!==Be.i&&Rr(we,we.next,re,Be))return!0;we=we.next}while(we!==re);return!1}function ft(re,Be){return bt(re.prev,re,re.next)<0?bt(re,Be,re.next)>=0&&bt(re,re.prev,Be)>=0:bt(re,Be,re.prev)<0||bt(re,re.next,Be)<0}function kt(re,Be){var we=re,ut=!1,ie=(re.x+Be.x)/2,Le=(re.y+Be.y)/2;do we.y>Le!=we.next.y>Le&&we.next.y!==we.y&&ie<(we.next.x-we.x)*(Le-we.y)/(we.next.y-we.y)+we.x&&(ut=!ut),we=we.next;while(we!==re);return ut}function qe(re,Be){var we=new oe(re.i,re.x,re.y),ut=new oe(Be.i,Be.x,Be.y),ie=re.next,Le=Be.prev;return re.next=Be,Be.prev=re,we.next=ie,ie.prev=we,ut.next=we,we.prev=ut,Le.next=ut,ut.prev=Le,ut}function Dt(re,Be,we,ut){var ie=new oe(re,Be,we);return ut?(ie.next=ut.next,ie.prev=ut,ut.next.prev=ie,ut.next=ie):(ie.prev=ie,ie.next=ie),ie}function dr(re){re.next.prev=re.prev,re.prev.next=re.next,re.prevZ&&(re.prevZ.nextZ=re.nextZ),re.nextZ&&(re.nextZ.prevZ=re.prevZ)}function oe(re,Be,we){this.i=re,this.x=Be,this.y=we,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}ne.deviation=function(re,Be,we,ut){var ie=Be&&Be.length,Le=ie?Be[0]*we:re.length,Pe=Math.abs(H(re,0,Le,we));if(ie)for(var Ge=0,Vt=Be.length;Ge<Vt;Ge++){var Et=Be[Ge]*we,Jr=Ge<Vt-1?Be[Ge+1]*we:re.length;Pe-=Math.abs(H(re,Et,Jr,we))}var on=0;for(Ge=0;Ge<ut.length;Ge+=3){var Mr=ut[Ge]*we,Dn=ut[Ge+1]*we,bn=ut[Ge+2]*we;on+=Math.abs((re[Mr]-re[bn])*(re[Dn+1]-re[Mr+1])-(re[Mr]-re[Dn])*(re[bn+1]-re[Mr+1]))}return Pe===0&&on===0?0:Math.abs((on-Pe)/Pe)};function H(re,Be,we,ut){for(var ie=0,Le=Be,Pe=we-ut;Le<we;Le+=ut)ie+=(re[Pe]-re[Le])*(re[Le+1]+re[Pe+1]),Pe=Le;return ie}ne.flatten=function(re){for(var Be=re[0][0].length,we={vertices:[],holes:[],dimensions:Be},ut=0,ie=0;ie<re.length;ie++){for(var Le=0;Le<re[ie].length;Le++)for(var Pe=0;Pe<Be;Pe++)we.vertices.push(re[ie][Le][Pe]);ie>0&&(ut+=re[ie-1].length,we.holes.push(ut))}return we}},31204:function(sr){function ne(te){var ye=te.target||te.srcElement;ye.__resizeRAF__&&cancelAnimationFrame(ye.__resizeRAF__),ye.__resizeRAF__=requestAnimationFrame(function(){var y=ye.__resizeTrigger__,he=y&&y.__resizeListeners__;he&&he.forEach(function(Z){Z.call(y,te)})})}var U=function(ye,y){var he=this,Z=he.document,pe,fe=Z.attachEvent;typeof navigator!="undefined"&&(pe=navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/Edge/));function it(){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__,this.contentDocument.defaultView.addEventListener("resize",ne)}if(!ye.__resizeListeners__)if(ye.__resizeListeners__=[],fe)ye.__resizeTrigger__=ye,ye.attachEvent("onresize",ne);else{getComputedStyle(ye).position==="static"&&(ye.style.position="relative");var ce=ye.__resizeTrigger__=Z.createElement("object");ce.setAttribute("style","position: absolute; top: 0; left: 0; height: 100%; width: 100%; pointer-events: none; z-index: -1; opacity: 0;"),ce.setAttribute("class","resize-sensor"),ce.setAttribute("tabindex","-1"),ce.setAttribute("title",""),ce.__resizeElement__=ye,ce.onload=it,ce.type="text/html",pe&&ye.appendChild(ce),ce.data="about:blank",pe||ye.appendChild(ce)}ye.__resizeListeners__.push(y)};sr.exports=typeof window=="undefined"?U:U.bind(window),sr.exports.unbind=function(te,ye){var y=document.attachEvent,he=te.__resizeListeners__||[];if(ye){var Z=he.indexOf(ye);Z!==-1&&he.splice(Z,1)}else he=te.__resizeListeners__=[];if(!he.length){if(y)te.detachEvent("onresize",ne);else if(te.__resizeTrigger__){var pe=te.__resizeTrigger__.contentDocument,fe=pe&&pe.defaultView;fe&&(fe.removeEventListener("resize",ne),delete fe.__resizeTrigger__),te.__resizeTrigger__=!te.removeChild(te.__resizeTrigger__)}delete te.__resizeListeners__}}},11312:function(sr){"use strict";var ne=Object.prototype.hasOwnProperty,U="~";function te(){}Object.create&&(te.prototype=Object.create(null),new te().__proto__||(U=!1));function ye(pe,fe,it){this.fn=pe,this.context=fe,this.once=it||!1}function y(pe,fe,it,ce,rt){if(typeof it!="function")throw new TypeError("The listener must be a function");var vt=new ye(it,ce||pe,rt),tt=U?U+fe:fe;return pe._events[tt]?pe._events[tt].fn?pe._events[tt]=[pe._events[tt],vt]:pe._events[tt].push(vt):(pe._events[tt]=vt,pe._eventsCount++),pe}function he(pe,fe){--pe._eventsCount===0?pe._events=new te:delete pe._events[fe]}function Z(){this._events=new te,this._eventsCount=0}Z.prototype.eventNames=function(){var fe=[],it,ce;if(this._eventsCount===0)return fe;for(ce in it=this._events)ne.call(it,ce)&&fe.push(U?ce.slice(1):ce);return Object.getOwnPropertySymbols?fe.concat(Object.getOwnPropertySymbols(it)):fe},Z.prototype.listeners=function(fe){var it=U?U+fe:fe,ce=this._events[it];if(!ce)return[];if(ce.fn)return[ce.fn];for(var rt=0,vt=ce.length,tt=new Array(vt);rt<vt;rt++)tt[rt]=ce[rt].fn;return tt},Z.prototype.listenerCount=function(fe){var it=U?U+fe:fe,ce=this._events[it];return ce?ce.fn?1:ce.length:0},Z.prototype.emit=function(fe,it,ce,rt,vt,tt){var Ot=U?U+fe:fe;if(!this._events[Ot])return!1;var Xt=this._events[Ot],Yt=arguments.length,ar,Zt;if(Xt.fn){switch(Xt.once&&this.removeListener(fe,Xt.fn,void 0,!0),Yt){case 1:return Xt.fn.call(Xt.context),!0;case 2:return Xt.fn.call(Xt.context,it),!0;case 3:return Xt.fn.call(Xt.context,it,ce),!0;case 4:return Xt.fn.call(Xt.context,it,ce,rt),!0;case 5:return Xt.fn.call(Xt.context,it,ce,rt,vt),!0;case 6:return Xt.fn.call(Xt.context,it,ce,rt,vt,tt),!0}for(Zt=1,ar=new Array(Yt-1);Zt<Yt;Zt++)ar[Zt-1]=arguments[Zt];Xt.fn.apply(Xt.context,ar)}else{var bt=Xt.length,St;for(Zt=0;Zt<bt;Zt++)switch(Xt[Zt].once&&this.removeListener(fe,Xt[Zt].fn,void 0,!0),Yt){case 1:Xt[Zt].fn.call(Xt[Zt].context);break;case 2:Xt[Zt].fn.call(Xt[Zt].context,it);break;case 3:Xt[Zt].fn.call(Xt[Zt].context,it,ce);break;case 4:Xt[Zt].fn.call(Xt[Zt].context,it,ce,rt);break;default:if(!ar)for(St=1,ar=new Array(Yt-1);St<Yt;St++)ar[St-1]=arguments[St];Xt[Zt].fn.apply(Xt[Zt].context,ar)}}return!0},Z.prototype.on=function(fe,it,ce){return y(this,fe,it,ce,!1)},Z.prototype.once=function(fe,it,ce){return y(this,fe,it,ce,!0)},Z.prototype.removeListener=function(fe,it,ce,rt){var vt=U?U+fe:fe;if(!this._events[vt])return this;if(!it)return he(this,vt),this;var tt=this._events[vt];if(tt.fn)tt.fn===it&&(!rt||tt.once)&&(!ce||tt.context===ce)&&he(this,vt);else{for(var Ot=0,Xt=[],Yt=tt.length;Ot<Yt;Ot++)(tt[Ot].fn!==it||rt&&!tt[Ot].once||ce&&tt[Ot].context!==ce)&&Xt.push(tt[Ot]);Xt.length?this._events[vt]=Xt.length===1?Xt[0]:Xt:he(this,vt)}return this},Z.prototype.removeAllListeners=function(fe){var it;return fe?(it=U?U+fe:fe,this._events[it]&&he(this,it)):(this._events=new te,this._eventsCount=0),this},Z.prototype.off=Z.prototype.removeListener,Z.prototype.addListener=Z.prototype.on,Z.prefixed=U,Z.EventEmitter=Z,sr.exports=Z},11553:function(sr,ne,U){var te;(function(ye,y,he,Z){"use strict";var pe=["","webkit","Moz","MS","ms","o"],fe=y.createElement("div"),it="function",ce=Math.round,rt=Math.abs,vt=Date.now;function tt(ge,ke,gt){return setTimeout(Rr(ge,gt),ke)}function Ot(ge,ke,gt){return Array.isArray(ge)?(Xt(ge,gt[ke],gt),!0):!1}function Xt(ge,ke,gt){var lr;if(ge)if(ge.forEach)ge.forEach(ke,gt);else if(ge.length!==Z)for(lr=0;lr<ge.length;)ke.call(gt,ge[lr],lr,ge),lr++;else for(lr in ge)ge.hasOwnProperty(lr)&&ke.call(gt,ge[lr],lr,ge)}function Yt(ge,ke,gt){var lr="DEPRECATED METHOD: "+ke+`
|
|
`+gt+` AT
|
|
`;return function(){var Kr=new Error("get-stack-trace"),kn=Kr&&Kr.stack?Kr.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ji=ye.console&&(ye.console.warn||ye.console.log);return ji&&ji.call(ye.console,lr,kn),ge.apply(this,arguments)}}var ar;typeof Object.assign!="function"?ar=function(ke){if(ke===Z||ke===null)throw new TypeError("Cannot convert undefined or null to object");for(var gt=Object(ke),lr=1;lr<arguments.length;lr++){var Kr=arguments[lr];if(Kr!==Z&&Kr!==null)for(var kn in Kr)Kr.hasOwnProperty(kn)&&(gt[kn]=Kr[kn])}return gt}:ar=Object.assign;var Zt=Yt(function(ke,gt,lr){for(var Kr=Object.keys(gt),kn=0;kn<Kr.length;)(!lr||lr&&ke[Kr[kn]]===Z)&&(ke[Kr[kn]]=gt[Kr[kn]]),kn++;return ke},"extend","Use `assign`."),bt=Yt(function(ke,gt){return Zt(ke,gt,!0)},"merge","Use `assign`.");function St(ge,ke,gt){var lr=ke.prototype,Kr;Kr=ge.prototype=Object.create(lr),Kr.constructor=ge,Kr._super=lr,gt&&ar(Kr,gt)}function Rr(ge,ke){return function(){return ge.apply(ke,arguments)}}function gr(ge,ke){return typeof ge==it?ge.apply(ke&&ke[0]||Z,ke):ge}function fr(ge,ke){return ge===Z?ke:ge}function Mt(ge,ke,gt){Xt(Dt(ke),function(lr){ge.addEventListener(lr,gt,!1)})}function ft(ge,ke,gt){Xt(Dt(ke),function(lr){ge.removeEventListener(lr,gt,!1)})}function kt(ge,ke){for(;ge;){if(ge==ke)return!0;ge=ge.parentNode}return!1}function qe(ge,ke){return ge.indexOf(ke)>-1}function Dt(ge){return ge.trim().split(/\s+/g)}function dr(ge,ke,gt){if(ge.indexOf&&!gt)return ge.indexOf(ke);for(var lr=0;lr<ge.length;){if(gt&&ge[lr][gt]==ke||!gt&&ge[lr]===ke)return lr;lr++}return-1}function oe(ge){return Array.prototype.slice.call(ge,0)}function H(ge,ke,gt){for(var lr=[],Kr=[],kn=0;kn<ge.length;){var ji=ke?ge[kn][ke]:ge[kn];dr(Kr,ji)<0&&lr.push(ge[kn]),Kr[kn]=ji,kn++}return gt&&(ke?lr=lr.sort(function(Co,po){return Co[ke]>po[ke]}):lr=lr.sort()),lr}function re(ge,ke){for(var gt,lr,Kr=ke[0].toUpperCase()+ke.slice(1),kn=0;kn<pe.length;){if(gt=pe[kn],lr=gt?gt+Kr:ke,lr in ge)return lr;kn++}return Z}var Be=1;function we(){return Be++}function ut(ge){var ke=ge.ownerDocument||ge;return ke.defaultView||ke.parentWindow||ye}var ie=/mobile|tablet|ip(ad|hone|od)|android/i,Le="ontouchstart"in ye,Pe=re(ye,"PointerEvent")!==Z,Ge=Le&&ie.test(navigator.userAgent),Vt="touch",Et="pen",Jr="mouse",on="kinect",Mr=25,Dn=1,bn=2,rn=4,yi=8,ti=1,Zi=2,En=4,Rn=8,sa=16,ki=Zi|En,ba=Rn|sa,fo=ki|ba,Re=["x","y"],Ea=["clientX","clientY"];function va(ge,ke){var gt=this;this.manager=ge,this.callback=ke,this.element=ge.element,this.target=ge.options.inputTarget,this.domHandler=function(lr){gr(ge.options.enable,[ge])&>.handler(lr)},this.init()}va.prototype={handler:function(){},init:function(){this.evEl&&Mt(this.element,this.evEl,this.domHandler),this.evTarget&&Mt(this.target,this.evTarget,this.domHandler),this.evWin&&Mt(ut(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&ft(this.element,this.evEl,this.domHandler),this.evTarget&&ft(this.target,this.evTarget,this.domHandler),this.evWin&&ft(ut(this.element),this.evWin,this.domHandler)}};function Za(ge){var ke,gt=ge.options.inputClass;return gt?ke=gt:Pe?ke=B:Ge?ke=Fe:Le?ke=yr:ke=zt,new ke(ge,Ms)}function Ms(ge,ke,gt){var lr=gt.pointers.length,Kr=gt.changedPointers.length,kn=ke&Dn&&lr-Kr===0,ji=ke&(rn|yi)&&lr-Kr===0;gt.isFirst=!!kn,gt.isFinal=!!ji,kn&&(ge.session={}),gt.eventType=ke,ho(ge,gt),ge.emit("hammer.input",gt),ge.recognize(gt),ge.session.prevInput=gt}function ho(ge,ke){var gt=ge.session,lr=ke.pointers,Kr=lr.length;gt.firstInput||(gt.firstInput=pr(ke)),Kr>1&&!gt.firstMultiple?gt.firstMultiple=pr(ke):Kr===1&&(gt.firstMultiple=!1);var kn=gt.firstInput,ji=gt.firstMultiple,go=ji?ji.center:kn.center,Co=ke.center=Vr(lr);ke.timeStamp=vt(),ke.deltaTime=ke.timeStamp-kn.timeStamp,ke.angle=ue(go,Co),ke.distance=Gi(go,Co),Zo(gt,ke),ke.offsetDirection=Ln(ke.deltaX,ke.deltaY);var po=en(ke.deltaTime,ke.deltaX,ke.deltaY);ke.overallVelocityX=po.x,ke.overallVelocityY=po.y,ke.overallVelocity=rt(po.x)>rt(po.y)?po.x:po.y,ke.scale=ji?z(ji.pointers,lr):1,ke.rotation=ji?k(ji.pointers,lr):0,ke.maxPointers=gt.prevInput?ke.pointers.length>gt.prevInput.maxPointers?ke.pointers.length:gt.prevInput.maxPointers:ke.pointers.length,jt(gt,ke);var Ls=ge.element;kt(ke.srcEvent.target,Ls)&&(Ls=ke.srcEvent.target),ke.target=Ls}function Zo(ge,ke){var gt=ke.center,lr=ge.offsetDelta||{},Kr=ge.prevDelta||{},kn=ge.prevInput||{};(ke.eventType===Dn||kn.eventType===rn)&&(Kr=ge.prevDelta={x:kn.deltaX||0,y:kn.deltaY||0},lr=ge.offsetDelta={x:gt.x,y:gt.y}),ke.deltaX=Kr.x+(gt.x-lr.x),ke.deltaY=Kr.y+(gt.y-lr.y)}function jt(ge,ke){var gt=ge.lastInterval||ke,lr=ke.timeStamp-gt.timeStamp,Kr,kn,ji,go;if(ke.eventType!=yi&&(lr>Mr||gt.velocity===Z)){var Co=ke.deltaX-gt.deltaX,po=ke.deltaY-gt.deltaY,Ls=en(lr,Co,po);kn=Ls.x,ji=Ls.y,Kr=rt(Ls.x)>rt(Ls.y)?Ls.x:Ls.y,go=Ln(Co,po),ge.lastInterval=ke}else Kr=gt.velocity,kn=gt.velocityX,ji=gt.velocityY,go=gt.direction;ke.velocity=Kr,ke.velocityX=kn,ke.velocityY=ji,ke.direction=go}function pr(ge){for(var ke=[],gt=0;gt<ge.pointers.length;)ke[gt]={clientX:ce(ge.pointers[gt].clientX),clientY:ce(ge.pointers[gt].clientY)},gt++;return{timeStamp:vt(),pointers:ke,center:Vr(ke),deltaX:ge.deltaX,deltaY:ge.deltaY}}function Vr(ge){var ke=ge.length;if(ke===1)return{x:ce(ge[0].clientX),y:ce(ge[0].clientY)};for(var gt=0,lr=0,Kr=0;Kr<ke;)gt+=ge[Kr].clientX,lr+=ge[Kr].clientY,Kr++;return{x:ce(gt/ke),y:ce(lr/ke)}}function en(ge,ke,gt){return{x:ke/ge||0,y:gt/ge||0}}function Ln(ge,ke){return ge===ke?ti:rt(ge)>=rt(ke)?ge<0?Zi:En:ke<0?Rn:sa}function Gi(ge,ke,gt){gt||(gt=Re);var lr=ke[gt[0]]-ge[gt[0]],Kr=ke[gt[1]]-ge[gt[1]];return Math.sqrt(lr*lr+Kr*Kr)}function ue(ge,ke,gt){gt||(gt=Re);var lr=ke[gt[0]]-ge[gt[0]],Kr=ke[gt[1]]-ge[gt[1]];return Math.atan2(Kr,lr)*180/Math.PI}function k(ge,ke){return ue(ke[1],ke[0],Ea)+ue(ge[1],ge[0],Ea)}function z(ge,ke){return Gi(ke[0],ke[1],Ea)/Gi(ge[0],ge[1],Ea)}var ae={mousedown:Dn,mousemove:bn,mouseup:rn},Ee="mousedown",De="mousemove mouseup";function zt(){this.evEl=Ee,this.evWin=De,this.pressed=!1,va.apply(this,arguments)}St(zt,va,{handler:function(ke){var gt=ae[ke.type];gt&Dn&&ke.button===0&&(this.pressed=!0),gt&bn&&ke.which!==1&&(gt=rn),this.pressed&&(gt&rn&&(this.pressed=!1),this.callback(this.manager,gt,{pointers:[ke],changedPointers:[ke],pointerType:Jr,srcEvent:ke}))}});var Tt={pointerdown:Dn,pointermove:bn,pointerup:rn,pointercancel:yi,pointerout:yi},Rt={2:Vt,3:Et,4:Jr,5:on},dt="pointerdown",N="pointermove pointerup pointercancel";ye.MSPointerEvent&&!ye.PointerEvent&&(dt="MSPointerDown",N="MSPointerMove MSPointerUp MSPointerCancel");function B(){this.evEl=dt,this.evWin=N,va.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}St(B,va,{handler:function(ke){var gt=this.store,lr=!1,Kr=ke.type.toLowerCase().replace("ms",""),kn=Tt[Kr],ji=Rt[ke.pointerType]||ke.pointerType,go=ji==Vt,Co=dr(gt,ke.pointerId,"pointerId");kn&Dn&&(ke.button===0||go)?Co<0&&(gt.push(ke),Co=gt.length-1):kn&(rn|yi)&&(lr=!0),!(Co<0)&&(gt[Co]=ke,this.callback(this.manager,kn,{pointers:gt,changedPointers:[ke],pointerType:ji,srcEvent:ke}),lr&>.splice(Co,1))}});var $={touchstart:Dn,touchmove:bn,touchend:rn,touchcancel:yi},ee="touchstart",xe="touchstart touchmove touchend touchcancel";function Ue(){this.evTarget=ee,this.evWin=xe,this.started=!1,va.apply(this,arguments)}St(Ue,va,{handler:function(ke){var gt=$[ke.type];if(gt===Dn&&(this.started=!0),!!this.started){var lr=Qe.call(this,ke,gt);gt&(rn|yi)&&lr[0].length-lr[1].length===0&&(this.started=!1),this.callback(this.manager,gt,{pointers:lr[0],changedPointers:lr[1],pointerType:Vt,srcEvent:ke})}}});function Qe(ge,ke){var gt=oe(ge.touches),lr=oe(ge.changedTouches);return ke&(rn|yi)&&(gt=H(gt.concat(lr),"identifier",!0)),[gt,lr]}var j={touchstart:Dn,touchmove:bn,touchend:rn,touchcancel:yi},Q="touchstart touchmove touchend touchcancel";function Fe(){this.evTarget=Q,this.targetIds={},va.apply(this,arguments)}St(Fe,va,{handler:function(ke){var gt=j[ke.type],lr=et.call(this,ke,gt);lr&&this.callback(this.manager,gt,{pointers:lr[0],changedPointers:lr[1],pointerType:Vt,srcEvent:ke})}});function et(ge,ke){var gt=oe(ge.touches),lr=this.targetIds;if(ke&(Dn|bn)&>.length===1)return lr[gt[0].identifier]=!0,[gt,gt];var Kr,kn,ji=oe(ge.changedTouches),go=[],Co=this.target;if(kn=gt.filter(function(po){return kt(po.target,Co)}),ke===Dn)for(Kr=0;Kr<kn.length;)lr[kn[Kr].identifier]=!0,Kr++;for(Kr=0;Kr<ji.length;)lr[ji[Kr].identifier]&&go.push(ji[Kr]),ke&(rn|yi)&&delete lr[ji[Kr].identifier],Kr++;if(go.length)return[H(kn.concat(go),"identifier",!0),go]}var Ae=2500,$t=25;function yr(){va.apply(this,arguments);var ge=Rr(this.handler,this);this.touch=new Fe(this.manager,ge),this.mouse=new zt(this.manager,ge),this.primaryTouch=null,this.lastTouches=[]}St(yr,va,{handler:function(ke,gt,lr){var Kr=lr.pointerType==Vt,kn=lr.pointerType==Jr;if(!(kn&&lr.sourceCapabilities&&lr.sourceCapabilities.firesTouchEvents)){if(Kr)nn.call(this,gt,lr);else if(kn&&tr.call(this,lr))return;this.callback(ke,gt,lr)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function nn(ge,ke){ge&Dn?(this.primaryTouch=ke.changedPointers[0].identifier,Qr.call(this,ke)):ge&(rn|yi)&&Qr.call(this,ke)}function Qr(ge){var ke=ge.changedPointers[0];if(ke.identifier===this.primaryTouch){var gt={x:ke.clientX,y:ke.clientY};this.lastTouches.push(gt);var lr=this.lastTouches,Kr=function(){var kn=lr.indexOf(gt);kn>-1&&lr.splice(kn,1)};setTimeout(Kr,Ae)}}function tr(ge){for(var ke=ge.srcEvent.clientX,gt=ge.srcEvent.clientY,lr=0;lr<this.lastTouches.length;lr++){var Kr=this.lastTouches[lr],kn=Math.abs(ke-Kr.x),ji=Math.abs(gt-Kr.y);if(kn<=$t&&ji<=$t)return!0}return!1}var Xr=re(fe.style,"touchAction"),zr=Xr!==Z,jr="compute",Jn="auto",ln="manipulation",hi="none",Vi="pan-x",ci="pan-y",Li=Qi();function Ei(ge,ke){this.manager=ge,this.set(ke)}Ei.prototype={set:function(ge){ge==jr&&(ge=this.compute()),zr&&this.manager.element.style&&Li[ge]&&(this.manager.element.style[Xr]=ge),this.actions=ge.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var ge=[];return Xt(this.manager.recognizers,function(ke){gr(ke.options.enable,[ke])&&(ge=ge.concat(ke.getTouchAction()))}),ns(ge.join(" "))},preventDefaults:function(ge){var ke=ge.srcEvent,gt=ge.offsetDirection;if(this.manager.session.prevented){ke.preventDefault();return}var lr=this.actions,Kr=qe(lr,hi)&&!Li[hi],kn=qe(lr,ci)&&!Li[ci],ji=qe(lr,Vi)&&!Li[Vi];if(Kr){var go=ge.pointers.length===1,Co=ge.distance<2,po=ge.deltaTime<250;if(go&&Co&&po)return}if(!(ji&&kn)&&(Kr||kn&>&ki||ji&>&ba))return this.preventSrc(ke)},preventSrc:function(ge){this.manager.session.prevented=!0,ge.preventDefault()}};function ns(ge){if(qe(ge,hi))return hi;var ke=qe(ge,Vi),gt=qe(ge,ci);return ke&>?hi:ke||gt?ke?Vi:ci:qe(ge,ln)?ln:Jn}function Qi(){if(!zr)return!1;var ge={},ke=ye.CSS&&ye.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(gt){ge[gt]=ke?ye.CSS.supports("touch-action",gt):!0}),ge}var Pa=1,Si=2,di=4,Ai=8,Oa=Ai,vu=16,fa=32;function Ra(ge){this.options=ar({},this.defaults,ge||{}),this.id=we(),this.manager=null,this.options.enable=fr(this.options.enable,!0),this.state=Pa,this.simultaneous={},this.requireFail=[]}Ra.prototype={defaults:{},set:function(ge){return ar(this.options,ge),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(ge){if(Ot(ge,"recognizeWith",this))return this;var ke=this.simultaneous;return ge=Ma(ge,this),ke[ge.id]||(ke[ge.id]=ge,ge.recognizeWith(this)),this},dropRecognizeWith:function(ge){return Ot(ge,"dropRecognizeWith",this)?this:(ge=Ma(ge,this),delete this.simultaneous[ge.id],this)},requireFailure:function(ge){if(Ot(ge,"requireFailure",this))return this;var ke=this.requireFail;return ge=Ma(ge,this),dr(ke,ge)===-1&&(ke.push(ge),ge.requireFailure(this)),this},dropRequireFailure:function(ge){if(Ot(ge,"dropRequireFailure",this))return this;ge=Ma(ge,this);var ke=dr(this.requireFail,ge);return ke>-1&&this.requireFail.splice(ke,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(ge){return!!this.simultaneous[ge.id]},emit:function(ge){var ke=this,gt=this.state;function lr(Kr){ke.manager.emit(Kr,ge)}gt<Ai&&lr(ke.options.event+Gl(gt)),lr(ke.options.event),ge.additionalEvent&&lr(ge.additionalEvent),gt>=Ai&&lr(ke.options.event+Gl(gt))},tryEmit:function(ge){if(this.canEmit())return this.emit(ge);this.state=fa},canEmit:function(){for(var ge=0;ge<this.requireFail.length;){if(!(this.requireFail[ge].state&(fa|Pa)))return!1;ge++}return!0},recognize:function(ge){var ke=ar({},ge);if(!gr(this.options.enable,[this,ke])){this.reset(),this.state=fa;return}this.state&(Oa|vu|fa)&&(this.state=Pa),this.state=this.process(ke),this.state&(Si|di|Ai|vu)&&this.tryEmit(ke)},process:function(ge){},getTouchAction:function(){},reset:function(){}};function Gl(ge){return ge&vu?"cancel":ge&Ai?"end":ge&di?"move":ge&Si?"start":""}function vs(ge){return ge==sa?"down":ge==Rn?"up":ge==Zi?"left":ge==En?"right":""}function Ma(ge,ke){var gt=ke.manager;return gt?gt.get(ge):ge}function vi(){Ra.apply(this,arguments)}St(vi,Ra,{defaults:{pointers:1},attrTest:function(ge){var ke=this.options.pointers;return ke===0||ge.pointers.length===ke},process:function(ge){var ke=this.state,gt=ge.eventType,lr=ke&(Si|di),Kr=this.attrTest(ge);return lr&&(gt&yi||!Kr)?ke|vu:lr||Kr?gt&rn?ke|Ai:ke&Si?ke|di:Si:fa}});function ka(){vi.apply(this,arguments),this.pX=null,this.pY=null}St(ka,vi,{defaults:{event:"pan",threshold:10,pointers:1,direction:fo},getTouchAction:function(){var ge=this.options.direction,ke=[];return ge&ki&&ke.push(ci),ge&ba&&ke.push(Vi),ke},directionTest:function(ge){var ke=this.options,gt=!0,lr=ge.distance,Kr=ge.direction,kn=ge.deltaX,ji=ge.deltaY;return Kr&ke.direction||(ke.direction&ki?(Kr=kn===0?ti:kn<0?Zi:En,gt=kn!=this.pX,lr=Math.abs(ge.deltaX)):(Kr=ji===0?ti:ji<0?Rn:sa,gt=ji!=this.pY,lr=Math.abs(ge.deltaY))),ge.direction=Kr,gt&&lr>ke.threshold&&Kr&ke.direction},attrTest:function(ge){return vi.prototype.attrTest.call(this,ge)&&(this.state&Si||!(this.state&Si)&&this.directionTest(ge))},emit:function(ge){this.pX=ge.deltaX,this.pY=ge.deltaY;var ke=vs(ge.direction);ke&&(ge.additionalEvent=this.options.event+ke),this._super.emit.call(this,ge)}});function na(){vi.apply(this,arguments)}St(na,vi,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[hi]},attrTest:function(ge){return this._super.attrTest.call(this,ge)&&(Math.abs(ge.scale-1)>this.options.threshold||this.state&Si)},emit:function(ge){if(ge.scale!==1){var ke=ge.scale<1?"in":"out";ge.additionalEvent=this.options.event+ke}this._super.emit.call(this,ge)}});function Vo(){Ra.apply(this,arguments),this._timer=null,this._input=null}St(Vo,Ra,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Jn]},process:function(ge){var ke=this.options,gt=ge.pointers.length===ke.pointers,lr=ge.distance<ke.threshold,Kr=ge.deltaTime>ke.time;if(this._input=ge,!lr||!gt||ge.eventType&(rn|yi)&&!Kr)this.reset();else if(ge.eventType&Dn)this.reset(),this._timer=tt(function(){this.state=Oa,this.tryEmit()},ke.time,this);else if(ge.eventType&rn)return Oa;return fa},reset:function(){clearTimeout(this._timer)},emit:function(ge){this.state===Oa&&(ge&&ge.eventType&rn?this.manager.emit(this.options.event+"up",ge):(this._input.timeStamp=vt(),this.manager.emit(this.options.event,this._input)))}});function ca(){vi.apply(this,arguments)}St(ca,vi,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[hi]},attrTest:function(ge){return this._super.attrTest.call(this,ge)&&(Math.abs(ge.rotation)>this.options.threshold||this.state&Si)}});function is(){vi.apply(this,arguments)}St(is,vi,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ki|ba,pointers:1},getTouchAction:function(){return ka.prototype.getTouchAction.call(this)},attrTest:function(ge){var ke=this.options.direction,gt;return ke&(ki|ba)?gt=ge.overallVelocity:ke&ki?gt=ge.overallVelocityX:ke&ba&&(gt=ge.overallVelocityY),this._super.attrTest.call(this,ge)&&ke&ge.offsetDirection&&ge.distance>this.options.threshold&&ge.maxPointers==this.options.pointers&&rt(gt)>this.options.velocity&&ge.eventType&rn},emit:function(ge){var ke=vs(ge.offsetDirection);ke&&this.manager.emit(this.options.event+ke,ge),this.manager.emit(this.options.event,ge)}});function qo(){Ra.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}St(qo,Ra,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ln]},process:function(ge){var ke=this.options,gt=ge.pointers.length===ke.pointers,lr=ge.distance<ke.threshold,Kr=ge.deltaTime<ke.time;if(this.reset(),ge.eventType&Dn&&this.count===0)return this.failTimeout();if(lr&&Kr&>){if(ge.eventType!=rn)return this.failTimeout();var kn=this.pTime?ge.timeStamp-this.pTime<ke.interval:!0,ji=!this.pCenter||Gi(this.pCenter,ge.center)<ke.posThreshold;this.pTime=ge.timeStamp,this.pCenter=ge.center,!ji||!kn?this.count=1:this.count+=1,this._input=ge;var go=this.count%ke.taps;if(go===0)return this.hasRequireFailures()?(this._timer=tt(function(){this.state=Oa,this.tryEmit()},ke.interval,this),Si):Oa}return fa},failTimeout:function(){return this._timer=tt(function(){this.state=fa},this.options.interval,this),fa},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Oa&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Du(ge,ke){return ke=ke||{},ke.recognizers=fr(ke.recognizers,Du.defaults.preset),new Sa(ge,ke)}Du.VERSION="2.0.7",Du.defaults={domEvents:!1,touchAction:jr,enable:!0,inputTarget:null,inputClass:null,preset:[[ca,{enable:!1}],[na,{enable:!1},["rotate"]],[is,{direction:ki}],[ka,{direction:ki},["swipe"]],[qo],[qo,{event:"doubletap",taps:2},["tap"]],[Vo]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ms=1,yc=2;function Sa(ge,ke){this.options=ar({},Du.defaults,ke||{}),this.options.inputTarget=this.options.inputTarget||ge,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=ge,this.input=Za(this),this.touchAction=new Ei(this,this.options.touchAction),Ji(this,!0),Xt(this.options.recognizers,function(gt){var lr=this.add(new gt[0](gt[1]));gt[2]&&lr.recognizeWith(gt[2]),gt[3]&&lr.requireFailure(gt[3])},this)}Sa.prototype={set:function(ge){return ar(this.options,ge),ge.touchAction&&this.touchAction.update(),ge.inputTarget&&(this.input.destroy(),this.input.target=ge.inputTarget,this.input.init()),this},stop:function(ge){this.session.stopped=ge?yc:ms},recognize:function(ge){var ke=this.session;if(!ke.stopped){this.touchAction.preventDefaults(ge);var gt,lr=this.recognizers,Kr=ke.curRecognizer;(!Kr||Kr&&Kr.state&Oa)&&(Kr=ke.curRecognizer=null);for(var kn=0;kn<lr.length;)gt=lr[kn],ke.stopped!==yc&&(!Kr||gt==Kr||gt.canRecognizeWith(Kr))?gt.recognize(ge):gt.reset(),!Kr&>.state&(Si|di|Ai)&&(Kr=ke.curRecognizer=gt),kn++}},get:function(ge){if(ge instanceof Ra)return ge;for(var ke=this.recognizers,gt=0;gt<ke.length;gt++)if(ke[gt].options.event==ge)return ke[gt];return null},add:function(ge){if(Ot(ge,"add",this))return this;var ke=this.get(ge.options.event);return ke&&this.remove(ke),this.recognizers.push(ge),ge.manager=this,this.touchAction.update(),ge},remove:function(ge){if(Ot(ge,"remove",this))return this;if(ge=this.get(ge),ge){var ke=this.recognizers,gt=dr(ke,ge);gt!==-1&&(ke.splice(gt,1),this.touchAction.update())}return this},on:function(ge,ke){if(ge!==Z&&ke!==Z){var gt=this.handlers;return Xt(Dt(ge),function(lr){gt[lr]=gt[lr]||[],gt[lr].push(ke)}),this}},off:function(ge,ke){if(ge!==Z){var gt=this.handlers;return Xt(Dt(ge),function(lr){ke?gt[lr]&>[lr].splice(dr(gt[lr],ke),1):delete gt[lr]}),this}},emit:function(ge,ke){this.options.domEvents&&Qt(ge,ke);var gt=this.handlers[ge]&&this.handlers[ge].slice();if(!(!gt||!gt.length)){ke.type=ge,ke.preventDefault=function(){ke.srcEvent.preventDefault()};for(var lr=0;lr<gt.length;)gt[lr](ke),lr++}},destroy:function(){this.element&&Ji(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ji(ge,ke){var gt=ge.element;if(gt.style){var lr;Xt(ge.options.cssProps,function(Kr,kn){lr=re(gt.style,kn),ke?(ge.oldCssProps[lr]=gt.style[lr],gt.style[lr]=Kr):gt.style[lr]=ge.oldCssProps[lr]||""}),ke||(ge.oldCssProps={})}}function Qt(ge,ke){var gt=y.createEvent("Event");gt.initEvent(ge,!0,!0),gt.gesture=ke,ke.target.dispatchEvent(gt)}ar(Du,{INPUT_START:Dn,INPUT_MOVE:bn,INPUT_END:rn,INPUT_CANCEL:yi,STATE_POSSIBLE:Pa,STATE_BEGAN:Si,STATE_CHANGED:di,STATE_ENDED:Ai,STATE_RECOGNIZED:Oa,STATE_CANCELLED:vu,STATE_FAILED:fa,DIRECTION_NONE:ti,DIRECTION_LEFT:Zi,DIRECTION_RIGHT:En,DIRECTION_UP:Rn,DIRECTION_DOWN:sa,DIRECTION_HORIZONTAL:ki,DIRECTION_VERTICAL:ba,DIRECTION_ALL:fo,Manager:Sa,Input:va,TouchAction:Ei,TouchInput:Fe,MouseInput:zt,PointerEventInput:B,TouchMouseInput:yr,SingleTouchInput:Ue,Recognizer:Ra,AttrRecognizer:vi,Tap:qo,Pan:ka,Swipe:is,Pinch:na,Rotate:ca,Press:Vo,on:Mt,off:ft,each:Xt,merge:bt,extend:Zt,assign:ar,inherit:St,bindFn:Rr,prefixed:re});var _n=typeof ye!="undefined"?ye:typeof self!="undefined"?self:{};_n.Hammer=Du,te=function(){return Du}.call(ne,U,ne,sr),te!==Z&&(sr.exports=te)})(window,document,"Hammer")},84530:function(sr,ne){"use strict";Object.defineProperty(ne,"__esModule",{value:!0});var U=Symbol.for("INJECTION");function te(pe,fe,it,ce){function rt(){return ce&&!Reflect.hasMetadata(U,this,fe)&&Reflect.defineMetadata(U,it(),this,fe),Reflect.hasMetadata(U,this,fe)?Reflect.getMetadata(U,this,fe):it()}function vt(tt){Reflect.defineMetadata(U,tt,this,fe)}Object.defineProperty(pe,fe,{configurable:!0,enumerable:!0,get:rt,set:vt})}function ye(pe,fe){return function(it){return function(ce,rt){var vt=function(){return pe.get(it)};te(ce,rt,vt,fe)}}}ne.makePropertyInjectDecorator=ye;function y(pe,fe){return function(it,ce){return function(rt,vt){var tt=function(){return pe.getNamed(it,ce)};te(rt,vt,tt,fe)}}}ne.makePropertyInjectNamedDecorator=y;function he(pe,fe){return function(it,ce,rt){return function(vt,tt){var Ot=function(){return pe.getTagged(it,ce,rt)};te(vt,tt,Ot,fe)}}}ne.makePropertyInjectTaggedDecorator=he;function Z(pe,fe){return function(it){return function(ce,rt){var vt=function(){return pe.getAll(it)};te(ce,rt,vt,fe)}}}ne.makePropertyMultiInjectDecorator=Z},67754:function(sr,ne,U){"use strict";var te;te={value:!0};var ye=U(84530);function y(he,Z){Z===void 0&&(Z=!0);var pe=ye.makePropertyInjectDecorator(he,Z),fe=ye.makePropertyInjectNamedDecorator(he,Z),it=ye.makePropertyInjectTaggedDecorator(he,Z),ce=ye.makePropertyMultiInjectDecorator(he,Z);return{lazyInject:pe,lazyInjectNamed:fe,lazyInjectTagged:it,lazyMultiInject:ce}}ne.Z=y},38362:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.tagProperty=ne.tagParameter=ne.decorate=void 0;var te=U(81463),ye=U(17597);function y(ce,rt,vt,tt){var Ot=ye.TAGGED;Z(Ot,ce,rt,tt,vt)}ne.tagParameter=y;function he(ce,rt,vt){var tt=ye.TAGGED_PROP;Z(tt,ce.constructor,rt,vt)}ne.tagProperty=he;function Z(ce,rt,vt,tt,Ot){var Xt={},Yt=typeof Ot=="number",ar=Ot!==void 0&&Yt?Ot.toString():vt;if(Yt&&vt!==void 0)throw new Error(te.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(ce,rt)&&(Xt=Reflect.getMetadata(ce,rt));var Zt=Xt[ar];if(!Array.isArray(Zt))Zt=[];else for(var bt=0,St=Zt;bt<St.length;bt++){var Rr=St[bt];if(Rr.key===tt.key)throw new Error(te.DUPLICATED_METADATA+" "+Rr.key.toString())}Zt.push(tt),Xt[ar]=Zt,Reflect.defineMetadata(ce,Xt,rt)}function pe(ce,rt){Reflect.decorate(ce,rt)}function fe(ce,rt){return function(vt,tt){rt(vt,tt,ce)}}function it(ce,rt,vt){typeof vt=="number"?pe([fe(vt,ce)],rt):typeof vt=="string"?Reflect.decorate([ce],rt,vt):pe([ce],rt)}ne.decorate=it},71791:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.inject=ne.LazyServiceIdentifer=void 0;var te=U(81463),ye=U(17597),y=U(4957),he=U(38362),Z=function(){function fe(it){this._cb=it}return fe.prototype.unwrap=function(){return this._cb()},fe}();ne.LazyServiceIdentifer=Z;function pe(fe){return function(it,ce,rt){if(fe===void 0)throw new Error(te.UNDEFINED_INJECT_ANNOTATION(it.name));var vt=new y.Metadata(ye.INJECT_TAG,fe);typeof rt=="number"?he.tagParameter(it,ce,rt,vt):he.tagProperty(it,ce,vt)}}ne.inject=pe},66733:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.injectable=void 0;var te=U(81463),ye=U(17597);function y(){return function(he){if(Reflect.hasOwnMetadata(ye.PARAM_TYPES,he))throw new Error(te.DUPLICATED_INJECTABLE_DECORATOR);var Z=Reflect.getMetadata(ye.DESIGN_PARAM_TYPES,he)||[];return Reflect.defineMetadata(ye.PARAM_TYPES,Z,he),he}}ne.injectable=y},33406:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.multiInject=void 0;var te=U(17597),ye=U(4957),y=U(38362);function he(Z){return function(pe,fe,it){var ce=new ye.Metadata(te.MULTI_INJECT_TAG,Z);typeof it=="number"?y.tagParameter(pe,fe,it,ce):y.tagProperty(pe,fe,ce)}}ne.multiInject=he},23769:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.named=void 0;var te=U(17597),ye=U(4957),y=U(38362);function he(Z){return function(pe,fe,it){var ce=new ye.Metadata(te.NAMED_TAG,Z);typeof it=="number"?y.tagParameter(pe,fe,it,ce):y.tagProperty(pe,fe,ce)}}ne.named=he},57758:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.optional=void 0;var te=U(17597),ye=U(4957),y=U(38362);function he(){return function(Z,pe,fe){var it=new ye.Metadata(te.OPTIONAL_TAG,!0);typeof fe=="number"?y.tagParameter(Z,pe,fe,it):y.tagProperty(Z,pe,it)}}ne.optional=he},82935:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.postConstruct=void 0;var te=U(81463),ye=U(17597),y=U(4957);function he(){return function(Z,pe,fe){var it=new y.Metadata(ye.POST_CONSTRUCT,pe);if(Reflect.hasOwnMetadata(ye.POST_CONSTRUCT,Z.constructor))throw new Error(te.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(ye.POST_CONSTRUCT,it,Z.constructor)}}ne.postConstruct=he},76316:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.tagged=void 0;var te=U(4957),ye=U(38362);function y(he,Z){return function(pe,fe,it){var ce=new te.Metadata(he,Z);typeof it=="number"?ye.tagParameter(pe,fe,it,ce):ye.tagProperty(pe,fe,ce)}}ne.tagged=y},26805:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.targetName=void 0;var te=U(17597),ye=U(4957),y=U(38362);function he(Z){return function(pe,fe,it){var ce=new ye.Metadata(te.NAME_TAG,Z);y.tagParameter(pe,fe,it,ce)}}ne.targetName=he},39868:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.unmanaged=void 0;var te=U(17597),ye=U(4957),y=U(38362);function he(){return function(Z,pe,fe){var it=new ye.Metadata(te.UNMANAGED_TAG,!0);y.tagParameter(Z,pe,fe,it)}}ne.unmanaged=he},55047:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.Binding=void 0;var te=U(71297),ye=U(92452),y=function(){function he(Z,pe){this.id=ye.id(),this.activated=!1,this.serviceIdentifier=Z,this.scope=pe,this.type=te.BindingTypeEnum.Invalid,this.constraint=function(fe){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return he.prototype.clone=function(){var Z=new he(this.serviceIdentifier,this.scope);return Z.activated=Z.scope===te.BindingScopeEnum.Singleton?this.activated:!1,Z.implementationType=this.implementationType,Z.dynamicValue=this.dynamicValue,Z.scope=this.scope,Z.type=this.type,Z.factory=this.factory,Z.provider=this.provider,Z.constraint=this.constraint,Z.onActivation=this.onActivation,Z.cache=this.cache,Z},he}();ne.Binding=y},53837:function(sr,ne){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.BindingCount=void 0;var U={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};ne.BindingCount=U},81463:function(sr,ne){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.STACK_OVERFLOW=ne.CIRCULAR_DEPENDENCY_IN_FACTORY=ne.POST_CONSTRUCT_ERROR=ne.MULTIPLE_POST_CONSTRUCT_METHODS=ne.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=ne.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=ne.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=ne.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=ne.ARGUMENTS_LENGTH_MISMATCH=ne.INVALID_DECORATOR_OPERATION=ne.INVALID_TO_SELF_VALUE=ne.INVALID_FUNCTION_BINDING=ne.INVALID_MIDDLEWARE_RETURN=ne.NO_MORE_SNAPSHOTS_AVAILABLE=ne.INVALID_BINDING_TYPE=ne.NOT_IMPLEMENTED=ne.CIRCULAR_DEPENDENCY=ne.UNDEFINED_INJECT_ANNOTATION=ne.MISSING_INJECT_ANNOTATION=ne.MISSING_INJECTABLE_ANNOTATION=ne.NOT_REGISTERED=ne.CANNOT_UNBIND=ne.AMBIGUOUS_MATCH=ne.KEY_NOT_FOUND=ne.NULL_ARGUMENT=ne.DUPLICATED_METADATA=ne.DUPLICATED_INJECTABLE_DECORATOR=void 0,ne.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",ne.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",ne.NULL_ARGUMENT="NULL argument",ne.KEY_NOT_FOUND="Key Not Found",ne.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",ne.CANNOT_UNBIND="Could not unbind serviceIdentifier:",ne.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",ne.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",ne.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";var U=function(he){return"@inject called with undefined this could mean that the class "+he+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."};ne.UNDEFINED_INJECT_ANNOTATION=U,ne.CIRCULAR_DEPENDENCY="Circular dependency found:",ne.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",ne.INVALID_BINDING_TYPE="Invalid binding type:",ne.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",ne.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",ne.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",ne.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",ne.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 te=function(){for(var he=[],Z=0;Z<arguments.length;Z++)he[Z]=arguments[Z];return"The number of constructor arguments in the derived class "+(he[0]+" must be >= than the number of constructor arguments of its base class.")};ne.ARGUMENTS_LENGTH_MISMATCH=te,ne.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",ne.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",ne.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",ne.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",ne.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";var ye=function(){for(var he=[],Z=0;Z<arguments.length;Z++)he[Z]=arguments[Z];return"@postConstruct error in class "+he[0]+": "+he[1]};ne.POST_CONSTRUCT_ERROR=ye;var y=function(){for(var he=[],Z=0;Z<arguments.length;Z++)he[Z]=arguments[Z];return"It looks like there is a circular dependency "+("in one of the '"+he[0]+"' bindings. Please investigate bindings with")+("service identifier '"+he[1]+"'.")};ne.CIRCULAR_DEPENDENCY_IN_FACTORY=y,ne.STACK_OVERFLOW="Maximum call stack size exceeded"},71297:function(sr,ne){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.TargetTypeEnum=ne.BindingTypeEnum=ne.BindingScopeEnum=void 0;var U={Request:"Request",Singleton:"Singleton",Transient:"Transient"};ne.BindingScopeEnum=U;var te={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};ne.BindingTypeEnum=te;var ye={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};ne.TargetTypeEnum=ye},17597:function(sr,ne){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.NON_CUSTOM_TAG_KEYS=ne.POST_CONSTRUCT=ne.DESIGN_PARAM_TYPES=ne.PARAM_TYPES=ne.TAGGED_PROP=ne.TAGGED=ne.MULTI_INJECT_TAG=ne.INJECT_TAG=ne.OPTIONAL_TAG=ne.UNMANAGED_TAG=ne.NAME_TAG=ne.NAMED_TAG=void 0,ne.NAMED_TAG="named",ne.NAME_TAG="name",ne.UNMANAGED_TAG="unmanaged",ne.OPTIONAL_TAG="optional",ne.INJECT_TAG="inject",ne.MULTI_INJECT_TAG="multi_inject",ne.TAGGED="inversify:tagged",ne.TAGGED_PROP="inversify:tagged_props",ne.PARAM_TYPES="inversify:paramtypes",ne.DESIGN_PARAM_TYPES="design:paramtypes",ne.POST_CONSTRUCT="post_construct";function U(){return[ne.INJECT_TAG,ne.MULTI_INJECT_TAG,ne.NAME_TAG,ne.UNMANAGED_TAG,ne.NAMED_TAG,ne.OPTIONAL_TAG]}ne.NON_CUSTOM_TAG_KEYS=U()},27877:function(sr,ne,U){"use strict";var te=this&&this.__awaiter||function(Zt,bt,St,Rr){function gr(fr){return fr instanceof St?fr:new St(function(Mt){Mt(fr)})}return new(St||(St=Promise))(function(fr,Mt){function ft(Dt){try{qe(Rr.next(Dt))}catch(dr){Mt(dr)}}function kt(Dt){try{qe(Rr.throw(Dt))}catch(dr){Mt(dr)}}function qe(Dt){Dt.done?fr(Dt.value):gr(Dt.value).then(ft,kt)}qe((Rr=Rr.apply(Zt,bt||[])).next())})},ye=this&&this.__generator||function(Zt,bt){var St={label:0,sent:function(){if(fr[0]&1)throw fr[1];return fr[1]},trys:[],ops:[]},Rr,gr,fr,Mt;return Mt={next:ft(0),throw:ft(1),return:ft(2)},typeof Symbol=="function"&&(Mt[Symbol.iterator]=function(){return this}),Mt;function ft(qe){return function(Dt){return kt([qe,Dt])}}function kt(qe){if(Rr)throw new TypeError("Generator is already executing.");for(;St;)try{if(Rr=1,gr&&(fr=qe[0]&2?gr.return:qe[0]?gr.throw||((fr=gr.return)&&fr.call(gr),0):gr.next)&&!(fr=fr.call(gr,qe[1])).done)return fr;switch(gr=0,fr&&(qe=[qe[0]&2,fr.value]),qe[0]){case 0:case 1:fr=qe;break;case 4:return St.label++,{value:qe[1],done:!1};case 5:St.label++,gr=qe[1],qe=[0];continue;case 7:qe=St.ops.pop(),St.trys.pop();continue;default:if(fr=St.trys,!(fr=fr.length>0&&fr[fr.length-1])&&(qe[0]===6||qe[0]===2)){St=0;continue}if(qe[0]===3&&(!fr||qe[1]>fr[0]&&qe[1]<fr[3])){St.label=qe[1];break}if(qe[0]===6&&St.label<fr[1]){St.label=fr[1],fr=qe;break}if(fr&&St.label<fr[2]){St.label=fr[2],St.ops.push(qe);break}fr[2]&&St.ops.pop(),St.trys.pop();continue}qe=bt.call(Zt,St)}catch(Dt){qe=[6,Dt],gr=0}finally{Rr=fr=0}if(qe[0]&5)throw qe[1];return{value:qe[0]?qe[1]:void 0,done:!0}}},y=this&&this.__spreadArray||function(Zt,bt){for(var St=0,Rr=bt.length,gr=Zt.length;St<Rr;St++,gr++)Zt[gr]=bt[St];return Zt};Object.defineProperty(ne,"__esModule",{value:!0}),ne.Container=void 0;var he=U(55047),Z=U(81463),pe=U(71297),fe=U(17597),it=U(51288),ce=U(14346),rt=U(50857),vt=U(98e3),tt=U(92452),Ot=U(96783),Xt=U(527),Yt=U(7026),ar=function(){function Zt(bt){this._appliedMiddleware=[];var St=bt||{};if(typeof St!="object")throw new Error(""+Z.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(St.defaultScope===void 0)St.defaultScope=pe.BindingScopeEnum.Transient;else if(St.defaultScope!==pe.BindingScopeEnum.Singleton&&St.defaultScope!==pe.BindingScopeEnum.Transient&&St.defaultScope!==pe.BindingScopeEnum.Request)throw new Error(""+Z.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(St.autoBindInjectable===void 0)St.autoBindInjectable=!1;else if(typeof St.autoBindInjectable!="boolean")throw new Error(""+Z.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(St.skipBaseClassChecks===void 0)St.skipBaseClassChecks=!1;else if(typeof St.skipBaseClassChecks!="boolean")throw new Error(""+Z.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:St.autoBindInjectable,defaultScope:St.defaultScope,skipBaseClassChecks:St.skipBaseClassChecks},this.id=tt.id(),this._bindingDictionary=new Yt.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new it.MetadataReader}return Zt.merge=function(bt,St){for(var Rr=[],gr=2;gr<arguments.length;gr++)Rr[gr-2]=arguments[gr];var fr=new Zt,Mt=y([bt,St],Rr).map(function(qe){return ce.getBindingDictionary(qe)}),ft=ce.getBindingDictionary(fr);function kt(qe,Dt){qe.traverse(function(dr,oe){oe.forEach(function(H){Dt.add(H.serviceIdentifier,H.clone())})})}return Mt.forEach(function(qe){kt(qe,ft)}),fr},Zt.prototype.load=function(){for(var bt=[],St=0;St<arguments.length;St++)bt[St]=arguments[St];for(var Rr=this._getContainerModuleHelpersFactory(),gr=0,fr=bt;gr<fr.length;gr++){var Mt=fr[gr],ft=Rr(Mt.id);Mt.registry(ft.bindFunction,ft.unbindFunction,ft.isboundFunction,ft.rebindFunction)}},Zt.prototype.loadAsync=function(){for(var bt=[],St=0;St<arguments.length;St++)bt[St]=arguments[St];return te(this,void 0,void 0,function(){var Rr,gr,fr,Mt,ft;return ye(this,function(kt){switch(kt.label){case 0:Rr=this._getContainerModuleHelpersFactory(),gr=0,fr=bt,kt.label=1;case 1:return gr<fr.length?(Mt=fr[gr],ft=Rr(Mt.id),[4,Mt.registry(ft.bindFunction,ft.unbindFunction,ft.isboundFunction,ft.rebindFunction)]):[3,4];case 2:kt.sent(),kt.label=3;case 3:return gr++,[3,1];case 4:return[2]}})})},Zt.prototype.unload=function(){for(var bt=this,St=[],Rr=0;Rr<arguments.length;Rr++)St[Rr]=arguments[Rr];var gr=function(fr){return function(Mt){return Mt.moduleId===fr}};St.forEach(function(fr){var Mt=gr(fr.id);bt._bindingDictionary.removeByCondition(Mt)})},Zt.prototype.bind=function(bt){var St=this.options.defaultScope||pe.BindingScopeEnum.Transient,Rr=new he.Binding(bt,St);return this._bindingDictionary.add(bt,Rr),new vt.BindingToSyntax(Rr)},Zt.prototype.rebind=function(bt){return this.unbind(bt),this.bind(bt)},Zt.prototype.unbind=function(bt){try{this._bindingDictionary.remove(bt)}catch(St){throw new Error(Z.CANNOT_UNBIND+" "+Ot.getServiceIdentifierAsString(bt))}},Zt.prototype.unbindAll=function(){this._bindingDictionary=new Yt.Lookup},Zt.prototype.isBound=function(bt){var St=this._bindingDictionary.hasKey(bt);return!St&&this.parent&&(St=this.parent.isBound(bt)),St},Zt.prototype.isBoundNamed=function(bt,St){return this.isBoundTagged(bt,fe.NAMED_TAG,St)},Zt.prototype.isBoundTagged=function(bt,St,Rr){var gr=!1;if(this._bindingDictionary.hasKey(bt)){var fr=this._bindingDictionary.get(bt),Mt=ce.createMockRequest(this,bt,St,Rr);gr=fr.some(function(ft){return ft.constraint(Mt)})}return!gr&&this.parent&&(gr=this.parent.isBoundTagged(bt,St,Rr)),gr},Zt.prototype.snapshot=function(){this._snapshots.push(Xt.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},Zt.prototype.restore=function(){var bt=this._snapshots.pop();if(bt===void 0)throw new Error(Z.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=bt.bindings,this._middleware=bt.middleware},Zt.prototype.createChild=function(bt){var St=new Zt(bt||this.options);return St.parent=this,St},Zt.prototype.applyMiddleware=function(){for(var bt=[],St=0;St<arguments.length;St++)bt[St]=arguments[St];this._appliedMiddleware=this._appliedMiddleware.concat(bt);var Rr=this._middleware?this._middleware:this._planAndResolve();this._middleware=bt.reduce(function(gr,fr){return fr(gr)},Rr)},Zt.prototype.applyCustomMetadataReader=function(bt){this._metadataReader=bt},Zt.prototype.get=function(bt){return this._get(!1,!1,pe.TargetTypeEnum.Variable,bt)},Zt.prototype.getTagged=function(bt,St,Rr){return this._get(!1,!1,pe.TargetTypeEnum.Variable,bt,St,Rr)},Zt.prototype.getNamed=function(bt,St){return this.getTagged(bt,fe.NAMED_TAG,St)},Zt.prototype.getAll=function(bt){return this._get(!0,!0,pe.TargetTypeEnum.Variable,bt)},Zt.prototype.getAllTagged=function(bt,St,Rr){return this._get(!1,!0,pe.TargetTypeEnum.Variable,bt,St,Rr)},Zt.prototype.getAllNamed=function(bt,St){return this.getAllTagged(bt,fe.NAMED_TAG,St)},Zt.prototype.resolve=function(bt){var St=this.createChild();return St.bind(bt).toSelf(),this._appliedMiddleware.forEach(function(Rr){St.applyMiddleware(Rr)}),St.get(bt)},Zt.prototype._getContainerModuleHelpersFactory=function(){var bt=this,St=function(ft,kt){ft._binding.moduleId=kt},Rr=function(ft){return function(kt){var qe=bt.bind.bind(bt),Dt=qe(kt);return St(Dt,ft),Dt}},gr=function(ft){return function(kt){var qe=bt.unbind.bind(bt);qe(kt)}},fr=function(ft){return function(kt){var qe=bt.isBound.bind(bt);return qe(kt)}},Mt=function(ft){return function(kt){var qe=bt.rebind.bind(bt),Dt=qe(kt);return St(Dt,ft),Dt}};return function(ft){return{bindFunction:Rr(ft),isboundFunction:fr(ft),rebindFunction:Mt(ft),unbindFunction:gr(ft)}}},Zt.prototype._get=function(bt,St,Rr,gr,fr,Mt){var ft=null,kt={avoidConstraints:bt,contextInterceptor:function(qe){return qe},isMultiInject:St,key:fr,serviceIdentifier:gr,targetType:Rr,value:Mt};if(this._middleware){if(ft=this._middleware(kt),ft==null)throw new Error(Z.INVALID_MIDDLEWARE_RETURN)}else ft=this._planAndResolve()(kt);return ft},Zt.prototype._planAndResolve=function(){var bt=this;return function(St){var Rr=ce.plan(bt._metadataReader,bt,St.isMultiInject,St.targetType,St.serviceIdentifier,St.key,St.value,St.avoidConstraints);Rr=St.contextInterceptor(Rr);var gr=rt.resolve(Rr);return gr}},Zt}();ne.Container=ar},66440:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.AsyncContainerModule=ne.ContainerModule=void 0;var te=U(92452),ye=function(){function he(Z){this.id=te.id(),this.registry=Z}return he}();ne.ContainerModule=ye;var y=function(){function he(Z){this.id=te.id(),this.registry=Z}return he}();ne.AsyncContainerModule=y},527:function(sr,ne){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.ContainerSnapshot=void 0;var U=function(){function te(){}return te.of=function(ye,y){var he=new te;return he.bindings=ye,he.middleware=y,he},te}();ne.ContainerSnapshot=U},7026:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.Lookup=void 0;var te=U(81463),ye=function(){function y(){this._map=new Map}return y.prototype.getMap=function(){return this._map},y.prototype.add=function(he,Z){if(he==null)throw new Error(te.NULL_ARGUMENT);if(Z==null)throw new Error(te.NULL_ARGUMENT);var pe=this._map.get(he);pe!==void 0?(pe.push(Z),this._map.set(he,pe)):this._map.set(he,[Z])},y.prototype.get=function(he){if(he==null)throw new Error(te.NULL_ARGUMENT);var Z=this._map.get(he);if(Z!==void 0)return Z;throw new Error(te.KEY_NOT_FOUND)},y.prototype.remove=function(he){if(he==null)throw new Error(te.NULL_ARGUMENT);if(!this._map.delete(he))throw new Error(te.KEY_NOT_FOUND)},y.prototype.removeByCondition=function(he){var Z=this;this._map.forEach(function(pe,fe){var it=pe.filter(function(ce){return!he(ce)});it.length>0?Z._map.set(fe,it):Z._map.delete(fe)})},y.prototype.hasKey=function(he){if(he==null)throw new Error(te.NULL_ARGUMENT);return this._map.has(he)},y.prototype.clone=function(){var he=new y;return this._map.forEach(function(Z,pe){Z.forEach(function(fe){return he.add(pe,fe.clone())})}),he},y.prototype.traverse=function(he){this._map.forEach(function(Z,pe){he(pe,Z)})},y}();ne.Lookup=ye},14156:function(sr,ne,U){"use strict";var te;te={value:!0},te=te=te=te=te=te=ne.GW=te=te=ne.zY=te=te=te=te=te=ne.f3=te=te=ne.b2=te=te=te=te=te=ne.W2=te=void 0;var ye=U(17597);te=ye;var y=U(27877);Object.defineProperty(ne,"W2",{enumerable:!0,get:function(){return y.Container}});var he=U(71297);te={enumerable:!0,get:function(){return he.BindingScopeEnum}},te={enumerable:!0,get:function(){return he.BindingTypeEnum}},te={enumerable:!0,get:function(){return he.TargetTypeEnum}};var Z=U(66440);te={enumerable:!0,get:function(){return Z.AsyncContainerModule}},te={enumerable:!0,get:function(){return Z.ContainerModule}};var pe=U(66733);Object.defineProperty(ne,"b2",{enumerable:!0,get:function(){return pe.injectable}});var fe=U(76316);te={enumerable:!0,get:function(){return fe.tagged}};var it=U(23769);te={enumerable:!0,get:function(){return it.named}};var ce=U(71791);Object.defineProperty(ne,"f3",{enumerable:!0,get:function(){return ce.inject}}),te={enumerable:!0,get:function(){return ce.LazyServiceIdentifer}};var rt=U(57758);te={enumerable:!0,get:function(){return rt.optional}};var vt=U(39868);te={enumerable:!0,get:function(){return vt.unmanaged}};var tt=U(33406);te={enumerable:!0,get:function(){return tt.multiInject}};var Ot=U(26805);te={enumerable:!0,get:function(){return Ot.targetName}};var Xt=U(82935);Object.defineProperty(ne,"zY",{enumerable:!0,get:function(){return Xt.postConstruct}});var Yt=U(51288);te={enumerable:!0,get:function(){return Yt.MetadataReader}};var ar=U(92452);te={enumerable:!0,get:function(){return ar.id}};var Zt=U(38362);Object.defineProperty(ne,"GW",{enumerable:!0,get:function(){return Zt.decorate}});var bt=U(95093);te={enumerable:!0,get:function(){return bt.traverseAncerstors}},te={enumerable:!0,get:function(){return bt.taggedConstraint}},te={enumerable:!0,get:function(){return bt.namedConstraint}},te={enumerable:!0,get:function(){return bt.typeConstraint}};var St=U(96783);te={enumerable:!0,get:function(){return St.getServiceIdentifierAsString}};var Rr=U(6024);te={enumerable:!0,get:function(){return Rr.multiBindToService}}},68338:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.Context=void 0;var te=U(92452),ye=function(){function y(he){this.id=te.id(),this.container=he}return y.prototype.addPlan=function(he){this.plan=he},y.prototype.setCurrentRequest=function(he){this.currentRequest=he},y}();ne.Context=ye},4957:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.Metadata=void 0;var te=U(17597),ye=function(){function y(he,Z){this.key=he,this.value=Z}return y.prototype.toString=function(){return this.key===te.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},y}();ne.Metadata=ye},51288:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.MetadataReader=void 0;var te=U(17597),ye=function(){function y(){}return y.prototype.getConstructorMetadata=function(he){var Z=Reflect.getMetadata(te.PARAM_TYPES,he),pe=Reflect.getMetadata(te.TAGGED,he);return{compilerGeneratedMetadata:Z,userGeneratedMetadata:pe||{}}},y.prototype.getPropertiesMetadata=function(he){var Z=Reflect.getMetadata(te.TAGGED_PROP,he)||[];return Z},y}();ne.MetadataReader=ye},30515:function(sr,ne){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.Plan=void 0;var U=function(){function te(ye,y){this.parentContext=ye,this.rootRequest=y}return te}();ne.Plan=U},14346:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.getBindingDictionary=ne.createMockRequest=ne.plan=void 0;var te=U(53837),ye=U(81463),y=U(71297),he=U(17597),Z=U(99438),pe=U(96783),fe=U(68338),it=U(4957),ce=U(30515),rt=U(4793),vt=U(39373),tt=U(90700);function Ot(gr){return gr._bindingDictionary}ne.getBindingDictionary=Ot;function Xt(gr,fr,Mt,ft,kt,qe){var Dt=gr?he.MULTI_INJECT_TAG:he.INJECT_TAG,dr=new it.Metadata(Dt,Mt),oe=new tt.Target(fr,ft,Mt,dr);if(kt!==void 0){var H=new it.Metadata(kt,qe);oe.metadata.push(H)}return oe}function Yt(gr,fr,Mt,ft,kt){var qe=bt(Mt.container,kt.serviceIdentifier),Dt=[];return qe.length===te.BindingCount.NoBindingsAvailable&&Mt.container.options.autoBindInjectable&&typeof kt.serviceIdentifier=="function"&&gr.getConstructorMetadata(kt.serviceIdentifier).compilerGeneratedMetadata&&(Mt.container.bind(kt.serviceIdentifier).toSelf(),qe=bt(Mt.container,kt.serviceIdentifier)),fr?Dt=qe:Dt=qe.filter(function(dr){var oe=new vt.Request(dr.serviceIdentifier,Mt,ft,dr,kt);return dr.constraint(oe)}),ar(kt.serviceIdentifier,Dt,kt,Mt.container),Dt}function ar(gr,fr,Mt,ft){switch(fr.length){case te.BindingCount.NoBindingsAvailable:if(Mt.isOptional())return fr;var kt=pe.getServiceIdentifierAsString(gr),qe=ye.NOT_REGISTERED;throw qe+=pe.listMetadataForTarget(kt,Mt),qe+=pe.listRegisteredBindingsForServiceIdentifier(ft,kt,bt),new Error(qe);case te.BindingCount.OnlyOneBindingAvailable:if(!Mt.isArray())return fr;case te.BindingCount.MultipleBindingsAvailable:default:if(Mt.isArray())return fr;var kt=pe.getServiceIdentifierAsString(gr),qe=ye.AMBIGUOUS_MATCH+" "+kt;throw qe+=pe.listRegisteredBindingsForServiceIdentifier(ft,kt,bt),new Error(qe)}}function Zt(gr,fr,Mt,ft,kt,qe){var Dt,dr;if(kt===null){Dt=Yt(gr,fr,ft,null,qe),dr=new vt.Request(Mt,ft,null,Dt,qe);var oe=new ce.Plan(ft,dr);ft.addPlan(oe)}else Dt=Yt(gr,fr,ft,kt,qe),dr=kt.addChildRequest(qe.serviceIdentifier,Dt,qe);Dt.forEach(function(H){var re=null;if(qe.isArray())re=dr.addChildRequest(H.serviceIdentifier,H,qe);else{if(H.cache)return;re=dr}if(H.type===y.BindingTypeEnum.Instance&&H.implementationType!==null){var Be=rt.getDependencies(gr,H.implementationType);if(!ft.container.options.skipBaseClassChecks){var we=rt.getBaseClassDependencyCount(gr,H.implementationType);if(Be.length<we){var ut=ye.ARGUMENTS_LENGTH_MISMATCH(rt.getFunctionName(H.implementationType));throw new Error(ut)}}Be.forEach(function(ie){Zt(gr,!1,ie.serviceIdentifier,ft,re,ie)})}})}function bt(gr,fr){var Mt=[],ft=Ot(gr);return ft.hasKey(fr)?Mt=ft.get(fr):gr.parent!==null&&(Mt=bt(gr.parent,fr)),Mt}function St(gr,fr,Mt,ft,kt,qe,Dt,dr){dr===void 0&&(dr=!1);var oe=new fe.Context(fr),H=Xt(Mt,ft,kt,"",qe,Dt);try{return Zt(gr,dr,kt,oe,null,H),oe}catch(re){throw Z.isStackOverflowExeption(re)&&oe.plan&&pe.circularDependencyToException(oe.plan.rootRequest),re}}ne.plan=St;function Rr(gr,fr,Mt,ft){var kt=new tt.Target(y.TargetTypeEnum.Variable,"",fr,new it.Metadata(Mt,ft)),qe=new fe.Context(gr),Dt=new vt.Request(fr,qe,null,[],kt);return Dt}ne.createMockRequest=Rr},41141:function(sr,ne){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.QueryableString=void 0;var U=function(){function te(ye){this.str=ye}return te.prototype.startsWith=function(ye){return this.str.indexOf(ye)===0},te.prototype.endsWith=function(ye){var y="",he=ye.split("").reverse().join("");return y=this.str.split("").reverse().join(""),this.startsWith.call({str:y},he)},te.prototype.contains=function(ye){return this.str.indexOf(ye)!==-1},te.prototype.equals=function(ye){return this.str===ye},te.prototype.value=function(){return this.str},te}();ne.QueryableString=U},4793:function(sr,ne,U){"use strict";var te=this&&this.__spreadArray||function(Yt,ar){for(var Zt=0,bt=ar.length,St=Yt.length;Zt<bt;Zt++,St++)Yt[St]=ar[Zt];return Yt};Object.defineProperty(ne,"__esModule",{value:!0}),ne.getFunctionName=ne.getBaseClassDependencyCount=ne.getDependencies=void 0;var ye=U(71791),y=U(81463),he=U(71297),Z=U(17597),pe=U(96783);Object.defineProperty(ne,"getFunctionName",{enumerable:!0,get:function(){return pe.getFunctionName}});var fe=U(90700);function it(Yt,ar){var Zt=pe.getFunctionName(ar),bt=ce(Yt,Zt,ar,!1);return bt}ne.getDependencies=it;function ce(Yt,ar,Zt,bt){var St=Yt.getConstructorMetadata(Zt),Rr=St.compilerGeneratedMetadata;if(Rr===void 0){var gr=y.MISSING_INJECTABLE_ANNOTATION+" "+ar+".";throw new Error(gr)}var fr=St.userGeneratedMetadata,Mt=Object.keys(fr),ft=Zt.length===0&&Mt.length>0,kt=Mt.length>Zt.length,qe=ft||kt?Mt.length:Zt.length,Dt=vt(bt,ar,Rr,fr,qe),dr=tt(Yt,Zt),oe=te(te([],Dt),dr);return oe}function rt(Yt,ar,Zt,bt,St){var Rr=St[Yt.toString()]||[],gr=Xt(Rr),fr=gr.unmanaged!==!0,Mt=bt[Yt],ft=gr.inject||gr.multiInject;if(Mt=ft||Mt,Mt instanceof ye.LazyServiceIdentifer&&(Mt=Mt.unwrap()),fr){var kt=Mt===Object,qe=Mt===Function,Dt=Mt===void 0,dr=kt||qe||Dt;if(!ar&&dr){var oe=y.MISSING_INJECT_ANNOTATION+" argument "+Yt+" in class "+Zt+".";throw new Error(oe)}var H=new fe.Target(he.TargetTypeEnum.ConstructorArgument,gr.targetName,Mt);return H.metadata=Rr,H}return null}function vt(Yt,ar,Zt,bt,St){for(var Rr=[],gr=0;gr<St;gr++){var fr=gr,Mt=rt(fr,Yt,ar,Zt,bt);Mt!==null&&Rr.push(Mt)}return Rr}function tt(Yt,ar){for(var Zt=Yt.getPropertiesMetadata(ar),bt=[],St=Object.keys(Zt),Rr=0,gr=St;Rr<gr.length;Rr++){var fr=gr[Rr],Mt=Zt[fr],ft=Xt(Zt[fr]),kt=ft.targetName||fr,qe=ft.inject||ft.multiInject,Dt=new fe.Target(he.TargetTypeEnum.ClassProperty,kt,qe);Dt.metadata=Mt,bt.push(Dt)}var dr=Object.getPrototypeOf(ar.prototype).constructor;if(dr!==Object){var oe=tt(Yt,dr);bt=te(te([],bt),oe)}return bt}function Ot(Yt,ar){var Zt=Object.getPrototypeOf(ar.prototype).constructor;if(Zt!==Object){var bt=pe.getFunctionName(Zt),St=ce(Yt,bt,Zt,!0),Rr=St.map(function(Mt){return Mt.metadata.filter(function(ft){return ft.key===Z.UNMANAGED_TAG})}),gr=[].concat.apply([],Rr).length,fr=St.length-gr;return fr>0?fr:Ot(Yt,Zt)}else return 0}ne.getBaseClassDependencyCount=Ot;function Xt(Yt){var ar={};return Yt.forEach(function(Zt){ar[Zt.key.toString()]=Zt.value}),{inject:ar[Z.INJECT_TAG],multiInject:ar[Z.MULTI_INJECT_TAG],targetName:ar[Z.NAME_TAG],unmanaged:ar[Z.UNMANAGED_TAG]}}},39373:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.Request=void 0;var te=U(92452),ye=function(){function y(he,Z,pe,fe,it){this.id=te.id(),this.serviceIdentifier=he,this.parentContext=Z,this.parentRequest=pe,this.target=it,this.childRequests=[],this.bindings=Array.isArray(fe)?fe:[fe],this.requestScope=pe===null?new Map:null}return y.prototype.addChildRequest=function(he,Z,pe){var fe=new y(he,this.parentContext,this,Z,pe);return this.childRequests.push(fe),fe},y}();ne.Request=ye},90700:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.Target=void 0;var te=U(17597),ye=U(92452),y=U(4957),he=U(41141),Z=function(){function pe(fe,it,ce,rt){this.id=ye.id(),this.type=fe,this.serviceIdentifier=ce,this.name=new he.QueryableString(it||""),this.metadata=new Array;var vt=null;typeof rt=="string"?vt=new y.Metadata(te.NAMED_TAG,rt):rt instanceof y.Metadata&&(vt=rt),vt!==null&&this.metadata.push(vt)}return pe.prototype.hasTag=function(fe){for(var it=0,ce=this.metadata;it<ce.length;it++){var rt=ce[it];if(rt.key===fe)return!0}return!1},pe.prototype.isArray=function(){return this.hasTag(te.MULTI_INJECT_TAG)},pe.prototype.matchesArray=function(fe){return this.matchesTag(te.MULTI_INJECT_TAG)(fe)},pe.prototype.isNamed=function(){return this.hasTag(te.NAMED_TAG)},pe.prototype.isTagged=function(){return this.metadata.some(function(fe){return te.NON_CUSTOM_TAG_KEYS.every(function(it){return fe.key!==it})})},pe.prototype.isOptional=function(){return this.matchesTag(te.OPTIONAL_TAG)(!0)},pe.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(fe){return fe.key===te.NAMED_TAG})[0]:null},pe.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(fe){return te.NON_CUSTOM_TAG_KEYS.every(function(it){return fe.key!==it})}):null},pe.prototype.matchesNamedTag=function(fe){return this.matchesTag(te.NAMED_TAG)(fe)},pe.prototype.matchesTag=function(fe){var it=this;return function(ce){for(var rt=0,vt=it.metadata;rt<vt.length;rt++){var tt=vt[rt];if(tt.key===fe&&tt.value===ce)return!0}return!1}},pe}();ne.Target=Z},31831:function(sr,ne,U){"use strict";var te=this&&this.__spreadArray||function(ce,rt){for(var vt=0,tt=rt.length,Ot=ce.length;vt<tt;vt++,Ot++)ce[Ot]=rt[vt];return ce};Object.defineProperty(ne,"__esModule",{value:!0}),ne.resolveInstance=void 0;var ye=U(81463),y=U(71297),he=U(17597);function Z(ce,rt,vt){var tt=rt.filter(function(Xt){return Xt.target!==null&&Xt.target.type===y.TargetTypeEnum.ClassProperty}),Ot=tt.map(vt);return tt.forEach(function(Xt,Yt){var ar="";ar=Xt.target.name.value();var Zt=Ot[Yt];ce[ar]=Zt}),ce}function pe(ce,rt){return new(ce.bind.apply(ce,te([void 0],rt)))}function fe(ce,rt){if(Reflect.hasMetadata(he.POST_CONSTRUCT,ce)){var vt=Reflect.getMetadata(he.POST_CONSTRUCT,ce);try{rt[vt.value]()}catch(tt){throw new Error(ye.POST_CONSTRUCT_ERROR(ce.name,tt.message))}}}function it(ce,rt,vt){var tt=null;if(rt.length>0){var Ot=rt.filter(function(Yt){return Yt.target!==null&&Yt.target.type===y.TargetTypeEnum.ConstructorArgument}),Xt=Ot.map(vt);tt=pe(ce,Xt),tt=Z(tt,rt,vt)}else tt=new ce;return fe(ce,tt),tt}ne.resolveInstance=it},50857:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.resolve=void 0;var te=U(81463),ye=U(71297),y=U(99438),he=U(96783),Z=U(31831),pe=function(ce,rt,vt){try{return vt()}catch(tt){throw y.isStackOverflowExeption(tt)?new Error(te.CIRCULAR_DEPENDENCY_IN_FACTORY(ce,rt.toString())):tt}},fe=function(ce){return function(rt){rt.parentContext.setCurrentRequest(rt);var vt=rt.bindings,tt=rt.childRequests,Ot=rt.target&&rt.target.isArray(),Xt=!rt.parentRequest||!rt.parentRequest.target||!rt.target||!rt.parentRequest.target.matchesArray(rt.target.serviceIdentifier);if(Ot&&Xt)return tt.map(function(Rr){var gr=fe(ce);return gr(Rr)});var Yt=null;if(rt.target.isOptional()&&vt.length===0)return;var ar=vt[0],Zt=ar.scope===ye.BindingScopeEnum.Singleton,bt=ar.scope===ye.BindingScopeEnum.Request;if(Zt&&ar.activated)return ar.cache;if(bt&&ce!==null&&ce.has(ar.id))return ce.get(ar.id);if(ar.type===ye.BindingTypeEnum.ConstantValue)Yt=ar.cache,ar.activated=!0;else if(ar.type===ye.BindingTypeEnum.Function)Yt=ar.cache,ar.activated=!0;else if(ar.type===ye.BindingTypeEnum.Constructor)Yt=ar.implementationType;else if(ar.type===ye.BindingTypeEnum.DynamicValue&&ar.dynamicValue!==null)Yt=pe("toDynamicValue",ar.serviceIdentifier,function(){return ar.dynamicValue(rt.parentContext)});else if(ar.type===ye.BindingTypeEnum.Factory&&ar.factory!==null)Yt=pe("toFactory",ar.serviceIdentifier,function(){return ar.factory(rt.parentContext)});else if(ar.type===ye.BindingTypeEnum.Provider&&ar.provider!==null)Yt=pe("toProvider",ar.serviceIdentifier,function(){return ar.provider(rt.parentContext)});else if(ar.type===ye.BindingTypeEnum.Instance&&ar.implementationType!==null)Yt=Z.resolveInstance(ar.implementationType,tt,fe(ce));else{var St=he.getServiceIdentifierAsString(rt.serviceIdentifier);throw new Error(te.INVALID_BINDING_TYPE+" "+St)}return typeof ar.onActivation=="function"&&(Yt=ar.onActivation(rt.parentContext,Yt)),Zt&&(ar.cache=Yt,ar.activated=!0),bt&&ce!==null&&!ce.has(ar.id)&&ce.set(ar.id,Yt),Yt}};function it(ce){var rt=fe(ce.plan.rootRequest.requestScope);return rt(ce.plan.rootRequest)}ne.resolve=it},29664:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.BindingInSyntax=void 0;var te=U(71297),ye=U(62923),y=function(){function he(Z){this._binding=Z}return he.prototype.inRequestScope=function(){return this._binding.scope=te.BindingScopeEnum.Request,new ye.BindingWhenOnSyntax(this._binding)},he.prototype.inSingletonScope=function(){return this._binding.scope=te.BindingScopeEnum.Singleton,new ye.BindingWhenOnSyntax(this._binding)},he.prototype.inTransientScope=function(){return this._binding.scope=te.BindingScopeEnum.Transient,new ye.BindingWhenOnSyntax(this._binding)},he}();ne.BindingInSyntax=y},35268:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.BindingInWhenOnSyntax=void 0;var te=U(29664),ye=U(85370),y=U(76199),he=function(){function Z(pe){this._binding=pe,this._bindingWhenSyntax=new y.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new ye.BindingOnSyntax(this._binding),this._bindingInSyntax=new te.BindingInSyntax(pe)}return Z.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},Z.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},Z.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},Z.prototype.when=function(pe){return this._bindingWhenSyntax.when(pe)},Z.prototype.whenTargetNamed=function(pe){return this._bindingWhenSyntax.whenTargetNamed(pe)},Z.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},Z.prototype.whenTargetTagged=function(pe,fe){return this._bindingWhenSyntax.whenTargetTagged(pe,fe)},Z.prototype.whenInjectedInto=function(pe){return this._bindingWhenSyntax.whenInjectedInto(pe)},Z.prototype.whenParentNamed=function(pe){return this._bindingWhenSyntax.whenParentNamed(pe)},Z.prototype.whenParentTagged=function(pe,fe){return this._bindingWhenSyntax.whenParentTagged(pe,fe)},Z.prototype.whenAnyAncestorIs=function(pe){return this._bindingWhenSyntax.whenAnyAncestorIs(pe)},Z.prototype.whenNoAncestorIs=function(pe){return this._bindingWhenSyntax.whenNoAncestorIs(pe)},Z.prototype.whenAnyAncestorNamed=function(pe){return this._bindingWhenSyntax.whenAnyAncestorNamed(pe)},Z.prototype.whenAnyAncestorTagged=function(pe,fe){return this._bindingWhenSyntax.whenAnyAncestorTagged(pe,fe)},Z.prototype.whenNoAncestorNamed=function(pe){return this._bindingWhenSyntax.whenNoAncestorNamed(pe)},Z.prototype.whenNoAncestorTagged=function(pe,fe){return this._bindingWhenSyntax.whenNoAncestorTagged(pe,fe)},Z.prototype.whenAnyAncestorMatches=function(pe){return this._bindingWhenSyntax.whenAnyAncestorMatches(pe)},Z.prototype.whenNoAncestorMatches=function(pe){return this._bindingWhenSyntax.whenNoAncestorMatches(pe)},Z.prototype.onActivation=function(pe){return this._bindingOnSyntax.onActivation(pe)},Z}();ne.BindingInWhenOnSyntax=he},85370:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.BindingOnSyntax=void 0;var te=U(76199),ye=function(){function y(he){this._binding=he}return y.prototype.onActivation=function(he){return this._binding.onActivation=he,new te.BindingWhenSyntax(this._binding)},y}();ne.BindingOnSyntax=ye},98e3:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.BindingToSyntax=void 0;var te=U(81463),ye=U(71297),y=U(35268),he=U(62923),Z=function(){function pe(fe){this._binding=fe}return pe.prototype.to=function(fe){return this._binding.type=ye.BindingTypeEnum.Instance,this._binding.implementationType=fe,new y.BindingInWhenOnSyntax(this._binding)},pe.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+te.INVALID_TO_SELF_VALUE);var fe=this._binding.serviceIdentifier;return this.to(fe)},pe.prototype.toConstantValue=function(fe){return this._binding.type=ye.BindingTypeEnum.ConstantValue,this._binding.cache=fe,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=ye.BindingScopeEnum.Singleton,new he.BindingWhenOnSyntax(this._binding)},pe.prototype.toDynamicValue=function(fe){return this._binding.type=ye.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=fe,this._binding.implementationType=null,new y.BindingInWhenOnSyntax(this._binding)},pe.prototype.toConstructor=function(fe){return this._binding.type=ye.BindingTypeEnum.Constructor,this._binding.implementationType=fe,this._binding.scope=ye.BindingScopeEnum.Singleton,new he.BindingWhenOnSyntax(this._binding)},pe.prototype.toFactory=function(fe){return this._binding.type=ye.BindingTypeEnum.Factory,this._binding.factory=fe,this._binding.scope=ye.BindingScopeEnum.Singleton,new he.BindingWhenOnSyntax(this._binding)},pe.prototype.toFunction=function(fe){if(typeof fe!="function")throw new Error(te.INVALID_FUNCTION_BINDING);var it=this.toConstantValue(fe);return this._binding.type=ye.BindingTypeEnum.Function,this._binding.scope=ye.BindingScopeEnum.Singleton,it},pe.prototype.toAutoFactory=function(fe){return this._binding.type=ye.BindingTypeEnum.Factory,this._binding.factory=function(it){var ce=function(){return it.container.get(fe)};return ce},this._binding.scope=ye.BindingScopeEnum.Singleton,new he.BindingWhenOnSyntax(this._binding)},pe.prototype.toProvider=function(fe){return this._binding.type=ye.BindingTypeEnum.Provider,this._binding.provider=fe,this._binding.scope=ye.BindingScopeEnum.Singleton,new he.BindingWhenOnSyntax(this._binding)},pe.prototype.toService=function(fe){this.toDynamicValue(function(it){return it.container.get(fe)})},pe}();ne.BindingToSyntax=Z},62923:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.BindingWhenOnSyntax=void 0;var te=U(85370),ye=U(76199),y=function(){function he(Z){this._binding=Z,this._bindingWhenSyntax=new ye.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new te.BindingOnSyntax(this._binding)}return he.prototype.when=function(Z){return this._bindingWhenSyntax.when(Z)},he.prototype.whenTargetNamed=function(Z){return this._bindingWhenSyntax.whenTargetNamed(Z)},he.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},he.prototype.whenTargetTagged=function(Z,pe){return this._bindingWhenSyntax.whenTargetTagged(Z,pe)},he.prototype.whenInjectedInto=function(Z){return this._bindingWhenSyntax.whenInjectedInto(Z)},he.prototype.whenParentNamed=function(Z){return this._bindingWhenSyntax.whenParentNamed(Z)},he.prototype.whenParentTagged=function(Z,pe){return this._bindingWhenSyntax.whenParentTagged(Z,pe)},he.prototype.whenAnyAncestorIs=function(Z){return this._bindingWhenSyntax.whenAnyAncestorIs(Z)},he.prototype.whenNoAncestorIs=function(Z){return this._bindingWhenSyntax.whenNoAncestorIs(Z)},he.prototype.whenAnyAncestorNamed=function(Z){return this._bindingWhenSyntax.whenAnyAncestorNamed(Z)},he.prototype.whenAnyAncestorTagged=function(Z,pe){return this._bindingWhenSyntax.whenAnyAncestorTagged(Z,pe)},he.prototype.whenNoAncestorNamed=function(Z){return this._bindingWhenSyntax.whenNoAncestorNamed(Z)},he.prototype.whenNoAncestorTagged=function(Z,pe){return this._bindingWhenSyntax.whenNoAncestorTagged(Z,pe)},he.prototype.whenAnyAncestorMatches=function(Z){return this._bindingWhenSyntax.whenAnyAncestorMatches(Z)},he.prototype.whenNoAncestorMatches=function(Z){return this._bindingWhenSyntax.whenNoAncestorMatches(Z)},he.prototype.onActivation=function(Z){return this._bindingOnSyntax.onActivation(Z)},he}();ne.BindingWhenOnSyntax=y},76199:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.BindingWhenSyntax=void 0;var te=U(85370),ye=U(95093),y=function(){function he(Z){this._binding=Z}return he.prototype.when=function(Z){return this._binding.constraint=Z,new te.BindingOnSyntax(this._binding)},he.prototype.whenTargetNamed=function(Z){return this._binding.constraint=ye.namedConstraint(Z),new te.BindingOnSyntax(this._binding)},he.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(Z){var pe=Z.target!==null&&!Z.target.isNamed()&&!Z.target.isTagged();return pe},new te.BindingOnSyntax(this._binding)},he.prototype.whenTargetTagged=function(Z,pe){return this._binding.constraint=ye.taggedConstraint(Z)(pe),new te.BindingOnSyntax(this._binding)},he.prototype.whenInjectedInto=function(Z){return this._binding.constraint=function(pe){return ye.typeConstraint(Z)(pe.parentRequest)},new te.BindingOnSyntax(this._binding)},he.prototype.whenParentNamed=function(Z){return this._binding.constraint=function(pe){return ye.namedConstraint(Z)(pe.parentRequest)},new te.BindingOnSyntax(this._binding)},he.prototype.whenParentTagged=function(Z,pe){return this._binding.constraint=function(fe){return ye.taggedConstraint(Z)(pe)(fe.parentRequest)},new te.BindingOnSyntax(this._binding)},he.prototype.whenAnyAncestorIs=function(Z){return this._binding.constraint=function(pe){return ye.traverseAncerstors(pe,ye.typeConstraint(Z))},new te.BindingOnSyntax(this._binding)},he.prototype.whenNoAncestorIs=function(Z){return this._binding.constraint=function(pe){return!ye.traverseAncerstors(pe,ye.typeConstraint(Z))},new te.BindingOnSyntax(this._binding)},he.prototype.whenAnyAncestorNamed=function(Z){return this._binding.constraint=function(pe){return ye.traverseAncerstors(pe,ye.namedConstraint(Z))},new te.BindingOnSyntax(this._binding)},he.prototype.whenNoAncestorNamed=function(Z){return this._binding.constraint=function(pe){return!ye.traverseAncerstors(pe,ye.namedConstraint(Z))},new te.BindingOnSyntax(this._binding)},he.prototype.whenAnyAncestorTagged=function(Z,pe){return this._binding.constraint=function(fe){return ye.traverseAncerstors(fe,ye.taggedConstraint(Z)(pe))},new te.BindingOnSyntax(this._binding)},he.prototype.whenNoAncestorTagged=function(Z,pe){return this._binding.constraint=function(fe){return!ye.traverseAncerstors(fe,ye.taggedConstraint(Z)(pe))},new te.BindingOnSyntax(this._binding)},he.prototype.whenAnyAncestorMatches=function(Z){return this._binding.constraint=function(pe){return ye.traverseAncerstors(pe,Z)},new te.BindingOnSyntax(this._binding)},he.prototype.whenNoAncestorMatches=function(Z){return this._binding.constraint=function(pe){return!ye.traverseAncerstors(pe,Z)},new te.BindingOnSyntax(this._binding)},he}();ne.BindingWhenSyntax=y},95093:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.typeConstraint=ne.namedConstraint=ne.taggedConstraint=ne.traverseAncerstors=void 0;var te=U(17597),ye=U(4957),y=function(fe,it){var ce=fe.parentRequest;return ce!==null?it(ce)?!0:y(ce,it):!1};ne.traverseAncerstors=y;var he=function(fe){return function(it){var ce=function(rt){return rt!==null&&rt.target!==null&&rt.target.matchesTag(fe)(it)};return ce.metaData=new ye.Metadata(fe,it),ce}};ne.taggedConstraint=he;var Z=he(te.NAMED_TAG);ne.namedConstraint=Z;var pe=function(fe){return function(it){var ce=null;if(it!==null)if(ce=it.bindings[0],typeof fe=="string"){var rt=ce.serviceIdentifier;return rt===fe}else{var vt=it.bindings[0].implementationType;return fe===vt}return!1}};ne.typeConstraint=pe},6024:function(sr,ne){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.multiBindToService=void 0;var U=function(te){return function(ye){return function(){for(var y=[],he=0;he<arguments.length;he++)y[he]=arguments[he];return y.forEach(function(Z){return te.bind(Z).toService(ye)})}}};ne.multiBindToService=U},99438:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.isStackOverflowExeption=void 0;var te=U(81463);function ye(y){return y instanceof RangeError||y.message===te.STACK_OVERFLOW}ne.isStackOverflowExeption=ye},92452:function(sr,ne){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.id=void 0;var U=0;function te(){return U++}ne.id=te},96783:function(sr,ne,U){"use strict";Object.defineProperty(ne,"__esModule",{value:!0}),ne.circularDependencyToException=ne.listMetadataForTarget=ne.listRegisteredBindingsForServiceIdentifier=ne.getServiceIdentifierAsString=ne.getFunctionName=void 0;var te=U(81463);function ye(ce){if(typeof ce=="function"){var rt=ce;return rt.name}else{if(typeof ce=="symbol")return ce.toString();var rt=ce;return rt}}ne.getServiceIdentifierAsString=ye;function y(ce,rt,vt){var tt="",Ot=vt(ce,rt);return Ot.length!==0&&(tt=`
|
|
Registered bindings:`,Ot.forEach(function(Xt){var Yt="Object";Xt.implementationType!==null&&(Yt=it(Xt.implementationType)),tt=tt+`
|
|
`+Yt,Xt.constraint.metaData&&(tt=tt+" - "+Xt.constraint.metaData)})),tt}ne.listRegisteredBindingsForServiceIdentifier=y;function he(ce,rt){return ce.parentRequest===null?!1:ce.parentRequest.serviceIdentifier===rt?!0:he(ce.parentRequest,rt)}function Z(ce){function rt(tt,Ot){Ot===void 0&&(Ot=[]);var Xt=ye(tt.serviceIdentifier);return Ot.push(Xt),tt.parentRequest!==null?rt(tt.parentRequest,Ot):Ot}var vt=rt(ce);return vt.reverse().join(" --> ")}function pe(ce){ce.childRequests.forEach(function(rt){if(he(rt,rt.serviceIdentifier)){var vt=Z(rt);throw new Error(te.CIRCULAR_DEPENDENCY+" "+vt)}else pe(rt)})}ne.circularDependencyToException=pe;function fe(ce,rt){if(rt.isTagged()||rt.isNamed()){var vt="",tt=rt.getNamedTag(),Ot=rt.getCustomTags();return tt!==null&&(vt+=tt.toString()+`
|
|
`),Ot!==null&&Ot.forEach(function(Xt){vt+=Xt.toString()+`
|
|
`})," "+ce+`
|
|
`+ce+" - "+vt}else return" "+ce}ne.listMetadataForTarget=fe;function it(ce){if(ce.name)return ce.name;var rt=ce.toString(),vt=rt.match(/^function\s*([^\s(]+)/);return vt?vt[1]:"Anonymous function: "+rt}ne.getFunctionName=it},45170:function(sr,ne,U){var te=U(13807);function ye(y,he){var Z=y==null?0:y.length;return!!Z&&te(y,he,0)>-1}sr.exports=ye},94936:function(sr){function ne(U,te,ye){for(var y=-1,he=U==null?0:U.length;++y<he;)if(ye(te,U[y]))return!0;return!1}sr.exports=ne},54527:function(sr){function ne(U,te,ye){return U===U&&(ye!==void 0&&(U=U<=ye?U:ye),te!==void 0&&(U=U>=te?U:te)),U}sr.exports=ne},92504:function(sr){function ne(U,te,ye,y){for(var he=U.length,Z=ye+(y?1:-1);y?Z--:++Z<he;)if(te(U[Z],Z,U))return Z;return-1}sr.exports=ne},13807:function(sr,ne,U){var te=U(92504),ye=U(99940),y=U(3729);function he(Z,pe,fe){return pe===pe?y(Z,pe,fe):te(Z,ye,fe)}sr.exports=he},70525:function(sr){function ne(U,te,ye,y){for(var he=ye-1,Z=U.length;++he<Z;)if(y(U[he],te))return he;return-1}sr.exports=ne},99940:function(sr){function ne(U){return U!==U}sr.exports=ne},66868:function(sr,ne,U){var te=U(75697),ye=U(13807),y=U(70525),he=U(58792),Z=U(47165),pe=Array.prototype,fe=pe.splice;function it(ce,rt,vt,tt){var Ot=tt?y:ye,Xt=-1,Yt=rt.length,ar=ce;for(ce===rt&&(rt=Z(rt)),vt&&(ar=te(ce,he(vt)));++Xt<Yt;)for(var Zt=0,bt=rt[Xt],St=vt?vt(bt):bt;(Zt=Ot(ar,St,Zt,tt))>-1;)ar!==ce&&fe.call(ar,Zt,1),fe.call(ce,Zt,1);return ce}sr.exports=it},95453:function(sr,ne,U){var te=U(78188),ye=U(45170),y=U(94936),he=U(29880),Z=U(17319),pe=U(79967),fe=200;function it(ce,rt,vt){var tt=-1,Ot=ye,Xt=ce.length,Yt=!0,ar=[],Zt=ar;if(vt)Yt=!1,Ot=y;else if(Xt>=fe){var bt=rt?null:Z(ce);if(bt)return pe(bt);Yt=!1,Ot=he,Zt=new te}else Zt=rt?[]:ar;e:for(;++tt<Xt;){var St=ce[tt],Rr=rt?rt(St):St;if(St=vt||St!==0?St:0,Yt&&Rr===Rr){for(var gr=Zt.length;gr--;)if(Zt[gr]===Rr)continue e;rt&&Zt.push(Rr),ar.push(St)}else Ot(Zt,Rr,vt)||(Zt!==ar&&Zt.push(Rr),ar.push(St))}return ar}sr.exports=it},17319:function(sr,ne,U){var te=U(81956),ye=U(43226),y=U(79967),he=1/0,Z=te&&1/y(new te([,-0]))[1]==he?function(pe){return new te(pe)}:ye;sr.exports=Z},3729:function(sr){function ne(U,te,ye){for(var y=ye-1,he=U.length;++y<he;)if(U[y]===te)return y;return-1}sr.exports=ne},35636:function(sr,ne,U){var te=U(54527),ye=U(12448);function y(he,Z,pe){return pe===void 0&&(pe=Z,Z=void 0),pe!==void 0&&(pe=ye(pe),pe=pe===pe?pe:0),Z!==void 0&&(Z=ye(Z),Z=Z===Z?Z:0),te(ye(he),Z,pe)}sr.exports=y},98071:function(sr,ne,U){var te=U(80732),ye=U(55073),y="[object Boolean]";function he(Z){return Z===!0||Z===!1||ye(Z)&&te(Z)==y}sr.exports=he},31223:function(sr,ne,U){var te=U(6620);function ye(y,he){return te(y,he)}sr.exports=ye},46207:function(sr){function ne(U){return U==null}sr.exports=ne},59933:function(sr,ne,U){var te=U(80732),ye=U(55073),y="[object Number]";function he(Z){return typeof Z=="number"||ye(Z)&&te(Z)==y}sr.exports=he},89300:function(sr){function ne(U){return U===void 0}sr.exports=ne},53954:function(sr,ne,U){var te=U(97254),ye=U(77991),y=ye(function(he,Z,pe,fe){te(he,Z,pe,fe)});sr.exports=y},43226:function(sr){function ne(){}sr.exports=ne},25066:function(sr,ne,U){var te=U(16692),ye=U(20396),y=te(ye);sr.exports=y},20396:function(sr,ne,U){var te=U(66868);function ye(y,he){return y&&y.length&&he&&he.length?te(y,he):y}sr.exports=ye},4363:function(sr,ne,U){var te=U(95453);function ye(y){return y&&y.length?te(y):[]}sr.exports=ye},86463:function(sr){(function(ne,U){sr.exports=U()})(this,function(){"use strict";var ne,U,te;function ye(y,he){if(!ne)ne=he;else if(!U)U=he;else{var Z="var sharedChunk = {}; ("+ne+")(sharedChunk); ("+U+")(sharedChunk);",pe={};ne(pe),te=he(pe),typeof window!="undefined"&&(te.workerUrl=window.URL.createObjectURL(new Blob([Z],{type:"text/javascript"})))}}return ye(["exports"],function(y){"use strict";function he(o,u){return o(u={exports:{}},u.exports),u.exports}var Z=pe;function pe(o,u,c,m){this.cx=3*o,this.bx=3*(c-o)-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=o,this.p1y=m,this.p2x=c,this.p2y=m}pe.prototype.sampleCurveX=function(o){return((this.ax*o+this.bx)*o+this.cx)*o},pe.prototype.sampleCurveY=function(o){return((this.ay*o+this.by)*o+this.cy)*o},pe.prototype.sampleCurveDerivativeX=function(o){return(3*this.ax*o+2*this.bx)*o+this.cx},pe.prototype.solveCurveX=function(o,u){var c,m,x,E,A;for(u===void 0&&(u=1e-6),x=o,A=0;A<8;A++){if(E=this.sampleCurveX(x)-o,Math.abs(E)<u)return x;var R=this.sampleCurveDerivativeX(x);if(Math.abs(R)<1e-6)break;x-=E/R}if((x=o)<(c=0))return c;if(x>(m=1))return m;for(;c<m;){if(E=this.sampleCurveX(x),Math.abs(E-o)<u)return x;o>E?c=x:m=x,x=.5*(m-c)+c}return x},pe.prototype.solve=function(o,u){return this.sampleCurveY(this.solveCurveX(o,u))};var fe=it;function it(o,u){this.x=o,this.y=u}it.prototype={clone:function(){return new it(this.x,this.y)},add:function(o){return this.clone()._add(o)},sub:function(o){return this.clone()._sub(o)},multByPoint:function(o){return this.clone()._multByPoint(o)},divByPoint:function(o){return this.clone()._divByPoint(o)},mult:function(o){return this.clone()._mult(o)},div:function(o){return this.clone()._div(o)},rotate:function(o){return this.clone()._rotate(o)},rotateAround:function(o,u){return this.clone()._rotateAround(o,u)},matMult:function(o){return this.clone()._matMult(o)},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(o){return this.x===o.x&&this.y===o.y},dist:function(o){return Math.sqrt(this.distSqr(o))},distSqr:function(o){var u=o.x-this.x,c=o.y-this.y;return u*u+c*c},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(o){return Math.atan2(this.y-o.y,this.x-o.x)},angleWith:function(o){return this.angleWithSep(o.x,o.y)},angleWithSep:function(o,u){return Math.atan2(this.x*u-this.y*o,this.x*o+this.y*u)},_matMult:function(o){var u=o[2]*this.x+o[3]*this.y;return this.x=o[0]*this.x+o[1]*this.y,this.y=u,this},_add:function(o){return this.x+=o.x,this.y+=o.y,this},_sub:function(o){return this.x-=o.x,this.y-=o.y,this},_mult:function(o){return this.x*=o,this.y*=o,this},_div:function(o){return this.x/=o,this.y/=o,this},_multByPoint:function(o){return this.x*=o.x,this.y*=o.y,this},_divByPoint:function(o){return this.x/=o.x,this.y/=o.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var o=this.y;return this.y=this.x,this.x=-o,this},_rotate:function(o){var u=Math.cos(o),c=Math.sin(o),m=c*this.x+u*this.y;return this.x=u*this.x-c*this.y,this.y=m,this},_rotateAround:function(o,u){var c=Math.cos(o),m=Math.sin(o),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}},it.convert=function(o){return o instanceof it?o:Array.isArray(o)?new it(o[0],o[1]):o};var ce=typeof self!="undefined"?self:{},rt=Math.pow(2,53)-1;function vt(o,u,c,m){var x=new Z(o,u,c,m);return function(E){return x.solve(E)}}var tt=vt(.25,.1,.25,1);function Ot(o,u,c){return Math.min(c,Math.max(u,o))}function Xt(o,u,c){var m=c-u,x=((o-u)%m+m)%m+u;return x===u?c:x}function Yt(o){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)o[A]=E[A]}return o}var ar=1;function Zt(){return ar++}function bt(){return function o(u){return u?(u^16*Math.random()>>u/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,o)}()}function St(o){return!!o&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(o)}function Rr(o,u){o.forEach(function(c){u[c]&&(u[c]=u[c].bind(u))})}function gr(o,u){return o.indexOf(u,o.length-u.length)!==-1}function fr(o,u,c){var m={};for(var x in o)m[x]=u.call(c||this,o[x],x,o);return m}function Mt(o,u,c){var m={};for(var x in o)u.call(c||this,o[x],x,o)&&(m[x]=o[x]);return m}function ft(o){return Array.isArray(o)?o.map(ft):typeof o=="object"&&o?fr(o,ft):o}var kt={};function qe(o){kt[o]||(typeof console!="undefined"&&console.warn(o),kt[o]=!0)}function Dt(o,u,c){return(c.y-o.y)*(u.x-o.x)>(u.y-o.y)*(c.x-o.x)}function dr(o){for(var u=0,c=0,m=o.length,x=m-1,E=void 0,A=void 0;c<m;x=c++)u+=((A=o[x]).x-(E=o[c]).x)*(E.y+A.y);return u}function oe(){return typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope}function H(o){var u={};if(o.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(m,x,E,A){var R=E||A;return u[x]=!R||R.toLowerCase(),""}),u["max-age"]){var c=parseInt(u["max-age"],10);isNaN(c)?delete u["max-age"]:u["max-age"]=c}return u}var re=null;function Be(o){if(re==null){var u=o.navigator?o.navigator.userAgent:null;re=!!o.safari||!(!u||!(/\b(iPad|iPhone|iPod)\b/.test(u)||u.match("Safari")&&!u.match("Chrome")))}return re}function we(o){try{var u=ce[o];return u.setItem("_mapbox_test_",1),u.removeItem("_mapbox_test_"),!0}catch(c){return!1}}var ut,ie,Le,Pe,Ge=ce.performance&&ce.performance.now?ce.performance.now.bind(ce.performance):Date.now.bind(Date),Vt=ce.requestAnimationFrame||ce.mozRequestAnimationFrame||ce.webkitRequestAnimationFrame||ce.msRequestAnimationFrame,Et=ce.cancelAnimationFrame||ce.mozCancelAnimationFrame||ce.webkitCancelAnimationFrame||ce.msCancelAnimationFrame,Jr={now:Ge,frame:function(o){var u=Vt(o);return{cancel:function(){return Et(u)}}},getImageData:function(o,u){u===void 0&&(u=0);var c=ce.document.createElement("canvas"),m=c.getContext("2d");if(!m)throw new Error("failed to create canvas 2d context");return c.width=o.width,c.height=o.height,m.drawImage(o,0,0,o.width,o.height),m.getImageData(-u,-u,o.width+2*u,o.height+2*u)},resolveURL:function(o){return ut||(ut=ce.document.createElement("a")),ut.href=o,ut.href},hardwareConcurrency:ce.navigator&&ce.navigator.hardwareConcurrency||4,get devicePixelRatio(){return ce.devicePixelRatio},get prefersReducedMotion(){return!!ce.matchMedia&&(ie==null&&(ie=ce.matchMedia("(prefers-reduced-motion: reduce)")),ie.matches)}},on={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},Mr={supported:!1,testSupport:function(o){!Dn&&Pe&&(bn?rn(o):Le=o)}},Dn=!1,bn=!1;function rn(o){var u=o.createTexture();o.bindTexture(o.TEXTURE_2D,u);try{if(o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,Pe),o.isContextLost())return;Mr.supported=!0}catch(c){}o.deleteTexture(u),Dn=!0}ce.document&&((Pe=ce.document.createElement("img")).onload=function(){Le&&rn(Le),Le=null,bn=!0},Pe.onerror=function(){Dn=!0,Le=null},Pe.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var yi="01",ti=function(o,u){this._transformRequestFn=o,this._customAccessToken=u,this._createSkuToken()};function Zi(o){return o.indexOf("mapbox:")===0}ti.prototype._createSkuToken=function(){var o=function(){for(var u="",c=0;c<10;c++)u+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",yi,u].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=o.token,this._skuTokenExpiresAt=o.tokenExpiresAt},ti.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ti.prototype.transformRequest=function(o,u){return this._transformRequestFn&&this._transformRequestFn(o,u)||{url:o}},ti.prototype.normalizeStyleURL=function(o,u){if(!Zi(o))return o;var c=ki(o);return c.path="/styles/v1"+c.path,this._makeAPIURL(c,this._customAccessToken||u)},ti.prototype.normalizeGlyphsURL=function(o,u){if(!Zi(o))return o;var c=ki(o);return c.path="/fonts/v1"+c.path,this._makeAPIURL(c,this._customAccessToken||u)},ti.prototype.normalizeSourceURL=function(o,u){if(!Zi(o))return o;var c=ki(o);return c.path="/v4/"+c.authority+".json",c.params.push("secure"),this._makeAPIURL(c,this._customAccessToken||u)},ti.prototype.normalizeSpriteURL=function(o,u,c,m){var x=ki(o);return Zi(o)?(x.path="/styles/v1"+x.path+"/sprite"+u+c,this._makeAPIURL(x,this._customAccessToken||m)):(x.path+=""+u+c,ba(x))},ti.prototype.normalizeTileURL=function(o,u){if(this._isSkuTokenExpired()&&this._createSkuToken(),o&&!Zi(o))return o;var c=ki(o);c.path=c.path.replace(/(\.(png|jpg)\d*)(?=$)/,(Jr.devicePixelRatio>=2||u===512?"@2x":"")+(Mr.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 R=A[E].match(/^access_token=(.*)$/);if(R)return R[1]}return null}(c.params)||on.ACCESS_TOKEN;return on.REQUIRE_ACCESS_TOKEN&&m&&this._skuToken&&c.params.push("sku="+this._skuToken),this._makeAPIURL(c,m)},ti.prototype.canonicalizeTileURL=function(o,u){var c=ki(o);if(!c.path.match(/(^\/v4\/)/)||!c.path.match(/\.[\w]+$/))return o;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},ti.prototype.canonicalizeTileset=function(o,u){for(var c=!!u&&Zi(u),m=[],x=0,E=o.tiles||[];x<E.length;x+=1){var A=E[x];Rn(A)?m.push(this.canonicalizeTileURL(A,c)):m.push(A)}return m},ti.prototype._makeAPIURL=function(o,u){var c="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",m=ki(on.API_URL);if(o.protocol=m.protocol,o.authority=m.authority,o.protocol==="http"){var x=o.params.indexOf("secure");x>=0&&o.params.splice(x,1)}if(m.path!=="/"&&(o.path=""+m.path+o.path),!on.REQUIRE_ACCESS_TOKEN)return ba(o);if(!(u=u||on.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 o.params=o.params.filter(function(E){return E.indexOf("access_token")===-1}),o.params.push("access_token="+u),ba(o)};var En=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Rn(o){return En.test(o)}var sa=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function ki(o){var u=o.match(sa);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 ba(o){var u=o.params.length?"?"+o.params.join("&"):"";return o.protocol+"://"+o.authority+o.path+u}function fo(o){if(!o)return null;var u=o.split(".");if(!u||u.length!==3)return null;try{return JSON.parse(decodeURIComponent(ce.atob(u[1]).split("").map(function(c){return"%"+("00"+c.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch(c){return null}}var Re=function(o){this.type=o,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Re.prototype.getStorageKey=function(o){var u,c=fo(on.ACCESS_TOKEN);return u=c&&c.u?ce.btoa(encodeURIComponent(c.u).replace(/%([0-9A-F]{2})/g,function(m,x){return String.fromCharCode(+("0x"+x))})):on.ACCESS_TOKEN||"",o?"mapbox.eventData."+o+":"+u:"mapbox.eventData:"+u},Re.prototype.fetchEventData=function(){var o=we("localStorage"),u=this.getStorageKey(),c=this.getStorageKey("uuid");if(o)try{var m=ce.localStorage.getItem(u);m&&(this.eventData=JSON.parse(m));var x=ce.localStorage.getItem(c);x&&(this.anonId=x)}catch(E){qe("Unable to read from LocalStorage")}},Re.prototype.saveEventData=function(){var o=we("localStorage"),u=this.getStorageKey(),c=this.getStorageKey("uuid");if(o)try{ce.localStorage.setItem(c,this.anonId),Object.keys(this.eventData).length>=1&&ce.localStorage.setItem(u,JSON.stringify(this.eventData))}catch(m){qe("Unable to write to LocalStorage")}},Re.prototype.processRequests=function(o){},Re.prototype.postEvent=function(o,u,c,m){var x=this;if(on.EVENTS_URL){var E=ki(on.EVENTS_URL);E.params.push("access_token="+(m||on.ACCESS_TOKEN||""));var A={event:this.type,created:new Date(o).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:yi,userId:this.anonId},R=u?Yt(A,u):A,L={url:ba(E),headers:{"Content-Type":"text/plain"},body:JSON.stringify([R])};this.pendingRequest=dt(L,function(V){x.pendingRequest=null,c(V),x.saveEventData(),x.processRequests(m)})}},Re.prototype.queueRequest=function(o,u){this.queue.push(o),this.processRequests(u)};var Ea,va,Za=function(o){function u(){o.call(this,"map.load"),this.success={},this.skuToken=""}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.postMapLoadEvent=function(c,m,x,E){this.skuToken=x;var A=!(!E&&!on.ACCESS_TOKEN),R=Array.isArray(c)&&c.some(function(L){return Zi(L)||Rn(L)});on.EVENTS_URL&&A&&R&&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(),St(this.anonId)||(this.anonId=bt()),this.postEvent(A,{skuToken:this.skuToken},function(R){R||E&&(m.success[E]=!0)},c))}},u}(Re),Ms=new(function(o){function u(c){o.call(this,"appUserTurnstile"),this._customAccessToken=c}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.postTurnstileEvent=function(c,m){on.EVENTS_URL&&on.ACCESS_TOKEN&&Array.isArray(c)&&c.some(function(x){return Zi(x)||Rn(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=fo(on.ACCESS_TOKEN),E=x?x.u:on.ACCESS_TOKEN,A=E!==this.eventData.tokenU;St(this.anonId)||(this.anonId=bt(),A=!0);var R=this.queue.shift();if(this.eventData.lastSuccess){var L=new Date(this.eventData.lastSuccess),V=new Date(R),Y=(R-this.eventData.lastSuccess)/864e5;A=A||Y>=1||Y<-1||L.getDate()!==V.getDate()}else A=!0;if(!A)return this.processRequests();this.postEvent(R,{"enabled.telemetry":!1},function(K){K||(m.eventData.lastSuccess=R,m.eventData.tokenU=E)},c)}},u}(Re)),ho=Ms.postTurnstileEvent.bind(Ms),Zo=new Za,jt=Zo.postMapLoadEvent.bind(Zo),pr=500,Vr=50;function en(){ce.caches&&!Ea&&(Ea=ce.caches.open("mapbox-tiles"))}function Ln(o){var u=o.indexOf("?");return u<0?o:o.slice(0,u)}var Gi,ue=1/0;function k(){return Gi==null&&(Gi=ce.OffscreenCanvas&&new ce.OffscreenCanvas(1,1).getContext("2d")&&typeof ce.createImageBitmap=="function"),Gi}var z={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(z);var ae=function(o){function u(c,m,x){m===401&&Rn(x)&&(c+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),o.call(this,c),this.status=m,this.url=x,this.name=this.constructor.name,this.message=c}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},u}(Error),Ee=oe()?function(){return self.worker&&self.worker.referrer}:function(){return(ce.location.protocol==="blob:"?ce.parent:ce).location.href},De,zt,Tt=function(o,u){if(!(/^file:/.test(c=o.url)||/^file:/.test(Ee())&&!/^\w+:/.test(c))){if(ce.fetch&&ce.Request&&ce.AbortController&&ce.Request.prototype.hasOwnProperty("signal"))return function(m,x){var E,A=new ce.AbortController,R=new ce.Request(m.url,{method:m.method||"GET",body:m.body,credentials:m.credentials,headers:m.headers,referrer:Ee(),signal:A.signal}),L=!1,V=!1,Y=(E=R.url).indexOf("sku=")>0&&Rn(E);m.type==="json"&&R.headers.set("Accept","application/json");var K=function(ve,ze,I){if(!V){if(ve&&ve.message!=="SecurityError"&&qe(ve),ze&&I)return le(ze);var ht=Date.now();ce.fetch(R).then(function(Je){if(Je.ok){var wt=Y?Je.clone():null;return le(Je,wt,ht)}return x(new ae(Je.statusText,Je.status,m.url))}).catch(function(Je){Je.code!==20&&x(new Error(Je.message))})}},le=function(ve,ze,I){(m.type==="arrayBuffer"?ve.arrayBuffer():m.type==="json"?ve.json():ve.text()).then(function(ht){V||(ze&&I&&function(Je,wt,Bt){if(en(),Ea){var nr={status:wt.status,statusText:wt.statusText,headers:new ce.Headers};wt.headers.forEach(function(mr,Zr){return nr.headers.set(Zr,mr)});var or=H(wt.headers.get("Cache-Control")||"");or["no-store"]||(or["max-age"]&&nr.headers.set("Expires",new Date(Bt+1e3*or["max-age"]).toUTCString()),new Date(nr.headers.get("Expires")).getTime()-Bt<42e4||function(mr,Zr){if(va===void 0)try{new Response(new ReadableStream),va=!0}catch(qr){va=!1}va?Zr(mr.body):mr.blob().then(Zr)}(wt,function(mr){var Zr=new ce.Response(mr,nr);en(),Ea&&Ea.then(function(qr){return qr.put(Ln(Je.url),Zr)}).catch(function(qr){return qe(qr.message)})}))}}(R,ze,I),L=!0,x(null,ht,ve.headers.get("Cache-Control"),ve.headers.get("Expires")))}).catch(function(ht){V||x(new Error(ht.message))})};return Y?function(ve,ze){if(en(),!Ea)return ze(null);var I=Ln(ve.url);Ea.then(function(ht){ht.match(I).then(function(Je){var wt=function(Bt){if(!Bt)return!1;var nr=new Date(Bt.headers.get("Expires")||0),or=H(Bt.headers.get("Cache-Control")||"");return nr>Date.now()&&!or["no-cache"]}(Je);ht.delete(I),wt&&ht.put(I,Je.clone()),ze(null,Je,wt)}).catch(ze)}).catch(ze)}(R,K):K(null,null),{cancel:function(){V=!0,L||A.abort()}}}(o,u);if(oe()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",o,u,void 0,!0)}var c;return function(m,x){var E=new ce.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 R=E.response;if(m.type==="json")try{R=JSON.parse(E.response)}catch(L){return x(L)}x(null,R,E.getResponseHeader("Cache-Control"),E.getResponseHeader("Expires"))}else x(new ae(E.statusText,E.status,m.url))},E.send(m.body),{cancel:function(){return E.abort()}}}(o,u)},Rt=function(o,u){return Tt(Yt(o,{type:"arrayBuffer"}),u)},dt=function(o,u){return Tt(Yt(o,{method:"POST"}),u)},N="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";De=[],zt=0;var B=function(o,u){if(Mr.supported&&(o.headers||(o.headers={}),o.headers.accept="image/webp,*/*"),zt>=on.MAX_PARALLEL_IMAGE_REQUESTS){var c={requestParameters:o,callback:u,cancelled:!1,cancel:function(){this.cancelled=!0}};return De.push(c),c}zt++;var m=!1,x=function(){if(!m)for(m=!0,zt--;De.length&&zt<on.MAX_PARALLEL_IMAGE_REQUESTS;){var A=De.shift();A.cancelled||(A.cancel=B(A.requestParameters,A.callback).cancel)}},E=Rt(o,function(A,R,L,V){x(),A?u(A):R&&(k()?function(Y,K){var le=new ce.Blob([new Uint8Array(Y)],{type:"image/png"});ce.createImageBitmap(le).then(function(ve){K(null,ve)}).catch(function(ve){K(new Error("Could not load image because of "+ve.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(R,u):function(Y,K,le,ve){var ze=new ce.Image,I=ce.URL;ze.onload=function(){K(null,ze),I.revokeObjectURL(ze.src),ze.onload=null,ce.requestAnimationFrame(function(){ze.src=N})},ze.onerror=function(){return K(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 ht=new ce.Blob([new Uint8Array(Y)],{type:"image/png"});ze.cacheControl=le,ze.expires=ve,ze.src=Y.byteLength?I.createObjectURL(ht):N}(R,u,L,V))});return{cancel:function(){E.cancel(),x()}}};function $(o,u,c){c[o]&&c[o].indexOf(u)!==-1||(c[o]=c[o]||[],c[o].push(u))}function ee(o,u,c){if(c&&c[o]){var m=c[o].indexOf(u);m!==-1&&c[o].splice(m,1)}}var xe=function(o,u){u===void 0&&(u={}),Yt(this,u),this.type=o},Ue=function(o){function u(c,m){m===void 0&&(m={}),o.call(this,"error",Yt({error:c},m))}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u}(xe),Qe=function(){};Qe.prototype.on=function(o,u){return this._listeners=this._listeners||{},$(o,u,this._listeners),this},Qe.prototype.off=function(o,u){return ee(o,u,this._listeners),ee(o,u,this._oneTimeListeners),this},Qe.prototype.once=function(o,u){return this._oneTimeListeners=this._oneTimeListeners||{},$(o,u,this._oneTimeListeners),this},Qe.prototype.fire=function(o,u){typeof o=="string"&&(o=new xe(o,u||{}));var c=o.type;if(this.listens(c)){o.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,o);for(var E=0,A=this._oneTimeListeners&&this._oneTimeListeners[c]?this._oneTimeListeners[c].slice():[];E<A.length;E+=1){var R=A[E];ee(c,R,this._oneTimeListeners),R.call(this,o)}var L=this._eventedParent;L&&(Yt(o,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),L.fire(o))}else o instanceof Ue&&console.error(o.error);return this},Qe.prototype.listens=function(o){return this._listeners&&this._listeners[o]&&this._listeners[o].length>0||this._oneTimeListeners&&this._oneTimeListeners[o]&&this._oneTimeListeners[o].length>0||this._eventedParent&&this._eventedParent.listens(o)},Qe.prototype.setEventedParent=function(o,u){return this._eventedParent=o,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(o,u,c,m){this.message=(o?o+": ":"")+c,m&&(this.identifier=m),u!=null&&u.__line__&&(this.line=u.__line__)};function Fe(o){var u=o.value;return u?[new Q(o.key,u,"constants have been deprecated as of v8")]:[]}function et(o){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)o[A]=E[A]}return o}function Ae(o){return o instanceof Number||o instanceof String||o instanceof Boolean?o.valueOf():o}function $t(o){if(Array.isArray(o))return o.map($t);if(o instanceof Object&&!(o instanceof Number||o instanceof String||o instanceof Boolean)){var u={};for(var c in o)u[c]=$t(o[c]);return u}return Ae(o)}var yr=function(o){function u(c,m){o.call(this,m),this.message=m,this.key=c}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u}(Error),nn=function(o,u){u===void 0&&(u=[]),this.parent=o,this.bindings={};for(var c=0,m=u;c<m.length;c+=1){var x=m[c];this.bindings[x[0]]=x[1]}};nn.prototype.concat=function(o){return new nn(this,o)},nn.prototype.get=function(o){if(this.bindings[o])return this.bindings[o];if(this.parent)return this.parent.get(o);throw new Error(o+" not found in scope.")},nn.prototype.has=function(o){return!!this.bindings[o]||!!this.parent&&this.parent.has(o)};var Qr={kind:"null"},tr={kind:"number"},Xr={kind:"string"},zr={kind:"boolean"},jr={kind:"color"},Jn={kind:"object"},ln={kind:"value"},hi={kind:"collator"},Vi={kind:"formatted"},ci={kind:"resolvedImage"};function Li(o,u){return{kind:"array",itemType:o,N:u}}function Ei(o){if(o.kind==="array"){var u=Ei(o.itemType);return typeof o.N=="number"?"array<"+u+", "+o.N+">":o.itemType.kind==="value"?"array":"array<"+u+">"}return o.kind}var ns=[Qr,tr,Xr,zr,jr,Vi,Jn,Li(ln),ci];function Qi(o,u){if(u.kind==="error")return null;if(o.kind==="array"){if(u.kind==="array"&&(u.N===0&&u.itemType.kind==="value"||!Qi(o.itemType,u.itemType))&&(typeof o.N!="number"||o.N===u.N))return null}else{if(o.kind===u.kind)return null;if(o.kind==="value"){for(var c=0,m=ns;c<m.length;c+=1)if(!Qi(m[c],u))return null}}return"Expected "+Ei(o)+" but found "+Ei(u)+" instead."}function Pa(o,u){return u.some(function(c){return c.kind===o.kind})}function Si(o,u){return u.some(function(c){return c==="null"?o===null:c==="array"?Array.isArray(o):c==="object"?o&&!Array.isArray(o)&&typeof o=="object":c===typeof o})}var di=he(function(o,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(R){return(R=Math.round(R))<0?0:R>255?255:R}function x(R){return m(R[R.length-1]==="%"?parseFloat(R)/100*255:parseInt(R))}function E(R){return(L=R[R.length-1]==="%"?parseFloat(R)/100:parseFloat(R))<0?0:L>1?1:L;var L}function A(R,L,V){return V<0?V+=1:V>1&&(V-=1),6*V<1?R+(L-R)*V*6:2*V<1?L:3*V<2?R+(L-R)*(2/3-V)*6:R}try{u.parseCSSColor=function(R){var L,V=R.replace(/ /g,"").toLowerCase();if(V in c)return c[V].slice();if(V[0]==="#")return V.length===4?(L=parseInt(V.substr(1),16))>=0&&L<=4095?[(3840&L)>>4|(3840&L)>>8,240&L|(240&L)>>4,15&L|(15&L)<<4,1]:null:V.length===7&&(L=parseInt(V.substr(1),16))>=0&&L<=16777215?[(16711680&L)>>16,(65280&L)>>8,255&L,1]:null;var Y=V.indexOf("("),K=V.indexOf(")");if(Y!==-1&&K+1===V.length){var le=V.substr(0,Y),ve=V.substr(Y+1,K-(Y+1)).split(","),ze=1;switch(le){case"rgba":if(ve.length!==4)return null;ze=E(ve.pop());case"rgb":return ve.length!==3?null:[x(ve[0]),x(ve[1]),x(ve[2]),ze];case"hsla":if(ve.length!==4)return null;ze=E(ve.pop());case"hsl":if(ve.length!==3)return null;var I=(parseFloat(ve[0])%360+360)%360/360,ht=E(ve[1]),Je=E(ve[2]),wt=Je<=.5?Je*(ht+1):Je+ht-Je*ht,Bt=2*Je-wt;return[m(255*A(Bt,wt,I+1/3)),m(255*A(Bt,wt,I)),m(255*A(Bt,wt,I-1/3)),ze];default:return null}}return null}}catch(R){}}).parseCSSColor,Ai=function(o,u,c,m){m===void 0&&(m=1),this.r=o,this.g=u,this.b=c,this.a=m};Ai.parse=function(o){if(o){if(o instanceof Ai)return o;if(typeof o=="string"){var u=di(o);if(u)return new Ai(u[0]/255*u[3],u[1]/255*u[3],u[2]/255*u[3],u[3])}}},Ai.prototype.toString=function(){var o=this.toArray(),u=o[1],c=o[2],m=o[3];return"rgba("+Math.round(o[0])+","+Math.round(u)+","+Math.round(c)+","+m+")"},Ai.prototype.toArray=function(){var o=this.a;return o===0?[0,0,0,0]:[255*this.r/o,255*this.g/o,255*this.b/o,o]},Ai.black=new Ai(0,0,0,1),Ai.white=new Ai(1,1,1,1),Ai.transparent=new Ai(0,0,0,0),Ai.red=new Ai(1,0,0,1);var Oa=function(o,u,c){this.sensitivity=o?u?"variant":"case":u?"accent":"base",this.locale=c,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Oa.prototype.compare=function(o,u){return this.collator.compare(o,u)},Oa.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var vu=function(o,u,c,m,x){this.text=o,this.image=u,this.scale=c,this.fontStack=m,this.textColor=x},fa=function(o){this.sections=o};fa.fromString=function(o){return new fa([new vu(o,null,null,null,null)])},fa.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(o){return o.text.length!==0||o.image&&o.image.name.length!==0})},fa.factory=function(o){return o instanceof fa?o:fa.fromString(o)},fa.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(o){return o.text}).join("")},fa.prototype.serialize=function(){for(var o=["format"],u=0,c=this.sections;u<c.length;u+=1){var m=c[u];if(m.image)o.push(["image",m.image.name]);else{o.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())),o.push(x)}}return o};var Ra=function(o){this.name=o.name,this.available=o.available};function Gl(o,u,c,m){return typeof o=="number"&&o>=0&&o<=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 ["+[o,u,c,m].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof m=="number"?[o,u,c,m]:[o,u,c]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function vs(o){if(o===null||typeof o=="string"||typeof o=="boolean"||typeof o=="number"||o instanceof Ai||o instanceof Oa||o instanceof fa||o instanceof Ra)return!0;if(Array.isArray(o)){for(var u=0,c=o;u<c.length;u+=1)if(!vs(c[u]))return!1;return!0}if(typeof o=="object"){for(var m in o)if(!vs(o[m]))return!1;return!0}return!1}function Ma(o){if(o===null)return Qr;if(typeof o=="string")return Xr;if(typeof o=="boolean")return zr;if(typeof o=="number")return tr;if(o instanceof Ai)return jr;if(o instanceof Oa)return hi;if(o instanceof fa)return Vi;if(o instanceof Ra)return ci;if(Array.isArray(o)){for(var u,c=o.length,m=0,x=o;m<x.length;m+=1){var E=Ma(x[m]);if(u){if(u===E)continue;u=ln;break}u=E}return Li(u||ln,c)}return Jn}function vi(o){var u=typeof o;return o===null?"":u==="string"||u==="number"||u==="boolean"?String(o):o instanceof Ai||o instanceof fa||o instanceof Ra?o.toString():JSON.stringify(o)}Ra.prototype.toString=function(){return this.name},Ra.fromString=function(o){return o?new Ra({name:o,available:!1}):null},Ra.prototype.serialize=function(){return["image",this.name]};var ka=function(o,u){this.type=o,this.value=u};ka.parse=function(o,u){if(o.length!==2)return u.error("'literal' expression requires exactly one argument, but found "+(o.length-1)+" instead.");if(!vs(o[1]))return u.error("invalid value");var c=o[1],m=Ma(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 ka(m,c)},ka.prototype.evaluate=function(){return this.value},ka.prototype.eachChild=function(){},ka.prototype.outputDefined=function(){return!0},ka.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Ai?["rgba"].concat(this.value.toArray()):this.value instanceof fa?this.value.serialize():this.value};var na=function(o){this.name="ExpressionEvaluationError",this.message=o};na.prototype.toJSON=function(){return this.message};var Vo={string:Xr,number:tr,boolean:zr,object:Jn},ca=function(o,u){this.type=o,this.args=u};ca.parse=function(o,u){if(o.length<2)return u.error("Expected at least one argument.");var c,m=1,x=o[0];if(x==="array"){var E,A;if(o.length>2){var R=o[1];if(typeof R!="string"||!(R in Vo)||R==="object")return u.error('The item type argument of "array" must be one of string, number, boolean',1);E=Vo[R],m++}else E=ln;if(o.length>3){if(o[2]!==null&&(typeof o[2]!="number"||o[2]<0||o[2]!==Math.floor(o[2])))return u.error('The length argument to "array" must be a positive integer literal',2);A=o[2],m++}c=Li(E,A)}else c=Vo[x];for(var L=[];m<o.length;m++){var V=u.parse(o[m],m,ln);if(!V)return null;L.push(V)}return new ca(c,L)},ca.prototype.evaluate=function(o){for(var u=0;u<this.args.length;u++){var c=this.args[u].evaluate(o);if(!Qi(this.type,Ma(c)))return c;if(u===this.args.length-1)throw new na("Expected value to be of type "+Ei(this.type)+", but found "+Ei(Ma(c))+" instead.")}return null},ca.prototype.eachChild=function(o){this.args.forEach(o)},ca.prototype.outputDefined=function(){return this.args.every(function(o){return o.outputDefined()})},ca.prototype.serialize=function(){var o=this.type,u=[o.kind];if(o.kind==="array"){var c=o.itemType;if(c.kind==="string"||c.kind==="number"||c.kind==="boolean"){u.push(c.kind);var m=o.N;(typeof m=="number"||this.args.length>1)&&u.push(m)}}return u.concat(this.args.map(function(x){return x.serialize()}))};var is=function(o){this.type=Vi,this.sections=o};is.parse=function(o,u){if(o.length<2)return u.error("Expected at least one argument.");var c=o[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<=o.length-1;++E){var A=o[E];if(x&&typeof A=="object"&&!Array.isArray(A)){x=!1;var R=null;if(A["font-scale"]&&!(R=u.parse(A["font-scale"],1,tr)))return null;var L=null;if(A["text-font"]&&!(L=u.parse(A["text-font"],1,Li(Xr))))return null;var V=null;if(A["text-color"]&&!(V=u.parse(A["text-color"],1,jr)))return null;var Y=m[m.length-1];Y.scale=R,Y.font=L,Y.textColor=V}else{var K=u.parse(o[E],1,ln);if(!K)return null;var le=K.type.kind;if(le!=="string"&&le!=="value"&&le!=="null"&&le!=="resolvedImage")return u.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,m.push({content:K,scale:null,font:null,textColor:null})}}return new is(m)},is.prototype.evaluate=function(o){return new fa(this.sections.map(function(u){var c=u.content.evaluate(o);return Ma(c)===ci?new vu("",c,null,null,null):new vu(vi(c),null,u.scale?u.scale.evaluate(o):null,u.font?u.font.evaluate(o).join(","):null,u.textColor?u.textColor.evaluate(o):null)}))},is.prototype.eachChild=function(o){for(var u=0,c=this.sections;u<c.length;u+=1){var m=c[u];o(m.content),m.scale&&o(m.scale),m.font&&o(m.font),m.textColor&&o(m.textColor)}},is.prototype.outputDefined=function(){return!1},is.prototype.serialize=function(){for(var o=["format"],u=0,c=this.sections;u<c.length;u+=1){var m=c[u];o.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()),o.push(x)}return o};var qo=function(o){this.type=ci,this.input=o};qo.parse=function(o,u){if(o.length!==2)return u.error("Expected two arguments.");var c=u.parse(o[1],1,Xr);return c?new qo(c):u.error("No image name provided.")},qo.prototype.evaluate=function(o){var u=this.input.evaluate(o),c=Ra.fromString(u);return c&&o.availableImages&&(c.available=o.availableImages.indexOf(u)>-1),c},qo.prototype.eachChild=function(o){o(this.input)},qo.prototype.outputDefined=function(){return!1},qo.prototype.serialize=function(){return["image",this.input.serialize()]};var Du={"to-boolean":zr,"to-color":jr,"to-number":tr,"to-string":Xr},ms=function(o,u){this.type=o,this.args=u};ms.parse=function(o,u){if(o.length<2)return u.error("Expected at least one argument.");var c=o[0];if((c==="to-boolean"||c==="to-string")&&o.length!==2)return u.error("Expected one argument.");for(var m=Du[c],x=[],E=1;E<o.length;E++){var A=u.parse(o[E],E,ln);if(!A)return null;x.push(A)}return new ms(m,x)},ms.prototype.evaluate=function(o){if(this.type.kind==="boolean")return!!this.args[0].evaluate(o);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(o))instanceof Ai)return u;if(typeof u=="string"){var E=o.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.":Gl(u[0],u[1],u[2],u[3])))return new Ai(u[0]/255,u[1]/255,u[2]/255,u[3])}throw new na(c||"Could not parse color from value '"+(typeof u=="string"?u:String(JSON.stringify(u)))+"'")}if(this.type.kind==="number"){for(var A=null,R=0,L=this.args;R<L.length;R+=1){if((A=L[R].evaluate(o))===null)return 0;var V=Number(A);if(!isNaN(V))return V}throw new na("Could not convert "+JSON.stringify(A)+" to number.")}return this.type.kind==="formatted"?fa.fromString(vi(this.args[0].evaluate(o))):this.type.kind==="resolvedImage"?Ra.fromString(vi(this.args[0].evaluate(o))):vi(this.args[0].evaluate(o))},ms.prototype.eachChild=function(o){this.args.forEach(o)},ms.prototype.outputDefined=function(){return this.args.every(function(o){return o.outputDefined()})},ms.prototype.serialize=function(){if(this.type.kind==="formatted")return new is([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new qo(this.args[0]).serialize();var o=["to-"+this.type.kind];return this.eachChild(function(u){o.push(u.serialize())}),o};var yc=["Unknown","Point","LineString","Polygon"],Sa=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Sa.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Sa.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?yc[this.feature.type]:this.feature.type:null},Sa.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Sa.prototype.canonicalID=function(){return this.canonical},Sa.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Sa.prototype.parseColor=function(o){var u=this._parseColorCache[o];return u||(u=this._parseColorCache[o]=Ai.parse(o)),u};var Ji=function(o,u,c,m){this.name=o,this.type=u,this._evaluate=c,this.args=m};Ji.prototype.evaluate=function(o){return this._evaluate(o,this.args)},Ji.prototype.eachChild=function(o){this.args.forEach(o)},Ji.prototype.outputDefined=function(){return!1},Ji.prototype.serialize=function(){return[this.name].concat(this.args.map(function(o){return o.serialize()}))},Ji.parse=function(o,u){var c,m=o[0],x=Ji.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,R=A.filter(function(Zn){var mn=Zn[0];return!Array.isArray(mn)||mn.length===o.length-1}),L=null,V=0,Y=R;V<Y.length;V+=1){var K=Y[V],le=K[0],ve=K[1];L=new Ju(u.registry,u.path,null,u.scope);for(var ze=[],I=!1,ht=1;ht<o.length;ht++){var Je=o[ht],wt=Array.isArray(le)?le[ht-1]:le.type,Bt=L.parse(Je,1+ze.length,wt);if(!Bt){I=!0;break}ze.push(Bt)}if(!I)if(Array.isArray(le)&&le.length!==ze.length)L.error("Expected "+le.length+" arguments, but found "+ze.length+" instead.");else{for(var nr=0;nr<ze.length;nr++){var or=Array.isArray(le)?le[nr]:le.type,mr=ze[nr];L.concat(nr+1).checkSubtype(or,mr.type)}if(L.errors.length===0)return new Ji(m,E,ve,ze)}}if(R.length===1)(c=u.errors).push.apply(c,L.errors);else{for(var Zr=(R.length?R:A).map(function(Zn){var mn;return mn=Zn[0],Array.isArray(mn)?"("+mn.map(Ei).join(", ")+")":"("+Ei(mn.type)+"...)"}).join(" | "),qr=[],Nn=1;Nn<o.length;Nn++){var vn=u.parse(o[Nn],1+qr.length);if(!vn)return null;qr.push(Ei(vn.type))}u.error("Expected arguments of type "+Zr+", but found ("+qr.join(", ")+") instead.")}return null},Ji.register=function(o,u){for(var c in Ji.definitions=u,u)o[c]=Ji};var Qt=function(o,u,c){this.type=hi,this.locale=c,this.caseSensitive=o,this.diacriticSensitive=u};function _n(o,u){o[0]=Math.min(o[0],u[0]),o[1]=Math.min(o[1],u[1]),o[2]=Math.max(o[2],u[0]),o[3]=Math.max(o[3],u[1])}function ge(o,u){return!(o[0]<=u[0]||o[2]>=u[2]||o[1]<=u[1]||o[3]>=u[3])}function ke(o,u){var c=(180+o[0])/360,m=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o[1]*Math.PI/360)))/360,x=Math.pow(2,u.z);return[Math.round(c*x*8192),Math.round(m*x*8192)]}function gt(o,u,c){return u[1]>o[1]!=c[1]>o[1]&&o[0]<(c[0]-u[0])*(o[1]-u[1])/(c[1]-u[1])+u[0]}function lr(o,u){for(var c,m,x,E,A,R,L,V=!1,Y=0,K=u.length;Y<K;Y++)for(var le=u[Y],ve=0,ze=le.length;ve<ze-1;ve++){if((E=(c=o)[0]-(m=le[ve])[0])*(L=c[1]-(x=le[ve+1])[1])-(R=c[0]-x[0])*(A=c[1]-m[1])==0&&E*R<=0&&A*L<=0)return!1;gt(o,le[ve],le[ve+1])&&(V=!V)}return V}function Kr(o,u){for(var c=0;c<u.length;c++)if(lr(o,u[c]))return!0;return!1}function kn(o,u,c,m){var x=m[0]-c[0],E=m[1]-c[1],A=(o[0]-c[0])*E-x*(o[1]-c[1]),R=(u[0]-c[0])*E-x*(u[1]-c[1]);return A>0&&R<0||A<0&&R>0}function ji(o,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((K=[(Y=E[A+1])[0]-(V=E[A])[0],Y[1]-V[1]])[0]*(le=[(L=u)[0]-(R=o)[0],L[1]-R[1]])[1]-K[1]*le[0]!=0&&kn(R,L,V,Y)&&kn(V,Y,R,L))return!0;var R,L,V,Y,K,le;return!1}function go(o,u){for(var c=0;c<o.length;++c)if(!lr(o[c],u))return!1;for(var m=0;m<o.length-1;++m)if(ji(o[m],o[m+1],u))return!1;return!0}function Co(o,u){for(var c=0;c<u.length;c++)if(go(o,u[c]))return!0;return!1}function po(o,u,c){for(var m=[],x=0;x<o.length;x++){for(var E=[],A=0;A<o[x].length;A++){var R=ke(o[x][A],c);_n(u,R),E.push(R)}m.push(E)}return m}function Ls(o,u,c){for(var m=[],x=0;x<o.length;x++){var E=po(o[x],u,c);m.push(E)}return m}function Is(o,u,c,m){if(o[0]<c[0]||o[0]>c[2]){var x=.5*m,E=o[0]-c[0]>x?-m:c[0]-o[0]>x?m:0;E===0&&(E=o[0]-c[2]>x?-m:c[2]-o[0]>x?m:0),o[0]+=E}_n(u,o)}function ep(o,u,c,m){for(var x=8192*Math.pow(2,m.z),E=[8192*m.x,8192*m.y],A=[],R=0,L=o;R<L.length;R+=1)for(var V=0,Y=L[R];V<Y.length;V+=1){var K=Y[V],le=[K.x+E[0],K.y+E[1]];Is(le,u,c,x),A.push(le)}return A}function Af(o,u,c,m){for(var x,E=8192*Math.pow(2,m.z),A=[8192*m.x,8192*m.y],R=[],L=0,V=o;L<V.length;L+=1){for(var Y=[],K=0,le=V[L];K<le.length;K+=1){var ve=le[K],ze=[ve.x+A[0],ve.y+A[1]];_n(u,ze),Y.push(ze)}R.push(Y)}if(u[2]-u[0]<=E/2){(x=u)[0]=x[1]=1/0,x[2]=x[3]=-1/0;for(var I=0,ht=R;I<ht.length;I+=1)for(var Je=0,wt=ht[I];Je<wt.length;Je+=1)Is(wt[Je],u,c,E)}return R}Qt.parse=function(o,u){if(o.length!==2)return u.error("Expected one argument.");var c=o[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,zr);if(!m)return null;var x=u.parse(c["diacritic-sensitive"]!==void 0&&c["diacritic-sensitive"],1,zr);if(!x)return null;var E=null;return c.locale&&!(E=u.parse(c.locale,1,Xr))?null:new Qt(m,x,E)},Qt.prototype.evaluate=function(o){return new Oa(this.caseSensitive.evaluate(o),this.diacriticSensitive.evaluate(o),this.locale?this.locale.evaluate(o):null)},Qt.prototype.eachChild=function(o){o(this.caseSensitive),o(this.diacriticSensitive),this.locale&&o(this.locale)},Qt.prototype.outputDefined=function(){return!1},Qt.prototype.serialize=function(){var o={};return o["case-sensitive"]=this.caseSensitive.serialize(),o["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(o.locale=this.locale.serialize()),["collator",o]};var Ko=function(o,u){this.type=zr,this.geojson=o,this.geometries=u};function El(o){if(o instanceof Ji&&(o.name==="get"&&o.args.length===1||o.name==="feature-state"||o.name==="has"&&o.args.length===1||o.name==="properties"||o.name==="geometry-type"||o.name==="id"||/^filter-/.test(o.name))||o instanceof Ko)return!1;var u=!0;return o.eachChild(function(c){u&&!El(c)&&(u=!1)}),u}function Sl(o){if(o instanceof Ji&&o.name==="feature-state")return!1;var u=!0;return o.eachChild(function(c){u&&!Sl(c)&&(u=!1)}),u}function Lu(o,u){if(o instanceof Ji&&u.indexOf(o.name)>=0)return!1;var c=!0;return o.eachChild(function(m){c&&!Lu(m,u)&&(c=!1)}),c}Ko.parse=function(o,u){if(o.length!==2)return u.error("'within' expression requires exactly one argument, but found "+(o.length-1)+" instead.");if(vs(o[1])){var c=o[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 Ko(c,c.features[m].geometry)}else if(c.type==="Feature"){var E=c.geometry.type;if(E==="Polygon"||E==="MultiPolygon")return new Ko(c,c.geometry)}else if(c.type==="Polygon"||c.type==="MultiPolygon")return new Ko(c,c)}return u.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Ko.prototype.evaluate=function(o){if(o.geometry()!=null&&o.canonicalID()!=null){if(o.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=po(c.coordinates,x,E),R=ep(u.geometry(),m,x,E);if(!ge(m,x))return!1;for(var L=0,V=R;L<V.length;L+=1)if(!lr(V[L],A))return!1}if(c.type==="MultiPolygon"){var Y=Ls(c.coordinates,x,E),K=ep(u.geometry(),m,x,E);if(!ge(m,x))return!1;for(var le=0,ve=K;le<ve.length;le+=1)if(!Kr(ve[le],Y))return!1}return!0}(o,this.geometries);if(o.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=po(c.coordinates,x,E),R=Af(u.geometry(),m,x,E);if(!ge(m,x))return!1;for(var L=0,V=R;L<V.length;L+=1)if(!go(V[L],A))return!1}if(c.type==="MultiPolygon"){var Y=Ls(c.coordinates,x,E),K=Af(u.geometry(),m,x,E);if(!ge(m,x))return!1;for(var le=0,ve=K;le<ve.length;le+=1)if(!Co(ve[le],Y))return!1}return!0}(o,this.geometries)}return!1},Ko.prototype.eachChild=function(){},Ko.prototype.outputDefined=function(){return!0},Ko.prototype.serialize=function(){return["within",this.geojson]};var Bu=function(o,u){this.type=u.type,this.name=o,this.boundExpression=u};Bu.parse=function(o,u){if(o.length!==2||typeof o[1]!="string")return u.error("'var' expression requires exactly one string literal argument.");var c=o[1];return u.scope.has(c)?new Bu(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)},Bu.prototype.evaluate=function(o){return this.boundExpression.evaluate(o)},Bu.prototype.eachChild=function(){},Bu.prototype.outputDefined=function(){return!1},Bu.prototype.serialize=function(){return["var",this.name]};var Ju=function(o,u,c,m,x){u===void 0&&(u=[]),m===void 0&&(m=new nn),x===void 0&&(x=[]),this.registry=o,this.path=u,this.key=u.map(function(E){return"["+E+"]"}).join(""),this.scope=m,this.errors=x,this.expectedType=c};function $c(o,u){for(var c,m=o.length-1,x=0,E=m,A=0;x<=E;)if((c=o[A=Math.floor((x+E)/2)])<=u){if(A===m||u<o[A+1])return A;x=A+1}else{if(!(c>u))throw new na("Input is not a number.");E=A-1}return 0}Ju.prototype.parse=function(o,u,c,m,x){return x===void 0&&(x={}),u?this.concat(u,c,m)._parse(o,x):this._parse(o,x)},Ju.prototype._parse=function(o,u){function c(V,Y,K){return K==="assert"?new ca(Y,[V]):K==="coerce"?new ms(Y,[V]):V}if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&typeof o!="number"||(o=["literal",o]),Array.isArray(o)){if(o.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var m=o[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(o,this);if(!E)return null;if(this.expectedType){var A=this.expectedType,R=E.type;if(A.kind!=="string"&&A.kind!=="number"&&A.kind!=="boolean"&&A.kind!=="object"&&A.kind!=="array"||R.kind!=="value")if(A.kind!=="color"&&A.kind!=="formatted"&&A.kind!=="resolvedImage"||R.kind!=="value"&&R.kind!=="string"){if(this.checkSubtype(A,R))return null}else E=c(E,A,u.typeAnnotation||"coerce");else E=c(E,A,u.typeAnnotation||"assert")}if(!(E instanceof ka)&&E.type.kind!=="resolvedImage"&&function V(Y){if(Y instanceof Bu)return V(Y.boundExpression);if(Y instanceof Ji&&Y.name==="error"||Y instanceof Qt||Y instanceof Ko)return!1;var K=Y instanceof ms||Y instanceof ca,le=!0;return Y.eachChild(function(ve){le=K?le&&V(ve):le&&ve instanceof ka}),!!le&&El(Y)&&Lu(Y,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(E)){var L=new Sa;try{E=new ka(E.type,E.evaluate(L))}catch(V){return this.error(V.message),null}}return E}return this.error('Unknown expression "'+m+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(o===void 0?"'undefined' value invalid. Use null instead.":typeof o=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof o+" instead.")},Ju.prototype.concat=function(o,u,c){var m=typeof o=="number"?this.path.concat(o):this.path,x=c?this.scope.concat(c):this.scope;return new Ju(this.registry,m,u||null,x,this.errors)},Ju.prototype.error=function(o){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 yr(m,o))},Ju.prototype.checkSubtype=function(o,u){var c=Qi(o,u);return c&&this.error(c),c};var Bs=function(o,u,c){this.type=o,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(o,u,c){return o*(1-c)+u*c}Bs.parse=function(o,u){if(o.length-1<4)return u.error("Expected at least 4 arguments, but found only "+(o.length-1)+".");if((o.length-1)%2!=0)return u.error("Expected an even number of arguments.");var c=u.parse(o[1],1,tr);if(!c)return null;var m=[],x=null;u.expectedType&&u.expectedType.kind!=="value"&&(x=u.expectedType);for(var E=1;E<o.length;E+=2){var A=E===1?-1/0:o[E],R=o[E+1],L=E,V=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.',L);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.',L);var Y=u.parse(R,V,x);if(!Y)return null;x=x||Y.type,m.push([A,Y])}return new Bs(x,c,m)},Bs.prototype.evaluate=function(o){var u=this.labels,c=this.outputs;if(u.length===1)return c[0].evaluate(o);var m=this.input.evaluate(o);if(m<=u[0])return c[0].evaluate(o);var x=u.length;return m>=u[x-1]?c[x-1].evaluate(o):c[$c(u,m)].evaluate(o)},Bs.prototype.eachChild=function(o){o(this.input);for(var u=0,c=this.outputs;u<c.length;u+=1)o(c[u])},Bs.prototype.outputDefined=function(){return this.outputs.every(function(o){return o.outputDefined()})},Bs.prototype.serialize=function(){for(var o=["step",this.input.serialize()],u=0;u<this.labels.length;u++)u>0&&o.push(this.labels[u]),o.push(this.outputs[u].serialize());return o};var Al=Object.freeze({__proto__:null,number:qa,color:function(o,u,c){return new Ai(qa(o.r,u.r,c),qa(o.g,u.g,c),qa(o.b,u.b,c),qa(o.a,u.a,c))},array:function(o,u,c){return o.map(function(m,x){return qa(m,u[x],c)})}}),el=6/29*3*(6/29),Tf=Math.PI/180,tp=180/Math.PI;function wf(o){return o>.008856451679035631?Math.pow(o,1/3):o/el+4/29}function hh(o){return o>6/29?o*o*o:el*(o-4/29)}function ph(o){return 255*(o<=.0031308?12.92*o:1.055*Math.pow(o,1/2.4)-.055)}function dh(o){return(o/=255)<=.04045?o/12.92:Math.pow((o+.055)/1.055,2.4)}function rp(o){var u=dh(o.r),c=dh(o.g),m=dh(o.b),x=wf((.4124564*u+.3575761*c+.1804375*m)/.95047),E=wf((.2126729*u+.7151522*c+.072175*m)/1);return{l:116*E-16,a:500*(x-E),b:200*(E-wf((.0193339*u+.119192*c+.9503041*m)/1.08883)),alpha:o.a}}function np(o){var u=(o.l+16)/116,c=isNaN(o.a)?u:u+o.a/500,m=isNaN(o.b)?u:u-o.b/200;return u=1*hh(u),c=.95047*hh(c),m=1.08883*hh(m),new Ai(ph(3.2404542*c-1.5371385*u-.4985314*m),ph(-.969266*c+1.8760108*u+.041556*m),ph(.0556434*c-.2040259*u+1.0572252*m),o.alpha)}function zp(o,u,c){var m=u-o;return o+c*(m>180||m<-180?m-360*Math.round(m/360):m)}var Yc={forward:rp,reverse:np,interpolate:function(o,u,c){return{l:qa(o.l,u.l,c),a:qa(o.a,u.a,c),b:qa(o.b,u.b,c),alpha:qa(o.alpha,u.alpha,c)}}},Fu={forward:function(o){var u=rp(o),c=u.l,m=u.a,x=u.b,E=Math.atan2(x,m)*tp;return{h:E<0?E+360:E,c:Math.sqrt(m*m+x*x),l:c,alpha:o.a}},reverse:function(o){var u=o.h*Tf,c=o.c;return np({l:o.l,a:Math.cos(u)*c,b:Math.sin(u)*c,alpha:o.alpha})},interpolate:function(o,u,c){return{h:zp(o.h,u.h,c),c:qa(o.c,u.c,c),l:qa(o.l,u.l,c),alpha:qa(o.alpha,u.alpha,c)}}},ip=Object.freeze({__proto__:null,lab:Yc,hcl:Fu}),Qo=function(o,u,c,m,x){this.type=o,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 R=A[E],L=R[1];this.labels.push(R[0]),this.outputs.push(L)}};function Xl(o,u,c,m){var x=m-c,E=o-c;return x===0?0:u===1?E/x:(Math.pow(u,E)-1)/(Math.pow(u,x)-1)}Qo.interpolationFactor=function(o,u,c,m){var x=0;if(o.name==="exponential")x=Xl(u,o.base,c,m);else if(o.name==="linear")x=Xl(u,1,c,m);else if(o.name==="cubic-bezier"){var E=o.controlPoints;x=new Z(E[0],E[1],E[2],E[3]).solve(Xl(u,1,c,m))}return x},Qo.parse=function(o,u){var c=o[0],m=o[1],x=o[2],E=o.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 R=m.slice(1);if(R.length!==4||R.some(function(ht){return typeof ht!="number"||ht<0||ht>1}))return u.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);m={name:"cubic-bezier",controlPoints:R}}if(o.length-1<4)return u.error("Expected at least 4 arguments, but found only "+(o.length-1)+".");if((o.length-1)%2!=0)return u.error("Expected an even number of arguments.");if(!(x=u.parse(x,2,tr)))return null;var L=[],V=null;c==="interpolate-hcl"||c==="interpolate-lab"?V=jr:u.expectedType&&u.expectedType.kind!=="value"&&(V=u.expectedType);for(var Y=0;Y<E.length;Y+=2){var K=E[Y],le=E[Y+1],ve=Y+3,ze=Y+4;if(typeof K!="number")return u.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',ve);if(L.length&&L[L.length-1][0]>=K)return u.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ve);var I=u.parse(le,ze,V);if(!I)return null;V=V||I.type,L.push([K,I])}return V.kind==="number"||V.kind==="color"||V.kind==="array"&&V.itemType.kind==="number"&&typeof V.N=="number"?new Qo(V,c,m,x,L):u.error("Type "+Ei(V)+" is not interpolatable.")},Qo.prototype.evaluate=function(o){var u=this.labels,c=this.outputs;if(u.length===1)return c[0].evaluate(o);var m=this.input.evaluate(o);if(m<=u[0])return c[0].evaluate(o);var x=u.length;if(m>=u[x-1])return c[x-1].evaluate(o);var E=$c(u,m),A=Qo.interpolationFactor(this.interpolation,m,u[E],u[E+1]),R=c[E].evaluate(o),L=c[E+1].evaluate(o);return this.operator==="interpolate"?Al[this.type.kind.toLowerCase()](R,L,A):this.operator==="interpolate-hcl"?Fu.reverse(Fu.interpolate(Fu.forward(R),Fu.forward(L),A)):Yc.reverse(Yc.interpolate(Yc.forward(R),Yc.forward(L),A))},Qo.prototype.eachChild=function(o){o(this.input);for(var u=0,c=this.outputs;u<c.length;u+=1)o(c[u])},Qo.prototype.outputDefined=function(){return this.outputs.every(function(o){return o.outputDefined()})},Qo.prototype.serialize=function(){var o;o=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,o,this.input.serialize()],c=0;c<this.labels.length;c++)u.push(this.labels[c],this.outputs[c].serialize());return u};var Tl=function(o,u){this.type=o,this.args=u};Tl.parse=function(o,u){if(o.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=o.slice(1);E<A.length;E+=1){var R=u.parse(A[E],1+x.length,c,void 0,{typeAnnotation:"omit"});if(!R)return null;c=c||R.type,x.push(R)}var L=m&&x.some(function(V){return Qi(m,V.type)});return new Tl(L?ln:c,x)},Tl.prototype.evaluate=function(o){for(var u,c=null,m=0,x=0,E=this.args;x<E.length&&(m++,(c=E[x].evaluate(o))&&c instanceof Ra&&!c.available&&(u||(u=c.name),c=null,m===this.args.length&&(c=u)),c===null);x+=1);return c},Tl.prototype.eachChild=function(o){this.args.forEach(o)},Tl.prototype.outputDefined=function(){return this.args.every(function(o){return o.outputDefined()})},Tl.prototype.serialize=function(){var o=["coalesce"];return this.eachChild(function(u){o.push(u.serialize())}),o};var Ks=function(o,u){this.type=u.type,this.bindings=[].concat(o),this.result=u};Ks.prototype.evaluate=function(o){return this.result.evaluate(o)},Ks.prototype.eachChild=function(o){for(var u=0,c=this.bindings;u<c.length;u+=1)o(c[u][1]);o(this.result)},Ks.parse=function(o,u){if(o.length<4)return u.error("Expected at least 3 arguments, but found "+(o.length-1)+" instead.");for(var c=[],m=1;m<o.length-1;m+=2){var x=o[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(o[m+1],m+1);if(!E)return null;c.push([x,E])}var A=u.parse(o[o.length-1],o.length-1,u.expectedType,c);return A?new Ks(c,A):null},Ks.prototype.outputDefined=function(){return this.result.outputDefined()},Ks.prototype.serialize=function(){for(var o=["let"],u=0,c=this.bindings;u<c.length;u+=1){var m=c[u];o.push(m[0],m[1].serialize())}return o.push(this.result.serialize()),o};var wl=function(o,u,c){this.type=o,this.index=u,this.input=c};wl.parse=function(o,u){if(o.length!==3)return u.error("Expected 2 arguments, but found "+(o.length-1)+" instead.");var c=u.parse(o[1],1,tr),m=u.parse(o[2],2,Li(u.expectedType||ln));return c&&m?new wl(m.type.itemType,c,m):null},wl.prototype.evaluate=function(o){var u=this.index.evaluate(o),c=this.input.evaluate(o);if(u<0)throw new na("Array index out of bounds: "+u+" < 0.");if(u>=c.length)throw new na("Array index out of bounds: "+u+" > "+(c.length-1)+".");if(u!==Math.floor(u))throw new na("Array index must be an integer, but found "+u+" instead.");return c[u]},wl.prototype.eachChild=function(o){o(this.index),o(this.input)},wl.prototype.outputDefined=function(){return!1},wl.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var ui=function(o,u){this.type=zr,this.needle=o,this.haystack=u};ui.parse=function(o,u){if(o.length!==3)return u.error("Expected 2 arguments, but found "+(o.length-1)+" instead.");var c=u.parse(o[1],1,ln),m=u.parse(o[2],2,ln);return c&&m?Pa(c.type,[zr,Xr,tr,Qr,ln])?new ui(c,m):u.error("Expected first argument to be of type boolean, string, number or null, but found "+Ei(c.type)+" instead"):null},ui.prototype.evaluate=function(o){var u=this.needle.evaluate(o),c=this.haystack.evaluate(o);if(!c)return!1;if(!Si(u,["boolean","string","number","null"]))throw new na("Expected first argument to be of type boolean, string, number or null, but found "+Ei(Ma(u))+" instead.");if(!Si(c,["string","array"]))throw new na("Expected second argument to be of type array or string, but found "+Ei(Ma(c))+" instead.");return c.indexOf(u)>=0},ui.prototype.eachChild=function(o){o(this.needle),o(this.haystack)},ui.prototype.outputDefined=function(){return!0},ui.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var tl=function(o,u,c){this.type=tr,this.needle=o,this.haystack=u,this.fromIndex=c};tl.parse=function(o,u){if(o.length<=2||o.length>=5)return u.error("Expected 3 or 4 arguments, but found "+(o.length-1)+" instead.");var c=u.parse(o[1],1,ln),m=u.parse(o[2],2,ln);if(!c||!m)return null;if(!Pa(c.type,[zr,Xr,tr,Qr,ln]))return u.error("Expected first argument to be of type boolean, string, number or null, but found "+Ei(c.type)+" instead");if(o.length===4){var x=u.parse(o[3],3,tr);return x?new tl(c,m,x):null}return new tl(c,m)},tl.prototype.evaluate=function(o){var u=this.needle.evaluate(o),c=this.haystack.evaluate(o);if(!Si(u,["boolean","string","number","null"]))throw new na("Expected first argument to be of type boolean, string, number or null, but found "+Ei(Ma(u))+" instead.");if(!Si(c,["string","array"]))throw new na("Expected second argument to be of type array or string, but found "+Ei(Ma(c))+" instead.");if(this.fromIndex){var m=this.fromIndex.evaluate(o);return c.indexOf(u,m)}return c.indexOf(u)},tl.prototype.eachChild=function(o){o(this.needle),o(this.haystack),this.fromIndex&&o(this.fromIndex)},tl.prototype.outputDefined=function(){return!1},tl.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var o=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),o]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Fs=function(o,u,c,m,x,E){this.inputType=o,this.type=u,this.input=c,this.cases=m,this.outputs=x,this.otherwise=E};Fs.parse=function(o,u){if(o.length<5)return u.error("Expected at least 4 arguments, but found only "+(o.length-1)+".");if(o.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<o.length-1;A+=2){var R=o[A],L=o[A+1];Array.isArray(R)||(R=[R]);var V=u.concat(A);if(R.length===0)return V.error("Expected at least one branch label.");for(var Y=0,K=R;Y<K.length;Y+=1){var le=K[Y];if(typeof le!="number"&&typeof le!="string")return V.error("Branch labels must be numbers or strings.");if(typeof le=="number"&&Math.abs(le)>Number.MAX_SAFE_INTEGER)return V.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof le=="number"&&Math.floor(le)!==le)return V.error("Numeric branch labels must be integer values.");if(c){if(V.checkSubtype(c,Ma(le)))return null}else c=Ma(le);if(x[String(le)]!==void 0)return V.error("Branch labels must be unique.");x[String(le)]=E.length}var ve=u.parse(L,A,m);if(!ve)return null;m=m||ve.type,E.push(ve)}var ze=u.parse(o[1],1,ln);if(!ze)return null;var I=u.parse(o[o.length-1],o.length-1,m);return I?ze.type.kind!=="value"&&u.concat(1).checkSubtype(c,ze.type)?null:new Fs(c,m,ze,x,E,I):null},Fs.prototype.evaluate=function(o){var u=this.input.evaluate(o);return(Ma(u)===this.inputType&&this.outputs[this.cases[u]]||this.otherwise).evaluate(o)},Fs.prototype.eachChild=function(o){o(this.input),this.outputs.forEach(o),o(this.otherwise)},Fs.prototype.outputDefined=function(){return this.outputs.every(function(o){return o.outputDefined()})&&this.otherwise.outputDefined()},Fs.prototype.serialize=function(){for(var o=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];(K=m[this.cases[A]])===void 0?(m[this.cases[A]]=c.length,c.push([this.cases[A],[A]])):c[K][1].push(A)}for(var R=function(ve){return o.inputType.kind==="number"?Number(ve):ve},L=0,V=c;L<V.length;L+=1){var Y=V[L],K=Y[0],le=Y[1];u.push(le.length===1?R(le[0]):le.map(R)),u.push(this.outputs[outputIndex$1].serialize())}return u.push(this.otherwise.serialize()),u};var Nu=function(o,u,c){this.type=o,this.branches=u,this.otherwise=c};Nu.parse=function(o,u){if(o.length<4)return u.error("Expected at least 3 arguments, but found only "+(o.length-1)+".");if(o.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<o.length-1;x+=2){var E=u.parse(o[x],x,zr);if(!E)return null;var A=u.parse(o[x+1],x+1,c);if(!A)return null;m.push([E,A]),c=c||A.type}var R=u.parse(o[o.length-1],o.length-1,c);return R?new Nu(c,m,R):null},Nu.prototype.evaluate=function(o){for(var u=0,c=this.branches;u<c.length;u+=1){var m=c[u],x=m[1];if(m[0].evaluate(o))return x.evaluate(o)}return this.otherwise.evaluate(o)},Nu.prototype.eachChild=function(o){for(var u=0,c=this.branches;u<c.length;u+=1){var m=c[u],x=m[1];o(m[0]),o(x)}o(this.otherwise)},Nu.prototype.outputDefined=function(){return this.branches.every(function(o){return o[1].outputDefined()})&&this.otherwise.outputDefined()},Nu.prototype.serialize=function(){var o=["case"];return this.eachChild(function(u){o.push(u.serialize())}),o};var rl=function(o,u,c,m){this.type=o,this.input=u,this.beginIndex=c,this.endIndex=m};function ap(o,u){return o==="=="||o==="!="?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 Yi(o,u,c,m){return m.compare(u,c)===0}function Ci(o,u,c){var m=o!=="=="&&o!=="!=";return function(){function x(E,A,R){this.type=zr,this.lhs=E,this.rhs=A,this.collator=R,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 R=E[0],L=A.parse(E[1],1,ln);if(!L)return null;if(!ap(R,L.type))return A.concat(1).error('"'+R+`" comparisons are not supported for type '`+Ei(L.type)+"'.");var V=A.parse(E[2],2,ln);if(!V)return null;if(!ap(R,V.type))return A.concat(2).error('"'+R+`" comparisons are not supported for type '`+Ei(V.type)+"'.");if(L.type.kind!==V.type.kind&&L.type.kind!=="value"&&V.type.kind!=="value")return A.error("Cannot compare types '"+Ei(L.type)+"' and '"+Ei(V.type)+"'.");m&&(L.type.kind==="value"&&V.type.kind!=="value"?L=new ca(V.type,[L]):L.type.kind!=="value"&&V.type.kind==="value"&&(V=new ca(L.type,[V])));var Y=null;if(E.length===4){if(L.type.kind!=="string"&&V.type.kind!=="string"&&L.type.kind!=="value"&&V.type.kind!=="value")return A.error("Cannot use collator to compare non-string types.");if(!(Y=A.parse(E[3],3,hi)))return null}return new x(L,V,Y)},x.prototype.evaluate=function(E){var A=this.lhs.evaluate(E),R=this.rhs.evaluate(E);if(m&&this.hasUntypedArgument){var L=Ma(A),V=Ma(R);if(L.kind!==V.kind||L.kind!=="string"&&L.kind!=="number")throw new na('Expected arguments for "'+o+'" to be (string, string) or (number, number), but found ('+L.kind+", "+V.kind+") instead.")}if(this.collator&&!m&&this.hasUntypedArgument){var Y=Ma(A),K=Ma(R);if(Y.kind!=="string"||K.kind!=="string")return u(E,A,R)}return this.collator?c(E,A,R,this.collator.evaluate(E)):u(E,A,R)},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=[o];return this.eachChild(function(A){E.push(A.serialize())}),E},x}()}rl.parse=function(o,u){if(o.length<=2||o.length>=5)return u.error("Expected 3 or 4 arguments, but found "+(o.length-1)+" instead.");var c=u.parse(o[1],1,ln),m=u.parse(o[2],2,tr);if(!c||!m)return null;if(!Pa(c.type,[Li(ln),Xr,ln]))return u.error("Expected first argument to be of type array or string, but found "+Ei(c.type)+" instead");if(o.length===4){var x=u.parse(o[3],3,tr);return x?new rl(c.type,c,m,x):null}return new rl(c.type,c,m)},rl.prototype.evaluate=function(o){var u=this.input.evaluate(o),c=this.beginIndex.evaluate(o);if(!Si(u,["string","array"]))throw new na("Expected first argument to be of type array or string, but found "+Ei(Ma(u))+" instead.");if(this.endIndex){var m=this.endIndex.evaluate(o);return u.slice(c,m)}return u.slice(c)},rl.prototype.eachChild=function(o){o(this.input),o(this.beginIndex),this.endIndex&&o(this.endIndex)},rl.prototype.outputDefined=function(){return!1},rl.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var o=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),o]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var ou=Ci("==",function(o,u,c){return u===c},Yi),mu=Ci("!=",function(o,u,c){return u!==c},function(o,u,c,m){return!Yi(0,u,c,m)}),Cf=Ci("<",function(o,u,c){return u<c},function(o,u,c,m){return m.compare(u,c)<0}),Va=Ci(">",function(o,u,c){return u>c},function(o,u,c,m){return m.compare(u,c)>0}),vh=Ci("<=",function(o,u,c){return u<=c},function(o,u,c,m){return m.compare(u,c)<=0}),Rf=Ci(">=",function(o,u,c){return u>=c},function(o,u,c,m){return m.compare(u,c)>=0}),Ns=function(o,u,c,m,x){this.type=Xr,this.number=o,this.locale=u,this.currency=c,this.minFractionDigits=m,this.maxFractionDigits=x};Ns.parse=function(o,u){if(o.length!==3)return u.error("Expected two arguments.");var c=u.parse(o[1],1,tr);if(!c)return null;var m=o[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,Xr)))return null;var E=null;if(m.currency&&!(E=u.parse(m.currency,1,Xr)))return null;var A=null;if(m["min-fraction-digits"]&&!(A=u.parse(m["min-fraction-digits"],1,tr)))return null;var R=null;return m["max-fraction-digits"]&&!(R=u.parse(m["max-fraction-digits"],1,tr))?null:new Ns(c,x,E,A,R)},Ns.prototype.evaluate=function(o){return new Intl.NumberFormat(this.locale?this.locale.evaluate(o):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(o):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(o):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(o):void 0}).format(this.number.evaluate(o))},Ns.prototype.eachChild=function(o){o(this.number),this.locale&&o(this.locale),this.currency&&o(this.currency),this.minFractionDigits&&o(this.minFractionDigits),this.maxFractionDigits&&o(this.maxFractionDigits)},Ns.prototype.outputDefined=function(){return!1},Ns.prototype.serialize=function(){var o={};return this.locale&&(o.locale=this.locale.serialize()),this.currency&&(o.currency=this.currency.serialize()),this.minFractionDigits&&(o["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(o["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),o]};var nl=function(o){this.type=tr,this.input=o};nl.parse=function(o,u){if(o.length!==2)return u.error("Expected 1 argument, but found "+(o.length-1)+" instead.");var c=u.parse(o[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 "+Ei(c.type)+" instead."):new nl(c):null},nl.prototype.evaluate=function(o){var u=this.input.evaluate(o);if(typeof u=="string"||Array.isArray(u))return u.length;throw new na("Expected value to be of type string or array, but found "+Ei(Ma(u))+" instead.")},nl.prototype.eachChild=function(o){o(this.input)},nl.prototype.outputDefined=function(){return!1},nl.prototype.serialize=function(){var o=["length"];return this.eachChild(function(u){o.push(u.serialize())}),o};var gu={"==":ou,"!=":mu,">":Va,"<":Cf,">=":Rf,"<=":vh,array:ca,at:wl,boolean:ca,case:Nu,coalesce:Tl,collator:Qt,format:is,image:qo,in:ui,"index-of":tl,interpolate:Qo,"interpolate-hcl":Qo,"interpolate-lab":Qo,length:nl,let:Ks,literal:ka,match:Fs,number:ca,"number-format":Ns,object:ca,slice:rl,step:Bs,string:ca,"to-boolean":ms,"to-color":ms,"to-number":ms,"to-string":ms,var:Bu,within:Ko};function Cl(o,u){var c=u[0],m=u[1],x=u[2],E=u[3];c=c.evaluate(o),m=m.evaluate(o),x=x.evaluate(o);var A=E?E.evaluate(o):1,R=Gl(c,m,x,A);if(R)throw new na(R);return new Ai(c/255*A,m/255*A,x/255*A,A)}function mh(o,u){return o in u}function _c(o,u){var c=u[o];return c===void 0?null:c}function ua(o){return{type:o}}function xc(o){return{result:"success",value:o}}function il(o){return{result:"error",value:o}}function Rl(o){return o["property-type"]==="data-driven"||o["property-type"]==="cross-faded-data-driven"}function gh(o){return!!o.expression&&o.expression.parameters.indexOf("zoom")>-1}function qc(o){return!!o.expression&&o.expression.interpolated}function ha(o){return o instanceof Number?"number":o instanceof String?"string":o instanceof Boolean?"boolean":Array.isArray(o)?"array":o===null?"null":typeof o}function Ml(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}function op(o){return o}function al(o,u,c){return o!==void 0?o:u!==void 0?u:c!==void 0?c:void 0}function Kc(o,u,c,m,x){return al(typeof c===x?m[c]:void 0,o.default,u.default)}function Qc(o,u,c){if(ha(c)!=="number")return al(o.default,u.default);var m=o.stops.length;if(m===1||c<=o.stops[0][0])return o.stops[0][1];if(c>=o.stops[m-1][0])return o.stops[m-1][1];var x=$c(o.stops.map(function(E){return E[0]}),c);return o.stops[x][1]}function Mf(o,u,c){var m=o.base!==void 0?o.base:1;if(ha(c)!=="number")return al(o.default,u.default);var x=o.stops.length;if(x===1||c<=o.stops[0][0])return o.stops[0][1];if(c>=o.stops[x-1][0])return o.stops[x-1][1];var E=$c(o.stops.map(function(K){return K[0]}),c),A=function(K,le,ve,ze){var I=ze-ve,ht=K-ve;return I===0?0:le===1?ht/I:(Math.pow(le,ht)-1)/(Math.pow(le,I)-1)}(c,m,o.stops[E][0],o.stops[E+1][0]),R=o.stops[E][1],L=o.stops[E+1][1],V=Al[u.type]||op;if(o.colorSpace&&o.colorSpace!=="rgb"){var Y=ip[o.colorSpace];V=function(K,le){return Y.reverse(Y.interpolate(Y.forward(K),Y.forward(le),A))}}return typeof R.evaluate=="function"?{evaluate:function(){for(var K=[],le=arguments.length;le--;)K[le]=arguments[le];var ve=R.evaluate.apply(void 0,K),ze=L.evaluate.apply(void 0,K);if(ve!==void 0&&ze!==void 0)return V(ve,ze,A)}}:V(R,L,A)}function ol(o,u,c){return u.type==="color"?c=Ai.parse(c):u.type==="formatted"?c=fa.fromString(c.toString()):u.type==="resolvedImage"?c=Ra.fromString(c.toString()):ha(c)===u.type||u.type==="enum"&&u.values[c]||(c=void 0),al(c,o.default,u.default)}Ji.register(gu,{error:[{kind:"error"},[Xr],function(o,u){throw new na(u[0].evaluate(o))}],typeof:[Xr,[ln],function(o,u){return Ei(Ma(u[0].evaluate(o)))}],"to-rgba":[Li(tr,4),[jr],function(o,u){return u[0].evaluate(o).toArray()}],rgb:[jr,[tr,tr,tr],Cl],rgba:[jr,[tr,tr,tr,tr],Cl],has:{type:zr,overloads:[[[Xr],function(o,u){return mh(u[0].evaluate(o),o.properties())}],[[Xr,Jn],function(o,u){var c=u[1];return mh(u[0].evaluate(o),c.evaluate(o))}]]},get:{type:ln,overloads:[[[Xr],function(o,u){return _c(u[0].evaluate(o),o.properties())}],[[Xr,Jn],function(o,u){var c=u[1];return _c(u[0].evaluate(o),c.evaluate(o))}]]},"feature-state":[ln,[Xr],function(o,u){return _c(u[0].evaluate(o),o.featureState||{})}],properties:[Jn,[],function(o){return o.properties()}],"geometry-type":[Xr,[],function(o){return o.geometryType()}],id:[ln,[],function(o){return o.id()}],zoom:[tr,[],function(o){return o.globals.zoom}],"heatmap-density":[tr,[],function(o){return o.globals.heatmapDensity||0}],"line-progress":[tr,[],function(o){return o.globals.lineProgress||0}],accumulated:[ln,[],function(o){return o.globals.accumulated===void 0?null:o.globals.accumulated}],"+":[tr,ua(tr),function(o,u){for(var c=0,m=0,x=u;m<x.length;m+=1)c+=x[m].evaluate(o);return c}],"*":[tr,ua(tr),function(o,u){for(var c=1,m=0,x=u;m<x.length;m+=1)c*=x[m].evaluate(o);return c}],"-":{type:tr,overloads:[[[tr,tr],function(o,u){var c=u[1];return u[0].evaluate(o)-c.evaluate(o)}],[[tr],function(o,u){return-u[0].evaluate(o)}]]},"/":[tr,[tr,tr],function(o,u){var c=u[1];return u[0].evaluate(o)/c.evaluate(o)}],"%":[tr,[tr,tr],function(o,u){var c=u[1];return u[0].evaluate(o)%c.evaluate(o)}],ln2:[tr,[],function(){return Math.LN2}],pi:[tr,[],function(){return Math.PI}],e:[tr,[],function(){return Math.E}],"^":[tr,[tr,tr],function(o,u){var c=u[1];return Math.pow(u[0].evaluate(o),c.evaluate(o))}],sqrt:[tr,[tr],function(o,u){return Math.sqrt(u[0].evaluate(o))}],log10:[tr,[tr],function(o,u){return Math.log(u[0].evaluate(o))/Math.LN10}],ln:[tr,[tr],function(o,u){return Math.log(u[0].evaluate(o))}],log2:[tr,[tr],function(o,u){return Math.log(u[0].evaluate(o))/Math.LN2}],sin:[tr,[tr],function(o,u){return Math.sin(u[0].evaluate(o))}],cos:[tr,[tr],function(o,u){return Math.cos(u[0].evaluate(o))}],tan:[tr,[tr],function(o,u){return Math.tan(u[0].evaluate(o))}],asin:[tr,[tr],function(o,u){return Math.asin(u[0].evaluate(o))}],acos:[tr,[tr],function(o,u){return Math.acos(u[0].evaluate(o))}],atan:[tr,[tr],function(o,u){return Math.atan(u[0].evaluate(o))}],min:[tr,ua(tr),function(o,u){return Math.min.apply(Math,u.map(function(c){return c.evaluate(o)}))}],max:[tr,ua(tr),function(o,u){return Math.max.apply(Math,u.map(function(c){return c.evaluate(o)}))}],abs:[tr,[tr],function(o,u){return Math.abs(u[0].evaluate(o))}],round:[tr,[tr],function(o,u){var c=u[0].evaluate(o);return c<0?-Math.round(-c):Math.round(c)}],floor:[tr,[tr],function(o,u){return Math.floor(u[0].evaluate(o))}],ceil:[tr,[tr],function(o,u){return Math.ceil(u[0].evaluate(o))}],"filter-==":[zr,[Xr,ln],function(o,u){var c=u[0],m=u[1];return o.properties()[c.value]===m.value}],"filter-id-==":[zr,[ln],function(o,u){var c=u[0];return o.id()===c.value}],"filter-type-==":[zr,[Xr],function(o,u){var c=u[0];return o.geometryType()===c.value}],"filter-<":[zr,[Xr,ln],function(o,u){var c=u[0],m=u[1],x=o.properties()[c.value],E=m.value;return typeof x==typeof E&&x<E}],"filter-id-<":[zr,[ln],function(o,u){var c=u[0],m=o.id(),x=c.value;return typeof m==typeof x&&m<x}],"filter->":[zr,[Xr,ln],function(o,u){var c=u[0],m=u[1],x=o.properties()[c.value],E=m.value;return typeof x==typeof E&&x>E}],"filter-id->":[zr,[ln],function(o,u){var c=u[0],m=o.id(),x=c.value;return typeof m==typeof x&&m>x}],"filter-<=":[zr,[Xr,ln],function(o,u){var c=u[0],m=u[1],x=o.properties()[c.value],E=m.value;return typeof x==typeof E&&x<=E}],"filter-id-<=":[zr,[ln],function(o,u){var c=u[0],m=o.id(),x=c.value;return typeof m==typeof x&&m<=x}],"filter->=":[zr,[Xr,ln],function(o,u){var c=u[0],m=u[1],x=o.properties()[c.value],E=m.value;return typeof x==typeof E&&x>=E}],"filter-id->=":[zr,[ln],function(o,u){var c=u[0],m=o.id(),x=c.value;return typeof m==typeof x&&m>=x}],"filter-has":[zr,[ln],function(o,u){return u[0].value in o.properties()}],"filter-has-id":[zr,[],function(o){return o.id()!==null&&o.id()!==void 0}],"filter-type-in":[zr,[Li(Xr)],function(o,u){return u[0].value.indexOf(o.geometryType())>=0}],"filter-id-in":[zr,[Li(ln)],function(o,u){return u[0].value.indexOf(o.id())>=0}],"filter-in-small":[zr,[Xr,Li(ln)],function(o,u){var c=u[0];return u[1].value.indexOf(o.properties()[c.value])>=0}],"filter-in-large":[zr,[Xr,Li(ln)],function(o,u){var c=u[0],m=u[1];return function(x,E,A,R){for(;A<=R;){var L=A+R>>1;if(E[L]===x)return!0;E[L]>x?R=L-1:A=L+1}return!1}(o.properties()[c.value],m.value,0,m.value.length-1)}],all:{type:zr,overloads:[[[zr,zr],function(o,u){var c=u[1];return u[0].evaluate(o)&&c.evaluate(o)}],[ua(zr),function(o,u){for(var c=0,m=u;c<m.length;c+=1)if(!m[c].evaluate(o))return!1;return!0}]]},any:{type:zr,overloads:[[[zr,zr],function(o,u){var c=u[1];return u[0].evaluate(o)||c.evaluate(o)}],[ua(zr),function(o,u){for(var c=0,m=u;c<m.length;c+=1)if(m[c].evaluate(o))return!0;return!1}]]},"!":[zr,[zr],function(o,u){return!u[0].evaluate(o)}],"is-supported-script":[zr,[Xr],function(o,u){var c=o.globals&&o.globals.isSupportedScript;return!c||c(u[0].evaluate(o))}],upcase:[Xr,[Xr],function(o,u){return u[0].evaluate(o).toUpperCase()}],downcase:[Xr,[Xr],function(o,u){return u[0].evaluate(o).toLowerCase()}],concat:[Xr,ua(ln),function(o,u){return u.map(function(c){return vi(c.evaluate(o))}).join("")}],"resolved-locale":[Xr,[hi],function(o,u){return u[0].evaluate(o).resolvedLocale()}]});var $l=function(o,u){this.expression=o,this._warningHistory={},this._evaluator=new Sa,this._defaultValue=u?function(c){return c.type==="color"&&Ml(c.default)?new Ai(0,0,0,0):c.type==="color"?Ai.parse(c.default)||null:c.default===void 0?null:c.default}(u):null,this._enumValues=u&&u.type==="enum"?u.values:null};function Uu(o){return Array.isArray(o)&&o.length>0&&typeof o[0]=="string"&&o[0]in gu}function Jc(o,u){var c=new Ju(gu,[],u?function(x){var E={color:jr,string:Xr,number:tr,enum:Xr,boolean:zr,formatted:Vi,resolvedImage:ci};return x.type==="array"?Li(E[x.value]||ln,x.length):E[x.type]}(u):void 0),m=c.parse(o,void 0,void 0,void 0,u&&u.type==="string"?{typeAnnotation:"coerce"}:void 0);return m?xc(new $l(m,u)):il(c.errors)}$l.prototype.evaluateWithoutErrorHandling=function(o,u,c,m,x,E){return this._evaluator.globals=o,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)},$l.prototype.evaluate=function(o,u,c,m,x,E){this._evaluator.globals=o,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 na("Expected value to be one of "+Object.keys(this._enumValues).map(function(R){return JSON.stringify(R)}).join(", ")+", but found "+JSON.stringify(A)+" instead.");return A}catch(R){return this._warningHistory[R.message]||(this._warningHistory[R.message]=!0,typeof console!="undefined"&&console.warn(R.message)),this._defaultValue}};var bc=function(o,u){this.kind=o,this._styleExpression=u,this.isStateDependent=o!=="constant"&&!Sl(u.expression)};bc.prototype.evaluateWithoutErrorHandling=function(o,u,c,m,x,E){return this._styleExpression.evaluateWithoutErrorHandling(o,u,c,m,x,E)},bc.prototype.evaluate=function(o,u,c,m,x,E){return this._styleExpression.evaluate(o,u,c,m,x,E)};var Yl=function(o,u,c,m){this.kind=o,this.zoomStops=c,this._styleExpression=u,this.isStateDependent=o!=="camera"&&!Sl(u.expression),this.interpolationType=m};function yh(o,u){if((o=Jc(o,u)).result==="error")return o;var c=o.value.expression,m=El(c);if(!m&&!Rl(u))return il([new yr("","data expressions not supported")]);var x=Lu(c,["zoom"]);if(!x&&!gh(u))return il([new yr("","zoom expressions not supported")]);var E=function A(R){var L=null;if(R instanceof Ks)L=A(R.result);else if(R instanceof Tl)for(var V=0,Y=R.args;V<Y.length&&!(L=A(Y[V]));V+=1);else(R instanceof Bs||R instanceof Qo)&&R.input instanceof Ji&&R.input.name==="zoom"&&(L=R);return L instanceof yr||R.eachChild(function(K){var le=A(K);le instanceof yr?L=le:!L&&le?L=new yr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):L&&le&&L!==le&&(L=new yr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),L}(c);return E||x?E instanceof yr?il([E]):E instanceof Qo&&!qc(u)?il([new yr("",'"interpolate" expressions cannot be used with this property')]):xc(E?new Yl(m?"camera":"composite",o.value,E.labels,E instanceof Qo?E.interpolation:void 0):new bc(m?"constant":"source",o.value)):il([new yr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Yl.prototype.evaluateWithoutErrorHandling=function(o,u,c,m,x,E){return this._styleExpression.evaluateWithoutErrorHandling(o,u,c,m,x,E)},Yl.prototype.evaluate=function(o,u,c,m,x,E){return this._styleExpression.evaluate(o,u,c,m,x,E)},Yl.prototype.interpolationFactor=function(o,u,c){return this.interpolationType?Qo.interpolationFactor(this.interpolationType,o,u,c):0};var Ec=function(o,u){this._parameters=o,this._specification=u,et(this,function c(m,x){var E,A,R,L=x.type==="color",V=m.stops&&typeof m.stops[0][0]=="object",Y=V||!(V||m.property!==void 0),K=m.type||(qc(x)?"exponential":"interval");if(L&&((m=et({},m)).stops&&(m.stops=m.stops.map(function(vn){return[vn[0],Ai.parse(vn[1])]})),m.default=Ai.parse(m.default?m.default:x.default)),m.colorSpace&&m.colorSpace!=="rgb"&&!ip[m.colorSpace])throw new Error("Unknown color space: "+m.colorSpace);if(K==="exponential")E=Mf;else if(K==="interval")E=Qc;else if(K==="categorical"){E=Kc,A=Object.create(null);for(var le=0,ve=m.stops;le<ve.length;le+=1){var ze=ve[le];A[ze[0]]=ze[1]}R=typeof m.stops[0][0]}else{if(K!=="identity")throw new Error('Unknown function type "'+K+'"');E=ol}if(V){for(var I={},ht=[],Je=0;Je<m.stops.length;Je++){var wt=m.stops[Je],Bt=wt[0].zoom;I[Bt]===void 0&&(I[Bt]={zoom:Bt,type:m.type,property:m.property,default:m.default,stops:[]},ht.push(Bt)),I[Bt].stops.push([wt[0].value,wt[1]])}for(var nr=[],or=0,mr=ht;or<mr.length;or+=1){var Zr=mr[or];nr.push([I[Zr].zoom,c(I[Zr],x)])}var qr={name:"linear"};return{kind:"composite",interpolationType:qr,interpolationFactor:Qo.interpolationFactor.bind(void 0,qr),zoomStops:nr.map(function(vn){return vn[0]}),evaluate:function(vn,Zn){var mn=vn.zoom;return Mf({stops:nr,base:m.base},x,mn).evaluate(mn,Zn)}}}if(Y){var Nn=K==="exponential"?{name:"exponential",base:m.base!==void 0?m.base:1}:null;return{kind:"camera",interpolationType:Nn,interpolationFactor:Qo.interpolationFactor.bind(void 0,Nn),zoomStops:m.stops.map(function(vn){return vn[0]}),evaluate:function(vn){return E(m,x,vn.zoom,A,R)}}}return{kind:"source",evaluate:function(vn,Zn){var mn=Zn&&Zn.properties?Zn.properties[m.property]:void 0;return mn===void 0?al(m.default,x.default):E(m,x,mn,A,R)}}}(this._parameters,this._specification))};function Us(o){var u=o.key,c=o.value,m=o.valueSpec||{},x=o.objectElementValidators||{},E=o.style,A=o.styleSpec,R=[],L=ha(c);if(L!=="object")return[new Q(u,c,"object expected, "+L+" found")];for(var V in c){var Y=V.split(".")[0],K=m[Y]||m["*"],le=void 0;if(x[Y])le=x[Y];else if(m[Y])le=Bi;else if(x["*"])le=x["*"];else{if(!m["*"]){R.push(new Q(u,c[V],'unknown property "'+V+'"'));continue}le=Bi}R=R.concat(le({key:(u&&u+".")+V,value:c[V],valueSpec:K,style:E,styleSpec:A,object:c,objectKey:V},c))}for(var ve in m)x[ve]||m[ve].required&&m[ve].default===void 0&&c[ve]===void 0&&R.push(new Q(u,c,'missing required property "'+ve+'"'));return R}function _h(o){var u=o.value,c=o.valueSpec,m=o.style,x=o.styleSpec,E=o.key,A=o.arrayElementValidator||Bi;if(ha(u)!=="array")return[new Q(E,u,"array expected, "+ha(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 R={type:c.value,values:c.values};x.$version<7&&(R.function=c.function),ha(c.value)==="object"&&(R=c.value);for(var L=[],V=0;V<u.length;V++)L=L.concat(A({array:u,arrayIndex:V,value:u[V],valueSpec:R,style:m,styleSpec:x,key:E+"["+V+"]"}));return L}function ef(o){var u=o.key,c=o.value,m=o.valueSpec,x=ha(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 Sc(o){var u,c,m,x=o.valueSpec,E=Ae(o.value.type),A={},R=E!=="categorical"&&o.value.property===void 0,L=!R,V=ha(o.value.stops)==="array"&&ha(o.value.stops[0])==="array"&&ha(o.value.stops[0][0])==="object",Y=Us({key:o.key,value:o.value,valueSpec:o.styleSpec.function,style:o.style,styleSpec:o.styleSpec,objectElementValidators:{stops:function(ve){if(E==="identity")return[new Q(ve.key,ve.value,'identity function may not have a "stops" property')];var ze=[],I=ve.value;return ze=ze.concat(_h({key:ve.key,value:I,valueSpec:ve.valueSpec,style:ve.style,styleSpec:ve.styleSpec,arrayElementValidator:K})),ha(I)==="array"&&I.length===0&&ze.push(new Q(ve.key,I,"array must have at least one stop")),ze},default:function(ve){return Bi({key:ve.key,value:ve.value,valueSpec:x,style:ve.style,styleSpec:ve.styleSpec})}}});return E==="identity"&&R&&Y.push(new Q(o.key,o.value,'missing required property "property"')),E==="identity"||o.value.stops||Y.push(new Q(o.key,o.value,'missing required property "stops"')),E==="exponential"&&o.valueSpec.expression&&!qc(o.valueSpec)&&Y.push(new Q(o.key,o.value,"exponential functions not supported")),o.styleSpec.$version>=8&&(L&&!Rl(o.valueSpec)?Y.push(new Q(o.key,o.value,"property functions not supported")):R&&!gh(o.valueSpec)&&Y.push(new Q(o.key,o.value,"zoom functions not supported"))),E!=="categorical"&&!V||o.value.property!==void 0||Y.push(new Q(o.key,o.value,'"property" property is required')),Y;function K(ve){var ze=[],I=ve.value,ht=ve.key;if(ha(I)!=="array")return[new Q(ht,I,"array expected, "+ha(I)+" found")];if(I.length!==2)return[new Q(ht,I,"array length 2 expected, length "+I.length+" found")];if(V){if(ha(I[0])!=="object")return[new Q(ht,I,"object expected, "+ha(I[0])+" found")];if(I[0].zoom===void 0)return[new Q(ht,I,"object stop key must have zoom")];if(I[0].value===void 0)return[new Q(ht,I,"object stop key must have value")];if(m&&m>Ae(I[0].zoom))return[new Q(ht,I[0].zoom,"stop zoom values must appear in ascending order")];Ae(I[0].zoom)!==m&&(m=Ae(I[0].zoom),c=void 0,A={}),ze=ze.concat(Us({key:ht+"[0]",value:I[0],valueSpec:{zoom:{}},style:ve.style,styleSpec:ve.styleSpec,objectElementValidators:{zoom:ef,value:le}}))}else ze=ze.concat(le({key:ht+"[0]",value:I[0],valueSpec:{},style:ve.style,styleSpec:ve.styleSpec},I));return Uu($t(I[1]))?ze.concat([new Q(ht+"[1]",I[1],"expressions are not allowed in function stops.")]):ze.concat(Bi({key:ht+"[1]",value:I[1],valueSpec:x,style:ve.style,styleSpec:ve.styleSpec}))}function le(ve,ze){var I=ha(ve.value),ht=Ae(ve.value),Je=ve.value!==null?ve.value:ze;if(u){if(I!==u)return[new Q(ve.key,Je,I+" stop domain type must match previous stop domain type "+u)]}else u=I;if(I!=="number"&&I!=="string"&&I!=="boolean")return[new Q(ve.key,Je,"stop domain value must be a number, string, or boolean")];if(I!=="number"&&E!=="categorical"){var wt="number expected, "+I+" found";return Rl(x)&&E===void 0&&(wt+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Q(ve.key,Je,wt)]}return E!=="categorical"||I!=="number"||isFinite(ht)&&Math.floor(ht)===ht?E!=="categorical"&&I==="number"&&c!==void 0&&ht<c?[new Q(ve.key,Je,"stop domain values must appear in ascending order")]:(c=ht,E==="categorical"&&ht in A?[new Q(ve.key,Je,"stop domain values must be unique")]:(A[ht]=!0,[])):[new Q(ve.key,Je,"integer expected, found "+ht)]}}function Il(o){var u=(o.expressionContext==="property"?yh:Jc)($t(o.value),o.valueSpec);if(u.result==="error")return u.value.map(function(m){return new Q(""+o.key+m.key,o.value,m.message)});var c=u.value.expression||u.value._styleExpression.expression;if(o.expressionContext==="property"&&o.propertyKey==="text-font"&&!c.outputDefined())return[new Q(o.key,o.value,'Invalid data expression for "'+o.propertyKey+'". Output values must be contained as literals within the expression.')];if(o.expressionContext==="property"&&o.propertyType==="layout"&&!Sl(c))return[new Q(o.key,o.value,'"feature-state" data expressions are not supported with layout properties.')];if(o.expressionContext==="filter"&&!Sl(c))return[new Q(o.key,o.value,'"feature-state" data expressions are not supported with filters.')];if(o.expressionContext&&o.expressionContext.indexOf("cluster")===0){if(!Lu(c,["zoom","feature-state"]))return[new Q(o.key,o.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(o.expressionContext==="cluster-initial"&&!El(c))return[new Q(o.key,o.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function zu(o){var u=o.key,c=o.value,m=o.valueSpec,x=[];return Array.isArray(m.values)?m.values.indexOf(Ae(c))===-1&&x.push(new Q(u,c,"expected one of ["+m.values.join(", ")+"], "+JSON.stringify(c)+" found")):Object.keys(m.values).indexOf(Ae(c))===-1&&x.push(new Q(u,c,"expected one of ["+Object.keys(m.values).join(", ")+"], "+JSON.stringify(c)+" found")),x}function ql(o){if(o===!0||o===!1)return!0;if(!Array.isArray(o)||o.length===0)return!1;switch(o[0]){case"has":return o.length>=2&&o[1]!=="$id"&&o[1]!=="$type";case"in":return o.length>=3&&(typeof o[1]!="string"||Array.isArray(o[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return o.length!==3||Array.isArray(o[1])||Array.isArray(o[2]);case"any":case"all":for(var u=0,c=o.slice(1);u<c.length;u+=1){var m=c[u];if(!ql(m)&&typeof m!="boolean")return!1}return!0;default:return!0}}Ec.deserialize=function(o){return new Ec(o._parameters,o._specification)},Ec.serialize=function(o){return{_parameters:o._parameters,_specification:o._specification}};var If={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function sl(o){if(o==null)return{filter:function(){return!0},needGeometry:!1};ql(o)||(o=bh(o));var u=Jc(o,If);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}(o)}}function xh(o,u){return o<u?-1:o>u?1:0}function bh(o){if(!o)return!0;var u,c=o[0];return o.length<=1?c!=="any":c==="=="?Eh(o[1],o[2],"=="):c==="!="?ja(Eh(o[1],o[2],"==")):c==="<"||c===">"||c==="<="||c===">="?Eh(o[1],o[2],c):c==="any"?(u=o.slice(1),["any"].concat(u.map(bh))):c==="all"?["all"].concat(o.slice(1).map(bh)):c==="none"?["all"].concat(o.slice(1).map(bh).map(ja)):c==="in"?Pf(o[1],o.slice(2)):c==="!in"?ja(Pf(o[1],o.slice(2))):c==="has"?sp(o[1]):c==="!has"?ja(sp(o[1])):c!=="within"||o}function Eh(o,u,c){switch(o){case"$type":return["filter-type-"+c,u];case"$id":return["filter-id-"+c,u];default:return["filter-"+c,o,u]}}function Pf(o,u){if(u.length===0)return!1;switch(o){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",o,["literal",u.sort(xh)]]:["filter-in-small",o,["literal",u]]}}function sp(o){switch(o){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",o]}}function ja(o){return["!",o]}function up(o){return ql($t(o.value))?Il(et({},o,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function u(c){var m=c.value,x=c.key;if(ha(m)!=="array")return[new Q(x,m,"array expected, "+ha(m)+" found")];var E,A=c.styleSpec,R=[];if(m.length<1)return[new Q(x,m,"filter array must have at least 1 element")];switch(R=R.concat(zu({key:x+"[0]",value:m[0],valueSpec:A.filter_operator,style:c.style,styleSpec:c.styleSpec})),Ae(m[0])){case"<":case"<=":case">":case">=":m.length>=2&&Ae(m[1])==="$type"&&R.push(new Q(x,m,'"$type" cannot be use with operator "'+m[0]+'"'));case"==":case"!=":m.length!==3&&R.push(new Q(x,m,'filter array for operator "'+m[0]+'" must have 3 elements'));case"in":case"!in":m.length>=2&&(E=ha(m[1]))!=="string"&&R.push(new Q(x+"[1]",m[1],"string expected, "+E+" found"));for(var L=2;L<m.length;L++)E=ha(m[L]),Ae(m[1])==="$type"?R=R.concat(zu({key:x+"["+L+"]",value:m[L],valueSpec:A.geometry_type,style:c.style,styleSpec:c.styleSpec})):E!=="string"&&E!=="number"&&E!=="boolean"&&R.push(new Q(x+"["+L+"]",m[L],"string, number, or boolean expected, "+E+" found"));break;case"any":case"all":case"none":for(var V=1;V<m.length;V++)R=R.concat(u({key:x+"["+V+"]",value:m[V],style:c.style,styleSpec:c.styleSpec}));break;case"has":case"!has":E=ha(m[1]),m.length!==2?R.push(new Q(x,m,'filter array for "'+m[0]+'" operator must have 2 elements')):E!=="string"&&R.push(new Q(x+"[1]",m[1],"string expected, "+E+" found"));break;case"within":E=ha(m[1]),m.length!==2?R.push(new Q(x,m,'filter array for "'+m[0]+'" operator must have 2 elements')):E!=="object"&&R.push(new Q(x+"[1]",m[1],"object expected, "+E+" found"))}return R}(o)}function Of(o,u){var c=o.key,m=o.style,x=o.styleSpec,E=o.value,A=o.objectKey,R=x[u+"_"+o.layerType];if(!R)return[];var L=A.match(/^(.*)-transition$/);if(u==="paint"&&L&&R[L[1]]&&R[L[1]].transition)return Bi({key:c,value:E,valueSpec:x.transition,style:m,styleSpec:x});var V,Y=o.valueSpec||R[A];if(!Y)return[new Q(c,E,'unknown property "'+A+'"')];if(ha(E)==="string"&&Rl(Y)&&!Y.tokens&&(V=/^{([^}]+)}$/.exec(E)))return[new Q(c,E,'"'+A+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(V[1])+" }`.")];var K=[];return o.layerType==="symbol"&&(A==="text-field"&&m&&!m.glyphs&&K.push(new Q(c,E,'use of "text-field" requires a style "glyphs" property')),A==="text-font"&&Ml($t(E))&&Ae(E.type)==="identity"&&K.push(new Q(c,E,'"text-font" does not support identity functions'))),K.concat(Bi({key:o.key,value:E,valueSpec:Y,style:m,styleSpec:x,expressionContext:"property",propertyType:u,propertyKey:A}))}function lp(o){return Of(o,"paint")}function Kl(o){return Of(o,"layout")}function cp(o){var u=[],c=o.value,m=o.key,x=o.style,E=o.styleSpec;c.type||c.ref||u.push(new Q(m,c,'either "type" or "ref" is required'));var A,R=Ae(c.type),L=Ae(c.ref);if(c.id)for(var V=Ae(c.id),Y=0;Y<o.arrayIndex;Y++){var K=x.layers[Y];Ae(K.id)===V&&u.push(new Q(m,c.id,'duplicate layer id "'+c.id+'", previously used at line '+K.id.__line__))}if("ref"in c)["type","source","source-layer","filter","layout"].forEach(function(ze){ze in c&&u.push(new Q(m,c[ze],'"'+ze+'" is prohibited for ref layers'))}),x.layers.forEach(function(ze){Ae(ze.id)===L&&(A=ze)}),A?A.ref?u.push(new Q(m,c.ref,"ref cannot reference another ref layer")):R=Ae(A.type):u.push(new Q(m,c.ref,'ref layer "'+L+'" not found'));else if(R!=="background")if(c.source){var le=x.sources&&x.sources[c.source],ve=le&&Ae(le.type);le?ve==="vector"&&R==="raster"?u.push(new Q(m,c.source,'layer "'+c.id+'" requires a raster source')):ve==="raster"&&R!=="raster"?u.push(new Q(m,c.source,'layer "'+c.id+'" requires a vector source')):ve!=="vector"||c["source-layer"]?ve==="raster-dem"&&R!=="hillshade"?u.push(new Q(m,c.source,"raster-dem source can only be used with layer type 'hillshade'.")):R!=="line"||!c.paint||!c.paint["line-gradient"]||ve==="geojson"&&le.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(Us({key:m,value:c,valueSpec:E.layer,style:o.style,styleSpec:o.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Bi({key:m+".type",value:c.type,valueSpec:E.layer.type,style:o.style,styleSpec:o.styleSpec,object:c,objectKey:"type"})},filter:up,layout:function(ze){return Us({layer:c,key:ze.key,value:ze.value,style:ze.style,styleSpec:ze.styleSpec,objectElementValidators:{"*":function(I){return Kl(et({layerType:R},I))}}})},paint:function(ze){return Us({layer:c,key:ze.key,value:ze.value,style:ze.style,styleSpec:ze.styleSpec,objectElementValidators:{"*":function(I){return lp(et({layerType:R},I))}}})}}}))}function Zu(o){var u=o.value,c=o.key,m=ha(u);return m!=="string"?[new Q(c,u,"string expected, "+m+" found")]:[]}var ma={promoteId:function(o){var u=o.key,c=o.value;if(ha(c)==="string")return Zu({key:u,value:c});var m=[];for(var x in c)m.push.apply(m,Zu({key:u+"."+x,value:c[x]}));return m}};function Ql(o){var u=o.value,c=o.key,m=o.styleSpec,x=o.style;if(!u.type)return[new Q(c,u,'"type" is required')];var E,A=Ae(u.type);switch(A){case"vector":case"raster":case"raster-dem":return Us({key:c,value:u,valueSpec:m["source_"+A.replace("-","_")],style:o.style,styleSpec:m,objectElementValidators:ma});case"geojson":if(E=Us({key:c,value:u,valueSpec:m.source_geojson,style:x,styleSpec:m,objectElementValidators:ma}),u.cluster)for(var R in u.clusterProperties){var L=u.clusterProperties[R],V=L[0],Y=typeof V=="string"?[V,["accumulated"],["get",R]]:V;E.push.apply(E,Il({key:c+"."+R+".map",value:L[1],expressionContext:"cluster-map"})),E.push.apply(E,Il({key:c+"."+R+".reduce",value:Y,expressionContext:"cluster-reduce"}))}return E;case"video":return Us({key:c,value:u,valueSpec:m.source_video,style:x,styleSpec:m});case"image":return Us({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 zu({key:c+".type",value:u.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:x,styleSpec:m})}}function Vu(o){var u=o.value,c=o.styleSpec,m=c.light,x=o.style,E=[],A=ha(u);if(u===void 0)return E;if(A!=="object")return E.concat([new Q("light",u,"object expected, "+A+" found")]);for(var R in u){var L=R.match(/^(.*)-transition$/);E=E.concat(L&&m[L[1]]&&m[L[1]].transition?Bi({key:R,value:u[R],valueSpec:c.transition,style:x,styleSpec:c}):m[R]?Bi({key:R,value:u[R],valueSpec:m[R],style:x,styleSpec:c}):[new Q(R,u[R],'unknown property "'+R+'"')])}return E}var ul={"*":function(){return[]},array:_h,boolean:function(o){var u=o.value,c=o.key,m=ha(u);return m!=="boolean"?[new Q(c,u,"boolean expected, "+m+" found")]:[]},number:ef,color:function(o){var u=o.key,c=o.value,m=ha(c);return m!=="string"?[new Q(u,c,"color expected, "+m+" found")]:di(c)===null?[new Q(u,c,'color expected, "'+c+'" found')]:[]},constants:Fe,enum:zu,filter:up,function:Sc,layer:cp,object:Us,source:Ql,light:Vu,string:Zu,formatted:function(o){return Zu(o).length===0?[]:Il(o)},resolvedImage:function(o){return Zu(o).length===0?[]:Il(o)}};function Bi(o){var u=o.value,c=o.valueSpec,m=o.styleSpec;return c.expression&&Ml(Ae(u))?Sc(o):c.expression&&Uu($t(u))?Il(o):c.type&&ul[c.type]?ul[c.type](o):Us(et({},o,{valueSpec:c.type?m[c.type]:c}))}function ga(o){var u=o.value,c=o.key,m=Zu(o);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 su(o,u){u===void 0&&(u=j);var c=[];return c=c.concat(Bi({key:"",value:o,valueSpec:u.$root,styleSpec:u,style:o,objectElementValidators:{glyphs:ga,"*":function(){return[]}}})),o.constants&&(c=c.concat(Fe({key:"constants",value:o.constants,style:o,styleSpec:u}))),tf(c)}function tf(o){return[].concat(o).sort(function(u,c){return u.line-c.line})}function rf(o){return function(){for(var u=[],c=arguments.length;c--;)u[c]=arguments[c];return tf(o.apply(this,u))}}su.source=rf(Ql),su.light=rf(Vu),su.layer=rf(cp),su.filter=rf(up),su.paintProperty=rf(lp),su.layoutProperty=rf(Kl);var Qs=su,fp=Qs.light,kf=Qs.paintProperty,Df=Qs.layoutProperty;function Jl(o,u){var c=!1;if(u&&u.length)for(var m=0,x=u;m<x.length;m+=1)o.fire(new Ue(new Error(x[m].message))),c=!0;return c}var Ro=Ha;function Ha(o,u,c){var m=this.cells=[];if(o instanceof ArrayBuffer){this.arrayBuffer=o;var x=new Int32Array(this.arrayBuffer);o=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],R=x[3+E+1];m.push(A===R?null:x.subarray(A,R))}var L=x[3+m.length+1];this.keys=x.subarray(x[3+m.length],L),this.bboxes=x.subarray(L),this.insert=this._insertReadonly}else{this.d=u+2*c;for(var V=0;V<this.d*this.d;V++)m.push([]);this.keys=[],this.bboxes=[]}this.n=u,this.extent=o,this.padding=c,this.scale=u/o,this.uid=0;var Y=c/u*o;this.min=-Y,this.max=o+Y}Ha.prototype.insert=function(o,u,c,m,x){this._forEachCell(u,c,m,x,this._insertCell,this.uid++),this.keys.push(o),this.bboxes.push(u),this.bboxes.push(c),this.bboxes.push(m),this.bboxes.push(x)},Ha.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Ha.prototype._insertCell=function(o,u,c,m,x,E){this.cells[x].push(E)},Ha.prototype.query=function(o,u,c,m,x){var E=this.min,A=this.max;if(o<=E&&u<=E&&A<=c&&A<=m&&!x)return Array.prototype.slice.call(this.keys);var R=[];return this._forEachCell(o,u,c,m,this._queryCell,R,{},x),R},Ha.prototype._queryCell=function(o,u,c,m,x,E,A,R){var L=this.cells[x];if(L!==null)for(var V=this.keys,Y=this.bboxes,K=0;K<L.length;K++){var le=L[K];if(A[le]===void 0){var ve=4*le;(R?R(Y[ve+0],Y[ve+1],Y[ve+2],Y[ve+3]):o<=Y[ve+2]&&u<=Y[ve+3]&&c>=Y[ve+0]&&m>=Y[ve+1])?(A[le]=!0,E.push(V[le])):A[le]=!1}}},Ha.prototype._forEachCell=function(o,u,c,m,x,E,A,R){for(var L=this._convertToCellCoord(o),V=this._convertToCellCoord(u),Y=this._convertToCellCoord(c),K=this._convertToCellCoord(m),le=L;le<=Y;le++)for(var ve=V;ve<=K;ve++){var ze=this.d*ve+le;if((!R||R(this._convertFromCellCoord(le),this._convertFromCellCoord(ve),this._convertFromCellCoord(le+1),this._convertFromCellCoord(ve+1)))&&x.call(this,o,u,c,m,ze,E,A,R))return}},Ha.prototype._convertFromCellCoord=function(o){return(o-this.padding)/this.scale},Ha.prototype._convertToCellCoord=function(o){return Math.max(0,Math.min(this.d-1,Math.floor(o*this.scale)+this.padding))},Ha.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var o=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<o.length;A++){var R=o[A];x[3+A]=E,x.set(R,E),E+=R.length}return x[3+o.length]=E,x.set(this.keys,E),x[3+o.length+1]=E+=this.keys.length,x.set(this.bboxes,E),E+=this.bboxes.length,x.buffer};var nf=ce.ImageData,Ac=ce.ImageBitmap,io={};function xn(o,u,c){c===void 0&&(c={}),Object.defineProperty(u,"_classRegistryKey",{value:o,writeable:!1}),io[o]={klass:u,omit:c.omit||[],shallow:c.shallow||[]}}for(var gs in xn("Object",Object),Ro.serialize=function(o,u){var c=o.toArrayBuffer();return u&&u.push(c),{buffer:c}},Ro.deserialize=function(o){return new Ro(o.buffer)},xn("Grid",Ro),xn("Color",Ai),xn("Error",Error),xn("ResolvedImage",Ra),xn("StylePropertyFunction",Ec),xn("StyleExpression",$l,{omit:["_evaluator"]}),xn("ZoomDependentExpression",Yl),xn("ZoomConstantExpression",bc),xn("CompoundExpression",Ji,{omit:["_evaluate"]}),gu)gu[gs]._classRegistryKey||xn("Expression_"+gs,gu[gs]);function Lf(o){return o&&typeof ArrayBuffer!="undefined"&&(o instanceof ArrayBuffer||o.constructor&&o.constructor.name==="ArrayBuffer")}function Tc(o){return Ac&&o instanceof Ac}function as(o,u){if(o==null||typeof o=="boolean"||typeof o=="number"||typeof o=="string"||o instanceof Boolean||o instanceof Number||o instanceof String||o instanceof Date||o instanceof RegExp)return o;if(Lf(o)||Tc(o))return u&&u.push(o),o;if(ArrayBuffer.isView(o)){var c=o;return u&&u.push(c.buffer),c}if(o instanceof nf)return u&&u.push(o.data.buffer),o;if(Array.isArray(o)){for(var m=[],x=0,E=o;x<E.length;x+=1)m.push(as(E[x],u));return m}if(typeof o=="object"){var A=o.constructor,R=A._classRegistryKey;if(!R)throw new Error("can't serialize object of unregistered class");var L=A.serialize?A.serialize(o,u):{};if(!A.serialize){for(var V in o)if(o.hasOwnProperty(V)&&!(io[R].omit.indexOf(V)>=0)){var Y=o[V];L[V]=io[R].shallow.indexOf(V)>=0?Y:as(Y,u)}o instanceof Error&&(L.message=o.message)}if(L.$name)throw new Error("$name property is reserved for worker serialization logic.");return R!=="Object"&&(L.$name=R),L}throw new Error("can't serialize object of type "+typeof o)}function pa(o){if(o==null||typeof o=="boolean"||typeof o=="number"||typeof o=="string"||o instanceof Boolean||o instanceof Number||o instanceof String||o instanceof Date||o instanceof RegExp||Lf(o)||Tc(o)||ArrayBuffer.isView(o)||o instanceof nf)return o;if(Array.isArray(o))return o.map(pa);if(typeof o=="object"){var u=o.$name||"Object",c=io[u].klass;if(!c)throw new Error("can't deserialize unregistered class "+u);if(c.deserialize)return c.deserialize(o);for(var m=Object.create(c.prototype),x=0,E=Object.keys(o);x<E.length;x+=1){var A=E[x];if(A!=="$name"){var R=o[A];m[A]=io[u].shallow.indexOf(A)>=0?R:pa(R)}}return m}throw new Error("can't deserialize object of type "+typeof o)}var Bf=function(){this.first=!0};Bf.prototype.update=function(o,u){var c=Math.floor(o);return this.first?(this.first=!1,this.lastIntegerZoom=c,this.lastIntegerZoomTime=0,this.lastZoom=o,this.lastFloorZoom=c,!0):(this.lastFloorZoom>c?(this.lastIntegerZoom=c+1,this.lastIntegerZoomTime=u):this.lastFloorZoom<c&&(this.lastIntegerZoom=c,this.lastIntegerZoomTime=u),o!==this.lastZoom&&(this.lastZoom=o,this.lastFloorZoom=c,!0))};var sn={"Latin-1 Supplement":function(o){return o>=128&&o<=255},Arabic:function(o){return o>=1536&&o<=1791},"Arabic Supplement":function(o){return o>=1872&&o<=1919},"Arabic Extended-A":function(o){return o>=2208&&o<=2303},"Hangul Jamo":function(o){return o>=4352&&o<=4607},"Unified Canadian Aboriginal Syllabics":function(o){return o>=5120&&o<=5759},Khmer:function(o){return o>=6016&&o<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(o){return o>=6320&&o<=6399},"General Punctuation":function(o){return o>=8192&&o<=8303},"Letterlike Symbols":function(o){return o>=8448&&o<=8527},"Number Forms":function(o){return o>=8528&&o<=8591},"Miscellaneous Technical":function(o){return o>=8960&&o<=9215},"Control Pictures":function(o){return o>=9216&&o<=9279},"Optical Character Recognition":function(o){return o>=9280&&o<=9311},"Enclosed Alphanumerics":function(o){return o>=9312&&o<=9471},"Geometric Shapes":function(o){return o>=9632&&o<=9727},"Miscellaneous Symbols":function(o){return o>=9728&&o<=9983},"Miscellaneous Symbols and Arrows":function(o){return o>=11008&&o<=11263},"CJK Radicals Supplement":function(o){return o>=11904&&o<=12031},"Kangxi Radicals":function(o){return o>=12032&&o<=12255},"Ideographic Description Characters":function(o){return o>=12272&&o<=12287},"CJK Symbols and Punctuation":function(o){return o>=12288&&o<=12351},Hiragana:function(o){return o>=12352&&o<=12447},Katakana:function(o){return o>=12448&&o<=12543},Bopomofo:function(o){return o>=12544&&o<=12591},"Hangul Compatibility Jamo":function(o){return o>=12592&&o<=12687},Kanbun:function(o){return o>=12688&&o<=12703},"Bopomofo Extended":function(o){return o>=12704&&o<=12735},"CJK Strokes":function(o){return o>=12736&&o<=12783},"Katakana Phonetic Extensions":function(o){return o>=12784&&o<=12799},"Enclosed CJK Letters and Months":function(o){return o>=12800&&o<=13055},"CJK Compatibility":function(o){return o>=13056&&o<=13311},"CJK Unified Ideographs Extension A":function(o){return o>=13312&&o<=19903},"Yijing Hexagram Symbols":function(o){return o>=19904&&o<=19967},"CJK Unified Ideographs":function(o){return o>=19968&&o<=40959},"Yi Syllables":function(o){return o>=40960&&o<=42127},"Yi Radicals":function(o){return o>=42128&&o<=42191},"Hangul Jamo Extended-A":function(o){return o>=43360&&o<=43391},"Hangul Syllables":function(o){return o>=44032&&o<=55215},"Hangul Jamo Extended-B":function(o){return o>=55216&&o<=55295},"Private Use Area":function(o){return o>=57344&&o<=63743},"CJK Compatibility Ideographs":function(o){return o>=63744&&o<=64255},"Arabic Presentation Forms-A":function(o){return o>=64336&&o<=65023},"Vertical Forms":function(o){return o>=65040&&o<=65055},"CJK Compatibility Forms":function(o){return o>=65072&&o<=65103},"Small Form Variants":function(o){return o>=65104&&o<=65135},"Arabic Presentation Forms-B":function(o){return o>=65136&&o<=65279},"Halfwidth and Fullwidth Forms":function(o){return o>=65280&&o<=65519}};function ll(o){for(var u=0,c=o;u<c.length;u+=1)if(af(c[u].charCodeAt(0)))return!0;return!1}function af(o){return!(o!==746&&o!==747&&(o<4352||!(sn["Bopomofo Extended"](o)||sn.Bopomofo(o)||sn["CJK Compatibility Forms"](o)&&!(o>=65097&&o<=65103)||sn["CJK Compatibility Ideographs"](o)||sn["CJK Compatibility"](o)||sn["CJK Radicals Supplement"](o)||sn["CJK Strokes"](o)||!(!sn["CJK Symbols and Punctuation"](o)||o>=12296&&o<=12305||o>=12308&&o<=12319||o===12336)||sn["CJK Unified Ideographs Extension A"](o)||sn["CJK Unified Ideographs"](o)||sn["Enclosed CJK Letters and Months"](o)||sn["Hangul Compatibility Jamo"](o)||sn["Hangul Jamo Extended-A"](o)||sn["Hangul Jamo Extended-B"](o)||sn["Hangul Jamo"](o)||sn["Hangul Syllables"](o)||sn.Hiragana(o)||sn["Ideographic Description Characters"](o)||sn.Kanbun(o)||sn["Kangxi Radicals"](o)||sn["Katakana Phonetic Extensions"](o)||sn.Katakana(o)&&o!==12540||!(!sn["Halfwidth and Fullwidth Forms"](o)||o===65288||o===65289||o===65293||o>=65306&&o<=65310||o===65339||o===65341||o===65343||o>=65371&&o<=65503||o===65507||o>=65512&&o<=65519)||!(!sn["Small Form Variants"](o)||o>=65112&&o<=65118||o>=65123&&o<=65126)||sn["Unified Canadian Aboriginal Syllabics"](o)||sn["Unified Canadian Aboriginal Syllabics Extended"](o)||sn["Vertical Forms"](o)||sn["Yijing Hexagram Symbols"](o)||sn["Yi Syllables"](o)||sn["Yi Radicals"](o))))}function of(o){return!(af(o)||function(u){return!!(sn["Latin-1 Supplement"](u)&&(u===167||u===169||u===174||u===177||u===188||u===189||u===190||u===215||u===247)||sn["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)||sn["Letterlike Symbols"](u)||sn["Number Forms"](u)||sn["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)||sn["Control Pictures"](u)&&u!==9251||sn["Optical Character Recognition"](u)||sn["Enclosed Alphanumerics"](u)||sn["Geometric Shapes"](u)||sn["Miscellaneous Symbols"](u)&&!(u>=9754&&u<=9759)||sn["Miscellaneous Symbols and Arrows"](u)&&(u>=11026&&u<=11055||u>=11088&&u<=11097||u>=11192&&u<=11243)||sn["CJK Symbols and Punctuation"](u)||sn.Katakana(u)||sn["Private Use Area"](u)||sn["CJK Compatibility Forms"](u)||sn["Small Form Variants"](u)||sn["Halfwidth and Fullwidth Forms"](u)||u===8734||u===8756||u===8757||u>=9984&&u<=10087||u>=10102&&u<=10131||u===65532||u===65533)}(o))}function yu(o){return o>=1424&&o<=2303||sn["Arabic Presentation Forms-A"](o)||sn["Arabic Presentation Forms-B"](o)}function zs(o,u){return!(!u&&yu(o)||o>=2304&&o<=3583||o>=3840&&o<=4255||sn.Khmer(o))}function Ff(o){for(var u=0,c=o;u<c.length;u+=1)if(yu(c[u].charCodeAt(0)))return!0;return!1}var Nf=null,ys="unavailable",_u=null,hp=function(o){o&&typeof o=="string"&&o.indexOf("NetworkError")>-1&&(ys="error"),Nf&&Nf(o)};function wc(){Cc.fire(new xe("pluginStateChange",{pluginStatus:ys,pluginURL:_u}))}var Cc=new Qe,Uf=function(){return ys},Js=function(){if(ys!=="deferred"||!_u)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ys="loading",wc(),_u&&Rt({url:_u},function(o){o?hp(o):(ys="loaded",wc())})},Ft={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ys==="loaded"||Ft.applyArabicShaping!=null},isLoading:function(){return ys==="loading"},setState:function(o){ys=o.pluginStatus,_u=o.pluginURL},isParsed:function(){return Ft.applyArabicShaping!=null&&Ft.processBidirectionalText!=null&&Ft.processStyledBidirectionalText!=null},getPluginURL:function(){return _u}},Me=function(o,u){this.zoom=o,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 Bf,this.transition={})};Me.prototype.isSupportedScript=function(o){return function(u,c){for(var m=0,x=u;m<x.length;m+=1)if(!zs(x[m].charCodeAt(0),c))return!1;return!0}(o,Ft.isLoaded())},Me.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Me.prototype.getCrossfadeParameters=function(){var o=this.zoom,u=o-Math.floor(o),c=this.crossFadingFactor();return o>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:u+(1-u)*c}:{fromScale:.5,toScale:1,t:1-(1-c)*u}};var F=function(o,u){this.property=o,this.value=u,this.expression=function(c,m){if(Ml(c))return new Ec(c,m);if(Uu(c)){var x=yh(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=Ai.parse(c)),{kind:"constant",evaluate:function(){return E}}}(u===void 0?o.specification.default:u,o.specification)};F.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},F.prototype.possiblyEvaluate=function(o,u,c){return this.property.possiblyEvaluate(this,o,u,c)};var eu=function(o){this.property=o,this.value=new F(o,void 0)};eu.prototype.transitioned=function(o,u){return new Pl(this.property,this.value,u,Yt({},o.transition,this.transition),o.now)},eu.prototype.untransitioned=function(){return new Pl(this.property,this.value,null,{},0)};var _e=function(o){this._properties=o,this._values=Object.create(o.defaultTransitionablePropertyValues)};_e.prototype.getValue=function(o){return ft(this._values[o].value.value)},_e.prototype.setValue=function(o,u){this._values.hasOwnProperty(o)||(this._values[o]=new eu(this._values[o].property)),this._values[o].value=new F(this._values[o].property,u===null?void 0:ft(u))},_e.prototype.getTransition=function(o){return ft(this._values[o].transition)},_e.prototype.setTransition=function(o,u){this._values.hasOwnProperty(o)||(this._values[o]=new eu(this._values[o].property)),this._values[o].transition=ft(u)||void 0},_e.prototype.serialize=function(){for(var o={},u=0,c=Object.keys(this._values);u<c.length;u+=1){var m=c[u],x=this.getValue(m);x!==void 0&&(o[m]=x);var E=this.getTransition(m);E!==void 0&&(o[m+"-transition"]=E)}return o},_e.prototype.transitioned=function(o,u){for(var c=new Ka(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(o,u._values[E])}return c},_e.prototype.untransitioned=function(){for(var o=new Ka(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var m=c[u];o._values[m]=this._values[m].untransitioned()}return o};var Pl=function(o,u,c,m,x){this.property=o,this.value=u,this.begin=x+m.delay||0,this.end=this.begin+m.duration||0,o.specification.transition&&(m.delay||m.duration)&&(this.prior=c)};Pl.prototype.possiblyEvaluate=function(o,u,c){var m=o.now||0,x=this.value.possiblyEvaluate(o,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(o,u,c);var A=(m-this.begin)/(this.end-this.begin);return this.property.interpolate(E.possiblyEvaluate(o,u,c),x,function(R){if(R<=0)return 0;if(R>=1)return 1;var L=R*R,V=L*R;return 4*(R<.5?V:3*(R-L)+V-.75)}(A))}return x};var Ka=function(o){this._properties=o,this._values=Object.create(o.defaultTransitioningPropertyValues)};Ka.prototype.possiblyEvaluate=function(o,u,c){for(var m=new _s(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(o,u,c)}return m},Ka.prototype.hasTransition=function(){for(var o=0,u=Object.keys(this._values);o<u.length;o+=1)if(this._values[u[o]].prior)return!0;return!1};var Zs=function(o){this._properties=o,this._values=Object.create(o.defaultPropertyValues)};Zs.prototype.getValue=function(o){return ft(this._values[o].value)},Zs.prototype.setValue=function(o,u){this._values[o]=new F(this._values[o].property,u===null?void 0:ft(u))},Zs.prototype.serialize=function(){for(var o={},u=0,c=Object.keys(this._values);u<c.length;u+=1){var m=c[u],x=this.getValue(m);x!==void 0&&(o[m]=x)}return o},Zs.prototype.possiblyEvaluate=function(o,u,c){for(var m=new _s(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(o,u,c)}return m};var Mo=function(o,u,c){this.property=o,this.value=u,this.parameters=c};Mo.prototype.isConstant=function(){return this.value.kind==="constant"},Mo.prototype.constantOr=function(o){return this.value.kind==="constant"?this.value.value:o},Mo.prototype.evaluate=function(o,u,c,m){return this.property.evaluate(this.value,this.parameters,o,u,c,m)};var _s=function(o){this._properties=o,this._values=Object.create(o.defaultPossiblyEvaluatedValues)};_s.prototype.get=function(o){return this._values[o]};var Bn=function(o){this.specification=o};Bn.prototype.possiblyEvaluate=function(o,u){return o.expression.evaluate(u)},Bn.prototype.interpolate=function(o,u,c){var m=Al[this.specification.type];return m?m(o,u,c):o};var An=function(o,u){this.specification=o,this.overrides=u};An.prototype.possiblyEvaluate=function(o,u,c,m){return new Mo(this,o.expression.kind==="constant"||o.expression.kind==="camera"?{kind:"constant",value:o.expression.evaluate(u,null,{},c,m)}:o.expression,u)},An.prototype.interpolate=function(o,u,c){if(o.value.kind!=="constant"||u.value.kind!=="constant")return o;if(o.value.value===void 0||u.value.value===void 0)return new Mo(this,{kind:"constant",value:void 0},o.parameters);var m=Al[this.specification.type];return m?new Mo(this,{kind:"constant",value:m(o.value.value,u.value.value,c)},o.parameters):o},An.prototype.evaluate=function(o,u,c,m,x,E){return o.kind==="constant"?o.value:o.evaluate(u,c,m,x,E)};var os=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.possiblyEvaluate=function(c,m,x,E){if(c.value===void 0)return new Mo(this,{kind:"constant",value:void 0},m);if(c.expression.kind==="constant"){var A=c.expression.evaluate(m,null,{},x,E),R=c.property.specification.type==="resolvedImage"&&typeof A!="string"?A.name:A,L=this._calculate(R,R,R,m);return new Mo(this,{kind:"constant",value:L},m)}if(c.expression.kind==="camera"){var V=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 Mo(this,{kind:"constant",value:V},m)}return new Mo(this,c.expression,m)},u.prototype.evaluate=function(c,m,x,E,A,R){if(c.kind==="source"){var L=c.evaluate(m,x,E,A,R);return this._calculate(L,L,L,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}(An),ss=function(o){this.specification=o};ss.prototype.possiblyEvaluate=function(o,u,c,m){if(o.value!==void 0){if(o.expression.kind==="constant"){var x=o.expression.evaluate(u,null,{},c,m);return this._calculate(x,x,x,u)}return this._calculate(o.expression.evaluate(new Me(Math.floor(u.zoom-1),u)),o.expression.evaluate(new Me(Math.floor(u.zoom),u)),o.expression.evaluate(new Me(Math.floor(u.zoom+1),u)),u)}},ss.prototype._calculate=function(o,u,c,m){return m.zoom>m.zoomHistory.lastIntegerZoom?{from:o,to:u}:{from:c,to:u}},ss.prototype.interpolate=function(o){return o};var xu=function(o){this.specification=o};xu.prototype.possiblyEvaluate=function(o,u,c,m){return!!o.expression.evaluate(u,null,{},c,m)},xu.prototype.interpolate=function(){return!1};var Ba=function(o){for(var u in this.properties=o,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],o){var c=o[u];c.specification.overridable&&this.overridableProperties.push(u);var m=this.defaultPropertyValues[u]=new F(c,void 0),x=this.defaultTransitionablePropertyValues[u]=new eu(c);this.defaultTransitioningPropertyValues[u]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[u]=m.possiblyEvaluate({})}};xn("DataDrivenProperty",An),xn("DataConstantProperty",Bn),xn("CrossFadedDataDrivenProperty",os),xn("CrossFadedProperty",ss),xn("ColorRampProperty",xu);var tu=function(o){function u(c,m){if(o.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 Zs(m.layout)),m.paint)){for(var x in this._transitionablePaint=new _e(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 _s(m.paint)}}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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(Df,"layers."+this.id+".layout."+c,c,m,x)||(c!=="visibility"?this._unevaluatedLayout.setValue(c,m):this.visibility=m)},u.prototype.getPaintProperty=function(c){return gr(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(kf,"layers."+this.id+".paint."+c,c,m,x))return!1;if(gr(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",R=E.value.isDataDriven(),L=E.value;this._transitionablePaint.setValue(c,m),this._handleSpecialPaintPropertyUpdate(c);var V=this._transitionablePaint._values[c].value;return V.isDataDriven()||R||A||this._handleOverridablePaintPropertyUpdate(c,L,V)},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),Mt(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)&&Jl(this,c.call(Qs,{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 Mo&&Rl(m.property.specification)&&(m.value.kind==="source"||m.value.kind==="composite")&&m.value.isStateDependent)return!0}return!1},u}(Qe),bu={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Eu=function(o,u){this._structArray=o,this._pos1=u*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},oa=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function yo(o,u){u===void 0&&(u=1);var c=0,m=0;return{members:o.map(function(x){var E=bu[x.type].BYTES_PER_ELEMENT,A=c=Sh(c,Math.max(u,E)),R=x.components||1;return m=Math.max(m,E),c+=E*R,{name:x.name,type:x.type,components:R,offset:A}}),size:Sh(c,Math.max(m,u)),alignment:u}}function Sh(o,u){return Math.ceil(o/u)*u}oa.serialize=function(o,u){return o._trim(),u&&(o.isTransferred=!0,u.push(o.arrayBuffer)),{length:o.length,arrayBuffer:o.arrayBuffer}},oa.deserialize=function(o){var u=Object.create(this.prototype);return u.arrayBuffer=o.arrayBuffer,u.length=o.length,u.capacity=o.arrayBuffer.byteLength/u.bytesPerElement,u._refreshViews(),u},oa.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},oa.prototype.clear=function(){this.length=0},oa.prototype.resize=function(o){this.reserve(o),this.length=o},oa.prototype.reserve=function(o){if(o>this.capacity){this.capacity=Math.max(o,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)}},oa.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Ol=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(oa);Ol.prototype.bytesPerElement=4,xn("StructArrayLayout2i4",Ol);var zf=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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 R=4*c;return this.int16[R+0]=m,this.int16[R+1]=x,this.int16[R+2]=E,this.int16[R+3]=A,c},u}(oa);zf.prototype.bytesPerElement=8,xn("StructArrayLayout4i8",zf);var cl=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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,R){var L=this.length;return this.resize(L+1),this.emplace(L,c,m,x,E,A,R)},u.prototype.emplace=function(c,m,x,E,A,R,L){var V=6*c;return this.int16[V+0]=m,this.int16[V+1]=x,this.int16[V+2]=E,this.int16[V+3]=A,this.int16[V+4]=R,this.int16[V+5]=L,c},u}(oa);cl.prototype.bytesPerElement=12,xn("StructArrayLayout2i4i12",cl);var xs=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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,R){var L=this.length;return this.resize(L+1),this.emplace(L,c,m,x,E,A,R)},u.prototype.emplace=function(c,m,x,E,A,R,L){var V=4*c,Y=8*c;return this.int16[V+0]=m,this.int16[V+1]=x,this.uint8[Y+4]=E,this.uint8[Y+5]=A,this.uint8[Y+6]=R,this.uint8[Y+7]=L,c},u}(oa);xs.prototype.bytesPerElement=8,xn("StructArrayLayout2i4ub8",xs);var ec=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(oa);ec.prototype.bytesPerElement=8,xn("StructArrayLayout2f8",ec);var Su=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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,R,L,V,Y,K){var le=this.length;return this.resize(le+1),this.emplace(le,c,m,x,E,A,R,L,V,Y,K)},u.prototype.emplace=function(c,m,x,E,A,R,L,V,Y,K,le){var ve=10*c;return this.uint16[ve+0]=m,this.uint16[ve+1]=x,this.uint16[ve+2]=E,this.uint16[ve+3]=A,this.uint16[ve+4]=R,this.uint16[ve+5]=L,this.uint16[ve+6]=V,this.uint16[ve+7]=Y,this.uint16[ve+8]=K,this.uint16[ve+9]=le,c},u}(oa);Su.prototype.bytesPerElement=20,xn("StructArrayLayout10ui20",Su);var Zf=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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,R,L,V,Y,K,le,ve){var ze=this.length;return this.resize(ze+1),this.emplace(ze,c,m,x,E,A,R,L,V,Y,K,le,ve)},u.prototype.emplace=function(c,m,x,E,A,R,L,V,Y,K,le,ve,ze){var I=12*c;return this.int16[I+0]=m,this.int16[I+1]=x,this.int16[I+2]=E,this.int16[I+3]=A,this.uint16[I+4]=R,this.uint16[I+5]=L,this.uint16[I+6]=V,this.uint16[I+7]=Y,this.int16[I+8]=K,this.int16[I+9]=le,this.int16[I+10]=ve,this.int16[I+11]=ze,c},u}(oa);Zf.prototype.bytesPerElement=24,xn("StructArrayLayout4i4ui4i24",Zf);var Rc=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(oa);Rc.prototype.bytesPerElement=12,xn("StructArrayLayout3f12",Rc);var sf=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(oa);sf.prototype.bytesPerElement=4,xn("StructArrayLayout1ul4",sf);var Vf=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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,R,L,V,Y){var K=this.length;return this.resize(K+1),this.emplace(K,c,m,x,E,A,R,L,V,Y)},u.prototype.emplace=function(c,m,x,E,A,R,L,V,Y,K){var le=10*c,ve=5*c;return this.int16[le+0]=m,this.int16[le+1]=x,this.int16[le+2]=E,this.int16[le+3]=A,this.int16[le+4]=R,this.int16[le+5]=L,this.uint32[ve+3]=V,this.uint16[le+8]=Y,this.uint16[le+9]=K,c},u}(oa);Vf.prototype.bytesPerElement=20,xn("StructArrayLayout6i1ul2ui20",Vf);var tc=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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,R){var L=this.length;return this.resize(L+1),this.emplace(L,c,m,x,E,A,R)},u.prototype.emplace=function(c,m,x,E,A,R,L){var V=6*c;return this.int16[V+0]=m,this.int16[V+1]=x,this.int16[V+2]=E,this.int16[V+3]=A,this.int16[V+4]=R,this.int16[V+5]=L,c},u}(oa);tc.prototype.bytesPerElement=12,xn("StructArrayLayout2i2i2i12",tc);var rc=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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 R=this.length;return this.resize(R+1),this.emplace(R,c,m,x,E,A)},u.prototype.emplace=function(c,m,x,E,A,R){var L=4*c,V=8*c;return this.float32[L+0]=m,this.float32[L+1]=x,this.float32[L+2]=E,this.int16[V+6]=A,this.int16[V+7]=R,c},u}(oa);rc.prototype.bytesPerElement=16,xn("StructArrayLayout2f1f2i16",rc);var Ah=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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 R=12*c,L=3*c;return this.uint8[R+0]=m,this.uint8[R+1]=x,this.float32[L+1]=E,this.float32[L+2]=A,c},u}(oa);Ah.prototype.bytesPerElement=12,xn("StructArrayLayout2ub2f12",Ah);var us=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(oa);us.prototype.bytesPerElement=6,xn("StructArrayLayout3ui6",us);var Au=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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,R,L,V,Y,K,le,ve,ze,I,ht,Je,wt){var Bt=this.length;return this.resize(Bt+1),this.emplace(Bt,c,m,x,E,A,R,L,V,Y,K,le,ve,ze,I,ht,Je,wt)},u.prototype.emplace=function(c,m,x,E,A,R,L,V,Y,K,le,ve,ze,I,ht,Je,wt,Bt){var nr=24*c,or=12*c,mr=48*c;return this.int16[nr+0]=m,this.int16[nr+1]=x,this.uint16[nr+2]=E,this.uint16[nr+3]=A,this.uint32[or+2]=R,this.uint32[or+3]=L,this.uint32[or+4]=V,this.uint16[nr+10]=Y,this.uint16[nr+11]=K,this.uint16[nr+12]=le,this.float32[or+7]=ve,this.float32[or+8]=ze,this.uint8[mr+36]=I,this.uint8[mr+37]=ht,this.uint8[mr+38]=Je,this.uint32[or+10]=wt,this.int16[nr+22]=Bt,c},u}(oa);Au.prototype.bytesPerElement=48,xn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Au);var uf=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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,R,L,V,Y,K,le,ve,ze,I,ht,Je,wt,Bt,nr,or,mr,Zr,qr,Nn,vn,Zn,mn,bi){var ei=this.length;return this.resize(ei+1),this.emplace(ei,c,m,x,E,A,R,L,V,Y,K,le,ve,ze,I,ht,Je,wt,Bt,nr,or,mr,Zr,qr,Nn,vn,Zn,mn,bi)},u.prototype.emplace=function(c,m,x,E,A,R,L,V,Y,K,le,ve,ze,I,ht,Je,wt,Bt,nr,or,mr,Zr,qr,Nn,vn,Zn,mn,bi,ei){var Mn=34*c,Mi=17*c;return this.int16[Mn+0]=m,this.int16[Mn+1]=x,this.int16[Mn+2]=E,this.int16[Mn+3]=A,this.int16[Mn+4]=R,this.int16[Mn+5]=L,this.int16[Mn+6]=V,this.int16[Mn+7]=Y,this.uint16[Mn+8]=K,this.uint16[Mn+9]=le,this.uint16[Mn+10]=ve,this.uint16[Mn+11]=ze,this.uint16[Mn+12]=I,this.uint16[Mn+13]=ht,this.uint16[Mn+14]=Je,this.uint16[Mn+15]=wt,this.uint16[Mn+16]=Bt,this.uint16[Mn+17]=nr,this.uint16[Mn+18]=or,this.uint16[Mn+19]=mr,this.uint16[Mn+20]=Zr,this.uint16[Mn+21]=qr,this.uint16[Mn+22]=Nn,this.uint32[Mi+12]=vn,this.float32[Mi+13]=Zn,this.float32[Mi+14]=mn,this.float32[Mi+15]=bi,this.float32[Mi+16]=ei,c},u}(oa);uf.prototype.bytesPerElement=68,xn("StructArrayLayout8i15ui1ul4f68",uf);var kl=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(oa);kl.prototype.bytesPerElement=4,xn("StructArrayLayout1f4",kl);var uu=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(oa);uu.prototype.bytesPerElement=6,xn("StructArrayLayout3i6",uu);var Th=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(oa);Th.prototype.bytesPerElement=8,xn("StructArrayLayout1ul2ui8",Th);var ju=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(oa);ju.prototype.bytesPerElement=4,xn("StructArrayLayout2ui4",ju);var jf=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(oa);jf.prototype.bytesPerElement=2,xn("StructArrayLayout1ui2",jf);var wh=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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 R=4*c;return this.float32[R+0]=m,this.float32[R+1]=x,this.float32[R+2]=E,this.float32[R+3]=A,c},u}(oa);wh.prototype.bytesPerElement=16,xn("StructArrayLayout4f16",wh);var h=function(o){function u(){o.apply(this,arguments)}o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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 fe(this.anchorPointX,this.anchorPointY)},Object.defineProperties(u.prototype,c),u}(Eu);h.prototype.size=20;var v=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.get=function(c){return new h(this,c)},u}(Vf);xn("CollisionBoxArray",v);var p=function(o){function u(){o.apply(this,arguments)}o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(Eu);p.prototype.size=48;var g=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.get=function(c){return new p(this,c)},u}(Au);xn("PlacedSymbolArray",g);var S=function(o){function u(){o.apply(this,arguments)}o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(Eu);S.prototype.size=68;var w=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.get=function(c){return new S(this,c)},u}(uf);xn("SymbolInstanceArray",w);var C=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.getoffsetX=function(c){return this.float32[1*c+0]},u}(kl);xn("GlyphOffsetArray",C);var O=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(uu);xn("SymbolLineVertexArray",O);var X=function(o){function u(){o.apply(this,arguments)}o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(Eu);X.prototype.size=8;var J=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.get=function(c){return new X(this,c)},u}(Th);xn("FeatureIndexArray",J);var me=yo([{name:"a_pos",components:2,type:"Int16"}],4).members,be=function(o){o===void 0&&(o=[]),this.segments=o};function Te(o,u){return 256*(o=Ot(Math.floor(o),0,255))+Ot(Math.floor(u),0,255)}be.prototype.prepareSegment=function(o,u,c,m){var x=this.segments[this.segments.length-1];return o>be.MAX_VERTEX_ARRAY_LENGTH&&qe("Max vertices per segment is "+be.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+o),(!x||x.vertexLength+o>be.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},be.prototype.get=function(){return this.segments},be.prototype.destroy=function(){for(var o=0,u=this.segments;o<u.length;o+=1){var c=u[o];for(var m in c.vaos)c.vaos[m].destroy()}},be.simpleSegment=function(o,u,c,m){return new be([{vertexOffset:o,primitiveOffset:u,vertexLength:c,primitiveLength:m,vaos:{},sortKey:0}])},be.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,xn("SegmentVector",be);var je=yo([{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"}]),Ze=he(function(o){o.exports=function(u,c){var m,x,E,A,R,L,V,Y;for(x=u.length-(m=3&u.length),E=c,R=3432918353,L=461845907,Y=0;Y<x;)V=255&u.charCodeAt(Y)|(255&u.charCodeAt(++Y))<<8|(255&u.charCodeAt(++Y))<<16|(255&u.charCodeAt(++Y))<<24,++Y,E=27492+(65535&(A=5*(65535&(E=(E^=V=(65535&(V=(V=(65535&V)*R+(((V>>>16)*R&65535)<<16)&4294967295)<<15|V>>>17))*L+(((V>>>16)*L&65535)<<16)&4294967295)<<13|E>>>19))+((5*(E>>>16)&65535)<<16)&4294967295))+((58964+(A>>>16)&65535)<<16);switch(V=0,m){case 3:V^=(255&u.charCodeAt(Y+2))<<16;case 2:V^=(255&u.charCodeAt(Y+1))<<8;case 1:E^=V=(65535&(V=(V=(65535&(V^=255&u.charCodeAt(Y)))*R+(((V>>>16)*R&65535)<<16)&4294967295)<<15|V>>>17))*L+(((V>>>16)*L&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}}),lt=he(function(o){o.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}}),Ne=Ze,ot=lt;Ne.murmur3=Ze,Ne.murmur2=ot;var _t=function(){this.ids=[],this.positions=[],this.indexed=!1};_t.prototype.add=function(o,u,c,m){this.ids.push(ir(o)),this.positions.push(u,c,m)},_t.prototype.getPositions=function(o){for(var u=ir(o),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},_t.serialize=function(o,u){var c=new Float64Array(o.ids),m=new Uint32Array(o.positions);return function x(E,A,R,L){for(;R<L;){for(var V=E[R+L>>1],Y=R-1,K=L+1;;){do Y++;while(E[Y]<V);do K--;while(E[K]>V);if(Y>=K)break;qt(E,Y,K),qt(A,3*Y,3*K),qt(A,3*Y+1,3*K+1),qt(A,3*Y+2,3*K+2)}K-R<L-K?(x(E,A,R,K),R=K+1):(x(E,A,K+1,L),L=K)}}(c,m,0,c.length-1),u&&u.push(c.buffer,m.buffer),{ids:c,positions:m}},_t.deserialize=function(o){var u=new _t;return u.ids=o.ids,u.positions=o.positions,u.indexed=!0,u};var Lt=Math.pow(2,53)-1;function ir(o){var u=+o;return!isNaN(u)&&u<=Lt?u:Ne(String(o))}function qt(o,u,c){var m=o[u];o[u]=o[c],o[c]=m}xn("FeaturePositionMap",_t);var cr=function(o,u){this.gl=o.gl,this.location=u},br=function(o){function u(c,m){o.call(this,c,m),this.current=0}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.set=function(c){this.current!==c&&(this.current=c,this.gl.uniform1i(this.location,c))},u}(cr),Hr=function(o){function u(c,m){o.call(this,c,m),this.current=0}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.set=function(c){this.current!==c&&(this.current=c,this.gl.uniform1f(this.location,c))},u}(cr),Fr=function(o){function u(c,m){o.call(this,c,m),this.current=[0,0]}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(cr),hn=function(o){function u(c,m){o.call(this,c,m),this.current=[0,0,0]}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(cr),Un=function(o){function u(c,m){o.call(this,c,m),this.current=[0,0,0,0]}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(cr),Fn=function(o){function u(c,m){o.call(this,c,m),this.current=Ai.transparent}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(cr),zn=new Float32Array(16),zi=function(o){function u(c,m){o.call(this,c,m),this.current=zn}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(cr);function gn(o){return[Te(255*o.r,255*o.g),Te(255*o.b,255*o.a)]}var ii=function(o,u,c){this.value=o,this.uniformNames=u.map(function(m){return"u_"+m}),this.type=c};ii.prototype.setUniform=function(o,u,c){o.set(c.constantOr(this.value))},ii.prototype.getBinding=function(o,u,c){return this.type==="color"?new Fn(o,u):new Hr(o,u)};var pi=function(o,u){this.uniformNames=u.map(function(c){return"u_"+c}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};pi.prototype.setConstantPatternPositions=function(o,u){this.pixelRatioFrom=u.pixelRatio,this.pixelRatioTo=o.pixelRatio,this.patternFrom=u.tlbr,this.patternTo=o.tlbr},pi.prototype.setUniform=function(o,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&&o.set(x)},pi.prototype.getBinding=function(o,u,c){return c.substr(0,9)==="u_pattern"?new Un(o,u):new Hr(o,u)};var ri=function(o,u,c,m){this.expression=o,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(o,u,c,m,x){var E=this.paintVertexArray.length,A=this.expression.evaluate(new Me(0),u,{},m,[],x);this.paintVertexArray.resize(o),this._setPaintValue(E,o,A)},ri.prototype.updatePaintArray=function(o,u,c,m){var x=this.expression.evaluate({zoom:0},c,m);this._setPaintValue(o,u,x)},ri.prototype._setPaintValue=function(o,u,c){if(this.type==="color")for(var m=gn(c),x=o;x<u;x++)this.paintVertexArray.emplace(x,m[0],m[1]);else{for(var E=o;E<u;E++)this.paintVertexArray.emplace(E,c);this.maxValue=Math.max(this.maxValue,Math.abs(c))}},ri.prototype.upload=function(o){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=o.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ri.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Kn=function(o,u,c,m,x,E){this.expression=o,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};Kn.prototype.populatePaintArray=function(o,u,c,m,x){var E=this.expression.evaluate(new Me(this.zoom),u,{},m,[],x),A=this.expression.evaluate(new Me(this.zoom+1),u,{},m,[],x),R=this.paintVertexArray.length;this.paintVertexArray.resize(o),this._setPaintValue(R,o,E,A)},Kn.prototype.updatePaintArray=function(o,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(o,u,x,E)},Kn.prototype._setPaintValue=function(o,u,c,m){if(this.type==="color")for(var x=gn(c),E=gn(m),A=o;A<u;A++)this.paintVertexArray.emplace(A,x[0],x[1],E[0],E[1]);else{for(var R=o;R<u;R++)this.paintVertexArray.emplace(R,c,m);this.maxValue=Math.max(this.maxValue,Math.abs(c),Math.abs(m))}},Kn.prototype.upload=function(o){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=o.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Kn.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Kn.prototype.setUniform=function(o,u){var c=this.useIntegerZoom?Math.floor(u.zoom):u.zoom,m=Ot(this.expression.interpolationFactor(c,this.zoom,this.zoom+1),0,1);o.set(m)},Kn.prototype.getBinding=function(o,u,c){return new Hr(o,u)};var fi=function(o,u,c,m,x,E){this.expression=o,this.type=u,this.useIntegerZoom=c,this.zoom=m,this.layerId=E,this.zoomInPaintVertexArray=new x,this.zoomOutPaintVertexArray=new x};fi.prototype.populatePaintArray=function(o,u,c){var m=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(o),this.zoomOutPaintVertexArray.resize(o),this._setPaintValues(m,o,u.patterns&&u.patterns[this.layerId],c)},fi.prototype.updatePaintArray=function(o,u,c,m,x){this._setPaintValues(o,u,c.patterns&&c.patterns[this.layerId],x)},fi.prototype._setPaintValues=function(o,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 R=o;R<u;R++)this.zoomInPaintVertexArray.emplace(R,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(R,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)}},fi.prototype.upload=function(o){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=o.createVertexBuffer(this.zoomInPaintVertexArray,je.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=o.createVertexBuffer(this.zoomOutPaintVertexArray,je.members,this.expression.isStateDependent))},fi.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Qn=function(o,u,c){this.binders={},this._buffers=[];var m=[];for(var x in o.paint._values)if(c(x)){var E=o.paint.get(x);if(E instanceof Mo&&Rl(E.property.specification)){var A=Io(x,o.type),R=E.value,L=E.property.specification.type,V=E.property.useIntegerZoom,Y=E.property.specification["property-type"],K=Y==="cross-faded"||Y==="cross-faded-data-driven";if(R.kind==="constant")this.binders[x]=K?new pi(R.value,A):new ii(R.value,A,L),m.push("/u_"+x);else if(R.kind==="source"||K){var le=Qa(x,L,"source");this.binders[x]=K?new fi(R,L,V,u,le,o.id):new ri(R,A,L,le),m.push("/a_"+x)}else{var ve=Qa(x,L,"composite");this.binders[x]=new Kn(R,A,L,V,u,ve),m.push("/z_"+x)}}}this.cacheKey=m.sort().join("")};Qn.prototype.getMaxValue=function(o){var u=this.binders[o];return u instanceof ri||u instanceof Kn?u.maxValue:0},Qn.prototype.populatePaintArrays=function(o,u,c,m,x){for(var E in this.binders){var A=this.binders[E];(A instanceof ri||A instanceof Kn||A instanceof fi)&&A.populatePaintArray(o,u,c,m,x)}},Qn.prototype.setConstantPatternPositions=function(o,u){for(var c in this.binders){var m=this.binders[c];m instanceof pi&&m.setConstantPatternPositions(o,u)}},Qn.prototype.updatePaintArrays=function(o,u,c,m,x){var E=!1;for(var A in o)for(var R=0,L=u.getPositions(A);R<L.length;R+=1){var V=L[R],Y=c.feature(V.index);for(var K in this.binders){var le=this.binders[K];if((le instanceof ri||le instanceof Kn||le instanceof fi)&&le.expression.isStateDependent===!0){var ve=m.paint.get(K);le.expression=ve.value,le.updatePaintArray(V.start,V.end,Y,o[A],x),E=!0}}}return E},Qn.prototype.defines=function(){var o=[];for(var u in this.binders){var c=this.binders[u];(c instanceof ii||c instanceof pi)&&o.push.apply(o,c.uniformNames.map(function(m){return"#define HAS_UNIFORM_"+m}))}return o},Qn.prototype.getBinderAttributes=function(){var o=[];for(var u in this.binders){var c=this.binders[u];if(c instanceof ri||c instanceof Kn)for(var m=0;m<c.paintVertexAttributes.length;m++)o.push(c.paintVertexAttributes[m].name);else if(c instanceof fi)for(var x=0;x<je.members.length;x++)o.push(je.members[x].name)}return o},Qn.prototype.getBinderUniforms=function(){var o=[];for(var u in this.binders){var c=this.binders[u];if(c instanceof ii||c instanceof pi||c instanceof Kn)for(var m=0,x=c.uniformNames;m<x.length;m+=1)o.push(x[m])}return o},Qn.prototype.getPaintVertexBuffers=function(){return this._buffers},Qn.prototype.getUniforms=function(o,u){var c=[];for(var m in this.binders){var x=this.binders[m];if(x instanceof ii||x instanceof pi||x instanceof Kn)for(var E=0,A=x.uniformNames;E<A.length;E+=1){var R=A[E];if(u[R]){var L=x.getBinding(o,u[R],R);c.push({name:R,property:m,binding:L})}}}return c},Qn.prototype.setUniforms=function(o,u,c,m){for(var x=0,E=u;x<E.length;x+=1){var A=E[x],R=A.name,L=A.property;this.binders[L].setUniform(A.binding,m,c.get(L),R)}},Qn.prototype.updatePaintBuffers=function(o){for(var u in this._buffers=[],this.binders){var c=this.binders[u];if(o&&c instanceof fi){var m=o.fromScale===2?c.zoomInPaintVertexBuffer:c.zoomOutPaintVertexBuffer;m&&this._buffers.push(m)}else(c instanceof ri||c instanceof Kn)&&c.paintVertexBuffer&&this._buffers.push(c.paintVertexBuffer)}},Qn.prototype.upload=function(o){for(var u in this.binders){var c=this.binders[u];(c instanceof ri||c instanceof Kn||c instanceof fi)&&c.upload(o)}this.updatePaintBuffers()},Qn.prototype.destroy=function(){for(var o in this.binders){var u=this.binders[o];(u instanceof ri||u instanceof Kn||u instanceof fi)&&u.destroy()}};var Gn=function(o,u,c){c===void 0&&(c=function(){return!0}),this.programConfigurations={};for(var m=0,x=o;m<x.length;m+=1){var E=x[m];this.programConfigurations[E.id]=new Qn(E,u,c)}this.needsUpload=!1,this._featureMap=new _t,this._bufferOffset=0};function Io(o,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"]}[o]||[o.replace(u+"-","").replace(/-/g,"_")]}function Qa(o,u,c){var m={color:{source:ec,composite:wh},number:{source:kl,composite:ec}},x=function(E){return{"line-pattern":{source:Su,composite:Su},"fill-pattern":{source:Su,composite:Su},"fill-extrusion-pattern":{source:Su,composite:Su}}[E]}(o);return x&&x[c]||m[u][c]}Gn.prototype.populatePaintArrays=function(o,u,c,m,x,E){for(var A in this.programConfigurations)this.programConfigurations[A].populatePaintArrays(o,u,m,x,E);u.id!==void 0&&this._featureMap.add(u.id,c,this._bufferOffset,o),this._bufferOffset=o,this.needsUpload=!0},Gn.prototype.updatePaintArrays=function(o,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(o,this._featureMap,u,A,m)||this.needsUpload}},Gn.prototype.get=function(o){return this.programConfigurations[o]},Gn.prototype.upload=function(o){if(this.needsUpload){for(var u in this.programConfigurations)this.programConfigurations[u].upload(o);this.needsUpload=!1}},Gn.prototype.destroy=function(){for(var o in this.programConfigurations)this.programConfigurations[o].destroy()},xn("ConstantBinder",ii),xn("CrossFadedConstantBinder",pi),xn("SourceExpressionBinder",ri),xn("CrossFadedCompositeBinder",fi),xn("CompositeExpressionBinder",Kn),xn("ProgramConfiguration",Qn,{omit:["_buffers"]}),xn("ProgramConfigurationSet",Gn);var Po=Math.pow(2,14)-1,_o=-Po-1;function Wa(o){for(var u=8192/o.extent,c=o.loadGeometry(),m=0;m<c.length;m++)for(var x=c[m],E=0;E<x.length;E++){var A=x[E],R=Math.round(A.x*u),L=Math.round(A.y*u);A.x=Ot(R,_o,Po),A.y=Ot(L,_o,Po),(R<A.x||R>A.x+1||L<A.y||L>A.y+1)&&qe("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return c}function Ja(o,u){return{type:o.type,id:o.id,properties:o.properties,geometry:u?Wa(o):[]}}function bs(o,u,c,m,x){o.emplaceBack(2*u+(m+1)/2,2*c+(x+1)/2)}var Es=function(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(function(u){return u.id}),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new Ol,this.indexArray=new us,this.segments=new be,this.programConfigurations=new Gn(o.layers,o.zoom),this.stateDependentLayerIds=this.layers.filter(function(u){return u.isStateDependent()}).map(function(u){return u.id})};function fl(o,u){for(var c=0;c<o.length;c++)if(cu(u,o[c]))return!0;for(var m=0;m<u.length;m++)if(cu(o,u[m]))return!0;return!!Mc(o,u)}function Ss(o,u,c){return!!cu(o,u)||!!Tu(u,o,c)}function lu(o,u){if(o.length===1)return hl(u,o[0]);for(var c=0;c<u.length;c++)for(var m=u[c],x=0;x<m.length;x++)if(cu(o,m[x]))return!0;for(var E=0;E<o.length;E++)if(hl(u,o[E]))return!0;for(var A=0;A<u.length;A++)if(Mc(o,u[A]))return!0;return!1}function Vs(o,u,c){if(o.length>1){if(Mc(o,u))return!0;for(var m=0;m<u.length;m++)if(Tu(u[m],o,c))return!0}for(var x=0;x<o.length;x++)if(Tu(o[x],u,c))return!0;return!1}function Mc(o,u){if(o.length===0||u.length===0)return!1;for(var c=0;c<o.length-1;c++)for(var m=o[c],x=o[c+1],E=0;E<u.length-1;E++)if(Hu(m,x,u[E],u[E+1]))return!0;return!1}function Hu(o,u,c,m){return Dt(o,c,m)!==Dt(u,c,m)&&Dt(o,u,c)!==Dt(o,u,m)}function Tu(o,u,c){var m=c*c;if(u.length===1)return o.distSqr(u[0])<m;for(var x=1;x<u.length;x++)if(nc(o,u[x-1],u[x])<m)return!0;return!1}function nc(o,u,c){var m=u.distSqr(c);if(m===0)return o.distSqr(u);var x=((o.x-u.x)*(c.x-u.x)+(o.y-u.y)*(c.y-u.y))/m;return o.distSqr(x<0?u:x>1?c:c.sub(u)._mult(x)._add(u))}function hl(o,u){for(var c,m,x,E=!1,A=0;A<o.length;A++)for(var R=0,L=(c=o[A]).length-1;R<c.length;L=R++)(m=c[R]).y>u.y!=(x=c[L]).y>u.y&&u.x<(x.x-m.x)*(u.y-m.y)/(x.y-m.y)+m.x&&(E=!E);return E}function cu(o,u){for(var c=!1,m=0,x=o.length-1;m<o.length;x=m++){var E=o[m],A=o[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 pl(o,u,c){var m=c[0],x=c[2];if(o.x<m.x&&u.x<m.x||o.x>x.x&&u.x>x.x||o.y<m.y&&u.y<m.y||o.y>x.y&&u.y>x.y)return!1;var E=Dt(o,u,c[0]);return E!==Dt(o,u,c[1])||E!==Dt(o,u,c[2])||E!==Dt(o,u,c[3])}function Oo(o,u,c){var m=u.paint.get(o).value;return m.kind==="constant"?m.value:c.programConfigurations.get(u.id).getMaxValue(o)}function ao(o){return Math.sqrt(o[0]*o[0]+o[1]*o[1])}function Ps(o,u,c,m,x){if(!u[0]&&!u[1])return o;var E=fe.convert(u)._mult(x);c==="viewport"&&E._rotate(-m);for(var A=[],R=0;R<o.length;R++)A.push(o[R].sub(E));return A}Es.prototype.populate=function(o,u,c){var m=this.layers[0],x=[],E=null;m.type==="circle"&&(E=m.layout.get("circle-sort-key"));for(var A=0,R=o;A<R.length;A+=1){var L=R[A],V=L.feature,Y=L.id,K=L.index,le=L.sourceLayerIndex,ve=this.layers[0]._featureFilter.needGeometry,ze=Ja(V,ve);if(this.layers[0]._featureFilter.filter(new Me(this.zoom),ze,c)){var I=E?E.evaluate(ze,{},c):void 0,ht={id:Y,properties:V.properties,type:V.type,sourceLayerIndex:le,index:K,geometry:ve?ze.geometry:Wa(V),patterns:{},sortKey:I};x.push(ht)}}E&&x.sort(function(qr,Nn){return qr.sortKey-Nn.sortKey});for(var Je=0,wt=x;Je<wt.length;Je+=1){var Bt=wt[Je],nr=Bt.geometry,or=Bt.index,mr=Bt.sourceLayerIndex,Zr=o[or].feature;this.addFeature(Bt,nr,or,c),u.featureIndex.insert(Zr,nr,or,mr,this.index)}},Es.prototype.update=function(o,u,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,u,this.stateDependentLayers,c)},Es.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Es.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Es.prototype.upload=function(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,me),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0},Es.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Es.prototype.addFeature=function(o,u,c,m){for(var x=0,E=u;x<E.length;x+=1)for(var A=0,R=E[x];A<R.length;A+=1){var L=R[A],V=L.x,Y=L.y;if(!(V<0||V>=8192||Y<0||Y>=8192)){var K=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,o.sortKey),le=K.vertexLength;bs(this.layoutVertexArray,V,Y,-1,-1),bs(this.layoutVertexArray,V,Y,1,-1),bs(this.layoutVertexArray,V,Y,1,1),bs(this.layoutVertexArray,V,Y,-1,1),this.indexArray.emplaceBack(le,le+1,le+2),this.indexArray.emplaceBack(le,le+3,le+2),K.vertexLength+=4,K.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,c,{},m)},xn("CircleBucket",Es,{omit:["layers"]});var fu=new Ba({"circle-sort-key":new An(j.layout_circle["circle-sort-key"])}),wu={paint:new Ba({"circle-radius":new An(j.paint_circle["circle-radius"]),"circle-color":new An(j.paint_circle["circle-color"]),"circle-blur":new An(j.paint_circle["circle-blur"]),"circle-opacity":new An(j.paint_circle["circle-opacity"]),"circle-translate":new Bn(j.paint_circle["circle-translate"]),"circle-translate-anchor":new Bn(j.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Bn(j.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Bn(j.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new An(j.paint_circle["circle-stroke-width"]),"circle-stroke-color":new An(j.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new An(j.paint_circle["circle-stroke-opacity"])}),layout:fu},Fi=typeof Float32Array!="undefined"?Float32Array:Array;function Jo(o){return o[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=1,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o}function oo(o,u,c){var m=u[0],x=u[1],E=u[2],A=u[3],R=u[4],L=u[5],V=u[6],Y=u[7],K=u[8],le=u[9],ve=u[10],ze=u[11],I=u[12],ht=u[13],Je=u[14],wt=u[15],Bt=c[0],nr=c[1],or=c[2],mr=c[3];return o[0]=Bt*m+nr*R+or*K+mr*I,o[1]=Bt*x+nr*L+or*le+mr*ht,o[2]=Bt*E+nr*V+or*ve+mr*Je,o[3]=Bt*A+nr*Y+or*ze+mr*wt,o[4]=(Bt=c[4])*m+(nr=c[5])*R+(or=c[6])*K+(mr=c[7])*I,o[5]=Bt*x+nr*L+or*le+mr*ht,o[6]=Bt*E+nr*V+or*ve+mr*Je,o[7]=Bt*A+nr*Y+or*ze+mr*wt,o[8]=(Bt=c[8])*m+(nr=c[9])*R+(or=c[10])*K+(mr=c[11])*I,o[9]=Bt*x+nr*L+or*le+mr*ht,o[10]=Bt*E+nr*V+or*ve+mr*Je,o[11]=Bt*A+nr*Y+or*ze+mr*wt,o[12]=(Bt=c[12])*m+(nr=c[13])*R+(or=c[14])*K+(mr=c[15])*I,o[13]=Bt*x+nr*L+or*le+mr*ht,o[14]=Bt*E+nr*V+or*ve+mr*Je,o[15]=Bt*A+nr*Y+or*ze+mr*wt,o}Math.hypot||(Math.hypot=function(){for(var o=arguments,u=0,c=arguments.length;c--;)u+=o[c]*o[c];return Math.sqrt(u)});var hu,Ic=oo;function Wu(o,u,c){var m=u[0],x=u[1],E=u[2],A=u[3];return o[0]=c[0]*m+c[4]*x+c[8]*E+c[12]*A,o[1]=c[1]*m+c[5]*x+c[9]*E+c[13]*A,o[2]=c[2]*m+c[6]*x+c[10]*E+c[14]*A,o[3]=c[3]*m+c[7]*x+c[11]*E+c[15]*A,o}hu=new Fi(3),Fi!=Float32Array&&(hu[0]=0,hu[1]=0,hu[2]=0),function(){var o=new Fi(4);Fi!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0,o[3]=0)}();var Ch=(function(){var o=new Fi(2);Fi!=Float32Array&&(o[0]=0,o[1]=0)}(),function(o){function u(c){o.call(this,c,wu)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.createBucket=function(c){return new Es(c)},u.prototype.queryRadius=function(c){var m=c;return Oo("circle-radius",this,m)+Oo("circle-stroke-width",this,m)+ao(this.paint.get("circle-translate"))},u.prototype.queryIntersectsFeature=function(c,m,x,E,A,R,L,V){for(var Y=Ps(c,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),R.angle,L),K=this.paint.get("circle-radius").evaluate(m,x)+this.paint.get("circle-stroke-width").evaluate(m,x),le=this.paint.get("circle-pitch-alignment")==="map",ve=le?Y:function(Zr,qr){return Zr.map(function(Nn){return ko(Nn,qr)})}(Y,V),ze=le?K*L:K,I=0,ht=E;I<ht.length;I+=1)for(var Je=0,wt=ht[I];Je<wt.length;Je+=1){var Bt=wt[Je],nr=le?Bt:ko(Bt,V),or=ze,mr=Wu([],[Bt.x,Bt.y,0,1],V);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?or*=mr[3]/R.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(or*=R.cameraToCenterDistance/mr[3]),Ss(ve,nr,or))return!0}return!1},u}(tu));function ko(o,u){var c=Wu([],[o.x,o.y,0,1],u);return new fe(c[0]/c[3],c[1]/c[3])}var Dr=function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u}(Es);function js(o,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 o.width=x,o.height=E,o.data=m,o}function Rh(o,u,c){var m=u.width,x=u.height;if(m!==o.width||x!==o.height){var E=js({},{width:m,height:x},c);Do(o,E,{x:0,y:0},{x:0,y:0},{width:Math.min(o.width,m),height:Math.min(o.height,x)},c),o.width=m,o.height=x,o.data=E.data}}function Do(o,u,c,m,x,E){if(x.width===0||x.height===0)return u;if(x.width>o.width||x.height>o.height||c.x>o.width-x.width||c.y>o.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=o.data,R=u.data,L=0;L<x.height;L++)for(var V=((c.y+L)*o.width+c.x)*E,Y=((m.y+L)*u.width+m.x)*E,K=0;K<x.width*E;K++)R[Y+K]=A[V+K];return u}xn("HeatmapBucket",Dr,{omit:["layers"]});var ru=function(o,u){js(this,o,1,u)};ru.prototype.resize=function(o){Rh(this,o,1)},ru.prototype.clone=function(){return new ru({width:this.width,height:this.height},new Uint8Array(this.data))},ru.copy=function(o,u,c,m,x){Do(o,u,c,m,x,1)};var Lo=function(o,u){js(this,o,4,u)};Lo.prototype.resize=function(o){Rh(this,o,4)},Lo.prototype.replace=function(o,u){u?this.data.set(o):this.data=o instanceof Uint8ClampedArray?new Uint8Array(o.buffer):o},Lo.prototype.clone=function(){return new Lo({width:this.width,height:this.height},new Uint8Array(this.data))},Lo.copy=function(o,u,c,m,x){Do(o,u,c,m,x,4)},xn("AlphaImage",ru),xn("RGBAImage",Lo);var pp={paint:new Ba({"heatmap-radius":new An(j.paint_heatmap["heatmap-radius"]),"heatmap-weight":new An(j.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Bn(j.paint_heatmap["heatmap-intensity"]),"heatmap-color":new xu(j.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Bn(j.paint_heatmap["heatmap-opacity"])})};function ic(o){var u={},c=o.resolution||256,m=o.clips?o.clips.length:1,x=o.image||new Lo({width:c,height:m}),E=function(ze,I,ht){u[o.evaluationKey]=ht;var Je=o.expression.evaluate(u);x.data[ze+I+0]=Math.floor(255*Je.r/Je.a),x.data[ze+I+1]=Math.floor(255*Je.g/Je.a),x.data[ze+I+2]=Math.floor(255*Je.b/Je.a),x.data[ze+I+3]=Math.floor(255*Je.a)};if(o.clips)for(var A=0,R=0;A<m;++A,R+=4*c)for(var L=0,V=0;L<c;L++,V+=4){var Y=L/(c-1),K=o.clips[A];E(R,V,K.start*(1-Y)+K.end*Y)}else for(var le=0,ve=0;le<c;le++,ve+=4)E(0,ve,le/(c-1));return x}var dl=function(o){function u(c){o.call(this,c,pp),this._updateColorRamp()}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.createBucket=function(c){return new Dr(c)},u.prototype._handleSpecialPaintPropertyUpdate=function(c){c==="heatmap-color"&&this._updateColorRamp()},u.prototype._updateColorRamp=function(){this.colorRamp=ic({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}(tu),Zp={paint:new Ba({"hillshade-illumination-direction":new Bn(j.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Bn(j.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Bn(j.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Bn(j.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Bn(j.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Bn(j.paint_hillshade["hillshade-accent-color"])})},ag=function(o){function u(c){o.call(this,c,Zp)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},u}(tu),zv=yo([{name:"a_pos",components:2,type:"Int16"}],4).members,Hf=Mh,dp=Mh;function Mh(o,u,c){c=c||2;var m,x,E,A,R,L,V,Y=u&&u.length,K=Y?u[0]*c:o.length,le=Dd(o,0,K,c,!0),ve=[];if(!le||le.next===le.prev)return ve;if(Y&&(le=function(I,ht,Je,wt){var Bt,nr,or,mr=[];for(Bt=0,nr=ht.length;Bt<nr;Bt++)(or=Dd(I,ht[Bt]*wt,Bt<nr-1?ht[Bt+1]*wt:I.length,wt,!1))===or.next&&(or.steiner=!0),mr.push(vp(or));for(mr.sort(Bd),Bt=0;Bt<mr.length;Bt++)Fd(mr[Bt],Je),Je=Pc(Je,Je.next);return Je}(o,u,le,c)),o.length>80*c){m=E=o[0],x=A=o[1];for(var ze=c;ze<K;ze+=c)(R=o[ze])<m&&(m=R),(L=o[ze+1])<x&&(x=L),R>E&&(E=R),L>A&&(A=L);V=(V=Math.max(E-m,A-x))!==0?1/V:0}return Ih(le,ve,c,m,x,V),ve}function Dd(o,u,c,m,x){var E,A;if(x===ac(o,u,c,m)>0)for(E=u;E<c;E+=m)A=$f(E,o[E],o[E+1],A);else for(E=c-m;E>=u;E-=m)A=$f(E,o[E],o[E+1],A);return A&&Wf(A,A.next)&&(Dc(A),A=A.next),A}function Pc(o,u){if(!o)return o;u||(u=o);var c,m=o;do if(c=!1,m.steiner||!Wf(m,m.next)&&eo(m.prev,m,m.next)!==0)m=m.next;else{if(Dc(m),(m=u=m.prev)===m.next)break;c=!0}while(c||m!==u);return u}function Ih(o,u,c,m,x,E,A){if(o){!A&&E&&function(Y,K,le,ve){var ze=Y;do ze.z===null&&(ze.z=Dl(ze.x,ze.y,K,le,ve)),ze.prevZ=ze.prev,ze.nextZ=ze.next,ze=ze.next;while(ze!==Y);ze.prevZ.nextZ=null,ze.prevZ=null,function(I){var ht,Je,wt,Bt,nr,or,mr,Zr,qr=1;do{for(Je=I,I=null,nr=null,or=0;Je;){for(or++,wt=Je,mr=0,ht=0;ht<qr&&(mr++,wt=wt.nextZ);ht++);for(Zr=qr;mr>0||Zr>0&&wt;)mr!==0&&(Zr===0||!wt||Je.z<=wt.z)?(Bt=Je,Je=Je.nextZ,mr--):(Bt=wt,wt=wt.nextZ,Zr--),nr?nr.nextZ=Bt:I=Bt,Bt.prevZ=nr,nr=Bt;Je=wt}nr.nextZ=null,qr*=2}while(or>1)}(ze)}(o,m,x,E);for(var R,L,V=o;o.prev!==o.next;)if(R=o.prev,L=o.next,E?Ld(o,m,x,E):Zv(o))u.push(R.i/c),u.push(o.i/c),u.push(L.i/c),Dc(o),o=L.next,V=L.next;else if((o=L)===V){A?A===1?Ih(o=og(Pc(o),u,c),u,c,m,x,E,2):A===2&&Vp(o,u,c,m,x,E):Ih(Pc(o),u,c,m,x,E,1);break}}}function Zv(o){var u=o.prev,c=o,m=o.next;if(eo(u,c,m)>=0)return!1;for(var x=o.next.next;x!==o.prev;){if(Oc(u.x,u.y,c.x,c.y,m.x,m.y,x.x,x.y)&&eo(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function Ld(o,u,c,m){var x=o.prev,E=o,A=o.next;if(eo(x,E,A)>=0)return!1;for(var R=x.x>E.x?x.x>A.x?x.x:A.x:E.x>A.x?E.x:A.x,L=x.y>E.y?x.y>A.y?x.y:A.y:E.y>A.y?E.y:A.y,V=Dl(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),Y=Dl(R,L,u,c,m),K=o.prevZ,le=o.nextZ;K&&K.z>=V&&le&&le.z<=Y;){if(K!==o.prev&&K!==o.next&&Oc(x.x,x.y,E.x,E.y,A.x,A.y,K.x,K.y)&&eo(K.prev,K,K.next)>=0||(K=K.prevZ,le!==o.prev&&le!==o.next&&Oc(x.x,x.y,E.x,E.y,A.x,A.y,le.x,le.y)&&eo(le.prev,le,le.next)>=0))return!1;le=le.nextZ}for(;K&&K.z>=V;){if(K!==o.prev&&K!==o.next&&Oc(x.x,x.y,E.x,E.y,A.x,A.y,K.x,K.y)&&eo(K.prev,K,K.next)>=0)return!1;K=K.prevZ}for(;le&&le.z<=Y;){if(le!==o.prev&&le!==o.next&&Oc(x.x,x.y,E.x,E.y,A.x,A.y,le.x,le.y)&&eo(le.prev,le,le.next)>=0)return!1;le=le.nextZ}return!0}function og(o,u,c){var m=o;do{var x=m.prev,E=m.next.next;!Wf(x,E)&&Gf(x,m,m.next,E)&&kc(x,E)&&kc(E,x)&&(u.push(x.i/c),u.push(m.i/c),u.push(E.i/c),Dc(m),Dc(m.next),m=o=E),m=m.next}while(m!==o);return Pc(m)}function Vp(o,u,c,m,x,E){var A=o;do{for(var R=A.next.next;R!==A.prev;){if(A.i!==R.i&&Hp(A,R)){var L=Xf(A,R);return A=Pc(A,A.next),L=Pc(L,L.next),Ih(A,u,c,m,x,E),void Ih(L,u,c,m,x,E)}R=R.next}A=A.next}while(A!==o)}function Bd(o,u){return o.x-u.x}function Fd(o,u){if(u=function(m,x){var E,A=x,R=m.x,L=m.y,V=-1/0;do{if(L<=A.y&&L>=A.next.y&&A.next.y!==A.y){var Y=A.x+(L-A.y)*(A.next.x-A.x)/(A.next.y-A.y);if(Y<=R&&Y>V){if(V=Y,Y===R){if(L===A.y)return A;if(L===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(R===V)return E;var K,le=E,ve=E.x,ze=E.y,I=1/0;A=E;do R>=A.x&&A.x>=ve&&R!==A.x&&Oc(L<ze?R:V,L,ve,ze,L<ze?V:R,L,A.x,A.y)&&(K=Math.abs(L-A.y)/(R-A.x),kc(A,m)&&(K<I||K===I&&(A.x>E.x||A.x===E.x&&jp(E,A)))&&(E=A,I=K)),A=A.next;while(A!==le);return E}(o,u)){var c=Xf(u,o);Pc(u,u.next),Pc(c,c.next)}}function jp(o,u){return eo(o.prev,o,u.prev)<0&&eo(u.next,o,o.next)<0}function Dl(o,u,c,m,x){return(o=1431655765&((o=858993459&((o=252645135&((o=16711935&((o=32767*(o-c)*x)|o<<8))|o<<4))|o<<2))|o<<1))|(u=1431655765&((u=858993459&((u=252645135&((u=16711935&((u=32767*(u-m)*x)|u<<8))|u<<4))|u<<2))|u<<1))<<1}function vp(o){var u=o,c=o;do(u.x<c.x||u.x===c.x&&u.y<c.y)&&(c=u),u=u.next;while(u!==o);return c}function Oc(o,u,c,m,x,E,A,R){return(x-A)*(u-R)-(o-A)*(E-R)>=0&&(o-A)*(m-R)-(c-A)*(u-R)>=0&&(c-A)*(E-R)-(x-A)*(m-R)>=0}function Hp(o,u){return o.next.i!==u.i&&o.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&&Gf(x,x.next,c,m))return!0;x=x.next}while(x!==c);return!1}(o,u)&&(kc(o,u)&&kc(u,o)&&function(c,m){var x=c,E=!1,A=(c.x+m.x)/2,R=(c.y+m.y)/2;do x.y>R!=x.next.y>R&&x.next.y!==x.y&&A<(x.next.x-x.x)*(R-x.y)/(x.next.y-x.y)+x.x&&(E=!E),x=x.next;while(x!==c);return E}(o,u)&&(eo(o.prev,o,u.prev)||eo(o,u.prev,u))||Wf(o,u)&&eo(o.prev,o,o.next)>0&&eo(u.prev,u,u.next)>0)}function eo(o,u,c){return(u.y-o.y)*(c.x-u.x)-(u.x-o.x)*(c.y-u.y)}function Wf(o,u){return o.x===u.x&&o.y===u.y}function Gf(o,u,c,m){var x=lf(eo(o,u,c)),E=lf(eo(o,u,m)),A=lf(eo(c,m,o)),R=lf(eo(c,m,u));return x!==E&&A!==R||!(x!==0||!vl(o,c,u))||!(E!==0||!vl(o,m,u))||!(A!==0||!vl(c,o,m))||!(R!==0||!vl(c,u,m))}function vl(o,u,c){return u.x<=Math.max(o.x,c.x)&&u.x>=Math.min(o.x,c.x)&&u.y<=Math.max(o.y,c.y)&&u.y>=Math.min(o.y,c.y)}function lf(o){return o>0?1:o<0?-1:0}function kc(o,u){return eo(o.prev,o,o.next)<0?eo(o,u,o.next)>=0&&eo(o,o.prev,u)>=0:eo(o,u,o.prev)<0||eo(o,o.next,u)<0}function Xf(o,u){var c=new Lc(o.i,o.x,o.y),m=new Lc(u.i,u.x,u.y),x=o.next,E=u.prev;return o.next=u,u.prev=o,c.next=x,x.prev=c,m.next=c,c.prev=m,E.next=m,m.prev=E,m}function $f(o,u,c,m){var x=new Lc(o,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 Dc(o){o.next.prev=o.prev,o.prev.next=o.next,o.prevZ&&(o.prevZ.nextZ=o.nextZ),o.nextZ&&(o.nextZ.prevZ=o.prevZ)}function Lc(o,u,c){this.i=o,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 ac(o,u,c,m){for(var x=0,E=u,A=c-m;E<c;E+=m)x+=(o[A]-o[E])*(o[E+1]+o[A+1]),A=E;return x}function Wp(o,u,c,m,x){(function E(A,R,L,V,Y){for(;V>L;){if(V-L>600){var K=V-L+1,le=R-L+1,ve=Math.log(K),ze=.5*Math.exp(2*ve/3),I=.5*Math.sqrt(ve*ze*(K-ze)/K)*(le-K/2<0?-1:1);E(A,R,Math.max(L,Math.floor(R-le*ze/K+I)),Math.min(V,Math.floor(R+(K-le)*ze/K+I)),Y)}var ht=A[R],Je=L,wt=V;for(oc(A,L,R),Y(A[V],ht)>0&&oc(A,L,V);Je<wt;){for(oc(A,Je,wt),Je++,wt--;Y(A[Je],ht)<0;)Je++;for(;Y(A[wt],ht)>0;)wt--}Y(A[L],ht)===0?oc(A,L,wt):oc(A,++wt,V),wt<=R&&(L=wt+1),R<=wt&&(V=wt-1)}})(o,u,c||0,m||o.length-1,x||Hs)}function oc(o,u,c){var m=o[u];o[u]=o[c],o[c]=m}function Hs(o,u){return o<u?-1:o>u?1:0}function mp(o,u){var c=o.length;if(c<=1)return[o];for(var m,x,E=[],A=0;A<c;A++){var R=dr(o[A]);R!==0&&(o[A].area=Math.abs(R),x===void 0&&(x=R<0),x===R<0?(m&&E.push(m),m=[o[A]]):m.push(o[A]))}if(m&&E.push(m),u>1)for(var L=0;L<E.length;L++)E[L].length<=u||(Wp(E[L],u,1,E[L].length-1,Gp),E[L]=E[L].slice(0,u));return E}function Gp(o,u){return u.area-o.area}function Xp(o,u,c){for(var m=c.patternDependencies,x=!1,E=0,A=u;E<A.length;E+=1){var R=A[E].paint.get(o+"-pattern");R.isConstant()||(x=!0);var L=R.constantOr(null);L&&(x=!0,m[L.to]=!0,m[L.from]=!0)}return x}function Ph(o,u,c,m,x){for(var E=x.patternDependencies,A=0,R=u;A<R.length;A+=1){var L=R[A],V=L.paint.get(o+"-pattern").value;if(V.kind!=="constant"){var Y=V.evaluate({zoom:m-1},c,{},x.availableImages),K=V.evaluate({zoom:m},c,{},x.availableImages),le=V.evaluate({zoom:m+1},c,{},x.availableImages);K=K&&K.name?K.name:K,le=le&&le.name?le.name:le,E[Y=Y&&Y.name?Y.name:Y]=!0,E[K]=!0,E[le]=!0,c.patterns[L.id]={min:Y,mid:K,max:le}}}return c}Mh.deviation=function(o,u,c,m){var x=u&&u.length,E=Math.abs(ac(o,0,x?u[0]*c:o.length,c));if(x)for(var A=0,R=u.length;A<R;A++)E-=Math.abs(ac(o,u[A]*c,A<R-1?u[A+1]*c:o.length,c));var L=0;for(A=0;A<m.length;A+=3){var V=m[A]*c,Y=m[A+1]*c,K=m[A+2]*c;L+=Math.abs((o[V]-o[K])*(o[Y+1]-o[V+1])-(o[V]-o[Y])*(o[K+1]-o[V+1]))}return E===0&&L===0?0:Math.abs((L-E)/E)},Mh.flatten=function(o){for(var u=o[0][0].length,c={vertices:[],holes:[],dimensions:u},m=0,x=0;x<o.length;x++){for(var E=0;E<o[x].length;E++)for(var A=0;A<u;A++)c.vertices.push(o[x][E][A]);x>0&&c.holes.push(m+=o[x-1].length)}return c},Hf.default=dp;var ml=function(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(function(u){return u.id}),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ol,this.indexArray=new us,this.indexArray2=new ju,this.programConfigurations=new Gn(o.layers,o.zoom),this.segments=new be,this.segments2=new be,this.stateDependentLayerIds=this.layers.filter(function(u){return u.isStateDependent()}).map(function(u){return u.id})};ml.prototype.populate=function(o,u,c){this.hasPattern=Xp("fill",this.layers,u);for(var m=this.layers[0].layout.get("fill-sort-key"),x=[],E=0,A=o;E<A.length;E+=1){var R=A[E],L=R.feature,V=R.id,Y=R.index,K=R.sourceLayerIndex,le=this.layers[0]._featureFilter.needGeometry,ve=Ja(L,le);if(this.layers[0]._featureFilter.filter(new Me(this.zoom),ve,c)){var ze=m?m.evaluate(ve,{},c,u.availableImages):void 0,I={id:V,properties:L.properties,type:L.type,sourceLayerIndex:K,index:Y,geometry:le?ve.geometry:Wa(L),patterns:{},sortKey:ze};x.push(I)}}m&&x.sort(function(Zr,qr){return Zr.sortKey-qr.sortKey});for(var ht=0,Je=x;ht<Je.length;ht+=1){var wt=Je[ht],Bt=wt.geometry,nr=wt.index,or=wt.sourceLayerIndex;if(this.hasPattern){var mr=Ph("fill",this.layers,wt,this.zoom,u);this.patternFeatures.push(mr)}else this.addFeature(wt,Bt,nr,c,{});u.featureIndex.insert(o[nr].feature,Bt,nr,or,this.index)}},ml.prototype.update=function(o,u,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,u,this.stateDependentLayers,c)},ml.prototype.addFeatures=function(o,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)}},ml.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ml.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ml.prototype.upload=function(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,zv),this.indexBuffer=o.createIndexBuffer(this.indexArray),this.indexBuffer2=o.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(o),this.uploaded=!0},ml.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ml.prototype.addFeature=function(o,u,c,m,x){for(var E=0,A=mp(u,500);E<A.length;E+=1){for(var R=A[E],L=0,V=0,Y=R;V<Y.length;V+=1)L+=Y[V].length;for(var K=this.segments.prepareSegment(L,this.layoutVertexArray,this.indexArray),le=K.vertexLength,ve=[],ze=[],I=0,ht=R;I<ht.length;I+=1){var Je=ht[I];if(Je.length!==0){Je!==R[0]&&ze.push(ve.length/2);var wt=this.segments2.prepareSegment(Je.length,this.layoutVertexArray,this.indexArray2),Bt=wt.vertexLength;this.layoutVertexArray.emplaceBack(Je[0].x,Je[0].y),this.indexArray2.emplaceBack(Bt+Je.length-1,Bt),ve.push(Je[0].x),ve.push(Je[0].y);for(var nr=1;nr<Je.length;nr++)this.layoutVertexArray.emplaceBack(Je[nr].x,Je[nr].y),this.indexArray2.emplaceBack(Bt+nr-1,Bt+nr),ve.push(Je[nr].x),ve.push(Je[nr].y);wt.vertexLength+=Je.length,wt.primitiveLength+=Je.length}}for(var or=Hf(ve,ze),mr=0;mr<or.length;mr+=3)this.indexArray.emplaceBack(le+or[mr],le+or[mr+1],le+or[mr+2]);K.vertexLength+=L,K.primitiveLength+=or.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,c,x,m)},xn("FillBucket",ml,{omit:["layers","patternFeatures"]});var Gu=new Ba({"fill-sort-key":new An(j.layout_fill["fill-sort-key"])}),Nd={paint:new Ba({"fill-antialias":new Bn(j.paint_fill["fill-antialias"]),"fill-opacity":new An(j.paint_fill["fill-opacity"]),"fill-color":new An(j.paint_fill["fill-color"]),"fill-outline-color":new An(j.paint_fill["fill-outline-color"]),"fill-translate":new Bn(j.paint_fill["fill-translate"]),"fill-translate-anchor":new Bn(j.paint_fill["fill-translate-anchor"]),"fill-pattern":new os(j.paint_fill["fill-pattern"])}),layout:Gu},gp=function(o){function u(c){o.call(this,c,Nd)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.recalculate=function(c,m){o.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 ml(c)},u.prototype.queryRadius=function(){return ao(this.paint.get("fill-translate"))},u.prototype.queryIntersectsFeature=function(c,m,x,E,A,R,L){return lu(Ps(c,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),R.angle,L),E)},u.prototype.isTileClipped=function(){return!0},u}(tu),Ud=yo([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Oh=Bc;function Bc(o,u,c,m,x){this.properties={},this.extent=c,this.type=0,this._pbf=o,this._geometry=-1,this._keys=m,this._values=x,o.readFields($p,this,u)}function $p(o,u,c){o==1?u.id=c.readVarint():o==2?function(m,x){for(var E=m.readVarint()+m.pos;m.pos<E;){var A=x._keys[m.readVarint()],R=x._values[m.readVarint()];x.properties[A]=R}}(c,u):o==3?u.type=c.readVarint():o==4&&(u._geometry=c.pos)}function Xu(o){for(var u,c,m=0,x=0,E=o.length,A=E-1;x<E;A=x++)m+=((c=o[A]).x-(u=o[x]).x)*(u.y+c.y);return m}Bc.types=["Unknown","Point","LineString","Polygon"],Bc.prototype.loadGeometry=function(){var o=this._pbf;o.pos=this._geometry;for(var u,c=o.readVarint()+o.pos,m=1,x=0,E=0,A=0,R=[];o.pos<c;){if(x<=0){var L=o.readVarint();m=7&L,x=L>>3}if(x--,m===1||m===2)E+=o.readSVarint(),A+=o.readSVarint(),m===1&&(u&&R.push(u),u=[]),u.push(new fe(E,A));else{if(m!==7)throw new Error("unknown command "+m);u&&u.push(u[0].clone())}}return u&&R.push(u),R},Bc.prototype.bbox=function(){var o=this._pbf;o.pos=this._geometry;for(var u=o.readVarint()+o.pos,c=1,m=0,x=0,E=0,A=1/0,R=-1/0,L=1/0,V=-1/0;o.pos<u;){if(m<=0){var Y=o.readVarint();c=7&Y,m=Y>>3}if(m--,c===1||c===2)(x+=o.readSVarint())<A&&(A=x),x>R&&(R=x),(E+=o.readSVarint())<L&&(L=E),E>V&&(V=E);else if(c!==7)throw new Error("unknown command "+c)}return[A,L,R,V]},Bc.prototype.toGeoJSON=function(o,u,c){var m,x,E=this.extent*Math.pow(2,c),A=this.extent*o,R=this.extent*u,L=this.loadGeometry(),V=Bc.types[this.type];function Y(ve){for(var ze=0;ze<ve.length;ze++){var I=ve[ze];ve[ze]=[360*(I.x+A)/E-180,360/Math.PI*Math.atan(Math.exp((180-360*(I.y+R)/E)*Math.PI/180))-90]}}switch(this.type){case 1:var K=[];for(m=0;m<L.length;m++)K[m]=L[m][0];Y(L=K);break;case 2:for(m=0;m<L.length;m++)Y(L[m]);break;case 3:for(L=function(ve){var ze=ve.length;if(ze<=1)return[ve];for(var I,ht,Je=[],wt=0;wt<ze;wt++){var Bt=Xu(ve[wt]);Bt!==0&&(ht===void 0&&(ht=Bt<0),ht===Bt<0?(I&&Je.push(I),I=[ve[wt]]):I.push(ve[wt]))}return I&&Je.push(I),Je}(L),m=0;m<L.length;m++)for(x=0;x<L[m].length;x++)Y(L[m][x])}L.length===1?L=L[0]:V="Multi"+V;var le={type:"Feature",geometry:{type:V,coordinates:L},properties:this.properties};return"id"in this&&(le.id=this.id),le};var yp=Fc;function Fc(o,u){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=o,this._keys=[],this._values=[],this._features=[],o.readFields(Ws,this,u),this.length=this._features.length}function Ws(o,u,c){o===15?u.version=c.readVarint():o===1?u.name=c.readString():o===5?u.extent=c.readVarint():o===2?u._features.push(c.pos):o===3?u._keys.push(c.readString()):o===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 zd(o,u,c){if(o===3){var m=new yp(c,c.readVarint()+c.pos);m.length&&(u[m.name]=m)}}Fc.prototype.feature=function(o){if(o<0||o>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[o];var u=this._pbf.readVarint()+this._pbf.pos;return new Oh(this._pbf,u,this.extent,this._keys,this._values)};var sc={VectorTile:function(o,u){this.layers=o.readFields(zd,{},u)},VectorTileFeature:Oh,VectorTileLayer:yp},kh=sc.VectorTileFeature.types,Yf=Math.pow(2,13);function ls(o,u,c,m,x,E,A,R){o.emplaceBack(u,c,2*Math.floor(m*Yf)+A,x*Yf*2,E*Yf*2,Math.round(R))}var As=function(o){this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(function(u){return u.id}),this.index=o.index,this.hasPattern=!1,this.layoutVertexArray=new cl,this.indexArray=new us,this.programConfigurations=new Gn(o.layers,o.zoom),this.segments=new be,this.stateDependentLayerIds=this.layers.filter(function(u){return u.isStateDependent()}).map(function(u){return u.id})};function Bo(o,u){return o.x===u.x&&(o.x<0||o.x>8192)||o.y===u.y&&(o.y<0||o.y>8192)}As.prototype.populate=function(o,u,c){this.features=[],this.hasPattern=Xp("fill-extrusion",this.layers,u);for(var m=0,x=o;m<x.length;m+=1){var E=x[m],A=E.feature,R=E.id,L=E.index,V=E.sourceLayerIndex,Y=this.layers[0]._featureFilter.needGeometry,K=Ja(A,Y);if(this.layers[0]._featureFilter.filter(new Me(this.zoom),K,c)){var le={id:R,sourceLayerIndex:V,index:L,geometry:Y?K.geometry:Wa(A),properties:A.properties,type:A.type,patterns:{}};this.hasPattern?this.features.push(Ph("fill-extrusion",this.layers,le,this.zoom,u)):this.addFeature(le,le.geometry,L,c,{}),u.featureIndex.insert(A,le.geometry,L,V,this.index,!0)}}},As.prototype.addFeatures=function(o,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)}},As.prototype.update=function(o,u,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,u,this.stateDependentLayers,c)},As.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},As.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},As.prototype.upload=function(o){this.uploaded||(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,Ud),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0},As.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},As.prototype.addFeature=function(o,u,c,m,x){for(var E=0,A=mp(u,500);E<A.length;E+=1){for(var R=A[E],L=0,V=0,Y=R;V<Y.length;V+=1)L+=Y[V].length;for(var K=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),le=0,ve=R;le<ve.length;le+=1){var ze=ve[le];if(ze.length!==0&&!((Mi=ze).every(function(mi){return mi.x<0})||Mi.every(function(mi){return mi.x>8192})||Mi.every(function(mi){return mi.y<0})||Mi.every(function(mi){return mi.y>8192})))for(var I=0,ht=0;ht<ze.length;ht++){var Je=ze[ht];if(ht>=1){var wt=ze[ht-1];if(!Bo(Je,wt)){K.vertexLength+4>be.MAX_VERTEX_ARRAY_LENGTH&&(K=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Bt=Je.sub(wt)._perp()._unit(),nr=wt.dist(Je);I+nr>32768&&(I=0),ls(this.layoutVertexArray,Je.x,Je.y,Bt.x,Bt.y,0,0,I),ls(this.layoutVertexArray,Je.x,Je.y,Bt.x,Bt.y,0,1,I),ls(this.layoutVertexArray,wt.x,wt.y,Bt.x,Bt.y,0,0,I+=nr),ls(this.layoutVertexArray,wt.x,wt.y,Bt.x,Bt.y,0,1,I);var or=K.vertexLength;this.indexArray.emplaceBack(or,or+2,or+1),this.indexArray.emplaceBack(or+1,or+2,or+3),K.vertexLength+=4,K.primitiveLength+=2}}}}if(K.vertexLength+L>be.MAX_VERTEX_ARRAY_LENGTH&&(K=this.segments.prepareSegment(L,this.layoutVertexArray,this.indexArray)),kh[o.type]==="Polygon"){for(var mr=[],Zr=[],qr=K.vertexLength,Nn=0,vn=R;Nn<vn.length;Nn+=1){var Zn=vn[Nn];if(Zn.length!==0){Zn!==R[0]&&Zr.push(mr.length/2);for(var mn=0;mn<Zn.length;mn++){var bi=Zn[mn];ls(this.layoutVertexArray,bi.x,bi.y,0,0,1,1,0),mr.push(bi.x),mr.push(bi.y)}}}for(var ei=Hf(mr,Zr),Mn=0;Mn<ei.length;Mn+=3)this.indexArray.emplaceBack(qr+ei[Mn],qr+ei[Mn+2],qr+ei[Mn+1]);K.primitiveLength+=ei.length/3,K.vertexLength+=L}}var Mi;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,c,x,m)},xn("FillExtrusionBucket",As,{omit:["layers","features"]});var pu={paint:new Ba({"fill-extrusion-opacity":new Bn(j["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new An(j["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Bn(j["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Bn(j["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new os(j["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new An(j["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new An(j["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Bn(j["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Yp=function(o){function u(c){o.call(this,c,pu)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.createBucket=function(c){return new As(c)},u.prototype.queryRadius=function(){return ao(this.paint.get("fill-extrusion-translate"))},u.prototype.is3D=function(){return!0},u.prototype.queryIntersectsFeature=function(c,m,x,E,A,R,L,V){var Y=Ps(c,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),R.angle,L),K=this.paint.get("fill-extrusion-height").evaluate(m,x),le=this.paint.get("fill-extrusion-base").evaluate(m,x),ve=function(I,ht,Je,wt){for(var Bt=[],nr=0,or=I;nr<or.length;nr+=1){var mr=or[nr],Zr=[mr.x,mr.y,0,1];Wu(Zr,Zr,ht),Bt.push(new fe(Zr[0]/Zr[3],Zr[1]/Zr[3]))}return Bt}(Y,V),ze=function(I,ht,Je,wt){for(var Bt=[],nr=[],or=wt[8]*ht,mr=wt[9]*ht,Zr=wt[10]*ht,qr=wt[11]*ht,Nn=wt[8]*Je,vn=wt[9]*Je,Zn=wt[10]*Je,mn=wt[11]*Je,bi=0,ei=I;bi<ei.length;bi+=1){for(var Mn=[],Mi=[],mi=0,Hi=ei[bi];mi<Hi.length;mi+=1){var Hn=Hi[mi],ea=Hn.x,Ta=Hn.y,so=wt[0]*ea+wt[4]*Ta+wt[12],ro=wt[1]*ea+wt[5]*Ta+wt[13],Fa=wt[2]*ea+wt[6]*Ta+wt[14],$a=wt[3]*ea+wt[7]*Ta+wt[15],ts=Fa+Zr,Ho=$a+qr,Gs=so+Nn,hs=ro+vn,ks=Fa+Zn,To=$a+mn,wa=new fe((so+or)/Ho,(ro+mr)/Ho);wa.z=ts/Ho,Mn.push(wa);var Ni=new fe(Gs/To,hs/To);Ni.z=ks/To,Mi.push(Ni)}Bt.push(Mn),nr.push(Mi)}return[Bt,nr]}(E,le,K,V);return function(I,ht,Je){var wt=1/0;lu(Je,ht)&&(wt=qp(Je,ht[0]));for(var Bt=0;Bt<ht.length;Bt++)for(var nr=ht[Bt],or=I[Bt],mr=0;mr<nr.length-1;mr++){var Zr=nr[mr],qr=[Zr,nr[mr+1],or[mr+1],or[mr],Zr];fl(Je,qr)&&(wt=Math.min(wt,qp(Je,qr)))}return wt!==1/0&&wt}(ze[0],ze[1],ve)},u}(tu);function cf(o,u){return o.x*u.x+o.y*u.y}function qp(o,u){if(o.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=o[0],R=c.sub(x),L=E.sub(x),V=A.sub(x),Y=cf(R,R),K=cf(R,L),le=cf(L,L),ve=cf(V,R),ze=cf(V,L),I=Y*le-K*K,ht=(le*ve-K*ze)/I,Je=(Y*ze-K*ve)/I,wt=x.z*(1-ht-Je)+c.z*ht+E.z*Je;if(isFinite(wt))return wt}return 1/0}for(var Bt=1/0,nr=0,or=u;nr<or.length;nr+=1)Bt=Math.min(Bt,or[nr].z);return Bt}var Zd=yo([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Vv=yo([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Vd=sc.VectorTileFeature.types,Kp=Math.cos(Math.PI/180*37.5),jd=Math.pow(2,14)/.5,Os=function(o){var u=this;this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(function(c){return c.id}),this.index=o.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(c){u.gradients[c.id]={}}),this.layoutVertexArray=new xs,this.layoutVertexArray2=new ec,this.indexArray=new us,this.programConfigurations=new Gn(o.layers,o.zoom),this.segments=new be,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(c){return c.isStateDependent()}).map(function(c){return c.id})};Os.prototype.populate=function(o,u,c){this.hasPattern=Xp("line",this.layers,u);for(var m=this.layers[0].layout.get("line-sort-key"),x=[],E=0,A=o;E<A.length;E+=1){var R=A[E],L=R.feature,V=R.id,Y=R.index,K=R.sourceLayerIndex,le=this.layers[0]._featureFilter.needGeometry,ve=Ja(L,le);if(this.layers[0]._featureFilter.filter(new Me(this.zoom),ve,c)){var ze=m?m.evaluate(ve,{},c):void 0,I={id:V,properties:L.properties,type:L.type,sourceLayerIndex:K,index:Y,geometry:le?ve.geometry:Wa(L),patterns:{},sortKey:ze};x.push(I)}}m&&x.sort(function(Zr,qr){return Zr.sortKey-qr.sortKey});for(var ht=0,Je=x;ht<Je.length;ht+=1){var wt=Je[ht],Bt=wt.geometry,nr=wt.index,or=wt.sourceLayerIndex;if(this.hasPattern){var mr=Ph("line",this.layers,wt,this.zoom,u);this.patternFeatures.push(mr)}else this.addFeature(wt,Bt,nr,c,{});u.featureIndex.insert(o[nr].feature,Bt,nr,or,this.index)}},Os.prototype.update=function(o,u,c){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(o,u,this.stateDependentLayers,c)},Os.prototype.addFeatures=function(o,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)}},Os.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Os.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Os.prototype.upload=function(o){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=o.createVertexBuffer(this.layoutVertexArray2,Vv)),this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,Zd),this.indexBuffer=o.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(o),this.uploaded=!0},Os.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Os.prototype.lineFeatureClips=function(o){if(o.properties&&o.properties.hasOwnProperty("mapbox_clip_start")&&o.properties.hasOwnProperty("mapbox_clip_end"))return{start:+o.properties.mapbox_clip_start,end:+o.properties.mapbox_clip_end}},Os.prototype.addFeature=function(o,u,c,m,x){var E=this.layers[0].layout,A=E.get("line-join").evaluate(o,{}),R=E.get("line-cap"),L=E.get("line-miter-limit"),V=E.get("line-round-limit");this.lineClips=this.lineFeatureClips(o);for(var Y=0,K=u;Y<K.length;Y+=1)this.addLine(K[Y],o,A,R,L,V);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,o,c,x,m)},Os.prototype.addLine=function(o,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<o.length-1;A++)this.totalDistance+=o[A].dist(o[A+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var R=Vd[u.type]==="Polygon",L=o.length;L>=2&&o[L-1].equals(o[L-2]);)L--;for(var V=0;V<L-1&&o[V].equals(o[V+1]);)V++;if(!(L<(R?3:2))){c==="bevel"&&(x=1.05);var Y,K=this.overscaling<=16?122880/(512*this.overscaling):0,le=this.segments.prepareSegment(10*L,this.layoutVertexArray,this.indexArray),ve=void 0,ze=void 0,I=void 0,ht=void 0;this.e1=this.e2=-1,R&&(ht=o[V].sub(Y=o[L-2])._unit()._perp());for(var Je=V;Je<L;Je++)if(!(ze=Je===L-1?R?o[V+1]:void 0:o[Je+1])||!o[Je].equals(ze)){ht&&(I=ht),Y&&(ve=Y),Y=o[Je],ht=ze?ze.sub(Y)._unit()._perp():I;var wt=(I=I||ht).add(ht);wt.x===0&&wt.y===0||wt._unit();var Bt=I.x*ht.x+I.y*ht.y,nr=wt.x*ht.x+wt.y*ht.y,or=nr!==0?1/nr:1/0,mr=2*Math.sqrt(2-2*nr),Zr=nr<Kp&&ve&&ze,qr=I.x*ht.y-I.y*ht.x>0;if(Zr&&Je>V){var Nn=Y.dist(ve);if(Nn>2*K){var vn=Y.sub(Y.sub(ve)._mult(K/Nn)._round());this.updateDistance(ve,vn),this.addCurrentVertex(vn,I,0,0,le),ve=vn}}var Zn=ve&&ze,mn=Zn?c:R?"butt":m;if(Zn&&mn==="round"&&(or<E?mn="miter":or<=2&&(mn="fakeround")),mn==="miter"&&or>x&&(mn="bevel"),mn==="bevel"&&(or>2&&(mn="flipbevel"),or<x&&(mn="miter")),ve&&this.updateDistance(ve,Y),mn==="miter")wt._mult(or),this.addCurrentVertex(Y,wt,0,0,le);else if(mn==="flipbevel"){if(or>100)wt=ht.mult(-1);else{var bi=or*I.add(ht).mag()/I.sub(ht).mag();wt._perp()._mult(bi*(qr?-1:1))}this.addCurrentVertex(Y,wt,0,0,le),this.addCurrentVertex(Y,wt.mult(-1),0,0,le)}else if(mn==="bevel"||mn==="fakeround"){var ei=-Math.sqrt(or*or-1),Mn=qr?ei:0,Mi=qr?0:ei;if(ve&&this.addCurrentVertex(Y,I,Mn,Mi,le),mn==="fakeround")for(var mi=Math.round(180*mr/Math.PI/20),Hi=1;Hi<mi;Hi++){var Hn=Hi/mi;if(Hn!==.5){var ea=Hn-.5;Hn+=Hn*ea*(Hn-1)*((1.0904+Bt*(Bt*(3.55645-1.43519*Bt)-3.2452))*ea*ea+(.848013+Bt*(.215638*Bt-1.06021)))}var Ta=ht.sub(I)._mult(Hn)._add(I)._unit()._mult(qr?-1:1);this.addHalfVertex(Y,Ta.x,Ta.y,!1,qr,0,le)}ze&&this.addCurrentVertex(Y,ht,-Mn,-Mi,le)}else if(mn==="butt")this.addCurrentVertex(Y,wt,0,0,le);else if(mn==="square"){var so=ve?1:-1;this.addCurrentVertex(Y,wt,so,so,le)}else mn==="round"&&(ve&&(this.addCurrentVertex(Y,I,0,0,le),this.addCurrentVertex(Y,I,1,1,le,!0)),ze&&(this.addCurrentVertex(Y,ht,-1,-1,le,!0),this.addCurrentVertex(Y,ht,0,0,le)));if(Zr&&Je<L-1){var ro=Y.dist(ze);if(ro>2*K){var Fa=Y.add(ze.sub(Y)._mult(K/ro)._round());this.updateDistance(Y,Fa),this.addCurrentVertex(Fa,ht,0,0,le),Y=Fa}}}}},Os.prototype.addCurrentVertex=function(o,u,c,m,x,E){E===void 0&&(E=!1);var A=u.y*m-u.x,R=-u.y-u.x*m;this.addHalfVertex(o,u.x+u.y*c,u.y-u.x*c,E,!1,c,x),this.addHalfVertex(o,A,R,E,!0,-m,x),this.distance>jd/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(o,u,c,m,x,E))},Os.prototype.addHalfVertex=function(o,u,c,m,x,E,A){var R=.5*(this.lineClips?this.scaledDistance*(jd-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((o.x<<1)+(m?1:0),(o.y<<1)+(x?1:0),Math.round(63*u)+128,Math.round(63*c)+128,1+(E===0?0:E<0?-1:1)|(63&R)<<2,R>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var L=A.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,L),A.primitiveLength++),x?this.e2=L:this.e1=L},Os.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Os.prototype.updateDistance=function(o,u){this.distance+=o.dist(u),this.updateScaledDistance()},xn("LineBucket",Os,{omit:["layers","patternFeatures"]});var _p=new Ba({"line-cap":new Bn(j.layout_line["line-cap"]),"line-join":new An(j.layout_line["line-join"]),"line-miter-limit":new Bn(j.layout_line["line-miter-limit"]),"line-round-limit":new Bn(j.layout_line["line-round-limit"]),"line-sort-key":new An(j.layout_line["line-sort-key"])}),xp={paint:new Ba({"line-opacity":new An(j.paint_line["line-opacity"]),"line-color":new An(j.paint_line["line-color"]),"line-translate":new Bn(j.paint_line["line-translate"]),"line-translate-anchor":new Bn(j.paint_line["line-translate-anchor"]),"line-width":new An(j.paint_line["line-width"]),"line-gap-width":new An(j.paint_line["line-gap-width"]),"line-offset":new An(j.paint_line["line-offset"]),"line-blur":new An(j.paint_line["line-blur"]),"line-dasharray":new ss(j.paint_line["line-dasharray"]),"line-pattern":new os(j.paint_line["line-pattern"]),"line-gradient":new xu(j.paint_line["line-gradient"])}),layout:_p},Qp=new(function(o){function u(){o.apply(this,arguments)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.possiblyEvaluate=function(c,m){return m=new Me(Math.floor(m.zoom),{now:m.now,fadeDuration:m.fadeDuration,zoomHistory:m.zoomHistory,transition:m.transition}),o.prototype.possiblyEvaluate.call(this,c,m)},u.prototype.evaluate=function(c,m,x,E){return m=Yt({},m,{zoom:Math.floor(m.zoom)}),o.prototype.evaluate.call(this,c,m,x,E)},u}(An))(xp.paint.properties["line-width"].specification);Qp.useIntegerZoom=!0;var qf=function(o){function u(c){o.call(this,c,xp),this.gradientVersion=0}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype._handleSpecialPaintPropertyUpdate=function(c){c==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Bs,this.gradientVersion=(this.gradientVersion+1)%rt)},u.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},u.prototype.recalculate=function(c,m){o.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 Os(c)},u.prototype.queryRadius=function(c){var m=c,x=Jp(Oo("line-width",this,m),Oo("line-gap-width",this,m)),E=Oo("line-offset",this,m);return x/2+Math.abs(E)+ao(this.paint.get("line-translate"))},u.prototype.queryIntersectsFeature=function(c,m,x,E,A,R,L){var V=Ps(c,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),R.angle,L),Y=L/2*Jp(this.paint.get("line-width").evaluate(m,x),this.paint.get("line-gap-width").evaluate(m,x)),K=this.paint.get("line-offset").evaluate(m,x);return K&&(E=function(le,ve){for(var ze=[],I=new fe(0,0),ht=0;ht<le.length;ht++){for(var Je=le[ht],wt=[],Bt=0;Bt<Je.length;Bt++){var nr=Je[Bt],or=Je[Bt+1],mr=Bt===0?I:nr.sub(Je[Bt-1])._unit()._perp(),Zr=Bt===Je.length-1?I:or.sub(nr)._unit()._perp(),qr=mr._add(Zr)._unit();qr._mult(1/(qr.x*Zr.x+qr.y*Zr.y)),wt.push(qr._mult(ve)._add(nr))}ze.push(wt)}return ze}(E,K*L)),function(le,ve,ze){for(var I=0;I<ve.length;I++){var ht=ve[I];if(le.length>=3){for(var Je=0;Je<ht.length;Je++)if(cu(le,ht[Je]))return!0}if(Vs(le,ht,ze))return!0}return!1}(V,E,Y)},u.prototype.isTileClipped=function(){return!0},u}(tu);function Jp(o,u){return u>0?u+2*o:o}var jv=yo([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Hv=yo([{name:"a_projected_pos",components:3,type:"Float32"}],4),Hd=(yo([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),yo([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Wd=(yo([{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"}]),yo([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),W=yo([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ce(o,u,c){return o.sections.forEach(function(m){m.text=function(x,E,A){var R=E.layout.get("text-transform").evaluate(A,{});return R==="uppercase"?x=x.toLocaleUpperCase():R==="lowercase"&&(x=x.toLocaleLowerCase()),Ft.applyArabicShaping&&(x=Ft.applyArabicShaping(x)),x}(m.text,u,c)}),o}yo([{name:"triangle",components:3,type:"Uint16"}]),yo([{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"}]),yo([{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"}]),yo([{type:"Float32",name:"offsetX"}]),yo([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ye={"!":"\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"},Kt=function(o,u,c,m,x){var E,A,R=8*x-m-1,L=(1<<R)-1,V=L>>1,Y=-7,K=c?x-1:0,le=c?-1:1,ve=o[u+K];for(K+=le,E=ve&(1<<-Y)-1,ve>>=-Y,Y+=R;Y>0;E=256*E+o[u+K],K+=le,Y-=8);for(A=E&(1<<-Y)-1,E>>=-Y,Y+=m;Y>0;A=256*A+o[u+K],K+=le,Y-=8);if(E===0)E=1-V;else{if(E===L)return A?NaN:1/0*(ve?-1:1);A+=Math.pow(2,m),E-=V}return(ve?-1:1)*A*Math.pow(2,E-m)},vr=function(o,u,c,m,x,E){var A,R,L,V=8*E-x-1,Y=(1<<V)-1,K=Y>>1,le=x===23?Math.pow(2,-24)-Math.pow(2,-77):0,ve=m?0:E-1,ze=m?1:-1,I=u<0||u===0&&1/u<0?1:0;for(u=Math.abs(u),isNaN(u)||u===1/0?(R=isNaN(u)?1:0,A=Y):(A=Math.floor(Math.log(u)/Math.LN2),u*(L=Math.pow(2,-A))<1&&(A--,L*=2),(u+=A+K>=1?le/L:le*Math.pow(2,1-K))*L>=2&&(A++,L/=2),A+K>=Y?(R=0,A=Y):A+K>=1?(R=(u*L-1)*Math.pow(2,x),A+=K):(R=u*Math.pow(2,K-1)*Math.pow(2,x),A=0));x>=8;o[c+ve]=255&R,ve+=ze,R/=256,x-=8);for(A=A<<x|R,V+=x;V>0;o[c+ve]=255&A,ve+=ze,A/=256,V-=8);o[c+ve-ze]|=128*I},Jt=Ut;function Ut(o){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(o)?o:new Uint8Array(o||0),this.pos=0,this.type=0,this.length=this.buf.length}Ut.Varint=0,Ut.Fixed64=1,Ut.Bytes=2,Ut.Fixed32=5;var Br=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");function Or(o){return o.type===Ut.Bytes?o.readVarint()+o.pos:o.pos+1}function Yr(o,u,c){return c?4294967296*u+(o>>>0):4294967296*(u>>>0)+(o>>>0)}function Nr(o,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>=o;x--)c.buf[x+m]=c.buf[x]}function Wr(o,u){for(var c=0;c<o.length;c++)u.writeVarint(o[c])}function tn(o,u){for(var c=0;c<o.length;c++)u.writeSVarint(o[c])}function kr(o,u){for(var c=0;c<o.length;c++)u.writeFloat(o[c])}function $r(o,u){for(var c=0;c<o.length;c++)u.writeDouble(o[c])}function Pt(o,u){for(var c=0;c<o.length;c++)u.writeBoolean(o[c])}function ur(o,u){for(var c=0;c<o.length;c++)u.writeFixed32(o[c])}function Ur(o,u){for(var c=0;c<o.length;c++)u.writeSFixed32(o[c])}function cn(o,u){for(var c=0;c<o.length;c++)u.writeFixed64(o[c])}function Tr(o,u){for(var c=0;c<o.length;c++)u.writeSFixed64(o[c])}function pn(o,u){return(o[u]|o[u+1]<<8|o[u+2]<<16)+16777216*o[u+3]}function Ir(o,u,c){o[c]=u,o[c+1]=u>>>8,o[c+2]=u>>>16,o[c+3]=u>>>24}function fn(o,u){return(o[u]|o[u+1]<<8|o[u+2]<<16)+(o[u+3]<<24)}function Ar(o,u,c){o===1&&c.readMessage(un,u)}function un(o,u,c){if(o===3){var m=c.readMessage(jn,{}),x=m.width,E=m.height,A=m.left,R=m.top,L=m.advance;u.push({id:m.id,bitmap:new ru({width:x+6,height:E+6},m.bitmap),metrics:{width:x,height:E,left:A,top:R,advance:L}})}}function jn(o,u,c){o===1?u.id=c.readVarint():o===2?u.bitmap=c.readBytes():o===3?u.width=c.readVarint():o===4?u.height=c.readVarint():o===5?u.left=c.readSVarint():o===6?u.top=c.readSVarint():o===7&&(u.advance=c.readVarint())}function ai(o){for(var u=0,c=0,m=0,x=o;m<x.length;m+=1){var E=x[m];u+=E.w*E.h,c=Math.max(c,E.w)}o.sort(function(I,ht){return ht.h-I.h});for(var A=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(u/.95)),c),h:1/0}],R=0,L=0,V=0,Y=o;V<Y.length;V+=1)for(var K=Y[V],le=A.length-1;le>=0;le--){var ve=A[le];if(!(K.w>ve.w||K.h>ve.h)){if(K.x=ve.x,K.y=ve.y,L=Math.max(L,K.y+K.h),R=Math.max(R,K.x+K.w),K.w===ve.w&&K.h===ve.h){var ze=A.pop();le<A.length&&(A[le]=ze)}else K.h===ve.h?(ve.x+=K.w,ve.w-=K.w):K.w===ve.w?(ve.y+=K.h,ve.h-=K.h):(A.push({x:ve.x+K.w,y:ve.y,w:ve.w-K.w,h:K.h}),ve.y+=K.h,ve.h-=K.h);break}}return{w:R,h:L,fill:u/(R*L)||0}}Ut.prototype={destroy:function(){this.buf=null},readFields:function(o,u,c){for(c=c||this.length;this.pos<c;){var m=this.readVarint(),x=m>>3,E=this.pos;this.type=7&m,o(x,u,this),this.pos===E&&this.skip(m)}return u},readMessage:function(o,u){return this.readFields(o,u,this.readVarint()+this.pos)},readFixed32:function(){var o=pn(this.buf,this.pos);return this.pos+=4,o},readSFixed32:function(){var o=fn(this.buf,this.pos);return this.pos+=4,o},readFixed64:function(){var o=pn(this.buf,this.pos)+4294967296*pn(this.buf,this.pos+4);return this.pos+=8,o},readSFixed64:function(){var o=pn(this.buf,this.pos)+4294967296*fn(this.buf,this.pos+4);return this.pos+=8,o},readFloat:function(){var o=Kt(this.buf,this.pos,!0,23,4);return this.pos+=4,o},readDouble:function(){var o=Kt(this.buf,this.pos,!0,52,8);return this.pos+=8,o},readVarint:function(o){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 R,L,V=A.buf;if(R=(112&(L=V[A.pos++]))>>4,L<128||(R|=(127&(L=V[A.pos++]))<<3,L<128)||(R|=(127&(L=V[A.pos++]))<<10,L<128)||(R|=(127&(L=V[A.pos++]))<<17,L<128)||(R|=(127&(L=V[A.pos++]))<<24,L<128)||(R|=(1&(L=V[A.pos++]))<<31,L<128))return Yr(x,R,E);throw new Error("Expected varint not more than 10 bytes")}(u|=(15&(c=m[this.pos]))<<28,o,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var o=this.readVarint();return o%2==1?(o+1)/-2:o/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var o=this.readVarint()+this.pos,u=this.pos;return this.pos=o,o-u>=12&&Br?function(c,m,x){return Br.decode(c.subarray(m,x))}(this.buf,u,o):function(c,m,x){for(var E="",A=m;A<x;){var R,L,V,Y=c[A],K=null,le=Y>239?4:Y>223?3:Y>191?2:1;if(A+le>x)break;le===1?Y<128&&(K=Y):le===2?(192&(R=c[A+1]))==128&&(K=(31&Y)<<6|63&R)<=127&&(K=null):le===3?(L=c[A+2],(192&(R=c[A+1]))==128&&(192&L)==128&&((K=(15&Y)<<12|(63&R)<<6|63&L)<=2047||K>=55296&&K<=57343)&&(K=null)):le===4&&(L=c[A+2],V=c[A+3],(192&(R=c[A+1]))==128&&(192&L)==128&&(192&V)==128&&((K=(15&Y)<<18|(63&R)<<12|(63&L)<<6|63&V)<=65535||K>=1114112)&&(K=null)),K===null?(K=65533,le=1):K>65535&&(K-=65536,E+=String.fromCharCode(K>>>10&1023|55296),K=56320|1023&K),E+=String.fromCharCode(K),A+=le}return E}(this.buf,u,o)},readBytes:function(){var o=this.readVarint()+this.pos,u=this.buf.subarray(this.pos,o);return this.pos=o,u},readPackedVarint:function(o,u){if(this.type!==Ut.Bytes)return o.push(this.readVarint(u));var c=Or(this);for(o=o||[];this.pos<c;)o.push(this.readVarint(u));return o},readPackedSVarint:function(o){if(this.type!==Ut.Bytes)return o.push(this.readSVarint());var u=Or(this);for(o=o||[];this.pos<u;)o.push(this.readSVarint());return o},readPackedBoolean:function(o){if(this.type!==Ut.Bytes)return o.push(this.readBoolean());var u=Or(this);for(o=o||[];this.pos<u;)o.push(this.readBoolean());return o},readPackedFloat:function(o){if(this.type!==Ut.Bytes)return o.push(this.readFloat());var u=Or(this);for(o=o||[];this.pos<u;)o.push(this.readFloat());return o},readPackedDouble:function(o){if(this.type!==Ut.Bytes)return o.push(this.readDouble());var u=Or(this);for(o=o||[];this.pos<u;)o.push(this.readDouble());return o},readPackedFixed32:function(o){if(this.type!==Ut.Bytes)return o.push(this.readFixed32());var u=Or(this);for(o=o||[];this.pos<u;)o.push(this.readFixed32());return o},readPackedSFixed32:function(o){if(this.type!==Ut.Bytes)return o.push(this.readSFixed32());var u=Or(this);for(o=o||[];this.pos<u;)o.push(this.readSFixed32());return o},readPackedFixed64:function(o){if(this.type!==Ut.Bytes)return o.push(this.readFixed64());var u=Or(this);for(o=o||[];this.pos<u;)o.push(this.readFixed64());return o},readPackedSFixed64:function(o){if(this.type!==Ut.Bytes)return o.push(this.readSFixed64());var u=Or(this);for(o=o||[];this.pos<u;)o.push(this.readSFixed64());return o},skip:function(o){var u=7&o;if(u===Ut.Varint)for(;this.buf[this.pos++]>127;);else if(u===Ut.Bytes)this.pos=this.readVarint()+this.pos;else if(u===Ut.Fixed32)this.pos+=4;else{if(u!==Ut.Fixed64)throw new Error("Unimplemented type: "+u);this.pos+=8}},writeTag:function(o,u){this.writeVarint(o<<3|u)},realloc:function(o){for(var u=this.length||16;u<this.pos+o;)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(o){this.realloc(4),Ir(this.buf,o,this.pos),this.pos+=4},writeSFixed32:function(o){this.realloc(4),Ir(this.buf,o,this.pos),this.pos+=4},writeFixed64:function(o){this.realloc(8),Ir(this.buf,-1&o,this.pos),Ir(this.buf,Math.floor(o*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(o){this.realloc(8),Ir(this.buf,-1&o,this.pos),Ir(this.buf,Math.floor(o*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(o){(o=+o||0)>268435455||o<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,R){R.buf[R.pos++]=127&E|128,E>>>=7,R.buf[R.pos++]=127&E|128,E>>>=7,R.buf[R.pos++]=127&E|128,E>>>=7,R.buf[R.pos++]=127&E|128,R.buf[R.pos]=127&(E>>>=7)}(m,0,c),function(E,A){var R=(7&E)<<4;A.buf[A.pos++]|=R|((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)}(o,this):(this.realloc(4),this.buf[this.pos++]=127&o|(o>127?128:0),o<=127||(this.buf[this.pos++]=127&(o>>>=7)|(o>127?128:0),o<=127||(this.buf[this.pos++]=127&(o>>>=7)|(o>127?128:0),o<=127||(this.buf[this.pos++]=o>>>7&127))))},writeSVarint:function(o){this.writeVarint(o<0?2*-o-1:2*o)},writeBoolean:function(o){this.writeVarint(!!o)},writeString:function(o){o=String(o),this.realloc(4*o.length),this.pos++;var u=this.pos;this.pos=function(m,x,E){for(var A,R,L=0;L<x.length;L++){if((A=x.charCodeAt(L))>55295&&A<57344){if(!R){A>56319||L+1===x.length?(m[E++]=239,m[E++]=191,m[E++]=189):R=A;continue}if(A<56320){m[E++]=239,m[E++]=191,m[E++]=189,R=A;continue}A=R-55296<<10|A-56320|65536,R=null}else R&&(m[E++]=239,m[E++]=191,m[E++]=189,R=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,o,this.pos);var c=this.pos-u;c>=128&&Nr(u,c,this),this.pos=u-1,this.writeVarint(c),this.pos+=c},writeFloat:function(o){this.realloc(4),vr(this.buf,o,this.pos,!0,23,4),this.pos+=4},writeDouble:function(o){this.realloc(8),vr(this.buf,o,this.pos,!0,52,8),this.pos+=8},writeBytes:function(o){var u=o.length;this.writeVarint(u),this.realloc(u);for(var c=0;c<u;c++)this.buf[this.pos++]=o[c]},writeRawMessage:function(o,u){this.pos++;var c=this.pos;o(u,this);var m=this.pos-c;m>=128&&Nr(c,m,this),this.pos=c-1,this.writeVarint(m),this.pos+=m},writeMessage:function(o,u,c){this.writeTag(o,Ut.Bytes),this.writeRawMessage(u,c)},writePackedVarint:function(o,u){u.length&&this.writeMessage(o,Wr,u)},writePackedSVarint:function(o,u){u.length&&this.writeMessage(o,tn,u)},writePackedBoolean:function(o,u){u.length&&this.writeMessage(o,Pt,u)},writePackedFloat:function(o,u){u.length&&this.writeMessage(o,kr,u)},writePackedDouble:function(o,u){u.length&&this.writeMessage(o,$r,u)},writePackedFixed32:function(o,u){u.length&&this.writeMessage(o,ur,u)},writePackedSFixed32:function(o,u){u.length&&this.writeMessage(o,Ur,u)},writePackedFixed64:function(o,u){u.length&&this.writeMessage(o,cn,u)},writePackedSFixed64:function(o,u){u.length&&this.writeMessage(o,Tr,u)},writeBytesField:function(o,u){this.writeTag(o,Ut.Bytes),this.writeBytes(u)},writeFixed32Field:function(o,u){this.writeTag(o,Ut.Fixed32),this.writeFixed32(u)},writeSFixed32Field:function(o,u){this.writeTag(o,Ut.Fixed32),this.writeSFixed32(u)},writeFixed64Field:function(o,u){this.writeTag(o,Ut.Fixed64),this.writeFixed64(u)},writeSFixed64Field:function(o,u){this.writeTag(o,Ut.Fixed64),this.writeSFixed64(u)},writeVarintField:function(o,u){this.writeTag(o,Ut.Varint),this.writeVarint(u)},writeSVarintField:function(o,u){this.writeTag(o,Ut.Varint),this.writeSVarint(u)},writeStringField:function(o,u){this.writeTag(o,Ut.Bytes),this.writeString(u)},writeFloatField:function(o,u){this.writeTag(o,Ut.Fixed32),this.writeFloat(u)},writeDoubleField:function(o,u){this.writeTag(o,Ut.Fixed64),this.writeDouble(u)},writeBooleanField:function(o,u){this.writeVarintField(o,!!u)}};var an=function(o,u){var c=u.pixelRatio,m=u.version,x=u.stretchX,E=u.stretchY,A=u.content;this.paddedRect=o,this.pixelRatio=c,this.stretchX=x,this.stretchY=E,this.content=A,this.version=m},Lr={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Lr.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Lr.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Lr.tlbr.get=function(){return this.tl.concat(this.br)},Lr.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(an.prototype,Lr);var xr=function(o,u){var c={},m={};this.haveRenderCallbacks=[];var x=[];this.addImages(o,c,x),this.addImages(u,m,x);var E=ai(x),A=new Lo({width:E.w||1,height:E.h||1});for(var R in o){var L=o[R],V=c[R].paddedRect;Lo.copy(L.data,A,{x:0,y:0},{x:V.x+1,y:V.y+1},L.data)}for(var Y in u){var K=u[Y],le=m[Y].paddedRect,ve=le.x+1,ze=le.y+1,I=K.data.width,ht=K.data.height;Lo.copy(K.data,A,{x:0,y:0},{x:ve,y:ze},K.data),Lo.copy(K.data,A,{x:0,y:ht-1},{x:ve,y:ze-1},{width:I,height:1}),Lo.copy(K.data,A,{x:0,y:0},{x:ve,y:ze+ht},{width:I,height:1}),Lo.copy(K.data,A,{x:I-1,y:0},{x:ve-1,y:ze},{width:1,height:ht}),Lo.copy(K.data,A,{x:0,y:0},{x:ve+I,y:ze},{width:1,height:ht})}this.image=A,this.iconPositions=c,this.patternPositions=m};xr.prototype.addImages=function(o,u,c){for(var m in o){var x=o[m],E={x:0,y:0,w:x.data.width+2,h:x.data.height+2};c.push(E),u[m]=new an(E,x),x.hasRenderCallback&&this.haveRenderCallbacks.push(m)}},xr.prototype.patchUpdatedImages=function(o,u){for(var c in o.dispatchRenderCallbacks(this.haveRenderCallbacks),o.updatedImages)this.patchUpdatedImage(this.iconPositions[c],o.getImage(c),u),this.patchUpdatedImage(this.patternPositions[c],o.getImage(c),u)},xr.prototype.patchUpdatedImage=function(o,u,c){if(o&&u&&o.version!==u.version){o.version=u.version;var m=o.tl;c.update(u.data,void 0,{x:m[0],y:m[1]})}},xn("ImagePosition",an),xn("ImageAtlas",xr);var er={horizontal:1,vertical:2,horizontalOnly:3},Ti=function(){this.scale=1,this.fontStack="",this.imageName=null};Ti.forText=function(o,u){var c=new Ti;return c.scale=o||1,c.fontStack=u,c},Ti.forImage=function(o){var u=new Ti;return u.imageName=o,u};var Ke=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function _i(o,u,c,m,x,E,A,R,L,V,Y,K,le,ve,ze,I){var ht,Je=Ke.fromFeature(o,x);K===er.vertical&&Je.verticalizePunctuation();var wt=Ft.processBidirectionalText,Bt=Ft.processStyledBidirectionalText;if(wt&&Je.sections.length===1){ht=[];for(var nr=0,or=wt(Je.toString(),xo(Je,V,E,u,m,ve,ze));nr<or.length;nr+=1){var mr=or[nr],Zr=new Ke;Zr.text=mr,Zr.sections=Je.sections;for(var qr=0;qr<mr.length;qr++)Zr.sectionIndex.push(0);ht.push(Zr)}}else if(Bt){ht=[];for(var Nn=0,vn=Bt(Je.text,Je.sectionIndex,xo(Je,V,E,u,m,ve,ze));Nn<vn.length;Nn+=1){var Zn=vn[Nn],mn=new Ke;mn.text=Zn[0],mn.sectionIndex=Zn[1],mn.sections=Je.sections,ht.push(mn)}}else ht=function(Mn,Mi){for(var mi=[],Hi=Mn.text,Hn=0,ea=0,Ta=Mi;ea<Ta.length;ea+=1){var so=Ta[ea];mi.push(Mn.substring(Hn,so)),Hn=so}return Hn<Hi.length&&mi.push(Mn.substring(Hn,Hi.length)),mi}(Je,xo(Je,V,E,u,m,ve,ze));var bi=[],ei={positionedLines:bi,text:Je.toString(),top:Y[1],bottom:Y[1],left:Y[0],right:Y[0],writingMode:K,iconsInText:!1,verticalizable:!1};return function(Mn,Mi,mi,Hi,Hn,ea,Ta,so,ro,Fa,$a,ts){for(var Ho=0,Gs=-17,hs=0,ks=0,To=so==="right"?1:so==="left"?0:.5,wa=0,Ni=0,Ca=Hn;Ni<Ca.length;Ni+=1){var da=Ca[Ni];da.trim();var Ki=da.getMaxScale(),ps=24*(Ki-1),ws={positionedGlyphs:[],lineOffset:0};Mn.positionedLines[wa]=ws;var Da=ws.positionedGlyphs,wo=0;if(da.length()){for(var ds=0;ds<da.length();ds++){var ta=da.getSection(ds),Uc=da.getSectionIndex(ds),qu=da.getCharCode(ds),Bl=0,uo=null,Fl=null,Cu=null,pf=24,df=!(ro===er.horizontal||!$a&&!af(qu)||$a&&(si[qu]||(vf=qu,sn.Arabic(vf)||sn["Arabic Supplement"](vf)||sn["Arabic Extended-A"](vf)||sn["Arabic Presentation Forms-A"](vf)||sn["Arabic Presentation Forms-B"](vf))));if(ta.imageName){var eh=Hi[ta.imageName];if(!eh)continue;Cu=ta.imageName,Mn.iconsInText=Mn.iconsInText||!0,Fl=eh.paddedRect;var Nl=eh.displaySize;ta.scale=24*ta.scale/ts,Bl=ps+(24-Nl[1]*ta.scale),pf=(uo={width:Nl[0],height:Nl[1],left:1,top:-3,advance:df?Nl[1]:Nl[0]}).advance;var zc=df?Nl[0]*ta.scale-24*Ki:Nl[1]*ta.scale-24*Ki;zc>0&&zc>wo&&(wo=zc)}else{var nu=mi[ta.fontStack],th=nu&&nu[qu];if(th&&th.rect)Fl=th.rect,uo=th.metrics;else{var Uh=Mi[ta.fontStack],lc=Uh&&Uh[qu];if(!lc)continue;uo=lc.metrics}Bl=24*(Ki-ta.scale)}df?(Mn.verticalizable=!0,Da.push({glyph:qu,imageName:Cu,x:Ho,y:Gs+Bl,vertical:df,scale:ta.scale,fontStack:ta.fontStack,sectionIndex:Uc,metrics:uo,rect:Fl}),Ho+=pf*ta.scale+Fa):(Da.push({glyph:qu,imageName:Cu,x:Ho,y:Gs+Bl,vertical:df,scale:ta.scale,fontStack:ta.fontStack,sectionIndex:Uc,metrics:uo,rect:Fl}),Ho+=uo.advance*ta.scale+Fa)}Da.length!==0&&(hs=Math.max(Ho-Fa,hs),bo(Da,0,Da.length-1,To,wo)),Ho=0;var Gd=ea*Ki+wo;ws.lineOffset=Math.max(wo,ps),Gs+=Gd,ks=Math.max(Gd,ks),++wa}else Gs+=ea,++wa}var vf,sd=Gs- -17,zh=Aa(Ta),mf=zh.horizontalAlign,Zc=zh.verticalAlign;(function(Xd,$d,ud,Ep,Yd,ld,cd,cc,Sp){var gf,Ap=($d-ud)*Yd;gf=ld!==cd?-cc*Ep- -17:(-Ep*Sp+.5)*cd;for(var Vc=0,Zh=Xd;Vc<Zh.length;Vc+=1)for(var yf=0,_f=Zh[Vc].positionedGlyphs;yf<_f.length;yf+=1){var rh=_f[yf];rh.x+=Ap,rh.y+=gf}})(Mn.positionedLines,To,mf,Zc,hs,ks,ea,sd,Hn.length),Mn.top+=-Zc*sd,Mn.bottom=Mn.top+sd,Mn.left+=-mf*hs,Mn.right=Mn.left+hs}(ei,u,c,m,ht,A,R,L,K,V,le,I),!function(Mn){for(var Mi=0,mi=Mn;Mi<mi.length;Mi+=1)if(mi[Mi].positionedGlyphs.length!==0)return!1;return!0}(bi)&&ei}Ke.fromFeature=function(o,u){for(var c=new Ke,m=0;m<o.sections.length;m++){var x=o.sections[m];x.image?c.addImageSection(x):c.addTextSection(x,u)}return c},Ke.prototype.length=function(){return this.text.length},Ke.prototype.getSection=function(o){return this.sections[this.sectionIndex[o]]},Ke.prototype.getSectionIndex=function(o){return this.sectionIndex[o]},Ke.prototype.getCharCode=function(o){return this.text.charCodeAt(o)},Ke.prototype.verticalizePunctuation=function(){this.text=function(o){for(var u="",c=0;c<o.length;c++){var m=o.charCodeAt(c+1)||null,x=o.charCodeAt(c-1)||null;u+=m&&of(m)&&!Ye[o[c+1]]||x&&of(x)&&!Ye[o[c-1]]||!Ye[o[c]]?o[c]:Ye[o[c]]}return u}(this.text)},Ke.prototype.trim=function(){for(var o=0,u=0;u<this.text.length&&si[this.text.charCodeAt(u)];u++)o++;for(var c=this.text.length,m=this.text.length-1;m>=0&&m>=o&&si[this.text.charCodeAt(m)];m--)c--;this.text=this.text.substring(o,c),this.sectionIndex=this.sectionIndex.slice(o,c)},Ke.prototype.substring=function(o,u){var c=new Ke;return c.text=this.text.substring(o,u),c.sectionIndex=this.sectionIndex.slice(o,u),c.sections=this.sections,c},Ke.prototype.toString=function(){return this.text},Ke.prototype.getMaxScale=function(){var o=this;return this.sectionIndex.reduce(function(u,c){return Math.max(u,o.sections[c].scale)},0)},Ke.prototype.addTextSection=function(o,u){this.text+=o.text,this.sections.push(Ti.forText(o.scale,o.fontStack||u));for(var c=this.sections.length-1,m=0;m<o.text.length;++m)this.sectionIndex.push(c)},Ke.prototype.addImageSection=function(o){var u=o.image?o.image.name:"";if(u.length!==0){var c=this.getNextImageSectionCharCode();c?(this.text+=String.fromCharCode(c),this.sections.push(Ti.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.")},Ke.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 qi(o,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 R=c[u.fontStack],L=R&&R[o];return L?L.metrics.advance*u.scale+x:0}function vo(o,u,c,m){var x=Math.pow(o-u,2);return m?o<u?x/2:2*x:x+Math.abs(c)*c}function mo(o,u,c){var m=0;return o===10&&(m-=1e4),c&&(m+=150),o!==40&&o!==65288||(m+=50),u!==41&&u!==65289||(m+=50),m}function Ii(o,u,c,m,x,E){for(var A=null,R=vo(u,c,x,E),L=0,V=m;L<V.length;L+=1){var Y=V[L],K=vo(u-Y.x,c,x,E)+Y.badness;K<=R&&(A=Y,R=K)}return{index:o,x:u,priorBreak:A,badness:R}}function xo(o,u,c,m,x,E,A){if(E!=="point")return[];if(!o)return[];for(var R,L=[],V=function(ht,Je,wt,Bt,nr,or){for(var mr=0,Zr=0;Zr<ht.length();Zr++){var qr=ht.getSection(Zr);mr+=qi(ht.getCharCode(Zr),qr,Bt,nr,Je,or)}return mr/Math.max(1,Math.ceil(mr/wt))}(o,u,c,m,x,A),Y=o.text.indexOf("\u200B")>=0,K=0,le=0;le<o.length();le++){var ve=o.getSection(le),ze=o.getCharCode(le);if(si[ze]||(K+=qi(ze,ve,m,x,u,A)),le<o.length()-1){var I=!((R=ze)<11904||!(sn["Bopomofo Extended"](R)||sn.Bopomofo(R)||sn["CJK Compatibility Forms"](R)||sn["CJK Compatibility Ideographs"](R)||sn["CJK Compatibility"](R)||sn["CJK Radicals Supplement"](R)||sn["CJK Strokes"](R)||sn["CJK Symbols and Punctuation"](R)||sn["CJK Unified Ideographs Extension A"](R)||sn["CJK Unified Ideographs"](R)||sn["Enclosed CJK Letters and Months"](R)||sn["Halfwidth and Fullwidth Forms"](R)||sn.Hiragana(R)||sn["Ideographic Description Characters"](R)||sn["Kangxi Radicals"](R)||sn["Katakana Phonetic Extensions"](R)||sn.Katakana(R)||sn["Vertical Forms"](R)||sn["Yi Radicals"](R)||sn["Yi Syllables"](R)));(qn[ze]||I||ve.imageName)&&L.push(Ii(le+1,K,V,L,mo(ze,o.getCharCode(le+1),I&&Y),!1))}}return function ht(Je){return Je?ht(Je.priorBreak).concat(Je.index):[]}(Ii(o.length(),K,V,L,0,!0))}function Aa(o){var u=.5,c=.5;switch(o){case"right":case"top-right":case"bottom-right":u=1;break;case"left":case"top-left":case"bottom-left":u=0}switch(o){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 bo(o,u,c,m,x){if(m||x)for(var E=o[c],A=(o[c].x+E.metrics.advance*E.scale)*m,R=u;R<=c;R++)o[R].x-=A,o[R].y+=x}function Eo(o,u,c,m,x,E){var A,R=o.image;if(R.content){var L=R.content,V=R.pixelRatio||1;A=[L[0]/V,L[1]/V,R.displaySize[0]-L[2]/V,R.displaySize[1]-L[3]/V]}var Y,K,le,ve,ze=u.left*E,I=u.right*E;c==="width"||c==="both"?(ve=x[0]+ze-m[3],K=x[0]+I+m[1]):K=(ve=x[0]+(ze+I-R.displaySize[0])/2)+R.displaySize[0];var ht=u.top*E,Je=u.bottom*E;return c==="height"||c==="both"?(Y=x[1]+ht-m[0],le=x[1]+Je+m[2]):le=(Y=x[1]+(ht+Je-R.displaySize[1])/2)+R.displaySize[1],{image:R,top:Y,right:K,bottom:le,left:ve,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 Ga=function(o){function u(c,m,x,E){o.call(this,c,m),this.angle=x,E!==void 0&&(this.segment=E)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.clone=function(){return new u(this.x,this.y,this.angle,this.segment)},u}(fe);function Fo(o,u){var c=u.expression;if(c.kind==="constant")return{kind:"constant",layoutSize:c.evaluate(new Me(o+1))};if(c.kind==="source")return{kind:"source"};for(var m=c.zoomStops,x=c.interpolationType,E=0;E<m.length&&m[E]<=o;)E++;for(var A=E=Math.max(0,E-1);A<m.length&&m[A]<o+1;)A++;A=Math.min(m.length-1,A);var R=m[E],L=m[A];return c.kind==="composite"?{kind:"composite",minZoom:R,maxZoom:L,interpolationType:x}:{kind:"camera",minZoom:R,maxZoom:L,minSize:c.evaluate(new Me(R)),maxSize:c.evaluate(new Me(L)),interpolationType:x}}function Ts(o,u,c){var m=u.uSize,x=c.lowerSize;return o.kind==="source"?x/128:o.kind==="composite"?qa(x/128,c.upperSize/128,u.uSizeT):m}function So(o,u){var c=0,m=0;if(o.kind==="constant")m=o.layoutSize;else if(o.kind!=="source"){var x=o.interpolationType,E=x?Ot(Qo.interpolationFactor(x,u,o.minZoom,o.maxZoom),0,1):0;o.kind==="camera"?m=qa(o.minSize,o.maxSize,E):c=E}return{uSizeT:c,uSize:m}}xn("Anchor",Ga);var gi=Object.freeze({__proto__:null,getSizeData:Fo,evaluateSizeForFeature:Ts,evaluateSizeForZoom:So,SIZE_PACK_FACTOR:128});function cs(o,u,c,m,x){if(u.segment===void 0)return!0;for(var E=u,A=u.segment+1,R=0;R>-c/2;){if(--A<0)return!1;R-=o[A].dist(E),E=o[A]}R+=o[A].dist(o[A+1]),A++;for(var L=[],V=0;R<c/2;){var Y=o[A],K=o[A+1];if(!K)return!1;var le=o[A-1].angleTo(Y)-Y.angleTo(K);for(le=Math.abs((le+3*Math.PI)%(2*Math.PI)-Math.PI),L.push({distance:R,angleDelta:le}),V+=le;R-L[0].distance>m;)V-=L.shift().angleDelta;if(V>x)return!1;A++,R+=Y.dist(K)}return!0}function ia(o){for(var u=0,c=0;c<o.length-1;c++)u+=o[c].dist(o[c+1]);return u}function Xn(o,u,c){return o?.6*u*c:0}function Ri(o,u){return Math.max(o?o.right-o.left:0,u?u.right-u.left:0)}function Xi(o,u,c,m,x,E){for(var A=Xn(c,x,E),R=Ri(c,m)*E,L=0,V=ia(o)/2,Y=0;Y<o.length-1;Y++){var K=o[Y],le=o[Y+1],ve=K.dist(le);if(L+ve>V){var ze=(V-L)/ve,I=qa(K.x,le.x,ze),ht=qa(K.y,le.y,ze),Je=new Ga(I,ht,le.angleTo(K),Y);return Je._round(),!A||cs(o,Je,R,A,u)?Je:void 0}L+=ve}}function Ao(o,u,c,m,x,E,A,R,L){var V=Xn(m,E,A),Y=Ri(m,x),K=Y*A,le=o[0].x===0||o[0].x===L||o[0].y===0||o[0].y===L;return u-K<u/4&&(u=K+u/4),function ve(ze,I,ht,Je,wt,Bt,nr,or,mr){for(var Zr=Bt/2,qr=ia(ze),Nn=0,vn=I-ht,Zn=[],mn=0;mn<ze.length-1;mn++){for(var bi=ze[mn],ei=ze[mn+1],Mn=bi.dist(ei),Mi=ei.angleTo(bi);vn+ht<Nn+Mn;){var mi=((vn+=ht)-Nn)/Mn,Hi=qa(bi.x,ei.x,mi),Hn=qa(bi.y,ei.y,mi);if(Hi>=0&&Hi<mr&&Hn>=0&&Hn<mr&&vn-Zr>=0&&vn+Zr<=qr){var ea=new Ga(Hi,Hn,Mi,mn);ea._round(),Je&&!cs(ze,ea,Bt,Je,wt)||Zn.push(ea)}}Nn+=Mn}return or||Zn.length||nr||(Zn=ve(ze,Nn/2,ht,Je,wt,Bt,nr,!0,mr)),Zn}(o,le?u/2*R%u:(Y/2+2*E)*A*R%u,u,V,c,K,le,!1,L)}function gl(o,u,c,m,x){for(var E=[],A=0;A<o.length;A++)for(var R=o[A],L=void 0,V=0;V<R.length-1;V++){var Y=R[V],K=R[V+1];Y.x<u&&K.x<u||(Y.x<u?Y=new fe(u,Y.y+(u-Y.x)/(K.x-Y.x)*(K.y-Y.y))._round():K.x<u&&(K=new fe(u,Y.y+(u-Y.x)/(K.x-Y.x)*(K.y-Y.y))._round()),Y.y<c&&K.y<c||(Y.y<c?Y=new fe(Y.x+(c-Y.y)/(K.y-Y.y)*(K.x-Y.x),c)._round():K.y<c&&(K=new fe(Y.x+(c-Y.y)/(K.y-Y.y)*(K.x-Y.x),c)._round()),Y.x>=m&&K.x>=m||(Y.x>=m?Y=new fe(m,Y.y+(m-Y.x)/(K.x-Y.x)*(K.y-Y.y))._round():K.x>=m&&(K=new fe(m,Y.y+(m-Y.x)/(K.x-Y.x)*(K.y-Y.y))._round()),Y.y>=x&&K.y>=x||(Y.y>=x?Y=new fe(Y.x+(x-Y.y)/(K.y-Y.y)*(K.x-Y.x),x)._round():K.y>=x&&(K=new fe(Y.x+(x-Y.y)/(K.y-Y.y)*(K.x-Y.x),x)._round()),L&&Y.equals(L[L.length-1])||E.push(L=[Y]),L.push(K)))))}return E}function He(o,u,c,m){var x=[],E=o.image,A=E.pixelRatio,R=E.paddedRect.w-2,L=E.paddedRect.h-2,V=o.right-o.left,Y=o.bottom-o.top,K=E.stretchX||[[0,R]],le=E.stretchY||[[0,L]],ve=function(Hi,Hn){return Hi+Hn[1]-Hn[0]},ze=K.reduce(ve,0),I=le.reduce(ve,0),ht=R-ze,Je=L-I,wt=0,Bt=ze,nr=0,or=I,mr=0,Zr=ht,qr=0,Nn=Je;if(E.content&&m){var vn=E.content;wt=rr(K,0,vn[0]),nr=rr(le,0,vn[1]),Bt=rr(K,vn[0],vn[2]),or=rr(le,vn[1],vn[3]),mr=vn[0]-wt,qr=vn[1]-nr,Zr=vn[2]-vn[0]-Bt,Nn=vn[3]-vn[1]-or}var Zn=function(Hi,Hn,ea,Ta){var so=dn(Hi.stretch-wt,Bt,V,o.left),ro=xi(Hi.fixed-mr,Zr,Hi.stretch,ze),Fa=dn(Hn.stretch-nr,or,Y,o.top),$a=xi(Hn.fixed-qr,Nn,Hn.stretch,I),ts=dn(ea.stretch-wt,Bt,V,o.left),Ho=xi(ea.fixed-mr,Zr,ea.stretch,ze),Gs=dn(Ta.stretch-nr,or,Y,o.top),hs=xi(Ta.fixed-qr,Nn,Ta.stretch,I),ks=new fe(so,Fa),To=new fe(ts,Fa),wa=new fe(ts,Gs),Ni=new fe(so,Gs),Ca=new fe(ro/A,$a/A),da=new fe(Ho/A,hs/A),Ki=u*Math.PI/180;if(Ki){var ps=Math.sin(Ki),ws=Math.cos(Ki),Da=[ws,-ps,ps,ws];ks._matMult(Da),To._matMult(Da),Ni._matMult(Da),wa._matMult(Da)}var wo=Hi.stretch+Hi.fixed,ds=Hn.stretch+Hn.fixed;return{tl:ks,tr:To,bl:Ni,br:wa,tex:{x:E.paddedRect.x+1+wo,y:E.paddedRect.y+1+ds,w:ea.stretch+ea.fixed-wo,h:Ta.stretch+Ta.fixed-ds},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ca,pixelOffsetBR:da,minFontScaleX:Zr/A/V,minFontScaleY:Nn/A/Y,isSDF:c}};if(m&&(E.stretchX||E.stretchY))for(var mn=Ht(K,ht,ze),bi=Ht(le,Je,I),ei=0;ei<mn.length-1;ei++)for(var Mn=mn[ei],Mi=mn[ei+1],mi=0;mi<bi.length-1;mi++)x.push(Zn(Mn,bi[mi],Mi,bi[mi+1]));else x.push(Zn({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:R+1},{fixed:0,stretch:L+1}));return x}function rr(o,u,c){for(var m=0,x=0,E=o;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 Ht(o,u,c){for(var m=[{fixed:-1,stretch:0}],x=0,E=o;x<E.length;x+=1){var A=E[x],R=A[0],L=A[1],V=m[m.length-1];m.push({fixed:R-V.stretch,stretch:V.stretch}),m.push({fixed:R-V.stretch,stretch:V.stretch+(L-R)})}return m.push({fixed:u+1,stretch:c}),m}function dn(o,u,c,m){return o/u*c+m}function xi(o,u,c,m){return o-u*c/m}var ya=function(o,u,c,m,x,E,A,R,L,V){if(this.boxStartIndex=o.length,L){var Y=E.top,K=E.bottom,le=E.collisionPadding;le&&(Y-=le[1],K+=le[3]);var ve=K-Y;ve>0&&(ve=Math.max(10,ve),this.circleDiameter=ve)}else{var ze=E.top*A-R,I=E.bottom*A+R,ht=E.left*A-R,Je=E.right*A+R,wt=E.collisionPadding;if(wt&&(ht-=wt[0]*A,ze-=wt[1]*A,Je+=wt[2]*A,I+=wt[3]*A),V){var Bt=new fe(ht,ze),nr=new fe(Je,ze),or=new fe(ht,I),mr=new fe(Je,I),Zr=V*Math.PI/180;Bt._rotate(Zr),nr._rotate(Zr),or._rotate(Zr),mr._rotate(Zr),ht=Math.min(Bt.x,nr.x,or.x,mr.x),Je=Math.max(Bt.x,nr.x,or.x,mr.x),ze=Math.min(Bt.y,nr.y,or.y,mr.y),I=Math.max(Bt.y,nr.y,or.y,mr.y)}o.emplaceBack(u.x,u.y,ht,ze,Je,I,c,m,x)}this.boxEndIndex=o.length},de=function(o,u){if(o===void 0&&(o=[]),u===void 0&&(u=Oe),this.data=o,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 Oe(o,u){return o<u?-1:o>u?1:0}function $e(o,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,R=o[0],L=0;L<R.length;L++){var V=R[L];(!L||V.x<m)&&(m=V.x),(!L||V.y<x)&&(x=V.y),(!L||V.x>E)&&(E=V.x),(!L||V.y>A)&&(A=V.y)}var Y=Math.min(E-m,A-x),K=Y/2,le=new de([],Gt);if(Y===0)return new fe(m,x);for(var ve=m;ve<E;ve+=Y)for(var ze=x;ze<A;ze+=Y)le.push(new Nt(ve+K,ze+K,K,o));for(var I=function(wt){for(var Bt=0,nr=0,or=0,mr=wt[0],Zr=0,qr=mr.length,Nn=qr-1;Zr<qr;Nn=Zr++){var vn=mr[Zr],Zn=mr[Nn],mn=vn.x*Zn.y-Zn.x*vn.y;nr+=(vn.x+Zn.x)*mn,or+=(vn.y+Zn.y)*mn,Bt+=3*mn}return new Nt(nr/Bt,or/Bt,0,wt)}(o),ht=le.length;le.length;){var Je=le.pop();(Je.d>I.d||!I.d)&&(I=Je,c&&console.log("found best %d after %d probes",Math.round(1e4*Je.d)/1e4,ht)),Je.max-I.d<=u||(le.push(new Nt(Je.p.x-(K=Je.h/2),Je.p.y-K,K,o)),le.push(new Nt(Je.p.x+K,Je.p.y-K,K,o)),le.push(new Nt(Je.p.x-K,Je.p.y+K,K,o)),le.push(new Nt(Je.p.x+K,Je.p.y+K,K,o)),ht+=4)}return c&&(console.log("num probes: "+ht),console.log("best distance: "+I.d)),I.p}function Gt(o,u){return u.max-o.max}function Nt(o,u,c,m){this.p=new fe(o,u),this.h=c,this.d=function(x,E){for(var A=!1,R=1/0,L=0;L<E.length;L++)for(var V=E[L],Y=0,K=V.length,le=K-1;Y<K;le=Y++){var ve=V[Y],ze=V[le];ve.y>x.y!=ze.y>x.y&&x.x<(ze.x-ve.x)*(x.y-ve.y)/(ze.y-ve.y)+ve.x&&(A=!A),R=Math.min(R,nc(x,ve,ze))}return(A?1:-1)*Math.sqrt(R)}(this.p,m),this.max=this.d+this.h*Math.SQRT2}de.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},de.prototype.pop=function(){if(this.length!==0){var o=this.data[0],u=this.data.pop();return this.length--,this.length>0&&(this.data[0]=u,this._down(0)),o}},de.prototype.peek=function(){return this.data[0]},de.prototype._up=function(o){for(var u=this.data,c=this.compare,m=u[o];o>0;){var x=o-1>>1,E=u[x];if(c(m,E)>=0)break;u[o]=E,o=x}u[o]=m},de.prototype._down=function(o){for(var u=this.data,c=this.compare,m=this.length>>1,x=u[o];o<m;){var E=1+(o<<1),A=u[E],R=E+1;if(R<this.length&&c(u[R],A)<0&&(E=R,A=u[R]),c(A,x)>=0)break;u[o]=A,o=E}u[o]=x};var ct=Number.POSITIVE_INFINITY;function yt(o,u){return u[1]!==ct?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]}(o,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]}(o,u[0])}function xt(o){switch(o){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function We(o,u,c,m,x,E,A,R,L,V,Y,K,le,ve,ze){var I=function(nr,or,mr,Zr,qr,Nn,vn,Zn){for(var mn=Zr.layout.get("text-rotate").evaluate(Nn,{})*Math.PI/180,bi=[],ei=0,Mn=or.positionedLines;ei<Mn.length;ei+=1)for(var Mi=Mn[ei],mi=0,Hi=Mi.positionedGlyphs;mi<Hi.length;mi+=1){var Hn=Hi[mi];if(Hn.rect){var ea=Hn.rect||{},Ta=4,so=!0,ro=1,Fa=0,$a=(qr||Zn)&&Hn.vertical,ts=Hn.metrics.advance*Hn.scale/2;if(Zn&&or.verticalizable&&(Fa=Mi.lineOffset/2-(Hn.imageName?-(24-Hn.metrics.width*Hn.scale)/2:24*(Hn.scale-1))),Hn.imageName){var Ho=vn[Hn.imageName];so=Ho.sdf,Ta=1/(ro=Ho.pixelRatio)}var Gs=qr?[Hn.x+ts,Hn.y]:[0,0],hs=qr?[0,0]:[Hn.x+ts+mr[0],Hn.y+mr[1]-Fa],ks=[0,0];$a&&(ks=hs,hs=[0,0]);var To=(Hn.metrics.left-Ta)*Hn.scale-ts+hs[0],wa=(-Hn.metrics.top-Ta)*Hn.scale+hs[1],Ni=To+ea.w*Hn.scale/ro,Ca=wa+ea.h*Hn.scale/ro,da=new fe(To,wa),Ki=new fe(Ni,wa),ps=new fe(To,Ca),ws=new fe(Ni,Ca);if($a){var Da=new fe(-ts,ts- -17),wo=-Math.PI/2,ds=12-ts,ta=new fe(22-ds,-(Hn.imageName?ds:0)),Uc=new(Function.prototype.bind.apply(fe,[null].concat(ks)));da._rotateAround(wo,Da)._add(ta)._add(Uc),Ki._rotateAround(wo,Da)._add(ta)._add(Uc),ps._rotateAround(wo,Da)._add(ta)._add(Uc),ws._rotateAround(wo,Da)._add(ta)._add(Uc)}if(mn){var qu=Math.sin(mn),Bl=Math.cos(mn),uo=[Bl,-qu,qu,Bl];da._matMult(uo),Ki._matMult(uo),ps._matMult(uo),ws._matMult(uo)}var Fl=new fe(0,0),Cu=new fe(0,0);bi.push({tl:da,tr:Ki,bl:ps,br:ws,tex:ea,writingMode:or.writingMode,glyphOffset:Gs,sectionIndex:Hn.sectionIndex,isSDF:so,pixelOffsetTL:Fl,pixelOffsetBR:Cu,minFontScaleX:0,minFontScaleY:0})}}return bi}(0,c,R,x,E,A,m,o.allowVerticalPlacement),ht=o.textSizeData,Je=null;ht.kind==="source"?(Je=[128*x.layout.get("text-size").evaluate(A,{})])[0]>32640&&qe(o.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):ht.kind==="composite"&&((Je=[128*ve.compositeTextSizes[0].evaluate(A,{},ze),128*ve.compositeTextSizes[1].evaluate(A,{},ze)])[0]>32640||Je[1]>32640)&&qe(o.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),o.addSymbols(o.text,I,Je,R,E,A,V,u,L.lineStartIndex,L.lineLength,le,ze);for(var wt=0,Bt=Y;wt<Bt.length;wt+=1)K[Bt[wt]]=o.text.placedSymbolArray.length-1;return 4*I.length}function pt(o){for(var u in o)return o[u];return null}function Ie(o,u,c,m){var x=o.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 mt=sc.VectorTileFeature.types,Ct=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function hr(o,u,c,m,x,E,A,R,L,V,Y,K,le){var ve=R?Math.min(32640,Math.round(R[0])):0,ze=R?Math.min(32640,Math.round(R[1])):0;o.emplaceBack(u,c,Math.round(32*m),Math.round(32*x),E,A,(ve<<1)+(L?1:0),ze,16*V,16*Y,256*K,256*le)}function Cr(o,u,c){o.emplaceBack(u.x,u.y,c),o.emplaceBack(u.x,u.y,c),o.emplaceBack(u.x,u.y,c),o.emplaceBack(u.x,u.y,c)}function Er(o){for(var u=0,c=o.sections;u<c.length;u+=1)if(Ff(c[u].text))return!0;return!1}var wr=function(o){this.layoutVertexArray=new Zf,this.indexArray=new us,this.programConfigurations=o,this.segments=new be,this.dynamicLayoutVertexArray=new Rc,this.opacityVertexArray=new sf,this.placedSymbolArray=new g};wr.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},wr.prototype.upload=function(o,u,c,m){this.isEmpty()||(c&&(this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,jv.members),this.indexBuffer=o.createIndexBuffer(this.indexArray,u),this.dynamicLayoutVertexBuffer=o.createVertexBuffer(this.dynamicLayoutVertexArray,Hv.members,!0),this.opacityVertexBuffer=o.createVertexBuffer(this.opacityVertexArray,Ct,!0),this.opacityVertexBuffer.itemSize=1),(c||m)&&this.programConfigurations.upload(o))},wr.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},xn("SymbolBuffers",wr);var On=function(o,u,c){this.layoutVertexArray=new o,this.layoutAttributes=u,this.indexArray=new c,this.segments=new be,this.collisionVertexArray=new Ah};On.prototype.upload=function(o){this.layoutVertexBuffer=o.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=o.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=o.createVertexBuffer(this.collisionVertexArray,Hd.members,!0)},On.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},xn("CollisionBuffers",On);var Sn=function(o){this.collisionBoxArray=o.collisionBoxArray,this.zoom=o.zoom,this.overscaling=o.overscaling,this.layers=o.layers,this.layerIds=this.layers.map(function(E){return E.id}),this.index=o.index,this.pixelRatio=o.pixelRatio,this.sourceLayerIndex=o.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Jo([]),this.placementViewportMatrix=Jo([]);var u=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Fo(this.zoom,u["text-size"]),this.iconSizeData=Fo(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 er[E]})),this.stateDependentLayerIds=this.layers.filter(function(E){return E.isStateDependent()}).map(function(E){return E.id}),this.sourceID=o.sourceID};Sn.prototype.createArrays=function(){this.text=new wr(new Gn(this.layers,this.zoom,function(o){return/^text/.test(o)})),this.icon=new wr(new Gn(this.layers,this.zoom,function(o){return/^icon/.test(o)})),this.glyphOffsetArray=new C,this.lineVertexArray=new O,this.symbolInstances=new w},Sn.prototype.calculateGlyphDependencies=function(o,u,c,m,x){for(var E=0;E<o.length;E++)if(u[o.charCodeAt(E)]=!0,(c||m)&&x){var A=Ye[o.charAt(E)];A&&(u[A.charCodeAt(0)]=!0)}},Sn.prototype.populate=function(o,u,c){var m=this.layers[0],x=m.layout,E=x.get("text-font"),A=x.get("text-field"),R=x.get("icon-image"),L=(A.value.kind!=="constant"||A.value.value instanceof fa&&!A.value.value.isEmpty()||A.value.value.toString().length>0)&&(E.value.kind!=="constant"||E.value.value.length>0),V=R.value.kind!=="constant"||!!R.value.value||Object.keys(R.parameters).length>0,Y=x.get("symbol-sort-key");if(this.features=[],L||V){for(var K=u.iconDependencies,le=u.glyphDependencies,ve=u.availableImages,ze=new Me(this.zoom),I=0,ht=o;I<ht.length;I+=1){var Je=ht[I],wt=Je.feature,Bt=Je.id,nr=Je.index,or=Je.sourceLayerIndex,mr=m._featureFilter.needGeometry,Zr=Ja(wt,mr);if(m._featureFilter.filter(ze,Zr,c)){mr||(Zr.geometry=Wa(wt));var qr=void 0;if(L){var Nn=m.getValueAndResolveTokens("text-field",Zr,c,ve),vn=fa.factory(Nn);Er(vn)&&(this.hasRTLText=!0),(!this.hasRTLText||Uf()==="unavailable"||this.hasRTLText&&Ft.isParsed())&&(qr=Ce(vn,m,Zr))}var Zn=void 0;if(V){var mn=m.getValueAndResolveTokens("icon-image",Zr,c,ve);Zn=mn instanceof Ra?mn:Ra.fromString(mn)}if(qr||Zn){var bi=this.sortFeaturesByKey?Y.evaluate(Zr,{},c):void 0;if(this.features.push({id:Bt,text:qr,icon:Zn,index:nr,sourceLayerIndex:or,geometry:Zr.geometry,properties:wt.properties,type:mt[wt.type],sortKey:bi}),Zn&&(K[Zn.name]=!0),qr){var ei=E.evaluate(Zr,{},c).join(","),Mn=x.get("text-rotation-alignment")==="map"&&x.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(er.vertical)>=0;for(var Mi=0,mi=qr.sections;Mi<mi.length;Mi+=1){var Hi=mi[Mi];if(Hi.image)K[Hi.image.name]=!0;else{var Hn=ll(qr.toString()),ea=Hi.fontStack||ei,Ta=le[ea]=le[ea]||{};this.calculateGlyphDependencies(Hi.text,Ta,Mn,this.allowVerticalPlacement,Hn)}}}}}}x.get("symbol-placement")==="line"&&(this.features=function(so){var ro={},Fa={},$a=[],ts=0;function Ho(Da){$a.push(so[Da]),ts++}function Gs(Da,wo,ds){var ta=Fa[Da];return delete Fa[Da],Fa[wo]=ta,$a[ta].geometry[0].pop(),$a[ta].geometry[0]=$a[ta].geometry[0].concat(ds[0]),ta}function hs(Da,wo,ds){var ta=ro[wo];return delete ro[wo],ro[Da]=ta,$a[ta].geometry[0].shift(),$a[ta].geometry[0]=ds[0].concat($a[ta].geometry[0]),ta}function ks(Da,wo,ds){var ta=ds?wo[0][wo[0].length-1]:wo[0][0];return Da+":"+ta.x+":"+ta.y}for(var To=0;To<so.length;To++){var wa=so[To],Ni=wa.geometry,Ca=wa.text?wa.text.toString():null;if(Ca){var da=ks(Ca,Ni),Ki=ks(Ca,Ni,!0);if(da in Fa&&Ki in ro&&Fa[da]!==ro[Ki]){var ps=hs(da,Ki,Ni),ws=Gs(da,Ki,$a[ps].geometry);delete ro[da],delete Fa[Ki],Fa[ks(Ca,$a[ws].geometry,!0)]=ws,$a[ps].geometry=null}else da in Fa?Gs(da,Ki,Ni):Ki in ro?hs(da,Ki,Ni):(Ho(To),ro[da]=ts-1,Fa[Ki]=ts-1)}else Ho(To)}return $a.filter(function(Da){return Da.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(so,ro){return so.sortKey-ro.sortKey})}},Sn.prototype.update=function(o,u,c){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(o,u,this.layers,c),this.icon.programConfigurations.updatePaintArrays(o,u,this.layers,c))},Sn.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Sn.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Sn.prototype.upload=function(o){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(o),this.iconCollisionBox.upload(o)),this.text.upload(o,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(o,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Sn.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Sn.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Sn.prototype.addToLineVertexArray=function(o,u){var c=this.lineVertexArray.length;if(o.segment!==void 0){for(var m=o.dist(u[o.segment+1]),x=o.dist(u[o.segment]),E={},A=o.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 R=o.segment||0;R>=0;R--)E[R]={x:u[R].x,y:u[R].y,tileUnitDistanceFromAnchor:x},R>0&&(x+=u[R-1].dist(u[R]));for(var L=0;L<u.length;L++){var V=E[L];this.lineVertexArray.emplaceBack(V.x,V.y,V.tileUnitDistanceFromAnchor)}}return{lineStartIndex:c,lineLength:this.lineVertexArray.length-c}},Sn.prototype.addSymbols=function(o,u,c,m,x,E,A,R,L,V,Y,K){for(var le=o.indexArray,ve=o.layoutVertexArray,ze=o.segments.prepareSegment(4*u.length,ve,le,this.canOverlap?E.sortKey:void 0),I=this.glyphOffsetArray.length,ht=ze.vertexLength,Je=this.allowVerticalPlacement&&A===er.vertical?Math.PI/2:0,wt=E.text&&E.text.sections,Bt=0;Bt<u.length;Bt++){var nr=u[Bt],or=nr.tl,mr=nr.tr,Zr=nr.bl,qr=nr.br,Nn=nr.tex,vn=nr.pixelOffsetTL,Zn=nr.pixelOffsetBR,mn=nr.minFontScaleX,bi=nr.minFontScaleY,ei=nr.glyphOffset,Mn=nr.isSDF,Mi=nr.sectionIndex,mi=ze.vertexLength,Hi=ei[1];hr(ve,R.x,R.y,or.x,Hi+or.y,Nn.x,Nn.y,c,Mn,vn.x,vn.y,mn,bi),hr(ve,R.x,R.y,mr.x,Hi+mr.y,Nn.x+Nn.w,Nn.y,c,Mn,Zn.x,vn.y,mn,bi),hr(ve,R.x,R.y,Zr.x,Hi+Zr.y,Nn.x,Nn.y+Nn.h,c,Mn,vn.x,Zn.y,mn,bi),hr(ve,R.x,R.y,qr.x,Hi+qr.y,Nn.x+Nn.w,Nn.y+Nn.h,c,Mn,Zn.x,Zn.y,mn,bi),Cr(o.dynamicLayoutVertexArray,R,Je),le.emplaceBack(mi,mi+1,mi+2),le.emplaceBack(mi+1,mi+2,mi+3),ze.vertexLength+=4,ze.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(ei[0]),Bt!==u.length-1&&Mi===u[Bt+1].sectionIndex||o.programConfigurations.populatePaintArrays(ve.length,E,E.index,{},K,wt&&wt[Mi])}o.placedSymbolArray.emplaceBack(R.x,R.y,I,this.glyphOffsetArray.length-I,ht,L,V,R.segment,c?c[0]:0,c?c[1]:0,m[0],m[1],A,0,!1,0,Y)},Sn.prototype._addCollisionDebugVertex=function(o,u,c,m,x,E){return u.emplaceBack(0,0),o.emplaceBack(c.x,c.y,m,x,Math.round(E.x),Math.round(E.y))},Sn.prototype.addCollisionDebugVertices=function(o,u,c,m,x,E,A){var R=x.segments.prepareSegment(4,x.layoutVertexArray,x.indexArray),L=R.vertexLength,V=x.layoutVertexArray,Y=x.collisionVertexArray,K=A.anchorX,le=A.anchorY;this._addCollisionDebugVertex(V,Y,E,K,le,new fe(o,u)),this._addCollisionDebugVertex(V,Y,E,K,le,new fe(c,u)),this._addCollisionDebugVertex(V,Y,E,K,le,new fe(c,m)),this._addCollisionDebugVertex(V,Y,E,K,le,new fe(o,m)),R.vertexLength+=4;var ve=x.indexArray;ve.emplaceBack(L,L+1),ve.emplaceBack(L+1,L+2),ve.emplaceBack(L+2,L+3),ve.emplaceBack(L+3,L),R.primitiveLength+=4},Sn.prototype.addDebugCollisionBoxes=function(o,u,c,m){for(var x=o;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)}},Sn.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new On(tc,Wd.members,ju),this.iconCollisionBox=new On(tc,Wd.members,ju);for(var o=0;o<this.symbolInstances.length;o++){var u=this.symbolInstances.get(o);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)}},Sn.prototype._deserializeCollisionBoxesForSymbol=function(o,u,c,m,x,E,A,R,L){for(var V={},Y=u;Y<c;Y++){var K=o.get(Y);V.textBox={x1:K.x1,y1:K.y1,x2:K.x2,y2:K.y2,anchorPointX:K.anchorPointX,anchorPointY:K.anchorPointY},V.textFeatureIndex=K.featureIndex;break}for(var le=m;le<x;le++){var ve=o.get(le);V.verticalTextBox={x1:ve.x1,y1:ve.y1,x2:ve.x2,y2:ve.y2,anchorPointX:ve.anchorPointX,anchorPointY:ve.anchorPointY},V.verticalTextFeatureIndex=ve.featureIndex;break}for(var ze=E;ze<A;ze++){var I=o.get(ze);V.iconBox={x1:I.x1,y1:I.y1,x2:I.x2,y2:I.y2,anchorPointX:I.anchorPointX,anchorPointY:I.anchorPointY},V.iconFeatureIndex=I.featureIndex;break}for(var ht=R;ht<L;ht++){var Je=o.get(ht);V.verticalIconBox={x1:Je.x1,y1:Je.y1,x2:Je.x2,y2:Je.y2,anchorPointX:Je.anchorPointX,anchorPointY:Je.anchorPointY},V.verticalIconFeatureIndex=Je.featureIndex;break}return V},Sn.prototype.deserializeCollisionBoxes=function(o){this.collisionArrays=[];for(var u=0;u<this.symbolInstances.length;u++){var c=this.symbolInstances.get(u);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(o,c.textBoxStartIndex,c.textBoxEndIndex,c.verticalTextBoxStartIndex,c.verticalTextBoxEndIndex,c.iconBoxStartIndex,c.iconBoxEndIndex,c.verticalIconBoxStartIndex,c.verticalIconBoxEndIndex))}},Sn.prototype.hasTextData=function(){return this.text.segments.get().length>0},Sn.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Sn.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Sn.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Sn.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Sn.prototype.addIndicesForPlacedSymbol=function(o,u){for(var c=o.placedSymbolArray.get(u),m=c.vertexStartIndex+4*c.numGlyphs,x=c.vertexStartIndex;x<m;x+=4)o.indexArray.emplaceBack(x,x+1,x+2),o.indexArray.emplaceBack(x+1,x+2,x+3)},Sn.prototype.getSortedSymbolIndexes=function(o){if(this.sortedAngle===o&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var u=Math.sin(o),c=Math.cos(o),m=[],x=[],E=[],A=0;A<this.symbolInstances.length;++A){E.push(A);var R=this.symbolInstances.get(A);m.push(0|Math.round(u*R.anchorX+c*R.anchorY)),x.push(R.featureIndex)}return E.sort(function(L,V){return m[L]-m[V]||x[V]-x[L]}),E},Sn.prototype.addToSortKeyRanges=function(o,u){var c=this.sortKeyRanges[this.sortKeyRanges.length-1];c&&c.sortKey===u?c.symbolInstanceEnd=o+1:this.sortKeyRanges.push({sortKey:u,symbolInstanceStart:o,symbolInstanceEnd:o+1})},Sn.prototype.sortFeatures=function(o){var u=this;if(this.sortFeaturesByY&&this.sortedAngle!==o&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(o),this.sortedAngle=o,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,R){E>=0&&R.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)}},xn("SymbolBucket",Sn,{omit:["layers","collisionBoxArray","features","compareText"]}),Sn.MAX_GLYPHS=65535,Sn.addDynamicAttributes=Cr;var Tn=new Ba({"symbol-placement":new Bn(j.layout_symbol["symbol-placement"]),"symbol-spacing":new Bn(j.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Bn(j.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new An(j.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Bn(j.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Bn(j.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Bn(j.layout_symbol["icon-ignore-placement"]),"icon-optional":new Bn(j.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Bn(j.layout_symbol["icon-rotation-alignment"]),"icon-size":new An(j.layout_symbol["icon-size"]),"icon-text-fit":new Bn(j.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Bn(j.layout_symbol["icon-text-fit-padding"]),"icon-image":new An(j.layout_symbol["icon-image"]),"icon-rotate":new An(j.layout_symbol["icon-rotate"]),"icon-padding":new Bn(j.layout_symbol["icon-padding"]),"icon-keep-upright":new Bn(j.layout_symbol["icon-keep-upright"]),"icon-offset":new An(j.layout_symbol["icon-offset"]),"icon-anchor":new An(j.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Bn(j.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Bn(j.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Bn(j.layout_symbol["text-rotation-alignment"]),"text-field":new An(j.layout_symbol["text-field"]),"text-font":new An(j.layout_symbol["text-font"]),"text-size":new An(j.layout_symbol["text-size"]),"text-max-width":new An(j.layout_symbol["text-max-width"]),"text-line-height":new Bn(j.layout_symbol["text-line-height"]),"text-letter-spacing":new An(j.layout_symbol["text-letter-spacing"]),"text-justify":new An(j.layout_symbol["text-justify"]),"text-radial-offset":new An(j.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Bn(j.layout_symbol["text-variable-anchor"]),"text-anchor":new An(j.layout_symbol["text-anchor"]),"text-max-angle":new Bn(j.layout_symbol["text-max-angle"]),"text-writing-mode":new Bn(j.layout_symbol["text-writing-mode"]),"text-rotate":new An(j.layout_symbol["text-rotate"]),"text-padding":new Bn(j.layout_symbol["text-padding"]),"text-keep-upright":new Bn(j.layout_symbol["text-keep-upright"]),"text-transform":new An(j.layout_symbol["text-transform"]),"text-offset":new An(j.layout_symbol["text-offset"]),"text-allow-overlap":new Bn(j.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Bn(j.layout_symbol["text-ignore-placement"]),"text-optional":new Bn(j.layout_symbol["text-optional"])}),$n={paint:new Ba({"icon-opacity":new An(j.paint_symbol["icon-opacity"]),"icon-color":new An(j.paint_symbol["icon-color"]),"icon-halo-color":new An(j.paint_symbol["icon-halo-color"]),"icon-halo-width":new An(j.paint_symbol["icon-halo-width"]),"icon-halo-blur":new An(j.paint_symbol["icon-halo-blur"]),"icon-translate":new Bn(j.paint_symbol["icon-translate"]),"icon-translate-anchor":new Bn(j.paint_symbol["icon-translate-anchor"]),"text-opacity":new An(j.paint_symbol["text-opacity"]),"text-color":new An(j.paint_symbol["text-color"],{runtimeType:jr,getOverride:function(o){return o.textColor},hasOverride:function(o){return!!o.textColor}}),"text-halo-color":new An(j.paint_symbol["text-halo-color"]),"text-halo-width":new An(j.paint_symbol["text-halo-width"]),"text-halo-blur":new An(j.paint_symbol["text-halo-blur"]),"text-translate":new Bn(j.paint_symbol["text-translate"]),"text-translate-anchor":new Bn(j.paint_symbol["text-translate-anchor"])}),layout:Tn},ni=function(o){this.type=o.property.overrides?o.property.overrides.runtimeType:Qr,this.defaultValue=o};ni.prototype.evaluate=function(o){if(o.formattedSection){var u=this.defaultValue.property.overrides;if(u&&u.hasOverride(o.formattedSection))return u.getOverride(o.formattedSection)}return o.feature&&o.featureState?this.defaultValue.evaluate(o.feature,o.featureState):this.defaultValue.property.specification.default},ni.prototype.eachChild=function(o){this.defaultValue.isConstant()||o(this.defaultValue.value._styleExpression.expression)},ni.prototype.outputDefined=function(){return!1},ni.prototype.serialize=function(){return null},xn("FormatSectionOverride",ni,{omit:["defaultValue"]});var aa=function(o){function u(c){o.call(this,c,$n)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u.prototype.recalculate=function(c,m){if(o.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,R=x;A<R.length;A+=1){var L=R[A];E.indexOf(L)<0&&E.push(L)}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),R=this._unevaluatedLayout._values[c];return R.isDataDriven()||Uu(R.value)||!A?A:function(L,V){return V.replace(/{([^{}]+)}/g,function(Y,K){return K in L?String(L[K]):""})}(m.properties,A)},u.prototype.createBucket=function(c){return new Sn(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),R=new ni(A),L=new $l(R,A.property.specification);E=A.value.kind==="constant"||A.value.kind==="source"?new bc("source",L):new Yl("composite",L,A.value.zoomStops,A.value._interpolationType),this.paint._values[x]=new Mo(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,R=function(Y){for(var K=0,le=Y;K<le.length;K+=1)if(E.overrides&&E.overrides.hasOverride(le[K]))return void(A=!0)};if(x.value.kind==="constant"&&x.value.value instanceof fa)R(x.value.value.sections);else if(x.value.kind==="source"){var L=function(Y){A||(Y instanceof ka&&Ma(Y.value)===Vi?R(Y.value.sections):Y instanceof is?R(Y.sections):Y.eachChild(L))},V=x.value;V._styleExpression&&L(V._styleExpression.expression)}return A},u}(tu),No={paint:new Ba({"background-color":new Bn(j.paint_background["background-color"]),"background-pattern":new ss(j.paint_background["background-pattern"]),"background-opacity":new Bn(j.paint_background["background-opacity"])})},$u=function(o){function u(c){o.call(this,c,No)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u}(tu),bp={paint:new Ba({"raster-opacity":new Bn(j.paint_raster["raster-opacity"]),"raster-hue-rotate":new Bn(j.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Bn(j.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Bn(j.paint_raster["raster-brightness-max"]),"raster-saturation":new Bn(j.paint_raster["raster-saturation"]),"raster-contrast":new Bn(j.paint_raster["raster-contrast"]),"raster-resampling":new Bn(j.paint_raster["raster-resampling"]),"raster-fade-duration":new Bn(j.paint_raster["raster-fade-duration"])})},Yu=function(o){function u(c){o.call(this,c,bp)}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.prototype)).constructor=u,u}(tu),ed=function(o){function u(c){o.call(this,c,{}),this.implementation=c}return o&&(u.__proto__=o),(u.prototype=Object.create(o&&o.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}(tu),Ll={circle:Ch,heatmap:dl,hillshade:ag,fill:gp,"fill-extrusion":Yp,line:qf,symbol:aa,background:$u,raster:Yu},td=ce.HTMLImageElement,ff=ce.HTMLCanvasElement,Kf=ce.HTMLVideoElement,rd=ce.ImageData,es=ce.ImageBitmap,Dh=function(o,u,c,m){this.context=o,this.format=c,this.texture=o.gl.createTexture(),this.update(u,m)};Dh.prototype.update=function(o,u,c){var m=o.width,x=o.height,E=!(this.size&&this.size[0]===m&&this.size[1]===x||c),A=this.context,R=A.gl;if(this.useMipmap=!!(u&&u.useMipmap),R.bindTexture(R.TEXTURE_2D,this.texture),A.pixelStoreUnpackFlipY.set(!1),A.pixelStoreUnpack.set(1),A.pixelStoreUnpackPremultiplyAlpha.set(this.format===R.RGBA&&(!u||u.premultiply!==!1)),E)this.size=[m,x],o instanceof td||o instanceof ff||o instanceof Kf||o instanceof rd||es&&o instanceof es?R.texImage2D(R.TEXTURE_2D,0,this.format,this.format,R.UNSIGNED_BYTE,o):R.texImage2D(R.TEXTURE_2D,0,this.format,m,x,0,this.format,R.UNSIGNED_BYTE,o.data);else{var L=c||{x:0,y:0},V=L.x,Y=L.y;o instanceof td||o instanceof ff||o instanceof Kf||o instanceof rd||es&&o instanceof es?R.texSubImage2D(R.TEXTURE_2D,0,V,Y,R.RGBA,R.UNSIGNED_BYTE,o):R.texSubImage2D(R.TEXTURE_2D,0,V,Y,m,x,R.RGBA,R.UNSIGNED_BYTE,o.data)}this.useMipmap&&this.isSizePowerOfTwo()&&R.generateMipmap(R.TEXTURE_2D)},Dh.prototype.bind=function(o,u,c){var m=this.context.gl;m.bindTexture(m.TEXTURE_2D,this.texture),c!==m.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(c=m.LINEAR),o!==this.filter&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,o),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,c||o),this.filter=o),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)},Dh.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Dh.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Wv=function(o){var u=this;this._callback=o,this._triggered=!1,typeof MessageChannel!="undefined"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){u._triggered=!1,u._callback()})};Wv.prototype.trigger=function(){var o=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){o._triggered=!1,o._callback()},0))},Wv.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Lh=function(o,u,c){this.target=o,this.parent=u,this.mapId=c,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},Rr(["receive","process"],this),this.invoker=new Wv(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=oe()?o:ce};function Gv(o,u,c){var m=2*Math.PI*6378137/256/Math.pow(2,c);return[o*m-2*Math.PI*6378137/2,u*m-2*Math.PI*6378137/2]}Lh.prototype.send=function(o,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 R=Be(this.globalScope)?void 0:[];return this.target.postMessage({id:A,type:o,hasCallback:!!c,targetMapId:m,mustQueue:x,sourceMapId:this.mapId,data:as(u,R)},R),{cancel:function(){c&&delete E.callbacks[A],E.target.postMessage({id:A,type:"<cancel>",targetMapId:m,sourceMapId:E.mapId})}}},Lh.prototype.receive=function(o){var u=o.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 oe()||u.mustQueue?(this.tasks[c]=u,this.taskQueue.push(c),this.invoker.trigger()):this.processTask(c,u)},Lh.prototype.process=function(){if(this.taskQueue.length){var o=this.taskQueue.shift(),u=this.tasks[o];delete this.tasks[o],this.taskQueue.length&&this.invoker.trigger(),u&&this.processTask(o,u)}},Lh.prototype.processTask=function(o,u){var c=this;if(u.type==="<response>"){var m=this.callbacks[o];delete this.callbacks[o],m&&(u.error?m(pa(u.error)):m(null,pa(u.data)))}else{var x=!1,E=Be(this.globalScope)?void 0:[],A=u.hasCallback?function(Y,K){x=!0,delete c.cancelCallbacks[o],c.target.postMessage({id:o,type:"<response>",sourceMapId:c.mapId,error:Y?as(Y):null,data:as(K,E)},E)}:function(Y){x=!0},R=null,L=pa(u.data);if(this.parent[u.type])R=this.parent[u.type](u.sourceMapId,L,A);else if(this.parent.getWorkerSource){var V=u.type.split(".");R=this.parent.getWorkerSource(u.sourceMapId,V[0],L.source)[V[1]](L,A)}else A(new Error("Could not find function "+u.type));!x&&R&&R.cancel&&(this.cancelCallbacks[o]=R.cancel)}},Lh.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var jo=function(o,u){o&&(u?this.setSouthWest(o).setNorthEast(u):o.length===4?this.setSouthWest([o[0],o[1]]).setNorthEast([o[2],o[3]]):this.setSouthWest(o[0]).setNorthEast(o[1]))};jo.prototype.setNorthEast=function(o){return this._ne=o instanceof Xa?new Xa(o.lng,o.lat):Xa.convert(o),this},jo.prototype.setSouthWest=function(o){return this._sw=o instanceof Xa?new Xa(o.lng,o.lat):Xa.convert(o),this},jo.prototype.extend=function(o){var u,c,m=this._sw,x=this._ne;if(o instanceof Xa)u=o,c=o;else{if(!(o instanceof jo))return Array.isArray(o)?o.length===4||o.every(Array.isArray)?this.extend(jo.convert(o)):this.extend(Xa.convert(o)):this;if(c=o._ne,!(u=o._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 Xa(u.lng,u.lat),this._ne=new Xa(c.lng,c.lat)),this},jo.prototype.getCenter=function(){return new Xa((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},jo.prototype.getSouthWest=function(){return this._sw},jo.prototype.getNorthEast=function(){return this._ne},jo.prototype.getNorthWest=function(){return new Xa(this.getWest(),this.getNorth())},jo.prototype.getSouthEast=function(){return new Xa(this.getEast(),this.getSouth())},jo.prototype.getWest=function(){return this._sw.lng},jo.prototype.getSouth=function(){return this._sw.lat},jo.prototype.getEast=function(){return this._ne.lng},jo.prototype.getNorth=function(){return this._ne.lat},jo.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},jo.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},jo.prototype.isEmpty=function(){return!(this._sw&&this._ne)},jo.prototype.contains=function(o){var u=Xa.convert(o),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},jo.convert=function(o){return!o||o instanceof jo?o:new jo(o)};var Xa=function(o,u){if(isNaN(o)||isNaN(u))throw new Error("Invalid LngLat object: ("+o+", "+u+")");if(this.lng=+o,this.lat=+u,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Xa.prototype.wrap=function(){return new Xa(Xt(this.lng,-180,180),this.lat)},Xa.prototype.toArray=function(){return[this.lng,this.lat]},Xa.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Xa.prototype.distanceTo=function(o){var u=Math.PI/180,c=this.lat*u,m=o.lat*u,x=Math.sin(c)*Math.sin(m)+Math.cos(c)*Math.cos(m)*Math.cos((o.lng-this.lng)*u);return 63710088e-1*Math.acos(Math.min(x,1))},Xa.prototype.toBounds=function(o){o===void 0&&(o=0);var u=360*o/40075017,c=u/Math.cos(Math.PI/180*this.lat);return new jo(new Xa(this.lng-c,this.lat-u),new Xa(this.lng+c,this.lat+u))},Xa.convert=function(o){if(o instanceof Xa)return o;if(Array.isArray(o)&&(o.length===2||o.length===3))return new Xa(Number(o[0]),Number(o[1]));if(!Array.isArray(o)&&typeof o=="object"&&o!==null)return new Xa(Number("lng"in o?o.lng:o.lon),Number(o.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 sg=2*Math.PI*63710088e-1;function ug(o){return sg*Math.cos(o*Math.PI/180)}function Di(o){return(180+o)/360}function Pi(o){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360}function Bh(o,u){return o/ug(u)}function nd(o){return 360/Math.PI*Math.atan(Math.exp((180-360*o)*Math.PI/180))-90}var Fh=function(o,u,c){c===void 0&&(c=0),this.x=+o,this.y=+u,this.z=+c};Fh.fromLngLat=function(o,u){u===void 0&&(u=0);var c=Xa.convert(o);return new Fh(Di(c.lng),Pi(c.lat),Bh(u,c.lat))},Fh.prototype.toLngLat=function(){return new Xa(360*this.x-180,nd(this.y))},Fh.prototype.toAltitude=function(){return this.z*ug(nd(this.y))},Fh.prototype.meterInMercatorCoordinateUnits=function(){return 1/sg*(o=nd(this.y),1/Math.cos(o*Math.PI/180));var o};var Qf=function(o,u,c){this.z=o,this.x=u,this.y=c,this.key=uc(0,o,o,u,c)};Qf.prototype.equals=function(o){return this.z===o.z&&this.x===o.x&&this.y===o.y},Qf.prototype.url=function(o,u){var c,m,x,E,A,R=(m=this.y,x=this.z,E=Gv(256*(c=this.x),256*(m=Math.pow(2,x)-m-1),x),A=Gv(256*(c+1),256*(m+1),x),E[0]+","+E[1]+","+A[0]+","+A[1]),L=function(V,Y,K){for(var le,ve="",ze=V;ze>0;ze--)ve+=(Y&(le=1<<ze-1)?1:0)+(K&le?2:0);return ve}(this.z,this.x,this.y);return o[(this.x+this.y)%o.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}",L).replace("{bbox-epsg-3857}",R)},Qf.prototype.getTilePoint=function(o){var u=Math.pow(2,this.z);return new fe(8192*(o.x*u-this.x),8192*(o.y*u-this.y))},Qf.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Xv=function(o,u){this.wrap=o,this.canonical=u,this.key=uc(o,u.z,u.z,u.x,u.y)},to=function(o,u,c,m,x){this.overscaledZ=o,this.wrap=u,this.canonical=new Qf(c,+m,+x),this.key=uc(u,o,c,m,x)};function uc(o,u,c,m,x){(o*=2)<0&&(o=-1*o-1);var E=1<<c;return(E*E*o+E*x+m).toString(36)+c.toString(36)+u.toString(36)}to.prototype.equals=function(o){return this.overscaledZ===o.overscaledZ&&this.wrap===o.wrap&&this.canonical.equals(o.canonical)},to.prototype.scaledTo=function(o){var u=this.canonical.z-o;return o>this.canonical.z?new to(o,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new to(o,this.wrap,o,this.canonical.x>>u,this.canonical.y>>u)},to.prototype.calculateScaledKey=function(o,u){var c=this.canonical.z-o;return o>this.canonical.z?uc(this.wrap*+u,o,this.canonical.z,this.canonical.x,this.canonical.y):uc(this.wrap*+u,o,o,this.canonical.x>>c,this.canonical.y>>c)},to.prototype.isChildOf=function(o){if(o.wrap!==this.wrap)return!1;var u=this.canonical.z-o.canonical.z;return o.overscaledZ===0||o.overscaledZ<this.overscaledZ&&o.canonical.x===this.canonical.x>>u&&o.canonical.y===this.canonical.y>>u},to.prototype.children=function(o){if(this.overscaledZ>=o)return[new to(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 to(u,this.wrap,u,c,m),new to(u,this.wrap,u,c+1,m),new to(u,this.wrap,u,c,m+1),new to(u,this.wrap,u,c+1,m+1)]},to.prototype.isLessThan=function(o){return this.wrap<o.wrap||!(this.wrap>o.wrap)&&(this.overscaledZ<o.overscaledZ||!(this.overscaledZ>o.overscaledZ)&&(this.canonical.x<o.canonical.x||!(this.canonical.x>o.canonical.x)&&this.canonical.y<o.canonical.y))},to.prototype.wrapped=function(){return new to(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},to.prototype.unwrapTo=function(o){return new to(this.overscaledZ,o,this.canonical.z,this.canonical.x,this.canonical.y)},to.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},to.prototype.toUnwrapped=function(){return new Xv(this.wrap,this.canonical)},to.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},to.prototype.getTilePoint=function(o){return this.canonical.getTilePoint(new Fh(o.x-this.wrap,o.y))},xn("CanonicalTileID",Qf),xn("OverscaledTileID",to,{omit:["posMatrix"]});var Nc=function(o,u,c){if(this.uid=o,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)]};Nc.prototype.get=function(o,u){var c=new Uint8Array(this.data.buffer),m=4*this._idx(o,u);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(c[m],c[m+1],c[m+2])},Nc.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Nc.prototype._idx=function(o,u){if(o<-1||o>=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+(o+1)},Nc.prototype._unpackMapbox=function(o,u,c){return(256*o*256+256*u+c)/10-1e4},Nc.prototype._unpackTerrarium=function(o,u,c){return 256*o+u+c/256-32768},Nc.prototype.getPixels=function(){return new Lo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Nc.prototype.backfillBorder=function(o,u,c){if(this.dim!==o.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 R=-u*this.dim,L=-c*this.dim,V=E;V<A;V++)for(var Y=m;Y<x;Y++)this.data[this._idx(Y,V)]=o.data[this._idx(Y+R,V+L)]},xn("DEMData",Nc);var id=function(o){this._stringToNumber={},this._numberToString=[];for(var u=0;u<o.length;u++){var c=o[u];this._stringToNumber[c]=u,this._numberToString[u]=c}};id.prototype.encode=function(o){return this._stringToNumber[o]},id.prototype.decode=function(o){return this._numberToString[o]};var ad=function(o,u,c,m,x){this.type="Feature",this._vectorTileFeature=o,o._z=u,o._x=c,o._y=m,this.properties=o.properties,this.id=x},od={geometry:{configurable:!0}};od.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},od.geometry.set=function(o){this._geometry=o},ad.prototype.toJSON=function(){var o={geometry:this.geometry};for(var u in this)u!=="_geometry"&&u!=="_vectorTileFeature"&&(o[u]=this[u]);return o},Object.defineProperties(ad.prototype,od);var Nh=function(){this.state={},this.stateChanges={},this.deletedStates={}};Nh.prototype.updateState=function(o,u,c){var m=String(u);if(this.stateChanges[o]=this.stateChanges[o]||{},this.stateChanges[o][m]=this.stateChanges[o][m]||{},Yt(this.stateChanges[o][m],c),this.deletedStates[o]===null)for(var x in this.deletedStates[o]={},this.state[o])x!==m&&(this.deletedStates[o][x]=null);else if(this.deletedStates[o]&&this.deletedStates[o][m]===null)for(var E in this.deletedStates[o][m]={},this.state[o][m])c[E]||(this.deletedStates[o][m][E]=null);else for(var A in c)this.deletedStates[o]&&this.deletedStates[o][m]&&this.deletedStates[o][m][A]===null&&delete this.deletedStates[o][m][A]},Nh.prototype.removeFeatureState=function(o,u,c){if(this.deletedStates[o]!==null){var m=String(u);if(this.deletedStates[o]=this.deletedStates[o]||{},c&&u!==void 0)this.deletedStates[o][m]!==null&&(this.deletedStates[o][m]=this.deletedStates[o][m]||{},this.deletedStates[o][m][c]=null);else if(u!==void 0)if(this.stateChanges[o]&&this.stateChanges[o][m])for(c in this.deletedStates[o][m]={},this.stateChanges[o][m])this.deletedStates[o][m][c]=null;else this.deletedStates[o][m]=null;else this.deletedStates[o]=null}},Nh.prototype.getState=function(o,u){var c=String(u),m=Yt({},(this.state[o]||{})[c],(this.stateChanges[o]||{})[c]);if(this.deletedStates[o]===null)return{};if(this.deletedStates[o]){var x=this.deletedStates[o][u];if(x===null)return{};for(var E in x)delete m[E]}return m},Nh.prototype.initializeTileState=function(o,u){o.setFeatureState(this.state,u)},Nh.prototype.coalesceChanges=function(o,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]={}),Yt(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 R={};if(this.deletedStates[A]===null)for(var L in this.state[A])R[L]={},this.state[A][L]={};else for(var V in this.deletedStates[A]){if(this.deletedStates[A][V]===null)this.state[A][V]={};else for(var Y=0,K=Object.keys(this.deletedStates[A][V]);Y<K.length;Y+=1)delete this.state[A][V][K[Y]];R[V]=this.state[A][V]}c[A]=c[A]||{},Yt(c[A],R)}if(this.stateChanges={},this.deletedStates={},Object.keys(c).length!==0)for(var le in o)o[le].setFeatureState(c,u)};var hf=function(o,u){this.tileID=o,this.x=o.canonical.x,this.y=o.canonical.y,this.z=o.canonical.z,this.grid=new Ro(8192,16,0),this.grid3D=new Ro(8192,16,0),this.featureIndexArray=new J,this.promoteId=u};function lg(o,u,c,m,x){return fr(o,function(E,A){var R=u instanceof _s?u.get(A):null;return R&&R.evaluate?R.evaluate(c,m,x):R})}function $v(o){for(var u=1/0,c=1/0,m=-1/0,x=-1/0,E=0,A=o;E<A.length;E+=1){var R=A[E];u=Math.min(u,R.x),c=Math.min(c,R.y),m=Math.max(m,R.x),x=Math.max(x,R.y)}return{minX:u,minY:c,maxX:m,maxY:x}}function cg(o,u){return u-o}hf.prototype.insert=function(o,u,c,m,x,E){var A=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(c,m,x);for(var R=E?this.grid3D:this.grid,L=0;L<u.length;L++){for(var V=u[L],Y=[1/0,1/0,-1/0,-1/0],K=0;K<V.length;K++){var le=V[K];Y[0]=Math.min(Y[0],le.x),Y[1]=Math.min(Y[1],le.y),Y[2]=Math.max(Y[2],le.x),Y[3]=Math.max(Y[3],le.y)}Y[0]<8192&&Y[1]<8192&&Y[2]>=0&&Y[3]>=0&&R.insert(A,Y[0],Y[1],Y[2],Y[3])}},hf.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new sc.VectorTile(new Jt(this.rawTileData)).layers,this.sourceLayerCoder=new id(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},hf.prototype.query=function(o,u,c,m){var x=this;this.loadVTLayers();for(var E=o.params||{},A=8192/o.tileSize/o.scale,R=sl(E.filter),L=o.queryGeometry,V=o.queryPadding*A,Y=$v(L),K=this.grid.query(Y.minX-V,Y.minY-V,Y.maxX+V,Y.maxY+V),le=$v(o.cameraQueryGeometry),ve=this.grid3D.query(le.minX-V,le.minY-V,le.maxX+V,le.maxY+V,function(nr,or,mr,Zr){return function(qr,Nn,vn,Zn,mn){for(var bi=0,ei=qr;bi<ei.length;bi+=1){var Mn=ei[bi];if(Nn<=Mn.x&&vn<=Mn.y&&Zn>=Mn.x&&mn>=Mn.y)return!0}var Mi=[new fe(Nn,vn),new fe(Nn,mn),new fe(Zn,mn),new fe(Zn,vn)];if(qr.length>2){for(var mi=0,Hi=Mi;mi<Hi.length;mi+=1)if(cu(qr,Hi[mi]))return!0}for(var Hn=0;Hn<qr.length-1;Hn++)if(pl(qr[Hn],qr[Hn+1],Mi))return!0;return!1}(o.cameraQueryGeometry,nr-V,or-V,mr+V,Zr+V)}),ze=0,I=ve;ze<I.length;ze+=1)K.push(I[ze]);K.sort(cg);for(var ht,Je={},wt=function(nr){var or=K[nr];if(or!==ht){ht=or;var mr=x.featureIndexArray.get(or),Zr=null;x.loadMatchingFeature(Je,mr.bucketIndex,mr.sourceLayerIndex,mr.featureIndex,R,E.layers,E.availableImages,u,c,m,function(qr,Nn,vn){return Zr||(Zr=Wa(qr)),Nn.queryIntersectsFeature(L,qr,vn,Zr,x.z,o.transform,A,o.pixelPosMatrix)})}},Bt=0;Bt<K.length;Bt++)wt(Bt);return Je},hf.prototype.loadMatchingFeature=function(o,u,c,m,x,E,A,R,L,V,Y){var K=this.bucketLayerIDs[u];if(!E||function(qr,Nn){for(var vn=0;vn<qr.length;vn++)if(Nn.indexOf(qr[vn])>=0)return!0;return!1}(E,K)){var le=this.sourceLayerCoder.decode(c),ve=this.vtLayers[le].feature(m);if(x.needGeometry){var ze=Ja(ve,!0);if(!x.filter(new Me(this.tileID.overscaledZ),ze,this.tileID.canonical))return}else if(!x.filter(new Me(this.tileID.overscaledZ),ve))return;for(var I=this.getId(ve,le),ht=0;ht<K.length;ht++){var Je=K[ht];if(!(E&&E.indexOf(Je)<0)){var wt=R[Je];if(wt){var Bt={};I!==void 0&&V&&(Bt=V.getState(wt.sourceLayer||"_geojsonTileLayer",I));var nr=Yt({},L[Je]);nr.paint=lg(nr.paint,wt.paint,ve,Bt,A),nr.layout=lg(nr.layout,wt.layout,ve,Bt,A);var or=!Y||Y(ve,wt,Bt);if(or){var mr=new ad(ve,this.z,this.x,this.y,I);mr.layer=nr;var Zr=o[Je];Zr===void 0&&(Zr=o[Je]=[]),Zr.push({featureIndex:m,feature:mr,intersectionZ:or})}}}}}},hf.prototype.lookupSymbolFeatures=function(o,u,c,m,x,E,A,R){var L={};this.loadVTLayers();for(var V=sl(x),Y=0,K=o;Y<K.length;Y+=1)this.loadMatchingFeature(L,c,m,K[Y],V,E,A,R,u);return L},hf.prototype.hasLayer=function(o){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(o===x[m])return!0;return!1},hf.prototype.getId=function(o,u){var c=o.id;return this.promoteId&&typeof(c=o.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[u]])=="boolean"&&(c=Number(c)),c},xn("FeatureIndex",hf,{omit:["rawTileData","sourceLayerCoder"]});var fs=function(o,u){this.tileID=o,this.uid=Zt(),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"};fs.prototype.registerFadeDuration=function(o){var u=o+this.timeAdded;u<Jr.now()||this.fadeEndTime&&u<this.fadeEndTime||(this.fadeEndTime=u)},fs.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},fs.prototype.loadVectorData=function(o,u,c){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",o){for(var m in o.featureIndex&&(this.latestFeatureIndex=o.featureIndex,o.rawTileData?(this.latestRawTileData=o.rawTileData,this.latestFeatureIndex.rawTileData=o.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=o.collisionBoxArray,this.buckets=function(V,Y){var K={};if(!Y)return K;for(var le=function(){var I=ze[ve],ht=I.layerIds.map(function(Bt){return Y.getLayer(Bt)}).filter(Boolean);if(ht.length!==0){I.layers=ht,I.stateDependentLayerIds&&(I.stateDependentLayers=I.stateDependentLayerIds.map(function(Bt){return ht.filter(function(nr){return nr.id===Bt})[0]}));for(var Je=0,wt=ht;Je<wt.length;Je+=1)K[wt[Je].id]=I}},ve=0,ze=V;ve<ze.length;ve+=1)le();return K}(o.buckets,u.style),this.hasSymbolBuckets=!1,this.buckets){var x=this.buckets[m];if(x instanceof Sn){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 Sn&&A.hasRTLText){this.hasRTLText=!0,Ft.isLoading()||Ft.isLoaded()||Uf()!=="deferred"||Js();break}}for(var R in this.queryPadding=0,this.buckets){var L=this.buckets[R];this.queryPadding=Math.max(this.queryPadding,u.style.getLayer(R).queryRadius(L))}o.imageAtlas&&(this.imageAtlas=o.imageAtlas),o.glyphAtlasImage&&(this.glyphAtlasImage=o.glyphAtlasImage)}else this.collisionBoxArray=new v},fs.prototype.unloadVectorData=function(){for(var o in this.buckets)this.buckets[o].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},fs.prototype.getBucket=function(o){return this.buckets[o.id]},fs.prototype.upload=function(o){for(var u in this.buckets){var c=this.buckets[u];c.uploadPending()&&c.upload(o)}var m=o.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Dh(o,this.imageAtlas.image,m.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Dh(o,this.glyphAtlasImage,m.ALPHA),this.glyphAtlasImage=null)},fs.prototype.prepare=function(o){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(o,this.imageAtlasTexture)},fs.prototype.queryRenderedFeatures=function(o,u,c,m,x,E,A,R,L,V){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:m,cameraQueryGeometry:x,scale:E,tileSize:this.tileSize,pixelPosMatrix:V,transform:R,params:A,queryPadding:this.queryPadding*L},o,u,c):{}},fs.prototype.querySourceFeatures=function(o,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=sl(u&&u.filter),R=this.tileID.canonical,L=R.z,V=R.x,Y=R.y,K={z:L,x:V,y:Y},le=0;le<E.length;le++){var ve=E.feature(le);if(A.needGeometry){var ze=Ja(ve,!0);if(!A.filter(new Me(this.tileID.overscaledZ),ze,this.tileID.canonical))continue}else if(!A.filter(new Me(this.tileID.overscaledZ),ve))continue;var I=c.getId(ve,x),ht=new ad(ve,L,V,Y,I);ht.tile=K,o.push(ht)}}},fs.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},fs.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},fs.prototype.setExpiryData=function(o){var u=this.expirationTime;if(o.cacheControl){var c=H(o.cacheControl);c["max-age"]&&(this.expirationTime=Date.now()+1e3*c["max-age"])}else o.expires&&(this.expirationTime=new Date(o.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}},fs.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)},fs.prototype.setFeatureState=function(o,u){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(o).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],R=o[E];if(A&&R&&Object.keys(R).length!==0){x.update(R,A,this.imageAtlas&&this.imageAtlas.patternPositions||{});var L=u&&u.style&&u.style.getLayer(m);L&&(this.queryPadding=Math.max(this.queryPadding,L.queryRadius(x)))}}}},fs.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},fs.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Jr.now()},fs.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},fs.prototype.setHoldDuration=function(o){this.symbolFadeHoldUntil=Jr.now()+o},fs.prototype.setDependencies=function(o,u){for(var c={},m=0,x=u;m<x.length;m+=1)c[x[m]]=!0;this.dependencies[o]=c},fs.prototype.hasDependency=function(o,u){for(var c=0,m=o;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 Jf=ce.performance,fg=function(o){this._marks={start:[o.url,"start"].join("#"),end:[o.url,"end"].join("#"),measure:o.url.toString()},Jf.mark(this._marks.start)};fg.prototype.finish=function(){Jf.mark(this._marks.end);var o=Jf.getEntriesByName(this._marks.measure);return o.length===0&&(Jf.measure(this._marks.measure,this._marks.start,this._marks.end),o=Jf.getEntriesByName(this._marks.measure),Jf.clearMarks(this._marks.start),Jf.clearMarks(this._marks.end),Jf.clearMeasures(this._marks.measure)),o},y.Actor=Lh,y.AlphaImage=ru,y.CanonicalTileID=Qf,y.CollisionBoxArray=v,y.Color=Ai,y.DEMData=Nc,y.DataConstantProperty=Bn,y.DictionaryCoder=id,y.EXTENT=8192,y.ErrorEvent=Ue,y.EvaluationParameters=Me,y.Event=xe,y.Evented=Qe,y.FeatureIndex=hf,y.FillBucket=ml,y.FillExtrusionBucket=As,y.ImageAtlas=xr,y.ImagePosition=an,y.LineBucket=Os,y.LngLat=Xa,y.LngLatBounds=jo,y.MercatorCoordinate=Fh,y.ONE_EM=24,y.OverscaledTileID=to,y.Point=fe,y.Point$1=fe,y.Properties=Ba,y.Protobuf=Jt,y.RGBAImage=Lo,y.RequestManager=ti,y.RequestPerformance=fg,y.ResourceType=z,y.SegmentVector=be,y.SourceFeatureState=Nh,y.StructArrayLayout1ui2=jf,y.StructArrayLayout2f1f2i16=rc,y.StructArrayLayout2i4=Ol,y.StructArrayLayout3ui6=us,y.StructArrayLayout4i8=zf,y.SymbolBucket=Sn,y.Texture=Dh,y.Tile=fs,y.Transitionable=_e,y.Uniform1f=Hr,y.Uniform1i=br,y.Uniform2f=Fr,y.Uniform3f=hn,y.Uniform4f=Un,y.UniformColor=Fn,y.UniformMatrix4f=zi,y.UnwrappedTileID=Xv,y.ValidationError=Q,y.WritingMode=er,y.ZoomHistory=Bf,y.add=function(o,u,c){return o[0]=u[0]+c[0],o[1]=u[1]+c[1],o[2]=u[2]+c[2],o},y.addDynamicAttributes=Cr,y.asyncAll=function(o,u,c){if(!o.length)return c(null,[]);var m=o.length,x=new Array(o.length),E=null;o.forEach(function(A,R){u(A,function(L,V){L&&(E=L),x[R]=V,--m==0&&c(E,x)})})},y.bezier=vt,y.bindAll=Rr,y.browser=Jr,y.cacheEntryPossiblyAdded=function(o){++ue>Vr&&(o.getActor().send("enforceCacheSizeLimit",pr),ue=0)},y.clamp=Ot,y.clearTileCache=function(o){var u=ce.caches.delete("mapbox-tiles");o&&u.catch(o).then(function(){return o()})},y.clipLine=gl,y.clone=function(o){var u=new Fi(16);return u[0]=o[0],u[1]=o[1],u[2]=o[2],u[3]=o[3],u[4]=o[4],u[5]=o[5],u[6]=o[6],u[7]=o[7],u[8]=o[8],u[9]=o[9],u[10]=o[10],u[11]=o[11],u[12]=o[12],u[13]=o[13],u[14]=o[14],u[15]=o[15],u},y.clone$1=ft,y.clone$2=function(o){var u=new Fi(3);return u[0]=o[0],u[1]=o[1],u[2]=o[2],u},y.collisionCircleLayout=W,y.config=on,y.create=function(){var o=new Fi(16);return Fi!=Float32Array&&(o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[11]=0,o[12]=0,o[13]=0,o[14]=0),o[0]=1,o[5]=1,o[10]=1,o[15]=1,o},y.create$1=function(){var o=new Fi(9);return Fi!=Float32Array&&(o[1]=0,o[2]=0,o[3]=0,o[5]=0,o[6]=0,o[7]=0),o[0]=1,o[4]=1,o[8]=1,o},y.create$2=function(){var o=new Fi(4);return Fi!=Float32Array&&(o[1]=0,o[2]=0),o[0]=1,o[3]=1,o},y.createCommonjsModule=he,y.createExpression=Jc,y.createLayout=yo,y.createStyleLayer=function(o){return o.type==="custom"?new ed(o):new Ll[o.type](o)},y.cross=function(o,u,c){var m=u[0],x=u[1],E=u[2],A=c[0],R=c[1],L=c[2];return o[0]=x*L-E*R,o[1]=E*A-m*L,o[2]=m*R-x*A,o},y.deepEqual=function o(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(!o(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(!o(u[x],c[x]))return!1;return!0}return u===c},y.dot=function(o,u){return o[0]*u[0]+o[1]*u[1]+o[2]*u[2]},y.dot$1=function(o,u){return o[0]*u[0]+o[1]*u[1]+o[2]*u[2]+o[3]*u[3]},y.ease=tt,y.emitValidationErrors=Jl,y.endsWith=gr,y.enforceCacheSizeLimit=function(o){en(),Ea&&Ea.then(function(u){u.keys().then(function(c){for(var m=0;m<c.length-o;m++)u.delete(c[m])})})},y.evaluateSizeForFeature=Ts,y.evaluateSizeForZoom=So,y.evaluateVariableOffset=yt,y.evented=Cc,y.extend=Yt,y.featureFilter=sl,y.filterObject=Mt,y.fromRotation=function(o,u){var c=Math.sin(u),m=Math.cos(u);return o[0]=m,o[1]=c,o[2]=0,o[3]=-c,o[4]=m,o[5]=0,o[6]=0,o[7]=0,o[8]=1,o},y.getAnchorAlignment=Aa,y.getAnchorJustification=xt,y.getArrayBuffer=Rt,y.getImage=B,y.getJSON=function(o,u){return Tt(Yt(o,{type:"json"}),u)},y.getRTLTextPluginStatus=Uf,y.getReferrer=Ee,y.getVideo=function(o,u){var c,m,x=ce.document.createElement("video");x.muted=!0,x.onloadstart=function(){u(null,x)};for(var E=0;E<o.length;E++){var A=ce.document.createElement("source");c=o[E],m=void 0,(m=ce.document.createElement("a")).href=c,(m.protocol!==ce.document.location.protocol||m.host!==ce.document.location.host)&&(x.crossOrigin="Anonymous"),A.src=o[E],x.appendChild(A)}return{cancel:function(){}}},y.identity=Jo,y.invert=function(o,u){var c=u[0],m=u[1],x=u[2],E=u[3],A=u[4],R=u[5],L=u[6],V=u[7],Y=u[8],K=u[9],le=u[10],ve=u[11],ze=u[12],I=u[13],ht=u[14],Je=u[15],wt=c*R-m*A,Bt=c*L-x*A,nr=c*V-E*A,or=m*L-x*R,mr=m*V-E*R,Zr=x*V-E*L,qr=Y*I-K*ze,Nn=Y*ht-le*ze,vn=Y*Je-ve*ze,Zn=K*ht-le*I,mn=K*Je-ve*I,bi=le*Je-ve*ht,ei=wt*bi-Bt*mn+nr*Zn+or*vn-mr*Nn+Zr*qr;return ei?(o[0]=(R*bi-L*mn+V*Zn)*(ei=1/ei),o[1]=(x*mn-m*bi-E*Zn)*ei,o[2]=(I*Zr-ht*mr+Je*or)*ei,o[3]=(le*mr-K*Zr-ve*or)*ei,o[4]=(L*vn-A*bi-V*Nn)*ei,o[5]=(c*bi-x*vn+E*Nn)*ei,o[6]=(ht*nr-ze*Zr-Je*Bt)*ei,o[7]=(Y*Zr-le*nr+ve*Bt)*ei,o[8]=(A*mn-R*vn+V*qr)*ei,o[9]=(m*vn-c*mn-E*qr)*ei,o[10]=(ze*mr-I*nr+Je*wt)*ei,o[11]=(K*nr-Y*mr-ve*wt)*ei,o[12]=(R*Nn-A*Zn-L*qr)*ei,o[13]=(c*Zn-m*Nn+x*qr)*ei,o[14]=(I*Bt-ze*or-ht*wt)*ei,o[15]=(Y*or-K*Bt+le*wt)*ei,o):null},y.isChar=sn,y.isMapboxURL=Zi,y.keysDifference=function(o,u){var c=[];for(var m in o)m in u||c.push(m);return c},y.makeRequest=Tt,y.mapObject=fr,y.mercatorXfromLng=Di,y.mercatorYfromLat=Pi,y.mercatorZfromAltitude=Bh,y.mul=Ic,y.multiply=oo,y.mvt=sc,y.nextPowerOfTwo=function(o){return o<=1?1:Math.pow(2,Math.ceil(Math.log(o)/Math.LN2))},y.normalize=function(o,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)),o[0]=u[0]*E,o[1]=u[1]*E,o[2]=u[2]*E,o},y.number=qa,y.offscreenCanvasSupported=k,y.ortho=function(o,u,c,m,x,E,A){var R=1/(u-c),L=1/(m-x),V=1/(E-A);return o[0]=-2*R,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*L,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*V,o[11]=0,o[12]=(u+c)*R,o[13]=(x+m)*L,o[14]=(A+E)*V,o[15]=1,o},y.parseGlyphPBF=function(o){return new Jt(o).readFields(Ar,[])},y.pbf=Jt,y.performSymbolLayout=function(o,u,c,m,x,E,A){o.createArrays(),o.tilePixelRatio=8192/(512*o.overscaling),o.compareText={},o.iconsNeedLinear=!1;var R=o.layers[0].layout,L=o.layers[0]._unevaluatedLayout._values,V={};if(o.textSizeData.kind==="composite"){var Y=o.textSizeData,K=Y.maxZoom;V.compositeTextSizes=[L["text-size"].possiblyEvaluate(new Me(Y.minZoom),A),L["text-size"].possiblyEvaluate(new Me(K),A)]}if(o.iconSizeData.kind==="composite"){var le=o.iconSizeData,ve=le.maxZoom;V.compositeIconSizes=[L["icon-size"].possiblyEvaluate(new Me(le.minZoom),A),L["icon-size"].possiblyEvaluate(new Me(ve),A)]}V.layoutTextSize=L["text-size"].possiblyEvaluate(new Me(o.zoom+1),A),V.layoutIconSize=L["icon-size"].possiblyEvaluate(new Me(o.zoom+1),A),V.textMaxSize=L["text-size"].possiblyEvaluate(new Me(18));for(var ze=24*R.get("text-line-height"),I=R.get("text-rotation-alignment")==="map"&&R.get("symbol-placement")!=="point",ht=R.get("text-keep-upright"),Je=R.get("text-size"),wt=function(){var or=nr[Bt],mr=R.get("text-font").evaluate(or,{},A).join(","),Zr=Je.evaluate(or,{},A),qr=V.layoutTextSize.evaluate(or,{},A),Nn=V.layoutIconSize.evaluate(or,{},A),vn={horizontal:{},vertical:void 0},Zn=or.text,mn=[0,0];if(Zn){var bi=Zn.toString(),ei=24*R.get("text-letter-spacing").evaluate(or,{},A),Mn=function(Ni){for(var Ca=0,da=Ni;Ca<da.length;Ca+=1)if(Ki=da[Ca].charCodeAt(0),sn.Arabic(Ki)||sn["Arabic Supplement"](Ki)||sn["Arabic Extended-A"](Ki)||sn["Arabic Presentation Forms-A"](Ki)||sn["Arabic Presentation Forms-B"](Ki))return!1;var Ki;return!0}(bi)?ei:0,Mi=R.get("text-anchor").evaluate(or,{},A),mi=R.get("text-variable-anchor");if(!mi){var Hi=R.get("text-radial-offset").evaluate(or,{},A);mn=Hi?yt(Mi,[24*Hi,ct]):R.get("text-offset").evaluate(or,{},A).map(function(Ni){return 24*Ni})}var Hn=I?"center":R.get("text-justify").evaluate(or,{},A),ea=R.get("symbol-placement"),Ta=ea==="point"?24*R.get("text-max-width").evaluate(or,{},A):0,so=function(){o.allowVerticalPlacement&&ll(bi)&&(vn.vertical=_i(Zn,u,c,x,mr,Ta,ze,Mi,"left",Mn,mn,er.vertical,!0,ea,qr,Zr))};if(!I&&mi){for(var ro=Hn==="auto"?mi.map(function(Ni){return xt(Ni)}):[Hn],Fa=!1,$a=0;$a<ro.length;$a++){var ts=ro[$a];if(!vn.horizontal[ts])if(Fa)vn.horizontal[ts]=vn.horizontal[0];else{var Ho=_i(Zn,u,c,x,mr,Ta,ze,"center",ts,Mn,mn,er.horizontal,!1,ea,qr,Zr);Ho&&(vn.horizontal[ts]=Ho,Fa=Ho.positionedLines.length===1)}}so()}else{Hn==="auto"&&(Hn=xt(Mi));var Gs=_i(Zn,u,c,x,mr,Ta,ze,Mi,Hn,Mn,mn,er.horizontal,!1,ea,qr,Zr);Gs&&(vn.horizontal[Hn]=Gs),so(),ll(bi)&&I&&ht&&(vn.vertical=_i(Zn,u,c,x,mr,Ta,ze,Mi,Hn,Mn,mn,er.vertical,!1,ea,qr,Zr))}}var hs=void 0,ks=!1;if(or.icon&&or.icon.name){var To=m[or.icon.name];To&&(hs=function(Ni,Ca,da){var Ki=Aa(da),ps=Ca[0]-Ni.displaySize[0]*Ki.horizontalAlign,ws=Ca[1]-Ni.displaySize[1]*Ki.verticalAlign;return{image:Ni,top:ws,bottom:ws+Ni.displaySize[1],left:ps,right:ps+Ni.displaySize[0]}}(x[or.icon.name],R.get("icon-offset").evaluate(or,{},A),R.get("icon-anchor").evaluate(or,{},A)),ks=To.sdf,o.sdfIcons===void 0?o.sdfIcons=To.sdf:o.sdfIcons!==To.sdf&&qe("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(To.pixelRatio!==o.pixelRatio||R.get("icon-rotate").constantOr(1)!==0)&&(o.iconsNeedLinear=!0))}var wa=pt(vn.horizontal)||vn.vertical;o.iconsInText=!!wa&&wa.iconsInText,(wa||hs)&&function(Ni,Ca,da,Ki,ps,ws,Da,wo,ds,ta,Uc){var qu=ws.textMaxSize.evaluate(Ca,{});qu===void 0&&(qu=Da);var Bl,uo=Ni.layers[0].layout,Fl=uo.get("icon-offset").evaluate(Ca,{},Uc),Cu=pt(da.horizontal),pf=Da/24,df=Ni.tilePixelRatio*pf,eh=Ni.tilePixelRatio*qu/24,Nl=Ni.tilePixelRatio*wo,zc=Ni.tilePixelRatio*uo.get("symbol-spacing"),nu=uo.get("text-padding")*Ni.tilePixelRatio,th=uo.get("icon-padding")*Ni.tilePixelRatio,Uh=uo.get("text-max-angle")/180*Math.PI,lc=uo.get("text-rotation-alignment")==="map"&&uo.get("symbol-placement")!=="point",Gd=uo.get("icon-rotation-alignment")==="map"&&uo.get("symbol-placement")!=="point",vf=uo.get("symbol-placement"),sd=zc/2,zh=uo.get("icon-text-fit");Ki&&zh!=="none"&&(Ni.allowVerticalPlacement&&da.vertical&&(Bl=Eo(Ki,da.vertical,zh,uo.get("icon-text-fit-padding"),Fl,pf)),Cu&&(Ki=Eo(Ki,Cu,zh,uo.get("icon-text-fit-padding"),Fl,pf)));var mf=function(w0,Kd){Kd.x<0||Kd.x>=8192||Kd.y<0||Kd.y>=8192||function(lo,zl,Vy,xf,Yv,hg,Qd,fc,Jd,Tp,pd,dd,ev,qv,wp,Kv,Qv,Jv,em,tm,Ru,vd,rm,hc,pg){var nm,nh,Wo,jh,Hh,Wh=lo.addToLineVertexArray(zl,Vy),im=0,am=0,om=0,sm=0,tv=-1,rv=-1,jc={},um=Ne(""),nv=0,iv=0;if(fc._unevaluatedLayout.getValue("text-radial-offset")===void 0?(nv=(nm=fc.layout.get("text-offset").evaluate(Ru,{},hc).map(function(yd){return 24*yd}))[0],iv=nm[1]):(nv=24*fc.layout.get("text-radial-offset").evaluate(Ru,{},hc),iv=ct),lo.allowVerticalPlacement&&xf.vertical){var lm=fc.layout.get("text-rotate").evaluate(Ru,{},hc)+90;jh=new ya(Jd,zl,Tp,pd,dd,xf.vertical,ev,qv,wp,lm),Qd&&(Hh=new ya(Jd,zl,Tp,pd,dd,Qd,Qv,Jv,wp,lm))}if(Yv){var av=fc.layout.get("icon-rotate").evaluate(Ru,{}),cm=fc.layout.get("icon-text-fit")!=="none",dg=He(Yv,av,rm,cm),fm=Qd?He(Qd,av,rm,cm):void 0;Wo=new ya(Jd,zl,Tp,pd,dd,Yv,Qv,Jv,!1,av),im=4*dg.length;var vg=lo.iconSizeData,md=null;vg.kind==="source"?(md=[128*fc.layout.get("icon-size").evaluate(Ru,{})])[0]>32640&&qe(lo.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):vg.kind==="composite"&&((md=[128*vd.compositeIconSizes[0].evaluate(Ru,{},hc),128*vd.compositeIconSizes[1].evaluate(Ru,{},hc)])[0]>32640||md[1]>32640)&&qe(lo.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),lo.addSymbols(lo.icon,dg,md,tm,em,Ru,!1,zl,Wh.lineStartIndex,Wh.lineLength,-1,hc),tv=lo.icon.placedSymbolArray.length-1,fm&&(am=4*fm.length,lo.addSymbols(lo.icon,fm,md,tm,em,Ru,er.vertical,zl,Wh.lineStartIndex,Wh.lineLength,-1,hc),rv=lo.icon.placedSymbolArray.length-1)}for(var hm in xf.horizontal){var gd=xf.horizontal[hm];if(!nh){um=Ne(gd.text);var pm=fc.layout.get("text-rotate").evaluate(Ru,{},hc);nh=new ya(Jd,zl,Tp,pd,dd,gd,ev,qv,wp,pm)}var dm=gd.positionedLines.length===1;if(om+=We(lo,zl,gd,hg,fc,wp,Ru,Kv,Wh,xf.vertical?er.horizontal:er.horizontalOnly,dm?Object.keys(xf.horizontal):[hm],jc,tv,vd,hc),dm)break}xf.vertical&&(sm+=We(lo,zl,xf.vertical,hg,fc,wp,Ru,Kv,Wh,er.vertical,["vertical"],jc,rv,vd,hc));var mg=nh?nh.boxStartIndex:lo.collisionBoxArray.length,gg=nh?nh.boxEndIndex:lo.collisionBoxArray.length,C0=jh?jh.boxStartIndex:lo.collisionBoxArray.length,yg=jh?jh.boxEndIndex:lo.collisionBoxArray.length,R0=Wo?Wo.boxStartIndex:lo.collisionBoxArray.length,_g=Wo?Wo.boxEndIndex:lo.collisionBoxArray.length,xg=Hh?Hh.boxStartIndex:lo.collisionBoxArray.length,M0=Hh?Hh.boxEndIndex:lo.collisionBoxArray.length,Hc=-1,ov=function(yd,vm){return yd&&yd.circleDiameter?Math.max(yd.circleDiameter,vm):vm};Hc=ov(nh,Hc),Hc=ov(jh,Hc),Hc=ov(Wo,Hc);var bg=(Hc=ov(Hh,Hc))>-1?1:0;bg&&(Hc*=pg/24),lo.glyphOffsetArray.length>=Sn.MAX_GLYPHS&&qe("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ru.sortKey!==void 0&&lo.addToSortKeyRanges(lo.symbolInstances.length,Ru.sortKey),lo.symbolInstances.emplaceBack(zl.x,zl.y,jc.right>=0?jc.right:-1,jc.center>=0?jc.center:-1,jc.left>=0?jc.left:-1,jc.vertical||-1,tv,rv,um,mg,gg,C0,yg,R0,_g,xg,M0,Tp,om,sm,im,am,bg,0,ev,nv,iv,Hc)}(Ni,Kd,w0,da,Ki,ps,Bl,Ni.layers[0],Ni.collisionBoxArray,Ca.index,Ca.sourceLayerIndex,Ni.index,df,nu,lc,ds,Nl,th,Gd,Fl,Ca,ws,ta,Uc,Da)};if(vf==="line")for(var Zc=0,Xd=gl(Ca.geometry,0,0,8192,8192);Zc<Xd.length;Zc+=1)for(var $d=Xd[Zc],ud=0,Ep=Ao($d,zc,Uh,da.vertical||Cu,Ki,24,eh,Ni.overscaling,8192);ud<Ep.length;ud+=1){var Yd=Ep[ud];Cu&&Ie(Ni,Cu.text,sd,Yd)||mf($d,Yd)}else if(vf==="line-center")for(var ld=0,cd=Ca.geometry;ld<cd.length;ld+=1){var cc=cd[ld];if(cc.length>1){var Sp=Xi(cc,Uh,da.vertical||Cu,Ki,24,eh);Sp&&mf(cc,Sp)}}else if(Ca.type==="Polygon")for(var gf=0,Ap=mp(Ca.geometry,0);gf<Ap.length;gf+=1){var Vc=Ap[gf],Zh=$e(Vc,16);mf(Vc[0],new Ga(Zh.x,Zh.y,0))}else if(Ca.type==="LineString")for(var yf=0,_f=Ca.geometry;yf<_f.length;yf+=1){var rh=_f[yf];mf(rh,new Ga(rh[0].x,rh[0].y,0))}else if(Ca.type==="Point")for(var Vh=0,fd=Ca.geometry;Vh<fd.length;Vh+=1)for(var Ul=0,qd=fd[Vh];Ul<qd.length;Ul+=1){var hd=qd[Ul];mf([hd],new Ga(hd.x,hd.y,0))}}(o,or,vn,hs,m,V,qr,Nn,mn,ks,A)},Bt=0,nr=o.features;Bt<nr.length;Bt+=1)wt();E&&o.generateCollisionDebugBuffers()},y.perspective=function(o,u,c,m,x){var E,A=1/Math.tan(u/2);return o[0]=A/c,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=A,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[11]=-1,o[12]=0,o[13]=0,o[15]=0,x!=null&&x!==1/0?(o[10]=(x+m)*(E=1/(m-x)),o[14]=2*x*m*E):(o[10]=-1,o[14]=-2*m),o},y.pick=function(o,u){for(var c={},m=0;m<u.length;m++){var x=u[m];x in o&&(c[x]=o[x])}return c},y.plugin=Ft,y.polygonIntersectsPolygon=fl,y.postMapLoadEvent=jt,y.postTurnstileEvent=ho,y.potpack=ai,y.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],y.register=xn,y.registerForPluginStateChange=function(o){return o({pluginStatus:ys,pluginURL:_u}),Cc.on("pluginStateChange",o),o},y.renderColorRamp=ic,y.rotate=function(o,u,c){var m=u[0],x=u[1],E=u[2],A=u[3],R=Math.sin(c),L=Math.cos(c);return o[0]=m*L+E*R,o[1]=x*L+A*R,o[2]=m*-R+E*L,o[3]=x*-R+A*L,o},y.rotateX=function(o,u,c){var m=Math.sin(c),x=Math.cos(c),E=u[4],A=u[5],R=u[6],L=u[7],V=u[8],Y=u[9],K=u[10],le=u[11];return u!==o&&(o[0]=u[0],o[1]=u[1],o[2]=u[2],o[3]=u[3],o[12]=u[12],o[13]=u[13],o[14]=u[14],o[15]=u[15]),o[4]=E*x+V*m,o[5]=A*x+Y*m,o[6]=R*x+K*m,o[7]=L*x+le*m,o[8]=V*x-E*m,o[9]=Y*x-A*m,o[10]=K*x-R*m,o[11]=le*x-L*m,o},y.rotateZ=function(o,u,c){var m=Math.sin(c),x=Math.cos(c),E=u[0],A=u[1],R=u[2],L=u[3],V=u[4],Y=u[5],K=u[6],le=u[7];return u!==o&&(o[8]=u[8],o[9]=u[9],o[10]=u[10],o[11]=u[11],o[12]=u[12],o[13]=u[13],o[14]=u[14],o[15]=u[15]),o[0]=E*x+V*m,o[1]=A*x+Y*m,o[2]=R*x+K*m,o[3]=L*x+le*m,o[4]=V*x-E*m,o[5]=Y*x-A*m,o[6]=K*x-R*m,o[7]=le*x-L*m,o},y.scale=function(o,u,c){var m=c[0],x=c[1],E=c[2];return o[0]=u[0]*m,o[1]=u[1]*m,o[2]=u[2]*m,o[3]=u[3]*m,o[4]=u[4]*x,o[5]=u[5]*x,o[6]=u[6]*x,o[7]=u[7]*x,o[8]=u[8]*E,o[9]=u[9]*E,o[10]=u[10]*E,o[11]=u[11]*E,o[12]=u[12],o[13]=u[13],o[14]=u[14],o[15]=u[15],o},y.scale$1=function(o,u,c){return o[0]=u[0]*c,o[1]=u[1]*c,o[2]=u[2]*c,o[3]=u[3]*c,o},y.scale$2=function(o,u,c){return o[0]=u[0]*c,o[1]=u[1]*c,o[2]=u[2]*c,o},y.setCacheLimits=function(o,u){pr=o,Vr=u},y.setRTLTextPlugin=function(o,u,c){if(c===void 0&&(c=!1),ys==="deferred"||ys==="loading"||ys==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");_u=Jr.resolveURL(o),ys="deferred",Nf=u,wc(),c||Js()},y.sphericalToCartesian=function(o){var u=o[0],c=o[1],m=o[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)}},y.sqrLen=function(o){var u=o[0],c=o[1];return u*u+c*c},y.styleSpec=j,y.sub=function(o,u,c){return o[0]=u[0]-c[0],o[1]=u[1]-c[1],o[2]=u[2]-c[2],o},y.symbolSize=gi,y.transformMat3=function(o,u,c){var m=u[0],x=u[1],E=u[2];return o[0]=m*c[0]+x*c[3]+E*c[6],o[1]=m*c[1]+x*c[4]+E*c[7],o[2]=m*c[2]+x*c[5]+E*c[8],o},y.transformMat4=Wu,y.translate=function(o,u,c){var m,x,E,A,R,L,V,Y,K,le,ve,ze,I=c[0],ht=c[1],Je=c[2];return u===o?(o[12]=u[0]*I+u[4]*ht+u[8]*Je+u[12],o[13]=u[1]*I+u[5]*ht+u[9]*Je+u[13],o[14]=u[2]*I+u[6]*ht+u[10]*Je+u[14],o[15]=u[3]*I+u[7]*ht+u[11]*Je+u[15]):(x=u[1],E=u[2],A=u[3],R=u[4],L=u[5],V=u[6],Y=u[7],K=u[8],le=u[9],ve=u[10],ze=u[11],o[0]=m=u[0],o[1]=x,o[2]=E,o[3]=A,o[4]=R,o[5]=L,o[6]=V,o[7]=Y,o[8]=K,o[9]=le,o[10]=ve,o[11]=ze,o[12]=m*I+R*ht+K*Je+u[12],o[13]=x*I+L*ht+le*Je+u[13],o[14]=E*I+V*ht+ve*Je+u[14],o[15]=A*I+Y*ht+ze*Je+u[15]),o},y.triggerPluginCompletionEvent=hp,y.uniqueId=Zt,y.validateCustomStyleLayer=function(o){var u=[],c=o.id;return c===void 0&&u.push({message:"layers."+c+': missing required property "id"'}),o.render===void 0&&u.push({message:"layers."+c+': missing required method "render"'}),o.renderingMode&&o.renderingMode!=="2d"&&o.renderingMode!=="3d"&&u.push({message:"layers."+c+': property "renderingMode" must be either "2d" or "3d"'}),u},y.validateLight=fp,y.validateStyle=Qs,y.values=function(o){var u=[];for(var c in o)u.push(o[c]);return u},y.vectorTile=sc,y.version="1.13.3",y.warnOnce=qe,y.webpSupported=Mr,y.window=ce,y.wrap=Xt}),ye(["./shared"],function(y){"use strict";function he(N){var B=typeof N;if(B==="number"||B==="boolean"||B==="string"||N==null)return JSON.stringify(N);if(Array.isArray(N)){for(var $="[",ee=0,xe=N;ee<xe.length;ee+=1)$+=he(xe[ee])+",";return $+"]"}for(var Ue=Object.keys(N).sort(),Qe="{",j=0;j<Ue.length;j++)Qe+=JSON.stringify(Ue[j])+":"+he(N[Ue[j]])+",";return Qe+"}"}function Z(N){for(var B="",$=0,ee=y.refProperties;$<ee.length;$+=1)B+="/"+he(N[ee[$]]);return B}var pe=function(N){this.keyCache={},N&&this.replace(N)};pe.prototype.replace=function(N){this._layerConfigs={},this._layers={},this.update(N,[])},pe.prototype.update=function(N,B){for(var $=this,ee=0,xe=N;ee<xe.length;ee+=1){var Ue=xe[ee];this._layerConfigs[Ue.id]=Ue;var Qe=this._layers[Ue.id]=y.createStyleLayer(Ue);Qe._featureFilter=y.featureFilter(Qe.filter),this.keyCache[Ue.id]&&delete this.keyCache[Ue.id]}for(var j=0,Q=B;j<Q.length;j+=1){var Fe=Q[j];delete this.keyCache[Fe],delete this._layerConfigs[Fe],delete this._layers[Fe]}this.familiesBySource={};for(var et=0,Ae=function(zr,jr){for(var Jn={},ln=0;ln<zr.length;ln++){var hi=jr&&jr[zr[ln].id]||Z(zr[ln]);jr&&(jr[zr[ln].id]=hi);var Vi=Jn[hi];Vi||(Vi=Jn[hi]=[]),Vi.push(zr[ln])}var ci=[];for(var Li in Jn)ci.push(Jn[Li]);return ci}(y.values(this._layerConfigs),this.keyCache);et<Ae.length;et+=1){var $t=Ae[et].map(function(zr){return $._layers[zr.id]}),yr=$t[0];if(yr.visibility!=="none"){var nn=yr.source||"",Qr=this.familiesBySource[nn];Qr||(Qr=this.familiesBySource[nn]={});var tr=yr.sourceLayer||"_geojsonTileLayer",Xr=Qr[tr];Xr||(Xr=Qr[tr]=[]),Xr.push($t)}}};var fe=function(N){var B={},$=[];for(var ee in N){var xe=N[ee],Ue=B[ee]={};for(var Qe in xe){var j=xe[+Qe];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};$.push(Q),Ue[Qe]={rect:Q,metrics:j.metrics}}}}var Fe=y.potpack($),et=new y.AlphaImage({width:Fe.w||1,height:Fe.h||1});for(var Ae in N){var $t=N[Ae];for(var yr in $t){var nn=$t[+yr];if(nn&&nn.bitmap.width!==0&&nn.bitmap.height!==0){var Qr=B[Ae][yr].rect;y.AlphaImage.copy(nn.bitmap,et,{x:0,y:0},{x:Qr.x+1,y:Qr.y+1},nn.bitmap)}}}this.image=et,this.positions=B};y.register("GlyphAtlas",fe);var it=function(N){this.tileID=new y.OverscaledTileID(N.tileID.overscaledZ,N.tileID.wrap,N.tileID.canonical.z,N.tileID.canonical.x,N.tileID.canonical.y),this.uid=N.uid,this.zoom=N.zoom,this.pixelRatio=N.pixelRatio,this.tileSize=N.tileSize,this.source=N.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=N.showCollisionBoxes,this.collectResourceTiming=!!N.collectResourceTiming,this.returnDependencies=!!N.returnDependencies,this.promoteId=N.promoteId};function ce(N,B,$){for(var ee=new y.EvaluationParameters(B),xe=0,Ue=N;xe<Ue.length;xe+=1)Ue[xe].recalculate(ee,$)}function rt(N,B){var $=y.getArrayBuffer(N.request,function(ee,xe,Ue,Qe){ee?B(ee):xe&&B(null,{vectorTile:new y.vectorTile.VectorTile(new y.pbf(xe)),rawData:xe,cacheControl:Ue,expires:Qe})});return function(){$.cancel(),B()}}it.prototype.parse=function(N,B,$,ee,xe){var Ue=this;this.status="parsing",this.data=N,this.collisionBoxArray=new y.CollisionBoxArray;var Qe=new y.DictionaryCoder(Object.keys(N.layers).sort()),j=new y.FeatureIndex(this.tileID,this.promoteId);j.bucketLayerIDs=[];var Q,Fe,et,Ae,$t={},yr={featureIndex:j,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:$},nn=B.familiesBySource[this.source];for(var Qr in nn){var tr=N.layers[Qr];if(tr){tr.version===1&&y.warnOnce('Vector tile source "'+this.source+'" layer "'+Qr+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var Xr=Qe.encode(Qr),zr=[],jr=0;jr<tr.length;jr++){var Jn=tr.feature(jr),ln=j.getId(Jn,Qr);zr.push({feature:Jn,id:ln,index:jr,sourceLayerIndex:Xr})}for(var hi=0,Vi=nn[Qr];hi<Vi.length;hi+=1){var ci=Vi[hi],Li=ci[0];Li.minzoom&&this.zoom<Math.floor(Li.minzoom)||Li.maxzoom&&this.zoom>=Li.maxzoom||Li.visibility!=="none"&&(ce(ci,this.zoom,$),($t[Li.id]=Li.createBucket({index:j.bucketLayerIDs.length,layers:ci,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Xr,sourceID:this.source})).populate(zr,yr,this.tileID.canonical),j.bucketLayerIDs.push(ci.map(function(Si){return Si.id})))}}}var Ei=y.mapObject(yr.glyphDependencies,function(Si){return Object.keys(Si).map(Number)});Object.keys(Ei).length?ee.send("getGlyphs",{uid:this.uid,stacks:Ei},function(Si,di){Q||(Q=Si,Fe=di,Pa.call(Ue))}):Fe={};var ns=Object.keys(yr.iconDependencies);ns.length?ee.send("getImages",{icons:ns,source:this.source,tileID:this.tileID,type:"icons"},function(Si,di){Q||(Q=Si,et=di,Pa.call(Ue))}):et={};var Qi=Object.keys(yr.patternDependencies);function Pa(){if(Q)return xe(Q);if(Fe&&et&&Ae){var Si=new fe(Fe),di=new y.ImageAtlas(et,Ae);for(var Ai in $t){var Oa=$t[Ai];Oa instanceof y.SymbolBucket?(ce(Oa.layers,this.zoom,$),y.performSymbolLayout(Oa,Fe,Si.positions,et,di.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Oa.hasPattern&&(Oa instanceof y.LineBucket||Oa instanceof y.FillBucket||Oa instanceof y.FillExtrusionBucket)&&(ce(Oa.layers,this.zoom,$),Oa.addFeatures(yr,this.tileID.canonical,di.patternPositions))}this.status="done",xe(null,{buckets:y.values($t).filter(function(vu){return!vu.isEmpty()}),featureIndex:j,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Si.image,imageAtlas:di,glyphMap:this.returnDependencies?Fe:null,iconMap:this.returnDependencies?et:null,glyphPositions:this.returnDependencies?Si.positions:null})}}Qi.length?ee.send("getImages",{icons:Qi,source:this.source,tileID:this.tileID,type:"patterns"},function(Si,di){Q||(Q=Si,Ae=di,Pa.call(Ue))}):Ae={},Pa.call(this)};var vt=function(N,B,$,ee){this.actor=N,this.layerIndex=B,this.availableImages=$,this.loadVectorData=ee||rt,this.loading={},this.loaded={}};vt.prototype.loadTile=function(N,B){var $=this,ee=N.uid;this.loading||(this.loading={});var xe=!!(N&&N.request&&N.request.collectResourceTiming)&&new y.RequestPerformance(N.request),Ue=this.loading[ee]=new it(N);Ue.abort=this.loadVectorData(N,function(Qe,j){if(delete $.loading[ee],Qe||!j)return Ue.status="done",$.loaded[ee]=Ue,B(Qe);var Q=j.rawData,Fe={};j.expires&&(Fe.expires=j.expires),j.cacheControl&&(Fe.cacheControl=j.cacheControl);var et={};if(xe){var Ae=xe.finish();Ae&&(et.resourceTiming=JSON.parse(JSON.stringify(Ae)))}Ue.vectorTile=j.vectorTile,Ue.parse(j.vectorTile,$.layerIndex,$.availableImages,$.actor,function($t,yr){if($t||!yr)return B($t);B(null,y.extend({rawTileData:Q.slice(0)},yr,Fe,et))}),$.loaded=$.loaded||{},$.loaded[ee]=Ue})},vt.prototype.reloadTile=function(N,B){var $=this,ee=this.loaded,xe=N.uid,Ue=this;if(ee&&ee[xe]){var Qe=ee[xe];Qe.showCollisionBoxes=N.showCollisionBoxes;var j=function(Q,Fe){var et=Qe.reloadCallback;et&&(delete Qe.reloadCallback,Qe.parse(Qe.vectorTile,Ue.layerIndex,$.availableImages,Ue.actor,et)),B(Q,Fe)};Qe.status==="parsing"?Qe.reloadCallback=j:Qe.status==="done"&&(Qe.vectorTile?Qe.parse(Qe.vectorTile,this.layerIndex,this.availableImages,this.actor,j):j())}},vt.prototype.abortTile=function(N,B){var $=this.loading,ee=N.uid;$&&$[ee]&&$[ee].abort&&($[ee].abort(),delete $[ee]),B()},vt.prototype.removeTile=function(N,B){var $=this.loaded,ee=N.uid;$&&$[ee]&&delete $[ee],B()};var tt=y.window.ImageBitmap,Ot=function(){this.loaded={}};function Xt(N,B){if(N.length!==0){Yt(N[0],B);for(var $=1;$<N.length;$++)Yt(N[$],!B)}}function Yt(N,B){for(var $=0,ee=0,xe=0,Ue=N.length,Qe=Ue-1;xe<Ue;Qe=xe++){var j=(N[xe][0]-N[Qe][0])*(N[Qe][1]+N[xe][1]),Q=$+j;ee+=Math.abs($)>=Math.abs(j)?$-Q+j:j-Q+$,$=Q}$+ee>=0!=!!B&&N.reverse()}Ot.prototype.loadTile=function(N,B){var $=N.uid,ee=N.encoding,xe=N.rawImageData,Ue=tt&&xe instanceof tt?this.getImageData(xe):xe,Qe=new y.DEMData($,Ue,ee);this.loaded=this.loaded||{},this.loaded[$]=Qe,B(null,Qe)},Ot.prototype.getImageData=function(N){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(N.width,N.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=N.width,this.offscreenCanvas.height=N.height,this.offscreenCanvasContext.drawImage(N,0,0,N.width,N.height);var B=this.offscreenCanvasContext.getImageData(-1,-1,N.width+2,N.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new y.RGBAImage({width:B.width,height:B.height},B.data)},Ot.prototype.removeTile=function(N){var B=this.loaded,$=N.uid;B&&B[$]&&delete B[$]};var ar=y.vectorTile.VectorTileFeature.prototype.toGeoJSON,Zt=function(N){this._feature=N,this.extent=y.EXTENT,this.type=N.type,this.properties=N.tags,"id"in N&&!isNaN(N.id)&&(this.id=parseInt(N.id,10))};Zt.prototype.loadGeometry=function(){if(this._feature.type===1){for(var N=[],B=0,$=this._feature.geometry;B<$.length;B+=1){var ee=$[B];N.push([new y.Point$1(ee[0],ee[1])])}return N}for(var xe=[],Ue=0,Qe=this._feature.geometry;Ue<Qe.length;Ue+=1){for(var j=[],Q=0,Fe=Qe[Ue];Q<Fe.length;Q+=1){var et=Fe[Q];j.push(new y.Point$1(et[0],et[1]))}xe.push(j)}return xe},Zt.prototype.toGeoJSON=function(N,B,$){return ar.call(this,N,B,$)};var bt=function(N){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=y.EXTENT,this.length=N.length,this._features=N};bt.prototype.feature=function(N){return new Zt(this._features[N])};var St=y.vectorTile.VectorTileFeature,Rr=gr;function gr(N,B){this.options=B||{},this.features=N,this.length=N.length}function fr(N,B){this.id=typeof N.id=="number"?N.id:void 0,this.type=N.type,this.rawGeometry=N.type===1?[N.geometry]:N.geometry,this.properties=N.tags,this.extent=B||4096}gr.prototype.feature=function(N){return new fr(this.features[N],this.options.extent)},fr.prototype.loadGeometry=function(){var N=this.rawGeometry;this.geometry=[];for(var B=0;B<N.length;B++){for(var $=N[B],ee=[],xe=0;xe<$.length;xe++)ee.push(new y.Point$1($[xe][0],$[xe][1]));this.geometry.push(ee)}return this.geometry},fr.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var N=this.geometry,B=1/0,$=-1/0,ee=1/0,xe=-1/0,Ue=0;Ue<N.length;Ue++)for(var Qe=N[Ue],j=0;j<Qe.length;j++){var Q=Qe[j];B=Math.min(B,Q.x),$=Math.max($,Q.x),ee=Math.min(ee,Q.y),xe=Math.max(xe,Q.y)}return[B,ee,$,xe]},fr.prototype.toGeoJSON=St.prototype.toGeoJSON;var Mt=kt,ft=Rr;function kt(N){var B=new y.pbf;return function($,ee){for(var xe in $.layers)ee.writeMessage(3,qe,$.layers[xe])}(N,B),B.finish()}function qe(N,B){var $;B.writeVarintField(15,N.version||1),B.writeStringField(1,N.name||""),B.writeVarintField(5,N.extent||4096);var ee={keys:[],values:[],keycache:{},valuecache:{}};for($=0;$<N.length;$++)ee.feature=N.feature($),B.writeMessage(2,Dt,ee);var xe=ee.keys;for($=0;$<xe.length;$++)B.writeStringField(3,xe[$]);var Ue=ee.values;for($=0;$<Ue.length;$++)B.writeMessage(4,Be,Ue[$])}function Dt(N,B){var $=N.feature;$.id!==void 0&&B.writeVarintField(1,$.id),B.writeMessage(2,dr,N),B.writeVarintField(3,$.type),B.writeMessage(4,re,$)}function dr(N,B){var $=N.feature,ee=N.keys,xe=N.values,Ue=N.keycache,Qe=N.valuecache;for(var j in $.properties){var Q=Ue[j];Q===void 0&&(ee.push(j),Ue[j]=Q=ee.length-1),B.writeVarint(Q);var Fe=$.properties[j],et=typeof Fe;et!=="string"&&et!=="boolean"&&et!=="number"&&(Fe=JSON.stringify(Fe));var Ae=et+":"+Fe,$t=Qe[Ae];$t===void 0&&(xe.push(Fe),Qe[Ae]=$t=xe.length-1),B.writeVarint($t)}}function oe(N,B){return(B<<3)+(7&N)}function H(N){return N<<1^N>>31}function re(N,B){for(var $=N.loadGeometry(),ee=N.type,xe=0,Ue=0,Qe=$.length,j=0;j<Qe;j++){var Q=$[j],Fe=1;ee===1&&(Fe=Q.length),B.writeVarint(oe(1,Fe));for(var et=ee===3?Q.length-1:Q.length,Ae=0;Ae<et;Ae++){Ae===1&&ee!==1&&B.writeVarint(oe(2,et-1));var $t=Q[Ae].x-xe,yr=Q[Ae].y-Ue;B.writeVarint(H($t)),B.writeVarint(H(yr)),xe+=$t,Ue+=yr}ee===3&&B.writeVarint(oe(7,1))}}function Be(N,B){var $=typeof N;$==="string"?B.writeStringField(1,N):$==="boolean"?B.writeBooleanField(7,N):$==="number"&&(N%1!=0?B.writeDoubleField(3,N):N<0?B.writeSVarintField(6,N):B.writeVarintField(5,N))}function we(N,B,$,ee){ut(N,$,ee),ut(B,2*$,2*ee),ut(B,2*$+1,2*ee+1)}function ut(N,B,$){var ee=N[B];N[B]=N[$],N[$]=ee}function ie(N,B,$,ee){var xe=N-$,Ue=B-ee;return xe*xe+Ue*Ue}Mt.fromVectorTileJs=kt,Mt.fromGeojsonVt=function(N,B){B=B||{};var $={};for(var ee in N)$[ee]=new Rr(N[ee].features,B),$[ee].name=ee,$[ee].version=B.version,$[ee].extent=B.extent;return kt({layers:$})},Mt.GeoJSONWrapper=ft;var Le=function(N){return N[0]},Pe=function(N){return N[1]},Ge=function(N,B,$,ee,xe){B===void 0&&(B=Le),$===void 0&&($=Pe),ee===void 0&&(ee=64),xe===void 0&&(xe=Float64Array),this.nodeSize=ee,this.points=N;for(var Ue=N.length<65536?Uint16Array:Uint32Array,Qe=this.ids=new Ue(N.length),j=this.coords=new xe(2*N.length),Q=0;Q<N.length;Q++)Qe[Q]=Q,j[2*Q]=B(N[Q]),j[2*Q+1]=$(N[Q]);(function Fe(et,Ae,$t,yr,nn,Qr){if(!(nn-yr<=$t)){var tr=yr+nn>>1;(function Xr(zr,jr,Jn,ln,hi,Vi){for(;hi>ln;){if(hi-ln>600){var ci=hi-ln+1,Li=Jn-ln+1,Ei=Math.log(ci),ns=.5*Math.exp(2*Ei/3),Qi=.5*Math.sqrt(Ei*ns*(ci-ns)/ci)*(Li-ci/2<0?-1:1);Xr(zr,jr,Jn,Math.max(ln,Math.floor(Jn-Li*ns/ci+Qi)),Math.min(hi,Math.floor(Jn+(ci-Li)*ns/ci+Qi)),Vi)}var Pa=jr[2*Jn+Vi],Si=ln,di=hi;for(we(zr,jr,ln,Jn),jr[2*hi+Vi]>Pa&&we(zr,jr,ln,hi);Si<di;){for(we(zr,jr,Si,di),Si++,di--;jr[2*Si+Vi]<Pa;)Si++;for(;jr[2*di+Vi]>Pa;)di--}jr[2*ln+Vi]===Pa?we(zr,jr,ln,di):we(zr,jr,++di,hi),di<=Jn&&(ln=di+1),Jn<=di&&(hi=di-1)}})(et,Ae,tr,yr,nn,Qr%2),Fe(et,Ae,$t,yr,tr-1,Qr+1),Fe(et,Ae,$t,tr+1,nn,Qr+1)}})(Qe,j,ee,0,Qe.length-1,0)};Ge.prototype.range=function(N,B,$,ee){return function(xe,Ue,Qe,j,Q,Fe,et){for(var Ae,$t,yr=[0,xe.length-1,0],nn=[];yr.length;){var Qr=yr.pop(),tr=yr.pop(),Xr=yr.pop();if(tr-Xr<=et)for(var zr=Xr;zr<=tr;zr++)$t=Ue[2*zr+1],(Ae=Ue[2*zr])>=Qe&&Ae<=Q&&$t>=j&&$t<=Fe&&nn.push(xe[zr]);else{var jr=Math.floor((Xr+tr)/2);$t=Ue[2*jr+1],(Ae=Ue[2*jr])>=Qe&&Ae<=Q&&$t>=j&&$t<=Fe&&nn.push(xe[jr]);var Jn=(Qr+1)%2;(Qr===0?Qe<=Ae:j<=$t)&&(yr.push(Xr),yr.push(jr-1),yr.push(Jn)),(Qr===0?Q>=Ae:Fe>=$t)&&(yr.push(jr+1),yr.push(tr),yr.push(Jn))}}return nn}(this.ids,this.coords,N,B,$,ee,this.nodeSize)},Ge.prototype.within=function(N,B,$){return function(ee,xe,Ue,Qe,j,Q){for(var Fe=[0,ee.length-1,0],et=[],Ae=j*j;Fe.length;){var $t=Fe.pop(),yr=Fe.pop(),nn=Fe.pop();if(yr-nn<=Q)for(var Qr=nn;Qr<=yr;Qr++)ie(xe[2*Qr],xe[2*Qr+1],Ue,Qe)<=Ae&&et.push(ee[Qr]);else{var tr=Math.floor((nn+yr)/2),Xr=xe[2*tr],zr=xe[2*tr+1];ie(Xr,zr,Ue,Qe)<=Ae&&et.push(ee[tr]);var jr=($t+1)%2;($t===0?Ue-j<=Xr:Qe-j<=zr)&&(Fe.push(nn),Fe.push(tr-1),Fe.push(jr)),($t===0?Ue+j>=Xr:Qe+j>=zr)&&(Fe.push(tr+1),Fe.push(yr),Fe.push(jr))}}return et}(this.ids,this.coords,N,B,$,this.nodeSize)};var Vt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(N){return N}},Et=function(N){this.options=yi(Object.create(Vt),N),this.trees=new Array(this.options.maxZoom+1)};function Jr(N,B,$,ee,xe){return{x:N,y:B,zoom:1/0,id:$,parentId:-1,numPoints:ee,properties:xe}}function on(N,B){var $=N.geometry.coordinates,ee=$[1];return{x:bn($[0]),y:rn(ee),zoom:1/0,index:B,parentId:-1}}function Mr(N){return{type:"Feature",id:N.id,properties:Dn(N),geometry:{type:"Point",coordinates:[(ee=N.x,360*(ee-.5)),(B=N.y,$=(180-360*B)*Math.PI/180,360*Math.atan(Math.exp($))/Math.PI-90)]}};var B,$,ee}function Dn(N){var B=N.numPoints,$=B>=1e4?Math.round(B/1e3)+"k":B>=1e3?Math.round(B/100)/10+"k":B;return yi(yi({},N.properties),{cluster:!0,cluster_id:N.id,point_count:B,point_count_abbreviated:$})}function bn(N){return N/360+.5}function rn(N){var B=Math.sin(N*Math.PI/180),$=.5-.25*Math.log((1+B)/(1-B))/Math.PI;return $<0?0:$>1?1:$}function yi(N,B){for(var $ in B)N[$]=B[$];return N}function ti(N){return N.x}function Zi(N){return N.y}function En(N,B,$,ee,xe,Ue){var Qe=xe-$,j=Ue-ee;if(Qe!==0||j!==0){var Q=((N-$)*Qe+(B-ee)*j)/(Qe*Qe+j*j);Q>1?($=xe,ee=Ue):Q>0&&($+=Qe*Q,ee+=j*Q)}return(Qe=N-$)*Qe+(j=B-ee)*j}function Rn(N,B,$,ee){var xe={id:N===void 0?null:N,type:B,geometry:$,tags:ee,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Ue){var Qe=Ue.geometry,j=Ue.type;if(j==="Point"||j==="MultiPoint"||j==="LineString")sa(Ue,Qe);else if(j==="Polygon"||j==="MultiLineString")for(var Q=0;Q<Qe.length;Q++)sa(Ue,Qe[Q]);else if(j==="MultiPolygon")for(Q=0;Q<Qe.length;Q++)for(var Fe=0;Fe<Qe[Q].length;Fe++)sa(Ue,Qe[Q][Fe])}(xe),xe}function sa(N,B){for(var $=0;$<B.length;$+=3)N.minX=Math.min(N.minX,B[$]),N.minY=Math.min(N.minY,B[$+1]),N.maxX=Math.max(N.maxX,B[$]),N.maxY=Math.max(N.maxY,B[$+1])}function ki(N,B,$,ee){if(B.geometry){var xe=B.geometry.coordinates,Ue=B.geometry.type,Qe=Math.pow($.tolerance/((1<<$.maxZoom)*$.extent),2),j=[],Q=B.id;if($.promoteId?Q=B.properties[$.promoteId]:$.generateId&&(Q=ee||0),Ue==="Point")ba(xe,j);else if(Ue==="MultiPoint")for(var Fe=0;Fe<xe.length;Fe++)ba(xe[Fe],j);else if(Ue==="LineString")fo(xe,j,Qe,!1);else if(Ue==="MultiLineString"){if($.lineMetrics){for(Fe=0;Fe<xe.length;Fe++)fo(xe[Fe],j=[],Qe,!1),N.push(Rn(Q,"LineString",j,B.properties));return}Re(xe,j,Qe,!1)}else if(Ue==="Polygon")Re(xe,j,Qe,!0);else{if(Ue!=="MultiPolygon"){if(Ue==="GeometryCollection"){for(Fe=0;Fe<B.geometry.geometries.length;Fe++)ki(N,{id:Q,geometry:B.geometry.geometries[Fe],properties:B.properties},$,ee);return}throw new Error("Input data is not a valid GeoJSON object.")}for(Fe=0;Fe<xe.length;Fe++){var et=[];Re(xe[Fe],et,Qe,!0),j.push(et)}}N.push(Rn(Q,Ue,j,B.properties))}}function ba(N,B){B.push(Ea(N[0])),B.push(va(N[1])),B.push(0)}function fo(N,B,$,ee){for(var xe,Ue,Qe=0,j=0;j<N.length;j++){var Q=Ea(N[j][0]),Fe=va(N[j][1]);B.push(Q),B.push(Fe),B.push(0),j>0&&(Qe+=ee?(xe*Fe-Q*Ue)/2:Math.sqrt(Math.pow(Q-xe,2)+Math.pow(Fe-Ue,2))),xe=Q,Ue=Fe}var et=B.length-3;B[2]=1,function Ae($t,yr,nn,Qr){for(var tr,Xr=Qr,zr=nn-yr>>1,jr=nn-yr,Jn=$t[yr],ln=$t[yr+1],hi=$t[nn],Vi=$t[nn+1],ci=yr+3;ci<nn;ci+=3){var Li=En($t[ci],$t[ci+1],Jn,ln,hi,Vi);if(Li>Xr)tr=ci,Xr=Li;else if(Li===Xr){var Ei=Math.abs(ci-zr);Ei<jr&&(tr=ci,jr=Ei)}}Xr>Qr&&(tr-yr>3&&Ae($t,yr,tr,Qr),$t[tr+2]=Xr,nn-tr>3&&Ae($t,tr,nn,Qr))}(B,0,et,$),B[et+2]=1,B.size=Math.abs(Qe),B.start=0,B.end=B.size}function Re(N,B,$,ee){for(var xe=0;xe<N.length;xe++){var Ue=[];fo(N[xe],Ue,$,ee),B.push(Ue)}}function Ea(N){return N/360+.5}function va(N){var B=Math.sin(N*Math.PI/180),$=.5-.25*Math.log((1+B)/(1-B))/Math.PI;return $<0?0:$>1?1:$}function Za(N,B,$,ee,xe,Ue,Qe,j){if(ee/=B,Ue>=($/=B)&&Qe<ee)return N;if(Qe<$||Ue>=ee)return null;for(var Q=[],Fe=0;Fe<N.length;Fe++){var et=N[Fe],Ae=et.geometry,$t=et.type,yr=xe===0?et.minX:et.minY,nn=xe===0?et.maxX:et.maxY;if(yr>=$&&nn<ee)Q.push(et);else if(!(nn<$||yr>=ee)){var Qr=[];if($t==="Point"||$t==="MultiPoint")Ms(Ae,Qr,$,ee,xe);else if($t==="LineString")ho(Ae,Qr,$,ee,xe,!1,j.lineMetrics);else if($t==="MultiLineString")jt(Ae,Qr,$,ee,xe,!1);else if($t==="Polygon")jt(Ae,Qr,$,ee,xe,!0);else if($t==="MultiPolygon")for(var tr=0;tr<Ae.length;tr++){var Xr=[];jt(Ae[tr],Xr,$,ee,xe,!0),Xr.length&&Qr.push(Xr)}if(Qr.length){if(j.lineMetrics&&$t==="LineString"){for(tr=0;tr<Qr.length;tr++)Q.push(Rn(et.id,$t,Qr[tr],et.tags));continue}$t!=="LineString"&&$t!=="MultiLineString"||(Qr.length===1?($t="LineString",Qr=Qr[0]):$t="MultiLineString"),$t!=="Point"&&$t!=="MultiPoint"||($t=Qr.length===3?"Point":"MultiPoint"),Q.push(Rn(et.id,$t,Qr,et.tags))}}}return Q.length?Q:null}function Ms(N,B,$,ee,xe){for(var Ue=0;Ue<N.length;Ue+=3){var Qe=N[Ue+xe];Qe>=$&&Qe<=ee&&(B.push(N[Ue]),B.push(N[Ue+1]),B.push(N[Ue+2]))}}function ho(N,B,$,ee,xe,Ue,Qe){for(var j,Q,Fe=Zo(N),et=xe===0?Vr:en,Ae=N.start,$t=0;$t<N.length-3;$t+=3){var yr=N[$t],nn=N[$t+1],Qr=N[$t+2],tr=N[$t+3],Xr=N[$t+4],zr=xe===0?yr:nn,jr=xe===0?tr:Xr,Jn=!1;Qe&&(j=Math.sqrt(Math.pow(yr-tr,2)+Math.pow(nn-Xr,2))),zr<$?jr>$&&(Q=et(Fe,yr,nn,tr,Xr,$),Qe&&(Fe.start=Ae+j*Q)):zr>ee?jr<ee&&(Q=et(Fe,yr,nn,tr,Xr,ee),Qe&&(Fe.start=Ae+j*Q)):pr(Fe,yr,nn,Qr),jr<$&&zr>=$&&(Q=et(Fe,yr,nn,tr,Xr,$),Jn=!0),jr>ee&&zr<=ee&&(Q=et(Fe,yr,nn,tr,Xr,ee),Jn=!0),!Ue&&Jn&&(Qe&&(Fe.end=Ae+j*Q),B.push(Fe),Fe=Zo(N)),Qe&&(Ae+=j)}var ln=N.length-3;yr=N[ln],nn=N[ln+1],Qr=N[ln+2],(zr=xe===0?yr:nn)>=$&&zr<=ee&&pr(Fe,yr,nn,Qr),ln=Fe.length-3,Ue&&ln>=3&&(Fe[ln]!==Fe[0]||Fe[ln+1]!==Fe[1])&&pr(Fe,Fe[0],Fe[1],Fe[2]),Fe.length&&B.push(Fe)}function Zo(N){var B=[];return B.size=N.size,B.start=N.start,B.end=N.end,B}function jt(N,B,$,ee,xe,Ue){for(var Qe=0;Qe<N.length;Qe++)ho(N[Qe],B,$,ee,xe,Ue,!1)}function pr(N,B,$,ee){N.push(B),N.push($),N.push(ee)}function Vr(N,B,$,ee,xe,Ue){var Qe=(Ue-B)/(ee-B);return N.push(Ue),N.push($+(xe-$)*Qe),N.push(1),Qe}function en(N,B,$,ee,xe,Ue){var Qe=(Ue-$)/(xe-$);return N.push(B+(ee-B)*Qe),N.push(Ue),N.push(1),Qe}function Ln(N,B){for(var $=[],ee=0;ee<N.length;ee++){var xe,Ue=N[ee],Qe=Ue.type;if(Qe==="Point"||Qe==="MultiPoint"||Qe==="LineString")xe=Gi(Ue.geometry,B);else if(Qe==="MultiLineString"||Qe==="Polygon"){xe=[];for(var j=0;j<Ue.geometry.length;j++)xe.push(Gi(Ue.geometry[j],B))}else if(Qe==="MultiPolygon")for(xe=[],j=0;j<Ue.geometry.length;j++){for(var Q=[],Fe=0;Fe<Ue.geometry[j].length;Fe++)Q.push(Gi(Ue.geometry[j][Fe],B));xe.push(Q)}$.push(Rn(Ue.id,Qe,xe,Ue.tags))}return $}function Gi(N,B){var $=[];$.size=N.size,N.start!==void 0&&($.start=N.start,$.end=N.end);for(var ee=0;ee<N.length;ee+=3)$.push(N[ee]+B,N[ee+1],N[ee+2]);return $}function ue(N,B){if(N.transformed)return N;var $,ee,xe,Ue=1<<N.z,Qe=N.x,j=N.y;for($=0;$<N.features.length;$++){var Q=N.features[$],Fe=Q.geometry,et=Q.type;if(Q.geometry=[],et===1)for(ee=0;ee<Fe.length;ee+=2)Q.geometry.push(k(Fe[ee],Fe[ee+1],B,Ue,Qe,j));else for(ee=0;ee<Fe.length;ee++){var Ae=[];for(xe=0;xe<Fe[ee].length;xe+=2)Ae.push(k(Fe[ee][xe],Fe[ee][xe+1],B,Ue,Qe,j));Q.geometry.push(Ae)}}return N.transformed=!0,N}function k(N,B,$,ee,xe,Ue){return[Math.round($*(N*ee-xe)),Math.round($*(B*ee-Ue))]}function z(N,B,$,ee,xe){for(var Ue=B===xe.maxZoom?0:xe.tolerance/((1<<B)*xe.extent),Qe={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:$,y:ee,z:B,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},j=0;j<N.length;j++){Qe.numFeatures++,ae(Qe,N[j],Ue,xe);var Q=N[j].minX,Fe=N[j].minY,et=N[j].maxX,Ae=N[j].maxY;Q<Qe.minX&&(Qe.minX=Q),Fe<Qe.minY&&(Qe.minY=Fe),et>Qe.maxX&&(Qe.maxX=et),Ae>Qe.maxY&&(Qe.maxY=Ae)}return Qe}function ae(N,B,$,ee){var xe=B.geometry,Ue=B.type,Qe=[];if(Ue==="Point"||Ue==="MultiPoint")for(var j=0;j<xe.length;j+=3)Qe.push(xe[j]),Qe.push(xe[j+1]),N.numPoints++,N.numSimplified++;else if(Ue==="LineString")Ee(Qe,xe,N,$,!1,!1);else if(Ue==="MultiLineString"||Ue==="Polygon")for(j=0;j<xe.length;j++)Ee(Qe,xe[j],N,$,Ue==="Polygon",j===0);else if(Ue==="MultiPolygon")for(var Q=0;Q<xe.length;Q++){var Fe=xe[Q];for(j=0;j<Fe.length;j++)Ee(Qe,Fe[j],N,$,!0,j===0)}if(Qe.length){var et=B.tags||null;if(Ue==="LineString"&&ee.lineMetrics){for(var Ae in et={},B.tags)et[Ae]=B.tags[Ae];et.mapbox_clip_start=xe.start/xe.size,et.mapbox_clip_end=xe.end/xe.size}var $t={geometry:Qe,type:Ue==="Polygon"||Ue==="MultiPolygon"?3:Ue==="LineString"||Ue==="MultiLineString"?2:1,tags:et};B.id!==null&&($t.id=B.id),N.features.push($t)}}function Ee(N,B,$,ee,xe,Ue){var Qe=ee*ee;if(ee>0&&B.size<(xe?Qe:ee))$.numPoints+=B.length/3;else{for(var j=[],Q=0;Q<B.length;Q+=3)(ee===0||B[Q+2]>Qe)&&($.numSimplified++,j.push(B[Q]),j.push(B[Q+1])),$.numPoints++;xe&&function(Fe,et){for(var Ae=0,$t=0,yr=Fe.length,nn=yr-2;$t<yr;nn=$t,$t+=2)Ae+=(Fe[$t]-Fe[nn])*(Fe[$t+1]+Fe[nn+1]);if(Ae>0===et)for($t=0,yr=Fe.length;$t<yr/2;$t+=2){var Qr=Fe[$t],tr=Fe[$t+1];Fe[$t]=Fe[yr-2-$t],Fe[$t+1]=Fe[yr-1-$t],Fe[yr-2-$t]=Qr,Fe[yr-1-$t]=tr}}(j,Ue),N.push(j)}}function De(N,B){var $=(B=this.options=function(xe,Ue){for(var Qe in Ue)xe[Qe]=Ue[Qe];return xe}(Object.create(this.options),B)).debug;if($&&console.time("preprocess data"),B.maxZoom<0||B.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(B.promoteId&&B.generateId)throw new Error("promoteId and generateId cannot be used together.");var ee=function(xe,Ue){var Qe=[];if(xe.type==="FeatureCollection")for(var j=0;j<xe.features.length;j++)ki(Qe,xe.features[j],Ue,j);else ki(Qe,xe.type==="Feature"?xe:{geometry:xe},Ue);return Qe}(N,B);this.tiles={},this.tileCoords=[],$&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",B.indexMaxZoom,B.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(ee=function(xe,Ue){var Qe=Ue.buffer/Ue.extent,j=xe,Q=Za(xe,1,-1-Qe,Qe,0,-1,2,Ue),Fe=Za(xe,1,1-Qe,2+Qe,0,-1,2,Ue);return(Q||Fe)&&(j=Za(xe,1,-Qe,1+Qe,0,-1,2,Ue)||[],Q&&(j=Ln(Q,1).concat(j)),Fe&&(j=j.concat(Ln(Fe,-1)))),j}(ee,B)).length&&this.splitTile(ee,0,0,0),$&&(ee.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 zt(N,B,$){return 32*((1<<N)*$+B)+N}function Tt(N,B){var $=N.tileID.canonical;if(!this._geoJSONIndex)return B(null,null);var ee=this._geoJSONIndex.getTile($.z,$.x,$.y);if(!ee)return B(null,null);var xe=new bt(ee.features),Ue=Mt(xe);Ue.byteOffset===0&&Ue.byteLength===Ue.buffer.byteLength||(Ue=new Uint8Array(Ue)),B(null,{vectorTile:xe,rawData:Ue.buffer})}Et.prototype.load=function(N){var B=this.options,$=B.log,ee=B.minZoom,xe=B.maxZoom,Ue=B.nodeSize;$&&console.time("total time");var Qe="prepare "+N.length+" points";$&&console.time(Qe),this.points=N;for(var j=[],Q=0;Q<N.length;Q++)N[Q].geometry&&j.push(on(N[Q],Q));this.trees[xe+1]=new Ge(j,ti,Zi,Ue,Float32Array),$&&console.timeEnd(Qe);for(var Fe=xe;Fe>=ee;Fe--){var et=+Date.now();j=this._cluster(j,Fe),this.trees[Fe]=new Ge(j,ti,Zi,Ue,Float32Array),$&&console.log("z%d: %d clusters in %dms",Fe,j.length,+Date.now()-et)}return $&&console.timeEnd("total time"),this},Et.prototype.getClusters=function(N,B){var $=((N[0]+180)%360+360)%360-180,ee=Math.max(-90,Math.min(90,N[1])),xe=N[2]===180?180:((N[2]+180)%360+360)%360-180,Ue=Math.max(-90,Math.min(90,N[3]));if(N[2]-N[0]>=360)$=-180,xe=180;else if($>xe){var Qe=this.getClusters([$,ee,180,Ue],B),j=this.getClusters([-180,ee,xe,Ue],B);return Qe.concat(j)}for(var Q=this.trees[this._limitZoom(B)],Fe=[],et=0,Ae=Q.range(bn($),rn(Ue),bn(xe),rn(ee));et<Ae.length;et+=1){var $t=Q.points[Ae[et]];Fe.push($t.numPoints?Mr($t):this.points[$t.index])}return Fe},Et.prototype.getChildren=function(N){var B=this._getOriginId(N),$=this._getOriginZoom(N),ee="No cluster with the specified id.",xe=this.trees[$];if(!xe)throw new Error(ee);var Ue=xe.points[B];if(!Ue)throw new Error(ee);for(var Qe=this.options.radius/(this.options.extent*Math.pow(2,$-1)),j=[],Q=0,Fe=xe.within(Ue.x,Ue.y,Qe);Q<Fe.length;Q+=1){var et=xe.points[Fe[Q]];et.parentId===N&&j.push(et.numPoints?Mr(et):this.points[et.index])}if(j.length===0)throw new Error(ee);return j},Et.prototype.getLeaves=function(N,B,$){var ee=[];return this._appendLeaves(ee,N,B=B||10,$=$||0,0),ee},Et.prototype.getTile=function(N,B,$){var ee=this.trees[this._limitZoom(N)],xe=Math.pow(2,N),Ue=this.options,Qe=Ue.radius/Ue.extent,j=($-Qe)/xe,Q=($+1+Qe)/xe,Fe={features:[]};return this._addTileFeatures(ee.range((B-Qe)/xe,j,(B+1+Qe)/xe,Q),ee.points,B,$,xe,Fe),B===0&&this._addTileFeatures(ee.range(1-Qe/xe,j,1,Q),ee.points,xe,$,xe,Fe),B===xe-1&&this._addTileFeatures(ee.range(0,j,Qe/xe,Q),ee.points,-1,$,xe,Fe),Fe.features.length?Fe:null},Et.prototype.getClusterExpansionZoom=function(N){for(var B=this._getOriginZoom(N)-1;B<=this.options.maxZoom;){var $=this.getChildren(N);if(B++,$.length!==1)break;N=$[0].properties.cluster_id}return B},Et.prototype._appendLeaves=function(N,B,$,ee,xe){for(var Ue=0,Qe=this.getChildren(B);Ue<Qe.length;Ue+=1){var j=Qe[Ue],Q=j.properties;if(Q&&Q.cluster?xe+Q.point_count<=ee?xe+=Q.point_count:xe=this._appendLeaves(N,Q.cluster_id,$,ee,xe):xe<ee?xe++:N.push(j),N.length===$)break}return xe},Et.prototype._addTileFeatures=function(N,B,$,ee,xe,Ue){for(var Qe=0,j=N;Qe<j.length;Qe+=1){var Q=B[j[Qe]],Fe=Q.numPoints,et={type:1,geometry:[[Math.round(this.options.extent*(Q.x*xe-$)),Math.round(this.options.extent*(Q.y*xe-ee))]],tags:Fe?Dn(Q):this.points[Q.index].properties},Ae=void 0;Fe?Ae=Q.id:this.options.generateId?Ae=Q.index:this.points[Q.index].id&&(Ae=this.points[Q.index].id),Ae!==void 0&&(et.id=Ae),Ue.features.push(et)}},Et.prototype._limitZoom=function(N){return Math.max(this.options.minZoom,Math.min(+N,this.options.maxZoom+1))},Et.prototype._cluster=function(N,B){for(var $=[],ee=this.options,xe=ee.reduce,Ue=ee.minPoints,Qe=ee.radius/(ee.extent*Math.pow(2,B)),j=0;j<N.length;j++){var Q=N[j];if(!(Q.zoom<=B)){Q.zoom=B;for(var Fe=this.trees[B+1],et=Fe.within(Q.x,Q.y,Qe),Ae=Q.numPoints||1,$t=Ae,yr=0,nn=et;yr<nn.length;yr+=1){var Qr=Fe.points[nn[yr]];Qr.zoom>B&&($t+=Qr.numPoints||1)}if($t>=Ue){for(var tr=Q.x*Ae,Xr=Q.y*Ae,zr=xe&&Ae>1?this._map(Q,!0):null,jr=(j<<5)+(B+1)+this.points.length,Jn=0,ln=et;Jn<ln.length;Jn+=1){var hi=Fe.points[ln[Jn]];if(!(hi.zoom<=B)){hi.zoom=B;var Vi=hi.numPoints||1;tr+=hi.x*Vi,Xr+=hi.y*Vi,hi.parentId=jr,xe&&(zr||(zr=this._map(Q,!0)),xe(zr,this._map(hi)))}}Q.parentId=jr,$.push(Jr(tr/$t,Xr/$t,jr,$t,zr))}else if($.push(Q),$t>1)for(var ci=0,Li=et;ci<Li.length;ci+=1){var Ei=Fe.points[Li[ci]];Ei.zoom<=B||(Ei.zoom=B,$.push(Ei))}}}return $},Et.prototype._getOriginId=function(N){return N-this.points.length>>5},Et.prototype._getOriginZoom=function(N){return(N-this.points.length)%32},Et.prototype._map=function(N,B){if(N.numPoints)return B?yi({},N.properties):N.properties;var $=this.points[N.index].properties,ee=this.options.map($);return B&&ee===$?yi({},ee):ee},De.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},De.prototype.splitTile=function(N,B,$,ee,xe,Ue,Qe){for(var j=[N,B,$,ee],Q=this.options,Fe=Q.debug;j.length;){ee=j.pop(),$=j.pop(),B=j.pop(),N=j.pop();var et=1<<B,Ae=zt(B,$,ee),$t=this.tiles[Ae];if(!$t&&(Fe>1&&console.time("creation"),$t=this.tiles[Ae]=z(N,B,$,ee,Q),this.tileCoords.push({z:B,x:$,y:ee}),Fe)){Fe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",B,$,ee,$t.numFeatures,$t.numPoints,$t.numSimplified),console.timeEnd("creation"));var yr="z"+B;this.stats[yr]=(this.stats[yr]||0)+1,this.total++}if($t.source=N,xe){if(B===Q.maxZoom||B===xe)continue;var nn=1<<xe-B;if($!==Math.floor(Ue/nn)||ee!==Math.floor(Qe/nn))continue}else if(B===Q.indexMaxZoom||$t.numPoints<=Q.indexMaxPoints)continue;if($t.source=null,N.length!==0){Fe>1&&console.time("clipping");var Qr,tr,Xr,zr,jr,Jn,ln=.5*Q.buffer/Q.extent,hi=.5-ln,Vi=.5+ln,ci=1+ln;Qr=tr=Xr=zr=null,jr=Za(N,et,$-ln,$+Vi,0,$t.minX,$t.maxX,Q),Jn=Za(N,et,$+hi,$+ci,0,$t.minX,$t.maxX,Q),N=null,jr&&(Qr=Za(jr,et,ee-ln,ee+Vi,1,$t.minY,$t.maxY,Q),tr=Za(jr,et,ee+hi,ee+ci,1,$t.minY,$t.maxY,Q),jr=null),Jn&&(Xr=Za(Jn,et,ee-ln,ee+Vi,1,$t.minY,$t.maxY,Q),zr=Za(Jn,et,ee+hi,ee+ci,1,$t.minY,$t.maxY,Q),Jn=null),Fe>1&&console.timeEnd("clipping"),j.push(Qr||[],B+1,2*$,2*ee),j.push(tr||[],B+1,2*$,2*ee+1),j.push(Xr||[],B+1,2*$+1,2*ee),j.push(zr||[],B+1,2*$+1,2*ee+1)}}},De.prototype.getTile=function(N,B,$){var ee=this.options,xe=ee.extent,Ue=ee.debug;if(N<0||N>24)return null;var Qe=1<<N,j=zt(N,B=(B%Qe+Qe)%Qe,$);if(this.tiles[j])return ue(this.tiles[j],xe);Ue>1&&console.log("drilling down to z%d-%d-%d",N,B,$);for(var Q,Fe=N,et=B,Ae=$;!Q&&Fe>0;)Fe--,et=Math.floor(et/2),Ae=Math.floor(Ae/2),Q=this.tiles[zt(Fe,et,Ae)];return Q&&Q.source?(Ue>1&&console.log("found parent tile z%d-%d-%d",Fe,et,Ae),Ue>1&&console.time("drilling down"),this.splitTile(Q.source,Fe,et,Ae,N,B,$),Ue>1&&console.timeEnd("drilling down"),this.tiles[j]?ue(this.tiles[j],xe):null):null};var Rt=function(N){function B($,ee,xe,Ue){N.call(this,$,ee,xe,Tt),Ue&&(this.loadGeoJSON=Ue)}return N&&(B.__proto__=N),(B.prototype=Object.create(N&&N.prototype)).constructor=B,B.prototype.loadData=function($,ee){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=ee,this._pendingLoadDataParams=$,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},B.prototype._loadData=function(){var $=this;if(this._pendingCallback&&this._pendingLoadDataParams){var ee=this._pendingCallback,xe=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var Ue=!!(xe&&xe.request&&xe.request.collectResourceTiming)&&new y.RequestPerformance(xe.request);this.loadGeoJSON(xe,function(Qe,j){if(Qe||!j)return ee(Qe);if(typeof j!="object")return ee(new Error("Input data given to '"+xe.source+"' is not a valid GeoJSON object."));(function $t(yr,nn){var Qr,tr=yr&&yr.type;if(tr==="FeatureCollection")for(Qr=0;Qr<yr.features.length;Qr++)$t(yr.features[Qr],nn);else if(tr==="GeometryCollection")for(Qr=0;Qr<yr.geometries.length;Qr++)$t(yr.geometries[Qr],nn);else if(tr==="Feature")$t(yr.geometry,nn);else if(tr==="Polygon")Xt(yr.coordinates,nn);else if(tr==="MultiPolygon")for(Qr=0;Qr<yr.coordinates.length;Qr++)Xt(yr.coordinates[Qr],nn);return yr})(j,!0);try{if(xe.filter){var Q=y.createExpression(xe.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Q.result==="error")throw new Error(Q.value.map(function($t){return $t.key+": "+$t.message}).join(", "));var Fe=j.features.filter(function($t){return Q.value.evaluate({zoom:0},$t)});j={type:"FeatureCollection",features:Fe}}$._geoJSONIndex=xe.cluster?new Et(function($t){var yr=$t.superclusterOptions,nn=$t.clusterProperties;if(!nn||!yr)return yr;for(var Qr={},tr={},Xr={accumulated:null,zoom:0},zr={properties:null},jr=Object.keys(nn),Jn=0,ln=jr;Jn<ln.length;Jn+=1){var hi=ln[Jn],Vi=nn[hi],ci=Vi[0],Li=y.createExpression(Vi[1]),Ei=y.createExpression(typeof ci=="string"?[ci,["accumulated"],["get",hi]]:ci);Qr[hi]=Li.value,tr[hi]=Ei.value}return yr.map=function(ns){zr.properties=ns;for(var Qi={},Pa=0,Si=jr;Pa<Si.length;Pa+=1){var di=Si[Pa];Qi[di]=Qr[di].evaluate(Xr,zr)}return Qi},yr.reduce=function(ns,Qi){zr.properties=Qi;for(var Pa=0,Si=jr;Pa<Si.length;Pa+=1){var di=Si[Pa];Xr.accumulated=ns[di],ns[di]=tr[di].evaluate(Xr,zr)}},yr}(xe)).load(j.features):function($t,yr){return new De($t,yr)}(j,xe.geojsonVtOptions)}catch($t){return ee($t)}$.loaded={};var et={};if(Ue){var Ae=Ue.finish();Ae&&(et.resourceTiming={},et.resourceTiming[xe.source]=JSON.parse(JSON.stringify(Ae)))}ee(null,et)})}},B.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},B.prototype.reloadTile=function($,ee){var xe=this.loaded;return xe&&xe[$.uid]?N.prototype.reloadTile.call(this,$,ee):this.loadTile($,ee)},B.prototype.loadGeoJSON=function($,ee){if($.request)y.getJSON($.request,ee);else{if(typeof $.data!="string")return ee(new Error("Input data given to '"+$.source+"' is not a valid GeoJSON object."));try{return ee(null,JSON.parse($.data))}catch(xe){return ee(new Error("Input data given to '"+$.source+"' is not a valid GeoJSON object."))}}},B.prototype.removeSource=function($,ee){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),ee()},B.prototype.getClusterExpansionZoom=function($,ee){try{ee(null,this._geoJSONIndex.getClusterExpansionZoom($.clusterId))}catch(xe){ee(xe)}},B.prototype.getClusterChildren=function($,ee){try{ee(null,this._geoJSONIndex.getChildren($.clusterId))}catch(xe){ee(xe)}},B.prototype.getClusterLeaves=function($,ee){try{ee(null,this._geoJSONIndex.getLeaves($.clusterId,$.limit,$.offset))}catch(xe){ee(xe)}},B}(vt),dt=function(N){var B=this;this.self=N,this.actor=new y.Actor(N,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:vt,geojson:Rt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function($,ee){if(B.workerSourceTypes[$])throw new Error('Worker source with name "'+$+'" already registered.');B.workerSourceTypes[$]=ee},this.self.registerRTLTextPlugin=function($){if(y.plugin.isParsed())throw new Error("RTL text plugin already registered.");y.plugin.applyArabicShaping=$.applyArabicShaping,y.plugin.processBidirectionalText=$.processBidirectionalText,y.plugin.processStyledBidirectionalText=$.processStyledBidirectionalText}};return dt.prototype.setReferrer=function(N,B){this.referrer=B},dt.prototype.setImages=function(N,B,$){for(var ee in this.availableImages[N]=B,this.workerSources[N]){var xe=this.workerSources[N][ee];for(var Ue in xe)xe[Ue].availableImages=B}$()},dt.prototype.setLayers=function(N,B,$){this.getLayerIndex(N).replace(B),$()},dt.prototype.updateLayers=function(N,B,$){this.getLayerIndex(N).update(B.layers,B.removedIds),$()},dt.prototype.loadTile=function(N,B,$){this.getWorkerSource(N,B.type,B.source).loadTile(B,$)},dt.prototype.loadDEMTile=function(N,B,$){this.getDEMWorkerSource(N,B.source).loadTile(B,$)},dt.prototype.reloadTile=function(N,B,$){this.getWorkerSource(N,B.type,B.source).reloadTile(B,$)},dt.prototype.abortTile=function(N,B,$){this.getWorkerSource(N,B.type,B.source).abortTile(B,$)},dt.prototype.removeTile=function(N,B,$){this.getWorkerSource(N,B.type,B.source).removeTile(B,$)},dt.prototype.removeDEMTile=function(N,B){this.getDEMWorkerSource(N,B.source).removeTile(B)},dt.prototype.removeSource=function(N,B,$){if(this.workerSources[N]&&this.workerSources[N][B.type]&&this.workerSources[N][B.type][B.source]){var ee=this.workerSources[N][B.type][B.source];delete this.workerSources[N][B.type][B.source],ee.removeSource!==void 0?ee.removeSource(B,$):$()}},dt.prototype.loadWorkerSource=function(N,B,$){try{this.self.importScripts(B.url),$()}catch(ee){$(ee.toString())}},dt.prototype.syncRTLPluginState=function(N,B,$){try{y.plugin.setState(B);var ee=y.plugin.getPluginURL();if(y.plugin.isLoaded()&&!y.plugin.isParsed()&&ee!=null){this.self.importScripts(ee);var xe=y.plugin.isParsed();$(xe?void 0:new Error("RTL Text Plugin failed to import scripts from "+ee),xe)}}catch(Ue){$(Ue.toString())}},dt.prototype.getAvailableImages=function(N){var B=this.availableImages[N];return B||(B=[]),B},dt.prototype.getLayerIndex=function(N){var B=this.layerIndexes[N];return B||(B=this.layerIndexes[N]=new pe),B},dt.prototype.getWorkerSource=function(N,B,$){var ee=this;return this.workerSources[N]||(this.workerSources[N]={}),this.workerSources[N][B]||(this.workerSources[N][B]={}),this.workerSources[N][B][$]||(this.workerSources[N][B][$]=new this.workerSourceTypes[B]({send:function(xe,Ue,Qe){ee.actor.send(xe,Ue,Qe,N)}},this.getLayerIndex(N),this.getAvailableImages(N))),this.workerSources[N][B][$]},dt.prototype.getDEMWorkerSource=function(N,B){return this.demWorkerSources[N]||(this.demWorkerSources[N]={}),this.demWorkerSources[N][B]||(this.demWorkerSources[N][B]=new Ot),this.demWorkerSources[N][B]},dt.prototype.enforceCacheSizeLimit=function(N,B){y.enforceCacheSizeLimit(B)},typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope&&(self.worker=new dt(self)),dt}),ye(["./shared"],function(y){"use strict";var he=y.createCommonjsModule(function(h){function v(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,O,X=new Blob([""],{type:"text/javascript"}),J=URL.createObjectURL(X);try{O=new Worker(J),C=!0}catch(me){C=!1}return O&&O.terminate(),URL.revokeObjectURL(J),C}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var C=document.createElement("canvas");C.width=C.height=1;var O=C.getContext("2d");if(!O)return!1;var X=O.getImageData(0,0,1,1);return X&&X.width===C.width}()?(g[w=S&&S.failIfMajorPerformanceCaveat]===void 0&&(g[w]=function(C){var O=function(J){var me=document.createElement("canvas"),be=Object.create(v.webGLContextAttributes);return be.failIfMajorPerformanceCaveat=J,me.probablySupportsContext?me.probablySupportsContext("webgl",be)||me.probablySupportsContext("experimental-webgl",be):me.supportsContext?me.supportsContext("webgl",be)||me.supportsContext("experimental-webgl",be):me.getContext("webgl",be)||me.getContext("experimental-webgl",be)}(C);if(!O)return!1;var X=O.createShader(O.VERTEX_SHADER);return!(!X||O.isContextLost())&&(O.shaderSource(X,"void main() {}"),O.compileShader(X),O.getShaderParameter(X,O.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=v:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=v,window.mapboxgl.notSupportedReason=p);var g={};v.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),Z={create:function(h,v,p){var g=y.window.document.createElement(h);return v!==void 0&&(g.className=v),p&&p.appendChild(g),g},createNS:function(h,v){return y.window.document.createElementNS(h,v)}},pe=y.window.document&&y.window.document.documentElement.style;function fe(h){if(!pe)return h[0];for(var v=0;v<h.length;v++)if(h[v]in pe)return h[v];return h[0]}var it,ce=fe(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);Z.disableDrag=function(){pe&&ce&&(it=pe[ce],pe[ce]="none")},Z.enableDrag=function(){pe&&ce&&(pe[ce]=it)};var rt=fe(["transform","WebkitTransform"]);Z.setTransform=function(h,v){h.style[rt]=v};var vt=!1;try{var tt=Object.defineProperty({},"passive",{get:function(){vt=!0}});y.window.addEventListener("test",tt,tt),y.window.removeEventListener("test",tt,tt)}catch(h){vt=!1}Z.addEventListener=function(h,v,p,g){g===void 0&&(g={}),h.addEventListener(v,p,"passive"in g&&vt?g:g.capture)},Z.removeEventListener=function(h,v,p,g){g===void 0&&(g={}),h.removeEventListener(v,p,"passive"in g&&vt?g:g.capture)};var Ot=function(h){h.preventDefault(),h.stopPropagation(),y.window.removeEventListener("click",Ot,!0)};function Xt(h){var v=h.userImage;return!!(v&&v.render&&v.render())&&(h.data.replace(new Uint8Array(v.data.buffer)),!0)}Z.suppressClick=function(){y.window.addEventListener("click",Ot,!0),y.window.setTimeout(function(){y.window.removeEventListener("click",Ot,!0)},0)},Z.mousePos=function(h,v){var p=h.getBoundingClientRect();return new y.Point(v.clientX-p.left-h.clientLeft,v.clientY-p.top-h.clientTop)},Z.touchPos=function(h,v){for(var p=h.getBoundingClientRect(),g=[],S=0;S<v.length;S++)g.push(new y.Point(v[S].clientX-p.left-h.clientLeft,v[S].clientY-p.top-h.clientTop));return g},Z.mouseButton=function(h){return y.window.InstallTrigger!==void 0&&h.button===2&&h.ctrlKey&&y.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:h.button},Z.remove=function(h){h.parentNode&&h.parentNode.removeChild(h)};var Yt=function(h){function v(){h.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new y.RGBAImage({width:1,height:1}),this.dirty=!0}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.isLoaded=function(){return this.loaded},v.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=[]}},v.prototype.getImage=function(p){return this.images[p]},v.prototype.addImage=function(p,g){this._validate(p,g)&&(this.images[p]=g)},v.prototype._validate=function(p,g){var S=!0;return this._validateStretch(g.stretchX,g.data&&g.data.width)||(this.fire(new y.ErrorEvent(new Error('Image "'+p+'" has invalid "stretchX" value'))),S=!1),this._validateStretch(g.stretchY,g.data&&g.data.height)||(this.fire(new y.ErrorEvent(new Error('Image "'+p+'" has invalid "stretchY" value'))),S=!1),this._validateContent(g.content,g)||(this.fire(new y.ErrorEvent(new Error('Image "'+p+'" has invalid "content" value'))),S=!1),S},v.prototype._validateStretch=function(p,g){if(!p)return!0;for(var S=0,w=0,C=p;w<C.length;w+=1){var O=C[w];if(O[0]<S||O[1]<O[0]||g<O[1])return!1;S=O[1]}return!0},v.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]))},v.prototype.updateImage=function(p,g){g.version=this.images[p].version+1,this.images[p]=g,this.updatedImages[p]=!0},v.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()},v.prototype.listImages=function(){return Object.keys(this.images)},v.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})},v.prototype._notify=function(p,g){for(var S={},w=0,C=p;w<C.length;w+=1){var O=C[w];this.images[O]||this.fire(new y.Event("styleimagemissing",{id:O}));var X=this.images[O];X?S[O]={data:X.data.clone(),pixelRatio:X.pixelRatio,sdf:X.sdf,version:X.version,stretchX:X.stretchX,stretchY:X.stretchY,content:X.content,hasRenderCallback:!!(X.userImage&&X.userImage.render)}:y.warnOnce('Image "'+O+'" 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)},v.prototype.getPixelSize=function(){var p=this.atlasImage;return{width:p.width,height:p.height}},v.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 y.ImagePosition(w,S);this.patterns[p]={bin:w,position:C}}return this._updatePatternAtlas(),this.patterns[p].position},v.prototype.bind=function(p){var g=p.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new y.Texture(p,this.atlasImage,g.RGBA),this.atlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE)},v.prototype._updatePatternAtlas=function(){var p=[];for(var g in this.patterns)p.push(this.patterns[g].bin);var S=y.potpack(p),w=S.w,C=S.h,O=this.atlasImage;for(var X in O.resize({width:w||1,height:C||1}),this.patterns){var J=this.patterns[X].bin,me=J.x+1,be=J.y+1,Te=this.images[X].data,je=Te.width,Ze=Te.height;y.RGBAImage.copy(Te,O,{x:0,y:0},{x:me,y:be},{width:je,height:Ze}),y.RGBAImage.copy(Te,O,{x:0,y:Ze-1},{x:me,y:be-1},{width:je,height:1}),y.RGBAImage.copy(Te,O,{x:0,y:0},{x:me,y:be+Ze},{width:je,height:1}),y.RGBAImage.copy(Te,O,{x:je-1,y:0},{x:me-1,y:be},{width:1,height:Ze}),y.RGBAImage.copy(Te,O,{x:0,y:0},{x:me+je,y:be},{width:1,height:Ze})}this.dirty=!0},v.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},v.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)}}},v}(y.Evented),ar=St,Zt=St,bt=1e20;function St(h,v,p,g,S,w){this.fontSize=h||24,this.buffer=v===void 0?3:v,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 Rr(h,v,p,g,S,w,C){for(var O=0;O<v;O++){for(var X=0;X<p;X++)g[X]=h[X*v+O];for(gr(g,S,w,C,p),X=0;X<p;X++)h[X*v+O]=S[X]}for(X=0;X<p;X++){for(O=0;O<v;O++)g[O]=h[X*v+O];for(gr(g,S,w,C,v),O=0;O<v;O++)h[X*v+O]=Math.sqrt(S[O])}}function gr(h,v,p,g,S){p[0]=0,g[0]=-bt,g[1]=+bt;for(var w=1,C=0;w<S;w++){for(var O=(h[w]+w*w-(h[p[C]]+p[C]*p[C]))/(2*w-2*p[C]);O<=g[C];)C--,O=(h[w]+w*w-(h[p[C]]+p[C]*p[C]))/(2*w-2*p[C]);p[++C]=w,g[C]=O,g[C+1]=+bt}for(w=0,C=0;w<S;w++){for(;g[C+1]<w;)C++;v[w]=(w-p[C])*(w-p[C])+h[p[C]]}}St.prototype.draw=function(h){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(h,this.buffer,this.middle);for(var v=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=v.data[4*g+3]/255;this.gridOuter[g]=S===1?0:S===0?bt:Math.pow(Math.max(0,.5-S),2),this.gridInner[g]=S===1?bt:S===0?0:Math.pow(Math.max(0,S-.5),2)}for(Rr(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),Rr(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},ar.default=Zt;var fr=function(h,v){this.requestManager=h,this.localIdeographFontFamily=v,this.entries={}};fr.prototype.setURL=function(h){this.url=h},fr.prototype.getGlyphs=function(h,v){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]});y.asyncAll(g,function(O,X){var J=O.stack,me=O.id,be=p.entries[J];be||(be=p.entries[J]={glyphs:{},requests:{},ranges:{}});var Te=be.glyphs[me];if(Te===void 0){if(Te=p._tinySDF(be,J,me))return be.glyphs[me]=Te,void X(null,{stack:J,id:me,glyph:Te});var je=Math.floor(me/256);if(256*je>65535)X(new Error("glyphs > 65535 not supported"));else if(be.ranges[je])X(null,{stack:J,id:me,glyph:Te});else{var Ze=be.requests[je];Ze||(Ze=be.requests[je]=[],fr.loadGlyphRange(J,je,p.url,p.requestManager,function(lt,Ne){if(Ne){for(var ot in Ne)p._doesCharSupportLocalGlyph(+ot)||(be.glyphs[+ot]=Ne[+ot]);be.ranges[je]=!0}for(var _t=0,Lt=Ze;_t<Lt.length;_t+=1)(0,Lt[_t])(lt,Ne);delete be.requests[je]})),Ze.push(function(lt,Ne){lt?X(lt):Ne&&X(null,{stack:J,id:me,glyph:Ne[me]||null})})}}else X(null,{stack:J,id:me,glyph:Te})},function(O,X){if(O)v(O);else if(X){for(var J={},me=0,be=X;me<be.length;me+=1){var Te=be[me],je=Te.stack,Ze=Te.id,lt=Te.glyph;(J[je]||(J[je]={}))[Ze]=lt&&{id:lt.id,bitmap:lt.bitmap.clone(),metrics:lt.metrics}}v(null,J)}})},fr.prototype._doesCharSupportLocalGlyph=function(h){return!!this.localIdeographFontFamily&&(y.isChar["CJK Unified Ideographs"](h)||y.isChar["Hangul Syllables"](h)||y.isChar.Hiragana(h)||y.isChar.Katakana(h))},fr.prototype._tinySDF=function(h,v,p){var g=this.localIdeographFontFamily;if(g&&this._doesCharSupportLocalGlyph(p)){var S=h.tinySDF;if(!S){var w="400";/bold/i.test(v)?w="900":/medium/i.test(v)?w="500":/light/i.test(v)&&(w="200"),S=h.tinySDF=new fr.TinySDF(24,3,8,.25,g,w)}return{id:p,bitmap:new y.AlphaImage({width:30,height:30},S.draw(String.fromCharCode(p))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},fr.loadGlyphRange=function(h,v,p,g,S){var w=256*v,C=w+255,O=g.transformRequest(g.normalizeGlyphsURL(p).replace("{fontstack}",h).replace("{range}",w+"-"+C),y.ResourceType.Glyphs);y.getArrayBuffer(O,function(X,J){if(X)S(X);else if(J){for(var me={},be=0,Te=y.parseGlyphPBF(J);be<Te.length;be+=1){var je=Te[be];me[je.id]=je}S(null,me)}})},fr.TinySDF=ar;var Mt=function(){this.specification=y.styleSpec.light.position};Mt.prototype.possiblyEvaluate=function(h,v){return y.sphericalToCartesian(h.expression.evaluate(v))},Mt.prototype.interpolate=function(h,v,p){return{x:y.number(h.x,v.x,p),y:y.number(h.y,v.y,p),z:y.number(h.z,v.z,p)}};var ft=new y.Properties({anchor:new y.DataConstantProperty(y.styleSpec.light.anchor),position:new Mt,color:new y.DataConstantProperty(y.styleSpec.light.color),intensity:new y.DataConstantProperty(y.styleSpec.light.intensity)}),kt=function(h){function v(p){h.call(this),this._transitionable=new y.Transitionable(ft),this.setLight(p),this._transitioning=this._transitionable.untransitioned()}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getLight=function(){return this._transitionable.serialize()},v.prototype.setLight=function(p,g){if(g===void 0&&(g={}),!this._validate(y.validateLight,p,g))for(var S in p){var w=p[S];y.endsWith(S,"-transition")?this._transitionable.setTransition(S.slice(0,-11),w):this._transitionable.setValue(S,w)}},v.prototype.updateTransitions=function(p){this._transitioning=this._transitionable.transitioned(p,this._transitioning)},v.prototype.hasTransition=function(){return this._transitioning.hasTransition()},v.prototype.recalculate=function(p){this.properties=this._transitioning.possiblyEvaluate(p)},v.prototype._validate=function(p,g,S){return(!S||S.validate!==!1)&&y.emitValidationErrors(this,p.call(y.validateStyle,y.extend({value:g,style:{glyphs:!0,sprite:!0},styleSpec:y.styleSpec})))},v}(y.Evented),qe=function(h,v){this.width=h,this.height=v,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};qe.prototype.getDash=function(h,v){var p=h.join(",")+String(v);return this.dashEntry[p]||(this.dashEntry[p]=this.addDash(h,v)),this.dashEntry[p]},qe.prototype.getDashRanges=function(h,v,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 O=h[0],X=1;X<h.length;X++){var J=h[X];g.push({left:S=O*p,right:w=(O+=J)*p,isDash:C=!C,zeroLength:J===0})}return g},qe.prototype.addRoundDash=function(h,v,p){for(var g=v/2,S=-p;S<=p;S++)for(var w=this.width*(this.nextRow+p+S),C=0,O=h[C],X=0;X<this.width;X++){X/O.right>1&&(O=h[++C]);var J=Math.abs(X-O.left),me=Math.abs(X-O.right),be=Math.min(J,me),Te=void 0,je=S/p*(g+1);if(O.isDash){var Ze=g-Math.abs(je);Te=Math.sqrt(be*be+Ze*Ze)}else Te=g-Math.sqrt(be*be+je*je);this.data[w+X]=Math.max(0,Math.min(255,Te+128))}},qe.prototype.addRegularDash=function(h){for(var v=h.length-1;v>=0;--v){var p=h[v],g=h[v+1];p.zeroLength?h.splice(v,1):g&&g.isDash===p.isDash&&(g.left=p.left,h.splice(v,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,O=0,X=h[O],J=0;J<this.width;J++){J/X.right>1&&(X=h[++O]);var me=Math.abs(J-X.left),be=Math.abs(J-X.right),Te=Math.min(me,be);this.data[C+J]=Math.max(0,Math.min(255,(X.isDash?Te:-Te)+128))}},qe.prototype.addDash=function(h,v){var p=v?7:0,g=2*p+1;if(this.nextRow+g>this.height)return y.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,O=this.getDashRanges(h,this.width,C);v?this.addRoundDash(O,C,p):this.addRegularDash(O)}var X={y:(this.nextRow+p+.5)/this.height,height:2*p/this.height,width:S};return this.nextRow+=g,this.dirty=!0,X},qe.prototype.bind=function(h){var v=h.gl;this.texture?(v.bindTexture(v.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,v.texSubImage2D(v.TEXTURE_2D,0,0,0,this.width,this.height,v.ALPHA,v.UNSIGNED_BYTE,this.data))):(this.texture=v.createTexture(),v.bindTexture(v.TEXTURE_2D,this.texture),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.REPEAT),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.REPEAT),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.LINEAR),v.texImage2D(v.TEXTURE_2D,0,v.ALPHA,this.width,this.height,0,v.ALPHA,v.UNSIGNED_BYTE,this.data))};var Dt=function h(v,p){this.workerPool=v,this.actors=[],this.currentActor=0,this.id=y.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 dr(h,v,p){var g=function(S,w){if(S)return p(S);if(w){var C=y.pick(y.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(O){return O.id})),C.tiles=v.canonicalizeTileset(C,h.url),p(null,C)}};return h.url?y.getJSON(v.transformRequest(v.normalizeSourceURL(h.url),y.ResourceType.Source),g):y.browser.frame(function(){return g(null,h)})}Dt.prototype.broadcast=function(h,v,p){y.asyncAll(this.actors,function(g,S){g.send(h,v,S)},p=p||function(){})},Dt.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Dt.prototype.remove=function(){this.actors.forEach(function(h){h.remove()}),this.actors=[],this.workerPool.release(this.id)},Dt.Actor=y.Actor;var oe=function(h,v,p){this.bounds=y.LngLatBounds.convert(this.validateBounds(h)),this.minzoom=v||0,this.maxzoom=p||24};oe.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]},oe.prototype.contains=function(h){var v=Math.pow(2,h.z),p=Math.floor(y.mercatorXfromLng(this.bounds.getWest())*v),g=Math.floor(y.mercatorYfromLat(this.bounds.getNorth())*v),S=Math.ceil(y.mercatorXfromLng(this.bounds.getEast())*v),w=Math.ceil(y.mercatorYfromLat(this.bounds.getSouth())*v);return h.x>=p&&h.x<S&&h.y>=g&&h.y<w};var H=function(h){function v(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,y.extend(this,y.pick(g,["url","scheme","tileSize","promoteId"])),this._options=y.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&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.load=function(){var p=this;this._loaded=!1,this.fire(new y.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=dr(this._options,this.map._requestManager,function(g,S){p._tileJSONRequest=null,p._loaded=!0,g?p.fire(new y.ErrorEvent(g)):S&&(y.extend(p,S),S.bounds&&(p.tileBounds=new oe(S.bounds,p.minzoom,p.maxzoom)),y.postTurnstileEvent(S.tiles,p.map._requestManager._customAccessToken),y.postMapLoadEvent(S.tiles,p.map._getMapId(),p.map._requestManager._skuToken,p.map._requestManager._customAccessToken),p.fire(new y.Event("data",{dataType:"source",sourceDataType:"metadata"})),p.fire(new y.Event("data",{dataType:"source",sourceDataType:"content"})))})},v.prototype.loaded=function(){return this._loaded},v.prototype.hasTile=function(p){return!this.tileBounds||this.tileBounds.contains(p.canonical)},v.prototype.onAdd=function(p){this.map=p,this.load()},v.prototype.setSourceProperty=function(p){this._tileJSONRequest&&this._tileJSONRequest.cancel(),p(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},v.prototype.setTiles=function(p){var g=this;return this.setSourceProperty(function(){g._options.tiles=p}),this},v.prototype.setUrl=function(p){var g=this;return this.setSourceProperty(function(){g.url=p,g._options.url=p}),this},v.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},v.prototype.serialize=function(){return y.extend({},this._options)},v.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,y.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:y.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function C(O,X){return delete p.request,p.aborted?g(null):O&&O.status!==404?g(O):(X&&X.resourceTiming&&(p.resourceTiming=X.resourceTiming),this.map._refreshExpiredTiles&&X&&p.setExpiryData(X),p.loadVectorData(X,this.map.painter),y.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)))},v.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)},v.prototype.unloadTile=function(p){p.unloadVectorData(),p.actor&&p.actor.send("removeTile",{uid:p.uid,type:this.type,source:this.id},void 0)},v.prototype.hasTransition=function(){return!1},v}(y.Evented),re=function(h){function v(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=y.extend({type:"raster"},g),y.extend(this,y.pick(g,["url","scheme","tileSize"]))}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.load=function(){var p=this;this._loaded=!1,this.fire(new y.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=dr(this._options,this.map._requestManager,function(g,S){p._tileJSONRequest=null,p._loaded=!0,g?p.fire(new y.ErrorEvent(g)):S&&(y.extend(p,S),S.bounds&&(p.tileBounds=new oe(S.bounds,p.minzoom,p.maxzoom)),y.postTurnstileEvent(S.tiles),y.postMapLoadEvent(S.tiles,p.map._getMapId(),p.map._requestManager._skuToken),p.fire(new y.Event("data",{dataType:"source",sourceDataType:"metadata"})),p.fire(new y.Event("data",{dataType:"source",sourceDataType:"content"})))})},v.prototype.loaded=function(){return this._loaded},v.prototype.onAdd=function(p){this.map=p,this.load()},v.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},v.prototype.serialize=function(){return y.extend({},this._options)},v.prototype.hasTile=function(p){return!this.tileBounds||this.tileBounds.contains(p.canonical)},v.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=y.getImage(this.map._requestManager.transformRequest(w,y.ResourceType.Tile),function(C,O){if(delete p.request,p.aborted)p.state="unloaded",g(null);else if(C)p.state="errored",g(C);else if(O){S.map._refreshExpiredTiles&&p.setExpiryData(O),delete O.cacheControl,delete O.expires;var X=S.map.painter.context,J=X.gl;p.texture=S.map.painter.getTileTexture(O.width),p.texture?p.texture.update(O,{useMipmap:!0}):(p.texture=new y.Texture(X,O,J.RGBA,{useMipmap:!0}),p.texture.bind(J.LINEAR,J.CLAMP_TO_EDGE,J.LINEAR_MIPMAP_NEAREST),X.extTextureFilterAnisotropic&&J.texParameterf(J.TEXTURE_2D,X.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,X.extTextureFilterAnisotropicMax)),p.state="loaded",y.cacheEntryPossiblyAdded(S.dispatcher),g(null)}})},v.prototype.abortTile=function(p,g){p.request&&(p.request.cancel(),delete p.request),g()},v.prototype.unloadTile=function(p,g){p.texture&&this.map.painter.saveTileTexture(p.texture),g()},v.prototype.hasTransition=function(){return!1},v}(y.Evented),Be=function(h){function v(p,g,S,w){h.call(this,p,g,S,w),this.type="raster-dem",this.maxzoom=22,this._options=y.extend({type:"raster-dem"},g),this.encoding=g.encoding||"mapbox"}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},v.prototype.loadTile=function(p,g){var S=this.map._requestManager.normalizeTileURL(p.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function w(C,O){C&&(p.state="errored",g(C)),O&&(p.dem=O,p.needsHillshadePrepare=!0,p.state="loaded",g(null))}p.request=y.getImage(this.map._requestManager.transformRequest(S,y.ResourceType.Tile),function(C,O){if(delete p.request,p.aborted)p.state="unloaded",g(null);else if(C)p.state="errored",g(C);else if(O){this.map._refreshExpiredTiles&&p.setExpiryData(O),delete O.cacheControl,delete O.expires;var X=y.window.ImageBitmap&&O instanceof y.window.ImageBitmap&&y.offscreenCanvasSupported()?O:y.browser.getImageData(O,1),J={uid:p.uid,coord:p.tileID,source:this.id,rawImageData:X,encoding:this.encoding};p.actor&&p.state!=="expired"||(p.actor=this.dispatcher.getActor(),p.actor.send("loadDEMTile",J,w.bind(this)))}}.bind(this)),p.neighboringTiles=this._getNeighboringTiles(p.tileID)},v.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,O=(g.x+1+S)%S,X=g.x+1===S?p.wrap+1:p.wrap,J={};return J[new y.OverscaledTileID(p.overscaledZ,C,g.z,w,g.y).key]={backfilled:!1},J[new y.OverscaledTileID(p.overscaledZ,X,g.z,O,g.y).key]={backfilled:!1},g.y>0&&(J[new y.OverscaledTileID(p.overscaledZ,C,g.z,w,g.y-1).key]={backfilled:!1},J[new y.OverscaledTileID(p.overscaledZ,p.wrap,g.z,g.x,g.y-1).key]={backfilled:!1},J[new y.OverscaledTileID(p.overscaledZ,X,g.z,O,g.y-1).key]={backfilled:!1}),g.y+1<S&&(J[new y.OverscaledTileID(p.overscaledZ,C,g.z,w,g.y+1).key]={backfilled:!1},J[new y.OverscaledTileID(p.overscaledZ,p.wrap,g.z,g.x,g.y+1).key]={backfilled:!1},J[new y.OverscaledTileID(p.overscaledZ,X,g.z,O,g.y+1).key]={backfilled:!1}),J},v.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})},v}(re),we=function(h){function v(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=y.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=y.EXTENT/this.tileSize;this.workerOptions=y.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:y.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:y.EXTENT,radius:(g.clusterRadius||50)*C,log:!1,generateId:g.generateId||!1},clusterProperties:g.clusterProperties,filter:g.filter},g.workerOptions)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.load=function(){var p=this;this.fire(new y.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(g){if(g)p.fire(new y.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 y.Event("data",S))}})},v.prototype.onAdd=function(p){this.map=p,this.load()},v.prototype.setData=function(p){var g=this;return this._data=p,this.fire(new y.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(S){if(S)g.fire(new y.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 y.Event("data",w))}}),this},v.prototype.getClusterExpansionZoom=function(p,g){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:p,source:this.id},g),this},v.prototype.getClusterChildren=function(p,g){return this.actor.send("geojson.getClusterChildren",{clusterId:p,source:this.id},g),this},v.prototype.getClusterLeaves=function(p,g,S,w){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:p,limit:g,offset:S},w),this},v.prototype._updateWorkerData=function(p){var g=this;this._loaded=!1;var S=y.extend({},this.workerOptions),w=this._data;typeof w=="string"?(S.request=this.map._requestManager.transformRequest(y.browser.resolveURL(w),y.ResourceType.Source),S.request.collectResourceTiming=this._collectResourceTiming):S.data=JSON.stringify(w),this.actor.send(this.type+".loadData",S,function(C,O){g._removed||O&&O.abandoned||(g._loaded=!0,O&&O.resourceTiming&&O.resourceTiming[g.id]&&(g._resourceTiming=O.resourceTiming[g.id].slice(0)),g.actor.send(g.type+".coalesce",{source:S.source},null),p(C))})},v.prototype.loaded=function(){return this._loaded},v.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:y.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},function(C,O){return delete p.request,p.unloadVectorData(),p.aborted?g(null):C?g(C):(p.loadVectorData(O,S.map.painter,w==="reloadTile"),g(null))})},v.prototype.abortTile=function(p){p.request&&(p.request.cancel(),delete p.request),p.aborted=!0},v.prototype.unloadTile=function(p){p.unloadVectorData(),this.actor.send("removeTile",{uid:p.uid,type:this.type,source:this.id})},v.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},v.prototype.serialize=function(){return y.extend({},this._options,{type:this.type,data:this._data})},v.prototype.hasTransition=function(){return!1},v}(y.Evented),ut=y.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),ie=function(h){function v(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&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.load=function(p,g){var S=this;this._loaded=!1,this.fire(new y.Event("dataloading",{dataType:"source"})),this.url=this.options.url,y.getImage(this.map._requestManager.transformRequest(this.url,y.ResourceType.Image),function(w,C){S._loaded=!0,w?S.fire(new y.ErrorEvent(w)):C&&(S.image=C,p&&(S.coordinates=p),g&&g(),S._finishLoading())})},v.prototype.loaded=function(){return this._loaded},v.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},v.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new y.Event("data",{dataType:"source",sourceDataType:"metadata"})))},v.prototype.onAdd=function(p){this.map=p,this.load()},v.prototype.setCoordinates=function(p){var g=this;this.coordinates=p;var S=p.map(y.MercatorCoordinate.fromLngLat);this.tileID=function(C){for(var O=1/0,X=1/0,J=-1/0,me=-1/0,be=0,Te=C;be<Te.length;be+=1){var je=Te[be];O=Math.min(O,je.x),X=Math.min(X,je.y),J=Math.max(J,je.x),me=Math.max(me,je.y)}var Ze=Math.max(J-O,me-X),lt=Math.max(0,Math.floor(-Math.log(Ze)/Math.LN2)),Ne=Math.pow(2,lt);return new y.CanonicalTileID(lt,Math.floor((O+J)/2*Ne),Math.floor((X+me)/2*Ne))}(S),this.minzoom=this.maxzoom=this.tileID.z;var w=S.map(function(C){return g.tileID.getTilePoint(C)._round()});return this._boundsArray=new y.StructArrayLayout4i8,this._boundsArray.emplaceBack(w[0].x,w[0].y,0,0),this._boundsArray.emplaceBack(w[1].x,w[1].y,y.EXTENT,0),this._boundsArray.emplaceBack(w[3].x,w[3].y,0,y.EXTENT),this._boundsArray.emplaceBack(w[2].x,w[2].y,y.EXTENT,y.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new y.Event("data",{dataType:"source",sourceDataType:"content"})),this},v.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,ut.members)),this.boundsSegments||(this.boundsSegments=y.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new y.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)}}},v.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))},v.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},v.prototype.hasTransition=function(){return!1},v}(y.Evented),Le=function(h){function v(p,g,S,w){h.call(this,p,g,S,w),this.roundZoom=!0,this.type="video",this.options=g}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.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],y.ResourceType.Source).url);y.getVideo(this.urls,function(C,O){p._loaded=!0,C?p.fire(new y.ErrorEvent(C)):O&&(p.video=O,p.video.loop=!0,p.video.setAttribute("playsinline",""),p.video.addEventListener("playing",function(){p.map.triggerRepaint()}),p.map&&p.video.play(),p._finishLoading())})},v.prototype.pause=function(){this.video&&this.video.pause()},v.prototype.play=function(){this.video&&this.video.play()},v.prototype.seek=function(p){if(this.video){var g=this.video.seekable;p<g.start(0)||p>g.end(0)?this.fire(new y.ErrorEvent(new y.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}},v.prototype.getVideo=function(){return this.video},v.prototype.onAdd=function(p){this.map||(this.map=p,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},v.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,ut.members)),this.boundsSegments||(this.boundsSegments=y.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 y.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)}}},v.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},v.prototype.hasTransition=function(){return this.video&&!this.video.paused},v}(ie),Pe=function(h){function v(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(O){return typeof O!="number"})})||this.fire(new y.ErrorEvent(new y.ValidationError("sources."+p,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new y.ErrorEvent(new y.ValidationError("sources."+p,null,'missing required property "coordinates"'))),g.animate&&typeof g.animate!="boolean"&&this.fire(new y.ErrorEvent(new y.ValidationError("sources."+p,null,'optional "animate" property must be a boolean value'))),g.canvas?typeof g.canvas=="string"||g.canvas instanceof y.window.HTMLCanvasElement||this.fire(new y.ErrorEvent(new y.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 y.ErrorEvent(new y.ValidationError("sources."+p,null,'missing required property "canvas"'))),this.options=g,this.animate=g.animate===void 0||g.animate}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof y.window.HTMLCanvasElement?this.options.canvas:y.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new y.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())},v.prototype.getCanvas=function(){return this.canvas},v.prototype.onAdd=function(p){this.map=p,this.load(),this.canvas&&this.animate&&this.play()},v.prototype.onRemove=function(){this.pause()},v.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,ut.members)),this.boundsSegments||(this.boundsSegments=y.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(p||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new y.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)}}},v.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},v.prototype.hasTransition=function(){return this._playing},v.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},v}(ie),Ge={vector:H,raster:re,"raster-dem":Be,geojson:we,video:Le,image:ie,canvas:Pe};function Vt(h,v){var p=y.identity([]);return y.translate(p,p,[1,1,0]),y.scale(p,p,[.5*h.width,.5*h.height,1]),y.multiply(p,p,h.calculatePosMatrix(v.toUnwrapped()))}function Et(h,v,p,g,S,w){var C=function(lt,Ne,ot){if(lt)for(var _t=0,Lt=lt;_t<Lt.length;_t+=1){var ir=Ne[Lt[_t]];if(ir&&ir.source===ot&&ir.type==="fill-extrusion")return!0}else for(var qt in Ne){var cr=Ne[qt];if(cr.source===ot&&cr.type==="fill-extrusion")return!0}return!1}(S&&S.layers,v,h.id),O=w.maxPitchScaleFactor(),X=h.tilesIn(g,O,C);X.sort(Jr);for(var J=[],me=0,be=X;me<be.length;me+=1){var Te=be[me];J.push({wrappedTileID:Te.tileID.wrapped().key,queryResults:Te.tile.queryRenderedFeatures(v,p,h._state,Te.queryGeometry,Te.cameraQueryGeometry,Te.scale,S,w,O,Vt(h.transform,Te.tileID))})}var je=function(lt){for(var Ne={},ot={},_t=0,Lt=lt;_t<Lt.length;_t+=1){var ir=Lt[_t],qt=ir.queryResults,cr=ir.wrappedTileID,br=ot[cr]=ot[cr]||{};for(var Hr in qt)for(var Fr=qt[Hr],hn=br[Hr]=br[Hr]||{},Un=Ne[Hr]=Ne[Hr]||[],Fn=0,zn=Fr;Fn<zn.length;Fn+=1){var zi=zn[Fn];hn[zi.featureIndex]||(hn[zi.featureIndex]=!0,Un.push(zi))}}return Ne}(J);for(var Ze in je)je[Ze].forEach(function(lt){var Ne=lt.feature,ot=h.getFeatureState(Ne.layer["source-layer"],Ne.id);Ne.source=Ne.layer.source,Ne.layer["source-layer"]&&(Ne.sourceLayer=Ne.layer["source-layer"]),Ne.state=ot});return je}function Jr(h,v){var p=h.tileID,g=v.tileID;return p.overscaledZ-g.overscaledZ||p.canonical.y-g.canonical.y||p.wrap-g.wrap||p.canonical.x-g.canonical.x}var on=function(h,v){this.max=h,this.onRemove=v,this.reset()};on.prototype.reset=function(){for(var h in this.data)for(var v=0,p=this.data[h];v<p.length;v+=1){var g=p[v];g.timeout&&clearTimeout(g.timeout),this.onRemove(g.value)}return this.data={},this.order=[],this},on.prototype.add=function(h,v,p){var g=this,S=h.wrapped().key;this.data[S]===void 0&&(this.data[S]=[]);var w={value:v,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},on.prototype.has=function(h){return h.wrapped().key in this.data},on.prototype.getAndRemove=function(h){return this.has(h)?this._getAndRemoveByKey(h.wrapped().key):null},on.prototype._getAndRemoveByKey=function(h){var v=this.data[h].shift();return v.timeout&&clearTimeout(v.timeout),this.data[h].length===0&&delete this.data[h],this.order.splice(this.order.indexOf(h),1),v.value},on.prototype.getByKey=function(h){var v=this.data[h];return v?v[0].value:null},on.prototype.get=function(h){return this.has(h)?this.data[h.wrapped().key][0].value:null},on.prototype.remove=function(h,v){if(!this.has(h))return this;var p=h.wrapped().key,g=v===void 0?0:this.data[p].indexOf(v),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},on.prototype.setMaxSize=function(h){for(this.max=h;this.order.length>this.max;){var v=this._getAndRemoveByKey(this.order[0]);v&&this.onRemove(v)}return this},on.prototype.filter=function(h){var v=[];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)||v.push(w)}for(var C=0,O=v;C<O.length;C+=1){var X=O[C];this.remove(X.value.tileID,X)}};var Mr=function(h,v,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,v.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete v.arrayBuffer};Mr.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Mr.prototype.updateData=function(h){var v=this.context.gl;this.context.unbindVAO(),this.bind(),v.bufferSubData(v.ELEMENT_ARRAY_BUFFER,0,h.arrayBuffer)},Mr.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Dn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},bn=function(h,v,p,g){this.length=v.length,this.attributes=p,this.itemSize=v.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,v.arrayBuffer,this.dynamicDraw?S.DYNAMIC_DRAW:S.STATIC_DRAW),this.dynamicDraw||delete v.arrayBuffer};bn.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},bn.prototype.updateData=function(h){var v=this.context.gl;this.bind(),v.bufferSubData(v.ARRAY_BUFFER,0,h.arrayBuffer)},bn.prototype.enableAttributes=function(h,v){for(var p=0;p<this.attributes.length;p++){var g=v.attributes[this.attributes[p].name];g!==void 0&&h.enableVertexAttribArray(g)}},bn.prototype.setVertexAttribPointers=function(h,v,p){for(var g=0;g<this.attributes.length;g++){var S=this.attributes[g],w=v.attributes[S.name];w!==void 0&&h.vertexAttribPointer(w,S.components,h[Dn[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 rn=function(h){this.gl=h.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};rn.prototype.get=function(){return this.current},rn.prototype.set=function(h){},rn.prototype.getDefault=function(){return this.default},rn.prototype.setDefault=function(){this.set(this.default)};var yi=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return y.Color.transparent},v.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)},v}(rn),ti=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return 1},v.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.clearDepth(p),this.current=p,this.dirty=!1)},v}(rn),Zi=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return 0},v.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.clearStencil(p),this.current=p,this.dirty=!1)},v}(rn),En=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return[!0,!0,!0,!0]},v.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)},v}(rn),Rn=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return!0},v.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.depthMask(p),this.current=p,this.dirty=!1)},v}(rn),sa=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return 255},v.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.stencilMask(p),this.current=p,this.dirty=!1)},v}(rn),ki=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},v.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)},v}(rn),ba=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){var p=this.gl;return[p.KEEP,p.KEEP,p.KEEP]},v.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)},v}(rn),fo=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.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}},v}(rn),Re=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return[0,1]},v.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)},v}(rn),Ea=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.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}},v}(rn),va=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return this.gl.LESS},v.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.depthFunc(p),this.current=p,this.dirty=!1)},v}(rn),Za=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.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}},v}(rn),Ms=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){var p=this.gl;return[p.ONE,p.ZERO]},v.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)},v}(rn),ho=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return y.Color.transparent},v.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)},v}(rn),Zo=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return this.gl.FUNC_ADD},v.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.blendEquation(p),this.current=p,this.dirty=!1)},v}(rn),jt=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.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}},v}(rn),pr=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return this.gl.BACK},v.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.cullFace(p),this.current=p,this.dirty=!1)},v}(rn),Vr=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return this.gl.CCW},v.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.frontFace(p),this.current=p,this.dirty=!1)},v}(rn),en=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.useProgram(p),this.current=p,this.dirty=!1)},v}(rn),Ln=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return this.gl.TEXTURE0},v.prototype.set=function(p){(p!==this.current||this.dirty)&&(this.gl.activeTexture(p),this.current=p,this.dirty=!1)},v}(rn),Gi=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){var p=this.gl;return[0,0,p.drawingBufferWidth,p.drawingBufferHeight]},v.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)},v}(rn),ue=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.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}},v}(rn),k=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.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}},v}(rn),z=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.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}},v}(rn),ae=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.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}},v}(rn),Ee=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.prototype.set=function(p){var g=this.gl;g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,p),this.current=p,this.dirty=!1},v}(rn),De=function(h){function v(p){h.call(this,p),this.vao=p.extVertexArrayObject}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v.prototype.set=function(p){this.vao&&(p!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(p),this.current=p,this.dirty=!1)},v}(rn),zt=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return 4},v.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}},v}(rn),Tt=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.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}},v}(rn),Rt=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return!1},v.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}},v}(rn),dt=function(h){function v(p,g){h.call(this,p),this.context=p,this.parent=g}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getDefault=function(){return null},v}(rn),N=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.setDirty=function(){this.dirty=!0},v.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}},v}(dt),B=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.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}},v}(dt),$=function(h,v,p,g){this.context=h,this.width=v,this.height=p;var S=this.framebuffer=h.gl.createFramebuffer();this.colorAttachment=new N(h,S),g&&(this.depthAttachment=new B(h,S))};$.prototype.destroy=function(){var h=this.context.gl,v=this.colorAttachment.get();if(v&&h.deleteTexture(v),this.depthAttachment){var p=this.depthAttachment.get();p&&h.deleteRenderbuffer(p)}h.deleteFramebuffer(this.framebuffer)};var ee=function(h,v,p){this.func=h,this.mask=v,this.range=p};ee.ReadOnly=!1,ee.ReadWrite=!0,ee.disabled=new ee(519,ee.ReadOnly,[0,1]);var xe=function(h,v,p,g,S,w){this.test=h,this.ref=v,this.mask=p,this.fail=g,this.depthFail=S,this.pass=w};xe.disabled=new xe({func:519,mask:0},0,0,7680,7680,7680);var Ue=function(h,v,p){this.blendFunction=h,this.blendColor=v,this.mask=p};Ue.disabled=new Ue(Ue.Replace=[1,0],y.Color.transparent,[!1,!1,!1,!1]),Ue.unblended=new Ue(Ue.Replace,y.Color.transparent,[!0,!0,!0,!0]),Ue.alphaBlended=new Ue([1,771],y.Color.transparent,[!0,!0,!0,!0]);var Qe=function(h,v,p){this.enable=h,this.mode=v,this.frontFace=p};Qe.disabled=new Qe(!1,1029,2305),Qe.backCCW=new Qe(!0,1029,2305);var j=function(h){this.gl=h,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new yi(this),this.clearDepth=new ti(this),this.clearStencil=new Zi(this),this.colorMask=new En(this),this.depthMask=new Rn(this),this.stencilMask=new sa(this),this.stencilFunc=new ki(this),this.stencilOp=new ba(this),this.stencilTest=new fo(this),this.depthRange=new Re(this),this.depthTest=new Ea(this),this.depthFunc=new va(this),this.blend=new Za(this),this.blendFunc=new Ms(this),this.blendColor=new ho(this),this.blendEquation=new Zo(this),this.cullFace=new jt(this),this.cullFaceSide=new pr(this),this.frontFace=new Vr(this),this.program=new en(this),this.activeTexture=new Ln(this),this.viewport=new Gi(this),this.bindFramebuffer=new ue(this),this.bindRenderbuffer=new k(this),this.bindTexture=new z(this),this.bindVertexBuffer=new ae(this),this.bindElementBuffer=new Ee(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new De(this),this.pixelStoreUnpack=new zt(this),this.pixelStoreUnpackPremultiplyAlpha=new Tt(this),this.pixelStoreUnpackFlipY=new Rt(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,v){return new Mr(this,h,v)},j.prototype.createVertexBuffer=function(h,v,p){return new bn(this,h,v,p)},j.prototype.createRenderbuffer=function(h,v,p){var g=this.gl,S=g.createRenderbuffer();return this.bindRenderbuffer.set(S),g.renderbufferStorage(g.RENDERBUFFER,h,v,p),this.bindRenderbuffer.set(null),S},j.prototype.createFramebuffer=function(h,v,p){return new $(this,h,v,p)},j.prototype.clear=function(h){var v=h.color,p=h.depth,g=this.gl,S=0;v&&(S|=g.COLOR_BUFFER_BIT,this.clearColor.set(v),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){y.deepEqual(h.blendFunction,Ue.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 v(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,O,X,J){var me=new Ge[O.type](C,O,X,J);if(me.id!==C)throw new Error("Expected Source id to be "+C+" instead of "+me.id);return y.bindAll(["load","abort","unload","serialize","prepare"],me),me}(p,g,S,this),this._tiles={},this._cache=new on(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new y.SourceFeatureState}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.onAdd=function(p){this.map=p,this._maxTileCacheSize=p?p._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(p)},v.prototype.onRemove=function(p){this._source&&this._source.onRemove&&this._source.onRemove(p)},v.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},v.prototype.getSource=function(){return this._source},v.prototype.pause=function(){this._paused=!0},v.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)}},v.prototype._loadTile=function(p,g){return this._source.loadTile(p,g)},v.prototype._unloadTile=function(p){if(this._source.unloadTile)return this._source.unloadTile(p,function(){})},v.prototype._abortTile=function(p){if(this._source.abortTile)return this._source.abortTile(p,function(){})},v.prototype.serialize=function(){return this._source.serialize()},v.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)}},v.prototype.getIds=function(){return y.values(this._tiles).map(function(p){return p.tileID}).sort(Fe).map(function(p){return p.key})},v.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,O){var X=C.tileID,J=O.tileID,me=new y.Point(X.canonical.x,X.canonical.y)._rotate(g.transform.angle),be=new y.Point(J.canonical.x,J.canonical.y)._rotate(g.transform.angle);return X.overscaledZ-J.overscaledZ||be.y-me.y||be.x-me.x}).map(function(C){return C.tileID.key}):S.map(function(C){return C.tileID}).sort(Fe).map(function(C){return C.key})},v.prototype.hasRenderableParent=function(p){var g=this.findLoadedParent(p,0);return!!g&&this._isIdRenderable(g.tileID.key)},v.prototype._isIdRenderable=function(p,g){return this._tiles[p]&&this._tiles[p].hasData()&&!this._coveredTiles[p]&&(g||!this._tiles[p].holdingForFade())},v.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")},v.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)))},v.prototype._tileLoaded=function(p,g,S,w){if(w)return p.state="errored",void(w.status!==404?this._source.fire(new y.ErrorEvent(w,{tile:p})):this.update(this.transform));p.timeAdded=y.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 y.Event("data",{dataType:"source",tile:p,coord:p.tileID}))},v.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);O(p,C),O(C,p)}}function O(X,J){X.needsHillshadePrepare=!0;var me=J.tileID.canonical.x-X.tileID.canonical.x,be=J.tileID.canonical.y-X.tileID.canonical.y,Te=Math.pow(2,X.tileID.canonical.z),je=J.tileID.key;me===0&&be===0||Math.abs(be)>1||(Math.abs(me)>1&&(Math.abs(me+Te)===1?me+=Te:Math.abs(me-Te)===1&&(me-=Te)),J.dem&&X.dem&&(X.dem.backfillBorder(J.dem,me,be),X.neighboringTiles&&X.neighboringTiles[je]&&(X.neighboringTiles[je].backfilled=!0)))}},v.prototype.getTile=function(p){return this.getTileByID(p.key)},v.prototype.getTileByID=function(p){return this._tiles[p]},v.prototype._retainLoadedChildren=function(p,g,S,w){for(var C in this._tiles){var O=this._tiles[C];if(!(w[C]||!O.hasData()||O.tileID.overscaledZ<=g||O.tileID.overscaledZ>S)){for(var X=O.tileID;O&&O.tileID.overscaledZ>g+1;){var J=O.tileID.scaledTo(O.tileID.overscaledZ-1);(O=this._tiles[J.key])&&O.hasData()&&(X=J)}for(var me=X;me.overscaledZ>g;)if(p[(me=me.scaledTo(me.overscaledZ-1)).key]){w[X.key]=X;break}}}},v.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),O=this._getLoadedTile(C);if(O)return O}},v.prototype._getLoadedTile=function(p){var g=this._tiles[p.key];return g&&g.hasData()?g:this._cache.getByKey(p.wrapped().key)},v.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)},v.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 O in this._tiles=S,this._timers)clearTimeout(this._timers[O]),delete this._timers[O];for(var X in this._tiles)this._setTileReloadTimer(X,this._tiles[X])}},v.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(br){return new y.OverscaledTileID(br.canonical.z,br.wrap,br.canonical.z,br.canonical.x,br.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(br){return g._source.hasTile(br)}))):S=[];var w=p.coveringZoomLevel(this._source),C=Math.max(w-v.maxOverzooming,this._source.minzoom),O=Math.max(w+v.maxUnderzooming,this._source.minzoom),X=this._updateRetainedTiles(S,w);if(et(this._source.type)){for(var J={},me={},be=0,Te=Object.keys(X);be<Te.length;be+=1){var je=Te[be],Ze=X[je],lt=this._tiles[je];if(lt&&!(lt.fadeEndTime&<.fadeEndTime<=y.browser.now())){var Ne=this.findLoadedParent(Ze,C);Ne&&(this._addTile(Ne.tileID),J[Ne.tileID.key]=Ne.tileID),me[je]=Ze}}for(var ot in this._retainLoadedChildren(me,w,O,X),J)X[ot]||(this._coveredTiles[ot]=!0,X[ot]=J[ot])}for(var _t in X)this._tiles[_t].clearFadeHold();for(var Lt=0,ir=y.keysDifference(this._tiles,X);Lt<ir.length;Lt+=1){var qt=ir[Lt],cr=this._tiles[qt];cr.hasSymbolBuckets&&!cr.holdingForFade()?cr.setHoldDuration(this.map._fadeDuration):cr.hasSymbolBuckets&&!cr.symbolFadeFinished()||this._removeTile(qt)}this._updateLoadedParentTileCache()}},v.prototype.releaseSymbolFadeTiles=function(){for(var p in this._tiles)this._tiles[p].holdingForFade()&&this._removeTile(p)},v.prototype._updateRetainedTiles=function(p,g){for(var S={},w={},C=Math.max(g-v.maxOverzooming,this._source.minzoom),O=Math.max(g+v.maxUnderzooming,this._source.minzoom),X={},J=0,me=p;J<me.length;J+=1){var be=me[J],Te=this._addTile(be);S[be.key]=be,Te.hasData()||g<this._source.maxzoom&&(X[be.key]=be)}this._retainLoadedChildren(X,g,O,S);for(var je=0,Ze=p;je<Ze.length;je+=1){var lt=Ze[je],Ne=this._tiles[lt.key];if(!Ne.hasData()){if(g+1>this._source.maxzoom){var ot=lt.children(this._source.maxzoom)[0],_t=this.getTile(ot);if(_t&&_t.hasData()){S[ot.key]=ot;continue}}else{var Lt=lt.children(this._source.maxzoom);if(S[Lt[0].key]&&S[Lt[1].key]&&S[Lt[2].key]&&S[Lt[3].key])continue}for(var ir=Ne.wasRequested(),qt=lt.overscaledZ-1;qt>=C;--qt){var cr=lt.scaledTo(qt);if(w[cr.key]||(w[cr.key]=!0,!(Ne=this.getTile(cr))&&ir&&(Ne=this._addTile(cr)),Ne&&(S[cr.key]=cr,ir=Ne.wasRequested(),Ne.hasData())))break}}}return S},v.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 O=0,X=g;O<X.length;O+=1)this._loadedParentTiles[X[O]]=S}},v.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 y.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 y.Event("dataloading",{tile:g,coord:g.tileID,dataType:"source"})),g):null},v.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))},v.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))))},v.prototype.clearTiles=function(){for(var p in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(p);this._cache.reset()},v.prototype.tilesIn=function(p,g,S){var w=this,C=[],O=this.transform;if(!O)return C;for(var X=S?O.getCameraQueryGeometry(p):p,J=p.map(function(qt){return O.pointCoordinate(qt)}),me=X.map(function(qt){return O.pointCoordinate(qt)}),be=this.getIds(),Te=1/0,je=1/0,Ze=-1/0,lt=-1/0,Ne=0,ot=me;Ne<ot.length;Ne+=1){var _t=ot[Ne];Te=Math.min(Te,_t.x),je=Math.min(je,_t.y),Ze=Math.max(Ze,_t.x),lt=Math.max(lt,_t.y)}for(var Lt=function(qt){var cr=w._tiles[be[qt]];if(!cr.holdingForFade()){var br=cr.tileID,Hr=Math.pow(2,O.zoom-cr.tileID.overscaledZ),Fr=g*cr.queryPadding*y.EXTENT/cr.tileSize/Hr,hn=[br.getTilePoint(new y.MercatorCoordinate(Te,je)),br.getTilePoint(new y.MercatorCoordinate(Ze,lt))];if(hn[0].x-Fr<y.EXTENT&&hn[0].y-Fr<y.EXTENT&&hn[1].x+Fr>=0&&hn[1].y+Fr>=0){var Un=J.map(function(zn){return br.getTilePoint(zn)}),Fn=me.map(function(zn){return br.getTilePoint(zn)});C.push({tile:cr,tileID:br,queryGeometry:Un,cameraQueryGeometry:Fn,scale:Hr})}}},ir=0;ir<be.length;ir++)Lt(ir);return C},v.prototype.getVisibleCoordinates=function(p){for(var g=this,S=this.getRenderableIds(p).map(function(X){return g._tiles[X].tileID}),w=0,C=S;w<C.length;w+=1){var O=C[w];O.posMatrix=this.transform.calculatePosMatrix(O.toUnwrapped())}return S},v.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(et(this._source.type))for(var p in this._tiles){var g=this._tiles[p];if(g.fadeEndTime!==void 0&&g.fadeEndTime>=y.browser.now())return!0}return!1},v.prototype.setFeatureState=function(p,g,S){this._state.updateState(p=p||"_geojsonTileLayer",g,S)},v.prototype.removeFeatureState=function(p,g,S){this._state.removeFeatureState(p=p||"_geojsonTileLayer",g,S)},v.prototype.getFeatureState=function(p,g){return this._state.getState(p=p||"_geojsonTileLayer",g)},v.prototype.setDependencies=function(p,g,S){var w=this._tiles[p];w&&w.setDependencies(g,S)},v.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)})},v}(y.Evented);function Fe(h,v){var p=Math.abs(2*h.wrap)-+(h.wrap<0),g=Math.abs(2*v.wrap)-+(v.wrap<0);return h.overscaledZ-v.overscaledZ||g-p||v.canonical.y-h.canonical.y||v.canonical.x-h.canonical.x}function et(h){return h==="raster"||h==="image"||h==="video"}function Ae(){return new y.window.Worker(wh.workerUrl)}Q.maxOverzooming=10,Q.maxUnderzooming=3;var $t="mapboxgl_preloaded_worker_pool",yr=function(){this.active={}};yr.prototype.acquire=function(h){if(!this.workers)for(this.workers=[];this.workers.length<yr.workerCount;)this.workers.push(new Ae);return this.active[h]=!0,this.workers.slice()},yr.prototype.release=function(h){delete this.active[h],this.numActive()===0&&(this.workers.forEach(function(v){v.terminate()}),this.workers=null)},yr.prototype.isPreloaded=function(){return!!this.active[$t]},yr.prototype.numActive=function(){return Object.keys(this.active).length};var nn,Qr=Math.floor(y.browser.hardwareConcurrency/2);function tr(){return nn||(nn=new yr),nn}function Xr(h,v){var p={};for(var g in h)g!=="ref"&&(p[g]=h[g]);return y.refProperties.forEach(function(S){S in v&&(p[S]=v[S])}),p}function zr(h){h=h.slice();for(var v=Object.create(null),p=0;p<h.length;p++)v[h[p].id]=h[p];for(var g=0;g<h.length;g++)"ref"in h[g]&&(h[g]=Xr(h[g],v[h[g].ref]));return h}yr.workerCount=Math.max(Math.min(Qr,6),1);var jr={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 Jn(h,v,p){p.push({command:jr.addSource,args:[h,v[h]]})}function ln(h,v,p){v.push({command:jr.removeSource,args:[h]}),p[h]=!0}function hi(h,v,p,g){ln(h,p,g),Jn(h,v,p)}function Vi(h,v,p){var g;for(g in h[p])if(h[p].hasOwnProperty(g)&&g!=="data"&&!y.deepEqual(h[p][g],v[p][g]))return!1;for(g in v[p])if(v[p].hasOwnProperty(g)&&g!=="data"&&!y.deepEqual(h[p][g],v[p][g]))return!1;return!0}function ci(h,v,p,g,S,w){var C;for(C in v=v||{},h=h||{})h.hasOwnProperty(C)&&(y.deepEqual(h[C],v[C])||p.push({command:w,args:[g,C,v[C],S]}));for(C in v)v.hasOwnProperty(C)&&!h.hasOwnProperty(C)&&(y.deepEqual(h[C],v[C])||p.push({command:w,args:[g,C,v[C],S]}))}function Li(h){return h.id}function Ei(h,v){return h[v.id]=v,h}var ns=function(h,v){this.reset(h,v)};ns.prototype.reset=function(h,v){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(v||0,.5*this.length),this.paddedLength=this.length-2*this.padding},ns.prototype.lerp=function(h){if(this.points.length===1)return this.points[0];h=y.clamp(h,0,1);for(var v=1,p=this._distances[v],g=h*this.paddedLength+this.padding;p<g&&v<this._distances.length;)p=this._distances[++v];var S=v-1,w=this._distances[S],C=p-w,O=C>0?(g-w)/C:0;return this.points[S].mult(1-O).add(this.points[v].mult(O))};var Qi=function(h,v,p){var g=this.boxCells=[],S=this.circleCells=[];this.xCellCount=Math.ceil(h/p),this.yCellCount=Math.ceil(v/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=v,this.xScale=this.xCellCount/h,this.yScale=this.yCellCount/v,this.boxUid=0,this.circleUid=0};function Pa(h,v,p,g,S){var w=y.create();return v?(y.scale(w,w,[1/S,1/S,1]),p||y.rotateZ(w,w,g.angle)):y.multiply(w,g.labelPlaneMatrix,h),w}function Si(h,v,p,g,S){if(v){var w=y.clone(h);return y.scale(w,w,[S,S,1]),p||y.rotateZ(w,w,-g.angle),w}return g.glCoordMatrix}function di(h,v){var p=[h.x,h.y,0,1];na(p,p,v);var g=p[3];return{point:new y.Point(p[0]/g,p[1]/g),signedDistanceFromCamera:g}}function Ai(h,v){return .5+h/v*.5}function Oa(h,v){var p=h[0]/h[3],g=h[1]/h[3];return p>=-v[0]&&p<=v[0]&&g>=-v[1]&&g<=v[1]}function vu(h,v,p,g,S,w,C,O){var X=g?h.textSizeData:h.iconSizeData,J=y.evaluateSizeForZoom(X,p.transform.zoom),me=[256/p.width*2+1,256/p.height*2+1],be=g?h.text.dynamicLayoutVertexArray:h.icon.dynamicLayoutVertexArray;be.clear();for(var Te=h.lineVertexArray,je=g?h.text.placedSymbolArray:h.icon.placedSymbolArray,Ze=p.transform.width/p.transform.height,lt=!1,Ne=0;Ne<je.length;Ne++){var ot=je.get(Ne);if(ot.hidden||ot.writingMode===y.WritingMode.vertical&&!lt)ka(ot.numGlyphs,be);else{lt=!1;var _t=[ot.anchorX,ot.anchorY,0,1];if(y.transformMat4(_t,_t,v),Oa(_t,me)){var Lt=Ai(p.transform.cameraToCenterDistance,_t[3]),ir=y.evaluateSizeForFeature(X,J,ot),qt=C?ir/Lt:ir*Lt,cr=new y.Point(ot.anchorX,ot.anchorY),br=di(cr,S).point,Hr={},Fr=Gl(ot,qt,!1,O,v,S,w,h.glyphOffsetArray,Te,be,br,cr,Hr,Ze);lt=Fr.useVertical,(Fr.notEnoughRoom||lt||Fr.needsFlipping&&Gl(ot,qt,!0,O,v,S,w,h.glyphOffsetArray,Te,be,br,cr,Hr,Ze).notEnoughRoom)&&ka(ot.numGlyphs,be)}else ka(ot.numGlyphs,be)}}g?h.text.dynamicLayoutVertexBuffer.updateData(be):h.icon.dynamicLayoutVertexBuffer.updateData(be)}function fa(h,v,p,g,S,w,C,O,X,J,me){var be=O.glyphStartIndex+O.numGlyphs,Te=O.lineStartIndex,je=O.lineStartIndex+O.lineLength,Ze=v.getoffsetX(O.glyphStartIndex),lt=v.getoffsetX(be-1),Ne=Ma(h*Ze,p,g,S,w,C,O.segment,Te,je,X,J,me);if(!Ne)return null;var ot=Ma(h*lt,p,g,S,w,C,O.segment,Te,je,X,J,me);return ot?{first:Ne,last:ot}:null}function Ra(h,v,p,g){return h===y.WritingMode.horizontal&&Math.abs(p.y-v.y)>Math.abs(p.x-v.x)*g?{useVertical:!0}:(h===y.WritingMode.vertical?v.y<p.y:v.x>p.x)?{needsFlipping:!0}:null}function Gl(h,v,p,g,S,w,C,O,X,J,me,be,Te,je){var Ze,lt=v/24,Ne=h.lineOffsetX*lt,ot=h.lineOffsetY*lt;if(h.numGlyphs>1){var _t=h.glyphStartIndex+h.numGlyphs,Lt=h.lineStartIndex,ir=h.lineStartIndex+h.lineLength,qt=fa(lt,O,Ne,ot,p,me,be,h,X,w,Te);if(!qt)return{notEnoughRoom:!0};var cr=di(qt.first.point,C).point,br=di(qt.last.point,C).point;if(g&&!p){var Hr=Ra(h.writingMode,cr,br,je);if(Hr)return Hr}Ze=[qt.first];for(var Fr=h.glyphStartIndex+1;Fr<_t-1;Fr++)Ze.push(Ma(lt*O.getoffsetX(Fr),Ne,ot,p,me,be,h.segment,Lt,ir,X,w,Te));Ze.push(qt.last)}else{if(g&&!p){var hn=di(be,S).point,Un=h.lineStartIndex+h.segment+1,Fn=new y.Point(X.getx(Un),X.gety(Un)),zn=di(Fn,S),zi=zn.signedDistanceFromCamera>0?zn.point:vs(be,Fn,hn,1,S),gn=Ra(h.writingMode,hn,zi,je);if(gn)return gn}var ii=Ma(lt*O.getoffsetX(h.glyphStartIndex),Ne,ot,p,me,be,h.segment,h.lineStartIndex,h.lineStartIndex+h.lineLength,X,w,Te);if(!ii)return{notEnoughRoom:!0};Ze=[ii]}for(var pi=0,ri=Ze;pi<ri.length;pi+=1){var Kn=ri[pi];y.addDynamicAttributes(J,Kn.point,Kn.angle)}return{}}function vs(h,v,p,g,S){var w=di(h.add(h.sub(v)._unit()),S).point,C=p.sub(w);return p.add(C._mult(g/C.mag()))}function Ma(h,v,p,g,S,w,C,O,X,J,me,be){var Te=g?h-v:h+v,je=Te>0?1:-1,Ze=0;g&&(je*=-1,Ze=Math.PI),je<0&&(Ze+=Math.PI);for(var lt=je>0?O+C:O+C+1,Ne=S,ot=S,_t=0,Lt=0,ir=Math.abs(Te),qt=[];_t+Lt<=ir;){if((lt+=je)<O||lt>=X)return null;if(ot=Ne,qt.push(Ne),(Ne=be[lt])===void 0){var cr=new y.Point(J.getx(lt),J.gety(lt)),br=di(cr,me);if(br.signedDistanceFromCamera>0)Ne=be[lt]=br.point;else{var Hr=lt-je;Ne=vs(_t===0?w:new y.Point(J.getx(Hr),J.gety(Hr)),cr,ot,ir-_t+1,me)}}_t+=Lt,Lt=ot.dist(Ne)}var Fr=(ir-_t)/Lt,hn=Ne.sub(ot),Un=hn.mult(Fr)._add(ot);Un._add(hn._unit()._perp()._mult(p*je));var Fn=Ze+Math.atan2(Ne.y-ot.y,Ne.x-ot.x);return qt.push(Un),{point:Un,angle:Fn,path:qt}}Qi.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Qi.prototype.insert=function(h,v,p,g,S){this._forEachCell(v,p,g,S,this._insertBoxCell,this.boxUid++),this.boxKeys.push(h),this.bboxes.push(v),this.bboxes.push(p),this.bboxes.push(g),this.bboxes.push(S)},Qi.prototype.insertCircle=function(h,v,p,g){this._forEachCell(v-g,p-g,v+g,p+g,this._insertCircleCell,this.circleUid++),this.circleKeys.push(h),this.circles.push(v),this.circles.push(p),this.circles.push(g)},Qi.prototype._insertBoxCell=function(h,v,p,g,S,w){this.boxCells[S].push(w)},Qi.prototype._insertCircleCell=function(h,v,p,g,S,w){this.circleCells[S].push(w)},Qi.prototype._query=function(h,v,p,g,S,w){if(p<0||h>this.width||g<0||v>this.height)return!S&&[];var C=[];if(h<=0&&v<=0&&this.width<=p&&this.height<=g){if(S)return!0;for(var O=0;O<this.boxKeys.length;O++)C.push({key:this.boxKeys[O],x1:this.bboxes[4*O],y1:this.bboxes[4*O+1],x2:this.bboxes[4*O+2],y2:this.bboxes[4*O+3]});for(var X=0;X<this.circleKeys.length;X++){var J=this.circles[3*X],me=this.circles[3*X+1],be=this.circles[3*X+2];C.push({key:this.circleKeys[X],x1:J-be,y1:me-be,x2:J+be,y2:me+be})}return w?C.filter(w):C}return this._forEachCell(h,v,p,g,this._queryCell,C,{hitTest:S,seenUids:{box:{},circle:{}}},w),S?C.length>0:C},Qi.prototype._queryCircle=function(h,v,p,g,S){var w=h-p,C=h+p,O=v-p,X=v+p;if(C<0||w>this.width||X<0||O>this.height)return!g&&[];var J=[];return this._forEachCell(w,O,C,X,this._queryCellCircle,J,{hitTest:g,circle:{x:h,y:v,radius:p},seenUids:{box:{},circle:{}}},S),g?J.length>0:J},Qi.prototype.query=function(h,v,p,g,S){return this._query(h,v,p,g,!1,S)},Qi.prototype.hitTest=function(h,v,p,g,S){return this._query(h,v,p,g,!0,S)},Qi.prototype.hitTestCircle=function(h,v,p,g){return this._queryCircle(h,v,p,!0,g)},Qi.prototype._queryCell=function(h,v,p,g,S,w,C,O){var X=C.seenUids,J=this.boxCells[S];if(J!==null)for(var me=this.bboxes,be=0,Te=J;be<Te.length;be+=1){var je=Te[be];if(!X.box[je]){X.box[je]=!0;var Ze=4*je;if(h<=me[Ze+2]&&v<=me[Ze+3]&&p>=me[Ze+0]&&g>=me[Ze+1]&&(!O||O(this.boxKeys[je]))){if(C.hitTest)return w.push(!0),!0;w.push({key:this.boxKeys[je],x1:me[Ze],y1:me[Ze+1],x2:me[Ze+2],y2:me[Ze+3]})}}}var lt=this.circleCells[S];if(lt!==null)for(var Ne=this.circles,ot=0,_t=lt;ot<_t.length;ot+=1){var Lt=_t[ot];if(!X.circle[Lt]){X.circle[Lt]=!0;var ir=3*Lt;if(this._circleAndRectCollide(Ne[ir],Ne[ir+1],Ne[ir+2],h,v,p,g)&&(!O||O(this.circleKeys[Lt]))){if(C.hitTest)return w.push(!0),!0;var qt=Ne[ir],cr=Ne[ir+1],br=Ne[ir+2];w.push({key:this.circleKeys[Lt],x1:qt-br,y1:cr-br,x2:qt+br,y2:cr+br})}}}},Qi.prototype._queryCellCircle=function(h,v,p,g,S,w,C,O){var X=C.circle,J=C.seenUids,me=this.boxCells[S];if(me!==null)for(var be=this.bboxes,Te=0,je=me;Te<je.length;Te+=1){var Ze=je[Te];if(!J.box[Ze]){J.box[Ze]=!0;var lt=4*Ze;if(this._circleAndRectCollide(X.x,X.y,X.radius,be[lt+0],be[lt+1],be[lt+2],be[lt+3])&&(!O||O(this.boxKeys[Ze])))return w.push(!0),!0}}var Ne=this.circleCells[S];if(Ne!==null)for(var ot=this.circles,_t=0,Lt=Ne;_t<Lt.length;_t+=1){var ir=Lt[_t];if(!J.circle[ir]){J.circle[ir]=!0;var qt=3*ir;if(this._circlesCollide(ot[qt],ot[qt+1],ot[qt+2],X.x,X.y,X.radius)&&(!O||O(this.circleKeys[ir])))return w.push(!0),!0}}},Qi.prototype._forEachCell=function(h,v,p,g,S,w,C,O){for(var X=this._convertToXCellCoord(h),J=this._convertToYCellCoord(v),me=this._convertToXCellCoord(p),be=this._convertToYCellCoord(g),Te=X;Te<=me;Te++)for(var je=J;je<=be;je++)if(S.call(this,h,v,p,g,this.xCellCount*je+Te,w,C,O))return},Qi.prototype._convertToXCellCoord=function(h){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(h*this.xScale)))},Qi.prototype._convertToYCellCoord=function(h){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(h*this.yScale)))},Qi.prototype._circlesCollide=function(h,v,p,g,S,w){var C=g-h,O=S-v,X=p+w;return X*X>C*C+O*O},Qi.prototype._circleAndRectCollide=function(h,v,p,g,S,w,C){var O=(w-g)/2,X=Math.abs(h-(g+O));if(X>O+p)return!1;var J=(C-S)/2,me=Math.abs(v-(S+J));if(me>J+p)return!1;if(X<=O||me<=J)return!0;var be=X-O,Te=me-J;return be*be+Te*Te<=p*p};var vi=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ka(h,v){for(var p=0;p<h;p++){var g=v.length;v.resize(g+4),v.float32.set(vi,3*g)}}function na(h,v,p){var g=v[0],S=v[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 Vo=function(h,v,p){v===void 0&&(v=new Qi(h.width+200,h.height+200,25)),p===void 0&&(p=new Qi(h.width+200,h.height+200,25)),this.transform=h,this.grid=v,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 ca(h,v,p){return v*(y.EXTENT/(h.tileSize*Math.pow(2,p-h.tileID.overscaledZ)))}Vo.prototype.placeCollisionBox=function(h,v,p,g,S){var w=this.projectAndGetPerspectiveRatio(g,h.anchorPointX,h.anchorPointY),C=p*w.perspectiveRatio,O=h.x1*C+w.point.x,X=h.y1*C+w.point.y,J=h.x2*C+w.point.x,me=h.y2*C+w.point.y;return!this.isInsideGrid(O,X,J,me)||!v&&this.grid.hitTest(O,X,J,me,S)?{box:[],offscreen:!1}:{box:[O,X,J,me],offscreen:this.isOffscreen(O,X,J,me)}},Vo.prototype.placeCollisionCircles=function(h,v,p,g,S,w,C,O,X,J,me,be,Te){var je=[],Ze=new y.Point(v.anchorX,v.anchorY),lt=di(Ze,w),Ne=Ai(this.transform.cameraToCenterDistance,lt.signedDistanceFromCamera),ot=(J?S/Ne:S*Ne)/y.ONE_EM,_t=di(Ze,C).point,Lt=fa(ot,g,v.lineOffsetX*ot,v.lineOffsetY*ot,!1,_t,Ze,v,p,C,{}),ir=!1,qt=!1,cr=!0;if(Lt){for(var br=.5*be*Ne+Te,Hr=new y.Point(-100,-100),Fr=new y.Point(this.screenRightBoundary,this.screenBottomBoundary),hn=new ns,Un=Lt.first,Fn=Lt.last,zn=[],zi=Un.path.length-1;zi>=1;zi--)zn.push(Un.path[zi]);for(var gn=1;gn<Fn.path.length;gn++)zn.push(Fn.path[gn]);var ii=2.5*br;if(O){var pi=zn.map(function(Vs){return di(Vs,O)});zn=pi.some(function(Vs){return Vs.signedDistanceFromCamera<=0})?[]:pi.map(function(Vs){return Vs.point})}var ri=[];if(zn.length>0){for(var Kn=zn[0].clone(),fi=zn[0].clone(),Qn=1;Qn<zn.length;Qn++)Kn.x=Math.min(Kn.x,zn[Qn].x),Kn.y=Math.min(Kn.y,zn[Qn].y),fi.x=Math.max(fi.x,zn[Qn].x),fi.y=Math.max(fi.y,zn[Qn].y);ri=Kn.x>=Hr.x&&fi.x<=Fr.x&&Kn.y>=Hr.y&&fi.y<=Fr.y?[zn]:fi.x<Hr.x||Kn.x>Fr.x||fi.y<Hr.y||Kn.y>Fr.y?[]:y.clipLine([zn],Hr.x,Hr.y,Fr.x,Fr.y)}for(var Gn=0,Io=ri;Gn<Io.length;Gn+=1){var Qa;hn.reset(Io[Gn],.25*br),Qa=hn.length<=.5*br?1:Math.ceil(hn.paddedLength/ii)+1;for(var Po=0;Po<Qa;Po++){var _o=Po/Math.max(Qa-1,1),Wa=hn.lerp(_o),Ja=Wa.x+100,bs=Wa.y+100;je.push(Ja,bs,br,0);var Es=Ja-br,fl=bs-br,Ss=Ja+br,lu=bs+br;if(cr=cr&&this.isOffscreen(Es,fl,Ss,lu),qt=qt||this.isInsideGrid(Es,fl,Ss,lu),!h&&this.grid.hitTestCircle(Ja,bs,br,me)&&(ir=!0,!X))return{circles:[],offscreen:!1,collisionDetected:ir}}}}return{circles:!X&&ir||!qt?[]:je,offscreen:cr,collisionDetected:ir}},Vo.prototype.queryRenderedSymbols=function(h){if(h.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var v=[],p=1/0,g=1/0,S=-1/0,w=-1/0,C=0,O=h;C<O.length;C+=1){var X=O[C],J=new y.Point(X.x+100,X.y+100);p=Math.min(p,J.x),g=Math.min(g,J.y),S=Math.max(S,J.x),w=Math.max(w,J.y),v.push(J)}for(var me={},be={},Te=0,je=this.grid.query(p,g,S,w).concat(this.ignoredGrid.query(p,g,S,w));Te<je.length;Te+=1){var Ze=je[Te],lt=Ze.key;if(me[lt.bucketInstanceId]===void 0&&(me[lt.bucketInstanceId]={}),!me[lt.bucketInstanceId][lt.featureIndex]){var Ne=[new y.Point(Ze.x1,Ze.y1),new y.Point(Ze.x2,Ze.y1),new y.Point(Ze.x2,Ze.y2),new y.Point(Ze.x1,Ze.y2)];y.polygonIntersectsPolygon(v,Ne)&&(me[lt.bucketInstanceId][lt.featureIndex]=!0,be[lt.bucketInstanceId]===void 0&&(be[lt.bucketInstanceId]=[]),be[lt.bucketInstanceId].push(lt.featureIndex))}}return be},Vo.prototype.insertCollisionBox=function(h,v,p,g,S){(v?this.ignoredGrid:this.grid).insert({bucketInstanceId:p,featureIndex:g,collisionGroupID:S},h[0],h[1],h[2],h[3])},Vo.prototype.insertCollisionCircles=function(h,v,p,g,S){for(var w=v?this.ignoredGrid:this.grid,C={bucketInstanceId:p,featureIndex:g,collisionGroupID:S},O=0;O<h.length;O+=4)w.insertCircle(C,h[O],h[O+1],h[O+2])},Vo.prototype.projectAndGetPerspectiveRatio=function(h,v,p){var g=[v,p,0,1];return na(g,g,h),{point:new y.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}},Vo.prototype.isOffscreen=function(h,v,p,g){return p<100||h>=this.screenRightBoundary||g<100||v>this.screenBottomBoundary},Vo.prototype.isInsideGrid=function(h,v,p,g){return p>=0&&h<this.gridRightBoundary&&g>=0&&v<this.gridBottomBoundary},Vo.prototype.getViewportMatrix=function(){var h=y.identity([]);return y.translate(h,h,[-100,-100,0]),h};var is=function(h,v,p,g){this.opacity=h?Math.max(0,Math.min(1,h.opacity+(h.placed?v:-v))):g&&p?1:0,this.placed=p};is.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var qo=function(h,v,p,g,S){this.text=new is(h?h.text:null,v,p,S),this.icon=new is(h?h.icon:null,v,g,S)};qo.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Du=function(h,v,p){this.text=h,this.icon=v,this.skipFade=p},ms=function(){this.invProjMatrix=y.create(),this.viewportMatrix=y.create(),this.circles=[]},yc=function(h,v,p,g,S){this.bucketInstanceId=h,this.featureIndex=v,this.sourceLayerIndex=p,this.bucketIndex=g,this.tileID=S},Sa=function(h){this.crossSourceCollisions=h,this.maxGroupID=0,this.collisionGroups={}};function Ji(h,v,p,g,S){var w=y.getAnchorAlignment(h),C=-(w.horizontalAlign-.5)*v,O=-(w.verticalAlign-.5)*p,X=y.evaluateVariableOffset(h,g);return new y.Point(C+X[0]*S,O+X[1]*S)}function Qt(h,v,p,g,S,w){var C=h.x1,O=h.x2,X=h.y1,J=h.y2,me=h.anchorPointX,be=h.anchorPointY,Te=new y.Point(v,p);return g&&Te._rotate(S?w:-w),{x1:C+Te.x,y1:X+Te.y,x2:O+Te.x,y2:J+Te.y,anchorPointX:me,anchorPointY:be}}Sa.prototype.get=function(h){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[h]){var v=++this.maxGroupID;this.collisionGroups[h]={ID:v,predicate:function(p){return p.collisionGroupID===v}}}return this.collisionGroups[h]};var _n=function(h,v,p,g){this.transform=h.clone(),this.collisionIndex=new Vo(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=v,this.retainedQueryData={},this.collisionGroups=new Sa(p),this.collisionCircleArrays={},this.prevPlacement=g,g&&(g.prevPlacement=void 0),this.placedOrientations={}};function ge(h,v,p,g,S){h.emplaceBack(v?1:0,p?1:0,g||0,S||0),h.emplaceBack(v?1:0,p?1:0,g||0,S||0),h.emplaceBack(v?1:0,p?1:0,g||0,S||0),h.emplaceBack(v?1:0,p?1:0,g||0,S||0)}_n.prototype.getBucketParts=function(h,v,p,g){var S=p.getBucket(v),w=p.latestFeatureIndex;if(S&&w&&v.id===S.layerIds[0]){var C=p.collisionBoxArray,O=S.layers[0].layout,X=Math.pow(2,this.transform.zoom-p.tileID.overscaledZ),J=p.tileSize/y.EXTENT,me=this.transform.calculatePosMatrix(p.tileID.toUnwrapped()),be=O.get("text-pitch-alignment")==="map",Te=O.get("text-rotation-alignment")==="map",je=ca(p,1,this.transform.zoom),Ze=Pa(me,be,Te,this.transform,je),lt=null;if(be){var Ne=Si(me,be,Te,this.transform,je);lt=y.multiply([],this.transform.labelPlaneMatrix,Ne)}this.retainedQueryData[S.bucketInstanceId]=new yc(S.bucketInstanceId,w,S.sourceLayerIndex,S.index,p.tileID);var ot={bucket:S,layout:O,posMatrix:me,textLabelPlaneMatrix:Ze,labelToScreenMatrix:lt,scale:X,textPixelRatio:J,holdingForFade:p.holdingForFade(),collisionBoxArray:C,partiallyEvaluatedTextSize:y.evaluateSizeForZoom(S.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(S.sourceID)};if(g)for(var _t=0,Lt=S.sortKeyRanges;_t<Lt.length;_t+=1){var ir=Lt[_t];h.push({sortKey:ir.sortKey,symbolInstanceStart:ir.symbolInstanceStart,symbolInstanceEnd:ir.symbolInstanceEnd,parameters:ot})}else h.push({symbolInstanceStart:0,symbolInstanceEnd:S.symbolInstances.length,parameters:ot})}},_n.prototype.attemptAnchorPlacement=function(h,v,p,g,S,w,C,O,X,J,me,be,Te,je,Ze){var lt,Ne=[be.textOffset0,be.textOffset1],ot=Ji(h,p,g,Ne,S),_t=this.collisionIndex.placeCollisionBox(Qt(v,ot.x,ot.y,w,C,this.transform.angle),me,O,X,J.predicate);if(!Ze||this.collisionIndex.placeCollisionBox(Qt(Ze,ot.x,ot.y,w,C,this.transform.angle),me,O,X,J.predicate).box.length!==0)return _t.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[be.crossTileID]&&this.prevPlacement.placements[be.crossTileID]&&this.prevPlacement.placements[be.crossTileID].text&&(lt=this.prevPlacement.variableOffsets[be.crossTileID].anchor),this.variableOffsets[be.crossTileID]={textOffset:Ne,width:p,height:g,anchor:h,textBoxScale:S,prevAnchor:lt},this.markUsedJustification(Te,h,be,je),Te.allowVerticalPlacement&&(this.markUsedOrientation(Te,je,be),this.placedOrientations[be.crossTileID]=je),{shift:ot,placedGlyphBoxes:_t}):void 0},_n.prototype.placeLayerBucketPart=function(h,v,p){var g=this,S=h.parameters,w=S.bucket,C=S.layout,O=S.posMatrix,X=S.textLabelPlaneMatrix,J=S.labelToScreenMatrix,me=S.textPixelRatio,be=S.holdingForFade,Te=S.collisionBoxArray,je=S.partiallyEvaluatedTextSize,Ze=S.collisionGroup,lt=C.get("text-optional"),Ne=C.get("icon-optional"),ot=C.get("text-allow-overlap"),_t=C.get("icon-allow-overlap"),Lt=C.get("text-rotation-alignment")==="map",ir=C.get("text-pitch-alignment")==="map",qt=C.get("icon-text-fit")!=="none",cr=C.get("symbol-z-order")==="viewport-y",br=ot&&(_t||!w.hasIconData()||Ne),Hr=_t&&(ot||!w.hasTextData()||lt);!w.collisionArrays&&Te&&w.deserializeCollisionBoxes(Te);var Fr=function(gn,ii){if(!v[gn.crossTileID])if(be)g.placements[gn.crossTileID]=new Du(!1,!1,!1);else{var pi,ri=!1,Kn=!1,fi=!0,Qn=null,Gn={box:null,offscreen:null},Io={box:null,offscreen:null},Qa=null,Po=null,_o=0,Wa=0,Ja=0;ii.textFeatureIndex?_o=ii.textFeatureIndex:gn.useRuntimeCollisionCircles&&(_o=gn.featureIndex),ii.verticalTextFeatureIndex&&(Wa=ii.verticalTextFeatureIndex);var bs=ii.textBox;if(bs){var Es=function(Fi){var Jo=y.WritingMode.horizontal;if(w.allowVerticalPlacement&&!Fi&&g.prevPlacement){var oo=g.prevPlacement.placedOrientations[gn.crossTileID];oo&&(g.placedOrientations[gn.crossTileID]=oo,g.markUsedOrientation(w,Jo=oo,gn))}return Jo},fl=function(Fi,Jo){if(w.allowVerticalPlacement&&gn.numVerticalGlyphVertices>0&&ii.verticalTextBox)for(var oo=0,hu=w.writingModes;oo<hu.length&&(hu[oo]===y.WritingMode.vertical?(Gn=Jo(),Io=Gn):Gn=Fi(),!(Gn&&Gn.box&&Gn.box.length));oo+=1);else Gn=Fi()};if(C.get("text-variable-anchor")){var Ss=C.get("text-variable-anchor");if(g.prevPlacement&&g.prevPlacement.variableOffsets[gn.crossTileID]){var lu=g.prevPlacement.variableOffsets[gn.crossTileID];Ss.indexOf(lu.anchor)>0&&(Ss=Ss.filter(function(Fi){return Fi!==lu.anchor})).unshift(lu.anchor)}var Vs=function(Fi,Jo,oo){for(var hu=Fi.x2-Fi.x1,Ic=Fi.y2-Fi.y1,Wu=gn.textBoxScale,Ch=qt&&!_t?Jo:null,ko={box:[],offscreen:!1},Dr=ot?2*Ss.length:Ss.length,js=0;js<Dr;++js){var Rh=g.attemptAnchorPlacement(Ss[js%Ss.length],Fi,hu,Ic,Wu,Lt,ir,me,O,Ze,js>=Ss.length,gn,w,oo,Ch);if(Rh&&(ko=Rh.placedGlyphBoxes)&&ko.box&&ko.box.length){ri=!0,Qn=Rh.shift;break}}return ko};fl(function(){return Vs(bs,ii.iconBox,y.WritingMode.horizontal)},function(){var Fi=ii.verticalTextBox;return w.allowVerticalPlacement&&!(Gn&&Gn.box&&Gn.box.length)&&gn.numVerticalGlyphVertices>0&&Fi?Vs(Fi,ii.verticalIconBox,y.WritingMode.vertical):{box:null,offscreen:null}}),Gn&&(ri=Gn.box,fi=Gn.offscreen);var Mc=Es(Gn&&Gn.box);if(!ri&&g.prevPlacement){var Hu=g.prevPlacement.variableOffsets[gn.crossTileID];Hu&&(g.variableOffsets[gn.crossTileID]=Hu,g.markUsedJustification(w,Hu.anchor,gn,Mc))}}else{var Tu=function(Fi,Jo){var oo=g.collisionIndex.placeCollisionBox(Fi,ot,me,O,Ze.predicate);return oo&&oo.box&&oo.box.length&&(g.markUsedOrientation(w,Jo,gn),g.placedOrientations[gn.crossTileID]=Jo),oo};fl(function(){return Tu(bs,y.WritingMode.horizontal)},function(){var Fi=ii.verticalTextBox;return w.allowVerticalPlacement&&gn.numVerticalGlyphVertices>0&&Fi?Tu(Fi,y.WritingMode.vertical):{box:null,offscreen:null}}),Es(Gn&&Gn.box&&Gn.box.length)}}if(ri=(pi=Gn)&&pi.box&&pi.box.length>0,fi=pi&&pi.offscreen,gn.useRuntimeCollisionCircles){var nc=w.text.placedSymbolArray.get(gn.centerJustifiedTextSymbolIndex),hl=y.evaluateSizeForFeature(w.textSizeData,je,nc),cu=C.get("text-padding");Qa=g.collisionIndex.placeCollisionCircles(ot,nc,w.lineVertexArray,w.glyphOffsetArray,hl,O,X,J,p,ir,Ze.predicate,gn.collisionCircleDiameter,cu),ri=ot||Qa.circles.length>0&&!Qa.collisionDetected,fi=fi&&Qa.offscreen}if(ii.iconFeatureIndex&&(Ja=ii.iconFeatureIndex),ii.iconBox){var pl=function(Fi){var Jo=qt&&Qn?Qt(Fi,Qn.x,Qn.y,Lt,ir,g.transform.angle):Fi;return g.collisionIndex.placeCollisionBox(Jo,_t,me,O,Ze.predicate)};Kn=Io&&Io.box&&Io.box.length&&ii.verticalIconBox?(Po=pl(ii.verticalIconBox)).box.length>0:(Po=pl(ii.iconBox)).box.length>0,fi=fi&&Po.offscreen}var Oo=lt||gn.numHorizontalGlyphVertices===0&&gn.numVerticalGlyphVertices===0,ao=Ne||gn.numIconVertices===0;if(Oo||ao?ao?Oo||(Kn=Kn&&ri):ri=Kn&&ri:Kn=ri=Kn&&ri,ri&&pi&&pi.box&&g.collisionIndex.insertCollisionBox(pi.box,C.get("text-ignore-placement"),w.bucketInstanceId,Io&&Io.box&&Wa?Wa:_o,Ze.ID),Kn&&Po&&g.collisionIndex.insertCollisionBox(Po.box,C.get("icon-ignore-placement"),w.bucketInstanceId,Ja,Ze.ID),Qa&&(ri&&g.collisionIndex.insertCollisionCircles(Qa.circles,C.get("text-ignore-placement"),w.bucketInstanceId,_o,Ze.ID),p)){var Ps=w.bucketInstanceId,fu=g.collisionCircleArrays[Ps];fu===void 0&&(fu=g.collisionCircleArrays[Ps]=new ms);for(var wu=0;wu<Qa.circles.length;wu+=4)fu.circles.push(Qa.circles[wu+0]),fu.circles.push(Qa.circles[wu+1]),fu.circles.push(Qa.circles[wu+2]),fu.circles.push(Qa.collisionDetected?1:0)}g.placements[gn.crossTileID]=new Du(ri||br,Kn||Hr,fi||w.justReloaded),v[gn.crossTileID]=!0}};if(cr)for(var hn=w.getSortedSymbolIndexes(this.transform.angle),Un=hn.length-1;Un>=0;--Un){var Fn=hn[Un];Fr(w.symbolInstances.get(Fn),w.collisionArrays[Fn])}else for(var zn=h.symbolInstanceStart;zn<h.symbolInstanceEnd;zn++)Fr(w.symbolInstances.get(zn),w.collisionArrays[zn]);if(p&&w.bucketInstanceId in this.collisionCircleArrays){var zi=this.collisionCircleArrays[w.bucketInstanceId];y.invert(zi.invProjMatrix,O),zi.viewportMatrix=this.collisionIndex.getViewportMatrix()}w.justReloaded=!1},_n.prototype.markUsedJustification=function(h,v,p,g){var S;S=g===y.WritingMode.vertical?p.verticalPlacedTextSymbolIndex:{left:p.leftJustifiedTextSymbolIndex,center:p.centerJustifiedTextSymbolIndex,right:p.rightJustifiedTextSymbolIndex}[y.getAnchorJustification(v)];for(var w=0,C=[p.leftJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.rightJustifiedTextSymbolIndex,p.verticalPlacedTextSymbolIndex];w<C.length;w+=1){var O=C[w];O>=0&&(h.text.placedSymbolArray.get(O).crossTileID=S>=0&&O!==S?0:p.crossTileID)}},_n.prototype.markUsedOrientation=function(h,v,p){for(var g=v===y.WritingMode.horizontal||v===y.WritingMode.horizontalOnly?v:0,S=v===y.WritingMode.vertical?v: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)},_n.prototype.commit=function(h){this.commitTime=h,this.zoomAtLastRecencyCheck=this.transform.zoom;var v=this.prevPlacement,p=!1;this.prevZoomAdjustment=v?v.zoomAdjustment(this.transform.zoom):0;var g=v?v.symbolFadeChange(h):1,S=v?v.opacities:{},w=v?v.variableOffsets:{},C=v?v.placedOrientations:{};for(var O in this.placements){var X=this.placements[O],J=S[O];J?(this.opacities[O]=new qo(J,g,X.text,X.icon),p=p||X.text!==J.text.placed||X.icon!==J.icon.placed):(this.opacities[O]=new qo(null,g,X.text,X.icon,X.skipFade),p=p||X.text||X.icon)}for(var me in S){var be=S[me];if(!this.opacities[me]){var Te=new qo(be,g,!1,!1);Te.isHidden()||(this.opacities[me]=Te,p=p||be.text.placed||be.icon.placed)}}for(var je in w)this.variableOffsets[je]||!this.opacities[je]||this.opacities[je].isHidden()||(this.variableOffsets[je]=w[je]);for(var Ze in C)this.placedOrientations[Ze]||!this.opacities[Ze]||this.opacities[Ze].isHidden()||(this.placedOrientations[Ze]=C[Ze]);p?this.lastPlacementChangeTime=h:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=v?v.lastPlacementChangeTime:h)},_n.prototype.updateLayerOpacities=function(h,v){for(var p={},g=0,S=v;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)}},_n.prototype.updateBucketOpacities=function(h,v,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 qo(null,0,!1,!1,!0),C=S.get("text-allow-overlap"),O=S.get("icon-allow-overlap"),X=S.get("text-variable-anchor"),J=S.get("text-rotation-alignment")==="map",me=S.get("text-pitch-alignment")==="map",be=S.get("icon-text-fit")!=="none",Te=new qo(null,0,C&&(O||!h.hasIconData()||S.get("icon-optional")),O&&(C||!h.hasTextData()||S.get("text-optional")),!0);!h.collisionArrays&&p&&(h.hasIconCollisionBoxData()||h.hasTextCollisionBoxData())&&h.deserializeCollisionBoxes(p);for(var je=function(ot,_t,Lt){for(var ir=0;ir<_t/4;ir++)ot.opacityVertexArray.emplaceBack(Lt)},Ze=function(ot){var _t=h.symbolInstances.get(ot),Lt=_t.numHorizontalGlyphVertices,ir=_t.numVerticalGlyphVertices,qt=_t.crossTileID,cr=g.opacities[qt];v[qt]?cr=w:cr||(g.opacities[qt]=cr=Te),v[qt]=!0;var br=_t.numIconVertices>0,Hr=g.placedOrientations[_t.crossTileID],Fr=Hr===y.WritingMode.vertical,hn=Hr===y.WritingMode.horizontal||Hr===y.WritingMode.horizontalOnly;if(Lt>0||ir>0){var Un=Co(cr.text);je(h.text,Lt,Fr?po:Un),je(h.text,ir,hn?po:Un);var Fn=cr.text.isHidden();[_t.rightJustifiedTextSymbolIndex,_t.centerJustifiedTextSymbolIndex,_t.leftJustifiedTextSymbolIndex].forEach(function(Gn){Gn>=0&&(h.text.placedSymbolArray.get(Gn).hidden=Fn||Fr?1:0)}),_t.verticalPlacedTextSymbolIndex>=0&&(h.text.placedSymbolArray.get(_t.verticalPlacedTextSymbolIndex).hidden=Fn||hn?1:0);var zn=g.variableOffsets[_t.crossTileID];zn&&g.markUsedJustification(h,zn.anchor,_t,Hr);var zi=g.placedOrientations[_t.crossTileID];zi&&(g.markUsedJustification(h,"left",_t,zi),g.markUsedOrientation(h,zi,_t))}if(br){var gn=Co(cr.icon),ii=!(be&&_t.verticalPlacedIconSymbolIndex&&Fr);_t.placedIconSymbolIndex>=0&&(je(h.icon,_t.numIconVertices,ii?gn:po),h.icon.placedSymbolArray.get(_t.placedIconSymbolIndex).hidden=cr.icon.isHidden()),_t.verticalPlacedIconSymbolIndex>=0&&(je(h.icon,_t.numVerticalIconVertices,ii?po:gn),h.icon.placedSymbolArray.get(_t.verticalPlacedIconSymbolIndex).hidden=cr.icon.isHidden())}if(h.hasIconCollisionBoxData()||h.hasTextCollisionBoxData()){var pi=h.collisionArrays[ot];if(pi){var ri=new y.Point(0,0);if(pi.textBox||pi.verticalTextBox){var Kn=!0;if(X){var fi=g.variableOffsets[qt];fi?(ri=Ji(fi.anchor,fi.width,fi.height,fi.textOffset,fi.textBoxScale),J&&ri._rotate(me?g.transform.angle:-g.transform.angle)):Kn=!1}pi.textBox&&ge(h.textCollisionBox.collisionVertexArray,cr.text.placed,!Kn||Fr,ri.x,ri.y),pi.verticalTextBox&&ge(h.textCollisionBox.collisionVertexArray,cr.text.placed,!Kn||hn,ri.x,ri.y)}var Qn=!!(!hn&&pi.verticalIconBox);pi.iconBox&&ge(h.iconCollisionBox.collisionVertexArray,cr.icon.placed,Qn,be?ri.x:0,be?ri.y:0),pi.verticalIconBox&&ge(h.iconCollisionBox.collisionVertexArray,cr.icon.placed,!Qn,be?ri.x:0,be?ri.y:0)}}},lt=0;lt<h.symbolInstances.length;lt++)Ze(lt);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 Ne=this.collisionCircleArrays[h.bucketInstanceId];h.placementInvProjMatrix=Ne.invProjMatrix,h.placementViewportMatrix=Ne.viewportMatrix,h.collisionCircleArray=Ne.circles,delete this.collisionCircleArrays[h.bucketInstanceId]}},_n.prototype.symbolFadeChange=function(h){return this.fadeDuration===0?1:(h-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},_n.prototype.zoomAdjustment=function(h){return Math.max(0,(this.transform.zoom-h)/1.5)},_n.prototype.hasTransitions=function(h){return this.stale||h-this.lastPlacementChangeTime<this.fadeDuration},_n.prototype.stillRecent=function(h,v){var p=this.zoomAtLastRecencyCheck===v?1-this.zoomAdjustment(v):1;return this.zoomAtLastRecencyCheck=v,this.commitTime+this.fadeDuration*p>h},_n.prototype.setStale=function(){this.stale=!0};var ke=Math.pow(2,25),gt=Math.pow(2,24),lr=Math.pow(2,17),Kr=Math.pow(2,16),kn=Math.pow(2,9),ji=Math.pow(2,8),go=Math.pow(2,1);function Co(h){if(h.opacity===0&&!h.placed)return 0;if(h.opacity===1&&h.placed)return 4294967295;var v=h.placed?1:0,p=Math.floor(127*h.opacity);return p*ke+v*gt+p*lr+v*Kr+p*kn+v*ji+p*go+v}var po=0,Ls=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=[]};Ls.prototype.continuePlacement=function(h,v,p,g,S){for(var w=this._bucketParts;this._currentTileIndex<h.length;)if(v.getBucketParts(w,g,h[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,S())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,w.sort(function(C,O){return C.sortKey-O.sortKey}));this._currentPartIndex<w.length;)if(v.placeLayerBucketPart(w[this._currentPartIndex],this._seenCrossTileIDs,p),this._currentPartIndex++,S())return!0;return!1};var Is=function(h,v,p,g,S,w,C){this.placement=new _n(h,S,w,C),this._currentPlacementIndex=v.length-1,this._forceFullPlacement=p,this._showCollisionBoxes=g,this._done=!1};Is.prototype.isDone=function(){return this._done},Is.prototype.continuePlacement=function(h,v,p){for(var g=this,S=y.browser.now(),w=function(){var X=y.browser.now()-S;return!g._forceFullPlacement&&X>2};this._currentPlacementIndex>=0;){var C=v[h[this._currentPlacementIndex]],O=this.placement.collisionIndex.transform.zoom;if(C.type==="symbol"&&(!C.minzoom||C.minzoom<=O)&&(!C.maxzoom||C.maxzoom>O)){if(this._inProgressLayer||(this._inProgressLayer=new Ls(C)),this._inProgressLayer.continuePlacement(p[C.source],this.placement,this._showCollisionBoxes,C,w))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Is.prototype.commit=function(h){return this.placement.commit(h),this.placement};var ep=512/y.EXTENT/2,Af=function(h,v,p){this.tileID=h,this.indexedSymbolInstances={},this.bucketInstanceId=p;for(var g=0;g<v.length;g++){var S=v.get(g),w=S.key;this.indexedSymbolInstances[w]||(this.indexedSymbolInstances[w]=[]),this.indexedSymbolInstances[w].push({crossTileID:S.crossTileID,coord:this.getScaledCoordinates(S,h)})}};Af.prototype.getScaledCoordinates=function(h,v){var p=ep/Math.pow(2,v.canonical.z-this.tileID.canonical.z);return{x:Math.floor((v.canonical.x*y.EXTENT+h.anchorX)*p),y:Math.floor((v.canonical.y*y.EXTENT+h.anchorY)*p)}},Af.prototype.findMatches=function(h,v,p){for(var g=this.tileID.canonical.z<v.canonical.z?1:Math.pow(2,this.tileID.canonical.z-v.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 O=this.getScaledCoordinates(w,v),X=0,J=C;X<J.length;X+=1){var me=J[X];if(Math.abs(me.coord.x-O.x)<=g&&Math.abs(me.coord.y-O.y)<=g&&!p[me.crossTileID]){p[me.crossTileID]=!0,w.crossTileID=me.crossTileID;break}}}}};var Ko=function(){this.maxCrossTileID=0};Ko.prototype.generate=function(){return++this.maxCrossTileID};var El=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};El.prototype.handleWrapJump=function(h){var v=Math.round((h-this.lng)/360);if(v!==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+v),S[C.tileID.key]=C}this.indexes[p]=S}this.lng=h},El.prototype.addBucket=function(h,v,p){if(this.indexes[h.overscaledZ]&&this.indexes[h.overscaledZ][h.key]){if(this.indexes[h.overscaledZ][h.key].bucketInstanceId===v.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(h.overscaledZ,this.indexes[h.overscaledZ][h.key])}for(var g=0;g<v.symbolInstances.length;g++)v.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 O in C){var X=C[O];X.tileID.isChildOf(h)&&X.findMatches(v.symbolInstances,h,S)}else{var J=C[h.scaledTo(Number(w)).key];J&&J.findMatches(v.symbolInstances,h,S)}}for(var me=0;me<v.symbolInstances.length;me++){var be=v.symbolInstances.get(me);be.crossTileID||(be.crossTileID=p.generate(),S[be.crossTileID]=!0)}return this.indexes[h.overscaledZ]===void 0&&(this.indexes[h.overscaledZ]={}),this.indexes[h.overscaledZ][h.key]=new Af(h,v.symbolInstances,v.bucketInstanceId),!0},El.prototype.removeBucketCrossTileIDs=function(h,v){for(var p in v.indexedSymbolInstances)for(var g=0,S=v.indexedSymbolInstances[p];g<S.length;g+=1)delete this.usedCrossTileIDs[h][S[g].crossTileID]},El.prototype.removeStaleBuckets=function(h){var v=!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],v=!0)}return v};var Sl=function(){this.layerIndexes={},this.crossTileIDs=new Ko,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Sl.prototype.addLayer=function(h,v,p){var g=this.layerIndexes[h.id];g===void 0&&(g=this.layerIndexes[h.id]=new El);var S=!1,w={};g.handleWrapJump(p);for(var C=0,O=v;C<O.length;C+=1){var X=O[C],J=X.getBucket(h);J&&h.id===J.layerIds[0]&&(J.bucketInstanceId||(J.bucketInstanceId=++this.maxBucketInstanceId),g.addBucket(X.tileID,J,this.crossTileIDs)&&(S=!0),w[J.bucketInstanceId]=!0)}return g.removeStaleBuckets(w)&&(S=!0),S},Sl.prototype.pruneUnusedLayers=function(h){var v={};for(var p in h.forEach(function(g){v[g]=!0}),this.layerIndexes)v[p]||delete this.layerIndexes[p]};var Lu=function(h,v){return y.emitValidationErrors(h,v&&v.filter(function(p){return p.identifier!=="source.canvas"}))},Bu=y.pick(jr,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ju=y.pick(jr,["setCenter","setZoom","setBearing","setPitch"]),$c=function(){var h={},v=y.styleSpec.$version;for(var p in y.styleSpec.$root){var g,S=y.styleSpec.$root[p];S.required&&(g=p==="version"?v:S.type==="array"?[]:{})!=null&&(h[p]=g)}return h}(),Bs=function(h){function v(p,g){var S=this;g===void 0&&(g={}),h.call(this),this.map=p,this.dispatcher=new Dt(tr(),this),this.imageManager=new Yt,this.imageManager.setEventedParent(this),this.glyphManager=new fr(p._requestManager,g.localIdeographFontFamily),this.lineAtlas=new qe(256,512),this.crossTileSymbolIndex=new Sl,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new y.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",y.getReferrer());var w=this;this._rtlTextPluginCallback=v.registerForPluginStateChange(function(C){w.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:C.pluginStatus,pluginURL:C.pluginURL},function(O,X){if(y.triggerPluginCompletionEvent(O),X&&X.every(function(me){return me}))for(var J in w.sourceCaches)w.sourceCaches[J].reload()})}),this.on("data",function(C){if(C.dataType==="source"&&C.sourceDataType==="metadata"){var O=S.sourceCaches[C.sourceId];if(O){var X=O.getSource();if(X&&X.vectorLayerIds)for(var J in S._layers){var me=S._layers[J];me.source===X.id&&S._validateLayer(me)}}}})}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.loadURL=function(p,g){var S=this;g===void 0&&(g={}),this.fire(new y.Event("dataloading",{dataType:"style"}));var w=typeof g.validate=="boolean"?g.validate:!y.isMapboxURL(p);p=this.map._requestManager.normalizeStyleURL(p,g.accessToken);var C=this.map._requestManager.transformRequest(p,y.ResourceType.Style);this._request=y.getJSON(C,function(O,X){S._request=null,O?S.fire(new y.ErrorEvent(O)):X&&S._load(X,w)})},v.prototype.loadJSON=function(p,g){var S=this;g===void 0&&(g={}),this.fire(new y.Event("dataloading",{dataType:"style"})),this._request=y.browser.frame(function(){S._request=null,S._load(p,g.validate!==!1)})},v.prototype.loadEmpty=function(){this.fire(new y.Event("dataloading",{dataType:"style"})),this._load($c,!1)},v.prototype._load=function(p,g){if(!g||!Lu(this,y.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=zr(this.stylesheet.layers);this._order=w.map(function(J){return J.id}),this._layers={},this._serializedLayers={};for(var C=0,O=w;C<O.length;C+=1){var X=O[C];(X=y.createStyleLayer(X)).setEventedParent(this,{layer:{id:X.id}}),this._layers[X.id]=X,this._serializedLayers[X.id]=X.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new kt(this.stylesheet.light),this.fire(new y.Event("data",{dataType:"style"})),this.fire(new y.Event("style.load"))}},v.prototype._loadSprite=function(p){var g=this;this._spriteRequest=function(S,w,C){var O,X,J,me=y.browser.devicePixelRatio>1?"@2x":"",be=y.getJSON(w.transformRequest(w.normalizeSpriteURL(S,me,".json"),y.ResourceType.SpriteJSON),function(Ze,lt){be=null,J||(J=Ze,O=lt,je())}),Te=y.getImage(w.transformRequest(w.normalizeSpriteURL(S,me,".png"),y.ResourceType.SpriteImage),function(Ze,lt){Te=null,J||(J=Ze,X=lt,je())});function je(){if(J)C(J);else if(O&&X){var Ze=y.browser.getImageData(X),lt={};for(var Ne in O){var ot=O[Ne],_t=ot.width,Lt=ot.height,ir=ot.x,qt=ot.y,cr=ot.sdf,br=ot.pixelRatio,Hr=ot.stretchX,Fr=ot.stretchY,hn=ot.content,Un=new y.RGBAImage({width:_t,height:Lt});y.RGBAImage.copy(Ze,Un,{x:ir,y:qt},{x:0,y:0},{width:_t,height:Lt}),lt[Ne]={data:Un,pixelRatio:br,sdf:cr,stretchX:Hr,stretchY:Fr,content:hn}}C(null,lt)}}return{cancel:function(){be&&(be.cancel(),be=null),Te&&(Te.cancel(),Te=null)}}}(p,this.map._requestManager,function(S,w){if(g._spriteRequest=null,S)g.fire(new y.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 y.Event("data",{dataType:"style"}))})},v.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 y.ErrorEvent(new Error('Source layer "'+S+'" does not exist on source "'+w.id+'" as specified by style layer "'+p.id+'"')))}}},v.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()},v.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},v.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},v.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},v.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 O=this._updatedSources[C];O==="reload"?this._reloadSource(C):O==="clear"&&this._clearSource(C)}for(var X in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[X].updateTransitions(p);this.light.updateTransitions(p),this._resetUpdates()}var J={};for(var me in this.sourceCaches){var be=this.sourceCaches[me];J[me]=be.used,be.used=!1}for(var Te=0,je=this._order;Te<je.length;Te+=1){var Ze=this._layers[je[Te]];Ze.recalculate(p,this._availableImages),!Ze.isHidden(p.zoom)&&Ze.source&&(this.sourceCaches[Ze.source].used=!0)}for(var lt in J){var Ne=this.sourceCaches[lt];J[lt]!==Ne.used&&Ne.fire(new y.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:lt}))}this.light.recalculate(p),this.z=p.zoom,g&&this.fire(new y.Event("data",{dataType:"style"}))}},v.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={}}},v.prototype._updateWorkerLayers=function(p,g){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(p),removedIds:g})},v.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},v.prototype.setState=function(p){var g=this;if(this._checkLoaded(),Lu(this,y.validateStyle(p)))return!1;(p=y.clone$1(p)).layers=zr(p.layers);var S=function(C,O){if(!C)return[{command:jr.setStyle,args:[O]}];var X=[];try{if(!y.deepEqual(C.version,O.version))return[{command:jr.setStyle,args:[O]}];y.deepEqual(C.center,O.center)||X.push({command:jr.setCenter,args:[O.center]}),y.deepEqual(C.zoom,O.zoom)||X.push({command:jr.setZoom,args:[O.zoom]}),y.deepEqual(C.bearing,O.bearing)||X.push({command:jr.setBearing,args:[O.bearing]}),y.deepEqual(C.pitch,O.pitch)||X.push({command:jr.setPitch,args:[O.pitch]}),y.deepEqual(C.sprite,O.sprite)||X.push({command:jr.setSprite,args:[O.sprite]}),y.deepEqual(C.glyphs,O.glyphs)||X.push({command:jr.setGlyphs,args:[O.glyphs]}),y.deepEqual(C.transition,O.transition)||X.push({command:jr.setTransition,args:[O.transition]}),y.deepEqual(C.light,O.light)||X.push({command:jr.setLight,args:[O.light]});var J={},me=[];(function(Te,je,Ze,lt){var Ne;for(Ne in je=je||{},Te=Te||{})Te.hasOwnProperty(Ne)&&(je.hasOwnProperty(Ne)||ln(Ne,Ze,lt));for(Ne in je)je.hasOwnProperty(Ne)&&(Te.hasOwnProperty(Ne)?y.deepEqual(Te[Ne],je[Ne])||(Te[Ne].type==="geojson"&&je[Ne].type==="geojson"&&Vi(Te,je,Ne)?Ze.push({command:jr.setGeoJSONSourceData,args:[Ne,je[Ne].data]}):hi(Ne,je,Ze,lt)):Jn(Ne,je,Ze))})(C.sources,O.sources,me,J);var be=[];C.layers&&C.layers.forEach(function(Te){J[Te.source]?X.push({command:jr.removeLayer,args:[Te.id]}):be.push(Te)}),X=X.concat(me),function(Te,je,Ze){je=je||[];var lt,Ne,ot,_t,Lt,ir,qt,cr=(Te=Te||[]).map(Li),br=je.map(Li),Hr=Te.reduce(Ei,{}),Fr=je.reduce(Ei,{}),hn=cr.slice(),Un=Object.create(null);for(lt=0,Ne=0;lt<cr.length;lt++)Fr.hasOwnProperty(ot=cr[lt])?Ne++:(Ze.push({command:jr.removeLayer,args:[ot]}),hn.splice(hn.indexOf(ot,Ne),1));for(lt=0,Ne=0;lt<br.length;lt++)hn[hn.length-1-lt]!==(ot=br[br.length-1-lt])&&(Hr.hasOwnProperty(ot)?(Ze.push({command:jr.removeLayer,args:[ot]}),hn.splice(hn.lastIndexOf(ot,hn.length-Ne),1)):Ne++,Ze.push({command:jr.addLayer,args:[Fr[ot],ir=hn[hn.length-lt]]}),hn.splice(hn.length-lt,0,ot),Un[ot]=!0);for(lt=0;lt<br.length;lt++)if(_t=Hr[ot=br[lt]],Lt=Fr[ot],!Un[ot]&&!y.deepEqual(_t,Lt))if(y.deepEqual(_t.source,Lt.source)&&y.deepEqual(_t["source-layer"],Lt["source-layer"])&&y.deepEqual(_t.type,Lt.type)){for(qt in ci(_t.layout,Lt.layout,Ze,ot,null,jr.setLayoutProperty),ci(_t.paint,Lt.paint,Ze,ot,null,jr.setPaintProperty),y.deepEqual(_t.filter,Lt.filter)||Ze.push({command:jr.setFilter,args:[ot,Lt.filter]}),y.deepEqual(_t.minzoom,Lt.minzoom)&&y.deepEqual(_t.maxzoom,Lt.maxzoom)||Ze.push({command:jr.setLayerZoomRange,args:[ot,Lt.minzoom,Lt.maxzoom]}),_t)_t.hasOwnProperty(qt)&&qt!=="layout"&&qt!=="paint"&&qt!=="filter"&&qt!=="metadata"&&qt!=="minzoom"&&qt!=="maxzoom"&&(qt.indexOf("paint.")===0?ci(_t[qt],Lt[qt],Ze,ot,qt.slice(6),jr.setPaintProperty):y.deepEqual(_t[qt],Lt[qt])||Ze.push({command:jr.setLayerProperty,args:[ot,qt,Lt[qt]]}));for(qt in Lt)Lt.hasOwnProperty(qt)&&!_t.hasOwnProperty(qt)&&qt!=="layout"&&qt!=="paint"&&qt!=="filter"&&qt!=="metadata"&&qt!=="minzoom"&&qt!=="maxzoom"&&(qt.indexOf("paint.")===0?ci(_t[qt],Lt[qt],Ze,ot,qt.slice(6),jr.setPaintProperty):y.deepEqual(_t[qt],Lt[qt])||Ze.push({command:jr.setLayerProperty,args:[ot,qt,Lt[qt]]}))}else Ze.push({command:jr.removeLayer,args:[ot]}),ir=hn[hn.lastIndexOf(ot)+1],Ze.push({command:jr.addLayer,args:[Lt,ir]})}(be,O.layers,X)}catch(Te){console.warn("Unable to compute style diff:",Te),X=[{command:jr.setStyle,args:[O]}]}return X}(this.serialize(),p).filter(function(C){return!(C.command in Ju)});if(S.length===0)return!1;var w=S.filter(function(C){return!(C.command in Bu)});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},v.prototype.addImage=function(p,g){if(this.getImage(p))return this.fire(new y.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(p,g),this._afterImageUpdated(p)},v.prototype.updateImage=function(p,g){this.imageManager.updateImage(p,g)},v.prototype.getImage=function(p){return this.imageManager.getImage(p)},v.prototype.removeImage=function(p){if(!this.getImage(p))return this.fire(new y.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(p),this._afterImageUpdated(p)},v.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 y.Event("data",{dataType:"style"}))},v.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},v.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(y.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}},v.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 y.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 y.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:p})),S.setEventedParent(null),S.clearTiles(),S.onRemove&&S.onRemove(this.map),this._changed=!0},v.prototype.setGeoJSONSourceData=function(p,g){this._checkLoaded(),this.sourceCaches[p].getSource().setData(g),this._changed=!0},v.prototype.getSource=function(p){return this.sourceCaches[p]&&this.sourceCaches[p].getSource()},v.prototype.addLayer=function(p,g,S){S===void 0&&(S={}),this._checkLoaded();var w=p.id;if(this.getLayer(w))this.fire(new y.ErrorEvent(new Error('Layer with id "'+w+'" already exists on this map')));else{var C;if(p.type==="custom"){if(Lu(this,y.validateCustomStyleLayer(p)))return;C=y.createStyleLayer(p)}else{if(typeof p.source=="object"&&(this.addSource(w,p.source),p=y.clone$1(p),p=y.extend(p,{source:w})),this._validate(y.validateStyle.layer,"layers."+w,p,{arrayIndex:-1},S))return;C=y.createStyleLayer(p),this._validateLayer(C),C.setEventedParent(this,{layer:{id:w}}),this._serializedLayers[C.id]=C.serialize()}var O=g?this._order.indexOf(g):this._order.length;if(g&&O===-1)this.fire(new y.ErrorEvent(new Error('Layer with id "'+g+'" does not exist on this map.')));else{if(this._order.splice(O,0,w),this._layerOrderChanged=!0,this._layers[w]=C,this._removedLayers[w]&&C.source&&C.type!=="custom"){var X=this._removedLayers[w];delete this._removedLayers[w],X.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)}}},v.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 y.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 y.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be moved.")))},v.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 y.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be removed.")))},v.prototype.getLayer=function(p){return this._layers[p]},v.prototype.hasLayer=function(p){return p in this._layers},v.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 y.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot have zoom extent.")))},v.prototype.setFilter=function(p,g,S){S===void 0&&(S={}),this._checkLoaded();var w=this.getLayer(p);if(w){if(!y.deepEqual(w.filter,g))return g==null?(w.filter=void 0,void this._updateLayer(w)):void(this._validate(y.validateStyle.filter,"layers."+w.id+".filter",g,null,S)||(w.filter=y.clone$1(g),this._updateLayer(w)))}else this.fire(new y.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be filtered.")))},v.prototype.getFilter=function(p){return y.clone$1(this.getLayer(p).filter)},v.prototype.setLayoutProperty=function(p,g,S,w){w===void 0&&(w={}),this._checkLoaded();var C=this.getLayer(p);C?y.deepEqual(C.getLayoutProperty(g),S)||(C.setLayoutProperty(g,S,w),this._updateLayer(C)):this.fire(new y.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be styled.")))},v.prototype.getLayoutProperty=function(p,g){var S=this.getLayer(p);if(S)return S.getLayoutProperty(g);this.fire(new y.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style.")))},v.prototype.setPaintProperty=function(p,g,S,w){w===void 0&&(w={}),this._checkLoaded();var C=this.getLayer(p);C?y.deepEqual(C.getPaintProperty(g),S)||(C.setPaintProperty(g,S,w)&&this._updateLayer(C),this._changed=!0,this._updatedPaintProps[p]=!0):this.fire(new y.ErrorEvent(new Error("The layer '"+p+"' does not exist in the map's style and cannot be styled.")))},v.prototype.getPaintProperty=function(p,g){return this.getLayer(p).getPaintProperty(g)},v.prototype.setFeatureState=function(p,g){this._checkLoaded();var S=p.source,w=p.sourceLayer,C=this.sourceCaches[S];if(C!==void 0){var O=C.getSource().type;O==="geojson"&&w?this.fire(new y.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):O!=="vector"||w?(p.id===void 0&&this.fire(new y.ErrorEvent(new Error("The feature id parameter must be provided."))),C.setFeatureState(w,p.id,g)):this.fire(new y.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new y.ErrorEvent(new Error("The source '"+S+"' does not exist in the map's style.")))},v.prototype.removeFeatureState=function(p,g){this._checkLoaded();var S=p.source,w=this.sourceCaches[S];if(w!==void 0){var C=w.getSource().type,O=C==="vector"?p.sourceLayer:void 0;C!=="vector"||O?g&&typeof p.id!="string"&&typeof p.id!="number"?this.fire(new y.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):w.removeFeatureState(O,p.id,g):this.fire(new y.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new y.ErrorEvent(new Error("The source '"+S+"' does not exist in the map's style.")))},v.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 y.ErrorEvent(new Error("The feature id parameter must be provided."))),w.getFeatureState(S,p.id);this.fire(new y.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new y.ErrorEvent(new Error("The source '"+g+"' does not exist in the map's style.")))},v.prototype.getTransition=function(){return y.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},v.prototype.serialize=function(){return y.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:y.mapObject(this.sourceCaches,function(p){return p.serialize()}),layers:this._serializeLayers(this._order)},function(p){return p!==void 0})},v.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},v.prototype._flattenAndSortRenderedFeatures=function(p){for(var g=this,S=function(Hr){return g._layers[Hr].type==="fill-extrusion"},w={},C=[],O=this._order.length-1;O>=0;O--){var X=this._order[O];if(S(X)){w[X]=O;for(var J=0,me=p;J<me.length;J+=1){var be=me[J][X];if(be)for(var Te=0,je=be;Te<je.length;Te+=1)C.push(je[Te])}}}C.sort(function(Hr,Fr){return Fr.intersectionZ-Hr.intersectionZ});for(var Ze=[],lt=this._order.length-1;lt>=0;lt--){var Ne=this._order[lt];if(S(Ne))for(var ot=C.length-1;ot>=0;ot--){var _t=C[ot].feature;if(w[_t.layer.id]<lt)break;Ze.push(_t),C.pop()}else for(var Lt=0,ir=p;Lt<ir.length;Lt+=1){var qt=ir[Lt][Ne];if(qt)for(var cr=0,br=qt;cr<br.length;cr+=1)Ze.push(br[cr].feature)}}return Ze},v.prototype.queryRenderedFeatures=function(p,g,S){g&&g.filter&&this._validate(y.validateStyle.filter,"queryRenderedFeatures.filter",g.filter,null,g);var w={};if(g&&g.layers){if(!Array.isArray(g.layers))return this.fire(new y.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var C=0,O=g.layers;C<O.length;C+=1){var X=O[C],J=this._layers[X];if(!J)return this.fire(new y.ErrorEvent(new Error("The layer '"+X+"' does not exist in the map's style and cannot be queried for features."))),[];w[J.source]=!0}}var me=[];for(var be in g.availableImages=this._availableImages,this.sourceCaches)g.layers&&!w[be]||me.push(Et(this.sourceCaches[be],this._layers,this._serializedLayers,p,g,S));return this.placement&&me.push(function(Te,je,Ze,lt,Ne,ot,_t){for(var Lt={},ir=ot.queryRenderedSymbols(lt),qt=[],cr=0,br=Object.keys(ir).map(Number);cr<br.length;cr+=1)qt.push(_t[br[cr]]);qt.sort(Jr);for(var Hr=function(){var zn=hn[Fr],zi=zn.featureIndex.lookupSymbolFeatures(ir[zn.bucketInstanceId],je,zn.bucketIndex,zn.sourceLayerIndex,Ne.filter,Ne.layers,Ne.availableImages,Te);for(var gn in zi){var ii=Lt[gn]=Lt[gn]||[],pi=zi[gn];pi.sort(function(fi,Qn){var Gn=zn.featureSortOrder;if(Gn){var Io=Gn.indexOf(fi.featureIndex);return Gn.indexOf(Qn.featureIndex)-Io}return Qn.featureIndex-fi.featureIndex});for(var ri=0,Kn=pi;ri<Kn.length;ri+=1)ii.push(Kn[ri])}},Fr=0,hn=qt;Fr<hn.length;Fr+=1)Hr();var Un=function(zn){Lt[zn].forEach(function(zi){var gn=zi.feature,ii=Ze[Te[zn].source].getFeatureState(gn.layer["source-layer"],gn.id);gn.source=gn.layer.source,gn.layer["source-layer"]&&(gn.sourceLayer=gn.layer["source-layer"]),gn.state=ii})};for(var Fn in Lt)Un(Fn);return Lt}(this._layers,this._serializedLayers,this.sourceCaches,p,g,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(me)},v.prototype.querySourceFeatures=function(p,g){g&&g.filter&&this._validate(y.validateStyle.filter,"querySourceFeatures.filter",g.filter,null,g);var S=this.sourceCaches[p];return S?function(w,C){for(var O=w.getRenderableIds().map(function(je){return w.getTileByID(je)}),X=[],J={},me=0;me<O.length;me++){var be=O[me],Te=be.tileID.canonical.key;J[Te]||(J[Te]=!0,be.querySourceFeatures(X,C))}return X}(S,g):[]},v.prototype.addSourceType=function(p,g,S){return v.getSourceType(p)?S(new Error('A source type called "'+p+'" already exists.')):(v.setSourceType(p,g),g.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:p,url:g.workerSourceURL},S):S(null,null))},v.prototype.getLight=function(){return this.light.getLight()},v.prototype.setLight=function(p,g){g===void 0&&(g={}),this._checkLoaded();var S=this.light.getLight(),w=!1;for(var C in p)if(!y.deepEqual(p[C],S[C])){w=!0;break}if(w){var O={now:y.browser.now(),transition:y.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(p,g),this.light.updateTransitions(O)}},v.prototype._validate=function(p,g,S,w,C){return C===void 0&&(C={}),(!C||C.validate!==!1)&&Lu(this,p.call(y.validateStyle,y.extend({key:g,style:this.serialize(),value:S,styleSpec:y.styleSpec},w)))},v.prototype._remove=function(){for(var p in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),y.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()},v.prototype._clearSource=function(p){this.sourceCaches[p].clearTiles()},v.prototype._reloadSource=function(p){this.sourceCaches[p].resume(),this.sourceCaches[p].reload()},v.prototype._updateSources=function(p){for(var g in this.sourceCaches)this.sourceCaches[g].update(p)},v.prototype._generateCollisionBoxes=function(){for(var p in this.sourceCaches)this._reloadSource(p)},v.prototype._updatePlacement=function(p,g,S,w,C){C===void 0&&(C=!1);for(var O=!1,X=!1,J={},me=0,be=this._order;me<be.length;me+=1){var Te=this._layers[be[me]];if(Te.type==="symbol"){if(!J[Te.source]){var je=this.sourceCaches[Te.source];J[Te.source]=je.getRenderableIds(!0).map(function(_t){return je.getTileByID(_t)}).sort(function(_t,Lt){return Lt.tileID.overscaledZ-_t.tileID.overscaledZ||(_t.tileID.isLessThan(Lt.tileID)?-1:1)})}var Ze=this.crossTileSymbolIndex.addLayer(Te,J[Te.source],p.center.lng);O=O||Ze}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((C=C||this._layerOrderChanged||S===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(y.browser.now(),p.zoom))&&(this.pauseablePlacement=new Is(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,J),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(y.browser.now()),X=!0),O&&this.pauseablePlacement.placement.setStale()),X||O)for(var lt=0,Ne=this._order;lt<Ne.length;lt+=1){var ot=this._layers[Ne[lt]];ot.type==="symbol"&&this.placement.updateLayerOpacities(ot,J[ot.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(y.browser.now())},v.prototype._releaseSymbolFadeTiles=function(){for(var p in this.sourceCaches)this.sourceCaches[p].releaseSymbolFadeTiles()},v.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)},v.prototype.getGlyphs=function(p,g,S){this.glyphManager.getGlyphs(g.stacks,S)},v.prototype.getResource=function(p,g,S){return y.makeRequest(g,S)},v}(y.Evented);Bs.getSourceType=function(h){return Ge[h]},Bs.setSourceType=function(h,v){Ge[h]=v},Bs.registerForPluginStateChange=y.registerForPluginStateChange;var qa=y.createLayout([{name:"a_pos",type:"Int16",components:2}]),Al=Ci(`#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;}`),el=Ci(`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);}"),Tf=Ci(`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);}"),tp=Ci(`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);}`),wf=Ci("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);}"),hh=Ci(`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;}`),ph=Ci(`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;}"),dh=Ci("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;}"),rp=Ci("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);}"),np=Ci("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=Ci(`#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);}`),Yc=Ci(`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;}`),Fu=Ci(`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;}`),ip=Ci(`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);}`),Qo=Ci(`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;}`),Xl=Ci(`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;}`),Tl=Ci(`#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;}"),Ks=Ci(`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;}"),wl=Ci(`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);}`),ui=Ci(`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);}`),tl=Ci(`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;}`),Fs=Ci(`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);}`),Nu=Ci(`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;}"),rl=Ci(`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));}`),ap=Ci(`#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);}`),Yi=Ci(`#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 Ci(h,v){var p=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,g=v.match(/attribute ([\w]+) ([\w]+)/g),S=h.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),w=v.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),C=w?w.concat(S):S,O={};return{fragmentSource:h=h.replace(p,function(X,J,me,be,Te){return O[Te]=!0,J==="define"?`
|
|
#ifndef HAS_UNIFORM_u_`+Te+`
|
|
varying `+me+" "+be+" "+Te+`;
|
|
#else
|
|
uniform `+me+" "+be+" u_"+Te+`;
|
|
#endif
|
|
`:`
|
|
#ifdef HAS_UNIFORM_u_`+Te+`
|
|
`+me+" "+be+" "+Te+" = u_"+Te+`;
|
|
#endif
|
|
`}),vertexSource:v=v.replace(p,function(X,J,me,be,Te){var je=be==="float"?"vec2":"vec4",Ze=Te.match(/color/)?"color":je;return O[Te]?J==="define"?`
|
|
#ifndef HAS_UNIFORM_u_`+Te+`
|
|
uniform lowp float u_`+Te+`_t;
|
|
attribute `+me+" "+je+" a_"+Te+`;
|
|
varying `+me+" "+be+" "+Te+`;
|
|
#else
|
|
uniform `+me+" "+be+" u_"+Te+`;
|
|
#endif
|
|
`:Ze==="vec4"?`
|
|
#ifndef HAS_UNIFORM_u_`+Te+`
|
|
`+Te+" = a_"+Te+`;
|
|
#else
|
|
`+me+" "+be+" "+Te+" = u_"+Te+`;
|
|
#endif
|
|
`:`
|
|
#ifndef HAS_UNIFORM_u_`+Te+`
|
|
`+Te+" = unpack_mix_"+Ze+"(a_"+Te+", u_"+Te+`_t);
|
|
#else
|
|
`+me+" "+be+" "+Te+" = u_"+Te+`;
|
|
#endif
|
|
`:J==="define"?`
|
|
#ifndef HAS_UNIFORM_u_`+Te+`
|
|
uniform lowp float u_`+Te+`_t;
|
|
attribute `+me+" "+je+" a_"+Te+`;
|
|
#else
|
|
uniform `+me+" "+be+" u_"+Te+`;
|
|
#endif
|
|
`:Ze==="vec4"?`
|
|
#ifndef HAS_UNIFORM_u_`+Te+`
|
|
`+me+" "+be+" "+Te+" = a_"+Te+`;
|
|
#else
|
|
`+me+" "+be+" "+Te+" = u_"+Te+`;
|
|
#endif
|
|
`:`
|
|
#ifndef HAS_UNIFORM_u_`+Te+`
|
|
`+me+" "+be+" "+Te+" = unpack_mix_"+Ze+"(a_"+Te+", u_"+Te+`_t);
|
|
#else
|
|
`+me+" "+be+" "+Te+" = u_"+Te+`;
|
|
#endif
|
|
`}),staticAttributes:g,staticUniforms:C}}var ou=Object.freeze({__proto__:null,prelude:Al,background:el,backgroundPattern:Tf,circle:tp,clippingMask:wf,heatmap:hh,heatmapTexture:ph,collisionBox:dh,collisionCircle:rp,debug:np,fill:zp,fillOutline:Yc,fillOutlinePattern:Fu,fillPattern:ip,fillExtrusion:Qo,fillExtrusionPattern:Xl,hillshadePrepare:Tl,hillshade:Ks,line:wl,lineGradient:ui,linePattern:tl,lineSDF:Fs,raster:Nu,symbolIcon:rl,symbolSDF:ap,symbolTextAndIcon:Yi}),mu=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function Cf(h){for(var v=[],p=0;p<h.length;p++)if(h[p]!==null){var g=h[p].split(" ");v.push(g.pop())}return v}mu.prototype.bind=function(h,v,p,g,S,w,C,O){this.context=h;for(var X=this.boundPaintVertexBuffers.length!==g.length,J=0;!X&&J<g.length;J++)this.boundPaintVertexBuffers[J]!==g[J]&&(X=!0);h.extVertexArrayObject&&this.vao&&this.boundProgram===v&&this.boundLayoutVertexBuffer===p&&!X&&this.boundIndexBuffer===S&&this.boundVertexOffset===w&&this.boundDynamicVertexBuffer===C&&this.boundDynamicVertexBuffer2===O?(h.bindVertexArrayOES.set(this.vao),C&&C.bind(),S&&S.dynamicDraw&&S.bind(),O&&O.bind()):this.freshBind(v,p,g,S,w,C,O)},mu.prototype.freshBind=function(h,v,p,g,S,w,C){var O,X=h.numAttributes,J=this.context,me=J.gl;if(J.extVertexArrayObject)this.vao&&this.destroy(),this.vao=J.extVertexArrayObject.createVertexArrayOES(),J.bindVertexArrayOES.set(this.vao),O=0,this.boundProgram=h,this.boundLayoutVertexBuffer=v,this.boundPaintVertexBuffers=p,this.boundIndexBuffer=g,this.boundVertexOffset=S,this.boundDynamicVertexBuffer=w,this.boundDynamicVertexBuffer2=C;else{O=J.currentNumAttributes||0;for(var be=X;be<O;be++)me.disableVertexAttribArray(be)}v.enableAttributes(me,h);for(var Te=0,je=p;Te<je.length;Te+=1)je[Te].enableAttributes(me,h);w&&w.enableAttributes(me,h),C&&C.enableAttributes(me,h),v.bind(),v.setVertexAttribPointers(me,h,S);for(var Ze=0,lt=p;Ze<lt.length;Ze+=1){var Ne=lt[Ze];Ne.bind(),Ne.setVertexAttribPointers(me,h,S)}w&&(w.bind(),w.setVertexAttribPointers(me,h,S)),g&&g.bind(),C&&(C.bind(),C.setVertexAttribPointers(me,h,S)),J.currentNumAttributes=X},mu.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var Va=function(h,v,p,g,S,w){var C=h.gl;this.program=C.createProgram();for(var O=Cf(p.staticAttributes),X=g?g.getBinderAttributes():[],J=O.concat(X),me=p.staticUniforms?Cf(p.staticUniforms):[],be=g?g.getBinderUniforms():[],Te=[],je=0,Ze=me.concat(be);je<Ze.length;je+=1){var lt=Ze[je];Te.indexOf(lt)<0&&Te.push(lt)}var Ne=g?g.defines():[];w&&Ne.push("#define OVERDRAW_INSPECTOR;");var ot=Ne.concat(Al.fragmentSource,p.fragmentSource).join(`
|
|
`),_t=Ne.concat(Al.vertexSource,p.vertexSource).join(`
|
|
`),Lt=C.createShader(C.FRAGMENT_SHADER);if(C.isContextLost())this.failedToCreate=!0;else{C.shaderSource(Lt,ot),C.compileShader(Lt),C.attachShader(this.program,Lt);var ir=C.createShader(C.VERTEX_SHADER);if(C.isContextLost())this.failedToCreate=!0;else{C.shaderSource(ir,_t),C.compileShader(ir),C.attachShader(this.program,ir),this.attributes={};var qt={};this.numAttributes=J.length;for(var cr=0;cr<this.numAttributes;cr++)J[cr]&&(C.bindAttribLocation(this.program,cr,J[cr]),this.attributes[J[cr]]=cr);C.linkProgram(this.program),C.deleteShader(ir),C.deleteShader(Lt);for(var br=0;br<Te.length;br++){var Hr=Te[br];if(Hr&&!qt[Hr]){var Fr=C.getUniformLocation(this.program,Hr);Fr&&(qt[Hr]=Fr)}}this.fixedUniforms=S(h,qt),this.binderUniforms=g?g.getUniforms(h,qt):[]}}};function vh(h,v,p){var g=1/ca(p,1,v.transform.tileZoom),S=Math.pow(2,p.tileID.overscaledZ),w=p.tileSize*Math.pow(2,v.transform.tileZoom)/S,C=w*(p.tileID.canonical.x+p.tileID.wrap*S),O=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,O>>16],u_pixel_coord_lower:[65535&C,65535&O]}}Va.prototype.draw=function(h,v,p,g,S,w,C,O,X,J,me,be,Te,je,Ze,lt){var Ne,ot=h.gl;if(!this.failedToCreate){for(var _t in h.program.set(this.program),h.setDepthMode(p),h.setStencilMode(g),h.setColorMode(S),h.setCullFace(w),this.fixedUniforms)this.fixedUniforms[_t].set(C[_t]);je&&je.setUniforms(h,this.binderUniforms,be,{zoom:Te});for(var Lt=(Ne={},Ne[ot.LINES]=2,Ne[ot.TRIANGLES]=3,Ne[ot.LINE_STRIP]=1,Ne)[v],ir=0,qt=me.get();ir<qt.length;ir+=1){var cr=qt[ir],br=cr.vaos||(cr.vaos={});(br[O]||(br[O]=new mu)).bind(h,this,X,je?je.getPaintVertexBuffers():[],J,cr.vertexOffset,Ze,lt),ot.drawElements(v,cr.primitiveLength*Lt,ot.UNSIGNED_SHORT,cr.primitiveOffset*Lt*2)}}};var Rf=function(h,v,p,g){var S=v.style.light,w=S.properties.get("position"),C=[w.x,w.y,w.z],O=y.create$1();S.properties.get("anchor")==="viewport"&&y.fromRotation(O,-v.transform.angle),y.transformMat3(C,C,O);var X=S.properties.get("color");return{u_matrix:h,u_lightpos:C,u_lightintensity:S.properties.get("intensity"),u_lightcolor:[X.r,X.g,X.b],u_vertical_gradient:+p,u_opacity:g}},Ns=function(h,v,p,g,S,w,C){return y.extend(Rf(h,v,p,g),vh(w,v,C),{u_height_factor:-Math.pow(2,S.overscaledZ)/C.tileSize/8})},nl=function(h){return{u_matrix:h}},gu=function(h,v,p,g){return y.extend(nl(h),vh(p,v,g))},Cl=function(h,v){return{u_matrix:h,u_world:v}},mh=function(h,v,p,g,S){return y.extend(gu(h,v,p,g),{u_world:S})},_c=function(h,v,p,g){var S,w,C=h.transform;if(g.paint.get("circle-pitch-alignment")==="map"){var O=ca(p,1,C.zoom);S=!0,w=[O,O]}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(v.posMatrix,p,g.paint.get("circle-translate"),g.paint.get("circle-translate-anchor")),u_pitch_with_map:+S,u_device_pixel_ratio:y.browser.devicePixelRatio,u_extrude_scale:w}},ua=function(h,v,p){var g=ca(p,1,v.zoom),S=Math.pow(2,v.zoom-p.tileID.overscaledZ),w=p.tileID.overscaleFactor();return{u_matrix:h,u_camera_to_center_distance:v.cameraToCenterDistance,u_pixels_to_tile_units:g,u_extrude_scale:[v.pixelsToGLUnits[0]/(g*S),v.pixelsToGLUnits[1]/(g*S)],u_overscale_factor:w}},xc=function(h,v,p){return{u_matrix:h,u_inv_matrix:v,u_camera_to_center_distance:p.cameraToCenterDistance,u_viewport_size:[p.width,p.height]}},il=function(h,v,p){return p===void 0&&(p=1),{u_matrix:h,u_color:v,u_overlay:0,u_overlay_scale:p}},Rl=function(h){return{u_matrix:h}},gh=function(h,v,p,g){return{u_matrix:h,u_extrude_scale:ca(v,1,p),u_intensity:g}},qc=function(h,v,p){var g=h.transform;return{u_matrix:Kc(h,v,p),u_ratio:1/ca(v,1,g.zoom),u_device_pixel_ratio:y.browser.devicePixelRatio,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},ha=function(h,v,p,g){return y.extend(qc(h,v,p),{u_image:0,u_image_height:g})},Ml=function(h,v,p,g){var S=h.transform,w=al(v,S);return{u_matrix:Kc(h,v,p),u_texsize:v.imageAtlasTexture.size,u_ratio:1/ca(v,1,S.zoom),u_device_pixel_ratio:y.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]]}},op=function(h,v,p,g,S){var w=h.lineAtlas,C=al(v,h.transform),O=p.layout.get("line-cap")==="round",X=w.getDash(g.from,O),J=w.getDash(g.to,O),me=X.width*S.fromScale,be=J.width*S.toScale;return y.extend(qc(h,v,p),{u_patternscale_a:[C/me,-X.height/2],u_patternscale_b:[C/be,-J.height/2],u_sdfgamma:w.width/(256*Math.min(me,be)*y.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:X.y,u_tex_y_b:J.y,u_mix:S.t})};function al(h,v){return 1/ca(h,1,v.tileZoom)}function Kc(h,v,p){return h.translatePosMatrix(v.tileID.posMatrix,v,p.paint.get("line-translate"),p.paint.get("line-translate-anchor"))}var Qc=function(h,v,p,g,S){return{u_matrix:h,u_tl_parent:v,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:Mf(S.paint.get("raster-hue-rotate"))};var w,C};function Mf(h){h*=Math.PI/180;var v=Math.sin(h),p=Math.cos(h);return[(2*p+1)/3,(-Math.sqrt(3)*v-p+1)/3,(Math.sqrt(3)*v-p+1)/3]}var ol,$l=function(h,v,p,g,S,w,C,O,X,J){var me=S.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:v?v.uSizeT:0,u_size:v?v.uSize:0,u_camera_to_center_distance:me.cameraToCenterDistance,u_pitch:me.pitch/360*2*Math.PI,u_rotate_symbol:+p,u_aspect_ratio:me.width/me.height,u_fade_change:S.options.fadeDuration?S.symbolFadeChange:1,u_matrix:w,u_label_plane_matrix:C,u_coord_matrix:O,u_is_text:+X,u_pitch_with_map:+g,u_texsize:J,u_texture:0}},Uu=function(h,v,p,g,S,w,C,O,X,J,me){var be=S.transform;return y.extend($l(h,v,p,g,S,w,C,O,X,J),{u_gamma_scale:g?Math.cos(be._pitch)*be.cameraToCenterDistance:1,u_device_pixel_ratio:y.browser.devicePixelRatio,u_is_halo:+me})},Jc=function(h,v,p,g,S,w,C,O,X,J){return y.extend(Uu(h,v,p,g,S,w,C,O,!0,X,!0),{u_texsize_icon:J,u_texture_icon:1})},bc=function(h,v,p){return{u_matrix:h,u_opacity:v,u_color:p}},Yl=function(h,v,p,g,S,w){return y.extend(function(C,O,X,J){var me=X.imageManager.getPattern(C.from.toString()),be=X.imageManager.getPattern(C.to.toString()),Te=X.imageManager.getPixelSize(),je=Te.width,Ze=Te.height,lt=Math.pow(2,J.tileID.overscaledZ),Ne=J.tileSize*Math.pow(2,X.transform.tileZoom)/lt,ot=Ne*(J.tileID.canonical.x+J.tileID.wrap*lt),_t=Ne*J.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:me.tl,u_pattern_br_a:me.br,u_pattern_tl_b:be.tl,u_pattern_br_b:be.br,u_texsize:[je,Ze],u_mix:O.t,u_pattern_size_a:me.displaySize,u_pattern_size_b:be.displaySize,u_scale_a:O.fromScale,u_scale_b:O.toScale,u_tile_units_to_pixels:1/ca(J,1,X.transform.tileZoom),u_pixel_coord_upper:[ot>>16,_t>>16],u_pixel_coord_lower:[65535&ot,65535&_t]}}(g,w,p,S),{u_matrix:h,u_opacity:v})},yh={fillExtrusion:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_lightpos:new y.Uniform3f(h,v.u_lightpos),u_lightintensity:new y.Uniform1f(h,v.u_lightintensity),u_lightcolor:new y.Uniform3f(h,v.u_lightcolor),u_vertical_gradient:new y.Uniform1f(h,v.u_vertical_gradient),u_opacity:new y.Uniform1f(h,v.u_opacity)}},fillExtrusionPattern:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_lightpos:new y.Uniform3f(h,v.u_lightpos),u_lightintensity:new y.Uniform1f(h,v.u_lightintensity),u_lightcolor:new y.Uniform3f(h,v.u_lightcolor),u_vertical_gradient:new y.Uniform1f(h,v.u_vertical_gradient),u_height_factor:new y.Uniform1f(h,v.u_height_factor),u_image:new y.Uniform1i(h,v.u_image),u_texsize:new y.Uniform2f(h,v.u_texsize),u_pixel_coord_upper:new y.Uniform2f(h,v.u_pixel_coord_upper),u_pixel_coord_lower:new y.Uniform2f(h,v.u_pixel_coord_lower),u_scale:new y.Uniform3f(h,v.u_scale),u_fade:new y.Uniform1f(h,v.u_fade),u_opacity:new y.Uniform1f(h,v.u_opacity)}},fill:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix)}},fillPattern:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_image:new y.Uniform1i(h,v.u_image),u_texsize:new y.Uniform2f(h,v.u_texsize),u_pixel_coord_upper:new y.Uniform2f(h,v.u_pixel_coord_upper),u_pixel_coord_lower:new y.Uniform2f(h,v.u_pixel_coord_lower),u_scale:new y.Uniform3f(h,v.u_scale),u_fade:new y.Uniform1f(h,v.u_fade)}},fillOutline:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_world:new y.Uniform2f(h,v.u_world)}},fillOutlinePattern:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_world:new y.Uniform2f(h,v.u_world),u_image:new y.Uniform1i(h,v.u_image),u_texsize:new y.Uniform2f(h,v.u_texsize),u_pixel_coord_upper:new y.Uniform2f(h,v.u_pixel_coord_upper),u_pixel_coord_lower:new y.Uniform2f(h,v.u_pixel_coord_lower),u_scale:new y.Uniform3f(h,v.u_scale),u_fade:new y.Uniform1f(h,v.u_fade)}},circle:function(h,v){return{u_camera_to_center_distance:new y.Uniform1f(h,v.u_camera_to_center_distance),u_scale_with_map:new y.Uniform1i(h,v.u_scale_with_map),u_pitch_with_map:new y.Uniform1i(h,v.u_pitch_with_map),u_extrude_scale:new y.Uniform2f(h,v.u_extrude_scale),u_device_pixel_ratio:new y.Uniform1f(h,v.u_device_pixel_ratio),u_matrix:new y.UniformMatrix4f(h,v.u_matrix)}},collisionBox:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_camera_to_center_distance:new y.Uniform1f(h,v.u_camera_to_center_distance),u_pixels_to_tile_units:new y.Uniform1f(h,v.u_pixels_to_tile_units),u_extrude_scale:new y.Uniform2f(h,v.u_extrude_scale),u_overscale_factor:new y.Uniform1f(h,v.u_overscale_factor)}},collisionCircle:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_inv_matrix:new y.UniformMatrix4f(h,v.u_inv_matrix),u_camera_to_center_distance:new y.Uniform1f(h,v.u_camera_to_center_distance),u_viewport_size:new y.Uniform2f(h,v.u_viewport_size)}},debug:function(h,v){return{u_color:new y.UniformColor(h,v.u_color),u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_overlay:new y.Uniform1i(h,v.u_overlay),u_overlay_scale:new y.Uniform1f(h,v.u_overlay_scale)}},clippingMask:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix)}},heatmap:function(h,v){return{u_extrude_scale:new y.Uniform1f(h,v.u_extrude_scale),u_intensity:new y.Uniform1f(h,v.u_intensity),u_matrix:new y.UniformMatrix4f(h,v.u_matrix)}},heatmapTexture:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_world:new y.Uniform2f(h,v.u_world),u_image:new y.Uniform1i(h,v.u_image),u_color_ramp:new y.Uniform1i(h,v.u_color_ramp),u_opacity:new y.Uniform1f(h,v.u_opacity)}},hillshade:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_image:new y.Uniform1i(h,v.u_image),u_latrange:new y.Uniform2f(h,v.u_latrange),u_light:new y.Uniform2f(h,v.u_light),u_shadow:new y.UniformColor(h,v.u_shadow),u_highlight:new y.UniformColor(h,v.u_highlight),u_accent:new y.UniformColor(h,v.u_accent)}},hillshadePrepare:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_image:new y.Uniform1i(h,v.u_image),u_dimension:new y.Uniform2f(h,v.u_dimension),u_zoom:new y.Uniform1f(h,v.u_zoom),u_unpack:new y.Uniform4f(h,v.u_unpack)}},line:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_ratio:new y.Uniform1f(h,v.u_ratio),u_device_pixel_ratio:new y.Uniform1f(h,v.u_device_pixel_ratio),u_units_to_pixels:new y.Uniform2f(h,v.u_units_to_pixels)}},lineGradient:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_ratio:new y.Uniform1f(h,v.u_ratio),u_device_pixel_ratio:new y.Uniform1f(h,v.u_device_pixel_ratio),u_units_to_pixels:new y.Uniform2f(h,v.u_units_to_pixels),u_image:new y.Uniform1i(h,v.u_image),u_image_height:new y.Uniform1f(h,v.u_image_height)}},linePattern:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_texsize:new y.Uniform2f(h,v.u_texsize),u_ratio:new y.Uniform1f(h,v.u_ratio),u_device_pixel_ratio:new y.Uniform1f(h,v.u_device_pixel_ratio),u_image:new y.Uniform1i(h,v.u_image),u_units_to_pixels:new y.Uniform2f(h,v.u_units_to_pixels),u_scale:new y.Uniform3f(h,v.u_scale),u_fade:new y.Uniform1f(h,v.u_fade)}},lineSDF:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_ratio:new y.Uniform1f(h,v.u_ratio),u_device_pixel_ratio:new y.Uniform1f(h,v.u_device_pixel_ratio),u_units_to_pixels:new y.Uniform2f(h,v.u_units_to_pixels),u_patternscale_a:new y.Uniform2f(h,v.u_patternscale_a),u_patternscale_b:new y.Uniform2f(h,v.u_patternscale_b),u_sdfgamma:new y.Uniform1f(h,v.u_sdfgamma),u_image:new y.Uniform1i(h,v.u_image),u_tex_y_a:new y.Uniform1f(h,v.u_tex_y_a),u_tex_y_b:new y.Uniform1f(h,v.u_tex_y_b),u_mix:new y.Uniform1f(h,v.u_mix)}},raster:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_tl_parent:new y.Uniform2f(h,v.u_tl_parent),u_scale_parent:new y.Uniform1f(h,v.u_scale_parent),u_buffer_scale:new y.Uniform1f(h,v.u_buffer_scale),u_fade_t:new y.Uniform1f(h,v.u_fade_t),u_opacity:new y.Uniform1f(h,v.u_opacity),u_image0:new y.Uniform1i(h,v.u_image0),u_image1:new y.Uniform1i(h,v.u_image1),u_brightness_low:new y.Uniform1f(h,v.u_brightness_low),u_brightness_high:new y.Uniform1f(h,v.u_brightness_high),u_saturation_factor:new y.Uniform1f(h,v.u_saturation_factor),u_contrast_factor:new y.Uniform1f(h,v.u_contrast_factor),u_spin_weights:new y.Uniform3f(h,v.u_spin_weights)}},symbolIcon:function(h,v){return{u_is_size_zoom_constant:new y.Uniform1i(h,v.u_is_size_zoom_constant),u_is_size_feature_constant:new y.Uniform1i(h,v.u_is_size_feature_constant),u_size_t:new y.Uniform1f(h,v.u_size_t),u_size:new y.Uniform1f(h,v.u_size),u_camera_to_center_distance:new y.Uniform1f(h,v.u_camera_to_center_distance),u_pitch:new y.Uniform1f(h,v.u_pitch),u_rotate_symbol:new y.Uniform1i(h,v.u_rotate_symbol),u_aspect_ratio:new y.Uniform1f(h,v.u_aspect_ratio),u_fade_change:new y.Uniform1f(h,v.u_fade_change),u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_label_plane_matrix:new y.UniformMatrix4f(h,v.u_label_plane_matrix),u_coord_matrix:new y.UniformMatrix4f(h,v.u_coord_matrix),u_is_text:new y.Uniform1i(h,v.u_is_text),u_pitch_with_map:new y.Uniform1i(h,v.u_pitch_with_map),u_texsize:new y.Uniform2f(h,v.u_texsize),u_texture:new y.Uniform1i(h,v.u_texture)}},symbolSDF:function(h,v){return{u_is_size_zoom_constant:new y.Uniform1i(h,v.u_is_size_zoom_constant),u_is_size_feature_constant:new y.Uniform1i(h,v.u_is_size_feature_constant),u_size_t:new y.Uniform1f(h,v.u_size_t),u_size:new y.Uniform1f(h,v.u_size),u_camera_to_center_distance:new y.Uniform1f(h,v.u_camera_to_center_distance),u_pitch:new y.Uniform1f(h,v.u_pitch),u_rotate_symbol:new y.Uniform1i(h,v.u_rotate_symbol),u_aspect_ratio:new y.Uniform1f(h,v.u_aspect_ratio),u_fade_change:new y.Uniform1f(h,v.u_fade_change),u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_label_plane_matrix:new y.UniformMatrix4f(h,v.u_label_plane_matrix),u_coord_matrix:new y.UniformMatrix4f(h,v.u_coord_matrix),u_is_text:new y.Uniform1i(h,v.u_is_text),u_pitch_with_map:new y.Uniform1i(h,v.u_pitch_with_map),u_texsize:new y.Uniform2f(h,v.u_texsize),u_texture:new y.Uniform1i(h,v.u_texture),u_gamma_scale:new y.Uniform1f(h,v.u_gamma_scale),u_device_pixel_ratio:new y.Uniform1f(h,v.u_device_pixel_ratio),u_is_halo:new y.Uniform1i(h,v.u_is_halo)}},symbolTextAndIcon:function(h,v){return{u_is_size_zoom_constant:new y.Uniform1i(h,v.u_is_size_zoom_constant),u_is_size_feature_constant:new y.Uniform1i(h,v.u_is_size_feature_constant),u_size_t:new y.Uniform1f(h,v.u_size_t),u_size:new y.Uniform1f(h,v.u_size),u_camera_to_center_distance:new y.Uniform1f(h,v.u_camera_to_center_distance),u_pitch:new y.Uniform1f(h,v.u_pitch),u_rotate_symbol:new y.Uniform1i(h,v.u_rotate_symbol),u_aspect_ratio:new y.Uniform1f(h,v.u_aspect_ratio),u_fade_change:new y.Uniform1f(h,v.u_fade_change),u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_label_plane_matrix:new y.UniformMatrix4f(h,v.u_label_plane_matrix),u_coord_matrix:new y.UniformMatrix4f(h,v.u_coord_matrix),u_is_text:new y.Uniform1i(h,v.u_is_text),u_pitch_with_map:new y.Uniform1i(h,v.u_pitch_with_map),u_texsize:new y.Uniform2f(h,v.u_texsize),u_texsize_icon:new y.Uniform2f(h,v.u_texsize_icon),u_texture:new y.Uniform1i(h,v.u_texture),u_texture_icon:new y.Uniform1i(h,v.u_texture_icon),u_gamma_scale:new y.Uniform1f(h,v.u_gamma_scale),u_device_pixel_ratio:new y.Uniform1f(h,v.u_device_pixel_ratio),u_is_halo:new y.Uniform1i(h,v.u_is_halo)}},background:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_opacity:new y.Uniform1f(h,v.u_opacity),u_color:new y.UniformColor(h,v.u_color)}},backgroundPattern:function(h,v){return{u_matrix:new y.UniformMatrix4f(h,v.u_matrix),u_opacity:new y.Uniform1f(h,v.u_opacity),u_image:new y.Uniform1i(h,v.u_image),u_pattern_tl_a:new y.Uniform2f(h,v.u_pattern_tl_a),u_pattern_br_a:new y.Uniform2f(h,v.u_pattern_br_a),u_pattern_tl_b:new y.Uniform2f(h,v.u_pattern_tl_b),u_pattern_br_b:new y.Uniform2f(h,v.u_pattern_br_b),u_texsize:new y.Uniform2f(h,v.u_texsize),u_mix:new y.Uniform1f(h,v.u_mix),u_pattern_size_a:new y.Uniform2f(h,v.u_pattern_size_a),u_pattern_size_b:new y.Uniform2f(h,v.u_pattern_size_b),u_scale_a:new y.Uniform1f(h,v.u_scale_a),u_scale_b:new y.Uniform1f(h,v.u_scale_b),u_pixel_coord_upper:new y.Uniform2f(h,v.u_pixel_coord_upper),u_pixel_coord_lower:new y.Uniform2f(h,v.u_pixel_coord_lower),u_tile_units_to_pixels:new y.Uniform1f(h,v.u_tile_units_to_pixels)}}};function Ec(h,v,p,g,S,w,C){for(var O=h.context,X=O.gl,J=h.useProgram("collisionBox"),me=[],be=0,Te=0,je=0;je<g.length;je++){var Ze=g[je],lt=v.getTile(Ze),Ne=lt.getBucket(p);if(Ne){var ot=Ze.posMatrix;S[0]===0&&S[1]===0||(ot=h.translatePosMatrix(Ze.posMatrix,lt,S,w));var _t=C?Ne.textCollisionBox:Ne.iconCollisionBox,Lt=Ne.collisionCircleArray;if(Lt.length>0){var ir=y.create(),qt=ot;y.mul(ir,Ne.placementInvProjMatrix,h.transform.glCoordMatrix),y.mul(ir,ir,Ne.placementViewportMatrix),me.push({circleArray:Lt,circleOffset:Te,transform:qt,invTransform:ir}),Te=be+=Lt.length/4}_t&&J.draw(O,X.LINES,ee.disabled,xe.disabled,h.colorModeForRenderPass(),Qe.disabled,ua(ot,h.transform,lt),p.id,_t.layoutVertexBuffer,_t.indexBuffer,_t.segments,null,h.transform.zoom,null,null,_t.collisionVertexBuffer)}}if(C&&me.length){var cr=h.useProgram("collisionCircle"),br=new y.StructArrayLayout2f1f2i16;br.resize(4*be),br._trim();for(var Hr=0,Fr=0,hn=me;Fr<hn.length;Fr+=1)for(var Un=hn[Fr],Fn=0;Fn<Un.circleArray.length/4;Fn++){var zn=4*Fn,zi=Un.circleArray[zn+0],gn=Un.circleArray[zn+1],ii=Un.circleArray[zn+2],pi=Un.circleArray[zn+3];br.emplace(Hr++,zi,gn,ii,pi,0),br.emplace(Hr++,zi,gn,ii,pi,1),br.emplace(Hr++,zi,gn,ii,pi,2),br.emplace(Hr++,zi,gn,ii,pi,3)}(!ol||ol.length<2*be)&&(ol=function(Qa){var Po=2*Qa,_o=new y.StructArrayLayout3ui6;_o.resize(Po),_o._trim();for(var Wa=0;Wa<Po;Wa++){var Ja=6*Wa;_o.uint16[Ja+0]=4*Wa+0,_o.uint16[Ja+1]=4*Wa+1,_o.uint16[Ja+2]=4*Wa+2,_o.uint16[Ja+3]=4*Wa+2,_o.uint16[Ja+4]=4*Wa+3,_o.uint16[Ja+5]=4*Wa+0}return _o}(be));for(var ri=O.createIndexBuffer(ol,!0),Kn=O.createVertexBuffer(br,y.collisionCircleLayout.members,!0),fi=0,Qn=me;fi<Qn.length;fi+=1){var Gn=Qn[fi],Io=xc(Gn.transform,Gn.invTransform,h.transform);cr.draw(O,X.TRIANGLES,ee.disabled,xe.disabled,h.colorModeForRenderPass(),Qe.disabled,Io,p.id,Kn,ri,y.SegmentVector.simpleSegment(0,2*Gn.circleOffset,Gn.circleArray.length,Gn.circleArray.length/2),null,h.transform.zoom,null,null,null)}Kn.destroy(),ri.destroy()}}var Us=y.identity(new Float32Array(16));function _h(h,v,p,g,S,w){var C=y.getAnchorAlignment(h),O=-(C.horizontalAlign-.5)*v,X=-(C.verticalAlign-.5)*p,J=y.evaluateVariableOffset(h,g);return new y.Point((O/S+J[0])*w,(X/S+J[1])*w)}function ef(h,v,p,g,S,w,C,O,X,J,me){var be=h.text.placedSymbolArray,Te=h.text.dynamicLayoutVertexArray,je=h.icon.dynamicLayoutVertexArray,Ze={};Te.clear();for(var lt=0;lt<be.length;lt++){var Ne=be.get(lt),ot=Ne.hidden||!Ne.crossTileID||h.allowVerticalPlacement&&!Ne.placedOrientation?null:g[Ne.crossTileID];if(ot){var _t=new y.Point(Ne.anchorX,Ne.anchorY),Lt=di(_t,p?O:C),ir=Ai(w.cameraToCenterDistance,Lt.signedDistanceFromCamera),qt=S.evaluateSizeForFeature(h.textSizeData,J,Ne)*ir/y.ONE_EM;p&&(qt*=h.tilePixelRatio/X);for(var cr=_h(ot.anchor,ot.width,ot.height,ot.textOffset,ot.textBoxScale,qt),br=p?di(_t.add(cr),C).point:Lt.point.add(v?cr.rotate(-w.angle):cr),Hr=h.allowVerticalPlacement&&Ne.placedOrientation===y.WritingMode.vertical?Math.PI/2:0,Fr=0;Fr<Ne.numGlyphs;Fr++)y.addDynamicAttributes(Te,br,Hr);me&&Ne.associatedIconIndex>=0&&(Ze[Ne.associatedIconIndex]={shiftedAnchor:br,angle:Hr})}else ka(Ne.numGlyphs,Te)}if(me){je.clear();for(var hn=h.icon.placedSymbolArray,Un=0;Un<hn.length;Un++){var Fn=hn.get(Un);if(Fn.hidden)ka(Fn.numGlyphs,je);else{var zn=Ze[Un];if(zn)for(var zi=0;zi<Fn.numGlyphs;zi++)y.addDynamicAttributes(je,zn.shiftedAnchor,zn.angle);else ka(Fn.numGlyphs,je)}}h.icon.dynamicLayoutVertexBuffer.updateData(je)}h.text.dynamicLayoutVertexBuffer.updateData(Te)}function Sc(h,v,p){return p.iconsInText&&v?"symbolTextAndIcon":h?"symbolSDF":"symbolIcon"}function Il(h,v,p,g,S,w,C,O,X,J,me,be){for(var Te=h.context,je=Te.gl,Ze=h.transform,lt=O==="map",Ne=X==="map",ot=lt&&p.layout.get("symbol-placement")!=="point",_t=lt&&!Ne&&!ot,Lt=p.layout.get("symbol-sort-key").constantOr(1)!==void 0,ir=!1,qt=h.depthModeForSublayer(0,ee.ReadOnly),cr=p.layout.get("text-variable-anchor"),br=[],Hr=0,Fr=g;Hr<Fr.length;Hr+=1){var hn=Fr[Hr],Un=v.getTile(hn),Fn=Un.getBucket(p);if(Fn){var zn=S?Fn.text:Fn.icon;if(zn&&zn.segments.get().length){var zi=zn.programConfigurations.get(p.id),gn=S||Fn.sdfIcons,ii=S?Fn.textSizeData:Fn.iconSizeData,pi=Ne||Ze.pitch!==0,ri=h.useProgram(Sc(gn,S,Fn),zi),Kn=y.evaluateSizeForZoom(ii,Ze.zoom),fi=void 0,Qn=[0,0],Gn=void 0,Io=void 0,Qa=null,Po=void 0;if(S)Gn=Un.glyphAtlasTexture,Io=je.LINEAR,fi=Un.glyphAtlasTexture.size,Fn.iconsInText&&(Qn=Un.imageAtlasTexture.size,Qa=Un.imageAtlasTexture,Po=pi||h.options.rotating||h.options.zooming||ii.kind==="composite"||ii.kind==="camera"?je.LINEAR:je.NEAREST);else{var _o=p.layout.get("icon-size").constantOr(0)!==1||Fn.iconsNeedLinear;Gn=Un.imageAtlasTexture,Io=gn||h.options.rotating||h.options.zooming||_o||pi?je.LINEAR:je.NEAREST,fi=Un.imageAtlasTexture.size}var Wa=ca(Un,1,h.transform.zoom),Ja=Pa(hn.posMatrix,Ne,lt,h.transform,Wa),bs=Si(hn.posMatrix,Ne,lt,h.transform,Wa),Es=cr&&Fn.hasTextData(),fl=p.layout.get("icon-text-fit")!=="none"&&Es&&Fn.hasIconData();ot&&vu(Fn,hn.posMatrix,h,S,Ja,bs,Ne,J);var Ss=h.translatePosMatrix(hn.posMatrix,Un,w,C),lu=ot||S&&cr||fl?Us:Ja,Vs=h.translatePosMatrix(bs,Un,w,C,!0),Mc=gn&&p.paint.get(S?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Hu={program:ri,buffers:zn,uniformValues:gn?Fn.iconsInText?Jc(ii.kind,Kn,_t,Ne,h,Ss,lu,Vs,fi,Qn):Uu(ii.kind,Kn,_t,Ne,h,Ss,lu,Vs,S,fi,!0):$l(ii.kind,Kn,_t,Ne,h,Ss,lu,Vs,S,fi),atlasTexture:Gn,atlasTextureIcon:Qa,atlasInterpolation:Io,atlasInterpolationIcon:Po,isSDF:gn,hasHalo:Mc};if(Lt&&Fn.canOverlap){ir=!0;for(var Tu=0,nc=zn.segments.get();Tu<nc.length;Tu+=1){var hl=nc[Tu];br.push({segments:new y.SegmentVector([hl]),sortKey:hl.sortKey,state:Hu})}}else br.push({segments:zn.segments,sortKey:0,state:Hu})}}}ir&&br.sort(function(fu,wu){return fu.sortKey-wu.sortKey});for(var cu=0,pl=br;cu<pl.length;cu+=1){var Oo=pl[cu],ao=Oo.state;if(Te.activeTexture.set(je.TEXTURE0),ao.atlasTexture.bind(ao.atlasInterpolation,je.CLAMP_TO_EDGE),ao.atlasTextureIcon&&(Te.activeTexture.set(je.TEXTURE1),ao.atlasTextureIcon&&ao.atlasTextureIcon.bind(ao.atlasInterpolationIcon,je.CLAMP_TO_EDGE)),ao.isSDF){var Ps=ao.uniformValues;ao.hasHalo&&(Ps.u_is_halo=1,zu(ao.buffers,Oo.segments,p,h,ao.program,qt,me,be,Ps)),Ps.u_is_halo=0}zu(ao.buffers,Oo.segments,p,h,ao.program,qt,me,be,ao.uniformValues)}}function zu(h,v,p,g,S,w,C,O,X){var J=g.context;S.draw(J,J.gl.TRIANGLES,w,C,O,Qe.disabled,X,p.id,h.layoutVertexBuffer,h.indexBuffer,v,p.paint,g.transform.zoom,h.programConfigurations.get(p.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function ql(h,v,p,g,S,w,C){var O,X,J,me,be,Te=h.context.gl,je=p.paint.get("fill-pattern"),Ze=je&&je.constantOr(1),lt=p.getCrossfadeParameters();C?(X=Ze&&!p.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",O=Te.LINES):(X=Ze?"fillPattern":"fill",O=Te.TRIANGLES);for(var Ne=0,ot=g;Ne<ot.length;Ne+=1){var _t=ot[Ne],Lt=v.getTile(_t);if(!Ze||Lt.patternsLoaded()){var ir=Lt.getBucket(p);if(ir){var qt=ir.programConfigurations.get(p.id),cr=h.useProgram(X,qt);Ze&&(h.context.activeTexture.set(Te.TEXTURE0),Lt.imageAtlasTexture.bind(Te.LINEAR,Te.CLAMP_TO_EDGE),qt.updatePaintBuffers(lt));var br=je.constantOr(null);if(br&&Lt.imageAtlas){var Hr=Lt.imageAtlas,Fr=Hr.patternPositions[br.to.toString()],hn=Hr.patternPositions[br.from.toString()];Fr&&hn&&qt.setConstantPatternPositions(Fr,hn)}var Un=h.translatePosMatrix(_t.posMatrix,Lt,p.paint.get("fill-translate"),p.paint.get("fill-translate-anchor"));if(C){me=ir.indexBuffer2,be=ir.segments2;var Fn=[Te.drawingBufferWidth,Te.drawingBufferHeight];J=X==="fillOutlinePattern"&&Ze?mh(Un,h,lt,Lt,Fn):Cl(Un,Fn)}else me=ir.indexBuffer,be=ir.segments,J=Ze?gu(Un,h,lt,Lt):nl(Un);cr.draw(h.context,O,S,h.stencilModeForClipping(_t),w,Qe.disabled,J,p.id,ir.layoutVertexBuffer,me,be,p.paint,h.transform.zoom,qt)}}}}function If(h,v,p,g,S,w,C){for(var O=h.context,X=O.gl,J=p.paint.get("fill-extrusion-pattern"),me=J.constantOr(1),be=p.getCrossfadeParameters(),Te=p.paint.get("fill-extrusion-opacity"),je=0,Ze=g;je<Ze.length;je+=1){var lt=Ze[je],Ne=v.getTile(lt),ot=Ne.getBucket(p);if(ot){var _t=ot.programConfigurations.get(p.id),Lt=h.useProgram(me?"fillExtrusionPattern":"fillExtrusion",_t);me&&(h.context.activeTexture.set(X.TEXTURE0),Ne.imageAtlasTexture.bind(X.LINEAR,X.CLAMP_TO_EDGE),_t.updatePaintBuffers(be));var ir=J.constantOr(null);if(ir&&Ne.imageAtlas){var qt=Ne.imageAtlas,cr=qt.patternPositions[ir.to.toString()],br=qt.patternPositions[ir.from.toString()];cr&&br&&_t.setConstantPatternPositions(cr,br)}var Hr=h.translatePosMatrix(lt.posMatrix,Ne,p.paint.get("fill-extrusion-translate"),p.paint.get("fill-extrusion-translate-anchor")),Fr=p.paint.get("fill-extrusion-vertical-gradient"),hn=me?Ns(Hr,h,Fr,Te,lt,be,Ne):Rf(Hr,h,Fr,Te);Lt.draw(O,O.gl.TRIANGLES,S,w,C,Qe.backCCW,hn,p.id,ot.layoutVertexBuffer,ot.indexBuffer,ot.segments,p.paint,h.transform.zoom,_t)}}}function sl(h,v,p,g,S,w){var C=h.context,O=C.gl,X=v.fbo;if(X){var J=h.useProgram("hillshade");C.activeTexture.set(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,X.colorAttachment.get());var me=function(be,Te,je){var Ze=je.paint.get("hillshade-shadow-color"),lt=je.paint.get("hillshade-highlight-color"),Ne=je.paint.get("hillshade-accent-color"),ot=je.paint.get("hillshade-illumination-direction")*(Math.PI/180);je.paint.get("hillshade-illumination-anchor")==="viewport"&&(ot-=be.transform.angle);var _t,Lt,ir,qt=!be.options.moving;return{u_matrix:be.transform.calculatePosMatrix(Te.tileID.toUnwrapped(),qt),u_image:0,u_latrange:(_t=Te.tileID,Lt=Math.pow(2,_t.canonical.z),ir=_t.canonical.y,[new y.MercatorCoordinate(0,ir/Lt).toLngLat().lat,new y.MercatorCoordinate(0,(ir+1)/Lt).toLngLat().lat]),u_light:[je.paint.get("hillshade-exaggeration"),ot],u_shadow:Ze,u_highlight:lt,u_accent:Ne}}(h,v,p);J.draw(C,O.TRIANGLES,g,S,w,Qe.disabled,me,p.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}}function xh(h,v,p,g,S,w){var C=h.context,O=C.gl,X=v.dem;if(X&&X.data){var J=X.dim,me=X.stride,be=X.getPixels();if(C.activeTexture.set(O.TEXTURE1),C.pixelStoreUnpackPremultiplyAlpha.set(!1),v.demTexture=v.demTexture||h.getTileTexture(me),v.demTexture){var Te=v.demTexture;Te.update(be,{premultiply:!1}),Te.bind(O.NEAREST,O.CLAMP_TO_EDGE)}else v.demTexture=new y.Texture(C,be,O.RGBA,{premultiply:!1}),v.demTexture.bind(O.NEAREST,O.CLAMP_TO_EDGE);C.activeTexture.set(O.TEXTURE0);var je=v.fbo;if(!je){var Ze=new y.Texture(C,{width:J,height:J,data:null},O.RGBA);Ze.bind(O.LINEAR,O.CLAMP_TO_EDGE),(je=v.fbo=C.createFramebuffer(J,J,!0)).colorAttachment.set(Ze.texture)}C.bindFramebuffer.set(je.framebuffer),C.viewport.set([0,0,J,J]),h.useProgram("hillshadePrepare").draw(C,O.TRIANGLES,g,S,w,Qe.disabled,function(lt,Ne){var ot=Ne.stride,_t=y.create();return y.ortho(_t,0,y.EXTENT,-y.EXTENT,0,0,1),y.translate(_t,_t,[0,-y.EXTENT,0]),{u_matrix:_t,u_image:1,u_dimension:[ot,ot],u_zoom:lt.overscaledZ,u_unpack:Ne.getUnpackVector()}}(v.tileID,X),p.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments),v.needsHillshadePrepare=!1}}function bh(h,v,p,g,S){var w=g.paint.get("raster-fade-duration");if(w>0){var C=y.browser.now(),O=(C-h.timeAdded)/w,X=v?(C-v.timeAdded)/w:-1,J=p.getSource(),me=S.coveringZoomLevel({tileSize:J.tileSize,roundZoom:J.roundZoom}),be=!v||Math.abs(v.tileID.overscaledZ-me)>Math.abs(h.tileID.overscaledZ-me),Te=be&&h.refreshedUponExpiration?1:y.clamp(be?O:1-X,0,1);return h.refreshedUponExpiration&&O>=1&&(h.refreshedUponExpiration=!1),v?{opacity:1,mix:1-Te}:{opacity:Te,mix:0}}return{opacity:1,mix:0}}var Eh=new y.Color(1,0,0,1),Pf=new y.Color(0,1,0,1),sp=new y.Color(0,0,1,1),ja=new y.Color(1,0,1,1),up=new y.Color(0,1,1,1);function Of(h,v,p,g){Kl(h,0,v+p/2,h.transform.width,p,g)}function lp(h,v,p,g){Kl(h,v-p/2,0,p,h.transform.height,g)}function Kl(h,v,p,g,S,w){var C=h.context,O=C.gl;O.enable(O.SCISSOR_TEST),O.scissor(v*y.browser.devicePixelRatio,p*y.browser.devicePixelRatio,g*y.browser.devicePixelRatio,S*y.browser.devicePixelRatio),C.clear({color:w}),O.disable(O.SCISSOR_TEST)}function cp(h,v,p){var g=h.context,S=g.gl,w=p.posMatrix,C=h.useProgram("debug"),O=ee.disabled,X=xe.disabled,J=h.colorModeForRenderPass();g.activeTexture.set(S.TEXTURE0),h.emptyTexture.bind(S.LINEAR,S.CLAMP_TO_EDGE),C.draw(g,S.LINE_STRIP,O,X,J,Qe.disabled,il(w,y.Color.red),"$debug",h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments);var me=v.getTileByID(p.key).latestRawTileData,be=Math.floor((me&&me.byteLength||0)/1024),Te=v.getTile(p).tileSize,je=512/Math.min(Te,512)*(p.overscaledZ/h.transform.zoom)*.5,Ze=p.canonical.toString();p.overscaledZ!==p.canonical.z&&(Ze+=" => "+p.overscaledZ),function(lt,Ne){lt.initDebugOverlayCanvas();var ot=lt.debugOverlayCanvas,_t=lt.context.gl,Lt=lt.debugOverlayCanvas.getContext("2d");Lt.clearRect(0,0,ot.width,ot.height),Lt.shadowColor="white",Lt.shadowBlur=2,Lt.lineWidth=1.5,Lt.strokeStyle="white",Lt.textBaseline="top",Lt.font="bold 36px Open Sans, sans-serif",Lt.fillText(Ne,5,5),Lt.strokeText(Ne,5,5),lt.debugOverlayTexture.update(ot),lt.debugOverlayTexture.bind(_t.LINEAR,_t.CLAMP_TO_EDGE)}(h,Ze+" "+be+"kb"),C.draw(g,S.TRIANGLES,O,X,Ue.alphaBlended,Qe.disabled,il(w,y.Color.transparent,je),"$debug",h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments)}var Zu={symbol:function(h,v,p,g,S){if(h.renderPass==="translucent"){var w=xe.disabled,C=h.colorModeForRenderPass();p.layout.get("text-variable-anchor")&&function(O,X,J,me,be,Te,je){for(var Ze=X.transform,lt=be==="map",Ne=Te==="map",ot=0,_t=O;ot<_t.length;ot+=1){var Lt=_t[ot],ir=me.getTile(Lt),qt=ir.getBucket(J);if(qt&&qt.text&&qt.text.segments.get().length){var cr=y.evaluateSizeForZoom(qt.textSizeData,Ze.zoom),br=ca(ir,1,X.transform.zoom),Hr=Pa(Lt.posMatrix,Ne,lt,X.transform,br),Fr=J.layout.get("icon-text-fit")!=="none"&&qt.hasIconData();if(cr){var hn=Math.pow(2,Ze.zoom-ir.tileID.overscaledZ);ef(qt,lt,Ne,je,y.symbolSize,Ze,Hr,Lt.posMatrix,hn,cr,Fr)}}}}(g,h,p,v,p.layout.get("text-rotation-alignment"),p.layout.get("text-pitch-alignment"),S),p.paint.get("icon-opacity").constantOr(1)!==0&&Il(h,v,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&&Il(h,v,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),v.map.showCollisionBoxes&&(Ec(h,v,p,g,p.paint.get("text-translate"),p.paint.get("text-translate-anchor"),!0),Ec(h,v,p,g,p.paint.get("icon-translate"),p.paint.get("icon-translate-anchor"),!1))}},circle:function(h,v,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"),O=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 X=h.context,J=X.gl,me=h.depthModeForSublayer(0,ee.ReadOnly),be=xe.disabled,Te=h.colorModeForRenderPass(),je=[],Ze=0;Ze<g.length;Ze++){var lt=g[Ze],Ne=v.getTile(lt),ot=Ne.getBucket(p);if(ot){var _t=ot.programConfigurations.get(p.id),Lt={programConfiguration:_t,program:h.useProgram("circle",_t),layoutVertexBuffer:ot.layoutVertexBuffer,indexBuffer:ot.indexBuffer,uniformValues:_c(h,lt,Ne,p)};if(O)for(var ir=0,qt=ot.segments.get();ir<qt.length;ir+=1){var cr=qt[ir];je.push({segments:new y.SegmentVector([cr]),sortKey:cr.sortKey,state:Lt})}else je.push({segments:ot.segments,sortKey:0,state:Lt})}}O&&je.sort(function(Un,Fn){return Un.sortKey-Fn.sortKey});for(var br=0,Hr=je;br<Hr.length;br+=1){var Fr=Hr[br],hn=Fr.state;hn.program.draw(X,J.TRIANGLES,me,be,Te,Qe.disabled,hn.uniformValues,p.id,hn.layoutVertexBuffer,hn.indexBuffer,Fr.segments,p.paint,h.transform.zoom,hn.programConfiguration)}}}},heatmap:function(h,v,p,g){if(p.paint.get("heatmap-opacity")!==0)if(h.renderPass==="offscreen"){var S=h.context,w=S.gl,C=xe.disabled,O=new Ue([w.ONE,w.ONE],y.Color.transparent,[!0,!0,!0,!0]);(function(je,Ze,lt){var Ne=je.gl;je.activeTexture.set(Ne.TEXTURE1),je.viewport.set([0,0,Ze.width/4,Ze.height/4]);var ot=lt.heatmapFbo;if(ot)Ne.bindTexture(Ne.TEXTURE_2D,ot.colorAttachment.get()),je.bindFramebuffer.set(ot.framebuffer);else{var _t=Ne.createTexture();Ne.bindTexture(Ne.TEXTURE_2D,_t),Ne.texParameteri(Ne.TEXTURE_2D,Ne.TEXTURE_WRAP_S,Ne.CLAMP_TO_EDGE),Ne.texParameteri(Ne.TEXTURE_2D,Ne.TEXTURE_WRAP_T,Ne.CLAMP_TO_EDGE),Ne.texParameteri(Ne.TEXTURE_2D,Ne.TEXTURE_MIN_FILTER,Ne.LINEAR),Ne.texParameteri(Ne.TEXTURE_2D,Ne.TEXTURE_MAG_FILTER,Ne.LINEAR),ot=lt.heatmapFbo=je.createFramebuffer(Ze.width/4,Ze.height/4,!1),function(Lt,ir,qt,cr){var br=Lt.gl;br.texImage2D(br.TEXTURE_2D,0,br.RGBA,ir.width/4,ir.height/4,0,br.RGBA,Lt.extRenderToTextureHalfFloat?Lt.extTextureHalfFloat.HALF_FLOAT_OES:br.UNSIGNED_BYTE,null),cr.colorAttachment.set(qt)}(je,Ze,_t,ot)}})(S,h,p),S.clear({color:y.Color.transparent});for(var X=0;X<g.length;X++){var J=g[X];if(!v.hasRenderableParent(J)){var me=v.getTile(J),be=me.getBucket(p);if(be){var Te=be.programConfigurations.get(p.id);h.useProgram("heatmap",Te).draw(S,w.TRIANGLES,ee.disabled,C,O,Qe.disabled,gh(J.posMatrix,me,h.transform.zoom,p.paint.get("heatmap-intensity")),p.id,be.layoutVertexBuffer,be.indexBuffer,be.segments,p.paint,h.transform.zoom,Te)}}}S.viewport.set([0,0,h.width,h.height])}else h.renderPass==="translucent"&&(h.context.setColorMode(h.colorModeForRenderPass()),function(je,Ze){var lt=je.context,Ne=lt.gl,ot=Ze.heatmapFbo;if(ot){lt.activeTexture.set(Ne.TEXTURE0),Ne.bindTexture(Ne.TEXTURE_2D,ot.colorAttachment.get()),lt.activeTexture.set(Ne.TEXTURE1);var _t=Ze.colorRampTexture;_t||(_t=Ze.colorRampTexture=new y.Texture(lt,Ze.colorRamp,Ne.RGBA)),_t.bind(Ne.LINEAR,Ne.CLAMP_TO_EDGE),je.useProgram("heatmapTexture").draw(lt,Ne.TRIANGLES,ee.disabled,xe.disabled,je.colorModeForRenderPass(),Qe.disabled,function(Lt,ir,qt,cr){var br=y.create();y.ortho(br,0,Lt.width,Lt.height,0,0,1);var Hr=Lt.context.gl;return{u_matrix:br,u_world:[Hr.drawingBufferWidth,Hr.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:ir.paint.get("heatmap-opacity")}}(je,Ze),Ze.id,je.viewportBuffer,je.quadTriangleIndexBuffer,je.viewportSegments,Ze.paint,je.transform.zoom)}}(h,p))},line:function(h,v,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,ee.ReadOnly),O=h.colorModeForRenderPass(),X=p.paint.get("line-dasharray"),J=p.paint.get("line-pattern"),me=J.constantOr(1),be=p.paint.get("line-gradient"),Te=p.getCrossfadeParameters(),je=me?"linePattern":X?"lineSDF":be?"lineGradient":"line",Ze=h.context,lt=Ze.gl,Ne=!0,ot=0,_t=g;ot<_t.length;ot+=1){var Lt=_t[ot],ir=v.getTile(Lt);if(!me||ir.patternsLoaded()){var qt=ir.getBucket(p);if(qt){var cr=qt.programConfigurations.get(p.id),br=h.context.program.get(),Hr=h.useProgram(je,cr),Fr=Ne||Hr.program!==br,hn=J.constantOr(null);if(hn&&ir.imageAtlas){var Un=ir.imageAtlas,Fn=Un.patternPositions[hn.to.toString()],zn=Un.patternPositions[hn.from.toString()];Fn&&zn&&cr.setConstantPatternPositions(Fn,zn)}var zi=me?Ml(h,ir,p,Te):X?op(h,ir,p,X,Te):be?ha(h,ir,p,qt.lineClipsArray.length):qc(h,ir,p);if(me)Ze.activeTexture.set(lt.TEXTURE0),ir.imageAtlasTexture.bind(lt.LINEAR,lt.CLAMP_TO_EDGE),cr.updatePaintBuffers(Te);else if(X&&(Fr||h.lineAtlas.dirty))Ze.activeTexture.set(lt.TEXTURE0),h.lineAtlas.bind(Ze);else if(be){var gn=qt.gradients[p.id],ii=gn.texture;if(p.gradientVersion!==gn.version){var pi=256;if(p.stepInterpolant){var ri=v.getSource().maxzoom,Kn=Lt.canonical.z===ri?Math.ceil(1<<h.transform.maxZoom-Lt.canonical.z):1;pi=y.clamp(y.nextPowerOfTwo(qt.maxLineLength/y.EXTENT*1024*Kn),256,Ze.maxTextureSize)}gn.gradient=y.renderColorRamp({expression:p.gradientExpression(),evaluationKey:"lineProgress",resolution:pi,image:gn.gradient||void 0,clips:qt.lineClipsArray}),gn.texture?gn.texture.update(gn.gradient):gn.texture=new y.Texture(Ze,gn.gradient,lt.RGBA),gn.version=p.gradientVersion,ii=gn.texture}Ze.activeTexture.set(lt.TEXTURE0),ii.bind(p.stepInterpolant?lt.NEAREST:lt.LINEAR,lt.CLAMP_TO_EDGE)}Hr.draw(Ze,lt.TRIANGLES,C,h.stencilModeForClipping(Lt),O,Qe.disabled,zi,p.id,qt.layoutVertexBuffer,qt.indexBuffer,qt.segments,p.paint,h.transform.zoom,cr,qt.layoutVertexBuffer2),Ne=!1}}}}},fill:function(h,v,p,g){var S=p.paint.get("fill-color"),w=p.paint.get("fill-opacity");if(w.constantOr(1)!==0){var C=h.colorModeForRenderPass(),O=p.paint.get("fill-pattern"),X=h.opaquePassEnabledForLayer()&&!O.constantOr(1)&&S.constantOr(y.Color.transparent).a===1&&w.constantOr(0)===1?"opaque":"translucent";if(h.renderPass===X){var J=h.depthModeForSublayer(1,h.renderPass==="opaque"?ee.ReadWrite:ee.ReadOnly);ql(h,v,p,g,J,C,!1)}if(h.renderPass==="translucent"&&p.paint.get("fill-antialias")){var me=h.depthModeForSublayer(p.getPaintProperty("fill-outline-color")?2:0,ee.ReadOnly);ql(h,v,p,g,me,C,!0)}}},"fill-extrusion":function(h,v,p,g){var S=p.paint.get("fill-extrusion-opacity");if(S!==0&&h.renderPass==="translucent"){var w=new ee(h.context.gl.LEQUAL,ee.ReadWrite,h.depthRangeFor3D);if(S!==1||p.paint.get("fill-extrusion-pattern").constantOr(1))If(h,v,p,g,w,xe.disabled,Ue.disabled),If(h,v,p,g,w,h.stencilModeFor3D(),h.colorModeForRenderPass());else{var C=h.colorModeForRenderPass();If(h,v,p,g,w,xe.disabled,C)}}},hillshade:function(h,v,p,g){if(h.renderPass==="offscreen"||h.renderPass==="translucent"){for(var S=h.context,w=h.depthModeForSublayer(0,ee.ReadOnly),C=h.colorModeForRenderPass(),O=h.renderPass==="translucent"?h.stencilConfigForOverlap(g):[{},g],X=O[0],J=0,me=O[1];J<me.length;J+=1){var be=me[J],Te=v.getTile(be);Te.needsHillshadePrepare&&h.renderPass==="offscreen"?xh(h,Te,p,w,xe.disabled,C):h.renderPass==="translucent"&&sl(h,Te,p,w,X[be.overscaledZ],C)}S.viewport.set([0,0,h.width,h.height])}},raster:function(h,v,p,g){if(h.renderPass==="translucent"&&p.paint.get("raster-opacity")!==0&&g.length)for(var S=h.context,w=S.gl,C=v.getSource(),O=h.useProgram("raster"),X=h.colorModeForRenderPass(),J=C instanceof ie?[{},g]:h.stencilConfigForOverlap(g),me=J[0],be=J[1],Te=be[be.length-1].overscaledZ,je=!h.options.moving,Ze=0,lt=be;Ze<lt.length;Ze+=1){var Ne=lt[Ze],ot=h.depthModeForSublayer(Ne.overscaledZ-Te,p.paint.get("raster-opacity")===1?ee.ReadWrite:ee.ReadOnly,w.LESS),_t=v.getTile(Ne),Lt=h.transform.calculatePosMatrix(Ne.toUnwrapped(),je);_t.registerFadeDuration(p.paint.get("raster-fade-duration"));var ir=v.findLoadedParent(Ne,0),qt=bh(_t,ir,v,p,h.transform),cr=void 0,br=void 0,Hr=p.paint.get("raster-resampling")==="nearest"?w.NEAREST:w.LINEAR;S.activeTexture.set(w.TEXTURE0),_t.texture.bind(Hr,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST),S.activeTexture.set(w.TEXTURE1),ir?(ir.texture.bind(Hr,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST),cr=Math.pow(2,ir.tileID.overscaledZ-_t.tileID.overscaledZ),br=[_t.tileID.canonical.x*cr%1,_t.tileID.canonical.y*cr%1]):_t.texture.bind(Hr,w.CLAMP_TO_EDGE,w.LINEAR_MIPMAP_NEAREST);var Fr=Qc(Lt,br||[0,0],cr||1,qt,p);C instanceof ie?O.draw(S,w.TRIANGLES,ot,xe.disabled,X,Qe.disabled,Fr,p.id,C.boundsBuffer,h.quadTriangleIndexBuffer,C.boundsSegments):O.draw(S,w.TRIANGLES,ot,me[Ne.overscaledZ],X,Qe.disabled,Fr,p.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments)}},background:function(h,v,p){var g=p.paint.get("background-color"),S=p.paint.get("background-opacity");if(S!==0){var w=h.context,C=w.gl,O=h.transform,X=O.tileSize,J=p.paint.get("background-pattern");if(!h.isPatternMissing(J)){var me=!J&&g.a===1&&S===1&&h.opaquePassEnabledForLayer()?"opaque":"translucent";if(h.renderPass===me){var be=xe.disabled,Te=h.depthModeForSublayer(0,me==="opaque"?ee.ReadWrite:ee.ReadOnly),je=h.colorModeForRenderPass(),Ze=h.useProgram(J?"backgroundPattern":"background"),lt=O.coveringTiles({tileSize:X});J&&(w.activeTexture.set(C.TEXTURE0),h.imageManager.bind(h.context));for(var Ne=p.getCrossfadeParameters(),ot=0,_t=lt;ot<_t.length;ot+=1){var Lt=_t[ot],ir=h.transform.calculatePosMatrix(Lt.toUnwrapped()),qt=J?Yl(ir,S,h,J,{tileID:Lt,tileSize:X},Ne):bc(ir,S,g);Ze.draw(w,C.TRIANGLES,Te,be,je,Qe.disabled,qt,p.id,h.tileExtentBuffer,h.quadTriangleIndexBuffer,h.tileExtentSegments)}}}}},debug:function(h,v,p){for(var g=0;g<p.length;g++)cp(h,v,p[g])},custom:function(h,v,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(xe.disabled);var C=S.renderingMode==="3d"?new ee(h.context.gl.LEQUAL,ee.ReadWrite,h.depthRangeFor3D):h.depthModeForSublayer(0,ee.ReadOnly);g.setDepthMode(C),S.render(g.gl,h.transform.customLayerMatrix()),g.setDirty(),h.setBaseState(),g.bindFramebuffer.set(null)}}},ma=function(h,v){this.context=new j(h),this.transform=v,this._tileTextures={},this.setup(),this.numSublayers=Q.maxUnderzooming+Q.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Sl,this.gpuTimers={}};ma.prototype.resize=function(h,v){if(this.width=h*y.browser.devicePixelRatio,this.height=v*y.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()},ma.prototype.setup=function(){var h=this.context,v=new y.StructArrayLayout2i4;v.emplaceBack(0,0),v.emplaceBack(y.EXTENT,0),v.emplaceBack(0,y.EXTENT),v.emplaceBack(y.EXTENT,y.EXTENT),this.tileExtentBuffer=h.createVertexBuffer(v,qa.members),this.tileExtentSegments=y.SegmentVector.simpleSegment(0,0,4,2);var p=new y.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(y.EXTENT,0),p.emplaceBack(0,y.EXTENT),p.emplaceBack(y.EXTENT,y.EXTENT),this.debugBuffer=h.createVertexBuffer(p,qa.members),this.debugSegments=y.SegmentVector.simpleSegment(0,0,4,5);var g=new y.StructArrayLayout4i8;g.emplaceBack(0,0,0,0),g.emplaceBack(y.EXTENT,0,y.EXTENT,0),g.emplaceBack(0,y.EXTENT,0,y.EXTENT),g.emplaceBack(y.EXTENT,y.EXTENT,y.EXTENT,y.EXTENT),this.rasterBoundsBuffer=h.createVertexBuffer(g,ut.members),this.rasterBoundsSegments=y.SegmentVector.simpleSegment(0,0,4,2);var S=new y.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=y.SegmentVector.simpleSegment(0,0,4,2);var w=new y.StructArrayLayout1ui2;w.emplaceBack(0),w.emplaceBack(1),w.emplaceBack(3),w.emplaceBack(2),w.emplaceBack(0),this.tileBorderIndexBuffer=h.createIndexBuffer(w);var C=new y.StructArrayLayout3ui6;C.emplaceBack(0,1,2),C.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=h.createIndexBuffer(C),this.emptyTexture=new y.Texture(h,{width:1,height:1,data:new Uint8Array([0,0,0,0])},h.gl.RGBA);var O=this.context.gl;this.stencilClearMode=new xe({func:O.ALWAYS,mask:0},0,255,O.ZERO,O.ZERO,O.ZERO)},ma.prototype.clearStencil=function(){var h=this.context,v=h.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var p=y.create();y.ortho(p,0,this.width,this.height,0,0,1),y.scale(p,p,[v.drawingBufferWidth,v.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(h,v.TRIANGLES,ee.disabled,this.stencilClearMode,Ue.disabled,Qe.disabled,Rl(p),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},ma.prototype._renderTileClippingMasks=function(h,v){if(this.currentStencilSource!==h.source&&h.isTileClipped()&&v&&v.length){this.currentStencilSource=h.source;var p=this.context,g=p.gl;this.nextStencilID+v.length>256&&this.clearStencil(),p.setColorMode(Ue.disabled),p.setDepthMode(ee.disabled);var S=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var w=0,C=v;w<C.length;w+=1){var O=C[w],X=this._tileClippingMaskIDs[O.key]=this.nextStencilID++;S.draw(p,g.TRIANGLES,ee.disabled,new xe({func:g.ALWAYS,mask:0},X,255,g.KEEP,g.KEEP,g.REPLACE),Ue.disabled,Qe.disabled,Rl(O.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},ma.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var h=this.nextStencilID++,v=this.context.gl;return new xe({func:v.NOTEQUAL,mask:255},h,255,v.KEEP,v.KEEP,v.REPLACE)},ma.prototype.stencilModeForClipping=function(h){var v=this.context.gl;return new xe({func:v.EQUAL,mask:255},this._tileClippingMaskIDs[h.key],0,v.KEEP,v.KEEP,v.REPLACE)},ma.prototype.stencilConfigForOverlap=function(h){var v,p=this.context.gl,g=h.sort(function(X,J){return J.overscaledZ-X.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={},O=0;O<w;O++)C[O+S]=new xe({func:p.GEQUAL,mask:255},O+this.nextStencilID,255,p.KEEP,p.KEEP,p.REPLACE);return this.nextStencilID+=w,[C,g]}return[(v={},v[S]=xe.disabled,v),g]},ma.prototype.colorModeForRenderPass=function(){var h=this.context.gl;return this._showOverdrawInspector?new Ue([h.CONSTANT_COLOR,h.ONE],new y.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Ue.unblended:Ue.alphaBlended},ma.prototype.depthModeForSublayer=function(h,v,p){if(!this.opaquePassEnabledForLayer())return ee.disabled;var g=1-((1+this.currentLayer)*this.numSublayers+h)*this.depthEpsilon;return new ee(p||this.context.gl.LEQUAL,v,[g,g])},ma.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},ma.prototype.render=function(h,v){var p=this;this.style=h,this.options=v,this.lineAtlas=h.lineAtlas,this.imageManager=h.imageManager,this.glyphManager=h.glyphManager,this.symbolFadeChange=h.placement.symbolFadeChange(y.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 O,X,J={},me={},be={};for(var Te in S){var je=S[Te];J[Te]=je.getVisibleCoordinates(),me[Te]=J[Te].slice().reverse(),be[Te]=je.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var Ze=0;Ze<g.length;Ze++)if(this.style._layers[g[Ze]].is3D()){this.opaquePassCutoff=Ze;break}this.renderPass="offscreen";for(var lt=0,Ne=g;lt<Ne.length;lt+=1){var ot=this.style._layers[Ne[lt]];if(ot.hasOffscreenPass()&&!ot.isHidden(this.transform.zoom)){var _t=me[ot.source];(ot.type==="custom"||_t.length)&&this.renderLayer(this,S[ot.source],ot,_t)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:v.showOverdrawInspector?y.Color.black:y.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=v.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 Lt=this.style._layers[g[this.currentLayer]],ir=S[Lt.source],qt=J[Lt.source];this._renderTileClippingMasks(Lt,qt),this.renderLayer(this,ir,Lt,qt)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<g.length;this.currentLayer++){var cr=this.style._layers[g[this.currentLayer]],br=S[cr.source],Hr=(cr.type==="symbol"?be:me)[cr.source];this._renderTileClippingMasks(cr,J[cr.source]),this.renderLayer(this,br,cr,Hr)}this.options.showTileBoundaries&&(y.values(this.style._layers).forEach(function(Fr){Fr.source&&!Fr.isHidden(p.transform.zoom)&&(Fr.source!==(X&&X.id)&&(X=p.style.sourceCaches[Fr.source]),(!O||O.getSource().maxzoom<X.getSource().maxzoom)&&(O=X))}),O&&Zu.debug(this,O,O.getVisibleCoordinates())),this.options.showPadding&&function(Fr){var hn=Fr.transform.padding;Of(Fr,Fr.transform.height-(hn.top||0),3,Eh),Of(Fr,hn.bottom||0,3,Pf),lp(Fr,hn.left||0,3,sp),lp(Fr,Fr.transform.width-(hn.right||0),3,ja);var Un=Fr.transform.centerPoint;(function(Fn,zn,zi,gn){Kl(Fn,zn-1,zi-10,2,20,gn),Kl(Fn,zn-10,zi-1,20,2,gn)})(Fr,Un.x,Fr.transform.height-Un.y,up)}(this),this.context.setDefault()},ma.prototype.renderLayer=function(h,v,p,g){p.isHidden(this.transform.zoom)||(p.type==="background"||p.type==="custom"||g.length)&&(this.id=p.id,this.gpuTimingStart(p),Zu[p.type](h,v,p,g,this.style.placement.variableOffsets),this.gpuTimingEnd())},ma.prototype.gpuTimingStart=function(h){if(this.options.gpuTiming){var v=this.context.extTimerQuery,p=this.gpuTimers[h.id];p||(p=this.gpuTimers[h.id]={calls:0,cpuTime:0,query:v.createQueryEXT()}),p.calls++,v.beginQueryEXT(v.TIME_ELAPSED_EXT,p.query)}},ma.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var h=this.context.extTimerQuery;h.endQueryEXT(h.TIME_ELAPSED_EXT)}},ma.prototype.collectGpuTimers=function(){var h=this.gpuTimers;return this.gpuTimers={},h},ma.prototype.queryGpuTimers=function(h){var v={};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),v[p]=w}return v},ma.prototype.translatePosMatrix=function(h,v,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),O=Math.cos(w);p=[p[0]*O-p[1]*C,p[0]*C+p[1]*O]}var X=[S?p[0]:ca(v,p[0],this.transform.zoom),S?p[1]:ca(v,p[1],this.transform.zoom),0],J=new Float32Array(16);return y.translate(J,h,X),J},ma.prototype.saveTileTexture=function(h){var v=this._tileTextures[h.size[0]];v?v.push(h):this._tileTextures[h.size[0]]=[h]},ma.prototype.getTileTexture=function(h){var v=this._tileTextures[h];return v&&v.length>0?v.pop():null},ma.prototype.isPatternMissing=function(h){if(!h)return!1;if(!h.from||!h.to)return!0;var v=this.imageManager.getPattern(h.from.toString()),p=this.imageManager.getPattern(h.to.toString());return!v||!p},ma.prototype.useProgram=function(h,v){this.cache=this.cache||{};var p=""+h+(v?v.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[p]||(this.cache[p]=new Va(this.context,h,ou[h],v,yh[h],this._showOverdrawInspector)),this.cache[p]},ma.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()},ma.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)},ma.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=y.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new y.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},ma.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Ql=function(h,v){this.points=h,this.planes=v};Ql.fromInvProjectionMatrix=function(h,v,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 y.transformMat4([],C,h)}).map(function(C){return y.scale$1([],C,1/C[3]/v*g)}),w=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(C){var O=y.sub([],S[C[0]],S[C[1]]),X=y.sub([],S[C[2]],S[C[1]]),J=y.normalize([],y.cross([],O,X)),me=-y.dot(J,S[C[1]]);return J.concat(me)});return new Ql(S,w)};var Vu=function(h,v){this.min=h,this.max=v,this.center=y.scale$2([],y.add([],this.min,this.max),.5)};Vu.prototype.quadrant=function(h){for(var v=[h%2==0,h<2],p=y.clone$2(this.min),g=y.clone$2(this.max),S=0;S<v.length;S++)p[S]=v[S]?this.min[S]:this.center[S],g[S]=v[S]?this.center[S]:this.max[S];return g[2]=this.max[2],new Vu(p,g)},Vu.prototype.distanceX=function(h){return Math.max(Math.min(this.max[0],h[0]),this.min[0])-h[0]},Vu.prototype.distanceY=function(h){return Math.max(Math.min(this.max[1],h[1]),this.min[1])-h[1]},Vu.prototype.intersects=function(h){for(var v=[[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<v.length;C++)w+=y.dot$1(S,v[C])>=0;if(w===0)return 0;w!==v.length&&(p=!1)}if(p)return 2;for(var O=0;O<3;O++){for(var X=Number.MAX_VALUE,J=-Number.MAX_VALUE,me=0;me<h.points.length;me++){var be=h.points[me][O]-this.min[O];X=Math.min(X,be),J=Math.max(J,be)}if(J<0||X>this.max[O]-this.min[O])return 0}return 1};var ul=function(h,v,p,g){if(h===void 0&&(h=0),v===void 0&&(v=0),p===void 0&&(p=0),g===void 0&&(g=0),isNaN(h)||h<0||isNaN(v)||v<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=v,this.left=p,this.right=g};ul.prototype.interpolate=function(h,v,p){return v.top!=null&&h.top!=null&&(this.top=y.number(h.top,v.top,p)),v.bottom!=null&&h.bottom!=null&&(this.bottom=y.number(h.bottom,v.bottom,p)),v.left!=null&&h.left!=null&&(this.left=y.number(h.left,v.left,p)),v.right!=null&&h.right!=null&&(this.right=y.number(h.right,v.right,p)),this},ul.prototype.getCenter=function(h,v){var p=y.clamp((this.left+h-this.right)/2,0,h),g=y.clamp((this.top+v-this.bottom)/2,0,v);return new y.Point(p,g)},ul.prototype.equals=function(h){return this.top===h.top&&this.bottom===h.bottom&&this.left===h.left&&this.right===h.right},ul.prototype.clone=function(){return new ul(this.top,this.bottom,this.left,this.right)},ul.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Bi=function(h,v,p,g,S){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=S===void 0||S,this._minZoom=h||0,this._maxZoom=v||22,this._minPitch=p==null?0:p,this._maxPitch=g==null?60:g,this.setMaxBounds(),this.width=0,this.height=0,this._center=new y.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ul,this._posMatrixCache={},this._alignedPosMatrixCache={}},ga={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}};Bi.prototype.clone=function(){var h=new Bi(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},ga.minZoom.get=function(){return this._minZoom},ga.minZoom.set=function(h){this._minZoom!==h&&(this._minZoom=h,this.zoom=Math.max(this.zoom,h))},ga.maxZoom.get=function(){return this._maxZoom},ga.maxZoom.set=function(h){this._maxZoom!==h&&(this._maxZoom=h,this.zoom=Math.min(this.zoom,h))},ga.minPitch.get=function(){return this._minPitch},ga.minPitch.set=function(h){this._minPitch!==h&&(this._minPitch=h,this.pitch=Math.max(this.pitch,h))},ga.maxPitch.get=function(){return this._maxPitch},ga.maxPitch.set=function(h){this._maxPitch!==h&&(this._maxPitch=h,this.pitch=Math.min(this.pitch,h))},ga.renderWorldCopies.get=function(){return this._renderWorldCopies},ga.renderWorldCopies.set=function(h){h===void 0?h=!0:h===null&&(h=!1),this._renderWorldCopies=h},ga.worldSize.get=function(){return this.tileSize*this.scale},ga.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},ga.size.get=function(){return new y.Point(this.width,this.height)},ga.bearing.get=function(){return-this.angle/Math.PI*180},ga.bearing.set=function(h){var v=-y.wrap(h,-180,180)*Math.PI/180;this.angle!==v&&(this._unmodified=!1,this.angle=v,this._calcMatrices(),this.rotationMatrix=y.create$2(),y.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},ga.pitch.get=function(){return this._pitch/Math.PI*180},ga.pitch.set=function(h){var v=y.clamp(h,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==v&&(this._unmodified=!1,this._pitch=v,this._calcMatrices())},ga.fov.get=function(){return this._fov/Math.PI*180},ga.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())},ga.zoom.get=function(){return this._zoom},ga.zoom.set=function(h){var v=Math.min(Math.max(h,this.minZoom),this.maxZoom);this._zoom!==v&&(this._unmodified=!1,this._zoom=v,this.scale=this.zoomScale(v),this.tileZoom=Math.floor(v),this.zoomFraction=v-this.tileZoom,this._constrain(),this._calcMatrices())},ga.center.get=function(){return this._center},ga.center.set=function(h){h.lat===this._center.lat&&h.lng===this._center.lng||(this._unmodified=!1,this._center=h,this._constrain(),this._calcMatrices())},ga.padding.get=function(){return this._edgeInsets.toJSON()},ga.padding.set=function(h){this._edgeInsets.equals(h)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,h,1),this._calcMatrices())},ga.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Bi.prototype.isPaddingEqual=function(h){return this._edgeInsets.equals(h)},Bi.prototype.interpolatePadding=function(h,v,p){this._unmodified=!1,this._edgeInsets.interpolate(h,v,p),this._constrain(),this._calcMatrices()},Bi.prototype.coveringZoomLevel=function(h){var v=(h.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/h.tileSize));return Math.max(0,v)},Bi.prototype.getVisibleUnwrappedCoordinates=function(h){var v=[new y.UnwrappedTileID(0,h)];if(this._renderWorldCopies)for(var p=this.pointCoordinate(new y.Point(0,0)),g=this.pointCoordinate(new y.Point(this.width,0)),S=this.pointCoordinate(new y.Point(this.width,this.height)),w=this.pointCoordinate(new y.Point(0,this.height)),C=Math.floor(Math.min(p.x,g.x,S.x,w.x)),O=Math.floor(Math.max(p.x,g.x,S.x,w.x)),X=C-1;X<=O+1;X++)X!==0&&v.push(new y.UnwrappedTileID(X,h));return v},Bi.prototype.coveringTiles=function(h){var v=this.coveringZoomLevel(h),p=v;if(h.minzoom!==void 0&&v<h.minzoom)return[];h.maxzoom!==void 0&&v>h.maxzoom&&(v=h.maxzoom);var g=y.MercatorCoordinate.fromLngLat(this.center),S=Math.pow(2,v),w=[S*g.x,S*g.y,0],C=Ql.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,v),O=h.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(O=v);var X=function(Fr){return{aabb:new Vu([Fr*S,0,0],[(Fr+1)*S,S,0]),zoom:0,x:0,y:0,wrap:Fr,fullyVisible:!1}},J=[],me=[],be=v,Te=h.reparseOverscaled?p:v;if(this._renderWorldCopies)for(var je=1;je<=3;je++)J.push(X(-je)),J.push(X(je));for(J.push(X(0));J.length>0;){var Ze=J.pop(),lt=Ze.x,Ne=Ze.y,ot=Ze.fullyVisible;if(!ot){var _t=Ze.aabb.intersects(C);if(_t===0)continue;ot=_t===2}var Lt=Ze.aabb.distanceX(w),ir=Ze.aabb.distanceY(w),qt=Math.max(Math.abs(Lt),Math.abs(ir));if(Ze.zoom===be||qt>3+(1<<be-Ze.zoom)-2&&Ze.zoom>=O)me.push({tileID:new y.OverscaledTileID(Ze.zoom===be?Te:Ze.zoom,Ze.wrap,Ze.zoom,lt,Ne),distanceSq:y.sqrLen([w[0]-.5-lt,w[1]-.5-Ne])});else for(var cr=0;cr<4;cr++){var br=(lt<<1)+cr%2,Hr=(Ne<<1)+(cr>>1);J.push({aabb:Ze.aabb.quadrant(cr),zoom:Ze.zoom+1,x:br,y:Hr,wrap:Ze.wrap,fullyVisible:ot})}}return me.sort(function(Fr,hn){return Fr.distanceSq-hn.distanceSq}).map(function(Fr){return Fr.tileID})},Bi.prototype.resize=function(h,v){this.width=h,this.height=v,this.pixelsToGLUnits=[2/h,-2/v],this._constrain(),this._calcMatrices()},ga.unmodified.get=function(){return this._unmodified},Bi.prototype.zoomScale=function(h){return Math.pow(2,h)},Bi.prototype.scaleZoom=function(h){return Math.log(h)/Math.LN2},Bi.prototype.project=function(h){var v=y.clamp(h.lat,-this.maxValidLatitude,this.maxValidLatitude);return new y.Point(y.mercatorXfromLng(h.lng)*this.worldSize,y.mercatorYfromLat(v)*this.worldSize)},Bi.prototype.unproject=function(h){return new y.MercatorCoordinate(h.x/this.worldSize,h.y/this.worldSize).toLngLat()},ga.point.get=function(){return this.project(this.center)},Bi.prototype.setLocationAtPoint=function(h,v){var p=this.pointCoordinate(v),g=this.pointCoordinate(this.centerPoint),S=this.locationCoordinate(h),w=new y.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())},Bi.prototype.locationPoint=function(h){return this.coordinatePoint(this.locationCoordinate(h))},Bi.prototype.pointLocation=function(h){return this.coordinateLocation(this.pointCoordinate(h))},Bi.prototype.locationCoordinate=function(h){return y.MercatorCoordinate.fromLngLat(h)},Bi.prototype.coordinateLocation=function(h){return h.toLngLat()},Bi.prototype.pointCoordinate=function(h){var v=[h.x,h.y,0,1],p=[h.x,h.y,1,1];y.transformMat4(v,v,this.pixelMatrixInverse),y.transformMat4(p,p,this.pixelMatrixInverse);var g=v[3],S=p[3],w=v[1]/g,C=p[1]/S,O=v[2]/g,X=p[2]/S,J=O===X?0:(0-O)/(X-O);return new y.MercatorCoordinate(y.number(v[0]/g,p[0]/S,J)/this.worldSize,y.number(w,C,J)/this.worldSize)},Bi.prototype.coordinatePoint=function(h){var v=[h.x*this.worldSize,h.y*this.worldSize,0,1];return y.transformMat4(v,v,this.pixelMatrix),new y.Point(v[0]/v[3],v[1]/v[3])},Bi.prototype.getBounds=function(){return new y.LngLatBounds().extend(this.pointLocation(new y.Point(0,0))).extend(this.pointLocation(new y.Point(this.width,0))).extend(this.pointLocation(new y.Point(this.width,this.height))).extend(this.pointLocation(new y.Point(0,this.height)))},Bi.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new y.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Bi.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])},Bi.prototype.calculatePosMatrix=function(h,v){v===void 0&&(v=!1);var p=h.key,g=v?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,O=y.identity(new Float64Array(16));return y.translate(O,O,[C*w,S.y*w,0]),y.scale(O,O,[w/y.EXTENT,w/y.EXTENT,1]),y.multiply(O,v?this.alignedProjMatrix:this.projMatrix,O),g[p]=new Float32Array(O),g[p]},Bi.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Bi.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var h,v,p,g,S=-90,w=90,C=-180,O=180,X=this.size,J=this._unmodified;if(this.latRange){var me=this.latRange;S=y.mercatorYfromLat(me[1])*this.worldSize,h=(w=y.mercatorYfromLat(me[0])*this.worldSize)-S<X.y?X.y/(w-S):0}if(this.lngRange){var be=this.lngRange;C=y.mercatorXfromLng(be[0])*this.worldSize,v=(O=y.mercatorXfromLng(be[1])*this.worldSize)-C<X.x?X.x/(O-C):0}var Te=this.point,je=Math.max(v||0,h||0);if(je)return this.center=this.unproject(new y.Point(v?(O+C)/2:Te.x,h?(w+S)/2:Te.y)),this.zoom+=this.scaleZoom(je),this._unmodified=J,void(this._constraining=!1);if(this.latRange){var Ze=Te.y,lt=X.y/2;Ze-lt<S&&(g=S+lt),Ze+lt>w&&(g=w-lt)}if(this.lngRange){var Ne=Te.x,ot=X.x/2;Ne-ot<C&&(p=C+ot),Ne+ot>O&&(p=O-ot)}p===void 0&&g===void 0||(this.center=this.unproject(new y.Point(p!==void 0?p:Te.x,g!==void 0?g:Te.y))),this._unmodified=J,this._constraining=!1}},Bi.prototype._calcMatrices=function(){if(this.height){var h=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var v=Math.PI/2+this._pitch,p=this._fov*(.5+h.y/this.height),g=Math.sin(p)*this.cameraToCenterDistance/Math.sin(y.clamp(Math.PI-v-p,.01,Math.PI-.01)),S=this.point,w=S.x,C=S.y,O=1.01*(Math.cos(Math.PI/2-this._pitch)*g+this.cameraToCenterDistance),X=this.height/50,J=new Float64Array(16);y.perspective(J,this._fov,this.width/this.height,X,O),J[8]=2*-h.x/this.width,J[9]=2*h.y/this.height,y.scale(J,J,[1,-1,1]),y.translate(J,J,[0,0,-this.cameraToCenterDistance]),y.rotateX(J,J,this._pitch),y.rotateZ(J,J,this.angle),y.translate(J,J,[-w,-C,0]),this.mercatorMatrix=y.scale([],J,[this.worldSize,this.worldSize,this.worldSize]),y.scale(J,J,[1,1,y.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=J,this.invProjMatrix=y.invert([],this.projMatrix);var me=this.width%2/2,be=this.height%2/2,Te=Math.cos(this.angle),je=Math.sin(this.angle),Ze=w-Math.round(w)+Te*me+je*be,lt=C-Math.round(C)+Te*be+je*me,Ne=new Float64Array(J);if(y.translate(Ne,Ne,[Ze>.5?Ze-1:Ze,lt>.5?lt-1:lt,0]),this.alignedProjMatrix=Ne,J=y.create(),y.scale(J,J,[this.width/2,-this.height/2,1]),y.translate(J,J,[1,-1,0]),this.labelPlaneMatrix=J,J=y.create(),y.scale(J,J,[1,-1,1]),y.translate(J,J,[-1,-1,0]),y.scale(J,J,[2/this.width,2/this.height,1]),this.glCoordMatrix=J,this.pixelMatrix=y.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(J=y.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=J,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Bi.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var h=this.pointCoordinate(new y.Point(0,0)),v=[h.x*this.worldSize,h.y*this.worldSize,0,1];return y.transformMat4(v,v,this.pixelMatrix)[3]/this.cameraToCenterDistance},Bi.prototype.getCameraPoint=function(){var h=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new y.Point(0,h))},Bi.prototype.getCameraQueryGeometry=function(h){var v=this.getCameraPoint();if(h.length===1)return[h[0],v];for(var p=v.x,g=v.y,S=v.x,w=v.y,C=0,O=h;C<O.length;C+=1){var X=O[C];p=Math.min(p,X.x),g=Math.min(g,X.y),S=Math.max(S,X.x),w=Math.max(w,X.y)}return[new y.Point(p,g),new y.Point(S,g),new y.Point(S,w),new y.Point(p,w),new y.Point(p,g)]},Object.defineProperties(Bi.prototype,ga);var su=function(h){var v,p,g,S;this._hashName=h&&encodeURIComponent(h),y.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(v=this._updateHashUnthrottled.bind(this),p=!1,g=null,S=function(){g=null,p&&(v(),g=setTimeout(S,300),p=!1)},function(){return p=!0,g||S(),g})};su.prototype.addTo=function(h){return this._map=h,y.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},su.prototype.remove=function(){return y.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},su.prototype.getHashString=function(h){var v=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(v.lng*S)/S,C=Math.round(v.lat*S)/S,O=this._map.getBearing(),X=this._map.getPitch(),J="";if(J+=h?"/"+w+"/"+C+"/"+p:p+"/"+C+"/"+w,(O||X)&&(J+="/"+Math.round(10*O)/10),X&&(J+="/"+Math.round(X)),this._hashName){var me=this._hashName,be=!1,Te=y.window.location.hash.slice(1).split("&").map(function(je){var Ze=je.split("=")[0];return Ze===me?(be=!0,Ze+"="+J):je}).filter(function(je){return je});return be||Te.push(me+"="+J),"#"+Te.join("&")}return"#"+J},su.prototype._getCurrentHash=function(){var h,v=this,p=y.window.location.hash.replace("#","");return this._hashName?(p.split("&").map(function(g){return g.split("=")}).forEach(function(g){g[0]===v._hashName&&(h=g)}),(h&&h[1]||"").split("/")):p.split("/")},su.prototype._onHashChange=function(){var h=this._getCurrentHash();if(h.length>=3&&!h.some(function(p){return isNaN(p)})){var v=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:v,pitch:+(h[4]||0)}),!0}return!1},su.prototype._updateHashUnthrottled=function(){var h=y.window.location.href.replace(/(#.+)?$/,this.getHashString());try{y.window.history.replaceState(y.window.history.state,null,h)}catch(v){}};var tf={linearity:.3,easing:y.bezier(0,0,.3,1)},rf=y.extend({deceleration:2500,maxSpeed:1400},tf),Qs=y.extend({deceleration:20,maxSpeed:1400},tf),fp=y.extend({deceleration:1e3,maxSpeed:360},tf),kf=y.extend({deceleration:1e3,maxSpeed:90},tf),Df=function(h){this._map=h,this.clear()};function Jl(h,v){(!h.duration||h.duration<v.duration)&&(h.duration=v.duration,h.easing=v.easing)}function Ro(h,v,p){var g=p.maxSpeed,S=p.linearity,w=p.deceleration,C=y.clamp(h*S/(v/1e3),-g,g),O=Math.abs(C)/(w*S);return{easing:p.easing,duration:1e3*O,amount:C*(O/2)}}Df.prototype.clear=function(){this._inertiaBuffer=[]},Df.prototype.record=function(h){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:y.browser.now(),settings:h})},Df.prototype._drainInertiaBuffer=function(){for(var h=this._inertiaBuffer,v=y.browser.now();h.length>0&&v-h[0].time>160;)h.shift()},Df.prototype._onMoveEnd=function(h){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var v={zoom:0,bearing:0,pitch:0,pan:new y.Point(0,0),pinchAround:void 0,around:void 0},p=0,g=this._inertiaBuffer;p<g.length;p+=1){var S=g[p].settings;v.zoom+=S.zoomDelta||0,v.bearing+=S.bearingDelta||0,v.pitch+=S.pitchDelta||0,S.panDelta&&v.pan._add(S.panDelta),S.around&&(v.around=S.around),S.pinchAround&&(v.pinchAround=S.pinchAround)}var w=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,C={};if(v.pan.mag()){var O=Ro(v.pan.mag(),w,y.extend({},rf,h||{}));C.offset=v.pan.mult(O.amount/v.pan.mag()),C.center=this._map.transform.center,Jl(C,O)}if(v.zoom){var X=Ro(v.zoom,w,Qs);C.zoom=this._map.transform.zoom+X.amount,Jl(C,X)}if(v.bearing){var J=Ro(v.bearing,w,fp);C.bearing=this._map.transform.bearing+y.clamp(J.amount,-179,179),Jl(C,J)}if(v.pitch){var me=Ro(v.pitch,w,kf);C.pitch=this._map.transform.pitch+me.amount,Jl(C,me)}if(C.zoom||C.bearing){var be=v.pinchAround===void 0?v.around:v.pinchAround;C.around=be?this._map.unproject(be):this._map.getCenter()}return this.clear(),y.extend(C,{noMoveStart:!0})}};var Ha=function(h){function v(g,S,w,C){C===void 0&&(C={});var O=Z.mousePos(S.getCanvasContainer(),w),X=S.unproject(O);h.call(this,g,y.extend({point:O,lngLat:X,originalEvent:w},C)),this._defaultPrevented=!1,this.target=S}h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v;var p={defaultPrevented:{configurable:!0}};return v.prototype.preventDefault=function(){this._defaultPrevented=!0},p.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(v.prototype,p),v}(y.Event),nf=function(h){function v(g,S,w){var C=g==="touchend"?w.changedTouches:w.touches,O=Z.touchPos(S.getCanvasContainer(),C),X=O.map(function(be){return S.unproject(be)}),J=O.reduce(function(be,Te,je,Ze){return be.add(Te.div(Ze.length))},new y.Point(0,0)),me=S.unproject(J);h.call(this,g,{points:O,point:J,lngLats:X,lngLat:me,originalEvent:w}),this._defaultPrevented=!1}h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v;var p={defaultPrevented:{configurable:!0}};return v.prototype.preventDefault=function(){this._defaultPrevented=!0},p.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(v.prototype,p),v}(y.Event),Ac=function(h){function v(g,S,w){h.call(this,g,{originalEvent:w}),this._defaultPrevented=!1}h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v;var p={defaultPrevented:{configurable:!0}};return v.prototype.preventDefault=function(){this._defaultPrevented=!0},p.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(v.prototype,p),v}(y.Event),io=function(h,v){this._map=h,this._clickTolerance=v.clickTolerance};io.prototype.reset=function(){delete this._mousedownPos},io.prototype.wheel=function(h){return this._firePreventable(new Ac(h.type,this._map,h))},io.prototype.mousedown=function(h,v){return this._mousedownPos=v,this._firePreventable(new Ha(h.type,this._map,h))},io.prototype.mouseup=function(h){this._map.fire(new Ha(h.type,this._map,h))},io.prototype.click=function(h,v){this._mousedownPos&&this._mousedownPos.dist(v)>=this._clickTolerance||this._map.fire(new Ha(h.type,this._map,h))},io.prototype.dblclick=function(h){return this._firePreventable(new Ha(h.type,this._map,h))},io.prototype.mouseover=function(h){this._map.fire(new Ha(h.type,this._map,h))},io.prototype.mouseout=function(h){this._map.fire(new Ha(h.type,this._map,h))},io.prototype.touchstart=function(h){return this._firePreventable(new nf(h.type,this._map,h))},io.prototype.touchmove=function(h){this._map.fire(new nf(h.type,this._map,h))},io.prototype.touchend=function(h){this._map.fire(new nf(h.type,this._map,h))},io.prototype.touchcancel=function(h){this._map.fire(new nf(h.type,this._map,h))},io.prototype._firePreventable=function(h){if(this._map.fire(h),h.defaultPrevented)return{}},io.prototype.isEnabled=function(){return!0},io.prototype.isActive=function(){return!1},io.prototype.enable=function(){},io.prototype.disable=function(){};var xn=function(h){this._map=h};xn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},xn.prototype.mousemove=function(h){this._map.fire(new Ha(h.type,this._map,h))},xn.prototype.mousedown=function(){this._delayContextMenu=!0},xn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ha("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},xn.prototype.contextmenu=function(h){this._delayContextMenu?this._contextMenuEvent=h:this._map.fire(new Ha(h.type,this._map,h)),this._map.listens("contextmenu")&&h.preventDefault()},xn.prototype.isEnabled=function(){return!0},xn.prototype.isActive=function(){return!1},xn.prototype.enable=function(){},xn.prototype.disable=function(){};var gs=function(h,v){this._map=h,this._el=h.getCanvasContainer(),this._container=h.getContainer(),this._clickTolerance=v.clickTolerance||1};function Lf(h,v){for(var p={},g=0;g<h.length;g++)p[h[g].identifier]=v[g];return p}gs.prototype.isEnabled=function(){return!!this._enabled},gs.prototype.isActive=function(){return!!this._active},gs.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},gs.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},gs.prototype.mousedown=function(h,v){this.isEnabled()&&h.shiftKey&&h.button===0&&(Z.disableDrag(),this._startPos=this._lastPos=v,this._active=!0)},gs.prototype.mousemoveWindow=function(h,v){if(this._active){var p=v;if(!(this._lastPos.equals(p)||!this._box&&p.dist(this._startPos)<this._clickTolerance)){var g=this._startPos;this._lastPos=p,this._box||(this._box=Z.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),O=Math.max(g.y,p.y);Z.setTransform(this._box,"translate("+S+"px,"+C+"px)"),this._box.style.width=w-S+"px",this._box.style.height=O-C+"px"}}},gs.prototype.mouseupWindow=function(h,v){var p=this;if(this._active&&h.button===0){var g=this._startPos,S=v;if(this.reset(),Z.suppressClick(),g.x!==S.x||g.y!==S.y)return this._map.fire(new y.Event("boxzoomend",{originalEvent:h})),{cameraAnimation:function(w){return w.fitScreenCoordinates(g,S,p._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",h)}},gs.prototype.keydown=function(h){this._active&&h.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",h))},gs.prototype.blur=function(){this.reset()},gs.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(Z.remove(this._box),this._box=null),Z.enableDrag(),delete this._startPos,delete this._lastPos},gs.prototype._fireEvent=function(h,v){return this._map.fire(new y.Event(h,{originalEvent:v}))};var Tc=function(h){this.reset(),this.numTouches=h.numTouches};Tc.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Tc.prototype.touchstart=function(h,v,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 y.Point(0,0),w=0,C=g;w<C.length;w+=1)S._add(C[w]);return S.div(g.length)}(v),this.touches=Lf(p,v)))},Tc.prototype.touchmove=function(h,v,p){if(!this.aborted&&this.centroid){var g=Lf(p,v);for(var S in this.touches){var w=g[S];(!w||w.dist(this.touches[S])>30)&&(this.aborted=!0)}}},Tc.prototype.touchend=function(h,v,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 as=function(h){this.singleTap=new Tc(h),this.numTaps=h.numTaps,this.reset()};as.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},as.prototype.touchstart=function(h,v,p){this.singleTap.touchstart(h,v,p)},as.prototype.touchmove=function(h,v,p){this.singleTap.touchmove(h,v,p)},as.prototype.touchend=function(h,v,p){var g=this.singleTap.touchend(h,v,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 pa=function(){this._zoomIn=new as({numTouches:1,numTaps:2}),this._zoomOut=new as({numTouches:2,numTaps:1}),this.reset()};pa.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},pa.prototype.touchstart=function(h,v,p){this._zoomIn.touchstart(h,v,p),this._zoomOut.touchstart(h,v,p)},pa.prototype.touchmove=function(h,v,p){this._zoomIn.touchmove(h,v,p),this._zoomOut.touchmove(h,v,p)},pa.prototype.touchend=function(h,v,p){var g=this,S=this._zoomIn.touchend(h,v,p),w=this._zoomOut.touchend(h,v,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},pa.prototype.touchcancel=function(){this.reset()},pa.prototype.enable=function(){this._enabled=!0},pa.prototype.disable=function(){this._enabled=!1,this.reset()},pa.prototype.isEnabled=function(){return this._enabled},pa.prototype.isActive=function(){return this._active};var Bf={0:1,2:2},sn=function(h){this.reset(),this._clickTolerance=h.clickTolerance||1};sn.prototype.blur=function(){this.reset()},sn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},sn.prototype._correctButton=function(h,v){return!1},sn.prototype._move=function(h,v){return{}},sn.prototype.mousedown=function(h,v){if(!this._lastPoint){var p=Z.mouseButton(h);this._correctButton(h,p)&&(this._lastPoint=v,this._eventButton=p)}},sn.prototype.mousemoveWindow=function(h,v){var p=this._lastPoint;if(p){if(h.preventDefault(),function(g,S){var w=Bf[S];return g.buttons===void 0||(g.buttons&w)!==w}(h,this._eventButton))this.reset();else if(this._moved||!(v.dist(p)<this._clickTolerance))return this._moved=!0,this._lastPoint=v,this._move(p,v)}},sn.prototype.mouseupWindow=function(h){this._lastPoint&&Z.mouseButton(h)===this._eventButton&&(this._moved&&Z.suppressClick(),this.reset())},sn.prototype.enable=function(){this._enabled=!0},sn.prototype.disable=function(){this._enabled=!1,this.reset()},sn.prototype.isEnabled=function(){return this._enabled},sn.prototype.isActive=function(){return this._active};var ll=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.mousedown=function(p,g){h.prototype.mousedown.call(this,p,g),this._lastPoint&&(this._active=!0)},v.prototype._correctButton=function(p,g){return g===0&&!p.ctrlKey},v.prototype._move=function(p,g){return{around:g,panDelta:g.sub(p)}},v}(sn),af=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype._correctButton=function(p,g){return g===0&&p.ctrlKey||g===2},v.prototype._move=function(p,g){var S=.8*(g.x-p.x);if(S)return this._active=!0,{bearingDelta:S}},v.prototype.contextmenu=function(p){p.preventDefault()},v}(sn),of=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype._correctButton=function(p,g){return g===0&&p.ctrlKey||g===2},v.prototype._move=function(p,g){var S=-.5*(g.y-p.y);if(S)return this._active=!0,{pitchDelta:S}},v.prototype.contextmenu=function(p){p.preventDefault()},v}(sn),yu=function(h){this._minTouches=1,this._clickTolerance=h.clickTolerance||1,this.reset()};yu.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new y.Point(0,0)},yu.prototype.touchstart=function(h,v,p){return this._calculateTransform(h,v,p)},yu.prototype.touchmove=function(h,v,p){if(this._active&&!(p.length<this._minTouches))return h.preventDefault(),this._calculateTransform(h,v,p)},yu.prototype.touchend=function(h,v,p){this._calculateTransform(h,v,p),this._active&&p.length<this._minTouches&&this.reset()},yu.prototype.touchcancel=function(){this.reset()},yu.prototype._calculateTransform=function(h,v,p){p.length>0&&(this._active=!0);var g=Lf(p,v),S=new y.Point(0,0),w=new y.Point(0,0),C=0;for(var O in g){var X=g[O],J=this._touches[O];J&&(S._add(X),w._add(X.sub(J)),C++,g[O]=X)}if(this._touches=g,!(C<this._minTouches)&&w.mag()){var me=w.div(C);if(this._sum._add(me),!(this._sum.mag()<this._clickTolerance))return{around:S.div(C),panDelta:me}}},yu.prototype.enable=function(){this._enabled=!0},yu.prototype.disable=function(){this._enabled=!1,this.reset()},yu.prototype.isEnabled=function(){return this._enabled},yu.prototype.isActive=function(){return this._active};var zs=function(){this.reset()};function Ff(h,v,p){for(var g=0;g<h.length;g++)if(h[g].identifier===p)return v[g]}function Nf(h,v){return Math.log(h/v)/Math.LN2}zs.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},zs.prototype._start=function(h){},zs.prototype._move=function(h,v,p){return{}},zs.prototype.touchstart=function(h,v,p){this._firstTwoTouches||p.length<2||(this._firstTwoTouches=[p[0].identifier,p[1].identifier],this._start([v[0],v[1]]))},zs.prototype.touchmove=function(h,v,p){if(this._firstTwoTouches){h.preventDefault();var g=this._firstTwoTouches,S=g[1],w=Ff(p,v,g[0]),C=Ff(p,v,S);if(w&&C){var O=this._aroundCenter?null:w.add(C).div(2);return this._move([w,C],O,h)}}},zs.prototype.touchend=function(h,v,p){if(this._firstTwoTouches){var g=this._firstTwoTouches,S=g[1],w=Ff(p,v,g[0]),C=Ff(p,v,S);w&&C||(this._active&&Z.suppressClick(),this.reset())}},zs.prototype.touchcancel=function(){this.reset()},zs.prototype.enable=function(h){this._enabled=!0,this._aroundCenter=!!h&&h.around==="center"},zs.prototype.disable=function(){this._enabled=!1,this.reset()},zs.prototype.isEnabled=function(){return this._enabled},zs.prototype.isActive=function(){return this._active};var ys=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.reset=function(){h.prototype.reset.call(this),delete this._distance,delete this._startDistance},v.prototype._start=function(p){this._startDistance=this._distance=p[0].dist(p[1])},v.prototype._move=function(p,g){var S=this._distance;if(this._distance=p[0].dist(p[1]),this._active||!(Math.abs(Nf(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Nf(this._distance,S),pinchAround:g}},v}(zs);function _u(h,v){return 180*h.angleWith(v)/Math.PI}var hp=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.reset=function(){h.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},v.prototype._start=function(p){this._startVector=this._vector=p[0].sub(p[1]),this._minDiameter=p[0].dist(p[1])},v.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:_u(this._vector,S),pinchAround:g}},v.prototype._isBelowThreshold=function(p){this._minDiameter=Math.min(this._minDiameter,p.mag());var g=25/(Math.PI*this._minDiameter)*360,S=_u(p,this._startVector);return Math.abs(S)<g},v}(zs);function wc(h){return Math.abs(h.y)>Math.abs(h.x)}var Cc=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.reset=function(){h.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},v.prototype._start=function(p){this._lastPoints=p,wc(p[0].sub(p[1]))&&(this._valid=!1)},v.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}},v.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 O=p.y>0==g.y>0;return wc(p)&&wc(g)&&O}},v}(zs),Uf={panStep:100,bearingStep:15,pitchStep:10},Js=function(){var h=Uf;this._panStep=h.panStep,this._bearingStep=h.bearingStep,this._pitchStep=h.pitchStep,this._rotationDisabled=!1};function Ft(h){return h*(2-h)}Js.prototype.blur=function(){this.reset()},Js.prototype.reset=function(){this._active=!1},Js.prototype.keydown=function(h){var v=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(O){var X=O.getZoom();O.easeTo({duration:300,easeId:"keyboardHandler",easing:Ft,zoom:p?Math.round(X)+p*(h.shiftKey?2:1):X,bearing:O.getBearing()+g*v._bearingStep,pitch:O.getPitch()+S*v._pitchStep,offset:[-w*v._panStep,-C*v._panStep],center:O.getCenter()},{originalEvent:h})}}}},Js.prototype.enable=function(){this._enabled=!0},Js.prototype.disable=function(){this._enabled=!1,this.reset()},Js.prototype.isEnabled=function(){return this._enabled},Js.prototype.isActive=function(){return this._active},Js.prototype.disableRotation=function(){this._rotationDisabled=!0},Js.prototype.enableRotation=function(){this._rotationDisabled=!1};var Me=function(h,v){this._map=h,this._el=h.getCanvasContainer(),this._handler=v,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,y.bindAll(["_onTimeout"],this)};Me.prototype.setZoomRate=function(h){this._defaultZoomRate=h},Me.prototype.setWheelZoomRate=function(h){this._wheelZoomRate=h},Me.prototype.isEnabled=function(){return!!this._enabled},Me.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Me.prototype.isZooming=function(){return!!this._zooming},Me.prototype.enable=function(h){this.isEnabled()||(this._enabled=!0,this._aroundCenter=h&&h.around==="center")},Me.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Me.prototype.wheel=function(h){if(this.isEnabled()){var v=h.deltaMode===y.window.WheelEvent.DOM_DELTA_LINE?40*h.deltaY:h.deltaY,p=y.browser.now(),g=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,v!==0&&v%4.000244140625==0?this._type="wheel":v!==0&&Math.abs(v)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=v,this._timeout=setTimeout(this._onTimeout,40,h)):this._type||(this._type=Math.abs(g*v)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,v+=this._lastValue)),h.shiftKey&&v&&(v/=4),this._type&&(this._lastWheelEvent=h,this._delta-=v,this._active||this._start(h)),h.preventDefault()}},Me.prototype._onTimeout=function(h){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(h)},Me.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 v=Z.mousePos(this._el,h);this._around=y.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(v)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Me.prototype.renderFrame=function(){var h=this;if(this._frameId&&(this._frameId=null,this.isActive())){var v=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"?v.zoomScale(this._targetZoom):v.scale;this._targetZoom=Math.min(v.maxZoom,Math.max(v.minZoom,v.scaleZoom(S*g))),this._type==="wheel"&&(this._startZoom=v.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var w,C=typeof this._targetZoom=="number"?this._targetZoom:v.zoom,O=this._startZoom,X=this._easing,J=!1;if(this._type==="wheel"&&O&&X){var me=Math.min((y.browser.now()-this._lastWheelEventTime)/200,1),be=X(me);w=y.number(O,C,be),me<1?this._frameId||(this._frameId=!0):J=!0}else w=C,J=!0;return this._active=!0,J&&(this._active=!1,this._finishTimeout=setTimeout(function(){h._zooming=!1,h._handler._triggerRenderFrame(),delete h._targetZoom,delete h._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!J,zoomDelta:w-v.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Me.prototype._smoothOutEasing=function(h){var v=y.ease;if(this._prevEase){var p=this._prevEase,g=(y.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);v=y.bezier(w,C,.25,1)}return this._prevEase={start:y.browser.now(),duration:h,easing:v},v},Me.prototype.blur=function(){this.reset()},Me.prototype.reset=function(){this._active=!1};var F=function(h,v){this._clickZoom=h,this._tapZoom=v};F.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},F.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},F.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},F.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var eu=function(){this.reset()};eu.prototype.reset=function(){this._active=!1},eu.prototype.blur=function(){this.reset()},eu.prototype.dblclick=function(h,v){return h.preventDefault(),{cameraAnimation:function(p){p.easeTo({duration:300,zoom:p.getZoom()+(h.shiftKey?-1:1),around:p.unproject(v)},{originalEvent:h})}}},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 _e=function(){this._tap=new as({numTouches:1,numTaps:1}),this.reset()};_e.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},_e.prototype.touchstart=function(h,v,p){this._swipePoint||(this._tapTime&&h.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?p.length>0&&(this._swipePoint=v[0],this._swipeTouch=p[0].identifier):this._tap.touchstart(h,v,p))},_e.prototype.touchmove=function(h,v,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;var g=v[0],S=g.y-this._swipePoint.y;return this._swipePoint=g,h.preventDefault(),this._active=!0,{zoomDelta:S/128}}}else this._tap.touchmove(h,v,p)},_e.prototype.touchend=function(h,v,p){this._tapTime?this._swipePoint&&p.length===0&&this.reset():this._tap.touchend(h,v,p)&&(this._tapTime=h.timeStamp)},_e.prototype.touchcancel=function(){this.reset()},_e.prototype.enable=function(){this._enabled=!0},_e.prototype.disable=function(){this._enabled=!1,this.reset()},_e.prototype.isEnabled=function(){return this._enabled},_e.prototype.isActive=function(){return this._active};var Pl=function(h,v,p){this._el=h,this._mousePan=v,this._touchPan=p};Pl.prototype.enable=function(h){this._inertiaOptions=h||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Pl.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Pl.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Pl.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Ka=function(h,v,p){this._pitchWithRotate=h.pitchWithRotate,this._mouseRotate=v,this._mousePitch=p};Ka.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Ka.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Ka.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Ka.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Zs=function(h,v,p,g){this._el=h,this._touchZoom=v,this._touchRotate=p,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0};Zs.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")},Zs.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Zs.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Zs.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Zs.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Zs.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Mo=function(h){return h.zoom||h.drag||h.pitch||h.rotate},_s=function(h){function v(){h.apply(this,arguments)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v}(y.Event);function Bn(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta}var An=function(h,v){this._map=h,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Df(h),this._bearingSnap=v.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(v),y.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],[y.window.document,"mousemove",{capture:!0}],[y.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],[y.window,"blur",void 0]];for(var g=0,S=this._listeners;g<S.length;g+=1){var w=S[g],C=w[0];Z.addEventListener(C,w[1],C===y.window.document?this.handleWindowEvent:this.handleEvent,w[2])}};An.prototype.destroy=function(){for(var h=0,v=this._listeners;h<v.length;h+=1){var p=v[h],g=p[0];Z.removeEventListener(g,p[1],g===y.window.document?this.handleWindowEvent:this.handleEvent,p[2])}},An.prototype._addDefaultHandlers=function(h){var v=this._map,p=v.getCanvasContainer();this._add("mapEvent",new io(v,h));var g=v.boxZoom=new gs(v,h);this._add("boxZoom",g);var S=new pa,w=new eu;v.doubleClickZoom=new F(w,S),this._add("tapZoom",S),this._add("clickZoom",w);var C=new _e;this._add("tapDragZoom",C);var O=v.touchPitch=new Cc;this._add("touchPitch",O);var X=new af(h),J=new of(h);v.dragRotate=new Ka(h,X,J),this._add("mouseRotate",X,["mousePitch"]),this._add("mousePitch",J,["mouseRotate"]);var me=new ll(h),be=new yu(h);v.dragPan=new Pl(p,me,be),this._add("mousePan",me),this._add("touchPan",be,["touchZoom","touchRotate"]);var Te=new hp,je=new ys;v.touchZoomRotate=new Zs(p,je,Te,C),this._add("touchRotate",Te,["touchPan","touchZoom"]),this._add("touchZoom",je,["touchPan","touchRotate"]);var Ze=v.scrollZoom=new Me(v,this);this._add("scrollZoom",Ze,["mousePan"]);var lt=v.keyboard=new Js;this._add("keyboard",lt),this._add("blockableMapEvent",new xn(v));for(var Ne=0,ot=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];Ne<ot.length;Ne+=1){var _t=ot[Ne];h.interactive&&h[_t]&&v[_t].enable(h[_t])}},An.prototype._add=function(h,v,p){this._handlers.push({handlerName:h,handler:v,allowed:p}),this._handlersById[h]=v},An.prototype.stop=function(h){if(!this._updatingCamera){for(var v=0,p=this._handlers;v<p.length;v+=1)p[v].handler.reset();this._inertia.clear(),this._fireEvents({},{},h),this._changes=[]}},An.prototype.isActive=function(){for(var h=0,v=this._handlers;h<v.length;h+=1)if(v[h].handler.isActive())return!0;return!1},An.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},An.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},An.prototype.isMoving=function(){return!!Mo(this._eventsInProgress)||this.isZooming()},An.prototype._blockedByActive=function(h,v,p){for(var g in h)if(g!==p&&(!v||v.indexOf(g)<0))return!0;return!1},An.prototype.handleWindowEvent=function(h){this.handleEvent(h,h.type+"Window")},An.prototype._getMapTouches=function(h){for(var v=[],p=0,g=h;p<g.length;p+=1){var S=g[p];this._el.contains(S.target)&&v.push(S)}return v},An.prototype.handleEvent=function(h,v){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,O=C?Z.touchPos(this._el,C):Z.mousePos(this._el,h),X=0,J=this._handlers;X<J.length;X+=1){var me=J[X],be=me.handlerName,Te=me.handler,je=me.allowed;if(Te.isEnabled()){var Ze=void 0;this._blockedByActive(w,je,be)?Te.reset():Te[v||h.type]&&(Ze=Te[v||h.type](h,O,C),this.mergeHandlerResult(g,S,Ze,be,p),Ze&&Ze.needsRenderFrame&&this._triggerRenderFrame()),(Ze||Te.isActive())&&(w[be]=Te)}}var lt={};for(var Ne in this._previousActiveHandlers)w[Ne]||(lt[Ne]=p);this._previousActiveHandlers=w,(Object.keys(lt).length||Bn(g))&&(this._changes.push([g,S,lt]),this._triggerRenderFrame()),(Object.keys(w).length||Bn(g))&&this._map._stop(!0),this._updatingCamera=!1;var ot=g.cameraAnimation;ot&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ot(this._map))},An.prototype.mergeHandlerResult=function(h,v,p,g,S){if(p){y.extend(h,p);var w={handlerName:g,originalEvent:p.originalEvent||S};p.zoomDelta!==void 0&&(v.zoom=w),p.panDelta!==void 0&&(v.drag=w),p.pitchDelta!==void 0&&(v.pitch=w),p.bearingDelta!==void 0&&(v.rotate=w)}},An.prototype._applyChanges=function(){for(var h={},v={},p={},g=0,S=this._changes;g<S.length;g+=1){var w=S[g],C=w[0],O=w[1],X=w[2];C.panDelta&&(h.panDelta=(h.panDelta||new y.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),y.extend(v,O),y.extend(p,X)}this._updateMapTransform(h,v,p),this._changes=[]},An.prototype._updateMapTransform=function(h,v,p){var g=this._map,S=g.transform;if(!Bn(h))return this._fireEvents(v,p,!0);var w=h.panDelta,C=h.zoomDelta,O=h.bearingDelta,X=h.pitchDelta,J=h.around,me=h.pinchAround;me!==void 0&&(J=me),g._stop(!0),J=J||g.transform.centerPoint;var be=S.pointLocation(w?J.sub(w):J);O&&(S.bearing+=O),X&&(S.pitch+=X),C&&(S.zoom+=C),S.setLocationAtPoint(be,J),this._map._update(),h.noInertia||this._inertia.record(h),this._fireEvents(v,p,!0)},An.prototype._fireEvents=function(h,v,p){var g=this,S=Mo(this._eventsInProgress),w=Mo(h),C={};for(var O in h)this._eventsInProgress[O]||(C[O+"start"]=h[O].originalEvent),this._eventsInProgress[O]=h[O];for(var X in!S&&w&&this._fireEvent("movestart",w.originalEvent),C)this._fireEvent(X,C[X]);for(var J in w&&this._fireEvent("move",w.originalEvent),h)this._fireEvent(J,h[J].originalEvent);var me,be={};for(var Te in this._eventsInProgress){var je=this._eventsInProgress[Te],Ze=je.handlerName,lt=je.originalEvent;this._handlersById[Ze].isActive()||(delete this._eventsInProgress[Te],be[Te+"end"]=me=v[Ze]||lt)}for(var Ne in be)this._fireEvent(Ne,be[Ne]);var ot=Mo(this._eventsInProgress);if(p&&(S||w)&&!ot){this._updatingCamera=!0;var _t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Lt=function(ir){return ir!==0&&-g._bearingSnap<ir&&ir<g._bearingSnap};_t?(Lt(_t.bearing||this._map.getBearing())&&(_t.bearing=0),this._map.easeTo(_t,{originalEvent:me})):(this._map.fire(new y.Event("moveend",{originalEvent:me})),Lt(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},An.prototype._fireEvent=function(h,v){this._map.fire(new y.Event(h,v?{originalEvent:v}:{}))},An.prototype._requestFrame=function(){var h=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(v){delete h._frameId,h.handleEvent(new _s("renderFrame",{timeStamp:v})),h._applyChanges()})},An.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var os=function(h){function v(p,g){h.call(this),this._moving=!1,this._zooming=!1,this.transform=p,this._bearingSnap=g.bearingSnap,y.bindAll(["_renderFrameCallback"],this)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.getCenter=function(){return new y.LngLat(this.transform.center.lng,this.transform.center.lat)},v.prototype.setCenter=function(p,g){return this.jumpTo({center:p},g)},v.prototype.panBy=function(p,g,S){return p=y.Point.convert(p).mult(-1),this.panTo(this.transform.center,y.extend({offset:p},g),S)},v.prototype.panTo=function(p,g,S){return this.easeTo(y.extend({center:p},g),S)},v.prototype.getZoom=function(){return this.transform.zoom},v.prototype.setZoom=function(p,g){return this.jumpTo({zoom:p},g),this},v.prototype.zoomTo=function(p,g,S){return this.easeTo(y.extend({zoom:p},g),S)},v.prototype.zoomIn=function(p,g){return this.zoomTo(this.getZoom()+1,p,g),this},v.prototype.zoomOut=function(p,g){return this.zoomTo(this.getZoom()-1,p,g),this},v.prototype.getBearing=function(){return this.transform.bearing},v.prototype.setBearing=function(p,g){return this.jumpTo({bearing:p},g),this},v.prototype.getPadding=function(){return this.transform.padding},v.prototype.setPadding=function(p,g){return this.jumpTo({padding:p},g),this},v.prototype.rotateTo=function(p,g,S){return this.easeTo(y.extend({bearing:p},g),S)},v.prototype.resetNorth=function(p,g){return this.rotateTo(0,y.extend({duration:1e3},p),g),this},v.prototype.resetNorthPitch=function(p,g){return this.easeTo(y.extend({bearing:0,pitch:0,duration:1e3},p),g),this},v.prototype.snapToNorth=function(p,g){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(p,g):this},v.prototype.getPitch=function(){return this.transform.pitch},v.prototype.setPitch=function(p,g){return this.jumpTo({pitch:p},g),this},v.prototype.cameraForBounds=function(p,g){p=y.LngLatBounds.convert(p);var S=g&&g.bearing||0;return this._cameraForBoxAndBearing(p.getNorthWest(),p.getSouthEast(),S,g)},v.prototype._cameraForBoxAndBearing=function(p,g,S,w){var C={top:0,bottom:0,right:0,left:0};if(typeof(w=y.extend({padding:C,offset:[0,0],maxZoom:this.transform.maxZoom},w)).padding=="number"){var O=w.padding;w.padding={top:O,bottom:O,right:O,left:O}}w.padding=y.extend(C,w.padding);var X=this.transform,J=X.padding,me=X.project(y.LngLat.convert(p)),be=X.project(y.LngLat.convert(g)),Te=me.rotate(-S*Math.PI/180),je=be.rotate(-S*Math.PI/180),Ze=new y.Point(Math.max(Te.x,je.x),Math.max(Te.y,je.y)),lt=new y.Point(Math.min(Te.x,je.x),Math.min(Te.y,je.y)),Ne=Ze.sub(lt),ot=(X.width-(J.left+J.right+w.padding.left+w.padding.right))/Ne.x,_t=(X.height-(J.top+J.bottom+w.padding.top+w.padding.bottom))/Ne.y;if(!(_t<0||ot<0)){var Lt=Math.min(X.scaleZoom(X.scale*Math.min(ot,_t)),w.maxZoom),ir=typeof w.offset.x=="number"?new y.Point(w.offset.x,w.offset.y):y.Point.convert(w.offset),qt=new y.Point((w.padding.left-w.padding.right)/2,(w.padding.top-w.padding.bottom)/2).rotate(S*Math.PI/180),cr=ir.add(qt).mult(X.scale/X.zoomScale(Lt));return{center:X.unproject(me.add(be).div(2).sub(cr)),zoom:Lt,bearing:S}}y.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},v.prototype.fitBounds=function(p,g,S){return this._fitInternal(this.cameraForBounds(p,g),g,S)},v.prototype.fitScreenCoordinates=function(p,g,S,w,C){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(y.Point.convert(p)),this.transform.pointLocation(y.Point.convert(g)),S,w),w,C)},v.prototype._fitInternal=function(p,g,S){return p?(delete(g=y.extend(p,g)).padding,g.linear?this.easeTo(g,S):this.flyTo(g,S)):this},v.prototype.jumpTo=function(p,g){this.stop();var S=this.transform,w=!1,C=!1,O=!1;return"zoom"in p&&S.zoom!==+p.zoom&&(w=!0,S.zoom=+p.zoom),p.center!==void 0&&(S.center=y.LngLat.convert(p.center)),"bearing"in p&&S.bearing!==+p.bearing&&(C=!0,S.bearing=+p.bearing),"pitch"in p&&S.pitch!==+p.pitch&&(O=!0,S.pitch=+p.pitch),p.padding==null||S.isPaddingEqual(p.padding)||(S.padding=p.padding),this.fire(new y.Event("movestart",g)).fire(new y.Event("move",g)),w&&this.fire(new y.Event("zoomstart",g)).fire(new y.Event("zoom",g)).fire(new y.Event("zoomend",g)),C&&this.fire(new y.Event("rotatestart",g)).fire(new y.Event("rotate",g)).fire(new y.Event("rotateend",g)),O&&this.fire(new y.Event("pitchstart",g)).fire(new y.Event("pitch",g)).fire(new y.Event("pitchend",g)),this.fire(new y.Event("moveend",g))},v.prototype.easeTo=function(p,g){var S=this;this._stop(!1,p.easeId),((p=y.extend({offset:[0,0],duration:500,easing:y.ease},p)).animate===!1||!p.essential&&y.browser.prefersReducedMotion)&&(p.duration=0);var w=this.transform,C=this.getZoom(),O=this.getBearing(),X=this.getPitch(),J=this.getPadding(),me="zoom"in p?+p.zoom:C,be="bearing"in p?this._normalizeBearing(p.bearing,O):O,Te="pitch"in p?+p.pitch:X,je="padding"in p?p.padding:w.padding,Ze=y.Point.convert(p.offset),lt=w.centerPoint.add(Ze),Ne=w.pointLocation(lt),ot=y.LngLat.convert(p.center||Ne);this._normalizeCenter(ot);var _t,Lt,ir=w.project(Ne),qt=w.project(ot).sub(ir),cr=w.zoomScale(me-C);p.around&&(_t=y.LngLat.convert(p.around),Lt=w.locationPoint(_t));var br={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||me!==C,this._rotating=this._rotating||O!==be,this._pitching=this._pitching||Te!==X,this._padding=!w.isPaddingEqual(je),this._easeId=p.easeId,this._prepareEase(g,p.noMoveStart,br),this._ease(function(Hr){if(S._zooming&&(w.zoom=y.number(C,me,Hr)),S._rotating&&(w.bearing=y.number(O,be,Hr)),S._pitching&&(w.pitch=y.number(X,Te,Hr)),S._padding&&(w.interpolatePadding(J,je,Hr),lt=w.centerPoint.add(Ze)),_t)w.setLocationAtPoint(_t,Lt);else{var Fr=w.zoomScale(w.zoom-C),hn=me>C?Math.min(2,cr):Math.max(.5,cr),Un=Math.pow(hn,1-Hr),Fn=w.unproject(ir.add(qt.mult(Hr*Un)).mult(Fr));w.setLocationAtPoint(w.renderWorldCopies?Fn.wrap():Fn,lt)}S._fireMoveEvents(g)},function(Hr){S._afterEase(g,Hr)},p),this},v.prototype._prepareEase=function(p,g,S){S===void 0&&(S={}),this._moving=!0,g||S.moving||this.fire(new y.Event("movestart",p)),this._zooming&&!S.zooming&&this.fire(new y.Event("zoomstart",p)),this._rotating&&!S.rotating&&this.fire(new y.Event("rotatestart",p)),this._pitching&&!S.pitching&&this.fire(new y.Event("pitchstart",p))},v.prototype._fireMoveEvents=function(p){this.fire(new y.Event("move",p)),this._zooming&&this.fire(new y.Event("zoom",p)),this._rotating&&this.fire(new y.Event("rotate",p)),this._pitching&&this.fire(new y.Event("pitch",p))},v.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 y.Event("zoomend",p)),w&&this.fire(new y.Event("rotateend",p)),C&&this.fire(new y.Event("pitchend",p)),this.fire(new y.Event("moveend",p))}},v.prototype.flyTo=function(p,g){var S=this;if(!p.essential&&y.browser.prefersReducedMotion){var w=y.pick(p,["center","zoom","bearing","pitch","around"]);return this.jumpTo(w,g)}this.stop(),p=y.extend({offset:[0,0],speed:1.2,curve:1.42,easing:y.ease},p);var C=this.transform,O=this.getZoom(),X=this.getBearing(),J=this.getPitch(),me=this.getPadding(),be="zoom"in p?y.clamp(+p.zoom,C.minZoom,C.maxZoom):O,Te="bearing"in p?this._normalizeBearing(p.bearing,X):X,je="pitch"in p?+p.pitch:J,Ze="padding"in p?p.padding:C.padding,lt=C.zoomScale(be-O),Ne=y.Point.convert(p.offset),ot=C.centerPoint.add(Ne),_t=C.pointLocation(ot),Lt=y.LngLat.convert(p.center||_t);this._normalizeCenter(Lt);var ir=C.project(_t),qt=C.project(Lt).sub(ir),cr=p.curve,br=Math.max(C.width,C.height),Hr=br/lt,Fr=qt.mag();if("minZoom"in p){var hn=y.clamp(Math.min(p.minZoom,O,be),C.minZoom,C.maxZoom),Un=br/C.zoomScale(hn-O);cr=Math.sqrt(Un/Fr*2)}var Fn=cr*cr;function zn(Qn){var Gn=(Hr*Hr-br*br+(Qn?-1:1)*Fn*Fn*Fr*Fr)/(2*(Qn?Hr:br)*Fn*Fr);return Math.log(Math.sqrt(Gn*Gn+1)-Gn)}function zi(Qn){return(Math.exp(Qn)-Math.exp(-Qn))/2}function gn(Qn){return(Math.exp(Qn)+Math.exp(-Qn))/2}var ii=zn(0),pi=function(Qn){return gn(ii)/gn(ii+cr*Qn)},ri=function(Qn){return br*((gn(ii)*(zi(Gn=ii+cr*Qn)/gn(Gn))-zi(ii))/Fn)/Fr;var Gn},Kn=(zn(1)-ii)/cr;if(Math.abs(Fr)<1e-6||!isFinite(Kn)){if(Math.abs(br-Hr)<1e-6)return this.easeTo(p,g);var fi=Hr<br?-1:1;Kn=Math.abs(Math.log(Hr/br))/cr,ri=function(){return 0},pi=function(Qn){return Math.exp(fi*cr*Qn)}}return p.duration="duration"in p?+p.duration:1e3*Kn/("screenSpeed"in p?+p.screenSpeed/cr:+p.speed),p.maxDuration&&p.duration>p.maxDuration&&(p.duration=0),this._zooming=!0,this._rotating=X!==Te,this._pitching=je!==J,this._padding=!C.isPaddingEqual(Ze),this._prepareEase(g,!1),this._ease(function(Qn){var Gn=Qn*Kn,Io=1/pi(Gn);C.zoom=Qn===1?be:O+C.scaleZoom(Io),S._rotating&&(C.bearing=y.number(X,Te,Qn)),S._pitching&&(C.pitch=y.number(J,je,Qn)),S._padding&&(C.interpolatePadding(me,Ze,Qn),ot=C.centerPoint.add(Ne));var Qa=Qn===1?Lt:C.unproject(ir.add(qt.mult(ri(Gn))).mult(Io));C.setLocationAtPoint(C.renderWorldCopies?Qa.wrap():Qa,ot),S._fireMoveEvents(g)},function(){return S._afterEase(g)},p),this},v.prototype.isEasing=function(){return!!this._easeFrameId},v.prototype.stop=function(){return this._stop()},v.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},v.prototype._ease=function(p,g,S){S.animate===!1||S.duration===0?(p(1),g()):(this._easeStart=y.browser.now(),this._easeOptions=S,this._onEaseFrame=p,this._onEaseEnd=g,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},v.prototype._renderFrameCallback=function(){var p=Math.min((y.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(p)),p<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},v.prototype._normalizeBearing=function(p,g){p=y.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},v.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}},v}(y.Evented),ss=function(h){h===void 0&&(h={}),this.options=h,y.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};ss.prototype.getDefaultPosition=function(){return"bottom-right"},ss.prototype.onAdd=function(h){var v=this.options&&this.options.compact;return this._map=h,this._container=Z.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=Z.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Z.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),v&&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),v===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},ss.prototype.onRemove=function(){Z.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},ss.prototype._setElementTitle=function(h,v){var p=this._map._getUIString("AttributionControl."+v);h.title=p,h.setAttribute("aria-label",p)},ss.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"))},ss.prototype._updateEditLink=function(){var h=this._editLink;h||(h=this._editLink=this._container.querySelector(".mapbox-improve-map"));var v=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||y.config.ACCESS_TOKEN}];if(h){var p=v.reduce(function(g,S,w){return S.value&&(g+=S.key+"="+S.value+(w<v.length-1?"&":"")),g},"?");h.href=y.config.FEEDBACK_URL+"/"+p+(this._map._hash?this._map._hash.getHashString(!0):""),h.rel="noopener nofollow",this._setElementTitle(h,"MapFeedback")}},ss.prototype._updateData=function(h){!h||h.sourceDataType!=="metadata"&&h.sourceDataType!=="visibility"&&h.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},ss.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(O){return typeof O!="string"?"":O})):typeof this.options.customAttribution=="string"&&h.push(this.options.customAttribution)),this._map.style.stylesheet){var v=this._map.style.stylesheet;this.styleOwner=v.owner,this.styleId=v.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(O,X){return O.length-X.length});var C=(h=h.filter(function(O,X){for(var J=X+1;J<h.length;J++)if(h[J].indexOf(O)>=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)}},ss.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var xu=function(){y.bindAll(["_updateLogo"],this),y.bindAll(["_updateCompact"],this)};xu.prototype.onAdd=function(h){this._map=h,this._container=Z.create("div","mapboxgl-ctrl");var v=Z.create("a","mapboxgl-ctrl-logo");return v.target="_blank",v.rel="noopener nofollow",v.href="https://www.mapbox.com/",v.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),v.setAttribute("rel","noopener nofollow"),this._container.appendChild(v),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xu.prototype.onRemove=function(){Z.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},xu.prototype.getDefaultPosition=function(){return"bottom-left"},xu.prototype._updateLogo=function(h){h&&h.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},xu.prototype._logoRequired=function(){if(this._map.style){var h=this._map.style.sourceCaches;for(var v in h)if(h[v].getSource().mapbox_logo)return!0;return!1}},xu.prototype._updateCompact=function(){var h=this._container.children;if(h.length){var v=h[0];this._map.getCanvasContainer().offsetWidth<250?v.classList.add("mapboxgl-compact"):v.classList.remove("mapboxgl-compact")}};var Ba=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ba.prototype.add=function(h){var v=++this._id;return this._queue.push({callback:h,id:v,cancelled:!1}),v},Ba.prototype.remove=function(h){for(var v=this._currentlyRunning,p=0,g=v?this._queue.concat(v):this._queue;p<g.length;p+=1){var S=g[p];if(S.id===h)return void(S.cancelled=!0)}},Ba.prototype.run=function(h){h===void 0&&(h=0);var v=this._currentlyRunning=this._queue;this._queue=[];for(var p=0,g=v;p<g.length;p+=1){var S=g[p];if(!S.cancelled&&(S.callback(h),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Ba.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var tu={"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"},bu=y.window.HTMLImageElement,Eu=y.window.HTMLElement,oa=y.window.ImageBitmap,yo={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},Sh=function(h){function v(g){var S=this;if((g=y.extend({},yo,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 Bi(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 Ba,this._controls=[],this._mapId=y.uniqueId(),this._locale=y.extend({},tu,g.locale),this._clickTolerance=g.clickTolerance,this._requestManager=new y.RequestManager(g.transformRequest,g.accessToken),typeof g.container=="string"){if(this._container=y.window.document.getElementById(g.container),!this._container)throw new Error("Container '"+g.container+"' not found.")}else{if(!(g.container instanceof Eu))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=g.container}if(g.maxBounds&&this.setMaxBounds(g.maxBounds),y.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)}),y.window!==void 0&&(y.window.addEventListener("online",this._onWindowOnline,!1),y.window.addEventListener("resize",this._onWindowResize,!1),y.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new An(this,g),this._hash=g.hash&&new su(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,y.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 ss({customAttribution:g.customAttribution})),this.addControl(new xu,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 y.Event(C.dataType+"data",C))}),this.on("dataloading",function(C){S.fire(new y.Event(C.dataType+"dataloading",C))})}h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v;var p={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return v.prototype._getMapId=function(){return this._mapId},v.prototype.addControl=function(g,S){if(S===void 0&&(S=g.getDefaultPosition?g.getDefaultPosition():"top-right"),!g||!g.onAdd)return this.fire(new y.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},v.prototype.removeControl=function(g){if(!g||!g.onRemove)return this.fire(new y.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},v.prototype.hasControl=function(g){return this._controls.indexOf(g)>-1},v.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 O=!this._moving;return O&&this.fire(new y.Event("movestart",g)).fire(new y.Event("move",g)),this.fire(new y.Event("resize",g)),O&&this.fire(new y.Event("moveend",g)),this},v.prototype.getBounds=function(){return this.transform.getBounds()},v.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},v.prototype.setMaxBounds=function(g){return this.transform.setMaxBounds(y.LngLatBounds.convert(g)),this._update()},v.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")},v.prototype.getMinZoom=function(){return this.transform.minZoom},v.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")},v.prototype.getMaxZoom=function(){return this.transform.maxZoom},v.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")},v.prototype.getMinPitch=function(){return this.transform.minPitch},v.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")},v.prototype.getMaxPitch=function(){return this.transform.maxPitch},v.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},v.prototype.setRenderWorldCopies=function(g){return this.transform.renderWorldCopies=g,this._update()},v.prototype.project=function(g){return this.transform.locationPoint(y.LngLat.convert(g))},v.prototype.unproject=function(g){return this.transform.pointLocation(y.Point.convert(g))},v.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},v.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},v.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},v.prototype._createDelegatedListener=function(g,S,w){var C,O=this;if(g==="mouseenter"||g==="mouseover"){var X=!1;return{layer:S,listener:w,delegates:{mousemove:function(me){var be=O.getLayer(S)?O.queryRenderedFeatures(me.point,{layers:[S]}):[];be.length?X||(X=!0,w.call(O,new Ha(g,O,me.originalEvent,{features:be}))):X=!1},mouseout:function(){X=!1}}}}if(g==="mouseleave"||g==="mouseout"){var J=!1;return{layer:S,listener:w,delegates:{mousemove:function(me){(O.getLayer(S)?O.queryRenderedFeatures(me.point,{layers:[S]}):[]).length?J=!0:J&&(J=!1,w.call(O,new Ha(g,O,me.originalEvent)))},mouseout:function(me){J&&(J=!1,w.call(O,new Ha(g,O,me.originalEvent)))}}}}return{layer:S,listener:w,delegates:(C={},C[g]=function(me){var be=O.getLayer(S)?O.queryRenderedFeatures(me.point,{layers:[S]}):[];be.length&&(me.features=be,w.call(O,me),delete me.features)},C)}},v.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 O in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[g]=this._delegatedListeners[g]||[],this._delegatedListeners[g].push(C),C.delegates)this.on(O,C.delegates[O]);return this},v.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 O in C.delegates)this.once(O,C.delegates[O]);return this},v.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(O){for(var X=O[g],J=0;J<X.length;J++){var me=X[J];if(me.layer===S&&me.listener===w){for(var be in me.delegates)C.off(be,me.delegates[be]);return X.splice(J,1),C}}}(this._delegatedListeners),this)},v.prototype.queryRenderedFeatures=function(g,S){if(!this.style)return[];var w;if(S!==void 0||g===void 0||g instanceof y.Point||Array.isArray(g)||(S=g,g=void 0),S=S||{},(g=g||[[0,0],[this.transform.width,this.transform.height]])instanceof y.Point||typeof g[0]=="number")w=[y.Point.convert(g)];else{var C=y.Point.convert(g[0]),O=y.Point.convert(g[1]);w=[C,new y.Point(O.x,C.y),O,new y.Point(C.x,O.y),C]}return this.style.queryRenderedFeatures(w,S,this.transform)},v.prototype.querySourceFeatures=function(g,S){return this.style.querySourceFeatures(g,S)},v.prototype.setStyle=function(g,S){return(S=y.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))},v.prototype._getUIString=function(g){var S=this._locale[g];if(S==null)throw new Error("Missing UI string '"+g+"'");return S},v.prototype._updateStyle=function(g,S){return this.style&&(this.style.setEventedParent(null),this.style._remove()),g?(this.style=new Bs(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)},v.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Bs(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},v.prototype._diffStyle=function(g,S){var w=this;if(typeof g=="string"){var C=this._requestManager.normalizeStyleURL(g),O=this._requestManager.transformRequest(C,y.ResourceType.Style);y.getJSON(O,function(X,J){X?w.fire(new y.ErrorEvent(X)):J&&w._updateDiff(J,S)})}else typeof g=="object"&&this._updateDiff(g,S)},v.prototype._updateDiff=function(g,S){try{this.style.setState(g)&&this._update(!0)}catch(w){y.warnOnce("Unable to perform style diff: "+(w.message||w.error||w)+". Rebuilding the style from scratch."),this._updateStyle(g,S)}},v.prototype.getStyle=function(){if(this.style)return this.style.serialize()},v.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():y.warnOnce("There is no style added to the map.")},v.prototype.addSource=function(g,S){return this._lazyInitEmptyStyle(),this.style.addSource(g,S),this._update(!0)},v.prototype.isSourceLoaded=function(g){var S=this.style&&this.style.sourceCaches[g];if(S!==void 0)return S.loaded();this.fire(new y.ErrorEvent(new Error("There is no source with ID '"+g+"'")))},v.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 O=w[C];if(O.state!=="loaded"&&O.state!=="errored")return!1}}return!0},v.prototype.addSourceType=function(g,S,w){return this._lazyInitEmptyStyle(),this.style.addSourceType(g,S,w)},v.prototype.removeSource=function(g){return this.style.removeSource(g),this._update(!0)},v.prototype.getSource=function(g){return this.style.getSource(g)},v.prototype.addImage=function(g,S,w){w===void 0&&(w={});var C=w.pixelRatio;C===void 0&&(C=1);var O=w.sdf;O===void 0&&(O=!1);var X=w.stretchX,J=w.stretchY,me=w.content;if(this._lazyInitEmptyStyle(),S instanceof bu||oa&&S instanceof oa){var be=y.browser.getImageData(S);this.style.addImage(g,{data:new y.RGBAImage({width:be.width,height:be.height},be.data),pixelRatio:C,stretchX:X,stretchY:J,content:me,sdf:O,version:0})}else{if(S.width===void 0||S.height===void 0)return this.fire(new y.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 Te=S;this.style.addImage(g,{data:new y.RGBAImage({width:S.width,height:S.height},new Uint8Array(S.data)),pixelRatio:C,stretchX:X,stretchY:J,content:me,sdf:O,version:0,userImage:Te}),Te.onAdd&&Te.onAdd(this,g)}},v.prototype.updateImage=function(g,S){var w=this.style.getImage(g);if(!w)return this.fire(new y.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 bu||oa&&S instanceof oa?y.browser.getImageData(S):S,O=C.width,X=C.height,J=C.data;return O===void 0||X===void 0?this.fire(new y.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`"))):O!==w.data.width||X!==w.data.height?this.fire(new y.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(J,!(S instanceof bu||oa&&S instanceof oa)),void this.style.updateImage(g,w))},v.prototype.hasImage=function(g){return g?!!this.style.getImage(g):(this.fire(new y.ErrorEvent(new Error("Missing required image id"))),!1)},v.prototype.removeImage=function(g){this.style.removeImage(g)},v.prototype.loadImage=function(g,S){y.getImage(this._requestManager.transformRequest(g,y.ResourceType.Image),S)},v.prototype.listImages=function(){return this.style.listImages()},v.prototype.addLayer=function(g,S){return this._lazyInitEmptyStyle(),this.style.addLayer(g,S),this._update(!0)},v.prototype.moveLayer=function(g,S){return this.style.moveLayer(g,S),this._update(!0)},v.prototype.removeLayer=function(g){return this.style.removeLayer(g),this._update(!0)},v.prototype.getLayer=function(g){return this.style.getLayer(g)},v.prototype.setLayerZoomRange=function(g,S,w){return this.style.setLayerZoomRange(g,S,w),this._update(!0)},v.prototype.setFilter=function(g,S,w){return w===void 0&&(w={}),this.style.setFilter(g,S,w),this._update(!0)},v.prototype.getFilter=function(g){return this.style.getFilter(g)},v.prototype.setPaintProperty=function(g,S,w,C){return C===void 0&&(C={}),this.style.setPaintProperty(g,S,w,C),this._update(!0)},v.prototype.getPaintProperty=function(g,S){return this.style.getPaintProperty(g,S)},v.prototype.setLayoutProperty=function(g,S,w,C){return C===void 0&&(C={}),this.style.setLayoutProperty(g,S,w,C),this._update(!0)},v.prototype.getLayoutProperty=function(g,S){return this.style.getLayoutProperty(g,S)},v.prototype.setLight=function(g,S){return S===void 0&&(S={}),this._lazyInitEmptyStyle(),this.style.setLight(g,S),this._update(!0)},v.prototype.getLight=function(){return this.style.getLight()},v.prototype.setFeatureState=function(g,S){return this.style.setFeatureState(g,S),this._update()},v.prototype.removeFeatureState=function(g,S){return this.style.removeFeatureState(g,S),this._update()},v.prototype.getFeatureState=function(g){return this.style.getFeatureState(g)},v.prototype.getContainer=function(){return this._container},v.prototype.getCanvasContainer=function(){return this._canvasContainer},v.prototype.getCanvas=function(){return this._canvas},v.prototype._containerDimensions=function(){var g=0,S=0;return this._container&&(g=this._container.clientWidth||400,S=this._container.clientHeight||300),[g,S]},v.prototype._detectMissingCSS=function(){y.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&y.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/.")},v.prototype._setupContainer=function(){var g=this._container;g.classList.add("mapboxgl-map"),(this._missingCSSCanary=Z.create("div","mapboxgl-canary",g)).style.visibility="hidden",this._detectMissingCSS();var S=this._canvasContainer=Z.create("div","mapboxgl-canvas-container",g);this._interactive&&S.classList.add("mapboxgl-interactive"),this._canvas=Z.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=Z.create("div","mapboxgl-control-container",g),O=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(X){O[X]=Z.create("div","mapboxgl-ctrl-"+X,C)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},v.prototype._resizeCanvas=function(g,S){var w=y.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"},v.prototype._setupPainter=function(){var g=y.extend({},he.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 ma(S,this.transform),y.webpSupported.testSupport(S)):this.fire(new y.ErrorEvent(new Error("Failed to initialize WebGL")))},v.prototype._contextLost=function(g){g.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new y.Event("webglcontextlost",{originalEvent:g}))},v.prototype._contextRestored=function(g){this._setupPainter(),this.resize(),this._update(),this.fire(new y.Event("webglcontextrestored",{originalEvent:g}))},v.prototype._onMapScroll=function(g){if(g.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},v.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},v.prototype._update=function(g){return this.style?(this._styleDirty=this._styleDirty||g,this._sourcesDirty=!0,this.triggerRepaint(),this):this},v.prototype._requestRenderFrame=function(g){return this._update(),this._renderTaskQueue.add(g)},v.prototype._cancelRenderFrame=function(g){this._renderTaskQueue.remove(g)},v.prototype._render=function(g){var S,w=this,C=0,O=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(S=O.createQueryEXT(),O.beginQueryEXT(O.TIME_ELAPSED_EXT,S),C=y.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(g),!this._removed){var X=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var J=this.transform.zoom,me=y.browser.now();this.style.zoomHistory.update(J,me);var be=new y.EvaluationParameters(J,{now:me,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Te=be.crossFadingFactor();Te===1&&Te===this._crossFadingFactor||(X=!0,this._crossFadingFactor=Te),this.style.update(be)}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 y.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new y.Event("load"))),this.style&&(this.style.hasTransitions()||X)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var je=y.browser.now()-C;O.endQueryEXT(O.TIME_ELAPSED_EXT,S),setTimeout(function(){var Ne=O.getQueryObjectEXT(S,O.QUERY_RESULT_EXT)/1e6;O.deleteQueryEXT(S),w.fire(new y.Event("gpu-timing-frame",{cpuTime:je,gpuTime:Ne}))},50)}if(this.listens("gpu-timing-layer")){var Ze=this.painter.collectGpuTimers();setTimeout(function(){var Ne=w.painter.queryGpuTimers(Ze);w.fire(new y.Event("gpu-timing-layer",{layerTimes:Ne}))},50)}var lt=this._sourcesDirty||this._styleDirty||this._placementDirty;return lt||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new y.Event("idle")),!this._loaded||this._fullyLoaded||lt||(this._fullyLoaded=!0),this}},v.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),y.window!==void 0&&(y.window.removeEventListener("resize",this._onWindowResize,!1),y.window.removeEventListener("orientationchange",this._onWindowResize,!1),y.window.removeEventListener("online",this._onWindowOnline,!1));var w=this.painter.context.gl.getExtension("WEBGL_lose_context");w&&w.loseContext(),Ol(this._canvasContainer),Ol(this._controlContainer),Ol(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new y.Event("remove"))},v.prototype.triggerRepaint=function(){var g=this;this.style&&!this._frame&&(this._frame=y.browser.frame(function(S){g._frame=null,g._render(S)}))},v.prototype._onWindowOnline=function(){this._update()},v.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()},v.prototype._setCacheLimits=function(g,S){y.setCacheLimits(g,S)},p.version.get=function(){return y.version},Object.defineProperties(v.prototype,p),v}(os);function Ol(h){h.parentNode&&h.parentNode.removeChild(h)}var zf={showCompass:!0,showZoom:!0,visualizePitch:!1},cl=function(h){var v=this;this.options=y.extend({},zf,h),this._container=Z.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(p){return p.preventDefault()}),this.options.showZoom&&(y.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(p){return v._map.zoomIn({},{originalEvent:p})}),Z.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(p){return v._map.zoomOut({},{originalEvent:p})}),Z.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(y.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(p){v.options.visualizePitch?v._map.resetNorthPitch({},{originalEvent:p}):v._map.resetNorth({},{originalEvent:p})}),this._compassIcon=Z.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};cl.prototype._updateZoomButtons=function(){var h=this._map.getZoom(),v=h===this._map.getMaxZoom(),p=h===this._map.getMinZoom();this._zoomInButton.disabled=v,this._zoomOutButton.disabled=p,this._zoomInButton.setAttribute("aria-disabled",v.toString()),this._zoomOutButton.setAttribute("aria-disabled",p.toString())},cl.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},cl.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 xs(this._map,this._compass,this.options.visualizePitch)),this._container},cl.prototype.onRemove=function(){Z.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},cl.prototype._createButton=function(h,v){var p=Z.create("button",h,this._container);return p.type="button",p.addEventListener("click",v),p},cl.prototype._setButtonTitle=function(h,v){var p=this._map._getUIString("NavigationControl."+v);h.title=p,h.setAttribute("aria-label",p)};var xs=function(h,v,p){p===void 0&&(p=!1),this._clickTolerance=10,this.element=v,this.mouseRotate=new af({clickTolerance:h.dragRotate._mouseRotate._clickTolerance}),this.map=h,p&&(this.mousePitch=new of({clickTolerance:h.dragRotate._mousePitch._clickTolerance})),y.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),Z.addEventListener(v,"mousedown",this.mousedown),Z.addEventListener(v,"touchstart",this.touchstart,{passive:!1}),Z.addEventListener(v,"touchmove",this.touchmove),Z.addEventListener(v,"touchend",this.touchend),Z.addEventListener(v,"touchcancel",this.reset)};function ec(h,v,p){if(h=new y.LngLat(h.lng,h.lat),v){var g=new y.LngLat(h.lng-360,h.lat),S=new y.LngLat(h.lng+360,h.lat),w=p.locationPoint(h).distSqr(v);p.locationPoint(g).distSqr(v)<w?h=g:p.locationPoint(S).distSqr(v)<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}xs.prototype.down=function(h,v){this.mouseRotate.mousedown(h,v),this.mousePitch&&this.mousePitch.mousedown(h,v),Z.disableDrag()},xs.prototype.move=function(h,v){var p=this.map,g=this.mouseRotate.mousemoveWindow(h,v);if(g&&g.bearingDelta&&p.setBearing(p.getBearing()+g.bearingDelta),this.mousePitch){var S=this.mousePitch.mousemoveWindow(h,v);S&&S.pitchDelta&&p.setPitch(p.getPitch()+S.pitchDelta)}},xs.prototype.off=function(){var h=this.element;Z.removeEventListener(h,"mousedown",this.mousedown),Z.removeEventListener(h,"touchstart",this.touchstart,{passive:!1}),Z.removeEventListener(h,"touchmove",this.touchmove),Z.removeEventListener(h,"touchend",this.touchend),Z.removeEventListener(h,"touchcancel",this.reset),this.offTemp()},xs.prototype.offTemp=function(){Z.enableDrag(),Z.removeEventListener(y.window,"mousemove",this.mousemove),Z.removeEventListener(y.window,"mouseup",this.mouseup)},xs.prototype.mousedown=function(h){this.down(y.extend({},h,{ctrlKey:!0,preventDefault:function(){return h.preventDefault()}}),Z.mousePos(this.element,h)),Z.addEventListener(y.window,"mousemove",this.mousemove),Z.addEventListener(y.window,"mouseup",this.mouseup)},xs.prototype.mousemove=function(h){this.move(h,Z.mousePos(this.element,h))},xs.prototype.mouseup=function(h){this.mouseRotate.mouseupWindow(h),this.mousePitch&&this.mousePitch.mouseupWindow(h),this.offTemp()},xs.prototype.touchstart=function(h){h.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=Z.touchPos(this.element,h.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return h.preventDefault()}},this._startPos))},xs.prototype.touchmove=function(h){h.targetTouches.length!==1?this.reset():(this._lastPos=Z.touchPos(this.element,h.targetTouches)[0],this.move({preventDefault:function(){return h.preventDefault()}},this._lastPos))},xs.prototype.touchend=function(h){h.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},xs.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Su={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,v,p){var g=h.classList;for(var S in Su)g.remove("mapboxgl-"+p+"-anchor-"+S);g.add("mapboxgl-"+p+"-anchor-"+v)}var Rc,sf=function(h){function v(p,g){if(h.call(this),(p instanceof y.window.HTMLElement||g)&&(p=y.extend({element:p},g)),y.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=y.Point.convert(p&&p.offset||[0,0]);else{this._defaultMarker=!0,this._element=Z.create("div"),this._element.setAttribute("aria-label","Map marker");var S=Z.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=Z.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=Z.createNS("http://www.w3.org/2000/svg","g");C.setAttributeNS(null,"fill-rule","nonzero");var O=Z.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"transform","translate(3.0, 29.0)"),O.setAttributeNS(null,"fill","#000000");for(var X=0,J=[{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"}];X<J.length;X+=1){var me=J[X],be=Z.createNS("http://www.w3.org/2000/svg","ellipse");be.setAttributeNS(null,"opacity","0.04"),be.setAttributeNS(null,"cx","10.5"),be.setAttributeNS(null,"cy","5.80029008"),be.setAttributeNS(null,"rx",me.rx),be.setAttributeNS(null,"ry",me.ry),O.appendChild(be)}var Te=Z.createNS("http://www.w3.org/2000/svg","g");Te.setAttributeNS(null,"fill",this._color);var je=Z.createNS("http://www.w3.org/2000/svg","path");je.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"),Te.appendChild(je);var Ze=Z.createNS("http://www.w3.org/2000/svg","g");Ze.setAttributeNS(null,"opacity","0.25"),Ze.setAttributeNS(null,"fill","#000000");var lt=Z.createNS("http://www.w3.org/2000/svg","path");lt.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"),Ze.appendChild(lt);var Ne=Z.createNS("http://www.w3.org/2000/svg","g");Ne.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Ne.setAttributeNS(null,"fill","#FFFFFF");var ot=Z.createNS("http://www.w3.org/2000/svg","g");ot.setAttributeNS(null,"transform","translate(8.0, 8.0)");var _t=Z.createNS("http://www.w3.org/2000/svg","circle");_t.setAttributeNS(null,"fill","#000000"),_t.setAttributeNS(null,"opacity","0.25"),_t.setAttributeNS(null,"cx","5.5"),_t.setAttributeNS(null,"cy","5.5"),_t.setAttributeNS(null,"r","5.4999962");var Lt=Z.createNS("http://www.w3.org/2000/svg","circle");Lt.setAttributeNS(null,"fill","#FFFFFF"),Lt.setAttributeNS(null,"cx","5.5"),Lt.setAttributeNS(null,"cy","5.5"),Lt.setAttributeNS(null,"r","5.4999962"),ot.appendChild(_t),ot.appendChild(Lt),C.appendChild(O),C.appendChild(Te),C.appendChild(Ze),C.appendChild(Ne),C.appendChild(ot),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=y.Point.convert(p&&p.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(ir){ir.preventDefault()}),this._element.addEventListener("mousedown",function(ir){ir.preventDefault()}),Zf(this._element,this._anchor,"marker"),this._popup=null}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.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},v.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),Z.remove(this._element),this._popup&&this._popup.remove(),this},v.prototype.getLngLat=function(){return this._lngLat},v.prototype.setLngLat=function(p){return this._lngLat=y.LngLat.convert(p),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},v.prototype.getElement=function(){return this._element},v.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},v.prototype._onKeyPress=function(p){var g=p.code,S=p.charCode||p.keyCode;g!=="Space"&&g!=="Enter"&&S!==32&&S!==13||this.togglePopup()},v.prototype._onMapClick=function(p){var g=p.originalEvent.target,S=this._element;this._popup&&(g===S||S.contains(g))&&this.togglePopup()},v.prototype.getPopup=function(){return this._popup},v.prototype.togglePopup=function(){var p=this._popup;return p?(p.isOpen()?p.remove():p.addTo(this._map),this):this},v.prototype._update=function(p){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=ec(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()),Z.setTransform(this._element,Su[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+S+" "+g)}},v.prototype.getOffset=function(){return this._offset},v.prototype.setOffset=function(p){return this._offset=y.Point.convert(p),this._update(),this},v.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 y.Event("dragstart"))),this.fire(new y.Event("drag")))},v.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 y.Event("dragend")),this._state="inactive"},v.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))},v.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},v.prototype.isDraggable=function(){return this._draggable},v.prototype.setRotation=function(p){return this._rotation=p||0,this._update(),this},v.prototype.getRotation=function(){return this._rotation},v.prototype.setRotationAlignment=function(p){return this._rotationAlignment=p||"auto",this._update(),this},v.prototype.getRotationAlignment=function(){return this._rotationAlignment},v.prototype.setPitchAlignment=function(p){return this._pitchAlignment=p&&p!=="auto"?p:this._rotationAlignment,this._update(),this},v.prototype.getPitchAlignment=function(){return this._pitchAlignment},v}(y.Evented),Vf={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},tc=0,rc=!1,Ah=function(h){function v(p){h.call(this),this.options=y.extend({},Vf,p),y.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.prototype.onAdd=function(p){var g;return this._map=p,this._container=Z.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),g=this._setupUI,Rc!==void 0?g(Rc):y.window.navigator.permissions!==void 0?y.window.navigator.permissions.query({name:"geolocation"}).then(function(S){g(Rc=S.state!=="denied")}):g(Rc=!!y.window.navigator.geolocation),this._container},v.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(y.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(),Z.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,tc=0,rc=!1},v.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())},v.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")}},v.prototype._onSuccess=function(p){if(this._map){if(this._isOutOfMapMaxBounds(p))return this._setErrorState(),this.fire(new y.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 y.Event("geolocate",p)),this._finish()}},v.prototype._updateCamera=function(p){var g=new y.LngLat(p.coords.longitude,p.coords.latitude),S=p.coords.accuracy,w=this._map.getBearing(),C=y.extend({bearing:w},this.options.fitBoundsOptions);this._map.fitBounds(g.toBounds(S),C,{geolocateSource:!0})},v.prototype._updateMarker=function(p){if(p){var g=new y.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()},v.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"},v.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},v.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&&rc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new y.Event("error",p)),this._finish()}},v.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},v.prototype._setupUI=function(p){var g=this;if(this._container.addEventListener("contextmenu",function(C){return C.preventDefault()}),this._geolocateButton=Z.create("button","mapboxgl-ctrl-geolocate",this._container),Z.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",p===!1){y.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=Z.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new sf(this._dotElement),this._circleElement=Z.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new sf({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 y.Event("trackuserlocationend")))})},v.prototype.trigger=function(){if(!this._setup)return y.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 y.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":tc--,rc=!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 y.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 y.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"),++tc>1?(p={maximumAge:6e5,timeout:0},rc=!0):(p=this.options.positionOptions,rc=!1),this._geolocationWatchID=y.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,p)}}else y.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},v.prototype._clearWatch=function(){y.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)},v}(y.Evented),us={maxWidth:100,unit:"metric"},Au=function(h){this.options=y.extend({},us,h),y.bindAll(["_onMove","setUnit"],this)};function uf(h,v,p){var g=p&&p.maxWidth||100,S=h._container.clientHeight/2,w=h.unproject([0,S]),C=h.unproject([g,S]),O=w.distanceTo(C);if(p&&p.unit==="imperial"){var X=3.2808*O;X>5280?kl(v,g,X/5280,h._getUIString("ScaleControl.Miles")):kl(v,g,X,h._getUIString("ScaleControl.Feet"))}else p&&p.unit==="nautical"?kl(v,g,O/1852,h._getUIString("ScaleControl.NauticalMiles")):O>=1e3?kl(v,g,O/1e3,h._getUIString("ScaleControl.Kilometers")):kl(v,g,O,h._getUIString("ScaleControl.Meters"))}function kl(h,v,p,g){var S,w,C,O=(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(X){var J=Math.pow(10,Math.ceil(-Math.log(X)/Math.LN10));return Math.round(X*J)/J}(C)));h.style.width=v*(O/p)+"px",h.innerHTML=O+" "+g}Au.prototype.getDefaultPosition=function(){return"bottom-left"},Au.prototype._onMove=function(){uf(this._map,this._container,this.options)},Au.prototype.onAdd=function(h){return this._map=h,this._container=Z.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Au.prototype.onRemove=function(){Z.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Au.prototype.setUnit=function(h){this.options.unit=h,uf(this._map,this._container,this.options)};var uu=function(h){this._fullscreen=!1,h&&h.container&&(h.container instanceof y.window.HTMLElement?this._container=h.container:y.warnOnce("Full screen control 'container' must be a DOM element.")),y.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in y.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in y.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in y.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in y.window.document&&(this._fullscreenchange="MSFullscreenChange")};uu.prototype.onAdd=function(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=Z.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",y.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},uu.prototype.onRemove=function(){Z.remove(this._controlContainer),this._map=null,y.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},uu.prototype._checkFullscreenSupport=function(){return!!(y.window.document.fullscreenEnabled||y.window.document.mozFullScreenEnabled||y.window.document.msFullscreenEnabled||y.window.document.webkitFullscreenEnabled)},uu.prototype._setupUI=function(){var h=this._fullscreenButton=Z.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);Z.create("span","mapboxgl-ctrl-icon",h).setAttribute("aria-hidden",!0),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),y.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},uu.prototype._updateTitle=function(){var h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h},uu.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},uu.prototype._isFullscreen=function(){return this._fullscreen},uu.prototype._changeIcon=function(){(y.window.document.fullscreenElement||y.window.document.mozFullScreenElement||y.window.document.webkitFullscreenElement||y.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())},uu.prototype._onClickFullscreen=function(){this._isFullscreen()?y.window.document.exitFullscreen?y.window.document.exitFullscreen():y.window.document.mozCancelFullScreen?y.window.document.mozCancelFullScreen():y.window.document.msExitFullscreen?y.window.document.msExitFullscreen():y.window.document.webkitCancelFullScreen&&y.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 Th={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ju=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),jf=function(h){function v(p){h.call(this),this.options=y.extend(Object.create(Th),p),y.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return h&&(v.__proto__=h),(v.prototype=Object.create(h&&h.prototype)).constructor=v,v.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 y.Event("open")),this},v.prototype.isOpen=function(){return!!this._map},v.prototype.remove=function(){return this._content&&Z.remove(this._content),this._container&&(Z.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 y.Event("close")),this},v.prototype.getLngLat=function(){return this._lngLat},v.prototype.setLngLat=function(p){return this._lngLat=y.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},v.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},v.prototype.getElement=function(){return this._container},v.prototype.setText=function(p){return this.setDOMContent(y.window.document.createTextNode(p))},v.prototype.setHTML=function(p){var g,S=y.window.document.createDocumentFragment(),w=y.window.document.createElement("body");for(w.innerHTML=p;g=w.firstChild;)S.appendChild(g);return this.setDOMContent(S)},v.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},v.prototype.setMaxWidth=function(p){return this.options.maxWidth=p,this._update(),this},v.prototype.setDOMContent=function(p){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=Z.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(p),this._createCloseButton(),this._update(),this._focusFirstElement(),this},v.prototype.addClassName=function(p){this._container&&this._container.classList.add(p)},v.prototype.removeClassName=function(p){this._container&&this._container.classList.remove(p)},v.prototype.setOffset=function(p){return this.options.offset=p,this._update(),this},v.prototype.toggleClassName=function(p){if(this._container)return this._container.classList.toggle(p)},v.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=Z.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))},v.prototype._onMouseUp=function(p){this._update(p.point)},v.prototype._onMouseMove=function(p){this._update(p.point)},v.prototype._onDrag=function(p){this._update(p.point)},v.prototype._update=function(p){var g=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=Z.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=Z.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(be){return g._container.classList.add(be)}),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=ec(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 be(Te){if(Te){if(typeof Te=="number"){var je=Math.round(Math.sqrt(.5*Math.pow(Te,2)));return{center:new y.Point(0,0),top:new y.Point(0,Te),"top-left":new y.Point(je,je),"top-right":new y.Point(-je,je),bottom:new y.Point(0,-Te),"bottom-left":new y.Point(je,-je),"bottom-right":new y.Point(-je,-je),left:new y.Point(Te,0),right:new y.Point(-Te,0)}}if(Te instanceof y.Point||Array.isArray(Te)){var Ze=y.Point.convert(Te);return{center:Ze,top:Ze,"top-left":Ze,"top-right":Ze,bottom:Ze,"bottom-left":Ze,"bottom-right":Ze,left:Ze,right:Ze}}return{center:y.Point.convert(Te.center||[0,0]),top:y.Point.convert(Te.top||[0,0]),"top-left":y.Point.convert(Te["top-left"]||[0,0]),"top-right":y.Point.convert(Te["top-right"]||[0,0]),bottom:y.Point.convert(Te.bottom||[0,0]),"bottom-left":y.Point.convert(Te["bottom-left"]||[0,0]),"bottom-right":y.Point.convert(Te["bottom-right"]||[0,0]),left:y.Point.convert(Te.left||[0,0]),right:y.Point.convert(Te.right||[0,0])}}return be(new y.Point(0,0))}(this.options.offset);if(!w){var O,X=this._container.offsetWidth,J=this._container.offsetHeight;O=S.y+C.bottom.y<J?["top"]:S.y>this._map.transform.height-J?["bottom"]:[],S.x<X/2?O.push("left"):S.x>this._map.transform.width-X/2&&O.push("right"),w=O.length===0?"bottom":O.join("-")}var me=S.add(C[w]).round();Z.setTransform(this._container,Su[w]+" translate("+me.x+"px,"+me.y+"px)"),Zf(this._container,w,"popup")}},v.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var p=this._container.querySelector(ju);p&&p.focus()}},v.prototype._onClose=function(){this.remove()},v}(y.Evented),wh={version:y.version,supported:he,setRTLTextPlugin:y.setRTLTextPlugin,getRTLTextPluginStatus:y.getRTLTextPluginStatus,Map:Sh,NavigationControl:cl,GeolocateControl:Ah,AttributionControl:ss,ScaleControl:Au,FullscreenControl:uu,Popup:jf,Marker:sf,Style:Bs,LngLat:y.LngLat,LngLatBounds:y.LngLatBounds,Point:y.Point,MercatorCoordinate:y.MercatorCoordinate,Evented:y.Evented,config:y.config,prewarm:function(){tr().acquire($t)},clearPrewarmedResources:function(){var h=nn;h&&(h.isPreloaded()&&h.numActive()===1?(h.release($t),nn=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 y.config.ACCESS_TOKEN},set accessToken(h){y.config.ACCESS_TOKEN=h},get baseApiUrl(){return y.config.API_URL},set baseApiUrl(h){y.config.API_URL=h},get workerCount(){return yr.workerCount},set workerCount(h){yr.workerCount=h},get maxParallelImageRequests(){return y.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(h){y.config.MAX_PARALLEL_IMAGE_REQUESTS=h},clearStorage:function(h){y.clearTileCache(h)},workerUrl:""};return wh}),te})},63713:function(sr,ne,U){"use strict";sr.exports=ye;var te=U(30551);function ye(oe){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(oe)?oe:new Uint8Array(oe||0),this.pos=0,this.type=0,this.length=this.buf.length}ye.Varint=0,ye.Fixed64=1,ye.Bytes=2,ye.Fixed32=5;var y=65536*65536,he=1/y,Z=12,pe=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");ye.prototype={destroy:function(){this.buf=null},readFields:function(oe,H,re){for(re=re||this.length;this.pos<re;){var Be=this.readVarint(),we=Be>>3,ut=this.pos;this.type=Be&7,oe(we,H,this),this.pos===ut&&this.skip(Be)}return H},readMessage:function(oe,H){return this.readFields(oe,H,this.readVarint()+this.pos)},readFixed32:function(){var oe=Mt(this.buf,this.pos);return this.pos+=4,oe},readSFixed32:function(){var oe=kt(this.buf,this.pos);return this.pos+=4,oe},readFixed64:function(){var oe=Mt(this.buf,this.pos)+Mt(this.buf,this.pos+4)*y;return this.pos+=8,oe},readSFixed64:function(){var oe=Mt(this.buf,this.pos)+kt(this.buf,this.pos+4)*y;return this.pos+=8,oe},readFloat:function(){var oe=te.read(this.buf,this.pos,!0,23,4);return this.pos+=4,oe},readDouble:function(){var oe=te.read(this.buf,this.pos,!0,52,8);return this.pos+=8,oe},readVarint:function(oe){var H=this.buf,re,Be;return Be=H[this.pos++],re=Be&127,Be<128||(Be=H[this.pos++],re|=(Be&127)<<7,Be<128)||(Be=H[this.pos++],re|=(Be&127)<<14,Be<128)||(Be=H[this.pos++],re|=(Be&127)<<21,Be<128)?re:(Be=H[this.pos],re|=(Be&15)<<28,fe(re,oe,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var oe=this.readVarint();return oe%2===1?(oe+1)/-2:oe/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var oe=this.readVarint()+this.pos,H=this.pos;return this.pos=oe,oe-H>=Z&&pe?Dt(this.buf,H,oe):qe(this.buf,H,oe)},readBytes:function(){var oe=this.readVarint()+this.pos,H=this.buf.subarray(this.pos,oe);return this.pos=oe,H},readPackedVarint:function(oe,H){if(this.type!==ye.Bytes)return oe.push(this.readVarint(H));var re=it(this);for(oe=oe||[];this.pos<re;)oe.push(this.readVarint(H));return oe},readPackedSVarint:function(oe){if(this.type!==ye.Bytes)return oe.push(this.readSVarint());var H=it(this);for(oe=oe||[];this.pos<H;)oe.push(this.readSVarint());return oe},readPackedBoolean:function(oe){if(this.type!==ye.Bytes)return oe.push(this.readBoolean());var H=it(this);for(oe=oe||[];this.pos<H;)oe.push(this.readBoolean());return oe},readPackedFloat:function(oe){if(this.type!==ye.Bytes)return oe.push(this.readFloat());var H=it(this);for(oe=oe||[];this.pos<H;)oe.push(this.readFloat());return oe},readPackedDouble:function(oe){if(this.type!==ye.Bytes)return oe.push(this.readDouble());var H=it(this);for(oe=oe||[];this.pos<H;)oe.push(this.readDouble());return oe},readPackedFixed32:function(oe){if(this.type!==ye.Bytes)return oe.push(this.readFixed32());var H=it(this);for(oe=oe||[];this.pos<H;)oe.push(this.readFixed32());return oe},readPackedSFixed32:function(oe){if(this.type!==ye.Bytes)return oe.push(this.readSFixed32());var H=it(this);for(oe=oe||[];this.pos<H;)oe.push(this.readSFixed32());return oe},readPackedFixed64:function(oe){if(this.type!==ye.Bytes)return oe.push(this.readFixed64());var H=it(this);for(oe=oe||[];this.pos<H;)oe.push(this.readFixed64());return oe},readPackedSFixed64:function(oe){if(this.type!==ye.Bytes)return oe.push(this.readSFixed64());var H=it(this);for(oe=oe||[];this.pos<H;)oe.push(this.readSFixed64());return oe},skip:function(oe){var H=oe&7;if(H===ye.Varint)for(;this.buf[this.pos++]>127;);else if(H===ye.Bytes)this.pos=this.readVarint()+this.pos;else if(H===ye.Fixed32)this.pos+=4;else if(H===ye.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+H)},writeTag:function(oe,H){this.writeVarint(oe<<3|H)},realloc:function(oe){for(var H=this.length||16;H<this.pos+oe;)H*=2;if(H!==this.length){var re=new Uint8Array(H);re.set(this.buf),this.buf=re,this.length=H}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(oe){this.realloc(4),ft(this.buf,oe,this.pos),this.pos+=4},writeSFixed32:function(oe){this.realloc(4),ft(this.buf,oe,this.pos),this.pos+=4},writeFixed64:function(oe){this.realloc(8),ft(this.buf,oe&-1,this.pos),ft(this.buf,Math.floor(oe*he),this.pos+4),this.pos+=8},writeSFixed64:function(oe){this.realloc(8),ft(this.buf,oe&-1,this.pos),ft(this.buf,Math.floor(oe*he),this.pos+4),this.pos+=8},writeVarint:function(oe){if(oe=+oe||0,oe>268435455||oe<0){rt(oe,this);return}this.realloc(4),this.buf[this.pos++]=oe&127|(oe>127?128:0),!(oe<=127)&&(this.buf[this.pos++]=(oe>>>=7)&127|(oe>127?128:0),!(oe<=127)&&(this.buf[this.pos++]=(oe>>>=7)&127|(oe>127?128:0),!(oe<=127)&&(this.buf[this.pos++]=oe>>>7&127)))},writeSVarint:function(oe){this.writeVarint(oe<0?-oe*2-1:oe*2)},writeBoolean:function(oe){this.writeVarint(!!oe)},writeString:function(oe){oe=String(oe),this.realloc(oe.length*4),this.pos++;var H=this.pos;this.pos=dr(this.buf,oe,this.pos);var re=this.pos-H;re>=128&&Ot(H,re,this),this.pos=H-1,this.writeVarint(re),this.pos+=re},writeFloat:function(oe){this.realloc(4),te.write(this.buf,oe,this.pos,!0,23,4),this.pos+=4},writeDouble:function(oe){this.realloc(8),te.write(this.buf,oe,this.pos,!0,52,8),this.pos+=8},writeBytes:function(oe){var H=oe.length;this.writeVarint(H),this.realloc(H);for(var re=0;re<H;re++)this.buf[this.pos++]=oe[re]},writeRawMessage:function(oe,H){this.pos++;var re=this.pos;oe(H,this);var Be=this.pos-re;Be>=128&&Ot(re,Be,this),this.pos=re-1,this.writeVarint(Be),this.pos+=Be},writeMessage:function(oe,H,re){this.writeTag(oe,ye.Bytes),this.writeRawMessage(H,re)},writePackedVarint:function(oe,H){H.length&&this.writeMessage(oe,Xt,H)},writePackedSVarint:function(oe,H){H.length&&this.writeMessage(oe,Yt,H)},writePackedBoolean:function(oe,H){H.length&&this.writeMessage(oe,bt,H)},writePackedFloat:function(oe,H){H.length&&this.writeMessage(oe,ar,H)},writePackedDouble:function(oe,H){H.length&&this.writeMessage(oe,Zt,H)},writePackedFixed32:function(oe,H){H.length&&this.writeMessage(oe,St,H)},writePackedSFixed32:function(oe,H){H.length&&this.writeMessage(oe,Rr,H)},writePackedFixed64:function(oe,H){H.length&&this.writeMessage(oe,gr,H)},writePackedSFixed64:function(oe,H){H.length&&this.writeMessage(oe,fr,H)},writeBytesField:function(oe,H){this.writeTag(oe,ye.Bytes),this.writeBytes(H)},writeFixed32Field:function(oe,H){this.writeTag(oe,ye.Fixed32),this.writeFixed32(H)},writeSFixed32Field:function(oe,H){this.writeTag(oe,ye.Fixed32),this.writeSFixed32(H)},writeFixed64Field:function(oe,H){this.writeTag(oe,ye.Fixed64),this.writeFixed64(H)},writeSFixed64Field:function(oe,H){this.writeTag(oe,ye.Fixed64),this.writeSFixed64(H)},writeVarintField:function(oe,H){this.writeTag(oe,ye.Varint),this.writeVarint(H)},writeSVarintField:function(oe,H){this.writeTag(oe,ye.Varint),this.writeSVarint(H)},writeStringField:function(oe,H){this.writeTag(oe,ye.Bytes),this.writeString(H)},writeFloatField:function(oe,H){this.writeTag(oe,ye.Fixed32),this.writeFloat(H)},writeDoubleField:function(oe,H){this.writeTag(oe,ye.Fixed64),this.writeDouble(H)},writeBooleanField:function(oe,H){this.writeVarintField(oe,!!H)}};function fe(oe,H,re){var Be=re.buf,we,ut;if(ut=Be[re.pos++],we=(ut&112)>>4,ut<128||(ut=Be[re.pos++],we|=(ut&127)<<3,ut<128)||(ut=Be[re.pos++],we|=(ut&127)<<10,ut<128)||(ut=Be[re.pos++],we|=(ut&127)<<17,ut<128)||(ut=Be[re.pos++],we|=(ut&127)<<24,ut<128)||(ut=Be[re.pos++],we|=(ut&1)<<31,ut<128))return ce(oe,we,H);throw new Error("Expected varint not more than 10 bytes")}function it(oe){return oe.type===ye.Bytes?oe.readVarint()+oe.pos:oe.pos+1}function ce(oe,H,re){return re?H*4294967296+(oe>>>0):(H>>>0)*4294967296+(oe>>>0)}function rt(oe,H){var re,Be;if(oe>=0?(re=oe%4294967296|0,Be=oe/4294967296|0):(re=~(-oe%4294967296),Be=~(-oe/4294967296),re^4294967295?re=re+1|0:(re=0,Be=Be+1|0)),oe>=18446744073709552e3||oe<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");H.realloc(10),vt(re,Be,H),tt(Be,H)}function vt(oe,H,re){re.buf[re.pos++]=oe&127|128,oe>>>=7,re.buf[re.pos++]=oe&127|128,oe>>>=7,re.buf[re.pos++]=oe&127|128,oe>>>=7,re.buf[re.pos++]=oe&127|128,oe>>>=7,re.buf[re.pos]=oe&127}function tt(oe,H){var re=(oe&7)<<4;H.buf[H.pos++]|=re|((oe>>>=3)?128:0),oe&&(H.buf[H.pos++]=oe&127|((oe>>>=7)?128:0),oe&&(H.buf[H.pos++]=oe&127|((oe>>>=7)?128:0),oe&&(H.buf[H.pos++]=oe&127|((oe>>>=7)?128:0),oe&&(H.buf[H.pos++]=oe&127|((oe>>>=7)?128:0),oe&&(H.buf[H.pos++]=oe&127)))))}function Ot(oe,H,re){var Be=H<=16383?1:H<=2097151?2:H<=268435455?3:Math.floor(Math.log(H)/(Math.LN2*7));re.realloc(Be);for(var we=re.pos-1;we>=oe;we--)re.buf[we+Be]=re.buf[we]}function Xt(oe,H){for(var re=0;re<oe.length;re++)H.writeVarint(oe[re])}function Yt(oe,H){for(var re=0;re<oe.length;re++)H.writeSVarint(oe[re])}function ar(oe,H){for(var re=0;re<oe.length;re++)H.writeFloat(oe[re])}function Zt(oe,H){for(var re=0;re<oe.length;re++)H.writeDouble(oe[re])}function bt(oe,H){for(var re=0;re<oe.length;re++)H.writeBoolean(oe[re])}function St(oe,H){for(var re=0;re<oe.length;re++)H.writeFixed32(oe[re])}function Rr(oe,H){for(var re=0;re<oe.length;re++)H.writeSFixed32(oe[re])}function gr(oe,H){for(var re=0;re<oe.length;re++)H.writeFixed64(oe[re])}function fr(oe,H){for(var re=0;re<oe.length;re++)H.writeSFixed64(oe[re])}function Mt(oe,H){return(oe[H]|oe[H+1]<<8|oe[H+2]<<16)+oe[H+3]*16777216}function ft(oe,H,re){oe[re]=H,oe[re+1]=H>>>8,oe[re+2]=H>>>16,oe[re+3]=H>>>24}function kt(oe,H){return(oe[H]|oe[H+1]<<8|oe[H+2]<<16)+(oe[H+3]<<24)}function qe(oe,H,re){for(var Be="",we=H;we<re;){var ut=oe[we],ie=null,Le=ut>239?4:ut>223?3:ut>191?2:1;if(we+Le>re)break;var Pe,Ge,Vt;Le===1?ut<128&&(ie=ut):Le===2?(Pe=oe[we+1],(Pe&192)===128&&(ie=(ut&31)<<6|Pe&63,ie<=127&&(ie=null))):Le===3?(Pe=oe[we+1],Ge=oe[we+2],(Pe&192)===128&&(Ge&192)===128&&(ie=(ut&15)<<12|(Pe&63)<<6|Ge&63,(ie<=2047||ie>=55296&&ie<=57343)&&(ie=null))):Le===4&&(Pe=oe[we+1],Ge=oe[we+2],Vt=oe[we+3],(Pe&192)===128&&(Ge&192)===128&&(Vt&192)===128&&(ie=(ut&15)<<18|(Pe&63)<<12|(Ge&63)<<6|Vt&63,(ie<=65535||ie>=1114112)&&(ie=null))),ie===null?(ie=65533,Le=1):ie>65535&&(ie-=65536,Be+=String.fromCharCode(ie>>>10&1023|55296),ie=56320|ie&1023),Be+=String.fromCharCode(ie),we+=Le}return Be}function Dt(oe,H,re){return pe.decode(oe.subarray(H,re))}function dr(oe,H,re){for(var Be=0,we,ut;Be<H.length;Be++){if(we=H.charCodeAt(Be),we>55295&&we<57344)if(ut)if(we<56320){oe[re++]=239,oe[re++]=191,oe[re++]=189,ut=we;continue}else we=ut-55296<<10|we-56320|65536,ut=null;else{we>56319||Be+1===H.length?(oe[re++]=239,oe[re++]=191,oe[re++]=189):ut=we;continue}else ut&&(oe[re++]=239,oe[re++]=191,oe[re++]=189,ut=null);we<128?oe[re++]=we:(we<2048?oe[re++]=we>>6|192:(we<65536?oe[re++]=we>>12|224:(oe[re++]=we>>18|240,oe[re++]=we>>12&63|128),oe[re++]=we>>6&63|128),oe[re++]=we&63|128)}return re}},41227:function(sr,ne,U){var te=U(14224);(function(ye,y){sr.exports=y()})(this,function(){"use strict";function ye(ue,k){var z={label:0,sent:function(){if(De[0]&1)throw De[1];return De[1]},trys:[],ops:[]},ae,Ee,De,zt;return zt={next:Tt(0),throw:Tt(1),return:Tt(2)},typeof Symbol=="function"&&(zt[Symbol.iterator]=function(){return this}),zt;function Tt(dt){return function(N){return Rt([dt,N])}}function Rt(dt){if(ae)throw new TypeError("Generator is already executing.");for(;z;)try{if(ae=1,Ee&&(De=dt[0]&2?Ee.return:dt[0]?Ee.throw||((De=Ee.return)&&De.call(Ee),0):Ee.next)&&!(De=De.call(Ee,dt[1])).done)return De;switch(Ee=0,De&&(dt=[dt[0]&2,De.value]),dt[0]){case 0:case 1:De=dt;break;case 4:return z.label++,{value:dt[1],done:!1};case 5:z.label++,Ee=dt[1],dt=[0];continue;case 7:dt=z.ops.pop(),z.trys.pop();continue;default:if(De=z.trys,!(De=De.length>0&&De[De.length-1])&&(dt[0]===6||dt[0]===2)){z=0;continue}if(dt[0]===3&&(!De||dt[1]>De[0]&&dt[1]<De[3])){z.label=dt[1];break}if(dt[0]===6&&z.label<De[1]){z.label=De[1],De=dt;break}if(De&&z.label<De[2]){z.label=De[2],z.ops.push(dt);break}De[2]&&z.ops.pop(),z.trys.pop();continue}dt=k.call(ue,z)}catch(N){dt=[6,N],Ee=0}finally{ae=De=0}if(dt[0]&5)throw dt[1];return{value:dt[0]?dt[1]:void 0,done:!0}}}var y=function(){function ue(k,z){this.next=null,this.key=k,this.data=z,this.left=null,this.right=null}return ue}();function he(ue,k){return ue>k?1:ue<k?-1:0}function Z(ue,k,z){for(var ae=new y(null,null),Ee=ae,De=ae;;){var zt=z(ue,k.key);if(zt<0){if(k.left===null)break;if(z(ue,k.left.key)<0){var Tt=k.left;if(k.left=Tt.right,Tt.right=k,k=Tt,k.left===null)break}De.left=k,De=k,k=k.left}else if(zt>0){if(k.right===null)break;if(z(ue,k.right.key)>0){var Tt=k.right;if(k.right=Tt.left,Tt.left=k,k=Tt,k.right===null)break}Ee.right=k,Ee=k,k=k.right}else break}return Ee.right=k.left,De.left=k.right,k.left=ae.right,k.right=ae.left,k}function pe(ue,k,z,ae){var Ee=new y(ue,k);if(z===null)return Ee.left=Ee.right=null,Ee;z=Z(ue,z,ae);var De=ae(ue,z.key);return De<0?(Ee.left=z.left,Ee.right=z,z.left=null):De>=0&&(Ee.right=z.right,Ee.left=z,z.right=null),Ee}function fe(ue,k,z){var ae=null,Ee=null;if(k){k=Z(ue,k,z);var De=z(k.key,ue);De===0?(ae=k.left,Ee=k.right):De<0?(Ee=k.right,k.right=null,ae=k):(ae=k.left,k.left=null,Ee=k)}return{left:ae,right:Ee}}function it(ue,k,z){return k===null?ue:(ue===null||(k=Z(ue.key,k,z),k.left=ue),k)}function ce(ue,k,z,ae,Ee){if(ue){ae(""+k+(z?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+Ee(ue)+`
|
|
`);var De=k+(z?" ":"\u2502 ");ue.left&&ce(ue.left,De,!1,ae,Ee),ue.right&&ce(ue.right,De,!0,ae,Ee)}}var rt=function(){function ue(k){k===void 0&&(k=he),this._root=null,this._size=0,this._comparator=k}return ue.prototype.insert=function(k,z){return this._size++,this._root=pe(k,z,this._root,this._comparator)},ue.prototype.add=function(k,z){var ae=new y(k,z);this._root===null&&(ae.left=ae.right=null,this._size++,this._root=ae);var Ee=this._comparator,De=Z(k,this._root,Ee),zt=Ee(k,De.key);return zt===0?this._root=De:(zt<0?(ae.left=De.left,ae.right=De,De.left=null):zt>0&&(ae.right=De.right,ae.left=De,De.right=null),this._size++,this._root=ae),this._root},ue.prototype.remove=function(k){this._root=this._remove(k,this._root,this._comparator)},ue.prototype._remove=function(k,z,ae){var Ee;if(z===null)return null;z=Z(k,z,ae);var De=ae(k,z.key);return De===0?(z.left===null?Ee=z.right:(Ee=Z(k,z.left,ae),Ee.right=z.right),this._size--,Ee):z},ue.prototype.pop=function(){var k=this._root;if(k){for(;k.left;)k=k.left;return this._root=Z(k.key,this._root,this._comparator),this._root=this._remove(k.key,this._root,this._comparator),{key:k.key,data:k.data}}return null},ue.prototype.findStatic=function(k){for(var z=this._root,ae=this._comparator;z;){var Ee=ae(k,z.key);if(Ee===0)return z;Ee<0?z=z.left:z=z.right}return null},ue.prototype.find=function(k){return this._root&&(this._root=Z(k,this._root,this._comparator),this._comparator(k,this._root.key)!==0)?null:this._root},ue.prototype.contains=function(k){for(var z=this._root,ae=this._comparator;z;){var Ee=ae(k,z.key);if(Ee===0)return!0;Ee<0?z=z.left:z=z.right}return!1},ue.prototype.forEach=function(k,z){for(var ae=this._root,Ee=[],De=!1;!De;)ae!==null?(Ee.push(ae),ae=ae.left):Ee.length!==0?(ae=Ee.pop(),k.call(z,ae),ae=ae.right):De=!0;return this},ue.prototype.range=function(k,z,ae,Ee){for(var De=[],zt=this._comparator,Tt=this._root,Rt;De.length!==0||Tt;)if(Tt)De.push(Tt),Tt=Tt.left;else{if(Tt=De.pop(),Rt=zt(Tt.key,z),Rt>0)break;if(zt(Tt.key,k)>=0&&ae.call(Ee,Tt))return this;Tt=Tt.right}return this},ue.prototype.keys=function(){var k=[];return this.forEach(function(z){var ae=z.key;return k.push(ae)}),k},ue.prototype.values=function(){var k=[];return this.forEach(function(z){var ae=z.data;return k.push(ae)}),k},ue.prototype.min=function(){return this._root?this.minNode(this._root).key:null},ue.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},ue.prototype.minNode=function(k){if(k===void 0&&(k=this._root),k)for(;k.left;)k=k.left;return k},ue.prototype.maxNode=function(k){if(k===void 0&&(k=this._root),k)for(;k.right;)k=k.right;return k},ue.prototype.at=function(k){for(var z=this._root,ae=!1,Ee=0,De=[];!ae;)if(z)De.push(z),z=z.left;else if(De.length>0){if(z=De.pop(),Ee===k)return z;Ee++,z=z.right}else ae=!0;return null},ue.prototype.next=function(k){var z=this._root,ae=null;if(k.right){for(ae=k.right;ae.left;)ae=ae.left;return ae}for(var Ee=this._comparator;z;){var De=Ee(k.key,z.key);if(De===0)break;De<0?(ae=z,z=z.left):z=z.right}return ae},ue.prototype.prev=function(k){var z=this._root,ae=null;if(k.left!==null){for(ae=k.left;ae.right;)ae=ae.right;return ae}for(var Ee=this._comparator;z;){var De=Ee(k.key,z.key);if(De===0)break;De<0?z=z.left:(ae=z,z=z.right)}return ae},ue.prototype.clear=function(){return this._root=null,this._size=0,this},ue.prototype.toList=function(){return Ot(this._root)},ue.prototype.load=function(k,z,ae){z===void 0&&(z=[]),ae===void 0&&(ae=!1);var Ee=k.length,De=this._comparator;if(ae&&ar(k,z,0,Ee-1,De),this._root===null)this._root=vt(k,z,0,Ee),this._size=Ee;else{var zt=Yt(this.toList(),tt(k,z),De);Ee=this._size+Ee,this._root=Xt({head:zt},0,Ee)}return this},ue.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(ue.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(ue.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),ue.prototype.toString=function(k){k===void 0&&(k=function(ae){return String(ae.key)});var z=[];return ce(this._root,"",!0,function(ae){return z.push(ae)},k),z.join("")},ue.prototype.update=function(k,z,ae){var Ee=this._comparator,De=fe(k,this._root,Ee),zt=De.left,Tt=De.right;Ee(k,z)<0?Tt=pe(z,ae,Tt,Ee):zt=pe(z,ae,zt,Ee),this._root=it(zt,Tt,Ee)},ue.prototype.split=function(k){return fe(k,this._root,this._comparator)},ue.prototype[Symbol.iterator]=function(){var k,z,ae;return ye(this,function(Ee){switch(Ee.label){case 0:k=this._root,z=[],ae=!1,Ee.label=1;case 1:return ae?[3,6]:k===null?[3,2]:(z.push(k),k=k.left,[3,5]);case 2:return z.length===0?[3,4]:(k=z.pop(),[4,k]);case 3:return Ee.sent(),k=k.right,[3,5];case 4:ae=!0,Ee.label=5;case 5:return[3,1];case 6:return[2]}})},ue}();function vt(ue,k,z,ae){var Ee=ae-z;if(Ee>0){var De=z+Math.floor(Ee/2),zt=ue[De],Tt=k[De],Rt=new y(zt,Tt);return Rt.left=vt(ue,k,z,De),Rt.right=vt(ue,k,De+1,ae),Rt}return null}function tt(ue,k){for(var z=new y(null,null),ae=z,Ee=0;Ee<ue.length;Ee++)ae=ae.next=new y(ue[Ee],k[Ee]);return ae.next=null,z.next}function Ot(ue){for(var k=ue,z=[],ae=!1,Ee=new y(null,null),De=Ee;!ae;)k?(z.push(k),k=k.left):z.length>0?(k=De=De.next=z.pop(),k=k.right):ae=!0;return De.next=null,Ee.next}function Xt(ue,k,z){var ae=z-k;if(ae>0){var Ee=k+Math.floor(ae/2),De=Xt(ue,k,Ee),zt=ue.head;return zt.left=De,ue.head=ue.head.next,zt.right=Xt(ue,Ee+1,z),zt}return null}function Yt(ue,k,z){for(var ae=new y(null,null),Ee=ae,De=ue,zt=k;De!==null&&zt!==null;)z(De.key,zt.key)<0?(Ee.next=De,De=De.next):(Ee.next=zt,zt=zt.next),Ee=Ee.next;return De!==null?Ee.next=De:zt!==null&&(Ee.next=zt),ae.next}function ar(ue,k,z,ae,Ee){if(!(z>=ae)){for(var De=ue[z+ae>>1],zt=z-1,Tt=ae+1;;){do zt++;while(Ee(ue[zt],De)<0);do Tt--;while(Ee(ue[Tt],De)>0);if(zt>=Tt)break;var Rt=ue[zt];ue[zt]=ue[Tt],ue[Tt]=Rt,Rt=k[zt],k[zt]=k[Tt],k[Tt]=Rt}ar(ue,k,z,Tt,Ee),ar(ue,k,Tt+1,ae,Ee)}}const Zt=(ue,k)=>ue.ll.x<=k.x&&k.x<=ue.ur.x&&ue.ll.y<=k.y&&k.y<=ue.ur.y,bt=(ue,k)=>{if(k.ur.x<ue.ll.x||ue.ur.x<k.ll.x||k.ur.y<ue.ll.y||ue.ur.y<k.ll.y)return null;const z=ue.ll.x<k.ll.x?k.ll.x:ue.ll.x,ae=ue.ur.x<k.ur.x?ue.ur.x:k.ur.x,Ee=ue.ll.y<k.ll.y?k.ll.y:ue.ll.y,De=ue.ur.y<k.ur.y?ue.ur.y:k.ur.y;return{ll:{x:z,y:Ee},ur:{x:ae,y:De}}};let St=Number.EPSILON;St===void 0&&(St=Math.pow(2,-52));const Rr=St*St,gr=(ue,k)=>{if(-St<ue&&ue<St&&-St<k&&k<St)return 0;const z=ue-k;return z*z<Rr*ue*k?0:ue<k?-1:1};class fr{constructor(){this.reset()}reset(){this.xRounder=new Mt,this.yRounder=new Mt}round(k,z){return{x:this.xRounder.round(k),y:this.yRounder.round(z)}}}class Mt{constructor(){this.tree=new rt,this.round(0)}round(k){const z=this.tree.add(k),ae=this.tree.prev(z);if(ae!==null&&gr(z.key,ae.key)===0)return this.tree.remove(k),ae.key;const Ee=this.tree.next(z);return Ee!==null&&gr(z.key,Ee.key)===0?(this.tree.remove(k),Ee.key):k}}const ft=new fr,kt=11102230246251565e-32,qe=134217729,Dt=(3+8*kt)*kt;function dr(ue,k,z,ae,Ee){let De,zt,Tt,Rt,dt=k[0],N=ae[0],B=0,$=0;N>dt==N>-dt?(De=dt,dt=k[++B]):(De=N,N=ae[++$]);let ee=0;if(B<ue&&$<z)for(N>dt==N>-dt?(zt=dt+De,Tt=De-(zt-dt),dt=k[++B]):(zt=N+De,Tt=De-(zt-N),N=ae[++$]),De=zt,Tt!==0&&(Ee[ee++]=Tt);B<ue&&$<z;)N>dt==N>-dt?(zt=De+dt,Rt=zt-De,Tt=De-(zt-Rt)+(dt-Rt),dt=k[++B]):(zt=De+N,Rt=zt-De,Tt=De-(zt-Rt)+(N-Rt),N=ae[++$]),De=zt,Tt!==0&&(Ee[ee++]=Tt);for(;B<ue;)zt=De+dt,Rt=zt-De,Tt=De-(zt-Rt)+(dt-Rt),dt=k[++B],De=zt,Tt!==0&&(Ee[ee++]=Tt);for(;$<z;)zt=De+N,Rt=zt-De,Tt=De-(zt-Rt)+(N-Rt),N=ae[++$],De=zt,Tt!==0&&(Ee[ee++]=Tt);return(De!==0||ee===0)&&(Ee[ee++]=De),ee}function oe(ue,k){let z=k[0];for(let ae=1;ae<ue;ae++)z+=k[ae];return z}function H(ue){return new Float64Array(ue)}const re=(3+16*kt)*kt,Be=(2+12*kt)*kt,we=(9+64*kt)*kt*kt,ut=H(4),ie=H(8),Le=H(12),Pe=H(16),Ge=H(4);function Vt(ue,k,z,ae,Ee,De,zt){let Tt,Rt,dt,N,B,$,ee,xe,Ue,Qe,j,Q,Fe,et,Ae,$t,yr,nn;const Qr=ue-Ee,tr=z-Ee,Xr=k-De,zr=ae-De;et=Qr*zr,$=qe*Qr,ee=$-($-Qr),xe=Qr-ee,$=qe*zr,Ue=$-($-zr),Qe=zr-Ue,Ae=xe*Qe-(et-ee*Ue-xe*Ue-ee*Qe),$t=Xr*tr,$=qe*Xr,ee=$-($-Xr),xe=Xr-ee,$=qe*tr,Ue=$-($-tr),Qe=tr-Ue,yr=xe*Qe-($t-ee*Ue-xe*Ue-ee*Qe),j=Ae-yr,B=Ae-j,ut[0]=Ae-(j+B)+(B-yr),Q=et+j,B=Q-et,Fe=et-(Q-B)+(j-B),j=Fe-$t,B=Fe-j,ut[1]=Fe-(j+B)+(B-$t),nn=Q+j,B=nn-Q,ut[2]=Q-(nn-B)+(j-B),ut[3]=nn;let jr=oe(4,ut),Jn=Be*zt;if(jr>=Jn||-jr>=Jn||(B=ue-Qr,Tt=ue-(Qr+B)+(B-Ee),B=z-tr,dt=z-(tr+B)+(B-Ee),B=k-Xr,Rt=k-(Xr+B)+(B-De),B=ae-zr,N=ae-(zr+B)+(B-De),Tt===0&&Rt===0&&dt===0&&N===0)||(Jn=we*zt+Dt*Math.abs(jr),jr+=Qr*N+zr*Tt-(Xr*dt+tr*Rt),jr>=Jn||-jr>=Jn))return jr;et=Tt*zr,$=qe*Tt,ee=$-($-Tt),xe=Tt-ee,$=qe*zr,Ue=$-($-zr),Qe=zr-Ue,Ae=xe*Qe-(et-ee*Ue-xe*Ue-ee*Qe),$t=Rt*tr,$=qe*Rt,ee=$-($-Rt),xe=Rt-ee,$=qe*tr,Ue=$-($-tr),Qe=tr-Ue,yr=xe*Qe-($t-ee*Ue-xe*Ue-ee*Qe),j=Ae-yr,B=Ae-j,Ge[0]=Ae-(j+B)+(B-yr),Q=et+j,B=Q-et,Fe=et-(Q-B)+(j-B),j=Fe-$t,B=Fe-j,Ge[1]=Fe-(j+B)+(B-$t),nn=Q+j,B=nn-Q,Ge[2]=Q-(nn-B)+(j-B),Ge[3]=nn;const ln=dr(4,ut,4,Ge,ie);et=Qr*N,$=qe*Qr,ee=$-($-Qr),xe=Qr-ee,$=qe*N,Ue=$-($-N),Qe=N-Ue,Ae=xe*Qe-(et-ee*Ue-xe*Ue-ee*Qe),$t=Xr*dt,$=qe*Xr,ee=$-($-Xr),xe=Xr-ee,$=qe*dt,Ue=$-($-dt),Qe=dt-Ue,yr=xe*Qe-($t-ee*Ue-xe*Ue-ee*Qe),j=Ae-yr,B=Ae-j,Ge[0]=Ae-(j+B)+(B-yr),Q=et+j,B=Q-et,Fe=et-(Q-B)+(j-B),j=Fe-$t,B=Fe-j,Ge[1]=Fe-(j+B)+(B-$t),nn=Q+j,B=nn-Q,Ge[2]=Q-(nn-B)+(j-B),Ge[3]=nn;const hi=dr(ln,ie,4,Ge,Le);et=Tt*N,$=qe*Tt,ee=$-($-Tt),xe=Tt-ee,$=qe*N,Ue=$-($-N),Qe=N-Ue,Ae=xe*Qe-(et-ee*Ue-xe*Ue-ee*Qe),$t=Rt*dt,$=qe*Rt,ee=$-($-Rt),xe=Rt-ee,$=qe*dt,Ue=$-($-dt),Qe=dt-Ue,yr=xe*Qe-($t-ee*Ue-xe*Ue-ee*Qe),j=Ae-yr,B=Ae-j,Ge[0]=Ae-(j+B)+(B-yr),Q=et+j,B=Q-et,Fe=et-(Q-B)+(j-B),j=Fe-$t,B=Fe-j,Ge[1]=Fe-(j+B)+(B-$t),nn=Q+j,B=nn-Q,Ge[2]=Q-(nn-B)+(j-B),Ge[3]=nn;const Vi=dr(hi,Le,4,Ge,Pe);return Pe[Vi-1]}function Et(ue,k,z,ae,Ee,De){const zt=(k-De)*(z-Ee),Tt=(ue-Ee)*(ae-De),Rt=zt-Tt,dt=Math.abs(zt+Tt);return Math.abs(Rt)>=re*dt?Rt:-Vt(ue,k,z,ae,Ee,De,dt)}const Jr=(ue,k)=>ue.x*k.y-ue.y*k.x,on=(ue,k)=>ue.x*k.x+ue.y*k.y,Mr=(ue,k,z)=>{const ae=Et(ue.x,ue.y,k.x,k.y,z.x,z.y);return ae>0?-1:ae<0?1:0},Dn=ue=>Math.sqrt(on(ue,ue)),bn=(ue,k,z)=>{const ae={x:k.x-ue.x,y:k.y-ue.y},Ee={x:z.x-ue.x,y:z.y-ue.y};return Jr(Ee,ae)/Dn(Ee)/Dn(ae)},rn=(ue,k,z)=>{const ae={x:k.x-ue.x,y:k.y-ue.y},Ee={x:z.x-ue.x,y:z.y-ue.y};return on(Ee,ae)/Dn(Ee)/Dn(ae)},yi=(ue,k,z)=>k.y===0?null:{x:ue.x+k.x/k.y*(z-ue.y),y:z},ti=(ue,k,z)=>k.x===0?null:{x:z,y:ue.y+k.y/k.x*(z-ue.x)},Zi=(ue,k,z,ae)=>{if(k.x===0)return ti(z,ae,ue.x);if(ae.x===0)return ti(ue,k,z.x);if(k.y===0)return yi(z,ae,ue.y);if(ae.y===0)return yi(ue,k,z.y);const Ee=Jr(k,ae);if(Ee==0)return null;const De={x:z.x-ue.x,y:z.y-ue.y},zt=Jr(De,k)/Ee,Tt=Jr(De,ae)/Ee,Rt=ue.x+Tt*k.x,dt=z.x+zt*ae.x,N=ue.y+Tt*k.y,B=z.y+zt*ae.y,$=(Rt+dt)/2,ee=(N+B)/2;return{x:$,y:ee}};class En{static compare(k,z){const ae=En.comparePoints(k.point,z.point);return ae!==0?ae:(k.point!==z.point&&k.link(z),k.isLeft!==z.isLeft?k.isLeft?1:-1:sa.compare(k.segment,z.segment))}static comparePoints(k,z){return k.x<z.x?-1:k.x>z.x?1:k.y<z.y?-1:k.y>z.y?1:0}constructor(k,z){k.events===void 0?k.events=[this]:k.events.push(this),this.point=k,this.isLeft=z}link(k){if(k.point===this.point)throw new Error("Tried to link already linked events");const z=k.point.events;for(let ae=0,Ee=z.length;ae<Ee;ae++){const De=z[ae];this.point.events.push(De),De.point=this.point}this.checkForConsuming()}checkForConsuming(){const k=this.point.events.length;for(let z=0;z<k;z++){const ae=this.point.events[z];if(ae.segment.consumedBy===void 0)for(let Ee=z+1;Ee<k;Ee++){const De=this.point.events[Ee];De.consumedBy===void 0&&ae.otherSE.point.events===De.otherSE.point.events&&ae.segment.consume(De.segment)}}}getAvailableLinkedEvents(){const k=[];for(let z=0,ae=this.point.events.length;z<ae;z++){const Ee=this.point.events[z];Ee!==this&&!Ee.segment.ringOut&&Ee.segment.isInResult()&&k.push(Ee)}return k}getLeftmostComparator(k){const z=new Map,ae=Ee=>{const De=Ee.otherSE;z.set(Ee,{sine:bn(this.point,k.point,De.point),cosine:rn(this.point,k.point,De.point)})};return(Ee,De)=>{z.has(Ee)||ae(Ee),z.has(De)||ae(De);const{sine:zt,cosine:Tt}=z.get(Ee),{sine:Rt,cosine:dt}=z.get(De);return zt>=0&&Rt>=0?Tt<dt?1:Tt>dt?-1:0:zt<0&&Rt<0?Tt<dt?-1:Tt>dt?1:0:Rt<zt?-1:Rt>zt?1:0}}}let Rn=0;class sa{static compare(k,z){const ae=k.leftSE.point.x,Ee=z.leftSE.point.x,De=k.rightSE.point.x,zt=z.rightSE.point.x;if(zt<ae)return 1;if(De<Ee)return-1;const Tt=k.leftSE.point.y,Rt=z.leftSE.point.y,dt=k.rightSE.point.y,N=z.rightSE.point.y;if(ae<Ee){if(Rt<Tt&&Rt<dt)return 1;if(Rt>Tt&&Rt>dt)return-1;const B=k.comparePoint(z.leftSE.point);if(B<0)return 1;if(B>0)return-1;const $=z.comparePoint(k.rightSE.point);return $!==0?$:-1}if(ae>Ee){if(Tt<Rt&&Tt<N)return-1;if(Tt>Rt&&Tt>N)return 1;const B=z.comparePoint(k.leftSE.point);if(B!==0)return B;const $=k.comparePoint(z.rightSE.point);return $<0?1:$>0?-1:1}if(Tt<Rt)return-1;if(Tt>Rt)return 1;if(De<zt){const B=z.comparePoint(k.rightSE.point);if(B!==0)return B}if(De>zt){const B=k.comparePoint(z.rightSE.point);if(B<0)return 1;if(B>0)return-1}if(De!==zt){const B=dt-Tt,$=De-ae,ee=N-Rt,xe=zt-Ee;if(B>$&&ee<xe)return 1;if(B<$&&ee>xe)return-1}return De>zt?1:De<zt||dt<N?-1:dt>N?1:k.id<z.id?-1:k.id>z.id?1:0}constructor(k,z,ae,Ee){this.id=++Rn,this.leftSE=k,k.segment=this,k.otherSE=z,this.rightSE=z,z.segment=this,z.otherSE=k,this.rings=ae,this.windings=Ee}static fromRing(k,z,ae){let Ee,De,zt;const Tt=En.comparePoints(k,z);if(Tt<0)Ee=k,De=z,zt=1;else if(Tt>0)Ee=z,De=k,zt=-1;else throw new Error(`Tried to create degenerate segment at [${k.x}, ${k.y}]`);const Rt=new En(Ee,!0),dt=new En(De,!1);return new sa(Rt,dt,[ae],[zt])}replaceRightSE(k){this.rightSE=k,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const k=this.leftSE.point.y,z=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:k<z?k:z},ur:{x:this.rightSE.point.x,y:k>z?k:z}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(k){return k.x===this.leftSE.point.x&&k.y===this.leftSE.point.y||k.x===this.rightSE.point.x&&k.y===this.rightSE.point.y}comparePoint(k){if(this.isAnEndpoint(k))return 0;const z=this.leftSE.point,ae=this.rightSE.point,Ee=this.vector();if(z.x===ae.x)return k.x===z.x?0:k.x<z.x?1:-1;const De=(k.y-z.y)/Ee.y,zt=z.x+De*Ee.x;if(k.x===zt)return 0;const Tt=(k.x-z.x)/Ee.x,Rt=z.y+Tt*Ee.y;return k.y===Rt?0:k.y<Rt?-1:1}getIntersection(k){const z=this.bbox(),ae=k.bbox(),Ee=bt(z,ae);if(Ee===null)return null;const De=this.leftSE.point,zt=this.rightSE.point,Tt=k.leftSE.point,Rt=k.rightSE.point,dt=Zt(z,Tt)&&this.comparePoint(Tt)===0,N=Zt(ae,De)&&k.comparePoint(De)===0,B=Zt(z,Rt)&&this.comparePoint(Rt)===0,$=Zt(ae,zt)&&k.comparePoint(zt)===0;if(N&&dt)return $&&!B?zt:!$&&B?Rt:null;if(N)return B&&De.x===Rt.x&&De.y===Rt.y?null:De;if(dt)return $&&zt.x===Tt.x&&zt.y===Tt.y?null:Tt;if($&&B)return null;if($)return zt;if(B)return Rt;const ee=Zi(De,this.vector(),Tt,k.vector());return ee===null||!Zt(Ee,ee)?null:ft.round(ee.x,ee.y)}split(k){const z=[],ae=k.events!==void 0,Ee=new En(k,!0),De=new En(k,!1),zt=this.rightSE;this.replaceRightSE(De),z.push(De),z.push(Ee);const Tt=new sa(Ee,zt,this.rings.slice(),this.windings.slice());return En.comparePoints(Tt.leftSE.point,Tt.rightSE.point)>0&&Tt.swapEvents(),En.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),ae&&(Ee.checkForConsuming(),De.checkForConsuming()),z}swapEvents(){const k=this.rightSE;this.rightSE=this.leftSE,this.leftSE=k,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let z=0,ae=this.windings.length;z<ae;z++)this.windings[z]*=-1}consume(k){let z=this,ae=k;for(;z.consumedBy;)z=z.consumedBy;for(;ae.consumedBy;)ae=ae.consumedBy;const Ee=sa.compare(z,ae);if(Ee!==0){if(Ee>0){const De=z;z=ae,ae=De}if(z.prev===ae){const De=z;z=ae,ae=De}for(let De=0,zt=ae.rings.length;De<zt;De++){const Tt=ae.rings[De],Rt=ae.windings[De],dt=z.rings.indexOf(Tt);dt===-1?(z.rings.push(Tt),z.windings.push(Rt)):z.windings[dt]+=Rt}ae.rings=null,ae.windings=null,ae.consumedBy=z,ae.leftSE.consumedBy=z.leftSE,ae.rightSE.consumedBy=z.rightSE}}prevInResult(){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)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const k=this.prev.consumedBy||this.prev;this._beforeState=k.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const k=this.beforeState();this._afterState={rings:k.rings.slice(0),windings:k.windings.slice(0),multiPolys:[]};const z=this._afterState.rings,ae=this._afterState.windings,Ee=this._afterState.multiPolys;for(let Tt=0,Rt=this.rings.length;Tt<Rt;Tt++){const dt=this.rings[Tt],N=this.windings[Tt],B=z.indexOf(dt);B===-1?(z.push(dt),ae.push(N)):ae[B]+=N}const De=[],zt=[];for(let Tt=0,Rt=z.length;Tt<Rt;Tt++){if(ae[Tt]===0)continue;const dt=z[Tt],N=dt.poly;if(zt.indexOf(N)===-1)if(dt.isExterior)De.push(N);else{zt.indexOf(N)===-1&&zt.push(N);const B=De.indexOf(dt.poly);B!==-1&&De.splice(B,1)}}for(let Tt=0,Rt=De.length;Tt<Rt;Tt++){const dt=De[Tt].multiPoly;Ee.indexOf(dt)===-1&&Ee.push(dt)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const k=this.beforeState().multiPolys,z=this.afterState().multiPolys;switch(jt.type){case"union":{const ae=k.length===0,Ee=z.length===0;this._isInResult=ae!==Ee;break}case"intersection":{let ae,Ee;k.length<z.length?(ae=k.length,Ee=z.length):(ae=z.length,Ee=k.length),this._isInResult=Ee===jt.numMultiPolys&&ae<Ee;break}case"xor":{const ae=Math.abs(k.length-z.length);this._isInResult=ae%2===1;break}case"difference":{const ae=Ee=>Ee.length===1&&Ee[0].isSubject;this._isInResult=ae(k)!==ae(z);break}default:throw new Error(`Unrecognized operation type found ${jt.type}`)}return this._isInResult}}class ki{constructor(k,z,ae){if(!Array.isArray(k)||k.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=z,this.isExterior=ae,this.segments=[],typeof k[0][0]!="number"||typeof k[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const Ee=ft.round(k[0][0],k[0][1]);this.bbox={ll:{x:Ee.x,y:Ee.y},ur:{x:Ee.x,y:Ee.y}};let De=Ee;for(let zt=1,Tt=k.length;zt<Tt;zt++){if(typeof k[zt][0]!="number"||typeof k[zt][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let Rt=ft.round(k[zt][0],k[zt][1]);Rt.x===De.x&&Rt.y===De.y||(this.segments.push(sa.fromRing(De,Rt,this)),Rt.x<this.bbox.ll.x&&(this.bbox.ll.x=Rt.x),Rt.y<this.bbox.ll.y&&(this.bbox.ll.y=Rt.y),Rt.x>this.bbox.ur.x&&(this.bbox.ur.x=Rt.x),Rt.y>this.bbox.ur.y&&(this.bbox.ur.y=Rt.y),De=Rt)}(Ee.x!==De.x||Ee.y!==De.y)&&this.segments.push(sa.fromRing(De,Ee,this))}getSweepEvents(){const k=[];for(let z=0,ae=this.segments.length;z<ae;z++){const Ee=this.segments[z];k.push(Ee.leftSE),k.push(Ee.rightSE)}return k}}class ba{constructor(k,z){if(!Array.isArray(k))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new ki(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(let ae=1,Ee=k.length;ae<Ee;ae++){const De=new ki(k[ae],this,!1);De.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=De.bbox.ll.x),De.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=De.bbox.ll.y),De.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=De.bbox.ur.x),De.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=De.bbox.ur.y),this.interiorRings.push(De)}this.multiPoly=z}getSweepEvents(){const k=this.exteriorRing.getSweepEvents();for(let z=0,ae=this.interiorRings.length;z<ae;z++){const Ee=this.interiorRings[z].getSweepEvents();for(let De=0,zt=Ee.length;De<zt;De++)k.push(Ee[De])}return k}}class fo{constructor(k,z){if(!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(ae){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let ae=0,Ee=k.length;ae<Ee;ae++){const De=new ba(k[ae],this);De.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=De.bbox.ll.x),De.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=De.bbox.ll.y),De.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=De.bbox.ur.x),De.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=De.bbox.ur.y),this.polys.push(De)}this.isSubject=z}getSweepEvents(){const k=[];for(let z=0,ae=this.polys.length;z<ae;z++){const Ee=this.polys[z].getSweepEvents();for(let De=0,zt=Ee.length;De<zt;De++)k.push(Ee[De])}return k}}class Re{static factory(k){const z=[];for(let ae=0,Ee=k.length;ae<Ee;ae++){const De=k[ae];if(!De.isInResult()||De.ringOut)continue;let zt=null,Tt=De.leftSE,Rt=De.rightSE;const dt=[Tt],N=Tt.point,B=[];for(;zt=Tt,Tt=Rt,dt.push(Tt),Tt.point!==N;)for(;;){const $=Tt.getAvailableLinkedEvents();if($.length===0){const Ue=dt[0].point,Qe=dt[dt.length-1].point;throw new Error(`Unable to complete output ring starting at [${Ue.x}, ${Ue.y}]. Last matching segment found ends at [${Qe.x}, ${Qe.y}].`)}if($.length===1){Rt=$[0].otherSE;break}let ee=null;for(let Ue=0,Qe=B.length;Ue<Qe;Ue++)if(B[Ue].point===Tt.point){ee=Ue;break}if(ee!==null){const Ue=B.splice(ee)[0],Qe=dt.splice(Ue.index);Qe.unshift(Qe[0].otherSE),z.push(new Re(Qe.reverse()));continue}B.push({index:dt.length,point:Tt.point});const xe=Tt.getLeftmostComparator(zt);Rt=$.sort(xe)[0].otherSE;break}z.push(new Re(dt))}return z}constructor(k){this.events=k;for(let z=0,ae=k.length;z<ae;z++)k[z].segment.ringOut=this;this.poly=null}getGeom(){let k=this.events[0].point;const z=[k];for(let dt=1,N=this.events.length-1;dt<N;dt++){const B=this.events[dt].point,$=this.events[dt+1].point;Mr(B,k,$)!==0&&(z.push(B),k=B)}if(z.length===1)return null;const ae=z[0],Ee=z[1];Mr(ae,k,Ee)===0&&z.shift(),z.push(z[0]);const De=this.isExteriorRing()?1:-1,zt=this.isExteriorRing()?0:z.length-1,Tt=this.isExteriorRing()?z.length:-1,Rt=[];for(let dt=zt;dt!=Tt;dt+=De)Rt.push([z[dt].x,z[dt].y]);return Rt}isExteriorRing(){if(this._isExteriorRing===void 0){const k=this.enclosingRing();this._isExteriorRing=k?!k.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let k=this.events[0];for(let Ee=1,De=this.events.length;Ee<De;Ee++){const zt=this.events[Ee];En.compare(k,zt)>0&&(k=zt)}let z=k.segment.prevInResult(),ae=z?z.prevInResult():null;for(;;){if(!z)return null;if(!ae)return z.ringOut;if(ae.ringOut!==z.ringOut)return ae.ringOut.enclosingRing()!==z.ringOut?z.ringOut:z.ringOut.enclosingRing();z=ae.prevInResult(),ae=z?z.prevInResult():null}}}class Ea{constructor(k){this.exteriorRing=k,k.poly=this,this.interiorRings=[]}addInterior(k){this.interiorRings.push(k),k.poly=this}getGeom(){const k=[this.exteriorRing.getGeom()];if(k[0]===null)return null;for(let z=0,ae=this.interiorRings.length;z<ae;z++){const Ee=this.interiorRings[z].getGeom();Ee!==null&&k.push(Ee)}return k}}class va{constructor(k){this.rings=k,this.polys=this._composePolys(k)}getGeom(){const k=[];for(let z=0,ae=this.polys.length;z<ae;z++){const Ee=this.polys[z].getGeom();Ee!==null&&k.push(Ee)}return k}_composePolys(k){const z=[];for(let ae=0,Ee=k.length;ae<Ee;ae++){const De=k[ae];if(!De.poly)if(De.isExteriorRing())z.push(new Ea(De));else{const zt=De.enclosingRing();zt.poly||z.push(new Ea(zt)),zt.poly.addInterior(De)}}return z}}class Za{constructor(k){let z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sa.compare;this.queue=k,this.tree=new rt(z),this.segments=[]}process(k){const z=k.segment,ae=[];if(k.consumedBy)return k.isLeft?this.queue.remove(k.otherSE):this.tree.remove(z),ae;const Ee=k.isLeft?this.tree.add(z):this.tree.find(z);if(!Ee)throw new Error(`Unable to find segment #${z.id} [${z.leftSE.point.x}, ${z.leftSE.point.y}] -> [${z.rightSE.point.x}, ${z.rightSE.point.y}] in SweepLine tree.`);let De=Ee,zt=Ee,Tt,Rt;for(;Tt===void 0;)De=this.tree.prev(De),De===null?Tt=null:De.key.consumedBy===void 0&&(Tt=De.key);for(;Rt===void 0;)zt=this.tree.next(zt),zt===null?Rt=null:zt.key.consumedBy===void 0&&(Rt=zt.key);if(k.isLeft){let dt=null;if(Tt){const B=Tt.getIntersection(z);if(B!==null&&(z.isAnEndpoint(B)||(dt=B),!Tt.isAnEndpoint(B))){const $=this._splitSafely(Tt,B);for(let ee=0,xe=$.length;ee<xe;ee++)ae.push($[ee])}}let N=null;if(Rt){const B=Rt.getIntersection(z);if(B!==null&&(z.isAnEndpoint(B)||(N=B),!Rt.isAnEndpoint(B))){const $=this._splitSafely(Rt,B);for(let ee=0,xe=$.length;ee<xe;ee++)ae.push($[ee])}}if(dt!==null||N!==null){let B=null;dt===null?B=N:N===null?B=dt:B=En.comparePoints(dt,N)<=0?dt:N,this.queue.remove(z.rightSE),ae.push(z.rightSE);const $=z.split(B);for(let ee=0,xe=$.length;ee<xe;ee++)ae.push($[ee])}ae.length>0?(this.tree.remove(z),ae.push(k)):(this.segments.push(z),z.prev=Tt)}else{if(Tt&&Rt){const dt=Tt.getIntersection(Rt);if(dt!==null){if(!Tt.isAnEndpoint(dt)){const N=this._splitSafely(Tt,dt);for(let B=0,$=N.length;B<$;B++)ae.push(N[B])}if(!Rt.isAnEndpoint(dt)){const N=this._splitSafely(Rt,dt);for(let B=0,$=N.length;B<$;B++)ae.push(N[B])}}}this.tree.remove(z)}return ae}_splitSafely(k,z){this.tree.remove(k);const ae=k.rightSE;this.queue.remove(ae);const Ee=k.split(z);return Ee.push(ae),k.consumedBy===void 0&&this.tree.add(k),Ee}}const Ms=typeof te!="undefined"&&{NODE_ENV:"production",PUBLIC_PATH:"/"}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,ho=typeof te!="undefined"&&{NODE_ENV:"production",PUBLIC_PATH:"/"}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Zo{run(k,z,ae){jt.type=k,ft.reset();const Ee=[new fo(z,!0)];for(let B=0,$=ae.length;B<$;B++)Ee.push(new fo(ae[B],!1));if(jt.numMultiPolys=Ee.length,jt.type==="difference"){const B=Ee[0];let $=1;for(;$<Ee.length;)bt(Ee[$].bbox,B.bbox)!==null?$++:Ee.splice($,1)}if(jt.type==="intersection")for(let B=0,$=Ee.length;B<$;B++){const ee=Ee[B];for(let xe=B+1,Ue=Ee.length;xe<Ue;xe++)if(bt(ee.bbox,Ee[xe].bbox)===null)return[]}const De=new rt(En.compare);for(let B=0,$=Ee.length;B<$;B++){const ee=Ee[B].getSweepEvents();for(let xe=0,Ue=ee.length;xe<Ue;xe++)if(De.insert(ee[xe]),De.size>Ms)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const zt=new Za(De);let Tt=De.size,Rt=De.pop();for(;Rt;){const B=Rt.key;if(De.size===Tt){const ee=B.segment;throw new Error(`Unable to pop() ${B.isLeft?"left":"right"} SweepEvent [${B.point.x}, ${B.point.y}] from segment #${ee.id} [${ee.leftSE.point.x}, ${ee.leftSE.point.y}] -> [${ee.rightSE.point.x}, ${ee.rightSE.point.y}] from queue.`)}if(De.size>Ms)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(zt.segments.length>ho)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const $=zt.process(B);for(let ee=0,xe=$.length;ee<xe;ee++){const Ue=$[ee];Ue.consumedBy===void 0&&De.insert(Ue)}Tt=De.size,Rt=De.pop()}ft.reset();const dt=Re.factory(zt.segments);return new va(dt).getGeom()}}const jt=new Zo;var Gi={union:function(ue){for(var k=arguments.length,z=new Array(k>1?k-1:0),ae=1;ae<k;ae++)z[ae-1]=arguments[ae];return jt.run("union",ue,z)},intersection:function(ue){for(var k=arguments.length,z=new Array(k>1?k-1:0),ae=1;ae<k;ae++)z[ae-1]=arguments[ae];return jt.run("intersection",ue,z)},xor:function(ue){for(var k=arguments.length,z=new Array(k>1?k-1:0),ae=1;ae<k;ae++)z[ae-1]=arguments[ae];return jt.run("xor",ue,z)},difference:function(ue){for(var k=arguments.length,z=new Array(k>1?k-1:0),ae=1;ae<k;ae++)z[ae-1]=arguments[ae];return jt.run("difference",ue,z)}};return Gi})},18041:function(sr,ne,U){var te=U(14224);var ye;(function(y){(function(he){var Z=typeof U.g=="object"?U.g:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),pe=fe(y);typeof Z.Reflect=="undefined"?Z.Reflect=y:pe=fe(Z.Reflect,pe),he(pe);function fe(it,ce){return function(rt,vt){typeof it[rt]!="function"&&Object.defineProperty(it,rt,{configurable:!0,writable:!0,value:vt}),ce&&ce(rt,vt)}}})(function(he){var Z=Object.prototype.hasOwnProperty,pe=typeof Symbol=="function",fe=pe&&typeof Symbol.toPrimitive!="undefined"?Symbol.toPrimitive:"@@toPrimitive",it=pe&&typeof Symbol.iterator!="undefined"?Symbol.iterator:"@@iterator",ce=typeof Object.create=="function",rt={__proto__:[]}instanceof Array,vt=!ce&&!rt,tt={create:ce?function(){return Zo(Object.create(null))}:rt?function(){return Zo({__proto__:null})}:function(){return Zo({})},has:vt?function(jt,pr){return Z.call(jt,pr)}:function(jt,pr){return pr in jt},get:vt?function(jt,pr){return Z.call(jt,pr)?jt[pr]:void 0}:function(jt,pr){return jt[pr]}},Ot=Object.getPrototypeOf(Function),Xt=typeof te=="object"&&te["env"]&&te["env"].REFLECT_METADATA_USE_MAP_POLYFILL==="true",Yt=!Xt&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Za(),ar=!Xt&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Ms(),Zt=!Xt&&typeof WeakMap=="function"?WeakMap:ho(),bt=new Zt;function St(jt,pr,Vr,en){if(Et(Vr)){if(!Zi(jt))throw new TypeError;if(!Rn(pr))throw new TypeError;return oe(jt,pr)}else{if(!Zi(jt))throw new TypeError;if(!Mr(pr))throw new TypeError;if(!Mr(en)&&!Et(en)&&!Jr(en))throw new TypeError;return Jr(en)&&(en=void 0),Vr=ti(Vr),H(jt,pr,Vr,en)}}he("decorate",St);function Rr(jt,pr){function Vr(en,Ln){if(!Mr(en))throw new TypeError;if(!Et(Ln)&&!sa(Ln))throw new TypeError;Le(jt,pr,en,Ln)}return Vr}he("metadata",Rr);function gr(jt,pr,Vr,en){if(!Mr(Vr))throw new TypeError;return Et(en)||(en=ti(en)),Le(jt,pr,Vr,en)}he("defineMetadata",gr);function fr(jt,pr,Vr){if(!Mr(pr))throw new TypeError;return Et(Vr)||(Vr=ti(Vr)),Be(jt,pr,Vr)}he("hasMetadata",fr);function Mt(jt,pr,Vr){if(!Mr(pr))throw new TypeError;return Et(Vr)||(Vr=ti(Vr)),we(jt,pr,Vr)}he("hasOwnMetadata",Mt);function ft(jt,pr,Vr){if(!Mr(pr))throw new TypeError;return Et(Vr)||(Vr=ti(Vr)),ut(jt,pr,Vr)}he("getMetadata",ft);function kt(jt,pr,Vr){if(!Mr(pr))throw new TypeError;return Et(Vr)||(Vr=ti(Vr)),ie(jt,pr,Vr)}he("getOwnMetadata",kt);function qe(jt,pr){if(!Mr(jt))throw new TypeError;return Et(pr)||(pr=ti(pr)),Pe(jt,pr)}he("getMetadataKeys",qe);function Dt(jt,pr){if(!Mr(jt))throw new TypeError;return Et(pr)||(pr=ti(pr)),Ge(jt,pr)}he("getOwnMetadataKeys",Dt);function dr(jt,pr,Vr){if(!Mr(pr))throw new TypeError;Et(Vr)||(Vr=ti(Vr));var en=re(pr,Vr,!1);if(Et(en)||!en.delete(jt))return!1;if(en.size>0)return!0;var Ln=bt.get(pr);return Ln.delete(Vr),Ln.size>0||bt.delete(pr),!0}he("deleteMetadata",dr);function oe(jt,pr){for(var Vr=jt.length-1;Vr>=0;--Vr){var en=jt[Vr],Ln=en(pr);if(!Et(Ln)&&!Jr(Ln)){if(!Rn(Ln))throw new TypeError;pr=Ln}}return pr}function H(jt,pr,Vr,en){for(var Ln=jt.length-1;Ln>=0;--Ln){var Gi=jt[Ln],ue=Gi(pr,Vr,en);if(!Et(ue)&&!Jr(ue)){if(!Mr(ue))throw new TypeError;en=ue}}return en}function re(jt,pr,Vr){var en=bt.get(jt);if(Et(en)){if(!Vr)return;en=new Yt,bt.set(jt,en)}var Ln=en.get(pr);if(Et(Ln)){if(!Vr)return;Ln=new Yt,en.set(pr,Ln)}return Ln}function Be(jt,pr,Vr){var en=we(jt,pr,Vr);if(en)return!0;var Ln=va(pr);return Jr(Ln)?!1:Be(jt,Ln,Vr)}function we(jt,pr,Vr){var en=re(pr,Vr,!1);return Et(en)?!1:rn(en.has(jt))}function ut(jt,pr,Vr){var en=we(jt,pr,Vr);if(en)return ie(jt,pr,Vr);var Ln=va(pr);if(!Jr(Ln))return ut(jt,Ln,Vr)}function ie(jt,pr,Vr){var en=re(pr,Vr,!1);if(!Et(en))return en.get(jt)}function Le(jt,pr,Vr,en){var Ln=re(Vr,en,!0);Ln.set(jt,pr)}function Pe(jt,pr){var Vr=Ge(jt,pr),en=va(jt);if(en===null)return Vr;var Ln=Pe(en,pr);if(Ln.length<=0)return Vr;if(Vr.length<=0)return Ln;for(var Gi=new ar,ue=[],k=0,z=Vr;k<z.length;k++){var ae=z[k],Ee=Gi.has(ae);Ee||(Gi.add(ae),ue.push(ae))}for(var De=0,zt=Ln;De<zt.length;De++){var ae=zt[De],Ee=Gi.has(ae);Ee||(Gi.add(ae),ue.push(ae))}return ue}function Ge(jt,pr){var Vr=[],en=re(jt,pr,!1);if(Et(en))return Vr;for(var Ln=en.keys(),Gi=ba(Ln),ue=0;;){var k=Re(Gi);if(!k)return Vr.length=ue,Vr;var z=fo(k);try{Vr[ue]=z}catch(ae){try{Ea(Gi)}finally{throw ae}}ue++}}function Vt(jt){if(jt===null)return 1;switch(typeof jt){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return jt===null?1:6;default:return 6}}function Et(jt){return jt===void 0}function Jr(jt){return jt===null}function on(jt){return typeof jt=="symbol"}function Mr(jt){return typeof jt=="object"?jt!==null:typeof jt=="function"}function Dn(jt,pr){switch(Vt(jt)){case 0:return jt;case 1:return jt;case 2:return jt;case 3:return jt;case 4:return jt;case 5:return jt}var Vr=pr===3?"string":pr===5?"number":"default",en=ki(jt,fe);if(en!==void 0){var Ln=en.call(jt,Vr);if(Mr(Ln))throw new TypeError;return Ln}return bn(jt,Vr==="default"?"number":Vr)}function bn(jt,pr){if(pr==="string"){var Vr=jt.toString;if(En(Vr)){var en=Vr.call(jt);if(!Mr(en))return en}var Ln=jt.valueOf;if(En(Ln)){var en=Ln.call(jt);if(!Mr(en))return en}}else{var Ln=jt.valueOf;if(En(Ln)){var en=Ln.call(jt);if(!Mr(en))return en}var Gi=jt.toString;if(En(Gi)){var en=Gi.call(jt);if(!Mr(en))return en}}throw new TypeError}function rn(jt){return!!jt}function yi(jt){return""+jt}function ti(jt){var pr=Dn(jt,3);return on(pr)?pr:yi(pr)}function Zi(jt){return Array.isArray?Array.isArray(jt):jt instanceof Object?jt instanceof Array:Object.prototype.toString.call(jt)==="[object Array]"}function En(jt){return typeof jt=="function"}function Rn(jt){return typeof jt=="function"}function sa(jt){switch(Vt(jt)){case 3:return!0;case 4:return!0;default:return!1}}function ki(jt,pr){var Vr=jt[pr];if(Vr!=null){if(!En(Vr))throw new TypeError;return Vr}}function ba(jt){var pr=ki(jt,it);if(!En(pr))throw new TypeError;var Vr=pr.call(jt);if(!Mr(Vr))throw new TypeError;return Vr}function fo(jt){return jt.value}function Re(jt){var pr=jt.next();return pr.done?!1:pr}function Ea(jt){var pr=jt.return;pr&&pr.call(jt)}function va(jt){var pr=Object.getPrototypeOf(jt);if(typeof jt!="function"||jt===Ot||pr!==Ot)return pr;var Vr=jt.prototype,en=Vr&&Object.getPrototypeOf(Vr);if(en==null||en===Object.prototype)return pr;var Ln=en.constructor;return typeof Ln!="function"||Ln===jt?pr:Ln}function Za(){var jt={},pr=[],Vr=function(){function ue(k,z,ae){this._index=0,this._keys=k,this._values=z,this._selector=ae}return ue.prototype["@@iterator"]=function(){return this},ue.prototype[it]=function(){return this},ue.prototype.next=function(){var k=this._index;if(k>=0&&k<this._keys.length){var z=this._selector(this._keys[k],this._values[k]);return k+1>=this._keys.length?(this._index=-1,this._keys=pr,this._values=pr):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},ue.prototype.throw=function(k){throw this._index>=0&&(this._index=-1,this._keys=pr,this._values=pr),k},ue.prototype.return=function(k){return this._index>=0&&(this._index=-1,this._keys=pr,this._values=pr),{value:k,done:!0}},ue}();return function(){function ue(){this._keys=[],this._values=[],this._cacheKey=jt,this._cacheIndex=-2}return Object.defineProperty(ue.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ue.prototype.has=function(k){return this._find(k,!1)>=0},ue.prototype.get=function(k){var z=this._find(k,!1);return z>=0?this._values[z]:void 0},ue.prototype.set=function(k,z){var ae=this._find(k,!0);return this._values[ae]=z,this},ue.prototype.delete=function(k){var z=this._find(k,!1);if(z>=0){for(var ae=this._keys.length,Ee=z+1;Ee<ae;Ee++)this._keys[Ee-1]=this._keys[Ee],this._values[Ee-1]=this._values[Ee];return this._keys.length--,this._values.length--,k===this._cacheKey&&(this._cacheKey=jt,this._cacheIndex=-2),!0}return!1},ue.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=jt,this._cacheIndex=-2},ue.prototype.keys=function(){return new Vr(this._keys,this._values,en)},ue.prototype.values=function(){return new Vr(this._keys,this._values,Ln)},ue.prototype.entries=function(){return new Vr(this._keys,this._values,Gi)},ue.prototype["@@iterator"]=function(){return this.entries()},ue.prototype[it]=function(){return this.entries()},ue.prototype._find=function(k,z){return this._cacheKey!==k&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=k)),this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push(k),this._values.push(void 0)),this._cacheIndex},ue}();function en(ue,k){return ue}function Ln(ue,k){return k}function Gi(ue,k){return[ue,k]}}function Ms(){return function(){function jt(){this._map=new Yt}return Object.defineProperty(jt.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),jt.prototype.has=function(pr){return this._map.has(pr)},jt.prototype.add=function(pr){return this._map.set(pr,pr),this},jt.prototype.delete=function(pr){return this._map.delete(pr)},jt.prototype.clear=function(){this._map.clear()},jt.prototype.keys=function(){return this._map.keys()},jt.prototype.values=function(){return this._map.values()},jt.prototype.entries=function(){return this._map.entries()},jt.prototype["@@iterator"]=function(){return this.keys()},jt.prototype[it]=function(){return this.keys()},jt}()}function ho(){var jt=16,pr=tt.create(),Vr=en();return function(){function z(){this._key=en()}return z.prototype.has=function(ae){var Ee=Ln(ae,!1);return Ee!==void 0?tt.has(Ee,this._key):!1},z.prototype.get=function(ae){var Ee=Ln(ae,!1);return Ee!==void 0?tt.get(Ee,this._key):void 0},z.prototype.set=function(ae,Ee){var De=Ln(ae,!0);return De[this._key]=Ee,this},z.prototype.delete=function(ae){var Ee=Ln(ae,!1);return Ee!==void 0?delete Ee[this._key]:!1},z.prototype.clear=function(){this._key=en()},z}();function en(){var z;do z="@@WeakMap@@"+k();while(tt.has(pr,z));return pr[z]=!0,z}function Ln(z,ae){if(!Z.call(z,Vr)){if(!ae)return;Object.defineProperty(z,Vr,{value:tt.create()})}return z[Vr]}function Gi(z,ae){for(var Ee=0;Ee<ae;++Ee)z[Ee]=Math.random()*255|0;return z}function ue(z){return typeof Uint8Array=="function"?typeof crypto!="undefined"?crypto.getRandomValues(new Uint8Array(z)):typeof msCrypto!="undefined"?msCrypto.getRandomValues(new Uint8Array(z)):Gi(new Uint8Array(z),z):Gi(new Array(z),z)}function k(){var z=ue(jt);z[6]=z[6]&79|64,z[8]=z[8]&191|128;for(var ae="",Ee=0;Ee<jt;++Ee){var De=z[Ee];(Ee===4||Ee===6||Ee===8)&&(ae+="-"),De<16&&(ae+="0"),ae+=De.toString(16).toLowerCase()}return ae}}function Zo(jt){return jt.__=void 0,delete jt.__,jt}})})(ye||(ye={}))},79801:function(sr){(function(ne,U){sr.exports=U()})(this,function(){"use strict";var ne=function(W){return W instanceof Uint8Array||W instanceof Uint16Array||W instanceof Uint32Array||W instanceof Int8Array||W instanceof Int16Array||W instanceof Int32Array||W instanceof Float32Array||W instanceof Float64Array||W instanceof Uint8ClampedArray},U=function(W,Ce){for(var Ye=Object.keys(Ce),Kt=0;Kt<Ye.length;++Kt)W[Ye[Kt]]=Ce[Ye[Kt]];return W},te=`
|
|
`;function ye(W){return typeof atob!="undefined"?atob(W):"base64:"+W}function y(W){var Ce=new Error("(regl) "+W);throw console.error(Ce),Ce}function he(W,Ce){W||y(Ce)}function Z(W){return W?": "+W:""}function pe(W,Ce,Ye){W in Ce||y("unknown parameter ("+W+")"+Z(Ye)+". possible values: "+Object.keys(Ce).join())}function fe(W,Ce){ne(W)||y("invalid parameter type"+Z(Ce)+". must be a typed array")}function it(W,Ce){switch(Ce){case"number":return typeof W=="number";case"object":return typeof W=="object";case"string":return typeof W=="string";case"boolean":return typeof W=="boolean";case"function":return typeof W=="function";case"undefined":return typeof W=="undefined";case"symbol":return typeof W=="symbol"}}function ce(W,Ce,Ye){it(W,Ce)||y("invalid parameter type"+Z(Ye)+". expected "+Ce+", got "+typeof W)}function rt(W,Ce){W>=0&&(W|0)===W||y("invalid parameter type, ("+W+")"+Z(Ce)+". must be a nonnegative integer")}function vt(W,Ce,Ye){Ce.indexOf(W)<0&&y("invalid value"+Z(Ye)+". must be one of: "+Ce)}var tt=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function Ot(W){Object.keys(W).forEach(function(Ce){tt.indexOf(Ce)<0&&y('invalid regl constructor argument "'+Ce+'". must be one of '+tt)})}function Xt(W,Ce){for(W=W+"";W.length<Ce;)W=" "+W;return W}function Yt(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function ar(W,Ce){this.number=W,this.line=Ce,this.errors=[]}function Zt(W,Ce,Ye){this.file=W,this.line=Ce,this.message=Ye}function bt(){var W=new Error,Ce=(W.stack||W).toString(),Ye=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(Ce);if(Ye)return Ye[1];var Kt=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(Ce);return Kt?Kt[1]:"unknown"}function St(){var W=new Error,Ce=(W.stack||W).toString(),Ye=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(Ce);if(Ye)return Ye[1];var Kt=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(Ce);return Kt?Kt[1]:"unknown"}function Rr(W,Ce){var Ye=W.split(`
|
|
`),Kt=1,vr=0,Jt={unknown:new Yt,0:new Yt};Jt.unknown.name=Jt[0].name=Ce||bt(),Jt.unknown.lines.push(new ar(0,""));for(var Ut=0;Ut<Ye.length;++Ut){var Br=Ye[Ut],Or=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(Br);if(Or)switch(Or[1]){case"line":var Yr=/(\d+)(\s+\d+)?/.exec(Or[2]);Yr&&(Kt=Yr[1]|0,Yr[2]&&(vr=Yr[2]|0,vr in Jt||(Jt[vr]=new Yt)));break;case"define":var Nr=/SHADER_NAME(_B64)?\s+(.*)$/.exec(Or[2]);Nr&&(Jt[vr].name=Nr[1]?ye(Nr[2]):Nr[2]);break}Jt[vr].lines.push(new ar(Kt++,Br))}return Object.keys(Jt).forEach(function(Wr){var tn=Jt[Wr];tn.lines.forEach(function(kr){tn.index[kr.number]=kr})}),Jt}function gr(W){var Ce=[];return W.split(`
|
|
`).forEach(function(Ye){if(!(Ye.length<5)){var Kt=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(Ye);Kt?Ce.push(new Zt(Kt[1]|0,Kt[2]|0,Kt[3].trim())):Ye.length>0&&Ce.push(new Zt("unknown",0,Ye))}}),Ce}function fr(W,Ce){Ce.forEach(function(Ye){var Kt=W[Ye.file];if(Kt){var vr=Kt.index[Ye.line];if(vr){vr.errors.push(Ye),Kt.hasErrors=!0;return}}W.unknown.hasErrors=!0,W.unknown.lines[0].errors.push(Ye)})}function Mt(W,Ce,Ye,Kt,vr){if(!W.getShaderParameter(Ce,W.COMPILE_STATUS)){var Jt=W.getShaderInfoLog(Ce),Ut=Kt===W.FRAGMENT_SHADER?"fragment":"vertex";H(Ye,"string",Ut+" shader source must be a string",vr);var Br=Rr(Ye,vr),Or=gr(Jt);fr(Br,Or),Object.keys(Br).forEach(function(Yr){var Nr=Br[Yr];if(!Nr.hasErrors)return;var Wr=[""],tn=[""];function kr($r,Pt){Wr.push($r),tn.push(Pt||"")}kr("file number "+Yr+": "+Nr.name+`
|
|
`,"color:red;text-decoration:underline;font-weight:bold"),Nr.lines.forEach(function($r){if($r.errors.length>0){kr(Xt($r.number,4)+"| ","background-color:yellow; font-weight:bold"),kr($r.line+te,"color:red; background-color:yellow; font-weight:bold");var Pt=0;$r.errors.forEach(function(ur){var Ur=ur.message,cn=/^\s*'(.*)'\s*:\s*(.*)$/.exec(Ur);if(cn){var Tr=cn[1];switch(Ur=cn[2],Tr){case"assign":Tr="=";break}Pt=Math.max($r.line.indexOf(Tr,Pt),0)}else Pt=0;kr(Xt("| ",6)),kr(Xt("^^^",Pt+3)+te,"font-weight:bold"),kr(Xt("| ",6)),kr(Ur+te,"font-weight:bold")}),kr(Xt("| ",6)+te)}else kr(Xt($r.number,4)+"| "),kr($r.line+te,"color:red")}),typeof document!="undefined"&&!window.chrome?(tn[0]=Wr.join("%c"),console.log.apply(console,tn)):console.log(Wr.join(""))}),he.raise("Error compiling "+Ut+" shader, "+Br[0].name)}}function ft(W,Ce,Ye,Kt,vr){if(!W.getProgramParameter(Ce,W.LINK_STATUS)){var Jt=W.getProgramInfoLog(Ce),Ut=Rr(Ye,vr),Br=Rr(Kt,vr),Or='Error linking program with vertex shader, "'+Br[0].name+'", and fragment shader "'+Ut[0].name+'"';typeof document!="undefined"?console.log("%c"+Or+te+"%c"+Jt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(Or+te+Jt),he.raise(Or)}}function kt(W){W._commandRef=bt()}function qe(W,Ce,Ye,Kt){kt(W);function vr(Or){return Or?Kt.id(Or):0}W._fragId=vr(W.static.frag),W._vertId=vr(W.static.vert);function Jt(Or,Yr){Object.keys(Yr).forEach(function(Nr){Or[Kt.id(Nr)]=!0})}var Ut=W._uniformSet={};Jt(Ut,Ce.static),Jt(Ut,Ce.dynamic);var Br=W._attributeSet={};Jt(Br,Ye.static),Jt(Br,Ye.dynamic),W._hasCount="count"in W.static||"count"in W.dynamic||"elements"in W.static||"elements"in W.dynamic}function Dt(W,Ce){var Ye=St();y(W+" in command "+(Ce||bt())+(Ye==="unknown"?"":" called from "+Ye))}function dr(W,Ce,Ye){W||Dt(Ce,Ye||bt())}function oe(W,Ce,Ye,Kt){W in Ce||Dt("unknown parameter ("+W+")"+Z(Ye)+". possible values: "+Object.keys(Ce).join(),Kt||bt())}function H(W,Ce,Ye,Kt){it(W,Ce)||Dt("invalid parameter type"+Z(Ye)+". expected "+Ce+", got "+typeof W,Kt||bt())}function re(W){W()}function Be(W,Ce,Ye){W.texture?vt(W.texture._texture.internalformat,Ce,"unsupported texture format for attachment"):vt(W.renderbuffer._renderbuffer.format,Ye,"unsupported renderbuffer format for attachment")}var we=33071,ut=9728,ie=9984,Le=9985,Pe=9986,Ge=9987,Vt=5120,Et=5121,Jr=5122,on=5123,Mr=5124,Dn=5125,bn=5126,rn=32819,yi=32820,ti=33635,Zi=34042,En=36193,Rn={};Rn[Vt]=Rn[Et]=1,Rn[Jr]=Rn[on]=Rn[En]=Rn[ti]=Rn[rn]=Rn[yi]=2,Rn[Mr]=Rn[Dn]=Rn[bn]=Rn[Zi]=4;function sa(W,Ce){return W===yi||W===rn||W===ti?2:W===Zi?4:Rn[W]*Ce}function ki(W){return!(W&W-1)&&!!W}function ba(W,Ce,Ye){var Kt,vr=Ce.width,Jt=Ce.height,Ut=Ce.channels;he(vr>0&&vr<=Ye.maxTextureSize&&Jt>0&&Jt<=Ye.maxTextureSize,"invalid texture shape"),(W.wrapS!==we||W.wrapT!==we)&&he(ki(vr)&&ki(Jt),"incompatible wrap mode for texture, both width and height must be power of 2"),Ce.mipmask===1?vr!==1&&Jt!==1&&he(W.minFilter!==ie&&W.minFilter!==Pe&&W.minFilter!==Le&&W.minFilter!==Ge,"min filter requires mipmap"):(he(ki(vr)&&ki(Jt),"texture must be a square power of 2 to support mipmapping"),he(Ce.mipmask===(vr<<1)-1,"missing or incomplete mipmap data")),Ce.type===bn&&(Ye.extensions.indexOf("oes_texture_float_linear")<0&&he(W.minFilter===ut&&W.magFilter===ut,"filter not supported, must enable oes_texture_float_linear"),he(!W.genMipmaps,"mipmap generation not supported with float textures"));var Br=Ce.images;for(Kt=0;Kt<16;++Kt)if(Br[Kt]){var Or=vr>>Kt,Yr=Jt>>Kt;he(Ce.mipmask&1<<Kt,"missing mipmap data");var Nr=Br[Kt];if(he(Nr.width===Or&&Nr.height===Yr,"invalid shape for mip images"),he(Nr.format===Ce.format&&Nr.internalformat===Ce.internalformat&&Nr.type===Ce.type,"incompatible type for mip image"),!Nr.compressed)if(Nr.data){var Wr=Math.ceil(sa(Nr.type,Ut)*Or/Nr.unpackAlignment)*Nr.unpackAlignment;he(Nr.data.byteLength===Wr*Yr,"invalid data for image, buffer size is inconsistent with image format")}else Nr.element||Nr.copy}else W.genMipmaps||he((Ce.mipmask&1<<Kt)===0,"extra mipmap data");Ce.compressed&&he(!W.genMipmaps,"mipmap generation for compressed images not supported")}function fo(W,Ce,Ye,Kt){var vr=W.width,Jt=W.height,Ut=W.channels;he(vr>0&&vr<=Kt.maxTextureSize&&Jt>0&&Jt<=Kt.maxTextureSize,"invalid texture shape"),he(vr===Jt,"cube map must be square"),he(Ce.wrapS===we&&Ce.wrapT===we,"wrap mode not supported by cube map");for(var Br=0;Br<Ye.length;++Br){var Or=Ye[Br];he(Or.width===vr&&Or.height===Jt,"inconsistent cube map face shape"),Ce.genMipmaps&&(he(!Or.compressed,"can not generate mipmap for compressed textures"),he(Or.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var Yr=Or.images,Nr=0;Nr<16;++Nr){var Wr=Yr[Nr];if(Wr){var tn=vr>>Nr,kr=Jt>>Nr;he(Or.mipmask&1<<Nr,"missing mipmap data"),he(Wr.width===tn&&Wr.height===kr,"invalid shape for mip images"),he(Wr.format===W.format&&Wr.internalformat===W.internalformat&&Wr.type===W.type,"incompatible type for mip image"),Wr.compressed||(Wr.data?he(Wr.data.byteLength===tn*kr*Math.max(sa(Wr.type,Ut),Wr.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):Wr.element||Wr.copy)}}}}var Re=U(he,{optional:re,raise:y,commandRaise:Dt,command:dr,parameter:pe,commandParameter:oe,constructor:Ot,type:ce,commandType:H,isTypedArray:fe,nni:rt,oneOf:vt,shaderError:Mt,linkError:ft,callSite:St,saveCommandRef:kt,saveDrawInfo:qe,framebufferFormat:Be,guessCommand:bt,texture2D:ba,textureCube:fo}),Ea=0,va=0;function Za(W,Ce){this.id=Ea++,this.type=W,this.data=Ce}function Ms(W){return W.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function ho(W){if(W.length===0)return[];var Ce=W.charAt(0),Ye=W.charAt(W.length-1);if(W.length>1&&Ce===Ye&&(Ce==='"'||Ce==="'"))return['"'+Ms(W.substr(1,W.length-2))+'"'];var Kt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(W);if(Kt)return ho(W.substr(0,Kt.index)).concat(ho(Kt[1])).concat(ho(W.substr(Kt.index+Kt[0].length)));var vr=W.split(".");if(vr.length===1)return['"'+Ms(W)+'"'];for(var Jt=[],Ut=0;Ut<vr.length;++Ut)Jt=Jt.concat(ho(vr[Ut]));return Jt}function Zo(W){return"["+ho(W).join("][")+"]"}function jt(W,Ce){return new Za(W,Zo(Ce+""))}function pr(W){return typeof W=="function"&&!W._reglType||W instanceof Za}function Vr(W,Ce){return typeof W=="function"?new Za(va,W):W}var en={DynamicVariable:Za,define:jt,isDynamic:pr,unbox:Vr,accessor:Zo},Ln={next:typeof requestAnimationFrame=="function"?function(W){return requestAnimationFrame(W)}:function(W){return setTimeout(W,16)},cancel:typeof cancelAnimationFrame=="function"?function(W){return cancelAnimationFrame(W)}:clearTimeout},Gi=typeof performance!="undefined"&&performance.now?function(){return performance.now()}:function(){return+new Date};function ue(){var W={"":0},Ce=[""];return{id:function(Ye){var Kt=W[Ye];return Kt||(Kt=W[Ye]=Ce.length,Ce.push(Ye),Kt)},str:function(Ye){return Ce[Ye]}}}function k(W,Ce,Ye){var Kt=document.createElement("canvas");U(Kt.style,{border:0,margin:0,padding:0,top:0,left:0}),W.appendChild(Kt),W===document.body&&(Kt.style.position="absolute",U(W.style,{margin:0,padding:0}));function vr(){var Br=window.innerWidth,Or=window.innerHeight;if(W!==document.body){var Yr=W.getBoundingClientRect();Br=Yr.right-Yr.left,Or=Yr.bottom-Yr.top}Kt.width=Ye*Br,Kt.height=Ye*Or,U(Kt.style,{width:Br+"px",height:Or+"px"})}var Jt;W!==document.body&&typeof ResizeObserver=="function"?(Jt=new ResizeObserver(function(){setTimeout(vr)}),Jt.observe(W)):window.addEventListener("resize",vr,!1);function Ut(){Jt?Jt.disconnect():window.removeEventListener("resize",vr),W.removeChild(Kt)}return vr(),{canvas:Kt,onDestroy:Ut}}function z(W,Ce){function Ye(Kt){try{return W.getContext(Kt,Ce)}catch(vr){return null}}return Ye("webgl")||Ye("experimental-webgl")||Ye("webgl-experimental")}function ae(W){return typeof W.nodeName=="string"&&typeof W.appendChild=="function"&&typeof W.getBoundingClientRect=="function"}function Ee(W){return typeof W.drawArrays=="function"||typeof W.drawElements=="function"}function De(W){return typeof W=="string"?W.split():(Re(Array.isArray(W),"invalid extension array"),W)}function zt(W){return typeof W=="string"?(Re(typeof document!="undefined","not supported outside of DOM"),document.querySelector(W)):W}function Tt(W){var Ce=W||{},Ye,Kt,vr,Jt,Ut={},Br=[],Or=[],Yr=typeof window=="undefined"?1:window.devicePixelRatio,Nr=!1,Wr=function($r){$r&&Re.raise($r)},tn=function(){};if(typeof Ce=="string"?(Re(typeof document!="undefined","selector queries only supported in DOM enviroments"),Ye=document.querySelector(Ce),Re(Ye,"invalid query string for element")):typeof Ce=="object"?ae(Ce)?Ye=Ce:Ee(Ce)?(Jt=Ce,vr=Jt.canvas):(Re.constructor(Ce),"gl"in Ce?Jt=Ce.gl:"canvas"in Ce?vr=zt(Ce.canvas):"container"in Ce&&(Kt=zt(Ce.container)),"attributes"in Ce&&(Ut=Ce.attributes,Re.type(Ut,"object","invalid context attributes")),"extensions"in Ce&&(Br=De(Ce.extensions)),"optionalExtensions"in Ce&&(Or=De(Ce.optionalExtensions)),"onDone"in Ce&&(Re.type(Ce.onDone,"function","invalid or missing onDone callback"),Wr=Ce.onDone),"profile"in Ce&&(Nr=!!Ce.profile),"pixelRatio"in Ce&&(Yr=+Ce.pixelRatio,Re(Yr>0,"invalid pixel ratio"))):Re.raise("invalid arguments to regl"),Ye&&(Ye.nodeName.toLowerCase()==="canvas"?vr=Ye:Kt=Ye),!Jt){if(!vr){Re(typeof document!="undefined","must manually specify webgl context outside of DOM environments");var kr=k(Kt||document.body,Wr,Yr);if(!kr)return null;vr=kr.canvas,tn=kr.onDestroy}Ut.premultipliedAlpha===void 0&&(Ut.premultipliedAlpha=!0),Jt=z(vr,Ut)}return Jt?{gl:Jt,canvas:vr,container:Kt,extensions:Br,optionalExtensions:Or,pixelRatio:Yr,profile:Nr,onDone:Wr,onDestroy:tn}:(tn(),Wr("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Rt(W,Ce){var Ye={};function Kt(Ut){Re.type(Ut,"string","extension name must be string");var Br=Ut.toLowerCase(),Or;try{Or=Ye[Br]=W.getExtension(Br)}catch(Yr){}return!!Or}for(var vr=0;vr<Ce.extensions.length;++vr){var Jt=Ce.extensions[vr];if(!Kt(Jt))return Ce.onDestroy(),Ce.onDone('"'+Jt+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return Ce.optionalExtensions.forEach(Kt),{extensions:Ye,restore:function(){Object.keys(Ye).forEach(function(Ut){if(Ye[Ut]&&!Kt(Ut))throw new Error("(regl): error restoring extension "+Ut)})}}}function dt(W,Ce){for(var Ye=Array(W),Kt=0;Kt<W;++Kt)Ye[Kt]=Ce(Kt);return Ye}var N=5120,B=5121,$=5122,ee=5123,xe=5124,Ue=5125,Qe=5126;function j(W){for(var Ce=16;Ce<=1<<28;Ce*=16)if(W<=Ce)return Ce;return 0}function Q(W){var Ce,Ye;return Ce=(W>65535)<<4,W>>>=Ce,Ye=(W>255)<<3,W>>>=Ye,Ce|=Ye,Ye=(W>15)<<2,W>>>=Ye,Ce|=Ye,Ye=(W>3)<<1,W>>>=Ye,Ce|=Ye,Ce|W>>1}function Fe(){var W=dt(8,function(){return[]});function Ce(Jt){var Ut=j(Jt),Br=W[Q(Ut)>>2];return Br.length>0?Br.pop():new ArrayBuffer(Ut)}function Ye(Jt){W[Q(Jt.byteLength)>>2].push(Jt)}function Kt(Jt,Ut){var Br=null;switch(Jt){case N:Br=new Int8Array(Ce(Ut),0,Ut);break;case B:Br=new Uint8Array(Ce(Ut),0,Ut);break;case $:Br=new Int16Array(Ce(2*Ut),0,Ut);break;case ee:Br=new Uint16Array(Ce(2*Ut),0,Ut);break;case xe:Br=new Int32Array(Ce(4*Ut),0,Ut);break;case Ue:Br=new Uint32Array(Ce(4*Ut),0,Ut);break;case Qe:Br=new Float32Array(Ce(4*Ut),0,Ut);break;default:return null}return Br.length!==Ut?Br.subarray(0,Ut):Br}function vr(Jt){Ye(Jt.buffer)}return{alloc:Ce,free:Ye,allocType:Kt,freeType:vr}}var et=Fe();et.zero=Fe();var Ae=3408,$t=3410,yr=3411,nn=3412,Qr=3413,tr=3414,Xr=3415,zr=33901,jr=33902,Jn=3379,ln=3386,hi=34921,Vi=36347,ci=36348,Li=35661,Ei=35660,ns=34930,Qi=36349,Pa=34076,Si=34024,di=7936,Ai=7937,Oa=7938,vu=35724,fa=34047,Ra=36063,Gl=34852,vs=3553,Ma=34067,vi=34069,ka=33984,na=6408,Vo=5126,ca=5121,is=36160,qo=36053,Du=36064,ms=16384,yc=function(W,Ce){var Ye=1;Ce.ext_texture_filter_anisotropic&&(Ye=W.getParameter(fa));var Kt=1,vr=1;Ce.webgl_draw_buffers&&(Kt=W.getParameter(Gl),vr=W.getParameter(Ra));var Jt=!!Ce.oes_texture_float;if(Jt){var Ut=W.createTexture();W.bindTexture(vs,Ut),W.texImage2D(vs,0,na,1,1,0,na,Vo,null);var Br=W.createFramebuffer();if(W.bindFramebuffer(is,Br),W.framebufferTexture2D(is,Du,vs,Ut,0),W.bindTexture(vs,null),W.checkFramebufferStatus(is)!==qo)Jt=!1;else{W.viewport(0,0,1,1),W.clearColor(1,0,0,1),W.clear(ms);var Or=et.allocType(Vo,4);W.readPixels(0,0,1,1,na,Vo,Or),W.getError()?Jt=!1:(W.deleteFramebuffer(Br),W.deleteTexture(Ut),Jt=Or[0]===1),et.freeType(Or)}}var Yr=typeof navigator!="undefined"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Nr=!0;if(!Yr){var Wr=W.createTexture(),tn=et.allocType(ca,36);W.activeTexture(ka),W.bindTexture(Ma,Wr),W.texImage2D(vi,0,na,3,3,0,na,ca,tn),et.freeType(tn),W.bindTexture(Ma,null),W.deleteTexture(Wr),Nr=!W.getError()}return{colorBits:[W.getParameter($t),W.getParameter(yr),W.getParameter(nn),W.getParameter(Qr)],depthBits:W.getParameter(tr),stencilBits:W.getParameter(Xr),subpixelBits:W.getParameter(Ae),extensions:Object.keys(Ce).filter(function(kr){return!!Ce[kr]}),maxAnisotropic:Ye,maxDrawbuffers:Kt,maxColorAttachments:vr,pointSizeDims:W.getParameter(zr),lineWidthDims:W.getParameter(jr),maxViewportDims:W.getParameter(ln),maxCombinedTextureUnits:W.getParameter(Li),maxCubeMapSize:W.getParameter(Pa),maxRenderbufferSize:W.getParameter(Si),maxTextureUnits:W.getParameter(ns),maxTextureSize:W.getParameter(Jn),maxAttributes:W.getParameter(hi),maxVertexUniforms:W.getParameter(Vi),maxVertexTextureUnits:W.getParameter(Ei),maxVaryingVectors:W.getParameter(ci),maxFragmentUniforms:W.getParameter(Qi),glsl:W.getParameter(vu),renderer:W.getParameter(Ai),vendor:W.getParameter(di),version:W.getParameter(Oa),readFloat:Jt,npotTextureCube:Nr}};function Sa(W){return!!W&&typeof W=="object"&&Array.isArray(W.shape)&&Array.isArray(W.stride)&&typeof W.offset=="number"&&W.shape.length===W.stride.length&&(Array.isArray(W.data)||ne(W.data))}var Ji=function(W){return Object.keys(W).map(function(Ce){return W[Ce]})},Qt={shape:Kr,flatten:lr};function _n(W,Ce,Ye){for(var Kt=0;Kt<Ce;++Kt)Ye[Kt]=W[Kt]}function ge(W,Ce,Ye,Kt){for(var vr=0,Jt=0;Jt<Ce;++Jt)for(var Ut=W[Jt],Br=0;Br<Ye;++Br)Kt[vr++]=Ut[Br]}function ke(W,Ce,Ye,Kt,vr,Jt){for(var Ut=Jt,Br=0;Br<Ce;++Br)for(var Or=W[Br],Yr=0;Yr<Ye;++Yr)for(var Nr=Or[Yr],Wr=0;Wr<Kt;++Wr)vr[Ut++]=Nr[Wr]}function gt(W,Ce,Ye,Kt,vr){for(var Jt=1,Ut=Ye+1;Ut<Ce.length;++Ut)Jt*=Ce[Ut];var Br=Ce[Ye];if(Ce.length-Ye===4){var Or=Ce[Ye+1],Yr=Ce[Ye+2],Nr=Ce[Ye+3];for(Ut=0;Ut<Br;++Ut)ke(W[Ut],Or,Yr,Nr,Kt,vr),vr+=Jt}else for(Ut=0;Ut<Br;++Ut)gt(W[Ut],Ce,Ye+1,Kt,vr),vr+=Jt}function lr(W,Ce,Ye,Kt){var vr=1;if(Ce.length)for(var Jt=0;Jt<Ce.length;++Jt)vr*=Ce[Jt];else vr=0;var Ut=Kt||et.allocType(Ye,vr);switch(Ce.length){case 0:break;case 1:_n(W,Ce[0],Ut);break;case 2:ge(W,Ce[0],Ce[1],Ut);break;case 3:ke(W,Ce[0],Ce[1],Ce[2],Ut,0);break;default:gt(W,Ce,0,Ut,0)}return Ut}function Kr(W){for(var Ce=[],Ye=W;Ye.length;Ye=Ye[0])Ce.push(Ye.length);return Ce}var kn={"[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},ji=5120,go=5122,Co=5124,po=5121,Ls=5123,Is=5125,ep=5126,Af=5126,Ko={int8:ji,int16:go,int32:Co,uint8:po,uint16:Ls,uint32:Is,float:ep,float32:Af},El=35048,Sl=35040,Lu={dynamic:El,stream:Sl,static:35044},Bu=Qt.flatten,Ju=Qt.shape,$c=35044,Bs=35040,qa=5121,Al=5126,el=[];el[5120]=1,el[5122]=2,el[5124]=4,el[5121]=1,el[5123]=2,el[5125]=4,el[5126]=4;function Tf(W){return kn[Object.prototype.toString.call(W)]|0}function tp(W,Ce){for(var Ye=0;Ye<Ce.length;++Ye)W[Ye]=Ce[Ye]}function wf(W,Ce,Ye,Kt,vr,Jt,Ut){for(var Br=0,Or=0;Or<Ye;++Or)for(var Yr=0;Yr<Kt;++Yr)W[Br++]=Ce[vr*Or+Jt*Yr+Ut]}function hh(W,Ce,Ye,Kt){var vr=0,Jt={};function Ut(Pt){this.id=vr++,this.buffer=W.createBuffer(),this.type=Pt,this.usage=$c,this.byteLength=0,this.dimension=1,this.dtype=qa,this.persistentData=null,Ye.profile&&(this.stats={size:0})}Ut.prototype.bind=function(){W.bindBuffer(this.type,this.buffer)},Ut.prototype.destroy=function(){tn(this)};var Br=[];function Or(Pt,ur){var Ur=Br.pop();return Ur||(Ur=new Ut(Pt)),Ur.bind(),Wr(Ur,ur,Bs,0,1,!1),Ur}function Yr(Pt){Br.push(Pt)}function Nr(Pt,ur,Ur){Pt.byteLength=ur.byteLength,W.bufferData(Pt.type,ur,Ur)}function Wr(Pt,ur,Ur,cn,Tr,pn){var Ir;if(Pt.usage=Ur,Array.isArray(ur)){if(Pt.dtype=cn||Al,ur.length>0){var fn;if(Array.isArray(ur[0])){Ir=Ju(ur);for(var Ar=1,un=1;un<Ir.length;++un)Ar*=Ir[un];Pt.dimension=Ar,fn=Bu(ur,Ir,Pt.dtype),Nr(Pt,fn,Ur),pn?Pt.persistentData=fn:et.freeType(fn)}else if(typeof ur[0]=="number"){Pt.dimension=Tr;var jn=et.allocType(Pt.dtype,ur.length);tp(jn,ur),Nr(Pt,jn,Ur),pn?Pt.persistentData=jn:et.freeType(jn)}else ne(ur[0])?(Pt.dimension=ur[0].length,Pt.dtype=cn||Tf(ur[0])||Al,fn=Bu(ur,[ur.length,ur[0].length],Pt.dtype),Nr(Pt,fn,Ur),pn?Pt.persistentData=fn:et.freeType(fn)):Re.raise("invalid buffer data")}}else if(ne(ur))Pt.dtype=cn||Tf(ur),Pt.dimension=Tr,Nr(Pt,ur,Ur),pn&&(Pt.persistentData=new Uint8Array(new Uint8Array(ur.buffer)));else if(Sa(ur)){Ir=ur.shape;var ai=ur.stride,an=ur.offset,Lr=0,xr=0,er=0,Ti=0;Ir.length===1?(Lr=Ir[0],xr=1,er=ai[0],Ti=0):Ir.length===2?(Lr=Ir[0],xr=Ir[1],er=ai[0],Ti=ai[1]):Re.raise("invalid shape"),Pt.dtype=cn||Tf(ur.data)||Al,Pt.dimension=xr;var Ke=et.allocType(Pt.dtype,Lr*xr);wf(Ke,ur.data,Lr,xr,er,Ti,an),Nr(Pt,Ke,Ur),pn?Pt.persistentData=Ke:et.freeType(Ke)}else ur instanceof ArrayBuffer?(Pt.dtype=qa,Pt.dimension=Tr,Nr(Pt,ur,Ur),pn&&(Pt.persistentData=new Uint8Array(new Uint8Array(ur)))):Re.raise("invalid buffer data")}function tn(Pt){Ce.bufferCount--,Kt(Pt);var ur=Pt.buffer;Re(ur,"buffer must not be deleted already"),W.deleteBuffer(ur),Pt.buffer=null,delete Jt[Pt.id]}function kr(Pt,ur,Ur,cn){Ce.bufferCount++;var Tr=new Ut(ur);Jt[Tr.id]=Tr;function pn(Ar){var un=$c,jn=null,ai=0,an=0,Lr=1;return Array.isArray(Ar)||ne(Ar)||Sa(Ar)||Ar instanceof ArrayBuffer?jn=Ar:typeof Ar=="number"?ai=Ar|0:Ar&&(Re.type(Ar,"object","buffer arguments must be an object, a number or an array"),"data"in Ar&&(Re(jn===null||Array.isArray(jn)||ne(jn)||Sa(jn),"invalid data for buffer"),jn=Ar.data),"usage"in Ar&&(Re.parameter(Ar.usage,Lu,"invalid buffer usage"),un=Lu[Ar.usage]),"type"in Ar&&(Re.parameter(Ar.type,Ko,"invalid buffer type"),an=Ko[Ar.type]),"dimension"in Ar&&(Re.type(Ar.dimension,"number","invalid dimension"),Lr=Ar.dimension|0),"length"in Ar&&(Re.nni(ai,"buffer length must be a nonnegative integer"),ai=Ar.length|0)),Tr.bind(),jn?Wr(Tr,jn,un,an,Lr,cn):(ai&&W.bufferData(Tr.type,ai,un),Tr.dtype=an||qa,Tr.usage=un,Tr.dimension=Lr,Tr.byteLength=ai),Ye.profile&&(Tr.stats.size=Tr.byteLength*el[Tr.dtype]),pn}function Ir(Ar,un){Re(un+Ar.byteLength<=Tr.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+Ar.byteLength+" starting from offset "+un+" to a buffer of size "+Tr.byteLength),W.bufferSubData(Tr.type,un,Ar)}function fn(Ar,un){var jn=(un||0)|0,ai;if(Tr.bind(),ne(Ar)||Ar instanceof ArrayBuffer)Ir(Ar,jn);else if(Array.isArray(Ar)){if(Ar.length>0)if(typeof Ar[0]=="number"){var an=et.allocType(Tr.dtype,Ar.length);tp(an,Ar),Ir(an,jn),et.freeType(an)}else if(Array.isArray(Ar[0])||ne(Ar[0])){ai=Ju(Ar);var Lr=Bu(Ar,ai,Tr.dtype);Ir(Lr,jn),et.freeType(Lr)}else Re.raise("invalid buffer data")}else if(Sa(Ar)){ai=Ar.shape;var xr=Ar.stride,er=0,Ti=0,Ke=0,_i=0;ai.length===1?(er=ai[0],Ti=1,Ke=xr[0],_i=0):ai.length===2?(er=ai[0],Ti=ai[1],Ke=xr[0],_i=xr[1]):Re.raise("invalid shape");var si=Array.isArray(Ar.data)?Tr.dtype:Tf(Ar.data),qn=et.allocType(si,er*Ti);wf(qn,Ar.data,er,Ti,Ke,_i,Ar.offset),Ir(qn,jn),et.freeType(qn)}else Re.raise("invalid data for buffer subdata");return pn}return Ur||pn(Pt),pn._reglType="buffer",pn._buffer=Tr,pn.subdata=fn,Ye.profile&&(pn.stats=Tr.stats),pn.destroy=function(){tn(Tr)},pn}function $r(){Ji(Jt).forEach(function(Pt){Pt.buffer=W.createBuffer(),W.bindBuffer(Pt.type,Pt.buffer),W.bufferData(Pt.type,Pt.persistentData||Pt.byteLength,Pt.usage)})}return Ye.profile&&(Ce.getTotalBufferSize=function(){var Pt=0;return Object.keys(Jt).forEach(function(ur){Pt+=Jt[ur].stats.size}),Pt}),{create:kr,createStream:Or,destroyStream:Yr,clear:function(){Ji(Jt).forEach(tn),Br.forEach(tn)},getBuffer:function(Pt){return Pt&&Pt._buffer instanceof Ut?Pt._buffer:null},restore:$r,_initBuffer:Wr}}var ph=0,dh=0,rp=1,np=1,zp=4,Yc=4,Fu={points:ph,point:dh,lines:rp,line:np,triangles:zp,triangle:Yc,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},ip=0,Qo=1,Xl=4,Tl=5120,Ks=5121,wl=5122,ui=5123,tl=5124,Fs=5125,Nu=34963,rl=35040,ap=35044;function Yi(W,Ce,Ye,Kt){var vr={},Jt=0,Ut={uint8:Ks,uint16:ui};Ce.oes_element_index_uint&&(Ut.uint32=Fs);function Br($r){this.id=Jt++,vr[this.id]=this,this.buffer=$r,this.primType=Xl,this.vertCount=0,this.type=0}Br.prototype.bind=function(){this.buffer.bind()};var Or=[];function Yr($r){var Pt=Or.pop();return Pt||(Pt=new Br(Ye.create(null,Nu,!0,!1)._buffer)),Wr(Pt,$r,rl,-1,-1,0,0),Pt}function Nr($r){Or.push($r)}function Wr($r,Pt,ur,Ur,cn,Tr,pn){$r.buffer.bind();var Ir;if(Pt){var fn=pn;!pn&&(!ne(Pt)||Sa(Pt)&&!ne(Pt.data))&&(fn=Ce.oes_element_index_uint?Fs:ui),Ye._initBuffer($r.buffer,Pt,ur,fn,3)}else W.bufferData(Nu,Tr,ur),$r.buffer.dtype=Ir||Ks,$r.buffer.usage=ur,$r.buffer.dimension=3,$r.buffer.byteLength=Tr;if(Ir=pn,!pn){switch($r.buffer.dtype){case Ks:case Tl:Ir=Ks;break;case ui:case wl:Ir=ui;break;case Fs:case tl:Ir=Fs;break;default:Re.raise("unsupported type for element array")}$r.buffer.dtype=Ir}$r.type=Ir,Re(Ir!==Fs||!!Ce.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var Ar=cn;Ar<0&&(Ar=$r.buffer.byteLength,Ir===ui?Ar>>=1:Ir===Fs&&(Ar>>=2)),$r.vertCount=Ar;var un=Ur;if(Ur<0){un=Xl;var jn=$r.buffer.dimension;jn===1&&(un=ip),jn===2&&(un=Qo),jn===3&&(un=Xl)}$r.primType=un}function tn($r){Kt.elementsCount--,Re($r.buffer!==null,"must not double destroy elements"),delete vr[$r.id],$r.buffer.destroy(),$r.buffer=null}function kr($r,Pt){var ur=Ye.create(null,Nu,!0),Ur=new Br(ur._buffer);Kt.elementsCount++;function cn(Tr){if(!Tr)ur(),Ur.primType=Xl,Ur.vertCount=0,Ur.type=Ks;else if(typeof Tr=="number")ur(Tr),Ur.primType=Xl,Ur.vertCount=Tr|0,Ur.type=Ks;else{var pn=null,Ir=ap,fn=-1,Ar=-1,un=0,jn=0;Array.isArray(Tr)||ne(Tr)||Sa(Tr)?pn=Tr:(Re.type(Tr,"object","invalid arguments for elements"),"data"in Tr&&(pn=Tr.data,Re(Array.isArray(pn)||ne(pn)||Sa(pn),"invalid data for element buffer")),"usage"in Tr&&(Re.parameter(Tr.usage,Lu,"invalid element buffer usage"),Ir=Lu[Tr.usage]),"primitive"in Tr&&(Re.parameter(Tr.primitive,Fu,"invalid element buffer primitive"),fn=Fu[Tr.primitive]),"count"in Tr&&(Re(typeof Tr.count=="number"&&Tr.count>=0,"invalid vertex count for elements"),Ar=Tr.count|0),"type"in Tr&&(Re.parameter(Tr.type,Ut,"invalid buffer type"),jn=Ut[Tr.type]),"length"in Tr?un=Tr.length|0:(un=Ar,jn===ui||jn===wl?un*=2:(jn===Fs||jn===tl)&&(un*=4))),Wr(Ur,pn,Ir,fn,Ar,un,jn)}return cn}return cn($r),cn._reglType="elements",cn._elements=Ur,cn.subdata=function(Tr,pn){return ur.subdata(Tr,pn),cn},cn.destroy=function(){tn(Ur)},cn}return{create:kr,createStream:Yr,destroyStream:Nr,getElements:function($r){return typeof $r=="function"&&$r._elements instanceof Br?$r._elements:null},clear:function(){Ji(vr).forEach(tn)}}}var Ci=new Float32Array(1),ou=new Uint32Array(Ci.buffer),mu=5123;function Cf(W){for(var Ce=et.allocType(mu,W.length),Ye=0;Ye<W.length;++Ye)if(isNaN(W[Ye]))Ce[Ye]=65535;else if(W[Ye]===1/0)Ce[Ye]=31744;else if(W[Ye]===-1/0)Ce[Ye]=64512;else{Ci[0]=W[Ye];var Kt=ou[0],vr=Kt>>>31<<15,Jt=(Kt<<1>>>24)-127,Ut=Kt>>13&1024-1;if(Jt<-24)Ce[Ye]=vr;else if(Jt<-14){var Br=-14-Jt;Ce[Ye]=vr+(Ut+1024>>Br)}else Jt>15?Ce[Ye]=vr+31744:Ce[Ye]=vr+(Jt+15<<10)+Ut}return Ce}function Va(W){return Array.isArray(W)||ne(W)}var vh=function(W){return!(W&W-1)&&!!W},Rf=34467,Ns=3553,nl=34067,gu=34069,Cl=6408,mh=6406,_c=6407,ua=6409,xc=6410,il=32854,Rl=32855,gh=36194,qc=32819,ha=32820,Ml=33635,op=34042,al=6402,Kc=34041,Qc=35904,Mf=35906,ol=36193,$l=33776,Uu=33777,Jc=33778,bc=33779,Yl=35986,yh=35987,Ec=34798,Us=35840,_h=35841,ef=35842,Sc=35843,Il=36196,zu=5121,ql=5123,If=5125,sl=5126,xh=10242,bh=10243,Eh=10497,Pf=33071,sp=33648,ja=10240,up=10241,Of=9728,lp=9729,Kl=9984,cp=9985,Zu=9986,ma=9987,Ql=33170,Vu=4352,ul=4353,Bi=4354,ga=34046,su=3317,tf=37440,rf=37441,Qs=37443,fp=37444,kf=33984,Df=[Kl,Zu,cp,ma],Jl=[0,ua,xc,_c,Cl],Ro={};Ro[ua]=Ro[mh]=Ro[al]=1,Ro[Kc]=Ro[xc]=2,Ro[_c]=Ro[Qc]=3,Ro[Cl]=Ro[Mf]=4;function Ha(W){return"[object "+W+"]"}var nf=Ha("HTMLCanvasElement"),Ac=Ha("OffscreenCanvas"),io=Ha("CanvasRenderingContext2D"),xn=Ha("ImageBitmap"),gs=Ha("HTMLImageElement"),Lf=Ha("HTMLVideoElement"),Tc=Object.keys(kn).concat([nf,Ac,io,xn,gs,Lf]),as=[];as[zu]=1,as[sl]=4,as[ol]=2,as[ql]=2,as[If]=4;var pa=[];pa[il]=2,pa[Rl]=2,pa[gh]=2,pa[Kc]=4,pa[$l]=.5,pa[Uu]=.5,pa[Jc]=1,pa[bc]=1,pa[Yl]=.5,pa[yh]=1,pa[Ec]=1,pa[Us]=.5,pa[_h]=.25,pa[ef]=.5,pa[Sc]=.25,pa[Il]=.5;function Bf(W){return Array.isArray(W)&&(W.length===0||typeof W[0]=="number")}function sn(W){if(!Array.isArray(W))return!1;var Ce=W.length;return!(Ce===0||!Va(W[0]))}function ll(W){return Object.prototype.toString.call(W)}function af(W){return ll(W)===nf}function of(W){return ll(W)===Ac}function yu(W){return ll(W)===io}function zs(W){return ll(W)===xn}function Ff(W){return ll(W)===gs}function Nf(W){return ll(W)===Lf}function ys(W){if(!W)return!1;var Ce=ll(W);return Tc.indexOf(Ce)>=0?!0:Bf(W)||sn(W)||Sa(W)}function _u(W){return kn[Object.prototype.toString.call(W)]|0}function hp(W,Ce){var Ye=Ce.length;switch(W.type){case zu:case ql:case If:case sl:var Kt=et.allocType(W.type,Ye);Kt.set(Ce),W.data=Kt;break;case ol:W.data=Cf(Ce);break;default:Re.raise("unsupported texture type, must specify a typed array")}}function wc(W,Ce){return et.allocType(W.type===ol?sl:W.type,Ce)}function Cc(W,Ce){W.type===ol?(W.data=Cf(Ce),et.freeType(Ce)):W.data=Ce}function Uf(W,Ce,Ye,Kt,vr,Jt){for(var Ut=W.width,Br=W.height,Or=W.channels,Yr=Ut*Br*Or,Nr=wc(W,Yr),Wr=0,tn=0;tn<Br;++tn)for(var kr=0;kr<Ut;++kr)for(var $r=0;$r<Or;++$r)Nr[Wr++]=Ce[Ye*kr+Kt*tn+vr*$r+Jt];Cc(W,Nr)}function Js(W,Ce,Ye,Kt,vr,Jt){var Ut;if(typeof pa[W]!="undefined"?Ut=pa[W]:Ut=Ro[W]*as[Ce],Jt&&(Ut*=6),vr){for(var Br=0,Or=Ye;Or>=1;)Br+=Ut*Or*Or,Or/=2;return Br}else return Ut*Ye*Kt}function Ft(W,Ce,Ye,Kt,vr,Jt,Ut){var Br={"don't care":Vu,"dont care":Vu,nice:Bi,fast:ul},Or={repeat:Eh,clamp:Pf,mirror:sp},Yr={nearest:Of,linear:lp},Nr=U({mipmap:ma,"nearest mipmap nearest":Kl,"linear mipmap nearest":cp,"nearest mipmap linear":Zu,"linear mipmap linear":ma},Yr),Wr={none:0,browser:fp},tn={uint8:zu,rgba4:qc,rgb565:Ml,"rgb5 a1":ha},kr={alpha:mh,luminance:ua,"luminance alpha":xc,rgb:_c,rgba:Cl,rgba4:il,"rgb5 a1":Rl,rgb565:gh},$r={};Ce.ext_srgb&&(kr.srgb=Qc,kr.srgba=Mf),Ce.oes_texture_float&&(tn.float32=tn.float=sl),Ce.oes_texture_half_float&&(tn.float16=tn["half float"]=ol),Ce.webgl_depth_texture&&(U(kr,{depth:al,"depth stencil":Kc}),U(tn,{uint16:ql,uint32:If,"depth stencil":op})),Ce.webgl_compressed_texture_s3tc&&U($r,{"rgb s3tc dxt1":$l,"rgba s3tc dxt1":Uu,"rgba s3tc dxt3":Jc,"rgba s3tc dxt5":bc}),Ce.webgl_compressed_texture_atc&&U($r,{"rgb atc":Yl,"rgba atc explicit alpha":yh,"rgba atc interpolated alpha":Ec}),Ce.webgl_compressed_texture_pvrtc&&U($r,{"rgb pvrtc 4bppv1":Us,"rgb pvrtc 2bppv1":_h,"rgba pvrtc 4bppv1":ef,"rgba pvrtc 2bppv1":Sc}),Ce.webgl_compressed_texture_etc1&&($r["rgb etc1"]=Il);var Pt=Array.prototype.slice.call(W.getParameter(Rf));Object.keys($r).forEach(function(He){var rr=$r[He];Pt.indexOf(rr)>=0&&(kr[He]=rr)});var ur=Object.keys(kr);Ye.textureFormats=ur;var Ur=[];Object.keys(kr).forEach(function(He){var rr=kr[He];Ur[rr]=He});var cn=[];Object.keys(tn).forEach(function(He){var rr=tn[He];cn[rr]=He});var Tr=[];Object.keys(Yr).forEach(function(He){var rr=Yr[He];Tr[rr]=He});var pn=[];Object.keys(Nr).forEach(function(He){var rr=Nr[He];pn[rr]=He});var Ir=[];Object.keys(Or).forEach(function(He){var rr=Or[He];Ir[rr]=He});var fn=ur.reduce(function(He,rr){var Ht=kr[rr];return Ht===ua||Ht===mh||Ht===ua||Ht===xc||Ht===al||Ht===Kc||Ce.ext_srgb&&(Ht===Qc||Ht===Mf)?He[Ht]=Ht:Ht===Rl||rr.indexOf("rgba")>=0?He[Ht]=Cl:He[Ht]=_c,He},{});function Ar(){this.internalformat=Cl,this.format=Cl,this.type=zu,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=fp,this.width=0,this.height=0,this.channels=0}function un(He,rr){He.internalformat=rr.internalformat,He.format=rr.format,He.type=rr.type,He.compressed=rr.compressed,He.premultiplyAlpha=rr.premultiplyAlpha,He.flipY=rr.flipY,He.unpackAlignment=rr.unpackAlignment,He.colorSpace=rr.colorSpace,He.width=rr.width,He.height=rr.height,He.channels=rr.channels}function jn(He,rr){if(!(typeof rr!="object"||!rr)){if("premultiplyAlpha"in rr&&(Re.type(rr.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),He.premultiplyAlpha=rr.premultiplyAlpha),"flipY"in rr&&(Re.type(rr.flipY,"boolean","invalid texture flip"),He.flipY=rr.flipY),"alignment"in rr&&(Re.oneOf(rr.alignment,[1,2,4,8],"invalid texture unpack alignment"),He.unpackAlignment=rr.alignment),"colorSpace"in rr&&(Re.parameter(rr.colorSpace,Wr,"invalid colorSpace"),He.colorSpace=Wr[rr.colorSpace]),"type"in rr){var Ht=rr.type;Re(Ce.oes_texture_float||!(Ht==="float"||Ht==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),Re(Ce.oes_texture_half_float||!(Ht==="half float"||Ht==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),Re(Ce.webgl_depth_texture||!(Ht==="uint16"||Ht==="uint32"||Ht==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Re.parameter(Ht,tn,"invalid texture type"),He.type=tn[Ht]}var dn=He.width,xi=He.height,ya=He.channels,de=!1;"shape"in rr?(Re(Array.isArray(rr.shape)&&rr.shape.length>=2,"shape must be an array"),dn=rr.shape[0],xi=rr.shape[1],rr.shape.length===3&&(ya=rr.shape[2],Re(ya>0&&ya<=4,"invalid number of channels"),de=!0),Re(dn>=0&&dn<=Ye.maxTextureSize,"invalid width"),Re(xi>=0&&xi<=Ye.maxTextureSize,"invalid height")):("radius"in rr&&(dn=xi=rr.radius,Re(dn>=0&&dn<=Ye.maxTextureSize,"invalid radius")),"width"in rr&&(dn=rr.width,Re(dn>=0&&dn<=Ye.maxTextureSize,"invalid width")),"height"in rr&&(xi=rr.height,Re(xi>=0&&xi<=Ye.maxTextureSize,"invalid height")),"channels"in rr&&(ya=rr.channels,Re(ya>0&&ya<=4,"invalid number of channels"),de=!0)),He.width=dn|0,He.height=xi|0,He.channels=ya|0;var Oe=!1;if("format"in rr){var $e=rr.format;Re(Ce.webgl_depth_texture||!($e==="depth"||$e==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Re.parameter($e,kr,"invalid texture format");var Gt=He.internalformat=kr[$e];He.format=fn[Gt],$e in tn&&("type"in rr||(He.type=tn[$e])),$e in $r&&(He.compressed=!0),Oe=!0}!de&&Oe?He.channels=Ro[He.format]:de&&!Oe?He.channels!==Jl[He.format]&&(He.format=He.internalformat=Jl[He.channels]):Oe&&de&&Re(He.channels===Ro[He.format],"number of channels inconsistent with specified format")}}function ai(He){W.pixelStorei(tf,He.flipY),W.pixelStorei(rf,He.premultiplyAlpha),W.pixelStorei(Qs,He.colorSpace),W.pixelStorei(su,He.unpackAlignment)}function an(){Ar.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Lr(He,rr){var Ht=null;if(ys(rr)?Ht=rr:rr&&(Re.type(rr,"object","invalid pixel data type"),jn(He,rr),"x"in rr&&(He.xOffset=rr.x|0),"y"in rr&&(He.yOffset=rr.y|0),ys(rr.data)&&(Ht=rr.data)),Re(!He.compressed||Ht instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),rr.copy){Re(!Ht,"can not specify copy and data field for the same texture");var dn=vr.viewportWidth,xi=vr.viewportHeight;He.width=He.width||dn-He.xOffset,He.height=He.height||xi-He.yOffset,He.needsCopy=!0,Re(He.xOffset>=0&&He.xOffset<dn&&He.yOffset>=0&&He.yOffset<xi&&He.width>0&&He.width<=dn&&He.height>0&&He.height<=xi,"copy texture read out of bounds")}else if(!Ht)He.width=He.width||1,He.height=He.height||1,He.channels=He.channels||4;else if(ne(Ht))He.channels=He.channels||4,He.data=Ht,!("type"in rr)&&He.type===zu&&(He.type=_u(Ht));else if(Bf(Ht))He.channels=He.channels||4,hp(He,Ht),He.alignment=1,He.needsFree=!0;else if(Sa(Ht)){var ya=Ht.data;!Array.isArray(ya)&&He.type===zu&&(He.type=_u(ya));var de=Ht.shape,Oe=Ht.stride,$e,Gt,Nt,ct,yt,xt;de.length===3?(Nt=de[2],xt=Oe[2]):(Re(de.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Nt=1,xt=1),$e=de[0],Gt=de[1],ct=Oe[0],yt=Oe[1],He.alignment=1,He.width=$e,He.height=Gt,He.channels=Nt,He.format=He.internalformat=Jl[Nt],He.needsFree=!0,Uf(He,ya,ct,yt,xt,Ht.offset)}else if(af(Ht)||of(Ht)||yu(Ht))af(Ht)||of(Ht)?He.element=Ht:He.element=Ht.canvas,He.width=He.element.width,He.height=He.element.height,He.channels=4;else if(zs(Ht))He.element=Ht,He.width=Ht.width,He.height=Ht.height,He.channels=4;else if(Ff(Ht))He.element=Ht,He.width=Ht.naturalWidth,He.height=Ht.naturalHeight,He.channels=4;else if(Nf(Ht))He.element=Ht,He.width=Ht.videoWidth,He.height=Ht.videoHeight,He.channels=4;else if(sn(Ht)){var We=He.width||Ht[0].length,pt=He.height||Ht.length,Ie=He.channels;Va(Ht[0][0])?Ie=Ie||Ht[0][0].length:Ie=Ie||1;for(var mt=Qt.shape(Ht),Ct=1,hr=0;hr<mt.length;++hr)Ct*=mt[hr];var Cr=wc(He,Ct);Qt.flatten(Ht,mt,"",Cr),Cc(He,Cr),He.alignment=1,He.width=We,He.height=pt,He.channels=Ie,He.format=He.internalformat=Jl[Ie],He.needsFree=!0}He.type===sl?Re(Ye.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):He.type===ol&&Re(Ye.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function xr(He,rr,Ht){var dn=He.element,xi=He.data,ya=He.internalformat,de=He.format,Oe=He.type,$e=He.width,Gt=He.height;ai(He),dn?W.texImage2D(rr,Ht,de,de,Oe,dn):He.compressed?W.compressedTexImage2D(rr,Ht,ya,$e,Gt,0,xi):He.needsCopy?(Kt(),W.copyTexImage2D(rr,Ht,de,He.xOffset,He.yOffset,$e,Gt,0)):W.texImage2D(rr,Ht,de,$e,Gt,0,de,Oe,xi||null)}function er(He,rr,Ht,dn,xi){var ya=He.element,de=He.data,Oe=He.internalformat,$e=He.format,Gt=He.type,Nt=He.width,ct=He.height;ai(He),ya?W.texSubImage2D(rr,xi,Ht,dn,$e,Gt,ya):He.compressed?W.compressedTexSubImage2D(rr,xi,Ht,dn,Oe,Nt,ct,de):He.needsCopy?(Kt(),W.copyTexSubImage2D(rr,xi,Ht,dn,He.xOffset,He.yOffset,Nt,ct)):W.texSubImage2D(rr,xi,Ht,dn,Nt,ct,$e,Gt,de)}var Ti=[];function Ke(){return Ti.pop()||new an}function _i(He){He.needsFree&&et.freeType(He.data),an.call(He),Ti.push(He)}function si(){Ar.call(this),this.genMipmaps=!1,this.mipmapHint=Vu,this.mipmask=0,this.images=Array(16)}function qn(He,rr,Ht){var dn=He.images[0]=Ke();He.mipmask=1,dn.width=He.width=rr,dn.height=He.height=Ht,dn.channels=He.channels=4}function qi(He,rr){var Ht=null;if(ys(rr))Ht=He.images[0]=Ke(),un(Ht,He),Lr(Ht,rr),He.mipmask=1;else if(jn(He,rr),Array.isArray(rr.mipmap))for(var dn=rr.mipmap,xi=0;xi<dn.length;++xi)Ht=He.images[xi]=Ke(),un(Ht,He),Ht.width>>=xi,Ht.height>>=xi,Lr(Ht,dn[xi]),He.mipmask|=1<<xi;else Ht=He.images[0]=Ke(),un(Ht,He),Lr(Ht,rr),He.mipmask=1;un(He,He.images[0]),He.compressed&&(He.internalformat===$l||He.internalformat===Uu||He.internalformat===Jc||He.internalformat===bc)&&Re(He.width%4===0&&He.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function vo(He,rr){for(var Ht=He.images,dn=0;dn<Ht.length;++dn){if(!Ht[dn])return;xr(Ht[dn],rr,dn)}}var mo=[];function Ii(){var He=mo.pop()||new si;Ar.call(He),He.mipmask=0;for(var rr=0;rr<16;++rr)He.images[rr]=null;return He}function xo(He){for(var rr=He.images,Ht=0;Ht<rr.length;++Ht)rr[Ht]&&_i(rr[Ht]),rr[Ht]=null;mo.push(He)}function Aa(){this.minFilter=Of,this.magFilter=Of,this.wrapS=Pf,this.wrapT=Pf,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Vu}function bo(He,rr){if("min"in rr){var Ht=rr.min;Re.parameter(Ht,Nr),He.minFilter=Nr[Ht],Df.indexOf(He.minFilter)>=0&&!("faces"in rr)&&(He.genMipmaps=!0)}if("mag"in rr){var dn=rr.mag;Re.parameter(dn,Yr),He.magFilter=Yr[dn]}var xi=He.wrapS,ya=He.wrapT;if("wrap"in rr){var de=rr.wrap;typeof de=="string"?(Re.parameter(de,Or),xi=ya=Or[de]):Array.isArray(de)&&(Re.parameter(de[0],Or),Re.parameter(de[1],Or),xi=Or[de[0]],ya=Or[de[1]])}else{if("wrapS"in rr){var Oe=rr.wrapS;Re.parameter(Oe,Or),xi=Or[Oe]}if("wrapT"in rr){var $e=rr.wrapT;Re.parameter($e,Or),ya=Or[$e]}}if(He.wrapS=xi,He.wrapT=ya,"anisotropic"in rr){var Gt=rr.anisotropic;Re(typeof Gt=="number"&&Gt>=1&&Gt<=Ye.maxAnisotropic,"aniso samples must be between 1 and "),He.anisotropic=rr.anisotropic}if("mipmap"in rr){var Nt=!1;switch(typeof rr.mipmap){case"string":Re.parameter(rr.mipmap,Br,"invalid mipmap hint"),He.mipmapHint=Br[rr.mipmap],He.genMipmaps=!0,Nt=!0;break;case"boolean":Nt=He.genMipmaps=rr.mipmap;break;case"object":Re(Array.isArray(rr.mipmap),"invalid mipmap type"),He.genMipmaps=!1,Nt=!0;break;default:Re.raise("invalid mipmap type")}Nt&&!("min"in rr)&&(He.minFilter=Kl)}}function Eo(He,rr){W.texParameteri(rr,up,He.minFilter),W.texParameteri(rr,ja,He.magFilter),W.texParameteri(rr,xh,He.wrapS),W.texParameteri(rr,bh,He.wrapT),Ce.ext_texture_filter_anisotropic&&W.texParameteri(rr,ga,He.anisotropic),He.genMipmaps&&(W.hint(Ql,He.mipmapHint),W.generateMipmap(rr))}var Ga=0,Fo={},Ts=Ye.maxTextureUnits,So=Array(Ts).map(function(){return null});function gi(He){Ar.call(this),this.mipmask=0,this.internalformat=Cl,this.id=Ga++,this.refCount=1,this.target=He,this.texture=W.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Aa,Ut.profile&&(this.stats={size:0})}function cs(He){W.activeTexture(kf),W.bindTexture(He.target,He.texture)}function ia(){var He=So[0];He?W.bindTexture(He.target,He.texture):W.bindTexture(Ns,null)}function Xn(He){var rr=He.texture;Re(rr,"must not double destroy texture");var Ht=He.unit,dn=He.target;Ht>=0&&(W.activeTexture(kf+Ht),W.bindTexture(dn,null),So[Ht]=null),W.deleteTexture(rr),He.texture=null,He.params=null,He.pixels=null,He.refCount=0,delete Fo[He.id],Jt.textureCount--}U(gi.prototype,{bind:function(){var He=this;He.bindCount+=1;var rr=He.unit;if(rr<0){for(var Ht=0;Ht<Ts;++Ht){var dn=So[Ht];if(dn){if(dn.bindCount>0)continue;dn.unit=-1}So[Ht]=He,rr=Ht;break}rr>=Ts&&Re.raise("insufficient number of texture units"),Ut.profile&&Jt.maxTextureUnits<rr+1&&(Jt.maxTextureUnits=rr+1),He.unit=rr,W.activeTexture(kf+rr),W.bindTexture(He.target,He.texture)}return rr},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Xn(this)}});function Ri(He,rr){var Ht=new gi(Ns);Fo[Ht.id]=Ht,Jt.textureCount++;function dn(de,Oe){var $e=Ht.texInfo;Aa.call($e);var Gt=Ii();return typeof de=="number"?typeof Oe=="number"?qn(Gt,de|0,Oe|0):qn(Gt,de|0,de|0):de?(Re.type(de,"object","invalid arguments to regl.texture"),bo($e,de),qi(Gt,de)):qn(Gt,1,1),$e.genMipmaps&&(Gt.mipmask=(Gt.width<<1)-1),Ht.mipmask=Gt.mipmask,un(Ht,Gt),Re.texture2D($e,Gt,Ye),Ht.internalformat=Gt.internalformat,dn.width=Gt.width,dn.height=Gt.height,cs(Ht),vo(Gt,Ns),Eo($e,Ns),ia(),xo(Gt),Ut.profile&&(Ht.stats.size=Js(Ht.internalformat,Ht.type,Gt.width,Gt.height,$e.genMipmaps,!1)),dn.format=Ur[Ht.internalformat],dn.type=cn[Ht.type],dn.mag=Tr[$e.magFilter],dn.min=pn[$e.minFilter],dn.wrapS=Ir[$e.wrapS],dn.wrapT=Ir[$e.wrapT],dn}function xi(de,Oe,$e,Gt){Re(!!de,"must specify image data");var Nt=Oe|0,ct=$e|0,yt=Gt|0,xt=Ke();return un(xt,Ht),xt.width=0,xt.height=0,Lr(xt,de),xt.width=xt.width||(Ht.width>>yt)-Nt,xt.height=xt.height||(Ht.height>>yt)-ct,Re(Ht.type===xt.type&&Ht.format===xt.format&&Ht.internalformat===xt.internalformat,"incompatible format for texture.subimage"),Re(Nt>=0&&ct>=0&&Nt+xt.width<=Ht.width&&ct+xt.height<=Ht.height,"texture.subimage write out of bounds"),Re(Ht.mipmask&1<<yt,"missing mipmap data"),Re(xt.data||xt.element||xt.needsCopy,"missing image data"),cs(Ht),er(xt,Ns,Nt,ct,yt),ia(),_i(xt),dn}function ya(de,Oe){var $e=de|0,Gt=Oe|0||$e;if($e===Ht.width&&Gt===Ht.height)return dn;dn.width=Ht.width=$e,dn.height=Ht.height=Gt,cs(Ht);for(var Nt=0;Ht.mipmask>>Nt;++Nt){var ct=$e>>Nt,yt=Gt>>Nt;if(!ct||!yt)break;W.texImage2D(Ns,Nt,Ht.format,ct,yt,0,Ht.format,Ht.type,null)}return ia(),Ut.profile&&(Ht.stats.size=Js(Ht.internalformat,Ht.type,$e,Gt,!1,!1)),dn}return dn(He,rr),dn.subimage=xi,dn.resize=ya,dn._reglType="texture2d",dn._texture=Ht,Ut.profile&&(dn.stats=Ht.stats),dn.destroy=function(){Ht.decRef()},dn}function Xi(He,rr,Ht,dn,xi,ya){var de=new gi(nl);Fo[de.id]=de,Jt.cubeCount++;var Oe=new Array(6);function $e(ct,yt,xt,We,pt,Ie){var mt,Ct=de.texInfo;for(Aa.call(Ct),mt=0;mt<6;++mt)Oe[mt]=Ii();if(typeof ct=="number"||!ct){var hr=ct|0||1;for(mt=0;mt<6;++mt)qn(Oe[mt],hr,hr)}else if(typeof ct=="object")if(yt)qi(Oe[0],ct),qi(Oe[1],yt),qi(Oe[2],xt),qi(Oe[3],We),qi(Oe[4],pt),qi(Oe[5],Ie);else if(bo(Ct,ct),jn(de,ct),"faces"in ct){var Cr=ct.faces;for(Re(Array.isArray(Cr)&&Cr.length===6,"cube faces must be a length 6 array"),mt=0;mt<6;++mt)Re(typeof Cr[mt]=="object"&&!!Cr[mt],"invalid input for cube map face"),un(Oe[mt],de),qi(Oe[mt],Cr[mt])}else for(mt=0;mt<6;++mt)qi(Oe[mt],ct);else Re.raise("invalid arguments to cube map");for(un(de,Oe[0]),Ye.npotTextureCube||Re(vh(de.width)&&vh(de.height),"your browser does not support non power or two texture dimensions"),Ct.genMipmaps?de.mipmask=(Oe[0].width<<1)-1:de.mipmask=Oe[0].mipmask,Re.textureCube(de,Ct,Oe,Ye),de.internalformat=Oe[0].internalformat,$e.width=Oe[0].width,$e.height=Oe[0].height,cs(de),mt=0;mt<6;++mt)vo(Oe[mt],gu+mt);for(Eo(Ct,nl),ia(),Ut.profile&&(de.stats.size=Js(de.internalformat,de.type,$e.width,$e.height,Ct.genMipmaps,!0)),$e.format=Ur[de.internalformat],$e.type=cn[de.type],$e.mag=Tr[Ct.magFilter],$e.min=pn[Ct.minFilter],$e.wrapS=Ir[Ct.wrapS],$e.wrapT=Ir[Ct.wrapT],mt=0;mt<6;++mt)xo(Oe[mt]);return $e}function Gt(ct,yt,xt,We,pt){Re(!!yt,"must specify image data"),Re(typeof ct=="number"&&ct===(ct|0)&&ct>=0&&ct<6,"invalid face");var Ie=xt|0,mt=We|0,Ct=pt|0,hr=Ke();return un(hr,de),hr.width=0,hr.height=0,Lr(hr,yt),hr.width=hr.width||(de.width>>Ct)-Ie,hr.height=hr.height||(de.height>>Ct)-mt,Re(de.type===hr.type&&de.format===hr.format&&de.internalformat===hr.internalformat,"incompatible format for texture.subimage"),Re(Ie>=0&&mt>=0&&Ie+hr.width<=de.width&&mt+hr.height<=de.height,"texture.subimage write out of bounds"),Re(de.mipmask&1<<Ct,"missing mipmap data"),Re(hr.data||hr.element||hr.needsCopy,"missing image data"),cs(de),er(hr,gu+ct,Ie,mt,Ct),ia(),_i(hr),$e}function Nt(ct){var yt=ct|0;if(yt!==de.width){$e.width=de.width=yt,$e.height=de.height=yt,cs(de);for(var xt=0;xt<6;++xt)for(var We=0;de.mipmask>>We;++We)W.texImage2D(gu+xt,We,de.format,yt>>We,yt>>We,0,de.format,de.type,null);return ia(),Ut.profile&&(de.stats.size=Js(de.internalformat,de.type,$e.width,$e.height,!1,!0)),$e}}return $e(He,rr,Ht,dn,xi,ya),$e.subimage=Gt,$e.resize=Nt,$e._reglType="textureCube",$e._texture=de,Ut.profile&&($e.stats=de.stats),$e.destroy=function(){de.decRef()},$e}function Ao(){for(var He=0;He<Ts;++He)W.activeTexture(kf+He),W.bindTexture(Ns,null),So[He]=null;Ji(Fo).forEach(Xn),Jt.cubeCount=0,Jt.textureCount=0}Ut.profile&&(Jt.getTotalTextureSize=function(){var He=0;return Object.keys(Fo).forEach(function(rr){He+=Fo[rr].stats.size}),He});function gl(){for(var He=0;He<Ts;++He){var rr=So[He];rr&&(rr.bindCount=0,rr.unit=-1,So[He]=null)}Ji(Fo).forEach(function(Ht){Ht.texture=W.createTexture(),W.bindTexture(Ht.target,Ht.texture);for(var dn=0;dn<32;++dn)if(Ht.mipmask&1<<dn)if(Ht.target===Ns)W.texImage2D(Ns,dn,Ht.internalformat,Ht.width>>dn,Ht.height>>dn,0,Ht.internalformat,Ht.type,null);else for(var xi=0;xi<6;++xi)W.texImage2D(gu+xi,dn,Ht.internalformat,Ht.width>>dn,Ht.height>>dn,0,Ht.internalformat,Ht.type,null);Eo(Ht.texInfo,Ht.target)})}return{create2D:Ri,createCube:Xi,clear:Ao,getTexture:function(He){return null},restore:gl}}var Me=36161,F=32854,eu=32855,_e=36194,Pl=33189,Ka=36168,Zs=34041,Mo=35907,_s=34836,Bn=34842,An=34843,os=[];os[F]=2,os[eu]=2,os[_e]=2,os[Pl]=2,os[Ka]=1,os[Zs]=4,os[Mo]=4,os[_s]=16,os[Bn]=8,os[An]=6;function ss(W,Ce,Ye){return os[W]*Ce*Ye}var xu=function(W,Ce,Ye,Kt,vr){var Jt={rgba4:F,rgb565:_e,"rgb5 a1":eu,depth:Pl,stencil:Ka,"depth stencil":Zs};Ce.ext_srgb&&(Jt.srgba=Mo),Ce.ext_color_buffer_half_float&&(Jt.rgba16f=Bn,Jt.rgb16f=An),Ce.webgl_color_buffer_float&&(Jt.rgba32f=_s);var Ut=[];Object.keys(Jt).forEach(function(kr){var $r=Jt[kr];Ut[$r]=kr});var Br=0,Or={};function Yr(kr){this.id=Br++,this.refCount=1,this.renderbuffer=kr,this.format=F,this.width=0,this.height=0,vr.profile&&(this.stats={size:0})}Yr.prototype.decRef=function(){--this.refCount<=0&&Nr(this)};function Nr(kr){var $r=kr.renderbuffer;Re($r,"must not double destroy renderbuffer"),W.bindRenderbuffer(Me,null),W.deleteRenderbuffer($r),kr.renderbuffer=null,kr.refCount=0,delete Or[kr.id],Kt.renderbufferCount--}function Wr(kr,$r){var Pt=new Yr(W.createRenderbuffer());Or[Pt.id]=Pt,Kt.renderbufferCount++;function ur(cn,Tr){var pn=0,Ir=0,fn=F;if(typeof cn=="object"&&cn){var Ar=cn;if("shape"in Ar){var un=Ar.shape;Re(Array.isArray(un)&&un.length>=2,"invalid renderbuffer shape"),pn=un[0]|0,Ir=un[1]|0}else"radius"in Ar&&(pn=Ir=Ar.radius|0),"width"in Ar&&(pn=Ar.width|0),"height"in Ar&&(Ir=Ar.height|0);"format"in Ar&&(Re.parameter(Ar.format,Jt,"invalid renderbuffer format"),fn=Jt[Ar.format])}else typeof cn=="number"?(pn=cn|0,typeof Tr=="number"?Ir=Tr|0:Ir=pn):cn?Re.raise("invalid arguments to renderbuffer constructor"):pn=Ir=1;if(Re(pn>0&&Ir>0&&pn<=Ye.maxRenderbufferSize&&Ir<=Ye.maxRenderbufferSize,"invalid renderbuffer size"),!(pn===Pt.width&&Ir===Pt.height&&fn===Pt.format))return ur.width=Pt.width=pn,ur.height=Pt.height=Ir,Pt.format=fn,W.bindRenderbuffer(Me,Pt.renderbuffer),W.renderbufferStorage(Me,fn,pn,Ir),Re(W.getError()===0,"invalid render buffer format"),vr.profile&&(Pt.stats.size=ss(Pt.format,Pt.width,Pt.height)),ur.format=Ut[Pt.format],ur}function Ur(cn,Tr){var pn=cn|0,Ir=Tr|0||pn;return pn===Pt.width&&Ir===Pt.height||(Re(pn>0&&Ir>0&&pn<=Ye.maxRenderbufferSize&&Ir<=Ye.maxRenderbufferSize,"invalid renderbuffer size"),ur.width=Pt.width=pn,ur.height=Pt.height=Ir,W.bindRenderbuffer(Me,Pt.renderbuffer),W.renderbufferStorage(Me,Pt.format,pn,Ir),Re(W.getError()===0,"invalid render buffer format"),vr.profile&&(Pt.stats.size=ss(Pt.format,Pt.width,Pt.height))),ur}return ur(kr,$r),ur.resize=Ur,ur._reglType="renderbuffer",ur._renderbuffer=Pt,vr.profile&&(ur.stats=Pt.stats),ur.destroy=function(){Pt.decRef()},ur}vr.profile&&(Kt.getTotalRenderbufferSize=function(){var kr=0;return Object.keys(Or).forEach(function($r){kr+=Or[$r].stats.size}),kr});function tn(){Ji(Or).forEach(function(kr){kr.renderbuffer=W.createRenderbuffer(),W.bindRenderbuffer(Me,kr.renderbuffer),W.renderbufferStorage(Me,kr.format,kr.width,kr.height)}),W.bindRenderbuffer(Me,null)}return{create:Wr,clear:function(){Ji(Or).forEach(Nr)},restore:tn}},Ba=36160,tu=36161,bu=3553,Eu=34069,oa=36064,yo=36096,Sh=36128,Ol=33306,zf=36053,cl=36054,xs=36055,ec=36057,Su=36061,Zf=36193,Rc=5121,sf=5126,Vf=6407,tc=6408,rc=6402,Ah=[Vf,tc],us=[];us[tc]=4,us[Vf]=3;var Au=[];Au[Rc]=1,Au[sf]=4,Au[Zf]=2;var uf=32854,kl=32855,uu=36194,Th=33189,ju=36168,jf=34041,wh=35907,h=34836,v=34842,p=34843,g=[uf,kl,uu,wh,v,p,h],S={};S[zf]="complete",S[cl]="incomplete attachment",S[ec]="incomplete dimensions",S[xs]="incomplete, missing attachment",S[Su]="unsupported";function w(W,Ce,Ye,Kt,vr,Jt){var Ut={cur:null,next:null,dirty:!1,setFBO:null},Br=["rgba"],Or=["rgba4","rgb565","rgb5 a1"];Ce.ext_srgb&&Or.push("srgba"),Ce.ext_color_buffer_half_float&&Or.push("rgba16f","rgb16f"),Ce.webgl_color_buffer_float&&Or.push("rgba32f");var Yr=["uint8"];Ce.oes_texture_half_float&&Yr.push("half float","float16"),Ce.oes_texture_float&&Yr.push("float","float32");function Nr(an,Lr,xr){this.target=an,this.texture=Lr,this.renderbuffer=xr;var er=0,Ti=0;Lr?(er=Lr.width,Ti=Lr.height):xr&&(er=xr.width,Ti=xr.height),this.width=er,this.height=Ti}function Wr(an){an&&(an.texture&&an.texture._texture.decRef(),an.renderbuffer&&an.renderbuffer._renderbuffer.decRef())}function tn(an,Lr,xr){if(an)if(an.texture){var er=an.texture._texture,Ti=Math.max(1,er.width),Ke=Math.max(1,er.height);Re(Ti===Lr&&Ke===xr,"inconsistent width/height for supplied texture"),er.refCount+=1}else{var _i=an.renderbuffer._renderbuffer;Re(_i.width===Lr&&_i.height===xr,"inconsistent width/height for renderbuffer"),_i.refCount+=1}}function kr(an,Lr){Lr&&(Lr.texture?W.framebufferTexture2D(Ba,an,Lr.target,Lr.texture._texture.texture,0):W.framebufferRenderbuffer(Ba,an,tu,Lr.renderbuffer._renderbuffer.renderbuffer))}function $r(an){var Lr=bu,xr=null,er=null,Ti=an;typeof an=="object"&&(Ti=an.data,"target"in an&&(Lr=an.target|0)),Re.type(Ti,"function","invalid attachment data");var Ke=Ti._reglType;return Ke==="texture2d"?(xr=Ti,Re(Lr===bu)):Ke==="textureCube"?(xr=Ti,Re(Lr>=Eu&&Lr<Eu+6,"invalid cube map target")):Ke==="renderbuffer"?(er=Ti,Lr=tu):Re.raise("invalid regl object for attachment"),new Nr(Lr,xr,er)}function Pt(an,Lr,xr,er,Ti){if(xr){var Ke=Kt.create2D({width:an,height:Lr,format:er,type:Ti});return Ke._texture.refCount=0,new Nr(bu,Ke,null)}else{var _i=vr.create({width:an,height:Lr,format:er});return _i._renderbuffer.refCount=0,new Nr(tu,null,_i)}}function ur(an){return an&&(an.texture||an.renderbuffer)}function Ur(an,Lr,xr){an&&(an.texture?an.texture.resize(Lr,xr):an.renderbuffer&&an.renderbuffer.resize(Lr,xr),an.width=Lr,an.height=xr)}var cn=0,Tr={};function pn(){this.id=cn++,Tr[this.id]=this,this.framebuffer=W.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Ir(an){an.colorAttachments.forEach(Wr),Wr(an.depthAttachment),Wr(an.stencilAttachment),Wr(an.depthStencilAttachment)}function fn(an){var Lr=an.framebuffer;Re(Lr,"must not double destroy framebuffer"),W.deleteFramebuffer(Lr),an.framebuffer=null,Jt.framebufferCount--,delete Tr[an.id]}function Ar(an){var Lr;W.bindFramebuffer(Ba,an.framebuffer);var xr=an.colorAttachments;for(Lr=0;Lr<xr.length;++Lr)kr(oa+Lr,xr[Lr]);for(Lr=xr.length;Lr<Ye.maxColorAttachments;++Lr)W.framebufferTexture2D(Ba,oa+Lr,bu,null,0);W.framebufferTexture2D(Ba,Ol,bu,null,0),W.framebufferTexture2D(Ba,yo,bu,null,0),W.framebufferTexture2D(Ba,Sh,bu,null,0),kr(yo,an.depthAttachment),kr(Sh,an.stencilAttachment),kr(Ol,an.depthStencilAttachment);var er=W.checkFramebufferStatus(Ba);!W.isContextLost()&&er!==zf&&Re.raise("framebuffer configuration not supported, status = "+S[er]),W.bindFramebuffer(Ba,Ut.next?Ut.next.framebuffer:null),Ut.cur=Ut.next,W.getError()}function un(an,Lr){var xr=new pn;Jt.framebufferCount++;function er(Ke,_i){var si;Re(Ut.next!==xr,"can not update framebuffer which is currently in use");var qn=0,qi=0,vo=!0,mo=!0,Ii=null,xo=!0,Aa="rgba",bo="uint8",Eo=1,Ga=null,Fo=null,Ts=null,So=!1;if(typeof Ke=="number")qn=Ke|0,qi=_i|0||qn;else if(!Ke)qn=qi=1;else{Re.type(Ke,"object","invalid arguments for framebuffer");var gi=Ke;if("shape"in gi){var cs=gi.shape;Re(Array.isArray(cs)&&cs.length>=2,"invalid shape for framebuffer"),qn=cs[0],qi=cs[1]}else"radius"in gi&&(qn=qi=gi.radius),"width"in gi&&(qn=gi.width),"height"in gi&&(qi=gi.height);("color"in gi||"colors"in gi)&&(Ii=gi.color||gi.colors,Array.isArray(Ii)&&Re(Ii.length===1||Ce.webgl_draw_buffers,"multiple render targets not supported")),Ii||("colorCount"in gi&&(Eo=gi.colorCount|0,Re(Eo>0,"invalid color buffer count")),"colorTexture"in gi&&(xo=!!gi.colorTexture,Aa="rgba4"),"colorType"in gi&&(bo=gi.colorType,xo?(Re(Ce.oes_texture_float||!(bo==="float"||bo==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),Re(Ce.oes_texture_half_float||!(bo==="half float"||bo==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):bo==="half float"||bo==="float16"?(Re(Ce.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),Aa="rgba16f"):(bo==="float"||bo==="float32")&&(Re(Ce.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),Aa="rgba32f"),Re.oneOf(bo,Yr,"invalid color type")),"colorFormat"in gi&&(Aa=gi.colorFormat,Br.indexOf(Aa)>=0?xo=!0:Or.indexOf(Aa)>=0?xo=!1:xo?Re.oneOf(gi.colorFormat,Br,"invalid color format for texture"):Re.oneOf(gi.colorFormat,Or,"invalid color format for renderbuffer"))),("depthTexture"in gi||"depthStencilTexture"in gi)&&(So=!!(gi.depthTexture||gi.depthStencilTexture),Re(!So||Ce.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in gi&&(typeof gi.depth=="boolean"?vo=gi.depth:(Ga=gi.depth,mo=!1)),"stencil"in gi&&(typeof gi.stencil=="boolean"?mo=gi.stencil:(Fo=gi.stencil,vo=!1)),"depthStencil"in gi&&(typeof gi.depthStencil=="boolean"?vo=mo=gi.depthStencil:(Ts=gi.depthStencil,vo=!1,mo=!1))}var ia=null,Xn=null,Ri=null,Xi=null;if(Array.isArray(Ii))ia=Ii.map($r);else if(Ii)ia=[$r(Ii)];else for(ia=new Array(Eo),si=0;si<Eo;++si)ia[si]=Pt(qn,qi,xo,Aa,bo);Re(Ce.webgl_draw_buffers||ia.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),Re(ia.length<=Ye.maxColorAttachments,"too many color attachments, not supported"),qn=qn||ia[0].width,qi=qi||ia[0].height,Ga?Xn=$r(Ga):vo&&!mo&&(Xn=Pt(qn,qi,So,"depth","uint32")),Fo?Ri=$r(Fo):mo&&!vo&&(Ri=Pt(qn,qi,!1,"stencil","uint8")),Ts?Xi=$r(Ts):!Ga&&!Fo&&mo&&vo&&(Xi=Pt(qn,qi,So,"depth stencil","depth stencil")),Re(!!Ga+!!Fo+!!Ts<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var Ao=null;for(si=0;si<ia.length;++si)if(tn(ia[si],qn,qi),Re(!ia[si]||ia[si].texture&&Ah.indexOf(ia[si].texture._texture.format)>=0||ia[si].renderbuffer&&g.indexOf(ia[si].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+si+" is invalid"),ia[si]&&ia[si].texture){var gl=us[ia[si].texture._texture.format]*Au[ia[si].texture._texture.type];Ao===null?Ao=gl:Re(Ao===gl,"all color attachments much have the same number of bits per pixel.")}return tn(Xn,qn,qi),Re(!Xn||Xn.texture&&Xn.texture._texture.format===rc||Xn.renderbuffer&&Xn.renderbuffer._renderbuffer.format===Th,"invalid depth attachment for framebuffer object"),tn(Ri,qn,qi),Re(!Ri||Ri.renderbuffer&&Ri.renderbuffer._renderbuffer.format===ju,"invalid stencil attachment for framebuffer object"),tn(Xi,qn,qi),Re(!Xi||Xi.texture&&Xi.texture._texture.format===jf||Xi.renderbuffer&&Xi.renderbuffer._renderbuffer.format===jf,"invalid depth-stencil attachment for framebuffer object"),Ir(xr),xr.width=qn,xr.height=qi,xr.colorAttachments=ia,xr.depthAttachment=Xn,xr.stencilAttachment=Ri,xr.depthStencilAttachment=Xi,er.color=ia.map(ur),er.depth=ur(Xn),er.stencil=ur(Ri),er.depthStencil=ur(Xi),er.width=xr.width,er.height=xr.height,Ar(xr),er}function Ti(Ke,_i){Re(Ut.next!==xr,"can not resize a framebuffer which is currently in use");var si=Math.max(Ke|0,1),qn=Math.max(_i|0||si,1);if(si===xr.width&&qn===xr.height)return er;for(var qi=xr.colorAttachments,vo=0;vo<qi.length;++vo)Ur(qi[vo],si,qn);return Ur(xr.depthAttachment,si,qn),Ur(xr.stencilAttachment,si,qn),Ur(xr.depthStencilAttachment,si,qn),xr.width=er.width=si,xr.height=er.height=qn,Ar(xr),er}return er(an,Lr),U(er,{resize:Ti,_reglType:"framebuffer",_framebuffer:xr,destroy:function(){fn(xr),Ir(xr)},use:function(Ke){Ut.setFBO({framebuffer:er},Ke)}})}function jn(an){var Lr=Array(6);function xr(Ti){var Ke;Re(Lr.indexOf(Ut.next)<0,"can not update framebuffer which is currently in use");var _i={color:null},si=0,qn=null,qi="rgba",vo="uint8",mo=1;if(typeof Ti=="number")si=Ti|0;else if(!Ti)si=1;else{Re.type(Ti,"object","invalid arguments for framebuffer");var Ii=Ti;if("shape"in Ii){var xo=Ii.shape;Re(Array.isArray(xo)&&xo.length>=2,"invalid shape for framebuffer"),Re(xo[0]===xo[1],"cube framebuffer must be square"),si=xo[0]}else"radius"in Ii&&(si=Ii.radius|0),"width"in Ii?(si=Ii.width|0,"height"in Ii&&Re(Ii.height===si,"must be square")):"height"in Ii&&(si=Ii.height|0);("color"in Ii||"colors"in Ii)&&(qn=Ii.color||Ii.colors,Array.isArray(qn)&&Re(qn.length===1||Ce.webgl_draw_buffers,"multiple render targets not supported")),qn||("colorCount"in Ii&&(mo=Ii.colorCount|0,Re(mo>0,"invalid color buffer count")),"colorType"in Ii&&(Re.oneOf(Ii.colorType,Yr,"invalid color type"),vo=Ii.colorType),"colorFormat"in Ii&&(qi=Ii.colorFormat,Re.oneOf(Ii.colorFormat,Br,"invalid color format for texture"))),"depth"in Ii&&(_i.depth=Ii.depth),"stencil"in Ii&&(_i.stencil=Ii.stencil),"depthStencil"in Ii&&(_i.depthStencil=Ii.depthStencil)}var Aa;if(qn)if(Array.isArray(qn))for(Aa=[],Ke=0;Ke<qn.length;++Ke)Aa[Ke]=qn[Ke];else Aa=[qn];else{Aa=Array(mo);var bo={radius:si,format:qi,type:vo};for(Ke=0;Ke<mo;++Ke)Aa[Ke]=Kt.createCube(bo)}for(_i.color=Array(Aa.length),Ke=0;Ke<Aa.length;++Ke){var Eo=Aa[Ke];Re(typeof Eo=="function"&&Eo._reglType==="textureCube","invalid cube map"),si=si||Eo.width,Re(Eo.width===si&&Eo.height===si,"invalid cube map shape"),_i.color[Ke]={target:Eu,data:Aa[Ke]}}for(Ke=0;Ke<6;++Ke){for(var Ga=0;Ga<Aa.length;++Ga)_i.color[Ga].target=Eu+Ke;Ke>0&&(_i.depth=Lr[0].depth,_i.stencil=Lr[0].stencil,_i.depthStencil=Lr[0].depthStencil),Lr[Ke]?Lr[Ke](_i):Lr[Ke]=un(_i)}return U(xr,{width:si,height:si,color:Aa})}function er(Ti){var Ke,_i=Ti|0;if(Re(_i>0&&_i<=Ye.maxCubeMapSize,"invalid radius for cube fbo"),_i===xr.width)return xr;var si=xr.color;for(Ke=0;Ke<si.length;++Ke)si[Ke].resize(_i);for(Ke=0;Ke<6;++Ke)Lr[Ke].resize(_i);return xr.width=xr.height=_i,xr}return xr(an),U(xr,{faces:Lr,resize:er,_reglType:"framebufferCube",destroy:function(){Lr.forEach(function(Ti){Ti.destroy()})}})}function ai(){Ut.cur=null,Ut.next=null,Ut.dirty=!0,Ji(Tr).forEach(function(an){an.framebuffer=W.createFramebuffer(),Ar(an)})}return U(Ut,{getFramebuffer:function(an){if(typeof an=="function"&&an._reglType==="framebuffer"){var Lr=an._framebuffer;if(Lr instanceof pn)return Lr}return null},create:un,createCube:jn,clear:function(){Ji(Tr).forEach(fn)},restore:ai})}var C=5126,O=34962;function X(){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 J(W,Ce,Ye,Kt,vr){for(var Jt=Ye.maxAttributes,Ut=new Array(Jt),Br=0;Br<Jt;++Br)Ut[Br]=new X;var Or=0,Yr={},Nr={Record:X,scope:{},state:Ut,currentVAO:null,targetVAO:null,restore:tn()?Tr:function(){},createVAO:pn,getVAO:$r,destroyBuffer:Wr,setVAO:tn()?Pt:ur,clear:tn()?Ur:function(){}};function Wr(Ir){for(var fn=0;fn<Ut.length;++fn){var Ar=Ut[fn];Ar.buffer===Ir&&(W.disableVertexAttribArray(fn),Ar.buffer=null)}}function tn(){return Ce.oes_vertex_array_object}function kr(){return Ce.angle_instanced_arrays}function $r(Ir){return typeof Ir=="function"&&Ir._vao?Ir._vao:null}function Pt(Ir){if(Ir!==Nr.currentVAO){var fn=tn();Ir?fn.bindVertexArrayOES(Ir.vao):fn.bindVertexArrayOES(null),Nr.currentVAO=Ir}}function ur(Ir){if(Ir!==Nr.currentVAO){if(Ir)Ir.bindAttrs();else for(var fn=kr(),Ar=0;Ar<Ut.length;++Ar){var un=Ut[Ar];un.buffer?(W.enableVertexAttribArray(Ar),W.vertexAttribPointer(Ar,un.size,un.type,un.normalized,un.stride,un.offfset),fn&&fn.vertexAttribDivisorANGLE(Ar,un.divisor)):(W.disableVertexAttribArray(Ar),W.vertexAttrib4f(Ar,un.x,un.y,un.z,un.w))}Nr.currentVAO=Ir}}function Ur(){Ji(Yr).forEach(function(Ir){Ir.destroy()})}function cn(){this.id=++Or,this.attributes=[];var Ir=tn();Ir?this.vao=Ir.createVertexArrayOES():this.vao=null,Yr[this.id]=this,this.buffers=[]}cn.prototype.bindAttrs=function(){for(var Ir=kr(),fn=this.attributes,Ar=0;Ar<fn.length;++Ar){var un=fn[Ar];un.buffer?(W.enableVertexAttribArray(Ar),W.bindBuffer(O,un.buffer.buffer),W.vertexAttribPointer(Ar,un.size,un.type,un.normalized,un.stride,un.offset),Ir&&Ir.vertexAttribDivisorANGLE(Ar,un.divisor)):(W.disableVertexAttribArray(Ar),W.vertexAttrib4f(Ar,un.x,un.y,un.z,un.w))}for(var jn=fn.length;jn<Jt;++jn)W.disableVertexAttribArray(jn)},cn.prototype.refresh=function(){var Ir=tn();Ir&&(Ir.bindVertexArrayOES(this.vao),this.bindAttrs(),Nr.currentVAO=this)},cn.prototype.destroy=function(){if(this.vao){var Ir=tn();this===Nr.currentVAO&&(Nr.currentVAO=null,Ir.bindVertexArrayOES(null)),Ir.deleteVertexArrayOES(this.vao),this.vao=null}Yr[this.id]&&(delete Yr[this.id],Kt.vaoCount-=1)};function Tr(){var Ir=tn();Ir&&Ji(Yr).forEach(function(fn){fn.refresh()})}function pn(Ir){var fn=new cn;Kt.vaoCount+=1;function Ar(un){Re(Array.isArray(un),"arguments to vertex array constructor must be an array"),Re(un.length<Jt,"too many attributes"),Re(un.length>0,"must specify at least one attribute");for(var jn=0;jn<fn.buffers.length;++jn)fn.buffers[jn].destroy();fn.buffers.length=0;var ai=fn.attributes;ai.length=un.length;for(var an=0;an<un.length;++an){var Lr=un[an],xr=ai[an]=new X;if(Array.isArray(Lr)||ne(Lr)||Sa(Lr)){var er=vr.create(Lr,O,!1,!0);xr.buffer=vr.getBuffer(er),xr.size=xr.buffer.dimension|0,xr.normalized=!1,xr.type=xr.buffer.dtype,xr.offset=0,xr.stride=0,xr.divisor=0,xr.state=1,fn.buffers.push(er)}else vr.getBuffer(Lr)?(xr.buffer=vr.getBuffer(Lr),xr.size=xr.buffer.dimension|0,xr.normalized=!1,xr.type=xr.buffer.dtype,xr.offset=0,xr.stride=0,xr.divisor=0,xr.state=1):vr.getBuffer(Lr.buffer)?(xr.buffer=vr.getBuffer(Lr.buffer),xr.size=(+Lr.size||xr.buffer.dimension)|0,xr.normalized=!!Lr.normalized||!1,"type"in Lr?(Re.parameter(Lr.type,Ko,"invalid buffer type"),xr.type=Ko[Lr.type]):xr.type=xr.buffer.dtype,xr.offset=(Lr.offset||0)|0,xr.stride=(Lr.stride||0)|0,xr.divisor=(Lr.divisor||0)|0,xr.state=1,Re(xr.size>=1&&xr.size<=4,"size must be between 1 and 4"),Re(xr.offset>=0,"invalid offset"),Re(xr.stride>=0&&xr.stride<=255,"stride must be between 0 and 255"),Re(xr.divisor>=0,"divisor must be positive"),Re(!xr.divisor||!!Ce.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Lr?(Re(an>0,"first attribute must not be a constant"),xr.x=+Lr.x||0,xr.y=+Lr.y||0,xr.z=+Lr.z||0,xr.w=+Lr.w||0,xr.state=2):Re(!1,"invalid attribute spec for location "+an)}return fn.refresh(),Ar}return Ar.destroy=function(){fn.destroy()},Ar._vao=fn,Ar._reglType="vao",Ar(Ir)}return Nr}var me=35632,be=35633,Te=35718,je=35721;function Ze(W,Ce,Ye,Kt){var vr={},Jt={};function Ut(Pt,ur,Ur,cn){this.name=Pt,this.id=ur,this.location=Ur,this.info=cn}function Br(Pt,ur){for(var Ur=0;Ur<Pt.length;++Ur)if(Pt[Ur].id===ur.id){Pt[Ur].location=ur.location;return}Pt.push(ur)}function Or(Pt,ur,Ur){var cn=Pt===me?vr:Jt,Tr=cn[ur];if(!Tr){var pn=Ce.str(ur);Tr=W.createShader(Pt),W.shaderSource(Tr,pn),W.compileShader(Tr),Re.shaderError(W,Tr,pn,Pt,Ur),cn[ur]=Tr}return Tr}var Yr={},Nr=[],Wr=0;function tn(Pt,ur){this.id=Wr++,this.fragId=Pt,this.vertId=ur,this.program=null,this.uniforms=[],this.attributes=[],Kt.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function kr(Pt,ur,Ur){var cn,Tr,pn=Or(me,Pt.fragId),Ir=Or(be,Pt.vertId),fn=Pt.program=W.createProgram();if(W.attachShader(fn,pn),W.attachShader(fn,Ir),Ur)for(cn=0;cn<Ur.length;++cn){var Ar=Ur[cn];W.bindAttribLocation(fn,Ar[0],Ar[1])}W.linkProgram(fn),Re.linkError(W,fn,Ce.str(Pt.fragId),Ce.str(Pt.vertId),ur);var un=W.getProgramParameter(fn,Te);Kt.profile&&(Pt.stats.uniformsCount=un);var jn=Pt.uniforms;for(cn=0;cn<un;++cn)if(Tr=W.getActiveUniform(fn,cn),Tr)if(Tr.size>1)for(var ai=0;ai<Tr.size;++ai){var an=Tr.name.replace("[0]","["+ai+"]");Br(jn,new Ut(an,Ce.id(an),W.getUniformLocation(fn,an),Tr))}else Br(jn,new Ut(Tr.name,Ce.id(Tr.name),W.getUniformLocation(fn,Tr.name),Tr));var Lr=W.getProgramParameter(fn,je);Kt.profile&&(Pt.stats.attributesCount=Lr);var xr=Pt.attributes;for(cn=0;cn<Lr;++cn)Tr=W.getActiveAttrib(fn,cn),Tr&&Br(xr,new Ut(Tr.name,Ce.id(Tr.name),W.getAttribLocation(fn,Tr.name),Tr))}Kt.profile&&(Ye.getMaxUniformsCount=function(){var Pt=0;return Nr.forEach(function(ur){ur.stats.uniformsCount>Pt&&(Pt=ur.stats.uniformsCount)}),Pt},Ye.getMaxAttributesCount=function(){var Pt=0;return Nr.forEach(function(ur){ur.stats.attributesCount>Pt&&(Pt=ur.stats.attributesCount)}),Pt});function $r(){vr={},Jt={};for(var Pt=0;Pt<Nr.length;++Pt)kr(Nr[Pt],null,Nr[Pt].attributes.map(function(ur){return[ur.location,ur.name]}))}return{clear:function(){var Pt=W.deleteShader.bind(W);Ji(vr).forEach(Pt),vr={},Ji(Jt).forEach(Pt),Jt={},Nr.forEach(function(ur){W.deleteProgram(ur.program)}),Nr.length=0,Yr={},Ye.shaderCount=0},program:function(Pt,ur,Ur,cn){Re.command(Pt>=0,"missing vertex shader",Ur),Re.command(ur>=0,"missing fragment shader",Ur);var Tr=Yr[ur];Tr||(Tr=Yr[ur]={});var pn=Tr[Pt];if(pn&&!cn)return pn;var Ir=new tn(ur,Pt);return Ye.shaderCount++,kr(Ir,Ur,cn),pn||(Tr[Pt]=Ir),Nr.push(Ir),Ir},restore:$r,shader:Or,frag:-1,vert:-1}}var lt=6408,Ne=5121,ot=3333,_t=5126;function Lt(W,Ce,Ye,Kt,vr,Jt,Ut){function Br(Nr){var Wr;Ce.next===null?(Re(vr.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),Wr=Ne):(Re(Ce.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),Wr=Ce.next.colorAttachments[0].texture._texture.type,Jt.oes_texture_float?(Re(Wr===Ne||Wr===_t,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),Wr===_t&&Re(Ut.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):Re(Wr===Ne,"Reading from a framebuffer is only allowed for the type 'uint8'"));var tn=0,kr=0,$r=Kt.framebufferWidth,Pt=Kt.framebufferHeight,ur=null;ne(Nr)?ur=Nr:Nr&&(Re.type(Nr,"object","invalid arguments to regl.read()"),tn=Nr.x|0,kr=Nr.y|0,Re(tn>=0&&tn<Kt.framebufferWidth,"invalid x offset for regl.read"),Re(kr>=0&&kr<Kt.framebufferHeight,"invalid y offset for regl.read"),$r=(Nr.width||Kt.framebufferWidth-tn)|0,Pt=(Nr.height||Kt.framebufferHeight-kr)|0,ur=Nr.data||null),ur&&(Wr===Ne?Re(ur instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):Wr===_t&&Re(ur instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),Re($r>0&&$r+tn<=Kt.framebufferWidth,"invalid width for read pixels"),Re(Pt>0&&Pt+kr<=Kt.framebufferHeight,"invalid height for read pixels"),Ye();var Ur=$r*Pt*4;return ur||(Wr===Ne?ur=new Uint8Array(Ur):Wr===_t&&(ur=ur||new Float32Array(Ur))),Re.isTypedArray(ur,"data buffer for regl.read() must be a typedarray"),Re(ur.byteLength>=Ur,"data buffer for regl.read() too small"),W.pixelStorei(ot,4),W.readPixels(tn,kr,$r,Pt,lt,Wr,ur),ur}function Or(Nr){var Wr;return Ce.setFBO({framebuffer:Nr.framebuffer},function(){Wr=Br(Nr)}),Wr}function Yr(Nr){return!Nr||!("framebuffer"in Nr)?Br(Nr):Or(Nr)}return Yr}function ir(W){return Array.prototype.slice.call(W)}function qt(W){return ir(W).join("")}function cr(){var W=0,Ce=[],Ye=[];function Kt(Wr){for(var tn=0;tn<Ye.length;++tn)if(Ye[tn]===Wr)return Ce[tn];var kr="g"+W++;return Ce.push(kr),Ye.push(Wr),kr}function vr(){var Wr=[];function tn(){Wr.push.apply(Wr,ir(arguments))}var kr=[];function $r(){var Pt="v"+W++;return kr.push(Pt),arguments.length>0&&(Wr.push(Pt,"="),Wr.push.apply(Wr,ir(arguments)),Wr.push(";")),Pt}return U(tn,{def:$r,toString:function(){return qt([kr.length>0?"var "+kr.join(",")+";":"",qt(Wr)])}})}function Jt(){var Wr=vr(),tn=vr(),kr=Wr.toString,$r=tn.toString;function Pt(ur,Ur){tn(ur,Ur,"=",Wr.def(ur,Ur),";")}return U(function(){Wr.apply(Wr,ir(arguments))},{def:Wr.def,entry:Wr,exit:tn,save:Pt,set:function(ur,Ur,cn){Pt(ur,Ur),Wr(ur,Ur,"=",cn,";")},toString:function(){return kr()+$r()}})}function Ut(){var Wr=qt(arguments),tn=Jt(),kr=Jt(),$r=tn.toString,Pt=kr.toString;return U(tn,{then:function(){return tn.apply(tn,ir(arguments)),this},else:function(){return kr.apply(kr,ir(arguments)),this},toString:function(){var ur=Pt();return ur&&(ur="else{"+ur+"}"),qt(["if(",Wr,"){",$r(),"}",ur])}})}var Br=vr(),Or={};function Yr(Wr,tn){var kr=[];function $r(){var Tr="a"+kr.length;return kr.push(Tr),Tr}tn=tn||0;for(var Pt=0;Pt<tn;++Pt)$r();var ur=Jt(),Ur=ur.toString,cn=Or[Wr]=U(ur,{arg:$r,toString:function(){return qt(["function(",kr.join(),"){",Ur(),"}"])}});return cn}function Nr(){var Wr=['"use strict";',Br,"return {"];Object.keys(Or).forEach(function($r){Wr.push('"',$r,'":',Or[$r].toString(),",")}),Wr.push("}");var tn=qt(Wr).replace(/;/g,`;
|
|
`).replace(/}/g,`}
|
|
`).replace(/{/g,`{
|
|
`),kr=Function.apply(null,Ce.concat(tn));return kr.apply(null,Ye)}return{global:Br,link:Kt,block:vr,proc:Yr,scope:Jt,cond:Ut,compile:Nr}}var br="xyzw".split(""),Hr=5121,Fr=1,hn=2,Un=0,Fn=1,zn=2,zi=3,gn=4,ii="dither",pi="blend.enable",ri="blend.color",Kn="blend.equation",fi="blend.func",Qn="depth.enable",Gn="depth.func",Io="depth.range",Qa="depth.mask",Po="colorMask",_o="cull.enable",Wa="cull.face",Ja="frontFace",bs="lineWidth",Es="polygonOffset.enable",fl="polygonOffset.offset",Ss="sample.alpha",lu="sample.enable",Vs="sample.coverage",Mc="stencil.enable",Hu="stencil.mask",Tu="stencil.func",nc="stencil.opFront",hl="stencil.opBack",cu="scissor.enable",pl="scissor.box",Oo="viewport",ao="profile",Ps="framebuffer",fu="vert",wu="frag",Fi="elements",Jo="primitive",oo="count",hu="offset",Ic="instances",Wu="vao",Ch="Width",ko="Height",Dr=Ps+Ch,js=Ps+ko,Rh=Oo+Ch,Do=Oo+ko,ru="drawingBuffer",Lo=ru+Ch,pp=ru+ko,ic=[fi,Kn,Tu,nc,hl,Vs,Oo,pl,fl],dl=34962,Zp=34963,ag=35632,zv=35633,Hf=3553,dp=34067,Mh=2884,Dd=3042,Pc=3024,Ih=2960,Zv=2929,Ld=3089,og=32823,Vp=32926,Bd=32928,Fd=5126,jp=35664,Dl=35665,vp=35666,Oc=5124,Hp=35667,eo=35668,Wf=35669,Gf=35670,vl=35671,lf=35672,kc=35673,Xf=35674,$f=35675,Dc=35676,Lc=35678,ac=35680,Wp=4,oc=1028,Hs=1029,mp=2304,Gp=2305,Xp=32775,Ph=32776,ml=519,Gu=7680,Nd=0,gp=1,Ud=32774,Oh=513,Bc=36160,$p=36064,Xu={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},yp=["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"],Fc={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},Ws={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},zd={frag:ag,vert:zv},sc={cw:mp,ccw:Gp};function kh(W){return Array.isArray(W)||ne(W)||Sa(W)}function Yf(W){return W.sort(function(Ce,Ye){return Ce===Oo?-1:Ye===Oo?1:Ce<Ye?-1:1})}function ls(W,Ce,Ye,Kt){this.thisDep=W,this.contextDep=Ce,this.propDep=Ye,this.append=Kt}function As(W){return W&&!(W.thisDep||W.contextDep||W.propDep)}function Bo(W){return new ls(!1,!1,!1,W)}function pu(W,Ce){var Ye=W.type;if(Ye===Un){var Kt=W.data.length;return new ls(!0,Kt>=1,Kt>=2,Ce)}else if(Ye===gn){var vr=W.data;return new ls(vr.thisDep,vr.contextDep,vr.propDep,Ce)}else return new ls(Ye===zi,Ye===zn,Ye===Fn,Ce)}var Yp=new ls(!1,!1,!1,function(){});function cf(W,Ce,Ye,Kt,vr,Jt,Ut,Br,Or,Yr,Nr,Wr,tn,kr,$r){var Pt=Yr.Record,ur={add:32774,subtract:32778,"reverse subtract":32779};Ye.ext_blend_minmax&&(ur.min=Xp,ur.max=Ph);var Ur=Ye.angle_instanced_arrays,cn=Ye.webgl_draw_buffers,Tr={dirty:!0,profile:$r.profile},pn={},Ir=[],fn={},Ar={};function un(de){return de.replace(".","_")}function jn(de,Oe,$e){var Gt=un(de);Ir.push(de),pn[Gt]=Tr[Gt]=!!$e,fn[Gt]=Oe}function ai(de,Oe,$e){var Gt=un(de);Ir.push(de),Array.isArray($e)?(Tr[Gt]=$e.slice(),pn[Gt]=$e.slice()):Tr[Gt]=pn[Gt]=$e,Ar[Gt]=Oe}jn(ii,Pc),jn(pi,Dd),ai(ri,"blendColor",[0,0,0,0]),ai(Kn,"blendEquationSeparate",[Ud,Ud]),ai(fi,"blendFuncSeparate",[gp,Nd,gp,Nd]),jn(Qn,Zv,!0),ai(Gn,"depthFunc",Oh),ai(Io,"depthRange",[0,1]),ai(Qa,"depthMask",!0),ai(Po,Po,[!0,!0,!0,!0]),jn(_o,Mh),ai(Wa,"cullFace",Hs),ai(Ja,Ja,Gp),ai(bs,bs,1),jn(Es,og),ai(fl,"polygonOffset",[0,0]),jn(Ss,Vp),jn(lu,Bd),ai(Vs,"sampleCoverage",[1,!1]),jn(Mc,Ih),ai(Hu,"stencilMask",-1),ai(Tu,"stencilFunc",[ml,0,-1]),ai(nc,"stencilOpSeparate",[oc,Gu,Gu,Gu]),ai(hl,"stencilOpSeparate",[Hs,Gu,Gu,Gu]),jn(cu,Ld),ai(pl,"scissor",[0,0,W.drawingBufferWidth,W.drawingBufferHeight]),ai(Oo,Oo,[0,0,W.drawingBufferWidth,W.drawingBufferHeight]);var an={gl:W,context:tn,strings:Ce,next:pn,current:Tr,draw:Wr,elements:Jt,buffer:vr,shader:Nr,attributes:Yr.state,vao:Yr,uniforms:Or,framebuffer:Br,extensions:Ye,timer:kr,isBufferArgs:kh},Lr={primTypes:Fu,compareFuncs:Fc,blendFuncs:Xu,blendEquations:ur,stencilOps:Ws,glTypes:Ko,orientationType:sc};Re.optional(function(){an.isArrayLike=Va}),cn&&(Lr.backBuffer=[Hs],Lr.drawBuffer=dt(Kt.maxDrawbuffers,function(de){return de===0?[0]:dt(de,function(Oe){return $p+Oe})}));var xr=0;function er(){var de=cr(),Oe=de.link,$e=de.global;de.id=xr++,de.batchId="0";var Gt=Oe(an),Nt=de.shared={props:"a0"};Object.keys(an).forEach(function(pt){Nt[pt]=$e.def(Gt,".",pt)}),Re.optional(function(){de.CHECK=Oe(Re),de.commandStr=Re.guessCommand(),de.command=Oe(de.commandStr),de.assert=function(pt,Ie,mt){pt("if(!(",Ie,"))",this.CHECK,".commandRaise(",Oe(mt),",",this.command,");")},Lr.invalidBlendCombinations=yp});var ct=de.next={},yt=de.current={};Object.keys(Ar).forEach(function(pt){Array.isArray(Tr[pt])&&(ct[pt]=$e.def(Nt.next,".",pt),yt[pt]=$e.def(Nt.current,".",pt))});var xt=de.constants={};Object.keys(Lr).forEach(function(pt){xt[pt]=$e.def(JSON.stringify(Lr[pt]))}),de.invoke=function(pt,Ie){switch(Ie.type){case Un:var mt=["this",Nt.context,Nt.props,de.batchId];return pt.def(Oe(Ie.data),".call(",mt.slice(0,Math.max(Ie.data.length+1,4)),")");case Fn:return pt.def(Nt.props,Ie.data);case zn:return pt.def(Nt.context,Ie.data);case zi:return pt.def("this",Ie.data);case gn:return Ie.data.append(de,pt),Ie.data.ref}},de.attribCache={};var We={};return de.scopeAttrib=function(pt){var Ie=Ce.id(pt);if(Ie in We)return We[Ie];var mt=Yr.scope[Ie];mt||(mt=Yr.scope[Ie]=new Pt);var Ct=We[Ie]=Oe(mt);return Ct},de}function Ti(de){var Oe=de.static,$e=de.dynamic,Gt;if(ao in Oe){var Nt=!!Oe[ao];Gt=Bo(function(yt,xt){return Nt}),Gt.enable=Nt}else if(ao in $e){var ct=$e[ao];Gt=pu(ct,function(yt,xt){return yt.invoke(xt,ct)})}return Gt}function Ke(de,Oe){var $e=de.static,Gt=de.dynamic;if(Ps in $e){var Nt=$e[Ps];return Nt?(Nt=Br.getFramebuffer(Nt),Re.command(Nt,"invalid framebuffer object"),Bo(function(yt,xt){var We=yt.link(Nt),pt=yt.shared;xt.set(pt.framebuffer,".next",We);var Ie=pt.context;return xt.set(Ie,"."+Dr,We+".width"),xt.set(Ie,"."+js,We+".height"),We})):Bo(function(yt,xt){var We=yt.shared;xt.set(We.framebuffer,".next","null");var pt=We.context;return xt.set(pt,"."+Dr,pt+"."+Lo),xt.set(pt,"."+js,pt+"."+pp),"null"})}else if(Ps in Gt){var ct=Gt[Ps];return pu(ct,function(yt,xt){var We=yt.invoke(xt,ct),pt=yt.shared,Ie=pt.framebuffer,mt=xt.def(Ie,".getFramebuffer(",We,")");Re.optional(function(){yt.assert(xt,"!"+We+"||"+mt,"invalid framebuffer object")}),xt.set(Ie,".next",mt);var Ct=pt.context;return xt.set(Ct,"."+Dr,mt+"?"+mt+".width:"+Ct+"."+Lo),xt.set(Ct,"."+js,mt+"?"+mt+".height:"+Ct+"."+pp),mt})}else return null}function _i(de,Oe,$e){var Gt=de.static,Nt=de.dynamic;function ct(We){if(We in Gt){var pt=Gt[We];Re.commandType(pt,"object","invalid "+We,$e.commandStr);var Ie=!0,mt=pt.x|0,Ct=pt.y|0,hr,Cr;return"width"in pt?(hr=pt.width|0,Re.command(hr>=0,"invalid "+We,$e.commandStr)):Ie=!1,"height"in pt?(Cr=pt.height|0,Re.command(Cr>=0,"invalid "+We,$e.commandStr)):Ie=!1,new ls(!Ie&&Oe&&Oe.thisDep,!Ie&&Oe&&Oe.contextDep,!Ie&&Oe&&Oe.propDep,function(On,Sn){var Tn=On.shared.context,$n=hr;"width"in pt||($n=Sn.def(Tn,".",Dr,"-",mt));var ni=Cr;return"height"in pt||(ni=Sn.def(Tn,".",js,"-",Ct)),[mt,Ct,$n,ni]})}else if(We in Nt){var Er=Nt[We],wr=pu(Er,function(On,Sn){var Tn=On.invoke(Sn,Er);Re.optional(function(){On.assert(Sn,Tn+"&&typeof "+Tn+'==="object"',"invalid "+We)});var $n=On.shared.context,ni=Sn.def(Tn,".x|0"),aa=Sn.def(Tn,".y|0"),No=Sn.def('"width" in ',Tn,"?",Tn,".width|0:","(",$n,".",Dr,"-",ni,")"),$u=Sn.def('"height" in ',Tn,"?",Tn,".height|0:","(",$n,".",js,"-",aa,")");return Re.optional(function(){On.assert(Sn,No+">=0&&"+$u+">=0","invalid "+We)}),[ni,aa,No,$u]});return Oe&&(wr.thisDep=wr.thisDep||Oe.thisDep,wr.contextDep=wr.contextDep||Oe.contextDep,wr.propDep=wr.propDep||Oe.propDep),wr}else return Oe?new ls(Oe.thisDep,Oe.contextDep,Oe.propDep,function(On,Sn){var Tn=On.shared.context;return[0,0,Sn.def(Tn,".",Dr),Sn.def(Tn,".",js)]}):null}var yt=ct(Oo);if(yt){var xt=yt;yt=new ls(yt.thisDep,yt.contextDep,yt.propDep,function(We,pt){var Ie=xt.append(We,pt),mt=We.shared.context;return pt.set(mt,"."+Rh,Ie[2]),pt.set(mt,"."+Do,Ie[3]),Ie})}return{viewport:yt,scissor_box:ct(pl)}}function si(de,Oe){var $e=de.static,Gt=typeof $e[wu]=="string"&&typeof $e[fu]=="string";if(Gt){if(Object.keys(Oe.dynamic).length>0)return null;var Nt=Oe.static,ct=Object.keys(Nt);if(ct.length>0&&typeof Nt[ct[0]]=="number"){for(var yt=[],xt=0;xt<ct.length;++xt)Re(typeof Nt[ct[xt]]=="number","must specify all vertex attribute locations when using vaos"),yt.push([Nt[ct[xt]]|0,ct[xt]]);return yt}}return null}function qn(de,Oe,$e){var Gt=de.static,Nt=de.dynamic;function ct(Ie){if(Ie in Gt){var mt=Ce.id(Gt[Ie]);Re.optional(function(){Nr.shader(zd[Ie],mt,Re.guessCommand())});var Ct=Bo(function(){return mt});return Ct.id=mt,Ct}else if(Ie in Nt){var hr=Nt[Ie];return pu(hr,function(Cr,Er){var wr=Cr.invoke(Er,hr),On=Er.def(Cr.shared.strings,".id(",wr,")");return Re.optional(function(){Er(Cr.shared.shader,".shader(",zd[Ie],",",On,",",Cr.command,");")}),On})}return null}var yt=ct(wu),xt=ct(fu),We=null,pt;return As(yt)&&As(xt)?(We=Nr.program(xt.id,yt.id,null,$e),pt=Bo(function(Ie,mt){return Ie.link(We)})):pt=new ls(yt&&yt.thisDep||xt&&xt.thisDep,yt&&yt.contextDep||xt&&xt.contextDep,yt&&yt.propDep||xt&&xt.propDep,function(Ie,mt){var Ct=Ie.shared.shader,hr;yt?hr=yt.append(Ie,mt):hr=mt.def(Ct,".",wu);var Cr;xt?Cr=xt.append(Ie,mt):Cr=mt.def(Ct,".",fu);var Er=Ct+".program("+Cr+","+hr;return Re.optional(function(){Er+=","+Ie.command}),mt.def(Er+")")}),{frag:yt,vert:xt,progVar:pt,program:We}}function qi(de,Oe){var $e=de.static,Gt=de.dynamic;function Nt(){if(Fi in $e){var Ie=$e[Fi];kh(Ie)?Ie=Jt.getElements(Jt.create(Ie,!0)):Ie&&(Ie=Jt.getElements(Ie),Re.command(Ie,"invalid elements",Oe.commandStr));var mt=Bo(function(hr,Cr){if(Ie){var Er=hr.link(Ie);return hr.ELEMENTS=Er,Er}return hr.ELEMENTS=null,null});return mt.value=Ie,mt}else if(Fi in Gt){var Ct=Gt[Fi];return pu(Ct,function(hr,Cr){var Er=hr.shared,wr=Er.isBufferArgs,On=Er.elements,Sn=hr.invoke(Cr,Ct),Tn=Cr.def("null"),$n=Cr.def(wr,"(",Sn,")"),ni=hr.cond($n).then(Tn,"=",On,".createStream(",Sn,");").else(Tn,"=",On,".getElements(",Sn,");");return Re.optional(function(){hr.assert(ni.else,"!"+Sn+"||"+Tn,"invalid elements")}),Cr.entry(ni),Cr.exit(hr.cond($n).then(On,".destroyStream(",Tn,");")),hr.ELEMENTS=Tn,Tn})}return null}var ct=Nt();function yt(){if(Jo in $e){var Ie=$e[Jo];return Re.commandParameter(Ie,Fu,"invalid primitve",Oe.commandStr),Bo(function(Ct,hr){return Fu[Ie]})}else if(Jo in Gt){var mt=Gt[Jo];return pu(mt,function(Ct,hr){var Cr=Ct.constants.primTypes,Er=Ct.invoke(hr,mt);return Re.optional(function(){Ct.assert(hr,Er+" in "+Cr,"invalid primitive, must be one of "+Object.keys(Fu))}),hr.def(Cr,"[",Er,"]")})}else if(ct)return As(ct)?ct.value?Bo(function(Ct,hr){return hr.def(Ct.ELEMENTS,".primType")}):Bo(function(){return Wp}):new ls(ct.thisDep,ct.contextDep,ct.propDep,function(Ct,hr){var Cr=Ct.ELEMENTS;return hr.def(Cr,"?",Cr,".primType:",Wp)});return null}function xt(Ie,mt){if(Ie in $e){var Ct=$e[Ie]|0;return Re.command(!mt||Ct>=0,"invalid "+Ie,Oe.commandStr),Bo(function(Cr,Er){return mt&&(Cr.OFFSET=Ct),Ct})}else if(Ie in Gt){var hr=Gt[Ie];return pu(hr,function(Cr,Er){var wr=Cr.invoke(Er,hr);return mt&&(Cr.OFFSET=wr,Re.optional(function(){Cr.assert(Er,wr+">=0","invalid "+Ie)})),wr})}else if(mt&&ct)return Bo(function(Cr,Er){return Cr.OFFSET="0",0});return null}var We=xt(hu,!0);function pt(){if(oo in $e){var Ie=$e[oo]|0;return Re.command(typeof Ie=="number"&&Ie>=0,"invalid vertex count",Oe.commandStr),Bo(function(){return Ie})}else if(oo in Gt){var mt=Gt[oo];return pu(mt,function(Cr,Er){var wr=Cr.invoke(Er,mt);return Re.optional(function(){Cr.assert(Er,"typeof "+wr+'==="number"&&'+wr+">=0&&"+wr+"===("+wr+"|0)","invalid vertex count")}),wr})}else if(ct)if(As(ct)){if(ct)return We?new ls(We.thisDep,We.contextDep,We.propDep,function(Cr,Er){var wr=Er.def(Cr.ELEMENTS,".vertCount-",Cr.OFFSET);return Re.optional(function(){Cr.assert(Er,wr+">=0","invalid vertex offset/element buffer too small")}),wr}):Bo(function(Cr,Er){return Er.def(Cr.ELEMENTS,".vertCount")});var Ct=Bo(function(){return-1});return Re.optional(function(){Ct.MISSING=!0}),Ct}else{var hr=new ls(ct.thisDep||We.thisDep,ct.contextDep||We.contextDep,ct.propDep||We.propDep,function(Cr,Er){var wr=Cr.ELEMENTS;return Cr.OFFSET?Er.def(wr,"?",wr,".vertCount-",Cr.OFFSET,":-1"):Er.def(wr,"?",wr,".vertCount:-1")});return Re.optional(function(){hr.DYNAMIC=!0}),hr}return null}return{elements:ct,primitive:yt(),count:pt(),instances:xt(Ic,!1),offset:We}}function vo(de,Oe){var $e=de.static,Gt=de.dynamic,Nt={};return Ir.forEach(function(ct){var yt=un(ct);function xt(We,pt){if(ct in $e){var Ie=We($e[ct]);Nt[yt]=Bo(function(){return Ie})}else if(ct in Gt){var mt=Gt[ct];Nt[yt]=pu(mt,function(Ct,hr){return pt(Ct,hr,Ct.invoke(hr,mt))})}}switch(ct){case _o:case pi:case ii:case Mc:case Qn:case cu:case Es:case Ss:case lu:case Qa:return xt(function(We){return Re.commandType(We,"boolean",ct,Oe.commandStr),We},function(We,pt,Ie){return Re.optional(function(){We.assert(pt,"typeof "+Ie+'==="boolean"',"invalid flag "+ct,We.commandStr)}),Ie});case Gn:return xt(function(We){return Re.commandParameter(We,Fc,"invalid "+ct,Oe.commandStr),Fc[We]},function(We,pt,Ie){var mt=We.constants.compareFuncs;return Re.optional(function(){We.assert(pt,Ie+" in "+mt,"invalid "+ct+", must be one of "+Object.keys(Fc))}),pt.def(mt,"[",Ie,"]")});case Io:return xt(function(We){return Re.command(Va(We)&&We.length===2&&typeof We[0]=="number"&&typeof We[1]=="number"&&We[0]<=We[1],"depth range is 2d array",Oe.commandStr),We},function(We,pt,Ie){Re.optional(function(){We.assert(pt,We.shared.isArrayLike+"("+Ie+")&&"+Ie+".length===2&&typeof "+Ie+'[0]==="number"&&typeof '+Ie+'[1]==="number"&&'+Ie+"[0]<="+Ie+"[1]","depth range must be a 2d array")});var mt=pt.def("+",Ie,"[0]"),Ct=pt.def("+",Ie,"[1]");return[mt,Ct]});case fi:return xt(function(We){Re.commandType(We,"object","blend.func",Oe.commandStr);var pt="srcRGB"in We?We.srcRGB:We.src,Ie="srcAlpha"in We?We.srcAlpha:We.src,mt="dstRGB"in We?We.dstRGB:We.dst,Ct="dstAlpha"in We?We.dstAlpha:We.dst;return Re.commandParameter(pt,Xu,yt+".srcRGB",Oe.commandStr),Re.commandParameter(Ie,Xu,yt+".srcAlpha",Oe.commandStr),Re.commandParameter(mt,Xu,yt+".dstRGB",Oe.commandStr),Re.commandParameter(Ct,Xu,yt+".dstAlpha",Oe.commandStr),Re.command(yp.indexOf(pt+", "+mt)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+pt+", "+mt+")",Oe.commandStr),[Xu[pt],Xu[mt],Xu[Ie],Xu[Ct]]},function(We,pt,Ie){var mt=We.constants.blendFuncs;Re.optional(function(){We.assert(pt,Ie+"&&typeof "+Ie+'==="object"',"invalid blend func, must be an object")});function Ct(Tn,$n){var ni=pt.def('"',Tn,$n,'" in ',Ie,"?",Ie,".",Tn,$n,":",Ie,".",Tn);return Re.optional(function(){We.assert(pt,ni+" in "+mt,"invalid "+ct+"."+Tn+$n+", must be one of "+Object.keys(Xu))}),ni}var hr=Ct("src","RGB"),Cr=Ct("dst","RGB");Re.optional(function(){var Tn=We.constants.invalidBlendCombinations;We.assert(pt,Tn+".indexOf("+hr+'+", "+'+Cr+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var Er=pt.def(mt,"[",hr,"]"),wr=pt.def(mt,"[",Ct("src","Alpha"),"]"),On=pt.def(mt,"[",Cr,"]"),Sn=pt.def(mt,"[",Ct("dst","Alpha"),"]");return[Er,On,wr,Sn]});case Kn:return xt(function(We){if(typeof We=="string")return Re.commandParameter(We,ur,"invalid "+ct,Oe.commandStr),[ur[We],ur[We]];if(typeof We=="object")return Re.commandParameter(We.rgb,ur,ct+".rgb",Oe.commandStr),Re.commandParameter(We.alpha,ur,ct+".alpha",Oe.commandStr),[ur[We.rgb],ur[We.alpha]];Re.commandRaise("invalid blend.equation",Oe.commandStr)},function(We,pt,Ie){var mt=We.constants.blendEquations,Ct=pt.def(),hr=pt.def(),Cr=We.cond("typeof ",Ie,'==="string"');return Re.optional(function(){function Er(wr,On,Sn){We.assert(wr,Sn+" in "+mt,"invalid "+On+", must be one of "+Object.keys(ur))}Er(Cr.then,ct,Ie),We.assert(Cr.else,Ie+"&&typeof "+Ie+'==="object"',"invalid "+ct),Er(Cr.else,ct+".rgb",Ie+".rgb"),Er(Cr.else,ct+".alpha",Ie+".alpha")}),Cr.then(Ct,"=",hr,"=",mt,"[",Ie,"];"),Cr.else(Ct,"=",mt,"[",Ie,".rgb];",hr,"=",mt,"[",Ie,".alpha];"),pt(Cr),[Ct,hr]});case ri:return xt(function(We){return Re.command(Va(We)&&We.length===4,"blend.color must be a 4d array",Oe.commandStr),dt(4,function(pt){return+We[pt]})},function(We,pt,Ie){return Re.optional(function(){We.assert(pt,We.shared.isArrayLike+"("+Ie+")&&"+Ie+".length===4","blend.color must be a 4d array")}),dt(4,function(mt){return pt.def("+",Ie,"[",mt,"]")})});case Hu:return xt(function(We){return Re.commandType(We,"number",yt,Oe.commandStr),We|0},function(We,pt,Ie){return Re.optional(function(){We.assert(pt,"typeof "+Ie+'==="number"',"invalid stencil.mask")}),pt.def(Ie,"|0")});case Tu:return xt(function(We){Re.commandType(We,"object",yt,Oe.commandStr);var pt=We.cmp||"keep",Ie=We.ref||0,mt="mask"in We?We.mask:-1;return Re.commandParameter(pt,Fc,ct+".cmp",Oe.commandStr),Re.commandType(Ie,"number",ct+".ref",Oe.commandStr),Re.commandType(mt,"number",ct+".mask",Oe.commandStr),[Fc[pt],Ie,mt]},function(We,pt,Ie){var mt=We.constants.compareFuncs;Re.optional(function(){function Er(){We.assert(pt,Array.prototype.join.call(arguments,""),"invalid stencil.func")}Er(Ie+"&&typeof ",Ie,'==="object"'),Er('!("cmp" in ',Ie,")||(",Ie,".cmp in ",mt,")")});var Ct=pt.def('"cmp" in ',Ie,"?",mt,"[",Ie,".cmp]",":",Gu),hr=pt.def(Ie,".ref|0"),Cr=pt.def('"mask" in ',Ie,"?",Ie,".mask|0:-1");return[Ct,hr,Cr]});case nc:case hl:return xt(function(We){Re.commandType(We,"object",yt,Oe.commandStr);var pt=We.fail||"keep",Ie=We.zfail||"keep",mt=We.zpass||"keep";return Re.commandParameter(pt,Ws,ct+".fail",Oe.commandStr),Re.commandParameter(Ie,Ws,ct+".zfail",Oe.commandStr),Re.commandParameter(mt,Ws,ct+".zpass",Oe.commandStr),[ct===hl?Hs:oc,Ws[pt],Ws[Ie],Ws[mt]]},function(We,pt,Ie){var mt=We.constants.stencilOps;Re.optional(function(){We.assert(pt,Ie+"&&typeof "+Ie+'==="object"',"invalid "+ct)});function Ct(hr){return Re.optional(function(){We.assert(pt,'!("'+hr+'" in '+Ie+")||("+Ie+"."+hr+" in "+mt+")","invalid "+ct+"."+hr+", must be one of "+Object.keys(Ws))}),pt.def('"',hr,'" in ',Ie,"?",mt,"[",Ie,".",hr,"]:",Gu)}return[ct===hl?Hs:oc,Ct("fail"),Ct("zfail"),Ct("zpass")]});case fl:return xt(function(We){Re.commandType(We,"object",yt,Oe.commandStr);var pt=We.factor|0,Ie=We.units|0;return Re.commandType(pt,"number",yt+".factor",Oe.commandStr),Re.commandType(Ie,"number",yt+".units",Oe.commandStr),[pt,Ie]},function(We,pt,Ie){Re.optional(function(){We.assert(pt,Ie+"&&typeof "+Ie+'==="object"',"invalid "+ct)});var mt=pt.def(Ie,".factor|0"),Ct=pt.def(Ie,".units|0");return[mt,Ct]});case Wa:return xt(function(We){var pt=0;return We==="front"?pt=oc:We==="back"&&(pt=Hs),Re.command(!!pt,yt,Oe.commandStr),pt},function(We,pt,Ie){return Re.optional(function(){We.assert(pt,Ie+'==="front"||'+Ie+'==="back"',"invalid cull.face")}),pt.def(Ie,'==="front"?',oc,":",Hs)});case bs:return xt(function(We){return Re.command(typeof We=="number"&&We>=Kt.lineWidthDims[0]&&We<=Kt.lineWidthDims[1],"invalid line width, must be a positive number between "+Kt.lineWidthDims[0]+" and "+Kt.lineWidthDims[1],Oe.commandStr),We},function(We,pt,Ie){return Re.optional(function(){We.assert(pt,"typeof "+Ie+'==="number"&&'+Ie+">="+Kt.lineWidthDims[0]+"&&"+Ie+"<="+Kt.lineWidthDims[1],"invalid line width")}),Ie});case Ja:return xt(function(We){return Re.commandParameter(We,sc,yt,Oe.commandStr),sc[We]},function(We,pt,Ie){return Re.optional(function(){We.assert(pt,Ie+'==="cw"||'+Ie+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),pt.def(Ie+'==="cw"?'+mp+":"+Gp)});case Po:return xt(function(We){return Re.command(Va(We)&&We.length===4,"color.mask must be length 4 array",Oe.commandStr),We.map(function(pt){return!!pt})},function(We,pt,Ie){return Re.optional(function(){We.assert(pt,We.shared.isArrayLike+"("+Ie+")&&"+Ie+".length===4","invalid color.mask")}),dt(4,function(mt){return"!!"+Ie+"["+mt+"]"})});case Vs:return xt(function(We){Re.command(typeof We=="object"&&We,yt,Oe.commandStr);var pt="value"in We?We.value:1,Ie=!!We.invert;return Re.command(typeof pt=="number"&&pt>=0&&pt<=1,"sample.coverage.value must be a number between 0 and 1",Oe.commandStr),[pt,Ie]},function(We,pt,Ie){Re.optional(function(){We.assert(pt,Ie+"&&typeof "+Ie+'==="object"',"invalid sample.coverage")});var mt=pt.def('"value" in ',Ie,"?+",Ie,".value:1"),Ct=pt.def("!!",Ie,".invert");return[mt,Ct]})}}),Nt}function mo(de,Oe){var $e=de.static,Gt=de.dynamic,Nt={};return Object.keys($e).forEach(function(ct){var yt=$e[ct],xt;if(typeof yt=="number"||typeof yt=="boolean")xt=Bo(function(){return yt});else if(typeof yt=="function"){var We=yt._reglType;We==="texture2d"||We==="textureCube"?xt=Bo(function(pt){return pt.link(yt)}):We==="framebuffer"||We==="framebufferCube"?(Re.command(yt.color.length>0,'missing color attachment for framebuffer sent to uniform "'+ct+'"',Oe.commandStr),xt=Bo(function(pt){return pt.link(yt.color[0])})):Re.commandRaise('invalid data for uniform "'+ct+'"',Oe.commandStr)}else Va(yt)?xt=Bo(function(pt){var Ie=pt.global.def("[",dt(yt.length,function(mt){return Re.command(typeof yt[mt]=="number"||typeof yt[mt]=="boolean","invalid uniform "+ct,pt.commandStr),yt[mt]}),"]");return Ie}):Re.commandRaise('invalid or missing data for uniform "'+ct+'"',Oe.commandStr);xt.value=yt,Nt[ct]=xt}),Object.keys(Gt).forEach(function(ct){var yt=Gt[ct];Nt[ct]=pu(yt,function(xt,We){return xt.invoke(We,yt)})}),Nt}function Ii(de,Oe){var $e=de.static,Gt=de.dynamic,Nt={};return Object.keys($e).forEach(function(ct){var yt=$e[ct],xt=Ce.id(ct),We=new Pt;if(kh(yt))We.state=Fr,We.buffer=vr.getBuffer(vr.create(yt,dl,!1,!0)),We.type=0;else{var pt=vr.getBuffer(yt);if(pt)We.state=Fr,We.buffer=pt,We.type=0;else if(Re.command(typeof yt=="object"&&yt,"invalid data for attribute "+ct,Oe.commandStr),"constant"in yt){var Ie=yt.constant;We.buffer="null",We.state=hn,typeof Ie=="number"?We.x=Ie:(Re.command(Va(Ie)&&Ie.length>0&&Ie.length<=4,"invalid constant for attribute "+ct,Oe.commandStr),br.forEach(function(On,Sn){Sn<Ie.length&&(We[On]=Ie[Sn])}))}else{kh(yt.buffer)?pt=vr.getBuffer(vr.create(yt.buffer,dl,!1,!0)):pt=vr.getBuffer(yt.buffer),Re.command(!!pt,'missing buffer for attribute "'+ct+'"',Oe.commandStr);var mt=yt.offset|0;Re.command(mt>=0,'invalid offset for attribute "'+ct+'"',Oe.commandStr);var Ct=yt.stride|0;Re.command(Ct>=0&&Ct<256,'invalid stride for attribute "'+ct+'", must be integer betweeen [0, 255]',Oe.commandStr);var hr=yt.size|0;Re.command(!("size"in yt)||hr>0&&hr<=4,'invalid size for attribute "'+ct+'", must be 1,2,3,4',Oe.commandStr);var Cr=!!yt.normalized,Er=0;"type"in yt&&(Re.commandParameter(yt.type,Ko,"invalid type for attribute "+ct,Oe.commandStr),Er=Ko[yt.type]);var wr=yt.divisor|0;"divisor"in yt&&(Re.command(wr===0||Ur,'cannot specify divisor for attribute "'+ct+'", instancing not supported',Oe.commandStr),Re.command(wr>=0,'invalid divisor for attribute "'+ct+'"',Oe.commandStr)),Re.optional(function(){var On=Oe.commandStr,Sn=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(yt).forEach(function(Tn){Re.command(Sn.indexOf(Tn)>=0,'unknown parameter "'+Tn+'" for attribute pointer "'+ct+'" (valid parameters are '+Sn+")",On)})}),We.buffer=pt,We.state=Fr,We.size=hr,We.normalized=Cr,We.type=Er||pt.dtype,We.offset=mt,We.stride=Ct,We.divisor=wr}}Nt[ct]=Bo(function(On,Sn){var Tn=On.attribCache;if(xt in Tn)return Tn[xt];var $n={isStream:!1};return Object.keys(We).forEach(function(ni){$n[ni]=We[ni]}),We.buffer&&($n.buffer=On.link(We.buffer),$n.type=$n.type||$n.buffer+".dtype"),Tn[xt]=$n,$n})}),Object.keys(Gt).forEach(function(ct){var yt=Gt[ct];function xt(We,pt){var Ie=We.invoke(pt,yt),mt=We.shared,Ct=We.constants,hr=mt.isBufferArgs,Cr=mt.buffer;Re.optional(function(){We.assert(pt,Ie+"&&(typeof "+Ie+'==="object"||typeof '+Ie+'==="function")&&('+hr+"("+Ie+")||"+Cr+".getBuffer("+Ie+")||"+Cr+".getBuffer("+Ie+".buffer)||"+hr+"("+Ie+'.buffer)||("constant" in '+Ie+"&&(typeof "+Ie+'.constant==="number"||'+mt.isArrayLike+"("+Ie+".constant))))",'invalid dynamic attribute "'+ct+'"')});var Er={isStream:pt.def(!1)},wr=new Pt;wr.state=Fr,Object.keys(wr).forEach(function($n){Er[$n]=pt.def(""+wr[$n])});var On=Er.buffer,Sn=Er.type;pt("if(",hr,"(",Ie,")){",Er.isStream,"=true;",On,"=",Cr,".createStream(",dl,",",Ie,");",Sn,"=",On,".dtype;","}else{",On,"=",Cr,".getBuffer(",Ie,");","if(",On,"){",Sn,"=",On,".dtype;",'}else if("constant" in ',Ie,"){",Er.state,"=",hn,";","if(typeof "+Ie+'.constant === "number"){',Er[br[0]],"=",Ie,".constant;",br.slice(1).map(function($n){return Er[$n]}).join("="),"=0;","}else{",br.map(function($n,ni){return Er[$n]+"="+Ie+".constant.length>"+ni+"?"+Ie+".constant["+ni+"]:0;"}).join(""),"}}else{","if(",hr,"(",Ie,".buffer)){",On,"=",Cr,".createStream(",dl,",",Ie,".buffer);","}else{",On,"=",Cr,".getBuffer(",Ie,".buffer);","}",Sn,'="type" in ',Ie,"?",Ct.glTypes,"[",Ie,".type]:",On,".dtype;",Er.normalized,"=!!",Ie,".normalized;");function Tn($n){pt(Er[$n],"=",Ie,".",$n,"|0;")}return Tn("size"),Tn("offset"),Tn("stride"),Tn("divisor"),pt("}}"),pt.exit("if(",Er.isStream,"){",Cr,".destroyStream(",On,");","}"),Er}Nt[ct]=pu(yt,xt)}),Nt}function xo(de,Oe){var $e=de.static,Gt=de.dynamic;if(Wu in $e){var Nt=$e[Wu];return Nt!==null&&Yr.getVAO(Nt)===null&&(Nt=Yr.createVAO(Nt)),Bo(function(yt){return yt.link(Yr.getVAO(Nt))})}else if(Wu in Gt){var ct=Gt[Wu];return pu(ct,function(yt,xt){var We=yt.invoke(xt,ct);return xt.def(yt.shared.vao+".getVAO("+We+")")})}return null}function Aa(de){var Oe=de.static,$e=de.dynamic,Gt={};return Object.keys(Oe).forEach(function(Nt){var ct=Oe[Nt];Gt[Nt]=Bo(function(yt,xt){return typeof ct=="number"||typeof ct=="boolean"?""+ct:yt.link(ct)})}),Object.keys($e).forEach(function(Nt){var ct=$e[Nt];Gt[Nt]=pu(ct,function(yt,xt){return yt.invoke(xt,ct)})}),Gt}function bo(de,Oe,$e,Gt,Nt){var ct=de.static,yt=de.dynamic;Re.optional(function(){var Tn=[Ps,fu,wu,Fi,Jo,hu,oo,Ic,ao,Wu].concat(Ir);function $n(ni){Object.keys(ni).forEach(function(aa){Re.command(Tn.indexOf(aa)>=0,'unknown parameter "'+aa+'"',Nt.commandStr)})}$n(ct),$n(yt)});var xt=si(de,Oe),We=Ke(de,Nt),pt=_i(de,We,Nt),Ie=qi(de,Nt),mt=vo(de,Nt),Ct=qn(de,Nt,xt);function hr(Tn){var $n=pt[Tn];$n&&(mt[Tn]=$n)}hr(Oo),hr(un(pl));var Cr=Object.keys(mt).length>0,Er={framebuffer:We,draw:Ie,shader:Ct,state:mt,dirty:Cr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Er.profile=Ti(de,Nt),Er.uniforms=mo($e,Nt),Er.drawVAO=Er.scopeVAO=xo(de,Nt),!Er.drawVAO&&Ct.program&&!xt&&Ye.angle_instanced_arrays){var wr=!0,On=Ct.program.attributes.map(function(Tn){var $n=Oe.static[Tn];return wr=wr&&!!$n,$n});if(wr&&On.length>0){var Sn=Yr.getVAO(Yr.createVAO(On));Er.drawVAO=new ls(null,null,null,function(Tn,$n){return Tn.link(Sn)}),Er.useVAO=!0}}return xt?Er.useVAO=!0:Er.attributes=Ii(Oe,Nt),Er.context=Aa(Gt,Nt),Er}function Eo(de,Oe,$e){var Gt=de.shared,Nt=Gt.context,ct=de.scope();Object.keys($e).forEach(function(yt){Oe.save(Nt,"."+yt);var xt=$e[yt];ct(Nt,".",yt,"=",xt.append(de,Oe),";")}),Oe(ct)}function Ga(de,Oe,$e,Gt){var Nt=de.shared,ct=Nt.gl,yt=Nt.framebuffer,xt;cn&&(xt=Oe.def(Nt.extensions,".webgl_draw_buffers"));var We=de.constants,pt=We.drawBuffer,Ie=We.backBuffer,mt;$e?mt=$e.append(de,Oe):mt=Oe.def(yt,".next"),Gt||Oe("if(",mt,"!==",yt,".cur){"),Oe("if(",mt,"){",ct,".bindFramebuffer(",Bc,",",mt,".framebuffer);"),cn&&Oe(xt,".drawBuffersWEBGL(",pt,"[",mt,".colorAttachments.length]);"),Oe("}else{",ct,".bindFramebuffer(",Bc,",null);"),cn&&Oe(xt,".drawBuffersWEBGL(",Ie,");"),Oe("}",yt,".cur=",mt,";"),Gt||Oe("}")}function Fo(de,Oe,$e){var Gt=de.shared,Nt=Gt.gl,ct=de.current,yt=de.next,xt=Gt.current,We=Gt.next,pt=de.cond(xt,".dirty");Ir.forEach(function(Ie){var mt=un(Ie);if(!(mt in $e.state)){var Ct,hr;if(mt in yt){Ct=yt[mt],hr=ct[mt];var Cr=dt(Tr[mt].length,function(wr){return pt.def(Ct,"[",wr,"]")});pt(de.cond(Cr.map(function(wr,On){return wr+"!=="+hr+"["+On+"]"}).join("||")).then(Nt,".",Ar[mt],"(",Cr,");",Cr.map(function(wr,On){return hr+"["+On+"]="+wr}).join(";"),";"))}else{Ct=pt.def(We,".",mt);var Er=de.cond(Ct,"!==",xt,".",mt);pt(Er),mt in fn?Er(de.cond(Ct).then(Nt,".enable(",fn[mt],");").else(Nt,".disable(",fn[mt],");"),xt,".",mt,"=",Ct,";"):Er(Nt,".",Ar[mt],"(",Ct,");",xt,".",mt,"=",Ct,";")}}}),Object.keys($e.state).length===0&&pt(xt,".dirty=false;"),Oe(pt)}function Ts(de,Oe,$e,Gt){var Nt=de.shared,ct=de.current,yt=Nt.current,xt=Nt.gl;Yf(Object.keys($e)).forEach(function(We){var pt=$e[We];if(!(Gt&&!Gt(pt))){var Ie=pt.append(de,Oe);if(fn[We]){var mt=fn[We];As(pt)?Ie?Oe(xt,".enable(",mt,");"):Oe(xt,".disable(",mt,");"):Oe(de.cond(Ie).then(xt,".enable(",mt,");").else(xt,".disable(",mt,");")),Oe(yt,".",We,"=",Ie,";")}else if(Va(Ie)){var Ct=ct[We];Oe(xt,".",Ar[We],"(",Ie,");",Ie.map(function(hr,Cr){return Ct+"["+Cr+"]="+hr}).join(";"),";")}else Oe(xt,".",Ar[We],"(",Ie,");",yt,".",We,"=",Ie,";")}})}function So(de,Oe){Ur&&(de.instancing=Oe.def(de.shared.extensions,".angle_instanced_arrays"))}function gi(de,Oe,$e,Gt,Nt){var ct=de.shared,yt=de.stats,xt=ct.current,We=ct.timer,pt=$e.profile;function Ie(){return typeof performance=="undefined"?"Date.now()":"performance.now()"}var mt,Ct;function hr(Tn){mt=Oe.def(),Tn(mt,"=",Ie(),";"),typeof Nt=="string"?Tn(yt,".count+=",Nt,";"):Tn(yt,".count++;"),kr&&(Gt?(Ct=Oe.def(),Tn(Ct,"=",We,".getNumPendingQueries();")):Tn(We,".beginQuery(",yt,");"))}function Cr(Tn){Tn(yt,".cpuTime+=",Ie(),"-",mt,";"),kr&&(Gt?Tn(We,".pushScopeStats(",Ct,",",We,".getNumPendingQueries(),",yt,");"):Tn(We,".endQuery();"))}function Er(Tn){var $n=Oe.def(xt,".profile");Oe(xt,".profile=",Tn,";"),Oe.exit(xt,".profile=",$n,";")}var wr;if(pt){if(As(pt)){pt.enable?(hr(Oe),Cr(Oe.exit),Er("true")):Er("false");return}wr=pt.append(de,Oe),Er(wr)}else wr=Oe.def(xt,".profile");var On=de.block();hr(On),Oe("if(",wr,"){",On,"}");var Sn=de.block();Cr(Sn),Oe.exit("if(",wr,"){",Sn,"}")}function cs(de,Oe,$e,Gt,Nt){var ct=de.shared;function yt(We){switch(We){case jp:case Hp:case vl:return 2;case Dl:case eo:case lf:return 3;case vp:case Wf:case kc:return 4;default:return 1}}function xt(We,pt,Ie){var mt=ct.gl,Ct=Oe.def(We,".location"),hr=Oe.def(ct.attributes,"[",Ct,"]"),Cr=Ie.state,Er=Ie.buffer,wr=[Ie.x,Ie.y,Ie.z,Ie.w],On=["buffer","normalized","offset","stride"];function Sn(){Oe("if(!",hr,".buffer){",mt,".enableVertexAttribArray(",Ct,");}");var $n=Ie.type,ni;if(Ie.size?ni=Oe.def(Ie.size,"||",pt):ni=pt,Oe("if(",hr,".type!==",$n,"||",hr,".size!==",ni,"||",On.map(function(No){return hr+"."+No+"!=="+Ie[No]}).join("||"),"){",mt,".bindBuffer(",dl,",",Er,".buffer);",mt,".vertexAttribPointer(",[Ct,ni,$n,Ie.normalized,Ie.stride,Ie.offset],");",hr,".type=",$n,";",hr,".size=",ni,";",On.map(function(No){return hr+"."+No+"="+Ie[No]+";"}).join(""),"}"),Ur){var aa=Ie.divisor;Oe("if(",hr,".divisor!==",aa,"){",de.instancing,".vertexAttribDivisorANGLE(",[Ct,aa],");",hr,".divisor=",aa,";}")}}function Tn(){Oe("if(",hr,".buffer){",mt,".disableVertexAttribArray(",Ct,");",hr,".buffer=null;","}if(",br.map(function($n,ni){return hr+"."+$n+"!=="+wr[ni]}).join("||"),"){",mt,".vertexAttrib4f(",Ct,",",wr,");",br.map(function($n,ni){return hr+"."+$n+"="+wr[ni]+";"}).join(""),"}")}Cr===Fr?Sn():Cr===hn?Tn():(Oe("if(",Cr,"===",Fr,"){"),Sn(),Oe("}else{"),Tn(),Oe("}"))}Gt.forEach(function(We){var pt=We.name,Ie=$e.attributes[pt],mt;if(Ie){if(!Nt(Ie))return;mt=Ie.append(de,Oe)}else{if(!Nt(Yp))return;var Ct=de.scopeAttrib(pt);Re.optional(function(){de.assert(Oe,Ct+".state","missing attribute "+pt)}),mt={},Object.keys(new Pt).forEach(function(hr){mt[hr]=Oe.def(Ct,".",hr)})}xt(de.link(We),yt(We.info.type),mt)})}function ia(de,Oe,$e,Gt,Nt){for(var ct=de.shared,yt=ct.gl,xt,We=0;We<Gt.length;++We){var pt=Gt[We],Ie=pt.name,mt=pt.info.type,Ct=$e.uniforms[Ie],hr=de.link(pt),Cr=hr+".location",Er;if(Ct){if(!Nt(Ct))continue;if(As(Ct)){var wr=Ct.value;if(Re.command(wr!==null&&typeof wr!="undefined",'missing uniform "'+Ie+'"',de.commandStr),mt===Lc||mt===ac){Re.command(typeof wr=="function"&&(mt===Lc&&(wr._reglType==="texture2d"||wr._reglType==="framebuffer")||mt===ac&&(wr._reglType==="textureCube"||wr._reglType==="framebufferCube")),"invalid texture for uniform "+Ie,de.commandStr);var On=de.link(wr._texture||wr.color[0]._texture);Oe(yt,".uniform1i(",Cr,",",On+".bind());"),Oe.exit(On,".unbind();")}else if(mt===Xf||mt===$f||mt===Dc){Re.optional(function(){Re.command(Va(wr),"invalid matrix for uniform "+Ie,de.commandStr),Re.command(mt===Xf&&wr.length===4||mt===$f&&wr.length===9||mt===Dc&&wr.length===16,"invalid length for matrix uniform "+Ie,de.commandStr)});var Sn=de.global.def("new Float32Array(["+Array.prototype.slice.call(wr)+"])"),Tn=2;mt===$f?Tn=3:mt===Dc&&(Tn=4),Oe(yt,".uniformMatrix",Tn,"fv(",Cr,",false,",Sn,");")}else{switch(mt){case Fd:Re.commandType(wr,"number","uniform "+Ie,de.commandStr),xt="1f";break;case jp:Re.command(Va(wr)&&wr.length===2,"uniform "+Ie,de.commandStr),xt="2f";break;case Dl:Re.command(Va(wr)&&wr.length===3,"uniform "+Ie,de.commandStr),xt="3f";break;case vp:Re.command(Va(wr)&&wr.length===4,"uniform "+Ie,de.commandStr),xt="4f";break;case Gf:Re.commandType(wr,"boolean","uniform "+Ie,de.commandStr),xt="1i";break;case Oc:Re.commandType(wr,"number","uniform "+Ie,de.commandStr),xt="1i";break;case vl:Re.command(Va(wr)&&wr.length===2,"uniform "+Ie,de.commandStr),xt="2i";break;case Hp:Re.command(Va(wr)&&wr.length===2,"uniform "+Ie,de.commandStr),xt="2i";break;case lf:Re.command(Va(wr)&&wr.length===3,"uniform "+Ie,de.commandStr),xt="3i";break;case eo:Re.command(Va(wr)&&wr.length===3,"uniform "+Ie,de.commandStr),xt="3i";break;case kc:Re.command(Va(wr)&&wr.length===4,"uniform "+Ie,de.commandStr),xt="4i";break;case Wf:Re.command(Va(wr)&&wr.length===4,"uniform "+Ie,de.commandStr),xt="4i";break}Oe(yt,".uniform",xt,"(",Cr,",",Va(wr)?Array.prototype.slice.call(wr):wr,");")}continue}else Er=Ct.append(de,Oe)}else{if(!Nt(Yp))continue;Er=Oe.def(ct.uniforms,"[",Ce.id(Ie),"]")}mt===Lc?Oe("if(",Er,"&&",Er,'._reglType==="framebuffer"){',Er,"=",Er,".color[0];","}"):mt===ac&&Oe("if(",Er,"&&",Er,'._reglType==="framebufferCube"){',Er,"=",Er,".color[0];","}"),Re.optional(function(){function $u(Ll,td){de.assert(Oe,Ll,'bad data or missing for uniform "'+Ie+'". '+td)}function bp(Ll){$u("typeof "+Er+'==="'+Ll+'"',"invalid type, expected "+Ll)}function Yu(Ll,td){$u(ct.isArrayLike+"("+Er+")&&"+Er+".length==="+Ll,"invalid vector, should have length "+Ll,de.commandStr)}function ed(Ll){$u("typeof "+Er+'==="function"&&'+Er+'._reglType==="texture'+(Ll===Hf?"2d":"Cube")+'"',"invalid texture type",de.commandStr)}switch(mt){case Oc:bp("number");break;case Hp:Yu(2,"number");break;case eo:Yu(3,"number");break;case Wf:Yu(4,"number");break;case Fd:bp("number");break;case jp:Yu(2,"number");break;case Dl:Yu(3,"number");break;case vp:Yu(4,"number");break;case Gf:bp("boolean");break;case vl:Yu(2,"boolean");break;case lf:Yu(3,"boolean");break;case kc:Yu(4,"boolean");break;case Xf:Yu(4,"number");break;case $f:Yu(9,"number");break;case Dc:Yu(16,"number");break;case Lc:ed(Hf);break;case ac:ed(dp);break}});var $n=1;switch(mt){case Lc:case ac:var ni=Oe.def(Er,"._texture");Oe(yt,".uniform1i(",Cr,",",ni,".bind());"),Oe.exit(ni,".unbind();");continue;case Oc:case Gf:xt="1i";break;case Hp:case vl:xt="2i",$n=2;break;case eo:case lf:xt="3i",$n=3;break;case Wf:case kc:xt="4i",$n=4;break;case Fd:xt="1f";break;case jp:xt="2f",$n=2;break;case Dl:xt="3f",$n=3;break;case vp:xt="4f",$n=4;break;case Xf:xt="Matrix2fv";break;case $f:xt="Matrix3fv";break;case Dc:xt="Matrix4fv";break}if(Oe(yt,".uniform",xt,"(",Cr,","),xt.charAt(0)==="M"){var aa=Math.pow(mt-Xf+2,2),No=de.global.def("new Float32Array(",aa,")");Oe("false,(Array.isArray(",Er,")||",Er," instanceof Float32Array)?",Er,":(",dt(aa,function($u){return No+"["+$u+"]="+Er+"["+$u+"]"}),",",No,")")}else $n>1?Oe(dt($n,function($u){return Er+"["+$u+"]"})):Oe(Er);Oe(");")}}function Xn(de,Oe,$e,Gt){var Nt=de.shared,ct=Nt.gl,yt=Nt.draw,xt=Gt.draw;function We(){var ni=xt.elements,aa,No=Oe;return ni?((ni.contextDep&&Gt.contextDynamic||ni.propDep)&&(No=$e),aa=ni.append(de,No)):aa=No.def(yt,".",Fi),aa&&No("if("+aa+")"+ct+".bindBuffer("+Zp+","+aa+".buffer.buffer);"),aa}function pt(){var ni=xt.count,aa,No=Oe;return ni?((ni.contextDep&&Gt.contextDynamic||ni.propDep)&&(No=$e),aa=ni.append(de,No),Re.optional(function(){ni.MISSING&&de.assert(Oe,"false","missing vertex count"),ni.DYNAMIC&&de.assert(No,aa+">=0","missing vertex count")})):(aa=No.def(yt,".",oo),Re.optional(function(){de.assert(No,aa+">=0","missing vertex count")})),aa}var Ie=We();function mt(ni){var aa=xt[ni];return aa?aa.contextDep&&Gt.contextDynamic||aa.propDep?aa.append(de,$e):aa.append(de,Oe):Oe.def(yt,".",ni)}var Ct=mt(Jo),hr=mt(hu),Cr=pt();if(typeof Cr=="number"){if(Cr===0)return}else $e("if(",Cr,"){"),$e.exit("}");var Er,wr;Ur&&(Er=mt(Ic),wr=de.instancing);var On=Ie+".type",Sn=xt.elements&&As(xt.elements);function Tn(){function ni(){$e(wr,".drawElementsInstancedANGLE(",[Ct,Cr,On,hr+"<<(("+On+"-"+Hr+")>>1)",Er],");")}function aa(){$e(wr,".drawArraysInstancedANGLE(",[Ct,hr,Cr,Er],");")}Ie?Sn?ni():($e("if(",Ie,"){"),ni(),$e("}else{"),aa(),$e("}")):aa()}function $n(){function ni(){$e(ct+".drawElements("+[Ct,Cr,On,hr+"<<(("+On+"-"+Hr+")>>1)"]+");")}function aa(){$e(ct+".drawArrays("+[Ct,hr,Cr]+");")}Ie?Sn?ni():($e("if(",Ie,"){"),ni(),$e("}else{"),aa(),$e("}")):aa()}Ur&&(typeof Er!="number"||Er>=0)?typeof Er=="string"?($e("if(",Er,">0){"),Tn(),$e("}else if(",Er,"<0){"),$n(),$e("}")):Tn():$n()}function Ri(de,Oe,$e,Gt,Nt){var ct=er(),yt=ct.proc("body",Nt);return Re.optional(function(){ct.commandStr=Oe.commandStr,ct.command=ct.link(Oe.commandStr)}),Ur&&(ct.instancing=yt.def(ct.shared.extensions,".angle_instanced_arrays")),de(ct,yt,$e,Gt),ct.compile().body}function Xi(de,Oe,$e,Gt){So(de,Oe),$e.useVAO?$e.drawVAO?Oe(de.shared.vao,".setVAO(",$e.drawVAO.append(de,Oe),");"):Oe(de.shared.vao,".setVAO(",de.shared.vao,".targetVAO);"):(Oe(de.shared.vao,".setVAO(null);"),cs(de,Oe,$e,Gt.attributes,function(){return!0})),ia(de,Oe,$e,Gt.uniforms,function(){return!0}),Xn(de,Oe,Oe,$e)}function Ao(de,Oe){var $e=de.proc("draw",1);So(de,$e),Eo(de,$e,Oe.context),Ga(de,$e,Oe.framebuffer),Fo(de,$e,Oe),Ts(de,$e,Oe.state),gi(de,$e,Oe,!1,!0);var Gt=Oe.shader.progVar.append(de,$e);if($e(de.shared.gl,".useProgram(",Gt,".program);"),Oe.shader.program)Xi(de,$e,Oe,Oe.shader.program);else{$e(de.shared.vao,".setVAO(null);");var Nt=de.global.def("{}"),ct=$e.def(Gt,".id"),yt=$e.def(Nt,"[",ct,"]");$e(de.cond(yt).then(yt,".call(this,a0);").else(yt,"=",Nt,"[",ct,"]=",de.link(function(xt){return Ri(Xi,de,Oe,xt,1)}),"(",Gt,");",yt,".call(this,a0);"))}Object.keys(Oe.state).length>0&&$e(de.shared.current,".dirty=true;")}function gl(de,Oe,$e,Gt){de.batchId="a1",So(de,Oe);function Nt(){return!0}cs(de,Oe,$e,Gt.attributes,Nt),ia(de,Oe,$e,Gt.uniforms,Nt),Xn(de,Oe,Oe,$e)}function He(de,Oe,$e,Gt){So(de,Oe);var Nt=$e.contextDep,ct=Oe.def(),yt="a0",xt="a1",We=Oe.def();de.shared.props=We,de.batchId=ct;var pt=de.scope(),Ie=de.scope();Oe(pt.entry,"for(",ct,"=0;",ct,"<",xt,";++",ct,"){",We,"=",yt,"[",ct,"];",Ie,"}",pt.exit);function mt(On){return On.contextDep&&Nt||On.propDep}function Ct(On){return!mt(On)}if($e.needsContext&&Eo(de,Ie,$e.context),$e.needsFramebuffer&&Ga(de,Ie,$e.framebuffer),Ts(de,Ie,$e.state,mt),$e.profile&&mt($e.profile)&&gi(de,Ie,$e,!1,!0),Gt)$e.useVAO?$e.drawVAO?mt($e.drawVAO)?Ie(de.shared.vao,".setVAO(",$e.drawVAO.append(de,Ie),");"):pt(de.shared.vao,".setVAO(",$e.drawVAO.append(de,pt),");"):pt(de.shared.vao,".setVAO(",de.shared.vao,".targetVAO);"):(pt(de.shared.vao,".setVAO(null);"),cs(de,pt,$e,Gt.attributes,Ct),cs(de,Ie,$e,Gt.attributes,mt)),ia(de,pt,$e,Gt.uniforms,Ct),ia(de,Ie,$e,Gt.uniforms,mt),Xn(de,pt,Ie,$e);else{var hr=de.global.def("{}"),Cr=$e.shader.progVar.append(de,Ie),Er=Ie.def(Cr,".id"),wr=Ie.def(hr,"[",Er,"]");Ie(de.shared.gl,".useProgram(",Cr,".program);","if(!",wr,"){",wr,"=",hr,"[",Er,"]=",de.link(function(On){return Ri(gl,de,$e,On,2)}),"(",Cr,");}",wr,".call(this,a0[",ct,"],",ct,");")}}function rr(de,Oe){var $e=de.proc("batch",2);de.batchId="0",So(de,$e);var Gt=!1,Nt=!0;Object.keys(Oe.context).forEach(function(hr){Gt=Gt||Oe.context[hr].propDep}),Gt||(Eo(de,$e,Oe.context),Nt=!1);var ct=Oe.framebuffer,yt=!1;ct?(ct.propDep?Gt=yt=!0:ct.contextDep&&Gt&&(yt=!0),yt||Ga(de,$e,ct)):Ga(de,$e,null),Oe.state.viewport&&Oe.state.viewport.propDep&&(Gt=!0);function xt(hr){return hr.contextDep&&Gt||hr.propDep}Fo(de,$e,Oe),Ts(de,$e,Oe.state,function(hr){return!xt(hr)}),(!Oe.profile||!xt(Oe.profile))&&gi(de,$e,Oe,!1,"a1"),Oe.contextDep=Gt,Oe.needsContext=Nt,Oe.needsFramebuffer=yt;var We=Oe.shader.progVar;if(We.contextDep&&Gt||We.propDep)He(de,$e,Oe,null);else{var pt=We.append(de,$e);if($e(de.shared.gl,".useProgram(",pt,".program);"),Oe.shader.program)He(de,$e,Oe,Oe.shader.program);else{$e(de.shared.vao,".setVAO(null);");var Ie=de.global.def("{}"),mt=$e.def(pt,".id"),Ct=$e.def(Ie,"[",mt,"]");$e(de.cond(Ct).then(Ct,".call(this,a0,a1);").else(Ct,"=",Ie,"[",mt,"]=",de.link(function(hr){return Ri(He,de,Oe,hr,2)}),"(",pt,");",Ct,".call(this,a0,a1);"))}}Object.keys(Oe.state).length>0&&$e(de.shared.current,".dirty=true;")}function Ht(de,Oe){var $e=de.proc("scope",3);de.batchId="a2";var Gt=de.shared,Nt=Gt.current;Eo(de,$e,Oe.context),Oe.framebuffer&&Oe.framebuffer.append(de,$e),Yf(Object.keys(Oe.state)).forEach(function(yt){var xt=Oe.state[yt],We=xt.append(de,$e);Va(We)?We.forEach(function(pt,Ie){$e.set(de.next[yt],"["+Ie+"]",pt)}):$e.set(Gt.next,"."+yt,We)}),gi(de,$e,Oe,!0,!0),[Fi,hu,oo,Ic,Jo].forEach(function(yt){var xt=Oe.draw[yt];xt&&$e.set(Gt.draw,"."+yt,""+xt.append(de,$e))}),Object.keys(Oe.uniforms).forEach(function(yt){$e.set(Gt.uniforms,"["+Ce.id(yt)+"]",Oe.uniforms[yt].append(de,$e))}),Object.keys(Oe.attributes).forEach(function(yt){var xt=Oe.attributes[yt].append(de,$e),We=de.scopeAttrib(yt);Object.keys(new Pt).forEach(function(pt){$e.set(We,"."+pt,xt[pt])})}),Oe.scopeVAO&&$e.set(Gt.vao,".targetVAO",Oe.scopeVAO.append(de,$e));function ct(yt){var xt=Oe.shader[yt];xt&&$e.set(Gt.shader,"."+yt,xt.append(de,$e))}ct(fu),ct(wu),Object.keys(Oe.state).length>0&&($e(Nt,".dirty=true;"),$e.exit(Nt,".dirty=true;")),$e("a1(",de.shared.context,",a0,",de.batchId,");")}function dn(de){if(!(typeof de!="object"||Va(de))){for(var Oe=Object.keys(de),$e=0;$e<Oe.length;++$e)if(en.isDynamic(de[Oe[$e]]))return!0;return!1}}function xi(de,Oe,$e){var Gt=Oe.static[$e];if(!Gt||!dn(Gt))return;var Nt=de.global,ct=Object.keys(Gt),yt=!1,xt=!1,We=!1,pt=de.global.def("{}");ct.forEach(function(mt){var Ct=Gt[mt];if(en.isDynamic(Ct)){typeof Ct=="function"&&(Ct=Gt[mt]=en.unbox(Ct));var hr=pu(Ct,null);yt=yt||hr.thisDep,We=We||hr.propDep,xt=xt||hr.contextDep}else{switch(Nt(pt,".",mt,"="),typeof Ct){case"number":Nt(Ct);break;case"string":Nt('"',Ct,'"');break;case"object":Array.isArray(Ct)&&Nt("[",Ct.join(),"]");break;default:Nt(de.link(Ct));break}Nt(";")}});function Ie(mt,Ct){ct.forEach(function(hr){var Cr=Gt[hr];if(en.isDynamic(Cr)){var Er=mt.invoke(Ct,Cr);Ct(pt,".",hr,"=",Er,";")}})}Oe.dynamic[$e]=new en.DynamicVariable(gn,{thisDep:yt,contextDep:xt,propDep:We,ref:pt,append:Ie}),delete Oe.static[$e]}function ya(de,Oe,$e,Gt,Nt){var ct=er();ct.stats=ct.link(Nt),Object.keys(Oe.static).forEach(function(xt){xi(ct,Oe,xt)}),ic.forEach(function(xt){xi(ct,de,xt)});var yt=bo(de,Oe,$e,Gt,ct);return Ao(ct,yt),Ht(ct,yt),rr(ct,yt),ct.compile()}return{next:pn,current:Tr,procs:function(){var de=er(),Oe=de.proc("poll"),$e=de.proc("refresh"),Gt=de.block();Oe(Gt),$e(Gt);var Nt=de.shared,ct=Nt.gl,yt=Nt.next,xt=Nt.current;Gt(xt,".dirty=false;"),Ga(de,Oe),Ga(de,$e,null,!0);var We;Ur&&(We=de.link(Ur)),Ye.oes_vertex_array_object&&$e(de.link(Ye.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var pt=0;pt<Kt.maxAttributes;++pt){var Ie=$e.def(Nt.attributes,"[",pt,"]"),mt=de.cond(Ie,".buffer");mt.then(ct,".enableVertexAttribArray(",pt,");",ct,".bindBuffer(",dl,",",Ie,".buffer.buffer);",ct,".vertexAttribPointer(",pt,",",Ie,".size,",Ie,".type,",Ie,".normalized,",Ie,".stride,",Ie,".offset);").else(ct,".disableVertexAttribArray(",pt,");",ct,".vertexAttrib4f(",pt,",",Ie,".x,",Ie,".y,",Ie,".z,",Ie,".w);",Ie,".buffer=null;"),$e(mt),Ur&&$e(We,".vertexAttribDivisorANGLE(",pt,",",Ie,".divisor);")}return $e(de.shared.vao,".currentVAO=null;",de.shared.vao,".setVAO(",de.shared.vao,".targetVAO);"),Object.keys(fn).forEach(function(Ct){var hr=fn[Ct],Cr=Gt.def(yt,".",Ct),Er=de.block();Er("if(",Cr,"){",ct,".enable(",hr,")}else{",ct,".disable(",hr,")}",xt,".",Ct,"=",Cr,";"),$e(Er),Oe("if(",Cr,"!==",xt,".",Ct,"){",Er,"}")}),Object.keys(Ar).forEach(function(Ct){var hr=Ar[Ct],Cr=Tr[Ct],Er,wr,On=de.block();if(On(ct,".",hr,"("),Va(Cr)){var Sn=Cr.length;Er=de.global.def(yt,".",Ct),wr=de.global.def(xt,".",Ct),On(dt(Sn,function(Tn){return Er+"["+Tn+"]"}),");",dt(Sn,function(Tn){return wr+"["+Tn+"]="+Er+"["+Tn+"];"}).join("")),Oe("if(",dt(Sn,function(Tn){return Er+"["+Tn+"]!=="+wr+"["+Tn+"]"}).join("||"),"){",On,"}")}else Er=Gt.def(yt,".",Ct),wr=Gt.def(xt,".",Ct),On(Er,");",xt,".",Ct,"=",Er,";"),Oe("if(",Er,"!==",wr,"){",On,"}");$e(On)}),de.compile()}(),compile:ya}}function qp(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var Zd=34918,Vv=34919,Vd=35007,Kp=function(W,Ce){if(!Ce.ext_disjoint_timer_query)return null;var Ye=[];function Kt(){return Ye.pop()||Ce.ext_disjoint_timer_query.createQueryEXT()}function vr(Ur){Ye.push(Ur)}var Jt=[];function Ut(Ur){var cn=Kt();Ce.ext_disjoint_timer_query.beginQueryEXT(Vd,cn),Jt.push(cn),kr(Jt.length-1,Jt.length,Ur)}function Br(){Ce.ext_disjoint_timer_query.endQueryEXT(Vd)}function Or(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var Yr=[];function Nr(){return Yr.pop()||new Or}function Wr(Ur){Yr.push(Ur)}var tn=[];function kr(Ur,cn,Tr){var pn=Nr();pn.startQueryIndex=Ur,pn.endQueryIndex=cn,pn.sum=0,pn.stats=Tr,tn.push(pn)}var $r=[],Pt=[];function ur(){var Ur,cn,Tr=Jt.length;if(Tr!==0){Pt.length=Math.max(Pt.length,Tr+1),$r.length=Math.max($r.length,Tr+1),$r[0]=0,Pt[0]=0;var pn=0;for(Ur=0,cn=0;cn<Jt.length;++cn){var Ir=Jt[cn];Ce.ext_disjoint_timer_query.getQueryObjectEXT(Ir,Vv)?(pn+=Ce.ext_disjoint_timer_query.getQueryObjectEXT(Ir,Zd),vr(Ir)):Jt[Ur++]=Ir,$r[cn+1]=pn,Pt[cn+1]=Ur}for(Jt.length=Ur,Ur=0,cn=0;cn<tn.length;++cn){var fn=tn[cn],Ar=fn.startQueryIndex,un=fn.endQueryIndex;fn.sum+=$r[un]-$r[Ar];var jn=Pt[Ar],ai=Pt[un];ai===jn?(fn.stats.gpuTime+=fn.sum/1e6,Wr(fn)):(fn.startQueryIndex=jn,fn.endQueryIndex=ai,tn[Ur++]=fn)}tn.length=Ur}}return{beginQuery:Ut,endQuery:Br,pushScopeStats:kr,update:ur,getNumPendingQueries:function(){return Jt.length},clear:function(){Ye.push.apply(Ye,Jt);for(var Ur=0;Ur<Ye.length;Ur++)Ce.ext_disjoint_timer_query.deleteQueryEXT(Ye[Ur]);Jt.length=0,Ye.length=0},restore:function(){Jt.length=0,Ye.length=0}}},jd=16384,Os=256,_p=1024,xp=34962,Qp="webglcontextlost",qf="webglcontextrestored",Jp=1,jv=2,Hv=3;function Hd(W,Ce){for(var Ye=0;Ye<W.length;++Ye)if(W[Ye]===Ce)return Ye;return-1}function Wd(W){var Ce=Tt(W);if(!Ce)return null;var Ye=Ce.gl,Kt=Ye.getContextAttributes(),vr=Ye.isContextLost(),Jt=Rt(Ye,Ce);if(!Jt)return null;var Ut=ue(),Br=qp(),Or=Jt.extensions,Yr=Kp(Ye,Or),Nr=Gi(),Wr=Ye.drawingBufferWidth,tn=Ye.drawingBufferHeight,kr={tick:0,time:0,viewportWidth:Wr,viewportHeight:tn,framebufferWidth:Wr,framebufferHeight:tn,drawingBufferWidth:Wr,drawingBufferHeight:tn,pixelRatio:Ce.pixelRatio},$r={},Pt={elements:null,primitive:4,count:-1,offset:0,instances:-1},ur=yc(Ye,Or),Ur=hh(Ye,Br,Ce,Tr),cn=J(Ye,Or,ur,Br,Ur);function Tr(Xn){return cn.destroyBuffer(Xn)}var pn=Yi(Ye,Or,Ur,Br),Ir=Ze(Ye,Ut,Br,Ce),fn=Ft(Ye,Or,ur,function(){jn.procs.poll()},kr,Br,Ce),Ar=xu(Ye,Or,ur,Br,Ce),un=w(Ye,Or,ur,fn,Ar,Br),jn=cf(Ye,Ut,Or,ur,Ur,pn,fn,un,$r,cn,Ir,Pt,kr,Yr,Ce),ai=Lt(Ye,un,jn.procs.poll,kr,Kt,Or,ur),an=jn.next,Lr=Ye.canvas,xr=[],er=[],Ti=[],Ke=[Ce.onDestroy],_i=null;function si(){if(xr.length===0){Yr&&Yr.update(),_i=null;return}_i=Ln.next(si),Ts();for(var Xn=xr.length-1;Xn>=0;--Xn){var Ri=xr[Xn];Ri&&Ri(kr,null,0)}Ye.flush(),Yr&&Yr.update()}function qn(){!_i&&xr.length>0&&(_i=Ln.next(si))}function qi(){_i&&(Ln.cancel(si),_i=null)}function vo(Xn){Xn.preventDefault(),vr=!0,qi(),er.forEach(function(Ri){Ri()})}function mo(Xn){Ye.getError(),vr=!1,Jt.restore(),Ir.restore(),Ur.restore(),fn.restore(),Ar.restore(),un.restore(),cn.restore(),Yr&&Yr.restore(),jn.procs.refresh(),qn(),Ti.forEach(function(Ri){Ri()})}Lr&&(Lr.addEventListener(Qp,vo,!1),Lr.addEventListener(qf,mo,!1));function Ii(){xr.length=0,qi(),Lr&&(Lr.removeEventListener(Qp,vo),Lr.removeEventListener(qf,mo)),Ir.clear(),un.clear(),Ar.clear(),fn.clear(),pn.clear(),Ur.clear(),cn.clear(),Yr&&Yr.clear(),Ke.forEach(function(Xn){Xn()})}function xo(Xn){Re(!!Xn,"invalid args to regl({...})"),Re.type(Xn,"object","invalid args to regl({...})");function Ri(Nt){var ct=U({},Nt);delete ct.uniforms,delete ct.attributes,delete ct.context,delete ct.vao,"stencil"in ct&&ct.stencil.op&&(ct.stencil.opBack=ct.stencil.opFront=ct.stencil.op,delete ct.stencil.op);function yt(xt){if(xt in ct){var We=ct[xt];delete ct[xt],Object.keys(We).forEach(function(pt){ct[xt+"."+pt]=We[pt]})}}return yt("blend"),yt("depth"),yt("cull"),yt("stencil"),yt("polygonOffset"),yt("scissor"),yt("sample"),"vao"in Nt&&(ct.vao=Nt.vao),ct}function Xi(Nt){var ct={},yt={};return Object.keys(Nt).forEach(function(xt){var We=Nt[xt];en.isDynamic(We)?yt[xt]=en.unbox(We,xt):ct[xt]=We}),{dynamic:yt,static:ct}}var Ao=Xi(Xn.context||{}),gl=Xi(Xn.uniforms||{}),He=Xi(Xn.attributes||{}),rr=Xi(Ri(Xn)),Ht={gpuTime:0,cpuTime:0,count:0},dn=jn.compile(rr,He,gl,Ao,Ht),xi=dn.draw,ya=dn.batch,de=dn.scope,Oe=[];function $e(Nt){for(;Oe.length<Nt;)Oe.push(null);return Oe}function Gt(Nt,ct){var yt;if(vr&&Re.raise("context lost"),typeof Nt=="function")return de.call(this,null,Nt,0);if(typeof ct=="function")if(typeof Nt=="number")for(yt=0;yt<Nt;++yt)de.call(this,null,ct,yt);else if(Array.isArray(Nt))for(yt=0;yt<Nt.length;++yt)de.call(this,Nt[yt],ct,yt);else return de.call(this,Nt,ct,0);else if(typeof Nt=="number"){if(Nt>0)return ya.call(this,$e(Nt|0),Nt|0)}else if(Array.isArray(Nt)){if(Nt.length)return ya.call(this,Nt,Nt.length)}else return xi.call(this,Nt)}return U(Gt,{stats:Ht})}var Aa=un.setFBO=xo({framebuffer:en.define.call(null,Jp,"framebuffer")});function bo(Xn,Ri){var Xi=0;jn.procs.poll();var Ao=Ri.color;Ao&&(Ye.clearColor(+Ao[0]||0,+Ao[1]||0,+Ao[2]||0,+Ao[3]||0),Xi|=jd),"depth"in Ri&&(Ye.clearDepth(+Ri.depth),Xi|=Os),"stencil"in Ri&&(Ye.clearStencil(Ri.stencil|0),Xi|=_p),Re(!!Xi,"called regl.clear with no buffer specified"),Ye.clear(Xi)}function Eo(Xn){if(Re(typeof Xn=="object"&&Xn,"regl.clear() takes an object as input"),"framebuffer"in Xn)if(Xn.framebuffer&&Xn.framebuffer_reglType==="framebufferCube")for(var Ri=0;Ri<6;++Ri)Aa(U({framebuffer:Xn.framebuffer.faces[Ri]},Xn),bo);else Aa(Xn,bo);else bo(null,Xn)}function Ga(Xn){Re.type(Xn,"function","regl.frame() callback must be a function"),xr.push(Xn);function Ri(){var Xi=Hd(xr,Xn);Re(Xi>=0,"cannot cancel a frame twice");function Ao(){var gl=Hd(xr,Ao);xr[gl]=xr[xr.length-1],xr.length-=1,xr.length<=0&&qi()}xr[Xi]=Ao}return qn(),{cancel:Ri}}function Fo(){var Xn=an.viewport,Ri=an.scissor_box;Xn[0]=Xn[1]=Ri[0]=Ri[1]=0,kr.viewportWidth=kr.framebufferWidth=kr.drawingBufferWidth=Xn[2]=Ri[2]=Ye.drawingBufferWidth,kr.viewportHeight=kr.framebufferHeight=kr.drawingBufferHeight=Xn[3]=Ri[3]=Ye.drawingBufferHeight}function Ts(){kr.tick+=1,kr.time=gi(),Fo(),jn.procs.poll()}function So(){Fo(),jn.procs.refresh(),Yr&&Yr.update()}function gi(){return(Gi()-Nr)/1e3}So();function cs(Xn,Ri){Re.type(Ri,"function","listener callback must be a function");var Xi;switch(Xn){case"frame":return Ga(Ri);case"lost":Xi=er;break;case"restore":Xi=Ti;break;case"destroy":Xi=Ke;break;default:Re.raise("invalid event, must be one of frame,lost,restore,destroy")}return Xi.push(Ri),{cancel:function(){for(var Ao=0;Ao<Xi.length;++Ao)if(Xi[Ao]===Ri){Xi[Ao]=Xi[Xi.length-1],Xi.pop();return}}}}var ia=U(xo,{clear:Eo,prop:en.define.bind(null,Jp),context:en.define.bind(null,jv),this:en.define.bind(null,Hv),draw:xo({}),buffer:function(Xn){return Ur.create(Xn,xp,!1,!1)},elements:function(Xn){return pn.create(Xn,!1)},texture:fn.create2D,cube:fn.createCube,renderbuffer:Ar.create,framebuffer:un.create,framebufferCube:un.createCube,vao:cn.createVAO,attributes:Kt,frame:Ga,on:cs,limits:ur,hasExtension:function(Xn){return ur.extensions.indexOf(Xn.toLowerCase())>=0},read:ai,destroy:Ii,_gl:Ye,_refresh:So,poll:function(){Ts(),Yr&&Yr.update()},now:gi,stats:Br});return Ce.onDone(null,ia),ia}return Wd})},48096:function(sr){(function(ne,U){sr.exports=U()})(this,function(){"use strict";function ne(Mt,ft,kt,qe,Dt,dr){if(!(Dt-qe<=kt)){var oe=qe+Dt>>1;U(Mt,ft,oe,qe,Dt,dr%2),ne(Mt,ft,kt,qe,oe-1,dr+1),ne(Mt,ft,kt,oe+1,Dt,dr+1)}}function U(Mt,ft,kt,qe,Dt,dr){for(;Dt>qe;){if(Dt-qe>600){var oe=Dt-qe+1,H=kt-qe+1,re=Math.log(oe),Be=.5*Math.exp(2*re/3),we=.5*Math.sqrt(re*Be*(oe-Be)/oe)*(H-oe/2<0?-1:1),ut=Math.max(qe,Math.floor(kt-H*Be/oe+we)),ie=Math.min(Dt,Math.floor(kt+(oe-H)*Be/oe+we));U(Mt,ft,kt,ut,ie,dr)}var Le=ft[2*kt+dr],Pe=qe,Ge=Dt;for(te(Mt,ft,qe,kt),ft[2*Dt+dr]>Le&&te(Mt,ft,qe,Dt);Pe<Ge;){for(te(Mt,ft,Pe,Ge),Pe++,Ge--;ft[2*Pe+dr]<Le;)Pe++;for(;ft[2*Ge+dr]>Le;)Ge--}ft[2*qe+dr]===Le?te(Mt,ft,qe,Ge):(Ge++,te(Mt,ft,Ge,Dt)),Ge<=kt&&(qe=Ge+1),kt<=Ge&&(Dt=Ge-1)}}function te(Mt,ft,kt,qe){ye(Mt,kt,qe),ye(ft,2*kt,2*qe),ye(ft,2*kt+1,2*qe+1)}function ye(Mt,ft,kt){var qe=Mt[ft];Mt[ft]=Mt[kt],Mt[kt]=qe}function y(Mt,ft,kt,qe,Dt,dr,oe){for(var H=[0,Mt.length-1,0],re=[],Be,we;H.length;){var ut=H.pop(),ie=H.pop(),Le=H.pop();if(ie-Le<=oe){for(var Pe=Le;Pe<=ie;Pe++)Be=ft[2*Pe],we=ft[2*Pe+1],Be>=kt&&Be<=Dt&&we>=qe&&we<=dr&&re.push(Mt[Pe]);continue}var Ge=Math.floor((Le+ie)/2);Be=ft[2*Ge],we=ft[2*Ge+1],Be>=kt&&Be<=Dt&&we>=qe&&we<=dr&&re.push(Mt[Ge]);var Vt=(ut+1)%2;(ut===0?kt<=Be:qe<=we)&&(H.push(Le),H.push(Ge-1),H.push(Vt)),(ut===0?Dt>=Be:dr>=we)&&(H.push(Ge+1),H.push(ie),H.push(Vt))}return re}function he(Mt,ft,kt,qe,Dt,dr){for(var oe=[0,Mt.length-1,0],H=[],re=Dt*Dt;oe.length;){var Be=oe.pop(),we=oe.pop(),ut=oe.pop();if(we-ut<=dr){for(var ie=ut;ie<=we;ie++)Z(ft[2*ie],ft[2*ie+1],kt,qe)<=re&&H.push(Mt[ie]);continue}var Le=Math.floor((ut+we)/2),Pe=ft[2*Le],Ge=ft[2*Le+1];Z(Pe,Ge,kt,qe)<=re&&H.push(Mt[Le]);var Vt=(Be+1)%2;(Be===0?kt-Dt<=Pe:qe-Dt<=Ge)&&(oe.push(ut),oe.push(Le-1),oe.push(Vt)),(Be===0?kt+Dt>=Pe:qe+Dt>=Ge)&&(oe.push(Le+1),oe.push(we),oe.push(Vt))}return H}function Z(Mt,ft,kt,qe){var Dt=Mt-kt,dr=ft-qe;return Dt*Dt+dr*dr}var pe=function(Mt){return Mt[0]},fe=function(Mt){return Mt[1]},it=function(ft,kt,qe,Dt,dr){kt===void 0&&(kt=pe),qe===void 0&&(qe=fe),Dt===void 0&&(Dt=64),dr===void 0&&(dr=Float64Array),this.nodeSize=Dt,this.points=ft;for(var oe=ft.length<65536?Uint16Array:Uint32Array,H=this.ids=new oe(ft.length),re=this.coords=new dr(ft.length*2),Be=0;Be<ft.length;Be++)H[Be]=Be,re[2*Be]=kt(ft[Be]),re[2*Be+1]=qe(ft[Be]);ne(H,re,Dt,0,H.length-1,0)};it.prototype.range=function(ft,kt,qe,Dt){return y(this.ids,this.coords,ft,kt,qe,Dt,this.nodeSize)},it.prototype.within=function(ft,kt,qe){return he(this.ids,this.coords,ft,kt,qe,this.nodeSize)};var ce={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(Mt){return Mt}},rt=Math.fround||function(Mt){return function(ft){return Mt[0]=+ft,Mt[0]}}(new Float32Array(1)),vt=function(ft){this.options=Rr(Object.create(ce),ft),this.trees=new Array(this.options.maxZoom+1)};vt.prototype.load=function(ft){var kt=this.options,qe=kt.log,Dt=kt.minZoom,dr=kt.maxZoom,oe=kt.nodeSize;qe&&console.time("total time");var H="prepare "+ft.length+" points";qe&&console.time(H),this.points=ft;for(var re=[],Be=0;Be<ft.length;Be++)ft[Be].geometry&&re.push(Ot(ft[Be],Be));this.trees[dr+1]=new it(re,gr,fr,oe,Float32Array),qe&&console.timeEnd(H);for(var we=dr;we>=Dt;we--){var ut=+Date.now();re=this._cluster(re,we),this.trees[we]=new it(re,gr,fr,oe,Float32Array),qe&&console.log("z%d: %d clusters in %dms",we,re.length,+Date.now()-ut)}return qe&&console.timeEnd("total time"),this},vt.prototype.getClusters=function(ft,kt){var qe=((ft[0]+180)%360+360)%360-180,Dt=Math.max(-90,Math.min(90,ft[1])),dr=ft[2]===180?180:((ft[2]+180)%360+360)%360-180,oe=Math.max(-90,Math.min(90,ft[3]));if(ft[2]-ft[0]>=360)qe=-180,dr=180;else if(qe>dr){var H=this.getClusters([qe,Dt,180,oe],kt),re=this.getClusters([-180,Dt,dr,oe],kt);return H.concat(re)}for(var Be=this.trees[this._limitZoom(kt)],we=Be.range(ar(qe),Zt(oe),ar(dr),Zt(Dt)),ut=[],ie=0,Le=we;ie<Le.length;ie+=1){var Pe=Le[ie],Ge=Be.points[Pe];ut.push(Ge.numPoints?Xt(Ge):this.points[Ge.index])}return ut},vt.prototype.getChildren=function(ft){var kt=this._getOriginId(ft),qe=this._getOriginZoom(ft),Dt="No cluster with the specified id.",dr=this.trees[qe];if(!dr)throw new Error(Dt);var oe=dr.points[kt];if(!oe)throw new Error(Dt);for(var H=this.options.radius/(this.options.extent*Math.pow(2,qe-1)),re=dr.within(oe.x,oe.y,H),Be=[],we=0,ut=re;we<ut.length;we+=1){var ie=ut[we],Le=dr.points[ie];Le.parentId===ft&&Be.push(Le.numPoints?Xt(Le):this.points[Le.index])}if(Be.length===0)throw new Error(Dt);return Be},vt.prototype.getLeaves=function(ft,kt,qe){kt=kt||10,qe=qe||0;var Dt=[];return this._appendLeaves(Dt,ft,kt,qe,0),Dt},vt.prototype.getTile=function(ft,kt,qe){var Dt=this.trees[this._limitZoom(ft)],dr=Math.pow(2,ft),oe=this.options,H=oe.extent,re=oe.radius,Be=re/H,we=(qe-Be)/dr,ut=(qe+1+Be)/dr,ie={features:[]};return this._addTileFeatures(Dt.range((kt-Be)/dr,we,(kt+1+Be)/dr,ut),Dt.points,kt,qe,dr,ie),kt===0&&this._addTileFeatures(Dt.range(1-Be/dr,we,1,ut),Dt.points,dr,qe,dr,ie),kt===dr-1&&this._addTileFeatures(Dt.range(0,we,Be/dr,ut),Dt.points,-1,qe,dr,ie),ie.features.length?ie:null},vt.prototype.getClusterExpansionZoom=function(ft){for(var kt=this._getOriginZoom(ft)-1;kt<=this.options.maxZoom;){var qe=this.getChildren(ft);if(kt++,qe.length!==1)break;ft=qe[0].properties.cluster_id}return kt},vt.prototype._appendLeaves=function(ft,kt,qe,Dt,dr){for(var oe=this.getChildren(kt),H=0,re=oe;H<re.length;H+=1){var Be=re[H],we=Be.properties;if(we&&we.cluster?dr+we.point_count<=Dt?dr+=we.point_count:dr=this._appendLeaves(ft,we.cluster_id,qe,Dt,dr):dr<Dt?dr++:ft.push(Be),ft.length===qe)break}return dr},vt.prototype._addTileFeatures=function(ft,kt,qe,Dt,dr,oe){for(var H=0,re=ft;H<re.length;H+=1){var Be=re[H],we=kt[Be],ut=we.numPoints,ie=void 0,Le=void 0,Pe=void 0;if(ut)ie=Yt(we),Le=we.x,Pe=we.y;else{var Ge=this.points[we.index];ie=Ge.properties,Le=ar(Ge.geometry.coordinates[0]),Pe=Zt(Ge.geometry.coordinates[1])}var Vt={type:1,geometry:[[Math.round(this.options.extent*(Le*dr-qe)),Math.round(this.options.extent*(Pe*dr-Dt))]],tags:ie},Et=void 0;ut?Et=we.id:this.options.generateId?Et=we.index:this.points[we.index].id&&(Et=this.points[we.index].id),Et!==void 0&&(Vt.id=Et),oe.features.push(Vt)}},vt.prototype._limitZoom=function(ft){return Math.max(this.options.minZoom,Math.min(Math.floor(+ft),this.options.maxZoom+1))},vt.prototype._cluster=function(ft,kt){for(var qe=[],Dt=this.options,dr=Dt.radius,oe=Dt.extent,H=Dt.reduce,re=Dt.minPoints,Be=dr/(oe*Math.pow(2,kt)),we=0;we<ft.length;we++){var ut=ft[we];if(!(ut.zoom<=kt)){ut.zoom=kt;for(var ie=this.trees[kt+1],Le=ie.within(ut.x,ut.y,Be),Pe=ut.numPoints||1,Ge=Pe,Vt=0,Et=Le;Vt<Et.length;Vt+=1){var Jr=Et[Vt],on=ie.points[Jr];on.zoom>kt&&(Ge+=on.numPoints||1)}if(Ge>Pe&&Ge>=re){for(var Mr=ut.x*Pe,Dn=ut.y*Pe,bn=H&&Pe>1?this._map(ut,!0):null,rn=(we<<5)+(kt+1)+this.points.length,yi=0,ti=Le;yi<ti.length;yi+=1){var Zi=ti[yi],En=ie.points[Zi];if(!(En.zoom<=kt)){En.zoom=kt;var Rn=En.numPoints||1;Mr+=En.x*Rn,Dn+=En.y*Rn,En.parentId=rn,H&&(bn||(bn=this._map(ut,!0)),H(bn,this._map(En)))}}ut.parentId=rn,qe.push(tt(Mr/Ge,Dn/Ge,rn,Ge,bn))}else if(qe.push(ut),Ge>1)for(var sa=0,ki=Le;sa<ki.length;sa+=1){var ba=ki[sa],fo=ie.points[ba];fo.zoom<=kt||(fo.zoom=kt,qe.push(fo))}}}return qe},vt.prototype._getOriginId=function(ft){return ft-this.points.length>>5},vt.prototype._getOriginZoom=function(ft){return(ft-this.points.length)%32},vt.prototype._map=function(ft,kt){if(ft.numPoints)return kt?Rr({},ft.properties):ft.properties;var qe=this.points[ft.index].properties,Dt=this.options.map(qe);return kt&&Dt===qe?Rr({},Dt):Dt};function tt(Mt,ft,kt,qe,Dt){return{x:rt(Mt),y:rt(ft),zoom:1/0,id:kt,parentId:-1,numPoints:qe,properties:Dt}}function Ot(Mt,ft){var kt=Mt.geometry.coordinates,qe=kt[0],Dt=kt[1];return{x:rt(ar(qe)),y:rt(Zt(Dt)),zoom:1/0,index:ft,parentId:-1}}function Xt(Mt){return{type:"Feature",id:Mt.id,properties:Yt(Mt),geometry:{type:"Point",coordinates:[bt(Mt.x),St(Mt.y)]}}}function Yt(Mt){var ft=Mt.numPoints,kt=ft>=1e4?Math.round(ft/1e3)+"k":ft>=1e3?Math.round(ft/100)/10+"k":ft;return Rr(Rr({},Mt.properties),{cluster:!0,cluster_id:Mt.id,point_count:ft,point_count_abbreviated:kt})}function ar(Mt){return Mt/360+.5}function Zt(Mt){var ft=Math.sin(Mt*Math.PI/180),kt=.5-.25*Math.log((1+ft)/(1-ft))/Math.PI;return kt<0?0:kt>1?1:kt}function bt(Mt){return(Mt-.5)*360}function St(Mt){var ft=(180-Mt*360)*Math.PI/180;return 360*Math.atan(Math.exp(ft))/Math.PI-90}function Rr(Mt,ft){for(var kt in ft)Mt[kt]=ft[kt];return Mt}function gr(Mt){return Mt.x}function fr(Mt){return Mt.y}return vt})},39918:function(sr,ne,U){var te=U(91157).default;function ye(){"use strict";sr.exports=ye=function(){return he},sr.exports.__esModule=!0,sr.exports.default=sr.exports;var y,he={},Z=Object.prototype,pe=Z.hasOwnProperty,fe=Object.defineProperty||function(ie,Le,Pe){ie[Le]=Pe.value},it=typeof Symbol=="function"?Symbol:{},ce=it.iterator||"@@iterator",rt=it.asyncIterator||"@@asyncIterator",vt=it.toStringTag||"@@toStringTag";function tt(ie,Le,Pe){return Object.defineProperty(ie,Le,{value:Pe,enumerable:!0,configurable:!0,writable:!0}),ie[Le]}try{tt({},"")}catch(ie){tt=function(Pe,Ge,Vt){return Pe[Ge]=Vt}}function Ot(ie,Le,Pe,Ge){var Vt=Le&&Le.prototype instanceof Rr?Le:Rr,Et=Object.create(Vt.prototype),Jr=new we(Ge||[]);return fe(Et,"_invoke",{value:oe(ie,Pe,Jr)}),Et}function Xt(ie,Le,Pe){try{return{type:"normal",arg:ie.call(Le,Pe)}}catch(Ge){return{type:"throw",arg:Ge}}}he.wrap=Ot;var Yt="suspendedStart",ar="suspendedYield",Zt="executing",bt="completed",St={};function Rr(){}function gr(){}function fr(){}var Mt={};tt(Mt,ce,function(){return this});var ft=Object.getPrototypeOf,kt=ft&&ft(ft(ut([])));kt&&kt!==Z&&pe.call(kt,ce)&&(Mt=kt);var qe=fr.prototype=Rr.prototype=Object.create(Mt);function Dt(ie){["next","throw","return"].forEach(function(Le){tt(ie,Le,function(Pe){return this._invoke(Le,Pe)})})}function dr(ie,Le){function Pe(Vt,Et,Jr,on){var Mr=Xt(ie[Vt],ie,Et);if(Mr.type!=="throw"){var Dn=Mr.arg,bn=Dn.value;return bn&&te(bn)=="object"&&pe.call(bn,"__await")?Le.resolve(bn.__await).then(function(rn){Pe("next",rn,Jr,on)},function(rn){Pe("throw",rn,Jr,on)}):Le.resolve(bn).then(function(rn){Dn.value=rn,Jr(Dn)},function(rn){return Pe("throw",rn,Jr,on)})}on(Mr.arg)}var Ge;fe(this,"_invoke",{value:function(Et,Jr){function on(){return new Le(function(Mr,Dn){Pe(Et,Jr,Mr,Dn)})}return Ge=Ge?Ge.then(on,on):on()}})}function oe(ie,Le,Pe){var Ge=Yt;return function(Vt,Et){if(Ge===Zt)throw new Error("Generator is already running");if(Ge===bt){if(Vt==="throw")throw Et;return{value:y,done:!0}}for(Pe.method=Vt,Pe.arg=Et;;){var Jr=Pe.delegate;if(Jr){var on=H(Jr,Pe);if(on){if(on===St)continue;return on}}if(Pe.method==="next")Pe.sent=Pe._sent=Pe.arg;else if(Pe.method==="throw"){if(Ge===Yt)throw Ge=bt,Pe.arg;Pe.dispatchException(Pe.arg)}else Pe.method==="return"&&Pe.abrupt("return",Pe.arg);Ge=Zt;var Mr=Xt(ie,Le,Pe);if(Mr.type==="normal"){if(Ge=Pe.done?bt:ar,Mr.arg===St)continue;return{value:Mr.arg,done:Pe.done}}Mr.type==="throw"&&(Ge=bt,Pe.method="throw",Pe.arg=Mr.arg)}}}function H(ie,Le){var Pe=Le.method,Ge=ie.iterator[Pe];if(Ge===y)return Le.delegate=null,Pe==="throw"&&ie.iterator.return&&(Le.method="return",Le.arg=y,H(ie,Le),Le.method==="throw")||Pe!=="return"&&(Le.method="throw",Le.arg=new TypeError("The iterator does not provide a '"+Pe+"' method")),St;var Vt=Xt(Ge,ie.iterator,Le.arg);if(Vt.type==="throw")return Le.method="throw",Le.arg=Vt.arg,Le.delegate=null,St;var Et=Vt.arg;return Et?Et.done?(Le[ie.resultName]=Et.value,Le.next=ie.nextLoc,Le.method!=="return"&&(Le.method="next",Le.arg=y),Le.delegate=null,St):Et:(Le.method="throw",Le.arg=new TypeError("iterator result is not an object"),Le.delegate=null,St)}function re(ie){var Le={tryLoc:ie[0]};1 in ie&&(Le.catchLoc=ie[1]),2 in ie&&(Le.finallyLoc=ie[2],Le.afterLoc=ie[3]),this.tryEntries.push(Le)}function Be(ie){var Le=ie.completion||{};Le.type="normal",delete Le.arg,ie.completion=Le}function we(ie){this.tryEntries=[{tryLoc:"root"}],ie.forEach(re,this),this.reset(!0)}function ut(ie){if(ie||ie===""){var Le=ie[ce];if(Le)return Le.call(ie);if(typeof ie.next=="function")return ie;if(!isNaN(ie.length)){var Pe=-1,Ge=function Vt(){for(;++Pe<ie.length;)if(pe.call(ie,Pe))return Vt.value=ie[Pe],Vt.done=!1,Vt;return Vt.value=y,Vt.done=!0,Vt};return Ge.next=Ge}}throw new TypeError(te(ie)+" is not iterable")}return gr.prototype=fr,fe(qe,"constructor",{value:fr,configurable:!0}),fe(fr,"constructor",{value:gr,configurable:!0}),gr.displayName=tt(fr,vt,"GeneratorFunction"),he.isGeneratorFunction=function(ie){var Le=typeof ie=="function"&&ie.constructor;return!!Le&&(Le===gr||(Le.displayName||Le.name)==="GeneratorFunction")},he.mark=function(ie){return Object.setPrototypeOf?Object.setPrototypeOf(ie,fr):(ie.__proto__=fr,tt(ie,vt,"GeneratorFunction")),ie.prototype=Object.create(qe),ie},he.awrap=function(ie){return{__await:ie}},Dt(dr.prototype),tt(dr.prototype,rt,function(){return this}),he.AsyncIterator=dr,he.async=function(ie,Le,Pe,Ge,Vt){Vt===void 0&&(Vt=Promise);var Et=new dr(Ot(ie,Le,Pe,Ge),Vt);return he.isGeneratorFunction(Le)?Et:Et.next().then(function(Jr){return Jr.done?Jr.value:Et.next()})},Dt(qe),tt(qe,vt,"Generator"),tt(qe,ce,function(){return this}),tt(qe,"toString",function(){return"[object Generator]"}),he.keys=function(ie){var Le=Object(ie),Pe=[];for(var Ge in Le)Pe.push(Ge);return Pe.reverse(),function Vt(){for(;Pe.length;){var Et=Pe.pop();if(Et in Le)return Vt.value=Et,Vt.done=!1,Vt}return Vt.done=!0,Vt}},he.values=ut,we.prototype={constructor:we,reset:function(Le){if(this.prev=0,this.next=0,this.sent=this._sent=y,this.done=!1,this.delegate=null,this.method="next",this.arg=y,this.tryEntries.forEach(Be),!Le)for(var Pe in this)Pe.charAt(0)==="t"&&pe.call(this,Pe)&&!isNaN(+Pe.slice(1))&&(this[Pe]=y)},stop:function(){this.done=!0;var Le=this.tryEntries[0].completion;if(Le.type==="throw")throw Le.arg;return this.rval},dispatchException:function(Le){if(this.done)throw Le;var Pe=this;function Ge(Dn,bn){return Jr.type="throw",Jr.arg=Le,Pe.next=Dn,bn&&(Pe.method="next",Pe.arg=y),!!bn}for(var Vt=this.tryEntries.length-1;Vt>=0;--Vt){var Et=this.tryEntries[Vt],Jr=Et.completion;if(Et.tryLoc==="root")return Ge("end");if(Et.tryLoc<=this.prev){var on=pe.call(Et,"catchLoc"),Mr=pe.call(Et,"finallyLoc");if(on&&Mr){if(this.prev<Et.catchLoc)return Ge(Et.catchLoc,!0);if(this.prev<Et.finallyLoc)return Ge(Et.finallyLoc)}else if(on){if(this.prev<Et.catchLoc)return Ge(Et.catchLoc,!0)}else{if(!Mr)throw new Error("try statement without catch or finally");if(this.prev<Et.finallyLoc)return Ge(Et.finallyLoc)}}}},abrupt:function(Le,Pe){for(var Ge=this.tryEntries.length-1;Ge>=0;--Ge){var Vt=this.tryEntries[Ge];if(Vt.tryLoc<=this.prev&&pe.call(Vt,"finallyLoc")&&this.prev<Vt.finallyLoc){var Et=Vt;break}}Et&&(Le==="break"||Le==="continue")&&Et.tryLoc<=Pe&&Pe<=Et.finallyLoc&&(Et=null);var Jr=Et?Et.completion:{};return Jr.type=Le,Jr.arg=Pe,Et?(this.method="next",this.next=Et.finallyLoc,St):this.complete(Jr)},complete:function(Le,Pe){if(Le.type==="throw")throw Le.arg;return Le.type==="break"||Le.type==="continue"?this.next=Le.arg:Le.type==="return"?(this.rval=this.arg=Le.arg,this.method="return",this.next="end"):Le.type==="normal"&&Pe&&(this.next=Pe),St},finish:function(Le){for(var Pe=this.tryEntries.length-1;Pe>=0;--Pe){var Ge=this.tryEntries[Pe];if(Ge.finallyLoc===Le)return this.complete(Ge.completion,Ge.afterLoc),Be(Ge),St}},catch:function(Le){for(var Pe=this.tryEntries.length-1;Pe>=0;--Pe){var Ge=this.tryEntries[Pe];if(Ge.tryLoc===Le){var Vt=Ge.completion;if(Vt.type==="throw"){var Et=Vt.arg;Be(Ge)}return Et}}throw new Error("illegal catch attempt")},delegateYield:function(Le,Pe,Ge){return this.delegate={iterator:ut(Le),resultName:Pe,nextLoc:Ge},this.method==="next"&&(this.arg=y),St}},he}sr.exports=ye,sr.exports.__esModule=!0,sr.exports.default=sr.exports},91157:function(sr){function ne(U){"@babel/helpers - typeof";return sr.exports=ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},sr.exports.__esModule=!0,sr.exports.default=sr.exports,ne(U)}sr.exports=ne,sr.exports.__esModule=!0,sr.exports.default=sr.exports},22887:function(sr,ne,U){var te=U(39918)();sr.exports=te;try{regeneratorRuntime=te}catch(ye){typeof globalThis=="object"?globalThis.regeneratorRuntime=te:Function("r","regeneratorRuntime = r")(te)}},13351:function(sr,ne,U){var te;(function(ye){(function(y){var he=typeof globalThis=="object"?globalThis:typeof U.g=="object"?U.g:typeof self=="object"?self:typeof this=="object"?this:ce(),Z=pe(ye);typeof he.Reflect!="undefined"&&(Z=pe(he.Reflect,Z)),y(Z,he),typeof he.Reflect=="undefined"&&(he.Reflect=ye);function pe(rt,vt){return function(tt,Ot){Object.defineProperty(rt,tt,{configurable:!0,writable:!0,value:Ot}),vt&&vt(tt,Ot)}}function fe(){try{return Function("return this;")()}catch(rt){}}function it(){try{return(0,eval)("(function() { return this; })()")}catch(rt){}}function ce(){return fe()||it()}})(function(y,he){var Z=Object.prototype.hasOwnProperty,pe=typeof Symbol=="function",fe=pe&&typeof Symbol.toPrimitive!="undefined"?Symbol.toPrimitive:"@@toPrimitive",it=pe&&typeof Symbol.iterator!="undefined"?Symbol.iterator:"@@iterator",ce=typeof Object.create=="function",rt={__proto__:[]}instanceof Array,vt=!ce&&!rt,tt={create:ce?function(){return Gi(Object.create(null))}:rt?function(){return Gi({__proto__:null})}:function(){return Gi({})},has:vt?function(ue,k){return Z.call(ue,k)}:function(ue,k){return k in ue},get:vt?function(ue,k){return Z.call(ue,k)?ue[k]:void 0}:function(ue,k){return ue[k]}},Ot=Object.getPrototypeOf(Function),Xt=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Vr(),Yt=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:en(),ar=typeof WeakMap=="function"?WeakMap:Ln(),Zt=pe?Symbol.for("@reflect-metadata:registry"):void 0,bt=ho(),St=Zo(bt);function Rr(ue,k,z,ae){if(Et(z)){if(!Zi(ue))throw new TypeError;if(!Rn(k))throw new TypeError;return H(ue,k)}else{if(!Zi(ue))throw new TypeError;if(!Mr(k))throw new TypeError;if(!Mr(ae)&&!Et(ae)&&!Jr(ae))throw new TypeError;return Jr(ae)&&(ae=void 0),z=ti(z),re(ue,k,z,ae)}}y("decorate",Rr);function gr(ue,k){function z(ae,Ee){if(!Mr(ae))throw new TypeError;if(!Et(Ee)&&!sa(Ee))throw new TypeError;Le(ue,k,ae,Ee)}return z}y("metadata",gr);function fr(ue,k,z,ae){if(!Mr(z))throw new TypeError;return Et(ae)||(ae=ti(ae)),Le(ue,k,z,ae)}y("defineMetadata",fr);function Mt(ue,k,z){if(!Mr(k))throw new TypeError;return Et(z)||(z=ti(z)),Be(ue,k,z)}y("hasMetadata",Mt);function ft(ue,k,z){if(!Mr(k))throw new TypeError;return Et(z)||(z=ti(z)),we(ue,k,z)}y("hasOwnMetadata",ft);function kt(ue,k,z){if(!Mr(k))throw new TypeError;return Et(z)||(z=ti(z)),ut(ue,k,z)}y("getMetadata",kt);function qe(ue,k,z){if(!Mr(k))throw new TypeError;return Et(z)||(z=ti(z)),ie(ue,k,z)}y("getOwnMetadata",qe);function Dt(ue,k){if(!Mr(ue))throw new TypeError;return Et(k)||(k=ti(k)),Pe(ue,k)}y("getMetadataKeys",Dt);function dr(ue,k){if(!Mr(ue))throw new TypeError;return Et(k)||(k=ti(k)),Ge(ue,k)}y("getOwnMetadataKeys",dr);function oe(ue,k,z){if(!Mr(k))throw new TypeError;if(Et(z)||(z=ti(z)),!Mr(k))throw new TypeError;Et(z)||(z=ti(z));var ae=pr(k,z,!1);return Et(ae)?!1:ae.OrdinaryDeleteMetadata(ue,k,z)}y("deleteMetadata",oe);function H(ue,k){for(var z=ue.length-1;z>=0;--z){var ae=ue[z],Ee=ae(k);if(!Et(Ee)&&!Jr(Ee)){if(!Rn(Ee))throw new TypeError;k=Ee}}return k}function re(ue,k,z,ae){for(var Ee=ue.length-1;Ee>=0;--Ee){var De=ue[Ee],zt=De(k,z,ae);if(!Et(zt)&&!Jr(zt)){if(!Mr(zt))throw new TypeError;ae=zt}}return ae}function Be(ue,k,z){var ae=we(ue,k,z);if(ae)return!0;var Ee=Za(k);return Jr(Ee)?!1:Be(ue,Ee,z)}function we(ue,k,z){var ae=pr(k,z,!1);return Et(ae)?!1:rn(ae.OrdinaryHasOwnMetadata(ue,k,z))}function ut(ue,k,z){var ae=we(ue,k,z);if(ae)return ie(ue,k,z);var Ee=Za(k);if(!Jr(Ee))return ut(ue,Ee,z)}function ie(ue,k,z){var ae=pr(k,z,!1);if(!Et(ae))return ae.OrdinaryGetOwnMetadata(ue,k,z)}function Le(ue,k,z,ae){var Ee=pr(z,ae,!0);Ee.OrdinaryDefineOwnMetadata(ue,k,z,ae)}function Pe(ue,k){var z=Ge(ue,k),ae=Za(ue);if(ae===null)return z;var Ee=Pe(ae,k);if(Ee.length<=0)return z;if(z.length<=0)return Ee;for(var De=new Yt,zt=[],Tt=0,Rt=z;Tt<Rt.length;Tt++){var dt=Rt[Tt],N=De.has(dt);N||(De.add(dt),zt.push(dt))}for(var B=0,$=Ee;B<$.length;B++){var dt=$[B],N=De.has(dt);N||(De.add(dt),zt.push(dt))}return zt}function Ge(ue,k){var z=pr(ue,k,!1);return z?z.OrdinaryOwnMetadataKeys(ue,k):[]}function Vt(ue){if(ue===null)return 1;switch(typeof ue){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return ue===null?1:6;default:return 6}}function Et(ue){return ue===void 0}function Jr(ue){return ue===null}function on(ue){return typeof ue=="symbol"}function Mr(ue){return typeof ue=="object"?ue!==null:typeof ue=="function"}function Dn(ue,k){switch(Vt(ue)){case 0:return ue;case 1:return ue;case 2:return ue;case 3:return ue;case 4:return ue;case 5:return ue}var z=k===3?"string":k===5?"number":"default",ae=ba(ue,fe);if(ae!==void 0){var Ee=ae.call(ue,z);if(Mr(Ee))throw new TypeError;return Ee}return bn(ue,z==="default"?"number":z)}function bn(ue,k){if(k==="string"){var z=ue.toString;if(En(z)){var ae=z.call(ue);if(!Mr(ae))return ae}var Ee=ue.valueOf;if(En(Ee)){var ae=Ee.call(ue);if(!Mr(ae))return ae}}else{var Ee=ue.valueOf;if(En(Ee)){var ae=Ee.call(ue);if(!Mr(ae))return ae}var De=ue.toString;if(En(De)){var ae=De.call(ue);if(!Mr(ae))return ae}}throw new TypeError}function rn(ue){return!!ue}function yi(ue){return""+ue}function ti(ue){var k=Dn(ue,3);return on(k)?k:yi(k)}function Zi(ue){return Array.isArray?Array.isArray(ue):ue instanceof Object?ue instanceof Array:Object.prototype.toString.call(ue)==="[object Array]"}function En(ue){return typeof ue=="function"}function Rn(ue){return typeof ue=="function"}function sa(ue){switch(Vt(ue)){case 3:return!0;case 4:return!0;default:return!1}}function ki(ue,k){return ue===k||ue!==ue&&k!==k}function ba(ue,k){var z=ue[k];if(z!=null){if(!En(z))throw new TypeError;return z}}function fo(ue){var k=ba(ue,it);if(!En(k))throw new TypeError;var z=k.call(ue);if(!Mr(z))throw new TypeError;return z}function Re(ue){return ue.value}function Ea(ue){var k=ue.next();return k.done?!1:k}function va(ue){var k=ue.return;k&&k.call(ue)}function Za(ue){var k=Object.getPrototypeOf(ue);if(typeof ue!="function"||ue===Ot||k!==Ot)return k;var z=ue.prototype,ae=z&&Object.getPrototypeOf(z);if(ae==null||ae===Object.prototype)return k;var Ee=ae.constructor;return typeof Ee!="function"||Ee===ue?k:Ee}function Ms(){var ue;!Et(Zt)&&typeof he.Reflect!="undefined"&&!(Zt in he.Reflect)&&typeof he.Reflect.defineMetadata=="function"&&(ue=jt(he.Reflect));var k,z,ae,Ee=new ar,De={registerProvider:zt,getProvider:Rt,setProvider:N};return De;function zt(B){if(!Object.isExtensible(De))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case ue===B:break;case Et(k):k=B;break;case k===B:break;case Et(z):z=B;break;case z===B:break;default:ae===void 0&&(ae=new Yt),ae.add(B);break}}function Tt(B,$){if(!Et(k)){if(k.isProviderFor(B,$))return k;if(!Et(z)){if(z.isProviderFor(B,$))return k;if(!Et(ae))for(var ee=fo(ae);;){var xe=Ea(ee);if(!xe)return;var Ue=Re(xe);if(Ue.isProviderFor(B,$))return va(ee),Ue}}}if(!Et(ue)&&ue.isProviderFor(B,$))return ue}function Rt(B,$){var ee=Ee.get(B),xe;return Et(ee)||(xe=ee.get($)),Et(xe)&&(xe=Tt(B,$),Et(xe)||(Et(ee)&&(ee=new Xt,Ee.set(B,ee)),ee.set($,xe))),xe}function dt(B){if(Et(B))throw new TypeError;return k===B||z===B||!Et(ae)&&ae.has(B)}function N(B,$,ee){if(!dt(ee))throw new Error("Metadata provider not registered.");var xe=Rt(B,$);if(xe!==ee){if(!Et(xe))return!1;var Ue=Ee.get(B);Et(Ue)&&(Ue=new Xt,Ee.set(B,Ue)),Ue.set($,ee)}return!0}}function ho(){var ue;return!Et(Zt)&&Mr(he.Reflect)&&Object.isExtensible(he.Reflect)&&(ue=he.Reflect[Zt]),Et(ue)&&(ue=Ms()),!Et(Zt)&&Mr(he.Reflect)&&Object.isExtensible(he.Reflect)&&Object.defineProperty(he.Reflect,Zt,{enumerable:!1,configurable:!1,writable:!1,value:ue}),ue}function Zo(ue){var k=new ar,z={isProviderFor:function(dt,N){var B=k.get(dt);return Et(B)?!1:B.has(N)},OrdinaryDefineOwnMetadata:zt,OrdinaryHasOwnMetadata:Ee,OrdinaryGetOwnMetadata:De,OrdinaryOwnMetadataKeys:Tt,OrdinaryDeleteMetadata:Rt};return bt.registerProvider(z),z;function ae(dt,N,B){var $=k.get(dt),ee=!1;if(Et($)){if(!B)return;$=new Xt,k.set(dt,$),ee=!0}var xe=$.get(N);if(Et(xe)){if(!B)return;if(xe=new Xt,$.set(N,xe),!ue.setProvider(dt,N,z))throw $.delete(N),ee&&k.delete(dt),new Error("Wrong provider for target.")}return xe}function Ee(dt,N,B){var $=ae(N,B,!1);return Et($)?!1:rn($.has(dt))}function De(dt,N,B){var $=ae(N,B,!1);if(!Et($))return $.get(dt)}function zt(dt,N,B,$){var ee=ae(B,$,!0);ee.set(dt,N)}function Tt(dt,N){var B=[],$=ae(dt,N,!1);if(Et($))return B;for(var ee=$.keys(),xe=fo(ee),Ue=0;;){var Qe=Ea(xe);if(!Qe)return B.length=Ue,B;var j=Re(Qe);try{B[Ue]=j}catch(Q){try{va(xe)}finally{throw Q}}Ue++}}function Rt(dt,N,B){var $=ae(N,B,!1);if(Et($)||!$.delete(dt))return!1;if($.size===0){var ee=k.get(N);Et(ee)||(ee.delete(B),ee.size===0&&k.delete(ee))}return!0}}function jt(ue){var k=ue.defineMetadata,z=ue.hasOwnMetadata,ae=ue.getOwnMetadata,Ee=ue.getOwnMetadataKeys,De=ue.deleteMetadata,zt=new ar,Tt={isProviderFor:function(Rt,dt){var N=zt.get(Rt);return Et(N)?Ee(Rt,dt).length?(Et(N)&&(N=new Yt,zt.set(Rt,N)),N.add(dt),!0):!1:N.has(dt)},OrdinaryDefineOwnMetadata:k,OrdinaryHasOwnMetadata:z,OrdinaryGetOwnMetadata:ae,OrdinaryOwnMetadataKeys:Ee,OrdinaryDeleteMetadata:De};return Tt}function pr(ue,k,z){var ae=bt.getProvider(ue,k);if(!Et(ae))return ae;if(z){if(bt.setProvider(ue,k,St))return St;throw new Error("Illegal state.")}}function Vr(){var ue={},k=[],z=function(){function Tt(Rt,dt,N){this._index=0,this._keys=Rt,this._values=dt,this._selector=N}return Tt.prototype["@@iterator"]=function(){return this},Tt.prototype[it]=function(){return this},Tt.prototype.next=function(){var Rt=this._index;if(Rt>=0&&Rt<this._keys.length){var dt=this._selector(this._keys[Rt],this._values[Rt]);return Rt+1>=this._keys.length?(this._index=-1,this._keys=k,this._values=k):this._index++,{value:dt,done:!1}}return{value:void 0,done:!0}},Tt.prototype.throw=function(Rt){throw this._index>=0&&(this._index=-1,this._keys=k,this._values=k),Rt},Tt.prototype.return=function(Rt){return this._index>=0&&(this._index=-1,this._keys=k,this._values=k),{value:Rt,done:!0}},Tt}(),ae=function(){function Tt(){this._keys=[],this._values=[],this._cacheKey=ue,this._cacheIndex=-2}return Object.defineProperty(Tt.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Tt.prototype.has=function(Rt){return this._find(Rt,!1)>=0},Tt.prototype.get=function(Rt){var dt=this._find(Rt,!1);return dt>=0?this._values[dt]:void 0},Tt.prototype.set=function(Rt,dt){var N=this._find(Rt,!0);return this._values[N]=dt,this},Tt.prototype.delete=function(Rt){var dt=this._find(Rt,!1);if(dt>=0){for(var N=this._keys.length,B=dt+1;B<N;B++)this._keys[B-1]=this._keys[B],this._values[B-1]=this._values[B];return this._keys.length--,this._values.length--,ki(Rt,this._cacheKey)&&(this._cacheKey=ue,this._cacheIndex=-2),!0}return!1},Tt.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=ue,this._cacheIndex=-2},Tt.prototype.keys=function(){return new z(this._keys,this._values,Ee)},Tt.prototype.values=function(){return new z(this._keys,this._values,De)},Tt.prototype.entries=function(){return new z(this._keys,this._values,zt)},Tt.prototype["@@iterator"]=function(){return this.entries()},Tt.prototype[it]=function(){return this.entries()},Tt.prototype._find=function(Rt,dt){if(!ki(this._cacheKey,Rt)){this._cacheIndex=-1;for(var N=0;N<this._keys.length;N++)if(ki(this._keys[N],Rt)){this._cacheIndex=N;break}}return this._cacheIndex<0&&dt&&(this._cacheIndex=this._keys.length,this._keys.push(Rt),this._values.push(void 0)),this._cacheIndex},Tt}();return ae;function Ee(Tt,Rt){return Tt}function De(Tt,Rt){return Rt}function zt(Tt,Rt){return[Tt,Rt]}}function en(){var ue=function(){function k(){this._map=new Xt}return Object.defineProperty(k.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),k.prototype.has=function(z){return this._map.has(z)},k.prototype.add=function(z){return this._map.set(z,z),this},k.prototype.delete=function(z){return this._map.delete(z)},k.prototype.clear=function(){this._map.clear()},k.prototype.keys=function(){return this._map.keys()},k.prototype.values=function(){return this._map.keys()},k.prototype.entries=function(){return this._map.entries()},k.prototype["@@iterator"]=function(){return this.keys()},k.prototype[it]=function(){return this.keys()},k}();return ue}function Ln(){var ue=16,k=tt.create(),z=ae();return function(){function Rt(){this._key=ae()}return Rt.prototype.has=function(dt){var N=Ee(dt,!1);return N!==void 0?tt.has(N,this._key):!1},Rt.prototype.get=function(dt){var N=Ee(dt,!1);return N!==void 0?tt.get(N,this._key):void 0},Rt.prototype.set=function(dt,N){var B=Ee(dt,!0);return B[this._key]=N,this},Rt.prototype.delete=function(dt){var N=Ee(dt,!1);return N!==void 0?delete N[this._key]:!1},Rt.prototype.clear=function(){this._key=ae()},Rt}();function ae(){var Rt;do Rt="@@WeakMap@@"+Tt();while(tt.has(k,Rt));return k[Rt]=!0,Rt}function Ee(Rt,dt){if(!Z.call(Rt,z)){if(!dt)return;Object.defineProperty(Rt,z,{value:tt.create()})}return Rt[z]}function De(Rt,dt){for(var N=0;N<dt;++N)Rt[N]=Math.random()*255|0;return Rt}function zt(Rt){return typeof Uint8Array=="function"?typeof crypto!="undefined"?crypto.getRandomValues(new Uint8Array(Rt)):typeof msCrypto!="undefined"?msCrypto.getRandomValues(new Uint8Array(Rt)):De(new Uint8Array(Rt),Rt):De(new Array(Rt),Rt)}function Tt(){var Rt=zt(ue);Rt[6]=Rt[6]&79|64,Rt[8]=Rt[8]&191|128;for(var dt="",N=0;N<ue;++N){var B=Rt[N];(N===4||N===6||N===8)&&(dt+="-"),B<16&&(dt+="0"),dt+=B.toString(16).toLowerCase()}return dt}}function Gi(ue){return ue.__=void 0,delete ue.__,ue}})})(te||(te={}))}}]);
|