@mapcatch/util 1.0.10-a → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +53 -0
- package/.prettierrc +4 -0
- package/debug/app.js +22 -0
- package/debug/index.html +52 -0
- package/debug/libs/vue.global.js +16159 -0
- package/debug/my_icon.png +0 -0
- package/docs/Catolog.md +24 -0
- package/docs/Constant.md +92 -0
- package/docs/Event.md +90 -0
- package/docs/Util.md +345 -0
- package/package.json +1 -1
- package/vite.config.js +52 -0
- package/dist/catchUtil.min.esm.js +0 -16617
- package/dist/catchUtil.min.js +0 -282
package/dist/catchUtil.min.js
DELETED
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
(function(ir,cf){typeof exports=="object"&&typeof module<"u"?cf(exports):typeof define=="function"&&define.amd?define(["exports"],cf):(ir=typeof globalThis<"u"?globalThis:ir||self,cf(ir.catchUtil={}))})(this,function(ir){"use strict";let cf;const m_=new Uint8Array(16);function g_(){if(!cf&&(cf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!cf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return cf(m_)}const Nn=[];for(let t=0;t<256;++t)Nn.push((t+256).toString(16).slice(1));function y_(t,n=0){return Nn[t[n+0]]+Nn[t[n+1]]+Nn[t[n+2]]+Nn[t[n+3]]+"-"+Nn[t[n+4]]+Nn[t[n+5]]+"-"+Nn[t[n+6]]+Nn[t[n+7]]+"-"+Nn[t[n+8]]+Nn[t[n+9]]+"-"+Nn[t[n+10]]+Nn[t[n+11]]+Nn[t[n+12]]+Nn[t[n+13]]+Nn[t[n+14]]+Nn[t[n+15]]}const f0={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function b_(t,n,i){if(f0.randomUUID&&!n&&!t)return f0.randomUUID();t=t||{};const f=t.random||(t.rng||g_)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,n){i=i||0;for(let h=0;h<16;++h)n[i+h]=f[h];return n}return y_(f)}//! moment.js
|
|
2
|
-
//! version : 2.30.1
|
|
3
|
-
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
4
|
-
//! license : MIT
|
|
5
|
-
//! momentjs.com
|
|
6
|
-
var s0;function _t(){return s0.apply(null,arguments)}function x_(t){s0=t}function ki(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function Vf(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function Sr(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function Fc(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var n;for(n in t)if(Sr(t,n))return!1;return!0}function jn(t){return t===void 0}function xa(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function No(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function o0(t,n){var i=[],f,h=t.length;for(f=0;f<h;++f)i.push(n(t[f],f));return i}function hf(t,n){for(var i in n)Sr(n,i)&&(t[i]=n[i]);return Sr(n,"toString")&&(t.toString=n.toString),Sr(n,"valueOf")&&(t.valueOf=n.valueOf),t}function ea(t,n,i,f){return F0(t,n,i,f,!0).utc()}function w_(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function tr(t){return t._pf==null&&(t._pf=w_()),t._pf}var Nc;Array.prototype.some?Nc=Array.prototype.some:Nc=function(t){var n=Object(this),i=n.length>>>0,f;for(f=0;f<i;f++)if(f in n&&t.call(this,n[f],f,n))return!0;return!1};function Bc(t){var n=null,i=!1,f=t._d&&!isNaN(t._d.getTime());if(f&&(n=tr(t),i=Nc.call(n.parsedDateParts,function(h){return h!=null}),f=n.overflow<0&&!n.empty&&!n.invalidEra&&!n.invalidMonth&&!n.invalidWeekday&&!n.weekdayMismatch&&!n.nullInput&&!n.invalidFormat&&!n.userInvalidated&&(!n.meridiem||n.meridiem&&i),t._strict&&(f=f&&n.charsLeftOver===0&&n.unusedTokens.length===0&&n.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=f;else return f;return t._isValid}function eu(t){var n=ea(NaN);return t!=null?hf(tr(n),t):tr(n).userInvalidated=!0,n}var l0=_t.momentProperties=[],Pc=!1;function Gc(t,n){var i,f,h,s=l0.length;if(jn(n._isAMomentObject)||(t._isAMomentObject=n._isAMomentObject),jn(n._i)||(t._i=n._i),jn(n._f)||(t._f=n._f),jn(n._l)||(t._l=n._l),jn(n._strict)||(t._strict=n._strict),jn(n._tzm)||(t._tzm=n._tzm),jn(n._isUTC)||(t._isUTC=n._isUTC),jn(n._offset)||(t._offset=n._offset),jn(n._pf)||(t._pf=tr(n)),jn(n._locale)||(t._locale=n._locale),s>0)for(i=0;i<s;i++)f=l0[i],h=n[f],jn(h)||(t[f]=h);return t}function Bo(t){Gc(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Pc===!1&&(Pc=!0,_t.updateOffset(this),Pc=!1)}function Ii(t){return t instanceof Bo||t!=null&&t._isAMomentObject!=null}function u0(t){_t.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Si(t,n){var i=!0;return hf(function(){if(_t.deprecationHandler!=null&&_t.deprecationHandler(null,t),i){var f=[],h,s,u,d=arguments.length;for(s=0;s<d;s++){if(h="",typeof arguments[s]=="object"){h+=`
|
|
7
|
-
[`+s+"] ";for(u in arguments[0])Sr(arguments[0],u)&&(h+=u+": "+arguments[0][u]+", ");h=h.slice(0,-2)}else h=arguments[s];f.push(h)}u0(t+`
|
|
8
|
-
Arguments: `+Array.prototype.slice.call(f).join("")+`
|
|
9
|
-
`+new Error().stack),i=!1}return n.apply(this,arguments)},n)}var c0={};function h0(t,n){_t.deprecationHandler!=null&&_t.deprecationHandler(t,n),c0[t]||(u0(n),c0[t]=!0)}_t.suppressDeprecationWarnings=!1,_t.deprecationHandler=null;function ta(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function S_(t){var n,i;for(i in t)Sr(t,i)&&(n=t[i],ta(n)?this[i]=n:this["_"+i]=n);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Uc(t,n){var i=hf({},t),f;for(f in n)Sr(n,f)&&(Vf(t[f])&&Vf(n[f])?(i[f]={},hf(i[f],t[f]),hf(i[f],n[f])):n[f]!=null?i[f]=n[f]:delete i[f]);for(f in t)Sr(t,f)&&!Sr(n,f)&&Vf(t[f])&&(i[f]=hf({},i[f]));return i}function Yc(t){t!=null&&this.set(t)}var Hc;Object.keys?Hc=Object.keys:Hc=function(t){var n,i=[];for(n in t)Sr(t,n)&&i.push(n);return i};var T_={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function E_(t,n,i){var f=this._calendar[t]||this._calendar.sameElse;return ta(f)?f.call(n,i):f}function ra(t,n,i){var f=""+Math.abs(t),h=n-f.length,s=t>=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,h)).toString().substr(1)+f}var zc=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,tu=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Wc={},Cs={};function It(t,n,i,f){var h=f;typeof f=="string"&&(h=function(){return this[f]()}),t&&(Cs[t]=h),n&&(Cs[n[0]]=function(){return ra(h.apply(this,arguments),n[1],n[2])}),i&&(Cs[i]=function(){return this.localeData().ordinal(h.apply(this,arguments),t)})}function A_(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function D_(t){var n=t.match(zc),i,f;for(i=0,f=n.length;i<f;i++)Cs[n[i]]?n[i]=Cs[n[i]]:n[i]=A_(n[i]);return function(h){var s="",u;for(u=0;u<f;u++)s+=ta(n[u])?n[u].call(h,t):n[u];return s}}function ru(t,n){return t.isValid()?(n=d0(n,t.localeData()),Wc[n]=Wc[n]||D_(n),Wc[n](t)):t.localeData().invalidDate()}function d0(t,n){var i=5;function f(h){return n.longDateFormat(h)||h}for(tu.lastIndex=0;i>=0&&tu.test(t);)t=t.replace(tu,f),tu.lastIndex=0,i-=1;return t}var L_={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function O_(t){var n=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return n||!i?n:(this._longDateFormat[t]=i.match(zc).map(function(f){return f==="MMMM"||f==="MM"||f==="DD"||f==="dddd"?f.slice(1):f}).join(""),this._longDateFormat[t])}var R_="Invalid date";function C_(){return this._invalidDate}var M_="%d",k_=/\d{1,2}/;function I_(t){return this._ordinal.replace("%d",t)}var F_={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function N_(t,n,i,f){var h=this._relativeTime[i];return ta(h)?h(t,n,i,f):h.replace(/%d/i,t)}function B_(t,n){var i=this._relativeTime[t>0?"future":"past"];return ta(i)?i(n):i.replace(/%s/i,n)}var v0={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Ti(t){return typeof t=="string"?v0[t]||v0[t.toLowerCase()]:void 0}function Vc(t){var n={},i,f;for(f in t)Sr(t,f)&&(i=Ti(f),i&&(n[i]=t[f]));return n}var P_={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function G_(t){var n=[],i;for(i in t)Sr(t,i)&&n.push({unit:i,priority:P_[i]});return n.sort(function(f,h){return f.priority-h.priority}),n}var _0=/\d/,oi=/\d\d/,p0=/\d{3}/,$c=/\d{4}/,nu=/[+-]?\d{6}/,Gr=/\d\d?/,m0=/\d\d\d\d?/,g0=/\d\d\d\d\d\d?/,iu=/\d{1,3}/,Zc=/\d{1,4}/,au=/[+-]?\d{1,6}/,Ms=/\d+/,fu=/[+-]?\d+/,U_=/Z|[+-]\d\d:?\d\d/gi,su=/Z|[+-]\d\d(?::?\d\d)?/gi,Y_=/[+-]?\d+(\.\d{1,3})?/,Po=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ks=/^[1-9]\d?/,Xc=/^([1-9]\d|\d)/,ou;ou={};function xt(t,n,i){ou[t]=ta(n)?n:function(f,h){return f&&i?i:n}}function H_(t,n){return Sr(ou,t)?ou[t](n._strict,n._locale):new RegExp(z_(t))}function z_(t){return wa(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(n,i,f,h,s){return i||f||h||s}))}function wa(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ei(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function _r(t){var n=+t,i=0;return n!==0&&isFinite(n)&&(i=Ei(n)),i}var qc={};function kr(t,n){var i,f=n,h;for(typeof t=="string"&&(t=[t]),xa(n)&&(f=function(s,u){u[n]=_r(s)}),h=t.length,i=0;i<h;i++)qc[t[i]]=f}function Go(t,n){kr(t,function(i,f,h,s){h._w=h._w||{},n(i,h._w,h,s)})}function W_(t,n,i){n!=null&&Sr(qc,t)&&qc[t](n,i._a,i,t)}function lu(t){return t%4===0&&t%100!==0||t%400===0}var Yn=0,Sa=1,na=2,bn=3,Fi=4,Ta=5,$f=6,V_=7,$_=8;It("Y",0,0,function(){var t=this.year();return t<=9999?ra(t,4):"+"+t}),It(0,["YY",2],0,function(){return this.year()%100}),It(0,["YYYY",4],0,"year"),It(0,["YYYYY",5],0,"year"),It(0,["YYYYYY",6,!0],0,"year"),xt("Y",fu),xt("YY",Gr,oi),xt("YYYY",Zc,$c),xt("YYYYY",au,nu),xt("YYYYYY",au,nu),kr(["YYYYY","YYYYYY"],Yn),kr("YYYY",function(t,n){n[Yn]=t.length===2?_t.parseTwoDigitYear(t):_r(t)}),kr("YY",function(t,n){n[Yn]=_t.parseTwoDigitYear(t)}),kr("Y",function(t,n){n[Yn]=parseInt(t,10)});function Uo(t){return lu(t)?366:365}_t.parseTwoDigitYear=function(t){return _r(t)+(_r(t)>68?1900:2e3)};var y0=Is("FullYear",!0);function Z_(){return lu(this.year())}function Is(t,n){return function(i){return i!=null?(b0(this,t,i),_t.updateOffset(this,n),this):Yo(this,t)}}function Yo(t,n){if(!t.isValid())return NaN;var i=t._d,f=t._isUTC;switch(n){case"Milliseconds":return f?i.getUTCMilliseconds():i.getMilliseconds();case"Seconds":return f?i.getUTCSeconds():i.getSeconds();case"Minutes":return f?i.getUTCMinutes():i.getMinutes();case"Hours":return f?i.getUTCHours():i.getHours();case"Date":return f?i.getUTCDate():i.getDate();case"Day":return f?i.getUTCDay():i.getDay();case"Month":return f?i.getUTCMonth():i.getMonth();case"FullYear":return f?i.getUTCFullYear():i.getFullYear();default:return NaN}}function b0(t,n,i){var f,h,s,u,d;if(!(!t.isValid()||isNaN(i))){switch(f=t._d,h=t._isUTC,n){case"Milliseconds":return void(h?f.setUTCMilliseconds(i):f.setMilliseconds(i));case"Seconds":return void(h?f.setUTCSeconds(i):f.setSeconds(i));case"Minutes":return void(h?f.setUTCMinutes(i):f.setMinutes(i));case"Hours":return void(h?f.setUTCHours(i):f.setHours(i));case"Date":return void(h?f.setUTCDate(i):f.setDate(i));case"FullYear":break;default:return}s=i,u=t.month(),d=t.date(),d=d===29&&u===1&&!lu(s)?28:d,h?f.setUTCFullYear(s,u,d):f.setFullYear(s,u,d)}}function X_(t){return t=Ti(t),ta(this[t])?this[t]():this}function q_(t,n){if(typeof t=="object"){t=Vc(t);var i=G_(t),f,h=i.length;for(f=0;f<h;f++)this[i[f].unit](t[i[f].unit])}else if(t=Ti(t),ta(this[t]))return this[t](n);return this}function K_(t,n){return(t%n+n)%n}var nn;Array.prototype.indexOf?nn=Array.prototype.indexOf:nn=function(t){var n;for(n=0;n<this.length;++n)if(this[n]===t)return n;return-1};function Kc(t,n){if(isNaN(t)||isNaN(n))return NaN;var i=K_(n,12);return t+=(n-i)/12,i===1?lu(t)?29:28:31-i%7%2}It("M",["MM",2],"Mo",function(){return this.month()+1}),It("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),It("MMMM",0,0,function(t){return this.localeData().months(this,t)}),xt("M",Gr,ks),xt("MM",Gr,oi),xt("MMM",function(t,n){return n.monthsShortRegex(t)}),xt("MMMM",function(t,n){return n.monthsRegex(t)}),kr(["M","MM"],function(t,n){n[Sa]=_r(t)-1}),kr(["MMM","MMMM"],function(t,n,i,f){var h=i._locale.monthsParse(t,f,i._strict);h!=null?n[Sa]=h:tr(i).invalidMonth=t});var j_="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),x0="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),w0=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Q_=Po,J_=Po;function ep(t,n){return t?ki(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||w0).test(n)?"format":"standalone"][t.month()]:ki(this._months)?this._months:this._months.standalone}function tp(t,n){return t?ki(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[w0.test(n)?"format":"standalone"][t.month()]:ki(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function rp(t,n,i){var f,h,s,u=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],f=0;f<12;++f)s=ea([2e3,f]),this._shortMonthsParse[f]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[f]=this.months(s,"").toLocaleLowerCase();return i?n==="MMM"?(h=nn.call(this._shortMonthsParse,u),h!==-1?h:null):(h=nn.call(this._longMonthsParse,u),h!==-1?h:null):n==="MMM"?(h=nn.call(this._shortMonthsParse,u),h!==-1?h:(h=nn.call(this._longMonthsParse,u),h!==-1?h:null)):(h=nn.call(this._longMonthsParse,u),h!==-1?h:(h=nn.call(this._shortMonthsParse,u),h!==-1?h:null))}function np(t,n,i){var f,h,s;if(this._monthsParseExact)return rp.call(this,t,n,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),f=0;f<12;f++){if(h=ea([2e3,f]),i&&!this._longMonthsParse[f]&&(this._longMonthsParse[f]=new RegExp("^"+this.months(h,"").replace(".","")+"$","i"),this._shortMonthsParse[f]=new RegExp("^"+this.monthsShort(h,"").replace(".","")+"$","i")),!i&&!this._monthsParse[f]&&(s="^"+this.months(h,"")+"|^"+this.monthsShort(h,""),this._monthsParse[f]=new RegExp(s.replace(".",""),"i")),i&&n==="MMMM"&&this._longMonthsParse[f].test(t))return f;if(i&&n==="MMM"&&this._shortMonthsParse[f].test(t))return f;if(!i&&this._monthsParse[f].test(t))return f}}function S0(t,n){if(!t.isValid())return t;if(typeof n=="string"){if(/^\d+$/.test(n))n=_r(n);else if(n=t.localeData().monthsParse(n),!xa(n))return t}var i=n,f=t.date();return f=f<29?f:Math.min(f,Kc(t.year(),i)),t._isUTC?t._d.setUTCMonth(i,f):t._d.setMonth(i,f),t}function T0(t){return t!=null?(S0(this,t),_t.updateOffset(this,!0),this):Yo(this,"Month")}function ip(){return Kc(this.year(),this.month())}function ap(t){return this._monthsParseExact?(Sr(this,"_monthsRegex")||E0.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(Sr(this,"_monthsShortRegex")||(this._monthsShortRegex=Q_),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function fp(t){return this._monthsParseExact?(Sr(this,"_monthsRegex")||E0.call(this),t?this._monthsStrictRegex:this._monthsRegex):(Sr(this,"_monthsRegex")||(this._monthsRegex=J_),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function E0(){function t(v,M){return M.length-v.length}var n=[],i=[],f=[],h,s,u,d;for(h=0;h<12;h++)s=ea([2e3,h]),u=wa(this.monthsShort(s,"")),d=wa(this.months(s,"")),n.push(u),i.push(d),f.push(d),f.push(u);n.sort(t),i.sort(t),f.sort(t),this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function sp(t,n,i,f,h,s,u){var d;return t<100&&t>=0?(d=new Date(t+400,n,i,f,h,s,u),isFinite(d.getFullYear())&&d.setFullYear(t)):d=new Date(t,n,i,f,h,s,u),d}function Ho(t){var n,i;return t<100&&t>=0?(i=Array.prototype.slice.call(arguments),i[0]=t+400,n=new Date(Date.UTC.apply(null,i)),isFinite(n.getUTCFullYear())&&n.setUTCFullYear(t)):n=new Date(Date.UTC.apply(null,arguments)),n}function uu(t,n,i){var f=7+n-i,h=(7+Ho(t,0,f).getUTCDay()-n)%7;return-h+f-1}function A0(t,n,i,f,h){var s=(7+i-f)%7,u=uu(t,f,h),d=1+7*(n-1)+s+u,v,M;return d<=0?(v=t-1,M=Uo(v)+d):d>Uo(t)?(v=t+1,M=d-Uo(t)):(v=t,M=d),{year:v,dayOfYear:M}}function zo(t,n,i){var f=uu(t.year(),n,i),h=Math.floor((t.dayOfYear()-f-1)/7)+1,s,u;return h<1?(u=t.year()-1,s=h+Ea(u,n,i)):h>Ea(t.year(),n,i)?(s=h-Ea(t.year(),n,i),u=t.year()+1):(u=t.year(),s=h),{week:s,year:u}}function Ea(t,n,i){var f=uu(t,n,i),h=uu(t+1,n,i);return(Uo(t)-f+h)/7}It("w",["ww",2],"wo","week"),It("W",["WW",2],"Wo","isoWeek"),xt("w",Gr,ks),xt("ww",Gr,oi),xt("W",Gr,ks),xt("WW",Gr,oi),Go(["w","ww","W","WW"],function(t,n,i,f){n[f.substr(0,1)]=_r(t)});function op(t){return zo(t,this._week.dow,this._week.doy).week}var lp={dow:0,doy:6};function up(){return this._week.dow}function cp(){return this._week.doy}function hp(t){var n=this.localeData().week(this);return t==null?n:this.add((t-n)*7,"d")}function dp(t){var n=zo(this,1,4).week;return t==null?n:this.add((t-n)*7,"d")}It("d",0,"do","day"),It("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),It("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),It("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),It("e",0,0,"weekday"),It("E",0,0,"isoWeekday"),xt("d",Gr),xt("e",Gr),xt("E",Gr),xt("dd",function(t,n){return n.weekdaysMinRegex(t)}),xt("ddd",function(t,n){return n.weekdaysShortRegex(t)}),xt("dddd",function(t,n){return n.weekdaysRegex(t)}),Go(["dd","ddd","dddd"],function(t,n,i,f){var h=i._locale.weekdaysParse(t,f,i._strict);h!=null?n.d=h:tr(i).invalidWeekday=t}),Go(["d","e","E"],function(t,n,i,f){n[f]=_r(t)});function vp(t,n){return typeof t!="string"?t:isNaN(t)?(t=n.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function _p(t,n){return typeof t=="string"?n.weekdaysParse(t)%7||7:isNaN(t)?null:t}function jc(t,n){return t.slice(n,7).concat(t.slice(0,n))}var pp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),D0="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),mp="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),gp=Po,yp=Po,bp=Po;function xp(t,n){var i=ki(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(n)?"format":"standalone"];return t===!0?jc(i,this._week.dow):t?i[t.day()]:i}function wp(t){return t===!0?jc(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Sp(t){return t===!0?jc(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Tp(t,n,i){var f,h,s,u=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],f=0;f<7;++f)s=ea([2e3,1]).day(f),this._minWeekdaysParse[f]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[f]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[f]=this.weekdays(s,"").toLocaleLowerCase();return i?n==="dddd"?(h=nn.call(this._weekdaysParse,u),h!==-1?h:null):n==="ddd"?(h=nn.call(this._shortWeekdaysParse,u),h!==-1?h:null):(h=nn.call(this._minWeekdaysParse,u),h!==-1?h:null):n==="dddd"?(h=nn.call(this._weekdaysParse,u),h!==-1||(h=nn.call(this._shortWeekdaysParse,u),h!==-1)?h:(h=nn.call(this._minWeekdaysParse,u),h!==-1?h:null)):n==="ddd"?(h=nn.call(this._shortWeekdaysParse,u),h!==-1||(h=nn.call(this._weekdaysParse,u),h!==-1)?h:(h=nn.call(this._minWeekdaysParse,u),h!==-1?h:null)):(h=nn.call(this._minWeekdaysParse,u),h!==-1||(h=nn.call(this._weekdaysParse,u),h!==-1)?h:(h=nn.call(this._shortWeekdaysParse,u),h!==-1?h:null))}function Ep(t,n,i){var f,h,s;if(this._weekdaysParseExact)return Tp.call(this,t,n,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),f=0;f<7;f++){if(h=ea([2e3,1]).day(f),i&&!this._fullWeekdaysParse[f]&&(this._fullWeekdaysParse[f]=new RegExp("^"+this.weekdays(h,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[f]=new RegExp("^"+this.weekdaysShort(h,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[f]=new RegExp("^"+this.weekdaysMin(h,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[f]||(s="^"+this.weekdays(h,"")+"|^"+this.weekdaysShort(h,"")+"|^"+this.weekdaysMin(h,""),this._weekdaysParse[f]=new RegExp(s.replace(".",""),"i")),i&&n==="dddd"&&this._fullWeekdaysParse[f].test(t))return f;if(i&&n==="ddd"&&this._shortWeekdaysParse[f].test(t))return f;if(i&&n==="dd"&&this._minWeekdaysParse[f].test(t))return f;if(!i&&this._weekdaysParse[f].test(t))return f}}function Ap(t){if(!this.isValid())return t!=null?this:NaN;var n=Yo(this,"Day");return t!=null?(t=vp(t,this.localeData()),this.add(t-n,"d")):n}function Dp(t){if(!this.isValid())return t!=null?this:NaN;var n=(this.day()+7-this.localeData()._week.dow)%7;return t==null?n:this.add(t-n,"d")}function Lp(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var n=_p(t,this.localeData());return this.day(this.day()%7?n:n-7)}else return this.day()||7}function Op(t){return this._weekdaysParseExact?(Sr(this,"_weekdaysRegex")||Qc.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Sr(this,"_weekdaysRegex")||(this._weekdaysRegex=gp),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Rp(t){return this._weekdaysParseExact?(Sr(this,"_weekdaysRegex")||Qc.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Sr(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=yp),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Cp(t){return this._weekdaysParseExact?(Sr(this,"_weekdaysRegex")||Qc.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Sr(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=bp),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qc(){function t(k,g){return g.length-k.length}var n=[],i=[],f=[],h=[],s,u,d,v,M;for(s=0;s<7;s++)u=ea([2e3,1]).day(s),d=wa(this.weekdaysMin(u,"")),v=wa(this.weekdaysShort(u,"")),M=wa(this.weekdays(u,"")),n.push(d),i.push(v),f.push(M),h.push(d),h.push(v),h.push(M);n.sort(t),i.sort(t),f.sort(t),h.sort(t),this._weekdaysRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+f.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Jc(){return this.hours()%12||12}function Mp(){return this.hours()||24}It("H",["HH",2],0,"hour"),It("h",["hh",2],0,Jc),It("k",["kk",2],0,Mp),It("hmm",0,0,function(){return""+Jc.apply(this)+ra(this.minutes(),2)}),It("hmmss",0,0,function(){return""+Jc.apply(this)+ra(this.minutes(),2)+ra(this.seconds(),2)}),It("Hmm",0,0,function(){return""+this.hours()+ra(this.minutes(),2)}),It("Hmmss",0,0,function(){return""+this.hours()+ra(this.minutes(),2)+ra(this.seconds(),2)});function L0(t,n){It(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),n)})}L0("a",!0),L0("A",!1);function O0(t,n){return n._meridiemParse}xt("a",O0),xt("A",O0),xt("H",Gr,Xc),xt("h",Gr,ks),xt("k",Gr,ks),xt("HH",Gr,oi),xt("hh",Gr,oi),xt("kk",Gr,oi),xt("hmm",m0),xt("hmmss",g0),xt("Hmm",m0),xt("Hmmss",g0),kr(["H","HH"],bn),kr(["k","kk"],function(t,n,i){var f=_r(t);n[bn]=f===24?0:f}),kr(["a","A"],function(t,n,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),kr(["h","hh"],function(t,n,i){n[bn]=_r(t),tr(i).bigHour=!0}),kr("hmm",function(t,n,i){var f=t.length-2;n[bn]=_r(t.substr(0,f)),n[Fi]=_r(t.substr(f)),tr(i).bigHour=!0}),kr("hmmss",function(t,n,i){var f=t.length-4,h=t.length-2;n[bn]=_r(t.substr(0,f)),n[Fi]=_r(t.substr(f,2)),n[Ta]=_r(t.substr(h)),tr(i).bigHour=!0}),kr("Hmm",function(t,n,i){var f=t.length-2;n[bn]=_r(t.substr(0,f)),n[Fi]=_r(t.substr(f))}),kr("Hmmss",function(t,n,i){var f=t.length-4,h=t.length-2;n[bn]=_r(t.substr(0,f)),n[Fi]=_r(t.substr(f,2)),n[Ta]=_r(t.substr(h))});function kp(t){return(t+"").toLowerCase().charAt(0)==="p"}var Ip=/[ap]\.?m?\.?/i,Fp=Is("Hours",!0);function Np(t,n,i){return t>11?i?"pm":"PM":i?"am":"AM"}var R0={calendar:T_,longDateFormat:L_,invalidDate:R_,ordinal:M_,dayOfMonthOrdinalParse:k_,relativeTime:F_,months:j_,monthsShort:x0,week:lp,weekdays:pp,weekdaysMin:mp,weekdaysShort:D0,meridiemParse:Ip},$r={},Wo={},Vo;function Bp(t,n){var i,f=Math.min(t.length,n.length);for(i=0;i<f;i+=1)if(t[i]!==n[i])return i;return f}function C0(t){return t&&t.toLowerCase().replace("_","-")}function Pp(t){for(var n=0,i,f,h,s;n<t.length;){for(s=C0(t[n]).split("-"),i=s.length,f=C0(t[n+1]),f=f?f.split("-"):null;i>0;){if(h=cu(s.slice(0,i).join("-")),h)return h;if(f&&f.length>=i&&Bp(s,f)>=i-1)break;i--}n++}return Vo}function Gp(t){return!!(t&&t.match("^[^/\\\\]*$"))}function cu(t){var n=null,i;if($r[t]===void 0&&typeof module<"u"&&module&&module.exports&&Gp(t))try{n=Vo._abbr,i=require,i("./locale/"+t),df(n)}catch{$r[t]=null}return $r[t]}function df(t,n){var i;return t&&(jn(n)?i=Aa(t):i=eh(t,n),i?Vo=i:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Vo._abbr}function eh(t,n){if(n!==null){var i,f=R0;if(n.abbr=t,$r[t]!=null)h0("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),f=$r[t]._config;else if(n.parentLocale!=null)if($r[n.parentLocale]!=null)f=$r[n.parentLocale]._config;else if(i=cu(n.parentLocale),i!=null)f=i._config;else return Wo[n.parentLocale]||(Wo[n.parentLocale]=[]),Wo[n.parentLocale].push({name:t,config:n}),null;return $r[t]=new Yc(Uc(f,n)),Wo[t]&&Wo[t].forEach(function(h){eh(h.name,h.config)}),df(t),$r[t]}else return delete $r[t],null}function Up(t,n){if(n!=null){var i,f,h=R0;$r[t]!=null&&$r[t].parentLocale!=null?$r[t].set(Uc($r[t]._config,n)):(f=cu(t),f!=null&&(h=f._config),n=Uc(h,n),f==null&&(n.abbr=t),i=new Yc(n),i.parentLocale=$r[t],$r[t]=i),df(t)}else $r[t]!=null&&($r[t].parentLocale!=null?($r[t]=$r[t].parentLocale,t===df()&&df(t)):$r[t]!=null&&delete $r[t]);return $r[t]}function Aa(t){var n;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Vo;if(!ki(t)){if(n=cu(t),n)return n;t=[t]}return Pp(t)}function Yp(){return Hc($r)}function th(t){var n,i=t._a;return i&&tr(t).overflow===-2&&(n=i[Sa]<0||i[Sa]>11?Sa:i[na]<1||i[na]>Kc(i[Yn],i[Sa])?na:i[bn]<0||i[bn]>24||i[bn]===24&&(i[Fi]!==0||i[Ta]!==0||i[$f]!==0)?bn:i[Fi]<0||i[Fi]>59?Fi:i[Ta]<0||i[Ta]>59?Ta:i[$f]<0||i[$f]>999?$f:-1,tr(t)._overflowDayOfYear&&(n<Yn||n>na)&&(n=na),tr(t)._overflowWeeks&&n===-1&&(n=V_),tr(t)._overflowWeekday&&n===-1&&(n=$_),tr(t).overflow=n),t}var Hp=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,zp=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Wp=/Z|[+-]\d\d(?::?\d\d)?/,hu=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],rh=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Vp=/^\/?Date\((-?\d+)/i,$p=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Zp={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function M0(t){var n,i,f=t._i,h=Hp.exec(f)||zp.exec(f),s,u,d,v,M=hu.length,k=rh.length;if(h){for(tr(t).iso=!0,n=0,i=M;n<i;n++)if(hu[n][1].exec(h[1])){u=hu[n][0],s=hu[n][2]!==!1;break}if(u==null){t._isValid=!1;return}if(h[3]){for(n=0,i=k;n<i;n++)if(rh[n][1].exec(h[3])){d=(h[2]||" ")+rh[n][0];break}if(d==null){t._isValid=!1;return}}if(!s&&d!=null){t._isValid=!1;return}if(h[4])if(Wp.exec(h[4]))v="Z";else{t._isValid=!1;return}t._f=u+(d||"")+(v||""),ih(t)}else t._isValid=!1}function Xp(t,n,i,f,h,s){var u=[qp(t),x0.indexOf(n),parseInt(i,10),parseInt(f,10),parseInt(h,10)];return s&&u.push(parseInt(s,10)),u}function qp(t){var n=parseInt(t,10);return n<=49?2e3+n:n<=999?1900+n:n}function Kp(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function jp(t,n,i){if(t){var f=D0.indexOf(t),h=new Date(n[0],n[1],n[2]).getDay();if(f!==h)return tr(i).weekdayMismatch=!0,i._isValid=!1,!1}return!0}function Qp(t,n,i){if(t)return Zp[t];if(n)return 0;var f=parseInt(i,10),h=f%100,s=(f-h)/100;return s*60+h}function k0(t){var n=$p.exec(Kp(t._i)),i;if(n){if(i=Xp(n[4],n[3],n[2],n[5],n[6],n[7]),!jp(n[1],i,t))return;t._a=i,t._tzm=Qp(n[8],n[9],n[10]),t._d=Ho.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),tr(t).rfc2822=!0}else t._isValid=!1}function Jp(t){var n=Vp.exec(t._i);if(n!==null){t._d=new Date(+n[1]);return}if(M0(t),t._isValid===!1)delete t._isValid;else return;if(k0(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:_t.createFromInputFallback(t)}_t.createFromInputFallback=Si("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function Fs(t,n,i){return t!=null?t:n!=null?n:i}function em(t){var n=new Date(_t.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function nh(t){var n,i,f=[],h,s,u;if(!t._d){for(h=em(t),t._w&&t._a[na]==null&&t._a[Sa]==null&&tm(t),t._dayOfYear!=null&&(u=Fs(t._a[Yn],h[Yn]),(t._dayOfYear>Uo(u)||t._dayOfYear===0)&&(tr(t)._overflowDayOfYear=!0),i=Ho(u,0,t._dayOfYear),t._a[Sa]=i.getUTCMonth(),t._a[na]=i.getUTCDate()),n=0;n<3&&t._a[n]==null;++n)t._a[n]=f[n]=h[n];for(;n<7;n++)t._a[n]=f[n]=t._a[n]==null?n===2?1:0:t._a[n];t._a[bn]===24&&t._a[Fi]===0&&t._a[Ta]===0&&t._a[$f]===0&&(t._nextDay=!0,t._a[bn]=0),t._d=(t._useUTC?Ho:sp).apply(null,f),s=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[bn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==s&&(tr(t).weekdayMismatch=!0)}}function tm(t){var n,i,f,h,s,u,d,v,M;n=t._w,n.GG!=null||n.W!=null||n.E!=null?(s=1,u=4,i=Fs(n.GG,t._a[Yn],zo(Ur(),1,4).year),f=Fs(n.W,1),h=Fs(n.E,1),(h<1||h>7)&&(v=!0)):(s=t._locale._week.dow,u=t._locale._week.doy,M=zo(Ur(),s,u),i=Fs(n.gg,t._a[Yn],M.year),f=Fs(n.w,M.week),n.d!=null?(h=n.d,(h<0||h>6)&&(v=!0)):n.e!=null?(h=n.e+s,(n.e<0||n.e>6)&&(v=!0)):h=s),f<1||f>Ea(i,s,u)?tr(t)._overflowWeeks=!0:v!=null?tr(t)._overflowWeekday=!0:(d=A0(i,f,h,s,u),t._a[Yn]=d.year,t._dayOfYear=d.dayOfYear)}_t.ISO_8601=function(){},_t.RFC_2822=function(){};function ih(t){if(t._f===_t.ISO_8601){M0(t);return}if(t._f===_t.RFC_2822){k0(t);return}t._a=[],tr(t).empty=!0;var n=""+t._i,i,f,h,s,u,d=n.length,v=0,M,k;for(h=d0(t._f,t._locale).match(zc)||[],k=h.length,i=0;i<k;i++)s=h[i],f=(n.match(H_(s,t))||[])[0],f&&(u=n.substr(0,n.indexOf(f)),u.length>0&&tr(t).unusedInput.push(u),n=n.slice(n.indexOf(f)+f.length),v+=f.length),Cs[s]?(f?tr(t).empty=!1:tr(t).unusedTokens.push(s),W_(s,f,t)):t._strict&&!f&&tr(t).unusedTokens.push(s);tr(t).charsLeftOver=d-v,n.length>0&&tr(t).unusedInput.push(n),t._a[bn]<=12&&tr(t).bigHour===!0&&t._a[bn]>0&&(tr(t).bigHour=void 0),tr(t).parsedDateParts=t._a.slice(0),tr(t).meridiem=t._meridiem,t._a[bn]=rm(t._locale,t._a[bn],t._meridiem),M=tr(t).era,M!==null&&(t._a[Yn]=t._locale.erasConvertYear(M,t._a[Yn])),nh(t),th(t)}function rm(t,n,i){var f;return i==null?n:t.meridiemHour!=null?t.meridiemHour(n,i):(t.isPM!=null&&(f=t.isPM(i),f&&n<12&&(n+=12),!f&&n===12&&(n=0)),n)}function nm(t){var n,i,f,h,s,u,d=!1,v=t._f.length;if(v===0){tr(t).invalidFormat=!0,t._d=new Date(NaN);return}for(h=0;h<v;h++)s=0,u=!1,n=Gc({},t),t._useUTC!=null&&(n._useUTC=t._useUTC),n._f=t._f[h],ih(n),Bc(n)&&(u=!0),s+=tr(n).charsLeftOver,s+=tr(n).unusedTokens.length*10,tr(n).score=s,d?s<f&&(f=s,i=n):(f==null||s<f||u)&&(f=s,i=n,u&&(d=!0));hf(t,i||n)}function im(t){if(!t._d){var n=Vc(t._i),i=n.day===void 0?n.date:n.day;t._a=o0([n.year,n.month,i,n.hour,n.minute,n.second,n.millisecond],function(f){return f&&parseInt(f,10)}),nh(t)}}function am(t){var n=new Bo(th(I0(t)));return n._nextDay&&(n.add(1,"d"),n._nextDay=void 0),n}function I0(t){var n=t._i,i=t._f;return t._locale=t._locale||Aa(t._l),n===null||i===void 0&&n===""?eu({nullInput:!0}):(typeof n=="string"&&(t._i=n=t._locale.preparse(n)),Ii(n)?new Bo(th(n)):(No(n)?t._d=n:ki(i)?nm(t):i?ih(t):fm(t),Bc(t)||(t._d=null),t))}function fm(t){var n=t._i;jn(n)?t._d=new Date(_t.now()):No(n)?t._d=new Date(n.valueOf()):typeof n=="string"?Jp(t):ki(n)?(t._a=o0(n.slice(0),function(i){return parseInt(i,10)}),nh(t)):Vf(n)?im(t):xa(n)?t._d=new Date(n):_t.createFromInputFallback(t)}function F0(t,n,i,f,h){var s={};return(n===!0||n===!1)&&(f=n,n=void 0),(i===!0||i===!1)&&(f=i,i=void 0),(Vf(t)&&Fc(t)||ki(t)&&t.length===0)&&(t=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=h,s._l=i,s._i=t,s._f=n,s._strict=f,am(s)}function Ur(t,n,i,f){return F0(t,n,i,f,!1)}var sm=Si("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Ur.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:eu()}),om=Si("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Ur.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:eu()});function N0(t,n){var i,f;if(n.length===1&&ki(n[0])&&(n=n[0]),!n.length)return Ur();for(i=n[0],f=1;f<n.length;++f)(!n[f].isValid()||n[f][t](i))&&(i=n[f]);return i}function lm(){var t=[].slice.call(arguments,0);return N0("isBefore",t)}function um(){var t=[].slice.call(arguments,0);return N0("isAfter",t)}var cm=function(){return Date.now?Date.now():+new Date},$o=["year","quarter","month","week","day","hour","minute","second","millisecond"];function hm(t){var n,i=!1,f,h=$o.length;for(n in t)if(Sr(t,n)&&!(nn.call($o,n)!==-1&&(t[n]==null||!isNaN(t[n]))))return!1;for(f=0;f<h;++f)if(t[$o[f]]){if(i)return!1;parseFloat(t[$o[f]])!==_r(t[$o[f]])&&(i=!0)}return!0}function dm(){return this._isValid}function vm(){return Ni(NaN)}function du(t){var n=Vc(t),i=n.year||0,f=n.quarter||0,h=n.month||0,s=n.week||n.isoWeek||0,u=n.day||0,d=n.hour||0,v=n.minute||0,M=n.second||0,k=n.millisecond||0;this._isValid=hm(n),this._milliseconds=+k+M*1e3+v*6e4+d*1e3*60*60,this._days=+u+s*7,this._months=+h+f*3+i*12,this._data={},this._locale=Aa(),this._bubble()}function vu(t){return t instanceof du}function ah(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function _m(t,n,i){var f=Math.min(t.length,n.length),h=Math.abs(t.length-n.length),s=0,u;for(u=0;u<f;u++)(i&&t[u]!==n[u]||!i&&_r(t[u])!==_r(n[u]))&&s++;return s+h}function B0(t,n){It(t,0,0,function(){var i=this.utcOffset(),f="+";return i<0&&(i=-i,f="-"),f+ra(~~(i/60),2)+n+ra(~~i%60,2)})}B0("Z",":"),B0("ZZ",""),xt("Z",su),xt("ZZ",su),kr(["Z","ZZ"],function(t,n,i){i._useUTC=!0,i._tzm=fh(su,t)});var pm=/([\+\-]|\d\d)/gi;function fh(t,n){var i=(n||"").match(t),f,h,s;return i===null?null:(f=i[i.length-1]||[],h=(f+"").match(pm)||["-",0,0],s=+(h[1]*60)+_r(h[2]),s===0?0:h[0]==="+"?s:-s)}function sh(t,n){var i,f;return n._isUTC?(i=n.clone(),f=(Ii(t)||No(t)?t.valueOf():Ur(t).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+f),_t.updateOffset(i,!1),i):Ur(t).local()}function oh(t){return-Math.round(t._d.getTimezoneOffset())}_t.updateOffset=function(){};function mm(t,n,i){var f=this._offset||0,h;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=fh(su,t),t===null)return this}else Math.abs(t)<16&&!i&&(t=t*60);return!this._isUTC&&n&&(h=oh(this)),this._offset=t,this._isUTC=!0,h!=null&&this.add(h,"m"),f!==t&&(!n||this._changeInProgress?Y0(this,Ni(t-f,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,_t.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?f:oh(this)}function gm(t,n){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,n),this):-this.utcOffset()}function ym(t){return this.utcOffset(0,t)}function bm(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(oh(this),"m")),this}function xm(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=fh(U_,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function wm(t){return this.isValid()?(t=t?Ur(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Sm(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Tm(){if(!jn(this._isDSTShifted))return this._isDSTShifted;var t={},n;return Gc(t,this),t=I0(t),t._a?(n=t._isUTC?ea(t._a):Ur(t._a),this._isDSTShifted=this.isValid()&&_m(t._a,n.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Em(){return this.isValid()?!this._isUTC:!1}function Am(){return this.isValid()?this._isUTC:!1}function P0(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Dm=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Lm=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ni(t,n){var i=t,f=null,h,s,u;return vu(t)?i={ms:t._milliseconds,d:t._days,M:t._months}:xa(t)||!isNaN(+t)?(i={},n?i[n]=+t:i.milliseconds=+t):(f=Dm.exec(t))?(h=f[1]==="-"?-1:1,i={y:0,d:_r(f[na])*h,h:_r(f[bn])*h,m:_r(f[Fi])*h,s:_r(f[Ta])*h,ms:_r(ah(f[$f]*1e3))*h}):(f=Lm.exec(t))?(h=f[1]==="-"?-1:1,i={y:Zf(f[2],h),M:Zf(f[3],h),w:Zf(f[4],h),d:Zf(f[5],h),h:Zf(f[6],h),m:Zf(f[7],h),s:Zf(f[8],h)}):i==null?i={}:typeof i=="object"&&("from"in i||"to"in i)&&(u=Om(Ur(i.from),Ur(i.to)),i={},i.ms=u.milliseconds,i.M=u.months),s=new du(i),vu(t)&&Sr(t,"_locale")&&(s._locale=t._locale),vu(t)&&Sr(t,"_isValid")&&(s._isValid=t._isValid),s}Ni.fn=du.prototype,Ni.invalid=vm;function Zf(t,n){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*n}function G0(t,n){var i={};return i.months=n.month()-t.month()+(n.year()-t.year())*12,t.clone().add(i.months,"M").isAfter(n)&&--i.months,i.milliseconds=+n-+t.clone().add(i.months,"M"),i}function Om(t,n){var i;return t.isValid()&&n.isValid()?(n=sh(n,t),t.isBefore(n)?i=G0(t,n):(i=G0(n,t),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function U0(t,n){return function(i,f){var h,s;return f!==null&&!isNaN(+f)&&(h0(n,"moment()."+n+"(period, number) is deprecated. Please use moment()."+n+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=i,i=f,f=s),h=Ni(i,f),Y0(this,h,t),this}}function Y0(t,n,i,f){var h=n._milliseconds,s=ah(n._days),u=ah(n._months);!t.isValid()||(f=f==null?!0:f,u&&S0(t,Yo(t,"Month")+u*i),s&&b0(t,"Date",Yo(t,"Date")+s*i),h&&t._d.setTime(t._d.valueOf()+h*i),f&&_t.updateOffset(t,s||u))}var Rm=U0(1,"add"),Cm=U0(-1,"subtract");function H0(t){return typeof t=="string"||t instanceof String}function Mm(t){return Ii(t)||No(t)||H0(t)||xa(t)||Im(t)||km(t)||t===null||t===void 0}function km(t){var n=Vf(t)&&!Fc(t),i=!1,f=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],h,s,u=f.length;for(h=0;h<u;h+=1)s=f[h],i=i||Sr(t,s);return n&&i}function Im(t){var n=ki(t),i=!1;return n&&(i=t.filter(function(f){return!xa(f)&&H0(t)}).length===0),n&&i}function Fm(t){var n=Vf(t)&&!Fc(t),i=!1,f=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],h,s;for(h=0;h<f.length;h+=1)s=f[h],i=i||Sr(t,s);return n&&i}function Nm(t,n){var i=t.diff(n,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function Bm(t,n){arguments.length===1&&(arguments[0]?Mm(arguments[0])?(t=arguments[0],n=void 0):Fm(arguments[0])&&(n=arguments[0],t=void 0):(t=void 0,n=void 0));var i=t||Ur(),f=sh(i,this).startOf("day"),h=_t.calendarFormat(this,f)||"sameElse",s=n&&(ta(n[h])?n[h].call(this,i):n[h]);return this.format(s||this.localeData().calendar(h,this,Ur(i)))}function Pm(){return new Bo(this)}function Gm(t,n){var i=Ii(t)?t:Ur(t);return this.isValid()&&i.isValid()?(n=Ti(n)||"millisecond",n==="millisecond"?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(n).valueOf()):!1}function Um(t,n){var i=Ii(t)?t:Ur(t);return this.isValid()&&i.isValid()?(n=Ti(n)||"millisecond",n==="millisecond"?this.valueOf()<i.valueOf():this.clone().endOf(n).valueOf()<i.valueOf()):!1}function Ym(t,n,i,f){var h=Ii(t)?t:Ur(t),s=Ii(n)?n:Ur(n);return this.isValid()&&h.isValid()&&s.isValid()?(f=f||"()",(f[0]==="("?this.isAfter(h,i):!this.isBefore(h,i))&&(f[1]===")"?this.isBefore(s,i):!this.isAfter(s,i))):!1}function Hm(t,n){var i=Ii(t)?t:Ur(t),f;return this.isValid()&&i.isValid()?(n=Ti(n)||"millisecond",n==="millisecond"?this.valueOf()===i.valueOf():(f=i.valueOf(),this.clone().startOf(n).valueOf()<=f&&f<=this.clone().endOf(n).valueOf())):!1}function zm(t,n){return this.isSame(t,n)||this.isAfter(t,n)}function Wm(t,n){return this.isSame(t,n)||this.isBefore(t,n)}function Vm(t,n,i){var f,h,s;if(!this.isValid())return NaN;if(f=sh(t,this),!f.isValid())return NaN;switch(h=(f.utcOffset()-this.utcOffset())*6e4,n=Ti(n),n){case"year":s=_u(this,f)/12;break;case"month":s=_u(this,f);break;case"quarter":s=_u(this,f)/3;break;case"second":s=(this-f)/1e3;break;case"minute":s=(this-f)/6e4;break;case"hour":s=(this-f)/36e5;break;case"day":s=(this-f-h)/864e5;break;case"week":s=(this-f-h)/6048e5;break;default:s=this-f}return i?s:Ei(s)}function _u(t,n){if(t.date()<n.date())return-_u(n,t);var i=(n.year()-t.year())*12+(n.month()-t.month()),f=t.clone().add(i,"months"),h,s;return n-f<0?(h=t.clone().add(i-1,"months"),s=(n-f)/(f-h)):(h=t.clone().add(i+1,"months"),s=(n-f)/(h-f)),-(i+s)||0}_t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",_t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function $m(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Zm(t){if(!this.isValid())return null;var n=t!==!0,i=n?this.clone().utc():this;return i.year()<0||i.year()>9999?ru(i,n?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ta(Date.prototype.toISOString)?n?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ru(i,"Z")):ru(i,n?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Xm(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",n="",i,f,h,s;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",n="Z"),i="["+t+'("]',f=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",h="-MM-DD[T]HH:mm:ss.SSS",s=n+'[")]',this.format(i+f+h+s)}function qm(t){t||(t=this.isUtc()?_t.defaultFormatUtc:_t.defaultFormat);var n=ru(this,t);return this.localeData().postformat(n)}function Km(t,n){return this.isValid()&&(Ii(t)&&t.isValid()||Ur(t).isValid())?Ni({to:this,from:t}).locale(this.locale()).humanize(!n):this.localeData().invalidDate()}function jm(t){return this.from(Ur(),t)}function Qm(t,n){return this.isValid()&&(Ii(t)&&t.isValid()||Ur(t).isValid())?Ni({from:this,to:t}).locale(this.locale()).humanize(!n):this.localeData().invalidDate()}function Jm(t){return this.to(Ur(),t)}function z0(t){var n;return t===void 0?this._locale._abbr:(n=Aa(t),n!=null&&(this._locale=n),this)}var W0=Si("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function V0(){return this._locale}var pu=1e3,Ns=60*pu,mu=60*Ns,$0=(365*400+97)*24*mu;function Bs(t,n){return(t%n+n)%n}function Z0(t,n,i){return t<100&&t>=0?new Date(t+400,n,i)-$0:new Date(t,n,i).valueOf()}function X0(t,n,i){return t<100&&t>=0?Date.UTC(t+400,n,i)-$0:Date.UTC(t,n,i)}function e1(t){var n,i;if(t=Ti(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(i=this._isUTC?X0:Z0,t){case"year":n=i(this.year(),0,1);break;case"quarter":n=i(this.year(),this.month()-this.month()%3,1);break;case"month":n=i(this.year(),this.month(),1);break;case"week":n=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":n=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":n=i(this.year(),this.month(),this.date());break;case"hour":n=this._d.valueOf(),n-=Bs(n+(this._isUTC?0:this.utcOffset()*Ns),mu);break;case"minute":n=this._d.valueOf(),n-=Bs(n,Ns);break;case"second":n=this._d.valueOf(),n-=Bs(n,pu);break}return this._d.setTime(n),_t.updateOffset(this,!0),this}function t1(t){var n,i;if(t=Ti(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(i=this._isUTC?X0:Z0,t){case"year":n=i(this.year()+1,0,1)-1;break;case"quarter":n=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":n=i(this.year(),this.month()+1,1)-1;break;case"week":n=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":n=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":n=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":n=this._d.valueOf(),n+=mu-Bs(n+(this._isUTC?0:this.utcOffset()*Ns),mu)-1;break;case"minute":n=this._d.valueOf(),n+=Ns-Bs(n,Ns)-1;break;case"second":n=this._d.valueOf(),n+=pu-Bs(n,pu)-1;break}return this._d.setTime(n),_t.updateOffset(this,!0),this}function r1(){return this._d.valueOf()-(this._offset||0)*6e4}function n1(){return Math.floor(this.valueOf()/1e3)}function i1(){return new Date(this.valueOf())}function a1(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function f1(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function s1(){return this.isValid()?this.toISOString():null}function o1(){return Bc(this)}function l1(){return hf({},tr(this))}function u1(){return tr(this).overflow}function c1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}It("N",0,0,"eraAbbr"),It("NN",0,0,"eraAbbr"),It("NNN",0,0,"eraAbbr"),It("NNNN",0,0,"eraName"),It("NNNNN",0,0,"eraNarrow"),It("y",["y",1],"yo","eraYear"),It("y",["yy",2],0,"eraYear"),It("y",["yyy",3],0,"eraYear"),It("y",["yyyy",4],0,"eraYear"),xt("N",lh),xt("NN",lh),xt("NNN",lh),xt("NNNN",w1),xt("NNNNN",S1),kr(["N","NN","NNN","NNNN","NNNNN"],function(t,n,i,f){var h=i._locale.erasParse(t,f,i._strict);h?tr(i).era=h:tr(i).invalidEra=t}),xt("y",Ms),xt("yy",Ms),xt("yyy",Ms),xt("yyyy",Ms),xt("yo",T1),kr(["y","yy","yyy","yyyy"],Yn),kr(["yo"],function(t,n,i,f){var h;i._locale._eraYearOrdinalRegex&&(h=t.match(i._locale._eraYearOrdinalRegex)),i._locale.eraYearOrdinalParse?n[Yn]=i._locale.eraYearOrdinalParse(t,h):n[Yn]=parseInt(t,10)});function h1(t,n){var i,f,h,s=this._eras||Aa("en")._eras;for(i=0,f=s.length;i<f;++i){switch(typeof s[i].since){case"string":h=_t(s[i].since).startOf("day"),s[i].since=h.valueOf();break}switch(typeof s[i].until){case"undefined":s[i].until=1/0;break;case"string":h=_t(s[i].until).startOf("day").valueOf(),s[i].until=h.valueOf();break}}return s}function d1(t,n,i){var f,h,s=this.eras(),u,d,v;for(t=t.toUpperCase(),f=0,h=s.length;f<h;++f)if(u=s[f].name.toUpperCase(),d=s[f].abbr.toUpperCase(),v=s[f].narrow.toUpperCase(),i)switch(n){case"N":case"NN":case"NNN":if(d===t)return s[f];break;case"NNNN":if(u===t)return s[f];break;case"NNNNN":if(v===t)return s[f];break}else if([u,d,v].indexOf(t)>=0)return s[f]}function v1(t,n){var i=t.since<=t.until?1:-1;return n===void 0?_t(t.since).year():_t(t.since).year()+(n-t.offset)*i}function _1(){var t,n,i,f=this.localeData().eras();for(t=0,n=f.length;t<n;++t)if(i=this.clone().startOf("day").valueOf(),f[t].since<=i&&i<=f[t].until||f[t].until<=i&&i<=f[t].since)return f[t].name;return""}function p1(){var t,n,i,f=this.localeData().eras();for(t=0,n=f.length;t<n;++t)if(i=this.clone().startOf("day").valueOf(),f[t].since<=i&&i<=f[t].until||f[t].until<=i&&i<=f[t].since)return f[t].narrow;return""}function m1(){var t,n,i,f=this.localeData().eras();for(t=0,n=f.length;t<n;++t)if(i=this.clone().startOf("day").valueOf(),f[t].since<=i&&i<=f[t].until||f[t].until<=i&&i<=f[t].since)return f[t].abbr;return""}function g1(){var t,n,i,f,h=this.localeData().eras();for(t=0,n=h.length;t<n;++t)if(i=h[t].since<=h[t].until?1:-1,f=this.clone().startOf("day").valueOf(),h[t].since<=f&&f<=h[t].until||h[t].until<=f&&f<=h[t].since)return(this.year()-_t(h[t].since).year())*i+h[t].offset;return this.year()}function y1(t){return Sr(this,"_erasNameRegex")||uh.call(this),t?this._erasNameRegex:this._erasRegex}function b1(t){return Sr(this,"_erasAbbrRegex")||uh.call(this),t?this._erasAbbrRegex:this._erasRegex}function x1(t){return Sr(this,"_erasNarrowRegex")||uh.call(this),t?this._erasNarrowRegex:this._erasRegex}function lh(t,n){return n.erasAbbrRegex(t)}function w1(t,n){return n.erasNameRegex(t)}function S1(t,n){return n.erasNarrowRegex(t)}function T1(t,n){return n._eraYearOrdinalRegex||Ms}function uh(){var t=[],n=[],i=[],f=[],h,s,u,d,v,M=this.eras();for(h=0,s=M.length;h<s;++h)u=wa(M[h].name),d=wa(M[h].abbr),v=wa(M[h].narrow),n.push(u),t.push(d),i.push(v),f.push(u),f.push(d),f.push(v);this._erasRegex=new RegExp("^("+f.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+n.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+i.join("|")+")","i")}It(0,["gg",2],0,function(){return this.weekYear()%100}),It(0,["GG",2],0,function(){return this.isoWeekYear()%100});function gu(t,n){It(0,[t,t.length],0,n)}gu("gggg","weekYear"),gu("ggggg","weekYear"),gu("GGGG","isoWeekYear"),gu("GGGGG","isoWeekYear"),xt("G",fu),xt("g",fu),xt("GG",Gr,oi),xt("gg",Gr,oi),xt("GGGG",Zc,$c),xt("gggg",Zc,$c),xt("GGGGG",au,nu),xt("ggggg",au,nu),Go(["gggg","ggggg","GGGG","GGGGG"],function(t,n,i,f){n[f.substr(0,2)]=_r(t)}),Go(["gg","GG"],function(t,n,i,f){n[f]=_t.parseTwoDigitYear(t)});function E1(t){return q0.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function A1(t){return q0.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function D1(){return Ea(this.year(),1,4)}function L1(){return Ea(this.isoWeekYear(),1,4)}function O1(){var t=this.localeData()._week;return Ea(this.year(),t.dow,t.doy)}function R1(){var t=this.localeData()._week;return Ea(this.weekYear(),t.dow,t.doy)}function q0(t,n,i,f,h){var s;return t==null?zo(this,f,h).year:(s=Ea(t,f,h),n>s&&(n=s),C1.call(this,t,n,i,f,h))}function C1(t,n,i,f,h){var s=A0(t,n,i,f,h),u=Ho(s.year,0,s.dayOfYear);return this.year(u.getUTCFullYear()),this.month(u.getUTCMonth()),this.date(u.getUTCDate()),this}It("Q",0,"Qo","quarter"),xt("Q",_0),kr("Q",function(t,n){n[Sa]=(_r(t)-1)*3});function M1(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}It("D",["DD",2],"Do","date"),xt("D",Gr,ks),xt("DD",Gr,oi),xt("Do",function(t,n){return t?n._dayOfMonthOrdinalParse||n._ordinalParse:n._dayOfMonthOrdinalParseLenient}),kr(["D","DD"],na),kr("Do",function(t,n){n[na]=_r(t.match(Gr)[0])});var K0=Is("Date",!0);It("DDD",["DDDD",3],"DDDo","dayOfYear"),xt("DDD",iu),xt("DDDD",p0),kr(["DDD","DDDD"],function(t,n,i){i._dayOfYear=_r(t)});function k1(t){var n=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?n:this.add(t-n,"d")}It("m",["mm",2],0,"minute"),xt("m",Gr,Xc),xt("mm",Gr,oi),kr(["m","mm"],Fi);var I1=Is("Minutes",!1);It("s",["ss",2],0,"second"),xt("s",Gr,Xc),xt("ss",Gr,oi),kr(["s","ss"],Ta);var F1=Is("Seconds",!1);It("S",0,0,function(){return~~(this.millisecond()/100)}),It(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),It(0,["SSS",3],0,"millisecond"),It(0,["SSSS",4],0,function(){return this.millisecond()*10}),It(0,["SSSSS",5],0,function(){return this.millisecond()*100}),It(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),It(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),It(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),It(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),xt("S",iu,_0),xt("SS",iu,oi),xt("SSS",iu,p0);var vf,j0;for(vf="SSSS";vf.length<=9;vf+="S")xt(vf,Ms);function N1(t,n){n[$f]=_r(("0."+t)*1e3)}for(vf="S";vf.length<=9;vf+="S")kr(vf,N1);j0=Is("Milliseconds",!1),It("z",0,0,"zoneAbbr"),It("zz",0,0,"zoneName");function B1(){return this._isUTC?"UTC":""}function P1(){return this._isUTC?"Coordinated Universal Time":""}var et=Bo.prototype;et.add=Rm,et.calendar=Bm,et.clone=Pm,et.diff=Vm,et.endOf=t1,et.format=qm,et.from=Km,et.fromNow=jm,et.to=Qm,et.toNow=Jm,et.get=X_,et.invalidAt=u1,et.isAfter=Gm,et.isBefore=Um,et.isBetween=Ym,et.isSame=Hm,et.isSameOrAfter=zm,et.isSameOrBefore=Wm,et.isValid=o1,et.lang=W0,et.locale=z0,et.localeData=V0,et.max=om,et.min=sm,et.parsingFlags=l1,et.set=q_,et.startOf=e1,et.subtract=Cm,et.toArray=a1,et.toObject=f1,et.toDate=i1,et.toISOString=Zm,et.inspect=Xm,typeof Symbol<"u"&&Symbol.for!=null&&(et[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),et.toJSON=s1,et.toString=$m,et.unix=n1,et.valueOf=r1,et.creationData=c1,et.eraName=_1,et.eraNarrow=p1,et.eraAbbr=m1,et.eraYear=g1,et.year=y0,et.isLeapYear=Z_,et.weekYear=E1,et.isoWeekYear=A1,et.quarter=et.quarters=M1,et.month=T0,et.daysInMonth=ip,et.week=et.weeks=hp,et.isoWeek=et.isoWeeks=dp,et.weeksInYear=O1,et.weeksInWeekYear=R1,et.isoWeeksInYear=D1,et.isoWeeksInISOWeekYear=L1,et.date=K0,et.day=et.days=Ap,et.weekday=Dp,et.isoWeekday=Lp,et.dayOfYear=k1,et.hour=et.hours=Fp,et.minute=et.minutes=I1,et.second=et.seconds=F1,et.millisecond=et.milliseconds=j0,et.utcOffset=mm,et.utc=ym,et.local=bm,et.parseZone=xm,et.hasAlignedHourOffset=wm,et.isDST=Sm,et.isLocal=Em,et.isUtcOffset=Am,et.isUtc=P0,et.isUTC=P0,et.zoneAbbr=B1,et.zoneName=P1,et.dates=Si("dates accessor is deprecated. Use date instead.",K0),et.months=Si("months accessor is deprecated. Use month instead",T0),et.years=Si("years accessor is deprecated. Use year instead",y0),et.zone=Si("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",gm),et.isDSTShifted=Si("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Tm);function G1(t){return Ur(t*1e3)}function U1(){return Ur.apply(null,arguments).parseZone()}function Q0(t){return t}var Tr=Yc.prototype;Tr.calendar=E_,Tr.longDateFormat=O_,Tr.invalidDate=C_,Tr.ordinal=I_,Tr.preparse=Q0,Tr.postformat=Q0,Tr.relativeTime=N_,Tr.pastFuture=B_,Tr.set=S_,Tr.eras=h1,Tr.erasParse=d1,Tr.erasConvertYear=v1,Tr.erasAbbrRegex=b1,Tr.erasNameRegex=y1,Tr.erasNarrowRegex=x1,Tr.months=ep,Tr.monthsShort=tp,Tr.monthsParse=np,Tr.monthsRegex=fp,Tr.monthsShortRegex=ap,Tr.week=op,Tr.firstDayOfYear=cp,Tr.firstDayOfWeek=up,Tr.weekdays=xp,Tr.weekdaysMin=Sp,Tr.weekdaysShort=wp,Tr.weekdaysParse=Ep,Tr.weekdaysRegex=Op,Tr.weekdaysShortRegex=Rp,Tr.weekdaysMinRegex=Cp,Tr.isPM=kp,Tr.meridiem=Np;function yu(t,n,i,f){var h=Aa(),s=ea().set(f,n);return h[i](s,t)}function J0(t,n,i){if(xa(t)&&(n=t,t=void 0),t=t||"",n!=null)return yu(t,n,i,"month");var f,h=[];for(f=0;f<12;f++)h[f]=yu(t,f,i,"month");return h}function ch(t,n,i,f){typeof t=="boolean"?(xa(n)&&(i=n,n=void 0),n=n||""):(n=t,i=n,t=!1,xa(n)&&(i=n,n=void 0),n=n||"");var h=Aa(),s=t?h._week.dow:0,u,d=[];if(i!=null)return yu(n,(i+s)%7,f,"day");for(u=0;u<7;u++)d[u]=yu(n,(u+s)%7,f,"day");return d}function Y1(t,n){return J0(t,n,"months")}function H1(t,n){return J0(t,n,"monthsShort")}function z1(t,n,i){return ch(t,n,i,"weekdays")}function W1(t,n,i){return ch(t,n,i,"weekdaysShort")}function V1(t,n,i){return ch(t,n,i,"weekdaysMin")}df("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var n=t%10,i=_r(t%100/10)===1?"th":n===1?"st":n===2?"nd":n===3?"rd":"th";return t+i}}),_t.lang=Si("moment.lang is deprecated. Use moment.locale instead.",df),_t.langData=Si("moment.langData is deprecated. Use moment.localeData instead.",Aa);var Da=Math.abs;function $1(){var t=this._data;return this._milliseconds=Da(this._milliseconds),this._days=Da(this._days),this._months=Da(this._months),t.milliseconds=Da(t.milliseconds),t.seconds=Da(t.seconds),t.minutes=Da(t.minutes),t.hours=Da(t.hours),t.months=Da(t.months),t.years=Da(t.years),this}function ev(t,n,i,f){var h=Ni(n,i);return t._milliseconds+=f*h._milliseconds,t._days+=f*h._days,t._months+=f*h._months,t._bubble()}function Z1(t,n){return ev(this,t,n,1)}function X1(t,n){return ev(this,t,n,-1)}function tv(t){return t<0?Math.floor(t):Math.ceil(t)}function q1(){var t=this._milliseconds,n=this._days,i=this._months,f=this._data,h,s,u,d,v;return t>=0&&n>=0&&i>=0||t<=0&&n<=0&&i<=0||(t+=tv(hh(i)+n)*864e5,n=0,i=0),f.milliseconds=t%1e3,h=Ei(t/1e3),f.seconds=h%60,s=Ei(h/60),f.minutes=s%60,u=Ei(s/60),f.hours=u%24,n+=Ei(u/24),v=Ei(rv(n)),i+=v,n-=tv(hh(v)),d=Ei(i/12),i%=12,f.days=n,f.months=i,f.years=d,this}function rv(t){return t*4800/146097}function hh(t){return t*146097/4800}function K1(t){if(!this.isValid())return NaN;var n,i,f=this._milliseconds;if(t=Ti(t),t==="month"||t==="quarter"||t==="year")switch(n=this._days+f/864e5,i=this._months+rv(n),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(n=this._days+Math.round(hh(this._months)),t){case"week":return n/7+f/6048e5;case"day":return n+f/864e5;case"hour":return n*24+f/36e5;case"minute":return n*1440+f/6e4;case"second":return n*86400+f/1e3;case"millisecond":return Math.floor(n*864e5)+f;default:throw new Error("Unknown unit "+t)}}function La(t){return function(){return this.as(t)}}var nv=La("ms"),j1=La("s"),Q1=La("m"),J1=La("h"),eg=La("d"),tg=La("w"),rg=La("M"),ng=La("Q"),ig=La("y"),ag=nv;function fg(){return Ni(this)}function sg(t){return t=Ti(t),this.isValid()?this[t+"s"]():NaN}function Xf(t){return function(){return this.isValid()?this._data[t]:NaN}}var og=Xf("milliseconds"),lg=Xf("seconds"),ug=Xf("minutes"),cg=Xf("hours"),hg=Xf("days"),dg=Xf("months"),vg=Xf("years");function _g(){return Ei(this.days()/7)}var Oa=Math.round,Ps={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function pg(t,n,i,f,h){return h.relativeTime(n||1,!!i,t,f)}function mg(t,n,i,f){var h=Ni(t).abs(),s=Oa(h.as("s")),u=Oa(h.as("m")),d=Oa(h.as("h")),v=Oa(h.as("d")),M=Oa(h.as("M")),k=Oa(h.as("w")),g=Oa(h.as("y")),F=s<=i.ss&&["s",s]||s<i.s&&["ss",s]||u<=1&&["m"]||u<i.m&&["mm",u]||d<=1&&["h"]||d<i.h&&["hh",d]||v<=1&&["d"]||v<i.d&&["dd",v];return i.w!=null&&(F=F||k<=1&&["w"]||k<i.w&&["ww",k]),F=F||M<=1&&["M"]||M<i.M&&["MM",M]||g<=1&&["y"]||["yy",g],F[2]=n,F[3]=+t>0,F[4]=f,pg.apply(null,F)}function gg(t){return t===void 0?Oa:typeof t=="function"?(Oa=t,!0):!1}function yg(t,n){return Ps[t]===void 0?!1:n===void 0?Ps[t]:(Ps[t]=n,t==="s"&&(Ps.ss=n-1),!0)}function bg(t,n){if(!this.isValid())return this.localeData().invalidDate();var i=!1,f=Ps,h,s;return typeof t=="object"&&(n=t,t=!1),typeof t=="boolean"&&(i=t),typeof n=="object"&&(f=Object.assign({},Ps,n),n.s!=null&&n.ss==null&&(f.ss=n.s-1)),h=this.localeData(),s=mg(this,!i,f,h),i&&(s=h.pastFuture(+this,s)),h.postformat(s)}var dh=Math.abs;function Gs(t){return(t>0)-(t<0)||+t}function bu(){if(!this.isValid())return this.localeData().invalidDate();var t=dh(this._milliseconds)/1e3,n=dh(this._days),i=dh(this._months),f,h,s,u,d=this.asSeconds(),v,M,k,g;return d?(f=Ei(t/60),h=Ei(f/60),t%=60,f%=60,s=Ei(i/12),i%=12,u=t?t.toFixed(3).replace(/\.?0+$/,""):"",v=d<0?"-":"",M=Gs(this._months)!==Gs(d)?"-":"",k=Gs(this._days)!==Gs(d)?"-":"",g=Gs(this._milliseconds)!==Gs(d)?"-":"",v+"P"+(s?M+s+"Y":"")+(i?M+i+"M":"")+(n?k+n+"D":"")+(h||f||t?"T":"")+(h?g+h+"H":"")+(f?g+f+"M":"")+(t?g+u+"S":"")):"P0D"}var br=du.prototype;br.isValid=dm,br.abs=$1,br.add=Z1,br.subtract=X1,br.as=K1,br.asMilliseconds=nv,br.asSeconds=j1,br.asMinutes=Q1,br.asHours=J1,br.asDays=eg,br.asWeeks=tg,br.asMonths=rg,br.asQuarters=ng,br.asYears=ig,br.valueOf=ag,br._bubble=q1,br.clone=fg,br.get=sg,br.milliseconds=og,br.seconds=lg,br.minutes=ug,br.hours=cg,br.days=hg,br.weeks=_g,br.months=dg,br.years=vg,br.humanize=bg,br.toISOString=bu,br.toString=bu,br.toJSON=bu,br.locale=z0,br.localeData=V0,br.toIsoString=Si("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",bu),br.lang=W0,It("X",0,0,"unix"),It("x",0,0,"valueOf"),xt("x",fu),xt("X",Y_),kr("X",function(t,n,i){i._d=new Date(parseFloat(t)*1e3)}),kr("x",function(t,n,i){i._d=new Date(_r(t))});//! moment.js
|
|
10
|
-
_t.version="2.30.1",x_(Ur),_t.fn=et,_t.min=lm,_t.max=um,_t.now=cm,_t.utc=ea,_t.unix=G1,_t.months=Y1,_t.isDate=No,_t.locale=df,_t.invalid=eu,_t.duration=Ni,_t.isMoment=Ii,_t.weekdays=z1,_t.parseZone=U1,_t.localeData=Aa,_t.isDuration=vu,_t.monthsShort=H1,_t.weekdaysMin=V1,_t.defineLocale=eh,_t.updateLocale=Up,_t.locales=Yp,_t.weekdaysShort=W1,_t.normalizeUnits=Ti,_t.relativeTimeRounding=gg,_t.relativeTimeThreshold=yg,_t.calendarFormat=Nm,_t.prototype=et,_t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};var Us=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ys={exports:{}};/**
|
|
11
|
-
* @license
|
|
12
|
-
* Lodash <https://lodash.com/>
|
|
13
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
14
|
-
* Released under MIT license <https://lodash.com/license>
|
|
15
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
16
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
17
|
-
*/(function(t,n){(function(){var i,f="4.17.21",h=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",d="Invalid `variable` option passed into `_.template`",v="__lodash_hash_undefined__",M=500,k="__lodash_placeholder__",g=1,F=2,$=4,S=1,de=2,se=1,I=2,U=4,te=8,ce=16,_e=32,we=64,ee=128,Ce=256,ut=512,ct=30,nt="...",ft=800,tt=16,Le=1,Ct=2,bt=3,Me=1/0,Ze=9007199254740991,St=17976931348623157e292,$t=0/0,Wt=4294967295,Qt=Wt-1,sr=Wt>>>1,xr=[["ary",ee],["bind",se],["bindKey",I],["curry",te],["curryRight",ce],["flip",ut],["partial",_e],["partialRight",we],["rearg",Ce]],or="[object Arguments]",Kt="[object Array]",wr="[object AsyncFunction]",Gt="[object Boolean]",kt="[object Date]",hn="[object DOMException]",jr="[object Error]",Ft="[object Function]",Br="[object GeneratorFunction]",Ir="[object Map]",Zr="[object Number]",Qr="[object Null]",ar="[object Object]",Nt="[object Promise]",En="[object Proxy]",An="[object RegExp]",Jr="[object Set]",an="[object String]",w="[object Symbol]",li="[object Undefined]",dn="[object WeakMap]",Gi="[object WeakSet]",Bn="[object ArrayBuffer]",Er="[object DataView]",Dn="[object Float32Array]",Pn="[object Float64Array]",A="[object Int8Array]",Ue="[object Int16Array]",Xe="[object Int32Array]",dt="[object Uint8Array]",z="[object Uint8ClampedArray]",xe="[object Uint16Array]",p="[object Uint32Array]",He=/\b__p \+= '';/g,Bt=/\b(__p \+=) '' \+/g,o=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ue=/&(?:amp|lt|gt|quot|#39);/g,ge=/[&<>"']/g,y=RegExp(ue.source),Y=RegExp(ge.source),oe=/<%-([\s\S]+?)%>/g,At=/<%([\s\S]+?)%>/g,it=/<%=([\s\S]+?)%>/g,mt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lr=/^\w*$/,ui=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fr=/[\\^$.*+?()[\]{}|]/g,hr=RegExp(Fr.source),Yr=/^\s+/,vn=/\s/,Ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ra=/\{\n\/\* \[wrapped with (.+)\] \*/,Ca=/,? & /,jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Hn=/[()=,{}\[\]\/\s]/,fn=/\\(\\)?/g,ci=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$n=/\w*$/,Ws=/^[-+]0x[0-9a-f]+$/i,Ch=/^0b[01]+$/i,Mh=/^\[object .+?Constructor\]$/,kh=/^0o[0-7]+$/i,Ih=/^(?:0|[1-9]\d*)$/,Fh=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vs=/($^)/,Nh=/['\n\r\u2028\u2029\\]/g,$s="\\ud800-\\udfff",Bh="\\u0300-\\u036f",Ph="\\ufe20-\\ufe2f",Gh="\\u20d0-\\u20ff",Tu=Bh+Ph+Gh,Eu="\\u2700-\\u27bf",Au="a-z\\xdf-\\xf6\\xf8-\\xff",Uh="\\xac\\xb1\\xd7\\xf7",Yh="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Hh="\\u2000-\\u206f",zh=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Du="A-Z\\xc0-\\xd6\\xd8-\\xde",Lu="\\ufe0e\\ufe0f",Ou=Uh+Yh+Hh+zh,qo="['\u2019]",Zs="["+$s+"]",Ko="["+Ou+"]",Xs="["+Tu+"]",Ru="\\d+",Qf="["+Eu+"]",qs="["+Au+"]",jo="[^"+$s+Ou+Ru+Eu+Au+Du+"]",Jf="\\ud83c[\\udffb-\\udfff]",Wh="(?:"+Xs+"|"+Jf+")",Cu="[^"+$s+"]",Qo="(?:\\ud83c[\\udde6-\\uddff]){2}",Jo="[\\ud800-\\udbff][\\udc00-\\udfff]",On="["+Du+"]",zn="\\u200d",es="(?:"+qs+"|"+jo+")",Vh="(?:"+On+"|"+jo+")",Mu="(?:"+qo+"(?:d|ll|m|re|s|t|ve))?",el="(?:"+qo+"(?:D|LL|M|RE|S|T|VE))?",tl=Wh+"?",ku="["+Lu+"]?",$h="(?:"+zn+"(?:"+[Cu,Qo,Jo].join("|")+")"+ku+tl+")*",rl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Iu=ku+tl+$h,Xh="(?:"+[Qf,Qo,Jo].join("|")+")"+Iu,qh="(?:"+[Cu+Xs+"?",Xs,Qo,Jo,Zs].join("|")+")",Kh=RegExp(qo,"g"),jh=RegExp(Xs,"g"),nl=RegExp(Jf+"(?="+Jf+")|"+qh+Iu,"g"),Qh=RegExp([On+"?"+qs+"+"+Mu+"(?="+[Ko,On,"$"].join("|")+")",Vh+"+"+el+"(?="+[Ko,On+es,"$"].join("|")+")",On+"?"+es+"+"+Mu,On+"+"+el,Zh,rl,Ru,Xh].join("|"),"g"),Ma=RegExp("["+zn+$s+Tu+Lu+"]"),Jh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ed=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ks=-1,Rr={};Rr[Dn]=Rr[Pn]=Rr[A]=Rr[Ue]=Rr[Xe]=Rr[dt]=Rr[z]=Rr[xe]=Rr[p]=!0,Rr[or]=Rr[Kt]=Rr[Bn]=Rr[Gt]=Rr[Er]=Rr[kt]=Rr[jr]=Rr[Ft]=Rr[Ir]=Rr[Zr]=Rr[ar]=Rr[An]=Rr[Jr]=Rr[an]=Rr[dn]=!1;var Cr={};Cr[or]=Cr[Kt]=Cr[Bn]=Cr[Er]=Cr[Gt]=Cr[kt]=Cr[Dn]=Cr[Pn]=Cr[A]=Cr[Ue]=Cr[Xe]=Cr[Ir]=Cr[Zr]=Cr[ar]=Cr[An]=Cr[Jr]=Cr[an]=Cr[w]=Cr[dt]=Cr[z]=Cr[xe]=Cr[p]=!0,Cr[jr]=Cr[Ft]=Cr[dn]=!1;var Fu={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},td={"&":"&","<":"<",">":">",'"':""","'":"'"},il={"&":"&","<":"<",">":">",""":'"',"'":"'"},al={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ia=parseFloat,js=parseInt,fl=typeof Us=="object"&&Us&&Us.Object===Object&&Us,Nu=typeof self=="object"&&self&&self.Object===Object&&self,xn=fl||Nu||Function("return this")(),sl=n&&!n.nodeType&&n,ka=sl&&!0&&t&&!t.nodeType&&t,Bu=ka&&ka.exports===sl,ol=Bu&&fl.process,Jn=function(){try{var K=ka&&ka.require&&ka.require("util").types;return K||ol&&ol.binding&&ol.binding("util")}catch{}}(),Pu=Jn&&Jn.isArrayBuffer,Ui=Jn&&Jn.isDate,Gu=Jn&&Jn.isMap,Uu=Jn&&Jn.isRegExp,yf=Jn&&Jn.isSet,Yu=Jn&&Jn.isTypedArray;function _n(K,Ee,he){switch(he.length){case 0:return K.call(Ee);case 1:return K.call(Ee,he[0]);case 2:return K.call(Ee,he[0],he[1]);case 3:return K.call(Ee,he[0],he[1],he[2])}return K.apply(Ee,he)}function Hu(K,Ee,he,gt){for(var Zt=-1,mr=K==null?0:K.length;++Zt<mr;){var sn=K[Zt];Ee(gt,sn,he(sn),K)}return gt}function wn(K,Ee){for(var he=-1,gt=K==null?0:K.length;++he<gt&&Ee(K[he],he,K)!==!1;);return K}function zu(K,Ee){for(var he=K==null?0:K.length;he--&&Ee(K[he],he,K)!==!1;);return K}function aa(K,Ee){for(var he=-1,gt=K==null?0:K.length;++he<gt;)if(!Ee(K[he],he,K))return!1;return!0}function Di(K,Ee){for(var he=-1,gt=K==null?0:K.length,Zt=0,mr=[];++he<gt;){var sn=K[he];Ee(sn,he,K)&&(mr[Zt++]=sn)}return mr}function Qs(K,Ee){var he=K==null?0:K.length;return!!he&&Hi(K,Ee,0)>-1}function ll(K,Ee,he){for(var gt=-1,Zt=K==null?0:K.length;++gt<Zt;)if(he(Ee,K[gt]))return!0;return!1}function Pr(K,Ee){for(var he=-1,gt=K==null?0:K.length,Zt=Array(gt);++he<gt;)Zt[he]=Ee(K[he],he,K);return Zt}function Yi(K,Ee){for(var he=-1,gt=Ee.length,Zt=K.length;++he<gt;)K[Zt+he]=Ee[he];return K}function ul(K,Ee,he,gt){var Zt=-1,mr=K==null?0:K.length;for(gt&&mr&&(he=K[++Zt]);++Zt<mr;)he=Ee(he,K[Zt],Zt,K);return he}function rd(K,Ee,he,gt){var Zt=K==null?0:K.length;for(gt&&Zt&&(he=K[--Zt]);Zt--;)he=Ee(he,K[Zt],Zt,K);return he}function Js(K,Ee){for(var he=-1,gt=K==null?0:K.length;++he<gt;)if(Ee(K[he],he,K))return!0;return!1}var Nr=Fa("length");function Wu(K){return K.split("")}function nd(K){return K.match(jt)||[]}function hi(K,Ee,he){var gt;return he(K,function(Zt,mr,sn){if(Ee(Zt,mr,sn))return gt=mr,!1}),gt}function bf(K,Ee,he,gt){for(var Zt=K.length,mr=he+(gt?1:-1);gt?mr--:++mr<Zt;)if(Ee(K[mr],mr,K))return mr;return-1}function Hi(K,Ee,he){return Ee===Ee?Sf(K,Ee,he):bf(K,eo,he)}function Ia(K,Ee,he,gt){for(var Zt=he-1,mr=K.length;++Zt<mr;)if(gt(K[Zt],Ee))return Zt;return-1}function eo(K){return K!==K}function ts(K,Ee){var he=K==null?0:K.length;return he?to(K,Ee)/he:$t}function Fa(K){return function(Ee){return Ee==null?i:Ee[K]}}function xf(K){return function(Ee){return K==null?i:K[Ee]}}function cl(K,Ee,he,gt,Zt){return Zt(K,function(mr,sn,Ar){he=gt?(gt=!1,mr):Ee(he,mr,sn,Ar)}),he}function hl(K,Ee){var he=K.length;for(K.sort(Ee);he--;)K[he]=K[he].value;return K}function to(K,Ee){for(var he,gt=-1,Zt=K.length;++gt<Zt;){var mr=Ee(K[gt]);mr!==i&&(he=he===i?mr:he+mr)}return he}function dl(K,Ee){for(var he=-1,gt=Array(K);++he<K;)gt[he]=Ee(he);return gt}function id(K,Ee){return Pr(Ee,function(he){return[he,K[he]]})}function Vu(K){return K&&K.slice(0,qu(K)+1).replace(Yr,"")}function Zn(K){return function(Ee){return K(Ee)}}function rs(K,Ee){return Pr(Ee,function(he){return K[he]})}function fa(K,Ee){return K.has(Ee)}function ro(K,Ee){for(var he=-1,gt=K.length;++he<gt&&Hi(Ee,K[he],0)>-1;);return he}function no(K,Ee){for(var he=K.length;he--&&Hi(Ee,K[he],0)>-1;);return he}function wf(K,Ee){for(var he=K.length,gt=0;he--;)K[he]===Ee&&++gt;return gt}var vl=xf(Fu),_l=xf(td);function pl(K){return"\\"+al[K]}function ml(K,Ee){return K==null?i:K[Ee]}function Na(K){return Ma.test(K)}function $u(K){return Jh.test(K)}function Zu(K){for(var Ee,he=[];!(Ee=K.next()).done;)he.push(Ee.value);return he}function io(K){var Ee=-1,he=Array(K.size);return K.forEach(function(gt,Zt){he[++Ee]=[Zt,gt]}),he}function gl(K,Ee){return function(he){return K(Ee(he))}}function zi(K,Ee){for(var he=-1,gt=K.length,Zt=0,mr=[];++he<gt;){var sn=K[he];(sn===Ee||sn===k)&&(K[he]=k,mr[Zt++]=he)}return mr}function ns(K){var Ee=-1,he=Array(K.size);return K.forEach(function(gt){he[++Ee]=gt}),he}function Xu(K){var Ee=-1,he=Array(K.size);return K.forEach(function(gt){he[++Ee]=[gt,gt]}),he}function Sf(K,Ee,he){for(var gt=he-1,Zt=K.length;++gt<Zt;)if(K[gt]===Ee)return gt;return-1}function yl(K,Ee,he){for(var gt=he+1;gt--;)if(K[gt]===Ee)return gt;return gt}function sa(K){return Na(K)?fd(K):Nr(K)}function Gn(K){return Na(K)?bl(K):Wu(K)}function qu(K){for(var Ee=K.length;Ee--&&vn.test(K.charAt(Ee)););return Ee}var ad=xf(il);function fd(K){for(var Ee=nl.lastIndex=0;nl.test(K);)++Ee;return Ee}function bl(K){return K.match(nl)||[]}function sd(K){return K.match(Qh)||[]}var od=function K(Ee){Ee=Ee==null?xn:Tf.defaults(xn.Object(),Ee,Tf.pick(xn,ed));var he=Ee.Array,gt=Ee.Date,Zt=Ee.Error,mr=Ee.Function,sn=Ee.Math,Ar=Ee.Object,xl=Ee.RegExp,ld=Ee.String,ei=Ee.TypeError,ao=he.prototype,ud=mr.prototype,Ef=Ar.prototype,fo=Ee["__core-js_shared__"],is=ud.toString,gr=Ef.hasOwnProperty,cd=0,as=function(){var e=/[^.]+$/.exec(fo&&fo.keys&&fo.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Un=Ef.toString,Af=is.call(Ar),Ku=xn._,ju=xl("^"+is.call(gr).replace(Fr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fs=Bu?Ee.Buffer:i,Wi=Ee.Symbol,ss=Ee.Uint8Array,wl=fs?fs.allocUnsafe:i,so=gl(Ar.getPrototypeOf,Ar),Ba=Ar.create,on=Ef.propertyIsEnumerable,os=ao.splice,Sl=Wi?Wi.isConcatSpreadable:i,di=Wi?Wi.iterator:i,oa=Wi?Wi.toStringTag:i,ls=function(){try{var e=C(Ar,"defineProperty");return e({},"",{}),e}catch{}}(),hd=Ee.clearTimeout!==xn.clearTimeout&&Ee.clearTimeout,dd=gt&>.now!==xn.Date.now&>.now,vd=Ee.setTimeout!==xn.setTimeout&&Ee.setTimeout,oo=sn.ceil,Df=sn.floor,lo=Ar.getOwnPropertySymbols,_d=fs?fs.isBuffer:i,Tl=Ee.isFinite,Qu=ao.join,pd=gl(Ar.keys,Ar),Xr=sn.max,Rn=sn.min,la=gt.now,uo=Ee.parseInt,El=sn.random,Ju=ao.reverse,co=C(Ee,"DataView"),Lf=C(Ee,"Map"),ho=C(Ee,"Promise"),Pa=C(Ee,"Set"),Of=C(Ee,"WeakMap"),Rf=C(Ar,"create"),us=Of&&new Of,Cn={},ec=pr(co),md=pr(Lf),Vi=pr(ho),Al=pr(Pa),Ga=pr(Of),Ua=Wi?Wi.prototype:i,Cf=Ua?Ua.valueOf:i,Dl=Ua?Ua.toString:i;function b(e){if(rn(e)&&!Jt(e)&&!(e instanceof ur)){if(e instanceof ti)return e;if(gr.call(e,"__wrapped__"))return Kr(e)}return new ti(e)}var Ya=function(){function e(){}return function(r){if(!tn(r))return{};if(Ba)return Ba(r);e.prototype=r;var a=new e;return e.prototype=i,a}}();function cs(){}function ti(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=i}b.templateSettings={escape:oe,evaluate:At,interpolate:it,variable:"",imports:{_:b}},b.prototype=cs.prototype,b.prototype.constructor=b,ti.prototype=Ya(cs.prototype),ti.prototype.constructor=ti;function ur(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Wt,this.__views__=[]}function gd(){var e=new ur(this.__wrapped__);return e.__actions__=kn(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=kn(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=kn(this.__views__),e}function yd(){if(this.__filtered__){var e=new ur(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function bd(){var e=this.__wrapped__.value(),r=this.__dir__,a=Jt(e),l=r<0,_=a?e.length:0,T=De(0,_,this.__views__),P=T.start,H=T.end,J=H-P,Ie=l?H:P-1,Ne=this.__iteratees__,ze=Ne.length,vt=0,Ot=Rn(J,this.__takeCount__);if(!a||!l&&_==J&&Ot==J)return xs(e,this.__actions__);var Yt=[];e:for(;J--&&vt<Ot;){Ie+=r;for(var fr=-1,Ht=e[Ie];++fr<ze;){var vr=Ne[fr],yr=vr.iteratee,xi=vr.type,Kn=yr(Ht);if(xi==Ct)Ht=Kn;else if(!Kn){if(xi==Le)continue e;break e}}Yt[vt++]=Ht}return Yt}ur.prototype=Ya(cs.prototype),ur.prototype.constructor=ur;function Ha(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var l=e[r];this.set(l[0],l[1])}}function xd(){this.__data__=Rf?Rf(null):{},this.size=0}function tc(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}function rc(e){var r=this.__data__;if(Rf){var a=r[e];return a===v?i:a}return gr.call(r,e)?r[e]:i}function wd(e){var r=this.__data__;return Rf?r[e]!==i:gr.call(r,e)}function Sd(e,r){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=Rf&&r===i?v:r,this}Ha.prototype.clear=xd,Ha.prototype.delete=tc,Ha.prototype.get=rc,Ha.prototype.has=wd,Ha.prototype.set=Sd;function vi(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var l=e[r];this.set(l[0],l[1])}}function vo(){this.__data__=[],this.size=0}function Td(e){var r=this.__data__,a=ua(r,e);if(a<0)return!1;var l=r.length-1;return a==l?r.pop():os.call(r,a,1),--this.size,!0}function Ed(e){var r=this.__data__,a=ua(r,e);return a<0?i:r[a][1]}function Ad(e){return ua(this.__data__,e)>-1}function Dd(e,r){var a=this.__data__,l=ua(a,e);return l<0?(++this.size,a.push([e,r])):a[l][1]=r,this}vi.prototype.clear=vo,vi.prototype.delete=Td,vi.prototype.get=Ed,vi.prototype.has=Ad,vi.prototype.set=Dd;function $i(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var l=e[r];this.set(l[0],l[1])}}function nc(){this.size=0,this.__data__={hash:new Ha,map:new(Lf||vi),string:new Ha}}function Ld(e){var r=c(this,e).delete(e);return this.size-=r?1:0,r}function Od(e){return c(this,e).get(e)}function Rd(e){return c(this,e).has(e)}function Cd(e,r){var a=c(this,e),l=a.size;return a.set(e,r),this.size+=a.size==l?0:1,this}$i.prototype.clear=nc,$i.prototype.delete=Ld,$i.prototype.get=Od,$i.prototype.has=Rd,$i.prototype.set=Cd;function za(e){var r=-1,a=e==null?0:e.length;for(this.__data__=new $i;++r<a;)this.add(e[r])}function Mf(e){return this.__data__.set(e,v),this}function Md(e){return this.__data__.has(e)}za.prototype.add=za.prototype.push=Mf,za.prototype.has=Md;function _i(e){var r=this.__data__=new vi(e);this.size=r.size}function ic(){this.__data__=new vi,this.size=0}function _o(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}function ac(e){return this.__data__.get(e)}function Ll(e){return this.__data__.has(e)}function kd(e,r){var a=this.__data__;if(a instanceof vi){var l=a.__data__;if(!Lf||l.length<h-1)return l.push([e,r]),this.size=++a.size,this;a=this.__data__=new $i(l)}return a.set(e,r),this.size=a.size,this}_i.prototype.clear=ic,_i.prototype.delete=_o,_i.prototype.get=ac,_i.prototype.has=Ll,_i.prototype.set=kd;function Ol(e,r){var a=Jt(e),l=!a&&Rs(e),_=!a&&!l&&Wf(e),T=!a&&!l&&!_&&Io(e),P=a||l||_||T,H=P?dl(e.length,ld):[],J=H.length;for(var Ie in e)(r||gr.call(e,Ie))&&!(P&&(Ie=="length"||_&&(Ie=="offset"||Ie=="parent")||T&&(Ie=="buffer"||Ie=="byteLength"||Ie=="byteOffset")||V(Ie,J)))&&H.push(Ie);return H}function fc(e){var r=e.length;return r?e[wo(0,r-1)]:i}function Id(e,r){return Lr(kn(e),Wa(r,0,e.length))}function Fd(e){return Lr(kn(e))}function Rl(e,r,a){(a!==i&&!Qi(e[r],a)||a===i&&!(r in e))&&Wn(e,r,a)}function hs(e,r,a){var l=e[r];(!(gr.call(e,r)&&Qi(l,a))||a===i&&!(r in e))&&Wn(e,r,a)}function ua(e,r){for(var a=e.length;a--;)if(Qi(e[a][0],r))return a;return-1}function Nd(e,r,a,l){return Li(e,function(_,T,P){r(l,_,a(_),P)}),l}function ds(e,r){return e&&Oi(r,Fn(r),e)}function Bd(e,r){return e&&Oi(r,fi(r),e)}function Wn(e,r,a){r=="__proto__"&&ls?ls(e,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[r]=a}function ca(e,r){for(var a=-1,l=r.length,_=he(l),T=e==null;++a<l;)_[a]=T?i:jd(e,r[a]);return _}function Wa(e,r,a){return e===e&&(a!==i&&(e=e<=a?e:a),r!==i&&(e=e>=r?e:r)),e}function Sn(e,r,a,l,_,T){var P,H=r&g,J=r&F,Ie=r&$;if(a&&(P=_?a(e,l,_,T):a(e)),P!==i)return P;if(!tn(e))return e;var Ne=Jt(e);if(Ne){if(P=Ge(e),!H)return kn(e,P)}else{var ze=ae(e),vt=ze==Ft||ze==Br;if(Wf(e))return Ss(e,H);if(ze==ar||ze==or||vt&&!_){if(P=J||vt?{}:Pe(e),!H)return J?Yd(e,Bd(P,e)):Ud(e,ds(P,e))}else{if(!Cr[ze])return _?e:{};P=We(e,ze,H)}}T||(T=new _i);var Ot=T.get(e);if(Ot)return Ot;T.set(e,P),r_(e)?e.forEach(function(Ht){P.add(Sn(Ht,r,a,Ht,e,T))}):e_(e)&&e.forEach(function(Ht,vr){P.set(vr,Sn(Ht,r,a,vr,e,T))});var Yt=Ie?J?Co:Ro:J?fi:Fn,fr=Ne?i:Yt(e);return wn(fr||e,function(Ht,vr){fr&&(vr=Ht,Ht=e[vr]),hs(P,vr,Sn(Ht,r,a,vr,e,T))}),P}function sc(e){var r=Fn(e);return function(a){return Va(a,e,r)}}function Va(e,r,a){var l=a.length;if(e==null)return!l;for(e=Ar(e);l--;){var _=a[l],T=r[_],P=e[_];if(P===i&&!(_ in e)||!T(P))return!1}return!0}function po(e,r,a){if(typeof e!="function")throw new ei(u);return wt(function(){e.apply(i,a)},r)}function $a(e,r,a,l){var _=-1,T=Qs,P=!0,H=e.length,J=[],Ie=r.length;if(!H)return J;a&&(r=Pr(r,Zn(a))),l?(T=ll,P=!1):r.length>=h&&(T=fa,P=!1,r=new za(r));e:for(;++_<H;){var Ne=e[_],ze=a==null?Ne:a(Ne);if(Ne=l||Ne!==0?Ne:0,P&&ze===ze){for(var vt=Ie;vt--;)if(r[vt]===ze)continue e;J.push(Ne)}else T(r,ze,l)||J.push(Ne)}return J}var Li=$l(ri),mo=$l(vs,!0);function Cl(e,r){var a=!0;return Li(e,function(l,_,T){return a=!!r(l,_,T),a}),a}function Za(e,r,a){for(var l=-1,_=e.length;++l<_;){var T=e[l],P=r(T);if(P!=null&&(H===i?P===P&&!bi(P):a(P,H)))var H=P,J=T}return J}function oc(e,r,a,l){var _=e.length;for(a=nr(a),a<0&&(a=-a>_?0:_+a),l=l===i||l>_?_:nr(l),l<0&&(l+=_),l=a>l?0:i_(l);a<l;)e[a++]=r;return e}function Ml(e,r){var a=[];return Li(e,function(l,_,T){r(l,_,T)&&a.push(l)}),a}function pn(e,r,a,l,_){var T=-1,P=e.length;for(a||(a=Fe),_||(_=[]);++T<P;){var H=e[T];r>0&&a(H)?r>1?pn(H,r-1,a,l,_):Yi(_,H):l||(_[_.length]=H)}return _}var go=Zl(),kl=Zl(!0);function ri(e,r){return e&&go(e,r,Fn)}function vs(e,r){return e&&kl(e,r,Fn)}function _s(e,r){return Di(r,function(a){return of(e[a])})}function ha(e,r){r=pi(r,e);for(var a=0,l=r.length;e!=null&&a<l;)e=e[Dr(r[a++])];return a&&a==l?e:i}function Il(e,r,a){var l=r(e);return Jt(e)?l:Yi(l,a(e))}function Mn(e){return e==null?e===i?li:Qr:oa&&oa in Ar(e)?ie(e):$e(e)}function ps(e,r){return e>r}function lc(e,r){return e!=null&&gr.call(e,r)}function uc(e,r){return e!=null&&r in Ar(e)}function Fl(e,r,a){return e>=Rn(r,a)&&e<Xr(r,a)}function ms(e,r,a){for(var l=a?ll:Qs,_=e[0].length,T=e.length,P=T,H=he(T),J=1/0,Ie=[];P--;){var Ne=e[P];P&&r&&(Ne=Pr(Ne,Zn(r))),J=Rn(Ne.length,J),H[P]=!a&&(r||_>=120&&Ne.length>=120)?new za(P&&Ne):i}Ne=e[0];var ze=-1,vt=H[0];e:for(;++ze<_&&Ie.length<J;){var Ot=Ne[ze],Yt=r?r(Ot):Ot;if(Ot=a||Ot!==0?Ot:0,!(vt?fa(vt,Yt):l(Ie,Yt,a))){for(P=T;--P;){var fr=H[P];if(!(fr?fa(fr,Yt):l(e[P],Yt,a)))continue e}vt&&vt.push(Yt),Ie.push(Ot)}}return Ie}function cc(e,r,a,l){return ri(e,function(_,T,P){r(l,a(_),T,P)}),l}function Xa(e,r,a){r=pi(r,e),e=Mt(e,r);var l=e==null?e:e[Dr(N(r))];return l==null?i:_n(l,e,a)}function Nl(e){return rn(e)&&Mn(e)==or}function hc(e){return rn(e)&&Mn(e)==Bn}function Bl(e){return rn(e)&&Mn(e)==kt}function kf(e,r,a,l,_){return e===r?!0:e==null||r==null||!rn(e)&&!rn(r)?e!==e&&r!==r:dc(e,r,a,l,kf,_)}function dc(e,r,a,l,_,T){var P=Jt(e),H=Jt(r),J=P?Kt:ae(e),Ie=H?Kt:ae(r);J=J==or?ar:J,Ie=Ie==or?ar:Ie;var Ne=J==ar,ze=Ie==ar,vt=J==Ie;if(vt&&Wf(e)){if(!Wf(r))return!1;P=!0,Ne=!1}if(vt&&!Ne)return T||(T=new _i),P||Io(e)?Tc(e,r,a,l,_,T):Vd(e,r,J,a,l,_,T);if(!(a&S)){var Ot=Ne&&gr.call(e,"__wrapped__"),Yt=ze&&gr.call(r,"__wrapped__");if(Ot||Yt){var fr=Ot?e.value():e,Ht=Yt?r.value():r;return T||(T=new _i),_(fr,Ht,a,l,T)}}return vt?(T||(T=new _i),$d(e,r,a,l,_,T)):!1}function Pl(e){return rn(e)&&ae(e)==Ir}function gs(e,r,a,l){var _=a.length,T=_,P=!l;if(e==null)return!T;for(e=Ar(e);_--;){var H=a[_];if(P&&H[2]?H[1]!==e[H[0]]:!(H[0]in e))return!1}for(;++_<T;){H=a[_];var J=H[0],Ie=e[J],Ne=H[1];if(P&&H[2]){if(Ie===i&&!(J in e))return!1}else{var ze=new _i;if(l)var vt=l(Ie,Ne,J,e,r,ze);if(!(vt===i?kf(Ne,Ie,S|de,l,ze):vt))return!1}}return!0}function If(e){if(!tn(e)||Qe(e))return!1;var r=of(e)?ju:Mh;return r.test(pr(e))}function vc(e){return rn(e)&&Mn(e)==An}function yo(e){return rn(e)&&ae(e)==Jr}function Zi(e){return rn(e)&&Mc(e.length)&&!!Rr[Mn(e)]}function Ff(e){return typeof e=="function"?e:e==null?si:typeof e=="object"?Jt(e)?_a(e[0],e[1]):va(e):__(e)}function Xi(e){if(!pt(e))return pd(e);var r=[];for(var a in Ar(e))gr.call(e,a)&&a!="constructor"&&r.push(a);return r}function ys(e){if(!tn(e))return ke(e);var r=pt(e),a=[];for(var l in e)l=="constructor"&&(r||!gr.call(e,l))||a.push(l);return a}function qa(e,r){return e<r}function da(e,r){var a=-1,l=ai(e)?he(e.length):[];return Li(e,function(_,T,P){l[++a]=r(_,T,P)}),l}function va(e){var r=x(e);return r.length==1&&r[0][2]?me(r[0][0],r[0][1]):function(a){return a===e||gs(a,e,r)}}function _a(e,r){return Re(e)&&ye(r)?me(Dr(e),r):function(a){var l=jd(a,e);return l===i&&l===r?Qd(a,e):kf(r,l,S|de)}}function Ka(e,r,a,l,_){e!==r&&go(r,function(T,P){if(_||(_=new _i),tn(T))bo(e,r,P,a,Ka,l,_);else{var H=l?l(Ke(e,P),T,P+"",e,r,_):i;H===i&&(H=T),Rl(e,P,H)}},fi)}function bo(e,r,a,l,_,T,P){var H=Ke(e,a),J=Ke(r,a),Ie=P.get(J);if(Ie){Rl(e,a,Ie);return}var Ne=T?T(H,J,a+"",e,r,P):i,ze=Ne===i;if(ze){var vt=Jt(J),Ot=!vt&&Wf(J),Yt=!vt&&!Ot&&Io(J);Ne=J,vt||Ot||Yt?Jt(H)?Ne=H:un(H)?Ne=kn(H):Ot?(ze=!1,Ne=Ss(J,!0)):Yt?(ze=!1,Ne=Hf(J,!0)):Ne=[]:Jl(J)||Rs(J)?(Ne=H,Rs(H)?Ne=a_(H):(!tn(H)||of(H))&&(Ne=Pe(J))):ze=!1}ze&&(P.set(J,Ne),_(Ne,J,l,T,P),P.delete(J)),Rl(e,a,Ne)}function Nf(e,r){var a=e.length;if(!!a)return r+=r<0?a:0,V(r,a)?e[r]:i}function xo(e,r,a){r.length?r=Pr(r,function(T){return Jt(T)?function(P){return ha(P,T.length===1?T[0]:T)}:T}):r=[si];var l=-1;r=Pr(r,Zn(Pt()));var _=da(e,function(T,P,H){var J=Pr(r,function(Ie){return Ie(T)});return{criteria:J,index:++l,value:T}});return hl(_,function(T,P){return Ds(T,P,a)})}function Gl(e,r){return ja(e,r,function(a,l){return Qd(e,l)})}function ja(e,r,a){for(var l=-1,_=r.length,T={};++l<_;){var P=r[l],H=ha(e,P);a(H,P)&&bs(T,pi(P,e),H)}return T}function Bf(e){return function(r){return ha(r,e)}}function Ul(e,r,a,l){var _=l?Ia:Hi,T=-1,P=r.length,H=e;for(e===r&&(r=kn(r)),a&&(H=Pr(e,Zn(a)));++T<P;)for(var J=0,Ie=r[T],Ne=a?a(Ie):Ie;(J=_(H,Ne,J,l))>-1;)H!==e&&os.call(H,J,1),os.call(e,J,1);return e}function _c(e,r){for(var a=e?r.length:0,l=a-1;a--;){var _=r[a];if(a==l||_!==T){var T=_;V(_)?os.call(e,_,1):zl(e,_)}}return e}function wo(e,r){return e+Df(El()*(r-e+1))}function pc(e,r,a,l){for(var _=-1,T=Xr(oo((r-e)/(a||1)),0),P=he(T);T--;)P[l?T:++_]=e,e+=a;return P}function So(e,r){var a="";if(!e||r<1||r>Ze)return a;do r%2&&(a+=e),r=Df(r/2),r&&(e+=e);while(r);return a}function rr(e,r){return Rt(qe(e,r,si),e+"")}function Pf(e){return fc(Fo(e))}function Yl(e,r){var a=Fo(e);return Lr(a,Wa(r,0,a.length))}function bs(e,r,a,l){if(!tn(e))return e;r=pi(r,e);for(var _=-1,T=r.length,P=T-1,H=e;H!=null&&++_<T;){var J=Dr(r[_]),Ie=a;if(J==="__proto__"||J==="constructor"||J==="prototype")return e;if(_!=P){var Ne=H[J];Ie=l?l(Ne,J,H):i,Ie===i&&(Ie=tn(Ne)?Ne:V(r[_+1])?[]:{})}hs(H,J,Ie),H=H[J]}return e}var mc=us?function(e,r){return us.set(e,r),e}:si,gc=ls?function(e,r){return ls(e,"toString",{configurable:!0,enumerable:!1,value:e0(r),writable:!0})}:si;function Pd(e){return Lr(Fo(e))}function ni(e,r,a){var l=-1,_=e.length;r<0&&(r=-r>_?0:_+r),a=a>_?_:a,a<0&&(a+=_),_=r>a?0:a-r>>>0,r>>>=0;for(var T=he(_);++l<_;)T[l]=e[l+r];return T}function Gd(e,r){var a;return Li(e,function(l,_,T){return a=r(l,_,T),!a}),!!a}function To(e,r,a){var l=0,_=e==null?l:e.length;if(typeof r=="number"&&r===r&&_<=sr){for(;l<_;){var T=l+_>>>1,P=e[T];P!==null&&!bi(P)&&(a?P<=r:P<r)?l=T+1:_=T}return _}return Hl(e,r,si,a)}function Hl(e,r,a,l){var _=0,T=e==null?0:e.length;if(T===0)return 0;r=a(r);for(var P=r!==r,H=r===null,J=bi(r),Ie=r===i;_<T;){var Ne=Df((_+T)/2),ze=a(e[Ne]),vt=ze!==i,Ot=ze===null,Yt=ze===ze,fr=bi(ze);if(P)var Ht=l||Yt;else Ie?Ht=Yt&&(l||vt):H?Ht=Yt&&vt&&(l||!Ot):J?Ht=Yt&&vt&&!Ot&&(l||!fr):Ot||fr?Ht=!1:Ht=l?ze<=r:ze<r;Ht?_=Ne+1:T=Ne}return Rn(T,Qt)}function yc(e,r){for(var a=-1,l=e.length,_=0,T=[];++a<l;){var P=e[a],H=r?r(P):P;if(!a||!Qi(H,J)){var J=H;T[_++]=P===0?0:P}}return T}function bc(e){return typeof e=="number"?e:bi(e)?$t:+e}function Xn(e){if(typeof e=="string")return e;if(Jt(e))return Pr(e,Xn)+"";if(bi(e))return Dl?Dl.call(e):"";var r=e+"";return r=="0"&&1/e==-Me?"-0":r}function pa(e,r,a){var l=-1,_=Qs,T=e.length,P=!0,H=[],J=H;if(a)P=!1,_=ll;else if(T>=h){var Ie=r?null:zd(e);if(Ie)return ns(Ie);P=!1,_=fa,J=new za}else J=r?[]:H;e:for(;++l<T;){var Ne=e[l],ze=r?r(Ne):Ne;if(Ne=a||Ne!==0?Ne:0,P&&ze===ze){for(var vt=J.length;vt--;)if(J[vt]===ze)continue e;r&&J.push(ze),H.push(Ne)}else _(J,ze,a)||(J!==H&&J.push(ze),H.push(Ne))}return H}function zl(e,r){return r=pi(r,e),e=Mt(e,r),e==null||delete e[Dr(N(r))]}function Eo(e,r,a,l){return bs(e,r,a(ha(e,r)),l)}function Qa(e,r,a,l){for(var _=e.length,T=l?_:-1;(l?T--:++T<_)&&r(e[T],T,e););return a?ni(e,l?0:T,l?T+1:_):ni(e,l?T+1:0,l?_:T)}function xs(e,r){var a=e;return a instanceof ur&&(a=a.value()),ul(r,function(l,_){return _.func.apply(_.thisArg,Yi([l],_.args))},a)}function Gf(e,r,a){var l=e.length;if(l<2)return l?pa(e[0]):[];for(var _=-1,T=he(l);++_<l;)for(var P=e[_],H=-1;++H<l;)H!=_&&(T[_]=$a(T[_]||P,e[H],r,a));return pa(pn(T,1),r,a)}function Ao(e,r,a){for(var l=-1,_=e.length,T=r.length,P={};++l<_;){var H=l<T?r[l]:i;a(P,e[l],H)}return P}function Uf(e){return un(e)?e:[]}function Yf(e){return typeof e=="function"?e:si}function pi(e,r){return Jt(e)?e:Re(e,r)?[e]:Xt(Or(e))}var Wl=rr;function mi(e,r,a){var l=e.length;return a=a===i?l:a,!r&&a>=l?e:ni(e,r,a)}var ws=hd||function(e){return xn.clearTimeout(e)};function Ss(e,r){if(r)return e.slice();var a=e.length,l=wl?wl(a):new e.constructor(a);return e.copy(l),l}function Ja(e){var r=new e.constructor(e.byteLength);return new ss(r).set(new ss(e)),r}function Ts(e,r){var a=r?Ja(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.byteLength)}function Es(e){var r=new e.constructor(e.source,$n.exec(e));return r.lastIndex=e.lastIndex,r}function As(e){return Cf?Ar(Cf.call(e)):{}}function Hf(e,r){var a=r?Ja(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}function Do(e,r){if(e!==r){var a=e!==i,l=e===null,_=e===e,T=bi(e),P=r!==i,H=r===null,J=r===r,Ie=bi(r);if(!H&&!Ie&&!T&&e>r||T&&P&&J&&!H&&!Ie||l&&P&&J||!a&&J||!_)return 1;if(!l&&!T&&!Ie&&e<r||Ie&&a&&_&&!l&&!T||H&&a&&_||!P&&_||!J)return-1}return 0}function Ds(e,r,a){for(var l=-1,_=e.criteria,T=r.criteria,P=_.length,H=a.length;++l<P;){var J=Do(_[l],T[l]);if(J){if(l>=H)return J;var Ie=a[l];return J*(Ie=="desc"?-1:1)}}return e.index-r.index}function ma(e,r,a,l){for(var _=-1,T=e.length,P=a.length,H=-1,J=r.length,Ie=Xr(T-P,0),Ne=he(J+Ie),ze=!l;++H<J;)Ne[H]=r[H];for(;++_<P;)(ze||_<T)&&(Ne[a[_]]=e[_]);for(;Ie--;)Ne[H++]=e[_++];return Ne}function Vl(e,r,a,l){for(var _=-1,T=e.length,P=-1,H=a.length,J=-1,Ie=r.length,Ne=Xr(T-H,0),ze=he(Ne+Ie),vt=!l;++_<Ne;)ze[_]=e[_];for(var Ot=_;++J<Ie;)ze[Ot+J]=r[J];for(;++P<H;)(vt||_<T)&&(ze[Ot+a[P]]=e[_++]);return ze}function kn(e,r){var a=-1,l=e.length;for(r||(r=he(l));++a<l;)r[a]=e[a];return r}function Oi(e,r,a,l){var _=!a;a||(a={});for(var T=-1,P=r.length;++T<P;){var H=r[T],J=l?l(a[H],e[H],H,a,e):i;J===i&&(J=e[H]),_?Wn(a,H,J):hs(a,H,J)}return a}function Ud(e,r){return Oi(e,pe(e),r)}function Yd(e,r){return Oi(e,re(e),r)}function gi(e,r){return function(a,l){var _=Jt(a)?Hu:Nd,T=r?r():{};return _(a,e,Pt(l,2),T)}}function ef(e){return rr(function(r,a){var l=-1,_=a.length,T=_>1?a[_-1]:i,P=_>2?a[2]:i;for(T=e.length>3&&typeof T=="function"?(_--,T):i,P&&ne(a[0],a[1],P)&&(T=_<3?i:T,_=1),r=Ar(r);++l<_;){var H=a[l];H&&e(r,H,l,T)}return r})}function $l(e,r){return function(a,l){if(a==null)return a;if(!ai(a))return e(a,l);for(var _=a.length,T=r?_:-1,P=Ar(a);(r?T--:++T<_)&&l(P[T],T,P)!==!1;);return a}}function Zl(e){return function(r,a,l){for(var _=-1,T=Ar(r),P=l(r),H=P.length;H--;){var J=P[e?H:++_];if(a(T[J],J,T)===!1)break}return r}}function Hd(e,r,a){var l=r&se,_=Vn(e);function T(){var P=this&&this!==xn&&this instanceof T?_:e;return P.apply(l?a:this,arguments)}return T}function Xl(e){return function(r){r=Or(r);var a=Na(r)?Gn(r):i,l=a?a[0]:r.charAt(0),_=a?mi(a,1).join(""):r.slice(1);return l[e]()+_}}function zf(e){return function(r){return ul(d_(h_(r).replace(Kh,"")),e,"")}}function Vn(e){return function(){var r=arguments;switch(r.length){case 0:return new e;case 1:return new e(r[0]);case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[1],r[2]);case 4:return new e(r[0],r[1],r[2],r[3]);case 5:return new e(r[0],r[1],r[2],r[3],r[4]);case 6:return new e(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new e(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var a=Ya(e.prototype),l=e.apply(a,r);return tn(l)?l:a}}function xc(e,r,a){var l=Vn(e);function _(){for(var T=arguments.length,P=he(T),H=T,J=nf(_);H--;)P[H]=arguments[H];var Ie=T<3&&P[0]!==J&&P[T-1]!==J?[]:zi(P,J);if(T-=Ie.length,T<a)return ql(e,r,Ls,_.placeholder,i,P,Ie,i,i,a-T);var Ne=this&&this!==xn&&this instanceof _?l:e;return _n(Ne,this,P)}return _}function tf(e){return function(r,a,l){var _=Ar(r);if(!ai(r)){var T=Pt(a,3);r=Fn(r),a=function(H){return T(_[H],H,_)}}var P=e(r,a,l);return P>-1?_[T?r[P]:P]:i}}function qi(e){return Ri(function(r){var a=r.length,l=a,_=ti.prototype.thru;for(e&&r.reverse();l--;){var T=r[l];if(typeof T!="function")throw new ei(u);if(_&&!P&&Mo(T)=="wrapper")var P=new ti([],!0)}for(l=P?l:a;++l<a;){T=r[l];var H=Mo(T),J=H=="wrapper"?Ql(T):i;J&&Se(J[0])&&J[1]==(ee|te|_e|Ce)&&!J[4].length&&J[9]==1?P=P[Mo(J[0])].apply(P,J[3]):P=T.length==1&&Se(T)?P[H]():P.thru(T)}return function(){var Ie=arguments,Ne=Ie[0];if(P&&Ie.length==1&&Jt(Ne))return P.plant(Ne).value();for(var ze=0,vt=a?r[ze].apply(this,Ie):Ne;++ze<a;)vt=r[ze].call(this,vt);return vt}})}function Ls(e,r,a,l,_,T,P,H,J,Ie){var Ne=r&ee,ze=r&se,vt=r&I,Ot=r&(te|ce),Yt=r&ut,fr=vt?i:Vn(e);function Ht(){for(var vr=arguments.length,yr=he(vr),xi=vr;xi--;)yr[xi]=arguments[xi];if(Ot)var Kn=nf(Ht),wi=wf(yr,Kn);if(l&&(yr=ma(yr,l,_,Ot)),T&&(yr=Vl(yr,T,P,Ot)),vr-=wi,Ot&&vr<Ie){var cn=zi(yr,Kn);return ql(e,r,Ls,Ht.placeholder,a,yr,cn,H,J,Ie-vr)}var Ji=ze?a:this,uf=vt?Ji[e]:e;return vr=yr.length,H?yr=Lt(yr,H):Yt&&vr>1&&yr.reverse(),Ne&&J<vr&&(yr.length=J),this&&this!==xn&&this instanceof Ht&&(uf=fr||Vn(uf)),uf.apply(Ji,yr)}return Ht}function Lo(e,r){return function(a,l){return cc(a,e,r(l),{})}}function rf(e,r){return function(a,l){var _;if(a===i&&l===i)return r;if(a!==i&&(_=a),l!==i){if(_===i)return l;typeof a=="string"||typeof l=="string"?(a=Xn(a),l=Xn(l)):(a=bc(a),l=bc(l)),_=e(a,l)}return _}}function Oo(e){return Ri(function(r){return r=Pr(r,Zn(Pt())),rr(function(a){var l=this;return e(r,function(_){return _n(_,l,a)})})})}function Hr(e,r){r=r===i?" ":Xn(r);var a=r.length;if(a<2)return a?So(r,e):r;var l=So(r,oo(e/sa(r)));return Na(r)?mi(Gn(l),0,e).join(""):l.slice(0,e)}function ga(e,r,a,l){var _=r&se,T=Vn(e);function P(){for(var H=-1,J=arguments.length,Ie=-1,Ne=l.length,ze=he(Ne+J),vt=this&&this!==xn&&this instanceof P?T:e;++Ie<Ne;)ze[Ie]=l[Ie];for(;J--;)ze[Ie++]=arguments[++H];return _n(vt,_?a:this,ze)}return P}function zr(e){return function(r,a,l){return l&&typeof l!="number"&&ne(r,a,l)&&(a=l=i),r=lf(r),a===i?(a=r,r=0):a=lf(a),l=l===i?r<a?1:-1:lf(l),pc(r,a,l,e)}}function Tn(e){return function(r,a){return typeof r=="string"&&typeof a=="string"||(r=Mi(r),a=Mi(a)),e(r,a)}}function ql(e,r,a,l,_,T,P,H,J,Ie){var Ne=r&te,ze=Ne?P:i,vt=Ne?i:P,Ot=Ne?T:i,Yt=Ne?i:T;r|=Ne?_e:we,r&=~(Ne?we:_e),r&U||(r&=~(se|I));var fr=[e,r,_,Ot,ze,Yt,vt,H,J,Ie],Ht=a.apply(i,fr);return Se(e)&&Je(Ht,fr),Ht.placeholder=l,Vt(Ht,e,r)}function Kl(e){var r=sn[e];return function(a,l){if(a=Mi(a),l=l==null?0:Rn(nr(l),292),l&&Tl(a)){var _=(Or(a)+"e").split("e"),T=r(_[0]+"e"+(+_[1]+l));return _=(Or(T)+"e").split("e"),+(_[0]+"e"+(+_[1]-l))}return r(a)}}var zd=Pa&&1/ns(new Pa([,-0]))[1]==Me?function(e){return new Pa(e)}:n0;function wc(e){return function(r){var a=ae(r);return a==Ir?io(r):a==Jr?Xu(r):id(r,e(r))}}function Ki(e,r,a,l,_,T,P,H){var J=r&I;if(!J&&typeof e!="function")throw new ei(u);var Ie=l?l.length:0;if(Ie||(r&=~(_e|we),l=_=i),P=P===i?P:Xr(nr(P),0),H=H===i?H:nr(H),Ie-=_?_.length:0,r&we){var Ne=l,ze=_;l=_=i}var vt=J?i:Ql(e),Ot=[e,r,a,l,_,Ne,ze,T,P,H];if(vt&&Ve(Ot,vt),e=Ot[0],r=Ot[1],a=Ot[2],l=Ot[3],_=Ot[4],H=Ot[9]=Ot[9]===i?J?0:e.length:Xr(Ot[9]-Ie,0),!H&&r&(te|ce)&&(r&=~(te|ce)),!r||r==se)var Yt=Hd(e,r,a);else r==te||r==ce?Yt=xc(e,r,H):(r==_e||r==(se|_e))&&!_.length?Yt=ga(e,r,a,l):Yt=Ls.apply(i,Ot);var fr=vt?mc:Je;return Vt(fr(Yt,Ot),e,r)}function jl(e,r,a,l){return e===i||Qi(e,Ef[a])&&!gr.call(l,a)?r:e}function Sc(e,r,a,l,_,T){return tn(e)&&tn(r)&&(T.set(r,e),Ka(e,r,i,Sc,T),T.delete(r)),e}function Wd(e){return Jl(e)?i:e}function Tc(e,r,a,l,_,T){var P=a&S,H=e.length,J=r.length;if(H!=J&&!(P&&J>H))return!1;var Ie=T.get(e),Ne=T.get(r);if(Ie&&Ne)return Ie==r&&Ne==e;var ze=-1,vt=!0,Ot=a&de?new za:i;for(T.set(e,r),T.set(r,e);++ze<H;){var Yt=e[ze],fr=r[ze];if(l)var Ht=P?l(fr,Yt,ze,r,e,T):l(Yt,fr,ze,e,r,T);if(Ht!==i){if(Ht)continue;vt=!1;break}if(Ot){if(!Js(r,function(vr,yr){if(!fa(Ot,yr)&&(Yt===vr||_(Yt,vr,a,l,T)))return Ot.push(yr)})){vt=!1;break}}else if(!(Yt===fr||_(Yt,fr,a,l,T))){vt=!1;break}}return T.delete(e),T.delete(r),vt}function Vd(e,r,a,l,_,T,P){switch(a){case Er:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case Bn:return!(e.byteLength!=r.byteLength||!T(new ss(e),new ss(r)));case Gt:case kt:case Zr:return Qi(+e,+r);case jr:return e.name==r.name&&e.message==r.message;case An:case an:return e==r+"";case Ir:var H=io;case Jr:var J=l&S;if(H||(H=ns),e.size!=r.size&&!J)return!1;var Ie=P.get(e);if(Ie)return Ie==r;l|=de,P.set(e,r);var Ne=Tc(H(e),H(r),l,_,T,P);return P.delete(e),Ne;case w:if(Cf)return Cf.call(e)==Cf.call(r)}return!1}function $d(e,r,a,l,_,T){var P=a&S,H=Ro(e),J=H.length,Ie=Ro(r),Ne=Ie.length;if(J!=Ne&&!P)return!1;for(var ze=J;ze--;){var vt=H[ze];if(!(P?vt in r:gr.call(r,vt)))return!1}var Ot=T.get(e),Yt=T.get(r);if(Ot&&Yt)return Ot==r&&Yt==e;var fr=!0;T.set(e,r),T.set(r,e);for(var Ht=P;++ze<J;){vt=H[ze];var vr=e[vt],yr=r[vt];if(l)var xi=P?l(yr,vr,vt,r,e,T):l(vr,yr,vt,e,r,T);if(!(xi===i?vr===yr||_(vr,yr,a,l,T):xi)){fr=!1;break}Ht||(Ht=vt=="constructor")}if(fr&&!Ht){var Kn=e.constructor,wi=r.constructor;Kn!=wi&&"constructor"in e&&"constructor"in r&&!(typeof Kn=="function"&&Kn instanceof Kn&&typeof wi=="function"&&wi instanceof wi)&&(fr=!1)}return T.delete(e),T.delete(r),fr}function Ri(e){return Rt(qe(e,i,O),e+"")}function Ro(e){return Il(e,Fn,pe)}function Co(e){return Il(e,fi,re)}var Ql=us?function(e){return us.get(e)}:n0;function Mo(e){for(var r=e.name+"",a=Cn[r],l=gr.call(Cn,r)?a.length:0;l--;){var _=a[l],T=_.func;if(T==null||T==e)return _.name}return r}function nf(e){var r=gr.call(b,"placeholder")?b:e;return r.placeholder}function Pt(){var e=b.iteratee||t0;return e=e===t0?Ff:e,arguments.length?e(arguments[0],arguments[1]):e}function c(e,r){var a=e.__data__;return rt(r)?a[typeof r=="string"?"string":"hash"]:a.map}function x(e){for(var r=Fn(e),a=r.length;a--;){var l=r[a],_=e[l];r[a]=[l,_,ye(_)]}return r}function C(e,r){var a=ml(e,r);return If(a)?a:i}function ie(e){var r=gr.call(e,oa),a=e[oa];try{e[oa]=i;var l=!0}catch{}var _=Un.call(e);return l&&(r?e[oa]=a:delete e[oa]),_}var pe=lo?function(e){return e==null?[]:(e=Ar(e),Di(lo(e),function(r){return on.call(e,r)}))}:i0,re=lo?function(e){for(var r=[];e;)Yi(r,pe(e)),e=so(e);return r}:i0,ae=Mn;(co&&ae(new co(new ArrayBuffer(1)))!=Er||Lf&&ae(new Lf)!=Ir||ho&&ae(ho.resolve())!=Nt||Pa&&ae(new Pa)!=Jr||Of&&ae(new Of)!=dn)&&(ae=function(e){var r=Mn(e),a=r==ar?e.constructor:i,l=a?pr(a):"";if(l)switch(l){case ec:return Er;case md:return Ir;case Vi:return Nt;case Al:return Jr;case Ga:return dn}return r});function De(e,r,a){for(var l=-1,_=a.length;++l<_;){var T=a[l],P=T.size;switch(T.type){case"drop":e+=P;break;case"dropRight":r-=P;break;case"take":r=Rn(r,e+P);break;case"takeRight":e=Xr(e,r-P);break}}return{start:e,end:r}}function Ae(e){var r=e.match(Ra);return r?r[1].split(Ca):[]}function Be(e,r,a){r=pi(r,e);for(var l=-1,_=r.length,T=!1;++l<_;){var P=Dr(r[l]);if(!(T=e!=null&&a(e,P)))break;e=e[P]}return T||++l!=_?T:(_=e==null?0:e.length,!!_&&Mc(_)&&V(P,_)&&(Jt(e)||Rs(e)))}function Ge(e){var r=e.length,a=new e.constructor(r);return r&&typeof e[0]=="string"&&gr.call(e,"index")&&(a.index=e.index,a.input=e.input),a}function Pe(e){return typeof e.constructor=="function"&&!pt(e)?Ya(so(e)):{}}function We(e,r,a){var l=e.constructor;switch(r){case Bn:return Ja(e);case Gt:case kt:return new l(+e);case Er:return Ts(e,a);case Dn:case Pn:case A:case Ue:case Xe:case dt:case z:case xe:case p:return Hf(e,a);case Ir:return new l;case Zr:case an:return new l(e);case An:return Es(e);case Jr:return new l;case w:return As(e)}}function Oe(e,r){var a=r.length;if(!a)return e;var l=a-1;return r[l]=(a>1?"& ":"")+r[l],r=r.join(a>2?", ":" "),e.replace(Ln,`{
|
|
18
|
-
/* [wrapped with `+r+`] */
|
|
19
|
-
`)}function Fe(e){return Jt(e)||Rs(e)||!!(Sl&&e&&e[Sl])}function V(e,r){var a=typeof e;return r=r==null?Ze:r,!!r&&(a=="number"||a!="symbol"&&Ih.test(e))&&e>-1&&e%1==0&&e<r}function ne(e,r,a){if(!tn(a))return!1;var l=typeof r;return(l=="number"?ai(a)&&V(r,a.length):l=="string"&&r in a)?Qi(a[r],e):!1}function Re(e,r){if(Jt(e))return!1;var a=typeof e;return a=="number"||a=="symbol"||a=="boolean"||e==null||bi(e)?!0:lr.test(e)||!mt.test(e)||r!=null&&e in Ar(r)}function rt(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function Se(e){var r=Mo(e),a=b[r];if(typeof a!="function"||!(r in ur.prototype))return!1;if(e===a)return!0;var l=Ql(a);return!!l&&e===l[0]}function Qe(e){return!!as&&as in e}var je=fo?of:a0;function pt(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||Ef;return e===a}function ye(e){return e===e&&!tn(e)}function me(e,r){return function(a){return a==null?!1:a[e]===r&&(r!==i||e in Ar(a))}}function ot(e){var r=Rc(e,function(l){return a.size===M&&a.clear(),l}),a=r.cache;return r}function Ve(e,r){var a=e[1],l=r[1],_=a|l,T=_<(se|I|ee),P=l==ee&&a==te||l==ee&&a==Ce&&e[7].length<=r[8]||l==(ee|Ce)&&r[7].length<=r[8]&&a==te;if(!(T||P))return e;l&se&&(e[2]=r[2],_|=a&se?0:U);var H=r[3];if(H){var J=e[3];e[3]=J?ma(J,H,r[4]):H,e[4]=J?zi(e[3],k):r[4]}return H=r[5],H&&(J=e[5],e[5]=J?Vl(J,H,r[6]):H,e[6]=J?zi(e[5],k):r[6]),H=r[7],H&&(e[7]=H),l&ee&&(e[8]=e[8]==null?r[8]:Rn(e[8],r[8])),e[9]==null&&(e[9]=r[9]),e[0]=r[0],e[1]=_,e}function ke(e){var r=[];if(e!=null)for(var a in Ar(e))r.push(a);return r}function $e(e){return Un.call(e)}function qe(e,r,a){return r=Xr(r===i?e.length-1:r,0),function(){for(var l=arguments,_=-1,T=Xr(l.length-r,0),P=he(T);++_<T;)P[_]=l[r+_];_=-1;for(var H=he(r+1);++_<r;)H[_]=l[_];return H[r]=a(P),_n(e,this,H)}}function Mt(e,r){return r.length<2?e:ha(e,ni(r,0,-1))}function Lt(e,r){for(var a=e.length,l=Rn(r.length,a),_=kn(e);l--;){var T=r[l];e[l]=V(T,a)?_[T]:i}return e}function Ke(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}var Je=Mr(mc),wt=vd||function(e,r){return xn.setTimeout(e,r)},Rt=Mr(gc);function Vt(e,r,a){var l=r+"";return Rt(e,Oe(l,qr(Ae(l),a)))}function Mr(e){var r=0,a=0;return function(){var l=la(),_=tt-(l-a);if(a=l,_>0){if(++r>=ft)return arguments[0]}else r=0;return e.apply(i,arguments)}}function Lr(e,r){var a=-1,l=e.length,_=l-1;for(r=r===i?l:r;++a<r;){var T=wo(a,_),P=e[T];e[T]=e[a],e[a]=P}return e.length=r,e}var Xt=ot(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(ui,function(a,l,_,T){r.push(_?T.replace(fn,"$1"):l||a)}),r});function Dr(e){if(typeof e=="string"||bi(e))return e;var r=e+"";return r=="0"&&1/e==-Me?"-0":r}function pr(e){if(e!=null){try{return is.call(e)}catch{}try{return e+""}catch{}}return""}function qr(e,r){return wn(xr,function(a){var l="_."+a[0];r&a[1]&&!Qs(e,l)&&e.push(l)}),e.sort()}function Kr(e){if(e instanceof ur)return e.clone();var r=new ti(e.__wrapped__,e.__chain__);return r.__actions__=kn(e.__actions__),r.__index__=e.__index__,r.__values__=e.__values__,r}function en(e,r,a){(a?ne(e,r,a):r===i)?r=1:r=Xr(nr(r),0);var l=e==null?0:e.length;if(!l||r<1)return[];for(var _=0,T=0,P=he(oo(l/r));_<l;)P[T++]=ni(e,_,_+=r);return P}function ln(e){for(var r=-1,a=e==null?0:e.length,l=0,_=[];++r<a;){var T=e[r];T&&(_[l++]=T)}return _}function mn(){var e=arguments.length;if(!e)return[];for(var r=he(e-1),a=arguments[0],l=e;l--;)r[l-1]=arguments[l];return Yi(Jt(a)?kn(a):[a],pn(r,1))}var Wr=rr(function(e,r){return un(e)?$a(e,pn(r,1,un,!0)):[]}),Ut=rr(function(e,r){var a=N(r);return un(a)&&(a=i),un(e)?$a(e,pn(r,1,un,!0),Pt(a,2)):[]}),gn=rr(function(e,r){var a=N(r);return un(a)&&(a=i),un(e)?$a(e,pn(r,1,un,!0),i,a):[]});function cr(e,r,a){var l=e==null?0:e.length;return l?(r=a||r===i?1:nr(r),ni(e,r<0?0:r,l)):[]}function Tt(e,r,a){var l=e==null?0:e.length;return l?(r=a||r===i?1:nr(r),r=l-r,ni(e,0,r<0?0:r)):[]}function qt(e,r){return e&&e.length?Qa(e,Pt(r,3),!0,!0):[]}function er(e,r){return e&&e.length?Qa(e,Pt(r,3),!0):[]}function Vr(e,r,a,l){var _=e==null?0:e.length;return _?(a&&typeof a!="number"&&ne(e,r,a)&&(a=0,l=_),oc(e,r,a,l)):[]}function yi(e,r,a){var l=e==null?0:e.length;if(!l)return-1;var _=a==null?0:nr(a);return _<0&&(_=Xr(l+_,0)),bf(e,Pt(r,3),_)}function ya(e,r,a){var l=e==null?0:e.length;if(!l)return-1;var _=l-1;return a!==i&&(_=nr(a),_=a<0?Xr(l+_,0):Rn(_,l-1)),bf(e,Pt(r,3),_,!0)}function O(e){var r=e==null?0:e.length;return r?pn(e,1):[]}function fe(e){var r=e==null?0:e.length;return r?pn(e,Me):[]}function Q(e,r){var a=e==null?0:e.length;return a?(r=r===i?1:nr(r),pn(e,r)):[]}function st(e){for(var r=-1,a=e==null?0:e.length,l={};++r<a;){var _=e[r];l[_[0]]=_[1]}return l}function zt(e){return e&&e.length?e[0]:i}function E(e,r,a){var l=e==null?0:e.length;if(!l)return-1;var _=a==null?0:nr(a);return _<0&&(_=Xr(l+_,0)),Hi(e,r,_)}function m(e){var r=e==null?0:e.length;return r?ni(e,0,-1):[]}var B=rr(function(e){var r=Pr(e,Uf);return r.length&&r[0]===e[0]?ms(r):[]}),Z=rr(function(e){var r=N(e),a=Pr(e,Uf);return r===N(a)?r=i:a.pop(),a.length&&a[0]===e[0]?ms(a,Pt(r,2)):[]}),X=rr(function(e){var r=N(e),a=Pr(e,Uf);return r=typeof r=="function"?r:i,r&&a.pop(),a.length&&a[0]===e[0]?ms(a,i,r):[]});function G(e,r){return e==null?"":Qu.call(e,r)}function N(e){var r=e==null?0:e.length;return r?e[r-1]:i}function W(e,r,a){var l=e==null?0:e.length;if(!l)return-1;var _=l;return a!==i&&(_=nr(a),_=_<0?Xr(l+_,0):Rn(_,l-1)),r===r?yl(e,r,_):bf(e,eo,_,!0)}function D(e,r){return e&&e.length?Nf(e,nr(r)):i}var R=rr(L);function L(e,r){return e&&e.length&&r&&r.length?Ul(e,r):e}function j(e,r,a){return e&&e.length&&r&&r.length?Ul(e,r,Pt(a,2)):e}function q(e,r,a){return e&&e.length&&r&&r.length?Ul(e,r,i,a):e}var ve=Ri(function(e,r){var a=e==null?0:e.length,l=ca(e,r);return _c(e,Pr(r,function(_){return V(_,a)?+_:_}).sort(Do)),l});function be(e,r){var a=[];if(!(e&&e.length))return a;var l=-1,_=[],T=e.length;for(r=Pt(r,3);++l<T;){var P=e[l];r(P,l,e)&&(a.push(P),_.push(l))}return _c(e,_),a}function Ye(e){return e==null?e:Ju.call(e)}function Dt(e,r,a){var l=e==null?0:e.length;return l?(a&&typeof a!="number"&&ne(e,r,a)?(r=0,a=l):(r=r==null?0:nr(r),a=a===i?l:nr(a)),ni(e,r,a)):[]}function yt(e,r){return To(e,r)}function at(e,r,a){return Hl(e,r,Pt(a,2))}function Te(e,r){var a=e==null?0:e.length;if(a){var l=To(e,r);if(l<a&&Qi(e[l],r))return l}return-1}function le(e,r){return To(e,r,!0)}function ht(e,r,a){return Hl(e,r,Pt(a,2),!0)}function lt(e,r){var a=e==null?0:e.length;if(a){var l=To(e,r,!0)-1;if(Qi(e[l],r))return l}return-1}function Et(e){return e&&e.length?yc(e):[]}function dr(e,r){return e&&e.length?yc(e,Pt(r,2)):[]}function yn(e){var r=e==null?0:e.length;return r?ni(e,1,r):[]}function af(e,r,a){return e&&e.length?(r=a||r===i?1:nr(r),ni(e,0,r<0?0:r)):[]}function ji(e,r,a){var l=e==null?0:e.length;return l?(r=a||r===i?1:nr(r),r=l-r,ni(e,r<0?0:r,l)):[]}function Ci(e,r){return e&&e.length?Qa(e,Pt(r,3),!1,!0):[]}function ba(e,r){return e&&e.length?Qa(e,Pt(r,3)):[]}var ff=rr(function(e){return pa(pn(e,1,un,!0))}),Ec=rr(function(e){var r=N(e);return un(r)&&(r=i),pa(pn(e,1,un,!0),Pt(r,2))}),qn=rr(function(e){var r=N(e);return r=typeof r=="function"?r:i,pa(pn(e,1,un,!0),i,r)});function sf(e){return e&&e.length?pa(e):[]}function ii(e,r){return e&&e.length?pa(e,Pt(r,2)):[]}function Ac(e,r){return r=typeof r=="function"?r:i,e&&e.length?pa(e,i,r):[]}function In(e){if(!(e&&e.length))return[];var r=0;return e=Di(e,function(a){if(un(a))return r=Xr(a.length,r),!0}),dl(r,function(a){return Pr(e,Fa(a))})}function Os(e,r){if(!(e&&e.length))return[];var a=In(e);return r==null?a:Pr(a,function(l){return _n(r,i,l)})}var ko=rr(function(e,r){return un(e)?$a(e,r):[]}),$y=rr(function(e){return Gf(Di(e,un))}),Zy=rr(function(e){var r=N(e);return un(r)&&(r=i),Gf(Di(e,un),Pt(r,2))}),Xy=rr(function(e){var r=N(e);return r=typeof r=="function"?r:i,Gf(Di(e,un),i,r)}),qy=rr(In);function Ky(e,r){return Ao(e||[],r||[],hs)}function jy(e,r){return Ao(e||[],r||[],bs)}var Qy=rr(function(e){var r=e.length,a=r>1?e[r-1]:i;return a=typeof a=="function"?(e.pop(),a):i,Os(e,a)});function zv(e){var r=b(e);return r.__chain__=!0,r}function Jy(e,r){return r(e),e}function Dc(e,r){return r(e)}var eb=Ri(function(e){var r=e.length,a=r?e[0]:0,l=this.__wrapped__,_=function(T){return ca(T,e)};return r>1||this.__actions__.length||!(l instanceof ur)||!V(a)?this.thru(_):(l=l.slice(a,+a+(r?1:0)),l.__actions__.push({func:Dc,args:[_],thisArg:i}),new ti(l,this.__chain__).thru(function(T){return r&&!T.length&&T.push(i),T}))});function tb(){return zv(this)}function rb(){return new ti(this.value(),this.__chain__)}function nb(){this.__values__===i&&(this.__values__=n_(this.value()));var e=this.__index__>=this.__values__.length,r=e?i:this.__values__[this.__index__++];return{done:e,value:r}}function ib(){return this}function ab(e){for(var r,a=this;a instanceof cs;){var l=Kr(a);l.__index__=0,l.__values__=i,r?_.__wrapped__=l:r=l;var _=l;a=a.__wrapped__}return _.__wrapped__=e,r}function fb(){var e=this.__wrapped__;if(e instanceof ur){var r=e;return this.__actions__.length&&(r=new ur(this)),r=r.reverse(),r.__actions__.push({func:Dc,args:[Ye],thisArg:i}),new ti(r,this.__chain__)}return this.thru(Ye)}function sb(){return xs(this.__wrapped__,this.__actions__)}var ob=gi(function(e,r,a){gr.call(e,a)?++e[a]:Wn(e,a,1)});function lb(e,r,a){var l=Jt(e)?aa:Cl;return a&&ne(e,r,a)&&(r=i),l(e,Pt(r,3))}function ub(e,r){var a=Jt(e)?Di:Ml;return a(e,Pt(r,3))}var cb=tf(yi),hb=tf(ya);function db(e,r){return pn(Lc(e,r),1)}function vb(e,r){return pn(Lc(e,r),Me)}function _b(e,r,a){return a=a===i?1:nr(a),pn(Lc(e,r),a)}function Wv(e,r){var a=Jt(e)?wn:Li;return a(e,Pt(r,3))}function Vv(e,r){var a=Jt(e)?zu:mo;return a(e,Pt(r,3))}var pb=gi(function(e,r,a){gr.call(e,a)?e[a].push(r):Wn(e,a,[r])});function mb(e,r,a,l){e=ai(e)?e:Fo(e),a=a&&!l?nr(a):0;var _=e.length;return a<0&&(a=Xr(_+a,0)),kc(e)?a<=_&&e.indexOf(r,a)>-1:!!_&&Hi(e,r,a)>-1}var gb=rr(function(e,r,a){var l=-1,_=typeof r=="function",T=ai(e)?he(e.length):[];return Li(e,function(P){T[++l]=_?_n(r,P,a):Xa(P,r,a)}),T}),yb=gi(function(e,r,a){Wn(e,a,r)});function Lc(e,r){var a=Jt(e)?Pr:da;return a(e,Pt(r,3))}function bb(e,r,a,l){return e==null?[]:(Jt(r)||(r=r==null?[]:[r]),a=l?i:a,Jt(a)||(a=a==null?[]:[a]),xo(e,r,a))}var xb=gi(function(e,r,a){e[a?0:1].push(r)},function(){return[[],[]]});function wb(e,r,a){var l=Jt(e)?ul:cl,_=arguments.length<3;return l(e,Pt(r,4),a,_,Li)}function Sb(e,r,a){var l=Jt(e)?rd:cl,_=arguments.length<3;return l(e,Pt(r,4),a,_,mo)}function Tb(e,r){var a=Jt(e)?Di:Ml;return a(e,Cc(Pt(r,3)))}function Eb(e){var r=Jt(e)?fc:Pf;return r(e)}function Ab(e,r,a){(a?ne(e,r,a):r===i)?r=1:r=nr(r);var l=Jt(e)?Id:Yl;return l(e,r)}function Db(e){var r=Jt(e)?Fd:Pd;return r(e)}function Lb(e){if(e==null)return 0;if(ai(e))return kc(e)?sa(e):e.length;var r=ae(e);return r==Ir||r==Jr?e.size:Xi(e).length}function Ob(e,r,a){var l=Jt(e)?Js:Gd;return a&&ne(e,r,a)&&(r=i),l(e,Pt(r,3))}var Rb=rr(function(e,r){if(e==null)return[];var a=r.length;return a>1&&ne(e,r[0],r[1])?r=[]:a>2&&ne(r[0],r[1],r[2])&&(r=[r[0]]),xo(e,pn(r,1),[])}),Oc=dd||function(){return xn.Date.now()};function Cb(e,r){if(typeof r!="function")throw new ei(u);return e=nr(e),function(){if(--e<1)return r.apply(this,arguments)}}function $v(e,r,a){return r=a?i:r,r=e&&r==null?e.length:r,Ki(e,ee,i,i,i,i,r)}function Zv(e,r){var a;if(typeof r!="function")throw new ei(u);return e=nr(e),function(){return--e>0&&(a=r.apply(this,arguments)),e<=1&&(r=i),a}}var Zd=rr(function(e,r,a){var l=se;if(a.length){var _=zi(a,nf(Zd));l|=_e}return Ki(e,l,r,a,_)}),Xv=rr(function(e,r,a){var l=se|I;if(a.length){var _=zi(a,nf(Xv));l|=_e}return Ki(r,l,e,a,_)});function qv(e,r,a){r=a?i:r;var l=Ki(e,te,i,i,i,i,i,r);return l.placeholder=qv.placeholder,l}function Kv(e,r,a){r=a?i:r;var l=Ki(e,ce,i,i,i,i,i,r);return l.placeholder=Kv.placeholder,l}function jv(e,r,a){var l,_,T,P,H,J,Ie=0,Ne=!1,ze=!1,vt=!0;if(typeof e!="function")throw new ei(u);r=Mi(r)||0,tn(a)&&(Ne=!!a.leading,ze="maxWait"in a,T=ze?Xr(Mi(a.maxWait)||0,r):T,vt="trailing"in a?!!a.trailing:vt);function Ot(cn){var Ji=l,uf=_;return l=_=i,Ie=cn,P=e.apply(uf,Ji),P}function Yt(cn){return Ie=cn,H=wt(vr,r),Ne?Ot(cn):P}function fr(cn){var Ji=cn-J,uf=cn-Ie,p_=r-Ji;return ze?Rn(p_,T-uf):p_}function Ht(cn){var Ji=cn-J,uf=cn-Ie;return J===i||Ji>=r||Ji<0||ze&&uf>=T}function vr(){var cn=Oc();if(Ht(cn))return yr(cn);H=wt(vr,fr(cn))}function yr(cn){return H=i,vt&&l?Ot(cn):(l=_=i,P)}function xi(){H!==i&&ws(H),Ie=0,l=J=_=H=i}function Kn(){return H===i?P:yr(Oc())}function wi(){var cn=Oc(),Ji=Ht(cn);if(l=arguments,_=this,J=cn,Ji){if(H===i)return Yt(J);if(ze)return ws(H),H=wt(vr,r),Ot(J)}return H===i&&(H=wt(vr,r)),P}return wi.cancel=xi,wi.flush=Kn,wi}var Mb=rr(function(e,r){return po(e,1,r)}),kb=rr(function(e,r,a){return po(e,Mi(r)||0,a)});function Ib(e){return Ki(e,ut)}function Rc(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new ei(u);var a=function(){var l=arguments,_=r?r.apply(this,l):l[0],T=a.cache;if(T.has(_))return T.get(_);var P=e.apply(this,l);return a.cache=T.set(_,P)||T,P};return a.cache=new(Rc.Cache||$i),a}Rc.Cache=$i;function Cc(e){if(typeof e!="function")throw new ei(u);return function(){var r=arguments;switch(r.length){case 0:return!e.call(this);case 1:return!e.call(this,r[0]);case 2:return!e.call(this,r[0],r[1]);case 3:return!e.call(this,r[0],r[1],r[2])}return!e.apply(this,r)}}function Fb(e){return Zv(2,e)}var Nb=Wl(function(e,r){r=r.length==1&&Jt(r[0])?Pr(r[0],Zn(Pt())):Pr(pn(r,1),Zn(Pt()));var a=r.length;return rr(function(l){for(var _=-1,T=Rn(l.length,a);++_<T;)l[_]=r[_].call(this,l[_]);return _n(e,this,l)})}),Xd=rr(function(e,r){var a=zi(r,nf(Xd));return Ki(e,_e,i,r,a)}),Qv=rr(function(e,r){var a=zi(r,nf(Qv));return Ki(e,we,i,r,a)}),Bb=Ri(function(e,r){return Ki(e,Ce,i,i,i,r)});function Pb(e,r){if(typeof e!="function")throw new ei(u);return r=r===i?r:nr(r),rr(e,r)}function Gb(e,r){if(typeof e!="function")throw new ei(u);return r=r==null?0:Xr(nr(r),0),rr(function(a){var l=a[r],_=mi(a,0,r);return l&&Yi(_,l),_n(e,this,_)})}function Ub(e,r,a){var l=!0,_=!0;if(typeof e!="function")throw new ei(u);return tn(a)&&(l="leading"in a?!!a.leading:l,_="trailing"in a?!!a.trailing:_),jv(e,r,{leading:l,maxWait:r,trailing:_})}function Yb(e){return $v(e,1)}function Hb(e,r){return Xd(Yf(r),e)}function zb(){if(!arguments.length)return[];var e=arguments[0];return Jt(e)?e:[e]}function Wb(e){return Sn(e,$)}function Vb(e,r){return r=typeof r=="function"?r:i,Sn(e,$,r)}function $b(e){return Sn(e,g|$)}function Zb(e,r){return r=typeof r=="function"?r:i,Sn(e,g|$,r)}function Xb(e,r){return r==null||Va(e,r,Fn(r))}function Qi(e,r){return e===r||e!==e&&r!==r}var qb=Tn(ps),Kb=Tn(function(e,r){return e>=r}),Rs=Nl(function(){return arguments}())?Nl:function(e){return rn(e)&&gr.call(e,"callee")&&!on.call(e,"callee")},Jt=he.isArray,jb=Pu?Zn(Pu):hc;function ai(e){return e!=null&&Mc(e.length)&&!of(e)}function un(e){return rn(e)&&ai(e)}function Qb(e){return e===!0||e===!1||rn(e)&&Mn(e)==Gt}var Wf=_d||a0,Jb=Ui?Zn(Ui):Bl;function ex(e){return rn(e)&&e.nodeType===1&&!Jl(e)}function tx(e){if(e==null)return!0;if(ai(e)&&(Jt(e)||typeof e=="string"||typeof e.splice=="function"||Wf(e)||Io(e)||Rs(e)))return!e.length;var r=ae(e);if(r==Ir||r==Jr)return!e.size;if(pt(e))return!Xi(e).length;for(var a in e)if(gr.call(e,a))return!1;return!0}function rx(e,r){return kf(e,r)}function nx(e,r,a){a=typeof a=="function"?a:i;var l=a?a(e,r):i;return l===i?kf(e,r,i,a):!!l}function qd(e){if(!rn(e))return!1;var r=Mn(e);return r==jr||r==hn||typeof e.message=="string"&&typeof e.name=="string"&&!Jl(e)}function ix(e){return typeof e=="number"&&Tl(e)}function of(e){if(!tn(e))return!1;var r=Mn(e);return r==Ft||r==Br||r==wr||r==En}function Jv(e){return typeof e=="number"&&e==nr(e)}function Mc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ze}function tn(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}function rn(e){return e!=null&&typeof e=="object"}var e_=Gu?Zn(Gu):Pl;function ax(e,r){return e===r||gs(e,r,x(r))}function fx(e,r,a){return a=typeof a=="function"?a:i,gs(e,r,x(r),a)}function sx(e){return t_(e)&&e!=+e}function ox(e){if(je(e))throw new Zt(s);return If(e)}function lx(e){return e===null}function ux(e){return e==null}function t_(e){return typeof e=="number"||rn(e)&&Mn(e)==Zr}function Jl(e){if(!rn(e)||Mn(e)!=ar)return!1;var r=so(e);if(r===null)return!0;var a=gr.call(r,"constructor")&&r.constructor;return typeof a=="function"&&a instanceof a&&is.call(a)==Af}var Kd=Uu?Zn(Uu):vc;function cx(e){return Jv(e)&&e>=-Ze&&e<=Ze}var r_=yf?Zn(yf):yo;function kc(e){return typeof e=="string"||!Jt(e)&&rn(e)&&Mn(e)==an}function bi(e){return typeof e=="symbol"||rn(e)&&Mn(e)==w}var Io=Yu?Zn(Yu):Zi;function hx(e){return e===i}function dx(e){return rn(e)&&ae(e)==dn}function vx(e){return rn(e)&&Mn(e)==Gi}var _x=Tn(qa),px=Tn(function(e,r){return e<=r});function n_(e){if(!e)return[];if(ai(e))return kc(e)?Gn(e):kn(e);if(di&&e[di])return Zu(e[di]());var r=ae(e),a=r==Ir?io:r==Jr?ns:Fo;return a(e)}function lf(e){if(!e)return e===0?e:0;if(e=Mi(e),e===Me||e===-Me){var r=e<0?-1:1;return r*St}return e===e?e:0}function nr(e){var r=lf(e),a=r%1;return r===r?a?r-a:r:0}function i_(e){return e?Wa(nr(e),0,Wt):0}function Mi(e){if(typeof e=="number")return e;if(bi(e))return $t;if(tn(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=tn(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=Vu(e);var a=Ch.test(e);return a||kh.test(e)?js(e.slice(2),a?2:8):Ws.test(e)?$t:+e}function a_(e){return Oi(e,fi(e))}function mx(e){return e?Wa(nr(e),-Ze,Ze):e===0?e:0}function Or(e){return e==null?"":Xn(e)}var gx=ef(function(e,r){if(pt(r)||ai(r)){Oi(r,Fn(r),e);return}for(var a in r)gr.call(r,a)&&hs(e,a,r[a])}),f_=ef(function(e,r){Oi(r,fi(r),e)}),Ic=ef(function(e,r,a,l){Oi(r,fi(r),e,l)}),yx=ef(function(e,r,a,l){Oi(r,Fn(r),e,l)}),bx=Ri(ca);function xx(e,r){var a=Ya(e);return r==null?a:ds(a,r)}var wx=rr(function(e,r){e=Ar(e);var a=-1,l=r.length,_=l>2?r[2]:i;for(_&&ne(r[0],r[1],_)&&(l=1);++a<l;)for(var T=r[a],P=fi(T),H=-1,J=P.length;++H<J;){var Ie=P[H],Ne=e[Ie];(Ne===i||Qi(Ne,Ef[Ie])&&!gr.call(e,Ie))&&(e[Ie]=T[Ie])}return e}),Sx=rr(function(e){return e.push(i,Sc),_n(s_,i,e)});function Tx(e,r){return hi(e,Pt(r,3),ri)}function Ex(e,r){return hi(e,Pt(r,3),vs)}function Ax(e,r){return e==null?e:go(e,Pt(r,3),fi)}function Dx(e,r){return e==null?e:kl(e,Pt(r,3),fi)}function Lx(e,r){return e&&ri(e,Pt(r,3))}function Ox(e,r){return e&&vs(e,Pt(r,3))}function Rx(e){return e==null?[]:_s(e,Fn(e))}function Cx(e){return e==null?[]:_s(e,fi(e))}function jd(e,r,a){var l=e==null?i:ha(e,r);return l===i?a:l}function Mx(e,r){return e!=null&&Be(e,r,lc)}function Qd(e,r){return e!=null&&Be(e,r,uc)}var kx=Lo(function(e,r,a){r!=null&&typeof r.toString!="function"&&(r=Un.call(r)),e[r]=a},e0(si)),Ix=Lo(function(e,r,a){r!=null&&typeof r.toString!="function"&&(r=Un.call(r)),gr.call(e,r)?e[r].push(a):e[r]=[a]},Pt),Fx=rr(Xa);function Fn(e){return ai(e)?Ol(e):Xi(e)}function fi(e){return ai(e)?Ol(e,!0):ys(e)}function Nx(e,r){var a={};return r=Pt(r,3),ri(e,function(l,_,T){Wn(a,r(l,_,T),l)}),a}function Bx(e,r){var a={};return r=Pt(r,3),ri(e,function(l,_,T){Wn(a,_,r(l,_,T))}),a}var Px=ef(function(e,r,a){Ka(e,r,a)}),s_=ef(function(e,r,a,l){Ka(e,r,a,l)}),Gx=Ri(function(e,r){var a={};if(e==null)return a;var l=!1;r=Pr(r,function(T){return T=pi(T,e),l||(l=T.length>1),T}),Oi(e,Co(e),a),l&&(a=Sn(a,g|F|$,Wd));for(var _=r.length;_--;)zl(a,r[_]);return a});function Ux(e,r){return o_(e,Cc(Pt(r)))}var Yx=Ri(function(e,r){return e==null?{}:Gl(e,r)});function o_(e,r){if(e==null)return{};var a=Pr(Co(e),function(l){return[l]});return r=Pt(r),ja(e,a,function(l,_){return r(l,_[0])})}function Hx(e,r,a){r=pi(r,e);var l=-1,_=r.length;for(_||(_=1,e=i);++l<_;){var T=e==null?i:e[Dr(r[l])];T===i&&(l=_,T=a),e=of(T)?T.call(e):T}return e}function zx(e,r,a){return e==null?e:bs(e,r,a)}function Wx(e,r,a,l){return l=typeof l=="function"?l:i,e==null?e:bs(e,r,a,l)}var l_=wc(Fn),u_=wc(fi);function Vx(e,r,a){var l=Jt(e),_=l||Wf(e)||Io(e);if(r=Pt(r,4),a==null){var T=e&&e.constructor;_?a=l?new T:[]:tn(e)?a=of(T)?Ya(so(e)):{}:a={}}return(_?wn:ri)(e,function(P,H,J){return r(a,P,H,J)}),a}function $x(e,r){return e==null?!0:zl(e,r)}function Zx(e,r,a){return e==null?e:Eo(e,r,Yf(a))}function Xx(e,r,a,l){return l=typeof l=="function"?l:i,e==null?e:Eo(e,r,Yf(a),l)}function Fo(e){return e==null?[]:rs(e,Fn(e))}function qx(e){return e==null?[]:rs(e,fi(e))}function Kx(e,r,a){return a===i&&(a=r,r=i),a!==i&&(a=Mi(a),a=a===a?a:0),r!==i&&(r=Mi(r),r=r===r?r:0),Wa(Mi(e),r,a)}function jx(e,r,a){return r=lf(r),a===i?(a=r,r=0):a=lf(a),e=Mi(e),Fl(e,r,a)}function Qx(e,r,a){if(a&&typeof a!="boolean"&&ne(e,r,a)&&(r=a=i),a===i&&(typeof r=="boolean"?(a=r,r=i):typeof e=="boolean"&&(a=e,e=i)),e===i&&r===i?(e=0,r=1):(e=lf(e),r===i?(r=e,e=0):r=lf(r)),e>r){var l=e;e=r,r=l}if(a||e%1||r%1){var _=El();return Rn(e+_*(r-e+ia("1e-"+((_+"").length-1))),r)}return wo(e,r)}var Jx=zf(function(e,r,a){return r=r.toLowerCase(),e+(a?c_(r):r)});function c_(e){return Jd(Or(e).toLowerCase())}function h_(e){return e=Or(e),e&&e.replace(Fh,vl).replace(jh,"")}function ew(e,r,a){e=Or(e),r=Xn(r);var l=e.length;a=a===i?l:Wa(nr(a),0,l);var _=a;return a-=r.length,a>=0&&e.slice(a,_)==r}function tw(e){return e=Or(e),e&&Y.test(e)?e.replace(ge,_l):e}function rw(e){return e=Or(e),e&&hr.test(e)?e.replace(Fr,"\\$&"):e}var nw=zf(function(e,r,a){return e+(a?"-":"")+r.toLowerCase()}),iw=zf(function(e,r,a){return e+(a?" ":"")+r.toLowerCase()}),aw=Xl("toLowerCase");function fw(e,r,a){e=Or(e),r=nr(r);var l=r?sa(e):0;if(!r||l>=r)return e;var _=(r-l)/2;return Hr(Df(_),a)+e+Hr(oo(_),a)}function sw(e,r,a){e=Or(e),r=nr(r);var l=r?sa(e):0;return r&&l<r?e+Hr(r-l,a):e}function ow(e,r,a){e=Or(e),r=nr(r);var l=r?sa(e):0;return r&&l<r?Hr(r-l,a)+e:e}function lw(e,r,a){return a||r==null?r=0:r&&(r=+r),uo(Or(e).replace(Yr,""),r||0)}function uw(e,r,a){return(a?ne(e,r,a):r===i)?r=1:r=nr(r),So(Or(e),r)}function cw(){var e=arguments,r=Or(e[0]);return e.length<3?r:r.replace(e[1],e[2])}var hw=zf(function(e,r,a){return e+(a?"_":"")+r.toLowerCase()});function dw(e,r,a){return a&&typeof a!="number"&&ne(e,r,a)&&(r=a=i),a=a===i?Wt:a>>>0,a?(e=Or(e),e&&(typeof r=="string"||r!=null&&!Kd(r))&&(r=Xn(r),!r&&Na(e))?mi(Gn(e),0,a):e.split(r,a)):[]}var vw=zf(function(e,r,a){return e+(a?" ":"")+Jd(r)});function _w(e,r,a){return e=Or(e),a=a==null?0:Wa(nr(a),0,e.length),r=Xn(r),e.slice(a,a+r.length)==r}function pw(e,r,a){var l=b.templateSettings;a&&ne(e,r,a)&&(r=i),e=Or(e),r=Ic({},r,l,jl);var _=Ic({},r.imports,l.imports,jl),T=Fn(_),P=rs(_,T),H,J,Ie=0,Ne=r.interpolate||Vs,ze="__p += '",vt=xl((r.escape||Vs).source+"|"+Ne.source+"|"+(Ne===it?ci:Vs).source+"|"+(r.evaluate||Vs).source+"|$","g"),Ot="//# sourceURL="+(gr.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ks+"]")+`
|
|
20
|
-
`;e.replace(vt,function(Ht,vr,yr,xi,Kn,wi){return yr||(yr=xi),ze+=e.slice(Ie,wi).replace(Nh,pl),vr&&(H=!0,ze+=`' +
|
|
21
|
-
__e(`+vr+`) +
|
|
22
|
-
'`),Kn&&(J=!0,ze+=`';
|
|
23
|
-
`+Kn+`;
|
|
24
|
-
__p += '`),yr&&(ze+=`' +
|
|
25
|
-
((__t = (`+yr+`)) == null ? '' : __t) +
|
|
26
|
-
'`),Ie=wi+Ht.length,Ht}),ze+=`';
|
|
27
|
-
`;var Yt=gr.call(r,"variable")&&r.variable;if(!Yt)ze=`with (obj) {
|
|
28
|
-
`+ze+`
|
|
29
|
-
}
|
|
30
|
-
`;else if(Hn.test(Yt))throw new Zt(d);ze=(J?ze.replace(He,""):ze).replace(Bt,"$1").replace(o,"$1;"),ze="function("+(Yt||"obj")+`) {
|
|
31
|
-
`+(Yt?"":`obj || (obj = {});
|
|
32
|
-
`)+"var __t, __p = ''"+(H?", __e = _.escape":"")+(J?`, __j = Array.prototype.join;
|
|
33
|
-
function print() { __p += __j.call(arguments, '') }
|
|
34
|
-
`:`;
|
|
35
|
-
`)+ze+`return __p
|
|
36
|
-
}`;var fr=v_(function(){return mr(T,Ot+"return "+ze).apply(i,P)});if(fr.source=ze,qd(fr))throw fr;return fr}function mw(e){return Or(e).toLowerCase()}function gw(e){return Or(e).toUpperCase()}function yw(e,r,a){if(e=Or(e),e&&(a||r===i))return Vu(e);if(!e||!(r=Xn(r)))return e;var l=Gn(e),_=Gn(r),T=ro(l,_),P=no(l,_)+1;return mi(l,T,P).join("")}function bw(e,r,a){if(e=Or(e),e&&(a||r===i))return e.slice(0,qu(e)+1);if(!e||!(r=Xn(r)))return e;var l=Gn(e),_=no(l,Gn(r))+1;return mi(l,0,_).join("")}function xw(e,r,a){if(e=Or(e),e&&(a||r===i))return e.replace(Yr,"");if(!e||!(r=Xn(r)))return e;var l=Gn(e),_=ro(l,Gn(r));return mi(l,_).join("")}function ww(e,r){var a=ct,l=nt;if(tn(r)){var _="separator"in r?r.separator:_;a="length"in r?nr(r.length):a,l="omission"in r?Xn(r.omission):l}e=Or(e);var T=e.length;if(Na(e)){var P=Gn(e);T=P.length}if(a>=T)return e;var H=a-sa(l);if(H<1)return l;var J=P?mi(P,0,H).join(""):e.slice(0,H);if(_===i)return J+l;if(P&&(H+=J.length-H),Kd(_)){if(e.slice(H).search(_)){var Ie,Ne=J;for(_.global||(_=xl(_.source,Or($n.exec(_))+"g")),_.lastIndex=0;Ie=_.exec(Ne);)var ze=Ie.index;J=J.slice(0,ze===i?H:ze)}}else if(e.indexOf(Xn(_),H)!=H){var vt=J.lastIndexOf(_);vt>-1&&(J=J.slice(0,vt))}return J+l}function Sw(e){return e=Or(e),e&&y.test(e)?e.replace(ue,ad):e}var Tw=zf(function(e,r,a){return e+(a?" ":"")+r.toUpperCase()}),Jd=Xl("toUpperCase");function d_(e,r,a){return e=Or(e),r=a?i:r,r===i?$u(e)?sd(e):nd(e):e.match(r)||[]}var v_=rr(function(e,r){try{return _n(e,i,r)}catch(a){return qd(a)?a:new Zt(a)}}),Ew=Ri(function(e,r){return wn(r,function(a){a=Dr(a),Wn(e,a,Zd(e[a],e))}),e});function Aw(e){var r=e==null?0:e.length,a=Pt();return e=r?Pr(e,function(l){if(typeof l[1]!="function")throw new ei(u);return[a(l[0]),l[1]]}):[],rr(function(l){for(var _=-1;++_<r;){var T=e[_];if(_n(T[0],this,l))return _n(T[1],this,l)}})}function Dw(e){return sc(Sn(e,g))}function e0(e){return function(){return e}}function Lw(e,r){return e==null||e!==e?r:e}var Ow=qi(),Rw=qi(!0);function si(e){return e}function t0(e){return Ff(typeof e=="function"?e:Sn(e,g))}function Cw(e){return va(Sn(e,g))}function Mw(e,r){return _a(e,Sn(r,g))}var kw=rr(function(e,r){return function(a){return Xa(a,e,r)}}),Iw=rr(function(e,r){return function(a){return Xa(e,a,r)}});function r0(e,r,a){var l=Fn(r),_=_s(r,l);a==null&&!(tn(r)&&(_.length||!l.length))&&(a=r,r=e,e=this,_=_s(r,Fn(r)));var T=!(tn(a)&&"chain"in a)||!!a.chain,P=of(e);return wn(_,function(H){var J=r[H];e[H]=J,P&&(e.prototype[H]=function(){var Ie=this.__chain__;if(T||Ie){var Ne=e(this.__wrapped__),ze=Ne.__actions__=kn(this.__actions__);return ze.push({func:J,args:arguments,thisArg:e}),Ne.__chain__=Ie,Ne}return J.apply(e,Yi([this.value()],arguments))})}),e}function Fw(){return xn._===this&&(xn._=Ku),this}function n0(){}function Nw(e){return e=nr(e),rr(function(r){return Nf(r,e)})}var Bw=Oo(Pr),Pw=Oo(aa),Gw=Oo(Js);function __(e){return Re(e)?Fa(Dr(e)):Bf(e)}function Uw(e){return function(r){return e==null?i:ha(e,r)}}var Yw=zr(),Hw=zr(!0);function i0(){return[]}function a0(){return!1}function zw(){return{}}function Ww(){return""}function Vw(){return!0}function $w(e,r){if(e=nr(e),e<1||e>Ze)return[];var a=Wt,l=Rn(e,Wt);r=Pt(r),e-=Wt;for(var _=dl(l,r);++a<e;)r(a);return _}function Zw(e){return Jt(e)?Pr(e,Dr):bi(e)?[e]:kn(Xt(Or(e)))}function Xw(e){var r=++cd;return Or(e)+r}var qw=rf(function(e,r){return e+r},0),Kw=Kl("ceil"),jw=rf(function(e,r){return e/r},1),Qw=Kl("floor");function Jw(e){return e&&e.length?Za(e,si,ps):i}function e2(e,r){return e&&e.length?Za(e,Pt(r,2),ps):i}function t2(e){return ts(e,si)}function r2(e,r){return ts(e,Pt(r,2))}function n2(e){return e&&e.length?Za(e,si,qa):i}function i2(e,r){return e&&e.length?Za(e,Pt(r,2),qa):i}var a2=rf(function(e,r){return e*r},1),f2=Kl("round"),s2=rf(function(e,r){return e-r},0);function o2(e){return e&&e.length?to(e,si):0}function l2(e,r){return e&&e.length?to(e,Pt(r,2)):0}return b.after=Cb,b.ary=$v,b.assign=gx,b.assignIn=f_,b.assignInWith=Ic,b.assignWith=yx,b.at=bx,b.before=Zv,b.bind=Zd,b.bindAll=Ew,b.bindKey=Xv,b.castArray=zb,b.chain=zv,b.chunk=en,b.compact=ln,b.concat=mn,b.cond=Aw,b.conforms=Dw,b.constant=e0,b.countBy=ob,b.create=xx,b.curry=qv,b.curryRight=Kv,b.debounce=jv,b.defaults=wx,b.defaultsDeep=Sx,b.defer=Mb,b.delay=kb,b.difference=Wr,b.differenceBy=Ut,b.differenceWith=gn,b.drop=cr,b.dropRight=Tt,b.dropRightWhile=qt,b.dropWhile=er,b.fill=Vr,b.filter=ub,b.flatMap=db,b.flatMapDeep=vb,b.flatMapDepth=_b,b.flatten=O,b.flattenDeep=fe,b.flattenDepth=Q,b.flip=Ib,b.flow=Ow,b.flowRight=Rw,b.fromPairs=st,b.functions=Rx,b.functionsIn=Cx,b.groupBy=pb,b.initial=m,b.intersection=B,b.intersectionBy=Z,b.intersectionWith=X,b.invert=kx,b.invertBy=Ix,b.invokeMap=gb,b.iteratee=t0,b.keyBy=yb,b.keys=Fn,b.keysIn=fi,b.map=Lc,b.mapKeys=Nx,b.mapValues=Bx,b.matches=Cw,b.matchesProperty=Mw,b.memoize=Rc,b.merge=Px,b.mergeWith=s_,b.method=kw,b.methodOf=Iw,b.mixin=r0,b.negate=Cc,b.nthArg=Nw,b.omit=Gx,b.omitBy=Ux,b.once=Fb,b.orderBy=bb,b.over=Bw,b.overArgs=Nb,b.overEvery=Pw,b.overSome=Gw,b.partial=Xd,b.partialRight=Qv,b.partition=xb,b.pick=Yx,b.pickBy=o_,b.property=__,b.propertyOf=Uw,b.pull=R,b.pullAll=L,b.pullAllBy=j,b.pullAllWith=q,b.pullAt=ve,b.range=Yw,b.rangeRight=Hw,b.rearg=Bb,b.reject=Tb,b.remove=be,b.rest=Pb,b.reverse=Ye,b.sampleSize=Ab,b.set=zx,b.setWith=Wx,b.shuffle=Db,b.slice=Dt,b.sortBy=Rb,b.sortedUniq=Et,b.sortedUniqBy=dr,b.split=dw,b.spread=Gb,b.tail=yn,b.take=af,b.takeRight=ji,b.takeRightWhile=Ci,b.takeWhile=ba,b.tap=Jy,b.throttle=Ub,b.thru=Dc,b.toArray=n_,b.toPairs=l_,b.toPairsIn=u_,b.toPath=Zw,b.toPlainObject=a_,b.transform=Vx,b.unary=Yb,b.union=ff,b.unionBy=Ec,b.unionWith=qn,b.uniq=sf,b.uniqBy=ii,b.uniqWith=Ac,b.unset=$x,b.unzip=In,b.unzipWith=Os,b.update=Zx,b.updateWith=Xx,b.values=Fo,b.valuesIn=qx,b.without=ko,b.words=d_,b.wrap=Hb,b.xor=$y,b.xorBy=Zy,b.xorWith=Xy,b.zip=qy,b.zipObject=Ky,b.zipObjectDeep=jy,b.zipWith=Qy,b.entries=l_,b.entriesIn=u_,b.extend=f_,b.extendWith=Ic,r0(b,b),b.add=qw,b.attempt=v_,b.camelCase=Jx,b.capitalize=c_,b.ceil=Kw,b.clamp=Kx,b.clone=Wb,b.cloneDeep=$b,b.cloneDeepWith=Zb,b.cloneWith=Vb,b.conformsTo=Xb,b.deburr=h_,b.defaultTo=Lw,b.divide=jw,b.endsWith=ew,b.eq=Qi,b.escape=tw,b.escapeRegExp=rw,b.every=lb,b.find=cb,b.findIndex=yi,b.findKey=Tx,b.findLast=hb,b.findLastIndex=ya,b.findLastKey=Ex,b.floor=Qw,b.forEach=Wv,b.forEachRight=Vv,b.forIn=Ax,b.forInRight=Dx,b.forOwn=Lx,b.forOwnRight=Ox,b.get=jd,b.gt=qb,b.gte=Kb,b.has=Mx,b.hasIn=Qd,b.head=zt,b.identity=si,b.includes=mb,b.indexOf=E,b.inRange=jx,b.invoke=Fx,b.isArguments=Rs,b.isArray=Jt,b.isArrayBuffer=jb,b.isArrayLike=ai,b.isArrayLikeObject=un,b.isBoolean=Qb,b.isBuffer=Wf,b.isDate=Jb,b.isElement=ex,b.isEmpty=tx,b.isEqual=rx,b.isEqualWith=nx,b.isError=qd,b.isFinite=ix,b.isFunction=of,b.isInteger=Jv,b.isLength=Mc,b.isMap=e_,b.isMatch=ax,b.isMatchWith=fx,b.isNaN=sx,b.isNative=ox,b.isNil=ux,b.isNull=lx,b.isNumber=t_,b.isObject=tn,b.isObjectLike=rn,b.isPlainObject=Jl,b.isRegExp=Kd,b.isSafeInteger=cx,b.isSet=r_,b.isString=kc,b.isSymbol=bi,b.isTypedArray=Io,b.isUndefined=hx,b.isWeakMap=dx,b.isWeakSet=vx,b.join=G,b.kebabCase=nw,b.last=N,b.lastIndexOf=W,b.lowerCase=iw,b.lowerFirst=aw,b.lt=_x,b.lte=px,b.max=Jw,b.maxBy=e2,b.mean=t2,b.meanBy=r2,b.min=n2,b.minBy=i2,b.stubArray=i0,b.stubFalse=a0,b.stubObject=zw,b.stubString=Ww,b.stubTrue=Vw,b.multiply=a2,b.nth=D,b.noConflict=Fw,b.noop=n0,b.now=Oc,b.pad=fw,b.padEnd=sw,b.padStart=ow,b.parseInt=lw,b.random=Qx,b.reduce=wb,b.reduceRight=Sb,b.repeat=uw,b.replace=cw,b.result=Hx,b.round=f2,b.runInContext=K,b.sample=Eb,b.size=Lb,b.snakeCase=hw,b.some=Ob,b.sortedIndex=yt,b.sortedIndexBy=at,b.sortedIndexOf=Te,b.sortedLastIndex=le,b.sortedLastIndexBy=ht,b.sortedLastIndexOf=lt,b.startCase=vw,b.startsWith=_w,b.subtract=s2,b.sum=o2,b.sumBy=l2,b.template=pw,b.times=$w,b.toFinite=lf,b.toInteger=nr,b.toLength=i_,b.toLower=mw,b.toNumber=Mi,b.toSafeInteger=mx,b.toString=Or,b.toUpper=gw,b.trim=yw,b.trimEnd=bw,b.trimStart=xw,b.truncate=ww,b.unescape=Sw,b.uniqueId=Xw,b.upperCase=Tw,b.upperFirst=Jd,b.each=Wv,b.eachRight=Vv,b.first=zt,r0(b,function(){var e={};return ri(b,function(r,a){gr.call(b.prototype,a)||(e[a]=r)}),e}(),{chain:!1}),b.VERSION=f,wn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){b[e].placeholder=b}),wn(["drop","take"],function(e,r){ur.prototype[e]=function(a){a=a===i?1:Xr(nr(a),0);var l=this.__filtered__&&!r?new ur(this):this.clone();return l.__filtered__?l.__takeCount__=Rn(a,l.__takeCount__):l.__views__.push({size:Rn(a,Wt),type:e+(l.__dir__<0?"Right":"")}),l},ur.prototype[e+"Right"]=function(a){return this.reverse()[e](a).reverse()}}),wn(["filter","map","takeWhile"],function(e,r){var a=r+1,l=a==Le||a==bt;ur.prototype[e]=function(_){var T=this.clone();return T.__iteratees__.push({iteratee:Pt(_,3),type:a}),T.__filtered__=T.__filtered__||l,T}}),wn(["head","last"],function(e,r){var a="take"+(r?"Right":"");ur.prototype[e]=function(){return this[a](1).value()[0]}}),wn(["initial","tail"],function(e,r){var a="drop"+(r?"":"Right");ur.prototype[e]=function(){return this.__filtered__?new ur(this):this[a](1)}}),ur.prototype.compact=function(){return this.filter(si)},ur.prototype.find=function(e){return this.filter(e).head()},ur.prototype.findLast=function(e){return this.reverse().find(e)},ur.prototype.invokeMap=rr(function(e,r){return typeof e=="function"?new ur(this):this.map(function(a){return Xa(a,e,r)})}),ur.prototype.reject=function(e){return this.filter(Cc(Pt(e)))},ur.prototype.slice=function(e,r){e=nr(e);var a=this;return a.__filtered__&&(e>0||r<0)?new ur(a):(e<0?a=a.takeRight(-e):e&&(a=a.drop(e)),r!==i&&(r=nr(r),a=r<0?a.dropRight(-r):a.take(r-e)),a)},ur.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ur.prototype.toArray=function(){return this.take(Wt)},ri(ur.prototype,function(e,r){var a=/^(?:filter|find|map|reject)|While$/.test(r),l=/^(?:head|last)$/.test(r),_=b[l?"take"+(r=="last"?"Right":""):r],T=l||/^find/.test(r);!_||(b.prototype[r]=function(){var P=this.__wrapped__,H=l?[1]:arguments,J=P instanceof ur,Ie=H[0],Ne=J||Jt(P),ze=function(vr){var yr=_.apply(b,Yi([vr],H));return l&&vt?yr[0]:yr};Ne&&a&&typeof Ie=="function"&&Ie.length!=1&&(J=Ne=!1);var vt=this.__chain__,Ot=!!this.__actions__.length,Yt=T&&!vt,fr=J&&!Ot;if(!T&&Ne){P=fr?P:new ur(this);var Ht=e.apply(P,H);return Ht.__actions__.push({func:Dc,args:[ze],thisArg:i}),new ti(Ht,vt)}return Yt&&fr?e.apply(this,H):(Ht=this.thru(ze),Yt?l?Ht.value()[0]:Ht.value():Ht)})}),wn(["pop","push","shift","sort","splice","unshift"],function(e){var r=ao[e],a=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);b.prototype[e]=function(){var _=arguments;if(l&&!this.__chain__){var T=this.value();return r.apply(Jt(T)?T:[],_)}return this[a](function(P){return r.apply(Jt(P)?P:[],_)})}}),ri(ur.prototype,function(e,r){var a=b[r];if(a){var l=a.name+"";gr.call(Cn,l)||(Cn[l]=[]),Cn[l].push({name:r,func:a})}}),Cn[Ls(i,I).name]=[{name:"wrapper",func:i}],ur.prototype.clone=gd,ur.prototype.reverse=yd,ur.prototype.value=bd,b.prototype.at=eb,b.prototype.chain=tb,b.prototype.commit=rb,b.prototype.next=nb,b.prototype.plant=ab,b.prototype.reverse=fb,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=sb,b.prototype.first=b.prototype.head,di&&(b.prototype[di]=ib),b},Tf=od();ka?((ka.exports=Tf)._=Tf,sl._=Tf):xn._=Tf}).call(Us)})(Ys,Ys.exports);const _f=Ys.exports,vh={normal:["FC6310R","FC6310"],infrared:["M3T"],multispectral:["FC6360"]};var Qn=63710088e-1,iv={centimeters:Qn*100,centimetres:Qn*100,degrees:Qn/111325,feet:Qn*3.28084,inches:Qn*39.37,kilometers:Qn/1e3,kilometres:Qn/1e3,meters:Qn,metres:Qn,miles:Qn/1609.344,millimeters:Qn*1e3,millimetres:Qn*1e3,nauticalmiles:Qn/1852,radians:1,yards:Qn*1.0936};function xg(t,n,i){i===void 0&&(i={});var f={type:"Feature"};return(i.id===0||i.id)&&(f.id=i.id),i.bbox&&(f.bbox=i.bbox),f.properties=n||{},f.geometry=t,f}function wg(t,n,i){if(i===void 0&&(i={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!av(t[0])||!av(t[1]))throw new Error("coordinates must contain numbers");var f={type:"Point",coordinates:t};return xg(f,n,i)}function Sg(t,n){n===void 0&&(n="kilometers");var i=iv[n];if(!i)throw new Error(n+" units is invalid");return t*i}function Tg(t,n){n===void 0&&(n="kilometers");var i=iv[n];if(!i)throw new Error(n+" units is invalid");return t/i}function _h(t){var n=t%(2*Math.PI);return n*180/Math.PI}function Bi(t){var n=t%360;return n*Math.PI/180}function av(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function Zo(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Eg(t,n){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function fv(t,n,i){i===void 0&&(i={});var f=Zo(t),h=Zo(n),s=Bi(h[1]-f[1]),u=Bi(h[0]-f[0]),d=Bi(f[1]),v=Bi(h[1]),M=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(u/2),2)*Math.cos(d)*Math.cos(v);return Sg(2*Math.atan2(Math.sqrt(M),Math.sqrt(1-M)),i.units)}function Ag(t,n,i,f){f===void 0&&(f={});var h=Zo(t),s=Bi(h[0]),u=Bi(h[1]),d=Bi(i),v=Tg(n,f.units),M=Math.asin(Math.sin(u)*Math.cos(v)+Math.cos(u)*Math.sin(v)*Math.cos(d)),k=s+Math.atan2(Math.sin(d)*Math.sin(v)*Math.cos(u),Math.cos(v)-Math.sin(u)*Math.sin(M)),g=_h(k),F=_h(M);return wg([g,F],f.properties)}function sv(t,n,i){if(i===void 0&&(i={}),i.final===!0)return Dg(t,n);var f=Zo(t),h=Zo(n),s=Bi(f[0]),u=Bi(h[0]),d=Bi(f[1]),v=Bi(h[1]),M=Math.sin(u-s)*Math.cos(v),k=Math.cos(d)*Math.sin(v)-Math.sin(d)*Math.cos(v)*Math.cos(u-s);return _h(Math.atan2(M,k))}function Dg(t,n){var i=sv(n,t);return i=(i+180)%360,i}function Lg(t,n){var i=fv(t,n),f=sv(t,n),h=Ag(t,i/2,f);return h}const ov=[{id:"annotation",type:"annotation",name:"\u6807\u6CE8",collapsed:!1,visible:!0,opacity:1},{id:"output",type:"output",name:"\u6210\u679C\u56FE\u5C42",collapsed:!1,visible:!0,opacity:1},{id:"dataset",type:"dataset",name:"\u6570\u636E\u96C6",collapsed:!1,visible:!0,opacity:1},{id:"overlay",type:"overlay",name:"\u8986\u76D6\u7269",collapsed:!1,visible:!0,opacity:1}],Og=[{type:"image",img:"satellite",name:"\u5F71\u50CF\u5730\u56FE",items:[{type:"raster",tileSize:256,tiles:["http://ecn.t3.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=1"],maxzoom:19,layerType:"bmap"},{type:"raster",tileSize:256,tiles:["https://t0.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=bfc12ce6bd94a4449ad626b8a0b709d0"],maxzoom:18,layerType:"bmap"}]},{type:"vector_standard",img:"vector_standard",name:"\u77E2\u91CF\u5730\u56FE",items:[{type:"raster",tileSize:256,tiles:["https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=bfc12ce6bd94a4449ad626b8a0b709d0"],maxzoom:18,layerType:"bmap"},{type:"raster",tileSize:256,tiles:["https://t0.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=bfc12ce6bd94a4449ad626b8a0b709d0"],maxzoom:18,layerType:"bmap"}]}],Rg=["#321644","#455dd1","#2eb4f2","#26eda6","#c3f134","#f8bd39","#e14209","#7a0403"],Cg=[{type:"dom",name:"\u6B63\u5C04\u5F71\u50CF\uFF08DOM\uFF09",group:"output",visible:!0,opacity:1,class:"image2d"},{type:"tmp",name:"\u6E29\u5EA6\u56FE",group:"output",visible:!0,opacity:1,class:"tmp"},{type:"dsm",name:"\u6570\u5B57\u8868\u9762\u6A21\u578B\uFF08DSM\uFF09",group:"output",visible:!1,opacity:.5,class:"image2d"},{type:"mesh3d",name:"\u4E09\u7EF4\u6A21\u578B",group:"output",visible:!0,opacity:1,class:"3d_tiles"},{type:"point_cloud",name:"\u4E09\u7EF4\u70B9\u4E91",group:"output",visible:!1,opacity:1,class:"pnts"},{type:"ndvi",name:"\u690D\u88AB\u6307\u6570\uFF08NDVI\uFF09",group:"output",visible:!0,opacity:1,class:"ndvi"},{type:"photos",name:"\u7167\u7247",group:"dataset",visible:!1,opacity:1,class:"photos"}],Mg={dom:"dom_tiles",dsm:"dsm_tiles",ndvi:"ndvi_tiles",tmp:"tem_tiles"},kg={annotation:"icon-biaozhu",output:"icon-chengguo",dataset:"icon-photos",overlay:"icon-dataset",geojson:"icon-vector",raster:"icon-tuxiang",object:"icon-cube",dom:"icon-tuxiang",dsm:"icon-moxing",ndvi:"icon-zhishu",mesh3d:"icon-mesh",point_cloud:"icon-dianyun",photos:"icon-24gf-photoAlbum",point:"icon-locate",line:"icon-line",polygon:"icon-polygon"},Ig={quality:"medium",output:{normal:[{type:"image2d",name:"\u4E8C\u7EF4\u6B63\u5C04\uFF08DOM+DSM\uFF09"},{type:"mesh3d",name:"\u4E09\u7EF4\u6A21\u578B\uFF083DTiles\uFF09"}],infrared:[{type:"tmp",name:"\u6E29\u5EA6\u56FE",required:!0}],multispectral:[{type:"image2d",name:"\u4E8C\u7EF4\u6B63\u5C04\uFF08DOM+DSM\uFF09"},{type:"ndvi",name:"\u690D\u88AB\u6307\u6570\uFF08NDVI\uFF09",required:!0}]}},Fg=[{type:"draw_point",mode:"draw_point",name:"\u6807\u70B9",icon:"icon-locate"},{type:"draw_line_string",mode:"draw_line_string",name:"\u6807\u7EBF",icon:"icon-line"},{type:"draw_polygon",mode:"draw_polygon",name:"\u6807\u9762",icon:"icon-polygon"}],Ng={normal:{point:[{field:"height",label:"\u9AD8\u7A0B",unit:"m"}],line:[{field:"distance2d",label:"\u5E73\u9762\u957F\u5EA6",unit:"m"},{field:"distance3d",label:"\u7A7A\u95F4\u957F\u5EA6",unit:"m"},{field:"slope_min",label:"\u6700\u5C0F\u5761\u5EA6",unit:"\xB0"},{field:"slope_max",label:"\u6700\u5927\u5761\u5EA6",unit:"\xB0"},{field:"height_min",label:"\u6700\u5C0F\u9AD8\u7A0B",unit:"m"},{field:"height_max",label:"\u6700\u5927\u9AD8\u7A0B",unit:"m"}],polygon:[{field:"area2d",label:"\u5E73\u9762\u9762\u79EF",unit:"\u33A1"},{field:"area3d",label:"\u7A7A\u95F4\u9762\u79EF",unit:"\u33A1"},{field:"distance2d",label:"\u5E73\u9762\u5468\u957F",unit:"m"},{field:"distance3d",label:"\u7A7A\u95F4\u5468\u957F",unit:"m"},{field:"height_min",label:"\u6700\u5C0F\u9AD8\u7A0B",unit:"m"},{field:"height_max",label:"\u6700\u5927\u9AD8\u7A0B",unit:"m"}]},infrared:{point:[{field:"temprature",label:"\u6E29\u5EA6",unit:"\u2103"}],line:[{field:"distance2d",label:"\u957F\u5EA6",unit:"m"},{field:"temprature_min",label:"\u6700\u4F4E\u6E29\u5EA6",unit:"\u2103"},{field:"temprature_max",label:"\u6700\u9AD8\u6E29\u5EA6",unit:"\u2103"}],polygon:[{field:"area2d",label:"\u9762\u79EF",unit:"\u33A1"},{field:"distance2d",label:"\u5468\u957F",unit:"m"},{field:"temprature_min",label:"\u6700\u4F4E\u6E29\u5EA6",unit:"\u2103"},{field:"temprature_max",label:"\u6700\u9AD8\u6E29\u5EA6",unit:"\u2103"}]},multispectral:{point:[{field:"height",label:"\u9AD8\u7A0B",unit:"m"}],line:[{field:"distance2d",label:"\u5E73\u9762\u957F\u5EA6",unit:"m"},{field:"distance3d",label:"\u7A7A\u95F4\u957F\u5EA6",unit:"m"},{field:"slope_min",label:"\u6700\u5C0F\u5761\u5EA6",unit:"\xB0"},{field:"slope_max",label:"\u6700\u5927\u5761\u5EA6",unit:"\xB0"},{field:"height_min",label:"\u6700\u5C0F\u9AD8\u7A0B",unit:"m"},{field:"height_max",label:"\u6700\u5927\u9AD8\u7A0B",unit:"m"}],polygon:[{field:"area2d",label:"\u5E73\u9762\u9762\u79EF",unit:"\u33A1"},{field:"area3d",label:"\u7A7A\u95F4\u9762\u79EF",unit:"\u33A1"},{field:"distance2d",label:"\u5E73\u9762\u5468\u957F",unit:"m"},{field:"distance3d",label:"\u7A7A\u95F4\u5468\u957F",unit:"m"},{field:"height_min",label:"\u6700\u5C0F\u9AD8\u7A0B",unit:"m"},{field:"height_max",label:"\u6700\u5927\u9AD8\u7A0B",unit:"m"}]}},Bg={LOCAL_ENU:{code:0,name:"LOCAL_ENU"},LOCAL:{code:1,name:"LOCAL"},GEOGCS:{code:2,name:"Geographic"},PROJCS:{code:3,name:"Projected"},GEOCCS:{code:4,name:"Geocentric"}};var Xo=typeof Float32Array<"u"?Float32Array:Array,lv=Math.random;Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});function pf(){var t=new Xo(16);return Xo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function uv(t,n,i,f,h,s,u,d,v,M,k,g,F,$,S,de){var se=new Xo(16);return se[0]=t,se[1]=n,se[2]=i,se[3]=f,se[4]=h,se[5]=s,se[6]=u,se[7]=d,se[8]=v,se[9]=M,se[10]=k,se[11]=g,se[12]=F,se[13]=$,se[14]=S,se[15]=de,se}function Pg(t,n){if(t===n){var i=n[1],f=n[2],h=n[3],s=n[6],u=n[7],d=n[11];t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=i,t[6]=n[9],t[7]=n[13],t[8]=f,t[9]=s,t[11]=n[14],t[12]=h,t[13]=u,t[14]=d}else t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=n[1],t[5]=n[5],t[6]=n[9],t[7]=n[13],t[8]=n[2],t[9]=n[6],t[10]=n[10],t[11]=n[14],t[12]=n[3],t[13]=n[7],t[14]=n[11],t[15]=n[15];return t}function xu(t,n,i){var f=n[0],h=n[1],s=n[2],u=n[3],d=n[4],v=n[5],M=n[6],k=n[7],g=n[8],F=n[9],$=n[10],S=n[11],de=n[12],se=n[13],I=n[14],U=n[15],te=i[0],ce=i[1],_e=i[2],we=i[3];return t[0]=te*f+ce*d+_e*g+we*de,t[1]=te*h+ce*v+_e*F+we*se,t[2]=te*s+ce*M+_e*$+we*I,t[3]=te*u+ce*k+_e*S+we*U,te=i[4],ce=i[5],_e=i[6],we=i[7],t[4]=te*f+ce*d+_e*g+we*de,t[5]=te*h+ce*v+_e*F+we*se,t[6]=te*s+ce*M+_e*$+we*I,t[7]=te*u+ce*k+_e*S+we*U,te=i[8],ce=i[9],_e=i[10],we=i[11],t[8]=te*f+ce*d+_e*g+we*de,t[9]=te*h+ce*v+_e*F+we*se,t[10]=te*s+ce*M+_e*$+we*I,t[11]=te*u+ce*k+_e*S+we*U,te=i[12],ce=i[13],_e=i[14],we=i[15],t[12]=te*f+ce*d+_e*g+we*de,t[13]=te*h+ce*v+_e*F+we*se,t[14]=te*s+ce*M+_e*$+we*I,t[15]=te*u+ce*k+_e*S+we*U,t}function Gg(t,n){var i=Math.sin(n),f=Math.cos(n);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=i,t[7]=0,t[8]=0,t[9]=-i,t[10]=f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ug(t,n){var i=Math.sin(n),f=Math.cos(n);return t[0]=f,t[1]=0,t[2]=-i,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=i,t[9]=0,t[10]=f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Yg(t,n){var i=Math.sin(n),f=Math.cos(n);return t[0]=f,t[1]=i,t[2]=0,t[3]=0,t[4]=-i,t[5]=f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function qf(){var t=new Xo(3);return Xo!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Hg(t,n,i){return t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function zg(t,n,i){return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t}function cv(t,n){var i=n[0],f=n[1],h=n[2],s=i*i+f*f+h*h;return s>0&&(s=1/Math.sqrt(s)),t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s,t}function hv(t,n){n=n||1;var i=lv()*2*Math.PI,f=lv()*2-1,h=Math.sqrt(1-f*f)*n;return t[0]=Math.cos(i)*h,t[1]=Math.sin(i)*h,t[2]=f*n,t}(function(){var t=qf();return function(n,i,f,h,s,u){var d,v;for(i||(i=3),f||(f=0),h?v=Math.min(h*i+f,n.length):v=n.length,d=f;d<v;d+=i)t[0]=n[d],t[1]=n[d+1],t[2]=n[d+2],s(t,t,u),n[d]=t[0],n[d+1]=t[1],n[d+2]=t[2];return n}})();function Wg(){return b_()}function Vg(t){return t?_t(t).format("YYYY-MM-DD HH:mm:ss"):"-"}function $g(){return _t().format("YYYY/M/D HH:mm:ss")}function Zg(t){return t=parseInt(t),t=t.toString(),t.length>6?(t=(Number(t)/1e6).toFixed(2),t+" MB"):(t=(Number(t)/1e3).toFixed(2),t+" KB")}function Xg(t){return t==="N"||t==="E"?1:-1}function qg(t){return t[0]+t[1]/60+t[2]/3600}function Kg(t,n=[]){t=dv(t),n=dv(n);let i=[];for(let f of t){let{visible:h}=f;for(let s of f.items||[]){let{id:u,type:d,opacity:v,visible:M,color:k,geometry:g}=s;if(h||(M=!1),["point","line","polygon"].includes(d)&&i.find(de=>de[0]==="updateAnnotations"))continue;let F=wu(u,n);if(!F&&!M)continue;if(!F){["point","line","polygon"].includes(d)?i.push(["updateAnnotations",s]):i.push(["addLayer",s]);continue}let{opacity:$,visible:S}=F;_f.isEqual(s,F)||(["point","line","polygon"].includes(d)?i.push(["updateAnnotations",s]):v!==$||d==="geojson"&&!_f.isEqual(s.metadata,F.metadata)?i.push(["updateLayer",s]):M!==S&&i.push([M?"addLayer":"removeLayer",s]))}}for(let f of n)for(let h of f.items||[]){let{id:s,type:u}=h;wu(s,t)||(["point","line","polygon"].includes(u)?i.find(v=>v[0]==="updateAnnotations")||i.push(["updateAnnotations",h]):i.push(["removeLayer",h]))}return i}function wu(t,n){var i;for(let f of n){if(f.id===t)return f;if((i=f.items)!=null&&i.length){let h=wu(t,f.items);if(h)return h}}return null}function dv(t){let n=_f.cloneDeep(t);for(let i of n)for(let f of i.items||[])i.visible||(f.visible=!1);return n}function jg(t,n){let i=t.style._layers,f=t.style.order,{layerType:h}=n.metadata;return f.find(d=>{let v=i[d].metadata;return _f.isEmpty(v)&&(v={layerType:"dsm"}),u(h,n.id)<u(v.layerType,d)})||"";function u(d,v){const M=[["bmap"],["dom"],["ndvi"],["dsm"],["circle"],["annotation"],["label"]];let k=-1;return v.startsWith("gl-draw")?k=5:k=M.findIndex(g=>g.includes(d)),k===-1?100:k}}function Qg(t){if(!t)return!1;let{message:n="",msg:i=""}=t.data;return t.status==401&&(i.toLowerCase().includes("expired")||n.toLowerCase().includes("expired"))}function Jg(t){for(let n in vh)if(vh[n].includes(t))return n;return"normal"}function ey(t){let n=`\u5FEB\u7167${_t().format("YYYYMMDD")}${new Date().getTime()}.png`,i=document.createElement("a");i.href=t,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i)}function ty(t){let n=Eg(t);return["Point","MultiPoint"].includes(n)?"point":["LineString","MultiLineString"].includes(n)?"line":"polygon"}function ry(t){let n=t[3]>128?0:1,i=-1*(1-n)+n,f=Math.floor((t[3]+.1)%128)*2+Math.floor((t[2]+.1)/128)-127,h=t[0]+t[1]*256+Math.floor((t[2]+.1)%128)*256*256;return i*(1+h/8388607)*Math.pow(2,f)}function ny(t){let{geometry:n}=t,i=_f.cloneDeep(t);return delete i.geometry,{id:i.id,type:"Feature",properties:i,geometry:_f.cloneDeep(n)}}function iy(t,n){let i=[],f=n==="point"?"\u70B9\u6CE8\u8BB0":n==="line"?"\u7EBF\u6CE8\u8BB0":"\u9762\u6CE8\u8BB0";t.forEach(h=>{if(h.name===f){i.push(0);return}if(h.name.startsWith(`${f} `)){let s=Number(h.name.split(" ").pop());Number.isNaN(s)||i.push(s)}}),i=i.sort((h,s)=>h-s);for(let h=0;h<i.length;h++)if(i[h]!==h)return h===0?f:`${f} ${h}`;return i.length===0?f:`${f} ${i.length}`}function ay(t){let n=t.geometry.coordinates,i=[];for(let v=1;v<n.length;v++)fv(n[v-1],n[v],{units:"meters"})>30&&i.push([n[v-1],n[v]]);let f=[];if(i.length){let v=Math.floor(i.length/2);f=i[v]}else{let v=Math.floor(n.length/2-1);f=[n[v],n[v+1]]}let h=ph(f[0]),s=ph(f[1]),u=360-Math.atan((h.y-s.y)/(s.x-h.x))*180/Math.PI,d=Lg(f[0],f[1]);return d.properties=t.properties,d.properties.angle=u,d.geometry.coordinates.push(((f[0][2]||0)+(f[1][2]||0))/2),d}function ph(t,n=12){let[i,f]=t,h=(180+i)/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+f*Math.PI/360)))/360;return{x:h*Math.pow(2,n)*512,y:s*Math.pow(2,n)*512}}function fy(t,n){n.forEach(i=>{t.loadImage(i,(f,h)=>{let s=i.split("/").pop().split(".")[0];if(!t.hasImage(s)){if(f)throw f;t.addImage(s,h)}})})}function sy(t,n,i){var s;let f=_f.cloneDeep(((s=t.metadata)==null?void 0:s.groups)||ov);return f.forEach(u=>u.items=[]),n.forEach(u=>{let d=_f.cloneDeep(u);d.group||d.group,f.find(M=>M.id===d.group).items.push(d)}),(t.status==="complete"?i:[]).forEach(u=>{let{group:d}=u,v=f.find(M=>M.id===d);!v||v.items.push(u)}),f}function oy(t){for(let n=0;n<t.length;n++)if(Number.isNaN(t[n]))return!0;return!1}function ly(t,n,i){let f=[],h=uv(0,1,0,0,1,0,0,0,0,0,-1,0,0,0,0,1),s=uv(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),u=Yg(pf(),i*Math.PI/180),d=Ug(pf(),t*Math.PI/180),v=Gg(pf(),n*Math.PI/180),M=xu(pf(),xu(pf(),u,d),v),k=xu(pf(),xu(pf(),s,Pg(pf(),M)),h);for(let g=0;g<3;g++)for(let F=0;F<3;F++)f[g*3+F]=k[g+F*4];return f}let mf=null;function vv(t,n,i){i[t]=i[t]||[],i[t].push(n)}function mh(t,n,i){if(i&&i[t]){const f=i[t].indexOf(n);f!==-1&&i[t].splice(f,1)}}function _v(t,...n){for(const i of n)for(const f in i)t[f]=i[f];return t}function uy(t,n){return t.indexOf(n,t.length-n.length)!==-1}class cy{constructor(){this._listeners=[],this._oneTimeListeners=[],this._eventedParent=null,this._eventedParentData=null}on(n,i){return this._listeners=this._listeners||{},vv(n,i,this._listeners),this}off(n,i){if(!i){this._listeners={},this._oneTimeListeners={};return}return mh(n,i,this._listeners),mh(n,i,this._oneTimeListeners),this}once(n,i){return this._oneTimeListeners=this._oneTimeListeners||{},vv(n,i,this._oneTimeListeners),this}fire(n,i){if(this.listens(n)){if(i=_v({},i,{type:n,target:this}),mf){if(i.point&&mf===i.point.x+i.point.y){if(mf===i.point.x+i.point.y)return;mf=i.point.x+i.point.y}else if(i.feature){if(mf===i.x+i.y)return;mf=i.x+i.y}}else i.point?mf=i.point.x+i.point.y:i.feature&&(mf=i.x+i.y);const f=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let s=0;s<f.length;s++)f[s].call(this,i);const h=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let s=0;s<h.length;s++)h[s].call(this,i),mh(n,h[s],this._oneTimeListeners);this._eventedParent&&this._eventedParent.fire(n,_v({},i,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData))}else uy(n,"error")&&console.error(i&&i.error||i||"Empty error event");return this}listens(n){return this._listeners&&this._listeners[n]&&this._listeners[n].length>0||this._oneTimeListeners&&this._oneTimeListeners[n]&&this._oneTimeListeners[n].length>0||this._eventedParent&&this._eventedParent.listens(n)}setEventedParent(n,i){return this._eventedParent=n,this._eventedParentData=i,this}}const hy={tileFormat:"float32",tileSize:256,colorScale:[],sentinelValues:[],transitions:!1,transitionTimeMs:800,debug:!1,extraPixelLayers:0,colorscaleMaxLength:16,sentinelMaxLength:16,minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,glOperation:"none",multiLayers:0,operationUrlA:"",operationUrlB:"",operationUrlC:"",operationUrlD:"",operationUrlE:"",operationUrlF:"",filterLowA:0,filterHighA:1e5,filterLowB:0,filterHighB:1e5,filterLowC:0,filterHighC:1e5,filterLowD:0,filterHighD:1e5,filterLowE:0,filterHighE:1e5,filterLowF:0,filterHighF:1e5,multiplierA:1,multiplierB:1,multiplierC:1,multiplierD:1,multiplierE:1,multiplierF:1,hillshadeType:"none",hsSimpleZoomdelta:0,hsSimpleSlopescale:3,hsSimpleAzimuth:315,hsSimpleAltitude:70,hsAdvValueScale:1,hsAdvPixelScale:"auto",hsAdvSoftIterations:10,hsAdvAmbientIterations:10,hsAdvSunRadiusMultiplier:100,hsAdvFinalSoftMultiplier:1,hsAdvFinalAmbientMultiplier:.25,hsAdvBaselayerUrl:"",hsAdvSmoothInput:!1,hsAdvSmoothInputKernel:3,hsPregenUrl:"",_hillshadeOptions:{hillshadeType:"none"},contourType:"none",contourSmoothLines:!1,contourSmoothInput:!1,contourSmoothInputKernel:7,contourScaleFactor:1,contourInterval:25,contourIndexInterval:100,contourLineColor:"#000000",contourIlluminatedHighlightColor:"rgba(177,174,164,.5)",contourIlluminatedShadowColor:"#5b5143",contourIlluminatedShadowSize:2,contourLineWeight:.5,contourLineIndexWeight:2,contourIndexLabels:!1,contourLabelFont:"12px Arial",contourLabelDistance:250,contourHypso:!1,contourHypsoDomain:[0,1e3,2e3],contourHypsoColors:["#486341","#e5d9c9","#dddddd"],contourBathy:!1,contourBathyDomain:[-2e3,0],contourBathyColors:["#315d9b","#d5f2ff"],contourBathyShadowColor:"#4e5c66",contourBathyHighlightColor:"rgba(224, 242, 255, .5)"};function dy(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gh={exports:{}},yh={},pv;function gf(){return pv||(pv=1,function(t){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function i(s,u){return Object.prototype.hasOwnProperty.call(s,u)}t.assign=function(s){for(var u=Array.prototype.slice.call(arguments,1);u.length;){var d=u.shift();if(!!d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var v in d)i(d,v)&&(s[v]=d[v])}}return s},t.shrinkBuf=function(s,u){return s.length===u?s:s.subarray?s.subarray(0,u):(s.length=u,s)};var f={arraySet:function(s,u,d,v,M){if(u.subarray&&s.subarray){s.set(u.subarray(d,d+v),M);return}for(var k=0;k<v;k++)s[M+k]=u[d+k]},flattenChunks:function(s){var u,d,v,M,k,g;for(v=0,u=0,d=s.length;u<d;u++)v+=s[u].length;for(g=new Uint8Array(v),M=0,u=0,d=s.length;u<d;u++)k=s[u],g.set(k,M),M+=k.length;return g}},h={arraySet:function(s,u,d,v,M){for(var k=0;k<v;k++)s[M+k]=u[d+k]},flattenChunks:function(s){return[].concat.apply([],s)}};t.setTyped=function(s){s?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,f)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,h))},t.setTyped(n)}(yh)),yh}var Hs={},Pi={},Kf={},mv;function vy(){if(mv)return Kf;mv=1;var t=gf(),n=4,i=0,f=1,h=2;function s(A){for(var Ue=A.length;--Ue>=0;)A[Ue]=0}var u=0,d=1,v=2,M=3,k=258,g=29,F=256,$=F+1+g,S=30,de=19,se=2*$+1,I=15,U=16,te=7,ce=256,_e=16,we=17,ee=18,Ce=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ut=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ct=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ft=512,tt=new Array(($+2)*2);s(tt);var Le=new Array(S*2);s(Le);var Ct=new Array(ft);s(Ct);var bt=new Array(k-M+1);s(bt);var Me=new Array(g);s(Me);var Ze=new Array(S);s(Ze);function St(A,Ue,Xe,dt,z){this.static_tree=A,this.extra_bits=Ue,this.extra_base=Xe,this.elems=dt,this.max_length=z,this.has_stree=A&&A.length}var $t,Wt,Qt;function sr(A,Ue){this.dyn_tree=A,this.max_code=0,this.stat_desc=Ue}function xr(A){return A<256?Ct[A]:Ct[256+(A>>>7)]}function or(A,Ue){A.pending_buf[A.pending++]=Ue&255,A.pending_buf[A.pending++]=Ue>>>8&255}function Kt(A,Ue,Xe){A.bi_valid>U-Xe?(A.bi_buf|=Ue<<A.bi_valid&65535,or(A,A.bi_buf),A.bi_buf=Ue>>U-A.bi_valid,A.bi_valid+=Xe-U):(A.bi_buf|=Ue<<A.bi_valid&65535,A.bi_valid+=Xe)}function wr(A,Ue,Xe){Kt(A,Xe[Ue*2],Xe[Ue*2+1])}function Gt(A,Ue){var Xe=0;do Xe|=A&1,A>>>=1,Xe<<=1;while(--Ue>0);return Xe>>>1}function kt(A){A.bi_valid===16?(or(A,A.bi_buf),A.bi_buf=0,A.bi_valid=0):A.bi_valid>=8&&(A.pending_buf[A.pending++]=A.bi_buf&255,A.bi_buf>>=8,A.bi_valid-=8)}function hn(A,Ue){var Xe=Ue.dyn_tree,dt=Ue.max_code,z=Ue.stat_desc.static_tree,xe=Ue.stat_desc.has_stree,p=Ue.stat_desc.extra_bits,He=Ue.stat_desc.extra_base,Bt=Ue.stat_desc.max_length,o,ue,ge,y,Y,oe,At=0;for(y=0;y<=I;y++)A.bl_count[y]=0;for(Xe[A.heap[A.heap_max]*2+1]=0,o=A.heap_max+1;o<se;o++)ue=A.heap[o],y=Xe[Xe[ue*2+1]*2+1]+1,y>Bt&&(y=Bt,At++),Xe[ue*2+1]=y,!(ue>dt)&&(A.bl_count[y]++,Y=0,ue>=He&&(Y=p[ue-He]),oe=Xe[ue*2],A.opt_len+=oe*(y+Y),xe&&(A.static_len+=oe*(z[ue*2+1]+Y)));if(At!==0){do{for(y=Bt-1;A.bl_count[y]===0;)y--;A.bl_count[y]--,A.bl_count[y+1]+=2,A.bl_count[Bt]--,At-=2}while(At>0);for(y=Bt;y!==0;y--)for(ue=A.bl_count[y];ue!==0;)ge=A.heap[--o],!(ge>dt)&&(Xe[ge*2+1]!==y&&(A.opt_len+=(y-Xe[ge*2+1])*Xe[ge*2],Xe[ge*2+1]=y),ue--)}}function jr(A,Ue,Xe){var dt=new Array(I+1),z=0,xe,p;for(xe=1;xe<=I;xe++)dt[xe]=z=z+Xe[xe-1]<<1;for(p=0;p<=Ue;p++){var He=A[p*2+1];He!==0&&(A[p*2]=Gt(dt[He]++,He))}}function Ft(){var A,Ue,Xe,dt,z,xe=new Array(I+1);for(Xe=0,dt=0;dt<g-1;dt++)for(Me[dt]=Xe,A=0;A<1<<Ce[dt];A++)bt[Xe++]=dt;for(bt[Xe-1]=dt,z=0,dt=0;dt<16;dt++)for(Ze[dt]=z,A=0;A<1<<ut[dt];A++)Ct[z++]=dt;for(z>>=7;dt<S;dt++)for(Ze[dt]=z<<7,A=0;A<1<<ut[dt]-7;A++)Ct[256+z++]=dt;for(Ue=0;Ue<=I;Ue++)xe[Ue]=0;for(A=0;A<=143;)tt[A*2+1]=8,A++,xe[8]++;for(;A<=255;)tt[A*2+1]=9,A++,xe[9]++;for(;A<=279;)tt[A*2+1]=7,A++,xe[7]++;for(;A<=287;)tt[A*2+1]=8,A++,xe[8]++;for(jr(tt,$+1,xe),A=0;A<S;A++)Le[A*2+1]=5,Le[A*2]=Gt(A,5);$t=new St(tt,Ce,F+1,$,I),Wt=new St(Le,ut,0,S,I),Qt=new St(new Array(0),ct,0,de,te)}function Br(A){var Ue;for(Ue=0;Ue<$;Ue++)A.dyn_ltree[Ue*2]=0;for(Ue=0;Ue<S;Ue++)A.dyn_dtree[Ue*2]=0;for(Ue=0;Ue<de;Ue++)A.bl_tree[Ue*2]=0;A.dyn_ltree[ce*2]=1,A.opt_len=A.static_len=0,A.last_lit=A.matches=0}function Ir(A){A.bi_valid>8?or(A,A.bi_buf):A.bi_valid>0&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function Zr(A,Ue,Xe,dt){Ir(A),dt&&(or(A,Xe),or(A,~Xe)),t.arraySet(A.pending_buf,A.window,Ue,Xe,A.pending),A.pending+=Xe}function Qr(A,Ue,Xe,dt){var z=Ue*2,xe=Xe*2;return A[z]<A[xe]||A[z]===A[xe]&&dt[Ue]<=dt[Xe]}function ar(A,Ue,Xe){for(var dt=A.heap[Xe],z=Xe<<1;z<=A.heap_len&&(z<A.heap_len&&Qr(Ue,A.heap[z+1],A.heap[z],A.depth)&&z++,!Qr(Ue,dt,A.heap[z],A.depth));)A.heap[Xe]=A.heap[z],Xe=z,z<<=1;A.heap[Xe]=dt}function Nt(A,Ue,Xe){var dt,z,xe=0,p,He;if(A.last_lit!==0)do dt=A.pending_buf[A.d_buf+xe*2]<<8|A.pending_buf[A.d_buf+xe*2+1],z=A.pending_buf[A.l_buf+xe],xe++,dt===0?wr(A,z,Ue):(p=bt[z],wr(A,p+F+1,Ue),He=Ce[p],He!==0&&(z-=Me[p],Kt(A,z,He)),dt--,p=xr(dt),wr(A,p,Xe),He=ut[p],He!==0&&(dt-=Ze[p],Kt(A,dt,He)));while(xe<A.last_lit);wr(A,ce,Ue)}function En(A,Ue){var Xe=Ue.dyn_tree,dt=Ue.stat_desc.static_tree,z=Ue.stat_desc.has_stree,xe=Ue.stat_desc.elems,p,He,Bt=-1,o;for(A.heap_len=0,A.heap_max=se,p=0;p<xe;p++)Xe[p*2]!==0?(A.heap[++A.heap_len]=Bt=p,A.depth[p]=0):Xe[p*2+1]=0;for(;A.heap_len<2;)o=A.heap[++A.heap_len]=Bt<2?++Bt:0,Xe[o*2]=1,A.depth[o]=0,A.opt_len--,z&&(A.static_len-=dt[o*2+1]);for(Ue.max_code=Bt,p=A.heap_len>>1;p>=1;p--)ar(A,Xe,p);o=xe;do p=A.heap[1],A.heap[1]=A.heap[A.heap_len--],ar(A,Xe,1),He=A.heap[1],A.heap[--A.heap_max]=p,A.heap[--A.heap_max]=He,Xe[o*2]=Xe[p*2]+Xe[He*2],A.depth[o]=(A.depth[p]>=A.depth[He]?A.depth[p]:A.depth[He])+1,Xe[p*2+1]=Xe[He*2+1]=o,A.heap[1]=o++,ar(A,Xe,1);while(A.heap_len>=2);A.heap[--A.heap_max]=A.heap[1],hn(A,Ue),jr(Xe,Bt,A.bl_count)}function An(A,Ue,Xe){var dt,z=-1,xe,p=Ue[0*2+1],He=0,Bt=7,o=4;for(p===0&&(Bt=138,o=3),Ue[(Xe+1)*2+1]=65535,dt=0;dt<=Xe;dt++)xe=p,p=Ue[(dt+1)*2+1],!(++He<Bt&&xe===p)&&(He<o?A.bl_tree[xe*2]+=He:xe!==0?(xe!==z&&A.bl_tree[xe*2]++,A.bl_tree[_e*2]++):He<=10?A.bl_tree[we*2]++:A.bl_tree[ee*2]++,He=0,z=xe,p===0?(Bt=138,o=3):xe===p?(Bt=6,o=3):(Bt=7,o=4))}function Jr(A,Ue,Xe){var dt,z=-1,xe,p=Ue[0*2+1],He=0,Bt=7,o=4;for(p===0&&(Bt=138,o=3),dt=0;dt<=Xe;dt++)if(xe=p,p=Ue[(dt+1)*2+1],!(++He<Bt&&xe===p)){if(He<o)do wr(A,xe,A.bl_tree);while(--He!==0);else xe!==0?(xe!==z&&(wr(A,xe,A.bl_tree),He--),wr(A,_e,A.bl_tree),Kt(A,He-3,2)):He<=10?(wr(A,we,A.bl_tree),Kt(A,He-3,3)):(wr(A,ee,A.bl_tree),Kt(A,He-11,7));He=0,z=xe,p===0?(Bt=138,o=3):xe===p?(Bt=6,o=3):(Bt=7,o=4)}}function an(A){var Ue;for(An(A,A.dyn_ltree,A.l_desc.max_code),An(A,A.dyn_dtree,A.d_desc.max_code),En(A,A.bl_desc),Ue=de-1;Ue>=3&&A.bl_tree[nt[Ue]*2+1]===0;Ue--);return A.opt_len+=3*(Ue+1)+5+5+4,Ue}function w(A,Ue,Xe,dt){var z;for(Kt(A,Ue-257,5),Kt(A,Xe-1,5),Kt(A,dt-4,4),z=0;z<dt;z++)Kt(A,A.bl_tree[nt[z]*2+1],3);Jr(A,A.dyn_ltree,Ue-1),Jr(A,A.dyn_dtree,Xe-1)}function li(A){var Ue=4093624447,Xe;for(Xe=0;Xe<=31;Xe++,Ue>>>=1)if(Ue&1&&A.dyn_ltree[Xe*2]!==0)return i;if(A.dyn_ltree[9*2]!==0||A.dyn_ltree[10*2]!==0||A.dyn_ltree[13*2]!==0)return f;for(Xe=32;Xe<F;Xe++)if(A.dyn_ltree[Xe*2]!==0)return f;return i}var dn=!1;function Gi(A){dn||(Ft(),dn=!0),A.l_desc=new sr(A.dyn_ltree,$t),A.d_desc=new sr(A.dyn_dtree,Wt),A.bl_desc=new sr(A.bl_tree,Qt),A.bi_buf=0,A.bi_valid=0,Br(A)}function Bn(A,Ue,Xe,dt){Kt(A,(u<<1)+(dt?1:0),3),Zr(A,Ue,Xe,!0)}function Er(A){Kt(A,d<<1,3),wr(A,ce,tt),kt(A)}function Dn(A,Ue,Xe,dt){var z,xe,p=0;A.level>0?(A.strm.data_type===h&&(A.strm.data_type=li(A)),En(A,A.l_desc),En(A,A.d_desc),p=an(A),z=A.opt_len+3+7>>>3,xe=A.static_len+3+7>>>3,xe<=z&&(z=xe)):z=xe=Xe+5,Xe+4<=z&&Ue!==-1?Bn(A,Ue,Xe,dt):A.strategy===n||xe===z?(Kt(A,(d<<1)+(dt?1:0),3),Nt(A,tt,Le)):(Kt(A,(v<<1)+(dt?1:0),3),w(A,A.l_desc.max_code+1,A.d_desc.max_code+1,p+1),Nt(A,A.dyn_ltree,A.dyn_dtree)),Br(A),dt&&Ir(A)}function Pn(A,Ue,Xe){return A.pending_buf[A.d_buf+A.last_lit*2]=Ue>>>8&255,A.pending_buf[A.d_buf+A.last_lit*2+1]=Ue&255,A.pending_buf[A.l_buf+A.last_lit]=Xe&255,A.last_lit++,Ue===0?A.dyn_ltree[Xe*2]++:(A.matches++,Ue--,A.dyn_ltree[(bt[Xe]+F+1)*2]++,A.dyn_dtree[xr(Ue)*2]++),A.last_lit===A.lit_bufsize-1}return Kf._tr_init=Gi,Kf._tr_stored_block=Bn,Kf._tr_flush_block=Dn,Kf._tr_tally=Pn,Kf._tr_align=Er,Kf}var bh,gv;function yv(){if(gv)return bh;gv=1;function t(n,i,f,h){for(var s=n&65535|0,u=n>>>16&65535|0,d=0;f!==0;){d=f>2e3?2e3:f,f-=d;do s=s+i[h++]|0,u=u+s|0;while(--d);s%=65521,u%=65521}return s|u<<16|0}return bh=t,bh}var xh,bv;function xv(){if(bv)return xh;bv=1;function t(){for(var f,h=[],s=0;s<256;s++){f=s;for(var u=0;u<8;u++)f=f&1?3988292384^f>>>1:f>>>1;h[s]=f}return h}var n=t();function i(f,h,s,u){var d=n,v=u+s;f^=-1;for(var M=u;M<v;M++)f=f>>>8^d[(f^h[M])&255];return f^-1}return xh=i,xh}var wh,wv;function Sh(){return wv||(wv=1,wh={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),wh}var Sv;function _y(){if(Sv)return Pi;Sv=1;var t=gf(),n=vy(),i=yv(),f=xv(),h=Sh(),s=0,u=1,d=3,v=4,M=5,k=0,g=1,F=-2,$=-3,S=-5,de=-1,se=1,I=2,U=3,te=4,ce=0,_e=2,we=8,ee=9,Ce=15,ut=8,ct=29,nt=256,ft=nt+1+ct,tt=30,Le=19,Ct=2*ft+1,bt=15,Me=3,Ze=258,St=Ze+Me+1,$t=32,Wt=42,Qt=69,sr=73,xr=91,or=103,Kt=113,wr=666,Gt=1,kt=2,hn=3,jr=4,Ft=3;function Br(o,ue){return o.msg=h[ue],ue}function Ir(o){return(o<<1)-(o>4?9:0)}function Zr(o){for(var ue=o.length;--ue>=0;)o[ue]=0}function Qr(o){var ue=o.state,ge=ue.pending;ge>o.avail_out&&(ge=o.avail_out),ge!==0&&(t.arraySet(o.output,ue.pending_buf,ue.pending_out,ge,o.next_out),o.next_out+=ge,ue.pending_out+=ge,o.total_out+=ge,o.avail_out-=ge,ue.pending-=ge,ue.pending===0&&(ue.pending_out=0))}function ar(o,ue){n._tr_flush_block(o,o.block_start>=0?o.block_start:-1,o.strstart-o.block_start,ue),o.block_start=o.strstart,Qr(o.strm)}function Nt(o,ue){o.pending_buf[o.pending++]=ue}function En(o,ue){o.pending_buf[o.pending++]=ue>>>8&255,o.pending_buf[o.pending++]=ue&255}function An(o,ue,ge,y){var Y=o.avail_in;return Y>y&&(Y=y),Y===0?0:(o.avail_in-=Y,t.arraySet(ue,o.input,o.next_in,Y,ge),o.state.wrap===1?o.adler=i(o.adler,ue,Y,ge):o.state.wrap===2&&(o.adler=f(o.adler,ue,Y,ge)),o.next_in+=Y,o.total_in+=Y,Y)}function Jr(o,ue){var ge=o.max_chain_length,y=o.strstart,Y,oe,At=o.prev_length,it=o.nice_match,mt=o.strstart>o.w_size-St?o.strstart-(o.w_size-St):0,lr=o.window,ui=o.w_mask,Fr=o.prev,hr=o.strstart+Ze,Yr=lr[y+At-1],vn=lr[y+At];o.prev_length>=o.good_match&&(ge>>=2),it>o.lookahead&&(it=o.lookahead);do if(Y=ue,!(lr[Y+At]!==vn||lr[Y+At-1]!==Yr||lr[Y]!==lr[y]||lr[++Y]!==lr[y+1])){y+=2,Y++;do;while(lr[++y]===lr[++Y]&&lr[++y]===lr[++Y]&&lr[++y]===lr[++Y]&&lr[++y]===lr[++Y]&&lr[++y]===lr[++Y]&&lr[++y]===lr[++Y]&&lr[++y]===lr[++Y]&&lr[++y]===lr[++Y]&&y<hr);if(oe=Ze-(hr-y),y=hr-Ze,oe>At){if(o.match_start=ue,At=oe,oe>=it)break;Yr=lr[y+At-1],vn=lr[y+At]}}while((ue=Fr[ue&ui])>mt&&--ge!==0);return At<=o.lookahead?At:o.lookahead}function an(o){var ue=o.w_size,ge,y,Y,oe,At;do{if(oe=o.window_size-o.lookahead-o.strstart,o.strstart>=ue+(ue-St)){t.arraySet(o.window,o.window,ue,ue,0),o.match_start-=ue,o.strstart-=ue,o.block_start-=ue,y=o.hash_size,ge=y;do Y=o.head[--ge],o.head[ge]=Y>=ue?Y-ue:0;while(--y);y=ue,ge=y;do Y=o.prev[--ge],o.prev[ge]=Y>=ue?Y-ue:0;while(--y);oe+=ue}if(o.strm.avail_in===0)break;if(y=An(o.strm,o.window,o.strstart+o.lookahead,oe),o.lookahead+=y,o.lookahead+o.insert>=Me)for(At=o.strstart-o.insert,o.ins_h=o.window[At],o.ins_h=(o.ins_h<<o.hash_shift^o.window[At+1])&o.hash_mask;o.insert&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[At+Me-1])&o.hash_mask,o.prev[At&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=At,At++,o.insert--,!(o.lookahead+o.insert<Me)););}while(o.lookahead<St&&o.strm.avail_in!==0)}function w(o,ue){var ge=65535;for(ge>o.pending_buf_size-5&&(ge=o.pending_buf_size-5);;){if(o.lookahead<=1){if(an(o),o.lookahead===0&&ue===s)return Gt;if(o.lookahead===0)break}o.strstart+=o.lookahead,o.lookahead=0;var y=o.block_start+ge;if((o.strstart===0||o.strstart>=y)&&(o.lookahead=o.strstart-y,o.strstart=y,ar(o,!1),o.strm.avail_out===0)||o.strstart-o.block_start>=o.w_size-St&&(ar(o,!1),o.strm.avail_out===0))return Gt}return o.insert=0,ue===v?(ar(o,!0),o.strm.avail_out===0?hn:jr):(o.strstart>o.block_start&&(ar(o,!1),o.strm.avail_out===0),Gt)}function li(o,ue){for(var ge,y;;){if(o.lookahead<St){if(an(o),o.lookahead<St&&ue===s)return Gt;if(o.lookahead===0)break}if(ge=0,o.lookahead>=Me&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+Me-1])&o.hash_mask,ge=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart),ge!==0&&o.strstart-ge<=o.w_size-St&&(o.match_length=Jr(o,ge)),o.match_length>=Me)if(y=n._tr_tally(o,o.strstart-o.match_start,o.match_length-Me),o.lookahead-=o.match_length,o.match_length<=o.max_lazy_match&&o.lookahead>=Me){o.match_length--;do o.strstart++,o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+Me-1])&o.hash_mask,ge=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart;while(--o.match_length!==0);o.strstart++}else o.strstart+=o.match_length,o.match_length=0,o.ins_h=o.window[o.strstart],o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+1])&o.hash_mask;else y=n._tr_tally(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++;if(y&&(ar(o,!1),o.strm.avail_out===0))return Gt}return o.insert=o.strstart<Me-1?o.strstart:Me-1,ue===v?(ar(o,!0),o.strm.avail_out===0?hn:jr):o.last_lit&&(ar(o,!1),o.strm.avail_out===0)?Gt:kt}function dn(o,ue){for(var ge,y,Y;;){if(o.lookahead<St){if(an(o),o.lookahead<St&&ue===s)return Gt;if(o.lookahead===0)break}if(ge=0,o.lookahead>=Me&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+Me-1])&o.hash_mask,ge=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart),o.prev_length=o.match_length,o.prev_match=o.match_start,o.match_length=Me-1,ge!==0&&o.prev_length<o.max_lazy_match&&o.strstart-ge<=o.w_size-St&&(o.match_length=Jr(o,ge),o.match_length<=5&&(o.strategy===se||o.match_length===Me&&o.strstart-o.match_start>4096)&&(o.match_length=Me-1)),o.prev_length>=Me&&o.match_length<=o.prev_length){Y=o.strstart+o.lookahead-Me,y=n._tr_tally(o,o.strstart-1-o.prev_match,o.prev_length-Me),o.lookahead-=o.prev_length-1,o.prev_length-=2;do++o.strstart<=Y&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+Me-1])&o.hash_mask,ge=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart);while(--o.prev_length!==0);if(o.match_available=0,o.match_length=Me-1,o.strstart++,y&&(ar(o,!1),o.strm.avail_out===0))return Gt}else if(o.match_available){if(y=n._tr_tally(o,0,o.window[o.strstart-1]),y&&ar(o,!1),o.strstart++,o.lookahead--,o.strm.avail_out===0)return Gt}else o.match_available=1,o.strstart++,o.lookahead--}return o.match_available&&(y=n._tr_tally(o,0,o.window[o.strstart-1]),o.match_available=0),o.insert=o.strstart<Me-1?o.strstart:Me-1,ue===v?(ar(o,!0),o.strm.avail_out===0?hn:jr):o.last_lit&&(ar(o,!1),o.strm.avail_out===0)?Gt:kt}function Gi(o,ue){for(var ge,y,Y,oe,At=o.window;;){if(o.lookahead<=Ze){if(an(o),o.lookahead<=Ze&&ue===s)return Gt;if(o.lookahead===0)break}if(o.match_length=0,o.lookahead>=Me&&o.strstart>0&&(Y=o.strstart-1,y=At[Y],y===At[++Y]&&y===At[++Y]&&y===At[++Y])){oe=o.strstart+Ze;do;while(y===At[++Y]&&y===At[++Y]&&y===At[++Y]&&y===At[++Y]&&y===At[++Y]&&y===At[++Y]&&y===At[++Y]&&y===At[++Y]&&Y<oe);o.match_length=Ze-(oe-Y),o.match_length>o.lookahead&&(o.match_length=o.lookahead)}if(o.match_length>=Me?(ge=n._tr_tally(o,1,o.match_length-Me),o.lookahead-=o.match_length,o.strstart+=o.match_length,o.match_length=0):(ge=n._tr_tally(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++),ge&&(ar(o,!1),o.strm.avail_out===0))return Gt}return o.insert=0,ue===v?(ar(o,!0),o.strm.avail_out===0?hn:jr):o.last_lit&&(ar(o,!1),o.strm.avail_out===0)?Gt:kt}function Bn(o,ue){for(var ge;;){if(o.lookahead===0&&(an(o),o.lookahead===0)){if(ue===s)return Gt;break}if(o.match_length=0,ge=n._tr_tally(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++,ge&&(ar(o,!1),o.strm.avail_out===0))return Gt}return o.insert=0,ue===v?(ar(o,!0),o.strm.avail_out===0?hn:jr):o.last_lit&&(ar(o,!1),o.strm.avail_out===0)?Gt:kt}function Er(o,ue,ge,y,Y){this.good_length=o,this.max_lazy=ue,this.nice_length=ge,this.max_chain=y,this.func=Y}var Dn;Dn=[new Er(0,0,0,0,w),new Er(4,4,8,4,li),new Er(4,5,16,8,li),new Er(4,6,32,32,li),new Er(4,4,16,16,dn),new Er(8,16,32,32,dn),new Er(8,16,128,128,dn),new Er(8,32,128,256,dn),new Er(32,128,258,1024,dn),new Er(32,258,258,4096,dn)];function Pn(o){o.window_size=2*o.w_size,Zr(o.head),o.max_lazy_match=Dn[o.level].max_lazy,o.good_match=Dn[o.level].good_length,o.nice_match=Dn[o.level].nice_length,o.max_chain_length=Dn[o.level].max_chain,o.strstart=0,o.block_start=0,o.lookahead=0,o.insert=0,o.match_length=o.prev_length=Me-1,o.match_available=0,o.ins_h=0}function A(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=we,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new t.Buf16(Ct*2),this.dyn_dtree=new t.Buf16((2*tt+1)*2),this.bl_tree=new t.Buf16((2*Le+1)*2),Zr(this.dyn_ltree),Zr(this.dyn_dtree),Zr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(bt+1),this.heap=new t.Buf16(2*ft+1),Zr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*ft+1),Zr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ue(o){var ue;return!o||!o.state?Br(o,F):(o.total_in=o.total_out=0,o.data_type=_e,ue=o.state,ue.pending=0,ue.pending_out=0,ue.wrap<0&&(ue.wrap=-ue.wrap),ue.status=ue.wrap?Wt:Kt,o.adler=ue.wrap===2?0:1,ue.last_flush=s,n._tr_init(ue),k)}function Xe(o){var ue=Ue(o);return ue===k&&Pn(o.state),ue}function dt(o,ue){return!o||!o.state||o.state.wrap!==2?F:(o.state.gzhead=ue,k)}function z(o,ue,ge,y,Y,oe){if(!o)return F;var At=1;if(ue===de&&(ue=6),y<0?(At=0,y=-y):y>15&&(At=2,y-=16),Y<1||Y>ee||ge!==we||y<8||y>15||ue<0||ue>9||oe<0||oe>te)return Br(o,F);y===8&&(y=9);var it=new A;return o.state=it,it.strm=o,it.wrap=At,it.gzhead=null,it.w_bits=y,it.w_size=1<<it.w_bits,it.w_mask=it.w_size-1,it.hash_bits=Y+7,it.hash_size=1<<it.hash_bits,it.hash_mask=it.hash_size-1,it.hash_shift=~~((it.hash_bits+Me-1)/Me),it.window=new t.Buf8(it.w_size*2),it.head=new t.Buf16(it.hash_size),it.prev=new t.Buf16(it.w_size),it.lit_bufsize=1<<Y+6,it.pending_buf_size=it.lit_bufsize*4,it.pending_buf=new t.Buf8(it.pending_buf_size),it.d_buf=1*it.lit_bufsize,it.l_buf=(1+2)*it.lit_bufsize,it.level=ue,it.strategy=oe,it.method=ge,Xe(o)}function xe(o,ue){return z(o,ue,we,Ce,ut,ce)}function p(o,ue){var ge,y,Y,oe;if(!o||!o.state||ue>M||ue<0)return o?Br(o,F):F;if(y=o.state,!o.output||!o.input&&o.avail_in!==0||y.status===wr&&ue!==v)return Br(o,o.avail_out===0?S:F);if(y.strm=o,ge=y.last_flush,y.last_flush=ue,y.status===Wt)if(y.wrap===2)o.adler=0,Nt(y,31),Nt(y,139),Nt(y,8),y.gzhead?(Nt(y,(y.gzhead.text?1:0)+(y.gzhead.hcrc?2:0)+(y.gzhead.extra?4:0)+(y.gzhead.name?8:0)+(y.gzhead.comment?16:0)),Nt(y,y.gzhead.time&255),Nt(y,y.gzhead.time>>8&255),Nt(y,y.gzhead.time>>16&255),Nt(y,y.gzhead.time>>24&255),Nt(y,y.level===9?2:y.strategy>=I||y.level<2?4:0),Nt(y,y.gzhead.os&255),y.gzhead.extra&&y.gzhead.extra.length&&(Nt(y,y.gzhead.extra.length&255),Nt(y,y.gzhead.extra.length>>8&255)),y.gzhead.hcrc&&(o.adler=f(o.adler,y.pending_buf,y.pending,0)),y.gzindex=0,y.status=Qt):(Nt(y,0),Nt(y,0),Nt(y,0),Nt(y,0),Nt(y,0),Nt(y,y.level===9?2:y.strategy>=I||y.level<2?4:0),Nt(y,Ft),y.status=Kt);else{var At=we+(y.w_bits-8<<4)<<8,it=-1;y.strategy>=I||y.level<2?it=0:y.level<6?it=1:y.level===6?it=2:it=3,At|=it<<6,y.strstart!==0&&(At|=$t),At+=31-At%31,y.status=Kt,En(y,At),y.strstart!==0&&(En(y,o.adler>>>16),En(y,o.adler&65535)),o.adler=1}if(y.status===Qt)if(y.gzhead.extra){for(Y=y.pending;y.gzindex<(y.gzhead.extra.length&65535)&&!(y.pending===y.pending_buf_size&&(y.gzhead.hcrc&&y.pending>Y&&(o.adler=f(o.adler,y.pending_buf,y.pending-Y,Y)),Qr(o),Y=y.pending,y.pending===y.pending_buf_size));)Nt(y,y.gzhead.extra[y.gzindex]&255),y.gzindex++;y.gzhead.hcrc&&y.pending>Y&&(o.adler=f(o.adler,y.pending_buf,y.pending-Y,Y)),y.gzindex===y.gzhead.extra.length&&(y.gzindex=0,y.status=sr)}else y.status=sr;if(y.status===sr)if(y.gzhead.name){Y=y.pending;do{if(y.pending===y.pending_buf_size&&(y.gzhead.hcrc&&y.pending>Y&&(o.adler=f(o.adler,y.pending_buf,y.pending-Y,Y)),Qr(o),Y=y.pending,y.pending===y.pending_buf_size)){oe=1;break}y.gzindex<y.gzhead.name.length?oe=y.gzhead.name.charCodeAt(y.gzindex++)&255:oe=0,Nt(y,oe)}while(oe!==0);y.gzhead.hcrc&&y.pending>Y&&(o.adler=f(o.adler,y.pending_buf,y.pending-Y,Y)),oe===0&&(y.gzindex=0,y.status=xr)}else y.status=xr;if(y.status===xr)if(y.gzhead.comment){Y=y.pending;do{if(y.pending===y.pending_buf_size&&(y.gzhead.hcrc&&y.pending>Y&&(o.adler=f(o.adler,y.pending_buf,y.pending-Y,Y)),Qr(o),Y=y.pending,y.pending===y.pending_buf_size)){oe=1;break}y.gzindex<y.gzhead.comment.length?oe=y.gzhead.comment.charCodeAt(y.gzindex++)&255:oe=0,Nt(y,oe)}while(oe!==0);y.gzhead.hcrc&&y.pending>Y&&(o.adler=f(o.adler,y.pending_buf,y.pending-Y,Y)),oe===0&&(y.status=or)}else y.status=or;if(y.status===or&&(y.gzhead.hcrc?(y.pending+2>y.pending_buf_size&&Qr(o),y.pending+2<=y.pending_buf_size&&(Nt(y,o.adler&255),Nt(y,o.adler>>8&255),o.adler=0,y.status=Kt)):y.status=Kt),y.pending!==0){if(Qr(o),o.avail_out===0)return y.last_flush=-1,k}else if(o.avail_in===0&&Ir(ue)<=Ir(ge)&&ue!==v)return Br(o,S);if(y.status===wr&&o.avail_in!==0)return Br(o,S);if(o.avail_in!==0||y.lookahead!==0||ue!==s&&y.status!==wr){var mt=y.strategy===I?Bn(y,ue):y.strategy===U?Gi(y,ue):Dn[y.level].func(y,ue);if((mt===hn||mt===jr)&&(y.status=wr),mt===Gt||mt===hn)return o.avail_out===0&&(y.last_flush=-1),k;if(mt===kt&&(ue===u?n._tr_align(y):ue!==M&&(n._tr_stored_block(y,0,0,!1),ue===d&&(Zr(y.head),y.lookahead===0&&(y.strstart=0,y.block_start=0,y.insert=0))),Qr(o),o.avail_out===0))return y.last_flush=-1,k}return ue!==v?k:y.wrap<=0?g:(y.wrap===2?(Nt(y,o.adler&255),Nt(y,o.adler>>8&255),Nt(y,o.adler>>16&255),Nt(y,o.adler>>24&255),Nt(y,o.total_in&255),Nt(y,o.total_in>>8&255),Nt(y,o.total_in>>16&255),Nt(y,o.total_in>>24&255)):(En(y,o.adler>>>16),En(y,o.adler&65535)),Qr(o),y.wrap>0&&(y.wrap=-y.wrap),y.pending!==0?k:g)}function He(o){var ue;return!o||!o.state?F:(ue=o.state.status,ue!==Wt&&ue!==Qt&&ue!==sr&&ue!==xr&&ue!==or&&ue!==Kt&&ue!==wr?Br(o,F):(o.state=null,ue===Kt?Br(o,$):k))}function Bt(o,ue){var ge=ue.length,y,Y,oe,At,it,mt,lr,ui;if(!o||!o.state||(y=o.state,At=y.wrap,At===2||At===1&&y.status!==Wt||y.lookahead))return F;for(At===1&&(o.adler=i(o.adler,ue,ge,0)),y.wrap=0,ge>=y.w_size&&(At===0&&(Zr(y.head),y.strstart=0,y.block_start=0,y.insert=0),ui=new t.Buf8(y.w_size),t.arraySet(ui,ue,ge-y.w_size,y.w_size,0),ue=ui,ge=y.w_size),it=o.avail_in,mt=o.next_in,lr=o.input,o.avail_in=ge,o.next_in=0,o.input=ue,an(y);y.lookahead>=Me;){Y=y.strstart,oe=y.lookahead-(Me-1);do y.ins_h=(y.ins_h<<y.hash_shift^y.window[Y+Me-1])&y.hash_mask,y.prev[Y&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=Y,Y++;while(--oe);y.strstart=Y,y.lookahead=Me-1,an(y)}return y.strstart+=y.lookahead,y.block_start=y.strstart,y.insert=y.lookahead,y.lookahead=0,y.match_length=y.prev_length=Me-1,y.match_available=0,o.next_in=mt,o.input=lr,o.avail_in=it,y.wrap=At,k}return Pi.deflateInit=xe,Pi.deflateInit2=z,Pi.deflateReset=Xe,Pi.deflateResetKeep=Ue,Pi.deflateSetHeader=dt,Pi.deflate=p,Pi.deflateEnd=He,Pi.deflateSetDictionary=Bt,Pi.deflateInfo="pako deflate (from Nodeca project)",Pi}var jf={},Tv;function Ev(){if(Tv)return jf;Tv=1;var t=gf(),n=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{i=!1}for(var f=new t.Buf8(256),h=0;h<256;h++)f[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;f[254]=f[254]=1,jf.string2buf=function(u){var d,v,M,k,g,F=u.length,$=0;for(k=0;k<F;k++)v=u.charCodeAt(k),(v&64512)===55296&&k+1<F&&(M=u.charCodeAt(k+1),(M&64512)===56320&&(v=65536+(v-55296<<10)+(M-56320),k++)),$+=v<128?1:v<2048?2:v<65536?3:4;for(d=new t.Buf8($),g=0,k=0;g<$;k++)v=u.charCodeAt(k),(v&64512)===55296&&k+1<F&&(M=u.charCodeAt(k+1),(M&64512)===56320&&(v=65536+(v-55296<<10)+(M-56320),k++)),v<128?d[g++]=v:v<2048?(d[g++]=192|v>>>6,d[g++]=128|v&63):v<65536?(d[g++]=224|v>>>12,d[g++]=128|v>>>6&63,d[g++]=128|v&63):(d[g++]=240|v>>>18,d[g++]=128|v>>>12&63,d[g++]=128|v>>>6&63,d[g++]=128|v&63);return d};function s(u,d){if(d<65534&&(u.subarray&&i||!u.subarray&&n))return String.fromCharCode.apply(null,t.shrinkBuf(u,d));for(var v="",M=0;M<d;M++)v+=String.fromCharCode(u[M]);return v}return jf.buf2binstring=function(u){return s(u,u.length)},jf.binstring2buf=function(u){for(var d=new t.Buf8(u.length),v=0,M=d.length;v<M;v++)d[v]=u.charCodeAt(v);return d},jf.buf2string=function(u,d){var v,M,k,g,F=d||u.length,$=new Array(F*2);for(M=0,v=0;v<F;){if(k=u[v++],k<128){$[M++]=k;continue}if(g=f[k],g>4){$[M++]=65533,v+=g-1;continue}for(k&=g===2?31:g===3?15:7;g>1&&v<F;)k=k<<6|u[v++]&63,g--;if(g>1){$[M++]=65533;continue}k<65536?$[M++]=k:(k-=65536,$[M++]=55296|k>>10&1023,$[M++]=56320|k&1023)}return s($,M)},jf.utf8border=function(u,d){var v;for(d=d||u.length,d>u.length&&(d=u.length),v=d-1;v>=0&&(u[v]&192)===128;)v--;return v<0||v===0?d:v+f[u[v]]>d?v:d},jf}var Th,Av;function Dv(){if(Av)return Th;Av=1;function t(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return Th=t,Th}var Lv;function py(){if(Lv)return Hs;Lv=1;var t=_y(),n=gf(),i=Ev(),f=Sh(),h=Dv(),s=Object.prototype.toString,u=0,d=4,v=0,M=1,k=2,g=-1,F=0,$=8;function S(U){if(!(this instanceof S))return new S(U);this.options=n.assign({level:g,method:$,chunkSize:16384,windowBits:15,memLevel:8,strategy:F,to:""},U||{});var te=this.options;te.raw&&te.windowBits>0?te.windowBits=-te.windowBits:te.gzip&&te.windowBits>0&&te.windowBits<16&&(te.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var ce=t.deflateInit2(this.strm,te.level,te.method,te.windowBits,te.memLevel,te.strategy);if(ce!==v)throw new Error(f[ce]);if(te.header&&t.deflateSetHeader(this.strm,te.header),te.dictionary){var _e;if(typeof te.dictionary=="string"?_e=i.string2buf(te.dictionary):s.call(te.dictionary)==="[object ArrayBuffer]"?_e=new Uint8Array(te.dictionary):_e=te.dictionary,ce=t.deflateSetDictionary(this.strm,_e),ce!==v)throw new Error(f[ce]);this._dict_set=!0}}S.prototype.push=function(U,te){var ce=this.strm,_e=this.options.chunkSize,we,ee;if(this.ended)return!1;ee=te===~~te?te:te===!0?d:u,typeof U=="string"?ce.input=i.string2buf(U):s.call(U)==="[object ArrayBuffer]"?ce.input=new Uint8Array(U):ce.input=U,ce.next_in=0,ce.avail_in=ce.input.length;do{if(ce.avail_out===0&&(ce.output=new n.Buf8(_e),ce.next_out=0,ce.avail_out=_e),we=t.deflate(ce,ee),we!==M&&we!==v)return this.onEnd(we),this.ended=!0,!1;(ce.avail_out===0||ce.avail_in===0&&(ee===d||ee===k))&&(this.options.to==="string"?this.onData(i.buf2binstring(n.shrinkBuf(ce.output,ce.next_out))):this.onData(n.shrinkBuf(ce.output,ce.next_out)))}while((ce.avail_in>0||ce.avail_out===0)&&we!==M);return ee===d?(we=t.deflateEnd(this.strm),this.onEnd(we),this.ended=!0,we===v):(ee===k&&(this.onEnd(v),ce.avail_out=0),!0)},S.prototype.onData=function(U){this.chunks.push(U)},S.prototype.onEnd=function(U){U===v&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=U,this.msg=this.strm.msg};function de(U,te){var ce=new S(te);if(ce.push(U,!0),ce.err)throw ce.msg||f[ce.err];return ce.result}function se(U,te){return te=te||{},te.raw=!0,de(U,te)}function I(U,te){return te=te||{},te.gzip=!0,de(U,te)}return Hs.Deflate=S,Hs.deflate=de,Hs.deflateRaw=se,Hs.gzip=I,Hs}var zs={},Ai={},Eh,Ov;function my(){if(Ov)return Eh;Ov=1;var t=30,n=12;return Eh=function(f,h){var s,u,d,v,M,k,g,F,$,S,de,se,I,U,te,ce,_e,we,ee,Ce,ut,ct,nt,ft,tt;s=f.state,u=f.next_in,ft=f.input,d=u+(f.avail_in-5),v=f.next_out,tt=f.output,M=v-(h-f.avail_out),k=v+(f.avail_out-257),g=s.dmax,F=s.wsize,$=s.whave,S=s.wnext,de=s.window,se=s.hold,I=s.bits,U=s.lencode,te=s.distcode,ce=(1<<s.lenbits)-1,_e=(1<<s.distbits)-1;e:do{I<15&&(se+=ft[u++]<<I,I+=8,se+=ft[u++]<<I,I+=8),we=U[se&ce];t:for(;;){if(ee=we>>>24,se>>>=ee,I-=ee,ee=we>>>16&255,ee===0)tt[v++]=we&65535;else if(ee&16){Ce=we&65535,ee&=15,ee&&(I<ee&&(se+=ft[u++]<<I,I+=8),Ce+=se&(1<<ee)-1,se>>>=ee,I-=ee),I<15&&(se+=ft[u++]<<I,I+=8,se+=ft[u++]<<I,I+=8),we=te[se&_e];r:for(;;){if(ee=we>>>24,se>>>=ee,I-=ee,ee=we>>>16&255,ee&16){if(ut=we&65535,ee&=15,I<ee&&(se+=ft[u++]<<I,I+=8,I<ee&&(se+=ft[u++]<<I,I+=8)),ut+=se&(1<<ee)-1,ut>g){f.msg="invalid distance too far back",s.mode=t;break e}if(se>>>=ee,I-=ee,ee=v-M,ut>ee){if(ee=ut-ee,ee>$&&s.sane){f.msg="invalid distance too far back",s.mode=t;break e}if(ct=0,nt=de,S===0){if(ct+=F-ee,ee<Ce){Ce-=ee;do tt[v++]=de[ct++];while(--ee);ct=v-ut,nt=tt}}else if(S<ee){if(ct+=F+S-ee,ee-=S,ee<Ce){Ce-=ee;do tt[v++]=de[ct++];while(--ee);if(ct=0,S<Ce){ee=S,Ce-=ee;do tt[v++]=de[ct++];while(--ee);ct=v-ut,nt=tt}}}else if(ct+=S-ee,ee<Ce){Ce-=ee;do tt[v++]=de[ct++];while(--ee);ct=v-ut,nt=tt}for(;Ce>2;)tt[v++]=nt[ct++],tt[v++]=nt[ct++],tt[v++]=nt[ct++],Ce-=3;Ce&&(tt[v++]=nt[ct++],Ce>1&&(tt[v++]=nt[ct++]))}else{ct=v-ut;do tt[v++]=tt[ct++],tt[v++]=tt[ct++],tt[v++]=tt[ct++],Ce-=3;while(Ce>2);Ce&&(tt[v++]=tt[ct++],Ce>1&&(tt[v++]=tt[ct++]))}}else if((ee&64)===0){we=te[(we&65535)+(se&(1<<ee)-1)];continue r}else{f.msg="invalid distance code",s.mode=t;break e}break}}else if((ee&64)===0){we=U[(we&65535)+(se&(1<<ee)-1)];continue t}else if(ee&32){s.mode=n;break e}else{f.msg="invalid literal/length code",s.mode=t;break e}break}}while(u<d&&v<k);Ce=I>>3,u-=Ce,I-=Ce<<3,se&=(1<<I)-1,f.next_in=u,f.next_out=v,f.avail_in=u<d?5+(d-u):5-(u-d),f.avail_out=v<k?257+(k-v):257-(v-k),s.hold=se,s.bits=I},Eh}var Ah,Rv;function gy(){if(Rv)return Ah;Rv=1;var t=gf(),n=15,i=852,f=592,h=0,s=1,u=2,d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],v=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],M=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],k=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return Ah=function(F,$,S,de,se,I,U,te){var ce=te.bits,_e=0,we=0,ee=0,Ce=0,ut=0,ct=0,nt=0,ft=0,tt=0,Le=0,Ct,bt,Me,Ze,St,$t=null,Wt=0,Qt,sr=new t.Buf16(n+1),xr=new t.Buf16(n+1),or=null,Kt=0,wr,Gt,kt;for(_e=0;_e<=n;_e++)sr[_e]=0;for(we=0;we<de;we++)sr[$[S+we]]++;for(ut=ce,Ce=n;Ce>=1&&sr[Ce]===0;Ce--);if(ut>Ce&&(ut=Ce),Ce===0)return se[I++]=1<<24|64<<16|0,se[I++]=1<<24|64<<16|0,te.bits=1,0;for(ee=1;ee<Ce&&sr[ee]===0;ee++);for(ut<ee&&(ut=ee),ft=1,_e=1;_e<=n;_e++)if(ft<<=1,ft-=sr[_e],ft<0)return-1;if(ft>0&&(F===h||Ce!==1))return-1;for(xr[1]=0,_e=1;_e<n;_e++)xr[_e+1]=xr[_e]+sr[_e];for(we=0;we<de;we++)$[S+we]!==0&&(U[xr[$[S+we]]++]=we);if(F===h?($t=or=U,Qt=19):F===s?($t=d,Wt-=257,or=v,Kt-=257,Qt=256):($t=M,or=k,Qt=-1),Le=0,we=0,_e=ee,St=I,ct=ut,nt=0,Me=-1,tt=1<<ut,Ze=tt-1,F===s&&tt>i||F===u&&tt>f)return 1;for(;;){wr=_e-nt,U[we]<Qt?(Gt=0,kt=U[we]):U[we]>Qt?(Gt=or[Kt+U[we]],kt=$t[Wt+U[we]]):(Gt=32+64,kt=0),Ct=1<<_e-nt,bt=1<<ct,ee=bt;do bt-=Ct,se[St+(Le>>nt)+bt]=wr<<24|Gt<<16|kt|0;while(bt!==0);for(Ct=1<<_e-1;Le&Ct;)Ct>>=1;if(Ct!==0?(Le&=Ct-1,Le+=Ct):Le=0,we++,--sr[_e]===0){if(_e===Ce)break;_e=$[S+U[we]]}if(_e>ut&&(Le&Ze)!==Me){for(nt===0&&(nt=ut),St+=ee,ct=_e-nt,ft=1<<ct;ct+nt<Ce&&(ft-=sr[ct+nt],!(ft<=0));)ct++,ft<<=1;if(tt+=1<<ct,F===s&&tt>i||F===u&&tt>f)return 1;Me=Le&Ze,se[Me]=ut<<24|ct<<16|St-I|0}}return Le!==0&&(se[St+Le]=_e-nt<<24|64<<16|0),te.bits=ut,0},Ah}var Cv;function yy(){if(Cv)return Ai;Cv=1;var t=gf(),n=yv(),i=xv(),f=my(),h=gy(),s=0,u=1,d=2,v=4,M=5,k=6,g=0,F=1,$=2,S=-2,de=-3,se=-4,I=-5,U=8,te=1,ce=2,_e=3,we=4,ee=5,Ce=6,ut=7,ct=8,nt=9,ft=10,tt=11,Le=12,Ct=13,bt=14,Me=15,Ze=16,St=17,$t=18,Wt=19,Qt=20,sr=21,xr=22,or=23,Kt=24,wr=25,Gt=26,kt=27,hn=28,jr=29,Ft=30,Br=31,Ir=32,Zr=852,Qr=592,ar=15,Nt=ar;function En(z){return(z>>>24&255)+(z>>>8&65280)+((z&65280)<<8)+((z&255)<<24)}function An(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Jr(z){var xe;return!z||!z.state?S:(xe=z.state,z.total_in=z.total_out=xe.total=0,z.msg="",xe.wrap&&(z.adler=xe.wrap&1),xe.mode=te,xe.last=0,xe.havedict=0,xe.dmax=32768,xe.head=null,xe.hold=0,xe.bits=0,xe.lencode=xe.lendyn=new t.Buf32(Zr),xe.distcode=xe.distdyn=new t.Buf32(Qr),xe.sane=1,xe.back=-1,g)}function an(z){var xe;return!z||!z.state?S:(xe=z.state,xe.wsize=0,xe.whave=0,xe.wnext=0,Jr(z))}function w(z,xe){var p,He;return!z||!z.state||(He=z.state,xe<0?(p=0,xe=-xe):(p=(xe>>4)+1,xe<48&&(xe&=15)),xe&&(xe<8||xe>15))?S:(He.window!==null&&He.wbits!==xe&&(He.window=null),He.wrap=p,He.wbits=xe,an(z))}function li(z,xe){var p,He;return z?(He=new An,z.state=He,He.window=null,p=w(z,xe),p!==g&&(z.state=null),p):S}function dn(z){return li(z,Nt)}var Gi=!0,Bn,Er;function Dn(z){if(Gi){var xe;for(Bn=new t.Buf32(512),Er=new t.Buf32(32),xe=0;xe<144;)z.lens[xe++]=8;for(;xe<256;)z.lens[xe++]=9;for(;xe<280;)z.lens[xe++]=7;for(;xe<288;)z.lens[xe++]=8;for(h(u,z.lens,0,288,Bn,0,z.work,{bits:9}),xe=0;xe<32;)z.lens[xe++]=5;h(d,z.lens,0,32,Er,0,z.work,{bits:5}),Gi=!1}z.lencode=Bn,z.lenbits=9,z.distcode=Er,z.distbits=5}function Pn(z,xe,p,He){var Bt,o=z.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new t.Buf8(o.wsize)),He>=o.wsize?(t.arraySet(o.window,xe,p-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(Bt=o.wsize-o.wnext,Bt>He&&(Bt=He),t.arraySet(o.window,xe,p-He,Bt,o.wnext),He-=Bt,He?(t.arraySet(o.window,xe,p-He,He,0),o.wnext=He,o.whave=o.wsize):(o.wnext+=Bt,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=Bt))),0}function A(z,xe){var p,He,Bt,o,ue,ge,y,Y,oe,At,it,mt,lr,ui,Fr=0,hr,Yr,vn,Ln,Ra,Ca,jt,Hn,fn=new t.Buf8(4),ci,$n,Ws=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!z||!z.state||!z.output||!z.input&&z.avail_in!==0)return S;p=z.state,p.mode===Le&&(p.mode=Ct),ue=z.next_out,Bt=z.output,y=z.avail_out,o=z.next_in,He=z.input,ge=z.avail_in,Y=p.hold,oe=p.bits,At=ge,it=y,Hn=g;e:for(;;)switch(p.mode){case te:if(p.wrap===0){p.mode=Ct;break}for(;oe<16;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}if(p.wrap&2&&Y===35615){p.check=0,fn[0]=Y&255,fn[1]=Y>>>8&255,p.check=i(p.check,fn,2,0),Y=0,oe=0,p.mode=ce;break}if(p.flags=0,p.head&&(p.head.done=!1),!(p.wrap&1)||(((Y&255)<<8)+(Y>>8))%31){z.msg="incorrect header check",p.mode=Ft;break}if((Y&15)!==U){z.msg="unknown compression method",p.mode=Ft;break}if(Y>>>=4,oe-=4,jt=(Y&15)+8,p.wbits===0)p.wbits=jt;else if(jt>p.wbits){z.msg="invalid window size",p.mode=Ft;break}p.dmax=1<<jt,z.adler=p.check=1,p.mode=Y&512?ft:Le,Y=0,oe=0;break;case ce:for(;oe<16;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}if(p.flags=Y,(p.flags&255)!==U){z.msg="unknown compression method",p.mode=Ft;break}if(p.flags&57344){z.msg="unknown header flags set",p.mode=Ft;break}p.head&&(p.head.text=Y>>8&1),p.flags&512&&(fn[0]=Y&255,fn[1]=Y>>>8&255,p.check=i(p.check,fn,2,0)),Y=0,oe=0,p.mode=_e;case _e:for(;oe<32;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}p.head&&(p.head.time=Y),p.flags&512&&(fn[0]=Y&255,fn[1]=Y>>>8&255,fn[2]=Y>>>16&255,fn[3]=Y>>>24&255,p.check=i(p.check,fn,4,0)),Y=0,oe=0,p.mode=we;case we:for(;oe<16;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}p.head&&(p.head.xflags=Y&255,p.head.os=Y>>8),p.flags&512&&(fn[0]=Y&255,fn[1]=Y>>>8&255,p.check=i(p.check,fn,2,0)),Y=0,oe=0,p.mode=ee;case ee:if(p.flags&1024){for(;oe<16;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}p.length=Y,p.head&&(p.head.extra_len=Y),p.flags&512&&(fn[0]=Y&255,fn[1]=Y>>>8&255,p.check=i(p.check,fn,2,0)),Y=0,oe=0}else p.head&&(p.head.extra=null);p.mode=Ce;case Ce:if(p.flags&1024&&(mt=p.length,mt>ge&&(mt=ge),mt&&(p.head&&(jt=p.head.extra_len-p.length,p.head.extra||(p.head.extra=new Array(p.head.extra_len)),t.arraySet(p.head.extra,He,o,mt,jt)),p.flags&512&&(p.check=i(p.check,He,mt,o)),ge-=mt,o+=mt,p.length-=mt),p.length))break e;p.length=0,p.mode=ut;case ut:if(p.flags&2048){if(ge===0)break e;mt=0;do jt=He[o+mt++],p.head&&jt&&p.length<65536&&(p.head.name+=String.fromCharCode(jt));while(jt&&mt<ge);if(p.flags&512&&(p.check=i(p.check,He,mt,o)),ge-=mt,o+=mt,jt)break e}else p.head&&(p.head.name=null);p.length=0,p.mode=ct;case ct:if(p.flags&4096){if(ge===0)break e;mt=0;do jt=He[o+mt++],p.head&&jt&&p.length<65536&&(p.head.comment+=String.fromCharCode(jt));while(jt&&mt<ge);if(p.flags&512&&(p.check=i(p.check,He,mt,o)),ge-=mt,o+=mt,jt)break e}else p.head&&(p.head.comment=null);p.mode=nt;case nt:if(p.flags&512){for(;oe<16;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}if(Y!==(p.check&65535)){z.msg="header crc mismatch",p.mode=Ft;break}Y=0,oe=0}p.head&&(p.head.hcrc=p.flags>>9&1,p.head.done=!0),z.adler=p.check=0,p.mode=Le;break;case ft:for(;oe<32;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}z.adler=p.check=En(Y),Y=0,oe=0,p.mode=tt;case tt:if(p.havedict===0)return z.next_out=ue,z.avail_out=y,z.next_in=o,z.avail_in=ge,p.hold=Y,p.bits=oe,$;z.adler=p.check=1,p.mode=Le;case Le:if(xe===M||xe===k)break e;case Ct:if(p.last){Y>>>=oe&7,oe-=oe&7,p.mode=kt;break}for(;oe<3;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}switch(p.last=Y&1,Y>>>=1,oe-=1,Y&3){case 0:p.mode=bt;break;case 1:if(Dn(p),p.mode=Qt,xe===k){Y>>>=2,oe-=2;break e}break;case 2:p.mode=St;break;case 3:z.msg="invalid block type",p.mode=Ft}Y>>>=2,oe-=2;break;case bt:for(Y>>>=oe&7,oe-=oe&7;oe<32;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}if((Y&65535)!==(Y>>>16^65535)){z.msg="invalid stored block lengths",p.mode=Ft;break}if(p.length=Y&65535,Y=0,oe=0,p.mode=Me,xe===k)break e;case Me:p.mode=Ze;case Ze:if(mt=p.length,mt){if(mt>ge&&(mt=ge),mt>y&&(mt=y),mt===0)break e;t.arraySet(Bt,He,o,mt,ue),ge-=mt,o+=mt,y-=mt,ue+=mt,p.length-=mt;break}p.mode=Le;break;case St:for(;oe<14;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}if(p.nlen=(Y&31)+257,Y>>>=5,oe-=5,p.ndist=(Y&31)+1,Y>>>=5,oe-=5,p.ncode=(Y&15)+4,Y>>>=4,oe-=4,p.nlen>286||p.ndist>30){z.msg="too many length or distance symbols",p.mode=Ft;break}p.have=0,p.mode=$t;case $t:for(;p.have<p.ncode;){for(;oe<3;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}p.lens[Ws[p.have++]]=Y&7,Y>>>=3,oe-=3}for(;p.have<19;)p.lens[Ws[p.have++]]=0;if(p.lencode=p.lendyn,p.lenbits=7,ci={bits:p.lenbits},Hn=h(s,p.lens,0,19,p.lencode,0,p.work,ci),p.lenbits=ci.bits,Hn){z.msg="invalid code lengths set",p.mode=Ft;break}p.have=0,p.mode=Wt;case Wt:for(;p.have<p.nlen+p.ndist;){for(;Fr=p.lencode[Y&(1<<p.lenbits)-1],hr=Fr>>>24,Yr=Fr>>>16&255,vn=Fr&65535,!(hr<=oe);){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}if(vn<16)Y>>>=hr,oe-=hr,p.lens[p.have++]=vn;else{if(vn===16){for($n=hr+2;oe<$n;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}if(Y>>>=hr,oe-=hr,p.have===0){z.msg="invalid bit length repeat",p.mode=Ft;break}jt=p.lens[p.have-1],mt=3+(Y&3),Y>>>=2,oe-=2}else if(vn===17){for($n=hr+3;oe<$n;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}Y>>>=hr,oe-=hr,jt=0,mt=3+(Y&7),Y>>>=3,oe-=3}else{for($n=hr+7;oe<$n;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}Y>>>=hr,oe-=hr,jt=0,mt=11+(Y&127),Y>>>=7,oe-=7}if(p.have+mt>p.nlen+p.ndist){z.msg="invalid bit length repeat",p.mode=Ft;break}for(;mt--;)p.lens[p.have++]=jt}}if(p.mode===Ft)break;if(p.lens[256]===0){z.msg="invalid code -- missing end-of-block",p.mode=Ft;break}if(p.lenbits=9,ci={bits:p.lenbits},Hn=h(u,p.lens,0,p.nlen,p.lencode,0,p.work,ci),p.lenbits=ci.bits,Hn){z.msg="invalid literal/lengths set",p.mode=Ft;break}if(p.distbits=6,p.distcode=p.distdyn,ci={bits:p.distbits},Hn=h(d,p.lens,p.nlen,p.ndist,p.distcode,0,p.work,ci),p.distbits=ci.bits,Hn){z.msg="invalid distances set",p.mode=Ft;break}if(p.mode=Qt,xe===k)break e;case Qt:p.mode=sr;case sr:if(ge>=6&&y>=258){z.next_out=ue,z.avail_out=y,z.next_in=o,z.avail_in=ge,p.hold=Y,p.bits=oe,f(z,it),ue=z.next_out,Bt=z.output,y=z.avail_out,o=z.next_in,He=z.input,ge=z.avail_in,Y=p.hold,oe=p.bits,p.mode===Le&&(p.back=-1);break}for(p.back=0;Fr=p.lencode[Y&(1<<p.lenbits)-1],hr=Fr>>>24,Yr=Fr>>>16&255,vn=Fr&65535,!(hr<=oe);){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}if(Yr&&(Yr&240)===0){for(Ln=hr,Ra=Yr,Ca=vn;Fr=p.lencode[Ca+((Y&(1<<Ln+Ra)-1)>>Ln)],hr=Fr>>>24,Yr=Fr>>>16&255,vn=Fr&65535,!(Ln+hr<=oe);){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}Y>>>=Ln,oe-=Ln,p.back+=Ln}if(Y>>>=hr,oe-=hr,p.back+=hr,p.length=vn,Yr===0){p.mode=Gt;break}if(Yr&32){p.back=-1,p.mode=Le;break}if(Yr&64){z.msg="invalid literal/length code",p.mode=Ft;break}p.extra=Yr&15,p.mode=xr;case xr:if(p.extra){for($n=p.extra;oe<$n;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}p.length+=Y&(1<<p.extra)-1,Y>>>=p.extra,oe-=p.extra,p.back+=p.extra}p.was=p.length,p.mode=or;case or:for(;Fr=p.distcode[Y&(1<<p.distbits)-1],hr=Fr>>>24,Yr=Fr>>>16&255,vn=Fr&65535,!(hr<=oe);){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}if((Yr&240)===0){for(Ln=hr,Ra=Yr,Ca=vn;Fr=p.distcode[Ca+((Y&(1<<Ln+Ra)-1)>>Ln)],hr=Fr>>>24,Yr=Fr>>>16&255,vn=Fr&65535,!(Ln+hr<=oe);){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}Y>>>=Ln,oe-=Ln,p.back+=Ln}if(Y>>>=hr,oe-=hr,p.back+=hr,Yr&64){z.msg="invalid distance code",p.mode=Ft;break}p.offset=vn,p.extra=Yr&15,p.mode=Kt;case Kt:if(p.extra){for($n=p.extra;oe<$n;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}p.offset+=Y&(1<<p.extra)-1,Y>>>=p.extra,oe-=p.extra,p.back+=p.extra}if(p.offset>p.dmax){z.msg="invalid distance too far back",p.mode=Ft;break}p.mode=wr;case wr:if(y===0)break e;if(mt=it-y,p.offset>mt){if(mt=p.offset-mt,mt>p.whave&&p.sane){z.msg="invalid distance too far back",p.mode=Ft;break}mt>p.wnext?(mt-=p.wnext,lr=p.wsize-mt):lr=p.wnext-mt,mt>p.length&&(mt=p.length),ui=p.window}else ui=Bt,lr=ue-p.offset,mt=p.length;mt>y&&(mt=y),y-=mt,p.length-=mt;do Bt[ue++]=ui[lr++];while(--mt);p.length===0&&(p.mode=sr);break;case Gt:if(y===0)break e;Bt[ue++]=p.length,y--,p.mode=sr;break;case kt:if(p.wrap){for(;oe<32;){if(ge===0)break e;ge--,Y|=He[o++]<<oe,oe+=8}if(it-=y,z.total_out+=it,p.total+=it,it&&(z.adler=p.check=p.flags?i(p.check,Bt,it,ue-it):n(p.check,Bt,it,ue-it)),it=y,(p.flags?Y:En(Y))!==p.check){z.msg="incorrect data check",p.mode=Ft;break}Y=0,oe=0}p.mode=hn;case hn:if(p.wrap&&p.flags){for(;oe<32;){if(ge===0)break e;ge--,Y+=He[o++]<<oe,oe+=8}if(Y!==(p.total&4294967295)){z.msg="incorrect length check",p.mode=Ft;break}Y=0,oe=0}p.mode=jr;case jr:Hn=F;break e;case Ft:Hn=de;break e;case Br:return se;case Ir:default:return S}return z.next_out=ue,z.avail_out=y,z.next_in=o,z.avail_in=ge,p.hold=Y,p.bits=oe,(p.wsize||it!==z.avail_out&&p.mode<Ft&&(p.mode<kt||xe!==v))&&Pn(z,z.output,z.next_out,it-z.avail_out),At-=z.avail_in,it-=z.avail_out,z.total_in+=At,z.total_out+=it,p.total+=it,p.wrap&&it&&(z.adler=p.check=p.flags?i(p.check,Bt,it,z.next_out-it):n(p.check,Bt,it,z.next_out-it)),z.data_type=p.bits+(p.last?64:0)+(p.mode===Le?128:0)+(p.mode===Qt||p.mode===Me?256:0),(At===0&&it===0||xe===v)&&Hn===g&&(Hn=I),Hn}function Ue(z){if(!z||!z.state)return S;var xe=z.state;return xe.window&&(xe.window=null),z.state=null,g}function Xe(z,xe){var p;return!z||!z.state||(p=z.state,(p.wrap&2)===0)?S:(p.head=xe,xe.done=!1,g)}function dt(z,xe){var p=xe.length,He,Bt,o;return!z||!z.state||(He=z.state,He.wrap!==0&&He.mode!==tt)?S:He.mode===tt&&(Bt=1,Bt=n(Bt,xe,p,0),Bt!==He.check)?de:(o=Pn(z,xe,p,p),o?(He.mode=Br,se):(He.havedict=1,g))}return Ai.inflateReset=an,Ai.inflateReset2=w,Ai.inflateResetKeep=Jr,Ai.inflateInit=dn,Ai.inflateInit2=li,Ai.inflate=A,Ai.inflateEnd=Ue,Ai.inflateGetHeader=Xe,Ai.inflateSetDictionary=dt,Ai.inflateInfo="pako inflate (from Nodeca project)",Ai}var Dh,Mv;function kv(){return Mv||(Mv=1,Dh={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),Dh}var Lh,Iv;function by(){if(Iv)return Lh;Iv=1;function t(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}return Lh=t,Lh}var Fv;function xy(){if(Fv)return zs;Fv=1;var t=yy(),n=gf(),i=Ev(),f=kv(),h=Sh(),s=Dv(),u=by(),d=Object.prototype.toString;function v(g){if(!(this instanceof v))return new v(g);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},g||{});var F=this.options;F.raw&&F.windowBits>=0&&F.windowBits<16&&(F.windowBits=-F.windowBits,F.windowBits===0&&(F.windowBits=-15)),F.windowBits>=0&&F.windowBits<16&&!(g&&g.windowBits)&&(F.windowBits+=32),F.windowBits>15&&F.windowBits<48&&(F.windowBits&15)===0&&(F.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var $=t.inflateInit2(this.strm,F.windowBits);if($!==f.Z_OK)throw new Error(h[$]);if(this.header=new u,t.inflateGetHeader(this.strm,this.header),F.dictionary&&(typeof F.dictionary=="string"?F.dictionary=i.string2buf(F.dictionary):d.call(F.dictionary)==="[object ArrayBuffer]"&&(F.dictionary=new Uint8Array(F.dictionary)),F.raw&&($=t.inflateSetDictionary(this.strm,F.dictionary),$!==f.Z_OK)))throw new Error(h[$])}v.prototype.push=function(g,F){var $=this.strm,S=this.options.chunkSize,de=this.options.dictionary,se,I,U,te,ce,_e=!1;if(this.ended)return!1;I=F===~~F?F:F===!0?f.Z_FINISH:f.Z_NO_FLUSH,typeof g=="string"?$.input=i.binstring2buf(g):d.call(g)==="[object ArrayBuffer]"?$.input=new Uint8Array(g):$.input=g,$.next_in=0,$.avail_in=$.input.length;do{if($.avail_out===0&&($.output=new n.Buf8(S),$.next_out=0,$.avail_out=S),se=t.inflate($,f.Z_NO_FLUSH),se===f.Z_NEED_DICT&&de&&(se=t.inflateSetDictionary(this.strm,de)),se===f.Z_BUF_ERROR&&_e===!0&&(se=f.Z_OK,_e=!1),se!==f.Z_STREAM_END&&se!==f.Z_OK)return this.onEnd(se),this.ended=!0,!1;$.next_out&&($.avail_out===0||se===f.Z_STREAM_END||$.avail_in===0&&(I===f.Z_FINISH||I===f.Z_SYNC_FLUSH))&&(this.options.to==="string"?(U=i.utf8border($.output,$.next_out),te=$.next_out-U,ce=i.buf2string($.output,U),$.next_out=te,$.avail_out=S-te,te&&n.arraySet($.output,$.output,U,te,0),this.onData(ce)):this.onData(n.shrinkBuf($.output,$.next_out))),$.avail_in===0&&$.avail_out===0&&(_e=!0)}while(($.avail_in>0||$.avail_out===0)&&se!==f.Z_STREAM_END);return se===f.Z_STREAM_END&&(I=f.Z_FINISH),I===f.Z_FINISH?(se=t.inflateEnd(this.strm),this.onEnd(se),this.ended=!0,se===f.Z_OK):(I===f.Z_SYNC_FLUSH&&(this.onEnd(f.Z_OK),$.avail_out=0),!0)},v.prototype.onData=function(g){this.chunks.push(g)},v.prototype.onEnd=function(g){g===f.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg};function M(g,F){var $=new v(F);if($.push(g,!0),$.err)throw $.msg||h[$.err];return $.result}function k(g,F){return F=F||{},F.raw=!0,M(g,F)}return zs.Inflate=v,zs.inflate=M,zs.inflateRaw=k,zs.ungzip=M,zs}var Oh,Nv;function wy(){if(Nv)return Oh;Nv=1;var t=gf().assign,n=py(),i=xy(),f=kv(),h={};return t(h,n,i,f),Oh=h,Oh}(function(t){(function(){var n={},i;t.exports=n,typeof dy=="function"?i=wy():i=window.pako,function(f,h){f.toRGBA8=function(s){var u=s.width,d=s.height;if(s.tabs.acTL==null)return[f.toRGBA8.decodeImage(s.data,u,d,s).buffer];var v=[];s.frames[0].data==null&&(s.frames[0].data=s.data);for(var M,k=new Uint8Array(u*d*4),g=0;g<s.frames.length;g++){var F=s.frames[g],$=F.rect.x,S=F.rect.y,de=F.rect.width,se=F.rect.height,I=f.toRGBA8.decodeImage(F.data,de,se,s);if(g==0?M=I:F.blend==0?f._copyTile(I,de,se,M,u,d,$,S,0):F.blend==1&&f._copyTile(I,de,se,M,u,d,$,S,1),v.push(M.buffer),M=M.slice(0),F.dispose!=0){if(F.dispose==1)f._copyTile(k,de,se,M,u,d,$,S,0);else if(F.dispose==2){for(var U=g-1;s.frames[U].dispose==2;)U--;M=new Uint8Array(v[U]).slice(0)}}}return v},f.toRGBA8.decodeImage=function(s,u,d,v){var M=u*d,k=f.decode._getBPP(v),g=Math.ceil(u*k/8),F=new Uint8Array(M*4),$=new Uint32Array(F.buffer),S=v.ctype,de=v.depth,se=f._bin.readUshort;if(S==6){var I=M<<2;if(de==8)for(var U=0;U<I;U++)F[U]=s[U];if(de==16)for(var U=0;U<I;U++)F[U]=s[U<<1]}else if(S==2){var te=v.tabs.tRNS,ce=-1,_e=-1,we=-1;if(te&&(ce=te[0],_e=te[1],we=te[2]),de==8)for(var U=0;U<M;U++){var ee=U<<2,Ce=U*3;F[ee]=s[Ce],F[ee+1]=s[Ce+1],F[ee+2]=s[Ce+2],F[ee+3]=255,ce!=-1&&s[Ce]==ce&&s[Ce+1]==_e&&s[Ce+2]==we&&(F[ee+3]=0)}if(de==16)for(var U=0;U<M;U++){var ee=U<<2,Ce=U*6;F[ee]=s[Ce],F[ee+1]=s[Ce+2],F[ee+2]=s[Ce+4],F[ee+3]=255,ce!=-1&&se(s,Ce)==ce&&se(s,Ce+2)==_e&&se(s,Ce+4)==we&&(F[ee+3]=0)}}else if(S==3){var ut=v.tabs.PLTE,ct=v.tabs.tRNS,nt=ct?ct.length:0;if(de==1)for(var ft=0;ft<d;ft++)for(var tt=ft*g,Le=ft*u,U=0;U<u;U++){var ee=Le+U<<2,Ct=s[tt+(U>>3)]>>7-((U&7)<<0)&1,bt=3*Ct;F[ee]=ut[bt],F[ee+1]=ut[bt+1],F[ee+2]=ut[bt+2],F[ee+3]=Ct<nt?ct[Ct]:255}if(de==2)for(var ft=0;ft<d;ft++)for(var tt=ft*g,Le=ft*u,U=0;U<u;U++){var ee=Le+U<<2,Ct=s[tt+(U>>2)]>>6-((U&3)<<1)&3,bt=3*Ct;F[ee]=ut[bt],F[ee+1]=ut[bt+1],F[ee+2]=ut[bt+2],F[ee+3]=Ct<nt?ct[Ct]:255}if(de==4)for(var ft=0;ft<d;ft++)for(var tt=ft*g,Le=ft*u,U=0;U<u;U++){var ee=Le+U<<2,Ct=s[tt+(U>>1)]>>4-((U&1)<<2)&15,bt=3*Ct;F[ee]=ut[bt],F[ee+1]=ut[bt+1],F[ee+2]=ut[bt+2],F[ee+3]=Ct<nt?ct[Ct]:255}if(de==8)for(var U=0;U<M;U++){var ee=U<<2,Ct=s[U],bt=3*Ct;F[ee]=ut[bt],F[ee+1]=ut[bt+1],F[ee+2]=ut[bt+2],F[ee+3]=Ct<nt?ct[Ct]:255}}else if(S==4){if(de==8)for(var U=0;U<M;U++){var ee=U<<2,Me=U<<1,Ze=s[Me];F[ee]=Ze,F[ee+1]=Ze,F[ee+2]=Ze,F[ee+3]=s[Me+1]}if(de==16)for(var U=0;U<M;U++){var ee=U<<2,Me=U<<2,Ze=s[Me];F[ee]=Ze,F[ee+1]=Ze,F[ee+2]=Ze,F[ee+3]=s[Me+2]}}else if(S==0){var ce=v.tabs.tRNS?v.tabs.tRNS:-1;if(de==1)for(var U=0;U<M;U++){var Ze=255*(s[U>>3]>>7-(U&7)&1),St=Ze==ce*255?0:255;$[U]=St<<24|Ze<<16|Ze<<8|Ze}if(de==2)for(var U=0;U<M;U++){var Ze=85*(s[U>>2]>>6-((U&3)<<1)&3),St=Ze==ce*85?0:255;$[U]=St<<24|Ze<<16|Ze<<8|Ze}if(de==4)for(var U=0;U<M;U++){var Ze=17*(s[U>>1]>>4-((U&1)<<2)&15),St=Ze==ce*17?0:255;$[U]=St<<24|Ze<<16|Ze<<8|Ze}if(de==8)for(var U=0;U<M;U++){var Ze=s[U],St=Ze==ce?0:255;$[U]=St<<24|Ze<<16|Ze<<8|Ze}if(de==16)for(var U=0;U<M;U++){var Ze=s[U<<1],St=se(s,U<<1)==ce?0:255;$[U]=St<<24|Ze<<16|Ze<<8|Ze}}return F},f.decode=function(s){for(var u=new Uint8Array(s),d=8,v=f._bin,M=v.readUshort,k=v.readUint,g={tabs:{},frames:[]},F=new Uint8Array(u.length),$=0,S,de=0,se=[137,80,78,71,13,10,26,10],I=0;I<8;I++)if(u[I]!=se[I])throw"The input is not a PNG file!";for(;d<u.length;){var U=v.readUint(u,d);d+=4;var te=v.readASCII(u,d,4);if(d+=4,te=="IHDR")f.decode._IHDR(u,d,g);else if(te=="IDAT"){for(var I=0;I<U;I++)F[$+I]=u[d+I];$+=U}else if(te=="acTL")g.tabs[te]={num_frames:k(u,d),num_plays:k(u,d+4)},S=new Uint8Array(u.length);else if(te=="fcTL"){if(de!=0){var ce=g.frames[g.frames.length-1];ce.data=f.decode._decompress(g,S.slice(0,de),ce.rect.width,ce.rect.height),de=0}var _e={x:k(u,d+12),y:k(u,d+16),width:k(u,d+4),height:k(u,d+8)},we=M(u,d+22);we=M(u,d+20)/(we==0?100:we);var ee={rect:_e,delay:Math.round(we*1e3),dispose:u[d+24],blend:u[d+25]};g.frames.push(ee)}else if(te=="fdAT"){for(var I=0;I<U-4;I++)S[de+I]=u[d+I+4];de+=U-4}else if(te=="pHYs")g.tabs[te]=[v.readUint(u,d),v.readUint(u,d+4),u[d+8]];else if(te=="cHRM"){g.tabs[te]=[];for(var I=0;I<8;I++)g.tabs[te].push(v.readUint(u,d+I*4))}else if(te=="tEXt"){g.tabs[te]==null&&(g.tabs[te]={});var Ce=v.nextZero(u,d),ut=v.readASCII(u,d,Ce-d),ct=v.readASCII(u,Ce+1,d+U-Ce-1);g.tabs[te][ut]=ct}else if(te=="iTXt"){g.tabs[te]==null&&(g.tabs[te]={});var Ce=0,nt=d;Ce=v.nextZero(u,nt);var ut=v.readASCII(u,nt,Ce-nt);nt=Ce+1,u[nt],u[nt+1],nt+=2,Ce=v.nextZero(u,nt),v.readASCII(u,nt,Ce-nt),nt=Ce+1,Ce=v.nextZero(u,nt),v.readUTF8(u,nt,Ce-nt),nt=Ce+1;var ct=v.readUTF8(u,nt,U-(nt-d));g.tabs[te][ut]=ct}else if(te=="PLTE")g.tabs[te]=v.readBytes(u,d,U);else if(te=="hIST"){var ft=g.tabs.PLTE.length/3;g.tabs[te]=[];for(var I=0;I<ft;I++)g.tabs[te].push(M(u,d+I*2))}else if(te=="tRNS")g.ctype==3?g.tabs[te]=v.readBytes(u,d,U):g.ctype==0?g.tabs[te]=M(u,d):g.ctype==2&&(g.tabs[te]=[M(u,d),M(u,d+2),M(u,d+4)]);else if(te=="gAMA")g.tabs[te]=v.readUint(u,d)/1e5;else if(te=="sRGB")g.tabs[te]=u[d];else if(te=="bKGD")g.ctype==0||g.ctype==4?g.tabs[te]=[M(u,d)]:g.ctype==2||g.ctype==6?g.tabs[te]=[M(u,d),M(u,d+2),M(u,d+4)]:g.ctype==3&&(g.tabs[te]=u[d]);else if(te=="IEND"){if(de!=0){var ce=g.frames[g.frames.length-1];ce.data=f.decode._decompress(g,S.slice(0,de),ce.rect.width,ce.rect.height),de=0}g.data=f.decode._decompress(g,F,g.width,g.height);break}d+=U,v.readUint(u,d),d+=4}return delete g.compress,delete g.interlace,delete g.filter,g},f.decode._decompress=function(s,u,d,v){return s.compress==0&&(u=f.decode._inflate(u)),s.interlace==0?u=f.decode._filterZero(u,s,0,d,v):s.interlace==1&&(u=f.decode._readInterlace(u,s)),u},f.decode._inflate=function(s){return h.inflate(s)},f.decode._readInterlace=function(s,u){for(var d=u.width,v=u.height,M=f.decode._getBPP(u),k=M>>3,g=Math.ceil(d*M/8),F=new Uint8Array(v*g),$=0,S=[0,0,4,0,2,0,1],de=[0,4,0,2,0,1,0],se=[8,8,8,4,4,2,2],I=[8,8,4,4,2,2,1],U=0;U<7;){for(var te=se[U],ce=I[U],_e=0,we=0,ee=S[U];ee<v;)ee+=te,we++;for(var Ce=de[U];Ce<d;)Ce+=ce,_e++;var ut=Math.ceil(_e*M/8);f.decode._filterZero(s,u,$,_e,we);for(var ct=0,nt=S[U];nt<v;){for(var ft=de[U],tt=$+ct*ut<<3;ft<d;){if(M==1){var Le=s[tt>>3];Le=Le>>7-(tt&7)&1,F[nt*g+(ft>>3)]|=Le<<7-((ft&3)<<0)}if(M==2){var Le=s[tt>>3];Le=Le>>6-(tt&7)&3,F[nt*g+(ft>>2)]|=Le<<6-((ft&3)<<1)}if(M==4){var Le=s[tt>>3];Le=Le>>4-(tt&7)&15,F[nt*g+(ft>>1)]|=Le<<4-((ft&1)<<2)}if(M>=8)for(var Ct=nt*g+ft*k,bt=0;bt<k;bt++)F[Ct+bt]=s[(tt>>3)+bt];tt+=M,ft+=ce}ct++,nt+=te}_e*we!=0&&($+=we*(1+ut)),U=U+1}return F},f.decode._getBPP=function(s){var u=[1,null,3,1,2,null,4][s.ctype];return u*s.depth},f.decode._filterZero=function(s,u,d,v,M){var k=f.decode._getBPP(u),g=Math.ceil(v*k/8),F=f.decode._paeth;k=Math.ceil(k/8);for(var $=0;$<M;$++){var S=d+$*g,de=S+$+1,se=s[de-1];if(se==0)for(var I=0;I<g;I++)s[S+I]=s[de+I];else if(se==1){for(var I=0;I<k;I++)s[S+I]=s[de+I];for(var I=k;I<g;I++)s[S+I]=s[de+I]+s[S+I-k]&255}else if($==0){for(var I=0;I<k;I++)s[S+I]=s[de+I];if(se==2)for(var I=k;I<g;I++)s[S+I]=s[de+I]&255;if(se==3)for(var I=k;I<g;I++)s[S+I]=s[de+I]+(s[S+I-k]>>1)&255;if(se==4)for(var I=k;I<g;I++)s[S+I]=s[de+I]+F(s[S+I-k],0,0)&255}else{if(se==2)for(var I=0;I<g;I++)s[S+I]=s[de+I]+s[S+I-g]&255;if(se==3){for(var I=0;I<k;I++)s[S+I]=s[de+I]+(s[S+I-g]>>1)&255;for(var I=k;I<g;I++)s[S+I]=s[de+I]+(s[S+I-g]+s[S+I-k]>>1)&255}if(se==4){for(var I=0;I<k;I++)s[S+I]=s[de+I]+F(0,s[S+I-g],0)&255;for(var I=k;I<g;I++)s[S+I]=s[de+I]+F(s[S+I-k],s[S+I-g],s[S+I-k-g])&255}}}return s},f.decode._paeth=function(s,u,d){var v=s+u-d,M=Math.abs(v-s),k=Math.abs(v-u),g=Math.abs(v-d);return M<=k&&M<=g?s:k<=g?u:d},f.decode._IHDR=function(s,u,d){var v=f._bin;d.width=v.readUint(s,u),u+=4,d.height=v.readUint(s,u),u+=4,d.depth=s[u],u++,d.ctype=s[u],u++,d.compress=s[u],u++,d.filter=s[u],u++,d.interlace=s[u],u++},f._bin={nextZero:function(s,u){for(;s[u]!=0;)u++;return u},readUshort:function(s,u){return s[u]<<8|s[u+1]},writeUshort:function(s,u,d){s[u]=d>>8&255,s[u+1]=d&255},readUint:function(s,u){return s[u]*(256*256*256)+(s[u+1]<<16|s[u+2]<<8|s[u+3])},writeUint:function(s,u,d){s[u]=d>>24&255,s[u+1]=d>>16&255,s[u+2]=d>>8&255,s[u+3]=d&255},readASCII:function(s,u,d){for(var v="",M=0;M<d;M++)v+=String.fromCharCode(s[u+M]);return v},writeASCII:function(s,u,d){for(var v=0;v<d.length;v++)s[u+v]=d.charCodeAt(v)},readBytes:function(s,u,d){for(var v=[],M=0;M<d;M++)v.push(s[u+M]);return v},pad:function(s){return s.length<2?"0"+s:s},readUTF8:function(s,u,d){for(var v="",M,k=0;k<d;k++)v+="%"+f._bin.pad(s[u+k].toString(16));try{M=decodeURIComponent(v)}catch{return f._bin.readASCII(s,u,d)}return M}},f._copyTile=function(s,u,d,v,M,k,g,F,$){for(var S=Math.min(u,M),de=Math.min(d,k),se=0,I=0,U=0;U<de;U++)for(var te=0;te<S;te++)if(g>=0&&F>=0?(se=U*u+te<<2,I=(F+U)*M+g+te<<2):(se=(-F+U)*u-g+te<<2,I=U*M+te<<2),$==0)v[I]=s[se],v[I+1]=s[se+1],v[I+2]=s[se+2],v[I+3]=s[se+3];else if($==1){var ce=s[se+3]*.00392156862745098,_e=s[se]*ce,we=s[se+1]*ce,ee=s[se+2]*ce,Ce=v[I+3]*(1/255),ut=v[I]*Ce,ct=v[I+1]*Ce,nt=v[I+2]*Ce,ft=1-ce,tt=ce+Ce*ft,Le=tt==0?0:1/tt;v[I+3]=255*tt,v[I+0]=(_e+ut*ft)*Le,v[I+1]=(we+ct*ft)*Le,v[I+2]=(ee+nt*ft)*Le}else if($==2){var ce=s[se+3],_e=s[se],we=s[se+1],ee=s[se+2],Ce=v[I+3],ut=v[I],ct=v[I+1],nt=v[I+2];ce==Ce&&_e==ut&&we==ct&&ee==nt?(v[I]=0,v[I+1]=0,v[I+2]=0,v[I+3]=0):(v[I]=_e,v[I+1]=we,v[I+2]=ee,v[I+3]=ce)}else if($==3){var ce=s[se+3],_e=s[se],we=s[se+1],ee=s[se+2],Ce=v[I+3],ut=v[I],ct=v[I+1],nt=v[I+2];if(ce==Ce&&_e==ut&&we==ct&&ee==nt)continue;if(ce<220&&Ce>20)return!1}return!0},f.encode=function(s,u,d,v,M,k){v==null&&(v=0),k==null&&(k=!1);for(var g=new Uint8Array(s[0].byteLength*s.length+100),F=[137,80,78,71,13,10,26,10],$=0;$<8;$++)g[$]=F[$];var S=8,de=f._bin,se=f.crc.crc,I=de.writeUint,U=de.writeUshort,te=de.writeASCII,ce=f.encode.compressPNG(s,u,d,v,k);I(g,S,13),S+=4,te(g,S,"IHDR"),S+=4,I(g,S,u),S+=4,I(g,S,d),S+=4,g[S]=ce.depth,S++,g[S]=ce.ctype,S++,g[S]=0,S++,g[S]=0,S++,g[S]=0,S++,I(g,S,se(g,S-17,17)),S+=4,I(g,S,1),S+=4,te(g,S,"sRGB"),S+=4,g[S]=1,S++,I(g,S,se(g,S-5,5)),S+=4;var _e=s.length>1;if(_e&&(I(g,S,8),S+=4,te(g,S,"acTL"),S+=4,I(g,S,s.length),S+=4,I(g,S,0),S+=4,I(g,S,se(g,S-12,12)),S+=4),ce.ctype==3){var we=ce.plte.length;I(g,S,we*3),S+=4,te(g,S,"PLTE"),S+=4;for(var $=0;$<we;$++){var ee=$*3,Ce=ce.plte[$],ut=Ce&255,ct=Ce>>8&255,nt=Ce>>16&255;g[S+ee+0]=ut,g[S+ee+1]=ct,g[S+ee+2]=nt}if(S+=we*3,I(g,S,se(g,S-we*3-4,we*3+4)),S+=4,ce.gotAlpha){I(g,S,we),S+=4,te(g,S,"tRNS"),S+=4;for(var $=0;$<we;$++)g[S+$]=ce.plte[$]>>24&255;S+=we,I(g,S,se(g,S-we-4,we+4)),S+=4}}for(var ft=0,tt=0;tt<ce.frames.length;tt++){var Le=ce.frames[tt];_e&&(I(g,S,26),S+=4,te(g,S,"fcTL"),S+=4,I(g,S,ft++),S+=4,I(g,S,Le.rect.width),S+=4,I(g,S,Le.rect.height),S+=4,I(g,S,Le.rect.x),S+=4,I(g,S,Le.rect.y),S+=4,U(g,S,M[tt]),S+=2,U(g,S,1e3),S+=2,g[S]=Le.dispose,S++,g[S]=Le.blend,S++,I(g,S,se(g,S-30,30)),S+=4);var Ct=Le.cimg,we=Ct.length;I(g,S,we+(tt==0?0:4)),S+=4;var bt=S;te(g,S,tt==0?"IDAT":"fdAT"),S+=4,tt!=0&&(I(g,S,ft++),S+=4);for(var $=0;$<we;$++)g[S+$]=Ct[$];S+=we,I(g,S,se(g,bt,S-bt)),S+=4}return I(g,S,0),S+=4,te(g,S,"IEND"),S+=4,I(g,S,se(g,S-4,4)),S+=4,g.buffer.slice(0,S)},f.encode.compressPNG=function(s,u,d,v,M){for(var k=f.encode.compress(s,u,d,v,!1,M),g=0;g<s.length;g++){var F=k.frames[g];F.rect.width;var $=F.rect.height,S=F.bpl,de=F.bpp,se=new Uint8Array($*S+$);F.cimg=f.encode._filterZero(F.img,$,de,S,se)}return k},f.encode.compress=function(s,u,d,v,M,k){k==null&&(k=!1);for(var g=6,F=8,$=4,S=255,de=0;de<s.length;de++)for(var se=new Uint8Array(s[de]),I=se.length,U=0;U<I;U+=4)S&=se[U+3];var te=S!=255,ce={},_e=[];if(s.length!=0&&(ce[0]=0,_e.push(0),v!=0&&v--),v!=0){var we=f.quantize(s,v,M);s=we.bufs;for(var U=0;U<we.plte.length;U++){var ee=we.plte[U].est.rgba;ce[ee]==null&&(ce[ee]=_e.length,_e.push(ee))}}else for(var de=0;de<s.length;de++)for(var Ce=new Uint32Array(s[de]),I=Ce.length,U=0;U<I;U++){var ee=Ce[U];if((U<u||ee!=Ce[U-1]&&ee!=Ce[U-u])&&ce[ee]==null&&(ce[ee]=_e.length,_e.push(ee),_e.length>=300))break}var ut=te?M:!1,ct=_e.length;ct<=256&&k==!1&&(ct<=2?F=1:ct<=4?F=2:ct<=16?F=4:F=8,M&&(F=8),te=!0);for(var nt=[],de=0;de<s.length;de++){var ft=new Uint8Array(s[de]),tt=new Uint32Array(ft.buffer),Le=0,Ct=0,bt=u,Me=d,Ze=0;if(de!=0&&!ut){for(var St=M||de==1||nt[nt.length-2].dispose==2?1:2,$t=0,Wt=1e9,Qt=0;Qt<St;Qt++){for(var jr=new Uint8Array(s[de-1-Qt]),sr=new Uint32Array(s[de-1-Qt]),xr=u,or=d,Kt=-1,wr=-1,Gt=0;Gt<d;Gt++)for(var kt=0;kt<u;kt++){var U=Gt*u+kt;tt[U]!=sr[U]&&(kt<xr&&(xr=kt),kt>Kt&&(Kt=kt),Gt<or&&(or=Gt),Gt>wr&&(wr=Gt))}var hn=Kt==-1?1:(Kt-xr+1)*(wr-or+1);hn<Wt&&(Wt=hn,$t=Qt,Kt==-1?(Le=Ct=0,bt=Me=1):(Le=xr,Ct=or,bt=Kt-xr+1,Me=wr-or+1))}var jr=new Uint8Array(s[de-1-$t]);$t==1&&(nt[nt.length-1].dispose=2);var Ft=new Uint8Array(bt*Me*4);new Uint32Array(Ft.buffer),f._copyTile(jr,u,d,Ft,bt,Me,-Le,-Ct,0),f._copyTile(ft,u,d,Ft,bt,Me,-Le,-Ct,3)?(f._copyTile(ft,u,d,Ft,bt,Me,-Le,-Ct,2),Ze=1):(f._copyTile(ft,u,d,Ft,bt,Me,-Le,-Ct,0),Ze=0),ft=Ft,tt=new Uint32Array(ft.buffer)}var Br=4*bt;if(ct<=256&&k==!1){Br=Math.ceil(F*bt/8);for(var Ft=new Uint8Array(Br*Me),Gt=0;Gt<Me;Gt++){var U=Gt*Br,Ir=Gt*bt;if(F==8)for(var kt=0;kt<bt;kt++)Ft[U+kt]=ce[tt[Ir+kt]];else if(F==4)for(var kt=0;kt<bt;kt++)Ft[U+(kt>>1)]|=ce[tt[Ir+kt]]<<4-(kt&1)*4;else if(F==2)for(var kt=0;kt<bt;kt++)Ft[U+(kt>>2)]|=ce[tt[Ir+kt]]<<6-(kt&3)*2;else if(F==1)for(var kt=0;kt<bt;kt++)Ft[U+(kt>>3)]|=ce[tt[Ir+kt]]<<7-(kt&7)*1}ft=Ft,g=3,$=1}else if(te==!1&&s.length==1){for(var Ft=new Uint8Array(bt*Me*3),Zr=bt*Me,U=0;U<Zr;U++){var Qr=U*3,ar=U*4;Ft[Qr]=ft[ar],Ft[Qr+1]=ft[ar+1],Ft[Qr+2]=ft[ar+2]}ft=Ft,g=2,$=3,Br=3*bt}nt.push({rect:{x:Le,y:Ct,width:bt,height:Me},img:ft,bpl:Br,bpp:$,blend:Ze,dispose:ut?1:0})}return{ctype:g,depth:F,plte:_e,gotAlpha:te,frames:nt}},f.encode._filterZero=function(s,u,d,v,M){for(var k=[],g=0;g<5;g++)if(!(u*v>5e5&&(g==2||g==3||g==4))){for(var F=0;F<u;F++)f.encode._filterLine(M,s,F,v,d,g);if(k.push(h.deflate(M)),d==1)break}for(var $,S=1e9,de=0;de<k.length;de++)k[de].length<S&&($=de,S=k[de].length);return k[$]},f.encode._filterLine=function(s,u,d,v,M,k){var g=d*v,F=g+d,$=f.decode._paeth;if(s[F]=k,F++,k==0)for(var S=0;S<v;S++)s[F+S]=u[g+S];else if(k==1){for(var S=0;S<M;S++)s[F+S]=u[g+S];for(var S=M;S<v;S++)s[F+S]=u[g+S]-u[g+S-M]+256&255}else if(d==0){for(var S=0;S<M;S++)s[F+S]=u[g+S];if(k==2)for(var S=M;S<v;S++)s[F+S]=u[g+S];if(k==3)for(var S=M;S<v;S++)s[F+S]=u[g+S]-(u[g+S-M]>>1)+256&255;if(k==4)for(var S=M;S<v;S++)s[F+S]=u[g+S]-$(u[g+S-M],0,0)+256&255}else{if(k==2)for(var S=0;S<v;S++)s[F+S]=u[g+S]+256-u[g+S-v]&255;if(k==3){for(var S=0;S<M;S++)s[F+S]=u[g+S]+256-(u[g+S-v]>>1)&255;for(var S=M;S<v;S++)s[F+S]=u[g+S]+256-(u[g+S-v]+u[g+S-M]>>1)&255}if(k==4){for(var S=0;S<M;S++)s[F+S]=u[g+S]+256-$(0,u[g+S-v],0)&255;for(var S=M;S<v;S++)s[F+S]=u[g+S]+256-$(u[g+S-M],u[g+S-v],u[g+S-M-v])&255}}},f.crc={table:function(){for(var s=new Uint32Array(256),u=0;u<256;u++){for(var d=u,v=0;v<8;v++)d&1?d=3988292384^d>>>1:d=d>>>1;s[u]=d}return s}(),update:function(s,u,d,v){for(var M=0;M<v;M++)s=f.crc.table[(s^u[d+M])&255]^s>>>8;return s},crc:function(s,u,d){return f.crc.update(4294967295,s,u,d)^4294967295}},f.quantize=function(s,u,d){for(var v=[],M=0,k=0;k<s.length;k++)v.push(f.encode.alphaMul(new Uint8Array(s[k]),d)),M+=s[k].byteLength;for(var g=new Uint8Array(M),F=new Uint32Array(g.buffer),$=0,k=0;k<v.length;k++){for(var S=v[k],de=S.length,se=0;se<de;se++)g[$+se]=S[se];$+=de}var I={i0:0,i1:g.length,bst:null,est:null,tdst:0,left:null,right:null};I.bst=f.quantize.stats(g,I.i0,I.i1),I.est=f.quantize.estats(I.bst);for(var U=[I];U.length<u;){for(var te=0,ce=0,k=0;k<U.length;k++)U[k].est.L>te&&(te=U[k].est.L,ce=k);if(te<.001)break;var _e=U[ce],we=f.quantize.splitPixels(g,F,_e.i0,_e.i1,_e.est.e,_e.est.eMq255),ee={i0:_e.i0,i1:we,bst:null,est:null,tdst:0,left:null,right:null};ee.bst=f.quantize.stats(g,ee.i0,ee.i1),ee.est=f.quantize.estats(ee.bst);var Ce={i0:we,i1:_e.i1,bst:null,est:null,tdst:0,left:null,right:null};Ce.bst={R:[],m:[],N:_e.bst.N-ee.bst.N};for(var k=0;k<16;k++)Ce.bst.R[k]=_e.bst.R[k]-ee.bst.R[k];for(var k=0;k<4;k++)Ce.bst.m[k]=_e.bst.m[k]-ee.bst.m[k];Ce.est=f.quantize.estats(Ce.bst),_e.left=ee,_e.right=Ce,U[ce]=ee,U.push(Ce)}U.sort(function(St,$t){return $t.bst.N-St.bst.N});for(var ut=0;ut<v.length;ut++){for(var ct=f.quantize.planeDst,nt=new Uint8Array(v[ut].buffer),ft=new Uint32Array(v[ut].buffer),tt=nt.length,k=0;k<tt;k+=4){for(var Le=nt[k]*.00392156862745098,Ct=nt[k+1]*(1/255),bt=nt[k+2]*(1/255),Me=nt[k+3]*(1/255),Ze=I;Ze.left;)Ze=ct(Ze.est,Le,Ct,bt,Me)<=0?Ze.left:Ze.right;ft[k>>2]=Ze.est.rgba}v[ut]=ft.buffer}return{bufs:v,plte:U}},f.quantize.getNearest=function(s,u,d,v,M){if(s.left==null)return s.tdst=f.quantize.dist(s.est.q,u,d,v,M),s;var k=f.quantize.planeDst(s.est,u,d,v,M),g=s.left,F=s.right;k>0&&(g=s.right,F=s.left);var $=f.quantize.getNearest(g,u,d,v,M);if($.tdst<=k*k)return $;var S=f.quantize.getNearest(F,u,d,v,M);return S.tdst<$.tdst?S:$},f.quantize.planeDst=function(s,u,d,v,M){var k=s.e;return k[0]*u+k[1]*d+k[2]*v+k[3]*M-s.eMq},f.quantize.dist=function(s,u,d,v,M){var k=u-s[0],g=d-s[1],F=v-s[2],$=M-s[3];return k*k+g*g+F*F+$*$},f.quantize.splitPixels=function(s,u,d,v,M,k){var g=f.quantize.vecDot;for(v-=4;d<v;){for(;g(s,d,M)<=k;)d+=4;for(;g(s,v,M)>k;)v-=4;if(d>=v)break;var F=u[d>>2];u[d>>2]=u[v>>2],u[v>>2]=F,d+=4,v-=4}for(;g(s,d,M)>k;)d-=4;return d+4},f.quantize.vecDot=function(s,u,d){return s[u]*d[0]+s[u+1]*d[1]+s[u+2]*d[2]+s[u+3]*d[3]},f.quantize.stats=function(s,u,d){for(var v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],M=[0,0,0,0],k=d-u>>2,g=u;g<d;g+=4){var F=s[g]*.00392156862745098,$=s[g+1]*(1/255),S=s[g+2]*(1/255),de=s[g+3]*(1/255);M[0]+=F,M[1]+=$,M[2]+=S,M[3]+=de,v[0]+=F*F,v[1]+=F*$,v[2]+=F*S,v[3]+=F*de,v[5]+=$*$,v[6]+=$*S,v[7]+=$*de,v[10]+=S*S,v[11]+=S*de,v[15]+=de*de}return v[4]=v[1],v[8]=v[2],v[12]=v[3],v[9]=v[6],v[13]=v[7],v[14]=v[11],{R:v,m:M,N:k}},f.quantize.estats=function(s){var u=s.R,d=s.m,v=s.N,M=d[0],k=d[1],g=d[2],F=d[3],$=v==0?0:1/v,S=[u[0]-M*M*$,u[1]-M*k*$,u[2]-M*g*$,u[3]-M*F*$,u[4]-k*M*$,u[5]-k*k*$,u[6]-k*g*$,u[7]-k*F*$,u[8]-g*M*$,u[9]-g*k*$,u[10]-g*g*$,u[11]-g*F*$,u[12]-F*M*$,u[13]-F*k*$,u[14]-F*g*$,u[15]-F*F*$],de=S,se=f.M4,I=[.5,.5,.5,.5],U=0,te=0;if(v!=0)for(var ce=0;ce<10&&(I=se.multVec(de,I),te=Math.sqrt(se.dot(I,I)),I=se.sml(1/te,I),!(Math.abs(te-U)<1e-9));ce++)U=te;var _e=[M*$,k*$,g*$,F*$],we=se.dot(se.sml(255,_e),I),ee=_e[3]<.001?0:1/_e[3];return{Cov:S,q:_e,e:I,L:U,eMq255:we,eMq:se.dot(I,_e),rgba:(Math.round(255*_e[3])<<24|Math.round(255*_e[2]*ee)<<16|Math.round(255*_e[1]*ee)<<8|Math.round(255*_e[0]*ee)<<0)>>>0}},f.M4={multVec:function(s,u){return[s[0]*u[0]+s[1]*u[1]+s[2]*u[2]+s[3]*u[3],s[4]*u[0]+s[5]*u[1]+s[6]*u[2]+s[7]*u[3],s[8]*u[0]+s[9]*u[1]+s[10]*u[2]+s[11]*u[3],s[12]*u[0]+s[13]*u[1]+s[14]*u[2]+s[15]*u[3]]},dot:function(s,u){return s[0]*u[0]+s[1]*u[1]+s[2]*u[2]+s[3]*u[3]},sml:function(s,u){return[s*u[0],s*u[1],s*u[2],s*u[3]]}},f.encode.alphaMul=function(s,u){for(var d=new Uint8Array(s.length),v=s.length>>2,M=0;M<v;M++){var k=M<<2,g=s[k+3];u&&(g=g<128?0:255);var F=g*(1/255);d[k+0]=s[k+0]*F,d[k+1]=s[k+1]*F,d[k+2]=s[k+2]*F,d[k+3]=g}return d}}(n,i)})()})(gh);var Bv={exports:{}};(function(t,n){(function(i,f){t.exports=f()})(Us,function(){var i=function(c){return c instanceof Uint8Array||c instanceof Uint16Array||c instanceof Uint32Array||c instanceof Int8Array||c instanceof Int16Array||c instanceof Int32Array||c instanceof Float32Array||c instanceof Float64Array||c instanceof Uint8ClampedArray},f=function(c,x){for(var C=Object.keys(x),ie=0;ie<C.length;++ie)c[C[ie]]=x[C[ie]];return c},h=`
|
|
37
|
-
`;function s(c){return typeof atob<"u"?atob(c):"base64:"+c}function u(c){var x=new Error("(regl) "+c);throw console.error(x),x}function d(c,x){c||u(x)}function v(c){return c?": "+c:""}function M(c,x,C){c in x||u("unknown parameter ("+c+")"+v(C)+". possible values: "+Object.keys(x).join())}function k(c,x){i(c)||u("invalid parameter type"+v(x)+". must be a typed array")}function g(c,x){switch(x){case"number":return typeof c=="number";case"object":return typeof c=="object";case"string":return typeof c=="string";case"boolean":return typeof c=="boolean";case"function":return typeof c=="function";case"undefined":return typeof c>"u";case"symbol":return typeof c=="symbol"}}function F(c,x,C){g(c,x)||u("invalid parameter type"+v(C)+". expected "+x+", got "+typeof c)}function $(c,x){c>=0&&(c|0)===c||u("invalid parameter type, ("+c+")"+v(x)+". must be a nonnegative integer")}function S(c,x,C){x.indexOf(c)<0&&u("invalid value"+v(C)+". must be one of: "+x)}var de=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function se(c){Object.keys(c).forEach(function(x){de.indexOf(x)<0&&u('invalid regl constructor argument "'+x+'". must be one of '+de)})}function I(c,x){for(c=c+"";c.length<x;)c=" "+c;return c}function U(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function te(c,x){this.number=c,this.line=x,this.errors=[]}function ce(c,x,C){this.file=c,this.line=x,this.message=C}function _e(){var c=new Error,x=(c.stack||c).toString(),C=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(x);if(C)return C[1];var ie=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(x);return ie?ie[1]:"unknown"}function we(){var c=new Error,x=(c.stack||c).toString(),C=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(x);if(C)return C[1];var ie=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(x);return ie?ie[1]:"unknown"}function ee(c,x){var C=c.split(`
|
|
38
|
-
`),ie=1,pe=0,re={unknown:new U,0:new U};re.unknown.name=re[0].name=x||_e(),re.unknown.lines.push(new te(0,""));for(var ae=0;ae<C.length;++ae){var De=C[ae],Ae=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(De);if(Ae)switch(Ae[1]){case"line":var Be=/(\d+)(\s+\d+)?/.exec(Ae[2]);Be&&(ie=Be[1]|0,Be[2]&&(pe=Be[2]|0,pe in re||(re[pe]=new U)));break;case"define":var Ge=/SHADER_NAME(_B64)?\s+(.*)$/.exec(Ae[2]);Ge&&(re[pe].name=Ge[1]?s(Ge[2]):Ge[2]);break}re[pe].lines.push(new te(ie++,De))}return Object.keys(re).forEach(function(Pe){var We=re[Pe];We.lines.forEach(function(Oe){We.index[Oe.number]=Oe})}),re}function Ce(c){var x=[];return c.split(`
|
|
39
|
-
`).forEach(function(C){if(!(C.length<5)){var ie=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(C);ie?x.push(new ce(ie[1]|0,ie[2]|0,ie[3].trim())):C.length>0&&x.push(new ce("unknown",0,C))}}),x}function ut(c,x){x.forEach(function(C){var ie=c[C.file];if(ie){var pe=ie.index[C.line];if(pe){pe.errors.push(C),ie.hasErrors=!0;return}}c.unknown.hasErrors=!0,c.unknown.lines[0].errors.push(C)})}function ct(c,x,C,ie,pe){if(!c.getShaderParameter(x,c.COMPILE_STATUS)){var re=c.getShaderInfoLog(x),ae=ie===c.FRAGMENT_SHADER?"fragment":"vertex";Me(C,"string",ae+" shader source must be a string",pe);var De=ee(C,pe),Ae=Ce(re);ut(De,Ae),Object.keys(De).forEach(function(Be){var Ge=De[Be];if(!Ge.hasErrors)return;var Pe=[""],We=[""];function Oe(Fe,V){Pe.push(Fe),We.push(V||"")}Oe("file number "+Be+": "+Ge.name+`
|
|
40
|
-
`,"color:red;text-decoration:underline;font-weight:bold"),Ge.lines.forEach(function(Fe){if(Fe.errors.length>0){Oe(I(Fe.number,4)+"| ","background-color:yellow; font-weight:bold"),Oe(Fe.line+h,"color:red; background-color:yellow; font-weight:bold");var V=0;Fe.errors.forEach(function(ne){var Re=ne.message,rt=/^\s*'(.*)'\s*:\s*(.*)$/.exec(Re);if(rt){var Se=rt[1];switch(Re=rt[2],Se){case"assign":Se="=";break}V=Math.max(Fe.line.indexOf(Se,V),0)}else V=0;Oe(I("| ",6)),Oe(I("^^^",V+3)+h,"font-weight:bold"),Oe(I("| ",6)),Oe(Re+h,"font-weight:bold")}),Oe(I("| ",6)+h)}else Oe(I(Fe.number,4)+"| "),Oe(Fe.line+h,"color:red")}),typeof document<"u"&&!window.chrome?(We[0]=Pe.join("%c"),console.log.apply(console,We)):console.log(Pe.join(""))}),d.raise("Error compiling "+ae+" shader, "+De[0].name)}}function nt(c,x,C,ie,pe){if(!c.getProgramParameter(x,c.LINK_STATUS)){var re=c.getProgramInfoLog(x),ae=ee(C,pe),De=ee(ie,pe),Ae='Error linking program with vertex shader, "'+De[0].name+'", and fragment shader "'+ae[0].name+'"';typeof document<"u"?console.log("%c"+Ae+h+"%c"+re,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(Ae+h+re),d.raise(Ae)}}function ft(c){c._commandRef=_e()}function tt(c,x,C,ie){ft(c);function pe(Ae){return Ae?ie.id(Ae):0}c._fragId=pe(c.static.frag),c._vertId=pe(c.static.vert);function re(Ae,Be){Object.keys(Be).forEach(function(Ge){Ae[ie.id(Ge)]=!0})}var ae=c._uniformSet={};re(ae,x.static),re(ae,x.dynamic);var De=c._attributeSet={};re(De,C.static),re(De,C.dynamic),c._hasCount="count"in c.static||"count"in c.dynamic||"elements"in c.static||"elements"in c.dynamic}function Le(c,x){var C=we();u(c+" in command "+(x||_e())+(C==="unknown"?"":" called from "+C))}function Ct(c,x,C){c||Le(x,C||_e())}function bt(c,x,C,ie){c in x||Le("unknown parameter ("+c+")"+v(C)+". possible values: "+Object.keys(x).join(),ie||_e())}function Me(c,x,C,ie){g(c,x)||Le("invalid parameter type"+v(C)+". expected "+x+", got "+typeof c,ie||_e())}function Ze(c){c()}function St(c,x,C){c.texture?S(c.texture._texture.internalformat,x,"unsupported texture format for attachment"):S(c.renderbuffer._renderbuffer.format,C,"unsupported renderbuffer format for attachment")}var $t=33071,Wt=9728,Qt=9984,sr=9985,xr=9986,or=9987,Kt=5120,wr=5121,Gt=5122,kt=5123,hn=5124,jr=5125,Ft=5126,Br=32819,Ir=32820,Zr=33635,Qr=34042,ar=36193,Nt={};Nt[Kt]=Nt[wr]=1,Nt[Gt]=Nt[kt]=Nt[ar]=Nt[Zr]=Nt[Br]=Nt[Ir]=2,Nt[hn]=Nt[jr]=Nt[Ft]=Nt[Qr]=4;function En(c,x){return c===Ir||c===Br||c===Zr?2:c===Qr?4:Nt[c]*x}function An(c){return!(c&c-1)&&!!c}function Jr(c,x,C){var ie,pe=x.width,re=x.height,ae=x.channels;d(pe>0&&pe<=C.maxTextureSize&&re>0&&re<=C.maxTextureSize,"invalid texture shape"),(c.wrapS!==$t||c.wrapT!==$t)&&d(An(pe)&&An(re),"incompatible wrap mode for texture, both width and height must be power of 2"),x.mipmask===1?pe!==1&&re!==1&&d(c.minFilter!==Qt&&c.minFilter!==xr&&c.minFilter!==sr&&c.minFilter!==or,"min filter requires mipmap"):(d(An(pe)&&An(re),"texture must be a square power of 2 to support mipmapping"),d(x.mipmask===(pe<<1)-1,"missing or incomplete mipmap data")),x.type===Ft&&(C.extensions.indexOf("oes_texture_float_linear")<0&&d(c.minFilter===Wt&&c.magFilter===Wt,"filter not supported, must enable oes_texture_float_linear"),d(!c.genMipmaps,"mipmap generation not supported with float textures"));var De=x.images;for(ie=0;ie<16;++ie)if(De[ie]){var Ae=pe>>ie,Be=re>>ie;d(x.mipmask&1<<ie,"missing mipmap data");var Ge=De[ie];if(d(Ge.width===Ae&&Ge.height===Be,"invalid shape for mip images"),d(Ge.format===x.format&&Ge.internalformat===x.internalformat&&Ge.type===x.type,"incompatible type for mip image"),!Ge.compressed)if(Ge.data){var Pe=Math.ceil(En(Ge.type,ae)*Ae/Ge.unpackAlignment)*Ge.unpackAlignment;d(Ge.data.byteLength===Pe*Be,"invalid data for image, buffer size is inconsistent with image format")}else Ge.element||Ge.copy}else c.genMipmaps||d((x.mipmask&1<<ie)===0,"extra mipmap data");x.compressed&&d(!c.genMipmaps,"mipmap generation for compressed images not supported")}function an(c,x,C,ie){var pe=c.width,re=c.height,ae=c.channels;d(pe>0&&pe<=ie.maxTextureSize&&re>0&&re<=ie.maxTextureSize,"invalid texture shape"),d(pe===re,"cube map must be square"),d(x.wrapS===$t&&x.wrapT===$t,"wrap mode not supported by cube map");for(var De=0;De<C.length;++De){var Ae=C[De];d(Ae.width===pe&&Ae.height===re,"inconsistent cube map face shape"),x.genMipmaps&&(d(!Ae.compressed,"can not generate mipmap for compressed textures"),d(Ae.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var Be=Ae.images,Ge=0;Ge<16;++Ge){var Pe=Be[Ge];if(Pe){var We=pe>>Ge,Oe=re>>Ge;d(Ae.mipmask&1<<Ge,"missing mipmap data"),d(Pe.width===We&&Pe.height===Oe,"invalid shape for mip images"),d(Pe.format===c.format&&Pe.internalformat===c.internalformat&&Pe.type===c.type,"incompatible type for mip image"),Pe.compressed||(Pe.data?d(Pe.data.byteLength===We*Oe*Math.max(En(Pe.type,ae),Pe.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):Pe.element||Pe.copy)}}}}var w=f(d,{optional:Ze,raise:u,commandRaise:Le,command:Ct,parameter:M,commandParameter:bt,constructor:se,type:F,commandType:Me,isTypedArray:k,nni:$,oneOf:S,shaderError:ct,linkError:nt,callSite:we,saveCommandRef:ft,saveDrawInfo:tt,framebufferFormat:St,guessCommand:_e,texture2D:Jr,textureCube:an}),li=0,dn=0,Gi=5,Bn=6;function Er(c,x){this.id=li++,this.type=c,this.data=x}function Dn(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Pn(c){if(c.length===0)return[];var x=c.charAt(0),C=c.charAt(c.length-1);if(c.length>1&&x===C&&(x==='"'||x==="'"))return['"'+Dn(c.substr(1,c.length-2))+'"'];var ie=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(c);if(ie)return Pn(c.substr(0,ie.index)).concat(Pn(ie[1])).concat(Pn(c.substr(ie.index+ie[0].length)));var pe=c.split(".");if(pe.length===1)return['"'+Dn(c)+'"'];for(var re=[],ae=0;ae<pe.length;++ae)re=re.concat(Pn(pe[ae]));return re}function A(c){return"["+Pn(c).join("][")+"]"}function Ue(c,x){return new Er(c,A(x+""))}function Xe(c){return typeof c=="function"&&!c._reglType||c instanceof Er}function dt(c,x){if(typeof c=="function")return new Er(dn,c);if(typeof c=="number"||typeof c=="boolean")return new Er(Gi,c);if(Array.isArray(c))return new Er(Bn,c.map(function(C,ie){return dt(C,x+"["+ie+"]")}));if(c instanceof Er)return c;w(!1,"invalid option type in uniform "+x)}var z={DynamicVariable:Er,define:Ue,isDynamic:Xe,unbox:dt,accessor:A},xe={next:typeof requestAnimationFrame=="function"?function(c){return requestAnimationFrame(c)}:function(c){return setTimeout(c,16)},cancel:typeof cancelAnimationFrame=="function"?function(c){return cancelAnimationFrame(c)}:clearTimeout},p=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function He(){var c={"":0},x=[""];return{id:function(C){var ie=c[C];return ie||(ie=c[C]=x.length,x.push(C),ie)},str:function(C){return x[C]}}}function Bt(c,x,C){var ie=document.createElement("canvas");f(ie.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),c.appendChild(ie),c===document.body&&(ie.style.position="absolute",f(c.style,{margin:0,padding:0}));function pe(){var De=window.innerWidth,Ae=window.innerHeight;if(c!==document.body){var Be=ie.getBoundingClientRect();De=Be.right-Be.left,Ae=Be.bottom-Be.top}ie.width=C*De,ie.height=C*Ae}var re;c!==document.body&&typeof ResizeObserver=="function"?(re=new ResizeObserver(function(){setTimeout(pe)}),re.observe(c)):window.addEventListener("resize",pe,!1);function ae(){re?re.disconnect():window.removeEventListener("resize",pe),c.removeChild(ie)}return pe(),{canvas:ie,onDestroy:ae}}function o(c,x){function C(ie){try{return c.getContext(ie,x)}catch{return null}}return C("webgl")||C("experimental-webgl")||C("webgl-experimental")}function ue(c){return typeof c.nodeName=="string"&&typeof c.appendChild=="function"&&typeof c.getBoundingClientRect=="function"}function ge(c){return typeof c.drawArrays=="function"||typeof c.drawElements=="function"}function y(c){return typeof c=="string"?c.split():(w(Array.isArray(c),"invalid extension array"),c)}function Y(c){return typeof c=="string"?(w(typeof document<"u","not supported outside of DOM"),document.querySelector(c)):c}function oe(c){var x=c||{},C,ie,pe,re,ae={},De=[],Ae=[],Be=typeof window>"u"?1:window.devicePixelRatio,Ge=!1,Pe=function(Fe){Fe&&w.raise(Fe)},We=function(){};if(typeof x=="string"?(w(typeof document<"u","selector queries only supported in DOM enviroments"),C=document.querySelector(x),w(C,"invalid query string for element")):typeof x=="object"?ue(x)?C=x:ge(x)?(re=x,pe=re.canvas):(w.constructor(x),"gl"in x?re=x.gl:"canvas"in x?pe=Y(x.canvas):"container"in x&&(ie=Y(x.container)),"attributes"in x&&(ae=x.attributes,w.type(ae,"object","invalid context attributes")),"extensions"in x&&(De=y(x.extensions)),"optionalExtensions"in x&&(Ae=y(x.optionalExtensions)),"onDone"in x&&(w.type(x.onDone,"function","invalid or missing onDone callback"),Pe=x.onDone),"profile"in x&&(Ge=!!x.profile),"pixelRatio"in x&&(Be=+x.pixelRatio,w(Be>0,"invalid pixel ratio"))):w.raise("invalid arguments to regl"),C&&(C.nodeName.toLowerCase()==="canvas"?pe=C:ie=C),!re){if(!pe){w(typeof document<"u","must manually specify webgl context outside of DOM environments");var Oe=Bt(ie||document.body,Pe,Be);if(!Oe)return null;pe=Oe.canvas,We=Oe.onDestroy}ae.premultipliedAlpha===void 0&&(ae.premultipliedAlpha=!0),re=o(pe,ae)}return re?{gl:re,canvas:pe,container:ie,extensions:De,optionalExtensions:Ae,pixelRatio:Be,profile:Ge,onDone:Pe,onDestroy:We}:(We(),Pe("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function At(c,x){var C={};function ie(ae){w.type(ae,"string","extension name must be string");var De=ae.toLowerCase(),Ae;try{Ae=C[De]=c.getExtension(De)}catch{}return!!Ae}for(var pe=0;pe<x.extensions.length;++pe){var re=x.extensions[pe];if(!ie(re))return x.onDestroy(),x.onDone('"'+re+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return x.optionalExtensions.forEach(ie),{extensions:C,restore:function(){Object.keys(C).forEach(function(ae){if(C[ae]&&!ie(ae))throw new Error("(regl): error restoring extension "+ae)})}}}function it(c,x){for(var C=Array(c),ie=0;ie<c;++ie)C[ie]=x(ie);return C}var mt=5120,lr=5121,ui=5122,Fr=5123,hr=5124,Yr=5125,vn=5126;function Ln(c){for(var x=16;x<=1<<28;x*=16)if(c<=x)return x;return 0}function Ra(c){var x,C;return x=(c>65535)<<4,c>>>=x,C=(c>255)<<3,c>>>=C,x|=C,C=(c>15)<<2,c>>>=C,x|=C,C=(c>3)<<1,c>>>=C,x|=C,x|c>>1}function Ca(){var c=it(8,function(){return[]});function x(re){var ae=Ln(re),De=c[Ra(ae)>>2];return De.length>0?De.pop():new ArrayBuffer(ae)}function C(re){c[Ra(re.byteLength)>>2].push(re)}function ie(re,ae){var De=null;switch(re){case mt:De=new Int8Array(x(ae),0,ae);break;case lr:De=new Uint8Array(x(ae),0,ae);break;case ui:De=new Int16Array(x(2*ae),0,ae);break;case Fr:De=new Uint16Array(x(2*ae),0,ae);break;case hr:De=new Int32Array(x(4*ae),0,ae);break;case Yr:De=new Uint32Array(x(4*ae),0,ae);break;case vn:De=new Float32Array(x(4*ae),0,ae);break;default:return null}return De.length!==ae?De.subarray(0,ae):De}function pe(re){C(re.buffer)}return{alloc:x,free:C,allocType:ie,freeType:pe}}var jt=Ca();jt.zero=Ca();var Hn=3408,fn=3410,ci=3411,$n=3412,Ws=3413,Ch=3414,Mh=3415,kh=33901,Ih=33902,Fh=3379,Vs=3386,Nh=34921,$s=36347,Bh=36348,Ph=35661,Gh=35660,Tu=34930,Eu=36349,Au=34076,Uh=34024,Yh=7936,Hh=7937,zh=7938,Du=35724,Lu=34047,Ou=36063,qo=34852,Zs=3553,Ko=34067,Xs=34069,Ru=33984,Qf=6408,qs=5126,jo=5121,Jf=36160,Wh=36053,Cu=36064,Qo=16384,Jo=function(c,x){var C=1;x.ext_texture_filter_anisotropic&&(C=c.getParameter(Lu));var ie=1,pe=1;x.webgl_draw_buffers&&(ie=c.getParameter(qo),pe=c.getParameter(Ou));var re=!!x.oes_texture_float;if(re){var ae=c.createTexture();c.bindTexture(Zs,ae),c.texImage2D(Zs,0,Qf,1,1,0,Qf,qs,null);var De=c.createFramebuffer();if(c.bindFramebuffer(Jf,De),c.framebufferTexture2D(Jf,Cu,Zs,ae,0),c.bindTexture(Zs,null),c.checkFramebufferStatus(Jf)!==Wh)re=!1;else{c.viewport(0,0,1,1),c.clearColor(1,0,0,1),c.clear(Qo);var Ae=jt.allocType(qs,4);c.readPixels(0,0,1,1,Qf,qs,Ae),c.getError()?re=!1:(c.deleteFramebuffer(De),c.deleteTexture(ae),re=Ae[0]===1),jt.freeType(Ae)}}var Be=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Ge=!0;if(!Be){var Pe=c.createTexture(),We=jt.allocType(jo,36);c.activeTexture(Ru),c.bindTexture(Ko,Pe),c.texImage2D(Xs,0,Qf,3,3,0,Qf,jo,We),jt.freeType(We),c.bindTexture(Ko,null),c.deleteTexture(Pe),Ge=!c.getError()}return{colorBits:[c.getParameter(fn),c.getParameter(ci),c.getParameter($n),c.getParameter(Ws)],depthBits:c.getParameter(Ch),stencilBits:c.getParameter(Mh),subpixelBits:c.getParameter(Hn),extensions:Object.keys(x).filter(function(Oe){return!!x[Oe]}),maxAnisotropic:C,maxDrawbuffers:ie,maxColorAttachments:pe,pointSizeDims:c.getParameter(kh),lineWidthDims:c.getParameter(Ih),maxViewportDims:c.getParameter(Vs),maxCombinedTextureUnits:c.getParameter(Ph),maxCubeMapSize:c.getParameter(Au),maxRenderbufferSize:c.getParameter(Uh),maxTextureUnits:c.getParameter(Tu),maxTextureSize:c.getParameter(Fh),maxAttributes:c.getParameter(Nh),maxVertexUniforms:c.getParameter($s),maxVertexTextureUnits:c.getParameter(Gh),maxVaryingVectors:c.getParameter(Bh),maxFragmentUniforms:c.getParameter(Eu),glsl:c.getParameter(Du),renderer:c.getParameter(Hh),vendor:c.getParameter(Yh),version:c.getParameter(zh),readFloat:re,npotTextureCube:Ge}};function On(c){return!!c&&typeof c=="object"&&Array.isArray(c.shape)&&Array.isArray(c.stride)&&typeof c.offset=="number"&&c.shape.length===c.stride.length&&(Array.isArray(c.data)||i(c.data))}var zn=function(c){return Object.keys(c).map(function(x){return c[x]})},es={shape:$h,flatten:ku};function Vh(c,x,C){for(var ie=0;ie<x;++ie)C[ie]=c[ie]}function Mu(c,x,C,ie){for(var pe=0,re=0;re<x;++re)for(var ae=c[re],De=0;De<C;++De)ie[pe++]=ae[De]}function el(c,x,C,ie,pe,re){for(var ae=re,De=0;De<x;++De)for(var Ae=c[De],Be=0;Be<C;++Be)for(var Ge=Ae[Be],Pe=0;Pe<ie;++Pe)pe[ae++]=Ge[Pe]}function tl(c,x,C,ie,pe){for(var re=1,ae=C+1;ae<x.length;++ae)re*=x[ae];var De=x[C];if(x.length-C===4){var Ae=x[C+1],Be=x[C+2],Ge=x[C+3];for(ae=0;ae<De;++ae)el(c[ae],Ae,Be,Ge,ie,pe),pe+=re}else for(ae=0;ae<De;++ae)tl(c[ae],x,C+1,ie,pe),pe+=re}function ku(c,x,C,ie){var pe=1;if(x.length)for(var re=0;re<x.length;++re)pe*=x[re];else pe=0;var ae=ie||jt.allocType(C,pe);switch(x.length){case 0:break;case 1:Vh(c,x[0],ae);break;case 2:Mu(c,x[0],x[1],ae);break;case 3:el(c,x[0],x[1],x[2],ae,0);break;default:tl(c,x,0,ae,0)}return ae}function $h(c){for(var x=[],C=c;C.length;C=C[0])x.push(C.length);return x}var rl={"[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},Zh=5120,Iu=5122,Xh=5124,qh=5121,Kh=5123,jh=5125,nl=5126,Qh=5126,Ma={int8:Zh,int16:Iu,int32:Xh,uint8:qh,uint16:Kh,uint32:jh,float:nl,float32:Qh},Jh=35048,ed=35040,Ks={dynamic:Jh,stream:ed,static:35044},Rr=es.flatten,Cr=es.shape,Fu=35044,td=35040,il=5121,al=5126,ia=[];ia[5120]=1,ia[5122]=2,ia[5124]=4,ia[5121]=1,ia[5123]=2,ia[5125]=4,ia[5126]=4;function js(c){return rl[Object.prototype.toString.call(c)]|0}function fl(c,x){for(var C=0;C<x.length;++C)c[C]=x[C]}function Nu(c,x,C,ie,pe,re,ae){for(var De=0,Ae=0;Ae<C;++Ae)for(var Be=0;Be<ie;++Be)c[De++]=x[pe*Ae+re*Be+ae]}function xn(c,x,C,ie){var pe=0,re={};function ae(V){this.id=pe++,this.buffer=c.createBuffer(),this.type=V,this.usage=Fu,this.byteLength=0,this.dimension=1,this.dtype=il,this.persistentData=null,C.profile&&(this.stats={size:0})}ae.prototype.bind=function(){c.bindBuffer(this.type,this.buffer)},ae.prototype.destroy=function(){We(this)};var De=[];function Ae(V,ne){var Re=De.pop();return Re||(Re=new ae(V)),Re.bind(),Pe(Re,ne,td,0,1,!1),Re}function Be(V){De.push(V)}function Ge(V,ne,Re){V.byteLength=ne.byteLength,c.bufferData(V.type,ne,Re)}function Pe(V,ne,Re,rt,Se,Qe){var je;if(V.usage=Re,Array.isArray(ne)){if(V.dtype=rt||al,ne.length>0){var pt;if(Array.isArray(ne[0])){je=Cr(ne);for(var ye=1,me=1;me<je.length;++me)ye*=je[me];V.dimension=ye,pt=Rr(ne,je,V.dtype),Ge(V,pt,Re),Qe?V.persistentData=pt:jt.freeType(pt)}else if(typeof ne[0]=="number"){V.dimension=Se;var ot=jt.allocType(V.dtype,ne.length);fl(ot,ne),Ge(V,ot,Re),Qe?V.persistentData=ot:jt.freeType(ot)}else i(ne[0])?(V.dimension=ne[0].length,V.dtype=rt||js(ne[0])||al,pt=Rr(ne,[ne.length,ne[0].length],V.dtype),Ge(V,pt,Re),Qe?V.persistentData=pt:jt.freeType(pt)):w.raise("invalid buffer data")}}else if(i(ne))V.dtype=rt||js(ne),V.dimension=Se,Ge(V,ne,Re),Qe&&(V.persistentData=new Uint8Array(new Uint8Array(ne.buffer)));else if(On(ne)){je=ne.shape;var Ve=ne.stride,ke=ne.offset,$e=0,qe=0,Mt=0,Lt=0;je.length===1?($e=je[0],qe=1,Mt=Ve[0],Lt=0):je.length===2?($e=je[0],qe=je[1],Mt=Ve[0],Lt=Ve[1]):w.raise("invalid shape"),V.dtype=rt||js(ne.data)||al,V.dimension=qe;var Ke=jt.allocType(V.dtype,$e*qe);Nu(Ke,ne.data,$e,qe,Mt,Lt,ke),Ge(V,Ke,Re),Qe?V.persistentData=Ke:jt.freeType(Ke)}else ne instanceof ArrayBuffer?(V.dtype=il,V.dimension=Se,Ge(V,ne,Re),Qe&&(V.persistentData=new Uint8Array(new Uint8Array(ne)))):w.raise("invalid buffer data")}function We(V){x.bufferCount--,ie(V);var ne=V.buffer;w(ne,"buffer must not be deleted already"),c.deleteBuffer(ne),V.buffer=null,delete re[V.id]}function Oe(V,ne,Re,rt){x.bufferCount++;var Se=new ae(ne);re[Se.id]=Se;function Qe(ye){var me=Fu,ot=null,Ve=0,ke=0,$e=1;return Array.isArray(ye)||i(ye)||On(ye)||ye instanceof ArrayBuffer?ot=ye:typeof ye=="number"?Ve=ye|0:ye&&(w.type(ye,"object","buffer arguments must be an object, a number or an array"),"data"in ye&&(w(ot===null||Array.isArray(ot)||i(ot)||On(ot),"invalid data for buffer"),ot=ye.data),"usage"in ye&&(w.parameter(ye.usage,Ks,"invalid buffer usage"),me=Ks[ye.usage]),"type"in ye&&(w.parameter(ye.type,Ma,"invalid buffer type"),ke=Ma[ye.type]),"dimension"in ye&&(w.type(ye.dimension,"number","invalid dimension"),$e=ye.dimension|0),"length"in ye&&(w.nni(Ve,"buffer length must be a nonnegative integer"),Ve=ye.length|0)),Se.bind(),ot?Pe(Se,ot,me,ke,$e,rt):(Ve&&c.bufferData(Se.type,Ve,me),Se.dtype=ke||il,Se.usage=me,Se.dimension=$e,Se.byteLength=Ve),C.profile&&(Se.stats.size=Se.byteLength*ia[Se.dtype]),Qe}function je(ye,me){w(me+ye.byteLength<=Se.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+ye.byteLength+" starting from offset "+me+" to a buffer of size "+Se.byteLength),c.bufferSubData(Se.type,me,ye)}function pt(ye,me){var ot=(me||0)|0,Ve;if(Se.bind(),i(ye)||ye instanceof ArrayBuffer)je(ye,ot);else if(Array.isArray(ye)){if(ye.length>0)if(typeof ye[0]=="number"){var ke=jt.allocType(Se.dtype,ye.length);fl(ke,ye),je(ke,ot),jt.freeType(ke)}else if(Array.isArray(ye[0])||i(ye[0])){Ve=Cr(ye);var $e=Rr(ye,Ve,Se.dtype);je($e,ot),jt.freeType($e)}else w.raise("invalid buffer data")}else if(On(ye)){Ve=ye.shape;var qe=ye.stride,Mt=0,Lt=0,Ke=0,Je=0;Ve.length===1?(Mt=Ve[0],Lt=1,Ke=qe[0],Je=0):Ve.length===2?(Mt=Ve[0],Lt=Ve[1],Ke=qe[0],Je=qe[1]):w.raise("invalid shape");var wt=Array.isArray(ye.data)?Se.dtype:js(ye.data),Rt=jt.allocType(wt,Mt*Lt);Nu(Rt,ye.data,Mt,Lt,Ke,Je,ye.offset),je(Rt,ot),jt.freeType(Rt)}else w.raise("invalid data for buffer subdata");return Qe}return Re||Qe(V),Qe._reglType="buffer",Qe._buffer=Se,Qe.subdata=pt,C.profile&&(Qe.stats=Se.stats),Qe.destroy=function(){We(Se)},Qe}function Fe(){zn(re).forEach(function(V){V.buffer=c.createBuffer(),c.bindBuffer(V.type,V.buffer),c.bufferData(V.type,V.persistentData||V.byteLength,V.usage)})}return C.profile&&(x.getTotalBufferSize=function(){var V=0;return Object.keys(re).forEach(function(ne){V+=re[ne].stats.size}),V}),{create:Oe,createStream:Ae,destroyStream:Be,clear:function(){zn(re).forEach(We),De.forEach(We)},getBuffer:function(V){return V&&V._buffer instanceof ae?V._buffer:null},restore:Fe,_initBuffer:Pe}}var sl=0,ka=0,Bu=1,ol=1,Jn=4,Pu=4,Ui={points:sl,point:ka,lines:Bu,line:ol,triangles:Jn,triangle:Pu,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Gu=0,Uu=1,yf=4,Yu=5120,_n=5121,Hu=5122,wn=5123,zu=5124,aa=5125,Di=34963,Qs=35040,ll=35044;function Pr(c,x,C,ie){var pe={},re=0,ae={uint8:_n,uint16:wn};x.oes_element_index_uint&&(ae.uint32=aa);function De(Fe){this.id=re++,pe[this.id]=this,this.buffer=Fe,this.primType=yf,this.vertCount=0,this.type=0}De.prototype.bind=function(){this.buffer.bind()};var Ae=[];function Be(Fe){var V=Ae.pop();return V||(V=new De(C.create(null,Di,!0,!1)._buffer)),Pe(V,Fe,Qs,-1,-1,0,0),V}function Ge(Fe){Ae.push(Fe)}function Pe(Fe,V,ne,Re,rt,Se,Qe){Fe.buffer.bind();var je;if(V){var pt=Qe;!Qe&&(!i(V)||On(V)&&!i(V.data))&&(pt=x.oes_element_index_uint?aa:wn),C._initBuffer(Fe.buffer,V,ne,pt,3)}else c.bufferData(Di,Se,ne),Fe.buffer.dtype=je||_n,Fe.buffer.usage=ne,Fe.buffer.dimension=3,Fe.buffer.byteLength=Se;if(je=Qe,!Qe){switch(Fe.buffer.dtype){case _n:case Yu:je=_n;break;case wn:case Hu:je=wn;break;case aa:case zu:je=aa;break;default:w.raise("unsupported type for element array")}Fe.buffer.dtype=je}Fe.type=je,w(je!==aa||!!x.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var ye=rt;ye<0&&(ye=Fe.buffer.byteLength,je===wn?ye>>=1:je===aa&&(ye>>=2)),Fe.vertCount=ye;var me=Re;if(Re<0){me=yf;var ot=Fe.buffer.dimension;ot===1&&(me=Gu),ot===2&&(me=Uu),ot===3&&(me=yf)}Fe.primType=me}function We(Fe){ie.elementsCount--,w(Fe.buffer!==null,"must not double destroy elements"),delete pe[Fe.id],Fe.buffer.destroy(),Fe.buffer=null}function Oe(Fe,V){var ne=C.create(null,Di,!0),Re=new De(ne._buffer);ie.elementsCount++;function rt(Se){if(!Se)ne(),Re.primType=yf,Re.vertCount=0,Re.type=_n;else if(typeof Se=="number")ne(Se),Re.primType=yf,Re.vertCount=Se|0,Re.type=_n;else{var Qe=null,je=ll,pt=-1,ye=-1,me=0,ot=0;Array.isArray(Se)||i(Se)||On(Se)?Qe=Se:(w.type(Se,"object","invalid arguments for elements"),"data"in Se&&(Qe=Se.data,w(Array.isArray(Qe)||i(Qe)||On(Qe),"invalid data for element buffer")),"usage"in Se&&(w.parameter(Se.usage,Ks,"invalid element buffer usage"),je=Ks[Se.usage]),"primitive"in Se&&(w.parameter(Se.primitive,Ui,"invalid element buffer primitive"),pt=Ui[Se.primitive]),"count"in Se&&(w(typeof Se.count=="number"&&Se.count>=0,"invalid vertex count for elements"),ye=Se.count|0),"type"in Se&&(w.parameter(Se.type,ae,"invalid buffer type"),ot=ae[Se.type]),"length"in Se?me=Se.length|0:(me=ye,ot===wn||ot===Hu?me*=2:(ot===aa||ot===zu)&&(me*=4))),Pe(Re,Qe,je,pt,ye,me,ot)}return rt}return rt(Fe),rt._reglType="elements",rt._elements=Re,rt.subdata=function(Se,Qe){return ne.subdata(Se,Qe),rt},rt.destroy=function(){We(Re)},rt}return{create:Oe,createStream:Be,destroyStream:Ge,getElements:function(Fe){return typeof Fe=="function"&&Fe._elements instanceof De?Fe._elements:null},clear:function(){zn(pe).forEach(We)}}}var Yi=new Float32Array(1),ul=new Uint32Array(Yi.buffer),rd=5123;function Js(c){for(var x=jt.allocType(rd,c.length),C=0;C<c.length;++C)if(isNaN(c[C]))x[C]=65535;else if(c[C]===1/0)x[C]=31744;else if(c[C]===-1/0)x[C]=64512;else{Yi[0]=c[C];var ie=ul[0],pe=ie>>>31<<15,re=(ie<<1>>>24)-127,ae=ie>>13&(1<<10)-1;if(re<-24)x[C]=pe;else if(re<-14){var De=-14-re;x[C]=pe+(ae+(1<<10)>>De)}else re>15?x[C]=pe+31744:x[C]=pe+(re+15<<10)+ae}return x}function Nr(c){return Array.isArray(c)||i(c)}var Wu=function(c){return!(c&c-1)&&!!c},nd=34467,hi=3553,bf=34067,Hi=34069,Ia=6408,eo=6406,ts=6407,Fa=6409,xf=6410,cl=32854,hl=32855,to=36194,dl=32819,id=32820,Vu=33635,Zn=34042,rs=6402,fa=34041,ro=35904,no=35906,wf=36193,vl=33776,_l=33777,pl=33778,ml=33779,Na=35986,$u=35987,Zu=34798,io=35840,gl=35841,zi=35842,ns=35843,Xu=36196,Sf=5121,yl=5123,sa=5125,Gn=5126,qu=10242,ad=10243,fd=10497,bl=33071,sd=33648,od=10240,Tf=10241,K=9728,Ee=9729,he=9984,gt=9985,Zt=9986,mr=9987,sn=33170,Ar=4352,xl=4353,ld=4354,ei=34046,ao=3317,ud=37440,Ef=37441,fo=37443,is=37444,gr=33984,cd=[he,Zt,gt,mr],as=[0,Fa,xf,ts,Ia],Un={};Un[Fa]=Un[eo]=Un[rs]=1,Un[fa]=Un[xf]=2,Un[ts]=Un[ro]=3,Un[Ia]=Un[no]=4;function Af(c){return"[object "+c+"]"}var Ku=Af("HTMLCanvasElement"),ju=Af("OffscreenCanvas"),fs=Af("CanvasRenderingContext2D"),Wi=Af("ImageBitmap"),ss=Af("HTMLImageElement"),wl=Af("HTMLVideoElement"),so=Object.keys(rl).concat([Ku,ju,fs,Wi,ss,wl]),Ba=[];Ba[Sf]=1,Ba[Gn]=4,Ba[wf]=2,Ba[yl]=2,Ba[sa]=4;var on=[];on[cl]=2,on[hl]=2,on[to]=2,on[fa]=4,on[vl]=.5,on[_l]=.5,on[pl]=1,on[ml]=1,on[Na]=.5,on[$u]=1,on[Zu]=1,on[io]=.5,on[gl]=.25,on[zi]=.5,on[ns]=.25,on[Xu]=.5;function os(c){return Array.isArray(c)&&(c.length===0||typeof c[0]=="number")}function Sl(c){if(!Array.isArray(c))return!1;var x=c.length;return!(x===0||!Nr(c[0]))}function di(c){return Object.prototype.toString.call(c)}function oa(c){return di(c)===Ku}function ls(c){return di(c)===ju}function hd(c){return di(c)===fs}function dd(c){return di(c)===Wi}function vd(c){return di(c)===ss}function oo(c){return di(c)===wl}function Df(c){if(!c)return!1;var x=di(c);return so.indexOf(x)>=0?!0:os(c)||Sl(c)||On(c)}function lo(c){return rl[Object.prototype.toString.call(c)]|0}function _d(c,x){var C=x.length;switch(c.type){case Sf:case yl:case sa:case Gn:var ie=jt.allocType(c.type,C);ie.set(x),c.data=ie;break;case wf:c.data=Js(x);break;default:w.raise("unsupported texture type, must specify a typed array")}}function Tl(c,x){return jt.allocType(c.type===wf?Gn:c.type,x)}function Qu(c,x){c.type===wf?(c.data=Js(x),jt.freeType(x)):c.data=x}function pd(c,x,C,ie,pe,re){for(var ae=c.width,De=c.height,Ae=c.channels,Be=ae*De*Ae,Ge=Tl(c,Be),Pe=0,We=0;We<De;++We)for(var Oe=0;Oe<ae;++Oe)for(var Fe=0;Fe<Ae;++Fe)Ge[Pe++]=x[C*Oe+ie*We+pe*Fe+re];Qu(c,Ge)}function Xr(c,x,C,ie,pe,re){var ae;if(typeof on[c]<"u"?ae=on[c]:ae=Un[c]*Ba[x],re&&(ae*=6),pe){for(var De=0,Ae=C;Ae>=1;)De+=ae*Ae*Ae,Ae/=2;return De}else return ae*C*ie}function Rn(c,x,C,ie,pe,re,ae){var De={"don't care":Ar,"dont care":Ar,nice:ld,fast:xl},Ae={repeat:fd,clamp:bl,mirror:sd},Be={nearest:K,linear:Ee},Ge=f({mipmap:mr,"nearest mipmap nearest":he,"linear mipmap nearest":gt,"nearest mipmap linear":Zt,"linear mipmap linear":mr},Be),Pe={none:0,browser:is},We={uint8:Sf,rgba4:dl,rgb565:Vu,"rgb5 a1":id},Oe={alpha:eo,luminance:Fa,"luminance alpha":xf,rgb:ts,rgba:Ia,rgba4:cl,"rgb5 a1":hl,rgb565:to},Fe={};x.ext_srgb&&(Oe.srgb=ro,Oe.srgba=no),x.oes_texture_float&&(We.float32=We.float=Gn),x.oes_texture_half_float&&(We.float16=We["half float"]=wf),x.webgl_depth_texture&&(f(Oe,{depth:rs,"depth stencil":fa}),f(We,{uint16:yl,uint32:sa,"depth stencil":Zn})),x.webgl_compressed_texture_s3tc&&f(Fe,{"rgb s3tc dxt1":vl,"rgba s3tc dxt1":_l,"rgba s3tc dxt3":pl,"rgba s3tc dxt5":ml}),x.webgl_compressed_texture_atc&&f(Fe,{"rgb atc":Na,"rgba atc explicit alpha":$u,"rgba atc interpolated alpha":Zu}),x.webgl_compressed_texture_pvrtc&&f(Fe,{"rgb pvrtc 4bppv1":io,"rgb pvrtc 2bppv1":gl,"rgba pvrtc 4bppv1":zi,"rgba pvrtc 2bppv1":ns}),x.webgl_compressed_texture_etc1&&(Fe["rgb etc1"]=Xu);var V=Array.prototype.slice.call(c.getParameter(nd));Object.keys(Fe).forEach(function(O){var fe=Fe[O];V.indexOf(fe)>=0&&(Oe[O]=fe)});var ne=Object.keys(Oe);C.textureFormats=ne;var Re=[];Object.keys(Oe).forEach(function(O){var fe=Oe[O];Re[fe]=O});var rt=[];Object.keys(We).forEach(function(O){var fe=We[O];rt[fe]=O});var Se=[];Object.keys(Be).forEach(function(O){var fe=Be[O];Se[fe]=O});var Qe=[];Object.keys(Ge).forEach(function(O){var fe=Ge[O];Qe[fe]=O});var je=[];Object.keys(Ae).forEach(function(O){var fe=Ae[O];je[fe]=O});var pt=ne.reduce(function(O,fe){var Q=Oe[fe];return Q===Fa||Q===eo||Q===Fa||Q===xf||Q===rs||Q===fa||x.ext_srgb&&(Q===ro||Q===no)?O[Q]=Q:Q===hl||fe.indexOf("rgba")>=0?O[Q]=Ia:O[Q]=ts,O},{});function ye(){this.internalformat=Ia,this.format=Ia,this.type=Sf,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=is,this.width=0,this.height=0,this.channels=0}function me(O,fe){O.internalformat=fe.internalformat,O.format=fe.format,O.type=fe.type,O.compressed=fe.compressed,O.premultiplyAlpha=fe.premultiplyAlpha,O.flipY=fe.flipY,O.unpackAlignment=fe.unpackAlignment,O.colorSpace=fe.colorSpace,O.width=fe.width,O.height=fe.height,O.channels=fe.channels}function ot(O,fe){if(!(typeof fe!="object"||!fe)){if("premultiplyAlpha"in fe&&(w.type(fe.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),O.premultiplyAlpha=fe.premultiplyAlpha),"flipY"in fe&&(w.type(fe.flipY,"boolean","invalid texture flip"),O.flipY=fe.flipY),"alignment"in fe&&(w.oneOf(fe.alignment,[1,2,4,8],"invalid texture unpack alignment"),O.unpackAlignment=fe.alignment),"colorSpace"in fe&&(w.parameter(fe.colorSpace,Pe,"invalid colorSpace"),O.colorSpace=Pe[fe.colorSpace]),"type"in fe){var Q=fe.type;w(x.oes_texture_float||!(Q==="float"||Q==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),w(x.oes_texture_half_float||!(Q==="half float"||Q==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),w(x.webgl_depth_texture||!(Q==="uint16"||Q==="uint32"||Q==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),w.parameter(Q,We,"invalid texture type"),O.type=We[Q]}var st=O.width,zt=O.height,E=O.channels,m=!1;"shape"in fe?(w(Array.isArray(fe.shape)&&fe.shape.length>=2,"shape must be an array"),st=fe.shape[0],zt=fe.shape[1],fe.shape.length===3&&(E=fe.shape[2],w(E>0&&E<=4,"invalid number of channels"),m=!0),w(st>=0&&st<=C.maxTextureSize,"invalid width"),w(zt>=0&&zt<=C.maxTextureSize,"invalid height")):("radius"in fe&&(st=zt=fe.radius,w(st>=0&&st<=C.maxTextureSize,"invalid radius")),"width"in fe&&(st=fe.width,w(st>=0&&st<=C.maxTextureSize,"invalid width")),"height"in fe&&(zt=fe.height,w(zt>=0&&zt<=C.maxTextureSize,"invalid height")),"channels"in fe&&(E=fe.channels,w(E>0&&E<=4,"invalid number of channels"),m=!0)),O.width=st|0,O.height=zt|0,O.channels=E|0;var B=!1;if("format"in fe){var Z=fe.format;w(x.webgl_depth_texture||!(Z==="depth"||Z==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),w.parameter(Z,Oe,"invalid texture format");var X=O.internalformat=Oe[Z];O.format=pt[X],Z in We&&("type"in fe||(O.type=We[Z])),Z in Fe&&(O.compressed=!0),B=!0}!m&&B?O.channels=Un[O.format]:m&&!B?O.channels!==as[O.format]&&(O.format=O.internalformat=as[O.channels]):B&&m&&w(O.channels===Un[O.format],"number of channels inconsistent with specified format")}}function Ve(O){c.pixelStorei(ud,O.flipY),c.pixelStorei(Ef,O.premultiplyAlpha),c.pixelStorei(fo,O.colorSpace),c.pixelStorei(ao,O.unpackAlignment)}function ke(){ye.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function $e(O,fe){var Q=null;if(Df(fe)?Q=fe:fe&&(w.type(fe,"object","invalid pixel data type"),ot(O,fe),"x"in fe&&(O.xOffset=fe.x|0),"y"in fe&&(O.yOffset=fe.y|0),Df(fe.data)&&(Q=fe.data)),w(!O.compressed||Q instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),fe.copy){w(!Q,"can not specify copy and data field for the same texture");var st=pe.viewportWidth,zt=pe.viewportHeight;O.width=O.width||st-O.xOffset,O.height=O.height||zt-O.yOffset,O.needsCopy=!0,w(O.xOffset>=0&&O.xOffset<st&&O.yOffset>=0&&O.yOffset<zt&&O.width>0&&O.width<=st&&O.height>0&&O.height<=zt,"copy texture read out of bounds")}else if(!Q)O.width=O.width||1,O.height=O.height||1,O.channels=O.channels||4;else if(i(Q))O.channels=O.channels||4,O.data=Q,!("type"in fe)&&O.type===Sf&&(O.type=lo(Q));else if(os(Q))O.channels=O.channels||4,_d(O,Q),O.alignment=1,O.needsFree=!0;else if(On(Q)){var E=Q.data;!Array.isArray(E)&&O.type===Sf&&(O.type=lo(E));var m=Q.shape,B=Q.stride,Z,X,G,N,W,D;m.length===3?(G=m[2],D=B[2]):(w(m.length===2,"invalid ndarray pixel data, must be 2 or 3D"),G=1,D=1),Z=m[0],X=m[1],N=B[0],W=B[1],O.alignment=1,O.width=Z,O.height=X,O.channels=G,O.format=O.internalformat=as[G],O.needsFree=!0,pd(O,E,N,W,D,Q.offset)}else if(oa(Q)||ls(Q)||hd(Q))oa(Q)||ls(Q)?O.element=Q:O.element=Q.canvas,O.width=O.element.width,O.height=O.element.height,O.channels=4;else if(dd(Q))O.element=Q,O.width=Q.width,O.height=Q.height,O.channels=4;else if(vd(Q))O.element=Q,O.width=Q.naturalWidth,O.height=Q.naturalHeight,O.channels=4;else if(oo(Q))O.element=Q,O.width=Q.videoWidth,O.height=Q.videoHeight,O.channels=4;else if(Sl(Q)){var R=O.width||Q[0].length,L=O.height||Q.length,j=O.channels;Nr(Q[0][0])?j=j||Q[0][0].length:j=j||1;for(var q=es.shape(Q),ve=1,be=0;be<q.length;++be)ve*=q[be];var Ye=Tl(O,ve);es.flatten(Q,q,"",Ye),Qu(O,Ye),O.alignment=1,O.width=R,O.height=L,O.channels=j,O.format=O.internalformat=as[j],O.needsFree=!0}O.type===Gn?w(C.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):O.type===wf&&w(C.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function qe(O,fe,Q){var st=O.element,zt=O.data,E=O.internalformat,m=O.format,B=O.type,Z=O.width,X=O.height;Ve(O),st?c.texImage2D(fe,Q,m,m,B,st):O.compressed?c.compressedTexImage2D(fe,Q,E,Z,X,0,zt):O.needsCopy?(ie(),c.copyTexImage2D(fe,Q,m,O.xOffset,O.yOffset,Z,X,0)):c.texImage2D(fe,Q,m,Z,X,0,m,B,zt||null)}function Mt(O,fe,Q,st,zt){var E=O.element,m=O.data,B=O.internalformat,Z=O.format,X=O.type,G=O.width,N=O.height;Ve(O),E?c.texSubImage2D(fe,zt,Q,st,Z,X,E):O.compressed?c.compressedTexSubImage2D(fe,zt,Q,st,B,G,N,m):O.needsCopy?(ie(),c.copyTexSubImage2D(fe,zt,Q,st,O.xOffset,O.yOffset,G,N)):c.texSubImage2D(fe,zt,Q,st,G,N,Z,X,m)}var Lt=[];function Ke(){return Lt.pop()||new ke}function Je(O){O.needsFree&&jt.freeType(O.data),ke.call(O),Lt.push(O)}function wt(){ye.call(this),this.genMipmaps=!1,this.mipmapHint=Ar,this.mipmask=0,this.images=Array(16)}function Rt(O,fe,Q){var st=O.images[0]=Ke();O.mipmask=1,st.width=O.width=fe,st.height=O.height=Q,st.channels=O.channels=4}function Vt(O,fe){var Q=null;if(Df(fe))Q=O.images[0]=Ke(),me(Q,O),$e(Q,fe),O.mipmask=1;else if(ot(O,fe),Array.isArray(fe.mipmap))for(var st=fe.mipmap,zt=0;zt<st.length;++zt)Q=O.images[zt]=Ke(),me(Q,O),Q.width>>=zt,Q.height>>=zt,$e(Q,st[zt]),O.mipmask|=1<<zt;else Q=O.images[0]=Ke(),me(Q,O),$e(Q,fe),O.mipmask=1;me(O,O.images[0]),O.compressed&&(O.internalformat===vl||O.internalformat===_l||O.internalformat===pl||O.internalformat===ml)&&w(O.width%4===0&&O.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function Mr(O,fe){for(var Q=O.images,st=0;st<Q.length;++st){if(!Q[st])return;qe(Q[st],fe,st)}}var Lr=[];function Xt(){var O=Lr.pop()||new wt;ye.call(O),O.mipmask=0;for(var fe=0;fe<16;++fe)O.images[fe]=null;return O}function Dr(O){for(var fe=O.images,Q=0;Q<fe.length;++Q)fe[Q]&&Je(fe[Q]),fe[Q]=null;Lr.push(O)}function pr(){this.minFilter=K,this.magFilter=K,this.wrapS=bl,this.wrapT=bl,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Ar}function qr(O,fe){if("min"in fe){var Q=fe.min;w.parameter(Q,Ge),O.minFilter=Ge[Q],cd.indexOf(O.minFilter)>=0&&!("faces"in fe)&&(O.genMipmaps=!0)}if("mag"in fe){var st=fe.mag;w.parameter(st,Be),O.magFilter=Be[st]}var zt=O.wrapS,E=O.wrapT;if("wrap"in fe){var m=fe.wrap;typeof m=="string"?(w.parameter(m,Ae),zt=E=Ae[m]):Array.isArray(m)&&(w.parameter(m[0],Ae),w.parameter(m[1],Ae),zt=Ae[m[0]],E=Ae[m[1]])}else{if("wrapS"in fe){var B=fe.wrapS;w.parameter(B,Ae),zt=Ae[B]}if("wrapT"in fe){var Z=fe.wrapT;w.parameter(Z,Ae),E=Ae[Z]}}if(O.wrapS=zt,O.wrapT=E,"anisotropic"in fe){var X=fe.anisotropic;w(typeof X=="number"&&X>=1&&X<=C.maxAnisotropic,"aniso samples must be between 1 and "),O.anisotropic=fe.anisotropic}if("mipmap"in fe){var G=!1;switch(typeof fe.mipmap){case"string":w.parameter(fe.mipmap,De,"invalid mipmap hint"),O.mipmapHint=De[fe.mipmap],O.genMipmaps=!0,G=!0;break;case"boolean":G=O.genMipmaps=fe.mipmap;break;case"object":w(Array.isArray(fe.mipmap),"invalid mipmap type"),O.genMipmaps=!1,G=!0;break;default:w.raise("invalid mipmap type")}G&&!("min"in fe)&&(O.minFilter=he)}}function Kr(O,fe){c.texParameteri(fe,Tf,O.minFilter),c.texParameteri(fe,od,O.magFilter),c.texParameteri(fe,qu,O.wrapS),c.texParameteri(fe,ad,O.wrapT),x.ext_texture_filter_anisotropic&&c.texParameteri(fe,ei,O.anisotropic),O.genMipmaps&&(c.hint(sn,O.mipmapHint),c.generateMipmap(fe))}var en=0,ln={},mn=C.maxTextureUnits,Wr=Array(mn).map(function(){return null});function Ut(O){ye.call(this),this.mipmask=0,this.internalformat=Ia,this.id=en++,this.refCount=1,this.target=O,this.texture=c.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new pr,ae.profile&&(this.stats={size:0})}function gn(O){c.activeTexture(gr),c.bindTexture(O.target,O.texture)}function cr(){var O=Wr[0];O?c.bindTexture(O.target,O.texture):c.bindTexture(hi,null)}function Tt(O){var fe=O.texture;w(fe,"must not double destroy texture");var Q=O.unit,st=O.target;Q>=0&&(c.activeTexture(gr+Q),c.bindTexture(st,null),Wr[Q]=null),c.deleteTexture(fe),O.texture=null,O.params=null,O.pixels=null,O.refCount=0,delete ln[O.id],re.textureCount--}f(Ut.prototype,{bind:function(){var O=this;O.bindCount+=1;var fe=O.unit;if(fe<0){for(var Q=0;Q<mn;++Q){var st=Wr[Q];if(st){if(st.bindCount>0)continue;st.unit=-1}Wr[Q]=O,fe=Q;break}fe>=mn&&w.raise("insufficient number of texture units"),ae.profile&&re.maxTextureUnits<fe+1&&(re.maxTextureUnits=fe+1),O.unit=fe,c.activeTexture(gr+fe),c.bindTexture(O.target,O.texture)}return fe},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Tt(this)}});function qt(O,fe){var Q=new Ut(hi);ln[Q.id]=Q,re.textureCount++;function st(m,B){var Z=Q.texInfo;pr.call(Z);var X=Xt();return typeof m=="number"?typeof B=="number"?Rt(X,m|0,B|0):Rt(X,m|0,m|0):m?(w.type(m,"object","invalid arguments to regl.texture"),qr(Z,m),Vt(X,m)):Rt(X,1,1),Z.genMipmaps&&(X.mipmask=(X.width<<1)-1),Q.mipmask=X.mipmask,me(Q,X),w.texture2D(Z,X,C),Q.internalformat=X.internalformat,st.width=X.width,st.height=X.height,gn(Q),Mr(X,hi),Kr(Z,hi),cr(),Dr(X),ae.profile&&(Q.stats.size=Xr(Q.internalformat,Q.type,X.width,X.height,Z.genMipmaps,!1)),st.format=Re[Q.internalformat],st.type=rt[Q.type],st.mag=Se[Z.magFilter],st.min=Qe[Z.minFilter],st.wrapS=je[Z.wrapS],st.wrapT=je[Z.wrapT],st}function zt(m,B,Z,X){w(!!m,"must specify image data");var G=B|0,N=Z|0,W=X|0,D=Ke();return me(D,Q),D.width=0,D.height=0,$e(D,m),D.width=D.width||(Q.width>>W)-G,D.height=D.height||(Q.height>>W)-N,w(Q.type===D.type&&Q.format===D.format&&Q.internalformat===D.internalformat,"incompatible format for texture.subimage"),w(G>=0&&N>=0&&G+D.width<=Q.width&&N+D.height<=Q.height,"texture.subimage write out of bounds"),w(Q.mipmask&1<<W,"missing mipmap data"),w(D.data||D.element||D.needsCopy,"missing image data"),gn(Q),Mt(D,hi,G,N,W),cr(),Je(D),st}function E(m,B){var Z=m|0,X=B|0||Z;if(Z===Q.width&&X===Q.height)return st;st.width=Q.width=Z,st.height=Q.height=X,gn(Q);for(var G=0;Q.mipmask>>G;++G){var N=Z>>G,W=X>>G;if(!N||!W)break;c.texImage2D(hi,G,Q.format,N,W,0,Q.format,Q.type,null)}return cr(),ae.profile&&(Q.stats.size=Xr(Q.internalformat,Q.type,Z,X,!1,!1)),st}return st(O,fe),st.subimage=zt,st.resize=E,st._reglType="texture2d",st._texture=Q,ae.profile&&(st.stats=Q.stats),st.destroy=function(){Q.decRef()},st}function er(O,fe,Q,st,zt,E){var m=new Ut(bf);ln[m.id]=m,re.cubeCount++;var B=new Array(6);function Z(N,W,D,R,L,j){var q,ve=m.texInfo;for(pr.call(ve),q=0;q<6;++q)B[q]=Xt();if(typeof N=="number"||!N){var be=N|0||1;for(q=0;q<6;++q)Rt(B[q],be,be)}else if(typeof N=="object")if(W)Vt(B[0],N),Vt(B[1],W),Vt(B[2],D),Vt(B[3],R),Vt(B[4],L),Vt(B[5],j);else if(qr(ve,N),ot(m,N),"faces"in N){var Ye=N.faces;for(w(Array.isArray(Ye)&&Ye.length===6,"cube faces must be a length 6 array"),q=0;q<6;++q)w(typeof Ye[q]=="object"&&!!Ye[q],"invalid input for cube map face"),me(B[q],m),Vt(B[q],Ye[q])}else for(q=0;q<6;++q)Vt(B[q],N);else w.raise("invalid arguments to cube map");for(me(m,B[0]),w.optional(function(){C.npotTextureCube||w(Wu(m.width)&&Wu(m.height),"your browser does not support non power or two texture dimensions")}),ve.genMipmaps?m.mipmask=(B[0].width<<1)-1:m.mipmask=B[0].mipmask,w.textureCube(m,ve,B,C),m.internalformat=B[0].internalformat,Z.width=B[0].width,Z.height=B[0].height,gn(m),q=0;q<6;++q)Mr(B[q],Hi+q);for(Kr(ve,bf),cr(),ae.profile&&(m.stats.size=Xr(m.internalformat,m.type,Z.width,Z.height,ve.genMipmaps,!0)),Z.format=Re[m.internalformat],Z.type=rt[m.type],Z.mag=Se[ve.magFilter],Z.min=Qe[ve.minFilter],Z.wrapS=je[ve.wrapS],Z.wrapT=je[ve.wrapT],q=0;q<6;++q)Dr(B[q]);return Z}function X(N,W,D,R,L){w(!!W,"must specify image data"),w(typeof N=="number"&&N===(N|0)&&N>=0&&N<6,"invalid face");var j=D|0,q=R|0,ve=L|0,be=Ke();return me(be,m),be.width=0,be.height=0,$e(be,W),be.width=be.width||(m.width>>ve)-j,be.height=be.height||(m.height>>ve)-q,w(m.type===be.type&&m.format===be.format&&m.internalformat===be.internalformat,"incompatible format for texture.subimage"),w(j>=0&&q>=0&&j+be.width<=m.width&&q+be.height<=m.height,"texture.subimage write out of bounds"),w(m.mipmask&1<<ve,"missing mipmap data"),w(be.data||be.element||be.needsCopy,"missing image data"),gn(m),Mt(be,Hi+N,j,q,ve),cr(),Je(be),Z}function G(N){var W=N|0;if(W!==m.width){Z.width=m.width=W,Z.height=m.height=W,gn(m);for(var D=0;D<6;++D)for(var R=0;m.mipmask>>R;++R)c.texImage2D(Hi+D,R,m.format,W>>R,W>>R,0,m.format,m.type,null);return cr(),ae.profile&&(m.stats.size=Xr(m.internalformat,m.type,Z.width,Z.height,!1,!0)),Z}}return Z(O,fe,Q,st,zt,E),Z.subimage=X,Z.resize=G,Z._reglType="textureCube",Z._texture=m,ae.profile&&(Z.stats=m.stats),Z.destroy=function(){m.decRef()},Z}function Vr(){for(var O=0;O<mn;++O)c.activeTexture(gr+O),c.bindTexture(hi,null),Wr[O]=null;zn(ln).forEach(Tt),re.cubeCount=0,re.textureCount=0}ae.profile&&(re.getTotalTextureSize=function(){var O=0;return Object.keys(ln).forEach(function(fe){O+=ln[fe].stats.size}),O});function yi(){for(var O=0;O<mn;++O){var fe=Wr[O];fe&&(fe.bindCount=0,fe.unit=-1,Wr[O]=null)}zn(ln).forEach(function(Q){Q.texture=c.createTexture(),c.bindTexture(Q.target,Q.texture);for(var st=0;st<32;++st)if((Q.mipmask&1<<st)!==0)if(Q.target===hi)c.texImage2D(hi,st,Q.internalformat,Q.width>>st,Q.height>>st,0,Q.internalformat,Q.type,null);else for(var zt=0;zt<6;++zt)c.texImage2D(Hi+zt,st,Q.internalformat,Q.width>>st,Q.height>>st,0,Q.internalformat,Q.type,null);Kr(Q.texInfo,Q.target)})}function ya(){for(var O=0;O<mn;++O){var fe=Wr[O];fe&&(fe.bindCount=0,fe.unit=-1,Wr[O]=null),c.activeTexture(gr+O),c.bindTexture(hi,null),c.bindTexture(bf,null)}}return{create2D:qt,createCube:er,clear:Vr,getTexture:function(O){return null},restore:yi,refresh:ya}}var la=36161,uo=32854,El=32855,Ju=36194,co=33189,Lf=36168,ho=34041,Pa=35907,Of=34836,Rf=34842,us=34843,Cn=[];Cn[uo]=2,Cn[El]=2,Cn[Ju]=2,Cn[co]=2,Cn[Lf]=1,Cn[ho]=4,Cn[Pa]=4,Cn[Of]=16,Cn[Rf]=8,Cn[us]=6;function ec(c,x,C){return Cn[c]*x*C}var md=function(c,x,C,ie,pe){var re={rgba4:uo,rgb565:Ju,"rgb5 a1":El,depth:co,stencil:Lf,"depth stencil":ho};x.ext_srgb&&(re.srgba=Pa),x.ext_color_buffer_half_float&&(re.rgba16f=Rf,re.rgb16f=us),x.webgl_color_buffer_float&&(re.rgba32f=Of);var ae=[];Object.keys(re).forEach(function(Oe){var Fe=re[Oe];ae[Fe]=Oe});var De=0,Ae={};function Be(Oe){this.id=De++,this.refCount=1,this.renderbuffer=Oe,this.format=uo,this.width=0,this.height=0,pe.profile&&(this.stats={size:0})}Be.prototype.decRef=function(){--this.refCount<=0&&Ge(this)};function Ge(Oe){var Fe=Oe.renderbuffer;w(Fe,"must not double destroy renderbuffer"),c.bindRenderbuffer(la,null),c.deleteRenderbuffer(Fe),Oe.renderbuffer=null,Oe.refCount=0,delete Ae[Oe.id],ie.renderbufferCount--}function Pe(Oe,Fe){var V=new Be(c.createRenderbuffer());Ae[V.id]=V,ie.renderbufferCount++;function ne(rt,Se){var Qe=0,je=0,pt=uo;if(typeof rt=="object"&&rt){var ye=rt;if("shape"in ye){var me=ye.shape;w(Array.isArray(me)&&me.length>=2,"invalid renderbuffer shape"),Qe=me[0]|0,je=me[1]|0}else"radius"in ye&&(Qe=je=ye.radius|0),"width"in ye&&(Qe=ye.width|0),"height"in ye&&(je=ye.height|0);"format"in ye&&(w.parameter(ye.format,re,"invalid renderbuffer format"),pt=re[ye.format])}else typeof rt=="number"?(Qe=rt|0,typeof Se=="number"?je=Se|0:je=Qe):rt?w.raise("invalid arguments to renderbuffer constructor"):Qe=je=1;if(w(Qe>0&&je>0&&Qe<=C.maxRenderbufferSize&&je<=C.maxRenderbufferSize,"invalid renderbuffer size"),!(Qe===V.width&&je===V.height&&pt===V.format))return ne.width=V.width=Qe,ne.height=V.height=je,V.format=pt,c.bindRenderbuffer(la,V.renderbuffer),c.renderbufferStorage(la,pt,Qe,je),w(c.getError()===0,"invalid render buffer format"),pe.profile&&(V.stats.size=ec(V.format,V.width,V.height)),ne.format=ae[V.format],ne}function Re(rt,Se){var Qe=rt|0,je=Se|0||Qe;return Qe===V.width&&je===V.height||(w(Qe>0&&je>0&&Qe<=C.maxRenderbufferSize&&je<=C.maxRenderbufferSize,"invalid renderbuffer size"),ne.width=V.width=Qe,ne.height=V.height=je,c.bindRenderbuffer(la,V.renderbuffer),c.renderbufferStorage(la,V.format,Qe,je),w(c.getError()===0,"invalid render buffer format"),pe.profile&&(V.stats.size=ec(V.format,V.width,V.height))),ne}return ne(Oe,Fe),ne.resize=Re,ne._reglType="renderbuffer",ne._renderbuffer=V,pe.profile&&(ne.stats=V.stats),ne.destroy=function(){V.decRef()},ne}pe.profile&&(ie.getTotalRenderbufferSize=function(){var Oe=0;return Object.keys(Ae).forEach(function(Fe){Oe+=Ae[Fe].stats.size}),Oe});function We(){zn(Ae).forEach(function(Oe){Oe.renderbuffer=c.createRenderbuffer(),c.bindRenderbuffer(la,Oe.renderbuffer),c.renderbufferStorage(la,Oe.format,Oe.width,Oe.height)}),c.bindRenderbuffer(la,null)}return{create:Pe,clear:function(){zn(Ae).forEach(Ge)},restore:We}},Vi=36160,Al=36161,Ga=3553,Ua=34069,Cf=36064,Dl=36096,b=36128,Ya=33306,cs=36053,ti=36054,ur=36055,gd=36057,yd=36061,bd=36193,Ha=5121,xd=5126,tc=6407,rc=6408,wd=6402,Sd=[tc,rc],vi=[];vi[rc]=4,vi[tc]=3;var vo=[];vo[Ha]=1,vo[xd]=4,vo[bd]=2;var Td=32854,Ed=32855,Ad=36194,Dd=33189,$i=36168,nc=34041,Ld=35907,Od=34836,Rd=34842,Cd=34843,za=[Td,Ed,Ad,Ld,Rd,Cd,Od],Mf={};Mf[cs]="complete",Mf[ti]="incomplete attachment",Mf[gd]="incomplete dimensions",Mf[ur]="incomplete, missing attachment",Mf[yd]="unsupported";function Md(c,x,C,ie,pe,re){var ae={cur:null,next:null,dirty:!1,setFBO:null},De=["rgba"],Ae=["rgba4","rgb565","rgb5 a1"];x.ext_srgb&&Ae.push("srgba"),x.ext_color_buffer_half_float&&Ae.push("rgba16f","rgb16f"),x.webgl_color_buffer_float&&Ae.push("rgba32f");var Be=["uint8"];x.oes_texture_half_float&&Be.push("half float","float16"),x.oes_texture_float&&Be.push("float","float32");function Ge(ke,$e,qe){this.target=ke,this.texture=$e,this.renderbuffer=qe;var Mt=0,Lt=0;$e?(Mt=$e.width,Lt=$e.height):qe&&(Mt=qe.width,Lt=qe.height),this.width=Mt,this.height=Lt}function Pe(ke){ke&&(ke.texture&&ke.texture._texture.decRef(),ke.renderbuffer&&ke.renderbuffer._renderbuffer.decRef())}function We(ke,$e,qe){if(!!ke)if(ke.texture){var Mt=ke.texture._texture,Lt=Math.max(1,Mt.width),Ke=Math.max(1,Mt.height);w(Lt===$e&&Ke===qe,"inconsistent width/height for supplied texture"),Mt.refCount+=1}else{var Je=ke.renderbuffer._renderbuffer;w(Je.width===$e&&Je.height===qe,"inconsistent width/height for renderbuffer"),Je.refCount+=1}}function Oe(ke,$e){$e&&($e.texture?c.framebufferTexture2D(Vi,ke,$e.target,$e.texture._texture.texture,0):c.framebufferRenderbuffer(Vi,ke,Al,$e.renderbuffer._renderbuffer.renderbuffer))}function Fe(ke){var $e=Ga,qe=null,Mt=null,Lt=ke;typeof ke=="object"&&(Lt=ke.data,"target"in ke&&($e=ke.target|0)),w.type(Lt,"function","invalid attachment data");var Ke=Lt._reglType;return Ke==="texture2d"?(qe=Lt,w($e===Ga)):Ke==="textureCube"?(qe=Lt,w($e>=Ua&&$e<Ua+6,"invalid cube map target")):Ke==="renderbuffer"?(Mt=Lt,$e=Al):w.raise("invalid regl object for attachment"),new Ge($e,qe,Mt)}function V(ke,$e,qe,Mt,Lt){if(qe){var Ke=ie.create2D({width:ke,height:$e,format:Mt,type:Lt});return Ke._texture.refCount=0,new Ge(Ga,Ke,null)}else{var Je=pe.create({width:ke,height:$e,format:Mt});return Je._renderbuffer.refCount=0,new Ge(Al,null,Je)}}function ne(ke){return ke&&(ke.texture||ke.renderbuffer)}function Re(ke,$e,qe){ke&&(ke.texture?ke.texture.resize($e,qe):ke.renderbuffer&&ke.renderbuffer.resize($e,qe),ke.width=$e,ke.height=qe)}var rt=0,Se={};function Qe(){this.id=rt++,Se[this.id]=this,this.framebuffer=c.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function je(ke){ke.colorAttachments.forEach(Pe),Pe(ke.depthAttachment),Pe(ke.stencilAttachment),Pe(ke.depthStencilAttachment)}function pt(ke){var $e=ke.framebuffer;w($e,"must not double destroy framebuffer"),c.deleteFramebuffer($e),ke.framebuffer=null,re.framebufferCount--,delete Se[ke.id]}function ye(ke){var $e;c.bindFramebuffer(Vi,ke.framebuffer);var qe=ke.colorAttachments;for($e=0;$e<qe.length;++$e)Oe(Cf+$e,qe[$e]);for($e=qe.length;$e<C.maxColorAttachments;++$e)c.framebufferTexture2D(Vi,Cf+$e,Ga,null,0);c.framebufferTexture2D(Vi,Ya,Ga,null,0),c.framebufferTexture2D(Vi,Dl,Ga,null,0),c.framebufferTexture2D(Vi,b,Ga,null,0),Oe(Dl,ke.depthAttachment),Oe(b,ke.stencilAttachment),Oe(Ya,ke.depthStencilAttachment);var Mt=c.checkFramebufferStatus(Vi);!c.isContextLost()&&Mt!==cs&&w.raise("framebuffer configuration not supported, status = "+Mf[Mt]),c.bindFramebuffer(Vi,ae.next?ae.next.framebuffer:null),ae.cur=ae.next,c.getError()}function me(ke,$e){var qe=new Qe;re.framebufferCount++;function Mt(Ke,Je){var wt;w(ae.next!==qe,"can not update framebuffer which is currently in use");var Rt=0,Vt=0,Mr=!0,Lr=!0,Xt=null,Dr=!0,pr="rgba",qr="uint8",Kr=1,en=null,ln=null,mn=null,Wr=!1;if(typeof Ke=="number")Rt=Ke|0,Vt=Je|0||Rt;else if(!Ke)Rt=Vt=1;else{w.type(Ke,"object","invalid arguments for framebuffer");var Ut=Ke;if("shape"in Ut){var gn=Ut.shape;w(Array.isArray(gn)&&gn.length>=2,"invalid shape for framebuffer"),Rt=gn[0],Vt=gn[1]}else"radius"in Ut&&(Rt=Vt=Ut.radius),"width"in Ut&&(Rt=Ut.width),"height"in Ut&&(Vt=Ut.height);("color"in Ut||"colors"in Ut)&&(Xt=Ut.color||Ut.colors,Array.isArray(Xt)&&w(Xt.length===1||x.webgl_draw_buffers,"multiple render targets not supported")),Xt||("colorCount"in Ut&&(Kr=Ut.colorCount|0,w(Kr>0,"invalid color buffer count")),"colorTexture"in Ut&&(Dr=!!Ut.colorTexture,pr="rgba4"),"colorType"in Ut&&(qr=Ut.colorType,Dr?(w(x.oes_texture_float||!(qr==="float"||qr==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),w(x.oes_texture_half_float||!(qr==="half float"||qr==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):qr==="half float"||qr==="float16"?(w(x.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),pr="rgba16f"):(qr==="float"||qr==="float32")&&(w(x.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),pr="rgba32f"),w.oneOf(qr,Be,"invalid color type")),"colorFormat"in Ut&&(pr=Ut.colorFormat,De.indexOf(pr)>=0?Dr=!0:Ae.indexOf(pr)>=0?Dr=!1:w.optional(function(){Dr?w.oneOf(Ut.colorFormat,De,"invalid color format for texture"):w.oneOf(Ut.colorFormat,Ae,"invalid color format for renderbuffer")}))),("depthTexture"in Ut||"depthStencilTexture"in Ut)&&(Wr=!!(Ut.depthTexture||Ut.depthStencilTexture),w(!Wr||x.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Ut&&(typeof Ut.depth=="boolean"?Mr=Ut.depth:(en=Ut.depth,Lr=!1)),"stencil"in Ut&&(typeof Ut.stencil=="boolean"?Lr=Ut.stencil:(ln=Ut.stencil,Mr=!1)),"depthStencil"in Ut&&(typeof Ut.depthStencil=="boolean"?Mr=Lr=Ut.depthStencil:(mn=Ut.depthStencil,Mr=!1,Lr=!1))}var cr=null,Tt=null,qt=null,er=null;if(Array.isArray(Xt))cr=Xt.map(Fe);else if(Xt)cr=[Fe(Xt)];else for(cr=new Array(Kr),wt=0;wt<Kr;++wt)cr[wt]=V(Rt,Vt,Dr,pr,qr);w(x.webgl_draw_buffers||cr.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),w(cr.length<=C.maxColorAttachments,"too many color attachments, not supported"),Rt=Rt||cr[0].width,Vt=Vt||cr[0].height,en?Tt=Fe(en):Mr&&!Lr&&(Tt=V(Rt,Vt,Wr,"depth","uint32")),ln?qt=Fe(ln):Lr&&!Mr&&(qt=V(Rt,Vt,!1,"stencil","uint8")),mn?er=Fe(mn):!en&&!ln&&Lr&&Mr&&(er=V(Rt,Vt,Wr,"depth stencil","depth stencil")),w(!!en+!!ln+!!mn<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var Vr=null;for(wt=0;wt<cr.length;++wt)if(We(cr[wt],Rt,Vt),w(!cr[wt]||cr[wt].texture&&Sd.indexOf(cr[wt].texture._texture.format)>=0||cr[wt].renderbuffer&&za.indexOf(cr[wt].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+wt+" is invalid"),cr[wt]&&cr[wt].texture){var yi=vi[cr[wt].texture._texture.format]*vo[cr[wt].texture._texture.type];Vr===null?Vr=yi:w(Vr===yi,"all color attachments much have the same number of bits per pixel.")}return We(Tt,Rt,Vt),w(!Tt||Tt.texture&&Tt.texture._texture.format===wd||Tt.renderbuffer&&Tt.renderbuffer._renderbuffer.format===Dd,"invalid depth attachment for framebuffer object"),We(qt,Rt,Vt),w(!qt||qt.renderbuffer&&qt.renderbuffer._renderbuffer.format===$i,"invalid stencil attachment for framebuffer object"),We(er,Rt,Vt),w(!er||er.texture&&er.texture._texture.format===nc||er.renderbuffer&&er.renderbuffer._renderbuffer.format===nc,"invalid depth-stencil attachment for framebuffer object"),je(qe),qe.width=Rt,qe.height=Vt,qe.colorAttachments=cr,qe.depthAttachment=Tt,qe.stencilAttachment=qt,qe.depthStencilAttachment=er,Mt.color=cr.map(ne),Mt.depth=ne(Tt),Mt.stencil=ne(qt),Mt.depthStencil=ne(er),Mt.width=qe.width,Mt.height=qe.height,ye(qe),Mt}function Lt(Ke,Je){w(ae.next!==qe,"can not resize a framebuffer which is currently in use");var wt=Math.max(Ke|0,1),Rt=Math.max(Je|0||wt,1);if(wt===qe.width&&Rt===qe.height)return Mt;for(var Vt=qe.colorAttachments,Mr=0;Mr<Vt.length;++Mr)Re(Vt[Mr],wt,Rt);return Re(qe.depthAttachment,wt,Rt),Re(qe.stencilAttachment,wt,Rt),Re(qe.depthStencilAttachment,wt,Rt),qe.width=Mt.width=wt,qe.height=Mt.height=Rt,ye(qe),Mt}return Mt(ke,$e),f(Mt,{resize:Lt,_reglType:"framebuffer",_framebuffer:qe,destroy:function(){pt(qe),je(qe)},use:function(Ke){ae.setFBO({framebuffer:Mt},Ke)}})}function ot(ke){var $e=Array(6);function qe(Lt){var Ke;w($e.indexOf(ae.next)<0,"can not update framebuffer which is currently in use");var Je={color:null},wt=0,Rt=null,Vt="rgba",Mr="uint8",Lr=1;if(typeof Lt=="number")wt=Lt|0;else if(!Lt)wt=1;else{w.type(Lt,"object","invalid arguments for framebuffer");var Xt=Lt;if("shape"in Xt){var Dr=Xt.shape;w(Array.isArray(Dr)&&Dr.length>=2,"invalid shape for framebuffer"),w(Dr[0]===Dr[1],"cube framebuffer must be square"),wt=Dr[0]}else"radius"in Xt&&(wt=Xt.radius|0),"width"in Xt?(wt=Xt.width|0,"height"in Xt&&w(Xt.height===wt,"must be square")):"height"in Xt&&(wt=Xt.height|0);("color"in Xt||"colors"in Xt)&&(Rt=Xt.color||Xt.colors,Array.isArray(Rt)&&w(Rt.length===1||x.webgl_draw_buffers,"multiple render targets not supported")),Rt||("colorCount"in Xt&&(Lr=Xt.colorCount|0,w(Lr>0,"invalid color buffer count")),"colorType"in Xt&&(w.oneOf(Xt.colorType,Be,"invalid color type"),Mr=Xt.colorType),"colorFormat"in Xt&&(Vt=Xt.colorFormat,w.oneOf(Xt.colorFormat,De,"invalid color format for texture"))),"depth"in Xt&&(Je.depth=Xt.depth),"stencil"in Xt&&(Je.stencil=Xt.stencil),"depthStencil"in Xt&&(Je.depthStencil=Xt.depthStencil)}var pr;if(Rt)if(Array.isArray(Rt))for(pr=[],Ke=0;Ke<Rt.length;++Ke)pr[Ke]=Rt[Ke];else pr=[Rt];else{pr=Array(Lr);var qr={radius:wt,format:Vt,type:Mr};for(Ke=0;Ke<Lr;++Ke)pr[Ke]=ie.createCube(qr)}for(Je.color=Array(pr.length),Ke=0;Ke<pr.length;++Ke){var Kr=pr[Ke];w(typeof Kr=="function"&&Kr._reglType==="textureCube","invalid cube map"),wt=wt||Kr.width,w(Kr.width===wt&&Kr.height===wt,"invalid cube map shape"),Je.color[Ke]={target:Ua,data:pr[Ke]}}for(Ke=0;Ke<6;++Ke){for(var en=0;en<pr.length;++en)Je.color[en].target=Ua+Ke;Ke>0&&(Je.depth=$e[0].depth,Je.stencil=$e[0].stencil,Je.depthStencil=$e[0].depthStencil),$e[Ke]?$e[Ke](Je):$e[Ke]=me(Je)}return f(qe,{width:wt,height:wt,color:pr})}function Mt(Lt){var Ke,Je=Lt|0;if(w(Je>0&&Je<=C.maxCubeMapSize,"invalid radius for cube fbo"),Je===qe.width)return qe;var wt=qe.color;for(Ke=0;Ke<wt.length;++Ke)wt[Ke].resize(Je);for(Ke=0;Ke<6;++Ke)$e[Ke].resize(Je);return qe.width=qe.height=Je,qe}return qe(ke),f(qe,{faces:$e,resize:Mt,_reglType:"framebufferCube",destroy:function(){$e.forEach(function(Lt){Lt.destroy()})}})}function Ve(){ae.cur=null,ae.next=null,ae.dirty=!0,zn(Se).forEach(function(ke){ke.framebuffer=c.createFramebuffer(),ye(ke)})}return f(ae,{getFramebuffer:function(ke){if(typeof ke=="function"&&ke._reglType==="framebuffer"){var $e=ke._framebuffer;if($e instanceof Qe)return $e}return null},create:me,createCube:ot,clear:function(){zn(Se).forEach(pt)},restore:Ve})}var _i=5126,ic=34962,_o=34963,ac=["attributes","elements","offset","count","primitive","instances"];function Ll(){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=_i,this.offset=0,this.stride=0,this.divisor=0}function kd(c,x,C,ie,pe,re,ae){for(var De=C.maxAttributes,Ae=new Array(De),Be=0;Be<De;++Be)Ae[Be]=new Ll;var Ge=0,Pe={},We={Record:Ll,scope:{},state:Ae,currentVAO:null,targetVAO:null,restore:Fe()?je:function(){},createVAO:pt,getVAO:ne,destroyBuffer:Oe,setVAO:Fe()?Re:rt,clear:Fe()?Se:function(){}};function Oe(ye){for(var me=0;me<Ae.length;++me){var ot=Ae[me];ot.buffer===ye&&(c.disableVertexAttribArray(me),ot.buffer=null)}}function Fe(){return x.oes_vertex_array_object}function V(){return x.angle_instanced_arrays}function ne(ye){return typeof ye=="function"&&ye._vao?ye._vao:null}function Re(ye){if(ye!==We.currentVAO){var me=Fe();ye?me.bindVertexArrayOES(ye.vao):me.bindVertexArrayOES(null),We.currentVAO=ye}}function rt(ye){if(ye!==We.currentVAO){if(ye)ye.bindAttrs();else{for(var me=V(),ot=0;ot<Ae.length;++ot){var Ve=Ae[ot];Ve.buffer?(c.enableVertexAttribArray(ot),Ve.buffer.bind(),c.vertexAttribPointer(ot,Ve.size,Ve.type,Ve.normalized,Ve.stride,Ve.offfset),me&&Ve.divisor&&me.vertexAttribDivisorANGLE(ot,Ve.divisor)):(c.disableVertexAttribArray(ot),c.vertexAttrib4f(ot,Ve.x,Ve.y,Ve.z,Ve.w))}ae.elements?c.bindBuffer(_o,ae.elements.buffer.buffer):c.bindBuffer(_o,null)}We.currentVAO=ye}}function Se(){zn(Pe).forEach(function(ye){ye.destroy()})}function Qe(){this.id=++Ge,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var ye=Fe();ye?this.vao=ye.createVertexArrayOES():this.vao=null,Pe[this.id]=this,this.buffers=[]}Qe.prototype.bindAttrs=function(){for(var ye=V(),me=this.attributes,ot=0;ot<me.length;++ot){var Ve=me[ot];Ve.buffer?(c.enableVertexAttribArray(ot),c.bindBuffer(ic,Ve.buffer.buffer),c.vertexAttribPointer(ot,Ve.size,Ve.type,Ve.normalized,Ve.stride,Ve.offset),ye&&Ve.divisor&&ye.vertexAttribDivisorANGLE(ot,Ve.divisor)):(c.disableVertexAttribArray(ot),c.vertexAttrib4f(ot,Ve.x,Ve.y,Ve.z,Ve.w))}for(var ke=me.length;ke<De;++ke)c.disableVertexAttribArray(ke);var $e=re.getElements(this.elements);$e?c.bindBuffer(_o,$e.buffer.buffer):c.bindBuffer(_o,null)},Qe.prototype.refresh=function(){var ye=Fe();ye&&(ye.bindVertexArrayOES(this.vao),this.bindAttrs(),We.currentVAO=null,ye.bindVertexArrayOES(null))},Qe.prototype.destroy=function(){if(this.vao){var ye=Fe();this===We.currentVAO&&(We.currentVAO=null,ye.bindVertexArrayOES(null)),ye.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),Pe[this.id]&&(delete Pe[this.id],ie.vaoCount-=1)};function je(){var ye=Fe();ye&&zn(Pe).forEach(function(me){me.refresh()})}function pt(ye){var me=new Qe;ie.vaoCount+=1;function ot(Ve){var ke;if(Array.isArray(Ve))ke=Ve,me.elements&&me.ownsElements&&me.elements.destroy(),me.elements=null,me.ownsElements=!1,me.offset=0,me.count=0,me.instances=-1,me.primitive=4;else{if(w(typeof Ve=="object","invalid arguments for create vao"),w("attributes"in Ve,"must specify attributes for vao"),Ve.elements){var $e=Ve.elements;me.ownsElements?typeof $e=="function"&&$e._reglType==="elements"?(me.elements.destroy(),me.ownsElements=!1):(me.elements($e),me.ownsElements=!1):re.getElements(Ve.elements)?(me.elements=Ve.elements,me.ownsElements=!1):(me.elements=re.create(Ve.elements),me.ownsElements=!0)}else me.elements=null,me.ownsElements=!1;ke=Ve.attributes,me.offset=0,me.count=-1,me.instances=-1,me.primitive=4,me.elements&&(me.count=me.elements._elements.vertCount,me.primitive=me.elements._elements.primType),"offset"in Ve&&(me.offset=Ve.offset|0),"count"in Ve&&(me.count=Ve.count|0),"instances"in Ve&&(me.instances=Ve.instances|0),"primitive"in Ve&&(w(Ve.primitive in Ui,"bad primitive type: "+Ve.primitive),me.primitive=Ui[Ve.primitive]),w.optional(()=>{for(var Mr=Object.keys(Ve),Lr=0;Lr<Mr.length;++Lr)w(ac.indexOf(Mr[Lr])>=0,'invalid option for vao: "'+Mr[Lr]+'" valid options are '+ac)}),w(Array.isArray(ke),"attributes must be an array")}w(ke.length<De,"too many attributes"),w(ke.length>0,"must specify at least one attribute");var qe={},Mt=me.attributes;Mt.length=ke.length;for(var Lt=0;Lt<ke.length;++Lt){var Ke=ke[Lt],Je=Mt[Lt]=new Ll,wt=Ke.data||Ke;if(Array.isArray(wt)||i(wt)||On(wt)){var Rt;me.buffers[Lt]&&(Rt=me.buffers[Lt],i(wt)&&Rt._buffer.byteLength>=wt.byteLength?Rt.subdata(wt):(Rt.destroy(),me.buffers[Lt]=null)),me.buffers[Lt]||(Rt=me.buffers[Lt]=pe.create(Ke,ic,!1,!0)),Je.buffer=pe.getBuffer(Rt),Je.size=Je.buffer.dimension|0,Je.normalized=!1,Je.type=Je.buffer.dtype,Je.offset=0,Je.stride=0,Je.divisor=0,Je.state=1,qe[Lt]=1}else pe.getBuffer(Ke)?(Je.buffer=pe.getBuffer(Ke),Je.size=Je.buffer.dimension|0,Je.normalized=!1,Je.type=Je.buffer.dtype,Je.offset=0,Je.stride=0,Je.divisor=0,Je.state=1):pe.getBuffer(Ke.buffer)?(Je.buffer=pe.getBuffer(Ke.buffer),Je.size=(+Ke.size||Je.buffer.dimension)|0,Je.normalized=!!Ke.normalized||!1,"type"in Ke?(w.parameter(Ke.type,Ma,"invalid buffer type"),Je.type=Ma[Ke.type]):Je.type=Je.buffer.dtype,Je.offset=(Ke.offset||0)|0,Je.stride=(Ke.stride||0)|0,Je.divisor=(Ke.divisor||0)|0,Je.state=1,w(Je.size>=1&&Je.size<=4,"size must be between 1 and 4"),w(Je.offset>=0,"invalid offset"),w(Je.stride>=0&&Je.stride<=255,"stride must be between 0 and 255"),w(Je.divisor>=0,"divisor must be positive"),w(!Je.divisor||!!x.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Ke?(w(Lt>0,"first attribute must not be a constant"),Je.x=+Ke.x||0,Je.y=+Ke.y||0,Je.z=+Ke.z||0,Je.w=+Ke.w||0,Je.state=2):w(!1,"invalid attribute spec for location "+Lt)}for(var Vt=0;Vt<me.buffers.length;++Vt)!qe[Vt]&&me.buffers[Vt]&&(me.buffers[Vt].destroy(),me.buffers[Vt]=null);return me.refresh(),ot}return ot.destroy=function(){for(var Ve=0;Ve<me.buffers.length;++Ve)me.buffers[Ve]&&me.buffers[Ve].destroy();me.buffers.length=0,me.ownsElements&&(me.elements.destroy(),me.elements=null,me.ownsElements=!1),me.destroy()},ot._vao=me,ot._reglType="vao",ot(ye)}return We}var Ol=35632,fc=35633,Id=35718,Fd=35721;function Rl(c,x,C,ie){var pe={},re={};function ae(V,ne,Re,rt){this.name=V,this.id=ne,this.location=Re,this.info=rt}function De(V,ne){for(var Re=0;Re<V.length;++Re)if(V[Re].id===ne.id){V[Re].location=ne.location;return}V.push(ne)}function Ae(V,ne,Re){var rt=V===Ol?pe:re,Se=rt[ne];if(!Se){var Qe=x.str(ne);Se=c.createShader(V),c.shaderSource(Se,Qe),c.compileShader(Se),w.shaderError(c,Se,Qe,V,Re),rt[ne]=Se}return Se}var Be={},Ge=[],Pe=0;function We(V,ne){this.id=Pe++,this.fragId=V,this.vertId=ne,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,ie.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function Oe(V,ne,Re){var rt,Se,Qe=Ae(Ol,V.fragId),je=Ae(fc,V.vertId),pt=V.program=c.createProgram();if(c.attachShader(pt,Qe),c.attachShader(pt,je),Re)for(rt=0;rt<Re.length;++rt){var ye=Re[rt];c.bindAttribLocation(pt,ye[0],ye[1])}c.linkProgram(pt),w.linkError(c,pt,x.str(V.fragId),x.str(V.vertId),ne);var me=c.getProgramParameter(pt,Id);ie.profile&&(V.stats.uniformsCount=me);var ot=V.uniforms;for(rt=0;rt<me;++rt)if(Se=c.getActiveUniform(pt,rt),Se){if(Se.size>1)for(var Ve=0;Ve<Se.size;++Ve){var ke=Se.name.replace("[0]","["+Ve+"]");De(ot,new ae(ke,x.id(ke),c.getUniformLocation(pt,ke),Se))}var $e=Se.name;Se.size>1&&($e=$e.replace("[0]","")),De(ot,new ae($e,x.id($e),c.getUniformLocation(pt,$e),Se))}var qe=c.getProgramParameter(pt,Fd);ie.profile&&(V.stats.attributesCount=qe);var Mt=V.attributes;for(rt=0;rt<qe;++rt)Se=c.getActiveAttrib(pt,rt),Se&&De(Mt,new ae(Se.name,x.id(Se.name),c.getAttribLocation(pt,Se.name),Se))}ie.profile&&(C.getMaxUniformsCount=function(){var V=0;return Ge.forEach(function(ne){ne.stats.uniformsCount>V&&(V=ne.stats.uniformsCount)}),V},C.getMaxAttributesCount=function(){var V=0;return Ge.forEach(function(ne){ne.stats.attributesCount>V&&(V=ne.stats.attributesCount)}),V});function Fe(){pe={},re={};for(var V=0;V<Ge.length;++V)Oe(Ge[V],null,Ge[V].attributes.map(function(ne){return[ne.location,ne.name]}))}return{clear:function(){var V=c.deleteShader.bind(c);zn(pe).forEach(V),pe={},zn(re).forEach(V),re={},Ge.forEach(function(ne){c.deleteProgram(ne.program)}),Ge.length=0,Be={},C.shaderCount=0},program:function(V,ne,Re,rt){w.command(V>=0,"missing vertex shader",Re),w.command(ne>=0,"missing fragment shader",Re);var Se=Be[ne];Se||(Se=Be[ne]={});var Qe=Se[V];if(Qe&&(Qe.refCount++,!rt))return Qe;var je=new We(ne,V);return C.shaderCount++,Oe(je,Re,rt),Qe||(Se[V]=je),Ge.push(je),f(je,{destroy:function(){if(je.refCount--,je.refCount<=0){c.deleteProgram(je.program);var pt=Ge.indexOf(je);Ge.splice(pt,1),C.shaderCount--}Se[je.vertId].refCount<=0&&(c.deleteShader(re[je.vertId]),delete re[je.vertId],delete Be[je.fragId][je.vertId]),Object.keys(Be[je.fragId]).length||(c.deleteShader(pe[je.fragId]),delete pe[je.fragId],delete Be[je.fragId])}})},restore:Fe,shader:Ae,frag:-1,vert:-1}}var hs=6408,ua=5121,Nd=3333,ds=5126;function Bd(c,x,C,ie,pe,re,ae){function De(Ge){var Pe;x.next===null?(w(pe.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),Pe=ua):(w(x.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),Pe=x.next.colorAttachments[0].texture._texture.type,w.optional(function(){re.oes_texture_float?(w(Pe===ua||Pe===ds,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),Pe===ds&&w(ae.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):w(Pe===ua,"Reading from a framebuffer is only allowed for the type 'uint8'")}));var We=0,Oe=0,Fe=ie.framebufferWidth,V=ie.framebufferHeight,ne=null;i(Ge)?ne=Ge:Ge&&(w.type(Ge,"object","invalid arguments to regl.read()"),We=Ge.x|0,Oe=Ge.y|0,w(We>=0&&We<ie.framebufferWidth,"invalid x offset for regl.read"),w(Oe>=0&&Oe<ie.framebufferHeight,"invalid y offset for regl.read"),Fe=(Ge.width||ie.framebufferWidth-We)|0,V=(Ge.height||ie.framebufferHeight-Oe)|0,ne=Ge.data||null),ne&&(Pe===ua?w(ne instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):Pe===ds&&w(ne instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),w(Fe>0&&Fe+We<=ie.framebufferWidth,"invalid width for read pixels"),w(V>0&&V+Oe<=ie.framebufferHeight,"invalid height for read pixels"),C();var Re=Fe*V*4;return ne||(Pe===ua?ne=new Uint8Array(Re):Pe===ds&&(ne=ne||new Float32Array(Re))),w.isTypedArray(ne,"data buffer for regl.read() must be a typedarray"),w(ne.byteLength>=Re,"data buffer for regl.read() too small"),c.pixelStorei(Nd,4),c.readPixels(We,Oe,Fe,V,hs,Pe,ne),ne}function Ae(Ge){var Pe;return x.setFBO({framebuffer:Ge.framebuffer},function(){Pe=De(Ge)}),Pe}function Be(Ge){return!Ge||!("framebuffer"in Ge)?De(Ge):Ae(Ge)}return Be}function Wn(c){return Array.prototype.slice.call(c)}function ca(c){return Wn(c).join("")}function Wa(){var c=0,x=[],C=[];function ie(Pe){for(var We=0;We<C.length;++We)if(C[We]===Pe)return x[We];var Oe="g"+c++;return x.push(Oe),C.push(Pe),Oe}function pe(){var Pe=[];function We(){Pe.push.apply(Pe,Wn(arguments))}var Oe=[];function Fe(){var V="v"+c++;return Oe.push(V),arguments.length>0&&(Pe.push(V,"="),Pe.push.apply(Pe,Wn(arguments)),Pe.push(";")),V}return f(We,{def:Fe,toString:function(){return ca([Oe.length>0?"var "+Oe.join(",")+";":"",ca(Pe)])}})}function re(){var Pe=pe(),We=pe(),Oe=Pe.toString,Fe=We.toString;function V(ne,Re){We(ne,Re,"=",Pe.def(ne,Re),";")}return f(function(){Pe.apply(Pe,Wn(arguments))},{def:Pe.def,entry:Pe,exit:We,save:V,set:function(ne,Re,rt){V(ne,Re),Pe(ne,Re,"=",rt,";")},toString:function(){return Oe()+Fe()}})}function ae(){var Pe=ca(arguments),We=re(),Oe=re(),Fe=We.toString,V=Oe.toString;return f(We,{then:function(){return We.apply(We,Wn(arguments)),this},else:function(){return Oe.apply(Oe,Wn(arguments)),this},toString:function(){var ne=V();return ne&&(ne="else{"+ne+"}"),ca(["if(",Pe,"){",Fe(),"}",ne])}})}var De=pe(),Ae={};function Be(Pe,We){var Oe=[];function Fe(){var Se="a"+Oe.length;return Oe.push(Se),Se}We=We||0;for(var V=0;V<We;++V)Fe();var ne=re(),Re=ne.toString,rt=Ae[Pe]=f(ne,{arg:Fe,toString:function(){return ca(["function(",Oe.join(),"){",Re(),"}"])}});return rt}function Ge(){var Pe=['"use strict";',De,"return {"];Object.keys(Ae).forEach(function(Fe){Pe.push('"',Fe,'":',Ae[Fe].toString(),",")}),Pe.push("}");var We=ca(Pe).replace(/;/g,`;
|
|
41
|
-
`).replace(/}/g,`}
|
|
42
|
-
`).replace(/{/g,`{
|
|
43
|
-
`),Oe=Function.apply(null,x.concat(We));return Oe.apply(null,C)}return{global:De,link:ie,block:pe,proc:Be,scope:re,cond:ae,compile:Ge}}var Sn="xyzw".split(""),sc=5121,Va=1,po=2,$a=0,Li=1,mo=2,Cl=3,Za=4,oc=5,Ml=6,pn="dither",go="blend.enable",kl="blend.color",ri="blend.equation",vs="blend.func",_s="depth.enable",ha="depth.func",Il="depth.range",Mn="depth.mask",ps="colorMask",lc="cull.enable",uc="cull.face",Fl="frontFace",ms="lineWidth",cc="polygonOffset.enable",Xa="polygonOffset.offset",Nl="sample.alpha",hc="sample.enable",Bl="sample.coverage",kf="stencil.enable",dc="stencil.mask",Pl="stencil.func",gs="stencil.opFront",If="stencil.opBack",vc="scissor.enable",yo="scissor.box",Zi="viewport",Ff="profile",Xi="framebuffer",ys="vert",qa="frag",da="elements",va="primitive",_a="count",Ka="offset",bo="instances",Nf="vao",xo="Width",Gl="Height",ja=Xi+xo,Bf=Xi+Gl,Ul=Zi+xo,_c=Zi+Gl,wo="drawingBuffer",pc=wo+xo,So=wo+Gl,rr=[vs,ri,Pl,gs,If,Bl,Zi,yo,Xa],Pf=34962,Yl=34963,bs=35632,mc=35633,gc=3553,Pd=34067,ni=2884,Gd=3042,To=3024,Hl=2960,yc=2929,bc=3089,Xn=32823,pa=32926,zl=32928,Eo=5126,Qa=35664,xs=35665,Gf=35666,Ao=5124,Uf=35667,Yf=35668,pi=35669,Wl=35670,mi=35671,ws=35672,Ss=35673,Ja=35674,Ts=35675,Es=35676,As=35678,Hf=35680,Do=4,Ds=1028,ma=1029,Vl=2304,kn=2305,Oi=32775,Ud=32776,Yd=519,gi=7680,ef=0,$l=1,Zl=32774,Hd=513,Xl=36160,zf=36064,Vn={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},xc=["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"],tf={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},qi={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ls={frag:bs,vert:mc},Lo={cw:Vl,ccw:kn};function rf(c){return Array.isArray(c)||i(c)||On(c)}function Oo(c){return c.sort(function(x,C){return x===Zi?-1:C===Zi?1:x<C?-1:1})}function Hr(c,x,C,ie){this.thisDep=c,this.contextDep=x,this.propDep=C,this.append=ie}function ga(c){return c&&!(c.thisDep||c.contextDep||c.propDep)}function zr(c){return new Hr(!1,!1,!1,c)}function Tn(c,x){var C=c.type;if(C===$a){var ie=c.data.length;return new Hr(!0,ie>=1,ie>=2,x)}else if(C===Za){var pe=c.data;return new Hr(pe.thisDep,pe.contextDep,pe.propDep,x)}else{if(C===oc)return new Hr(!1,!1,!1,x);if(C===Ml){for(var re=!1,ae=!1,De=!1,Ae=0;Ae<c.data.length;++Ae){var Be=c.data[Ae];if(Be.type===Li)De=!0;else if(Be.type===mo)ae=!0;else if(Be.type===Cl)re=!0;else if(Be.type===$a){re=!0;var Ge=Be.data;Ge>=1&&(ae=!0),Ge>=2&&(De=!0)}else Be.type===Za&&(re=re||Be.data.thisDep,ae=ae||Be.data.contextDep,De=De||Be.data.propDep)}return new Hr(re,ae,De,x)}else return new Hr(C===Cl,C===mo,C===Li,x)}}var ql=new Hr(!1,!1,!1,function(){});function Kl(c,x,C,ie,pe,re,ae,De,Ae,Be,Ge,Pe,We,Oe,Fe){var V=Be.Record,ne={add:32774,subtract:32778,"reverse subtract":32779};C.ext_blend_minmax&&(ne.min=Oi,ne.max=Ud);var Re=C.angle_instanced_arrays,rt=C.webgl_draw_buffers,Se=C.oes_vertex_array_object,Qe={dirty:!0,profile:Fe.profile},je={},pt=[],ye={},me={};function ot(E){return E.replace(".","_")}function Ve(E,m,B){var Z=ot(E);pt.push(E),je[Z]=Qe[Z]=!!B,ye[Z]=m}function ke(E,m,B){var Z=ot(E);pt.push(E),Array.isArray(B)?(Qe[Z]=B.slice(),je[Z]=B.slice()):Qe[Z]=je[Z]=B,me[Z]=m}Ve(pn,To),Ve(go,Gd),ke(kl,"blendColor",[0,0,0,0]),ke(ri,"blendEquationSeparate",[Zl,Zl]),ke(vs,"blendFuncSeparate",[$l,ef,$l,ef]),Ve(_s,yc,!0),ke(ha,"depthFunc",Hd),ke(Il,"depthRange",[0,1]),ke(Mn,"depthMask",!0),ke(ps,ps,[!0,!0,!0,!0]),Ve(lc,ni),ke(uc,"cullFace",ma),ke(Fl,Fl,kn),ke(ms,ms,1),Ve(cc,Xn),ke(Xa,"polygonOffset",[0,0]),Ve(Nl,pa),Ve(hc,zl),ke(Bl,"sampleCoverage",[1,!1]),Ve(kf,Hl),ke(dc,"stencilMask",-1),ke(Pl,"stencilFunc",[Yd,0,-1]),ke(gs,"stencilOpSeparate",[Ds,gi,gi,gi]),ke(If,"stencilOpSeparate",[ma,gi,gi,gi]),Ve(vc,bc),ke(yo,"scissor",[0,0,c.drawingBufferWidth,c.drawingBufferHeight]),ke(Zi,Zi,[0,0,c.drawingBufferWidth,c.drawingBufferHeight]);var $e={gl:c,context:We,strings:x,next:je,current:Qe,draw:Pe,elements:re,buffer:pe,shader:Ge,attributes:Be.state,vao:Be,uniforms:Ae,framebuffer:De,extensions:C,timer:Oe,isBufferArgs:rf},qe={primTypes:Ui,compareFuncs:tf,blendFuncs:Vn,blendEquations:ne,stencilOps:qi,glTypes:Ma,orientationType:Lo};w.optional(function(){$e.isArrayLike=Nr}),rt&&(qe.backBuffer=[ma],qe.drawBuffer=it(ie.maxDrawbuffers,function(E){return E===0?[0]:it(E,function(m){return zf+m})}));var Mt=0;function Lt(){var E=Wa(),m=E.link,B=E.global;E.id=Mt++,E.batchId="0";var Z=m($e),X=E.shared={props:"a0"};Object.keys($e).forEach(function(R){X[R]=B.def(Z,".",R)}),w.optional(function(){E.CHECK=m(w),E.commandStr=w.guessCommand(),E.command=m(E.commandStr),E.assert=function(R,L,j){R("if(!(",L,"))",this.CHECK,".commandRaise(",m(j),",",this.command,");")},qe.invalidBlendCombinations=xc});var G=E.next={},N=E.current={};Object.keys(me).forEach(function(R){Array.isArray(Qe[R])&&(G[R]=B.def(X.next,".",R),N[R]=B.def(X.current,".",R))});var W=E.constants={};Object.keys(qe).forEach(function(R){W[R]=B.def(JSON.stringify(qe[R]))}),E.invoke=function(R,L){switch(L.type){case $a:var j=["this",X.context,X.props,E.batchId];return R.def(m(L.data),".call(",j.slice(0,Math.max(L.data.length+1,4)),")");case Li:return R.def(X.props,L.data);case mo:return R.def(X.context,L.data);case Cl:return R.def("this",L.data);case Za:return L.data.append(E,R),L.data.ref;case oc:return L.data.toString();case Ml:return L.data.map(function(q){return E.invoke(R,q)})}},E.attribCache={};var D={};return E.scopeAttrib=function(R){var L=x.id(R);if(L in D)return D[L];var j=Be.scope[L];j||(j=Be.scope[L]=new V);var q=D[L]=m(j);return q},E}function Ke(E){var m=E.static,B=E.dynamic,Z;if(Ff in m){var X=!!m[Ff];Z=zr(function(N,W){return X}),Z.enable=X}else if(Ff in B){var G=B[Ff];Z=Tn(G,function(N,W){return N.invoke(W,G)})}return Z}function Je(E,m){var B=E.static,Z=E.dynamic;if(Xi in B){var X=B[Xi];return X?(X=De.getFramebuffer(X),w.command(X,"invalid framebuffer object"),zr(function(N,W){var D=N.link(X),R=N.shared;W.set(R.framebuffer,".next",D);var L=R.context;return W.set(L,"."+ja,D+".width"),W.set(L,"."+Bf,D+".height"),D})):zr(function(N,W){var D=N.shared;W.set(D.framebuffer,".next","null");var R=D.context;return W.set(R,"."+ja,R+"."+pc),W.set(R,"."+Bf,R+"."+So),"null"})}else if(Xi in Z){var G=Z[Xi];return Tn(G,function(N,W){var D=N.invoke(W,G),R=N.shared,L=R.framebuffer,j=W.def(L,".getFramebuffer(",D,")");w.optional(function(){N.assert(W,"!"+D+"||"+j,"invalid framebuffer object")}),W.set(L,".next",j);var q=R.context;return W.set(q,"."+ja,j+"?"+j+".width:"+q+"."+pc),W.set(q,"."+Bf,j+"?"+j+".height:"+q+"."+So),j})}else return null}function wt(E,m,B){var Z=E.static,X=E.dynamic;function G(D){if(D in Z){var R=Z[D];w.commandType(R,"object","invalid "+D,B.commandStr);var L=!0,j=R.x|0,q=R.y|0,ve,be;return"width"in R?(ve=R.width|0,w.command(ve>=0,"invalid "+D,B.commandStr)):L=!1,"height"in R?(be=R.height|0,w.command(be>=0,"invalid "+D,B.commandStr)):L=!1,new Hr(!L&&m&&m.thisDep,!L&&m&&m.contextDep,!L&&m&&m.propDep,function(yt,at){var Te=yt.shared.context,le=ve;"width"in R||(le=at.def(Te,".",ja,"-",j));var ht=be;return"height"in R||(ht=at.def(Te,".",Bf,"-",q)),[j,q,le,ht]})}else if(D in X){var Ye=X[D],Dt=Tn(Ye,function(yt,at){var Te=yt.invoke(at,Ye);w.optional(function(){yt.assert(at,Te+"&&typeof "+Te+'==="object"',"invalid "+D)});var le=yt.shared.context,ht=at.def(Te,".x|0"),lt=at.def(Te,".y|0"),Et=at.def('"width" in ',Te,"?",Te,".width|0:","(",le,".",ja,"-",ht,")"),dr=at.def('"height" in ',Te,"?",Te,".height|0:","(",le,".",Bf,"-",lt,")");return w.optional(function(){yt.assert(at,Et+">=0&&"+dr+">=0","invalid "+D)}),[ht,lt,Et,dr]});return m&&(Dt.thisDep=Dt.thisDep||m.thisDep,Dt.contextDep=Dt.contextDep||m.contextDep,Dt.propDep=Dt.propDep||m.propDep),Dt}else return m?new Hr(m.thisDep,m.contextDep,m.propDep,function(yt,at){var Te=yt.shared.context;return[0,0,at.def(Te,".",ja),at.def(Te,".",Bf)]}):null}var N=G(Zi);if(N){var W=N;N=new Hr(N.thisDep,N.contextDep,N.propDep,function(D,R){var L=W.append(D,R),j=D.shared.context;return R.set(j,"."+Ul,L[2]),R.set(j,"."+_c,L[3]),L})}return{viewport:N,scissor_box:G(yo)}}function Rt(E,m){var B=E.static,Z=typeof B[qa]=="string"&&typeof B[ys]=="string";if(Z){if(Object.keys(m.dynamic).length>0)return null;var X=m.static,G=Object.keys(X);if(G.length>0&&typeof X[G[0]]=="number"){for(var N=[],W=0;W<G.length;++W)w(typeof X[G[W]]=="number","must specify all vertex attribute locations when using vaos"),N.push([X[G[W]]|0,G[W]]);return N}}return null}function Vt(E,m,B){var Z=E.static,X=E.dynamic;function G(L){if(L in Z){var j=x.id(Z[L]);w.optional(function(){Ge.shader(Ls[L],j,w.guessCommand())});var q=zr(function(){return j});return q.id=j,q}else if(L in X){var ve=X[L];return Tn(ve,function(be,Ye){var Dt=be.invoke(Ye,ve),yt=Ye.def(be.shared.strings,".id(",Dt,")");return w.optional(function(){Ye(be.shared.shader,".shader(",Ls[L],",",yt,",",be.command,");")}),yt})}return null}var N=G(qa),W=G(ys),D=null,R;return ga(N)&&ga(W)?(D=Ge.program(W.id,N.id,null,B),R=zr(function(L,j){return L.link(D)})):R=new Hr(N&&N.thisDep||W&&W.thisDep,N&&N.contextDep||W&&W.contextDep,N&&N.propDep||W&&W.propDep,function(L,j){var q=L.shared.shader,ve;N?ve=N.append(L,j):ve=j.def(q,".",qa);var be;W?be=W.append(L,j):be=j.def(q,".",ys);var Ye=q+".program("+be+","+ve;return w.optional(function(){Ye+=","+L.command}),j.def(Ye+")")}),{frag:N,vert:W,progVar:R,program:D}}function Mr(E,m){var B=E.static,Z=E.dynamic,X={},G=!1;function N(){if(Nf in B){var at=B[Nf];return at!==null&&Be.getVAO(at)===null&&(at=Be.createVAO(at)),G=!0,X.vao=at,zr(function(le){var ht=Be.getVAO(at);return ht?le.link(ht):"null"})}else if(Nf in Z){G=!0;var Te=Z[Nf];return Tn(Te,function(le,ht){var lt=le.invoke(ht,Te);return ht.def(le.shared.vao+".getVAO("+lt+")")})}return null}var W=N(),D=!1;function R(){if(da in B){var at=B[da];if(X.elements=at,rf(at)){var Te=X.elements=re.create(at,!0);at=re.getElements(Te),D=!0}else at&&(at=re.getElements(at),D=!0,w.command(at,"invalid elements",m.commandStr));var le=zr(function(lt,Et){if(at){var dr=lt.link(at);return lt.ELEMENTS=dr,dr}return lt.ELEMENTS=null,null});return le.value=at,le}else if(da in Z){D=!0;var ht=Z[da];return Tn(ht,function(lt,Et){var dr=lt.shared,yn=dr.isBufferArgs,af=dr.elements,ji=lt.invoke(Et,ht),Ci=Et.def("null"),ba=Et.def(yn,"(",ji,")"),ff=lt.cond(ba).then(Ci,"=",af,".createStream(",ji,");").else(Ci,"=",af,".getElements(",ji,");");return w.optional(function(){lt.assert(ff.else,"!"+ji+"||"+Ci,"invalid elements")}),Et.entry(ff),Et.exit(lt.cond(ba).then(af,".destroyStream(",Ci,");")),lt.ELEMENTS=Ci,Ci})}else if(G)return new Hr(W.thisDep,W.contextDep,W.propDep,function(lt,Et){return Et.def(lt.shared.vao+".currentVAO?"+lt.shared.elements+".getElements("+lt.shared.vao+".currentVAO.elements):null")});return null}var L=R();function j(){if(va in B){var at=B[va];return X.primitive=at,w.commandParameter(at,Ui,"invalid primitve",m.commandStr),zr(function(le,ht){return Ui[at]})}else if(va in Z){var Te=Z[va];return Tn(Te,function(le,ht){var lt=le.constants.primTypes,Et=le.invoke(ht,Te);return w.optional(function(){le.assert(ht,Et+" in "+lt,"invalid primitive, must be one of "+Object.keys(Ui))}),ht.def(lt,"[",Et,"]")})}else{if(D)return ga(L)?L.value?zr(function(le,ht){return ht.def(le.ELEMENTS,".primType")}):zr(function(){return Do}):new Hr(L.thisDep,L.contextDep,L.propDep,function(le,ht){var lt=le.ELEMENTS;return ht.def(lt,"?",lt,".primType:",Do)});if(G)return new Hr(W.thisDep,W.contextDep,W.propDep,function(le,ht){return ht.def(le.shared.vao+".currentVAO?"+le.shared.vao+".currentVAO.primitive:"+Do)})}return null}function q(at,Te){if(at in B){var le=B[at]|0;return Te?X.offset=le:X.instances=le,w.command(!Te||le>=0,"invalid "+at,m.commandStr),zr(function(lt,Et){return Te&&(lt.OFFSET=le),le})}else if(at in Z){var ht=Z[at];return Tn(ht,function(lt,Et){var dr=lt.invoke(Et,ht);return Te&&(lt.OFFSET=dr,w.optional(function(){lt.assert(Et,dr+">=0","invalid "+at)})),dr})}else if(Te){if(D)return zr(function(lt,Et){return lt.OFFSET=0,0});if(G)return new Hr(W.thisDep,W.contextDep,W.propDep,function(lt,Et){return Et.def(lt.shared.vao+".currentVAO?"+lt.shared.vao+".currentVAO.offset:0")})}else if(G)return new Hr(W.thisDep,W.contextDep,W.propDep,function(lt,Et){return Et.def(lt.shared.vao+".currentVAO?"+lt.shared.vao+".currentVAO.instances:-1")});return null}var ve=q(Ka,!0);function be(){if(_a in B){var at=B[_a]|0;return X.count=at,w.command(typeof at=="number"&&at>=0,"invalid vertex count",m.commandStr),zr(function(){return at})}else if(_a in Z){var Te=Z[_a];return Tn(Te,function(Et,dr){var yn=Et.invoke(dr,Te);return w.optional(function(){Et.assert(dr,"typeof "+yn+'==="number"&&'+yn+">=0&&"+yn+"===("+yn+"|0)","invalid vertex count")}),yn})}else if(D)if(ga(L)){if(L)return ve?new Hr(ve.thisDep,ve.contextDep,ve.propDep,function(Et,dr){var yn=dr.def(Et.ELEMENTS,".vertCount-",Et.OFFSET);return w.optional(function(){Et.assert(dr,yn+">=0","invalid vertex offset/element buffer too small")}),yn}):zr(function(Et,dr){return dr.def(Et.ELEMENTS,".vertCount")});var le=zr(function(){return-1});return w.optional(function(){le.MISSING=!0}),le}else{var ht=new Hr(L.thisDep||ve.thisDep,L.contextDep||ve.contextDep,L.propDep||ve.propDep,function(Et,dr){var yn=Et.ELEMENTS;return Et.OFFSET?dr.def(yn,"?",yn,".vertCount-",Et.OFFSET,":-1"):dr.def(yn,"?",yn,".vertCount:-1")});return w.optional(function(){ht.DYNAMIC=!0}),ht}else if(G){var lt=new Hr(W.thisDep,W.contextDep,W.propDep,function(Et,dr){return dr.def(Et.shared.vao,".currentVAO?",Et.shared.vao,".currentVAO.count:-1")});return lt}return null}var Ye=j(),Dt=be(),yt=q(bo,!1);return{elements:L,primitive:Ye,count:Dt,instances:yt,offset:ve,vao:W,vaoActive:G,elementsActive:D,static:X}}function Lr(E,m){var B=E.static,Z=E.dynamic,X={};return pt.forEach(function(G){var N=ot(G);function W(D,R){if(G in B){var L=D(B[G]);X[N]=zr(function(){return L})}else if(G in Z){var j=Z[G];X[N]=Tn(j,function(q,ve){return R(q,ve,q.invoke(ve,j))})}}switch(G){case lc:case go:case pn:case kf:case _s:case vc:case cc:case Nl:case hc:case Mn:return W(function(D){return w.commandType(D,"boolean",G,m.commandStr),D},function(D,R,L){return w.optional(function(){D.assert(R,"typeof "+L+'==="boolean"',"invalid flag "+G,D.commandStr)}),L});case ha:return W(function(D){return w.commandParameter(D,tf,"invalid "+G,m.commandStr),tf[D]},function(D,R,L){var j=D.constants.compareFuncs;return w.optional(function(){D.assert(R,L+" in "+j,"invalid "+G+", must be one of "+Object.keys(tf))}),R.def(j,"[",L,"]")});case Il:return W(function(D){return w.command(Nr(D)&&D.length===2&&typeof D[0]=="number"&&typeof D[1]=="number"&&D[0]<=D[1],"depth range is 2d array",m.commandStr),D},function(D,R,L){w.optional(function(){D.assert(R,D.shared.isArrayLike+"("+L+")&&"+L+".length===2&&typeof "+L+'[0]==="number"&&typeof '+L+'[1]==="number"&&'+L+"[0]<="+L+"[1]","depth range must be a 2d array")});var j=R.def("+",L,"[0]"),q=R.def("+",L,"[1]");return[j,q]});case vs:return W(function(D){w.commandType(D,"object","blend.func",m.commandStr);var R="srcRGB"in D?D.srcRGB:D.src,L="srcAlpha"in D?D.srcAlpha:D.src,j="dstRGB"in D?D.dstRGB:D.dst,q="dstAlpha"in D?D.dstAlpha:D.dst;return w.commandParameter(R,Vn,N+".srcRGB",m.commandStr),w.commandParameter(L,Vn,N+".srcAlpha",m.commandStr),w.commandParameter(j,Vn,N+".dstRGB",m.commandStr),w.commandParameter(q,Vn,N+".dstAlpha",m.commandStr),w.command(xc.indexOf(R+", "+j)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+R+", "+j+")",m.commandStr),[Vn[R],Vn[j],Vn[L],Vn[q]]},function(D,R,L){var j=D.constants.blendFuncs;w.optional(function(){D.assert(R,L+"&&typeof "+L+'==="object"',"invalid blend func, must be an object")});function q(Te,le){var ht=R.def('"',Te,le,'" in ',L,"?",L,".",Te,le,":",L,".",Te);return w.optional(function(){D.assert(R,ht+" in "+j,"invalid "+G+"."+Te+le+", must be one of "+Object.keys(Vn))}),ht}var ve=q("src","RGB"),be=q("dst","RGB");w.optional(function(){var Te=D.constants.invalidBlendCombinations;D.assert(R,Te+".indexOf("+ve+'+", "+'+be+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var Ye=R.def(j,"[",ve,"]"),Dt=R.def(j,"[",q("src","Alpha"),"]"),yt=R.def(j,"[",be,"]"),at=R.def(j,"[",q("dst","Alpha"),"]");return[Ye,yt,Dt,at]});case ri:return W(function(D){if(typeof D=="string")return w.commandParameter(D,ne,"invalid "+G,m.commandStr),[ne[D],ne[D]];if(typeof D=="object")return w.commandParameter(D.rgb,ne,G+".rgb",m.commandStr),w.commandParameter(D.alpha,ne,G+".alpha",m.commandStr),[ne[D.rgb],ne[D.alpha]];w.commandRaise("invalid blend.equation",m.commandStr)},function(D,R,L){var j=D.constants.blendEquations,q=R.def(),ve=R.def(),be=D.cond("typeof ",L,'==="string"');return w.optional(function(){function Ye(Dt,yt,at){D.assert(Dt,at+" in "+j,"invalid "+yt+", must be one of "+Object.keys(ne))}Ye(be.then,G,L),D.assert(be.else,L+"&&typeof "+L+'==="object"',"invalid "+G),Ye(be.else,G+".rgb",L+".rgb"),Ye(be.else,G+".alpha",L+".alpha")}),be.then(q,"=",ve,"=",j,"[",L,"];"),be.else(q,"=",j,"[",L,".rgb];",ve,"=",j,"[",L,".alpha];"),R(be),[q,ve]});case kl:return W(function(D){return w.command(Nr(D)&&D.length===4,"blend.color must be a 4d array",m.commandStr),it(4,function(R){return+D[R]})},function(D,R,L){return w.optional(function(){D.assert(R,D.shared.isArrayLike+"("+L+")&&"+L+".length===4","blend.color must be a 4d array")}),it(4,function(j){return R.def("+",L,"[",j,"]")})});case dc:return W(function(D){return w.commandType(D,"number",N,m.commandStr),D|0},function(D,R,L){return w.optional(function(){D.assert(R,"typeof "+L+'==="number"',"invalid stencil.mask")}),R.def(L,"|0")});case Pl:return W(function(D){w.commandType(D,"object",N,m.commandStr);var R=D.cmp||"keep",L=D.ref||0,j="mask"in D?D.mask:-1;return w.commandParameter(R,tf,G+".cmp",m.commandStr),w.commandType(L,"number",G+".ref",m.commandStr),w.commandType(j,"number",G+".mask",m.commandStr),[tf[R],L,j]},function(D,R,L){var j=D.constants.compareFuncs;w.optional(function(){function Ye(){D.assert(R,Array.prototype.join.call(arguments,""),"invalid stencil.func")}Ye(L+"&&typeof ",L,'==="object"'),Ye('!("cmp" in ',L,")||(",L,".cmp in ",j,")")});var q=R.def('"cmp" in ',L,"?",j,"[",L,".cmp]",":",gi),ve=R.def(L,".ref|0"),be=R.def('"mask" in ',L,"?",L,".mask|0:-1");return[q,ve,be]});case gs:case If:return W(function(D){w.commandType(D,"object",N,m.commandStr);var R=D.fail||"keep",L=D.zfail||"keep",j=D.zpass||"keep";return w.commandParameter(R,qi,G+".fail",m.commandStr),w.commandParameter(L,qi,G+".zfail",m.commandStr),w.commandParameter(j,qi,G+".zpass",m.commandStr),[G===If?ma:Ds,qi[R],qi[L],qi[j]]},function(D,R,L){var j=D.constants.stencilOps;w.optional(function(){D.assert(R,L+"&&typeof "+L+'==="object"',"invalid "+G)});function q(ve){return w.optional(function(){D.assert(R,'!("'+ve+'" in '+L+")||("+L+"."+ve+" in "+j+")","invalid "+G+"."+ve+", must be one of "+Object.keys(qi))}),R.def('"',ve,'" in ',L,"?",j,"[",L,".",ve,"]:",gi)}return[G===If?ma:Ds,q("fail"),q("zfail"),q("zpass")]});case Xa:return W(function(D){w.commandType(D,"object",N,m.commandStr);var R=D.factor|0,L=D.units|0;return w.commandType(R,"number",N+".factor",m.commandStr),w.commandType(L,"number",N+".units",m.commandStr),[R,L]},function(D,R,L){w.optional(function(){D.assert(R,L+"&&typeof "+L+'==="object"',"invalid "+G)});var j=R.def(L,".factor|0"),q=R.def(L,".units|0");return[j,q]});case uc:return W(function(D){var R=0;return D==="front"?R=Ds:D==="back"&&(R=ma),w.command(!!R,N,m.commandStr),R},function(D,R,L){return w.optional(function(){D.assert(R,L+'==="front"||'+L+'==="back"',"invalid cull.face")}),R.def(L,'==="front"?',Ds,":",ma)});case ms:return W(function(D){return w.command(typeof D=="number"&&D>=ie.lineWidthDims[0]&&D<=ie.lineWidthDims[1],"invalid line width, must be a positive number between "+ie.lineWidthDims[0]+" and "+ie.lineWidthDims[1],m.commandStr),D},function(D,R,L){return w.optional(function(){D.assert(R,"typeof "+L+'==="number"&&'+L+">="+ie.lineWidthDims[0]+"&&"+L+"<="+ie.lineWidthDims[1],"invalid line width")}),L});case Fl:return W(function(D){return w.commandParameter(D,Lo,N,m.commandStr),Lo[D]},function(D,R,L){return w.optional(function(){D.assert(R,L+'==="cw"||'+L+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),R.def(L+'==="cw"?'+Vl+":"+kn)});case ps:return W(function(D){return w.command(Nr(D)&&D.length===4,"color.mask must be length 4 array",m.commandStr),D.map(function(R){return!!R})},function(D,R,L){return w.optional(function(){D.assert(R,D.shared.isArrayLike+"("+L+")&&"+L+".length===4","invalid color.mask")}),it(4,function(j){return"!!"+L+"["+j+"]"})});case Bl:return W(function(D){w.command(typeof D=="object"&&D,N,m.commandStr);var R="value"in D?D.value:1,L=!!D.invert;return w.command(typeof R=="number"&&R>=0&&R<=1,"sample.coverage.value must be a number between 0 and 1",m.commandStr),[R,L]},function(D,R,L){w.optional(function(){D.assert(R,L+"&&typeof "+L+'==="object"',"invalid sample.coverage")});var j=R.def('"value" in ',L,"?+",L,".value:1"),q=R.def("!!",L,".invert");return[j,q]})}}),X}function Xt(E,m){var B=E.static,Z=E.dynamic,X={};return Object.keys(B).forEach(function(G){var N=B[G],W;if(typeof N=="number"||typeof N=="boolean")W=zr(function(){return N});else if(typeof N=="function"){var D=N._reglType;D==="texture2d"||D==="textureCube"?W=zr(function(R){return R.link(N)}):D==="framebuffer"||D==="framebufferCube"?(w.command(N.color.length>0,'missing color attachment for framebuffer sent to uniform "'+G+'"',m.commandStr),W=zr(function(R){return R.link(N.color[0])})):w.commandRaise('invalid data for uniform "'+G+'"',m.commandStr)}else Nr(N)?W=zr(function(R){var L=R.global.def("[",it(N.length,function(j){return w.command(typeof N[j]=="number"||typeof N[j]=="boolean","invalid uniform "+G,R.commandStr),N[j]}),"]");return L}):w.commandRaise('invalid or missing data for uniform "'+G+'"',m.commandStr);W.value=N,X[G]=W}),Object.keys(Z).forEach(function(G){var N=Z[G];X[G]=Tn(N,function(W,D){return W.invoke(D,N)})}),X}function Dr(E,m){var B=E.static,Z=E.dynamic,X={};return Object.keys(B).forEach(function(G){var N=B[G],W=x.id(G),D=new V;if(rf(N))D.state=Va,D.buffer=pe.getBuffer(pe.create(N,Pf,!1,!0)),D.type=0;else{var R=pe.getBuffer(N);if(R)D.state=Va,D.buffer=R,D.type=0;else if(w.command(typeof N=="object"&&N,"invalid data for attribute "+G,m.commandStr),"constant"in N){var L=N.constant;D.buffer="null",D.state=po,typeof L=="number"?D.x=L:(w.command(Nr(L)&&L.length>0&&L.length<=4,"invalid constant for attribute "+G,m.commandStr),Sn.forEach(function(yt,at){at<L.length&&(D[yt]=L[at])}))}else{rf(N.buffer)?R=pe.getBuffer(pe.create(N.buffer,Pf,!1,!0)):R=pe.getBuffer(N.buffer),w.command(!!R,'missing buffer for attribute "'+G+'"',m.commandStr);var j=N.offset|0;w.command(j>=0,'invalid offset for attribute "'+G+'"',m.commandStr);var q=N.stride|0;w.command(q>=0&&q<256,'invalid stride for attribute "'+G+'", must be integer betweeen [0, 255]',m.commandStr);var ve=N.size|0;w.command(!("size"in N)||ve>0&&ve<=4,'invalid size for attribute "'+G+'", must be 1,2,3,4',m.commandStr);var be=!!N.normalized,Ye=0;"type"in N&&(w.commandParameter(N.type,Ma,"invalid type for attribute "+G,m.commandStr),Ye=Ma[N.type]);var Dt=N.divisor|0;w.optional(function(){"divisor"in N&&(w.command(Dt===0||Re,'cannot specify divisor for attribute "'+G+'", instancing not supported',m.commandStr),w.command(Dt>=0,'invalid divisor for attribute "'+G+'"',m.commandStr));var yt=m.commandStr,at=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(N).forEach(function(Te){w.command(at.indexOf(Te)>=0,'unknown parameter "'+Te+'" for attribute pointer "'+G+'" (valid parameters are '+at+")",yt)})}),D.buffer=R,D.state=Va,D.size=ve,D.normalized=be,D.type=Ye||R.dtype,D.offset=j,D.stride=q,D.divisor=Dt}}X[G]=zr(function(yt,at){var Te=yt.attribCache;if(W in Te)return Te[W];var le={isStream:!1};return Object.keys(D).forEach(function(ht){le[ht]=D[ht]}),D.buffer&&(le.buffer=yt.link(D.buffer),le.type=le.type||le.buffer+".dtype"),Te[W]=le,le})}),Object.keys(Z).forEach(function(G){var N=Z[G];function W(D,R){var L=D.invoke(R,N),j=D.shared,q=D.constants,ve=j.isBufferArgs,be=j.buffer;w.optional(function(){D.assert(R,L+"&&(typeof "+L+'==="object"||typeof '+L+'==="function")&&('+ve+"("+L+")||"+be+".getBuffer("+L+")||"+be+".getBuffer("+L+".buffer)||"+ve+"("+L+'.buffer)||("constant" in '+L+"&&(typeof "+L+'.constant==="number"||'+j.isArrayLike+"("+L+".constant))))",'invalid dynamic attribute "'+G+'"')});var Ye={isStream:R.def(!1)},Dt=new V;Dt.state=Va,Object.keys(Dt).forEach(function(le){Ye[le]=R.def(""+Dt[le])});var yt=Ye.buffer,at=Ye.type;R("if(",ve,"(",L,")){",Ye.isStream,"=true;",yt,"=",be,".createStream(",Pf,",",L,");",at,"=",yt,".dtype;","}else{",yt,"=",be,".getBuffer(",L,");","if(",yt,"){",at,"=",yt,".dtype;",'}else if("constant" in ',L,"){",Ye.state,"=",po,";","if(typeof "+L+'.constant === "number"){',Ye[Sn[0]],"=",L,".constant;",Sn.slice(1).map(function(le){return Ye[le]}).join("="),"=0;","}else{",Sn.map(function(le,ht){return Ye[le]+"="+L+".constant.length>"+ht+"?"+L+".constant["+ht+"]:0;"}).join(""),"}}else{","if(",ve,"(",L,".buffer)){",yt,"=",be,".createStream(",Pf,",",L,".buffer);","}else{",yt,"=",be,".getBuffer(",L,".buffer);","}",at,'="type" in ',L,"?",q.glTypes,"[",L,".type]:",yt,".dtype;",Ye.normalized,"=!!",L,".normalized;");function Te(le){R(Ye[le],"=",L,".",le,"|0;")}return Te("size"),Te("offset"),Te("stride"),Te("divisor"),R("}}"),R.exit("if(",Ye.isStream,"){",be,".destroyStream(",yt,");","}"),Ye}X[G]=Tn(N,W)}),X}function pr(E){var m=E.static,B=E.dynamic,Z={};return Object.keys(m).forEach(function(X){var G=m[X];Z[X]=zr(function(N,W){return typeof G=="number"||typeof G=="boolean"?""+G:N.link(G)})}),Object.keys(B).forEach(function(X){var G=B[X];Z[X]=Tn(G,function(N,W){return N.invoke(W,G)})}),Z}function qr(E,m,B,Z,X){var G=E.static,N=E.dynamic;w.optional(function(){var Te=[Xi,ys,qa,da,va,Ka,_a,bo,Ff,Nf].concat(pt);function le(ht){Object.keys(ht).forEach(function(lt){w.command(Te.indexOf(lt)>=0,'unknown parameter "'+lt+'"',X.commandStr)})}le(G),le(N)});var W=Rt(E,m),D=Je(E),R=wt(E,D,X),L=Mr(E,X),j=Lr(E,X),q=Vt(E,X,W);function ve(Te){var le=R[Te];le&&(j[Te]=le)}ve(Zi),ve(ot(yo));var be=Object.keys(j).length>0,Ye={framebuffer:D,draw:L,shader:q,state:j,dirty:be,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Ye.profile=Ke(E),Ye.uniforms=Xt(B,X),Ye.drawVAO=Ye.scopeVAO=L.vao,!Ye.drawVAO&&q.program&&!W&&C.angle_instanced_arrays&&L.static.elements){var Dt=!0,yt=q.program.attributes.map(function(Te){var le=m.static[Te];return Dt=Dt&&!!le,le});if(Dt&&yt.length>0){var at=Be.getVAO(Be.createVAO({attributes:yt,elements:L.static.elements}));Ye.drawVAO=new Hr(null,null,null,function(Te,le){return Te.link(at)}),Ye.useVAO=!0}}return W?Ye.useVAO=!0:Ye.attributes=Dr(m,X),Ye.context=pr(Z),Ye}function Kr(E,m,B){var Z=E.shared,X=Z.context,G=E.scope();Object.keys(B).forEach(function(N){m.save(X,"."+N);var W=B[N],D=W.append(E,m);Array.isArray(D)?G(X,".",N,"=[",D.join(),"];"):G(X,".",N,"=",D,";")}),m(G)}function en(E,m,B,Z){var X=E.shared,G=X.gl,N=X.framebuffer,W;rt&&(W=m.def(X.extensions,".webgl_draw_buffers"));var D=E.constants,R=D.drawBuffer,L=D.backBuffer,j;B?j=B.append(E,m):j=m.def(N,".next"),Z||m("if(",j,"!==",N,".cur){"),m("if(",j,"){",G,".bindFramebuffer(",Xl,",",j,".framebuffer);"),rt&&m(W,".drawBuffersWEBGL(",R,"[",j,".colorAttachments.length]);"),m("}else{",G,".bindFramebuffer(",Xl,",null);"),rt&&m(W,".drawBuffersWEBGL(",L,");"),m("}",N,".cur=",j,";"),Z||m("}")}function ln(E,m,B){var Z=E.shared,X=Z.gl,G=E.current,N=E.next,W=Z.current,D=Z.next,R=E.cond(W,".dirty");pt.forEach(function(L){var j=ot(L);if(!(j in B.state)){var q,ve;if(j in N){q=N[j],ve=G[j];var be=it(Qe[j].length,function(Dt){return R.def(q,"[",Dt,"]")});R(E.cond(be.map(function(Dt,yt){return Dt+"!=="+ve+"["+yt+"]"}).join("||")).then(X,".",me[j],"(",be,");",be.map(function(Dt,yt){return ve+"["+yt+"]="+Dt}).join(";"),";"))}else{q=R.def(D,".",j);var Ye=E.cond(q,"!==",W,".",j);R(Ye),j in ye?Ye(E.cond(q).then(X,".enable(",ye[j],");").else(X,".disable(",ye[j],");"),W,".",j,"=",q,";"):Ye(X,".",me[j],"(",q,");",W,".",j,"=",q,";")}}}),Object.keys(B.state).length===0&&R(W,".dirty=false;"),m(R)}function mn(E,m,B,Z){var X=E.shared,G=E.current,N=X.current,W=X.gl;Oo(Object.keys(B)).forEach(function(D){var R=B[D];if(!(Z&&!Z(R))){var L=R.append(E,m);if(ye[D]){var j=ye[D];ga(R)?L?m(W,".enable(",j,");"):m(W,".disable(",j,");"):m(E.cond(L).then(W,".enable(",j,");").else(W,".disable(",j,");")),m(N,".",D,"=",L,";")}else if(Nr(L)){var q=G[D];m(W,".",me[D],"(",L,");",L.map(function(ve,be){return q+"["+be+"]="+ve}).join(";"),";")}else m(W,".",me[D],"(",L,");",N,".",D,"=",L,";")}})}function Wr(E,m){Re&&(E.instancing=m.def(E.shared.extensions,".angle_instanced_arrays"))}function Ut(E,m,B,Z,X){var G=E.shared,N=E.stats,W=G.current,D=G.timer,R=B.profile;function L(){return typeof performance>"u"?"Date.now()":"performance.now()"}var j,q;function ve(Te){j=m.def(),Te(j,"=",L(),";"),typeof X=="string"?Te(N,".count+=",X,";"):Te(N,".count++;"),Oe&&(Z?(q=m.def(),Te(q,"=",D,".getNumPendingQueries();")):Te(D,".beginQuery(",N,");"))}function be(Te){Te(N,".cpuTime+=",L(),"-",j,";"),Oe&&(Z?Te(D,".pushScopeStats(",q,",",D,".getNumPendingQueries(),",N,");"):Te(D,".endQuery();"))}function Ye(Te){var le=m.def(W,".profile");m(W,".profile=",Te,";"),m.exit(W,".profile=",le,";")}var Dt;if(R){if(ga(R)){R.enable?(ve(m),be(m.exit),Ye("true")):Ye("false");return}Dt=R.append(E,m),Ye(Dt)}else Dt=m.def(W,".profile");var yt=E.block();ve(yt),m("if(",Dt,"){",yt,"}");var at=E.block();be(at),m.exit("if(",Dt,"){",at,"}")}function gn(E,m,B,Z,X){var G=E.shared;function N(D){switch(D){case Qa:case Uf:case mi:return 2;case xs:case Yf:case ws:return 3;case Gf:case pi:case Ss:return 4;default:return 1}}function W(D,R,L){var j=G.gl,q=m.def(D,".location"),ve=m.def(G.attributes,"[",q,"]"),be=L.state,Ye=L.buffer,Dt=[L.x,L.y,L.z,L.w],yt=["buffer","normalized","offset","stride"];function at(){m("if(!",ve,".buffer){",j,".enableVertexAttribArray(",q,");}");var le=L.type,ht;if(L.size?ht=m.def(L.size,"||",R):ht=R,m("if(",ve,".type!==",le,"||",ve,".size!==",ht,"||",yt.map(function(Et){return ve+"."+Et+"!=="+L[Et]}).join("||"),"){",j,".bindBuffer(",Pf,",",Ye,".buffer);",j,".vertexAttribPointer(",[q,ht,le,L.normalized,L.stride,L.offset],");",ve,".type=",le,";",ve,".size=",ht,";",yt.map(function(Et){return ve+"."+Et+"="+L[Et]+";"}).join(""),"}"),Re){var lt=L.divisor;m("if(",ve,".divisor!==",lt,"){",E.instancing,".vertexAttribDivisorANGLE(",[q,lt],");",ve,".divisor=",lt,";}")}}function Te(){m("if(",ve,".buffer){",j,".disableVertexAttribArray(",q,");",ve,".buffer=null;","}if(",Sn.map(function(le,ht){return ve+"."+le+"!=="+Dt[ht]}).join("||"),"){",j,".vertexAttrib4f(",q,",",Dt,");",Sn.map(function(le,ht){return ve+"."+le+"="+Dt[ht]+";"}).join(""),"}")}be===Va?at():be===po?Te():(m("if(",be,"===",Va,"){"),at(),m("}else{"),Te(),m("}"))}Z.forEach(function(D){var R=D.name,L=B.attributes[R],j;if(L){if(!X(L))return;j=L.append(E,m)}else{if(!X(ql))return;var q=E.scopeAttrib(R);w.optional(function(){E.assert(m,q+".state","missing attribute "+R)}),j={},Object.keys(new V).forEach(function(ve){j[ve]=m.def(q,".",ve)})}W(E.link(D),N(D.info.type),j)})}function cr(E,m,B,Z,X,G){for(var N=E.shared,W=N.gl,D={},R,L=0;L<Z.length;++L){var j=Z[L],q=j.name,ve=j.info.type,be=j.info.size,Ye=B.uniforms[q];if(be>1){if(!Ye)continue;var Dt=q.replace("[0]","");if(D[Dt])continue;D[Dt]=1}var yt=E.link(j),at=yt+".location",Te;if(Ye){if(!X(Ye))continue;if(ga(Ye)){var le=Ye.value;if(w.command(le!==null&&typeof le<"u",'missing uniform "'+q+'"',E.commandStr),ve===As||ve===Hf){w.command(typeof le=="function"&&(ve===As&&(le._reglType==="texture2d"||le._reglType==="framebuffer")||ve===Hf&&(le._reglType==="textureCube"||le._reglType==="framebufferCube")),"invalid texture for uniform "+q,E.commandStr);var ht=E.link(le._texture||le.color[0]._texture);m(W,".uniform1i(",at,",",ht+".bind());"),m.exit(ht,".unbind();")}else if(ve===Ja||ve===Ts||ve===Es){w.optional(function(){w.command(Nr(le),"invalid matrix for uniform "+q,E.commandStr),w.command(ve===Ja&&le.length===4||ve===Ts&&le.length===9||ve===Es&&le.length===16,"invalid length for matrix uniform "+q,E.commandStr)});var lt=E.global.def("new Float32Array(["+Array.prototype.slice.call(le)+"])"),Et=2;ve===Ts?Et=3:ve===Es&&(Et=4),m(W,".uniformMatrix",Et,"fv(",at,",false,",lt,");")}else{switch(ve){case Eo:be===1?w.commandType(le,"number","uniform "+q,E.commandStr):w.command(Nr(le)&&le.length===be,"uniform "+q,E.commandStr),R="1f";break;case Qa:w.command(Nr(le)&&le.length&&le.length%2===0&&le.length<=be*2,"uniform "+q,E.commandStr),R="2f";break;case xs:w.command(Nr(le)&&le.length&&le.length%3===0&&le.length<=be*3,"uniform "+q,E.commandStr),R="3f";break;case Gf:w.command(Nr(le)&&le.length&&le.length%4===0&&le.length<=be*4,"uniform "+q,E.commandStr),R="4f";break;case Wl:be===1?w.commandType(le,"boolean","uniform "+q,E.commandStr):w.command(Nr(le)&&le.length===be,"uniform "+q,E.commandStr),R="1i";break;case Ao:be===1?w.commandType(le,"number","uniform "+q,E.commandStr):w.command(Nr(le)&&le.length===be,"uniform "+q,E.commandStr),R="1i";break;case mi:w.command(Nr(le)&&le.length&&le.length%2===0&&le.length<=be*2,"uniform "+q,E.commandStr),R="2i";break;case Uf:w.command(Nr(le)&&le.length&&le.length%2===0&&le.length<=be*2,"uniform "+q,E.commandStr),R="2i";break;case ws:w.command(Nr(le)&&le.length&&le.length%3===0&&le.length<=be*3,"uniform "+q,E.commandStr),R="3i";break;case Yf:w.command(Nr(le)&&le.length&&le.length%3===0&&le.length<=be*3,"uniform "+q,E.commandStr),R="3i";break;case Ss:w.command(Nr(le)&&le.length&&le.length%4===0&&le.length<=be*4,"uniform "+q,E.commandStr),R="4i";break;case pi:w.command(Nr(le)&&le.length&&le.length%4===0&&le.length<=be*4,"uniform "+q,E.commandStr),R="4i";break}be>1?(R+="v",le=E.global.def("["+Array.prototype.slice.call(le)+"]")):le=Nr(le)?Array.prototype.slice.call(le):le,m(W,".uniform",R,"(",at,",",le,");")}continue}else Te=Ye.append(E,m)}else{if(!X(ql))continue;Te=m.def(N.uniforms,"[",x.id(q),"]")}ve===As?(w(!Array.isArray(Te),"must specify a scalar prop for textures"),m("if(",Te,"&&",Te,'._reglType==="framebuffer"){',Te,"=",Te,".color[0];","}")):ve===Hf&&(w(!Array.isArray(Te),"must specify a scalar prop for cube maps"),m("if(",Te,"&&",Te,'._reglType==="framebufferCube"){',Te,"=",Te,".color[0];","}")),w.optional(function(){function qn(In,Os){E.assert(m,In,'bad data or missing for uniform "'+q+'". '+Os)}function sf(In,Os){Os===1&&w(!Array.isArray(Te),"must not specify an array type for uniform"),qn("Array.isArray("+Te+") && typeof "+Te+'[0]===" '+In+'" || typeof '+Te+'==="'+In+'"',"invalid type, expected "+In)}function ii(In,Os,ko){Array.isArray(Te)?w(Te.length&&Te.length%In===0&&Te.length<=In*ko,"must have length of "+(ko===1?"":"n * ")+In):qn(N.isArrayLike+"("+Te+")&&"+Te+".length && "+Te+".length % "+In+" === 0 && "+Te+".length<="+In*ko,"invalid vector, should have length of "+(ko===1?"":"n * ")+In,E.commandStr)}function Ac(In){w(!Array.isArray(Te),"must not specify a value type"),qn("typeof "+Te+'==="function"&&'+Te+'._reglType==="texture'+(In===gc?"2d":"Cube")+'"',"invalid texture type",E.commandStr)}switch(ve){case Ao:sf("number",be);break;case Uf:ii(2,"number",be);break;case Yf:ii(3,"number",be);break;case pi:ii(4,"number",be);break;case Eo:sf("number",be);break;case Qa:ii(2,"number",be);break;case xs:ii(3,"number",be);break;case Gf:ii(4,"number",be);break;case Wl:sf("boolean",be);break;case mi:ii(2,"boolean",be);break;case ws:ii(3,"boolean",be);break;case Ss:ii(4,"boolean",be);break;case Ja:ii(4,"number",be);break;case Ts:ii(9,"number",be);break;case Es:ii(16,"number",be);break;case As:Ac(gc);break;case Hf:Ac(Pd);break}});var dr=1;switch(ve){case As:case Hf:var yn=m.def(Te,"._texture");m(W,".uniform1i(",at,",",yn,".bind());"),m.exit(yn,".unbind();");continue;case Ao:case Wl:R="1i";break;case Uf:case mi:R="2i",dr=2;break;case Yf:case ws:R="3i",dr=3;break;case pi:case Ss:R="4i",dr=4;break;case Eo:R="1f";break;case Qa:R="2f",dr=2;break;case xs:R="3f",dr=3;break;case Gf:R="4f",dr=4;break;case Ja:R="Matrix2fv";break;case Ts:R="Matrix3fv";break;case Es:R="Matrix4fv";break}if(R.indexOf("Matrix")===-1&&be>1&&(R+="v",dr=1),R.charAt(0)==="M"){m(W,".uniform",R,"(",at,",");var af=Math.pow(ve-Ja+2,2),ji=E.global.def("new Float32Array(",af,")");Array.isArray(Te)?m("false,(",it(af,function(qn){return ji+"["+qn+"]="+Te[qn]}),",",ji,")"):m("false,(Array.isArray(",Te,")||",Te," instanceof Float32Array)?",Te,":(",it(af,function(qn){return ji+"["+qn+"]="+Te+"["+qn+"]"}),",",ji,")"),m(");")}else if(dr>1){for(var Ci=[],ba=[],ff=0;ff<dr;++ff)Array.isArray(Te)?ba.push(Te[ff]):ba.push(m.def(Te+"["+ff+"]")),G&&Ci.push(m.def());G&&m("if(!",E.batchId,"||",Ci.map(function(qn,sf){return qn+"!=="+ba[sf]}).join("||"),"){",Ci.map(function(qn,sf){return qn+"="+ba[sf]+";"}).join("")),m(W,".uniform",R,"(",at,",",ba.join(","),");"),G&&m("}")}else{if(w(!Array.isArray(Te),"uniform value must not be an array"),G){var Ec=m.def();m("if(!",E.batchId,"||",Ec,"!==",Te,"){",Ec,"=",Te,";")}m(W,".uniform",R,"(",at,",",Te,");"),G&&m("}")}}}function Tt(E,m,B,Z){var X=E.shared,G=X.gl,N=X.draw,W=Z.draw;function D(){var ht=W.elements,lt,Et=m;return ht?((ht.contextDep&&Z.contextDynamic||ht.propDep)&&(Et=B),lt=ht.append(E,Et),W.elementsActive&&Et("if("+lt+")"+G+".bindBuffer("+Yl+","+lt+".buffer.buffer);")):(lt=Et.def(),Et(lt,"=",N,".",da,";","if(",lt,"){",G,".bindBuffer(",Yl,",",lt,".buffer.buffer);}","else if(",X.vao,".currentVAO){",lt,"=",E.shared.elements+".getElements("+X.vao,".currentVAO.elements);",Se?"":"if("+lt+")"+G+".bindBuffer("+Yl+","+lt+".buffer.buffer);","}")),lt}function R(){var ht=W.count,lt,Et=m;return ht?((ht.contextDep&&Z.contextDynamic||ht.propDep)&&(Et=B),lt=ht.append(E,Et),w.optional(function(){ht.MISSING&&E.assert(m,"false","missing vertex count"),ht.DYNAMIC&&E.assert(Et,lt+">=0","missing vertex count")})):(lt=Et.def(N,".",_a),w.optional(function(){E.assert(Et,lt+">=0","missing vertex count")})),lt}var L=D();function j(ht){var lt=W[ht];return lt?lt.contextDep&&Z.contextDynamic||lt.propDep?lt.append(E,B):lt.append(E,m):m.def(N,".",ht)}var q=j(va),ve=j(Ka),be=R();if(typeof be=="number"){if(be===0)return}else B("if(",be,"){"),B.exit("}");var Ye,Dt;Re&&(Ye=j(bo),Dt=E.instancing);var yt=L+".type",at=W.elements&&ga(W.elements)&&!W.vaoActive;function Te(){function ht(){B(Dt,".drawElementsInstancedANGLE(",[q,be,yt,ve+"<<(("+yt+"-"+sc+")>>1)",Ye],");")}function lt(){B(Dt,".drawArraysInstancedANGLE(",[q,ve,be,Ye],");")}L&&L!=="null"?at?ht():(B("if(",L,"){"),ht(),B("}else{"),lt(),B("}")):lt()}function le(){function ht(){B(G+".drawElements("+[q,be,yt,ve+"<<(("+yt+"-"+sc+")>>1)"]+");")}function lt(){B(G+".drawArrays("+[q,ve,be]+");")}L&&L!=="null"?at?ht():(B("if(",L,"){"),ht(),B("}else{"),lt(),B("}")):lt()}Re&&(typeof Ye!="number"||Ye>=0)?typeof Ye=="string"?(B("if(",Ye,">0){"),Te(),B("}else if(",Ye,"<0){"),le(),B("}")):Te():le()}function qt(E,m,B,Z,X){var G=Lt(),N=G.proc("body",X);return w.optional(function(){G.commandStr=m.commandStr,G.command=G.link(m.commandStr)}),Re&&(G.instancing=N.def(G.shared.extensions,".angle_instanced_arrays")),E(G,N,B,Z),G.compile().body}function er(E,m,B,Z){Wr(E,m),B.useVAO?B.drawVAO?m(E.shared.vao,".setVAO(",B.drawVAO.append(E,m),");"):m(E.shared.vao,".setVAO(",E.shared.vao,".targetVAO);"):(m(E.shared.vao,".setVAO(null);"),gn(E,m,B,Z.attributes,function(){return!0})),cr(E,m,B,Z.uniforms,function(){return!0},!1),Tt(E,m,m,B)}function Vr(E,m){var B=E.proc("draw",1);Wr(E,B),Kr(E,B,m.context),en(E,B,m.framebuffer),ln(E,B,m),mn(E,B,m.state),Ut(E,B,m,!1,!0);var Z=m.shader.progVar.append(E,B);if(B(E.shared.gl,".useProgram(",Z,".program);"),m.shader.program)er(E,B,m,m.shader.program);else{B(E.shared.vao,".setVAO(null);");var X=E.global.def("{}"),G=B.def(Z,".id"),N=B.def(X,"[",G,"]");B(E.cond(N).then(N,".call(this,a0);").else(N,"=",X,"[",G,"]=",E.link(function(W){return qt(er,E,m,W,1)}),"(",Z,");",N,".call(this,a0);"))}Object.keys(m.state).length>0&&B(E.shared.current,".dirty=true;"),E.shared.vao&&B(E.shared.vao,".setVAO(null);")}function yi(E,m,B,Z){E.batchId="a1",Wr(E,m);function X(){return!0}gn(E,m,B,Z.attributes,X),cr(E,m,B,Z.uniforms,X,!1),Tt(E,m,m,B)}function ya(E,m,B,Z){Wr(E,m);var X=B.contextDep,G=m.def(),N="a0",W="a1",D=m.def();E.shared.props=D,E.batchId=G;var R=E.scope(),L=E.scope();m(R.entry,"for(",G,"=0;",G,"<",W,";++",G,"){",D,"=",N,"[",G,"];",L,"}",R.exit);function j(yt){return yt.contextDep&&X||yt.propDep}function q(yt){return!j(yt)}if(B.needsContext&&Kr(E,L,B.context),B.needsFramebuffer&&en(E,L,B.framebuffer),mn(E,L,B.state,j),B.profile&&j(B.profile)&&Ut(E,L,B,!1,!0),Z)B.useVAO?B.drawVAO?j(B.drawVAO)?L(E.shared.vao,".setVAO(",B.drawVAO.append(E,L),");"):R(E.shared.vao,".setVAO(",B.drawVAO.append(E,R),");"):R(E.shared.vao,".setVAO(",E.shared.vao,".targetVAO);"):(R(E.shared.vao,".setVAO(null);"),gn(E,R,B,Z.attributes,q),gn(E,L,B,Z.attributes,j)),cr(E,R,B,Z.uniforms,q,!1),cr(E,L,B,Z.uniforms,j,!0),Tt(E,R,L,B);else{var ve=E.global.def("{}"),be=B.shader.progVar.append(E,L),Ye=L.def(be,".id"),Dt=L.def(ve,"[",Ye,"]");L(E.shared.gl,".useProgram(",be,".program);","if(!",Dt,"){",Dt,"=",ve,"[",Ye,"]=",E.link(function(yt){return qt(yi,E,B,yt,2)}),"(",be,");}",Dt,".call(this,a0[",G,"],",G,");")}}function O(E,m){var B=E.proc("batch",2);E.batchId="0",Wr(E,B);var Z=!1,X=!0;Object.keys(m.context).forEach(function(ve){Z=Z||m.context[ve].propDep}),Z||(Kr(E,B,m.context),X=!1);var G=m.framebuffer,N=!1;G?(G.propDep?Z=N=!0:G.contextDep&&Z&&(N=!0),N||en(E,B,G)):en(E,B,null),m.state.viewport&&m.state.viewport.propDep&&(Z=!0);function W(ve){return ve.contextDep&&Z||ve.propDep}ln(E,B,m),mn(E,B,m.state,function(ve){return!W(ve)}),(!m.profile||!W(m.profile))&&Ut(E,B,m,!1,"a1"),m.contextDep=Z,m.needsContext=X,m.needsFramebuffer=N;var D=m.shader.progVar;if(D.contextDep&&Z||D.propDep)ya(E,B,m,null);else{var R=D.append(E,B);if(B(E.shared.gl,".useProgram(",R,".program);"),m.shader.program)ya(E,B,m,m.shader.program);else{B(E.shared.vao,".setVAO(null);");var L=E.global.def("{}"),j=B.def(R,".id"),q=B.def(L,"[",j,"]");B(E.cond(q).then(q,".call(this,a0,a1);").else(q,"=",L,"[",j,"]=",E.link(function(ve){return qt(ya,E,m,ve,2)}),"(",R,");",q,".call(this,a0,a1);"))}}Object.keys(m.state).length>0&&B(E.shared.current,".dirty=true;"),E.shared.vao&&B(E.shared.vao,".setVAO(null);")}function fe(E,m){var B=E.proc("scope",3);E.batchId="a2";var Z=E.shared,X=Z.current;Kr(E,B,m.context),m.framebuffer&&m.framebuffer.append(E,B),Oo(Object.keys(m.state)).forEach(function(N){var W=m.state[N],D=W.append(E,B);Nr(D)?D.forEach(function(R,L){B.set(E.next[N],"["+L+"]",R)}):B.set(Z.next,"."+N,D)}),Ut(E,B,m,!0,!0),[da,Ka,_a,bo,va].forEach(function(N){var W=m.draw[N];!W||B.set(Z.draw,"."+N,""+W.append(E,B))}),Object.keys(m.uniforms).forEach(function(N){var W=m.uniforms[N].append(E,B);Array.isArray(W)&&(W="["+W.join()+"]"),B.set(Z.uniforms,"["+x.id(N)+"]",W)}),Object.keys(m.attributes).forEach(function(N){var W=m.attributes[N].append(E,B),D=E.scopeAttrib(N);Object.keys(new V).forEach(function(R){B.set(D,"."+R,W[R])})}),m.scopeVAO&&B.set(Z.vao,".targetVAO",m.scopeVAO.append(E,B));function G(N){var W=m.shader[N];W&&B.set(Z.shader,"."+N,W.append(E,B))}G(ys),G(qa),Object.keys(m.state).length>0&&(B(X,".dirty=true;"),B.exit(X,".dirty=true;")),B("a1(",E.shared.context,",a0,",E.batchId,");")}function Q(E){if(!(typeof E!="object"||Nr(E))){for(var m=Object.keys(E),B=0;B<m.length;++B)if(z.isDynamic(E[m[B]]))return!0;return!1}}function st(E,m,B){var Z=m.static[B];if(!Z||!Q(Z))return;var X=E.global,G=Object.keys(Z),N=!1,W=!1,D=!1,R=E.global.def("{}");G.forEach(function(j){var q=Z[j];if(z.isDynamic(q)){typeof q=="function"&&(q=Z[j]=z.unbox(q));var ve=Tn(q,null);N=N||ve.thisDep,D=D||ve.propDep,W=W||ve.contextDep}else{switch(X(R,".",j,"="),typeof q){case"number":X(q);break;case"string":X('"',q,'"');break;case"object":Array.isArray(q)&&X("[",q.join(),"]");break;default:X(E.link(q));break}X(";")}});function L(j,q){G.forEach(function(ve){var be=Z[ve];if(!!z.isDynamic(be)){var Ye=j.invoke(q,be);q(R,".",ve,"=",Ye,";")}})}m.dynamic[B]=new z.DynamicVariable(Za,{thisDep:N,contextDep:W,propDep:D,ref:R,append:L}),delete m.static[B]}function zt(E,m,B,Z,X){var G=Lt();G.stats=G.link(X),Object.keys(m.static).forEach(function(W){st(G,m,W)}),rr.forEach(function(W){st(G,E,W)});var N=qr(E,m,B,Z,G);return Vr(G,N),fe(G,N),O(G,N),f(G.compile(),{destroy:function(){N.shader.program.destroy()}})}return{next:je,current:Qe,procs:function(){var E=Lt(),m=E.proc("poll"),B=E.proc("refresh"),Z=E.block();m(Z),B(Z);var X=E.shared,G=X.gl,N=X.next,W=X.current;Z(W,".dirty=false;"),en(E,m),en(E,B,null,!0);var D;Re&&(D=E.link(Re)),C.oes_vertex_array_object&&B(E.link(C.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var R=0;R<ie.maxAttributes;++R){var L=B.def(X.attributes,"[",R,"]"),j=E.cond(L,".buffer");j.then(G,".enableVertexAttribArray(",R,");",G,".bindBuffer(",Pf,",",L,".buffer.buffer);",G,".vertexAttribPointer(",R,",",L,".size,",L,".type,",L,".normalized,",L,".stride,",L,".offset);").else(G,".disableVertexAttribArray(",R,");",G,".vertexAttrib4f(",R,",",L,".x,",L,".y,",L,".z,",L,".w);",L,".buffer=null;"),B(j),Re&&B(D,".vertexAttribDivisorANGLE(",R,",",L,".divisor);")}return B(E.shared.vao,".currentVAO=null;",E.shared.vao,".setVAO(",E.shared.vao,".targetVAO);"),Object.keys(ye).forEach(function(q){var ve=ye[q],be=Z.def(N,".",q),Ye=E.block();Ye("if(",be,"){",G,".enable(",ve,")}else{",G,".disable(",ve,")}",W,".",q,"=",be,";"),B(Ye),m("if(",be,"!==",W,".",q,"){",Ye,"}")}),Object.keys(me).forEach(function(q){var ve=me[q],be=Qe[q],Ye,Dt,yt=E.block();if(yt(G,".",ve,"("),Nr(be)){var at=be.length;Ye=E.global.def(N,".",q),Dt=E.global.def(W,".",q),yt(it(at,function(Te){return Ye+"["+Te+"]"}),");",it(at,function(Te){return Dt+"["+Te+"]="+Ye+"["+Te+"];"}).join("")),m("if(",it(at,function(Te){return Ye+"["+Te+"]!=="+Dt+"["+Te+"]"}).join("||"),"){",yt,"}")}else Ye=Z.def(N,".",q),Dt=Z.def(W,".",q),yt(Ye,");",W,".",q,"=",Ye,";"),m("if(",Ye,"!==",Dt,"){",yt,"}");B(yt)}),E.compile()}(),compile:zt}}function zd(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var wc=34918,Ki=34919,jl=35007,Sc=function(c,x){if(!x.ext_disjoint_timer_query)return null;var C=[];function ie(){return C.pop()||x.ext_disjoint_timer_query.createQueryEXT()}function pe(Re){C.push(Re)}var re=[];function ae(Re){var rt=ie();x.ext_disjoint_timer_query.beginQueryEXT(jl,rt),re.push(rt),Oe(re.length-1,re.length,Re)}function De(){x.ext_disjoint_timer_query.endQueryEXT(jl)}function Ae(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var Be=[];function Ge(){return Be.pop()||new Ae}function Pe(Re){Be.push(Re)}var We=[];function Oe(Re,rt,Se){var Qe=Ge();Qe.startQueryIndex=Re,Qe.endQueryIndex=rt,Qe.sum=0,Qe.stats=Se,We.push(Qe)}var Fe=[],V=[];function ne(){var Re,rt,Se=re.length;if(Se!==0){V.length=Math.max(V.length,Se+1),Fe.length=Math.max(Fe.length,Se+1),Fe[0]=0,V[0]=0;var Qe=0;for(Re=0,rt=0;rt<re.length;++rt){var je=re[rt];x.ext_disjoint_timer_query.getQueryObjectEXT(je,Ki)?(Qe+=x.ext_disjoint_timer_query.getQueryObjectEXT(je,wc),pe(je)):re[Re++]=je,Fe[rt+1]=Qe,V[rt+1]=Re}for(re.length=Re,Re=0,rt=0;rt<We.length;++rt){var pt=We[rt],ye=pt.startQueryIndex,me=pt.endQueryIndex;pt.sum+=Fe[me]-Fe[ye];var ot=V[ye],Ve=V[me];Ve===ot?(pt.stats.gpuTime+=pt.sum/1e6,Pe(pt)):(pt.startQueryIndex=ot,pt.endQueryIndex=Ve,We[Re++]=pt)}We.length=Re}}return{beginQuery:ae,endQuery:De,pushScopeStats:Oe,update:ne,getNumPendingQueries:function(){return re.length},clear:function(){C.push.apply(C,re);for(var Re=0;Re<C.length;Re++)x.ext_disjoint_timer_query.deleteQueryEXT(C[Re]);re.length=0,C.length=0},restore:function(){re.length=0,C.length=0}}},Wd=16384,Tc=256,Vd=1024,$d=34962,Ri="webglcontextlost",Ro="webglcontextrestored",Co=1,Ql=2,Mo=3;function nf(c,x){for(var C=0;C<c.length;++C)if(c[C]===x)return C;return-1}function Pt(c){var x=oe(c);if(!x)return null;var C=x.gl,ie=C.getContextAttributes(),pe=C.isContextLost(),re=At(C,x);if(!re)return null;var ae=He(),De=zd(),Ae=re.extensions,Be=Sc(C,Ae),Ge=p(),Pe=C.drawingBufferWidth,We=C.drawingBufferHeight,Oe={tick:0,time:0,viewportWidth:Pe,viewportHeight:We,framebufferWidth:Pe,framebufferHeight:We,drawingBufferWidth:Pe,drawingBufferHeight:We,pixelRatio:x.pixelRatio},Fe={},V={elements:null,primitive:4,count:-1,offset:0,instances:-1},ne=Jo(C,Ae),Re=xn(C,De,x,Qe),rt=Pr(C,Ae,Re,De),Se=kd(C,Ae,ne,De,Re,rt,V);function Qe(Tt){return Se.destroyBuffer(Tt)}var je=Rl(C,ae,De,x),pt=Rn(C,Ae,ne,function(){ot.procs.poll()},Oe,De,x),ye=md(C,Ae,ne,De,x),me=Md(C,Ae,ne,pt,ye,De),ot=Kl(C,ae,Ae,ne,Re,rt,pt,me,Fe,Se,je,V,Oe,Be,x),Ve=Bd(C,me,ot.procs.poll,Oe,ie,Ae,ne),ke=ot.next,$e=C.canvas,qe=[],Mt=[],Lt=[],Ke=[x.onDestroy],Je=null;function wt(){if(qe.length===0){Be&&Be.update(),Je=null;return}Je=xe.next(wt),mn();for(var Tt=qe.length-1;Tt>=0;--Tt){var qt=qe[Tt];qt&&qt(Oe,null,0)}C.flush(),Be&&Be.update()}function Rt(){!Je&&qe.length>0&&(Je=xe.next(wt))}function Vt(){Je&&(xe.cancel(wt),Je=null)}function Mr(Tt){Tt.preventDefault(),pe=!0,Vt(),Mt.forEach(function(qt){qt()})}function Lr(Tt){C.getError(),pe=!1,re.restore(),je.restore(),Re.restore(),pt.restore(),ye.restore(),me.restore(),Se.restore(),Be&&Be.restore(),ot.procs.refresh(),Rt(),Lt.forEach(function(qt){qt()})}$e&&($e.addEventListener(Ri,Mr,!1),$e.addEventListener(Ro,Lr,!1));function Xt(){qe.length=0,Vt(),$e&&($e.removeEventListener(Ri,Mr),$e.removeEventListener(Ro,Lr)),je.clear(),me.clear(),ye.clear(),Se.clear(),pt.clear(),rt.clear(),Re.clear(),Be&&Be.clear(),Ke.forEach(function(Tt){Tt()})}function Dr(Tt){w(!!Tt,"invalid args to regl({...})"),w.type(Tt,"object","invalid args to regl({...})");function qt(X){var G=f({},X);delete G.uniforms,delete G.attributes,delete G.context,delete G.vao,"stencil"in G&&G.stencil.op&&(G.stencil.opBack=G.stencil.opFront=G.stencil.op,delete G.stencil.op);function N(W){if(W in G){var D=G[W];delete G[W],Object.keys(D).forEach(function(R){G[W+"."+R]=D[R]})}}return N("blend"),N("depth"),N("cull"),N("stencil"),N("polygonOffset"),N("scissor"),N("sample"),"vao"in X&&(G.vao=X.vao),G}function er(X,G){var N={},W={};return Object.keys(X).forEach(function(D){var R=X[D];if(z.isDynamic(R)){W[D]=z.unbox(R,D);return}else if(G&&Array.isArray(R)){for(var L=0;L<R.length;++L)if(z.isDynamic(R[L])){W[D]=z.unbox(R,D);return}}N[D]=R}),{dynamic:W,static:N}}var Vr=er(Tt.context||{},!0),yi=er(Tt.uniforms||{},!0),ya=er(Tt.attributes||{},!1),O=er(qt(Tt),!1),fe={gpuTime:0,cpuTime:0,count:0},Q=ot.compile(O,ya,yi,Vr,fe),st=Q.draw,zt=Q.batch,E=Q.scope,m=[];function B(X){for(;m.length<X;)m.push(null);return m}function Z(X,G){var N;if(pe&&w.raise("context lost"),typeof X=="function")return E.call(this,null,X,0);if(typeof G=="function")if(typeof X=="number")for(N=0;N<X;++N)E.call(this,null,G,N);else if(Array.isArray(X))for(N=0;N<X.length;++N)E.call(this,X[N],G,N);else return E.call(this,X,G,0);else if(typeof X=="number"){if(X>0)return zt.call(this,B(X|0),X|0)}else if(Array.isArray(X)){if(X.length)return zt.call(this,X,X.length)}else return st.call(this,X)}return f(Z,{stats:fe,destroy:function(){Q.destroy()}})}var pr=me.setFBO=Dr({framebuffer:z.define.call(null,Co,"framebuffer")});function qr(Tt,qt){var er=0;ot.procs.poll();var Vr=qt.color;Vr&&(C.clearColor(+Vr[0]||0,+Vr[1]||0,+Vr[2]||0,+Vr[3]||0),er|=Wd),"depth"in qt&&(C.clearDepth(+qt.depth),er|=Tc),"stencil"in qt&&(C.clearStencil(qt.stencil|0),er|=Vd),w(!!er,"called regl.clear with no buffer specified"),C.clear(er)}function Kr(Tt){if(w(typeof Tt=="object"&&Tt,"regl.clear() takes an object as input"),"framebuffer"in Tt)if(Tt.framebuffer&&Tt.framebuffer_reglType==="framebufferCube")for(var qt=0;qt<6;++qt)pr(f({framebuffer:Tt.framebuffer.faces[qt]},Tt),qr);else pr(Tt,qr);else qr(null,Tt)}function en(Tt){w.type(Tt,"function","regl.frame() callback must be a function"),qe.push(Tt);function qt(){var er=nf(qe,Tt);w(er>=0,"cannot cancel a frame twice");function Vr(){var yi=nf(qe,Vr);qe[yi]=qe[qe.length-1],qe.length-=1,qe.length<=0&&Vt()}qe[er]=Vr}return Rt(),{cancel:qt}}function ln(){var Tt=ke.viewport,qt=ke.scissor_box;Tt[0]=Tt[1]=qt[0]=qt[1]=0,Oe.viewportWidth=Oe.framebufferWidth=Oe.drawingBufferWidth=Tt[2]=qt[2]=C.drawingBufferWidth,Oe.viewportHeight=Oe.framebufferHeight=Oe.drawingBufferHeight=Tt[3]=qt[3]=C.drawingBufferHeight}function mn(){Oe.tick+=1,Oe.time=Ut(),ln(),ot.procs.poll()}function Wr(){pt.refresh(),ln(),ot.procs.refresh(),Be&&Be.update()}function Ut(){return(p()-Ge)/1e3}Wr();function gn(Tt,qt){w.type(qt,"function","listener callback must be a function");var er;switch(Tt){case"frame":return en(qt);case"lost":er=Mt;break;case"restore":er=Lt;break;case"destroy":er=Ke;break;default:w.raise("invalid event, must be one of frame,lost,restore,destroy")}return er.push(qt),{cancel:function(){for(var Vr=0;Vr<er.length;++Vr)if(er[Vr]===qt){er[Vr]=er[er.length-1],er.pop();return}}}}var cr=f(Dr,{clear:Kr,prop:z.define.bind(null,Co),context:z.define.bind(null,Ql),this:z.define.bind(null,Mo),draw:Dr({}),buffer:function(Tt){return Re.create(Tt,$d,!1,!1)},elements:function(Tt){return rt.create(Tt,!1)},texture:pt.create2D,cube:pt.createCube,renderbuffer:ye.create,framebuffer:me.create,framebufferCube:me.createCube,vao:Se.createVAO,attributes:ie,frame:en,on:gn,limits:ne,hasExtension:function(Tt){return ne.extensions.indexOf(Tt.toLowerCase())>=0},read:Ve,destroy:Xt,_gl:C,_refresh:Wr,poll:function(){mn(),Be&&Be.update()},now:Ut,stats:De});return x.onDone(null,cr),cr}return Pt})})(Bv);const Sy=Bv.exports,Ty=[0,0,0,0],Ey=1024,Ay=1496e8,Dy=40075016686e-3,Ly=695508e3,Oy=.017453292519943295,Ry=.0333334,Cy=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,My=/(?:#)[0-9a-f]{8}|(?:#)[0-9a-f]{6}|(?:#)[0-9a-f]{4}|(?:#)[0-9a-f]{3}/ig;function Pv(){const t=new Uint8Array([170,187]);return new Uint16Array(t.buffer)[0]===48042}function Gv(...t){if(t.length===1){const[n]=t;return new Array(n).fill(void 0).map((i,f)=>f)}else{const[n,i,f=1]=t;if(f===0)throw new Error("Argument step must be nonzero.");const h=[];for(let s=n;f>0?s<i:s>i;s+=f)h.push(s);return h}}async function Uv(t,n,i){return new Promise((f,h)=>{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer",s.addEventListener("load",()=>{f(s.response)}),s.addEventListener("error",h),s.send(null)}).then(f=>{const h=gh.exports.decode(f),s=gh.exports.toRGBA8(h)[0];return new Uint8Array(s)}).catch(()=>Rh(n,i))}function ky(t,n){return t.byteLength!==n.byteLength?!1:t.every((i,f)=>i===n[f])}function Iy(t,n){const i=2/t,f=-2/n;return[i,0,0,0,0,f,0,0,0,0,1,0,-1,1,0,1]}function Fy(t){const[{x:n,y:i},{x:f,y:h}]=t;return[[n,i],[f,i],[n,h],[f,h]]}const Rh=Ys.exports.memoize((t,n=256)=>{const i=new Float32Array(n*n);return i.fill(t),new Uint8Array(i.buffer)});function Ny(t,n){return`${Object.keys(n).map(f=>`#define ${f} ${n[f]}
|
|
44
|
-
`).join("")}
|
|
45
|
-
${t}`}const By=t=>{const n=t.length===9,i=n?24:16,f=parseInt(t.slice(1),16),h=f>>i&255,s=f>>i-8&255,u=f>>i-16&255,d=n?f>>i-24&255:255;return[h,s,u,d]};function Py(t){if(t==="transparent")return[0,0,0,0];const n=t.match(Cy),i=t.match(My);if(n!==null){const[,f,h,s]=n;return[+f,+h,+s,255]}else{if(i!==null)return By(t);throw new Error(`'${t}' is not a valid RGB or hex color expression.`)}}const Gy=t=>{const n=[];let i=[];for(let d=0;d<t.length;d++){n.push(t[d].offset);const v=Py(t[d].color);i=i.concat(v)}const f=new Float32Array(n),h=new Uint8Array(f.buffer),s=Array.from(h);return i.concat(s)};function Su(t,n){const i=Gy(t);let f;return t.length===0?f=n.texture({shape:[2,2]}):f=n.texture({width:t.length,height:2,data:i}),f}class Yv{constructor(n,i=256,f,h=!1,s="rgba",u="uint8"){const d=Math.floor(f/i),v=d*i,M=d*d,k=n.texture({width:v,height:v,flipY:h,format:s,type:u}),g=new Map,F=this.allTextureCoordinates(d,i);Object.assign(this,{tileSize:i,tilesAcross:d,pixelsAcross:v,tileCapacity:M,texture:k,contents:g,available:F})}addTile(n,i){const{available:f,contents:h,texture:s,tileSize:u}=this,d=this.hashTileCoordinates(n);if(h.has(d)){const g=h.get(d);return h.delete(d),h.set(d,g),this.formatOutputTextureCoordinates(g)}if(Ys.exports.isEmpty(f)){const g=h.keys().next().value;this.removeByHashKey(g)}const v=f.pop();h.set(d,v);const{x:M,y:k}=v;return s.subimage({data:i,width:u,height:u},M,k),this.formatOutputTextureCoordinates(v)}removeTile(n){this.removeByHashKey(this.hashTileCoordinates(n))}clearTiles(){for(const n of Array.from(this.contents.keys()))this.removeByHashKey(n)}destroy(){this.texture.destroy()}removeByHashKey(n){if(this.contents.has(n)){const i=this.contents.get(n);this.contents.delete(n),this.available.push(i)}}formatOutputTextureCoordinates(n){const{x:i,y:f}=n,{pixelsAcross:h,tileSize:s}=this;return[{x:i/h,y:f/h},{x:(i+s)/h,y:(f+s)/h}]}hashTileCoordinates({x:n,y:i,z:f}){return`${n}:${i}:${f}`}getTextureCoordinates(n){const i=this.hashTileCoordinates(n),f=this.contents.get(i);return this.formatOutputTextureCoordinates(f)}allTextureCoordinates(n,i){return Ys.exports.flatMap(Gv(n),f=>Gv(n).map(h=>({x:f*i,y:h*i})))}}const Uy=`#define GLSLIFY 1
|
|
46
|
-
uniform mat4 transformMatrix;
|
|
47
|
-
|
|
48
|
-
attribute vec2 position;
|
|
49
|
-
attribute vec2 texCoord;
|
|
50
|
-
|
|
51
|
-
varying vec2 vTexCoord;
|
|
52
|
-
|
|
53
|
-
void main() {
|
|
54
|
-
vTexCoord = texCoord;
|
|
55
|
-
gl_Position = transformMatrix * vec4(position, 0.0, 1.0);
|
|
56
|
-
}`,Yy=`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
57
|
-
precision highp float;
|
|
58
|
-
#else
|
|
59
|
-
precision mediump float;
|
|
60
|
-
#define GLSLIFY 1
|
|
61
|
-
#endif
|
|
62
|
-
|
|
63
|
-
#ifndef RELATIVE_TOLERANCE
|
|
64
|
-
#define RELATIVE_TOLERANCE 0.0001
|
|
65
|
-
#endif
|
|
66
|
-
|
|
67
|
-
bool isCloseEnough_1(float a, float b) {
|
|
68
|
-
return abs(a - b) <= max(abs(a), abs(b)) * RELATIVE_TOLERANCE;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// #pragma glslify: rgbaToFloat = require(glsl-rgba-to-float)
|
|
72
|
-
// From https://stackoverflow.com/questions/63827836/is-it-possible-to-do-a-rgba-to-float-and-back-round-trip-and-read-the-pixels-in
|
|
73
|
-
|
|
74
|
-
// note: the 0.1s here and there are voodoo related to precision
|
|
75
|
-
float rgbaToFloat_0(vec4 v, bool littleEndian) {
|
|
76
|
-
if (!littleEndian) {
|
|
77
|
-
v = v.abgr;
|
|
78
|
-
}
|
|
79
|
-
vec4 bits = v * 255.0;
|
|
80
|
-
float sign = mix(-1.0, 1.0, step(bits[3], 128.0));
|
|
81
|
-
float expo = floor(mod(bits[3] + 0.1, 128.0)) * 2.0 +
|
|
82
|
-
floor((bits[2] + 0.1) / 128.0) - 127.0;
|
|
83
|
-
float sig = bits[0] +
|
|
84
|
-
bits[1] * 256.0 +
|
|
85
|
-
floor(mod(bits[2] + 0.1, 128.0)) * 256.0 * 256.0;
|
|
86
|
-
return sign * (1.0 + sig / 8388607.0) * pow(2.0, expo);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
float getTexelValue_0(sampler2D texture, vec2 pos, bool littleEndian) {
|
|
90
|
-
vec4 texelRgba = texture2D(texture, pos);
|
|
91
|
-
float texelFloat = rgbaToFloat_0(texelRgba, littleEndian);
|
|
92
|
-
return texelFloat;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
#ifndef DEFAULT_COLOR
|
|
96
|
-
#define DEFAULT_COLOR vec4(0.0)
|
|
97
|
-
#endif
|
|
98
|
-
|
|
99
|
-
#ifndef SCALE_MAX_LENGTH
|
|
100
|
-
#define SCALE_MAX_LENGTH 16
|
|
101
|
-
#endif
|
|
102
|
-
|
|
103
|
-
#ifndef SENTINEL_MAX_LENGTH
|
|
104
|
-
#define SENTINEL_MAX_LENGTH 16
|
|
105
|
-
#endif
|
|
106
|
-
|
|
107
|
-
vec4 computeColor(
|
|
108
|
-
float inputVal,
|
|
109
|
-
sampler2D scaleColormap,
|
|
110
|
-
sampler2D sentinelColormap,
|
|
111
|
-
int scaleLength,
|
|
112
|
-
int sentinelLength,
|
|
113
|
-
bool littleEndian
|
|
114
|
-
) {
|
|
115
|
-
|
|
116
|
-
// vertical texture coordinate to find color and offset
|
|
117
|
-
float colorRow = 0.25;
|
|
118
|
-
float offsetRow = 0.75;
|
|
119
|
-
|
|
120
|
-
// Compare the value against any sentinel values, if defined.
|
|
121
|
-
if (sentinelLength > 0) {
|
|
122
|
-
for (int i = 0; i < SENTINEL_MAX_LENGTH; ++i) {
|
|
123
|
-
if (i == sentinelLength) {
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
float i_f = float(i);
|
|
128
|
-
float sentinelLengthFloat = float(sentinelLength);
|
|
129
|
-
// retrieve the offset from the colormap
|
|
130
|
-
float sentinelOffset = getTexelValue_0(sentinelColormap, vec2((i_f + 0.5) / sentinelLengthFloat, offsetRow), littleEndian);
|
|
131
|
-
if (isCloseEnough_1(inputVal, sentinelOffset)) {
|
|
132
|
-
// retrieve the color from the colormap
|
|
133
|
-
vec2 colormapCoord = vec2((i_f + 0.5) / sentinelLengthFloat, colorRow);
|
|
134
|
-
return texture2D(sentinelColormap, colormapCoord);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Do linear interpolation using the color scale, if defined.
|
|
140
|
-
if (scaleLength > 0) {
|
|
141
|
-
// If value below color scale range, clamp to lowest color stop.
|
|
142
|
-
float scaleOffsetLowest = getTexelValue_0(scaleColormap, vec2(0.0, offsetRow), littleEndian);
|
|
143
|
-
float scaleOffsetHighest = getTexelValue_0(scaleColormap, vec2(1.0, offsetRow), littleEndian);
|
|
144
|
-
if (inputVal < scaleOffsetLowest) {
|
|
145
|
-
return texture2D(scaleColormap, vec2(0.0, colorRow));
|
|
146
|
-
} else if (inputVal > scaleOffsetHighest) {
|
|
147
|
-
return texture2D(scaleColormap, vec2(1.0, colorRow));
|
|
148
|
-
} else {
|
|
149
|
-
for (int i = 0; i < SCALE_MAX_LENGTH; ++i) {
|
|
150
|
-
float i_f = float(i);
|
|
151
|
-
float scaleLengthFloat = float(scaleLength);
|
|
152
|
-
|
|
153
|
-
// If value above color scale range, clamp to highest color stop.
|
|
154
|
-
if (i == scaleLength) {
|
|
155
|
-
return texture2D(sentinelColormap, vec2((scaleLengthFloat - 0.5) / scaleLengthFloat, colorRow));
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
float scaleOffsetNext = getTexelValue_0(scaleColormap, vec2((i_f + 1.0 + 0.5) / scaleLengthFloat, offsetRow), littleEndian);
|
|
159
|
-
|
|
160
|
-
if (inputVal <= scaleOffsetNext) {
|
|
161
|
-
float scaleOffset = getTexelValue_0(scaleColormap, vec2((i_f + 0.5) / scaleLengthFloat, offsetRow), littleEndian);
|
|
162
|
-
float percent = (inputVal - scaleOffset)
|
|
163
|
-
/ (scaleOffsetNext - scaleOffset);
|
|
164
|
-
vec4 colorLow = texture2D(scaleColormap, vec2((i_f + 0.5) / scaleLengthFloat, colorRow));
|
|
165
|
-
vec4 colorHigh = texture2D(scaleColormap, vec2((i_f + 1.0 + 0.5) / scaleLengthFloat, colorRow));
|
|
166
|
-
return mix(colorLow, colorHigh, percent);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return DEFAULT_COLOR;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
#ifndef RELATIVE_TOLERANCE
|
|
176
|
-
#define RELATIVE_TOLERANCE 0.0001
|
|
177
|
-
#endif
|
|
178
|
-
|
|
179
|
-
bool isCloseEnough_0(float a, float b) {
|
|
180
|
-
return abs(a - b) <= max(abs(a), abs(b)) * RELATIVE_TOLERANCE;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// #pragma glslify: rgbaToFloat = require(glsl-rgba-to-float)
|
|
184
|
-
// From https://stackoverflow.com/questions/63827836/is-it-possible-to-do-a-rgba-to-float-and-back-round-trip-and-read-the-pixels-in
|
|
185
|
-
|
|
186
|
-
// note: the 0.1s here and there are voodoo related to precision
|
|
187
|
-
float rgbaToFloat_1(vec4 v, bool littleEndian) {
|
|
188
|
-
if (!littleEndian) {
|
|
189
|
-
v = v.abgr;
|
|
190
|
-
}
|
|
191
|
-
vec4 bits = v * 255.0;
|
|
192
|
-
float sign = mix(-1.0, 1.0, step(bits[3], 128.0));
|
|
193
|
-
float expo = floor(mod(bits[3] + 0.1, 128.0)) * 2.0 +
|
|
194
|
-
floor((bits[2] + 0.1) / 128.0) - 127.0;
|
|
195
|
-
float sig = bits[0] +
|
|
196
|
-
bits[1] * 256.0 +
|
|
197
|
-
floor(mod(bits[2] + 0.1, 128.0)) * 256.0 * 256.0;
|
|
198
|
-
return sign * (1.0 + sig / 8388607.0) * pow(2.0, expo);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
float getTexelValue_1(sampler2D texture, vec2 pos, bool littleEndian) {
|
|
202
|
-
vec4 texelRgba = texture2D(texture, pos);
|
|
203
|
-
float texelFloat = rgbaToFloat_1(texelRgba, littleEndian);
|
|
204
|
-
return texelFloat;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
uniform int scaleLength;
|
|
208
|
-
uniform int sentinelLength;
|
|
209
|
-
uniform sampler2D scaleColormap;
|
|
210
|
-
uniform sampler2D sentinelColormap;
|
|
211
|
-
|
|
212
|
-
uniform float nodataValue;
|
|
213
|
-
uniform sampler2D texture;
|
|
214
|
-
uniform bool littleEndian;
|
|
215
|
-
uniform bool enableSimpleHillshade;
|
|
216
|
-
|
|
217
|
-
uniform float textureSize;
|
|
218
|
-
uniform float tileSize;
|
|
219
|
-
uniform vec4 textureBounds;
|
|
220
|
-
varying vec2 vTexCoord;
|
|
221
|
-
|
|
222
|
-
uniform float offset;
|
|
223
|
-
uniform float slopescale;
|
|
224
|
-
uniform float slopeFactor;
|
|
225
|
-
uniform float deg2rad;
|
|
226
|
-
uniform float azimuth;
|
|
227
|
-
uniform float altitude;
|
|
228
|
-
|
|
229
|
-
float getRelativeHeight(vec2 pos, float v, vec4 textureBounds) {
|
|
230
|
-
float pixelFloatValue = getTexelValue_1(texture, pos, littleEndian);
|
|
231
|
-
float test = step(0.0, pixelFloatValue);
|
|
232
|
-
float testReturn = ((test * pixelFloatValue) + ((1.0 - test) * v)) * (slopescale*slopeFactor);
|
|
233
|
-
return testReturn;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
float hillshade(vec2 pos, float v, float offset, vec4 textureBounds) {
|
|
237
|
-
float cv = v * (slopescale * slopeFactor);
|
|
238
|
-
vec4 nv = vec4(
|
|
239
|
-
getRelativeHeight(vec2(pos.x + offset, pos.y), v, textureBounds),
|
|
240
|
-
getRelativeHeight(vec2(pos.x - offset, pos.y), v, textureBounds),
|
|
241
|
-
getRelativeHeight(vec2(pos.x, pos.y + offset), v, textureBounds),
|
|
242
|
-
getRelativeHeight(vec2(pos.x, pos.y - offset), v, textureBounds)
|
|
243
|
-
);
|
|
244
|
-
|
|
245
|
-
vec2 grad = vec2(
|
|
246
|
-
(nv[0] - cv) / 2.0 + (cv - nv[1]) / 2.0,
|
|
247
|
-
(nv[2] - cv) / 2.0 + (cv - nv[3]) / 2.0
|
|
248
|
-
);
|
|
249
|
-
|
|
250
|
-
float slope = max(3.141593 / 2.0 - atan(sqrt(dot(grad, grad))), 0.0);
|
|
251
|
-
float aspect = atan(-grad.y, grad.x);
|
|
252
|
-
|
|
253
|
-
float hs = sin(altitude * deg2rad) * sin(slope) +
|
|
254
|
-
cos(altitude * deg2rad) * cos(slope) *
|
|
255
|
-
cos((azimuth * deg2rad) - aspect);
|
|
256
|
-
|
|
257
|
-
return clamp(hs, 0.0, 1.0);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
void main() {
|
|
261
|
-
float texelFloat = getTexelValue_1(texture, vTexCoord, littleEndian);
|
|
262
|
-
|
|
263
|
-
if (isCloseEnough_0(texelFloat, nodataValue)) {
|
|
264
|
-
discard;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
vec4 clr = computeColor(
|
|
268
|
-
texelFloat,
|
|
269
|
-
scaleColormap,
|
|
270
|
-
sentinelColormap,
|
|
271
|
-
scaleLength,
|
|
272
|
-
sentinelLength,
|
|
273
|
-
littleEndian
|
|
274
|
-
);
|
|
275
|
-
|
|
276
|
-
if (enableSimpleHillshade) {
|
|
277
|
-
float hs = hillshade(vTexCoord, texelFloat, offset, textureBounds);
|
|
278
|
-
clr.rgb = clr.rgb * hs;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
gl_FragColor = clr;
|
|
282
|
-
}`;function Hy(t,n,i){return t({...n,vert:Uy,frag:Ny(Yy,i),uniforms:{...n.uniforms,scaleLength:t.prop("scaleLength"),sentinelLength:t.prop("sentinelLength"),scaleColormap:t.prop("scaleColormap"),sentinelColormap:t.prop("sentinelColormap"),texture:(f,{texture:h})=>h,enableSimpleHillshade:(f,{enableSimpleHillshade:h})=>h,offset:0,azimuth:0,altitude:0,slopescale:0,deg2rad:Oy,slopeFactor:Ry,tileSize:0,textureSize:0,textureBounds:[0,0,0,0]},attributes:{...n.attributes,texCoord:(f,{textureBounds:h})=>Fy(h)}})}Pv();const zy=Pv();function Wy(t,n){return{uniforms:{nodataValue:n,littleEndian:zy,transformMatrix:({viewportWidth:i,viewportHeight:f})=>Iy(i,f)},attributes:{position:(i,{canvasCoordinates:f})=>{const[h,s]=f,[u,d]=[h+t,s+t];return[[h,s],[u,s],[h,d],[u,d]]}},depth:{enable:!1},primitive:"triangle strip",count:4,viewport:(i,{canvasSize:[f,h]})=>({width:f,height:h})}}class Hv{constructor(n,i,f,h,s,u,d){const v=document.createElement("canvas");let M=Ey,k=1024;const g=Sy({canvas:v,optionalExtensions:["OES_texture_float","WEBGL_color_buffer_float"],onDone:function(S,de){if(S){console.log(S);return}else de.limits.maxTextureSize>2048&&(M=2048),de.limits.maxTextureSize>4096&&(M=4096),de.limits.maxTextureSize>8192&&(M=8192),k=M;de.limits.maxFragmentUniforms===261&&console.warn("Software rendering detected. Many features of this plugin will fail. If you have a GPU, check if drivers are installed ok?")}}),F=Wy(i,f),$={SCALE_MAX_LENGTH:u,SENTINEL_MAX_LENGTH:d};Object.assign(this,{gloperations:n,canvas:v,regl:g,tileSize:i,nodataValue:f,maxTextureDimension:M,normalTextureDimension:k,scaleInput:h,sentinelInput:s,scaleColormap:Su(h,g),sentinelColormap:Su(s,g),textureManager:new Yv(g,i,k,!1),drawTile:Hy(g,F,$)})}renderTile({coords:n,pixelData:i},f,h){const{regl:s,textureManager:u,tileSize:d}=this;this.setCanvasSize(d,d);const v=u.addTile(n,i);s.clear({color:Ty});const M=f.hsSimpleZoomdelta||0,g=Math.max(.5,2**(h+M)/2048)/u.texture.width;return f.hillshadeType==="none"?this.drawTile({canvasSize:[d,d],canvasCoordinates:[0,0],textureBounds:v,texture:u.texture,scaleLength:this.scaleInput.length,sentinelLength:this.sentinelInput.length,scaleColormap:this.scaleColormap,sentinelColormap:this.sentinelColormap,enableSimpleHillshade:!1}):f.hillshadeType==="simple"&&this.drawTileHsSimple({scaleLength:this.scaleInput.length,sentinelLength:this.sentinelInput.length,scaleColormap:this.scaleColormap,sentinelColormap:this.sentinelColormap,canvasSize:[d,d],canvasCoordinates:[0,0],textureBounds:v,texture:u.texture,textureSize:u.texture.width,tileSize:d,offset:g,enableSimpleHillshade:!0,azimuth:f.hsSimpleAzimuth,altitude:f.hsSimpleAltitude,slopescale:f.hsSimpleSlopescale}),[0,0]}setCanvasSize(n,i){Object.assign(this.canvas,{width:n,height:i})}generateAmbientDirections(n){const i=[];for(let f=0;f<n;f++){const h=hv(qf(),Math.random());i.push(h)}this.ambientDirections=i}generateSunDirections(n,i){const f=[];for(let h=0;h<n;h++){const s=cv(qf(),Hg(qf(),zg(qf(),cv(qf(),[1,1,1]),Ay),hv(qf(),Ly*i)));f.push(s)}this.sunDirections=f}updateColorscale(n){this.scaleInputPrevious=this.scaleInput,this.scaleInput=n,this.scaleColormapPrevious=this.scaleColormap,this.scaleColormap=Su(n,this.regl)}updateSentinels(n){this.sentinelInputPrevious=this.sentinelInput,this.sentinelInput=n,this.sentinelColormapPrevious=this.sentinelColormap,this.sentinelColormap=Su(n,this.regl)}setMaxTextureDimension(n){const{textureManager:i,tileSize:f,regl:h}=this;i.destroy(),Object.assign(this,{maxTextureDimension:n,textureManager:new Yv(h,f,n,!1)})}}class Vy{constructor(n){this.options=Object.assign({},hy,n),this._checkColorScaleAndSentinels(),this.setHillshadeOptions();const{nodataValue:i,tileSize:f}=this.options;this._renderer=new Hv(this,f,i,this.options.colorScale,this.options.sentinelValues,this.options.colorscaleMaxLength,this.options.sentinelMaxLength),this._renderer.generateAmbientDirections(this.options.hsAdvAmbientIterations),this._renderer.generateSunDirections(this.options.hsAdvSoftIterations,this.options.hsAdvSunRadiusMultiplier)}updateOptions(n){const{url:i,glOperation:f,operationUrlA:h,operationUrlB:s,operationUrlC:u,operationUrlD:d,operationUrlE:v,operationUrlF:M,colorScale:k,sentinelValues:g,filterLowA:F,filterHighA:$,filterLowB:S,filterHighB:de,filterLowC:se,filterHighC:I,filterLowD:U,filterHighD:te,filterLowE:ce,filterHighE:_e,filterLowF:we,filterHighF:ee,multiplierA:Ce,multiplierB:ut,multiplierC:ct,multiplierD:nt,multiplierE:ft,multiplierF:tt,multiLayers:Le,hsPregenUrl:Ct,hillshadeType:bt,hsAdvValueScale:Me,hsAdvPixelScale:Ze,hsSimpleSlopescale:St,hsSimpleAzimuth:$t,hsSimpleAltitude:Wt,hsAdvSoftIterations:Qt,hsAdvAmbientIterations:sr,hsAdvSunRadiusMultiplier:xr,hsAdvFinalSoftMultiplier:or,hsAdvFinalAmbientMultiplier:Kt,hsAdvBaselayerUrl:wr,hsAdvSmoothInput:Gt,hsAdvSmoothInputKernel:kt,contourInterval:hn,contourIndexInterval:jr,contourLineColor:Ft,contourLineWeight:Br,contourLineIndexWeight:Ir,contourType:Zr,contourSmoothLines:Qr,contourSmoothInput:ar,contourSmoothInputKernel:Nt,contourIlluminatedHighlightColor:En,contourIlluminatedShadowColor:An,contourIlluminatedShadowSize:Jr,contourHypso:an,contourHypsoDomain:w,contourHypsoColors:li,contourBathy:dn,contourBathyDomain:Gi,contourBathyColors:Bn,contourBathyShadowColor:Er,contourBathyHighlightColor:Dn,contourIndexLabels:Pn,contourLabelFont:A,contourLabelDistance:Ue,colorscaleMaxLength:Xe,sentinelMaxLength:dt}=this.options;if(Object.assign(this.options,n),this.options.colorscaleMaxLength!==Xe||this.options.sentinelMaxLength!==dt){const z=this._tileSizeAsNumber(),xe=new Hv(this,z,this.options.nodataValue,this.options.colorScale,this.options.sentinelValues,this.options.colorscaleMaxLength,this.options.sentinelMaxLength);this._renderer.regl.destroy(),delete this._renderer,Object.assign(this,{_renderer:xe})}this._checkColorScaleAndSentinels(),this.options.colorScale!==k&&this._renderer.updateColorscale(this.options.colorScale),this.options.sentinelValues!==g&&this._renderer.updateSentinels(this.options.sentinelValues),this.options.hsAdvAmbientIterations!==sr&&this._renderer.generateAmbientDirections(this.options.hsAdvAmbientIterations),(this.options.hsAdvSoftIterations!==Qt||this.options.hsAdvSunRadiusMultiplier!==xr)&&this._renderer.generateSunDirections(this.options.hsAdvSoftIterations,this.options.hsAdvSunRadiusMultiplier),this.setHillshadeOptions(),this.options.extraPixelLayers>0&&this.options.glOperation==="none"&&this._maybeLoadExtraLayers(h,s,u,d),this.options.hillshadeType!==bt&&(this.options.hillshadeType==="simple"?this._renderer.setMaxTextureDimension(this._tileSizeAsNumber()):bt==="simple"&&this._renderer.setMaxTextureDimension(this._renderer.findMaxTextureDimension())),this.options.url!==i&&this._renderer.textureManager.clearTiles(),this.options.hsAdvBaselayerUrl!==wr&&this._renderer.textureManagerHillshade.clearTiles()}createTile(n){const{extraPixelLayers:i,tileSize:f,url:h,hsPregenUrl:s,operationUrlA:u,operationUrlB:d,operationUrlC:v,operationUrlD:M,operationUrlE:k,operationUrlF:g,filterLowA:F,filterHighA:$,filterLowB:S,filterHighB:de,filterLowC:se,filterHighC:I,filterLowD:U,filterHighD:te,filterLowE:ce,filterHighE:_e,filterLowF:we,filterHighF:ee,multiplierA:Ce,multiplierB:ut,multiplierC:ct,multiplierD:nt,multiplierE:ft,multiplierF:tt}=this.options,Le=document.createElement("canvas");return Object.assign(Le,{className:"gl-tile",width:f,height:f}),new Promise((Ct,bt)=>{this.options.glOperation==="none"?(i===1&&this._fetchTileData(n,u).then(Me=>{this.options.debug&&console.log("createTile - extraPixelLayers === 1"),Le.pixelDataA=Me}),this._fetchTileData(n,h).then(Me=>{this.options.debug&&console.log("_fetchTileData with no operation");let[Ze,St]=this._renderer.renderTile({coords:n,pixelData:Me},this.options._hillshadeOptions,n.z);Le.pixelData=Me,this._copyToTileCanvas(Le,Ze,St),Ct(Le)})):this.options.glOperation==="diff"?Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with diff");const Ze=Me[0],St=Me[1],[$t,Wt,Qt]=this._renderer.renderTileDiff({coords:n,pixelData:Ze},{coords:n,pixelData:St});Le.pixelData=Qt,Le.pixelDataA=Ze,Le.pixelDataB=St,this._copyToTileCanvas(Le,$t,Wt)}):this.options.glOperation==="multi"&&this.options.multiLayers===1?Promise.all([this._fetchTileData(n,u)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],[St,$t,Wt]=this._renderer.renderTileMulti1({coords:n,pixelData:Ze},F,$,Ce);Le.pixelData=Wt,Le.pixelDataA=Ze,this._copyToTileCanvas(Le,St,$t)}):this.options.glOperation==="multi"&&this.options.multiLayers===2?Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],St=Me[1],[$t,Wt,Qt]=this._renderer.renderTileMulti2({coords:n,pixelData:Ze},{coords:n,pixelData:St},F,$,S,de,Ce,ut);Le.pixelData=Qt,Le.pixelDataA=Ze,Le.pixelDataB=St,this._copyToTileCanvas(Le,$t,Wt)}):this.options.glOperation==="multi"&&this.options.multiLayers===3?Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d),this._fetchTileData(n,v)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],St=Me[1],$t=Me[2],[Wt,Qt,sr]=this._renderer.renderTileMulti3({coords:n,pixelData:Ze},{coords:n,pixelData:St},{coords:n,pixelData:$t},F,$,S,de,se,I,Ce,ut,ct);Le.pixelData=sr,Le.pixelDataA=Ze,Le.pixelDataB=St,Le.pixelDataC=$t,this._copyToTileCanvas(Le,Wt,Qt)}):this.options.glOperation==="multi"&&this.options.multiLayers===4?Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d),this._fetchTileData(n,v),this._fetchTileData(n,M)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],St=Me[1],$t=Me[2],Wt=Me[3],[Qt,sr,xr]=this._renderer.renderTileMulti4({coords:n,pixelData:Ze},{coords:n,pixelData:St},{coords:n,pixelData:$t},{coords:n,pixelData:Wt},F,$,S,de,se,I,U,te,Ce,ut,ct,nt);Le.pixelData=xr,Le.pixelDataA=Ze,Le.pixelDataB=St,Le.pixelDataC=$t,Le.pixelDataD=Wt,this._copyToTileCanvas(Le,Qt,sr)}):this.options.glOperation==="multi"&&this.options.multiLayers===5?Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d),this._fetchTileData(n,v),this._fetchTileData(n,M),this._fetchTileData(n,k)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],St=Me[1],$t=Me[2],Wt=Me[3],Qt=Me[4],[sr,xr,or]=this._renderer.renderTileMulti5({coords:n,pixelData:Ze},{coords:n,pixelData:St},{coords:n,pixelData:$t},{coords:n,pixelData:Wt},{coords:n,pixelData:Qt},F,$,S,de,se,I,U,te,ce,_e,Ce,ut,ct,nt,ft);Le.pixelData=or,Le.pixelDataA=Ze,Le.pixelDataB=St,Le.pixelDataC=$t,Le.pixelDataD=Wt,Le.pixelDataE=Qt,this._copyToTileCanvas(Le,sr,xr)}):this.options.glOperation==="multi"&&this.options.multiLayers===6&&Promise.all([this._fetchTileData(n,u),this._fetchTileData(n,d),this._fetchTileData(n,v),this._fetchTileData(n,M),this._fetchTileData(n,k),this._fetchTileData(n,g)]).then(Me=>{this.options.debug&&console.log("_fetchTileData with multi");const Ze=Me[0],St=Me[1],$t=Me[2],Wt=Me[3],Qt=Me[4],sr=Me[5],[xr,or,Kt]=this._renderer.renderTileMulti6({coords:n,pixelData:Ze},{coords:n,pixelData:St},{coords:n,pixelData:$t},{coords:n,pixelData:Wt},{coords:n,pixelData:Qt},{coords:n,pixelData:sr},F,$,S,de,se,I,U,te,ce,_e,we,ee,Ce,ut,ct,nt,ft,tt);Le.pixelData=Kt,Le.pixelDataA=Ze,Le.pixelDataB=St,Le.pixelDataC=$t,Le.pixelDataD=Wt,Le.pixelDataE=Qt,Le.pixelDataF=sr,this._copyToTileCanvas(Le,xr,or)})})}_checkColorScaleAndSentinels(){const{colorScale:n,sentinelValues:i,colorscaleMaxLength:f,sentinelMaxLength:h}=this.options;if(n.length===0&&i.length===0)throw new Error("Either `colorScale` or `sentinelValues` must be of non-zero length.");if(n.length>f)throw new Error(`Color scale length ${n.length} exceeds the maximum, ${f}.`);if(i.length>h)throw new Error(`Sentinel values length ${i.length} exceeds the maximum, ${h}.`)}setHillshadeOptions(){this.options._hillshadeOptions={hillshadeType:this.options.hillshadeType,hsAdvValueScale:this.options.hsAdvValueScale,hsAdvPixelScale:this.options.hsAdvPixelScale,hsSimpleSlopescale:this.options.hsSimpleSlopescale,hsSimpleAzimuth:this.options.hsSimpleAzimuth,hsSimpleAltitude:this.options.hsSimpleAltitude,hsSimpleZoomdelta:this.options.hsSimpleZoomdelta,hsAdvSoftIterations:this.options.hsAdvSoftIterations,hsAdvAmbientIterations:this.options.hsAdvAmbientIterations,hsAdvSunRadiusMultiplier:this.options.hsAdvSunRadiusMultiplier,hsAdvFinalSoftMultiplier:this.options.hsAdvFinalSoftMultiplier,hsAdvFinalAmbientMultiplier:this.options.hsAdvFinalAmbientMultiplier,hsAdvBaselayerUrl:this.options.hsAdvBaselayerUrl,hsAdvSmoothInput:this.options.hsAdvSmoothInput,hsAdvSmoothInputKernel:this.options.hsAdvSmoothInputKernel,hsPregenUrl:this.options.hsPregenUrl}}_tileSizeAsNumber(){return this.options.tileSize}async _fetchTileData(n,i,f=this.options.tileFormat){if(f==="float32"||f==="image")return Uv(this.getTileUrl(n,i),this.options.nodataValue,this._tileSizeAsNumber());if(f==="dem"){const h=Rh(this.options.nodataValue,this._tileSizeAsNumber()),s=await Uv(this.getTileUrl(n,i),this.options.nodataValue,this._tileSizeAsNumber());return ky(s,h)?s:this._renderer.renderConvertDem(s)}return Rh(this.options.nodataValue,this._tileSizeAsNumber())}_copyToTileCanvas(n,i,f){const h=this._tileSizeAsNumber(),s=n.getContext("2d");if(s===null)throw new Error("Tile canvas 2D context is null.");s.clearRect(0,0,h,h),s.drawImage(this._renderer.canvas,i,f,h,h,0,0,h,h)}getTileUrl(n,i){return i.replace(/{z}/g,String(n.z)).replace(/{x}/g,String(n.x)).replace(/{y}/g,String(n.y))}_getPixelScale(n){let{bbox:{east:i,south:f,west:h,north:s},z:u}=n,d=1,v=(f+s)/2;return this.options.hsAdvPixelScale==="auto"?d=Dy*Math.abs(Math.cos(v/180*Math.PI))/Math.pow(2,u+8):typeof this.options.hsAdvPixelScale=="number"&&(d=this.options.hsAdvPixelScale/(this._tileSizeAsNumber()*2**u)),d}}ir.Event=cy,ir.GLOperations=Vy,ir.addIcons2Map=fy,ir.bmapTypes=Og,ir.cameras=vh,ir.colors=Rg,ir.crsTypes=Bg,ir.defaultLayers=Cg,ir.diffLayers=Kg,ir.downloadImage=ey,ir.findNodeInTree=wu,ir.formatDate=Vg,ir.formatFileSize=Zg,ir.formatLocalDate=$g,ir.generateId=Wg,ir.getAnnotationFeature=ny,ir.getAnnotationName=iy,ir.getBeforeId=jg,ir.getDataType=Jg,ir.getGeoCoordOperator=Xg,ir.getGeometryType=ty,ir.getLineLabelFeature=ay,ir.getRotationMatrix=ly,ir.getTaskTreeList=sy,ir.hasNaN=oy,ir.isTokenExpired=Qg,ir.layerFolders=Mg,ir.layerGroups=ov,ir.layerIcons=kg,ir.measurementFields=Ng,ir.project=ph,ir.rgbaToFloat=ry,ir.taskParams=Ig,ir.toRadian=qg,ir.tools=Fg,Object.defineProperties(ir,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|