{"version":3,"file":"spacexr.1.0.0.js","mappings":";;;;;;;;;;;;;;;;;;;;;AAAO;AACP;AACA;AACA;AACA,CAAC,wCAAwC;AAClC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,wEAAwE;AACzG;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,mFAAmF;AAC1H;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,KAAK,mDAAmD;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACtTwB;AACxB;;;;;;;;;;;;;;;;;ACDuC;AACA;AACM;AACtC,yBAAyB,qDAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,+CAAU;AAClD;AACA;AACA;AACA;AACA;AACA,0CAA0C,+CAAU;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mDAAW;AAC3B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,gBAAgB,mDAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACtH0C;AACnC,gCAAgC,mDAAU;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACjDO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,QAAQ;AACjC;AACA,6BAA6B,QAAQ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;AC5I4D;AACrD;AACP;AACA;AACA;AACA,mBAAmB,oEAAU;AAC7B;AACA;AACA,oBAAoB,oEAAU;AAC9B,oBAAoB,oEAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,QAAQ;AACrC;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,8BAA8B,OAAO,EAAE,sBAAsB,OAAO,EAAE,sBAAsB,UAAU,YAAY,SAAS,YAAY;AAC1K;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC5EO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACLuC;AACH;AAC7B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4CAAW;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,4CAAW,cAAc,gDAAQ;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,SAAS;AACnC,8BAA8B,SAAS;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,eAAe;AAChD;AACA,qCAAqC,eAAe;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AC7HiC;AACL;AACK;AACH;AAC9B;;;;;;;;;;;;;;;ACJO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC5BO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACzFO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gCAAgC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;AC3LiC;AACG;AACA;AACN;AAC9B;;;;;;;;;;;;;;;;;ACJuC;AACH;AACoB;AACjD,6CAA6C,gEAAc;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B;AACA;AACA;AACA;AACA;AACA,uBAAuB,yCAAM;AAC7B;AACA;AACA,uBAAuB,yCAAM;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,yCAAM;AACxB,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B;AACA;AACA;AACA;AACA,sBAAsB,yCAAM;AAC5B,sBAAsB,yCAAM;AAC5B;AACA,mBAAmB,4CAAI;AACvB;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC7DuC;AACH;AACoB;AACjD,kCAAkC,gEAAc;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,yCAAM;AACxB;AACA;AACA;AACA;AACA;AACA,uBAAuB,4CAAI;AAC3B;AACA;AACA,mBAAmB,yCAAM;AACzB,mBAAmB,yCAAM;AACzB,kBAAkB,yCAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,yCAAM;AAC1B,oBAAoB,yCAAM;AAC1B;AACA,mBAAmB,4CAAI;AACvB;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC3E0C;AACK;AAC/C;;;;;;;;;;;;;;;ACFgD;AACzC;AACP;AACA,+BAA+B,yDAAS;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACVO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;AC7EyC;AAClC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iDAAU;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACtBgD;AACS;AACxB;AACQ;AAClC;AACP;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AAChC;AACP,yEAAyE,yDAAS;AAClF,6BAA6B,yCAAM;AACnC,0BAA0B,yCAAM;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,yDAAS;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,iEAAU;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iDAAU;AACrC,iCAAiC,yCAAM;AACvC,8BAA8B,yCAAM;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,yDAAS;AACrD;;;;;;;;;;;;;;;;;;;;;;;;;AC5GoC;AACH;AACI;AACC;AACR;AACE;AAChC;;;;;;;;;;;;;;ACNO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;;;;;;;;;;;;;;;AC9C4D;AACrD,mCAAmC,2DAAU;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe,yDAAQ;AACvB;AACA;AACA;;;;;;;;;;;;;;;;;;;AC3CsC;AACwC;AAClC;AACM;AAC3C;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qDAAI,SAAS,qDAAI;AAC7C;AACA;AACA;AACA,gBAAgB,mEAAY;AAC5B;AACA;AACA;AACA;AACA,iCAAiC,qDAAI,0BAA0B,qDAAI;AACnE,yCAAyC,qDAAI;AAC7C,iCAAiC,qDAAI;AACrC,iCAAiC,qDAAI,2BAA2B,qDAAI;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mEAAY;AAC5B;AACA;AACA;AACA;AACA;AACA,qCAAqC,qDAAI,oCAAoC,qDAAI;AACjF,qCAAqC,qDAAI,wCAAwC,qDAAI;AACrF,qCAAqC,qDAAI;AACzC,qCAAqC,qDAAI,qCAAqC,qDAAI;AAClF,qCAAqC,qDAAI,sCAAsC,qDAAI;AACnF,qCAAqC,qDAAI,0CAA0C,qDAAI;AACvF,qCAAqC,qDAAI,mCAAmC,qDAAI;AAChF,qCAAqC,qDAAI,uCAAuC,qDAAI;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,8CAAM;AAC3B,qBAAqB,8CAAM;AAC3B;AACA,qCAAqC,qDAAI,wBAAwB,qDAAI;AACrE,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA,oBAAoB,iEAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAI;AACvB;AACA;AACA,mBAAmB,qDAAI;AACvB;AACA;AACA,mBAAmB,qDAAI;AACvB;AACA;AACA,mBAAmB,qDAAI;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAI;AACvB;AACA;AACA;AACA;AACA;AACA,mBAAmB,0DAAK;AACxB;AACA;AACA;AACA;AACA;AACA,YAAY,iEAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mEAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iEAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB,IAAI,qBAAqB;AACzE;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACrRO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACf4C;AACrC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,qDAAI;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qDAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qDAAI;AACrB,YAAY,qDAAI;AAChB,uBAAuB,qDAAI;AAC3B,gBAAgB,qDAAI;AACpB,gBAAgB,qDAAI;AACpB,gBAAgB,qDAAI;AACpB,oBAAoB,qDAAI;AACxB,iBAAiB,qDAAI;AACrB,qBAAqB,qDAAI;AACzB,mBAAmB,qDAAI;AACvB,oBAAoB,qDAAI;AACxB,mBAAmB,qDAAI;AACvB,gBAAgB,qDAAI;AACpB,mBAAmB,qDAAI;AACvB,qBAAqB,qDAAI;AACzB,gBAAgB,qDAAI;AACpB,oBAAoB,qDAAI;AACxB,iBAAiB,qDAAI;AACrB;AACA;AACA,kBAAkB,qDAAI;AACtB,kBAAkB,qDAAI;AACtB,cAAc,qDAAI;AAClB,kBAAkB,qDAAI;AACtB,iBAAiB,qDAAI;AACrB,cAAc,qDAAI;AAClB,kBAAkB,qDAAI;AACtB,kBAAkB,qDAAI;AACtB,iBAAiB,qDAAI;AACrB,kBAAkB,qDAAI;AACtB,sBAAsB,qDAAI;AAC1B,0BAA0B,qDAAI;AAC9B,mBAAmB,qDAAI;AACvB,qBAAqB,qDAAI;AACzB,gBAAgB,qDAAI;AACpB,qBAAqB,qDAAI;AACzB,iBAAiB,qDAAI;AACrB,oBAAoB,qDAAI;AACxB;AACA;AACA,qBAAqB,qDAAI;AACzB,qBAAqB,qDAAI;AACzB,0BAA0B,qDAAI;AAC9B,kBAAkB,qDAAI;AACtB,mBAAmB,qDAAI;AACvB,qBAAqB,qDAAI;AACzB,eAAe,qDAAI;AACnB,mBAAmB,qDAAI;AACvB,wBAAwB,qDAAI;AAC5B,uBAAuB,qDAAI;AAC3B,uBAAuB,qDAAI;AAC3B,mBAAmB,qDAAI;AACvB,eAAe,qDAAI;AACnB,qBAAqB,qDAAI;AACzB,gBAAgB,qDAAI;AACpB,qBAAqB,qDAAI;AACzB,uBAAuB,qDAAI;AAC3B,mBAAmB,qDAAI;AACvB,mBAAmB,qDAAI;AACvB;AACA;AACA,uBAAuB,qDAAI;AAC3B,iBAAiB,qDAAI;AACrB,mBAAmB,qDAAI;AACvB,qBAAqB,qDAAI;AACzB,0BAA0B,qDAAI;AAC9B,mBAAmB,qDAAI;AACvB,qBAAqB,qDAAI;AACzB,oBAAoB,qDAAI;AACxB,iBAAiB,qDAAI;AACrB,wBAAwB,qDAAI;AAC5B,kBAAkB,qDAAI;AACtB,qBAAqB,qDAAI;AACzB;AACA;AACA,mBAAmB,qDAAI;AACvB,qBAAqB,qDAAI;AACzB,eAAe,qDAAI;AACnB;AACA;AACA,qBAAqB,qDAAI;AACzB,uBAAuB,qDAAI;AAC3B;AACA;;;;;;;;;;;;;;;AClHO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,UAAU,GAAG,UAAU;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,UAAU,GAAG,UAAU;AAC1C;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,UAAU,GAAG,UAAU,GAAG,UAAU;AAC3D;AACA,mBAAmB,UAAU,GAAG,UAAU;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,UAAU,IAAI,UAAU,IAAI,UAAU,SAAS,UAAU,IAAI,UAAU;AAC7G;AACA;AACA;;;;;;;;;;;;;;;;;AC5FyD;AACnB;AACsB;AACrD;AACP;AACA,8DAA8D,oEAAU;AACxE;AACA;AACA,iCAAiC,iEAAS;AAC1C,sBAAsB,8CAAM;AAC5B,cAAc,8CAAM;AACpB,wBAAwB,8CAAM;AAC9B,4DAA4D,8CAAM;AAClE;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClBuC;AACF;AACA;AACW;AACR;AACA;AACJ;AACK;AAChB;AACzB;;;;;;;;;;;;;;;;;ACTiD;AACJ;AACgB;AACtD,sBAAsB,sDAAQ;AACrC;AACA,cAAc,sEAAY;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yDAAQ;AACvB;AACA;AACA;;;;;;;;;;;;;;;;;;;AC/BoE;AACvB;AACM;AACU;AACtD,yBAAyB,4DAAW;AAC3C;AACA,+BAA+B,oDAAc,WAAW,yDAAmB;AAC3E;AACA;AACA;AACA;AACA;AACA,wBAAwB,SAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oDAAc,WAAW,yDAAmB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,qDAAI,oBAAoB,qDAAI,oBAAoB,qDAAI,oBAAoB,qDAAI;AAC/G;AACA;AACA,iBAAiB,sEAAY;AAC7B;AACA;AACA;;;;;;;;;;;;;;;;;ACjCiD;AACJ;AACgB;AACtD,0BAA0B,sDAAQ;AACzC;AACA,sBAAsB,sEAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yDAAQ;AACvB;AACA;AACA;;;;;;;;;;;;;;;ACfmD;AAC5C,uBAAuB,2DAAU;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACVO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AAC9B;AACP;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;ACX8C;AACZ;AACE;AACC;AACJ;AACjC;;;;;;;;;;;;;;;;ACLoD;AACH;AAC1C,gCAAgC,qDAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oDAAM,uCAAuC,8DAAQ;AACpE;AACA;AACA;;;;;;;;;;;;;;;;;ACvCkD;AACD;AAC1C,qBAAqB,2DAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA,oBAAoB,8DAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,2DAAU;AAC5B,kBAAkB,2DAAU;AAC5B,kBAAkB,2DAAU;AAC5B,kBAAkB,2DAAU;AAC5B,kBAAkB,2DAAU;AAC5B,kBAAkB,2DAAU;AAC5B,kBAAkB,2DAAU;AAC5B,kBAAkB,2DAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2DAAU;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,UAAU,WAAW,UAAU,UAAU,UAAU,UAAU,UAAU,QAAQ,UAAU,SAAS,UAAU,UAAU,WAAW,WAAW,YAAY,UAAU,WAAW;AACpM;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACjM2C;AAC0B;AAC9D;AACP;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,4DAAU;AAC7B;AACA,oBAAoB,4DAAU;AAC9B;AACA;AACA,oBAAoB,4DAAU;AAC9B;AACA;AACA,oBAAoB,4DAAU;AAC9B;AACA;AACA,oBAAoB,4DAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2CAAQ;AACxB,gBAAgB,2CAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO,MAAM,OAAO;AACxC;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,yCAAM;AAC3C;AACA;AACA;AACA,qCAAqC,yCAAM;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,yCAAM;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2CAAQ;AACxB,gBAAgB,2CAAQ;AACxB,gBAAgB,2CAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sEAAgB;AAC5B,4BAA4B,mBAAmB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,yCAAM;AACnC,eAAe,yCAAM,qCAAqC,yCAAM,qCAAqC,yCAAM;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO,MAAM,OAAO,MAAM,OAAO;AACrD;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO,MAAM,OAAO,MAAM,OAAO,MAAM,OAAO;AAClE;AACA;AACA;;;;;;;;;;;;;;;;ACnQkC;AACgB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,2DAAU,KAAK,2DAAU,mBAAmB,2DAAU,OAAO,2DAAU,mBAAmB,2DAAU;AACxH;AACA;AACA,2EAA2E,2DAAU;AACrF,2EAA2E,2DAAU;AACrF,2EAA2E,2DAAU;AACrF,2EAA2E,2DAAU;AACrF;AACA;AACA,2EAA2E,2DAAU;AACrF,2EAA2E,2DAAU;AACrF,2EAA2E,2DAAU;AACrF,2EAA2E,2DAAU;AACrF;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAM;AACd,wBAAwB,uBAAuB;AAC/C,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB;AACA;AACA,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,4BAA4B,OAAO;AACnC,gBAAgB,8CAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC,kCAAkC,gBAAgB;AAClD;AACA;AACA,oBAAoB,2DAAU;AAC9B;AACA,sCAAsC,gBAAgB;AACtD;AACA,wBAAwB,2DAAU;AAClC;AACA,0CAA0C,gBAAgB;AAC1D;AACA,4BAA4B,2DAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAM;AACd,QAAQ,8CAAM;AACd;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAM;AACd;AACA;AACA;AACA,QAAQ,8CAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAM;AACd,QAAQ,8CAAM;AACd,QAAQ,8CAAM;AACd,QAAQ,8CAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8CAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8CAAM;AAClB;AACA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,2DAAU;AAC1E;AACA;AACA,gBAAgB,8CAAM;AACtB;AACA;AACA;AACA,gBAAgB,8CAAM;AACtB;AACA;AACA;AACA,gBAAgB,8CAAM;AACtB,gBAAgB,8CAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,eAAe,2DAAU,kBAAkB,2DAAU;AACrD;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA,gBAAgB,8CAAM;AACtB;AACA;AACA,gBAAgB,8CAAM;AACtB,gBAAgB,8CAAM;AACtB,gBAAgB,8CAAM;AACtB;AACA;AACA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB;AACA;AACA;AACA;AACA,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,YAAY,8CAAM;AAClB,wBAAwB,2DAAU,uBAAuB,2DAAU;AACnE,YAAY,8CAAM,CAAC,2DAAU;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;AC3aO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,oBAAoB;AACd;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACzDkC;AAC4B;AACL;AAClD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,2DAAU;AAChC;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2DAAU;AAClC;AACA,yBAAyB;AACzB,aAAa;AACb;AACA,+BAA+B,kEAAkB;AACjD;AACA,gCAAgC;AAChC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,4BAA4B;AACpD;AACA;AACA;AACA,uBAAuB,2DAAU;AACjC,uBAAuB,2DAAU;AACjC,uBAAuB,2DAAU;AACjC,2BAA2B,2DAAU;AACrC;AACA,oBAAoB,2DAAU;AAC9B;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2DAAU,2CAA2C,2DAAU;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA,8BAA8B,2DAAU,KAAK,2DAAU,2BAA2B,2DAAU;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,2DAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,aAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,WAAW;AAC/C,wBAAwB,OAAO;AAC/B,4BAA4B,OAAO;AACnC,gCAAgC,OAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,OAAO;AACnC;AACA;AACA;AACA,4BAA4B,OAAO;AACnC;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B,4BAA4B,OAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACnOO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,SAAS;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,UAAU;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC1EmC;AACa;AACzC;AACP;AACA;AACA;AACA;AACA;AACA,oBAAoB,2CAAQ;AAC5B,qBAAqB,2CAAQ;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,oBAAoB,2CAAQ;AAC5B,qBAAqB,2CAAQ;AAC7B,oBAAoB,2CAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClEsC;AACD;AACH;AACW;AACb;AACY;AACF;AACjB;AACW;AACpC;;;;;;;;;;;;;;;;;;ACT4C;AACO;AACF;AACQ;AAClD,qBAAqB,0DAAa;AACzC;AACA,cAAc,kEAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2DAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oDAAM;AACzB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACtC4C;AACmB;AACX;AACH;AACQ;AAClD,mBAAmB,0DAAa;AACvC;AACA,cAAc,kEAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2DAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2DAAU;AACtB;AACA;AACA;AACA;AACA;AACA,oBAAoB,2DAAU;AAC9B,oBAAoB,2DAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,2DAAU;AAC9B,oBAAoB,2DAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,4DAAU;AACrC;AACA;AACA;AACA;AACA,gCAAgC,4DAAU;AAC1C;AACA;AACA;AACA;AACA,gCAAgC,4DAAU;AAC1C;AACA;AACA;AACA;AACA,gCAAgC,4DAAU;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2DAAU;AAClC;AACA;AACA;AACA;AACA,wBAAwB,2DAAU;AAClC;AACA,UAAU;AACV;AACA;AACA;AACA,eAAe,oDAAM;AACrB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACvF4C;AACmB;AACV;AACJ;AACQ;AAClD,oBAAoB,0DAAa;AACxC;AACA,cAAc,kEAAS;AACvB,YAAY,iEAAW;AACvB;AACA;AACA;AACA,iCAAiC,2DAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2DAAU;AACtB;AACA;AACA;AACA;AACA;AACA,mBAAmB,2DAAU;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oDAAM;AACrB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACtCkD;AACa;AACE;AAClB;AACU;AACzD,kCAAkC,2DAAU;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,sBAAsB,wDAAQ;AACrC;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2DAAmB;AAC/B;AACA,4BAA4B,mBAAmB;AAC/C;AACA;AACA,gCAAgC,gBAAgB;AAChD,+BAA+B,2DAAU;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C,uBAAuB,2DAAU;AACjC;AACA;AACA;AACA;AACA,YAAY,6EAAuB;AACnC;AACA,4BAA4B,mBAAmB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kEAAS;AAC1B,4BAA4B,2DAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2DAAU;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,2DAAU;AAC3D;AACA;AACA;AACA,gCAAgC,kBAAkB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA,gBAAgB,2DAAU;AAC1B;AACA,oCAAoC,wBAAwB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;AC3LkD;AACN;AACmB;AACc;AAC5B;AACQ;AAClD,uBAAuB,0DAAa;AAC3C;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2DAAmB;AAC/B;AACA,4BAA4B,mBAAmB;AAC/C;AACA;AACA,gCAAgC,gBAAgB;AAChD,+BAA+B,2DAAU;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C,uBAAuB,2DAAU;AACjC;AACA;AACA;AACA;AACA,YAAY,6EAAuB;AACnC;AACA;AACA;AACA;AACA;AACA,sBAAsB,kEAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,2DAAU;AAC5D;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4DAAU;AACjC;AACA;AACA;AACA;AACA,4BAA4B,4DAAU;AACtC;AACA;AACA;AACA;AACA,4BAA4B,4DAAU;AACtC;AACA;AACA;AACA;AACA,4BAA4B,4DAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2DAAU;AAC7B;AACA;AACA,eAAe,oDAAM;AACrB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACtI6C;AACtC,4BAA4B,qDAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B;AACA,aAAa;AACb;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACxBO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;AACxB;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnC6C;AACZ;AACC;AACC;AACC;AACJ;AACC;AACjC;;;;;;;;;;;;;;;;;;;;;ACPiC;AACgB;AAC1C;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,YAAY,gDAAQ;AACpB;AACA;AACA,YAAY,mDAAW;AACvB;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,uDAAuD,MAAM;AAC7D;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,oBAAoB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,KAAK,WAAW,gBAAgB;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,IAAI,IAAI,uBAAuB;AAC/E;AACA,8EAA8E,IAAI;AAClF;AACA;AACA,2BAA2B,yCAAM;AACjC;AACA;AACA;AACA,UAAU;AACV,kEAAkE,IAAI;AACtE;AACA;AACA;;;;;;;;;;;;;;;;;;;AC9GgC;AACH;AACQ;AACrC;;;;;;;;;;;;;;;ACHsC;AAC/B,4BAA4B,2CAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACpDqD;AACF;AACqB;AACjE,wBAAwB,4DAAgB;AAC/C;AACA;AACA,0BAA0B,8DAAa;AACvC;AACA;AACA;AACA,gEAAgE,oDAAe;AAC/E,oEAAoE,+DAA0B;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACxBoC;AAC8B;AAC3D,+BAA+B,+CAAW;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,yCAAM;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8DAAsB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AC9E+B;AACA;AAC/B;;;;;;;;;;;;;;;;;;;;;;;;;ACFwC;AACM;AACA;AACD;AACM;AACX;AACxC;;;;;;;;;;;;;;;ACN0C;AACnC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,+CAAU;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AChI0C;AAC6B;AACI;AACpE;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gFAAuB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oFAA0B;AAClE;AACA;AACA;AACA;AACA;AACA,0CAA0C,+CAAU;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,+CAAU;AAC1D;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,iDAAiD,+CAAU;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,+CAAU;AACzD;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,+CAAU;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,+CAAU;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,+CAAU;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,+CAAU;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,+CAAU;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,+CAAU;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,+CAAU;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,gBAAgB;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AClOiE;AAC1D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,0EAAgB;AACrC;AACA;AACA;AACA;AACA;AACA,qBAAqB,0EAAgB;AACrC;AACA;AACA;AACA;AACA;AACA,qBAAqB,0EAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC3F0C;AACE;AACqB;AACjE;AACA,KAAK,0EAAgB,YAAY,gBAAgB;AACjD,KAAK,0EAAgB,WAAW,cAAc;AAC9C,KAAK,0EAAgB,UAAU,cAAc;AAC7C,KAAK,0EAAgB,SAAS,cAAc;AAC5C,KAAK,0EAAgB,eAAe,cAAc;AAClD,KAAK,0EAAgB,WAAW,cAAc;AAC9C;AACO;AACP;AACA;AACA;AACA;AACA,4BAA4B,iDAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,0EAAgB;AAClD;AACA;AACA,uCAAuC,wBAAwB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,0EAAgB;AACrD;AACA,8CAA8C,0EAAgB;AAC9D;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D,8CAA8C,gBAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,0EAAgB;AACrD;AACA,8CAA8C,0EAAgB;AAC9D;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D,8CAA8C,gBAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,0EAAgB;AACrD;AACA,8CAA8C,0EAAgB;AAC9D;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D,8CAA8C,gBAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,+CAAU;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,0EAAgB;AAChE,wBAAwB,0EAAgB;AACxC;AACA,kDAAkD,0EAAgB;AAClE,wBAAwB,0EAAgB;AACxC;AACA,iDAAiD,0EAAgB;AACjE,wBAAwB,0EAAgB;AACxC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACxNO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;;;;;;;;;;;;;;;ACTO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACfuB;AACM;AACA;AAC7B;;;;;;;;;;;;;;;;ACHgC;AACzB;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,EAAE,UAAU,EAAE,UAAU,EAAE;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,yCAAM;AACxB;AACA;AACA,kBAAkB,yCAAM;AACxB;AACA;AACA,kBAAkB,yCAAM;AACxB;AACA;AACA,kBAAkB,yCAAM;AACxB;AACA;AACA;AACA;AACA;AACA,qBAAqB,yCAAM,eAAe,yCAAM,eAAe,yCAAM;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO,GAAG,OAAO,GAAG,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACrdO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3FuC;AAChC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,4BAA4B,gDAAa;AAChD;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AChW+B;AACK;AACpC;;;;;;;;;;;;;;;;ACFO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACM;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACO;AACP;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,SAAS;AACnC;AACA;AACA,iCAAiC,YAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,aAAa;AACvC;AACA;AACA,8BAA8B,aAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;ACzJ+B;AACU;AACzC;;;;;;;;;;;;;;;;;;;;ACFyC;AAClC;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,8CAAM;AACxB,kBAAkB,8CAAM;AACxB;AACA;AACA;AACA,eAAe,8CAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,8CAAM;AACzB,oBAAoB,8CAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA,2CAA2C,8CAAM;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,8CAAM;AAChC,0BAA0B,8CAAM;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,8CAAM;AACxB,kBAAkB,8CAAM;AACxB,kBAAkB,8CAAM;AACxB,sBAAsB,8CAAM;AAC5B,kBAAkB,8CAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,8CAAM;AAChC,0BAA0B,8CAAM;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,8CAAM;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,8CAAM;AAC7B;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACnPuE;AAChE;AACP;AACA;AACA;AACA,kCAAkC,oDAAM,gBAAgB,oDAAM;AAC9D;AACA;AACA,gCAAgC,mDAAK,cAAc,mDAAK;AACxD,2CAA2C,mDAAK,yBAAyB,mDAAK;AAC9E,mCAAmC,mDAAK,iBAAiB,mDAAK;AAC9D,2BAA2B,sDAAQ,SAAS,sDAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oDAAM;AACzB;AACA;AACA;AACA,mBAAmB,oDAAM;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oDAAM;AACzB;AACA;AACA,mBAAmB,mDAAK;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oDAAM;AACzB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrEkC;AACC;AACG;AACJ;AACA;AAClC;;;;;;;;;;;;;;;ACLqD;AAC9C;AACP;AACA,8BAA8B,mDAAK;AACnC,2BAA2B,sDAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,mDAAK;AAClC,8BAA8B,sDAAQ;AACtC;;;;;;;;;;;;;;AClBO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;;;;;;;;;;;;;;;;AClBgG;AACzF;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,yBAAyB,yDAAW,cAAc,yDAAW;AAC7D;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,2DAAE,KAAK,yDAAW,QAAQ,yDAAW,eAAe,yDAAW,QAAQ,yDAAW,gCAAgC,2DAAE,KAAK,kDAAI,KAAK,kDAAI,iBAAiB,2DAAE,KAAK,oDAAM,MAAM,oDAAM,iBAAiB,2DAAE,KAAK,wDAAU,QAAQ,wDAAU;AACjR,6CAA6C,2DAAE,KAAK,yDAAW,QAAQ,yDAAW,eAAe,yDAAW,QAAQ,yDAAW,iDAAiD,2DAAE,KAAK,kDAAI,MAAM,kDAAI,gBAAgB,kDAAI,KAAK,kDAAI,iBAAiB,2DAAE,KAAK,oDAAM,MAAM,oDAAM,gBAAgB,oDAAM,MAAM,oDAAM,iBAAiB,2DAAE,KAAK,wDAAU,KAAK,wDAAU,kBAAkB,wDAAU,QAAQ,wDAAU;AAC7Y,6CAA6C,2DAAE,KAAK,yDAAW,OAAO,yDAAW,eAAe,yDAAW,QAAQ,yDAAW,uCAAuC,2DAAE,KAAK,kDAAI,MAAM,kDAAI,gBAAgB,kDAAI,MAAM,kDAAI,iBAAiB,2DAAE,KAAK,oDAAM,MAAM,oDAAM,gBAAgB,oDAAM,MAAM,oDAAM,iBAAiB,2DAAE,KAAK,wDAAU,IAAI,wDAAU,kBAAkB,wDAAU,KAAK,wDAAU;AAC/X,6CAA6C,2DAAE,KAAK,yDAAW,OAAO,yDAAW,eAAe,yDAAW,OAAO,yDAAW,yCAAyC,2DAAE,KAAK,kDAAI,OAAO,kDAAI,gBAAgB,kDAAI,MAAM,kDAAI,iBAAiB,2DAAE,KAAK,oDAAM,OAAO,oDAAM,gBAAgB,oDAAM,MAAM,oDAAM,iBAAiB,2DAAE,KAAK,wDAAU,MAAM,wDAAU,kBAAkB,wDAAU,IAAI,wDAAU;AACnY,6CAA6C,2DAAE,KAAK,yDAAW,OAAO,yDAAW,eAAe,yDAAW,OAAO,yDAAW,yCAAyC,2DAAE,KAAK,kDAAI,MAAM,kDAAI,gBAAgB,kDAAI,OAAO,kDAAI,iBAAiB,2DAAE,KAAK,oDAAM,OAAO,oDAAM,gBAAgB,oDAAM,OAAO,oDAAM,iBAAiB,2DAAE,KAAK,wDAAU,MAAM,wDAAU,kBAAkB,wDAAU,MAAM,wDAAU;AACtY,6CAA6C,2DAAE,KAAK,yDAAW,OAAO,yDAAW,eAAe,yDAAW,OAAO,yDAAW,+CAA+C,2DAAE,KAAK,kDAAI,OAAO,kDAAI,gBAAgB,kDAAI,MAAM,kDAAI,iBAAiB,2DAAE,KAAK,oDAAM,MAAM,oDAAM,gBAAgB,oDAAM,OAAO,oDAAM,iBAAiB,2DAAE,KAAK,wDAAU,OAAO,wDAAU,kBAAkB,wDAAU,MAAM,wDAAU;AAC5Y,6CAA6C,2DAAE,KAAK,yDAAW,OAAO,yDAAW,eAAe,yDAAW,OAAO,yDAAW,2CAA2C,2DAAE,KAAK,kDAAI,OAAO,kDAAI,gBAAgB,kDAAI,OAAO,kDAAI,iBAAiB,2DAAE,KAAK,oDAAM,IAAI,oDAAM,gBAAgB,oDAAM,MAAM,oDAAM,iBAAiB,2DAAE,KAAK,wDAAU,IAAI,wDAAU,kBAAkB,wDAAU,MAAM,wDAAU;AACnY;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,2DAAE,KAAK,yDAAW,OAAO,yDAAW,eAAe,yDAAW,QAAQ,yDAAW;AACtH;;;;;;;;;;;;;;;;;;AC5EyE;AACxB;AACF;AACxC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,wBAAwB,mEAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,mEAAiB;AACvC;AACA;AACA,2BAA2B,+DAAa;AACxC,wBAAwB,aAAa;AACrC,wBAAwB,UAAU;AAClC,wBAAwB,mEAAmE,uDAAS;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yDAAW,cAAc,yDAAW;AAC/D;AACA;AACA,uBAAuB,uDAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,gEAAgE;AAC3F,MAAM,sBAAsB,iEAAiE;AAC7F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,iEAAiE;AAC7F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,iEAAiE;AAC7F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,gEAAgE;AAC7F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,uBAAuB,gEAAgE;AAC7F,MAAM,uBAAuB,kEAAkE;AAC/F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,gEAAgE;AAC5F,MAAM,sBAAsB,iEAAiE;AAC7F,MAAM,sBAAsB,iEAAiE;AAC7F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,iEAAiE;AAC7F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,iEAAiE;AAC7F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,sBAAsB,kEAAkE;AAC9F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,uBAAuB,iEAAiE;AAC9F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,iEAAiE;AAC5F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F,MAAM,qBAAqB,kEAAkE;AAC7F;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACnQ0B;AACI;AAC9B;;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACvvBoC;AAC7B;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,6CAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6CAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AChD4B;AACE;AACM;AACpC;;;;;;;;;;;;;;;;;;;ACH8C;AACJ;AAC1C;;;;;;;;;;;;;;;;;;;;;ACFwE;AACtB;AACF;AACzC;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,oCAAoC,6EAAW;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,oDAAS;AAC1D,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,kDAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACjG4C;AACrC;AACP;AACA;AACA;AACA,CAAC,gDAAgD;AAC1C;AACP,+CAA+C,iDAAU;AACzD,cAAc,iDAAU;AACxB;AACA;AACO;AACP;AACA;AACA;;;;;;;;;;;;;;;;ACd+D;AACN;AAClD,yBAAyB,oEAAe;AAC/C;AACA;AACA,mCAAmC,kEAAkB;AACrD;AACA;AACA;AACA,eAAe,kEAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACzBgC;AAChC;;;;;;;;;;;;;;;;;ACDyC;AACD;AACjC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AAClC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,wBAAwB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,wBAAwB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,gBAAgB;AACrE;AACA;AACA;AACA,yCAAyC,IAAI,kBAAkB,EAAE;AACjE;AACA;AACA,yCAAyC,IAAI,kBAAkB,EAAE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO,MAAM,OAAO,QAAQ,mBAAmB,MAAM,aAAa;AACtF;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3N0C;AACX;AACM;AACI;AACH;AACA;AACtC;;;;;;;;;;;;;;ACNO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,0BAA0B;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC1BqF;AAC9E,yCAAyC,0EAAyB;AACzE;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,mEAAkB,gCAAgC,mEAAkB;AACtH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uBAAuB;AACrD;AACA,qCAAqC,yBAAyB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,UAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC3CO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC,4BAA4B,WAAW;AACvC;AACA,mDAAmD,sCAAsC;AACzF,uDAAuD,qCAAqC;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACrC0D;AACnD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,+DAAI,gBAAgB,+DAAI;AACpE,6CAA6C,+DAAI,eAAe,+DAAI;AACpE;AACA;AACA;AACA;AACA,oEAAoE,0BAA0B;AAC9F;AACA;AACA;AACA;AACA,8BAA8B,+DAAI;AAClC,8BAA8B,+DAAI;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,mBAAmB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uBAAuB;AACrD;AACA,qCAAqC,yBAAyB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC9JO;AACP;AACA;AACA;;;;;;;;;;;;;;;;;ACHO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACzCgC;AAChC;;;;;;;;;;;;;;;;;ACDoE;AAC7B;AAChC;AACP;AACA;AACA,kDAAkD,+CAAU;AAC5D;AACA;AACA;AACA;AACA,2BAA2B,4CAAK;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,4CAAK;AAC5C,oEAAoE,6DAAwB;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;AClC2C;AACE;AAC7C;;;;;;;;;;;;;;;;;ACFuD;AACK;AACnB;AAClC,uBAAuB,+DAAmB;AACjD;AACA;AACA,uCAAuC,iEAAS;AAChD;AACA;AACA,mBAAmB,8CAAM;AACzB,oCAAoC,8CAAM;AAC1C;AACA;AACA;AACA;AACA;AACA,mBAAmB,8CAAM;AACzB,oBAAoB,8CAAM;AAC1B;AACA;AACA,mCAAmC,8CAAM;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,8CAAM;AACzB,oBAAoB,8CAAM;AAC1B;AACA,gDAAgD,8CAAM;AACtD;AACA;AACA,wBAAwB,8CAAM;AAC9B,wBAAwB,8CAAM;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,8CAAM;AACxB,wBAAwB,8CAAM;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;AC7E+C;AACgB;AACE;AACE;AACR;AACW;AAC5B;AACnC;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,6CAA6C,2EAAkB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,+CAAU;AAClD;AACA;AACA;AACA;AACA;AACA,0CAA0C,+CAAU;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,wDAAiB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oDAAY;AAC7B;AACA;AACA,iBAAiB,oDAAY;AAC7B;AACA;AACA,iBAAiB,oDAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sEAAO;AACtB;AACA;AACA,kBAAkB,iDAAU;AAC5B,kBAAkB,iDAAU;AAC5B;AACA;AACA,wCAAwC,gEAAI;AAC5C;AACA;AACA;AACA,yCAAyC,wEAAQ;AACjD;AACA;AACA;AACA,wBAAwB,iDAAU;AAClC;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iDAAU;AACzB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7GgC;AACD;AACE;AACE;AACP;AACM;AACF;AACA;AACE;AACH;AACI;AACH;AACD;AACP;AACQ;AACG;AACJ;AACV;AACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClB4B;AACW;AACT;AACI;AACI;AACA;AACL;AACjC;;;;;;;;;;;;;;;;;;;ACP4D;AACrD;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA,WAAW,wEAAqB;AAChC;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;AC1BoE;AAChB;AACJ;AACwB;AACf;AACb;AAC2B;AAChE,0BAA0B,qDAAa;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,4DAAmB;AAC7F,8CAA8C,qDAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,+CAAU;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,6DAAwB;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,+EAAiB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,6DAAwB;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,4DAAmB;AACtC;AACA;AACA,mBAAmB,qDAAQ;AAC3B;AACA;AACA,mBAAmB,6EAAiB;AACpC;AACA;AACA,mBAAmB,6EAAiB;AACpC;AACA;AACA,mBAAmB,kEAAgB;AACnC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;AC5PoE;AACb;AACe;AACjC;AACc;AAC5C;AACP;AACA,QAAQ,8CAAM;AACd,QAAQ,8CAAM;AACd;AACA,yBAAyB,mEAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,+CAAU;AAC5D;AACA;AACA;AACA;AACA;AACA,gDAAgD,+CAAU;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,6DAAwB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,6DAAwB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,6DAAwB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,6DAAwB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mFAA4B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2DAAmB;AACtC;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AC1H0C;AACC;AACS;AACmB;AACjB;AACV;AACA;AACrC,+BAA+B,oDAAY;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kEAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,+CAAU;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,+EAAiB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oDAAY;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAQ;AAC3B;AACA;AACA,mBAAmB,4DAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG,wCAAwC;AACxI;AACA;AACA;;;;;;;;;;;;;;;ACpIqE;AAC9D,2BAA2B,6EAAW;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;AC1ByC;AACW;AACC;AAC9C,uBAAuB,8DAAY;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iDAAW;AACnC;AACA;AACA;AACA;AACA,6BAA6B,iDAAU;AACvC,6BAA6B,iDAAU;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iDAAW;AACvC,6BAA6B,aAAa;AAC1C,iCAAiC,aAAa;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6CAAM;AACjC,gCAAgC,6CAAM;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iDAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;AC5G0C;AACF;AACC;AACzC;;;;;;;;;;;;;;;ACHkD;AAC3C,2BAA2B,0DAAY;AAC9C;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACNkD;AAC3C,yBAAyB,0DAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACVkD;AACA;AAC3C,iCAAiC,0DAAY;AACpD;AACA;AACA,qCAAqC,uDAAkB;AACvD;AACA;AACA;AACA,iCAAiC,uDAAkB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;ACvB8C;AACL;AACK;AACE;AACT;AACvC;;;;;;;;;;;;;;;;;;;ACL4C;AACgB;AACpB;AACjC;AACP;AACA,+BAA+B,iDAAU;AACzC;AACA,mCAAmC,gDAAQ;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,4CAAI;AAC9C;AACA;AACA;AACA;AACA;AACA,2CAA2C,+CAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sDAAU;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,4CAAI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,+CAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iDAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACvHsD;AACG;AAClD;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,QAAQ,sDAAU;AAClB;AACA;AACA,6BAA6B,+CAAO;AACpC;AACA,QAAQ,qEAAkB;AAC1B;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACjCoE;AAC7D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,+CAAU;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6DAAwB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6DAAwB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6DAAwB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;AC7DoE;AACpB;AACJ;AACgB;AACT;AAC6B;AACzE,kCAAkC,qDAAa;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iDAAU;AACzC;AACA,iCAAiC,sDAAU,eAAe,4CAAI,2CAA2C,4CAAI,oCAAoC,4CAAI;AACrJ,4BAA4B,+CAAO;AACnC,qCAAqC,2DAAgB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,4CAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6DAAwB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,6DAAwB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,6DAAwB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6DAAwB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6DAAwB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6DAAwB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,+CAAU;AAC5D;AACA;AACA;AACA;AACA,2BAA2B,+CAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,yFAA+B;AAC5D;AACA;AACA;AACA;AACA,0BAA0B,YAAY,UAAU,UAAU,aAAa,aAAa;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACxKO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACnC4C;AACN;AACQ;AAC9C;;;;;;;;;;;;;;;;ACHO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACfO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC1D0C;AACe;AAClD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,+CAAU;AACvE;AACA;AACA;AACA,iEAAiE,+CAAU;AAC3E;AACA;AACA;AACA,iEAAiE,+CAAU;AAC3E;AACA;AACA;AACA;AACA,6BAA6B,kEAAgB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACxCO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;AChByC;AACC;AACT;AACjC;;;;;;;;;;;;;;;;;;;;ACHwD;AACgB;AACnB;AACN;AACA;AACC;AACzC,mCAAmC,qDAAa;AACvD;AACA;AACA;AACA,uBAAuB,oEAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,6DAAc;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,iEAAU;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,iEAAU;AACzE;AACA;AACA;AACA,6DAA6D,iEAAU;AACvE;AACA;AACA;AACA,iEAAiE,iEAAU;AAC3E;AACA;AACA;AACA;AACA,6BAA6B,uDAAgB;AAC7C;AACA;AACA;AACA;AACA;AACA,4DAA4D,iEAAU;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uDAAW;AACjC;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACtMgD;AACO;AAChD;AACP;AACA;AACA,mCAAmC,qDAAW;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+DAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,kBAAkB;AAC3F;AACA;AACA,SAAS;AACT,qEAAqE,OAAO;AAC5E;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,UAAU,GAAG,oDAAoD;AACpF;AACA,mBAAmB,UAAU,GAAG,oDAAoD;AACpF;AACA;AACA;AACA;AACA,iCAAiC,IAAI,OAAO,aAAa,EAAE,IAAI;AAC/D;AACA;AACA;;;;;;;;;;;;;;;AC7EiE;AAC1D,2BAA2B,0EAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACX+B;AACxB;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,wCAAI;AACrC;AACA;AACA,0BAA0B,wCAAI;AAC9B,4BAA4B,wCAAI;AAChC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACzCsD;AACK;AACpD,4BAA4B,0CAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,2CAAU;AAChC;AACA,YAAY,+DAAW;AACvB,mBAAmB,4CAAW;AAC9B;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;AC3B+D;AACT;AACK;AACtB;AAC9B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,+DAAW;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2EAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mEAAQ;AACvB;AACA;AACA,eAAe,6CAAM;AACrB;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AC7LO;AACP;AACA;AACA;AACA;AACO;AACP;AACA,wBAAwB,eAAe;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AACtC;AACP;AACA;AACA;AACA;AACO;AACP;AACA,wBAAwB,eAAe;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0DAA0D;AACpD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACvFwC;AACc;AACjB;AAC9B,mBAAmB,+DAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gDAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6CAAM;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACrE6D;AACX;AACG;AACZ;AACL;AAC7B,kCAAkC,2DAAgB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6DAAwB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6DAAwB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6DAAwB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6DAAwB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iDAAU;AAC5B;AACA;AACA;AACA;AACA,kBAAkB,4CAAI;AACtB;AACA;AACA;AACA;AACA,kBAAkB,iDAAU;AAC5B;AACA;AACA;AACA;AACA,kBAAkB,4CAAI;AACtB;AACA;AACA;AACA;AACA,kBAAkB,iDAAU;AAC5B;AACA;AACA;AACA;AACA,kBAAkB,iDAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,sEAAuB;AACxE;AACA;;;;;;;;;;;;;;;;;ACpG2C;AACsB;AAC1D;AACP;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,+CAAU;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6DAAwB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6DAAwB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6DAAwB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6DAAwB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6DAAwB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6DAAwB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,mDAAW;AACjD,sCAAsC,mDAAW;AACjD;AACA;AACA;AACA;;;;;;;;;;;;;;AC9IO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,WAAW,GAAG,WAAW,OAAO,WAAW;AAChF,wCAAwC,YAAY;AACpD,0BAA0B,OAAO,KAAK,KAAK,GAAG,WAAW,EAAE,MAAM;AACjE;AACA,6CAA6C,UAAU;AACvD;AACA,wCAAwC,EAAE;AAC1C,+BAA+B,EAAE;AACjC,+BAA+B,EAAE;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,EAAE;AAClC;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACrD0C;AACF;AACxC;;;;;;;;;;;;;;ACFO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AACjD;;;;;;;;;;;;;;;;;ACPoD;AACW;AAC8B;AACtF;AACP;AACA;AACA,yCAAyC,yDAAkB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,WAAW,GAAG,wCAAwC;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,0EAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA;AACA,qCAAqC,wEAAkB;AACvD;AACA;AACA;AACA;AACA,wDAAwD,wBAAwB;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,0EAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA;AACA,qCAAqC,wEAAkB;AACvD,qCAAqC,wEAAkB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,0EAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA;AACA,qCAAqC,wEAAkB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,wFAAyB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC5PO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACO;AACP;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;AChBuC;AACA;AACvC;;;;;;;;;;;;;;;;;;;;ACFgD;AACc;AACG;AACZ;AAC9C;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,oDAAoD;AAC9C,oCAAoC,6DAAiB;AAC5D;AACA;AACA;AACA,wBAAwB,EAAE;AAC1B,iCAAiC,gBAAgB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,mBAAmB,wDAAa,IAAI,WAAW,sBAAsB,sEAAc;AACnF;AACA;AACA,mBAAmB,wDAAa,IAAI,WAAW,8CAA8C,sEAAc;AAC3G;AACA;AACA,mBAAmB,wDAAa,IAAI,WAAW,8CAA8C,sEAAc;AAC3G;AACA;AACA,mBAAmB,wDAAa,IAAI,WAAW,8CAA8C,sEAAc;AAC3G;AACA;AACA,mBAAmB,wDAAa,IAAI,WAAW,gDAAgD,sEAAc;AAC7G;AACA;AACA;AACA;AACA,qBAAqB,yEAAQ,GAAG,iCAAiC;AACjE;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AC7CgD;AACK;AACkE;AACtD;AACL;AACC;AACjB;AAC2B;AAChE,kCAAkC,6DAAiB;AAC1D;AACA;AACA,2EAA2E,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU;AAC1G;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,uCAAuC,iDAAU;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,mBAAmB,wDAAa,IAAI,WAAW,gDAAgD,sEAAc;AAC7G;AACA;AACA,kBAAkB,yEAAQ,wBAAwB,+EAAuB,GAAG,yBAAyB;AACrG,mBAAmB,wDAAa,IAAI,WAAW,sDAAsD,wEAAgB;AACrH;AACA;AACA,mBAAmB,wDAAa,IAAI,WAAW,0CAA0C,sEAAc;AACvG;AACA;AACA,mBAAmB,wDAAa,IAAI,WAAW,0CAA0C,oEAAY;AACrG;AACA;AACA,mBAAmB,wDAAa,IAAI,WAAW,qDAAqD,+EAAmB;AACvH;AACA;AACA,mBAAmB,iEAAgB,IAAI,WAAW;AAClD;AACA;AACA;AACA;AACA,qBAAqB,yEAAQ,GAAG,iCAAiC;AACjE;AACA;;;;;;;;;;;;;;;;;;;;;;;;ACjE0C;AACN;AACK;AACV;AAC/B;;;;;;;;;;;;;;;ACJO;AACP;AACA;AACO;AACP;AACA;AACA;;;;;;;;;;;;;;;;ACNsD;AACM;AACrD;AACP,8HAA8H,qEAAgB;AAC9I;AACA;AACA;AACA;AACA,yBAAyB,+DAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,+DAAe;AAClC;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AChD0D;AACb;AACtC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mDAAQ;AAClC;AACA;AACA;AACA;AACA,8DAA8D,sDAAW;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,mDAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA,4BAA4B,mDAAQ;AACpC;AACA;AACA;AACA;AACA;AACA,iDAAiD,QAAQ;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wDAAiB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACtI+C;AACQ;AAChD;AACP;AACA;AACA,oBAAoB,kCAAkC;AACtD;AACA;AACA;AACA;AACA;AACA,oBAAoB,6CAAM;AAC1B,oBAAoB,6CAAM;AAC1B,oBAAoB,6CAAM;AAC1B,oBAAoB,6CAAM;AAC1B;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,oBAAoB,yCAAyC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6CAAM;AAC1B,oBAAoB,6CAAM;AAC1B,oBAAoB,6CAAM;AAC1B,oBAAoB,6CAAM;AAC1B,oBAAoB,6CAAM;AAC1B,oBAAoB,6CAAM;AAC1B,oBAAoB,6CAAM;AAC1B,oBAAoB,6CAAM;AAC1B;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,yCAAyC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,2GAA2G,oEAAU;AACrH;AACA;AACA,iEAAiE,mDAAQ;AACzE;AACA;AACA;AACA;AACA,gCAAgC,6CAAM;AACtC,gCAAgC,6CAAM;AACtC;AACA;AACA;AACA;AACA,6DAA6D,mDAAQ;AACrE;AACA;AACA;AACA;AACA,gCAAgC,6CAAM;AACtC,gCAAgC,6CAAM;AACtC;AACA;AACA;AACA;AACA,6DAA6D,mDAAQ;AACrE;AACA;AACA;AACA;AACA,gCAAgC,6CAAM;AACtC,gCAAgC,6CAAM;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;AClGO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;;;;;;;;;;;;;;AC/BO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,YAAY;AACvE;AACA;AACA;AACA;AACA;AACA,0DAA0D,YAAY;AACtE;AACA;AACA;AACA;AACA;AACA,2DAA2D,YAAY;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,eAAe;AAC9E,+DAA+D,eAAe;AAC9E,2DAA2D,eAAe;AAC1E,mEAAmE,eAAe;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,EAAE;AAC9B,2BAA2B,EAAE;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,OAAO;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;ACnI8B;AACP;AACG;AACG;AAC7B;;;;;;;;;;;;;;;ACJO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC5BO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACLO;AACP;AACA,kBAAkB,KAAK,EAAE,yCAAyC,EAAE,OAAO;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACVsC;AAC/B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,+CAAU;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;UC/DA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNwB;AACI;AACG;AACC;AACE;AACD;AACL;AACC;AACE;AACD;AACA;AACA;AACA;AACF;AACL;AACA;AACvB,iC","sources":["webpack://SPACEXR/./dist/cache/cache.js","webpack://SPACEXR/./dist/cache/index.js","webpack://SPACEXR/./dist/collections/collection.js","webpack://SPACEXR/./dist/collections/orderedCollection.js","webpack://SPACEXR/./dist/dem/dem.helpers.js","webpack://SPACEXR/./dist/dem/dem.infos.js","webpack://SPACEXR/./dist/dem/dem.interfaces.js","webpack://SPACEXR/./dist/dem/dem.tileclient.js","webpack://SPACEXR/./dist/dem/index.js","webpack://SPACEXR/./dist/events/events.args.js","webpack://SPACEXR/./dist/events/events.emitter.js","webpack://SPACEXR/./dist/events/events.observable.js","webpack://SPACEXR/./dist/events/index.js","webpack://SPACEXR/./dist/geodesy/calculators/geodesy.calculator.flat.js","webpack://SPACEXR/./dist/geodesy/calculators/geodesy.calculator.spherical.js","webpack://SPACEXR/./dist/geodesy/calculators/index.js","webpack://SPACEXR/./dist/geodesy/geodesy.calculators.js","webpack://SPACEXR/./dist/geodesy/geodesy.ellipsoid.js","webpack://SPACEXR/./dist/geodesy/geodesy.scale.js","webpack://SPACEXR/./dist/geodesy/geodesy.system.js","webpack://SPACEXR/./dist/geodesy/index.js","webpack://SPACEXR/./dist/geography/geography.bearing.js","webpack://SPACEXR/./dist/geography/geography.envelope.collection.js","webpack://SPACEXR/./dist/geography/geography.envelope.js","webpack://SPACEXR/./dist/geography/geography.interfaces.js","webpack://SPACEXR/./dist/geography/geography.knownPlaces.js","webpack://SPACEXR/./dist/geography/geography.position.js","webpack://SPACEXR/./dist/geography/geography.projections.js","webpack://SPACEXR/./dist/geography/index.js","webpack://SPACEXR/./dist/geography/shapes/geography.line.js","webpack://SPACEXR/./dist/geography/shapes/geography.polygon.js","webpack://SPACEXR/./dist/geography/shapes/geography.polyline.js","webpack://SPACEXR/./dist/geography/shapes/geography.shape.js","webpack://SPACEXR/./dist/geography/shapes/geography.shapes.interfaces.js","webpack://SPACEXR/./dist/geography/shapes/index.js","webpack://SPACEXR/./dist/geometry/geometry.bounds.collection.js","webpack://SPACEXR/./dist/geometry/geometry.bounds.js","webpack://SPACEXR/./dist/geometry/geometry.cartesian.js","webpack://SPACEXR/./dist/geometry/geometry.convex.quickhull.js","webpack://SPACEXR/./dist/geometry/geometry.interfaces.js","webpack://SPACEXR/./dist/geometry/geometry.plane.cruncher.js","webpack://SPACEXR/./dist/geometry/geometry.simplify.js","webpack://SPACEXR/./dist/geometry/geometry.size.js","webpack://SPACEXR/./dist/geometry/index.js","webpack://SPACEXR/./dist/geometry/shapes/geometry.circle.js","webpack://SPACEXR/./dist/geometry/shapes/geometry.line.js","webpack://SPACEXR/./dist/geometry/shapes/geometry.point.js","webpack://SPACEXR/./dist/geometry/shapes/geometry.polygon.js","webpack://SPACEXR/./dist/geometry/shapes/geometry.polyline.js","webpack://SPACEXR/./dist/geometry/shapes/geometry.shape.js","webpack://SPACEXR/./dist/geometry/shapes/geometry.shapes.interfaces.js","webpack://SPACEXR/./dist/geometry/shapes/index.js","webpack://SPACEXR/./dist/io/webClient.js","webpack://SPACEXR/./dist/map/canvas/index.js","webpack://SPACEXR/./dist/map/canvas/map.canvas.display.js","webpack://SPACEXR/./dist/map/canvas/map.canvas.js","webpack://SPACEXR/./dist/map/canvas/map.context2d.js","webpack://SPACEXR/./dist/map/index.js","webpack://SPACEXR/./dist/map/inputs/index.js","webpack://SPACEXR/./dist/map/inputs/map.inputs.controller.drag.js","webpack://SPACEXR/./dist/map/inputs/map.inputs.controller.js","webpack://SPACEXR/./dist/map/inputs/map.inputs.controller.navigation.js","webpack://SPACEXR/./dist/map/inputs/map.inputs.controller.touch.js","webpack://SPACEXR/./dist/map/inputs/map.inputs.interfaces.hands.js","webpack://SPACEXR/./dist/map/inputs/map.inputs.interfaces.touch.js","webpack://SPACEXR/./dist/math/index.js","webpack://SPACEXR/./dist/math/math.color.js","webpack://SPACEXR/./dist/math/math.js","webpack://SPACEXR/./dist/math/math.units.js","webpack://SPACEXR/./dist/meshes/index.js","webpack://SPACEXR/./dist/meshes/terrain.grid.js","webpack://SPACEXR/./dist/space/Mechanics/index.js","webpack://SPACEXR/./dist/space/Mechanics/space.celestialTracker.js","webpack://SPACEXR/./dist/space/Mechanics/space.kepler.js","webpack://SPACEXR/./dist/space/index.js","webpack://SPACEXR/./dist/space/space.axialTilt.js","webpack://SPACEXR/./dist/space/space.interfaces.js","webpack://SPACEXR/./dist/space/space.spectralClass.js","webpack://SPACEXR/./dist/space/space.starColor.js","webpack://SPACEXR/./dist/text/index.js","webpack://SPACEXR/./dist/text/iso6391.js","webpack://SPACEXR/./dist/text/localizable.js","webpack://SPACEXR/./dist/tiles/3d/index.js","webpack://SPACEXR/./dist/tiles/3d/streaming/index.js","webpack://SPACEXR/./dist/tiles/3d/streaming/tile3d.streaming.engine.js","webpack://SPACEXR/./dist/tiles/3d/tile3d.interfaces.js","webpack://SPACEXR/./dist/tiles/3d/tile3d.node.js","webpack://SPACEXR/./dist/tiles/address/index.js","webpack://SPACEXR/./dist/tiles/address/tiles.address.js","webpack://SPACEXR/./dist/tiles/codecs/index.js","webpack://SPACEXR/./dist/tiles/codecs/tiles.codecs.canvas.js","webpack://SPACEXR/./dist/tiles/codecs/tiles.codecs.cartesian.js","webpack://SPACEXR/./dist/tiles/codecs/tiles.codecs.filter.js","webpack://SPACEXR/./dist/tiles/codecs/tiles.codecs.image.js","webpack://SPACEXR/./dist/tiles/codecs/tiles.codecs.interfaces.js","webpack://SPACEXR/./dist/tiles/codecs/tiles.codecs.js","webpack://SPACEXR/./dist/tiles/display/index.js","webpack://SPACEXR/./dist/tiles/display/tiles.display.js","webpack://SPACEXR/./dist/tiles/geography/index.js","webpack://SPACEXR/./dist/tiles/geography/tiles.geography.EPSG3857.js","webpack://SPACEXR/./dist/tiles/geography/tiles.geography.collection.js","webpack://SPACEXR/./dist/tiles/index.js","webpack://SPACEXR/./dist/tiles/map/index.js","webpack://SPACEXR/./dist/tiles/map/tiles.map.interfaces.js","webpack://SPACEXR/./dist/tiles/map/tiles.map.js","webpack://SPACEXR/./dist/tiles/map/tiles.map.layer.js","webpack://SPACEXR/./dist/tiles/map/tiles.map.layerView.js","webpack://SPACEXR/./dist/tiles/map/tiles.map.view.base.js","webpack://SPACEXR/./dist/tiles/map/tiles.map.view.js","webpack://SPACEXR/./dist/tiles/map/typed/index.js","webpack://SPACEXR/./dist/tiles/map/typed/tiles.map.layer.float32.js","webpack://SPACEXR/./dist/tiles/map/typed/tiles.map.layer.image.js","webpack://SPACEXR/./dist/tiles/map/typed/tiles.map.layer.vector.js","webpack://SPACEXR/./dist/tiles/navigation/index.js","webpack://SPACEXR/./dist/tiles/navigation/tiles.navigation.api.js","webpack://SPACEXR/./dist/tiles/navigation/tiles.navigation.interfaces.js","webpack://SPACEXR/./dist/tiles/navigation/tiles.navigation.state.camera.js","webpack://SPACEXR/./dist/tiles/navigation/tiles.navigation.state.js","webpack://SPACEXR/./dist/tiles/navigation/tiles.navigation.state.sync.js","webpack://SPACEXR/./dist/tiles/pipeline/index.js","webpack://SPACEXR/./dist/tiles/pipeline/tiles.pipeline.interfaces.js","webpack://SPACEXR/./dist/tiles/pipeline/tiles.pipeline.link.js","webpack://SPACEXR/./dist/tiles/pipeline/tiles.pipeline.sourceblock.js","webpack://SPACEXR/./dist/tiles/pipeline/tiles.pipeline.target.proxy.js","webpack://SPACEXR/./dist/tiles/providers/index.js","webpack://SPACEXR/./dist/tiles/providers/tiles.provider.abstract.js","webpack://SPACEXR/./dist/tiles/providers/tiles.provider.content.js","webpack://SPACEXR/./dist/tiles/providers/tiles.provider.js","webpack://SPACEXR/./dist/tiles/tiles.builder.js","webpack://SPACEXR/./dist/tiles/tiles.client.js","webpack://SPACEXR/./dist/tiles/tiles.collection.js","webpack://SPACEXR/./dist/tiles/tiles.interfaces.js","webpack://SPACEXR/./dist/tiles/tiles.js","webpack://SPACEXR/./dist/tiles/tiles.metrics.js","webpack://SPACEXR/./dist/tiles/tiles.system.js","webpack://SPACEXR/./dist/tiles/tiles.url.web.js","webpack://SPACEXR/./dist/tiles/vector/index.js","webpack://SPACEXR/./dist/tiles/vector/tiles.vector.interfaces.js","webpack://SPACEXR/./dist/tiles/vector/tiles.vector.renderer.js","webpack://SPACEXR/./dist/tiles/vector/tiles.vector.style.interface.js","webpack://SPACEXR/./dist/tiles/vendors/index.js","webpack://SPACEXR/./dist/tiles/vendors/tiles.vendors.google.js","webpack://SPACEXR/./dist/tiles/vendors/tiles.vendors.mapzen.js","webpack://SPACEXR/./dist/tree/index.js","webpack://SPACEXR/./dist/tree/tree.spatial.interfaces.js","webpack://SPACEXR/./dist/tree/tree.spatial.js","webpack://SPACEXR/./dist/tree/tree.spatial.node.js","webpack://SPACEXR/./dist/tree/tree.spatial.splitters.js","webpack://SPACEXR/./dist/types.js","webpack://SPACEXR/./dist/utils/debugtouch.js","webpack://SPACEXR/./dist/utils/index.js","webpack://SPACEXR/./dist/utils/objectpools.js","webpack://SPACEXR/./dist/utils/runtime.js","webpack://SPACEXR/./dist/utils/text.js","webpack://SPACEXR/./dist/validable.js","webpack://SPACEXR/webpack/bootstrap","webpack://SPACEXR/webpack/runtime/define property getters","webpack://SPACEXR/webpack/runtime/hasOwnProperty shorthand","webpack://SPACEXR/webpack/runtime/make namespace object","webpack://SPACEXR/./dist/index.js"],"sourcesContent":["export var EvictionReason;\n(function (EvictionReason) {\n    EvictionReason[EvictionReason[\"user\"] = 0] = \"user\";\n    EvictionReason[EvictionReason[\"expired\"] = 1] = \"expired\";\n})(EvictionReason || (EvictionReason = {}));\nexport class CachePolicyBuilder {\n    withSlidingExpiration(slidingExpiration) {\n        this._slidingExpiration = slidingExpiration;\n        return this;\n    }\n    withSlidingExpirationFromMinutes(slidingExpiration) {\n        this._slidingExpiration = slidingExpiration ? slidingExpiration * 60000 : slidingExpiration;\n        return this;\n    }\n    withSlidingExpirationFromSeconds(slidingExpiration) {\n        this._slidingExpiration = slidingExpiration ? slidingExpiration * 1000 : slidingExpiration;\n        return this;\n    }\n    withThreshold(threshold) {\n        this._threshold = threshold;\n        return this;\n    }\n    build() {\n        return new CachePolicy({ slidingExpiration: this._slidingExpiration, threshold: this._threshold });\n    }\n}\nexport class CachePolicy {\n    constructor(init) {\n        Object.assign(this, init);\n    }\n}\nCachePolicy.Default = new CachePolicyBuilder().withSlidingExpirationFromMinutes(5).withThreshold(100).build();\nexport class CacheEntryOptions {\n    constructor(init) {\n        Object.assign(this, init);\n    }\n    get slidingExpiration() {\n        return this._slidingExpiration;\n    }\n    set slidingExpiration(v) {\n        this._slidingExpiration = v;\n    }\n    get postEvictionCallback() {\n        return (this._callbacks = this._callbacks || []);\n    }\n    set postEvictionCallback(a) {\n        this._callbacks = a;\n    }\n}\nexport class CacheEntryOptionsBuilder {\n    withSlidingExpiration(slidingExpiration) {\n        this._slidingExpiration = slidingExpiration;\n        return this;\n    }\n    withSlidingExpirationFromMinutes(slidingExpiration) {\n        this._slidingExpiration = slidingExpiration ? slidingExpiration * 60000 : slidingExpiration;\n        return this;\n    }\n    withSlidingExpirationFromSeconds(slidingExpiration) {\n        this._slidingExpiration = slidingExpiration ? slidingExpiration * 1000 : slidingExpiration;\n        return this;\n    }\n    withPostEvictionCallbacks(..._callbacks) {\n        this._callbacks = this._callbacks || [];\n        this._callbacks.push(..._callbacks);\n        return this;\n    }\n    build() {\n        return new CacheEntryOptions({ slidingExpiration: this._slidingExpiration, postEvictionCallback: this._callbacks });\n    }\n}\nexport class CacheEntry {\n    constructor(key, value, options) {\n        this._options = options;\n        this._value = value;\n        this._lastAccess = Date.now();\n    }\n    get key() {\n        return this._key;\n    }\n    get value() {\n        this._lastAccess = Date.now();\n        return this._value;\n    }\n    set value(v) {\n        this._lastAccess = Date.now();\n        this._value = v;\n    }\n    get expiration() {\n        const se = this._options?._slidingExpiration;\n        if (!this._lastAccess || !se) {\n            return Infinity;\n        }\n        return this._lastAccess + se;\n    }\n    *postEvictionCallback() {\n        return this._options?._callbacks;\n    }\n}\nexport class MemoryCache {\n    constructor(policy) {\n        this._count = 0;\n        this._policy = { ...CachePolicy.Default, ...policy };\n        this._cache = new Map();\n        this._gc = this.gc.bind(this);\n    }\n    contains(key) {\n        return this._cache.has(key);\n    }\n    get(key) {\n        const e = this._cache.get(key);\n        if (e) {\n            const v = e.value;\n            this.sortList(e);\n            return v;\n        }\n        return undefined;\n    }\n    set(key, value, options) {\n        const o = { ...{ slidingExpiration: this._policy.slidingExpiration }, ...options };\n        let e = this._cache.get(key);\n        if (!e) {\n            e = new CacheEntry(key, value, o);\n            this._cache.set(key, e);\n        }\n        else {\n            e.value = value;\n        }\n        this.sortList(e);\n        return;\n    }\n    delete(key) {\n        const e = this._cache.get(key);\n        if (e) {\n            const isHead = e === this._head;\n            this.removeNode(e);\n            this._cache.delete(key);\n            for (const cb of e.postEvictionCallback()) {\n                cb(e, EvictionReason.user);\n            }\n            if (isHead) {\n                this.updateTimer();\n            }\n        }\n    }\n    keys() {\n        return this._cache.keys();\n    }\n    clear(predicate) {\n        const keys = [...this._cache.keys()];\n        for (const k of keys) {\n            if (predicate && predicate(k)) {\n                this.delete(k);\n            }\n        }\n    }\n    any(predicate) {\n        if (!predicate)\n            return true;\n        const keys = [...this._cache.keys()];\n        for (const k of keys) {\n            if (predicate(k)) {\n                return true;\n            }\n        }\n        return false;\n    }\n    dispose() {\n        if (this._timer) {\n            clearTimeout(this._timer);\n            this._timer = undefined;\n        }\n        this.clear();\n    }\n    gc() {\n        const now = Date.now();\n        const threshold = this._policy.threshold || 0;\n        if (this._head && this._head.expiration <= now) {\n            do {\n                const tmp = this._head;\n                this.removeNode(tmp);\n                this._cache.delete(tmp.key);\n                for (const cb of tmp.postEvictionCallback()) {\n                    cb(tmp, EvictionReason.expired);\n                }\n            } while (this._head && this._head.expiration - threshold <= now);\n        }\n        this.updateTimer();\n    }\n    updateTimer() {\n        if (this._head) {\n            const delay = this._head.expiration - Date.now();\n            if (this._timer) {\n                clearTimeout(this._timer);\n            }\n            this._timer = setTimeout(this._gc, delay);\n        }\n        else {\n            this._timer = undefined;\n        }\n    }\n    sortList(e) {\n        if (e) {\n            const head = this._head;\n            try {\n                if (!e._next && !e._prev) {\n                    this.insertLast(e);\n                }\n                const value = e.expiration;\n                let n = e._prev;\n                if (n && n.expiration > value) {\n                    this.removeNode(e);\n                    do {\n                        n = n._prev;\n                    } while (n && n.expiration > value);\n                    if (n) {\n                        this.insertAfter(e, n);\n                        return;\n                    }\n                    this.insertFirst(e);\n                    return;\n                }\n                n = e._next;\n                if (n && n.expiration < value) {\n                    this.removeNode(e);\n                    do {\n                        n = n._next;\n                    } while (n && n.expiration < value);\n                    if (n) {\n                        this.insertBefore(e, n);\n                    }\n                    else {\n                        this.insertLast(e);\n                    }\n                }\n            }\n            finally {\n                if (this._head && this._head !== head) {\n                    const delay = this._head.expiration - Date.now();\n                    if (this._timer) {\n                        clearTimeout(this._timer);\n                    }\n                    this._timer = setTimeout(this._gc, delay);\n                }\n            }\n        }\n    }\n    removeNode(e) {\n        if (e._next) {\n            e._next._prev = e._prev;\n        }\n        if (e._prev) {\n            e._prev._next = e._next;\n        }\n        if (this._head === e) {\n            this._head = e._next;\n        }\n        if (this._tail === e) {\n            this._tail = e._prev;\n        }\n        e._next = e._prev = undefined;\n        this._count--;\n    }\n    insertFirst(node) {\n        if (!this._tail) {\n            this._tail = node;\n        }\n        if (this._head) {\n            this._head._prev = node;\n            node._next = this._head;\n        }\n        this._head = node;\n        this._count++;\n    }\n    insertLast(node) {\n        if (!this._head) {\n            this._head = node;\n        }\n        if (this._tail) {\n            this._tail._next = node;\n            node._prev = this._tail;\n        }\n        this._tail = node;\n        this._count++;\n    }\n    insertAfter(node, referenceNode) {\n        if (!referenceNode._next) {\n            this._tail = node;\n        }\n        if (referenceNode._next) {\n            referenceNode._next._prev = node;\n            node._next = referenceNode._next;\n        }\n        referenceNode._next = node;\n        node._prev = referenceNode;\n        this._count++;\n    }\n    insertBefore(node, referenceNode) {\n        if (!referenceNode._prev) {\n            this._head = node;\n        }\n        if (referenceNode._prev) {\n            referenceNode._prev._next = node;\n            node._prev = referenceNode._prev;\n        }\n        referenceNode._prev = node;\n        node._next = referenceNode;\n        this._count++;\n    }\n}\n//# sourceMappingURL=cache.js.map","export * from \"./cache\";\n//# sourceMappingURL=index.js.map","import { Observable } from \"../events\";\nimport { isValidable } from \"../types\";\nimport { ValidableBase } from \"../validable\";\nexport class Collection extends ValidableBase {\n    static Empty() {\n        return new Collection();\n    }\n    constructor(...items) {\n        super();\n        this._items = Array.from(items);\n    }\n    get addedObservable() {\n        if (!this._addedObservable) {\n            this._addedObservable = new Observable();\n        }\n        return this._addedObservable;\n    }\n    get removedObservable() {\n        if (!this._removedObservable) {\n            this._removedObservable = new Observable();\n        }\n        return this._removedObservable;\n    }\n    get count() {\n        return this._items.length;\n    }\n    *get(predicate, sorted) {\n        for (const l of this._items ?? []) {\n            if (!predicate || predicate(l))\n                yield l;\n        }\n    }\n    add(...item) {\n        const added = this._addInternal(item);\n        if (added?.length) {\n            if (this._addedObservable && this._addedObservable.hasObservers()) {\n                this._addedObservable.notifyObservers(added, -1, this, this);\n            }\n            this.invalidate();\n        }\n    }\n    remove(...item) {\n        const removed = this._removeInternal(item);\n        if (removed?.length) {\n            if (this._removedObservable && this._removedObservable.hasObservers()) {\n                this._removedObservable.notifyObservers(removed, -1, this, this);\n            }\n            this.invalidate();\n        }\n    }\n    clear() {\n        if (this._items) {\n            const toRemove = Array.from(this._items);\n            for (const l of toRemove) {\n                this.remove(l);\n            }\n        }\n    }\n    dispose() {\n        this.clear();\n        this._addedObservable?.clear();\n        this._removedObservable?.clear();\n    }\n    [Symbol.iterator]() {\n        let pointer = 0;\n        let items = this._items;\n        const iterator = {\n            next() {\n                if (pointer < items.length) {\n                    return {\n                        done: false,\n                        value: items[pointer++],\n                    };\n                }\n                return {\n                    done: true,\n                    value: null,\n                };\n            },\n            [Symbol.iterator]() {\n                return this;\n            },\n        };\n        return iterator;\n    }\n    get isValid() {\n        if (!super.isValid) {\n            return false;\n        }\n        return (this._items.every((l) => {\n            if (isValidable(l)) {\n                return l.isValid;\n            }\n            return true;\n        }) ?? true);\n    }\n    _doValidate() {\n        for (const i of this._items) {\n            if (isValidable(i)) {\n                i.validate();\n            }\n        }\n    }\n    _addInternal(items) {\n        this._items.push(...items);\n        return items;\n    }\n    _removeInternal(items) {\n        let removed = [];\n        for (const item of items) {\n            const i = this._items.indexOf(item);\n            if (i >= 0) {\n                removed.push(...this._items.splice(i, 1));\n            }\n        }\n        return removed;\n    }\n}\n//# sourceMappingURL=collection.js.map","import { Collection } from \"./collection\";\nexport class OrderedCollection extends Collection {\n    constructor(...items) {\n        super(...items);\n        this._weightCallback = this._onWeightChanged;\n    }\n    _addInternal(items) {\n        const inserted = this._insertInternal(items);\n        if (inserted?.length) {\n            for (const i of inserted) {\n                i.weightChangedObservable?.add(this._weightCallback, -1, false, this, false);\n            }\n        }\n        return inserted;\n    }\n    _insertInternal(items) {\n        if (!items) {\n            return [];\n        }\n        for (const item of items) {\n            let index = this._items.findIndex((item) => (item.weight ?? 0) > (item.weight ?? 0));\n            if (index === -1) {\n                this._items.push(item);\n            }\n            else {\n                this._items.splice(index, 0, item);\n            }\n        }\n        return items;\n    }\n    _removeInternal(items) {\n        const removed = super._removeInternal(items);\n        if (removed?.length) {\n            for (const i of removed) {\n                i.weightChangedObservable?.removeCallback(this._weightCallback, this);\n            }\n        }\n        return removed;\n    }\n    _onWeightChanged(eventData, eventState) {\n        const item = eventData;\n        if (item) {\n            const inserted = this._insertInternal(super._removeInternal([item]));\n            if (inserted?.length) {\n                this.invalidate();\n            }\n        }\n    }\n}\n//# sourceMappingURL=orderedCollection.js.map","export class ElevationHelpers {\n    static _cubicInterpolate(v0, v1, v2, v3, t) {\n        return v1 + 0.5 * t * (v2 - v0 + t * (2 * v0 - 5 * v1 + 4 * v2 - v3 + t * (3 * (v1 - v2) + v3 - v0)));\n    }\n    static getSafeElevation(elevations, w, h, xi, yi) {\n        const clampedX = Math.min(Math.max(0, xi), w - 1);\n        const clampedY = Math.min(Math.max(0, yi), h - 1);\n        return elevations[clampedX + clampedY * w];\n    }\n    static GetElevationBilinear(elevations, w, h, xNorm, yNorm) {\n        const x = xNorm * (w - 1);\n        const y = yNorm * (h - 1);\n        const x0 = Math.floor(x);\n        const y0 = Math.floor(y);\n        const x1 = Math.min(x0 + 1, w - 1);\n        const y1 = Math.min(y0 + 1, h - 1);\n        const q11 = elevations[x0 + y0 * w];\n        const q21 = elevations[x1 + y0 * w];\n        const q12 = elevations[x0 + y1 * w];\n        const q22 = elevations[x1 + y1 * w];\n        const dx = x - x0;\n        const dy = y - y0;\n        const r1 = q11 * (1 - dx) + q21 * dx;\n        const r2 = q12 * (1 - dx) + q22 * dx;\n        return r1 * (1 - dy) + r2 * dy;\n    }\n    static GetElevationCubic(elevations, w, h, xNorm, yNorm) {\n        const x = xNorm * (w - 1);\n        const y = yNorm * (h - 1);\n        const x0 = Math.floor(x);\n        const y0 = Math.floor(y);\n        const dx = x - x0;\n        const dy = y - y0;\n        const values = [];\n        for (let j = -1; j <= 2; j++) {\n            const row = [];\n            for (let i = -1; i <= 2; i++) {\n                row.push(ElevationHelpers.getSafeElevation(elevations, w, h, x0 + i, y0 + j));\n            }\n            values.push(row);\n        }\n        const interpolatedRows = values.map((row) => ElevationHelpers._cubicInterpolate(row[0], row[1], row[2], row[3], dx));\n        return ElevationHelpers._cubicInterpolate(interpolatedRows[0], interpolatedRows[1], interpolatedRows[2], interpolatedRows[3], dy);\n    }\n    static GetLastColumn(elevations, w, h) {\n        const lastColumn = new elevations.constructor(h);\n        for (let i = 0, w1 = w - 1; i < h; i++, w1 += w) {\n            lastColumn[i] = elevations[w1];\n        }\n        return lastColumn;\n    }\n    static GetLastRow(elevations, w, h) {\n        const startIndex = (h - 1) * w;\n        return new elevations.constructor(elevations.buffer, elevations.byteOffset + startIndex * elevations.BYTES_PER_ELEMENT, w);\n    }\n    static GetFirstColumn(elevations, w, h, duplicateFirst = false) {\n        const firstColumn = new elevations.constructor(h + (duplicateFirst ? 1 : 0));\n        for (let i = 0; i < h; i++) {\n            firstColumn[i] = elevations[i * w];\n        }\n        if (duplicateFirst) {\n            firstColumn[h] = firstColumn[h - 1];\n        }\n        return firstColumn;\n    }\n    static GetFirstRow(elevations, w) {\n        return new elevations.constructor(elevations.buffer, elevations.byteOffset, w);\n    }\n    static GetElevationAt(elevations, w, h, x, y) {\n        if (x < 0 || x >= w || y < 0 || y >= h) {\n            throw new Error(\"Coordinates out of bounds\");\n        }\n        const index = x + y * w;\n        const target = new elevations.constructor(1);\n        target[0] = elevations[index];\n        return target;\n    }\n    static GetColumn(elevations, w, h, colIndex) {\n        const column = new elevations.constructor(h);\n        for (let i = 0; i < h; i++) {\n            column[i] = elevations[colIndex + i * w];\n        }\n        return column;\n    }\n    static GetRow(elevations, w, rowIndex) {\n        const startIndex = rowIndex * w;\n        const endIndex = startIndex + w;\n        if (startIndex < 0 || endIndex > elevations.length) {\n            throw new Error(\"Row index out of bounds\");\n        }\n        return new elevations.constructor(elevations.buffer, elevations.byteOffset + startIndex * elevations.BYTES_PER_ELEMENT, w);\n    }\n    static GetArea(elevations, w, h, startX, startY, areaWidth, areaHeight) {\n        if (startX < 0 || startY < 0 || startX + areaWidth > w || startY + areaHeight > h) {\n            throw new Error(\"Specified area is out of bounds.\");\n        }\n        const area = new elevations.constructor(areaWidth * areaHeight);\n        for (let y = 0; y < areaHeight; y++) {\n            const sourceStart = (startY + y) * w + startX;\n            const destStart = y * areaWidth;\n            area.set(elevations.subarray(sourceStart, sourceStart + areaWidth), destStart);\n        }\n        return area;\n    }\n    static CompareElevations(array1, array2, epsilon) {\n        if (array1.length !== array2.length) {\n            return false;\n        }\n        for (let i = 0; i < array1.length; i++) {\n            if (Math.abs(array1[i] - array2[i]) > epsilon) {\n                return false;\n            }\n        }\n        return true;\n    }\n    static GetElevationsBetween(elevations, w, h, x1Norm, y1Norm, x2Norm, y2Norm, steps) {\n        const result = new elevations.constructor(steps);\n        const dxNorm = (x2Norm - x1Norm) / (steps - 1);\n        const dyNorm = (y2Norm - y1Norm) / (steps - 1);\n        for (let i = 0; i < steps; i++) {\n            const xNorm = x1Norm + dxNorm * i;\n            const yNorm = y1Norm + dyNorm * i;\n            result[i] = ElevationHelpers.GetElevationBilinear(elevations, w, h, xNorm, yNorm);\n        }\n        return result;\n    }\n    static Normalize(elevations, minRange = 0, maxRange = 1) {\n        const minValue = Math.min(...elevations);\n        const maxValue = Math.max(...elevations);\n        if (minValue === maxValue) {\n            throw new Error(\"Normalization is not possible when all values are identical.\");\n        }\n        const normalized = new elevations.constructor(elevations.length);\n        const scale = (maxRange - minRange) / (maxValue - minValue);\n        for (let i = 0; i < elevations.length; i++) {\n            normalized[i] = minRange + (elevations[i] - minValue) * scale;\n        }\n        return normalized;\n    }\n}\n//# sourceMappingURL=dem.helpers.js.map","import { Cartesian3 } from \"../geometry/geometry.cartesian\";\nexport class DemInfos {\n    static GetVector(z, i, stride) {\n        const y = Math.floor(i / stride);\n        const x = i - y * stride;\n        return new Cartesian3(x, y, z);\n    }\n    constructor(elevations, normals = null, stride, pos, size) {\n        this._max = Cartesian3.Zero();\n        this._min = Cartesian3.Zero();\n        this._delta = 0;\n        this._mean = 0;\n        this._elevations = null;\n        this._normals = null;\n        this._stride = 0;\n        this._elevations = elevations;\n        this._normals = normals;\n        if (this._elevations) {\n            const length = this._elevations?.length;\n            this._stride = stride || Math.sqrt(length);\n            let min = Number.MAX_SAFE_INTEGER;\n            let max = Number.MIN_SAFE_INTEGER;\n            let mean = -this._elevations[0] / length;\n            let mini = 0;\n            let maxi = 0;\n            const x0 = pos?.x || 0;\n            const x1 = x0 + (size?.width || this._stride);\n            const y0 = pos?.y || 0;\n            const y1 = y0 + (size?.height || this._stride);\n            for (let y = y0; y < y1; y++) {\n                const j = y * this._stride;\n                for (let x = x0; x < x1; x++) {\n                    const i = j + x;\n                    const z = this._elevations[i];\n                    if (z < min) {\n                        min = z;\n                        mini = i;\n                    }\n                    else if (z > max) {\n                        max = z;\n                        maxi = i;\n                    }\n                    mean += z / length;\n                }\n            }\n            this._max = DemInfos.GetVector(max, maxi, this._stride);\n            this._min = DemInfos.GetVector(min, mini, this._stride);\n            this._delta = this._max.z - this._min.z;\n            this._mean = mean;\n        }\n    }\n    get max() {\n        return this._max;\n    }\n    get min() {\n        return this._min;\n    }\n    get delta() {\n        return this._delta;\n    }\n    get mean() {\n        return this._mean;\n    }\n    get elevations() {\n        return this._elevations;\n    }\n    get normals() {\n        return this._normals;\n    }\n    toString() {\n        return `elevations count:${this._elevations?.length || 0}, min:{${this._min.toString()}}, max:{${this._max.toString()}}, delta:${this._delta}, mean:${this._mean}}`;\n    }\n    getDemInfoView(pos, size) {\n        return new DemInfos(this._elevations, this._normals, this._stride, pos, size);\n    }\n}\n//# sourceMappingURL=dem.infos.js.map","export function IsDemInfos(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return b.getDemInfoView !== undefined;\n}\n//# sourceMappingURL=dem.interfaces.js.map","import { DemInfos } from \"./dem.infos\";\nimport { FetchResult } from \"../io\";\nexport class DemTileWebClient {\n    constructor(name, elevationSrc, normalSrc) {\n        this._zindex = 0;\n        this._name = name;\n        this._elevationsDataSource = elevationSrc;\n        this._normalsDataSource = normalSrc;\n    }\n    get name() {\n        return this._name;\n    }\n    get zindex() {\n        return this._zindex;\n    }\n    set zindex(v) {\n        this._zindex = v;\n    }\n    get metrics() {\n        return this._elevationsDataSource.metrics;\n    }\n    async fetchAsync(request, env, ...userArgs) {\n        const requests = [];\n        requests.push(this._elevationsDataSource.fetchAsync(request, env, ...userArgs));\n        if (this._normalsDataSource) {\n            requests.push(this._normalsDataSource.fetchAsync(request, env, ...userArgs));\n        }\n        const results = await Promise.allSettled(requests);\n        let elevations = null;\n        let normals = null;\n        if (results[0].status == \"fulfilled\") {\n            elevations = results[0].value.content;\n        }\n        else {\n            throw new Error(results[0].reason);\n        }\n        if (elevations == null) {\n            return new FetchResult(request, null, userArgs);\n        }\n        if (results.length > 1) {\n            if (results[1].status == \"fulfilled\") {\n                normals = results[1].value.content;\n            }\n        }\n        if (normals == null) {\n            const s = this.metrics.tileSize;\n            normals = this.computeNormals(elevations, s, s);\n        }\n        const result = new FetchResult(request, new DemInfos(elevations, normals), userArgs);\n        result.ok = true;\n        return result;\n    }\n    computeNormals(positions, w, h) {\n        const normals = new Uint8ClampedArray(w * h * 3);\n        const indices = [0, 3, 6, 15, 24, 21, 18, 9];\n        let i = 0;\n        for (let row = 0; row < w; row++) {\n            for (let col = 0; col < h; col++) {\n                let nx = 0;\n                let ny = 0;\n                let nz = 0;\n                let nn = 0;\n                const v = this.getNormalsWindows(positions, row, col, w, h);\n                let k = indices[0];\n                let a1 = v[k++];\n                let a2 = v[k++];\n                let a3 = v[k];\n                for (let i = 1; i < indices.length; i++) {\n                    k = indices[i];\n                    const b1 = v[k++];\n                    const b2 = v[k++];\n                    const b3 = v[k];\n                    if (a3 !== undefined && b3 !== undefined) {\n                        const na = a2 * b3 - a3 * b2;\n                        const nb = a3 * b1 - a1 * b3;\n                        const nc = a1 * b2 - a2 * b1;\n                        nx += na;\n                        ny += nb;\n                        nz += nc;\n                        nn++;\n                    }\n                    a1 = b1;\n                    a2 = b2;\n                    a3 = b3;\n                }\n                const x = nx / nn;\n                const y = ny / nn;\n                const z = nz / nn;\n                const l = Math.sqrt(x * x + y * y + z * z);\n                const R = ((x / l + 1) / 2) * 255;\n                const G = ((y / l + 1) / 2) * 255;\n                const B = (z / l) * 127 + 128;\n                normals[i++] = R;\n                normals[i++] = G;\n                normals[i++] = B;\n            }\n        }\n        return normals;\n    }\n    getNormalsWindows(positions, i, j, w, h) {\n        let index = (i * w + j) * 3;\n        const xref = positions[index++];\n        const yref = positions[index++];\n        const zref = positions[index];\n        const windows = new Array(27);\n        const startRow = i - 1;\n        const endRow = i + 1;\n        const startCol = j - 1;\n        const endCol = j + 1;\n        let k = 0;\n        for (let row = startRow; row <= endRow; row++) {\n            const offset = row * w;\n            for (let col = startCol; col <= endCol; col++) {\n                index = (offset + col) * 3;\n                let dx = col < 0 ? undefined : col >= w ? undefined : positions[index] - xref;\n                let dy = row < 0 ? undefined : row >= h ? undefined : positions[index + 1] - yref;\n                let dz = dx === undefined || dy === undefined ? undefined : positions[index + 2] - zref;\n                windows[k++] = dx;\n                windows[k++] = dy;\n                windows[k++] = dz;\n            }\n        }\n        return windows;\n    }\n}\n//# sourceMappingURL=dem.tileclient.js.map","export * from \"./dem.interfaces\";\nexport * from \"./dem.infos\";\nexport * from \"./dem.tileclient\";\nexport * from \"./dem.helpers\";\n//# sourceMappingURL=index.js.map","export class EventArgs {\n    constructor(source) {\n        this._source = source;\n    }\n    get source() {\n        return this._source;\n    }\n}\nexport class PropertyChangedEventArgs extends EventArgs {\n    constructor(source, oldValue, newValue, propertyName) {\n        super(source);\n        this._propertyName = propertyName;\n        this._oldValue = oldValue;\n        this._newValue = newValue;\n    }\n    get propertyName() {\n        return this._propertyName;\n    }\n    get oldValue() {\n        return this._oldValue;\n    }\n    get newValue() {\n        return this._newValue;\n    }\n    get source() {\n        return this._source;\n    }\n}\n//# sourceMappingURL=events.args.js.map","export class EventEmitter {\n    constructor(maxListeners = EventEmitter.defaultMaxListeners) {\n        this._events = new Map();\n        this._maxListeners = maxListeners;\n    }\n    addListener(eventName, listener) {\n        return this.on(eventName, listener);\n    }\n    on(eventName, listener) {\n        this._registerEvent(eventName, listener, false);\n        return this;\n    }\n    once(eventName, listener) {\n        this._registerEvent(eventName, listener, true);\n        return this;\n    }\n    emit(eventName, ...args) {\n        const listeners = this._events.get(eventName);\n        const listenerCount = this.listenerCount(eventName);\n        if (listeners) {\n            listeners.map((listener) => listener(...args));\n        }\n        return listenerCount === 0 ? false : true;\n    }\n    eventNames() {\n        return Array.from(this._events.keys());\n    }\n    getMaxListeners() {\n        return this._maxListeners === null ? EventEmitter.defaultMaxListeners : this._maxListeners;\n    }\n    setMaxListeners(limit) {\n        this._maxListeners = limit;\n        return this;\n    }\n    listeners(eventName) {\n        return this._events.get(eventName);\n    }\n    listenerCount(eventName) {\n        const event = this._events.get(eventName);\n        return event === undefined ? 0 : event.length;\n    }\n    removeAllListeners(eventNames) {\n        if (!eventNames) {\n            eventNames = Array.from(this._events.keys());\n        }\n        eventNames.forEach((eventName) => this._events.delete(eventName));\n        return this;\n    }\n    removeListener(eventName, listener) {\n        if (this.listeners) {\n            const l = this.listeners(eventName);\n            if (l) {\n                const listeners = l.filter((item) => listener === undefined || listener === null || item === listener);\n                this._events.set(eventName, listeners);\n            }\n        }\n        return this;\n    }\n    _registerEvent(eventName, listener, type) {\n        if (this._ListenerLimitReached(eventName)) {\n            console.log(\"Maximum listener reached, new Listener not added\");\n            return;\n        }\n        if (type === true) {\n            listener = this._createOnceListener(listener, eventName);\n        }\n        const listeners = this._createListeners(listener, this.listeners(eventName));\n        this._events.set(eventName, listeners);\n        return;\n    }\n    _createListeners(listener, listeners) {\n        if (!listeners) {\n            listeners = new Array();\n        }\n        listeners.push(listener);\n        return listeners;\n    }\n    _createOnceListener(listener, eventName) {\n        const newListener = (...args) => {\n            this.removeListener(eventName, listener);\n            return listener(...args);\n        };\n        return newListener;\n    }\n    _ListenerLimitReached(eventName) {\n        return this.listenerCount(eventName) === this.getMaxListeners() ? true : false;\n    }\n}\nEventEmitter.defaultMaxListeners = 100;\n//# sourceMappingURL=events.emitter.js.map","export class EventState {\n    constructor(mask, skipNextObservers = false, target, currentTarget) {\n        this.initialize(mask, skipNextObservers, target, currentTarget);\n    }\n    initialize(mask, skipNextObservers = false, target, currentTarget) {\n        this.mask = mask;\n        this.skipNextObservers = skipNextObservers;\n        this.target = target;\n        this.currentTarget = currentTarget;\n        return this;\n    }\n}\nexport class Observer {\n    constructor(source, callback, mask, scope = null) {\n        this.source = source;\n        this.callback = callback;\n        this.mask = mask;\n        this.scope = scope;\n        this._willBeUnregistered = false;\n        this.unregisterOnNextCall = false;\n    }\n    disconnect() {\n        this.source?.remove(this);\n    }\n}\nexport class Observable {\n    static FromPromise(promise, onErrorObservable) {\n        const observable = new Observable();\n        promise\n            .then((ret) => {\n            observable.notifyObservers(ret);\n        })\n            .catch((err) => {\n            if (onErrorObservable) {\n                onErrorObservable.notifyObservers(err);\n            }\n            else {\n                throw err;\n            }\n        });\n        return observable;\n    }\n    get observers() {\n        return this._observers;\n    }\n    constructor(onObserverAdded) {\n        this._observers = new Array();\n        this._eventState = new EventState(0);\n        if (onObserverAdded) {\n            this._onObserverAdded = onObserverAdded;\n        }\n    }\n    add(callback, mask = -1, insertFirst = false, scope = null, unregisterOnFirstCall = false) {\n        if (!callback) {\n            return null;\n        }\n        const observer = new Observer(this, callback, mask, scope);\n        observer.unregisterOnNextCall = unregisterOnFirstCall;\n        if (insertFirst) {\n            this._observers.unshift(observer);\n        }\n        else {\n            this._observers.push(observer);\n        }\n        if (this._onObserverAdded) {\n            this._onObserverAdded(observer);\n        }\n        return observer;\n    }\n    addOnce(callback) {\n        return this.add(callback, undefined, undefined, undefined, true);\n    }\n    remove(observer) {\n        if (!observer) {\n            return false;\n        }\n        const index = this._observers.indexOf(observer);\n        if (index !== -1) {\n            this._deferUnregister(observer);\n            return true;\n        }\n        return false;\n    }\n    removeCallback(callback, scope) {\n        for (let index = 0; index < this._observers.length; index++) {\n            const observer = this._observers[index];\n            if (observer._willBeUnregistered) {\n                continue;\n            }\n            if (observer.callback === callback && (!scope || scope === observer.scope)) {\n                this._deferUnregister(observer);\n                return true;\n            }\n        }\n        return false;\n    }\n    _deferUnregister(observer) {\n        observer.unregisterOnNextCall = false;\n        observer._willBeUnregistered = true;\n        setTimeout(() => {\n            this._remove(observer);\n        }, 0);\n    }\n    _remove(observer) {\n        if (!observer) {\n            return false;\n        }\n        const index = this._observers.indexOf(observer);\n        if (index !== -1) {\n            this._observers.splice(index, 1);\n            return true;\n        }\n        return false;\n    }\n    makeObserverTopPriority(observer) {\n        this._remove(observer);\n        this._observers.unshift(observer);\n    }\n    makeObserverBottomPriority(observer) {\n        this._remove(observer);\n        this._observers.push(observer);\n    }\n    notifyObservers(eventData, mask = -1, target, currentTarget, userInfo) {\n        if (!this._observers.length) {\n            return true;\n        }\n        const state = this._eventState;\n        state.mask = mask;\n        state.target = target;\n        state.currentTarget = currentTarget;\n        state.skipNextObservers = false;\n        state.lastReturnValue = eventData;\n        state.userInfo = userInfo;\n        for (const obs of this._observers) {\n            if (obs._willBeUnregistered) {\n                continue;\n            }\n            if (obs.mask & mask) {\n                if (obs.scope) {\n                    state.lastReturnValue = obs.callback.apply(obs.scope, [eventData, state]);\n                }\n                else {\n                    state.lastReturnValue = obs.callback(eventData, state);\n                }\n                if (obs.unregisterOnNextCall) {\n                    this._deferUnregister(obs);\n                }\n            }\n            if (state.skipNextObservers) {\n                return false;\n            }\n        }\n        return true;\n    }\n    notifyObserver(observer, eventData, mask = -1) {\n        if (observer._willBeUnregistered) {\n            return;\n        }\n        const state = this._eventState;\n        state.mask = mask;\n        state.skipNextObservers = false;\n        observer.callback(eventData, state);\n        if (observer.unregisterOnNextCall) {\n            this._deferUnregister(observer);\n        }\n    }\n    hasObservers() {\n        return this._observers.length > 0;\n    }\n    clear() {\n        this._observers = new Array();\n        this._onObserverAdded = null;\n    }\n    clone() {\n        const result = new Observable();\n        result._observers = this._observers.slice(0);\n        return result;\n    }\n    hasSpecificMask(mask = -1) {\n        for (const obs of this._observers) {\n            if (obs.mask & mask || obs.mask === mask) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n//# sourceMappingURL=events.observable.js.map","export * from \"./events.emitter\";\nexport * from \"./events.interfaces\";\nexport * from \"./events.observable\";\nexport * from \"./events.args\";\n//# sourceMappingURL=index.js.map","import { Geo2 } from \"../../geography\";\nimport { Scalar } from \"../../math\";\nimport { CalculatorBase } from \"../geodesy.calculators\";\nexport class PythagoreanFlatEarthCalculator extends CalculatorBase {\n    constructor(e) {\n        super(e);\n    }\n    getDistanceFromFloat(lata, lona, latb, lonb, alta, altb, deg) {\n        if (lata === latb && lona === lonb) {\n            return 0;\n        }\n        if (deg) {\n            lata *= Scalar.DEG2RAD;\n            lona *= Scalar.DEG2RAD;\n            latb *= Scalar.DEG2RAD;\n            lonb *= Scalar.DEG2RAD;\n        }\n        const a = Math.PI / 2 - lata;\n        const b = Math.PI / 2 - latb;\n        const c = Math.sqrt(a * a + b * b - 2 * a * b * Math.cos(lona - lonb));\n        let distance = this._ellipsoid.semiMajorAxis * c;\n        return distance;\n    }\n    getAzimuthFromFloat(lat1, lon1, lat2, lon2, deg) {\n        if (lat1 === lat2 && lon1 === lon2) {\n            return 0;\n        }\n        if (deg) {\n            lat1 *= Scalar.DEG2RAD;\n            lon1 *= Scalar.DEG2RAD;\n            lat2 *= Scalar.DEG2RAD;\n            lon2 *= Scalar.DEG2RAD;\n        }\n        const dLon = lon2 - lon1;\n        const dLat = lat2 - lat1;\n        let azimuth = Math.atan2(dLon, dLat);\n        if (azimuth < 0) {\n            azimuth += Scalar.PI_2;\n        }\n        if (deg) {\n            azimuth *= Scalar.RAD2DEG;\n        }\n        return azimuth;\n    }\n    getLocationAtDistanceAzimuth(lat1, lon1, dist, az, deg) {\n        const unit2deg = 1 / (((2 * Math.PI) / 360) * this._ellipsoid.semiMajorAxis);\n        if (deg) {\n            az *= Scalar.DEG2RAD;\n            lat1 *= Scalar.DEG2RAD;\n            lon1 *= Scalar.DEG2RAD;\n        }\n        let newLat = lat1 + dist * Math.cos(az) * unit2deg;\n        let newLon = lon1 + (dist * Math.sin(az) * unit2deg) / Math.cos(lat1);\n        if (deg) {\n            newLat *= Scalar.RAD2DEG;\n            newLon *= Scalar.RAD2DEG;\n        }\n        return new Geo2(newLat, newLon);\n    }\n}\nPythagoreanFlatEarthCalculator.Shared = new PythagoreanFlatEarthCalculator();\n//# sourceMappingURL=geodesy.calculator.flat.js.map","import { Geo2 } from \"../../geography\";\nimport { Scalar } from \"../../math\";\nimport { CalculatorBase } from \"../geodesy.calculators\";\nexport class SphericalCalculator extends CalculatorBase {\n    constructor(e) {\n        super(e);\n    }\n    getDistanceFromFloat(lata, lona, latb, lonb, alta, altb, deg) {\n        if (lata === latb && lona === lonb && alta === altb) {\n            return 0;\n        }\n        if (deg) {\n            lata *= Scalar.DEG2RAD;\n            lona *= Scalar.DEG2RAD;\n            latb *= Scalar.DEG2RAD;\n            lonb *= Scalar.DEG2RAD;\n        }\n        const dLat = (latb - lata) / 2;\n        const dLon = (lonb - lona) / 2;\n        const sdLat = Math.sin(dLat);\n        const sdlon = Math.sin(dLon);\n        const a = sdLat * sdLat + Math.cos(lata) * Math.cos(latb) * sdlon * sdlon;\n        const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n        let distance = this._ellipsoid.semiMajorAxis * c;\n        if (alta !== undefined && altb !== undefined) {\n            const altDifference = altb - alta;\n            distance = Math.sqrt(distance * distance + altDifference * altDifference);\n        }\n        return distance;\n    }\n    getAzimuthFromFloat(lat1, lon1, lat2, lon2, deg) {\n        if (lat1 === lat2 && lon1 === lon2) {\n            return 0;\n        }\n        if (deg) {\n            lat1 *= Scalar.DEG2RAD;\n            lon1 *= Scalar.DEG2RAD;\n            lat2 *= Scalar.DEG2RAD;\n            lon2 *= Scalar.DEG2RAD;\n        }\n        const dlon = lon2 - lon1;\n        const coslat2 = Math.cos(lat2);\n        const y = Math.sin(dlon) * coslat2;\n        const x = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * coslat2 * Math.cos(dlon);\n        let az = Math.atan2(y, x);\n        if (deg) {\n            az *= Scalar.RAD2DEG;\n        }\n        return az;\n    }\n    getLocationAtDistanceAzimuth(lat, lon, dist, az, deg) {\n        if (dist == 0) {\n            return new Geo2(lat, lon);\n        }\n        if (deg) {\n            lat *= Scalar.DEG2RAD;\n            lon *= Scalar.DEG2RAD;\n            az *= Scalar.DEG2RAD;\n        }\n        const ddr = dist / this._ellipsoid.semiMajorAxis;\n        const cosddr = Math.cos(ddr);\n        const sinddr = Math.sin(ddr);\n        const coslat = Math.cos(lat);\n        const sinlat = Math.sin(lat);\n        const coslatsinddr = coslat * sinddr;\n        let lat1 = Math.asin(sinlat * cosddr + coslatsinddr * Math.cos(az));\n        let lon1 = lon + Math.atan2(coslatsinddr * Math.sin(az), cosddr - sinlat * Math.sin(lat1));\n        if (deg) {\n            lat1 *= Scalar.RAD2DEG;\n            lon1 *= Scalar.RAD2DEG;\n        }\n        return new Geo2(lat1, lon1);\n    }\n}\nSphericalCalculator.Shared = new SphericalCalculator();\n//# sourceMappingURL=geodesy.calculator.spherical.js.map","export * from \"./geodesy.calculator.flat\";\nexport * from \"./geodesy.calculator.spherical\";\n//# sourceMappingURL=index.js.map","import { Ellipsoid } from \"./geodesy.ellipsoid\";\nexport class CalculatorBase {\n    constructor(e) {\n        this._ellipsoid = e ?? Ellipsoid.WGS84;\n    }\n    get ellipsoid() {\n        return this._ellipsoid;\n    }\n}\nCalculatorBase.Shared = null;\n//# sourceMappingURL=geodesy.calculators.js.map","export class Ellipsoid {\n    static FromAAndInverseF(name, semiMajor, inverseFlattening) {\n        const f = 1.0 / inverseFlattening;\n        const b = (1.0 - f) * semiMajor;\n        return new Ellipsoid(name, semiMajor, b, f, inverseFlattening);\n    }\n    static FromAAndF(name, semiMajor, flattening) {\n        const inverseF = 1.0 / flattening;\n        const b = (1.0 - flattening) * semiMajor;\n        return new Ellipsoid(name, semiMajor, b, flattening, inverseF);\n    }\n    constructor(name, semiMajor, semiMinor, flattening, inverseFlattening) {\n        this._name = name;\n        this._a = semiMajor;\n        this._b = semiMinor;\n        this._f = flattening;\n        this._p1mf = 1.0 - this._f;\n        this._invf = inverseFlattening;\n        this._aa = this._a * this._a;\n        this._bb = this._b * this._b;\n        this._c = Math.sqrt(this._aa - this._bb);\n        this._ee = 1 - this._bb / this._aa;\n        this._e = Math.sqrt(this._ee);\n        this._invaa = 1.0 / this._aa;\n        this._aadc = this._aa / this._c;\n        this._bbdcc = this._bb / (this._c * this._c);\n        this._l = this._ee / 2;\n        this._p1mee = 1 - this._ee;\n        this._p1meedaa = this._p1mee / this._aa;\n        this._hmin = Math.pow(this._e, 12) / 4;\n        this._ll = this._l * this._l;\n        this._ll4 = this._ll * 4;\n    }\n    get name() {\n        return this._name;\n    }\n    get semiMajorAxis() {\n        return this._a;\n    }\n    get semiMinorAxis() {\n        return this._b;\n    }\n    get flattening() {\n        return this._f;\n    }\n    get inverseFlattening() {\n        return this._invf;\n    }\n    get linearEccentricity() {\n        return this._c;\n    }\n    get eccentricity() {\n        return this._e;\n    }\n    get sqrEccentricity() {\n        return this._ee;\n    }\n    get oneMinusSqrEccentricity() {\n        return this._p1mee;\n    }\n    get semiLatusRectum() {\n        return this._p1mee * this._a;\n    }\n    isEquals(other) {\n        return other && other._a == this._a && other._b == this._b;\n    }\n    clone(name, scale = 1.0) {\n        return new Ellipsoid(name, this._a * scale, this._b * scale, this._f, this._invf);\n    }\n}\nEllipsoid.WGS84 = Ellipsoid.FromAAndInverseF(\"WGS84\", 6378137.0, 298.257223563);\nEllipsoid.GRS80 = Ellipsoid.FromAAndInverseF(\"GRS80\", 6378137.0, 298.257222101);\nEllipsoid.GRS67 = Ellipsoid.FromAAndInverseF(\"GRS67\", 6378160.0, 298.25);\nEllipsoid.ANS = Ellipsoid.FromAAndInverseF(\"ANS\", 6378160.0, 298.25);\nEllipsoid.WGS72 = Ellipsoid.FromAAndInverseF(\"WGS72\", 6378135.0, 298.26);\nEllipsoid.Clarke1858 = Ellipsoid.FromAAndInverseF(\"Clarke1858\", 6378293.645, 294.26);\nEllipsoid.Clarke1880 = Ellipsoid.FromAAndInverseF(\"Clarke1880\", 6378249.145, 293.465);\n//# sourceMappingURL=geodesy.ellipsoid.js.map","import { Cartesian3 } from \"../geometry\";\nexport class MapScale {\n    static GetScale(displaySize, resolution, metrics, lat, LOD) {\n        const worldSize = resolution * metrics.groundResolution(lat, LOD);\n        return displaySize / worldSize;\n    }\n    static GetScale3(displaySize, resolution, metrics, lat, LOD) {\n        const groundRes = metrics.groundResolution(lat, LOD);\n        const x = displaySize.width / (resolution.width * groundRes);\n        const y = displaySize.height / (resolution.height * groundRes);\n        let z = groundRes;\n        if (displaySize.depth) {\n            z = (displaySize.depth / resolution.depth) * groundRes;\n        }\n        return new Cartesian3(x, y, z);\n    }\n    static GetLOD(scale, displaySize, resolution, lat, ellipsoidSemiMajorAxis, tileSize) {\n        const constantFactor = (resolution * Math.cos(lat) * 2 * Math.PI * ellipsoidSemiMajorAxis) / (displaySize * tileSize);\n        const LOD = Math.log2(scale * constantFactor);\n        return LOD;\n    }\n}\n//# sourceMappingURL=geodesy.scale.js.map","import { Ellipsoid } from \"./geodesy.ellipsoid\";\nimport { Observable } from \"../events/events.observable\";\nimport { Scalar } from \"../math\";\nimport { Cartesian3 } from \"../geometry\";\nexport var CartesianMode;\n(function (CartesianMode) {\n    CartesianMode[CartesianMode[\"ECEF\"] = 0] = \"ECEF\";\n    CartesianMode[CartesianMode[\"ENU\"] = 1] = \"ENU\";\n    CartesianMode[CartesianMode[\"NED\"] = 2] = \"NED\";\n})(CartesianMode || (CartesianMode = {}));\nexport class GeodeticSystem {\n    static GetENUTransformMatrixFromFloat(lat, lon, alt = 0, ellipsoid = Ellipsoid.WGS84, rowOrder = true) {\n        const lambda = lat * Scalar.DEG2RAD;\n        const phi = lon * Scalar.DEG2RAD;\n        const sin_lambda = Math.sin(lambda);\n        const N = ellipsoid.semiMajorAxis / Math.sqrt(1 - ellipsoid.sqrEccentricity * sin_lambda * sin_lambda);\n        const cos_lambda = Math.cos(lambda);\n        const cos_phi = Math.cos(phi);\n        const sin_phi = Math.sin(phi);\n        const tmp = (alt + N) * cos_lambda;\n        const x = tmp * cos_phi;\n        const y = tmp * sin_phi;\n        const z = (alt + ellipsoid.oneMinusSqrEccentricity * N) * sin_lambda;\n        const om0 = -sin_phi;\n        const om1 = -sin_lambda * cos_phi;\n        const om2 = cos_lambda * cos_phi;\n        const om4 = cos_phi;\n        const om5 = -sin_lambda * sin_phi;\n        const om6 = cos_lambda * sin_phi;\n        const om9 = cos_lambda;\n        const om10 = sin_lambda;\n        const om12 = -x * om0 - y * om4;\n        const om13 = -x * om1 - y * om5 - z * om9;\n        const om14 = -x * om2 - y * om6 - z * om10;\n        if (rowOrder) {\n            return [om0, om1, om2, 0, om4, om5, om6, 0, 0, om9, om10, 0, om12, om13, om14, 1.0];\n        }\n        else {\n            return [om0, om4, 0, om12, om1, om5, om9, om13, om2, om6, om10, om14, 0, 0, 0, 1.0];\n        }\n    }\n    constructor(e, bounds) {\n        this._ellipsoid = e || Ellipsoid.WGS84;\n        this._bounds = bounds;\n    }\n    get ellipsoid() {\n        return this._ellipsoid;\n    }\n    get ENUReference() {\n        return this._enuReference;\n    }\n    set ENUReference(v) {\n        if (this._enuReference) {\n            if (this._enuReference.equals(v)) {\n                return;\n            }\n            this._enuReference = v?.clone();\n            this._enuTransform = undefined;\n            if (this._enuObservable && this._enuObservable.hasObservers()) {\n                this._enuObservable.notifyObservers(this);\n            }\n        }\n    }\n    get ENUTransform() {\n        if (this._enuTransform === undefined && this._enuReference) {\n            this._enuTransform = GeodeticSystem.GetENUTransformMatrixFromFloat(this._enuReference.lat, this._enuReference.lon, this._enuReference.alt, this._ellipsoid);\n        }\n        return this._enuTransform;\n    }\n    get ENUObservable() {\n        this._enuObservable = this._enuObservable || new Observable();\n        return this._enuObservable;\n    }\n    get cartesianMode() {\n        return this._enuReference !== undefined ? CartesianMode.ENU : CartesianMode.ECEF;\n    }\n    geodeticFloatToCartesianToRef(lat, lon, alt, target, deg = true) {\n        target = target || Cartesian3.Zero();\n        let lambda = deg ? lat * Scalar.DEG2RAD : lat;\n        let phi = deg ? lon * Scalar.DEG2RAD : lon;\n        const sin_lambda = Math.sin(lambda);\n        const cos_lambda = Math.cos(lambda);\n        const cos_phi = Math.cos(phi);\n        const sin_phi = Math.sin(phi);\n        const N = this._ellipsoid._a / Math.sqrt(1.0 - this._ellipsoid._ee * sin_lambda * sin_lambda);\n        const tmp = (alt + N) * cos_lambda;\n        let x = tmp * cos_phi;\n        let y = tmp * sin_phi;\n        let z = (alt + this._ellipsoid._p1mee * N) * sin_lambda;\n        if (this.ENUTransform) {\n            const m = this.ENUTransform;\n            const rx = x * m[0] + y * m[4] + z * m[8] + m[12];\n            const ry = x * m[1] + y * m[5] + z * m[9] + m[13];\n            const rz = x * m[2] + y * m[6] + z * m[10] + m[14];\n            x = rx;\n            y = ry;\n            z = rz;\n        }\n        target.x = x;\n        target.y = y;\n        target.z = z;\n        return target;\n    }\n    geodeticToCartesianToRef(geo, target) {\n        return this.geodeticFloatToCartesianToRef(geo.lat, geo.lon, geo.alt || 0, target);\n    }\n}\nGeodeticSystem.Default = new GeodeticSystem(Ellipsoid.WGS84);\n//# sourceMappingURL=geodesy.system.js.map","export * from \"./geodesy.ellipsoid\";\nexport * from \"./geodesy.system\";\nexport * from \"./geodesy.interfaces\";\nexport * from \"./geodesy.calculators\";\nexport * from \"./calculators\";\nexport * from \"./geodesy.scale\";\n//# sourceMappingURL=index.js.map","export class Bearing {\n    static Zero() {\n        return new Bearing(0);\n    }\n    static ClampAzimuth(a) {\n        return ((a % 360) + 360) % 360;\n    }\n    constructor(value) {\n        this._value = Bearing.ClampAzimuth(value);\n        const rad = (this._value * Math.PI) / 180;\n        this._cos = Math.cos(rad);\n        this._sin = Math.sin(rad);\n    }\n    get value() {\n        return this._value;\n    }\n    get radian() {\n        return (this._value * Math.PI) / 180;\n    }\n    set value(v) {\n        const clamped = Bearing.ClampAzimuth(v);\n        if (this._value !== clamped) {\n            this._value = clamped;\n            const rad = (this._value * Math.PI) / 180;\n            this._cos = Math.cos(rad);\n            this._sin = Math.sin(rad);\n        }\n    }\n    get cos() {\n        return this._cos;\n    }\n    get sin() {\n        return this._sin;\n    }\n    additiveInverse() {\n        return new Bearing(-this._value);\n    }\n    copyInPlace(other) {\n        this._value = other._value;\n        this._cos = other._cos;\n        this._sin = other._sin;\n    }\n    toString() {\n        return `${this._value}°`;\n    }\n}\n//# sourceMappingURL=geography.bearing.js.map","import { Envelope, GeoBounded } from \"./geography.envelope\";\nexport class GeoBoundedCollection extends GeoBounded {\n    constructor() {\n        super();\n        this._items = new Array();\n    }\n    push(...views) {\n        this._items.push(...views);\n        this.invalidateEnvelope();\n    }\n    findIndex(predicate, thisArg) {\n        return this._items.findIndex(predicate, thisArg);\n    }\n    splice(start, deleteCount) {\n        this._items.splice(start, deleteCount);\n        this.invalidateEnvelope();\n    }\n    [Symbol.iterator]() {\n        let pointer = 0;\n        let items = this._items;\n        const iterator = {\n            next() {\n                if (pointer < items.length) {\n                    return {\n                        done: false,\n                        value: items[pointer++],\n                    };\n                }\n                return {\n                    done: true,\n                    value: null,\n                };\n            },\n            [Symbol.iterator]() {\n                return this;\n            },\n        };\n        return iterator;\n    }\n    _buildEnvelope() {\n        return Envelope.FromEnvelopes(...this._items.map((v) => v.geoBounds));\n    }\n}\n//# sourceMappingURL=geography.envelope.collection.js.map","import { Scalar } from \"../math/math\";\nimport { IsEnvelope, IsGeoBounded, IsLocation } from \"./geography.interfaces\";\nimport { Geo3 } from \"./geography.position\";\nimport { Size3 } from \"../geometry/geometry.size\";\nexport class Envelope {\n    static RegionIntersectsRegion(a, b) {\n        if (a[1] > b[3] || a[3] < b[1] || a[0] > b[2] || a[2] < b[0] || a[4] > b[5] || a[5] < b[4]) {\n            return false;\n        }\n        return true;\n    }\n    static RegionContainsFloat(a, lat, lon, alt) {\n        return lat >= a[1] && lat <= a[3] && (lon === undefined || (lon >= a[0] && lon <= a[2])) && (alt === undefined || (alt >= a[4] && alt <= a[5]));\n    }\n    static Zero() {\n        return new Envelope(Geo3.Zero(), Geo3.Zero());\n    }\n    static Split2(a) {\n        if (a) {\n            if (IsGeoBounded(a)) {\n                return Envelope.Split2(a.geoBounds);\n            }\n            const center = a.center;\n            return [\n                new Envelope(new Geo3(center.lat, a.west), new Geo3(a.north, center.lon)),\n                new Envelope(center, new Geo3(a.north, a.east)),\n                new Envelope(new Geo3(a.south, a.west), center),\n                new Envelope(new Geo3(a.south, center.lon), new Geo3(center.lat, a.east)),\n            ];\n        }\n        return [];\n    }\n    static Split3(a) {\n        if (a) {\n            if (IsGeoBounded(a)) {\n                return Envelope.Split3(a.geoBounds);\n            }\n            if (a.hasAltitude) {\n                const center = a.center;\n                return [\n                    new Envelope(new Geo3(center.lat, a.west, a.bottom), new Geo3(a.north, center.lon, center.alt)),\n                    new Envelope(new Geo3(center.lat, center.lon, a.bottom), new Geo3(a.north, a.east, center.alt)),\n                    new Envelope(new Geo3(a.south, a.west, a.bottom), center),\n                    new Envelope(new Geo3(a.south, center.lon, a.bottom), new Geo3(center.lat, a.east, center.alt)),\n                    new Envelope(new Geo3(center.lat, a.west, center.alt), new Geo3(a.north, center.lon, a.top)),\n                    new Envelope(new Geo3(center.lat, center.lon, center.alt), new Geo3(a.north, a.east, a.top)),\n                    new Envelope(new Geo3(a.south, a.west, center.alt), new Geo3(center.lat, center.lon, a.top)),\n                    new Envelope(new Geo3(a.south, center.lon, center.alt), new Geo3(center.lat, a.east, a.top)),\n                ];\n            }\n        }\n        return [];\n    }\n    static FromPoints(...array) {\n        const a = array[0];\n        const hasAlt = a.alt !== undefined && a.alt !== undefined;\n        const lat0 = Scalar.Clamp(a.lat, Envelope.MinLatitude, Envelope.MaxLatitude);\n        const lon0 = Scalar.Clamp(a.lon, Envelope.MinLongitude, Envelope.MaxLongitude);\n        const alt0 = hasAlt ? a.alt : undefined;\n        const env = new Envelope(new Geo3(lat0, lon0, alt0), new Geo3(lat0, lon0, alt0));\n        for (let i = 1; i < array.length; i++) {\n            env.addInPlace(array[i]);\n        }\n        return env;\n    }\n    static FromEnvelopes(...array) {\n        let env = undefined;\n        for (let i = 0; i < array.length; i++) {\n            let a = array[i];\n            if (a) {\n                if (IsEnvelope(a)) {\n                    env = env ? env.unionInPlace(a) : a.clone();\n                }\n                else {\n                    a = a.geoBounds;\n                    if (a) {\n                        env = env ? env.unionInPlace(a) : a.clone();\n                    }\n                }\n            }\n        }\n        return env;\n    }\n    constructor(lowerCorner, upperCorner) {\n        this._min = lowerCorner;\n        this._max = upperCorner;\n    }\n    isEmpty() {\n        return this._min.equals(this._max);\n    }\n    get north() {\n        return this._max.lat;\n    }\n    get south() {\n        return this._min.lat;\n    }\n    get east() {\n        return this._max.lon;\n    }\n    get west() {\n        return this._min.lon;\n    }\n    get bottom() {\n        return this._min.alt;\n    }\n    get top() {\n        return this._max.alt;\n    }\n    get nw() {\n        return new Geo3(this.north, this.west);\n    }\n    get sw() {\n        return new Geo3(this.south, this.west);\n    }\n    get ne() {\n        return new Geo3(this.north, this.east);\n    }\n    get se() {\n        return new Geo3(this.south, this.east);\n    }\n    equals(other) {\n        return (other !== undefined &&\n            this._min.lat === other.south &&\n            this._min.lon === other.west &&\n            this._min.alt === other.bottom &&\n            this._max.lat === other.north &&\n            this._max.lon === other.east &&\n            this._max.alt === other.top);\n    }\n    clone() {\n        return new Envelope(this._min.clone(), this._max.clone());\n    }\n    get hasAltitude() {\n        return this._min.hasAltitude && this._max.hasAltitude;\n    }\n    get center() {\n        const lon = this._min.lon + (this._max.lon - this._min.lon) / 2;\n        const lat = this._min.lat + (this._max.lat - this._min.lat) / 2;\n        const alt = this.hasAltitude ? this._min.alt + (this._max.alt - this._min.alt) / 2 : undefined;\n        return new Geo3(lat, lon, alt);\n    }\n    get size() {\n        const w = this._max.lon - this._min.lon;\n        const h = this._max.lat - this._min.lat;\n        const t = this.hasAltitude ? this._max.alt - this._min.alt : 0;\n        return new Size3(w, h, t);\n    }\n    add(lat, lon, alt) {\n        return this.clone().addInPlace(lat, lon, alt);\n    }\n    addInPlace(lat, lon, alt) {\n        if (IsLocation(lat)) {\n            return this.addInPlace(lat.lat, lat.lon, lat.alt);\n        }\n        this._min.lat = Math.min(this._min.lat, lat);\n        this._max.lat = Math.max(this._max.lat, lat);\n        if (lon !== undefined) {\n            this._min.lon = Math.min(this._min.lon, lon);\n            this._max.lon = Math.max(this._max.lon, lon);\n        }\n        if (this.hasAltitude && alt) {\n            this._min.alt = Math.min(this._min.alt, alt);\n            this._max.alt = Math.max(this._max.alt, alt);\n        }\n        return this;\n    }\n    unionInPlace(other) {\n        this._min.lat = Math.min(this._min.lat, other.south);\n        this._max.lat = Math.max(this._max.lat, other.north);\n        this._min.lon = Math.min(this._min.lon, other.west);\n        this._max.lon = Math.max(this._max.lon, other.east);\n        if (this.hasAltitude && other.hasAltitude) {\n            this._min.alt = Math.min(this._min.alt, other.bottom);\n            this._max.alt = Math.max(this._max.alt, other.top);\n        }\n        return this;\n    }\n    intersects(bounds) {\n        if (bounds === undefined)\n            return false;\n        if (Array.isArray(bounds)) {\n            if (this._min.lat > bounds[3] || this._max.lat < bounds[1] || this._min.lon > bounds[2] || this._max.lon < bounds[0]) {\n                return false;\n            }\n            if (this.hasAltitude && bounds.length === 6) {\n                if (this._min.alt > bounds[5] || this._max.alt < bounds[4]) {\n                    return false;\n                }\n            }\n            return true;\n        }\n        if (IsGeoBounded(bounds)) {\n            return this.intersects(bounds.geoBounds);\n        }\n        if (this._min.lat > bounds.north || this._max.lat < bounds.south || this._min.lon > bounds.east || this._max.lon < bounds.west) {\n            return false;\n        }\n        if (this.hasAltitude && bounds.hasAltitude) {\n            if (this._min.alt > bounds.top || this._max.alt < bounds.bottom) {\n                return false;\n            }\n        }\n        return true;\n    }\n    contains(other) {\n        if (!other)\n            return false;\n        if (IsLocation(other)) {\n            return this.containsFloat(other.lat, other.lon, other.alt);\n        }\n        return (this.containsFloat(other.south, other.west) &&\n            this.containsFloat(other.north, other.east) &&\n            (!this.hasAltitude ||\n                (other.bottom !== undefined &&\n                    other.top !== undefined &&\n                    this.containsFloat(other.bottom, undefined, other.bottom) &&\n                    this.containsFloat(other.top, undefined, other.top))));\n    }\n    containsFloat(lat, lon, alt) {\n        return (lat >= this._min.lat &&\n            lat <= this._max.lat &&\n            (lon === undefined || (lon >= this._min.lon && lon <= this._max.lon)) &&\n            (alt === undefined || (this.hasAltitude && alt >= this._min.alt && alt <= this._max.alt)));\n    }\n    scaleInPlace(scale) {\n        const size = this.size;\n        size.width = (size.width * scale - size.width) / 2;\n        size.height = (size.height * scale - size.height) / 2;\n        size.depth = (size.depth * scale - size.depth) / 2;\n        this._min.lat -= size.height;\n        this._min.lon -= size.width;\n        if (this._min.alt) {\n            this._min.alt -= size.depth;\n        }\n        this._max.lat += size.height;\n        this._max.lon += size.width;\n        if (this._max.alt) {\n            this._max.alt += size.depth;\n        }\n        return this;\n    }\n    toString() {\n        return `Envelope(${this._min.toString()}, ${this._max.toString()})`;\n    }\n}\nEnvelope.MaxLongitude = 540;\nEnvelope.MaxLatitude = 90;\nEnvelope.MinLongitude = -Envelope.MaxLongitude;\nEnvelope.MinLatitude = -Envelope.MaxLatitude;\nexport class GeoBounded {\n    constructor(bounds, parent) {\n        if (parent) {\n            this._parent = parent;\n        }\n        this._env = bounds;\n    }\n    get parent() {\n        return this._parent;\n    }\n    get geoBounds() {\n        this.validateEnvelope();\n        return this._env;\n    }\n    validateEnvelope() {\n        if (!this._env) {\n            this._env = this._buildEnvelope();\n        }\n    }\n    invalidateEnvelope() {\n        if (this._env) {\n            delete this._env;\n            if (this._parent) {\n                this._parent.invalidateEnvelope();\n            }\n        }\n    }\n}\n//# sourceMappingURL=geography.envelope.js.map","export function IsLocation(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return b.lat !== undefined && b.lon !== undefined;\n}\nexport function IsEnvelope(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return b.nw !== undefined && b.sw !== undefined && b.ne !== undefined && b.nw !== undefined;\n}\nexport function IsGeoBounded(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return IsEnvelope(b.geoBounds);\n}\n//# sourceMappingURL=geography.interfaces.js.map","import { Geo2 } from \"./geography.position\";\nexport class KnownPlaces {\n    static FillSelectElement(select, places, callback) {\n        const unselectedOption = document.createElement(\"option\");\n        unselectedOption.value = \"\";\n        unselectedOption.disabled = true;\n        unselectedOption.selected = true;\n        unselectedOption.textContent = \"Select a location...\";\n        select.appendChild(unselectedOption);\n        for (const [category, locations] of Object.entries(places)) {\n            const optgroup = document.createElement(\"optgroup\");\n            optgroup.label = category;\n            const entries = Object.entries(locations);\n            const sortedEntries = entries.sort((a, b) => a[0].localeCompare(b[0]));\n            for (const [name, coords] of sortedEntries) {\n                const option = document.createElement(\"option\");\n                option.value = Geo2.ToString(coords);\n                option.text = name;\n                optgroup.appendChild(option);\n            }\n            select.appendChild(optgroup);\n        }\n        select.onchange = () => {\n            const selectedOption = select.options[select.selectedIndex];\n            const coords = Geo2.Parse(selectedOption.value);\n            callback(selectedOption.text, coords);\n        };\n        return select;\n    }\n}\nKnownPlaces.Mountains = {\n    Everest: new Geo2(27.9881, 86.925),\n    K2: new Geo2(35.8808, 76.5155),\n    Kangchenjunga: new Geo2(27.7025, 88.1475),\n    Lhotse: new Geo2(27.9617, 86.9333),\n    Makalu: new Geo2(27.8897, 87.0889),\n    ChoOyu: new Geo2(28.0942, 86.6608),\n    Dhaulagiri: new Geo2(28.6967, 83.4872),\n    Manaslu: new Geo2(28.5494, 84.5599),\n    NangaParbat: new Geo2(35.237, 74.5892),\n    Annapurna: new Geo2(28.5961, 83.8203),\n    Matterhorn: new Geo2(45.9763, 7.6586),\n    MontBlanc: new Geo2(45.8326, 6.8652),\n    Denali: new Geo2(63.0695, -151.0074),\n    Aconcagua: new Geo2(-32.6532, -70.0109),\n    Kilimanjaro: new Geo2(-3.0674, 37.3556),\n    Elbrus: new Geo2(43.3499, 42.4375),\n    PuncakJaya: new Geo2(-4.0751, 137.1889),\n    Roraima: new Geo2(5.125, -60.75),\n};\nKnownPlaces.Volcanoes = {\n    Krakatoa: new Geo2(-6.102, 105.423),\n    Vesuvius: new Geo2(40.821, 14.426),\n    Etna: new Geo2(37.751, 14.993),\n    MaunaLoa: new Geo2(19.475, -155.608),\n    Kilauea: new Geo2(19.421, -155.287),\n    Fuji: new Geo2(35.3606, 138.7274),\n    StHelens: new Geo2(46.1912, -122.1944),\n    Pinatubo: new Geo2(15.142, 120.35),\n    Rainier: new Geo2(46.853, -121.76),\n    Cotopaxi: new Geo2(-0.679, -78.438),\n    Popocatepetl: new Geo2(19.023, -98.622),\n    Eyjafjallajokull: new Geo2(63.633, -19.621),\n    Santorini: new Geo2(36.404, 25.396),\n    Kilimanjaro: new Geo2(-3.067, 37.355),\n    Arenal: new Geo2(10.463, -84.703),\n    Yellowstone: new Geo2(44.428, -110.588),\n    Tambora: new Geo2(-8.25, 118.0),\n    Sakurajima: new Geo2(31.593, 130.657),\n};\nKnownPlaces.SightsAndParks = {\n    GrandCanyon: new Geo2(36.1069, -112.1129),\n    Yellowstone: new Geo2(44.428, -110.5885),\n    GreatBarrierReef: new Geo2(-18.2871, 147.6992),\n    Yosemite: new Geo2(37.8651, -119.5383),\n    Serengeti: new Geo2(-2.3333, 34.8333),\n    MachuPicchu: new Geo2(-13.1631, -72.545),\n    Banff: new Geo2(51.1784, -115.5708),\n    Galapagos: new Geo2(-0.9538, -90.9656),\n    TorresDelPaine: new Geo2(-51.1667, -73.2425),\n    PlitviceLakes: new Geo2(44.8803, 15.6161),\n    VictoriaFalls: new Geo2(-17.9243, 25.8573),\n    Santorini: new Geo2(36.3932, 25.4615),\n    Petra: new Geo2(30.3285, 35.4444),\n    IguazuFalls: new Geo2(-25.6953, -54.4367),\n    Kruger: new Geo2(-23.9884, 31.5547),\n    BryceCanyon: new Geo2(37.593, -112.1871),\n    CliffsOfMoher: new Geo2(52.9715, -9.4265),\n    AngkorWat: new Geo2(13.4125, 103.8669),\n    HaLongBay: new Geo2(20.9101, 107.1839),\n};\nKnownPlaces.WorldWonders = {\n    CliffsOfMoher: new Geo2(52.9715, -9.4265),\n    Everest: new Geo2(27.9881, 86.925),\n    Galapagos: new Geo2(-0.9538, -90.9656),\n    GrandCanyon: new Geo2(36.1069, -112.1129),\n    GreatBarrierReef: new Geo2(-18.2871, 147.6992),\n    HaLongBay: new Geo2(20.9101, 107.1839),\n    Kilimanjaro: new Geo2(-3.0674, 37.3556),\n    Matterhorn: new Geo2(45.9763, 7.6586),\n    Roraima: new Geo2(5.125, -60.75),\n    TorresDelPaine: new Geo2(-51.1667, -73.2425),\n    Vesuvius: new Geo2(40.821, 14.426),\n    Yellowstone: new Geo2(44.428, -110.5885),\n};\nKnownPlaces.Wonders = {\n    AngkorWat: new Geo2(13.4125, 103.8669),\n    MachuPicchu: new Geo2(-13.1631, -72.545),\n    Petra: new Geo2(30.3285, 35.4444),\n};\nKnownPlaces.Waterfalls = {\n    IguazuFalls: new Geo2(-25.6953, -54.4367),\n    VictoriaFalls: new Geo2(-17.9243, 25.8573),\n};\n//# sourceMappingURL=geography.knownPlaces.js.map","export class Geo2 {\n    static FromGeoJson(coordinates) {\n        return new Geo2(coordinates[1], coordinates[0]);\n    }\n    static Parse(value) {\n        const parts = value.replace(/[\\[\\]]/g, \"\").split(\",\");\n        const lat = parseFloat(parts[0]);\n        const lon = parseFloat(parts[1]);\n        return new Geo2(lat, lon);\n    }\n    static ToString(value) {\n        return `[${value.lat},${value.lon}]`;\n    }\n    static Zero() {\n        return new Geo2(0, 0);\n    }\n    constructor(lat, lon) {\n        this._lat = lat;\n        this._lon = lon;\n    }\n    get lat() {\n        return this._lat;\n    }\n    get lon() {\n        return this._lon;\n    }\n    set lat(v) {\n        this._lat = v;\n    }\n    set lon(v) {\n        this._lon = v;\n    }\n    clone() {\n        return new Geo2(this._lat, this._lon);\n    }\n    equals(other) {\n        return this._lat === other.lat && this._lon === other.lon;\n    }\n    toString() {\n        return `[${this._lat},${this._lon}]`;\n    }\n}\nGeo2.Default = new Geo2(46.382581, -0.308024);\nexport class Geo3 extends Geo2 {\n    static FromGeoJson(coordinates) {\n        if (coordinates.length === 2) {\n            return new Geo3(coordinates[1], coordinates[0]);\n        }\n        return new Geo3(coordinates[1], coordinates[0], coordinates[2]);\n    }\n    static ToString(value) {\n        if (value.alt !== undefined) {\n            return `[${value.lat},${value.lon},${value.alt}]`;\n        }\n        return `[${value.lat},${value.lon}]`;\n    }\n    static Parse(value) {\n        const parts = value.replace(/[\\[\\]]/g, \"\").split(\",\");\n        const lat = parseFloat(parts[0]);\n        const lon = parseFloat(parts[1]);\n        if (parts.length > 2) {\n            const alt = parseFloat(parts[2]);\n            return new Geo3(lat, lon, alt);\n        }\n        return new Geo3(lat, lon);\n    }\n    static Zero() {\n        return new Geo3(0, 0, 0);\n    }\n    constructor(lat, lon, alt) {\n        super(lat, lon);\n        this._alt = alt;\n    }\n    get alt() {\n        return this._alt;\n    }\n    set alt(v) {\n        this._alt = v;\n    }\n    get hasAltitude() {\n        return this._alt !== undefined;\n    }\n    clone() {\n        return new Geo3(this._lat, this._lon, this._alt);\n    }\n    equals(other) {\n        return this._lat === other.lat && this._lon === other.lon && this._alt === other.alt;\n    }\n    toString() {\n        return this.hasAltitude ? `(${this._lat}, ${this._lon}, ${this._alt})` : `(${this._lat}, ${this._lon})`;\n    }\n}\n//# sourceMappingURL=geography.position.js.map","import { Ellipsoid } from \"../geodesy/geodesy.ellipsoid\";\nimport { Scalar } from \"../math/math\";\nimport { Cartesian2 } from \"../geometry/geometry.cartesian\";\nexport class Projections {\n    static LatLonToWebMercator(lat, lon, ellipsoid) {\n        return Projections.LatLonToWebMercatorToRef(lat, lon, Cartesian2.Zero(), ellipsoid);\n    }\n    static LatLonToWebMercatorToRef(lat, lon, ref, ellipsoid) {\n        ellipsoid = ellipsoid || Ellipsoid.WGS84;\n        ref.x = lon * Scalar.DEG2RAD * ellipsoid.semiMajorAxis;\n        lat = Scalar.Clamp(lat, Projections.WebMercatorMinLatitude, Projections.WebMercatorMaxLatitude);\n        let rad = lat * Scalar.DEG2RAD;\n        ref.y = ellipsoid.semiMajorAxis * Math.log(Math.tan(Scalar.PI_4 + rad / 2));\n        return ref;\n    }\n}\nProjections.WebMercatorMaxLatitude = 85.05112878;\nProjections.WebMercatorMinLatitude = -Projections.WebMercatorMaxLatitude;\n//# sourceMappingURL=geography.projections.js.map","export * from \"./geography.interfaces\";\nexport * from \"./geography.position\";\nexport * from \"./geography.envelope\";\nexport * from \"./geography.envelope.collection\";\nexport * from \"./geography.knownPlaces\";\nexport * from \"./geography.projections\";\nexport * from \"./geography.bearing\";\nexport * from \"./shapes/geography.shape\";\nexport * from \"./shapes\";\n//# sourceMappingURL=index.js.map","import { Envelope } from \"../geography.envelope\";\nimport { GeoShape } from \"./geography.shape\";\nimport { GeoShapeType } from \"./geography.shapes.interfaces\";\nexport class GeoLine extends GeoShape {\n    constructor(a, b) {\n        super(GeoShapeType.Line);\n        this._alice = a;\n        this._bob = b;\n    }\n    get start() {\n        return this._alice;\n    }\n    set start(v) {\n        if (!this._alice.equals(v)) {\n            this._alice = v;\n            this.invalidateEnvelope();\n        }\n    }\n    get end() {\n        return this._bob;\n    }\n    set end(v) {\n        if (!this._bob.equals(v)) {\n            this._bob = v;\n            this.invalidateEnvelope();\n        }\n    }\n    _buildEnvelope() {\n        return Envelope.FromPoints(this._alice, this._bob);\n    }\n}\n//# sourceMappingURL=geography.line.js.map","import { CalculatorBase, SphericalCalculator } from \"../../geodesy\";\nimport { Geo2 } from \"../geography.position\";\nimport { GeoPolyline } from \"./geography.polyline\";\nimport { GeoShapeType } from \"./geography.shapes.interfaces\";\nexport class GeoPolygon extends GeoPolyline {\n    static FromCircle(center, radius, step, p) {\n        const processor = p ?? CalculatorBase.Shared ?? SphericalCalculator.Shared;\n        const points = [];\n        const angle = 360 / step;\n        const r = radius;\n        const lat = center.lat;\n        const lon = center.lon;\n        for (let i = 0; i < 360; i += angle) {\n            points.push(processor.getLocationAtDistanceAzimuth(lat, lon, r, i));\n        }\n        return new GeoPolygon(points);\n    }\n    static FromRectangle(center, width, height, p) {\n        const halfWidth = width / 2;\n        const halfHeight = height / 2;\n        p = p ?? CalculatorBase.Shared ?? SphericalCalculator.Shared;\n        const lat = center.lat;\n        const lon = center.lon;\n        const N = p.getLocationAtDistanceAzimuth(lat, lon, halfHeight, 0);\n        const E = p.getLocationAtDistanceAzimuth(lat, lon, halfWidth, 90);\n        const S = p.getLocationAtDistanceAzimuth(lat, lon, halfHeight, 180);\n        const W = p.getLocationAtDistanceAzimuth(lat, lon, halfWidth, 270);\n        return new GeoPolygon([new Geo2(N.lat, W.lon), new Geo2(N.lat, E.lon), new Geo2(S.lat, E.lon), new Geo2(S.lat, W.lon)]);\n    }\n    constructor(p) {\n        super(p, GeoShapeType.Polygon);\n    }\n}\n//# sourceMappingURL=geography.polygon.js.map","import { Envelope } from \"../geography.envelope\";\nimport { GeoShape } from \"./geography.shape\";\nimport { GeoShapeType } from \"./geography.shapes.interfaces\";\nexport class GeoPolyline extends GeoShape {\n    constructor(p, type) {\n        super(type ?? GeoShapeType.Polyline);\n        this._points = p;\n    }\n    get points() {\n        return this._points;\n    }\n    _buildEnvelope() {\n        return Envelope.FromPoints(...this._points);\n    }\n}\n//# sourceMappingURL=geography.polyline.js.map","import { GeoBounded } from \"../geography.envelope\";\nexport class GeoShape extends GeoBounded {\n    constructor(t) {\n        super();\n        this._type = t;\n    }\n    get type() {\n        return this._type;\n    }\n}\n//# sourceMappingURL=geography.shape.js.map","export var GeoShapeType;\n(function (GeoShapeType) {\n    GeoShapeType[GeoShapeType[\"Unknown\"] = 100] = \"Unknown\";\n    GeoShapeType[GeoShapeType[\"Point\"] = 101] = \"Point\";\n    GeoShapeType[GeoShapeType[\"Line\"] = 102] = \"Line\";\n    GeoShapeType[GeoShapeType[\"Polyline\"] = 103] = \"Polyline\";\n    GeoShapeType[GeoShapeType[\"Polygon\"] = 104] = \"Polygon\";\n})(GeoShapeType || (GeoShapeType = {}));\nexport function isGeoShape(value) {\n    return value && value.type !== undefined && GeoShapeType[value.type] !== undefined;\n}\n//# sourceMappingURL=geography.shapes.interfaces.js.map","export * from \"./geography.shapes.interfaces\";\nexport * from \"./geography.shape\";\nexport * from \"./geography.polygon\";\nexport * from \"./geography.polyline\";\nexport * from \"./geography.line\";\n//# sourceMappingURL=index.js.map","import { Bounded, Bounds } from \"./geometry.bounds\";\nimport { IsBounds } from \"./geometry.interfaces\";\nexport class BoundedCollection extends Bounded {\n    constructor() {\n        super();\n        this._items = new Array();\n    }\n    get data() {\n        return this._items;\n    }\n    set data(d) {\n        this._items = d;\n        this.invalidateBounds();\n    }\n    get length() {\n        return this._items.length;\n    }\n    push(...views) {\n        this._items.push(...views);\n        this.invalidateBounds();\n    }\n    pop() {\n        const d = this._items.pop();\n        if (d) {\n            this.invalidateBounds();\n        }\n        return d;\n    }\n    findIndex(predicate, thisArg) {\n        return this._items.findIndex(predicate, thisArg);\n    }\n    splice(start, deleteCount) {\n        this._items.splice(start, deleteCount);\n        this.invalidateBounds();\n    }\n    _buildBounds() {\n        return Bounds.FromBounds(...this._items.map((v) => (IsBounds(v) ? v : v.boundingBox)));\n    }\n}\n//# sourceMappingURL=geometry.bounds.collection.js.map","import { Cartesian3 } from \"./geometry.cartesian\";\nimport { IsBounds } from \"./geometry.interfaces\";\nexport class Bounds extends Cartesian3 {\n    static Zero() {\n        return new Bounds(0, 0, 0, 0, 0, 0);\n    }\n    static FromSize(size) {\n        return new Bounds(0, 0, size?.width || 0, size?.height || 0, 0, size?.depth || 0);\n    }\n    static FromBounds(...array) {\n        let rect = undefined;\n        for (let i = 0; i < array.length; i++) {\n            let a = array[i];\n            if (a) {\n                if (IsBounds(a)) {\n                    rect = rect ? rect.unionInPlace(a) : a.clone();\n                }\n                else {\n                    a = a.boundingBox;\n                    if (a) {\n                        rect = rect ? rect.unionInPlace(a) : a.clone();\n                    }\n                }\n            }\n        }\n        return rect;\n    }\n    static FromPoints2(...params) {\n        let i = 0;\n        let xmin = params[i].x;\n        let xmax = params[i].x;\n        let ymin = params[i].y;\n        let ymax = params[i].y;\n        for (; i < params.length; i++) {\n            const p = params[i];\n            if (p) {\n                xmin = Math.min(xmin, p.x);\n                xmax = Math.max(xmax, p.x);\n                ymin = Math.min(ymin, p.y);\n                ymax = Math.max(ymax, p.y);\n            }\n        }\n        return new Bounds(xmin, ymin, xmax - xmin, ymax - ymin);\n    }\n    static FromPoints3(...params) {\n        let i = 0;\n        let xmin = params[i].x;\n        let xmax = params[i].x;\n        let ymin = params[i].y;\n        let ymax = params[i].y;\n        let zmin = params[i].z;\n        let zmax = params[i++].z;\n        for (; i < params.length; i++) {\n            const p = params[i];\n            if (p) {\n                xmin = Math.min(xmin, p.x);\n                xmax = Math.max(xmax, p.x);\n                ymin = Math.min(ymin, p.y);\n                ymax = Math.max(ymax, p.y);\n                zmin = Math.min(zmin, p.z);\n                zmax = Math.max(zmax, p.z);\n            }\n        }\n        return new Bounds(xmin, ymin, xmax - xmin, ymax - ymin, zmin, zmax - zmin);\n    }\n    constructor(x, y, width, height, z = 0, depth = 0) {\n        super(x, y, z);\n        this.width = width;\n        this.height = height;\n        this.depth = depth;\n    }\n    *points() {\n        const r = this.xmax;\n        const t = this.ymax;\n        const f = this.zmax;\n        yield new Cartesian3(this.xmin, this.ymin, this.zmin);\n        yield new Cartesian3(this.xmin, this.ymin, f);\n        yield new Cartesian3(this.xmin, t, this.zmin);\n        yield new Cartesian3(this.xmin, t, f);\n        yield new Cartesian3(r, this.ymin, this.zmin);\n        yield new Cartesian3(r, this.ymin, f);\n        yield new Cartesian3(r, t, this.zmin);\n        yield new Cartesian3(r, t, f);\n    }\n    clone() {\n        return new Bounds(this.x, this.y, this.width, this.height, this.z, this.depth);\n    }\n    get xmin() {\n        return this.x;\n    }\n    get xmax() {\n        return this.x + this.width;\n    }\n    get ymin() {\n        return this.y;\n    }\n    get ymax() {\n        return this.y + this.height;\n    }\n    get zmin() {\n        return this.z;\n    }\n    get zmax() {\n        return this.z + this.depth;\n    }\n    get center() {\n        return new Cartesian3(this.x + this.width / 2, this.y + this.height / 2, this.z + this.depth / 2);\n    }\n    intersects(other) {\n        if (!other || this.xmin > other.xmax || this.xmax < other.xmin || this.ymin > other.ymax || this.ymax < other.ymin || this.zmin > other.zmax || this.zmax < other.zmin) {\n            return false;\n        }\n        return true;\n    }\n    intersection(other, ref) {\n        if (!other || !this.intersects(other)) {\n            return undefined;\n        }\n        const target = ref || Bounds.Zero();\n        target.x = Math.max(this.xmin, other.xmin);\n        target.width = Math.min(this.xmax, other.xmax) - target.x;\n        target.y = Math.max(this.ymin, other.ymin);\n        target.height = Math.min(this.ymax, other.ymax) - target.y;\n        target.z = Math.max(this.zmin, other.zmin);\n        target.depth = Math.min(this.zmax, other.zmax) - target.z;\n        return target;\n    }\n    containsFloat(x, y, z = 0) {\n        return x >= this.xmin && x <= this.xmax && y >= this.ymin && y <= this.ymax && z >= this.zmin && z <= this.zmax;\n    }\n    containsBounds(other) {\n        if (!other)\n            return false;\n        return other.xmin >= this.xmin && other.xmax <= this.xmax && other.ymin >= this.ymin && other.ymax <= this.ymax && other.zmin >= this.zmin && other.zmax <= this.zmax;\n    }\n    unionInPlace(other) {\n        if (!other)\n            return this;\n        const x1 = Math.min(this.x, other.x);\n        const y1 = Math.min(this.y, other.y);\n        const z1 = Math.min(this.z, other.z);\n        const x2 = Math.max(this.xmax, other.xmax);\n        const y2 = Math.max(this.ymax, other.ymax);\n        const z2 = Math.max(this.zmax, other.zmax);\n        this.x = x1;\n        this.y = y1;\n        this.z = z1;\n        this.width = x2 - x1;\n        this.height = y2 - y1;\n        this.depth = z2 - z1;\n        return this;\n    }\n    inflateInPlace(dx, dy, dz = 0) {\n        this.x -= dx;\n        this.y -= dy;\n        this.z -= dz;\n        this.width += 2 * dx;\n        this.height += 2 * dy;\n        this.depth += 2 * dz;\n        return this;\n    }\n    toString() {\n        return `left:${this.xmin}, bottom:${this.ymin}, front:${this.zmin}, right:${this.xmax}, top:${this.ymax}, back:${this.zmax}, width:${this.width}, height:${this.height}, depth:${this.depth}`;\n    }\n}\nexport class Bounded {\n    constructor(bounds, parent) {\n        if (parent) {\n            this._parent = parent;\n        }\n        this._rect = bounds;\n    }\n    get parent() {\n        return this._parent;\n    }\n    get boundingBox() {\n        this.validateBounds();\n        return this._rect;\n    }\n    validateBounds() {\n        if (!this._rect) {\n            this._rect = this._buildBounds();\n        }\n    }\n    invalidateBounds() {\n        if (this._rect) {\n            delete this._rect;\n            if (this._parent) {\n                this._parent.invalidateBounds();\n            }\n        }\n    }\n}\n//# sourceMappingURL=geometry.bounds.js.map","import { Quantity, Scalar } from \"../math\";\nimport { isCartesianArray, RegionCode } from \"./geometry.interfaces\";\nexport class Cartesian2 {\n    static Flatten(values, ref) {\n        ref = ref ?? new Float32Array(values.length * 2);\n        let i = 0;\n        for (let j = 0; j < values.length; j++) {\n            ref[i++] = values[j].x;\n            ref[i++] = values[j].y;\n        }\n        return ref;\n    }\n    static ComputeCode(point, clipArea) {\n        let code = RegionCode.INSIDE;\n        if (point.x < clipArea.xmin) {\n            code |= RegionCode.LEFT;\n        }\n        else if (point.x > clipArea.xmax) {\n            code |= RegionCode.RIGHT;\n        }\n        if (point.y < clipArea.ymin) {\n            code |= RegionCode.BOTTOM;\n        }\n        else if (point.y > clipArea.ymax) {\n            code |= RegionCode.TOP;\n        }\n        return code;\n    }\n    static Dot(a, b) {\n        return a.x * b.y - a.y * b.x;\n    }\n    static Cross(a, b) {\n        return new Cartesian2(a.x * b.y - a.y * b.x, a.y * b.x - a.x * b.y);\n    }\n    static Subtract(a, b) {\n        return new Cartesian2(a.x - b.x, a.y - b.y);\n    }\n    static ConvertInPlace(value, from, to) {\n        return Cartesian2.ConvertToRef(value, from, to, value);\n    }\n    static ConvertToRef(value, from, to, ref) {\n        ref = ref ?? Cartesian2.Zero();\n        ref.x = Quantity.Convert(value.x, from, to);\n        ref.y = Quantity.Convert(value.y, from, to);\n        return ref;\n    }\n    static Zero() {\n        return new Cartesian2(0, 0);\n    }\n    static One() {\n        return new Cartesian2(1, 1);\n    }\n    static Infinity() {\n        return new Cartesian2(Infinity, Infinity);\n    }\n    constructor(x, y) {\n        this.x = x;\n        this.y = y;\n    }\n    toString() {\n        return `x:${this.x}, y:${this.y}`;\n    }\n}\nexport class Cartesian3 extends Cartesian2 {\n    static Dot(a, b) {\n        return a.x * b.x + a.y * b.y + a.z * b.z;\n    }\n    static Cross(a, b) {\n        return new Cartesian3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x);\n    }\n    static Subtract(a, b) {\n        return new Cartesian3(a.x - b.x, a.y - b.y, a.z - b.z);\n    }\n    static Normalize(a) {\n        return Cartesian3.NormalizeToRef(a, Cartesian3.Zero());\n    }\n    static NormalizeInPlace(a) {\n        return Cartesian3.NormalizeToRef(a, a);\n    }\n    static Normal(v0, v1, v2) {\n        return Cartesian3.NormalizeInPlace(Cartesian3.Cross(Cartesian3.Subtract(v1, v0), Cartesian3.Subtract(v2, v0)));\n    }\n    static NormalizeToRef(a, ref) {\n        const length = Math.sqrt(a.x * a.x + a.y * a.y + a.z * a.z);\n        ref.x = a.x / length;\n        ref.y = a.y / length;\n        ref.z = a.z / length;\n        return ref;\n    }\n    static AreCoincident(a, b, epsilon) {\n        const length = Cartesian3.Magnitude(Cartesian3.Subtract(a, b));\n        return length <= (epsilon ?? Scalar.EPSILON);\n    }\n    static AreCollinear(a, b, c, epsilon) {\n        const length = Cartesian3.Magnitude(Cartesian3.Cross(Cartesian3.Subtract(b, a), Cartesian3.Subtract(c, a)));\n        return length <= (epsilon ?? Scalar.EPSILON);\n    }\n    static IsWithinTheBounds(a, b, p) {\n        if (!Cartesian3.AreCollinear(a, b, p)) {\n            return false;\n        }\n        const ab = Cartesian3.Subtract(b, a);\n        const ap = Cartesian3.Subtract(p, a);\n        const bp = Cartesian3.Subtract(p, b);\n        if (Cartesian3.Dot(ab, ap) < 0) {\n            return false;\n        }\n        if (Cartesian3.Dot(ab, bp) > 0) {\n            return false;\n        }\n        return true;\n    }\n    static AreCoplanar(a, b, c, d, epsilon) {\n        var n1 = Cartesian3.Cross(Cartesian3.Subtract(c, a), Cartesian3.Subtract(c, b));\n        var n2 = Cartesian3.Cross(Cartesian3.Subtract(d, a), Cartesian3.Subtract(d, b));\n        var m1 = Cartesian3.Magnitude(n1);\n        var m2 = Cartesian3.Magnitude(n2);\n        const EPSILON = epsilon ?? Scalar.EPSILON;\n        return (m1 <= EPSILON ||\n            m2 <= EPSILON ||\n            Cartesian3.AreCollinear(Cartesian3.Zero(), Cartesian3.MultiplyByFloatInPlace(n1, 1.0 / m1), Cartesian3.MultiplyByFloatInPlace(n2, 1.0 / m2)));\n    }\n    static Multiply(a, b) {\n        return Cartesian3.MultiplyToRef(a, b, Cartesian3.Zero());\n    }\n    static MultiplyInPlace(a, b) {\n        return Cartesian3.MultiplyToRef(a, b, a);\n    }\n    static MultiplyToRef(a, b, ref) {\n        ref.x = a.x * b.x;\n        ref.y = a.y * b.y;\n        ref.z = a.z * b.z;\n        return ref;\n    }\n    static MultiplyByFloatInPlace(a, n) {\n        return Cartesian3.MultiplyByFloatToRef(a, n, a);\n    }\n    static MultiplyByFloatToRef(a, n, ref) {\n        ref.x = a.x * n;\n        ref.y = a.y * n;\n        ref.z = a.z * n;\n        return ref;\n    }\n    static Divide(a, b) {\n        return Cartesian3.DivideToRef(a, b, Cartesian3.Zero());\n    }\n    static DivideInPlace(a, b) {\n        return Cartesian3.DivideToRef(a, b, a);\n    }\n    static DivideToRef(a, b, ref) {\n        ref.x = b.x ? a.x / b.x : Infinity;\n        ref.y = b.y ? a.y / b.y : Infinity;\n        ref.z = b.z ? a.z / b.z : Infinity;\n        return ref;\n    }\n    static DivideByFloatInPlace(a, n) {\n        return Cartesian3.DivideByFloatToRef(a, n, a);\n    }\n    static DivideByFloatToRef(a, n, ref) {\n        if (n === 0) {\n            ref.x = ref.y = ref.z = Infinity;\n        }\n        ref.x = a.x / n;\n        ref.y = a.y / n;\n        ref.z = a.z / n;\n        return ref;\n    }\n    static Distance(a, b) {\n        return Cartesian3.Magnitude(Cartesian3.Subtract(b, a));\n    }\n    static Magnitude(a) {\n        return Math.sqrt(a.x * a.x + a.y * a.y + a.z * a.z);\n    }\n    static ConvertInPlace(value, from, to) {\n        return Cartesian3.ConvertToRef(value, from, to, value);\n    }\n    static ConvertToRef(value, from, to, ref) {\n        ref = ref ?? Cartesian3.Zero();\n        ref.x = Quantity.Convert(value.x, from, to);\n        ref.y = Quantity.Convert(value.y, from, to);\n        ref.z = Quantity.Convert(value.z, from, to);\n        return ref;\n    }\n    static Centroid(values, ref) {\n        let x = 0;\n        let y = 0;\n        let z = 0;\n        let count = values.length;\n        if (isCartesianArray(values)) {\n            for (let i = 0; i < values.length; i++) {\n                x += values[i].x;\n                y += values[i].y;\n                z += values[i].z;\n            }\n        }\n        else {\n            count = values.length / 3;\n            for (let i = 0; i < values.length;) {\n                x += values[i++];\n                y += values[i++];\n                z += values[i++];\n            }\n        }\n        ref = ref ?? Cartesian3.Zero();\n        ref.x = x / count;\n        ref.y = y / count;\n        ref.z = z / count;\n        return ref;\n    }\n    static Zero() {\n        return new Cartesian3(0, 0, 0);\n    }\n    static One() {\n        return new Cartesian3(1.0, 1.0, 1.0);\n    }\n    static Infinity() {\n        return new Cartesian3(Infinity, Infinity, Infinity);\n    }\n    static FromArray(array, offset = 0, stride = 3) {\n        let i = 0;\n        const x = array[offset + i];\n        const y = i < stride ? array[offset + ++i] : 0;\n        const z = i < stride ? array[offset + ++i] : 0;\n        return new Cartesian3(x, y, z);\n    }\n    static Flatten(values, ref) {\n        ref = ref ?? new Float32Array(values.length * 3);\n        let i = 0;\n        for (let j = 0; j < values.length; j++) {\n            ref[i++] = values[j].x;\n            ref[i++] = values[j].y;\n            ref[i++] = values[j].z;\n        }\n        return ref;\n    }\n    static Equals(a, b, epsilon) {\n        epsilon = epsilon ?? Scalar.EPSILON;\n        return Scalar.WithinEpsilon(a.x, b.x, epsilon) && Scalar.WithinEpsilon(a.y, b.y, epsilon) && Scalar.WithinEpsilon(a.z, b.z, epsilon);\n    }\n    constructor(x, y, z = 0.0) {\n        super(x, y);\n        this.z = z;\n    }\n    toString() {\n        return `x:${this.x}, y:${this.y}, z:${this.z}`;\n    }\n}\nexport class Cartesian4 extends Cartesian3 {\n    static Zero() {\n        return new Cartesian4(0, 0, 0);\n    }\n    constructor(x, y, z, w = 1.0) {\n        super(x, y, z);\n        this.w = w;\n    }\n    toString() {\n        return `x:${this.x}, y:${this.y}, z:${this.z}, w:${this.w}`;\n    }\n}\n//# sourceMappingURL=geometry.cartesian.js.map","import { Assert } from \"../utils\";\nimport { Cartesian3 } from \"./geometry.cartesian\";\nclass Face {\n    constructor(v0, v1, v2, o0, o1, o2, normal) {\n        this.Vertex0 = v0;\n        this.Vertex1 = v1;\n        this.Vertex2 = v2;\n        this.Opposite0 = o0;\n        this.Opposite1 = o1;\n        this.Opposite2 = o2;\n        this.Normal = normal;\n    }\n    Equals(other) {\n        return (this.Vertex0 == other.Vertex0 &&\n            this.Vertex1 == other.Vertex1 &&\n            this.Vertex2 == other.Vertex2 &&\n            this.Opposite0 == other.Opposite0 &&\n            this.Opposite1 == other.Opposite1 &&\n            this.Opposite2 == other.Opposite2 &&\n            this.Normal == other.Normal);\n    }\n}\nclass PointFace {\n    constructor(p, f, d) {\n        this.Point = p;\n        this.Face = f;\n        this.Distance = d;\n    }\n}\nclass HorizonEdge {\n    constructor(Face = 0, Edge0 = 0, Edge1 = 0) {\n        this.Face = Face;\n        this.Edge0 = Edge0;\n        this.Edge1 = Edge1;\n    }\n}\nexport class QuickHull {\n    constructor() {\n        this.openSetTail = -1;\n        this.faceCount = 0;\n        this.faces = new Map();\n        this.litFaces = new Set();\n        this.horizon = new Array();\n        this.openSet = new Array();\n        this.hullVerts = new Map();\n    }\n    generateHull(points, splitVerts = false) {\n        if (points.length < 4) {\n            throw new Error(\"Need at least 4 points to generate a convex hull\");\n        }\n        this._initialize(points, splitVerts);\n        this._generateInitialHull(points);\n        while (this.openSetTail >= 0) {\n            this._growHull(points);\n        }\n        const exported = this._exportMeshData(points, splitVerts);\n        return exported;\n    }\n    _initialize(points, splitVerts) {\n        this.faceCount = 0;\n        this.openSetTail = -1;\n        this.faces.clear();\n        this.litFaces?.clear();\n        this.horizon = [];\n        this.openSet = [];\n        if (!splitVerts) {\n            this.hullVerts.clear();\n        }\n    }\n    _generateInitialHull(points) {\n        const b = this._findInitialHullIndices(points);\n        const b0 = b[0];\n        const b1 = b[1];\n        const b2 = b[2];\n        const b3 = b[3];\n        var v0 = points[b0];\n        var v1 = points[b1];\n        var v2 = points[b2];\n        var v3 = points[b3];\n        var above = Cartesian3.Dot(Cartesian3.Subtract(v3, v1), Cartesian3.Cross(Cartesian3.Subtract(v1, v0), Cartesian3.Subtract(v2, v0))) > 0.0;\n        this.faceCount = 0;\n        if (above) {\n            this.faces.set(this.faceCount++, new Face(b0, b2, b1, 3, 1, 2, Cartesian3.Normal(points[b0], points[b2], points[b1])));\n            this.faces.set(this.faceCount++, new Face(b0, b1, b3, 3, 2, 0, Cartesian3.Normal(points[b0], points[b1], points[b3])));\n            this.faces.set(this.faceCount++, new Face(b0, b3, b2, 3, 0, 1, Cartesian3.Normal(points[b0], points[b3], points[b2])));\n            this.faces.set(this.faceCount++, new Face(b1, b2, b3, 2, 1, 0, Cartesian3.Normal(points[b1], points[b2], points[b3])));\n        }\n        else {\n            this.faces.set(this.faceCount++, new Face(b0, b1, b2, 3, 2, 1, Cartesian3.Normal(points[b0], points[b1], points[b2])));\n            this.faces.set(this.faceCount++, new Face(b0, b3, b1, 3, 0, 2, Cartesian3.Normal(points[b0], points[b3], points[b1])));\n            this.faces.set(this.faceCount++, new Face(b0, b2, b3, 3, 1, 0, Cartesian3.Normal(points[b0], points[b2], points[b3])));\n            this.faces.set(this.faceCount++, new Face(b1, b3, b2, 2, 0, 1, Cartesian3.Normal(points[b1], points[b3], points[b2])));\n        }\n        this._verifyFaces(points);\n        for (let i = 0; i < points.length; i++) {\n            if (i == b0 || i == b1 || i == b2 || i == b3)\n                continue;\n            this.openSet.push(new PointFace(i, QuickHull.UNASSIGNED, 0.0));\n        }\n        this.openSet.push(new PointFace(b0, QuickHull.INSIDE, Number.NaN));\n        this.openSet.push(new PointFace(b1, QuickHull.INSIDE, Number.NaN));\n        this.openSet.push(new PointFace(b2, QuickHull.INSIDE, Number.NaN));\n        this.openSet.push(new PointFace(b3, QuickHull.INSIDE, Number.NaN));\n        this.openSetTail = this.openSet.length - 5;\n        Assert(this.openSet.length == points.length);\n        for (let i = 0; i <= this.openSetTail; i++) {\n            Assert(this.openSet[i].Face == QuickHull.UNASSIGNED);\n            Assert(this.openSet[this.openSetTail].Face == QuickHull.UNASSIGNED);\n            Assert(this.openSet[this.openSetTail + 1].Face == QuickHull.INSIDE);\n            var assigned = false;\n            var fp = this.openSet[i];\n            Assert(this.faces.size == 4);\n            Assert(this.faces.size == this.faceCount);\n            for (let j = 0; j < 4; j++) {\n                Assert(this.faces.has(j));\n                var face = this.faces.get(j);\n                var dist = this._pointFaceDistance(points[fp.Point], points[face.Vertex0], face);\n                if (dist > 0) {\n                    fp.Face = j;\n                    fp.Distance = dist;\n                    this.openSet[i] = fp;\n                    assigned = true;\n                    break;\n                }\n            }\n            if (!assigned) {\n                fp.Face = QuickHull.INSIDE;\n                fp.Distance = Number.NaN;\n                this.openSet[i] = this.openSet[this.openSetTail];\n                this.openSet[this.openSetTail] = fp;\n                this.openSetTail -= 1;\n                i -= 1;\n            }\n        }\n        this._verifyOpenSet(points);\n    }\n    _findInitialHullIndices(points) {\n        var count = points.length;\n        for (let i0 = 0; i0 < count - 3; i0++) {\n            for (let i1 = i0 + 1; i1 < count - 2; i1++) {\n                var p0 = points[i0];\n                var p1 = points[i1];\n                if (Cartesian3.AreCoincident(p0, p1, QuickHull.EPSILON))\n                    continue;\n                for (let i2 = i1 + 1; i2 < count - 1; i2++) {\n                    var p2 = points[i2];\n                    if (Cartesian3.AreCollinear(p0, p1, p2, QuickHull.EPSILON))\n                        continue;\n                    for (let i3 = i2 + 1; i3 < count - 0; i3++) {\n                        var p3 = points[i3];\n                        if (Cartesian3.AreCoplanar(p0, p1, p2, p3, QuickHull.EPSILON))\n                            continue;\n                        return [i0, i1, i2, i3];\n                    }\n                }\n            }\n        }\n        throw new Error(\"Can't generate hull, points are coplanar\");\n    }\n    _growHull(points) {\n        Assert(this.openSetTail >= 0);\n        Assert(this.openSet[0].Face != QuickHull.INSIDE);\n        var farthestPoint = 0;\n        var dist = this.openSet[0].Distance;\n        for (let i = 1; i <= this.openSetTail; i++) {\n            if (this.openSet[i].Distance > dist) {\n                farthestPoint = i;\n                dist = this.openSet[i].Distance;\n            }\n        }\n        this._findHorizon(points, points[this.openSet[farthestPoint].Point], this.openSet[farthestPoint].Face, this.faces.get(this.openSet[farthestPoint].Face));\n        this._verifyHorizon();\n        this._constructCone(points, this.openSet[farthestPoint].Point);\n        this._verifyFaces(points);\n        this._reassignPoints(points);\n    }\n    _findHorizon(points, point, fi, face) {\n        Assert(face != null && face != undefined);\n        this.litFaces.clear();\n        this.horizon = [];\n        this.litFaces.add(fi);\n        Assert(this._pointFaceDistance(point, points[face.Vertex0], face) > 0.0);\n        {\n            var oppositeFace = this.faces.get(face.Opposite0);\n            var dist = this._pointFaceDistance(point, points[oppositeFace.Vertex0], oppositeFace);\n            if (dist <= 0.0) {\n                this.horizon.push(new HorizonEdge(face.Opposite0, face.Vertex1, face.Vertex2));\n            }\n            else {\n                this._searchHorizon(points, point, fi, face.Opposite0, oppositeFace);\n            }\n        }\n        if (!this.litFaces.has(face.Opposite1)) {\n            var oppositeFace = this.faces.get(face.Opposite1);\n            var dist = this._pointFaceDistance(point, points[oppositeFace.Vertex0], oppositeFace);\n            if (dist <= 0.0) {\n                this.horizon.push(new HorizonEdge(face.Opposite1, face.Vertex2, face.Vertex0));\n            }\n            else {\n                this._searchHorizon(points, point, fi, face.Opposite1, oppositeFace);\n            }\n        }\n        if (!this.litFaces.has(face.Opposite2)) {\n            var oppositeFace = this.faces.get(face.Opposite2);\n            var dist = this._pointFaceDistance(point, points[oppositeFace.Vertex0], oppositeFace);\n            if (dist <= 0.0) {\n                this.horizon.push(new HorizonEdge(face.Opposite2, face.Vertex0, face.Vertex1));\n            }\n            else {\n                this._searchHorizon(points, point, fi, face.Opposite2, oppositeFace);\n            }\n        }\n    }\n    _searchHorizon(points, point, prevFaceIndex, faceCount, face) {\n        Assert(prevFaceIndex >= 0);\n        Assert(this.litFaces.has(prevFaceIndex));\n        Assert(!this.litFaces.has(faceCount));\n        Assert(this.faces.get(faceCount)?.Equals(face));\n        this.litFaces.add(faceCount);\n        let nextFaceIndex0;\n        let nextFaceIndex1;\n        let edge0;\n        let edge1;\n        let edge2;\n        if (prevFaceIndex == face.Opposite0) {\n            nextFaceIndex0 = face.Opposite1;\n            nextFaceIndex1 = face.Opposite2;\n            edge0 = face.Vertex2;\n            edge1 = face.Vertex0;\n            edge2 = face.Vertex1;\n        }\n        else if (prevFaceIndex == face.Opposite1) {\n            nextFaceIndex0 = face.Opposite2;\n            nextFaceIndex1 = face.Opposite0;\n            edge0 = face.Vertex0;\n            edge1 = face.Vertex1;\n            edge2 = face.Vertex2;\n        }\n        else {\n            Assert(prevFaceIndex == face.Opposite2);\n            nextFaceIndex0 = face.Opposite0;\n            nextFaceIndex1 = face.Opposite1;\n            edge0 = face.Vertex1;\n            edge1 = face.Vertex2;\n            edge2 = face.Vertex0;\n        }\n        if (!this.litFaces.has(nextFaceIndex0)) {\n            const oppositeFace = this.faces.get(nextFaceIndex0);\n            const dist = this._pointFaceDistance(point, points[oppositeFace.Vertex0], oppositeFace);\n            if (dist <= 0.0) {\n                this.horizon.push(new HorizonEdge(nextFaceIndex0, edge0, edge1));\n            }\n            else {\n                this._searchHorizon(points, point, faceCount, nextFaceIndex0, oppositeFace);\n            }\n        }\n        if (!this.litFaces.has(nextFaceIndex1)) {\n            const oppositeFace = this.faces.get(nextFaceIndex1);\n            const dist = this._pointFaceDistance(point, points[oppositeFace.Vertex0], oppositeFace);\n            if (dist <= 0.0) {\n                this.horizon.push(new HorizonEdge(nextFaceIndex1, edge1, edge2));\n            }\n            else {\n                this._searchHorizon(points, point, faceCount, nextFaceIndex1, oppositeFace);\n            }\n        }\n    }\n    _constructCone(points, farthestPoint) {\n        for (let fi of this.litFaces) {\n            Assert(this.faces.has(fi));\n            this.faces.delete(fi);\n        }\n        const firstNewFace = this.faceCount;\n        for (let i = 0; i < this.horizon.length; i++) {\n            const v0 = farthestPoint;\n            const v1 = this.horizon[i].Edge0;\n            const v2 = this.horizon[i].Edge1;\n            const o0 = this.horizon[i].Face;\n            const o1 = i == this.horizon.length - 1 ? firstNewFace : firstNewFace + i + 1;\n            const o2 = i == 0 ? firstNewFace + this.horizon.length - 1 : firstNewFace + i - 1;\n            let fi = this.faceCount++;\n            this.faces.set(fi, new Face(v0, v1, v2, o0, o1, o2, Cartesian3.Normal(points[v0], points[v1], points[v2])));\n            var horizonFace = this.faces.get(this.horizon[i].Face);\n            if (horizonFace.Vertex0 == v1) {\n                Assert(v2 == horizonFace.Vertex2);\n                horizonFace.Opposite1 = fi;\n            }\n            else if (horizonFace.Vertex1 == v1) {\n                Assert(v2 == horizonFace.Vertex0);\n                horizonFace.Opposite2 = fi;\n            }\n            else {\n                Assert(v1 == horizonFace.Vertex2);\n                Assert(v2 == horizonFace.Vertex1);\n                horizonFace.Opposite0 = fi;\n            }\n            this.faces.set(this.horizon[i].Face, horizonFace);\n        }\n    }\n    _reassignPoints(points) {\n        for (let i = 0; i <= this.openSetTail; i++) {\n            var fp = this.openSet[i];\n            if (this.litFaces.has(fp.Face)) {\n                var assigned = false;\n                var point = points[fp.Point];\n                for (let [fi, face] of this.faces) {\n                    var dist = this._pointFaceDistance(point, points[face.Vertex0], face);\n                    if (dist > QuickHull.EPSILON) {\n                        assigned = true;\n                        fp.Face = fi;\n                        fp.Distance = dist;\n                        this.openSet[i] = fp;\n                        break;\n                    }\n                }\n                if (!assigned) {\n                    fp.Face = QuickHull.INSIDE;\n                    fp.Distance = Number.NaN;\n                    this.openSet[i] = this.openSet[this.openSetTail];\n                    this.openSet[this.openSetTail] = fp;\n                    i--;\n                    this.openSetTail--;\n                }\n            }\n        }\n    }\n    _exportMeshData(points, splitVerts) {\n        const verts = new Array();\n        const tris = new Array();\n        const normals = new Array();\n        for (let face of this.faces.values()) {\n            let vi0 = 0, vi1 = 0, vi2 = 0;\n            if (splitVerts) {\n                vi0 = verts.length;\n                verts.push(points[face.Vertex0]);\n                vi1 = verts.length;\n                verts.push(points[face.Vertex1]);\n                vi2 = verts.length;\n                verts.push(points[face.Vertex2]);\n                normals.push(face.Normal);\n                normals.push(face.Normal);\n                normals.push(face.Normal);\n            }\n            else {\n                let tmp = this.hullVerts.get(face.Vertex0);\n                if (!tmp) {\n                    vi0 = verts.length;\n                    this.hullVerts.set(face.Vertex0, vi0);\n                    verts.push(points[face.Vertex0]);\n                }\n                else {\n                    vi0 = tmp;\n                }\n                tmp = this.hullVerts.get(face.Vertex1);\n                if (!tmp) {\n                    vi1 = verts.length;\n                    this.hullVerts.set(face.Vertex1, vi1);\n                    verts.push(points[face.Vertex1]);\n                }\n                else {\n                    vi1 = tmp;\n                }\n                tmp = this.hullVerts.get(face.Vertex2);\n                if (!tmp) {\n                    vi2 = verts.length;\n                    this.hullVerts.set(face.Vertex2, vi2);\n                    verts.push(points[face.Vertex2]);\n                }\n                else {\n                    vi2 = tmp;\n                }\n            }\n            tris.push(vi0);\n            tris.push(vi1);\n            tris.push(vi2);\n        }\n        return { vertices: verts, faces: tris, normals: normals };\n    }\n    _pointFaceDistance(point, pointOnFace, face) {\n        return Cartesian3.Dot(face.Normal, Cartesian3.Subtract(point, pointOnFace));\n    }\n    _verifyOpenSet(points) {\n        for (let i = 0; i < this.openSet.length; i++) {\n            if (i > this.openSetTail) {\n                Assert(this.openSet[i].Face == QuickHull.INSIDE);\n            }\n            else {\n                Assert(this.openSet[i].Face != QuickHull.INSIDE);\n                Assert(this.openSet[i].Face != QuickHull.UNASSIGNED);\n                Assert(this._pointFaceDistance(points[this.openSet[i].Point], points[this.faces.get(this.openSet[i].Face).Vertex0], this.faces.get(this.openSet[i].Face)) > 0.0);\n            }\n        }\n    }\n    _verifyHorizon() {\n        for (let i = 0; i < this.horizon.length; i++) {\n            const prev = i == 0 ? this.horizon.length - 1 : i - 1;\n            Assert(this.horizon[prev].Edge1 == this.horizon[i].Edge0);\n            Assert(this._hasEdge(this.faces.get(this.horizon[i].Face), this.horizon[i].Edge1, this.horizon[i].Edge0));\n        }\n    }\n    _verifyFaces(points) {\n        for (var [fi, face] of this.faces) {\n            Assert(this.faces.has(face.Opposite0));\n            Assert(this.faces.has(face.Opposite1));\n            Assert(this.faces.has(face.Opposite2));\n            Assert(face.Opposite0 != fi);\n            Assert(face.Opposite1 != fi);\n            Assert(face.Opposite2 != fi);\n            Assert(face.Vertex0 != face.Vertex1);\n            Assert(face.Vertex0 != face.Vertex2);\n            Assert(face.Vertex1 != face.Vertex2);\n            Assert(this._hasEdge(this.faces.get(face.Opposite0), face.Vertex2, face.Vertex1));\n            Assert(this._hasEdge(this.faces.get(face.Opposite1), face.Vertex0, face.Vertex2));\n            Assert(this._hasEdge(this.faces.get(face.Opposite2), face.Vertex1, face.Vertex0));\n            const tmp = Cartesian3.Subtract(face.Normal, Cartesian3.Normal(points[face.Vertex0], points[face.Vertex1], points[face.Vertex2]));\n            Assert(Cartesian3.Magnitude(tmp) < QuickHull.EPSILON);\n        }\n    }\n    _hasEdge(f, e0, e1) {\n        if (f == undefined)\n            return false;\n        return (f.Vertex0 == e0 && f.Vertex1 == e1) || (f.Vertex1 == e0 && f.Vertex2 == e1) || (f.Vertex2 == e0 && f.Vertex0 == e1);\n    }\n}\nQuickHull.UNASSIGNED = -2;\nQuickHull.INSIDE = -1;\nQuickHull.EPSILON = 0.0001;\n//# sourceMappingURL=geometry.convex.quickhull.js.map","export var RegionCode;\n(function (RegionCode) {\n    RegionCode[RegionCode[\"INSIDE\"] = 0] = \"INSIDE\";\n    RegionCode[RegionCode[\"LEFT\"] = 1] = \"LEFT\";\n    RegionCode[RegionCode[\"RIGHT\"] = 2] = \"RIGHT\";\n    RegionCode[RegionCode[\"BOTTOM\"] = 4] = \"BOTTOM\";\n    RegionCode[RegionCode[\"TOP\"] = 8] = \"TOP\";\n})(RegionCode || (RegionCode = {}));\nexport function isCartesian(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return b.x !== undefined && b.y !== undefined;\n}\nexport function isCartesian3(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return b.x !== undefined && b.y !== undefined && b.z !== undefined;\n}\nexport function isCartesianArray(b) {\n    return Array.isArray(b) && b.every(isCartesian);\n}\nexport function isArrayOfCartesianArray(input) {\n    if (!Array.isArray(input)) {\n        return false;\n    }\n    return input.every(isCartesianArray);\n}\nexport function isCartesian4(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return b.x !== undefined && b.y !== undefined && b.z !== undefined && b.w !== undefined;\n}\nexport var Side;\n(function (Side) {\n    Side[Side[\"left\"] = 0] = \"left\";\n    Side[Side[\"top\"] = 1] = \"top\";\n    Side[Side[\"right\"] = 2] = \"right\";\n    Side[Side[\"bottom\"] = 3] = \"bottom\";\n})(Side || (Side = {}));\nexport function IsSize(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return b.height !== undefined && b.width !== undefined;\n}\nexport function IsSize3(size) {\n    return IsSize(size) && size.depth !== undefined;\n}\nexport function IsBounds(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return (b.xmin !== undefined &&\n        b.ymin !== undefined &&\n        b.zmin !== undefined &&\n        b.xmax !== undefined &&\n        b.ymax !== undefined &&\n        b.zmax !== undefined);\n}\n//# sourceMappingURL=geometry.interfaces.js.map","import { Assert } from \"../utils\";\nimport { Cartesian2, Cartesian3 } from \"./geometry.cartesian\";\nimport { PolylineSimplifier } from \"./geometry.simplify\";\nexport class PlaneDefinition {\n    constructor(p, n, hull) {\n        this._hull = [];\n        this._point = p;\n        this._normal = n;\n        this._hull = hull;\n    }\n    get point() {\n        return this._point;\n    }\n    get normal() {\n        return this._normal;\n    }\n    get hull() {\n        return this._hull;\n    }\n}\nclass NormalGroup {\n    constructor(normal) {\n        this.indices = new Set();\n        this.center = Cartesian3.Zero();\n        this.normal = normal;\n    }\n}\nexport class PlaneCruncher {\n    constructor() {\n        this._positions = null;\n        this._indices = null;\n        this._groups = [];\n    }\n    withTolerance(tolerance) {\n        this._tolerance = tolerance;\n        return this;\n    }\n    withPositions(positions) {\n        this._positions = positions;\n        return this;\n    }\n    withIndices(indices) {\n        this._indices = indices;\n        return this;\n    }\n    crunch() {\n        Assert(this._positions !== null && this._indices !== null, \"Positions and indices must be set before crunching.\");\n        this._buildGroups(this._tolerance ?? PlaneCruncher.DEFAULT_TOLERANCE);\n        const planes = [];\n        for (let g of this._groups) {\n            const t = this._createTranslationMatrix(g.center);\n            const r = this._createRotationMatrix(g.normal);\n            const m = this._multiplyMatrices(r, t);\n            const inv = this._invertMatrix(m);\n            const transformed = Array.from(g.indices).map((i) => {\n                let p = Cartesian3.FromArray(this._positions, i * 3);\n                p = this._transformPoint(p, m);\n                return { x: p.x, y: p.y };\n            });\n            const hull = this._grahamScan(transformed);\n            const simplified = PolylineSimplifier.Shared.simplify(hull);\n            const convertedHull = simplified.map((p) => {\n                const point = { x: p.x, y: p.y, z: 0 };\n                return this._transformPoint(point, inv);\n            });\n            const p = new PlaneDefinition(g.center, g.normal, convertedHull);\n            planes.push(p);\n        }\n        return planes;\n    }\n    _buildGroups(epsilon) {\n        if (this._positions === null || this._indices === null)\n            return;\n        for (let i = 0; i != this._indices?.length; i += 3) {\n            const i1 = this._indices[i];\n            const i2 = this._indices[i + 1];\n            const i3 = this._indices[i + 2];\n            const p1 = Cartesian3.FromArray(this._positions, i1 * 3);\n            const p2 = Cartesian3.FromArray(this._positions, i2 * 3);\n            const p3 = Cartesian3.FromArray(this._positions, i3 * 3);\n            const normal = Cartesian3.Normal(p1, p2, p3);\n            let group = this._groups.find((g) => {\n                if (Cartesian3.Equals(g.normal, normal, epsilon)) {\n                    return true;\n                }\n                return false;\n            });\n            if (group === undefined) {\n                group = new NormalGroup(normal);\n                this._groups.push(group);\n            }\n            group.indices.add(i1);\n            group.indices.add(i2);\n            group.indices.add(i3);\n        }\n        for (let g of this._groups) {\n            g.center = Cartesian3.Centroid(Array.from(g.indices).map((i) => Cartesian3.FromArray(this._positions, i * 3)), g.center);\n        }\n    }\n    _grahamScan(points) {\n        if (points.length < 3) {\n            throw new Error(\"At least three points are required\");\n        }\n        let startPoint = points[0];\n        for (const point of points) {\n            if (point.y < startPoint.y || (point.y === startPoint.y && point.x < startPoint.x)) {\n                startPoint = point;\n            }\n        }\n        const sortedPoints = points.slice().sort((a, b) => {\n            const angleA = Math.atan2(a.y - startPoint.y, a.x - startPoint.x);\n            const angleB = Math.atan2(b.y - startPoint.y, b.x - startPoint.x);\n            return angleA - angleB;\n        });\n        const hull = [sortedPoints[0], sortedPoints[1]];\n        for (let i = 2; i < sortedPoints.length; i++) {\n            while (hull.length >= 2) {\n                const top = hull[hull.length - 1];\n                const nextToTop = hull[hull.length - 2];\n                const cross = Cartesian2.Dot(Cartesian2.Subtract(top, nextToTop), Cartesian2.Subtract(sortedPoints[i], top));\n                if (cross > 0) {\n                    break;\n                }\n                hull.pop();\n            }\n            hull.push(sortedPoints[i]);\n        }\n        return hull;\n    }\n    _createTranslationMatrix(p) {\n        return [\n            [1, 0, 0, -p.x],\n            [0, 1, 0, -p.y],\n            [0, 0, 1, -p.z],\n            [0, 0, 0, 1],\n        ];\n    }\n    _createRotationMatrix(n) {\n        const normalizedN = Cartesian3.Normalize(n);\n        if (Math.abs(normalizedN.x) < 1e-6 && Math.abs(normalizedN.y) < 1e-6 && Math.abs(normalizedN.z - 1) < 1e-6) {\n            return [\n                [1, 0, 0, 0],\n                [0, 1, 0, 0],\n                [0, 0, 1, 0],\n                [0, 0, 0, 1],\n            ];\n        }\n        const axis = { x: normalizedN.y, y: -normalizedN.x, z: 0 };\n        const axisLength = Math.sqrt(axis.x * axis.x + axis.y * axis.y);\n        if (axisLength !== 0) {\n            axis.x /= axisLength;\n            axis.y /= axisLength;\n        }\n        const cosTheta = normalizedN.z;\n        const sinTheta = Math.sqrt(1 - cosTheta * cosTheta);\n        const oneMinusCosTheta = 1 - cosTheta;\n        const { x: u, y: v } = axis;\n        return [\n            [cosTheta + u * u * oneMinusCosTheta, u * v * oneMinusCosTheta, v * sinTheta, 0],\n            [u * v * oneMinusCosTheta, cosTheta + v * v * oneMinusCosTheta, -u * sinTheta, 0],\n            [-v * sinTheta, u * sinTheta, cosTheta, 0],\n            [0, 0, 0, 1],\n        ];\n    }\n    _multiplyMatrices(a, b) {\n        const result = Array.from({ length: 4 }, () => Array(4).fill(0));\n        for (let i = 0; i < 4; i++) {\n            for (let j = 0; j < 4; j++) {\n                for (let k = 0; k < 4; k++) {\n                    result[i][j] += a[i][k] * b[k][j];\n                }\n            }\n        }\n        return result;\n    }\n    _invertMatrix(matrix) {\n        const m = JSON.parse(JSON.stringify(matrix));\n        const inv = [\n            [1, 0, 0, 0],\n            [0, 1, 0, 0],\n            [0, 0, 1, 0],\n            [0, 0, 0, 1],\n        ];\n        for (let i = 0; i < 4; i++) {\n            let pivot = m[i][i];\n            if (pivot === 0) {\n                for (let j = i + 1; j < 4; j++) {\n                    if (m[j][i] !== 0) {\n                        [m[i], m[j]] = [m[j], m[i]];\n                        [inv[i], inv[j]] = [inv[j], inv[i]];\n                        pivot = m[i][i];\n                        break;\n                    }\n                }\n            }\n            for (let j = 0; j < 4; j++) {\n                m[i][j] /= pivot;\n                inv[i][j] /= pivot;\n            }\n            for (let j = 0; j < 4; j++) {\n                if (i !== j) {\n                    const factor = m[j][i];\n                    for (let k = 0; k < 4; k++) {\n                        m[j][k] -= factor * m[i][k];\n                        inv[j][k] -= factor * inv[i][k];\n                    }\n                }\n            }\n        }\n        return inv;\n    }\n    _transformPoint(point, transformationMatrix) {\n        const pointHomogeneous = [point.x, point.y, point.z, 1];\n        const transformedPointHomogeneous = [0, 0, 0, 0];\n        for (let i = 0; i < 4; i++) {\n            for (let j = 0; j < 4; j++) {\n                transformedPointHomogeneous[i] += transformationMatrix[i][j] * pointHomogeneous[j];\n            }\n        }\n        return {\n            x: transformedPointHomogeneous[0] / transformedPointHomogeneous[3],\n            y: transformedPointHomogeneous[1] / transformedPointHomogeneous[3],\n            z: transformedPointHomogeneous[2] / transformedPointHomogeneous[3],\n        };\n    }\n}\nPlaneCruncher.DEFAULT_TOLERANCE = 0.0001;\n//# sourceMappingURL=geometry.plane.cruncher.js.map","export class PolylineSimplifier {\n    constructor(tolerance = PolylineSimplifier.DEFAULT_TOLERANCE, highestQuality = false) {\n        this._tolerance = tolerance;\n        this._highestQuality = highestQuality;\n    }\n    simplify(points, tolerance, highestQuality) {\n        if (points.length <= 2)\n            return points;\n        const toleranceValue = tolerance ?? this._tolerance;\n        const highestQualityValue = highestQuality ?? this._highestQuality;\n        points = highestQualityValue ? points : this._simplifyDouglasPeucker(points, toleranceValue);\n        return this._simplifyRadialDist(points, this._tolerance);\n    }\n    _simplifyRadialDist(points, sqTolerance) {\n        let prevPoint = points[0], newPoints = [prevPoint], point = prevPoint;\n        for (var i = 1, len = points.length; i < len; i++) {\n            point = points[i];\n            if (this._getSqDist(point, prevPoint) > sqTolerance) {\n                newPoints.push(point);\n                prevPoint = point;\n            }\n        }\n        if (prevPoint !== point)\n            newPoints.push(point);\n        return newPoints;\n    }\n    _simplifyDouglasPeucker(points, sqTolerance) {\n        var last = points.length - 1;\n        var simplified = [points[0]];\n        this._simplifyDPStep(points, 0, last, sqTolerance, simplified);\n        simplified.push(points[last]);\n        return simplified;\n    }\n    _getSqDist(p1, p2) {\n        var dx = p1.x - p2.x, dy = p1.y - p2.y;\n        return dx * dx + dy * dy;\n    }\n    _getSqSegDist(p, p1, p2) {\n        var x = p1.x, y = p1.y, dx = p2.x - x, dy = p2.y - y;\n        if (dx !== 0 || dy !== 0) {\n            var t = ((p.x - x) * dx + (p.y - y) * dy) / (dx * dx + dy * dy);\n            if (t > 1) {\n                x = p2.x;\n                y = p2.y;\n            }\n            else if (t > 0) {\n                x += dx * t;\n                y += dy * t;\n            }\n        }\n        dx = p.x - x;\n        dy = p.y - y;\n        return dx * dx + dy * dy;\n    }\n    _simplifyDPStep(points, first, last, sqTolerance, simplified) {\n        var maxSqDist = sqTolerance, index;\n        for (var i = first + 1; i < last; i++) {\n            var sqDist = this._getSqSegDist(points[i], points[first], points[last]);\n            if (sqDist > maxSqDist) {\n                index = i;\n                maxSqDist = sqDist;\n            }\n        }\n        if (maxSqDist > sqTolerance) {\n            if (index - first > 1)\n                this._simplifyDPStep(points, first, index, sqTolerance, simplified);\n            simplified.push(points[index]);\n            if (last - index > 1)\n                this._simplifyDPStep(points, index, last, sqTolerance, simplified);\n        }\n    }\n}\nPolylineSimplifier.DEFAULT_TOLERANCE = 1;\nPolylineSimplifier.Shared = new PolylineSimplifier();\n//# sourceMappingURL=geometry.simplify.js.map","import { Quantity } from \"../math\";\nimport { IsSize3 } from \"./geometry.interfaces\";\nexport class Size2 {\n    static ConvertInPlace(size, from, to) {\n        return Size2.ConvertToRef(size, from, to, size);\n    }\n    static ConvertToRef(size, from, to, ref) {\n        ref = ref ?? Size2.Zero();\n        ref.width = Quantity.Convert(size.width, from, to);\n        ref.height = Quantity.Convert(size.height, from, to);\n        return ref;\n    }\n    static Zero() {\n        return new Size2(0, 0);\n    }\n    constructor(width, height) {\n        this.width = width;\n        this.height = height;\n    }\n    multiplyFloats(w, h) {\n        return new Size2(this.width * w, this.height * (h ?? w));\n    }\n    clone() {\n        return new Size2(this.width, this.height);\n    }\n    equals(other) {\n        return this.height === other.height && this.width === other.width;\n    }\n}\nexport class Size3 extends Size2 {\n    static ConvertInPlace(size, from, to) {\n        return Size3.ConvertToRef(size, from, to, size);\n    }\n    static ConvertToRef(size, from, to, ref) {\n        ref = ref ?? Size3.Zero();\n        ref.width = Quantity.Convert(size.width, from, to);\n        ref.height = Quantity.Convert(size.height, from, to);\n        ref.depth = Quantity.Convert(size.depth, from, to);\n        return ref;\n    }\n    static Zero() {\n        return new Size3(0, 0, 0);\n    }\n    static IsEmpty(size) {\n        return size.width === 0 && size.height === 0 && (size.depth ?? 0) === 0;\n    }\n    static FromSize(size) {\n        if (IsSize3(size)) {\n            return new Size3(size.width, size.height, size.depth);\n        }\n        return new Size3(size.width, size.height);\n    }\n    constructor(width, height, depth = 0) {\n        super(width, height);\n        this.depth = depth;\n    }\n    get hasThickness() {\n        return this.depth !== undefined;\n    }\n    clone() {\n        return new Size3(this.width, this.height, this.depth);\n    }\n    equals(other) {\n        return this.height === other.height && this.width === other.width && this.depth === other.depth;\n    }\n}\n//# sourceMappingURL=geometry.size.js.map","export * from \"./geometry.interfaces\";\nexport * from \"./geometry.cartesian\";\nexport * from \"./geometry.bounds\";\nexport * from \"./geometry.bounds.collection\";\nexport * from \"./geometry.size\";\nexport * from \"./geometry.convex.quickhull\";\nexport * from \"./geometry.plane.cruncher\";\nexport * from \"./shapes\";\nexport * from \"./geometry.simplify\";\n//# sourceMappingURL=index.js.map","import { Bounds } from \"../geometry.bounds\";\nimport { Cartesian3 } from \"../geometry.cartesian\";\nimport { AbstractShape } from \"./geometry.shape\";\nimport { ShapeType } from \"./geometry.shapes.interfaces\";\nexport class Circle extends AbstractShape {\n    constructor(c, radius) {\n        super(ShapeType.Circle);\n        this._center = c;\n        this._radius = radius;\n    }\n    get center() {\n        return this._center;\n    }\n    set center(v) {\n        if (Cartesian3.Equals(v, this._center) == false) {\n            this._center = v;\n            this.invalidateBounds();\n        }\n    }\n    get radius() {\n        return this._radius;\n    }\n    set radius(v) {\n        if (this._radius !== v) {\n            this._radius = v;\n            this.invalidateBounds();\n        }\n    }\n    _buildBounds() {\n        const r = this._radius;\n        const x = this._center.x;\n        const y = this._center.y;\n        return new Bounds(x - r, y - r, r * 2, r * 2);\n    }\n    _getPoints() {\n        return [this._center];\n    }\n}\n//# sourceMappingURL=geometry.circle.js.map","import { Bounds } from \"../geometry.bounds\";\nimport { Cartesian2, Cartesian3 } from \"../geometry.cartesian\";\nimport { RegionCode } from \"../geometry.interfaces\";\nimport { AbstractShape } from \"./geometry.shape\";\nimport { ShapeType } from \"./geometry.shapes.interfaces\";\nexport class Line extends AbstractShape {\n    constructor(a, b) {\n        super(ShapeType.Line);\n        this._alice = a;\n        this._bob = b;\n    }\n    get start() {\n        return this._alice;\n    }\n    set start(v) {\n        if (Cartesian3.Equals(v, this._alice) == false) {\n            this._alice = v;\n            this.invalidateBounds();\n        }\n    }\n    get end() {\n        return this._bob;\n    }\n    set end(v) {\n        if (Cartesian3.Equals(v, this._bob) == false) {\n            this._bob = v;\n            this.invalidateBounds();\n        }\n    }\n    clip(clipArea) {\n        let code1 = Cartesian2.ComputeCode(this._alice, clipArea);\n        let code2 = Cartesian2.ComputeCode(this._bob, clipArea);\n        if (code1 == 0 && code2 == 0) {\n            return this;\n        }\n        if (code1 & code2) {\n            return undefined;\n        }\n        let a = new Cartesian3(this._alice.x, this._alice.y, this._alice.z);\n        let b = new Cartesian3(this._bob.x, this._bob.y, this._bob.z);\n        do {\n            let code_out = code1 != 0 ? code1 : code2;\n            let x = 0, y = 0;\n            const x1 = a.x;\n            const y1 = a.y;\n            const x2 = b.x;\n            const y2 = b.y;\n            if (code_out & RegionCode.TOP) {\n                const y_max = clipArea.ymax;\n                x = x1 + ((x2 - x1) * (y_max - y1)) / (y2 - y1);\n                y = y_max;\n            }\n            else if (code_out & RegionCode.BOTTOM) {\n                const y_min = clipArea.ymin;\n                x = x1 + ((x2 - x1) * (y_min - y1)) / (y2 - y1);\n                y = y_min;\n            }\n            else if (code_out & RegionCode.RIGHT) {\n                const x_max = clipArea.xmax;\n                y = y1 + ((y2 - y1) * (x_max - x1)) / (x2 - x1);\n                x = x_max;\n            }\n            else if (code_out & RegionCode.LEFT) {\n                const x_min = clipArea.xmin;\n                y = y1 + ((y2 - y1) * (x_min - x1)) / (x2 - x1);\n                x = x_min;\n            }\n            if (code_out == code1) {\n                a.x = x;\n                a.y = y;\n                code1 = Cartesian2.ComputeCode(a, clipArea);\n            }\n            else {\n                b.x = x;\n                b.y = y;\n                code2 = Cartesian2.ComputeCode(b, clipArea);\n            }\n        } while (code1 != 0 || code2 != 0);\n        return new Line(a, b);\n    }\n    _buildBounds() {\n        return Bounds.FromPoints2(this._alice, this._bob);\n    }\n    _getPoints() {\n        return [this._alice, this._bob];\n    }\n}\n//# sourceMappingURL=geometry.line.js.map","import { Bounds } from \"../geometry.bounds\";\nimport { Cartesian2, Cartesian3 } from \"../geometry.cartesian\";\nimport { isCartesian } from \"../geometry.interfaces\";\nimport { AbstractShape } from \"./geometry.shape\";\nimport { ShapeType } from \"./geometry.shapes.interfaces\";\nexport class Point extends AbstractShape {\n    constructor(a, b, c) {\n        super(ShapeType.Point);\n        if (isCartesian(a)) {\n            this._position = a;\n        }\n        else {\n            this._position = new Cartesian3(a, b ?? 0, c ?? 0);\n        }\n    }\n    get position() {\n        return this._position;\n    }\n    set position(v) {\n        if (Cartesian3.Equals(v, this._position) == false) {\n            this._position = v;\n            this.invalidateBounds();\n        }\n    }\n    clip(clipArea) {\n        let code = Cartesian2.ComputeCode(this._position, clipArea);\n        if (code == 0) {\n            return this;\n        }\n        return undefined;\n    }\n    _buildBounds() {\n        return Bounds.FromPoints2(this._position);\n    }\n    _getPoints() {\n        return [this._position];\n    }\n}\n//# sourceMappingURL=geometry.point.js.map","import { isArrayOfFloatArray } from \"../../types\";\nimport { Cartesian2, Cartesian3 } from \"../geometry.cartesian\";\nimport { isArrayOfCartesianArray } from \"../geometry.interfaces\";\nimport { Polyline } from \"./geometry.polyline\";\nimport { ShapeType } from \"./geometry.shapes.interfaces\";\nclass Cartesian3WithInfos extends Cartesian3 {\n    constructor(x, y, z, __wayCode__$t1967, subject, subjectIndex, clipIndex = 0) {\n        super(x, y, z);\n        this.__wayCode__$t1967 = __wayCode__$t1967;\n        this.subject = subject;\n        this.subjectIndex = subjectIndex;\n        this.clipIndex = clipIndex;\n    }\n}\nfunction isIntersection(p) {\n    return p.__wayCode__$t1967 !== undefined;\n}\nexport class Polygon extends Polyline {\n    static IsClockWise(points) {\n        let sum = 0;\n        const n = points.length;\n        for (let i = 0; i < points.length - 1; i++) {\n            const a = points[i];\n            const b = points[(i + 1) % n];\n            sum += (b.x - a.x) * (b.y + a.y);\n        }\n        return sum < 0;\n    }\n    static FromFloats(points, stride = 3, assertClose = true, assertClockWize = true) {\n        if (isArrayOfFloatArray(points)) {\n            const records = [];\n            for (let i = 0; i < points.length; i++) {\n                const tmp = points[i];\n                const p = [];\n                for (let j = 0; j < tmp.length; j += stride) {\n                    p.push(new Cartesian3(tmp[j], tmp[j + 1], stride > 2 ? tmp[j + 2] : 0));\n                }\n                records.push(p);\n            }\n            return Polygon.FromPoints(records, assertClose, assertClockWize);\n        }\n        const p = [];\n        for (let i = 0; i < points.length; i += stride) {\n            p.push(new Cartesian3(points[i], points[i + 1], stride > 2 ? points[i + 2] : 0));\n        }\n        return new Polygon(p, assertClose, assertClockWize);\n    }\n    static FromPoints(points, assertClose = true, assertClockWize = true) {\n        if (isArrayOfCartesianArray(points)) {\n            const p = new Polygon(points[0], assertClose, assertClockWize);\n            for (let i = 1; i < points.length; i++) {\n                p.addHole(points[i], assertClose, assertClockWize);\n            }\n            return p;\n        }\n        return new Polygon(points, assertClose, assertClockWize);\n    }\n    constructor(p, assertClose = true, assertClockWize = true) {\n        super(p, ShapeType.Polygon);\n        if (assertClose && !Cartesian3.Equals(p[0], p[p.length - 1])) {\n            p.push(p[0]);\n        }\n        if (assertClockWize && !Polygon.IsClockWise(p)) {\n            p.reverse();\n        }\n    }\n    get holes() {\n        return this._holes;\n    }\n    addHole(hole, assertClose = true, assertAntiClockWize = true) {\n        if ((hole?.length ?? 0) > 2) {\n            if (assertClose && !Cartesian3.Equals(hole[0], hole[hole.length - 1])) {\n                hole.push(hole[0]);\n            }\n            if (assertAntiClockWize && Polygon.IsClockWise(hole)) {\n                hole.reverse();\n            }\n            this._holes = this._holes ?? [];\n            this._holes.push(hole);\n        }\n    }\n    clip(clipArea) {\n        if (clipArea.containsBounds(this.boundingBox)) {\n            return this;\n        }\n        return this._clipPolygon(clipArea);\n    }\n    _clipPolygon(clipArea) {\n        if (clipArea.intersects(this.boundingBox)) {\n            const polygonArea = Array.from(clipArea.points()).map((p) => this._buildPoint(p.x, p.y, 0));\n            polygonArea.push(polygonArea[0]);\n            const toClips = [this._points];\n            if (this._holes) {\n                toClips.push(...this._holes);\n            }\n            const entering = [];\n            for (const subject of toClips) {\n                const points = [];\n                const codes = subject.map((p) => Cartesian2.ComputeCode(p, clipArea));\n                let a = subject[0];\n                let codea = codes[0];\n                let inside = codea == 0;\n                for (let i = 1; i < codes.length; i++) {\n                    const b = subject[i];\n                    const codeb = codes[i];\n                    if (inside) {\n                        points.push(this._buildPoint(a.x, a.y, a.z));\n                        if (codeb != 0) {\n                            const intersection = this._computeIntersectionToRef(clipArea, a, b, codeb, new Cartesian3WithInfos(0, 0, 0, false, points, points.length));\n                            points.push(intersection);\n                            intersection.clipIndex = this._InsertIntersectionIntoClipPolygon(polygonArea, intersection);\n                            inside = !inside;\n                        }\n                    }\n                    else {\n                        points.push(a);\n                        if (codeb == 0) {\n                            const intersection = this._computeIntersectionToRef(clipArea, a, b, codea, new Cartesian3WithInfos(0, 0, 0, true, points, points.length));\n                            entering.push(intersection);\n                            points.push(intersection);\n                            intersection.clipIndex = this._InsertIntersectionIntoClipPolygon(polygonArea, intersection);\n                            inside = !inside;\n                        }\n                    }\n                    a = b;\n                    codea = codeb;\n                }\n                if (inside) {\n                    points.push(this._buildPoint(a.x, a.y, a.z));\n                }\n            }\n            const polygons = [];\n            if (entering.length != 0) {\n                do {\n                    const polygon = [];\n                    const first = entering.splice(0, 1)[0];\n                    let i = first.subjectIndex;\n                    let subject = first.subject;\n                    do {\n                        const current = subject[i++];\n                        i == subject.length && (i = 1);\n                        if (isIntersection(current)) {\n                            polygon.push(this._buildPoint(current.x, current.y, current.z));\n                            if (!current.__wayCode__$t1967) {\n                                i = current.clipIndex + 1;\n                                subject = polygonArea;\n                                continue;\n                            }\n                            if (polygon.length == 1) {\n                                continue;\n                            }\n                            if (current === first) {\n                                polygons.push(polygon);\n                                break;\n                            }\n                            i = current.subjectIndex + 1;\n                            subject = current.subject;\n                            entering.splice(entering.findIndex((p) => p === current), 1);\n                            continue;\n                        }\n                        polygon.push(current);\n                    } while (true);\n                } while (entering.length > 0);\n            }\n            return polygons.length ? (polygons.length == 1 ? new Polygon(polygons[0], false, false) : polygons.map((p) => new Polygon(p, false, false))) : undefined;\n        }\n        return undefined;\n    }\n    _InsertIntersectionIntoClipPolygon(clipPolygon, intersection) {\n        let a = clipPolygon[0];\n        for (let i = 1; i < clipPolygon.length; i++) {\n            const b = clipPolygon[i];\n            if (Cartesian3.IsWithinTheBounds(a, b, intersection)) {\n                clipPolygon.splice(i, 0, intersection);\n                for (let j = i + 1; j < clipPolygon.length; j++) {\n                    const c = clipPolygon[j];\n                    if (isIntersection(c)) {\n                        c.clipIndex++;\n                    }\n                }\n                return i;\n            }\n            a = b;\n        }\n        return -1;\n    }\n}\n//# sourceMappingURL=geometry.polygon.js.map","import { isArrayOfFloatArray } from \"../../types\";\nimport { Bounds } from \"../geometry.bounds\";\nimport { Cartesian2, Cartesian3 } from \"../geometry.cartesian\";\nimport { isArrayOfCartesianArray, RegionCode } from \"../geometry.interfaces\";\nimport { AbstractShape } from \"./geometry.shape\";\nimport { ShapeType } from \"./geometry.shapes.interfaces\";\nexport class Polyline extends AbstractShape {\n    static ArraysEqual(arr1, arr2) {\n        if (arr1.length !== arr2.length) {\n            return false;\n        }\n        for (let i = 0; i < arr1.length; i++) {\n            if (arr1[i] !== arr2[i]) {\n                return false;\n            }\n        }\n        return true;\n    }\n    static FromFloats(points, stride = 3) {\n        if (isArrayOfFloatArray(points)) {\n            const multipolyline = [];\n            for (let i = 0; i < points.length; i++) {\n                const tmp = points[i];\n                const p = [];\n                for (let j = 0; j < tmp.length; j += stride) {\n                    p.push(new Cartesian3(tmp[j], tmp[j + 1], stride > 2 ? tmp[j + 2] : 0));\n                }\n                multipolyline.push(new Polyline(p));\n            }\n            return multipolyline;\n        }\n        const p = [];\n        for (let i = 0; i < points.length; i += stride) {\n            p.push(new Cartesian3(points[i], points[i + 1], stride > 2 ? points[i + 2] : 0));\n        }\n        return new Polyline(p);\n    }\n    static FromPoints(points) {\n        if (isArrayOfCartesianArray(points)) {\n            return Polyline.FromPoints(points.flat());\n        }\n        return new Polyline(points);\n    }\n    constructor(p, type) {\n        super(type ?? ShapeType.Polyline);\n        this._points = p;\n    }\n    get points() {\n        return this._points;\n    }\n    clip(clipArea) {\n        if (clipArea.containsBounds(this.boundingBox)) {\n            return this;\n        }\n        return this._clipPolyline(clipArea);\n    }\n    _clipPolyline(clipArea) {\n        if (clipArea.intersects(this.boundingBox)) {\n            const polylines = [];\n            let points = [];\n            const codes = this._points.map((p) => Cartesian2.ComputeCode(p, clipArea));\n            let a = this._points[0];\n            let codea = codes[0];\n            let inside = codea == 0;\n            for (let i = 1; i < codes.length; i++) {\n                const b = this._points[i];\n                const codeb = codes[i];\n                if (inside) {\n                    points.push(this._buildPoint(a.x, a.y, a.z));\n                    if (codeb != 0) {\n                        const intersection = this._computeIntersectionToRef(clipArea, a, b, codeb, this._buildPoint(0, 0, 0));\n                        points.push(intersection);\n                        polylines.push(new Polyline(points));\n                        points = [];\n                        inside = !inside;\n                    }\n                }\n                else {\n                    if (codeb == 0) {\n                        const intersection = this._computeIntersectionToRef(clipArea, a, b, codea, this._buildPoint(0, 0, 0));\n                        points.push(intersection);\n                        inside = !inside;\n                    }\n                }\n                a = b;\n                codea = codeb;\n            }\n            if (inside) {\n                points.push(this._buildPoint(a.x, a.y, a.z));\n            }\n            if (points.length) {\n                polylines.push(new Polyline(points));\n            }\n            return polylines.length ? (polylines.length == 1 ? polylines[0] : polylines) : undefined;\n        }\n        return undefined;\n    }\n    _computeIntersectionToRef(clipArea, a, b, code_out, ref) {\n        const x1 = a.x;\n        const y1 = a.y;\n        const x2 = b.x;\n        const y2 = b.y;\n        if (code_out & RegionCode.TOP) {\n            const y_max = clipArea.ymax;\n            ref.x = x1 + ((x2 - x1) * (y_max - y1)) / (y2 - y1);\n            ref.y = y_max;\n        }\n        else if (code_out & RegionCode.BOTTOM) {\n            const y_min = clipArea.ymin;\n            ref.x = x1 + ((x2 - x1) * (y_min - y1)) / (y2 - y1);\n            ref.y = y_min;\n        }\n        else if (code_out & RegionCode.RIGHT) {\n            const x_max = clipArea.xmax;\n            ref.y = y1 + ((y2 - y1) * (x_max - x1)) / (x2 - x1);\n            ref.x = x_max;\n        }\n        else if (code_out & RegionCode.LEFT) {\n            const x_min = clipArea.xmin;\n            ref.y = y1 + ((y2 - y1) * (x_min - x1)) / (x2 - x1);\n            ref.x = x_min;\n        }\n        return ref;\n    }\n    _buildPoint(x, y, z) {\n        return new Cartesian3(x ?? 0, y ?? 0, z ?? 0);\n    }\n    _buildBounds() {\n        return Bounds.FromPoints2(...this._points);\n    }\n    _getPoints() {\n        return this._points;\n    }\n}\n//# sourceMappingURL=geometry.polyline.js.map","import { Bounded } from \"../geometry.bounds\";\nexport class AbstractShape extends Bounded {\n    constructor(t) {\n        super();\n        this._type = t;\n    }\n    get type() {\n        return this._type;\n    }\n    [Symbol.iterator]() {\n        let index = 0;\n        let points = this._getPoints();\n        return {\n            next() {\n                if (index < points.length) {\n                    return { value: points[index++], done: false };\n                }\n                else {\n                    return { value: null, done: true };\n                }\n            },\n        };\n    }\n}\n//# sourceMappingURL=geometry.shape.js.map","export var ShapeType;\n(function (ShapeType) {\n    ShapeType[ShapeType[\"Unknown\"] = 0] = \"Unknown\";\n    ShapeType[ShapeType[\"Point\"] = 1] = \"Point\";\n    ShapeType[ShapeType[\"Polyline\"] = 2] = \"Polyline\";\n    ShapeType[ShapeType[\"Polygon\"] = 3] = \"Polygon\";\n    ShapeType[ShapeType[\"Circle\"] = 4] = \"Circle\";\n    ShapeType[ShapeType[\"Line\"] = 5] = \"Line\";\n})(ShapeType || (ShapeType = {}));\nexport function isClipable(value) {\n    return value && value.clip !== undefined;\n}\nexport function isShape(value) {\n    return value && value.type !== undefined && ShapeType[value.type] !== undefined;\n}\nexport function isCircle(shape) {\n    if (typeof shape !== \"object\" || shape === null)\n        return false;\n    return shape.type === ShapeType.Circle;\n}\nexport function isLine(shape) {\n    if (typeof shape !== \"object\" || shape === null)\n        return false;\n    return shape.type === ShapeType.Line;\n}\nexport function isPolyline(shape) {\n    if (typeof shape !== \"object\" || shape === null)\n        return false;\n    return shape.type === ShapeType.Polyline;\n}\nexport function isPolygon(shape) {\n    if (typeof shape !== \"object\" || shape === null)\n        return false;\n    return shape.type === ShapeType.Polygon;\n}\n//# sourceMappingURL=geometry.shapes.interfaces.js.map","export * from \"./geometry.shapes.interfaces\";\nexport * from \"./geometry.shape\";\nexport * from \"./geometry.circle\";\nexport * from \"./geometry.polygon\";\nexport * from \"./geometry.polyline\";\nexport * from \"./geometry.line\";\nexport * from \"./geometry.point\";\n//# sourceMappingURL=index.js.map","import { Scalar } from \"../math\";\nimport { HasToString, IsString } from \"../types\";\nexport class FetchError extends Error {\n    constructor(message, ...userArgs) {\n        super(message);\n        this.userArgs = userArgs.length > 0 ? userArgs : [];\n    }\n}\nexport class FetchResult {\n    static Null(request, userArgs = null) {\n        return new FetchResult(request, null, userArgs);\n    }\n    constructor(address, content, userArgs = null) {\n        this.ok = true;\n        this.address = address;\n        this.content = content;\n        this.userArgs = userArgs ?? [];\n    }\n}\nexport class DefaultUrlBuilder {\n    buildUrl(request, ...params) {\n        if (IsString(request)) {\n            return request;\n        }\n        if (HasToString(request)) {\n            return request.toString();\n        }\n        throw new Error(\"Request must be a string or an object with a toString method.\");\n    }\n}\nexport class WebClientOptions {\n    static getDefault() {\n        return new WebClientOptions({\n            maxRetry: 3,\n            initialDelay: 1000,\n        });\n    }\n    constructor(p) {\n        Object.assign(this, p);\n    }\n}\nexport class WebClientOptionsBuilder {\n    constructor() {\n        this._options = {};\n    }\n    withMaxRetry(v) {\n        this._options.maxRetry = v;\n        return this;\n    }\n    withInitialDelay(v) {\n        this._options.initialDelay = v;\n        return this;\n    }\n    build() {\n        return new WebClientOptions(this._options);\n    }\n}\nexport class WebClient {\n    constructor(name, codec, urlFactory, options) {\n        this._name = name;\n        if (!codec) {\n            throw new Error(`invalid codec parameter ${codec}`);\n        }\n        this._urlFactory = urlFactory ?? new DefaultUrlBuilder();\n        this._codec = codec;\n        this._options = { ...WebClientOptions.getDefault(), ...options };\n    }\n    get name() {\n        return this._name;\n    }\n    async fetchAsync(request, ...userArgs) {\n        if (!request) {\n            throw new FetchError(\"Invalid request parameter.\");\n        }\n        const url = this._urlFactory.buildUrl(request, ...userArgs) ?? request.toString();\n        if (!url) {\n            throw new FetchError(`Builded url of ${request.toString()} can not be null`);\n        }\n        const maxRetry = this._options.maxRetry ?? 1;\n        let delay = this._options.initialDelay ?? 1000;\n        let retryCount = 0;\n        do {\n            try {\n                const response = await fetch(url);\n                let content = null;\n                if (response.ok) {\n                    content = (await this._codec.decodeAsync(response));\n                }\n                else {\n                    console.warn(`Request failed: ${url} (Status: ${response.status})`);\n                }\n                const result = new FetchResult(request, content, userArgs);\n                result.status = response.status;\n                result.statusText = response.statusText;\n                return result;\n            }\n            catch (error) {\n                console.error(`Error fetching ${url}: ${error.message || error}`);\n                if (retryCount >= maxRetry - 1) {\n                    throw new FetchError(`Exceeded maximum retries for URL: ${url}`, ...userArgs);\n                }\n            }\n            const jitter = Scalar.GetRandomInt(0, this._options.initialDelay ?? 1000);\n            await new Promise((resolve) => setTimeout(resolve, Math.min(delay + jitter, 30000)));\n            delay *= 2;\n            retryCount++;\n        } while (retryCount < maxRetry);\n        throw new FetchError(`Exceeded maximum retries for URL: ${url}`, ...userArgs);\n    }\n}\n//# sourceMappingURL=webClient.js.map","export * from \"./map.context2d\";\nexport * from \"./map.canvas\";\nexport * from \"./map.canvas.display\";\n//# sourceMappingURL=index.js.map","import { Display } from \"../../tiles\";\nexport class CanvasDisplay extends Display {\n    static CreateCanvas(width, height) {\n        const canvas = document.createElement(\"canvas\");\n        canvas.width = width;\n        canvas.height = height;\n        return canvas;\n    }\n    static ResizeToDisplaySize(canvas, scale = 1) {\n        const displayWidth = canvas.clientWidth;\n        const displayHeight = canvas.clientHeight;\n        const ratio = window.devicePixelRatio;\n        const w = displayWidth * ratio * scale;\n        const h = displayHeight * ratio * scale;\n        if (canvas.width != w || canvas.height != h) {\n            canvas.width = w;\n            canvas.height = h;\n            return true;\n        }\n        return false;\n    }\n    constructor(canvas, scale, resizeToFitClient) {\n        const f = resizeToFitClient == undefined || resizeToFitClient == true;\n        scale = scale ?? 1.0;\n        if (f) {\n            CanvasDisplay.ResizeToDisplaySize(canvas, scale);\n        }\n        super(canvas);\n        this.canvas = canvas;\n        this._resizeToFitClient = f;\n        this._scale = scale;\n        const canvasAsElement = canvas;\n        this._resizeObserver = new ResizeObserver((entries) => {\n            for (let entry of entries) {\n                if (entry.target === canvasAsElement) {\n                    if (this._resizeToFitClient) {\n                        CanvasDisplay.ResizeToDisplaySize(canvas, this._scale);\n                    }\n                    this.resize(canvas.width, canvas.height);\n                }\n            }\n        });\n        this._resizeObserver.observe(canvasAsElement);\n    }\n    getContext(options) {\n        return this.canvas.getContext(\"2d\", options);\n    }\n    dispose() {\n        super.dispose();\n        this._resizeObserver.disconnect();\n    }\n}\n//# sourceMappingURL=map.canvas.display.js.map","import { CanvasDisplay } from \"./map.canvas.display\";\nimport { Context2DTileMap } from \"./map.context2d\";\nimport { InputController, InputsNavigationController } from \"../inputs\";\nexport class CanvasMap extends Context2DTileMap {\n    constructor(display, options, nav) {\n        if (display instanceof HTMLCanvasElement) {\n            display = new CanvasDisplay(display);\n        }\n        super(display, nav);\n        this._context = display.getContext();\n        this._inputController = options?.inputController ?? new InputController(display.canvas);\n        this._navigationManager = options?.navigationManager ?? new InputsNavigationController(this._inputController, this);\n    }\n    _doValidate() {\n        super._doValidate();\n        const ctx = this._getContext2D();\n        if (ctx) {\n            this.draw(ctx);\n        }\n    }\n    _getContext2D() {\n        return this._context;\n    }\n}\n//# sourceMappingURL=map.canvas.js.map","import { Scalar } from \"../../math\";\nimport { IsDrawableTileMapLayer, TileMapBase } from \"../../tiles\";\nexport class Context2DTileMap extends TileMapBase {\n    constructor(display, nav) {\n        super(display, nav);\n    }\n    draw(ctx, xoffset = 0, yoffset = 0) {\n        const navigation = this.navigationState;\n        if (!navigation) {\n            return;\n        }\n        if (!ctx || !this._display) {\n            return;\n        }\n        if (!this._layerViews.count) {\n            return;\n        }\n        const display = this.display;\n        if (!display) {\n            return;\n        }\n        ctx.save();\n        try {\n            const x = xoffset;\n            const y = yoffset;\n            const w = display.resolution.width;\n            const h = display.resolution.height;\n            const scale = this.navigationState?.scale ?? 1.0;\n            ctx.clearRect(x, y, w, h);\n            ctx.translate(x + w / 2, y + h / 2);\n            if (this.navigationState?.azimuth?.value) {\n                const angle = this.navigationState.azimuth.value * Scalar.DEG2RAD;\n                ctx.rotate(angle);\n            }\n            ctx.scale(scale, scale);\n            for (const view of this._layerViews) {\n                const layer = view.layer;\n                if (!layer.enabled) {\n                    continue;\n                }\n                const render = IsDrawableTileMapLayer(layer) ? layer.drawFn?.bind(layer.drawTarget ?? layer) : undefined;\n                if (!render) {\n                    continue;\n                }\n                const currentLod = navigation.lod;\n                const lat = navigation.center.lat;\n                const lon = navigation.center.lon;\n                const metrics = layer.metrics;\n                const center = metrics.getLatLonToPointXY(lat, lon, currentLod);\n                const size = metrics.tileSize;\n                const tiles = view.activTiles;\n                for (const tile of tiles) {\n                    const b = tile?.boundingBox;\n                    if (!b || !tile.content) {\n                        continue;\n                    }\n                    const dlod = currentLod - tile.address.levelOfDetail;\n                    const lodScaling = dlod == 0 ? 1 : dlod < 0 ? 1 << dlod : 1 / (1 << dlod);\n                    const x = b.x * lodScaling - center.x;\n                    const y = b.y * lodScaling - center.y;\n                    ctx.save();\n                    try {\n                        ctx.translate(x, y);\n                        ctx.scale(lodScaling, lodScaling);\n                        render(ctx, tile, size, size);\n                    }\n                    finally {\n                        ctx.restore();\n                    }\n                    continue;\n                }\n            }\n        }\n        finally {\n            ctx.restore();\n        }\n    }\n}\n//# sourceMappingURL=map.context2d.js.map","export * from \"./canvas/index\";\nexport * from \"./inputs/index\";\n//# sourceMappingURL=index.js.map","export * from \"./map.inputs.interfaces\";\nexport * from \"./map.inputs.interfaces.touch\";\nexport * from \"./map.inputs.interfaces.hands\";\nexport * from \"./map.inputs.controller.drag\";\nexport * from \"./map.inputs.controller.navigation\";\nexport * from \"./map.inputs.controller\";\n//# sourceMappingURL=index.js.map","import { Observable } from \"../../events\";\nexport class PointerToDragController {\n    constructor(source) {\n        this._pointerState = new Map();\n        this._observers = [];\n        this._onStart = (e) => {\n            if (e.pointerType === \"touch\") {\n                return;\n            }\n            const x = this._getClientX(e);\n            const y = this._getClientY(e);\n            var state = {\n                startX: x,\n                startY: y,\n                lastX: x,\n                lastY: y,\n                button: e.button,\n            };\n            this._pointerState.set(e.pointerId, state);\n            const event = {\n                type: \"start\",\n                pointerId: e.pointerId,\n                button: state.button,\n                startX: state.startX,\n                startY: state.startY,\n                x: x,\n                y: y,\n                deltaX: 0,\n                deltaY: 0,\n                timestamp: performance.now(),\n                originalEvent: e,\n            };\n            this.onDragObservable.notifyObservers(event);\n        };\n        this._onMove = (e) => {\n            if (e.pointerType === \"touch\") {\n                return;\n            }\n            const state = this._pointerState.get(e.pointerId);\n            if (state) {\n                const x = this._getClientX(e);\n                const y = this._getClientY(e);\n                const dx = x - state.lastX;\n                const dy = y - state.lastY;\n                const event = {\n                    type: \"drag\",\n                    pointerId: e.pointerId,\n                    button: state.button,\n                    startX: state.startX,\n                    startY: state.startY,\n                    x: x,\n                    y: y,\n                    deltaX: dx,\n                    deltaY: dy,\n                    timestamp: performance.now(),\n                    originalEvent: e,\n                };\n                this.onDragObservable.notifyObservers(event);\n                state.lastX = x;\n                state.lastY = y;\n            }\n        };\n        this._onEnd = (e) => {\n            if (e.pointerType === \"touch\") {\n                return;\n            }\n            const state = this._pointerState.get(e.pointerId);\n            if (state) {\n                const x = this._getClientX(e);\n                const y = this._getClientY(e);\n                const dx = x - state.startX;\n                const dy = y - state.startY;\n                this.onDragObservable.notifyObservers({\n                    type: \"end\",\n                    pointerId: e.pointerId,\n                    button: state.button,\n                    startX: state.startX,\n                    startY: state.startY,\n                    x: x,\n                    y: y,\n                    deltaX: dx,\n                    deltaY: dy,\n                    timestamp: performance.now(),\n                    originalEvent: e,\n                });\n                this._pointerState.delete(e.pointerId);\n            }\n        };\n        this._source = source;\n    }\n    dispose() {\n        this._detachSource();\n        this._clearObservable();\n        this._pointerState.clear();\n    }\n    get onDragObservable() {\n        if (!this._onDragObservable) {\n            this._onDragObservable = new Observable();\n            this._attachSource(this._source);\n        }\n        return this._onDragObservable;\n    }\n    get source() {\n        return this._source;\n    }\n    _clearObservable() {\n        this._onDragObservable?.clear();\n    }\n    _attachSource(source) {\n        if (source && this._onDragObservable) {\n            this._observers.push(source.onPointerDownObservable.add(this._onStart), source.onPointerMoveObservable.add(this._onMove), source.onPointerUpObservable.add(this._onEnd), source.onPointerCancelObservable.add(this._onEnd));\n        }\n    }\n    _detachSource() {\n        for (const observer of this._observers) {\n            if (observer) {\n                observer.disconnect();\n            }\n        }\n        this._observers = [];\n    }\n    _getClientX(e) {\n        return e.clientX;\n    }\n    _getClientY(e) {\n        return e.clientY;\n    }\n}\n//# sourceMappingURL=map.inputs.controller.drag.js.map","import { Observable } from \"../../events\";\nimport { PointerToDragController } from \"./map.inputs.controller.drag\";\nimport { PointerToGestureController } from \"./map.inputs.controller.touch\";\nexport class InputController {\n    constructor(src) {\n        this._onContextMenu = (ev) => {\n            ev.preventDefault();\n            ev.stopPropagation();\n        };\n        this._onWheel = (ev) => {\n            this._onWheelObservable?.notifyObservers(ev);\n        };\n        this._onPointerOver = (ev) => {\n            this._onPointerOverObservable?.notifyObservers(ev);\n        };\n        this._onPointerEnter = (ev) => {\n            this._onPointerEnterObservable?.notifyObservers(ev);\n        };\n        this._onPointerOut = (ev) => {\n            this._onPointerOutObservable?.notifyObservers(ev);\n        };\n        this._onPointerLeave = (ev) => {\n            this._onPointerLeaveObservable?.notifyObservers(ev);\n        };\n        this._onPointerMove = (ev) => {\n            this._onPointerMoveObservable?.notifyObservers(ev);\n        };\n        this._onPointerDown = (ev) => {\n            this._onPointerDownObservable?.notifyObservers(ev);\n        };\n        this._onPointerUp = (ev) => {\n            this._onPointerUpObservable?.notifyObservers(ev);\n        };\n        this._onPointerCancel = (ev) => {\n            this._onPointerCancelObservable?.notifyObservers(ev);\n        };\n        this._onPointerGotCapture = (ev) => {\n            this._onPointerGotCaptureObservable?.notifyObservers(ev);\n        };\n        this._onPointerLostCapture = (ev) => {\n            this._onPointerLostCaptureObservable?.notifyObservers(ev);\n        };\n        this.source = src;\n        this._dragController = new PointerToDragController(this);\n    }\n    get onDragObservable() {\n        return this._dragController.onDragObservable;\n    }\n    get onTouchObservable() {\n        if (!this._touchController) {\n            this._touchController = new PointerToGestureController(this);\n        }\n        return this._touchController.onTouchObservable;\n    }\n    get onWheelObservable() {\n        if (!this._onWheelObservable) {\n            this._onWheelObservable = new Observable();\n            this._src?.addEventListener(\"wheel\", this._onWheel);\n        }\n        return this._onWheelObservable;\n    }\n    get onPointerOverObservable() {\n        if (!this._onPointerOverObservable) {\n            this._onPointerOverObservable = new Observable();\n            this._src?.addEventListener(\"pointerover\", (ev) => {\n                this._onPointerOverObservable?.notifyObservers(ev);\n            });\n        }\n        return this._onPointerOverObservable;\n    }\n    get onPointerEnterObservable() {\n        if (!this._onPointerEnterObservable) {\n            this._onPointerEnterObservable = new Observable();\n            this._src?.addEventListener(\"pointerenter\", this._onPointerEnter);\n        }\n        return this._onPointerEnterObservable;\n    }\n    get onPointerOutObservable() {\n        if (!this._onPointerOutObservable) {\n            this._onPointerOutObservable = new Observable();\n            this._src?.addEventListener(\"pointerout\", this._onPointerOut);\n        }\n        return this._onPointerOutObservable;\n    }\n    get onPointerLeaveObservable() {\n        if (!this._onPointerLeaveObservable) {\n            this._onPointerLeaveObservable = new Observable();\n            this._src?.addEventListener(\"pointerleave\", this._onPointerLeave);\n        }\n        return this._onPointerLeaveObservable;\n    }\n    get onPointerMoveObservable() {\n        if (!this._onPointerMoveObservable) {\n            this._onPointerMoveObservable = new Observable();\n            this._src?.addEventListener(\"pointermove\", this._onPointerMove);\n        }\n        return this._onPointerMoveObservable;\n    }\n    get onPointerDownObservable() {\n        if (!this._onPointerDownObservable) {\n            this._onPointerDownObservable = new Observable();\n            this._src?.addEventListener(\"pointerdown\", this._onPointerDown);\n        }\n        return this._onPointerDownObservable;\n    }\n    get onPointerUpObservable() {\n        if (!this._onPointerUpObservable) {\n            this._onPointerUpObservable = new Observable();\n            this._src?.addEventListener(\"pointerup\", this._onPointerUp);\n        }\n        return this._onPointerUpObservable;\n    }\n    get onPointerCancelObservable() {\n        if (!this._onPointerCancelObservable) {\n            this._onPointerCancelObservable = new Observable();\n            this._src?.addEventListener(\"pointercancel\", this._onPointerCancel);\n        }\n        return this._onPointerCancelObservable;\n    }\n    get onPointerGotCaptureObservable() {\n        if (!this._onPointerGotCaptureObservable) {\n            this._onPointerGotCaptureObservable = new Observable();\n            this._src?.addEventListener(\"gotpointercapture\", this._onPointerGotCapture);\n        }\n        return this._onPointerGotCaptureObservable;\n    }\n    get onPointerLostCaptureObservable() {\n        if (!this._onPointerLostCaptureObservable) {\n            this._onPointerLostCaptureObservable = new Observable();\n            this._src?.addEventListener(\"lostpointercapture\", this._onPointerLostCapture);\n        }\n        return this._onPointerLostCaptureObservable;\n    }\n    get source() {\n        return this._src;\n    }\n    set source(src) {\n        if (src !== this._src) {\n            this._detachControl(this._src);\n            this._src = src;\n            this._attachControl(src);\n        }\n    }\n    dispose() {\n        this._detachControl(this._src);\n        this._clearObservables();\n    }\n    _attachControl(src) {\n        if (src) {\n            src.addEventListener(\"contextmenu\", this._onContextMenu.bind(this));\n            if (this._onPointerOverObservable) {\n                src.addEventListener(\"pointerover\", this._onPointerOver.bind(this));\n            }\n            if (this._onPointerEnterObservable) {\n                src.addEventListener(\"pointerenter\", this._onPointerEnter.bind(this));\n            }\n            if (this._onPointerOutObservable) {\n                src.addEventListener(\"pointerout\", this._onPointerOut.bind(this));\n            }\n            if (this._onPointerLeaveObservable) {\n                src.addEventListener(\"pointerleave\", this._onPointerLeave.bind(this));\n            }\n            if (this._onPointerMoveObservable) {\n                src.addEventListener(\"pointermove\", this._onPointerMove.bind(this), { passive: false });\n            }\n            if (this._onPointerDownObservable) {\n                src.addEventListener(\"pointerdown\", this._onPointerDown);\n            }\n            if (this._onPointerUpObservable) {\n                src.addEventListener(\"pointerup\", this._onPointerUp.bind(this));\n            }\n            if (this._onPointerCancelObservable) {\n                src.addEventListener(\"pointercancel\", this._onPointerCancel.bind(this));\n            }\n            if (this._onPointerGotCaptureObservable) {\n                src.addEventListener(\"gotpointercapture\", this._onPointerGotCapture.bind(this));\n            }\n            if (this._onPointerLostCaptureObservable) {\n                src.addEventListener(\"lostpointercapture\", this._onPointerLostCapture.bind(this));\n            }\n            if (this._onWheelObservable) {\n                src.addEventListener(\"wheel\", this._onWheel.bind(this));\n            }\n        }\n    }\n    _detachControl(src) {\n        if (src) {\n            src.removeEventListener(\"contextmenu\", this._onContextMenu);\n            src.removeEventListener(\"pointerover\", this._onPointerOver);\n            src.removeEventListener(\"pointerenter\", this._onPointerEnter);\n            src.removeEventListener(\"pointerout\", this._onPointerOut);\n            src.removeEventListener(\"pointerleave\", this._onPointerLeave);\n            src.removeEventListener(\"pointermove\", this._onPointerMove);\n            src.removeEventListener(\"pointerdown\", this._onPointerDown);\n            src.removeEventListener(\"pointerup\", this._onPointerUp);\n            src.removeEventListener(\"pointercancel\", this._onPointerCancel);\n            src.removeEventListener(\"gotpointercapture\", this._onPointerGotCapture);\n            src.removeEventListener(\"lostpointercapture\", this._onPointerLostCapture);\n            src.removeEventListener(\"wheel\", this._onWheel);\n        }\n    }\n    _clearObservables() {\n        this._onWheelObservable?.clear();\n        this._onPointerOverObservable?.clear();\n        this._onPointerEnterObservable?.clear();\n        this._onPointerOutObservable?.clear();\n        this._onPointerLeaveObservable?.clear();\n        this._onPointerMoveObservable?.clear();\n        this._onPointerDownObservable?.clear();\n        this._onPointerUpObservable?.clear();\n        this._onPointerCancelObservable?.clear();\n        this._onPointerGotCaptureObservable?.clear();\n        this._onPointerLostCaptureObservable?.clear();\n        this._onPointerOverObservable = undefined;\n        this._onPointerEnterObservable = undefined;\n        this._onPointerOutObservable = undefined;\n        this._onPointerLeaveObservable = undefined;\n        this._onPointerMoveObservable = undefined;\n        this._onPointerDownObservable = undefined;\n        this._onPointerUpObservable = undefined;\n        this._onPointerCancelObservable = undefined;\n        this._onPointerGotCaptureObservable = undefined;\n        this._onPointerLostCaptureObservable = undefined;\n        this._onWheelObservable = undefined;\n    }\n}\n//# sourceMappingURL=map.inputs.controller.js.map","import { TouchGestureType } from \"./map.inputs.interfaces.touch\";\nexport class InpustNavigationControllerOptions {\n}\nInpustNavigationControllerOptions.DEFAULT_ZOOM_INCREMENT = 0.1;\nInpustNavigationControllerOptions.DEFAULT_TOUCH_ZOOM_INCREMENT = 0.05;\nInpustNavigationControllerOptions.DEFAULT_INVERT_Y = false;\nInpustNavigationControllerOptions.DEFAULT_INVERT_Z = false;\nInpustNavigationControllerOptions.DEFAULT_ROTATE_FACTOR = 1;\nInpustNavigationControllerOptions.DEFAULT_TRANSLATE_FACTOR = 1;\nInpustNavigationControllerOptions.DEFAULT_ZOOM_FACTOR = 1;\nInpustNavigationControllerOptions.DEFAULT_OPTIONS = {\n    zoomIncrement: InpustNavigationControllerOptions.DEFAULT_ZOOM_INCREMENT,\n    touchZoomIncrement: InpustNavigationControllerOptions.DEFAULT_TOUCH_ZOOM_INCREMENT,\n    invertZ: InpustNavigationControllerOptions.DEFAULT_INVERT_Z,\n    invertY: InpustNavigationControllerOptions.DEFAULT_INVERT_Y,\n};\nexport class InputsNavigationController {\n    constructor(source, target, options) {\n        this._onDragObserver = null;\n        this._onWheelObserver = null;\n        this._onTouchObserver = null;\n        this._onDrag = (event) => {\n            switch (event.type) {\n                case \"drag\": {\n                    switch (event.button) {\n                        case 0: {\n                            if (event.deltaX || event.deltaY) {\n                                const translateFactor = this._options.translateFactor ?? InpustNavigationControllerOptions?.DEFAULT_TRANSLATE_FACTOR;\n                                const invertY = this._options.invertY ?? InpustNavigationControllerOptions?.DEFAULT_INVERT_Y;\n                                this._target.translateUnitsMap(-event.deltaX * translateFactor, (invertY ? event.deltaY : -event.deltaY) * translateFactor);\n                            }\n                            break;\n                        }\n                        case 2: {\n                            if (event.deltaX) {\n                                const rotateFactor = this._options.rotateFactor ?? InpustNavigationControllerOptions?.DEFAULT_ROTATE_FACTOR;\n                                this._target.rotateMap(Math.sign(event.deltaX) * Math.hypot(event.deltaX, event.deltaY) * rotateFactor);\n                            }\n                            break;\n                        }\n                    }\n                    break;\n                }\n            }\n        };\n        this._onWheel = (event) => {\n            const zoomFactor = this._options.zoomFactor ?? InpustNavigationControllerOptions?.DEFAULT_ZOOM_FACTOR;\n            const delta = Math.sign(event.deltaY) * (this._options.zoomIncrement ?? Math.abs(event.deltaY)) * zoomFactor;\n            this._target.zoomMap(this._options.invertZ ? delta : -delta);\n        };\n        this._onTouch = (event) => {\n            switch (event.type) {\n                case TouchGestureType.Drag: {\n                    const translateFactor = this._options.translateFactor ?? InpustNavigationControllerOptions?.DEFAULT_TRANSLATE_FACTOR;\n                    const invertY = this._options.invertY ?? InpustNavigationControllerOptions?.DEFAULT_INVERT_Y;\n                    this._target.translateUnitsMap(-event.deltaX * translateFactor, (invertY ? event.deltaY : -event.deltaY) * translateFactor);\n                    break;\n                }\n                case TouchGestureType.Pinch: {\n                    const zoomFactor = this._options.zoomFactor ?? InpustNavigationControllerOptions?.DEFAULT_ZOOM_FACTOR;\n                    const delta = Math.sign(event.scale) * (this._options.touchZoomIncrement ?? Math.abs(event.scale)) * zoomFactor;\n                    this._target.zoomMap(this._options.invertZ ? -delta : delta);\n                    break;\n                }\n                case TouchGestureType.Rotate: {\n                    const rotateFactor = this._options.rotateFactor ?? InpustNavigationControllerOptions?.DEFAULT_ROTATE_FACTOR;\n                    this._target.rotateMap(event.angle * rotateFactor);\n                    break;\n                }\n            }\n        };\n        this._source = source;\n        this._target = target;\n        this._options = options ?? InpustNavigationControllerOptions.DEFAULT_OPTIONS;\n        this._attachSource(this._source);\n    }\n    dispose() {\n        this._detachSource();\n    }\n    _attachSource(source) {\n        this._onDragObserver = source.onDragObservable.add(this._onDrag);\n        this._onWheelObserver = source.onWheelObservable.add(this._onWheel);\n        this._onTouchObserver = source.onTouchObservable.add(this._onTouch);\n    }\n    _detachSource() {\n        this._onDragObserver?.disconnect();\n        this._onWheelObserver?.disconnect();\n        this._onDragObserver = null;\n        this._onWheelObserver = null;\n    }\n}\n//# sourceMappingURL=map.inputs.controller.navigation.js.map","import { Observable } from \"../../events\";\nimport { Cartesian2 } from \"../../geometry\";\nimport { TouchGestureType } from \"./map.inputs.interfaces.touch\";\nconst GestureDetectionSettings = {\n    [TouchGestureType.Rotate]: { threshold: 0.5 },\n    [TouchGestureType.Pinch]: { threshold: 1 },\n    [TouchGestureType.Drag]: { threshold: 1 },\n    [TouchGestureType.Tap]: { threshold: 0 },\n    [TouchGestureType.LongPress]: { threshold: 0 },\n    [TouchGestureType.Swipe]: { threshold: 0 },\n};\nexport class PointerToGestureController {\n    constructor(source) {\n        this._pointers = new Map();\n        this._startDistance = 0;\n        this._startAngle = 0;\n        this._startCenter = Cartesian2.Zero();\n        this._moveCount = 0;\n        this._firstMoveCountThreshold = 5;\n        this._onStart = (e) => {\n            if (e.pointerType !== \"touch\") {\n                return;\n            }\n            const x = this._getClientX(e);\n            const y = this._getClientY(e);\n            const state = {\n                id: e.pointerId,\n                startX: x,\n                startY: y,\n                lastX: x,\n                lastY: y,\n                x: x,\n                y: y,\n                startTime: performance.now(),\n            };\n            this._pointers.set(e.pointerId, state);\n            if (this._pointers.size === 2) {\n                const [a, b] = Array.from(this._pointers.values());\n                this._startDistance = this._distance(a, b);\n                this._startAngle = this._angle(a, b);\n                this._startCenter = this._midpoint(a, b);\n                this._moveCount = 0;\n            }\n        };\n        this._onMove = (e) => {\n            if (e.pointerType !== \"touch\") {\n                return;\n            }\n            const state = this._pointers.get(e.pointerId);\n            if (state) {\n                state.x = this._getClientX(e);\n                state.y = this._getClientY(e);\n                switch (this._pointers.size) {\n                    case 1: {\n                        const gesture = {\n                            type: TouchGestureType.Drag,\n                            timestamp: performance.now(),\n                            duration: performance.now() - state.startTime,\n                            points: [{ x: state.x, y: state.y }],\n                            deltaX: state.x - state.lastX,\n                            deltaY: state.y - state.lastY,\n                        };\n                        this.onTouchObservable.notifyObservers(gesture);\n                        state.lastX = state.x;\n                        state.lastY = state.y;\n                        break;\n                    }\n                    case 2: {\n                        this._moveCount++;\n                        if (this._moveCount < this._firstMoveCountThreshold) {\n                            return;\n                        }\n                        const [a, b] = Array.from(this._pointers.values());\n                        const center = this._midpoint(a, b);\n                        const angle = this._angle(a, b);\n                        const distance = this._distance(a, b);\n                        const deltaAngle = angle - this._startAngle;\n                        const deltaDistance = distance - this._startDistance;\n                        const deltaCenter = this._distance(center, this._startCenter);\n                        const types = this._detectActiveTypes(deltaAngle, deltaDistance, deltaCenter);\n                        for (const type of types) {\n                            switch (type) {\n                                case TouchGestureType.Rotate: {\n                                    const gesture = {\n                                        type: TouchGestureType.Rotate,\n                                        timestamp: performance.now(),\n                                        duration: 0,\n                                        points: [\n                                            { x: a.x, y: a.y },\n                                            { x: b.x, y: b.y },\n                                        ],\n                                        center: center,\n                                        angle: deltaAngle,\n                                    };\n                                    this._startAngle = angle;\n                                    this.onTouchObservable.notifyObservers(gesture);\n                                    break;\n                                }\n                                case TouchGestureType.Pinch: {\n                                    const gesture = {\n                                        type: TouchGestureType.Pinch,\n                                        timestamp: performance.now(),\n                                        duration: 0,\n                                        points: [\n                                            { x: a.x, y: a.y },\n                                            { x: b.x, y: b.y },\n                                        ],\n                                        center: center,\n                                        scale: deltaDistance,\n                                    };\n                                    this._startDistance = distance;\n                                    this.onTouchObservable.notifyObservers(gesture);\n                                    break;\n                                }\n                                case TouchGestureType.Drag: {\n                                    const gesture = {\n                                        type: TouchGestureType.Drag,\n                                        timestamp: performance.now(),\n                                        duration: 0,\n                                        points: [\n                                            { x: a.x, y: a.y },\n                                            { x: b.x, y: b.y },\n                                        ],\n                                        deltaX: center.x - this._startCenter.x,\n                                        deltaY: center.y - this._startCenter.y,\n                                        startPosition: this._startCenter,\n                                    };\n                                    this._startCenter = { x: center.x, y: center.y };\n                                    this.onTouchObservable.notifyObservers(gesture);\n                                    break;\n                                }\n                            }\n                        }\n                        break;\n                    }\n                }\n            }\n        };\n        this._onEnd = (e) => {\n            if (e.pointerType !== \"touch\") {\n                return;\n            }\n            this._pointers.delete(e.pointerId);\n        };\n        this._source = source;\n    }\n    dispose() {\n        this._detachSource(this._source);\n        this._clearObservable;\n    }\n    get onTouchObservable() {\n        if (!this._onTouchObservable) {\n            this._onTouchObservable = new Observable();\n            this._attachSource(this._source);\n        }\n        return this._onTouchObservable;\n    }\n    get source() {\n        return this._source;\n    }\n    _getClientX(e) {\n        return e.clientX;\n    }\n    _getClientY(e) {\n        return e.clientY;\n    }\n    _clearObservable() {\n        this._onTouchObservable?.clear();\n        this._onTouchObservable = undefined;\n    }\n    _attachSource(source) {\n        if (source && this._onTouchObservable) {\n            source.onPointerDownObservable.add(this._onStart);\n            source.onPointerMoveObservable.add(this._onMove);\n            source.onPointerUpObservable.add(this._onEnd);\n            source.onPointerCancelObservable.add(this._onEnd);\n        }\n    }\n    _detachSource(source) {\n        if (source) {\n            source.onPointerDownObservable.removeCallback(this._onStart);\n            source.onPointerMoveObservable.removeCallback(this._onMove);\n            source.onPointerUpObservable.removeCallback(this._onEnd);\n            source.onPointerCancelObservable.removeCallback(this._onEnd);\n        }\n    }\n    _distance(a, b) {\n        const dx = b.x - a.x;\n        const dy = b.y - a.y;\n        return Math.sqrt(dx * dx + dy * dy);\n    }\n    _angle(a, b) {\n        const dx = b.x - a.x;\n        const dy = b.y - a.y;\n        return Math.atan2(dy, dx) * (180 / Math.PI);\n    }\n    _midpoint(a, b) {\n        return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };\n    }\n    _detectActiveTypes(angleRad, distDelta, centerDelta) {\n        const result = [];\n        const angleDeg = Math.abs(angleRad * 57.2958);\n        const pinchScore = Math.abs(distDelta);\n        const dragScore = Math.abs(centerDelta);\n        if (angleDeg > GestureDetectionSettings[TouchGestureType.Rotate].threshold) {\n            result.push(TouchGestureType.Rotate);\n        }\n        if (pinchScore > GestureDetectionSettings[TouchGestureType.Pinch].threshold) {\n            result.push(TouchGestureType.Pinch);\n        }\n        if (dragScore > GestureDetectionSettings[TouchGestureType.Drag].threshold) {\n            result.push(TouchGestureType.Drag);\n        }\n        return result;\n    }\n}\n//# sourceMappingURL=map.inputs.controller.touch.js.map","export var XRGestureType;\n(function (XRGestureType) {\n    XRGestureType[XRGestureType[\"Grab\"] = 100] = \"Grab\";\n    XRGestureType[XRGestureType[\"Release\"] = 101] = \"Release\";\n    XRGestureType[XRGestureType[\"Pinch\"] = 102] = \"Pinch\";\n    XRGestureType[XRGestureType[\"Point\"] = 1033] = \"Point\";\n    XRGestureType[XRGestureType[\"Swipe\"] = 104] = \"Swipe\";\n    XRGestureType[XRGestureType[\"Custom\"] = 999] = \"Custom\";\n})(XRGestureType || (XRGestureType = {}));\n//# sourceMappingURL=map.inputs.interfaces.hands.js.map","export function IsTouchCapable() {\n    const hasTouchEvents = \"ontouchstart\" in window;\n    const hasTouchConstructor = typeof window !== \"undefined\" && \"DocumentTouch\" in window && document instanceof window.DocumentTouch;\n    const hasTouchPoints = navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;\n    return hasTouchEvents || hasTouchConstructor || hasTouchPoints;\n}\nexport var TouchGestureType;\n(function (TouchGestureType) {\n    TouchGestureType[TouchGestureType[\"Tap\"] = 0] = \"Tap\";\n    TouchGestureType[TouchGestureType[\"LongPress\"] = 1] = \"LongPress\";\n    TouchGestureType[TouchGestureType[\"Rotate\"] = 2] = \"Rotate\";\n    TouchGestureType[TouchGestureType[\"Swipe\"] = 3] = \"Swipe\";\n    TouchGestureType[TouchGestureType[\"Pinch\"] = 4] = \"Pinch\";\n    TouchGestureType[TouchGestureType[\"Drag\"] = 5] = \"Drag\";\n})(TouchGestureType || (TouchGestureType = {}));\n//# sourceMappingURL=map.inputs.interfaces.touch.js.map","export * from \"./math\";\nexport * from \"./math.units\";\nexport * from \"./math.color\";\n//# sourceMappingURL=index.js.map","import { Scalar } from \"./math\";\nexport class RGBAColor {\n    static White() {\n        return new RGBAColor(255, 255, 255);\n    }\n    static Black() {\n        return new RGBAColor(0, 0, 0);\n    }\n    static LightGray() {\n        return new RGBAColor(211, 211, 211);\n    }\n    static Gray() {\n        return new RGBAColor(128, 128, 128);\n    }\n    static CoolSteelBlue() {\n        return new RGBAColor(70, 130, 180);\n    }\n    static ElectricBlue() {\n        return new RGBAColor(0, 191, 255);\n    }\n    static NeonBlue() {\n        return new RGBAColor(77, 77, 255);\n    }\n    static h2r(hex) {\n        var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n        return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : undefined;\n    }\n    static r2h(rgb) {\n        return \"#\" + ((1 << 24) + (rgb[0] << 16) + (rgb[1] << 8) + rgb[2]).toString(16).slice(1);\n    }\n    static Parse(str) {\n        if (str[0] == \"#\") {\n            var a = RGBAColor.h2r(str);\n            if (a) {\n                return new RGBAColor(a[0], a[1], a[2]);\n            }\n        }\n        return new RGBAColor(RGBAColor.CSSMap.get(str) || RGBAColor.White());\n    }\n    constructor(r, g = 0, b = 0, a = 255) {\n        this._r = 0;\n        this._g = 0;\n        this._b = 0;\n        this._a = 255;\n        if (r instanceof RGBAColor) {\n            this.r = r.r;\n            this.g = r.g;\n            this.b = r.b;\n            this.a = r.a;\n        }\n        else {\n            this.r = r;\n            this.g = g;\n            this.b = b;\n        }\n        this._a = a;\n    }\n    get r() {\n        return this._r;\n    }\n    get g() {\n        return this._g;\n    }\n    get b() {\n        return this._b;\n    }\n    get a() {\n        return this._a;\n    }\n    set r(value) {\n        this._r = Scalar.Clamp(value, 0, 255);\n    }\n    set g(value) {\n        this._g = Scalar.Clamp(value, 0, 255);\n    }\n    set b(value) {\n        this._b = Scalar.Clamp(value, 0, 255);\n    }\n    set a(value) {\n        this._a = Scalar.Clamp(value, 0, 255);\n    }\n    toHexString() {\n        const intR = Math.round(this.r);\n        const intG = Math.round(this.g);\n        const intB = Math.round(this.b);\n        return \"#\" + Scalar.ToHex(intR) + Scalar.ToHex(intG) + Scalar.ToHex(intB);\n    }\n    toHSL() {\n        const r = this.r / 255;\n        const g = this.g / 255;\n        const b = this.b / 255;\n        const max = Math.max(r, g, b);\n        const min = Math.min(r, g, b);\n        let h, s;\n        const l = (max + min) / 2;\n        if (max == min) {\n            h = s = 0;\n        }\n        else {\n            const d = max - min;\n            s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n            switch (max) {\n                case r:\n                    h = (g - b) / d + (g < b ? 6 : 0);\n                    break;\n                case g:\n                    h = (b - r) / d + 2;\n                    break;\n                case b:\n                    h = (r - g) / d + 4;\n                    break;\n                default:\n                    h = 0;\n                    break;\n            }\n            h /= 6;\n        }\n        return new HSLColor(h, s, l);\n    }\n    interpolate(color, t, keepAlpha = true) {\n        t = t || 0.5;\n        const r = Math.round(this.r + t * (color.r - this.r));\n        const g = Math.round(this.g + t * (color.g - this.g));\n        const b = Math.round(this.b + t * (color.b - this.b));\n        const a = keepAlpha ? this.a : Math.round(this.a + t * (color.a - this.a));\n        return new RGBAColor(r, g, b, a);\n    }\n    interpolateInPlace(color, t, keepAlpha = true) {\n        t = t || 0.5;\n        this.r = Math.round(this.r + t * (color.r - this.r));\n        this.g = Math.round(this.g + t * (color.g - this.g));\n        this.b = Math.round(this.b + t * (color.b - this.b));\n        this.a = keepAlpha ? this.a : Math.round(this.a + t * (color.a - this.a));\n        return this;\n    }\n    toString() {\n        return `rgb(${this.r},${this.g},${this.b})`;\n    }\n}\nRGBAColor.aliceblue = new RGBAColor(240, 248, 255);\nRGBAColor.antiquewhite = new RGBAColor(250, 235, 215);\nRGBAColor.aqua = new RGBAColor(0, 255, 255);\nRGBAColor.aquamarine = new RGBAColor(127, 255, 212);\nRGBAColor.azure = new RGBAColor(240, 255, 255);\nRGBAColor.beige = new RGBAColor(245, 245, 220);\nRGBAColor.bisque = new RGBAColor(255, 228, 196);\nRGBAColor.black = new RGBAColor(0, 0, 0);\nRGBAColor.blanchedalmond = new RGBAColor(255, 235, 205);\nRGBAColor.blue = new RGBAColor(0, 0, 255);\nRGBAColor.blueviolet = new RGBAColor(138, 43, 226);\nRGBAColor.brown = new RGBAColor(165, 42, 42);\nRGBAColor.burlywood = new RGBAColor(222, 184, 135);\nRGBAColor.cadetblue = new RGBAColor(95, 158, 160);\nRGBAColor.chartreuse = new RGBAColor(127, 255, 0);\nRGBAColor.chocolate = new RGBAColor(210, 105, 30);\nRGBAColor.coral = new RGBAColor(255, 127, 80);\nRGBAColor.cornflowerblue = new RGBAColor(100, 149, 237);\nRGBAColor.cornsilk = new RGBAColor(255, 248, 220);\nRGBAColor.crimson = new RGBAColor(220, 20, 60);\nRGBAColor.cyan = new RGBAColor(0, 255, 255);\nRGBAColor.darkblue = new RGBAColor(0, 0, 139);\nRGBAColor.darkcyan = new RGBAColor(0, 139, 139);\nRGBAColor.darkgoldenrod = new RGBAColor(184, 134, 11);\nRGBAColor.darkgray = new RGBAColor(169, 169, 169);\nRGBAColor.darkgreen = new RGBAColor(0, 100, 0);\nRGBAColor.darkgrey = new RGBAColor(169, 169, 169);\nRGBAColor.darkkhaki = new RGBAColor(189, 183, 107);\nRGBAColor.darkmagenta = new RGBAColor(139, 0, 139);\nRGBAColor.darkolivegreen = new RGBAColor(85, 107, 47);\nRGBAColor.darkorange = new RGBAColor(255, 140, 0);\nRGBAColor.darkorchid = new RGBAColor(153, 50, 204);\nRGBAColor.darkred = new RGBAColor(139, 0, 0);\nRGBAColor.darksalmon = new RGBAColor(233, 150, 122);\nRGBAColor.darkseagreen = new RGBAColor(143, 188, 143);\nRGBAColor.darkslateblue = new RGBAColor(72, 61, 139);\nRGBAColor.darkslategray = new RGBAColor(47, 79, 79);\nRGBAColor.darkslategrey = new RGBAColor(47, 79, 79);\nRGBAColor.darkturquoise = new RGBAColor(0, 206, 209);\nRGBAColor.darkviolet = new RGBAColor(148, 0, 211);\nRGBAColor.deeppink = new RGBAColor(255, 20, 147);\nRGBAColor.deepskyblue = new RGBAColor(0, 191, 255);\nRGBAColor.dimgray = new RGBAColor(105, 105, 105);\nRGBAColor.dimgrey = new RGBAColor(105, 105, 105);\nRGBAColor.dodgerblue = new RGBAColor(30, 144, 255);\nRGBAColor.firebrick = new RGBAColor(178, 34, 34);\nRGBAColor.floralwhite = new RGBAColor(255, 250, 240);\nRGBAColor.forestgreen = new RGBAColor(34, 139, 34);\nRGBAColor.fuchsia = new RGBAColor(255, 0, 255);\nRGBAColor.gainsboro = new RGBAColor(220, 220, 220);\nRGBAColor.ghostwhite = new RGBAColor(248, 248, 255);\nRGBAColor.gold = new RGBAColor(255, 215, 0);\nRGBAColor.goldenrod = new RGBAColor(218, 165, 32);\nRGBAColor.gray = new RGBAColor(128, 128, 128);\nRGBAColor.green = new RGBAColor(0, 128, 0);\nRGBAColor.greenyellow = new RGBAColor(173, 255, 47);\nRGBAColor.grey = new RGBAColor(128, 128, 128);\nRGBAColor.honeydew = new RGBAColor(240, 255, 240);\nRGBAColor.hotpink = new RGBAColor(255, 105, 180);\nRGBAColor.indianred = new RGBAColor(205, 92, 92);\nRGBAColor.indigo = new RGBAColor(75, 0, 130);\nRGBAColor.ivory = new RGBAColor(255, 255, 240);\nRGBAColor.khaki = new RGBAColor(240, 230, 140);\nRGBAColor.lavender = new RGBAColor(230, 230, 250);\nRGBAColor.lavenderblush = new RGBAColor(255, 240, 245);\nRGBAColor.lawngreen = new RGBAColor(124, 252, 0);\nRGBAColor.lemonchiffon = new RGBAColor(255, 250, 205);\nRGBAColor.lightblue = new RGBAColor(173, 216, 230);\nRGBAColor.lightcoral = new RGBAColor(240, 128, 128);\nRGBAColor.lightcyan = new RGBAColor(224, 255, 255);\nRGBAColor.lightgoldenrodyellow = new RGBAColor(250, 250, 210);\nRGBAColor.lightgray = new RGBAColor(211, 211, 211);\nRGBAColor.lightgreen = new RGBAColor(144, 238, 144);\nRGBAColor.lightgrey = new RGBAColor(211, 211, 211);\nRGBAColor.lightpink = new RGBAColor(255, 182, 193);\nRGBAColor.lightsalmon = new RGBAColor(255, 160, 122);\nRGBAColor.lightseagreen = new RGBAColor(32, 178, 170);\nRGBAColor.lightskyblue = new RGBAColor(135, 206, 250);\nRGBAColor.lightslategray = new RGBAColor(119, 136, 153);\nRGBAColor.lightslategrey = new RGBAColor(119, 136, 153);\nRGBAColor.lightsteelblue = new RGBAColor(176, 196, 222);\nRGBAColor.lightyellow = new RGBAColor(255, 255, 224);\nRGBAColor.lime = new RGBAColor(0, 255, 0);\nRGBAColor.limegreen = new RGBAColor(50, 205, 50);\nRGBAColor.linen = new RGBAColor(250, 240, 230);\nRGBAColor.magenta = new RGBAColor(255, 0, 255);\nRGBAColor.maroon = new RGBAColor(128, 0, 0);\nRGBAColor.mediumaquamarine = new RGBAColor(102, 205, 170);\nRGBAColor.mediumblue = new RGBAColor(0, 0, 205);\nRGBAColor.mediumorchid = new RGBAColor(186, 85, 211);\nRGBAColor.mediumpurple = new RGBAColor(147, 112, 219);\nRGBAColor.mediumseagreen = new RGBAColor(60, 179, 113);\nRGBAColor.mediumslateblue = new RGBAColor(123, 104, 238);\nRGBAColor.mediumspringgreen = new RGBAColor(0, 250, 154);\nRGBAColor.mediumturquoise = new RGBAColor(72, 209, 204);\nRGBAColor.mediumvioletred = new RGBAColor(199, 21, 133);\nRGBAColor.midnightblue = new RGBAColor(25, 25, 112);\nRGBAColor.mintcream = new RGBAColor(245, 255, 250);\nRGBAColor.mistyrose = new RGBAColor(255, 228, 225);\nRGBAColor.moccasin = new RGBAColor(255, 228, 181);\nRGBAColor.navajowhite = new RGBAColor(255, 222, 173);\nRGBAColor.navy = new RGBAColor(0, 0, 128);\nRGBAColor.oldlace = new RGBAColor(253, 245, 230);\nRGBAColor.olive = new RGBAColor(128, 128, 0);\nRGBAColor.olivedrab = new RGBAColor(107, 142, 35);\nRGBAColor.orange = new RGBAColor(255, 165, 0);\nRGBAColor.orangered = new RGBAColor(255, 69, 0);\nRGBAColor.orchid = new RGBAColor(218, 112, 214);\nRGBAColor.palegoldenrod = new RGBAColor(238, 232, 170);\nRGBAColor.palegreen = new RGBAColor(152, 251, 152);\nRGBAColor.paleturquoise = new RGBAColor(175, 238, 238);\nRGBAColor.palevioletred = new RGBAColor(219, 112, 147);\nRGBAColor.papayawhip = new RGBAColor(255, 239, 213);\nRGBAColor.peachpuff = new RGBAColor(255, 218, 185);\nRGBAColor.peru = new RGBAColor(205, 133, 63);\nRGBAColor.pink = new RGBAColor(255, 192, 203);\nRGBAColor.plum = new RGBAColor(221, 160, 221);\nRGBAColor.powderblue = new RGBAColor(176, 224, 230);\nRGBAColor.purple = new RGBAColor(128, 0, 128);\nRGBAColor.red = new RGBAColor(255, 0, 0);\nRGBAColor.rosybrown = new RGBAColor(188, 143, 143);\nRGBAColor.royalblue = new RGBAColor(65, 105, 225);\nRGBAColor.saddlebrown = new RGBAColor(139, 69, 19);\nRGBAColor.salmon = new RGBAColor(250, 128, 114);\nRGBAColor.sandybrown = new RGBAColor(244, 164, 96);\nRGBAColor.seagreen = new RGBAColor(46, 139, 87);\nRGBAColor.seashell = new RGBAColor(255, 245, 238);\nRGBAColor.sienna = new RGBAColor(160, 82, 45);\nRGBAColor.silver = new RGBAColor(192, 192, 192);\nRGBAColor.skyblue = new RGBAColor(135, 206, 235);\nRGBAColor.slateblue = new RGBAColor(106, 90, 205);\nRGBAColor.slategray = new RGBAColor(112, 128, 144);\nRGBAColor.slategrey = new RGBAColor(112, 128, 144);\nRGBAColor.snow = new RGBAColor(255, 250, 250);\nRGBAColor.springgreen = new RGBAColor(0, 255, 127);\nRGBAColor.steelblue = new RGBAColor(70, 130, 180);\nRGBAColor.tan = new RGBAColor(210, 180, 140);\nRGBAColor.teal = new RGBAColor(0, 128, 128);\nRGBAColor.thistle = new RGBAColor(216, 191, 216);\nRGBAColor.tomato = new RGBAColor(255, 99, 71);\nRGBAColor.turquoise = new RGBAColor(64, 224, 208);\nRGBAColor.violet = new RGBAColor(238, 130, 238);\nRGBAColor.wheat = new RGBAColor(245, 222, 179);\nRGBAColor.white = new RGBAColor(255, 255, 255);\nRGBAColor.whitesmoke = new RGBAColor(245, 245, 245);\nRGBAColor.yellow = new RGBAColor(255, 255, 0);\nRGBAColor.yellowgreen = new RGBAColor(154, 205, 50);\nRGBAColor.CSSMap = new Map([\n    [\"aliceblue\", RGBAColor.aliceblue],\n    [\"antiquewhite\", RGBAColor.antiquewhite],\n    [\"aqua\", RGBAColor.aqua],\n    [\"aquamarine\", RGBAColor.aquamarine],\n    [\"azure\", RGBAColor.azure],\n    [\"beige\", RGBAColor.beige],\n    [\"bisque\", RGBAColor.bisque],\n    [\"black\", RGBAColor.black],\n    [\"blanchedalmond\", RGBAColor.blanchedalmond],\n    [\"blue\", RGBAColor.blue],\n    [\"blueviolet\", RGBAColor.blueviolet],\n    [\"brown\", RGBAColor.brown],\n    [\"burlywood\", RGBAColor.burlywood],\n    [\"cadetblue\", RGBAColor.cadetblue],\n    [\"chartreuse\", RGBAColor.chartreuse],\n    [\"chocolate\", RGBAColor.chocolate],\n    [\"coral\", RGBAColor.coral],\n    [\"cornflowerblue\", RGBAColor.cornflowerblue],\n    [\"cornsilk\", RGBAColor.cornsilk],\n    [\"crimson\", RGBAColor.crimson],\n    [\"cyan\", RGBAColor.cyan],\n    [\"darkblue\", RGBAColor.darkblue],\n    [\"darkcyan\", RGBAColor.darkcyan],\n    [\"darkgoldenrod\", RGBAColor.darkgoldenrod],\n    [\"darkgray\", RGBAColor.darkgray],\n    [\"darkgreen\", RGBAColor.darkgreen],\n    [\"darkgrey\", RGBAColor.darkgrey],\n    [\"darkkhaki\", RGBAColor.darkkhaki],\n    [\"darkmagenta\", RGBAColor.darkmagenta],\n    [\"darkolivegreen\", RGBAColor.darkolivegreen],\n    [\"darkorange\", RGBAColor.darkorange],\n    [\"darkorchid\", RGBAColor.darkorchid],\n    [\"darkred\", RGBAColor.darkred],\n    [\"darksalmon\", RGBAColor.darksalmon],\n    [\"darkseagreen\", RGBAColor.darkseagreen],\n    [\"darkslateblue\", RGBAColor.darkslateblue],\n    [\"darkslategray\", RGBAColor.darkslategray],\n    [\"darkslategrey\", RGBAColor.darkslategrey],\n    [\"darkturquoise\", RGBAColor.darkturquoise],\n    [\"darkviolet\", RGBAColor.darkviolet],\n    [\"deeppink\", RGBAColor.deeppink],\n    [\"deepskyblue\", RGBAColor.deepskyblue],\n    [\"dimgray\", RGBAColor.dimgray],\n    [\"dimgrey\", RGBAColor.dimgrey],\n    [\"dodgerblue\", RGBAColor.dodgerblue],\n    [\"firebrick\", RGBAColor.firebrick],\n    [\"floralwhite\", RGBAColor.floralwhite],\n    [\"forestgreen\", RGBAColor.forestgreen],\n    [\"fuchsia\", RGBAColor.fuchsia],\n    [\"gainsboro\", RGBAColor.gainsboro],\n    [\"ghostwhite\", RGBAColor.ghostwhite],\n    [\"gold\", RGBAColor.gold],\n    [\"goldenrod\", RGBAColor.goldenrod],\n    [\"gray\", RGBAColor.gray],\n    [\"green\", RGBAColor.green],\n    [\"greenyellow\", RGBAColor.greenyellow],\n    [\"grey\", RGBAColor.grey],\n    [\"honeydew\", RGBAColor.honeydew],\n    [\"hotpink\", RGBAColor.hotpink],\n    [\"indianred\", RGBAColor.indianred],\n    [\"indigo\", RGBAColor.indigo],\n    [\"ivory\", RGBAColor.ivory],\n    [\"khaki\", RGBAColor.khaki],\n    [\"lavender\", RGBAColor.lavender],\n    [\"lavenderblush\", RGBAColor.lavenderblush],\n    [\"lawngreen\", RGBAColor.lawngreen],\n    [\"lemonchiffon\", RGBAColor.lemonchiffon],\n    [\"lightblue\", RGBAColor.lightblue],\n    [\"lightcoral\", RGBAColor.lightcoral],\n    [\"lightcyan\", RGBAColor.lightcyan],\n    [\"lightgoldenrodyellow\", RGBAColor.lightgoldenrodyellow],\n    [\"lightgray\", RGBAColor.lightgray],\n    [\"lightgreen\", RGBAColor.lightgreen],\n    [\"lightgrey\", RGBAColor.lightgrey],\n    [\"lightpink\", RGBAColor.lightpink],\n    [\"lightsalmon\", RGBAColor.lightsalmon],\n    [\"lightseagreen\", RGBAColor.lightseagreen],\n    [\"lightskyblue\", RGBAColor.lightskyblue],\n    [\"lightslategray\", RGBAColor.lightslategray],\n    [\"lightslategrey\", RGBAColor.lightslategrey],\n    [\"lightsteelblue\", RGBAColor.lightsteelblue],\n    [\"lightyellow\", RGBAColor.lightyellow],\n    [\"lime\", RGBAColor.lime],\n    [\"limegreen\", RGBAColor.limegreen],\n    [\"linen\", RGBAColor.linen],\n    [\"magenta\", RGBAColor.magenta],\n    [\"maroon\", RGBAColor.maroon],\n    [\"mediumaquamarine\", RGBAColor.mediumaquamarine],\n    [\"mediumblue\", RGBAColor.mediumblue],\n    [\"mediumorchid\", RGBAColor.mediumorchid],\n    [\"mediumpurple\", RGBAColor.mediumpurple],\n    [\"mediumseagreen\", RGBAColor.mediumseagreen],\n    [\"mediumslateblue\", RGBAColor.mediumslateblue],\n    [\"mediumspringgreen\", RGBAColor.mediumspringgreen],\n    [\"mediumturquoise\", RGBAColor.mediumturquoise],\n    [\"mediumvioletred\", RGBAColor.mediumvioletred],\n    [\"midnightblue\", RGBAColor.midnightblue],\n    [\"mintcream\", RGBAColor.mintcream],\n    [\"mistyrose\", RGBAColor.mistyrose],\n    [\"moccasin\", RGBAColor.moccasin],\n    [\"navajowhite\", RGBAColor.navajowhite],\n    [\"navy\", RGBAColor.navy],\n    [\"oldlace\", RGBAColor.oldlace],\n    [\"olive\", RGBAColor.olive],\n    [\"olivedrab\", RGBAColor.olivedrab],\n    [\"orange\", RGBAColor.orange],\n    [\"orangered\", RGBAColor.orangered],\n    [\"orchid\", RGBAColor.orchid],\n    [\"palegoldenrod\", RGBAColor.palegoldenrod],\n    [\"palegreen\", RGBAColor.palegreen],\n    [\"paleturquoise\", RGBAColor.paleturquoise],\n    [\"palevioletred\", RGBAColor.palevioletred],\n    [\"papayawhip\", RGBAColor.papayawhip],\n    [\"peachpuff\", RGBAColor.peachpuff],\n    [\"peru\", RGBAColor.peru],\n    [\"pink\", RGBAColor.pink],\n    [\"plum\", RGBAColor.plum],\n    [\"powderblue\", RGBAColor.powderblue],\n    [\"purple\", RGBAColor.purple],\n    [\"red\", RGBAColor.red],\n    [\"rosybrown\", RGBAColor.rosybrown],\n    [\"royalblue\", RGBAColor.royalblue],\n    [\"saddlebrown\", RGBAColor.saddlebrown],\n    [\"salmon\", RGBAColor.salmon],\n    [\"sandybrown\", RGBAColor.sandybrown],\n    [\"seagreen\", RGBAColor.seagreen],\n    [\"seashell\", RGBAColor.seashell],\n    [\"sienna\", RGBAColor.sienna],\n    [\"silver\", RGBAColor.silver],\n    [\"skyblue\", RGBAColor.skyblue],\n    [\"slateblue\", RGBAColor.slateblue],\n    [\"slategray\", RGBAColor.slategray],\n    [\"slategrey\", RGBAColor.slategrey],\n    [\"snow\", RGBAColor.snow],\n    [\"springgreen\", RGBAColor.springgreen],\n    [\"steelblue\", RGBAColor.steelblue],\n    [\"tan\", RGBAColor.tan],\n    [\"teal\", RGBAColor.teal],\n    [\"thistle\", RGBAColor.thistle],\n    [\"tomato\", RGBAColor.tomato],\n    [\"turquoise\", RGBAColor.turquoise],\n    [\"violet\", RGBAColor.violet],\n    [\"wheat\", RGBAColor.wheat],\n    [\"white\", RGBAColor.white],\n    [\"whitesmoke\", RGBAColor.whitesmoke],\n    [\"yellow\", RGBAColor.yellow],\n    [\"yellowgreen\", RGBAColor.yellowgreen],\n]);\nexport class HSLColor {\n    static hue2rgb(p, q, t) {\n        if (t < 0)\n            t += 1;\n        if (t > 1)\n            t -= 1;\n        if (t < 1 / 6)\n            return p + (q - p) * 6 * t;\n        if (t < 1 / 2)\n            return q;\n        if (t < 2 / 3)\n            return p + (q - p) * (2 / 3 - t) * 6;\n        return p;\n    }\n    constructor(h, s, l) {\n        this.h = h;\n        this.s = s;\n        this.l = l;\n    }\n    toRGB() {\n        let l = this.l;\n        if (this.s === 0) {\n            l = Math.round(l * 255);\n            return new RGBAColor(l, l, l);\n        }\n        const s = this.s;\n        const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n        const p = 2 * l - q;\n        const r = HSLColor.hue2rgb(p, q, this.h + 1 / 3);\n        const g = HSLColor.hue2rgb(p, q, this.h);\n        const b = HSLColor.hue2rgb(p, q, this.h - 1 / 3);\n        return new RGBAColor(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255));\n    }\n}\n//# sourceMappingURL=math.color.js.map","export class Scalar {\n    static WithinEpsilon(a, b, epsilon = Scalar.EPSILON) {\n        const num = a - b;\n        return -epsilon <= num && num <= epsilon;\n    }\n    static Sign(value) {\n        return value > 0 ? 1 : -1;\n    }\n    static Clamp(value, min, max) {\n        if (min === void 0) {\n            min = 0;\n        }\n        if (max === void 0) {\n            max = 1;\n        }\n        return Math.min(max, Math.max(min, value));\n    }\n    static GetRandomInt(min, max) {\n        min = Math.ceil(min);\n        max = Math.floor(max);\n        return Math.floor(Math.random() * (max - min + 1)) + min;\n    }\n    static ToHex(i) {\n        const str = i.toString(16);\n        if (i <= 15) {\n            return (\"0\" + str).toUpperCase();\n        }\n        return str.toUpperCase();\n    }\n}\nScalar.EPSILON = 1.401298e-45;\nScalar.DEG2RAD = Math.PI / 180;\nScalar.RAD2DEG = 180 / Math.PI;\nScalar.INCH2METER = 0.0254;\nScalar.METER2INCH = 39.3701;\nScalar.PI = Math.PI;\nScalar.PI_2 = Math.PI / 2;\nScalar.PI_4 = Math.PI / 4;\nexport class AbstractRange {\n    constructor(min, max) {\n        this._min = min;\n        this._max = max;\n    }\n    get min() {\n        return this._min;\n    }\n    set min(m) {\n        this._min = m;\n        this._d = undefined;\n    }\n    get max() {\n        return this._max;\n    }\n    set max(m) {\n        this._max = m;\n        this._d = undefined;\n    }\n    get delta() {\n        if (this._d === undefined) {\n            this._d = this.computeDelta(this._min, this._max);\n        }\n        return this._d;\n    }\n}\nexport class Range extends AbstractRange {\n    static Zero() {\n        return new Range(0, 0);\n    }\n    static Max() {\n        return new Range(Number.MIN_VALUE, Number.MAX_VALUE);\n    }\n    computeDelta(a, b) {\n        return a && b ? b - a : Number.POSITIVE_INFINITY;\n    }\n    constructor(min, max) {\n        super(min, max);\n    }\n    unionInPlace(min, max) {\n        if (min instanceof Range) {\n            this.unionInPlace(min.min, min.max);\n            return;\n        }\n        this._min = Math.min(this._min, min);\n        if (max !== undefined) {\n            this._max = Math.max(this._max ?? max, max);\n        }\n    }\n    clone() {\n        return new Range(this._min, this._max);\n    }\n}\n//# sourceMappingURL=math.js.map","import { AbstractRange } from \"./math\";\nexport class Unit {\n    constructor(name, symbol, value = 0, converter) {\n        this.name = name;\n        this.symbol = symbol;\n        this.value = value;\n        this.converter = converter;\n    }\n}\nconst _defaultDecimalPrecision = 6;\nexport class Quantity {\n    static Convert(value, from, to) {\n        if (!from || !to || from === to) {\n            return value;\n        }\n        if (from.converter && from.converter.accept(to)) {\n            return from.converter.convert(value, to);\n        }\n        return value * (from.value / to.value);\n    }\n    static round(value, decimalPrecision = _defaultDecimalPrecision) {\n        const dp = decimalPrecision || _defaultDecimalPrecision;\n        return Math.round(value * Math.pow(10, dp)) / Math.pow(10, dp);\n    }\n    constructor(value, unit) {\n        if (value instanceof Quantity) {\n            const q = value;\n            this._value = q.value;\n            this._unit = q._unit;\n        }\n        else {\n            this._value = value;\n            this._unit = unit;\n        }\n    }\n    get unit() {\n        return this._unit;\n    }\n    set unit(target) {\n        if (target && this._unit && this._unit !== target) {\n            this.tryConvert(target);\n        }\n    }\n    get value() {\n        return this._value;\n    }\n    set value(value) {\n        this._value = value;\n    }\n    tryConvert(targetUnit) {\n        if (this._unit) {\n            if (this._unit.converter) {\n                if (this._unit.converter.accept(this._unit) === false) {\n                    return false;\n                }\n                this.value = this._unit.converter.convert(this.value, targetUnit);\n                this._unit = targetUnit;\n                return true;\n            }\n            if (targetUnit.value && targetUnit.symbol !== this._unit.symbol) {\n                this.value *= this._unit.value / targetUnit.value;\n                this._unit = targetUnit;\n                return true;\n            }\n        }\n        return false;\n    }\n    clone(unit) {\n        const n = new (this.constructor(this._value, this._unit))();\n        if (unit) {\n            n.tryConvert(unit);\n        }\n        return n;\n    }\n    getValue(unit) {\n        if (!this._unit) {\n            return this._value;\n        }\n        if (unit && unit !== this._unit) {\n            if (this._unit.converter) {\n                if (this._unit.converter.accept(unit)) {\n                    return this._unit.converter.convert(this.value, unit);\n                }\n            }\n            if (unit.value && unit.symbol !== this._unit.symbol) {\n                return this.value * (this._unit.value / unit.value);\n            }\n        }\n        return this.value;\n    }\n    equals(v) {\n        if (v._unit === this._unit) {\n            return this.value === v.value;\n        }\n        return this.value === v.getValue(this._unit);\n    }\n    subtract(v) {\n        const result = this.value - (v._unit === this._unit ? v.value : v.getValue(this._unit));\n        return this.constructor(result, this._unit);\n    }\n    add(v) {\n        const result = this.value + (v._unit === this._unit ? v.value : v.getValue(this._unit));\n        return this.constructor(result, this._unit);\n    }\n    tryParse(str) {\n        if (str) {\n            const parts = str.split(\" \");\n            const v = parseFloat(str);\n            if (Number.isNaN(v)) {\n                return false;\n            }\n            this.value = v;\n            if (parts.length > 1) {\n                this._unit = this.unitForSymbol(parts[1]);\n            }\n            else {\n                this._unit = undefined;\n            }\n            return true;\n        }\n        return false;\n    }\n}\nexport class QuantityRange extends AbstractRange {\n    computeDelta(a, b) {\n        return b && a ? b.subtract(a) : a.constructor(0, a.unit);\n    }\n}\nexport class Timespan extends Quantity {\n    static ForParameter(value, defaultValue, defaultUnit) {\n        return value ? new Timespan(value, defaultUnit) : new Timespan(defaultValue, defaultUnit);\n    }\n    unitForSymbol(str) {\n        return Timespan.Units[str] || undefined;\n    }\n}\nTimespan.Units = {\n    ys: new Unit(\"yoctosecond\", \"ys\", 10e-24),\n    zs: new Unit(\"zeptosecond\", \"zs\", 10e-21),\n    as: new Unit(\"attosecond\", \"as\", 10e-18),\n    fs: new Unit(\"femtosecond\", \"fs\", 10e-15),\n    ps: new Unit(\"picosecond\", \"ps\", 10e-12),\n    ns: new Unit(\"nanosecond\", \"ns\", 10e-9),\n    tick: new Unit(\"tick\", \"ns\", 10e-7),\n    mis: new Unit(\"microsecond\", \"mis\", 10e-6),\n    ms: new Unit(\"millisecond\", \"ms\", 10e-3),\n    s: new Unit(\"second\", \"s\", 1),\n    Min: new Unit(\"minute\", \"m\", 60),\n    Hour: new Unit(\"hour\", \"h\", 3600),\n    Day: new Unit(\"day\", \"d\", 86400),\n    Week: new Unit(\"week\", \"w\", 86400 * 7),\n    Yr: new Unit(\"year\", \"y\", 86400 * 365.25),\n    Cy: new Unit(\"century\", \"c\", 86400 * 36525),\n};\nclass KConverter {\n    accept(unit) {\n        return unit === Temperature.Units.c || unit === Temperature.Units.f;\n    }\n    convert(value, unit) {\n        switch (unit) {\n            case Temperature.Units.c:\n                return value - Temperature.Units.k.value;\n            case Temperature.Units.f:\n                return (value - Temperature.Units.k.value) * 1.8 + 32;\n            default:\n                return value;\n        }\n    }\n}\nclass CConverter {\n    accept(unit) {\n        return unit === Temperature.Units.k || unit === Temperature.Units.f;\n    }\n    convert(value, unit) {\n        switch (unit) {\n            case Temperature.Units.k:\n                return value + Temperature.Units.k.value;\n            case Temperature.Units.f:\n                return value * 1.8 + 32;\n            default:\n                return value;\n        }\n    }\n}\nclass FConverter {\n    accept(unit) {\n        return unit === Temperature.Units.k || unit === Temperature.Units.c;\n    }\n    convert(value, unit) {\n        switch (unit) {\n            case Temperature.Units.k:\n                return (value - 32) / 1.8 + Temperature.Units.k.value;\n            case Temperature.Units.c:\n                return (value - 32) / 1.8;\n            default:\n                return value;\n        }\n    }\n}\nexport class Temperature extends Quantity {\n    static ForParameter(value, defaultValue, defaultUnit) {\n        return value ? new Temperature(value, defaultUnit) : new Temperature(defaultValue, defaultUnit);\n    }\n    unitForSymbol(str) {\n        return Temperature.Units[str] || undefined;\n    }\n}\nTemperature.Units = {\n    k: new Unit(\"kelvin\", \"k\", -273.15, new KConverter()),\n    c: new Unit(\"celsius\", \"c\", 1, new CConverter()),\n    f: new Unit(\"fahrenheit\", \"f\", 33.8, new FConverter()),\n};\nexport class Mass extends Quantity {\n    static ForParameter(value, defaultValue, defaultUnit) {\n        return value ? new Mass(value, defaultUnit) : new Mass(defaultValue, defaultUnit);\n    }\n    unitForSymbol(str) {\n        return Mass.Units[str] || undefined;\n    }\n}\nMass.Units = {\n    u: new Unit(\"atomic mass unit\", \"u\", 1.66e-27),\n    pm: new Unit(\"plank mass\", \"pm\", 1e-8),\n    mg: new Unit(\"microgram\", \"µg\", 1e-6),\n    g: new Unit(\"gram\", \"g\", 1e-3),\n    pound: new Unit(\"pound\", \"lb\", 0.45359237),\n    kg: new Unit(\"kilogram\", \"kg\", 1),\n    T: new Unit(\"Ton\", \"T\", 1000),\n    Sm: new Unit(\"solar mass\", \"Sm\", 1.98855e30),\n};\nexport class Power extends Quantity {\n    static ForParameter(value, defaultValue, defaultUnit) {\n        return value ? new Power(value, defaultUnit) : new Power(defaultValue, defaultUnit);\n    }\n    unitForSymbol(str) {\n        return Power.Units[str] || undefined;\n    }\n}\nPower.Units = {\n    watt: new Unit(\"watt\", \"w\", 1),\n    Kwatt: new Unit(\"Kwatt\", \"kw\", 1000),\n};\nexport class Voltage extends Quantity {\n    static ForParameter(value, defaultValue, defaultUnit) {\n        return value ? new Voltage(value, defaultUnit) : new Voltage(defaultValue, defaultUnit);\n    }\n    unitForSymbol(str) {\n        return Voltage.Units[str] || undefined;\n    }\n}\nVoltage.Units = {\n    volt: new Unit(\"volt\", \"v\", 1),\n};\nexport class Current extends Quantity {\n    static ForParameter(value, defaultValue, defaultUnit) {\n        return value ? new Current(value, defaultUnit) : new Current(defaultValue, defaultUnit);\n    }\n    unitForSymbol(str) {\n        return Current.Units[str] || undefined;\n    }\n}\nCurrent.Units = {\n    amp: new Unit(\"amp\", \"a\", 1),\n};\nexport class Luminosity extends Quantity {\n    static ForParameter(value, defaultValue, defaultUnit) {\n        return value ? new Luminosity(value, defaultUnit) : new Luminosity(defaultValue, defaultUnit);\n    }\n    unitForSymbol(str) {\n        return Luminosity.Units[str] || undefined;\n    }\n}\nLuminosity.Units = {\n    watt: new Unit(\"watt\", \"w\", 1),\n    Lsun: new Unit(\"solar luminosity\", \"Lsun\", 3.846e26),\n};\nexport class Volume extends Quantity {\n    static ForParameter(value, defaultValue, defaultUnit) {\n        return value ? new Volume(value, defaultUnit) : new Volume(defaultValue, defaultUnit);\n    }\n    unitForSymbol(str) {\n        return Volume.Units[str] || undefined;\n    }\n}\nVolume.Units = {\n    m3: new Unit(\"cubic meter\", \"m3\", 1),\n};\nexport class Angle extends Quantity {\n    static ForParameter(value, defaultValue, defaultUnit) {\n        return value ? new Angle(value, defaultUnit) : new Angle(defaultValue, defaultUnit);\n    }\n    unitForSymbol(str) {\n        return Angle.Units[str] || undefined;\n    }\n}\nAngle.PIBY2 = Math.PI / 2;\nAngle.PIBY4 = Math.PI / 4;\nAngle.DE2RA = Math.PI / 180;\nAngle.RA2DE = 180 / Math.PI;\nAngle.DE2RABY2 = Math.PI / 360;\nAngle.Units = {\n    d: new Unit(\"degre\", \"d\", 1),\n    r: new Unit(\"radian\", \"r\", Angle.RA2DE),\n};\nexport class Length extends Quantity {\n    static ForParameter(value, defaultValue, defaultUnit) {\n        return value ? new Length(value, defaultUnit) : new Length(defaultValue, defaultUnit);\n    }\n    unitForSymbol(str) {\n        return Length.Units[str] || undefined;\n    }\n}\nLength.Units = {\n    ym: new Unit(\"yoctometer\", \"ym\", 10e-24),\n    zm: new Unit(\"zeptometer\", \"zm\", 10e-21),\n    am: new Unit(\"attometer\", \"am\", 10e-18),\n    fm: new Unit(\"femtometer\", \"fm\", 10e-15),\n    pm: new Unit(\"picometer\", \"pm\", 10e-12),\n    nm: new Unit(\"nanometer\", \"nm\", 10e-9),\n    mim: new Unit(\"micrometer\", \"mim\", 10e-6),\n    mm: new Unit(\"millimeter\", \"mm\", 10e-3),\n    cm: new Unit(\"centimeter\", \"cm\", 10e-2),\n    in: new Unit(\"inch\", \"in\", 0.0254),\n    dm: new Unit(\"decimeter\", \"dm\", 10e-1),\n    m: new Unit(\"meter\", \"m\", 1),\n    Mi: new Unit(\"mile\", \"Mi\", 1.609343502101154),\n    Nmi: new Unit(\"nmile\", \"Nmi\", 1.8519994270282407189),\n    Dam: new Unit(\"decameter\", \"Dm\", 10),\n    Hm: new Unit(\"hectometer\", \"Hm\", 100),\n    Km: new Unit(\"kilometer\", \"Km\", 1000),\n    Sr: new Unit(\"solar radius\", \"Sr\", 6957e5),\n    Mm: new Unit(\"megameter\", \"Mn\", 10e6),\n    Ls: new Unit(\"light second\", \"Ls\", 299792458),\n    Gm: new Unit(\"gigameter\", \"Gm\", 10e9),\n    Au: new Unit(\"astronomical unit\", \"Au\", 1.496e11),\n    Tm: new Unit(\"terameter\", \"Tm\", 10e12),\n    Pm: new Unit(\"petameter\", \"Pm\", 10e15),\n    Ly: new Unit(\"light year\", \"Ly\", 9.4607e15),\n    Pc: new Unit(\"parsec\", \"Pc\", 3.0857e16),\n    Em: new Unit(\"exameter\", \"Em\", 10e18),\n    Zm: new Unit(\"zettameter\", \"Zm\", 10e21),\n    Ym: new Unit(\"yottameter\", \"Ym\", 10e24),\n};\nexport class Speed extends Quantity {\n    static ForParameter(value, defaultValue, defaultUnit) {\n        return value ? new Length(value, defaultUnit) : new Length(defaultValue, defaultUnit);\n    }\n    unitForSymbol(str) {\n        return Speed.Units[str] || undefined;\n    }\n}\nSpeed.Units = {};\n//# sourceMappingURL=math.units.js.map","export * from \"./terrain.grid\";\nexport * from \"./meshes.interfaces\";\n//# sourceMappingURL=index.js.map","export class TerrainGridOptions {\n    constructor(p) {\n        Object.assign(this, p);\n    }\n    clone() {\n        return new TerrainGridOptions(this);\n    }\n}\nTerrainGridOptions.DefaultGridSize = 32;\nTerrainGridOptions.DefaultInvertIndices = false;\nTerrainGridOptions.DefaultScale = 1;\nTerrainGridOptions.Shared = new TerrainGridOptions({\n    columns: TerrainGridOptions.DefaultGridSize,\n});\nexport class TerrainGridOptionsBuilder {\n    withUvs(flag) {\n        this._uvs = flag;\n        return this;\n    }\n    withNormals(flag) {\n        this._normals = flag;\n        return this;\n    }\n    withColumns(v) {\n        this._cols = v;\n        return this;\n    }\n    withRows(v) {\n        this._rows = v;\n        return this;\n    }\n    withInvertIndices(v) {\n        this._invertIndices = v;\n        return this;\n    }\n    withInvertYZ(v) {\n        this._invertYZ = v;\n        return this;\n    }\n    withScale(x, y) {\n        this._sx = x;\n        this._sy = y || x;\n        return this;\n    }\n    withOffset(x, y) {\n        this._ox = x;\n        this._oy = y || x;\n        return this;\n    }\n    withZInitializer(zinit) {\n        this._zInitializer = zinit;\n        return this;\n    }\n    withUVInitializer(uvinit) {\n        this._uvInitializer = uvinit;\n        return this;\n    }\n    build() {\n        return new TerrainGridOptions({\n            uvs: this._uvs,\n            normals: this._normals,\n            columns: this._cols || this._rows,\n            rows: this._rows || this._cols,\n            sx: this._sx,\n            sy: this._sy,\n            invertIndices: this._invertIndices,\n            invertYZ: this._invertYZ,\n            zInitializer: this._zInitializer,\n            uvInitializer: this._uvInitializer,\n        });\n    }\n}\nexport class TerrainNormalizedGridBuilder {\n    constructor(options = null) {\n        this.withOptions(options);\n    }\n    withOptions(options) {\n        this._o = { ...TerrainGridOptions.Shared, ...options };\n        return this;\n    }\n    build(data, ...params) {\n        data = data || {};\n        const w = this._o?.columns || TerrainGridOptions.DefaultGridSize;\n        const h = this._o?.rows || w;\n        const sx = this._o?.sx || TerrainGridOptions.DefaultScale;\n        const sy = this._o?.sy || TerrainGridOptions.DefaultScale;\n        const ox = this._o?.ox || 0;\n        const oy = this._o?.oy || 0;\n        const positions = [];\n        const indices = [];\n        const uvs = this._o?.uvs ? [] : null;\n        const normals = this._o?.normals ? [] : null;\n        const dx = 1 / (w - 1);\n        const dy = 1 / (h - 1);\n        const x0 = -0.5 + ox * dx;\n        const y0 = 0.5 + oy * dy;\n        for (let row = 0; row < h; row++) {\n            let v = row == h - 1 ? 1 : row * dy;\n            const y = (y0 - v) * sy;\n            for (let column = 0; column < w; column++) {\n                const u = column == w - 1 ? 1 : column * dx;\n                const x = (x0 + u) * sx;\n                const z = this._o?.zInitializer ? this._o.zInitializer(column, row, w, h, ...params) : 0;\n                if (this._o?.invertYZ)\n                    positions.push(x, z, y);\n                else\n                    positions.push(x, y, z);\n                if (uvs) {\n                    const uv = this._o?.uvInitializer ? this._o.uvInitializer(column, row, w, h, ...params) : [u, v];\n                    uvs.push(...uv);\n                }\n                if (normals) {\n                    if (this._o?.invertYZ)\n                        normals.push(0, 1, 0);\n                    else\n                        normals.push(0, 0, 1);\n                }\n            }\n        }\n        const isWEven = w % 2 == 0;\n        for (let row = 0; row < h - 1; row++) {\n            const indice = isWEven ? row % 2 : 0;\n            const offset = row * w;\n            for (let col = 0; col < w - 1; col++) {\n                const idx1 = offset + col;\n                const idx2 = idx1 + w;\n                const idx3 = idx2 + 1;\n                const idx4 = idx1 + 1;\n                if (idx1 % 2 != indice) {\n                    if (this._o?.invertIndices) {\n                        indices.push(idx1, idx2, idx4, idx2, idx3, idx4);\n                    }\n                    else {\n                        indices.push(idx1, idx4, idx2, idx2, idx4, idx3);\n                    }\n                }\n                else {\n                    if (this._o?.invertIndices) {\n                        indices.push(idx1, idx2, idx3, idx3, idx4, idx1);\n                    }\n                    else {\n                        indices.push(idx1, idx3, idx2, idx3, idx1, idx4);\n                    }\n                }\n            }\n        }\n        data.indices = indices;\n        data.positions = positions;\n        data.uvs = uvs;\n        data.normals = normals;\n        return data;\n    }\n}\n//# sourceMappingURL=terrain.grid.js.map","export * from \"./space.kepler\";\nexport * from \"./space.celestialTracker\";\n//# sourceMappingURL=index.js.map","import { Scalar } from \"../../math/math\";\nexport class HorizonVector {\n    constructor(azimuth, altitude) {\n        this.azimuth = azimuth;\n        this.altitude = altitude;\n    }\n}\nexport class EquatorialVector {\n    constructor(rightAscension, declination) {\n        this.rightAscension = rightAscension;\n        this.declination = declination;\n    }\n}\nexport class MoonState {\n    constructor(fraction, phase, angle) {\n        this.fraction = fraction;\n        this.phase = phase;\n        this.angle = angle;\n    }\n}\nexport class SunTrajectoryConfig {\n    constructor(angle, riseName, setName) {\n        this.angle = angle;\n        this.riseName = riseName;\n        this.setName = setName;\n    }\n}\nexport class JulianDate {\n    static JulianCycle(d, lw) {\n        return Math.round(d - JulianDate.J0 - lw / (2 * Math.PI));\n    }\n    static FromDate(date) {\n        return new JulianDate(date.valueOf() / JulianDate.DayMs - 0.5 + JulianDate.J1970);\n    }\n    static ToDate(julian) {\n        return new Date((julian + 0.5 - JulianDate.J1970) * JulianDate.DayMs);\n    }\n    constructor(value) {\n        this._value = value;\n    }\n    get value() {\n        return this._value;\n    }\n    toDate() {\n        return new Date((this._value + 0.5 - JulianDate.J1970) * JulianDate.DayMs);\n    }\n    toDays() {\n        return this._value - JulianDate.J2000;\n    }\n}\nJulianDate.DayMs = 1000 * 60 * 60 * 24;\nJulianDate.J1970 = 2440588;\nJulianDate.J2000 = 2451545;\nJulianDate.J0 = 0.0009;\nexport class CelestialTracker {\n    static _ApproxTransit(Ht, lw, n) {\n        return JulianDate.J0 + (Ht + lw) / (2 * Math.PI) + n;\n    }\n    static _SolarTransitJ(ds, M, L) {\n        return JulianDate.J2000 + ds + 0.0053 * Math.sin(M) - 0.0069 * Math.sin(2 * L);\n    }\n    static _HourAngle(h, phi, d) {\n        return Math.acos((Math.sin(h) - Math.sin(phi) * Math.sin(d)) / (Math.cos(phi) * Math.cos(d)));\n    }\n    static _ObserverAngle(height) {\n        return (-2.076 * Math.sqrt(height)) / 60;\n    }\n    static _GetSetJ(h, lw, phi, dec, n, M, L) {\n        var w = CelestialTracker._HourAngle(h, phi, dec), a = CelestialTracker._ApproxTransit(w, lw, n);\n        return CelestialTracker._SolarTransitJ(a, M, L);\n    }\n    static Azimuth(H, phi, dec) {\n        return Math.atan2(Math.sin(H), Math.cos(H) * Math.sin(phi) - Math.tan(dec) * Math.cos(phi));\n    }\n    static Altitude(H, phi, dec) {\n        return Math.asin(Math.sin(phi) * Math.sin(dec) + Math.cos(phi) * Math.cos(dec) * Math.cos(H));\n    }\n    static SiderealTime(d, lw) {\n        return Scalar.DEG2RAD * (280.16 + 360.9856235 * d) - lw;\n    }\n    static Declination(l, b) {\n        return Math.asin(Math.sin(b) * CelestialTracker.EarthObliquity_Cos + Math.sin(l) * CelestialTracker.EarthObliquity_Sin * Math.cos(b));\n    }\n    static RightAscension(l, b) {\n        return Math.atan2(Math.sin(l) * CelestialTracker.EarthObliquity_Cos - Math.tan(b) * CelestialTracker.EarthObliquity_Sin, Math.cos(l));\n    }\n    static EclipticLongitude(M) {\n        const C = Scalar.DEG2RAD * (1.9148 * Math.sin(M) + 0.02 * Math.sin(2 * M) + 0.0003 * Math.sin(3 * M));\n        const P = Scalar.DEG2RAD * 102.9372;\n        return M + C + P + Math.PI;\n    }\n    static SolarMeanAnomaly(d) {\n        return Scalar.DEG2RAD * (357.5291 + 0.98560028 * d);\n    }\n    static SunCoords(d) {\n        const M = CelestialTracker.SolarMeanAnomaly(d);\n        const L = CelestialTracker.EclipticLongitude(M);\n        return new EquatorialVector(CelestialTracker.RightAscension(L, 0), CelestialTracker.Declination(L, 0));\n    }\n    static GetSunTimes(date, lat, lng, height) {\n        height = height || 0;\n        const lw = Scalar.DEG2RAD * -lng;\n        const phi = Scalar.DEG2RAD * lat;\n        const dh = CelestialTracker._ObserverAngle(height);\n        const d = JulianDate.FromDate(date).toDays();\n        const n = JulianDate.JulianCycle(d, lw);\n        const ds = CelestialTracker._ApproxTransit(0, lw, n);\n        const M = CelestialTracker.SolarMeanAnomaly(ds);\n        const L = CelestialTracker.EclipticLongitude(M);\n        const dec = CelestialTracker.Declination(L, 0);\n        const Jnoon = CelestialTracker._SolarTransitJ(ds, M, L);\n        var result = {\n            solarNoon: JulianDate.ToDate(Jnoon),\n            nadir: JulianDate.ToDate(Jnoon - 0.5),\n        };\n        const times = CelestialTracker.SunTrajectories;\n        for (let i = 0, len = times.length; i < len; i += 1) {\n            const time = times[i];\n            const h0 = (time.angle + dh) * Scalar.DEG2RAD;\n            const Jset = CelestialTracker._GetSetJ(h0, lw, phi, dec, n, M, L);\n            const Jrise = Jnoon - (Jset - Jnoon);\n            result[time.riseName] = JulianDate.ToDate(Jrise);\n            result[time.setName] = JulianDate.ToDate(Jset);\n        }\n        return result;\n    }\n    static GetSunPosition(date, lat, lon) {\n        const lw = -lon * Scalar.DEG2RAD;\n        const phi = lat * Scalar.DEG2RAD;\n        const d = JulianDate.FromDate(date).toDays();\n        const c = CelestialTracker.SunCoords(d);\n        const H = CelestialTracker.SiderealTime(d, lw) - c.rightAscension;\n        return new HorizonVector(CelestialTracker.Azimuth(H, phi, c.declination), CelestialTracker.Altitude(H, phi, c.declination));\n    }\n    static _MoonCoords(d) {\n        const L = Scalar.DEG2RAD * (218.316 + 13.176396 * d);\n        const M = Scalar.DEG2RAD * (134.963 + 13.064993 * d);\n        const F = Scalar.DEG2RAD * (93.272 + 13.22935 * d);\n        const l = L + Scalar.DEG2RAD * 6.289 * Math.sin(M);\n        const b = Scalar.DEG2RAD * 5.128 * Math.sin(F);\n        const dt = 385001 - 20905 * Math.cos(M);\n        const v = new EquatorialVector(CelestialTracker.RightAscension(l, b), CelestialTracker.Declination(l, b));\n        v.distance = dt;\n        return v;\n    }\n    static _AstroRefraction(h) {\n        if (h < 0)\n            h = 0;\n        return 0.0002967 / Math.tan(h + 0.00312536 / (h + 0.08901179));\n    }\n    static GetMoonPosition(date, lat, lon) {\n        const lw = -lon * Scalar.DEG2RAD;\n        const phi = lat * Scalar.DEG2RAD;\n        const d = JulianDate.FromDate(date).toDays();\n        const c = CelestialTracker._MoonCoords(d);\n        const H = CelestialTracker.SiderealTime(d, lw) - c.rightAscension;\n        let h = CelestialTracker.Altitude(H, phi, c.declination);\n        const pa = Math.atan2(Math.sin(H), Math.tan(phi) * Math.cos(c.declination) - Math.sin(c.declination) * Math.cos(H));\n        h = h + CelestialTracker._AstroRefraction(h);\n        const v = new HorizonVector(CelestialTracker.Azimuth(H, phi, c.declination), h);\n        v.distance = c.distance;\n        v.parallacticAngle = pa;\n        return v;\n    }\n    static _HoursLater(date, h) {\n        return new Date(date.valueOf() + (h * JulianDate.DayMs) / 24);\n    }\n}\nCelestialTracker.EarthObliquity = Scalar.DEG2RAD * 23.4397;\nCelestialTracker.EarthObliquity_Sin = Math.sin(CelestialTracker.EarthObliquity);\nCelestialTracker.EarthObliquity_Cos = Math.cos(CelestialTracker.EarthObliquity);\nCelestialTracker.SunTrajectories = [\n    new SunTrajectoryConfig(-0.833, \"sunrise\", \"sunset\"),\n    new SunTrajectoryConfig(-0.3, \"sunriseEnd\", \"sunsetStart\"),\n    new SunTrajectoryConfig(-6, \"dawn\", \"dusk\"),\n    new SunTrajectoryConfig(-12, \"nauticalDawn\", \"nauticalDusk\"),\n    new SunTrajectoryConfig(-18, \"nightEnd\", \"night\"),\n    new SunTrajectoryConfig(6, \"goldenHourEnd\", \"goldenHour\"),\n];\nCelestialTracker.GetMoonIllumination = function (date) {\n    const d = JulianDate.FromDate(date).toDays();\n    const s = CelestialTracker.SunCoords(d);\n    const m = CelestialTracker._MoonCoords(d);\n    const sdist = 149598000;\n    const phi = Math.acos(Math.sin(s.declination) * Math.sin(m.declination) + Math.cos(s.declination) * Math.cos(m.declination) * Math.cos(s.rightAscension - m.rightAscension));\n    const inc = Math.atan2(sdist * Math.sin(phi), m.distance - sdist * Math.cos(phi));\n    const angle = Math.atan2(Math.cos(s.declination) * Math.sin(s.rightAscension - m.rightAscension), Math.sin(s.declination) * Math.cos(m.declination) - Math.cos(s.declination) * Math.sin(m.declination) * Math.cos(s.rightAscension - m.rightAscension));\n    return new MoonState(1 + Math.cos(inc), 0.5 + (0.5 * inc * (angle < 0 ? -1 : 1)) / Math.PI, angle);\n};\nCelestialTracker.GetMoonTimes = function (date, lat, lng, inUTC) {\n    var t = new Date(date);\n    if (inUTC)\n        t.setUTCHours(0, 0, 0, 0);\n    else\n        t.setHours(0, 0, 0, 0);\n    const hc = 0.133 * Scalar.DEG2RAD;\n    let h0 = CelestialTracker.GetMoonPosition(t, lat, lng).altitude - hc;\n    let rise, set, ye;\n    for (var i = 1; i <= 24; i += 2) {\n        const h1 = CelestialTracker.GetMoonPosition(CelestialTracker._HoursLater(t, i), lat, lng).altitude - hc;\n        const h2 = CelestialTracker.GetMoonPosition(CelestialTracker._HoursLater(t, i + 1), lat, lng).altitude - hc;\n        const a = (h0 + h2) / 2 - h1;\n        const b = (h2 - h0) / 2;\n        const xe = -b / (2 * a);\n        ye = (a * xe + b) * xe + h1;\n        const d = b * b - 4 * a * h1;\n        let roots = 0;\n        let x1 = 0;\n        let x2 = 0;\n        if (d >= 0) {\n            const dx = Math.sqrt(d) / (Math.abs(a) * 2);\n            x1 = xe - dx;\n            x2 = xe + dx;\n            if (Math.abs(x1) <= 1)\n                roots++;\n            if (Math.abs(x2) <= 1)\n                roots++;\n            if (x1 < -1)\n                x1 = x2;\n        }\n        if (roots === 1) {\n            if (h0 < 0)\n                rise = i + x1;\n            else\n                set = i + x1;\n        }\n        else if (roots === 2) {\n            rise = i + (ye < 0 ? x2 : x1);\n            set = i + (ye < 0 ? x1 : x2);\n        }\n        if (rise && set)\n            break;\n        h0 = h2;\n    }\n    var result = {};\n    if (rise)\n        result.rise = CelestialTracker._HoursLater(t, rise);\n    if (set)\n        result.set = CelestialTracker._HoursLater(t, set);\n    if (!rise && !set)\n        result[ye && ye > 0 ? \"alwaysUp\" : \"alwaysDown\"] = true;\n    return result;\n};\n//# sourceMappingURL=space.celestialTracker.js.map","import { Length, Angle, Timespan, Speed } from \"../../math/math.units\";\nexport class KeplerOrbitBase {\n    constructor(body, focus, semiMajorAxis, eccentricity = 0, periapsisTime = 0, inclination, ascendingNodeLongitude, periapsisAngle, period) {\n        this._body = body;\n        this._focus = focus;\n        this._semiMajorAxis = new Length(semiMajorAxis, Length.Units.Ly);\n        this._eccentricity = eccentricity;\n        this._periapsisTime = periapsisTime;\n        this._inclination = new Angle(inclination, Angle.Units.d);\n        this._ascendingNodeLongitude = new Angle(ascendingNodeLongitude, Angle.Units.d);\n        this._periapsisAngle = new Angle(periapsisAngle, Angle.Units.d);\n        this._period = new Timespan(period, Timespan.Units.Yr);\n    }\n    get body() {\n        return this._body;\n    }\n    get focus() {\n        return this._focus;\n    }\n    get semiMajorAxis() {\n        return this._semiMajorAxis;\n    }\n    get semiMinorAxis() {\n        const v = this._semiMajorAxis.value * Math.sqrt(1.0 - this._eccentricity * this._eccentricity);\n        return new Length(v, this._semiMajorAxis.unit);\n    }\n    get periapsis() {\n        const v = this.semiMajorAxis.value * (1.0 - this._eccentricity);\n        return new Length(v, this._semiMajorAxis.unit);\n    }\n    get periapsisTime() {\n        return this._periapsisTime;\n    }\n    get periapsisAngle() {\n        return this._periapsisAngle;\n    }\n    get inclination() {\n        return this._inclination;\n    }\n    get period() {\n        return this._period;\n    }\n    get apoapsis() {\n        const v = this.semiMajorAxis.value * (1.0 + this._eccentricity);\n        return new Length(v, this._semiMajorAxis.unit);\n    }\n    get meanAngularSpeed() {\n        return new Speed(360.0 / this._period.value);\n    }\n    getEccentricAnomaly(meanAnomaly, decimalPrecision) {\n        const dp = decimalPrecision || KeplerOrbitBase.DefaultDecimalPrecision;\n        const K = Math.PI / 180.0;\n        let m = meanAnomaly / 360.0;\n        m = 2.0 * Math.PI * (m - Math.floor(m));\n        let E = this._eccentricity < 0.8 ? m : Math.PI;\n        let F = E - this._eccentricity * Math.sin(m) - m;\n        const maxIteration = KeplerOrbitBase.DefaultIterationLimit;\n        const delta = Math.pow(10, -dp);\n        let i = 0;\n        while (Math.abs(F) > delta && i++ < maxIteration) {\n            E -= F / (1.0 - this._eccentricity * Math.cos(E));\n            F = E - this._eccentricity * Math.sin(E) - m;\n        }\n        E /= K;\n        return new Length(Math.round(E * Math.pow(10, dp)) / Math.pow(10, dp));\n    }\n}\nKeplerOrbitBase.DefaultDecimalPrecision = 5;\nKeplerOrbitBase.DefaultIterationLimit = 30;\n//# sourceMappingURL=space.kepler.js.map","export * from \"./space.axialTilt\";\nexport * from \"./space.interfaces\";\nexport * from \"./space.spectralClass\";\nexport * from \"./space.starColor\";\nexport * from \"./Mechanics/index\";\n//# sourceMappingURL=index.js.map","import { Angle, Timespan } from \"../math/math.units\";\nexport class AxialTilt {\n    constructor(obliquity, period) {\n        this._obliquity = new Angle(obliquity, AxialTilt.defaultAngleUnit);\n        this._period = new Timespan(period, AxialTilt.defaultPeriodUnit);\n    }\n    get obliquity() {\n        return this._obliquity;\n    }\n    get period() {\n        return this._period;\n    }\n    get meanAngularSpeed() {\n        return 360.0 / this._period.value;\n    }\n}\nAxialTilt.defaultAngleUnit = Angle.Units.d;\nAxialTilt.defaultPeriodUnit = Timespan.Units.s;\n//# sourceMappingURL=space.axialTilt.js.map","export var CelestialNodeType;\n(function (CelestialNodeType) {\n    CelestialNodeType[CelestialNodeType[\"HUBBLE_RADIUS\"] = 0] = \"HUBBLE_RADIUS\";\n    CelestialNodeType[CelestialNodeType[\"SUPER_CLUSTER\"] = 1] = \"SUPER_CLUSTER\";\n    CelestialNodeType[CelestialNodeType[\"CLUSTER\"] = 2] = \"CLUSTER\";\n    CelestialNodeType[CelestialNodeType[\"GROUP\"] = 3] = \"GROUP\";\n    CelestialNodeType[CelestialNodeType[\"GALAXY\"] = 4] = \"GALAXY\";\n    CelestialNodeType[CelestialNodeType[\"SYSTEM\"] = 5] = \"SYSTEM\";\n    CelestialNodeType[CelestialNodeType[\"STAR\"] = 6] = \"STAR\";\n    CelestialNodeType[CelestialNodeType[\"PLANET\"] = 7] = \"PLANET\";\n    CelestialNodeType[CelestialNodeType[\"MOON\"] = 8] = \"MOON\";\n    CelestialNodeType[CelestialNodeType[\"ASTEROIDE\"] = 9] = \"ASTEROIDE\";\n    CelestialNodeType[CelestialNodeType[\"COMET\"] = 10] = \"COMET\";\n    CelestialNodeType[CelestialNodeType[\"ARTIFICIAL\"] = 11] = \"ARTIFICIAL\";\n    CelestialNodeType[CelestialNodeType[\"VOID\"] = 12] = \"VOID\";\n    CelestialNodeType[CelestialNodeType[\"BLACK_HOLE\"] = 13] = \"BLACK_HOLE\";\n    CelestialNodeType[CelestialNodeType[\"RING\"] = 14] = \"RING\";\n})(CelestialNodeType || (CelestialNodeType = {}));\n//# sourceMappingURL=space.interfaces.js.map","import { Temperature, Length, Mass, Luminosity, QuantityRange as QR } from \"../math/math.units\";\nexport class MorganKeenanClass {\n    static Parse(str) {\n        const a = this.pattern.exec(str);\n        if (a) {\n            const major = a[0];\n            const minor = parseFloat(a[1]);\n            const lum = (a.length > 2 ? a[2] : undefined);\n            return new MorganKeenanClass(major, minor, lum);\n        }\n        return undefined;\n    }\n    constructor(major, minor, luminosity) {\n        this._major = major;\n        this._minor = minor;\n        this._lum = luminosity;\n    }\n    get major() {\n        return this._major;\n    }\n    get minor() {\n        return this._minor;\n    }\n    get luminosity() {\n        return this._lum;\n    }\n    get fullName() {\n        return this._major + this._minor + this._lum ? \"(\" + this._lum + \")\" : \"\";\n    }\n}\nMorganKeenanClass.pattern = /^(O|B|A|F|G|K|M)([0-9](.[0-9])?)((Ia\\+|I|II|III|IV|V|sd|D))?$/;\nMorganKeenanClass.LuminosityNames = [\"Ia+\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"sd\", \"D\"];\nexport class SpectralClass {\n    static ClassFromTemperature(temperature) {\n        const temp = new Temperature(temperature, Temperature.Units.k);\n        const c = SpectralClass.HarwardClassification;\n        for (let i = 0; i !== c.length; i++) {\n            const sc = c[i];\n            const min = sc.effectiveTemperature.min;\n            const max = sc.effectiveTemperature.max;\n            if ((!min || min.value <= temp.value) && (!max || max.value > temp.value)) {\n                return sc;\n            }\n        }\n        return undefined;\n    }\n    constructor(name, effectiveTemperature, VegaRelativeColorLabel, chromacityLabel, mass, radius, luminosity, hydrogenLine, fractionOfStars) {\n        this.name = name;\n        this.effectiveTemperature = effectiveTemperature;\n        this.VegaRelativeColorLabel = VegaRelativeColorLabel;\n        this.chromacityLabel = chromacityLabel;\n        this.mass = mass;\n        this.radius = radius;\n        this.luminosity = luminosity;\n        this.hydrogenLine = hydrogenLine;\n        this.fractionOfStars = fractionOfStars;\n    }\n}\nSpectralClass.O = new SpectralClass(\"O\", new QR(new Temperature(30000, Temperature.Units.k), new Temperature(60000, Temperature.Units.k)), \"blue\", \"blue\", new QR(new Mass(16, Mass.Units.Sm)), new QR(new Length(6.6, Length.Units.Sr)), new QR(new Luminosity(30000, Luminosity.Units.Lsun)), \"weak\", 0.00003);\nSpectralClass.B = new SpectralClass(\"B\", new QR(new Temperature(10000, Temperature.Units.k), new Temperature(30000, Temperature.Units.k)), \"blue white\", \"deep blue white\", new QR(new Mass(2.1, Mass.Units.Sm), new Mass(16, Mass.Units.Sm)), new QR(new Length(1.8, Length.Units.Sr), new Length(6.6, Length.Units.Sr)), new QR(new Luminosity(25, Luminosity.Units.Lsun), new Luminosity(30000, Luminosity.Units.Lsun)), \"weak\", 0.13);\nSpectralClass.A = new SpectralClass(\"A\", new QR(new Temperature(7500, Temperature.Units.k), new Temperature(10000, Temperature.Units.k)), \"white\", \"blue white\", new QR(new Mass(1.4, Mass.Units.Sm), new Mass(2.1, Mass.Units.Sm)), new QR(new Length(1.4, Length.Units.Sr), new Length(1.8, Length.Units.Sr)), new QR(new Luminosity(5, Luminosity.Units.Lsun), new Luminosity(25, Luminosity.Units.Lsun)), \"strong\", 0.6);\nSpectralClass.F = new SpectralClass(\"F\", new QR(new Temperature(6000, Temperature.Units.k), new Temperature(7500, Temperature.Units.k)), \"yellow white\", \"white\", new QR(new Mass(1.04, Mass.Units.Sm), new Mass(1.4, Mass.Units.Sm)), new QR(new Length(1.15, Length.Units.Sr), new Length(1.4, Length.Units.Sr)), new QR(new Luminosity(1.5, Luminosity.Units.Lsun), new Luminosity(5, Luminosity.Units.Lsun)), \"medium\", 3);\nSpectralClass.G = new SpectralClass(\"G\", new QR(new Temperature(5200, Temperature.Units.k), new Temperature(6000, Temperature.Units.k)), \"yellow\", \"yello white\", new QR(new Mass(0.8, Mass.Units.Sm), new Mass(1.04, Mass.Units.Sm)), new QR(new Length(0.96, Length.Units.Sr), new Length(1.15, Length.Units.Sr)), new QR(new Luminosity(0.6, Luminosity.Units.Lsun), new Luminosity(1.5, Luminosity.Units.Lsun)), \"weak\", 7.6);\nSpectralClass.K = new SpectralClass(\"K\", new QR(new Temperature(3700, Temperature.Units.k), new Temperature(5200, Temperature.Units.k)), \"orange\tpale\", \"yello orange\", new QR(new Mass(0.45, Mass.Units.Sm), new Mass(0.8, Mass.Units.Sm)), new QR(new Length(0.7, Length.Units.Sr), new Length(0.96, Length.Units.Sr)), new QR(new Luminosity(0.08, Luminosity.Units.Lsun), new Luminosity(0.6, Luminosity.Units.Lsun)), \"very weak\", 12.1);\nSpectralClass.M = new SpectralClass(\"M\", new QR(new Temperature(2400, Temperature.Units.k), new Temperature(3700, Temperature.Units.k)), \"red light\", \"orange red\", new QR(new Mass(0.08, Mass.Units.Sm), new Mass(0.45, Mass.Units.Sm)), new QR(new Length(0, Length.Units.Sr), new Length(0.7, Length.Units.Sr)), new QR(new Luminosity(0, Luminosity.Units.Lsun), new Luminosity(0.8, Luminosity.Units.Lsun)), \"very weak\", 76.45);\nSpectralClass.HarwardClassificationIndex = {\n    O: SpectralClass.O,\n    B: SpectralClass.B,\n    A: SpectralClass.A,\n    F: SpectralClass.F,\n    G: SpectralClass.G,\n    K: SpectralClass.K,\n    M: SpectralClass.M,\n};\nSpectralClass.HarwardClassification = [SpectralClass.O, SpectralClass.B, SpectralClass.A, SpectralClass.F, SpectralClass.G, SpectralClass.K, SpectralClass.M];\nSpectralClass.TemperatureRange = new QR(new Temperature(2400, Temperature.Units.k), new Temperature(60000, Temperature.Units.k));\n//# sourceMappingURL=space.spectralClass.js.map","import { SpectralClass, MorganKeenanClass } from \"./space.spectralClass\";\nimport { Temperature } from \"../math/math.units\";\nimport { RGBAColor } from \"../math/math.color\";\nexport class ColorValue {\n    constructor(mk, sclass, kelvin, color) {\n        this.mk = mk;\n        this.sclass = sclass;\n        this.kelvin = kelvin;\n        this.color = color;\n    }\n}\nexport class StarColor {\n    static _buildIndex(ColorTable) {\n        const o = {};\n        for (const l of MorganKeenanClass.LuminosityNames) {\n            o[l] = Array.from(StarColor._SelectByLuminosity(l, ColorTable)).sort((a, b) => a.kelvin - b.kelvin);\n        }\n        return o;\n    }\n    static *_SelectByLuminosity(l, table) {\n        for (const p of table) {\n            const c = MorganKeenanClass.Parse(p.key);\n            if (c && c.luminosity === l) {\n                const t = 0.9 - c.minor / 10;\n                const sc = SpectralClass.HarwardClassificationIndex[c.major];\n                const { min, delta } = sc.effectiveTemperature;\n                const { r, g, b } = p.value;\n                yield { mk: c, sclass: sc, kelvin: min.value + delta.value * t, color: new RGBAColor(r, g, b) };\n            }\n        }\n    }\n    static _lookup(source, temperature) {\n        let low = 0, high = source.length;\n        while (low < high) {\n            const mid = (low + high) >>> 1;\n            if (source[mid].kelvin > temperature)\n                low = mid + 1;\n            else\n                high = mid;\n        }\n        return low;\n    }\n    static _lookupIndexes(luminosity, temperature) {\n        const l = StarColor.Matrix[luminosity];\n        if (!l || !l.length)\n            return [];\n        const i = StarColor._lookup(l, temperature);\n        const res = [];\n        if (i == l.length) {\n            res.push(l[i - 1]);\n            return res;\n        }\n        res.push(l[i]);\n        if (i > 0) {\n            res.push(l[i - 1]);\n        }\n        return res;\n    }\n    static lookupRgb(luminosity, temperature) {\n        const kelvin = new Temperature(temperature, Temperature.Units.k);\n        const i = this._lookupIndexes(luminosity, kelvin.value);\n        if (!i || !i.length)\n            return new RGBAColor(0, 0, 0);\n        if (i.length == 1) {\n            return i[0].color;\n        }\n        const k0 = i[0].kelvin;\n        const k1 = i[1].kelvin;\n        const dk = k1 - k0;\n        const c0 = i[0].color;\n        if (dk == 0)\n            return c0;\n        const c1 = i[1].color;\n        const f = (kelvin.value - k0) / dk;\n        return c0.interpolateInPlace(c1, f);\n    }\n}\nStarColor.ColorTable = [\n    { key: \"O9I\", value: { x: 0.2507, y: 0.2468, r: 164, g: 185, b: 255, color: \"#a4b9ff\" } },\n    { key: \"B0I\", value: { x: 0.2498, y: 0.2513, r: 161, g: 189, b: 255, color: \"#a1bdff\" } },\n    { key: \"B1I\", value: { x: 0.2547, y: 0.2562, r: 168, g: 193, b: 255, color: \"#a8c1ff\" } },\n    { key: \"B2I\", value: { x: 0.2606, y: 0.2611, r: 177, g: 196, b: 255, color: \"#b1c4ff\" } },\n    { key: \"B3I\", value: { x: 0.2591, y: 0.2582, r: 175, g: 194, b: 255, color: \"#afc2ff\" } },\n    { key: \"B4I\", value: { x: 0.2678, y: 0.271, r: 187, g: 203, b: 255, color: \"#bbcbff\" } },\n    { key: \"B5I\", value: { x: 0.2628, y: 0.2685, r: 179, g: 202, b: 255, color: \"#b3caff\" } },\n    { key: \"B6I\", value: { x: 0.2711, y: 0.2754, r: 191, g: 207, b: 255, color: \"#bfcfff\" } },\n    { key: \"B7I\", value: { x: 0.2734, y: 0.2785, r: 195, g: 209, b: 255, color: \"#c3d1ff\" } },\n    { key: \"B8I\", value: { x: 0.2653, y: 0.274, r: 182, g: 206, b: 255, color: \"#b6ceff\" } },\n    { key: \"B9I\", value: { x: 0.2797, y: 0.2865, r: 204, g: 216, b: 255, color: \"#ccd8ff\" } },\n    { key: \"A0I\", value: { x: 0.2683, y: 0.2737, r: 187, g: 206, b: 255, color: \"#bbceff\" } },\n    { key: \"A1I\", value: { x: 0.2871, y: 0.2955, r: 214, g: 223, b: 255, color: \"#d6dfff\" } },\n    { key: \"A2I\", value: { x: 0.2768, y: 0.2842, r: 199, g: 214, b: 255, color: \"#c7d6ff\" } },\n    { key: \"A5I\", value: { x: 0.2925, y: 0.3019, r: 223, g: 229, b: 255, color: \"#dfe5ff\" } },\n    { key: \"F0I\", value: { x: 0.2789, y: 0.2855, r: 202, g: 215, b: 255, color: \"#cad7ff\" } },\n    { key: \"F2I\", value: { x: 0.3061, y: 0.3172, r: 244, g: 243, b: 255, color: \"#f4f3ff\" } },\n    { key: \"F5I\", value: { x: 0.2899, y: 0.2978, r: 219, g: 225, b: 255, color: \"#dbe1ff\" } },\n    { key: \"F8I\", value: { x: 0.3177, y: 0.3337, r: 255, g: 252, b: 247, color: \"#fffcf7\" } },\n    { key: \"G0I\", value: { x: 0.3361, y: 0.349, r: 255, g: 239, b: 219, color: \"#ffefdb\" } },\n    { key: \"G2I\", value: { x: 0.3461, y: 0.3605, r: 255, g: 236, b: 205, color: \"#ffeccd\" } },\n    { key: \"G3I\", value: { x: 0.3479, y: 0.3566, r: 255, g: 231, b: 203, color: \"#ffe7cb\" } },\n    { key: \"G5I\", value: { x: 0.3617, y: 0.3769, r: 255, g: 230, b: 183, color: \"#ffe6b7\" } },\n    { key: \"G8I\", value: { x: 0.3764, y: 0.3833, r: 255, g: 220, b: 167, color: \"#ffdca7\" } },\n    { key: \"K0I\", value: { x: 0.3659, y: 0.3706, r: 255, g: 221, b: 181, color: \"#ffddb5\" } },\n    { key: \"K1I\", value: { x: 0.3693, y: 0.373, r: 255, g: 220, b: 177, color: \"#ffdcb1\" } },\n    { key: \"K2I\", value: { x: 0.4022, y: 0.4058, r: 255, g: 211, b: 135, color: \"#ffd387\" } },\n    { key: \"K3I\", value: { x: 0.411, y: 0.4074, r: 255, g: 204, b: 128, color: \"#ffcc80\" } },\n    { key: \"K4I\", value: { x: 0.4195, y: 0.4128, r: 255, g: 201, b: 118, color: \"#ffc976\" } },\n    { key: \"K5I\", value: { x: 0.3896, y: 0.3863, r: 255, g: 209, b: 154, color: \"#ffd19a\" } },\n    { key: \"M0I\", value: { x: 0.3994, y: 0.392, r: 255, g: 204, b: 143, color: \"#ffcc8f\" } },\n    { key: \"M1I\", value: { x: 0.4048, y: 0.3948, r: 255, g: 202, b: 138, color: \"#ffca8a\" } },\n    { key: \"M2I\", value: { x: 0.4338, y: 0.4178, r: 255, g: 193, b: 104, color: \"#ffc168\" } },\n    { key: \"M3I\", value: { x: 0.4254, y: 0.4044, r: 255, g: 192, b: 118, color: \"#ffc076\" } },\n    { key: \"M4I\", value: { x: 0.4402, y: 0.41, r: 255, g: 185, b: 104, color: \"#ffb968\" } },\n    { key: \"B2II\", value: { x: 0.253, y: 0.2557, r: 165, g: 192, b: 255, color: \"#a5c0ff\" } },\n    { key: \"B5II\", value: { x: 0.2593, y: 0.2597, r: 175, g: 195, b: 255, color: \"#afc3ff\" } },\n    { key: \"F0II\", value: { x: 0.2795, y: 0.288, r: 203, g: 217, b: 255, color: \"#cbd9ff\" } },\n    { key: \"F2II\", value: { x: 0.2966, y: 0.3069, r: 229, g: 233, b: 255, color: \"#e5e9ff\" } },\n    { key: \"G5II\", value: { x: 0.3471, y: 0.3611, r: 255, g: 235, b: 203, color: \"#ffebcb\" } },\n    { key: \"M3II\", value: { x: 0.4185, y: 0.412, r: 255, g: 201, b: 119, color: \"#ffc977\" } },\n    { key: \"O7III\", value: { x: 0.246, y: 0.2363, r: 158, g: 177, b: 255, color: \"#9eb1ff\" } },\n    { key: \"O8III\", value: { x: 0.2455, y: 0.2373, r: 157, g: 178, b: 255, color: \"#9db2ff\" } },\n    { key: \"O9III\", value: { x: 0.246, y: 0.2363, r: 158, g: 177, b: 255, color: \"#9eb1ff\" } },\n    { key: \"B0III\", value: { x: 0.246, y: 0.2363, r: 158, g: 177, b: 255, color: \"#9eb1ff\" } },\n    { key: \"B1III\", value: { x: 0.246, y: 0.2363, r: 158, g: 177, b: 255, color: \"#9eb1ff\" } },\n    { key: \"B2III\", value: { x: 0.247, y: 0.2396, r: 159, g: 180, b: 255, color: \"#9fb4ff\" } },\n    { key: \"B3III\", value: { x: 0.2509, y: 0.2486, r: 163, g: 187, b: 255, color: \"#a3bbff\" } },\n    { key: \"B5III\", value: { x: 0.2541, y: 0.2514, r: 168, g: 189, b: 255, color: \"#a8bdff\" } },\n    { key: \"B7III\", value: { x: 0.2562, y: 0.2542, r: 171, g: 191, b: 255, color: \"#abbfff\" } },\n    { key: \"B9III\", value: { x: 0.2615, y: 0.2608, r: 178, g: 195, b: 255, color: \"#b2c3ff\" } },\n    { key: \"A0III\", value: { x: 0.2687, y: 0.2729, r: 188, g: 205, b: 255, color: \"#bccdff\" } },\n    { key: \"A3III\", value: { x: 0.2691, y: 0.2707, r: 189, g: 203, b: 255, color: \"#bdcbff\" } },\n    { key: \"A5III\", value: { x: 0.2787, y: 0.2858, r: 202, g: 215, b: 255, color: \"#cad7ff\" } },\n    { key: \"A6III\", value: { x: 0.2837, y: 0.2903, r: 209, g: 219, b: 255, color: \"#d1dbff\" } },\n    { key: \"A7III\", value: { x: 0.2843, y: 0.2911, r: 210, g: 219, b: 255, color: \"#d2dbff\" } },\n    { key: \"A8III\", value: { x: 0.2837, y: 0.2903, r: 209, g: 219, b: 255, color: \"#d1dbff\" } },\n    { key: \"A9III\", value: { x: 0.2837, y: 0.2903, r: 209, g: 219, b: 255, color: \"#d1dbff\" } },\n    { key: \"F0III\", value: { x: 0.2865, y: 0.2945, r: 213, g: 222, b: 255, color: \"#d5deff\" } },\n    { key: \"F2III\", value: { x: 0.3041, y: 0.3151, r: 241, g: 241, b: 255, color: \"#f1f1ff\" } },\n    { key: \"F4III\", value: { x: 0.3043, y: 0.3137, r: 241, g: 240, b: 255, color: \"#f1f0ff\" } },\n    { key: \"F5III\", value: { x: 0.3048, y: 0.3145, r: 242, g: 240, b: 255, color: \"#f2f0ff\" } },\n    { key: \"F6III\", value: { x: 0.3043, y: 0.3137, r: 241, g: 240, b: 255, color: \"#f1f0ff\" } },\n    { key: \"F7III\", value: { x: 0.3043, y: 0.3137, r: 241, g: 240, b: 255, color: \"#f1f0ff\" } },\n    { key: \"G0III\", value: { x: 0.3268, y: 0.3384, r: 255, g: 242, b: 233, color: \"#fff2e9\" } },\n    { key: \"G1III\", value: { x: 0.3265, y: 0.338, r: 255, g: 243, b: 233, color: \"#fff3e9\" } },\n    { key: \"G2III\", value: { x: 0.3265, y: 0.338, r: 255, g: 243, b: 233, color: \"#fff3e9\" } },\n    { key: \"G3III\", value: { x: 0.3265, y: 0.338, r: 255, g: 243, b: 233, color: \"#fff3e9\" } },\n    { key: \"G4III\", value: { x: 0.3265, y: 0.338, r: 255, g: 243, b: 233, color: \"#fff3e9\" } },\n    { key: \"G5III\", value: { x: 0.3421, y: 0.3541, r: 255, g: 236, b: 211, color: \"#ffecd3\" } },\n    { key: \"G6III\", value: { x: 0.3392, y: 0.3496, r: 255, g: 236, b: 215, color: \"#ffecd7\" } },\n    { key: \"G8III\", value: { x: 0.3505, y: 0.3613, r: 255, g: 231, b: 199, color: \"#ffe7c7\" } },\n    { key: \"G9III\", value: { x: 0.3529, y: 0.3643, r: 255, g: 231, b: 196, color: \"#ffe7c4\" } },\n    { key: \"K0III\", value: { x: 0.358, y: 0.3663, r: 255, g: 227, b: 190, color: \"#ffe3be\" } },\n    { key: \"K1III\", value: { x: 0.3653, y: 0.3721, r: 255, g: 223, b: 181, color: \"#ffdfb5\" } },\n    { key: \"K2III\", value: { x: 0.3698, y: 0.376, r: 255, g: 221, b: 175, color: \"#ffddaf\" } },\n    { key: \"K3III\", value: { x: 0.3776, y: 0.38, r: 255, g: 216, b: 167, color: \"#ffd8a7\" } },\n    { key: \"K4III\", value: { x: 0.3947, y: 0.3956, r: 255, g: 211, b: 146, color: \"#ffd392\" } },\n    { key: \"K5III\", value: { x: 0.4034, y: 0.3966, r: 255, g: 204, b: 138, color: \"#ffcc8a\" } },\n    { key: \"K7III\", value: { x: 0.3989, y: 0.3975, r: 255, g: 208, b: 142, color: \"#ffd08e\" } },\n    { key: \"M0III\", value: { x: 0.4088, y: 0.4013, r: 255, g: 203, b: 132, color: \"#ffcb84\" } },\n    { key: \"M1III\", value: { x: 0.4181, y: 0.4085, r: 255, g: 200, b: 121, color: \"#ffc879\" } },\n    { key: \"M2III\", value: { x: 0.4215, y: 0.4098, r: 255, g: 198, b: 118, color: \"#ffc676\" } },\n    { key: \"M3III\", value: { x: 0.4192, y: 0.4108, r: 255, g: 200, b: 119, color: \"#ffc877\" } },\n    { key: \"M4III\", value: { x: 0.4102, y: 0.4091, r: 255, g: 206, b: 127, color: \"#ffce7f\" } },\n    { key: \"M5III\", value: { x: 0.4171, y: 0.4035, r: 255, g: 197, b: 124, color: \"#ffc57c\" } },\n    { key: \"M6III\", value: { x: 0.4312, y: 0.3876, r: 255, g: 178, b: 121, color: \"#ffb279\" } },\n    { key: \"M7III\", value: { x: 0.4591, y: 0.3966, r: 255, g: 165, b: 97, color: \"#ffa561\" } },\n    { key: \"M8III\", value: { x: 0.4582, y: 0.398, r: 255, g: 167, b: 97, color: \"#ffa761\" } },\n    { key: \"M9III\", value: { x: 0.3802, y: 0.4084, r: 255, g: 233, b: 154, color: \"#ffe99a\" } },\n    { key: \"B1IV\", value: { x: 0.2459, y: 0.2397, r: 157, g: 180, b: 255, color: \"#9db4ff\" } },\n    { key: \"B2IV\", value: { x: 0.2467, y: 0.2388, r: 159, g: 179, b: 255, color: \"#9fb3ff\" } },\n    { key: \"B3IV\", value: { x: 0.2523, y: 0.2498, r: 166, g: 188, b: 255, color: \"#a6bcff\" } },\n    { key: \"B6IV\", value: { x: 0.2591, y: 0.2582, r: 175, g: 194, b: 255, color: \"#afc2ff\" } },\n    { key: \"B7IV\", value: { x: 0.2552, y: 0.2522, r: 170, g: 189, b: 255, color: \"#aabdff\" } },\n    { key: \"B9IV\", value: { x: 0.2628, y: 0.2629, r: 180, g: 197, b: 255, color: \"#b4c5ff\" } },\n    { key: \"A0IV\", value: { x: 0.2622, y: 0.2623, r: 179, g: 197, b: 255, color: \"#b3c5ff\" } },\n    { key: \"A3IV\", value: { x: 0.2698, y: 0.2734, r: 190, g: 205, b: 255, color: \"#becdff\" } },\n    { key: \"A4IV\", value: { x: 0.2738, y: 0.2793, r: 195, g: 210, b: 255, color: \"#c3d2ff\" } },\n    { key: \"A5IV\", value: { x: 0.2857, y: 0.2923, r: 212, g: 220, b: 255, color: \"#d4dcff\" } },\n    { key: \"A7IV\", value: { x: 0.2715, y: 0.2759, r: 192, g: 207, b: 255, color: \"#c0cfff\" } },\n    { key: \"A9IV\", value: { x: 0.2932, y: 0.2997, r: 224, g: 227, b: 255, color: \"#e0e3ff\" } },\n    { key: \"F0IV\", value: { x: 0.2893, y: 0.2966, r: 218, g: 224, b: 255, color: \"#dae0ff\" } },\n    { key: \"F2IV\", value: { x: 0.2951, y: 0.3029, r: 227, g: 230, b: 255, color: \"#e3e6ff\" } },\n    { key: \"F3IV\", value: { x: 0.2952, y: 0.3036, r: 227, g: 230, b: 255, color: \"#e3e6ff\" } },\n    { key: \"F5IV\", value: { x: 0.3044, y: 0.3133, r: 241, g: 239, b: 255, color: \"#f1efff\" } },\n    { key: \"F7IV\", value: { x: 0.304, y: 0.313, r: 240, g: 239, b: 255, color: \"#f0efff\" } },\n    { key: \"F8IV\", value: { x: 0.3138, y: 0.328, r: 255, g: 252, b: 253, color: \"#fffcfd\" } },\n    { key: \"G0IV\", value: { x: 0.319, y: 0.3317, r: 255, g: 248, b: 245, color: \"#fff8f5\" } },\n    { key: \"G2IV\", value: { x: 0.3212, y: 0.3311, r: 255, g: 244, b: 242, color: \"#fff4f2\" } },\n    { key: \"G3IV\", value: { x: 0.3319, y: 0.3417, r: 255, g: 238, b: 226, color: \"#ffeee2\" } },\n    { key: \"G4IV\", value: { x: 0.3232, y: 0.3359, r: 255, g: 245, b: 238, color: \"#fff5ee\" } },\n    { key: \"G5IV\", value: { x: 0.3404, y: 0.3503, r: 255, g: 235, b: 213, color: \"#ffebd5\" } },\n    { key: \"G6IV\", value: { x: 0.326, y: 0.3359, r: 255, g: 242, b: 234, color: \"#fff2ea\" } },\n    { key: \"G7IV\", value: { x: 0.3466, y: 0.3551, r: 255, g: 231, b: 205, color: \"#ffe7cd\" } },\n    { key: \"G8IV\", value: { x: 0.3422, y: 0.351, r: 255, g: 233, b: 211, color: \"#ffe9d3\" } },\n    { key: \"K0IV\", value: { x: 0.3592, y: 0.3659, r: 255, g: 225, b: 189, color: \"#ffe1bd\" } },\n    { key: \"K1IV\", value: { x: 0.3743, y: 0.3753, r: 255, g: 216, b: 171, color: \"#ffd8ab\" } },\n    { key: \"K2IV\", value: { x: 0.3491, y: 0.3565, r: 255, g: 229, b: 202, color: \"#ffe5ca\" } },\n    { key: \"K3IV\", value: { x: 0.3764, y: 0.3821, r: 255, g: 219, b: 167, color: \"#ffdba7\" } },\n    { key: \"O5V\", value: { x: 0.2436, y: 0.2343, r: 155, g: 176, b: 255, color: \"#9bb0ff\" } },\n    { key: \"O6V\", value: { x: 0.2492, y: 0.2445, r: 162, g: 184, b: 255, color: \"#a2b8ff\" } },\n    { key: \"O7V\", value: { x: 0.2451, y: 0.2351, r: 157, g: 177, b: 255, color: \"#9db1ff\" } },\n    { key: \"O8V\", value: { x: 0.2451, y: 0.2351, r: 157, g: 177, b: 255, color: \"#9db1ff\" } },\n    { key: \"O9V\", value: { x: 0.2437, y: 0.2366, r: 154, g: 178, b: 255, color: \"#9ab2ff\" } },\n    { key: \"O9.5V\", value: { x: 0.251, y: 0.2472, r: 164, g: 186, b: 255, color: \"#a4baff\" } },\n    { key: \"B0V\", value: { x: 0.2448, y: 0.2362, r: 156, g: 178, b: 255, color: \"#9cb2ff\" } },\n    { key: \"B0.5V\", value: { x: 0.253, y: 0.2501, r: 167, g: 188, b: 255, color: \"#a7bcff\" } },\n    { key: \"B1V\", value: { x: 0.2481, y: 0.2424, r: 160, g: 182, b: 255, color: \"#a0b6ff\" } },\n    { key: \"B2V\", value: { x: 0.2474, y: 0.2395, r: 160, g: 180, b: 255, color: \"#a0b4ff\" } },\n    { key: \"B3V\", value: { x: 0.2517, y: 0.2472, r: 165, g: 185, b: 255, color: \"#a5b9ff\" } },\n    { key: \"B4V\", value: { x: 0.2506, y: 0.2453, r: 164, g: 184, b: 255, color: \"#a4b8ff\" } },\n    { key: \"B5V\", value: { x: 0.2559, y: 0.2546, r: 170, g: 191, b: 255, color: \"#aabfff\" } },\n    { key: \"B6V\", value: { x: 0.2563, y: 0.2522, r: 172, g: 189, b: 255, color: \"#acbdff\" } },\n    { key: \"B7V\", value: { x: 0.2578, y: 0.2555, r: 173, g: 191, b: 255, color: \"#adbfff\" } },\n    { key: \"B8V\", value: { x: 0.2604, y: 0.2603, r: 177, g: 195, b: 255, color: \"#b1c3ff\" } },\n    { key: \"B9V\", value: { x: 0.2639, y: 0.2642, r: 181, g: 198, b: 255, color: \"#b5c6ff\" } },\n    { key: \"A0V\", value: { x: 0.2668, y: 0.2686, r: 185, g: 201, b: 255, color: \"#b9c9ff\" } },\n    { key: \"A1V\", value: { x: 0.2635, y: 0.265, r: 181, g: 199, b: 255, color: \"#b5c7ff\" } },\n    { key: \"A2V\", value: { x: 0.2677, y: 0.2701, r: 187, g: 203, b: 255, color: \"#bbcbff\" } },\n    { key: \"A3V\", value: { x: 0.2706, y: 0.2752, r: 191, g: 207, b: 255, color: \"#bfcfff\" } },\n    { key: \"A5V\", value: { x: 0.2786, y: 0.2858, r: 202, g: 215, b: 255, color: \"#cad7ff\" } },\n    { key: \"A6V\", value: { x: 0.2765, y: 0.2825, r: 199, g: 212, b: 255, color: \"#c7d4ff\" } },\n    { key: \"A7V\", value: { x: 0.2771, y: 0.283, r: 200, g: 213, b: 255, color: \"#c8d5ff\" } },\n    { key: \"A8V\", value: { x: 0.2864, y: 0.2943, r: 213, g: 222, b: 255, color: \"#d5deff\" } },\n    { key: \"A9V\", value: { x: 0.2901, y: 0.2971, r: 219, g: 224, b: 255, color: \"#dbe0ff\" } },\n    { key: \"F0V\", value: { x: 0.2932, y: 0.3018, r: 224, g: 229, b: 255, color: \"#e0e5ff\" } },\n    { key: \"F2V\", value: { x: 0.3012, y: 0.3125, r: 236, g: 239, b: 255, color: \"#ecefff\" } },\n    { key: \"F4V\", value: { x: 0.2935, y: 0.2993, r: 224, g: 226, b: 255, color: \"#e0e2ff\" } },\n    { key: \"F5V\", value: { x: 0.3088, y: 0.3209, r: 248, g: 247, b: 255, color: \"#f8f7ff\" } },\n    { key: \"F6V\", value: { x: 0.306, y: 0.3154, r: 244, g: 241, b: 255, color: \"#f4f1ff\" } },\n    { key: \"F7V\", value: { x: 0.3075, y: 0.3168, r: 246, g: 243, b: 255, color: \"#f6f3ff\" } },\n    { key: \"F8V\", value: { x: 0.3147, y: 0.324, r: 255, g: 247, b: 252, color: \"#fff7fc\" } },\n    { key: \"F9V\", value: { x: 0.3149, y: 0.3247, r: 255, g: 247, b: 252, color: \"#fff7fc\" } },\n    { key: \"G0V\", value: { x: 0.3149, y: 0.3257, r: 255, g: 248, b: 252, color: \"#fff8fc\" } },\n    { key: \"G1V\", value: { x: 0.3172, y: 0.3278, r: 255, g: 247, b: 248, color: \"#fff7f8\" } },\n    { key: \"G2V\", value: { x: 0.3211, y: 0.3323, r: 255, g: 245, b: 242, color: \"#fff5f2\" } },\n    { key: \"G4V\", value: { x: 0.3293, y: 0.3403, r: 255, g: 241, b: 229, color: \"#fff1e5\" } },\n    { key: \"G5V\", value: { x: 0.326, y: 0.3382, r: 255, g: 244, b: 234, color: \"#fff4ea\" } },\n    { key: \"G6V\", value: { x: 0.3257, y: 0.338, r: 255, g: 244, b: 235, color: \"#fff4eb\" } },\n    { key: \"G7V\", value: { x: 0.3257, y: 0.338, r: 255, g: 244, b: 235, color: \"#fff4eb\" } },\n    { key: \"G8V\", value: { x: 0.3346, y: 0.3445, r: 255, g: 237, b: 222, color: \"#ffedde\" } },\n    { key: \"G9V\", value: { x: 0.3352, y: 0.3469, r: 255, g: 239, b: 221, color: \"#ffefdd\" } },\n    { key: \"K0V\", value: { x: 0.3352, y: 0.3458, r: 255, g: 238, b: 221, color: \"#ffeedd\" } },\n    { key: \"K1V\", value: { x: 0.3603, y: 0.3664, r: 255, g: 224, b: 188, color: \"#ffe0bc\" } },\n    { key: \"K2V\", value: { x: 0.3535, y: 0.3597, r: 255, g: 227, b: 196, color: \"#ffe3c4\" } },\n    { key: \"K3V\", value: { x: 0.3555, y: 0.3571, r: 255, g: 222, b: 195, color: \"#ffdec3\" } },\n    { key: \"K4V\", value: { x: 0.367, y: 0.3645, r: 255, g: 216, b: 181, color: \"#ffd8b5\" } },\n    { key: \"K5V\", value: { x: 0.3836, y: 0.3798, r: 255, g: 210, b: 161, color: \"#ffd2a1\" } },\n    { key: \"K7V\", value: { x: 0.403, y: 0.3875, r: 255, g: 199, b: 142, color: \"#ffc78e\" } },\n    { key: \"K8V\", value: { x: 0.3746, y: 0.3661, r: 255, g: 209, b: 174, color: \"#ffd1ae\" } },\n    { key: \"M0V\", value: { x: 0.4073, y: 0.3876, r: 255, g: 195, b: 139, color: \"#ffc38b\" } },\n    { key: \"M1V\", value: { x: 0.4011, y: 0.3927, r: 255, g: 204, b: 142, color: \"#ffcc8e\" } },\n    { key: \"M2V\", value: { x: 0.413, y: 0.3958, r: 255, g: 196, b: 131, color: \"#ffc483\" } },\n    { key: \"M3V\", value: { x: 0.4089, y: 0.4075, r: 255, g: 206, b: 129, color: \"#ffce81\" } },\n    { key: \"M4V\", value: { x: 0.4137, y: 0.4043, r: 255, g: 201, b: 127, color: \"#ffc97f\" } },\n    { key: \"M5V\", value: { x: 0.4227, y: 0.4218, r: 255, g: 204, b: 111, color: \"#ffcc6f\" } },\n    { key: \"M6V\", value: { x: 0.4271, y: 0.4123, r: 255, g: 195, b: 112, color: \"#ffc370\" } },\n    { key: \"M8V\", value: { x: 0.4276, y: 0.4176, r: 255, g: 198, b: 109, color: \"#ffc66d\" } },\n];\nStarColor.Matrix = StarColor._buildIndex(StarColor.ColorTable);\n//# sourceMappingURL=space.starColor.js.map","export * from \"./iso6391\";\nexport * from \"./localizable\";\n//# sourceMappingURL=index.js.map","const LANGUAGES_LIST = {\n    aa: {\n        name: \"Afar\",\n        nativeName: \"Afaraf\",\n    },\n    ab: {\n        name: \"Abkhaz\",\n        nativeName: \"аҧсуа бызшәа\",\n    },\n    ae: {\n        name: \"Avestan\",\n        nativeName: \"avesta\",\n    },\n    af: {\n        name: \"Afrikaans\",\n        nativeName: \"Afrikaans\",\n    },\n    ak: {\n        name: \"Akan\",\n        nativeName: \"Akan\",\n    },\n    am: {\n        name: \"Amharic\",\n        nativeName: \"አማርኛ\",\n    },\n    an: {\n        name: \"Aragonese\",\n        nativeName: \"aragonés\",\n    },\n    ar: {\n        name: \"Arabic\",\n        nativeName: \"اللغة العربية\",\n    },\n    as: {\n        name: \"Assamese\",\n        nativeName: \"অসমীয়া\",\n    },\n    av: {\n        name: \"Avaric\",\n        nativeName: \"авар мацӀ\",\n    },\n    ay: {\n        name: \"Aymara\",\n        nativeName: \"aymar aru\",\n    },\n    az: {\n        name: \"Azerbaijani\",\n        nativeName: \"azərbaycan dili\",\n    },\n    ba: {\n        name: \"Bashkir\",\n        nativeName: \"башҡорт теле\",\n    },\n    be: {\n        name: \"Belarusian\",\n        nativeName: \"беларуская мова\",\n    },\n    bg: {\n        name: \"Bulgarian\",\n        nativeName: \"български език\",\n    },\n    bh: {\n        name: \"Bihari\",\n        nativeName: \"भोजपुरी\",\n    },\n    bi: {\n        name: \"Bislama\",\n        nativeName: \"Bislama\",\n    },\n    bm: {\n        name: \"Bambara\",\n        nativeName: \"bamanankan\",\n    },\n    bn: {\n        name: \"Bengali\",\n        nativeName: \"বাংলা\",\n    },\n    bo: {\n        name: \"Tibetan Standard\",\n        nativeName: \"བོད་ཡིག\",\n    },\n    br: {\n        name: \"Breton\",\n        nativeName: \"brezhoneg\",\n    },\n    bs: {\n        name: \"Bosnian\",\n        nativeName: \"bosanski jezik\",\n    },\n    ca: {\n        name: \"Catalan\",\n        nativeName: \"català\",\n    },\n    ce: {\n        name: \"Chechen\",\n        nativeName: \"нохчийн мотт\",\n    },\n    ch: {\n        name: \"Chamorro\",\n        nativeName: \"Chamoru\",\n    },\n    co: {\n        name: \"Corsican\",\n        nativeName: \"corsu\",\n    },\n    cr: {\n        name: \"Cree\",\n        nativeName: \"ᓀᐦᐃᔭᐍᐏᐣ\",\n    },\n    cs: {\n        name: \"Czech\",\n        nativeName: \"čeština\",\n    },\n    cu: {\n        name: \"Old Church Slavonic\",\n        nativeName: \"ѩзыкъ словѣньскъ\",\n    },\n    cv: {\n        name: \"Chuvash\",\n        nativeName: \"чӑваш чӗлхи\",\n    },\n    cy: {\n        name: \"Welsh\",\n        nativeName: \"Cymraeg\",\n    },\n    da: {\n        name: \"Danish\",\n        nativeName: \"dansk\",\n    },\n    de: {\n        name: \"German\",\n        nativeName: \"Deutsch\",\n    },\n    dv: {\n        name: \"Divehi\",\n        nativeName: \"Dhivehi\",\n    },\n    dz: {\n        name: \"Dzongkha\",\n        nativeName: \"རྫོང་ཁ\",\n    },\n    ee: {\n        name: \"Ewe\",\n        nativeName: \"Eʋegbe\",\n    },\n    el: {\n        name: \"Greek\",\n        nativeName: \"ελληνικά\",\n    },\n    en: {\n        name: \"English\",\n        nativeName: \"English\",\n    },\n    eo: {\n        name: \"Esperanto\",\n        nativeName: \"Esperanto\",\n    },\n    es: {\n        name: \"Spanish\",\n        nativeName: \"Español\",\n    },\n    et: {\n        name: \"Estonian\",\n        nativeName: \"eesti\",\n    },\n    eu: {\n        name: \"Basque\",\n        nativeName: \"euskara\",\n    },\n    fa: {\n        name: \"Persian\",\n        nativeName: \"فارسی\",\n    },\n    ff: {\n        name: \"Fula\",\n        nativeName: \"Fulfulde\",\n    },\n    fi: {\n        name: \"Finnish\",\n        nativeName: \"suomi\",\n    },\n    fj: {\n        name: \"Fijian\",\n        nativeName: \"Vakaviti\",\n    },\n    fo: {\n        name: \"Faroese\",\n        nativeName: \"føroyskt\",\n    },\n    fr: {\n        name: \"French\",\n        nativeName: \"Français\",\n    },\n    fy: {\n        name: \"Western Frisian\",\n        nativeName: \"Frysk\",\n    },\n    ga: {\n        name: \"Irish\",\n        nativeName: \"Gaeilge\",\n    },\n    gd: {\n        name: \"Scottish Gaelic\",\n        nativeName: \"Gàidhlig\",\n    },\n    gl: {\n        name: \"Galician\",\n        nativeName: \"galego\",\n    },\n    gn: {\n        name: \"Guaraní\",\n        nativeName: \"Avañe'ẽ\",\n    },\n    gu: {\n        name: \"Gujarati\",\n        nativeName: \"ગુજરાતી\",\n    },\n    gv: {\n        name: \"Manx\",\n        nativeName: \"Gaelg\",\n    },\n    ha: {\n        name: \"Hausa\",\n        nativeName: \"هَوُسَ\",\n    },\n    he: {\n        name: \"Hebrew\",\n        nativeName: \"עברית\",\n    },\n    hi: {\n        name: \"Hindi\",\n        nativeName: \"हिन्दी\",\n    },\n    ho: {\n        name: \"Hiri Motu\",\n        nativeName: \"Hiri Motu\",\n    },\n    hr: {\n        name: \"Croatian\",\n        nativeName: \"hrvatski jezik\",\n    },\n    ht: {\n        name: \"Haitian\",\n        nativeName: \"Kreyòl ayisyen\",\n    },\n    hu: {\n        name: \"Hungarian\",\n        nativeName: \"magyar\",\n    },\n    hy: {\n        name: \"Armenian\",\n        nativeName: \"Հայերեն\",\n    },\n    hz: {\n        name: \"Herero\",\n        nativeName: \"Otjiherero\",\n    },\n    ia: {\n        name: \"Interlingua\",\n        nativeName: \"Interlingua\",\n    },\n    id: {\n        name: \"Indonesian\",\n        nativeName: \"Indonesian\",\n    },\n    ie: {\n        name: \"Interlingue\",\n        nativeName: \"Interlingue\",\n    },\n    ig: {\n        name: \"Igbo\",\n        nativeName: \"Asụsụ Igbo\",\n    },\n    ii: {\n        name: \"Nuosu\",\n        nativeName: \"ꆈꌠ꒿ Nuosuhxop\",\n    },\n    ik: {\n        name: \"Inupiaq\",\n        nativeName: \"Iñupiaq\",\n    },\n    io: {\n        name: \"Ido\",\n        nativeName: \"Ido\",\n    },\n    is: {\n        name: \"Icelandic\",\n        nativeName: \"Íslenska\",\n    },\n    it: {\n        name: \"Italian\",\n        nativeName: \"Italiano\",\n    },\n    iu: {\n        name: \"Inuktitut\",\n        nativeName: \"ᐃᓄᒃᑎᑐᑦ\",\n    },\n    ja: {\n        name: \"Japanese\",\n        nativeName: \"日本語\",\n    },\n    jv: {\n        name: \"Javanese\",\n        nativeName: \"basa Jawa\",\n    },\n    ka: {\n        name: \"Georgian\",\n        nativeName: \"ქართული\",\n    },\n    kg: {\n        name: \"Kongo\",\n        nativeName: \"Kikongo\",\n    },\n    ki: {\n        name: \"Kikuyu\",\n        nativeName: \"Gĩkũyũ\",\n    },\n    kj: {\n        name: \"Kwanyama\",\n        nativeName: \"Kuanyama\",\n    },\n    kk: {\n        name: \"Kazakh\",\n        nativeName: \"қазақ тілі\",\n    },\n    kl: {\n        name: \"Kalaallisut\",\n        nativeName: \"kalaallisut\",\n    },\n    km: {\n        name: \"Khmer\",\n        nativeName: \"ខេមរភាសា\",\n    },\n    kn: {\n        name: \"Kannada\",\n        nativeName: \"ಕನ್ನಡ\",\n    },\n    ko: {\n        name: \"Korean\",\n        nativeName: \"한국어\",\n    },\n    kr: {\n        name: \"Kanuri\",\n        nativeName: \"Kanuri\",\n    },\n    ks: {\n        name: \"Kashmiri\",\n        nativeName: \"कश्मीरी\",\n    },\n    ku: {\n        name: \"Kurdish\",\n        nativeName: \"Kurdî\",\n    },\n    kv: {\n        name: \"Komi\",\n        nativeName: \"коми кыв\",\n    },\n    kw: {\n        name: \"Cornish\",\n        nativeName: \"Kernewek\",\n    },\n    ky: {\n        name: \"Kyrgyz\",\n        nativeName: \"Кыргызча\",\n    },\n    la: {\n        name: \"Latin\",\n        nativeName: \"latine\",\n    },\n    lb: {\n        name: \"Luxembourgish\",\n        nativeName: \"Lëtzebuergesch\",\n    },\n    lg: {\n        name: \"Ganda\",\n        nativeName: \"Luganda\",\n    },\n    li: {\n        name: \"Limburgish\",\n        nativeName: \"Limburgs\",\n    },\n    ln: {\n        name: \"Lingala\",\n        nativeName: \"Lingála\",\n    },\n    lo: {\n        name: \"Lao\",\n        nativeName: \"ພາສາ\",\n    },\n    lt: {\n        name: \"Lithuanian\",\n        nativeName: \"lietuvių kalba\",\n    },\n    lu: {\n        name: \"Luba-Katanga\",\n        nativeName: \"Tshiluba\",\n    },\n    lv: {\n        name: \"Latvian\",\n        nativeName: \"latviešu valoda\",\n    },\n    mg: {\n        name: \"Malagasy\",\n        nativeName: \"fiteny malagasy\",\n    },\n    mh: {\n        name: \"Marshallese\",\n        nativeName: \"Kajin M̧ajeļ\",\n    },\n    mi: {\n        name: \"Māori\",\n        nativeName: \"te reo Māori\",\n    },\n    mk: {\n        name: \"Macedonian\",\n        nativeName: \"македонски јазик\",\n    },\n    ml: {\n        name: \"Malayalam\",\n        nativeName: \"മലയാളം\",\n    },\n    mn: {\n        name: \"Mongolian\",\n        nativeName: \"Монгол хэл\",\n    },\n    mr: {\n        name: \"Marathi\",\n        nativeName: \"मराठी\",\n    },\n    ms: {\n        name: \"Malay\",\n        nativeName: \"هاس ملايو‎\",\n    },\n    mt: {\n        name: \"Maltese\",\n        nativeName: \"Malti\",\n    },\n    my: {\n        name: \"Burmese\",\n        nativeName: \"ဗမာစာ\",\n    },\n    na: {\n        name: \"Nauru\",\n        nativeName: \"Ekakairũ Naoero\",\n    },\n    nb: {\n        name: \"Norwegian Bokmål\",\n        nativeName: \"Norsk bokmål\",\n    },\n    nd: {\n        name: \"Northern Ndebele\",\n        nativeName: \"isiNdebele\",\n    },\n    ne: {\n        name: \"Nepali\",\n        nativeName: \"नेपाली\",\n    },\n    ng: {\n        name: \"Ndonga\",\n        nativeName: \"Owambo\",\n    },\n    nl: {\n        name: \"Dutch\",\n        nativeName: \"Nederlands\",\n    },\n    nn: {\n        name: \"Norwegian Nynorsk\",\n        nativeName: \"Norsk nynorsk\",\n    },\n    no: {\n        name: \"Norwegian\",\n        nativeName: \"Norsk\",\n    },\n    nr: {\n        name: \"Southern Ndebele\",\n        nativeName: \"isiNdebele\",\n    },\n    nv: {\n        name: \"Navajo\",\n        nativeName: \"Diné bizaad\",\n    },\n    ny: {\n        name: \"Chichewa\",\n        nativeName: \"chiCheŵa\",\n    },\n    oc: {\n        name: \"Occitan\",\n        nativeName: \"occitan\",\n    },\n    oj: {\n        name: \"Ojibwe\",\n        nativeName: \"ᐊᓂᔑᓈᐯᒧᐎᓐ\",\n    },\n    om: {\n        name: \"Oromo\",\n        nativeName: \"Afaan Oromoo\",\n    },\n    or: {\n        name: \"Oriya\",\n        nativeName: \"ଓଡ଼ିଆ\",\n    },\n    os: {\n        name: \"Ossetian\",\n        nativeName: \"ирон æвзаг\",\n    },\n    pa: {\n        name: \"Panjabi\",\n        nativeName: \"ਪੰਜਾਬੀ\",\n    },\n    pi: {\n        name: \"Pāli\",\n        nativeName: \"पाऴि\",\n    },\n    pl: {\n        name: \"Polish\",\n        nativeName: \"język polski\",\n    },\n    ps: {\n        name: \"Pashto\",\n        nativeName: \"پښتو\",\n    },\n    pt: {\n        name: \"Portuguese\",\n        nativeName: \"Português\",\n    },\n    qu: {\n        name: \"Quechua\",\n        nativeName: \"Runa Simi\",\n    },\n    rm: {\n        name: \"Romansh\",\n        nativeName: \"rumantsch grischun\",\n    },\n    rn: {\n        name: \"Kirundi\",\n        nativeName: \"Ikirundi\",\n    },\n    ro: {\n        name: \"Romanian\",\n        nativeName: \"limba română\",\n    },\n    ru: {\n        name: \"Russian\",\n        nativeName: \"Русский\",\n    },\n    rw: {\n        name: \"Kinyarwanda\",\n        nativeName: \"Ikinyarwanda\",\n    },\n    sa: {\n        name: \"Sanskrit\",\n        nativeName: \"संस्कृतम्\",\n    },\n    sc: {\n        name: \"Sardinian\",\n        nativeName: \"sardu\",\n    },\n    sd: {\n        name: \"Sindhi\",\n        nativeName: \"सिन्धी\",\n    },\n    se: {\n        name: \"Northern Sami\",\n        nativeName: \"Davvisámegiella\",\n    },\n    sg: {\n        name: \"Sango\",\n        nativeName: \"yângâ tî sängö\",\n    },\n    si: {\n        name: \"Sinhala\",\n        nativeName: \"සිංහල\",\n    },\n    sk: {\n        name: \"Slovak\",\n        nativeName: \"slovenčina\",\n    },\n    sl: {\n        name: \"Slovene\",\n        nativeName: \"slovenski jezik\",\n    },\n    sm: {\n        name: \"Samoan\",\n        nativeName: \"gagana fa'a Samoa\",\n    },\n    sn: {\n        name: \"Shona\",\n        nativeName: \"chiShona\",\n    },\n    so: {\n        name: \"Somali\",\n        nativeName: \"Soomaaliga\",\n    },\n    sq: {\n        name: \"Albanian\",\n        nativeName: \"Shqip\",\n    },\n    sr: {\n        name: \"Serbian\",\n        nativeName: \"српски језик\",\n    },\n    ss: {\n        name: \"Swati\",\n        nativeName: \"SiSwati\",\n    },\n    st: {\n        name: \"Southern Sotho\",\n        nativeName: \"Sesotho\",\n    },\n    su: {\n        name: \"Sundanese\",\n        nativeName: \"Basa Sunda\",\n    },\n    sv: {\n        name: \"Swedish\",\n        nativeName: \"svenska\",\n    },\n    sw: {\n        name: \"Swahili\",\n        nativeName: \"Kiswahili\",\n    },\n    ta: {\n        name: \"Tamil\",\n        nativeName: \"தமிழ்\",\n    },\n    te: {\n        name: \"Telugu\",\n        nativeName: \"తెలుగు\",\n    },\n    tg: {\n        name: \"Tajik\",\n        nativeName: \"тоҷикӣ\",\n    },\n    th: {\n        name: \"Thai\",\n        nativeName: \"ไทย\",\n    },\n    ti: {\n        name: \"Tigrinya\",\n        nativeName: \"ትግርኛ\",\n    },\n    tk: {\n        name: \"Turkmen\",\n        nativeName: \"Türkmen\",\n    },\n    tl: {\n        name: \"Tagalog\",\n        nativeName: \"Wikang Tagalog\",\n    },\n    tn: {\n        name: \"Tswana\",\n        nativeName: \"Setswana\",\n    },\n    to: {\n        name: \"Tonga\",\n        nativeName: \"faka Tonga\",\n    },\n    tr: {\n        name: \"Turkish\",\n        nativeName: \"Türkçe\",\n    },\n    ts: {\n        name: \"Tsonga\",\n        nativeName: \"Xitsonga\",\n    },\n    tt: {\n        name: \"Tatar\",\n        nativeName: \"татар теле\",\n    },\n    tw: {\n        name: \"Twi\",\n        nativeName: \"Twi\",\n    },\n    ty: {\n        name: \"Tahitian\",\n        nativeName: \"Reo Tahiti\",\n    },\n    ug: {\n        name: \"Uyghur\",\n        nativeName: \"ئۇيغۇرچە‎\",\n    },\n    uk: {\n        name: \"Ukrainian\",\n        nativeName: \"Українська\",\n    },\n    ur: {\n        name: \"Urdu\",\n        nativeName: \"اردو\",\n    },\n    uz: {\n        name: \"Uzbek\",\n        nativeName: \"Ўзбек\",\n    },\n    ve: {\n        name: \"Venda\",\n        nativeName: \"Tshivenḓa\",\n    },\n    vi: {\n        name: \"Vietnamese\",\n        nativeName: \"Tiếng Việt\",\n    },\n    vo: {\n        name: \"Volapük\",\n        nativeName: \"Volapük\",\n    },\n    wa: {\n        name: \"Walloon\",\n        nativeName: \"walon\",\n    },\n    wo: {\n        name: \"Wolof\",\n        nativeName: \"Wollof\",\n    },\n    xh: {\n        name: \"Xhosa\",\n        nativeName: \"isiXhosa\",\n    },\n    yi: {\n        name: \"Yiddish\",\n        nativeName: \"ייִדיש\",\n    },\n    yo: {\n        name: \"Yoruba\",\n        nativeName: \"Yorùbá\",\n    },\n    za: {\n        name: \"Zhuang\",\n        nativeName: \"Saɯ cueŋƅ\",\n    },\n    zh: {\n        name: \"Chinese\",\n        nativeName: \"中文\",\n    },\n    zu: {\n        name: \"Zulu\",\n        nativeName: \"isiZulu\",\n    },\n};\nexport class ISO6391 {\n    static getName(code) {\n        return ISO6391._map.get(code)?.name;\n    }\n    static getNativeName(code) {\n        return ISO6391._map.get(code)?.nativeName;\n    }\n    static getCode(name) {\n        var lcn = name.toLowerCase();\n        for (var e of ISO6391._map.entries()) {\n            if (e[1].name.toLowerCase() === lcn || e[1].nativeName.toLowerCase() === lcn) {\n                return e[0];\n            }\n        }\n        return undefined;\n    }\n    static validate(code) {\n        return ISO6391._map.has(code);\n    }\n}\nISO6391._map = new Map(Object.entries(LANGUAGES_LIST));\n//# sourceMappingURL=iso6391.js.map","import { ISO6391 } from \"./iso6391\";\nexport function IsLocalizable(item) {\n    return item instanceof LocalString;\n}\nexport function DeserializeLocalizableString(input) {\n    if (!input) {\n        return undefined;\n    }\n    if (input[\"contents\"]) {\n        return input;\n    }\n    var ls = new LocalString();\n    ls.deserialize(input);\n    return ls;\n}\nexport function GetLocalizableStringValue(str, code) {\n    return str instanceof String ? str : str.getValue(code);\n}\nexport class LocalString {\n    constructor() {\n        this.contents = new Map();\n    }\n    tryAdd(code, value) {\n        if (ISO6391.validate(code)) {\n            this.contents.set(code, value);\n            return true;\n        }\n        return false;\n    }\n    deserialize(input) {\n        this.contents.clear();\n        for (var p in input.getOwnPropertyNames()) {\n            if (ISO6391.validate(p)) {\n                this.contents.set(p, input[p]);\n            }\n        }\n    }\n    getValue(code) {\n        if (code) {\n            var v = this.contents.get(code);\n            if (v || code == LocalString.DefaultCode) {\n                return v;\n            }\n        }\n        return this.contents.get(LocalString.DefaultCode);\n    }\n}\nLocalString.DefaultCode = \"en\";\n//# sourceMappingURL=localizable.js.map","export * from \"./streaming\";\nexport * from \"./tile3d.node\";\nexport * from \"./tile3d.interfaces\";\n//# sourceMappingURL=index.js.map","export * from \"./tile3d.streaming.interfaces\";\nexport * from \"./tile3d.streaming.engine\";\n//# sourceMappingURL=index.js.map","import { SourceBlock } from \"../../pipeline/tiles.pipeline.sourceblock\";\nimport { WebClient } from \"../../../io/webClient\";\nimport { TextUtils } from \"../../../utils/text\";\nexport class TilesetCodec {\n    async decodeAsync(r) {\n        return r instanceof Response ? (await r.json()) : null;\n    }\n}\nexport class Tile3dStreamingEngineOptions {\n}\nTile3dStreamingEngineOptions.Default = {\n    tilesetExtension: \"json\",\n};\nexport class TileNode {\n    constructor(tile, tilesetUri, parent = null) {\n        this.tile = tile;\n        this.parent = parent;\n        this.children = [];\n        this.tilesetUri = tilesetUri;\n    }\n    addChild(child) {\n        this.children.push(child);\n    }\n}\nexport class TilesetCache {\n    constructor() {\n        this.cache = new Map();\n    }\n    get(tilesetUri) {\n        return this.cache.get(tilesetUri) || null;\n    }\n    set(tilesetUri, tileset) {\n        this.cache.set(tilesetUri, tileset);\n    }\n    has(tilesetUri) {\n        return this.cache.has(tilesetUri);\n    }\n}\nexport class Tile3dStreamingEngine extends SourceBlock {\n    constructor(uri, options) {\n        super();\n        this._actives = [];\n        this._uri = uri;\n        this._root = null;\n        this._cache = options?.cache ?? new TilesetCache();\n        this._client = options?.webClient ?? new WebClient(uri, new TilesetCodec());\n        this._options = { ...Tile3dStreamingEngineOptions.Default, ...options };\n    }\n    setContext(state, display) {\n        if (!state || !display) {\n            this._doClearContext();\n            return;\n        }\n        this._doValidateContext(state, display);\n    }\n    _doClearContext() { }\n    _doValidateContext(state, display) {\n        if (this._root === null) {\n            this._doFetchTilesetAsync(this._uri).then((tileset) => {\n                if (tileset) {\n                    this._root = new TileNode(tileset.root, this._uri, null);\n                    this._doValidateContext(state, display);\n                }\n            });\n            return;\n        }\n        this._browseTilesetHierarchy(this._root.tile, state, display, this._uri);\n    }\n    async _browseTilesetHierarchy(tile, state, display, baseUrl) {\n        if (!tile)\n            return;\n        if (!this._isTileVisible(tile, state, display)) {\n            return;\n        }\n        const uri = tile.content?.uri;\n        const ext = uri ? TextUtils.GetUriExtension(uri)?.toLowerCase() : null;\n        if (uri && ext && ext === (this._options.tilesetExtension?.toLowerCase() ?? \"json\")) {\n            const contentUrl = new URL(uri, baseUrl).toString();\n            const tileset = await this._doFetchTilesetAsync(contentUrl);\n            if (tileset && tileset.root) {\n                await this._browseTilesetHierarchy(tileset.root, state, display, contentUrl);\n            }\n        }\n        if (tile.children) {\n            for (const child of tile.children) {\n                await this._browseTilesetHierarchy(child, state, display, baseUrl);\n            }\n        }\n    }\n    _isTileVisible(tile, state, display) {\n        return true;\n    }\n    async _doFetchTilesetAsync(uri) {\n        const result = await this._client.fetchAsync(this._uri);\n        return result.content;\n    }\n}\n//# sourceMappingURL=tile3d.streaming.engine.js.map","import { Cartesian3 } from \"../../geometry\";\nexport var RefinementStrategy;\n(function (RefinementStrategy) {\n    RefinementStrategy[RefinementStrategy[\"ADDITIVE\"] = 0] = \"ADDITIVE\";\n    RefinementStrategy[RefinementStrategy[\"REPLACEMENT\"] = 1] = \"REPLACEMENT\";\n})(RefinementStrategy || (RefinementStrategy = {}));\nexport function ScreenSpaceError(node, position, viewportHeight, fov) {\n    const center = node.boundingBox?.center ?? Cartesian3.Zero();\n    const d = Cartesian3.Distance(center, position);\n    return (node.geometricError * viewportHeight) / (d * Math.tan(fov / 2));\n}\nexport function ScreenSpaceError0(geometricError, distance, viewportHeight, tanfov2) {\n    return (geometricError * viewportHeight) / (distance * tanfov2);\n}\n//# sourceMappingURL=tile3d.interfaces.js.map","import { SpatialTreeNode } from \"../../tree/tree.spatial.node\";\nimport { RefinementStrategy } from \"./tile3d.interfaces\";\nexport class Tile3DNode extends SpatialTreeNode {\n    constructor(bounds, depth, error = 0) {\n        super(bounds, depth);\n        this._refinementStrategy = RefinementStrategy.REPLACEMENT;\n        this._geometricError = error;\n    }\n    get refinementStrategy() {\n        return RefinementStrategy.ADDITIVE;\n    }\n    set refinementStrategy(v) {\n        if (v !== this._refinementStrategy) {\n            this._refinementStrategy = v;\n        }\n    }\n    get geometricError() {\n        return this._geometricError;\n    }\n    set geometricError(v) {\n        if (v !== this._geometricError) {\n            this._geometricError = v;\n        }\n    }\n}\n//# sourceMappingURL=tile3d.node.js.map","export * from \"./tiles.address\";\n//# sourceMappingURL=index.js.map","import { Scalar } from \"../../math/math\";\nimport { Bounds } from \"../../geometry\";\nexport var NeighborsIndex;\n(function (NeighborsIndex) {\n    NeighborsIndex[NeighborsIndex[\"NW\"] = 0] = \"NW\";\n    NeighborsIndex[NeighborsIndex[\"N\"] = 1] = \"N\";\n    NeighborsIndex[NeighborsIndex[\"NE\"] = 2] = \"NE\";\n    NeighborsIndex[NeighborsIndex[\"W\"] = 3] = \"W\";\n    NeighborsIndex[NeighborsIndex[\"C\"] = 4] = \"C\";\n    NeighborsIndex[NeighborsIndex[\"E\"] = 5] = \"E\";\n    NeighborsIndex[NeighborsIndex[\"SW\"] = 6] = \"SW\";\n    NeighborsIndex[NeighborsIndex[\"S\"] = 7] = \"S\";\n    NeighborsIndex[NeighborsIndex[\"SE\"] = 8] = \"SE\";\n})(NeighborsIndex || (NeighborsIndex = {}));\nexport class TileAddress {\n    static Split(a, metrics) {\n        if (a.levelOfDetail == metrics.maxLOD) {\n            return null;\n        }\n        const baseX = a.x * 2;\n        const baseY = a.y * 2;\n        const childLod = a.levelOfDetail + 1;\n        return [\n            new TileAddress(baseX, baseY, childLod),\n            new TileAddress(baseX + 1, baseY, childLod),\n            new TileAddress(baseX, baseY + 1, childLod),\n            new TileAddress(baseX + 1, baseY + 1, childLod),\n        ];\n    }\n    static ShiftMultiple(addresses, N, metrics) {\n        const uniqueQuadKeys = new Set();\n        addresses.forEach((address) => {\n            const shifted = TileAddress.Shift(address, N, metrics);\n            if (Array.isArray(shifted)) {\n                shifted.forEach((child) => {\n                    uniqueQuadKeys.add(child.quadkey);\n                });\n            }\n            else if (shifted) {\n                uniqueQuadKeys.add(shifted.quadkey);\n            }\n        });\n        return Array.from(uniqueQuadKeys).map((key) => TileAddress.QuadKeyToTileXY(key));\n    }\n    static Shift(a, N, metrics) {\n        if (Array.isArray(a)) {\n            return TileAddress.ShiftMultiple(a, N, metrics);\n        }\n        let currentKey = a.quadkey;\n        let currentLod = a.levelOfDetail;\n        if (N === 0) {\n            return a;\n        }\n        if (N > 0) {\n            const maxShift = metrics.maxLOD - currentLod;\n            const effectiveShift = Math.min(N, maxShift);\n            let keys = [currentKey];\n            for (let level = 0; level < effectiveShift; level++) {\n                keys = keys.flatMap((key) => TileAddress.ToChildsKey(key));\n            }\n            return keys.map((key) => TileAddress.QuadKeyToTileXY(key));\n        }\n        const maxShift = currentLod - metrics.minLOD;\n        const effectiveShift = Math.min(Math.abs(N), maxShift);\n        for (let level = 0; level < effectiveShift; level++) {\n            currentKey = TileAddress.ToParentKey(currentKey);\n            currentLod--;\n        }\n        return TileAddress.QuadKeyToTileXY(currentKey);\n    }\n    static ToBounds(a, metrics) {\n        const points = [metrics.getTileXYToPointXY(a.x, a.y), metrics.getTileXYToPointXY(a.x + 1, a.y + 1)];\n        return Bounds.FromPoints2(...points);\n    }\n    static IsEquals(a, b) {\n        return a.x === b.x && a.y === b.y && a.levelOfDetail === b.levelOfDetail;\n    }\n    static IsValidAddress(a, metrics) {\n        if (!TileAddress.IsValidLod(a.levelOfDetail, metrics)) {\n            return false;\n        }\n        const s = (0x01 << a.levelOfDetail) - 1;\n        if (a.x < 0 || a.x > s) {\n            return false;\n        }\n        if (a.y < 0 || a.y > s) {\n            return false;\n        }\n        return true;\n    }\n    static AssertValidAddress(a, metrics) {\n        if (!TileAddress.IsValidLod(a.levelOfDetail, metrics)) {\n            throw new Error(`Invalid levelOfDetail ${a.levelOfDetail}`);\n        }\n        const s = (0x01 << a.levelOfDetail) - 1;\n        if (a.x < 0 || a.x > s) {\n            throw new Error(`Invalid x ${a.x}, must be in [0,${s}] range.`);\n        }\n        if (a.y < 0 || a.y > s) {\n            throw new Error(`Invalid y ${a.y}, must be in [0,${s}] range.`);\n        }\n    }\n    static IsValidLod(lod, metrics) {\n        return lod >= metrics.minLOD && lod <= metrics.maxLOD;\n    }\n    static ClampLod(levelOfDetail, metrics) {\n        return Scalar.Clamp(levelOfDetail, metrics.minLOD, metrics.maxLOD);\n    }\n    static ToParentKey(key) {\n        return key && key.length > 1 ? key.substring(0, key.length - 1) : key;\n    }\n    static ToChildsKey(key) {\n        key = key || \"\";\n        return [key.slice() + \"0\", key.slice() + \"1\", key.slice() + \"2\", key.slice() + \"3\"];\n    }\n    static ToNeighborsKey(key) {\n        return TileAddress.ToNeighborsXY(TileAddress.QuadKeyToTileXY(key)).map((a) => (a ? TileAddress.TileXYToQuadKey(a.x, a.y, a.levelOfDetail) : null));\n    }\n    static ToNeighborsXY(a) {\n        const max = Math.pow(2, a.levelOfDetail);\n        const n = [\n            new TileAddress(a.x - 1, a.y - 1, a.levelOfDetail),\n            new TileAddress(a.x, a.y - 1, a.levelOfDetail),\n            new TileAddress(a.x + 1, a.y - 1, a.levelOfDetail),\n            new TileAddress(a.x - 1, a.y, a.levelOfDetail),\n            a,\n            new TileAddress(a.x + 1, a.y, a.levelOfDetail),\n            new TileAddress(a.x - 1, a.y + 1, a.levelOfDetail),\n            new TileAddress(a.x, a.y + 1, a.levelOfDetail),\n            new TileAddress(a.x + 1, a.y + 1, a.levelOfDetail),\n        ];\n        return n.map((ad) => (ad.x >= 0 && ad.y >= 0 && ad.x < max && ad.y < max ? ad : null));\n    }\n    static TileXYToQuadKey(x, y, levelOfDetail) {\n        let quadKey = \"\";\n        for (let i = levelOfDetail; i > 0; i--) {\n            let digit = 0;\n            const mask = 1 << (i - 1);\n            if ((x & mask) != 0) {\n                digit++;\n            }\n            if ((y & mask) != 0) {\n                digit++;\n                digit++;\n            }\n            quadKey = quadKey + digit;\n        }\n        return quadKey;\n    }\n    static QuadKeyToTileXY(quadKey) {\n        let tileX = 0;\n        let tileY = 0;\n        const levelOfDetail = quadKey.length;\n        for (let i = levelOfDetail; i > 0; i--) {\n            const mask = 1 << (i - 1);\n            switch (quadKey[levelOfDetail - i]) {\n                case \"0\":\n                    break;\n                case \"1\":\n                    tileX |= mask;\n                    break;\n                case \"2\":\n                    tileY |= mask;\n                    break;\n                case \"3\":\n                    tileX |= mask;\n                    tileY |= mask;\n                    break;\n                default:\n                    throw new Error(\"Invalid QuadKey digit sequence.\");\n            }\n        }\n        return { x: tileX, y: tileY, levelOfDetail: levelOfDetail };\n    }\n    constructor(x, y, levelOfDetail) {\n        this._x = x;\n        this._y = y;\n        this._lod = levelOfDetail;\n    }\n    get x() {\n        return this._x;\n    }\n    set x(value) {\n        if (this._x !== value) {\n            this._x = value;\n            this._k = undefined;\n        }\n    }\n    get y() {\n        return this._y;\n    }\n    set y(value) {\n        if (this._y !== value) {\n            this._y = value;\n            this._k = undefined;\n        }\n    }\n    get levelOfDetail() {\n        return this._lod;\n    }\n    set levelOfDetail(value) {\n        if (this._lod !== value) {\n            this._lod = value;\n            this._k = undefined;\n        }\n    }\n    get quadkey() {\n        if (!this._k) {\n            this._k = TileAddress.TileXYToQuadKey(this.x, this.y, this.levelOfDetail);\n        }\n        return this._k;\n    }\n    clone() {\n        return new TileAddress(this.x, this.y, this.levelOfDetail);\n    }\n    toString() {\n        return `x:${this.x}, y:${this.y}, lod:${this.levelOfDetail}, k:${this.quadkey}`;\n    }\n}\n//# sourceMappingURL=tiles.address.js.map","export * from \"./tiles.codecs.interfaces\";\nexport * from \"./tiles.codecs\";\nexport * from \"./tiles.codecs.image\";\nexport * from \"./tiles.codecs.cartesian\";\nexport * from \"./tiles.codecs.filter\";\nexport * from \"./tiles.codecs.canvas\";\n//# sourceMappingURL=index.js.map","export class CanvasTileCodec {\n    constructor(canvas) {\n        this._canvas = canvas;\n    }\n    get width() {\n        return this._canvas.width;\n    }\n    get height() {\n        return this._canvas.height;\n    }\n    async decodeAsync(r) {\n        if (r instanceof Response) {\n            const data = await this._decodeDataAsync(r);\n            if (data) {\n                const workingContext = this._canvas?.getContext(\"2d\", { willReadFrequently: true });\n                if (!workingContext) {\n                    throw new Error(\"Unable to get 2d context\");\n                }\n                this._render(workingContext, data);\n                const imgData = workingContext.getImageData(0, 0, this._canvas.width, this._canvas.height);\n                return await createImageBitmap(imgData);\n            }\n        }\n        return null;\n    }\n}\n//# sourceMappingURL=tiles.codecs.canvas.js.map","import { ImageDataTileCodec, ImageDataTileCodecOptions } from \"./tiles.codecs.image\";\nexport class Cartesian4TileCodecOptions extends ImageDataTileCodecOptions {\n    constructor(p) {\n        super(p);\n    }\n}\nexport class Cartesian4TileCodec {\n    constructor(pixelDecoder, options, canvas) {\n        this.pixelDecoder = pixelDecoder;\n        this._canvas = canvas;\n        this._options = options;\n    }\n    async decodeAsync(r) {\n        const imgData = await (this._canvas ? new ImageDataTileCodec(this._canvas, this._options) : ImageDataTileCodec.Shared).decodeAsync(r);\n        if (imgData) {\n            const pixels = imgData.data;\n            const w = imgData.width;\n            const h = imgData.height;\n            const size = w * h;\n            const pixelSize = pixels.length / size;\n            const stride = imgData.width * pixelSize;\n            const values = this._buildArray(size);\n            let i = 0;\n            for (let row = 0; row != imgData.height; row++) {\n                const offset = stride * row;\n                for (let column = 0; column != imgData.width; column++) {\n                    i = this.pixelDecoder.decode(pixels, offset + column * pixelSize, values, i);\n                }\n            }\n            return values;\n        }\n        return null;\n    }\n    _buildArray(size) {\n        const a = new Array(size);\n        if (this._options?.factory) {\n            for (let i = 0; i < size; i++) {\n                a[i] = this._options.factory();\n            }\n        }\n        return a;\n    }\n}\n//# sourceMappingURL=tiles.codecs.cartesian.js.map","export class MedianFilter {\n    constructor(_windowSize = 5, _threshold = 50) {\n        this._windowSize = _windowSize;\n        this._threshold = _threshold;\n        if (_windowSize % 2 === 0) {\n            throw new Error(\"Window size must be odd.\");\n        }\n    }\n    apply(values, x, y, width, height) {\n        const edge = Math.floor(this._windowSize / 2);\n        const result = new Float32Array(values.length);\n        values.copyWithin(0, 0);\n        for (let i = 0; i < height; i++) {\n            for (let j = 0; j < width; j++) {\n                const window = [];\n                for (let wi = Math.max(-edge, -i); wi <= Math.min(edge, height - 1 - i); wi++) {\n                    for (let wj = Math.max(-edge, -j); wj <= Math.min(edge, width - 1 - j); wj++) {\n                        const index = (i + wi) * width + (j + wj);\n                        window.push(values[index]);\n                    }\n                }\n                window.sort((a, b) => a - b);\n                const median = window[Math.floor(window.length / 2)];\n                const currentIndex = i * width + j;\n                const currentValue = values[currentIndex];\n                if (Math.abs(currentValue - median) > this._threshold) {\n                    result[currentIndex] = median;\n                }\n                else {\n                    result[currentIndex] = currentValue;\n                }\n            }\n        }\n        return result;\n    }\n}\nMedianFilter.Shared = new MedianFilter();\n//# sourceMappingURL=tiles.codecs.filter.js.map","import { Side } from \"../../geometry/geometry.interfaces\";\nexport class ImageTileCodec {\n    async decodeAsync(r) {\n        const blob = r instanceof Response ? await r.blob() : null;\n        if (blob) {\n            return new Promise((resolve, reject) => {\n                try {\n                    const img = new Image();\n                    const blobURL = URL.createObjectURL(blob);\n                    img.onload = function (ev) {\n                        const e = ev.target;\n                        if (e && e instanceof HTMLImageElement) {\n                            URL.revokeObjectURL(e.src);\n                            e.onload = null;\n                        }\n                        resolve(img);\n                    };\n                    img.onerror = reject;\n                    img.src = blobURL;\n                }\n                catch (e) {\n                    reject(e);\n                }\n            });\n        }\n        else {\n            return null;\n        }\n    }\n}\nImageTileCodec.Shared = new ImageTileCodec();\nexport class ImageDataTileCodecOptions {\n    constructor(p) {\n        Object.assign(this, p);\n    }\n}\nexport class ImageDataTileCodecOptionsBuilder {\n    withInsets(v, side) {\n        this._insets = this._insets ?? [0, 0, 0, 0];\n        this._insets[side] = v;\n        return this;\n    }\n    build() {\n        return new ImageDataTileCodecOptions({\n            insets: this._insets,\n        });\n    }\n}\nexport class ImageDataTileCodec {\n    static CreateCanvas(width, height) {\n        const canvas = document.createElement(\"canvas\");\n        canvas.width = width;\n        canvas.height = height;\n        return canvas;\n    }\n    constructor(canvas, options) {\n        this._canvas = canvas;\n        this._options = options;\n    }\n    async decodeAsync(r) {\n        const image = await ImageTileCodec.Shared.decodeAsync(r);\n        if (image) {\n            const insets = this._options?.insets ?? [0, 0, 0, 0];\n            const w = image.width - (insets[Side.left] + insets[Side.right]);\n            const h = image.height - (insets[Side.top] + insets[Side.bottom]);\n            const workingCanvas = this._canvas || ImageDataTileCodec.CreateCanvas(w, h);\n            if (!workingCanvas) {\n                throw new Error(\"Unable to create 2d canvas\");\n            }\n            const workingContext = workingCanvas.getContext(\"2d\", { willReadFrequently: true });\n            if (!workingContext) {\n                throw new Error(\"Unable to get 2d context\");\n            }\n            workingContext.clearRect(0, 0, w, h);\n            const sx = insets[Side.left];\n            const sy = insets[Side.top];\n            workingContext.drawImage(image, sx, sy, w, h, 0, 0, w, h);\n            return workingContext.getImageData(0, 0, w, h);\n        }\n        return null;\n    }\n}\nImageDataTileCodec.Shared = new ImageDataTileCodec();\nexport class RGBTileCodec {\n    constructor(canvas) {\n        this._canvas = canvas;\n    }\n    async decodeAsync(r) {\n        const imgData = await (this._canvas ? new ImageDataTileCodec(this._canvas) : ImageDataTileCodec.Shared).decodeAsync(r);\n        if (imgData) {\n            const pixels = imgData.data;\n            const size = imgData.width * imgData.height;\n            const n = pixels.length / size;\n            if (n == 4) {\n                const a = new Uint8ClampedArray(size * 3);\n                for (let i = 0, j = 0; i < pixels.length; i += 4, j += 3) {\n                    a[j] = pixels[i];\n                    a[j + 1] = pixels[i + 1];\n                    a[j + 2] = pixels[i + 2];\n                }\n                return a;\n            }\n            return pixels;\n        }\n        return null;\n    }\n}\nexport class RGBATileCodec {\n    constructor(canvas) {\n        this._canvas = canvas;\n    }\n    async decodeAsync(r) {\n        const imgData = await (this._canvas ? new ImageDataTileCodec(this._canvas) : ImageDataTileCodec.Shared).decodeAsync(r);\n        if (imgData) {\n            const pixels = imgData.data;\n            return pixels;\n        }\n        return null;\n    }\n}\nexport class Float32TileCodecOptions extends ImageDataTileCodecOptions {\n    constructor(p) {\n        super(p);\n    }\n}\nexport class Float32TileCodecOptionsBuilder extends ImageDataTileCodecOptionsBuilder {\n}\nexport class Float32TileCodec {\n    constructor(pixelDecoder, options, canvas) {\n        this.pixelDecoder = pixelDecoder;\n        this._options = options;\n        this._canvas = canvas;\n    }\n    async decodeAsync(r) {\n        const imgData = await (this._canvas ? new ImageDataTileCodec(this._canvas, this._options) : ImageDataTileCodec.Shared).decodeAsync(r);\n        if (imgData) {\n            const pixels = imgData.data;\n            const w = imgData.width;\n            const h = imgData.height;\n            const size = w * h;\n            const pixelSize = pixels.length / size;\n            const stride = imgData.width * pixelSize;\n            const values = new Float32Array(size);\n            let i = 0;\n            for (let row = 0; row != imgData.height; row++) {\n                const offset = stride * row;\n                for (let column = 0; column != imgData.width; column++) {\n                    i = this.pixelDecoder.decode(pixels, offset + column * pixelSize, values, i);\n                }\n            }\n            if (this._options?.filter) {\n                return this._options.filter.apply(values, 0, 0, w, h);\n            }\n            return values;\n        }\n        return null;\n    }\n}\n//# sourceMappingURL=tiles.codecs.image.js.map","export function isFilter(f) {\n    return f && typeof f.apply === \"function\";\n}\n//# sourceMappingURL=tiles.codecs.interfaces.js.map","export class BlobTileCodec {\n    async decodeAsync(r) {\n        if (r instanceof Response) {\n            const data = await r.blob();\n            return data;\n        }\n        return null;\n    }\n}\nBlobTileCodec.Shared = new BlobTileCodec();\nexport class TextTileCodec {\n    async decodeAsync(r) {\n        if (r instanceof Response) {\n            const data = await r.text();\n            return data;\n        }\n        return null;\n    }\n}\nTextTileCodec.Shared = new TextTileCodec();\nexport class JsonTileCodec {\n    async decodeAsync(r) {\n        if (r instanceof Response) {\n            const data = await r.json();\n            return data;\n        }\n        return null;\n    }\n}\nJsonTileCodec.Shared = new JsonTileCodec();\nexport class XmlDocumentTileCodec {\n    async decodeAsync(r) {\n        const str = r instanceof Response ? await r.text() : null;\n        if (str) {\n            const data = new DOMParser().parseFromString(str, \"application/xml\");\n            return data;\n        }\n        return null;\n    }\n}\nXmlDocumentTileCodec.Shared = new XmlDocumentTileCodec();\n//# sourceMappingURL=tiles.codecs.js.map","export * from \"./tiles.display\";\n//# sourceMappingURL=index.js.map","import { Observable, PropertyChangedEventArgs } from \"../../events\";\nimport { Size3 } from \"../../geometry\";\nexport class Display {\n    get propertyChangedObservable() {\n        if (!this._propertyChangedObservable) {\n            this._propertyChangedObservable = new Observable();\n        }\n        return this._propertyChangedObservable;\n    }\n    constructor(resolution) {\n        this._resolution = Size3.FromSize(resolution);\n    }\n    get resolution() {\n        return this._resolution;\n    }\n    resize(width, height, thickness) {\n        if (this._resolution.width != width || this._resolution.height != height || this._resolution.depth != thickness) {\n            if (this._propertyChangedObservable && this._propertyChangedObservable.hasObservers()) {\n                const old = this._resolution;\n                this._resolution = new Size3(width, height, thickness ?? this._resolution.depth);\n                this._propertyChangedObservable.notifyObservers(new PropertyChangedEventArgs(this, old, this._resolution, \"resolution\"));\n                return;\n            }\n            this._resolution.width = width;\n            this._resolution.height = height;\n            if (thickness) {\n                this._resolution.depth = thickness;\n            }\n        }\n    }\n    dispose() {\n        this._propertyChangedObservable?.clear();\n    }\n}\n//# sourceMappingURL=tiles.display.js.map","export * from \"./tiles.geography.EPSG3857\";\nexport * from \"./tiles.geography.collection\";\n//# sourceMappingURL=index.js.map","import { AbstractTileMetrics } from \"../tiles.metrics\";\nimport { Ellipsoid } from \"../../geodesy/geodesy.ellipsoid\";\nimport { Scalar } from \"../../math/math\";\nexport class EPSG3857 extends AbstractTileMetrics {\n    constructor(options, ellipsoid) {\n        super(options);\n        this._ellipsoid = ellipsoid || Ellipsoid.WGS84;\n    }\n    groundResolution(latitude, levelOfDetail) {\n        latitude = Scalar.Clamp(latitude, this.minLatitude, this.maxLatitude);\n        return (Math.cos(latitude * Scalar.DEG2RAD) * 2 * Math.PI * this._ellipsoid.semiMajorAxis) / this.mapSize(levelOfDetail);\n    }\n    getLatLonToTileXYToRef(latitude, longitude, levelOfDetail, tileXY) {\n        if (!tileXY)\n            return;\n        const t = tileXY;\n        latitude = Scalar.Clamp(latitude, this.minLatitude, this.maxLatitude);\n        longitude = Scalar.Clamp(longitude, this.minLongitude, this.maxLongitude);\n        const n = Math.pow(2, levelOfDetail);\n        const x = Math.floor(((longitude + 180) / 360) * n);\n        const lat_rad = latitude * Scalar.DEG2RAD;\n        const y = Math.floor(((1 - Math.log(Math.tan(lat_rad) + 1 / Math.cos(lat_rad)) / Math.PI) / 2) * n);\n        t.x = x;\n        t.y = y;\n    }\n    getTileXYToLatLonToRef(x, y, levelOfDetail, loc) {\n        if (!loc)\n            return;\n        const l = loc;\n        let n = Math.pow(2, levelOfDetail);\n        const lon = -180 + (x / n) * 360;\n        n = Math.PI - (2 * Math.PI * y) / n;\n        const lat = (180 / Math.PI) * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n        l.lat = lat;\n        l.lon = lon;\n    }\n    getLatLonToPointXYToRef(latitude, longitude, levelOfDetail, pointXY) {\n        if (!pointXY)\n            return;\n        const p = pointXY;\n        latitude = Scalar.Clamp(latitude, this.minLatitude, this.maxLatitude);\n        longitude = Scalar.Clamp(longitude, this.minLongitude, this.maxLongitude);\n        const x = (longitude + 180) / 360;\n        const sinLatitude = Math.sin(latitude * Scalar.DEG2RAD);\n        const y = 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);\n        const mapSize = this.mapSize(levelOfDetail);\n        p.x = Math.ceil(Scalar.Clamp(x * mapSize, 0, mapSize - 1));\n        p.y = Math.ceil(Scalar.Clamp(y * mapSize, 0, mapSize - 1));\n    }\n    getPointXYToLatLonToRef(pointX, pointY, levelOfDetail, latLon) {\n        if (!latLon)\n            return;\n        const g = latLon;\n        const mapSize = this.mapSize(levelOfDetail);\n        const x = Scalar.Clamp(pointX, 0, mapSize - 1) / mapSize - 0.5;\n        const y = 0.5 - Scalar.Clamp(pointY, 0, mapSize - 1) / mapSize;\n        g.lat = 90 - (360 * Math.atan(Math.exp(-y * 2 * Math.PI))) / Math.PI;\n        g.lon = 360 * x;\n    }\n    getTileXYToPointXYToRef(tileX, tileY, pointXY) {\n        if (!pointXY)\n            return;\n        const p = pointXY;\n        const s = this.tileSize;\n        p.x = tileX * s;\n        p.y = tileY * s;\n    }\n    getPointXYToTileXYToRef(pointX, pointY, tileXY) {\n        if (!tileXY)\n            return;\n        const t = tileXY;\n        const s = this.tileSize;\n        t.x = Math.floor(pointX / s);\n        t.y = Math.floor(pointY / s);\n    }\n}\nEPSG3857.Shared = new EPSG3857();\n//# sourceMappingURL=tiles.geography.EPSG3857.js.map","import { GeoShapeType } from \"../../geography\";\nimport { BoundedCollection, Cartesian3 } from \"../../geometry\";\nimport { Polygon } from \"../../geometry/shapes/geometry.polygon\";\nimport { Polyline } from \"../../geometry/shapes/geometry.polyline\";\nimport { Line } from \"../../geometry/shapes/geometry.line\";\nimport { PolylineSimplifier } from \"../../geometry/geometry.simplify\";\nimport { Observable } from \"../../events\";\nexport class ShapeCollectionEventArgs {\n    constructor(lod, IShapes) {\n        this.lod = lod;\n        this.IShapes = IShapes;\n    }\n}\nexport class ShapeCollection {\n    constructor(metrics, simplifier) {\n        this._metrics = metrics;\n        this._shapes = new Array(metrics.maxLOD - metrics.minLOD + 1);\n        this._simplifier = simplifier ?? new PolylineSimplifier(ShapeCollection.DefaultSimplifyTolerance, ShapeCollection.DefaultSimplifyHighQuality);\n    }\n    get metrics() {\n        return this._metrics;\n    }\n    get addedObservable() {\n        if (this._addedObservable === undefined) {\n            this._addedObservable = new Observable();\n        }\n        return this._addedObservable;\n    }\n    get removedObservable() {\n        if (this._removedObservable === undefined) {\n            this._removedObservable = new Observable();\n        }\n        return this._removedObservable;\n    }\n    get(lod) {\n        if (lod < this._metrics.minLOD || lod > this._metrics.maxLOD) {\n            return null;\n        }\n        return this._shapes[lod - this._metrics.minLOD];\n    }\n    trySet(lod, ...shapes) {\n        let collection = this.get(lod);\n        const views = shapes.map((s) => this._buildShape(s, lod, this.metrics)).filter((v) => v !== null);\n        if (views.length === 0) {\n            return false;\n        }\n        if (!collection) {\n            collection = new BoundedCollection();\n            this._shapes[lod - this._metrics.minLOD] = collection;\n        }\n        collection.push(...views);\n        if (this._addedObservable !== undefined && this._addedObservable.hasObservers()) {\n            this._addedObservable.notifyObservers(new ShapeCollectionEventArgs(lod, views), -1, this, this);\n        }\n        return true;\n    }\n    _buildShape(shape, lod, metrics) {\n        switch (shape.type) {\n            case GeoShapeType.Polygon: {\n                return this._buildPolygon(shape, lod, metrics);\n            }\n            case GeoShapeType.Line: {\n                return this._buildLine(shape, lod, metrics);\n            }\n            case GeoShapeType.Polyline: {\n                return this._buildPolyline(shape, lod, metrics);\n            }\n            default: {\n                return null;\n            }\n        }\n    }\n    _buildPolygon(shape, lod, metrics) {\n        const points = this._transform(shape.points, lod, metrics);\n        return Polygon.FromPoints(points);\n    }\n    _buildLine(shape, lod, metrics) {\n        const a = Cartesian3.Zero();\n        const b = Cartesian3.Zero();\n        metrics.getLatLonToPointXYToRef(shape.start.lat, shape.start.lon, lod, a);\n        metrics.getLatLonToPointXYToRef(shape.end.lat, shape.end.lon, lod, b);\n        return this._filter(a, b) ? new Line(a, b) : null;\n    }\n    _buildPolyline(shape, lod, metrics) {\n        const points = this._transform(shape.points, lod, metrics);\n        return this._filter(...points) ? Polyline.FromPoints(points) : null;\n    }\n    _transform(geo, lod, metrics) {\n        const result = geo.map((p) => {\n            const ref = Cartesian3.Zero();\n            metrics.getLatLonToPointXYToRef(p.lat, p.lon, lod, ref);\n            return ref;\n        });\n        if (result.length > 2 && this._simplifier) {\n            return this._simplifier.simplify(result);\n        }\n        return result;\n    }\n    _filter(...args) {\n        if (args.length < 2)\n            return true;\n        const p1 = args[0];\n        const p2 = args[1];\n        return Cartesian3.Equals(p1, p2, ShapeCollection.Epsilon) == false;\n    }\n}\nShapeCollection.DefaultSimplifyTolerance = 2;\nShapeCollection.DefaultSimplifyHighQuality = false;\nShapeCollection.Epsilon = 1;\n//# sourceMappingURL=tiles.geography.collection.js.map","export * from \"./vendors/index\";\nexport * from \"./codecs/index\";\nexport * from \"./pipeline/index\";\nexport * from \"./navigation/index\";\nexport * from \"./map/index\";\nexport * from \"./providers/index\";\nexport * from \"./address/index\";\nexport * from \"./display/index\";\nexport * from \"./geography/index\";\nexport * from \"./vector/index\";\nexport * from \"./tiles.interfaces\";\nexport * from \"./tiles.metrics\";\nexport * from \"./tiles.client\";\nexport * from \"./tiles\";\nexport * from \"./tiles.url.web\";\nexport * from \"./tiles.collection\";\nexport * from \"./tiles.system\";\nexport * from \"./3d\";\n//# sourceMappingURL=index.js.map","export * from \"./tiles.map\";\nexport * from \"./tiles.map.interfaces\";\nexport * from \"./typed/index\";\nexport * from \"./tiles.map.layer\";\nexport * from \"./tiles.map.layerView\";\nexport * from \"./tiles.map.view.base\";\nexport * from \"./tiles.map.view\";\n//# sourceMappingURL=index.js.map","import { IsTileMetricsProvider } from \"../tiles.interfaces\";\nexport function IsDrawableTileMapLayer(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return b.drawFn !== undefined;\n}\nexport function IsTileMapLayer(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return IsTileMetricsProvider(b) && b.provider !== undefined && b.addTo !== undefined;\n}\nexport function IsTileMapLayerProxy(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return b.layer !== undefined;\n}\nexport function IsTileMapLayerContainerProxy(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return b.layers !== undefined;\n}\nexport function IsPhysicalDisplay(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return b.resolution !== undefined && b.dimension !== undefined && b.pixelPerUnit !== undefined;\n}\n//# sourceMappingURL=tiles.map.interfaces.js.map","import { Observable, PropertyChangedEventArgs } from \"../../events\";\nimport { TileNavigationState } from \"../navigation\";\nimport { ValidableBase } from \"../../validable\";\nimport { OrderedCollection } from \"../../collections/orderedCollection\";\nimport { TileMapLayerView } from \"./tiles.map.layerView\";\nimport { TileView } from \"./tiles.map.view\";\nimport { TileNavigationApi } from \"../navigation/tiles.navigation.api\";\nexport class TileMapBase extends ValidableBase {\n    constructor(display, nav, container) {\n        super();\n        this._display = null;\n        this._navigation = null;\n        this._api = null;\n        this._layers = container ?? this._buildLayerContainer() ?? this._buildLayerContainerInternal();\n        this._layerAddedObserver = this._layers.addedObservable.add(this._onLayerAdded.bind(this));\n        this._layerRemovedObserver = this._layers.removedObservable.add(this._onLayerRemoved.bind(this));\n        this.display = display ?? null;\n        this.navigationState = nav ?? this._buildNavigationState() ?? new TileNavigationState();\n        this._view = this._buildView() ?? new TileView();\n        this._layerViews = this._buildLayerViewContainer(this._layers) ?? this._buildLayerViewContainerInternal(this._layers);\n        this._layerViewAddedObserver = this._layerViews.addedObservable.add(this._onLayerViewAdded.bind(this));\n        this._layerViewRemovedObserver = this._layerViews.removedObservable.add(this._onLayerViewRemoved.bind(this));\n    }\n    get layers() {\n        return this._layers;\n    }\n    get layerViews() {\n        return this._layerViews;\n    }\n    get propertyChangedObservable() {\n        if (!this._propertyChangedObservable)\n            this._propertyChangedObservable = new Observable();\n        return this._propertyChangedObservable;\n    }\n    get display() {\n        return this._display;\n    }\n    set display(value) {\n        this._bindDisplay(value);\n    }\n    get navigationState() {\n        return this._navigation;\n    }\n    set navigationState(value) {\n        this._bindNavigation(value);\n    }\n    get view() {\n        return this._view;\n    }\n    dispose() {\n        super.dispose();\n        this._navigationValidableObserver?.disconnect();\n        this._displayPropertyObserver?.disconnect();\n        this._layerAddedObserver?.disconnect();\n        this._layerRemovedObserver?.disconnect();\n        this._layerViewAddedObserver?.disconnect();\n        this._layerViewRemovedObserver?.disconnect();\n    }\n    setViewMap(center, zoom, rotation) {\n        this._api?.setViewMap(center, zoom, rotation);\n        for (const v of this._layerViews) {\n            v.navigationApi?.setViewMap(center, zoom, rotation);\n        }\n        return this;\n    }\n    zoomMap(delta) {\n        this._api?.zoomMap(delta);\n        for (const v of this._layerViews) {\n            v.navigationApi?.zoomMap(delta);\n        }\n        return this;\n    }\n    zoomInMap(delta) {\n        this._api?.zoomInMap(delta);\n        for (const v of this._layerViews) {\n            v.navigationApi?.zoomInMap(delta);\n        }\n        return this;\n    }\n    zoomOutMap(delta) {\n        this._api?.zoomOutMap(delta);\n        for (const v of this._layerViews) {\n            v.navigationApi?.zoomOutMap(delta);\n        }\n        return this;\n    }\n    translateUnitsMap(tx, ty) {\n        this._api?.translateUnitsMap(tx, ty);\n        for (const v of this._layerViews) {\n            v.navigationApi?.translateUnitsMap(tx, ty);\n        }\n        return this;\n    }\n    translateMap(lat, lon) {\n        this._api?.translateMap(lat, lon);\n        for (const v of this._layerViews) {\n            v.navigationApi?.translateMap(lat, lon);\n        }\n        return this;\n    }\n    rotateMap(r) {\n        this._api?.rotateMap(r);\n        for (const v of this._layerViews) {\n            v.navigationApi?.rotateMap(r);\n        }\n        return this;\n    }\n    get isValid() {\n        return super.isValid && this._layers?.isValid && this._layerViews?.isValid;\n    }\n    _doValidate() {\n        this._layers?.validate();\n        this._layerViews?.validate();\n    }\n    _onLayerAdded(eventData, eventstate) {\n        const views = eventData.map((l) => this._buildLayerView(l)).filter((i) => i !== null && i !== undefined);\n        if (views.length > 0) {\n            this._layerViews.add(...views);\n            this.invalidate();\n        }\n    }\n    _onLayerRemoved(eventData, eventstate) {\n        const toRemove = Array.from(this._layerViews.get((v) => eventData.includes(v.layer)));\n        if (toRemove?.length) {\n            this._layerViews.remove(...toRemove);\n            this.invalidate();\n        }\n    }\n    _onLayerViewAdded(eventData, eventstate) {\n        this._updateLayerNavigations(eventData);\n    }\n    _onLayerViewRemoved(eventData, eventstate) { }\n    _updateLayerNavigations(layers) {\n        if (layers) {\n            const nav = this.navigationState;\n            if (nav) {\n                for (const layerView of layers) {\n                    layerView.navigationState?.copy(nav);\n                }\n            }\n        }\n    }\n    _onNavigationValidationChanged(event, state) {\n        if (event && state.target === this._navigation) {\n            this.invalidate();\n            this._onNavigationUpdated(state.target);\n        }\n    }\n    _onDisplayPropertyChanged(event, state) {\n        switch (event.propertyName) {\n            case \"size\": {\n                this.invalidate();\n                this._onDisplayResized(event.source);\n                break;\n            }\n            default: {\n                break;\n            }\n        }\n    }\n    _onNavigationPropertyChanged(event, state) { }\n    _bindDisplay(display) {\n        if (this._display != display) {\n            const old = this.display;\n            if (this._display) {\n                this._displayPropertyObserver?.disconnect();\n                this._displayPropertyObserver = null;\n                this._onDisplayUnbinded(this._display);\n            }\n            this._display = display;\n            if (this._display) {\n                this._displayPropertyObserver = this._display.propertyChangedObservable?.add(this._onDisplayPropertyChanged.bind(this));\n            }\n            if (this._layerViews) {\n                for (const l of this._layerViews) {\n                    l.display = display;\n                }\n            }\n            this.invalidate();\n            this._onDisplayBinded(display);\n            if (this._propertyChangedObservable && this._propertyChangedObservable.hasObservers()) {\n                this._propertyChangedObservable.notifyObservers(new PropertyChangedEventArgs(this, old, this._display, TileMapBase.DISPLAY_PROPERTY_NAME), -1, this, this);\n            }\n        }\n    }\n    _bindNavigation(nav) {\n        if (this._navigation != nav) {\n            const old = this._navigation;\n            if (this._navigation) {\n                this._navigationValidableObserver?.disconnect();\n                this._navigationValidableObserver = null;\n                this._navigationPropertyObserver?.disconnect();\n                this._navigationPropertyObserver = null;\n                this._api?.dispose();\n                this._api = null;\n                this._onNavigationUnbinded(this._navigation);\n            }\n            this._navigation = nav;\n            if (this._navigation) {\n                this._api = new TileNavigationApi(this._navigation);\n                this._navigationPropertyObserver = this._navigation.propertyChangedObservable?.add(this._onNavigationPropertyChanged.bind(this));\n                this._navigationValidableObserver = this._navigation.validationObservable?.add(this._onNavigationValidationChanged.bind(this));\n                this._updateLayerNavigations(this._layerViews);\n            }\n            this.invalidate();\n            this._onNavigationBinded(nav);\n            if (this._propertyChangedObservable && this._propertyChangedObservable.hasObservers()) {\n                this._propertyChangedObservable.notifyObservers(new PropertyChangedEventArgs(this, old, this._navigation, TileMapBase.NAVIGATION_PROPERTY_NAME), -1, this, this);\n            }\n        }\n    }\n    _buildLayerContainer() {\n        return this._buildLayerContainerInternal();\n    }\n    _buildLayerViewContainer(layers) {\n        return this._buildLayerViewContainerInternal(layers);\n    }\n    _buildLayerView(layer) {\n        return this._buildLayerViewInternal(layer);\n    }\n    _onDisplayUnbinded(display) {\n    }\n    _onDisplayBinded(display) {\n    }\n    _onNavigationUnbinded(nav) {\n    }\n    _onNavigationBinded(nav) {\n    }\n    _onNavigationUpdated(nav) {\n    }\n    _onDisplayResized(display) {\n    }\n    _onDisplayTranslated(display) {\n    }\n    _buildNavigationState() {\n        return new TileNavigationState();\n    }\n    _buildView() {\n        return new TileView();\n    }\n    _buildLayerContainerInternal() {\n        return new OrderedCollection();\n    }\n    _buildLayerViewContainerInternal(layers) {\n        return new OrderedCollection(...Array.from(this._layers).map((l) => this._buildLayerView(l) ?? this._buildLayerViewInternal(l)));\n    }\n    _buildLayerViewInternal(layer) {\n        return new TileMapLayerView(layer, this._display, this._view);\n    }\n}\nTileMapBase.DISPLAY_PROPERTY_NAME = \"display\";\nTileMapBase.NAVIGATION_PROPERTY_NAME = \"nav\";\n//# sourceMappingURL=tiles.map.js.map","import { Observable, PropertyChangedEventArgs } from \"../../events\";\nimport { IsTileDatasource } from \"../tiles.interfaces\";\nimport { IsTileMapLayerContainerProxy } from \"./tiles.map.interfaces\";\nimport { Assert } from \"../../utils\";\nimport { TileContentProvider } from \"../providers\";\nexport class TileMapLayer {\n    constructor(name, provider, options, enabled) {\n        Assert(name !== undefined && name !== null && name !== \"\", \"Invalid layer name.\");\n        Assert(provider !== undefined && name !== null, \"Invalid provider or datasource\");\n        this._name = name;\n        this._provider = IsTileDatasource(provider) ? this._buildProvider(provider) : provider;\n        this._weight = options?.weight ?? -1;\n        this._zoomOffset = options?.zoomOffset ?? 0;\n        this._attribution = options?.attribution;\n        this._draw = options?.drawFn;\n        this._drawTarget = options?.drawTarget ?? this;\n        this._enabled = enabled ?? true;\n    }\n    get metrics() {\n        return this._provider.metrics;\n    }\n    get provider() {\n        return this._provider;\n    }\n    get drawFn() {\n        return this._draw;\n    }\n    get drawTarget() {\n        return this._drawTarget;\n    }\n    get propertyChangedObservable() {\n        if (!this._propertyChangedObservable) {\n            this._propertyChangedObservable = new Observable();\n        }\n        return this._propertyChangedObservable;\n    }\n    get weightChangedObservable() {\n        if (!this._weightChangedObservable) {\n            this._weightChangedObservable = new Observable();\n        }\n        return this._weightChangedObservable;\n    }\n    get name() {\n        return this._name;\n    }\n    get weight() {\n        return this._weight;\n    }\n    set weight(zindex) {\n        if (this._weight !== zindex) {\n            if (this._propertyChangedObservable && this._propertyChangedObservable.hasObservers()) {\n                const oldValue = this._weight;\n                this._weight = zindex;\n                const args = new PropertyChangedEventArgs(this, oldValue, this._weight, \"weight\");\n                this._propertyChangedObservable.notifyObservers(args, -1, this, this);\n                return;\n            }\n            if (this._weightChangedObservable && this._weightChangedObservable.hasObservers()) {\n                this._weightChangedObservable.notifyObservers(this, -1, this, this);\n            }\n            this._weight = zindex;\n        }\n    }\n    get zoomOffset() {\n        return this._zoomOffset ?? 0;\n    }\n    set zoomOffset(zoomOffset) {\n        if (this._zoomOffset !== zoomOffset) {\n            if (this._propertyChangedObservable && this._propertyChangedObservable.hasObservers()) {\n                const oldValue = this._zoomOffset;\n                this._zoomOffset = zoomOffset;\n                const args = new PropertyChangedEventArgs(this, oldValue, this._zoomOffset, \"zoomOffset\");\n                this._propertyChangedObservable.notifyObservers(args, -1, this, this);\n                return;\n            }\n            this._zoomOffset = zoomOffset;\n        }\n    }\n    get attribution() {\n        return this._attribution;\n    }\n    set attribution(attribution) {\n        if (this._attribution !== attribution) {\n            if (this._propertyChangedObservable && this._propertyChangedObservable.hasObservers()) {\n                const oldValue = this._attribution;\n                this._attribution = attribution;\n                const args = new PropertyChangedEventArgs(this, oldValue, this._attribution, \"attribution\");\n                this._propertyChangedObservable.notifyObservers(args, -1, this, this);\n                return;\n            }\n            this._attribution = attribution;\n        }\n    }\n    get enabled() {\n        return this._enabled;\n    }\n    set enabled(enabled) {\n        if (this._enabled !== enabled) {\n            if (this._propertyChangedObservable && this._propertyChangedObservable.hasObservers()) {\n                const oldValue = this._enabled;\n                this._enabled = enabled;\n                const args = new PropertyChangedEventArgs(this, oldValue, this._enabled, \"enabled\");\n                this._propertyChangedObservable.notifyObservers(args, -1, this, this);\n                return;\n            }\n            this._enabled = enabled;\n        }\n    }\n    addTo(map) {\n        if (map) {\n            if (IsTileMapLayerContainerProxy(map)) {\n                map = map.layers;\n            }\n            map?.add(this);\n        }\n        return this;\n    }\n    dispose() { }\n    _buildProvider(dataSource, cache) {\n        return new TileContentProvider(dataSource, cache);\n    }\n}\n//# sourceMappingURL=tiles.map.layer.js.map","import { Observable } from \"../../events\";\nimport { IsDisposable } from \"../../types\";\nimport { TileNavigationState } from \"../navigation\";\nimport { TileNavigationApi } from \"../navigation/tiles.navigation.api\";\nimport { hasTileSelectionContext } from \"../pipeline\";\nimport { TileProvider } from \"../providers\";\nimport { TileView } from \"./tiles.map.view\";\nexport class TileMapLayerView extends TileProvider {\n    constructor(layer, display, source, selectionContext) {\n        super(layer.provider);\n        this._ownSource = false;\n        this._navigation = null;\n        this._navigationObserver = null;\n        this._api = null;\n        this._display = null;\n        this._displayObserver = null;\n        this._layer = layer;\n        this._layerObserver = layer.propertyChangedObservable.add(this._onLayerPropertyChanged.bind(this));\n        this.navigationState = this._buildNavigation();\n        this.display = display;\n        this._source = source ?? this._buildSource();\n        this._source?.linkTo(this);\n        if (!selectionContext) {\n            if (hasTileSelectionContext(this._source)) {\n                selectionContext = this._source;\n            }\n        }\n        this._selectionContext = selectionContext;\n    }\n    get navigationApi() {\n        return this._api;\n    }\n    get weightChangedObservable() {\n        if (!this._weightChangedObservable) {\n            this._weightChangedObservable = new Observable();\n        }\n        return this._weightChangedObservable;\n    }\n    get weight() {\n        return this._layer.weight;\n    }\n    get name() {\n        return this._layer.name;\n    }\n    get layer() {\n        return this._layer;\n    }\n    get display() {\n        return this._display;\n    }\n    get navigationState() {\n        return this._navigation;\n    }\n    set navigationState(value) {\n        if (this._navigation !== value) {\n            const tmp = this._navigation;\n            if (tmp) {\n                this._navigationObserver?.disconnect();\n                this._navigationObserver = null;\n                this._api?.dispose();\n                this._api = null;\n            }\n            this._navigation = value;\n            if (this._navigation) {\n                this._api = new TileNavigationApi(this._navigation, this.metrics);\n                this._navigationObserver = this._navigation.propertyChangedObservable.add(this._onNavigationPropertyChanged.bind(this));\n            }\n            this._onNavigationChanged(tmp, value);\n        }\n    }\n    set display(value) {\n        if (this._display !== value) {\n            const tmp = this._display;\n            if (tmp) {\n                this._displayObserver?.disconnect();\n                this._displayObserver = null;\n            }\n            this._display = value;\n            if (this._display) {\n                this._displayObserver = this._display.propertyChangedObservable.add(this._onDisplayPropertyChanged.bind(this));\n            }\n            this._onDisplayChanged(tmp, value);\n        }\n    }\n    get source() {\n        return this._source;\n    }\n    dispose() {\n        super.dispose();\n        this._navigation?.dispose();\n        this._source?.unlinkFrom(this);\n        if (this._ownSource && IsDisposable(this._source)) {\n            this._source?.dispose();\n        }\n        this._layerObserver?.disconnect();\n        this._displayObserver?.disconnect();\n        this._navigationObserver?.disconnect();\n    }\n    _buildSource() {\n        this._ownSource = true;\n        return new TileView();\n    }\n    _buildNavigation() {\n        return new TileNavigationState(undefined, undefined, undefined, this.metrics);\n    }\n    _onLayerPropertyChanged(eventData, eventState) {\n        switch (eventData.propertyName) {\n            case \"weight\": {\n                if (this._weightChangedObservable && this._weightChangedObservable.hasObservers()) {\n                    this._weightChangedObservable.notifyObservers(this, -1, this, this);\n                }\n                break;\n            }\n        }\n        this.invalidate();\n    }\n    _onNavigationChanged(oldValue, newValue) {\n        this.invalidate();\n    }\n    _onNavigationPropertyChanged(eventData, eventState) {\n        this.invalidate();\n    }\n    _onDisplayChanged(oldValue, newValue) {\n        this.invalidate();\n    }\n    _onDisplayPropertyChanged(eventData, eventState) {\n        this.invalidate();\n    }\n    _doValidate() {\n        this._selectionContext?.setContext(this.navigationState, this._display, this.metrics, { zoomOffset: this.layer.zoomOffset ?? 0 });\n    }\n}\n//# sourceMappingURL=tiles.map.layerView.js.map","import { SourceBlock } from \"../pipeline/tiles.pipeline.sourceblock\";\nexport class TileViewBase extends SourceBlock {\n    constructor() {\n        super();\n        this._activ = new Map();\n    }\n    setContext(state, display, metrics, options) {\n        if (!state || !display) {\n            this._doClearContext(state, this._activ, options);\n            return;\n        }\n        this._doValidateContext(state, display, metrics, this._activ, options);\n    }\n    _doClearContext(state, activAddresses, options) {\n        if (state) {\n            let deleted = Array.from(activAddresses.values());\n            activAddresses.clear();\n            if (options?.dispatchEvent ?? true) {\n                if (deleted.length && this._removedObservable?.hasObservers()) {\n                    this._removedObservable.notifyObservers(deleted, -1, this, this);\n                }\n            }\n        }\n    }\n    _doValidateContext(state, display, metrics, activAddresses, options) { }\n}\n//# sourceMappingURL=tiles.map.view.base.js.map","import { TileAddress } from \"../address\";\nimport { Cartesian2, Bounds } from \"../../geometry\";\nimport { TileViewBase } from \"./tiles.map.view.base\";\nexport class TileView extends TileViewBase {\n    constructor(offset = 0) {\n        super();\n        this._offset = 0;\n        this._offset = offset;\n    }\n    get offset() {\n        return this._offset;\n    }\n    _doValidateContext(state, display, metrics, activAddresses, options) {\n        if (state && display) {\n            const offset = this._offset + (options?.zoomOffset ?? 0);\n            const target = state.lod + offset;\n            const lod = TileAddress.ClampLod(target, metrics);\n            if (target != lod) {\n                return;\n            }\n            let scale = state.scale;\n            const nwTileXY = Cartesian2.Zero();\n            const seTileXY = Cartesian2.Zero();\n            const pixelCenterXY = metrics.getLatLonToPointXY(state.center.lat, state.center.lon, lod);\n            const r = offset == 0 ? 1.0 : offset > 0 ? Math.pow(2, offset) : 1.0 / Math.pow(2, -offset);\n            let w = (display?.resolution.width ?? 0) * r;\n            let h = (display?.resolution.height ?? 0) * r;\n            let rect = this._getRectangle(pixelCenterXY, w, h, scale, state.azimuth);\n            let testRect = state.azimuth?.value ? this._getRectangle(pixelCenterXY, w, h, scale) : null;\n            metrics.getPointXYToTileXYToRef(rect.xmin, rect.ymin, nwTileXY);\n            metrics.getPointXYToTileXYToRef(rect.xmax, rect.ymax, seTileXY);\n            const maxIndex = metrics.mapSize(lod) / metrics.tileSize - 1;\n            const x0 = Math.max(0, nwTileXY.x);\n            const y0 = Math.max(0, nwTileXY.y);\n            const x1 = Math.min(maxIndex, seTileXY.x);\n            const y1 = Math.min(maxIndex, seTileXY.y);\n            const remains = new Array();\n            const added = new Array();\n            const tmp = new TileAddress(0, 0, lod);\n            for (tmp.y = y0; tmp.y <= y1; tmp.y++) {\n                for (tmp.x = x0; tmp.x <= x1; tmp.x++) {\n                    if (testRect) {\n                        const tileRect = this._getTileRectangle(tmp, metrics, pixelCenterXY, state.azimuth);\n                        if (testRect.intersects(tileRect) == false) {\n                            continue;\n                        }\n                    }\n                    const key = tmp.quadkey;\n                    const activ = activAddresses.get(key);\n                    if (activ) {\n                        remains.push(activ);\n                        activAddresses.delete(key);\n                        continue;\n                    }\n                    added.push(tmp.clone());\n                }\n            }\n            let deleted = Array.from(activAddresses.values());\n            activAddresses.clear();\n            for (const a of remains) {\n                activAddresses.set(a.quadkey, a);\n            }\n            for (const a of added) {\n                activAddresses.set(a.quadkey, a);\n            }\n            if (options?.dispatchEvent ?? true) {\n                if (deleted.length && this._removedObservable?.hasObservers()) {\n                    this._removedObservable.notifyObservers(deleted, -1, this, this);\n                }\n                if (added.length && this._addedObservable?.hasObservers()) {\n                    this._addedObservable.notifyObservers(added, -1, this, this);\n                }\n            }\n        }\n    }\n    _getRectangle(center, w, h, scale, azimuth) {\n        w = (w / scale) * 1.5;\n        h = (h / scale) * 1.5;\n        const x0 = center.x - w / 2;\n        const y0 = center.y - h / 2;\n        const bounds = new Bounds(x0, y0, w, h);\n        return azimuth?.value ? Bounds.FromPoints2(...this._rotatePointsArround(center, azimuth, ...bounds.points())) : bounds;\n    }\n    _getTileRectangle(a, metrics, center, azimuth) {\n        const points = [\n            metrics.getTileXYToPointXY(a.x, a.y),\n            metrics.getTileXYToPointXY(a.x + 1, a.y),\n            metrics.getTileXYToPointXY(a.x + 1, a.y + 1),\n            metrics.getTileXYToPointXY(a.x, a.y + 1),\n        ];\n        return Bounds.FromPoints2(...this._rotatePointsArround(center, azimuth, ...points));\n    }\n    *_rotatePointsArround(center, azimuth, ...points) {\n        for (const p of points) {\n            yield this._rotatePointArround(p.x, p.y, center, azimuth, p);\n        }\n    }\n    _rotatePointArround(x, y, center, azimuth, target) {\n        const r = target || Cartesian2.Zero();\n        const translatedX = x - center.x;\n        const translatedY = y - center.y;\n        const cos = azimuth?.cos ?? 1;\n        const sin = azimuth?.sin ?? 0;\n        r.x = translatedX * cos - translatedY * sin + center.x;\n        r.y = translatedX * sin + translatedY * cos + center.y;\n        return r;\n    }\n}\n//# sourceMappingURL=tiles.map.view.js.map","export * from \"./tiles.map.layer.float32\";\nexport * from \"./tiles.map.layer.image\";\nexport * from \"./tiles.map.layer.vector\";\n//# sourceMappingURL=index.js.map","import { TileMapLayer } from \"../tiles.map.layer\";\nexport class Float32Layer extends TileMapLayer {\n    constructor(name, provider, options, enabled) {\n        super(name, provider, options, enabled);\n    }\n}\n//# sourceMappingURL=tiles.map.layer.float32.js.map","import { TileMapLayer } from \"../tiles.map.layer\";\nexport class ImageLayer extends TileMapLayer {\n    constructor(name, provider, options, enabled) {\n        super(name, provider, options, enabled);\n        this._draw = this._draw ?? this._renderTile.bind(this);\n    }\n    _renderTile(ctx, tile, w, h) {\n        ctx.drawImage(tile.content, 0, 0, w + 1, h + 1);\n    }\n}\n//# sourceMappingURL=tiles.map.layer.image.js.map","import { TileVectorRenderer } from \"../../vector\";\nimport { TileMapLayer } from \"../tiles.map.layer\";\nexport class TileMapVectorLayer extends TileMapLayer {\n    constructor(name, source, options, enabled = true) {\n        super(name, source, options, enabled);\n        if (options.style instanceof TileVectorRenderer) {\n            this._renderer = options.style;\n        }\n        else {\n            this._renderer = new TileVectorRenderer(options.style);\n        }\n        this._draw = this._draw ?? this._renderTile.bind(this);\n    }\n    _renderTile(ctx, tile, w, h) {\n        this._clip(ctx, 0, 0, w, h);\n        this._renderer.renderTile(tile.content, ctx, w, h);\n    }\n    _clip(ctx, x, y, w, h) {\n        ctx.beginPath();\n        ctx.rect(x, y, w, h);\n        ctx.clip();\n    }\n}\n//# sourceMappingURL=tiles.map.layer.vector.js.map","export * from \"./tiles.navigation.interfaces\";\nexport * from \"./tiles.navigation.state\";\nexport * from \"./tiles.navigation.state.sync\";\nexport * from \"./tiles.navigation.state.camera\";\nexport * from \"./tiles.navigation.api\";\n//# sourceMappingURL=index.js.map","import { Cartesian2 } from \"../../geometry\";\nimport { IsLocation, Bearing, Geo2 } from \"../../geography\";\nimport { EPSG3857 } from \"../geography\";\nexport class TileNavigationApi {\n    constructor(navigation, metrics) {\n        this._cartesianCache = Cartesian2.Zero();\n        this._navigation = navigation;\n        this._metrics = metrics ?? EPSG3857.Shared;\n    }\n    get navigationState() {\n        return this._navigation;\n    }\n    get metrics() {\n        return this._metrics;\n    }\n    dispose() { }\n    setViewMap(center, zoom, rotation, validate) {\n        if (center) {\n            let lat = 0;\n            let lon = 0;\n            if (Array.isArray(center)) {\n                lat = center.length > 0 ? center[0] : 0;\n                lon = center.length > 1 ? center[1] : 0;\n            }\n            else {\n                lat = center.lat;\n                lon = center.lon;\n            }\n            this._navigation.center = new Geo2(lat, lon);\n        }\n        if (zoom !== undefined) {\n            this._navigation.zoom = zoom;\n        }\n        if (rotation !== undefined && rotation !== this._navigation.azimuth?.value) {\n            this._navigation.azimuth = new Bearing(rotation);\n        }\n        if (validate === undefined || validate === true) {\n            this._navigation.validate();\n        }\n        return this;\n    }\n    zoomInMap(delta, validate) {\n        this._navigation.zoom = this._navigation.zoom + Math.abs(delta);\n        if (validate === undefined || validate === true) {\n            this._navigation.validate();\n        }\n        return this;\n    }\n    zoomMap(delta, validate) {\n        this._navigation.zoom = this._navigation.zoom + delta;\n        if (validate === undefined || validate === true) {\n            this._navigation.validate();\n        }\n        return this;\n    }\n    zoomOutMap(delta, validate) {\n        this._navigation.zoom = this._navigation.zoom - Math.abs(delta);\n        if (validate === undefined || validate === true) {\n            this._navigation.validate();\n        }\n        return this;\n    }\n    translateUnitsMap(tx, ty, validate) {\n        const m = this._metrics;\n        if (this._navigation.azimuth?.value) {\n            const p = this.rotatePointInv(tx, ty, this._cartesianCache);\n            tx = p.x;\n            ty = p.y;\n        }\n        const lod = Math.round(this._navigation.zoom);\n        const center = this._navigation.center;\n        const pixelCenterXY = m.getLatLonToPointXY(center.lat, center.lon, lod);\n        pixelCenterXY.x += tx;\n        pixelCenterXY.y += ty;\n        this._navigation.center = m.getPointXYToLatLon(pixelCenterXY.x, pixelCenterXY.y, lod);\n        if (validate === undefined || validate === true) {\n            this._navigation.validate();\n        }\n        return this;\n    }\n    translateMap(lat, lon, validate) {\n        if (lat) {\n            let dlat;\n            let dlon;\n            if (Array.isArray(lat)) {\n                dlat = lat.length > 0 ? lat[0] : 0;\n                dlon = lat.length > 1 ? lat[1] : 0;\n            }\n            else if (IsLocation(lat)) {\n                dlat = lat.lat;\n                dlon = lat.lon;\n            }\n            else {\n                dlat = lat;\n                dlon = lon ?? 0;\n            }\n            const center = this._navigation.center;\n            this._navigation.center = new Geo2(center.lat + dlat, center.lon + dlon);\n            if (validate === undefined || validate === true) {\n                this._navigation.validate();\n            }\n        }\n        return this;\n    }\n    rotateMap(r, validate) {\n        this._navigation.azimuth = new Bearing(this._navigation.azimuth.value + r);\n        if (validate === undefined || validate === true) {\n            this._navigation.validate();\n        }\n        return this;\n    }\n    rotatePointInv(x, y, target) {\n        const r = target || Cartesian2.Zero();\n        const azimuth = this._navigation.azimuth;\n        r.x = x * azimuth.cos + y * azimuth.sin;\n        r.y = -x * azimuth.sin + y * azimuth.cos;\n        return r;\n    }\n}\n//# sourceMappingURL=tiles.navigation.api.js.map","import { IsLocation, Bearing } from \"../../geography\";\nimport { IsTileSystemBounds } from \"../tiles.interfaces\";\nexport function HasNavigationState(obj) {\n    if (typeof obj !== \"object\" || obj === null)\n        return false;\n    return obj.navigationState !== undefined;\n}\nexport function IsTileNavigationState(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return (b.center !== undefined &&\n        IsLocation(b.center) &&\n        b.zoom !== undefined &&\n        b.azimuth !== undefined &&\n        b.azimuth instanceof Bearing &&\n        b.bounds !== undefined &&\n        IsTileSystemBounds(b.bounds));\n}\nexport function IsTileNavigationApi(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return (b.setViewMap !== undefined &&\n        b.zoomInMap !== undefined &&\n        b.zoomOutMap !== undefined &&\n        b.translateUnitsMap !== undefined &&\n        b.translateMap !== undefined &&\n        b.rotateMap !== undefined);\n}\nexport function HasNavigationApi(obj) {\n    if (typeof obj !== \"object\" || obj === null)\n        return false;\n    return obj.navigationApi !== undefined;\n}\n//# sourceMappingURL=tiles.navigation.interfaces.js.map","import { Observable, PropertyChangedEventArgs } from \"../../events\";\nexport class CameraState {\n    constructor(position, target, fov) {\n        this._position = position;\n        this._target = target;\n        this._fov = fov;\n    }\n    get propertyChangedObservable() {\n        if (!this._propertyChangedObservable)\n            this._propertyChangedObservable = new Observable();\n        return this._propertyChangedObservable;\n    }\n    get position() {\n        return this._position;\n    }\n    set position(value) {\n        if (this._position !== value) {\n            const old = this._position;\n            this._position = value;\n            if (this._propertyChangedObservable?.hasObservers()) {\n                const e = new PropertyChangedEventArgs(this, old, this._position, CameraState.POSITION_PROPERTY_NAME);\n                this._propertyChangedObservable.notifyObservers(e, -1, this, this);\n            }\n        }\n    }\n    get target() {\n        return this._target;\n    }\n    set target(value) {\n        if (this._target !== value) {\n            const old = this._target;\n            this._target = value;\n            if (this._propertyChangedObservable?.hasObservers()) {\n                const e = new PropertyChangedEventArgs(this, old, this._target, CameraState.TARGET_PROPERTY_NAME);\n                this._propertyChangedObservable.notifyObservers(e, -1, this, this);\n            }\n        }\n    }\n    get fov() {\n        return this._fov;\n    }\n    set fov(value) {\n        if (this._fov !== value) {\n            const old = this._fov;\n            this._fov = value;\n            if (this._propertyChangedObservable?.hasObservers()) {\n                const e = new PropertyChangedEventArgs(this, old, this._fov, CameraState.TARGET_PROPERTY_NAME);\n                this._propertyChangedObservable.notifyObservers(e, -1, this, this);\n            }\n        }\n    }\n    get tanfov2() {\n        if (!this._tanfov2) {\n            this._tanfov2 = Math.tan((this._fov * Math.PI) / 360);\n        }\n        return this._tanfov2;\n    }\n}\nCameraState.POSITION_PROPERTY_NAME = \"position\";\nCameraState.TARGET_PROPERTY_NAME = \"target\";\nCameraState.FOV_PROPERTY_NAME = \"fov\";\n//# sourceMappingURL=tiles.navigation.state.camera.js.map","import { PropertyChangedEventArgs, Observable } from \"../../events\";\nimport { ValidableBase } from \"../../validable\";\nimport { Cartesian2 } from \"../../geometry\";\nimport { IsLocation, Bearing, Geo2 } from \"../../geography\";\nimport { TileSystemBounds } from \"../tiles.system\";\nimport { TileNavigationStateSynchronizer } from \"./tiles.navigation.state.sync\";\nexport class TileNavigationState extends ValidableBase {\n    static GetLodScale(lod) {\n        let lodOffset = (lod * 1000 - Math.round(lod) * 1000) / 1000;\n        let scale = lodOffset < 0 ? 1 + lodOffset / 2 : 1 + lodOffset;\n        return scale;\n    }\n    constructor(center, lod, azimuth, bounds) {\n        super();\n        this._cartesianCache = Cartesian2.Zero();\n        this._lodf = lod ?? 0;\n        this._center = center ? (IsLocation(center) ? new Geo2(center?.lat ?? 0, center?.lon ?? 0) : new Geo2(center[0] ?? 0, center[1] ?? 0)) : Geo2.Zero();\n        this._azimuth = new Bearing(azimuth ?? 0);\n        this._bounds = bounds ?? new TileSystemBounds();\n        this._boundsObserver = this._bounds.propertyChangedObservable.add(this._boundsPropertyChanged.bind(this));\n        this._lod = Math.round(this._lodf);\n        this._scale = TileNavigationState.GetLodScale(this._lodf);\n        this._sync = null;\n    }\n    clone() {\n        return new TileNavigationState(this._center, this._lod, this._azimuth.value, this._bounds);\n    }\n    dispose() {\n        this._boundsObserver?.disconnect;\n        this._boundsObserver = null;\n        if (this._sync) {\n            this._sync.dispose();\n            this._sync = null;\n        }\n    }\n    get lod() {\n        return this._lod;\n    }\n    get scale() {\n        return this._scale;\n    }\n    get center() {\n        return this._center;\n    }\n    set center(center) {\n        center = center ?? Geo2.Zero();\n        const lat = Math.min(Math.max(center.lat, this._bounds.minLatitude), this._bounds.maxLatitude);\n        const lon = Math.min(Math.max(center.lon, this._bounds.minLongitude), this._bounds.maxLongitude);\n        if (this._center.lat != lat || this._center.lon != lon) {\n            if (this._propertyChangedObservable?.hasObservers()) {\n                const old = this._center.clone();\n                this._center.lat = lat;\n                this._center.lon = lon;\n                const e = new PropertyChangedEventArgs(this, old, this._center.clone(), TileNavigationState.CENTER_PROPERTY_NAME);\n                this._propertyChangedObservable.notifyObservers(e, -1, this, this);\n                this.invalidate();\n                return;\n            }\n            this._center.lat = lat;\n            this._center.lon = lon;\n            this.invalidate();\n        }\n    }\n    get zoom() {\n        return this._lodf;\n    }\n    set zoom(lodf) {\n        lodf = Math.min(Math.max(lodf, this._bounds.minLOD), this._bounds.maxLOD);\n        if (this._lodf != lodf) {\n            const old = this._lodf;\n            this._lodf = lodf;\n            const lod = Math.round(this._lodf);\n            let event = null;\n            if (this._lod != lod) {\n                const oldLod = this._lod;\n                this._lod = lod;\n                if (this._propertyChangedObservable && this._propertyChangedObservable.hasObservers()) {\n                    event = new PropertyChangedEventArgs(this, oldLod, this._lod, TileNavigationState.LOD_PROPERTY_NAME);\n                }\n            }\n            this._scale = TileNavigationState.GetLodScale(this._lodf);\n            this.invalidate();\n            if (this._propertyChangedObservable && this._propertyChangedObservable.hasObservers()) {\n                if (event) {\n                    this._propertyChangedObservable.notifyObservers(event, -1, this, this);\n                }\n                event = new PropertyChangedEventArgs(this, old, this._lodf, TileNavigationState.ZOOM_PROPERTY_NAME);\n                this._propertyChangedObservable.notifyObservers(event, -1, this, this);\n            }\n        }\n    }\n    get azimuth() {\n        return this._azimuth;\n    }\n    set azimuth(r) {\n        if (this._azimuth.value != r.value) {\n            const old = this._azimuth;\n            this._azimuth = r;\n            this.invalidate();\n            if (this._propertyChangedObservable?.hasObservers()) {\n                const e = new PropertyChangedEventArgs(this, old, this._azimuth, TileNavigationState.AZIMUTH_PROPERTY_NAME);\n                this._propertyChangedObservable.notifyObservers(e, -1, this, this);\n            }\n        }\n    }\n    get camera() {\n        return this._camera;\n    }\n    set camera(c) {\n        if (this._camera !== c) {\n            const old = this._camera;\n            this._camera = c;\n            this.invalidate();\n            if (this._propertyChangedObservable?.hasObservers()) {\n                const e = new PropertyChangedEventArgs(this, old, this._camera, TileNavigationState.CAMERA_PROPERTY_NAME);\n                this._propertyChangedObservable.notifyObservers(e, -1, this, this);\n            }\n        }\n    }\n    get bounds() {\n        return this._bounds;\n    }\n    set bounds(bounds) {\n        if (this._bounds !== bounds) {\n            this._boundsObserver?.disconnect;\n            const old = this._bounds;\n            this._bounds = bounds;\n            this._boundsObserver = this._bounds.propertyChangedObservable.add(this._boundsPropertyChanged.bind(this));\n            this.invalidate();\n            if (this._propertyChangedObservable?.hasObservers()) {\n                const e = new PropertyChangedEventArgs(this, old, this._bounds, TileNavigationState.BOUNDS_PROPERTY_NAME);\n                this._propertyChangedObservable.notifyObservers(e, -1, this, this);\n            }\n        }\n    }\n    get propertyChangedObservable() {\n        if (!this._propertyChangedObservable)\n            this._propertyChangedObservable = new Observable();\n        return this._propertyChangedObservable;\n    }\n    copy(other) {\n        this.center = other.center;\n        this.azimuth = new Bearing(other.azimuth.value);\n        this.zoom = other.zoom;\n        return this;\n    }\n    syncWith(state) {\n        if (this._sync) {\n            this._sync.dispose();\n            this._sync = null;\n        }\n        if (state) {\n            this.copy(state).validate();\n            this._sync = new TileNavigationStateSynchronizer(state, this);\n        }\n        return this;\n    }\n    toString() {\n        return `center: ${this.center}, zoom: ${this.zoom}, azimuth: ${this.azimuth}`;\n    }\n    _boundsPropertyChanged(e, state) { }\n}\nTileNavigationState.CENTER_PROPERTY_NAME = \"center\";\nTileNavigationState.ZOOM_PROPERTY_NAME = \"zoom\";\nTileNavigationState.LOD_PROPERTY_NAME = \"lod\";\nTileNavigationState.AZIMUTH_PROPERTY_NAME = \"azimuth\";\nTileNavigationState.BOUNDS_PROPERTY_NAME = \"bounds\";\nTileNavigationState.CAMERA_PROPERTY_NAME = \"camera\";\n//# sourceMappingURL=tiles.navigation.state.js.map","export class TileNavigationStateSynchronizer {\n    constructor(source, target, enabled = true) {\n        this._source = source;\n        this._target = target;\n        this._enabled = enabled;\n        this._sourceChangedObserver = this._source.validationObservable?.add(this._onSourceValidation.bind(this));\n        this._propertyChangedObserver = this._source.propertyChangedObservable.add(this._onSourcePropertyChanged.bind(this));\n    }\n    dispose() {\n        this._sourceChangedObserver?.disconnect();\n        this._propertyChangedObserver?.disconnect();\n    }\n    get source() {\n        return this._source;\n    }\n    get target() {\n        return this._target;\n    }\n    get enabled() {\n        return this._enabled;\n    }\n    set enabled(v) {\n        this._enabled = v;\n    }\n    _onSourceValidation(state, eventState) {\n        if (state && this._enabled) {\n            this._target.validate();\n        }\n    }\n    _onSourcePropertyChanged(property, eventState) {\n        if (this._enabled && property.propertyName) {\n            this._target[property.propertyName] = property.newValue;\n        }\n    }\n}\n//# sourceMappingURL=tiles.navigation.state.sync.js.map","export * from \"./tiles.pipeline.interfaces\";\nexport * from \"./tiles.pipeline.link\";\nexport * from \"./tiles.pipeline.target.proxy\";\n//# sourceMappingURL=index.js.map","export function IsTargetBlock(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return b.added !== undefined || b.removed !== undefined || b.updated !== undefined;\n}\nexport function hasTileSelectionContext(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return b.setContext !== undefined;\n}\nexport function isViewProxy(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return b.view !== undefined;\n}\n//# sourceMappingURL=tiles.pipeline.interfaces.js.map","export class TilePipelineLink {\n    constructor(source, target, options) {\n        this._source = source;\n        this._target = target;\n        this._options = options;\n        this._addedObserver = source.addedObservable.add(this.forwardAdded.bind(this));\n        this._removedObserver = source.removedObservable.add(this.forwardRemoved.bind(this));\n        this._updatedObserver = source.updatedObservable.add(this.forwardUpdated.bind(this));\n    }\n    get source() {\n        return this._source;\n    }\n    get target() {\n        return this._target;\n    }\n    get options() {\n        return this._options;\n    }\n    dispose() {\n        this._addedObserver?.disconnect();\n        this._removedObserver?.disconnect();\n        this._updatedObserver?.disconnect();\n        this._addedObserver = null;\n        this._removedObserver = null;\n        this._updatedObserver = null;\n    }\n    forwardAdded(eventData, eventState) {\n        if (this._target && this._target.added) {\n            const filter = this._options?.acceptAdded ?? this.options?.accept;\n            eventData = filter ? this._filter(eventData, filter) : eventData;\n            this._target.added(eventData, eventState);\n        }\n    }\n    forwardRemoved(eventData, eventState) {\n        if (this._target && this._target.removed) {\n            const filter = this._options?.acceptRemoved ?? this.options?.accept;\n            eventData = filter ? this._filter(eventData, filter) : eventData;\n            this._target.removed(eventData, eventState);\n        }\n    }\n    forwardUpdated(eventData, eventState) {\n        if (this._target && this._target.updated) {\n            const filter = this._options?.acceptUpdated ?? this.options?.accept;\n            eventData = filter ? this._filter(eventData, filter) : eventData;\n            this._target.updated(eventData, eventState);\n        }\n    }\n    _filter(eventData, filter) {\n        const filtered = [];\n        for (let i = 0; i != eventData.length; i++) {\n            const d = eventData[i];\n            if (filter(d)) {\n                filtered.push(d);\n            }\n        }\n        return filtered;\n    }\n}\n//# sourceMappingURL=tiles.pipeline.link.js.map","import { Observable } from \"../../events\";\nimport { TilePipelineLink } from \"./tiles.pipeline.link\";\nexport class SourceBlock {\n    constructor() {\n        this._links = [];\n    }\n    dispose() {\n        for (const l of this._links) {\n            l.dispose();\n        }\n        this._links = [];\n    }\n    get addedObservable() {\n        this._addedObservable = this._addedObservable || new Observable();\n        return this._addedObservable;\n    }\n    get removedObservable() {\n        this._removedObservable = this._removedObservable || new Observable();\n        return this._removedObservable;\n    }\n    get updatedObservable() {\n        this._updatedObservable = this._updatedObservable || new Observable();\n        return this._updatedObservable;\n    }\n    linkTo(target, options) {\n        if (this._links.findIndex((l) => l.target === target) === -1) {\n            const link = new TilePipelineLink(this, target, options);\n            this._links.push(link);\n        }\n    }\n    unlinkFrom(target) {\n        const i = this._links.findIndex((l) => l.target === target);\n        if (i !== -1) {\n            const l = this._links.splice(i)[0];\n            l.dispose();\n            return l;\n        }\n        return undefined;\n    }\n}\n//# sourceMappingURL=tiles.pipeline.sourceblock.js.map","export class TargetProxy {\n    constructor(added, removed, updated) {\n        this._added = added;\n        this._removed = removed;\n        this._updated = updated;\n    }\n    get added() {\n        return this._added;\n    }\n    get removed() {\n        return this._removed;\n    }\n    get updated() {\n        return this._updated;\n    }\n}\n//# sourceMappingURL=tiles.pipeline.target.proxy.js.map","export * from \"./tiles.provider.content\";\nexport * from \"./tiles.provider.abstract\";\nexport * from \"./tiles.provider\";\n//# sourceMappingURL=index.js.map","import { IsTileConstructor } from \"../tiles.interfaces\";\nimport { EventState, Observable } from \"../../events/events.observable\";\nimport { TileCollection } from \"../tiles.collection\";\nimport { TileBuilder } from \"../tiles.builder\";\nimport { TilePipelineLink } from \"../pipeline\";\nimport { ValidableBase } from \"../../validable\";\nexport class AbstractTileProvider extends ValidableBase {\n    constructor(factory, enabled = true) {\n        super();\n        this._links = [];\n        if (factory && IsTileConstructor(factory)) {\n            this._factory = this._buildFactory(factory) ?? this._buildFactoryInternal(factory);\n        }\n        else {\n            this._factory = factory ?? this._buildFactory() ?? this._buildFactoryInternal();\n        }\n        this._enabled = enabled;\n        this._activTiles = new TileCollection();\n        this._callback = this._onContentFetched.bind(this);\n    }\n    get geoBounds() {\n        return this._activTiles?.geoBounds;\n    }\n    get boundingBox() {\n        return this._activTiles?.boundingBox;\n    }\n    get enabledObservable() {\n        this._enabledObservable = this._enabledObservable || new Observable();\n        return this._enabledObservable;\n    }\n    get enabled() {\n        return this._enabled;\n    }\n    set enabled(v) {\n        if (this._enabled !== v) {\n            this._enabled = v;\n            if (this._enabledObservable && this._enabledObservable.hasObservers()) {\n                this._enabledObservable.notifyObservers(this, -1, this, this);\n            }\n        }\n    }\n    get metrics() {\n        return this.factory.metrics;\n    }\n    get namespace() {\n        return this.factory.namespace;\n    }\n    get factory() {\n        return this._factory;\n    }\n    dispose() {\n        this._activTiles?.clear();\n    }\n    get activTiles() {\n        return Array.from(this._activTiles);\n    }\n    getTile(a) {\n        return this._activTiles.get(a);\n    }\n    hasTile(a) {\n        return this._activTiles.has(a);\n    }\n    get updatedObservable() {\n        this._updateObservable = this._updateObservable || new Observable();\n        return this._updateObservable;\n    }\n    get addedObservable() {\n        this._addedObservable = this._addedObservable || new Observable();\n        return this._addedObservable;\n    }\n    get removedObservable() {\n        this._removedObservable = this._removedObservable || new Observable();\n        return this._removedObservable;\n    }\n    linkTo(target, options, ...args) {\n        if (this._links.findIndex((l) => l.target === target) === -1) {\n            const link = new TilePipelineLink(this, target, options);\n            this._links.push(link);\n            this._onLinked(link);\n        }\n    }\n    _onLinked(link) {\n        link.forwardAdded(Array.from(this._activTiles), new EventState(-1, false, this, this));\n    }\n    unlinkFrom(target) {\n        const i = this._links.findIndex((l) => l.target === target);\n        if (i !== -1) {\n            const l = this._links.splice(i)[0];\n            this._onUnlinked(l);\n            l.dispose();\n            return l;\n        }\n        return undefined;\n    }\n    _onUnlinked(link) { }\n    added(eventData, eventState) {\n        const tiles = this._onTileAddressesAdded(eventData, eventState);\n        if (tiles.length) {\n            this.invalidate();\n            if (tiles.length === 1) {\n                this._onTileAdded(tiles[0]);\n            }\n            else {\n                this._onTilesAdded(tiles);\n            }\n            if (this._addedObservable && this._addedObservable.hasObservers()) {\n                this._addedObservable.notifyObservers(tiles, -1, this, this);\n            }\n        }\n    }\n    removed(eventData, eventState) {\n        const tiles = this._onTileAddressesRemoved(eventData, eventState);\n        if (tiles.length) {\n            this.invalidate();\n            if (tiles.length === 1) {\n                this._onTileRemoved(tiles[0]);\n            }\n            else {\n                this._onTilesRemoved(tiles);\n            }\n            if (this._removedObservable && this._removedObservable.hasObservers()) {\n                this._removedObservable?.notifyObservers(tiles, -1, this, this);\n            }\n        }\n    }\n    updated(eventData, eventState) {\n    }\n    _onTileAddressesAdded(address, eventState) {\n        const toActivate = address.length === 0 ? [...(this._activTiles ?? [])].map((t) => t.address) : address;\n        const tiles = new Array();\n        for (const a of toActivate ?? []) {\n            const t = this._activTiles?.get(a);\n            if (t) {\n                tiles.push(t);\n                continue;\n            }\n            const factory = this._factory.withAddress(a);\n            try {\n                let tile = factory.build();\n                if (tile) {\n                    tile = this._fetchContent(tile, this._callback);\n                    this._activTiles?.add(tile);\n                    tiles.push(tile);\n                }\n            }\n            catch (e) {\n                console.log(e);\n            }\n        }\n        return tiles;\n    }\n    _onTileAddressesRemoved(address, eventState) {\n        if (this._activTiles && this._activTiles.count) {\n            const tiles = new Array();\n            for (const a of address ?? []) {\n                const t = this._activTiles?.get(a);\n                if (t) {\n                    tiles.push(t);\n                    this._activTiles?.remove(a);\n                }\n            }\n            return tiles;\n        }\n        return [];\n    }\n    _onContentFetched(tile) {\n        this.invalidate();\n        this._onTileUpdated(tile);\n        if (this.updatedObservable?.hasObservers()) {\n            this.updatedObservable.notifyObservers([tile], -1, this, this);\n        }\n    }\n    _buildFactory(type) {\n        return this._buildFactoryInternal(type);\n    }\n    _onTilesAdded(tiles) {\n        for (const t of tiles) {\n            this._onTileAdded(t);\n        }\n    }\n    _onTileAdded(tiles) { }\n    _onTilesRemoved(tiles) {\n        for (const t of tiles) {\n            this._onTileRemoved(t);\n        }\n    }\n    _onTileRemoved(tiles) { }\n    _onTilesUpdated(tiles) {\n        for (const t of tiles) {\n            this._onTileUpdated(t);\n        }\n    }\n    _onTileUpdated(tiles) { }\n    _buildFactoryInternal(type) {\n        const b = new TileBuilder();\n        return type ? b.withType(type) : b;\n    }\n}\n//# sourceMappingURL=tiles.provider.abstract.js.map","import { MemoryCache } from \"../../cache/cache\";\nimport { TileAddress } from \"../address/tiles.address\";\nexport class TileContentProvider {\n    constructor(datasource, cache) {\n        this._datasource = datasource;\n        this._cache = cache || new MemoryCache();\n        if (cache) {\n            this._prefix = this._buildPrefix();\n            this._ownCache = false;\n        }\n        else {\n            this._ownCache = true;\n        }\n    }\n    accept(address) {\n        return TileAddress.IsValidAddress(address, this.metrics);\n    }\n    get name() {\n        return this._datasource.name;\n    }\n    get datasource() {\n        return this._datasource;\n    }\n    get metrics() {\n        return this._datasource.metrics;\n    }\n    dispose() {\n        if (this._prefix && !this._ownCache) {\n            const p = this._prefix;\n            this._cache.clear((k) => k.startsWith(p));\n            return;\n        }\n        this._cache.clear();\n    }\n    fetchContent(tile, callback) {\n        const address = tile.address;\n        const cacheKey = this._buildCacheKey(address.quadkey);\n        if (this._cache.contains(cacheKey)) {\n            tile.content = this._cache.get(cacheKey);\n            return tile;\n        }\n        let c = this._buildTemporaryContent(address);\n        this._cache.set(cacheKey, c);\n        this._datasource.fetchAsync(address, tile).then((result) => {\n            if (result.ok) {\n                this._cache.set(this._buildCacheKey(address.quadkey), result.content);\n                tile.content = result.content;\n                callback?.(tile);\n            }\n            else {\n                console.log(`the fetch operation has failed because of ${result.statusText}`);\n                callback?.(tile);\n            }\n        }, (reason) => {\n            console.log(`the fetch operation has failed because of ${reason}`);\n            callback?.(tile);\n        });\n        tile.content = c;\n        return tile;\n    }\n    _buildTemporaryContent(address) {\n        return null;\n    }\n    _buildAlternativContent(address) {\n        return null;\n    }\n    _buildPrefix() {\n        let p = `${this.name}_${Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)}_`;\n        while (this._cache?.any((k) => k.startsWith(p))) {\n            p = `${this.name}_${Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)}_`;\n        }\n        return p;\n    }\n    _buildCacheKey(key) {\n        return this._prefix ? `${key}` : `${this._prefix}${key}`;\n    }\n}\n//# sourceMappingURL=tiles.provider.content.js.map","import { AbstractTileProvider } from \"./tiles.provider.abstract\";\nexport class TileProvider extends AbstractTileProvider {\n    constructor(provider, factory, enabled = true) {\n        super(factory, enabled);\n        this.factory.withMetrics(provider.metrics).withNamespace(provider.name);\n        this._contentProvider = provider;\n    }\n    _fetchContent(tile, callback) {\n        return this._contentProvider.fetchContent(tile, callback);\n    }\n}\n//# sourceMappingURL=tiles.provider.js.map","import { Tile } from \"./tiles\";\nexport class TileBuilder {\n    static SharedBuilder() {\n        return new TileBuilder();\n    }\n    get metrics() {\n        return this._m;\n    }\n    get namespace() {\n        return this._ns ?? \"\";\n    }\n    withNamespace(namespace) {\n        this._ns = namespace;\n        return this;\n    }\n    withAddress(a) {\n        this._a = a;\n        return this;\n    }\n    withData(d) {\n        this._d = d;\n        return this;\n    }\n    withMetrics(metrics) {\n        this._m = metrics;\n        return this;\n    }\n    withType(type) {\n        this._t = type;\n        return this;\n    }\n    build() {\n        const type = this._t ?? (Tile);\n        const t = new type(this._a?.x || 0, this._a?.y || 0, this._a?.levelOfDetail || this._m?.minLOD || 0, this._d || null);\n        if (this._m) {\n            t.geoBounds = Tile.BuildEnvelope(t, this._m);\n            t.boundingBox = Tile.BuildBounds(t, this._m);\n        }\n        return t;\n    }\n}\n//# sourceMappingURL=tiles.builder.js.map","import { TileAddress } from \"./address/tiles.address\";\nimport { FetchError, FetchResult, WebClient } from \"../io\";\nexport class TileWebClient extends WebClient {\n    constructor(name, urlFactory, codec, metrics, options) {\n        super(name, codec, urlFactory, options);\n        this._metrics = metrics;\n        this._zindex = 0;\n    }\n    get zindex() {\n        return this._zindex;\n    }\n    set zindex(v) {\n        this._zindex = v;\n    }\n    get metrics() {\n        return this._metrics;\n    }\n    async fetchAsync(request, env, ...userArgs) {\n        if (!request) {\n            throw new FetchError(`invalid request parameter.`);\n        }\n        if (TileAddress.IsValidAddress(request, this._metrics) === false) {\n            return FetchResult.Null(request, userArgs);\n        }\n        return super.fetchAsync(request, env, ...userArgs);\n    }\n}\n//# sourceMappingURL=tiles.client.js.map","import { IsEnvelope } from \"../geography/geography.interfaces\";\nimport { TileAddress } from \"./address/tiles.address\";\nimport { Envelope } from \"../geography/geography.envelope\";\nimport { Bounds } from \"../geometry\";\nexport class TileCollection {\n    static Empty() {\n        return new TileCollection();\n    }\n    constructor(...items) {\n        this._items = items;\n    }\n    get namespace() {\n        return this._ns ?? \"\";\n    }\n    set namespace(ns) {\n        this._ns = ns;\n    }\n    get count() {\n        return this._items.length;\n    }\n    get index() {\n        if (!this._index) {\n            this._index = this._buildIndex();\n        }\n        return this._index;\n    }\n    get geoBounds() {\n        if (!this._bounds) {\n            this._bounds = this._buildBounds();\n        }\n        return this._bounds;\n    }\n    get boundingBox() {\n        if (!this._rect) {\n            this._rect = this._buildRect();\n        }\n        return this._rect;\n    }\n    has(address) {\n        return this.index.has(address.quadkey);\n    }\n    get(address) {\n        return this.index.get(address.quadkey);\n    }\n    getAll(...address) {\n        return address.map((a) => this.get(a));\n    }\n    add(tile) {\n        if (!this.has(tile.address)) {\n            this._items.push(tile);\n            this._index?.set(tile.quadkey, tile);\n            const b = tile.geoBounds;\n            if (b && this._bounds) {\n                this._bounds.unionInPlace(b);\n            }\n            const r = tile.boundingBox;\n            if (r && this._rect) {\n                this._rect.unionInPlace(r);\n            }\n        }\n    }\n    addAll(...tiles) {\n        for (const t of tiles) {\n            this.add(t);\n        }\n    }\n    remove(address) {\n        if (this.has(address)) {\n            const index = this._items.findIndex((t) => TileAddress.IsEquals(t.address, address));\n            this._items.splice(index, 1);\n            this._bounds = undefined;\n            this._rect = undefined;\n            this._index?.delete(address.quadkey);\n        }\n    }\n    removeAll(...address) {\n        for (const a of address) {\n            this.remove(a);\n        }\n    }\n    clear() {\n        this._items = [];\n        this._bounds = undefined;\n        this._rect = undefined;\n    }\n    intersect(bounds) {\n        if (!bounds)\n            return this[Symbol.iterator]();\n        let pointer = 0;\n        let items = this._items;\n        if (IsEnvelope(bounds)) {\n            if (this.geoBounds?.intersects(bounds)) {\n                return {\n                    next() {\n                        while (pointer < items.length) {\n                            let item = items[pointer++];\n                            let b = item.geoBounds;\n                            if (!b || bounds.intersects(b)) {\n                                return {\n                                    done: false,\n                                    value: item,\n                                };\n                            }\n                        }\n                        return {\n                            done: true,\n                            value: null,\n                        };\n                    },\n                    [Symbol.iterator]() {\n                        return this;\n                    },\n                };\n            }\n        }\n        else {\n            if (this.boundingBox?.intersects(bounds)) {\n                return {\n                    next() {\n                        while (pointer < items.length) {\n                            let item = items[pointer++];\n                            let r = item.boundingBox;\n                            if (!r || bounds.intersects(r)) {\n                                return {\n                                    done: false,\n                                    value: item,\n                                };\n                            }\n                        }\n                        return {\n                            done: true,\n                            value: null,\n                        };\n                    },\n                    [Symbol.iterator]() {\n                        return this;\n                    },\n                };\n            }\n        }\n        return {\n            next() {\n                return {\n                    done: true,\n                    value: null,\n                };\n            },\n            [Symbol.iterator]() {\n                return this;\n            },\n        };\n    }\n    [Symbol.iterator]() {\n        let pointer = 0;\n        let items = this._items;\n        const iterator = {\n            next() {\n                if (pointer < items.length) {\n                    return {\n                        done: false,\n                        value: items[pointer++],\n                    };\n                }\n                return {\n                    done: true,\n                    value: null,\n                };\n            },\n            [Symbol.iterator]() {\n                return this;\n            },\n        };\n        return iterator;\n    }\n    _buildIndex() {\n        const index = new Map();\n        for (let i = 0; i < this._items.length; i++) {\n            const t = this._items[i];\n            index.set(t.quadkey, t);\n        }\n        return index;\n    }\n    _buildBounds() {\n        return Envelope.FromEnvelopes(...this._items);\n    }\n    _buildRect() {\n        return Bounds.FromBounds(...this._items);\n    }\n}\n//# sourceMappingURL=tiles.collection.js.map","export function IsTileAddress(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return b.x !== undefined && b.y !== undefined && b.levelOfDetail !== undefined;\n}\nexport function IsArrayOfTileAddress(b) {\n    if (Array.isArray(b) && b.length) {\n        for (let i = 0; i != b.length; i++) {\n            if (IsTileAddress(b[i])) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\nexport var NeighborsAddress;\n(function (NeighborsAddress) {\n    NeighborsAddress[NeighborsAddress[\"NW\"] = 0] = \"NW\";\n    NeighborsAddress[NeighborsAddress[\"N\"] = 1] = \"N\";\n    NeighborsAddress[NeighborsAddress[\"NE\"] = 2] = \"NE\";\n    NeighborsAddress[NeighborsAddress[\"W\"] = 3] = \"W\";\n    NeighborsAddress[NeighborsAddress[\"A\"] = 4] = \"A\";\n    NeighborsAddress[NeighborsAddress[\"E\"] = 5] = \"E\";\n    NeighborsAddress[NeighborsAddress[\"SW\"] = 6] = \"SW\";\n    NeighborsAddress[NeighborsAddress[\"S\"] = 7] = \"S\";\n    NeighborsAddress[NeighborsAddress[\"SE\"] = 8] = \"SE\";\n})(NeighborsAddress || (NeighborsAddress = {}));\nexport function IsTile(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return b.address !== undefined && b.content !== undefined;\n}\nexport function IsArrayOfTile(b) {\n    if (Array.isArray(b) && b.length) {\n        for (let i = 0; i != b.length; i++) {\n            if (IsTile(b[i])) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\nexport function IsTileConstructor(obj) {\n    return typeof obj === \"function\" && !!obj.prototype && \"value\" in obj.prototype;\n}\nexport function IsTileCollection(b) {\n    if (typeof b !== \"object\" || b === null)\n        return false;\n    return (b.count !== undefined &&\n        b.has !== undefined &&\n        b.get !== undefined &&\n        b.getAll !== undefined &&\n        b.add !== undefined &&\n        b.addAll !== undefined &&\n        b.remove !== undefined &&\n        b.removeAll !== undefined &&\n        b.clear !== undefined &&\n        b.intersect !== undefined);\n}\nexport var CellCoordinateReference;\n(function (CellCoordinateReference) {\n    CellCoordinateReference[CellCoordinateReference[\"CENTER\"] = 0] = \"CENTER\";\n    CellCoordinateReference[CellCoordinateReference[\"NW\"] = 1] = \"NW\";\n    CellCoordinateReference[CellCoordinateReference[\"NE\"] = 2] = \"NE\";\n    CellCoordinateReference[CellCoordinateReference[\"SW\"] = 3] = \"SW\";\n    CellCoordinateReference[CellCoordinateReference[\"SE\"] = 4] = \"SE\";\n})(CellCoordinateReference || (CellCoordinateReference = {}));\nexport function IsTileSystemBounds(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return (b.minLOD !== undefined &&\n        b.maxLOD !== undefined &&\n        b.minLatitude !== undefined &&\n        b.maxLatitude !== undefined &&\n        b.minLongitude !== undefined &&\n        b.maxLongitude !== undefined);\n}\nexport function IsTileMetricsProvider(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return b.metrics !== undefined;\n}\nexport function IsTileDatasource(b) {\n    if (b === null || typeof b !== \"object\")\n        return false;\n    return b.fetchAsync !== undefined && b.metrics !== undefined;\n}\n//# sourceMappingURL=tiles.interfaces.js.map","import { Envelope } from \"../geography\";\nimport { TileAddress } from \"./address/tiles.address\";\nimport { Bounds } from \"../geometry\";\nexport class Tile extends TileAddress {\n    static BuildEnvelope(t, metrics) {\n        if (metrics) {\n            if (metrics.geoBoundsFactory) {\n                const b = metrics.geoBoundsFactory(t, metrics);\n                if (b) {\n                    return b;\n                }\n            }\n            const a = t.address;\n            const nw = metrics.getTileXYToLatLon(a.x, a.y, a.levelOfDetail);\n            const se = metrics.getTileXYToLatLon(a.x + 1, a.y + 1, a.levelOfDetail);\n            return Envelope.FromPoints(nw, se);\n        }\n        return undefined;\n    }\n    static BuildBounds(t, metrics) {\n        if (metrics) {\n            if (metrics.boundsFactory) {\n                const b = metrics.boundsFactory(t, metrics);\n                if (b) {\n                    return b;\n                }\n            }\n            const a = t.address;\n            const p = metrics.getTileXYToPointXY(a.x, a.y);\n            return new Bounds(p.x, p.y, metrics.tileSize, metrics.tileSize);\n        }\n        return undefined;\n    }\n    constructor(x, y, levelOfDetail, data = null, metrics) {\n        super(x, y, levelOfDetail);\n        this._value = data;\n        if (metrics) {\n            this._env = Tile.BuildEnvelope(this, metrics);\n            this._rect = Tile.BuildBounds(this, metrics);\n        }\n    }\n    get namespace() {\n        return this._ns || \"\";\n    }\n    set namespace(v) {\n        this._ns = v;\n    }\n    get address() {\n        return this;\n    }\n    get content() {\n        return this._value;\n    }\n    set content(v) {\n        this._value = v;\n    }\n    get geoBounds() {\n        return this._env;\n    }\n    set geoBounds(e) {\n        this._env = e;\n    }\n    get boundingBox() {\n        return this._rect;\n    }\n    set boundingBox(r) {\n        this._rect = r;\n    }\n}\n//# sourceMappingURL=tiles.js.map","import { CellCoordinateReference } from \"./tiles.interfaces\";\nimport { TileSystemBounds } from \"./tiles.system\";\nimport { PropertyChangedEventArgs } from \"../events\";\nimport { Cartesian2 } from \"../geometry\";\nimport { Geo2 } from \"../geography\";\nexport class AbstractTileMetrics extends TileSystemBounds {\n    constructor(options) {\n        super(options);\n        this._tileSize = AbstractTileMetrics.DefaultTileSize;\n        this._cellSize = AbstractTileMetrics.DefaultCellSize;\n        this._cellCoordinateReference = AbstractTileMetrics.DefaultCoordinateReference;\n        this._overlap = AbstractTileMetrics.DefaultOverlap;\n    }\n    mapSize(levelOfDetail) {\n        const result = this.tileSize * Math.pow(2, levelOfDetail);\n        return result >>> 0;\n    }\n    get tileSize() {\n        return this._tileSize;\n    }\n    set tileSize(v) {\n        if (this._tileSize !== v) {\n            const old = this._tileSize;\n            this._tileSize = v;\n            this._propertyChangedObservable?.notifyObservers(new PropertyChangedEventArgs(this, old, v, \"tileSize\"), -1, this, this);\n        }\n    }\n    get cellSize() {\n        return this._cellSize;\n    }\n    set cellSize(v) {\n        if (this._cellSize !== v) {\n            const old = this._cellSize;\n            this._cellSize = v;\n            this._propertyChangedObservable?.notifyObservers(new PropertyChangedEventArgs(this, old, v, \"cellSize\"), -1, this, this);\n        }\n    }\n    get cellCoordinateReference() {\n        return this._cellCoordinateReference;\n    }\n    set cellCoordinateReference(v) {\n        if (this._cellCoordinateReference !== v) {\n            const old = this._cellCoordinateReference;\n            this._cellCoordinateReference = v;\n            this._propertyChangedObservable?.notifyObservers(new PropertyChangedEventArgs(this, old, v, \"cellCoordinateReference\"), -1, this, this);\n        }\n    }\n    get overlap() {\n        return this._overlap;\n    }\n    set overlap(v) {\n        if (this._overlap !== v) {\n            const old = this._overlap;\n            this._overlap = v;\n            this._propertyChangedObservable?.notifyObservers(new PropertyChangedEventArgs(this, old, v, \"overlap\"), -1, this, this);\n        }\n    }\n    mapScale(latitude, levelOfDetail, pixelPerUnit) {\n        if (pixelPerUnit === 0)\n            return Infinity;\n        const d = this.groundResolution(latitude, levelOfDetail);\n        if (d === 0)\n            return Infinity;\n        return 1 / (d * pixelPerUnit);\n    }\n    getLatLonToTileXY(latitude, longitude, levelOfDetail) {\n        const c = Cartesian2.Zero();\n        this.getLatLonToTileXYToRef(latitude, longitude, levelOfDetail, c);\n        return c;\n    }\n    getTileXYToLatLon(x, y, levelOfDetail) {\n        const g = Geo2.Zero();\n        this.getTileXYToLatLonToRef(x, y, levelOfDetail, g);\n        return g;\n    }\n    getLatLonToPointXY(latitude, longitude, levelOfDetail) {\n        const c = Cartesian2.Zero();\n        this.getLatLonToPointXYToRef(latitude, longitude, levelOfDetail, c);\n        return c;\n    }\n    getPointXYToLatLon(x, y, levelOfDetail) {\n        const g = Geo2.Zero();\n        this.getPointXYToLatLonToRef(x, y, levelOfDetail, g);\n        return g;\n    }\n    getTileXYToPointXY(x, y) {\n        const c = Cartesian2.Zero();\n        this.getTileXYToPointXYToRef(x, y, c);\n        return c;\n    }\n    getPointXYToTileXY(x, y) {\n        const c = Cartesian2.Zero();\n        this.getPointXYToTileXYToRef(x, y, c);\n        return c;\n    }\n}\nAbstractTileMetrics.DefaultTileSize = 256;\nAbstractTileMetrics.DefaultCellSize = 1;\nAbstractTileMetrics.DefaultCoordinateReference = CellCoordinateReference.CENTER;\nAbstractTileMetrics.DefaultOverlap = 0;\n//# sourceMappingURL=tiles.metrics.js.map","import { Projections } from \"../geography\";\nimport { Observable, PropertyChangedEventArgs } from \"../events\";\nexport class TileSystemBounds {\n    static Intersection(bounds) {\n        if (!bounds || bounds.length === 0) {\n            return null;\n        }\n        const result = bounds[0].clone();\n        for (let i = 1; i < bounds.length; i++) {\n            result.intersectionInPlace(bounds[i]);\n        }\n        return result;\n    }\n    static Union(bounds) {\n        if (!bounds || bounds.length === 0) {\n            return null;\n        }\n        const result = bounds[0].clone();\n        for (let i = 1; i < bounds.length; i++) {\n            result.unionInPlace(bounds[i]);\n        }\n        return result;\n    }\n    constructor(p) {\n        this._minLOD = TileSystemBounds.DefaultMinLOD;\n        this._maxLOD = TileSystemBounds.DefaultMaxLOD;\n        this._minLatitude = TileSystemBounds.DefaultMinLatitude;\n        this._maxLatitude = TileSystemBounds.DefaultMaxLatitude;\n        this._minLongitude = TileSystemBounds.DefaultMinLongitude;\n        this._maxLongitude = TileSystemBounds.DefaultMaxLongitude;\n        if (p) {\n            Object.assign(this, p);\n        }\n    }\n    get propertyChangedObservable() {\n        if (!this._propertyChangedObservable) {\n            this._propertyChangedObservable = new Observable();\n        }\n        return this._propertyChangedObservable;\n    }\n    unionInPlace(bounds) {\n        if (bounds) {\n            this.minLOD = Math.min(this.minLOD, bounds.minLOD);\n            this.maxLOD = Math.max(this.maxLOD, bounds.maxLOD);\n            this.minLatitude = Math.min(this.minLatitude, bounds.minLatitude);\n            this.maxLatitude = Math.max(this.maxLatitude, bounds.maxLatitude);\n            this.minLongitude = Math.min(this.minLongitude, bounds.minLongitude);\n            this.maxLongitude = Math.max(this.maxLongitude, bounds.maxLongitude);\n        }\n    }\n    copy(bounds) {\n        if (bounds) {\n            this.minLOD = bounds.minLOD;\n            this.maxLOD = bounds.maxLOD;\n            this.minLatitude = bounds.minLatitude;\n            this.maxLatitude = bounds.maxLatitude;\n            this.minLongitude = bounds.minLongitude;\n            this.maxLongitude = bounds.maxLongitude;\n        }\n    }\n    clone() {\n        return new TileSystemBounds(this);\n    }\n    intersectionInPlace(bounds) {\n        if (bounds) {\n            this.minLOD = Math.max(this.minLOD, bounds.minLOD);\n            this.maxLOD = Math.min(this.maxLOD, bounds.maxLOD);\n            this.minLatitude = Math.max(this.minLatitude, bounds.minLatitude);\n            this.maxLatitude = Math.min(this.maxLatitude, bounds.maxLatitude);\n            this.minLongitude = Math.max(this.minLongitude, bounds.minLongitude);\n            this.maxLongitude = Math.min(this.maxLongitude, bounds.maxLongitude);\n        }\n    }\n    get minLOD() {\n        return this._minLOD;\n    }\n    set minLOD(v) {\n        if (this._minLOD !== v) {\n            const old = this._minLOD;\n            this._minLOD = v;\n            this._propertyChangedObservable?.notifyObservers(new PropertyChangedEventArgs(this, old, v, \"minLOD\"), -1, this, this);\n        }\n    }\n    get maxLOD() {\n        return this._maxLOD;\n    }\n    set maxLOD(v) {\n        if (this._maxLOD !== v) {\n            const old = this._maxLOD;\n            this._maxLOD = v;\n            this._propertyChangedObservable?.notifyObservers(new PropertyChangedEventArgs(this, old, v, \"maxLOD\"), -1, this, this);\n        }\n    }\n    get minLatitude() {\n        return this._minLatitude;\n    }\n    set minLatitude(v) {\n        if (this._minLatitude !== v) {\n            const old = this._minLatitude;\n            this._minLatitude = v;\n            this._propertyChangedObservable?.notifyObservers(new PropertyChangedEventArgs(this, old, v, \"minLatitude\"), -1, this, this);\n        }\n    }\n    get maxLatitude() {\n        return this._maxLatitude;\n    }\n    set maxLatitude(v) {\n        if (this._maxLatitude !== v) {\n            const old = this._maxLatitude;\n            this._maxLatitude = v;\n            this._propertyChangedObservable?.notifyObservers(new PropertyChangedEventArgs(this, old, v, \"maxLatitude\"), -1, this, this);\n        }\n    }\n    get minLongitude() {\n        return this._minLongitude;\n    }\n    set minLongitude(v) {\n        if (this._minLongitude !== v) {\n            const old = this._minLongitude;\n            this._minLongitude = v;\n            this._propertyChangedObservable?.notifyObservers(new PropertyChangedEventArgs(this, old, v, \"minLongitude\"), -1, this, this);\n        }\n    }\n    get maxLongitude() {\n        return this._maxLongitude;\n    }\n    set maxLongitude(v) {\n        if (this._maxLongitude !== v) {\n            const old = this._maxLongitude;\n            this._maxLongitude = v;\n            this._propertyChangedObservable?.notifyObservers(new PropertyChangedEventArgs(this, old, v, \"maxLongitude\"), -1, this, this);\n        }\n    }\n}\nTileSystemBounds.DefaultLOD = 0;\nTileSystemBounds.DefaultMinLOD = 0;\nTileSystemBounds.DefaultMaxLOD = 23;\nTileSystemBounds.DefaultMinLatitude = Projections.WebMercatorMinLatitude;\nTileSystemBounds.DefaultMaxLatitude = Projections.WebMercatorMaxLatitude;\nTileSystemBounds.DefaultMinLongitude = -180;\nTileSystemBounds.DefaultMaxLongitude = 180;\nTileSystemBounds.Shared = new TileSystemBounds();\n//# sourceMappingURL=tiles.system.js.map","export class WebTileUrlBuilder {\n    constructor() { }\n    withSecure(v) {\n        this._isSecure = v;\n        return this;\n    }\n    withHost(v) {\n        this._host = v;\n        return this;\n    }\n    withPort(v) {\n        this._port = v;\n        return this;\n    }\n    withPath(v) {\n        this._path = v;\n        return this;\n    }\n    withQuery(v) {\n        this._query = v;\n        return this;\n    }\n    withExtension(v) {\n        this._extension = v;\n        return this;\n    }\n    withSubDomains(subdomains) {\n        this._subdomains = subdomains;\n        return this;\n    }\n    buildUrl(a, ...params) {\n        const scheme = this._isSecure ? \"https\" : \"http\";\n        const host = this._port ? `${this._host}:${this._port}` : `${this._host}`;\n        const query = this._query ? `?${this._query}` : \"\";\n        let template = `${scheme}://${host}/${this._path}${query}`;\n        if (this._extension) {\n            template = template.replaceAll(\"{extension}\", this._extension);\n        }\n        let str = template.replaceAll(\"{x}\", a.x.toString());\n        str = str.replaceAll(\"{y}\", a.y.toString());\n        str = str.replaceAll(\"{z}\", a.levelOfDetail.toString());\n        if (this._subdomains) {\n            let i = this._i ?? 0;\n            if (i >= this._subdomains.length) {\n                i = 0;\n            }\n            const s = this._subdomains[i];\n            str = str.replace(\"{s}\", s);\n            this._i = i + 1;\n        }\n        return str;\n    }\n}\n//# sourceMappingURL=tiles.url.web.js.map","export * from \"./tiles.vector.interfaces\";\nexport * from \"./tiles.vector.renderer\";\n//# sourceMappingURL=index.js.map","export var VectorTileGeomType;\n(function (VectorTileGeomType) {\n    VectorTileGeomType[VectorTileGeomType[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n    VectorTileGeomType[VectorTileGeomType[\"POINT\"] = 1] = \"POINT\";\n    VectorTileGeomType[VectorTileGeomType[\"LINESTRING\"] = 2] = \"LINESTRING\";\n    VectorTileGeomType[VectorTileGeomType[\"POLYGON\"] = 3] = \"POLYGON\";\n})(VectorTileGeomType || (VectorTileGeomType = {}));\n//# sourceMappingURL=tiles.vector.interfaces.js.map","import { PolylineSimplifier } from \"../../geometry\";\nimport { VectorTileGeomType } from \"./tiles.vector.interfaces\";\nimport { IsExpressionSpecification, LayerStyleTypes, } from \"./tiles.vector.style.interface\";\nexport class TileVectorRenderer {\n    constructor(style, simplifier) {\n        this._style = style;\n        this._simplifier = simplifier ?? PolylineSimplifier.Shared;\n        this._orderedStyleLayers = this._prepareOrderedLayers(style);\n    }\n    renderTile(tile, ctx, w, h, style) {\n        w = w ?? ctx.canvas.width;\n        h = h ?? ctx.canvas.height;\n        if (tile) {\n            style = style ?? this._style;\n            if (style) {\n                if (style !== this._style) {\n                    this._style = style;\n                    this._orderedStyleLayers = this._prepareOrderedLayers(style);\n                }\n                if (this._orderedStyleLayers) {\n                    for (const key of this._orderedStyleLayers) {\n                        const styleLayer = style.layers[key];\n                        const name = styleLayer.sourceLayer;\n                        const layer = tile.layers[name];\n                        if (layer && this._acceptLayer(name, layer, styleLayer)) {\n                            this._drawLayer(ctx, name, layer, w, h, styleLayer);\n                        }\n                    }\n                }\n            }\n        }\n    }\n    _prepareOrderedLayers(style) {\n        if (!style) {\n            return undefined;\n        }\n        const a = {};\n        const defaultSlot = this._generateUniqueSlotName();\n        const length = style.layers.length;\n        for (let i = 0; i < length; i++) {\n            const value = style.layers[i];\n            if (!value) {\n                continue;\n            }\n            const slot = value.slot ?? defaultSlot;\n            let group = a[slot];\n            if (!group) {\n                a[slot] = group = [];\n            }\n            group.push(i);\n        }\n        return Object.values(a).flat();\n    }\n    _generateUniqueSlotName() {\n        return `slot-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;\n    }\n    _drawLayer(ctx, key, layer, w, h, styleLayer) {\n        const extent = layer.extent;\n        const scalex = w / extent;\n        const scaley = h / extent;\n        ctx.save();\n        try {\n            switch (styleLayer.type) {\n                case LayerStyleTypes.Fill: {\n                    const paint = styleLayer.paint;\n                    if (!paint) {\n                        break;\n                    }\n                    const color = this._evaluate(paint.color);\n                    const outlineColor = this._evaluate(paint.outlineColor);\n                    if (!color && !outlineColor) {\n                        break;\n                    }\n                    if (color) {\n                        ctx.fillStyle = color;\n                    }\n                    if (outlineColor) {\n                        ctx.strokeStyle = outlineColor;\n                        ctx.lineWidth = TileVectorRenderer.DefaultLineWith;\n                    }\n                    const opacity = this._evaluate(paint.opacity) ?? TileVectorRenderer.DefaultOpacity;\n                    ctx.globalAlpha = opacity;\n                    const translate = this._evaluate(paint.translate);\n                    for (let i = 0; i < layer.length; i++) {\n                        const feature = layer.feature(i);\n                        if (feature && this._acceptFeature(feature, styleLayer)) {\n                            switch (feature.type) {\n                                case VectorTileGeomType.POLYGON: {\n                                    const transformed = this._getTransformedGeometry(feature, scalex, scaley, translate);\n                                    ctx.beginPath();\n                                    this._drawPath(ctx, transformed[0]);\n                                    if (transformed.length > 1) {\n                                        for (let i = 1; i < transformed.length; i++) {\n                                            this._drawPath(ctx, transformed[i]);\n                                        }\n                                    }\n                                    ctx.fill();\n                                    if (outlineColor) {\n                                        ctx.stroke();\n                                    }\n                                    break;\n                                }\n                                default:\n                                    break;\n                            }\n                        }\n                    }\n                    break;\n                }\n                case LayerStyleTypes.Line: {\n                    const paint = styleLayer.paint;\n                    if (!paint) {\n                        break;\n                    }\n                    const color = this._evaluate(paint.color);\n                    if (!color) {\n                        break;\n                    }\n                    ctx.strokeStyle = color;\n                    const opacity = this._evaluate(paint.opacity) ?? TileVectorRenderer.DefaultOpacity;\n                    ctx.globalAlpha = opacity;\n                    const width = this._evaluate(paint.width);\n                    ctx.lineWidth = width ?? TileVectorRenderer.DefaultLineWith;\n                    const dasharray = this._evaluate(paint.dashArray);\n                    if (dasharray) {\n                        ctx.setLineDash(dasharray);\n                    }\n                    const translate = this._evaluate(paint.translate);\n                    for (let i = 0; i < layer.length; i++) {\n                        const feature = layer.feature(i);\n                        if (feature && this._acceptFeature(feature, styleLayer)) {\n                            switch (feature.type) {\n                                case VectorTileGeomType.POLYGON:\n                                case VectorTileGeomType.LINESTRING: {\n                                    const transformed = this._getTransformedGeometry(feature, scalex, scaley, translate);\n                                    for (const line of transformed) {\n                                        ctx.beginPath();\n                                        this._drawPath(ctx, line);\n                                        ctx.stroke();\n                                    }\n                                    break;\n                                }\n                                default:\n                                    break;\n                            }\n                        }\n                    }\n                    break;\n                }\n                case LayerStyleTypes.Circle: {\n                    const paint = styleLayer.paint;\n                    if (!paint) {\n                        break;\n                    }\n                    const color = this._evaluate(paint.color);\n                    const outlineColor = this._evaluate(paint.strockeColor);\n                    if (!color && !outlineColor) {\n                        break;\n                    }\n                    if (color) {\n                        ctx.fillStyle = color;\n                    }\n                    const opacity = this._evaluate(paint.opacity) ?? TileVectorRenderer.DefaultOpacity;\n                    ctx.globalAlpha = opacity;\n                    if (outlineColor) {\n                        ctx.strokeStyle = outlineColor;\n                        ctx.lineWidth = TileVectorRenderer.DefaultLineWith;\n                    }\n                    const translate = this._evaluate(paint.translate);\n                    for (let i = 0; i < layer.length; i++) {\n                        const feature = layer.feature(i);\n                        if (feature && this._acceptFeature(feature, styleLayer)) {\n                            switch (feature.type) {\n                                case VectorTileGeomType.POINT: {\n                                    const transformed = this._getTransformedGeometry(feature, scalex, scaley, translate);\n                                    for (const point of transformed) {\n                                        ctx.beginPath();\n                                        ctx.arc(point[0].x, point[0].y, paint.radius, 0, 2 * Math.PI);\n                                        ctx.fill();\n                                        if (outlineColor) {\n                                            ctx.stroke();\n                                        }\n                                    }\n                                    break;\n                                }\n                                default: {\n                                    break;\n                                }\n                            }\n                        }\n                    }\n                    break;\n                }\n                default: {\n                    break;\n                }\n            }\n        }\n        finally {\n            ctx.restore();\n        }\n    }\n    _evaluate(p) {\n        if (IsExpressionSpecification(p)) {\n            return this._evaluateExpression(p);\n        }\n        return p;\n    }\n    _evaluateExpression(p) {\n        return undefined;\n    }\n    _getTransformedGeometry(feature, scalex, scaley, translate) {\n        const geom = feature.loadGeometry();\n        const transformed = [];\n        for (let i = 0; i < geom.length; i++) {\n            for (let j = 0; j < geom[i].length; j++) {\n                if (translate) {\n                    geom[i][j].x += translate[0];\n                    geom[i][j].y += translate[1];\n                }\n                geom[i][j].x *= scalex;\n                geom[i][j].y *= scaley;\n            }\n            transformed.push(this._simplifier.simplify(geom[i]));\n        }\n        return transformed;\n    }\n    _drawPolyline(ctx, points) {\n        this._drawPath(ctx, points);\n    }\n    _drawPolygon(ctx, points) { }\n    _drawPath(ctx, points) {\n        let i = 0;\n        let p = points[i];\n        ctx.moveTo(p.x, p.y);\n        if (i < points.length - 1) {\n            do {\n                p = points[++i];\n                ctx.lineTo(p.x, p.y);\n            } while (i < points.length - 1);\n        }\n    }\n    _acceptLayer(key, layer, styleLayer) {\n        return true;\n    }\n    _acceptFeature(layer, styleLayer) {\n        return true;\n    }\n}\nTileVectorRenderer.DefaultOpacity = 1.0;\nTileVectorRenderer.DefaultLineWith = 1.0;\nTileVectorRenderer.DefaultColor = \"white\";\n//# sourceMappingURL=tiles.vector.renderer.js.map","export function IsExpressionSpecification(value) {\n    return Array.isArray(value) && typeof value[0] === \"string\";\n}\nexport var LayerStyleTypes;\n(function (LayerStyleTypes) {\n    LayerStyleTypes[\"Fill\"] = \"fill\";\n    LayerStyleTypes[\"Line\"] = \"line\";\n    LayerStyleTypes[\"Circle\"] = \"circle\";\n    LayerStyleTypes[\"Background\"] = \"background\";\n})(LayerStyleTypes || (LayerStyleTypes = {}));\nexport function IsFillLayerStyle(value) {\n    return value && value.type === LayerStyleTypes.Fill;\n}\nexport function IsLineLayerStyle(value) {\n    return value && value.type === LayerStyleTypes.Line;\n}\n//# sourceMappingURL=tiles.vector.style.interface.js.map","export * from \"./tiles.vendors.mapzen\";\nexport * from \"./tiles.vendors.google\";\n//# sourceMappingURL=index.js.map","import { TileWebClient } from \"../tiles.client\";\nimport { ImageTileCodec } from \"../codecs/tiles.codecs.image\";\nimport { EPSG3857 } from \"../geography/tiles.geography.EPSG3857\";\nimport { WebTileUrlBuilder } from \"../tiles.url.web\";\nexport var GoogleMap2DLayerCode;\n(function (GoogleMap2DLayerCode) {\n    GoogleMap2DLayerCode[\"street\"] = \"m\";\n    GoogleMap2DLayerCode[\"satellite\"] = \"s\";\n    GoogleMap2DLayerCode[\"hybrid\"] = \"h\";\n    GoogleMap2DLayerCode[\"terrain\"] = \"p\";\n})(GoogleMap2DLayerCode || (GoogleMap2DLayerCode = {}));\nexport class GoogleMap2DUrlBuilder extends WebTileUrlBuilder {\n    constructor(...types) {\n        super();\n        this.withSubDomains([\"mt0\", \"mt1\", \"mt2\", \"mt3\"])\n            .withHost(\"{s}.google.com\")\n            .withPath(`vt/lyrs=${types.join(\",\")}&x={x}&y={y}&z={z}`)\n            .withSecure(true);\n    }\n}\nGoogleMap2DUrlBuilder.Street = new GoogleMap2DUrlBuilder(GoogleMap2DLayerCode.street);\nGoogleMap2DUrlBuilder.Satellite = new GoogleMap2DUrlBuilder(GoogleMap2DLayerCode.satellite);\nGoogleMap2DUrlBuilder.Hybrid = new GoogleMap2DUrlBuilder(GoogleMap2DLayerCode.satellite, GoogleMap2DLayerCode.hybrid);\nGoogleMap2DUrlBuilder.Terrain = new GoogleMap2DUrlBuilder(GoogleMap2DLayerCode.terrain);\nexport class Google {\n    static Client2d(urlBuilder, options) {\n        return new TileWebClient(`${Google.KEY}_2d`, urlBuilder, new ImageTileCodec(), Google.Metrics, options);\n    }\n    static StreetClient2d(options) {\n        return new TileWebClient(`${Google.KEY}_street2d`, GoogleMap2DUrlBuilder.Street, new ImageTileCodec(), Google.Metrics, options);\n    }\n    static SatelliteClient2d(options) {\n        return new TileWebClient(`${Google.KEY}_sat2d`, GoogleMap2DUrlBuilder.Satellite, new ImageTileCodec(), Google.Metrics, options);\n    }\n    static HybridClient2d(options) {\n        return new TileWebClient(`${Google.KEY}_hybrid2d`, GoogleMap2DUrlBuilder.Hybrid, new ImageTileCodec(), Google.Metrics, options);\n    }\n    static TerrainClient2d(options) {\n        return new TileWebClient(`${Google.KEY}_terrain2d`, GoogleMap2DUrlBuilder.Terrain, new ImageTileCodec(), Google.Metrics, options);\n    }\n}\nGoogle.KEY = \"google\";\nGoogle.MaxLevelOfDetail = 20;\nGoogle.Metrics = new EPSG3857({ maxLOD: Google.MaxLevelOfDetail });\nGoogle.Attribution = \"Imagery © Google\";\n//# sourceMappingURL=tiles.vendors.google.js.map","import { TileWebClient } from \"../tiles.client\";\nimport { WebTileUrlBuilder } from \"../tiles.url.web\";\nimport { Float32TileCodec, Float32TileCodecOptions, ImageTileCodec, RGBTileCodec } from \"../codecs/tiles.codecs.image\";\nimport { EPSG3857 } from \"../geography/tiles.geography.EPSG3857\";\nimport { DemTileWebClient } from \"../../dem/dem.tileclient\";\nimport { isFilter } from \"../codecs/tiles.codecs.interfaces\";\nimport { Cartesian4 } from \"../../geometry\";\nimport { Cartesian4TileCodec } from \"../codecs/tiles.codecs.cartesian\";\nexport class MapZenDemUrlBuilder extends WebTileUrlBuilder {\n    constructor(format, extension = \"png\") {\n        super();\n        this.withHost(\"s3.amazonaws.com\").withPath(`elevation-tiles-prod/${format}/{z}/{x}/{y}.{extension}`).withSecure(true).withExtension(extension);\n    }\n}\nMapZenDemUrlBuilder.Terrarium = new MapZenDemUrlBuilder(\"terrarium\");\nMapZenDemUrlBuilder.Normal = new MapZenDemUrlBuilder(\"normal\");\nexport class MapzenAltitudeDecoder {\n    decode(pixels, offset, target, targetOffset) {\n        const r = pixels[offset++];\n        const g = pixels[offset++];\n        const b = pixels[offset];\n        target[targetOffset++] = r * 256 + g + b / 256 - 32768;\n        return targetOffset;\n    }\n}\nMapzenAltitudeDecoder.Shared = new MapzenAltitudeDecoder();\nexport class MapZenNormalsDecoder {\n    decode(pixels, offset, target, targetOffset) {\n        let v = target[targetOffset];\n        if (!v) {\n            v = target[targetOffset] = Cartesian4.Zero();\n        }\n        v.x = pixels[offset++];\n        v.y = pixels[offset++];\n        v.z = pixels[offset++];\n        v.w = pixels[offset];\n        return targetOffset + 1;\n    }\n}\nMapZenNormalsDecoder.Shared = new MapZenNormalsDecoder();\nexport class MapZen {\n    static ElevationsImagesClient(options) {\n        return new TileWebClient(`${MapZen.KEY}_terrarium`, MapZenDemUrlBuilder.Terrarium, new ImageTileCodec(), MapZen.Metrics, options);\n    }\n    static ElevationsClient(options) {\n        const o = isFilter(options?.filter) ? new Float32TileCodecOptions({ filter: options?.filter }) : undefined;\n        return new TileWebClient(`${MapZen.KEY}_terrarium_float`, MapZenDemUrlBuilder.Terrarium, new Float32TileCodec(MapzenAltitudeDecoder.Shared, o), MapZen.Metrics, options);\n    }\n    static NormalsImagesClient(options) {\n        return new TileWebClient(`${MapZen.KEY}_normal`, MapZenDemUrlBuilder.Normal, new ImageTileCodec(), MapZen.Metrics, options);\n    }\n    static NormalsUint8ArrayClient(options) {\n        return new TileWebClient(`${MapZen.KEY}_normal`, MapZenDemUrlBuilder.Normal, new RGBTileCodec(), MapZen.Metrics, options);\n    }\n    static NormalsCartesian4Client(options) {\n        return new TileWebClient(`${MapZen.KEY}_normal_Cartesian4`, MapZenDemUrlBuilder.Normal, new Cartesian4TileCodec(MapZenNormalsDecoder.Shared), MapZen.Metrics, options);\n    }\n    static DemClient(optionsElevations, optionsNormals) {\n        return new DemTileWebClient(`${MapZen.KEY}_dem`, MapZen.ElevationsClient(optionsElevations), MapZen.NormalsUint8ArrayClient(optionsNormals));\n    }\n}\nMapZen.KEY = \"mapzen\";\nMapZen.MaxLevelOfDetail = 15;\nMapZen.Metrics = new EPSG3857({ maxLOD: MapZen.MaxLevelOfDetail });\nMapZen.Attribution = \"Freely provided by MapZen - with thanks.\";\n//# sourceMappingURL=tiles.vendors.mapzen.js.map","export * from \"./tree.spatial.interfaces\";\nexport * from \"./tree.spatial.node\";\nexport * from \"./tree.spatial.splitters\";\nexport * from \"./tree.spatial\";\n//# sourceMappingURL=index.js.map","export function IsKDTreeSplitter(splitter) {\n    return splitter.splitAxisSelector !== undefined;\n}\nexport function RoundRobin(depth, dimension) {\n    return depth % dimension;\n}\n//# sourceMappingURL=tree.spatial.interfaces.js.map","import { SpatialTreeNode } from \"./tree.spatial.node\";\nimport { QuadtreeSplitter } from \"./tree.spatial.splitters\";\nexport class SpatialTree {\n    constructor(maxDepth = SpatialTree.DefaultMaxDepth, maxItemPerNode = SpatialTree.DefaultMaxItemPerNode, subdivision = new QuadtreeSplitter(), lookupThreshold = SpatialTree.DefaultLookupThreshold) {\n        this._splitter = subdivision;\n        this._maxDepth = maxDepth;\n        this._maxItemPerNode = maxItemPerNode;\n        this._lookupThresold = lookupThreshold;\n        this._root = new SpatialTreeNode();\n        this._context = this._buildContext();\n    }\n    get root() {\n        return this._root;\n    }\n    get spliter() {\n        return this._splitter;\n    }\n    get maxDepth() {\n        return this._maxDepth;\n    }\n    get maxItemPerNode() {\n        return this._maxItemPerNode;\n    }\n    get lookupThreshold() {\n        return this._lookupThresold;\n    }\n    get factory() {\n        return this._buildNode;\n    }\n    add(...data) {\n        this._root.add(this._context, Array.from(data));\n    }\n    remove(...data) {\n        this._root.remove(this._context, Array.from(data));\n    }\n    lookupToRef(bounds, ref) {\n        this._root.lookupToRef(this._context, bounds, ref);\n    }\n    _buildNode(bounds, depth) {\n        return new SpatialTreeNode(bounds, depth);\n    }\n    _buildContext() {\n        return { tree: this, lookupThreshold: this._lookupThresold };\n    }\n}\nSpatialTree.DefaultMaxDepth = 32;\nSpatialTree.DefaultMaxItemPerNode = 32;\nSpatialTree.DefaultLookupThreshold = 512;\n//# sourceMappingURL=tree.spatial.js.map","import { BoundedCollection, IsBounds } from \"../geometry\";\nimport { SpatialTree } from \"./tree.spatial\";\nexport class SpatialTreeNode {\n    constructor(bounds, depth) {\n        this.boundingBox = bounds;\n        this.depth = depth ?? 1;\n    }\n    get isLeaf() {\n        return (this.children?.length ?? 0) != 0;\n    }\n    *[Symbol.iterator](predicate) {\n        if (this.children) {\n            if (predicate) {\n                for (const t of this.children) {\n                    if (predicate(t)) {\n                        yield t;\n                    }\n                }\n            }\n            return this.children;\n        }\n        return null;\n    }\n    subdivide(options) {\n        if (options.spliter != undefined) {\n            const splitBounds = options.spliter.split(this, options);\n            if (splitBounds && splitBounds.length > 0) {\n                const d = this.depth + 1;\n                this.children = splitBounds.map((b) => this.createInstance(options, b, d));\n            }\n            return;\n        }\n    }\n    lookupToRef(context, bounds, ref) {\n        const nodeBox = this.boundingBox;\n        const lookupBox = IsBounds(bounds) ? bounds : bounds.boundingBox;\n        if (lookupBox == undefined || lookupBox.intersects(nodeBox) == false) {\n            return;\n        }\n        if (this.items) {\n            const threshold = context.tree.lookupThreshold ?? SpatialTree.DefaultLookupThreshold;\n            if (this.items.length < threshold) {\n                const contentBounds = this.items.boundingBox;\n                if (lookupBox.intersects(contentBounds) == false) {\n                    return;\n                }\n            }\n            for (const v of this.items.data) {\n                const dataBox = IsBounds(v) ? v : v.boundingBox;\n                if (dataBox && dataBox.intersects(lookupBox)) {\n                    ref.push(v);\n                }\n            }\n            return;\n        }\n        if (this.children) {\n            for (const c of this.children) {\n                c.lookupToRef(context, bounds, ref);\n            }\n        }\n    }\n    _checkBounds(data) {\n        const nodeBox = this.boundingBox;\n        const accepted = [];\n        const indicesToRemove = [];\n        for (let i = 0; i < data.length; i++) {\n            const v = data[i];\n            const dataBox = IsBounds(v) ? v : v.boundingBox;\n            if (dataBox?.intersects(nodeBox)) {\n                accepted.push(v);\n                indicesToRemove.push(i);\n            }\n        }\n        for (let i = indicesToRemove.length - 1; i >= 0; i--) {\n            data.splice(indicesToRemove[i], 1);\n        }\n        return accepted;\n    }\n    createInstance(ctx, box, depth) {\n        const ctor = this.constructor;\n        return new ctor();\n    }\n    add(context, data) {\n        const accepted = this._checkBounds(data);\n        if (accepted.length == 0) {\n            return;\n        }\n        if (this.children?.length) {\n            for (const c of this.children) {\n                c.add(context, accepted);\n                if (accepted.length == 0) {\n                    break;\n                }\n            }\n            return;\n        }\n        if (this.depth == context.tree.maxDepth) {\n            this.items = this.items ?? new BoundedCollection();\n            this.items.push(...accepted);\n            return;\n        }\n        if (this.items && this.items.length + accepted.length > context.tree.maxItemPerNode) {\n            this.subdivide(context.tree);\n            accepted.push(...this.items.data);\n            this.items = undefined;\n            if (this.children) {\n                for (const c of this.children) {\n                    c.add(context, accepted);\n                    if (data.length == 0) {\n                        break;\n                    }\n                }\n            }\n        }\n    }\n    remove(context, data) {\n        const accepted = this._checkBounds(data);\n        if (accepted.length == 0) {\n            return;\n        }\n        if (this.items) {\n            const removeSet = new Set(accepted);\n            const kept = this.items.data.filter((item) => !removeSet.has(item));\n            if (kept.length !== this.items.data.length) {\n                this.items.data = kept;\n            }\n        }\n        if (this.children) {\n            for (const c of this.children) {\n                c.remove(context, accepted);\n            }\n        }\n    }\n}\n//# sourceMappingURL=tree.spatial.node.js.map","import { Bounds, IsBounds } from \"../geometry\";\nimport { RoundRobin } from \"./tree.spatial.interfaces\";\nexport class QuadtreeSplitter {\n    split(node, options) {\n        if (node.boundingBox) {\n            const { xmin, ymin, zmin, width, height } = node.boundingBox;\n            const halfWidth = width / 2;\n            const halfHeight = height / 2;\n            const midX = xmin + halfWidth;\n            const midY = ymin + halfHeight;\n            return [\n                new Bounds(xmin, ymin, halfWidth, halfHeight, zmin, 0),\n                new Bounds(xmin, midY, halfWidth, halfHeight, zmin, 0),\n                new Bounds(midX, ymin, halfWidth, halfHeight, zmin, 0),\n                new Bounds(midX, midY, halfWidth, halfHeight, zmin, 0),\n            ];\n        }\n        return [];\n    }\n}\nexport class OctreeSplitter {\n    split(node, options) {\n        if (node.boundingBox) {\n            const { xmin, ymin, zmin, width, height, depth } = node.boundingBox;\n            const halfWidth = width / 2;\n            const halfHeight = height / 2;\n            const midX = xmin + halfWidth;\n            const midY = ymin + halfHeight;\n            const halfDepth = depth / 2;\n            const midZ = zmin + halfDepth;\n            return [\n                new Bounds(xmin, ymin, halfWidth, halfHeight, zmin, halfDepth),\n                new Bounds(xmin, midY, halfWidth, halfHeight, zmin, halfDepth),\n                new Bounds(midX, ymin, halfWidth, halfHeight, zmin, halfDepth),\n                new Bounds(midX, midY, halfWidth, halfHeight, zmin, halfDepth),\n                new Bounds(xmin, ymin, halfWidth, halfHeight, midZ, halfDepth),\n                new Bounds(xmin, midY, halfWidth, halfHeight, midZ, halfDepth),\n                new Bounds(midX, ymin, halfWidth, halfHeight, midZ, halfDepth),\n                new Bounds(midX, midY, halfWidth, halfHeight, midZ, halfDepth),\n            ];\n        }\n        return [];\n    }\n}\nexport class KdtreeSplitter {\n    constructor(splitAxisSelector, dimension = 2) {\n        this.splitAxisSelector = splitAxisSelector;\n        this.dimension = dimension;\n    }\n    split(node, options) {\n        if (node.boundingBox) {\n            const { xmin, ymin, zmin, width, height, depth } = node.boundingBox;\n            const halfWidth = width / 2;\n            const halfHeight = height / 2;\n            const midX = xmin + halfWidth;\n            const midY = ymin + halfHeight;\n            const halfDepth = depth / 2;\n            const midZ = zmin + halfDepth;\n            const axe = this.splitAxisSelector ? this.splitAxisSelector(node.depth, this.dimension ?? 3) : RoundRobin(node.depth, this.dimension ?? 3);\n            switch (axe) {\n                case 0:\n                    let center = node.items?.data.map((item) => (IsBounds(item) ? item.center.x : item.boundingBox?.center.x ?? midX));\n                    if (center && center.length > 0) {\n                        const splitPlane = center.reduce((a, b) => a + b, 0) / center.length;\n                        const size = splitPlane - xmin;\n                        return [\n                            new Bounds(xmin, ymin, size, height, zmin, depth),\n                            new Bounds(splitPlane, ymin, size, height, zmin, depth),\n                        ];\n                    }\n                    break;\n                case 1:\n                    center = node.items?.data.map((item) => (IsBounds(item) ? item.center.y : item.boundingBox?.center.y ?? midY));\n                    if (center && center.length > 0) {\n                        const splitPlane = center.reduce((a, b) => a + b, 0) / center.length;\n                        const size = splitPlane - ymin;\n                        return [\n                            new Bounds(xmin, ymin, width, size, zmin, depth),\n                            new Bounds(xmin, splitPlane, width, size, zmin, depth),\n                        ];\n                    }\n                    break;\n                case 2:\n                    center = node.items?.data.map((item) => (IsBounds(item) ? item.center.z : item.boundingBox?.center.z ?? midZ));\n                    if (center && center.length > 0) {\n                        const splitPlane = center.reduce((a, b) => a + b, 0) / center.length;\n                        const size = splitPlane - zmin;\n                        return [\n                            new Bounds(xmin, ymin, width, height, zmin, size),\n                            new Bounds(xmin, ymin, width, height, splitPlane, size),\n                        ];\n                    }\n                    break;\n            }\n        }\n        return [];\n    }\n}\n//# sourceMappingURL=tree.spatial.splitters.js.map","export function isFloatArray(input) {\n    if (Array.isArray(input)) {\n        return input.every((item) => typeof item === \"number\");\n    }\n    return input instanceof Float32Array;\n}\nexport function isArrayOfFloatArray(input) {\n    if (!Array.isArray(input)) {\n        return false;\n    }\n    return input.every(isFloatArray);\n}\nexport function IsDisposable(obj) {\n    if (typeof obj !== \"object\" || obj === null)\n        return false;\n    return obj.dispose !== undefined;\n}\nexport function isValidable(obj) {\n    if (typeof obj !== \"object\" || obj === null)\n        return false;\n    return obj.validate !== undefined && obj.invalidate !== undefined;\n}\nexport function IsNumber(value) {\n    return typeof value === \"number\" && !Number.isNaN(value);\n}\nexport function IsString(value) {\n    return typeof value === \"string\";\n}\nexport function HasToString(value) {\n    return value !== null && typeof value === \"object\" && typeof value.toString === \"function\";\n}\n//# sourceMappingURL=types.js.map","export class DebugTouchConsole {\n    constructor() {\n        this.touchMap = new Map();\n        this._onDown = (e) => {\n            if (e.pointerType !== \"touch\")\n                return;\n            const dot = this._createOrGetDot(e.pointerId);\n            this._updateDot(dot, e.clientX, e.clientY, `↓${e.pointerId}`);\n        };\n        this._onMove = (e) => {\n            if (e.pointerType !== \"touch\")\n                return;\n            const dot = this._createOrGetDot(e.pointerId);\n            this._updateDot(dot, e.clientX, e.clientY, `${e.pointerId}`);\n        };\n        this._onUp = (e) => {\n            if (e.pointerType !== \"touch\")\n                return;\n            const dot = this._createOrGetDot(e.pointerId);\n            this._updateDot(dot, e.clientX, e.clientY, `↑${e.pointerId}`);\n            setTimeout(() => this._removeDot(e.pointerId), 500);\n        };\n        this._onCancel = (e) => {\n            this._removeDot(e.pointerId);\n        };\n        this.container = document.createElement(\"div\");\n        this.container.style.pointerEvents = \"none\";\n        this.container.style.position = \"fixed\";\n        this.container.style.top = \"0\";\n        this.container.style.left = \"0\";\n        this.container.style.right = \"0\";\n        this.container.style.bottom = \"0\";\n        this.container.style.pointerEvents = \"none\";\n        this.container.style.zIndex = \"99999\";\n        document.body.appendChild(this.container);\n        this.logBox = document.createElement(\"div\");\n        Object.assign(this.logBox.style, {\n            position: \"fixed\",\n            bottom: \"0\",\n            left: \"0\",\n            right: \"0\",\n            maxHeight: \"35vh\",\n            overflowY: \"auto\",\n            background: \"rgba(0,0,0,0.8)\",\n            color: \"#0f0\",\n            fontFamily: \"monospace\",\n            fontSize: \"12px\",\n            padding: \"4px\",\n            whiteSpace: \"pre-wrap\",\n        });\n        this.container.appendChild(this.logBox);\n        this._hookConsole();\n        this._hookPointerEvents();\n    }\n    dispose() {\n        this._unhookConsole();\n        this.container.remove();\n    }\n    _hookPointerEvents() {\n        window.addEventListener(\"pointerdown\", this._onDown, { passive: true });\n        window.addEventListener(\"pointermove\", this._onMove, { passive: true });\n        window.addEventListener(\"pointerup\", this._onUp, { passive: true });\n        window.addEventListener(\"pointercancel\", this._onCancel, { passive: true });\n    }\n    _createOrGetDot(id) {\n        if (this.touchMap.has(id))\n            return this.touchMap.get(id);\n        const el = document.createElement(\"div\");\n        el.style.position = \"fixed\";\n        el.style.width = \"30px\";\n        el.style.height = \"30px\";\n        el.style.borderRadius = \"50%\";\n        el.style.background = \"rgba(255,0,0,0.5)\";\n        el.style.display = \"flex\";\n        el.style.alignItems = \"center\";\n        el.style.justifyContent = \"center\";\n        el.style.color = \"white\";\n        el.style.fontSize = \"10px\";\n        el.style.pointerEvents = \"none\";\n        el.style.transform = \"translate(-50%, -50%)\";\n        this.container.appendChild(el);\n        this.touchMap.set(id, el);\n        return el;\n    }\n    _updateDot(dot, x, y, label) {\n        dot.style.left = `${x}px`;\n        dot.style.top = `${y}px`;\n        dot.textContent = label;\n    }\n    _removeDot(id) {\n        const el = this.touchMap.get(id);\n        if (el) {\n            el.remove();\n            this.touchMap.delete(id);\n        }\n    }\n    _hookConsole() {\n        const original = {\n            log: console.log,\n            warn: console.warn,\n            error: console.error,\n        };\n        const append = (prefix, ...args) => {\n            const line = `[${prefix}] ` + args.map((arg) => (typeof arg === \"object\" ? JSON.stringify(arg) : String(arg))).join(\" \") + \"\\n\";\n            this.logBox.textContent += line;\n            this.logBox.scrollTop = this.logBox.scrollHeight;\n        };\n        console.log = (...args) => {\n            append(\"log\", ...args);\n            original.log(...args);\n        };\n        console.warn = (...args) => {\n            append(\"warn\", ...args);\n            original.warn(...args);\n        };\n        console.error = (...args) => {\n            append(\"error\", ...args);\n            original.error(...args);\n        };\n        window.__debugConsoleRestore__ = () => {\n            console.log = original.log;\n            console.warn = original.warn;\n            console.error = original.error;\n        };\n    }\n    _unhookConsole() {\n        if (window.__debugConsoleRestore__) {\n            window.__debugConsoleRestore__();\n        }\n    }\n}\n//# sourceMappingURL=debugtouch.js.map","export * from \"./objectpools\";\nexport * from \"./text\";\nexport * from \"./runtime\";\nexport * from \"./debugtouch\";\n//# sourceMappingURL=index.js.map","export class ObjectPoolOptions {\n    constructor(factory, maxCount, clean) {\n        this.factory = factory;\n        this.maxCount = maxCount;\n        this.clean = clean;\n    }\n}\nexport class ObjectPool {\n    constructor(options) {\n        this.pool = [];\n        this._o = options;\n    }\n    alloc() {\n        let obj = this.pool.pop();\n        if (obj) {\n            return obj;\n        }\n        return this._o.factory();\n    }\n    free(obj) {\n        if (this._o.clean) {\n            this._o.clean(obj);\n        }\n        if (!this._o.maxCount || this.pool.length < this._o.maxCount) {\n            this.pool.push(obj);\n        }\n    }\n}\n//# sourceMappingURL=objectpools.js.map","export function Assert(condition, message) {\n    if (!condition) {\n        throw new Error(message || \"Assertion failed\");\n    }\n}\n//# sourceMappingURL=runtime.js.map","export class TextUtils {\n    static BuildNameWithSuffix(name, suffix, separator) {\n        return `${name}${separator ?? TextUtils.DEFAULT_SEPARATOR}${suffix}`;\n    }\n    static GetUriExtension(uri) {\n        const lastDot = uri.lastIndexOf(\".\");\n        return lastDot !== -1 ? uri.substring(lastDot + 1) : null;\n    }\n}\nTextUtils.DEFAULT_SEPARATOR = \".\";\n//# sourceMappingURL=text.js.map","import { Observable } from \"./events\";\nexport class ValidableBase {\n    constructor() {\n        this._valid = true;\n    }\n    get isValid() {\n        return this._valid;\n    }\n    get validationObservable() {\n        if (!this._validationObservable) {\n            this._validationObservable = new Observable();\n        }\n        return this._validationObservable;\n    }\n    invalidate() {\n        if (this.isValid) {\n            this._doInvalidateInternal();\n        }\n    }\n    validate(force) {\n        if (!this.isValid || force) {\n            this._doValidateInternal();\n        }\n    }\n    revalidate() {\n        this.invalidate();\n        this.validate();\n    }\n    _doInvalidateInternal() {\n        this._beforeInvalidate();\n        this._valid = false;\n        this._doInvalidate();\n        if (this._validationObservable && this._validationObservable.hasObservers()) {\n            this._validationObservable.notifyObservers(false, -1, this, this);\n        }\n        this._afterInvalidate();\n    }\n    _doValidateInternal() {\n        this._beforeValidate();\n        this._valid = true;\n        this._doValidate();\n        if (this._validationObservable && this._validationObservable.hasObservers()) {\n            this._validationObservable.notifyObservers(true, -1, this, this);\n        }\n        this._afterValidate();\n    }\n    dispose() {\n        this._validationObservable?.clear();\n    }\n    _beforeInvalidate() {\n    }\n    _doInvalidate() {\n    }\n    _afterInvalidate() {\n    }\n    _beforeValidate() {\n    }\n    _doValidate() {\n    }\n    _afterValidate() {\n    }\n}\nValidableBase.VALID_PROPERTY_NAME = \"valid\";\n//# sourceMappingURL=validable.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from \"./types\";\nexport * from \"./validable\";\nexport * from \"./events/index\";\nexport * from \"./geodesy/index\";\nexport * from \"./geography/index\";\nexport * from \"./geometry/index\";\nexport * from \"./map/index\";\nexport * from \"./math/index\";\nexport * from \"./meshes/index\";\nexport * from \"./space/index\";\nexport * from \"./tiles/index\";\nexport * from \"./utils/index\";\nexport * from \"./cache/index\";\nexport * from \"./dem/index\";\nexport * from \"./text\";\nexport * from \"./tree\";\n//# sourceMappingURL=index.js.map"],"names":[],"sourceRoot":""}